From cd34fdeeb6d4a7c3038d64ee90cb8f4e64d0eb78 Mon Sep 17 00:00:00 2001 From: do-me Date: Tue, 26 Mar 2024 07:14:51 +0000 Subject: [PATCH] deploy: 1e7a061c882382c560010e851e63c62ddbdbb0fd --- 16846ff81b40a23cea21.wasm | Bin 0 -> 155825 bytes bundle.js | 3472 ++++++++++++++++- index.html | 91 +- main.css | 245 +- src_js_worker_js.bundle.js | 261 ++ ...dules_wasm-bhtsne_wasm_bhtsne_js.bundle.js | 32 + 6 files changed, 4043 insertions(+), 58 deletions(-) create mode 100644 16846ff81b40a23cea21.wasm create mode 100644 src_js_worker_js.bundle.js create mode 100644 vendors-node_modules_wasm-bhtsne_wasm_bhtsne_js.bundle.js diff --git a/16846ff81b40a23cea21.wasm b/16846ff81b40a23cea21.wasm new file mode 100644 index 0000000000000000000000000000000000000000..72616d59277a2190a44002792747fcfb8e68776f GIT binary patch literal 155825 zcmeFa4V+%pUGKa1+Rxj}Gm|`l03j2~+M56qNXkqynVBHM?1Z;8yjiiLZO!WhI+Fr< zA<%n(3@y;KMN1*rcx~^^Ii-S?9@~pky*ZQyj`oFEWX!GuO$59l;e;KEn;(gI3w=ev}`|$FU?Aup5 z(WZ!i3IQak$tly`p|p2ysun>}RD6=WZedDj83`$JcErVZY-$wANLS_{L2{>69^XL< z8ghr4#}Ad=p&IT8#hQcn_TV)KFL_m|IqnV>5#Ju)?hZH4Np9V8{o;)qZ{6~)8@F9Q ze&fcQwoHs~-LrAquA6S&xNCfS6e+<;9SLr{<=tDxcWu0Wd`}d&Ghe^)#_?M>Zr-wO z^T_b{=;*2~n@2aV-X7JIV2Ltczj61T&08lo4zC_vIkIN^_|VYmp~0=&heH`flJQ-; zZrZhR`{?Sy;o*_Z+eZesY~8-KNOEQ)`6qRjY=#h2qW%X=&nHE&1Cv@3>`r_r_Ht+c&S=x_Qm`(D(qKTSDT~LgKBv-gEPw zn>KD88r?iHGPGr2<;ra<2R3hw5_Msr(i8xC*X{yFA?i&b`^~#<+B&{__r{fLMn_f+ zZQZ_d_3F)|qpP=tM5l*Dd&hU}e%DPm?%p`Qa(rZTd~ns!_^R>M+Xe4i zR}K#hg@zQ++`4(kj*VNl46g>?wyjycZDere=*n3sc8~AazHxB-_Q7o!$OhPDkBX-=8l?^|x%HopB`H;xxrRG`|scIUfx zZGO+jp{*;2wyYXjwROwjs;%3%%toS{Z`pmr#;uzNw*nAgvwh9L2*_*$-3ge1L9lh( z`0CZ$h6l$72e(BPp+eErEw^mn&P*Q|T|K^aaQpC@p@G5CtwYUBD3k0&UA6&V5eAVFS`0&c1)#GI^ ziv$$4arIW(y>iv);Na@P(Un_QMOC%#4b;45aLp=8-Z~17j;vXEOwHQ{XwdL5a9=qL z42v!;oza2P?73mrO}7S$wV)&T-Q(}RY1eze#P=n4 zC2``SimS9LjT0J;MjZZ&s{B`c%V{*6iz|(&J3cY#jog9-(ZZ-0LwP;=h zrbN{!syPDmpCa^M9G4+3ISG$*^?E(3Hj}s+)nopz*ONGkT^!e_rCN>RlcQ!FQ&e2- z>PiTYyZFSZ#*T*6U5~3cnoR|iOn8)7Y_)od(kP@7(Xnb0_w@8EN}`CsUNSf(Cr=#B zj}qD;f0U>k)l847QPs7QQ~R2|r@5GX^{5ubl{iUUayo5H+77dwDi%lqpW~BI=X!c#N+6gZ;%Z74*L>2g|DtN89^V}Q41Y8?T2SkPIpz$W1D@^K4JK^g1#Ny?!@fm|f6mRfZ}93ySk?`Jzc^0G@vF8S6SoHtK zvrqsEchlDBC*27hc(H3dgdTEMTY-dD+kbbR>}>qD8^O7oc8y0zT-RsmeI7SI89(Yi z;ck2={$Tup_`UJFKNRne55(_}e>OQ}f1h-}7vHgO$L>vgwoJu4@BBpaNA4Hn_a*O( z?~NabAB^vhKOBD~e%B56#GgnGCif)&=x+aW^8UH|+2sFnw>(ebUvM9DRFV8FzmF2E zfA3HBC(p$HKK^z0Q44#?{T87QC;W3C8@wcNv&$z#Hzu$&Ha`8iu+6V zKivQ0emj0EZBMTK$@nkgyOW=Y|9jm1t5c1;l83(E<@@^XJR`~54HIe2x zej;7#qkiYJb3QG1X?E_X*ZOZqF`zBwg;;t#!9&7eA7&;48j8TlYx%W`EgQ zzyFc+Jb$sd1H{Nb=v{ueI*~5KeG>O1+(&Uw#(gE8NKe6i8Fvxx^SGzt9>!ga`y_53 z?kmwmx&-%S+|zKM$9)s-VcgU6FCKaNL$!2e{&$D(`l%#cm4D_>_WyQ09m>D_TX%h- zmafig=`!`AC+kUv_0h<>(h+@BvhH+LA5qp!*Z7{)`>r(g-D&2V=^6N!;y)ArS@?Sa z%%X{9Nt9ijZt&5vq?N5pukaVAm-}_;dfd0*UPhvROLU1kpEc6+{UwiNN&0=hk)G|7 zbRKR$?ukX~E+|_6{YC39ELwk25kFS=D@A;@NM9@B>qY$hBED6`FG$9K&)8&kg1>0k zMc(a3{*d3I6_OLr3ciynO zU+&ug%!u-J9Fp|6|_ll9^ zdAXO5B+toRKaw1l`<9VpTJB{d$&+$>XusSp+Ap`8_RDS3e!0W6U+xI)mpe-P<*uRq zay{*ro6>%{8SR&Q2JM%-l=jO#llIF!YuMe6(>v^L!&yD-_TUT+yPI)V4Z9sUD~H_; zI2R1NZ8()-w+W{@?B0P>8+O;>)Q8=*IP-_yH8`zdcLmOZVRt#s*s!}8=fYuk0nYai zyHSShV09wv$`ZdMpN?7|O*9K$tW0DT0vZ#UU*@8bM8mnnzMiiTKSg}ip8#rxD7P#b z9Z6nEh#H;9Qk++kiL8eEJSpp~57SnEvWlDEF7D*AxT-&0FUYkpo zw_|PUt#5m6roN@^wTWir*7DlCG^%S}o5n_b&C9G${3#_mRrmzTXSShy$_)Jb6mwQP zrmuv5UkU$;pA%yiD_?Ir-{Lag;+cGNBFm}DcXm79sb#)XXY$R7CySJCUOV5SGT)*y zpN*HO#EH{pjBF6}vPC>f1el_TM+s0` z(I-%a2v9{4MmPu(Ap=*409O=Y6o;S}E#eRnAd4an6-6Dfh{uTlTNLrQA_BI^D^e7Y zMLr{30a@fVIv0>dUL%VES>!dU7LY|=BZ2{009L6p&zftF_{SS8LH#Sn_7vZ1DE*^H( zNP=kLuN;vCBk@^MC(<-Hj8hpdipe(&gGEo3 z8%lJDgx^7AU4-pP6Q;f=`F*XD-**$KkaY7s>92!S%q{(WCzFb07^E^JAW3TXWLHXF zkl-YND??zC;C4@Tl?5X=Nj}R=D3tnkwFM6=`1v?9kx`oCH5Lrhm2{Vx)F&(JMyY z$;IIJqFgL~FUZB@_q<$eexH+z(eF9ASpA-ri`nn6T69x=r(9V&<;v12cLaS=t}LB$W$BbFOQ&2}I_1jJDOZ+Gxw3T1m8DZImd;mI zFQ(2{80**0WL`^Fw5y0oRbd%~Np_)Iig(?G zjDrj~EST`UpP7;0M}Z+lWKpc35cP_xeU(x>qqL-Qp?g_TUz!!g*qF_CV1lSu+(g!B z{Rv~%?*^pn^}8XdcxFV7@@Uw#XbNc4z+p9oTzvV4PbTxq-i(Mv z=56|J3rKw88yotD-9k#}SFKMb6Gffq}V>M}%+HfwQwj^Ju4m}f0`9M-t0%JNdH>?`%-r1;F@0=0fF%|_F;ES_pePvAD zm<%I+0Yz2zOr)7&(Ht$+-SI>gS@0POzJ~NT*Or08Q2aMfkR-FuZ4?xFi6XDg%J-=GoEFpO zVGk`y3NcSsROT{&c4y#=)saMv&Z#MbjoD;`4QYZzs;}3ur!2P@{GX|Fo=-c=I$TuH z-x+u$RB$55RFtP_Ia8iyLfMC9zPmH)RL$Bp&nKOs_Y*qmJIWiKRh~#qSzZrN0N1;; zQrzX6Vxdh~sOCT2h+BVav}hsh)d9UM7D}};CRYXUYU;T?6PjO+Mdyj7(fnrq$TK`n*ePIcrJ!sOGKk5$EKy zPikUSn~e>(Q*+hVCMG8HTX*KkB#ok38~S{7Wp9lVD-$7WC4czmpVnINCB4-=@|DRn zar^WEdaUn_7U!q)`Pyr*)i>bbv&O&1-s`hya&I2*q@Z}uWPag9GpkW`zW=eOBT=y| z?xjs>#J_5fYvvGS)mXH#I_aYgth%TVm7<^fz~{Wvm4Mt2vBbrp5J#_R2gGhL?JNK(h&dFXReO~ks#BT#zZTn z4J-|4eLO+3i(A(h&GyNLUi?IS72(Gxt1k4vwczxfS+uA1rxJOhJv#+B0eM!fNl~jB zY#j=<;tjRN9krJIqi$E!4d4YMIUi40qgC;YMdoIKOyqn{h=G44%;FB1k={U7_LgDW zrAbw9ru;|@6`RB9(V|RnXm6uwV#r3F#o9J*(VNm;r{{Y$7=XcV-@xnBjyOrl53S z2BR+o5oT!Im?!19X`%r9n2FN)*V(5H0Q9kP&il%SUg*8iG0G^Ya!KVTAi@ z$pO2SD12EM-H${BTtN2*v@?uEF&CK0?1Z8O0fZk=)08+Hk|I;Rspd40jh<9OzS%)! z-&6*-QxQ+85&BWPDMckoii-jy^Cv^(SWG+0Mi2JLFDVp^rebiS#B0zS=pz)(l!|K23T2>fwaPAN|fl}8|w|gh@=x~ zT(m}wq(!uvQbk{j7R5B^sJbszu|;pvu6BNMcUf-XuJx=7F$q59T zNI^hUtyoSZC+GJw?h;~2FweJe@&kmJvXtMaFR5gf$<#DUFJ0JB zB^M_FCiI|^NtEz4Xs6)WdueZ7j_;bxq`*WZZ2cGDSkMuLOfrKAI4&J2x$?h2M_Atz z0^uMEii^lGIwAxGb4->9I;Q*;P)t+Xh5}eg+=0N&3`{Bo6fjO|o07>Ju(3c5MLJ`` zndS&_lWC>IIUn$|lrJt79j7X!q&&W?x9Ws_Q0;2b{it=lsGM|On=pI@fg%=~Gl=R1 zTqRILH-u z+8Jyj7E_82M*>iLHlRFEUlP!k2|Ae>BUf@+TKJ)rvyj%6NDDa)K(|DOKpA6kKNOi_K z67EX&79Am=HCd)c5~v&>g(WUau>2QLn5GGZae64-2A^S4V9_QB@L{$5wbKQH*Po#e zGiyyeRMN-fk=QDa+;+?p@;q9^$ZaQkN}k7y7`g3a&&cy+5hJ&q>{)rHix|1>WS^7g za1kT7o$Lj9o-1PHwv)Xi&+|o$+;*}TJ7c~ik3!VBmpeUQmPa9qInwEQRUU;X=9Ny* z-T#pog(zmK({rCZ3Q^4dPR{{(6rz~>J3SwhM_b)_LMx27cp|%$)1tt$s$H>JK3}HOcyb7+sQsB&*36QZadiv@;q0>$ZaQkNuKA6 z7`g3aUy|p=B1UdI*_Y*cxrmY5PWGxiM~WD^?PPZg=U*veGxhSu278!MfM3)CLDJzA^RctNr zN7!>CO%f_NhqRb}<(%j%a!z>gofwNwc)%}wr}Qd_aYYQ#$&uQEg$OGxO~u+*y{y+n zM*)#0bZ_YGHr|K%DLY9A2Tqo)Jt9wNQ(f((RY_%RT@+1SY1Yi-GCBgQ){?ufH711?W53R4FTEvo9 za(G=o4i;!}JL$&qvbvu)h^HB?`0>8#t~v@qV)B>7tOymoXCGAhvx zbZ5!fy?!1zg9zF0me6B*N}tTzYI_+e#rFi8_o5V=VCrZ=#Ri8KpwUfaJ#?6!Mi(6j z!!s32T4k@O;=3mVj+rFc3HLFo2!uCc3+kIapy>6p2DAZ~WYuQ?uuI~2;&BEThg#UY zU(-U|9(>5FH{&2m?*|xKmb+UnGQbqBtg`AOI&pp^LaxrI;)&LF6?R3&#K81^X=NdGO(izM<3^<;`|{T#b?NkDNpQ7A&l z8uWTw(ZEz8{p2omliO^025DDRvMcvcBBL@Gm3p!yB#}^@U;!~p6QcTo1SO+xREt7e zACP5DkV!G^;9gG0X{(^NXo4?0xxmCGg#bd+uV6qIpszL&Fqz~@{`?20qt<&>EXyLn zcb9w`-j_S#s==qY{QeJ3NBODwD~gt}SQYfEmAK1ONQ?Z zSPRAnv66*H6B~H;n|pqAjodJ&)S+XF%A?D`tcvQKDKhRXQe>tEEf4hl)AhKz4`KFy zPcpz^W+aL6t|aWOkC-;kSlRGLtyi7qHAXa)au0`S{cq$fl^lqH3_PafB$r`xk#KF~ ziljs#GtV~*oNQv~CT2AXBJ@%Ek3bakpQ?r$(~~4&PVW2okPzb(>Hw<&rp;J7u~_4?fJTOZGF_o?v_XOyLfv!% zEu0ak(ZZzA8(dKOT%q)dsuoscYhl@G%5K}tI+VVdPOGodSK77Cf<3lL>yhv%q_D51 z83WXOcQs6=5OShYDQjC2lDsr=*qVh7W8N;F;@!-eg+PQE3A8JLtk2^X8AE`fCMEnJ zUm%A@94iI(NSP;5AX&{wWSqNwXNICR#Tr4|jMQNeVgiAPbfaz1iRUutly<2A>cu@# zv-R(C@OKiNE!$B7a$Oc+XfrlFx6dcbBduRVS81Z~eM;~Tpyr7Kf9QbH?hdv;m+o3#)ufuV;06`5GVN`Ar~ zhVw|YQ>7>EJiBBInR+IYr34NCt?^TCKGs5T$F9NG+EQTDaIoAklk zB>3_{c(;~~N>Q~25g(eaNW5Ou;JJlI6GWv^5C}0oU2L zp!z?%?=6S}%Nd;V%eB7}`=Sg%(S{sLN!{d2Nz=0nv1DM0S!d8pEE#~;*kR(D%ql4z z(4UW1L>~SN;Pd1%WMD99o{M5E5fMWKa;d=x7<(y9a)!QYS{Jb5Wefx(sSli80zPQ| zq>HGX$KNBB$6@#4K$CQR}L?Dh*7of&4BPN>kP5;_M%vUkQd=*2?S24t-3|dVir}Bo4 z9bk+ANJk;5k}(F7TxK*4Y+ZuBH(H=3-@X$rR#eRJKq%B~ zy+T=89yJ*BTOx?dr*Y}{bbK|6ocgbs%p#kVziR$!yc0@f_-;Tzm?IME1>l^DkrV^8 z7^}=yUh8}5NNw+~{I2)j-Pkz+91W$87g?}Ut=S%%voN#H5eb~6mS)JFk_SO)48PXB z1`wkKjlKD6cfDHQ$)~v!h@_PrEFMWH0uhC{CT_=kEe0&stt?hQH1ujsG}8|%su`>o zd$0(6oGX!<1DF|+A{FZ}#})<6go&zoOSIyDOzXs*4B*D57!Tw;n39N&urL;}iGe)4 zr;UMp6&T1@fq{G#7)VNCAPpA=h6PRJ)@XJiKqV3e3VL9m3y9kMm3llca5IF)2$dr< z=`rgSQ=2CeV0=wYR`aN20{sx}QAC55H)y0W049HB6s${TT38npDzL7a z7=RN;YUJ?B?jo%*FR8)1K!66*9F0*Ng|cA*frlw+ZHBRQuZSYCFUvKoul;5^AYFyYC9EwS{chAd*SX zSc{ND1w`trX_ue__H>~xYX?neJ`fP?EdOXM>MtFe%v!z`8ap{Ji7SyYqptj`B=@zp z8q*`J0Q2TmYgHH)K;lSR{!b(l;1a&SqHn@0e5)?W%&GufsAP$KB2%030QgPC>w7Dd zp_R4Q=3`gU4uYN>YS%~pf&BAKR*=W-*_+RYSLEI6xh2AAgUZtssO4}3U%R?b3M!1p z8@e+u3=B!GQAXrlk6a;@vrc9iZ5oqW4Xyj`tl{UE;*bpsMCPdnpN?8DOY==^k_U!7 zd&r~?7el7OpwMD4NY)+<=&rQ`=adoVg<3N87NjqA&`q$6e|V>3|H7hR`YOx z1}&kvbgH5D$0Xr9!u(mXqX^rZy72(JpO}Fq(jp3%t9x~I12f7_X0rx0t065=&Wgxq zF%>75_OT=^@hWy8;_KI8lRp9ywE!2G$zB?TV-gsPc|}i335-1zlEBO=6{V3)H`SKG zuV@7AlnHLO1QtWnf^e=BwT>R*1zDBF1Tv|1vD?Rxpm+E>WC9KtAbC{D3Z4Y1*N0|X zo4~W2?bb^S6zpTLp6BuTkq^Z%*4F~aP#0imbsW`~TFxHXIr_rnq{+lslOwv& zV^wH#?Gh6rAx4y{RJ2Q}n*UgdyZ2#L8$eRUs+Q!*`BA@5)?%1& z%(Oi?(&k(To9hN`ptWJIP>^wGA|uA?_8zzroKmXqYeup(*|lXRjeuy`cNvVdYuI2y zBeiw7=nL~(at4jSdMZT6!$_i1p^gikWmZWM>(I4L*w;*w$woVk07PEhlWGt`6Hu0z z19P+>p49>Maagb3LDC^k<4uaVu?rFYwU7lZ05 z?ZO$yWmlSPn4vrQPqKc_W>|X0|7aM(5>?8MGB$Aw>@Dgr=?_#a3pG&CucA;UnH7q} zZncF%!D1^^^e@G>Zlx{3!8W@{x-9WzWG@XL1&{%rAS|iTKr4prx$z_jkA-aqE?R<2 z!wK*^}mWO&7J#|r(ZAkR6Dov9{|SE5PbL2tYX`PKxJ*+kbY%*Geg^C zGj4vOl2lo{itnT|I$)8tuIY{RZEGur?q;542*TQlN8>SG#E=ZYVMVugU}S;#?Z~>M zz;}~$sqiIhYCQ{vpnt47h_;7CqHeVDM}uO~bwl zM*DIJjmAj>>!Jacd%o8?%KVLeX>Sl)RRWCBN&r|rPz9%Uve@#GhkndxM6f?+SUDuu z7nW=lEQ_?249FnPfiZ9?&k#k+qOG#Ab6eq(9_#BOEuzgc=YfZ^Uf+7+03E7RVOUoI zyfQ`rV3|~C!-2Gyreh%rZK~pgHMKBk ze5}XS_9b@B7&(|;)ClgH=?VI6I*s1H$1jRd8;g&sZ6^$pPtUv95|j z4Oo^e8nLA*=;CtYHj^@UYLyBY=%4oJ?Vyeq*w;j?-9^FpPY$Fc~Bn;XmWj zdYo;YHb|K@cSE0cn%bJ$LUke#DVEbTHn1h_drJg4ZgR_H%xa(a01qv46Lgpf7J(>{ zohd3hFZNpG1}ye9;3NbgF<@5#1X)8$QEBV%M(|YRrwCbhSHQpsND1PA`{59j(;{`*R!6nKF5sVoGls(*DuZ^Z ze*xhH&#_6(KamQ4`_QT99F9HcvN6Xt8)~vgm}GI$Czr7P@@MkRJr~ zi{c*T(>7rkk`L&P3QSYQf-7b2m;C&&O%()>Vx}B2|H5Le$FOHgJb+=i9Y>M`w>Y`6 z{HcebHTQyfNP4YblBi%93g$cq@vAJ2L{-|Uv{q$^@Ni5ri8joe)`dn@7=~xHSPAwr z^{=3W7ok!hANkpqLp>C}05GW#D!PKfFR+4kV;tO7mVntvlZHz;@@nf>VokY5>k(X` zI)N_~Yohsc^pc|El0q1+JQ>?nClGtqoIk>-(+*gy#FPW~PDlA~X!N)pF@Hh6r`}Kh zr&<3bex}L7*+X#Z%=hpPkhM_Y6IFPTi${9X-$-2e+&%p6J$vwmkZ{dWSvYKmYi2l%J75bw3@_g6@+G zT$8)Pi%zw+?oy9GLp;XLujU~MqkiUceFf-;LJ{}~S zVzCj^vd#mVvotsoDLEZjljwG1*;Z#4br!InP+2XEEiAzk!%oe!5RV-egvu$~LX=jEfQ~U>J;hcYY@OmLqAJK# z{Bd4WRgbAG=}0OP1j3pQH@N`dBIx!)30UwSg1+M{MRdUNkV>3I@Od1RA~}^5JyXXS zAtgH8SVv3%om6bMxR59)SQkj-1ZE{wR%ceLSz;e}5mO*4$y#^Y`QF-R%df_1<1>=hS2;LW}0z`7`!-p3Du z52-4dZCYAz&@b={-qANZvXPmLRz?!t{rNL4_-M93@?wLUf)yL>OLRc2Qt1y+6hX)u z3OW$>A3Yc{QKKXieSio`Yx zjoDU^A?$Qw@_vF?xu0Q=B`2MVHH{#MF+&}T=x1#HG5i(6z(RTARNzMizNF z`C-M{10?BUN~2haJ!?J~s2QRlO~e8|Ds1UR{87Y!pAYmyl9q3F#x4@q zmgo}p`jx#f;)MajM2g5`!WX_-z~v)QEoi+cn@znY+ElwMO}f(Vi1seFyU~=4(Nf)X zvB~IjLuBcJ26uEXmJCb(YP!uAeQuT%Aqi0;`#{;}AR)>OZDLAWBJmO>dI<)diymW` z6Al+XZQlY(3!jM}V-7uL%b$-9r|y= zD@>Zh#{u$I!=@3g5FwK|BekfLpW~A{^eK)no!-sJBwBKrkz6XpM8)o=L(1{&L{^+Oi+meOq#&pyNm` zYH}5v2$GAfoJewknUsC&`6{0rf!EA;VaNESOf@I^QH0x<9An^3<8hS^F9o zLl}uebgMzPn1Ld6>@^9p%Nx^kvDn)fz!Vt@?I~%9bO3LtX};9D($Fw4W1`mG5G1=1 z1?F!zq{zZ?sNe|~gv6?UshYuPViuEt($Ku^$;$+s9I~TNJ3=atI2>e%8%X(Op#keF zLFB=lsJm3zo+(AueB1EFIWY1GI~xg~qEXEKSlJ|V+zwE%>&^!zP?&4z63)fa%Ys0G zGsFeqI0M>Sqs@HCuaZX)3uH?_NzNiHnm7yDq>9tx263EX<7oqE;j5%Z!`=Z1@m+@` zF+a#E@g}#io{juTJ2(u^{pBpIiKf#A0AgRU7lTz;gy2JyD35QCbD zR6)w)T}0t0`$h6Dl1Jr}L`9QH)z8tNa=hOUr(Ln^61^|^jLqL#s76d*`*pl=NMMddSPoN|oWo2q;7|xWl zh)vlzJ&Y7ii)-6Ss0%yNvl#R-4s;pKhkrC%Pm4yXOm2J;(qo141d;wt|(jX&wHl~Z8g@#4}mZ^rW`RTt8xNYF$8tLT(AYK zstNI&By>wdrA*@8HrgyH&=0LvDqx|ZjkobTPr$tIp6MuOE%t+jwkpXF+@dg**t2T} z$(CELY{fe@)?m~Fe#NG+ppWN4zha|S0=0$&4Wy=iz=-433khj};_t0Z{k8$FjnC!u zP!?-{f6)X(F@Zc`3V*Z9EZQHM{0$awvs4018xD-eHwuSPD7_b4Y@ZnzX#f>GfnIAx zuv!7!_T558f=t}E>C8|zGWIQK6@u?db_(JwNXt52DwDgeNl%CTDJTMA3Uv7)W&#uJ zL`|}ghdF8^A#`Bsir&~P4XX^ArI-{z!zQzINtmS~0m+!n$`y0X&jDsa=lncxQ&tc2 zv)<>=^8=gO^K*vUWCNSB6Z`y$moQ72!voA=CvvB0$*Mp(Et8@rb*47c`NS}tmz2{v z0RS=fvWOzuQ9 zbv7EPDY=GBTY5MJvRMDL+M`OtT+yhc-2ffUvDll~4Vk7Aq&tp3!)LQDEc;wo#JIr; zG)Yg;)KcT5lWAi|LNiV?eGFyKp$ymq5|SqIu3yp(`yT> zC&1ko>mR#GSYe@lOeJtZEH)7(w+_bX%5@R;h;)S**K6rO!M|u;FXgYeFI`1ZtYw2o zU1^=*io1gxQIrnCL|eM)NlP~HrsW6xssq{br%=LA-w(C3D z0P}m#|MEi>nZ&Uqy!7i|;nEhdUl!93Cs%S(Nqb6{_po@mJcPc=!b_bS`}2>!^y?2* zHlPAWSM4N=T-ae#J(%*#9~y<)HP3O4#nwR5Kk*lz{Yfr>s4W(5)$#{^?!c?m#dUX= z_yv;+TdtJ*4(Q-V>A^D6qf&YnTkOy}-Kk=)dU40-Me6Y#Yg80K9kR|I$Z(aQ>2iAS~Q|Daxz<~#|jZ2(0=}(bn&&SCfff zJ1yB_$}a)g#hrs{P1AZl-Uia9qpFQ$U0Eqjae@y$A1YiSl zXz7oMpW5_!?d`$c_x4=?7$T>U;e1)TTu?sGX4u<<``X)0>|X&JZl?h)SNIjQjnojD z6$TD*YfC|s6*6^^__WF^(n94drK;gGl~f>6u4(hy>J+{`#gyqovRWaJ%6aYWLPTb3OuV+wh1UB*SCuQP{$I9kyR75T>rOwL`p1h8wAvG6Pg5^5v#T z);&ugY}XU#I>ydcD5)mAX-$sim5XWQYGfR@qXLz{qLT=3lz-0b3;iahOWY+0(+#R* zFk6`}pjCZB!ZFrjwHDK}n1B=;IxZcGauJ(UbhlIn&^~BHEoASz@MP7mLiof+nQCZ z!`;qE(0UL`482%~vl12)gb=|3qs!~F7vc`8<@tTF;W7ucoNP&lTq$*cetIimBze>k z{-`UKv8InUXK|3<&Akw(Hpi&D!JLKZN;~Vc9?~{vVP=wY69;pa(3+}>c3a?m0D$OJ zE!R{j?OCzxS+Na?eyt0!8baV>?JkgK8MohJjl}k#4$7XzS*u{r!ZcSbDgwQ@bqSOO zyt24Is>GD{;63cYR&KlT`1A_5fX9C&v z_$@!F7#d<0=x}_lI1ozbCheTUH*%Z~+?Mr8>y9`*VOq)oFpcJcN?g;%x@pLP)5I`~ z2~g4vta{o^G>i?5iV2k87OdqJ?PLNRG5|Zx7aq2dGX_F~$62lQjDz8^+LfQ$`r}xM zACA#vu<^F;a~y|Zj~>Tgm`?1)vO$u0zlz9m|}se?D|X6|NsjthS&O1a8WrT&GqrSi@H;6?|$7%wA+B)S#SUbA$%!Nu!;Qwk_w} z^|LHFgykIDiOU~1%ejOh%Ujf2=B8z>$1HAI^yj+^E1)9Z!-~1FBASI2?=5JBZb1pO zf)$Dgsji%Kk}0*-s_jRhlAy`F60vq7BunH-$TNqVnweNeQi=^!A}3*2m1B+67o?;b zNJ*7k;C$a4)C3i;q$cdSJw7$DB?#u3=08`B+tfGF)mkXBfzkVNVxbnDL_)-mObc5- zB=X?KG$}cEW0TS-16EvxiZWD>PZ?B9rJxL#&p{cq@_8xZ&5`9uKpWg1TXc0I)d(ShG?23-4I!^6!+$Z#fK&-(_%6c%;}LB} z@m-4pT=mw01Am_cnc?v^9hfz*=bq5AnL`^2goFZIKIhavRa80YubX4iZwizC9i5Z@l&^Kt zs}h^^&xEyft{$;jkJLgB0(CtmJT@Stf1uJ;^30)#bulK4)D5I z8zyJ!BpYkSVdP+6hbA0n;eFK>AgU_PVr~70^xUo4x>fQj3tHOZ-opa2*~+xvPW#ED zG{HtLnZVH7v~w-FYxA8irIg1| zO|nZ&vip!pc9yfKxX4S(TK`AP3IsM0-xUnhLB{(w4*Q~S@vv|Fwha5CZ}YGp{?|6_ z-=x_t4)wj+UeJl7XM6M=JKNvzuzxqs_NX=YZ2zl5iPLGSw&54MNDl80mfsgKo?=Jp*h(9+hvH_*opbTn(AzgW!Zqs+7ILqjf@XWQqB zn6XEjV@F@l9Ls?gGzXjCv(2#!XQp_2apw)2W6?U8%jI+q+#A`~#9<^;$?C-+8QdVN zkI&5O()juRvjukH*J_MuTVR8n?o3X%g)F+(w#5WF{kRs`kXQ5hcWpig>HOO^%!|Lp z!@TQTKFo{1&BOdV{~CsQ$+vizZ~B%G^OA4#FhBdRVVJ*3L|d%+dqlfq*{mem(RUQl ze#683-A1&d)^`%oe#683-A1&dRwvQ^)5KNp)V3*3`qvSNC-X5jGT8#jLR$`DwLmBB zID*moakJ?!Pj!UkKJ4}OgAmAFZaUt?tr4HjlC}TvTfhI?kKFf#&m4*F$=ur3y=%Yt zVtluEYybSEhyLM@zx0Ktz7*YlPgYrb(g%EH?JrN?{q!IF#Rm_hcVv}&vg+E_2Rv&a zYajpA)IYrM5B~ZezYyI)5&i>fUyJX#J*(c6)s&4pTGoE@FaPo0-}~L4{opq0z=ocL zi~HD&Ub&l;33+Z;i8Ymo8J--y_pW{Rg1eQxS|*q&Pze@%z{)BkXL6JG13oz_ry8O> z7NG<*gML{td{c)SevfyAaZ#C$cy{yRe2i=N3Argg^N*n%H?$)yGO4;;jR2GYeSno3 zwg59ISTQmV`0|py^0VXeez{E@9(QBtF@bB@oqy!>I=vEcjD)q$KPVKbBW=^jEJcaD zb8J`%>)SAba!-|$L1agvFtxYBnWlc?93s{m-3=#INoo-XYf$^Kbg-1BEw#jk6IpeK8z7Q{#aKZRl$N72X6cV8YUCnh@Tw50|yWpT&m_TfW)wCBew^xI7 zGA`_ds*BoWy{RiU&uc-vn1`B^+94VyqR#)b{>O2FSZDtsE?oC6=jPPbU}enIss2>y zhh+W8=7qI%?X|Vtw6RRA<*N3}@1Leu+Ai~~eaXm5fM^&cy}BQRt=%nI?6iaH(4OU~ zPESZK*qY*eIti2aD2~>%XEQp z{`g0x^{mgwaO@T+E?b0l3)aR-%0m!NYou{;X926@zR4j2y)0y@U?~-jX)rdI1Ae-2 zG2!^Qk&7svy!Z2T-u~JU$!22RgEBV4$p~lX9_9lo>k8DJIjw`(qX3aBkDia&A%OdW zD3RVk;+)2F!H!+Gtkj|beNi+fe7?+QeHo-g7njs+LvdXcXIZ#3q;A`zJr36mc+iV( z=uis{xQ$Q-n=KInqSsSV4B8Y8QDUW~;ohk$#jOguX@W7?p{v`&=3ks`U<}T6T7hI) z7>MGGh0(hpT%a(T_9}1)yus;bNO6{?3*>k`wWj0$C(Buso+4)<@37(6Rl2NEhYK5` za5saV5dXgZ5a2k@Ou+LI=@=OEE-2EGe| zYd0;Nf!EsvYdn_QCq^)$pFR(iqPT*`!$k!(* zS_w;Zg@b*aoQ%=vlc;&VKS{SPEXTW$;#+=UxRaqlSzI6GPY8E1G^{S_(Pa2P9a(dEph^g3&ha5!NxnL{dK8!sF zYDFa~*>c6%{(3%ae+#P?`dk5s!v1ychH&h5SKyoZ3fHQ>NrmYSPMk#nStXF6uI{Zk?!E=|#r+Ii)53fzJOetWtaqp?b|TAo(m-}P z19>`!Yjs(a?v3i^P0@%nnt7+DVYX(lfO6!KZ@^a?@v*_SQIa z$2sqCIRtci!k-R~Kn`$tg-H7q&e+h)b{JYRSYQnVhKV!}NuafJ{ zG?@vYN>@@ECr}?EOO;x>sW(m|%46G*#ar9LovkxvhIY}Qu*r#&*wmt#?+0u{kPZT; zTodx@hoHfB$pziZpKANmxi880US07Dh=T7f`7$mPd7+(>G0vZD`_AQzx-gEx@aOnt z9uDFAxv$m>INrM1upLCAlA^mDNjTo6qMY9AxKvc!N1Lz0SvQvGmV@Xx0{{eP2-x6^ z8qyfzcXu3HY+pFY5xXGXQ8+`dMGP(l3y1VHUm6*Y2TJI-DTTZbtqm)bVYxu(4HZOd zU`^rNA}0kE)NyW+Ly?3qjqR@DaBh)|OkXnD5`~UOdc5S-O)llR#RcKqBKbw^xMz1q z2D2};i*5?kO~|xrsm1p0$h1GnHit3SI8UgP^Bw0F#kIq^MO4f3%wrF2g#^&=aNnBk zU4*5LpnAGxVBsi}PpBHQKGFhz#vxi+1a0;p3t%W}oh` z*5OLztNa=Ba|5UWOvj&fwcE4~P;4!Q!>^>Gtd_({^{;|jd_SWKl>Y@!}9* z$eXjzMLsS-p>^8IJXZz+LNKCzs1VFumK;XKeO^T1`SM)kkz>zAzI>c>k!o~|l!6v_ zNEei{IqZ#`i!9o0^60}7e&Rek&bdf+fdh}_xkws<_l0&BVrlrFqYE#B2kKxr7inG4 zPR2td9ABB6UDu@;asE(H^U#{q<&BV81o*698l_Na)w1D38_zqb${W*PZO@& z*$L1#N(hi`WCeYZxIb#rH(1{B{Sx1xl~DIfd={vC;C>afi9np|a1N670xHs_d0f?| z;}p8Jgr>I_Ty;|({`P`wc@3l|E>7q@?Yu^#;((zkjZSu5p&eDzCO(|-DrQ?^h;!ZjUc6DynRGjs=A+iR;enmv?RxYC1fSOD zIrMkT6N=mrRAh&-Gg7&pP{eG7bUiVd-?}qTV0<7@Z3FV(q_-Ck*`o?NbGAK{pH~Ur z&}TJdNg2xEOt#L=f=QDi5Lifq(;)N@A>D5K|& zbV}adX6ktEs1lw#qO_v3?Ux%mo;#{^Ja<&-cS%V8%K!$iF!piCMs+U#`eQoE26a0}%z-=}<5zFPtdDy_5@Gu+0R|!H;5ZQRU zut5EXV{rR`QE?2~T+PIRSP^DT3OzwGFoCw(^XYV9GDiIXLkCc@6W8|a_b1+id+NQx z?F)W0(pI!D@32j5-7hBs!zPWsC?ZNRF~Q zj~E8RD^LWsqoY6Y)OVlo6S&zK0WNZoylz(qNL)&}lPA^9-z|HAnzHqRTDT%ZZ@W>4 zI4#?|g|I{tSjn2wt-ACL(&USFaJ3aDr6EkH0lIY#lnU=5k)fII|IBou2UoaDBL()`zToXUfl!5Wo!ksTJ#Ooln7na z)(H~sGZHiew1AZ~tu+GxqVt2FEdf9r?`x^`3&V|lT+d=%2Z}m8A~no92xL^F?z1p; zf|CS+wd>kvAwGAf(ACO{=oGuxMF+bHMGH6LrCABnYDy90BsfJ;HqjaV;av<~!hIyn>OCNvGx-9(HlKoMOWhVaWF+8PlTCULeSM zZ$Q?wn`@0W@K~P|^rCF;2ja=8EWvJp{%)sRbYs+omu9H8wAb*Mbt@R7jR!U800C`G zLL1u&tX&#cVM)00k6Q9Od9yZ;F55**sY1}yMKl#@37o0Pk`)p6_Nmdw13{U>%7?a< zHw4=IW<6rqM)J6(J$KyLpqa%xX^aMFQX^LP5>rz+O|&ASm&WCbBRL7zt7t@lB$;4F zoad3^&rOxga;vk!Dvw@7u}Pt+V>pn<_zeZPUb&!s?zps1kZhtxAq{dVr_>L!N=Gv~ z(ya-ldrI5~Jl zQtBWADS}svLN-2)_5rMeF^TWC1t-$NHmPAUkKRIN10}H`P^4yTw=TX#<H7l6Yzi&Ugo%9S2Yz81>xptq z$FK;9yHrE^O1owfvI1!dpKm9u^M?4*C)8q{Py` z;xy83!Ou7(vcuR;;zg6i;y zI66s^M#3$cMUp0^XpU!*uVoeNk)o8{R7+#K@)uE5b6&$?+UT`tV2(XRZ$OZG63*SN zkIRtTc(#Gnr^(RVs-MR>L%PDrPFZw$87mYZLah2260NfU&Svv3>Tx3YO6m+MIFeh( zD%_Z_&0dK+?gLT{y}@TzK|N_s0V*g4qwN-l!zM`k*f%iB)?=0AO+Ra8eWvf*A zVcl#gX~!nzH||lB1(V*iZDg_pnzasyQ39)r{9vpLMhjKJ4TLJbKfuxB1Pk5(Ut|(| zNh|{if>Y#P&tf(P^%lG9NF<(zP-x0ac*qC9v@Q^G%kBZdS@AR@mf6cL0BIhVnxtZK zj-EU`t%2)!&1Z;ybNlnjR6JnBkzOmYkB#PTrtUu-fP>9t%W~F07rw3a*E_=1etS@ z3IRxTRWA|I85_R*aACx3X))`$ay{WbRw-IPuB8fy{s5)KVP#zRx)O4Mh1iV^79wMQ z>o-L4v5?tEzuRPKu%l6bk!^&ah`f7}oSMUFduBlXk>fPZG4x*kdFV3;`D?AGQA03AF7$o^mv- z$G)yaCPyqsF3~86J;m@muUvxLQb-|$_-e)jlD8gV1t)*`qchx}Cz_d8+{Q=xkPQ`E zTxj2=b{iFipc1hpXxtd|Vp)!3+nUkHs#g+j`aW5|81q?_1o3FMVToAUl@fDM(v(#! zi1j|m7GauPQD`{s~7?RH_7m}qG0+DtybW%tejF%$T`g?u-ZpyWVs`<^<2fR1?V9w1O_&c9X}cb&R;1Z^$#v?U{JIA7?>a;0(^vK8&We1 zaKkJdTH3dbQM@8Db;d-jDXxMyxn>Fq00)Bp@meR7@N&k+fDChaceqCZ#=~&>1fwW7 z-qXg$J5?Jc_)AF-r(Z|kS*A#!OEU;#w_?ofw;T;gwNW7fbH(XKEG zwesllq_56ZQx*9be8NaAVVCyvJd3Ygn(4ZRDQk1XURN|zwaXE8P;e!c)UAniy5qa9 z*agnP$BI^hH5xHBNNmP%A-vJ3QX~O^Krms8Y(DRT$rA$spf@fb1MygwOEY#;{|tm0 zdsDJW@UvGjId(7E28==w=lvn%JgQs~MVSd&vFFiJ^i@!<2WEs=)*dY$=g>{eaCg0f zgc8lW4T;q%V<5H?`awCM81h-{dnLp%l3fz1$(!GI@abadRS&qBPiQw&SCC_+Y6y;I zCgiqc-u0#$x`#w8F#^qjnLmxN8C|9O9uZ}{UYa+}f`VU*=<^*PIZhr z4xs1-ZH8+PU2Ru!(%#hNpRY>h4vBRCK_!2+Yy$CgSc0%Bt>j-WBe(%0+DSj+Ch{4w zu;vz$Umh`305GSNK8*R4O|w)5CRvd}S{NDlnP5So;+m|7=`h0}aixN}UiV%nWXWHq zwwaZ8;Nwh^4^y7Lr1|sh6i#5ihke4qyo;<2D`pf^ z$?-(_UrTQP8-9Ejcf;q{ulh6(5g>ycFHa=k9vhlJp}a>$*gcHO3>m2ldR;QLSXD16 zIq^r8zKDn31tJ+^tNCFPNj?O3?b;6Z5D_X%D(h-on#PpGX{BWGwH1*+KN{5+dtip$ z5ML~T58yOMl75_Soh4KOusCA$uryt1U8~7KSkVLXYnWgs)^V+JNK#*v|5fNB-%A2S z^qvF&K0nfoK||HiVtcJCYW@%BDzomffxTj0qWi@iHTWf-&bpwcZK;8*nl+;$cp>u@ z&j^$LxEIt!lDU->9CJYq0u?3kgN=5-OvmLk=%vQVp?oa<8`GNOa+)L=Q)K7mG(ojt zFpLOLd_RR_QUSB58mIb*kF4p;Nx?f(51_wuUrtkIV@{Zy9OifOx|h=ge%pMY0yzl^ zHjenc@N}2FF;SIxVniO5Pja8syAPvA{5hOyTke2&XK5Yu6R+*%W2^3Ku74%vDpw%9^1aJXJln zP`7 z!h@g8>*e_BHg$PP6zoakFj*qhraNZdk^?7aUYx5Ikdtb~wM6Yy+Vo~9+@yO0|mzFd5&9X2tr-zd$COhN~*oM_J)RvKZLXxQ~X#yOZ6@;Kv=FarFu*1hDqCV zbj97~B4(_pE!+G}*S-I&1eVp(k0kc0Uq9}B8r*Rtd`ds&!I>07P$A;u__qvgcY zpre#)Yrrwj1AK47e#2H4wcQG2*n;JmF?`X7_;{N z-;J)7IFuF_166ZguwuOi#z=j1k_1y(L(ZLdJc7|hx_$mqbR*jW;yw8{LFvOqzN3*x1eC25{Zt$&)z}6T{ZzzG86W6d)muz;R zrqV2L4a*rTkrI(^1}hm)mQ2VU5EG1Df%)ZY#7&Tn3I-?&+#L9qakH>&&qhz_Ym{;< zdUoLEZ^&vBKv)10yTC+#`%Xq*o3$japjaXMW1?Zf2%(u_LOQmE(G)yPYY5LMwCX0? zL@=NtN=gA^eV=ZyxX3eb8Bc{3Mjc+(t55%Dh3cBl|07NQ%wz%>H3-Iy-+ z?ZybE_(}8{+}n22AdG;5u2R&MqJB&YvjETt>?|NS2#u{sb~SC5t4aY2ZI5YpY*o_o zV0WV3ytsvJMwYXTrmG9WTlM1A2Qk%5$^Mq4Bmp$Rt|&pj`E;?AF$I1XYN+5T>Z83M zt*|d5_j+3`!n&N(iq>Y9Tvd{gMNoAGBvElEioJmO{GC~1y8si-6;K%SlIZIE4g6I0 z+AJn?iuOkNU9rsam=p6SpbeO7G%kwE$;o^QOT5RcZ$!m@ldBW0rUCiGv?l=XC~xsR zjgOjNt)ku8&9KMQ?#AAbc4vwmBPhMjj8TZYl2v&>s{w$aY6SSkLxhdx2PEJgt?>Qp zR`en_qq!aX1`{mijjf=rmo_KmQu-Hs5<;`QP~fCPj^(oyI9ay9<>jC~$|ouUEDpRz zfh(1sC@63)?~?cgj+p`%&d6|@EGYG+zzG91g+-$ID-}39das2?X^}@MZMLdHLfgNEYNx;F-aGL<5-(`zIji+|1m^3GwTZJu)5@2VvW%4qf7fx z%GKK#GnHCU2rF8tc=+cb?)st9{7$uZ$*ns{Yxi*jBCfZi46{bV;LJRsvanrB9#>1X zVO%Xm910M%=;lvo<=6~tEH1pB0-$naMPLVv23Dh+hd1ik5i=^Yh$@s>#7q_~mZm^$ z3XMVS0|yYT@8z*36&lfuAc>$4zZYfMHRE<{(m%?R(XQm6ri z&4LyEQXU(d4C0u~xfjqlGr5@|M5r4~A`JD{tvR#+Bv7Pe;bZ=FXb!E+aNt1U&3En8#82LLS#kgwX7Z#2|Qbp ziV~$=)Bgst6@~E5vmC*I=Jx!5?7a=RUR8PLy+59F&U4OlPR`B;l#eQ6XWGupHMXU%*0Bkf735;vQk7&m@@T9Tpw!-j!3h4pFglR^><6y+{*6v>G`M_Ic-KSjD)GnUF*zZUh0h090>2VRdcNzxeQXfY-*up zM`4hDE1gzCO>|~LZM+d`=spr^sS8sH{IcV9!336+XLq;qOiL+f3C)&u%^ZeesDOX! zTm_S8aW)Vjs+|jp69ouB#PXM0MXs>EM3cI-l{F+6XbQ*ForgOKJ4Cpn-xM+gb+bxj z#vNT^h-?QgAQW#i2Elg{gb9N{Bnn4FFN&^?=YJ$(C(>iJkxH#eK20w6mK~?f`u{Pn z8s9;cvu~XvyqZ52{QW&RG$7-jhX#}5ks;p){p{J}t^Iv*lFZb0g!TWC#`jCVQ^xo3 zKT6~K`QLft`=uu|zJEUo*un&?i`3%3vi(8&f;chK#l-b=wikge@1O~N6XtunVxI^j zlSAEl&b$N7*}(exR{w^)gIf9~tW1SryfQ~JapTX(z%!G?Ougd&%Zl4mHHo6|ooI5r zZF0O!9qxS`O=Zg%`_M|%CK^?G*>!@nxJlq4$Iy7$WL)3+>oD-M>)l*D>~-ObkIqA< zs#|gyDTY0nPr>ZcvQ=LCOG}6xUssal$3R%rszW@z%9Q~ zzkK^9pQ|e1;@dX)pdf*8JT*ng?S0`p!f?&~fC4fV z_|B!`Fy#>L$6@MeUL2-g%!|X+i^Xx6gS99xrhOFSF!eN0XNUe*%*bhio=uv!zlXbXpvZ-V+nHs6R5$;KsaBF_#u?*N;6phdySgs`mq6y-#q=VZk|c>*j%rGYD4(JM)^J z2!6a7AcciL*rWH1g&sK*K^`N$waU&JWlz3J!NBISsgFxk6>(nIl#fNv-j(r~rAAF~-6VehB<$dVbv$n!%HMZ8>|@XCHP7G@9KHNxeQ)FFMC zxZ3y0lsINLRv|kUp<|T-c0-vK_;45Vj<0&R$u9%%x*=JEa!!l2!!1m&|z*@Z7?a`W4rrfiBxs-HW27> zGGlFL1H+_Cj3|vYJBJuofnk`7U~plXO0Z;FoaC+pENZzq zdsmYsq27C!tyF3~vfjZ!>N-2He!6@|kjv&m9Fs724G&R{Z< zi0h0iZ4*kj_e(JAzMyB!WL~%XLl^?8{XbE{|9Z5*pLQMB(uU5rz@aw;o~0AF;emX? z;$oAV=yl!~R|(0lY;^5ogRyY0)KA~TMz<}p-X2l)owP`PT8LO=k0^*0dt@GpzE`b~ z?*^8B@}IGE64vc?|LC!F+k(A)iqpXB2)C9d&3tHlthOqrMYq0-mB|tvtVpj!g>kN; z#UO5Qt|Eq_-!)s{X4Sfzxmj7frj973%>%25;Nmw^ga^MM=Usb1AOQw7qbK1ECh#3lF<=dP~QC`^|3!c}lr4){P} zxS#-~5_zf$*d0YiFTsvzB>hzV*aLI?RD3Bd9+fOtdDkpWceYRj!N$tEbn(Z3m(p70 ztdH?saTEgqy?-y^xvu!LGO2|pbkKAR)58r^#5tS`%!vP5KSh zhSHu%4x8?jntYEvmnP#_l7`Bikr4btSMc z8^$6G2>OZ$M^6w{dWb>9G$Yq8jZ3OEm>vlAYB5byVA^)}Ii|@_88J;y`oSdS=lEMk>8S9a4LMhNyk%SOueyXenoeg;wq|Xx>EId76)~ zLm^U8IExyJhVNGRPI%^4HmBm_QI0V>Mcjn6i^Eu)PM4@qkMC1rN*-(%ILaNLD8XG0 zS0J>GES0iI_?)O2ea-IKYjCi)&#UEw*Kp;$aRn)mCYXN4fY=vm3zoI!b;Gsvh zL<|!}xTuJ#aQsltVjeMyr~n@7`&YS;VOBn7(wp(X8kM$bPJ6~#BA^2Q2`A_Cy(yrd zR?MnXi^Y`5LX;iK$AxAdLoa5hF~SHX94rF(Cj)Y=I*$lCf7PJ>vnJ2ocF z!mm-hI6|R$bxAYllnSZcW_8JeDQ6xmGuIYvvsw`3gH zs49~pMzn0R${mfY;TjqbIG5KaCxgemzTdn>q&|lao-8I~x_Y7VN>F*A5fyBujtuOM zK?Zhv`n``$>qGCMC>I_}T4(8^h$%_EDtD4ZO?Y@f`W6uMF+M#WD*N(QGTqLZmmjUT zkf&qHc`7_z-Qe)cg9LfC@lqp+?^3W6>As#NY1;%EFkMZv5lfGAy%Xp80;GBjAB+cX z;L_pbP-@#cgwe~usCcgswkV)XCg|qxIzFGZ;IV%IbYA{X7@f_W*Tg+Z@@#g-H1w%h zv6Cav!=_`4Lcb4`S_%P?=zuOwNF`;Kg!~O>#(o6pd6Y00oROjR>^)5Tzq`Kkp zmyO1aHvJH{#gdXoP}yn+kxiJ(Sl;*;(Bd%WWj!mhDKqoEQ@kD(+Vrfn$<&zR+$mR^$|{ZEF^&#wcC=T6^w^$ct~WkwJPF7ws*; zhc5|-l_3X6B)Yr#Hv?Gvi)(LBJ=)|asxGBQ0Z5@jXW3oVm6!t0U%lHxZ=4I&p zY3lK*eb24>i`pzxq*bRSfa2$b((W8A>+HNlA3)l8O?z}~>F2_cW~P7Zg?M%v<1P}gW&i#DZ6<6=|V_cY=J z{67HRF8^n|eOvT)**^)qHEb?wkS8%wqwd+VIemF@Q`L1(vAOR9cdhPua;uo%Yd%K< zzxUq;+#ko+-Q`Gc?e*yTFxyfQKqqp24A|@LM9S;qxjt@fT_5Bz>q`rgqbpiSq3>vubn!$PJ8cPJ%gg62VF4Uq~b3?Gsv(d__ zc;`+Mt(z^^L5tNBc;=Qss;6{c=$SiC{-f_IK2K=0pENqZG+$?n>YDVne>w`=7gLdI zQU`XiqMUQY9uH3?+SAI->}-dGG*)1C){g%m-QZ`(chyHecJ>wg{(Ha1{m>QH=}_YO zw#R$B>M!;5{)>Oi?fa+V4{y1)zU{HGOL>3rS9!lIzP|d}`q=M}DO0l&%haFyRf1+V z)(3Cn@<3XD<^5bgl^6epX@MqGf9&gHyXxTT_V48JzYPk%lotX zeedJ?k<7pC-JDq}PMIFs0)3w>Fgo^f)3w>N`?qY`%`Q&(UzyZ5S-R5M*(b@Tldkco zPRcwrqO3R+n*C$|ntkt4=#Xy@P4wx@_T5*e^&@Z5+jsueodmX}_39gT{$`b3JbUd6 zF51UyDj_4*|9<;Jf0OV0gw=FQ1ub3thkw0#%RW`AdS-5UPn9(f7wy}JpAjo(9|hHF zm0bMwum0jo_Feqp51)0>E&kE-ZhIpyR{p`^m)x@N7XBadci(c0B1u_t(?{=CwaI&Q z3e3oWDJrE7_8Lu5`87SMJ7y3+Y3)Y5PaCdTIKJO@u*f!Ixj_L|iZ3JiqD)mC1cq@% zR&mRsP96_TO1ss15v);@qWK$hdD?*p7SO9eP#NO&EW?p%i?yn= z5W&i$2lrSAvFZjO8IEzu9c0EAsn+HfnYw=&P5t1iy99+9ksPU~RSbk#f3?YjPqorb zU>mWv+<3E$$XpVGJ@ttjqv|45upuv$Qo|zH8zDd-Fk(W9rJ%N7 z(L8Jck5;F%JsNvjGE;ek!S7rT61)i-iytRm)B+av_!^)Y$26v>RSS9jTIxYs^66E?TtvB3BlgxZ6yG1dCbRt>O-!FLx~U zeIbsm1atB8{7i={iyRdJg7D&445MADy@waJ7rZ%I-M*mJ?ekkzXKnTCi)kB^ZN3Zu zi~BjMT&MMArZYfd;D9k-`V21zwL(M4v{*_xLTYW!Yy9N<=@Kj)2x>i^`oQe74bJwZ zP^poCkdwIr=@M?Axq;&?_2RNnyMSH3Zq z)I-I8&P1yV2Y8*;T;C0TYrIx+e%#A_@o(ia;d$P0X=PqRWxNDRVEn}f)^lMXSjeP7 z$Y-}I!|5P;d4k5N3{<~IZ=Lk&0|QOyQ!3)q`fGwzK9$gZs1Hb0@;OnFS&N7J!zizu zXL0}x%{R~H0Mk=1Gx8)bdkMqQGAO??QOLzT#K9E6KO`|Sn_fXO2TRMXg-_BU3fb}= z<=2b$ttQ?rNXu>M=mpiCEo+VO%Q54TP={kmQw7x@cIi2}dxMPAXW-wzH^ATYCOckl zvVSza>9oC>OXl}RgQ}qz9Hox>C1f*w7&)#Cc1)T6_aB=NciZ5KAt()@>iHI#6ET`X z&PM1)uE#Z&S%c@|t(kHpw z#1P14vYGnuNAB0mRd9=L>l-1h`iQ?It(5Le9{aE0LL5xO5*?_1;_sMMicVtXboaNo zKg=KF7Z#QU^S2D={H!VDP@D~f;>l;Om9;BUE?&l8diMx_wJ)IfU#Z~JKaJ1r zIw&TdsB3fQKw4$W_-TcifF9jXBRXuA3FIjx9!Yf^j1Izs!=b}a)1xV_Wf-M+7AIdG zkC|E-AAjwk%4=flHTT7unZ~?0YA?u6u^j#=X}b@`9XR}l-r%AaV+EE<^Ed8qV4aAB zYy%|`zUu2>`FiDd0QO@GVgK?V>`oBT3tyu(e`HQ1u{_5cPj7*j5z-MRx#ofdOEdnn z|CurWjNU*159;BLk46HhALp)qLB0E4Uf2;UmfPGGAH*?*%REvpR|OMhzJr5sNXAyu zz&Ndi8)k8jhn-Aj`#iKI!|CF9MQ?|Q2(9Qssu&Vld$^m9`AH>unw$4@qL^C*XGeBpIW8Sy)TewPum7Wg${a0#HM3P4vCe%=Cu zFAy-2kb8DKgym*~^$Z*jk-Jp-zg@;6JvoPDr{+Hl5a2XRfSsro6m(p>k<~ zAW@APrsuMPWPiw-!AebI75tb{611AF1=aWmu_2uRgI?%(&?bGmH#AtCjyE->{`*MI z&EC%)MBo!4bHe^cf0{zkCRG~IqGRYp1=&o7$dPw|ZC#SJ`a`w+S}6lBzhz8mFx=Ue zOmTtUR&ile3#QBNo765WB<^nP)?dEUzOOQ`Q;+o4+Ops3N4)_1yBIZ1nF3kG{g8~r zyxaV4szUvk7j}Wx)D3R}0MtuCCx#O`>`6`d_uu>4aw-unB(+XaF^cF3MTex}@iK#U zGK?F30bZBCCopE{hZ!?gR@KXx;Rrj4Bh zI&f9J77_UmG?g;H=J6p0ZwNe-M|ulE}% ztMUN@&Yl*rbNnpY^!!;xIphJo5}Y z)IhFd%QFw|mKt*geCfRM#~tyzgz7lgVixxkAvqW#`)CH|Msh8hgXIT|s+bxE zulIXeKr;|%Mcb26V^D@o!FrIitEbrHZn16*i?e6zmZ8Ty3L{{8r{Di0?r!V8>R?(``8a-K;tOaW5J(blR%KoGjKT$5IyR-KfMm zON5lIjFdcJjdIM~Vv)jCV#@J@m2Q<@8|Ir$iM5~o2Mxrm8BDWjDH5dt>aiodtneCr z$C2en}DAvHS1eJo1=t_U=0%mN6K#d$*<8(u*_)057i z{814ygdjE$X9+IVD~XBrJuRc^XmLOpJo$y?6nz1Wia_>Ct?u0>wh5H(Uk{lq0PPWB zmyQ4_p3glYYQ{87a~AiacgVi&6&+w_iSD=hCJ|mt^TA(oUC;Gyv~1~|S)^QUrkU13 z-ypeNk1~4x0$5~MFeJ}qqXcs1F7f;0_912oso;&cToLSYiYZe#&TzxomEzX{=}b4_ zaGC5@>xKSc4#orb;8Ddl#hYPMROq{eun0LY0;~r8{5U^@cTG1qgNPiLojRVEDaaZy zp|$7&i&5tHsv{pgcU_XuGc9(NBe~ej=%z%Lkxz9odl4Y3BXQYlykZw;qD85pdM?#1 zrj%5`_+&35>Oy%hfHK!u90<(d;myWFOwciJ)m7%jx2Y)$4ZJbnI(QiH*Da6 z7R^}BT+!Dc>5N+$jMS%{MyA{gC2Vi?ZpD zP79}Mq)!W{0hg?}(_puyKB9ZeC6jWCE;`_r^~@(8E66~F$!Fx`famcruA z6~ztky)3NQlx*CVoC~@i#u?S6(>brjh>pM~%>JI^;XyHtr=T;cdMdq&WfGl;0M*)r z;O1QLaXHrqsYQ#zGrOwQ#XTu^M|pFG#fXAunh0yCJo3d20J173x+mtnlID zsi1fEROq)U2;81*fo?;-c}w~^Fz!qb(Xs+7%@IT44jothe~|6mkS1HwPY9xHL#htl zs~=|bondu7YrDiU2(6yWBEMS3d|K9LO3O5Jd?Y67dwo~gvO0NjI+uoJ+HZw~KCQI!D2Vsgx68WysG>CSIH*KnAhrVM5Fy3*{E8d1_novQS9NXKq}s ziA)V>udT27GFC>c0le;(9iE?{$V?fCsoaYisMoz>sqhSTT=hCiF@f;CwA9U6|!dUFc8nC3};$tru!N;u&7i3VM z<_lfgl0(2*0Cx~LQ z-l9AU`92UWR3cA#fOVntx%E zN;>#+Ctb^(^ueAK4^F})T`R{No>PG56rL+yx7`OFli(!M+$p$vEkc2tDd4t1zEk+U zW~890R|S3;XR2{QZ3jZlMG<4dDQvdwg;i1u^g_`VTN1k=TcYLpW1Jy>J3+6<2SfVU zHoTw0EC952gii^ln4T(41r5E|SB5ABLginC0dawQnBuC6l|&G->o0GKvEUDrae|E? z&v`H4*!Rv_m<3?)YmfJM*eT2M)*Wf+Nq`RPLbk<#7A{PV+m_!H>O3q z%4PO1l-{3w-UIyq8ZTG@a1JwDaQ|2*z{vHC2e=Kx_<+PL{7cApr~h3gcx0 z7GqDOYw}Jh)O6Gp(!j}5pvc74$iv1XyTV@b44Y=a!fqbcN|U_Zr}%!cQ(O}FtWEo{ zP7M~(gT&vM#;c3QRl;IaV9Y6n`99{~j=^jPNQtUVTMv^EG~~f$6-ePyfVEz!R52*) z<4lcl@KJn{@fL-Tc~|Lid__<6DyfF)mZrj2GZ3L6Z^fsK?{8*Kt4Al=-owd?(%CfSPSRpiNS*y6Psznh6rlRH1R+ z0kJuNhr*bl$O$dcYnl1R{4C{J{Py7|=eR5QwaM{G17<5|dLQFg%ke2)92zpRfdRB@ zm6sFwf&Wherl)ykGiTf{-O$_dR(U>VRk|__nobmo@;Kb7*Kr?{{AlAyvcuPqgAi6E%MT47hEgl+f#_PGi zb=-`%xEXich$iYs_|&68C(Z{lgxdp1IeXKXdt4Ks6J*=uXK zgv0#KoS6LbgpeA)g?T>YcQ|AvLnk-nkU`)aB2_;nT9?;?uFuof#P`JB3q=Ni9DZDc zKr2(=@}uNtNJdKzlVY}$&{7m;lWGvBK&X!bMtv^75fQgXOJ|SrC&upB;7g@&9GEL( zWJ7knMEwYcgy@k~xS6`6vq(oA}X=`@^CykD9*X556#od;8q!!9(!RAcW>#|h=N zv|fl7CSul0R1e7h8YbU_4udaOAvZcqCR}u~)?_60 zY9xCkcWXS1i8&bhN+qCZ9C3aQp>lE>^Utty1Dh*q&UIBV6Q8DG0w`8dQ&${Adq*Yk z<}wiCJgVPSx{pUfTF7WU1XDzSoj3eR0rPfMy&*pA53E6(f^Q;fI0di|whauPQR;Nf&SRW8b2Z1O{E zOPlrRAhTQf~WpAVR``Wt3!S28YlFSa6kus=tG7cjHe~G29070Cdd*kk)s!9sm+t zv)1E7TR)!ebkpC$xWZ~1@cL0&T8*+}ejM;;F?jJeBI8gto!5tzUYGV4IfgywpC3hWKLNQiF*iMX!-j?r0lCDO?2 zZDUzi&5vcB%Q%=k-IT!eXk{AaQ{{36XJ8f?*F+m>Ly@*6H95(x400kjja?r;oL0s? zk81r-IT6IK@LfrG4@r2hF*$}`1-!tSB*hSpCd~@zAogt1EUZP%7#b9e(i!MSl#$|RMhD-> z6@frxT#&LihUJ@*0vXGv%foU^fr=5`n32TqPBXn_$m&)DZRW*Nb42cT&ffT$UOiOi zR$MZd+LS|3mG&5n)1j$)_*%*EnQ(gXBqdH)tsO4rDO_G#pwe>n;G2;5@>V}vF2&ST zzvbEuBT)GD_K(kTH^sE94{=+cUElr*kf;b5eqHK|$L_N)^z%Iwm6K<=YAd*4QtZ(f zD64;ug$J1v(9EfV+R$^V+A3hS+4Fx>`ebgbub0pfA#qo`y<8FSpl%oMNI zpANVlDt=g~Uw8;rX2Z0^QrJ5!w)4%@q5;z%_Fu(STUcK4m-a)qM1kcudF$8$h0a5O zhG#ax^E?!?vmm-*1{?cFN87~Hp0t^;8iG*?Nao5etA@iuafH!7Xow^%RGIF?9f>sV z_MXbqQH$1K&;<|YkcUj`pYiZb+T#68nPxMz1|i%)9u>SW7r`ocq3t}#_q-l^DSt+; zx^^v7T_0$tMO#z=@$wRPYz@~hA&i53JoOVpZZv9aIy@D>=EFio&FN};?}$w64P`f1{{ZLSlrGKAcC^PbC4Lg7qo#PHrD89@ zQhpdwNb$XNGK{eGz#<=DEQF+lj1zRlWZ08{`j=jL?RD~a5wO7wPK&>z?E6KJ&C+a~ zEwehm?*2qe{i*&#nJWqCkMSm*Hu7W$MA3p~4UUE!y-cd7MQnr4pp{(^H>3*-0{RV~ z21*PzKA+%!Rd1N2sfpHR%J6OucL1#wH(}DfGfrj}W*1CmPe?BcU1~P-7Umz*+Mi(h zE}hRlGr_pT{GAn}1JhuiPAr_ge`P-m&faYC>;-GgMxVAE3}ZgO6HHqb)GTYJ?3ryA zB$=9^Ucxh}gHyW%)@1J;X&dr_hm{F}*t885@@rAiykKc$sl~nwX{TVk+rG2@WfQeS z^}U3mNk(EZo2!+5CEE3=T?xL)RCm(Tx7s`Dx|oLy36o4>^rt}>^lZVt_+6pmHb_|N zSE4{^g|Ahag=TY)$80vWeP>KJtq>y8a4sR@ec2}O=?n{d8@YsBw@{oQ?!9iHy*ZpB z3mTmC_J-%TS6l&~)$D%8%@JLs{xtp5ES=Xs3j~LYU5^HeX0E=ff0^|UI?#l)!zIO( z=p>Av$CMiN;s;}3Tk-z9cv4;pp#nC^3Sf(lPETpTt$0KSgV>^DHj81xocU~QP^{Vf zI$WjjX+NDjVYDcsZX(&lF$asH|As`Hzq11B{Z$7W{NP5Rj*-zQnF1 zv>@A*B%yq~GU&~*%;w{k*=#$OfS4^r$LSaTDqMiQotm*WRgGzq@?E+o;$&CdxuN6= z_j0B$fZ_CZiAZARnPunziD^NO60@KjPAiNFhj2A|-uvQE*5mXdT(Ae=YeaLoGdAjH zvn&8HOtN=iW|~Y$d`(5@&a*R9&m3=xd`9ChxNs@hG8NUad}?o5s1iT3{rTWrlG!Ap z;d`{suXT{Mz$gC<&IWZz%DxiX)%+u*j-}47Xq_wj4P?|pi*N_gALX^?LyGq=Dbu`G zn{(xE@FEOyY+7otzN0)x+K9CXgc3(uY4s`dbe)!CvQhb&$P{-LC{s0D2|RaA9KkIz zJPFE^M~!-KC*;r&fBfqp@qbfdG3G2f)$S%<>X2mEb)#W2}Gu zxO0RGZ|bLz)HVE!J~M>~PxqK{1@7DLi-O8yDn?7d)VmHg>Ff$U%cJ43M_wI6(v`VH zm7uNwjc+oWeV2xluq#>R%29E%y=a1AYi%urwK0ap3q2W*j#(^TErw#5FRq1_o~038 z>d2iXM)X;1ajAn@zOya<nNVrw>*Oco7k0%wER zuqi{zpLa{43w2)$v(5;v@L5k4>Mil%~xMy|>H@6l%DkvSkr0(_u ziLoJJMbYmLFB=Rb9&vEMBww4db+UoP!>Ul-u^Oyd6Xa5?Bpy^5Q&EA$JX%yTS4~b2 zBp&fVVg#hRsUoosX@Ak;%54@x4GifYX+Mc+E@&EvMk;zLRiuIoui{gwVw<~2Qd>o5 zLnq@m(*v~cl;LQCl}y#2}6slO4&NG`%Vio28Ohi zQ>o+>H9>OZGZLX`Rg((~CoY|sBMSUa^=v{)cNnczf0?Oxw@%5i^3_wZZ z4U$KaT3mhivZ4~yd3s^-#uj)F&ykI)#Be9vy6lc?n8K`tPlQJJFzuw#^~Lv$6AZDrSd$}ugEccc;r(iVYoOU#YNbp5pjR*8TIGm08 zj0voI(@(7j`i>0^2a2_KeOH~|;F}$Yono>@>oBYT=)-?>mW)y5z7RrW9A@=@<88Ek z@l=@zU10k%9mKhOZ5`j2urMU-0fMF|R*6$^5_)1GUD@J2K0D?z%`wjJQ^7~I-k zLHESt2w(?XCbYme45soZAnJsT7-1zjz{(9Nn%|Ch!Ej=F zlgI{MEG$S>Z`08*7!lWSW2r|zRn#NgxOB&H*+@-`z^r=i9m5Q;QL-J8B1{_x*atnt zZVkN;RkpsPfnfm1nNlV&Q4{9k%qt=jmBiiz-x=lIDe+xGx)hjg0#@jevt6<6Fe=7m zv)OSL=cLdF<&-ul#EZr5fPpAK&|tfC2%2%3td%gIfgr@<;<|R}{is_DP@4KHqM|-! zBBQpJUFl1!J@%e4wmYmwF<%Ka*wwxd&FNDqlU$6?d?{;{5bd0jvyx>$X*!w^SPIK~ z=C#M4Y0i68f|ihte#^*R0nUiQi&Y&2pHl<|J7L2zk8O{bF$CKq=IpCJ`d1CBzSr)= z#rX-y0kppRuN&FWQHCq5P!Y{&CMu%^(#MBU3;g4Dh}fVJCXcy_I*I@sffBVx%NivP zx}{|N=$O)G`&uM{&|*kmNXv`KSP+oHn`)hWL7EUu4Vo^#n+PR#_utGV^$Ux4;eUM= zN6<1-%pbvLvG&<_-@lMPu5PJMe9mScx{zo}A`2oE(dG!Ca2Vm)TFOt1 zODWWH=}6pTpEhPHQhS73mhz8%2Iy=lf9Wp{`4_72F^YxNrA_kGd3efo`K?6h4~# zD2ueYF%1aRBs!lhZ;KDSd1bHnBQ0Z7H;h|IN}g;FjwerF+hPZ9!%#DTc#KT~OEVH? z6`=L#oTD0EAi_@T$3JBQ=Otu0!6}dOjyp!-%fHJg==4z@O-v=v3j9m(`t&T;^^@cRA`^4*RUXm0ZhzvY<6z0tdoNB5GK1Lwk~4z3e@iqv3bt&4;_AU>K(* z!ftET+mZaM2^+~7*V}FDPFnmKtpyXV;|Tn_-mH!0YTzvRt5;)!2(0ju!eYbaD8Inq zF}k_g?3z+WsKO3Y1v7Bg+)XuidLcKPyrb}?;wh#l4^>Vm52ApL;4-+_r&W}Y{)T+2 zM3`*I11@GR)8(@IzDF69Z)mw6SB>9`FXz~>t~%!}1UV3dWl~V(=)k>fcc^URc88Hc z%!@?@(X@65uq#S5W6s+#WNmGkSAbOZF%Zhu5PTp|A)AIHS@3?yp;x761_voZ>G7U4 zZ4a?BrCL1PB9~@-cG((~p%cT8&$PlU@g=ViSF$d|)WuM6(=HDCc|(MNHx3`Qpx(b^ zj;S!!nM98ZWA3Gp;>-`x>(qrU{x&thHEi^b&d^;OBCh6Kk0r*vgi>7eUgP|P*#kde63)w)C})s*j=5!X z)F6{pV2+$7U7~T21?duRy>~9D&#dp`V#47^gjExLQC`uO`I;pA@My%`ZD!e_g4m$A z!i(7WtS}=DSV&X$H7hO|_ydku*X*d#$4yYXs+QHi$EV|b$_j<8T%}qV6KUAV$-^NTw!Pk%2s!5l=9kL|8XS;NQDs{FU!wb)fA%;y}?t>H}=v& zRMHptmYPe8+frawzd_qgv!q0n3C^?vGY}n<#*`7qA{ouzjs%dtS08pCBL>jM2rjy~ zF0s~TjNDBU>jJNKiUxBBf#-Ntt@H635V!MuMw#Oklv}cBq27~46PqCk2Z4B?hR`bh zp=AcAxQzG>DI=!MfopRbnX(&`bV|^<(@27W>bMB6l2Y8c(GAC0 z)#&w^;q?a@Rsay(;zmpp=DWr`y*S~2KPH7gaUP#&H&aUR5JR#DZdSaLKlRP;o=fW4 zw7z*Cyz{qDG@E`S6^@r0^=Cda5Bz=VT0o6f*E7S~C1RSIg)$1t1Rc;=`O<7KQARrP%v^6WyB zSGn9|Np8YmVyf*IlyDasWhh-IRjh~wpZ8`4xhSV+VI3sD zP}s$*&3!FX5grK6MQ8}@d%iKJW|ZLA1h%oGnm9~iHm)}fjfn}>$)te24XwrT0XpOw zm5XIk6nSTodSDdI6e&PLC$I1 zW!OexM9YyGDQ;;cFYe(FAcDnS{Z7dce&mHBM{Z89z{Qajw#^y{TunwN)`%Hcx$S1A zqqD#QG_x6?3>VL>;32l13WrglB|dCeZ%Dgc7oRqu z()$s5KUxI*F{82Qs6Lji>;VdCQO-xfNGvzfHZl)G^1BNc^j$8TC(-lj&m>fb_vC@E z^Kd)kXOZKsROH6Pf{aym>$#Ya#({H7UVt&72n8ONqB-y&)wvELH6Fj9ib*10t{LT8 zo141O$Y30ERvb)4o&%APFe3&+@y7{Y=28#pr1x?v5~b;%(etuSlIFQ)phhsMe-;5@ z{#Sb*M6lIQ35~JJgP@*N7gYr1)eqwsVYI0-ByZ6qf<(o4GSO5bE^Wiohhf zl_moY(%uhxl~OMuD20w0tlaKemL)(6)y>X=>1ndgf@}9y$b+pUKOTA^Bfz9g@ph2+ zea1=DJWrV6qTs;lR>#zv8gzTEjc7pP|f04SMQy=DHb$i-R$Gv~2@bSJ9V=|V{ zMfT$1paWvpihQeIDZWrIIh6Hj%;2`#b)UEoJd zq7hB>_~|uysdB*Q5s`0v1M_DYYfYk5iDUDGbI8eG&Lxr2WcA(6gWO5d;Tz4p(bi#J zIMSfq#`qcB>V5QW_cN>ozb>`ad;ibh?<=`c@jqczhxRm8J^2f|o9}qKhhI(cJ(;SG zyr-$E38(>~;>Z$L_3m34c*W7aEYh|J5fRZ4qNK$M2=T0}1gtbm*s%92qnsLv>8I*^|@J(>d=u{jaf^4mwg*! zv(&I$n1B#CDxk?8PSG6n(;q={^(mR`vWKZY`5Dwttk-arl*s`uJTy4Dq> zW@a1?s3}@4SDXlBQW=xX4&(_t%jbbvonJ{zFROlr4BL@Z;TBL!L=UV-8{!hm=Tm}?6N75M_++xA zM^o~hSq37qb6ot?Q#amNe8Rq+A@3XCZpRtNWoxOdMRM3Ju7cPLt;^WgPw_QWAP){- z&9Eug>L8euI>H363ly%2vPTz{8fIMov9`ZT$*@+Dkb(bfsh{np;W^x$!Y8aYhB3C+ zjG`E3mZAU!ktnn3tT4po7Hw}JTvu<-4rhn6_;>b?t=09FYxP?i6q6RtDn4&pCgfYD zMuqoMDI16gxj^I*Gt?oY3AB2Ov~@P04_}X@0^FWG%N@(Z^F*Y*-zv|NjG-5-KWX2t z;0b5FN6j(WsFM(JJ_BhGL4QODlol$w>`@)3xBPb!y=983cJ;M7>)rHAU41vbxj0E? zz5B=M6J49vr;)%ZRGR~9#tKLp3C~xoti5Es#GkfvVejo$wo;CVB1`~3lT-9jye9Nq zu+r(%Lt1QH!`Q)HV^8@p$cY)Ixf#>Vh#!+GIZUcqb`u&WAE^&3osF3KNPXxX(hh06 z-fMT4bH@v($ofIvncOlK&y+b|meEut3&-3=4=|r35!kqt2NnfMWsrx{*yI}DAJTON z`D1lugVXKt{Q+H|Lf@;aO}z~n!9qka%O7<09OS{ad}02e7!$jugB*qJ3PO=$=}Uty~M|1yAQ)wJpsisK`~sV zfb7bIfwGd!b>fm_ng8*v*t2Q-x?rcHHx7zUPmzmS88yLw$$KSXn(wsQ>bu$ ztEu3TbC&Xj7&wW@Q4p=hJbMARQm~Ht3?m6doR3CuapYiIKg36cvI7v=$slndA%=#N z0o2HWj)74HM_UKS(Q|p&I8L!JG=Cg<()6?8YzI=9*0FOK;84G&NTw7#nj$`=%s5Ro zW*lhHj1z_#Si0D4|0dO(9s|( zHi`e@j2z|=fNXGteau?bL9;xL8Guu;909`3G2$>xx&vo*bJ&^IfKA3REl2rp43UN8 zh3kv5lnJc|5+<~VcoG3I5hh8lR!~sq)?_B0$$4qrU0ctTgzUCa#9cO+xP0WunO}A1G?`rNE>I4D=_b|JhdvnPBb)whn!=q{v71@3 zW}G*q4Z7-FUf-_W_I|tjHq|JB7ppv=TV9DXN{ZEw-_q2Y!CghYBHQhDmpVF~v_;+$ z58@yuK8zkgu3@(L=>`V^tpp_T&Ty(cpLog6%Eq_i10X>Gg7eg{-rSQavd7mt+&U;W zS;y?_aK;7vNTnDGV$)0(!7Db-t&TBM&FVHV&-*Y~hcnpVb*ql0 z3_#9=wD>EuSP{B88a@37<}M_jvG+K&IVkPZlxfXn$rj?E;6ccJ6oeS@KxIr2tWOQO z7@o3YGM^M#Ib48xgjRHZjX4lqg-NEGysra7w8<;iQtOylz=Y-6BEYE8v&Yn#u`A>$ z4&9fUD>%g&DvmT(RI;H4e5U~)oViwe@_G&ngJfxpOQmPh0iqYjs|AIaF52y9L0eqi z-?nazMLdG&zGs#uCuB8bjtRuLu`eMPBIIJL+X|4R8ZiRJ(b2y!Mx^|EnO|?kiD!?@ zWP5QFFX~x-!mxf+{u*-v=Ge{>!ii1a!DW~iMPnUz8ADL~ddA>C{le|J3B}T%!u5lD z05>-qSVO`=;IshTOlXhek~1{bLiV3&XR?oB-+%{`eKug81s3JsiR%;2MvuWO-h^$5 z7$pc5^WaI62MUFt0rMV8BL{Paqkh2dO9gchm8i4j5^h!Z{Wh(G5g^$s zpyWi_E7t9i80rhI8&09@3VFp%_>wN@4~ca^VonSgpy`6w#k8@POgj6H^_=@N$8l5{ zGI@|~nO9N`Y>C}x^+Uie63*hfxzu`QR-#oFUMj3w1g!-YZg8Z_K?}CsgJt7@Bmf%! zE)`L!n~F*1YG=KeGmXkDo&bkn3en~h855A?%HNzzB&YBlX)I_!1LDgjJ(dD^D~!Np zG|1?Hv-evIc&I6@wm=>kf{I^DMfr|D`v})tee6V~>qlw3KD)k~LN+a$7YCXb@?3!i z>yWLB(RHIlTT;`lps-LLLBsk1UB=qz{b8TJ+bFn5++fzJ=Ii&;Iw5LSp-7wFG9R}k z6X4gQ6Mgl|e64T&9ZHMlA?@AV7ylNjy)odQl>c0$y(yW9gq@49sTXH#eg|_B8!+)?x~kzCNALWG3Kyfm8CwSman{zy!@2a8_skCFEj30|8r5qweV0ENpsC{D z_j<34QF1o0AlG($um~hcq5i<4?Gh`1rY%%1?to_nRnmx=00!{1Xf)J11gt?hCt)n} z0Vb923h5P|c0>fms)Ul;!la-ipR`s*WDmA&;rI!<=*+;e-MvjVI%tK69}BzT4!#vK zbX>h5?-p-BNJwA0wzm=FwiAzEqf!66zdpx_*c{9aXdls6#!X)6Xe{}(_-osAn-)*_ z=3CzUZ0@e|;$AqdsxN*!Jzo7!kR`RL|8s5q#{uTnZ}kiJf%$kAhb&nNo);v>7>l2n zRE%Mp4{B3F=^XwN@+KeD7J7G_bWm(SA{l~|VkO8BZ=FTAOX{0U4y)Swc9?T9YqIZY z6GA;LD1Quoze}+6wl%ZLiOj<17i@E5QWx)opfz0vDeN>S1B>fo205XN`ye(p_0DN3 z76~Jk=5s8~)p-o-JwMfX;f+IY>AWd@GXr&mDYO|rwHZQGy5%Y>wXtO`+ohvkP3w~U zxW-8q30}Yb&Vj&krrg@_!lZUNqGd!Q|`#sfBMT`eYMBGnfQ%4@+h9-dhee5bOrH_NCYr!EgP zUyj(FSwApNM&%iNV30iS6)i~aS3jc0z!|EV!Kg+vyq8i$MvMn3gaiIBk*b&C5ZtZ_ zBO342jC5INwtG~%0e9>kRXyB2`jonXGof8uG&w1)gH^n}v&;xS}h4~v(LYhm$S zuNn2di#&I;&n!x-nN5d3XEiGU&xC;YfXwV zty>7K+yupcj0M`=h*5xH&9|sHXe1-Br7`%dy#~F%kXLDeel6cw!Y5;A=TjHrk>O*c z?p^Y&jBUu152?Ph^X^B>?eepAtL3^_AooyMUi<~o9lR}<$5@f&GJwK%**&&>JMMs% zLmTslt%-v+0iJ!gVgX_!e9xi^nB=B6`6CozK^Vak^#lB7^v*`bmM;*0UY#@ufg^~Y zikN^KeN&TE2Sk7eUy@g~igmGS+co%Dv_8xz)o0rm^%J^3^j?N-4h@WIds>-t((ARO zgz?#vsk+05jD(2X+vs_jSyFA|MeoUgZp&bhFD!$h-m5YAcI%3}Z?GNJ@g`p5CTy#K zG8R_xYKq`>Y>PZJzlZ>Q8AVuFumhmD-M*-f^LdM%^G?jtb)mQ8n>WqQhApVoy&b>* z-rxG>2hY&nb9L;%uiQ+ri&U(^q@wz{VPqiOeN5vgeYtb%EzWjoW>sUN*c^-I@7S8u9MsUD?A z6Tv4%Vy=N9wag)JJ|*Bfaz=YJJwPc*K-B-uIcU2%#qMBvF!uDTBHh|QcNx7DvSo^%{$JW;QH9EJFI4H(TSB+cF z^~+q9(nzP*YFugI`s!?srct5uca~=|l4?+G%*^b2CT&)yC~r~F{sb9P3R&A(d@yC~ zR)kZosc>m3MOC6y3gCg|3Rwfgno>~KnZnF2CnFu!zEm~-eXtWpPNIfkxr&^QGlwDRoP5)*t`4^ znU<&p`kD%BXvyGjclP53wwrkW1IxLloh@ zQxWe0zN;xR{5v~t{?>&@C2peqO)gNHzt|7fZtWFtrOeB;{#v zio9l{J)jFrdWIPlXDBl7sj&VE3ULvHnw$WW*vE{%L+HB#o0n2A^CUL+pOS?H^Zb!?kdk` zc!#ubuN`85#Y{paxdMfBh@RM6y-~yotXeG@Ez%Mk@u;E&UsUhYGJrWDEfJ&bHG_h7 zlLlMguB#I19XVY6zW+$c&!!R(V9dGui%bd<9S9Xw5DTI(3+ILN-%_3TA>inR^LB*Y z9}46K7$LfKQJeM6?*xeR>c{s)AnN~DFNk4$R|}P6jd2Gg!zZzx0*L{g4^jfvpvH;C zz%@is(B^J9iLy^Jzo)|U6U%W%3-ry`#}_Cj(u@wsc? zQ~XLIg(v*uBs`ZE(L10g&7{*rDOWMz8FWMPam|tSz;TJ)De_FzJ^|m;qNZ2~u`>zj zqa|h;os#_0<>`zJgoChk0Ki*KSrL`O1u(KkFp&J#Gm5}slyQ)d3 zl{QwgzLxG1S6E4Rx!0}HlcJIG>uXNsNSJ?QBi9^+OW>jc=uUA=XG>hmf0tJITKI&C ztF_2Ne6%`rPqYnfV)8H@7-CLC3Cpjf$6YuJz35}HE8PU_bq#wu$o=WzSOX+W!y%Lc z(9^+z1X%K%^)nF!F zS20_abc#l305wW6mX@VTXEY&3)g4o?xDE^$>si?+K#b8 zC3B~G|t=iJgp{lxx;CjfH2o5f4#5XZm7Ry=MjK`8(BJ29B8`h-`!9$ z`0&8`_1A{ZPEB!^6inYj&Wnb!tDuaep13|FZ-CsE-{99Fe-31V7L*_nq5} zl<;$@uX>*Cexb)Y$C^~7*OaGf>8O5zM79yns@g1WK0@?R1PW4AlYXo4&^T11FKY^*4uawjT0zE%+~8h&jYGbnQV!jQ$6ivXye7JxAU zpc!jLp9TPS(&WCtKBCL6Y6F1+0{PU4fei~WaMsfTFtV0GIW=quR&$;!2E zN&lq>u}1Q#>I-XNpkm0RsCyFj1fuYRDwm+Nm!-i z=RB(9+!!p>avlE#{#)jEx5;H+P6d5g@1#WE> z3q!^c#;K5=4TujNT`NasnJ`>1@SW8%P34f5%VfBVE8W^Mc%T`0GE6$h;bUXRc?Gw> zvf3c&I7Zu$=s=TdND7E+8kUMa;)<`N-QnVseJ%*gQ$ff$2${`13VI0WKpwN5!q`Y? zPGjE9vYzEw7>eh*S>s)WYVZ!y`FeM8MRk_^wImTIQi3wOM43b;R|Titge$JA(zWID zY>jLUBU!Aaj^{yh+^o_VKQBB_+Si(0<*FXl@+BBD4jo1+GS*42P9TzzDlh46SwL2- zd*VsvQU+#JpFl6$Ns-7p(Y=IkKRJeqfkhRs67og>b7vLGbpl{aXmgI~@7I-qHbN-W zMxYI5eZLJvT@c~&je4Or3S-ZJgHNX5i*+D|j|!YPl~Gx~DRIJLMWQ2QNK;Yd+gMnq zpEw&7jK?WbxnjwMCUPNqpiD@V&PNH`o8tW!UXs9~!P?eoqOvz!7Ze_&Sd*gjss-NX z`5H9wfjWO^;3HuOyzSx-IJ^`$j}ZrB#2bbyzDa_}AP%7vhB1SlQBs@Z4F<-1u8kQA zEAa=ZA*r(kkqvcdRA|bav!yWt2q1@m{ac|esM65K-NGpwIg1F;ddtXWGFaI9hclrv zWeh1IZ$Mbqig9s(T>V>E-ML|d7}2@Th;+c5$E9$TczuT^@LRPor%u_^O?r}WzPFv+ zS%7^d6}#o6M(tj}>osvuyb37cEUvcoc z@ap_Z&LCr3<36A9ehQfx=oD3;B1$rT($1^S42!U{@uVVFcFZ%Qt^M8w82tda>G8;sN52W59VC=3^j7Ck8q%bkmI zgTB5-##hJDR-G>7C~{e|Po5xQwpWUyLtx^E{CCCLE8%^(qSTuF1ycP{U^U{iqL`?I zBODkV$)~JNQBLz2mt5n}foWo>;Zc}KMK*4YWDp-?A?H|YYibUP-{f}GDZoIValVba zUk;8X8<>qLQuTMaU1i6~vavyCMIqXdjuLfW83kzeB9FXE`fW*>Pu=Ur_?RF<@WCNR z#3A8|nuQ<*EI~1Bc=3^h2y7}b3MLnA7wsLOzCNdZxEX;S%4;*$?V%aE_X%F2RZeMX=#m!84^P4~nO(qL7_LRhuyXy|(pU z8m7O)bNOW-oqORrrnYs z(>?Ew#&`SEE!yK^?~droYRUt;zQ9tr;Va*eZROZeD_-9xPui1yPmJ*e*%N+`Vsb%- zA6jQ9;O@R4dyM<~K~^;mD*759`vWOc*_XbwI5vm2y)o{L!N;0PSTM>G5ijD7+}PZC zl)LV>c;No|y2z=X%Ga6k2b$3crSfua(VDM$)i3ZnsOCj>hnz;Nq~Uy?;7T-@uTK=> zjd|-{>7275_|`xYujQXsvl4iWf-Eb*<5gw>&&n|U7+u@K$L3G;B+lyPp_IWH)=^0S zrU5c^6d$3>FQanI_6ExGJwjAn%)B!Br_tyExo>Jf<|A=oA8Lom(3 zK?(W5Eg{gLCaY!frSGw@fsEJzR?GJW=sBhe&WR} zRG?K%fE^Xxu;yjM$<9gu;{a(VdB{Td0G9E(!+$F>#y@r~tk8(2n6=imU=$4wl;a|4 z`m(KrIHAlQad@vhIeHoXZ<=e8VMZ8VY6UyE+{- zQZ4gMBpKKi3|6a33sEAs@*Ghqw(~js+9%hg@0=*d!|AkKoyE=r5hnC>4TLJ-xs$dq z8CG0lXRMpSmE$vqgpsc$|T)mr4g5+Jh6<& zw3d%6`)niMV!CPxp~N$!xRWvA_LNvlq;LCtOs+{{TZ9K(TdKwC7z$_TYSj$4)z}*R znVOhG;dIGeuz%HrwcY?Tio9MDn6Ypgz%VBR6(|!WI9quZU=7jRYK%ME;1hw|aOH%N zzE#V^IMr@A5s(vY^;T(9-}o}=SLf7^wi6Hh)lUvQ4b^)NG}9MU)cf0~F-jg9cp9qj zYoAo|aQk#RJv-Vyft32u_6c88{bc(zgtoKi15JAyXkq`r(@=e=eNxH$+9y~18>S^S zw;B<@{R+jT3P+k48|nk4Gb^(@1JGf_!di1ed7sK+q2-bs9k>zMiK( zjWEfbMyN(K;??wNBy}3$1FHroq|7ZQ4n7}c^lX!f5r;@)1cFeoRHO%}+4gx@O+56d zNu+&TfX3SzV@(Y?89K&WFsNWa=-4F2g1dBLQYD)1+XfQmmr$@kAP{jYiaOkml)MT@ z+ou#dd9-~R5$z2;rS+bJ4K1kT{`QG&(eKHNSHQRmTtCxZXlCzX7% zeNruZKG?LUkhA^m6Fjdz+Rlp8#U*hex`bi@LlO!_SkKyjf>f;!H>J(Qysvq3Ng)p1 zM1qM&gG(`EF0f|C4(9tDaqJY{d|Eh-vA#G-l8g3f#7~o87CEp!nVLw0VI+JZz9H4; zO!5BL%kn)_me*+98Y=Sb@hyhfXQWf1i%NTEua{sqM^4WcI^*xy9{RoX-)(P|OEtb8 zt&b%;RSjZ6O-lixX>=m=rmdKeii45L)NFud^kktxT&h)LiGa2ZmfF*n&<^L_)cg#y zl{2RJG0YMFyxC8!Evw|e;=|73Z!(4I{bZ0T3lMQHAV9nlO_R&jrPNOr2gmqz%t9aN zG=Ouw@%1JFv+PZ-piZg;!r9J*s8(7Wfb1>Q38F0e{}`D`DZ}Ho@SnX!zl4>xM$UFk zk4uCLSh>T-~L7?hc;3e&m-M!dt0{%h1|V{-l3q3p;qbFGU*VszfXB zFct2oO0y1S-4=XmmL7*e;<#cBR?5&NAYjr`QpEO&Cm`wq;l#&N`V1wC+W^+6$HNIG zW%xA!<8N2-w$2EdXsangI7L^LboqQocw0E{<{se(a^K+NWo19F?q84Q) zd+MogeDXkXFfX^xYi7~!vB_laVAy)ed3TMz^_~|`%zUug8nzy!sb2r(+=2Gzu=N9B zTk~P^s`TegcS*_rIBY4-gzPEW@zX}X&{je-?QPdmbMUjU3bdC?cP`{d#t%2eFiM72d z`E9H77@Ba8FPQB*-*L;%Om;A8)_i5gKpxWAu zZUUSi_+Z%ffdl={Q@w4zv+<>SBX-QzIDI^=$VFP?9fEr2f0ru%3j=%h%T5nq>J$G~Co;&D4**)`~p#+Lx`ZZ<(Ya z3h>EOBRlWfasJyrd9c@mTI3m-bQ}D|kXZ2!`M?C4CBTw7SKoT;TvETNKElPlT*#ag z{hS~tpJs-TBf&jhjomO zH!UerSW%O)J6Mpw6VMGl6|vMH4kL0=LqY&DaZ&&yu)ufB&qjGAIeCG(d!{ig=Y{CM(3f0> z>pdJ+hR71k`*d!Z-_8+qXR>j)zTIy3iYj~^imkIOO9fTj4g>OeKbs+XwU>4_qae2^r<&Q**$g^8mm_JFU8i8UG-P%N z39>{Fa zE@gBC&0H$54I0RFkABAiCaO#G~juUV-NJM{mgK$rfhrYkf+TR z?i{CX$Ov70MRKGD?iVlc9l2$K-W~@0uoBGAz$8|0V^-3=5xY&yK@sVhsfW*v@ zNZpG29>k$&ti|EF`tXP69EUo9NB8&f$8nf$N@g_R+mad0U3o$^JGBkYu5{h^M2eAiQ_hE8HXbZ6sJ-^U#wmYLl}rr`VY0Sw&r zHgTl{EDjBumLL&rY!_Q)&*l*AX9^XFrG*sBV~JeQ{^fp7OAsj7_)csqvjn4NL1;yV zx*0N761)(UNFo2#s5b6V>e482u?H~4YQBMfk-xvD`KGa$;aBI_HsjPUqZ5#G48=#d7pH z(N4XmJp+RB_7Ky0COjbz1Br;X<;}GI${46P9Lf5}WW^+Th&C7bL?AMOXBolucy5;uLrWfO< zH}KKpV9#(jl*EdBN*YP%vk#_Oj^%%HxHbcJ^(Gls6D^3n|cOMI8Ccii!o=0+n@OYV}Qc*S# zK9lBeRrgNy-Yz`a1H92U^%`PF(0o?9Sv%{_I1WM#9n9e~)ATLDWU|=Up_}fvk72Ev ziqJ5No4v0MXCuPS|6km907g-K|L^XVTpBrghfP2TCB26-cXXt80X4ZK7YHer++Apb zgkqsr5tJ^{q$r>$(nO^9-jps?2))Dq^JZ_81O587@csV|COfm!-n@D9=FOWovk$Ov zMNRzPd5l2J8^8?O#*s-lph3uWz_ekCZ5JAn$UsGj^kp^NI5po)Uq9mLpi%0I!?7mZ z|H;>V)MDdc2{cYys$4;)TK{0Yn}Lga8wd)z!AyMdpy)s({q_bLs5e4|S-X%aO3EfSqO0<8DB(mY zp{XKDC$!K7^1z{wKiR;8F1f6U69iNb-NA(eUJ%15Enjz{P9J~jXn43-AS%Eqk|NFE zVuK;1@xsB_yg|yMl28Q#A~YaZZ9b~G6`Si#Ab&%b;v)^|R+J)6zf=U^L^Rpfa^$;8 z)EaSoLhTkMV?HTJ-0B91N;heEMvTM4Ai;qkhpeg#j)L^C+mwt|X~rpNB_9iP+dVaj ze-A+7@}D;!5uEV3593JrRyL8pIqwTTT7XmTGTvL&SUG7&>nLL1lC#Ml_Zwq*_Xgn*>3)|2c!kSe9qNI0l^|Z3%yo9`unOWk3+} z%`oJp8=?dwPX3VT5LhVh(P>`2WMQd5VDEpikQfapL`_Xyq)fL1D)2WKZApZ?X};7`sOU#C&=VJ}K$Z<)J4w~6AABQ@;Ce?7FnmO!Kc1rjbTOO+{Ut|%1~t-G z)%f>E>GN;kG4%O2to&+dWSm7)zxzhEp>E%Oqpna)ONogoRY?GZrVjuJKxk=5K4|gv z+$ZY*h*?=lU`!APr4opdVnstzzFGP1o1kSr*RF|77nRfyz&dfyf!9wqbs~b?lR%#-i8|Zlmo>B0?i$Rqki1w^o7dXD#4J-%s0^g!PtSNM_Hlk;BK-L=CWHtM5en>aUU zJR)Jhl~6oji;73WY_E7BS3*?*CHMfE`A|!*baNkk933lH1YuM~``pL}4uf+7t~|PQ zSp(ZDUO03j#+k6wM3;`!1Za)ZHU6Rkl=>GjPx!S;{LB`$eC0CEz?(o@EtE^*uW8)39U}CEr zYre!C8j9l;wS_u}I1xea4KGiCg$c#GWO1N@&;8zh{2eW{;7PZ8mqmJN{ircO z1Gnh+Zo>G6f zF!J^RUC9N@tf&Ncw;TwTocpW%0De@ZTlmv*x#+$_L!?VVkalHUN9XL;w(6 zK>##%fwsXCxC*owd1y~p)p=2P4H^ED2rMxW_8cEK(Sm zBxC~H&^zrsYc?6!>5#Y#Cd@AF`cLTVB|kOJ`_ zOw!Q+9nJxm`DGqTBV1nGsZ`MTmk}||g%m=>beDhJ$A7WWJ$VDE(Mt0J;ZvGVHyS9- zm*H!sbR0;NuSx+j0m{`33ZO3U%RQs^Sl(al1*LKVNU59vYDWAW6`K#DS=_SMd~h_l zU@Z*ye9|t0g&`iZscZC;_^RbwYX%y3qOlzpj5x2uEcl*e7QBlfhRnGUI}O*$a={55 z$L9c=07$K6CYh|@4JDx>h+QLBs4_1E@)YKEPytXjFk{l$$`nxaxX_Q|x+emWXT%=^ z_`gyZ%0{rTu$Mk0L|g;+6Pl$QEI|s&P#{psaO2-#-b(s1W@8SnZ!8GOIcA*_0t~L! z)AYsLg5n82FAQMJW3rG#Gas*1lhc^bA>i#?Tgb~(+uw`h4K{4mNY>Oy0TJnDQPb z@k>$BQT_tD2YOU=4=o3R1T2h6?*^&*yAAj(8kEB{k@7C{QIfh0 zDE!9m@CU{VmCdu%7%U&=@)#_s)XTWR zH&B}SgZHth5rk*~T!AFY=kGy%EeJ6@e7`V&)fiDdQqh3mA=$i=DuDce!C}6{D==;s z{W*7$$;=Alx~d`)Lqx!Q94}zM7>TJ3)Rj9G0RMYeQr96T;N|VW7BO|CL>);5@h_E@ zlT0!#*znM}ZU)9}-Xtec`O4f)8-tV{!0`LML97JFFkB!DGA1-Dk}_HS03QGtx?ZA1 zS3;8VUPu@~Nn{a7+#Ss)>XX zV=(V$^9l;lvWU+G$1|EwW4=a}0fPA+UX(8?Vm_Rt6Fmk=AZz7{652+AI)!d# zfuuoqs*%73s?*Q~$)fBsjrHTpTu?pa6=gy-YjSY=1qeomtfb@<{RIt%3}?WEC__<>>q+`;X1-??E1RfY(wCYDuuxT}*^V#OkBK?T%y?5dEi204^w1E=^jZh)Rz zg{6#yvhdJICe(tvZFuWx^HGC+Um#uQYJECyJ>3NKV(Y0!P!*}CaFznsfDj6B(5ttK z0%WAhTew=!iv@1bBIM#YaAkKxgj*iM7xf37#sngWD$uX|m^I9)l>%HX2Iu5026uB6 zprV|s_>mt(0B}Jcg(=BA2>FRFaBLiO;XPBNc?`q=F6^Q;&L|6M4WxkmZcb|=$^%&t zqERgw_+ULs)CFa)46I0mJ|Z3TgMbw%l51#<1f&yLfR!rAsXP6N&+^X1*+uDh1*`q% zy+Y!{M#gujQ~Qf-=h0Xg%P>0?^fHol-yTgkf22;JvL52CSlq z00XG09?D=)MvFQaI5~Lo!N5KFi(UJX^q5%y?IgI#3^~lavuhPu_)NA z%F-Kiu@SQse?qJ4dZxSHr+Y8(kPO@+5Hki{q{+oXDiBvXL5t3nU5p8 zEDJmWx^}WzQ_}JW_A1OfKi`1NeB7g25FEP2~grKp$C;D`GUFYTPTe4n|!FS4o?fAVT7cF9XV{?yI5JwT>W z$UjxA_|VnVFc}q-yvPj!xjujz4G>7c11hMscu;Gn{rA>F;e&+AxBh5OCg}y;_u>2v zg4qjeWGpG901qQ^3oaR<9$E22^ds#WmwL!t47j57f_Vbvr4=R$!xEfC5b8?g6euU% zbmFCa;?Qe8)MknV!q6dn9#n7`&>j$)D5w34G3JhwE=b!KENrjh4jq`BaL#J zUs;D&9NXF|Z@C@C^Mhb<)y!$t!C<*x^U33EPk<)ggMg`sVIY4eXN1lhS#wrx0P zZGhw|-5>NrfZ$~Pjy|N~)S1t&!}Xu|G-Gef@2dhd$i+`+;6Mn0$a2gxe)#0M28R%E zyhtoKHI%=87SN?BJitNVxM~zkvp(aJq59%9n==Oz2DB7&@E(7V7O7`$?z`9XlOJ)` zU|HWW6@SXvNrySKk3OC{b?PyAkzPsHsD1rY#cpmyx?eOqCZ{ynLg~6r44724`F`?F z-D*khX-Uek%E`7AYe-L9rZps^cX(V_NN}>n-oqAR zxAsVLIPLvH9QNdpw5$|s-{54s#c6c}r`dv{Q^R6X!o!o2EMZZhp<$^Zc1u57R#39d zZVd_x4hsto<=J}Kl7j6H&_^J)+26wRS2)=%oazcETQV{LR$`lMXPPZ5K0Y_AkKK|T zSR+xkWyuyfv9&GBnke_SWaL`ar0uPa+zjW-Nweg{#&)|asUV0b-vFnDli>bG?aZ(^ zlY3H2jiOOVKs{clxF()zyZgW&{Oalt3yyJN*pZQzYz;~7nVXgF0020)A|#@oXK*Fp zeBtOvcqjtr2WNx>I)j{PnN~S1E6tf^$w=#OA;im>mVR=U%_%2Yw%5vL=|8qz!4X}9u@5k|p0 ztQg{k!pU%I_&xZmyM;f5zoc7uGW;Pgg^8!C`4__<;TB#4KQ_Pq6oW<>Arb});B*wi z8HqT8vn?ErA~j4DRmv^A3jT_2;h*6z1EGK92Elt#)SqEXEin`W^)-P4aid>O>Q0=mdb2?`C44UXaiEQO|qw4_`b367B5tTbX3pc5b1b@oJk zabUKnTIi(2bg*P*XISm=@eb}ua9~trSQFB+k~4CNvBb+6wmx!wxo27r@DhjB&Y4lF zB@L58yquYqBG;`aJFFS0!5P-9z#7RGK7y6PWFo3>fo zTtboSDpX?UvVkMm;z+PtQv+)#WP>_Xye@;E`ti?rYE{odj(`byt@Zx9hy^|JuO*sXmDt-m+ba4yHeXyDGoB49c{|C zWu-WX+hWjQT0*I^wXY@FDfhNwe#Z2T)b!Gl(Zgm>bN0*(R^e%c!AR{T?(|2v>t#)L zVy3TFP4@3&v!`3_3Ce5~oaRW#%FW0KtnrE{@MQ^6l`?_d)?P*-3Gh__4HC_(VVw3A z`26~B=eA_6OK-dG} z-{a(WlTNk;vl7iq2^J@2F2b1dSAJn6V}k18>`5b$vsf9jvagZjy(gYT8*1Gb!CPre zs^L2blYFIypS~29Ku{#1sPP(vWw-E3q^I$%#;-+~aI1#5B24tChPNSH72)5v-Iki_ zusUV`dU7bS1XmDKFdA2w|5M}z`z|O?29I%v-w$E;`YBBHsr5sn@k08}2$R&O#=q_A zn?K{xTZnx}zSp~}XtH4K+Uues6`@?tDjY$UFx&>{zdN#8UG5NX6&ZE^+{zg8LI z4Cka-xtU4e(df+-3ph9yHCawauvdYQs7|2W{fwNhLIFSZsTwYZHq#nR4Hri^;H5B) z7d5^#;@!gm2osLg_^Jrg7*WH)2veV{;ShvL+E&962v>P2Op>vCJn;lI9Qjgu3bU8u z-P1=QzM)$@g*&_ycCU}(-SbBy><%A=-Rq;Ud-{3^(-=_UrEsm6!tVI1|5ADi$GD}Z zuzPxja2>aJ3cHt2VfXYVgx%qxuzUFwc27_9uzR=(!o&mB_RK|?_|Yrke+BZ^nxcPC z-l8_sim9VL4Wk4ShodJ}!s+C*C_}_9CtI>D$rw3}iW&L1{--cQ^Pek)HzkuZ_dK5fqtXbqnX^!j+Xf4ucg^>yUmZHe8Tb;Rfs2^kq zSA5_@45i_#t<#!q zOYVs}su=KXs9U(MdaCu=jV9o%nseqZrf(r9rk^gA?yXzd0nJ-t})M!vX<>aQ>Ns;5U z_C@;PCCSe4pO5=O#g`+bkHwK05*&%XRqKd#ShWzrFAsva4(B|odt?iYf7*nTmp$ivDp=-veR3mipK0=7PE9PwB)^?qxc8HF|cE2kD3A zaM|gf&ebZ9d|A(a6mYje*@RD8ulyZeZ$f%^`u;s_IfHvxozOs8a{{Xck_uDCW=Ty_ zML6Yz8vh^ED#GXG75d+d0Z40+{|sY+vZo-=F;|}U=B{m8C$#R=D#0~8lo#zg@OKT{ zcIwcP?_RV8Uu=+@mXX5e>~t)U1;LCuN!}qxG~T=ok9^@h(Q#AGVW|Xj2JOi7Yp(81 zSyLJz-ULTwG=_7r;VcWbu+%*(;M8eJBTfvpS{fE`q`1P41hy=NCdfnkUX;Hn+$*A? zf-zj7qETpta*u&XWjy~54K+i0cN+R1ah-zs^IO20fI9EP(Ry1AKZHLJ?w{@r##Z|K zdxL$ErzYxD@%0yE!hhR!FYFB-LH)GOAU$6=-2VvoZn6aA{>m@TM}Md7ua1@fsmN~L zx&d2OH)}NqN)7;A65sp5k@`vvtK$4W?T^B(0ots!IBl6}wDN=g8gem|FxB;myH6692s~LOJ9mLBTb2aQYdz} z|F|rpzmYG|)UuYLEK;@5FBc{iX+3Cp$u&Y&JKiNCJuU73H3=1pWxwmA0xY4P0jQ6} zvK%<9==k*bzpR^&n+)vxp_3kdyquNu^yJj#!vFh0rua?`f(dN8`XfOqOy3Sznw`5?V_F#5dBTbj8q*J-M)cpGrZMUDOLd!?YfP6v?)mmR zH8rNvb2{(8=B+VF84JJiy)KzP+&ww$;9kj8{b`L3F)JlgnAm4m@D$0kqs4+p%LhoN zq!zumtg%R@kz*FmZQN8c)!A(8-!w=vtyrg>zNWZjDzoG4#+i>qQ}nF!kFTB)O?{^1 zES$DYG%EmE}E8)n|I^+Q^Azmx#*sQmju(pphb~a4hW|Eo38Jxw_Y%H z`zj}Q*CN5RcfuvZ$CCw9ze>qtrwkEHUzVC*Wp9>XTKw6Pdv&@CrV|(Hw?5ufFwMKQ zVCcd~!BpeBvC;y6!BlVDfu;wG2&Nu~%KXsv!E?5BbIAV01JBt?F{jM;OP{kwy@zX4 zM?7cuPHmMFQlGOewO0AfZSb5m3EMa#yz+DQ>2}d#c=C+hA7<=b<=8VeuI2p=gTHyk z-kesmh5w{y%zWbG5W)V8*_Qq=wL;rxY<`t1o1DSV*p#KsAM1Uev3I@Nf3)xFQzpOm zM=W}0w_Sa= zK4M{8X4dcg#UobDV^&JbF^^cQL9g4pe)bSA;JbjM;_c4!HuJ^+@pYo5` zm3fb<*`GaRnaymquAOWYG(=zaNwRkd4aK z^h@gakbV2}^FNZdG{~kM#xUI|CUiX+!{x{meZSFC1|2dZ`M&4u3FU?8(w#+@|SAFKzHc#)e z#+^dmId|qRYgT9AKKtgo?D5$uRh}-o%UZT9vU%{>yR1>QPDKRgUG`eP@~!*4ahKJr z-Rsb=b?>sHZM|-_^1sV6%e{T$3*B8dtygR*;mRHM^w9Ff&3E5ndYyFdgXMSF+wGf$ zubzB|U3o8c#;N{y*u>%69rxe9!@Aw7b4h4;hmDV#7xcK=9ac5rbj}5@J8W?|`!DOR z-)4C~cbfA4{@bkdlU3{Md~=&!&R%Z&dFpNURw>=OUITBlNaOa^XA^I;UgfK0H)?d7 zCFI^YGp71&mZr_}{lV)t8mz>PCP+!Qn6a~I>Imr;JNe=1i6hV7WGjBT{~&eq zP4=05yq)_a9KWkIwNP?`(yLj!{+wxoo)H-VCzyduC&f)U1Q?z znu7D$@Dt|KoqhA!_(l9q+Zf!9M!@#;}XNc>efcZTzMv4;+ua$Q;|Bji0ms zSN3kq9LxUnU)iT2NB4wDzp`x({rtR-F0cw2Ws`DWyTC>duN(dSSLc~m>1U&F#GPmQ z3bTKhvGyGM?Q*9LtnN7$T0SW@`0KN*SL428=Ttw-yc)BQ=S?`nTDK7D=(i8D0YkMI+_PYUx zSelnycUjy0tjyHI=e$SnP&F-reZXy*n%0oS<|)G9weR_z`RpGsxjg7!E9!+@(m_m9mclb9*ysme#lNp+>vZ@ z6GxkxCC9QJ>4}k==HprTtS?5#`c7o248oXYm z_00C4u!UK>hL#PT#!?;*IZ>|I3|6~b*&~A=%w&G+CI?TsIg3qLTzRJM@@&>7zW${F zXXmiA*r~g3{rnlbarrM<*x{13f1CRy`?c$>y(L1vVusxxuk%^`6-(^+bE5-|m$ShBpYBQBzntwI ze(d~D2`gCLOVz5}_-zHNVlQtxGhihv{q7_Er#@e^^zWTr%1{5AHJ zj`R)RutAxNy2W)^#agvy;`U!xvHHW;Pp|OKx2(AK^W0G5ckJ1Q=_j@GzGHW{Ux}Dn zcQp&N?6`dGz-qRt&F#L=)4yl6^SpcR)vjS{f34FzVa6I3=CSU(FJjlSA&Gq~UmsY@ zu2lZ?);qR!tjEaqHJ*E~XW?_wchq0Fo_)AZ-*I}C4XmE@U5khI4QyYl_Vre5+`uAN z&Z)Sg*bl6sbHN2u@(*mpPq`CHto(spc(2TBO>`UC{)I#59O}H0&Fj#=_>T)VvgE!4 zh820dkv)2}Qul4EAKAgc%Zt{}`jHujrHy>;&W~*6HqFM%O*gSIRqkc@Oxwif_CB{{ zbp9qbeZ$s;nT>y9Z}z$U;o?tzVzyHcdcU6k6Pwn0>71rbHnU4@1M1J6wwZ;@pZsp( z?ai!R>360Lczp}A>eCK9n7xIyJzP2I(8De4OJT@}V(qsw$K?s*zg)DHy_S-@ewk() z`|x6~1mj!VSaSM-_4~is#%^8<3cqjM&Q47(>-}!}c2<5wmpMH)Z)dv3yV|ex-@$6l z|Db=$z#Z(DvFrNxJ+_0HOC4L4AGMPiyV)XM$#_-a&}k1p+HxwbuRikI8R zzKxIieoKpeEN)K6-K?Q3>`)lN6`yglFm>oe`< zfVN*9VBgmsyZ6$C1FYnssC{e79b}~k|9E3(n}f`E>ynve-#f^jJu-IrZ1q7_eAoIh zz48yTNz*!Pv{gIA_9fNJUh(E3wx->Yve6R{v7Bms8a~)|hy}(Dc0LjgvoBf}QC2~Jilr?)$}~MzKRI*mC`)V* z`RQksj|Rm9y6T!jfta$|?8!7dEbJ z=#ClQ4PG&|V(;;%*;k=Cqvx$W%@%!PHX4tfW`WDY=d5^qn!VXCtl5OhXV?L4f^kX1 zGpy$1_lxOzo?&aJewzL1s55MKh^b4?S7(^~u;a524xeGt{Rs-9i@*@IT9T z)*s*Pt)^#LPMWU9u*|dUMEImJw z+IjZ#7tLQU+U7hfvE@`k&wl4wl^rMT{&UZ>O52*ZVSCQAq2d0QHa$AezQ1Da_I0%j zOjBu0e(??$Sg2pCYUc-Go;|&Fag8Mx*t20RY?qE-U|vh}rd0L(m7V&i)0DF@zp_fU zi8ZVD_?4w^Yxnm3$-lDKt|rfTW6Q7XvG3K@Z6Ex~=1ZnK7iwH&qqB27D!+M=ZEG>R zu4e2-R$V{6&nFu%vX6%PxA^VeMb^pD#ZOoJ5<8q6`{b(S68mKM_sy0}xx`L>`)iv{ zdoQu}Rl?WaG+buwLn~|?-{3MU5tY=X$-v7j`KPL*10ZKiJ!idM=iX)J)A!y}tmN3x zDeVr8bY5YbANIfb?CUG6_@+!&^WhbCe0|iA`1)6w>GZgG>w8z(=)GrKU)_C`HT~|! zu?pp{v2TYg+WmH~YfNggU_r#%YixLfIenX#_>C2N^oD*y_HXQAlzzVLz;A4MdX3XX z8RV;OS=~FXy3VZ9fNi}R-EheP`RrfolVFt%)5V^2)Ck+{5y4@6yS+y)jHt-2x>=-A zcpG|$xp1V4{u`>$WMxzRU!UR-I-*|sL395<*B*f-&WP)iEpCeL{OHkPZq3$Q>@(J zK*e7&%2SPSc&uBoNr+Rme<|?W9EwRay;t*-X1SA6xXfz;T{eqVj2zo^D0n3#;vE?{ zv<3jdy&Q7m4l*{yax<*Z*JH^^<`F3{bV+vNTv&lQN^Mx_ zYm)2+37XNKH={G1R&=;Pp+pUN|MIjiR^7f)dvohX@hH6Dcp1lB0m9S-%83|Q4P`jf zVD2W<5k5z}jQv-@=g76n8ENS_rPtn>(bSryKoKu@!7i+=k3)9!bKtm^oSK`(53s45 zCup;hvY{=zUjy1L1t92Rjter3O|@f}l}-hyIjnYjmMtFrs<1J|)J`VrSO*NGd%F(L z6?A7jZQ;PUmJDlwK-$@H7SaM}hd6&VIQr2hTo7Cc9C1L}aS0O4C+~tQMTGHyV);h| z`hGl4JHpW~7*7#yf1FYH3T_fy4>xF9F+{*t9*Y@Jtc z>6n5tNqw(cI=(6f)`O6O-~Wn%m8tt81Ecy>=Ft=WmQRZ&_R&bs& z$x6dH#cs>awx;myde?rMoK02=-13x;f)-@v3=r1X*bB5J(V-P^N2hXjrBBZ^>=yRn zvnzJ=cwU&mSyJgdOqzwCn1OWw75BP>kIldufU{~nBWH%S@g!XJacf6k_-Wg-KOFts zv4JM;17|p?mlG2SarvI5PtX4>riKu*|+Q_PG(ii(Aai_JqQK_0T`&cT!L^KxZ8Gs+%^ z_%ev^1SF8vmuuXklhRWAp)YU%n+_<+bU+C#*p^8Qmfiq?D)oGeGRTVfJ^VP5k;mU}2$LkP;sjt*N84CX}IO4c8*58ABAI?1u)$^h29UdJ2 z!|@yer8Ac3&I!g@E8BX@T-I$aVAs+1qmM$=pxxsAQVx$gfPe z?Q(5SOXI%DRx1viw6-}rSgq+)g6pJt6BsFV!C^gXH`pF`#C)EDwzvRmgfk~DZ}Y6| zTqo?vGpwzxPMVCVf@Y926i}3^TH0*c?Ez|=tc-qz05szA7YG-XH>R_)%^ha z9Gv7)h9rzeh!dvfW)!~5a+f&hN(nBJ;M{ybmHjoi0%8 z8wF08kj>5##iBD0yHykZ4h>xmIil=mxz6cyyQ`0+2OXX5t z@{=nKM{(pRJ;hTV3RAts;ncKL2l;hyf5z!ifN;BJ|X!b!Nja6iGVgjc*nt`1ynxUz6X z;MSNRpWt~9&zo@P;l=|_;=|-7z^QckM<;63(>k&ZhlNvd+#c!6G*L{Jo-|ha%?EP; zwf}F-=^O@R;XHgIp1+5I3|K(?h|5ELW%29|h98b+>)Z@36S%iy65hLq$uduc=Py_X z3N?a*1+l4--}cgg%L1)(oxGO#?gHM^uN9K;fw{0n?Iu^+6NXv)SsLJJ%j7bEbnk`QkMAq8dOAq>NlXb~4{B=@vB z{Oi@L_j`lf#J~(|s#BKjxDUZuBM~RVDI6~+Cf4>+UXq`yidLXJ!s$*|xxe5^^nC?S zf;|!LKcz7?Q}DnGLVEf|;vL9D1gh>3`eh>Hx342ukpjEIbkjEanojERhmjEf453X2MliinDgii(PkiiwJiii-}7 z4vP+tj);zoj*5;J#oJ4*Z>2lzz!$GBiv#em!c2Zmr&8kGJ#Ly{M<&-k$ z*mZE(=XHfXE8!VXP=+-t#Z^LEyeCRgAWT=en7c20+5LZglyy?_}|Bqc&qDV zxU#-;Wu^NeHIt2&A!?h*Nh+ zPkj86t4@{1lW?6?7M<^)rUa6whTNwo#w#^|L~7(M(*nE}d8^?`eOMDuYO7j?s=Tns z&}Z9~k&kPK>c|ik01nhQbO(+c$ZgJ1K0&0y^Crq7CC3mvX&xGZr{1mX-}kN4uAUM3 z7HMg`cz^-X+Us{|v4Z2bcxA%~mW!tfzdet9uOU6nowNo}!z9CyTp)-VolcMM73vKh zo<+SXc$f7l=W8tD((DS zl7DmPdn4!0TetqFEqjiiXf|c-uFbpmG;iIeOV_s(hL0Kh)ik)owacYpKV z{b$efGIM@8Ritv3twP0wf$uI|Ht72`rAk+-+@xviHg9x$^X+#Bef`tHLnrfZ-nBc% zI&&vi3l5pTY}NWLdybs?#Pso$(6N>GAKd-Cb(?P8Jq&)v>LJ%}WZ7csu?CIDjqlJS zck8yj`;H#F`0TkLCj<;Rr5)19P+qGqI(TuByf1W>JqMT9lr@Oj5N)K^LnC_VJ&Jm@ z^(*Gl$wQ;9;N__?XgoBMMx*i3>NMVZu}Dc>Ymf3CT|6XxX`i;*hMFLas4c4Z^NH71 zd@VuF)b@HUZ>w&|mzr|=Ax|}3JxY0&@hss}!l#$sOJ7dk)uWcKiC1l{k5<%#dDqsK z(|c?379%Potd%BjuA#2RPgB<;)=*0~tqq&49eli+hmTH|H_tfuu7@bs)FXDZHgBD#yvEO0 z(Bl?eQ7h>@aIdMsQ}WVzOGUIsv8Yr`SG;Hmv7}U5D(hQ8SJ6;etSa`>rc28-UrB4E zJ<>kupwA)C!_pDyxOiH3M!KlIBwd&DwGX66n#ZC~^*Z%iw;4NQ#>{s{PMkbv`Rez- z(tCJD*Q?+8_TGKk5@n)eI(HegXz8-GQKyT2Fnr960%9auY~3cs`sO#Q%2)6(czKs7 z9UT|HVByhYo-yObFYxfHQ$ICr?1ZAWg!R{NbW6JP&BO zlGSTA>AihQR*Ywj+s&K5bJr}7vgHC^tIsZ8yYc*|&04w2Yt;fHV&j{=-m-0nPMwMN z5|gc|>5jew2aTA!XxWz=_AXtPWm`A#?SOZ58f}m!RU?K3=MAZ-3G=I*B7IeDRc)Xl(z|uT!7-ktybNXPG>+3G8$3fx>HIb2b)qR&+d>zj_44raFv-=m zKAzEPS*l#M3MEQ=wnhbwe9L-x>6;mEf()$*V*Ly|R)|Sruu5L;PpJtw3O&XVP zX6WGC+`}vHUK6j1nx@TTG(`+v`Zy1-!O>+s>S!u-7X89~hklxx>z%i0M9XB~VWGxS zV;2o+I{UjJaUM0bZ|bXgHSr466(90tcWVo6oCi#UK@uN7Fbq3f({s+n!4ZC9MST&i zVeqKo+H{?-#?!+%A+f2avu@r!FNYz!WRw0h6uNkp&HG?*Q_Xt~{7MdMTUoEqJ5)SswJAQG zz4DgER`ji{^~8wK=Y2BtsJ5uaSJOwEpvU;~^U=nlae;<_)`L6xR0J&1h9XGn>5;eN zHLqd%|H#8#ygY#}oB$i=qAOVSf_BOpwJrRCZeiL4qq&uYy`frJ7_Und-YPyzC{|jo z>?0>uzEOKtt(u{7ZQH!lwWS4#L6sgS1`E&R=o!xwqo0arqD3$Nn5w>KV!kM1i3=$+ zJ1(?>rP=LDvs;=XEp79A&2HDm=HGt$n%V7zJ(dpEeX~0V$Nf7Br_Xd+de+kA+Ij!3 zdoRuIDht=U=8J>63E8;3AV?HN3ID`q-k~Lpq7|GKrA7Z0)Iei zlx+|_G+t6Au@3V3AZH+oN2wYe*oTMY%}XVaP^m=W3Q`>4Q){UxHWRh@n1m=A#CD?O z;bTY=B~NdU=2Cf-CyFseMAWGB7OQ%SsajDFpro>rR%6uq!mAf?uZc#`RFo>=p9%MB z8$`+5Qv_cYbEN>Ww?->@ih9inAOX;NP>GU3?y+Ei)Y1;bOOGpq0-M*}scG+`BeMd?K8Dqz#&SzhX7pf|k;ABeST(5X7XQ|^w*;T;2hLORfz(6H&Uk~pQ!f}Fj)yA)3(EVAy_Ic00&x~ z!6125(&F<9G1_p0SVSzP6a7$XQC^}hMVy5^&~9r5k4z6CF)v?eiMvf*Ye*Vs{DPA8 z+$Wr7uIGAO@4E=sxQZI#9Zy^@laiZ^JGmr721M{&=(a^|duTKTA4HLM%9;|C)K8=1 z*IZV_ { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ "./index.js": -/*!******************!*\ - !*** ./index.js ***! - \******************/ +/***/ "./node_modules/@deck.gl/core/dist/esm/controllers/controller.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/controllers/controller.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Controller)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _transition_manager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transition-manager */ \"./node_modules/@deck.gl/core/dist/esm/controllers/transition-manager.js\");\n/* harmony import */ var _transitions_linear_interpolator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../transitions/linear-interpolator */ \"./node_modules/@deck.gl/core/dist/esm/transitions/linear-interpolator.js\");\n\n\n\nconst NO_TRANSITION_PROPS = {\n transitionDuration: 0\n};\nconst DEFAULT_INERTIA = 300;\n\nconst INERTIA_EASING = t => 1 - (1 - t) * (1 - t);\n\nconst EVENT_TYPES = {\n WHEEL: ['wheel'],\n PAN: ['panstart', 'panmove', 'panend'],\n PINCH: ['pinchstart', 'pinchmove', 'pinchend'],\n TRIPLE_PAN: ['tripanstart', 'tripanmove', 'tripanend'],\n DOUBLE_TAP: ['doubletap'],\n KEYBOARD: ['keydown']\n};\nconst pinchEventWorkaround = {};\nclass Controller {\n constructor(opts) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"props\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"state\", {});\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"transitionManager\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"eventManager\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"onViewStateChange\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"onStateChange\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"makeViewport\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_controllerState\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_events\", {});\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_interactionState\", {\n isDragging: false\n });\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_customEvents\", []);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_eventStartBlocked\", null);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_panMove\", false);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"invertPan\", false);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"dragMode\", 'rotate');\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"inertia\", 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"scrollZoom\", true);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"dragPan\", true);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"dragRotate\", true);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"doubleClickZoom\", true);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"touchZoom\", true);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"touchRotate\", false);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"keyboard\", true);\n\n this.transitionManager = new _transition_manager__WEBPACK_IMPORTED_MODULE_1__[\"default\"]({ ...opts,\n getControllerState: props => new this.ControllerState(props),\n onViewStateChange: this._onTransition.bind(this),\n onStateChange: this._setInteractionState.bind(this)\n });\n this.handleEvent = this.handleEvent.bind(this);\n this.eventManager = opts.eventManager;\n\n this.onViewStateChange = opts.onViewStateChange || (() => {});\n\n this.onStateChange = opts.onStateChange || (() => {});\n\n this.makeViewport = opts.makeViewport;\n }\n\n set events(customEvents) {\n this.toggleEvents(this._customEvents, false);\n this.toggleEvents(customEvents, true);\n this._customEvents = customEvents;\n\n if (this.props) {\n this.setProps(this.props);\n }\n }\n\n finalize() {\n for (const eventName in this._events) {\n if (this._events[eventName]) {\n var _this$eventManager;\n\n (_this$eventManager = this.eventManager) === null || _this$eventManager === void 0 ? void 0 : _this$eventManager.off(eventName, this.handleEvent);\n }\n }\n\n this.transitionManager.finalize();\n }\n\n handleEvent(event) {\n this._controllerState = undefined;\n const eventStartBlocked = this._eventStartBlocked;\n\n switch (event.type) {\n case 'panstart':\n return eventStartBlocked ? false : this._onPanStart(event);\n\n case 'panmove':\n return this._onPan(event);\n\n case 'panend':\n return this._onPanEnd(event);\n\n case 'pinchstart':\n return eventStartBlocked ? false : this._onPinchStart(event);\n\n case 'pinchmove':\n return this._onPinch(event);\n\n case 'pinchend':\n return this._onPinchEnd(event);\n\n case 'tripanstart':\n return eventStartBlocked ? false : this._onTriplePanStart(event);\n\n case 'tripanmove':\n return this._onTriplePan(event);\n\n case 'tripanend':\n return this._onTriplePanEnd(event);\n\n case 'doubletap':\n return this._onDoubleTap(event);\n\n case 'wheel':\n return this._onWheel(event);\n\n case 'keydown':\n return this._onKeyDown(event);\n\n default:\n return false;\n }\n }\n\n get controllerState() {\n this._controllerState = this._controllerState || new this.ControllerState({\n makeViewport: this.makeViewport,\n ...this.props,\n ...this.state\n });\n return this._controllerState;\n }\n\n getCenter(event) {\n const {\n x,\n y\n } = this.props;\n const {\n offsetCenter\n } = event;\n return [offsetCenter.x - x, offsetCenter.y - y];\n }\n\n isPointInBounds(pos, event) {\n const {\n width,\n height\n } = this.props;\n\n if (event && event.handled) {\n return false;\n }\n\n const inside = pos[0] >= 0 && pos[0] <= width && pos[1] >= 0 && pos[1] <= height;\n\n if (inside && event) {\n event.stopPropagation();\n }\n\n return inside;\n }\n\n isFunctionKeyPressed(event) {\n const {\n srcEvent\n } = event;\n return Boolean(srcEvent.metaKey || srcEvent.altKey || srcEvent.ctrlKey || srcEvent.shiftKey);\n }\n\n isDragging() {\n return this._interactionState.isDragging || false;\n }\n\n blockEvents(timeout) {\n const timer = setTimeout(() => {\n if (this._eventStartBlocked === timer) {\n this._eventStartBlocked = null;\n }\n }, timeout);\n this._eventStartBlocked = timer;\n }\n\n setProps(props) {\n if (props.dragMode) {\n this.dragMode = props.dragMode;\n }\n\n this.props = props;\n\n if (!('transitionInterpolator' in props)) {\n props.transitionInterpolator = this._getTransitionProps().transitionInterpolator;\n }\n\n this.transitionManager.processViewStateChange(props);\n const {\n inertia\n } = props;\n this.inertia = Number.isFinite(inertia) ? inertia : inertia === true ? DEFAULT_INERTIA : 0;\n const {\n scrollZoom = true,\n dragPan = true,\n dragRotate = true,\n doubleClickZoom = true,\n touchZoom = true,\n touchRotate = false,\n keyboard = true\n } = props;\n const isInteractive = Boolean(this.onViewStateChange);\n this.toggleEvents(EVENT_TYPES.WHEEL, isInteractive && scrollZoom);\n this.toggleEvents(EVENT_TYPES.PAN, isInteractive);\n this.toggleEvents(EVENT_TYPES.PINCH, isInteractive && (touchZoom || touchRotate));\n this.toggleEvents(EVENT_TYPES.TRIPLE_PAN, isInteractive && touchRotate);\n this.toggleEvents(EVENT_TYPES.DOUBLE_TAP, isInteractive && doubleClickZoom);\n this.toggleEvents(EVENT_TYPES.KEYBOARD, isInteractive && keyboard);\n this.scrollZoom = scrollZoom;\n this.dragPan = dragPan;\n this.dragRotate = dragRotate;\n this.doubleClickZoom = doubleClickZoom;\n this.touchZoom = touchZoom;\n this.touchRotate = touchRotate;\n this.keyboard = keyboard;\n }\n\n updateTransition() {\n this.transitionManager.updateTransition();\n }\n\n toggleEvents(eventNames, enabled) {\n if (this.eventManager) {\n eventNames.forEach(eventName => {\n if (this._events[eventName] !== enabled) {\n this._events[eventName] = enabled;\n\n if (enabled) {\n this.eventManager.on(eventName, this.handleEvent);\n } else {\n this.eventManager.off(eventName, this.handleEvent);\n }\n }\n });\n }\n }\n\n updateViewport(newControllerState, extraProps = null, interactionState = {}) {\n const viewState = { ...newControllerState.getViewportProps(),\n ...extraProps\n };\n const changed = this.controllerState !== newControllerState;\n this.state = newControllerState.getState();\n\n this._setInteractionState(interactionState);\n\n if (changed) {\n const oldViewState = this.controllerState && this.controllerState.getViewportProps();\n\n if (this.onViewStateChange) {\n this.onViewStateChange({\n viewState,\n interactionState: this._interactionState,\n oldViewState\n });\n }\n }\n }\n\n _onTransition(params) {\n this.onViewStateChange({ ...params,\n interactionState: this._interactionState\n });\n }\n\n _setInteractionState(newStates) {\n Object.assign(this._interactionState, newStates);\n this.onStateChange(this._interactionState);\n }\n\n _onPanStart(event) {\n const pos = this.getCenter(event);\n\n if (!this.isPointInBounds(pos, event)) {\n return false;\n }\n\n let alternateMode = this.isFunctionKeyPressed(event) || event.rightButton || false;\n\n if (this.invertPan || this.dragMode === 'pan') {\n alternateMode = !alternateMode;\n }\n\n const newControllerState = this.controllerState[alternateMode ? 'panStart' : 'rotateStart']({\n pos\n });\n this._panMove = alternateMode;\n this.updateViewport(newControllerState, NO_TRANSITION_PROPS, {\n isDragging: true\n });\n return true;\n }\n\n _onPan(event) {\n if (!this.isDragging()) {\n return false;\n }\n\n return this._panMove ? this._onPanMove(event) : this._onPanRotate(event);\n }\n\n _onPanEnd(event) {\n if (!this.isDragging()) {\n return false;\n }\n\n return this._panMove ? this._onPanMoveEnd(event) : this._onPanRotateEnd(event);\n }\n\n _onPanMove(event) {\n if (!this.dragPan) {\n return false;\n }\n\n const pos = this.getCenter(event);\n const newControllerState = this.controllerState.pan({\n pos\n });\n this.updateViewport(newControllerState, NO_TRANSITION_PROPS, {\n isDragging: true,\n isPanning: true\n });\n return true;\n }\n\n _onPanMoveEnd(event) {\n const {\n inertia\n } = this;\n\n if (this.dragPan && inertia && event.velocity) {\n const pos = this.getCenter(event);\n const endPos = [pos[0] + event.velocityX * inertia / 2, pos[1] + event.velocityY * inertia / 2];\n const newControllerState = this.controllerState.pan({\n pos: endPos\n }).panEnd();\n this.updateViewport(newControllerState, { ...this._getTransitionProps(),\n transitionDuration: inertia,\n transitionEasing: INERTIA_EASING\n }, {\n isDragging: false,\n isPanning: true\n });\n } else {\n const newControllerState = this.controllerState.panEnd();\n this.updateViewport(newControllerState, null, {\n isDragging: false,\n isPanning: false\n });\n }\n\n return true;\n }\n\n _onPanRotate(event) {\n if (!this.dragRotate) {\n return false;\n }\n\n const pos = this.getCenter(event);\n const newControllerState = this.controllerState.rotate({\n pos\n });\n this.updateViewport(newControllerState, NO_TRANSITION_PROPS, {\n isDragging: true,\n isRotating: true\n });\n return true;\n }\n\n _onPanRotateEnd(event) {\n const {\n inertia\n } = this;\n\n if (this.dragRotate && inertia && event.velocity) {\n const pos = this.getCenter(event);\n const endPos = [pos[0] + event.velocityX * inertia / 2, pos[1] + event.velocityY * inertia / 2];\n const newControllerState = this.controllerState.rotate({\n pos: endPos\n }).rotateEnd();\n this.updateViewport(newControllerState, { ...this._getTransitionProps(),\n transitionDuration: inertia,\n transitionEasing: INERTIA_EASING\n }, {\n isDragging: false,\n isRotating: true\n });\n } else {\n const newControllerState = this.controllerState.rotateEnd();\n this.updateViewport(newControllerState, null, {\n isDragging: false,\n isRotating: false\n });\n }\n\n return true;\n }\n\n _onWheel(event) {\n if (!this.scrollZoom) {\n return false;\n }\n\n const pos = this.getCenter(event);\n\n if (!this.isPointInBounds(pos, event)) {\n return false;\n }\n\n event.srcEvent.preventDefault();\n const {\n speed = 0.01,\n smooth = false\n } = this.scrollZoom === true ? {} : this.scrollZoom;\n const {\n delta\n } = event;\n let scale = 2 / (1 + Math.exp(-Math.abs(delta * speed)));\n\n if (delta < 0 && scale !== 0) {\n scale = 1 / scale;\n }\n\n const newControllerState = this.controllerState.zoom({\n pos,\n scale\n });\n this.updateViewport(newControllerState, { ...this._getTransitionProps({\n around: pos\n }),\n transitionDuration: smooth ? 250 : 1\n }, {\n isZooming: true,\n isPanning: true\n });\n return true;\n }\n\n _onTriplePanStart(event) {\n const pos = this.getCenter(event);\n\n if (!this.isPointInBounds(pos, event)) {\n return false;\n }\n\n const newControllerState = this.controllerState.rotateStart({\n pos\n });\n this.updateViewport(newControllerState, NO_TRANSITION_PROPS, {\n isDragging: true\n });\n return true;\n }\n\n _onTriplePan(event) {\n if (!this.touchRotate) {\n return false;\n }\n\n if (!this.isDragging()) {\n return false;\n }\n\n const pos = this.getCenter(event);\n pos[0] -= event.deltaX;\n const newControllerState = this.controllerState.rotate({\n pos\n });\n this.updateViewport(newControllerState, NO_TRANSITION_PROPS, {\n isDragging: true,\n isRotating: true\n });\n return true;\n }\n\n _onTriplePanEnd(event) {\n if (!this.isDragging()) {\n return false;\n }\n\n const {\n inertia\n } = this;\n\n if (this.touchRotate && inertia && event.velocityY) {\n const pos = this.getCenter(event);\n const endPos = [pos[0], pos[1] += event.velocityY * inertia / 2];\n const newControllerState = this.controllerState.rotate({\n pos: endPos\n });\n this.updateViewport(newControllerState, { ...this._getTransitionProps(),\n transitionDuration: inertia,\n transitionEasing: INERTIA_EASING\n }, {\n isDragging: false,\n isRotating: true\n });\n this.blockEvents(inertia);\n } else {\n const newControllerState = this.controllerState.rotateEnd();\n this.updateViewport(newControllerState, null, {\n isDragging: false,\n isRotating: false\n });\n }\n\n return true;\n }\n\n _onPinchStart(event) {\n const pos = this.getCenter(event);\n\n if (!this.isPointInBounds(pos, event)) {\n return false;\n }\n\n const newControllerState = this.controllerState.zoomStart({\n pos\n }).rotateStart({\n pos\n });\n pinchEventWorkaround._startPinchRotation = event.rotation;\n pinchEventWorkaround._lastPinchEvent = event;\n this.updateViewport(newControllerState, NO_TRANSITION_PROPS, {\n isDragging: true\n });\n return true;\n }\n\n _onPinch(event) {\n if (!this.touchZoom && !this.touchRotate) {\n return false;\n }\n\n if (!this.isDragging()) {\n return false;\n }\n\n let newControllerState = this.controllerState;\n\n if (this.touchZoom) {\n const {\n scale\n } = event;\n const pos = this.getCenter(event);\n newControllerState = newControllerState.zoom({\n pos,\n scale\n });\n }\n\n if (this.touchRotate) {\n const {\n rotation\n } = event;\n newControllerState = newControllerState.rotate({\n deltaAngleX: pinchEventWorkaround._startPinchRotation - rotation\n });\n }\n\n this.updateViewport(newControllerState, NO_TRANSITION_PROPS, {\n isDragging: true,\n isPanning: this.touchZoom,\n isZooming: this.touchZoom,\n isRotating: this.touchRotate\n });\n pinchEventWorkaround._lastPinchEvent = event;\n return true;\n }\n\n _onPinchEnd(event) {\n if (!this.isDragging()) {\n return false;\n }\n\n const {\n inertia\n } = this;\n const {\n _lastPinchEvent\n } = pinchEventWorkaround;\n\n if (this.touchZoom && inertia && _lastPinchEvent && event.scale !== _lastPinchEvent.scale) {\n const pos = this.getCenter(event);\n let newControllerState = this.controllerState.rotateEnd();\n const z = Math.log2(event.scale);\n\n const velocityZ = (z - Math.log2(_lastPinchEvent.scale)) / (event.deltaTime - _lastPinchEvent.deltaTime);\n\n const endScale = Math.pow(2, z + velocityZ * inertia / 2);\n newControllerState = newControllerState.zoom({\n pos,\n scale: endScale\n }).zoomEnd();\n this.updateViewport(newControllerState, { ...this._getTransitionProps({\n around: pos\n }),\n transitionDuration: inertia,\n transitionEasing: INERTIA_EASING\n }, {\n isDragging: false,\n isPanning: this.touchZoom,\n isZooming: this.touchZoom,\n isRotating: false\n });\n this.blockEvents(inertia);\n } else {\n const newControllerState = this.controllerState.zoomEnd().rotateEnd();\n this.updateViewport(newControllerState, null, {\n isDragging: false,\n isPanning: false,\n isZooming: false,\n isRotating: false\n });\n }\n\n pinchEventWorkaround._startPinchRotation = null;\n pinchEventWorkaround._lastPinchEvent = null;\n return true;\n }\n\n _onDoubleTap(event) {\n if (!this.doubleClickZoom) {\n return false;\n }\n\n const pos = this.getCenter(event);\n\n if (!this.isPointInBounds(pos, event)) {\n return false;\n }\n\n const isZoomOut = this.isFunctionKeyPressed(event);\n const newControllerState = this.controllerState.zoom({\n pos,\n scale: isZoomOut ? 0.5 : 2\n });\n this.updateViewport(newControllerState, this._getTransitionProps({\n around: pos\n }), {\n isZooming: true,\n isPanning: true\n });\n this.blockEvents(100);\n return true;\n }\n\n _onKeyDown(event) {\n if (!this.keyboard) {\n return false;\n }\n\n const funcKey = this.isFunctionKeyPressed(event);\n const {\n zoomSpeed,\n moveSpeed,\n rotateSpeedX,\n rotateSpeedY\n } = this.keyboard === true ? {} : this.keyboard;\n const {\n controllerState\n } = this;\n let newControllerState;\n const interactionState = {};\n\n switch (event.srcEvent.code) {\n case 'Minus':\n newControllerState = funcKey ? controllerState.zoomOut(zoomSpeed).zoomOut(zoomSpeed) : controllerState.zoomOut(zoomSpeed);\n interactionState.isZooming = true;\n break;\n\n case 'Equal':\n newControllerState = funcKey ? controllerState.zoomIn(zoomSpeed).zoomIn(zoomSpeed) : controllerState.zoomIn(zoomSpeed);\n interactionState.isZooming = true;\n break;\n\n case 'ArrowLeft':\n if (funcKey) {\n newControllerState = controllerState.rotateLeft(rotateSpeedX);\n interactionState.isRotating = true;\n } else {\n newControllerState = controllerState.moveLeft(moveSpeed);\n interactionState.isPanning = true;\n }\n\n break;\n\n case 'ArrowRight':\n if (funcKey) {\n newControllerState = controllerState.rotateRight(rotateSpeedX);\n interactionState.isRotating = true;\n } else {\n newControllerState = controllerState.moveRight(moveSpeed);\n interactionState.isPanning = true;\n }\n\n break;\n\n case 'ArrowUp':\n if (funcKey) {\n newControllerState = controllerState.rotateUp(rotateSpeedY);\n interactionState.isRotating = true;\n } else {\n newControllerState = controllerState.moveUp(moveSpeed);\n interactionState.isPanning = true;\n }\n\n break;\n\n case 'ArrowDown':\n if (funcKey) {\n newControllerState = controllerState.rotateDown(rotateSpeedY);\n interactionState.isRotating = true;\n } else {\n newControllerState = controllerState.moveDown(moveSpeed);\n interactionState.isPanning = true;\n }\n\n break;\n\n default:\n return false;\n }\n\n this.updateViewport(newControllerState, this._getTransitionProps(), interactionState);\n return true;\n }\n\n _getTransitionProps(opts) {\n const {\n transition\n } = this;\n\n if (!transition || !transition.transitionInterpolator) {\n return NO_TRANSITION_PROPS;\n }\n\n return opts ? { ...transition,\n transitionInterpolator: new _transitions_linear_interpolator__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({ ...opts,\n ...transition.transitionInterpolator.opts,\n makeViewport: this.controllerState.makeViewport\n })\n } : transition;\n }\n\n}\n//# sourceMappingURL=controller.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/controllers/controller.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/controllers/map-controller.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/controllers/map-controller.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MapState: () => (/* binding */ MapState),\n/* harmony export */ \"default\": () => (/* binding */ MapController)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @math.gl/core */ \"./node_modules/@math.gl/core/dist/esm/lib/common.js\");\n/* harmony import */ var _controller__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./controller */ \"./node_modules/@deck.gl/core/dist/esm/controllers/controller.js\");\n/* harmony import */ var _view_state__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./view-state */ \"./node_modules/@deck.gl/core/dist/esm/controllers/view-state.js\");\n/* harmony import */ var _math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @math.gl/web-mercator */ \"./node_modules/@math.gl/web-mercator/dist/esm/index.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@deck.gl/core/dist/esm/utils/assert.js\");\n/* harmony import */ var _transitions_linear_interpolator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../transitions/linear-interpolator */ \"./node_modules/@deck.gl/core/dist/esm/transitions/linear-interpolator.js\");\n\n\n\n\n\n\n\nconst PITCH_MOUSE_THRESHOLD = 5;\nconst PITCH_ACCEL = 1.2;\nclass MapState extends _view_state__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n constructor(options) {\n const {\n width,\n height,\n latitude,\n longitude,\n zoom,\n bearing = 0,\n pitch = 0,\n altitude = 1.5,\n position = [0, 0, 0],\n maxZoom = 20,\n minZoom = 0,\n maxPitch = 60,\n minPitch = 0,\n startPanLngLat,\n startZoomLngLat,\n startRotatePos,\n startBearing,\n startPitch,\n startZoom,\n normalize = true\n } = options;\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(Number.isFinite(longitude));\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(Number.isFinite(latitude));\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(Number.isFinite(zoom));\n super({\n width,\n height,\n latitude,\n longitude,\n zoom,\n bearing,\n pitch,\n altitude,\n maxZoom,\n minZoom,\n maxPitch,\n minPitch,\n normalize,\n position\n }, {\n startPanLngLat,\n startZoomLngLat,\n startRotatePos,\n startBearing,\n startPitch,\n startZoom\n });\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"makeViewport\", void 0);\n\n this.makeViewport = options.makeViewport;\n }\n\n panStart({\n pos\n }) {\n return this._getUpdatedState({\n startPanLngLat: this._unproject(pos)\n });\n }\n\n pan({\n pos,\n startPos\n }) {\n const startPanLngLat = this.getState().startPanLngLat || this._unproject(startPos);\n\n if (!startPanLngLat) {\n return this;\n }\n\n const viewport = this.makeViewport(this.getViewportProps());\n const newProps = viewport.panByPosition(startPanLngLat, pos);\n return this._getUpdatedState(newProps);\n }\n\n panEnd() {\n return this._getUpdatedState({\n startPanLngLat: null\n });\n }\n\n rotateStart({\n pos\n }) {\n return this._getUpdatedState({\n startRotatePos: pos,\n startBearing: this.getViewportProps().bearing,\n startPitch: this.getViewportProps().pitch\n });\n }\n\n rotate({\n pos,\n deltaAngleX = 0,\n deltaAngleY = 0\n }) {\n const {\n startRotatePos,\n startBearing,\n startPitch\n } = this.getState();\n\n if (!startRotatePos || startBearing === undefined || startPitch === undefined) {\n return this;\n }\n\n let newRotation;\n\n if (pos) {\n newRotation = this._getNewRotation(pos, startRotatePos, startPitch, startBearing);\n } else {\n newRotation = {\n bearing: startBearing + deltaAngleX,\n pitch: startPitch + deltaAngleY\n };\n }\n\n return this._getUpdatedState(newRotation);\n }\n\n rotateEnd() {\n return this._getUpdatedState({\n startBearing: null,\n startPitch: null\n });\n }\n\n zoomStart({\n pos\n }) {\n return this._getUpdatedState({\n startZoomLngLat: this._unproject(pos),\n startZoom: this.getViewportProps().zoom\n });\n }\n\n zoom({\n pos,\n startPos,\n scale\n }) {\n let {\n startZoom,\n startZoomLngLat\n } = this.getState();\n\n if (!startZoomLngLat) {\n startZoom = this.getViewportProps().zoom;\n startZoomLngLat = this._unproject(startPos) || this._unproject(pos);\n }\n\n if (!startZoomLngLat) {\n return this;\n }\n\n const {\n maxZoom,\n minZoom\n } = this.getViewportProps();\n let zoom = startZoom + Math.log2(scale);\n zoom = (0,_math_gl_core__WEBPACK_IMPORTED_MODULE_4__.clamp)(zoom, minZoom, maxZoom);\n const zoomedViewport = this.makeViewport({ ...this.getViewportProps(),\n zoom\n });\n return this._getUpdatedState({\n zoom,\n ...zoomedViewport.panByPosition(startZoomLngLat, pos)\n });\n }\n\n zoomEnd() {\n return this._getUpdatedState({\n startZoomLngLat: null,\n startZoom: null\n });\n }\n\n zoomIn(speed = 2) {\n return this._zoomFromCenter(speed);\n }\n\n zoomOut(speed = 2) {\n return this._zoomFromCenter(1 / speed);\n }\n\n moveLeft(speed = 100) {\n return this._panFromCenter([speed, 0]);\n }\n\n moveRight(speed = 100) {\n return this._panFromCenter([-speed, 0]);\n }\n\n moveUp(speed = 100) {\n return this._panFromCenter([0, speed]);\n }\n\n moveDown(speed = 100) {\n return this._panFromCenter([0, -speed]);\n }\n\n rotateLeft(speed = 15) {\n return this._getUpdatedState({\n bearing: this.getViewportProps().bearing - speed\n });\n }\n\n rotateRight(speed = 15) {\n return this._getUpdatedState({\n bearing: this.getViewportProps().bearing + speed\n });\n }\n\n rotateUp(speed = 10) {\n return this._getUpdatedState({\n pitch: this.getViewportProps().pitch + speed\n });\n }\n\n rotateDown(speed = 10) {\n return this._getUpdatedState({\n pitch: this.getViewportProps().pitch - speed\n });\n }\n\n shortestPathFrom(viewState) {\n const fromProps = viewState.getViewportProps();\n const props = { ...this.getViewportProps()\n };\n const {\n bearing,\n longitude\n } = props;\n\n if (Math.abs(bearing - fromProps.bearing) > 180) {\n props.bearing = bearing < 0 ? bearing + 360 : bearing - 360;\n }\n\n if (Math.abs(longitude - fromProps.longitude) > 180) {\n props.longitude = longitude < 0 ? longitude + 360 : longitude - 360;\n }\n\n return props;\n }\n\n applyConstraints(props) {\n const {\n maxZoom,\n minZoom,\n zoom\n } = props;\n props.zoom = (0,_math_gl_core__WEBPACK_IMPORTED_MODULE_4__.clamp)(zoom, minZoom, maxZoom);\n const {\n maxPitch,\n minPitch,\n pitch\n } = props;\n props.pitch = (0,_math_gl_core__WEBPACK_IMPORTED_MODULE_4__.clamp)(pitch, minPitch, maxPitch);\n const {\n normalize = true\n } = props;\n\n if (normalize) {\n Object.assign(props, (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.normalizeViewportProps)(props));\n }\n\n return props;\n }\n\n _zoomFromCenter(scale) {\n const {\n width,\n height\n } = this.getViewportProps();\n return this.zoom({\n pos: [width / 2, height / 2],\n scale\n });\n }\n\n _panFromCenter(offset) {\n const {\n width,\n height\n } = this.getViewportProps();\n return this.pan({\n startPos: [width / 2, height / 2],\n pos: [width / 2 + offset[0], height / 2 + offset[1]]\n });\n }\n\n _getUpdatedState(newProps) {\n return new this.constructor({\n makeViewport: this.makeViewport,\n ...this.getViewportProps(),\n ...this.getState(),\n ...newProps\n });\n }\n\n _unproject(pos) {\n const viewport = this.makeViewport(this.getViewportProps());\n return pos && viewport.unproject(pos);\n }\n\n _getNewRotation(pos, startPos, startPitch, startBearing) {\n const deltaX = pos[0] - startPos[0];\n const deltaY = pos[1] - startPos[1];\n const centerY = pos[1];\n const startY = startPos[1];\n const {\n width,\n height\n } = this.getViewportProps();\n const deltaScaleX = deltaX / width;\n let deltaScaleY = 0;\n\n if (deltaY > 0) {\n if (Math.abs(height - startY) > PITCH_MOUSE_THRESHOLD) {\n deltaScaleY = deltaY / (startY - height) * PITCH_ACCEL;\n }\n } else if (deltaY < 0) {\n if (startY > PITCH_MOUSE_THRESHOLD) {\n deltaScaleY = 1 - centerY / startY;\n }\n }\n\n deltaScaleY = (0,_math_gl_core__WEBPACK_IMPORTED_MODULE_4__.clamp)(deltaScaleY, -1, 1);\n const {\n minPitch,\n maxPitch\n } = this.getViewportProps();\n const bearing = startBearing + 180 * deltaScaleX;\n let pitch = startPitch;\n\n if (deltaScaleY > 0) {\n pitch = startPitch + deltaScaleY * (maxPitch - startPitch);\n } else if (deltaScaleY < 0) {\n pitch = startPitch - deltaScaleY * (minPitch - startPitch);\n }\n\n return {\n pitch,\n bearing\n };\n }\n\n}\nclass MapController extends _controller__WEBPACK_IMPORTED_MODULE_5__[\"default\"] {\n constructor(...args) {\n super(...args);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"ControllerState\", MapState);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"transition\", {\n transitionDuration: 300,\n transitionInterpolator: new _transitions_linear_interpolator__WEBPACK_IMPORTED_MODULE_6__[\"default\"]({\n transitionProps: {\n compare: ['longitude', 'latitude', 'zoom', 'bearing', 'pitch', 'position'],\n required: ['longitude', 'latitude', 'zoom']\n }\n })\n });\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"dragMode\", 'pan');\n }\n\n setProps(props) {\n props.position = props.position || [0, 0, 0];\n const oldProps = this.props;\n super.setProps(props);\n const dimensionChanged = !oldProps || oldProps.height !== props.height;\n\n if (dimensionChanged) {\n this.updateViewport(new this.ControllerState({\n makeViewport: this.makeViewport,\n ...props,\n ...this.state\n }));\n }\n }\n\n}\n//# sourceMappingURL=map-controller.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/controllers/map-controller.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/controllers/transition-manager.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/controllers/transition-manager.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TRANSITION_EVENTS: () => (/* binding */ TRANSITION_EVENTS),\n/* harmony export */ \"default\": () => (/* binding */ TransitionManager)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _transitions_transition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../transitions/transition */ \"./node_modules/@deck.gl/core/dist/esm/transitions/transition.js\");\n\n\n\nconst noop = () => {};\n\nconst TRANSITION_EVENTS = {\n BREAK: 1,\n SNAP_TO_END: 2,\n IGNORE: 3\n};\n\nconst DEFAULT_EASING = t => t;\n\nconst DEFAULT_INTERRUPTION = TRANSITION_EVENTS.BREAK;\nclass TransitionManager {\n constructor(opts) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"getControllerState\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"props\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"propsInTransition\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"transition\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"onViewStateChange\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"onStateChange\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_onTransitionUpdate\", transition => {\n const {\n time,\n settings: {\n interpolator,\n startProps,\n endProps,\n duration,\n easing\n }\n } = transition;\n const t = easing(time / duration);\n const viewport = interpolator.interpolateProps(startProps, endProps, t);\n this.propsInTransition = this.getControllerState({ ...this.props,\n ...viewport\n }).getViewportProps();\n this.onViewStateChange({\n viewState: this.propsInTransition,\n oldViewState: this.props\n });\n });\n\n this.getControllerState = opts.getControllerState;\n this.propsInTransition = null;\n this.transition = new _transitions_transition__WEBPACK_IMPORTED_MODULE_1__[\"default\"](opts.timeline);\n this.onViewStateChange = opts.onViewStateChange || noop;\n this.onStateChange = opts.onStateChange || noop;\n }\n\n finalize() {\n this.transition.cancel();\n }\n\n getViewportInTransition() {\n return this.propsInTransition;\n }\n\n processViewStateChange(nextProps) {\n let transitionTriggered = false;\n const currentProps = this.props;\n this.props = nextProps;\n\n if (!currentProps || this._shouldIgnoreViewportChange(currentProps, nextProps)) {\n return false;\n }\n\n if (this._isTransitionEnabled(nextProps)) {\n let startProps = currentProps;\n\n if (this.transition.inProgress) {\n const {\n interruption,\n endProps\n } = this.transition.settings;\n startProps = { ...currentProps,\n ...(interruption === TRANSITION_EVENTS.SNAP_TO_END ? endProps : this.propsInTransition || currentProps)\n };\n }\n\n this._triggerTransition(startProps, nextProps);\n\n transitionTriggered = true;\n } else {\n this.transition.cancel();\n }\n\n return transitionTriggered;\n }\n\n updateTransition() {\n this.transition.update();\n }\n\n _isTransitionEnabled(props) {\n const {\n transitionDuration,\n transitionInterpolator\n } = props;\n return (transitionDuration > 0 || transitionDuration === 'auto') && Boolean(transitionInterpolator);\n }\n\n _isUpdateDueToCurrentTransition(props) {\n if (this.transition.inProgress && this.propsInTransition) {\n return this.transition.settings.interpolator.arePropsEqual(props, this.propsInTransition);\n }\n\n return false;\n }\n\n _shouldIgnoreViewportChange(currentProps, nextProps) {\n if (this.transition.inProgress) {\n return this.transition.settings.interruption === TRANSITION_EVENTS.IGNORE || this._isUpdateDueToCurrentTransition(nextProps);\n }\n\n if (this._isTransitionEnabled(nextProps)) {\n return nextProps.transitionInterpolator.arePropsEqual(currentProps, nextProps);\n }\n\n return true;\n }\n\n _triggerTransition(startProps, endProps) {\n const startViewstate = this.getControllerState(startProps);\n const endViewStateProps = this.getControllerState(endProps).shortestPathFrom(startViewstate);\n const transitionInterpolator = endProps.transitionInterpolator;\n const duration = transitionInterpolator.getDuration ? transitionInterpolator.getDuration(startProps, endProps) : endProps.transitionDuration;\n\n if (duration === 0) {\n return;\n }\n\n const initialProps = transitionInterpolator.initializeProps(startProps, endViewStateProps);\n this.propsInTransition = {};\n const transitionSettings = {\n duration,\n easing: endProps.transitionEasing || DEFAULT_EASING,\n interpolator: transitionInterpolator,\n interruption: endProps.transitionInterruption || DEFAULT_INTERRUPTION,\n startProps: initialProps.start,\n endProps: initialProps.end,\n onStart: endProps.onTransitionStart,\n onUpdate: this._onTransitionUpdate,\n onInterrupt: this._onTransitionEnd(endProps.onTransitionInterrupt),\n onEnd: this._onTransitionEnd(endProps.onTransitionEnd)\n };\n this.transition.start(transitionSettings);\n this.onStateChange({\n inTransition: true\n });\n this.updateTransition();\n }\n\n _onTransitionEnd(callback) {\n return transition => {\n this.propsInTransition = null;\n this.onStateChange({\n inTransition: false,\n isZooming: false,\n isPanning: false,\n isRotating: false\n });\n callback === null || callback === void 0 ? void 0 : callback(transition);\n };\n }\n\n}\n//# sourceMappingURL=transition-manager.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/controllers/transition-manager.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/controllers/view-state.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/controllers/view-state.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ViewState)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n\nclass ViewState {\n constructor(props, state) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_viewportProps\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_state\", void 0);\n\n this._viewportProps = this.applyConstraints(props);\n this._state = state;\n }\n\n getViewportProps() {\n return this._viewportProps;\n }\n\n getState() {\n return this._state;\n }\n\n}\n//# sourceMappingURL=view-state.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/controllers/view-state.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/debug/index.js": +/*!************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/debug/index.js ***! + \************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ debug),\n/* harmony export */ register: () => (/* binding */ register)\n/* harmony export */ });\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/log */ \"./node_modules/@deck.gl/core/dist/esm/utils/log.js\");\n/* harmony import */ var _loggers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./loggers */ \"./node_modules/@deck.gl/core/dist/esm/debug/loggers.js\");\n\n\nlet loggers = {};\n\nif (true) {\n loggers = (0,_loggers__WEBPACK_IMPORTED_MODULE_0__.getLoggers)(_utils_log__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n}\n\nfunction register(handlers) {\n loggers = handlers;\n}\nfunction debug(eventType, arg1, arg2, arg3) {\n if (_utils_log__WEBPACK_IMPORTED_MODULE_1__[\"default\"].level > 0 && loggers[eventType]) {\n loggers[eventType].call(null, arg1, arg2, arg3);\n }\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/debug/index.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/debug/loggers.js": +/*!**************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/debug/loggers.js ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getLoggers: () => (/* binding */ getLoggers)\n/* harmony export */ });\nconst logState = {\n attributeUpdateStart: -1,\n attributeManagerUpdateStart: -1,\n attributeUpdateMessages: []\n};\nconst LOG_LEVEL_MAJOR_UPDATE = 1;\nconst LOG_LEVEL_MINOR_UPDATE = 2;\nconst LOG_LEVEL_UPDATE_DETAIL = 3;\nconst LOG_LEVEL_INFO = 4;\nconst LOG_LEVEL_DRAW = 2;\nconst getLoggers = log => ({\n 'layer.changeFlag': (layer, key, flags) => {\n log.log(LOG_LEVEL_UPDATE_DETAIL, \"\".concat(layer.id, \" \").concat(key, \": \"), flags[key])();\n },\n 'layer.initialize': layer => {\n log.log(LOG_LEVEL_MAJOR_UPDATE, \"Initializing \".concat(layer))();\n },\n 'layer.update': (layer, needsUpdate) => {\n if (needsUpdate) {\n const flags = layer.getChangeFlags();\n log.log(LOG_LEVEL_MINOR_UPDATE, \"Updating \".concat(layer, \" because: \").concat(Object.keys(flags).filter(key => flags[key]).join(', ')))();\n } else {\n log.log(LOG_LEVEL_INFO, \"\".concat(layer, \" does not need update\"))();\n }\n },\n 'layer.matched': (layer, changed) => {\n if (changed) {\n log.log(LOG_LEVEL_INFO, \"Matched \".concat(layer, \", state transfered\"))();\n }\n },\n 'layer.finalize': layer => {\n log.log(LOG_LEVEL_MAJOR_UPDATE, \"Finalizing \".concat(layer))();\n },\n 'compositeLayer.renderLayers': (layer, updated, subLayers) => {\n if (updated) {\n log.log(LOG_LEVEL_MINOR_UPDATE, \"Composite layer rendered new subLayers \".concat(layer), subLayers)();\n } else {\n log.log(LOG_LEVEL_INFO, \"Composite layer reused subLayers \".concat(layer), subLayers)();\n }\n },\n 'layerManager.setLayers': (layerManager, updated, layers) => {\n if (updated) {\n log.log(LOG_LEVEL_MINOR_UPDATE, \"Updating \".concat(layers.length, \" deck layers\"))();\n }\n },\n 'layerManager.activateViewport': (layerManager, viewport) => {\n log.log(LOG_LEVEL_UPDATE_DETAIL, 'Viewport changed', viewport)();\n },\n 'attributeManager.invalidate': (attributeManager, trigger, attributeNames) => {\n log.log(LOG_LEVEL_MAJOR_UPDATE, attributeNames ? \"invalidated attributes \".concat(attributeNames, \" (\").concat(trigger, \") for \").concat(attributeManager.id) : \"invalidated all attributes for \".concat(attributeManager.id))();\n },\n 'attributeManager.updateStart': attributeManager => {\n logState.attributeUpdateMessages.length = 0;\n logState.attributeManagerUpdateStart = Date.now();\n },\n 'attributeManager.updateEnd': (attributeManager, numInstances) => {\n const timeMs = Math.round(Date.now() - logState.attributeManagerUpdateStart);\n log.groupCollapsed(LOG_LEVEL_MINOR_UPDATE, \"Updated attributes for \".concat(numInstances, \" instances in \").concat(attributeManager.id, \" in \").concat(timeMs, \"ms\"))();\n\n for (const updateMessage of logState.attributeUpdateMessages) {\n log.log(LOG_LEVEL_UPDATE_DETAIL, updateMessage)();\n }\n\n log.groupEnd(LOG_LEVEL_MINOR_UPDATE)();\n },\n 'attribute.updateStart': attribute => {\n logState.attributeUpdateStart = Date.now();\n },\n 'attribute.allocate': (attribute, numInstances) => {\n const message = \"\".concat(attribute.id, \" allocated \").concat(numInstances);\n logState.attributeUpdateMessages.push(message);\n },\n 'attribute.updateEnd': (attribute, numInstances) => {\n const timeMs = Math.round(Date.now() - logState.attributeUpdateStart);\n const message = \"\".concat(attribute.id, \" updated \").concat(numInstances, \" in \").concat(timeMs, \"ms\");\n logState.attributeUpdateMessages.push(message);\n },\n 'deckRenderer.renderLayers': (deckRenderer, renderStats, opts) => {\n const {\n pass,\n redrawReason,\n stats\n } = opts;\n\n for (const status of renderStats) {\n const {\n totalCount,\n visibleCount,\n compositeCount,\n pickableCount\n } = status;\n const primitiveCount = totalCount - compositeCount;\n const hiddenCount = primitiveCount - visibleCount;\n log.log(LOG_LEVEL_DRAW, \"RENDER #\".concat(deckRenderer.renderCount, \" \").concat(visibleCount, \" (of \").concat(totalCount, \" layers) to \").concat(pass, \" because \").concat(redrawReason, \" (\").concat(hiddenCount, \" hidden, \").concat(compositeCount, \" composite \").concat(pickableCount, \" pickable)\"))();\n\n if (stats) {\n stats.get('Redraw Layers').add(visibleCount);\n }\n }\n }\n});\n//# sourceMappingURL=loggers.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/debug/loggers.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/effects/lighting/ambient-light.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/effects/lighting/ambient-light.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AmbientLight: () => (/* binding */ AmbientLight)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n\nconst DEFAULT_LIGHT_COLOR = [255, 255, 255];\nconst DEFAULT_LIGHT_INTENSITY = 1.0;\nlet idCount = 0;\nclass AmbientLight {\n constructor(props = {}) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"id\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"color\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"intensity\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"type\", 'ambient');\n\n const {\n color = DEFAULT_LIGHT_COLOR\n } = props;\n const {\n intensity = DEFAULT_LIGHT_INTENSITY\n } = props;\n this.id = props.id || \"ambient-\".concat(idCount++);\n this.color = color;\n this.intensity = intensity;\n }\n\n}\n//# sourceMappingURL=ambient-light.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/effects/lighting/ambient-light.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/effects/lighting/directional-light.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/effects/lighting/directional-light.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DirectionalLight: () => (/* binding */ DirectionalLight)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @math.gl/core */ \"./node_modules/@math.gl/core/dist/esm/classes/vector3.js\");\n\n\nconst DEFAULT_LIGHT_COLOR = [255, 255, 255];\nconst DEFAULT_LIGHT_INTENSITY = 1.0;\nconst DEFAULT_LIGHT_DIRECTION = [0.0, 0.0, -1.0];\nlet idCount = 0;\nclass DirectionalLight {\n constructor(props = {}) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"id\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"color\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"intensity\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"type\", 'directional');\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"direction\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"shadow\", void 0);\n\n const {\n color = DEFAULT_LIGHT_COLOR\n } = props;\n const {\n intensity = DEFAULT_LIGHT_INTENSITY\n } = props;\n const {\n direction = DEFAULT_LIGHT_DIRECTION\n } = props;\n const {\n _shadow = false\n } = props;\n this.id = props.id || \"directional-\".concat(idCount++);\n this.color = color;\n this.intensity = intensity;\n this.type = 'directional';\n this.direction = new _math_gl_core__WEBPACK_IMPORTED_MODULE_1__[\"default\"](direction).normalize().toArray();\n this.shadow = _shadow;\n }\n\n getProjectedLight(opts) {\n return this;\n }\n\n}\n//# sourceMappingURL=directional-light.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/effects/lighting/directional-light.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/effects/lighting/lighting-effect.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/effects/lighting/lighting-effect.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ LightingEffect)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/engine/dist/esm/lib/program-manager.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture-2d.js\");\n/* harmony import */ var _ambient_light__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ambient-light */ \"./node_modules/@deck.gl/core/dist/esm/effects/lighting/ambient-light.js\");\n/* harmony import */ var _directional_light__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./directional-light */ \"./node_modules/@deck.gl/core/dist/esm/effects/lighting/directional-light.js\");\n/* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @math.gl/core */ \"./node_modules/@math.gl/core/dist/esm/classes/matrix4.js\");\n/* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @math.gl/core */ \"./node_modules/@math.gl/core/dist/esm/classes/vector3.js\");\n/* harmony import */ var _passes_shadow_pass__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../passes/shadow-pass */ \"./node_modules/@deck.gl/core/dist/esm/passes/shadow-pass.js\");\n/* harmony import */ var _shaderlib_shadow_shadow__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shaderlib/shadow/shadow */ \"./node_modules/@deck.gl/core/dist/esm/shaderlib/shadow/shadow.js\");\n\n\n\n\n\n\n\nconst DEFAULT_AMBIENT_LIGHT_PROPS = {\n color: [255, 255, 255],\n intensity: 1.0\n};\nconst DEFAULT_DIRECTIONAL_LIGHT_PROPS = [{\n color: [255, 255, 255],\n intensity: 1.0,\n direction: [-1, 3, -1]\n}, {\n color: [255, 255, 255],\n intensity: 0.9,\n direction: [1, -8, -2.5]\n}];\nconst DEFAULT_SHADOW_COLOR = [0, 0, 0, 200 / 255];\nclass LightingEffect {\n constructor(props = {}) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"id\", 'lighting-effect');\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"props\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"shadowColor\", DEFAULT_SHADOW_COLOR);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"shadow\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"ambientLight\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"directionalLights\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"pointLights\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"shadowPasses\", []);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"shadowMaps\", []);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"dummyShadowMap\", null);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"programManager\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"shadowMatrices\", void 0);\n\n this.setProps(props);\n }\n\n setProps(props) {\n this.ambientLight = null;\n this.directionalLights = [];\n this.pointLights = [];\n\n for (const key in props) {\n const lightSource = props[key];\n\n switch (lightSource.type) {\n case 'ambient':\n this.ambientLight = lightSource;\n break;\n\n case 'directional':\n this.directionalLights.push(lightSource);\n break;\n\n case 'point':\n this.pointLights.push(lightSource);\n break;\n\n default:\n }\n }\n\n this._applyDefaultLights();\n\n this.shadow = this.directionalLights.some(light => light.shadow);\n this.props = props;\n }\n\n preRender(gl, {\n layers,\n layerFilter,\n viewports,\n onViewportActive,\n views\n }) {\n if (!this.shadow) return;\n this.shadowMatrices = this._calculateMatrices();\n\n if (this.shadowPasses.length === 0) {\n this._createShadowPasses(gl);\n }\n\n if (!this.programManager) {\n this.programManager = _luma_gl_core__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getDefaultProgramManager(gl);\n\n if (_shaderlib_shadow_shadow__WEBPACK_IMPORTED_MODULE_2__[\"default\"]) {\n this.programManager.addDefaultModule(_shaderlib_shadow_shadow__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n }\n }\n\n if (!this.dummyShadowMap) {\n this.dummyShadowMap = new _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"](gl, {\n width: 1,\n height: 1\n });\n }\n\n for (let i = 0; i < this.shadowPasses.length; i++) {\n const shadowPass = this.shadowPasses[i];\n shadowPass.render({\n layers,\n layerFilter,\n viewports,\n onViewportActive,\n views,\n moduleParameters: {\n shadowLightId: i,\n dummyShadowMap: this.dummyShadowMap,\n shadowMatrices: this.shadowMatrices\n }\n });\n }\n }\n\n getModuleParameters(layer) {\n const parameters = this.shadow ? {\n shadowMaps: this.shadowMaps,\n dummyShadowMap: this.dummyShadowMap,\n shadowColor: this.shadowColor,\n shadowMatrices: this.shadowMatrices\n } : {};\n parameters.lightSources = {\n ambientLight: this.ambientLight,\n directionalLights: this.directionalLights.map(directionalLight => directionalLight.getProjectedLight({\n layer\n })),\n pointLights: this.pointLights.map(pointLight => pointLight.getProjectedLight({\n layer\n }))\n };\n return parameters;\n }\n\n cleanup() {\n for (const shadowPass of this.shadowPasses) {\n shadowPass.delete();\n }\n\n this.shadowPasses.length = 0;\n this.shadowMaps.length = 0;\n\n if (this.dummyShadowMap) {\n this.dummyShadowMap.delete();\n this.dummyShadowMap = null;\n }\n\n if (this.shadow && this.programManager) {\n this.programManager.removeDefaultModule(_shaderlib_shadow_shadow__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n this.programManager = null;\n }\n }\n\n _calculateMatrices() {\n const lightMatrices = [];\n\n for (const light of this.directionalLights) {\n const viewMatrix = new _math_gl_core__WEBPACK_IMPORTED_MODULE_4__[\"default\"]().lookAt({\n eye: new _math_gl_core__WEBPACK_IMPORTED_MODULE_5__[\"default\"](light.direction).negate()\n });\n lightMatrices.push(viewMatrix);\n }\n\n return lightMatrices;\n }\n\n _createShadowPasses(gl) {\n for (let i = 0; i < this.directionalLights.length; i++) {\n const shadowPass = new _passes_shadow_pass__WEBPACK_IMPORTED_MODULE_6__[\"default\"](gl);\n this.shadowPasses[i] = shadowPass;\n this.shadowMaps[i] = shadowPass.shadowMap;\n }\n }\n\n _applyDefaultLights() {\n const {\n ambientLight,\n pointLights,\n directionalLights\n } = this;\n\n if (!ambientLight && pointLights.length === 0 && directionalLights.length === 0) {\n this.ambientLight = new _ambient_light__WEBPACK_IMPORTED_MODULE_7__.AmbientLight(DEFAULT_AMBIENT_LIGHT_PROPS);\n this.directionalLights.push(new _directional_light__WEBPACK_IMPORTED_MODULE_8__.DirectionalLight(DEFAULT_DIRECTIONAL_LIGHT_PROPS[0]), new _directional_light__WEBPACK_IMPORTED_MODULE_8__.DirectionalLight(DEFAULT_DIRECTIONAL_LIGHT_PROPS[1]));\n }\n }\n\n}\n//# sourceMappingURL=lighting-effect.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/effects/lighting/lighting-effect.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute-manager.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute-manager.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ AttributeManager)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _attribute__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./attribute */ \"./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute.js\");\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/log */ \"./node_modules/@deck.gl/core/dist/esm/utils/log.js\");\n/* harmony import */ var _utils_memoize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/memoize */ \"./node_modules/@deck.gl/core/dist/esm/utils/memoize.js\");\n/* harmony import */ var _utils_math_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/math-utils */ \"./node_modules/@deck.gl/core/dist/esm/utils/math-utils.js\");\n/* harmony import */ var _debug__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../debug */ \"./node_modules/@deck.gl/core/dist/esm/debug/index.js\");\n/* harmony import */ var _attribute_transition_manager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./attribute-transition-manager */ \"./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute-transition-manager.js\");\n\n\n\n\n\n\n\nconst TRACE_INVALIDATE = 'attributeManager.invalidate';\nconst TRACE_UPDATE_START = 'attributeManager.updateStart';\nconst TRACE_UPDATE_END = 'attributeManager.updateEnd';\nconst TRACE_ATTRIBUTE_UPDATE_START = 'attribute.updateStart';\nconst TRACE_ATTRIBUTE_ALLOCATE = 'attribute.allocate';\nconst TRACE_ATTRIBUTE_UPDATE_END = 'attribute.updateEnd';\nclass AttributeManager {\n constructor(gl, {\n id = 'attribute-manager',\n stats,\n timeline\n } = {}) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"id\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"gl\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"attributes\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"updateTriggers\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"needsRedraw\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"userData\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"stats\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"attributeTransitionManager\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"mergeBoundsMemoized\", (0,_utils_memoize__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_utils_math_utils__WEBPACK_IMPORTED_MODULE_2__.mergeBounds));\n\n this.id = id;\n this.gl = gl;\n this.attributes = {};\n this.updateTriggers = {};\n this.needsRedraw = true;\n this.userData = {};\n this.stats = stats;\n this.attributeTransitionManager = new _attribute_transition_manager__WEBPACK_IMPORTED_MODULE_3__[\"default\"](gl, {\n id: \"\".concat(id, \"-transitions\"),\n timeline\n });\n Object.seal(this);\n }\n\n finalize() {\n for (const attributeName in this.attributes) {\n this.attributes[attributeName].delete();\n }\n\n this.attributeTransitionManager.finalize();\n }\n\n getNeedsRedraw(opts = {\n clearRedrawFlags: false\n }) {\n const redraw = this.needsRedraw;\n this.needsRedraw = this.needsRedraw && !opts.clearRedrawFlags;\n return redraw && this.id;\n }\n\n setNeedsRedraw() {\n this.needsRedraw = true;\n }\n\n add(attributes) {\n this._add(attributes);\n }\n\n addInstanced(attributes) {\n this._add(attributes, {\n instanced: 1\n });\n }\n\n remove(attributeNameArray) {\n for (const name of attributeNameArray) {\n if (this.attributes[name] !== undefined) {\n this.attributes[name].delete();\n delete this.attributes[name];\n }\n }\n }\n\n invalidate(triggerName, dataRange) {\n const invalidatedAttributes = this._invalidateTrigger(triggerName, dataRange);\n\n (0,_debug__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(TRACE_INVALIDATE, this, triggerName, invalidatedAttributes);\n }\n\n invalidateAll(dataRange) {\n for (const attributeName in this.attributes) {\n this.attributes[attributeName].setNeedsUpdate(attributeName, dataRange);\n }\n\n (0,_debug__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(TRACE_INVALIDATE, this, 'all');\n }\n\n update({\n data,\n numInstances,\n startIndices = null,\n transitions,\n props = {},\n buffers = {},\n context = {}\n }) {\n let updated = false;\n (0,_debug__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(TRACE_UPDATE_START, this);\n\n if (this.stats) {\n this.stats.get('Update Attributes').timeStart();\n }\n\n for (const attributeName in this.attributes) {\n const attribute = this.attributes[attributeName];\n const accessorName = attribute.settings.accessor;\n attribute.startIndices = startIndices;\n attribute.numInstances = numInstances;\n\n if (props[attributeName]) {\n _utils_log__WEBPACK_IMPORTED_MODULE_5__[\"default\"].removed(\"props.\".concat(attributeName), \"data.attributes.\".concat(attributeName))();\n }\n\n if (attribute.setExternalBuffer(buffers[attributeName])) {} else if (attribute.setBinaryValue(typeof accessorName === 'string' ? buffers[accessorName] : undefined, data.startIndices)) {} else if (typeof accessorName === 'string' && !buffers[accessorName] && attribute.setConstantValue(props[accessorName])) {} else if (attribute.needsUpdate()) {\n updated = true;\n\n this._updateAttribute({\n attribute,\n numInstances,\n data,\n props,\n context\n });\n }\n\n this.needsRedraw = this.needsRedraw || attribute.needsRedraw();\n }\n\n if (updated) {\n (0,_debug__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(TRACE_UPDATE_END, this, numInstances);\n }\n\n if (this.stats) {\n this.stats.get('Update Attributes').timeEnd();\n }\n\n this.attributeTransitionManager.update({\n attributes: this.attributes,\n numInstances,\n transitions\n });\n }\n\n updateTransition() {\n const {\n attributeTransitionManager\n } = this;\n const transitionUpdated = attributeTransitionManager.run();\n this.needsRedraw = this.needsRedraw || transitionUpdated;\n return transitionUpdated;\n }\n\n getAttributes() {\n return this.attributes;\n }\n\n getBounds(attributeNames) {\n const bounds = attributeNames.map(attributeName => {\n var _this$attributes$attr;\n\n return (_this$attributes$attr = this.attributes[attributeName]) === null || _this$attributes$attr === void 0 ? void 0 : _this$attributes$attr.getBounds();\n });\n return this.mergeBoundsMemoized(bounds);\n }\n\n getChangedAttributes(opts = {\n clearChangedFlags: false\n }) {\n const {\n attributes,\n attributeTransitionManager\n } = this;\n const changedAttributes = { ...attributeTransitionManager.getAttributes()\n };\n\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n\n if (attribute.needsRedraw(opts) && !attributeTransitionManager.hasAttribute(attributeName)) {\n changedAttributes[attributeName] = attribute;\n }\n }\n\n return changedAttributes;\n }\n\n getShaderAttributes(attributes, excludeAttributes = {}) {\n if (!attributes) {\n attributes = this.getAttributes();\n }\n\n const shaderAttributes = {};\n\n for (const attributeName in attributes) {\n if (!excludeAttributes[attributeName]) {\n Object.assign(shaderAttributes, attributes[attributeName].getShaderAttributes());\n }\n }\n\n return shaderAttributes;\n }\n\n _add(attributes, extraProps = {}) {\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n this.attributes[attributeName] = this._createAttribute(attributeName, attribute, extraProps);\n }\n\n this._mapUpdateTriggersToAttributes();\n }\n\n _createAttribute(name, attribute, extraProps) {\n const props = { ...attribute,\n id: name,\n size: attribute.isIndexed && 1 || attribute.size || 1,\n divisor: extraProps.instanced ? 1 : attribute.divisor || 0\n };\n return new _attribute__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this.gl, props);\n }\n\n _mapUpdateTriggersToAttributes() {\n const triggers = {};\n\n for (const attributeName in this.attributes) {\n const attribute = this.attributes[attributeName];\n attribute.getUpdateTriggers().forEach(triggerName => {\n if (!triggers[triggerName]) {\n triggers[triggerName] = [];\n }\n\n triggers[triggerName].push(attributeName);\n });\n }\n\n this.updateTriggers = triggers;\n }\n\n _invalidateTrigger(triggerName, dataRange) {\n const {\n attributes,\n updateTriggers\n } = this;\n const invalidatedAttributes = updateTriggers[triggerName];\n\n if (invalidatedAttributes) {\n invalidatedAttributes.forEach(name => {\n const attribute = attributes[name];\n\n if (attribute) {\n attribute.setNeedsUpdate(attribute.id, dataRange);\n }\n });\n }\n\n return invalidatedAttributes;\n }\n\n _updateAttribute(opts) {\n const {\n attribute,\n numInstances\n } = opts;\n (0,_debug__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(TRACE_ATTRIBUTE_UPDATE_START, attribute);\n\n if (attribute.constant) {\n attribute.setConstantValue(attribute.value);\n return;\n }\n\n if (attribute.allocate(numInstances)) {\n (0,_debug__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(TRACE_ATTRIBUTE_ALLOCATE, attribute, numInstances);\n }\n\n const updated = attribute.updateBuffer(opts);\n\n if (updated) {\n this.needsRedraw = true;\n (0,_debug__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(TRACE_ATTRIBUTE_UPDATE_END, attribute, numInstances);\n }\n }\n\n}\n//# sourceMappingURL=attribute-manager.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute-manager.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute-transition-manager.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute-transition-manager.js ***! + \*******************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ AttributeTransitionManager)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/engine/dist/esm/transform/transform.js\");\n/* harmony import */ var _transitions_gpu_interpolation_transition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../transitions/gpu-interpolation-transition */ \"./node_modules/@deck.gl/core/dist/esm/transitions/gpu-interpolation-transition.js\");\n/* harmony import */ var _transitions_gpu_spring_transition__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../transitions/gpu-spring-transition */ \"./node_modules/@deck.gl/core/dist/esm/transitions/gpu-spring-transition.js\");\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/log */ \"./node_modules/@deck.gl/core/dist/esm/utils/log.js\");\n\n\n\n\n\nconst TRANSITION_TYPES = {\n interpolation: _transitions_gpu_interpolation_transition__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n spring: _transitions_gpu_spring_transition__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n};\nclass AttributeTransitionManager {\n constructor(gl, {\n id,\n timeline\n }) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"id\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"isSupported\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"gl\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"timeline\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"transitions\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"needsRedraw\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"numInstances\", void 0);\n\n this.id = id;\n this.gl = gl;\n this.timeline = timeline;\n this.transitions = {};\n this.needsRedraw = false;\n this.numInstances = 1;\n this.isSupported = _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isSupported(gl);\n }\n\n finalize() {\n for (const attributeName in this.transitions) {\n this._removeTransition(attributeName);\n }\n }\n\n update({\n attributes,\n transitions,\n numInstances\n }) {\n this.numInstances = numInstances || 1;\n\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n const settings = attribute.getTransitionSetting(transitions);\n if (!settings) continue;\n\n this._updateAttribute(attributeName, attribute, settings);\n }\n\n for (const attributeName in this.transitions) {\n const attribute = attributes[attributeName];\n\n if (!attribute || !attribute.getTransitionSetting(transitions)) {\n this._removeTransition(attributeName);\n }\n }\n }\n\n hasAttribute(attributeName) {\n const transition = this.transitions[attributeName];\n return transition && transition.inProgress;\n }\n\n getAttributes() {\n const animatedAttributes = {};\n\n for (const attributeName in this.transitions) {\n const transition = this.transitions[attributeName];\n\n if (transition.inProgress) {\n animatedAttributes[attributeName] = transition.attributeInTransition;\n }\n }\n\n return animatedAttributes;\n }\n\n run() {\n if (!this.isSupported || this.numInstances === 0) {\n return false;\n }\n\n for (const attributeName in this.transitions) {\n const updated = this.transitions[attributeName].update();\n\n if (updated) {\n this.needsRedraw = true;\n }\n }\n\n const needsRedraw = this.needsRedraw;\n this.needsRedraw = false;\n return needsRedraw;\n }\n\n _removeTransition(attributeName) {\n this.transitions[attributeName].cancel();\n delete this.transitions[attributeName];\n }\n\n _updateAttribute(attributeName, attribute, settings) {\n const transition = this.transitions[attributeName];\n let isNew = !transition || transition.type !== settings.type;\n\n if (isNew) {\n if (!this.isSupported) {\n _utils_log__WEBPACK_IMPORTED_MODULE_4__[\"default\"].warn(\"WebGL2 not supported by this browser. Transition for \".concat(attributeName, \" is disabled.\"))();\n return;\n }\n\n if (transition) {\n this._removeTransition(attributeName);\n }\n\n const TransitionType = TRANSITION_TYPES[settings.type];\n\n if (TransitionType) {\n this.transitions[attributeName] = new TransitionType({\n attribute,\n timeline: this.timeline,\n gl: this.gl\n });\n } else {\n _utils_log__WEBPACK_IMPORTED_MODULE_4__[\"default\"].error(\"unsupported transition type '\".concat(settings.type, \"'\"))();\n isNew = false;\n }\n }\n\n if (isNew || attribute.needsRedraw()) {\n this.needsRedraw = true;\n this.transitions[attributeName].start(settings, this.numInstances);\n }\n }\n\n}\n//# sourceMappingURL=attribute-transition-manager.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute-transition-manager.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute-transition-utils.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute-transition-utils.js ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ cycleBuffers: () => (/* binding */ cycleBuffers),\n/* harmony export */ getAttributeBufferLength: () => (/* binding */ getAttributeBufferLength),\n/* harmony export */ getAttributeTypeFromSize: () => (/* binding */ getAttributeTypeFromSize),\n/* harmony export */ getSourceBufferAttribute: () => (/* binding */ getSourceBufferAttribute),\n/* harmony export */ normalizeTransitionSettings: () => (/* binding */ normalizeTransitionSettings),\n/* harmony export */ padBuffer: () => (/* binding */ padBuffer)\n/* harmony export */ });\n/* harmony import */ var _utils_array_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/array-utils */ \"./node_modules/@deck.gl/core/dist/esm/utils/array-utils.js\");\n\nconst DEFAULT_TRANSITION_SETTINGS = {\n interpolation: {\n duration: 0,\n easing: t => t\n },\n spring: {\n stiffness: 0.05,\n damping: 0.5\n }\n};\nfunction normalizeTransitionSettings(userSettings, layerSettings) {\n if (!userSettings) {\n return null;\n }\n\n if (Number.isFinite(userSettings)) {\n userSettings = {\n type: 'interpolation',\n duration: userSettings\n };\n }\n\n const type = userSettings.type || 'interpolation';\n return { ...DEFAULT_TRANSITION_SETTINGS[type],\n ...layerSettings,\n ...userSettings,\n type\n };\n}\nfunction getSourceBufferAttribute(gl, attribute) {\n const buffer = attribute.getBuffer();\n\n if (buffer) {\n return [buffer, {\n divisor: 0,\n size: attribute.size,\n normalized: attribute.settings.normalized\n }];\n }\n\n return attribute.value;\n}\nfunction getAttributeTypeFromSize(size) {\n switch (size) {\n case 1:\n return 'float';\n\n case 2:\n return 'vec2';\n\n case 3:\n return 'vec3';\n\n case 4:\n return 'vec4';\n\n default:\n throw new Error(\"No defined attribute type for size \\\"\".concat(size, \"\\\"\"));\n }\n}\nfunction cycleBuffers(buffers) {\n buffers.push(buffers.shift());\n}\nfunction getAttributeBufferLength(attribute, numInstances) {\n const {\n doublePrecision,\n settings,\n value,\n size\n } = attribute;\n const multiplier = doublePrecision && value instanceof Float64Array ? 2 : 1;\n return (settings.noAlloc ? value.length : numInstances * size) * multiplier;\n}\nfunction padBuffer({\n buffer,\n numInstances,\n attribute,\n fromLength,\n fromStartIndices,\n getData = x => x\n}) {\n const precisionMultiplier = attribute.doublePrecision && attribute.value instanceof Float64Array ? 2 : 1;\n const size = attribute.size * precisionMultiplier;\n const byteOffset = attribute.byteOffset;\n const toStartIndices = attribute.startIndices;\n const hasStartIndices = fromStartIndices && toStartIndices;\n const toLength = getAttributeBufferLength(attribute, numInstances);\n const isConstant = attribute.isConstant;\n\n if (!hasStartIndices && fromLength >= toLength) {\n return;\n }\n\n const toData = isConstant ? attribute.value : attribute.getBuffer().getData({\n srcByteOffset: byteOffset\n });\n\n if (attribute.settings.normalized && !isConstant) {\n const getter = getData;\n\n getData = (value, chunk) => attribute.normalizeConstant(getter(value, chunk));\n }\n\n const getMissingData = isConstant ? (i, chunk) => getData(toData, chunk) : (i, chunk) => getData(toData.subarray(i, i + size), chunk);\n const source = buffer.getData({\n length: fromLength\n });\n const data = new Float32Array(toLength);\n (0,_utils_array_utils__WEBPACK_IMPORTED_MODULE_0__.padArray)({\n source,\n target: data,\n sourceStartIndices: fromStartIndices,\n targetStartIndices: toStartIndices,\n size,\n getData: getMissingData\n });\n\n if (buffer.byteLength < data.byteLength + byteOffset) {\n buffer.reallocate(data.byteLength + byteOffset);\n }\n\n buffer.subData({\n data,\n offset: byteOffset\n });\n}\n//# sourceMappingURL=attribute-transition-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute-transition-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute.js": +/*!************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Attribute)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _data_column__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./data-column */ \"./node_modules/@deck.gl/core/dist/esm/lib/attribute/data-column.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/assert */ \"./node_modules/@deck.gl/core/dist/esm/utils/assert.js\");\n/* harmony import */ var _utils_iterable_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/iterable-utils */ \"./node_modules/@deck.gl/core/dist/esm/utils/iterable-utils.js\");\n/* harmony import */ var _utils_flatten__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/flatten */ \"./node_modules/@deck.gl/core/dist/esm/utils/flatten.js\");\n/* harmony import */ var _utils_range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/range */ \"./node_modules/@deck.gl/core/dist/esm/utils/range.js\");\n/* harmony import */ var _attribute_transition_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./attribute-transition-utils */ \"./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute-transition-utils.js\");\n\n\n\n\n\n\n\nclass Attribute extends _data_column__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(gl, opts) {\n super(gl, opts, {\n startIndices: null,\n lastExternalBuffer: null,\n binaryValue: null,\n binaryAccessor: null,\n needsUpdate: true,\n needsRedraw: false,\n updateRanges: _utils_range__WEBPACK_IMPORTED_MODULE_2__.FULL\n });\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"constant\", false);\n\n this.settings.update = opts.update || (opts.accessor ? this._autoUpdater : undefined);\n Object.seal(this.settings);\n Object.seal(this.state);\n\n this._validateAttributeUpdaters();\n }\n\n get startIndices() {\n return this.state.startIndices;\n }\n\n set startIndices(layout) {\n this.state.startIndices = layout;\n }\n\n needsUpdate() {\n return this.state.needsUpdate;\n }\n\n needsRedraw({\n clearChangedFlags = false\n } = {}) {\n const needsRedraw = this.state.needsRedraw;\n this.state.needsRedraw = needsRedraw && !clearChangedFlags;\n return needsRedraw;\n }\n\n getUpdateTriggers() {\n const {\n accessor\n } = this.settings;\n return [this.id].concat(typeof accessor !== 'function' && accessor || []);\n }\n\n supportsTransition() {\n return Boolean(this.settings.transition);\n }\n\n getTransitionSetting(opts) {\n if (!opts || !this.supportsTransition()) {\n return null;\n }\n\n const {\n accessor\n } = this.settings;\n const layerSettings = this.settings.transition;\n const userSettings = Array.isArray(accessor) ? opts[accessor.find(a => opts[a])] : opts[accessor];\n return (0,_attribute_transition_utils__WEBPACK_IMPORTED_MODULE_3__.normalizeTransitionSettings)(userSettings, layerSettings);\n }\n\n setNeedsUpdate(reason = this.id, dataRange) {\n this.state.needsUpdate = this.state.needsUpdate || reason;\n this.setNeedsRedraw(reason);\n\n if (dataRange) {\n const {\n startRow = 0,\n endRow = Infinity\n } = dataRange;\n this.state.updateRanges = _utils_range__WEBPACK_IMPORTED_MODULE_2__.add(this.state.updateRanges, [startRow, endRow]);\n } else {\n this.state.updateRanges = _utils_range__WEBPACK_IMPORTED_MODULE_2__.FULL;\n }\n }\n\n clearNeedsUpdate() {\n this.state.needsUpdate = false;\n this.state.updateRanges = _utils_range__WEBPACK_IMPORTED_MODULE_2__.EMPTY;\n }\n\n setNeedsRedraw(reason = this.id) {\n this.state.needsRedraw = this.state.needsRedraw || reason;\n }\n\n allocate(numInstances) {\n const {\n state,\n settings\n } = this;\n\n if (settings.noAlloc) {\n return false;\n }\n\n if (settings.update) {\n super.allocate(numInstances, state.updateRanges !== _utils_range__WEBPACK_IMPORTED_MODULE_2__.FULL);\n return true;\n }\n\n return false;\n }\n\n updateBuffer({\n numInstances,\n data,\n props,\n context\n }) {\n if (!this.needsUpdate()) {\n return false;\n }\n\n const {\n state: {\n updateRanges\n },\n settings: {\n update,\n noAlloc\n }\n } = this;\n let updated = true;\n\n if (update) {\n for (const [startRow, endRow] of updateRanges) {\n update.call(context, this, {\n data,\n startRow,\n endRow,\n props,\n numInstances\n });\n }\n\n if (!this.value) {} else if (this.constant || this.buffer.byteLength < this.value.byteLength + this.byteOffset) {\n this.setData({\n value: this.value,\n constant: this.constant\n });\n this.constant = false;\n } else {\n for (const [startRow, endRow] of updateRanges) {\n const startOffset = Number.isFinite(startRow) ? this.getVertexOffset(startRow) : 0;\n const endOffset = Number.isFinite(endRow) ? this.getVertexOffset(endRow) : noAlloc || !Number.isFinite(numInstances) ? this.value.length : numInstances * this.size;\n super.updateSubBuffer({\n startOffset,\n endOffset\n });\n }\n }\n\n this._checkAttributeArray();\n } else {\n updated = false;\n }\n\n this.clearNeedsUpdate();\n this.setNeedsRedraw();\n return updated;\n }\n\n setConstantValue(value) {\n if (value === undefined || typeof value === 'function') {\n return false;\n }\n\n const hasChanged = this.setData({\n constant: true,\n value\n });\n\n if (hasChanged) {\n this.setNeedsRedraw();\n }\n\n this.clearNeedsUpdate();\n return true;\n }\n\n setExternalBuffer(buffer) {\n const {\n state\n } = this;\n\n if (!buffer) {\n state.lastExternalBuffer = null;\n return false;\n }\n\n this.clearNeedsUpdate();\n\n if (state.lastExternalBuffer === buffer) {\n return true;\n }\n\n state.lastExternalBuffer = buffer;\n this.setNeedsRedraw();\n this.setData(buffer);\n return true;\n }\n\n setBinaryValue(buffer, startIndices = null) {\n const {\n state,\n settings\n } = this;\n\n if (!buffer) {\n state.binaryValue = null;\n state.binaryAccessor = null;\n return false;\n }\n\n if (settings.noAlloc) {\n return false;\n }\n\n if (state.binaryValue === buffer) {\n this.clearNeedsUpdate();\n return true;\n }\n\n state.binaryValue = buffer;\n this.setNeedsRedraw();\n const needsUpdate = settings.transform || startIndices !== this.startIndices;\n\n if (needsUpdate) {\n if (ArrayBuffer.isView(buffer)) {\n buffer = {\n value: buffer\n };\n }\n\n const binaryValue = buffer;\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(ArrayBuffer.isView(binaryValue.value), \"invalid \".concat(settings.accessor));\n const needsNormalize = Boolean(binaryValue.size) && binaryValue.size !== this.size;\n state.binaryAccessor = (0,_utils_iterable_utils__WEBPACK_IMPORTED_MODULE_5__.getAccessorFromBuffer)(binaryValue.value, {\n size: binaryValue.size || this.size,\n stride: binaryValue.stride,\n offset: binaryValue.offset,\n startIndices: startIndices,\n nested: needsNormalize\n });\n return false;\n }\n\n this.clearNeedsUpdate();\n this.setData(buffer);\n return true;\n }\n\n getVertexOffset(row) {\n const {\n startIndices\n } = this;\n const vertexIndex = startIndices ? row < startIndices.length ? startIndices[row] : this.numInstances : row;\n return vertexIndex * this.size;\n }\n\n getShaderAttributes() {\n const shaderAttributeDefs = this.settings.shaderAttributes || {\n [this.id]: null\n };\n const shaderAttributes = {};\n\n for (const shaderAttributeName in shaderAttributeDefs) {\n Object.assign(shaderAttributes, super.getShaderAttributes(shaderAttributeName, shaderAttributeDefs[shaderAttributeName]));\n }\n\n return shaderAttributes;\n }\n\n _autoUpdater(attribute, {\n data,\n startRow,\n endRow,\n props,\n numInstances\n }) {\n if (attribute.constant) {\n return;\n }\n\n const {\n settings,\n state,\n value,\n size,\n startIndices\n } = attribute;\n const {\n accessor,\n transform\n } = settings;\n const accessorFunc = state.binaryAccessor || (typeof accessor === 'function' ? accessor : props[accessor]);\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(typeof accessorFunc === 'function', \"accessor \\\"\".concat(accessor, \"\\\" is not a function\"));\n let i = attribute.getVertexOffset(startRow);\n const {\n iterable,\n objectInfo\n } = (0,_utils_iterable_utils__WEBPACK_IMPORTED_MODULE_5__.createIterable)(data, startRow, endRow);\n\n for (const object of iterable) {\n objectInfo.index++;\n let objectValue = accessorFunc(object, objectInfo);\n\n if (transform) {\n objectValue = transform.call(this, objectValue);\n }\n\n if (startIndices) {\n const numVertices = (objectInfo.index < startIndices.length - 1 ? startIndices[objectInfo.index + 1] : numInstances) - startIndices[objectInfo.index];\n\n if (objectValue && Array.isArray(objectValue[0])) {\n let startIndex = i;\n\n for (const item of objectValue) {\n attribute._normalizeValue(item, value, startIndex);\n\n startIndex += size;\n }\n } else if (objectValue && objectValue.length > size) {\n value.set(objectValue, i);\n } else {\n attribute._normalizeValue(objectValue, objectInfo.target, 0);\n\n (0,_utils_flatten__WEBPACK_IMPORTED_MODULE_6__.fillArray)({\n target: value,\n source: objectInfo.target,\n start: i,\n count: numVertices\n });\n }\n\n i += numVertices * size;\n } else {\n attribute._normalizeValue(objectValue, value, i);\n\n i += size;\n }\n }\n }\n\n _validateAttributeUpdaters() {\n const {\n settings\n } = this;\n const hasUpdater = settings.noAlloc || typeof settings.update === 'function';\n\n if (!hasUpdater) {\n throw new Error(\"Attribute \".concat(this.id, \" missing update or accessor\"));\n }\n }\n\n _checkAttributeArray() {\n const {\n value\n } = this;\n const limit = Math.min(4, this.size);\n\n if (value && value.length >= limit) {\n let valid = true;\n\n switch (limit) {\n case 4:\n valid = valid && Number.isFinite(value[3]);\n\n case 3:\n valid = valid && Number.isFinite(value[2]);\n\n case 2:\n valid = valid && Number.isFinite(value[1]);\n\n case 1:\n valid = valid && Number.isFinite(value[0]);\n break;\n\n default:\n valid = false;\n }\n\n if (!valid) {\n throw new Error(\"Illegal attribute generated for \".concat(this.id));\n }\n }\n }\n\n}\n//# sourceMappingURL=attribute.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/attribute/data-column.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/attribute/data-column.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ DataColumn)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/features/features.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/features/webgl-features-table.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/buffer.js\");\n/* harmony import */ var _shader_attribute__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./shader-attribute */ \"./node_modules/@deck.gl/core/dist/esm/lib/attribute/shader-attribute.js\");\n/* harmony import */ var _gl_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./gl-utils */ \"./node_modules/@deck.gl/core/dist/esm/lib/attribute/gl-utils.js\");\n/* harmony import */ var _utils_typed_array_manager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/typed-array-manager */ \"./node_modules/@deck.gl/core/dist/esm/utils/typed-array-manager.js\");\n/* harmony import */ var _utils_math_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/math-utils */ \"./node_modules/@deck.gl/core/dist/esm/utils/math-utils.js\");\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/log */ \"./node_modules/@deck.gl/core/dist/esm/utils/log.js\");\n\n\n\n\n\n\n\n\nfunction getStride(accessor) {\n return accessor.stride || accessor.size * accessor.bytesPerElement;\n}\n\nfunction resolveShaderAttribute(baseAccessor, shaderAttributeOptions) {\n if (shaderAttributeOptions.offset) {\n _utils_log__WEBPACK_IMPORTED_MODULE_1__[\"default\"].removed('shaderAttribute.offset', 'vertexOffset, elementOffset')();\n }\n\n const stride = getStride(baseAccessor);\n const vertexOffset = shaderAttributeOptions.vertexOffset !== undefined ? shaderAttributeOptions.vertexOffset : baseAccessor.vertexOffset || 0;\n const elementOffset = shaderAttributeOptions.elementOffset || 0;\n const offset = vertexOffset * stride + elementOffset * baseAccessor.bytesPerElement + (baseAccessor.offset || 0);\n return { ...shaderAttributeOptions,\n offset,\n stride\n };\n}\n\nfunction resolveDoublePrecisionShaderAttributes(baseAccessor, shaderAttributeOptions) {\n const resolvedOptions = resolveShaderAttribute(baseAccessor, shaderAttributeOptions);\n return {\n high: resolvedOptions,\n low: { ...resolvedOptions,\n offset: resolvedOptions.offset + baseAccessor.size * 4\n }\n };\n}\n\nclass DataColumn {\n constructor(gl, opts, state) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"gl\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"id\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"size\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"settings\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"value\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"doublePrecision\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_buffer\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"state\", void 0);\n\n this.gl = gl;\n this.id = opts.id || '';\n this.size = opts.size || 1;\n const logicalType = opts.logicalType || opts.type;\n const doublePrecision = logicalType === 5130;\n let {\n defaultValue\n } = opts;\n defaultValue = Number.isFinite(defaultValue) ? [defaultValue] : defaultValue || new Array(this.size).fill(0);\n let bufferType;\n\n if (doublePrecision) {\n bufferType = 5126;\n } else if (!logicalType && opts.isIndexed) {\n bufferType = gl && (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__.hasFeature)(gl, _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__.FEATURES.ELEMENT_INDEX_UINT32) ? 5125 : 5123;\n } else {\n bufferType = logicalType || 5126;\n }\n\n let defaultType = (0,_gl_utils__WEBPACK_IMPORTED_MODULE_4__.glArrayFromType)(logicalType || bufferType || 5126);\n this.doublePrecision = doublePrecision;\n\n if (doublePrecision && opts.fp64 === false) {\n defaultType = Float32Array;\n }\n\n this.value = null;\n this.settings = { ...opts,\n defaultType,\n defaultValue: defaultValue,\n logicalType,\n type: bufferType,\n size: this.size,\n bytesPerElement: defaultType.BYTES_PER_ELEMENT\n };\n this.state = { ...state,\n externalBuffer: null,\n bufferAccessor: this.settings,\n allocatedValue: null,\n numInstances: 0,\n bounds: null,\n constant: false\n };\n this._buffer = null;\n }\n\n get isConstant() {\n return this.state.constant;\n }\n\n get buffer() {\n if (!this._buffer) {\n const {\n isIndexed,\n type\n } = this.settings;\n this._buffer = new _luma_gl_core__WEBPACK_IMPORTED_MODULE_5__[\"default\"](this.gl, {\n id: this.id,\n target: isIndexed ? 34963 : 34962,\n accessor: {\n type\n }\n });\n }\n\n return this._buffer;\n }\n\n get byteOffset() {\n const accessor = this.getAccessor();\n\n if (accessor.vertexOffset) {\n return accessor.vertexOffset * getStride(accessor);\n }\n\n return 0;\n }\n\n get numInstances() {\n return this.state.numInstances;\n }\n\n set numInstances(n) {\n this.state.numInstances = n;\n }\n\n delete() {\n if (this._buffer) {\n this._buffer.delete();\n\n this._buffer = null;\n }\n\n _utils_typed_array_manager__WEBPACK_IMPORTED_MODULE_6__[\"default\"].release(this.state.allocatedValue);\n }\n\n getShaderAttributes(id, options) {\n if (this.doublePrecision) {\n const shaderAttributes = {};\n const isBuffer64Bit = this.value instanceof Float64Array;\n const doubleShaderAttributeDefs = resolveDoublePrecisionShaderAttributes(this.getAccessor(), options || {});\n shaderAttributes[id] = new _shader_attribute__WEBPACK_IMPORTED_MODULE_7__[\"default\"](this, doubleShaderAttributeDefs.high);\n shaderAttributes[\"\".concat(id, \"64Low\")] = isBuffer64Bit ? new _shader_attribute__WEBPACK_IMPORTED_MODULE_7__[\"default\"](this, doubleShaderAttributeDefs.low) : new Float32Array(this.size);\n return shaderAttributes;\n }\n\n if (options) {\n const shaderAttributeDef = resolveShaderAttribute(this.getAccessor(), options);\n return {\n [id]: new _shader_attribute__WEBPACK_IMPORTED_MODULE_7__[\"default\"](this, shaderAttributeDef)\n };\n }\n\n return {\n [id]: this\n };\n }\n\n getBuffer() {\n if (this.state.constant) {\n return null;\n }\n\n return this.state.externalBuffer || this._buffer;\n }\n\n getValue() {\n if (this.state.constant) {\n return this.value;\n }\n\n return [this.getBuffer(), this.getAccessor()];\n }\n\n getAccessor() {\n return this.state.bufferAccessor;\n }\n\n getBounds() {\n if (this.state.bounds) {\n return this.state.bounds;\n }\n\n let result = null;\n\n if (this.state.constant && this.value) {\n const min = Array.from(this.value);\n result = [min, min];\n } else {\n const {\n value,\n numInstances,\n size\n } = this;\n const len = numInstances * size;\n\n if (value && len && value.length >= len) {\n const min = new Array(size).fill(Infinity);\n const max = new Array(size).fill(-Infinity);\n\n for (let i = 0; i < len;) {\n for (let j = 0; j < size; j++) {\n const v = value[i++];\n if (v < min[j]) min[j] = v;\n if (v > max[j]) max[j] = v;\n }\n }\n\n result = [min, max];\n }\n }\n\n this.state.bounds = result;\n return result;\n }\n\n setData(data) {\n const {\n state\n } = this;\n let opts;\n\n if (ArrayBuffer.isView(data)) {\n opts = {\n value: data\n };\n } else if (data instanceof _luma_gl_core__WEBPACK_IMPORTED_MODULE_5__[\"default\"]) {\n opts = {\n buffer: data\n };\n } else {\n opts = data;\n }\n\n const accessor = { ...this.settings,\n ...opts\n };\n state.bufferAccessor = accessor;\n state.bounds = null;\n\n if (opts.constant) {\n let value = opts.value;\n value = this._normalizeValue(value, [], 0);\n\n if (this.settings.normalized) {\n value = this.normalizeConstant(value);\n }\n\n const hasChanged = !state.constant || !this._areValuesEqual(value, this.value);\n\n if (!hasChanged) {\n return false;\n }\n\n state.externalBuffer = null;\n state.constant = true;\n this.value = value;\n } else if (opts.buffer) {\n const buffer = opts.buffer;\n state.externalBuffer = buffer;\n state.constant = false;\n this.value = opts.value || null;\n const isBuffer64Bit = opts.value instanceof Float64Array;\n accessor.type = opts.type || buffer.accessor.type;\n accessor.bytesPerElement = buffer.accessor.BYTES_PER_ELEMENT * (isBuffer64Bit ? 2 : 1);\n accessor.stride = getStride(accessor);\n } else if (opts.value) {\n this._checkExternalBuffer(opts);\n\n let value = opts.value;\n state.externalBuffer = null;\n state.constant = false;\n this.value = value;\n accessor.bytesPerElement = value.BYTES_PER_ELEMENT;\n accessor.stride = getStride(accessor);\n const {\n buffer,\n byteOffset\n } = this;\n\n if (this.doublePrecision && value instanceof Float64Array) {\n value = (0,_utils_math_utils__WEBPACK_IMPORTED_MODULE_8__.toDoublePrecisionArray)(value, accessor);\n }\n\n const requiredBufferSize = value.byteLength + byteOffset + accessor.stride * 2;\n\n if (buffer.byteLength < requiredBufferSize) {\n buffer.reallocate(requiredBufferSize);\n }\n\n buffer.setAccessor(null);\n buffer.subData({\n data: value,\n offset: byteOffset\n });\n accessor.type = opts.type || buffer.accessor.type;\n }\n\n return true;\n }\n\n updateSubBuffer(opts = {}) {\n this.state.bounds = null;\n const value = this.value;\n const {\n startOffset = 0,\n endOffset\n } = opts;\n this.buffer.subData({\n data: this.doublePrecision && value instanceof Float64Array ? (0,_utils_math_utils__WEBPACK_IMPORTED_MODULE_8__.toDoublePrecisionArray)(value, {\n size: this.size,\n startIndex: startOffset,\n endIndex: endOffset\n }) : value.subarray(startOffset, endOffset),\n offset: startOffset * value.BYTES_PER_ELEMENT + this.byteOffset\n });\n }\n\n allocate(numInstances, copy = false) {\n const {\n state\n } = this;\n const oldValue = state.allocatedValue;\n const value = _utils_typed_array_manager__WEBPACK_IMPORTED_MODULE_6__[\"default\"].allocate(oldValue, numInstances + 1, {\n size: this.size,\n type: this.settings.defaultType,\n copy\n });\n this.value = value;\n const {\n buffer,\n byteOffset\n } = this;\n\n if (buffer.byteLength < value.byteLength + byteOffset) {\n buffer.reallocate(value.byteLength + byteOffset);\n\n if (copy && oldValue) {\n buffer.subData({\n data: oldValue instanceof Float64Array ? (0,_utils_math_utils__WEBPACK_IMPORTED_MODULE_8__.toDoublePrecisionArray)(oldValue, this) : oldValue,\n offset: byteOffset\n });\n }\n }\n\n state.allocatedValue = value;\n state.constant = false;\n state.externalBuffer = null;\n state.bufferAccessor = this.settings;\n return true;\n }\n\n _checkExternalBuffer(opts) {\n const {\n value\n } = opts;\n\n if (!ArrayBuffer.isView(value)) {\n throw new Error(\"Attribute \".concat(this.id, \" value is not TypedArray\"));\n }\n\n const ArrayType = this.settings.defaultType;\n let illegalArrayType = false;\n\n if (this.doublePrecision) {\n illegalArrayType = value.BYTES_PER_ELEMENT < 4;\n }\n\n if (illegalArrayType) {\n throw new Error(\"Attribute \".concat(this.id, \" does not support \").concat(value.constructor.name));\n }\n\n if (!(value instanceof ArrayType) && this.settings.normalized && !('normalized' in opts)) {\n _utils_log__WEBPACK_IMPORTED_MODULE_1__[\"default\"].warn(\"Attribute \".concat(this.id, \" is normalized\"))();\n }\n }\n\n normalizeConstant(value) {\n switch (this.settings.type) {\n case 5120:\n return new Float32Array(value).map(x => (x + 128) / 255 * 2 - 1);\n\n case 5122:\n return new Float32Array(value).map(x => (x + 32768) / 65535 * 2 - 1);\n\n case 5121:\n return new Float32Array(value).map(x => x / 255);\n\n case 5123:\n return new Float32Array(value).map(x => x / 65535);\n\n default:\n return value;\n }\n }\n\n _normalizeValue(value, out, start) {\n const {\n defaultValue,\n size\n } = this.settings;\n\n if (Number.isFinite(value)) {\n out[start] = value;\n return out;\n }\n\n if (!value) {\n let i = size;\n\n while (--i >= 0) {\n out[start + i] = defaultValue[i];\n }\n\n return out;\n }\n\n switch (size) {\n case 4:\n out[start + 3] = Number.isFinite(value[3]) ? value[3] : defaultValue[3];\n\n case 3:\n out[start + 2] = Number.isFinite(value[2]) ? value[2] : defaultValue[2];\n\n case 2:\n out[start + 1] = Number.isFinite(value[1]) ? value[1] : defaultValue[1];\n\n case 1:\n out[start + 0] = Number.isFinite(value[0]) ? value[0] : defaultValue[0];\n break;\n\n default:\n let i = size;\n\n while (--i >= 0) {\n out[start + i] = Number.isFinite(value[i]) ? value[i] : defaultValue[i];\n }\n\n }\n\n return out;\n }\n\n _areValuesEqual(value1, value2) {\n if (!value1 || !value2) {\n return false;\n }\n\n const {\n size\n } = this;\n\n for (let i = 0; i < size; i++) {\n if (value1[i] !== value2[i]) {\n return false;\n }\n }\n\n return true;\n }\n\n}\n//# sourceMappingURL=data-column.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/attribute/data-column.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/attribute/gl-utils.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/attribute/gl-utils.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ glArrayFromType: () => (/* binding */ glArrayFromType)\n/* harmony export */ });\nfunction glArrayFromType(glType) {\n switch (glType) {\n case 5126:\n return Float32Array;\n\n case 5130:\n return Float64Array;\n\n case 5123:\n case 33635:\n case 32819:\n case 32820:\n return Uint16Array;\n\n case 5125:\n return Uint32Array;\n\n case 5121:\n return Uint8ClampedArray;\n\n case 5120:\n return Int8Array;\n\n case 5122:\n return Int16Array;\n\n case 5124:\n return Int32Array;\n\n default:\n throw new Error('Unknown GL type');\n }\n}\n//# sourceMappingURL=gl-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/attribute/gl-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/attribute/shader-attribute.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/attribute/shader-attribute.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ShaderAttribute)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n\nclass ShaderAttribute {\n constructor(dataColumn, opts) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"opts\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"source\", void 0);\n\n this.opts = opts;\n this.source = dataColumn;\n }\n\n get value() {\n return this.source.value;\n }\n\n getValue() {\n const buffer = this.source.getBuffer();\n const accessor = this.getAccessor();\n\n if (buffer) {\n return [buffer, accessor];\n }\n\n const {\n value\n } = this.source;\n const {\n size\n } = accessor;\n let constantValue = value;\n\n if (value && value.length !== size) {\n constantValue = new Float32Array(size);\n const index = accessor.elementOffset || 0;\n\n for (let i = 0; i < size; ++i) {\n constantValue[i] = value[index + i];\n }\n }\n\n return constantValue;\n }\n\n getAccessor() {\n return { ...this.source.getAccessor(),\n ...this.opts\n };\n }\n\n}\n//# sourceMappingURL=shader-attribute.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/attribute/shader-attribute.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/constants.js": +/*!**************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/constants.js ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ COORDINATE_SYSTEM: () => (/* binding */ COORDINATE_SYSTEM),\n/* harmony export */ EVENTS: () => (/* binding */ EVENTS),\n/* harmony export */ OPERATION: () => (/* binding */ OPERATION),\n/* harmony export */ PROJECTION_MODE: () => (/* binding */ PROJECTION_MODE),\n/* harmony export */ UNIT: () => (/* binding */ UNIT)\n/* harmony export */ });\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/log */ \"./node_modules/@deck.gl/core/dist/esm/utils/log.js\");\n\nconst COORDINATE_SYSTEM = {\n DEFAULT: -1,\n LNGLAT: 1,\n METER_OFFSETS: 2,\n LNGLAT_OFFSETS: 3,\n CARTESIAN: 0\n};\nObject.defineProperty(COORDINATE_SYSTEM, 'IDENTITY', {\n get: () => {\n _utils_log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].deprecated('COORDINATE_SYSTEM.IDENTITY', 'COORDINATE_SYSTEM.CARTESIAN')();\n return 0;\n }\n});\nconst PROJECTION_MODE = {\n WEB_MERCATOR: 1,\n GLOBE: 2,\n WEB_MERCATOR_AUTO_OFFSET: 4,\n IDENTITY: 0\n};\nconst UNIT = {\n common: 0,\n meters: 1,\n pixels: 2\n};\nconst EVENTS = {\n click: {\n handler: 'onClick'\n },\n panstart: {\n handler: 'onDragStart'\n },\n panmove: {\n handler: 'onDrag'\n },\n panend: {\n handler: 'onDragEnd'\n }\n};\nconst OPERATION = {\n DRAW: 'draw',\n MASK: 'mask',\n TERRAIN: 'terrain'\n};\n//# sourceMappingURL=constants.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/constants.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/deck-picker.js": +/*!****************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/deck-picker.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ DeckPicker)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/framebuffer.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture-2d.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/copy-and-blit.js\");\n/* harmony import */ var _passes_pick_layers_pass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../passes/pick-layers-pass */ \"./node_modules/@deck.gl/core/dist/esm/passes/pick-layers-pass.js\");\n/* harmony import */ var _picking_query_object__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./picking/query-object */ \"./node_modules/@deck.gl/core/dist/esm/lib/picking/query-object.js\");\n/* harmony import */ var _picking_pick_info__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./picking/pick-info */ \"./node_modules/@deck.gl/core/dist/esm/lib/picking/pick-info.js\");\n\n\n\n\n\nclass DeckPicker {\n constructor(gl) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"gl\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"pickingFBO\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"depthFBO\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"pickLayersPass\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"layerFilter\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"lastPickedInfo\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_pickable\", true);\n\n this.gl = gl;\n this.pickLayersPass = new _passes_pick_layers_pass__WEBPACK_IMPORTED_MODULE_1__[\"default\"](gl);\n this.lastPickedInfo = {\n index: -1,\n layerId: null,\n info: null\n };\n }\n\n setProps(props) {\n if ('layerFilter' in props) {\n this.layerFilter = props.layerFilter;\n }\n\n if ('_pickable' in props) {\n this._pickable = props._pickable;\n }\n }\n\n finalize() {\n if (this.pickingFBO) {\n this.pickingFBO.delete();\n }\n\n if (this.depthFBO) {\n this.depthFBO.color.delete();\n this.depthFBO.delete();\n }\n }\n\n pickObject(opts) {\n return this._pickClosestObject(opts);\n }\n\n pickObjects(opts) {\n return this._pickVisibleObjects(opts);\n }\n\n getLastPickedObject({\n x,\n y,\n layers,\n viewports\n }, lastPickedInfo = this.lastPickedInfo.info) {\n const lastPickedLayerId = lastPickedInfo && lastPickedInfo.layer && lastPickedInfo.layer.id;\n const lastPickedViewportId = lastPickedInfo && lastPickedInfo.viewport && lastPickedInfo.viewport.id;\n const layer = lastPickedLayerId ? layers.find(l => l.id === lastPickedLayerId) : null;\n const viewport = lastPickedViewportId && viewports.find(v => v.id === lastPickedViewportId) || viewports[0];\n const coordinate = viewport && viewport.unproject([x - viewport.x, y - viewport.y]);\n const info = {\n x,\n y,\n viewport,\n coordinate,\n layer\n };\n return { ...lastPickedInfo,\n ...info\n };\n }\n\n _resizeBuffer() {\n var _this$pickingFBO, _this$depthFBO;\n\n const {\n gl\n } = this;\n\n if (!this.pickingFBO) {\n this.pickingFBO = new _luma_gl_core__WEBPACK_IMPORTED_MODULE_2__[\"default\"](gl);\n\n if (_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__[\"default\"].isSupported(gl, {\n colorBufferFloat: true\n })) {\n const depthFBO = new _luma_gl_core__WEBPACK_IMPORTED_MODULE_2__[\"default\"](gl);\n depthFBO.attach({\n [36064]: new _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"](gl, {\n format: (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_4__.isWebGL2)(gl) ? 34836 : 6408,\n type: 5126\n })\n });\n this.depthFBO = depthFBO;\n }\n }\n\n (_this$pickingFBO = this.pickingFBO) === null || _this$pickingFBO === void 0 ? void 0 : _this$pickingFBO.resize({\n width: gl.canvas.width,\n height: gl.canvas.height\n });\n (_this$depthFBO = this.depthFBO) === null || _this$depthFBO === void 0 ? void 0 : _this$depthFBO.resize({\n width: gl.canvas.width,\n height: gl.canvas.height\n });\n }\n\n _getPickable(layers) {\n if (this._pickable === false) {\n return null;\n }\n\n const pickableLayers = layers.filter(layer => this.pickLayersPass.shouldDrawLayer(layer) && !layer.isComposite);\n return pickableLayers.length ? pickableLayers : null;\n }\n\n _pickClosestObject({\n layers,\n views,\n viewports,\n x,\n y,\n radius = 0,\n depth = 1,\n mode = 'query',\n unproject3D,\n onViewportActive,\n effects\n }) {\n const pickableLayers = this._getPickable(layers);\n\n const pixelRatio = (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_4__.cssToDeviceRatio)(this.gl);\n\n if (!pickableLayers) {\n return {\n result: [],\n emptyInfo: (0,_picking_pick_info__WEBPACK_IMPORTED_MODULE_5__.getEmptyPickingInfo)({\n viewports,\n x,\n y,\n pixelRatio\n })\n };\n }\n\n this._resizeBuffer();\n\n const devicePixelRange = (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_4__.cssToDevicePixels)(this.gl, [x, y], true);\n const devicePixel = [devicePixelRange.x + Math.floor(devicePixelRange.width / 2), devicePixelRange.y + Math.floor(devicePixelRange.height / 2)];\n const deviceRadius = Math.round(radius * pixelRatio);\n const {\n width,\n height\n } = this.pickingFBO;\n\n const deviceRect = this._getPickingRect({\n deviceX: devicePixel[0],\n deviceY: devicePixel[1],\n deviceRadius,\n deviceWidth: width,\n deviceHeight: height\n });\n\n const cullRect = {\n x: x - radius,\n y: y - radius,\n width: radius * 2 + 1,\n height: radius * 2 + 1\n };\n let infos;\n const result = [];\n const affectedLayers = new Set();\n\n for (let i = 0; i < depth; i++) {\n let pickInfo;\n\n if (deviceRect) {\n const pickedResult = this._drawAndSample({\n layers: pickableLayers,\n views,\n viewports,\n onViewportActive,\n deviceRect,\n cullRect,\n effects,\n pass: \"picking:\".concat(mode)\n });\n\n pickInfo = (0,_picking_query_object__WEBPACK_IMPORTED_MODULE_6__.getClosestObject)({ ...pickedResult,\n deviceX: devicePixel[0],\n deviceY: devicePixel[1],\n deviceRadius,\n deviceRect\n });\n } else {\n pickInfo = {\n pickedColor: null,\n pickedObjectIndex: -1\n };\n }\n\n let z;\n\n if (pickInfo.pickedLayer && unproject3D && this.depthFBO) {\n const {\n pickedColors: pickedColors2\n } = this._drawAndSample({\n layers: [pickInfo.pickedLayer],\n views,\n viewports,\n onViewportActive,\n deviceRect: {\n x: pickInfo.pickedX,\n y: pickInfo.pickedY,\n width: 1,\n height: 1\n },\n cullRect,\n effects,\n pass: \"picking:\".concat(mode, \":z\")\n }, true);\n\n if (pickedColors2[3]) {\n z = pickedColors2[0];\n }\n }\n\n if (pickInfo.pickedLayer && i + 1 < depth) {\n affectedLayers.add(pickInfo.pickedLayer);\n pickInfo.pickedLayer.disablePickingIndex(pickInfo.pickedObjectIndex);\n }\n\n infos = (0,_picking_pick_info__WEBPACK_IMPORTED_MODULE_5__.processPickInfo)({\n pickInfo,\n lastPickedInfo: this.lastPickedInfo,\n mode,\n layers: pickableLayers,\n viewports,\n x,\n y,\n z,\n pixelRatio\n });\n\n for (const info of infos.values()) {\n if (info.layer) {\n result.push(info);\n }\n }\n\n if (!pickInfo.pickedColor) {\n break;\n }\n }\n\n for (const layer of affectedLayers) {\n layer.restorePickingColors();\n }\n\n return {\n result,\n emptyInfo: infos.get(null)\n };\n }\n\n _pickVisibleObjects({\n layers,\n views,\n viewports,\n x,\n y,\n width = 1,\n height = 1,\n mode = 'query',\n maxObjects = null,\n onViewportActive,\n effects\n }) {\n const pickableLayers = this._getPickable(layers);\n\n if (!pickableLayers) {\n return [];\n }\n\n this._resizeBuffer();\n\n const pixelRatio = (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_4__.cssToDeviceRatio)(this.gl);\n const leftTop = (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_4__.cssToDevicePixels)(this.gl, [x, y], true);\n const deviceLeft = leftTop.x;\n const deviceTop = leftTop.y + leftTop.height;\n const rightBottom = (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_4__.cssToDevicePixels)(this.gl, [x + width, y + height], true);\n const deviceRight = rightBottom.x + rightBottom.width;\n const deviceBottom = rightBottom.y;\n const deviceRect = {\n x: deviceLeft,\n y: deviceBottom,\n width: deviceRight - deviceLeft,\n height: deviceTop - deviceBottom\n };\n\n const pickedResult = this._drawAndSample({\n layers: pickableLayers,\n views,\n viewports,\n onViewportActive,\n deviceRect,\n cullRect: {\n x,\n y,\n width,\n height\n },\n effects,\n pass: \"picking:\".concat(mode)\n });\n\n const pickInfos = (0,_picking_query_object__WEBPACK_IMPORTED_MODULE_6__.getUniqueObjects)(pickedResult);\n const uniqueInfos = new Map();\n const isMaxObjects = Number.isFinite(maxObjects);\n\n for (let i = 0; i < pickInfos.length; i++) {\n var _info$object;\n\n if (isMaxObjects && maxObjects && uniqueInfos.size >= maxObjects) {\n break;\n }\n\n const pickInfo = pickInfos[i];\n let info = {\n color: pickInfo.pickedColor,\n layer: null,\n index: pickInfo.pickedObjectIndex,\n picked: true,\n x,\n y,\n pixelRatio\n };\n info = (0,_picking_pick_info__WEBPACK_IMPORTED_MODULE_5__.getLayerPickingInfo)({\n layer: pickInfo.pickedLayer,\n info,\n mode\n });\n const pickedObjectKey = (_info$object = info.object) !== null && _info$object !== void 0 ? _info$object : \"\".concat(info.layer.id, \"[\").concat(info.index, \"]\");\n\n if (!uniqueInfos.has(pickedObjectKey)) {\n uniqueInfos.set(pickedObjectKey, info);\n }\n }\n\n return Array.from(uniqueInfos.values());\n }\n\n _drawAndSample({\n layers,\n views,\n viewports,\n onViewportActive,\n deviceRect,\n cullRect,\n effects,\n pass\n }, pickZ = false) {\n const pickingFBO = pickZ ? this.depthFBO : this.pickingFBO;\n const opts = {\n layers,\n layerFilter: this.layerFilter,\n views,\n viewports,\n onViewportActive,\n pickingFBO,\n deviceRect,\n cullRect,\n effects,\n pass,\n pickZ,\n preRenderStats: {}\n };\n\n for (const effect of effects) {\n if (effect.useInPicking) {\n opts.preRenderStats[effect.id] = effect.preRender(this.gl, opts);\n }\n }\n\n const {\n decodePickingColor\n } = this.pickLayersPass.render(opts);\n const {\n x,\n y,\n width,\n height\n } = deviceRect;\n const pickedColors = new (pickZ ? Float32Array : Uint8Array)(width * height * 4);\n (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_7__.readPixelsToArray)(pickingFBO, {\n sourceX: x,\n sourceY: y,\n sourceWidth: width,\n sourceHeight: height,\n target: pickedColors\n });\n return {\n pickedColors,\n decodePickingColor\n };\n }\n\n _getPickingRect({\n deviceX,\n deviceY,\n deviceRadius,\n deviceWidth,\n deviceHeight\n }) {\n const x = Math.max(0, deviceX - deviceRadius);\n const y = Math.max(0, deviceY - deviceRadius);\n const width = Math.min(deviceWidth, deviceX + deviceRadius + 1) - x;\n const height = Math.min(deviceHeight, deviceY + deviceRadius + 1) - y;\n\n if (width <= 0 || height <= 0) {\n return null;\n }\n\n return {\n x,\n y,\n width,\n height\n };\n }\n\n}\n//# sourceMappingURL=deck-picker.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/deck-picker.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/deck-renderer.js": +/*!******************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/deck-renderer.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ DeckRenderer)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _debug__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../debug */ \"./node_modules/@deck.gl/core/dist/esm/debug/index.js\");\n/* harmony import */ var _passes_draw_layers_pass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../passes/draw-layers-pass */ \"./node_modules/@deck.gl/core/dist/esm/passes/draw-layers-pass.js\");\n/* harmony import */ var _passes_pick_layers_pass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../passes/pick-layers-pass */ \"./node_modules/@deck.gl/core/dist/esm/passes/pick-layers-pass.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/framebuffer.js\");\n\n\n\n\n\nconst TRACE_RENDER_LAYERS = 'deckRenderer.renderLayers';\nclass DeckRenderer {\n constructor(gl) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"gl\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"layerFilter\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"drawPickingColors\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"drawLayersPass\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"pickLayersPass\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"renderCount\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_needsRedraw\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"renderBuffers\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"lastPostProcessEffect\", void 0);\n\n this.gl = gl;\n this.layerFilter = null;\n this.drawPickingColors = false;\n this.drawLayersPass = new _passes_draw_layers_pass__WEBPACK_IMPORTED_MODULE_1__[\"default\"](gl);\n this.pickLayersPass = new _passes_pick_layers_pass__WEBPACK_IMPORTED_MODULE_2__[\"default\"](gl);\n this.renderCount = 0;\n this._needsRedraw = 'Initial render';\n this.renderBuffers = [];\n this.lastPostProcessEffect = null;\n }\n\n setProps(props) {\n if (this.layerFilter !== props.layerFilter) {\n this.layerFilter = props.layerFilter;\n this._needsRedraw = 'layerFilter changed';\n }\n\n if (this.drawPickingColors !== props.drawPickingColors) {\n this.drawPickingColors = props.drawPickingColors;\n this._needsRedraw = 'drawPickingColors changed';\n }\n }\n\n renderLayers(opts) {\n if (!opts.viewports.length) {\n return;\n }\n\n const layerPass = this.drawPickingColors ? this.pickLayersPass : this.drawLayersPass;\n const renderOpts = {\n layerFilter: this.layerFilter,\n isPicking: this.drawPickingColors,\n ...opts,\n target: opts.target || _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getDefaultFramebuffer(this.gl)\n };\n\n if (renderOpts.effects) {\n this._preRender(renderOpts.effects, renderOpts);\n }\n\n const outputBuffer = this.lastPostProcessEffect ? this.renderBuffers[0] : renderOpts.target;\n const renderStats = layerPass.render({ ...renderOpts,\n target: outputBuffer\n });\n\n if (renderOpts.effects) {\n this._postRender(renderOpts.effects, renderOpts);\n }\n\n this.renderCount++;\n (0,_debug__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(TRACE_RENDER_LAYERS, this, renderStats, opts);\n }\n\n needsRedraw(opts = {\n clearRedrawFlags: false\n }) {\n const redraw = this._needsRedraw;\n\n if (opts.clearRedrawFlags) {\n this._needsRedraw = false;\n }\n\n return redraw;\n }\n\n finalize() {\n const {\n renderBuffers\n } = this;\n\n for (const buffer of renderBuffers) {\n buffer.delete();\n }\n\n renderBuffers.length = 0;\n }\n\n _preRender(effects, opts) {\n this.lastPostProcessEffect = null;\n opts.preRenderStats = opts.preRenderStats || {};\n\n for (const effect of effects) {\n opts.preRenderStats[effect.id] = effect.preRender(this.gl, opts);\n\n if (effect.postRender) {\n this.lastPostProcessEffect = effect.id;\n }\n }\n\n if (this.lastPostProcessEffect) {\n this._resizeRenderBuffers();\n }\n }\n\n _resizeRenderBuffers() {\n const {\n renderBuffers\n } = this;\n\n if (renderBuffers.length === 0) {\n renderBuffers.push(new _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.gl), new _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.gl));\n }\n\n for (const buffer of renderBuffers) {\n buffer.resize();\n }\n }\n\n _postRender(effects, opts) {\n const {\n renderBuffers\n } = this;\n const params = { ...opts,\n inputBuffer: renderBuffers[0],\n swapBuffer: renderBuffers[1],\n target: null\n };\n\n for (const effect of effects) {\n if (effect.postRender) {\n if (effect.id === this.lastPostProcessEffect) {\n params.target = opts.target;\n effect.postRender(this.gl, params);\n break;\n }\n\n const buffer = effect.postRender(this.gl, params);\n params.inputBuffer = buffer;\n params.swapBuffer = buffer === renderBuffers[0] ? renderBuffers[1] : renderBuffers[0];\n }\n }\n }\n\n}\n//# sourceMappingURL=deck-renderer.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/deck-renderer.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/deck.js": +/*!*********************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/deck.js ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Deck)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _layer_manager__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./layer-manager */ \"./node_modules/@deck.gl/core/dist/esm/lib/layer-manager.js\");\n/* harmony import */ var _view_manager__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./view-manager */ \"./node_modules/@deck.gl/core/dist/esm/lib/view-manager.js\");\n/* harmony import */ var _views_map_view__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../views/map-view */ \"./node_modules/@deck.gl/core/dist/esm/views/map-view.js\");\n/* harmony import */ var _effect_manager__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./effect-manager */ \"./node_modules/@deck.gl/core/dist/esm/lib/effect-manager.js\");\n/* harmony import */ var _deck_renderer__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./deck-renderer */ \"./node_modules/@deck.gl/core/dist/esm/lib/deck-renderer.js\");\n/* harmony import */ var _deck_picker__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./deck-picker */ \"./node_modules/@deck.gl/core/dist/esm/lib/deck-picker.js\");\n/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./tooltip */ \"./node_modules/@deck.gl/core/dist/esm/lib/tooltip.js\");\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/log */ \"./node_modules/@deck.gl/core/dist/esm/utils/log.js\");\n/* harmony import */ var _utils_deep_equal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/deep-equal */ \"./node_modules/@deck.gl/core/dist/esm/utils/deep-equal.js\");\n/* harmony import */ var _utils_typed_array_manager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/typed-array-manager */ \"./node_modules/@deck.gl/core/dist/esm/utils/typed-array-manager.js\");\n/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./init */ \"./node_modules/@deck.gl/core/dist/esm/lib/init.js\");\n/* harmony import */ var _probe_gl_env__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @probe.gl/env */ \"./node_modules/@probe.gl/env/dist/esm/lib/get-browser.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/engine/dist/esm/lib/animation-loop.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/engine/dist/esm/animation/timeline.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/init.js\");\n/* harmony import */ var _probe_gl_stats__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @probe.gl/stats */ \"./node_modules/@probe.gl/stats/dist/esm/index.js\");\n/* harmony import */ var mjolnir_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! mjolnir.js */ \"./node_modules/mjolnir.js/dist/esm/index.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@deck.gl/core/dist/esm/utils/assert.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants */ \"./node_modules/@deck.gl/core/dist/esm/lib/constants.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction noop() {}\n\nconst getCursor = ({\n isDragging\n}) => isDragging ? 'grabbing' : 'grab';\n\nconst defaultProps = {\n id: '',\n width: '100%',\n height: '100%',\n style: null,\n viewState: null,\n initialViewState: null,\n pickingRadius: 0,\n layerFilter: null,\n glOptions: {},\n parameters: {},\n parent: null,\n gl: null,\n canvas: null,\n layers: [],\n effects: [],\n views: null,\n controller: null,\n useDevicePixels: true,\n touchAction: 'none',\n eventRecognizerOptions: {},\n _framebuffer: null,\n _animate: false,\n _pickable: true,\n _typedArrayManagerProps: {},\n _customRender: null,\n onWebGLInitialized: noop,\n onResize: noop,\n onViewStateChange: noop,\n onInteractionStateChange: noop,\n onBeforeRender: noop,\n onAfterRender: noop,\n onLoad: noop,\n onError: error => _utils_log__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(error.message, error.cause)(),\n onHover: null,\n onClick: null,\n onDragStart: null,\n onDrag: null,\n onDragEnd: null,\n _onMetrics: null,\n getCursor,\n getTooltip: null,\n debug: false,\n drawPickingColors: false\n};\nclass Deck {\n constructor(props) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"props\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"width\", 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"height\", 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"userData\", {});\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"canvas\", null);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"viewManager\", null);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"layerManager\", null);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"effectManager\", null);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"deckRenderer\", null);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"deckPicker\", null);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"eventManager\", null);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"tooltip\", null);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"metrics\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"animationLoop\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"stats\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"viewState\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"cursorState\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_needsRedraw\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_pickRequest\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_lastPointerDownInfo\", null);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_metricsCounter\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_onPointerMove\", event => {\n const {\n _pickRequest\n } = this;\n\n if (event.type === 'pointerleave') {\n _pickRequest.x = -1;\n _pickRequest.y = -1;\n _pickRequest.radius = 0;\n } else if (event.leftButton || event.rightButton) {\n return;\n } else {\n const pos = event.offsetCenter;\n\n if (!pos) {\n return;\n }\n\n _pickRequest.x = pos.x;\n _pickRequest.y = pos.y;\n _pickRequest.radius = this.props.pickingRadius;\n }\n\n if (this.layerManager) {\n this.layerManager.context.mousePosition = {\n x: _pickRequest.x,\n y: _pickRequest.y\n };\n }\n\n _pickRequest.event = event;\n });\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_onEvent\", event => {\n const eventOptions = _constants__WEBPACK_IMPORTED_MODULE_4__.EVENTS[event.type];\n const pos = event.offsetCenter;\n\n if (!eventOptions || !pos || !this.layerManager) {\n return;\n }\n\n const layers = this.layerManager.getLayers();\n const info = this.deckPicker.getLastPickedObject({\n x: pos.x,\n y: pos.y,\n layers,\n viewports: this.getViewports(pos)\n }, this._lastPointerDownInfo);\n const {\n layer\n } = info;\n const layerHandler = layer && (layer[eventOptions.handler] || layer.props[eventOptions.handler]);\n const rootHandler = this.props[eventOptions.handler];\n let handled = false;\n\n if (layerHandler) {\n handled = layerHandler.call(layer, info, event);\n }\n\n if (!handled && rootHandler) {\n rootHandler(info, event);\n }\n });\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_onPointerDown\", event => {\n const pos = event.offsetCenter;\n\n const pickedInfo = this._pick('pickObject', 'pickObject Time', {\n x: pos.x,\n y: pos.y,\n radius: this.props.pickingRadius\n });\n\n this._lastPointerDownInfo = pickedInfo.result[0] || pickedInfo.emptyInfo;\n });\n\n this.props = { ...defaultProps,\n ...props\n };\n props = this.props;\n this._needsRedraw = 'Initial render';\n this._pickRequest = {\n mode: 'hover',\n x: -1,\n y: -1,\n radius: 0,\n event: null\n };\n this.cursorState = {\n isHovering: false,\n isDragging: false\n };\n\n if (props.viewState && props.initialViewState) {\n _utils_log__WEBPACK_IMPORTED_MODULE_3__[\"default\"].warn('View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.')();\n }\n\n if ((0,_probe_gl_env__WEBPACK_IMPORTED_MODULE_5__[\"default\"])() === 'IE') {\n _utils_log__WEBPACK_IMPORTED_MODULE_3__[\"default\"].warn('IE 11 is not supported')();\n }\n\n this.viewState = props.initialViewState;\n\n if (!props.gl) {\n if (typeof document !== 'undefined') {\n this.canvas = this._createCanvas(props);\n }\n }\n\n this.animationLoop = this._createAnimationLoop(props);\n this.stats = new _probe_gl_stats__WEBPACK_IMPORTED_MODULE_1__.Stats({\n id: 'deck.gl'\n });\n this.metrics = {\n fps: 0,\n setPropsTime: 0,\n updateAttributesTime: 0,\n framesRedrawn: 0,\n pickTime: 0,\n pickCount: 0,\n gpuTime: 0,\n gpuTimePerFrame: 0,\n cpuTime: 0,\n cpuTimePerFrame: 0,\n bufferMemory: 0,\n textureMemory: 0,\n renderbufferMemory: 0,\n gpuMemory: 0\n };\n this._metricsCounter = 0;\n this.setProps(props);\n\n if (props._typedArrayManagerProps) {\n _utils_typed_array_manager__WEBPACK_IMPORTED_MODULE_6__[\"default\"].setOptions(props._typedArrayManagerProps);\n }\n\n this.animationLoop.start();\n }\n\n finalize() {\n var _this$animationLoop, _this$layerManager, _this$viewManager, _this$effectManager, _this$deckRenderer, _this$deckPicker, _this$eventManager, _this$tooltip;\n\n (_this$animationLoop = this.animationLoop) === null || _this$animationLoop === void 0 ? void 0 : _this$animationLoop.stop();\n this.animationLoop = null;\n this._lastPointerDownInfo = null;\n (_this$layerManager = this.layerManager) === null || _this$layerManager === void 0 ? void 0 : _this$layerManager.finalize();\n this.layerManager = null;\n (_this$viewManager = this.viewManager) === null || _this$viewManager === void 0 ? void 0 : _this$viewManager.finalize();\n this.viewManager = null;\n (_this$effectManager = this.effectManager) === null || _this$effectManager === void 0 ? void 0 : _this$effectManager.finalize();\n this.effectManager = null;\n (_this$deckRenderer = this.deckRenderer) === null || _this$deckRenderer === void 0 ? void 0 : _this$deckRenderer.finalize();\n this.deckRenderer = null;\n (_this$deckPicker = this.deckPicker) === null || _this$deckPicker === void 0 ? void 0 : _this$deckPicker.finalize();\n this.deckPicker = null;\n (_this$eventManager = this.eventManager) === null || _this$eventManager === void 0 ? void 0 : _this$eventManager.destroy();\n this.eventManager = null;\n (_this$tooltip = this.tooltip) === null || _this$tooltip === void 0 ? void 0 : _this$tooltip.remove();\n this.tooltip = null;\n\n if (!this.props.canvas && !this.props.gl && this.canvas) {\n var _this$canvas$parentEl;\n\n (_this$canvas$parentEl = this.canvas.parentElement) === null || _this$canvas$parentEl === void 0 ? void 0 : _this$canvas$parentEl.removeChild(this.canvas);\n this.canvas = null;\n }\n }\n\n setProps(props) {\n this.stats.get('setProps Time').timeStart();\n\n if ('onLayerHover' in props) {\n _utils_log__WEBPACK_IMPORTED_MODULE_3__[\"default\"].removed('onLayerHover', 'onHover')();\n }\n\n if ('onLayerClick' in props) {\n _utils_log__WEBPACK_IMPORTED_MODULE_3__[\"default\"].removed('onLayerClick', 'onClick')();\n }\n\n if (props.initialViewState && !(0,_utils_deep_equal__WEBPACK_IMPORTED_MODULE_7__.deepEqual)(this.props.initialViewState, props.initialViewState, 3)) {\n this.viewState = props.initialViewState;\n }\n\n Object.assign(this.props, props);\n\n this._setCanvasSize(this.props);\n\n const resolvedProps = Object.create(this.props);\n Object.assign(resolvedProps, {\n views: this._getViews(),\n width: this.width,\n height: this.height,\n viewState: this._getViewState()\n });\n this.animationLoop.setProps(resolvedProps);\n\n if (this.layerManager) {\n this.viewManager.setProps(resolvedProps);\n this.layerManager.activateViewport(this.getViewports()[0]);\n this.layerManager.setProps(resolvedProps);\n this.effectManager.setProps(resolvedProps);\n this.deckRenderer.setProps(resolvedProps);\n this.deckPicker.setProps(resolvedProps);\n }\n\n this.stats.get('setProps Time').timeEnd();\n }\n\n needsRedraw(opts = {\n clearRedrawFlags: false\n }) {\n if (!this.layerManager) {\n return false;\n }\n\n if (this.props._animate) {\n return 'Deck._animate';\n }\n\n let redraw = this._needsRedraw;\n\n if (opts.clearRedrawFlags) {\n this._needsRedraw = false;\n }\n\n const viewManagerNeedsRedraw = this.viewManager.needsRedraw(opts);\n const layerManagerNeedsRedraw = this.layerManager.needsRedraw(opts);\n const effectManagerNeedsRedraw = this.effectManager.needsRedraw(opts);\n const deckRendererNeedsRedraw = this.deckRenderer.needsRedraw(opts);\n redraw = redraw || viewManagerNeedsRedraw || layerManagerNeedsRedraw || effectManagerNeedsRedraw || deckRendererNeedsRedraw;\n return redraw;\n }\n\n redraw(reason) {\n if (!this.layerManager) {\n return;\n }\n\n let redrawReason = this.needsRedraw({\n clearRedrawFlags: true\n });\n redrawReason = reason || redrawReason;\n\n if (!redrawReason) {\n return;\n }\n\n this.stats.get('Redraw Count').incrementCount();\n\n if (this.props._customRender) {\n this.props._customRender(redrawReason);\n } else {\n this._drawLayers(redrawReason);\n }\n }\n\n get isInitialized() {\n return this.viewManager !== null;\n }\n\n getViews() {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(this.viewManager);\n return this.viewManager.views;\n }\n\n getViewports(rect) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(this.viewManager);\n return this.viewManager.getViewports(rect);\n }\n\n getCanvas() {\n return this.canvas;\n }\n\n pickObject(opts) {\n const infos = this._pick('pickObject', 'pickObject Time', opts).result;\n\n return infos.length ? infos[0] : null;\n }\n\n pickMultipleObjects(opts) {\n opts.depth = opts.depth || 10;\n return this._pick('pickObject', 'pickMultipleObjects Time', opts).result;\n }\n\n pickObjects(opts) {\n return this._pick('pickObjects', 'pickObjects Time', opts);\n }\n\n _addResources(resources, forceUpdate = false) {\n for (const id in resources) {\n this.layerManager.resourceManager.add({\n resourceId: id,\n data: resources[id],\n forceUpdate\n });\n }\n }\n\n _removeResources(resourceIds) {\n for (const id of resourceIds) {\n this.layerManager.resourceManager.remove(id);\n }\n }\n\n _addDefaultEffect(effect) {\n this.effectManager.addDefaultEffect(effect);\n }\n\n _pick(method, statKey, opts) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(this.deckPicker);\n const {\n stats\n } = this;\n stats.get('Pick Count').incrementCount();\n stats.get(statKey).timeStart();\n const infos = this.deckPicker[method]({\n layers: this.layerManager.getLayers(opts),\n views: this.viewManager.getViews(),\n viewports: this.getViewports(opts),\n onViewportActive: this.layerManager.activateViewport,\n effects: this.effectManager.getEffects(),\n ...opts\n });\n stats.get(statKey).timeEnd();\n return infos;\n }\n\n _createCanvas(props) {\n let canvas = props.canvas;\n\n if (typeof canvas === 'string') {\n canvas = document.getElementById(canvas);\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(canvas);\n }\n\n if (!canvas) {\n canvas = document.createElement('canvas');\n canvas.id = props.id || 'deckgl-overlay';\n const parent = props.parent || document.body;\n parent.appendChild(canvas);\n }\n\n Object.assign(canvas.style, props.style);\n return canvas;\n }\n\n _setCanvasSize(props) {\n if (!this.canvas) {\n return;\n }\n\n const {\n width,\n height\n } = props;\n\n if (width || width === 0) {\n const cssWidth = Number.isFinite(width) ? \"\".concat(width, \"px\") : width;\n this.canvas.style.width = cssWidth;\n }\n\n if (height || height === 0) {\n var _props$style;\n\n const cssHeight = Number.isFinite(height) ? \"\".concat(height, \"px\") : height;\n this.canvas.style.position = ((_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.position) || 'absolute';\n this.canvas.style.height = cssHeight;\n }\n }\n\n _updateCanvasSize() {\n var _canvas$clientWidth, _canvas$clientHeight;\n\n const {\n canvas\n } = this;\n\n if (!canvas) {\n return;\n }\n\n const newWidth = (_canvas$clientWidth = canvas.clientWidth) !== null && _canvas$clientWidth !== void 0 ? _canvas$clientWidth : canvas.width;\n const newHeight = (_canvas$clientHeight = canvas.clientHeight) !== null && _canvas$clientHeight !== void 0 ? _canvas$clientHeight : canvas.height;\n\n if (newWidth !== this.width || newHeight !== this.height) {\n var _this$viewManager2, _this$layerManager2;\n\n this.width = newWidth;\n this.height = newHeight;\n (_this$viewManager2 = this.viewManager) === null || _this$viewManager2 === void 0 ? void 0 : _this$viewManager2.setProps({\n width: newWidth,\n height: newHeight\n });\n (_this$layerManager2 = this.layerManager) === null || _this$layerManager2 === void 0 ? void 0 : _this$layerManager2.activateViewport(this.getViewports()[0]);\n this.props.onResize({\n width: newWidth,\n height: newHeight\n });\n }\n }\n\n _createAnimationLoop(props) {\n const {\n width,\n height,\n gl,\n glOptions,\n debug,\n onError,\n onBeforeRender,\n onAfterRender,\n useDevicePixels\n } = props;\n return new _luma_gl_core__WEBPACK_IMPORTED_MODULE_9__[\"default\"]({\n width,\n height,\n useDevicePixels,\n autoResizeDrawingBuffer: !gl,\n autoResizeViewport: false,\n gl,\n onCreateContext: opts => (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_10__.createGLContext)({ ...glOptions,\n ...opts,\n canvas: this.canvas,\n debug,\n onContextLost: () => this._onContextLost()\n }),\n onInitialize: context => this._setGLContext(context.gl),\n onRender: this._onRenderFrame.bind(this),\n onBeforeRender,\n onAfterRender,\n onError\n });\n }\n\n _getViewState() {\n return this.props.viewState || this.viewState;\n }\n\n _getViews() {\n let views = this.props.views || [new _views_map_view__WEBPACK_IMPORTED_MODULE_11__[\"default\"]({\n id: 'default-view'\n })];\n views = Array.isArray(views) ? views : [views];\n\n if (views.length && this.props.controller) {\n views[0].props.controller = this.props.controller;\n }\n\n return views;\n }\n\n _onContextLost() {\n const {\n onError\n } = this.props;\n\n if (this.animationLoop && onError) {\n onError(new Error('WebGL context is lost'));\n }\n }\n\n _pickAndCallback() {\n const {\n _pickRequest\n } = this;\n\n if (_pickRequest.event) {\n const {\n result,\n emptyInfo\n } = this._pick('pickObject', 'pickObject Time', _pickRequest);\n\n this.cursorState.isHovering = result.length > 0;\n let pickedInfo = emptyInfo;\n let handled = false;\n\n for (const info of result) {\n var _info$layer;\n\n pickedInfo = info;\n handled = ((_info$layer = info.layer) === null || _info$layer === void 0 ? void 0 : _info$layer.onHover(info, _pickRequest.event)) || handled;\n }\n\n if (!handled && this.props.onHover) {\n this.props.onHover(pickedInfo, _pickRequest.event);\n }\n\n if (this.props.getTooltip && this.tooltip) {\n const displayInfo = this.props.getTooltip(pickedInfo);\n this.tooltip.setTooltip(displayInfo, pickedInfo.x, pickedInfo.y);\n }\n\n _pickRequest.event = null;\n }\n }\n\n _updateCursor() {\n const container = this.props.parent || this.canvas;\n\n if (container) {\n container.style.cursor = this.props.getCursor(this.cursorState);\n }\n }\n\n _setGLContext(gl) {\n if (this.layerManager) {\n return;\n }\n\n if (!this.canvas) {\n this.canvas = gl.canvas;\n (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_10__.instrumentGLContext)(gl, {\n enable: true,\n copyState: true\n });\n }\n\n this.tooltip = new _tooltip__WEBPACK_IMPORTED_MODULE_12__[\"default\"](this.canvas);\n (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_10__.setParameters)(gl, {\n blend: true,\n blendFunc: [770, 771, 1, 771],\n polygonOffsetFill: true,\n depthTest: true,\n depthFunc: 515\n });\n this.props.onWebGLInitialized(gl);\n const timeline = new _luma_gl_core__WEBPACK_IMPORTED_MODULE_13__.Timeline();\n timeline.play();\n this.animationLoop.attachTimeline(timeline);\n this.eventManager = new mjolnir_js__WEBPACK_IMPORTED_MODULE_2__.EventManager(this.props.parent || gl.canvas, {\n touchAction: this.props.touchAction,\n recognizerOptions: this.props.eventRecognizerOptions,\n events: {\n pointerdown: this._onPointerDown,\n pointermove: this._onPointerMove,\n pointerleave: this._onPointerMove\n }\n });\n\n for (const eventType in _constants__WEBPACK_IMPORTED_MODULE_4__.EVENTS) {\n this.eventManager.on(eventType, this._onEvent);\n }\n\n this.viewManager = new _view_manager__WEBPACK_IMPORTED_MODULE_14__[\"default\"]({\n timeline,\n eventManager: this.eventManager,\n onViewStateChange: this._onViewStateChange.bind(this),\n onInteractionStateChange: this._onInteractionStateChange.bind(this),\n views: this._getViews(),\n viewState: this._getViewState(),\n width: this.width,\n height: this.height\n });\n const viewport = this.viewManager.getViewports()[0];\n this.layerManager = new _layer_manager__WEBPACK_IMPORTED_MODULE_15__[\"default\"](gl, {\n deck: this,\n stats: this.stats,\n viewport,\n timeline\n });\n this.effectManager = new _effect_manager__WEBPACK_IMPORTED_MODULE_16__[\"default\"]();\n this.deckRenderer = new _deck_renderer__WEBPACK_IMPORTED_MODULE_17__[\"default\"](gl);\n this.deckPicker = new _deck_picker__WEBPACK_IMPORTED_MODULE_18__[\"default\"](gl);\n this.setProps(this.props);\n\n this._updateCanvasSize();\n\n this.props.onLoad();\n }\n\n _drawLayers(redrawReason, renderOptions) {\n const {\n gl\n } = this.layerManager.context;\n (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_10__.setParameters)(gl, this.props.parameters);\n this.props.onBeforeRender({\n gl\n });\n this.deckRenderer.renderLayers({\n target: this.props._framebuffer,\n layers: this.layerManager.getLayers(),\n viewports: this.viewManager.getViewports(),\n onViewportActive: this.layerManager.activateViewport,\n views: this.viewManager.getViews(),\n pass: 'screen',\n effects: this.effectManager.getEffects(),\n ...renderOptions\n });\n this.props.onAfterRender({\n gl\n });\n }\n\n _onRenderFrame(animationProps) {\n this._getFrameStats();\n\n if (this._metricsCounter++ % 60 === 0) {\n this._getMetrics();\n\n this.stats.reset();\n _utils_log__WEBPACK_IMPORTED_MODULE_3__[\"default\"].table(4, this.metrics)();\n\n if (this.props._onMetrics) {\n this.props._onMetrics(this.metrics);\n }\n }\n\n this._updateCanvasSize();\n\n this._updateCursor();\n\n if (this.tooltip.isVisible && this.viewManager.needsRedraw()) {\n this.tooltip.setTooltip(null);\n }\n\n this.layerManager.updateLayers();\n\n this._pickAndCallback();\n\n this.redraw();\n\n if (this.viewManager) {\n this.viewManager.updateViewStates();\n }\n }\n\n _onViewStateChange(params) {\n const viewState = this.props.onViewStateChange(params) || params.viewState;\n\n if (this.viewState) {\n this.viewState = { ...this.viewState,\n [params.viewId]: viewState\n };\n\n if (!this.props.viewState) {\n if (this.viewManager) {\n this.viewManager.setProps({\n viewState: this.viewState\n });\n }\n }\n }\n }\n\n _onInteractionStateChange(interactionState) {\n this.cursorState.isDragging = interactionState.isDragging || false;\n this.props.onInteractionStateChange(interactionState);\n }\n\n _getFrameStats() {\n const {\n stats\n } = this;\n stats.get('frameRate').timeEnd();\n stats.get('frameRate').timeStart();\n const animationLoopStats = this.animationLoop.stats;\n stats.get('GPU Time').addTime(animationLoopStats.get('GPU Time').lastTiming);\n stats.get('CPU Time').addTime(animationLoopStats.get('CPU Time').lastTiming);\n }\n\n _getMetrics() {\n const {\n metrics,\n stats\n } = this;\n metrics.fps = stats.get('frameRate').getHz();\n metrics.setPropsTime = stats.get('setProps Time').time;\n metrics.updateAttributesTime = stats.get('Update Attributes').time;\n metrics.framesRedrawn = stats.get('Redraw Count').count;\n metrics.pickTime = stats.get('pickObject Time').time + stats.get('pickMultipleObjects Time').time + stats.get('pickObjects Time').time;\n metrics.pickCount = stats.get('Pick Count').count;\n metrics.gpuTime = stats.get('GPU Time').time;\n metrics.cpuTime = stats.get('CPU Time').time;\n metrics.gpuTimePerFrame = stats.get('GPU Time').getAverageTime();\n metrics.cpuTimePerFrame = stats.get('CPU Time').getAverageTime();\n const memoryStats = _luma_gl_core__WEBPACK_IMPORTED_MODULE_19__.lumaStats.get('Memory Usage');\n metrics.bufferMemory = memoryStats.get('Buffer Memory').count;\n metrics.textureMemory = memoryStats.get('Texture Memory').count;\n metrics.renderbufferMemory = memoryStats.get('Renderbuffer Memory').count;\n metrics.gpuMemory = memoryStats.get('GPU Memory').count;\n }\n\n}\n\n(0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Deck, \"defaultProps\", defaultProps);\n\n(0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Deck, \"VERSION\", _init__WEBPACK_IMPORTED_MODULE_20__.VERSION);\n//# sourceMappingURL=deck.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/deck.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/effect-manager.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/effect-manager.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ EffectManager)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _utils_deep_equal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/deep-equal */ \"./node_modules/@deck.gl/core/dist/esm/utils/deep-equal.js\");\n/* harmony import */ var _effects_lighting_lighting_effect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../effects/lighting/lighting-effect */ \"./node_modules/@deck.gl/core/dist/esm/effects/lighting/lighting-effect.js\");\n\n\n\nconst DEFAULT_LIGHTING_EFFECT = new _effects_lighting_lighting_effect__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n\nfunction compareEffects(e1, e2) {\n var _e1$order, _e2$order;\n\n const o1 = (_e1$order = e1.order) !== null && _e1$order !== void 0 ? _e1$order : Infinity;\n const o2 = (_e2$order = e2.order) !== null && _e2$order !== void 0 ? _e2$order : Infinity;\n return o1 - o2;\n}\n\nclass EffectManager {\n constructor() {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"effects\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_resolvedEffects\", []);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_defaultEffects\", []);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_needsRedraw\", void 0);\n\n this.effects = [];\n this._needsRedraw = 'Initial render';\n\n this._setEffects([]);\n }\n\n addDefaultEffect(effect) {\n const defaultEffects = this._defaultEffects;\n\n if (!defaultEffects.find(e => e.id === effect.id)) {\n const index = defaultEffects.findIndex(e => compareEffects(e, effect) > 0);\n\n if (index < 0) {\n defaultEffects.push(effect);\n } else {\n defaultEffects.splice(index, 0, effect);\n }\n\n this._setEffects(this.effects);\n }\n }\n\n setProps(props) {\n if ('effects' in props) {\n if (!(0,_utils_deep_equal__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(props.effects, this.effects, 1)) {\n this._setEffects(props.effects);\n }\n }\n }\n\n needsRedraw(opts = {\n clearRedrawFlags: false\n }) {\n const redraw = this._needsRedraw;\n\n if (opts.clearRedrawFlags) {\n this._needsRedraw = false;\n }\n\n return redraw;\n }\n\n getEffects() {\n return this._resolvedEffects;\n }\n\n _setEffects(effects) {\n const oldEffectsMap = {};\n\n for (const effect of this.effects) {\n oldEffectsMap[effect.id] = effect;\n }\n\n const nextEffects = [];\n\n for (const effect of effects) {\n const oldEffect = oldEffectsMap[effect.id];\n\n if (oldEffect && oldEffect !== effect) {\n if (oldEffect.setProps) {\n oldEffect.setProps(effect.props);\n nextEffects.push(oldEffect);\n } else {\n oldEffect.cleanup();\n nextEffects.push(effect);\n }\n } else {\n nextEffects.push(effect);\n }\n\n delete oldEffectsMap[effect.id];\n }\n\n for (const removedEffectId in oldEffectsMap) {\n oldEffectsMap[removedEffectId].cleanup();\n }\n\n this.effects = nextEffects;\n this._resolvedEffects = nextEffects.concat(this._defaultEffects);\n\n if (!effects.some(effect => effect instanceof _effects_lighting_lighting_effect__WEBPACK_IMPORTED_MODULE_1__[\"default\"])) {\n this._resolvedEffects.push(DEFAULT_LIGHTING_EFFECT);\n }\n\n this._needsRedraw = 'effects changed';\n }\n\n finalize() {\n for (const effect of this._resolvedEffects) {\n effect.cleanup();\n }\n\n this.effects.length = 0;\n this._resolvedEffects.length = 0;\n this._defaultEffects.length = 0;\n }\n\n}\n//# sourceMappingURL=effect-manager.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/effect-manager.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/init.js": +/*!*********************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/init.js ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ VERSION: () => (/* binding */ VERSION)\n/* harmony export */ });\n/* harmony import */ var _loaders_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @loaders.gl/core */ \"./node_modules/@loaders.gl/core/dist/esm/lib/api/register-loaders.js\");\n/* harmony import */ var _loaders_gl_images__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @loaders.gl/images */ \"./node_modules/@loaders.gl/images/dist/esm/image-loader.js\");\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/log */ \"./node_modules/@deck.gl/core/dist/esm/utils/log.js\");\n/* harmony import */ var _debug__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../debug */ \"./node_modules/@deck.gl/core/dist/esm/debug/index.js\");\n/* harmony import */ var _utils_json_loader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/json-loader */ \"./node_modules/@deck.gl/core/dist/esm/utils/json-loader.js\");\n\n\n\n\n\n\nfunction checkVersion() {\n const version = true ? \"8.9.35\" : 0;\n const existingVersion = globalThis.deck && globalThis.deck.VERSION;\n\n if (existingVersion && existingVersion !== version) {\n throw new Error(\"deck.gl - multiple versions detected: \".concat(existingVersion, \" vs \").concat(version));\n }\n\n if (!existingVersion) {\n _utils_log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].log(1, \"deck.gl \".concat(version))();\n globalThis.deck = { ...globalThis.deck,\n VERSION: version,\n version,\n log: _utils_log__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n _registerLoggers: _debug__WEBPACK_IMPORTED_MODULE_1__.register\n };\n (0,_loaders_gl_core__WEBPACK_IMPORTED_MODULE_2__.registerLoaders)([_utils_json_loader__WEBPACK_IMPORTED_MODULE_3__[\"default\"], [_loaders_gl_images__WEBPACK_IMPORTED_MODULE_4__.ImageLoader, {\n imagebitmap: {\n premultiplyAlpha: 'none'\n }\n }]]);\n }\n\n return version;\n}\n\nconst VERSION = checkVersion();\n//# sourceMappingURL=init.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/init.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/layer-manager.js": +/*!******************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/layer-manager.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ LayerManager)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/engine/dist/esm/animation/timeline.js\");\n/* harmony import */ var _lifecycle_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../lifecycle/constants */ \"./node_modules/@deck.gl/core/dist/esm/lifecycle/constants.js\");\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/log */ \"./node_modules/@deck.gl/core/dist/esm/utils/log.js\");\n/* harmony import */ var _debug__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../debug */ \"./node_modules/@deck.gl/core/dist/esm/debug/index.js\");\n/* harmony import */ var _utils_flatten__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/flatten */ \"./node_modules/@deck.gl/core/dist/esm/utils/flatten.js\");\n/* harmony import */ var _probe_gl_stats__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @probe.gl/stats */ \"./node_modules/@probe.gl/stats/dist/esm/index.js\");\n/* harmony import */ var _resource_resource_manager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./resource/resource-manager */ \"./node_modules/@deck.gl/core/dist/esm/lib/resource/resource-manager.js\");\n/* harmony import */ var _viewports_viewport__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../viewports/viewport */ \"./node_modules/@deck.gl/core/dist/esm/viewports/viewport.js\");\n/* harmony import */ var _shaderlib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../shaderlib */ \"./node_modules/@deck.gl/core/dist/esm/shaderlib/index.js\");\n\n\n\n\n\n\n\n\n\n\nconst TRACE_SET_LAYERS = 'layerManager.setLayers';\nconst TRACE_ACTIVATE_VIEWPORT = 'layerManager.activateViewport';\nclass LayerManager {\n constructor(gl, {\n deck,\n stats,\n viewport: _viewport,\n timeline\n } = {}) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"layers\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"context\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"resourceManager\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_lastRenderedLayers\", []);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_needsRedraw\", false);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_needsUpdate\", false);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_nextLayers\", null);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_debug\", false);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"activateViewport\", viewport => {\n (0,_debug__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(TRACE_ACTIVATE_VIEWPORT, this, viewport);\n\n if (viewport) {\n this.context.viewport = viewport;\n }\n });\n\n this.layers = [];\n this.resourceManager = new _resource_resource_manager__WEBPACK_IMPORTED_MODULE_3__[\"default\"]({\n gl,\n protocol: 'deck://'\n });\n this.context = {\n mousePosition: null,\n userData: {},\n layerManager: this,\n gl,\n deck,\n programManager: gl && (0,_shaderlib__WEBPACK_IMPORTED_MODULE_4__.createProgramManager)(gl),\n stats: stats || new _probe_gl_stats__WEBPACK_IMPORTED_MODULE_1__.Stats({\n id: 'deck.gl'\n }),\n viewport: _viewport || new _viewports_viewport__WEBPACK_IMPORTED_MODULE_5__[\"default\"]({\n id: 'DEFAULT-INITIAL-VIEWPORT'\n }),\n timeline: timeline || new _luma_gl_core__WEBPACK_IMPORTED_MODULE_6__.Timeline(),\n resourceManager: this.resourceManager,\n onError: undefined\n };\n Object.seal(this);\n }\n\n finalize() {\n this.resourceManager.finalize();\n\n for (const layer of this.layers) {\n this._finalizeLayer(layer);\n }\n }\n\n needsRedraw(opts = {\n clearRedrawFlags: false\n }) {\n let redraw = this._needsRedraw;\n\n if (opts.clearRedrawFlags) {\n this._needsRedraw = false;\n }\n\n for (const layer of this.layers) {\n const layerNeedsRedraw = layer.getNeedsRedraw(opts);\n redraw = redraw || layerNeedsRedraw;\n }\n\n return redraw;\n }\n\n needsUpdate() {\n if (this._nextLayers && this._nextLayers !== this._lastRenderedLayers) {\n return 'layers changed';\n }\n\n return this._needsUpdate;\n }\n\n setNeedsRedraw(reason) {\n this._needsRedraw = this._needsRedraw || reason;\n }\n\n setNeedsUpdate(reason) {\n this._needsUpdate = this._needsUpdate || reason;\n }\n\n getLayers({\n layerIds\n } = {}) {\n return layerIds ? this.layers.filter(layer => layerIds.find(layerId => layer.id.indexOf(layerId) === 0)) : this.layers;\n }\n\n setProps(props) {\n if ('debug' in props) {\n this._debug = props.debug;\n }\n\n if ('userData' in props) {\n this.context.userData = props.userData;\n }\n\n if ('layers' in props) {\n this._nextLayers = props.layers;\n }\n\n if ('onError' in props) {\n this.context.onError = props.onError;\n }\n }\n\n setLayers(newLayers, reason) {\n (0,_debug__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(TRACE_SET_LAYERS, this, reason, newLayers);\n this._lastRenderedLayers = newLayers;\n const flatLayers = (0,_utils_flatten__WEBPACK_IMPORTED_MODULE_7__.flatten)(newLayers, Boolean);\n\n for (const layer of flatLayers) {\n layer.context = this.context;\n }\n\n this._updateLayers(this.layers, flatLayers);\n }\n\n updateLayers() {\n const reason = this.needsUpdate();\n\n if (reason) {\n this.setNeedsRedraw(\"updating layers: \".concat(reason));\n this.setLayers(this._nextLayers || this._lastRenderedLayers, reason);\n }\n\n this._nextLayers = null;\n }\n\n _handleError(stage, error, layer) {\n layer.raiseError(error, \"\".concat(stage, \" of \").concat(layer));\n }\n\n _updateLayers(oldLayers, newLayers) {\n const oldLayerMap = {};\n\n for (const oldLayer of oldLayers) {\n if (oldLayerMap[oldLayer.id]) {\n _utils_log__WEBPACK_IMPORTED_MODULE_8__[\"default\"].warn(\"Multiple old layers with same id \".concat(oldLayer.id))();\n } else {\n oldLayerMap[oldLayer.id] = oldLayer;\n }\n }\n\n const generatedLayers = [];\n\n this._updateSublayersRecursively(newLayers, oldLayerMap, generatedLayers);\n\n this._finalizeOldLayers(oldLayerMap);\n\n let needsUpdate = false;\n\n for (const layer of generatedLayers) {\n if (layer.hasUniformTransition()) {\n needsUpdate = \"Uniform transition in \".concat(layer);\n break;\n }\n }\n\n this._needsUpdate = needsUpdate;\n this.layers = generatedLayers;\n }\n\n _updateSublayersRecursively(newLayers, oldLayerMap, generatedLayers) {\n for (const newLayer of newLayers) {\n newLayer.context = this.context;\n const oldLayer = oldLayerMap[newLayer.id];\n\n if (oldLayer === null) {\n _utils_log__WEBPACK_IMPORTED_MODULE_8__[\"default\"].warn(\"Multiple new layers with same id \".concat(newLayer.id))();\n }\n\n oldLayerMap[newLayer.id] = null;\n let sublayers = null;\n\n try {\n if (this._debug && oldLayer !== newLayer) {\n newLayer.validateProps();\n }\n\n if (!oldLayer) {\n this._initializeLayer(newLayer);\n } else {\n this._transferLayerState(oldLayer, newLayer);\n\n this._updateLayer(newLayer);\n }\n\n generatedLayers.push(newLayer);\n sublayers = newLayer.isComposite ? newLayer.getSubLayers() : null;\n } catch (err) {\n this._handleError('matching', err, newLayer);\n }\n\n if (sublayers) {\n this._updateSublayersRecursively(sublayers, oldLayerMap, generatedLayers);\n }\n }\n }\n\n _finalizeOldLayers(oldLayerMap) {\n for (const layerId in oldLayerMap) {\n const layer = oldLayerMap[layerId];\n\n if (layer) {\n this._finalizeLayer(layer);\n }\n }\n }\n\n _initializeLayer(layer) {\n try {\n layer._initialize();\n\n layer.lifecycle = _lifecycle_constants__WEBPACK_IMPORTED_MODULE_9__.LIFECYCLE.INITIALIZED;\n } catch (err) {\n this._handleError('initialization', err, layer);\n }\n }\n\n _transferLayerState(oldLayer, newLayer) {\n newLayer._transferState(oldLayer);\n\n newLayer.lifecycle = _lifecycle_constants__WEBPACK_IMPORTED_MODULE_9__.LIFECYCLE.MATCHED;\n\n if (newLayer !== oldLayer) {\n oldLayer.lifecycle = _lifecycle_constants__WEBPACK_IMPORTED_MODULE_9__.LIFECYCLE.AWAITING_GC;\n }\n }\n\n _updateLayer(layer) {\n try {\n layer._update();\n } catch (err) {\n this._handleError('update', err, layer);\n }\n }\n\n _finalizeLayer(layer) {\n this._needsRedraw = this._needsRedraw || \"finalized \".concat(layer);\n layer.lifecycle = _lifecycle_constants__WEBPACK_IMPORTED_MODULE_9__.LIFECYCLE.AWAITING_FINALIZATION;\n\n try {\n layer._finalize();\n\n layer.lifecycle = _lifecycle_constants__WEBPACK_IMPORTED_MODULE_9__.LIFECYCLE.FINALIZED;\n } catch (err) {\n this._handleError('finalization', err, layer);\n }\n }\n\n}\n//# sourceMappingURL=layer-manager.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/layer-manager.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/layer-state.js": +/*!****************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/layer-state.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ LayerState)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _lifecycle_component_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lifecycle/component-state */ \"./node_modules/@deck.gl/core/dist/esm/lifecycle/component-state.js\");\n\n\nclass LayerState extends _lifecycle_component_state__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor({\n attributeManager,\n layer\n }) {\n super(layer);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"attributeManager\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"needsRedraw\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"needsUpdate\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"subLayers\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"usesPickingColorCache\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"hasPickingBuffer\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"changeFlags\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"viewport\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"uniformTransitions\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"propsInTransition\", void 0);\n\n this.attributeManager = attributeManager;\n this.needsRedraw = true;\n this.needsUpdate = true;\n this.subLayers = null;\n this.usesPickingColorCache = false;\n }\n\n get layer() {\n return this.component;\n }\n\n _fetch(propName, url) {\n const layer = this.layer;\n const fetch = layer === null || layer === void 0 ? void 0 : layer.props.fetch;\n\n if (fetch) {\n return fetch(url, {\n propName,\n layer\n });\n }\n\n return super._fetch(propName, url);\n }\n\n _onResolve(propName, value) {\n const layer = this.layer;\n\n if (layer) {\n const onDataLoad = layer.props.onDataLoad;\n\n if (propName === 'data' && onDataLoad) {\n onDataLoad(value, {\n propName,\n layer\n });\n }\n }\n }\n\n _onError(propName, error) {\n const layer = this.layer;\n\n if (layer) {\n layer.raiseError(error, \"loading \".concat(propName, \" of \").concat(this.layer));\n }\n }\n\n}\n//# sourceMappingURL=layer-state.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/layer-state.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/layer.js": +/*!**********************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/layer.js ***! + \**********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Layer)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants */ \"./node_modules/@deck.gl/core/dist/esm/lib/constants.js\");\n/* harmony import */ var _attribute_attribute_manager__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./attribute/attribute-manager */ \"./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute-manager.js\");\n/* harmony import */ var _uniform_transition_manager__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./uniform-transition-manager */ \"./node_modules/@deck.gl/core/dist/esm/lib/uniform-transition-manager.js\");\n/* harmony import */ var _lifecycle_props__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../lifecycle/props */ \"./node_modules/@deck.gl/core/dist/esm/lifecycle/props.js\");\n/* harmony import */ var _lifecycle_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lifecycle/constants */ \"./node_modules/@deck.gl/core/dist/esm/lifecycle/constants.js\");\n/* harmony import */ var _utils_count__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/count */ \"./node_modules/@deck.gl/core/dist/esm/utils/count.js\");\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils/log */ \"./node_modules/@deck.gl/core/dist/esm/utils/log.js\");\n/* harmony import */ var _debug__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../debug */ \"./node_modules/@deck.gl/core/dist/esm/debug/index.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@deck.gl/core/dist/esm/utils/assert.js\");\n/* harmony import */ var _utils_memoize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/memoize */ \"./node_modules/@deck.gl/core/dist/esm/utils/memoize.js\");\n/* harmony import */ var _utils_shader__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/shader */ \"./node_modules/@deck.gl/core/dist/esm/utils/shader.js\");\n/* harmony import */ var _shaderlib_project_project_functions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../shaderlib/project/project-functions */ \"./node_modules/@deck.gl/core/dist/esm/shaderlib/project/project-functions.js\");\n/* harmony import */ var _utils_typed_array_manager__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utils/typed-array-manager */ \"./node_modules/@deck.gl/core/dist/esm/utils/typed-array-manager.js\");\n/* harmony import */ var _lifecycle_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lifecycle/component */ \"./node_modules/@deck.gl/core/dist/esm/lifecycle/component.js\");\n/* harmony import */ var _layer_state__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./layer-state */ \"./node_modules/@deck.gl/core/dist/esm/lib/layer-state.js\");\n/* harmony import */ var _math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @math.gl/web-mercator */ \"./node_modules/@math.gl/web-mercator/dist/esm/index.js\");\n/* harmony import */ var _loaders_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @loaders.gl/core */ \"./node_modules/@loaders.gl/core/dist/esm/lib/api/load.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst TRACE_CHANGE_FLAG = 'layer.changeFlag';\nconst TRACE_INITIALIZE = 'layer.initialize';\nconst TRACE_UPDATE = 'layer.update';\nconst TRACE_FINALIZE = 'layer.finalize';\nconst TRACE_MATCHED = 'layer.matched';\nconst MAX_PICKING_COLOR_CACHE_SIZE = 2 ** 24 - 1;\nconst EMPTY_ARRAY = Object.freeze([]);\nconst areViewportsEqual = (0,_utils_memoize__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(({\n oldViewport,\n viewport\n}) => {\n return oldViewport.equals(viewport);\n});\nlet pickingColorCache = new Uint8ClampedArray(0);\nconst defaultProps = {\n data: {\n type: 'data',\n value: EMPTY_ARRAY,\n async: true\n },\n dataComparator: {\n type: 'function',\n value: null,\n optional: true\n },\n _dataDiff: {\n type: 'function',\n value: data => data && data.__diff,\n optional: true\n },\n dataTransform: {\n type: 'function',\n value: null,\n optional: true\n },\n onDataLoad: {\n type: 'function',\n value: null,\n optional: true\n },\n onError: {\n type: 'function',\n value: null,\n optional: true\n },\n fetch: {\n type: 'function',\n value: (url, {\n propName,\n layer,\n loaders,\n loadOptions,\n signal\n }) => {\n const {\n resourceManager\n } = layer.context;\n loadOptions = loadOptions || layer.getLoadOptions();\n loaders = loaders || layer.props.loaders;\n\n if (signal) {\n var _loadOptions;\n\n loadOptions = { ...loadOptions,\n fetch: { ...((_loadOptions = loadOptions) === null || _loadOptions === void 0 ? void 0 : _loadOptions.fetch),\n signal\n }\n };\n }\n\n let inResourceManager = resourceManager.contains(url);\n\n if (!inResourceManager && !loadOptions) {\n resourceManager.add({\n resourceId: url,\n data: (0,_loaders_gl_core__WEBPACK_IMPORTED_MODULE_3__.load)(url, loaders),\n persistent: false\n });\n inResourceManager = true;\n }\n\n if (inResourceManager) {\n return resourceManager.subscribe({\n resourceId: url,\n onChange: data => {\n var _layer$internalState;\n\n return (_layer$internalState = layer.internalState) === null || _layer$internalState === void 0 ? void 0 : _layer$internalState.reloadAsyncProp(propName, data);\n },\n consumerId: layer.id,\n requestId: propName\n });\n }\n\n return (0,_loaders_gl_core__WEBPACK_IMPORTED_MODULE_3__.load)(url, loaders, loadOptions);\n }\n },\n updateTriggers: {},\n visible: true,\n pickable: false,\n opacity: {\n type: 'number',\n min: 0,\n max: 1,\n value: 1\n },\n operation: 'draw',\n onHover: {\n type: 'function',\n value: null,\n optional: true\n },\n onClick: {\n type: 'function',\n value: null,\n optional: true\n },\n onDragStart: {\n type: 'function',\n value: null,\n optional: true\n },\n onDrag: {\n type: 'function',\n value: null,\n optional: true\n },\n onDragEnd: {\n type: 'function',\n value: null,\n optional: true\n },\n coordinateSystem: _constants__WEBPACK_IMPORTED_MODULE_4__.COORDINATE_SYSTEM.DEFAULT,\n coordinateOrigin: {\n type: 'array',\n value: [0, 0, 0],\n compare: true\n },\n modelMatrix: {\n type: 'array',\n value: null,\n compare: true,\n optional: true\n },\n wrapLongitude: false,\n positionFormat: 'XYZ',\n colorFormat: 'RGBA',\n parameters: {\n type: 'object',\n value: {},\n optional: true,\n compare: 2\n },\n loadOptions: {\n type: 'object',\n value: null,\n optional: true,\n ignore: true\n },\n transitions: null,\n extensions: [],\n loaders: {\n type: 'array',\n value: [],\n optional: true,\n ignore: true\n },\n getPolygonOffset: {\n type: 'function',\n value: ({\n layerIndex\n }) => [0, -layerIndex * 100]\n },\n highlightedObjectIndex: null,\n autoHighlight: false,\n highlightColor: {\n type: 'accessor',\n value: [0, 0, 128, 128]\n }\n};\nclass Layer extends _lifecycle_component__WEBPACK_IMPORTED_MODULE_5__[\"default\"] {\n constructor(...args) {\n super(...args);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"internalState\", null);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"lifecycle\", _lifecycle_constants__WEBPACK_IMPORTED_MODULE_6__.LIFECYCLE.NO_STATE);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"context\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"state\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"parent\", null);\n }\n\n static get componentName() {\n return Object.prototype.hasOwnProperty.call(this, 'layerName') ? this.layerName : '';\n }\n\n get root() {\n let layer = this;\n\n while (layer.parent) {\n layer = layer.parent;\n }\n\n return layer;\n }\n\n toString() {\n const className = this.constructor.layerName || this.constructor.name;\n return \"\".concat(className, \"({id: '\").concat(this.props.id, \"'})\");\n }\n\n project(xyz) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(this.internalState);\n const viewport = this.internalState.viewport || this.context.viewport;\n const worldPosition = (0,_shaderlib_project_project_functions__WEBPACK_IMPORTED_MODULE_8__.getWorldPosition)(xyz, {\n viewport,\n modelMatrix: this.props.modelMatrix,\n coordinateOrigin: this.props.coordinateOrigin,\n coordinateSystem: this.props.coordinateSystem\n });\n const [x, y, z] = (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.worldToPixels)(worldPosition, viewport.pixelProjectionMatrix);\n return xyz.length === 2 ? [x, y] : [x, y, z];\n }\n\n unproject(xy) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(this.internalState);\n const viewport = this.internalState.viewport || this.context.viewport;\n return viewport.unproject(xy);\n }\n\n projectPosition(xyz, params) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(this.internalState);\n const viewport = this.internalState.viewport || this.context.viewport;\n return (0,_shaderlib_project_project_functions__WEBPACK_IMPORTED_MODULE_8__.projectPosition)(xyz, {\n viewport,\n modelMatrix: this.props.modelMatrix,\n coordinateOrigin: this.props.coordinateOrigin,\n coordinateSystem: this.props.coordinateSystem,\n ...params\n });\n }\n\n get isComposite() {\n return false;\n }\n\n setState(partialState) {\n this.setChangeFlags({\n stateChanged: true\n });\n Object.assign(this.state, partialState);\n this.setNeedsRedraw();\n }\n\n setNeedsRedraw() {\n if (this.internalState) {\n this.internalState.needsRedraw = true;\n }\n }\n\n setNeedsUpdate() {\n if (this.internalState) {\n this.context.layerManager.setNeedsUpdate(String(this));\n this.internalState.needsUpdate = true;\n }\n }\n\n get isLoaded() {\n return this.internalState ? !this.internalState.isAsyncPropLoading() : false;\n }\n\n get wrapLongitude() {\n return this.props.wrapLongitude;\n }\n\n isPickable() {\n return this.props.pickable && this.props.visible;\n }\n\n getModels() {\n return this.state && (this.state.models || this.state.model && [this.state.model]) || [];\n }\n\n setModuleParameters(moduleParameters) {\n for (const model of this.getModels()) {\n model.updateModuleSettings(moduleParameters);\n }\n }\n\n getAttributeManager() {\n return this.internalState && this.internalState.attributeManager;\n }\n\n getCurrentLayer() {\n return this.internalState && this.internalState.layer;\n }\n\n getLoadOptions() {\n return this.props.loadOptions;\n }\n\n use64bitPositions() {\n const {\n coordinateSystem\n } = this.props;\n return coordinateSystem === _constants__WEBPACK_IMPORTED_MODULE_4__.COORDINATE_SYSTEM.DEFAULT || coordinateSystem === _constants__WEBPACK_IMPORTED_MODULE_4__.COORDINATE_SYSTEM.LNGLAT || coordinateSystem === _constants__WEBPACK_IMPORTED_MODULE_4__.COORDINATE_SYSTEM.CARTESIAN;\n }\n\n onHover(info, pickingEvent) {\n if (this.props.onHover) {\n return this.props.onHover(info, pickingEvent) || false;\n }\n\n return false;\n }\n\n onClick(info, pickingEvent) {\n if (this.props.onClick) {\n return this.props.onClick(info, pickingEvent) || false;\n }\n\n return false;\n }\n\n nullPickingColor() {\n return [0, 0, 0];\n }\n\n encodePickingColor(i, target = []) {\n target[0] = i + 1 & 255;\n target[1] = i + 1 >> 8 & 255;\n target[2] = i + 1 >> 8 >> 8 & 255;\n return target;\n }\n\n decodePickingColor(color) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(color instanceof Uint8Array);\n const [i1, i2, i3] = color;\n const index = i1 + i2 * 256 + i3 * 65536 - 1;\n return index;\n }\n\n getNumInstances() {\n if (Number.isFinite(this.props.numInstances)) {\n return this.props.numInstances;\n }\n\n if (this.state && this.state.numInstances !== undefined) {\n return this.state.numInstances;\n }\n\n return (0,_utils_count__WEBPACK_IMPORTED_MODULE_9__.count)(this.props.data);\n }\n\n getStartIndices() {\n if (this.props.startIndices) {\n return this.props.startIndices;\n }\n\n if (this.state && this.state.startIndices) {\n return this.state.startIndices;\n }\n\n return null;\n }\n\n getBounds() {\n var _this$getAttributeMan;\n\n return (_this$getAttributeMan = this.getAttributeManager()) === null || _this$getAttributeMan === void 0 ? void 0 : _this$getAttributeMan.getBounds(['positions', 'instancePositions']);\n }\n\n getShaders(shaders) {\n for (const extension of this.props.extensions) {\n shaders = (0,_utils_shader__WEBPACK_IMPORTED_MODULE_10__.mergeShaders)(shaders, extension.getShaders.call(this, extension));\n }\n\n return shaders;\n }\n\n shouldUpdateState(params) {\n return params.changeFlags.propsOrDataChanged;\n }\n\n updateState(params) {\n const attributeManager = this.getAttributeManager();\n const {\n dataChanged\n } = params.changeFlags;\n\n if (dataChanged && attributeManager) {\n if (Array.isArray(dataChanged)) {\n for (const dataRange of dataChanged) {\n attributeManager.invalidateAll(dataRange);\n }\n } else {\n attributeManager.invalidateAll();\n }\n }\n\n if (attributeManager) {\n const {\n props\n } = params;\n const hasPickingBuffer = this.internalState.hasPickingBuffer;\n const needsPickingBuffer = Number.isInteger(props.highlightedObjectIndex) || props.pickable || props.extensions.some(extension => extension.getNeedsPickingBuffer.call(this, extension));\n\n if (hasPickingBuffer !== needsPickingBuffer) {\n this.internalState.hasPickingBuffer = needsPickingBuffer;\n const {\n pickingColors,\n instancePickingColors\n } = attributeManager.attributes;\n const pickingColorsAttribute = pickingColors || instancePickingColors;\n\n if (pickingColorsAttribute) {\n if (needsPickingBuffer && pickingColorsAttribute.constant) {\n pickingColorsAttribute.constant = false;\n attributeManager.invalidate(pickingColorsAttribute.id);\n }\n\n if (!pickingColorsAttribute.value && !needsPickingBuffer) {\n pickingColorsAttribute.constant = true;\n pickingColorsAttribute.value = [0, 0, 0];\n }\n }\n }\n }\n }\n\n finalizeState(context) {\n for (const model of this.getModels()) {\n model.delete();\n }\n\n const attributeManager = this.getAttributeManager();\n\n if (attributeManager) {\n attributeManager.finalize();\n }\n\n if (this.context) {\n this.context.resourceManager.unsubscribe({\n consumerId: this.id\n });\n }\n\n if (this.internalState) {\n this.internalState.uniformTransitions.clear();\n this.internalState.finalize();\n }\n }\n\n draw(opts) {\n for (const model of this.getModels()) {\n model.draw(opts);\n }\n }\n\n getPickingInfo({\n info,\n mode,\n sourceLayer\n }) {\n const {\n index\n } = info;\n\n if (index >= 0) {\n if (Array.isArray(this.props.data)) {\n info.object = this.props.data[index];\n }\n }\n\n return info;\n }\n\n raiseError(error, message) {\n var _this$props$onError, _this$props;\n\n if (message) {\n error = new Error(\"\".concat(message, \": \").concat(error.message), {\n cause: error\n });\n }\n\n if (!((_this$props$onError = (_this$props = this.props).onError) !== null && _this$props$onError !== void 0 && _this$props$onError.call(_this$props, error))) {\n var _this$context, _this$context$onError;\n\n (_this$context = this.context) === null || _this$context === void 0 ? void 0 : (_this$context$onError = _this$context.onError) === null || _this$context$onError === void 0 ? void 0 : _this$context$onError.call(_this$context, error, this);\n }\n }\n\n getNeedsRedraw(opts = {\n clearRedrawFlags: false\n }) {\n return this._getNeedsRedraw(opts);\n }\n\n needsUpdate() {\n if (!this.internalState) {\n return false;\n }\n\n return this.internalState.needsUpdate || this.hasUniformTransition() || this.shouldUpdateState(this._getUpdateParams());\n }\n\n hasUniformTransition() {\n var _this$internalState;\n\n return ((_this$internalState = this.internalState) === null || _this$internalState === void 0 ? void 0 : _this$internalState.uniformTransitions.active) || false;\n }\n\n activateViewport(viewport) {\n if (!this.internalState) {\n return;\n }\n\n const oldViewport = this.internalState.viewport;\n this.internalState.viewport = viewport;\n\n if (!oldViewport || !areViewportsEqual({\n oldViewport,\n viewport\n })) {\n this.setChangeFlags({\n viewportChanged: true\n });\n\n if (this.isComposite) {\n if (this.needsUpdate()) {\n this.setNeedsUpdate();\n }\n } else {\n this._update();\n }\n }\n }\n\n invalidateAttribute(name = 'all') {\n const attributeManager = this.getAttributeManager();\n\n if (!attributeManager) {\n return;\n }\n\n if (name === 'all') {\n attributeManager.invalidateAll();\n } else {\n attributeManager.invalidate(name);\n }\n }\n\n updateAttributes(changedAttributes) {\n for (const model of this.getModels()) {\n this._setModelAttributes(model, changedAttributes);\n }\n }\n\n _updateAttributes() {\n const attributeManager = this.getAttributeManager();\n\n if (!attributeManager) {\n return;\n }\n\n const props = this.props;\n const numInstances = this.getNumInstances();\n const startIndices = this.getStartIndices();\n attributeManager.update({\n data: props.data,\n numInstances,\n startIndices,\n props,\n transitions: props.transitions,\n buffers: props.data.attributes,\n context: this\n });\n const changedAttributes = attributeManager.getChangedAttributes({\n clearChangedFlags: true\n });\n this.updateAttributes(changedAttributes);\n }\n\n _updateAttributeTransition() {\n const attributeManager = this.getAttributeManager();\n\n if (attributeManager) {\n attributeManager.updateTransition();\n }\n }\n\n _updateUniformTransition() {\n const {\n uniformTransitions\n } = this.internalState;\n\n if (uniformTransitions.active) {\n const propsInTransition = uniformTransitions.update();\n const props = Object.create(this.props);\n\n for (const key in propsInTransition) {\n Object.defineProperty(props, key, {\n value: propsInTransition[key]\n });\n }\n\n return props;\n }\n\n return this.props;\n }\n\n calculateInstancePickingColors(attribute, {\n numInstances\n }) {\n if (attribute.constant) {\n return;\n }\n\n const cacheSize = Math.floor(pickingColorCache.length / 3);\n this.internalState.usesPickingColorCache = true;\n\n if (cacheSize < numInstances) {\n if (numInstances > MAX_PICKING_COLOR_CACHE_SIZE) {\n _utils_log__WEBPACK_IMPORTED_MODULE_11__[\"default\"].warn('Layer has too many data objects. Picking might not be able to distinguish all objects.')();\n }\n\n pickingColorCache = _utils_typed_array_manager__WEBPACK_IMPORTED_MODULE_12__[\"default\"].allocate(pickingColorCache, numInstances, {\n size: 3,\n copy: true,\n maxCount: Math.max(numInstances, MAX_PICKING_COLOR_CACHE_SIZE)\n });\n const newCacheSize = Math.floor(pickingColorCache.length / 3);\n const pickingColor = [];\n\n for (let i = cacheSize; i < newCacheSize; i++) {\n this.encodePickingColor(i, pickingColor);\n pickingColorCache[i * 3 + 0] = pickingColor[0];\n pickingColorCache[i * 3 + 1] = pickingColor[1];\n pickingColorCache[i * 3 + 2] = pickingColor[2];\n }\n }\n\n attribute.value = pickingColorCache.subarray(0, numInstances * 3);\n }\n\n _setModelAttributes(model, changedAttributes) {\n const attributeManager = this.getAttributeManager();\n const excludeAttributes = model.userData.excludeAttributes || {};\n const shaderAttributes = attributeManager.getShaderAttributes(changedAttributes, excludeAttributes);\n model.setAttributes(shaderAttributes);\n }\n\n disablePickingIndex(objectIndex) {\n const data = this.props.data;\n\n if (!('attributes' in data)) {\n this._disablePickingIndex(objectIndex);\n\n return;\n }\n\n const {\n pickingColors,\n instancePickingColors\n } = this.getAttributeManager().attributes;\n const colors = pickingColors || instancePickingColors;\n const externalColorAttribute = colors && data.attributes && data.attributes[colors.id];\n\n if (externalColorAttribute && externalColorAttribute.value) {\n const values = externalColorAttribute.value;\n const objectColor = this.encodePickingColor(objectIndex);\n\n for (let index = 0; index < data.length; index++) {\n const i = colors.getVertexOffset(index);\n\n if (values[i] === objectColor[0] && values[i + 1] === objectColor[1] && values[i + 2] === objectColor[2]) {\n this._disablePickingIndex(index);\n }\n }\n } else {\n this._disablePickingIndex(objectIndex);\n }\n }\n\n _disablePickingIndex(objectIndex) {\n const {\n pickingColors,\n instancePickingColors\n } = this.getAttributeManager().attributes;\n const colors = pickingColors || instancePickingColors;\n\n if (!colors) {\n return;\n }\n\n const start = colors.getVertexOffset(objectIndex);\n const end = colors.getVertexOffset(objectIndex + 1);\n colors.buffer.subData({\n data: new Uint8Array(end - start),\n offset: start\n });\n }\n\n restorePickingColors() {\n const {\n pickingColors,\n instancePickingColors\n } = this.getAttributeManager().attributes;\n const colors = pickingColors || instancePickingColors;\n\n if (!colors) {\n return;\n }\n\n if (this.internalState.usesPickingColorCache && colors.value.buffer !== pickingColorCache.buffer) {\n colors.value = pickingColorCache.subarray(0, colors.value.length);\n }\n\n colors.updateSubBuffer({\n startOffset: 0\n });\n }\n\n _initialize() {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(!this.internalState);\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(Number.isFinite(this.props.coordinateSystem));\n (0,_debug__WEBPACK_IMPORTED_MODULE_13__[\"default\"])(TRACE_INITIALIZE, this);\n\n const attributeManager = this._getAttributeManager();\n\n if (attributeManager) {\n attributeManager.addInstanced({\n instancePickingColors: {\n type: 5121,\n size: 3,\n noAlloc: true,\n update: this.calculateInstancePickingColors\n }\n });\n }\n\n this.internalState = new _layer_state__WEBPACK_IMPORTED_MODULE_14__[\"default\"]({\n attributeManager,\n layer: this\n });\n\n this._clearChangeFlags();\n\n this.state = {};\n Object.defineProperty(this.state, 'attributeManager', {\n get: () => {\n _utils_log__WEBPACK_IMPORTED_MODULE_11__[\"default\"].deprecated('layer.state.attributeManager', 'layer.getAttributeManager()')();\n return attributeManager;\n }\n });\n this.internalState.uniformTransitions = new _uniform_transition_manager__WEBPACK_IMPORTED_MODULE_15__[\"default\"](this.context.timeline);\n this.internalState.onAsyncPropUpdated = this._onAsyncPropUpdated.bind(this);\n this.internalState.setAsyncProps(this.props);\n this.initializeState(this.context);\n\n for (const extension of this.props.extensions) {\n extension.initializeState.call(this, this.context, extension);\n }\n\n this.setChangeFlags({\n dataChanged: 'init',\n propsChanged: 'init',\n viewportChanged: true,\n extensionsChanged: true\n });\n\n this._update();\n }\n\n _transferState(oldLayer) {\n (0,_debug__WEBPACK_IMPORTED_MODULE_13__[\"default\"])(TRACE_MATCHED, this, this === oldLayer);\n const {\n state,\n internalState\n } = oldLayer;\n\n if (this === oldLayer) {\n return;\n }\n\n this.internalState = internalState;\n this.state = state;\n this.internalState.setAsyncProps(this.props);\n\n this._diffProps(this.props, this.internalState.getOldProps());\n }\n\n _update() {\n const stateNeedsUpdate = this.needsUpdate();\n (0,_debug__WEBPACK_IMPORTED_MODULE_13__[\"default\"])(TRACE_UPDATE, this, stateNeedsUpdate);\n\n if (!stateNeedsUpdate) {\n return;\n }\n\n const currentProps = this.props;\n const context = this.context;\n const internalState = this.internalState;\n const currentViewport = context.viewport;\n\n const propsInTransition = this._updateUniformTransition();\n\n internalState.propsInTransition = propsInTransition;\n context.viewport = internalState.viewport || currentViewport;\n this.props = propsInTransition;\n\n try {\n const updateParams = this._getUpdateParams();\n\n const oldModels = this.getModels();\n\n if (context.gl) {\n this.updateState(updateParams);\n } else {\n try {\n this.updateState(updateParams);\n } catch (error) {}\n }\n\n for (const extension of this.props.extensions) {\n extension.updateState.call(this, updateParams, extension);\n }\n\n const modelChanged = this.getModels()[0] !== oldModels[0];\n\n this._postUpdate(updateParams, modelChanged);\n } finally {\n context.viewport = currentViewport;\n this.props = currentProps;\n\n this._clearChangeFlags();\n\n internalState.needsUpdate = false;\n internalState.resetOldProps();\n }\n }\n\n _finalize() {\n (0,_debug__WEBPACK_IMPORTED_MODULE_13__[\"default\"])(TRACE_FINALIZE, this);\n this.finalizeState(this.context);\n\n for (const extension of this.props.extensions) {\n extension.finalizeState.call(this, this.context, extension);\n }\n }\n\n _drawLayer({\n moduleParameters = null,\n uniforms = {},\n parameters = {}\n }) {\n this._updateAttributeTransition();\n\n const currentProps = this.props;\n const context = this.context;\n this.props = this.internalState.propsInTransition || currentProps;\n const opacity = this.props.opacity;\n uniforms.opacity = Math.pow(opacity, 1 / 2.2);\n\n try {\n if (moduleParameters) {\n this.setModuleParameters(moduleParameters);\n }\n\n const {\n getPolygonOffset\n } = this.props;\n const offsets = getPolygonOffset && getPolygonOffset(uniforms) || [0, 0];\n (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_16__.setParameters)(context.gl, {\n polygonOffset: offsets\n });\n (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_16__.withParameters)(context.gl, parameters, () => {\n const opts = {\n moduleParameters,\n uniforms,\n parameters,\n context\n };\n\n for (const extension of this.props.extensions) {\n extension.draw.call(this, opts, extension);\n }\n\n this.draw(opts);\n });\n } finally {\n this.props = currentProps;\n }\n }\n\n getChangeFlags() {\n var _this$internalState2;\n\n return (_this$internalState2 = this.internalState) === null || _this$internalState2 === void 0 ? void 0 : _this$internalState2.changeFlags;\n }\n\n setChangeFlags(flags) {\n if (!this.internalState) {\n return;\n }\n\n const {\n changeFlags\n } = this.internalState;\n\n for (const key in flags) {\n if (flags[key]) {\n let flagChanged = false;\n\n switch (key) {\n case 'dataChanged':\n const dataChangedReason = flags[key];\n const prevDataChangedReason = changeFlags[key];\n\n if (dataChangedReason && Array.isArray(prevDataChangedReason)) {\n changeFlags.dataChanged = Array.isArray(dataChangedReason) ? prevDataChangedReason.concat(dataChangedReason) : dataChangedReason;\n flagChanged = true;\n }\n\n default:\n if (!changeFlags[key]) {\n changeFlags[key] = flags[key];\n flagChanged = true;\n }\n\n }\n\n if (flagChanged) {\n (0,_debug__WEBPACK_IMPORTED_MODULE_13__[\"default\"])(TRACE_CHANGE_FLAG, this, key, flags);\n }\n }\n }\n\n const propsOrDataChanged = Boolean(changeFlags.dataChanged || changeFlags.updateTriggersChanged || changeFlags.propsChanged || changeFlags.extensionsChanged);\n changeFlags.propsOrDataChanged = propsOrDataChanged;\n changeFlags.somethingChanged = propsOrDataChanged || changeFlags.viewportChanged || changeFlags.stateChanged;\n }\n\n _clearChangeFlags() {\n this.internalState.changeFlags = {\n dataChanged: false,\n propsChanged: false,\n updateTriggersChanged: false,\n viewportChanged: false,\n stateChanged: false,\n extensionsChanged: false,\n propsOrDataChanged: false,\n somethingChanged: false\n };\n }\n\n _diffProps(newProps, oldProps) {\n const changeFlags = (0,_lifecycle_props__WEBPACK_IMPORTED_MODULE_17__.diffProps)(newProps, oldProps);\n\n if (changeFlags.updateTriggersChanged) {\n for (const key in changeFlags.updateTriggersChanged) {\n if (changeFlags.updateTriggersChanged[key]) {\n this.invalidateAttribute(key);\n }\n }\n }\n\n if (changeFlags.transitionsChanged) {\n for (const key in changeFlags.transitionsChanged) {\n var _newProps$transitions;\n\n this.internalState.uniformTransitions.add(key, oldProps[key], newProps[key], (_newProps$transitions = newProps.transitions) === null || _newProps$transitions === void 0 ? void 0 : _newProps$transitions[key]);\n }\n }\n\n return this.setChangeFlags(changeFlags);\n }\n\n validateProps() {\n (0,_lifecycle_props__WEBPACK_IMPORTED_MODULE_17__.validateProps)(this.props);\n }\n\n updateAutoHighlight(info) {\n if (this.props.autoHighlight && !Number.isInteger(this.props.highlightedObjectIndex)) {\n this._updateAutoHighlight(info);\n }\n }\n\n _updateAutoHighlight(info) {\n const pickingModuleParameters = {\n pickingSelectedColor: info.picked ? info.color : null\n };\n const {\n highlightColor\n } = this.props;\n\n if (info.picked && typeof highlightColor === 'function') {\n pickingModuleParameters.pickingHighlightColor = highlightColor(info);\n }\n\n this.setModuleParameters(pickingModuleParameters);\n this.setNeedsRedraw();\n }\n\n _getAttributeManager() {\n const context = this.context;\n return new _attribute_attribute_manager__WEBPACK_IMPORTED_MODULE_18__[\"default\"](context.gl, {\n id: this.props.id,\n stats: context.stats,\n timeline: context.timeline\n });\n }\n\n _postUpdate(updateParams, forceUpdate) {\n const {\n props,\n oldProps\n } = updateParams;\n this.setNeedsRedraw();\n\n this._updateAttributes();\n\n const {\n model\n } = this.state;\n model === null || model === void 0 ? void 0 : model.setInstanceCount(this.getNumInstances());\n const {\n autoHighlight,\n highlightedObjectIndex,\n highlightColor\n } = props;\n\n if (forceUpdate || oldProps.autoHighlight !== autoHighlight || oldProps.highlightedObjectIndex !== highlightedObjectIndex || oldProps.highlightColor !== highlightColor) {\n const parameters = {};\n\n if (!autoHighlight) {\n parameters.pickingSelectedColor = null;\n }\n\n if (Array.isArray(highlightColor)) {\n parameters.pickingHighlightColor = highlightColor;\n }\n\n if (forceUpdate || highlightedObjectIndex !== oldProps.highlightedObjectIndex) {\n parameters.pickingSelectedColor = Number.isFinite(highlightedObjectIndex) && highlightedObjectIndex >= 0 ? this.encodePickingColor(highlightedObjectIndex) : null;\n }\n\n this.setModuleParameters(parameters);\n }\n }\n\n _getUpdateParams() {\n return {\n props: this.props,\n oldProps: this.internalState.getOldProps(),\n context: this.context,\n changeFlags: this.internalState.changeFlags\n };\n }\n\n _getNeedsRedraw(opts) {\n if (!this.internalState) {\n return false;\n }\n\n let redraw = false;\n redraw = redraw || this.internalState.needsRedraw && this.id;\n const attributeManager = this.getAttributeManager();\n const attributeManagerNeedsRedraw = attributeManager ? attributeManager.getNeedsRedraw(opts) : false;\n redraw = redraw || attributeManagerNeedsRedraw;\n\n if (redraw) {\n for (const extension of this.props.extensions) {\n extension.onNeedsRedraw.call(this, extension);\n }\n }\n\n this.internalState.needsRedraw = this.internalState.needsRedraw && !opts.clearRedrawFlags;\n return redraw;\n }\n\n _onAsyncPropUpdated() {\n this._diffProps(this.props, this.internalState.getOldProps());\n\n this.setNeedsUpdate();\n }\n\n}\n\n(0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Layer, \"defaultProps\", defaultProps);\n\n(0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Layer, \"layerName\", 'Layer');\n//# sourceMappingURL=layer.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/layer.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/picking/pick-info.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/picking/pick-info.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getEmptyPickingInfo: () => (/* binding */ getEmptyPickingInfo),\n/* harmony export */ getLayerPickingInfo: () => (/* binding */ getLayerPickingInfo),\n/* harmony export */ processPickInfo: () => (/* binding */ processPickInfo)\n/* harmony export */ });\nfunction getEmptyPickingInfo({\n pickInfo,\n viewports,\n pixelRatio,\n x,\n y,\n z\n}) {\n let pickedViewport = viewports[0];\n\n if (viewports.length > 1) {\n pickedViewport = getViewportFromCoordinates((pickInfo === null || pickInfo === void 0 ? void 0 : pickInfo.pickedViewports) || viewports, {\n x,\n y\n });\n }\n\n let coordinate;\n\n if (pickedViewport) {\n const point = [x - pickedViewport.x, y - pickedViewport.y];\n\n if (z !== undefined) {\n point[2] = z;\n }\n\n coordinate = pickedViewport.unproject(point);\n }\n\n return {\n color: null,\n layer: null,\n viewport: pickedViewport,\n index: -1,\n picked: false,\n x,\n y,\n pixel: [x, y],\n coordinate,\n devicePixel: pickInfo && 'pickedX' in pickInfo ? [pickInfo.pickedX, pickInfo.pickedY] : undefined,\n pixelRatio\n };\n}\nfunction processPickInfo(opts) {\n const {\n pickInfo,\n lastPickedInfo,\n mode,\n layers\n } = opts;\n const {\n pickedColor,\n pickedLayer,\n pickedObjectIndex\n } = pickInfo;\n const affectedLayers = pickedLayer ? [pickedLayer] : [];\n\n if (mode === 'hover') {\n const lastPickedPixelIndex = lastPickedInfo.index;\n const lastPickedLayerId = lastPickedInfo.layerId;\n const pickedLayerId = pickedLayer ? pickedLayer.props.id : null;\n\n if (pickedLayerId !== lastPickedLayerId || pickedObjectIndex !== lastPickedPixelIndex) {\n if (pickedLayerId !== lastPickedLayerId) {\n const lastPickedLayer = layers.find(layer => layer.props.id === lastPickedLayerId);\n\n if (lastPickedLayer) {\n affectedLayers.unshift(lastPickedLayer);\n }\n }\n\n lastPickedInfo.layerId = pickedLayerId;\n lastPickedInfo.index = pickedObjectIndex;\n lastPickedInfo.info = null;\n }\n }\n\n const baseInfo = getEmptyPickingInfo(opts);\n const infos = new Map();\n infos.set(null, baseInfo);\n affectedLayers.forEach(layer => {\n let info = { ...baseInfo\n };\n\n if (layer === pickedLayer) {\n info.color = pickedColor;\n info.index = pickedObjectIndex;\n info.picked = true;\n }\n\n info = getLayerPickingInfo({\n layer,\n info,\n mode\n });\n const rootLayer = info.layer;\n\n if (layer === pickedLayer && mode === 'hover') {\n lastPickedInfo.info = info;\n }\n\n infos.set(rootLayer.id, info);\n\n if (mode === 'hover') {\n rootLayer.updateAutoHighlight(info);\n }\n });\n return infos;\n}\nfunction getLayerPickingInfo({\n layer,\n info,\n mode\n}) {\n while (layer && info) {\n const sourceLayer = info.layer || null;\n info.sourceLayer = sourceLayer;\n info.layer = layer;\n info = layer.getPickingInfo({\n info,\n mode,\n sourceLayer\n });\n layer = layer.parent;\n }\n\n return info;\n}\n\nfunction getViewportFromCoordinates(viewports, pixel) {\n for (let i = viewports.length - 1; i >= 0; i--) {\n const viewport = viewports[i];\n\n if (viewport.containsPixel(pixel)) {\n return viewport;\n }\n }\n\n return viewports[0];\n}\n//# sourceMappingURL=pick-info.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/picking/pick-info.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/picking/query-object.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/picking/query-object.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getClosestObject: () => (/* binding */ getClosestObject),\n/* harmony export */ getUniqueObjects: () => (/* binding */ getUniqueObjects)\n/* harmony export */ });\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/log */ \"./node_modules/@deck.gl/core/dist/esm/utils/log.js\");\n\nconst NO_PICKED_OBJECT = {\n pickedColor: null,\n pickedObjectIndex: -1\n};\nfunction getClosestObject({\n pickedColors,\n decodePickingColor,\n deviceX,\n deviceY,\n deviceRadius,\n deviceRect\n}) {\n const {\n x,\n y,\n width,\n height\n } = deviceRect;\n let minSquareDistanceToCenter = deviceRadius * deviceRadius;\n let closestPixelIndex = -1;\n let i = 0;\n\n for (let row = 0; row < height; row++) {\n const dy = row + y - deviceY;\n const dy2 = dy * dy;\n\n if (dy2 > minSquareDistanceToCenter) {\n i += 4 * width;\n } else {\n for (let col = 0; col < width; col++) {\n const pickedLayerIndex = pickedColors[i + 3] - 1;\n\n if (pickedLayerIndex >= 0) {\n const dx = col + x - deviceX;\n const d2 = dx * dx + dy2;\n\n if (d2 <= minSquareDistanceToCenter) {\n minSquareDistanceToCenter = d2;\n closestPixelIndex = i;\n }\n }\n\n i += 4;\n }\n }\n }\n\n if (closestPixelIndex >= 0) {\n const pickedColor = pickedColors.slice(closestPixelIndex, closestPixelIndex + 4);\n const pickedObject = decodePickingColor(pickedColor);\n\n if (pickedObject) {\n const dy = Math.floor(closestPixelIndex / 4 / width);\n const dx = closestPixelIndex / 4 - dy * width;\n return { ...pickedObject,\n pickedColor,\n pickedX: x + dx,\n pickedY: y + dy\n };\n }\n\n _utils_log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].error('Picked non-existent layer. Is picking buffer corrupt?')();\n }\n\n return NO_PICKED_OBJECT;\n}\nfunction getUniqueObjects({\n pickedColors,\n decodePickingColor\n}) {\n const uniqueColors = new Map();\n\n if (pickedColors) {\n for (let i = 0; i < pickedColors.length; i += 4) {\n const pickedLayerIndex = pickedColors[i + 3] - 1;\n\n if (pickedLayerIndex >= 0) {\n const pickedColor = pickedColors.slice(i, i + 4);\n const colorKey = pickedColor.join(',');\n\n if (!uniqueColors.has(colorKey)) {\n const pickedObject = decodePickingColor(pickedColor);\n\n if (pickedObject) {\n uniqueColors.set(colorKey, { ...pickedObject,\n color: pickedColor\n });\n } else {\n _utils_log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].error('Picked non-existent layer. Is picking buffer corrupt?')();\n }\n }\n }\n }\n }\n\n return Array.from(uniqueColors.values());\n}\n//# sourceMappingURL=query-object.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/picking/query-object.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/resource/resource-manager.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/resource/resource-manager.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ResourceManager)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _resource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resource */ \"./node_modules/@deck.gl/core/dist/esm/lib/resource/resource.js\");\n\n\nclass ResourceManager {\n constructor({\n gl,\n protocol\n }) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"protocol\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_context\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_resources\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_consumers\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_pruneRequest\", void 0);\n\n this.protocol = protocol || 'resource://';\n this._context = {\n gl,\n resourceManager: this\n };\n this._resources = {};\n this._consumers = {};\n this._pruneRequest = null;\n }\n\n contains(resourceId) {\n if (resourceId.startsWith(this.protocol)) {\n return true;\n }\n\n return resourceId in this._resources;\n }\n\n add({\n resourceId,\n data,\n forceUpdate = false,\n persistent = true\n }) {\n let res = this._resources[resourceId];\n\n if (res) {\n res.setData(data, forceUpdate);\n } else {\n res = new _resource__WEBPACK_IMPORTED_MODULE_1__[\"default\"](resourceId, data, this._context);\n this._resources[resourceId] = res;\n }\n\n res.persistent = persistent;\n }\n\n remove(resourceId) {\n const res = this._resources[resourceId];\n\n if (res) {\n res.delete();\n delete this._resources[resourceId];\n }\n }\n\n unsubscribe({\n consumerId\n }) {\n const consumer = this._consumers[consumerId];\n\n if (consumer) {\n for (const requestId in consumer) {\n const request = consumer[requestId];\n const resource = this._resources[request.resourceId];\n\n if (resource) {\n resource.unsubscribe(request);\n }\n }\n\n delete this._consumers[consumerId];\n this.prune();\n }\n }\n\n subscribe({\n resourceId,\n onChange,\n consumerId,\n requestId = 'default'\n }) {\n const {\n _resources: resources,\n protocol\n } = this;\n\n if (resourceId.startsWith(protocol)) {\n resourceId = resourceId.replace(protocol, '');\n\n if (!resources[resourceId]) {\n this.add({\n resourceId,\n data: null,\n persistent: false\n });\n }\n }\n\n const res = resources[resourceId];\n\n this._track(consumerId, requestId, res, onChange);\n\n if (res) {\n return res.getData();\n }\n\n return undefined;\n }\n\n prune() {\n if (!this._pruneRequest) {\n this._pruneRequest = setTimeout(() => this._prune(), 0);\n }\n }\n\n finalize() {\n for (const key in this._resources) {\n this._resources[key].delete();\n }\n }\n\n _track(consumerId, requestId, resource, onChange) {\n const consumers = this._consumers;\n const consumer = consumers[consumerId] = consumers[consumerId] || {};\n const request = consumer[requestId] || {};\n const oldResource = request.resourceId && this._resources[request.resourceId];\n\n if (oldResource) {\n oldResource.unsubscribe(request);\n this.prune();\n }\n\n if (resource) {\n consumer[requestId] = request;\n request.onChange = onChange;\n request.resourceId = resource.id;\n resource.subscribe(request);\n }\n }\n\n _prune() {\n this._pruneRequest = null;\n\n for (const key of Object.keys(this._resources)) {\n const res = this._resources[key];\n\n if (!res.persistent && !res.inUse()) {\n res.delete();\n delete this._resources[key];\n }\n }\n }\n\n}\n//# sourceMappingURL=resource-manager.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/resource/resource-manager.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/resource/resource.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/resource/resource.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Resource)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _loaders_gl_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @loaders.gl/core */ \"./node_modules/@loaders.gl/core/dist/esm/lib/api/load.js\");\n\n\nclass Resource {\n constructor(id, data, context) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"id\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"context\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"isLoaded\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"persistent\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_loadCount\", 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_subscribers\", new Set());\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_data\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_loader\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_error\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_content\", void 0);\n\n this.id = id;\n this.context = context;\n this.setData(data);\n }\n\n subscribe(consumer) {\n this._subscribers.add(consumer);\n }\n\n unsubscribe(consumer) {\n this._subscribers.delete(consumer);\n }\n\n inUse() {\n return this._subscribers.size > 0;\n }\n\n delete() {}\n\n getData() {\n return this.isLoaded ? this._error ? Promise.reject(this._error) : this._content : this._loader.then(() => this.getData());\n }\n\n setData(data, forceUpdate) {\n if (data === this._data && !forceUpdate) {\n return;\n }\n\n this._data = data;\n const loadCount = ++this._loadCount;\n let loader = data;\n\n if (typeof data === 'string') {\n loader = (0,_loaders_gl_core__WEBPACK_IMPORTED_MODULE_1__.load)(data);\n }\n\n if (loader instanceof Promise) {\n this.isLoaded = false;\n this._loader = loader.then(result => {\n if (this._loadCount === loadCount) {\n this.isLoaded = true;\n this._error = undefined;\n this._content = result;\n }\n }).catch(error => {\n if (this._loadCount === loadCount) {\n this.isLoaded = true;\n this._error = error || true;\n }\n });\n } else {\n this.isLoaded = true;\n this._error = undefined;\n this._content = data;\n }\n\n for (const subscriber of this._subscribers) {\n subscriber.onChange(this.getData());\n }\n }\n\n}\n//# sourceMappingURL=resource.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/resource/resource.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/tooltip.js": +/*!************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/tooltip.js ***! + \************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Tooltip)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n\nconst defaultStyle = {\n zIndex: '1',\n position: 'absolute',\n pointerEvents: 'none',\n color: '#a0a7b4',\n backgroundColor: '#29323c',\n padding: '10px',\n top: '0',\n left: '0',\n display: 'none'\n};\nclass Tooltip {\n constructor(canvas) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"el\", null);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"isVisible\", false);\n\n const canvasParent = canvas.parentElement;\n\n if (canvasParent) {\n this.el = document.createElement('div');\n this.el.className = 'deck-tooltip';\n Object.assign(this.el.style, defaultStyle);\n canvasParent.appendChild(this.el);\n }\n }\n\n setTooltip(displayInfo, x, y) {\n const el = this.el;\n\n if (!el) {\n return;\n }\n\n if (typeof displayInfo === 'string') {\n el.innerText = displayInfo;\n } else if (!displayInfo) {\n this.isVisible = false;\n el.style.display = 'none';\n return;\n } else {\n if (displayInfo.text) {\n el.innerText = displayInfo.text;\n }\n\n if (displayInfo.html) {\n el.innerHTML = displayInfo.html;\n }\n\n if (displayInfo.className) {\n el.className = displayInfo.className;\n }\n }\n\n this.isVisible = true;\n el.style.display = 'block';\n el.style.transform = \"translate(\".concat(x, \"px, \").concat(y, \"px)\");\n\n if (displayInfo && typeof displayInfo === 'object' && 'style' in displayInfo) {\n Object.assign(el.style, displayInfo.style);\n }\n }\n\n remove() {\n if (this.el) {\n this.el.remove();\n this.el = null;\n }\n }\n\n}\n//# sourceMappingURL=tooltip.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/tooltip.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/uniform-transition-manager.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/uniform-transition-manager.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ UniformTransitionManager)\n/* harmony export */ });\n/* harmony import */ var _attribute_attribute_transition_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./attribute/attribute-transition-utils */ \"./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute-transition-utils.js\");\n/* harmony import */ var _transitions_cpu_interpolation_transition__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../transitions/cpu-interpolation-transition */ \"./node_modules/@deck.gl/core/dist/esm/transitions/cpu-interpolation-transition.js\");\n/* harmony import */ var _transitions_cpu_spring_transition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../transitions/cpu-spring-transition */ \"./node_modules/@deck.gl/core/dist/esm/transitions/cpu-spring-transition.js\");\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/log */ \"./node_modules/@deck.gl/core/dist/esm/utils/log.js\");\n\n\n\n\nconst TRANSITION_TYPES = {\n interpolation: _transitions_cpu_interpolation_transition__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n spring: _transitions_cpu_spring_transition__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\n};\nclass UniformTransitionManager {\n constructor(timeline) {\n this.transitions = new Map();\n this.timeline = timeline;\n }\n\n get active() {\n return this.transitions.size > 0;\n }\n\n add(key, fromValue, toValue, settings) {\n const {\n transitions\n } = this;\n\n if (transitions.has(key)) {\n const transition = transitions.get(key);\n const {\n value = transition.settings.fromValue\n } = transition;\n fromValue = value;\n this.remove(key);\n }\n\n settings = (0,_attribute_attribute_transition_utils__WEBPACK_IMPORTED_MODULE_2__.normalizeTransitionSettings)(settings);\n\n if (!settings) {\n return;\n }\n\n const TransitionType = TRANSITION_TYPES[settings.type];\n\n if (!TransitionType) {\n _utils_log__WEBPACK_IMPORTED_MODULE_3__[\"default\"].error(\"unsupported transition type '\".concat(settings.type, \"'\"))();\n return;\n }\n\n const transition = new TransitionType(this.timeline);\n transition.start({ ...settings,\n fromValue,\n toValue\n });\n transitions.set(key, transition);\n }\n\n remove(key) {\n const {\n transitions\n } = this;\n\n if (transitions.has(key)) {\n transitions.get(key).cancel();\n transitions.delete(key);\n }\n }\n\n update() {\n const propsInTransition = {};\n\n for (const [key, transition] of this.transitions) {\n transition.update();\n propsInTransition[key] = transition.value;\n\n if (!transition.inProgress) {\n this.remove(key);\n }\n }\n\n return propsInTransition;\n }\n\n clear() {\n for (const key of this.transitions.keys()) {\n this.remove(key);\n }\n }\n\n}\n//# sourceMappingURL=uniform-transition-manager.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/uniform-transition-manager.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lib/view-manager.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lib/view-manager.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ViewManager)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _utils_deep_equal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/deep-equal */ \"./node_modules/@deck.gl/core/dist/esm/utils/deep-equal.js\");\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/log */ \"./node_modules/@deck.gl/core/dist/esm/utils/log.js\");\n/* harmony import */ var _utils_flatten__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/flatten */ \"./node_modules/@deck.gl/core/dist/esm/utils/flatten.js\");\n\n\n\n\nclass ViewManager {\n constructor(props) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"width\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"height\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"views\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"viewState\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"controllers\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"timeline\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_viewports\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_viewportMap\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_isUpdating\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_needsRedraw\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_needsUpdate\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_eventManager\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_eventCallbacks\", void 0);\n\n this.views = [];\n this.width = 100;\n this.height = 100;\n this.viewState = {};\n this.controllers = {};\n this.timeline = props.timeline;\n this._viewports = [];\n this._viewportMap = {};\n this._isUpdating = false;\n this._needsRedraw = 'First render';\n this._needsUpdate = 'Initialize';\n this._eventManager = props.eventManager;\n this._eventCallbacks = {\n onViewStateChange: props.onViewStateChange,\n onInteractionStateChange: props.onInteractionStateChange\n };\n Object.seal(this);\n this.setProps(props);\n }\n\n finalize() {\n for (const key in this.controllers) {\n const controller = this.controllers[key];\n\n if (controller) {\n controller.finalize();\n }\n }\n\n this.controllers = {};\n }\n\n needsRedraw(opts = {\n clearRedrawFlags: false\n }) {\n const redraw = this._needsRedraw;\n\n if (opts.clearRedrawFlags) {\n this._needsRedraw = false;\n }\n\n return redraw;\n }\n\n setNeedsUpdate(reason) {\n this._needsUpdate = this._needsUpdate || reason;\n this._needsRedraw = this._needsRedraw || reason;\n }\n\n updateViewStates() {\n for (const viewId in this.controllers) {\n const controller = this.controllers[viewId];\n\n if (controller) {\n controller.updateTransition();\n }\n }\n }\n\n getViewports(rect) {\n if (rect) {\n return this._viewports.filter(viewport => viewport.containsPixel(rect));\n }\n\n return this._viewports;\n }\n\n getViews() {\n const viewMap = {};\n this.views.forEach(view => {\n viewMap[view.id] = view;\n });\n return viewMap;\n }\n\n getView(viewId) {\n return this.views.find(view => view.id === viewId);\n }\n\n getViewState(viewOrViewId) {\n const view = typeof viewOrViewId === 'string' ? this.getView(viewOrViewId) : viewOrViewId;\n const viewState = view && this.viewState[view.getViewStateId()] || this.viewState;\n return view ? view.filterViewState(viewState) : viewState;\n }\n\n getViewport(viewId) {\n return this._viewportMap[viewId];\n }\n\n unproject(xyz, opts) {\n const viewports = this.getViewports();\n const pixel = {\n x: xyz[0],\n y: xyz[1]\n };\n\n for (let i = viewports.length - 1; i >= 0; --i) {\n const viewport = viewports[i];\n\n if (viewport.containsPixel(pixel)) {\n const p = xyz.slice();\n p[0] -= viewport.x;\n p[1] -= viewport.y;\n return viewport.unproject(p, opts);\n }\n }\n\n return null;\n }\n\n setProps(props) {\n if (props.views) {\n this._setViews(props.views);\n }\n\n if (props.viewState) {\n this._setViewState(props.viewState);\n }\n\n if ('width' in props || 'height' in props) {\n this._setSize(props.width, props.height);\n }\n\n if (!this._isUpdating) {\n this._update();\n }\n }\n\n _update() {\n this._isUpdating = true;\n\n if (this._needsUpdate) {\n this._needsUpdate = false;\n\n this._rebuildViewports();\n }\n\n if (this._needsUpdate) {\n this._needsUpdate = false;\n\n this._rebuildViewports();\n }\n\n this._isUpdating = false;\n }\n\n _setSize(width, height) {\n if (width !== this.width || height !== this.height) {\n this.width = width;\n this.height = height;\n this.setNeedsUpdate('Size changed');\n }\n }\n\n _setViews(views) {\n views = (0,_utils_flatten__WEBPACK_IMPORTED_MODULE_1__.flatten)(views, Boolean);\n\n const viewsChanged = this._diffViews(views, this.views);\n\n if (viewsChanged) {\n this.setNeedsUpdate('views changed');\n }\n\n this.views = views;\n }\n\n _setViewState(viewState) {\n if (viewState) {\n const viewStateChanged = !(0,_utils_deep_equal__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(viewState, this.viewState, 3);\n\n if (viewStateChanged) {\n this.setNeedsUpdate('viewState changed');\n }\n\n this.viewState = viewState;\n } else {\n _utils_log__WEBPACK_IMPORTED_MODULE_3__[\"default\"].warn('missing `viewState` or `initialViewState`')();\n }\n }\n\n _onViewStateChange(viewId, event) {\n if (this._eventCallbacks.onViewStateChange) {\n this._eventCallbacks.onViewStateChange({ ...event,\n viewId\n });\n }\n }\n\n _createController(view, props) {\n const Controller = props.type;\n const controller = new Controller({\n timeline: this.timeline,\n eventManager: this._eventManager,\n onViewStateChange: this._onViewStateChange.bind(this, props.id),\n onStateChange: this._eventCallbacks.onInteractionStateChange,\n makeViewport: viewState => {\n var _this$getView;\n\n return (_this$getView = this.getView(view.id)) === null || _this$getView === void 0 ? void 0 : _this$getView.makeViewport({\n viewState,\n width: this.width,\n height: this.height\n });\n }\n });\n return controller;\n }\n\n _updateController(view, viewState, viewport, controller) {\n const controllerProps = view.controller;\n\n if (controllerProps && viewport) {\n const resolvedProps = { ...viewState,\n ...controllerProps,\n id: view.id,\n x: viewport.x,\n y: viewport.y,\n width: viewport.width,\n height: viewport.height\n };\n\n if (!controller || controller.constructor !== controllerProps.type) {\n controller = this._createController(view, resolvedProps);\n }\n\n if (controller) {\n controller.setProps(resolvedProps);\n }\n\n return controller;\n }\n\n return null;\n }\n\n _rebuildViewports() {\n const {\n views\n } = this;\n const oldControllers = this.controllers;\n this._viewports = [];\n this.controllers = {};\n let invalidateControllers = false;\n\n for (let i = views.length; i--;) {\n const view = views[i];\n const viewState = this.getViewState(view);\n const viewport = view.makeViewport({\n viewState,\n width: this.width,\n height: this.height\n });\n let oldController = oldControllers[view.id];\n const hasController = Boolean(view.controller);\n\n if (hasController && !oldController) {\n invalidateControllers = true;\n }\n\n if ((invalidateControllers || !hasController) && oldController) {\n oldController.finalize();\n oldController = null;\n }\n\n this.controllers[view.id] = this._updateController(view, viewState, viewport, oldController);\n\n if (viewport) {\n this._viewports.unshift(viewport);\n }\n }\n\n for (const id in oldControllers) {\n const oldController = oldControllers[id];\n\n if (oldController && !this.controllers[id]) {\n oldController.finalize();\n }\n }\n\n this._buildViewportMap();\n }\n\n _buildViewportMap() {\n this._viewportMap = {};\n\n this._viewports.forEach(viewport => {\n if (viewport.id) {\n this._viewportMap[viewport.id] = this._viewportMap[viewport.id] || viewport;\n }\n });\n }\n\n _diffViews(newViews, oldViews) {\n if (newViews.length !== oldViews.length) {\n return true;\n }\n\n return newViews.some((_, i) => !newViews[i].equals(oldViews[i]));\n }\n\n}\n//# sourceMappingURL=view-manager.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lib/view-manager.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lifecycle/component-state.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lifecycle/component-state.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ComponentState)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _utils_iterable_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/iterable-utils */ \"./node_modules/@deck.gl/core/dist/esm/utils/iterable-utils.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ \"./node_modules/@deck.gl/core/dist/esm/lifecycle/constants.js\");\n\n\n\nconst EMPTY_PROPS = Object.freeze({});\nclass ComponentState {\n constructor(component) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"component\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"onAsyncPropUpdated\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"asyncProps\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"oldProps\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"oldAsyncProps\", void 0);\n\n this.component = component;\n this.asyncProps = {};\n\n this.onAsyncPropUpdated = () => {};\n\n this.oldProps = null;\n this.oldAsyncProps = null;\n }\n\n finalize() {\n for (const propName in this.asyncProps) {\n const asyncProp = this.asyncProps[propName];\n\n if (asyncProp && asyncProp.type && asyncProp.type.release) {\n asyncProp.type.release(asyncProp.resolvedValue, asyncProp.type, this.component);\n }\n }\n\n this.asyncProps = {};\n this.component = null;\n this.resetOldProps();\n }\n\n getOldProps() {\n return this.oldAsyncProps || this.oldProps || EMPTY_PROPS;\n }\n\n resetOldProps() {\n this.oldAsyncProps = null;\n this.oldProps = this.component ? this.component.props : null;\n }\n\n hasAsyncProp(propName) {\n return propName in this.asyncProps;\n }\n\n getAsyncProp(propName) {\n const asyncProp = this.asyncProps[propName];\n return asyncProp && asyncProp.resolvedValue;\n }\n\n isAsyncPropLoading(propName) {\n if (propName) {\n const asyncProp = this.asyncProps[propName];\n return Boolean(asyncProp && asyncProp.pendingLoadCount > 0 && asyncProp.pendingLoadCount !== asyncProp.resolvedLoadCount);\n }\n\n for (const key in this.asyncProps) {\n if (this.isAsyncPropLoading(key)) {\n return true;\n }\n }\n\n return false;\n }\n\n reloadAsyncProp(propName, value) {\n this._watchPromise(propName, Promise.resolve(value));\n }\n\n setAsyncProps(props) {\n this.component = props[_constants__WEBPACK_IMPORTED_MODULE_1__.COMPONENT_SYMBOL] || this.component;\n const resolvedValues = props[_constants__WEBPACK_IMPORTED_MODULE_1__.ASYNC_RESOLVED_SYMBOL] || {};\n const originalValues = props[_constants__WEBPACK_IMPORTED_MODULE_1__.ASYNC_ORIGINAL_SYMBOL] || props;\n const defaultValues = props[_constants__WEBPACK_IMPORTED_MODULE_1__.ASYNC_DEFAULTS_SYMBOL] || {};\n\n for (const propName in resolvedValues) {\n const value = resolvedValues[propName];\n\n this._createAsyncPropData(propName, defaultValues[propName]);\n\n this._updateAsyncProp(propName, value);\n\n resolvedValues[propName] = this.getAsyncProp(propName);\n }\n\n for (const propName in originalValues) {\n const value = originalValues[propName];\n\n this._createAsyncPropData(propName, defaultValues[propName]);\n\n this._updateAsyncProp(propName, value);\n }\n }\n\n _fetch(propName, url) {\n return null;\n }\n\n _onResolve(propName, value) {}\n\n _onError(propName, error) {}\n\n _updateAsyncProp(propName, value) {\n if (!this._didAsyncInputValueChange(propName, value)) {\n return;\n }\n\n if (typeof value === 'string') {\n value = this._fetch(propName, value);\n }\n\n if (value instanceof Promise) {\n this._watchPromise(propName, value);\n\n return;\n }\n\n if ((0,_utils_iterable_utils__WEBPACK_IMPORTED_MODULE_2__.isAsyncIterable)(value)) {\n this._resolveAsyncIterable(propName, value);\n\n return;\n }\n\n this._setPropValue(propName, value);\n }\n\n _freezeAsyncOldProps() {\n if (!this.oldAsyncProps && this.oldProps) {\n this.oldAsyncProps = Object.create(this.oldProps);\n\n for (const propName in this.asyncProps) {\n Object.defineProperty(this.oldAsyncProps, propName, {\n enumerable: true,\n value: this.oldProps[propName]\n });\n }\n }\n }\n\n _didAsyncInputValueChange(propName, value) {\n const asyncProp = this.asyncProps[propName];\n\n if (value === asyncProp.resolvedValue || value === asyncProp.lastValue) {\n return false;\n }\n\n asyncProp.lastValue = value;\n return true;\n }\n\n _setPropValue(propName, value) {\n this._freezeAsyncOldProps();\n\n const asyncProp = this.asyncProps[propName];\n\n if (asyncProp) {\n value = this._postProcessValue(asyncProp, value);\n asyncProp.resolvedValue = value;\n asyncProp.pendingLoadCount++;\n asyncProp.resolvedLoadCount = asyncProp.pendingLoadCount;\n }\n }\n\n _setAsyncPropValue(propName, value, loadCount) {\n const asyncProp = this.asyncProps[propName];\n\n if (asyncProp && loadCount >= asyncProp.resolvedLoadCount && value !== undefined) {\n this._freezeAsyncOldProps();\n\n asyncProp.resolvedValue = value;\n asyncProp.resolvedLoadCount = loadCount;\n this.onAsyncPropUpdated(propName, value);\n }\n }\n\n _watchPromise(propName, promise) {\n const asyncProp = this.asyncProps[propName];\n\n if (asyncProp) {\n asyncProp.pendingLoadCount++;\n const loadCount = asyncProp.pendingLoadCount;\n promise.then(data => {\n if (!this.component) {\n return;\n }\n\n data = this._postProcessValue(asyncProp, data);\n\n this._setAsyncPropValue(propName, data, loadCount);\n\n this._onResolve(propName, data);\n }).catch(error => {\n this._onError(propName, error);\n });\n }\n }\n\n async _resolveAsyncIterable(propName, iterable) {\n if (propName !== 'data') {\n this._setPropValue(propName, iterable);\n\n return;\n }\n\n const asyncProp = this.asyncProps[propName];\n\n if (!asyncProp) {\n return;\n }\n\n asyncProp.pendingLoadCount++;\n const loadCount = asyncProp.pendingLoadCount;\n let data = [];\n let count = 0;\n\n for await (const chunk of iterable) {\n if (!this.component) {\n return;\n }\n\n const {\n dataTransform\n } = this.component.props;\n\n if (dataTransform) {\n data = dataTransform(chunk, data);\n } else {\n data = data.concat(chunk);\n }\n\n Object.defineProperty(data, '__diff', {\n enumerable: false,\n value: [{\n startRow: count,\n endRow: data.length\n }]\n });\n count = data.length;\n\n this._setAsyncPropValue(propName, data, loadCount);\n }\n\n this._onResolve(propName, data);\n }\n\n _postProcessValue(asyncProp, value) {\n const propType = asyncProp.type;\n\n if (propType && this.component) {\n if (propType.release) {\n propType.release(asyncProp.resolvedValue, propType, this.component);\n }\n\n if (propType.transform) {\n return propType.transform(value, propType, this.component);\n }\n }\n\n return value;\n }\n\n _createAsyncPropData(propName, defaultValue) {\n const asyncProp = this.asyncProps[propName];\n\n if (!asyncProp) {\n const propTypes = this.component && this.component.props[_constants__WEBPACK_IMPORTED_MODULE_1__.PROP_TYPES_SYMBOL];\n this.asyncProps[propName] = {\n type: propTypes && propTypes[propName],\n lastValue: null,\n resolvedValue: defaultValue,\n pendingLoadCount: 0,\n resolvedLoadCount: 0\n };\n }\n }\n\n}\n//# sourceMappingURL=component-state.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lifecycle/component-state.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lifecycle/component.js": +/*!********************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lifecycle/component.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Component)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants */ \"./node_modules/@deck.gl/core/dist/esm/lifecycle/constants.js\");\n/* harmony import */ var _create_props__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create-props */ \"./node_modules/@deck.gl/core/dist/esm/lifecycle/create-props.js\");\n\n\n\nlet counter = 0;\nclass Component {\n constructor(...propObjects) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"id\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"props\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"count\", void 0);\n\n this.props = (0,_create_props__WEBPACK_IMPORTED_MODULE_1__.createProps)(this, propObjects);\n this.id = this.props.id;\n this.count = counter++;\n }\n\n clone(newProps) {\n const {\n props\n } = this;\n const asyncProps = {};\n\n for (const key in props[_constants__WEBPACK_IMPORTED_MODULE_2__.ASYNC_DEFAULTS_SYMBOL]) {\n if (key in props[_constants__WEBPACK_IMPORTED_MODULE_2__.ASYNC_RESOLVED_SYMBOL]) {\n asyncProps[key] = props[_constants__WEBPACK_IMPORTED_MODULE_2__.ASYNC_RESOLVED_SYMBOL][key];\n } else if (key in props[_constants__WEBPACK_IMPORTED_MODULE_2__.ASYNC_ORIGINAL_SYMBOL]) {\n asyncProps[key] = props[_constants__WEBPACK_IMPORTED_MODULE_2__.ASYNC_ORIGINAL_SYMBOL][key];\n }\n }\n\n return new this.constructor({ ...props,\n ...asyncProps,\n ...newProps\n });\n }\n\n}\n\n(0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Component, \"componentName\", 'Component');\n\n(0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Component, \"defaultProps\", {});\n//# sourceMappingURL=component.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lifecycle/component.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lifecycle/constants.js": +/*!********************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lifecycle/constants.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ASYNC_DEFAULTS_SYMBOL: () => (/* binding */ ASYNC_DEFAULTS_SYMBOL),\n/* harmony export */ ASYNC_ORIGINAL_SYMBOL: () => (/* binding */ ASYNC_ORIGINAL_SYMBOL),\n/* harmony export */ ASYNC_RESOLVED_SYMBOL: () => (/* binding */ ASYNC_RESOLVED_SYMBOL),\n/* harmony export */ COMPONENT_SYMBOL: () => (/* binding */ COMPONENT_SYMBOL),\n/* harmony export */ DEPRECATED_PROPS_SYMBOL: () => (/* binding */ DEPRECATED_PROPS_SYMBOL),\n/* harmony export */ LIFECYCLE: () => (/* binding */ LIFECYCLE),\n/* harmony export */ PROP_TYPES_SYMBOL: () => (/* binding */ PROP_TYPES_SYMBOL)\n/* harmony export */ });\nconst LIFECYCLE = {\n NO_STATE: 'Awaiting state',\n MATCHED: 'Matched. State transferred from previous layer',\n INITIALIZED: 'Initialized',\n AWAITING_GC: 'Discarded. Awaiting garbage collection',\n AWAITING_FINALIZATION: 'No longer matched. Awaiting garbage collection',\n FINALIZED: 'Finalized! Awaiting garbage collection'\n};\nconst COMPONENT_SYMBOL = Symbol.for('component');\nconst PROP_TYPES_SYMBOL = Symbol.for('propTypes');\nconst DEPRECATED_PROPS_SYMBOL = Symbol.for('deprecatedProps');\nconst ASYNC_DEFAULTS_SYMBOL = Symbol.for('asyncPropDefaults');\nconst ASYNC_ORIGINAL_SYMBOL = Symbol.for('asyncPropOriginal');\nconst ASYNC_RESOLVED_SYMBOL = Symbol.for('asyncPropResolved');\n//# sourceMappingURL=constants.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lifecycle/constants.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lifecycle/create-props.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lifecycle/create-props.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createProps: () => (/* binding */ createProps)\n/* harmony export */ });\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/log */ \"./node_modules/@deck.gl/core/dist/esm/utils/log.js\");\n/* harmony import */ var _utils_iterable_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/iterable-utils */ \"./node_modules/@deck.gl/core/dist/esm/utils/iterable-utils.js\");\n/* harmony import */ var _prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./prop-types */ \"./node_modules/@deck.gl/core/dist/esm/lifecycle/prop-types.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ \"./node_modules/@deck.gl/core/dist/esm/lifecycle/constants.js\");\n\n\n\n\nfunction createProps(component, propObjects) {\n let extensions;\n\n for (let i = propObjects.length - 1; i >= 0; i--) {\n const props = propObjects[i];\n\n if ('extensions' in props) {\n extensions = props.extensions;\n }\n }\n\n const propsPrototype = getPropsPrototype(component.constructor, extensions);\n const propsInstance = Object.create(propsPrototype);\n propsInstance[_constants__WEBPACK_IMPORTED_MODULE_0__.COMPONENT_SYMBOL] = component;\n propsInstance[_constants__WEBPACK_IMPORTED_MODULE_0__.ASYNC_ORIGINAL_SYMBOL] = {};\n propsInstance[_constants__WEBPACK_IMPORTED_MODULE_0__.ASYNC_RESOLVED_SYMBOL] = {};\n\n for (let i = 0; i < propObjects.length; ++i) {\n const props = propObjects[i];\n\n for (const key in props) {\n propsInstance[key] = props[key];\n }\n }\n\n Object.freeze(propsInstance);\n return propsInstance;\n}\nconst MergedDefaultPropsCacheKey = '_mergedDefaultProps';\n\nfunction getPropsPrototype(componentClass, extensions) {\n let cacheKey = MergedDefaultPropsCacheKey;\n\n if (extensions) {\n for (const extension of extensions) {\n const ExtensionClass = extension.constructor;\n\n if (ExtensionClass) {\n cacheKey += \":\".concat(ExtensionClass.extensionName || ExtensionClass.name);\n }\n }\n }\n\n const defaultProps = getOwnProperty(componentClass, cacheKey);\n\n if (!defaultProps) {\n return componentClass[cacheKey] = createPropsPrototypeAndTypes(componentClass, extensions || []);\n }\n\n return defaultProps;\n}\n\nfunction createPropsPrototypeAndTypes(componentClass, extensions) {\n const parent = componentClass.prototype;\n\n if (!parent) {\n return null;\n }\n\n const parentClass = Object.getPrototypeOf(componentClass);\n const parentDefaultProps = getPropsPrototype(parentClass);\n const componentDefaultProps = getOwnProperty(componentClass, 'defaultProps') || {};\n const componentPropDefs = (0,_prop_types__WEBPACK_IMPORTED_MODULE_1__.parsePropTypes)(componentDefaultProps);\n const defaultProps = Object.assign(Object.create(null), parentDefaultProps, componentPropDefs.defaultProps);\n const propTypes = Object.assign(Object.create(null), parentDefaultProps === null || parentDefaultProps === void 0 ? void 0 : parentDefaultProps[_constants__WEBPACK_IMPORTED_MODULE_0__.PROP_TYPES_SYMBOL], componentPropDefs.propTypes);\n const deprecatedProps = Object.assign(Object.create(null), parentDefaultProps === null || parentDefaultProps === void 0 ? void 0 : parentDefaultProps[_constants__WEBPACK_IMPORTED_MODULE_0__.DEPRECATED_PROPS_SYMBOL], componentPropDefs.deprecatedProps);\n\n for (const extension of extensions) {\n const extensionDefaultProps = getPropsPrototype(extension.constructor);\n\n if (extensionDefaultProps) {\n Object.assign(defaultProps, extensionDefaultProps);\n Object.assign(propTypes, extensionDefaultProps[_constants__WEBPACK_IMPORTED_MODULE_0__.PROP_TYPES_SYMBOL]);\n Object.assign(deprecatedProps, extensionDefaultProps[_constants__WEBPACK_IMPORTED_MODULE_0__.DEPRECATED_PROPS_SYMBOL]);\n }\n }\n\n createPropsPrototype(defaultProps, componentClass);\n addAsyncPropsToPropPrototype(defaultProps, propTypes);\n addDeprecatedPropsToPropPrototype(defaultProps, deprecatedProps);\n defaultProps[_constants__WEBPACK_IMPORTED_MODULE_0__.PROP_TYPES_SYMBOL] = propTypes;\n defaultProps[_constants__WEBPACK_IMPORTED_MODULE_0__.DEPRECATED_PROPS_SYMBOL] = deprecatedProps;\n\n if (extensions.length === 0 && !hasOwnProperty(componentClass, '_propTypes')) {\n componentClass._propTypes = propTypes;\n }\n\n return defaultProps;\n}\n\nfunction createPropsPrototype(defaultProps, componentClass) {\n const id = getComponentName(componentClass);\n Object.defineProperties(defaultProps, {\n id: {\n writable: true,\n value: id\n }\n });\n}\n\nfunction addDeprecatedPropsToPropPrototype(defaultProps, deprecatedProps) {\n for (const propName in deprecatedProps) {\n Object.defineProperty(defaultProps, propName, {\n enumerable: false,\n\n set(newValue) {\n const nameStr = \"\".concat(this.id, \": \").concat(propName);\n\n for (const newPropName of deprecatedProps[propName]) {\n if (!hasOwnProperty(this, newPropName)) {\n this[newPropName] = newValue;\n }\n }\n\n _utils_log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].deprecated(nameStr, deprecatedProps[propName].join('/'))();\n }\n\n });\n }\n}\n\nfunction addAsyncPropsToPropPrototype(defaultProps, propTypes) {\n const defaultValues = {};\n const descriptors = {};\n\n for (const propName in propTypes) {\n const propType = propTypes[propName];\n const {\n name,\n value\n } = propType;\n\n if (propType.async) {\n defaultValues[name] = value;\n descriptors[name] = getDescriptorForAsyncProp(name);\n }\n }\n\n defaultProps[_constants__WEBPACK_IMPORTED_MODULE_0__.ASYNC_DEFAULTS_SYMBOL] = defaultValues;\n defaultProps[_constants__WEBPACK_IMPORTED_MODULE_0__.ASYNC_ORIGINAL_SYMBOL] = {};\n Object.defineProperties(defaultProps, descriptors);\n}\n\nfunction getDescriptorForAsyncProp(name) {\n return {\n enumerable: true,\n\n set(newValue) {\n if (typeof newValue === 'string' || newValue instanceof Promise || (0,_utils_iterable_utils__WEBPACK_IMPORTED_MODULE_3__.isAsyncIterable)(newValue)) {\n this[_constants__WEBPACK_IMPORTED_MODULE_0__.ASYNC_ORIGINAL_SYMBOL][name] = newValue;\n } else {\n this[_constants__WEBPACK_IMPORTED_MODULE_0__.ASYNC_RESOLVED_SYMBOL][name] = newValue;\n }\n },\n\n get() {\n if (this[_constants__WEBPACK_IMPORTED_MODULE_0__.ASYNC_RESOLVED_SYMBOL]) {\n if (name in this[_constants__WEBPACK_IMPORTED_MODULE_0__.ASYNC_RESOLVED_SYMBOL]) {\n const value = this[_constants__WEBPACK_IMPORTED_MODULE_0__.ASYNC_RESOLVED_SYMBOL][name];\n return value || this[_constants__WEBPACK_IMPORTED_MODULE_0__.ASYNC_DEFAULTS_SYMBOL][name];\n }\n\n if (name in this[_constants__WEBPACK_IMPORTED_MODULE_0__.ASYNC_ORIGINAL_SYMBOL]) {\n const state = this[_constants__WEBPACK_IMPORTED_MODULE_0__.COMPONENT_SYMBOL] && this[_constants__WEBPACK_IMPORTED_MODULE_0__.COMPONENT_SYMBOL].internalState;\n\n if (state && state.hasAsyncProp(name)) {\n return state.getAsyncProp(name) || this[_constants__WEBPACK_IMPORTED_MODULE_0__.ASYNC_DEFAULTS_SYMBOL][name];\n }\n }\n }\n\n return this[_constants__WEBPACK_IMPORTED_MODULE_0__.ASYNC_DEFAULTS_SYMBOL][name];\n }\n\n };\n}\n\nfunction hasOwnProperty(object, prop) {\n return Object.prototype.hasOwnProperty.call(object, prop);\n}\n\nfunction getOwnProperty(object, prop) {\n return hasOwnProperty(object, prop) && object[prop];\n}\n\nfunction getComponentName(componentClass) {\n const componentName = componentClass.componentName;\n\n if (!componentName) {\n _utils_log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].warn(\"\".concat(componentClass.name, \".componentName not specified\"))();\n }\n\n return componentName || componentClass.name;\n}\n//# sourceMappingURL=create-props.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lifecycle/create-props.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lifecycle/prop-types.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lifecycle/prop-types.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ parsePropTypes: () => (/* binding */ parsePropTypes)\n/* harmony export */ });\n/* harmony import */ var _utils_texture__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/texture */ \"./node_modules/@deck.gl/core/dist/esm/utils/texture.js\");\n/* harmony import */ var _utils_deep_equal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/deep-equal */ \"./node_modules/@deck.gl/core/dist/esm/utils/deep-equal.js\");\n\n\nconst TYPE_DEFINITIONS = {\n boolean: {\n validate(value, propType) {\n return true;\n },\n\n equal(value1, value2, propType) {\n return Boolean(value1) === Boolean(value2);\n }\n\n },\n number: {\n validate(value, propType) {\n return Number.isFinite(value) && (!('max' in propType) || value <= propType.max) && (!('min' in propType) || value >= propType.min);\n }\n\n },\n color: {\n validate(value, propType) {\n return propType.optional && !value || isArray(value) && (value.length === 3 || value.length === 4);\n },\n\n equal(value1, value2, propType) {\n return (0,_utils_deep_equal__WEBPACK_IMPORTED_MODULE_0__.deepEqual)(value1, value2, 1);\n }\n\n },\n accessor: {\n validate(value, propType) {\n const valueType = getTypeOf(value);\n return valueType === 'function' || valueType === getTypeOf(propType.value);\n },\n\n equal(value1, value2, propType) {\n if (typeof value2 === 'function') {\n return true;\n }\n\n return (0,_utils_deep_equal__WEBPACK_IMPORTED_MODULE_0__.deepEqual)(value1, value2, 1);\n }\n\n },\n array: {\n validate(value, propType) {\n return propType.optional && !value || isArray(value);\n },\n\n equal(value1, value2, propType) {\n const {\n compare\n } = propType;\n const depth = Number.isInteger(compare) ? compare : compare ? 1 : 0;\n return compare ? (0,_utils_deep_equal__WEBPACK_IMPORTED_MODULE_0__.deepEqual)(value1, value2, depth) : value1 === value2;\n }\n\n },\n object: {\n equal(value1, value2, propType) {\n if (propType.ignore) {\n return true;\n }\n\n const {\n compare\n } = propType;\n const depth = Number.isInteger(compare) ? compare : compare ? 1 : 0;\n return compare ? (0,_utils_deep_equal__WEBPACK_IMPORTED_MODULE_0__.deepEqual)(value1, value2, depth) : value1 === value2;\n }\n\n },\n function: {\n validate(value, propType) {\n return propType.optional && !value || typeof value === 'function';\n },\n\n equal(value1, value2, propType) {\n const shouldIgnore = !propType.compare && propType.ignore !== false;\n return shouldIgnore || value1 === value2;\n }\n\n },\n data: {\n transform: (value, propType, component) => {\n const {\n dataTransform\n } = component.props;\n return dataTransform && value ? dataTransform(value) : value;\n }\n },\n image: {\n transform: (value, propType, component) => {\n const context = component.context;\n\n if (!context || !context.gl) {\n return null;\n }\n\n return (0,_utils_texture__WEBPACK_IMPORTED_MODULE_1__.createTexture)(component.id, context.gl, value, { ...propType.parameters,\n ...component.props.textureParameters\n });\n },\n release: (value, propType, component) => {\n (0,_utils_texture__WEBPACK_IMPORTED_MODULE_1__.destroyTexture)(component.id, value);\n }\n }\n};\nfunction parsePropTypes(propDefs) {\n const propTypes = {};\n const defaultProps = {};\n const deprecatedProps = {};\n\n for (const [propName, propDef] of Object.entries(propDefs)) {\n const deprecated = propDef === null || propDef === void 0 ? void 0 : propDef.deprecatedFor;\n\n if (deprecated) {\n deprecatedProps[propName] = Array.isArray(deprecated) ? deprecated : [deprecated];\n } else {\n const propType = parsePropType(propName, propDef);\n propTypes[propName] = propType;\n defaultProps[propName] = propType.value;\n }\n }\n\n return {\n propTypes,\n defaultProps,\n deprecatedProps\n };\n}\n\nfunction parsePropType(name, propDef) {\n switch (getTypeOf(propDef)) {\n case 'object':\n return normalizePropDefinition(name, propDef);\n\n case 'array':\n return normalizePropDefinition(name, {\n type: 'array',\n value: propDef,\n compare: false\n });\n\n case 'boolean':\n return normalizePropDefinition(name, {\n type: 'boolean',\n value: propDef\n });\n\n case 'number':\n return normalizePropDefinition(name, {\n type: 'number',\n value: propDef\n });\n\n case 'function':\n return normalizePropDefinition(name, {\n type: 'function',\n value: propDef,\n compare: true\n });\n\n default:\n return {\n name,\n type: 'unknown',\n value: propDef\n };\n }\n}\n\nfunction normalizePropDefinition(name, propDef) {\n if (!('type' in propDef)) {\n if (!('value' in propDef)) {\n return {\n name,\n type: 'object',\n value: propDef\n };\n }\n\n return {\n name,\n type: getTypeOf(propDef.value),\n ...propDef\n };\n }\n\n return {\n name,\n ...TYPE_DEFINITIONS[propDef.type],\n ...propDef\n };\n}\n\nfunction isArray(value) {\n return Array.isArray(value) || ArrayBuffer.isView(value);\n}\n\nfunction getTypeOf(value) {\n if (isArray(value)) {\n return 'array';\n }\n\n if (value === null) {\n return 'null';\n }\n\n return typeof value;\n}\n//# sourceMappingURL=prop-types.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lifecycle/prop-types.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/lifecycle/props.js": +/*!****************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/lifecycle/props.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ compareProps: () => (/* binding */ compareProps),\n/* harmony export */ diffProps: () => (/* binding */ diffProps),\n/* harmony export */ validateProps: () => (/* binding */ validateProps)\n/* harmony export */ });\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ \"./node_modules/@deck.gl/core/dist/esm/lifecycle/constants.js\");\n\nfunction validateProps(props) {\n const propTypes = props[_constants__WEBPACK_IMPORTED_MODULE_0__.PROP_TYPES_SYMBOL];\n\n for (const propName in propTypes) {\n const propType = propTypes[propName];\n const {\n validate\n } = propType;\n\n if (validate && !validate(props[propName], propType)) {\n throw new Error(\"Invalid prop \".concat(propName, \": \").concat(props[propName]));\n }\n }\n}\nfunction diffProps(props, oldProps) {\n const propsChangedReason = compareProps({\n newProps: props,\n oldProps,\n propTypes: props[_constants__WEBPACK_IMPORTED_MODULE_0__.PROP_TYPES_SYMBOL],\n ignoreProps: {\n data: null,\n updateTriggers: null,\n extensions: null,\n transitions: null\n }\n });\n const dataChangedReason = diffDataProps(props, oldProps);\n let updateTriggersChangedReason = false;\n\n if (!dataChangedReason) {\n updateTriggersChangedReason = diffUpdateTriggers(props, oldProps);\n }\n\n return {\n dataChanged: dataChangedReason,\n propsChanged: propsChangedReason,\n updateTriggersChanged: updateTriggersChangedReason,\n extensionsChanged: diffExtensions(props, oldProps),\n transitionsChanged: diffTransitions(props, oldProps)\n };\n}\n\nfunction diffTransitions(props, oldProps) {\n if (!props.transitions) {\n return false;\n }\n\n const result = {};\n const propTypes = props[_constants__WEBPACK_IMPORTED_MODULE_0__.PROP_TYPES_SYMBOL];\n let changed = false;\n\n for (const key in props.transitions) {\n const propType = propTypes[key];\n const type = propType && propType.type;\n const isTransitionable = type === 'number' || type === 'color' || type === 'array';\n\n if (isTransitionable && comparePropValues(props[key], oldProps[key], propType)) {\n result[key] = true;\n changed = true;\n }\n }\n\n return changed ? result : false;\n}\n\nfunction compareProps({\n newProps,\n oldProps,\n ignoreProps = {},\n propTypes = {},\n triggerName = 'props'\n}) {\n if (oldProps === newProps) {\n return false;\n }\n\n if (typeof newProps !== 'object' || newProps === null) {\n return \"\".concat(triggerName, \" changed shallowly\");\n }\n\n if (typeof oldProps !== 'object' || oldProps === null) {\n return \"\".concat(triggerName, \" changed shallowly\");\n }\n\n for (const key of Object.keys(newProps)) {\n if (!(key in ignoreProps)) {\n if (!(key in oldProps)) {\n return \"\".concat(triggerName, \".\").concat(key, \" added\");\n }\n\n const changed = comparePropValues(newProps[key], oldProps[key], propTypes[key]);\n\n if (changed) {\n return \"\".concat(triggerName, \".\").concat(key, \" \").concat(changed);\n }\n }\n }\n\n for (const key of Object.keys(oldProps)) {\n if (!(key in ignoreProps)) {\n if (!(key in newProps)) {\n return \"\".concat(triggerName, \".\").concat(key, \" dropped\");\n }\n\n if (!Object.hasOwnProperty.call(newProps, key)) {\n const changed = comparePropValues(newProps[key], oldProps[key], propTypes[key]);\n\n if (changed) {\n return \"\".concat(triggerName, \".\").concat(key, \" \").concat(changed);\n }\n }\n }\n }\n\n return false;\n}\n\nfunction comparePropValues(newProp, oldProp, propType) {\n let equal = propType && propType.equal;\n\n if (equal && !equal(newProp, oldProp, propType)) {\n return 'changed deeply';\n }\n\n if (!equal) {\n equal = newProp && oldProp && newProp.equals;\n\n if (equal && !equal.call(newProp, oldProp)) {\n return 'changed deeply';\n }\n }\n\n if (!equal && oldProp !== newProp) {\n return 'changed shallowly';\n }\n\n return null;\n}\n\nfunction diffDataProps(props, oldProps) {\n if (oldProps === null) {\n return 'oldProps is null, initial diff';\n }\n\n let dataChanged = false;\n const {\n dataComparator,\n _dataDiff\n } = props;\n\n if (dataComparator) {\n if (!dataComparator(props.data, oldProps.data)) {\n dataChanged = 'Data comparator detected a change';\n }\n } else if (props.data !== oldProps.data) {\n dataChanged = 'A new data container was supplied';\n }\n\n if (dataChanged && _dataDiff) {\n dataChanged = _dataDiff(props.data, oldProps.data) || dataChanged;\n }\n\n return dataChanged;\n}\n\nfunction diffUpdateTriggers(props, oldProps) {\n if (oldProps === null) {\n return {\n all: true\n };\n }\n\n if ('all' in props.updateTriggers) {\n const diffReason = diffUpdateTrigger(props, oldProps, 'all');\n\n if (diffReason) {\n return {\n all: true\n };\n }\n }\n\n const reason = {};\n let changed = false;\n\n for (const triggerName in props.updateTriggers) {\n if (triggerName !== 'all') {\n const diffReason = diffUpdateTrigger(props, oldProps, triggerName);\n\n if (diffReason) {\n reason[triggerName] = true;\n changed = true;\n }\n }\n }\n\n return changed ? reason : false;\n}\n\nfunction diffExtensions(props, oldProps) {\n if (oldProps === null) {\n return true;\n }\n\n const oldExtensions = oldProps.extensions;\n const {\n extensions\n } = props;\n\n if (extensions === oldExtensions) {\n return false;\n }\n\n if (!oldExtensions || !extensions) {\n return true;\n }\n\n if (extensions.length !== oldExtensions.length) {\n return true;\n }\n\n for (let i = 0; i < extensions.length; i++) {\n if (!extensions[i].equals(oldExtensions[i])) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction diffUpdateTrigger(props, oldProps, triggerName) {\n let newTriggers = props.updateTriggers[triggerName];\n newTriggers = newTriggers === undefined || newTriggers === null ? {} : newTriggers;\n let oldTriggers = oldProps.updateTriggers[triggerName];\n oldTriggers = oldTriggers === undefined || oldTriggers === null ? {} : oldTriggers;\n const diffReason = compareProps({\n oldProps: oldTriggers,\n newProps: newTriggers,\n triggerName\n });\n return diffReason;\n}\n//# sourceMappingURL=props.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/lifecycle/props.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/passes/draw-layers-pass.js": +/*!************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/passes/draw-layers-pass.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ DrawLayersPass)\n/* harmony export */ });\n/* harmony import */ var _layers_pass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./layers-pass */ \"./node_modules/@deck.gl/core/dist/esm/passes/layers-pass.js\");\n\nclass DrawLayersPass extends _layers_pass__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n shouldDrawLayer(layer) {\n const {\n operation\n } = layer.props;\n return operation.includes('draw') || operation.includes('terrain');\n }\n\n}\n//# sourceMappingURL=draw-layers-pass.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/passes/draw-layers-pass.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/passes/layers-pass.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/passes/layers-pass.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ LayersPass),\n/* harmony export */ layerIndexResolver: () => (/* binding */ layerIndexResolver)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _pass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pass */ \"./node_modules/@deck.gl/core/dist/esm/passes/pass.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/clear.js\");\n\n\n\nclass LayersPass extends _pass__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(...args) {\n super(...args);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_lastRenderIndex\", -1);\n }\n\n render(options) {\n const gl = this.gl;\n (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__.setParameters)(gl, {\n framebuffer: options.target\n });\n return this._drawLayers(options);\n }\n\n _drawLayers(options) {\n const {\n target,\n moduleParameters,\n viewports,\n views,\n onViewportActive,\n clearStack = true,\n clearCanvas = true\n } = options;\n options.pass = options.pass || 'unknown';\n const gl = this.gl;\n\n if (clearCanvas) {\n clearGLCanvas(gl, target);\n }\n\n if (clearStack) {\n this._lastRenderIndex = -1;\n }\n\n const renderStats = [];\n\n for (const viewport of viewports) {\n const view = views && views[viewport.id];\n onViewportActive === null || onViewportActive === void 0 ? void 0 : onViewportActive(viewport);\n\n const drawLayerParams = this._getDrawLayerParams(viewport, options);\n\n const subViewports = viewport.subViewports || [viewport];\n\n for (const subViewport of subViewports) {\n const stats = this._drawLayersInViewport(gl, {\n target,\n moduleParameters,\n viewport: subViewport,\n view,\n pass: options.pass,\n layers: options.layers\n }, drawLayerParams);\n\n renderStats.push(stats);\n }\n }\n\n return renderStats;\n }\n\n _getDrawLayerParams(viewport, {\n layers,\n pass,\n isPicking = false,\n layerFilter,\n cullRect,\n effects,\n moduleParameters\n }, evaluateShouldDrawOnly = false) {\n const drawLayerParams = [];\n const indexResolver = layerIndexResolver(this._lastRenderIndex + 1);\n const drawContext = {\n layer: layers[0],\n viewport,\n isPicking,\n renderPass: pass,\n cullRect\n };\n const layerFilterCache = {};\n\n for (let layerIndex = 0; layerIndex < layers.length; layerIndex++) {\n const layer = layers[layerIndex];\n\n const shouldDrawLayer = this._shouldDrawLayer(layer, drawContext, layerFilter, layerFilterCache);\n\n const layerParam = {\n shouldDrawLayer\n };\n\n if (shouldDrawLayer && !evaluateShouldDrawOnly) {\n layerParam.layerRenderIndex = indexResolver(layer, shouldDrawLayer);\n layerParam.moduleParameters = this._getModuleParameters(layer, effects, pass, moduleParameters);\n layerParam.layerParameters = this.getLayerParameters(layer, layerIndex, viewport);\n }\n\n drawLayerParams[layerIndex] = layerParam;\n }\n\n return drawLayerParams;\n }\n\n _drawLayersInViewport(gl, {\n layers,\n moduleParameters: globalModuleParameters,\n pass,\n target,\n viewport,\n view\n }, drawLayerParams) {\n const glViewport = getGLViewport(gl, {\n moduleParameters: globalModuleParameters,\n target,\n viewport\n });\n\n if (view && view.props.clear) {\n const clearOpts = view.props.clear === true ? {\n color: true,\n depth: true\n } : view.props.clear;\n (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__.withParameters)(gl, {\n scissorTest: true,\n scissor: glViewport\n }, () => (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_3__.clear)(gl, clearOpts));\n }\n\n const renderStatus = {\n totalCount: layers.length,\n visibleCount: 0,\n compositeCount: 0,\n pickableCount: 0\n };\n (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__.setParameters)(gl, {\n viewport: glViewport\n });\n\n for (let layerIndex = 0; layerIndex < layers.length; layerIndex++) {\n const layer = layers[layerIndex];\n const {\n shouldDrawLayer,\n layerRenderIndex,\n moduleParameters,\n layerParameters\n } = drawLayerParams[layerIndex];\n\n if (shouldDrawLayer && layer.props.pickable) {\n renderStatus.pickableCount++;\n }\n\n if (layer.isComposite) {\n renderStatus.compositeCount++;\n } else if (shouldDrawLayer) {\n renderStatus.visibleCount++;\n this._lastRenderIndex = Math.max(this._lastRenderIndex, layerRenderIndex);\n moduleParameters.viewport = viewport;\n\n try {\n layer._drawLayer({\n moduleParameters,\n uniforms: {\n layerIndex: layerRenderIndex\n },\n parameters: layerParameters\n });\n } catch (err) {\n layer.raiseError(err, \"drawing \".concat(layer, \" to \").concat(pass));\n }\n }\n }\n\n return renderStatus;\n }\n\n shouldDrawLayer(layer) {\n return true;\n }\n\n getModuleParameters(layer, effects) {\n return null;\n }\n\n getLayerParameters(layer, layerIndex, viewport) {\n return layer.props.parameters;\n }\n\n _shouldDrawLayer(layer, drawContext, layerFilter, layerFilterCache) {\n const shouldDrawLayer = layer.props.visible && this.shouldDrawLayer(layer);\n\n if (!shouldDrawLayer) {\n return false;\n }\n\n drawContext.layer = layer;\n let parent = layer.parent;\n\n while (parent) {\n if (!parent.props.visible || !parent.filterSubLayer(drawContext)) {\n return false;\n }\n\n drawContext.layer = parent;\n parent = parent.parent;\n }\n\n if (layerFilter) {\n const rootLayerId = drawContext.layer.id;\n\n if (!(rootLayerId in layerFilterCache)) {\n layerFilterCache[rootLayerId] = layerFilter(drawContext);\n }\n\n if (!layerFilterCache[rootLayerId]) {\n return false;\n }\n }\n\n layer.activateViewport(drawContext.viewport);\n return true;\n }\n\n _getModuleParameters(layer, effects, pass, overrides) {\n var _layer$internalState;\n\n const moduleParameters = Object.assign(Object.create(((_layer$internalState = layer.internalState) === null || _layer$internalState === void 0 ? void 0 : _layer$internalState.propsInTransition) || layer.props), {\n autoWrapLongitude: layer.wrapLongitude,\n viewport: layer.context.viewport,\n mousePosition: layer.context.mousePosition,\n pickingActive: 0,\n devicePixelRatio: (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__.cssToDeviceRatio)(this.gl)\n });\n\n if (effects) {\n for (const effect of effects) {\n var _effect$getModulePara;\n\n Object.assign(moduleParameters, (_effect$getModulePara = effect.getModuleParameters) === null || _effect$getModulePara === void 0 ? void 0 : _effect$getModulePara.call(effect, layer));\n }\n }\n\n return Object.assign(moduleParameters, this.getModuleParameters(layer, effects), overrides);\n }\n\n}\nfunction layerIndexResolver(startIndex = 0, layerIndices = {}) {\n const resolvers = {};\n\n const resolveLayerIndex = (layer, isDrawn) => {\n const indexOverride = layer.props._offset;\n const layerId = layer.id;\n const parentId = layer.parent && layer.parent.id;\n let index;\n\n if (parentId && !(parentId in layerIndices)) {\n resolveLayerIndex(layer.parent, false);\n }\n\n if (parentId in resolvers) {\n const resolver = resolvers[parentId] = resolvers[parentId] || layerIndexResolver(layerIndices[parentId], layerIndices);\n index = resolver(layer, isDrawn);\n resolvers[layerId] = resolver;\n } else if (Number.isFinite(indexOverride)) {\n index = indexOverride + (layerIndices[parentId] || 0);\n resolvers[layerId] = null;\n } else {\n index = startIndex;\n }\n\n if (isDrawn && index >= startIndex) {\n startIndex = index + 1;\n }\n\n layerIndices[layerId] = index;\n return index;\n };\n\n return resolveLayerIndex;\n}\n\nfunction getGLViewport(gl, {\n moduleParameters,\n target,\n viewport\n}) {\n const useTarget = target && target.id !== 'default-framebuffer';\n const pixelRatio = moduleParameters && moduleParameters.devicePixelRatio || (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__.cssToDeviceRatio)(gl);\n const height = useTarget ? target.height : gl.drawingBufferHeight;\n const dimensions = viewport;\n return [dimensions.x * pixelRatio, height - (dimensions.y + dimensions.height) * pixelRatio, dimensions.width * pixelRatio, dimensions.height * pixelRatio];\n}\n\nfunction clearGLCanvas(gl, targetFramebuffer) {\n const width = targetFramebuffer ? targetFramebuffer.width : gl.drawingBufferWidth;\n const height = targetFramebuffer ? targetFramebuffer.height : gl.drawingBufferHeight;\n (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__.setParameters)(gl, {\n viewport: [0, 0, width, height]\n });\n gl.clear(16384 | 256);\n}\n//# sourceMappingURL=layers-pass.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/passes/layers-pass.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/passes/pass.js": +/*!************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/passes/pass.js ***! + \************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Pass)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n\nclass Pass {\n constructor(gl, props = {\n id: 'pass'\n }) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"id\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"gl\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"props\", void 0);\n\n const {\n id\n } = props;\n this.id = id;\n this.gl = gl;\n this.props = { ...props\n };\n }\n\n setProps(props) {\n Object.assign(this.props, props);\n }\n\n render(params) {}\n\n cleanup() {}\n\n}\n//# sourceMappingURL=pass.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/passes/pass.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/passes/pick-layers-pass.js": +/*!************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/passes/pick-layers-pass.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ PickLayersPass)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _layers_pass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./layers-pass */ \"./node_modules/@deck.gl/core/dist/esm/passes/layers-pass.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/log */ \"./node_modules/@deck.gl/core/dist/esm/utils/log.js\");\n\n\n\n\nconst PICKING_PARAMETERS = {\n blendFunc: [1, 0, 32771, 0],\n blendEquation: 32774\n};\nclass PickLayersPass extends _layers_pass__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(...args) {\n super(...args);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"pickZ\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_colorEncoderState\", null);\n }\n\n render(props) {\n if ('pickingFBO' in props) {\n return this._drawPickingBuffer(props);\n }\n\n return super.render(props);\n }\n\n _drawPickingBuffer({\n layers,\n layerFilter,\n views,\n viewports,\n onViewportActive,\n pickingFBO,\n deviceRect: {\n x,\n y,\n width,\n height\n },\n cullRect,\n effects,\n pass = 'picking',\n pickZ,\n moduleParameters\n }) {\n const gl = this.gl;\n this.pickZ = pickZ;\n\n const colorEncoderState = this._resetColorEncoder(pickZ);\n\n const renderStatus = (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__.withParameters)(gl, {\n scissorTest: true,\n scissor: [x, y, width, height],\n clearColor: [0, 0, 0, 0],\n depthMask: true,\n depthTest: true,\n depthRange: [0, 1],\n colorMask: [true, true, true, true],\n ...PICKING_PARAMETERS,\n blend: !pickZ\n }, () => super.render({\n target: pickingFBO,\n layers,\n layerFilter,\n views,\n viewports,\n onViewportActive,\n cullRect,\n effects: effects === null || effects === void 0 ? void 0 : effects.filter(e => e.useInPicking),\n pass,\n isPicking: true,\n moduleParameters\n }));\n this._colorEncoderState = null;\n const decodePickingColor = colorEncoderState && decodeColor.bind(null, colorEncoderState);\n return {\n decodePickingColor,\n stats: renderStatus\n };\n }\n\n shouldDrawLayer(layer) {\n const {\n pickable,\n operation\n } = layer.props;\n return pickable && operation.includes('draw') || operation.includes('terrain') || operation.includes('mask');\n }\n\n getModuleParameters() {\n return {\n pickingActive: 1,\n pickingAttribute: this.pickZ,\n lightSources: {}\n };\n }\n\n getLayerParameters(layer, layerIndex, viewport) {\n const pickParameters = { ...layer.props.parameters\n };\n const {\n pickable,\n operation\n } = layer.props;\n\n if (!this._colorEncoderState) {\n pickParameters.blend = false;\n } else if (pickable && operation.includes('draw')) {\n Object.assign(pickParameters, PICKING_PARAMETERS);\n pickParameters.blend = true;\n pickParameters.blendColor = encodeColor(this._colorEncoderState, layer, viewport);\n }\n\n if (operation.includes('terrain')) {\n pickParameters.blend = false;\n }\n\n return pickParameters;\n }\n\n _resetColorEncoder(pickZ) {\n this._colorEncoderState = pickZ ? null : {\n byLayer: new Map(),\n byAlpha: []\n };\n return this._colorEncoderState;\n }\n\n}\n\nfunction encodeColor(encoded, layer, viewport) {\n const {\n byLayer,\n byAlpha\n } = encoded;\n let a;\n let entry = byLayer.get(layer);\n\n if (entry) {\n entry.viewports.push(viewport);\n a = entry.a;\n } else {\n a = byLayer.size + 1;\n\n if (a <= 255) {\n entry = {\n a,\n layer,\n viewports: [viewport]\n };\n byLayer.set(layer, entry);\n byAlpha[a] = entry;\n } else {\n _utils_log__WEBPACK_IMPORTED_MODULE_3__[\"default\"].warn('Too many pickable layers, only picking the first 255')();\n a = 0;\n }\n }\n\n return [0, 0, 0, a / 255];\n}\n\nfunction decodeColor(encoded, pickedColor) {\n const entry = encoded.byAlpha[pickedColor[3]];\n return entry && {\n pickedLayer: entry.layer,\n pickedViewports: entry.viewports,\n pickedObjectIndex: entry.layer.decodePickingColor(pickedColor)\n };\n}\n//# sourceMappingURL=pick-layers-pass.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/passes/pick-layers-pass.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/passes/shadow-pass.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/passes/shadow-pass.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ShadowPass)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _layers_pass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./layers-pass */ \"./node_modules/@deck.gl/core/dist/esm/passes/layers-pass.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture-2d.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/renderbuffer.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/framebuffer.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n\n\n\nclass ShadowPass extends _layers_pass__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(gl, props) {\n super(gl, props);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"shadowMap\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"depthBuffer\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"fbo\", void 0);\n\n this.shadowMap = new _luma_gl_core__WEBPACK_IMPORTED_MODULE_2__[\"default\"](gl, {\n width: 1,\n height: 1,\n parameters: {\n [10241]: 9729,\n [10240]: 9729,\n [10242]: 33071,\n [10243]: 33071\n }\n });\n this.depthBuffer = new _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"](gl, {\n format: 33189,\n width: 1,\n height: 1\n });\n this.fbo = new _luma_gl_core__WEBPACK_IMPORTED_MODULE_4__[\"default\"](gl, {\n id: 'shadowmap',\n width: 1,\n height: 1,\n attachments: {\n [36064]: this.shadowMap,\n [36096]: this.depthBuffer\n }\n });\n }\n\n render(params) {\n const target = this.fbo;\n (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_5__.withParameters)(this.gl, {\n depthRange: [0, 1],\n depthTest: true,\n blend: false,\n clearColor: [1, 1, 1, 1]\n }, () => {\n const viewport = params.viewports[0];\n const pixelRatio = (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_5__.cssToDeviceRatio)(this.gl);\n const width = viewport.width * pixelRatio;\n const height = viewport.height * pixelRatio;\n\n if (width !== target.width || height !== target.height) {\n target.resize({\n width,\n height\n });\n }\n\n super.render({ ...params,\n target,\n pass: 'shadow'\n });\n });\n }\n\n shouldDrawLayer(layer) {\n return layer.props.shadowEnabled !== false;\n }\n\n getModuleParameters() {\n return {\n drawToShadowMap: true\n };\n }\n\n delete() {\n if (this.fbo) {\n this.fbo.delete();\n this.fbo = null;\n }\n\n if (this.shadowMap) {\n this.shadowMap.delete();\n this.shadowMap = null;\n }\n\n if (this.depthBuffer) {\n this.depthBuffer.delete();\n this.depthBuffer = null;\n }\n }\n\n}\n//# sourceMappingURL=shadow-pass.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/passes/shadow-pass.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/shaderlib/index.js": +/*!****************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/shaderlib/index.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createProgramManager: () => (/* binding */ createProgramManager),\n/* harmony export */ gouraudLighting: () => (/* reexport safe */ _luma_gl_core__WEBPACK_IMPORTED_MODULE_4__.gouraudLighting),\n/* harmony export */ phongLighting: () => (/* reexport safe */ _luma_gl_core__WEBPACK_IMPORTED_MODULE_4__.phongLighting),\n/* harmony export */ picking: () => (/* reexport safe */ _picking_picking__WEBPACK_IMPORTED_MODULE_2__[\"default\"]),\n/* harmony export */ project: () => (/* reexport safe */ _project_project__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ project32: () => (/* reexport safe */ _project32_project32__WEBPACK_IMPORTED_MODULE_3__[\"default\"]),\n/* harmony export */ shadow: () => (/* reexport safe */ _shadow_shadow__WEBPACK_IMPORTED_MODULE_5__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/engine/dist/esm/lib/program-manager.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/shadertools/dist/esm/modules/phong-lighting/phong-lighting.js\");\n/* harmony import */ var _project_project__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./project/project */ \"./node_modules/@deck.gl/core/dist/esm/shaderlib/project/project.js\");\n/* harmony import */ var _project32_project32__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./project32/project32 */ \"./node_modules/@deck.gl/core/dist/esm/shaderlib/project32/project32.js\");\n/* harmony import */ var _shadow_shadow__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./shadow/shadow */ \"./node_modules/@deck.gl/core/dist/esm/shaderlib/shadow/shadow.js\");\n/* harmony import */ var _picking_picking__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./picking/picking */ \"./node_modules/@deck.gl/core/dist/esm/shaderlib/picking/picking.js\");\n\n\n\n\n\n\nconst DEFAULT_MODULES = [_project_project__WEBPACK_IMPORTED_MODULE_0__[\"default\"]];\nconst SHADER_HOOKS = ['vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)', 'vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)', 'vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)', 'fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)'];\nfunction createProgramManager(gl) {\n const programManager = _luma_gl_core__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getDefaultProgramManager(gl);\n\n for (const shaderModule of DEFAULT_MODULES) {\n programManager.addDefaultModule(shaderModule);\n }\n\n for (const shaderHook of SHADER_HOOKS) {\n programManager.addShaderHook(shaderHook);\n }\n\n return programManager;\n}\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/shaderlib/index.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/shaderlib/misc/geometry.js": +/*!************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/shaderlib/misc/geometry.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nconst defines = '#define SMOOTH_EDGE_RADIUS 0.5';\nconst vs = \"\\n\".concat(defines, \"\\n\\nstruct VertexGeometry {\\n vec4 position;\\n vec3 worldPosition;\\n vec3 worldPositionAlt;\\n vec3 normal;\\n vec2 uv;\\n vec3 pickingColor;\\n} geometry = VertexGeometry(\\n vec4(0.0, 0.0, 1.0, 0.0),\\n vec3(0.0),\\n vec3(0.0),\\n vec3(0.0),\\n vec2(0.0),\\n vec3(0.0)\\n);\\n\");\nconst fs = \"\\n\".concat(defines, \"\\n\\nstruct FragmentGeometry {\\n vec2 uv;\\n} geometry;\\n\\nfloat smoothedge(float edge, float x) {\\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\\n}\\n\");\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n name: 'geometry',\n vs,\n fs\n});\n//# sourceMappingURL=geometry.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/shaderlib/misc/geometry.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/shaderlib/picking/picking.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/shaderlib/picking/picking.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/shadertools/dist/esm/modules/picking/picking.js\");\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n inject: {\n 'vs:DECKGL_FILTER_GL_POSITION': \"\\n // for picking depth values\\n picking_setPickingAttribute(position.z / position.w);\\n \",\n 'vs:DECKGL_FILTER_COLOR': \"\\n picking_setPickingColor(geometry.pickingColor);\\n \",\n 'fs:#decl': \"\\nuniform bool picking_uAttribute;\\n \",\n 'fs:DECKGL_FILTER_COLOR': {\n order: 99,\n injection: \"\\n // use highlight color if this fragment belongs to the selected object.\\n color = picking_filterHighlightColor(color);\\n\\n // use picking color if rendering to picking FBO.\\n color = picking_filterPickingColor(color);\\n \"\n }\n },\n ..._luma_gl_core__WEBPACK_IMPORTED_MODULE_0__.picking\n});\n//# sourceMappingURL=picking.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/shaderlib/picking/picking.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/shaderlib/project/project-functions.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/shaderlib/project/project-functions.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getWorldPosition: () => (/* binding */ getWorldPosition),\n/* harmony export */ projectPosition: () => (/* binding */ projectPosition)\n/* harmony export */ });\n/* harmony import */ var _lib_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/@deck.gl/core/dist/esm/lib/constants.js\");\n/* harmony import */ var _viewport_uniforms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./viewport-uniforms */ \"./node_modules/@deck.gl/core/dist/esm/shaderlib/project/viewport-uniforms.js\");\n/* harmony import */ var _viewports_web_mercator_viewport__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../viewports/web-mercator-viewport */ \"./node_modules/@deck.gl/core/dist/esm/viewports/web-mercator-viewport.js\");\n/* harmony import */ var gl_matrix_vec4__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! gl-matrix/vec4 */ \"./node_modules/gl-matrix/esm/vec4.js\");\n/* harmony import */ var gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! gl-matrix/vec3 */ \"./node_modules/gl-matrix/esm/vec3.js\");\n/* harmony import */ var _math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @math.gl/web-mercator */ \"./node_modules/@math.gl/web-mercator/dist/esm/index.js\");\n\n\n\n\n\n\nconst DEFAULT_COORDINATE_ORIGIN = [0, 0, 0];\n\nfunction lngLatZToWorldPosition(lngLatZ, viewport, offsetMode = false) {\n const p = viewport.projectPosition(lngLatZ);\n\n if (offsetMode && viewport instanceof _viewports_web_mercator_viewport__WEBPACK_IMPORTED_MODULE_1__[\"default\"]) {\n const [longitude, latitude, z = 0] = lngLatZ;\n const distanceScales = viewport.getDistanceScales([longitude, latitude]);\n p[2] = z * distanceScales.unitsPerMeter[2];\n }\n\n return p;\n}\n\nfunction normalizeParameters(opts) {\n const {\n viewport,\n modelMatrix,\n coordinateOrigin\n } = opts;\n let {\n coordinateSystem,\n fromCoordinateSystem,\n fromCoordinateOrigin\n } = opts;\n\n if (coordinateSystem === _lib_constants__WEBPACK_IMPORTED_MODULE_2__.COORDINATE_SYSTEM.DEFAULT) {\n coordinateSystem = viewport.isGeospatial ? _lib_constants__WEBPACK_IMPORTED_MODULE_2__.COORDINATE_SYSTEM.LNGLAT : _lib_constants__WEBPACK_IMPORTED_MODULE_2__.COORDINATE_SYSTEM.CARTESIAN;\n }\n\n if (fromCoordinateSystem === undefined) {\n fromCoordinateSystem = coordinateSystem;\n }\n\n if (fromCoordinateOrigin === undefined) {\n fromCoordinateOrigin = coordinateOrigin;\n }\n\n return {\n viewport,\n coordinateSystem,\n coordinateOrigin,\n modelMatrix,\n fromCoordinateSystem,\n fromCoordinateOrigin\n };\n}\n\nfunction getWorldPosition(position, {\n viewport,\n modelMatrix,\n coordinateSystem,\n coordinateOrigin,\n offsetMode\n}) {\n let [x, y, z = 0] = position;\n\n if (modelMatrix) {\n [x, y, z] = gl_matrix_vec4__WEBPACK_IMPORTED_MODULE_3__.transformMat4([], [x, y, z, 1.0], modelMatrix);\n }\n\n switch (coordinateSystem) {\n case _lib_constants__WEBPACK_IMPORTED_MODULE_2__.COORDINATE_SYSTEM.LNGLAT:\n return lngLatZToWorldPosition([x, y, z], viewport, offsetMode);\n\n case _lib_constants__WEBPACK_IMPORTED_MODULE_2__.COORDINATE_SYSTEM.LNGLAT_OFFSETS:\n return lngLatZToWorldPosition([x + coordinateOrigin[0], y + coordinateOrigin[1], z + (coordinateOrigin[2] || 0)], viewport, offsetMode);\n\n case _lib_constants__WEBPACK_IMPORTED_MODULE_2__.COORDINATE_SYSTEM.METER_OFFSETS:\n return lngLatZToWorldPosition((0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_0__.addMetersToLngLat)(coordinateOrigin, [x, y, z]), viewport, offsetMode);\n\n case _lib_constants__WEBPACK_IMPORTED_MODULE_2__.COORDINATE_SYSTEM.CARTESIAN:\n default:\n return viewport.isGeospatial ? [x + coordinateOrigin[0], y + coordinateOrigin[1], z + coordinateOrigin[2]] : viewport.projectPosition([x, y, z]);\n }\n}\nfunction projectPosition(position, params) {\n const {\n viewport,\n coordinateSystem,\n coordinateOrigin,\n modelMatrix,\n fromCoordinateSystem,\n fromCoordinateOrigin\n } = normalizeParameters(params);\n const {\n autoOffset = true\n } = params;\n const {\n geospatialOrigin = DEFAULT_COORDINATE_ORIGIN,\n shaderCoordinateOrigin = DEFAULT_COORDINATE_ORIGIN,\n offsetMode = false\n } = autoOffset ? (0,_viewport_uniforms__WEBPACK_IMPORTED_MODULE_4__.getOffsetOrigin)(viewport, coordinateSystem, coordinateOrigin) : {};\n const worldPosition = getWorldPosition(position, {\n viewport,\n modelMatrix,\n coordinateSystem: fromCoordinateSystem,\n coordinateOrigin: fromCoordinateOrigin,\n offsetMode\n });\n\n if (offsetMode) {\n const positionCommonSpace = viewport.projectPosition(geospatialOrigin || shaderCoordinateOrigin);\n gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_5__.sub(worldPosition, worldPosition, positionCommonSpace);\n }\n\n return worldPosition;\n}\n//# sourceMappingURL=project-functions.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/shaderlib/project/project-functions.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/shaderlib/project/project.glsl.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/shaderlib/project/project.glsl.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _lib_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/@deck.gl/core/dist/esm/lib/constants.js\");\n\nconst COORDINATE_SYSTEM_GLSL_CONSTANTS = Object.keys(_lib_constants__WEBPACK_IMPORTED_MODULE_0__.COORDINATE_SYSTEM).map(key => \"const int COORDINATE_SYSTEM_\".concat(key, \" = \").concat(_lib_constants__WEBPACK_IMPORTED_MODULE_0__.COORDINATE_SYSTEM[key], \";\")).join('');\nconst PROJECTION_MODE_GLSL_CONSTANTS = Object.keys(_lib_constants__WEBPACK_IMPORTED_MODULE_0__.PROJECTION_MODE).map(key => \"const int PROJECTION_MODE_\".concat(key, \" = \").concat(_lib_constants__WEBPACK_IMPORTED_MODULE_0__.PROJECTION_MODE[key], \";\")).join('');\nconst UNIT_GLSL_CONSTANTS = Object.keys(_lib_constants__WEBPACK_IMPORTED_MODULE_0__.UNIT).map(key => \"const int UNIT_\".concat(key.toUpperCase(), \" = \").concat(_lib_constants__WEBPACK_IMPORTED_MODULE_0__.UNIT[key], \";\")).join('');\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (\"\".concat(COORDINATE_SYSTEM_GLSL_CONSTANTS, \"\\n\").concat(PROJECTION_MODE_GLSL_CONSTANTS, \"\\n\").concat(UNIT_GLSL_CONSTANTS, \"\\n\\nuniform int project_uCoordinateSystem;\\nuniform int project_uProjectionMode;\\nuniform float project_uScale;\\nuniform bool project_uWrapLongitude;\\nuniform vec3 project_uCommonUnitsPerMeter;\\nuniform vec3 project_uCommonUnitsPerWorldUnit;\\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\\nuniform vec4 project_uCenter;\\nuniform mat4 project_uModelMatrix;\\nuniform mat4 project_uViewProjectionMatrix;\\nuniform vec2 project_uViewportSize;\\nuniform float project_uDevicePixelRatio;\\nuniform float project_uFocalDistance;\\nuniform vec3 project_uCameraPosition;\\nuniform vec3 project_uCoordinateOrigin;\\nuniform vec3 project_uCommonOrigin;\\nuniform bool project_uPseudoMeters;\\n\\nconst float TILE_SIZE = 512.0;\\nconst float PI = 3.1415926536;\\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\\nconst vec3 ZERO_64_LOW = vec3(0.0);\\nconst float EARTH_RADIUS = 6370972.0;\\nconst float GLOBE_RADIUS = 256.0;\\nfloat project_size_at_latitude(float lat) {\\n float y = clamp(lat, -89.9, 89.9);\\n return 1.0 / cos(radians(y));\\n}\\n\\nfloat project_size() {\\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR &&\\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT &&\\n project_uPseudoMeters == false) {\\n \\n if (geometry.position.w == 0.0) {\\n return project_size_at_latitude(geometry.worldPosition.y);\\n }\\n \\n float y = geometry.position.y / TILE_SIZE * 2.0 - 1.0;\\n float y2 = y * y;\\n float y4 = y2 * y2;\\n float y6 = y4 * y2;\\n return 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6;\\n }\\n return 1.0;\\n}\\n\\nfloat project_size_at_latitude(float meters, float lat) {\\n return meters * project_uCommonUnitsPerMeter.z * project_size_at_latitude(lat);\\n}\\nfloat project_size(float meters) {\\n return meters * project_uCommonUnitsPerMeter.z * project_size();\\n}\\n\\nvec2 project_size(vec2 meters) {\\n return meters * project_uCommonUnitsPerMeter.xy * project_size();\\n}\\n\\nvec3 project_size(vec3 meters) {\\n return meters * project_uCommonUnitsPerMeter * project_size();\\n}\\n\\nvec4 project_size(vec4 meters) {\\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\\n}\\nmat3 project_get_orientation_matrix(vec3 up) {\\n vec3 uz = normalize(up);\\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\\n vec3 uy = cross(uz, ux);\\n return mat3(ux, uy, uz);\\n}\\n\\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\\n transform = project_get_orientation_matrix(commonPosition);\\n return true;\\n }\\n return false;\\n}\\nvec3 project_normal(vec3 vector) {\\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\\n vec3 n = normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\\n mat3 rotation;\\n if (project_needs_rotation(geometry.position.xyz, rotation)) {\\n n = rotation * n;\\n }\\n return n;\\n}\\n\\nvec4 project_offset_(vec4 offset) {\\n float dy = offset.y;\\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\\n}\\nvec2 project_mercator_(vec2 lnglat) {\\n float x = lnglat.x;\\n if (project_uWrapLongitude) {\\n x = mod(x + 180., 360.0) - 180.;\\n }\\n float y = clamp(lnglat.y, -89.9, 89.9);\\n return vec2(\\n radians(x) + PI,\\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\\n ) * WORLD_SCALE;\\n}\\n\\nvec3 project_globe_(vec3 lnglatz) {\\n float lambda = radians(lnglatz.x);\\n float phi = radians(lnglatz.y);\\n float cosPhi = cos(phi);\\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\\n\\n return vec3(\\n sin(lambda) * cosPhi,\\n -cos(lambda) * cosPhi,\\n sin(phi)\\n ) * D;\\n}\\nvec4 project_position(vec4 position, vec3 position64Low) {\\n vec4 position_world = project_uModelMatrix * position;\\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\\n return vec4(\\n project_mercator_(position_world.xy),\\n project_size_at_latitude(position_world.z, position_world.y),\\n position_world.w\\n );\\n }\\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\\n position_world.xyz += project_uCoordinateOrigin;\\n }\\n }\\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\\n return vec4(\\n project_globe_(position_world.xyz),\\n position_world.w\\n );\\n }\\n }\\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\\n return vec4(\\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\\n project_size(position_world.z),\\n position_world.w\\n );\\n }\\n }\\n }\\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\\n position_world.xyz -= project_uCoordinateOrigin;\\n }\\n return project_offset_(position_world) + project_offset_(project_uModelMatrix * vec4(position64Low, 0.0));\\n}\\n\\nvec4 project_position(vec4 position) {\\n return project_position(position, ZERO_64_LOW);\\n}\\n\\nvec3 project_position(vec3 position, vec3 position64Low) {\\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\\n return projected_position.xyz;\\n}\\n\\nvec3 project_position(vec3 position) {\\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\\n return projected_position.xyz;\\n}\\n\\nvec2 project_position(vec2 position) {\\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\\n return projected_position.xy;\\n}\\n\\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\\n return viewProjectionMatrix * position + center;\\n}\\nvec4 project_common_position_to_clipspace(vec4 position) {\\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\\n}\\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\\n return offset * project_uFocalDistance;\\n}\\n\\nfloat project_size_to_pixel(float meters) {\\n return project_size(meters) * project_uScale;\\n}\\nfloat project_size_to_pixel(float size, int unit) {\\n if (unit == UNIT_METERS) return project_size_to_pixel(size);\\n if (unit == UNIT_COMMON) return size * project_uScale;\\n return size;\\n}\\nfloat project_pixel_size(float pixels) {\\n return pixels / project_uScale;\\n}\\nvec2 project_pixel_size(vec2 pixels) {\\n return pixels / project_uScale;\\n}\\n\"));\n//# sourceMappingURL=project.glsl.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/shaderlib/project/project.glsl.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/shaderlib/project/project.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/shaderlib/project/project.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/shadertools/dist/esm/modules/fp32/fp32.js\");\n/* harmony import */ var _misc_geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../misc/geometry */ \"./node_modules/@deck.gl/core/dist/esm/shaderlib/misc/geometry.js\");\n/* harmony import */ var _project_glsl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./project.glsl */ \"./node_modules/@deck.gl/core/dist/esm/shaderlib/project/project.glsl.js\");\n/* harmony import */ var _viewport_uniforms__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./viewport-uniforms */ \"./node_modules/@deck.gl/core/dist/esm/shaderlib/project/viewport-uniforms.js\");\n\n\n\n\nconst INITIAL_MODULE_OPTIONS = {};\n\nfunction getUniforms(opts = INITIAL_MODULE_OPTIONS) {\n if ('viewport' in opts) {\n return (0,_viewport_uniforms__WEBPACK_IMPORTED_MODULE_0__.getUniformsFromViewport)(opts);\n }\n\n return {};\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n name: 'project',\n dependencies: [_luma_gl_core__WEBPACK_IMPORTED_MODULE_1__.fp32, _misc_geometry__WEBPACK_IMPORTED_MODULE_2__[\"default\"]],\n vs: _project_glsl__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n getUniforms\n});\n//# sourceMappingURL=project.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/shaderlib/project/project.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/shaderlib/project/viewport-uniforms.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/shaderlib/project/viewport-uniforms.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getOffsetOrigin: () => (/* binding */ getOffsetOrigin),\n/* harmony export */ getUniformsFromViewport: () => (/* binding */ getUniformsFromViewport)\n/* harmony export */ });\n/* harmony import */ var gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! gl-matrix/mat4 */ \"./node_modules/gl-matrix/esm/mat4.js\");\n/* harmony import */ var gl_matrix_vec4__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gl-matrix/vec4 */ \"./node_modules/gl-matrix/esm/vec4.js\");\n/* harmony import */ var _lib_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/@deck.gl/core/dist/esm/lib/constants.js\");\n/* harmony import */ var _utils_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/memoize */ \"./node_modules/@deck.gl/core/dist/esm/utils/memoize.js\");\n\n\n\n\nconst ZERO_VECTOR = [0, 0, 0, 0];\nconst VECTOR_TO_POINT_MATRIX = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0];\nconst IDENTITY_MATRIX = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\nconst DEFAULT_PIXELS_PER_UNIT2 = [0, 0, 0];\nconst DEFAULT_COORDINATE_ORIGIN = [0, 0, 0];\nconst getMemoizedViewportUniforms = (0,_utils_memoize__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(calculateViewportUniforms);\nfunction getOffsetOrigin(viewport, coordinateSystem, coordinateOrigin = DEFAULT_COORDINATE_ORIGIN) {\n if (coordinateOrigin.length < 3) {\n coordinateOrigin = [coordinateOrigin[0], coordinateOrigin[1], 0];\n }\n\n let shaderCoordinateOrigin = coordinateOrigin;\n let geospatialOrigin;\n let offsetMode = true;\n\n if (coordinateSystem === _lib_constants__WEBPACK_IMPORTED_MODULE_1__.COORDINATE_SYSTEM.LNGLAT_OFFSETS || coordinateSystem === _lib_constants__WEBPACK_IMPORTED_MODULE_1__.COORDINATE_SYSTEM.METER_OFFSETS) {\n geospatialOrigin = coordinateOrigin;\n } else {\n geospatialOrigin = viewport.isGeospatial ? [Math.fround(viewport.longitude), Math.fround(viewport.latitude), 0] : null;\n }\n\n switch (viewport.projectionMode) {\n case _lib_constants__WEBPACK_IMPORTED_MODULE_1__.PROJECTION_MODE.WEB_MERCATOR:\n if (coordinateSystem === _lib_constants__WEBPACK_IMPORTED_MODULE_1__.COORDINATE_SYSTEM.LNGLAT || coordinateSystem === _lib_constants__WEBPACK_IMPORTED_MODULE_1__.COORDINATE_SYSTEM.CARTESIAN) {\n geospatialOrigin = [0, 0, 0];\n offsetMode = false;\n }\n\n break;\n\n case _lib_constants__WEBPACK_IMPORTED_MODULE_1__.PROJECTION_MODE.WEB_MERCATOR_AUTO_OFFSET:\n if (coordinateSystem === _lib_constants__WEBPACK_IMPORTED_MODULE_1__.COORDINATE_SYSTEM.LNGLAT) {\n shaderCoordinateOrigin = geospatialOrigin;\n } else if (coordinateSystem === _lib_constants__WEBPACK_IMPORTED_MODULE_1__.COORDINATE_SYSTEM.CARTESIAN) {\n shaderCoordinateOrigin = [Math.fround(viewport.center[0]), Math.fround(viewport.center[1]), 0];\n geospatialOrigin = viewport.unprojectPosition(shaderCoordinateOrigin);\n shaderCoordinateOrigin[0] -= coordinateOrigin[0];\n shaderCoordinateOrigin[1] -= coordinateOrigin[1];\n shaderCoordinateOrigin[2] -= coordinateOrigin[2];\n }\n\n break;\n\n case _lib_constants__WEBPACK_IMPORTED_MODULE_1__.PROJECTION_MODE.IDENTITY:\n shaderCoordinateOrigin = viewport.position.map(Math.fround);\n shaderCoordinateOrigin[2] = shaderCoordinateOrigin[2] || 0;\n break;\n\n case _lib_constants__WEBPACK_IMPORTED_MODULE_1__.PROJECTION_MODE.GLOBE:\n offsetMode = false;\n geospatialOrigin = null;\n break;\n\n default:\n offsetMode = false;\n }\n\n return {\n geospatialOrigin,\n shaderCoordinateOrigin,\n offsetMode\n };\n}\n\nfunction calculateMatrixAndOffset(viewport, coordinateSystem, coordinateOrigin) {\n const {\n viewMatrixUncentered,\n projectionMatrix\n } = viewport;\n let {\n viewMatrix,\n viewProjectionMatrix\n } = viewport;\n let projectionCenter = ZERO_VECTOR;\n let originCommon = ZERO_VECTOR;\n let cameraPosCommon = viewport.cameraPosition;\n const {\n geospatialOrigin,\n shaderCoordinateOrigin,\n offsetMode\n } = getOffsetOrigin(viewport, coordinateSystem, coordinateOrigin);\n\n if (offsetMode) {\n originCommon = viewport.projectPosition(geospatialOrigin || shaderCoordinateOrigin);\n cameraPosCommon = [cameraPosCommon[0] - originCommon[0], cameraPosCommon[1] - originCommon[1], cameraPosCommon[2] - originCommon[2]];\n originCommon[3] = 1;\n projectionCenter = gl_matrix_vec4__WEBPACK_IMPORTED_MODULE_2__.transformMat4([], originCommon, viewProjectionMatrix);\n viewMatrix = viewMatrixUncentered || viewMatrix;\n viewProjectionMatrix = gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_3__.multiply([], projectionMatrix, viewMatrix);\n viewProjectionMatrix = gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_3__.multiply([], viewProjectionMatrix, VECTOR_TO_POINT_MATRIX);\n }\n\n return {\n viewMatrix,\n viewProjectionMatrix,\n projectionCenter,\n originCommon,\n cameraPosCommon,\n shaderCoordinateOrigin,\n geospatialOrigin\n };\n}\n\nfunction getUniformsFromViewport({\n viewport,\n devicePixelRatio = 1,\n modelMatrix = null,\n coordinateSystem = _lib_constants__WEBPACK_IMPORTED_MODULE_1__.COORDINATE_SYSTEM.DEFAULT,\n coordinateOrigin = DEFAULT_COORDINATE_ORIGIN,\n autoWrapLongitude = false\n}) {\n if (coordinateSystem === _lib_constants__WEBPACK_IMPORTED_MODULE_1__.COORDINATE_SYSTEM.DEFAULT) {\n coordinateSystem = viewport.isGeospatial ? _lib_constants__WEBPACK_IMPORTED_MODULE_1__.COORDINATE_SYSTEM.LNGLAT : _lib_constants__WEBPACK_IMPORTED_MODULE_1__.COORDINATE_SYSTEM.CARTESIAN;\n }\n\n const uniforms = getMemoizedViewportUniforms({\n viewport,\n devicePixelRatio,\n coordinateSystem,\n coordinateOrigin\n });\n uniforms.project_uWrapLongitude = autoWrapLongitude;\n uniforms.project_uModelMatrix = modelMatrix || IDENTITY_MATRIX;\n return uniforms;\n}\n\nfunction calculateViewportUniforms({\n viewport,\n devicePixelRatio,\n coordinateSystem,\n coordinateOrigin\n}) {\n const {\n projectionCenter,\n viewProjectionMatrix,\n originCommon,\n cameraPosCommon,\n shaderCoordinateOrigin,\n geospatialOrigin\n } = calculateMatrixAndOffset(viewport, coordinateSystem, coordinateOrigin);\n const distanceScales = viewport.getDistanceScales();\n const viewportSize = [viewport.width * devicePixelRatio, viewport.height * devicePixelRatio];\n const focalDistance = gl_matrix_vec4__WEBPACK_IMPORTED_MODULE_2__.transformMat4([], [0, 0, -viewport.focalDistance, 1], viewport.projectionMatrix)[3] || 1;\n const uniforms = {\n project_uCoordinateSystem: coordinateSystem,\n project_uProjectionMode: viewport.projectionMode,\n project_uCoordinateOrigin: shaderCoordinateOrigin,\n project_uCommonOrigin: originCommon.slice(0, 3),\n project_uCenter: projectionCenter,\n project_uPseudoMeters: Boolean(viewport._pseudoMeters),\n project_uViewportSize: viewportSize,\n project_uDevicePixelRatio: devicePixelRatio,\n project_uFocalDistance: focalDistance,\n project_uCommonUnitsPerMeter: distanceScales.unitsPerMeter,\n project_uCommonUnitsPerWorldUnit: distanceScales.unitsPerMeter,\n project_uCommonUnitsPerWorldUnit2: DEFAULT_PIXELS_PER_UNIT2,\n project_uScale: viewport.scale,\n project_uWrapLongitude: false,\n project_uViewProjectionMatrix: viewProjectionMatrix,\n project_uModelMatrix: IDENTITY_MATRIX,\n project_uCameraPosition: cameraPosCommon\n };\n\n if (geospatialOrigin) {\n const distanceScalesAtOrigin = viewport.getDistanceScales(geospatialOrigin);\n\n switch (coordinateSystem) {\n case _lib_constants__WEBPACK_IMPORTED_MODULE_1__.COORDINATE_SYSTEM.METER_OFFSETS:\n uniforms.project_uCommonUnitsPerWorldUnit = distanceScalesAtOrigin.unitsPerMeter;\n uniforms.project_uCommonUnitsPerWorldUnit2 = distanceScalesAtOrigin.unitsPerMeter2;\n break;\n\n case _lib_constants__WEBPACK_IMPORTED_MODULE_1__.COORDINATE_SYSTEM.LNGLAT:\n case _lib_constants__WEBPACK_IMPORTED_MODULE_1__.COORDINATE_SYSTEM.LNGLAT_OFFSETS:\n if (!viewport._pseudoMeters) {\n uniforms.project_uCommonUnitsPerMeter = distanceScalesAtOrigin.unitsPerMeter;\n }\n\n uniforms.project_uCommonUnitsPerWorldUnit = distanceScalesAtOrigin.unitsPerDegree;\n uniforms.project_uCommonUnitsPerWorldUnit2 = distanceScalesAtOrigin.unitsPerDegree2;\n break;\n\n case _lib_constants__WEBPACK_IMPORTED_MODULE_1__.COORDINATE_SYSTEM.CARTESIAN:\n uniforms.project_uCommonUnitsPerWorldUnit = [1, 1, distanceScalesAtOrigin.unitsPerMeter[2]];\n uniforms.project_uCommonUnitsPerWorldUnit2 = [0, 0, distanceScalesAtOrigin.unitsPerMeter2[2]];\n break;\n\n default:\n break;\n }\n }\n\n return uniforms;\n}\n//# sourceMappingURL=viewport-uniforms.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/shaderlib/project/viewport-uniforms.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/shaderlib/project32/project32.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/shaderlib/project32/project32.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _project_project__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../project/project */ \"./node_modules/@deck.gl/core/dist/esm/shaderlib/project/project.js\");\n\nconst vs = \"\\nvec4 project_position_to_clipspace(\\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\\n) {\\n vec3 projectedPosition = project_position(position, position64Low);\\n mat3 rotation;\\n if (project_needs_rotation(projectedPosition, rotation)) {\\n // offset is specified as ENU\\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\\n offset = rotation * offset;\\n }\\n commonPosition = vec4(projectedPosition + offset, 1.0);\\n return project_common_position_to_clipspace(commonPosition);\\n}\\n\\nvec4 project_position_to_clipspace(\\n vec3 position, vec3 position64Low, vec3 offset\\n) {\\n vec4 commonPosition;\\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\\n}\\n\";\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n name: 'project32',\n dependencies: [_project_project__WEBPACK_IMPORTED_MODULE_0__[\"default\"]],\n vs\n});\n//# sourceMappingURL=project32.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/shaderlib/project32/project32.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/shaderlib/shadow/shadow.js": +/*!************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/shaderlib/shadow/shadow.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _lib_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/@deck.gl/core/dist/esm/lib/constants.js\");\n/* harmony import */ var _project_project__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../project/project */ \"./node_modules/@deck.gl/core/dist/esm/shaderlib/project/project.js\");\n/* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @math.gl/core */ \"./node_modules/@math.gl/core/dist/esm/classes/matrix4.js\");\n/* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @math.gl/core */ \"./node_modules/@math.gl/core/dist/esm/classes/vector3.js\");\n/* harmony import */ var _utils_memoize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/memoize */ \"./node_modules/@deck.gl/core/dist/esm/utils/memoize.js\");\n/* harmony import */ var _math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @math.gl/web-mercator */ \"./node_modules/@math.gl/web-mercator/dist/esm/index.js\");\n\n\n\n\n\nconst vs = \"\\nconst int max_lights = 2;\\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\\nuniform vec4 shadow_uProjectCenters[max_lights];\\nuniform bool shadow_uDrawShadowMap;\\nuniform bool shadow_uUseShadowMap;\\nuniform int shadow_uLightId;\\nuniform float shadow_uLightCount;\\n\\nvarying vec3 shadow_vPosition[max_lights];\\n\\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\\n if (shadow_uDrawShadowMap) {\\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\\n }\\n if (shadow_uUseShadowMap) {\\n for (int i = 0; i < max_lights; i++) {\\n if(i < int(shadow_uLightCount)) {\\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\\n }\\n }\\n }\\n return gl_Position;\\n}\\n\";\nconst fs = \"\\nconst int max_lights = 2;\\nuniform bool shadow_uDrawShadowMap;\\nuniform bool shadow_uUseShadowMap;\\nuniform sampler2D shadow_uShadowMap0;\\nuniform sampler2D shadow_uShadowMap1;\\nuniform vec4 shadow_uColor;\\nuniform float shadow_uLightCount;\\n\\nvarying vec3 shadow_vPosition[max_lights];\\n\\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\\n\\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\\n\\n float z = dot(rgbaDepth, bitUnpackShift);\\n return smoothstep(0.001, 0.01, position.z - z);\\n}\\n\\nvec4 shadow_filterShadowColor(vec4 color) {\\n if (shadow_uDrawShadowMap) {\\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\\n return rgbaDepth;\\n }\\n if (shadow_uUseShadowMap) {\\n float shadowAlpha = 0.0;\\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\\n if(shadow_uLightCount > 1.0) {\\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\\n }\\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\\n\\n return vec4(\\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\\n blendedAlpha\\n );\\n }\\n return color;\\n}\\n\";\nconst getMemoizedViewportCenterPosition = (0,_utils_memoize__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(getViewportCenterPosition);\nconst getMemoizedViewProjectionMatrices = (0,_utils_memoize__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(getViewProjectionMatrices);\nconst DEFAULT_SHADOW_COLOR = [0, 0, 0, 1.0];\nconst VECTOR_TO_POINT_MATRIX = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0];\n\nfunction screenToCommonSpace(xyz, pixelUnprojectionMatrix) {\n const [x, y, z] = xyz;\n const coord = (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_0__.pixelsToWorld)([x, y, z], pixelUnprojectionMatrix);\n\n if (Number.isFinite(z)) {\n return coord;\n }\n\n return [coord[0], coord[1], 0];\n}\n\nfunction getViewportCenterPosition({\n viewport,\n center\n}) {\n return new _math_gl_core__WEBPACK_IMPORTED_MODULE_2__[\"default\"](viewport.viewProjectionMatrix).invert().transform(center);\n}\n\nfunction getViewProjectionMatrices({\n viewport,\n shadowMatrices\n}) {\n const projectionMatrices = [];\n const pixelUnprojectionMatrix = viewport.pixelUnprojectionMatrix;\n const farZ = viewport.isGeospatial ? undefined : 1;\n const corners = [[0, 0, farZ], [viewport.width, 0, farZ], [0, viewport.height, farZ], [viewport.width, viewport.height, farZ], [0, 0, -1], [viewport.width, 0, -1], [0, viewport.height, -1], [viewport.width, viewport.height, -1]].map(pixel => screenToCommonSpace(pixel, pixelUnprojectionMatrix));\n\n for (const shadowMatrix of shadowMatrices) {\n const viewMatrix = shadowMatrix.clone().translate(new _math_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"](viewport.center).negate());\n const positions = corners.map(corner => viewMatrix.transform(corner));\n const projectionMatrix = new _math_gl_core__WEBPACK_IMPORTED_MODULE_2__[\"default\"]().ortho({\n left: Math.min(...positions.map(position => position[0])),\n right: Math.max(...positions.map(position => position[0])),\n bottom: Math.min(...positions.map(position => position[1])),\n top: Math.max(...positions.map(position => position[1])),\n near: Math.min(...positions.map(position => -position[2])),\n far: Math.max(...positions.map(position => -position[2]))\n });\n projectionMatrices.push(projectionMatrix.multiplyRight(shadowMatrix));\n }\n\n return projectionMatrices;\n}\n\nfunction createShadowUniforms(opts, context) {\n const {\n shadowEnabled = true\n } = opts;\n\n if (!shadowEnabled || !opts.shadowMatrices || !opts.shadowMatrices.length) {\n return {\n shadow_uDrawShadowMap: false,\n shadow_uUseShadowMap: false\n };\n }\n\n const uniforms = {\n shadow_uDrawShadowMap: Boolean(opts.drawToShadowMap),\n shadow_uUseShadowMap: opts.shadowMaps ? opts.shadowMaps.length > 0 : false,\n shadow_uColor: opts.shadowColor || DEFAULT_SHADOW_COLOR,\n shadow_uLightId: opts.shadowLightId || 0,\n shadow_uLightCount: opts.shadowMatrices.length\n };\n const center = getMemoizedViewportCenterPosition({\n viewport: opts.viewport,\n center: context.project_uCenter\n });\n const projectCenters = [];\n const viewProjectionMatrices = getMemoizedViewProjectionMatrices({\n shadowMatrices: opts.shadowMatrices,\n viewport: opts.viewport\n }).slice();\n\n for (let i = 0; i < opts.shadowMatrices.length; i++) {\n const viewProjectionMatrix = viewProjectionMatrices[i];\n const viewProjectionMatrixCentered = viewProjectionMatrix.clone().translate(new _math_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"](opts.viewport.center).negate());\n\n if (context.project_uCoordinateSystem === _lib_constants__WEBPACK_IMPORTED_MODULE_4__.COORDINATE_SYSTEM.LNGLAT && context.project_uProjectionMode === _lib_constants__WEBPACK_IMPORTED_MODULE_4__.PROJECTION_MODE.WEB_MERCATOR) {\n viewProjectionMatrices[i] = viewProjectionMatrixCentered;\n projectCenters[i] = center;\n } else {\n viewProjectionMatrices[i] = viewProjectionMatrix.clone().multiplyRight(VECTOR_TO_POINT_MATRIX);\n projectCenters[i] = viewProjectionMatrixCentered.transform(center);\n }\n }\n\n for (let i = 0; i < viewProjectionMatrices.length; i++) {\n uniforms[\"shadow_uViewProjectionMatrices[\".concat(i, \"]\")] = viewProjectionMatrices[i];\n uniforms[\"shadow_uProjectCenters[\".concat(i, \"]\")] = projectCenters[i];\n\n if (opts.shadowMaps && opts.shadowMaps.length > 0) {\n uniforms[\"shadow_uShadowMap\".concat(i)] = opts.shadowMaps[i];\n } else {\n uniforms[\"shadow_uShadowMap\".concat(i)] = opts.dummyShadowMap;\n }\n }\n\n return uniforms;\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n name: 'shadow',\n dependencies: [_project_project__WEBPACK_IMPORTED_MODULE_5__[\"default\"]],\n vs,\n fs,\n inject: {\n 'vs:DECKGL_FILTER_GL_POSITION': \"\\n position = shadow_setVertexPosition(geometry.position);\\n \",\n 'fs:DECKGL_FILTER_COLOR': \"\\n color = shadow_filterShadowColor(color);\\n \"\n },\n getUniforms: (opts = {}, context = {}) => {\n if ('viewport' in opts && (opts.drawToShadowMap || opts.shadowMaps && opts.shadowMaps.length > 0)) {\n return createShadowUniforms(opts, context);\n }\n\n return {};\n }\n});\n//# sourceMappingURL=shadow.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/shaderlib/shadow/shadow.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/transitions/cpu-interpolation-transition.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/transitions/cpu-interpolation-transition.js ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ CPUInterpolationTransition)\n/* harmony export */ });\n/* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @math.gl/core */ \"./node_modules/@math.gl/core/dist/esm/lib/common.js\");\n/* harmony import */ var _transition__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transition */ \"./node_modules/@deck.gl/core/dist/esm/transitions/transition.js\");\n\n\nclass CPUInterpolationTransition extends _transition__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n get value() {\n return this._value;\n }\n\n _onUpdate() {\n const {\n time,\n settings: {\n fromValue,\n toValue,\n duration,\n easing\n }\n } = this;\n const t = easing(time / duration);\n this._value = (0,_math_gl_core__WEBPACK_IMPORTED_MODULE_1__.lerp)(fromValue, toValue, t);\n }\n\n}\n//# sourceMappingURL=cpu-interpolation-transition.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/transitions/cpu-interpolation-transition.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/transitions/cpu-spring-transition.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/transitions/cpu-spring-transition.js ***! + \**********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ CPUSpringTransition)\n/* harmony export */ });\n/* harmony import */ var _transition__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transition */ \"./node_modules/@deck.gl/core/dist/esm/transitions/transition.js\");\n\nconst EPSILON = 1e-5;\n\nfunction updateSpringElement(prev, cur, dest, damping, stiffness) {\n const velocity = cur - prev;\n const delta = dest - cur;\n const spring = delta * stiffness;\n const damper = -velocity * damping;\n return spring + damper + velocity + cur;\n}\n\nfunction updateSpring(prev, cur, dest, damping, stiffness) {\n if (Array.isArray(dest)) {\n const next = [];\n\n for (let i = 0; i < dest.length; i++) {\n next[i] = updateSpringElement(prev[i], cur[i], dest[i], damping, stiffness);\n }\n\n return next;\n }\n\n return updateSpringElement(prev, cur, dest, damping, stiffness);\n}\n\nfunction distance(value1, value2) {\n if (Array.isArray(value1)) {\n let distanceSquare = 0;\n\n for (let i = 0; i < value1.length; i++) {\n const d = value1[i] - value2[i];\n distanceSquare += d * d;\n }\n\n return Math.sqrt(distanceSquare);\n }\n\n return Math.abs(value1 - value2);\n}\n\nclass CPUSpringTransition extends _transition__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n get value() {\n return this._currValue;\n }\n\n _onUpdate() {\n const {\n fromValue,\n toValue,\n damping,\n stiffness\n } = this.settings;\n const {\n _prevValue = fromValue,\n _currValue = fromValue\n } = this;\n let nextValue = updateSpring(_prevValue, _currValue, toValue, damping, stiffness);\n const delta = distance(nextValue, toValue);\n const velocity = distance(nextValue, _currValue);\n\n if (delta < EPSILON && velocity < EPSILON) {\n nextValue = toValue;\n this.end();\n }\n\n this._prevValue = _currValue;\n this._currValue = nextValue;\n }\n\n}\n//# sourceMappingURL=cpu-spring-transition.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/transitions/cpu-spring-transition.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/transitions/gpu-interpolation-transition.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/transitions/gpu-interpolation-transition.js ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ GPUInterpolationTransition)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/buffer.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/engine/dist/esm/transform/transform.js\");\n/* harmony import */ var _lib_attribute_attribute__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/attribute/attribute */ \"./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute.js\");\n/* harmony import */ var _lib_attribute_attribute_transition_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/attribute/attribute-transition-utils */ \"./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute-transition-utils.js\");\n/* harmony import */ var _transition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transition */ \"./node_modules/@deck.gl/core/dist/esm/transitions/transition.js\");\n\n\n\n\n\nclass GPUInterpolationTransition {\n constructor({\n gl,\n attribute,\n timeline\n }) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"gl\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"type\", 'interpolation');\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"attributeInTransition\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"settings\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"attribute\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"transition\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"currentStartIndices\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"currentLength\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"transform\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"buffers\", void 0);\n\n this.gl = gl;\n this.transition = new _transition__WEBPACK_IMPORTED_MODULE_1__[\"default\"](timeline);\n this.attribute = attribute;\n this.attributeInTransition = new _lib_attribute_attribute__WEBPACK_IMPORTED_MODULE_2__[\"default\"](gl, attribute.settings);\n this.currentStartIndices = attribute.startIndices;\n this.currentLength = 0;\n this.transform = getTransform(gl, attribute);\n const bufferOpts = {\n byteLength: 0,\n usage: 35050\n };\n this.buffers = [new _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"](gl, bufferOpts), new _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"](gl, bufferOpts)];\n }\n\n get inProgress() {\n return this.transition.inProgress;\n }\n\n start(transitionSettings, numInstances) {\n if (transitionSettings.duration <= 0) {\n this.transition.cancel();\n return;\n }\n\n this.settings = transitionSettings;\n const {\n gl,\n buffers,\n attribute\n } = this;\n (0,_lib_attribute_attribute_transition_utils__WEBPACK_IMPORTED_MODULE_4__.cycleBuffers)(buffers);\n const padBufferOpts = {\n numInstances,\n attribute,\n fromLength: this.currentLength,\n fromStartIndices: this.currentStartIndices,\n getData: transitionSettings.enter\n };\n\n for (const buffer of buffers) {\n (0,_lib_attribute_attribute_transition_utils__WEBPACK_IMPORTED_MODULE_4__.padBuffer)({\n buffer,\n ...padBufferOpts\n });\n }\n\n this.currentStartIndices = attribute.startIndices;\n this.currentLength = (0,_lib_attribute_attribute_transition_utils__WEBPACK_IMPORTED_MODULE_4__.getAttributeBufferLength)(attribute, numInstances);\n this.attributeInTransition.setData({\n buffer: buffers[1],\n value: attribute.value\n });\n this.transition.start(transitionSettings);\n this.transform.update({\n elementCount: Math.floor(this.currentLength / attribute.size),\n sourceBuffers: {\n aFrom: buffers[0],\n aTo: (0,_lib_attribute_attribute_transition_utils__WEBPACK_IMPORTED_MODULE_4__.getSourceBufferAttribute)(gl, attribute)\n },\n feedbackBuffers: {\n vCurrent: buffers[1]\n }\n });\n }\n\n update() {\n const updated = this.transition.update();\n\n if (updated) {\n const {\n duration,\n easing\n } = this.settings;\n const {\n time\n } = this.transition;\n let t = time / duration;\n\n if (easing) {\n t = easing(t);\n }\n\n this.transform.run({\n uniforms: {\n time: t\n }\n });\n }\n\n return updated;\n }\n\n cancel() {\n this.transition.cancel();\n this.transform.delete();\n\n for (const buffer of this.buffers) {\n buffer.delete();\n }\n\n this.buffers.length = 0;\n }\n\n}\nconst vs = \"\\n#define SHADER_NAME interpolation-transition-vertex-shader\\n\\nuniform float time;\\nattribute ATTRIBUTE_TYPE aFrom;\\nattribute ATTRIBUTE_TYPE aTo;\\nvarying ATTRIBUTE_TYPE vCurrent;\\n\\nvoid main(void) {\\n vCurrent = mix(aFrom, aTo, time);\\n gl_Position = vec4(0.0);\\n}\\n\";\n\nfunction getTransform(gl, attribute) {\n const attributeType = (0,_lib_attribute_attribute_transition_utils__WEBPACK_IMPORTED_MODULE_4__.getAttributeTypeFromSize)(attribute.size);\n return new _luma_gl_core__WEBPACK_IMPORTED_MODULE_5__[\"default\"](gl, {\n vs,\n defines: {\n ATTRIBUTE_TYPE: attributeType\n },\n varyings: ['vCurrent']\n });\n}\n//# sourceMappingURL=gpu-interpolation-transition.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/transitions/gpu-interpolation-transition.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/transitions/gpu-spring-transition.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/transitions/gpu-spring-transition.js ***! + \**********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ GPUSpringTransition)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/buffer.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/copy-and-blit.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/engine/dist/esm/transform/transform.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture-2d.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/framebuffer.js\");\n/* harmony import */ var _lib_attribute_attribute_transition_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/attribute/attribute-transition-utils */ \"./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute-transition-utils.js\");\n/* harmony import */ var _lib_attribute_attribute__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/attribute/attribute */ \"./node_modules/@deck.gl/core/dist/esm/lib/attribute/attribute.js\");\n/* harmony import */ var _transition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transition */ \"./node_modules/@deck.gl/core/dist/esm/transitions/transition.js\");\n\n\n\n\n\nclass GPUSpringTransition {\n constructor({\n gl,\n attribute,\n timeline\n }) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"gl\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"type\", 'spring');\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"attributeInTransition\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"settings\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"attribute\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"transition\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"currentStartIndices\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"currentLength\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"texture\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"framebuffer\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"transform\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"buffers\", void 0);\n\n this.gl = gl;\n this.type = 'spring';\n this.transition = new _transition__WEBPACK_IMPORTED_MODULE_1__[\"default\"](timeline);\n this.attribute = attribute;\n this.attributeInTransition = new _lib_attribute_attribute__WEBPACK_IMPORTED_MODULE_2__[\"default\"](gl, { ...attribute.settings,\n normalized: false\n });\n this.currentStartIndices = attribute.startIndices;\n this.currentLength = 0;\n this.texture = getTexture(gl);\n this.framebuffer = getFramebuffer(gl, this.texture);\n this.transform = getTransform(gl, attribute, this.framebuffer);\n const bufferOpts = {\n byteLength: 0,\n usage: 35050\n };\n this.buffers = [new _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"](gl, bufferOpts), new _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"](gl, bufferOpts), new _luma_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"](gl, bufferOpts)];\n }\n\n get inProgress() {\n return this.transition.inProgress;\n }\n\n start(transitionSettings, numInstances) {\n const {\n gl,\n buffers,\n attribute\n } = this;\n const padBufferOpts = {\n numInstances,\n attribute,\n fromLength: this.currentLength,\n fromStartIndices: this.currentStartIndices,\n getData: transitionSettings.enter\n };\n\n for (const buffer of buffers) {\n (0,_lib_attribute_attribute_transition_utils__WEBPACK_IMPORTED_MODULE_4__.padBuffer)({\n buffer,\n ...padBufferOpts\n });\n }\n\n this.settings = transitionSettings;\n this.currentStartIndices = attribute.startIndices;\n this.currentLength = (0,_lib_attribute_attribute_transition_utils__WEBPACK_IMPORTED_MODULE_4__.getAttributeBufferLength)(attribute, numInstances);\n this.attributeInTransition.setData({\n buffer: buffers[1],\n value: attribute.value\n });\n this.transition.start({ ...transitionSettings,\n duration: Infinity\n });\n this.transform.update({\n elementCount: Math.floor(this.currentLength / attribute.size),\n sourceBuffers: {\n aTo: (0,_lib_attribute_attribute_transition_utils__WEBPACK_IMPORTED_MODULE_4__.getSourceBufferAttribute)(gl, attribute)\n }\n });\n }\n\n update() {\n const {\n buffers,\n transform,\n framebuffer,\n transition\n } = this;\n const updated = transition.update();\n\n if (!updated) {\n return false;\n }\n\n const settings = this.settings;\n transform.update({\n sourceBuffers: {\n aPrev: buffers[0],\n aCur: buffers[1]\n },\n feedbackBuffers: {\n vNext: buffers[2]\n }\n });\n transform.run({\n framebuffer,\n discard: false,\n clearRenderTarget: true,\n uniforms: {\n stiffness: settings.stiffness,\n damping: settings.damping\n },\n parameters: {\n depthTest: false,\n blend: true,\n viewport: [0, 0, 1, 1],\n blendFunc: [1, 1],\n blendEquation: [32776, 32776]\n }\n });\n (0,_lib_attribute_attribute_transition_utils__WEBPACK_IMPORTED_MODULE_4__.cycleBuffers)(buffers);\n this.attributeInTransition.setData({\n buffer: buffers[1],\n value: this.attribute.value\n });\n const isTransitioning = (0,_luma_gl_core__WEBPACK_IMPORTED_MODULE_5__.readPixelsToArray)(framebuffer)[0] > 0;\n\n if (!isTransitioning) {\n transition.end();\n }\n\n return true;\n }\n\n cancel() {\n this.transition.cancel();\n this.transform.delete();\n\n for (const buffer of this.buffers) {\n buffer.delete();\n }\n\n this.buffers.length = 0;\n this.texture.delete();\n this.framebuffer.delete();\n }\n\n}\n\nfunction getTransform(gl, attribute, framebuffer) {\n const attributeType = (0,_lib_attribute_attribute_transition_utils__WEBPACK_IMPORTED_MODULE_4__.getAttributeTypeFromSize)(attribute.size);\n return new _luma_gl_core__WEBPACK_IMPORTED_MODULE_6__[\"default\"](gl, {\n framebuffer,\n vs: \"\\n#define SHADER_NAME spring-transition-vertex-shader\\n\\n#define EPSILON 0.00001\\n\\nuniform float stiffness;\\nuniform float damping;\\nattribute ATTRIBUTE_TYPE aPrev;\\nattribute ATTRIBUTE_TYPE aCur;\\nattribute ATTRIBUTE_TYPE aTo;\\nvarying ATTRIBUTE_TYPE vNext;\\nvarying float vIsTransitioningFlag;\\n\\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\\n ATTRIBUTE_TYPE velocity = cur - prev;\\n ATTRIBUTE_TYPE delta = dest - cur;\\n ATTRIBUTE_TYPE spring = delta * stiffness;\\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\\n return spring + damper + velocity + cur;\\n}\\n\\nvoid main(void) {\\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\\n\\n vNext = getNextValue(aCur, aPrev, aTo);\\n gl_Position = vec4(0, 0, 0, 1);\\n gl_PointSize = 100.0;\\n}\\n\",\n fs: \"\\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\\n\\nvarying float vIsTransitioningFlag;\\n\\nvoid main(void) {\\n if (vIsTransitioningFlag == 0.0) {\\n discard;\\n }\\n gl_FragColor = vec4(1.0);\\n}\",\n defines: {\n ATTRIBUTE_TYPE: attributeType\n },\n varyings: ['vNext']\n });\n}\n\nfunction getTexture(gl) {\n return new _luma_gl_core__WEBPACK_IMPORTED_MODULE_7__[\"default\"](gl, {\n data: new Uint8Array(4),\n format: 6408,\n type: 5121,\n border: 0,\n mipmaps: false,\n dataFormat: 6408,\n width: 1,\n height: 1\n });\n}\n\nfunction getFramebuffer(gl, texture) {\n return new _luma_gl_core__WEBPACK_IMPORTED_MODULE_8__[\"default\"](gl, {\n id: 'spring-transition-is-transitioning-framebuffer',\n width: 1,\n height: 1,\n attachments: {\n [36064]: texture\n }\n });\n}\n//# sourceMappingURL=gpu-spring-transition.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/transitions/gpu-spring-transition.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/transitions/linear-interpolator.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/transitions/linear-interpolator.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ LinearInterpolator)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _transition_interpolator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transition-interpolator */ \"./node_modules/@deck.gl/core/dist/esm/transitions/transition-interpolator.js\");\n/* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @math.gl/core */ \"./node_modules/@math.gl/core/dist/esm/lib/common.js\");\n\n\n\nconst DEFAULT_PROPS = ['longitude', 'latitude', 'zoom', 'bearing', 'pitch'];\nconst DEFAULT_REQUIRED_PROPS = ['longitude', 'latitude', 'zoom'];\nclass LinearInterpolator extends _transition_interpolator__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(opts = {}) {\n const transitionProps = Array.isArray(opts) ? opts : opts.transitionProps;\n const normalizedOpts = Array.isArray(opts) ? {} : opts;\n normalizedOpts.transitionProps = Array.isArray(transitionProps) ? {\n compare: transitionProps,\n required: transitionProps\n } : transitionProps || {\n compare: DEFAULT_PROPS,\n required: DEFAULT_REQUIRED_PROPS\n };\n super(normalizedOpts.transitionProps);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"opts\", void 0);\n\n this.opts = normalizedOpts;\n }\n\n initializeProps(startProps, endProps) {\n const result = super.initializeProps(startProps, endProps);\n const {\n makeViewport,\n around\n } = this.opts;\n\n if (makeViewport && around) {\n const startViewport = makeViewport(startProps);\n const endViewport = makeViewport(endProps);\n const aroundPosition = startViewport.unproject(around);\n result.start.around = around;\n Object.assign(result.end, {\n around: endViewport.project(aroundPosition),\n aroundPosition,\n width: endProps.width,\n height: endProps.height\n });\n }\n\n return result;\n }\n\n interpolateProps(startProps, endProps, t) {\n const propsInTransition = {};\n\n for (const key of this._propsToExtract) {\n propsInTransition[key] = (0,_math_gl_core__WEBPACK_IMPORTED_MODULE_2__.lerp)(startProps[key] || 0, endProps[key] || 0, t);\n }\n\n if (endProps.aroundPosition && this.opts.makeViewport) {\n const viewport = this.opts.makeViewport({ ...endProps,\n ...propsInTransition\n });\n Object.assign(propsInTransition, viewport.panByPosition(endProps.aroundPosition, (0,_math_gl_core__WEBPACK_IMPORTED_MODULE_2__.lerp)(startProps.around, endProps.around, t)));\n }\n\n return propsInTransition;\n }\n\n}\n//# sourceMappingURL=linear-interpolator.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/transitions/linear-interpolator.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/transitions/transition-interpolator.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/transitions/transition-interpolator.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ TransitionInterpolator)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @math.gl/core */ \"./node_modules/@math.gl/core/dist/esm/lib/common.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@deck.gl/core/dist/esm/utils/assert.js\");\n\n\n\nclass TransitionInterpolator {\n constructor(opts) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_propsToCompare\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_propsToExtract\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_requiredProps\", void 0);\n\n const {\n compare,\n extract,\n required\n } = opts;\n this._propsToCompare = compare;\n this._propsToExtract = extract || compare;\n this._requiredProps = required;\n }\n\n arePropsEqual(currentProps, nextProps) {\n for (const key of this._propsToCompare) {\n if (!(key in currentProps) || !(key in nextProps) || !(0,_math_gl_core__WEBPACK_IMPORTED_MODULE_1__.equals)(currentProps[key], nextProps[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n initializeProps(startProps, endProps) {\n const startViewStateProps = {};\n const endViewStateProps = {};\n\n for (const key of this._propsToExtract) {\n if (key in startProps || key in endProps) {\n startViewStateProps[key] = startProps[key];\n endViewStateProps[key] = endProps[key];\n }\n }\n\n this._checkRequiredProps(startViewStateProps);\n\n this._checkRequiredProps(endViewStateProps);\n\n return {\n start: startViewStateProps,\n end: endViewStateProps\n };\n }\n\n getDuration(startProps, endProps) {\n return endProps.transitionDuration;\n }\n\n _checkRequiredProps(props) {\n if (!this._requiredProps) {\n return;\n }\n\n this._requiredProps.forEach(propName => {\n const value = props[propName];\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(Number.isFinite(value) || Array.isArray(value), \"\".concat(propName, \" is required for transition\"));\n });\n }\n\n}\n//# sourceMappingURL=transition-interpolator.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/transitions/transition-interpolator.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/transitions/transition.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/transitions/transition.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Transition)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n\nclass Transition {\n constructor(timeline) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_inProgress\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_handle\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_timeline\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"time\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"settings\", void 0);\n\n this._inProgress = false;\n this._handle = null;\n this._timeline = timeline;\n this.time = 0;\n this.settings = {\n duration: 0\n };\n }\n\n get inProgress() {\n return this._inProgress;\n }\n\n start(settings) {\n var _this$settings$onStar, _this$settings;\n\n this.cancel();\n this.settings = settings;\n this._inProgress = true;\n (_this$settings$onStar = (_this$settings = this.settings).onStart) === null || _this$settings$onStar === void 0 ? void 0 : _this$settings$onStar.call(_this$settings, this);\n }\n\n end() {\n if (this._inProgress) {\n var _this$settings$onEnd, _this$settings2;\n\n this._timeline.removeChannel(this._handle);\n\n this._handle = null;\n this._inProgress = false;\n (_this$settings$onEnd = (_this$settings2 = this.settings).onEnd) === null || _this$settings$onEnd === void 0 ? void 0 : _this$settings$onEnd.call(_this$settings2, this);\n }\n }\n\n cancel() {\n if (this._inProgress) {\n var _this$settings$onInte, _this$settings3;\n\n (_this$settings$onInte = (_this$settings3 = this.settings).onInterrupt) === null || _this$settings$onInte === void 0 ? void 0 : _this$settings$onInte.call(_this$settings3, this);\n\n this._timeline.removeChannel(this._handle);\n\n this._handle = null;\n this._inProgress = false;\n }\n }\n\n update() {\n var _this$settings$onUpda, _this$settings4;\n\n if (!this._inProgress) {\n return false;\n }\n\n if (this._handle === null) {\n const {\n _timeline: timeline,\n settings\n } = this;\n this._handle = timeline.addChannel({\n delay: timeline.getTime(),\n duration: settings.duration\n });\n }\n\n this.time = this._timeline.getTime(this._handle);\n\n this._onUpdate();\n\n (_this$settings$onUpda = (_this$settings4 = this.settings).onUpdate) === null || _this$settings$onUpda === void 0 ? void 0 : _this$settings$onUpda.call(_this$settings4, this);\n\n if (this._timeline.isFinished(this._handle)) {\n this.end();\n }\n\n return true;\n }\n\n _onUpdate() {}\n\n}\n//# sourceMappingURL=transition.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/transitions/transition.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/utils/array-utils.js": +/*!******************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/utils/array-utils.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ padArray: () => (/* binding */ padArray)\n/* harmony export */ });\nfunction padArrayChunk(options) {\n const {\n source,\n target,\n start = 0,\n size,\n getData\n } = options;\n const end = options.end || target.length;\n const sourceLength = source.length;\n const targetLength = end - start;\n\n if (sourceLength > targetLength) {\n target.set(source.subarray(0, targetLength), start);\n return;\n }\n\n target.set(source, start);\n\n if (!getData) {\n return;\n }\n\n let i = sourceLength;\n\n while (i < targetLength) {\n const datum = getData(i, source);\n\n for (let j = 0; j < size; j++) {\n target[start + i] = datum[j] || 0;\n i++;\n }\n }\n}\n\nfunction padArray({\n source,\n target,\n size,\n getData,\n sourceStartIndices,\n targetStartIndices\n}) {\n if (!Array.isArray(targetStartIndices)) {\n padArrayChunk({\n source,\n target,\n size,\n getData\n });\n return target;\n }\n\n let sourceIndex = 0;\n let targetIndex = 0;\n\n const getChunkData = getData && ((i, chunk) => getData(i + targetIndex, chunk));\n\n const n = Math.min(sourceStartIndices.length, targetStartIndices.length);\n\n for (let i = 1; i < n; i++) {\n const nextSourceIndex = sourceStartIndices[i] * size;\n const nextTargetIndex = targetStartIndices[i] * size;\n padArrayChunk({\n source: source.subarray(sourceIndex, nextSourceIndex),\n target,\n start: targetIndex,\n end: nextTargetIndex,\n size,\n getData: getChunkData\n });\n sourceIndex = nextSourceIndex;\n targetIndex = nextTargetIndex;\n }\n\n if (targetIndex < target.length) {\n padArrayChunk({\n source: [],\n target,\n start: targetIndex,\n size,\n getData: getChunkData\n });\n }\n\n return target;\n}\n//# sourceMappingURL=array-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/utils/array-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/utils/assert.js": +/*!*************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/utils/assert.js ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ assert)\n/* harmony export */ });\nfunction assert(condition, message) {\n if (!condition) {\n throw new Error(message || 'deck.gl: assertion failed.');\n }\n}\n//# sourceMappingURL=assert.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/utils/assert.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/utils/count.js": +/*!************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/utils/count.js ***! + \************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ count: () => (/* binding */ count)\n/* harmony export */ });\nconst ERR_NOT_OBJECT = 'count(): argument not an object';\nconst ERR_NOT_CONTAINER = 'count(): argument not a container';\nfunction count(container) {\n if (!isObject(container)) {\n throw new Error(ERR_NOT_OBJECT);\n }\n\n if (typeof container.count === 'function') {\n return container.count();\n }\n\n if (Number.isFinite(container.size)) {\n return container.size;\n }\n\n if (Number.isFinite(container.length)) {\n return container.length;\n }\n\n if (isPlainObject(container)) {\n return Object.keys(container).length;\n }\n\n throw new Error(ERR_NOT_CONTAINER);\n}\n\nfunction isPlainObject(value) {\n return value !== null && typeof value === 'object' && value.constructor === Object;\n}\n\nfunction isObject(value) {\n return value !== null && typeof value === 'object';\n}\n//# sourceMappingURL=count.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/utils/count.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/utils/deep-equal.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/utils/deep-equal.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ deepEqual: () => (/* binding */ deepEqual)\n/* harmony export */ });\nfunction deepEqual(a, b, depth) {\n if (a === b) {\n return true;\n }\n\n if (!depth || !a || !b) {\n return false;\n }\n\n if (Array.isArray(a)) {\n if (!Array.isArray(b) || a.length !== b.length) {\n return false;\n }\n\n for (let i = 0; i < a.length; i++) {\n if (!deepEqual(a[i], b[i], depth - 1)) {\n return false;\n }\n }\n\n return true;\n }\n\n if (Array.isArray(b)) {\n return false;\n }\n\n if (typeof a === 'object' && typeof b === 'object') {\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n\n for (const key of aKeys) {\n if (!b.hasOwnProperty(key)) {\n return false;\n }\n\n if (!deepEqual(a[key], b[key], depth - 1)) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n}\n//# sourceMappingURL=deep-equal.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/utils/deep-equal.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/utils/flatten.js": +/*!**************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/utils/flatten.js ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ fillArray: () => (/* binding */ fillArray),\n/* harmony export */ flatten: () => (/* binding */ flatten)\n/* harmony export */ });\nfunction flatten(array, filter = () => true) {\n if (!Array.isArray(array)) {\n return filter(array) ? [array] : [];\n }\n\n return flattenArray(array, filter, []);\n}\n\nfunction flattenArray(array, filter, result) {\n let index = -1;\n\n while (++index < array.length) {\n const value = array[index];\n\n if (Array.isArray(value)) {\n flattenArray(value, filter, result);\n } else if (filter(value)) {\n result.push(value);\n }\n }\n\n return result;\n}\n\nfunction fillArray({\n target,\n source,\n start = 0,\n count = 1\n}) {\n const length = source.length;\n const total = count * length;\n let copied = 0;\n\n for (let i = start; copied < length; copied++) {\n target[i++] = source[copied];\n }\n\n while (copied < total) {\n if (copied < total - copied) {\n target.copyWithin(start + copied, start, start + copied);\n copied *= 2;\n } else {\n target.copyWithin(start + copied, start, start + total - copied);\n copied = total;\n }\n }\n\n return target;\n}\n//# sourceMappingURL=flatten.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/utils/flatten.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/utils/iterable-utils.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/utils/iterable-utils.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createIterable: () => (/* binding */ createIterable),\n/* harmony export */ getAccessorFromBuffer: () => (/* binding */ getAccessorFromBuffer),\n/* harmony export */ isAsyncIterable: () => (/* binding */ isAsyncIterable)\n/* harmony export */ });\nconst EMPTY_ARRAY = [];\nconst placeholderArray = [];\nfunction createIterable(data, startRow = 0, endRow = Infinity) {\n let iterable = EMPTY_ARRAY;\n const objectInfo = {\n index: -1,\n data,\n target: []\n };\n\n if (!data) {\n iterable = EMPTY_ARRAY;\n } else if (typeof data[Symbol.iterator] === 'function') {\n iterable = data;\n } else if (data.length > 0) {\n placeholderArray.length = data.length;\n iterable = placeholderArray;\n }\n\n if (startRow > 0 || Number.isFinite(endRow)) {\n iterable = (Array.isArray(iterable) ? iterable : Array.from(iterable)).slice(startRow, endRow);\n objectInfo.index = startRow - 1;\n }\n\n return {\n iterable,\n objectInfo\n };\n}\nfunction isAsyncIterable(data) {\n return data && data[Symbol.asyncIterator];\n}\nfunction getAccessorFromBuffer(typedArray, options) {\n const {\n size,\n stride,\n offset,\n startIndices,\n nested\n } = options;\n const bytesPerElement = typedArray.BYTES_PER_ELEMENT;\n const elementStride = stride ? stride / bytesPerElement : size;\n const elementOffset = offset ? offset / bytesPerElement : 0;\n const vertexCount = Math.floor((typedArray.length - elementOffset) / elementStride);\n return (_, {\n index,\n target\n }) => {\n if (!startIndices) {\n const sourceIndex = index * elementStride + elementOffset;\n\n for (let j = 0; j < size; j++) {\n target[j] = typedArray[sourceIndex + j];\n }\n\n return target;\n }\n\n const startIndex = startIndices[index];\n const endIndex = startIndices[index + 1] || vertexCount;\n let result;\n\n if (nested) {\n result = new Array(endIndex - startIndex);\n\n for (let i = startIndex; i < endIndex; i++) {\n const sourceIndex = i * elementStride + elementOffset;\n target = new Array(size);\n\n for (let j = 0; j < size; j++) {\n target[j] = typedArray[sourceIndex + j];\n }\n\n result[i - startIndex] = target;\n }\n } else if (elementStride === size) {\n result = typedArray.subarray(startIndex * size + elementOffset, endIndex * size + elementOffset);\n } else {\n result = new typedArray.constructor((endIndex - startIndex) * size);\n let targetIndex = 0;\n\n for (let i = startIndex; i < endIndex; i++) {\n const sourceIndex = i * elementStride + elementOffset;\n\n for (let j = 0; j < size; j++) {\n result[targetIndex++] = typedArray[sourceIndex + j];\n }\n }\n }\n\n return result;\n };\n}\n//# sourceMappingURL=iterable-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/utils/iterable-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/utils/json-loader.js": +/*!******************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/utils/json-loader.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nfunction isJSON(text) {\n const firstChar = text[0];\n const lastChar = text[text.length - 1];\n return firstChar === '{' && lastChar === '}' || firstChar === '[' && lastChar === ']';\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n id: 'JSON',\n name: 'JSON',\n module: '',\n version: '',\n options: {},\n extensions: ['json', 'geojson'],\n mimeTypes: ['application/json', 'application/geo+json'],\n testText: isJSON,\n parseTextSync: JSON.parse\n});\n//# sourceMappingURL=json-loader.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/utils/json-loader.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/utils/log.js": +/*!**********************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/utils/log.js ***! + \**********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _probe_gl_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @probe.gl/log */ \"./node_modules/@probe.gl/log/dist/esm/log.js\");\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (new _probe_gl_log__WEBPACK_IMPORTED_MODULE_0__.Log({\n id: 'deck'\n}));\n//# sourceMappingURL=log.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/utils/log.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/utils/math-utils.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/utils/math-utils.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createMat4: () => (/* binding */ createMat4),\n/* harmony export */ fp64LowPart: () => (/* binding */ fp64LowPart),\n/* harmony export */ getCameraPosition: () => (/* binding */ getCameraPosition),\n/* harmony export */ getFrustumPlanes: () => (/* binding */ getFrustumPlanes),\n/* harmony export */ mergeBounds: () => (/* binding */ mergeBounds),\n/* harmony export */ mod: () => (/* binding */ mod),\n/* harmony export */ toDoublePrecisionArray: () => (/* binding */ toDoublePrecisionArray)\n/* harmony export */ });\n/* harmony import */ var _typed_array_manager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./typed-array-manager */ \"./node_modules/@deck.gl/core/dist/esm/utils/typed-array-manager.js\");\n/* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @math.gl/core */ \"./node_modules/@math.gl/core/dist/esm/classes/vector3.js\");\n\n\nfunction createMat4() {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}\nfunction mod(value, divisor) {\n const modulus = value % divisor;\n return modulus < 0 ? divisor + modulus : modulus;\n}\nfunction getCameraPosition(viewMatrixInverse) {\n return [viewMatrixInverse[12], viewMatrixInverse[13], viewMatrixInverse[14]];\n}\nfunction getFrustumPlanes(viewProjectionMatrix) {\n return {\n left: getFrustumPlane(viewProjectionMatrix[3] + viewProjectionMatrix[0], viewProjectionMatrix[7] + viewProjectionMatrix[4], viewProjectionMatrix[11] + viewProjectionMatrix[8], viewProjectionMatrix[15] + viewProjectionMatrix[12]),\n right: getFrustumPlane(viewProjectionMatrix[3] - viewProjectionMatrix[0], viewProjectionMatrix[7] - viewProjectionMatrix[4], viewProjectionMatrix[11] - viewProjectionMatrix[8], viewProjectionMatrix[15] - viewProjectionMatrix[12]),\n bottom: getFrustumPlane(viewProjectionMatrix[3] + viewProjectionMatrix[1], viewProjectionMatrix[7] + viewProjectionMatrix[5], viewProjectionMatrix[11] + viewProjectionMatrix[9], viewProjectionMatrix[15] + viewProjectionMatrix[13]),\n top: getFrustumPlane(viewProjectionMatrix[3] - viewProjectionMatrix[1], viewProjectionMatrix[7] - viewProjectionMatrix[5], viewProjectionMatrix[11] - viewProjectionMatrix[9], viewProjectionMatrix[15] - viewProjectionMatrix[13]),\n near: getFrustumPlane(viewProjectionMatrix[3] + viewProjectionMatrix[2], viewProjectionMatrix[7] + viewProjectionMatrix[6], viewProjectionMatrix[11] + viewProjectionMatrix[10], viewProjectionMatrix[15] + viewProjectionMatrix[14]),\n far: getFrustumPlane(viewProjectionMatrix[3] - viewProjectionMatrix[2], viewProjectionMatrix[7] - viewProjectionMatrix[6], viewProjectionMatrix[11] - viewProjectionMatrix[10], viewProjectionMatrix[15] - viewProjectionMatrix[14])\n };\n}\nconst scratchVector = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n\nfunction getFrustumPlane(a, b, c, d) {\n scratchVector.set(a, b, c);\n const L = scratchVector.len();\n return {\n distance: d / L,\n normal: new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"](-a / L, -b / L, -c / L)\n };\n}\n\nfunction fp64LowPart(x) {\n return x - Math.fround(x);\n}\nlet scratchArray;\nfunction toDoublePrecisionArray(typedArray, options) {\n const {\n size = 1,\n startIndex = 0\n } = options;\n const endIndex = options.endIndex !== undefined ? options.endIndex : typedArray.length;\n const count = (endIndex - startIndex) / size;\n scratchArray = _typed_array_manager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].allocate(scratchArray, count, {\n type: Float32Array,\n size: size * 2\n });\n let sourceIndex = startIndex;\n let targetIndex = 0;\n\n while (sourceIndex < endIndex) {\n for (let j = 0; j < size; j++) {\n const value = typedArray[sourceIndex++];\n scratchArray[targetIndex + j] = value;\n scratchArray[targetIndex + j + size] = fp64LowPart(value);\n }\n\n targetIndex += size * 2;\n }\n\n return scratchArray.subarray(0, count * size * 2);\n}\nfunction mergeBounds(boundsList) {\n let mergedBounds = null;\n let isMerged = false;\n\n for (const bounds of boundsList) {\n if (!bounds) continue;\n\n if (!mergedBounds) {\n mergedBounds = bounds;\n } else {\n if (!isMerged) {\n mergedBounds = [[mergedBounds[0][0], mergedBounds[0][1]], [mergedBounds[1][0], mergedBounds[1][1]]];\n isMerged = true;\n }\n\n mergedBounds[0][0] = Math.min(mergedBounds[0][0], bounds[0][0]);\n mergedBounds[0][1] = Math.min(mergedBounds[0][1], bounds[0][1]);\n mergedBounds[1][0] = Math.max(mergedBounds[1][0], bounds[1][0]);\n mergedBounds[1][1] = Math.max(mergedBounds[1][1], bounds[1][1]);\n }\n }\n\n return mergedBounds;\n}\n//# sourceMappingURL=math-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/utils/math-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/utils/memoize.js": +/*!**************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/utils/memoize.js ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ memoize)\n/* harmony export */ });\nfunction isEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (Array.isArray(a)) {\n const len = a.length;\n\n if (!b || b.length !== len) {\n return false;\n }\n\n for (let i = 0; i < len; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n}\n\nfunction memoize(compute) {\n let cachedArgs = {};\n let cachedResult;\n return args => {\n for (const key in args) {\n if (!isEqual(args[key], cachedArgs[key])) {\n cachedResult = compute(args);\n cachedArgs = args;\n break;\n }\n }\n\n return cachedResult;\n };\n}\n//# sourceMappingURL=memoize.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/utils/memoize.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/utils/positions.js": +/*!****************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/utils/positions.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getPosition: () => (/* binding */ getPosition),\n/* harmony export */ parsePosition: () => (/* binding */ parsePosition)\n/* harmony export */ });\nconst PERCENT_OR_PIXELS_REGEX = /([0-9]+\\.?[0-9]*)(%|px)/;\nfunction parsePosition(value) {\n switch (typeof value) {\n case 'number':\n return {\n position: value,\n relative: false\n };\n\n case 'string':\n const match = PERCENT_OR_PIXELS_REGEX.exec(value);\n\n if (match && match.length >= 3) {\n const relative = match[2] === '%';\n const position = parseFloat(match[1]);\n return {\n position: relative ? position / 100 : position,\n relative\n };\n }\n\n default:\n throw new Error(\"Could not parse position string \".concat(value));\n }\n}\nfunction getPosition(position, extent) {\n return position.relative ? Math.round(position.position * extent) : position.position;\n}\n//# sourceMappingURL=positions.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/utils/positions.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/utils/range.js": +/*!************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/utils/range.js ***! + \************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EMPTY: () => (/* binding */ EMPTY),\n/* harmony export */ FULL: () => (/* binding */ FULL),\n/* harmony export */ add: () => (/* binding */ add)\n/* harmony export */ });\nconst EMPTY = [];\nconst FULL = [[0, Infinity]];\nfunction add(rangeList, range) {\n if (rangeList === FULL) {\n return rangeList;\n }\n\n if (range[0] < 0) {\n range[0] = 0;\n }\n\n if (range[0] >= range[1]) {\n return rangeList;\n }\n\n const newRangeList = [];\n const len = rangeList.length;\n let insertPosition = 0;\n\n for (let i = 0; i < len; i++) {\n const range0 = rangeList[i];\n\n if (range0[1] < range[0]) {\n newRangeList.push(range0);\n insertPosition = i + 1;\n } else if (range0[0] > range[1]) {\n newRangeList.push(range0);\n } else {\n range = [Math.min(range0[0], range[0]), Math.max(range0[1], range[1])];\n }\n }\n\n newRangeList.splice(insertPosition, 0, range);\n return newRangeList;\n}\n//# sourceMappingURL=range.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/utils/range.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/utils/shader.js": +/*!*************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/utils/shader.js ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ mergeShaders: () => (/* binding */ mergeShaders)\n/* harmony export */ });\nfunction mergeShaders(target, source) {\n if (!source) {\n return target;\n }\n\n const result = { ...target,\n ...source\n };\n\n if ('defines' in source) {\n result.defines = { ...target.defines,\n ...source.defines\n };\n }\n\n if ('modules' in source) {\n result.modules = (target.modules || []).concat(source.modules);\n\n if (source.modules.some(module => module.name === 'project64')) {\n const index = result.modules.findIndex(module => module.name === 'project32');\n\n if (index >= 0) {\n result.modules.splice(index, 1);\n }\n }\n }\n\n if ('inject' in source) {\n if (!target.inject) {\n result.inject = source.inject;\n } else {\n const mergedInjection = { ...target.inject\n };\n\n for (const key in source.inject) {\n mergedInjection[key] = (mergedInjection[key] || '') + source.inject[key];\n }\n\n result.inject = mergedInjection;\n }\n }\n\n return result;\n}\n//# sourceMappingURL=shader.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/utils/shader.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/utils/texture.js": +/*!**************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/utils/texture.js ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createTexture: () => (/* binding */ createTexture),\n/* harmony export */ destroyTexture: () => (/* binding */ destroyTexture)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture-2d.js\");\n\nconst DEFAULT_TEXTURE_PARAMETERS = {\n [10241]: 9987,\n [10240]: 9729,\n [10242]: 33071,\n [10243]: 33071\n};\nconst internalTextures = {};\nfunction createTexture(owner, gl, image, parameters) {\n if (image instanceof _luma_gl_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"]) {\n return image;\n } else if (image.constructor && image.constructor.name !== 'Object') {\n image = {\n data: image\n };\n }\n\n let specialTextureParameters = null;\n\n if (image.compressed) {\n specialTextureParameters = {\n [10241]: image.data.length > 1 ? 9985 : 9729\n };\n }\n\n const texture = new _luma_gl_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"](gl, { ...image,\n parameters: { ...DEFAULT_TEXTURE_PARAMETERS,\n ...specialTextureParameters,\n ...parameters\n }\n });\n internalTextures[texture.id] = owner;\n return texture;\n}\nfunction destroyTexture(owner, texture) {\n if (!texture || !(texture instanceof _luma_gl_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"])) {\n return;\n }\n\n if (internalTextures[texture.id] === owner) {\n texture.delete();\n delete internalTextures[texture.id];\n }\n}\n//# sourceMappingURL=texture.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/utils/texture.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/utils/typed-array-manager.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/utils/typed-array-manager.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TypedArrayManager: () => (/* binding */ TypedArrayManager),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n\nclass TypedArrayManager {\n constructor(options = {}) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_pool\", []);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"opts\", {\n overAlloc: 2,\n poolSize: 100\n });\n\n this.setOptions(options);\n }\n\n setOptions(options) {\n Object.assign(this.opts, options);\n }\n\n allocate(typedArray, count, {\n size = 1,\n type,\n padding = 0,\n copy = false,\n initialize = false,\n maxCount\n }) {\n const Type = type || typedArray && typedArray.constructor || Float32Array;\n const newSize = count * size + padding;\n\n if (ArrayBuffer.isView(typedArray)) {\n if (newSize <= typedArray.length) {\n return typedArray;\n }\n\n if (newSize * typedArray.BYTES_PER_ELEMENT <= typedArray.buffer.byteLength) {\n return new Type(typedArray.buffer, 0, newSize);\n }\n }\n\n let maxSize = Infinity;\n\n if (maxCount) {\n maxSize = maxCount * size + padding;\n }\n\n const newArray = this._allocate(Type, newSize, initialize, maxSize);\n\n if (typedArray && copy) {\n newArray.set(typedArray);\n } else if (!initialize) {\n newArray.fill(0, 0, 4);\n }\n\n this._release(typedArray);\n\n return newArray;\n }\n\n release(typedArray) {\n this._release(typedArray);\n }\n\n _allocate(Type, size, initialize, maxSize) {\n let sizeToAllocate = Math.max(Math.ceil(size * this.opts.overAlloc), 1);\n\n if (sizeToAllocate > maxSize) {\n sizeToAllocate = maxSize;\n }\n\n const pool = this._pool;\n const byteLength = Type.BYTES_PER_ELEMENT * sizeToAllocate;\n const i = pool.findIndex(b => b.byteLength >= byteLength);\n\n if (i >= 0) {\n const array = new Type(pool.splice(i, 1)[0], 0, sizeToAllocate);\n\n if (initialize) {\n array.fill(0);\n }\n\n return array;\n }\n\n return new Type(sizeToAllocate);\n }\n\n _release(typedArray) {\n if (!ArrayBuffer.isView(typedArray)) {\n return;\n }\n\n const pool = this._pool;\n const {\n buffer\n } = typedArray;\n const {\n byteLength\n } = buffer;\n const i = pool.findIndex(b => b.byteLength >= byteLength);\n\n if (i < 0) {\n pool.push(buffer);\n } else if (i > 0 || pool.length < this.opts.poolSize) {\n pool.splice(i, 0, buffer);\n }\n\n if (pool.length > this.opts.poolSize) {\n pool.shift();\n }\n }\n\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (new TypedArrayManager());\n//# sourceMappingURL=typed-array-manager.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/utils/typed-array-manager.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/viewports/viewport.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/viewports/viewport.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Viewport)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/log */ \"./node_modules/@deck.gl/core/dist/esm/utils/log.js\");\n/* harmony import */ var _utils_math_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/math-utils */ \"./node_modules/@deck.gl/core/dist/esm/utils/math-utils.js\");\n/* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @math.gl/core */ \"./node_modules/@math.gl/core/dist/esm/classes/matrix4.js\");\n/* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @math.gl/core */ \"./node_modules/@math.gl/core/dist/esm/lib/common.js\");\n/* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @math.gl/core */ \"./node_modules/@math.gl/core/dist/esm/classes/vector3.js\");\n/* harmony import */ var gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! gl-matrix/mat4 */ \"./node_modules/gl-matrix/esm/mat4.js\");\n/* harmony import */ var _math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @math.gl/web-mercator */ \"./node_modules/@math.gl/web-mercator/dist/esm/index.js\");\n/* harmony import */ var _lib_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/constants */ \"./node_modules/@deck.gl/core/dist/esm/lib/constants.js\");\n\n\n\n\n\n\n\nconst DEGREES_TO_RADIANS = Math.PI / 180;\nconst IDENTITY = (0,_utils_math_utils__WEBPACK_IMPORTED_MODULE_2__.createMat4)();\nconst ZERO_VECTOR = [0, 0, 0];\nconst DEFAULT_DISTANCE_SCALES = {\n unitsPerMeter: [1, 1, 1],\n metersPerUnit: [1, 1, 1]\n};\n\nfunction createProjectionMatrix({\n width,\n height,\n orthographic,\n fovyRadians,\n focalDistance,\n padding,\n near,\n far\n}) {\n const aspect = width / height;\n const matrix = orthographic ? new _math_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"]().orthographic({\n fovy: fovyRadians,\n aspect,\n focalDistance,\n near,\n far\n }) : new _math_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"]().perspective({\n fovy: fovyRadians,\n aspect,\n near,\n far\n });\n\n if (padding) {\n const {\n left = 0,\n right = 0,\n top = 0,\n bottom = 0\n } = padding;\n const offsetX = (0,_math_gl_core__WEBPACK_IMPORTED_MODULE_4__.clamp)((left + width - right) / 2, 0, width) - width / 2;\n const offsetY = (0,_math_gl_core__WEBPACK_IMPORTED_MODULE_4__.clamp)((top + height - bottom) / 2, 0, height) - height / 2;\n matrix[8] -= offsetX * 2 / width;\n matrix[9] += offsetY * 2 / height;\n }\n\n return matrix;\n}\n\nclass Viewport {\n constructor(opts = {}) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"id\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"x\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"y\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"width\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"height\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"padding\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"isGeospatial\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"zoom\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"focalDistance\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"position\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"modelMatrix\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"distanceScales\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"scale\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"center\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"cameraPosition\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"projectionMatrix\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"viewMatrix\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"viewMatrixUncentered\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"viewMatrixInverse\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"viewProjectionMatrix\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"pixelProjectionMatrix\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"pixelUnprojectionMatrix\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"resolution\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_frustumPlanes\", {});\n\n this.id = opts.id || this.constructor.displayName || 'viewport';\n this.x = opts.x || 0;\n this.y = opts.y || 0;\n this.width = opts.width || 1;\n this.height = opts.height || 1;\n this.zoom = opts.zoom || 0;\n this.padding = opts.padding;\n this.distanceScales = opts.distanceScales || DEFAULT_DISTANCE_SCALES;\n this.focalDistance = opts.focalDistance || 1;\n this.position = opts.position || ZERO_VECTOR;\n this.modelMatrix = opts.modelMatrix || null;\n const {\n longitude,\n latitude\n } = opts;\n this.isGeospatial = Number.isFinite(latitude) && Number.isFinite(longitude);\n\n this._initProps(opts);\n\n this._initMatrices(opts);\n\n this.equals = this.equals.bind(this);\n this.project = this.project.bind(this);\n this.unproject = this.unproject.bind(this);\n this.projectPosition = this.projectPosition.bind(this);\n this.unprojectPosition = this.unprojectPosition.bind(this);\n this.projectFlat = this.projectFlat.bind(this);\n this.unprojectFlat = this.unprojectFlat.bind(this);\n }\n\n get subViewports() {\n return null;\n }\n\n get metersPerPixel() {\n return this.distanceScales.metersPerUnit[2] / this.scale;\n }\n\n get projectionMode() {\n if (this.isGeospatial) {\n return this.zoom < 12 ? _lib_constants__WEBPACK_IMPORTED_MODULE_5__.PROJECTION_MODE.WEB_MERCATOR : _lib_constants__WEBPACK_IMPORTED_MODULE_5__.PROJECTION_MODE.WEB_MERCATOR_AUTO_OFFSET;\n }\n\n return _lib_constants__WEBPACK_IMPORTED_MODULE_5__.PROJECTION_MODE.IDENTITY;\n }\n\n equals(viewport) {\n if (!(viewport instanceof Viewport)) {\n return false;\n }\n\n if (this === viewport) {\n return true;\n }\n\n return viewport.width === this.width && viewport.height === this.height && viewport.scale === this.scale && (0,_math_gl_core__WEBPACK_IMPORTED_MODULE_4__.equals)(viewport.projectionMatrix, this.projectionMatrix) && (0,_math_gl_core__WEBPACK_IMPORTED_MODULE_4__.equals)(viewport.viewMatrix, this.viewMatrix);\n }\n\n project(xyz, {\n topLeft = true\n } = {}) {\n const worldPosition = this.projectPosition(xyz);\n const coord = (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.worldToPixels)(worldPosition, this.pixelProjectionMatrix);\n const [x, y] = coord;\n const y2 = topLeft ? y : this.height - y;\n return xyz.length === 2 ? [x, y2] : [x, y2, coord[2]];\n }\n\n unproject(xyz, {\n topLeft = true,\n targetZ\n } = {}) {\n const [x, y, z] = xyz;\n const y2 = topLeft ? y : this.height - y;\n const targetZWorld = targetZ && targetZ * this.distanceScales.unitsPerMeter[2];\n const coord = (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.pixelsToWorld)([x, y2, z], this.pixelUnprojectionMatrix, targetZWorld);\n const [X, Y, Z] = this.unprojectPosition(coord);\n\n if (Number.isFinite(z)) {\n return [X, Y, Z];\n }\n\n return Number.isFinite(targetZ) ? [X, Y, targetZ] : [X, Y];\n }\n\n projectPosition(xyz) {\n const [X, Y] = this.projectFlat(xyz);\n const Z = (xyz[2] || 0) * this.distanceScales.unitsPerMeter[2];\n return [X, Y, Z];\n }\n\n unprojectPosition(xyz) {\n const [X, Y] = this.unprojectFlat(xyz);\n const Z = (xyz[2] || 0) * this.distanceScales.metersPerUnit[2];\n return [X, Y, Z];\n }\n\n projectFlat(xyz) {\n if (this.isGeospatial) {\n const result = (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.lngLatToWorld)(xyz);\n result[1] = (0,_math_gl_core__WEBPACK_IMPORTED_MODULE_4__.clamp)(result[1], -318, 830);\n return result;\n }\n\n return xyz;\n }\n\n unprojectFlat(xyz) {\n if (this.isGeospatial) {\n return (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.worldToLngLat)(xyz);\n }\n\n return xyz;\n }\n\n getBounds(options = {}) {\n const unprojectOption = {\n targetZ: options.z || 0\n };\n const topLeft = this.unproject([0, 0], unprojectOption);\n const topRight = this.unproject([this.width, 0], unprojectOption);\n const bottomLeft = this.unproject([0, this.height], unprojectOption);\n const bottomRight = this.unproject([this.width, this.height], unprojectOption);\n return [Math.min(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]), Math.min(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]), Math.max(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]), Math.max(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1])];\n }\n\n getDistanceScales(coordinateOrigin) {\n if (coordinateOrigin) {\n return (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.getDistanceScales)({\n longitude: coordinateOrigin[0],\n latitude: coordinateOrigin[1],\n highPrecision: true\n });\n }\n\n return this.distanceScales;\n }\n\n containsPixel({\n x,\n y,\n width = 1,\n height = 1\n }) {\n return x < this.x + this.width && this.x < x + width && y < this.y + this.height && this.y < y + height;\n }\n\n getFrustumPlanes() {\n if (this._frustumPlanes.near) {\n return this._frustumPlanes;\n }\n\n Object.assign(this._frustumPlanes, (0,_utils_math_utils__WEBPACK_IMPORTED_MODULE_2__.getFrustumPlanes)(this.viewProjectionMatrix));\n return this._frustumPlanes;\n }\n\n panByPosition(coords, pixel) {\n return null;\n }\n\n _initProps(opts) {\n const longitude = opts.longitude;\n const latitude = opts.latitude;\n\n if (this.isGeospatial) {\n if (!Number.isFinite(opts.zoom)) {\n this.zoom = (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.getMeterZoom)({\n latitude\n }) + Math.log2(this.focalDistance);\n }\n\n this.distanceScales = opts.distanceScales || (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.getDistanceScales)({\n latitude,\n longitude\n });\n }\n\n const scale = Math.pow(2, this.zoom);\n this.scale = scale;\n const {\n position,\n modelMatrix\n } = opts;\n let meterOffset = ZERO_VECTOR;\n\n if (position) {\n meterOffset = modelMatrix ? new _math_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"](modelMatrix).transformAsVector(position, []) : position;\n }\n\n if (this.isGeospatial) {\n const center = this.projectPosition([longitude, latitude, 0]);\n this.center = new _math_gl_core__WEBPACK_IMPORTED_MODULE_6__[\"default\"](meterOffset).scale(this.distanceScales.unitsPerMeter).add(center);\n } else {\n this.center = this.projectPosition(meterOffset);\n }\n }\n\n _initMatrices(opts) {\n const {\n viewMatrix = IDENTITY,\n projectionMatrix = null,\n orthographic = false,\n fovyRadians,\n fovy = 75,\n near = 0.1,\n far = 1000,\n padding = null,\n focalDistance = 1\n } = opts;\n this.viewMatrixUncentered = viewMatrix;\n this.viewMatrix = new _math_gl_core__WEBPACK_IMPORTED_MODULE_3__[\"default\"]().multiplyRight(viewMatrix).translate(new _math_gl_core__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this.center).negate());\n this.projectionMatrix = projectionMatrix || createProjectionMatrix({\n width: this.width,\n height: this.height,\n orthographic,\n fovyRadians: fovyRadians || fovy * DEGREES_TO_RADIANS,\n focalDistance,\n padding,\n near,\n far\n });\n const vpm = (0,_utils_math_utils__WEBPACK_IMPORTED_MODULE_2__.createMat4)();\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_7__.multiply(vpm, vpm, this.projectionMatrix);\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_7__.multiply(vpm, vpm, this.viewMatrix);\n this.viewProjectionMatrix = vpm;\n this.viewMatrixInverse = gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_7__.invert([], this.viewMatrix) || this.viewMatrix;\n this.cameraPosition = (0,_utils_math_utils__WEBPACK_IMPORTED_MODULE_2__.getCameraPosition)(this.viewMatrixInverse);\n const viewportMatrix = (0,_utils_math_utils__WEBPACK_IMPORTED_MODULE_2__.createMat4)();\n const pixelProjectionMatrix = (0,_utils_math_utils__WEBPACK_IMPORTED_MODULE_2__.createMat4)();\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_7__.scale(viewportMatrix, viewportMatrix, [this.width / 2, -this.height / 2, 1]);\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_7__.translate(viewportMatrix, viewportMatrix, [1, -1, 0]);\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_7__.multiply(pixelProjectionMatrix, viewportMatrix, this.viewProjectionMatrix);\n this.pixelProjectionMatrix = pixelProjectionMatrix;\n this.pixelUnprojectionMatrix = gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_7__.invert((0,_utils_math_utils__WEBPACK_IMPORTED_MODULE_2__.createMat4)(), this.pixelProjectionMatrix);\n\n if (!this.pixelUnprojectionMatrix) {\n _utils_log__WEBPACK_IMPORTED_MODULE_8__[\"default\"].warn('Pixel project matrix not invertible')();\n }\n }\n\n}\n\n(0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Viewport, \"displayName\", 'Viewport');\n//# sourceMappingURL=viewport.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/viewports/viewport.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/viewports/web-mercator-viewport.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/viewports/web-mercator-viewport.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WebMercatorViewport)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _viewport__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./viewport */ \"./node_modules/@deck.gl/core/dist/esm/viewports/viewport.js\");\n/* harmony import */ var _math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @math.gl/web-mercator */ \"./node_modules/@math.gl/web-mercator/dist/esm/index.js\");\n/* harmony import */ var gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! gl-matrix/vec2 */ \"./node_modules/gl-matrix/esm/vec2.js\");\n/* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @math.gl/core */ \"./node_modules/@math.gl/core/dist/esm/lib/common.js\");\n/* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @math.gl/core */ \"./node_modules/@math.gl/core/dist/esm/classes/matrix4.js\");\n\n\n\n\n\nclass WebMercatorViewport extends _viewport__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n constructor(opts = {}) {\n const {\n latitude = 0,\n longitude = 0,\n zoom = 0,\n pitch = 0,\n bearing = 0,\n nearZMultiplier = 0.1,\n farZMultiplier = 1.01,\n nearZ,\n farZ,\n orthographic = false,\n projectionMatrix,\n repeat = false,\n worldOffset = 0,\n position,\n padding,\n legacyMeterSizes = false\n } = opts;\n let {\n width,\n height,\n altitude = 1.5\n } = opts;\n const scale = Math.pow(2, zoom);\n width = width || 1;\n height = height || 1;\n let fovy;\n let projectionParameters = null;\n\n if (projectionMatrix) {\n altitude = projectionMatrix[5] / 2;\n fovy = (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.altitudeToFovy)(altitude);\n } else {\n if (opts.fovy) {\n fovy = opts.fovy;\n altitude = (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.fovyToAltitude)(fovy);\n } else {\n fovy = (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.altitudeToFovy)(altitude);\n }\n\n let offset;\n\n if (padding) {\n const {\n top = 0,\n bottom = 0\n } = padding;\n offset = [0, (0,_math_gl_core__WEBPACK_IMPORTED_MODULE_3__.clamp)((top + height - bottom) / 2, 0, height) - height / 2];\n }\n\n projectionParameters = (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.getProjectionParameters)({\n width,\n height,\n scale,\n center: position && [0, 0, position[2] * (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.unitsPerMeter)(latitude)],\n offset,\n pitch,\n fovy,\n nearZMultiplier,\n farZMultiplier\n });\n\n if (Number.isFinite(nearZ)) {\n projectionParameters.near = nearZ;\n }\n\n if (Number.isFinite(farZ)) {\n projectionParameters.far = farZ;\n }\n }\n\n let viewMatrixUncentered = (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.getViewMatrix)({\n height,\n pitch,\n bearing,\n scale,\n altitude\n });\n\n if (worldOffset) {\n const viewOffset = new _math_gl_core__WEBPACK_IMPORTED_MODULE_4__[\"default\"]().translate([512 * worldOffset, 0, 0]);\n viewMatrixUncentered = viewOffset.multiplyLeft(viewMatrixUncentered);\n }\n\n super({ ...opts,\n width,\n height,\n viewMatrix: viewMatrixUncentered,\n longitude,\n latitude,\n zoom,\n ...projectionParameters,\n fovy,\n focalDistance: altitude\n });\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"longitude\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"latitude\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"pitch\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"bearing\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"altitude\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"fovy\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"orthographic\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_subViewports\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_pseudoMeters\", void 0);\n\n this.latitude = latitude;\n this.longitude = longitude;\n this.zoom = zoom;\n this.pitch = pitch;\n this.bearing = bearing;\n this.altitude = altitude;\n this.fovy = fovy;\n this.orthographic = orthographic;\n this._subViewports = repeat ? [] : null;\n this._pseudoMeters = legacyMeterSizes;\n Object.freeze(this);\n }\n\n get subViewports() {\n if (this._subViewports && !this._subViewports.length) {\n const bounds = this.getBounds();\n const minOffset = Math.floor((bounds[0] + 180) / 360);\n const maxOffset = Math.ceil((bounds[2] - 180) / 360);\n\n for (let x = minOffset; x <= maxOffset; x++) {\n const offsetViewport = x ? new WebMercatorViewport({ ...this,\n worldOffset: x\n }) : this;\n\n this._subViewports.push(offsetViewport);\n }\n }\n\n return this._subViewports;\n }\n\n projectPosition(xyz) {\n if (this._pseudoMeters) {\n return super.projectPosition(xyz);\n }\n\n const [X, Y] = this.projectFlat(xyz);\n const Z = (xyz[2] || 0) * (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.unitsPerMeter)(xyz[1]);\n return [X, Y, Z];\n }\n\n unprojectPosition(xyz) {\n if (this._pseudoMeters) {\n return super.unprojectPosition(xyz);\n }\n\n const [X, Y] = this.unprojectFlat(xyz);\n const Z = (xyz[2] || 0) / (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.unitsPerMeter)(Y);\n return [X, Y, Z];\n }\n\n addMetersToLngLat(lngLatZ, xyz) {\n return (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.addMetersToLngLat)(lngLatZ, xyz);\n }\n\n panByPosition(coords, pixel) {\n const fromLocation = (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.pixelsToWorld)(pixel, this.pixelUnprojectionMatrix);\n const toLocation = this.projectFlat(coords);\n const translate = gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_5__.add([], toLocation, gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_5__.negate([], fromLocation));\n const newCenter = gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_5__.add([], this.center, translate);\n const [longitude, latitude] = this.unprojectFlat(newCenter);\n return {\n longitude,\n latitude\n };\n }\n\n getBounds(options = {}) {\n const corners = (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.getBounds)(this, options.z || 0);\n return [Math.min(corners[0][0], corners[1][0], corners[2][0], corners[3][0]), Math.min(corners[0][1], corners[1][1], corners[2][1], corners[3][1]), Math.max(corners[0][0], corners[1][0], corners[2][0], corners[3][0]), Math.max(corners[0][1], corners[1][1], corners[2][1], corners[3][1])];\n }\n\n fitBounds(bounds, options = {}) {\n const {\n width,\n height\n } = this;\n const {\n longitude,\n latitude,\n zoom\n } = (0,_math_gl_web_mercator__WEBPACK_IMPORTED_MODULE_1__.fitBounds)({\n width,\n height,\n bounds,\n ...options\n });\n return new WebMercatorViewport({\n width,\n height,\n longitude,\n latitude,\n zoom\n });\n }\n\n}\n\n(0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(WebMercatorViewport, \"displayName\", 'WebMercatorViewport');\n//# sourceMappingURL=web-mercator-viewport.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/viewports/web-mercator-viewport.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/views/map-view.js": +/*!***************************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/views/map-view.js ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ MapView)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./view */ \"./node_modules/@deck.gl/core/dist/esm/views/view.js\");\n/* harmony import */ var _viewports_web_mercator_viewport__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../viewports/web-mercator-viewport */ \"./node_modules/@deck.gl/core/dist/esm/viewports/web-mercator-viewport.js\");\n/* harmony import */ var _controllers_map_controller__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../controllers/map-controller */ \"./node_modules/@deck.gl/core/dist/esm/controllers/map-controller.js\");\n\n\n\n\nclass MapView extends _view__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n get ViewportType() {\n return _viewports_web_mercator_viewport__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\n }\n\n get ControllerType() {\n return _controllers_map_controller__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\n }\n\n}\n\n(0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(MapView, \"displayName\", 'MapView');\n//# sourceMappingURL=map-view.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/views/map-view.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/core/dist/esm/views/view.js": +/*!***********************************************************!*\ + !*** ./node_modules/@deck.gl/core/dist/esm/views/view.js ***! + \***********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ View)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _viewports_viewport__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../viewports/viewport */ \"./node_modules/@deck.gl/core/dist/esm/viewports/viewport.js\");\n/* harmony import */ var _utils_positions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/positions */ \"./node_modules/@deck.gl/core/dist/esm/utils/positions.js\");\n/* harmony import */ var _utils_deep_equal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/deep-equal */ \"./node_modules/@deck.gl/core/dist/esm/utils/deep-equal.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@deck.gl/core/dist/esm/utils/assert.js\");\n\n\n\n\n\nclass View {\n constructor(props) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"id\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"viewportInstance\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_x\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_y\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_width\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_height\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_padding\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"props\", void 0);\n\n const {\n id,\n x = 0,\n y = 0,\n width = '100%',\n height = '100%',\n padding = null,\n viewportInstance\n } = props || {};\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(!viewportInstance || viewportInstance instanceof _viewports_viewport__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n this.viewportInstance = viewportInstance;\n this.id = id || this.constructor.displayName || 'view';\n this.props = { ...props,\n id: this.id\n };\n this._x = (0,_utils_positions__WEBPACK_IMPORTED_MODULE_3__.parsePosition)(x);\n this._y = (0,_utils_positions__WEBPACK_IMPORTED_MODULE_3__.parsePosition)(y);\n this._width = (0,_utils_positions__WEBPACK_IMPORTED_MODULE_3__.parsePosition)(width);\n this._height = (0,_utils_positions__WEBPACK_IMPORTED_MODULE_3__.parsePosition)(height);\n this._padding = padding && {\n left: (0,_utils_positions__WEBPACK_IMPORTED_MODULE_3__.parsePosition)(padding.left || 0),\n right: (0,_utils_positions__WEBPACK_IMPORTED_MODULE_3__.parsePosition)(padding.right || 0),\n top: (0,_utils_positions__WEBPACK_IMPORTED_MODULE_3__.parsePosition)(padding.top || 0),\n bottom: (0,_utils_positions__WEBPACK_IMPORTED_MODULE_3__.parsePosition)(padding.bottom || 0)\n };\n this.equals = this.equals.bind(this);\n Object.seal(this);\n }\n\n equals(view) {\n if (this === view) {\n return true;\n }\n\n if (this.viewportInstance) {\n return view.viewportInstance ? this.viewportInstance.equals(view.viewportInstance) : false;\n }\n\n return this.ViewportType === view.ViewportType && (0,_utils_deep_equal__WEBPACK_IMPORTED_MODULE_4__.deepEqual)(this.props, view.props, 2);\n }\n\n makeViewport({\n width,\n height,\n viewState\n }) {\n if (this.viewportInstance) {\n return this.viewportInstance;\n }\n\n viewState = this.filterViewState(viewState);\n const viewportDimensions = this.getDimensions({\n width,\n height\n });\n\n if (!viewportDimensions.height || !viewportDimensions.width) {\n return null;\n }\n\n return new this.ViewportType({ ...viewState,\n ...this.props,\n ...viewportDimensions\n });\n }\n\n getViewStateId() {\n const {\n viewState\n } = this.props;\n\n if (typeof viewState === 'string') {\n return viewState;\n }\n\n return (viewState === null || viewState === void 0 ? void 0 : viewState.id) || this.id;\n }\n\n filterViewState(viewState) {\n if (this.props.viewState && typeof this.props.viewState === 'object') {\n if (!this.props.viewState.id) {\n return this.props.viewState;\n }\n\n const newViewState = { ...viewState\n };\n\n for (const key in this.props.viewState) {\n if (key !== 'id') {\n newViewState[key] = this.props.viewState[key];\n }\n }\n\n return newViewState;\n }\n\n return viewState;\n }\n\n getDimensions({\n width,\n height\n }) {\n const dimensions = {\n x: (0,_utils_positions__WEBPACK_IMPORTED_MODULE_3__.getPosition)(this._x, width),\n y: (0,_utils_positions__WEBPACK_IMPORTED_MODULE_3__.getPosition)(this._y, height),\n width: (0,_utils_positions__WEBPACK_IMPORTED_MODULE_3__.getPosition)(this._width, width),\n height: (0,_utils_positions__WEBPACK_IMPORTED_MODULE_3__.getPosition)(this._height, height)\n };\n\n if (this._padding) {\n dimensions.padding = {\n left: (0,_utils_positions__WEBPACK_IMPORTED_MODULE_3__.getPosition)(this._padding.left, width),\n top: (0,_utils_positions__WEBPACK_IMPORTED_MODULE_3__.getPosition)(this._padding.top, height),\n right: (0,_utils_positions__WEBPACK_IMPORTED_MODULE_3__.getPosition)(this._padding.right, width),\n bottom: (0,_utils_positions__WEBPACK_IMPORTED_MODULE_3__.getPosition)(this._padding.bottom, height)\n };\n }\n\n return dimensions;\n }\n\n get controller() {\n const opts = this.props.controller;\n\n if (!opts) {\n return null;\n }\n\n if (opts === true) {\n return {\n type: this.ControllerType\n };\n }\n\n if (typeof opts === 'function') {\n return {\n type: opts\n };\n }\n\n return {\n type: this.ControllerType,\n ...opts\n };\n }\n\n}\n//# sourceMappingURL=view.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/core/dist/esm/views/view.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/layers/dist/esm/scatterplot-layer/scatterplot-layer-fragment.glsl.js": +/*!****************************************************************************************************!*\ + !*** ./node_modules/@deck.gl/layers/dist/esm/scatterplot-layer/scatterplot-layer-fragment.glsl.js ***! + \****************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (\"#define SHADER_NAME scatterplot-layer-fragment-shader\\n\\nprecision highp float;\\n\\nuniform bool filled;\\nuniform float stroked;\\nuniform bool antialiasing;\\n\\nvarying vec4 vFillColor;\\nvarying vec4 vLineColor;\\nvarying vec2 unitPosition;\\nvarying float innerUnitRadius;\\nvarying float outerRadiusPixels;\\n\\nvoid main(void) {\\n geometry.uv = unitPosition;\\n\\n float distToCenter = length(unitPosition) * outerRadiusPixels;\\n float inCircle = antialiasing ? \\n smoothedge(distToCenter, outerRadiusPixels) : \\n step(distToCenter, outerRadiusPixels);\\n\\n if (inCircle == 0.0) {\\n discard;\\n }\\n\\n if (stroked > 0.5) {\\n float isLine = antialiasing ? \\n smoothedge(innerUnitRadius * outerRadiusPixels, distToCenter) :\\n step(innerUnitRadius * outerRadiusPixels, distToCenter);\\n\\n if (filled) {\\n gl_FragColor = mix(vFillColor, vLineColor, isLine);\\n } else {\\n if (isLine == 0.0) {\\n discard;\\n }\\n gl_FragColor = vec4(vLineColor.rgb, vLineColor.a * isLine);\\n }\\n } else if (!filled) {\\n discard;\\n } else {\\n gl_FragColor = vFillColor;\\n }\\n\\n gl_FragColor.a *= inCircle;\\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\\n}\\n\");\n//# sourceMappingURL=scatterplot-layer-fragment.glsl.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/layers/dist/esm/scatterplot-layer/scatterplot-layer-fragment.glsl.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/layers/dist/esm/scatterplot-layer/scatterplot-layer-vertex.glsl.js": +/*!**************************************************************************************************!*\ + !*** ./node_modules/@deck.gl/layers/dist/esm/scatterplot-layer/scatterplot-layer-vertex.glsl.js ***! + \**************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (\"#define SHADER_NAME scatterplot-layer-vertex-shader\\n\\nattribute vec3 positions;\\n\\nattribute vec3 instancePositions;\\nattribute vec3 instancePositions64Low;\\nattribute float instanceRadius;\\nattribute float instanceLineWidths;\\nattribute vec4 instanceFillColors;\\nattribute vec4 instanceLineColors;\\nattribute vec3 instancePickingColors;\\n\\nuniform float opacity;\\nuniform float radiusScale;\\nuniform float radiusMinPixels;\\nuniform float radiusMaxPixels;\\nuniform float lineWidthScale;\\nuniform float lineWidthMinPixels;\\nuniform float lineWidthMaxPixels;\\nuniform float stroked;\\nuniform bool filled;\\nuniform bool antialiasing;\\nuniform bool billboard;\\nuniform int radiusUnits;\\nuniform int lineWidthUnits;\\n\\nvarying vec4 vFillColor;\\nvarying vec4 vLineColor;\\nvarying vec2 unitPosition;\\nvarying float innerUnitRadius;\\nvarying float outerRadiusPixels;\\n\\n\\nvoid main(void) {\\n geometry.worldPosition = instancePositions;\\n outerRadiusPixels = clamp(\\n project_size_to_pixel(radiusScale * instanceRadius, radiusUnits),\\n radiusMinPixels, radiusMaxPixels\\n );\\n float lineWidthPixels = clamp(\\n project_size_to_pixel(lineWidthScale * instanceLineWidths, lineWidthUnits),\\n lineWidthMinPixels, lineWidthMaxPixels\\n );\\n outerRadiusPixels += stroked * lineWidthPixels / 2.0;\\n float edgePadding = antialiasing ? (outerRadiusPixels + SMOOTH_EDGE_RADIUS) / outerRadiusPixels : 1.0;\\n unitPosition = edgePadding * positions.xy;\\n geometry.uv = unitPosition;\\n geometry.pickingColor = instancePickingColors;\\n\\n innerUnitRadius = 1.0 - stroked * lineWidthPixels / outerRadiusPixels;\\n \\n if (billboard) {\\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\\n vec3 offset = edgePadding * positions * outerRadiusPixels;\\n DECKGL_FILTER_SIZE(offset, geometry);\\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\\n } else {\\n vec3 offset = edgePadding * positions * project_pixel_size(outerRadiusPixels);\\n DECKGL_FILTER_SIZE(offset, geometry);\\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position);\\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\\n }\\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\\n DECKGL_FILTER_COLOR(vFillColor, geometry);\\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\\n DECKGL_FILTER_COLOR(vLineColor, geometry);\\n}\\n\");\n//# sourceMappingURL=scatterplot-layer-vertex.glsl.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/layers/dist/esm/scatterplot-layer/scatterplot-layer-vertex.glsl.js?"); + +/***/ }), + +/***/ "./node_modules/@deck.gl/layers/dist/esm/scatterplot-layer/scatterplot-layer.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@deck.gl/layers/dist/esm/scatterplot-layer/scatterplot-layer.js ***! + \**************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ScatterplotLayer)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @deck.gl/core */ \"./node_modules/@deck.gl/core/dist/esm/lib/layer.js\");\n/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @deck.gl/core */ \"./node_modules/@deck.gl/core/dist/esm/shaderlib/project32/project32.js\");\n/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @deck.gl/core */ \"./node_modules/@deck.gl/core/dist/esm/shaderlib/picking/picking.js\");\n/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @deck.gl/core */ \"./node_modules/@deck.gl/core/dist/esm/lib/constants.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/engine/dist/esm/lib/model.js\");\n/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @luma.gl/core */ \"./node_modules/@luma.gl/engine/dist/esm/geometry/geometry.js\");\n/* harmony import */ var _scatterplot_layer_vertex_glsl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./scatterplot-layer-vertex.glsl */ \"./node_modules/@deck.gl/layers/dist/esm/scatterplot-layer/scatterplot-layer-vertex.glsl.js\");\n/* harmony import */ var _scatterplot_layer_fragment_glsl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./scatterplot-layer-fragment.glsl */ \"./node_modules/@deck.gl/layers/dist/esm/scatterplot-layer/scatterplot-layer-fragment.glsl.js\");\n\n\n\n\n\nconst DEFAULT_COLOR = [0, 0, 0, 255];\nconst defaultProps = {\n radiusUnits: 'meters',\n radiusScale: {\n type: 'number',\n min: 0,\n value: 1\n },\n radiusMinPixels: {\n type: 'number',\n min: 0,\n value: 0\n },\n radiusMaxPixels: {\n type: 'number',\n min: 0,\n value: Number.MAX_SAFE_INTEGER\n },\n lineWidthUnits: 'meters',\n lineWidthScale: {\n type: 'number',\n min: 0,\n value: 1\n },\n lineWidthMinPixels: {\n type: 'number',\n min: 0,\n value: 0\n },\n lineWidthMaxPixels: {\n type: 'number',\n min: 0,\n value: Number.MAX_SAFE_INTEGER\n },\n stroked: false,\n filled: true,\n billboard: false,\n antialiasing: true,\n getPosition: {\n type: 'accessor',\n value: x => x.position\n },\n getRadius: {\n type: 'accessor',\n value: 1\n },\n getFillColor: {\n type: 'accessor',\n value: DEFAULT_COLOR\n },\n getLineColor: {\n type: 'accessor',\n value: DEFAULT_COLOR\n },\n getLineWidth: {\n type: 'accessor',\n value: 1\n },\n strokeWidth: {\n deprecatedFor: 'getLineWidth'\n },\n outline: {\n deprecatedFor: 'stroked'\n },\n getColor: {\n deprecatedFor: ['getFillColor', 'getLineColor']\n }\n};\nclass ScatterplotLayer extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n getShaders() {\n return super.getShaders({\n vs: _scatterplot_layer_vertex_glsl__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n fs: _scatterplot_layer_fragment_glsl__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n modules: [_deck_gl_core__WEBPACK_IMPORTED_MODULE_4__[\"default\"], _deck_gl_core__WEBPACK_IMPORTED_MODULE_5__[\"default\"]]\n });\n }\n\n initializeState() {\n this.getAttributeManager().addInstanced({\n instancePositions: {\n size: 3,\n type: 5130,\n fp64: this.use64bitPositions(),\n transition: true,\n accessor: 'getPosition'\n },\n instanceRadius: {\n size: 1,\n transition: true,\n accessor: 'getRadius',\n defaultValue: 1\n },\n instanceFillColors: {\n size: this.props.colorFormat.length,\n transition: true,\n normalized: true,\n type: 5121,\n accessor: 'getFillColor',\n defaultValue: [0, 0, 0, 255]\n },\n instanceLineColors: {\n size: this.props.colorFormat.length,\n transition: true,\n normalized: true,\n type: 5121,\n accessor: 'getLineColor',\n defaultValue: [0, 0, 0, 255]\n },\n instanceLineWidths: {\n size: 1,\n transition: true,\n accessor: 'getLineWidth',\n defaultValue: 1\n }\n });\n }\n\n updateState(params) {\n super.updateState(params);\n\n if (params.changeFlags.extensionsChanged) {\n var _this$state$model;\n\n const {\n gl\n } = this.context;\n (_this$state$model = this.state.model) === null || _this$state$model === void 0 ? void 0 : _this$state$model.delete();\n this.state.model = this._getModel(gl);\n this.getAttributeManager().invalidateAll();\n }\n }\n\n draw({\n uniforms\n }) {\n const {\n radiusUnits,\n radiusScale,\n radiusMinPixels,\n radiusMaxPixels,\n stroked,\n filled,\n billboard,\n antialiasing,\n lineWidthUnits,\n lineWidthScale,\n lineWidthMinPixels,\n lineWidthMaxPixels\n } = this.props;\n this.state.model.setUniforms(uniforms).setUniforms({\n stroked: stroked ? 1 : 0,\n filled,\n billboard,\n antialiasing,\n radiusUnits: _deck_gl_core__WEBPACK_IMPORTED_MODULE_6__.UNIT[radiusUnits],\n radiusScale,\n radiusMinPixels,\n radiusMaxPixels,\n lineWidthUnits: _deck_gl_core__WEBPACK_IMPORTED_MODULE_6__.UNIT[lineWidthUnits],\n lineWidthScale,\n lineWidthMinPixels,\n lineWidthMaxPixels\n }).draw();\n }\n\n _getModel(gl) {\n const positions = [-1, -1, 0, 1, -1, 0, 1, 1, 0, -1, 1, 0];\n return new _luma_gl_core__WEBPACK_IMPORTED_MODULE_7__[\"default\"](gl, { ...this.getShaders(),\n id: this.props.id,\n geometry: new _luma_gl_core__WEBPACK_IMPORTED_MODULE_8__[\"default\"]({\n drawMode: 6,\n vertexCount: 4,\n attributes: {\n positions: {\n size: 3,\n value: new Float32Array(positions)\n }\n }\n }),\n isInstanced: true\n });\n }\n\n}\n\n(0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(ScatterplotLayer, \"defaultProps\", defaultProps);\n\n(0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(ScatterplotLayer, \"layerName\", 'ScatterplotLayer');\n//# sourceMappingURL=scatterplot-layer.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@deck.gl/layers/dist/esm/scatterplot-layer/scatterplot-layer.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-array-buffer-iterator.js": +/*!******************************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-array-buffer-iterator.js ***! + \******************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ makeArrayBufferIterator: () => (/* binding */ makeArrayBufferIterator)\n/* harmony export */ });\nconst DEFAULT_CHUNK_SIZE = 256 * 1024;\nfunction makeArrayBufferIterator(arrayBuffer) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return function* () {\n const {\n chunkSize = DEFAULT_CHUNK_SIZE\n } = options;\n let byteOffset = 0;\n while (byteOffset < arrayBuffer.byteLength) {\n const chunkByteLength = Math.min(arrayBuffer.byteLength - byteOffset, chunkSize);\n const chunk = new ArrayBuffer(chunkByteLength);\n const sourceArray = new Uint8Array(arrayBuffer, byteOffset, chunkByteLength);\n const chunkArray = new Uint8Array(chunk);\n chunkArray.set(sourceArray);\n byteOffset += chunkByteLength;\n yield chunk;\n }\n }();\n}\n//# sourceMappingURL=make-array-buffer-iterator.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-array-buffer-iterator.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-blob-iterator.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-blob-iterator.js ***! + \**********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ makeBlobIterator: () => (/* binding */ makeBlobIterator)\n/* harmony export */ });\nconst DEFAULT_CHUNK_SIZE = 1024 * 1024;\nasync function* makeBlobIterator(blob, options) {\n const chunkSize = (options === null || options === void 0 ? void 0 : options.chunkSize) || DEFAULT_CHUNK_SIZE;\n let offset = 0;\n while (offset < blob.size) {\n const end = offset + chunkSize;\n const chunk = await blob.slice(offset, end).arrayBuffer();\n offset = end;\n yield chunk;\n }\n}\n//# sourceMappingURL=make-blob-iterator.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-blob-iterator.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-iterator.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-iterator.js ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ makeIterator: () => (/* binding */ makeIterator)\n/* harmony export */ });\n/* harmony import */ var _make_string_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./make-string-iterator */ \"./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-string-iterator.js\");\n/* harmony import */ var _make_array_buffer_iterator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./make-array-buffer-iterator */ \"./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-array-buffer-iterator.js\");\n/* harmony import */ var _make_blob_iterator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./make-blob-iterator */ \"./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-blob-iterator.js\");\n/* harmony import */ var _make_stream_iterator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./make-stream-iterator */ \"./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-stream-iterator.js\");\n/* harmony import */ var _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../javascript-utils/is-type */ \"./node_modules/@loaders.gl/core/dist/esm/javascript-utils/is-type.js\");\n\n\n\n\n\nfunction makeIterator(data, options) {\n if (typeof data === 'string') {\n return (0,_make_string_iterator__WEBPACK_IMPORTED_MODULE_0__.makeStringIterator)(data, options);\n }\n if (data instanceof ArrayBuffer) {\n return (0,_make_array_buffer_iterator__WEBPACK_IMPORTED_MODULE_1__.makeArrayBufferIterator)(data, options);\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_2__.isBlob)(data)) {\n return (0,_make_blob_iterator__WEBPACK_IMPORTED_MODULE_3__.makeBlobIterator)(data, options);\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_2__.isReadableStream)(data)) {\n return (0,_make_stream_iterator__WEBPACK_IMPORTED_MODULE_4__.makeStreamIterator)(data, options);\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_2__.isResponse)(data)) {\n const response = data;\n return (0,_make_stream_iterator__WEBPACK_IMPORTED_MODULE_4__.makeStreamIterator)(response.body, options);\n }\n throw new Error('makeIterator');\n}\n//# sourceMappingURL=make-iterator.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-iterator.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-stream-iterator.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-stream-iterator.js ***! + \************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ makeStreamIterator: () => (/* binding */ makeStreamIterator)\n/* harmony export */ });\n/* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/loader-utils */ \"./node_modules/@loaders.gl/loader-utils/dist/esm/lib/env-utils/globals.js\");\n/* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @loaders.gl/loader-utils */ \"./node_modules/@loaders.gl/loader-utils/dist/esm/lib/binary-utils/memory-conversion-utils.js\");\n\nfunction makeStreamIterator(stream, options) {\n return _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__.isBrowser ? makeBrowserStreamIterator(stream, options) : makeNodeStreamIterator(stream, options);\n}\nasync function* makeBrowserStreamIterator(stream, options) {\n const reader = stream.getReader();\n let nextBatchPromise;\n try {\n while (true) {\n const currentBatchPromise = nextBatchPromise || reader.read();\n if (options !== null && options !== void 0 && options._streamReadAhead) {\n nextBatchPromise = reader.read();\n }\n const {\n done,\n value\n } = await currentBatchPromise;\n if (done) {\n return;\n }\n yield (0,_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__.toArrayBuffer)(value);\n }\n } catch (error) {\n reader.releaseLock();\n }\n}\nasync function* makeNodeStreamIterator(stream, options) {\n for await (const chunk of stream) {\n yield (0,_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__.toArrayBuffer)(chunk);\n }\n}\n//# sourceMappingURL=make-stream-iterator.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-stream-iterator.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-string-iterator.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-string-iterator.js ***! + \************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ makeStringIterator: () => (/* binding */ makeStringIterator)\n/* harmony export */ });\nconst DEFAULT_CHUNK_SIZE = 256 * 1024;\nfunction* makeStringIterator(string, options) {\n const chunkSize = (options === null || options === void 0 ? void 0 : options.chunkSize) || DEFAULT_CHUNK_SIZE;\n let offset = 0;\n const textEncoder = new TextEncoder();\n while (offset < string.length) {\n const chunkLength = Math.min(string.length - offset, chunkSize);\n const chunk = string.slice(offset, offset + chunkLength);\n offset += chunkLength;\n yield textEncoder.encode(chunk);\n }\n}\n//# sourceMappingURL=make-string-iterator.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-string-iterator.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/javascript-utils/is-type.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/javascript-utils/is-type.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ isAsyncIterable: () => (/* binding */ isAsyncIterable),\n/* harmony export */ isBlob: () => (/* binding */ isBlob),\n/* harmony export */ isBuffer: () => (/* binding */ isBuffer),\n/* harmony export */ isFile: () => (/* binding */ isFile),\n/* harmony export */ isIterable: () => (/* binding */ isIterable),\n/* harmony export */ isIterator: () => (/* binding */ isIterator),\n/* harmony export */ isObject: () => (/* binding */ isObject),\n/* harmony export */ isPromise: () => (/* binding */ isPromise),\n/* harmony export */ isPureObject: () => (/* binding */ isPureObject),\n/* harmony export */ isReadableDOMStream: () => (/* binding */ isReadableDOMStream),\n/* harmony export */ isReadableNodeStream: () => (/* binding */ isReadableNodeStream),\n/* harmony export */ isReadableStream: () => (/* binding */ isReadableStream),\n/* harmony export */ isResponse: () => (/* binding */ isResponse),\n/* harmony export */ isWritableDOMStream: () => (/* binding */ isWritableDOMStream),\n/* harmony export */ isWritableNodeStream: () => (/* binding */ isWritableNodeStream),\n/* harmony export */ isWritableStream: () => (/* binding */ isWritableStream)\n/* harmony export */ });\nconst isBoolean = x => typeof x === 'boolean';\nconst isFunction = x => typeof x === 'function';\nconst isObject = x => x !== null && typeof x === 'object';\nconst isPureObject = x => isObject(x) && x.constructor === {}.constructor;\nconst isPromise = x => isObject(x) && isFunction(x.then);\nconst isIterable = x => x && typeof x[Symbol.iterator] === 'function';\nconst isAsyncIterable = x => x && typeof x[Symbol.asyncIterator] === 'function';\nconst isIterator = x => x && isFunction(x.next);\nconst isResponse = x => typeof Response !== 'undefined' && x instanceof Response || x && x.arrayBuffer && x.text && x.json;\nconst isFile = x => typeof File !== 'undefined' && x instanceof File;\nconst isBlob = x => typeof Blob !== 'undefined' && x instanceof Blob;\nconst isBuffer = x => x && typeof x === 'object' && x.isBuffer;\nconst isWritableDOMStream = x => isObject(x) && isFunction(x.abort) && isFunction(x.getWriter);\nconst isReadableDOMStream = x => typeof ReadableStream !== 'undefined' && x instanceof ReadableStream || isObject(x) && isFunction(x.tee) && isFunction(x.cancel) && isFunction(x.getReader);\nconst isWritableNodeStream = x => isObject(x) && isFunction(x.end) && isFunction(x.write) && isBoolean(x.writable);\nconst isReadableNodeStream = x => isObject(x) && isFunction(x.read) && isFunction(x.pipe) && isBoolean(x.readable);\nconst isReadableStream = x => isReadableDOMStream(x) || isReadableNodeStream(x);\nconst isWritableStream = x => isWritableDOMStream(x) || isWritableNodeStream(x);\n//# sourceMappingURL=is-type.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/javascript-utils/is-type.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/lib/api/load.js": +/*!****************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/lib/api/load.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ load: () => (/* binding */ load)\n/* harmony export */ });\n/* harmony import */ var _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../javascript-utils/is-type */ \"./node_modules/@loaders.gl/core/dist/esm/javascript-utils/is-type.js\");\n/* harmony import */ var _loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../loader-utils/normalize-loader */ \"./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/normalize-loader.js\");\n/* harmony import */ var _loader_utils_get_fetch_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../loader-utils/get-fetch-function */ \"./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/get-fetch-function.js\");\n/* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parse */ \"./node_modules/@loaders.gl/core/dist/esm/lib/api/parse.js\");\n\n\n\n\nasync function load(url, loaders, options, context) {\n if (!Array.isArray(loaders) && !(0,_loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_0__.isLoaderObject)(loaders)) {\n context = undefined;\n options = loaders;\n loaders = undefined;\n }\n const fetch = (0,_loader_utils_get_fetch_function__WEBPACK_IMPORTED_MODULE_1__.getFetchFunction)(options);\n let data = url;\n if (typeof url === 'string') {\n data = await fetch(url);\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_2__.isBlob)(url)) {\n data = await fetch(url);\n }\n return await (0,_parse__WEBPACK_IMPORTED_MODULE_3__.parse)(data, loaders, options);\n}\n//# sourceMappingURL=load.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/lib/api/load.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/lib/api/parse.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/lib/api/parse.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ parse: () => (/* binding */ parse)\n/* harmony export */ });\n/* harmony import */ var _loaders_gl_worker_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/worker-utils */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/assert.js\");\n/* harmony import */ var _loaders_gl_worker_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @loaders.gl/worker-utils */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-api/validate-worker-version.js\");\n/* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @loaders.gl/loader-utils */ \"./node_modules/@loaders.gl/loader-utils/dist/esm/lib/worker-loader-utils/parse-with-worker.js\");\n/* harmony import */ var _loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../loader-utils/normalize-loader */ \"./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/normalize-loader.js\");\n/* harmony import */ var _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../javascript-utils/is-type */ \"./node_modules/@loaders.gl/core/dist/esm/javascript-utils/is-type.js\");\n/* harmony import */ var _loader_utils_option_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../loader-utils/option-utils */ \"./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/option-utils.js\");\n/* harmony import */ var _loader_utils_get_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../loader-utils/get-data */ \"./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/get-data.js\");\n/* harmony import */ var _loader_utils_loader_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../loader-utils/loader-context */ \"./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/loader-context.js\");\n/* harmony import */ var _utils_resource_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/resource-utils */ \"./node_modules/@loaders.gl/core/dist/esm/lib/utils/resource-utils.js\");\n/* harmony import */ var _select_loader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./select-loader */ \"./node_modules/@loaders.gl/core/dist/esm/lib/api/select-loader.js\");\n\n\n\n\n\n\n\n\n\nasync function parse(data, loaders, options, context) {\n (0,_loaders_gl_worker_utils__WEBPACK_IMPORTED_MODULE_0__.assert)(!context || typeof context === 'object');\n if (loaders && !Array.isArray(loaders) && !(0,_loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_1__.isLoaderObject)(loaders)) {\n context = undefined;\n options = loaders;\n loaders = undefined;\n }\n data = await data;\n options = options || {};\n const url = (0,_utils_resource_utils__WEBPACK_IMPORTED_MODULE_2__.getResourceUrl)(data);\n const typedLoaders = loaders;\n const candidateLoaders = (0,_loader_utils_loader_context__WEBPACK_IMPORTED_MODULE_3__.getLoadersFromContext)(typedLoaders, context);\n const loader = await (0,_select_loader__WEBPACK_IMPORTED_MODULE_4__.selectLoader)(data, candidateLoaders, options);\n if (!loader) {\n return null;\n }\n options = (0,_loader_utils_option_utils__WEBPACK_IMPORTED_MODULE_5__.normalizeOptions)(options, loader, candidateLoaders, url);\n context = (0,_loader_utils_loader_context__WEBPACK_IMPORTED_MODULE_3__.getLoaderContext)({\n url,\n parse,\n loaders: candidateLoaders\n }, options, context || null);\n return await parseWithLoader(loader, data, options, context);\n}\nasync function parseWithLoader(loader, data, options, context) {\n (0,_loaders_gl_worker_utils__WEBPACK_IMPORTED_MODULE_6__.validateWorkerVersion)(loader);\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_7__.isResponse)(data)) {\n const response = data;\n const {\n ok,\n redirected,\n status,\n statusText,\n type,\n url\n } = response;\n const headers = Object.fromEntries(response.headers.entries());\n context.response = {\n headers,\n ok,\n redirected,\n status,\n statusText,\n type,\n url\n };\n }\n data = await (0,_loader_utils_get_data__WEBPACK_IMPORTED_MODULE_8__.getArrayBufferOrStringFromData)(data, loader, options);\n if (loader.parseTextSync && typeof data === 'string') {\n options.dataType = 'text';\n return loader.parseTextSync(data, options, context, loader);\n }\n if ((0,_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_9__.canParseWithWorker)(loader, options)) {\n return await (0,_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_9__.parseWithWorker)(loader, data, options, context, parse);\n }\n if (loader.parseText && typeof data === 'string') {\n return await loader.parseText(data, options, context, loader);\n }\n if (loader.parse) {\n return await loader.parse(data, options, context, loader);\n }\n (0,_loaders_gl_worker_utils__WEBPACK_IMPORTED_MODULE_0__.assert)(!loader.parseSync);\n throw new Error(\"\".concat(loader.id, \" loader - no parser found and worker is disabled\"));\n}\n//# sourceMappingURL=parse.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/lib/api/parse.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/lib/api/register-loaders.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/lib/api/register-loaders.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ _unregisterLoaders: () => (/* binding */ _unregisterLoaders),\n/* harmony export */ getRegisteredLoaders: () => (/* binding */ getRegisteredLoaders),\n/* harmony export */ registerLoaders: () => (/* binding */ registerLoaders)\n/* harmony export */ });\n/* harmony import */ var _loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../loader-utils/normalize-loader */ \"./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/normalize-loader.js\");\n/* harmony import */ var _loader_utils_option_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../loader-utils/option-utils */ \"./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/option-utils.js\");\n\n\nconst getGlobalLoaderRegistry = () => {\n const state = (0,_loader_utils_option_utils__WEBPACK_IMPORTED_MODULE_0__.getGlobalLoaderState)();\n state.loaderRegistry = state.loaderRegistry || [];\n return state.loaderRegistry;\n};\nfunction registerLoaders(loaders) {\n const loaderRegistry = getGlobalLoaderRegistry();\n loaders = Array.isArray(loaders) ? loaders : [loaders];\n for (const loader of loaders) {\n const normalizedLoader = (0,_loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_1__.normalizeLoader)(loader);\n if (!loaderRegistry.find(registeredLoader => normalizedLoader === registeredLoader)) {\n loaderRegistry.unshift(normalizedLoader);\n }\n }\n}\nfunction getRegisteredLoaders() {\n return getGlobalLoaderRegistry();\n}\nfunction _unregisterLoaders() {\n const state = (0,_loader_utils_option_utils__WEBPACK_IMPORTED_MODULE_0__.getGlobalLoaderState)();\n state.loaderRegistry = [];\n}\n//# sourceMappingURL=register-loaders.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/lib/api/register-loaders.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/lib/api/select-loader.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/lib/api/select-loader.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ selectLoader: () => (/* binding */ selectLoader),\n/* harmony export */ selectLoaderSync: () => (/* binding */ selectLoaderSync)\n/* harmony export */ });\n/* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @loaders.gl/loader-utils */ \"./node_modules/@loaders.gl/loader-utils/dist/esm/lib/path-utils/path.js\");\n/* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @loaders.gl/loader-utils */ \"./node_modules/@loaders.gl/loader-utils/dist/esm/lib/binary-utils/array-buffer-utils.js\");\n/* harmony import */ var _loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../loader-utils/normalize-loader */ \"./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/normalize-loader.js\");\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/log */ \"./node_modules/@loaders.gl/core/dist/esm/lib/utils/log.js\");\n/* harmony import */ var _utils_resource_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/resource-utils */ \"./node_modules/@loaders.gl/core/dist/esm/lib/utils/resource-utils.js\");\n/* harmony import */ var _register_loaders__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./register-loaders */ \"./node_modules/@loaders.gl/core/dist/esm/lib/api/register-loaders.js\");\n/* harmony import */ var _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../javascript-utils/is-type */ \"./node_modules/@loaders.gl/core/dist/esm/javascript-utils/is-type.js\");\n/* harmony import */ var _utils_url_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/url-utils */ \"./node_modules/@loaders.gl/core/dist/esm/lib/utils/url-utils.js\");\n\n\n\n\n\n\n\nconst EXT_PATTERN = /\\.([^.]+)$/;\nasync function selectLoader(data) {\n let loaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n let options = arguments.length > 2 ? arguments[2] : undefined;\n let context = arguments.length > 3 ? arguments[3] : undefined;\n if (!validHTTPResponse(data)) {\n return null;\n }\n let loader = selectLoaderSync(data, loaders, {\n ...options,\n nothrow: true\n }, context);\n if (loader) {\n return loader;\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isBlob)(data)) {\n data = await data.slice(0, 10).arrayBuffer();\n loader = selectLoaderSync(data, loaders, options, context);\n }\n if (!loader && !(options !== null && options !== void 0 && options.nothrow)) {\n throw new Error(getNoValidLoaderMessage(data));\n }\n return loader;\n}\nfunction selectLoaderSync(data) {\n let loaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n let options = arguments.length > 2 ? arguments[2] : undefined;\n let context = arguments.length > 3 ? arguments[3] : undefined;\n if (!validHTTPResponse(data)) {\n return null;\n }\n if (loaders && !Array.isArray(loaders)) {\n return (0,_loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_1__.normalizeLoader)(loaders);\n }\n let candidateLoaders = [];\n if (loaders) {\n candidateLoaders = candidateLoaders.concat(loaders);\n }\n if (!(options !== null && options !== void 0 && options.ignoreRegisteredLoaders)) {\n candidateLoaders.push(...(0,_register_loaders__WEBPACK_IMPORTED_MODULE_2__.getRegisteredLoaders)());\n }\n normalizeLoaders(candidateLoaders);\n const loader = selectLoaderInternal(data, candidateLoaders, options, context);\n if (!loader && !(options !== null && options !== void 0 && options.nothrow)) {\n throw new Error(getNoValidLoaderMessage(data));\n }\n return loader;\n}\nfunction selectLoaderInternal(data, loaders, options, context) {\n const url = (0,_utils_resource_utils__WEBPACK_IMPORTED_MODULE_3__.getResourceUrl)(data);\n const type = (0,_utils_resource_utils__WEBPACK_IMPORTED_MODULE_3__.getResourceMIMEType)(data);\n const testUrl = (0,_utils_url_utils__WEBPACK_IMPORTED_MODULE_4__.stripQueryString)(url) || (context === null || context === void 0 ? void 0 : context.url);\n let loader = null;\n let reason = '';\n if (options !== null && options !== void 0 && options.mimeType) {\n loader = findLoaderByMIMEType(loaders, options === null || options === void 0 ? void 0 : options.mimeType);\n reason = \"match forced by supplied MIME type \".concat(options === null || options === void 0 ? void 0 : options.mimeType);\n }\n loader = loader || findLoaderByUrl(loaders, testUrl);\n reason = reason || (loader ? \"matched url \".concat(testUrl) : '');\n loader = loader || findLoaderByMIMEType(loaders, type);\n reason = reason || (loader ? \"matched MIME type \".concat(type) : '');\n loader = loader || findLoaderByInitialBytes(loaders, data);\n reason = reason || (loader ? \"matched initial data \".concat(getFirstCharacters(data)) : '');\n loader = loader || findLoaderByMIMEType(loaders, options === null || options === void 0 ? void 0 : options.fallbackMimeType);\n reason = reason || (loader ? \"matched fallback MIME type \".concat(type) : '');\n if (reason) {\n var _loader;\n _utils_log__WEBPACK_IMPORTED_MODULE_5__.log.log(1, \"selectLoader selected \".concat((_loader = loader) === null || _loader === void 0 ? void 0 : _loader.name, \": \").concat(reason, \".\"));\n }\n return loader;\n}\nfunction validHTTPResponse(data) {\n if (data instanceof Response) {\n if (data.status === 204) {\n return false;\n }\n }\n return true;\n}\nfunction getNoValidLoaderMessage(data) {\n const url = (0,_utils_resource_utils__WEBPACK_IMPORTED_MODULE_3__.getResourceUrl)(data);\n const type = (0,_utils_resource_utils__WEBPACK_IMPORTED_MODULE_3__.getResourceMIMEType)(data);\n let message = 'No valid loader found (';\n message += url ? \"\".concat(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_6__.filename(url), \", \") : 'no url provided, ';\n message += \"MIME type: \".concat(type ? \"\\\"\".concat(type, \"\\\"\") : 'not provided', \", \");\n const firstCharacters = data ? getFirstCharacters(data) : '';\n message += firstCharacters ? \" first bytes: \\\"\".concat(firstCharacters, \"\\\"\") : 'first bytes: not available';\n message += ')';\n return message;\n}\nfunction normalizeLoaders(loaders) {\n for (const loader of loaders) {\n (0,_loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_1__.normalizeLoader)(loader);\n }\n}\nfunction findLoaderByUrl(loaders, url) {\n const match = url && EXT_PATTERN.exec(url);\n const extension = match && match[1];\n return extension ? findLoaderByExtension(loaders, extension) : null;\n}\nfunction findLoaderByExtension(loaders, extension) {\n extension = extension.toLowerCase();\n for (const loader of loaders) {\n for (const loaderExtension of loader.extensions) {\n if (loaderExtension.toLowerCase() === extension) {\n return loader;\n }\n }\n }\n return null;\n}\nfunction findLoaderByMIMEType(loaders, mimeType) {\n for (const loader of loaders) {\n if (loader.mimeTypes && loader.mimeTypes.includes(mimeType)) {\n return loader;\n }\n if (mimeType === \"application/x.\".concat(loader.id)) {\n return loader;\n }\n }\n return null;\n}\nfunction findLoaderByInitialBytes(loaders, data) {\n if (!data) {\n return null;\n }\n for (const loader of loaders) {\n if (typeof data === 'string') {\n if (testDataAgainstText(data, loader)) {\n return loader;\n }\n } else if (ArrayBuffer.isView(data)) {\n if (testDataAgainstBinary(data.buffer, data.byteOffset, loader)) {\n return loader;\n }\n } else if (data instanceof ArrayBuffer) {\n const byteOffset = 0;\n if (testDataAgainstBinary(data, byteOffset, loader)) {\n return loader;\n }\n }\n }\n return null;\n}\nfunction testDataAgainstText(data, loader) {\n if (loader.testText) {\n return loader.testText(data);\n }\n const tests = Array.isArray(loader.tests) ? loader.tests : [loader.tests];\n return tests.some(test => data.startsWith(test));\n}\nfunction testDataAgainstBinary(data, byteOffset, loader) {\n const tests = Array.isArray(loader.tests) ? loader.tests : [loader.tests];\n return tests.some(test => testBinary(data, byteOffset, loader, test));\n}\nfunction testBinary(data, byteOffset, loader, test) {\n if (test instanceof ArrayBuffer) {\n return (0,_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_7__.compareArrayBuffers)(test, data, test.byteLength);\n }\n switch (typeof test) {\n case 'function':\n return test(data, loader);\n case 'string':\n const magic = getMagicString(data, byteOffset, test.length);\n return test === magic;\n default:\n return false;\n }\n}\nfunction getFirstCharacters(data) {\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;\n if (typeof data === 'string') {\n return data.slice(0, length);\n } else if (ArrayBuffer.isView(data)) {\n return getMagicString(data.buffer, data.byteOffset, length);\n } else if (data instanceof ArrayBuffer) {\n const byteOffset = 0;\n return getMagicString(data, byteOffset, length);\n }\n return '';\n}\nfunction getMagicString(arrayBuffer, byteOffset, length) {\n if (arrayBuffer.byteLength < byteOffset + length) {\n return '';\n }\n const dataView = new DataView(arrayBuffer);\n let magic = '';\n for (let i = 0; i < length; i++) {\n magic += String.fromCharCode(dataView.getUint8(byteOffset + i));\n }\n return magic;\n}\n//# sourceMappingURL=select-loader.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/lib/api/select-loader.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/lib/fetch/fetch-file.js": +/*!************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/lib/fetch/fetch-file.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ fetchFile: () => (/* binding */ fetchFile)\n/* harmony export */ });\n/* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/loader-utils */ \"./node_modules/@loaders.gl/loader-utils/dist/esm/lib/path-utils/file-aliases.js\");\n/* harmony import */ var _utils_response_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/response-utils */ \"./node_modules/@loaders.gl/core/dist/esm/lib/utils/response-utils.js\");\n\n\nasync function fetchFile(url, options) {\n if (typeof url === 'string') {\n url = (0,_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__.resolvePath)(url);\n let fetchOptions = options;\n if (options !== null && options !== void 0 && options.fetch && typeof (options === null || options === void 0 ? void 0 : options.fetch) !== 'function') {\n fetchOptions = options.fetch;\n }\n return await fetch(url, fetchOptions);\n }\n return await (0,_utils_response_utils__WEBPACK_IMPORTED_MODULE_1__.makeResponse)(url);\n}\n//# sourceMappingURL=fetch-file.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/lib/fetch/fetch-file.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/get-data.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/get-data.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getArrayBufferOrStringFromData: () => (/* binding */ getArrayBufferOrStringFromData),\n/* harmony export */ getArrayBufferOrStringFromDataSync: () => (/* binding */ getArrayBufferOrStringFromDataSync),\n/* harmony export */ getAsyncIterableFromData: () => (/* binding */ getAsyncIterableFromData),\n/* harmony export */ getReadableStream: () => (/* binding */ getReadableStream)\n/* harmony export */ });\n/* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @loaders.gl/loader-utils */ \"./node_modules/@loaders.gl/loader-utils/dist/esm/lib/iterators/async-iteration.js\");\n/* harmony import */ var _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../javascript-utils/is-type */ \"./node_modules/@loaders.gl/core/dist/esm/javascript-utils/is-type.js\");\n/* harmony import */ var _iterators_make_iterator_make_iterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../iterators/make-iterator/make-iterator */ \"./node_modules/@loaders.gl/core/dist/esm/iterators/make-iterator/make-iterator.js\");\n/* harmony import */ var _utils_response_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/response-utils */ \"./node_modules/@loaders.gl/core/dist/esm/lib/utils/response-utils.js\");\n\n\n\n\nconst ERR_DATA = 'Cannot convert supplied data type';\nfunction getArrayBufferOrStringFromDataSync(data, loader, options) {\n if (loader.text && typeof data === 'string') {\n return data;\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isBuffer)(data)) {\n data = data.buffer;\n }\n if (data instanceof ArrayBuffer) {\n const arrayBuffer = data;\n if (loader.text && !loader.binary) {\n const textDecoder = new TextDecoder('utf8');\n return textDecoder.decode(arrayBuffer);\n }\n return arrayBuffer;\n }\n if (ArrayBuffer.isView(data)) {\n if (loader.text && !loader.binary) {\n const textDecoder = new TextDecoder('utf8');\n return textDecoder.decode(data);\n }\n let arrayBuffer = data.buffer;\n const byteLength = data.byteLength || data.length;\n if (data.byteOffset !== 0 || byteLength !== arrayBuffer.byteLength) {\n arrayBuffer = arrayBuffer.slice(data.byteOffset, data.byteOffset + byteLength);\n }\n return arrayBuffer;\n }\n throw new Error(ERR_DATA);\n}\nasync function getArrayBufferOrStringFromData(data, loader, options) {\n const isArrayBuffer = data instanceof ArrayBuffer || ArrayBuffer.isView(data);\n if (typeof data === 'string' || isArrayBuffer) {\n return getArrayBufferOrStringFromDataSync(data, loader, options);\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isBlob)(data)) {\n data = await (0,_utils_response_utils__WEBPACK_IMPORTED_MODULE_1__.makeResponse)(data);\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isResponse)(data)) {\n const response = data;\n await (0,_utils_response_utils__WEBPACK_IMPORTED_MODULE_1__.checkResponse)(response);\n return loader.binary ? await response.arrayBuffer() : await response.text();\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isReadableStream)(data)) {\n data = (0,_iterators_make_iterator_make_iterator__WEBPACK_IMPORTED_MODULE_2__.makeIterator)(data, options);\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isIterable)(data) || (0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isAsyncIterable)(data)) {\n return (0,_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_3__.concatenateArrayBuffersAsync)(data);\n }\n throw new Error(ERR_DATA);\n}\nasync function getAsyncIterableFromData(data, options) {\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isIterator)(data)) {\n return data;\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isResponse)(data)) {\n const response = data;\n await (0,_utils_response_utils__WEBPACK_IMPORTED_MODULE_1__.checkResponse)(response);\n const body = await response.body;\n return (0,_iterators_make_iterator_make_iterator__WEBPACK_IMPORTED_MODULE_2__.makeIterator)(body, options);\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isBlob)(data) || (0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isReadableStream)(data)) {\n return (0,_iterators_make_iterator_make_iterator__WEBPACK_IMPORTED_MODULE_2__.makeIterator)(data, options);\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isAsyncIterable)(data)) {\n return data[Symbol.asyncIterator]();\n }\n return getIterableFromData(data);\n}\nasync function getReadableStream(data) {\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isReadableStream)(data)) {\n return data;\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isResponse)(data)) {\n return data.body;\n }\n const response = await (0,_utils_response_utils__WEBPACK_IMPORTED_MODULE_1__.makeResponse)(data);\n return response.body;\n}\nfunction getIterableFromData(data) {\n if (ArrayBuffer.isView(data)) {\n return function* oneChunk() {\n yield data.buffer;\n }();\n }\n if (data instanceof ArrayBuffer) {\n return function* oneChunk() {\n yield data;\n }();\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isIterator)(data)) {\n return data;\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isIterable)(data)) {\n return data[Symbol.iterator]();\n }\n throw new Error(ERR_DATA);\n}\n//# sourceMappingURL=get-data.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/get-data.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/get-fetch-function.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/get-fetch-function.js ***! + \***************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getFetchFunction: () => (/* binding */ getFetchFunction)\n/* harmony export */ });\n/* harmony import */ var _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../javascript-utils/is-type */ \"./node_modules/@loaders.gl/core/dist/esm/javascript-utils/is-type.js\");\n/* harmony import */ var _fetch_fetch_file__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../fetch/fetch-file */ \"./node_modules/@loaders.gl/core/dist/esm/lib/fetch/fetch-file.js\");\n/* harmony import */ var _option_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./option-utils */ \"./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/option-utils.js\");\n\n\n\nfunction getFetchFunction(options, context) {\n const globalOptions = (0,_option_utils__WEBPACK_IMPORTED_MODULE_0__.getGlobalLoaderOptions)();\n const fetchOptions = options || globalOptions;\n if (typeof fetchOptions.fetch === 'function') {\n return fetchOptions.fetch;\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_1__.isObject)(fetchOptions.fetch)) {\n return url => (0,_fetch_fetch_file__WEBPACK_IMPORTED_MODULE_2__.fetchFile)(url, fetchOptions);\n }\n if (context !== null && context !== void 0 && context.fetch) {\n return context === null || context === void 0 ? void 0 : context.fetch;\n }\n return _fetch_fetch_file__WEBPACK_IMPORTED_MODULE_2__.fetchFile;\n}\n//# sourceMappingURL=get-fetch-function.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/get-fetch-function.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/loader-context.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/loader-context.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getLoaderContext: () => (/* binding */ getLoaderContext),\n/* harmony export */ getLoadersFromContext: () => (/* binding */ getLoadersFromContext)\n/* harmony export */ });\n/* harmony import */ var _get_fetch_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get-fetch-function */ \"./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/get-fetch-function.js\");\n/* harmony import */ var _utils_url_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/url-utils */ \"./node_modules/@loaders.gl/core/dist/esm/lib/utils/url-utils.js\");\n/* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @loaders.gl/loader-utils */ \"./node_modules/@loaders.gl/loader-utils/dist/esm/lib/path-utils/path.js\");\n\n\n\nfunction getLoaderContext(context, options, parentContext) {\n if (parentContext) {\n return parentContext;\n }\n const newContext = {\n fetch: (0,_get_fetch_function__WEBPACK_IMPORTED_MODULE_0__.getFetchFunction)(options, context),\n ...context\n };\n if (newContext.url) {\n const baseUrl = (0,_utils_url_utils__WEBPACK_IMPORTED_MODULE_1__.stripQueryString)(newContext.url);\n newContext.baseUrl = baseUrl;\n newContext.queryString = (0,_utils_url_utils__WEBPACK_IMPORTED_MODULE_1__.extractQueryString)(newContext.url);\n newContext.filename = _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_2__.filename(baseUrl);\n newContext.baseUrl = _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_2__.dirname(baseUrl);\n }\n if (!Array.isArray(newContext.loaders)) {\n newContext.loaders = null;\n }\n return newContext;\n}\nfunction getLoadersFromContext(loaders, context) {\n if (!context && loaders && !Array.isArray(loaders)) {\n return loaders;\n }\n let candidateLoaders;\n if (loaders) {\n candidateLoaders = Array.isArray(loaders) ? loaders : [loaders];\n }\n if (context && context.loaders) {\n const contextLoaders = Array.isArray(context.loaders) ? context.loaders : [context.loaders];\n candidateLoaders = candidateLoaders ? [...candidateLoaders, ...contextLoaders] : contextLoaders;\n }\n return candidateLoaders && candidateLoaders.length ? candidateLoaders : null;\n}\n//# sourceMappingURL=loader-context.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/loader-context.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/loggers.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/loggers.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ConsoleLog: () => (/* binding */ ConsoleLog),\n/* harmony export */ NullLog: () => (/* binding */ NullLog),\n/* harmony export */ probeLog: () => (/* binding */ probeLog)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _probe_gl_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @probe.gl/log */ \"./node_modules/@probe.gl/log/dist/esm/log.js\");\n\n\nconst probeLog = new _probe_gl_log__WEBPACK_IMPORTED_MODULE_1__.Log({\n id: 'loaders.gl'\n});\nclass NullLog {\n log() {\n return () => {};\n }\n info() {\n return () => {};\n }\n warn() {\n return () => {};\n }\n error() {\n return () => {};\n }\n}\nclass ConsoleLog {\n constructor() {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"console\", void 0);\n this.console = console;\n }\n log() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return this.console.log.bind(this.console, ...args);\n }\n info() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return this.console.info.bind(this.console, ...args);\n }\n warn() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n return this.console.warn.bind(this.console, ...args);\n }\n error() {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n return this.console.error.bind(this.console, ...args);\n }\n}\n//# sourceMappingURL=loggers.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/loggers.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/normalize-loader.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/normalize-loader.js ***! + \*************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ isLoaderObject: () => (/* binding */ isLoaderObject),\n/* harmony export */ normalizeLoader: () => (/* binding */ normalizeLoader)\n/* harmony export */ });\n/* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/loader-utils */ \"./node_modules/@loaders.gl/loader-utils/dist/esm/lib/env-utils/assert.js\");\n\nfunction isLoaderObject(loader) {\n var _loader;\n if (!loader) {\n return false;\n }\n if (Array.isArray(loader)) {\n loader = loader[0];\n }\n const hasExtensions = Array.isArray((_loader = loader) === null || _loader === void 0 ? void 0 : _loader.extensions);\n return hasExtensions;\n}\nfunction normalizeLoader(loader) {\n var _loader2, _loader3;\n (0,_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__.assert)(loader, 'null loader');\n (0,_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__.assert)(isLoaderObject(loader), 'invalid loader');\n let options;\n if (Array.isArray(loader)) {\n options = loader[1];\n loader = loader[0];\n loader = {\n ...loader,\n options: {\n ...loader.options,\n ...options\n }\n };\n }\n if ((_loader2 = loader) !== null && _loader2 !== void 0 && _loader2.parseTextSync || (_loader3 = loader) !== null && _loader3 !== void 0 && _loader3.parseText) {\n loader.text = true;\n }\n if (!loader.text) {\n loader.binary = true;\n }\n return loader;\n}\n//# sourceMappingURL=normalize-loader.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/normalize-loader.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/option-defaults.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/option-defaults.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DEFAULT_LOADER_OPTIONS: () => (/* binding */ DEFAULT_LOADER_OPTIONS),\n/* harmony export */ REMOVED_LOADER_OPTIONS: () => (/* binding */ REMOVED_LOADER_OPTIONS)\n/* harmony export */ });\n/* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @loaders.gl/loader-utils */ \"./node_modules/@loaders.gl/loader-utils/dist/esm/lib/env-utils/globals.js\");\n/* harmony import */ var _loggers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./loggers */ \"./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/loggers.js\");\n\n\nconst DEFAULT_LOADER_OPTIONS = {\n fetch: null,\n mimeType: undefined,\n nothrow: false,\n log: new _loggers__WEBPACK_IMPORTED_MODULE_0__.ConsoleLog(),\n CDN: 'https://unpkg.com/@loaders.gl',\n worker: true,\n maxConcurrency: 3,\n maxMobileConcurrency: 1,\n reuseWorkers: _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__.isBrowser,\n _nodeWorkers: false,\n _workerType: '',\n limit: 0,\n _limitMB: 0,\n batchSize: 'auto',\n batchDebounceMs: 0,\n metadata: false,\n transforms: []\n};\nconst REMOVED_LOADER_OPTIONS = {\n throws: 'nothrow',\n dataType: '(no longer used)',\n uri: 'baseUri',\n method: 'fetch.method',\n headers: 'fetch.headers',\n body: 'fetch.body',\n mode: 'fetch.mode',\n credentials: 'fetch.credentials',\n cache: 'fetch.cache',\n redirect: 'fetch.redirect',\n referrer: 'fetch.referrer',\n referrerPolicy: 'fetch.referrerPolicy',\n integrity: 'fetch.integrity',\n keepalive: 'fetch.keepalive',\n signal: 'fetch.signal'\n};\n//# sourceMappingURL=option-defaults.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/option-defaults.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/option-utils.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/option-utils.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getGlobalLoaderOptions: () => (/* binding */ getGlobalLoaderOptions),\n/* harmony export */ getGlobalLoaderState: () => (/* binding */ getGlobalLoaderState),\n/* harmony export */ normalizeOptions: () => (/* binding */ normalizeOptions),\n/* harmony export */ setGlobalOptions: () => (/* binding */ setGlobalOptions)\n/* harmony export */ });\n/* harmony import */ var _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../javascript-utils/is-type */ \"./node_modules/@loaders.gl/core/dist/esm/javascript-utils/is-type.js\");\n/* harmony import */ var _loggers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./loggers */ \"./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/loggers.js\");\n/* harmony import */ var _option_defaults__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./option-defaults */ \"./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/option-defaults.js\");\n\n\n\nfunction getGlobalLoaderState() {\n globalThis.loaders = globalThis.loaders || {};\n const {\n loaders\n } = globalThis;\n loaders._state = loaders._state || {};\n return loaders._state;\n}\nconst getGlobalLoaderOptions = () => {\n const state = getGlobalLoaderState();\n state.globalOptions = state.globalOptions || {\n ..._option_defaults__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_LOADER_OPTIONS\n };\n return state.globalOptions;\n};\nfunction setGlobalOptions(options) {\n const state = getGlobalLoaderState();\n const globalOptions = getGlobalLoaderOptions();\n state.globalOptions = normalizeOptionsInternal(globalOptions, options);\n}\nfunction normalizeOptions(options, loader, loaders, url) {\n loaders = loaders || [];\n loaders = Array.isArray(loaders) ? loaders : [loaders];\n validateOptions(options, loaders);\n return normalizeOptionsInternal(loader, options, url);\n}\nfunction validateOptions(options, loaders) {\n validateOptionsObject(options, null, _option_defaults__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_LOADER_OPTIONS, _option_defaults__WEBPACK_IMPORTED_MODULE_0__.REMOVED_LOADER_OPTIONS, loaders);\n for (const loader of loaders) {\n const idOptions = options && options[loader.id] || {};\n const loaderOptions = loader.options && loader.options[loader.id] || {};\n const deprecatedOptions = loader.deprecatedOptions && loader.deprecatedOptions[loader.id] || {};\n validateOptionsObject(idOptions, loader.id, loaderOptions, deprecatedOptions, loaders);\n }\n}\nfunction validateOptionsObject(options, id, defaultOptions, deprecatedOptions, loaders) {\n const loaderName = id || 'Top level';\n const prefix = id ? \"\".concat(id, \".\") : '';\n for (const key in options) {\n const isSubOptions = !id && (0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_1__.isObject)(options[key]);\n const isBaseUriOption = key === 'baseUri' && !id;\n const isWorkerUrlOption = key === 'workerUrl' && id;\n if (!(key in defaultOptions) && !isBaseUriOption && !isWorkerUrlOption) {\n if (key in deprecatedOptions) {\n _loggers__WEBPACK_IMPORTED_MODULE_2__.probeLog.warn(\"\".concat(loaderName, \" loader option '\").concat(prefix).concat(key, \"' no longer supported, use '\").concat(deprecatedOptions[key], \"'\"))();\n } else if (!isSubOptions) {\n const suggestion = findSimilarOption(key, loaders);\n _loggers__WEBPACK_IMPORTED_MODULE_2__.probeLog.warn(\"\".concat(loaderName, \" loader option '\").concat(prefix).concat(key, \"' not recognized. \").concat(suggestion))();\n }\n }\n }\n}\nfunction findSimilarOption(optionKey, loaders) {\n const lowerCaseOptionKey = optionKey.toLowerCase();\n let bestSuggestion = '';\n for (const loader of loaders) {\n for (const key in loader.options) {\n if (optionKey === key) {\n return \"Did you mean '\".concat(loader.id, \".\").concat(key, \"'?\");\n }\n const lowerCaseKey = key.toLowerCase();\n const isPartialMatch = lowerCaseOptionKey.startsWith(lowerCaseKey) || lowerCaseKey.startsWith(lowerCaseOptionKey);\n if (isPartialMatch) {\n bestSuggestion = bestSuggestion || \"Did you mean '\".concat(loader.id, \".\").concat(key, \"'?\");\n }\n }\n }\n return bestSuggestion;\n}\nfunction normalizeOptionsInternal(loader, options, url) {\n const loaderDefaultOptions = loader.options || {};\n const mergedOptions = {\n ...loaderDefaultOptions\n };\n addUrlOptions(mergedOptions, url);\n if (mergedOptions.log === null) {\n mergedOptions.log = new _loggers__WEBPACK_IMPORTED_MODULE_2__.NullLog();\n }\n mergeNestedFields(mergedOptions, getGlobalLoaderOptions());\n mergeNestedFields(mergedOptions, options);\n return mergedOptions;\n}\nfunction mergeNestedFields(mergedOptions, options) {\n for (const key in options) {\n if (key in options) {\n const value = options[key];\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_1__.isPureObject)(value) && (0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_1__.isPureObject)(mergedOptions[key])) {\n mergedOptions[key] = {\n ...mergedOptions[key],\n ...options[key]\n };\n } else {\n mergedOptions[key] = options[key];\n }\n }\n }\n}\nfunction addUrlOptions(options, url) {\n if (url && !('baseUri' in options)) {\n options.baseUri = url;\n }\n}\n//# sourceMappingURL=option-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/lib/loader-utils/option-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/lib/utils/log.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/lib/utils/log.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ log: () => (/* binding */ log)\n/* harmony export */ });\n/* harmony import */ var _probe_gl_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @probe.gl/log */ \"./node_modules/@probe.gl/log/dist/esm/log.js\");\n\nconst log = new _probe_gl_log__WEBPACK_IMPORTED_MODULE_0__.Log({\n id: 'loaders.gl'\n});\n//# sourceMappingURL=log.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/lib/utils/log.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/lib/utils/mime-type-utils.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/lib/utils/mime-type-utils.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ parseMIMEType: () => (/* binding */ parseMIMEType),\n/* harmony export */ parseMIMETypeFromURL: () => (/* binding */ parseMIMETypeFromURL)\n/* harmony export */ });\nconst DATA_URL_PATTERN = /^data:([-\\w.]+\\/[-\\w.+]+)(;|,)/;\nconst MIME_TYPE_PATTERN = /^([-\\w.]+\\/[-\\w.+]+)/;\nfunction parseMIMEType(mimeString) {\n const matches = MIME_TYPE_PATTERN.exec(mimeString);\n if (matches) {\n return matches[1];\n }\n return mimeString;\n}\nfunction parseMIMETypeFromURL(url) {\n const matches = DATA_URL_PATTERN.exec(url);\n if (matches) {\n return matches[1];\n }\n return '';\n}\n//# sourceMappingURL=mime-type-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/lib/utils/mime-type-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/lib/utils/resource-utils.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/lib/utils/resource-utils.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getResourceContentLength: () => (/* binding */ getResourceContentLength),\n/* harmony export */ getResourceMIMEType: () => (/* binding */ getResourceMIMEType),\n/* harmony export */ getResourceUrl: () => (/* binding */ getResourceUrl)\n/* harmony export */ });\n/* harmony import */ var _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../javascript-utils/is-type */ \"./node_modules/@loaders.gl/core/dist/esm/javascript-utils/is-type.js\");\n/* harmony import */ var _mime_type_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mime-type-utils */ \"./node_modules/@loaders.gl/core/dist/esm/lib/utils/mime-type-utils.js\");\n/* harmony import */ var _url_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./url-utils */ \"./node_modules/@loaders.gl/core/dist/esm/lib/utils/url-utils.js\");\n\n\n\nfunction getResourceUrl(resource) {\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isResponse)(resource)) {\n const response = resource;\n return response.url;\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isBlob)(resource)) {\n const blob = resource;\n return blob.name || '';\n }\n if (typeof resource === 'string') {\n return resource;\n }\n return '';\n}\nfunction getResourceMIMEType(resource) {\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isResponse)(resource)) {\n const response = resource;\n const contentTypeHeader = response.headers.get('content-type') || '';\n const noQueryUrl = (0,_url_utils__WEBPACK_IMPORTED_MODULE_1__.stripQueryString)(response.url);\n return (0,_mime_type_utils__WEBPACK_IMPORTED_MODULE_2__.parseMIMEType)(contentTypeHeader) || (0,_mime_type_utils__WEBPACK_IMPORTED_MODULE_2__.parseMIMETypeFromURL)(noQueryUrl);\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isBlob)(resource)) {\n const blob = resource;\n return blob.type || '';\n }\n if (typeof resource === 'string') {\n return (0,_mime_type_utils__WEBPACK_IMPORTED_MODULE_2__.parseMIMETypeFromURL)(resource);\n }\n return '';\n}\nfunction getResourceContentLength(resource) {\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isResponse)(resource)) {\n const response = resource;\n return response.headers['content-length'] || -1;\n }\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isBlob)(resource)) {\n const blob = resource;\n return blob.size;\n }\n if (typeof resource === 'string') {\n return resource.length;\n }\n if (resource instanceof ArrayBuffer) {\n return resource.byteLength;\n }\n if (ArrayBuffer.isView(resource)) {\n return resource.byteLength;\n }\n return -1;\n}\n//# sourceMappingURL=resource-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/lib/utils/resource-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/lib/utils/response-utils.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/lib/utils/response-utils.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ checkResponse: () => (/* binding */ checkResponse),\n/* harmony export */ checkResponseSync: () => (/* binding */ checkResponseSync),\n/* harmony export */ makeResponse: () => (/* binding */ makeResponse)\n/* harmony export */ });\n/* harmony import */ var _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../javascript-utils/is-type */ \"./node_modules/@loaders.gl/core/dist/esm/javascript-utils/is-type.js\");\n/* harmony import */ var _resource_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resource-utils */ \"./node_modules/@loaders.gl/core/dist/esm/lib/utils/resource-utils.js\");\n\n\nasync function makeResponse(resource) {\n if ((0,_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__.isResponse)(resource)) {\n return resource;\n }\n const headers = {};\n const contentLength = (0,_resource_utils__WEBPACK_IMPORTED_MODULE_1__.getResourceContentLength)(resource);\n if (contentLength >= 0) {\n headers['content-length'] = String(contentLength);\n }\n const url = (0,_resource_utils__WEBPACK_IMPORTED_MODULE_1__.getResourceUrl)(resource);\n const type = (0,_resource_utils__WEBPACK_IMPORTED_MODULE_1__.getResourceMIMEType)(resource);\n if (type) {\n headers['content-type'] = type;\n }\n const initialDataUrl = await getInitialDataUrl(resource);\n if (initialDataUrl) {\n headers['x-first-bytes'] = initialDataUrl;\n }\n if (typeof resource === 'string') {\n resource = new TextEncoder().encode(resource);\n }\n const response = new Response(resource, {\n headers\n });\n Object.defineProperty(response, 'url', {\n value: url\n });\n return response;\n}\nasync function checkResponse(response) {\n if (!response.ok) {\n const message = await getResponseError(response);\n throw new Error(message);\n }\n}\nfunction checkResponseSync(response) {\n if (!response.ok) {\n let message = \"\".concat(response.status, \" \").concat(response.statusText);\n message = message.length > 60 ? \"\".concat(message.slice(0, 60), \"...\") : message;\n throw new Error(message);\n }\n}\nasync function getResponseError(response) {\n let message = \"Failed to fetch resource \".concat(response.url, \" (\").concat(response.status, \"): \");\n try {\n const contentType = response.headers.get('Content-Type');\n let text = response.statusText;\n if (contentType.includes('application/json')) {\n text += \" \".concat(await response.text());\n }\n message += text;\n message = message.length > 60 ? \"\".concat(message.slice(0, 60), \"...\") : message;\n } catch (error) {}\n return message;\n}\nasync function getInitialDataUrl(resource) {\n const INITIAL_DATA_LENGTH = 5;\n if (typeof resource === 'string') {\n return \"data:,\".concat(resource.slice(0, INITIAL_DATA_LENGTH));\n }\n if (resource instanceof Blob) {\n const blobSlice = resource.slice(0, 5);\n return await new Promise(resolve => {\n const reader = new FileReader();\n reader.onload = event => {\n var _event$target;\n return resolve(event === null || event === void 0 ? void 0 : (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.result);\n };\n reader.readAsDataURL(blobSlice);\n });\n }\n if (resource instanceof ArrayBuffer) {\n const slice = resource.slice(0, INITIAL_DATA_LENGTH);\n const base64 = arrayBufferToBase64(slice);\n return \"data:base64,\".concat(base64);\n }\n return null;\n}\nfunction arrayBufferToBase64(buffer) {\n let binary = '';\n const bytes = new Uint8Array(buffer);\n for (let i = 0; i < bytes.byteLength; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n}\n//# sourceMappingURL=response-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/lib/utils/response-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/core/dist/esm/lib/utils/url-utils.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@loaders.gl/core/dist/esm/lib/utils/url-utils.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ extractQueryString: () => (/* binding */ extractQueryString),\n/* harmony export */ stripQueryString: () => (/* binding */ stripQueryString)\n/* harmony export */ });\nconst QUERY_STRING_PATTERN = /\\?.*/;\nfunction extractQueryString(url) {\n const matches = url.match(QUERY_STRING_PATTERN);\n return matches && matches[0];\n}\nfunction stripQueryString(url) {\n return url.replace(QUERY_STRING_PATTERN, '');\n}\n//# sourceMappingURL=url-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/core/dist/esm/lib/utils/url-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/images/dist/esm/image-loader.js": +/*!******************************************************************!*\ + !*** ./node_modules/@loaders.gl/images/dist/esm/image-loader.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ImageLoader: () => (/* binding */ ImageLoader),\n/* harmony export */ _typecheckImageLoader: () => (/* binding */ _typecheckImageLoader)\n/* harmony export */ });\n/* harmony import */ var _lib_utils_version__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/utils/version */ \"./node_modules/@loaders.gl/images/dist/esm/lib/utils/version.js\");\n/* harmony import */ var _lib_parsers_parse_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/parsers/parse-image */ \"./node_modules/@loaders.gl/images/dist/esm/lib/parsers/parse-image.js\");\n/* harmony import */ var _lib_category_api_binary_image_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/category-api/binary-image-api */ \"./node_modules/@loaders.gl/images/dist/esm/lib/category-api/binary-image-api.js\");\n\n\n\nconst EXTENSIONS = ['png', 'jpg', 'jpeg', 'gif', 'webp', 'bmp', 'ico', 'svg', 'avif'];\nconst MIME_TYPES = ['image/png', 'image/jpeg', 'image/gif', 'image/webp', 'image/avif', 'image/bmp', 'image/vnd.microsoft.icon', 'image/svg+xml'];\nconst DEFAULT_IMAGE_LOADER_OPTIONS = {\n image: {\n type: 'auto',\n decode: true\n }\n};\nconst ImageLoader = {\n id: 'image',\n module: 'images',\n name: 'Images',\n version: _lib_utils_version__WEBPACK_IMPORTED_MODULE_0__.VERSION,\n mimeTypes: MIME_TYPES,\n extensions: EXTENSIONS,\n parse: _lib_parsers_parse_image__WEBPACK_IMPORTED_MODULE_1__.parseImage,\n tests: [arrayBuffer => Boolean((0,_lib_category_api_binary_image_api__WEBPACK_IMPORTED_MODULE_2__.getBinaryImageMetadata)(new DataView(arrayBuffer)))],\n options: DEFAULT_IMAGE_LOADER_OPTIONS\n};\nconst _typecheckImageLoader = ImageLoader;\n//# sourceMappingURL=image-loader.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/images/dist/esm/image-loader.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/images/dist/esm/lib/category-api/binary-image-api.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/images/dist/esm/lib/category-api/binary-image-api.js ***! + \***************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getBinaryImageMetadata: () => (/* binding */ getBinaryImageMetadata),\n/* harmony export */ getBmpMetadata: () => (/* binding */ getBmpMetadata)\n/* harmony export */ });\n/* harmony import */ var _parse_isobmff_binary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse-isobmff-binary */ \"./node_modules/@loaders.gl/images/dist/esm/lib/category-api/parse-isobmff-binary.js\");\n\nconst BIG_ENDIAN = false;\nconst LITTLE_ENDIAN = true;\nfunction getBinaryImageMetadata(binaryData) {\n const dataView = toDataView(binaryData);\n return getPngMetadata(dataView) || getJpegMetadata(dataView) || getGifMetadata(dataView) || getBmpMetadata(dataView) || getISOBMFFMetadata(dataView);\n}\nfunction getISOBMFFMetadata(binaryData) {\n const buffer = new Uint8Array(binaryData instanceof DataView ? binaryData.buffer : binaryData);\n const mediaType = (0,_parse_isobmff_binary__WEBPACK_IMPORTED_MODULE_0__.getISOBMFFMediaType)(buffer);\n if (!mediaType) {\n return null;\n }\n return {\n mimeType: mediaType.mimeType,\n width: 0,\n height: 0\n };\n}\nfunction getPngMetadata(binaryData) {\n const dataView = toDataView(binaryData);\n const isPng = dataView.byteLength >= 24 && dataView.getUint32(0, BIG_ENDIAN) === 0x89504e47;\n if (!isPng) {\n return null;\n }\n return {\n mimeType: 'image/png',\n width: dataView.getUint32(16, BIG_ENDIAN),\n height: dataView.getUint32(20, BIG_ENDIAN)\n };\n}\nfunction getGifMetadata(binaryData) {\n const dataView = toDataView(binaryData);\n const isGif = dataView.byteLength >= 10 && dataView.getUint32(0, BIG_ENDIAN) === 0x47494638;\n if (!isGif) {\n return null;\n }\n return {\n mimeType: 'image/gif',\n width: dataView.getUint16(6, LITTLE_ENDIAN),\n height: dataView.getUint16(8, LITTLE_ENDIAN)\n };\n}\nfunction getBmpMetadata(binaryData) {\n const dataView = toDataView(binaryData);\n const isBmp = dataView.byteLength >= 14 && dataView.getUint16(0, BIG_ENDIAN) === 0x424d && dataView.getUint32(2, LITTLE_ENDIAN) === dataView.byteLength;\n if (!isBmp) {\n return null;\n }\n return {\n mimeType: 'image/bmp',\n width: dataView.getUint32(18, LITTLE_ENDIAN),\n height: dataView.getUint32(22, LITTLE_ENDIAN)\n };\n}\nfunction getJpegMetadata(binaryData) {\n const dataView = toDataView(binaryData);\n const isJpeg = dataView.byteLength >= 3 && dataView.getUint16(0, BIG_ENDIAN) === 0xffd8 && dataView.getUint8(2) === 0xff;\n if (!isJpeg) {\n return null;\n }\n const {\n tableMarkers,\n sofMarkers\n } = getJpegMarkers();\n let i = 2;\n while (i + 9 < dataView.byteLength) {\n const marker = dataView.getUint16(i, BIG_ENDIAN);\n if (sofMarkers.has(marker)) {\n return {\n mimeType: 'image/jpeg',\n height: dataView.getUint16(i + 5, BIG_ENDIAN),\n width: dataView.getUint16(i + 7, BIG_ENDIAN)\n };\n }\n if (!tableMarkers.has(marker)) {\n return null;\n }\n i += 2;\n i += dataView.getUint16(i, BIG_ENDIAN);\n }\n return null;\n}\nfunction getJpegMarkers() {\n const tableMarkers = new Set([0xffdb, 0xffc4, 0xffcc, 0xffdd, 0xfffe]);\n for (let i = 0xffe0; i < 0xfff0; ++i) {\n tableMarkers.add(i);\n }\n const sofMarkers = new Set([0xffc0, 0xffc1, 0xffc2, 0xffc3, 0xffc5, 0xffc6, 0xffc7, 0xffc9, 0xffca, 0xffcb, 0xffcd, 0xffce, 0xffcf, 0xffde]);\n return {\n tableMarkers,\n sofMarkers\n };\n}\nfunction toDataView(data) {\n if (data instanceof DataView) {\n return data;\n }\n if (ArrayBuffer.isView(data)) {\n return new DataView(data.buffer);\n }\n if (data instanceof ArrayBuffer) {\n return new DataView(data);\n }\n throw new Error('toDataView');\n}\n//# sourceMappingURL=binary-image-api.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/images/dist/esm/lib/category-api/binary-image-api.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/images/dist/esm/lib/category-api/image-type.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@loaders.gl/images/dist/esm/lib/category-api/image-type.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getDefaultImageType: () => (/* binding */ getDefaultImageType),\n/* harmony export */ isImageTypeSupported: () => (/* binding */ isImageTypeSupported)\n/* harmony export */ });\n/* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/loader-utils */ \"./node_modules/@loaders.gl/loader-utils/dist/esm/lib/env-utils/globals.js\");\n\nconst {\n _parseImageNode\n} = globalThis;\nconst IMAGE_SUPPORTED = typeof Image !== 'undefined';\nconst IMAGE_BITMAP_SUPPORTED = typeof ImageBitmap !== 'undefined';\nconst NODE_IMAGE_SUPPORTED = Boolean(_parseImageNode);\nconst DATA_SUPPORTED = _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__.isBrowser ? true : NODE_IMAGE_SUPPORTED;\nfunction isImageTypeSupported(type) {\n switch (type) {\n case 'auto':\n return IMAGE_BITMAP_SUPPORTED || IMAGE_SUPPORTED || DATA_SUPPORTED;\n case 'imagebitmap':\n return IMAGE_BITMAP_SUPPORTED;\n case 'image':\n return IMAGE_SUPPORTED;\n case 'data':\n return DATA_SUPPORTED;\n default:\n throw new Error(\"@loaders.gl/images: image \".concat(type, \" not supported in this environment\"));\n }\n}\nfunction getDefaultImageType() {\n if (IMAGE_BITMAP_SUPPORTED) {\n return 'imagebitmap';\n }\n if (IMAGE_SUPPORTED) {\n return 'image';\n }\n if (DATA_SUPPORTED) {\n return 'data';\n }\n throw new Error('Install \\'@loaders.gl/polyfills\\' to parse images under Node.js');\n}\n//# sourceMappingURL=image-type.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/images/dist/esm/lib/category-api/image-type.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/images/dist/esm/lib/category-api/parse-isobmff-binary.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/images/dist/esm/lib/category-api/parse-isobmff-binary.js ***! + \*******************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ decodeMajorBrand: () => (/* binding */ decodeMajorBrand),\n/* harmony export */ getISOBMFFMediaType: () => (/* binding */ getISOBMFFMediaType)\n/* harmony export */ });\nfunction getISOBMFFMediaType(buffer) {\n if (!checkString(buffer, 'ftyp', 4)) {\n return null;\n }\n if ((buffer[8] & 0x60) === 0x00) {\n return null;\n }\n return decodeMajorBrand(buffer);\n}\nfunction decodeMajorBrand(buffer) {\n const brandMajor = getUTF8String(buffer, 8, 12).replace('\\0', ' ').trim();\n switch (brandMajor) {\n case 'avif':\n case 'avis':\n return {\n extension: 'avif',\n mimeType: 'image/avif'\n };\n default:\n return null;\n }\n}\nfunction getUTF8String(array, start, end) {\n return String.fromCharCode(...array.slice(start, end));\n}\nfunction stringToBytes(string) {\n return [...string].map(character => character.charCodeAt(0));\n}\nfunction checkString(buffer, header) {\n let offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n const headerBytes = stringToBytes(header);\n for (let i = 0; i < headerBytes.length; ++i) {\n if (headerBytes[i] !== buffer[i + offset]) {\n return false;\n }\n }\n return true;\n}\n//# sourceMappingURL=parse-isobmff-binary.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/images/dist/esm/lib/category-api/parse-isobmff-binary.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/images/dist/esm/lib/category-api/parsed-image-api.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/images/dist/esm/lib/category-api/parsed-image-api.js ***! + \***************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ deleteImage: () => (/* binding */ deleteImage),\n/* harmony export */ getImageData: () => (/* binding */ getImageData),\n/* harmony export */ getImageSize: () => (/* binding */ getImageSize),\n/* harmony export */ getImageType: () => (/* binding */ getImageType),\n/* harmony export */ isImage: () => (/* binding */ isImage)\n/* harmony export */ });\nfunction isImage(image) {\n return Boolean(getImageTypeOrNull(image));\n}\nfunction deleteImage(image) {\n switch (getImageType(image)) {\n case 'imagebitmap':\n image.close();\n break;\n default:\n }\n}\nfunction getImageType(image) {\n const format = getImageTypeOrNull(image);\n if (!format) {\n throw new Error('Not an image');\n }\n return format;\n}\nfunction getImageSize(image) {\n return getImageData(image);\n}\nfunction getImageData(image) {\n switch (getImageType(image)) {\n case 'data':\n return image;\n case 'image':\n case 'imagebitmap':\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n if (!context) {\n throw new Error('getImageData');\n }\n canvas.width = image.width;\n canvas.height = image.height;\n context.drawImage(image, 0, 0);\n return context.getImageData(0, 0, image.width, image.height);\n default:\n throw new Error('getImageData');\n }\n}\nfunction getImageTypeOrNull(image) {\n if (typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap) {\n return 'imagebitmap';\n }\n if (typeof Image !== 'undefined' && image instanceof Image) {\n return 'image';\n }\n if (image && typeof image === 'object' && image.data && image.width && image.height) {\n return 'data';\n }\n return null;\n}\n//# sourceMappingURL=parsed-image-api.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/images/dist/esm/lib/category-api/parsed-image-api.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/images/dist/esm/lib/parsers/parse-image.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@loaders.gl/images/dist/esm/lib/parsers/parse-image.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ parseImage: () => (/* binding */ parseImage)\n/* harmony export */ });\n/* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @loaders.gl/loader-utils */ \"./node_modules/@loaders.gl/loader-utils/dist/esm/lib/env-utils/assert.js\");\n/* harmony import */ var _category_api_image_type__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../category-api/image-type */ \"./node_modules/@loaders.gl/images/dist/esm/lib/category-api/image-type.js\");\n/* harmony import */ var _category_api_parsed_image_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../category-api/parsed-image-api */ \"./node_modules/@loaders.gl/images/dist/esm/lib/category-api/parsed-image-api.js\");\n/* harmony import */ var _parse_to_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parse-to-image */ \"./node_modules/@loaders.gl/images/dist/esm/lib/parsers/parse-to-image.js\");\n/* harmony import */ var _parse_to_image_bitmap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse-to-image-bitmap */ \"./node_modules/@loaders.gl/images/dist/esm/lib/parsers/parse-to-image-bitmap.js\");\n/* harmony import */ var _parse_to_node_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parse-to-node-image */ \"./node_modules/@loaders.gl/images/dist/esm/lib/parsers/parse-to-node-image.js\");\n\n\n\n\n\n\nasync function parseImage(arrayBuffer, options, context) {\n options = options || {};\n const imageOptions = options.image || {};\n const imageType = imageOptions.type || 'auto';\n const {\n url\n } = context || {};\n const loadType = getLoadableImageType(imageType);\n let image;\n switch (loadType) {\n case 'imagebitmap':\n image = await (0,_parse_to_image_bitmap__WEBPACK_IMPORTED_MODULE_0__.parseToImageBitmap)(arrayBuffer, options, url);\n break;\n case 'image':\n image = await (0,_parse_to_image__WEBPACK_IMPORTED_MODULE_1__.parseToImage)(arrayBuffer, options, url);\n break;\n case 'data':\n image = await (0,_parse_to_node_image__WEBPACK_IMPORTED_MODULE_2__.parseToNodeImage)(arrayBuffer, options);\n break;\n default:\n (0,_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_3__.assert)(false);\n }\n if (imageType === 'data') {\n image = (0,_category_api_parsed_image_api__WEBPACK_IMPORTED_MODULE_4__.getImageData)(image);\n }\n return image;\n}\nfunction getLoadableImageType(type) {\n switch (type) {\n case 'auto':\n case 'data':\n return (0,_category_api_image_type__WEBPACK_IMPORTED_MODULE_5__.getDefaultImageType)();\n default:\n (0,_category_api_image_type__WEBPACK_IMPORTED_MODULE_5__.isImageTypeSupported)(type);\n return type;\n }\n}\n//# sourceMappingURL=parse-image.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/images/dist/esm/lib/parsers/parse-image.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/images/dist/esm/lib/parsers/parse-to-image-bitmap.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/images/dist/esm/lib/parsers/parse-to-image-bitmap.js ***! + \***************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ parseToImageBitmap: () => (/* binding */ parseToImageBitmap)\n/* harmony export */ });\n/* harmony import */ var _svg_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./svg-utils */ \"./node_modules/@loaders.gl/images/dist/esm/lib/parsers/svg-utils.js\");\n/* harmony import */ var _parse_to_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parse-to-image */ \"./node_modules/@loaders.gl/images/dist/esm/lib/parsers/parse-to-image.js\");\n\n\nconst EMPTY_OBJECT = {};\nlet imagebitmapOptionsSupported = true;\nasync function parseToImageBitmap(arrayBuffer, options, url) {\n let blob;\n if ((0,_svg_utils__WEBPACK_IMPORTED_MODULE_0__.isSVG)(url)) {\n const image = await (0,_parse_to_image__WEBPACK_IMPORTED_MODULE_1__.parseToImage)(arrayBuffer, options, url);\n blob = image;\n } else {\n blob = (0,_svg_utils__WEBPACK_IMPORTED_MODULE_0__.getBlob)(arrayBuffer, url);\n }\n const imagebitmapOptions = options && options.imagebitmap;\n return await safeCreateImageBitmap(blob, imagebitmapOptions);\n}\nasync function safeCreateImageBitmap(blob) {\n let imagebitmapOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n if (isEmptyObject(imagebitmapOptions) || !imagebitmapOptionsSupported) {\n imagebitmapOptions = null;\n }\n if (imagebitmapOptions) {\n try {\n return await createImageBitmap(blob, imagebitmapOptions);\n } catch (error) {\n console.warn(error);\n imagebitmapOptionsSupported = false;\n }\n }\n return await createImageBitmap(blob);\n}\nfunction isEmptyObject(object) {\n for (const key in object || EMPTY_OBJECT) {\n return false;\n }\n return true;\n}\n//# sourceMappingURL=parse-to-image-bitmap.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/images/dist/esm/lib/parsers/parse-to-image-bitmap.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/images/dist/esm/lib/parsers/parse-to-image.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@loaders.gl/images/dist/esm/lib/parsers/parse-to-image.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadToImage: () => (/* binding */ loadToImage),\n/* harmony export */ parseToImage: () => (/* binding */ parseToImage)\n/* harmony export */ });\n/* harmony import */ var _svg_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./svg-utils */ \"./node_modules/@loaders.gl/images/dist/esm/lib/parsers/svg-utils.js\");\n\nasync function parseToImage(arrayBuffer, options, url) {\n const blobOrDataUrl = (0,_svg_utils__WEBPACK_IMPORTED_MODULE_0__.getBlobOrSVGDataUrl)(arrayBuffer, url);\n const URL = self.URL || self.webkitURL;\n const objectUrl = typeof blobOrDataUrl !== 'string' && URL.createObjectURL(blobOrDataUrl);\n try {\n return await loadToImage(objectUrl || blobOrDataUrl, options);\n } finally {\n if (objectUrl) {\n URL.revokeObjectURL(objectUrl);\n }\n }\n}\nasync function loadToImage(url, options) {\n const image = new Image();\n image.src = url;\n if (options.image && options.image.decode && image.decode) {\n await image.decode();\n return image;\n }\n return await new Promise((resolve, reject) => {\n try {\n image.onload = () => resolve(image);\n image.onerror = err => reject(new Error(\"Could not load image \".concat(url, \": \").concat(err)));\n } catch (error) {\n reject(error);\n }\n });\n}\n//# sourceMappingURL=parse-to-image.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/images/dist/esm/lib/parsers/parse-to-image.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/images/dist/esm/lib/parsers/parse-to-node-image.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/images/dist/esm/lib/parsers/parse-to-node-image.js ***! + \*************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ parseToNodeImage: () => (/* binding */ parseToNodeImage)\n/* harmony export */ });\n/* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @loaders.gl/loader-utils */ \"./node_modules/@loaders.gl/loader-utils/dist/esm/lib/env-utils/assert.js\");\n/* harmony import */ var _category_api_binary_image_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../category-api/binary-image-api */ \"./node_modules/@loaders.gl/images/dist/esm/lib/category-api/binary-image-api.js\");\n\n\nasync function parseToNodeImage(arrayBuffer, options) {\n const {\n mimeType\n } = (0,_category_api_binary_image_api__WEBPACK_IMPORTED_MODULE_0__.getBinaryImageMetadata)(arrayBuffer) || {};\n const _parseImageNode = globalThis._parseImageNode;\n (0,_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__.assert)(_parseImageNode);\n return await _parseImageNode(arrayBuffer, mimeType);\n}\n//# sourceMappingURL=parse-to-node-image.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/images/dist/esm/lib/parsers/parse-to-node-image.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/images/dist/esm/lib/parsers/svg-utils.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@loaders.gl/images/dist/esm/lib/parsers/svg-utils.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getBlob: () => (/* binding */ getBlob),\n/* harmony export */ getBlobOrSVGDataUrl: () => (/* binding */ getBlobOrSVGDataUrl),\n/* harmony export */ isSVG: () => (/* binding */ isSVG)\n/* harmony export */ });\nconst SVG_DATA_URL_PATTERN = /^data:image\\/svg\\+xml/;\nconst SVG_URL_PATTERN = /\\.svg((\\?|#).*)?$/;\nfunction isSVG(url) {\n return url && (SVG_DATA_URL_PATTERN.test(url) || SVG_URL_PATTERN.test(url));\n}\nfunction getBlobOrSVGDataUrl(arrayBuffer, url) {\n if (isSVG(url)) {\n const textDecoder = new TextDecoder();\n let xmlText = textDecoder.decode(arrayBuffer);\n try {\n if (typeof unescape === 'function' && typeof encodeURIComponent === 'function') {\n xmlText = unescape(encodeURIComponent(xmlText));\n }\n } catch (error) {\n throw new Error(error.message);\n }\n const src = \"data:image/svg+xml;base64,\".concat(btoa(xmlText));\n return src;\n }\n return getBlob(arrayBuffer, url);\n}\nfunction getBlob(arrayBuffer, url) {\n if (isSVG(url)) {\n throw new Error('SVG cannot be parsed directly to imagebitmap');\n }\n return new Blob([new Uint8Array(arrayBuffer)]);\n}\n//# sourceMappingURL=svg-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/images/dist/esm/lib/parsers/svg-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/images/dist/esm/lib/utils/version.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@loaders.gl/images/dist/esm/lib/utils/version.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ VERSION: () => (/* binding */ VERSION)\n/* harmony export */ });\nconst VERSION = true ? \"3.4.15\" : 0;\n//# sourceMappingURL=version.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/images/dist/esm/lib/utils/version.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/loader-utils/dist/esm/lib/binary-utils/array-buffer-utils.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/loader-utils/dist/esm/lib/binary-utils/array-buffer-utils.js ***! + \***********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ compareArrayBuffers: () => (/* binding */ compareArrayBuffers),\n/* harmony export */ concatenateArrayBuffers: () => (/* binding */ concatenateArrayBuffers),\n/* harmony export */ concatenateTypedArrays: () => (/* binding */ concatenateTypedArrays),\n/* harmony export */ sliceArrayBuffer: () => (/* binding */ sliceArrayBuffer)\n/* harmony export */ });\nfunction compareArrayBuffers(arrayBuffer1, arrayBuffer2, byteLength) {\n byteLength = byteLength || arrayBuffer1.byteLength;\n if (arrayBuffer1.byteLength < byteLength || arrayBuffer2.byteLength < byteLength) {\n return false;\n }\n const array1 = new Uint8Array(arrayBuffer1);\n const array2 = new Uint8Array(arrayBuffer2);\n for (let i = 0; i < array1.length; ++i) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n}\nfunction concatenateArrayBuffers() {\n for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n const sourceArrays = sources.map(source2 => source2 instanceof ArrayBuffer ? new Uint8Array(source2) : source2);\n const byteLength = sourceArrays.reduce((length, typedArray) => length + typedArray.byteLength, 0);\n const result = new Uint8Array(byteLength);\n let offset = 0;\n for (const sourceArray of sourceArrays) {\n result.set(sourceArray, offset);\n offset += sourceArray.byteLength;\n }\n return result.buffer;\n}\nfunction concatenateTypedArrays() {\n for (var _len2 = arguments.length, typedArrays = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n typedArrays[_key2] = arguments[_key2];\n }\n const arrays = typedArrays;\n const TypedArrayConstructor = arrays && arrays.length > 1 && arrays[0].constructor || null;\n if (!TypedArrayConstructor) {\n throw new Error('\"concatenateTypedArrays\" - incorrect quantity of arguments or arguments have incompatible data types');\n }\n const sumLength = arrays.reduce((acc, value) => acc + value.length, 0);\n const result = new TypedArrayConstructor(sumLength);\n let offset = 0;\n for (const array of arrays) {\n result.set(array, offset);\n offset += array.length;\n }\n return result;\n}\nfunction sliceArrayBuffer(arrayBuffer, byteOffset, byteLength) {\n const subArray = byteLength !== undefined ? new Uint8Array(arrayBuffer).subarray(byteOffset, byteOffset + byteLength) : new Uint8Array(arrayBuffer).subarray(byteOffset);\n const arrayCopy = new Uint8Array(subArray);\n return arrayCopy.buffer;\n}\n//# sourceMappingURL=array-buffer-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/loader-utils/dist/esm/lib/binary-utils/array-buffer-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/loader-utils/dist/esm/lib/binary-utils/memory-conversion-utils.js": +/*!****************************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/loader-utils/dist/esm/lib/binary-utils/memory-conversion-utils.js ***! + \****************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ isBuffer: () => (/* binding */ isBuffer),\n/* harmony export */ toArrayBuffer: () => (/* binding */ toArrayBuffer),\n/* harmony export */ toBuffer: () => (/* binding */ toBuffer)\n/* harmony export */ });\n/* harmony import */ var _node_buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node/buffer */ \"./node_modules/@loaders.gl/loader-utils/dist/esm/lib/node/buffer.browser.js\");\n\nfunction isBuffer(value) {\n return value && typeof value === 'object' && value.isBuffer;\n}\nfunction toBuffer(data) {\n return _node_buffer__WEBPACK_IMPORTED_MODULE_0__.toBuffer ? _node_buffer__WEBPACK_IMPORTED_MODULE_0__.toBuffer(data) : data;\n}\nfunction toArrayBuffer(data) {\n if (isBuffer(data)) {\n return _node_buffer__WEBPACK_IMPORTED_MODULE_0__.toArrayBuffer(data);\n }\n if (data instanceof ArrayBuffer) {\n return data;\n }\n if (ArrayBuffer.isView(data)) {\n if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {\n return data.buffer;\n }\n return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);\n }\n if (typeof data === 'string') {\n const text = data;\n const uint8Array = new TextEncoder().encode(text);\n return uint8Array.buffer;\n }\n if (data && typeof data === 'object' && data._toArrayBuffer) {\n return data._toArrayBuffer();\n }\n throw new Error('toArrayBuffer');\n}\n//# sourceMappingURL=memory-conversion-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/loader-utils/dist/esm/lib/binary-utils/memory-conversion-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/loader-utils/dist/esm/lib/env-utils/assert.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@loaders.gl/loader-utils/dist/esm/lib/env-utils/assert.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ assert: () => (/* binding */ assert)\n/* harmony export */ });\nfunction assert(condition, message) {\n if (!condition) {\n throw new Error(message || 'loader assertion failed.');\n }\n}\n//# sourceMappingURL=assert.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/loader-utils/dist/esm/lib/env-utils/assert.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/loader-utils/dist/esm/lib/env-utils/globals.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@loaders.gl/loader-utils/dist/esm/lib/env-utils/globals.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ document: () => (/* binding */ document_),\n/* harmony export */ global: () => (/* binding */ global_),\n/* harmony export */ isBrowser: () => (/* binding */ isBrowser),\n/* harmony export */ isWorker: () => (/* binding */ isWorker),\n/* harmony export */ nodeVersion: () => (/* binding */ nodeVersion),\n/* harmony export */ self: () => (/* binding */ self_),\n/* harmony export */ window: () => (/* binding */ window_)\n/* harmony export */ });\nconst globals = {\n self: typeof self !== 'undefined' && self,\n window: typeof window !== 'undefined' && window,\n global: typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g,\n document: typeof document !== 'undefined' && document\n};\nconst self_ = globals.self || globals.window || globals.global || {};\nconst window_ = globals.window || globals.self || globals.global || {};\nconst global_ = globals.global || globals.self || globals.window || {};\nconst document_ = globals.document || {};\n\nconst isBrowser = Boolean(typeof process !== 'object' || String(process) !== '[object process]' || process.browser);\nconst isWorker = typeof importScripts === 'function';\nconst matches = typeof process !== 'undefined' && process.version && /v([0-9]*)/.exec(process.version);\nconst nodeVersion = matches && parseFloat(matches[1]) || 0;\n//# sourceMappingURL=globals.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/loader-utils/dist/esm/lib/env-utils/globals.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/loader-utils/dist/esm/lib/iterators/async-iteration.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/loader-utils/dist/esm/lib/iterators/async-iteration.js ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ concatenateArrayBuffersAsync: () => (/* binding */ concatenateArrayBuffersAsync),\n/* harmony export */ concatenateStringsAsync: () => (/* binding */ concatenateStringsAsync),\n/* harmony export */ forEach: () => (/* binding */ forEach)\n/* harmony export */ });\n/* harmony import */ var _binary_utils_array_buffer_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../binary-utils/array-buffer-utils */ \"./node_modules/@loaders.gl/loader-utils/dist/esm/lib/binary-utils/array-buffer-utils.js\");\n\nasync function forEach(iterator, visitor) {\n while (true) {\n const {\n done,\n value\n } = await iterator.next();\n if (done) {\n iterator.return();\n return;\n }\n const cancel = visitor(value);\n if (cancel) {\n return;\n }\n }\n}\nasync function concatenateArrayBuffersAsync(asyncIterator) {\n const arrayBuffers = [];\n for await (const chunk of asyncIterator) {\n arrayBuffers.push(chunk);\n }\n return (0,_binary_utils_array_buffer_utils__WEBPACK_IMPORTED_MODULE_0__.concatenateArrayBuffers)(...arrayBuffers);\n}\nasync function concatenateStringsAsync(asyncIterator) {\n const strings = [];\n for await (const chunk of asyncIterator) {\n strings.push(chunk);\n }\n return strings.join('');\n}\n//# sourceMappingURL=async-iteration.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/loader-utils/dist/esm/lib/iterators/async-iteration.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/loader-utils/dist/esm/lib/node/buffer.browser.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@loaders.gl/loader-utils/dist/esm/lib/node/buffer.browser.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ toArrayBuffer: () => (/* binding */ toArrayBuffer),\n/* harmony export */ toBuffer: () => (/* binding */ toBuffer)\n/* harmony export */ });\nfunction toArrayBuffer(buffer) {\n return buffer;\n}\nfunction toBuffer(binaryData) {\n throw new Error('Buffer not supported in browser');\n}\n//# sourceMappingURL=buffer.browser.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/loader-utils/dist/esm/lib/node/buffer.browser.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/loader-utils/dist/esm/lib/path-utils/file-aliases.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/loader-utils/dist/esm/lib/path-utils/file-aliases.js ***! + \***************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ addAliases: () => (/* binding */ addAliases),\n/* harmony export */ getPathPrefix: () => (/* binding */ getPathPrefix),\n/* harmony export */ resolvePath: () => (/* binding */ resolvePath),\n/* harmony export */ setPathPrefix: () => (/* binding */ setPathPrefix)\n/* harmony export */ });\nlet pathPrefix = '';\nconst fileAliases = {};\nfunction setPathPrefix(prefix) {\n pathPrefix = prefix;\n}\nfunction getPathPrefix() {\n return pathPrefix;\n}\nfunction addAliases(aliases) {\n Object.assign(fileAliases, aliases);\n}\nfunction resolvePath(filename) {\n for (const alias in fileAliases) {\n if (filename.startsWith(alias)) {\n const replacement = fileAliases[alias];\n filename = filename.replace(alias, replacement);\n }\n }\n if (!filename.startsWith('http://') && !filename.startsWith('https://')) {\n filename = \"\".concat(pathPrefix).concat(filename);\n }\n return filename;\n}\n//# sourceMappingURL=file-aliases.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/loader-utils/dist/esm/lib/path-utils/file-aliases.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/loader-utils/dist/esm/lib/path-utils/get-cwd.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@loaders.gl/loader-utils/dist/esm/lib/path-utils/get-cwd.js ***! + \**********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getCWD: () => (/* binding */ getCWD)\n/* harmony export */ });\nfunction getCWD() {\n var _window$location;\n if (typeof process !== 'undefined' && typeof process.cwd !== 'undefined') {\n return process.cwd();\n }\n const pathname = (_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname;\n return (pathname === null || pathname === void 0 ? void 0 : pathname.slice(0, pathname.lastIndexOf('/') + 1)) || '';\n}\n//# sourceMappingURL=get-cwd.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/loader-utils/dist/esm/lib/path-utils/get-cwd.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/loader-utils/dist/esm/lib/path-utils/path.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@loaders.gl/loader-utils/dist/esm/lib/path-utils/path.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ dirname: () => (/* binding */ dirname),\n/* harmony export */ filename: () => (/* binding */ filename),\n/* harmony export */ join: () => (/* binding */ join),\n/* harmony export */ resolve: () => (/* binding */ resolve)\n/* harmony export */ });\n/* harmony import */ var _get_cwd__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get-cwd */ \"./node_modules/@loaders.gl/loader-utils/dist/esm/lib/path-utils/get-cwd.js\");\n\nfunction filename(url) {\n const slashIndex = url ? url.lastIndexOf('/') : -1;\n return slashIndex >= 0 ? url.substr(slashIndex + 1) : '';\n}\nfunction dirname(url) {\n const slashIndex = url ? url.lastIndexOf('/') : -1;\n return slashIndex >= 0 ? url.substr(0, slashIndex) : '';\n}\nfunction join() {\n for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) {\n parts[_key] = arguments[_key];\n }\n const separator = '/';\n parts = parts.map((part, index) => {\n if (index) {\n part = part.replace(new RegExp(\"^\".concat(separator)), '');\n }\n if (index !== parts.length - 1) {\n part = part.replace(new RegExp(\"\".concat(separator, \"$\")), '');\n }\n return part;\n });\n return parts.join(separator);\n}\nfunction resolve() {\n const paths = [];\n for (let _i = 0; _i < arguments.length; _i++) {\n paths[_i] = _i < 0 || arguments.length <= _i ? undefined : arguments[_i];\n }\n let resolvedPath = '';\n let resolvedAbsolute = false;\n let cwd;\n for (let i = paths.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n let path;\n if (i >= 0) {\n path = paths[i];\n } else {\n if (cwd === undefined) {\n cwd = (0,_get_cwd__WEBPACK_IMPORTED_MODULE_0__.getCWD)();\n }\n path = cwd;\n }\n if (path.length === 0) {\n continue;\n }\n resolvedPath = \"\".concat(path, \"/\").concat(resolvedPath);\n resolvedAbsolute = path.charCodeAt(0) === SLASH;\n }\n resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);\n if (resolvedAbsolute) {\n return \"/\".concat(resolvedPath);\n } else if (resolvedPath.length > 0) {\n return resolvedPath;\n }\n return '.';\n}\nconst SLASH = 47;\nconst DOT = 46;\nfunction normalizeStringPosix(path, allowAboveRoot) {\n let res = '';\n let lastSlash = -1;\n let dots = 0;\n let code;\n let isAboveRoot = false;\n for (let i = 0; i <= path.length; ++i) {\n if (i < path.length) {\n code = path.charCodeAt(i);\n } else if (code === SLASH) {\n break;\n } else {\n code = SLASH;\n }\n if (code === SLASH) {\n if (lastSlash === i - 1 || dots === 1) {} else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || !isAboveRoot || res.charCodeAt(res.length - 1) !== DOT || res.charCodeAt(res.length - 2) !== DOT) {\n if (res.length > 2) {\n const start = res.length - 1;\n let j = start;\n for (; j >= 0; --j) {\n if (res.charCodeAt(j) === SLASH) {\n break;\n }\n }\n if (j !== start) {\n res = j === -1 ? '' : res.slice(0, j);\n lastSlash = i;\n dots = 0;\n isAboveRoot = false;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSlash = i;\n dots = 0;\n isAboveRoot = false;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0) {\n res += '/..';\n } else {\n res = '..';\n }\n isAboveRoot = true;\n }\n } else {\n const slice = path.slice(lastSlash + 1, i);\n if (res.length > 0) {\n res += \"/\".concat(slice);\n } else {\n res = slice;\n }\n isAboveRoot = false;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === DOT && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\n//# sourceMappingURL=path.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/loader-utils/dist/esm/lib/path-utils/path.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/loader-utils/dist/esm/lib/worker-loader-utils/parse-with-worker.js": +/*!*****************************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/loader-utils/dist/esm/lib/worker-loader-utils/parse-with-worker.js ***! + \*****************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ canParseWithWorker: () => (/* binding */ canParseWithWorker),\n/* harmony export */ parseWithWorker: () => (/* binding */ parseWithWorker)\n/* harmony export */ });\n/* harmony import */ var _loaders_gl_worker_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @loaders.gl/worker-utils */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/globals.js\");\n/* harmony import */ var _loaders_gl_worker_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/worker-utils */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-farm.js\");\n/* harmony import */ var _loaders_gl_worker_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @loaders.gl/worker-utils */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-api/get-worker-url.js\");\n\n\nfunction canParseWithWorker(loader, options) {\n if (!_loaders_gl_worker_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isSupported()) {\n return false;\n }\n if (!_loaders_gl_worker_utils__WEBPACK_IMPORTED_MODULE_1__.isBrowser && !(options !== null && options !== void 0 && options._nodeWorkers)) {\n return false;\n }\n return loader.worker && (options === null || options === void 0 ? void 0 : options.worker);\n}\nasync function parseWithWorker(loader, data, options, context, parseOnMainThread) {\n const name = loader.id;\n const url = (0,_loaders_gl_worker_utils__WEBPACK_IMPORTED_MODULE_2__.getWorkerURL)(loader, options);\n const workerFarm = _loaders_gl_worker_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getWorkerFarm(options);\n const workerPool = workerFarm.getWorkerPool({\n name,\n url\n });\n options = JSON.parse(JSON.stringify(options));\n context = JSON.parse(JSON.stringify(context || {}));\n const job = await workerPool.startJob('process-on-worker', onMessage.bind(null, parseOnMainThread));\n job.postMessage('process', {\n input: data,\n options,\n context\n });\n const result = await job.result;\n return await result.result;\n}\nasync function onMessage(parseOnMainThread, job, type, payload) {\n switch (type) {\n case 'done':\n job.done(payload);\n break;\n case 'error':\n job.error(new Error(payload.error));\n break;\n case 'process':\n const {\n id,\n input,\n options\n } = payload;\n try {\n const result = await parseOnMainThread(input, options);\n job.postMessage('done', {\n id,\n result\n });\n } catch (error) {\n const message = error instanceof Error ? error.message : 'unknown error';\n job.postMessage('error', {\n id,\n error: message\n });\n }\n break;\n default:\n console.warn(\"parse-with-worker unknown message \".concat(type));\n }\n}\n//# sourceMappingURL=parse-with-worker.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/loader-utils/dist/esm/lib/worker-loader-utils/parse-with-worker.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/assert.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/assert.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ assert: () => (/* binding */ assert)\n/* harmony export */ });\nfunction assert(condition, message) {\n if (!condition) {\n throw new Error(message || 'loaders.gl assertion failed.');\n }\n}\n//# sourceMappingURL=assert.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/assert.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/globals.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/globals.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ document: () => (/* binding */ document_),\n/* harmony export */ global: () => (/* binding */ global_),\n/* harmony export */ isBrowser: () => (/* binding */ isBrowser),\n/* harmony export */ isMobile: () => (/* binding */ isMobile),\n/* harmony export */ isWorker: () => (/* binding */ isWorker),\n/* harmony export */ nodeVersion: () => (/* binding */ nodeVersion),\n/* harmony export */ self: () => (/* binding */ self_),\n/* harmony export */ window: () => (/* binding */ window_)\n/* harmony export */ });\nconst globals = {\n self: typeof self !== 'undefined' && self,\n window: typeof window !== 'undefined' && window,\n global: typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g,\n document: typeof document !== 'undefined' && document\n};\nconst self_ = globals.self || globals.window || globals.global || {};\nconst window_ = globals.window || globals.self || globals.global || {};\nconst global_ = globals.global || globals.self || globals.window || {};\nconst document_ = globals.document || {};\n\nconst isBrowser = typeof process !== 'object' || String(process) !== '[object process]' || process.browser;\nconst isWorker = typeof importScripts === 'function';\nconst isMobile = typeof window !== 'undefined' && typeof window.orientation !== 'undefined';\nconst matches = typeof process !== 'undefined' && process.version && /v([0-9]*)/.exec(process.version);\nconst nodeVersion = matches && parseFloat(matches[1]) || 0;\n//# sourceMappingURL=globals.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/globals.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/version.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/version.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ VERSION: () => (/* binding */ VERSION)\n/* harmony export */ });\nconst DEFAULT_VERSION = 'latest';\nconst VERSION = true ? \"3.4.15\" : 0;\nif (false) {}\n//# sourceMappingURL=version.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/version.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/worker-utils/dist/esm/lib/node/worker_threads-browser.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/worker-utils/dist/esm/lib/node/worker_threads-browser.js ***! + \*******************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ NodeWorker: () => (/* binding */ Worker),\n/* harmony export */ NodeWorkerType: () => (/* binding */ Worker),\n/* harmony export */ Worker: () => (/* binding */ Worker),\n/* harmony export */ parentPort: () => (/* binding */ parentPort)\n/* harmony export */ });\nclass Worker {\n terminate() {}\n}\n\n\nconst parentPort = null;\n//# sourceMappingURL=worker_threads-browser.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/worker-utils/dist/esm/lib/node/worker_threads-browser.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-api/get-worker-url.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-api/get-worker-url.js ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getWorkerName: () => (/* binding */ getWorkerName),\n/* harmony export */ getWorkerURL: () => (/* binding */ getWorkerURL)\n/* harmony export */ });\n/* harmony import */ var _env_utils_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../env-utils/assert */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/assert.js\");\n\n\nconst NPM_TAG = 'latest';\nconst VERSION = true ? \"3.4.15\" : 0;\nfunction getWorkerName(worker) {\n const warning = worker.version !== VERSION ? \" (worker-utils@\".concat(VERSION, \")\") : '';\n return \"\".concat(worker.name, \"@\").concat(worker.version).concat(warning);\n}\nfunction getWorkerURL(worker) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const workerOptions = options[worker.id] || {};\n const workerFile = \"\".concat(worker.id, \"-worker.js\");\n let url = workerOptions.workerUrl;\n if (!url && worker.id === 'compression') {\n url = options.workerUrl;\n }\n if (options._workerType === 'test') {\n url = \"modules/\".concat(worker.module, \"/dist/\").concat(workerFile);\n }\n if (!url) {\n let version = worker.version;\n if (version === 'latest') {\n version = NPM_TAG;\n }\n const versionTag = version ? \"@\".concat(version) : '';\n url = \"https://unpkg.com/@loaders.gl/\".concat(worker.module).concat(versionTag, \"/dist/\").concat(workerFile);\n }\n (0,_env_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(url);\n return url;\n}\n//# sourceMappingURL=get-worker-url.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-api/get-worker-url.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-api/validate-worker-version.js": +/*!**************************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-api/validate-worker-version.js ***! + \**************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ validateWorkerVersion: () => (/* binding */ validateWorkerVersion)\n/* harmony export */ });\n/* harmony import */ var _env_utils_assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../env-utils/assert */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/assert.js\");\n/* harmony import */ var _env_utils_version__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../env-utils/version */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/version.js\");\n\n\nfunction validateWorkerVersion(worker) {\n let coreVersion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _env_utils_version__WEBPACK_IMPORTED_MODULE_0__.VERSION;\n (0,_env_utils_assert__WEBPACK_IMPORTED_MODULE_1__.assert)(worker, 'no worker provided');\n const workerVersion = worker.version;\n if (!coreVersion || !workerVersion) {\n return false;\n }\n return true;\n}\nfunction parseVersion(version) {\n const parts = version.split('.').map(Number);\n return {\n major: parts[0],\n minor: parts[1]\n };\n}\n//# sourceMappingURL=validate-worker-version.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-api/validate-worker-version.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-farm.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-farm.js ***! + \***************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WorkerFarm)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _worker_pool__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./worker-pool */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-pool.js\");\n/* harmony import */ var _worker_thread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./worker-thread */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-thread.js\");\n\n\n\nconst DEFAULT_PROPS = {\n maxConcurrency: 3,\n maxMobileConcurrency: 1,\n reuseWorkers: true,\n onDebug: () => {}\n};\nclass WorkerFarm {\n static isSupported() {\n return _worker_thread__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isSupported();\n }\n static getWorkerFarm() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n WorkerFarm._workerFarm = WorkerFarm._workerFarm || new WorkerFarm({});\n WorkerFarm._workerFarm.setProps(props);\n return WorkerFarm._workerFarm;\n }\n constructor(props) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"props\", void 0);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"workerPools\", new Map());\n this.props = {\n ...DEFAULT_PROPS\n };\n this.setProps(props);\n this.workerPools = new Map();\n }\n destroy() {\n for (const workerPool of this.workerPools.values()) {\n workerPool.destroy();\n }\n this.workerPools = new Map();\n }\n setProps(props) {\n this.props = {\n ...this.props,\n ...props\n };\n for (const workerPool of this.workerPools.values()) {\n workerPool.setProps(this._getWorkerPoolProps());\n }\n }\n getWorkerPool(options) {\n const {\n name,\n source,\n url\n } = options;\n let workerPool = this.workerPools.get(name);\n if (!workerPool) {\n workerPool = new _worker_pool__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n name,\n source,\n url\n });\n workerPool.setProps(this._getWorkerPoolProps());\n this.workerPools.set(name, workerPool);\n }\n return workerPool;\n }\n _getWorkerPoolProps() {\n return {\n maxConcurrency: this.props.maxConcurrency,\n maxMobileConcurrency: this.props.maxMobileConcurrency,\n reuseWorkers: this.props.reuseWorkers,\n onDebug: this.props.onDebug\n };\n }\n}\n(0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(WorkerFarm, \"_workerFarm\", void 0);\n//# sourceMappingURL=worker-farm.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-farm.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-job.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-job.js ***! + \**************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WorkerJob)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _env_utils_assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../env-utils/assert */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/assert.js\");\n\n\nclass WorkerJob {\n constructor(jobName, workerThread) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"name\", void 0);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"workerThread\", void 0);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"isRunning\", true);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"result\", void 0);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_resolve\", () => {});\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_reject\", () => {});\n this.name = jobName;\n this.workerThread = workerThread;\n this.result = new Promise((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n }\n postMessage(type, payload) {\n this.workerThread.postMessage({\n source: 'loaders.gl',\n type,\n payload\n });\n }\n done(value) {\n (0,_env_utils_assert__WEBPACK_IMPORTED_MODULE_1__.assert)(this.isRunning);\n this.isRunning = false;\n this._resolve(value);\n }\n error(error) {\n (0,_env_utils_assert__WEBPACK_IMPORTED_MODULE_1__.assert)(this.isRunning);\n this.isRunning = false;\n this._reject(error);\n }\n}\n//# sourceMappingURL=worker-job.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-job.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-pool.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-pool.js ***! + \***************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WorkerPool)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _env_utils_globals__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../env-utils/globals */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/globals.js\");\n/* harmony import */ var _worker_thread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./worker-thread */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-thread.js\");\n/* harmony import */ var _worker_job__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./worker-job */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-job.js\");\n\n\n\n\nclass WorkerPool {\n static isSupported() {\n return _worker_thread__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isSupported();\n }\n constructor(props) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"name\", 'unnamed');\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"source\", void 0);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"url\", void 0);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"maxConcurrency\", 1);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"maxMobileConcurrency\", 1);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"onDebug\", () => {});\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"reuseWorkers\", true);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"props\", {});\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"jobQueue\", []);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"idleQueue\", []);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"count\", 0);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"isDestroyed\", false);\n this.source = props.source;\n this.url = props.url;\n this.setProps(props);\n }\n destroy() {\n this.idleQueue.forEach(worker => worker.destroy());\n this.isDestroyed = true;\n }\n setProps(props) {\n this.props = {\n ...this.props,\n ...props\n };\n if (props.name !== undefined) {\n this.name = props.name;\n }\n if (props.maxConcurrency !== undefined) {\n this.maxConcurrency = props.maxConcurrency;\n }\n if (props.maxMobileConcurrency !== undefined) {\n this.maxMobileConcurrency = props.maxMobileConcurrency;\n }\n if (props.reuseWorkers !== undefined) {\n this.reuseWorkers = props.reuseWorkers;\n }\n if (props.onDebug !== undefined) {\n this.onDebug = props.onDebug;\n }\n }\n async startJob(name) {\n let onMessage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (job, type, data) => job.done(data);\n let onError = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : (job, error) => job.error(error);\n const startPromise = new Promise(onStart => {\n this.jobQueue.push({\n name,\n onMessage,\n onError,\n onStart\n });\n return this;\n });\n this._startQueuedJob();\n return await startPromise;\n }\n async _startQueuedJob() {\n if (!this.jobQueue.length) {\n return;\n }\n const workerThread = this._getAvailableWorker();\n if (!workerThread) {\n return;\n }\n const queuedJob = this.jobQueue.shift();\n if (queuedJob) {\n this.onDebug({\n message: 'Starting job',\n name: queuedJob.name,\n workerThread,\n backlog: this.jobQueue.length\n });\n const job = new _worker_job__WEBPACK_IMPORTED_MODULE_2__[\"default\"](queuedJob.name, workerThread);\n workerThread.onMessage = data => queuedJob.onMessage(job, data.type, data.payload);\n workerThread.onError = error => queuedJob.onError(job, error);\n queuedJob.onStart(job);\n try {\n await job.result;\n } finally {\n this.returnWorkerToQueue(workerThread);\n }\n }\n }\n returnWorkerToQueue(worker) {\n const shouldDestroyWorker = this.isDestroyed || !this.reuseWorkers || this.count > this._getMaxConcurrency();\n if (shouldDestroyWorker) {\n worker.destroy();\n this.count--;\n } else {\n this.idleQueue.push(worker);\n }\n if (!this.isDestroyed) {\n this._startQueuedJob();\n }\n }\n _getAvailableWorker() {\n if (this.idleQueue.length > 0) {\n return this.idleQueue.shift() || null;\n }\n if (this.count < this._getMaxConcurrency()) {\n this.count++;\n const name = \"\".concat(this.name.toLowerCase(), \" (#\").concat(this.count, \" of \").concat(this.maxConcurrency, \")\");\n return new _worker_thread__WEBPACK_IMPORTED_MODULE_1__[\"default\"]({\n name,\n source: this.source,\n url: this.url\n });\n }\n return null;\n }\n _getMaxConcurrency() {\n return _env_utils_globals__WEBPACK_IMPORTED_MODULE_3__.isMobile ? this.maxMobileConcurrency : this.maxConcurrency;\n }\n}\n//# sourceMappingURL=worker-pool.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-pool.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-thread.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-thread.js ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WorkerThread)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _node_worker_threads__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../node/worker_threads */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/node/worker_threads-browser.js\");\n/* harmony import */ var _env_utils_globals__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../env-utils/globals */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/globals.js\");\n/* harmony import */ var _env_utils_assert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../env-utils/assert */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/assert.js\");\n/* harmony import */ var _worker_utils_get_loadable_worker_url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../worker-utils/get-loadable-worker-url */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-utils/get-loadable-worker-url.js\");\n/* harmony import */ var _worker_utils_get_transfer_list__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../worker-utils/get-transfer-list */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-utils/get-transfer-list.js\");\n\n\n\n\n\n\nconst NOOP = () => {};\nclass WorkerThread {\n static isSupported() {\n return typeof Worker !== 'undefined' && _env_utils_globals__WEBPACK_IMPORTED_MODULE_1__.isBrowser || typeof _node_worker_threads__WEBPACK_IMPORTED_MODULE_2__.NodeWorker !== 'undefined' && !_env_utils_globals__WEBPACK_IMPORTED_MODULE_1__.isBrowser;\n }\n constructor(props) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"name\", void 0);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"source\", void 0);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"url\", void 0);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"terminated\", false);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"worker\", void 0);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"onMessage\", void 0);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"onError\", void 0);\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_loadableURL\", '');\n const {\n name,\n source,\n url\n } = props;\n (0,_env_utils_assert__WEBPACK_IMPORTED_MODULE_3__.assert)(source || url);\n this.name = name;\n this.source = source;\n this.url = url;\n this.onMessage = NOOP;\n this.onError = error => console.log(error);\n this.worker = _env_utils_globals__WEBPACK_IMPORTED_MODULE_1__.isBrowser ? this._createBrowserWorker() : this._createNodeWorker();\n }\n destroy() {\n this.onMessage = NOOP;\n this.onError = NOOP;\n this.worker.terminate();\n this.terminated = true;\n }\n get isRunning() {\n return Boolean(this.onMessage);\n }\n postMessage(data, transferList) {\n transferList = transferList || (0,_worker_utils_get_transfer_list__WEBPACK_IMPORTED_MODULE_4__.getTransferList)(data);\n this.worker.postMessage(data, transferList);\n }\n _getErrorFromErrorEvent(event) {\n let message = 'Failed to load ';\n message += \"worker \".concat(this.name, \" from \").concat(this.url, \". \");\n if (event.message) {\n message += \"\".concat(event.message, \" in \");\n }\n if (event.lineno) {\n message += \":\".concat(event.lineno, \":\").concat(event.colno);\n }\n return new Error(message);\n }\n _createBrowserWorker() {\n this._loadableURL = (0,_worker_utils_get_loadable_worker_url__WEBPACK_IMPORTED_MODULE_5__.getLoadableWorkerURL)({\n source: this.source,\n url: this.url\n });\n const worker = new Worker(this._loadableURL, {\n name: this.name\n });\n worker.onmessage = event => {\n if (!event.data) {\n this.onError(new Error('No data received'));\n } else {\n this.onMessage(event.data);\n }\n };\n worker.onerror = error => {\n this.onError(this._getErrorFromErrorEvent(error));\n this.terminated = true;\n };\n worker.onmessageerror = event => console.error(event);\n return worker;\n }\n _createNodeWorker() {\n let worker;\n if (this.url) {\n const absolute = this.url.includes(':/') || this.url.startsWith('/');\n const url = absolute ? this.url : \"./\".concat(this.url);\n worker = new _node_worker_threads__WEBPACK_IMPORTED_MODULE_2__.NodeWorker(url, {\n eval: false\n });\n } else if (this.source) {\n worker = new _node_worker_threads__WEBPACK_IMPORTED_MODULE_2__.NodeWorker(this.source, {\n eval: true\n });\n } else {\n throw new Error('no worker');\n }\n worker.on('message', data => {\n this.onMessage(data);\n });\n worker.on('error', error => {\n this.onError(error);\n });\n worker.on('exit', code => {});\n return worker;\n }\n}\n//# sourceMappingURL=worker-thread.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-thread.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-utils/get-loadable-worker-url.js": +/*!****************************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-utils/get-loadable-worker-url.js ***! + \****************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getLoadableWorkerURL: () => (/* binding */ getLoadableWorkerURL)\n/* harmony export */ });\n/* harmony import */ var _env_utils_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../env-utils/assert */ \"./node_modules/@loaders.gl/worker-utils/dist/esm/lib/env-utils/assert.js\");\n\nconst workerURLCache = new Map();\nfunction getLoadableWorkerURL(props) {\n (0,_env_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(props.source && !props.url || !props.source && props.url);\n let workerURL = workerURLCache.get(props.source || props.url);\n if (!workerURL) {\n if (props.url) {\n workerURL = getLoadableWorkerURLFromURL(props.url);\n workerURLCache.set(props.url, workerURL);\n }\n if (props.source) {\n workerURL = getLoadableWorkerURLFromSource(props.source);\n workerURLCache.set(props.source, workerURL);\n }\n }\n (0,_env_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(workerURL);\n return workerURL;\n}\nfunction getLoadableWorkerURLFromURL(url) {\n if (!url.startsWith('http')) {\n return url;\n }\n const workerSource = buildScriptSource(url);\n return getLoadableWorkerURLFromSource(workerSource);\n}\nfunction getLoadableWorkerURLFromSource(workerSource) {\n const blob = new Blob([workerSource], {\n type: 'application/javascript'\n });\n return URL.createObjectURL(blob);\n}\nfunction buildScriptSource(workerUrl) {\n return \"try {\\n importScripts('\".concat(workerUrl, \"');\\n} catch (error) {\\n console.error(error);\\n throw error;\\n}\");\n}\n//# sourceMappingURL=get-loadable-worker-url.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-utils/get-loadable-worker-url.js?"); + +/***/ }), + +/***/ "./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-utils/get-transfer-list.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-utils/get-transfer-list.js ***! + \**********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getTransferList: () => (/* binding */ getTransferList),\n/* harmony export */ getTransferListForWriter: () => (/* binding */ getTransferListForWriter)\n/* harmony export */ });\nfunction getTransferList(object) {\n let recursive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n let transfers = arguments.length > 2 ? arguments[2] : undefined;\n const transfersSet = transfers || new Set();\n if (!object) {} else if (isTransferable(object)) {\n transfersSet.add(object);\n } else if (isTransferable(object.buffer)) {\n transfersSet.add(object.buffer);\n } else if (ArrayBuffer.isView(object)) {} else if (recursive && typeof object === 'object') {\n for (const key in object) {\n getTransferList(object[key], recursive, transfersSet);\n }\n }\n return transfers === undefined ? Array.from(transfersSet) : [];\n}\nfunction isTransferable(object) {\n if (!object) {\n return false;\n }\n if (object instanceof ArrayBuffer) {\n return true;\n }\n if (typeof MessagePort !== 'undefined' && object instanceof MessagePort) {\n return true;\n }\n if (typeof ImageBitmap !== 'undefined' && object instanceof ImageBitmap) {\n return true;\n }\n if (typeof OffscreenCanvas !== 'undefined' && object instanceof OffscreenCanvas) {\n return true;\n }\n return false;\n}\nfunction getTransferListForWriter(object) {\n if (object === null) {\n return {};\n }\n const clone = Object.assign({}, object);\n Object.keys(clone).forEach(key => {\n if (typeof object[key] === 'object' && !ArrayBuffer.isView(object[key]) && !(object[key] instanceof Array)) {\n clone[key] = getTransferListForWriter(object[key]);\n } else if (typeof clone[key] === 'function' || clone[key] instanceof RegExp) {\n clone[key] = {};\n } else {\n clone[key] = object[key];\n }\n });\n return clone;\n}\n//# sourceMappingURL=get-transfer-list.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-utils/get-transfer-list.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/engine/dist/esm/animation/timeline.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@luma.gl/engine/dist/esm/animation/timeline.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Timeline: () => (/* binding */ Timeline)\n/* harmony export */ });\nlet channelHandles = 1;\nlet animationHandles = 1;\nclass Timeline {\n constructor() {\n this.time = 0;\n this.channels = new Map();\n this.animations = new Map();\n this.playing = false;\n this.lastEngineTime = -1;\n }\n\n addChannel(props) {\n const {\n delay = 0,\n duration = Number.POSITIVE_INFINITY,\n rate = 1,\n repeat = 1\n } = props;\n const handle = channelHandles++;\n const channel = {\n time: 0,\n delay,\n duration,\n rate,\n repeat\n };\n\n this._setChannelTime(channel, this.time);\n\n this.channels.set(handle, channel);\n return handle;\n }\n\n removeChannel(handle) {\n this.channels.delete(handle);\n\n for (const [animationHandle, animation] of this.animations) {\n if (animation.channel === handle) {\n this.detachAnimation(animationHandle);\n }\n }\n }\n\n isFinished(handle) {\n const channel = this.channels.get(handle);\n\n if (channel === undefined) {\n return false;\n }\n\n return this.time >= channel.delay + channel.duration * channel.repeat;\n }\n\n getTime(handle) {\n if (handle === undefined) {\n return this.time;\n }\n\n const channel = this.channels.get(handle);\n\n if (channel === undefined) {\n return -1;\n }\n\n return channel.time;\n }\n\n setTime(time) {\n this.time = Math.max(0, time);\n const channels = this.channels.values();\n\n for (const channel of channels) {\n this._setChannelTime(channel, this.time);\n }\n\n const animations = this.animations.values();\n\n for (const animationData of animations) {\n const {\n animation,\n channel\n } = animationData;\n animation.setTime(this.getTime(channel));\n }\n }\n\n play() {\n this.playing = true;\n }\n\n pause() {\n this.playing = false;\n this.lastEngineTime = -1;\n }\n\n reset() {\n this.setTime(0);\n }\n\n attachAnimation(animation, channelHandle) {\n const animationHandle = animationHandles++;\n this.animations.set(animationHandle, {\n animation,\n channel: channelHandle\n });\n animation.setTime(this.getTime(channelHandle));\n return animationHandle;\n }\n\n detachAnimation(handle) {\n this.animations.delete(handle);\n }\n\n update(engineTime) {\n if (this.playing) {\n if (this.lastEngineTime === -1) {\n this.lastEngineTime = engineTime;\n }\n\n this.setTime(this.time + (engineTime - this.lastEngineTime));\n this.lastEngineTime = engineTime;\n }\n }\n\n _setChannelTime(channel, time) {\n const offsetTime = time - channel.delay;\n const totalDuration = channel.duration * channel.repeat;\n\n if (offsetTime >= totalDuration) {\n channel.time = channel.duration * channel.rate;\n } else {\n channel.time = Math.max(0, offsetTime) % channel.duration;\n channel.time *= channel.rate;\n }\n }\n\n}\n//# sourceMappingURL=timeline.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/engine/dist/esm/animation/timeline.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/engine/dist/esm/geometry/geometry.js": +/*!********************************************************************!*\ + !*** ./node_modules/@luma.gl/engine/dist/esm/geometry/geometry.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DRAW_MODE: () => (/* binding */ DRAW_MODE),\n/* harmony export */ \"default\": () => (/* binding */ Geometry)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/utils.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n\nconst DRAW_MODE = {\n POINTS: 0x0000,\n LINES: 0x0001,\n LINE_LOOP: 0x0002,\n LINE_STRIP: 0x0003,\n TRIANGLES: 0x0004,\n TRIANGLE_STRIP: 0x0005,\n TRIANGLE_FAN: 0x0006\n};\nclass Geometry {\n static get DRAW_MODE() {\n return DRAW_MODE;\n }\n\n constructor() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n id = (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_0__.uid)('geometry'),\n drawMode = DRAW_MODE.TRIANGLES,\n attributes = {},\n indices = null,\n vertexCount = null\n } = props;\n this.id = id;\n this.drawMode = drawMode | 0;\n this.attributes = {};\n this.userData = {};\n\n this._setAttributes(attributes, indices);\n\n this.vertexCount = vertexCount || this._calculateVertexCount(this.attributes, this.indices);\n }\n\n get mode() {\n return this.drawMode;\n }\n\n getVertexCount() {\n return this.vertexCount;\n }\n\n getAttributes() {\n return this.indices ? {\n indices: this.indices,\n ...this.attributes\n } : this.attributes;\n }\n\n _print(attributeName) {\n return \"Geometry \".concat(this.id, \" attribute \").concat(attributeName);\n }\n\n _setAttributes(attributes, indices) {\n if (indices) {\n this.indices = ArrayBuffer.isView(indices) ? {\n value: indices,\n size: 1\n } : indices;\n }\n\n for (const attributeName in attributes) {\n let attribute = attributes[attributeName];\n attribute = ArrayBuffer.isView(attribute) ? {\n value: attribute\n } : attribute;\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__.assert)(ArrayBuffer.isView(attribute.value), \"\".concat(this._print(attributeName), \": must be typed array or object with value as typed array\"));\n\n if ((attributeName === 'POSITION' || attributeName === 'positions') && !attribute.size) {\n attribute.size = 3;\n }\n\n if (attributeName === 'indices') {\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__.assert)(!this.indices);\n this.indices = attribute;\n } else {\n this.attributes[attributeName] = attribute;\n }\n }\n\n if (this.indices && this.indices.isIndexed !== undefined) {\n this.indices = Object.assign({}, this.indices);\n delete this.indices.isIndexed;\n }\n\n return this;\n }\n\n _calculateVertexCount(attributes, indices) {\n if (indices) {\n return indices.value.length;\n }\n\n let vertexCount = Infinity;\n\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n const {\n value,\n size,\n constant\n } = attribute;\n\n if (!constant && value && size >= 1) {\n vertexCount = Math.min(vertexCount, value.length / size);\n }\n }\n\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__.assert)(Number.isFinite(vertexCount));\n return vertexCount;\n }\n\n}\n//# sourceMappingURL=geometry.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/engine/dist/esm/geometry/geometry.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/engine/dist/esm/lib/animation-loop.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@luma.gl/engine/dist/esm/lib/animation-loop.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ AnimationLoop)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/init.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/query.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/request-animation-frame.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/framebuffer.js\");\n/* harmony import */ var _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @probe.gl/env */ \"./node_modules/@probe.gl/env/dist/esm/lib/is-browser.js\");\n\n\n\nconst isPage = (0,_probe_gl_env__WEBPACK_IMPORTED_MODULE_1__[\"default\"])() && typeof document !== 'undefined';\nlet statIdCounter = 0;\nclass AnimationLoop {\n constructor() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n onCreateContext = opts => (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.createGLContext)(opts),\n onAddHTML = null,\n onInitialize = () => {},\n onRender = () => {},\n onFinalize = () => {},\n onError,\n gl = null,\n glOptions = {},\n debug = false,\n createFramebuffer = false,\n autoResizeViewport = true,\n autoResizeDrawingBuffer = true,\n stats = _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_2__.lumaStats.get(\"animation-loop-\".concat(statIdCounter++))\n } = props;\n let {\n useDevicePixels = true\n } = props;\n\n if ('useDevicePixelRatio' in props) {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.deprecated('useDevicePixelRatio', 'useDevicePixels')();\n useDevicePixels = props.useDevicePixelRatio;\n }\n\n this.props = {\n onCreateContext,\n onAddHTML,\n onInitialize,\n onRender,\n onFinalize,\n onError,\n gl,\n glOptions,\n debug,\n createFramebuffer\n };\n this.gl = gl;\n this.needsRedraw = null;\n this.timeline = null;\n this.stats = stats;\n this.cpuTime = this.stats.get('CPU Time');\n this.gpuTime = this.stats.get('GPU Time');\n this.frameRate = this.stats.get('Frame Rate');\n this._initialized = false;\n this._running = false;\n this._animationFrameId = null;\n this._nextFramePromise = null;\n this._resolveNextFrame = null;\n this._cpuStartTime = 0;\n this.setProps({\n autoResizeViewport,\n autoResizeDrawingBuffer,\n useDevicePixels\n });\n this.start = this.start.bind(this);\n this.stop = this.stop.bind(this);\n this._pageLoadPromise = null;\n this._onMousemove = this._onMousemove.bind(this);\n this._onMouseleave = this._onMouseleave.bind(this);\n }\n\n delete() {\n this.stop();\n\n this._setDisplay(null);\n }\n\n setNeedsRedraw(reason) {\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_3__.assert)(typeof reason === 'string');\n this.needsRedraw = this.needsRedraw || reason;\n return this;\n }\n\n setProps(props) {\n if ('autoResizeViewport' in props) {\n this.autoResizeViewport = props.autoResizeViewport;\n }\n\n if ('autoResizeDrawingBuffer' in props) {\n this.autoResizeDrawingBuffer = props.autoResizeDrawingBuffer;\n }\n\n if ('useDevicePixels' in props) {\n this.useDevicePixels = props.useDevicePixels;\n }\n\n return this;\n }\n\n start() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (this._running) {\n return this;\n }\n\n this._running = true;\n\n const startPromise = this._getPageLoadPromise().then(() => {\n if (!this._running || this._initialized) {\n return null;\n }\n\n this._createWebGLContext(opts);\n\n this._createFramebuffer();\n\n this._startEventHandling();\n\n this._initializeCallbackData();\n\n this._updateCallbackData();\n\n this._resizeCanvasDrawingBuffer();\n\n this._resizeViewport();\n\n this._gpuTimeQuery = _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_4__[\"default\"].isSupported(this.gl, ['timers']) ? new _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this.gl) : null;\n this._initialized = true;\n return this.onInitialize(this.animationProps);\n }).then(appContext => {\n if (this._running) {\n this._addCallbackData(appContext || {});\n\n if (appContext !== false) {\n this._startLoop();\n }\n }\n });\n\n if (this.props.onError) {\n startPromise.catch(this.props.onError);\n }\n\n return this;\n }\n\n redraw() {\n if (this.isContextLost()) {\n return this;\n }\n\n this._beginTimers();\n\n this._setupFrame();\n\n this._updateCallbackData();\n\n this._renderFrame(this.animationProps);\n\n this._clearNeedsRedraw();\n\n if (this.offScreen && this.gl.commit) {\n this.gl.commit();\n }\n\n if (this._resolveNextFrame) {\n this._resolveNextFrame(this);\n\n this._nextFramePromise = null;\n this._resolveNextFrame = null;\n }\n\n this._endTimers();\n\n return this;\n }\n\n stop() {\n if (this._running) {\n this._finalizeCallbackData();\n\n this._cancelAnimationFrame(this._animationFrameId);\n\n this._nextFramePromise = null;\n this._resolveNextFrame = null;\n this._animationFrameId = null;\n this._running = false;\n }\n\n return this;\n }\n\n attachTimeline(timeline) {\n this.timeline = timeline;\n return this.timeline;\n }\n\n detachTimeline() {\n this.timeline = null;\n }\n\n waitForRender() {\n this.setNeedsRedraw('waitForRender');\n\n if (!this._nextFramePromise) {\n this._nextFramePromise = new Promise(resolve => {\n this._resolveNextFrame = resolve;\n });\n }\n\n return this._nextFramePromise;\n }\n\n async toDataURL() {\n this.setNeedsRedraw('toDataURL');\n await this.waitForRender();\n return this.gl.canvas.toDataURL();\n }\n\n isContextLost() {\n return this.gl.isContextLost();\n }\n\n onCreateContext() {\n return this.props.onCreateContext(...arguments);\n }\n\n onInitialize() {\n return this.props.onInitialize(...arguments);\n }\n\n onRender() {\n return this.props.onRender(...arguments);\n }\n\n onFinalize() {\n return this.props.onFinalize(...arguments);\n }\n\n getHTMLControlValue(id) {\n let defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n const element = document.getElementById(id);\n return element ? Number(element.value) : defaultValue;\n }\n\n setViewParameters() {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.removed('AnimationLoop.setViewParameters', 'AnimationLoop.setProps')();\n return this;\n }\n\n _startLoop() {\n const renderFrame = () => {\n if (!this._running) {\n return;\n }\n\n this.redraw();\n this._animationFrameId = this._requestAnimationFrame(renderFrame);\n };\n\n this._cancelAnimationFrame(this._animationFrameId);\n\n this._animationFrameId = this._requestAnimationFrame(renderFrame);\n }\n\n _getPageLoadPromise() {\n if (!this._pageLoadPromise) {\n this._pageLoadPromise = isPage ? new Promise((resolve, reject) => {\n if (isPage && document.readyState === 'complete') {\n resolve(document);\n return;\n }\n\n window.addEventListener('load', () => {\n resolve(document);\n });\n }) : Promise.resolve({});\n }\n\n return this._pageLoadPromise;\n }\n\n _setDisplay(display) {\n if (this.display) {\n this.display.delete();\n this.display.animationLoop = null;\n }\n\n if (display) {\n display.animationLoop = this;\n }\n\n this.display = display;\n }\n\n _cancelAnimationFrame(animationFrameId) {\n if (this.display && this.display.cancelAnimationFrame) {\n return this.display.cancelAnimationFrame(animationFrameId);\n }\n\n return (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_5__.cancelAnimationFrame)(animationFrameId);\n }\n\n _requestAnimationFrame(renderFrameCallback) {\n if (this._running) {\n if (this.display && this.display.requestAnimationFrame) {\n return this.display.requestAnimationFrame(renderFrameCallback);\n }\n\n return (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_5__.requestAnimationFrame)(renderFrameCallback);\n }\n\n return undefined;\n }\n\n _renderFrame() {\n if (this.display) {\n this.display._renderFrame(...arguments);\n\n return;\n }\n\n this.onRender(...arguments);\n }\n\n _clearNeedsRedraw() {\n this.needsRedraw = null;\n }\n\n _setupFrame() {\n this._resizeCanvasDrawingBuffer();\n\n this._resizeViewport();\n\n this._resizeFramebuffer();\n }\n\n _initializeCallbackData() {\n this.animationProps = {\n gl: this.gl,\n stop: this.stop,\n canvas: this.gl.canvas,\n framebuffer: this.framebuffer,\n useDevicePixels: this.useDevicePixels,\n needsRedraw: null,\n startTime: Date.now(),\n engineTime: 0,\n tick: 0,\n tock: 0,\n time: 0,\n _timeline: this.timeline,\n _loop: this,\n _animationLoop: this,\n _mousePosition: null\n };\n }\n\n _updateCallbackData() {\n const {\n width,\n height,\n aspect\n } = this._getSizeAndAspect();\n\n if (width !== this.animationProps.width || height !== this.animationProps.height) {\n this.setNeedsRedraw('drawing buffer resized');\n }\n\n if (aspect !== this.animationProps.aspect) {\n this.setNeedsRedraw('drawing buffer aspect changed');\n }\n\n this.animationProps.width = width;\n this.animationProps.height = height;\n this.animationProps.aspect = aspect;\n this.animationProps.needsRedraw = this.needsRedraw;\n this.animationProps.engineTime = Date.now() - this.animationProps.startTime;\n\n if (this.timeline) {\n this.timeline.update(this.animationProps.engineTime);\n }\n\n this.animationProps.tick = Math.floor(this.animationProps.time / 1000 * 60);\n this.animationProps.tock++;\n this.animationProps.time = this.timeline ? this.timeline.getTime() : this.animationProps.engineTime;\n this.animationProps._offScreen = this.offScreen;\n }\n\n _finalizeCallbackData() {\n this.onFinalize(this.animationProps);\n }\n\n _addCallbackData(appContext) {\n if (typeof appContext === 'object' && appContext !== null) {\n this.animationProps = Object.assign({}, this.animationProps, appContext);\n }\n }\n\n _createWebGLContext(opts) {\n this.offScreen = opts.canvas && typeof OffscreenCanvas !== 'undefined' && opts.canvas instanceof OffscreenCanvas;\n opts = Object.assign({}, opts, this.props.glOptions);\n this.gl = this.props.gl ? (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.instrumentGLContext)(this.props.gl, opts) : this.onCreateContext(opts);\n\n if (!(0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL)(this.gl)) {\n throw new Error('AnimationLoop.onCreateContext - illegal context returned');\n }\n\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.resetParameters)(this.gl);\n\n this._createInfoDiv();\n }\n\n _createInfoDiv() {\n if (this.gl.canvas && this.props.onAddHTML) {\n const wrapperDiv = document.createElement('div');\n document.body.appendChild(wrapperDiv);\n wrapperDiv.style.position = 'relative';\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '10px';\n div.style.bottom = '10px';\n div.style.width = '300px';\n div.style.background = 'white';\n wrapperDiv.appendChild(this.gl.canvas);\n wrapperDiv.appendChild(div);\n const html = this.props.onAddHTML(div);\n\n if (html) {\n div.innerHTML = html;\n }\n }\n }\n\n _getSizeAndAspect() {\n const width = this.gl.drawingBufferWidth;\n const height = this.gl.drawingBufferHeight;\n let aspect = 1;\n const {\n canvas\n } = this.gl;\n\n if (canvas && canvas.clientHeight) {\n aspect = canvas.clientWidth / canvas.clientHeight;\n } else if (width > 0 && height > 0) {\n aspect = width / height;\n }\n\n return {\n width,\n height,\n aspect\n };\n }\n\n _resizeViewport() {\n if (this.autoResizeViewport) {\n this.gl.viewport(0, 0, this.gl.drawingBufferWidth, this.gl.drawingBufferHeight);\n }\n }\n\n _resizeCanvasDrawingBuffer() {\n if (this.autoResizeDrawingBuffer) {\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.resizeGLContext)(this.gl, {\n useDevicePixels: this.useDevicePixels\n });\n }\n }\n\n _createFramebuffer() {\n if (this.props.createFramebuffer) {\n this.framebuffer = new _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this.gl);\n }\n }\n\n _resizeFramebuffer() {\n if (this.framebuffer) {\n this.framebuffer.resize({\n width: this.gl.drawingBufferWidth,\n height: this.gl.drawingBufferHeight\n });\n }\n }\n\n _beginTimers() {\n this.frameRate.timeEnd();\n this.frameRate.timeStart();\n\n if (this._gpuTimeQuery && this._gpuTimeQuery.isResultAvailable() && !this._gpuTimeQuery.isTimerDisjoint()) {\n this.stats.get('GPU Time').addTime(this._gpuTimeQuery.getTimerMilliseconds());\n }\n\n if (this._gpuTimeQuery) {\n this._gpuTimeQuery.beginTimeElapsedQuery();\n }\n\n this.cpuTime.timeStart();\n }\n\n _endTimers() {\n this.cpuTime.timeEnd();\n\n if (this._gpuTimeQuery) {\n this._gpuTimeQuery.end();\n }\n }\n\n _startEventHandling() {\n const {\n canvas\n } = this.gl;\n\n if (canvas) {\n canvas.addEventListener('mousemove', this._onMousemove);\n canvas.addEventListener('mouseleave', this._onMouseleave);\n }\n }\n\n _onMousemove(e) {\n this.animationProps._mousePosition = [e.offsetX, e.offsetY];\n }\n\n _onMouseleave(e) {\n this.animationProps._mousePosition = null;\n }\n\n}\n//# sourceMappingURL=animation-loop.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/engine/dist/esm/lib/animation-loop.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/engine/dist/esm/lib/model-utils.js": +/*!******************************************************************!*\ + !*** ./node_modules/@luma.gl/engine/dist/esm/lib/model-utils.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getBuffersFromGeometry: () => (/* binding */ getBuffersFromGeometry),\n/* harmony export */ inferAttributeAccessor: () => (/* binding */ inferAttributeAccessor)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/buffer.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n\nconst GLTF_TO_LUMA_ATTRIBUTE_MAP = {\n POSITION: 'positions',\n NORMAL: 'normals',\n COLOR_0: 'colors',\n TEXCOORD_0: 'texCoords',\n TEXCOORD_1: 'texCoords1',\n TEXCOORD_2: 'texCoords2'\n};\nfunction getBuffersFromGeometry(gl, geometry, options) {\n const buffers = {};\n let indices = geometry.indices;\n\n for (const name in geometry.attributes) {\n const attribute = geometry.attributes[name];\n const remappedName = mapAttributeName(name, options);\n\n if (name === 'indices') {\n indices = attribute;\n } else if (attribute.constant) {\n buffers[remappedName] = attribute.value;\n } else {\n const typedArray = attribute.value;\n const accessor = { ...attribute\n };\n delete accessor.value;\n buffers[remappedName] = [new _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_0__[\"default\"](gl, typedArray), accessor];\n inferAttributeAccessor(name, accessor);\n }\n }\n\n if (indices) {\n const data = indices.value || indices;\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__.assert)(data instanceof Uint16Array || data instanceof Uint32Array, 'attribute array for \"indices\" must be of integer type');\n const accessor = {\n size: 1,\n isIndexed: indices.isIndexed === undefined ? true : indices.isIndexed\n };\n buffers.indices = [new _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_0__[\"default\"](gl, {\n data,\n target: 34963\n }), accessor];\n }\n\n return buffers;\n}\n\nfunction mapAttributeName(name, options) {\n const {\n attributeMap = GLTF_TO_LUMA_ATTRIBUTE_MAP\n } = options || {};\n return attributeMap && attributeMap[name] || name;\n}\n\nfunction inferAttributeAccessor(attributeName, attribute) {\n let category;\n\n switch (attributeName) {\n case 'texCoords':\n case 'texCoord1':\n case 'texCoord2':\n case 'texCoord3':\n category = 'uvs';\n break;\n\n case 'vertices':\n case 'positions':\n case 'normals':\n case 'pickingColors':\n category = 'vectors';\n break;\n\n default:\n }\n\n switch (category) {\n case 'vectors':\n attribute.size = attribute.size || 3;\n break;\n\n case 'uvs':\n attribute.size = attribute.size || 2;\n break;\n\n default:\n }\n\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__.assert)(Number.isFinite(attribute.size), \"attribute \".concat(attributeName, \" needs size\"));\n}\n//# sourceMappingURL=model-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/engine/dist/esm/lib/model-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/engine/dist/esm/lib/model.js": +/*!************************************************************!*\ + !*** ./node_modules/@luma.gl/engine/dist/esm/lib/model.js ***! + \************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Model)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _program_manager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./program-manager */ \"./node_modules/@luma.gl/engine/dist/esm/lib/program-manager.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/utils.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/clear.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/program.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/vertex-array.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/buffer.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/transform-feedback.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/debug/debug-vertex-array.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/debug/debug-uniforms.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/debug/debug-program-configuration.js\");\n/* harmony import */ var _model_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./model-utils */ \"./node_modules/@luma.gl/engine/dist/esm/lib/model-utils.js\");\n\n\n\n\n\nconst LOG_DRAW_PRIORITY = 2;\nconst LOG_DRAW_TIMEOUT = 10000;\nconst ERR_MODEL_PARAMS = 'Model needs drawMode and vertexCount';\n\nconst NOOP = () => {};\n\nconst DRAW_PARAMS = {};\nclass Model {\n constructor(gl) {\n let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const {\n id = (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__.uid)('model')\n } = props;\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_2__.assert)((0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL)(gl));\n this.id = id;\n this.gl = gl;\n this.id = props.id || (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__.uid)('Model');\n this.lastLogTime = 0;\n this.animated = false;\n this.initialize(props);\n }\n\n initialize(props) {\n this.props = {};\n this.programManager = props.programManager || _program_manager__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getDefaultProgramManager(this.gl);\n this._programManagerState = -1;\n this._managedProgram = false;\n const {\n program = null,\n vs,\n fs,\n modules,\n defines,\n inject,\n varyings,\n bufferMode,\n transpileToGLSL100\n } = props;\n this.programProps = {\n program,\n vs,\n fs,\n modules,\n defines,\n inject,\n varyings,\n bufferMode,\n transpileToGLSL100\n };\n this.program = null;\n this.vertexArray = null;\n this._programDirty = true;\n this.userData = {};\n this.needsRedraw = true;\n this._attributes = {};\n this.attributes = {};\n this.uniforms = {};\n this.pickable = true;\n\n this._checkProgram();\n\n this.setUniforms(Object.assign({}, this.getModuleUniforms(props.moduleSettings)));\n this.drawMode = props.drawMode !== undefined ? props.drawMode : 4;\n this.vertexCount = props.vertexCount || 0;\n this.geometryBuffers = {};\n this.isInstanced = props.isInstanced || props.instanced || props.instanceCount > 0;\n\n this._setModelProps(props);\n\n this.geometry = {};\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_2__.assert)(this.drawMode !== undefined && Number.isFinite(this.vertexCount), ERR_MODEL_PARAMS);\n }\n\n setProps(props) {\n this._setModelProps(props);\n }\n\n delete() {\n for (const key in this._attributes) {\n if (this._attributes[key] !== this.attributes[key]) {\n this._attributes[key].delete();\n }\n }\n\n if (this._managedProgram) {\n this.programManager.release(this.program);\n this._managedProgram = false;\n }\n\n this.vertexArray.delete();\n\n this._deleteGeometryBuffers();\n }\n\n getDrawMode() {\n return this.drawMode;\n }\n\n getVertexCount() {\n return this.vertexCount;\n }\n\n getInstanceCount() {\n return this.instanceCount;\n }\n\n getAttributes() {\n return this.attributes;\n }\n\n getProgram() {\n return this.program;\n }\n\n setProgram(props) {\n const {\n program,\n vs,\n fs,\n modules,\n defines,\n inject,\n varyings,\n bufferMode,\n transpileToGLSL100\n } = props;\n this.programProps = {\n program,\n vs,\n fs,\n modules,\n defines,\n inject,\n varyings,\n bufferMode,\n transpileToGLSL100\n };\n this._programDirty = true;\n }\n\n getUniforms() {\n return this.uniforms;\n }\n\n setDrawMode(drawMode) {\n this.drawMode = drawMode;\n return this;\n }\n\n setVertexCount(vertexCount) {\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_2__.assert)(Number.isFinite(vertexCount));\n this.vertexCount = vertexCount;\n return this;\n }\n\n setInstanceCount(instanceCount) {\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_2__.assert)(Number.isFinite(instanceCount));\n this.instanceCount = instanceCount;\n return this;\n }\n\n setGeometry(geometry) {\n this.drawMode = geometry.drawMode;\n this.vertexCount = geometry.getVertexCount();\n\n this._deleteGeometryBuffers();\n\n this.geometryBuffers = (0,_model_utils__WEBPACK_IMPORTED_MODULE_4__.getBuffersFromGeometry)(this.gl, geometry);\n this.vertexArray.setAttributes(this.geometryBuffers);\n return this;\n }\n\n setAttributes() {\n let attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if ((0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__.isObjectEmpty)(attributes)) {\n return this;\n }\n\n const normalizedAttributes = {};\n\n for (const name in attributes) {\n const attribute = attributes[name];\n normalizedAttributes[name] = attribute.getValue ? attribute.getValue() : attribute;\n }\n\n this.vertexArray.setAttributes(normalizedAttributes);\n return this;\n }\n\n setUniforms() {\n let uniforms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n Object.assign(this.uniforms, uniforms);\n return this;\n }\n\n getModuleUniforms(opts) {\n this._checkProgram();\n\n const getUniforms = this.programManager.getUniforms(this.program);\n\n if (getUniforms) {\n return getUniforms(opts);\n }\n\n return {};\n }\n\n updateModuleSettings(opts) {\n const uniforms = this.getModuleUniforms(opts || {});\n return this.setUniforms(uniforms);\n }\n\n clear(opts) {\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_5__.clear)(this.program.gl, opts);\n return this;\n }\n\n draw() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n this._checkProgram();\n\n const {\n moduleSettings = null,\n framebuffer,\n uniforms = {},\n attributes = {},\n transformFeedback = this.transformFeedback,\n parameters = {},\n vertexArray = this.vertexArray\n } = opts;\n this.setAttributes(attributes);\n this.updateModuleSettings(moduleSettings);\n this.setUniforms(uniforms);\n let logPriority;\n\n if (_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.priority >= LOG_DRAW_PRIORITY) {\n logPriority = this._logDrawCallStart(LOG_DRAW_PRIORITY);\n }\n\n const drawParams = this.vertexArray.getDrawParams();\n const {\n isIndexed = drawParams.isIndexed,\n indexType = drawParams.indexType,\n indexOffset = drawParams.indexOffset,\n vertexArrayInstanced = drawParams.isInstanced\n } = this.props;\n\n if (vertexArrayInstanced && !this.isInstanced) {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.warn('Found instanced attributes on non-instanced model', this.id)();\n }\n\n const {\n isInstanced,\n instanceCount\n } = this;\n const {\n onBeforeRender = NOOP,\n onAfterRender = NOOP\n } = this.props;\n onBeforeRender();\n this.program.setUniforms(this.uniforms);\n const didDraw = this.program.draw(Object.assign(DRAW_PARAMS, opts, {\n logPriority,\n uniforms: null,\n framebuffer,\n parameters,\n drawMode: this.getDrawMode(),\n vertexCount: this.getVertexCount(),\n vertexArray,\n transformFeedback,\n isIndexed,\n indexType,\n isInstanced,\n instanceCount,\n offset: isIndexed ? indexOffset : 0\n }));\n onAfterRender();\n\n if (_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.priority >= LOG_DRAW_PRIORITY) {\n this._logDrawCallEnd(logPriority, vertexArray, framebuffer);\n }\n\n return didDraw;\n }\n\n transform() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n discard = true,\n feedbackBuffers,\n unbindModels = []\n } = opts;\n let {\n parameters\n } = opts;\n\n if (feedbackBuffers) {\n this._setFeedbackBuffers(feedbackBuffers);\n }\n\n if (discard) {\n parameters = Object.assign({}, parameters, {\n [35977]: discard\n });\n }\n\n unbindModels.forEach(model => model.vertexArray.unbindBuffers());\n\n try {\n this.draw(Object.assign({}, opts, {\n parameters\n }));\n } finally {\n unbindModels.forEach(model => model.vertexArray.bindBuffers());\n }\n\n return this;\n }\n\n render() {\n let uniforms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.warn('Model.render() is deprecated. Use Model.setUniforms() and Model.draw()')();\n return this.setUniforms(uniforms).draw();\n }\n\n _setModelProps(props) {\n Object.assign(this.props, props);\n\n if ('uniforms' in props) {\n this.setUniforms(props.uniforms);\n }\n\n if ('pickable' in props) {\n this.pickable = props.pickable;\n }\n\n if ('instanceCount' in props) {\n this.instanceCount = props.instanceCount;\n }\n\n if ('geometry' in props) {\n this.setGeometry(props.geometry);\n }\n\n if ('attributes' in props) {\n this.setAttributes(props.attributes);\n }\n\n if ('_feedbackBuffers' in props) {\n this._setFeedbackBuffers(props._feedbackBuffers);\n }\n }\n\n _checkProgram() {\n const needsUpdate = this._programDirty || this.programManager.stateHash !== this._programManagerState;\n\n if (!needsUpdate) {\n return;\n }\n\n let {\n program\n } = this.programProps;\n\n if (program) {\n this._managedProgram = false;\n } else {\n const {\n vs,\n fs,\n modules,\n inject,\n defines,\n varyings,\n bufferMode,\n transpileToGLSL100\n } = this.programProps;\n program = this.programManager.get({\n vs,\n fs,\n modules,\n inject,\n defines,\n varyings,\n bufferMode,\n transpileToGLSL100\n });\n\n if (this.program && this._managedProgram) {\n this.programManager.release(this.program);\n }\n\n this._programManagerState = this.programManager.stateHash;\n this._managedProgram = true;\n }\n\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_2__.assert)(program instanceof _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_6__[\"default\"], 'Model needs a program');\n this._programDirty = false;\n\n if (program === this.program) {\n return;\n }\n\n this.program = program;\n\n if (this.vertexArray) {\n this.vertexArray.setProps({\n program: this.program,\n attributes: this.vertexArray.attributes\n });\n } else {\n this.vertexArray = new _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_7__[\"default\"](this.gl, {\n program: this.program\n });\n }\n\n this.setUniforms(Object.assign({}, this.getModuleUniforms()));\n }\n\n _deleteGeometryBuffers() {\n for (const name in this.geometryBuffers) {\n const buffer = this.geometryBuffers[name][0] || this.geometryBuffers[name];\n\n if (buffer instanceof _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_8__[\"default\"]) {\n buffer.delete();\n }\n }\n }\n\n _setAnimationProps(animationProps) {\n if (this.animated) {\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_2__.assert)(animationProps, 'Model.draw(): animated uniforms but no animationProps');\n }\n }\n\n _setFeedbackBuffers() {\n let feedbackBuffers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if ((0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__.isObjectEmpty)(feedbackBuffers)) {\n return this;\n }\n\n const {\n gl\n } = this.program;\n this.transformFeedback = this.transformFeedback || new _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_9__[\"default\"](gl, {\n program: this.program\n });\n this.transformFeedback.setBuffers(feedbackBuffers);\n return this;\n }\n\n _logDrawCallStart(logLevel) {\n const logDrawTimeout = logLevel > 3 ? 0 : LOG_DRAW_TIMEOUT;\n\n if (Date.now() - this.lastLogTime < logDrawTimeout) {\n return undefined;\n }\n\n this.lastLogTime = Date.now();\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.group(LOG_DRAW_PRIORITY, \">>> DRAWING MODEL \".concat(this.id), {\n collapsed: _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.level <= 2\n })();\n return logLevel;\n }\n\n _logDrawCallEnd(logLevel, vertexArray, uniforms, framebuffer) {\n if (logLevel === undefined) {\n return;\n }\n\n const attributeTable = (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_10__.getDebugTableForVertexArray)({\n vertexArray,\n header: \"\".concat(this.id, \" attributes\"),\n attributes: this._attributes\n });\n const {\n table: uniformTable,\n unusedTable,\n unusedCount\n } = (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_11__.getDebugTableForUniforms)({\n header: \"\".concat(this.id, \" uniforms\"),\n program: this.program,\n uniforms: Object.assign({}, this.program.uniforms, uniforms)\n });\n const {\n table: missingTable,\n count: missingCount\n } = (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_11__.getDebugTableForUniforms)({\n header: \"\".concat(this.id, \" uniforms\"),\n program: this.program,\n uniforms: Object.assign({}, this.program.uniforms, uniforms),\n undefinedOnly: true\n });\n\n if (missingCount > 0) {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.log('MISSING UNIFORMS', Object.keys(missingTable))();\n }\n\n if (unusedCount > 0) {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.log('UNUSED UNIFORMS', Object.keys(unusedTable))();\n }\n\n const configTable = (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_12__.getDebugTableForProgramConfiguration)(this.vertexArray.configuration);\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.table(logLevel, attributeTable)();\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.table(logLevel, uniformTable)();\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.table(logLevel + 1, configTable)();\n\n if (framebuffer) {\n framebuffer.log({\n logLevel: LOG_DRAW_PRIORITY,\n message: \"Rendered to \".concat(framebuffer.id)\n });\n }\n\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.groupEnd(LOG_DRAW_PRIORITY)();\n }\n\n}\n//# sourceMappingURL=model.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/engine/dist/esm/lib/model.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/engine/dist/esm/lib/program-manager.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@luma.gl/engine/dist/esm/lib/program-manager.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ProgramManager)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/shadertools */ \"./node_modules/@luma.gl/shadertools/dist/esm/lib/assemble-shaders.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/program.js\");\n\n\nclass ProgramManager {\n static getDefaultProgramManager(gl) {\n gl.luma = gl.luma || {};\n gl.luma.defaultProgramManager = gl.luma.defaultProgramManager || new ProgramManager(gl);\n return gl.luma.defaultProgramManager;\n }\n\n constructor(gl) {\n this.gl = gl;\n this._programCache = {};\n this._getUniforms = {};\n this._registeredModules = {};\n this._hookFunctions = [];\n this._defaultModules = [];\n this._hashes = {};\n this._hashCounter = 0;\n this.stateHash = 0;\n this._useCounts = {};\n }\n\n addDefaultModule(module) {\n if (!this._defaultModules.find(m => m.name === module.name)) {\n this._defaultModules.push(module);\n }\n\n this.stateHash++;\n }\n\n removeDefaultModule(module) {\n const moduleName = typeof module === 'string' ? module : module.name;\n this._defaultModules = this._defaultModules.filter(m => m.name !== moduleName);\n this.stateHash++;\n }\n\n addShaderHook(hook, opts) {\n if (opts) {\n hook = Object.assign(opts, {\n hook\n });\n }\n\n this._hookFunctions.push(hook);\n\n this.stateHash++;\n }\n\n get() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n vs = '',\n fs = '',\n defines = {},\n inject = {},\n varyings = [],\n bufferMode = 0x8c8d,\n transpileToGLSL100 = false\n } = props;\n\n const modules = this._getModuleList(props.modules);\n\n const vsHash = this._getHash(vs);\n\n const fsHash = this._getHash(fs);\n\n const moduleHashes = modules.map(m => this._getHash(m.name)).sort();\n const varyingHashes = varyings.map(v => this._getHash(v));\n const defineKeys = Object.keys(defines).sort();\n const injectKeys = Object.keys(inject).sort();\n const defineHashes = [];\n const injectHashes = [];\n\n for (const key of defineKeys) {\n defineHashes.push(this._getHash(key));\n defineHashes.push(this._getHash(defines[key]));\n }\n\n for (const key of injectKeys) {\n injectHashes.push(this._getHash(key));\n injectHashes.push(this._getHash(inject[key]));\n }\n\n const hash = \"\".concat(vsHash, \"/\").concat(fsHash, \"D\").concat(defineHashes.join('/'), \"M\").concat(moduleHashes.join('/'), \"I\").concat(injectHashes.join('/'), \"V\").concat(varyingHashes.join('/'), \"H\").concat(this.stateHash, \"B\").concat(bufferMode).concat(transpileToGLSL100 ? 'T' : '');\n\n if (!this._programCache[hash]) {\n const assembled = (0,_luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_0__.assembleShaders)(this.gl, {\n vs,\n fs,\n modules,\n inject,\n defines,\n hookFunctions: this._hookFunctions,\n transpileToGLSL100\n });\n this._programCache[hash] = new _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this.gl, {\n hash,\n vs: assembled.vs,\n fs: assembled.fs,\n varyings,\n bufferMode\n });\n\n this._getUniforms[hash] = assembled.getUniforms || (x => {});\n\n this._useCounts[hash] = 0;\n }\n\n this._useCounts[hash]++;\n return this._programCache[hash];\n }\n\n getUniforms(program) {\n return this._getUniforms[program.hash] || null;\n }\n\n release(program) {\n const hash = program.hash;\n this._useCounts[hash]--;\n\n if (this._useCounts[hash] === 0) {\n this._programCache[hash].delete();\n\n delete this._programCache[hash];\n delete this._getUniforms[hash];\n delete this._useCounts[hash];\n }\n }\n\n _getHash(key) {\n if (this._hashes[key] === undefined) {\n this._hashes[key] = this._hashCounter++;\n }\n\n return this._hashes[key];\n }\n\n _getModuleList() {\n let appModules = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n const modules = new Array(this._defaultModules.length + appModules.length);\n const seen = {};\n let count = 0;\n\n for (let i = 0, len = this._defaultModules.length; i < len; ++i) {\n const module = this._defaultModules[i];\n const name = module.name;\n modules[count++] = module;\n seen[name] = true;\n }\n\n for (let i = 0, len = appModules.length; i < len; ++i) {\n const module = appModules[i];\n const name = module.name;\n\n if (!seen[name]) {\n modules[count++] = module;\n seen[name] = true;\n }\n }\n\n modules.length = count;\n return modules;\n }\n\n}\n//# sourceMappingURL=program-manager.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/engine/dist/esm/lib/program-manager.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/engine/dist/esm/transform/buffer-transform.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@luma.gl/engine/dist/esm/transform/buffer-transform.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ BufferTransform)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/buffer.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/transform-feedback.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n\n\n\nclass BufferTransform {\n constructor(gl) {\n let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.gl = gl;\n this.currentIndex = 0;\n this.feedbackMap = {};\n this.varyings = null;\n this.bindings = [];\n this.resources = {};\n\n this._initialize(props);\n\n Object.seal(this);\n }\n\n setupResources(opts) {\n for (const binding of this.bindings) {\n this._setupTransformFeedback(binding, opts);\n }\n }\n\n updateModelProps() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n varyings\n } = this;\n\n if (varyings.length > 0) {\n props = Object.assign({}, props, {\n varyings\n });\n }\n\n return props;\n }\n\n getDrawOptions() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const binding = this.bindings[this.currentIndex];\n const {\n sourceBuffers,\n transformFeedback\n } = binding;\n const attributes = Object.assign({}, sourceBuffers, opts.attributes);\n return {\n attributes,\n transformFeedback\n };\n }\n\n swap() {\n if (this.feedbackMap) {\n this.currentIndex = this._getNextIndex();\n return true;\n }\n\n return false;\n }\n\n update() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n this._setupBuffers(opts);\n }\n\n getBuffer(varyingName) {\n const {\n feedbackBuffers\n } = this.bindings[this.currentIndex];\n const bufferOrParams = varyingName ? feedbackBuffers[varyingName] : null;\n\n if (!bufferOrParams) {\n return null;\n }\n\n return bufferOrParams instanceof _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__[\"default\"] ? bufferOrParams : bufferOrParams.buffer;\n }\n\n getData() {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n varyingName\n } = options;\n const buffer = this.getBuffer(varyingName);\n\n if (buffer) {\n return buffer.getData();\n }\n\n return null;\n }\n\n delete() {\n for (const name in this.resources) {\n this.resources[name].delete();\n }\n }\n\n _initialize() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n this._setupBuffers(props);\n\n this.varyings = props.varyings || Object.keys(this.bindings[this.currentIndex].feedbackBuffers);\n\n if (this.varyings.length > 0) {\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_2__.assert)((0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(this.gl));\n }\n }\n\n _getFeedbackBuffers(props) {\n const {\n sourceBuffers = {}\n } = props;\n const feedbackBuffers = {};\n\n if (this.bindings[this.currentIndex]) {\n Object.assign(feedbackBuffers, this.bindings[this.currentIndex].feedbackBuffers);\n }\n\n if (this.feedbackMap) {\n for (const sourceName in this.feedbackMap) {\n const feedbackName = this.feedbackMap[sourceName];\n\n if (sourceName in sourceBuffers) {\n feedbackBuffers[feedbackName] = sourceName;\n }\n }\n }\n\n Object.assign(feedbackBuffers, props.feedbackBuffers);\n\n for (const bufferName in feedbackBuffers) {\n const bufferOrRef = feedbackBuffers[bufferName];\n\n if (typeof bufferOrRef === 'string') {\n const sourceBuffer = sourceBuffers[bufferOrRef];\n const {\n byteLength,\n usage,\n accessor\n } = sourceBuffer;\n feedbackBuffers[bufferName] = this._createNewBuffer(bufferName, {\n byteLength,\n usage,\n accessor\n });\n }\n }\n\n return feedbackBuffers;\n }\n\n _setupBuffers() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n sourceBuffers = null\n } = props;\n Object.assign(this.feedbackMap, props.feedbackMap);\n\n const feedbackBuffers = this._getFeedbackBuffers(props);\n\n this._updateBindings({\n sourceBuffers,\n feedbackBuffers\n });\n }\n\n _setupTransformFeedback(binding, _ref) {\n let {\n model\n } = _ref;\n const {\n program\n } = model;\n binding.transformFeedback = new _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.gl, {\n program,\n buffers: binding.feedbackBuffers\n });\n }\n\n _updateBindings(opts) {\n this.bindings[this.currentIndex] = this._updateBinding(this.bindings[this.currentIndex], opts);\n\n if (this.feedbackMap) {\n const {\n sourceBuffers,\n feedbackBuffers\n } = this._swapBuffers(this.bindings[this.currentIndex]);\n\n const nextIndex = this._getNextIndex();\n\n this.bindings[nextIndex] = this._updateBinding(this.bindings[nextIndex], {\n sourceBuffers,\n feedbackBuffers\n });\n }\n }\n\n _updateBinding(binding, opts) {\n if (!binding) {\n return {\n sourceBuffers: Object.assign({}, opts.sourceBuffers),\n feedbackBuffers: Object.assign({}, opts.feedbackBuffers)\n };\n }\n\n Object.assign(binding.sourceBuffers, opts.sourceBuffers);\n Object.assign(binding.feedbackBuffers, opts.feedbackBuffers);\n\n if (binding.transformFeedback) {\n binding.transformFeedback.setBuffers(binding.feedbackBuffers);\n }\n\n return binding;\n }\n\n _swapBuffers(opts) {\n if (!this.feedbackMap) {\n return null;\n }\n\n const sourceBuffers = Object.assign({}, opts.sourceBuffers);\n const feedbackBuffers = Object.assign({}, opts.feedbackBuffers);\n\n for (const srcName in this.feedbackMap) {\n const dstName = this.feedbackMap[srcName];\n sourceBuffers[srcName] = opts.feedbackBuffers[dstName];\n feedbackBuffers[dstName] = opts.sourceBuffers[srcName];\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_2__.assert)(feedbackBuffers[dstName] instanceof _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n }\n\n return {\n sourceBuffers,\n feedbackBuffers\n };\n }\n\n _createNewBuffer(name, opts) {\n const buffer = new _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this.gl, opts);\n\n if (this.resources[name]) {\n this.resources[name].delete();\n }\n\n this.resources[name] = buffer;\n return buffer;\n }\n\n _getNextIndex() {\n return (this.currentIndex + 1) % 2;\n }\n\n}\n//# sourceMappingURL=buffer-transform.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/engine/dist/esm/transform/buffer-transform.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/engine/dist/esm/transform/texture-transform.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@luma.gl/engine/dist/esm/transform/texture-transform.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ TextureTransform)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/copy-and-blit.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture-2d.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/buffer.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/framebuffer.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/texture-utils.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/get-shader-version.js\");\n/* harmony import */ var _luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @luma.gl/shadertools */ \"./node_modules/@luma.gl/shadertools/dist/esm/utils/shader-utils.js\");\n/* harmony import */ var _luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @luma.gl/shadertools */ \"./node_modules/@luma.gl/shadertools/dist/esm/lib/inject-shader.js\");\n/* harmony import */ var _luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @luma.gl/shadertools */ \"./node_modules/@luma.gl/shadertools/dist/esm/modules/transform/transform.js\");\n/* harmony import */ var _transform_shader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transform-shader-utils */ \"./node_modules/@luma.gl/engine/dist/esm/transform/transform-shader-utils.js\");\n\n\n\nconst SRC_TEX_PARAMETER_OVERRIDES = {\n [10241]: 9728,\n [10240]: 9728,\n [10242]: 33071,\n [10243]: 33071\n};\nconst FS_OUTPUT_VARIABLE = 'transform_output';\nclass TextureTransform {\n constructor(gl) {\n let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.gl = gl;\n this.id = this.currentIndex = 0;\n this._swapTexture = null;\n this.targetTextureVarying = null;\n this.targetTextureType = null;\n this.samplerTextureMap = null;\n this.bindings = [];\n this.resources = {};\n\n this._initialize(props);\n\n Object.seal(this);\n }\n\n updateModelProps() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n const updatedModelProps = this._processVertexShader(props);\n\n return Object.assign({}, props, updatedModelProps);\n }\n\n getDrawOptions() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n sourceBuffers,\n sourceTextures,\n framebuffer,\n targetTexture\n } = this.bindings[this.currentIndex];\n const attributes = Object.assign({}, sourceBuffers, opts.attributes);\n const uniforms = Object.assign({}, opts.uniforms);\n const parameters = Object.assign({}, opts.parameters);\n let discard = opts.discard;\n\n if (this.hasSourceTextures || this.hasTargetTexture) {\n attributes.transform_elementID = this.elementIDBuffer;\n\n for (const sampler in this.samplerTextureMap) {\n const textureName = this.samplerTextureMap[sampler];\n uniforms[sampler] = sourceTextures[textureName];\n }\n\n this._setSourceTextureParameters();\n\n const sizeUniforms = (0,_transform_shader_utils__WEBPACK_IMPORTED_MODULE_0__.getSizeUniforms)({\n sourceTextureMap: sourceTextures,\n targetTextureVarying: this.targetTextureVarying,\n targetTexture\n });\n Object.assign(uniforms, sizeUniforms);\n }\n\n if (this.hasTargetTexture) {\n discard = false;\n parameters.viewport = [0, 0, framebuffer.width, framebuffer.height];\n }\n\n return {\n attributes,\n framebuffer,\n uniforms,\n discard,\n parameters\n };\n }\n\n swap() {\n if (this._swapTexture) {\n this.currentIndex = this._getNextIndex();\n return true;\n }\n\n return false;\n }\n\n update() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n this._setupTextures(opts);\n }\n\n getTargetTexture() {\n const {\n targetTexture\n } = this.bindings[this.currentIndex];\n return targetTexture;\n }\n\n getData() {\n let {\n packed = false\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n framebuffer\n } = this.bindings[this.currentIndex];\n const pixels = (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__.readPixelsToArray)(framebuffer);\n\n if (!packed) {\n return pixels;\n }\n\n const ArrayType = pixels.constructor;\n const channelCount = (0,_luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_2__.typeToChannelCount)(this.targetTextureType);\n const packedPixels = new ArrayType(pixels.length * channelCount / 4);\n let packCount = 0;\n\n for (let i = 0; i < pixels.length; i += 4) {\n for (let j = 0; j < channelCount; j++) {\n packedPixels[packCount++] = pixels[i + j];\n }\n }\n\n return packedPixels;\n }\n\n getFramebuffer() {\n const currentResources = this.bindings[this.currentIndex];\n return currentResources.framebuffer;\n }\n\n delete() {\n if (this.ownTexture) {\n this.ownTexture.delete();\n }\n\n if (this.elementIDBuffer) {\n this.elementIDBuffer.delete();\n }\n }\n\n _initialize() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n _targetTextureVarying,\n _swapTexture\n } = props;\n this._swapTexture = _swapTexture;\n this.targetTextureVarying = _targetTextureVarying;\n this.hasTargetTexture = _targetTextureVarying;\n\n this._setupTextures(props);\n }\n\n _createTargetTexture(props) {\n const {\n sourceTextures,\n textureOrReference\n } = props;\n\n if (textureOrReference instanceof _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_3__[\"default\"]) {\n return textureOrReference;\n }\n\n const refTexture = sourceTextures[textureOrReference];\n\n if (!refTexture) {\n return null;\n }\n\n this._targetRefTexName = textureOrReference;\n return this._createNewTexture(refTexture);\n }\n\n _setupTextures() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n sourceBuffers,\n _sourceTextures = {},\n _targetTexture\n } = props;\n\n const targetTexture = this._createTargetTexture({\n sourceTextures: _sourceTextures,\n textureOrReference: _targetTexture\n });\n\n this.hasSourceTextures = this.hasSourceTextures || _sourceTextures && Object.keys(_sourceTextures).length > 0;\n\n this._updateBindings({\n sourceBuffers,\n sourceTextures: _sourceTextures,\n targetTexture\n });\n\n if ('elementCount' in props) {\n this._updateElementIDBuffer(props.elementCount);\n }\n }\n\n _updateElementIDBuffer(elementCount) {\n if (typeof elementCount !== 'number' || this.elementCount >= elementCount) {\n return;\n }\n\n const elementIds = new Float32Array(elementCount);\n elementIds.forEach((_, index, array) => {\n array[index] = index;\n });\n\n if (!this.elementIDBuffer) {\n this.elementIDBuffer = new _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this.gl, {\n data: elementIds,\n accessor: {\n size: 1\n }\n });\n } else {\n this.elementIDBuffer.setData({\n data: elementIds\n });\n }\n\n this.elementCount = elementCount;\n }\n\n _updateBindings(opts) {\n this.bindings[this.currentIndex] = this._updateBinding(this.bindings[this.currentIndex], opts);\n\n if (this._swapTexture) {\n const {\n sourceTextures,\n targetTexture\n } = this._swapTextures(this.bindings[this.currentIndex]);\n\n const nextIndex = this._getNextIndex();\n\n this.bindings[nextIndex] = this._updateBinding(this.bindings[nextIndex], {\n sourceTextures,\n targetTexture\n });\n }\n }\n\n _updateBinding(binding, opts) {\n const {\n sourceBuffers,\n sourceTextures,\n targetTexture\n } = opts;\n\n if (!binding) {\n binding = {\n sourceBuffers: {},\n sourceTextures: {},\n targetTexture: null\n };\n }\n\n Object.assign(binding.sourceTextures, sourceTextures);\n Object.assign(binding.sourceBuffers, sourceBuffers);\n\n if (targetTexture) {\n binding.targetTexture = targetTexture;\n const {\n width,\n height\n } = targetTexture;\n const {\n framebuffer\n } = binding;\n\n if (framebuffer) {\n framebuffer.update({\n attachments: {\n [36064]: targetTexture\n },\n resizeAttachments: false\n });\n framebuffer.resize({\n width,\n height\n });\n } else {\n binding.framebuffer = new _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_5__[\"default\"](this.gl, {\n id: \"transform-framebuffer\",\n width,\n height,\n attachments: {\n [36064]: targetTexture\n }\n });\n }\n }\n\n return binding;\n }\n\n _setSourceTextureParameters() {\n const index = this.currentIndex;\n const {\n sourceTextures\n } = this.bindings[index];\n\n for (const name in sourceTextures) {\n sourceTextures[name].setParameters(SRC_TEX_PARAMETER_OVERRIDES);\n }\n }\n\n _swapTextures(opts) {\n if (!this._swapTexture) {\n return null;\n }\n\n const sourceTextures = Object.assign({}, opts.sourceTextures);\n sourceTextures[this._swapTexture] = opts.targetTexture;\n const targetTexture = opts.sourceTextures[this._swapTexture];\n return {\n sourceTextures,\n targetTexture\n };\n }\n\n _createNewTexture(refTexture) {\n const texture = (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_6__.cloneTextureFrom)(refTexture, {\n parameters: {\n [10241]: 9728,\n [10240]: 9728,\n [10242]: 33071,\n [10243]: 33071\n },\n pixelStore: {\n [37440]: false\n }\n });\n\n if (this.ownTexture) {\n this.ownTexture.delete();\n }\n\n this.ownTexture = texture;\n return texture;\n }\n\n _getNextIndex() {\n return (this.currentIndex + 1) % 2;\n }\n\n _processVertexShader() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n sourceTextures,\n targetTexture\n } = this.bindings[this.currentIndex];\n const {\n vs,\n uniforms,\n targetTextureType,\n inject,\n samplerTextureMap\n } = (0,_transform_shader_utils__WEBPACK_IMPORTED_MODULE_0__.updateForTextures)({\n vs: props.vs,\n sourceTextureMap: sourceTextures,\n targetTextureVarying: this.targetTextureVarying,\n targetTexture\n });\n const combinedInject = (0,_luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_7__.combineInjects)([props.inject || {}, inject]);\n this.targetTextureType = targetTextureType;\n this.samplerTextureMap = samplerTextureMap;\n const fs = props._fs || (0,_luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_2__.getPassthroughFS)({\n version: (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(vs),\n input: this.targetTextureVarying,\n inputType: targetTextureType,\n output: FS_OUTPUT_VARIABLE\n });\n const modules = this.hasSourceTextures || this.targetTextureVarying ? [_luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_9__.transform].concat(props.modules || []) : props.modules;\n return {\n vs,\n fs,\n modules,\n uniforms,\n inject: combinedInject\n };\n }\n\n}\n//# sourceMappingURL=texture-transform.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/engine/dist/esm/transform/texture-transform.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/engine/dist/esm/transform/transform-shader-utils.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@luma.gl/engine/dist/esm/transform/transform-shader-utils.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getSizeUniforms: () => (/* binding */ getSizeUniforms),\n/* harmony export */ getVaryingType: () => (/* binding */ getVaryingType),\n/* harmony export */ processAttributeDefinition: () => (/* binding */ processAttributeDefinition),\n/* harmony export */ updateForTextures: () => (/* binding */ updateForTextures)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n/* harmony import */ var _luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/shadertools */ \"./node_modules/@luma.gl/shadertools/dist/esm/lib/inject-shader.js\");\n/* harmony import */ var _luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @luma.gl/shadertools */ \"./node_modules/@luma.gl/shadertools/dist/esm/utils/shader-utils.js\");\n\n\nconst SAMPLER_UNIFORM_PREFIX = 'transform_uSampler_';\nconst SIZE_UNIFORM_PREFIX = 'transform_uSize_';\nconst VS_POS_VARIABLE = 'transform_position';\nfunction updateForTextures(_ref) {\n let {\n vs,\n sourceTextureMap,\n targetTextureVarying,\n targetTexture\n } = _ref;\n const texAttributeNames = Object.keys(sourceTextureMap);\n let sourceCount = texAttributeNames.length;\n let targetTextureType = null;\n const samplerTextureMap = {};\n let updatedVs = vs;\n let finalInject = {};\n\n if (sourceCount > 0 || targetTextureVarying) {\n const vsLines = updatedVs.split('\\n');\n const updateVsLines = vsLines.slice();\n vsLines.forEach((line, index, lines) => {\n if (sourceCount > 0) {\n const updated = processAttributeDefinition(line, sourceTextureMap);\n\n if (updated) {\n const {\n updatedLine,\n inject\n } = updated;\n updateVsLines[index] = updatedLine;\n finalInject = (0,_luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_0__.combineInjects)([finalInject, inject]);\n Object.assign(samplerTextureMap, updated.samplerTextureMap);\n sourceCount--;\n }\n }\n\n if (targetTextureVarying && !targetTextureType) {\n targetTextureType = getVaryingType(line, targetTextureVarying);\n }\n });\n\n if (targetTextureVarying) {\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__.assert)(targetTexture);\n const sizeName = \"\".concat(SIZE_UNIFORM_PREFIX).concat(targetTextureVarying);\n const uniformDeclaration = \"uniform vec2 \".concat(sizeName, \";\\n\");\n const posInstructions = \" vec2 \".concat(VS_POS_VARIABLE, \" = transform_getPos(\").concat(sizeName, \");\\n gl_Position = vec4(\").concat(VS_POS_VARIABLE, \", 0, 1.);\\n\");\n const inject = {\n 'vs:#decl': uniformDeclaration,\n 'vs:#main-start': posInstructions\n };\n finalInject = (0,_luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_0__.combineInjects)([finalInject, inject]);\n }\n\n updatedVs = updateVsLines.join('\\n');\n }\n\n return {\n vs: updatedVs,\n targetTextureType,\n inject: finalInject,\n samplerTextureMap\n };\n}\nfunction getSizeUniforms(_ref2) {\n let {\n sourceTextureMap,\n targetTextureVarying,\n targetTexture\n } = _ref2;\n const uniforms = {};\n let width;\n let height;\n\n if (targetTextureVarying) {\n ({\n width,\n height\n } = targetTexture);\n uniforms[\"\".concat(SIZE_UNIFORM_PREFIX).concat(targetTextureVarying)] = [width, height];\n }\n\n for (const textureName in sourceTextureMap) {\n ({\n width,\n height\n } = sourceTextureMap[textureName]);\n uniforms[\"\".concat(SIZE_UNIFORM_PREFIX).concat(textureName)] = [width, height];\n }\n\n return uniforms;\n}\n\nfunction getAttributeDefinition(line) {\n return (0,_luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_2__.getQualifierDetails)(line, ['attribute', 'in']);\n}\n\nfunction getSamplerDeclerations(textureName) {\n const samplerName = \"\".concat(SAMPLER_UNIFORM_PREFIX).concat(textureName);\n const sizeName = \"\".concat(SIZE_UNIFORM_PREFIX).concat(textureName);\n const uniformDeclerations = \" uniform sampler2D \".concat(samplerName, \";\\n uniform vec2 \").concat(sizeName, \";\");\n return {\n samplerName,\n sizeName,\n uniformDeclerations\n };\n}\n\nfunction getVaryingType(line, varying) {\n const qualaiferDetails = (0,_luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_2__.getQualifierDetails)(line, ['varying', 'out']);\n\n if (!qualaiferDetails) {\n return null;\n }\n\n return qualaiferDetails.name === varying ? qualaiferDetails.type : null;\n}\nfunction processAttributeDefinition(line, textureMap) {\n const samplerTextureMap = {};\n const attributeData = getAttributeDefinition(line);\n\n if (!attributeData) {\n return null;\n }\n\n const {\n type,\n name\n } = attributeData;\n\n if (name && textureMap[name]) {\n const updatedLine = \"// \".concat(line, \" => Replaced by Transform with a sampler\");\n const {\n samplerName,\n sizeName,\n uniformDeclerations\n } = getSamplerDeclerations(name);\n const channels = (0,_luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_2__.typeToChannelSuffix)(type);\n const sampleInstruction = \" \".concat(type, \" \").concat(name, \" = transform_getInput(\").concat(samplerName, \", \").concat(sizeName, \").\").concat(channels, \";\\n\");\n samplerTextureMap[samplerName] = name;\n const inject = {\n 'vs:#decl': uniformDeclerations,\n 'vs:#main-start': sampleInstruction\n };\n return {\n updatedLine,\n inject,\n samplerTextureMap\n };\n }\n\n return null;\n}\n//# sourceMappingURL=transform-shader-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/engine/dist/esm/transform/transform-shader-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/engine/dist/esm/transform/transform.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@luma.gl/engine/dist/esm/transform/transform.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Transform)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @luma.gl/shadertools */ \"./node_modules/@luma.gl/shadertools/dist/esm/utils/shader-utils.js\");\n/* harmony import */ var _buffer_transform__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./buffer-transform */ \"./node_modules/@luma.gl/engine/dist/esm/transform/buffer-transform.js\");\n/* harmony import */ var _texture_transform__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./texture-transform */ \"./node_modules/@luma.gl/engine/dist/esm/transform/texture-transform.js\");\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/get-shader-version.js\");\n/* harmony import */ var _luma_gl_webgl__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @luma.gl/webgl */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/utils.js\");\n/* harmony import */ var _lib_model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/model */ \"./node_modules/@luma.gl/engine/dist/esm/lib/model.js\");\n\n\n\n\n\n\nclass Transform {\n static isSupported(gl) {\n return (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl);\n }\n\n constructor(gl) {\n let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.gl = gl;\n this.model = null;\n this.elementCount = 0;\n this.bufferTransform = null;\n this.textureTransform = null;\n this.elementIDBuffer = null;\n\n this._initialize(props);\n\n Object.seal(this);\n }\n\n delete() {\n const {\n model,\n bufferTransform,\n textureTransform\n } = this;\n\n if (model) {\n model.delete();\n }\n\n if (bufferTransform) {\n bufferTransform.delete();\n }\n\n if (textureTransform) {\n textureTransform.delete();\n }\n }\n\n run() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n clearRenderTarget = true\n } = opts;\n\n const updatedOpts = this._updateDrawOptions(opts);\n\n if (clearRenderTarget && updatedOpts.framebuffer) {\n updatedOpts.framebuffer.clear({\n color: true\n });\n }\n\n this.model.transform(updatedOpts);\n }\n\n swap() {\n let swapped = false;\n const resourceTransforms = [this.bufferTransform, this.textureTransform].filter(Boolean);\n\n for (const resourceTransform of resourceTransforms) {\n swapped = swapped || resourceTransform.swap();\n }\n\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__.assert)(swapped, 'Nothing to swap');\n }\n\n getBuffer() {\n let varyingName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n return this.bufferTransform && this.bufferTransform.getBuffer(varyingName);\n }\n\n getData() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const resourceTransforms = [this.bufferTransform, this.textureTransform].filter(Boolean);\n\n for (const resourceTransform of resourceTransforms) {\n const data = resourceTransform.getData(opts);\n\n if (data) {\n return data;\n }\n }\n\n return null;\n }\n\n getFramebuffer() {\n return this.textureTransform && this.textureTransform.getFramebuffer();\n }\n\n update() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if ('elementCount' in opts) {\n this.model.setVertexCount(opts.elementCount);\n }\n\n const resourceTransforms = [this.bufferTransform, this.textureTransform].filter(Boolean);\n\n for (const resourceTransform of resourceTransforms) {\n resourceTransform.update(opts);\n }\n }\n\n _initialize() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n gl\n } = this;\n\n this._buildResourceTransforms(gl, props);\n\n props = this._updateModelProps(props);\n this.model = new _lib_model__WEBPACK_IMPORTED_MODULE_2__[\"default\"](gl, Object.assign({}, props, {\n fs: props.fs || (0,_luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_3__.getPassthroughFS)({\n version: (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(props.vs)\n }),\n id: props.id || 'transform-model',\n drawMode: props.drawMode || 0,\n vertexCount: props.elementCount\n }));\n this.bufferTransform && this.bufferTransform.setupResources({\n model: this.model\n });\n }\n\n _updateModelProps(props) {\n let updatedProps = Object.assign({}, props);\n const resourceTransforms = [this.bufferTransform, this.textureTransform].filter(Boolean);\n\n for (const resourceTransform of resourceTransforms) {\n updatedProps = resourceTransform.updateModelProps(updatedProps);\n }\n\n return updatedProps;\n }\n\n _buildResourceTransforms(gl, props) {\n if (canCreateBufferTransform(props)) {\n this.bufferTransform = new _buffer_transform__WEBPACK_IMPORTED_MODULE_5__[\"default\"](gl, props);\n }\n\n if (canCreateTextureTransform(props)) {\n this.textureTransform = new _texture_transform__WEBPACK_IMPORTED_MODULE_6__[\"default\"](gl, props);\n }\n\n (0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_1__.assert)(this.bufferTransform || this.textureTransform, 'must provide source/feedback buffers or source/target textures');\n }\n\n _updateDrawOptions(opts) {\n let updatedOpts = Object.assign({}, opts);\n const resourceTransforms = [this.bufferTransform, this.textureTransform].filter(Boolean);\n\n for (const resourceTransform of resourceTransforms) {\n updatedOpts = Object.assign(updatedOpts, resourceTransform.getDrawOptions(updatedOpts));\n }\n\n return updatedOpts;\n }\n\n}\n\nfunction canCreateBufferTransform(props) {\n if (!(0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_7__.isObjectEmpty)(props.feedbackBuffers) || !(0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_7__.isObjectEmpty)(props.feedbackMap) || props.varyings && props.varyings.length > 0) {\n return true;\n }\n\n return false;\n}\n\nfunction canCreateTextureTransform(props) {\n if (!(0,_luma_gl_webgl__WEBPACK_IMPORTED_MODULE_7__.isObjectEmpty)(props._sourceTextures) || props._targetTexture || props._targetTextureVarying) {\n return true;\n }\n\n return false;\n}\n//# sourceMappingURL=transform.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/engine/dist/esm/transform/transform.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/gltools/dist/esm/context/context.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@luma.gl/gltools/dist/esm/context/context.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createGLContext: () => (/* binding */ createGLContext),\n/* harmony export */ getContextDebugInfo: () => (/* binding */ getContextDebugInfo),\n/* harmony export */ instrumentGLContext: () => (/* binding */ instrumentGLContext),\n/* harmony export */ resizeGLContext: () => (/* binding */ resizeGLContext)\n/* harmony export */ });\n/* harmony import */ var _probe_gl_env__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @probe.gl/env */ \"./node_modules/@probe.gl/env/dist/esm/lib/is-browser.js\");\n/* harmony import */ var _state_tracker_track_context_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../state-tracker/track-context-state */ \"./node_modules/@luma.gl/gltools/dist/esm/state-tracker/track-context-state.js\");\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/log */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/log.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/assert.js\");\n/* harmony import */ var _utils_device_pixels__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/device-pixels */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/device-pixels.js\");\n/* harmony import */ var _utils_webgl_checks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/webgl-checks */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/webgl-checks.js\");\n\n\n\n\n\n\nconst isBrowser = (0,_probe_gl_env__WEBPACK_IMPORTED_MODULE_5__[\"default\"])();\nconst isPage = isBrowser && typeof document !== 'undefined';\nconst CONTEXT_DEFAULTS = {\n webgl2: true,\n webgl1: true,\n throwOnError: true,\n manageState: true,\n canvas: null,\n debug: false,\n width: 800,\n height: 600\n};\nfunction createGLContext() {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(isBrowser, \"createGLContext only available in the browser.\\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils\");\n options = Object.assign({}, CONTEXT_DEFAULTS, options);\n const {\n width,\n height\n } = options;\n\n function onError(message) {\n if (options.throwOnError) {\n throw new Error(message);\n }\n\n console.error(message);\n return null;\n }\n\n options.onError = onError;\n let gl;\n const {\n canvas\n } = options;\n const targetCanvas = getCanvas({\n canvas,\n width,\n height,\n onError\n });\n gl = createBrowserContext(targetCanvas, options);\n\n if (!gl) {\n return null;\n }\n\n gl = instrumentGLContext(gl, options);\n logInfo(gl);\n return gl;\n}\nfunction instrumentGLContext(gl) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!gl || gl._instrumented) {\n return gl;\n }\n\n gl._version = gl._version || getVersion(gl);\n gl.luma = gl.luma || {};\n gl.luma.canvasSizeInfo = gl.luma.canvasSizeInfo || {};\n options = Object.assign({}, CONTEXT_DEFAULTS, options);\n const {\n manageState,\n debug\n } = options;\n\n if (manageState) {\n (0,_state_tracker_track_context_state__WEBPACK_IMPORTED_MODULE_0__.trackContextState)(gl, {\n copyState: false,\n log: function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _utils_log__WEBPACK_IMPORTED_MODULE_1__.log.log(1, ...args)();\n }\n });\n }\n\n if (isBrowser && debug) {\n if (!globalThis.makeDebugContext) {\n _utils_log__WEBPACK_IMPORTED_MODULE_1__.log.warn('WebGL debug mode not activated. import \"@luma.gl/debug\" to enable.')();\n } else {\n gl = globalThis.makeDebugContext(gl, options);\n _utils_log__WEBPACK_IMPORTED_MODULE_1__.log.level = Math.max(_utils_log__WEBPACK_IMPORTED_MODULE_1__.log.level, 1);\n }\n }\n\n gl._instrumented = true;\n return gl;\n}\nfunction getContextDebugInfo(gl) {\n const vendorMasked = gl.getParameter(7936);\n const rendererMasked = gl.getParameter(7937);\n const ext = gl.getExtension('WEBGL_debug_renderer_info');\n const vendorUnmasked = ext && gl.getParameter(ext.UNMASKED_VENDOR_WEBGL || 7936);\n const rendererUnmasked = ext && gl.getParameter(ext.UNMASKED_RENDERER_WEBGL || 7937);\n return {\n vendor: vendorUnmasked || vendorMasked,\n renderer: rendererUnmasked || rendererMasked,\n vendorMasked,\n rendererMasked,\n version: gl.getParameter(7938),\n shadingLanguageVersion: gl.getParameter(35724)\n };\n}\nfunction resizeGLContext(gl) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (gl.canvas) {\n const devicePixelRatio = (0,_utils_device_pixels__WEBPACK_IMPORTED_MODULE_3__.getDevicePixelRatio)(options.useDevicePixels);\n setDevicePixelRatio(gl, devicePixelRatio, options);\n return;\n }\n\n const ext = gl.getExtension('STACKGL_resize_drawingbuffer');\n\n if (ext && \"width\" in options && \"height\" in options) {\n ext.resize(options.width, options.height);\n }\n}\n\nfunction createBrowserContext(canvas, options) {\n const {\n onError\n } = options;\n let errorMessage = null;\n\n const onCreateError = error => errorMessage = error.statusMessage || errorMessage;\n\n canvas.addEventListener('webglcontextcreationerror', onCreateError, false);\n const {\n webgl1 = true,\n webgl2 = true\n } = options;\n let gl = null;\n\n if (webgl2) {\n gl = gl || canvas.getContext('webgl2', options);\n gl = gl || canvas.getContext('experimental-webgl2', options);\n }\n\n if (webgl1) {\n gl = gl || canvas.getContext('webgl', options);\n gl = gl || canvas.getContext('experimental-webgl', options);\n }\n\n canvas.removeEventListener('webglcontextcreationerror', onCreateError, false);\n\n if (!gl) {\n return onError(\"Failed to create \".concat(webgl2 && !webgl1 ? 'WebGL2' : 'WebGL', \" context: \").concat(errorMessage || 'Unknown error'));\n }\n\n if (options.onContextLost) {\n canvas.addEventListener('webglcontextlost', options.onContextLost, false);\n }\n\n if (options.onContextRestored) {\n canvas.addEventListener('webglcontextrestored', options.onContextRestored, false);\n }\n\n return gl;\n}\n\nfunction getCanvas(_ref) {\n let {\n canvas,\n width = 800,\n height = 600,\n onError\n } = _ref;\n let targetCanvas;\n\n if (typeof canvas === 'string') {\n const isPageLoaded = isPage && document.readyState === 'complete';\n\n if (!isPageLoaded) {\n onError(\"createGLContext called on canvas '\".concat(canvas, \"' before page was loaded\"));\n }\n\n targetCanvas = document.getElementById(canvas);\n } else if (canvas) {\n targetCanvas = canvas;\n } else {\n targetCanvas = document.createElement('canvas');\n targetCanvas.id = 'lumagl-canvas';\n targetCanvas.style.width = Number.isFinite(width) ? \"\".concat(width, \"px\") : '100%';\n targetCanvas.style.height = Number.isFinite(height) ? \"\".concat(height, \"px\") : '100%';\n document.body.insertBefore(targetCanvas, document.body.firstChild);\n }\n\n return targetCanvas;\n}\n\nfunction logInfo(gl) {\n const webGL = (0,_utils_webgl_checks__WEBPACK_IMPORTED_MODULE_4__.isWebGL2)(gl) ? 'WebGL2' : 'WebGL1';\n const info = getContextDebugInfo(gl);\n const driver = info ? \"(\".concat(info.vendor, \",\").concat(info.renderer, \")\") : '';\n const debug = gl.debug ? ' debug' : '';\n _utils_log__WEBPACK_IMPORTED_MODULE_1__.log.info(1, \"\".concat(webGL).concat(debug, \" context \").concat(driver))();\n}\n\nfunction getVersion(gl) {\n if (typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext) {\n return 2;\n }\n\n return 1;\n}\n\nfunction setDevicePixelRatio(gl, devicePixelRatio, options) {\n let clientWidth = 'width' in options ? options.width : gl.canvas.clientWidth;\n let clientHeight = 'height' in options ? options.height : gl.canvas.clientHeight;\n\n if (!clientWidth || !clientHeight) {\n _utils_log__WEBPACK_IMPORTED_MODULE_1__.log.log(1, 'Canvas clientWidth/clientHeight is 0')();\n devicePixelRatio = 1;\n clientWidth = gl.canvas.width || 1;\n clientHeight = gl.canvas.height || 1;\n }\n\n gl.luma = gl.luma || {};\n gl.luma.canvasSizeInfo = gl.luma.canvasSizeInfo || {};\n const cachedSize = gl.luma.canvasSizeInfo;\n\n if (cachedSize.clientWidth !== clientWidth || cachedSize.clientHeight !== clientHeight || cachedSize.devicePixelRatio !== devicePixelRatio) {\n let clampedPixelRatio = devicePixelRatio;\n const canvasWidth = Math.floor(clientWidth * clampedPixelRatio);\n const canvasHeight = Math.floor(clientHeight * clampedPixelRatio);\n gl.canvas.width = canvasWidth;\n gl.canvas.height = canvasHeight;\n\n if (gl.drawingBufferWidth !== canvasWidth || gl.drawingBufferHeight !== canvasHeight) {\n _utils_log__WEBPACK_IMPORTED_MODULE_1__.log.warn(\"Device pixel ratio clamped\")();\n clampedPixelRatio = Math.min(gl.drawingBufferWidth / clientWidth, gl.drawingBufferHeight / clientHeight);\n gl.canvas.width = Math.floor(clientWidth * clampedPixelRatio);\n gl.canvas.height = Math.floor(clientHeight * clampedPixelRatio);\n }\n\n Object.assign(gl.luma.canvasSizeInfo, {\n clientWidth,\n clientHeight,\n devicePixelRatio\n });\n }\n}\n//# sourceMappingURL=context.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/gltools/dist/esm/context/context.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/gltools/dist/esm/index.js": +/*!*********************************************************!*\ + !*** ./node_modules/@luma.gl/gltools/dist/esm/index.js ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ assertWebGL2Context: () => (/* reexport safe */ _utils_webgl_checks__WEBPACK_IMPORTED_MODULE_1__.assertWebGL2Context),\n/* harmony export */ assertWebGLContext: () => (/* reexport safe */ _utils_webgl_checks__WEBPACK_IMPORTED_MODULE_1__.assertWebGLContext),\n/* harmony export */ createGLContext: () => (/* reexport safe */ _context_context__WEBPACK_IMPORTED_MODULE_5__.createGLContext),\n/* harmony export */ cssToDevicePixels: () => (/* reexport safe */ _utils_device_pixels__WEBPACK_IMPORTED_MODULE_6__.cssToDevicePixels),\n/* harmony export */ cssToDeviceRatio: () => (/* reexport safe */ _utils_device_pixels__WEBPACK_IMPORTED_MODULE_6__.cssToDeviceRatio),\n/* harmony export */ getContextDebugInfo: () => (/* reexport safe */ _context_context__WEBPACK_IMPORTED_MODULE_5__.getContextDebugInfo),\n/* harmony export */ getParameters: () => (/* reexport safe */ _state_tracker_unified_parameter_api__WEBPACK_IMPORTED_MODULE_3__.getParameters),\n/* harmony export */ getWebGL2Context: () => (/* reexport safe */ _utils_webgl_checks__WEBPACK_IMPORTED_MODULE_1__.getWebGL2Context),\n/* harmony export */ instrumentGLContext: () => (/* reexport safe */ _context_context__WEBPACK_IMPORTED_MODULE_5__.instrumentGLContext),\n/* harmony export */ isWebGL: () => (/* reexport safe */ _utils_webgl_checks__WEBPACK_IMPORTED_MODULE_1__.isWebGL),\n/* harmony export */ isWebGL2: () => (/* reexport safe */ _utils_webgl_checks__WEBPACK_IMPORTED_MODULE_1__.isWebGL2),\n/* harmony export */ log: () => (/* reexport safe */ _utils_log__WEBPACK_IMPORTED_MODULE_0__.log),\n/* harmony export */ polyfillContext: () => (/* reexport safe */ _polyfill_polyfill_context__WEBPACK_IMPORTED_MODULE_2__.polyfillContext),\n/* harmony export */ popContextState: () => (/* reexport safe */ _state_tracker_track_context_state__WEBPACK_IMPORTED_MODULE_4__.popContextState),\n/* harmony export */ pushContextState: () => (/* reexport safe */ _state_tracker_track_context_state__WEBPACK_IMPORTED_MODULE_4__.pushContextState),\n/* harmony export */ resetParameters: () => (/* reexport safe */ _state_tracker_unified_parameter_api__WEBPACK_IMPORTED_MODULE_3__.resetParameters),\n/* harmony export */ resizeGLContext: () => (/* reexport safe */ _context_context__WEBPACK_IMPORTED_MODULE_5__.resizeGLContext),\n/* harmony export */ setParameters: () => (/* reexport safe */ _state_tracker_unified_parameter_api__WEBPACK_IMPORTED_MODULE_3__.setParameters),\n/* harmony export */ trackContextState: () => (/* reexport safe */ _state_tracker_track_context_state__WEBPACK_IMPORTED_MODULE_4__.trackContextState),\n/* harmony export */ withParameters: () => (/* reexport safe */ _state_tracker_unified_parameter_api__WEBPACK_IMPORTED_MODULE_3__.withParameters)\n/* harmony export */ });\n/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/log */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/log.js\");\n/* harmony import */ var _utils_webgl_checks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/webgl-checks */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/webgl-checks.js\");\n/* harmony import */ var _polyfill_polyfill_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./polyfill/polyfill-context */ \"./node_modules/@luma.gl/gltools/dist/esm/polyfill/polyfill-context.js\");\n/* harmony import */ var _state_tracker_unified_parameter_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./state-tracker/unified-parameter-api */ \"./node_modules/@luma.gl/gltools/dist/esm/state-tracker/unified-parameter-api.js\");\n/* harmony import */ var _state_tracker_track_context_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./state-tracker/track-context-state */ \"./node_modules/@luma.gl/gltools/dist/esm/state-tracker/track-context-state.js\");\n/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./context/context */ \"./node_modules/@luma.gl/gltools/dist/esm/context/context.js\");\n/* harmony import */ var _utils_device_pixels__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/device-pixels */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/device-pixels.js\");\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/gltools/dist/esm/index.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/gltools/dist/esm/polyfill/get-parameter-polyfill.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@luma.gl/gltools/dist/esm/polyfill/get-parameter-polyfill.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getParameterPolyfill: () => (/* binding */ getParameterPolyfill)\n/* harmony export */ });\n/* harmony import */ var _utils_webgl_checks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/webgl-checks */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/webgl-checks.js\");\n\nconst OES_element_index = 'OES_element_index';\nconst WEBGL_draw_buffers = 'WEBGL_draw_buffers';\nconst EXT_disjoint_timer_query = 'EXT_disjoint_timer_query';\nconst EXT_disjoint_timer_query_webgl2 = 'EXT_disjoint_timer_query_webgl2';\nconst EXT_texture_filter_anisotropic = 'EXT_texture_filter_anisotropic';\nconst WEBGL_debug_renderer_info = 'WEBGL_debug_renderer_info';\nconst GL_FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8b8b;\nconst GL_DONT_CARE = 0x1100;\nconst GL_GPU_DISJOINT_EXT = 0x8fbb;\nconst GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84ff;\nconst GL_UNMASKED_VENDOR_WEBGL = 0x9245;\nconst GL_UNMASKED_RENDERER_WEBGL = 0x9246;\n\nconst getWebGL2ValueOrZero = gl => !(0,_utils_webgl_checks__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl) ? 0 : undefined;\n\nconst WEBGL_PARAMETERS = {\n [3074]: gl => !(0,_utils_webgl_checks__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl) ? 36064 : undefined,\n [GL_FRAGMENT_SHADER_DERIVATIVE_HINT]: gl => !(0,_utils_webgl_checks__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl) ? GL_DONT_CARE : undefined,\n [35977]: getWebGL2ValueOrZero,\n [32937]: getWebGL2ValueOrZero,\n [GL_GPU_DISJOINT_EXT]: (gl, getParameter) => {\n const ext = (0,_utils_webgl_checks__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl) ? gl.getExtension(EXT_disjoint_timer_query_webgl2) : gl.getExtension(EXT_disjoint_timer_query);\n return ext && ext.GPU_DISJOINT_EXT ? getParameter(ext.GPU_DISJOINT_EXT) : 0;\n },\n [GL_UNMASKED_VENDOR_WEBGL]: (gl, getParameter) => {\n const ext = gl.getExtension(WEBGL_debug_renderer_info);\n return getParameter(ext && ext.UNMASKED_VENDOR_WEBGL || 7936);\n },\n [GL_UNMASKED_RENDERER_WEBGL]: (gl, getParameter) => {\n const ext = gl.getExtension(WEBGL_debug_renderer_info);\n return getParameter(ext && ext.UNMASKED_RENDERER_WEBGL || 7937);\n },\n [GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT]: (gl, getParameter) => {\n const ext = gl.luma.extensions[EXT_texture_filter_anisotropic];\n return ext ? getParameter(ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 1.0;\n },\n [32883]: getWebGL2ValueOrZero,\n [35071]: getWebGL2ValueOrZero,\n [37447]: getWebGL2ValueOrZero,\n [36063]: (gl, getParameter) => {\n if (!(0,_utils_webgl_checks__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl)) {\n const ext = gl.getExtension(WEBGL_draw_buffers);\n return ext ? getParameter(ext.MAX_COLOR_ATTACHMENTS_WEBGL) : 0;\n }\n\n return undefined;\n },\n [35379]: getWebGL2ValueOrZero,\n [35374]: getWebGL2ValueOrZero,\n [35377]: getWebGL2ValueOrZero,\n [34852]: gl => {\n if (!(0,_utils_webgl_checks__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl)) {\n const ext = gl.getExtension(WEBGL_draw_buffers);\n return ext ? ext.MAX_DRAW_BUFFERS_WEBGL : 0;\n }\n\n return undefined;\n },\n [36203]: gl => gl.getExtension(OES_element_index) ? 2147483647 : 65535,\n [33001]: gl => gl.getExtension(OES_element_index) ? 16777216 : 65535,\n [33000]: gl => 16777216,\n [37157]: getWebGL2ValueOrZero,\n [35373]: getWebGL2ValueOrZero,\n [35657]: getWebGL2ValueOrZero,\n [36183]: getWebGL2ValueOrZero,\n [37137]: getWebGL2ValueOrZero,\n [34045]: getWebGL2ValueOrZero,\n [35978]: getWebGL2ValueOrZero,\n [35979]: getWebGL2ValueOrZero,\n [35968]: getWebGL2ValueOrZero,\n [35376]: getWebGL2ValueOrZero,\n [35375]: getWebGL2ValueOrZero,\n [35659]: getWebGL2ValueOrZero,\n [37154]: getWebGL2ValueOrZero,\n [35371]: getWebGL2ValueOrZero,\n [35658]: getWebGL2ValueOrZero,\n [35076]: getWebGL2ValueOrZero,\n [35077]: getWebGL2ValueOrZero,\n [35380]: getWebGL2ValueOrZero\n};\nfunction getParameterPolyfill(gl, originalGetParameter, pname) {\n const limit = WEBGL_PARAMETERS[pname];\n const value = typeof limit === 'function' ? limit(gl, originalGetParameter, pname) : limit;\n const result = value !== undefined ? value : originalGetParameter(pname);\n return result;\n}\n//# sourceMappingURL=get-parameter-polyfill.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/gltools/dist/esm/polyfill/get-parameter-polyfill.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/gltools/dist/esm/polyfill/polyfill-context.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@luma.gl/gltools/dist/esm/polyfill/polyfill-context.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ polyfillContext: () => (/* binding */ polyfillContext)\n/* harmony export */ });\n/* harmony import */ var _polyfill_vertex_array_object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./polyfill-vertex-array-object */ \"./node_modules/@luma.gl/gltools/dist/esm/polyfill/polyfill-vertex-array-object.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/assert.js\");\n/* harmony import */ var _polyfill_table__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./polyfill-table */ \"./node_modules/@luma.gl/gltools/dist/esm/polyfill/polyfill-table.js\");\n\n\n\nfunction polyfillContext(gl) {\n gl.luma = gl.luma || {};\n const {\n luma\n } = gl;\n\n if (!luma.polyfilled) {\n (0,_polyfill_vertex_array_object__WEBPACK_IMPORTED_MODULE_0__.polyfillVertexArrayObject)(gl);\n initializeExtensions(gl);\n installPolyfills(gl, _polyfill_table__WEBPACK_IMPORTED_MODULE_2__.WEBGL2_CONTEXT_POLYFILLS);\n installOverrides(gl, {\n target: luma,\n target2: gl\n });\n luma.polyfilled = true;\n }\n\n return gl;\n}\nglobalThis.polyfillContext = polyfillContext;\n\nfunction initializeExtensions(gl) {\n gl.luma.extensions = {};\n const EXTENSIONS = gl.getSupportedExtensions() || [];\n\n for (const extension of EXTENSIONS) {\n gl.luma[extension] = gl.getExtension(extension);\n }\n}\n\nfunction installOverrides(gl, _ref) {\n let {\n target,\n target2\n } = _ref;\n Object.keys(_polyfill_table__WEBPACK_IMPORTED_MODULE_2__.WEBGL2_CONTEXT_OVERRIDES).forEach(key => {\n if (typeof _polyfill_table__WEBPACK_IMPORTED_MODULE_2__.WEBGL2_CONTEXT_OVERRIDES[key] === 'function') {\n const originalFunc = gl[key] ? gl[key].bind(gl) : () => {};\n const polyfill = _polyfill_table__WEBPACK_IMPORTED_MODULE_2__.WEBGL2_CONTEXT_OVERRIDES[key].bind(null, gl, originalFunc);\n target[key] = polyfill;\n target2[key] = polyfill;\n }\n });\n}\n\nfunction installPolyfills(gl, polyfills) {\n for (const extension of Object.getOwnPropertyNames(polyfills)) {\n if (extension !== 'overrides') {\n polyfillExtension(gl, {\n extension,\n target: gl.luma,\n target2: gl\n });\n }\n }\n}\n\nfunction polyfillExtension(gl, _ref2) {\n let {\n extension,\n target,\n target2\n } = _ref2;\n const defaults = _polyfill_table__WEBPACK_IMPORTED_MODULE_2__.WEBGL2_CONTEXT_POLYFILLS[extension];\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_1__.assert)(defaults);\n const {\n meta = {}\n } = defaults;\n const {\n suffix = ''\n } = meta;\n const ext = gl.getExtension(extension);\n\n for (const key of Object.keys(defaults)) {\n const extKey = \"\".concat(key).concat(suffix);\n let polyfill = null;\n\n if (key === 'meta') {} else if (typeof gl[key] === 'function') {} else if (ext && typeof ext[extKey] === 'function') {\n polyfill = function () {\n return ext[extKey](...arguments);\n };\n } else if (typeof defaults[key] === 'function') {\n polyfill = defaults[key].bind(target);\n }\n\n if (polyfill) {\n target[key] = polyfill;\n target2[key] = polyfill;\n }\n }\n}\n//# sourceMappingURL=polyfill-context.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/gltools/dist/esm/polyfill/polyfill-context.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/gltools/dist/esm/polyfill/polyfill-table.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@luma.gl/gltools/dist/esm/polyfill/polyfill-table.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ WEBGL2_CONTEXT_OVERRIDES: () => (/* binding */ WEBGL2_CONTEXT_OVERRIDES),\n/* harmony export */ WEBGL2_CONTEXT_POLYFILLS: () => (/* binding */ WEBGL2_CONTEXT_POLYFILLS)\n/* harmony export */ });\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/assert.js\");\n/* harmony import */ var _utils_webgl_checks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/webgl-checks */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/webgl-checks.js\");\n/* harmony import */ var _get_parameter_polyfill__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./get-parameter-polyfill */ \"./node_modules/@luma.gl/gltools/dist/esm/polyfill/get-parameter-polyfill.js\");\n\n\n\nconst OES_vertex_array_object = 'OES_vertex_array_object';\nconst ANGLE_instanced_arrays = 'ANGLE_instanced_arrays';\nconst WEBGL_draw_buffers = 'WEBGL_draw_buffers';\nconst EXT_disjoint_timer_query = 'EXT_disjoint_timer_query';\nconst EXT_texture_filter_anisotropic = 'EXT_texture_filter_anisotropic';\nconst ERR_VAO_NOT_SUPPORTED = 'VertexArray requires WebGL2 or OES_vertex_array_object extension';\n\nfunction getExtensionData(gl, extension) {\n return {\n webgl2: (0,_utils_webgl_checks__WEBPACK_IMPORTED_MODULE_1__.isWebGL2)(gl),\n ext: gl.getExtension(extension)\n };\n}\n\nconst WEBGL2_CONTEXT_POLYFILLS = {\n [OES_vertex_array_object]: {\n meta: {\n suffix: 'OES'\n },\n createVertexArray: () => {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(false, ERR_VAO_NOT_SUPPORTED);\n },\n deleteVertexArray: () => {},\n bindVertexArray: () => {},\n isVertexArray: () => false\n },\n [ANGLE_instanced_arrays]: {\n meta: {\n suffix: 'ANGLE'\n },\n\n vertexAttribDivisor(location, divisor) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(divisor === 0, 'WebGL instanced rendering not supported');\n },\n\n drawElementsInstanced: () => {},\n drawArraysInstanced: () => {}\n },\n [WEBGL_draw_buffers]: {\n meta: {\n suffix: 'WEBGL'\n },\n drawBuffers: () => {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(false);\n }\n },\n [EXT_disjoint_timer_query]: {\n meta: {\n suffix: 'EXT'\n },\n createQuery: () => {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(false);\n },\n deleteQuery: () => {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(false);\n },\n beginQuery: () => {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(false);\n },\n endQuery: () => {},\n\n getQuery(handle, pname) {\n return this.getQueryObject(handle, pname);\n },\n\n getQueryParameter(handle, pname) {\n return this.getQueryObject(handle, pname);\n },\n\n getQueryObject: () => {}\n }\n};\nconst WEBGL2_CONTEXT_OVERRIDES = {\n readBuffer: (gl, originalFunc, attachment) => {\n if ((0,_utils_webgl_checks__WEBPACK_IMPORTED_MODULE_1__.isWebGL2)(gl)) {\n originalFunc(attachment);\n } else {}\n },\n getVertexAttrib: (gl, originalFunc, location, pname) => {\n const {\n webgl2,\n ext\n } = getExtensionData(gl, ANGLE_instanced_arrays);\n let result;\n\n switch (pname) {\n case 35069:\n result = !webgl2 ? false : undefined;\n break;\n\n case 35070:\n result = !webgl2 && !ext ? 0 : undefined;\n break;\n\n default:\n }\n\n return result !== undefined ? result : originalFunc(location, pname);\n },\n getProgramParameter: (gl, originalFunc, program, pname) => {\n if (!(0,_utils_webgl_checks__WEBPACK_IMPORTED_MODULE_1__.isWebGL2)(gl)) {\n switch (pname) {\n case 35967:\n return 35981;\n\n case 35971:\n return 0;\n\n case 35382:\n return 0;\n\n default:\n }\n }\n\n return originalFunc(program, pname);\n },\n getInternalformatParameter: (gl, originalFunc, target, format, pname) => {\n if (!(0,_utils_webgl_checks__WEBPACK_IMPORTED_MODULE_1__.isWebGL2)(gl)) {\n switch (pname) {\n case 32937:\n return new Int32Array([0]);\n\n default:\n }\n }\n\n return gl.getInternalformatParameter(target, format, pname);\n },\n\n getTexParameter(gl, originalFunc, target, pname) {\n switch (pname) {\n case 34046:\n const {\n extensions\n } = gl.luma;\n const ext = extensions[EXT_texture_filter_anisotropic];\n pname = ext && ext.TEXTURE_MAX_ANISOTROPY_EXT || 34046;\n break;\n\n default:\n }\n\n return originalFunc(target, pname);\n },\n\n getParameter: _get_parameter_polyfill__WEBPACK_IMPORTED_MODULE_2__.getParameterPolyfill,\n\n hint(gl, originalFunc, pname, value) {\n return originalFunc(pname, value);\n }\n\n};\n//# sourceMappingURL=polyfill-table.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/gltools/dist/esm/polyfill/polyfill-table.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/gltools/dist/esm/polyfill/polyfill-vertex-array-object.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@luma.gl/gltools/dist/esm/polyfill/polyfill-vertex-array-object.js ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ polyfillVertexArrayObject: () => (/* binding */ polyfillVertexArrayObject)\n/* harmony export */ });\nconst glErrorShadow = {};\n\nfunction error(msg) {\n if (globalThis.console && globalThis.console.error) {\n globalThis.console.error(msg);\n }\n}\n\nfunction log(msg) {\n if (globalThis.console && globalThis.console.log) {\n globalThis.console.log(msg);\n }\n}\n\nfunction synthesizeGLError(err, opt_msg) {\n glErrorShadow[err] = true;\n\n if (opt_msg !== undefined) {\n error(opt_msg);\n }\n}\n\nfunction wrapGLError(gl) {\n const f = gl.getError;\n\n gl.getError = function getError() {\n let err;\n\n do {\n err = f.apply(gl);\n\n if (err !== 0) {\n glErrorShadow[err] = true;\n }\n } while (err !== 0);\n\n for (err in glErrorShadow) {\n if (glErrorShadow[err]) {\n delete glErrorShadow[err];\n return parseInt(err, 10);\n }\n }\n\n return 0;\n };\n}\n\nconst WebGLVertexArrayObjectOES = function WebGLVertexArrayObjectOES(ext) {\n const gl = ext.gl;\n this.ext = ext;\n this.isAlive = true;\n this.hasBeenBound = false;\n this.elementArrayBuffer = null;\n this.attribs = new Array(ext.maxVertexAttribs);\n\n for (let n = 0; n < this.attribs.length; n++) {\n const attrib = new WebGLVertexArrayObjectOES.VertexAttrib(gl);\n this.attribs[n] = attrib;\n }\n\n this.maxAttrib = 0;\n};\n\nWebGLVertexArrayObjectOES.VertexAttrib = function VertexAttrib(gl) {\n this.enabled = false;\n this.buffer = null;\n this.size = 4;\n this.type = 5126;\n this.normalized = false;\n this.stride = 16;\n this.offset = 0;\n this.cached = '';\n this.recache();\n};\n\nWebGLVertexArrayObjectOES.VertexAttrib.prototype.recache = function recache() {\n this.cached = [this.size, this.type, this.normalized, this.stride, this.offset].join(':');\n};\n\nconst OESVertexArrayObject = function OESVertexArrayObject(gl) {\n const self = this;\n this.gl = gl;\n wrapGLError(gl);\n const original = this.original = {\n getParameter: gl.getParameter,\n enableVertexAttribArray: gl.enableVertexAttribArray,\n disableVertexAttribArray: gl.disableVertexAttribArray,\n bindBuffer: gl.bindBuffer,\n getVertexAttrib: gl.getVertexAttrib,\n vertexAttribPointer: gl.vertexAttribPointer\n };\n\n gl.getParameter = function getParameter(pname) {\n if (pname === self.VERTEX_ARRAY_BINDING_OES) {\n if (self.currentVertexArrayObject === self.defaultVertexArrayObject) {\n return null;\n }\n\n return self.currentVertexArrayObject;\n }\n\n return original.getParameter.apply(this, arguments);\n };\n\n gl.enableVertexAttribArray = function enableVertexAttribArray(index) {\n const vao = self.currentVertexArrayObject;\n vao.maxAttrib = Math.max(vao.maxAttrib, index);\n const attrib = vao.attribs[index];\n attrib.enabled = true;\n return original.enableVertexAttribArray.apply(this, arguments);\n };\n\n gl.disableVertexAttribArray = function disableVertexAttribArray(index) {\n const vao = self.currentVertexArrayObject;\n vao.maxAttrib = Math.max(vao.maxAttrib, index);\n const attrib = vao.attribs[index];\n attrib.enabled = false;\n return original.disableVertexAttribArray.apply(this, arguments);\n };\n\n gl.bindBuffer = function bindBuffer(target, buffer) {\n switch (target) {\n case 34962:\n self.currentArrayBuffer = buffer;\n break;\n\n case 34963:\n self.currentVertexArrayObject.elementArrayBuffer = buffer;\n break;\n\n default:\n }\n\n return original.bindBuffer.apply(this, arguments);\n };\n\n gl.getVertexAttrib = function getVertexAttrib(index, pname) {\n const vao = self.currentVertexArrayObject;\n const attrib = vao.attribs[index];\n\n switch (pname) {\n case 34975:\n return attrib.buffer;\n\n case 34338:\n return attrib.enabled;\n\n case 34339:\n return attrib.size;\n\n case 34340:\n return attrib.stride;\n\n case 34341:\n return attrib.type;\n\n case 34922:\n return attrib.normalized;\n\n default:\n return original.getVertexAttrib.apply(this, arguments);\n }\n };\n\n gl.vertexAttribPointer = function vertexAttribPointer(indx, size, type, normalized, stride, offset) {\n const vao = self.currentVertexArrayObject;\n vao.maxAttrib = Math.max(vao.maxAttrib, indx);\n const attrib = vao.attribs[indx];\n attrib.buffer = self.currentArrayBuffer;\n attrib.size = size;\n attrib.type = type;\n attrib.normalized = normalized;\n attrib.stride = stride;\n attrib.offset = offset;\n attrib.recache();\n return original.vertexAttribPointer.apply(this, arguments);\n };\n\n if (gl.instrumentExtension) {\n gl.instrumentExtension(this, 'OES_vertex_array_object');\n }\n\n if (gl.canvas) {\n gl.canvas.addEventListener('webglcontextrestored', () => {\n log('OESVertexArrayObject emulation library context restored');\n self.reset_();\n }, true);\n }\n\n this.reset_();\n};\n\nOESVertexArrayObject.prototype.VERTEX_ARRAY_BINDING_OES = 0x85b5;\n\nOESVertexArrayObject.prototype.reset_ = function reset_() {\n const contextWasLost = this.vertexArrayObjects !== undefined;\n\n if (contextWasLost) {\n for (let ii = 0; ii < this.vertexArrayObjects.length; ++ii) {\n this.vertexArrayObjects.isAlive = false;\n }\n }\n\n const gl = this.gl;\n this.maxVertexAttribs = gl.getParameter(34921);\n this.defaultVertexArrayObject = new WebGLVertexArrayObjectOES(this);\n this.currentVertexArrayObject = null;\n this.currentArrayBuffer = null;\n this.vertexArrayObjects = [this.defaultVertexArrayObject];\n this.bindVertexArrayOES(null);\n};\n\nOESVertexArrayObject.prototype.createVertexArrayOES = function createVertexArrayOES() {\n const arrayObject = new WebGLVertexArrayObjectOES(this);\n this.vertexArrayObjects.push(arrayObject);\n return arrayObject;\n};\n\nOESVertexArrayObject.prototype.deleteVertexArrayOES = function deleteVertexArrayOES(arrayObject) {\n arrayObject.isAlive = false;\n this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(arrayObject), 1);\n\n if (this.currentVertexArrayObject === arrayObject) {\n this.bindVertexArrayOES(null);\n }\n};\n\nOESVertexArrayObject.prototype.isVertexArrayOES = function isVertexArrayOES(arrayObject) {\n if (arrayObject && arrayObject instanceof WebGLVertexArrayObjectOES) {\n if (arrayObject.hasBeenBound && arrayObject.ext === this) {\n return true;\n }\n }\n\n return false;\n};\n\nOESVertexArrayObject.prototype.bindVertexArrayOES = function bindVertexArrayOES(arrayObject) {\n const gl = this.gl;\n\n if (arrayObject && !arrayObject.isAlive) {\n synthesizeGLError(1282, 'bindVertexArrayOES: attempt to bind deleted arrayObject');\n return;\n }\n\n const original = this.original;\n const oldVAO = this.currentVertexArrayObject;\n this.currentVertexArrayObject = arrayObject || this.defaultVertexArrayObject;\n this.currentVertexArrayObject.hasBeenBound = true;\n const newVAO = this.currentVertexArrayObject;\n\n if (oldVAO === newVAO) {\n return;\n }\n\n if (!oldVAO || newVAO.elementArrayBuffer !== oldVAO.elementArrayBuffer) {\n original.bindBuffer.call(gl, 34963, newVAO.elementArrayBuffer);\n }\n\n let currentBinding = this.currentArrayBuffer;\n const maxAttrib = Math.max(oldVAO ? oldVAO.maxAttrib : 0, newVAO.maxAttrib);\n\n for (let n = 0; n <= maxAttrib; n++) {\n const attrib = newVAO.attribs[n];\n const oldAttrib = oldVAO ? oldVAO.attribs[n] : null;\n\n if (!oldVAO || attrib.enabled !== oldAttrib.enabled) {\n if (attrib.enabled) {\n original.enableVertexAttribArray.call(gl, n);\n } else {\n original.disableVertexAttribArray.call(gl, n);\n }\n }\n\n if (attrib.enabled) {\n let bufferChanged = false;\n\n if (!oldVAO || attrib.buffer !== oldAttrib.buffer) {\n if (currentBinding !== attrib.buffer) {\n original.bindBuffer.call(gl, 34962, attrib.buffer);\n currentBinding = attrib.buffer;\n }\n\n bufferChanged = true;\n }\n\n if (bufferChanged || attrib.cached !== oldAttrib.cached) {\n original.vertexAttribPointer.call(gl, n, attrib.size, attrib.type, attrib.normalized, attrib.stride, attrib.offset);\n }\n }\n }\n\n if (this.currentArrayBuffer !== currentBinding) {\n original.bindBuffer.call(gl, 34962, this.currentArrayBuffer);\n }\n};\n\nfunction polyfillVertexArrayObject(gl) {\n if (typeof gl.createVertexArray === 'function') {\n return;\n }\n\n const original_getSupportedExtensions = gl.getSupportedExtensions;\n\n gl.getSupportedExtensions = function getSupportedExtensions() {\n const list = original_getSupportedExtensions.call(this) || [];\n\n if (list.indexOf('OES_vertex_array_object') < 0) {\n list.push('OES_vertex_array_object');\n }\n\n return list;\n };\n\n const original_getExtension = gl.getExtension;\n\n gl.getExtension = function getExtension(name) {\n const ext = original_getExtension.call(this, name);\n\n if (ext) {\n return ext;\n }\n\n if (name !== 'OES_vertex_array_object') {\n return null;\n }\n\n if (!gl.__OESVertexArrayObject) {\n this.__OESVertexArrayObject = new OESVertexArrayObject(this);\n }\n\n return this.__OESVertexArrayObject;\n };\n}\n//# sourceMappingURL=polyfill-vertex-array-object.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/gltools/dist/esm/polyfill/polyfill-vertex-array-object.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/gltools/dist/esm/state-tracker/track-context-state.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/@luma.gl/gltools/dist/esm/state-tracker/track-context-state.js ***! + \*************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ popContextState: () => (/* binding */ popContextState),\n/* harmony export */ pushContextState: () => (/* binding */ pushContextState),\n/* harmony export */ trackContextState: () => (/* binding */ trackContextState)\n/* harmony export */ });\n/* harmony import */ var _webgl_parameter_tables__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./webgl-parameter-tables */ \"./node_modules/@luma.gl/gltools/dist/esm/state-tracker/webgl-parameter-tables.js\");\n/* harmony import */ var _unified_parameter_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./unified-parameter-api */ \"./node_modules/@luma.gl/gltools/dist/esm/state-tracker/unified-parameter-api.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/assert.js\");\n/* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/utils */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/utils.js\");\n\n\n\n\n\nfunction installGetterOverride(gl, functionName) {\n const originalGetterFunc = gl[functionName].bind(gl);\n\n gl[functionName] = function get() {\n const pname = arguments.length <= 0 ? undefined : arguments[0];\n\n if (!(pname in gl.state.cache)) {\n return originalGetterFunc(...arguments);\n }\n\n return gl.state.enable ? gl.state.cache[pname] : originalGetterFunc(...arguments);\n };\n\n Object.defineProperty(gl[functionName], 'name', {\n value: \"\".concat(functionName, \"-from-cache\"),\n configurable: false\n });\n}\n\nfunction installSetterSpy(gl, functionName, setter) {\n const originalSetterFunc = gl[functionName].bind(gl);\n\n gl[functionName] = function set() {\n for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {\n params[_key] = arguments[_key];\n }\n\n const {\n valueChanged,\n oldValue\n } = setter(gl.state._updateCache, ...params);\n\n if (valueChanged) {\n originalSetterFunc(...params);\n }\n\n return oldValue;\n };\n\n Object.defineProperty(gl[functionName], 'name', {\n value: \"\".concat(functionName, \"-to-cache\"),\n configurable: false\n });\n}\n\nfunction installProgramSpy(gl) {\n const originalUseProgram = gl.useProgram.bind(gl);\n\n gl.useProgram = function useProgramLuma(handle) {\n if (gl.state.program !== handle) {\n originalUseProgram(handle);\n gl.state.program = handle;\n }\n };\n}\n\nclass GLState {\n constructor(gl) {\n let {\n copyState = false,\n log = () => {}\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.gl = gl;\n this.program = null;\n this.stateStack = [];\n this.enable = true;\n this.cache = copyState ? (0,_unified_parameter_api__WEBPACK_IMPORTED_MODULE_1__.getParameters)(gl) : Object.assign({}, _webgl_parameter_tables__WEBPACK_IMPORTED_MODULE_0__.GL_PARAMETER_DEFAULTS);\n this.log = log;\n this._updateCache = this._updateCache.bind(this);\n Object.seal(this);\n }\n\n push() {\n let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.stateStack.push({});\n }\n\n pop() {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(this.stateStack.length > 0);\n const oldValues = this.stateStack[this.stateStack.length - 1];\n (0,_unified_parameter_api__WEBPACK_IMPORTED_MODULE_1__.setParameters)(this.gl, oldValues);\n this.stateStack.pop();\n }\n\n _updateCache(values) {\n let valueChanged = false;\n let oldValue;\n const oldValues = this.stateStack.length > 0 && this.stateStack[this.stateStack.length - 1];\n\n for (const key in values) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(key !== undefined);\n const value = values[key];\n const cached = this.cache[key];\n\n if (!(0,_utils_utils__WEBPACK_IMPORTED_MODULE_3__.deepArrayEqual)(value, cached)) {\n valueChanged = true;\n oldValue = cached;\n\n if (oldValues && !(key in oldValues)) {\n oldValues[key] = cached;\n }\n\n this.cache[key] = value;\n }\n }\n\n return {\n valueChanged,\n oldValue\n };\n }\n\n}\n\nfunction trackContextState(gl) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const {\n enable = true,\n copyState\n } = options;\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(copyState !== undefined);\n\n if (!gl.state) {\n const {\n polyfillContext\n } = globalThis;\n\n if (polyfillContext) {\n polyfillContext(gl);\n }\n\n gl.state = new GLState(gl, {\n copyState\n });\n installProgramSpy(gl);\n\n for (const key in _webgl_parameter_tables__WEBPACK_IMPORTED_MODULE_0__.GL_HOOKED_SETTERS) {\n const setter = _webgl_parameter_tables__WEBPACK_IMPORTED_MODULE_0__.GL_HOOKED_SETTERS[key];\n installSetterSpy(gl, key, setter);\n }\n\n installGetterOverride(gl, 'getParameter');\n installGetterOverride(gl, 'isEnabled');\n }\n\n gl.state.enable = enable;\n return gl;\n}\nfunction pushContextState(gl) {\n if (!gl.state) {\n trackContextState(gl, {\n copyState: false\n });\n }\n\n gl.state.push();\n}\nfunction popContextState(gl) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(gl.state);\n gl.state.pop();\n}\n//# sourceMappingURL=track-context-state.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/gltools/dist/esm/state-tracker/track-context-state.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/gltools/dist/esm/state-tracker/unified-parameter-api.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@luma.gl/gltools/dist/esm/state-tracker/unified-parameter-api.js ***! + \***************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getParameters: () => (/* binding */ getParameters),\n/* harmony export */ resetParameters: () => (/* binding */ resetParameters),\n/* harmony export */ setParameters: () => (/* binding */ setParameters),\n/* harmony export */ withParameters: () => (/* binding */ withParameters)\n/* harmony export */ });\n/* harmony import */ var _webgl_parameter_tables__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./webgl-parameter-tables */ \"./node_modules/@luma.gl/gltools/dist/esm/state-tracker/webgl-parameter-tables.js\");\n/* harmony import */ var _track_context_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./track-context-state */ \"./node_modules/@luma.gl/gltools/dist/esm/state-tracker/track-context-state.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/assert.js\");\n/* harmony import */ var _utils_webgl_checks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/webgl-checks */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/webgl-checks.js\");\n/* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/utils */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/utils.js\");\n\n\n\n\n\nfunction setParameters(gl, values) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)((0,_utils_webgl_checks__WEBPACK_IMPORTED_MODULE_3__.isWebGL)(gl), 'setParameters requires a WebGL context');\n\n if ((0,_utils_utils__WEBPACK_IMPORTED_MODULE_4__.isObjectEmpty)(values)) {\n return;\n }\n\n const compositeSetters = {};\n\n for (const key in values) {\n const glConstant = Number(key);\n const setter = _webgl_parameter_tables__WEBPACK_IMPORTED_MODULE_0__.GL_PARAMETER_SETTERS[key];\n\n if (setter) {\n if (typeof setter === 'string') {\n compositeSetters[setter] = true;\n } else {\n setter(gl, values[key], glConstant);\n }\n }\n }\n\n const cache = gl.state && gl.state.cache;\n\n if (cache) {\n for (const key in compositeSetters) {\n const compositeSetter = _webgl_parameter_tables__WEBPACK_IMPORTED_MODULE_0__.GL_COMPOSITE_PARAMETER_SETTERS[key];\n compositeSetter(gl, values, cache);\n }\n }\n}\nfunction getParameters(gl, parameters) {\n parameters = parameters || _webgl_parameter_tables__WEBPACK_IMPORTED_MODULE_0__.GL_PARAMETER_DEFAULTS;\n\n if (typeof parameters === 'number') {\n const key = parameters;\n const getter = _webgl_parameter_tables__WEBPACK_IMPORTED_MODULE_0__.GL_PARAMETER_GETTERS[key];\n return getter ? getter(gl, key) : gl.getParameter(key);\n }\n\n const parameterKeys = Array.isArray(parameters) ? parameters : Object.keys(parameters);\n const state = {};\n\n for (const key of parameterKeys) {\n const getter = _webgl_parameter_tables__WEBPACK_IMPORTED_MODULE_0__.GL_PARAMETER_GETTERS[key];\n state[key] = getter ? getter(gl, Number(key)) : gl.getParameter(Number(key));\n }\n\n return state;\n}\nfunction resetParameters(gl) {\n setParameters(gl, _webgl_parameter_tables__WEBPACK_IMPORTED_MODULE_0__.GL_PARAMETER_DEFAULTS);\n}\nfunction withParameters(gl, parameters, func) {\n if ((0,_utils_utils__WEBPACK_IMPORTED_MODULE_4__.isObjectEmpty)(parameters)) {\n return func(gl);\n }\n\n const {\n nocatch = true\n } = parameters;\n (0,_track_context_state__WEBPACK_IMPORTED_MODULE_1__.pushContextState)(gl);\n setParameters(gl, parameters);\n let value;\n\n if (nocatch) {\n value = func(gl);\n (0,_track_context_state__WEBPACK_IMPORTED_MODULE_1__.popContextState)(gl);\n } else {\n try {\n value = func(gl);\n } finally {\n (0,_track_context_state__WEBPACK_IMPORTED_MODULE_1__.popContextState)(gl);\n }\n }\n\n return value;\n}\n//# sourceMappingURL=unified-parameter-api.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/gltools/dist/esm/state-tracker/unified-parameter-api.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/gltools/dist/esm/state-tracker/webgl-parameter-tables.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/@luma.gl/gltools/dist/esm/state-tracker/webgl-parameter-tables.js ***! + \****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GL_COMPOSITE_PARAMETER_SETTERS: () => (/* binding */ GL_COMPOSITE_PARAMETER_SETTERS),\n/* harmony export */ GL_HOOKED_SETTERS: () => (/* binding */ GL_HOOKED_SETTERS),\n/* harmony export */ GL_PARAMETER_DEFAULTS: () => (/* binding */ GL_PARAMETER_DEFAULTS),\n/* harmony export */ GL_PARAMETER_GETTERS: () => (/* binding */ GL_PARAMETER_GETTERS),\n/* harmony export */ GL_PARAMETER_SETTERS: () => (/* binding */ GL_PARAMETER_SETTERS)\n/* harmony export */ });\n/* harmony import */ var _utils_webgl_checks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/webgl-checks */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/webgl-checks.js\");\n\nconst GL_PARAMETER_DEFAULTS = {\n [3042]: false,\n [32773]: new Float32Array([0, 0, 0, 0]),\n [32777]: 32774,\n [34877]: 32774,\n [32969]: 1,\n [32968]: 0,\n [32971]: 1,\n [32970]: 0,\n [3106]: new Float32Array([0, 0, 0, 0]),\n [3107]: [true, true, true, true],\n [2884]: false,\n [2885]: 1029,\n [2929]: false,\n [2931]: 1,\n [2932]: 513,\n [2928]: new Float32Array([0, 1]),\n [2930]: true,\n [3024]: true,\n [36006]: null,\n [2886]: 2305,\n [33170]: 4352,\n [2849]: 1,\n [32823]: false,\n [32824]: 0,\n [10752]: 0,\n [32938]: 1.0,\n [32939]: false,\n [3089]: false,\n [3088]: new Int32Array([0, 0, 1024, 1024]),\n [2960]: false,\n [2961]: 0,\n [2968]: 0xffffffff,\n [36005]: 0xffffffff,\n [2962]: 519,\n [2967]: 0,\n [2963]: 0xffffffff,\n [34816]: 519,\n [36003]: 0,\n [36004]: 0xffffffff,\n [2964]: 7680,\n [2965]: 7680,\n [2966]: 7680,\n [34817]: 7680,\n [34818]: 7680,\n [34819]: 7680,\n [2978]: [0, 0, 1024, 1024],\n [3333]: 4,\n [3317]: 4,\n [37440]: false,\n [37441]: false,\n [37443]: 37444,\n [35723]: 4352,\n [36010]: null,\n [35977]: false,\n [3330]: 0,\n [3332]: 0,\n [3331]: 0,\n [3314]: 0,\n [32878]: 0,\n [3316]: 0,\n [3315]: 0,\n [32877]: 0\n};\n\nconst enable = (gl, value, key) => value ? gl.enable(key) : gl.disable(key);\n\nconst hint = (gl, value, key) => gl.hint(key, value);\n\nconst pixelStorei = (gl, value, key) => gl.pixelStorei(key, value);\n\nconst drawFramebuffer = (gl, value) => {\n const target = (0,_utils_webgl_checks__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl) ? 36009 : 36160;\n return gl.bindFramebuffer(target, value);\n};\n\nconst readFramebuffer = (gl, value) => {\n return gl.bindFramebuffer(36008, value);\n};\n\nfunction isArray(array) {\n return Array.isArray(array) || ArrayBuffer.isView(array);\n}\n\nconst GL_PARAMETER_SETTERS = {\n [3042]: enable,\n [32773]: (gl, value) => gl.blendColor(...value),\n [32777]: 'blendEquation',\n [34877]: 'blendEquation',\n [32969]: 'blendFunc',\n [32968]: 'blendFunc',\n [32971]: 'blendFunc',\n [32970]: 'blendFunc',\n [3106]: (gl, value) => gl.clearColor(...value),\n [3107]: (gl, value) => gl.colorMask(...value),\n [2884]: enable,\n [2885]: (gl, value) => gl.cullFace(value),\n [2929]: enable,\n [2931]: (gl, value) => gl.clearDepth(value),\n [2932]: (gl, value) => gl.depthFunc(value),\n [2928]: (gl, value) => gl.depthRange(...value),\n [2930]: (gl, value) => gl.depthMask(value),\n [3024]: enable,\n [35723]: hint,\n [36006]: drawFramebuffer,\n [2886]: (gl, value) => gl.frontFace(value),\n [33170]: hint,\n [2849]: (gl, value) => gl.lineWidth(value),\n [32823]: enable,\n [32824]: 'polygonOffset',\n [10752]: 'polygonOffset',\n [35977]: enable,\n [32938]: 'sampleCoverage',\n [32939]: 'sampleCoverage',\n [3089]: enable,\n [3088]: (gl, value) => gl.scissor(...value),\n [2960]: enable,\n [2961]: (gl, value) => gl.clearStencil(value),\n [2968]: (gl, value) => gl.stencilMaskSeparate(1028, value),\n [36005]: (gl, value) => gl.stencilMaskSeparate(1029, value),\n [2962]: 'stencilFuncFront',\n [2967]: 'stencilFuncFront',\n [2963]: 'stencilFuncFront',\n [34816]: 'stencilFuncBack',\n [36003]: 'stencilFuncBack',\n [36004]: 'stencilFuncBack',\n [2964]: 'stencilOpFront',\n [2965]: 'stencilOpFront',\n [2966]: 'stencilOpFront',\n [34817]: 'stencilOpBack',\n [34818]: 'stencilOpBack',\n [34819]: 'stencilOpBack',\n [2978]: (gl, value) => gl.viewport(...value),\n [3333]: pixelStorei,\n [3317]: pixelStorei,\n [37440]: pixelStorei,\n [37441]: pixelStorei,\n [37443]: pixelStorei,\n [3330]: pixelStorei,\n [3332]: pixelStorei,\n [3331]: pixelStorei,\n [36010]: readFramebuffer,\n [3314]: pixelStorei,\n [32878]: pixelStorei,\n [3316]: pixelStorei,\n [3315]: pixelStorei,\n [32877]: pixelStorei,\n framebuffer: (gl, framebuffer) => {\n const handle = framebuffer && 'handle' in framebuffer ? framebuffer.handle : framebuffer;\n return gl.bindFramebuffer(36160, handle);\n },\n blend: (gl, value) => value ? gl.enable(3042) : gl.disable(3042),\n blendColor: (gl, value) => gl.blendColor(...value),\n blendEquation: (gl, args) => {\n args = isArray(args) ? args : [args, args];\n gl.blendEquationSeparate(...args);\n },\n blendFunc: (gl, args) => {\n args = isArray(args) && args.length === 2 ? [...args, ...args] : args;\n gl.blendFuncSeparate(...args);\n },\n clearColor: (gl, value) => gl.clearColor(...value),\n clearDepth: (gl, value) => gl.clearDepth(value),\n clearStencil: (gl, value) => gl.clearStencil(value),\n colorMask: (gl, value) => gl.colorMask(...value),\n cull: (gl, value) => value ? gl.enable(2884) : gl.disable(2884),\n cullFace: (gl, value) => gl.cullFace(value),\n depthTest: (gl, value) => value ? gl.enable(2929) : gl.disable(2929),\n depthFunc: (gl, value) => gl.depthFunc(value),\n depthMask: (gl, value) => gl.depthMask(value),\n depthRange: (gl, value) => gl.depthRange(...value),\n dither: (gl, value) => value ? gl.enable(3024) : gl.disable(3024),\n derivativeHint: (gl, value) => {\n gl.hint(35723, value);\n },\n frontFace: (gl, value) => gl.frontFace(value),\n mipmapHint: (gl, value) => gl.hint(33170, value),\n lineWidth: (gl, value) => gl.lineWidth(value),\n polygonOffsetFill: (gl, value) => value ? gl.enable(32823) : gl.disable(32823),\n polygonOffset: (gl, value) => gl.polygonOffset(...value),\n sampleCoverage: (gl, value) => gl.sampleCoverage(...value),\n scissorTest: (gl, value) => value ? gl.enable(3089) : gl.disable(3089),\n scissor: (gl, value) => gl.scissor(...value),\n stencilTest: (gl, value) => value ? gl.enable(2960) : gl.disable(2960),\n stencilMask: (gl, value) => {\n value = isArray(value) ? value : [value, value];\n const [mask, backMask] = value;\n gl.stencilMaskSeparate(1028, mask);\n gl.stencilMaskSeparate(1029, backMask);\n },\n stencilFunc: (gl, args) => {\n args = isArray(args) && args.length === 3 ? [...args, ...args] : args;\n const [func, ref, mask, backFunc, backRef, backMask] = args;\n gl.stencilFuncSeparate(1028, func, ref, mask);\n gl.stencilFuncSeparate(1029, backFunc, backRef, backMask);\n },\n stencilOp: (gl, args) => {\n args = isArray(args) && args.length === 3 ? [...args, ...args] : args;\n const [sfail, dpfail, dppass, backSfail, backDpfail, backDppass] = args;\n gl.stencilOpSeparate(1028, sfail, dpfail, dppass);\n gl.stencilOpSeparate(1029, backSfail, backDpfail, backDppass);\n },\n viewport: (gl, value) => gl.viewport(...value)\n};\n\nfunction getValue(glEnum, values, cache) {\n return values[glEnum] !== undefined ? values[glEnum] : cache[glEnum];\n}\n\nconst GL_COMPOSITE_PARAMETER_SETTERS = {\n blendEquation: (gl, values, cache) => gl.blendEquationSeparate(getValue(32777, values, cache), getValue(34877, values, cache)),\n blendFunc: (gl, values, cache) => gl.blendFuncSeparate(getValue(32969, values, cache), getValue(32968, values, cache), getValue(32971, values, cache), getValue(32970, values, cache)),\n polygonOffset: (gl, values, cache) => gl.polygonOffset(getValue(32824, values, cache), getValue(10752, values, cache)),\n sampleCoverage: (gl, values, cache) => gl.sampleCoverage(getValue(32938, values, cache), getValue(32939, values, cache)),\n stencilFuncFront: (gl, values, cache) => gl.stencilFuncSeparate(1028, getValue(2962, values, cache), getValue(2967, values, cache), getValue(2963, values, cache)),\n stencilFuncBack: (gl, values, cache) => gl.stencilFuncSeparate(1029, getValue(34816, values, cache), getValue(36003, values, cache), getValue(36004, values, cache)),\n stencilOpFront: (gl, values, cache) => gl.stencilOpSeparate(1028, getValue(2964, values, cache), getValue(2965, values, cache), getValue(2966, values, cache)),\n stencilOpBack: (gl, values, cache) => gl.stencilOpSeparate(1029, getValue(34817, values, cache), getValue(34818, values, cache), getValue(34819, values, cache))\n};\nconst GL_HOOKED_SETTERS = {\n enable: (update, capability) => update({\n [capability]: true\n }),\n disable: (update, capability) => update({\n [capability]: false\n }),\n pixelStorei: (update, pname, value) => update({\n [pname]: value\n }),\n hint: (update, pname, hint) => update({\n [pname]: hint\n }),\n bindFramebuffer: (update, target, framebuffer) => {\n switch (target) {\n case 36160:\n return update({\n [36006]: framebuffer,\n [36010]: framebuffer\n });\n\n case 36009:\n return update({\n [36006]: framebuffer\n });\n\n case 36008:\n return update({\n [36010]: framebuffer\n });\n\n default:\n return null;\n }\n },\n blendColor: (update, r, g, b, a) => update({\n [32773]: new Float32Array([r, g, b, a])\n }),\n blendEquation: (update, mode) => update({\n [32777]: mode,\n [34877]: mode\n }),\n blendEquationSeparate: (update, modeRGB, modeAlpha) => update({\n [32777]: modeRGB,\n [34877]: modeAlpha\n }),\n blendFunc: (update, src, dst) => update({\n [32969]: src,\n [32968]: dst,\n [32971]: src,\n [32970]: dst\n }),\n blendFuncSeparate: (update, srcRGB, dstRGB, srcAlpha, dstAlpha) => update({\n [32969]: srcRGB,\n [32968]: dstRGB,\n [32971]: srcAlpha,\n [32970]: dstAlpha\n }),\n clearColor: (update, r, g, b, a) => update({\n [3106]: new Float32Array([r, g, b, a])\n }),\n clearDepth: (update, depth) => update({\n [2931]: depth\n }),\n clearStencil: (update, s) => update({\n [2961]: s\n }),\n colorMask: (update, r, g, b, a) => update({\n [3107]: [r, g, b, a]\n }),\n cullFace: (update, mode) => update({\n [2885]: mode\n }),\n depthFunc: (update, func) => update({\n [2932]: func\n }),\n depthRange: (update, zNear, zFar) => update({\n [2928]: new Float32Array([zNear, zFar])\n }),\n depthMask: (update, mask) => update({\n [2930]: mask\n }),\n frontFace: (update, face) => update({\n [2886]: face\n }),\n lineWidth: (update, width) => update({\n [2849]: width\n }),\n polygonOffset: (update, factor, units) => update({\n [32824]: factor,\n [10752]: units\n }),\n sampleCoverage: (update, value, invert) => update({\n [32938]: value,\n [32939]: invert\n }),\n scissor: (update, x, y, width, height) => update({\n [3088]: new Int32Array([x, y, width, height])\n }),\n stencilMask: (update, mask) => update({\n [2968]: mask,\n [36005]: mask\n }),\n stencilMaskSeparate: (update, face, mask) => update({\n [face === 1028 ? 2968 : 36005]: mask\n }),\n stencilFunc: (update, func, ref, mask) => update({\n [2962]: func,\n [2967]: ref,\n [2963]: mask,\n [34816]: func,\n [36003]: ref,\n [36004]: mask\n }),\n stencilFuncSeparate: (update, face, func, ref, mask) => update({\n [face === 1028 ? 2962 : 34816]: func,\n [face === 1028 ? 2967 : 36003]: ref,\n [face === 1028 ? 2963 : 36004]: mask\n }),\n stencilOp: (update, fail, zfail, zpass) => update({\n [2964]: fail,\n [2965]: zfail,\n [2966]: zpass,\n [34817]: fail,\n [34818]: zfail,\n [34819]: zpass\n }),\n stencilOpSeparate: (update, face, fail, zfail, zpass) => update({\n [face === 1028 ? 2964 : 34817]: fail,\n [face === 1028 ? 2965 : 34818]: zfail,\n [face === 1028 ? 2966 : 34819]: zpass\n }),\n viewport: (update, x, y, width, height) => update({\n [2978]: [x, y, width, height]\n })\n};\n\nconst isEnabled = (gl, key) => gl.isEnabled(key);\n\nconst GL_PARAMETER_GETTERS = {\n [3042]: isEnabled,\n [2884]: isEnabled,\n [2929]: isEnabled,\n [3024]: isEnabled,\n [32823]: isEnabled,\n [32926]: isEnabled,\n [32928]: isEnabled,\n [3089]: isEnabled,\n [2960]: isEnabled,\n [35977]: isEnabled\n};\n//# sourceMappingURL=webgl-parameter-tables.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/gltools/dist/esm/state-tracker/webgl-parameter-tables.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/gltools/dist/esm/utils/assert.js": +/*!****************************************************************!*\ + !*** ./node_modules/@luma.gl/gltools/dist/esm/utils/assert.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ assert: () => (/* binding */ assert)\n/* harmony export */ });\nfunction assert(condition, message) {\n if (!condition) {\n throw new Error(message || 'luma.gl: assertion failed.');\n }\n}\n//# sourceMappingURL=assert.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/gltools/dist/esm/utils/assert.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/gltools/dist/esm/utils/device-pixels.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@luma.gl/gltools/dist/esm/utils/device-pixels.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ cssToDevicePixels: () => (/* binding */ cssToDevicePixels),\n/* harmony export */ cssToDeviceRatio: () => (/* binding */ cssToDeviceRatio),\n/* harmony export */ getDevicePixelRatio: () => (/* binding */ getDevicePixelRatio)\n/* harmony export */ });\nfunction cssToDeviceRatio(gl) {\n const {\n luma\n } = gl;\n\n if (gl.canvas && luma) {\n const cachedSize = luma.canvasSizeInfo;\n const clientWidth = 'clientWidth' in cachedSize ? cachedSize.clientWidth : gl.canvas.clientWidth;\n return clientWidth ? gl.drawingBufferWidth / clientWidth : 1;\n }\n\n return 1;\n}\nfunction cssToDevicePixels(gl, cssPixel) {\n let yInvert = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n const ratio = cssToDeviceRatio(gl);\n const width = gl.drawingBufferWidth;\n const height = gl.drawingBufferHeight;\n return scalePixels(cssPixel, ratio, width, height, yInvert);\n}\nfunction getDevicePixelRatio(useDevicePixels) {\n const windowRatio = typeof window === 'undefined' ? 1 : window.devicePixelRatio || 1;\n\n if (Number.isFinite(useDevicePixels)) {\n return useDevicePixels <= 0 ? 1 : useDevicePixels;\n }\n\n return useDevicePixels ? windowRatio : 1;\n}\n\nfunction scalePixels(pixel, ratio, width, height, yInvert) {\n const x = scaleX(pixel[0], ratio, width);\n let y = scaleY(pixel[1], ratio, height, yInvert);\n let t = scaleX(pixel[0] + 1, ratio, width);\n const xHigh = t === width - 1 ? t : t - 1;\n t = scaleY(pixel[1] + 1, ratio, height, yInvert);\n let yHigh;\n\n if (yInvert) {\n t = t === 0 ? t : t + 1;\n yHigh = y;\n y = t;\n } else {\n yHigh = t === height - 1 ? t : t - 1;\n }\n\n return {\n x,\n y,\n width: Math.max(xHigh - x + 1, 1),\n height: Math.max(yHigh - y + 1, 1)\n };\n}\n\nfunction scaleX(x, ratio, width) {\n const r = Math.min(Math.round(x * ratio), width - 1);\n return r;\n}\n\nfunction scaleY(y, ratio, height, yInvert) {\n return yInvert ? Math.max(0, height - 1 - Math.round(y * ratio)) : Math.min(Math.round(y * ratio), height - 1);\n}\n//# sourceMappingURL=device-pixels.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/gltools/dist/esm/utils/device-pixels.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/gltools/dist/esm/utils/log.js": +/*!*************************************************************!*\ + !*** ./node_modules/@luma.gl/gltools/dist/esm/utils/log.js ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ log: () => (/* binding */ log)\n/* harmony export */ });\n/* harmony import */ var _probe_gl_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @probe.gl/log */ \"./node_modules/@probe.gl/log/dist/esm/log.js\");\n\nconst log = new _probe_gl_log__WEBPACK_IMPORTED_MODULE_0__.Log({\n id: 'luma.gl'\n});\n//# sourceMappingURL=log.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/gltools/dist/esm/utils/log.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/gltools/dist/esm/utils/utils.js": +/*!***************************************************************!*\ + !*** ./node_modules/@luma.gl/gltools/dist/esm/utils/utils.js ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ deepArrayEqual: () => (/* binding */ deepArrayEqual),\n/* harmony export */ isObjectEmpty: () => (/* binding */ isObjectEmpty)\n/* harmony export */ });\nfunction isObjectEmpty(object) {\n for (const key in object) {\n return false;\n }\n\n return true;\n}\nfunction deepArrayEqual(x, y) {\n if (x === y) {\n return true;\n }\n\n const isArrayX = Array.isArray(x) || ArrayBuffer.isView(x);\n const isArrayY = Array.isArray(y) || ArrayBuffer.isView(y);\n\n if (isArrayX && isArrayY && x.length === y.length) {\n for (let i = 0; i < x.length; ++i) {\n if (x[i] !== y[i]) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n}\n//# sourceMappingURL=utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/gltools/dist/esm/utils/utils.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/gltools/dist/esm/utils/webgl-checks.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@luma.gl/gltools/dist/esm/utils/webgl-checks.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ERR_WEBGL: () => (/* binding */ ERR_WEBGL),\n/* harmony export */ ERR_WEBGL2: () => (/* binding */ ERR_WEBGL2),\n/* harmony export */ assertWebGL2Context: () => (/* binding */ assertWebGL2Context),\n/* harmony export */ assertWebGLContext: () => (/* binding */ assertWebGLContext),\n/* harmony export */ getWebGL2Context: () => (/* binding */ getWebGL2Context),\n/* harmony export */ isWebGL: () => (/* binding */ isWebGL),\n/* harmony export */ isWebGL2: () => (/* binding */ isWebGL2)\n/* harmony export */ });\n/* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assert */ \"./node_modules/@luma.gl/gltools/dist/esm/utils/assert.js\");\n\nconst ERR_CONTEXT = 'Invalid WebGLRenderingContext';\nconst ERR_WEBGL = ERR_CONTEXT;\nconst ERR_WEBGL2 = 'Requires WebGL2';\nfunction isWebGL(gl) {\n if (typeof WebGLRenderingContext !== 'undefined' && gl instanceof WebGLRenderingContext) {\n return true;\n }\n\n if (typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext) {\n return true;\n }\n\n return Boolean(gl && Number.isFinite(gl._version));\n}\nfunction isWebGL2(gl) {\n if (typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext) {\n return true;\n }\n\n return Boolean(gl && gl._version === 2);\n}\nfunction getWebGL2Context(gl) {\n return isWebGL2(gl) ? gl : null;\n}\nfunction assertWebGLContext(gl) {\n (0,_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(isWebGL(gl), ERR_CONTEXT);\n return gl;\n}\nfunction assertWebGL2Context(gl) {\n (0,_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(isWebGL2(gl), ERR_WEBGL2);\n return gl;\n}\n//# sourceMappingURL=webgl-checks.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/gltools/dist/esm/utils/webgl-checks.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/lib/assemble-shaders.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/lib/assemble-shaders.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ assembleShaders: () => (/* binding */ assembleShaders)\n/* harmony export */ });\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ \"./node_modules/@luma.gl/shadertools/dist/esm/lib/constants.js\");\n/* harmony import */ var _resolve_modules__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resolve-modules */ \"./node_modules/@luma.gl/shadertools/dist/esm/lib/resolve-modules.js\");\n/* harmony import */ var _platform_defines__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./platform-defines */ \"./node_modules/@luma.gl/shadertools/dist/esm/lib/platform-defines.js\");\n/* harmony import */ var _inject_shader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./inject-shader */ \"./node_modules/@luma.gl/shadertools/dist/esm/lib/inject-shader.js\");\n/* harmony import */ var _transpile_shader__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./transpile-shader */ \"./node_modules/@luma.gl/shadertools/dist/esm/lib/transpile-shader.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ \"./node_modules/@luma.gl/shadertools/dist/esm/utils/assert.js\");\n\n\n\n\n\n\nconst INJECT_SHADER_DECLARATIONS = \"\\n\\n\".concat(_inject_shader__WEBPACK_IMPORTED_MODULE_0__.DECLARATION_INJECT_MARKER, \"\\n\\n\");\nconst SHADER_TYPE = {\n [_constants__WEBPACK_IMPORTED_MODULE_1__.VERTEX_SHADER]: 'vertex',\n [_constants__WEBPACK_IMPORTED_MODULE_1__.FRAGMENT_SHADER]: 'fragment'\n};\nconst FRAGMENT_SHADER_PROLOGUE = \"precision highp float;\\n\\n\";\nfunction assembleShaders(gl, opts) {\n const {\n vs,\n fs\n } = opts;\n const modules = (0,_resolve_modules__WEBPACK_IMPORTED_MODULE_2__.resolveModules)(opts.modules || []);\n return {\n gl,\n vs: assembleShader(gl, Object.assign({}, opts, {\n source: vs,\n type: _constants__WEBPACK_IMPORTED_MODULE_1__.VERTEX_SHADER,\n modules\n })),\n fs: assembleShader(gl, Object.assign({}, opts, {\n source: fs,\n type: _constants__WEBPACK_IMPORTED_MODULE_1__.FRAGMENT_SHADER,\n modules\n })),\n getUniforms: assembleGetUniforms(modules)\n };\n}\n\nfunction assembleShader(gl, _ref) {\n let {\n id,\n source,\n type,\n modules,\n defines = {},\n hookFunctions = [],\n inject = {},\n transpileToGLSL100 = false,\n prologue = true,\n log\n } = _ref;\n (0,_utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(typeof source === 'string', 'shader source must be a string');\n const isVertex = type === _constants__WEBPACK_IMPORTED_MODULE_1__.VERTEX_SHADER;\n const sourceLines = source.split('\\n');\n let glslVersion = 100;\n let versionLine = '';\n let coreSource = source;\n\n if (sourceLines[0].indexOf('#version ') === 0) {\n glslVersion = 300;\n versionLine = sourceLines[0];\n coreSource = sourceLines.slice(1).join('\\n');\n } else {\n versionLine = \"#version \".concat(glslVersion);\n }\n\n const allDefines = {};\n modules.forEach(module => {\n Object.assign(allDefines, module.getDefines());\n });\n Object.assign(allDefines, defines);\n let assembledSource = prologue ? \"\".concat(versionLine, \"\\n\").concat(getShaderName({\n id,\n source,\n type\n }), \"\\n\").concat(getShaderType({\n type\n }), \"\\n\").concat((0,_platform_defines__WEBPACK_IMPORTED_MODULE_4__.getPlatformShaderDefines)(gl), \"\\n\").concat((0,_platform_defines__WEBPACK_IMPORTED_MODULE_4__.getVersionDefines)(gl, glslVersion, !isVertex), \"\\n\").concat(getApplicationDefines(allDefines), \"\\n\").concat(isVertex ? '' : FRAGMENT_SHADER_PROLOGUE, \"\\n\") : \"\".concat(versionLine, \"\\n\");\n const hookFunctionMap = normalizeHookFunctions(hookFunctions);\n const hookInjections = {};\n const declInjections = {};\n const mainInjections = {};\n\n for (const key in inject) {\n const injection = typeof inject[key] === 'string' ? {\n injection: inject[key],\n order: 0\n } : inject[key];\n const match = key.match(/^(v|f)s:(#)?([\\w-]+)$/);\n\n if (match) {\n const hash = match[2];\n const name = match[3];\n\n if (hash) {\n if (name === 'decl') {\n declInjections[key] = [injection];\n } else {\n mainInjections[key] = [injection];\n }\n } else {\n hookInjections[key] = [injection];\n }\n } else {\n mainInjections[key] = [injection];\n }\n }\n\n for (const module of modules) {\n if (log) {\n module.checkDeprecations(coreSource, log);\n }\n\n const moduleSource = module.getModuleSource(type, glslVersion);\n assembledSource += moduleSource;\n const injections = module.injections[type];\n\n for (const key in injections) {\n const match = key.match(/^(v|f)s:#([\\w-]+)$/);\n\n if (match) {\n const name = match[2];\n const injectionType = name === 'decl' ? declInjections : mainInjections;\n injectionType[key] = injectionType[key] || [];\n injectionType[key].push(injections[key]);\n } else {\n hookInjections[key] = hookInjections[key] || [];\n hookInjections[key].push(injections[key]);\n }\n }\n }\n\n assembledSource += INJECT_SHADER_DECLARATIONS;\n assembledSource = (0,_inject_shader__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(assembledSource, type, declInjections);\n assembledSource += getHookFunctions(hookFunctionMap[type], hookInjections);\n assembledSource += coreSource;\n assembledSource = (0,_inject_shader__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(assembledSource, type, mainInjections);\n assembledSource = (0,_transpile_shader__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(assembledSource, transpileToGLSL100 ? 100 : glslVersion, isVertex);\n return assembledSource;\n}\n\nfunction assembleGetUniforms(modules) {\n return function getUniforms(opts) {\n const uniforms = {};\n\n for (const module of modules) {\n const moduleUniforms = module.getUniforms(opts, uniforms);\n Object.assign(uniforms, moduleUniforms);\n }\n\n return uniforms;\n };\n}\n\nfunction getShaderType(_ref2) {\n let {\n type\n } = _ref2;\n return \"\\n#define SHADER_TYPE_\".concat(SHADER_TYPE[type].toUpperCase(), \"\\n\");\n}\n\nfunction getShaderName(_ref3) {\n let {\n id,\n source,\n type\n } = _ref3;\n const injectShaderName = id && typeof id === 'string' && source.indexOf('SHADER_NAME') === -1;\n return injectShaderName ? \"\\n#define SHADER_NAME \".concat(id, \"_\").concat(SHADER_TYPE[type], \"\\n\\n\") : '';\n}\n\nfunction getApplicationDefines() {\n let defines = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let count = 0;\n let sourceText = '';\n\n for (const define in defines) {\n if (count === 0) {\n sourceText += '\\n// APPLICATION DEFINES\\n';\n }\n\n count++;\n const value = defines[define];\n\n if (value || Number.isFinite(value)) {\n sourceText += \"#define \".concat(define.toUpperCase(), \" \").concat(defines[define], \"\\n\");\n }\n }\n\n if (count === 0) {\n sourceText += '\\n';\n }\n\n return sourceText;\n}\n\nfunction getHookFunctions(hookFunctions, hookInjections) {\n let result = '';\n\n for (const hookName in hookFunctions) {\n const hookFunction = hookFunctions[hookName];\n result += \"void \".concat(hookFunction.signature, \" {\\n\");\n\n if (hookFunction.header) {\n result += \" \".concat(hookFunction.header);\n }\n\n if (hookInjections[hookName]) {\n const injections = hookInjections[hookName];\n injections.sort((a, b) => a.order - b.order);\n\n for (const injection of injections) {\n result += \" \".concat(injection.injection, \"\\n\");\n }\n }\n\n if (hookFunction.footer) {\n result += \" \".concat(hookFunction.footer);\n }\n\n result += '}\\n';\n }\n\n return result;\n}\n\nfunction normalizeHookFunctions(hookFunctions) {\n const result = {\n vs: {},\n fs: {}\n };\n hookFunctions.forEach(hook => {\n let opts;\n\n if (typeof hook !== 'string') {\n opts = hook;\n hook = opts.hook;\n } else {\n opts = {};\n }\n\n hook = hook.trim();\n const [stage, signature] = hook.split(':');\n const name = hook.replace(/\\(.+/, '');\n result[stage][name] = Object.assign(opts, {\n signature\n });\n });\n return result;\n}\n//# sourceMappingURL=assemble-shaders.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/lib/assemble-shaders.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/lib/constants.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/lib/constants.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FRAGMENT_SHADER: () => (/* binding */ FRAGMENT_SHADER),\n/* harmony export */ VERTEX_SHADER: () => (/* binding */ VERTEX_SHADER)\n/* harmony export */ });\nconst VERTEX_SHADER = 'vs';\nconst FRAGMENT_SHADER = 'fs';\n//# sourceMappingURL=constants.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/lib/constants.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/lib/filters/prop-types.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/lib/filters/prop-types.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ parsePropTypes: () => (/* binding */ parsePropTypes)\n/* harmony export */ });\nconst TYPE_DEFINITIONS = {\n number: {\n validate(value, propType) {\n return Number.isFinite(value) && (!('max' in propType) || value <= propType.max) && (!('min' in propType) || value >= propType.min);\n }\n\n },\n array: {\n validate(value, propType) {\n return Array.isArray(value) || ArrayBuffer.isView(value);\n }\n\n }\n};\nfunction parsePropTypes(propDefs) {\n const propTypes = {};\n\n for (const propName in propDefs) {\n const propDef = propDefs[propName];\n const propType = parsePropType(propDef);\n propTypes[propName] = propType;\n }\n\n return propTypes;\n}\n\nfunction parsePropType(propDef) {\n let type = getTypeOf(propDef);\n\n if (type === 'object') {\n if (!propDef) {\n return {\n type: 'object',\n value: null\n };\n }\n\n if ('type' in propDef) {\n return Object.assign({}, propDef, TYPE_DEFINITIONS[propDef.type]);\n }\n\n if (!('value' in propDef)) {\n return {\n type: 'object',\n value: propDef\n };\n }\n\n type = getTypeOf(propDef.value);\n return Object.assign({\n type\n }, propDef, TYPE_DEFINITIONS[type]);\n }\n\n return Object.assign({\n type,\n value: propDef\n }, TYPE_DEFINITIONS[type]);\n}\n\nfunction getTypeOf(value) {\n if (Array.isArray(value) || ArrayBuffer.isView(value)) {\n return 'array';\n }\n\n return typeof value;\n}\n//# sourceMappingURL=prop-types.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/lib/filters/prop-types.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/lib/inject-shader.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/lib/inject-shader.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DECLARATION_INJECT_MARKER: () => (/* binding */ DECLARATION_INJECT_MARKER),\n/* harmony export */ combineInjects: () => (/* binding */ combineInjects),\n/* harmony export */ \"default\": () => (/* binding */ injectShader)\n/* harmony export */ });\n/* harmony import */ var _modules_module_injectors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../modules/module-injectors */ \"./node_modules/@luma.gl/shadertools/dist/esm/modules/module-injectors.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ \"./node_modules/@luma.gl/shadertools/dist/esm/lib/constants.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ \"./node_modules/@luma.gl/shadertools/dist/esm/utils/assert.js\");\n\n\n\nconst MODULE_INJECTORS = {\n [_constants__WEBPACK_IMPORTED_MODULE_0__.VERTEX_SHADER]: _modules_module_injectors__WEBPACK_IMPORTED_MODULE_1__.MODULE_INJECTORS_VS,\n [_constants__WEBPACK_IMPORTED_MODULE_0__.FRAGMENT_SHADER]: _modules_module_injectors__WEBPACK_IMPORTED_MODULE_1__.MODULE_INJECTORS_FS\n};\nconst DECLARATION_INJECT_MARKER = '__LUMA_INJECT_DECLARATIONS__';\nconst REGEX_START_OF_MAIN = /void\\s+main\\s*\\([^)]*\\)\\s*\\{\\n?/;\nconst REGEX_END_OF_MAIN = /}\\n?[^{}]*$/;\nconst fragments = [];\nfunction injectShader(source, type, inject) {\n let injectStandardStubs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n const isVertex = type === _constants__WEBPACK_IMPORTED_MODULE_0__.VERTEX_SHADER;\n\n for (const key in inject) {\n const fragmentData = inject[key];\n fragmentData.sort((a, b) => a.order - b.order);\n fragments.length = fragmentData.length;\n\n for (let i = 0, len = fragmentData.length; i < len; ++i) {\n fragments[i] = fragmentData[i].injection;\n }\n\n const fragmentString = \"\".concat(fragments.join('\\n'), \"\\n\");\n\n switch (key) {\n case 'vs:#decl':\n if (isVertex) {\n source = source.replace(DECLARATION_INJECT_MARKER, fragmentString);\n }\n\n break;\n\n case 'vs:#main-start':\n if (isVertex) {\n source = source.replace(REGEX_START_OF_MAIN, match => match + fragmentString);\n }\n\n break;\n\n case 'vs:#main-end':\n if (isVertex) {\n source = source.replace(REGEX_END_OF_MAIN, match => fragmentString + match);\n }\n\n break;\n\n case 'fs:#decl':\n if (!isVertex) {\n source = source.replace(DECLARATION_INJECT_MARKER, fragmentString);\n }\n\n break;\n\n case 'fs:#main-start':\n if (!isVertex) {\n source = source.replace(REGEX_START_OF_MAIN, match => match + fragmentString);\n }\n\n break;\n\n case 'fs:#main-end':\n if (!isVertex) {\n source = source.replace(REGEX_END_OF_MAIN, match => fragmentString + match);\n }\n\n break;\n\n default:\n source = source.replace(key, match => match + fragmentString);\n }\n }\n\n source = source.replace(DECLARATION_INJECT_MARKER, '');\n\n if (injectStandardStubs) {\n source = source.replace(/\\}\\s*$/, match => match + MODULE_INJECTORS[type]);\n }\n\n return source;\n}\nfunction combineInjects(injects) {\n const result = {};\n (0,_utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(Array.isArray(injects) && injects.length > 1);\n injects.forEach(inject => {\n for (const key in inject) {\n result[key] = result[key] ? \"\".concat(result[key], \"\\n\").concat(inject[key]) : inject[key];\n }\n });\n return result;\n}\n//# sourceMappingURL=inject-shader.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/lib/inject-shader.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/lib/platform-defines.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/lib/platform-defines.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getPlatformShaderDefines: () => (/* binding */ getPlatformShaderDefines),\n/* harmony export */ getVersionDefines: () => (/* binding */ getVersionDefines)\n/* harmony export */ });\n/* harmony import */ var _utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/webgl-info */ \"./node_modules/@luma.gl/shadertools/dist/esm/utils/webgl-info.js\");\n\nfunction getPlatformShaderDefines(gl) {\n const debugInfo = (0,_utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__.getContextInfo)(gl);\n\n switch (debugInfo.gpuVendor.toLowerCase()) {\n case 'nvidia':\n return \"#define NVIDIA_GPU\\n// Nvidia optimizes away the calculation necessary for emulated fp64\\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\\n\";\n\n case 'intel':\n return \"#define INTEL_GPU\\n// Intel optimizes away the calculation necessary for emulated fp64\\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\\n// Intel's built-in 'tan' function doesn't have acceptable precision\\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\\n\";\n\n case 'amd':\n return \"#define AMD_GPU\\n\";\n\n default:\n return \"#define DEFAULT_GPU\\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\\n// Intel's built-in 'tan' function doesn't have acceptable precision\\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\\n\";\n }\n}\nfunction getVersionDefines(gl, glslVersion, isFragment) {\n let versionDefines = \"#if (__VERSION__ > 120)\\n\\n# define FEATURE_GLSL_DERIVATIVES\\n# define FEATURE_GLSL_DRAW_BUFFERS\\n# define FEATURE_GLSL_FRAG_DEPTH\\n# define FEATURE_GLSL_TEXTURE_LOD\\n\\n// DEPRECATED FLAGS, remove in v9\\n# define FRAG_DEPTH\\n# define DERIVATIVES\\n# define DRAW_BUFFERS\\n# define TEXTURE_LOD\\n\\n#endif // __VERSION\\n\";\n\n if ((0,_utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__.hasFeatures)(gl, _utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__.FEATURES.GLSL_FRAG_DEPTH)) {\n versionDefines += \"\\n// FRAG_DEPTH => gl_FragDepth is available\\n#ifdef GL_EXT_frag_depth\\n#extension GL_EXT_frag_depth : enable\\n# define FEATURE_GLSL_FRAG_DEPTH\\n# define FRAG_DEPTH\\n# define gl_FragDepth gl_FragDepthEXT\\n#endif\\n\";\n }\n\n if ((0,_utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__.hasFeatures)(gl, _utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__.FEATURES.GLSL_DERIVATIVES) && (0,_utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__.canCompileGLGSExtension)(gl, _utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__.FEATURES.GLSL_DERIVATIVES)) {\n versionDefines += \"\\n// DERIVATIVES => dxdF, dxdY and fwidth are available\\n#ifdef GL_OES_standard_derivatives\\n#extension GL_OES_standard_derivatives : enable\\n# define FEATURE_GLSL_DERIVATIVES\\n# define DERIVATIVES\\n#endif\\n\";\n }\n\n if ((0,_utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__.hasFeatures)(gl, _utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__.FEATURES.GLSL_FRAG_DATA) && (0,_utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__.canCompileGLGSExtension)(gl, _utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__.FEATURES.GLSL_FRAG_DATA, {\n behavior: 'require'\n })) {\n versionDefines += \"\\n// DRAW_BUFFERS => gl_FragData[] is available\\n#ifdef GL_EXT_draw_buffers\\n#extension GL_EXT_draw_buffers : require\\n#define FEATURE_GLSL_DRAW_BUFFERS\\n#define DRAW_BUFFERS\\n#endif\\n\";\n }\n\n if ((0,_utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__.hasFeatures)(gl, _utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__.FEATURES.GLSL_TEXTURE_LOD)) {\n versionDefines += \"// TEXTURE_LOD => texture2DLod etc are available\\n#ifdef GL_EXT_shader_texture_lod\\n#extension GL_EXT_shader_texture_lod : enable\\n\\n# define FEATURE_GLSL_TEXTURE_LOD\\n# define TEXTURE_LOD\\n\\n#endif\\n\";\n }\n\n return versionDefines;\n}\n//# sourceMappingURL=platform-defines.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/lib/platform-defines.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/lib/resolve-modules.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/lib/resolve-modules.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TEST_EXPORTS: () => (/* binding */ TEST_EXPORTS),\n/* harmony export */ resolveModules: () => (/* binding */ resolveModules)\n/* harmony export */ });\n/* harmony import */ var _shader_module__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shader-module */ \"./node_modules/@luma.gl/shadertools/dist/esm/lib/shader-module.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ \"./node_modules/@luma.gl/shadertools/dist/esm/utils/assert.js\");\n\n\nfunction resolveModules(modules) {\n return getShaderDependencies(instantiateModules(modules));\n}\n\nfunction getShaderDependencies(modules) {\n const moduleMap = {};\n const moduleDepth = {};\n getDependencyGraph({\n modules,\n level: 0,\n moduleMap,\n moduleDepth\n });\n return Object.keys(moduleDepth).sort((a, b) => moduleDepth[b] - moduleDepth[a]).map(name => moduleMap[name]);\n}\n\nfunction getDependencyGraph(_ref) {\n let {\n modules,\n level,\n moduleMap,\n moduleDepth\n } = _ref;\n\n if (level >= 5) {\n throw new Error('Possible loop in shader dependency graph');\n }\n\n for (const module of modules) {\n moduleMap[module.name] = module;\n\n if (moduleDepth[module.name] === undefined || moduleDepth[module.name] < level) {\n moduleDepth[module.name] = level;\n }\n }\n\n for (const module of modules) {\n if (module.dependencies) {\n getDependencyGraph({\n modules: module.dependencies,\n level: level + 1,\n moduleMap,\n moduleDepth\n });\n }\n }\n}\n\nfunction instantiateModules(modules, seen) {\n return modules.map(module => {\n if (module instanceof _shader_module__WEBPACK_IMPORTED_MODULE_0__[\"default\"]) {\n return module;\n }\n\n (0,_utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(typeof module !== 'string', \"Shader module use by name is deprecated. Import shader module '\".concat(module, \"' and use it directly.\"));\n (0,_utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(module.name, 'shader module has no name');\n module = new _shader_module__WEBPACK_IMPORTED_MODULE_0__[\"default\"](module);\n module.dependencies = instantiateModules(module.dependencies);\n return module;\n });\n}\n\nconst TEST_EXPORTS = {\n getShaderDependencies,\n getDependencyGraph\n};\n//# sourceMappingURL=resolve-modules.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/lib/resolve-modules.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/lib/shader-module.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/lib/shader-module.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ShaderModule),\n/* harmony export */ normalizeShaderModule: () => (/* binding */ normalizeShaderModule)\n/* harmony export */ });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ \"./node_modules/@luma.gl/shadertools/dist/esm/utils/assert.js\");\n/* harmony import */ var _filters_prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filters/prop-types */ \"./node_modules/@luma.gl/shadertools/dist/esm/lib/filters/prop-types.js\");\n\n\nconst VERTEX_SHADER = 'vs';\nconst FRAGMENT_SHADER = 'fs';\nclass ShaderModule {\n constructor(_ref) {\n let {\n name,\n vs,\n fs,\n dependencies = [],\n uniforms,\n getUniforms,\n deprecations = [],\n defines = {},\n inject = {},\n vertexShader,\n fragmentShader\n } = _ref;\n (0,_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(typeof name === 'string');\n this.name = name;\n this.vs = vs || vertexShader;\n this.fs = fs || fragmentShader;\n this.getModuleUniforms = getUniforms;\n this.dependencies = dependencies;\n this.deprecations = this._parseDeprecationDefinitions(deprecations);\n this.defines = defines;\n this.injections = normalizeInjections(inject);\n\n if (uniforms) {\n this.uniforms = (0,_filters_prop_types__WEBPACK_IMPORTED_MODULE_1__.parsePropTypes)(uniforms);\n }\n }\n\n getModuleSource(type) {\n let moduleSource;\n\n switch (type) {\n case VERTEX_SHADER:\n moduleSource = this.vs || '';\n break;\n\n case FRAGMENT_SHADER:\n moduleSource = this.fs || '';\n break;\n\n default:\n (0,_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(false);\n }\n\n return \"#define MODULE_\".concat(this.name.toUpperCase().replace(/[^0-9a-z]/gi, '_'), \"\\n\").concat(moduleSource, \"// END MODULE_\").concat(this.name, \"\\n\\n\");\n }\n\n getUniforms(opts, uniforms) {\n if (this.getModuleUniforms) {\n return this.getModuleUniforms(opts, uniforms);\n }\n\n if (this.uniforms) {\n return this._defaultGetUniforms(opts);\n }\n\n return {};\n }\n\n getDefines() {\n return this.defines;\n }\n\n checkDeprecations(shaderSource, log) {\n this.deprecations.forEach(def => {\n if (def.regex.test(shaderSource)) {\n if (def.deprecated) {\n log.deprecated(def.old, def.new)();\n } else {\n log.removed(def.old, def.new)();\n }\n }\n });\n }\n\n _parseDeprecationDefinitions(deprecations) {\n deprecations.forEach(def => {\n switch (def.type) {\n case 'function':\n def.regex = new RegExp(\"\\\\b\".concat(def.old, \"\\\\(\"));\n break;\n\n default:\n def.regex = new RegExp(\"\".concat(def.type, \" \").concat(def.old, \";\"));\n }\n });\n return deprecations;\n }\n\n _defaultGetUniforms() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const uniforms = {};\n const propTypes = this.uniforms;\n\n for (const key in propTypes) {\n const propDef = propTypes[key];\n\n if (key in opts && !propDef.private) {\n if (propDef.validate) {\n (0,_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(propDef.validate(opts[key], propDef), \"\".concat(this.name, \": invalid \").concat(key));\n }\n\n uniforms[key] = opts[key];\n } else {\n uniforms[key] = propDef.value;\n }\n }\n\n return uniforms;\n }\n\n}\nfunction normalizeShaderModule(module) {\n if (!module.normalized) {\n module.normalized = true;\n\n if (module.uniforms && !module.getUniforms) {\n const shaderModule = new ShaderModule(module);\n module.getUniforms = shaderModule.getUniforms.bind(shaderModule);\n }\n }\n\n return module;\n}\n\nfunction normalizeInjections(injections) {\n const result = {\n vs: {},\n fs: {}\n };\n\n for (const hook in injections) {\n let injection = injections[hook];\n const stage = hook.slice(0, 2);\n\n if (typeof injection === 'string') {\n injection = {\n order: 0,\n injection\n };\n }\n\n result[stage][hook] = injection;\n }\n\n return result;\n}\n//# sourceMappingURL=shader-module.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/lib/shader-module.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/lib/transpile-shader.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/lib/transpile-shader.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ transpileShader)\n/* harmony export */ });\nfunction testVariable(qualifier) {\n return new RegExp(\"\\\\b\".concat(qualifier, \"[ \\\\t]+(\\\\w+[ \\\\t]+\\\\w+(\\\\[\\\\w+\\\\])?;)\"), 'g');\n}\n\nconst ES300_REPLACEMENTS = [[/^(#version[ \\t]+(100|300[ \\t]+es))?[ \\t]*\\n/, '#version 300 es\\n'], [/\\btexture(2D|2DProj|Cube)Lod(EXT)?\\(/g, 'textureLod('], [/\\btexture(2D|2DProj|Cube)(EXT)?\\(/g, 'texture(']];\nconst ES300_VERTEX_REPLACEMENTS = [...ES300_REPLACEMENTS, [testVariable('attribute'), 'in $1'], [testVariable('varying'), 'out $1']];\nconst ES300_FRAGMENT_REPLACEMENTS = [...ES300_REPLACEMENTS, [testVariable('varying'), 'in $1']];\nconst ES100_REPLACEMENTS = [[/^#version[ \\t]+300[ \\t]+es/, '#version 100'], [/\\btexture(2D|2DProj|Cube)Lod\\(/g, 'texture$1LodEXT('], [/\\btexture\\(/g, 'texture2D('], [/\\btextureLod\\(/g, 'texture2DLodEXT(']];\nconst ES100_VERTEX_REPLACEMENTS = [...ES100_REPLACEMENTS, [testVariable('in'), 'attribute $1'], [testVariable('out'), 'varying $1']];\nconst ES100_FRAGMENT_REPLACEMENTS = [...ES100_REPLACEMENTS, [testVariable('in'), 'varying $1']];\nconst ES100_FRAGMENT_OUTPUT_NAME = 'gl_FragColor';\nconst ES300_FRAGMENT_OUTPUT_REGEX = /\\bout[ \\t]+vec4[ \\t]+(\\w+)[ \\t]*;\\n?/;\nconst REGEX_START_OF_MAIN = /void\\s+main\\s*\\([^)]*\\)\\s*\\{\\n?/;\nfunction transpileShader(source, targetGLSLVersion, isVertex) {\n switch (targetGLSLVersion) {\n case 300:\n return isVertex ? convertShader(source, ES300_VERTEX_REPLACEMENTS) : convertFragmentShaderTo300(source);\n\n case 100:\n return isVertex ? convertShader(source, ES100_VERTEX_REPLACEMENTS) : convertFragmentShaderTo100(source);\n\n default:\n throw new Error(\"unknown GLSL version \".concat(targetGLSLVersion));\n }\n}\n\nfunction convertShader(source, replacements) {\n for (const [pattern, replacement] of replacements) {\n source = source.replace(pattern, replacement);\n }\n\n return source;\n}\n\nfunction convertFragmentShaderTo300(source) {\n source = convertShader(source, ES300_FRAGMENT_REPLACEMENTS);\n const outputMatch = source.match(ES300_FRAGMENT_OUTPUT_REGEX);\n\n if (outputMatch) {\n const outputName = outputMatch[1];\n source = source.replace(new RegExp(\"\\\\b\".concat(ES100_FRAGMENT_OUTPUT_NAME, \"\\\\b\"), 'g'), outputName);\n } else {\n const outputName = 'fragmentColor';\n source = source.replace(REGEX_START_OF_MAIN, match => \"out vec4 \".concat(outputName, \";\\n\").concat(match)).replace(new RegExp(\"\\\\b\".concat(ES100_FRAGMENT_OUTPUT_NAME, \"\\\\b\"), 'g'), outputName);\n }\n\n return source;\n}\n\nfunction convertFragmentShaderTo100(source) {\n source = convertShader(source, ES100_FRAGMENT_REPLACEMENTS);\n const outputMatch = source.match(ES300_FRAGMENT_OUTPUT_REGEX);\n\n if (outputMatch) {\n const outputName = outputMatch[1];\n source = source.replace(ES300_FRAGMENT_OUTPUT_REGEX, '').replace(new RegExp(\"\\\\b\".concat(outputName, \"\\\\b\"), 'g'), ES100_FRAGMENT_OUTPUT_NAME);\n }\n\n return source;\n}\n//# sourceMappingURL=transpile-shader.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/lib/transpile-shader.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/modules/fp32/fp32.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/modules/fp32/fp32.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ fp32: () => (/* binding */ fp32)\n/* harmony export */ });\nconst fp32shader = \"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\\nconst float TWO_PI = 6.2831854820251465;\\nconst float PI_2 = 1.5707963705062866;\\nconst float PI_16 = 0.1963495463132858;\\n\\nconst float SIN_TABLE_0 = 0.19509032368659973;\\nconst float SIN_TABLE_1 = 0.3826834261417389;\\nconst float SIN_TABLE_2 = 0.5555702447891235;\\nconst float SIN_TABLE_3 = 0.7071067690849304;\\n\\nconst float COS_TABLE_0 = 0.9807852506637573;\\nconst float COS_TABLE_1 = 0.9238795042037964;\\nconst float COS_TABLE_2 = 0.8314695954322815;\\nconst float COS_TABLE_3 = 0.7071067690849304;\\n\\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\\n\\nfloat sin_taylor_fp32(float a) {\\n float r, s, t, x;\\n\\n if (a == 0.0) {\\n return 0.0;\\n }\\n\\n x = -a * a;\\n s = a;\\n r = a;\\n\\n r = r * x;\\n t = r * INVERSE_FACTORIAL_3;\\n s = s + t;\\n\\n r = r * x;\\n t = r * INVERSE_FACTORIAL_5;\\n s = s + t;\\n\\n r = r * x;\\n t = r * INVERSE_FACTORIAL_7;\\n s = s + t;\\n\\n r = r * x;\\n t = r * INVERSE_FACTORIAL_9;\\n s = s + t;\\n\\n return s;\\n}\\n\\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\\n if (a == 0.0) {\\n sin_t = 0.0;\\n cos_t = 1.0;\\n }\\n sin_t = sin_taylor_fp32(a);\\n cos_t = sqrt(1.0 - sin_t * sin_t);\\n}\\n\\nfloat tan_taylor_fp32(float a) {\\n float sin_a;\\n float cos_a;\\n\\n if (a == 0.0) {\\n return 0.0;\\n }\\n float z = floor(a / TWO_PI);\\n float r = a - TWO_PI * z;\\n\\n float t;\\n float q = floor(r / PI_2 + 0.5);\\n int j = int(q);\\n\\n if (j < -2 || j > 2) {\\n return 1.0 / 0.0;\\n }\\n\\n t = r - PI_2 * q;\\n\\n q = floor(t / PI_16 + 0.5);\\n int k = int(q);\\n int abs_k = int(abs(float(k)));\\n\\n if (abs_k > 4) {\\n return 1.0 / 0.0;\\n } else {\\n t = t - PI_16 * q;\\n }\\n\\n float u = 0.0;\\n float v = 0.0;\\n\\n float sin_t, cos_t;\\n float s, c;\\n sincos_taylor_fp32(t, sin_t, cos_t);\\n\\n if (k == 0) {\\n s = sin_t;\\n c = cos_t;\\n } else {\\n if (abs(float(abs_k) - 1.0) < 0.5) {\\n u = COS_TABLE_0;\\n v = SIN_TABLE_0;\\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\\n u = COS_TABLE_1;\\n v = SIN_TABLE_1;\\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\\n u = COS_TABLE_2;\\n v = SIN_TABLE_2;\\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\\n u = COS_TABLE_3;\\n v = SIN_TABLE_3;\\n }\\n if (k > 0) {\\n s = u * sin_t + v * cos_t;\\n c = u * cos_t - v * sin_t;\\n } else {\\n s = u * sin_t - v * cos_t;\\n c = u * cos_t + v * sin_t;\\n }\\n }\\n\\n if (j == 0) {\\n sin_a = s;\\n cos_a = c;\\n } else if (j == 1) {\\n sin_a = c;\\n cos_a = -s;\\n } else if (j == -1) {\\n sin_a = -c;\\n cos_a = s;\\n } else {\\n sin_a = -s;\\n cos_a = -c;\\n }\\n return sin_a / cos_a;\\n}\\n#endif\\n\\nfloat tan_fp32(float a) {\\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\\n return tan_taylor_fp32(a);\\n#else\\n return tan(a);\\n#endif\\n}\\n\";\nconst fp32 = {\n name: 'fp32',\n vs: fp32shader,\n fs: null\n};\n//# sourceMappingURL=fp32.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/modules/fp32/fp32.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/modules/lights/lights.glsl.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/modules/lights/lights.glsl.js ***! + \**********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (\"#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\\n\\nstruct AmbientLight {\\n vec3 color;\\n};\\n\\nstruct PointLight {\\n vec3 color;\\n vec3 position;\\n vec3 attenuation;\\n};\\n\\nstruct DirectionalLight {\\n vec3 color;\\n vec3 direction;\\n};\\n\\nuniform AmbientLight lighting_uAmbientLight;\\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\\nuniform int lighting_uPointLightCount;\\nuniform int lighting_uDirectionalLightCount;\\n\\nuniform bool lighting_uEnabled;\\n\\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\\n return pointLight.attenuation.x\\n + pointLight.attenuation.y * distance\\n + pointLight.attenuation.z * distance * distance;\\n}\\n\\n#endif\\n\");\n//# sourceMappingURL=lights.glsl.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/modules/lights/lights.glsl.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/modules/lights/lights.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/modules/lights/lights.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ lights: () => (/* binding */ lights)\n/* harmony export */ });\n/* harmony import */ var _lights_glsl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lights.glsl */ \"./node_modules/@luma.gl/shadertools/dist/esm/modules/lights/lights.glsl.js\");\n\nconst INITIAL_MODULE_OPTIONS = {\n lightSources: {}\n};\n\nfunction convertColor() {\n let {\n color = [0, 0, 0],\n intensity = 1.0\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return color.map(component => component * intensity / 255.0);\n}\n\nfunction getLightSourceUniforms(_ref) {\n let {\n ambientLight,\n pointLights = [],\n directionalLights = []\n } = _ref;\n const lightSourceUniforms = {};\n\n if (ambientLight) {\n lightSourceUniforms['lighting_uAmbientLight.color'] = convertColor(ambientLight);\n } else {\n lightSourceUniforms['lighting_uAmbientLight.color'] = [0, 0, 0];\n }\n\n pointLights.forEach((pointLight, index) => {\n lightSourceUniforms[\"lighting_uPointLight[\".concat(index, \"].color\")] = convertColor(pointLight);\n lightSourceUniforms[\"lighting_uPointLight[\".concat(index, \"].position\")] = pointLight.position;\n lightSourceUniforms[\"lighting_uPointLight[\".concat(index, \"].attenuation\")] = pointLight.attenuation || [1, 0, 0];\n });\n lightSourceUniforms.lighting_uPointLightCount = pointLights.length;\n directionalLights.forEach((directionalLight, index) => {\n lightSourceUniforms[\"lighting_uDirectionalLight[\".concat(index, \"].color\")] = convertColor(directionalLight);\n lightSourceUniforms[\"lighting_uDirectionalLight[\".concat(index, \"].direction\")] = directionalLight.direction;\n });\n lightSourceUniforms.lighting_uDirectionalLightCount = directionalLights.length;\n return lightSourceUniforms;\n}\n\nfunction getUniforms() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INITIAL_MODULE_OPTIONS;\n\n if ('lightSources' in opts) {\n const {\n ambientLight,\n pointLights,\n directionalLights\n } = opts.lightSources || {};\n const hasLights = ambientLight || pointLights && pointLights.length > 0 || directionalLights && directionalLights.length > 0;\n\n if (!hasLights) {\n return {\n lighting_uEnabled: false\n };\n }\n\n return Object.assign({}, getLightSourceUniforms({\n ambientLight,\n pointLights,\n directionalLights\n }), {\n lighting_uEnabled: true\n });\n }\n\n if ('lights' in opts) {\n const lightSources = {\n pointLights: [],\n directionalLights: []\n };\n\n for (const light of opts.lights || []) {\n switch (light.type) {\n case 'ambient':\n lightSources.ambientLight = light;\n break;\n\n case 'directional':\n lightSources.directionalLights.push(light);\n break;\n\n case 'point':\n lightSources.pointLights.push(light);\n break;\n\n default:\n }\n }\n\n return getUniforms({\n lightSources\n });\n }\n\n return {};\n}\n\nconst lights = {\n name: 'lights',\n vs: _lights_glsl__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n fs: _lights_glsl__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n getUniforms,\n defines: {\n MAX_LIGHTS: 3\n }\n};\n//# sourceMappingURL=lights.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/modules/lights/lights.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/modules/module-injectors.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/modules/module-injectors.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MODULE_INJECTORS_FS: () => (/* binding */ MODULE_INJECTORS_FS),\n/* harmony export */ MODULE_INJECTORS_VS: () => (/* binding */ MODULE_INJECTORS_VS)\n/* harmony export */ });\nconst MODULE_INJECTORS_VS = \"#ifdef MODULE_LOGDEPTH\\n logdepth_adjustPosition(gl_Position);\\n#endif\\n\";\nconst MODULE_INJECTORS_FS = \"#ifdef MODULE_MATERIAL\\n gl_FragColor = material_filterColor(gl_FragColor);\\n#endif\\n\\n#ifdef MODULE_LIGHTING\\n gl_FragColor = lighting_filterColor(gl_FragColor);\\n#endif\\n\\n#ifdef MODULE_FOG\\n gl_FragColor = fog_filterColor(gl_FragColor);\\n#endif\\n\\n#ifdef MODULE_PICKING\\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\\n#endif\\n\\n#ifdef MODULE_LOGDEPTH\\n logdepth_setFragDepth();\\n#endif\\n\";\n//# sourceMappingURL=module-injectors.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/modules/module-injectors.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/modules/phong-lighting/phong-lighting.glsl.js": +/*!**************************************************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/modules/phong-lighting/phong-lighting.glsl.js ***! + \**************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (\"\\nuniform float lighting_uAmbient;\\nuniform float lighting_uDiffuse;\\nuniform float lighting_uShininess;\\nuniform vec3 lighting_uSpecularColor;\\n\\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\\n vec3 halfway_direction = normalize(light_direction + view_direction);\\n float lambertian = dot(light_direction, normal_worldspace);\\n float specular = 0.0;\\n if (lambertian > 0.0) {\\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\\n specular = pow(specular_angle, lighting_uShininess);\\n }\\n lambertian = max(lambertian, 0.0);\\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\\n}\\n\\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\\n vec3 lightColor = surfaceColor;\\n\\n if (lighting_uEnabled) {\\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\\n\\n for (int i = 0; i < MAX_LIGHTS; i++) {\\n if (i >= lighting_uPointLightCount) {\\n break;\\n }\\n PointLight pointLight = lighting_uPointLight[i];\\n vec3 light_position_worldspace = pointLight.position;\\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\\n }\\n\\n for (int i = 0; i < MAX_LIGHTS; i++) {\\n if (i >= lighting_uDirectionalLightCount) {\\n break;\\n }\\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\\n }\\n }\\n return lightColor;\\n}\\n\\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\\n vec3 lightColor = vec3(0, 0, 0);\\n vec3 surfaceColor = vec3(0, 0, 0);\\n\\n if (lighting_uEnabled) {\\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\\n\\n for (int i = 0; i < MAX_LIGHTS; i++) {\\n if (i >= lighting_uPointLightCount) {\\n break;\\n }\\n PointLight pointLight = lighting_uPointLight[i];\\n vec3 light_position_worldspace = pointLight.position;\\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\\n }\\n\\n for (int i = 0; i < MAX_LIGHTS; i++) {\\n if (i >= lighting_uDirectionalLightCount) {\\n break;\\n }\\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\\n }\\n }\\n return lightColor;\\n}\\n\");\n//# sourceMappingURL=phong-lighting.glsl.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/modules/phong-lighting/phong-lighting.glsl.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/modules/phong-lighting/phong-lighting.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/modules/phong-lighting/phong-lighting.js ***! + \*********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ gouraudLighting: () => (/* binding */ gouraudLighting),\n/* harmony export */ phongLighting: () => (/* binding */ phongLighting)\n/* harmony export */ });\n/* harmony import */ var _lights_lights__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lights/lights */ \"./node_modules/@luma.gl/shadertools/dist/esm/modules/lights/lights.js\");\n/* harmony import */ var _phong_lighting_glsl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./phong-lighting.glsl */ \"./node_modules/@luma.gl/shadertools/dist/esm/modules/phong-lighting/phong-lighting.glsl.js\");\n\n\nconst INITIAL_MODULE_OPTIONS = {};\n\nfunction getMaterialUniforms(material) {\n const {\n ambient = 0.35,\n diffuse = 0.6,\n shininess = 32,\n specularColor = [30, 30, 30]\n } = material;\n return {\n lighting_uAmbient: ambient,\n lighting_uDiffuse: diffuse,\n lighting_uShininess: shininess,\n lighting_uSpecularColor: specularColor.map(x => x / 255)\n };\n}\n\nfunction getUniforms() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INITIAL_MODULE_OPTIONS;\n\n if (!('material' in opts)) {\n return {};\n }\n\n const {\n material\n } = opts;\n\n if (!material) {\n return {\n lighting_uEnabled: false\n };\n }\n\n return getMaterialUniforms(material);\n}\n\nconst gouraudLighting = {\n name: 'gouraud-lighting',\n dependencies: [_lights_lights__WEBPACK_IMPORTED_MODULE_0__.lights],\n vs: _phong_lighting_glsl__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n defines: {\n LIGHTING_VERTEX: 1\n },\n getUniforms\n};\nconst phongLighting = {\n name: 'phong-lighting',\n dependencies: [_lights_lights__WEBPACK_IMPORTED_MODULE_0__.lights],\n fs: _phong_lighting_glsl__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n defines: {\n LIGHTING_FRAGMENT: 1\n },\n getUniforms\n};\n//# sourceMappingURL=phong-lighting.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/modules/phong-lighting/phong-lighting.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/modules/picking/picking.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/modules/picking/picking.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ picking: () => (/* binding */ picking)\n/* harmony export */ });\nconst DEFAULT_HIGHLIGHT_COLOR = new Uint8Array([0, 255, 255, 255]);\nconst DEFAULT_MODULE_OPTIONS = {\n pickingSelectedColor: null,\n pickingHighlightColor: DEFAULT_HIGHLIGHT_COLOR,\n pickingActive: false,\n pickingAttribute: false\n};\n\nfunction getUniforms() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_MODULE_OPTIONS;\n const uniforms = {};\n\n if (opts.pickingSelectedColor !== undefined) {\n if (!opts.pickingSelectedColor) {\n uniforms.picking_uSelectedColorValid = 0;\n } else {\n const selectedColor = opts.pickingSelectedColor.slice(0, 3);\n uniforms.picking_uSelectedColorValid = 1;\n uniforms.picking_uSelectedColor = selectedColor;\n }\n }\n\n if (opts.pickingHighlightColor) {\n const color = Array.from(opts.pickingHighlightColor, x => x / 255);\n\n if (!Number.isFinite(color[3])) {\n color[3] = 1;\n }\n\n uniforms.picking_uHighlightColor = color;\n }\n\n if (opts.pickingActive !== undefined) {\n uniforms.picking_uActive = Boolean(opts.pickingActive);\n uniforms.picking_uAttribute = Boolean(opts.pickingAttribute);\n }\n\n return uniforms;\n}\n\nconst vs = \"uniform bool picking_uActive;\\nuniform bool picking_uAttribute;\\nuniform vec3 picking_uSelectedColor;\\nuniform bool picking_uSelectedColorValid;\\n\\nout vec4 picking_vRGBcolor_Avalid;\\n\\nconst float COLOR_SCALE = 1. / 255.;\\n\\nbool picking_isColorValid(vec3 color) {\\n return dot(color, vec3(1.0)) > 0.001;\\n}\\n\\nbool isVertexPicked(vec3 vertexColor) {\\n return\\n picking_uSelectedColorValid &&\\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\\n}\\n\\nvoid picking_setPickingColor(vec3 pickingColor) {\\n if (picking_uActive) {\\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\\n\\n if (!picking_uAttribute) {\\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\\n }\\n } else {\\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\\n }\\n}\\n\\nvoid picking_setPickingAttribute(float value) {\\n if (picking_uAttribute) {\\n picking_vRGBcolor_Avalid.r = value;\\n }\\n}\\nvoid picking_setPickingAttribute(vec2 value) {\\n if (picking_uAttribute) {\\n picking_vRGBcolor_Avalid.rg = value;\\n }\\n}\\nvoid picking_setPickingAttribute(vec3 value) {\\n if (picking_uAttribute) {\\n picking_vRGBcolor_Avalid.rgb = value;\\n }\\n}\\n\";\nconst fs = \"uniform bool picking_uActive;\\nuniform vec3 picking_uSelectedColor;\\nuniform vec4 picking_uHighlightColor;\\n\\nin vec4 picking_vRGBcolor_Avalid;\\nvec4 picking_filterHighlightColor(vec4 color) {\\n if (picking_uActive) {\\n return color;\\n }\\n bool selected = bool(picking_vRGBcolor_Avalid.a);\\n\\n if (selected) {\\n float highLightAlpha = picking_uHighlightColor.a;\\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\\n float highLightRatio = highLightAlpha / blendedAlpha;\\n\\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\\n return vec4(blendedRGB, blendedAlpha);\\n } else {\\n return color;\\n }\\n}\\nvec4 picking_filterPickingColor(vec4 color) {\\n if (picking_uActive) {\\n if (picking_vRGBcolor_Avalid.a == 0.0) {\\n discard;\\n }\\n return picking_vRGBcolor_Avalid;\\n }\\n return color;\\n}\\nvec4 picking_filterColor(vec4 color) {\\n vec4 highightColor = picking_filterHighlightColor(color);\\n return picking_filterPickingColor(highightColor);\\n}\\n\\n\";\nconst picking = {\n name: 'picking',\n vs,\n fs,\n getUniforms\n};\n//# sourceMappingURL=picking.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/modules/picking/picking.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/modules/transform/transform.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/modules/transform/transform.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ transform: () => (/* binding */ transform)\n/* harmony export */ });\nconst vs = \"attribute float transform_elementID;\\nvec2 transform_getPixelSizeHalf(vec2 size) {\\n return vec2(1.) / (2. * size);\\n}\\n\\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\\n float xIndex = transform_elementID - (yIndex * texSize[0]);\\n return vec2(xIndex, yIndex);\\n}\\nvec2 transform_getTexCoord(vec2 size) {\\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\\n vec2 coord = indices / size + pixelSizeHalf;\\n return coord;\\n}\\nvec2 transform_getPos(vec2 size) {\\n vec2 texCoord = transform_getTexCoord(size);\\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\\n return pos;\\n}\\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\\n vec2 texCoord = transform_getTexCoord(size);\\n vec4 textureColor = texture2D(texSampler, texCoord);\\n return textureColor;\\n}\\n\";\nconst transform = {\n name: 'transform',\n vs,\n fs: null\n};\n//# sourceMappingURL=transform.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/modules/transform/transform.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/utils/assert.js": +/*!********************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/utils/assert.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ assert)\n/* harmony export */ });\nfunction assert(condition, message) {\n if (!condition) {\n throw new Error(message || 'shadertools: assertion failed.');\n }\n}\n//# sourceMappingURL=assert.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/utils/assert.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/utils/is-old-ie.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/utils/is-old-ie.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ isOldIE)\n/* harmony export */ });\nfunction isOldIE() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const navigator = typeof window !== 'undefined' ? window.navigator || {} : {};\n const userAgent = opts.userAgent || navigator.userAgent || '';\n const isMSIE = userAgent.indexOf('MSIE ') !== -1;\n const isTrident = userAgent.indexOf('Trident/') !== -1;\n return isMSIE || isTrident;\n}\n//# sourceMappingURL=is-old-ie.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/utils/is-old-ie.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/utils/shader-utils.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/utils/shader-utils.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ convertToVec4: () => (/* binding */ convertToVec4),\n/* harmony export */ getPassthroughFS: () => (/* binding */ getPassthroughFS),\n/* harmony export */ getQualifierDetails: () => (/* binding */ getQualifierDetails),\n/* harmony export */ typeToChannelCount: () => (/* binding */ typeToChannelCount),\n/* harmony export */ typeToChannelSuffix: () => (/* binding */ typeToChannelSuffix)\n/* harmony export */ });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ \"./node_modules/@luma.gl/shadertools/dist/esm/utils/assert.js\");\n\nconst FS100 = \"void main() {gl_FragColor = vec4(0);}\";\nconst FS_GLES = \"out vec4 transform_output;\\nvoid main() {\\n transform_output = vec4(0);\\n}\";\nconst FS300 = \"#version 300 es\\n\".concat(FS_GLES);\nfunction getQualifierDetails(line, qualifiers) {\n qualifiers = Array.isArray(qualifiers) ? qualifiers : [qualifiers];\n const words = line.replace(/^\\s+/, '').split(/\\s+/);\n const [qualifier, type, definition] = words;\n\n if (!qualifiers.includes(qualifier) || !type || !definition) {\n return null;\n }\n\n const name = definition.split(';')[0];\n return {\n qualifier,\n type,\n name\n };\n}\nfunction getPassthroughFS() {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n version = 100,\n input,\n inputType,\n output\n } = options;\n\n if (!input) {\n if (version === 300) {\n return FS300;\n } else if (version > 300) {\n return \"#version \".concat(version, \"\\n\").concat(FS_GLES);\n }\n\n return FS100;\n }\n\n const outputValue = convertToVec4(input, inputType);\n\n if (version >= 300) {\n return \"#version \".concat(version, \" \").concat(version === 300 ? 'es' : '', \"\\nin \").concat(inputType, \" \").concat(input, \";\\nout vec4 \").concat(output, \";\\nvoid main() {\\n \").concat(output, \" = \").concat(outputValue, \";\\n}\");\n }\n\n return \"varying \".concat(inputType, \" \").concat(input, \";\\nvoid main() {\\n gl_FragColor = \").concat(outputValue, \";\\n}\");\n}\nfunction typeToChannelSuffix(type) {\n switch (type) {\n case 'float':\n return 'x';\n\n case 'vec2':\n return 'xy';\n\n case 'vec3':\n return 'xyz';\n\n case 'vec4':\n return 'xyzw';\n\n default:\n (0,_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(false);\n return null;\n }\n}\nfunction typeToChannelCount(type) {\n switch (type) {\n case 'float':\n return 1;\n\n case 'vec2':\n return 2;\n\n case 'vec3':\n return 3;\n\n case 'vec4':\n return 4;\n\n default:\n (0,_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(false);\n return null;\n }\n}\nfunction convertToVec4(variable, type) {\n switch (type) {\n case 'float':\n return \"vec4(\".concat(variable, \", 0.0, 0.0, 1.0)\");\n\n case 'vec2':\n return \"vec4(\".concat(variable, \", 0.0, 1.0)\");\n\n case 'vec3':\n return \"vec4(\".concat(variable, \", 1.0)\");\n\n case 'vec4':\n return variable;\n\n default:\n (0,_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(false);\n return null;\n }\n}\n//# sourceMappingURL=shader-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/utils/shader-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/shadertools/dist/esm/utils/webgl-info.js": +/*!************************************************************************!*\ + !*** ./node_modules/@luma.gl/shadertools/dist/esm/utils/webgl-info.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FEATURES: () => (/* binding */ FEATURES),\n/* harmony export */ canCompileGLGSExtension: () => (/* binding */ canCompileGLGSExtension),\n/* harmony export */ getContextInfo: () => (/* binding */ getContextInfo),\n/* harmony export */ hasFeatures: () => (/* binding */ hasFeatures)\n/* harmony export */ });\n/* harmony import */ var _is_old_ie__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-old-ie */ \"./node_modules/@luma.gl/shadertools/dist/esm/utils/is-old-ie.js\");\n/* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assert */ \"./node_modules/@luma.gl/shadertools/dist/esm/utils/assert.js\");\n\n\nconst GL_VENDOR = 0x1f00;\nconst GL_RENDERER = 0x1f01;\nconst GL_VERSION = 0x1f02;\nconst GL_SHADING_LANGUAGE_VERSION = 0x8b8c;\nconst WEBGL_FEATURES = {\n GLSL_FRAG_DATA: ['WEBGL_draw_buffers', true],\n GLSL_FRAG_DEPTH: ['EXT_frag_depth', true],\n GLSL_DERIVATIVES: ['OES_standard_derivatives', true],\n GLSL_TEXTURE_LOD: ['EXT_shader_texture_lod', true]\n};\nconst FEATURES = {};\nObject.keys(WEBGL_FEATURES).forEach(key => {\n FEATURES[key] = key;\n});\n\n\nfunction isWebGL2(gl) {\n if (typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext) {\n return true;\n }\n\n return Boolean(gl && gl._version === 2);\n}\n\nfunction getContextInfo(gl) {\n const info = gl.getExtension('WEBGL_debug_renderer_info');\n const vendor = gl.getParameter(info && info.UNMASKED_VENDOR_WEBGL || GL_VENDOR);\n const renderer = gl.getParameter(info && info.UNMASKED_RENDERER_WEBGL || GL_RENDERER);\n const gpuVendor = identifyGPUVendor(vendor, renderer);\n const gpuInfo = {\n gpuVendor,\n vendor,\n renderer,\n version: gl.getParameter(GL_VERSION),\n shadingLanguageVersion: gl.getParameter(GL_SHADING_LANGUAGE_VERSION)\n };\n return gpuInfo;\n}\n\nfunction identifyGPUVendor(vendor, renderer) {\n if (vendor.match(/NVIDIA/i) || renderer.match(/NVIDIA/i)) {\n return 'NVIDIA';\n }\n\n if (vendor.match(/INTEL/i) || renderer.match(/INTEL/i)) {\n return 'INTEL';\n }\n\n if (vendor.match(/AMD/i) || renderer.match(/AMD/i) || vendor.match(/ATI/i) || renderer.match(/ATI/i)) {\n return 'AMD';\n }\n\n return 'UNKNOWN GPU';\n}\n\nconst compiledGlslExtensions = {};\nfunction canCompileGLGSExtension(gl, cap) {\n let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n const feature = WEBGL_FEATURES[cap];\n (0,_assert__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(feature, cap);\n\n if (!(0,_is_old_ie__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(opts)) {\n return true;\n }\n\n if (cap in compiledGlslExtensions) {\n return compiledGlslExtensions[cap];\n }\n\n const extensionName = feature[0];\n const behavior = opts.behavior || 'enable';\n const source = \"#extension GL_\".concat(extensionName, \" : \").concat(behavior, \"\\nvoid main(void) {}\");\n const shader = gl.createShader(35633);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n const canCompile = gl.getShaderParameter(shader, 35713);\n gl.deleteShader(shader);\n compiledGlslExtensions[cap] = canCompile;\n return canCompile;\n}\n\nfunction getFeature(gl, cap) {\n const feature = WEBGL_FEATURES[cap];\n (0,_assert__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(feature, cap);\n const extensionName = isWebGL2(gl) ? feature[1] || feature[0] : feature[0];\n const value = typeof extensionName === 'string' ? Boolean(gl.getExtension(extensionName)) : extensionName;\n (0,_assert__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value === false || value === true);\n return value;\n}\n\nfunction hasFeatures(gl, features) {\n features = Array.isArray(features) ? features : [features];\n return features.every(feature => getFeature(gl, feature));\n}\n//# sourceMappingURL=webgl-info.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/shadertools/dist/esm/utils/webgl-info.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/accessor.js": +/*!******************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/accessor.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DEFAULT_ACCESSOR_VALUES: () => (/* binding */ DEFAULT_ACCESSOR_VALUES),\n/* harmony export */ \"default\": () => (/* binding */ Accessor)\n/* harmony export */ });\n/* harmony import */ var _webgl_utils_typed_array_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../webgl-utils/typed-array-utils */ \"./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/typed-array-utils.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n/* harmony import */ var _utils_check_props__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/check-props */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/check-props.js\");\n\n\n\nconst DEFAULT_ACCESSOR_VALUES = {\n offset: 0,\n stride: 0,\n type: 5126,\n size: 1,\n divisor: 0,\n normalized: false,\n integer: false\n};\nconst PROP_CHECKS = {\n deprecatedProps: {\n instanced: 'divisor',\n isInstanced: 'divisor'\n }\n};\nclass Accessor {\n static getBytesPerElement(accessor) {\n const ArrayType = (0,_webgl_utils_typed_array_utils__WEBPACK_IMPORTED_MODULE_0__.getTypedArrayFromGLType)(accessor.type || 5126);\n return ArrayType.BYTES_PER_ELEMENT;\n }\n\n static getBytesPerVertex(accessor) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_1__.assert)(accessor.size);\n const ArrayType = (0,_webgl_utils_typed_array_utils__WEBPACK_IMPORTED_MODULE_0__.getTypedArrayFromGLType)(accessor.type || 5126);\n return ArrayType.BYTES_PER_ELEMENT * accessor.size;\n }\n\n static resolve() {\n for (var _len = arguments.length, accessors = new Array(_len), _key = 0; _key < _len; _key++) {\n accessors[_key] = arguments[_key];\n }\n\n return new Accessor(...[DEFAULT_ACCESSOR_VALUES, ...accessors]);\n }\n\n constructor() {\n for (var _len2 = arguments.length, accessors = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n accessors[_key2] = arguments[_key2];\n }\n\n accessors.forEach(accessor => this._assign(accessor));\n Object.freeze(this);\n }\n\n toString() {\n return JSON.stringify(this);\n }\n\n get BYTES_PER_ELEMENT() {\n return Accessor.getBytesPerElement(this);\n }\n\n get BYTES_PER_VERTEX() {\n return Accessor.getBytesPerVertex(this);\n }\n\n _assign() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n props = (0,_utils_check_props__WEBPACK_IMPORTED_MODULE_2__.checkProps)('Accessor', props, PROP_CHECKS);\n\n if (props.type !== undefined) {\n this.type = props.type;\n\n if (props.type === 5124 || props.type === 5125) {\n this.integer = true;\n }\n }\n\n if (props.size !== undefined) {\n this.size = props.size;\n }\n\n if (props.offset !== undefined) {\n this.offset = props.offset;\n }\n\n if (props.stride !== undefined) {\n this.stride = props.stride;\n }\n\n if (props.normalized !== undefined) {\n this.normalized = props.normalized;\n }\n\n if (props.integer !== undefined) {\n this.integer = props.integer;\n }\n\n if (props.divisor !== undefined) {\n this.divisor = props.divisor;\n }\n\n if (props.buffer !== undefined) {\n this.buffer = props.buffer;\n }\n\n if (props.index !== undefined) {\n if (typeof props.index === 'boolean') {\n this.index = props.index ? 1 : 0;\n } else {\n this.index = props.index;\n }\n }\n\n if (props.instanced !== undefined) {\n this.divisor = props.instanced ? 1 : 0;\n }\n\n if (props.isInstanced !== undefined) {\n this.divisor = props.isInstanced ? 1 : 0;\n }\n\n return this;\n }\n\n}\n\n//# sourceMappingURL=accessor.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/accessor.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/buffer.js": +/*!****************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/buffer.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Buffer)\n/* harmony export */ });\n/* harmony import */ var _resource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resource */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/resource.js\");\n/* harmony import */ var _accessor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./accessor */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/accessor.js\");\n/* harmony import */ var _webgl_utils_typed_array_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../webgl-utils/typed-array-utils */ \"./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/typed-array-utils.js\");\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n/* harmony import */ var _utils_check_props__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/check-props */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/check-props.js\");\n\n\n\n\n\n\nconst DEBUG_DATA_LENGTH = 10;\nconst DEPRECATED_PROPS = {\n offset: 'accessor.offset',\n stride: 'accessor.stride',\n type: 'accessor.type',\n size: 'accessor.size',\n divisor: 'accessor.divisor',\n normalized: 'accessor.normalized',\n integer: 'accessor.integer',\n instanced: 'accessor.divisor',\n isInstanced: 'accessor.divisor'\n};\nconst PROP_CHECKS_INITIALIZE = {\n removedProps: {},\n replacedProps: {\n bytes: 'byteLength'\n },\n deprecatedProps: DEPRECATED_PROPS\n};\nconst PROP_CHECKS_SET_PROPS = {\n removedProps: DEPRECATED_PROPS\n};\nclass Buffer extends _resource__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n get [Symbol.toStringTag]() {\n return 'Buffer';\n }\n\n constructor(gl) {\n let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n super(gl, props);\n this.stubRemovedMethods('Buffer', 'v6.0', ['layout', 'setLayout', 'getIndexedParameter']);\n this.target = props.target || (this.gl.webgl2 ? 36662 : 34962);\n this.initialize(props);\n Object.seal(this);\n }\n\n getElementCount() {\n let accessor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.accessor;\n return Math.round(this.byteLength / _accessor__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getBytesPerElement(accessor));\n }\n\n getVertexCount() {\n let accessor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.accessor;\n return Math.round(this.byteLength / _accessor__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getBytesPerVertex(accessor));\n }\n\n initialize() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (ArrayBuffer.isView(props)) {\n props = {\n data: props\n };\n }\n\n if (Number.isFinite(props)) {\n props = {\n byteLength: props\n };\n }\n\n props = (0,_utils_check_props__WEBPACK_IMPORTED_MODULE_3__.checkProps)('Buffer', props, PROP_CHECKS_INITIALIZE);\n this.usage = props.usage || 35044;\n this.debugData = null;\n this.setAccessor(Object.assign({}, props, props.accessor));\n\n if (props.data) {\n this._setData(props.data, props.offset, props.byteLength);\n } else {\n this._setByteLength(props.byteLength || 0);\n }\n\n return this;\n }\n\n setProps(props) {\n props = (0,_utils_check_props__WEBPACK_IMPORTED_MODULE_3__.checkProps)('Buffer', props, PROP_CHECKS_SET_PROPS);\n\n if ('accessor' in props) {\n this.setAccessor(props.accessor);\n }\n\n return this;\n }\n\n setAccessor(accessor) {\n accessor = Object.assign({}, accessor);\n delete accessor.buffer;\n this.accessor = new _accessor__WEBPACK_IMPORTED_MODULE_2__[\"default\"](accessor);\n return this;\n }\n\n reallocate(byteLength) {\n if (byteLength > this.byteLength) {\n this._setByteLength(byteLength);\n\n return true;\n }\n\n this.bytesUsed = byteLength;\n return false;\n }\n\n setData(props) {\n return this.initialize(props);\n }\n\n subData(props) {\n if (ArrayBuffer.isView(props)) {\n props = {\n data: props\n };\n }\n\n const {\n data,\n offset = 0,\n srcOffset = 0\n } = props;\n const byteLength = props.byteLength || props.length;\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_4__.assert)(data);\n const target = this.gl.webgl2 ? 36663 : this.target;\n this.gl.bindBuffer(target, this.handle);\n\n if (srcOffset !== 0 || byteLength !== undefined) {\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(this.gl);\n this.gl.bufferSubData(this.target, offset, data, srcOffset, byteLength);\n } else {\n this.gl.bufferSubData(target, offset, data);\n }\n\n this.gl.bindBuffer(target, null);\n this.debugData = null;\n\n this._inferType(data);\n\n return this;\n }\n\n copyData(_ref) {\n let {\n sourceBuffer,\n readOffset = 0,\n writeOffset = 0,\n size\n } = _ref;\n const {\n gl\n } = this;\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(gl);\n gl.bindBuffer(36662, sourceBuffer.handle);\n gl.bindBuffer(36663, this.handle);\n gl.copyBufferSubData(36662, 36663, readOffset, writeOffset, size);\n gl.bindBuffer(36662, null);\n gl.bindBuffer(36663, null);\n this.debugData = null;\n return this;\n }\n\n getData() {\n let {\n dstData = null,\n srcByteOffset = 0,\n dstOffset = 0,\n length = 0\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(this.gl);\n const ArrayType = (0,_webgl_utils_typed_array_utils__WEBPACK_IMPORTED_MODULE_5__.getTypedArrayFromGLType)(this.accessor.type || 5126, {\n clamped: false\n });\n\n const sourceAvailableElementCount = this._getAvailableElementCount(srcByteOffset);\n\n const dstElementOffset = dstOffset;\n let dstAvailableElementCount;\n let dstElementCount;\n\n if (dstData) {\n dstElementCount = dstData.length;\n dstAvailableElementCount = dstElementCount - dstElementOffset;\n } else {\n dstAvailableElementCount = Math.min(sourceAvailableElementCount, length || sourceAvailableElementCount);\n dstElementCount = dstElementOffset + dstAvailableElementCount;\n }\n\n const copyElementCount = Math.min(sourceAvailableElementCount, dstAvailableElementCount);\n length = length || copyElementCount;\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_4__.assert)(length <= copyElementCount);\n dstData = dstData || new ArrayType(dstElementCount);\n this.gl.bindBuffer(36662, this.handle);\n this.gl.getBufferSubData(36662, srcByteOffset, dstData, dstOffset, length);\n this.gl.bindBuffer(36662, null);\n return dstData;\n }\n\n bind() {\n let {\n target = this.target,\n index = this.accessor && this.accessor.index,\n offset = 0,\n size\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (target === 35345 || target === 35982) {\n if (size !== undefined) {\n this.gl.bindBufferRange(target, index, this.handle, offset, size);\n } else {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_4__.assert)(offset === 0);\n this.gl.bindBufferBase(target, index, this.handle);\n }\n } else {\n this.gl.bindBuffer(target, this.handle);\n }\n\n return this;\n }\n\n unbind() {\n let {\n target = this.target,\n index = this.accessor && this.accessor.index\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const isIndexedBuffer = target === 35345 || target === 35982;\n\n if (isIndexedBuffer) {\n this.gl.bindBufferBase(target, index, null);\n } else {\n this.gl.bindBuffer(target, null);\n }\n\n return this;\n }\n\n getDebugData() {\n if (!this.debugData) {\n this.debugData = this.getData({\n length: Math.min(DEBUG_DATA_LENGTH, this.byteLength)\n });\n return {\n data: this.debugData,\n changed: true\n };\n }\n\n return {\n data: this.debugData,\n changed: false\n };\n }\n\n invalidateDebugData() {\n this.debugData = null;\n }\n\n _setData(data) {\n let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n let byteLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : data.byteLength + offset;\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_4__.assert)(ArrayBuffer.isView(data));\n\n this._trackDeallocatedMemory();\n\n const target = this._getTarget();\n\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, byteLength, this.usage);\n this.gl.bufferSubData(target, offset, data);\n this.gl.bindBuffer(target, null);\n this.debugData = data.slice(0, DEBUG_DATA_LENGTH);\n this.bytesUsed = byteLength;\n\n this._trackAllocatedMemory(byteLength);\n\n const type = (0,_webgl_utils_typed_array_utils__WEBPACK_IMPORTED_MODULE_5__.getGLTypeFromTypedArray)(data);\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_4__.assert)(type);\n this.setAccessor(new _accessor__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.accessor, {\n type\n }));\n return this;\n }\n\n _setByteLength(byteLength) {\n let usage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.usage;\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_4__.assert)(byteLength >= 0);\n\n this._trackDeallocatedMemory();\n\n let data = byteLength;\n\n if (byteLength === 0) {\n data = new Float32Array(0);\n }\n\n const target = this._getTarget();\n\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, data, usage);\n this.gl.bindBuffer(target, null);\n this.usage = usage;\n this.debugData = null;\n this.bytesUsed = byteLength;\n\n this._trackAllocatedMemory(byteLength);\n\n return this;\n }\n\n _getTarget() {\n return this.gl.webgl2 ? 36663 : this.target;\n }\n\n _getAvailableElementCount(srcByteOffset) {\n const ArrayType = (0,_webgl_utils_typed_array_utils__WEBPACK_IMPORTED_MODULE_5__.getTypedArrayFromGLType)(this.accessor.type || 5126, {\n clamped: false\n });\n const sourceElementOffset = srcByteOffset / ArrayType.BYTES_PER_ELEMENT;\n return this.getElementCount() - sourceElementOffset;\n }\n\n _inferType(data) {\n if (!this.accessor.type) {\n this.setAccessor(new _accessor__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.accessor, {\n type: (0,_webgl_utils_typed_array_utils__WEBPACK_IMPORTED_MODULE_5__.getGLTypeFromTypedArray)(data)\n }));\n }\n }\n\n _createHandle() {\n return this.gl.createBuffer();\n }\n\n _deleteHandle() {\n this.gl.deleteBuffer(this.handle);\n\n this._trackDeallocatedMemory();\n }\n\n _getParameter(pname) {\n this.gl.bindBuffer(this.target, this.handle);\n const value = this.gl.getBufferParameter(this.target, pname);\n this.gl.bindBuffer(this.target, null);\n return value;\n }\n\n get type() {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.deprecated('Buffer.type', 'Buffer.accessor.type')();\n return this.accessor.type;\n }\n\n get bytes() {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.deprecated('Buffer.bytes', 'Buffer.byteLength')();\n return this.byteLength;\n }\n\n setByteLength(byteLength) {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.deprecated('setByteLength', 'reallocate')();\n return this.reallocate(byteLength);\n }\n\n updateAccessor(opts) {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.deprecated('updateAccessor(...)', 'setAccessor(new Accessor(buffer.accessor, ...)')();\n this.accessor = new _accessor__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.accessor, opts);\n return this;\n }\n\n}\n//# sourceMappingURL=buffer.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/buffer.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/clear.js": +/*!***************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/clear.js ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ clear: () => (/* binding */ clear),\n/* harmony export */ clearBuffer: () => (/* binding */ clearBuffer)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n\n\nconst GL_DEPTH_BUFFER_BIT = 0x00000100;\nconst GL_STENCIL_BUFFER_BIT = 0x00000400;\nconst GL_COLOR_BUFFER_BIT = 0x00004000;\nconst GL_COLOR = 0x1800;\nconst GL_DEPTH = 0x1801;\nconst GL_STENCIL = 0x1802;\nconst GL_DEPTH_STENCIL = 0x84f9;\nconst ERR_ARGUMENTS = 'clear: bad arguments';\nfunction clear(gl) {\n let {\n framebuffer = null,\n color = null,\n depth = null,\n stencil = null\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const parameters = {};\n\n if (framebuffer) {\n parameters.framebuffer = framebuffer;\n }\n\n let clearFlags = 0;\n\n if (color) {\n clearFlags |= GL_COLOR_BUFFER_BIT;\n\n if (color !== true) {\n parameters.clearColor = color;\n }\n }\n\n if (depth) {\n clearFlags |= GL_DEPTH_BUFFER_BIT;\n\n if (depth !== true) {\n parameters.clearDepth = depth;\n }\n }\n\n if (stencil) {\n clearFlags |= GL_STENCIL_BUFFER_BIT;\n\n if (depth !== true) {\n parameters.clearStencil = depth;\n }\n }\n\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_1__.assert)(clearFlags !== 0, ERR_ARGUMENTS);\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.withParameters)(gl, parameters, () => {\n gl.clear(clearFlags);\n });\n}\nfunction clearBuffer(gl) {\n let {\n framebuffer = null,\n buffer = GL_COLOR,\n drawBuffer = 0,\n value = [0, 0, 0, 0]\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(gl);\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.withParameters)(gl, {\n framebuffer\n }, () => {\n switch (buffer) {\n case GL_COLOR:\n switch (value.constructor) {\n case Int32Array:\n gl.clearBufferiv(buffer, drawBuffer, value);\n break;\n\n case Uint32Array:\n gl.clearBufferuiv(buffer, drawBuffer, value);\n break;\n\n case Float32Array:\n default:\n gl.clearBufferfv(buffer, drawBuffer, value);\n }\n\n break;\n\n case GL_DEPTH:\n gl.clearBufferfv(GL_DEPTH, 0, [value]);\n break;\n\n case GL_STENCIL:\n gl.clearBufferiv(GL_STENCIL, 0, [value]);\n break;\n\n case GL_DEPTH_STENCIL:\n const [depth, stencil] = value;\n gl.clearBufferfi(GL_DEPTH_STENCIL, 0, depth, stencil);\n break;\n\n default:\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_1__.assert)(false, ERR_ARGUMENTS);\n }\n });\n}\n//# sourceMappingURL=clear.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/clear.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/copy-and-blit.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/copy-and-blit.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ blit: () => (/* binding */ blit),\n/* harmony export */ copyToDataUrl: () => (/* binding */ copyToDataUrl),\n/* harmony export */ copyToImage: () => (/* binding */ copyToImage),\n/* harmony export */ copyToTexture: () => (/* binding */ copyToTexture),\n/* harmony export */ readPixelsToArray: () => (/* binding */ readPixelsToArray),\n/* harmony export */ readPixelsToBuffer: () => (/* binding */ readPixelsToBuffer)\n/* harmony export */ });\n/* harmony import */ var _buffer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./buffer */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/buffer.js\");\n/* harmony import */ var _framebuffer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./framebuffer */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/framebuffer.js\");\n/* harmony import */ var _texture__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./texture */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture.js\");\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _webgl_utils_typed_array_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../webgl-utils/typed-array-utils */ \"./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/typed-array-utils.js\");\n/* harmony import */ var _webgl_utils_format_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../webgl-utils/format-utils */ \"./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/format-utils.js\");\n/* harmony import */ var _webgl_utils_texture_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../webgl-utils/texture-utils */ \"./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/texture-utils.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n\n\n\n\n\n\n\n\n\nfunction readPixelsToArray(source) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const {\n sourceX = 0,\n sourceY = 0,\n sourceFormat = 6408\n } = options;\n let {\n sourceAttachment = 36064,\n target = null,\n sourceWidth,\n sourceHeight,\n sourceType\n } = options;\n const {\n framebuffer,\n deleteFramebuffer\n } = getFramebuffer(source);\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_1__.assert)(framebuffer);\n const {\n gl,\n handle,\n attachments\n } = framebuffer;\n sourceWidth = sourceWidth || framebuffer.width;\n sourceHeight = sourceHeight || framebuffer.height;\n\n if (sourceAttachment === 36064 && handle === null) {\n sourceAttachment = 1028;\n }\n\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_1__.assert)(attachments[sourceAttachment]);\n sourceType = sourceType || attachments[sourceAttachment].type;\n target = getPixelArray(target, sourceType, sourceFormat, sourceWidth, sourceHeight);\n sourceType = sourceType || (0,_webgl_utils_typed_array_utils__WEBPACK_IMPORTED_MODULE_2__.getGLTypeFromTypedArray)(target);\n const prevHandle = gl.bindFramebuffer(36160, handle);\n gl.readPixels(sourceX, sourceY, sourceWidth, sourceHeight, sourceFormat, sourceType, target);\n gl.bindFramebuffer(36160, prevHandle || null);\n\n if (deleteFramebuffer) {\n framebuffer.delete();\n }\n\n return target;\n}\nfunction readPixelsToBuffer(source, _ref) {\n let {\n sourceX = 0,\n sourceY = 0,\n sourceFormat = 6408,\n target = null,\n targetByteOffset = 0,\n sourceWidth,\n sourceHeight,\n sourceType\n } = _ref;\n const {\n framebuffer,\n deleteFramebuffer\n } = getFramebuffer(source);\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_1__.assert)(framebuffer);\n sourceWidth = sourceWidth || framebuffer.width;\n sourceHeight = sourceHeight || framebuffer.height;\n const gl2 = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(framebuffer.gl);\n sourceType = sourceType || (target ? target.type : 5121);\n\n if (!target) {\n const components = (0,_webgl_utils_format_utils__WEBPACK_IMPORTED_MODULE_3__.glFormatToComponents)(sourceFormat);\n const byteCount = (0,_webgl_utils_format_utils__WEBPACK_IMPORTED_MODULE_3__.glTypeToBytes)(sourceType);\n const byteLength = targetByteOffset + sourceWidth * sourceHeight * components * byteCount;\n target = new _buffer__WEBPACK_IMPORTED_MODULE_4__[\"default\"](gl2, {\n byteLength,\n accessor: {\n type: sourceType,\n size: components\n }\n });\n }\n\n target.bind({\n target: 35051\n });\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.withParameters)(gl2, {\n framebuffer\n }, () => {\n gl2.readPixels(sourceX, sourceY, sourceWidth, sourceHeight, sourceFormat, sourceType, targetByteOffset);\n });\n target.unbind({\n target: 35051\n });\n\n if (deleteFramebuffer) {\n framebuffer.delete();\n }\n\n return target;\n}\nfunction copyToDataUrl(source) {\n let {\n sourceAttachment = 36064,\n targetMaxHeight = Number.MAX_SAFE_INTEGER\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let data = readPixelsToArray(source, {\n sourceAttachment\n });\n let {\n width,\n height\n } = source;\n\n while (height > targetMaxHeight) {\n ({\n data,\n width,\n height\n } = (0,_webgl_utils_typed_array_utils__WEBPACK_IMPORTED_MODULE_2__.scalePixels)({\n data,\n width,\n height\n }));\n }\n\n (0,_webgl_utils_typed_array_utils__WEBPACK_IMPORTED_MODULE_2__.flipRows)({\n data,\n width,\n height\n });\n const canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n const context = canvas.getContext('2d');\n const imageData = context.createImageData(width, height);\n imageData.data.set(data);\n context.putImageData(imageData, 0, 0);\n return canvas.toDataURL();\n}\nfunction copyToImage(source) {\n let {\n sourceAttachment = 36064,\n targetImage = null\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const dataUrl = copyToDataUrl(source, {\n sourceAttachment\n });\n targetImage = targetImage || new Image();\n targetImage.src = dataUrl;\n return targetImage;\n}\nfunction copyToTexture(source, target) {\n let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n const {\n sourceX = 0,\n sourceY = 0,\n targetMipmaplevel = 0,\n targetInternalFormat = 6408\n } = options;\n let {\n targetX,\n targetY,\n targetZ,\n width,\n height\n } = options;\n const {\n framebuffer,\n deleteFramebuffer\n } = getFramebuffer(source);\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_1__.assert)(framebuffer);\n const {\n gl,\n handle\n } = framebuffer;\n const isSubCopy = typeof targetX !== 'undefined' || typeof targetY !== 'undefined' || typeof targetZ !== 'undefined';\n targetX = targetX || 0;\n targetY = targetY || 0;\n targetZ = targetZ || 0;\n const prevHandle = gl.bindFramebuffer(36160, handle);\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_1__.assert)(target);\n let texture = null;\n\n if (target instanceof _texture__WEBPACK_IMPORTED_MODULE_5__[\"default\"]) {\n texture = target;\n width = Number.isFinite(width) ? width : texture.width;\n height = Number.isFinite(height) ? height : texture.height;\n texture.bind(0);\n target = texture.target;\n }\n\n if (!isSubCopy) {\n gl.copyTexImage2D(target, targetMipmaplevel, targetInternalFormat, sourceX, sourceY, width, height, 0);\n } else {\n switch (target) {\n case 3553:\n case 34067:\n gl.copyTexSubImage2D(target, targetMipmaplevel, targetX, targetY, sourceX, sourceY, width, height);\n break;\n\n case 35866:\n case 32879:\n const gl2 = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(gl);\n gl2.copyTexSubImage3D(target, targetMipmaplevel, targetX, targetY, targetZ, sourceX, sourceY, width, height);\n break;\n\n default:\n }\n }\n\n if (texture) {\n texture.unbind();\n }\n\n gl.bindFramebuffer(36160, prevHandle || null);\n\n if (deleteFramebuffer) {\n framebuffer.delete();\n }\n\n return texture;\n}\nfunction blit(source, target) {\n let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n const {\n sourceX0 = 0,\n sourceY0 = 0,\n targetX0 = 0,\n targetY0 = 0,\n color = true,\n depth = false,\n stencil = false,\n filter = 9728\n } = options;\n let {\n sourceX1,\n sourceY1,\n targetX1,\n targetY1,\n sourceAttachment = 36064,\n mask = 0\n } = options;\n const {\n framebuffer: srcFramebuffer,\n deleteFramebuffer: deleteSrcFramebuffer\n } = getFramebuffer(source);\n const {\n framebuffer: dstFramebuffer,\n deleteFramebuffer: deleteDstFramebuffer\n } = getFramebuffer(target);\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_1__.assert)(srcFramebuffer);\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_1__.assert)(dstFramebuffer);\n const {\n gl,\n handle,\n width,\n height,\n readBuffer\n } = dstFramebuffer;\n const gl2 = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(gl);\n\n if (!srcFramebuffer.handle && sourceAttachment === 36064) {\n sourceAttachment = 1028;\n }\n\n if (color) {\n mask |= 16384;\n }\n\n if (depth) {\n mask |= 256;\n }\n\n if (stencil) {\n mask |= 1024;\n }\n\n if (deleteSrcFramebuffer || deleteDstFramebuffer) {\n if (mask & (256 | 1024)) {\n mask = 16384;\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.warn('Blitting from or into a Texture object, forcing mask to GL.COLOR_BUFFER_BIT')();\n }\n }\n\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_1__.assert)(mask);\n sourceX1 = sourceX1 === undefined ? srcFramebuffer.width : sourceX1;\n sourceY1 = sourceY1 === undefined ? srcFramebuffer.height : sourceY1;\n targetX1 = targetX1 === undefined ? width : targetX1;\n targetY1 = targetY1 === undefined ? height : targetY1;\n const prevDrawHandle = gl.bindFramebuffer(36009, handle);\n const prevReadHandle = gl.bindFramebuffer(36008, srcFramebuffer.handle);\n gl2.readBuffer(sourceAttachment);\n gl2.blitFramebuffer(sourceX0, sourceY0, sourceX1, sourceY1, targetX0, targetY0, targetX1, targetY1, mask, filter);\n gl2.readBuffer(readBuffer);\n gl2.bindFramebuffer(36008, prevReadHandle || null);\n gl2.bindFramebuffer(36009, prevDrawHandle || null);\n\n if (deleteSrcFramebuffer) {\n srcFramebuffer.delete();\n }\n\n if (deleteDstFramebuffer) {\n dstFramebuffer.delete();\n }\n\n return dstFramebuffer;\n}\n\nfunction getFramebuffer(source) {\n if (!(source instanceof _framebuffer__WEBPACK_IMPORTED_MODULE_6__[\"default\"])) {\n return {\n framebuffer: (0,_webgl_utils_texture_utils__WEBPACK_IMPORTED_MODULE_7__.toFramebuffer)(source),\n deleteFramebuffer: true\n };\n }\n\n return {\n framebuffer: source,\n deleteFramebuffer: false\n };\n}\n\nfunction getPixelArray(pixelArray, type, format, width, height) {\n if (pixelArray) {\n return pixelArray;\n }\n\n type = type || 5121;\n const ArrayType = (0,_webgl_utils_typed_array_utils__WEBPACK_IMPORTED_MODULE_2__.getTypedArrayFromGLType)(type, {\n clamped: false\n });\n const components = (0,_webgl_utils_format_utils__WEBPACK_IMPORTED_MODULE_3__.glFormatToComponents)(format);\n return new ArrayType(width * height * components);\n}\n//# sourceMappingURL=copy-and-blit.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/copy-and-blit.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/framebuffer.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/framebuffer.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FRAMEBUFFER_ATTACHMENT_PARAMETERS: () => (/* binding */ FRAMEBUFFER_ATTACHMENT_PARAMETERS),\n/* harmony export */ \"default\": () => (/* binding */ Framebuffer)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _resource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resource */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/resource.js\");\n/* harmony import */ var _texture_2d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./texture-2d */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture-2d.js\");\n/* harmony import */ var _renderbuffer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./renderbuffer */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/renderbuffer.js\");\n/* harmony import */ var _clear__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./clear */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/clear.js\");\n/* harmony import */ var _copy_and_blit_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./copy-and-blit.js */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/copy-and-blit.js\");\n/* harmony import */ var _features__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../features */ \"./node_modules/@luma.gl/webgl/dist/esm/features/features.js\");\n/* harmony import */ var _webgl_utils_constants_to_keys__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../webgl-utils/constants-to-keys */ \"./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/constants-to-keys.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n\n\n\n\n\n\n\n\n\nconst ERR_MULTIPLE_RENDERTARGETS = 'Multiple render targets not supported';\nclass Framebuffer extends _resource__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n get [Symbol.toStringTag]() {\n return 'Framebuffer';\n }\n\n static isSupported(gl) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const {\n colorBufferFloat,\n colorBufferHalfFloat\n } = options;\n let supported = true;\n\n if (colorBufferFloat) {\n supported = Boolean(gl.getExtension('EXT_color_buffer_float') || gl.getExtension('WEBGL_color_buffer_float') || gl.getExtension('OES_texture_float'));\n }\n\n if (colorBufferHalfFloat) {\n supported = supported && Boolean(gl.getExtension('EXT_color_buffer_float') || gl.getExtension('EXT_color_buffer_half_float'));\n }\n\n return supported;\n }\n\n static getDefaultFramebuffer(gl) {\n gl.luma = gl.luma || {};\n gl.luma.defaultFramebuffer = gl.luma.defaultFramebuffer || new Framebuffer(gl, {\n id: 'default-framebuffer',\n handle: null,\n attachments: {}\n });\n return gl.luma.defaultFramebuffer;\n }\n\n get MAX_COLOR_ATTACHMENTS() {\n const gl2 = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(this.gl);\n return gl2.getParameter(gl2.MAX_COLOR_ATTACHMENTS);\n }\n\n get MAX_DRAW_BUFFERS() {\n const gl2 = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(this.gl);\n return gl2.getParameter(gl2.MAX_DRAW_BUFFERS);\n }\n\n constructor(gl) {\n let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n super(gl, opts);\n this.width = null;\n this.height = null;\n this.attachments = {};\n this.readBuffer = 36064;\n this.drawBuffers = [36064];\n this.ownResources = [];\n this.initialize(opts);\n Object.seal(this);\n }\n\n get color() {\n return this.attachments[36064] || null;\n }\n\n get texture() {\n return this.attachments[36064] || null;\n }\n\n get depth() {\n return this.attachments[36096] || this.attachments[33306] || null;\n }\n\n get stencil() {\n return this.attachments[36128] || this.attachments[33306] || null;\n }\n\n initialize(_ref) {\n let {\n width = 1,\n height = 1,\n attachments = null,\n color = true,\n depth = true,\n stencil = false,\n check = true,\n readBuffer = undefined,\n drawBuffers = undefined\n } = _ref;\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(width >= 0 && height >= 0, 'Width and height need to be integers');\n this.width = width;\n this.height = height;\n\n if (attachments) {\n for (const attachment in attachments) {\n const target = attachments[attachment];\n const object = Array.isArray(target) ? target[0] : target;\n object.resize({\n width,\n height\n });\n }\n } else {\n attachments = this._createDefaultAttachments(color, depth, stencil, width, height);\n }\n\n this.update({\n clearAttachments: true,\n attachments,\n readBuffer,\n drawBuffers\n });\n\n if (attachments && check) {\n this.checkStatus();\n }\n }\n\n delete() {\n for (const resource of this.ownResources) {\n resource.delete();\n }\n\n super.delete();\n return this;\n }\n\n update(_ref2) {\n let {\n attachments = {},\n readBuffer,\n drawBuffers,\n clearAttachments = false,\n resizeAttachments = true\n } = _ref2;\n this.attach(attachments, {\n clearAttachments,\n resizeAttachments\n });\n const {\n gl\n } = this;\n const prevHandle = gl.bindFramebuffer(36160, this.handle);\n\n if (readBuffer) {\n this._setReadBuffer(readBuffer);\n }\n\n if (drawBuffers) {\n this._setDrawBuffers(drawBuffers);\n }\n\n gl.bindFramebuffer(36160, prevHandle || null);\n return this;\n }\n\n resize() {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let {\n width,\n height\n } = options;\n\n if (this.handle === null) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(width === undefined && height === undefined);\n this.width = this.gl.drawingBufferWidth;\n this.height = this.gl.drawingBufferHeight;\n return this;\n }\n\n if (width === undefined) {\n width = this.gl.drawingBufferWidth;\n }\n\n if (height === undefined) {\n height = this.gl.drawingBufferHeight;\n }\n\n if (width !== this.width && height !== this.height) {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.log(2, \"Resizing framebuffer \".concat(this.id, \" to \").concat(width, \"x\").concat(height))();\n }\n\n for (const attachmentPoint in this.attachments) {\n this.attachments[attachmentPoint].resize({\n width,\n height\n });\n }\n\n this.width = width;\n this.height = height;\n return this;\n }\n\n attach(attachments) {\n let {\n clearAttachments = false,\n resizeAttachments = true\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const newAttachments = {};\n\n if (clearAttachments) {\n Object.keys(this.attachments).forEach(key => {\n newAttachments[key] = null;\n });\n }\n\n Object.assign(newAttachments, attachments);\n const prevHandle = this.gl.bindFramebuffer(36160, this.handle);\n\n for (const key in newAttachments) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(key !== undefined, 'Misspelled framebuffer binding point?');\n const attachment = Number(key);\n const descriptor = newAttachments[attachment];\n let object = descriptor;\n\n if (!object) {\n this._unattach(attachment);\n } else if (object instanceof _renderbuffer__WEBPACK_IMPORTED_MODULE_3__[\"default\"]) {\n this._attachRenderbuffer({\n attachment,\n renderbuffer: object\n });\n } else if (Array.isArray(descriptor)) {\n const [texture, layer = 0, level = 0] = descriptor;\n object = texture;\n\n this._attachTexture({\n attachment,\n texture,\n layer,\n level\n });\n } else {\n this._attachTexture({\n attachment,\n texture: object,\n layer: 0,\n level: 0\n });\n }\n\n if (resizeAttachments && object) {\n object.resize({\n width: this.width,\n height: this.height\n });\n }\n }\n\n this.gl.bindFramebuffer(36160, prevHandle || null);\n Object.assign(this.attachments, attachments);\n Object.keys(this.attachments).filter(key => !this.attachments[key]).forEach(key => {\n delete this.attachments[key];\n });\n }\n\n checkStatus() {\n const {\n gl\n } = this;\n const status = this.getStatus();\n\n if (status !== 36053) {\n throw new Error(_getFrameBufferStatus(status));\n }\n\n return this;\n }\n\n getStatus() {\n const {\n gl\n } = this;\n const prevHandle = gl.bindFramebuffer(36160, this.handle);\n const status = gl.checkFramebufferStatus(36160);\n gl.bindFramebuffer(36160, prevHandle || null);\n return status;\n }\n\n clear() {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n color,\n depth,\n stencil,\n drawBuffers = []\n } = options;\n const prevHandle = this.gl.bindFramebuffer(36160, this.handle);\n\n if (color || depth || stencil) {\n (0,_clear__WEBPACK_IMPORTED_MODULE_4__.clear)(this.gl, {\n color,\n depth,\n stencil\n });\n }\n\n drawBuffers.forEach((value, drawBuffer) => {\n (0,_clear__WEBPACK_IMPORTED_MODULE_4__.clearBuffer)(this.gl, {\n drawBuffer,\n value\n });\n });\n this.gl.bindFramebuffer(36160, prevHandle || null);\n return this;\n }\n\n readPixels() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.error('Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)')();\n return null;\n }\n\n readPixelsToBuffer() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.error('Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)')();\n return null;\n }\n\n copyToDataUrl() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.error('Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)')();\n return null;\n }\n\n copyToImage() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.error('Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)')();\n return null;\n }\n\n copyToTexture() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.error('Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})')();\n return null;\n }\n\n blit() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.error('Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)')();\n return null;\n }\n\n invalidate(_ref3) {\n let {\n attachments = [],\n x = 0,\n y = 0,\n width,\n height\n } = _ref3;\n const gl2 = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(this.gl);\n const prevHandle = gl2.bindFramebuffer(36008, this.handle);\n const invalidateAll = x === 0 && y === 0 && width === undefined && height === undefined;\n\n if (invalidateAll) {\n gl2.invalidateFramebuffer(36008, attachments);\n } else {\n gl2.invalidateFramebuffer(36008, attachments, x, y, width, height);\n }\n\n gl2.bindFramebuffer(36008, prevHandle);\n return this;\n }\n\n getAttachmentParameter(attachment, pname, keys) {\n let value = this._getAttachmentParameterFallback(pname);\n\n if (value === null) {\n this.gl.bindFramebuffer(36160, this.handle);\n value = this.gl.getFramebufferAttachmentParameter(36160, attachment, pname);\n this.gl.bindFramebuffer(36160, null);\n }\n\n if (keys && value > 1000) {\n value = (0,_webgl_utils_constants_to_keys__WEBPACK_IMPORTED_MODULE_5__.getKey)(this.gl, value);\n }\n\n return value;\n }\n\n getAttachmentParameters() {\n let attachment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 36064;\n let keys = arguments.length > 1 ? arguments[1] : undefined;\n let parameters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.constructor.ATTACHMENT_PARAMETERS || [];\n const values = {};\n\n for (const pname of parameters) {\n const key = keys ? (0,_webgl_utils_constants_to_keys__WEBPACK_IMPORTED_MODULE_5__.getKey)(this.gl, pname) : pname;\n values[key] = this.getAttachmentParameter(attachment, pname, keys);\n }\n\n return values;\n }\n\n getParameters() {\n let keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n const attachments = Object.keys(this.attachments);\n const parameters = {};\n\n for (const attachmentName of attachments) {\n const attachment = Number(attachmentName);\n const key = keys ? (0,_webgl_utils_constants_to_keys__WEBPACK_IMPORTED_MODULE_5__.getKey)(this.gl, attachment) : attachment;\n parameters[key] = this.getAttachmentParameters(attachment, keys);\n }\n\n return parameters;\n }\n\n show() {\n if (typeof window !== 'undefined') {\n window.open((0,_copy_and_blit_js__WEBPACK_IMPORTED_MODULE_6__.copyToDataUrl)(this), 'luma-debug-texture');\n }\n\n return this;\n }\n\n log() {\n let logLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n if (logLevel > _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.level || typeof window === 'undefined') {\n return this;\n }\n\n message = message || \"Framebuffer \".concat(this.id);\n const image = (0,_copy_and_blit_js__WEBPACK_IMPORTED_MODULE_6__.copyToDataUrl)(this, {\n targetMaxHeight: 100\n });\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.image({\n logLevel,\n message,\n image\n }, message)();\n return this;\n }\n\n bind() {\n let {\n target = 36160\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.gl.bindFramebuffer(target, this.handle);\n return this;\n }\n\n unbind() {\n let {\n target = 36160\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.gl.bindFramebuffer(target, null);\n return this;\n }\n\n _createDefaultAttachments(color, depth, stencil, width, height) {\n let defaultAttachments = null;\n\n if (color) {\n defaultAttachments = defaultAttachments || {};\n defaultAttachments[36064] = new _texture_2d__WEBPACK_IMPORTED_MODULE_7__[\"default\"](this.gl, {\n id: \"\".concat(this.id, \"-color0\"),\n pixels: null,\n format: 6408,\n type: 5121,\n width,\n height,\n mipmaps: false,\n parameters: {\n [10241]: 9729,\n [10240]: 9729,\n [10242]: 33071,\n [10243]: 33071\n }\n });\n this.ownResources.push(defaultAttachments[36064]);\n }\n\n if (depth && stencil) {\n defaultAttachments = defaultAttachments || {};\n defaultAttachments[33306] = new _renderbuffer__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.gl, {\n id: \"\".concat(this.id, \"-depth-stencil\"),\n format: 35056,\n width,\n height: 111\n });\n this.ownResources.push(defaultAttachments[33306]);\n } else if (depth) {\n defaultAttachments = defaultAttachments || {};\n defaultAttachments[36096] = new _renderbuffer__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.gl, {\n id: \"\".concat(this.id, \"-depth\"),\n format: 33189,\n width,\n height\n });\n this.ownResources.push(defaultAttachments[36096]);\n } else if (stencil) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(false);\n }\n\n return defaultAttachments;\n }\n\n _unattach(attachment) {\n const oldAttachment = this.attachments[attachment];\n\n if (!oldAttachment) {\n return;\n }\n\n if (oldAttachment instanceof _renderbuffer__WEBPACK_IMPORTED_MODULE_3__[\"default\"]) {\n this.gl.framebufferRenderbuffer(36160, attachment, 36161, null);\n } else {\n this.gl.framebufferTexture2D(36160, attachment, 3553, null, 0);\n }\n\n delete this.attachments[attachment];\n }\n\n _attachRenderbuffer(_ref4) {\n let {\n attachment = 36064,\n renderbuffer\n } = _ref4;\n const {\n gl\n } = this;\n gl.framebufferRenderbuffer(36160, attachment, 36161, renderbuffer.handle);\n this.attachments[attachment] = renderbuffer;\n }\n\n _attachTexture(_ref5) {\n let {\n attachment = 36064,\n texture,\n layer,\n level\n } = _ref5;\n const {\n gl\n } = this;\n gl.bindTexture(texture.target, texture.handle);\n\n switch (texture.target) {\n case 35866:\n case 32879:\n const gl2 = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(gl);\n gl2.framebufferTextureLayer(36160, attachment, texture.target, level, layer);\n break;\n\n case 34067:\n const face = mapIndexToCubeMapFace(layer);\n gl.framebufferTexture2D(36160, attachment, face, texture.handle, level);\n break;\n\n case 3553:\n gl.framebufferTexture2D(36160, attachment, 3553, texture.handle, level);\n break;\n\n default:\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(false, 'Illegal texture type');\n }\n\n gl.bindTexture(texture.target, null);\n this.attachments[attachment] = texture;\n }\n\n _setReadBuffer(readBuffer) {\n const gl2 = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.getWebGL2Context)(this.gl);\n\n if (gl2) {\n gl2.readBuffer(readBuffer);\n } else {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(readBuffer === 36064 || readBuffer === 1029, ERR_MULTIPLE_RENDERTARGETS);\n }\n\n this.readBuffer = readBuffer;\n }\n\n _setDrawBuffers(drawBuffers) {\n const {\n gl\n } = this;\n const gl2 = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(gl);\n\n if (gl2) {\n gl2.drawBuffers(drawBuffers);\n } else {\n const ext = gl.getExtension('WEBGL_draw_buffers');\n\n if (ext) {\n ext.drawBuffersWEBGL(drawBuffers);\n } else {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(drawBuffers.length === 1 && (drawBuffers[0] === 36064 || drawBuffers[0] === 1029), ERR_MULTIPLE_RENDERTARGETS);\n }\n }\n\n this.drawBuffers = drawBuffers;\n }\n\n _getAttachmentParameterFallback(pname) {\n const caps = (0,_features__WEBPACK_IMPORTED_MODULE_8__.getFeatures)(this.gl);\n\n switch (pname) {\n case 36052:\n return !caps.WEBGL2 ? 0 : null;\n\n case 33298:\n case 33299:\n case 33300:\n case 33301:\n case 33302:\n case 33303:\n return !caps.WEBGL2 ? 8 : null;\n\n case 33297:\n return !caps.WEBGL2 ? 5125 : null;\n\n case 33296:\n return !caps.WEBGL2 && !caps.EXT_sRGB ? 9729 : null;\n\n default:\n return null;\n }\n }\n\n _createHandle() {\n return this.gl.createFramebuffer();\n }\n\n _deleteHandle() {\n this.gl.deleteFramebuffer(this.handle);\n }\n\n _bindHandle(handle) {\n return this.gl.bindFramebuffer(36160, handle);\n }\n\n}\n\nfunction mapIndexToCubeMapFace(layer) {\n return layer < 34069 ? layer + 34069 : layer;\n}\n\nfunction _getFrameBufferStatus(status) {\n const STATUS = Framebuffer.STATUS || {};\n return STATUS[status] || \"Framebuffer error \".concat(status);\n}\n\nconst FRAMEBUFFER_ATTACHMENT_PARAMETERS = [36049, 36048, 33296, 33298, 33299, 33300, 33301, 33302, 33303];\nFramebuffer.ATTACHMENT_PARAMETERS = FRAMEBUFFER_ATTACHMENT_PARAMETERS;\n//# sourceMappingURL=framebuffer.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/framebuffer.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/program-configuration.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/program-configuration.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ProgramConfiguration)\n/* harmony export */ });\n/* harmony import */ var _accessor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./accessor */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/accessor.js\");\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _webgl_utils_attribute_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../webgl-utils/attribute-utils */ \"./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/attribute-utils.js\");\n\n\n\nclass ProgramConfiguration {\n constructor(program) {\n this.id = program.id;\n this.attributeInfos = [];\n this.attributeInfosByName = {};\n this.attributeInfosByLocation = [];\n this.varyingInfos = [];\n this.varyingInfosByName = {};\n Object.seal(this);\n\n this._readAttributesFromProgram(program);\n\n this._readVaryingsFromProgram(program);\n }\n\n getAttributeInfo(locationOrName) {\n const location = Number(locationOrName);\n\n if (Number.isFinite(location)) {\n return this.attributeInfosByLocation[location];\n }\n\n return this.attributeInfosByName[locationOrName] || null;\n }\n\n getAttributeLocation(locationOrName) {\n const attributeInfo = this.getAttributeInfo(locationOrName);\n return attributeInfo ? attributeInfo.location : -1;\n }\n\n getAttributeAccessor(locationOrName) {\n const attributeInfo = this.getAttributeInfo(locationOrName);\n return attributeInfo ? attributeInfo.accessor : null;\n }\n\n getVaryingInfo(locationOrName) {\n const location = Number(locationOrName);\n\n if (Number.isFinite(location)) {\n return this.varyingInfos[location];\n }\n\n return this.varyingInfosByName[locationOrName] || null;\n }\n\n getVaryingIndex(locationOrName) {\n const varying = this.getVaryingInfo();\n return varying ? varying.location : -1;\n }\n\n getVaryingAccessor(locationOrName) {\n const varying = this.getVaryingInfo();\n return varying ? varying.accessor : null;\n }\n\n _readAttributesFromProgram(program) {\n const {\n gl\n } = program;\n const count = gl.getProgramParameter(program.handle, 35721);\n\n for (let index = 0; index < count; index++) {\n const {\n name,\n type,\n size\n } = gl.getActiveAttrib(program.handle, index);\n const location = gl.getAttribLocation(program.handle, name);\n\n if (location >= 0) {\n this._addAttribute(location, name, type, size);\n }\n }\n\n this.attributeInfos.sort((a, b) => a.location - b.location);\n }\n\n _readVaryingsFromProgram(program) {\n const {\n gl\n } = program;\n\n if (!(0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl)) {\n return;\n }\n\n const count = gl.getProgramParameter(program.handle, 35971);\n\n for (let location = 0; location < count; location++) {\n const {\n name,\n type,\n size\n } = gl.getTransformFeedbackVarying(program.handle, location);\n\n this._addVarying(location, name, type, size);\n }\n\n this.varyingInfos.sort((a, b) => a.location - b.location);\n }\n\n _addAttribute(location, name, compositeType, size) {\n const {\n type,\n components\n } = (0,_webgl_utils_attribute_utils__WEBPACK_IMPORTED_MODULE_1__.decomposeCompositeGLType)(compositeType);\n const accessor = {\n type,\n size: size * components\n };\n\n this._inferProperties(location, name, accessor);\n\n const attributeInfo = {\n location,\n name,\n accessor: new _accessor__WEBPACK_IMPORTED_MODULE_2__[\"default\"](accessor)\n };\n this.attributeInfos.push(attributeInfo);\n this.attributeInfosByLocation[location] = attributeInfo;\n this.attributeInfosByName[attributeInfo.name] = attributeInfo;\n }\n\n _inferProperties(location, name, accessor) {\n if (/instance/i.test(name)) {\n accessor.divisor = 1;\n }\n }\n\n _addVarying(location, name, compositeType, size) {\n const {\n type,\n components\n } = (0,_webgl_utils_attribute_utils__WEBPACK_IMPORTED_MODULE_1__.decomposeCompositeGLType)(compositeType);\n const accessor = new _accessor__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n type,\n size: size * components\n });\n const varying = {\n location,\n name,\n accessor\n };\n this.varyingInfos.push(varying);\n this.varyingInfosByName[varying.name] = varying;\n }\n\n}\n//# sourceMappingURL=program-configuration.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/program-configuration.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/program.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/program.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Program)\n/* harmony export */ });\n/* harmony import */ var _resource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resource */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/resource.js\");\n/* harmony import */ var _texture__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./texture */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture.js\");\n/* harmony import */ var _framebuffer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./framebuffer */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/framebuffer.js\");\n/* harmony import */ var _uniforms__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./uniforms */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/uniforms.js\");\n/* harmony import */ var _shader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shader */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/shader.js\");\n/* harmony import */ var _program_configuration__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./program-configuration */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/program-configuration.js\");\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _webgl_utils_constants_to_keys__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../webgl-utils/constants-to-keys */ \"./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/constants-to-keys.js\");\n/* harmony import */ var _webgl_utils_attribute_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../webgl-utils/attribute-utils */ \"./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/attribute-utils.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n/* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/utils */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/utils.js\");\n\n\n\n\n\n\n\n\n\n\n\n\nconst LOG_PROGRAM_PERF_PRIORITY = 4;\nconst GL_SEPARATE_ATTRIBS = 0x8c8d;\nconst V6_DEPRECATED_METHODS = ['setVertexArray', 'setAttributes', 'setBuffers', 'unsetBuffers', 'use', 'getUniformCount', 'getUniformInfo', 'getUniformLocation', 'getUniformValue', 'getVarying', 'getFragDataLocation', 'getAttachedShaders', 'getAttributeCount', 'getAttributeLocation', 'getAttributeInfo'];\nclass Program extends _resource__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n get [Symbol.toStringTag]() {\n return 'Program';\n }\n\n constructor(gl) {\n let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n super(gl, props);\n this.stubRemovedMethods('Program', 'v6.0', V6_DEPRECATED_METHODS);\n this._isCached = false;\n this.initialize(props);\n Object.seal(this);\n\n this._setId(props.id);\n }\n\n initialize() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n hash,\n vs,\n fs,\n varyings,\n bufferMode = GL_SEPARATE_ATTRIBS\n } = props;\n this.hash = hash || '';\n this.vs = typeof vs === 'string' ? new _shader__WEBPACK_IMPORTED_MODULE_2__.VertexShader(this.gl, {\n id: \"\".concat(props.id, \"-vs\"),\n source: vs\n }) : vs;\n this.fs = typeof fs === 'string' ? new _shader__WEBPACK_IMPORTED_MODULE_2__.FragmentShader(this.gl, {\n id: \"\".concat(props.id, \"-fs\"),\n source: fs\n }) : fs;\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__.assert)(this.vs instanceof _shader__WEBPACK_IMPORTED_MODULE_2__.VertexShader);\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__.assert)(this.fs instanceof _shader__WEBPACK_IMPORTED_MODULE_2__.FragmentShader);\n this.uniforms = {};\n this._textureUniforms = {};\n\n if (varyings && varyings.length > 0) {\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(this.gl);\n this.varyings = varyings;\n this.gl2.transformFeedbackVaryings(this.handle, varyings, bufferMode);\n }\n\n this._compileAndLink();\n\n this._readUniformLocationsFromLinkedProgram();\n\n this.configuration = new _program_configuration__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this);\n return this.setProps(props);\n }\n\n delete() {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (this._isCached) {\n return this;\n }\n\n return super.delete(options);\n }\n\n setProps(props) {\n if ('uniforms' in props) {\n this.setUniforms(props.uniforms);\n }\n\n return this;\n }\n\n draw(_ref) {\n let {\n logPriority,\n drawMode = 4,\n vertexCount,\n offset = 0,\n start,\n end,\n isIndexed = false,\n indexType = 5123,\n instanceCount = 0,\n isInstanced = instanceCount > 0,\n vertexArray = null,\n transformFeedback,\n framebuffer,\n parameters = {},\n uniforms,\n samplers\n } = _ref;\n\n if (uniforms || samplers) {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.deprecated('Program.draw({uniforms})', 'Program.setUniforms(uniforms)')();\n this.setUniforms(uniforms || {});\n }\n\n if (_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.priority >= logPriority) {\n const fb = framebuffer ? framebuffer.id : 'default';\n const message = \"mode=\".concat((0,_webgl_utils_constants_to_keys__WEBPACK_IMPORTED_MODULE_5__.getKey)(this.gl, drawMode), \" verts=\").concat(vertexCount, \" \") + \"instances=\".concat(instanceCount, \" indexType=\").concat((0,_webgl_utils_constants_to_keys__WEBPACK_IMPORTED_MODULE_5__.getKey)(this.gl, indexType), \" \") + \"isInstanced=\".concat(isInstanced, \" isIndexed=\").concat(isIndexed, \" \") + \"Framebuffer=\".concat(fb);\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.log(logPriority, message)();\n }\n\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__.assert)(vertexArray);\n this.gl.useProgram(this.handle);\n\n if (!this._areTexturesRenderable() || vertexCount === 0 || isInstanced && instanceCount === 0) {\n return false;\n }\n\n vertexArray.bindForDraw(vertexCount, instanceCount, () => {\n if (framebuffer !== undefined) {\n parameters = Object.assign({}, parameters, {\n framebuffer\n });\n }\n\n if (transformFeedback) {\n const primitiveMode = (0,_webgl_utils_attribute_utils__WEBPACK_IMPORTED_MODULE_6__.getPrimitiveDrawMode)(drawMode);\n transformFeedback.begin(primitiveMode);\n }\n\n this._bindTextures();\n\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.withParameters)(this.gl, parameters, () => {\n if (isIndexed && isInstanced) {\n this.gl2.drawElementsInstanced(drawMode, vertexCount, indexType, offset, instanceCount);\n } else if (isIndexed && (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(this.gl) && !isNaN(start) && !isNaN(end)) {\n this.gl2.drawRangeElements(drawMode, start, end, vertexCount, indexType, offset);\n } else if (isIndexed) {\n this.gl.drawElements(drawMode, vertexCount, indexType, offset);\n } else if (isInstanced) {\n this.gl2.drawArraysInstanced(drawMode, offset, vertexCount, instanceCount);\n } else {\n this.gl.drawArrays(drawMode, offset, vertexCount);\n }\n });\n\n if (transformFeedback) {\n transformFeedback.end();\n }\n });\n return true;\n }\n\n setUniforms() {\n let uniforms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.priority >= 2) {\n (0,_uniforms__WEBPACK_IMPORTED_MODULE_7__.checkUniformValues)(uniforms, this.id, this._uniformSetters);\n }\n\n this.gl.useProgram(this.handle);\n\n for (const uniformName in uniforms) {\n const uniform = uniforms[uniformName];\n const uniformSetter = this._uniformSetters[uniformName];\n\n if (uniformSetter) {\n let value = uniform;\n let textureUpdate = false;\n\n if (value instanceof _framebuffer__WEBPACK_IMPORTED_MODULE_8__[\"default\"]) {\n value = value.texture;\n }\n\n if (value instanceof _texture__WEBPACK_IMPORTED_MODULE_9__[\"default\"]) {\n textureUpdate = this.uniforms[uniformName] !== uniform;\n\n if (textureUpdate) {\n if (uniformSetter.textureIndex === undefined) {\n uniformSetter.textureIndex = this._textureIndexCounter++;\n }\n\n const texture = value;\n const {\n textureIndex\n } = uniformSetter;\n texture.bind(textureIndex);\n value = textureIndex;\n this._textureUniforms[uniformName] = texture;\n } else {\n value = uniformSetter.textureIndex;\n }\n } else if (this._textureUniforms[uniformName]) {\n delete this._textureUniforms[uniformName];\n }\n\n if (uniformSetter(value) || textureUpdate) {\n (0,_uniforms__WEBPACK_IMPORTED_MODULE_7__.copyUniform)(this.uniforms, uniformName, uniform);\n }\n }\n }\n\n return this;\n }\n\n _areTexturesRenderable() {\n let texturesRenderable = true;\n\n for (const uniformName in this._textureUniforms) {\n const texture = this._textureUniforms[uniformName];\n texture.update();\n texturesRenderable = texturesRenderable && texture.loaded;\n }\n\n return texturesRenderable;\n }\n\n _bindTextures() {\n for (const uniformName in this._textureUniforms) {\n const textureIndex = this._uniformSetters[uniformName].textureIndex;\n\n this._textureUniforms[uniformName].bind(textureIndex);\n }\n }\n\n _createHandle() {\n return this.gl.createProgram();\n }\n\n _deleteHandle() {\n this.gl.deleteProgram(this.handle);\n }\n\n _getOptionsFromHandle(handle) {\n const shaderHandles = this.gl.getAttachedShaders(handle);\n const opts = {};\n\n for (const shaderHandle of shaderHandles) {\n const type = this.gl.getShaderParameter(this.handle, 35663);\n\n switch (type) {\n case 35633:\n opts.vs = new _shader__WEBPACK_IMPORTED_MODULE_2__.VertexShader({\n handle: shaderHandle\n });\n break;\n\n case 35632:\n opts.fs = new _shader__WEBPACK_IMPORTED_MODULE_2__.FragmentShader({\n handle: shaderHandle\n });\n break;\n\n default:\n }\n }\n\n return opts;\n }\n\n _getParameter(pname) {\n return this.gl.getProgramParameter(this.handle, pname);\n }\n\n _setId(id) {\n if (!id) {\n const programName = this._getName();\n\n this.id = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_10__.uid)(programName);\n }\n }\n\n _getName() {\n let programName = this.vs.getName() || this.fs.getName();\n programName = programName.replace(/shader/i, '');\n programName = programName ? \"\".concat(programName, \"-program\") : 'program';\n return programName;\n }\n\n _compileAndLink() {\n const {\n gl\n } = this;\n gl.attachShader(this.handle, this.vs.handle);\n gl.attachShader(this.handle, this.fs.handle);\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.time(LOG_PROGRAM_PERF_PRIORITY, \"linkProgram for \".concat(this._getName()))();\n gl.linkProgram(this.handle);\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.timeEnd(LOG_PROGRAM_PERF_PRIORITY, \"linkProgram for \".concat(this._getName()))();\n\n if (gl.debug || _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.level > 0) {\n const linked = gl.getProgramParameter(this.handle, 35714);\n\n if (!linked) {\n throw new Error(\"Error linking: \".concat(gl.getProgramInfoLog(this.handle)));\n }\n\n gl.validateProgram(this.handle);\n const validated = gl.getProgramParameter(this.handle, 35715);\n\n if (!validated) {\n throw new Error(\"Error validating: \".concat(gl.getProgramInfoLog(this.handle)));\n }\n }\n }\n\n _readUniformLocationsFromLinkedProgram() {\n const {\n gl\n } = this;\n this._uniformSetters = {};\n this._uniformCount = this._getParameter(35718);\n\n for (let i = 0; i < this._uniformCount; i++) {\n const info = this.gl.getActiveUniform(this.handle, i);\n const {\n name\n } = (0,_uniforms__WEBPACK_IMPORTED_MODULE_7__.parseUniformName)(info.name);\n let location = gl.getUniformLocation(this.handle, name);\n this._uniformSetters[name] = (0,_uniforms__WEBPACK_IMPORTED_MODULE_7__.getUniformSetter)(gl, location, info);\n\n if (info.size > 1) {\n for (let l = 0; l < info.size; l++) {\n location = gl.getUniformLocation(this.handle, \"\".concat(name, \"[\").concat(l, \"]\"));\n this._uniformSetters[\"\".concat(name, \"[\").concat(l, \"]\")] = (0,_uniforms__WEBPACK_IMPORTED_MODULE_7__.getUniformSetter)(gl, location, info);\n }\n }\n }\n\n this._textureIndexCounter = 0;\n }\n\n getActiveUniforms(uniformIndices, pname) {\n return this.gl2.getActiveUniforms(this.handle, uniformIndices, pname);\n }\n\n getUniformBlockIndex(blockName) {\n return this.gl2.getUniformBlockIndex(this.handle, blockName);\n }\n\n getActiveUniformBlockParameter(blockIndex, pname) {\n return this.gl2.getActiveUniformBlockParameter(this.handle, blockIndex, pname);\n }\n\n uniformBlockBinding(blockIndex, blockBinding) {\n this.gl2.uniformBlockBinding(this.handle, blockIndex, blockBinding);\n }\n\n}\n//# sourceMappingURL=program.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/program.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/query.js": +/*!***************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/query.js ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Query)\n/* harmony export */ });\n/* harmony import */ var _resource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resource */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/resource.js\");\n/* harmony import */ var _features__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../features */ \"./node_modules/@luma.gl/webgl/dist/esm/features/features.js\");\n/* harmony import */ var _features__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../features */ \"./node_modules/@luma.gl/webgl/dist/esm/features/webgl-features-table.js\");\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n\n\n\n\nconst GL_QUERY_RESULT = 0x8866;\nconst GL_QUERY_RESULT_AVAILABLE = 0x8867;\nconst GL_TIME_ELAPSED_EXT = 0x88bf;\nconst GL_GPU_DISJOINT_EXT = 0x8fbb;\nconst GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8c88;\nconst GL_ANY_SAMPLES_PASSED = 0x8c2f;\nconst GL_ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8d6a;\nclass Query extends _resource__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n get [Symbol.toStringTag]() {\n return 'Query';\n }\n\n static isSupported(gl) {\n let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n const webgl2 = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl);\n const hasTimerQuery = (0,_features__WEBPACK_IMPORTED_MODULE_2__.hasFeatures)(gl, _features__WEBPACK_IMPORTED_MODULE_3__.FEATURES.TIMER_QUERY);\n let supported = webgl2 || hasTimerQuery;\n\n for (const key of opts) {\n switch (key) {\n case 'queries':\n supported = supported && webgl2;\n break;\n\n case 'timers':\n supported = supported && hasTimerQuery;\n break;\n\n default:\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_4__.assert)(false);\n }\n }\n\n return supported;\n }\n\n constructor(gl) {\n let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n super(gl, opts);\n this.target = null;\n this._queryPending = false;\n this._pollingPromise = null;\n Object.seal(this);\n }\n\n beginTimeElapsedQuery() {\n return this.begin(GL_TIME_ELAPSED_EXT);\n }\n\n beginOcclusionQuery() {\n let {\n conservative = false\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return this.begin(conservative ? GL_ANY_SAMPLES_PASSED_CONSERVATIVE : GL_ANY_SAMPLES_PASSED);\n }\n\n beginTransformFeedbackQuery() {\n return this.begin(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);\n }\n\n begin(target) {\n if (this._queryPending) {\n return this;\n }\n\n this.target = target;\n this.gl2.beginQuery(this.target, this.handle);\n return this;\n }\n\n end() {\n if (this._queryPending) {\n return this;\n }\n\n if (this.target) {\n this.gl2.endQuery(this.target);\n this.target = null;\n this._queryPending = true;\n }\n\n return this;\n }\n\n isResultAvailable() {\n if (!this._queryPending) {\n return false;\n }\n\n const resultAvailable = this.gl2.getQueryParameter(this.handle, GL_QUERY_RESULT_AVAILABLE);\n\n if (resultAvailable) {\n this._queryPending = false;\n }\n\n return resultAvailable;\n }\n\n isTimerDisjoint() {\n return this.gl2.getParameter(GL_GPU_DISJOINT_EXT);\n }\n\n getResult() {\n return this.gl2.getQueryParameter(this.handle, GL_QUERY_RESULT);\n }\n\n getTimerMilliseconds() {\n return this.getResult() / 1e6;\n }\n\n createPoll() {\n let limit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Number.POSITIVE_INFINITY;\n\n if (this._pollingPromise) {\n return this._pollingPromise;\n }\n\n let counter = 0;\n this._pollingPromise = new Promise((resolve, reject) => {\n const poll = () => {\n if (this.isResultAvailable()) {\n resolve(this.getResult());\n this._pollingPromise = null;\n } else if (counter++ > limit) {\n reject('Timed out');\n this._pollingPromise = null;\n } else {\n requestAnimationFrame(poll);\n }\n };\n\n requestAnimationFrame(poll);\n });\n return this._pollingPromise;\n }\n\n _createHandle() {\n return Query.isSupported(this.gl) ? this.gl2.createQuery() : null;\n }\n\n _deleteHandle() {\n this.gl2.deleteQuery(this.handle);\n }\n\n}\n//# sourceMappingURL=query.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/query.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/renderbuffer-formats.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/renderbuffer-formats.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nconst EXT_FLOAT_WEBGL2 = 'EXT_color_buffer_float';\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n [33189]: {\n bpp: 2\n },\n [33190]: {\n gl2: true,\n bpp: 3\n },\n [36012]: {\n gl2: true,\n bpp: 4\n },\n [36168]: {\n bpp: 1\n },\n [34041]: {\n bpp: 4\n },\n [35056]: {\n gl2: true,\n bpp: 4\n },\n [36013]: {\n gl2: true,\n bpp: 5\n },\n [32854]: {\n bpp: 2\n },\n [36194]: {\n bpp: 2\n },\n [32855]: {\n bpp: 2\n },\n [33321]: {\n gl2: true,\n bpp: 1\n },\n [33330]: {\n gl2: true,\n bpp: 1\n },\n [33329]: {\n gl2: true,\n bpp: 1\n },\n [33332]: {\n gl2: true,\n bpp: 2\n },\n [33331]: {\n gl2: true,\n bpp: 2\n },\n [33334]: {\n gl2: true,\n bpp: 4\n },\n [33333]: {\n gl2: true,\n bpp: 4\n },\n [33323]: {\n gl2: true,\n bpp: 2\n },\n [33336]: {\n gl2: true,\n bpp: 2\n },\n [33335]: {\n gl2: true,\n bpp: 2\n },\n [33338]: {\n gl2: true,\n bpp: 4\n },\n [33337]: {\n gl2: true,\n bpp: 4\n },\n [33340]: {\n gl2: true,\n bpp: 8\n },\n [33339]: {\n gl2: true,\n bpp: 8\n },\n [32849]: {\n gl2: true,\n bpp: 3\n },\n [32856]: {\n gl2: true,\n bpp: 4\n },\n [32857]: {\n gl2: true,\n bpp: 4\n },\n [36220]: {\n gl2: true,\n bpp: 4\n },\n [36238]: {\n gl2: true,\n bpp: 4\n },\n [36975]: {\n gl2: true,\n bpp: 4\n },\n [36214]: {\n gl2: true,\n bpp: 8\n },\n [36232]: {\n gl2: true,\n bpp: 8\n },\n [36226]: {\n gl2: true,\n bpp: 16\n },\n [36208]: {\n gl2: true,\n bpp: 16\n },\n [33325]: {\n gl2: EXT_FLOAT_WEBGL2,\n bpp: 2\n },\n [33327]: {\n gl2: EXT_FLOAT_WEBGL2,\n bpp: 4\n },\n [34842]: {\n gl2: EXT_FLOAT_WEBGL2,\n bpp: 8\n },\n [33326]: {\n gl2: EXT_FLOAT_WEBGL2,\n bpp: 4\n },\n [33328]: {\n gl2: EXT_FLOAT_WEBGL2,\n bpp: 8\n },\n [34836]: {\n gl2: EXT_FLOAT_WEBGL2,\n bpp: 16\n },\n [35898]: {\n gl2: EXT_FLOAT_WEBGL2,\n bpp: 4\n }\n});\n//# sourceMappingURL=renderbuffer-formats.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/renderbuffer-formats.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/renderbuffer.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/renderbuffer.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Renderbuffer)\n/* harmony export */ });\n/* harmony import */ var _resource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resource */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/resource.js\");\n/* harmony import */ var _renderbuffer_formats__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./renderbuffer-formats */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/renderbuffer-formats.js\");\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n\n\n\n\n\nfunction isFormatSupported(gl, format, formats) {\n const info = formats[format];\n\n if (!info) {\n return false;\n }\n\n const value = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl) ? info.gl2 || info.gl1 : info.gl1;\n\n if (typeof value === 'string') {\n return gl.getExtension(value);\n }\n\n return value;\n}\n\nclass Renderbuffer extends _resource__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n get [Symbol.toStringTag]() {\n return 'Renderbuffer';\n }\n\n static isSupported(gl) {\n let {\n format\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n format: null\n };\n return !format || isFormatSupported(gl, format, _renderbuffer_formats__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n }\n\n static getSamplesForFormat(gl, _ref) {\n let {\n format\n } = _ref;\n return gl.getInternalformatParameter(36161, format, 32937);\n }\n\n constructor(gl) {\n let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n super(gl, opts);\n this.initialize(opts);\n Object.seal(this);\n }\n\n initialize(_ref2) {\n let {\n format,\n width = 1,\n height = 1,\n samples = 0\n } = _ref2;\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__.assert)(format, 'Needs format');\n\n this._trackDeallocatedMemory();\n\n this.gl.bindRenderbuffer(36161, this.handle);\n\n if (samples !== 0 && (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(this.gl)) {\n this.gl.renderbufferStorageMultisample(36161, samples, format, width, height);\n } else {\n this.gl.renderbufferStorage(36161, format, width, height);\n }\n\n this.format = format;\n this.width = width;\n this.height = height;\n this.samples = samples;\n\n this._trackAllocatedMemory(this.width * this.height * (this.samples || 1) * _renderbuffer_formats__WEBPACK_IMPORTED_MODULE_2__[\"default\"][this.format].bpp);\n\n return this;\n }\n\n resize(_ref3) {\n let {\n width,\n height\n } = _ref3;\n\n if (width !== this.width || height !== this.height) {\n return this.initialize({\n width,\n height,\n format: this.format,\n samples: this.samples\n });\n }\n\n return this;\n }\n\n _createHandle() {\n return this.gl.createRenderbuffer();\n }\n\n _deleteHandle() {\n this.gl.deleteRenderbuffer(this.handle);\n\n this._trackDeallocatedMemory();\n }\n\n _bindHandle(handle) {\n this.gl.bindRenderbuffer(36161, handle);\n }\n\n _syncHandle(handle) {\n this.format = this.getParameter(36164);\n this.width = this.getParameter(36162);\n this.height = this.getParameter(36163);\n this.samples = this.getParameter(36011);\n }\n\n _getParameter(pname) {\n this.gl.bindRenderbuffer(36161, this.handle);\n const value = this.gl.getRenderbufferParameter(36161, pname);\n return value;\n }\n\n}\n//# sourceMappingURL=renderbuffer.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/renderbuffer.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/resource.js": +/*!******************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/resource.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Resource)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../init */ \"./node_modules/@luma.gl/webgl/dist/esm/init.js\");\n/* harmony import */ var _webgl_utils_constants_to_keys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../webgl-utils/constants-to-keys */ \"./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/constants-to-keys.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n/* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/utils */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/utils.js\");\n/* harmony import */ var _utils_stub_methods__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/stub-methods */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/stub-methods.js\");\n\n\n\n\n\n\nconst ERR_RESOURCE_METHOD_UNDEFINED = 'Resource subclass must define virtual methods';\nclass Resource {\n get [Symbol.toStringTag]() {\n return 'Resource';\n }\n\n constructor(gl) {\n let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGLContext)(gl);\n const {\n id,\n userData = {}\n } = opts;\n this.gl = gl;\n this.gl2 = gl;\n this.id = id || (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__.uid)(this[Symbol.toStringTag]);\n this.userData = userData;\n this._bound = false;\n this._handle = opts.handle;\n\n if (this._handle === undefined) {\n this._handle = this._createHandle();\n }\n\n this.byteLength = 0;\n\n this._addStats();\n }\n\n toString() {\n return \"\".concat(this[Symbol.toStringTag] || this.constructor.name, \"(\").concat(this.id, \")\");\n }\n\n get handle() {\n return this._handle;\n }\n\n delete() {\n let {\n deleteChildren = false\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n const children = this._handle && this._deleteHandle(this._handle);\n\n if (this._handle) {\n this._removeStats();\n }\n\n this._handle = null;\n\n if (children && deleteChildren) {\n children.filter(Boolean).forEach(child => child.delete());\n }\n\n return this;\n }\n\n bind() {\n let funcOrHandle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.handle;\n\n if (typeof funcOrHandle !== 'function') {\n this._bindHandle(funcOrHandle);\n\n return this;\n }\n\n let value;\n\n if (!this._bound) {\n this._bindHandle(this.handle);\n\n this._bound = true;\n value = funcOrHandle();\n this._bound = false;\n\n this._bindHandle(null);\n } else {\n value = funcOrHandle();\n }\n\n return value;\n }\n\n unbind() {\n this.bind(null);\n }\n\n getParameter(pname) {\n let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n pname = (0,_webgl_utils_constants_to_keys__WEBPACK_IMPORTED_MODULE_2__.getKeyValue)(this.gl, pname);\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__.assert)(pname);\n const parameters = this.constructor.PARAMETERS || {};\n const parameter = parameters[pname];\n\n if (parameter) {\n const isWebgl2 = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(this.gl);\n const parameterAvailable = (!('webgl2' in parameter) || isWebgl2) && (!('extension' in parameter) || this.gl.getExtension(parameter.extension));\n\n if (!parameterAvailable) {\n const webgl1Default = parameter.webgl1;\n const webgl2Default = 'webgl2' in parameter ? parameter.webgl2 : parameter.webgl1;\n const defaultValue = isWebgl2 ? webgl2Default : webgl1Default;\n return defaultValue;\n }\n }\n\n return this._getParameter(pname, opts);\n }\n\n getParameters() {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n parameters,\n keys\n } = options;\n const PARAMETERS = this.constructor.PARAMETERS || {};\n const isWebgl2 = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(this.gl);\n const values = {};\n const parameterKeys = parameters || Object.keys(PARAMETERS);\n\n for (const pname of parameterKeys) {\n const parameter = PARAMETERS[pname];\n const parameterAvailable = parameter && (!('webgl2' in parameter) || isWebgl2) && (!('extension' in parameter) || this.gl.getExtension(parameter.extension));\n\n if (parameterAvailable) {\n const key = keys ? (0,_webgl_utils_constants_to_keys__WEBPACK_IMPORTED_MODULE_2__.getKey)(this.gl, pname) : pname;\n values[key] = this.getParameter(pname, options);\n\n if (keys && parameter.type === 'GLenum') {\n values[key] = (0,_webgl_utils_constants_to_keys__WEBPACK_IMPORTED_MODULE_2__.getKey)(this.gl, values[key]);\n }\n }\n }\n\n return values;\n }\n\n setParameter(pname, value) {\n pname = (0,_webgl_utils_constants_to_keys__WEBPACK_IMPORTED_MODULE_2__.getKeyValue)(this.gl, pname);\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__.assert)(pname);\n const parameters = this.constructor.PARAMETERS || {};\n const parameter = parameters[pname];\n\n if (parameter) {\n const isWebgl2 = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(this.gl);\n const parameterAvailable = (!('webgl2' in parameter) || isWebgl2) && (!('extension' in parameter) || this.gl.getExtension(parameter.extension));\n\n if (!parameterAvailable) {\n throw new Error('Parameter not available on this platform');\n }\n\n if (parameter.type === 'GLenum') {\n value = (0,_webgl_utils_constants_to_keys__WEBPACK_IMPORTED_MODULE_2__.getKeyValue)(value);\n }\n }\n\n this._setParameter(pname, value);\n\n return this;\n }\n\n setParameters(parameters) {\n for (const pname in parameters) {\n this.setParameter(pname, parameters[pname]);\n }\n\n return this;\n }\n\n stubRemovedMethods(className, version, methodNames) {\n return (0,_utils_stub_methods__WEBPACK_IMPORTED_MODULE_4__.stubRemovedMethods)(this, className, version, methodNames);\n }\n\n initialize(opts) {}\n\n _createHandle() {\n throw new Error(ERR_RESOURCE_METHOD_UNDEFINED);\n }\n\n _deleteHandle() {\n throw new Error(ERR_RESOURCE_METHOD_UNDEFINED);\n }\n\n _bindHandle(handle) {\n throw new Error(ERR_RESOURCE_METHOD_UNDEFINED);\n }\n\n _getOptsFromHandle() {\n throw new Error(ERR_RESOURCE_METHOD_UNDEFINED);\n }\n\n _getParameter(pname, opts) {\n throw new Error(ERR_RESOURCE_METHOD_UNDEFINED);\n }\n\n _setParameter(pname, value) {\n throw new Error(ERR_RESOURCE_METHOD_UNDEFINED);\n }\n\n _context() {\n this.gl.luma = this.gl.luma || {};\n return this.gl.luma;\n }\n\n _addStats() {\n const name = this[Symbol.toStringTag];\n const stats = _init__WEBPACK_IMPORTED_MODULE_5__.lumaStats.get('Resource Counts');\n stats.get('Resources Created').incrementCount();\n stats.get(\"\".concat(name, \"s Created\")).incrementCount();\n stats.get(\"\".concat(name, \"s Active\")).incrementCount();\n }\n\n _removeStats() {\n const name = this[Symbol.toStringTag];\n const stats = _init__WEBPACK_IMPORTED_MODULE_5__.lumaStats.get('Resource Counts');\n stats.get(\"\".concat(name, \"s Active\")).decrementCount();\n }\n\n _trackAllocatedMemory(bytes) {\n let name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this[Symbol.toStringTag];\n\n this._trackAllocatedMemoryForContext(bytes, name);\n\n this._trackAllocatedMemoryForContext(bytes, name, this.gl.canvas && this.gl.canvas.id);\n\n this.byteLength = bytes;\n }\n\n _trackAllocatedMemoryForContext(bytes) {\n let name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this[Symbol.toStringTag];\n let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n const stats = _init__WEBPACK_IMPORTED_MODULE_5__.lumaStats.get(\"Memory Usage\".concat(id));\n stats.get('GPU Memory').addCount(bytes);\n stats.get(\"\".concat(name, \" Memory\")).addCount(bytes);\n }\n\n _trackDeallocatedMemory() {\n let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this[Symbol.toStringTag];\n\n this._trackDeallocatedMemoryForContext(name);\n\n this._trackDeallocatedMemoryForContext(name, this.gl.canvas && this.gl.canvas.id);\n\n this.byteLength = 0;\n }\n\n _trackDeallocatedMemoryForContext() {\n let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this[Symbol.toStringTag];\n let id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n const stats = _init__WEBPACK_IMPORTED_MODULE_5__.lumaStats.get(\"Memory Usage\".concat(id));\n stats.get('GPU Memory').subtractCount(this.byteLength);\n stats.get(\"\".concat(name, \" Memory\")).subtractCount(this.byteLength);\n }\n\n}\n//# sourceMappingURL=resource.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/resource.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/shader.js": +/*!****************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/shader.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FragmentShader: () => (/* binding */ FragmentShader),\n/* harmony export */ Shader: () => (/* binding */ Shader),\n/* harmony export */ VertexShader: () => (/* binding */ VertexShader)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _glsl_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../glsl-utils */ \"./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/get-shader-name.js\");\n/* harmony import */ var _glsl_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../glsl-utils */ \"./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/format-glsl-error.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n/* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/utils */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/utils.js\");\n/* harmony import */ var _resource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resource */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/resource.js\");\n\n\n\n\n\nconst ERR_SOURCE = 'Shader: GLSL source code must be a JavaScript string';\nclass Shader extends _resource__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n get [Symbol.toStringTag]() {\n return 'Shader';\n }\n\n static getTypeName(shaderType) {\n switch (shaderType) {\n case 35633:\n return 'vertex-shader';\n\n case 35632:\n return 'fragment-shader';\n\n default:\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(false);\n return 'unknown';\n }\n }\n\n constructor(gl, props) {\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGLContext)(gl);\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(typeof props.source === 'string', ERR_SOURCE);\n const id = (0,_glsl_utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(props.source, null) || props.id || (0,_utils_utils__WEBPACK_IMPORTED_MODULE_4__.uid)(\"unnamed \".concat(Shader.getTypeName(props.shaderType)));\n super(gl, {\n id\n });\n this.shaderType = props.shaderType;\n this.source = props.source;\n this.initialize(props);\n }\n\n initialize(_ref) {\n let {\n source\n } = _ref;\n const shaderName = (0,_glsl_utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(source, null);\n\n if (shaderName) {\n this.id = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_4__.uid)(shaderName);\n }\n\n this._compile(source);\n }\n\n getParameter(pname) {\n return this.gl.getShaderParameter(this.handle, pname);\n }\n\n toString() {\n return \"\".concat(Shader.getTypeName(this.shaderType), \":\").concat(this.id);\n }\n\n getName() {\n return (0,_glsl_utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.source) || 'unnamed-shader';\n }\n\n getSource() {\n return this.gl.getShaderSource(this.handle);\n }\n\n getTranslatedSource() {\n const extension = this.gl.getExtension('WEBGL_debug_shaders');\n return extension ? extension.getTranslatedShaderSource(this.handle) : 'No translated source available. WEBGL_debug_shaders not implemented';\n }\n\n _compile() {\n let source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.source;\n\n if (!source.startsWith('#version ')) {\n source = \"#version 100\\n\".concat(source);\n }\n\n this.source = source;\n this.gl.shaderSource(this.handle, this.source);\n this.gl.compileShader(this.handle);\n const compileStatus = this.getParameter(35713);\n\n if (!compileStatus) {\n const infoLog = this.gl.getShaderInfoLog(this.handle);\n const {\n shaderName,\n errors,\n warnings\n } = (0,_glsl_utils__WEBPACK_IMPORTED_MODULE_5__.parseGLSLCompilerError)(infoLog, this.source, this.shaderType, this.id);\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.error(\"GLSL compilation errors in \".concat(shaderName, \"\\n\").concat(errors))();\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.warn(\"GLSL compilation warnings in \".concat(shaderName, \"\\n\").concat(warnings))();\n throw new Error(\"GLSL compilation errors in \".concat(shaderName));\n }\n }\n\n _deleteHandle() {\n this.gl.deleteShader(this.handle);\n }\n\n _getOptsFromHandle() {\n return {\n type: this.getParameter(35663),\n source: this.getSource()\n };\n }\n\n}\nclass VertexShader extends Shader {\n get [Symbol.toStringTag]() {\n return 'VertexShader';\n }\n\n constructor(gl, props) {\n if (typeof props === 'string') {\n props = {\n source: props\n };\n }\n\n super(gl, Object.assign({}, props, {\n shaderType: 35633\n }));\n }\n\n _createHandle() {\n return this.gl.createShader(35633);\n }\n\n}\nclass FragmentShader extends Shader {\n get [Symbol.toStringTag]() {\n return 'FragmentShader';\n }\n\n constructor(gl, props) {\n if (typeof props === 'string') {\n props = {\n source: props\n };\n }\n\n super(gl, Object.assign({}, props, {\n shaderType: 35632\n }));\n }\n\n _createHandle() {\n return this.gl.createShader(35632);\n }\n\n}\n//# sourceMappingURL=shader.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/shader.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/texture-2d.js": +/*!********************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/texture-2d.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Texture2D)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _texture__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./texture */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture.js\");\n/* harmony import */ var _utils_load_file__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/load-file */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/load-file.js\");\n\n\n\nclass Texture2D extends _texture__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n get [Symbol.toStringTag]() {\n return 'Texture2D';\n }\n\n static isSupported(gl, opts) {\n return _texture__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isSupported(gl, opts);\n }\n\n constructor(gl) {\n let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGLContext)(gl);\n\n if (props instanceof Promise || typeof props === 'string') {\n props = {\n data: props\n };\n }\n\n if (typeof props.data === 'string') {\n props = Object.assign({}, props, {\n data: (0,_utils_load_file__WEBPACK_IMPORTED_MODULE_2__.loadImage)(props.data)\n });\n }\n\n super(gl, Object.assign({}, props, {\n target: 3553\n }));\n this.initialize(props);\n Object.seal(this);\n }\n\n}\n//# sourceMappingURL=texture-2d.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/texture-2d.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/texture-3d.js": +/*!********************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/texture-3d.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Texture3D)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _texture__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./texture */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture.js\");\n/* harmony import */ var _texture_formats__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./texture-formats */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture-formats.js\");\n/* harmony import */ var _buffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./buffer */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/buffer.js\");\n\n\n\n\nclass Texture3D extends _texture__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n get [Symbol.toStringTag]() {\n return 'Texture3D';\n }\n\n static isSupported(gl) {\n return (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl);\n }\n\n constructor(gl) {\n let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(gl);\n props = Object.assign({\n depth: 1\n }, props, {\n target: 32879,\n unpackFlipY: false\n });\n super(gl, props);\n this.initialize(props);\n Object.seal(this);\n }\n\n setImageData(_ref) {\n let {\n level = 0,\n dataFormat = 6408,\n width,\n height,\n depth = 1,\n border = 0,\n format,\n type = 5121,\n offset = 0,\n data,\n parameters = {}\n } = _ref;\n\n this._trackDeallocatedMemory('Texture');\n\n this.gl.bindTexture(this.target, this.handle);\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.withParameters)(this.gl, parameters, () => {\n if (ArrayBuffer.isView(data)) {\n this.gl.texImage3D(this.target, level, dataFormat, width, height, depth, border, format, type, data);\n }\n\n if (data instanceof _buffer__WEBPACK_IMPORTED_MODULE_2__[\"default\"]) {\n this.gl.bindBuffer(35052, data.handle);\n this.gl.texImage3D(this.target, level, dataFormat, width, height, depth, border, format, type, offset);\n }\n });\n\n if (data && data.byteLength) {\n this._trackAllocatedMemory(data.byteLength, 'Texture');\n } else {\n const channels = _texture_formats__WEBPACK_IMPORTED_MODULE_3__.DATA_FORMAT_CHANNELS[this.dataFormat] || 4;\n const channelSize = _texture_formats__WEBPACK_IMPORTED_MODULE_3__.TYPE_SIZES[this.type] || 1;\n\n this._trackAllocatedMemory(this.width * this.height * this.depth * channels * channelSize, 'Texture');\n }\n\n this.loaded = true;\n return this;\n }\n\n}\n//# sourceMappingURL=texture-3d.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/texture-3d.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/texture-cube.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/texture-cube.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ TextureCube)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _texture__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./texture */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture.js\");\n\n\nconst FACES = [34069, 34070, 34071, 34072, 34073, 34074];\nclass TextureCube extends _texture__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n get [Symbol.toStringTag]() {\n return 'TextureCube';\n }\n\n constructor(gl) {\n let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGLContext)(gl);\n super(gl, Object.assign({}, props, {\n target: 34067\n }));\n this.initialize(props);\n Object.seal(this);\n }\n\n initialize() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n mipmaps = true,\n parameters = {}\n } = props;\n this.opts = props;\n this.setCubeMapImageData(props).then(() => {\n this.loaded = true;\n\n if (mipmaps) {\n this.generateMipmap(props);\n }\n\n this.setParameters(parameters);\n });\n return this;\n }\n\n subImage(_ref) {\n let {\n face,\n data,\n x = 0,\n y = 0,\n mipmapLevel = 0\n } = _ref;\n return this._subImage({\n target: face,\n data,\n x,\n y,\n mipmapLevel\n });\n }\n\n async setCubeMapImageData(_ref2) {\n let {\n width,\n height,\n pixels,\n data,\n border = 0,\n format = 6408,\n type = 5121\n } = _ref2;\n const {\n gl\n } = this;\n const imageDataMap = pixels || data;\n const resolvedFaces = await Promise.all(FACES.map(face => {\n const facePixels = imageDataMap[face];\n return Promise.all(Array.isArray(facePixels) ? facePixels : [facePixels]);\n }));\n this.bind();\n FACES.forEach((face, index) => {\n if (resolvedFaces[index].length > 1 && this.opts.mipmaps !== false) {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.warn(\"\".concat(this.id, \" has mipmap and multiple LODs.\"))();\n }\n\n resolvedFaces[index].forEach((image, lodLevel) => {\n if (width && height) {\n gl.texImage2D(face, lodLevel, format, width, height, border, format, type, image);\n } else {\n gl.texImage2D(face, lodLevel, format, format, type, image);\n }\n });\n });\n this.unbind();\n }\n\n setImageDataForFace(options) {\n const {\n face,\n width,\n height,\n pixels,\n data,\n border = 0,\n format = 6408,\n type = 5121\n } = options;\n const {\n gl\n } = this;\n const imageData = pixels || data;\n this.bind();\n\n if (imageData instanceof Promise) {\n imageData.then(resolvedImageData => this.setImageDataForFace(Object.assign({}, options, {\n face,\n data: resolvedImageData,\n pixels: resolvedImageData\n })));\n } else if (this.width || this.height) {\n gl.texImage2D(face, 0, format, width, height, border, format, type, imageData);\n } else {\n gl.texImage2D(face, 0, format, format, type, imageData);\n }\n\n return this;\n }\n\n}\nTextureCube.FACES = FACES;\n//# sourceMappingURL=texture-cube.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/texture-cube.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/texture-formats.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/texture-formats.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DATA_FORMAT_CHANNELS: () => (/* binding */ DATA_FORMAT_CHANNELS),\n/* harmony export */ TEXTURE_FORMATS: () => (/* binding */ TEXTURE_FORMATS),\n/* harmony export */ TYPE_SIZES: () => (/* binding */ TYPE_SIZES),\n/* harmony export */ isFormatSupported: () => (/* binding */ isFormatSupported),\n/* harmony export */ isLinearFilteringSupported: () => (/* binding */ isLinearFilteringSupported)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n\nconst TEXTURE_FORMATS = {\n [6407]: {\n dataFormat: 6407,\n types: [5121, 33635]\n },\n [6408]: {\n dataFormat: 6408,\n types: [5121, 32819, 32820]\n },\n [6406]: {\n dataFormat: 6406,\n types: [5121]\n },\n [6409]: {\n dataFormat: 6409,\n types: [5121]\n },\n [6410]: {\n dataFormat: 6410,\n types: [5121]\n },\n [33326]: {\n dataFormat: 6403,\n types: [5126],\n gl2: true\n },\n [33328]: {\n dataFormat: 33319,\n types: [5126],\n gl2: true\n },\n [34837]: {\n dataFormat: 6407,\n types: [5126],\n gl2: true\n },\n [34836]: {\n dataFormat: 6408,\n types: [5126],\n gl2: true\n }\n};\nconst DATA_FORMAT_CHANNELS = {\n [6403]: 1,\n [36244]: 1,\n [33319]: 2,\n [33320]: 2,\n [6407]: 3,\n [36248]: 3,\n [6408]: 4,\n [36249]: 4,\n [6402]: 1,\n [34041]: 1,\n [6406]: 1,\n [6409]: 1,\n [6410]: 2\n};\nconst TYPE_SIZES = {\n [5126]: 4,\n [5125]: 4,\n [5124]: 4,\n [5123]: 2,\n [5122]: 2,\n [5131]: 2,\n [5120]: 1,\n [5121]: 1\n};\nfunction isFormatSupported(gl, format) {\n const info = TEXTURE_FORMATS[format];\n\n if (!info) {\n return false;\n }\n\n if (info.gl1 === undefined && info.gl2 === undefined) {\n return true;\n }\n\n const value = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl) ? info.gl2 || info.gl1 : info.gl1;\n return typeof value === 'string' ? gl.getExtension(value) : value;\n}\nfunction isLinearFilteringSupported(gl, format) {\n const info = TEXTURE_FORMATS[format];\n\n switch (info && info.types[0]) {\n case 5126:\n return gl.getExtension('OES_texture_float_linear');\n\n case 5131:\n return gl.getExtension('OES_texture_half_float_linear');\n\n default:\n return true;\n }\n}\n//# sourceMappingURL=texture-formats.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/texture-formats.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/texture.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/texture.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Texture)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _resource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resource */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/resource.js\");\n/* harmony import */ var _buffer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./buffer */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/buffer.js\");\n/* harmony import */ var _texture_formats__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./texture-formats */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture-formats.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n/* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/utils */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/utils.js\");\n\n\n\n\n\n\nconst NPOT_MIN_FILTERS = [9729, 9728];\n\nconst WebGLBuffer = globalThis.WebGLBuffer || function WebGLBuffer() {};\n\nclass Texture extends _resource__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n get [Symbol.toStringTag]() {\n return 'Texture';\n }\n\n static isSupported(gl) {\n let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const {\n format,\n linearFiltering\n } = opts;\n let supported = true;\n\n if (format) {\n supported = supported && (0,_texture_formats__WEBPACK_IMPORTED_MODULE_2__.isFormatSupported)(gl, format);\n supported = supported && (!linearFiltering || (0,_texture_formats__WEBPACK_IMPORTED_MODULE_2__.isLinearFilteringSupported)(gl, format));\n }\n\n return supported;\n }\n\n constructor(gl, props) {\n const {\n id = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_3__.uid)('texture'),\n handle,\n target\n } = props;\n super(gl, {\n id,\n handle\n });\n this.target = target;\n this.textureUnit = undefined;\n this.loaded = false;\n this.width = undefined;\n this.height = undefined;\n this.depth = undefined;\n this.format = undefined;\n this.type = undefined;\n this.dataFormat = undefined;\n this.border = undefined;\n this.textureUnit = undefined;\n this.mipmaps = undefined;\n }\n\n toString() {\n return \"Texture(\".concat(this.id, \",\").concat(this.width, \"x\").concat(this.height, \")\");\n }\n\n initialize() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let data = props.data;\n\n if (data instanceof Promise) {\n data.then(resolvedImageData => this.initialize(Object.assign({}, props, {\n pixels: resolvedImageData,\n data: resolvedImageData\n })));\n return this;\n }\n\n const isVideo = typeof HTMLVideoElement !== 'undefined' && data instanceof HTMLVideoElement;\n\n if (isVideo && data.readyState < HTMLVideoElement.HAVE_METADATA) {\n this._video = null;\n data.addEventListener('loadeddata', () => this.initialize(props));\n return this;\n }\n\n const {\n pixels = null,\n format = 6408,\n border = 0,\n recreate = false,\n parameters = {},\n pixelStore = {},\n textureUnit = undefined\n } = props;\n\n if (!data) {\n data = pixels;\n }\n\n let {\n width,\n height,\n dataFormat,\n type,\n compressed = false,\n mipmaps = true\n } = props;\n const {\n depth = 0\n } = props;\n ({\n width,\n height,\n compressed,\n dataFormat,\n type\n } = this._deduceParameters({\n format,\n type,\n dataFormat,\n compressed,\n data,\n width,\n height\n }));\n this.width = width;\n this.height = height;\n this.depth = depth;\n this.format = format;\n this.type = type;\n this.dataFormat = dataFormat;\n this.border = border;\n this.textureUnit = textureUnit;\n\n if (Number.isFinite(this.textureUnit)) {\n this.gl.activeTexture(33984 + this.textureUnit);\n this.gl.bindTexture(this.target, this.handle);\n }\n\n if (mipmaps && this._isNPOT()) {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.warn(\"texture: \".concat(this, \" is Non-Power-Of-Two, disabling mipmaping\"))();\n mipmaps = false;\n\n this._updateForNPOT(parameters);\n }\n\n this.mipmaps = mipmaps;\n this.setImageData({\n data,\n width,\n height,\n depth,\n format,\n type,\n dataFormat,\n border,\n mipmaps,\n parameters: pixelStore,\n compressed\n });\n\n if (mipmaps) {\n this.generateMipmap();\n }\n\n this.setParameters(parameters);\n\n if (recreate) {\n this.data = data;\n }\n\n if (isVideo) {\n this._video = {\n video: data,\n parameters,\n lastTime: data.readyState >= HTMLVideoElement.HAVE_CURRENT_DATA ? data.currentTime : -1\n };\n }\n\n return this;\n }\n\n update() {\n if (this._video) {\n const {\n video,\n parameters,\n lastTime\n } = this._video;\n\n if (lastTime === video.currentTime || video.readyState < HTMLVideoElement.HAVE_CURRENT_DATA) {\n return;\n }\n\n this.setSubImageData({\n data: video,\n parameters\n });\n\n if (this.mipmaps) {\n this.generateMipmap();\n }\n\n this._video.lastTime = video.currentTime;\n }\n }\n\n resize(_ref) {\n let {\n height,\n width,\n mipmaps = false\n } = _ref;\n\n if (width !== this.width || height !== this.height) {\n return this.initialize({\n width,\n height,\n format: this.format,\n type: this.type,\n dataFormat: this.dataFormat,\n border: this.border,\n mipmaps\n });\n }\n\n return this;\n }\n\n generateMipmap() {\n let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (this._isNPOT()) {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.warn(\"texture: \".concat(this, \" is Non-Power-Of-Two, disabling mipmaping\"))();\n return this;\n }\n\n this.mipmaps = true;\n this.gl.bindTexture(this.target, this.handle);\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.withParameters)(this.gl, params, () => {\n this.gl.generateMipmap(this.target);\n });\n this.gl.bindTexture(this.target, null);\n return this;\n }\n\n setImageData(options) {\n this._trackDeallocatedMemory('Texture');\n\n const {\n target = this.target,\n pixels = null,\n level = 0,\n format = this.format,\n border = this.border,\n offset = 0,\n parameters = {}\n } = options;\n let {\n data = null,\n type = this.type,\n width = this.width,\n height = this.height,\n dataFormat = this.dataFormat,\n compressed = false\n } = options;\n\n if (!data) {\n data = pixels;\n }\n\n ({\n type,\n dataFormat,\n compressed,\n width,\n height\n } = this._deduceParameters({\n format,\n type,\n dataFormat,\n compressed,\n data,\n width,\n height\n }));\n const {\n gl\n } = this;\n gl.bindTexture(this.target, this.handle);\n let dataType = null;\n ({\n data,\n dataType\n } = this._getDataType({\n data,\n compressed\n }));\n let gl2;\n let compressedTextureSize = 0;\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.withParameters)(this.gl, parameters, () => {\n switch (dataType) {\n case 'null':\n gl.texImage2D(target, level, format, width, height, border, dataFormat, type, data);\n break;\n\n case 'typed-array':\n gl.texImage2D(target, level, format, width, height, border, dataFormat, type, data, offset);\n break;\n\n case 'buffer':\n gl2 = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(gl);\n gl2.bindBuffer(35052, data.handle || data);\n gl2.texImage2D(target, level, format, width, height, border, dataFormat, type, offset);\n gl2.bindBuffer(35052, null);\n break;\n\n case 'browser-object':\n if ((0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl)) {\n gl.texImage2D(target, level, format, width, height, border, dataFormat, type, data);\n } else {\n gl.texImage2D(target, level, format, dataFormat, type, data);\n }\n\n break;\n\n case 'compressed':\n for (const [levelIndex, levelData] of data.entries()) {\n gl.compressedTexImage2D(target, levelIndex, levelData.format, levelData.width, levelData.height, border, levelData.data);\n compressedTextureSize += levelData.levelSize;\n }\n\n break;\n\n default:\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_4__.assert)(false, 'Unknown image data type');\n }\n });\n\n if (dataType === 'compressed') {\n this._trackAllocatedMemory(compressedTextureSize, 'Texture');\n } else if (data && data.byteLength) {\n this._trackAllocatedMemory(data.byteLength, 'Texture');\n } else {\n const channels = _texture_formats__WEBPACK_IMPORTED_MODULE_2__.DATA_FORMAT_CHANNELS[this.dataFormat] || 4;\n const channelSize = _texture_formats__WEBPACK_IMPORTED_MODULE_2__.TYPE_SIZES[this.type] || 1;\n\n this._trackAllocatedMemory(this.width * this.height * channels * channelSize, 'Texture');\n }\n\n this.loaded = true;\n return this;\n }\n\n setSubImageData(_ref2) {\n let {\n target = this.target,\n pixels = null,\n data = null,\n x = 0,\n y = 0,\n width = this.width,\n height = this.height,\n level = 0,\n format = this.format,\n type = this.type,\n dataFormat = this.dataFormat,\n compressed = false,\n offset = 0,\n border = this.border,\n parameters = {}\n } = _ref2;\n ({\n type,\n dataFormat,\n compressed,\n width,\n height\n } = this._deduceParameters({\n format,\n type,\n dataFormat,\n compressed,\n data,\n width,\n height\n }));\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_4__.assert)(this.depth === 0, 'texSubImage not supported for 3D textures');\n\n if (!data) {\n data = pixels;\n }\n\n if (data && data.data) {\n const ndarray = data;\n data = ndarray.data;\n width = ndarray.shape[0];\n height = ndarray.shape[1];\n }\n\n if (data instanceof _buffer__WEBPACK_IMPORTED_MODULE_5__[\"default\"]) {\n data = data.handle;\n }\n\n this.gl.bindTexture(this.target, this.handle);\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.withParameters)(this.gl, parameters, () => {\n if (compressed) {\n this.gl.compressedTexSubImage2D(target, level, x, y, width, height, format, data);\n } else if (data === null) {\n this.gl.texSubImage2D(target, level, x, y, width, height, dataFormat, type, null);\n } else if (ArrayBuffer.isView(data)) {\n this.gl.texSubImage2D(target, level, x, y, width, height, dataFormat, type, data, offset);\n } else if (data instanceof WebGLBuffer) {\n const gl2 = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(this.gl);\n gl2.bindBuffer(35052, data);\n gl2.texSubImage2D(target, level, x, y, width, height, dataFormat, type, offset);\n gl2.bindBuffer(35052, null);\n } else if ((0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(this.gl)) {\n const gl2 = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(this.gl);\n gl2.texSubImage2D(target, level, x, y, width, height, dataFormat, type, data);\n } else {\n this.gl.texSubImage2D(target, level, x, y, dataFormat, type, data);\n }\n });\n this.gl.bindTexture(this.target, null);\n }\n\n copyFramebuffer() {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.error('Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})')();\n return null;\n }\n\n getActiveUnit() {\n return this.gl.getParameter(34016) - 33984;\n }\n\n bind() {\n let textureUnit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.textureUnit;\n const {\n gl\n } = this;\n\n if (textureUnit !== undefined) {\n this.textureUnit = textureUnit;\n gl.activeTexture(33984 + textureUnit);\n }\n\n gl.bindTexture(this.target, this.handle);\n return textureUnit;\n }\n\n unbind() {\n let textureUnit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.textureUnit;\n const {\n gl\n } = this;\n\n if (textureUnit !== undefined) {\n this.textureUnit = textureUnit;\n gl.activeTexture(33984 + textureUnit);\n }\n\n gl.bindTexture(this.target, null);\n return textureUnit;\n }\n\n _getDataType(_ref3) {\n let {\n data,\n compressed = false\n } = _ref3;\n\n if (compressed) {\n return {\n data,\n dataType: 'compressed'\n };\n }\n\n if (data === null) {\n return {\n data,\n dataType: 'null'\n };\n }\n\n if (ArrayBuffer.isView(data)) {\n return {\n data,\n dataType: 'typed-array'\n };\n }\n\n if (data instanceof _buffer__WEBPACK_IMPORTED_MODULE_5__[\"default\"]) {\n return {\n data: data.handle,\n dataType: 'buffer'\n };\n }\n\n if (data instanceof WebGLBuffer) {\n return {\n data,\n dataType: 'buffer'\n };\n }\n\n return {\n data,\n dataType: 'browser-object'\n };\n }\n\n _deduceParameters(opts) {\n const {\n format,\n data\n } = opts;\n let {\n width,\n height,\n dataFormat,\n type,\n compressed\n } = opts;\n const textureFormat = _texture_formats__WEBPACK_IMPORTED_MODULE_2__.TEXTURE_FORMATS[format];\n dataFormat = dataFormat || textureFormat && textureFormat.dataFormat;\n type = type || textureFormat && textureFormat.types[0];\n compressed = compressed || textureFormat && textureFormat.compressed;\n ({\n width,\n height\n } = this._deduceImageSize(data, width, height));\n return {\n dataFormat,\n type,\n compressed,\n width,\n height,\n format,\n data\n };\n }\n\n _deduceImageSize(data, width, height) {\n let size;\n\n if (typeof ImageData !== 'undefined' && data instanceof ImageData) {\n size = {\n width: data.width,\n height: data.height\n };\n } else if (typeof HTMLImageElement !== 'undefined' && data instanceof HTMLImageElement) {\n size = {\n width: data.naturalWidth,\n height: data.naturalHeight\n };\n } else if (typeof HTMLCanvasElement !== 'undefined' && data instanceof HTMLCanvasElement) {\n size = {\n width: data.width,\n height: data.height\n };\n } else if (typeof ImageBitmap !== 'undefined' && data instanceof ImageBitmap) {\n size = {\n width: data.width,\n height: data.height\n };\n } else if (typeof HTMLVideoElement !== 'undefined' && data instanceof HTMLVideoElement) {\n size = {\n width: data.videoWidth,\n height: data.videoHeight\n };\n } else if (!data) {\n size = {\n width: width >= 0 ? width : 1,\n height: height >= 0 ? height : 1\n };\n } else {\n size = {\n width,\n height\n };\n }\n\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_4__.assert)(size, 'Could not deduced texture size');\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_4__.assert)(width === undefined || size.width === width, 'Deduced texture width does not match supplied width');\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_4__.assert)(height === undefined || size.height === height, 'Deduced texture height does not match supplied height');\n return size;\n }\n\n _createHandle() {\n return this.gl.createTexture();\n }\n\n _deleteHandle() {\n this.gl.deleteTexture(this.handle);\n\n this._trackDeallocatedMemory('Texture');\n }\n\n _getParameter(pname) {\n switch (pname) {\n case 4096:\n return this.width;\n\n case 4097:\n return this.height;\n\n default:\n this.gl.bindTexture(this.target, this.handle);\n const value = this.gl.getTexParameter(this.target, pname);\n this.gl.bindTexture(this.target, null);\n return value;\n }\n }\n\n _setParameter(pname, param) {\n this.gl.bindTexture(this.target, this.handle);\n param = this._getNPOTParam(pname, param);\n\n switch (pname) {\n case 33082:\n case 33083:\n this.gl.texParameterf(this.handle, pname, param);\n break;\n\n case 4096:\n case 4097:\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_4__.assert)(false);\n break;\n\n default:\n this.gl.texParameteri(this.target, pname, param);\n break;\n }\n\n this.gl.bindTexture(this.target, null);\n return this;\n }\n\n _isNPOT() {\n if ((0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(this.gl)) {\n return false;\n }\n\n if (!this.width || !this.height) {\n return false;\n }\n\n return !(0,_utils_utils__WEBPACK_IMPORTED_MODULE_3__.isPowerOfTwo)(this.width) || !(0,_utils_utils__WEBPACK_IMPORTED_MODULE_3__.isPowerOfTwo)(this.height);\n }\n\n _updateForNPOT(parameters) {\n if (parameters[this.gl.TEXTURE_MIN_FILTER] === undefined) {\n parameters[this.gl.TEXTURE_MIN_FILTER] = this.gl.LINEAR;\n }\n\n if (parameters[this.gl.TEXTURE_WRAP_S] === undefined) {\n parameters[this.gl.TEXTURE_WRAP_S] = this.gl.CLAMP_TO_EDGE;\n }\n\n if (parameters[this.gl.TEXTURE_WRAP_T] === undefined) {\n parameters[this.gl.TEXTURE_WRAP_T] = this.gl.CLAMP_TO_EDGE;\n }\n }\n\n _getNPOTParam(pname, param) {\n if (this._isNPOT()) {\n switch (pname) {\n case 10241:\n if (NPOT_MIN_FILTERS.indexOf(param) === -1) {\n param = 9729;\n }\n\n break;\n\n case 10242:\n case 10243:\n if (param !== 33071) {\n param = 33071;\n }\n\n break;\n\n default:\n break;\n }\n }\n\n return param;\n }\n\n}\n//# sourceMappingURL=texture.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/texture.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/transform-feedback.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/transform-feedback.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ TransformFeedback)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _resource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resource */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/resource.js\");\n/* harmony import */ var _buffer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./buffer */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/buffer.js\");\n/* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/utils */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/utils.js\");\n\n\n\n\nclass TransformFeedback extends _resource__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n get [Symbol.toStringTag]() {\n return 'TransformFeedback';\n }\n\n static isSupported(gl) {\n return (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl);\n }\n\n constructor(gl) {\n let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.assertWebGL2Context)(gl);\n super(gl, props);\n this.initialize(props);\n this.stubRemovedMethods('TransformFeedback', 'v6.0', ['pause', 'resume']);\n Object.seal(this);\n }\n\n initialize() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.buffers = {};\n this.unused = {};\n this.configuration = null;\n this.bindOnUse = true;\n\n if (!(0,_utils_utils__WEBPACK_IMPORTED_MODULE_2__.isObjectEmpty)(this.buffers)) {\n this.bind(() => this._unbindBuffers());\n }\n\n this.setProps(props);\n return this;\n }\n\n setProps(props) {\n if ('program' in props) {\n this.configuration = props.program && props.program.configuration;\n }\n\n if ('configuration' in props) {\n this.configuration = props.configuration;\n }\n\n if ('bindOnUse' in props) {\n props = props.bindOnUse;\n }\n\n if ('buffers' in props) {\n this.setBuffers(props.buffers);\n }\n }\n\n setBuffers() {\n let buffers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.bind(() => {\n for (const bufferName in buffers) {\n this.setBuffer(bufferName, buffers[bufferName]);\n }\n });\n return this;\n }\n\n setBuffer(locationOrName, bufferOrParams) {\n const location = this._getVaryingIndex(locationOrName);\n\n const {\n buffer,\n byteSize,\n byteOffset\n } = this._getBufferParams(bufferOrParams);\n\n if (location < 0) {\n this.unused[locationOrName] = buffer;\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.warn(\"\".concat(this.id, \" unused varying buffer \").concat(locationOrName))();\n return this;\n }\n\n this.buffers[location] = bufferOrParams;\n\n if (!this.bindOnUse) {\n this._bindBuffer(location, buffer, byteOffset, byteSize);\n }\n\n return this;\n }\n\n begin() {\n let primitiveMode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n this.gl.bindTransformFeedback(36386, this.handle);\n\n this._bindBuffers();\n\n this.gl.beginTransformFeedback(primitiveMode);\n return this;\n }\n\n end() {\n this.gl.endTransformFeedback();\n\n this._unbindBuffers();\n\n this.gl.bindTransformFeedback(36386, null);\n return this;\n }\n\n _getBufferParams(bufferOrParams) {\n let byteOffset;\n let byteSize;\n let buffer;\n\n if (bufferOrParams instanceof _buffer__WEBPACK_IMPORTED_MODULE_3__[\"default\"] === false) {\n buffer = bufferOrParams.buffer;\n byteSize = bufferOrParams.byteSize;\n byteOffset = bufferOrParams.byteOffset;\n } else {\n buffer = bufferOrParams;\n }\n\n if (byteOffset !== undefined || byteSize !== undefined) {\n byteOffset = byteOffset || 0;\n byteSize = byteSize || buffer.byteLength - byteOffset;\n }\n\n return {\n buffer,\n byteOffset,\n byteSize\n };\n }\n\n _getVaryingInfo(locationOrName) {\n return this.configuration && this.configuration.getVaryingInfo(locationOrName);\n }\n\n _getVaryingIndex(locationOrName) {\n if (this.configuration) {\n return this.configuration.getVaryingInfo(locationOrName).location;\n }\n\n const location = Number(locationOrName);\n return Number.isFinite(location) ? location : -1;\n }\n\n _bindBuffers() {\n if (this.bindOnUse) {\n for (const bufferIndex in this.buffers) {\n const {\n buffer,\n byteSize,\n byteOffset\n } = this._getBufferParams(this.buffers[bufferIndex]);\n\n this._bindBuffer(bufferIndex, buffer, byteOffset, byteSize);\n }\n }\n }\n\n _unbindBuffers() {\n if (this.bindOnUse) {\n for (const bufferIndex in this.buffers) {\n this._bindBuffer(bufferIndex, null);\n }\n }\n }\n\n _bindBuffer(index, buffer) {\n let byteOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n let byteSize = arguments.length > 3 ? arguments[3] : undefined;\n const handle = buffer && buffer.handle;\n\n if (!handle || byteSize === undefined) {\n this.gl.bindBufferBase(35982, index, handle);\n } else {\n this.gl.bindBufferRange(35982, index, handle, byteOffset, byteSize);\n }\n\n return this;\n }\n\n _createHandle() {\n return this.gl.createTransformFeedback();\n }\n\n _deleteHandle() {\n this.gl.deleteTransformFeedback(this.handle);\n }\n\n _bindHandle(handle) {\n this.gl.bindTransformFeedback(36386, this.handle);\n }\n\n}\n//# sourceMappingURL=transform-feedback.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/transform-feedback.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/uniforms.js": +/*!******************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/uniforms.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ checkUniformValues: () => (/* binding */ checkUniformValues),\n/* harmony export */ copyUniform: () => (/* binding */ copyUniform),\n/* harmony export */ getUniformSetter: () => (/* binding */ getUniformSetter),\n/* harmony export */ parseUniformName: () => (/* binding */ parseUniformName)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _framebuffer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./framebuffer */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/framebuffer.js\");\n/* harmony import */ var _renderbuffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./renderbuffer */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/renderbuffer.js\");\n/* harmony import */ var _texture__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./texture */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n\n\n\n\n\nconst UNIFORM_SETTERS = {\n [5126]: getArraySetter.bind(null, 'uniform1fv', toFloatArray, 1, setVectorUniform),\n [35664]: getArraySetter.bind(null, 'uniform2fv', toFloatArray, 2, setVectorUniform),\n [35665]: getArraySetter.bind(null, 'uniform3fv', toFloatArray, 3, setVectorUniform),\n [35666]: getArraySetter.bind(null, 'uniform4fv', toFloatArray, 4, setVectorUniform),\n [5124]: getArraySetter.bind(null, 'uniform1iv', toIntArray, 1, setVectorUniform),\n [35667]: getArraySetter.bind(null, 'uniform2iv', toIntArray, 2, setVectorUniform),\n [35668]: getArraySetter.bind(null, 'uniform3iv', toIntArray, 3, setVectorUniform),\n [35669]: getArraySetter.bind(null, 'uniform4iv', toIntArray, 4, setVectorUniform),\n [35670]: getArraySetter.bind(null, 'uniform1iv', toIntArray, 1, setVectorUniform),\n [35671]: getArraySetter.bind(null, 'uniform2iv', toIntArray, 2, setVectorUniform),\n [35672]: getArraySetter.bind(null, 'uniform3iv', toIntArray, 3, setVectorUniform),\n [35673]: getArraySetter.bind(null, 'uniform4iv', toIntArray, 4, setVectorUniform),\n [35674]: getArraySetter.bind(null, 'uniformMatrix2fv', toFloatArray, 4, setMatrixUniform),\n [35675]: getArraySetter.bind(null, 'uniformMatrix3fv', toFloatArray, 9, setMatrixUniform),\n [35676]: getArraySetter.bind(null, 'uniformMatrix4fv', toFloatArray, 16, setMatrixUniform),\n [35678]: getSamplerSetter,\n [35680]: getSamplerSetter,\n [5125]: getArraySetter.bind(null, 'uniform1uiv', toUIntArray, 1, setVectorUniform),\n [36294]: getArraySetter.bind(null, 'uniform2uiv', toUIntArray, 2, setVectorUniform),\n [36295]: getArraySetter.bind(null, 'uniform3uiv', toUIntArray, 3, setVectorUniform),\n [36296]: getArraySetter.bind(null, 'uniform4uiv', toUIntArray, 4, setVectorUniform),\n [35685]: getArraySetter.bind(null, 'uniformMatrix2x3fv', toFloatArray, 6, setMatrixUniform),\n [35686]: getArraySetter.bind(null, 'uniformMatrix2x4fv', toFloatArray, 8, setMatrixUniform),\n [35687]: getArraySetter.bind(null, 'uniformMatrix3x2fv', toFloatArray, 6, setMatrixUniform),\n [35688]: getArraySetter.bind(null, 'uniformMatrix3x4fv', toFloatArray, 12, setMatrixUniform),\n [35689]: getArraySetter.bind(null, 'uniformMatrix4x2fv', toFloatArray, 8, setMatrixUniform),\n [35690]: getArraySetter.bind(null, 'uniformMatrix4x3fv', toFloatArray, 12, setMatrixUniform),\n [35678]: getSamplerSetter,\n [35680]: getSamplerSetter,\n [35679]: getSamplerSetter,\n [35682]: getSamplerSetter,\n [36289]: getSamplerSetter,\n [36292]: getSamplerSetter,\n [36293]: getSamplerSetter,\n [36298]: getSamplerSetter,\n [36299]: getSamplerSetter,\n [36300]: getSamplerSetter,\n [36303]: getSamplerSetter,\n [36306]: getSamplerSetter,\n [36307]: getSamplerSetter,\n [36308]: getSamplerSetter,\n [36311]: getSamplerSetter\n};\nconst FLOAT_ARRAY = {};\nconst INT_ARRAY = {};\nconst UINT_ARRAY = {};\nconst array1 = [0];\n\nfunction toTypedArray(value, uniformLength, Type, cache) {\n if (uniformLength === 1 && typeof value === 'boolean') {\n value = value ? 1 : 0;\n }\n\n if (Number.isFinite(value)) {\n array1[0] = value;\n value = array1;\n }\n\n const length = value.length;\n\n if (length % uniformLength) {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.warn(\"Uniform size should be multiples of \".concat(uniformLength), value)();\n }\n\n if (value instanceof Type) {\n return value;\n }\n\n let result = cache[length];\n\n if (!result) {\n result = new Type(length);\n cache[length] = result;\n }\n\n for (let i = 0; i < length; i++) {\n result[i] = value[i];\n }\n\n return result;\n}\n\nfunction toFloatArray(value, uniformLength) {\n return toTypedArray(value, uniformLength, Float32Array, FLOAT_ARRAY);\n}\n\nfunction toIntArray(value, uniformLength) {\n return toTypedArray(value, uniformLength, Int32Array, INT_ARRAY);\n}\n\nfunction toUIntArray(value, uniformLength) {\n return toTypedArray(value, uniformLength, Uint32Array, UINT_ARRAY);\n}\n\nfunction getUniformSetter(gl, location, info) {\n const setter = UNIFORM_SETTERS[info.type];\n\n if (!setter) {\n throw new Error(\"Unknown GLSL uniform type \".concat(info.type));\n }\n\n return setter().bind(null, gl, location);\n}\nfunction parseUniformName(name) {\n if (name[name.length - 1] !== ']') {\n return {\n name,\n length: 1,\n isArray: false\n };\n }\n\n const UNIFORM_NAME_REGEXP = /([^[]*)(\\[[0-9]+\\])?/;\n const matches = name.match(UNIFORM_NAME_REGEXP);\n\n if (!matches || matches.length < 2) {\n throw new Error(\"Failed to parse GLSL uniform name \".concat(name));\n }\n\n return {\n name: matches[1],\n length: matches[2] || 1,\n isArray: Boolean(matches[2])\n };\n}\nfunction checkUniformValues(uniforms, source, uniformMap) {\n for (const uniformName in uniforms) {\n const value = uniforms[uniformName];\n const shouldCheck = !uniformMap || Boolean(uniformMap[uniformName]);\n\n if (shouldCheck && !checkUniformValue(value)) {\n source = source ? \"\".concat(source, \" \") : '';\n console.error(\"\".concat(source, \" Bad uniform \").concat(uniformName), value);\n throw new Error(\"\".concat(source, \" Bad uniform \").concat(uniformName));\n }\n }\n\n return true;\n}\n\nfunction checkUniformValue(value) {\n if (Array.isArray(value) || ArrayBuffer.isView(value)) {\n return checkUniformArray(value);\n }\n\n if (isFinite(value)) {\n return true;\n } else if (value === true || value === false) {\n return true;\n } else if (value instanceof _texture__WEBPACK_IMPORTED_MODULE_1__[\"default\"]) {\n return true;\n } else if (value instanceof _renderbuffer__WEBPACK_IMPORTED_MODULE_2__[\"default\"]) {\n return true;\n } else if (value instanceof _framebuffer__WEBPACK_IMPORTED_MODULE_3__[\"default\"]) {\n return Boolean(value.texture);\n }\n\n return false;\n}\n\nfunction copyUniform(uniforms, key, value) {\n if (Array.isArray(value) || ArrayBuffer.isView(value)) {\n if (uniforms[key]) {\n const dest = uniforms[key];\n\n for (let i = 0, len = value.length; i < len; ++i) {\n dest[i] = value[i];\n }\n } else {\n uniforms[key] = value.slice();\n }\n } else {\n uniforms[key] = value;\n }\n}\n\nfunction checkUniformArray(value) {\n if (value.length === 0) {\n return false;\n }\n\n const checkLength = Math.min(value.length, 16);\n\n for (let i = 0; i < checkLength; ++i) {\n if (!Number.isFinite(value[i])) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction getSamplerSetter() {\n let cache = null;\n return (gl, location, value) => {\n const update = cache !== value;\n\n if (update) {\n gl.uniform1i(location, value);\n cache = value;\n }\n\n return update;\n };\n}\n\nfunction getArraySetter(functionName, toArray, size, uniformSetter) {\n let cache = null;\n let cacheLength = null;\n return (gl, location, value) => {\n const arrayValue = toArray(value, size);\n const length = arrayValue.length;\n let update = false;\n\n if (cache === null) {\n cache = new Float32Array(length);\n cacheLength = length;\n update = true;\n } else {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_4__.assert)(cacheLength === length, 'Uniform length cannot change.');\n\n for (let i = 0; i < length; ++i) {\n if (arrayValue[i] !== cache[i]) {\n update = true;\n break;\n }\n }\n }\n\n if (update) {\n uniformSetter(gl, functionName, location, arrayValue);\n cache.set(arrayValue);\n }\n\n return update;\n };\n}\n\nfunction setVectorUniform(gl, functionName, location, value) {\n gl[functionName](location, value);\n}\n\nfunction setMatrixUniform(gl, functionName, location, value) {\n gl[functionName](location, false, value);\n}\n//# sourceMappingURL=uniforms.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/uniforms.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/vertex-array-object.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/vertex-array-object.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ VertexArrayObject)\n/* harmony export */ });\n/* harmony import */ var _resource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resource */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/resource.js\");\n/* harmony import */ var _buffer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./buffer */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/buffer.js\");\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _utils_array_utils_flat__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/array-utils-flat */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/array-utils-flat.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n/* harmony import */ var _probe_gl_env__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @probe.gl/env */ \"./node_modules/@probe.gl/env/dist/esm/lib/get-browser.js\");\n\n\n\n\n\n\nconst ERR_ELEMENTS = 'elements must be GL.ELEMENT_ARRAY_BUFFER';\nclass VertexArrayObject extends _resource__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n get [Symbol.toStringTag]() {\n return 'VertexArrayObject';\n }\n\n static isSupported(gl) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (options.constantAttributeZero) {\n return (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl) || (0,_probe_gl_env__WEBPACK_IMPORTED_MODULE_2__[\"default\"])() === 'Chrome';\n }\n\n return true;\n }\n\n static getDefaultArray(gl) {\n gl.luma = gl.luma || {};\n\n if (!gl.luma.defaultVertexArray) {\n gl.luma.defaultVertexArray = new VertexArrayObject(gl, {\n handle: null,\n isDefaultArray: true\n });\n }\n\n return gl.luma.defaultVertexArray;\n }\n\n static getMaxAttributes(gl) {\n VertexArrayObject.MAX_ATTRIBUTES = VertexArrayObject.MAX_ATTRIBUTES || gl.getParameter(34921);\n return VertexArrayObject.MAX_ATTRIBUTES;\n }\n\n static setConstant(gl, location, array) {\n switch (array.constructor) {\n case Float32Array:\n VertexArrayObject._setConstantFloatArray(gl, location, array);\n\n break;\n\n case Int32Array:\n VertexArrayObject._setConstantIntArray(gl, location, array);\n\n break;\n\n case Uint32Array:\n VertexArrayObject._setConstantUintArray(gl, location, array);\n\n break;\n\n default:\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__.assert)(false);\n }\n }\n\n constructor(gl) {\n let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const id = opts.id || opts.program && opts.program.id;\n super(gl, Object.assign({}, opts, {\n id\n }));\n this.buffer = null;\n this.bufferValue = null;\n this.isDefaultArray = opts.isDefaultArray || false;\n this.gl2 = gl;\n this.initialize(opts);\n Object.seal(this);\n }\n\n delete() {\n super.delete();\n\n if (this.buffer) {\n this.buffer.delete();\n }\n\n return this;\n }\n\n get MAX_ATTRIBUTES() {\n return VertexArrayObject.getMaxAttributes(this.gl);\n }\n\n initialize() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return this.setProps(props);\n }\n\n setProps(props) {\n return this;\n }\n\n setElementBuffer() {\n let elementBuffer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__.assert)(!elementBuffer || elementBuffer.target === 34963, ERR_ELEMENTS);\n this.bind(() => {\n this.gl.bindBuffer(34963, elementBuffer ? elementBuffer.handle : null);\n });\n return this;\n }\n\n setBuffer(location, buffer, accessor) {\n if (buffer.target === 34963) {\n return this.setElementBuffer(buffer, accessor);\n }\n\n const {\n size,\n type,\n stride,\n offset,\n normalized,\n integer,\n divisor\n } = accessor;\n const {\n gl,\n gl2\n } = this;\n location = Number(location);\n this.bind(() => {\n gl.bindBuffer(34962, buffer.handle);\n\n if (integer) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__.assert)((0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl));\n gl2.vertexAttribIPointer(location, size, type, stride, offset);\n } else {\n gl.vertexAttribPointer(location, size, type, normalized, stride, offset);\n }\n\n gl.enableVertexAttribArray(location);\n gl2.vertexAttribDivisor(location, divisor || 0);\n });\n return this;\n }\n\n enable(location) {\n let enable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n const disablingAttributeZero = !enable && location === 0 && !VertexArrayObject.isSupported(this.gl, {\n constantAttributeZero: true\n });\n\n if (!disablingAttributeZero) {\n location = Number(location);\n this.bind(() => enable ? this.gl.enableVertexAttribArray(location) : this.gl.disableVertexAttribArray(location));\n }\n\n return this;\n }\n\n getConstantBuffer(elementCount, value) {\n const constantValue = this._normalizeConstantArrayValue(value);\n\n const byteLength = constantValue.byteLength * elementCount;\n const length = constantValue.length * elementCount;\n let updateNeeded = !this.buffer;\n this.buffer = this.buffer || new _buffer__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this.gl, byteLength);\n updateNeeded = updateNeeded || this.buffer.reallocate(byteLength);\n updateNeeded = updateNeeded || !this._compareConstantArrayValues(constantValue, this.bufferValue);\n\n if (updateNeeded) {\n const typedArray = (0,_utils_array_utils_flat__WEBPACK_IMPORTED_MODULE_5__.getScratchArray)(value.constructor, length);\n (0,_utils_array_utils_flat__WEBPACK_IMPORTED_MODULE_5__.fillArray)({\n target: typedArray,\n source: constantValue,\n start: 0,\n count: length\n });\n this.buffer.subData(typedArray);\n this.bufferValue = value;\n }\n\n return this.buffer;\n }\n\n _normalizeConstantArrayValue(arrayValue) {\n if (Array.isArray(arrayValue)) {\n return new Float32Array(arrayValue);\n }\n\n return arrayValue;\n }\n\n _compareConstantArrayValues(v1, v2) {\n if (!v1 || !v2 || v1.length !== v2.length || v1.constructor !== v2.constructor) {\n return false;\n }\n\n for (let i = 0; i < v1.length; ++i) {\n if (v1[i] !== v2[i]) {\n return false;\n }\n }\n\n return true;\n }\n\n static _setConstantFloatArray(gl, location, array) {\n switch (array.length) {\n case 1:\n gl.vertexAttrib1fv(location, array);\n break;\n\n case 2:\n gl.vertexAttrib2fv(location, array);\n break;\n\n case 3:\n gl.vertexAttrib3fv(location, array);\n break;\n\n case 4:\n gl.vertexAttrib4fv(location, array);\n break;\n\n default:\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__.assert)(false);\n }\n }\n\n static _setConstantIntArray(gl, location, array) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__.assert)((0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl));\n\n switch (array.length) {\n case 1:\n gl.vertexAttribI1iv(location, array);\n break;\n\n case 2:\n gl.vertexAttribI2iv(location, array);\n break;\n\n case 3:\n gl.vertexAttribI3iv(location, array);\n break;\n\n case 4:\n gl.vertexAttribI4iv(location, array);\n break;\n\n default:\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__.assert)(false);\n }\n }\n\n static _setConstantUintArray(gl, location, array) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__.assert)((0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl));\n\n switch (array.length) {\n case 1:\n gl.vertexAttribI1uiv(location, array);\n break;\n\n case 2:\n gl.vertexAttribI2uiv(location, array);\n break;\n\n case 3:\n gl.vertexAttribI3uiv(location, array);\n break;\n\n case 4:\n gl.vertexAttribI4uiv(location, array);\n break;\n\n default:\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__.assert)(false);\n }\n }\n\n _createHandle() {\n const gl2 = this.gl;\n return gl2.createVertexArray();\n }\n\n _deleteHandle(handle) {\n this.gl2.deleteVertexArray(handle);\n return [this.elements];\n }\n\n _bindHandle(handle) {\n this.gl2.bindVertexArray(handle);\n }\n\n _getParameter(pname, _ref) {\n let {\n location\n } = _ref;\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_3__.assert)(Number.isFinite(location));\n return this.bind(() => {\n switch (pname) {\n case 34373:\n return this.gl.getVertexAttribOffset(location, pname);\n\n default:\n return this.gl.getVertexAttrib(location, pname);\n }\n });\n }\n\n}\n//# sourceMappingURL=vertex-array-object.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/vertex-array-object.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/classes/vertex-array.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/classes/vertex-array.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ VertexArray)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _accessor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./accessor */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/accessor.js\");\n/* harmony import */ var _buffer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./buffer */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/buffer.js\");\n/* harmony import */ var _vertex_array_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./vertex-array-object */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/vertex-array-object.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n/* harmony import */ var _utils_stub_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/stub-methods */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/stub-methods.js\");\n\n\n\n\n\n\nconst ERR_ATTRIBUTE_TYPE = 'VertexArray: attributes must be Buffers or constants (i.e. typed array)';\nconst MULTI_LOCATION_ATTRIBUTE_REGEXP = /^(.+)__LOCATION_([0-9]+)$/;\nconst DEPRECATIONS_V6 = ['setBuffers', 'setGeneric', 'clearBindings', 'setLocations', 'setGenericValues', 'setDivisor', 'enable', 'disable'];\nclass VertexArray {\n constructor(gl) {\n let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const id = opts.id || opts.program && opts.program.id;\n this.id = id;\n this.gl = gl;\n this.configuration = null;\n this.elements = null;\n this.elementsAccessor = null;\n this.values = null;\n this.accessors = null;\n this.unused = null;\n this.drawParams = null;\n this.buffer = null;\n this.attributes = {};\n this.vertexArrayObject = new _vertex_array_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"](gl);\n (0,_utils_stub_methods__WEBPACK_IMPORTED_MODULE_2__.stubRemovedMethods)(this, 'VertexArray', 'v6.0', DEPRECATIONS_V6);\n this.initialize(opts);\n Object.seal(this);\n }\n\n delete() {\n if (this.buffer) {\n this.buffer.delete();\n }\n\n this.vertexArrayObject.delete();\n }\n\n initialize() {\n let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.reset();\n this.configuration = null;\n this.bindOnUse = false;\n return this.setProps(props);\n }\n\n reset() {\n this.elements = null;\n this.elementsAccessor = null;\n const {\n MAX_ATTRIBUTES\n } = this.vertexArrayObject;\n this.values = new Array(MAX_ATTRIBUTES).fill(null);\n this.accessors = new Array(MAX_ATTRIBUTES).fill(null);\n this.unused = {};\n this.drawParams = null;\n return this;\n }\n\n setProps(props) {\n if ('program' in props) {\n this.configuration = props.program && props.program.configuration;\n }\n\n if ('configuration' in props) {\n this.configuration = props.configuration;\n }\n\n if ('attributes' in props) {\n this.setAttributes(props.attributes);\n }\n\n if ('elements' in props) {\n this.setElementBuffer(props.elements);\n }\n\n if ('bindOnUse' in props) {\n props = props.bindOnUse;\n }\n\n return this;\n }\n\n clearDrawParams() {\n this.drawParams = null;\n }\n\n getDrawParams() {\n this.drawParams = this.drawParams || this._updateDrawParams();\n return this.drawParams;\n }\n\n setAttributes(attributes) {\n Object.assign(this.attributes, attributes);\n this.vertexArrayObject.bind(() => {\n for (const locationOrName in attributes) {\n const value = attributes[locationOrName];\n\n this._setAttribute(locationOrName, value);\n }\n\n this.gl.bindBuffer(34962, null);\n });\n return this;\n }\n\n setElementBuffer() {\n let elementBuffer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n let accessor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.elements = elementBuffer;\n this.elementsAccessor = accessor;\n this.clearDrawParams();\n this.vertexArrayObject.setElementBuffer(elementBuffer, accessor);\n return this;\n }\n\n setBuffer(locationOrName, buffer) {\n let appAccessor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n if (buffer.target === 34963) {\n return this.setElementBuffer(buffer, appAccessor);\n }\n\n const {\n location,\n accessor\n } = this._resolveLocationAndAccessor(locationOrName, buffer, buffer.accessor, appAccessor);\n\n if (location >= 0) {\n this.values[location] = buffer;\n this.accessors[location] = accessor;\n this.clearDrawParams();\n this.vertexArrayObject.setBuffer(location, buffer, accessor);\n }\n\n return this;\n }\n\n setConstant(locationOrName, arrayValue) {\n let appAccessor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n const {\n location,\n accessor\n } = this._resolveLocationAndAccessor(locationOrName, arrayValue, Object.assign({\n size: arrayValue.length\n }, appAccessor));\n\n if (location >= 0) {\n arrayValue = this.vertexArrayObject._normalizeConstantArrayValue(arrayValue);\n this.values[location] = arrayValue;\n this.accessors[location] = accessor;\n this.clearDrawParams();\n this.vertexArrayObject.enable(location, false);\n }\n\n return this;\n }\n\n unbindBuffers() {\n this.vertexArrayObject.bind(() => {\n if (this.elements) {\n this.vertexArrayObject.setElementBuffer(null);\n }\n\n this.buffer = this.buffer || new _buffer__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.gl, {\n accessor: {\n size: 4\n }\n });\n\n for (let location = 0; location < this.vertexArrayObject.MAX_ATTRIBUTES; location++) {\n if (this.values[location] instanceof _buffer__WEBPACK_IMPORTED_MODULE_3__[\"default\"]) {\n this.gl.disableVertexAttribArray(location);\n this.gl.bindBuffer(34962, this.buffer.handle);\n this.gl.vertexAttribPointer(location, 1, 5126, false, 0, 0);\n }\n }\n });\n return this;\n }\n\n bindBuffers() {\n this.vertexArrayObject.bind(() => {\n if (this.elements) {\n this.setElementBuffer(this.elements);\n }\n\n for (let location = 0; location < this.vertexArrayObject.MAX_ATTRIBUTES; location++) {\n const buffer = this.values[location];\n\n if (buffer instanceof _buffer__WEBPACK_IMPORTED_MODULE_3__[\"default\"]) {\n this.setBuffer(location, buffer);\n }\n }\n });\n return this;\n }\n\n bindForDraw(vertexCount, instanceCount, func) {\n let value;\n this.vertexArrayObject.bind(() => {\n this._setConstantAttributes(vertexCount, instanceCount);\n\n value = func();\n });\n return value;\n }\n\n _resolveLocationAndAccessor(locationOrName, value, valueAccessor, appAccessor) {\n const INVALID_RESULT = {\n location: -1,\n accessor: null\n };\n\n const {\n location,\n name\n } = this._getAttributeIndex(locationOrName);\n\n if (!Number.isFinite(location) || location < 0) {\n this.unused[locationOrName] = value;\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.once(3, () => \"unused value \".concat(locationOrName, \" in \").concat(this.id))();\n return INVALID_RESULT;\n }\n\n const accessInfo = this._getAttributeInfo(name || location);\n\n if (!accessInfo) {\n return INVALID_RESULT;\n }\n\n const currentAccessor = this.accessors[location] || {};\n const accessor = _accessor__WEBPACK_IMPORTED_MODULE_4__[\"default\"].resolve(accessInfo.accessor, currentAccessor, valueAccessor, appAccessor);\n const {\n size,\n type\n } = accessor;\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_5__.assert)(Number.isFinite(size) && Number.isFinite(type));\n return {\n location,\n accessor\n };\n }\n\n _getAttributeInfo(attributeName) {\n return this.configuration && this.configuration.getAttributeInfo(attributeName);\n }\n\n _getAttributeIndex(locationOrName) {\n const location = Number(locationOrName);\n\n if (Number.isFinite(location)) {\n return {\n location\n };\n }\n\n const multiLocation = MULTI_LOCATION_ATTRIBUTE_REGEXP.exec(locationOrName);\n const name = multiLocation ? multiLocation[1] : locationOrName;\n const locationOffset = multiLocation ? Number(multiLocation[2]) : 0;\n\n if (this.configuration) {\n return {\n location: this.configuration.getAttributeLocation(name) + locationOffset,\n name\n };\n }\n\n return {\n location: -1\n };\n }\n\n _setAttribute(locationOrName, value) {\n if (value instanceof _buffer__WEBPACK_IMPORTED_MODULE_3__[\"default\"]) {\n this.setBuffer(locationOrName, value);\n } else if (Array.isArray(value) && value.length && value[0] instanceof _buffer__WEBPACK_IMPORTED_MODULE_3__[\"default\"]) {\n const buffer = value[0];\n const accessor = value[1];\n this.setBuffer(locationOrName, buffer, accessor);\n } else if (ArrayBuffer.isView(value) || Array.isArray(value)) {\n const constant = value;\n this.setConstant(locationOrName, constant);\n } else if (value.buffer instanceof _buffer__WEBPACK_IMPORTED_MODULE_3__[\"default\"]) {\n const accessor = value;\n this.setBuffer(locationOrName, accessor.buffer, accessor);\n } else {\n throw new Error(ERR_ATTRIBUTE_TYPE);\n }\n }\n\n _setConstantAttributes(vertexCount, instanceCount) {\n const elementCount = Math.max(vertexCount | 0, instanceCount | 0);\n let constant = this.values[0];\n\n if (ArrayBuffer.isView(constant)) {\n this._setConstantAttributeZero(constant, elementCount);\n }\n\n for (let location = 1; location < this.vertexArrayObject.MAX_ATTRIBUTES; location++) {\n constant = this.values[location];\n\n if (ArrayBuffer.isView(constant)) {\n this._setConstantAttribute(location, constant);\n }\n }\n }\n\n _setConstantAttributeZero(constant, elementCount) {\n if (_vertex_array_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isSupported(this.gl, {\n constantAttributeZero: true\n })) {\n this._setConstantAttribute(0, constant);\n\n return;\n }\n\n const buffer = this.vertexArrayObject.getConstantBuffer(elementCount, constant);\n this.vertexArrayObject.setBuffer(0, buffer, this.accessors[0]);\n }\n\n _setConstantAttribute(location, constant) {\n _vertex_array_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setConstant(this.gl, location, constant);\n }\n\n _updateDrawParams() {\n const drawParams = {\n isIndexed: false,\n isInstanced: false,\n indexCount: Infinity,\n vertexCount: Infinity,\n instanceCount: Infinity\n };\n\n for (let location = 0; location < this.vertexArrayObject.MAX_ATTRIBUTES; location++) {\n this._updateDrawParamsForLocation(drawParams, location);\n }\n\n if (this.elements) {\n drawParams.elementCount = this.elements.getElementCount(this.elements.accessor);\n drawParams.isIndexed = true;\n drawParams.indexType = this.elementsAccessor.type || this.elements.accessor.type;\n drawParams.indexOffset = this.elementsAccessor.offset || 0;\n }\n\n if (drawParams.indexCount === Infinity) {\n drawParams.indexCount = 0;\n }\n\n if (drawParams.vertexCount === Infinity) {\n drawParams.vertexCount = 0;\n }\n\n if (drawParams.instanceCount === Infinity) {\n drawParams.instanceCount = 0;\n }\n\n return drawParams;\n }\n\n _updateDrawParamsForLocation(drawParams, location) {\n const value = this.values[location];\n const accessor = this.accessors[location];\n\n if (!value) {\n return;\n }\n\n const {\n divisor\n } = accessor;\n const isInstanced = divisor > 0;\n drawParams.isInstanced = drawParams.isInstanced || isInstanced;\n\n if (value instanceof _buffer__WEBPACK_IMPORTED_MODULE_3__[\"default\"]) {\n const buffer = value;\n\n if (isInstanced) {\n const instanceCount = buffer.getVertexCount(accessor);\n drawParams.instanceCount = Math.min(drawParams.instanceCount, instanceCount);\n } else {\n const vertexCount = buffer.getVertexCount(accessor);\n drawParams.vertexCount = Math.min(drawParams.vertexCount, vertexCount);\n }\n }\n }\n\n setElements() {\n let elementBuffer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n let accessor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.deprecated('setElements', 'setElementBuffer')();\n return this.setElementBuffer(elementBuffer, accessor);\n }\n\n}\n//# sourceMappingURL=vertex-array.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/classes/vertex-array.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/debug/debug-program-configuration.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/debug/debug-program-configuration.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getDebugTableForProgramConfiguration: () => (/* binding */ getDebugTableForProgramConfiguration)\n/* harmony export */ });\n/* harmony import */ var _webgl_utils_attribute_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../webgl-utils/attribute-utils */ \"./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/attribute-utils.js\");\n\nfunction getDebugTableForProgramConfiguration(config) {\n const table = {};\n const header = \"Accessors for \".concat(config.id);\n\n for (const attributeInfo of config.attributeInfos) {\n if (attributeInfo) {\n const glslDeclaration = getGLSLDeclaration(attributeInfo);\n table[\"in \".concat(glslDeclaration)] = {\n [header]: JSON.stringify(attributeInfo.accessor)\n };\n }\n }\n\n for (const varyingInfo of config.varyingInfos) {\n if (varyingInfo) {\n const glslDeclaration = getGLSLDeclaration(varyingInfo);\n table[\"out \".concat(glslDeclaration)] = {\n [header]: JSON.stringify(varyingInfo.accessor)\n };\n }\n }\n\n return table;\n}\n\nfunction getGLSLDeclaration(attributeInfo) {\n const {\n type,\n size\n } = attributeInfo.accessor;\n const typeAndName = (0,_webgl_utils_attribute_utils__WEBPACK_IMPORTED_MODULE_0__.getCompositeGLType)(type, size);\n\n if (typeAndName) {\n return \"\".concat(typeAndName.name, \" \").concat(attributeInfo.name);\n }\n\n return attributeInfo.name;\n}\n//# sourceMappingURL=debug-program-configuration.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/debug/debug-program-configuration.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/debug/debug-uniforms.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/debug/debug-uniforms.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getDebugTableForUniforms: () => (/* binding */ getDebugTableForUniforms)\n/* harmony export */ });\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n/* harmony import */ var _utils_format_value__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/format-value */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/format-value.js\");\n\n\nfunction getDebugTableForUniforms(_ref) {\n let {\n header = 'Uniforms',\n program,\n uniforms,\n undefinedOnly = false\n } = _ref;\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(program);\n const SHADER_MODULE_UNIFORM_REGEXP = '.*_.*';\n const PROJECT_MODULE_UNIFORM_REGEXP = '.*Matrix';\n const uniformLocations = program._uniformSetters;\n const table = {};\n const uniformNames = Object.keys(uniformLocations).sort();\n let count = 0;\n\n for (const uniformName of uniformNames) {\n if (!uniformName.match(SHADER_MODULE_UNIFORM_REGEXP) && !uniformName.match(PROJECT_MODULE_UNIFORM_REGEXP)) {\n if (addUniformToTable({\n table,\n header,\n uniforms,\n uniformName,\n undefinedOnly\n })) {\n count++;\n }\n }\n }\n\n for (const uniformName of uniformNames) {\n if (uniformName.match(PROJECT_MODULE_UNIFORM_REGEXP)) {\n if (addUniformToTable({\n table,\n header,\n uniforms,\n uniformName,\n undefinedOnly\n })) {\n count++;\n }\n }\n }\n\n for (const uniformName of uniformNames) {\n if (!table[uniformName]) {\n if (addUniformToTable({\n table,\n header,\n uniforms,\n uniformName,\n undefinedOnly\n })) {\n count++;\n }\n }\n }\n\n let unusedCount = 0;\n const unusedTable = {};\n\n if (!undefinedOnly) {\n for (const uniformName in uniforms) {\n const uniform = uniforms[uniformName];\n\n if (!table[uniformName]) {\n unusedCount++;\n unusedTable[uniformName] = {\n Type: \"NOT USED: \".concat(uniform),\n [header]: (0,_utils_format_value__WEBPACK_IMPORTED_MODULE_1__.formatValue)(uniform)\n };\n }\n }\n }\n\n return {\n table,\n count,\n unusedTable,\n unusedCount\n };\n}\n\nfunction addUniformToTable(_ref2) {\n let {\n table,\n header,\n uniforms,\n uniformName,\n undefinedOnly\n } = _ref2;\n const value = uniforms[uniformName];\n const isDefined = isUniformDefined(value);\n\n if (!undefinedOnly || !isDefined) {\n table[uniformName] = {\n [header]: isDefined ? (0,_utils_format_value__WEBPACK_IMPORTED_MODULE_1__.formatValue)(value) : 'N/A',\n 'Uniform Type': isDefined ? value : 'NOT PROVIDED'\n };\n return true;\n }\n\n return false;\n}\n\nfunction isUniformDefined(value) {\n return value !== undefined && value !== null;\n}\n//# sourceMappingURL=debug-uniforms.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/debug/debug-uniforms.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/debug/debug-vertex-array.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/debug/debug-vertex-array.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getDebugTableForVertexArray: () => (/* binding */ getDebugTableForVertexArray)\n/* harmony export */ });\n/* harmony import */ var _classes_buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../classes/buffer */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/buffer.js\");\n/* harmony import */ var _webgl_utils_constants_to_keys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../webgl-utils/constants-to-keys */ \"./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/constants-to-keys.js\");\n/* harmony import */ var _webgl_utils_attribute_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../webgl-utils/attribute-utils */ \"./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/attribute-utils.js\");\n/* harmony import */ var _utils_format_value__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/format-value */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/format-value.js\");\n\n\n\n\nfunction getDebugTableForVertexArray(_ref) {\n let {\n vertexArray,\n header = 'Attributes'\n } = _ref;\n\n if (!vertexArray.configuration) {\n return {};\n }\n\n const table = {};\n\n if (vertexArray.elements) {\n table.ELEMENT_ARRAY_BUFFER = getDebugTableRow(vertexArray, vertexArray.elements, null, header);\n }\n\n const attributes = vertexArray.values;\n\n for (const attributeLocation in attributes) {\n const info = vertexArray._getAttributeInfo(attributeLocation);\n\n if (info) {\n let rowHeader = \"\".concat(attributeLocation, \": \").concat(info.name);\n const accessor = vertexArray.accessors[info.location];\n\n if (accessor) {\n rowHeader = \"\".concat(attributeLocation, \": \").concat(getGLSLDeclaration(info.name, accessor));\n }\n\n table[rowHeader] = getDebugTableRow(vertexArray, attributes[attributeLocation], accessor, header);\n }\n }\n\n return table;\n}\n\nfunction getDebugTableRow(vertexArray, attribute, accessor, header) {\n const {\n gl\n } = vertexArray;\n\n if (!attribute) {\n return {\n [header]: 'null',\n 'Format ': 'N/A'\n };\n }\n\n let type = 'NOT PROVIDED';\n let size = 1;\n let verts = 0;\n let bytes = 0;\n let isInteger;\n let marker;\n let value;\n\n if (accessor) {\n type = accessor.type;\n size = accessor.size;\n type = String(type).replace('Array', '');\n isInteger = type.indexOf('nt') !== -1;\n }\n\n if (attribute instanceof _classes_buffer__WEBPACK_IMPORTED_MODULE_0__[\"default\"]) {\n const buffer = attribute;\n const {\n data,\n changed\n } = buffer.getDebugData();\n marker = changed ? '*' : '';\n value = data;\n bytes = buffer.byteLength;\n verts = bytes / data.BYTES_PER_ELEMENT / size;\n let format;\n\n if (accessor) {\n const instanced = accessor.divisor > 0;\n format = \"\".concat(instanced ? 'I ' : 'P ', \" \").concat(verts, \" (x\").concat(size, \"=\").concat(bytes, \" bytes \").concat((0,_webgl_utils_constants_to_keys__WEBPACK_IMPORTED_MODULE_1__.getKey)(gl, type), \")\");\n } else {\n isInteger = true;\n format = \"\".concat(bytes, \" bytes\");\n }\n\n return {\n [header]: \"\".concat(marker).concat((0,_utils_format_value__WEBPACK_IMPORTED_MODULE_2__.formatValue)(value, {\n size,\n isInteger\n })),\n 'Format ': format\n };\n }\n\n value = attribute;\n size = attribute.length;\n type = String(attribute.constructor.name).replace('Array', '');\n isInteger = type.indexOf('nt') !== -1;\n return {\n [header]: \"\".concat((0,_utils_format_value__WEBPACK_IMPORTED_MODULE_2__.formatValue)(value, {\n size,\n isInteger\n }), \" (constant)\"),\n 'Format ': \"\".concat(size, \"x\").concat(type, \" (constant)\")\n };\n}\n\nfunction getGLSLDeclaration(name, accessor) {\n const {\n type,\n size\n } = accessor;\n const typeAndName = (0,_webgl_utils_attribute_utils__WEBPACK_IMPORTED_MODULE_3__.getCompositeGLType)(type, size);\n return typeAndName ? \"\".concat(name, \" (\").concat(typeAndName.name, \")\") : name;\n}\n//# sourceMappingURL=debug-vertex-array.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/debug/debug-vertex-array.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/features/features.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/features/features.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getFeatures: () => (/* binding */ getFeatures),\n/* harmony export */ hasFeature: () => (/* binding */ hasFeature),\n/* harmony export */ hasFeatures: () => (/* binding */ hasFeatures)\n/* harmony export */ });\n/* harmony import */ var _webgl_features_table__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./webgl-features-table */ \"./node_modules/@luma.gl/webgl/dist/esm/features/webgl-features-table.js\");\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n\n\n\nconst LOG_UNSUPPORTED_FEATURE = 2;\nfunction hasFeature(gl, feature) {\n return hasFeatures(gl, feature);\n}\nfunction hasFeatures(gl, features) {\n features = Array.isArray(features) ? features : [features];\n return features.every(feature => {\n return isFeatureSupported(gl, feature);\n });\n}\nfunction getFeatures(gl) {\n gl.luma = gl.luma || {};\n gl.luma.caps = gl.luma.caps || {};\n\n for (const cap in _webgl_features_table__WEBPACK_IMPORTED_MODULE_1__[\"default\"]) {\n if (gl.luma.caps[cap] === undefined) {\n gl.luma.caps[cap] = isFeatureSupported(gl, cap);\n }\n }\n\n return gl.luma.caps;\n}\n\nfunction isFeatureSupported(gl, cap) {\n gl.luma = gl.luma || {};\n gl.luma.caps = gl.luma.caps || {};\n\n if (gl.luma.caps[cap] === undefined) {\n gl.luma.caps[cap] = queryFeature(gl, cap);\n }\n\n if (!gl.luma.caps[cap]) {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.log(LOG_UNSUPPORTED_FEATURE, \"Feature: \".concat(cap, \" not supported\"))();\n }\n\n return gl.luma.caps[cap];\n}\n\nfunction queryFeature(gl, cap) {\n const feature = _webgl_features_table__WEBPACK_IMPORTED_MODULE_1__[\"default\"][cap];\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(feature, cap);\n let isSupported;\n const featureDefinition = (0,_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.isWebGL2)(gl) ? feature[1] || feature[0] : feature[0];\n\n if (typeof featureDefinition === 'function') {\n isSupported = featureDefinition(gl);\n } else if (Array.isArray(featureDefinition)) {\n isSupported = true;\n\n for (const extension of featureDefinition) {\n isSupported = isSupported && Boolean(gl.getExtension(extension));\n }\n } else if (typeof featureDefinition === 'string') {\n isSupported = Boolean(gl.getExtension(featureDefinition));\n } else if (typeof featureDefinition === 'boolean') {\n isSupported = featureDefinition;\n } else {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(false);\n }\n\n return isSupported;\n}\n//# sourceMappingURL=features.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/features/features.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/features/webgl-features-table.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/features/webgl-features-table.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FEATURES: () => (/* binding */ FEATURES),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _classes_framebuffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../classes/framebuffer */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/framebuffer.js\");\n/* harmony import */ var _classes_texture_2d__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../classes/texture-2d */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture-2d.js\");\n\n\nconst FEATURES = {\n WEBGL2: 'WEBGL2',\n VERTEX_ARRAY_OBJECT: 'VERTEX_ARRAY_OBJECT',\n TIMER_QUERY: 'TIMER_QUERY',\n INSTANCED_RENDERING: 'INSTANCED_RENDERING',\n MULTIPLE_RENDER_TARGETS: 'MULTIPLE_RENDER_TARGETS',\n ELEMENT_INDEX_UINT32: 'ELEMENT_INDEX_UINT32',\n BLEND_EQUATION_MINMAX: 'BLEND_EQUATION_MINMAX',\n FLOAT_BLEND: 'FLOAT_BLEND',\n COLOR_ENCODING_SRGB: 'COLOR_ENCODING_SRGB',\n TEXTURE_DEPTH: 'TEXTURE_DEPTH',\n TEXTURE_FLOAT: 'TEXTURE_FLOAT',\n TEXTURE_HALF_FLOAT: 'TEXTURE_HALF_FLOAT',\n TEXTURE_FILTER_LINEAR_FLOAT: 'TEXTURE_FILTER_LINEAR_FLOAT',\n TEXTURE_FILTER_LINEAR_HALF_FLOAT: 'TEXTURE_FILTER_LINEAR_HALF_FLOAT',\n TEXTURE_FILTER_ANISOTROPIC: 'TEXTURE_FILTER_ANISOTROPIC',\n COLOR_ATTACHMENT_RGBA32F: 'COLOR_ATTACHMENT_RGBA32F',\n COLOR_ATTACHMENT_FLOAT: 'COLOR_ATTACHMENT_FLOAT',\n COLOR_ATTACHMENT_HALF_FLOAT: 'COLOR_ATTACHMENT_HALF_FLOAT',\n GLSL_FRAG_DATA: 'GLSL_FRAG_DATA',\n GLSL_FRAG_DEPTH: 'GLSL_FRAG_DEPTH',\n GLSL_DERIVATIVES: 'GLSL_DERIVATIVES',\n GLSL_TEXTURE_LOD: 'GLSL_TEXTURE_LOD'\n};\n\nfunction checkFloat32ColorAttachment(gl) {\n const testTexture = new _classes_texture_2d__WEBPACK_IMPORTED_MODULE_0__[\"default\"](gl, {\n format: 6408,\n type: 5126,\n dataFormat: 6408\n });\n const testFb = new _classes_framebuffer__WEBPACK_IMPORTED_MODULE_1__[\"default\"](gl, {\n id: \"test-framebuffer\",\n check: false,\n attachments: {\n [36064]: testTexture\n }\n });\n const status = testFb.getStatus();\n testTexture.delete();\n testFb.delete();\n return status === 36053;\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n [FEATURES.WEBGL2]: [false, true],\n [FEATURES.VERTEX_ARRAY_OBJECT]: ['OES_vertex_array_object', true],\n [FEATURES.TIMER_QUERY]: ['EXT_disjoint_timer_query', 'EXT_disjoint_timer_query_webgl2'],\n [FEATURES.INSTANCED_RENDERING]: ['ANGLE_instanced_arrays', true],\n [FEATURES.MULTIPLE_RENDER_TARGETS]: ['WEBGL_draw_buffers', true],\n [FEATURES.ELEMENT_INDEX_UINT32]: ['OES_element_index_uint', true],\n [FEATURES.BLEND_EQUATION_MINMAX]: ['EXT_blend_minmax', true],\n [FEATURES.FLOAT_BLEND]: ['EXT_float_blend'],\n [FEATURES.COLOR_ENCODING_SRGB]: ['EXT_sRGB', true],\n [FEATURES.TEXTURE_DEPTH]: ['WEBGL_depth_texture', true],\n [FEATURES.TEXTURE_FLOAT]: ['OES_texture_float', true],\n [FEATURES.TEXTURE_HALF_FLOAT]: ['OES_texture_half_float', true],\n [FEATURES.TEXTURE_FILTER_LINEAR_FLOAT]: ['OES_texture_float_linear'],\n [FEATURES.TEXTURE_FILTER_LINEAR_HALF_FLOAT]: ['OES_texture_half_float_linear'],\n [FEATURES.TEXTURE_FILTER_ANISOTROPIC]: ['EXT_texture_filter_anisotropic'],\n [FEATURES.COLOR_ATTACHMENT_RGBA32F]: [checkFloat32ColorAttachment, 'EXT_color_buffer_float'],\n [FEATURES.COLOR_ATTACHMENT_FLOAT]: [false, 'EXT_color_buffer_float'],\n [FEATURES.COLOR_ATTACHMENT_HALF_FLOAT]: ['EXT_color_buffer_half_float'],\n [FEATURES.GLSL_FRAG_DATA]: ['WEBGL_draw_buffers', true],\n [FEATURES.GLSL_FRAG_DEPTH]: ['EXT_frag_depth', true],\n [FEATURES.GLSL_DERIVATIVES]: ['OES_standard_derivatives', true],\n [FEATURES.GLSL_TEXTURE_LOD]: ['EXT_shader_texture_lod', true]\n});\n//# sourceMappingURL=webgl-features-table.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/features/webgl-features-table.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/format-glsl-error.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/format-glsl-error.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ formatGLSLCompilerError),\n/* harmony export */ parseGLSLCompilerError: () => (/* binding */ parseGLSLCompilerError)\n/* harmony export */ });\n/* harmony import */ var _get_shader_name__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get-shader-name */ \"./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/get-shader-name.js\");\n/* harmony import */ var _get_shader_type_name__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./get-shader-type-name */ \"./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/get-shader-type-name.js\");\n\n\nfunction formatGLSLCompilerError(errLog, src, shaderType) {\n const {\n shaderName,\n errors,\n warnings\n } = parseGLSLCompilerError(errLog, src, shaderType);\n return \"GLSL compilation error in \".concat(shaderName, \"\\n\\n\").concat(errors, \"\\n\").concat(warnings);\n}\nfunction parseGLSLCompilerError(errLog, src, shaderType, shaderName) {\n const errorStrings = errLog.split(/\\r?\\n/);\n const errors = {};\n const warnings = {};\n const name = shaderName || (0,_get_shader_name__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(src) || '(unnamed)';\n const shaderDescription = \"\".concat((0,_get_shader_type_name__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(shaderType), \" shader \").concat(name);\n\n for (let i = 0; i < errorStrings.length; i++) {\n const errorString = errorStrings[i];\n\n if (errorString.length <= 1) {\n continue;\n }\n\n const segments = errorString.split(':');\n const type = segments[0];\n const line = parseInt(segments[2], 10);\n\n if (isNaN(line)) {\n throw new Error(\"GLSL compilation error in \".concat(shaderDescription, \": \").concat(errLog));\n }\n\n if (type !== 'WARNING') {\n errors[line] = errorString;\n } else {\n warnings[line] = errorString;\n }\n }\n\n const lines = addLineNumbers(src);\n return {\n shaderName: shaderDescription,\n errors: formatErrors(errors, lines),\n warnings: formatErrors(warnings, lines)\n };\n}\n\nfunction formatErrors(errors, lines) {\n let message = '';\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n\n if (!errors[i + 3] && !errors[i + 2] && !errors[i + 1]) {\n continue;\n }\n\n message += \"\".concat(line, \"\\n\");\n\n if (errors[i + 1]) {\n const error = errors[i + 1];\n const segments = error.split(':', 3);\n const type = segments[0];\n const column = parseInt(segments[1], 10) || 0;\n const err = error.substring(segments.join(':').length + 1).trim();\n message += padLeft(\"^^^ \".concat(type, \": \").concat(err, \"\\n\\n\"), column);\n }\n }\n\n return message;\n}\n\nfunction addLineNumbers(string) {\n let start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n let delim = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ': ';\n const lines = string.split(/\\r?\\n/);\n const maxDigits = String(lines.length + start - 1).length;\n return lines.map((line, i) => {\n const lineNumber = String(i + start);\n const digits = lineNumber.length;\n const prefix = padLeft(lineNumber, maxDigits - digits);\n return prefix + delim + line;\n });\n}\n\nfunction padLeft(string, digits) {\n let result = '';\n\n for (let i = 0; i < digits; ++i) {\n result += ' ';\n }\n\n return \"\".concat(result).concat(string);\n}\n//# sourceMappingURL=format-glsl-error.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/format-glsl-error.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/get-shader-name.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/get-shader-name.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ getShaderName)\n/* harmony export */ });\nfunction getShaderName(shader) {\n let defaultName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'unnamed';\n const SHADER_NAME_REGEXP = /#define[\\s*]SHADER_NAME[\\s*]([A-Za-z0-9_-]+)[\\s*]/;\n const match = shader.match(SHADER_NAME_REGEXP);\n return match ? match[1] : defaultName;\n}\n//# sourceMappingURL=get-shader-name.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/get-shader-name.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/get-shader-type-name.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/get-shader-type-name.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ getShaderTypeName)\n/* harmony export */ });\nconst GL_FRAGMENT_SHADER = 0x8b30;\nconst GL_VERTEX_SHADER = 0x8b31;\nfunction getShaderTypeName(type) {\n switch (type) {\n case GL_FRAGMENT_SHADER:\n return 'fragment';\n\n case GL_VERTEX_SHADER:\n return 'vertex';\n\n default:\n return 'unknown type';\n }\n}\n//# sourceMappingURL=get-shader-type-name.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/get-shader-type-name.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/get-shader-version.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/get-shader-version.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ getShaderVersion)\n/* harmony export */ });\nfunction getShaderVersion(source) {\n let version = 100;\n const words = source.match(/[^\\s]+/g);\n\n if (words.length >= 2 && words[0] === '#version') {\n const v = parseInt(words[1], 10);\n\n if (Number.isFinite(v)) {\n version = v;\n }\n }\n\n return version;\n}\n//# sourceMappingURL=get-shader-version.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/glsl-utils/get-shader-version.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/init.js": +/*!******************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/init.js ***! + \******************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ StatsManager: () => (/* binding */ StatsManager),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ lumaStats: () => (/* binding */ lumaStats)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n/* harmony import */ var _probe_gl_stats__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @probe.gl/stats */ \"./node_modules/@probe.gl/stats/dist/esm/index.js\");\n/* harmony import */ var _probe_gl_env__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @probe.gl/env */ \"./node_modules/@probe.gl/env/dist/esm/lib/is-browser.js\");\n\n\n\nconst VERSION = true ? \"8.5.21\" : 0;\nconst STARTUP_MESSAGE = 'set luma.log.level=1 (or higher) to trace rendering';\nclass StatsManager {\n constructor() {\n this.stats = new Map();\n }\n\n get(name) {\n if (!this.stats.has(name)) {\n this.stats.set(name, new _probe_gl_stats__WEBPACK_IMPORTED_MODULE_1__.Stats({\n id: name\n }));\n }\n\n return this.stats.get(name);\n }\n\n}\nconst lumaStats = new StatsManager();\n\nif (globalThis.luma && globalThis.luma.VERSION !== VERSION) {\n throw new Error(\"luma.gl - multiple VERSIONs detected: \".concat(globalThis.luma.VERSION, \" vs \").concat(VERSION));\n}\n\nif (!globalThis.luma) {\n if ((0,_probe_gl_env__WEBPACK_IMPORTED_MODULE_2__[\"default\"])()) {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.log(1, \"luma.gl \".concat(VERSION, \" - \").concat(STARTUP_MESSAGE))();\n }\n\n globalThis.luma = globalThis.luma || {\n VERSION,\n version: VERSION,\n log: _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log,\n stats: lumaStats,\n globals: {\n modules: {},\n nodeIO: {}\n }\n };\n}\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (globalThis.luma);\n//# sourceMappingURL=init.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/init.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/utils/array-utils-flat.js": +/*!************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/utils/array-utils-flat.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ fillArray: () => (/* binding */ fillArray),\n/* harmony export */ getScratchArray: () => (/* binding */ getScratchArray),\n/* harmony export */ getScratchArrayBuffer: () => (/* binding */ getScratchArrayBuffer)\n/* harmony export */ });\nlet arrayBuffer = null;\nfunction getScratchArrayBuffer(byteLength) {\n if (!arrayBuffer || arrayBuffer.byteLength < byteLength) {\n arrayBuffer = new ArrayBuffer(byteLength);\n }\n\n return arrayBuffer;\n}\nfunction getScratchArray(Type, length) {\n const scratchArrayBuffer = getScratchArrayBuffer(Type.BYTES_PER_ELEMENT * length);\n return new Type(scratchArrayBuffer, 0, length);\n}\nfunction fillArray(_ref) {\n let {\n target,\n source,\n start = 0,\n count = 1\n } = _ref;\n const length = source.length;\n const total = count * length;\n let copied = 0;\n\n for (let i = start; copied < length; copied++) {\n target[i++] = source[copied];\n }\n\n while (copied < total) {\n if (copied < total - copied) {\n target.copyWithin(start + copied, start, start + copied);\n copied *= 2;\n } else {\n target.copyWithin(start + copied, start, start + total - copied);\n copied = total;\n }\n }\n\n return target;\n}\n//# sourceMappingURL=array-utils-flat.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/utils/array-utils-flat.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js": +/*!**************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ assert: () => (/* binding */ assert)\n/* harmony export */ });\nfunction assert(condition, message) {\n if (!condition) {\n throw new Error(message || 'luma.gl: assertion failed.');\n }\n}\n//# sourceMappingURL=assert.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/utils/check-props.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/utils/check-props.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ checkProps: () => (/* binding */ checkProps)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n\nfunction checkProps(className, props, propChecks) {\n const {\n removedProps = {},\n deprecatedProps = {},\n replacedProps = {}\n } = propChecks;\n\n for (const propName in removedProps) {\n if (propName in props) {\n const replacementProp = removedProps[propName];\n const replacement = replacementProp ? \"\".concat(className, \".\").concat(removedProps[propName]) : 'N/A';\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.removed(\"\".concat(className, \".\").concat(propName), replacement)();\n }\n }\n\n for (const propName in deprecatedProps) {\n if (propName in props) {\n const replacementProp = deprecatedProps[propName];\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.deprecated(\"\".concat(className, \".\").concat(propName), \"\".concat(className, \".\").concat(replacementProp))();\n }\n }\n\n let newProps = null;\n\n for (const propName in replacedProps) {\n if (propName in props) {\n const replacementProp = replacedProps[propName];\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.deprecated(\"\".concat(className, \".\").concat(propName), \"\".concat(className, \".\").concat(replacementProp))();\n newProps = newProps || Object.assign({}, props);\n newProps[replacementProp] = props[propName];\n delete newProps[propName];\n }\n }\n\n return newProps || props;\n}\n//# sourceMappingURL=check-props.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/utils/check-props.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/utils/format-value.js": +/*!********************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/utils/format-value.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ formatValue: () => (/* binding */ formatValue)\n/* harmony export */ });\nfunction formatArrayValue(v, opts) {\n const {\n maxElts = 16,\n size = 1\n } = opts;\n let string = '[';\n\n for (let i = 0; i < v.length && i < maxElts; ++i) {\n if (i > 0) {\n string += \",\".concat(i % size === 0 ? ' ' : '');\n }\n\n string += formatValue(v[i], opts);\n }\n\n const terminator = v.length > maxElts ? '...' : ']';\n return \"\".concat(string).concat(terminator);\n}\n\nfunction formatValue(v) {\n let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const EPSILON = 1e-16;\n const {\n isInteger = false\n } = opts;\n\n if (Array.isArray(v) || ArrayBuffer.isView(v)) {\n return formatArrayValue(v, opts);\n }\n\n if (!Number.isFinite(v)) {\n return String(v);\n }\n\n if (Math.abs(v) < EPSILON) {\n return isInteger ? '0' : '0.';\n }\n\n if (isInteger) {\n return v.toFixed(0);\n }\n\n if (Math.abs(v) > 100 && Math.abs(v) < 10000) {\n return v.toFixed(0);\n }\n\n const string = v.toPrecision(2);\n const decimal = string.indexOf('.0');\n return decimal === string.length - 2 ? string.slice(0, -1) : string;\n}\n//# sourceMappingURL=format-value.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/utils/format-value.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/utils/load-file.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/utils/load-file.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadFile: () => (/* binding */ loadFile),\n/* harmony export */ loadImage: () => (/* binding */ loadImage),\n/* harmony export */ setPathPrefix: () => (/* binding */ setPathPrefix)\n/* harmony export */ });\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n\nlet pathPrefix = '';\nfunction setPathPrefix(prefix) {\n pathPrefix = prefix;\n}\nfunction loadFile(url) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(typeof url === 'string');\n url = pathPrefix + url;\n const dataType = options.dataType || 'text';\n return fetch(url, options).then(res => res[dataType]());\n}\nfunction loadImage(url, opts) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(typeof url === 'string');\n url = pathPrefix + url;\n return new Promise((resolve, reject) => {\n try {\n const image = new Image();\n\n image.onload = () => resolve(image);\n\n image.onerror = () => reject(new Error(\"Could not load image \".concat(url, \".\")));\n\n image.crossOrigin = opts && opts.crossOrigin || 'anonymous';\n image.src = url;\n } catch (error) {\n reject(error);\n }\n });\n}\n//# sourceMappingURL=load-file.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/utils/load-file.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/utils/stub-methods.js": +/*!********************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/utils/stub-methods.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ stubRemovedMethods: () => (/* binding */ stubRemovedMethods)\n/* harmony export */ });\n/* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ \"./node_modules/@luma.gl/gltools/dist/esm/index.js\");\n\nfunction stubRemovedMethods(instance, className, version, methodNames) {\n const upgradeMessage = \"See luma.gl \".concat(version, \" Upgrade Guide at https://luma.gl/docs/upgrade-guide\");\n const prototype = Object.getPrototypeOf(instance);\n methodNames.forEach(methodName => {\n if (prototype.methodName) {\n return;\n }\n\n prototype[methodName] = () => {\n _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__.log.removed(\"Calling removed method \".concat(className, \".\").concat(methodName, \": \"), upgradeMessage)();\n throw new Error(methodName);\n };\n });\n}\n//# sourceMappingURL=stub-methods.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/utils/stub-methods.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/utils/utils.js": +/*!*************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/utils/utils.js ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ isObjectEmpty: () => (/* binding */ isObjectEmpty),\n/* harmony export */ isPowerOfTwo: () => (/* binding */ isPowerOfTwo),\n/* harmony export */ uid: () => (/* binding */ uid)\n/* harmony export */ });\n/* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n\nconst uidCounters = {};\nfunction uid() {\n let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'id';\n uidCounters[id] = uidCounters[id] || 1;\n const count = uidCounters[id]++;\n return \"\".concat(id, \"-\").concat(count);\n}\nfunction isPowerOfTwo(n) {\n (0,_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(typeof n === 'number', 'Input must be a number');\n return n && (n & n - 1) === 0;\n}\nfunction isObjectEmpty(obj) {\n let isEmpty = true;\n\n for (const key in obj) {\n isEmpty = false;\n break;\n }\n\n return isEmpty;\n}\n//# sourceMappingURL=utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/utils/utils.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/attribute-utils.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/attribute-utils.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ decomposeCompositeGLType: () => (/* binding */ decomposeCompositeGLType),\n/* harmony export */ getCompositeGLType: () => (/* binding */ getCompositeGLType),\n/* harmony export */ getPrimitiveCount: () => (/* binding */ getPrimitiveCount),\n/* harmony export */ getPrimitiveDrawMode: () => (/* binding */ getPrimitiveDrawMode),\n/* harmony export */ getVertexCount: () => (/* binding */ getVertexCount)\n/* harmony export */ });\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n\nconst GL_BYTE = 0x1400;\nconst GL_UNSIGNED_BYTE = 0x1401;\nconst GL_SHORT = 0x1402;\nconst GL_UNSIGNED_SHORT = 0x1403;\nconst GL_POINTS = 0x0;\nconst GL_LINES = 0x1;\nconst GL_LINE_LOOP = 0x2;\nconst GL_LINE_STRIP = 0x3;\nconst GL_TRIANGLES = 0x4;\nconst GL_TRIANGLE_STRIP = 0x5;\nconst GL_TRIANGLE_FAN = 0x6;\nconst GL_FLOAT = 0x1406;\nconst GL_FLOAT_VEC2 = 0x8b50;\nconst GL_FLOAT_VEC3 = 0x8b51;\nconst GL_FLOAT_VEC4 = 0x8b52;\nconst GL_INT = 0x1404;\nconst GL_INT_VEC2 = 0x8b53;\nconst GL_INT_VEC3 = 0x8b54;\nconst GL_INT_VEC4 = 0x8b55;\nconst GL_UNSIGNED_INT = 0x1405;\nconst GL_UNSIGNED_INT_VEC2 = 0x8dc6;\nconst GL_UNSIGNED_INT_VEC3 = 0x8dc7;\nconst GL_UNSIGNED_INT_VEC4 = 0x8dc8;\nconst GL_BOOL = 0x8b56;\nconst GL_BOOL_VEC2 = 0x8b57;\nconst GL_BOOL_VEC3 = 0x8b58;\nconst GL_BOOL_VEC4 = 0x8b59;\nconst GL_FLOAT_MAT2 = 0x8b5a;\nconst GL_FLOAT_MAT3 = 0x8b5b;\nconst GL_FLOAT_MAT4 = 0x8b5c;\nconst GL_FLOAT_MAT2x3 = 0x8b65;\nconst GL_FLOAT_MAT2x4 = 0x8b66;\nconst GL_FLOAT_MAT3x2 = 0x8b67;\nconst GL_FLOAT_MAT3x4 = 0x8b68;\nconst GL_FLOAT_MAT4x2 = 0x8b69;\nconst GL_FLOAT_MAT4x3 = 0x8b6a;\nconst COMPOSITE_GL_TYPES = {\n [GL_FLOAT]: [GL_FLOAT, 1, 'float'],\n [GL_FLOAT_VEC2]: [GL_FLOAT, 2, 'vec2'],\n [GL_FLOAT_VEC3]: [GL_FLOAT, 3, 'vec3'],\n [GL_FLOAT_VEC4]: [GL_FLOAT, 4, 'vec4'],\n [GL_INT]: [GL_INT, 1, 'int'],\n [GL_INT_VEC2]: [GL_INT, 2, 'ivec2'],\n [GL_INT_VEC3]: [GL_INT, 3, 'ivec3'],\n [GL_INT_VEC4]: [GL_INT, 4, 'ivec4'],\n [GL_UNSIGNED_INT]: [GL_UNSIGNED_INT, 1, 'uint'],\n [GL_UNSIGNED_INT_VEC2]: [GL_UNSIGNED_INT, 2, 'uvec2'],\n [GL_UNSIGNED_INT_VEC3]: [GL_UNSIGNED_INT, 3, 'uvec3'],\n [GL_UNSIGNED_INT_VEC4]: [GL_UNSIGNED_INT, 4, 'uvec4'],\n [GL_BOOL]: [GL_FLOAT, 1, 'bool'],\n [GL_BOOL_VEC2]: [GL_FLOAT, 2, 'bvec2'],\n [GL_BOOL_VEC3]: [GL_FLOAT, 3, 'bvec3'],\n [GL_BOOL_VEC4]: [GL_FLOAT, 4, 'bvec4'],\n [GL_FLOAT_MAT2]: [GL_FLOAT, 8, 'mat2'],\n [GL_FLOAT_MAT2x3]: [GL_FLOAT, 8, 'mat2x3'],\n [GL_FLOAT_MAT2x4]: [GL_FLOAT, 8, 'mat2x4'],\n [GL_FLOAT_MAT3]: [GL_FLOAT, 12, 'mat3'],\n [GL_FLOAT_MAT3x2]: [GL_FLOAT, 12, 'mat3x2'],\n [GL_FLOAT_MAT3x4]: [GL_FLOAT, 12, 'mat3x4'],\n [GL_FLOAT_MAT4]: [GL_FLOAT, 16, 'mat4'],\n [GL_FLOAT_MAT4x2]: [GL_FLOAT, 16, 'mat4x2'],\n [GL_FLOAT_MAT4x3]: [GL_FLOAT, 16, 'mat4x3']\n};\nfunction getPrimitiveDrawMode(drawMode) {\n switch (drawMode) {\n case GL_POINTS:\n return GL_POINTS;\n\n case GL_LINES:\n return GL_LINES;\n\n case GL_LINE_STRIP:\n return GL_LINES;\n\n case GL_LINE_LOOP:\n return GL_LINES;\n\n case GL_TRIANGLES:\n return GL_TRIANGLES;\n\n case GL_TRIANGLE_STRIP:\n return GL_TRIANGLES;\n\n case GL_TRIANGLE_FAN:\n return GL_TRIANGLES;\n\n default:\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(false);\n return 0;\n }\n}\nfunction getPrimitiveCount(_ref) {\n let {\n drawMode,\n vertexCount\n } = _ref;\n\n switch (drawMode) {\n case GL_POINTS:\n case GL_LINE_LOOP:\n return vertexCount;\n\n case GL_LINES:\n return vertexCount / 2;\n\n case GL_LINE_STRIP:\n return vertexCount - 1;\n\n case GL_TRIANGLES:\n return vertexCount / 3;\n\n case GL_TRIANGLE_STRIP:\n case GL_TRIANGLE_FAN:\n return vertexCount - 2;\n\n default:\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(false);\n return 0;\n }\n}\nfunction getVertexCount(_ref2) {\n let {\n drawMode,\n vertexCount\n } = _ref2;\n const primitiveCount = getPrimitiveCount({\n drawMode,\n vertexCount\n });\n\n switch (getPrimitiveDrawMode(drawMode)) {\n case GL_POINTS:\n return primitiveCount;\n\n case GL_LINES:\n return primitiveCount * 2;\n\n case GL_TRIANGLES:\n return primitiveCount * 3;\n\n default:\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(false);\n return 0;\n }\n}\nfunction decomposeCompositeGLType(compositeGLType) {\n const typeAndSize = COMPOSITE_GL_TYPES[compositeGLType];\n\n if (!typeAndSize) {\n return null;\n }\n\n const [type, components] = typeAndSize;\n return {\n type,\n components\n };\n}\nfunction getCompositeGLType(type, components) {\n switch (type) {\n case GL_BYTE:\n case GL_UNSIGNED_BYTE:\n case GL_SHORT:\n case GL_UNSIGNED_SHORT:\n type = GL_FLOAT;\n break;\n\n default:\n }\n\n for (const glType in COMPOSITE_GL_TYPES) {\n const [compType, compComponents, name] = COMPOSITE_GL_TYPES[glType];\n\n if (compType === type && compComponents === components) {\n return {\n glType,\n name\n };\n }\n }\n\n return null;\n}\n//# sourceMappingURL=attribute-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/attribute-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/constants-to-keys.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/constants-to-keys.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getKey: () => (/* binding */ getKey),\n/* harmony export */ getKeyType: () => (/* binding */ getKeyType),\n/* harmony export */ getKeyValue: () => (/* binding */ getKeyValue)\n/* harmony export */ });\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n\nfunction getKeyValue(gl, name) {\n if (typeof name !== 'string') {\n return name;\n }\n\n const number = Number(name);\n\n if (!isNaN(number)) {\n return number;\n }\n\n name = name.replace(/^.*\\./, '');\n const value = gl[name];\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(value !== undefined, \"Accessing undefined constant GL.\".concat(name));\n return value;\n}\nfunction getKey(gl, value) {\n value = Number(value);\n\n for (const key in gl) {\n if (gl[key] === value) {\n return \"GL.\".concat(key);\n }\n }\n\n return String(value);\n}\nfunction getKeyType(gl, value) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(value !== undefined, 'undefined key');\n value = Number(value);\n\n for (const key in gl) {\n if (gl[key] === value) {\n return \"GL.\".concat(key);\n }\n }\n\n return String(value);\n}\n//# sourceMappingURL=constants-to-keys.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/constants-to-keys.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/format-utils.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/format-utils.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ glFormatToComponents: () => (/* binding */ glFormatToComponents),\n/* harmony export */ glTypeToBytes: () => (/* binding */ glTypeToBytes)\n/* harmony export */ });\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n\nfunction glFormatToComponents(format) {\n switch (format) {\n case 6406:\n case 33326:\n case 6403:\n return 1;\n\n case 33328:\n case 33319:\n return 2;\n\n case 6407:\n case 34837:\n return 3;\n\n case 6408:\n case 34836:\n return 4;\n\n default:\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(false);\n return 0;\n }\n}\nfunction glTypeToBytes(type) {\n switch (type) {\n case 5121:\n return 1;\n\n case 33635:\n case 32819:\n case 32820:\n return 2;\n\n case 5126:\n return 4;\n\n default:\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(false);\n return 0;\n }\n}\n//# sourceMappingURL=format-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/format-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/request-animation-frame.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/request-animation-frame.js ***! + \*************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ cancelAnimationFrame: () => (/* binding */ cancelAnimationFrame),\n/* harmony export */ requestAnimationFrame: () => (/* binding */ requestAnimationFrame)\n/* harmony export */ });\nfunction requestAnimationFrame(callback) {\n return typeof window !== 'undefined' && window.requestAnimationFrame ? window.requestAnimationFrame(callback) : setTimeout(callback, 1000 / 60);\n}\nfunction cancelAnimationFrame(timerId) {\n return typeof window !== 'undefined' && window.cancelAnimationFrame ? window.cancelAnimationFrame(timerId) : clearTimeout(timerId);\n}\n//# sourceMappingURL=request-animation-frame.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/request-animation-frame.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/texture-utils.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/texture-utils.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ cloneTextureFrom: () => (/* binding */ cloneTextureFrom),\n/* harmony export */ toFramebuffer: () => (/* binding */ toFramebuffer)\n/* harmony export */ });\n/* harmony import */ var _classes_texture_2d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../classes/texture-2d */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture-2d.js\");\n/* harmony import */ var _classes_texture_cube__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../classes/texture-cube */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture-cube.js\");\n/* harmony import */ var _classes_texture_3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../classes/texture-3d */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/texture-3d.js\");\n/* harmony import */ var _classes_framebuffer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../classes/framebuffer */ \"./node_modules/@luma.gl/webgl/dist/esm/classes/framebuffer.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/assert */ \"./node_modules/@luma.gl/webgl/dist/esm/utils/assert.js\");\n\n\n\n\n\nfunction cloneTextureFrom(refTexture, overrides) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_0__.assert)(refTexture instanceof _classes_texture_2d__WEBPACK_IMPORTED_MODULE_1__[\"default\"] || refTexture instanceof _classes_texture_cube__WEBPACK_IMPORTED_MODULE_2__[\"default\"] || refTexture instanceof _classes_texture_3d__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n const TextureType = refTexture.constructor;\n const {\n gl,\n width,\n height,\n format,\n type,\n dataFormat,\n border,\n mipmaps\n } = refTexture;\n const textureOptions = Object.assign({\n width,\n height,\n format,\n type,\n dataFormat,\n border,\n mipmaps\n }, overrides);\n return new TextureType(gl, textureOptions);\n}\nfunction toFramebuffer(texture, opts) {\n const {\n gl,\n width,\n height,\n id\n } = texture;\n const framebuffer = new _classes_framebuffer__WEBPACK_IMPORTED_MODULE_4__[\"default\"](gl, Object.assign({}, opts, {\n id: \"framebuffer-for-\".concat(id),\n width,\n height,\n attachments: {\n [36064]: texture\n }\n }));\n return framebuffer;\n}\n//# sourceMappingURL=texture-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/texture-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/typed-array-utils.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/typed-array-utils.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ flipRows: () => (/* binding */ flipRows),\n/* harmony export */ getGLTypeFromTypedArray: () => (/* binding */ getGLTypeFromTypedArray),\n/* harmony export */ getTypedArrayFromGLType: () => (/* binding */ getTypedArrayFromGLType),\n/* harmony export */ scalePixels: () => (/* binding */ scalePixels)\n/* harmony export */ });\nconst ERR_TYPE_DEDUCTION = 'Failed to deduce GL constant from typed array';\nfunction getGLTypeFromTypedArray(arrayOrType) {\n const type = ArrayBuffer.isView(arrayOrType) ? arrayOrType.constructor : arrayOrType;\n\n switch (type) {\n case Float32Array:\n return 5126;\n\n case Uint16Array:\n return 5123;\n\n case Uint32Array:\n return 5125;\n\n case Uint8Array:\n return 5121;\n\n case Uint8ClampedArray:\n return 5121;\n\n case Int8Array:\n return 5120;\n\n case Int16Array:\n return 5122;\n\n case Int32Array:\n return 5124;\n\n default:\n throw new Error(ERR_TYPE_DEDUCTION);\n }\n}\nfunction getTypedArrayFromGLType(glType) {\n let {\n clamped = true\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n switch (glType) {\n case 5126:\n return Float32Array;\n\n case 5123:\n case 33635:\n case 32819:\n case 32820:\n return Uint16Array;\n\n case 5125:\n return Uint32Array;\n\n case 5121:\n return clamped ? Uint8ClampedArray : Uint8Array;\n\n case 5120:\n return Int8Array;\n\n case 5122:\n return Int16Array;\n\n case 5124:\n return Int32Array;\n\n default:\n throw new Error('Failed to deduce typed array type from GL constant');\n }\n}\nfunction flipRows(_ref) {\n let {\n data,\n width,\n height,\n bytesPerPixel = 4,\n temp\n } = _ref;\n const bytesPerRow = width * bytesPerPixel;\n temp = temp || new Uint8Array(bytesPerRow);\n\n for (let y = 0; y < height / 2; ++y) {\n const topOffset = y * bytesPerRow;\n const bottomOffset = (height - y - 1) * bytesPerRow;\n temp.set(data.subarray(topOffset, topOffset + bytesPerRow));\n data.copyWithin(topOffset, bottomOffset, bottomOffset + bytesPerRow);\n data.set(temp, bottomOffset);\n }\n}\nfunction scalePixels(_ref2) {\n let {\n data,\n width,\n height\n } = _ref2;\n const newWidth = Math.round(width / 2);\n const newHeight = Math.round(height / 2);\n const newData = new Uint8Array(newWidth * newHeight * 4);\n\n for (let y = 0; y < newHeight; y++) {\n for (let x = 0; x < newWidth; x++) {\n for (let c = 0; c < 4; c++) {\n newData[(y * newWidth + x) * 4 + c] = data[(y * 2 * width + x * 2) * 4 + c];\n }\n }\n }\n\n return {\n data: newData,\n width: newWidth,\n height: newHeight\n };\n}\n//# sourceMappingURL=typed-array-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@luma.gl/webgl/dist/esm/webgl-utils/typed-array-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/core/dist/esm/classes/base/math-array.js": +/*!************************************************************************!*\ + !*** ./node_modules/@math.gl/core/dist/esm/classes/base/math-array.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ MathArray)\n/* harmony export */ });\n/* harmony import */ var _lib_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../lib/common */ \"./node_modules/@math.gl/core/dist/esm/lib/common.js\");\nfunction _extendableBuiltin(cls) {\n function ExtendableBuiltin() {\n var instance = Reflect.construct(cls, Array.from(arguments));\n Object.setPrototypeOf(instance, Object.getPrototypeOf(this));\n return instance;\n }\n\n ExtendableBuiltin.prototype = Object.create(cls.prototype, {\n constructor: {\n value: cls,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ExtendableBuiltin, cls);\n } else {\n ExtendableBuiltin.__proto__ = cls;\n }\n\n return ExtendableBuiltin;\n}\n\n\nclass MathArray extends _extendableBuiltin(Array) {\n clone() {\n return new this.constructor().copy(this);\n }\n\n fromArray(array, offset = 0) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = array[i + offset];\n }\n\n return this.check();\n }\n\n toArray(targetArray = [], offset = 0) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n targetArray[offset + i] = this[i];\n }\n\n return targetArray;\n }\n\n from(arrayOrObject) {\n return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) : this.fromObject(arrayOrObject);\n }\n\n to(arrayOrObject) {\n if (arrayOrObject === this) {\n return this;\n }\n\n return (0,_lib_common__WEBPACK_IMPORTED_MODULE_0__.isArray)(arrayOrObject) ? this.toArray(arrayOrObject) : this.toObject(arrayOrObject);\n }\n\n toTarget(target) {\n return target ? this.to(target) : this;\n }\n\n toFloat32Array() {\n return new Float32Array(this);\n }\n\n toString() {\n return this.formatString(_lib_common__WEBPACK_IMPORTED_MODULE_0__.config);\n }\n\n formatString(opts) {\n let string = '';\n\n for (let i = 0; i < this.ELEMENTS; ++i) {\n string += (i > 0 ? ', ' : '') + (0,_lib_common__WEBPACK_IMPORTED_MODULE_0__.formatValue)(this[i], opts);\n }\n\n return \"\".concat(opts.printTypes ? this.constructor.name : '', \"[\").concat(string, \"]\");\n }\n\n equals(array) {\n if (!array || this.length !== array.length) {\n return false;\n }\n\n for (let i = 0; i < this.ELEMENTS; ++i) {\n if (!(0,_lib_common__WEBPACK_IMPORTED_MODULE_0__.equals)(this[i], array[i])) {\n return false;\n }\n }\n\n return true;\n }\n\n exactEquals(array) {\n if (!array || this.length !== array.length) {\n return false;\n }\n\n for (let i = 0; i < this.ELEMENTS; ++i) {\n if (this[i] !== array[i]) {\n return false;\n }\n }\n\n return true;\n }\n\n negate() {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = -this[i];\n }\n\n return this.check();\n }\n\n lerp(a, b, t) {\n if (t === undefined) {\n return this.lerp(this, a, b);\n }\n\n for (let i = 0; i < this.ELEMENTS; ++i) {\n const ai = a[i];\n this[i] = ai + t * (b[i] - ai);\n }\n\n return this.check();\n }\n\n min(vector) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = Math.min(vector[i], this[i]);\n }\n\n return this.check();\n }\n\n max(vector) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = Math.max(vector[i], this[i]);\n }\n\n return this.check();\n }\n\n clamp(minVector, maxVector) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = Math.min(Math.max(this[i], minVector[i]), maxVector[i]);\n }\n\n return this.check();\n }\n\n add(...vectors) {\n for (const vector of vectors) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] += vector[i];\n }\n }\n\n return this.check();\n }\n\n subtract(...vectors) {\n for (const vector of vectors) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] -= vector[i];\n }\n }\n\n return this.check();\n }\n\n scale(scale) {\n if (typeof scale === 'number') {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] *= scale;\n }\n } else {\n for (let i = 0; i < this.ELEMENTS && i < scale.length; ++i) {\n this[i] *= scale[i];\n }\n }\n\n return this.check();\n }\n\n multiplyByScalar(scalar) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] *= scalar;\n }\n\n return this.check();\n }\n\n check() {\n if (_lib_common__WEBPACK_IMPORTED_MODULE_0__.config.debug && !this.validate()) {\n throw new Error(\"math.gl: \".concat(this.constructor.name, \" some fields set to invalid numbers'\"));\n }\n\n return this;\n }\n\n validate() {\n let valid = this.length === this.ELEMENTS;\n\n for (let i = 0; i < this.ELEMENTS; ++i) {\n valid = valid && Number.isFinite(this[i]);\n }\n\n return valid;\n }\n\n sub(a) {\n return this.subtract(a);\n }\n\n setScalar(a) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = a;\n }\n\n return this.check();\n }\n\n addScalar(a) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] += a;\n }\n\n return this.check();\n }\n\n subScalar(a) {\n return this.addScalar(-a);\n }\n\n multiplyScalar(scalar) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] *= scalar;\n }\n\n return this.check();\n }\n\n divideScalar(a) {\n return this.multiplyByScalar(1 / a);\n }\n\n clampScalar(min, max) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = Math.min(Math.max(this[i], min), max);\n }\n\n return this.check();\n }\n\n get elements() {\n return this;\n }\n\n}\n//# sourceMappingURL=math-array.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/core/dist/esm/classes/base/math-array.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/core/dist/esm/classes/base/matrix.js": +/*!********************************************************************!*\ + !*** ./node_modules/@math.gl/core/dist/esm/classes/base/matrix.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Matrix)\n/* harmony export */ });\n/* harmony import */ var _math_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math-array */ \"./node_modules/@math.gl/core/dist/esm/classes/base/math-array.js\");\n/* harmony import */ var _lib_validators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../lib/validators */ \"./node_modules/@math.gl/core/dist/esm/lib/validators.js\");\n/* harmony import */ var _lib_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../lib/common */ \"./node_modules/@math.gl/core/dist/esm/lib/common.js\");\n\n\n\nclass Matrix extends _math_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n toString() {\n let string = '[';\n\n if (_lib_common__WEBPACK_IMPORTED_MODULE_1__.config.printRowMajor) {\n string += 'row-major:';\n\n for (let row = 0; row < this.RANK; ++row) {\n for (let col = 0; col < this.RANK; ++col) {\n string += \" \".concat(this[col * this.RANK + row]);\n }\n }\n } else {\n string += 'column-major:';\n\n for (let i = 0; i < this.ELEMENTS; ++i) {\n string += \" \".concat(this[i]);\n }\n }\n\n string += ']';\n return string;\n }\n\n getElementIndex(row, col) {\n return col * this.RANK + row;\n }\n\n getElement(row, col) {\n return this[col * this.RANK + row];\n }\n\n setElement(row, col, value) {\n this[col * this.RANK + row] = (0,_lib_validators__WEBPACK_IMPORTED_MODULE_2__.checkNumber)(value);\n return this;\n }\n\n getColumn(columnIndex, result = new Array(this.RANK).fill(-0)) {\n const firstIndex = columnIndex * this.RANK;\n\n for (let i = 0; i < this.RANK; ++i) {\n result[i] = this[firstIndex + i];\n }\n\n return result;\n }\n\n setColumn(columnIndex, columnVector) {\n const firstIndex = columnIndex * this.RANK;\n\n for (let i = 0; i < this.RANK; ++i) {\n this[firstIndex + i] = columnVector[i];\n }\n\n return this;\n }\n\n}\n//# sourceMappingURL=matrix.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/core/dist/esm/classes/base/matrix.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/core/dist/esm/classes/base/vector.js": +/*!********************************************************************!*\ + !*** ./node_modules/@math.gl/core/dist/esm/classes/base/vector.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Vector)\n/* harmony export */ });\n/* harmony import */ var _math_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math-array */ \"./node_modules/@math.gl/core/dist/esm/classes/base/math-array.js\");\n/* harmony import */ var _lib_validators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../lib/validators */ \"./node_modules/@math.gl/core/dist/esm/lib/validators.js\");\n/* harmony import */ var _lib_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../lib/assert */ \"./node_modules/@math.gl/core/dist/esm/lib/assert.js\");\n\n\n\nclass Vector extends _math_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n get x() {\n return this[0];\n }\n\n set x(value) {\n this[0] = (0,_lib_validators__WEBPACK_IMPORTED_MODULE_1__.checkNumber)(value);\n }\n\n get y() {\n return this[1];\n }\n\n set y(value) {\n this[1] = (0,_lib_validators__WEBPACK_IMPORTED_MODULE_1__.checkNumber)(value);\n }\n\n len() {\n return Math.sqrt(this.lengthSquared());\n }\n\n magnitude() {\n return this.len();\n }\n\n lengthSquared() {\n let length = 0;\n\n for (let i = 0; i < this.ELEMENTS; ++i) {\n length += this[i] * this[i];\n }\n\n return length;\n }\n\n magnitudeSquared() {\n return this.lengthSquared();\n }\n\n distance(mathArray) {\n return Math.sqrt(this.distanceSquared(mathArray));\n }\n\n distanceSquared(mathArray) {\n let length = 0;\n\n for (let i = 0; i < this.ELEMENTS; ++i) {\n const dist = this[i] - mathArray[i];\n length += dist * dist;\n }\n\n return (0,_lib_validators__WEBPACK_IMPORTED_MODULE_1__.checkNumber)(length);\n }\n\n dot(mathArray) {\n let product = 0;\n\n for (let i = 0; i < this.ELEMENTS; ++i) {\n product += this[i] * mathArray[i];\n }\n\n return (0,_lib_validators__WEBPACK_IMPORTED_MODULE_1__.checkNumber)(product);\n }\n\n normalize() {\n const length = this.magnitude();\n\n if (length !== 0) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] /= length;\n }\n }\n\n return this.check();\n }\n\n multiply(...vectors) {\n for (const vector of vectors) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] *= vector[i];\n }\n }\n\n return this.check();\n }\n\n divide(...vectors) {\n for (const vector of vectors) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] /= vector[i];\n }\n }\n\n return this.check();\n }\n\n lengthSq() {\n return this.lengthSquared();\n }\n\n distanceTo(vector) {\n return this.distance(vector);\n }\n\n distanceToSquared(vector) {\n return this.distanceSquared(vector);\n }\n\n getComponent(i) {\n (0,_lib_assert__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(i >= 0 && i < this.ELEMENTS, 'index is out of range');\n return (0,_lib_validators__WEBPACK_IMPORTED_MODULE_1__.checkNumber)(this[i]);\n }\n\n setComponent(i, value) {\n (0,_lib_assert__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(i >= 0 && i < this.ELEMENTS, 'index is out of range');\n this[i] = value;\n return this.check();\n }\n\n addVectors(a, b) {\n return this.copy(a).add(b);\n }\n\n subVectors(a, b) {\n return this.copy(a).subtract(b);\n }\n\n multiplyVectors(a, b) {\n return this.copy(a).multiply(b);\n }\n\n addScaledVector(a, b) {\n return this.add(new this.constructor(a).multiplyScalar(b));\n }\n\n}\n//# sourceMappingURL=vector.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/core/dist/esm/classes/base/vector.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/core/dist/esm/classes/matrix4.js": +/*!****************************************************************!*\ + !*** ./node_modules/@math.gl/core/dist/esm/classes/matrix4.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Matrix4)\n/* harmony export */ });\n/* harmony import */ var _base_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base/matrix */ \"./node_modules/@math.gl/core/dist/esm/classes/base/matrix.js\");\n/* harmony import */ var _lib_validators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/validators */ \"./node_modules/@math.gl/core/dist/esm/lib/validators.js\");\n/* harmony import */ var _lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/gl-matrix-extras */ \"./node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js\");\n/* harmony import */ var gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gl-matrix/mat4 */ \"./node_modules/gl-matrix/esm/mat4.js\");\n/* harmony import */ var gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! gl-matrix/vec2 */ \"./node_modules/gl-matrix/esm/vec2.js\");\n/* harmony import */ var gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! gl-matrix/vec3 */ \"./node_modules/gl-matrix/esm/vec3.js\");\n/* harmony import */ var gl_matrix_vec4__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gl-matrix/vec4 */ \"./node_modules/gl-matrix/esm/vec4.js\");\n\n\n\n\n\n\n\nvar INDICES;\n\n(function (INDICES) {\n INDICES[INDICES[\"COL0ROW0\"] = 0] = \"COL0ROW0\";\n INDICES[INDICES[\"COL0ROW1\"] = 1] = \"COL0ROW1\";\n INDICES[INDICES[\"COL0ROW2\"] = 2] = \"COL0ROW2\";\n INDICES[INDICES[\"COL0ROW3\"] = 3] = \"COL0ROW3\";\n INDICES[INDICES[\"COL1ROW0\"] = 4] = \"COL1ROW0\";\n INDICES[INDICES[\"COL1ROW1\"] = 5] = \"COL1ROW1\";\n INDICES[INDICES[\"COL1ROW2\"] = 6] = \"COL1ROW2\";\n INDICES[INDICES[\"COL1ROW3\"] = 7] = \"COL1ROW3\";\n INDICES[INDICES[\"COL2ROW0\"] = 8] = \"COL2ROW0\";\n INDICES[INDICES[\"COL2ROW1\"] = 9] = \"COL2ROW1\";\n INDICES[INDICES[\"COL2ROW2\"] = 10] = \"COL2ROW2\";\n INDICES[INDICES[\"COL2ROW3\"] = 11] = \"COL2ROW3\";\n INDICES[INDICES[\"COL3ROW0\"] = 12] = \"COL3ROW0\";\n INDICES[INDICES[\"COL3ROW1\"] = 13] = \"COL3ROW1\";\n INDICES[INDICES[\"COL3ROW2\"] = 14] = \"COL3ROW2\";\n INDICES[INDICES[\"COL3ROW3\"] = 15] = \"COL3ROW3\";\n})(INDICES || (INDICES = {}));\n\nconst DEFAULT_FOVY = 45 * Math.PI / 180;\nconst DEFAULT_ASPECT = 1;\nconst DEFAULT_NEAR = 0.1;\nconst DEFAULT_FAR = 500;\nconst IDENTITY_MATRIX = Object.freeze([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);\nclass Matrix4 extends _base_matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n static get IDENTITY() {\n return getIdentityMatrix();\n }\n\n static get ZERO() {\n return getZeroMatrix();\n }\n\n get ELEMENTS() {\n return 16;\n }\n\n get RANK() {\n return 4;\n }\n\n get INDICES() {\n return INDICES;\n }\n\n constructor(array) {\n super(-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0);\n\n if (arguments.length === 1 && Array.isArray(array)) {\n this.copy(array);\n } else {\n this.identity();\n }\n }\n\n copy(array) {\n this[0] = array[0];\n this[1] = array[1];\n this[2] = array[2];\n this[3] = array[3];\n this[4] = array[4];\n this[5] = array[5];\n this[6] = array[6];\n this[7] = array[7];\n this[8] = array[8];\n this[9] = array[9];\n this[10] = array[10];\n this[11] = array[11];\n this[12] = array[12];\n this[13] = array[13];\n this[14] = array[14];\n this[15] = array[15];\n return this.check();\n }\n\n set(m00, m10, m20, m30, m01, m11, m21, m31, m02, m12, m22, m32, m03, m13, m23, m33) {\n this[0] = m00;\n this[1] = m10;\n this[2] = m20;\n this[3] = m30;\n this[4] = m01;\n this[5] = m11;\n this[6] = m21;\n this[7] = m31;\n this[8] = m02;\n this[9] = m12;\n this[10] = m22;\n this[11] = m32;\n this[12] = m03;\n this[13] = m13;\n this[14] = m23;\n this[15] = m33;\n return this.check();\n }\n\n setRowMajor(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n this[0] = m00;\n this[1] = m10;\n this[2] = m20;\n this[3] = m30;\n this[4] = m01;\n this[5] = m11;\n this[6] = m21;\n this[7] = m31;\n this[8] = m02;\n this[9] = m12;\n this[10] = m22;\n this[11] = m32;\n this[12] = m03;\n this[13] = m13;\n this[14] = m23;\n this[15] = m33;\n return this.check();\n }\n\n toRowMajor(result) {\n result[0] = this[0];\n result[1] = this[4];\n result[2] = this[8];\n result[3] = this[12];\n result[4] = this[1];\n result[5] = this[5];\n result[6] = this[9];\n result[7] = this[13];\n result[8] = this[2];\n result[9] = this[6];\n result[10] = this[10];\n result[11] = this[14];\n result[12] = this[3];\n result[13] = this[7];\n result[14] = this[11];\n result[15] = this[15];\n return result;\n }\n\n identity() {\n return this.copy(IDENTITY_MATRIX);\n }\n\n fromObject(object) {\n return this.check();\n }\n\n fromQuaternion(quaternion) {\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_1__.fromQuat(this, quaternion);\n return this.check();\n }\n\n frustum(view) {\n const {\n left,\n right,\n bottom,\n top,\n near = DEFAULT_NEAR,\n far = DEFAULT_FAR\n } = view;\n\n if (far === Infinity) {\n computeInfinitePerspectiveOffCenter(this, left, right, bottom, top, near);\n } else {\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_1__.frustum(this, left, right, bottom, top, near, far);\n }\n\n return this.check();\n }\n\n lookAt(view) {\n const {\n eye,\n center = [0, 0, 0],\n up = [0, 1, 0]\n } = view;\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_1__.lookAt(this, eye, center, up);\n return this.check();\n }\n\n ortho(view) {\n const {\n left,\n right,\n bottom,\n top,\n near = DEFAULT_NEAR,\n far = DEFAULT_FAR\n } = view;\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_1__.ortho(this, left, right, bottom, top, near, far);\n return this.check();\n }\n\n orthographic(view) {\n const {\n fovy = DEFAULT_FOVY,\n aspect = DEFAULT_ASPECT,\n focalDistance = 1,\n near = DEFAULT_NEAR,\n far = DEFAULT_FAR\n } = view;\n checkRadians(fovy);\n const halfY = fovy / 2;\n const top = focalDistance * Math.tan(halfY);\n const right = top * aspect;\n return this.ortho({\n left: -right,\n right,\n bottom: -top,\n top,\n near,\n far\n });\n }\n\n perspective(view) {\n const {\n fovy = 45 * Math.PI / 180,\n aspect = 1,\n near = 0.1,\n far = 500\n } = view;\n checkRadians(fovy);\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_1__.perspective(this, fovy, aspect, near, far);\n return this.check();\n }\n\n determinant() {\n return gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_1__.determinant(this);\n }\n\n getScale(result = [-0, -0, -0]) {\n result[0] = Math.sqrt(this[0] * this[0] + this[1] * this[1] + this[2] * this[2]);\n result[1] = Math.sqrt(this[4] * this[4] + this[5] * this[5] + this[6] * this[6]);\n result[2] = Math.sqrt(this[8] * this[8] + this[9] * this[9] + this[10] * this[10]);\n return result;\n }\n\n getTranslation(result = [-0, -0, -0]) {\n result[0] = this[12];\n result[1] = this[13];\n result[2] = this[14];\n return result;\n }\n\n getRotation(result, scaleResult) {\n result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];\n scaleResult = scaleResult || [-0, -0, -0];\n const scale = this.getScale(scaleResult);\n const inverseScale0 = 1 / scale[0];\n const inverseScale1 = 1 / scale[1];\n const inverseScale2 = 1 / scale[2];\n result[0] = this[0] * inverseScale0;\n result[1] = this[1] * inverseScale1;\n result[2] = this[2] * inverseScale2;\n result[3] = 0;\n result[4] = this[4] * inverseScale0;\n result[5] = this[5] * inverseScale1;\n result[6] = this[6] * inverseScale2;\n result[7] = 0;\n result[8] = this[8] * inverseScale0;\n result[9] = this[9] * inverseScale1;\n result[10] = this[10] * inverseScale2;\n result[11] = 0;\n result[12] = 0;\n result[13] = 0;\n result[14] = 0;\n result[15] = 1;\n return result;\n }\n\n getRotationMatrix3(result, scaleResult) {\n result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0];\n scaleResult = scaleResult || [-0, -0, -0];\n const scale = this.getScale(scaleResult);\n const inverseScale0 = 1 / scale[0];\n const inverseScale1 = 1 / scale[1];\n const inverseScale2 = 1 / scale[2];\n result[0] = this[0] * inverseScale0;\n result[1] = this[1] * inverseScale1;\n result[2] = this[2] * inverseScale2;\n result[3] = this[4] * inverseScale0;\n result[4] = this[5] * inverseScale1;\n result[5] = this[6] * inverseScale2;\n result[6] = this[8] * inverseScale0;\n result[7] = this[9] * inverseScale1;\n result[8] = this[10] * inverseScale2;\n return result;\n }\n\n transpose() {\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_1__.transpose(this, this);\n return this.check();\n }\n\n invert() {\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_1__.invert(this, this);\n return this.check();\n }\n\n multiplyLeft(a) {\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_1__.multiply(this, a, this);\n return this.check();\n }\n\n multiplyRight(a) {\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_1__.multiply(this, this, a);\n return this.check();\n }\n\n rotateX(radians) {\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_1__.rotateX(this, this, radians);\n return this.check();\n }\n\n rotateY(radians) {\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_1__.rotateY(this, this, radians);\n return this.check();\n }\n\n rotateZ(radians) {\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_1__.rotateZ(this, this, radians);\n return this.check();\n }\n\n rotateXYZ(angleXYZ) {\n return this.rotateX(angleXYZ[0]).rotateY(angleXYZ[1]).rotateZ(angleXYZ[2]);\n }\n\n rotateAxis(radians, axis) {\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_1__.rotate(this, this, radians, axis);\n return this.check();\n }\n\n scale(factor) {\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_1__.scale(this, this, Array.isArray(factor) ? factor : [factor, factor, factor]);\n return this.check();\n }\n\n translate(vector) {\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_1__.translate(this, this, vector);\n return this.check();\n }\n\n transform(vector, result) {\n if (vector.length === 4) {\n result = gl_matrix_vec4__WEBPACK_IMPORTED_MODULE_2__.transformMat4(result || [-0, -0, -0, -0], vector, this);\n (0,_lib_validators__WEBPACK_IMPORTED_MODULE_3__.checkVector)(result, 4);\n return result;\n }\n\n return this.transformAsPoint(vector, result);\n }\n\n transformAsPoint(vector, result) {\n const {\n length\n } = vector;\n let out;\n\n switch (length) {\n case 2:\n out = gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_4__.transformMat4(result || [-0, -0], vector, this);\n break;\n\n case 3:\n out = gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_5__.transformMat4(result || [-0, -0, -0], vector, this);\n break;\n\n default:\n throw new Error('Illegal vector');\n }\n\n (0,_lib_validators__WEBPACK_IMPORTED_MODULE_3__.checkVector)(out, vector.length);\n return out;\n }\n\n transformAsVector(vector, result) {\n let out;\n\n switch (vector.length) {\n case 2:\n out = (0,_lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_6__.vec2_transformMat4AsVector)(result || [-0, -0], vector, this);\n break;\n\n case 3:\n out = (0,_lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_6__.vec3_transformMat4AsVector)(result || [-0, -0, -0], vector, this);\n break;\n\n default:\n throw new Error('Illegal vector');\n }\n\n (0,_lib_validators__WEBPACK_IMPORTED_MODULE_3__.checkVector)(out, vector.length);\n return out;\n }\n\n transformPoint(vector, result) {\n return this.transformAsPoint(vector, result);\n }\n\n transformVector(vector, result) {\n return this.transformAsPoint(vector, result);\n }\n\n transformDirection(vector, result) {\n return this.transformAsVector(vector, result);\n }\n\n makeRotationX(radians) {\n return this.identity().rotateX(radians);\n }\n\n makeTranslation(x, y, z) {\n return this.identity().translate([x, y, z]);\n }\n\n}\nlet ZERO;\nlet IDENTITY;\n\nfunction getZeroMatrix() {\n if (!ZERO) {\n ZERO = new Matrix4([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);\n Object.freeze(ZERO);\n }\n\n return ZERO;\n}\n\nfunction getIdentityMatrix() {\n if (!IDENTITY) {\n IDENTITY = new Matrix4();\n Object.freeze(IDENTITY);\n }\n\n return IDENTITY;\n}\n\nfunction checkRadians(possiblyDegrees) {\n if (possiblyDegrees > Math.PI * 2) {\n throw Error('expected radians');\n }\n}\n\nfunction computeInfinitePerspectiveOffCenter(result, left, right, bottom, top, near) {\n const column0Row0 = 2 * near / (right - left);\n const column1Row1 = 2 * near / (top - bottom);\n const column2Row0 = (right + left) / (right - left);\n const column2Row1 = (top + bottom) / (top - bottom);\n const column2Row2 = -1;\n const column2Row3 = -1;\n const column3Row2 = -2 * near;\n result[0] = column0Row0;\n result[1] = 0;\n result[2] = 0;\n result[3] = 0;\n result[4] = 0;\n result[5] = column1Row1;\n result[6] = 0;\n result[7] = 0;\n result[8] = column2Row0;\n result[9] = column2Row1;\n result[10] = column2Row2;\n result[11] = column2Row3;\n result[12] = 0;\n result[13] = 0;\n result[14] = column3Row2;\n result[15] = 0;\n return result;\n}\n//# sourceMappingURL=matrix4.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/core/dist/esm/classes/matrix4.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/core/dist/esm/classes/vector3.js": +/*!****************************************************************!*\ + !*** ./node_modules/@math.gl/core/dist/esm/classes/vector3.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Vector3)\n/* harmony export */ });\n/* harmony import */ var _base_vector__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base/vector */ \"./node_modules/@math.gl/core/dist/esm/classes/base/vector.js\");\n/* harmony import */ var _lib_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/common */ \"./node_modules/@math.gl/core/dist/esm/lib/common.js\");\n/* harmony import */ var _lib_validators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/validators */ \"./node_modules/@math.gl/core/dist/esm/lib/validators.js\");\n/* harmony import */ var gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! gl-matrix/vec3 */ \"./node_modules/gl-matrix/esm/vec3.js\");\n/* harmony import */ var _lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/gl-matrix-extras */ \"./node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js\");\n\n\n\n\n\nconst ORIGIN = [0, 0, 0];\nlet ZERO;\nclass Vector3 extends _base_vector__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n static get ZERO() {\n if (!ZERO) {\n ZERO = new Vector3(0, 0, 0);\n Object.freeze(ZERO);\n }\n\n return ZERO;\n }\n\n constructor(x = 0, y = 0, z = 0) {\n super(-0, -0, -0);\n\n if (arguments.length === 1 && (0,_lib_common__WEBPACK_IMPORTED_MODULE_1__.isArray)(x)) {\n this.copy(x);\n } else {\n if (_lib_common__WEBPACK_IMPORTED_MODULE_1__.config.debug) {\n (0,_lib_validators__WEBPACK_IMPORTED_MODULE_2__.checkNumber)(x);\n (0,_lib_validators__WEBPACK_IMPORTED_MODULE_2__.checkNumber)(y);\n (0,_lib_validators__WEBPACK_IMPORTED_MODULE_2__.checkNumber)(z);\n }\n\n this[0] = x;\n this[1] = y;\n this[2] = z;\n }\n }\n\n set(x, y, z) {\n this[0] = x;\n this[1] = y;\n this[2] = z;\n return this.check();\n }\n\n copy(array) {\n this[0] = array[0];\n this[1] = array[1];\n this[2] = array[2];\n return this.check();\n }\n\n fromObject(object) {\n if (_lib_common__WEBPACK_IMPORTED_MODULE_1__.config.debug) {\n (0,_lib_validators__WEBPACK_IMPORTED_MODULE_2__.checkNumber)(object.x);\n (0,_lib_validators__WEBPACK_IMPORTED_MODULE_2__.checkNumber)(object.y);\n (0,_lib_validators__WEBPACK_IMPORTED_MODULE_2__.checkNumber)(object.z);\n }\n\n this[0] = object.x;\n this[1] = object.y;\n this[2] = object.z;\n return this.check();\n }\n\n toObject(object) {\n object.x = this[0];\n object.y = this[1];\n object.z = this[2];\n return object;\n }\n\n get ELEMENTS() {\n return 3;\n }\n\n get z() {\n return this[2];\n }\n\n set z(value) {\n this[2] = (0,_lib_validators__WEBPACK_IMPORTED_MODULE_2__.checkNumber)(value);\n }\n\n angle(vector) {\n return gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_3__.angle(this, vector);\n }\n\n cross(vector) {\n gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_3__.cross(this, this, vector);\n return this.check();\n }\n\n rotateX({\n radians,\n origin = ORIGIN\n }) {\n gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_3__.rotateX(this, this, origin, radians);\n return this.check();\n }\n\n rotateY({\n radians,\n origin = ORIGIN\n }) {\n gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_3__.rotateY(this, this, origin, radians);\n return this.check();\n }\n\n rotateZ({\n radians,\n origin = ORIGIN\n }) {\n gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_3__.rotateZ(this, this, origin, radians);\n return this.check();\n }\n\n transform(matrix4) {\n return this.transformAsPoint(matrix4);\n }\n\n transformAsPoint(matrix4) {\n gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_3__.transformMat4(this, this, matrix4);\n return this.check();\n }\n\n transformAsVector(matrix4) {\n (0,_lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_4__.vec3_transformMat4AsVector)(this, this, matrix4);\n return this.check();\n }\n\n transformByMatrix3(matrix3) {\n gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_3__.transformMat3(this, this, matrix3);\n return this.check();\n }\n\n transformByMatrix2(matrix2) {\n (0,_lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_4__.vec3_transformMat2)(this, this, matrix2);\n return this.check();\n }\n\n transformByQuaternion(quaternion) {\n gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_3__.transformQuat(this, this, quaternion);\n return this.check();\n }\n\n}\n//# sourceMappingURL=vector3.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/core/dist/esm/classes/vector3.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/core/dist/esm/lib/assert.js": +/*!***********************************************************!*\ + !*** ./node_modules/@math.gl/core/dist/esm/lib/assert.js ***! + \***********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ assert)\n/* harmony export */ });\nfunction assert(condition, message) {\n if (!condition) {\n throw new Error(\"math.gl assertion \".concat(message));\n }\n}\n//# sourceMappingURL=assert.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/core/dist/esm/lib/assert.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/core/dist/esm/lib/common.js": +/*!***********************************************************!*\ + !*** ./node_modules/@math.gl/core/dist/esm/lib/common.js ***! + \***********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ acos: () => (/* binding */ acos),\n/* harmony export */ asin: () => (/* binding */ asin),\n/* harmony export */ atan: () => (/* binding */ atan),\n/* harmony export */ clamp: () => (/* binding */ clamp),\n/* harmony export */ clone: () => (/* binding */ clone),\n/* harmony export */ config: () => (/* binding */ config),\n/* harmony export */ configure: () => (/* binding */ configure),\n/* harmony export */ cos: () => (/* binding */ cos),\n/* harmony export */ degrees: () => (/* binding */ degrees),\n/* harmony export */ equals: () => (/* binding */ equals),\n/* harmony export */ exactEquals: () => (/* binding */ exactEquals),\n/* harmony export */ formatValue: () => (/* binding */ formatValue),\n/* harmony export */ isArray: () => (/* binding */ isArray),\n/* harmony export */ lerp: () => (/* binding */ lerp),\n/* harmony export */ radians: () => (/* binding */ radians),\n/* harmony export */ sin: () => (/* binding */ sin),\n/* harmony export */ tan: () => (/* binding */ tan),\n/* harmony export */ toDegrees: () => (/* binding */ toDegrees),\n/* harmony export */ toRadians: () => (/* binding */ toRadians),\n/* harmony export */ withEpsilon: () => (/* binding */ withEpsilon)\n/* harmony export */ });\n/* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assert */ \"./node_modules/@math.gl/core/dist/esm/lib/assert.js\");\n\nconst RADIANS_TO_DEGREES = 1 / Math.PI * 180;\nconst DEGREES_TO_RADIANS = 1 / 180 * Math.PI;\nconst config = {\n EPSILON: 1e-12,\n debug: false,\n precision: 4,\n printTypes: false,\n printDegrees: false,\n printRowMajor: true\n};\nfunction configure(options) {\n for (const key in options) {\n (0,_assert__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(key in config);\n config[key] = options[key];\n }\n\n return config;\n}\nfunction formatValue(value, {\n precision = config.precision\n} = {}) {\n value = round(value);\n return \"\".concat(parseFloat(value.toPrecision(precision)));\n}\nfunction isArray(value) {\n return Array.isArray(value) || ArrayBuffer.isView(value) && !(value instanceof DataView);\n}\nfunction clone(array) {\n return 'clone' in array ? array.clone() : array.slice();\n}\nfunction toRadians(degrees) {\n return radians(degrees);\n}\nfunction toDegrees(radians) {\n return degrees(radians);\n}\nfunction radians(degrees, result) {\n return map(degrees, degrees => degrees * DEGREES_TO_RADIANS, result);\n}\nfunction degrees(radians, result) {\n return map(radians, radians => radians * RADIANS_TO_DEGREES, result);\n}\nfunction sin(radians, result) {\n return map(radians, angle => Math.sin(angle), result);\n}\nfunction cos(radians, result) {\n return map(radians, angle => Math.cos(angle), result);\n}\nfunction tan(radians, result) {\n return map(radians, angle => Math.tan(angle), result);\n}\nfunction asin(radians, result) {\n return map(radians, angle => Math.asin(angle), result);\n}\nfunction acos(radians, result) {\n return map(radians, angle => Math.acos(angle), result);\n}\nfunction atan(radians, result) {\n return map(radians, angle => Math.atan(angle), result);\n}\nfunction clamp(value, min, max) {\n return map(value, value => Math.max(min, Math.min(max, value)));\n}\nfunction lerp(a, b, t) {\n if (isArray(a)) {\n return a.map((ai, i) => lerp(ai, b[i], t));\n }\n\n return t * b + (1 - t) * a;\n}\nfunction equals(a, b, epsilon) {\n const oldEpsilon = config.EPSILON;\n\n if (epsilon) {\n config.EPSILON = epsilon;\n }\n\n try {\n if (a === b) {\n return true;\n }\n\n if (isArray(a) && isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n\n for (let i = 0; i < a.length; ++i) {\n if (!equals(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n }\n\n if (a && a.equals) {\n return a.equals(b);\n }\n\n if (b && b.equals) {\n return b.equals(a);\n }\n\n if (typeof a === 'number' && typeof b === 'number') {\n return Math.abs(a - b) <= config.EPSILON * Math.max(1, Math.abs(a), Math.abs(b));\n }\n\n return false;\n } finally {\n config.EPSILON = oldEpsilon;\n }\n}\nfunction exactEquals(a, b) {\n if (a === b) {\n return true;\n }\n\n if (a && typeof a === 'object' && b && typeof b === 'object') {\n if (a.constructor !== b.constructor) {\n return false;\n }\n\n if (a.exactEquals) {\n return a.exactEquals(b);\n }\n }\n\n if (isArray(a) && isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n\n for (let i = 0; i < a.length; ++i) {\n if (!exactEquals(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n}\nfunction withEpsilon(epsilon, func) {\n const oldPrecision = config.EPSILON;\n config.EPSILON = epsilon;\n let value;\n\n try {\n value = func();\n } finally {\n config.EPSILON = oldPrecision;\n }\n\n return value;\n}\n\nfunction round(value) {\n return Math.round(value / config.EPSILON) * config.EPSILON;\n}\n\nfunction duplicateArray(array) {\n return array.clone ? array.clone() : new Array(array.length);\n}\n\nfunction map(value, func, result) {\n if (isArray(value)) {\n const array = value;\n result = result || duplicateArray(array);\n\n for (let i = 0; i < result.length && i < array.length; ++i) {\n result[i] = func(value[i], i, result);\n }\n\n return result;\n }\n\n return func(value);\n}\n//# sourceMappingURL=common.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/core/dist/esm/lib/common.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ vec2_transformMat4AsVector: () => (/* binding */ vec2_transformMat4AsVector),\n/* harmony export */ vec3_transformMat2: () => (/* binding */ vec3_transformMat2),\n/* harmony export */ vec3_transformMat4AsVector: () => (/* binding */ vec3_transformMat4AsVector),\n/* harmony export */ vec4_transformMat2: () => (/* binding */ vec4_transformMat2),\n/* harmony export */ vec4_transformMat3: () => (/* binding */ vec4_transformMat3)\n/* harmony export */ });\nfunction vec2_transformMat4AsVector(out, a, m) {\n const x = a[0];\n const y = a[1];\n const w = m[3] * x + m[7] * y || 1.0;\n out[0] = (m[0] * x + m[4] * y) / w;\n out[1] = (m[1] * x + m[5] * y) / w;\n return out;\n}\nfunction vec3_transformMat4AsVector(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z) / w;\n return out;\n}\nfunction vec3_transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n out[2] = a[2];\n return out;\n}\nfunction vec4_transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\nfunction vec4_transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n out[0] = m[0] * x + m[3] * y + m[6] * z;\n out[1] = m[1] * x + m[4] * y + m[7] * z;\n out[2] = m[2] * x + m[5] * y + m[8] * z;\n out[3] = a[3];\n return out;\n}\n//# sourceMappingURL=gl-matrix-extras.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/core/dist/esm/lib/validators.js": +/*!***************************************************************!*\ + !*** ./node_modules/@math.gl/core/dist/esm/lib/validators.js ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ checkNumber: () => (/* binding */ checkNumber),\n/* harmony export */ checkVector: () => (/* binding */ checkVector),\n/* harmony export */ deprecated: () => (/* binding */ deprecated),\n/* harmony export */ validateVector: () => (/* binding */ validateVector)\n/* harmony export */ });\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common */ \"./node_modules/@math.gl/core/dist/esm/lib/common.js\");\n\nfunction validateVector(v, length) {\n if (v.length !== length) {\n return false;\n }\n\n for (let i = 0; i < v.length; ++i) {\n if (!Number.isFinite(v[i])) {\n return false;\n }\n }\n\n return true;\n}\nfunction checkNumber(value) {\n if (!Number.isFinite(value)) {\n throw new Error(\"Invalid number \".concat(value));\n }\n\n return value;\n}\nfunction checkVector(v, length, callerName = '') {\n if (_common__WEBPACK_IMPORTED_MODULE_0__.config.debug && !validateVector(v, length)) {\n throw new Error(\"math.gl: \".concat(callerName, \" some fields set to invalid numbers'\"));\n }\n\n return v;\n}\nconst map = {};\nfunction deprecated(method, version) {\n if (!map[method]) {\n map[method] = true;\n console.warn(\"\".concat(method, \" has been removed in version \").concat(version, \", see upgrade guide for more information\"));\n }\n}\n//# sourceMappingURL=validators.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/core/dist/esm/lib/validators.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/web-mercator/dist/esm/assert.js": +/*!***************************************************************!*\ + !*** ./node_modules/@math.gl/web-mercator/dist/esm/assert.js ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ assert)\n/* harmony export */ });\nfunction assert(condition, message) {\n if (!condition) {\n throw new Error(message || '@math.gl/web-mercator: assertion failed.');\n }\n}\n//# sourceMappingURL=assert.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/web-mercator/dist/esm/assert.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/web-mercator/dist/esm/fit-bounds.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@math.gl/web-mercator/dist/esm/fit-bounds.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ fitBounds)\n/* harmony export */ });\n/* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assert */ \"./node_modules/@math.gl/web-mercator/dist/esm/assert.js\");\n/* harmony import */ var _math_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./math-utils */ \"./node_modules/@math.gl/web-mercator/dist/esm/math-utils.js\");\n/* harmony import */ var _web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./web-mercator-utils */ \"./node_modules/@math.gl/web-mercator/dist/esm/web-mercator-utils.js\");\n\n\n\nfunction fitBounds(options) {\n const {\n width,\n height,\n bounds,\n minExtent = 0,\n maxZoom = 24,\n offset = [0, 0]\n } = options;\n const [[west, south], [east, north]] = bounds;\n const padding = getPaddingObject(options.padding);\n const nw = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.lngLatToWorld)([west, (0,_math_utils__WEBPACK_IMPORTED_MODULE_1__.clamp)(north, -_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.MAX_LATITUDE, _web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.MAX_LATITUDE)]);\n const se = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.lngLatToWorld)([east, (0,_math_utils__WEBPACK_IMPORTED_MODULE_1__.clamp)(south, -_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.MAX_LATITUDE, _web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.MAX_LATITUDE)]);\n const size = [Math.max(Math.abs(se[0] - nw[0]), minExtent), Math.max(Math.abs(se[1] - nw[1]), minExtent)];\n const targetSize = [width - padding.left - padding.right - Math.abs(offset[0]) * 2, height - padding.top - padding.bottom - Math.abs(offset[1]) * 2];\n (0,_assert__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(targetSize[0] > 0 && targetSize[1] > 0);\n const scaleX = targetSize[0] / size[0];\n const scaleY = targetSize[1] / size[1];\n const offsetX = (padding.right - padding.left) / 2 / scaleX;\n const offsetY = (padding.top - padding.bottom) / 2 / scaleY;\n const center = [(se[0] + nw[0]) / 2 + offsetX, (se[1] + nw[1]) / 2 + offsetY];\n const centerLngLat = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.worldToLngLat)(center);\n const zoom = Math.min(maxZoom, (0,_math_utils__WEBPACK_IMPORTED_MODULE_1__.log2)(Math.abs(Math.min(scaleX, scaleY))));\n (0,_assert__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Number.isFinite(zoom));\n return {\n longitude: centerLngLat[0],\n latitude: centerLngLat[1],\n zoom\n };\n}\n\nfunction getPaddingObject(padding = 0) {\n if (typeof padding === 'number') {\n return {\n top: padding,\n bottom: padding,\n left: padding,\n right: padding\n };\n }\n\n (0,_assert__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Number.isFinite(padding.top) && Number.isFinite(padding.bottom) && Number.isFinite(padding.left) && Number.isFinite(padding.right));\n return padding;\n}\n//# sourceMappingURL=fit-bounds.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/web-mercator/dist/esm/fit-bounds.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/web-mercator/dist/esm/fly-to-viewport.js": +/*!************************************************************************!*\ + !*** ./node_modules/@math.gl/web-mercator/dist/esm/fly-to-viewport.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ flyToViewport),\n/* harmony export */ getFlyToDuration: () => (/* binding */ getFlyToDuration)\n/* harmony export */ });\n/* harmony import */ var _math_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math-utils */ \"./node_modules/@math.gl/web-mercator/dist/esm/math-utils.js\");\n/* harmony import */ var _web_mercator_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./web-mercator-utils */ \"./node_modules/@math.gl/web-mercator/dist/esm/web-mercator-utils.js\");\n/* harmony import */ var gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gl-matrix/vec2 */ \"./node_modules/gl-matrix/esm/vec2.js\");\n\n\n\nconst EPSILON = 0.01;\nconst VIEWPORT_TRANSITION_PROPS = ['longitude', 'latitude', 'zoom'];\nconst DEFAULT_OPTS = {\n curve: 1.414,\n speed: 1.2\n};\nfunction flyToViewport(startProps, endProps, t, options) {\n const {\n startZoom,\n startCenterXY,\n uDelta,\n w0,\n u1,\n S,\n rho,\n rho2,\n r0\n } = getFlyToTransitionParams(startProps, endProps, options);\n\n if (u1 < EPSILON) {\n const viewport = {};\n\n for (const key of VIEWPORT_TRANSITION_PROPS) {\n const startValue = startProps[key];\n const endValue = endProps[key];\n viewport[key] = (0,_math_utils__WEBPACK_IMPORTED_MODULE_0__.lerp)(startValue, endValue, t);\n }\n\n return viewport;\n }\n\n const s = t * S;\n const w = Math.cosh(r0) / Math.cosh(r0 + rho * s);\n const u = w0 * ((Math.cosh(r0) * Math.tanh(r0 + rho * s) - Math.sinh(r0)) / rho2) / u1;\n const scaleIncrement = 1 / w;\n const newZoom = startZoom + (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_1__.scaleToZoom)(scaleIncrement);\n const newCenterWorld = gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_2__.scale([], uDelta, u);\n gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_2__.add(newCenterWorld, newCenterWorld, startCenterXY);\n const newCenter = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_1__.worldToLngLat)(newCenterWorld);\n return {\n longitude: newCenter[0],\n latitude: newCenter[1],\n zoom: newZoom\n };\n}\nfunction getFlyToDuration(startProps, endProps, options) {\n const opts = { ...DEFAULT_OPTS,\n ...options\n };\n const {\n screenSpeed,\n speed,\n maxDuration\n } = opts;\n const {\n S,\n rho\n } = getFlyToTransitionParams(startProps, endProps, opts);\n const length = 1000 * S;\n let duration;\n\n if (Number.isFinite(screenSpeed)) {\n duration = length / (screenSpeed / rho);\n } else {\n duration = length / speed;\n }\n\n return Number.isFinite(maxDuration) && duration > maxDuration ? 0 : duration;\n}\n\nfunction getFlyToTransitionParams(startProps, endProps, opts) {\n opts = Object.assign({}, DEFAULT_OPTS, opts);\n const rho = opts.curve;\n const startZoom = startProps.zoom;\n const startCenter = [startProps.longitude, startProps.latitude];\n const startScale = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_1__.zoomToScale)(startZoom);\n const endZoom = endProps.zoom;\n const endCenter = [endProps.longitude, endProps.latitude];\n const scale = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_1__.zoomToScale)(endZoom - startZoom);\n const startCenterXY = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_1__.lngLatToWorld)(startCenter);\n const endCenterXY = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_1__.lngLatToWorld)(endCenter);\n const uDelta = gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_2__.sub([], endCenterXY, startCenterXY);\n const w0 = Math.max(startProps.width, startProps.height);\n const w1 = w0 / scale;\n const u1 = gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_2__.length(uDelta) * startScale;\n\n const _u1 = Math.max(u1, EPSILON);\n\n const rho2 = rho * rho;\n const b0 = (w1 * w1 - w0 * w0 + rho2 * rho2 * _u1 * _u1) / (2 * w0 * rho2 * _u1);\n const b1 = (w1 * w1 - w0 * w0 - rho2 * rho2 * _u1 * _u1) / (2 * w1 * rho2 * _u1);\n const r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0);\n const r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n const S = (r1 - r0) / rho;\n return {\n startZoom,\n startCenterXY,\n uDelta,\n w0,\n u1,\n S,\n rho,\n rho2,\n r0,\n r1\n };\n}\n//# sourceMappingURL=fly-to-viewport.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/web-mercator/dist/esm/fly-to-viewport.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/web-mercator/dist/esm/get-bounds.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@math.gl/web-mercator/dist/esm/get-bounds.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ getBounds)\n/* harmony export */ });\n/* harmony import */ var _web_mercator_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./web-mercator-utils */ \"./node_modules/@math.gl/web-mercator/dist/esm/web-mercator-utils.js\");\n/* harmony import */ var gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gl-matrix/vec2 */ \"./node_modules/gl-matrix/esm/vec2.js\");\n/* harmony import */ var _math_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./math-utils */ \"./node_modules/@math.gl/web-mercator/dist/esm/math-utils.js\");\n\n\n\nconst DEGREES_TO_RADIANS = Math.PI / 180;\nfunction getBounds(viewport, z = 0) {\n const {\n width,\n height,\n unproject\n } = viewport;\n const unprojectOps = {\n targetZ: z\n };\n const bottomLeft = unproject([0, height], unprojectOps);\n const bottomRight = unproject([width, height], unprojectOps);\n let topLeft;\n let topRight;\n const halfFov = viewport.fovy ? 0.5 * viewport.fovy * DEGREES_TO_RADIANS : Math.atan(0.5 / viewport.altitude);\n const angleToGround = (90 - viewport.pitch) * DEGREES_TO_RADIANS;\n\n if (halfFov > angleToGround - 0.01) {\n topLeft = unprojectOnFarPlane(viewport, 0, z);\n topRight = unprojectOnFarPlane(viewport, width, z);\n } else {\n topLeft = unproject([0, 0], unprojectOps);\n topRight = unproject([width, 0], unprojectOps);\n }\n\n return [bottomLeft, bottomRight, topRight, topLeft];\n}\n\nfunction unprojectOnFarPlane(viewport, x, targetZ) {\n const {\n pixelUnprojectionMatrix\n } = viewport;\n const coord0 = (0,_math_utils__WEBPACK_IMPORTED_MODULE_1__.transformVector)(pixelUnprojectionMatrix, [x, 0, 1, 1]);\n const coord1 = (0,_math_utils__WEBPACK_IMPORTED_MODULE_1__.transformVector)(pixelUnprojectionMatrix, [x, viewport.height, 1, 1]);\n const z = targetZ * viewport.distanceScales.unitsPerMeter[2];\n const t = (z - coord0[2]) / (coord1[2] - coord0[2]);\n const coord = gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_2__.lerp([], coord0, coord1, t);\n const result = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_0__.worldToLngLat)(coord);\n result.push(targetZ);\n return result;\n}\n//# sourceMappingURL=get-bounds.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/web-mercator/dist/esm/get-bounds.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/web-mercator/dist/esm/index.js": +/*!**************************************************************!*\ + !*** ./node_modules/@math.gl/web-mercator/dist/esm/index.js ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MAX_LATITUDE: () => (/* reexport safe */ _web_mercator_utils__WEBPACK_IMPORTED_MODULE_5__.MAX_LATITUDE),\n/* harmony export */ WebMercatorViewport: () => (/* reexport safe */ _web_mercator_viewport__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ addMetersToLngLat: () => (/* reexport safe */ _web_mercator_utils__WEBPACK_IMPORTED_MODULE_5__.addMetersToLngLat),\n/* harmony export */ altitudeToFovy: () => (/* reexport safe */ _web_mercator_utils__WEBPACK_IMPORTED_MODULE_5__.altitudeToFovy),\n/* harmony export */ \"default\": () => (/* reexport safe */ _web_mercator_viewport__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ fitBounds: () => (/* reexport safe */ _fit_bounds__WEBPACK_IMPORTED_MODULE_2__[\"default\"]),\n/* harmony export */ flyToViewport: () => (/* reexport safe */ _fly_to_viewport__WEBPACK_IMPORTED_MODULE_4__[\"default\"]),\n/* harmony export */ fovyToAltitude: () => (/* reexport safe */ _web_mercator_utils__WEBPACK_IMPORTED_MODULE_5__.fovyToAltitude),\n/* harmony export */ getBounds: () => (/* reexport safe */ _get_bounds__WEBPACK_IMPORTED_MODULE_1__[\"default\"]),\n/* harmony export */ getDistanceScales: () => (/* reexport safe */ _web_mercator_utils__WEBPACK_IMPORTED_MODULE_5__.getDistanceScales),\n/* harmony export */ getFlyToDuration: () => (/* reexport safe */ _fly_to_viewport__WEBPACK_IMPORTED_MODULE_4__.getFlyToDuration),\n/* harmony export */ getMeterZoom: () => (/* reexport safe */ _web_mercator_utils__WEBPACK_IMPORTED_MODULE_5__.getMeterZoom),\n/* harmony export */ getProjectionMatrix: () => (/* reexport safe */ _web_mercator_utils__WEBPACK_IMPORTED_MODULE_5__.getProjectionMatrix),\n/* harmony export */ getProjectionParameters: () => (/* reexport safe */ _web_mercator_utils__WEBPACK_IMPORTED_MODULE_5__.getProjectionParameters),\n/* harmony export */ getViewMatrix: () => (/* reexport safe */ _web_mercator_utils__WEBPACK_IMPORTED_MODULE_5__.getViewMatrix),\n/* harmony export */ lngLatToWorld: () => (/* reexport safe */ _web_mercator_utils__WEBPACK_IMPORTED_MODULE_5__.lngLatToWorld),\n/* harmony export */ normalizeViewportProps: () => (/* reexport safe */ _normalize_viewport_props__WEBPACK_IMPORTED_MODULE_3__[\"default\"]),\n/* harmony export */ pixelsToWorld: () => (/* reexport safe */ _web_mercator_utils__WEBPACK_IMPORTED_MODULE_5__.pixelsToWorld),\n/* harmony export */ scaleToZoom: () => (/* reexport safe */ _web_mercator_utils__WEBPACK_IMPORTED_MODULE_5__.scaleToZoom),\n/* harmony export */ unitsPerMeter: () => (/* reexport safe */ _web_mercator_utils__WEBPACK_IMPORTED_MODULE_5__.unitsPerMeter),\n/* harmony export */ worldToLngLat: () => (/* reexport safe */ _web_mercator_utils__WEBPACK_IMPORTED_MODULE_5__.worldToLngLat),\n/* harmony export */ worldToPixels: () => (/* reexport safe */ _web_mercator_utils__WEBPACK_IMPORTED_MODULE_5__.worldToPixels),\n/* harmony export */ zoomToScale: () => (/* reexport safe */ _web_mercator_utils__WEBPACK_IMPORTED_MODULE_5__.zoomToScale)\n/* harmony export */ });\n/* harmony import */ var _web_mercator_viewport__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./web-mercator-viewport */ \"./node_modules/@math.gl/web-mercator/dist/esm/web-mercator-viewport.js\");\n/* harmony import */ var _get_bounds__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./get-bounds */ \"./node_modules/@math.gl/web-mercator/dist/esm/get-bounds.js\");\n/* harmony import */ var _fit_bounds__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fit-bounds */ \"./node_modules/@math.gl/web-mercator/dist/esm/fit-bounds.js\");\n/* harmony import */ var _normalize_viewport_props__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./normalize-viewport-props */ \"./node_modules/@math.gl/web-mercator/dist/esm/normalize-viewport-props.js\");\n/* harmony import */ var _fly_to_viewport__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./fly-to-viewport */ \"./node_modules/@math.gl/web-mercator/dist/esm/fly-to-viewport.js\");\n/* harmony import */ var _web_mercator_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./web-mercator-utils */ \"./node_modules/@math.gl/web-mercator/dist/esm/web-mercator-utils.js\");\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/web-mercator/dist/esm/index.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/web-mercator/dist/esm/math-utils.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@math.gl/web-mercator/dist/esm/math-utils.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ clamp: () => (/* binding */ clamp),\n/* harmony export */ createMat4: () => (/* binding */ createMat4),\n/* harmony export */ lerp: () => (/* binding */ lerp),\n/* harmony export */ log2: () => (/* binding */ log2),\n/* harmony export */ mod: () => (/* binding */ mod),\n/* harmony export */ transformVector: () => (/* binding */ transformVector)\n/* harmony export */ });\n/* harmony import */ var gl_matrix_vec4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix/vec4 */ \"./node_modules/gl-matrix/esm/vec4.js\");\n\nfunction createMat4() {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}\nfunction transformVector(matrix, vector) {\n const result = (0,gl_matrix_vec4__WEBPACK_IMPORTED_MODULE_0__.transformMat4)([], vector, matrix);\n (0,gl_matrix_vec4__WEBPACK_IMPORTED_MODULE_0__.scale)(result, result, 1 / result[3]);\n return result;\n}\nfunction mod(value, divisor) {\n const modulus = value % divisor;\n return modulus < 0 ? divisor + modulus : modulus;\n}\nfunction lerp(start, end, step) {\n return step * end + (1 - step) * start;\n}\nfunction clamp(x, min, max) {\n return x < min ? min : x > max ? max : x;\n}\n\nfunction ieLog2(x) {\n return Math.log(x) * Math.LOG2E;\n}\n\nconst log2 = Math.log2 || ieLog2;\n//# sourceMappingURL=math-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/web-mercator/dist/esm/math-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/web-mercator/dist/esm/normalize-viewport-props.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@math.gl/web-mercator/dist/esm/normalize-viewport-props.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ normalizeViewportProps)\n/* harmony export */ });\n/* harmony import */ var _web_mercator_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./web-mercator-utils */ \"./node_modules/@math.gl/web-mercator/dist/esm/web-mercator-utils.js\");\n/* harmony import */ var _math_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./math-utils */ \"./node_modules/@math.gl/web-mercator/dist/esm/math-utils.js\");\n\n\nconst TILE_SIZE = 512;\nfunction normalizeViewportProps(props) {\n const {\n width,\n height,\n pitch = 0\n } = props;\n let {\n longitude,\n latitude,\n zoom,\n bearing = 0\n } = props;\n\n if (longitude < -180 || longitude > 180) {\n longitude = (0,_math_utils__WEBPACK_IMPORTED_MODULE_1__.mod)(longitude + 180, 360) - 180;\n }\n\n if (bearing < -180 || bearing > 180) {\n bearing = (0,_math_utils__WEBPACK_IMPORTED_MODULE_1__.mod)(bearing + 180, 360) - 180;\n }\n\n const minZoom = (0,_math_utils__WEBPACK_IMPORTED_MODULE_1__.log2)(height / TILE_SIZE);\n\n if (zoom <= minZoom) {\n zoom = minZoom;\n latitude = 0;\n } else {\n const halfHeightPixels = height / 2 / Math.pow(2, zoom);\n const minLatitude = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_0__.worldToLngLat)([0, halfHeightPixels])[1];\n\n if (latitude < minLatitude) {\n latitude = minLatitude;\n } else {\n const maxLatitude = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_0__.worldToLngLat)([0, TILE_SIZE - halfHeightPixels])[1];\n\n if (latitude > maxLatitude) {\n latitude = maxLatitude;\n }\n }\n }\n\n return {\n width,\n height,\n longitude,\n latitude,\n zoom,\n pitch,\n bearing\n };\n}\n//# sourceMappingURL=normalize-viewport-props.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/web-mercator/dist/esm/normalize-viewport-props.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/web-mercator/dist/esm/web-mercator-utils.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@math.gl/web-mercator/dist/esm/web-mercator-utils.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DEFAULT_ALTITUDE: () => (/* binding */ DEFAULT_ALTITUDE),\n/* harmony export */ MAX_LATITUDE: () => (/* binding */ MAX_LATITUDE),\n/* harmony export */ addMetersToLngLat: () => (/* binding */ addMetersToLngLat),\n/* harmony export */ altitudeToFovy: () => (/* binding */ altitudeToFovy),\n/* harmony export */ fovyToAltitude: () => (/* binding */ fovyToAltitude),\n/* harmony export */ getDistanceScales: () => (/* binding */ getDistanceScales),\n/* harmony export */ getMeterZoom: () => (/* binding */ getMeterZoom),\n/* harmony export */ getProjectionMatrix: () => (/* binding */ getProjectionMatrix),\n/* harmony export */ getProjectionParameters: () => (/* binding */ getProjectionParameters),\n/* harmony export */ getViewMatrix: () => (/* binding */ getViewMatrix),\n/* harmony export */ lngLatToWorld: () => (/* binding */ lngLatToWorld),\n/* harmony export */ pixelsToWorld: () => (/* binding */ pixelsToWorld),\n/* harmony export */ scaleToZoom: () => (/* binding */ scaleToZoom),\n/* harmony export */ unitsPerMeter: () => (/* binding */ unitsPerMeter),\n/* harmony export */ worldToLngLat: () => (/* binding */ worldToLngLat),\n/* harmony export */ worldToPixels: () => (/* binding */ worldToPixels),\n/* harmony export */ zoomToScale: () => (/* binding */ zoomToScale)\n/* harmony export */ });\n/* harmony import */ var _math_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math-utils */ \"./node_modules/@math.gl/web-mercator/dist/esm/math-utils.js\");\n/* harmony import */ var gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gl-matrix/mat4 */ \"./node_modules/gl-matrix/esm/mat4.js\");\n/* harmony import */ var gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! gl-matrix/vec2 */ \"./node_modules/gl-matrix/esm/vec2.js\");\n/* harmony import */ var gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! gl-matrix/vec3 */ \"./node_modules/gl-matrix/esm/vec3.js\");\n/* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assert */ \"./node_modules/@math.gl/web-mercator/dist/esm/assert.js\");\n\n\n\n\n\nconst PI = Math.PI;\nconst PI_4 = PI / 4;\nconst DEGREES_TO_RADIANS = PI / 180;\nconst RADIANS_TO_DEGREES = 180 / PI;\nconst TILE_SIZE = 512;\nconst EARTH_CIRCUMFERENCE = 40.03e6;\nconst MAX_LATITUDE = 85.051129;\nconst DEFAULT_ALTITUDE = 1.5;\nfunction zoomToScale(zoom) {\n return Math.pow(2, zoom);\n}\nfunction scaleToZoom(scale) {\n return (0,_math_utils__WEBPACK_IMPORTED_MODULE_0__.log2)(scale);\n}\nfunction lngLatToWorld(lngLat) {\n const [lng, lat] = lngLat;\n (0,_assert__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Number.isFinite(lng));\n (0,_assert__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Number.isFinite(lat) && lat >= -90 && lat <= 90, 'invalid latitude');\n const lambda2 = lng * DEGREES_TO_RADIANS;\n const phi2 = lat * DEGREES_TO_RADIANS;\n const x = TILE_SIZE * (lambda2 + PI) / (2 * PI);\n const y = TILE_SIZE * (PI + Math.log(Math.tan(PI_4 + phi2 * 0.5))) / (2 * PI);\n return [x, y];\n}\nfunction worldToLngLat(xy) {\n const [x, y] = xy;\n const lambda2 = x / TILE_SIZE * (2 * PI) - PI;\n const phi2 = 2 * (Math.atan(Math.exp(y / TILE_SIZE * (2 * PI) - PI)) - PI_4);\n return [lambda2 * RADIANS_TO_DEGREES, phi2 * RADIANS_TO_DEGREES];\n}\nfunction getMeterZoom(options) {\n const {\n latitude\n } = options;\n (0,_assert__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Number.isFinite(latitude));\n const latCosine = Math.cos(latitude * DEGREES_TO_RADIANS);\n return scaleToZoom(EARTH_CIRCUMFERENCE * latCosine) - 9;\n}\nfunction unitsPerMeter(latitude) {\n const latCosine = Math.cos(latitude * DEGREES_TO_RADIANS);\n return TILE_SIZE / EARTH_CIRCUMFERENCE / latCosine;\n}\nfunction getDistanceScales(options) {\n const {\n latitude,\n longitude,\n highPrecision = false\n } = options;\n (0,_assert__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Number.isFinite(latitude) && Number.isFinite(longitude));\n const worldSize = TILE_SIZE;\n const latCosine = Math.cos(latitude * DEGREES_TO_RADIANS);\n const unitsPerDegreeX = worldSize / 360;\n const unitsPerDegreeY = unitsPerDegreeX / latCosine;\n const altUnitsPerMeter = worldSize / EARTH_CIRCUMFERENCE / latCosine;\n const result = {\n unitsPerMeter: [altUnitsPerMeter, altUnitsPerMeter, altUnitsPerMeter],\n metersPerUnit: [1 / altUnitsPerMeter, 1 / altUnitsPerMeter, 1 / altUnitsPerMeter],\n unitsPerDegree: [unitsPerDegreeX, unitsPerDegreeY, altUnitsPerMeter],\n degreesPerUnit: [1 / unitsPerDegreeX, 1 / unitsPerDegreeY, 1 / altUnitsPerMeter]\n };\n\n if (highPrecision) {\n const latCosine2 = DEGREES_TO_RADIANS * Math.tan(latitude * DEGREES_TO_RADIANS) / latCosine;\n const unitsPerDegreeY2 = unitsPerDegreeX * latCosine2 / 2;\n const altUnitsPerDegree2 = worldSize / EARTH_CIRCUMFERENCE * latCosine2;\n const altUnitsPerMeter2 = altUnitsPerDegree2 / unitsPerDegreeY * altUnitsPerMeter;\n result.unitsPerDegree2 = [0, unitsPerDegreeY2, altUnitsPerDegree2];\n result.unitsPerMeter2 = [altUnitsPerMeter2, 0, altUnitsPerMeter2];\n }\n\n return result;\n}\nfunction addMetersToLngLat(lngLatZ, xyz) {\n const [longitude, latitude, z0] = lngLatZ;\n const [x, y, z] = xyz;\n const {\n unitsPerMeter,\n unitsPerMeter2\n } = getDistanceScales({\n longitude,\n latitude,\n highPrecision: true\n });\n const worldspace = lngLatToWorld(lngLatZ);\n worldspace[0] += x * (unitsPerMeter[0] + unitsPerMeter2[0] * y);\n worldspace[1] += y * (unitsPerMeter[1] + unitsPerMeter2[1] * y);\n const newLngLat = worldToLngLat(worldspace);\n const newZ = (z0 || 0) + (z || 0);\n return Number.isFinite(z0) || Number.isFinite(z) ? [newLngLat[0], newLngLat[1], newZ] : newLngLat;\n}\nfunction getViewMatrix(options) {\n const {\n height,\n pitch,\n bearing,\n altitude,\n scale,\n center\n } = options;\n const vm = (0,_math_utils__WEBPACK_IMPORTED_MODULE_0__.createMat4)();\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_2__.translate(vm, vm, [0, 0, -altitude]);\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_2__.rotateX(vm, vm, -pitch * DEGREES_TO_RADIANS);\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_2__.rotateZ(vm, vm, bearing * DEGREES_TO_RADIANS);\n const relativeScale = scale / height;\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_2__.scale(vm, vm, [relativeScale, relativeScale, relativeScale]);\n\n if (center) {\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_2__.translate(vm, vm, gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_3__.negate([], center));\n }\n\n return vm;\n}\nfunction getProjectionParameters(options) {\n const {\n width,\n height,\n altitude,\n pitch = 0,\n offset,\n center,\n scale,\n nearZMultiplier = 1,\n farZMultiplier = 1\n } = options;\n let {\n fovy = altitudeToFovy(DEFAULT_ALTITUDE)\n } = options;\n\n if (altitude !== undefined) {\n fovy = altitudeToFovy(altitude);\n }\n\n const fovRadians = fovy * DEGREES_TO_RADIANS;\n const pitchRadians = pitch * DEGREES_TO_RADIANS;\n const focalDistance = fovyToAltitude(fovy);\n let cameraToSeaLevelDistance = focalDistance;\n\n if (center) {\n cameraToSeaLevelDistance += center[2] * scale / Math.cos(pitchRadians) / height;\n }\n\n const fovAboveCenter = fovRadians * (0.5 + (offset ? offset[1] : 0) / height);\n const topHalfSurfaceDistance = Math.sin(fovAboveCenter) * cameraToSeaLevelDistance / Math.sin((0,_math_utils__WEBPACK_IMPORTED_MODULE_0__.clamp)(Math.PI / 2 - pitchRadians - fovAboveCenter, 0.01, Math.PI - 0.01));\n const furthestDistance = Math.sin(pitchRadians) * topHalfSurfaceDistance + cameraToSeaLevelDistance;\n const horizonDistance = cameraToSeaLevelDistance * 10;\n const farZ = Math.min(furthestDistance * farZMultiplier, horizonDistance);\n return {\n fov: fovRadians,\n aspect: width / height,\n focalDistance,\n near: nearZMultiplier,\n far: farZ\n };\n}\nfunction getProjectionMatrix(options) {\n const {\n fov,\n aspect,\n near,\n far\n } = getProjectionParameters(options);\n const projectionMatrix = gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_2__.perspective([], fov, aspect, near, far);\n return projectionMatrix;\n}\nfunction altitudeToFovy(altitude) {\n return 2 * Math.atan(0.5 / altitude) * RADIANS_TO_DEGREES;\n}\nfunction fovyToAltitude(fovy) {\n return 0.5 / Math.tan(0.5 * fovy * DEGREES_TO_RADIANS);\n}\nfunction worldToPixels(xyz, pixelProjectionMatrix) {\n const [x, y, z = 0] = xyz;\n (0,_assert__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Number.isFinite(x) && Number.isFinite(y) && Number.isFinite(z));\n return (0,_math_utils__WEBPACK_IMPORTED_MODULE_0__.transformVector)(pixelProjectionMatrix, [x, y, z, 1]);\n}\nfunction pixelsToWorld(xyz, pixelUnprojectionMatrix, targetZ = 0) {\n const [x, y, z] = xyz;\n (0,_assert__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Number.isFinite(x) && Number.isFinite(y), 'invalid pixel coordinate');\n\n if (Number.isFinite(z)) {\n const coord = (0,_math_utils__WEBPACK_IMPORTED_MODULE_0__.transformVector)(pixelUnprojectionMatrix, [x, y, z, 1]);\n return coord;\n }\n\n const coord0 = (0,_math_utils__WEBPACK_IMPORTED_MODULE_0__.transformVector)(pixelUnprojectionMatrix, [x, y, 0, 1]);\n const coord1 = (0,_math_utils__WEBPACK_IMPORTED_MODULE_0__.transformVector)(pixelUnprojectionMatrix, [x, y, 1, 1]);\n const z0 = coord0[2];\n const z1 = coord1[2];\n const t = z0 === z1 ? 0 : ((targetZ || 0) - z0) / (z1 - z0);\n return gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_4__.lerp([], coord0, coord1, t);\n}\n//# sourceMappingURL=web-mercator-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/web-mercator/dist/esm/web-mercator-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@math.gl/web-mercator/dist/esm/web-mercator-viewport.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@math.gl/web-mercator/dist/esm/web-mercator-viewport.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WebMercatorViewport)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _math_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./math-utils */ \"./node_modules/@math.gl/web-mercator/dist/esm/math-utils.js\");\n/* harmony import */ var _web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./web-mercator-utils */ \"./node_modules/@math.gl/web-mercator/dist/esm/web-mercator-utils.js\");\n/* harmony import */ var _fit_bounds__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fit-bounds */ \"./node_modules/@math.gl/web-mercator/dist/esm/fit-bounds.js\");\n/* harmony import */ var _get_bounds__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./get-bounds */ \"./node_modules/@math.gl/web-mercator/dist/esm/get-bounds.js\");\n/* harmony import */ var gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! gl-matrix/mat4 */ \"./node_modules/gl-matrix/esm/mat4.js\");\n/* harmony import */ var gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! gl-matrix/vec2 */ \"./node_modules/gl-matrix/esm/vec2.js\");\n/* harmony import */ var gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! gl-matrix/vec3 */ \"./node_modules/gl-matrix/esm/vec3.js\");\n\n\n\n\n\n\n\n\nclass WebMercatorViewport {\n constructor(props = {\n width: 1,\n height: 1\n }) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"latitude\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"longitude\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"zoom\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"pitch\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"bearing\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"altitude\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"fovy\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"meterOffset\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"center\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"width\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"height\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"scale\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"distanceScales\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"viewMatrix\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"projectionMatrix\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"viewProjectionMatrix\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"pixelProjectionMatrix\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"pixelUnprojectionMatrix\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"equals\", viewport => {\n if (!(viewport instanceof WebMercatorViewport)) {\n return false;\n }\n\n return viewport.width === this.width && viewport.height === this.height && gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_5__.equals(viewport.projectionMatrix, this.projectionMatrix) && gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_5__.equals(viewport.viewMatrix, this.viewMatrix);\n });\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"project\", (lngLatZ, options = {}) => {\n const {\n topLeft = true\n } = options;\n const worldPosition = this.projectPosition(lngLatZ);\n const coord = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.worldToPixels)(worldPosition, this.pixelProjectionMatrix);\n const [x, y] = coord;\n const y2 = topLeft ? y : this.height - y;\n return lngLatZ.length === 2 ? [x, y2] : [x, y2, coord[2]];\n });\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"unproject\", (xyz, options = {}) => {\n const {\n topLeft = true,\n targetZ = undefined\n } = options;\n const [x, y, z] = xyz;\n const y2 = topLeft ? y : this.height - y;\n const targetZWorld = targetZ && targetZ * this.distanceScales.unitsPerMeter[2];\n const coord = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.pixelsToWorld)([x, y2, z], this.pixelUnprojectionMatrix, targetZWorld);\n const [X, Y, Z] = this.unprojectPosition(coord);\n\n if (Number.isFinite(z)) {\n return [X, Y, Z];\n }\n\n return Number.isFinite(targetZ) ? [X, Y, targetZ] : [X, Y];\n });\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"projectPosition\", xyz => {\n const [X, Y] = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.lngLatToWorld)(xyz);\n const Z = (xyz[2] || 0) * this.distanceScales.unitsPerMeter[2];\n return [X, Y, Z];\n });\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"unprojectPosition\", xyz => {\n const [X, Y] = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.worldToLngLat)(xyz);\n const Z = (xyz[2] || 0) * this.distanceScales.metersPerUnit[2];\n return [X, Y, Z];\n });\n\n let {\n width,\n height,\n altitude = null,\n fovy = null\n } = props;\n const {\n latitude = 0,\n longitude = 0,\n zoom = 0,\n pitch = 0,\n bearing = 0,\n position = null,\n nearZMultiplier = 0.02,\n farZMultiplier = 1.01\n } = props;\n width = width || 1;\n height = height || 1;\n\n if (fovy === null && altitude === null) {\n altitude = _web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_ALTITUDE;\n fovy = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.altitudeToFovy)(altitude);\n } else if (fovy === null) {\n fovy = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.altitudeToFovy)(altitude);\n } else if (altitude === null) {\n altitude = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.fovyToAltitude)(fovy);\n }\n\n const scale = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.zoomToScale)(zoom);\n altitude = Math.max(0.75, altitude);\n const distanceScales = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.getDistanceScales)({\n longitude,\n latitude\n });\n const center = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.lngLatToWorld)([longitude, latitude]);\n center.push(0);\n\n if (position) {\n gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_6__.add(center, center, gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_6__.mul([], position, distanceScales.unitsPerMeter));\n }\n\n this.projectionMatrix = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.getProjectionMatrix)({\n width,\n height,\n scale,\n center,\n pitch,\n fovy,\n nearZMultiplier,\n farZMultiplier\n });\n this.viewMatrix = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.getViewMatrix)({\n height,\n scale,\n center,\n pitch,\n bearing,\n altitude\n });\n this.width = width;\n this.height = height;\n this.scale = scale;\n this.latitude = latitude;\n this.longitude = longitude;\n this.zoom = zoom;\n this.pitch = pitch;\n this.bearing = bearing;\n this.altitude = altitude;\n this.fovy = fovy;\n this.center = center;\n this.meterOffset = position || [0, 0, 0];\n this.distanceScales = distanceScales;\n\n this._initMatrices();\n\n Object.freeze(this);\n }\n\n _initMatrices() {\n const {\n width,\n height,\n projectionMatrix,\n viewMatrix\n } = this;\n const vpm = (0,_math_utils__WEBPACK_IMPORTED_MODULE_1__.createMat4)();\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_5__.multiply(vpm, vpm, projectionMatrix);\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_5__.multiply(vpm, vpm, viewMatrix);\n this.viewProjectionMatrix = vpm;\n const m = (0,_math_utils__WEBPACK_IMPORTED_MODULE_1__.createMat4)();\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_5__.scale(m, m, [width / 2, -height / 2, 1]);\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_5__.translate(m, m, [1, -1, 0]);\n gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_5__.multiply(m, m, vpm);\n const mInverse = gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_5__.invert((0,_math_utils__WEBPACK_IMPORTED_MODULE_1__.createMat4)(), m);\n\n if (!mInverse) {\n throw new Error('Pixel project matrix not invertible');\n }\n\n this.pixelProjectionMatrix = m;\n this.pixelUnprojectionMatrix = mInverse;\n }\n\n projectFlat(lngLat) {\n return (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.lngLatToWorld)(lngLat);\n }\n\n unprojectFlat(xy) {\n return (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.worldToLngLat)(xy);\n }\n\n getMapCenterByLngLatPosition({\n lngLat,\n pos\n }) {\n const fromLocation = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.pixelsToWorld)(pos, this.pixelUnprojectionMatrix);\n const toLocation = (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.lngLatToWorld)(lngLat);\n const translate = gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_7__.add([], toLocation, gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_7__.negate([], fromLocation));\n const newCenter = gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_7__.add([], this.center, translate);\n return (0,_web_mercator_utils__WEBPACK_IMPORTED_MODULE_2__.worldToLngLat)(newCenter);\n }\n\n fitBounds(bounds, options = {}) {\n const {\n width,\n height\n } = this;\n const {\n longitude,\n latitude,\n zoom\n } = (0,_fit_bounds__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(Object.assign({\n width,\n height,\n bounds\n }, options));\n return new WebMercatorViewport({\n width,\n height,\n longitude,\n latitude,\n zoom\n });\n }\n\n getBounds(options) {\n const corners = this.getBoundingRegion(options);\n const west = Math.min(...corners.map(p => p[0]));\n const east = Math.max(...corners.map(p => p[0]));\n const south = Math.min(...corners.map(p => p[1]));\n const north = Math.max(...corners.map(p => p[1]));\n return [[west, south], [east, north]];\n }\n\n getBoundingRegion(options = {}) {\n return (0,_get_bounds__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this, options.z || 0);\n }\n\n getLocationAtPoint({\n lngLat,\n pos\n }) {\n return this.getMapCenterByLngLatPosition({\n lngLat,\n pos\n });\n }\n\n}\n//# sourceMappingURL=web-mercator-viewport.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@math.gl/web-mercator/dist/esm/web-mercator-viewport.js?"); + +/***/ }), + +/***/ "./node_modules/@probe.gl/env/dist/esm/lib/get-browser.js": +/*!****************************************************************!*\ + !*** ./node_modules/@probe.gl/env/dist/esm/lib/get-browser.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ getBrowser),\n/* harmony export */ isMobile: () => (/* binding */ isMobile)\n/* harmony export */ });\n/* harmony import */ var _is_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-browser */ \"./node_modules/@probe.gl/env/dist/esm/lib/is-browser.js\");\n/* harmony import */ var _is_electron__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-electron */ \"./node_modules/@probe.gl/env/dist/esm/lib/is-electron.js\");\n\n\nconst window = globalThis;\nfunction isMobile() {\n return typeof window.orientation !== 'undefined';\n}\nfunction getBrowser(mockUserAgent) {\n if (!mockUserAgent && !(0,_is_browser__WEBPACK_IMPORTED_MODULE_0__[\"default\"])()) {\n return 'Node';\n }\n\n if ((0,_is_electron__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(mockUserAgent)) {\n return 'Electron';\n }\n\n const navigator_ = typeof navigator !== 'undefined' ? navigator : {};\n const userAgent = mockUserAgent || navigator_.userAgent || '';\n\n if (userAgent.indexOf('Edge') > -1) {\n return 'Edge';\n }\n\n const isMSIE = userAgent.indexOf('MSIE ') !== -1;\n const isTrident = userAgent.indexOf('Trident/') !== -1;\n\n if (isMSIE || isTrident) {\n return 'IE';\n }\n\n if (window.chrome) {\n return 'Chrome';\n }\n\n if (window.safari) {\n return 'Safari';\n }\n\n if (window.mozInnerScreenX) {\n return 'Firefox';\n }\n\n return 'Unknown';\n}\n//# sourceMappingURL=get-browser.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@probe.gl/env/dist/esm/lib/get-browser.js?"); + +/***/ }), + +/***/ "./node_modules/@probe.gl/env/dist/esm/lib/globals.js": +/*!************************************************************!*\ + !*** ./node_modules/@probe.gl/env/dist/esm/lib/globals.js ***! + \************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ console: () => (/* binding */ console_),\n/* harmony export */ document: () => (/* binding */ document_),\n/* harmony export */ global: () => (/* binding */ global_),\n/* harmony export */ process: () => (/* binding */ process_),\n/* harmony export */ self: () => (/* binding */ self_),\n/* harmony export */ window: () => (/* binding */ window_)\n/* harmony export */ });\nconst globals = {\n self: typeof self !== 'undefined' && self,\n window: typeof window !== 'undefined' && window,\n global: typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g,\n document: typeof document !== 'undefined' && document,\n process: typeof process === 'object' && process\n};\nconst global_ = globalThis;\nconst self_ = globals.self || globals.window || globals.global;\nconst window_ = globals.window || globals.self || globals.global;\nconst document_ = globals.document || {};\nconst process_ = globals.process || {};\nconst console_ = console;\n\n//# sourceMappingURL=globals.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@probe.gl/env/dist/esm/lib/globals.js?"); + +/***/ }), + +/***/ "./node_modules/@probe.gl/env/dist/esm/lib/is-browser.js": +/*!***************************************************************!*\ + !*** ./node_modules/@probe.gl/env/dist/esm/lib/is-browser.js ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ isBrowser),\n/* harmony export */ isBrowserMainThread: () => (/* binding */ isBrowserMainThread)\n/* harmony export */ });\n/* harmony import */ var _is_electron__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-electron */ \"./node_modules/@probe.gl/env/dist/esm/lib/is-electron.js\");\n\nfunction isBrowser() {\n const isNode = typeof process === 'object' && String(process) === '[object process]' && !process.browser;\n return !isNode || (0,_is_electron__WEBPACK_IMPORTED_MODULE_0__[\"default\"])();\n}\nfunction isBrowserMainThread() {\n return isBrowser() && typeof document !== 'undefined';\n}\n//# sourceMappingURL=is-browser.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@probe.gl/env/dist/esm/lib/is-browser.js?"); + +/***/ }), + +/***/ "./node_modules/@probe.gl/env/dist/esm/lib/is-electron.js": +/*!****************************************************************!*\ + !*** ./node_modules/@probe.gl/env/dist/esm/lib/is-electron.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ isElectron)\n/* harmony export */ });\nfunction isElectron(mockUserAgent) {\n if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') {\n return true;\n }\n\n if (typeof process !== 'undefined' && typeof process.versions === 'object' && Boolean(process.versions['electron'])) {\n return true;\n }\n\n const realUserAgent = typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent;\n const userAgent = mockUserAgent || realUserAgent;\n\n if (userAgent && userAgent.indexOf('Electron') >= 0) {\n return true;\n }\n\n return false;\n}\n//# sourceMappingURL=is-electron.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@probe.gl/env/dist/esm/lib/is-electron.js?"); + +/***/ }), + +/***/ "./node_modules/@probe.gl/env/dist/esm/utils/globals.js": +/*!**************************************************************!*\ + !*** ./node_modules/@probe.gl/env/dist/esm/utils/globals.js ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ VERSION: () => (/* binding */ VERSION),\n/* harmony export */ console: () => (/* reexport safe */ _lib_globals__WEBPACK_IMPORTED_MODULE_0__.console),\n/* harmony export */ document: () => (/* reexport safe */ _lib_globals__WEBPACK_IMPORTED_MODULE_0__.document),\n/* harmony export */ global: () => (/* reexport safe */ _lib_globals__WEBPACK_IMPORTED_MODULE_0__.global),\n/* harmony export */ isBrowser: () => (/* binding */ isBrowser),\n/* harmony export */ process: () => (/* reexport safe */ _lib_globals__WEBPACK_IMPORTED_MODULE_0__.process),\n/* harmony export */ self: () => (/* reexport safe */ _lib_globals__WEBPACK_IMPORTED_MODULE_0__.self),\n/* harmony export */ window: () => (/* reexport safe */ _lib_globals__WEBPACK_IMPORTED_MODULE_0__.window)\n/* harmony export */ });\n/* harmony import */ var _lib_is_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/is-browser */ \"./node_modules/@probe.gl/env/dist/esm/lib/is-browser.js\");\n/* harmony import */ var _lib_globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lib/globals */ \"./node_modules/@probe.gl/env/dist/esm/lib/globals.js\");\n\n\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'untranspiled source';\nconst isBrowser = (0,_lib_is_browser__WEBPACK_IMPORTED_MODULE_1__[\"default\"])();\n//# sourceMappingURL=globals.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@probe.gl/env/dist/esm/utils/globals.js?"); + +/***/ }), + +/***/ "./node_modules/@probe.gl/log/dist/esm/log.js": +/*!****************************************************!*\ + !*** ./node_modules/@probe.gl/log/dist/esm/log.js ***! + \****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Log: () => (/* binding */ Log),\n/* harmony export */ normalizeArguments: () => (/* binding */ normalizeArguments)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @probe.gl/env */ \"./node_modules/@probe.gl/env/dist/esm/lib/is-browser.js\");\n/* harmony import */ var _probe_gl_env__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @probe.gl/env */ \"./node_modules/@probe.gl/env/dist/esm/utils/globals.js\");\n/* harmony import */ var _utils_local_storage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/local-storage */ \"./node_modules/@probe.gl/log/dist/esm/utils/local-storage.js\");\n/* harmony import */ var _utils_formatters__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/formatters */ \"./node_modules/@probe.gl/log/dist/esm/utils/formatters.js\");\n/* harmony import */ var _utils_color__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/color */ \"./node_modules/@probe.gl/log/dist/esm/utils/color.js\");\n/* harmony import */ var _utils_autobind__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/autobind */ \"./node_modules/@probe.gl/log/dist/esm/utils/autobind.js\");\n/* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/assert */ \"./node_modules/@probe.gl/log/dist/esm/utils/assert.js\");\n/* harmony import */ var _utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/hi-res-timestamp */ \"./node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js\");\n\n\n\n\n\n\n\n\nconst originalConsole = {\n debug: _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__[\"default\"] ? console.debug || console.log : console.log,\n log: console.log,\n info: console.info,\n warn: console.warn,\n error: console.error\n};\nconst DEFAULT_SETTINGS = {\n enabled: true,\n level: 0\n};\n\nfunction noop() {}\n\nconst cache = {};\nconst ONCE = {\n once: true\n};\nclass Log {\n constructor() {\n let {\n id\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n id: ''\n };\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"id\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"VERSION\", _probe_gl_env__WEBPACK_IMPORTED_MODULE_2__.VERSION);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_startTs\", (0,_utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_3__.getHiResTimestamp)());\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_deltaTs\", (0,_utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_3__.getHiResTimestamp)());\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_storage\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"userData\", {});\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"LOG_THROTTLE_TIMEOUT\", 0);\n\n this.id = id;\n this.userData = {};\n this._storage = new _utils_local_storage__WEBPACK_IMPORTED_MODULE_4__.LocalStorage(\"__probe-\".concat(this.id, \"__\"), DEFAULT_SETTINGS);\n this.timeStamp(\"\".concat(this.id, \" started\"));\n (0,_utils_autobind__WEBPACK_IMPORTED_MODULE_5__.autobind)(this);\n Object.seal(this);\n }\n\n set level(newLevel) {\n this.setLevel(newLevel);\n }\n\n get level() {\n return this.getLevel();\n }\n\n isEnabled() {\n return this._storage.config.enabled;\n }\n\n getLevel() {\n return this._storage.config.level;\n }\n\n getTotal() {\n return Number(((0,_utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_3__.getHiResTimestamp)() - this._startTs).toPrecision(10));\n }\n\n getDelta() {\n return Number(((0,_utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_3__.getHiResTimestamp)() - this._deltaTs).toPrecision(10));\n }\n\n set priority(newPriority) {\n this.level = newPriority;\n }\n\n get priority() {\n return this.level;\n }\n\n getPriority() {\n return this.level;\n }\n\n enable() {\n let enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n this._storage.setConfiguration({\n enabled\n });\n\n return this;\n }\n\n setLevel(level) {\n this._storage.setConfiguration({\n level\n });\n\n return this;\n }\n\n get(setting) {\n return this._storage.config[setting];\n }\n\n set(setting, value) {\n this._storage.setConfiguration({\n [setting]: value\n });\n }\n\n settings() {\n if (console.table) {\n console.table(this._storage.config);\n } else {\n console.log(this._storage.config);\n }\n }\n\n assert(condition, message) {\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(condition, message);\n }\n\n warn(message) {\n return this._getLogFunction(0, message, originalConsole.warn, arguments, ONCE);\n }\n\n error(message) {\n return this._getLogFunction(0, message, originalConsole.error, arguments);\n }\n\n deprecated(oldUsage, newUsage) {\n return this.warn(\"`\".concat(oldUsage, \"` is deprecated and will be removed in a later version. Use `\").concat(newUsage, \"` instead\"));\n }\n\n removed(oldUsage, newUsage) {\n return this.error(\"`\".concat(oldUsage, \"` has been removed. Use `\").concat(newUsage, \"` instead\"));\n }\n\n probe(logLevel, message) {\n return this._getLogFunction(logLevel, message, originalConsole.log, arguments, {\n time: true,\n once: true\n });\n }\n\n log(logLevel, message) {\n return this._getLogFunction(logLevel, message, originalConsole.debug, arguments);\n }\n\n info(logLevel, message) {\n return this._getLogFunction(logLevel, message, console.info, arguments);\n }\n\n once(logLevel, message) {\n for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);\n }\n\n table(logLevel, table, columns) {\n if (table) {\n return this._getLogFunction(logLevel, table, console.table || noop, columns && [columns], {\n tag: getTableHeader(table)\n });\n }\n\n return noop;\n }\n\n image(_ref) {\n let {\n logLevel,\n priority,\n image,\n message = '',\n scale = 1\n } = _ref;\n\n if (!this._shouldLog(logLevel || priority)) {\n return noop;\n }\n\n return _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__[\"default\"] ? logImageInBrowser({\n image,\n message,\n scale\n }) : logImageInNode({\n image,\n message,\n scale\n });\n }\n\n time(logLevel, message) {\n return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);\n }\n\n timeEnd(logLevel, message) {\n return this._getLogFunction(logLevel, message, console.timeEnd ? console.timeEnd : console.info);\n }\n\n timeStamp(logLevel, message) {\n return this._getLogFunction(logLevel, message, console.timeStamp || noop);\n }\n\n group(logLevel, message) {\n let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n collapsed: false\n };\n const options = normalizeArguments({\n logLevel,\n message,\n opts\n });\n const {\n collapsed\n } = opts;\n options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;\n return this._getLogFunction(options);\n }\n\n groupCollapsed(logLevel, message) {\n let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n return this.group(logLevel, message, Object.assign({}, opts, {\n collapsed: true\n }));\n }\n\n groupEnd(logLevel) {\n return this._getLogFunction(logLevel, '', console.groupEnd || noop);\n }\n\n withGroup(logLevel, message, func) {\n this.group(logLevel, message)();\n\n try {\n func();\n } finally {\n this.groupEnd(logLevel)();\n }\n }\n\n trace() {\n if (console.trace) {\n console.trace();\n }\n }\n\n _shouldLog(logLevel) {\n return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);\n }\n\n _getLogFunction(logLevel, message, method, args, opts) {\n if (this._shouldLog(logLevel)) {\n opts = normalizeArguments({\n logLevel,\n message,\n args,\n opts\n });\n method = method || opts.method;\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(method);\n opts.total = this.getTotal();\n opts.delta = this.getDelta();\n this._deltaTs = (0,_utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_3__.getHiResTimestamp)();\n const tag = opts.tag || opts.message;\n\n if (opts.once) {\n if (!cache[tag]) {\n cache[tag] = (0,_utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_3__.getHiResTimestamp)();\n } else {\n return noop;\n }\n }\n\n message = decorateMessage(this.id, opts.message, opts);\n return method.bind(console, message, ...opts.args);\n }\n\n return noop;\n }\n\n}\n\n(0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Log, \"VERSION\", _probe_gl_env__WEBPACK_IMPORTED_MODULE_2__.VERSION);\n\nfunction normalizeLogLevel(logLevel) {\n if (!logLevel) {\n return 0;\n }\n\n let resolvedLevel;\n\n switch (typeof logLevel) {\n case 'number':\n resolvedLevel = logLevel;\n break;\n\n case 'object':\n resolvedLevel = logLevel.logLevel || logLevel.priority || 0;\n break;\n\n default:\n return 0;\n }\n\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);\n return resolvedLevel;\n}\n\nfunction normalizeArguments(opts) {\n const {\n logLevel,\n message\n } = opts;\n opts.logLevel = normalizeLogLevel(logLevel);\n const args = opts.args ? Array.from(opts.args) : [];\n\n while (args.length && args.shift() !== message) {}\n\n switch (typeof logLevel) {\n case 'string':\n case 'function':\n if (message !== undefined) {\n args.unshift(message);\n }\n\n opts.message = logLevel;\n break;\n\n case 'object':\n Object.assign(opts, logLevel);\n break;\n\n default:\n }\n\n if (typeof opts.message === 'function') {\n opts.message = opts.message();\n }\n\n const messageType = typeof opts.message;\n (0,_utils_assert__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(messageType === 'string' || messageType === 'object');\n return Object.assign(opts, {\n args\n }, opts.opts);\n}\n\nfunction decorateMessage(id, message, opts) {\n if (typeof message === 'string') {\n const time = opts.time ? (0,_utils_formatters__WEBPACK_IMPORTED_MODULE_7__.leftPad)((0,_utils_formatters__WEBPACK_IMPORTED_MODULE_7__.formatTime)(opts.total)) : '';\n message = opts.time ? \"\".concat(id, \": \").concat(time, \" \").concat(message) : \"\".concat(id, \": \").concat(message);\n message = (0,_utils_color__WEBPACK_IMPORTED_MODULE_8__.addColor)(message, opts.color, opts.background);\n }\n\n return message;\n}\n\nfunction logImageInNode(_ref2) {\n let {\n image,\n message = '',\n scale = 1\n } = _ref2;\n console.warn('removed');\n return noop;\n}\n\nfunction logImageInBrowser(_ref3) {\n let {\n image,\n message = '',\n scale = 1\n } = _ref3;\n\n if (typeof image === 'string') {\n const img = new Image();\n\n img.onload = () => {\n const args = (0,_utils_formatters__WEBPACK_IMPORTED_MODULE_7__.formatImage)(img, message, scale);\n console.log(...args);\n };\n\n img.src = image;\n return noop;\n }\n\n const element = image.nodeName || '';\n\n if (element.toLowerCase() === 'img') {\n console.log(...(0,_utils_formatters__WEBPACK_IMPORTED_MODULE_7__.formatImage)(image, message, scale));\n return noop;\n }\n\n if (element.toLowerCase() === 'canvas') {\n const img = new Image();\n\n img.onload = () => console.log(...(0,_utils_formatters__WEBPACK_IMPORTED_MODULE_7__.formatImage)(img, message, scale));\n\n img.src = image.toDataURL();\n return noop;\n }\n\n return noop;\n}\n\nfunction getTableHeader(table) {\n for (const key in table) {\n for (const title in table[key]) {\n return title || 'untitled';\n }\n }\n\n return 'empty';\n}\n//# sourceMappingURL=log.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@probe.gl/log/dist/esm/log.js?"); + +/***/ }), + +/***/ "./node_modules/@probe.gl/log/dist/esm/utils/assert.js": +/*!*************************************************************!*\ + !*** ./node_modules/@probe.gl/log/dist/esm/utils/assert.js ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ assert)\n/* harmony export */ });\nfunction assert(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=assert.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@probe.gl/log/dist/esm/utils/assert.js?"); + +/***/ }), + +/***/ "./node_modules/@probe.gl/log/dist/esm/utils/autobind.js": +/*!***************************************************************!*\ + !*** ./node_modules/@probe.gl/log/dist/esm/utils/autobind.js ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ autobind: () => (/* binding */ autobind)\n/* harmony export */ });\nfunction autobind(obj) {\n let predefined = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['constructor'];\n const proto = Object.getPrototypeOf(obj);\n const propNames = Object.getOwnPropertyNames(proto);\n\n for (const key of propNames) {\n if (typeof obj[key] === 'function') {\n if (!predefined.find(name => key === name)) {\n obj[key] = obj[key].bind(obj);\n }\n }\n }\n}\n//# sourceMappingURL=autobind.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@probe.gl/log/dist/esm/utils/autobind.js?"); + +/***/ }), + +/***/ "./node_modules/@probe.gl/log/dist/esm/utils/color.js": +/*!************************************************************!*\ + !*** ./node_modules/@probe.gl/log/dist/esm/utils/color.js ***! + \************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ COLOR: () => (/* binding */ COLOR),\n/* harmony export */ addColor: () => (/* binding */ addColor)\n/* harmony export */ });\n/* harmony import */ var _probe_gl_env__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @probe.gl/env */ \"./node_modules/@probe.gl/env/dist/esm/lib/is-browser.js\");\n\nlet COLOR;\n\n(function (COLOR) {\n COLOR[COLOR[\"BLACK\"] = 30] = \"BLACK\";\n COLOR[COLOR[\"RED\"] = 31] = \"RED\";\n COLOR[COLOR[\"GREEN\"] = 32] = \"GREEN\";\n COLOR[COLOR[\"YELLOW\"] = 33] = \"YELLOW\";\n COLOR[COLOR[\"BLUE\"] = 34] = \"BLUE\";\n COLOR[COLOR[\"MAGENTA\"] = 35] = \"MAGENTA\";\n COLOR[COLOR[\"CYAN\"] = 36] = \"CYAN\";\n COLOR[COLOR[\"WHITE\"] = 37] = \"WHITE\";\n COLOR[COLOR[\"BRIGHT_BLACK\"] = 90] = \"BRIGHT_BLACK\";\n COLOR[COLOR[\"BRIGHT_RED\"] = 91] = \"BRIGHT_RED\";\n COLOR[COLOR[\"BRIGHT_GREEN\"] = 92] = \"BRIGHT_GREEN\";\n COLOR[COLOR[\"BRIGHT_YELLOW\"] = 93] = \"BRIGHT_YELLOW\";\n COLOR[COLOR[\"BRIGHT_BLUE\"] = 94] = \"BRIGHT_BLUE\";\n COLOR[COLOR[\"BRIGHT_MAGENTA\"] = 95] = \"BRIGHT_MAGENTA\";\n COLOR[COLOR[\"BRIGHT_CYAN\"] = 96] = \"BRIGHT_CYAN\";\n COLOR[COLOR[\"BRIGHT_WHITE\"] = 97] = \"BRIGHT_WHITE\";\n})(COLOR || (COLOR = {}));\n\nfunction getColor(color) {\n return typeof color === 'string' ? COLOR[color.toUpperCase()] || COLOR.WHITE : color;\n}\n\nfunction addColor(string, color, background) {\n if (!_probe_gl_env__WEBPACK_IMPORTED_MODULE_0__[\"default\"] && typeof string === 'string') {\n if (color) {\n color = getColor(color);\n string = \"\\x1B[\".concat(color, \"m\").concat(string, \"\\x1B[39m\");\n }\n\n if (background) {\n color = getColor(background);\n string = \"\\x1B[\".concat(background + 10, \"m\").concat(string, \"\\x1B[49m\");\n }\n }\n\n return string;\n}\n//# sourceMappingURL=color.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@probe.gl/log/dist/esm/utils/color.js?"); + +/***/ }), + +/***/ "./node_modules/@probe.gl/log/dist/esm/utils/formatters.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@probe.gl/log/dist/esm/utils/formatters.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ formatImage: () => (/* binding */ formatImage),\n/* harmony export */ formatTime: () => (/* binding */ formatTime),\n/* harmony export */ formatValue: () => (/* binding */ formatValue),\n/* harmony export */ leftPad: () => (/* binding */ leftPad),\n/* harmony export */ rightPad: () => (/* binding */ rightPad)\n/* harmony export */ });\nfunction formatTime(ms) {\n let formatted;\n\n if (ms < 10) {\n formatted = \"\".concat(ms.toFixed(2), \"ms\");\n } else if (ms < 100) {\n formatted = \"\".concat(ms.toFixed(1), \"ms\");\n } else if (ms < 1000) {\n formatted = \"\".concat(ms.toFixed(0), \"ms\");\n } else {\n formatted = \"\".concat((ms / 1000).toFixed(2), \"s\");\n }\n\n return formatted;\n}\nfunction leftPad(string) {\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 8;\n const padLength = Math.max(length - string.length, 0);\n return \"\".concat(' '.repeat(padLength)).concat(string);\n}\nfunction rightPad(string) {\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 8;\n const padLength = Math.max(length - string.length, 0);\n return \"\".concat(string).concat(' '.repeat(padLength));\n}\nfunction formatValue(v) {\n let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const EPSILON = 1e-16;\n const {\n isInteger = false\n } = opts;\n\n if (Array.isArray(v) || ArrayBuffer.isView(v)) {\n return formatArrayValue(v, opts);\n }\n\n if (!Number.isFinite(v)) {\n return String(v);\n }\n\n if (Math.abs(v) < EPSILON) {\n return isInteger ? '0' : '0.';\n }\n\n if (isInteger) {\n return v.toFixed(0);\n }\n\n if (Math.abs(v) > 100 && Math.abs(v) < 10000) {\n return v.toFixed(0);\n }\n\n const string = v.toPrecision(2);\n const decimal = string.indexOf('.0');\n return decimal === string.length - 2 ? string.slice(0, -1) : string;\n}\n\nfunction formatArrayValue(v, opts) {\n const {\n maxElts = 16,\n size = 1\n } = opts;\n let string = '[';\n\n for (let i = 0; i < v.length && i < maxElts; ++i) {\n if (i > 0) {\n string += \",\".concat(i % size === 0 ? ' ' : '');\n }\n\n string += formatValue(v[i], opts);\n }\n\n const terminator = v.length > maxElts ? '...' : ']';\n return \"\".concat(string).concat(terminator);\n}\n\nfunction formatImage(image, message, scale) {\n let maxWidth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 600;\n const imageUrl = image.src.replace(/\\(/g, '%28').replace(/\\)/g, '%29');\n\n if (image.width > maxWidth) {\n scale = Math.min(scale, maxWidth / image.width);\n }\n\n const width = image.width * scale;\n const height = image.height * scale;\n const style = ['font-size:1px;', \"padding:\".concat(Math.floor(height / 2), \"px \").concat(Math.floor(width / 2), \"px;\"), \"line-height:\".concat(height, \"px;\"), \"background:url(\".concat(imageUrl, \");\"), \"background-size:\".concat(width, \"px \").concat(height, \"px;\"), 'color:transparent;'].join('');\n return [\"\".concat(message, \" %c+\"), style];\n}\n//# sourceMappingURL=formatters.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@probe.gl/log/dist/esm/utils/formatters.js?"); + +/***/ }), + +/***/ "./node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getHiResTimestamp: () => (/* binding */ getHiResTimestamp)\n/* harmony export */ });\n/* harmony import */ var _probe_gl_env__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @probe.gl/env */ \"./node_modules/@probe.gl/env/dist/esm/lib/is-browser.js\");\n/* harmony import */ var _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @probe.gl/env */ \"./node_modules/@probe.gl/env/dist/esm/lib/globals.js\");\n\nfunction getHiResTimestamp() {\n let timestamp;\n\n if (_probe_gl_env__WEBPACK_IMPORTED_MODULE_0__[\"default\"] && \"performance\" in _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__.window) {\n var _window$performance, _window$performance$n;\n\n timestamp = _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__.window === null || _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__.window === void 0 ? void 0 : (_window$performance = _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__.window.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);\n } else if (\"hrtime\" in _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__.process) {\n var _process$hrtime;\n\n const timeParts = _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__.process === null || _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__.process === void 0 ? void 0 : (_process$hrtime = _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__.process.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(_probe_gl_env__WEBPACK_IMPORTED_MODULE_1__.process);\n timestamp = timeParts[0] * 1000 + timeParts[1] / 1e6;\n } else {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n//# sourceMappingURL=hi-res-timestamp.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js?"); + +/***/ }), + +/***/ "./node_modules/@probe.gl/log/dist/esm/utils/local-storage.js": +/*!********************************************************************!*\ + !*** ./node_modules/@probe.gl/log/dist/esm/utils/local-storage.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LocalStorage: () => (/* binding */ LocalStorage)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n\n\nfunction getStorage(type) {\n try {\n const storage = window[type];\n const x = '__storage_test__';\n storage.setItem(x, x);\n storage.removeItem(x);\n return storage;\n } catch (e) {\n return null;\n }\n}\n\nclass LocalStorage {\n constructor(id, defaultConfig) {\n let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'sessionStorage';\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"storage\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"id\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"config\", void 0);\n\n this.storage = getStorage(type);\n this.id = id;\n this.config = defaultConfig;\n\n this._loadConfiguration();\n }\n\n getConfiguration() {\n return this.config;\n }\n\n setConfiguration(configuration) {\n Object.assign(this.config, configuration);\n\n if (this.storage) {\n const serialized = JSON.stringify(this.config);\n this.storage.setItem(this.id, serialized);\n }\n }\n\n _loadConfiguration() {\n let configuration = {};\n\n if (this.storage) {\n const serializedConfiguration = this.storage.getItem(this.id);\n configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {};\n }\n\n Object.assign(this.config, configuration);\n return this;\n }\n\n}\n//# sourceMappingURL=local-storage.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@probe.gl/log/dist/esm/utils/local-storage.js?"); + +/***/ }), + +/***/ "./node_modules/@probe.gl/stats/dist/esm/index.js": +/*!********************************************************!*\ + !*** ./node_modules/@probe.gl/stats/dist/esm/index.js ***! + \********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Stat: () => (/* reexport safe */ _lib_stat__WEBPACK_IMPORTED_MODULE_1__[\"default\"]),\n/* harmony export */ Stats: () => (/* reexport safe */ _lib_stats__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ _getHiResTimestamp: () => (/* reexport safe */ _utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_2__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _lib_stats__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/stats */ \"./node_modules/@probe.gl/stats/dist/esm/lib/stats.js\");\n/* harmony import */ var _lib_stat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/stat */ \"./node_modules/@probe.gl/stats/dist/esm/lib/stat.js\");\n/* harmony import */ var _utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/hi-res-timestamp */ \"./node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js\");\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@probe.gl/stats/dist/esm/index.js?"); + +/***/ }), + +/***/ "./node_modules/@probe.gl/stats/dist/esm/lib/stat.js": +/*!***********************************************************!*\ + !*** ./node_modules/@probe.gl/stats/dist/esm/lib/stat.js ***! + \***********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Stat)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/hi-res-timestamp */ \"./node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js\");\n\n\nclass Stat {\n constructor(name, type) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"name\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"type\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"sampleSize\", 1);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"time\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"count\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"samples\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"lastTiming\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"lastSampleTime\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"lastSampleCount\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_count\", 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_time\", 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_samples\", 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_startTime\", 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_timerPending\", false);\n\n this.name = name;\n this.type = type;\n this.reset();\n }\n\n setSampleSize(samples) {\n this.sampleSize = samples;\n return this;\n }\n\n incrementCount() {\n this.addCount(1);\n return this;\n }\n\n decrementCount() {\n this.subtractCount(1);\n return this;\n }\n\n addCount(value) {\n this._count += value;\n this._samples++;\n\n this._checkSampling();\n\n return this;\n }\n\n subtractCount(value) {\n this._count -= value;\n this._samples++;\n\n this._checkSampling();\n\n return this;\n }\n\n addTime(time) {\n this._time += time;\n this.lastTiming = time;\n this._samples++;\n\n this._checkSampling();\n\n return this;\n }\n\n timeStart() {\n this._startTime = (0,_utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_1__[\"default\"])();\n this._timerPending = true;\n return this;\n }\n\n timeEnd() {\n if (!this._timerPending) {\n return this;\n }\n\n this.addTime((0,_utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_1__[\"default\"])() - this._startTime);\n this._timerPending = false;\n\n this._checkSampling();\n\n return this;\n }\n\n getSampleAverageCount() {\n return this.sampleSize > 0 ? this.lastSampleCount / this.sampleSize : 0;\n }\n\n getSampleAverageTime() {\n return this.sampleSize > 0 ? this.lastSampleTime / this.sampleSize : 0;\n }\n\n getSampleHz() {\n return this.lastSampleTime > 0 ? this.sampleSize / (this.lastSampleTime / 1000) : 0;\n }\n\n getAverageCount() {\n return this.samples > 0 ? this.count / this.samples : 0;\n }\n\n getAverageTime() {\n return this.samples > 0 ? this.time / this.samples : 0;\n }\n\n getHz() {\n return this.time > 0 ? this.samples / (this.time / 1000) : 0;\n }\n\n reset() {\n this.time = 0;\n this.count = 0;\n this.samples = 0;\n this.lastTiming = 0;\n this.lastSampleTime = 0;\n this.lastSampleCount = 0;\n this._count = 0;\n this._time = 0;\n this._samples = 0;\n this._startTime = 0;\n this._timerPending = false;\n return this;\n }\n\n _checkSampling() {\n if (this._samples === this.sampleSize) {\n this.lastSampleTime = this._time;\n this.lastSampleCount = this._count;\n this.count += this._count;\n this.time += this._time;\n this.samples += this._samples;\n this._time = 0;\n this._count = 0;\n this._samples = 0;\n }\n }\n\n}\n//# sourceMappingURL=stat.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@probe.gl/stats/dist/esm/lib/stat.js?"); + +/***/ }), + +/***/ "./node_modules/@probe.gl/stats/dist/esm/lib/stats.js": +/*!************************************************************!*\ + !*** ./node_modules/@probe.gl/stats/dist/esm/lib/stats.js ***! + \************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Stats)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _stat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stat */ \"./node_modules/@probe.gl/stats/dist/esm/lib/stat.js\");\n\n\nclass Stats {\n constructor(options) {\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"id\", void 0);\n\n (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"stats\", {});\n\n this.id = options.id;\n this.stats = {};\n\n this._initializeStats(options.stats);\n\n Object.seal(this);\n }\n\n get(name) {\n let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'count';\n return this._getOrCreate({\n name,\n type\n });\n }\n\n get size() {\n return Object.keys(this.stats).length;\n }\n\n reset() {\n for (const key in this.stats) {\n this.stats[key].reset();\n }\n\n return this;\n }\n\n forEach(fn) {\n for (const key in this.stats) {\n fn(this.stats[key]);\n }\n }\n\n getTable() {\n const table = {};\n this.forEach(stat => {\n table[stat.name] = {\n time: stat.time || 0,\n count: stat.count || 0,\n average: stat.getAverageTime() || 0,\n hz: stat.getHz() || 0\n };\n });\n return table;\n }\n\n _initializeStats() {\n let stats = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n stats.forEach(stat => this._getOrCreate(stat));\n }\n\n _getOrCreate(stat) {\n if (!stat || !stat.name) {\n return null;\n }\n\n const {\n name,\n type\n } = stat;\n\n if (!this.stats[name]) {\n if (stat instanceof _stat__WEBPACK_IMPORTED_MODULE_1__[\"default\"]) {\n this.stats[name] = stat;\n } else {\n this.stats[name] = new _stat__WEBPACK_IMPORTED_MODULE_1__[\"default\"](name, type);\n }\n }\n\n return this.stats[name];\n }\n\n}\n//# sourceMappingURL=stats.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@probe.gl/stats/dist/esm/lib/stats.js?"); + +/***/ }), + +/***/ "./node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ getHiResTimestamp)\n/* harmony export */ });\nfunction getHiResTimestamp() {\n let timestamp;\n\n if (typeof window !== 'undefined' && window.performance) {\n timestamp = window.performance.now();\n } else if (typeof process !== 'undefined' && process.hrtime) {\n const timeParts = process.hrtime();\n timestamp = timeParts[0] * 1000 + timeParts[1] / 1e6;\n } else {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n//# sourceMappingURL=hi-res-timestamp.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js?"); + +/***/ }), + +/***/ "./node_modules/distinct-colors/lib/index.js": +/*!***************************************************!*\ + !*** ./node_modules/distinct-colors/lib/index.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n\nvar _utils = _interopRequireDefault(__webpack_require__(/*! ./utils */ \"./node_modules/distinct-colors/lib/utils.js\"));\n\nvar _deepClone = _interopRequireDefault(__webpack_require__(/*! mout/lang/deepClone */ \"./node_modules/mout/lang/deepClone.js\"));\n\nvar _deepEquals = _interopRequireDefault(__webpack_require__(/*! mout/lang/deepEquals */ \"./node_modules/mout/lang/deepEquals.js\"));\n\nvar _chromaJs = _interopRequireDefault(__webpack_require__(/*! chroma-js */ \"./node_modules/chroma-js/chroma.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _createForOfIteratorHelper(o) { if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(n); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\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 defaults = {\n count: 5,\n hueMin: 0,\n hueMax: 360,\n chromaMin: 0,\n chromaMax: 100,\n lightMin: 0,\n lightMax: 100,\n quality: 50,\n samples: 800\n};\n\nvar getClosestIndex = function getClosestIndex(colors, color) {\n var minDist = Number.MAX_SAFE_INTEGER;\n var nearest = 0;\n\n for (var idx = 0; idx < colors.length; idx += 1) {\n var sample = colors[idx];\n var dist = Math.sqrt(Math.pow(Math.abs(sample[0] - color[0]), 2) + Math.pow(Math.abs(sample[1] - color[1]), 2) + Math.pow(Math.abs(sample[2] - color[2]), 2));\n\n if (dist < minDist) {\n minDist = dist;\n nearest = idx;\n }\n }\n\n return nearest;\n};\n\nvar checkColor = function checkColor(lab, options) {\n var color = _chromaJs[\"default\"].lab(lab);\n\n var hcl = color.hcl();\n var rgb = color.rgb();\n\n var compLab = _chromaJs[\"default\"].rgb(rgb).lab();\n\n var labTolerance = 2;\n return hcl[0] >= options.hueMin && hcl[0] <= options.hueMax && hcl[1] >= options.chromaMin && hcl[1] <= options.chromaMax && hcl[2] >= options.lightMin && hcl[2] <= options.lightMax && compLab[0] >= lab[0] - labTolerance && compLab[0] <= lab[0] + labTolerance && compLab[1] >= lab[1] - labTolerance && compLab[1] <= lab[1] + labTolerance && compLab[2] >= lab[2] - labTolerance && compLab[2] <= lab[2] + labTolerance;\n};\n\nvar sortByContrast = function sortByContrast(colorList) {\n var unsortedColors = colorList.slice(0);\n var sortedColors = [unsortedColors.shift()];\n\n while (unsortedColors.length > 0) {\n var lastColor = sortedColors[sortedColors.length - 1];\n var nearest = 0;\n var maxDist = Number.MIN_SAFE_INTEGER;\n\n for (var i = 0; i < unsortedColors.length; i += 1) {\n var dist = Math.sqrt(Math.pow(Math.abs(lastColor[0] - unsortedColors[i][0]), 2) + Math.pow(Math.abs(lastColor[1] - unsortedColors[i][1]), 2) + Math.pow(Math.abs(lastColor[2] - unsortedColors[i][2]), 2));\n\n if (dist > maxDist) {\n maxDist = dist;\n nearest = i;\n }\n }\n\n sortedColors.push(unsortedColors.splice(nearest, 1)[0]);\n }\n\n return sortedColors;\n};\n\nvar distinctColors = function distinctColors() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var options = _objectSpread({}, defaults, {}, opts);\n\n if (options.count <= 0) {\n return [];\n }\n\n if (options.samples < options.count * 3) {\n options.samples = Math.ceil(options.count * 3);\n }\n\n var colors = [];\n var zonesProto = [];\n var samples = new Set();\n var rangeDivider = Math.ceil(Math.cbrt(options.samples));\n var hStep = (options.hueMax - options.hueMin) / rangeDivider;\n var cStep = (options.chromaMax - options.chromaMin) / rangeDivider;\n var lStep = (options.lightMax - options.lightMin) / rangeDivider;\n\n if (hStep <= 0) {\n throw new Error('hueMax must be greater than hueMin!');\n }\n\n if (cStep <= 0) {\n throw new Error('chromaMax must be greater than chromaMin!');\n }\n\n if (lStep <= 0) {\n throw new Error('lightMax must be greater than lightMin!');\n }\n\n for (var h = options.hueMin + hStep / 2; h <= options.hueMax; h += hStep) {\n for (var c = options.chromaMin + cStep / 2; c <= options.chromaMax; c += cStep) {\n for (var l = options.lightMin + lStep / 2; l <= options.lightMax; l += lStep) {\n var color = _chromaJs[\"default\"].hcl(h, c, l).lab();\n\n if (checkColor(color, options)) {\n samples.add(color.toString());\n }\n }\n }\n }\n\n samples = Array.from(samples);\n samples = samples.map(function (i) {\n return i.split(',').map(function (j) {\n return parseFloat(j);\n });\n });\n\n if (samples.length < options.count) {\n throw new Error('Not enough samples to generate palette, increase sample count.');\n }\n\n var sliceSize = Math.floor(samples.length / options.count);\n\n for (var i = 0; i < samples.length; i += sliceSize) {\n colors.push(samples[i]);\n zonesProto.push([]);\n\n if (colors.length >= options.count) {\n break;\n }\n }\n\n for (var step = 1; step <= options.quality; step += 1) {\n var zones = (0, _deepClone[\"default\"])(zonesProto);\n var sampleList = (0, _deepClone[\"default\"])(samples); // Immediately add the closest sample for each color\n\n for (var _i = 0; _i < colors.length; _i += 1) {\n var idx = getClosestIndex(sampleList, colors[_i]);\n\n zones[_i].push(sampleList[idx]);\n\n sampleList.splice(idx, 1);\n } // Find closest color for each remaining sample\n\n\n for (var _i2 = 0; _i2 < sampleList.length; _i2 += 1) {\n var sample = samples[_i2];\n var nearest = getClosestIndex(colors, sample);\n zones[nearest].push(samples[_i2]);\n }\n\n var lastColors = (0, _deepClone[\"default\"])(colors);\n\n for (var _i3 = 0; _i3 < zones.length; _i3 += 1) {\n var zone = zones[_i3];\n var size = zone.length;\n var Ls = [];\n var As = [];\n var Bs = [];\n\n var _iterator = _createForOfIteratorHelper(zone),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _sample = _step.value;\n Ls.push(_sample[0]);\n As.push(_sample[1]);\n Bs.push(_sample[2]);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n var lAvg = _utils[\"default\"].sum(Ls) / size;\n var aAvg = _utils[\"default\"].sum(As) / size;\n var bAvg = _utils[\"default\"].sum(Bs) / size;\n colors[_i3] = [lAvg, aAvg, bAvg];\n }\n\n if ((0, _deepEquals[\"default\"])(lastColors, colors)) {\n break;\n }\n }\n\n colors = sortByContrast(colors);\n return colors.map(function (lab) {\n return _chromaJs[\"default\"].lab(lab);\n });\n};\n\nvar _default = distinctColors;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/distinct-colors/lib/index.js?"); + +/***/ }), + +/***/ "./node_modules/distinct-colors/lib/utils.js": +/*!***************************************************!*\ + !*** ./node_modules/distinct-colors/lib/utils.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nvar utils = {\n sum: function sum(array) {\n return array.reduce(function (a, b) {\n return a + b;\n });\n }\n};\nvar _default = utils;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/distinct-colors/lib/utils.js?"); + +/***/ }), + +/***/ "./node_modules/gl-matrix/esm/common.js": +/*!**********************************************!*\ + !*** ./node_modules/gl-matrix/esm/common.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ARRAY_TYPE: () => (/* binding */ ARRAY_TYPE),\n/* harmony export */ EPSILON: () => (/* binding */ EPSILON),\n/* harmony export */ RANDOM: () => (/* binding */ RANDOM),\n/* harmony export */ equals: () => (/* binding */ equals),\n/* harmony export */ setMatrixArrayType: () => (/* binding */ setMatrixArrayType),\n/* harmony export */ toRadian: () => (/* binding */ toRadian)\n/* harmony export */ });\n/**\n * Common utilities\n * @module glMatrix\n */\n// Configuration Constants\nvar EPSILON = 0.000001;\nvar ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nvar RANDOM = Math.random;\n/**\n * Sets the type of array used when creating new vectors and matrices\n *\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\n */\n\nfunction setMatrixArrayType(type) {\n ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\n/**\n * Convert Degree To Radian\n *\n * @param {Number} a Angle in Degrees\n */\n\nfunction toRadian(a) {\n return a * degree;\n}\n/**\n * Tests whether or not the arguments have approximately the same value, within an absolute\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\n * than or equal to 1.0, and a relative tolerance is used for larger values)\n *\n * @param {Number} a The first number to test.\n * @param {Number} b The second number to test.\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\n */\n\nfunction equals(a, b) {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\nif (!Math.hypot) Math.hypot = function () {\n var y = 0,\n i = arguments.length;\n\n while (i--) {\n y += arguments[i] * arguments[i];\n }\n\n return Math.sqrt(y);\n};\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/gl-matrix/esm/common.js?"); + +/***/ }), + +/***/ "./node_modules/gl-matrix/esm/mat4.js": +/*!********************************************!*\ + !*** ./node_modules/gl-matrix/esm/mat4.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ add: () => (/* binding */ add),\n/* harmony export */ adjoint: () => (/* binding */ adjoint),\n/* harmony export */ clone: () => (/* binding */ clone),\n/* harmony export */ copy: () => (/* binding */ copy),\n/* harmony export */ create: () => (/* binding */ create),\n/* harmony export */ determinant: () => (/* binding */ determinant),\n/* harmony export */ equals: () => (/* binding */ equals),\n/* harmony export */ exactEquals: () => (/* binding */ exactEquals),\n/* harmony export */ frob: () => (/* binding */ frob),\n/* harmony export */ fromQuat: () => (/* binding */ fromQuat),\n/* harmony export */ fromQuat2: () => (/* binding */ fromQuat2),\n/* harmony export */ fromRotation: () => (/* binding */ fromRotation),\n/* harmony export */ fromRotationTranslation: () => (/* binding */ fromRotationTranslation),\n/* harmony export */ fromRotationTranslationScale: () => (/* binding */ fromRotationTranslationScale),\n/* harmony export */ fromRotationTranslationScaleOrigin: () => (/* binding */ fromRotationTranslationScaleOrigin),\n/* harmony export */ fromScaling: () => (/* binding */ fromScaling),\n/* harmony export */ fromTranslation: () => (/* binding */ fromTranslation),\n/* harmony export */ fromValues: () => (/* binding */ fromValues),\n/* harmony export */ fromXRotation: () => (/* binding */ fromXRotation),\n/* harmony export */ fromYRotation: () => (/* binding */ fromYRotation),\n/* harmony export */ fromZRotation: () => (/* binding */ fromZRotation),\n/* harmony export */ frustum: () => (/* binding */ frustum),\n/* harmony export */ getRotation: () => (/* binding */ getRotation),\n/* harmony export */ getScaling: () => (/* binding */ getScaling),\n/* harmony export */ getTranslation: () => (/* binding */ getTranslation),\n/* harmony export */ identity: () => (/* binding */ identity),\n/* harmony export */ invert: () => (/* binding */ invert),\n/* harmony export */ lookAt: () => (/* binding */ lookAt),\n/* harmony export */ mul: () => (/* binding */ mul),\n/* harmony export */ multiply: () => (/* binding */ multiply),\n/* harmony export */ multiplyScalar: () => (/* binding */ multiplyScalar),\n/* harmony export */ multiplyScalarAndAdd: () => (/* binding */ multiplyScalarAndAdd),\n/* harmony export */ ortho: () => (/* binding */ ortho),\n/* harmony export */ orthoNO: () => (/* binding */ orthoNO),\n/* harmony export */ orthoZO: () => (/* binding */ orthoZO),\n/* harmony export */ perspective: () => (/* binding */ perspective),\n/* harmony export */ perspectiveFromFieldOfView: () => (/* binding */ perspectiveFromFieldOfView),\n/* harmony export */ perspectiveNO: () => (/* binding */ perspectiveNO),\n/* harmony export */ perspectiveZO: () => (/* binding */ perspectiveZO),\n/* harmony export */ rotate: () => (/* binding */ rotate),\n/* harmony export */ rotateX: () => (/* binding */ rotateX),\n/* harmony export */ rotateY: () => (/* binding */ rotateY),\n/* harmony export */ rotateZ: () => (/* binding */ rotateZ),\n/* harmony export */ scale: () => (/* binding */ scale),\n/* harmony export */ set: () => (/* binding */ set),\n/* harmony export */ str: () => (/* binding */ str),\n/* harmony export */ sub: () => (/* binding */ sub),\n/* harmony export */ subtract: () => (/* binding */ subtract),\n/* harmony export */ targetTo: () => (/* binding */ targetTo),\n/* harmony export */ translate: () => (/* binding */ translate),\n/* harmony export */ transpose: () => (/* binding */ transpose)\n/* harmony export */ });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied.\n * @module mat4\n */\n\n/**\n * Creates a new identity mat4\n *\n * @returns {mat4} a new 4x4 matrix\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n }\n\n out[0] = 1;\n out[5] = 1;\n out[10] = 1;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a new mat4 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat4} a matrix to clone\n * @returns {mat4} a new 4x4 matrix\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Copy the values from one mat4 to another\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Create a new mat4 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} A new mat4\n */\n\nfunction fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\n * Set the components of a mat4 to the given values\n *\n * @param {mat4} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} out\n */\n\nfunction set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\n * Set a mat4 to the identity matrix\n *\n * @param {mat4} out the receiving matrix\n * @returns {mat4} out\n */\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Transpose the values of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nfunction transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a12 = a[6],\n a13 = a[7];\n var a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\n * Inverts a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nfunction invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n}\n/**\n * Calculates the adjugate of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nfunction adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n return out;\n}\n/**\n * Calculates the determinant of a mat4\n *\n * @param {ReadonlyMat4} a the source matrix\n * @returns {Number} determinant of a\n */\n\nfunction determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\n * Multiplies two mat4s\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nfunction multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n/**\n * Translate a mat4 by the given vector\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to translate\n * @param {ReadonlyVec3} v vector to translate by\n * @returns {mat4} out\n */\n\nfunction translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n}\n/**\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\n * @returns {mat4} out\n **/\n\nfunction scale(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Rotates a mat4 by the given angle around the given axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\n\nfunction rotate(out, a, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n var b00, b01, b02;\n var b10, b11, b12;\n var b20, b21, b22;\n\n if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11]; // Construct the elements of the rotation matrix\n\n b00 = x * x * t + c;\n b01 = y * x * t + z * s;\n b02 = z * x * t - y * s;\n b10 = x * y * t - z * s;\n b11 = y * y * t + c;\n b12 = z * y * t + x * s;\n b20 = x * z * t + y * s;\n b21 = y * z * t - x * s;\n b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the X axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction rotateX(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the Y axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction rotateY(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the Z axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction rotateZ(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\n\nfunction fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Scaling vector\n * @returns {mat4} out\n */\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\n\nfunction fromRotation(out, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n\n if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c; // Perform rotation-specific matrix multiplication\n\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction fromXRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction fromYRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction fromZRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\n\nfunction fromRotationTranslation(out, q, v) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a new mat4 from a dual quat.\n *\n * @param {mat4} out Matrix\n * @param {ReadonlyQuat2} a Dual Quaternion\n * @returns {mat4} mat4 receiving operation result\n */\n\nfunction fromQuat2(out, a) {\n var translation = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3);\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n if (magnitude > 0) {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n\n fromRotationTranslation(out, a, translation);\n return out;\n}\n/**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n\nfunction getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n}\n/**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion paramter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n\nfunction getScaling(out, mat) {\n var m11 = mat[0];\n var m12 = mat[1];\n var m13 = mat[2];\n var m21 = mat[4];\n var m22 = mat[5];\n var m23 = mat[6];\n var m31 = mat[8];\n var m32 = mat[9];\n var m33 = mat[10];\n out[0] = Math.hypot(m11, m12, m13);\n out[1] = Math.hypot(m21, m22, m23);\n out[2] = Math.hypot(m31, m32, m33);\n return out;\n}\n/**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @param {quat} out Quaternion to receive the rotation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {quat} out\n */\n\nfunction getRotation(out, mat) {\n var scaling = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3);\n getScaling(scaling, mat);\n var is1 = 1 / scaling[0];\n var is2 = 1 / scaling[1];\n var is3 = 1 / scaling[2];\n var sm11 = mat[0] * is1;\n var sm12 = mat[1] * is2;\n var sm13 = mat[2] * is3;\n var sm21 = mat[4] * is1;\n var sm22 = mat[5] * is2;\n var sm23 = mat[6] * is3;\n var sm31 = mat[8] * is1;\n var sm32 = mat[9] * is2;\n var sm33 = mat[10] * is3;\n var trace = sm11 + sm22 + sm33;\n var S = 0;\n\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @returns {mat4} out\n */\n\nfunction fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\n * @returns {mat4} out\n */\n\nfunction fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n var ox = o[0];\n var oy = o[1];\n var oz = o[2];\n var out0 = (1 - (yy + zz)) * sx;\n var out1 = (xy + wz) * sx;\n var out2 = (xz - wy) * sx;\n var out4 = (xy - wz) * sy;\n var out5 = (1 - (xx + zz)) * sy;\n var out6 = (yz + wx) * sy;\n var out8 = (xz + wy) * sz;\n var out9 = (yz - wx) * sz;\n var out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n}\n/**\n * Calculates a 4x4 matrix from the given quaternion\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyQuat} q Quaternion to create matrix from\n *\n * @returns {mat4} out\n */\n\nfunction fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Generates a frustum matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Number} left Left bound of the frustum\n * @param {Number} right Right bound of the frustum\n * @param {Number} bottom Bottom bound of the frustum\n * @param {Number} top Top bound of the frustum\n * @param {Number} near Near bound of the frustum\n * @param {Number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nfunction frustum(out, left, right, bottom, top, near, far) {\n var rl = 1 / (right - left);\n var tb = 1 / (top - bottom);\n var nf = 1 / (near - far);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near * 2 * nf;\n out[15] = 0;\n return out;\n}\n/**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\n\nfunction perspectiveNO(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n\n return out;\n}\n/**\n * Alias for {@link mat4.perspectiveNO}\n * @function\n */\n\nvar perspective = perspectiveNO;\n/**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\n\nfunction perspectiveZO(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n\n return out;\n}\n/**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nfunction perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n var xScale = 2.0 / (leftTan + rightTan);\n var yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n}\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nfunction orthoNO(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\n * Alias for {@link mat4.orthoNO}\n * @function\n */\n\nvar ortho = orthoNO;\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nfunction orthoZO(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n}\n/**\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} center Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\n\nfunction lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n var eyex = eye[0];\n var eyey = eye[1];\n var eyez = eye[2];\n var upx = up[0];\n var upy = up[1];\n var upz = up[2];\n var centerx = center[0];\n var centery = center[1];\n var centerz = center[2];\n\n if (Math.abs(eyex - centerx) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyey - centery) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyez - centerz) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n/**\n * Generates a matrix that makes something look at something else.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} center Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\n\nfunction targetTo(out, eye, target, up) {\n var eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2];\n var z0 = eyex - target[0],\n z1 = eyey - target[1],\n z2 = eyez - target[2];\n var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n\n var x0 = upy * z2 - upz * z1,\n x1 = upz * z0 - upx * z2,\n x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n}\n/**\n * Returns a string representation of a mat4\n *\n * @param {ReadonlyMat4} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nfunction str(a) {\n return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat4\n *\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n}\n/**\n * Adds two mat4's\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat4} out\n */\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n/**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat4} out the receiving vector\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat4} out\n */\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var a8 = a[8],\n a9 = a[9],\n a10 = a[10],\n a11 = a[11];\n var a12 = a[12],\n a13 = a[13],\n a14 = a[14],\n a15 = a[15];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n var b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n var b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11];\n var b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\n * Alias for {@link mat4.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link mat4.subtract}\n * @function\n */\n\nvar sub = subtract;\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/gl-matrix/esm/mat4.js?"); + +/***/ }), + +/***/ "./node_modules/gl-matrix/esm/vec2.js": +/*!********************************************!*\ + !*** ./node_modules/gl-matrix/esm/vec2.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ add: () => (/* binding */ add),\n/* harmony export */ angle: () => (/* binding */ angle),\n/* harmony export */ ceil: () => (/* binding */ ceil),\n/* harmony export */ clone: () => (/* binding */ clone),\n/* harmony export */ copy: () => (/* binding */ copy),\n/* harmony export */ create: () => (/* binding */ create),\n/* harmony export */ cross: () => (/* binding */ cross),\n/* harmony export */ dist: () => (/* binding */ dist),\n/* harmony export */ distance: () => (/* binding */ distance),\n/* harmony export */ div: () => (/* binding */ div),\n/* harmony export */ divide: () => (/* binding */ divide),\n/* harmony export */ dot: () => (/* binding */ dot),\n/* harmony export */ equals: () => (/* binding */ equals),\n/* harmony export */ exactEquals: () => (/* binding */ exactEquals),\n/* harmony export */ floor: () => (/* binding */ floor),\n/* harmony export */ forEach: () => (/* binding */ forEach),\n/* harmony export */ fromValues: () => (/* binding */ fromValues),\n/* harmony export */ inverse: () => (/* binding */ inverse),\n/* harmony export */ len: () => (/* binding */ len),\n/* harmony export */ length: () => (/* binding */ length),\n/* harmony export */ lerp: () => (/* binding */ lerp),\n/* harmony export */ max: () => (/* binding */ max),\n/* harmony export */ min: () => (/* binding */ min),\n/* harmony export */ mul: () => (/* binding */ mul),\n/* harmony export */ multiply: () => (/* binding */ multiply),\n/* harmony export */ negate: () => (/* binding */ negate),\n/* harmony export */ normalize: () => (/* binding */ normalize),\n/* harmony export */ random: () => (/* binding */ random),\n/* harmony export */ rotate: () => (/* binding */ rotate),\n/* harmony export */ round: () => (/* binding */ round),\n/* harmony export */ scale: () => (/* binding */ scale),\n/* harmony export */ scaleAndAdd: () => (/* binding */ scaleAndAdd),\n/* harmony export */ set: () => (/* binding */ set),\n/* harmony export */ sqrDist: () => (/* binding */ sqrDist),\n/* harmony export */ sqrLen: () => (/* binding */ sqrLen),\n/* harmony export */ squaredDistance: () => (/* binding */ squaredDistance),\n/* harmony export */ squaredLength: () => (/* binding */ squaredLength),\n/* harmony export */ str: () => (/* binding */ str),\n/* harmony export */ sub: () => (/* binding */ sub),\n/* harmony export */ subtract: () => (/* binding */ subtract),\n/* harmony export */ transformMat2: () => (/* binding */ transformMat2),\n/* harmony export */ transformMat2d: () => (/* binding */ transformMat2d),\n/* harmony export */ transformMat3: () => (/* binding */ transformMat3),\n/* harmony export */ transformMat4: () => (/* binding */ transformMat4),\n/* harmony export */ zero: () => (/* binding */ zero)\n/* harmony export */ });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 2 Dimensional Vector\n * @module vec2\n */\n\n/**\n * Creates a new, empty vec2\n *\n * @returns {vec2} a new 2D vector\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec2 initialized with values from an existing vector\n *\n * @param {ReadonlyVec2} a vector to clone\n * @returns {vec2} a new 2D vector\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\n * Creates a new vec2 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} a new 2D vector\n */\n\nfunction fromValues(x, y) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\n * Copy the values from one vec2 to another\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the source vector\n * @returns {vec2} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\n * Set the components of a vec2 to the given values\n *\n * @param {vec2} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} out\n */\n\nfunction set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\n * Adds two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n/**\n * Multiplies two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n}\n/**\n * Divides two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n}\n/**\n * Math.ceil the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to ceil\n * @returns {vec2} out\n */\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n}\n/**\n * Math.floor the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to floor\n * @returns {vec2} out\n */\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n}\n/**\n * Returns the minimum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n}\n/**\n * Returns the maximum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n}\n/**\n * Math.round the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to round\n * @returns {vec2} out\n */\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n}\n/**\n * Scales a vec2 by a scalar number\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec2} out\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n}\n/**\n * Adds two vec2's after scaling the second operand by a scalar value\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec2} out\n */\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} distance between a and b\n */\n\nfunction distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.hypot(x, y);\n}\n/**\n * Calculates the squared euclidian distance between two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x * x + y * y;\n}\n/**\n * Calculates the length of a vec2\n *\n * @param {ReadonlyVec2} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nfunction length(a) {\n var x = a[0],\n y = a[1];\n return Math.hypot(x, y);\n}\n/**\n * Calculates the squared length of a vec2\n *\n * @param {ReadonlyVec2} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nfunction squaredLength(a) {\n var x = a[0],\n y = a[1];\n return x * x + y * y;\n}\n/**\n * Negates the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to negate\n * @returns {vec2} out\n */\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to invert\n * @returns {vec2} out\n */\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n}\n/**\n * Normalize a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to normalize\n * @returns {vec2} out\n */\n\nfunction normalize(out, a) {\n var x = a[0],\n y = a[1];\n var len = x * x + y * y;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n}\n/**\n * Computes the cross product of two vec2's\n * Note that the cross product must by definition produce a 3D vector\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec3} out\n */\n\nfunction cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec2} out\n */\n\nfunction lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec2} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec2} out\n */\n\nfunction random(out, scale) {\n scale = scale || 1.0;\n var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n}\n/**\n * Transforms the vec2 with a mat2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat2} m matrix to transform with\n * @returns {vec2} out\n */\n\nfunction transformMat2(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n}\n/**\n * Transforms the vec2 with a mat2d\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat2d} m matrix to transform with\n * @returns {vec2} out\n */\n\nfunction transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\n * Transforms the vec2 with a mat3\n * 3rd vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat3} m matrix to transform with\n * @returns {vec2} out\n */\n\nfunction transformMat3(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n}\n/**\n * Transforms the vec2 with a mat4\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec2} out\n */\n\nfunction transformMat4(out, a, m) {\n var x = a[0];\n var y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n/**\n * Rotate a 2D vector\n * @param {vec2} out The receiving vec2\n * @param {ReadonlyVec2} a The vec2 point to rotate\n * @param {ReadonlyVec2} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec2} out\n */\n\nfunction rotate(out, a, b, rad) {\n //Translate point to the origin\n var p0 = a[0] - b[0],\n p1 = a[1] - b[1],\n sinC = Math.sin(rad),\n cosC = Math.cos(rad); //perform rotation and translate to correct position\n\n out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n}\n/**\n * Get the angle between two 2D vectors\n * @param {ReadonlyVec2} a The first operand\n * @param {ReadonlyVec2} b The second operand\n * @returns {Number} The angle in radians\n */\n\nfunction angle(a, b) {\n var x1 = a[0],\n y1 = a[1],\n x2 = b[0],\n y2 = b[1],\n // mag is the product of the magnitudes of a and b\n mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),\n // mag &&.. short circuits if mag == 0\n cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\n * Set the components of a vec2 to zero\n *\n * @param {vec2} out the receiving vector\n * @returns {vec2} out\n */\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec2} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nfunction str(a) {\n return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n/**\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec2} a The first vector.\n * @param {ReadonlyVec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec2} a The first vector.\n * @param {ReadonlyVec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1];\n var b0 = b[0],\n b1 = b[1];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\n * Alias for {@link vec2.length}\n * @function\n */\n\nvar len = length;\n/**\n * Alias for {@link vec2.subtract}\n * @function\n */\n\nvar sub = subtract;\n/**\n * Alias for {@link vec2.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link vec2.divide}\n * @function\n */\n\nvar div = divide;\n/**\n * Alias for {@link vec2.distance}\n * @function\n */\n\nvar dist = distance;\n/**\n * Alias for {@link vec2.squaredDistance}\n * @function\n */\n\nvar sqrDist = squaredDistance;\n/**\n * Alias for {@link vec2.squaredLength}\n * @function\n */\n\nvar sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec2s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 2;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n }\n\n return a;\n };\n}();\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/gl-matrix/esm/vec2.js?"); + +/***/ }), + +/***/ "./node_modules/gl-matrix/esm/vec3.js": +/*!********************************************!*\ + !*** ./node_modules/gl-matrix/esm/vec3.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ add: () => (/* binding */ add),\n/* harmony export */ angle: () => (/* binding */ angle),\n/* harmony export */ bezier: () => (/* binding */ bezier),\n/* harmony export */ ceil: () => (/* binding */ ceil),\n/* harmony export */ clone: () => (/* binding */ clone),\n/* harmony export */ copy: () => (/* binding */ copy),\n/* harmony export */ create: () => (/* binding */ create),\n/* harmony export */ cross: () => (/* binding */ cross),\n/* harmony export */ dist: () => (/* binding */ dist),\n/* harmony export */ distance: () => (/* binding */ distance),\n/* harmony export */ div: () => (/* binding */ div),\n/* harmony export */ divide: () => (/* binding */ divide),\n/* harmony export */ dot: () => (/* binding */ dot),\n/* harmony export */ equals: () => (/* binding */ equals),\n/* harmony export */ exactEquals: () => (/* binding */ exactEquals),\n/* harmony export */ floor: () => (/* binding */ floor),\n/* harmony export */ forEach: () => (/* binding */ forEach),\n/* harmony export */ fromValues: () => (/* binding */ fromValues),\n/* harmony export */ hermite: () => (/* binding */ hermite),\n/* harmony export */ inverse: () => (/* binding */ inverse),\n/* harmony export */ len: () => (/* binding */ len),\n/* harmony export */ length: () => (/* binding */ length),\n/* harmony export */ lerp: () => (/* binding */ lerp),\n/* harmony export */ max: () => (/* binding */ max),\n/* harmony export */ min: () => (/* binding */ min),\n/* harmony export */ mul: () => (/* binding */ mul),\n/* harmony export */ multiply: () => (/* binding */ multiply),\n/* harmony export */ negate: () => (/* binding */ negate),\n/* harmony export */ normalize: () => (/* binding */ normalize),\n/* harmony export */ random: () => (/* binding */ random),\n/* harmony export */ rotateX: () => (/* binding */ rotateX),\n/* harmony export */ rotateY: () => (/* binding */ rotateY),\n/* harmony export */ rotateZ: () => (/* binding */ rotateZ),\n/* harmony export */ round: () => (/* binding */ round),\n/* harmony export */ scale: () => (/* binding */ scale),\n/* harmony export */ scaleAndAdd: () => (/* binding */ scaleAndAdd),\n/* harmony export */ set: () => (/* binding */ set),\n/* harmony export */ sqrDist: () => (/* binding */ sqrDist),\n/* harmony export */ sqrLen: () => (/* binding */ sqrLen),\n/* harmony export */ squaredDistance: () => (/* binding */ squaredDistance),\n/* harmony export */ squaredLength: () => (/* binding */ squaredLength),\n/* harmony export */ str: () => (/* binding */ str),\n/* harmony export */ sub: () => (/* binding */ sub),\n/* harmony export */ subtract: () => (/* binding */ subtract),\n/* harmony export */ transformMat3: () => (/* binding */ transformMat3),\n/* harmony export */ transformMat4: () => (/* binding */ transformMat4),\n/* harmony export */ transformQuat: () => (/* binding */ transformQuat),\n/* harmony export */ zero: () => (/* binding */ zero)\n/* harmony export */ });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 3 Dimensional Vector\n * @module vec3\n */\n\n/**\n * Creates a new, empty vec3\n *\n * @returns {vec3} a new 3D vector\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec3 initialized with values from an existing vector\n *\n * @param {ReadonlyVec3} a vector to clone\n * @returns {vec3} a new 3D vector\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\n * Calculates the length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nfunction length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return Math.hypot(x, y, z);\n}\n/**\n * Creates a new vec3 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} a new 3D vector\n */\n\nfunction fromValues(x, y, z) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\n * Copy the values from one vec3 to another\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the source vector\n * @returns {vec3} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\n * Set the components of a vec3 to the given values\n *\n * @param {vec3} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} out\n */\n\nfunction set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\n * Adds two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n/**\n * Multiplies two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n/**\n * Divides two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n/**\n * Math.ceil the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to ceil\n * @returns {vec3} out\n */\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n/**\n * Math.floor the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to floor\n * @returns {vec3} out\n */\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n/**\n * Returns the minimum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n/**\n * Returns the maximum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n/**\n * Math.round the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to round\n * @returns {vec3} out\n */\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n return out;\n}\n/**\n * Scales a vec3 by a scalar number\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec3} out\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n/**\n * Adds two vec3's after scaling the second operand by a scalar value\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec3} out\n */\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} distance between a and b\n */\n\nfunction distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return Math.hypot(x, y, z);\n}\n/**\n * Calculates the squared euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return x * x + y * y + z * z;\n}\n/**\n * Calculates the squared length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nfunction squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return x * x + y * y + z * z;\n}\n/**\n * Negates the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to negate\n * @returns {vec3} out\n */\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to invert\n * @returns {vec3} out\n */\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n/**\n * Normalize a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to normalize\n * @returns {vec3} out\n */\n\nfunction normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var len = x * x + y * y + z * z;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\n * Computes the cross product of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction cross(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2];\n var bx = b[0],\n by = b[1],\n bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nfunction lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n/**\n * Performs a hermite interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nfunction hermite(out, a, b, c, d, t) {\n var factorTimes2 = t * t;\n var factor1 = factorTimes2 * (2 * t - 3) + 1;\n var factor2 = factorTimes2 * (t - 2) + t;\n var factor3 = factorTimes2 * (t - 1);\n var factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\n * Performs a bezier interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nfunction bezier(out, a, b, c, d, t) {\n var inverseFactor = 1 - t;\n var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n var factorTimes2 = t * t;\n var factor1 = inverseFactorTimesTwo * inverseFactor;\n var factor2 = 3 * t * inverseFactorTimesTwo;\n var factor3 = 3 * factorTimes2 * inverseFactor;\n var factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec3} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec3} out\n */\n\nfunction random(out, scale) {\n scale = scale || 1.0;\n var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI;\n var z = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 - 1.0;\n var zScale = Math.sqrt(1.0 - z * z) * scale;\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n/**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec3} out\n */\n\nfunction transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n/**\n * Transforms the vec3 with a mat3.\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\n * @returns {vec3} out\n */\n\nfunction transformMat3(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n/**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyQuat} q quaternion to transform with\n * @returns {vec3} out\n */\n\nfunction transformQuat(out, a, q) {\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3];\n var x = a[0],\n y = a[1],\n z = a[2]; // var qvec = [qx, qy, qz];\n // var uv = vec3.cross([], qvec, a);\n\n var uvx = qy * z - qz * y,\n uvy = qz * x - qx * z,\n uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n var uuvx = qy * uvz - qz * uvy,\n uuvy = qz * uvx - qx * uvz,\n uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n var w2 = qw * 2;\n uvx *= w2;\n uvy *= w2;\n uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n uuvx *= 2;\n uuvy *= 2;\n uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n out[0] = x + uvx + uuvx;\n out[1] = y + uvy + uuvy;\n out[2] = z + uvz + uuvz;\n return out;\n}\n/**\n * Rotate a 3D vector around the x-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nfunction rotateX(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Rotate a 3D vector around the y-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nfunction rotateY(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Rotate a 3D vector around the z-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nfunction rotateZ(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2]; //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Get the angle between two 3D vectors\n * @param {ReadonlyVec3} a The first operand\n * @param {ReadonlyVec3} b The second operand\n * @returns {Number} The angle in radians\n */\n\nfunction angle(a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n bx = b[0],\n by = b[1],\n bz = b[2],\n mag1 = Math.sqrt(ax * ax + ay * ay + az * az),\n mag2 = Math.sqrt(bx * bx + by * by + bz * bz),\n mag = mag1 * mag2,\n cosine = mag && dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\n * Set the components of a vec3 to zero\n *\n * @param {vec3} out the receiving vector\n * @returns {vec3} out\n */\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec3} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nfunction str(a) {\n return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\n * Alias for {@link vec3.subtract}\n * @function\n */\n\nvar sub = subtract;\n/**\n * Alias for {@link vec3.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link vec3.divide}\n * @function\n */\n\nvar div = divide;\n/**\n * Alias for {@link vec3.distance}\n * @function\n */\n\nvar dist = distance;\n/**\n * Alias for {@link vec3.squaredDistance}\n * @function\n */\n\nvar sqrDist = squaredDistance;\n/**\n * Alias for {@link vec3.length}\n * @function\n */\n\nvar len = length;\n/**\n * Alias for {@link vec3.squaredLength}\n * @function\n */\n\nvar sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec3s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 3;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n }\n\n return a;\n };\n}();\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/gl-matrix/esm/vec3.js?"); + +/***/ }), + +/***/ "./node_modules/gl-matrix/esm/vec4.js": +/*!********************************************!*\ + !*** ./node_modules/gl-matrix/esm/vec4.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ add: () => (/* binding */ add),\n/* harmony export */ ceil: () => (/* binding */ ceil),\n/* harmony export */ clone: () => (/* binding */ clone),\n/* harmony export */ copy: () => (/* binding */ copy),\n/* harmony export */ create: () => (/* binding */ create),\n/* harmony export */ cross: () => (/* binding */ cross),\n/* harmony export */ dist: () => (/* binding */ dist),\n/* harmony export */ distance: () => (/* binding */ distance),\n/* harmony export */ div: () => (/* binding */ div),\n/* harmony export */ divide: () => (/* binding */ divide),\n/* harmony export */ dot: () => (/* binding */ dot),\n/* harmony export */ equals: () => (/* binding */ equals),\n/* harmony export */ exactEquals: () => (/* binding */ exactEquals),\n/* harmony export */ floor: () => (/* binding */ floor),\n/* harmony export */ forEach: () => (/* binding */ forEach),\n/* harmony export */ fromValues: () => (/* binding */ fromValues),\n/* harmony export */ inverse: () => (/* binding */ inverse),\n/* harmony export */ len: () => (/* binding */ len),\n/* harmony export */ length: () => (/* binding */ length),\n/* harmony export */ lerp: () => (/* binding */ lerp),\n/* harmony export */ max: () => (/* binding */ max),\n/* harmony export */ min: () => (/* binding */ min),\n/* harmony export */ mul: () => (/* binding */ mul),\n/* harmony export */ multiply: () => (/* binding */ multiply),\n/* harmony export */ negate: () => (/* binding */ negate),\n/* harmony export */ normalize: () => (/* binding */ normalize),\n/* harmony export */ random: () => (/* binding */ random),\n/* harmony export */ round: () => (/* binding */ round),\n/* harmony export */ scale: () => (/* binding */ scale),\n/* harmony export */ scaleAndAdd: () => (/* binding */ scaleAndAdd),\n/* harmony export */ set: () => (/* binding */ set),\n/* harmony export */ sqrDist: () => (/* binding */ sqrDist),\n/* harmony export */ sqrLen: () => (/* binding */ sqrLen),\n/* harmony export */ squaredDistance: () => (/* binding */ squaredDistance),\n/* harmony export */ squaredLength: () => (/* binding */ squaredLength),\n/* harmony export */ str: () => (/* binding */ str),\n/* harmony export */ sub: () => (/* binding */ sub),\n/* harmony export */ subtract: () => (/* binding */ subtract),\n/* harmony export */ transformMat4: () => (/* binding */ transformMat4),\n/* harmony export */ transformQuat: () => (/* binding */ transformQuat),\n/* harmony export */ zero: () => (/* binding */ zero)\n/* harmony export */ });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 4 Dimensional Vector\n * @module vec4\n */\n\n/**\n * Creates a new, empty vec4\n *\n * @returns {vec4} a new 4D vector\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec4 initialized with values from an existing vector\n *\n * @param {ReadonlyVec4} a vector to clone\n * @returns {vec4} a new 4D vector\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Creates a new vec4 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} a new 4D vector\n */\n\nfunction fromValues(x, y, z, w) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\n * Copy the values from one vec4 to another\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the source vector\n * @returns {vec4} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Set the components of a vec4 to the given values\n *\n * @param {vec4} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} out\n */\n\nfunction set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\n * Adds two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\n * Multiplies two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n/**\n * Divides two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n/**\n * Math.ceil the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to ceil\n * @returns {vec4} out\n */\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n/**\n * Math.floor the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to floor\n * @returns {vec4} out\n */\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n/**\n * Returns the minimum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n/**\n * Returns the maximum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n/**\n * Math.round the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to round\n * @returns {vec4} out\n */\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n}\n/**\n * Scales a vec4 by a scalar number\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec4} out\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\n * Adds two vec4's after scaling the second operand by a scalar value\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec4} out\n */\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} distance between a and b\n */\n\nfunction distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\n * Calculates the squared euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\n * Calculates the length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nfunction length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\n * Calculates the squared length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nfunction squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\n * Negates the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to negate\n * @returns {vec4} out\n */\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to invert\n * @returns {vec4} out\n */\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n/**\n * Normalize a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to normalize\n * @returns {vec4} out\n */\n\nfunction normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\n * Returns the cross-product of three vectors in a 4-dimensional space\n *\n * @param {ReadonlyVec4} result the receiving vector\n * @param {ReadonlyVec4} U the first vector\n * @param {ReadonlyVec4} V the second vector\n * @param {ReadonlyVec4} W the third vector\n * @returns {vec4} result\n */\n\nfunction cross(out, u, v, w) {\n var A = v[0] * w[1] - v[1] * w[0],\n B = v[0] * w[2] - v[2] * w[0],\n C = v[0] * w[3] - v[3] * w[0],\n D = v[1] * w[2] - v[2] * w[1],\n E = v[1] * w[3] - v[3] * w[1],\n F = v[2] * w[3] - v[3] * w[2];\n var G = u[0];\n var H = u[1];\n var I = u[2];\n var J = u[3];\n out[0] = H * F - I * E + J * D;\n out[1] = -(G * F) + I * C - J * B;\n out[2] = G * E - H * C + J * A;\n out[3] = -(G * D) + H * B - I * A;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec4} out\n */\n\nfunction lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n var aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec4} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec4} out\n */\n\nfunction random(out, scale) {\n scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n\n var v1, v2, v3, v4;\n var s1, s2;\n\n do {\n v1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1;\n v2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n\n do {\n v3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1;\n v4 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n\n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n}\n/**\n * Transforms the vec4 with a mat4.\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec4} out\n */\n\nfunction transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n/**\n * Transforms the vec4 with a quat\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyQuat} q quaternion to transform with\n * @returns {vec4} out\n */\n\nfunction transformQuat(out, a, q) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3]; // calculate quat * vec\n\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n/**\n * Set the components of a vec4 to zero\n *\n * @param {vec4} out the receiving vector\n * @returns {vec4} out\n */\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec4} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nfunction str(a) {\n return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\n * Alias for {@link vec4.subtract}\n * @function\n */\n\nvar sub = subtract;\n/**\n * Alias for {@link vec4.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link vec4.divide}\n * @function\n */\n\nvar div = divide;\n/**\n * Alias for {@link vec4.distance}\n * @function\n */\n\nvar dist = distance;\n/**\n * Alias for {@link vec4.squaredDistance}\n * @function\n */\n\nvar sqrDist = squaredDistance;\n/**\n * Alias for {@link vec4.length}\n * @function\n */\n\nvar len = length;\n/**\n * Alias for {@link vec4.squaredLength}\n * @function\n */\n\nvar sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec4s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 4;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n vec[3] = a[i + 3];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n a[i + 3] = vec[3];\n }\n\n return a;\n };\n}();\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/gl-matrix/esm/vec4.js?"); + +/***/ }), + +/***/ "./node_modules/hammerjs/hammer.js": +/*!*****************************************!*\ + !*** ./node_modules/hammerjs/hammer.js ***! + \*****************************************/ +/***/ ((module, exports, __webpack_require__) => { + +eval("var __WEBPACK_AMD_DEFINE_RESULT__;/*! Hammer.JS - v2.0.7 - 2016-04-22\n * http://hammerjs.github.io/\n *\n * Copyright (c) 2016 Jorik Tangelder;\n * Licensed under the MIT license */\n(function(window, document, exportName, undefined) {\n 'use strict';\n\nvar VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];\nvar TEST_ELEMENT = document.createElement('div');\n\nvar TYPE_FUNCTION = 'function';\n\nvar round = Math.round;\nvar abs = Math.abs;\nvar now = Date.now;\n\n/**\n * set a timeout with a given scope\n * @param {Function} fn\n * @param {Number} timeout\n * @param {Object} context\n * @returns {number}\n */\nfunction setTimeoutContext(fn, timeout, context) {\n return setTimeout(bindFn(fn, context), timeout);\n}\n\n/**\n * if the argument is an array, we want to execute the fn on each entry\n * if it aint an array we don't want to do a thing.\n * this is used by all the methods that accept a single and array argument.\n * @param {*|Array} arg\n * @param {String} fn\n * @param {Object} [context]\n * @returns {Boolean}\n */\nfunction invokeArrayArg(arg, fn, context) {\n if (Array.isArray(arg)) {\n each(arg, context[fn], context);\n return true;\n }\n return false;\n}\n\n/**\n * walk objects and arrays\n * @param {Object} obj\n * @param {Function} iterator\n * @param {Object} context\n */\nfunction each(obj, iterator, context) {\n var i;\n\n if (!obj) {\n return;\n }\n\n if (obj.forEach) {\n obj.forEach(iterator, context);\n } else if (obj.length !== undefined) {\n i = 0;\n while (i < obj.length) {\n iterator.call(context, obj[i], i, obj);\n i++;\n }\n } else {\n for (i in obj) {\n obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);\n }\n }\n}\n\n/**\n * wrap a method with a deprecation warning and stack trace\n * @param {Function} method\n * @param {String} name\n * @param {String} message\n * @returns {Function} A new function wrapping the supplied method.\n */\nfunction deprecate(method, name, message) {\n var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\\n' + message + ' AT \\n';\n return function() {\n var e = new Error('get-stack-trace');\n var stack = e && e.stack ? e.stack.replace(/^[^\\(]+?[\\n$]/gm, '')\n .replace(/^\\s+at\\s+/gm, '')\n .replace(/^Object.\\s*\\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';\n\n var log = window.console && (window.console.warn || window.console.log);\n if (log) {\n log.call(window.console, deprecationMessage, stack);\n }\n return method.apply(this, arguments);\n };\n}\n\n/**\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} target\n * @param {...Object} objects_to_assign\n * @returns {Object} target\n */\nvar assign;\nif (typeof Object.assign !== 'function') {\n assign = function assign(target) {\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n var output = Object(target);\n for (var index = 1; index < arguments.length; index++) {\n var source = arguments[index];\n if (source !== undefined && source !== null) {\n for (var nextKey in source) {\n if (source.hasOwnProperty(nextKey)) {\n output[nextKey] = source[nextKey];\n }\n }\n }\n }\n return output;\n };\n} else {\n assign = Object.assign;\n}\n\n/**\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} dest\n * @param {Object} src\n * @param {Boolean} [merge=false]\n * @returns {Object} dest\n */\nvar extend = deprecate(function extend(dest, src, merge) {\n var keys = Object.keys(src);\n var i = 0;\n while (i < keys.length) {\n if (!merge || (merge && dest[keys[i]] === undefined)) {\n dest[keys[i]] = src[keys[i]];\n }\n i++;\n }\n return dest;\n}, 'extend', 'Use `assign`.');\n\n/**\n * merge the values from src in the dest.\n * means that properties that exist in dest will not be overwritten by src\n * @param {Object} dest\n * @param {Object} src\n * @returns {Object} dest\n */\nvar merge = deprecate(function merge(dest, src) {\n return extend(dest, src, true);\n}, 'merge', 'Use `assign`.');\n\n/**\n * simple class inheritance\n * @param {Function} child\n * @param {Function} base\n * @param {Object} [properties]\n */\nfunction inherit(child, base, properties) {\n var baseP = base.prototype,\n childP;\n\n childP = child.prototype = Object.create(baseP);\n childP.constructor = child;\n childP._super = baseP;\n\n if (properties) {\n assign(childP, properties);\n }\n}\n\n/**\n * simple function bind\n * @param {Function} fn\n * @param {Object} context\n * @returns {Function}\n */\nfunction bindFn(fn, context) {\n return function boundFn() {\n return fn.apply(context, arguments);\n };\n}\n\n/**\n * let a boolean value also be a function that must return a boolean\n * this first item in args will be used as the context\n * @param {Boolean|Function} val\n * @param {Array} [args]\n * @returns {Boolean}\n */\nfunction boolOrFn(val, args) {\n if (typeof val == TYPE_FUNCTION) {\n return val.apply(args ? args[0] || undefined : undefined, args);\n }\n return val;\n}\n\n/**\n * use the val2 when val1 is undefined\n * @param {*} val1\n * @param {*} val2\n * @returns {*}\n */\nfunction ifUndefined(val1, val2) {\n return (val1 === undefined) ? val2 : val1;\n}\n\n/**\n * addEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\nfunction addEventListeners(target, types, handler) {\n each(splitStr(types), function(type) {\n target.addEventListener(type, handler, false);\n });\n}\n\n/**\n * removeEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\nfunction removeEventListeners(target, types, handler) {\n each(splitStr(types), function(type) {\n target.removeEventListener(type, handler, false);\n });\n}\n\n/**\n * find if a node is in the given parent\n * @method hasParent\n * @param {HTMLElement} node\n * @param {HTMLElement} parent\n * @return {Boolean} found\n */\nfunction hasParent(node, parent) {\n while (node) {\n if (node == parent) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n}\n\n/**\n * small indexOf wrapper\n * @param {String} str\n * @param {String} find\n * @returns {Boolean} found\n */\nfunction inStr(str, find) {\n return str.indexOf(find) > -1;\n}\n\n/**\n * split string on whitespace\n * @param {String} str\n * @returns {Array} words\n */\nfunction splitStr(str) {\n return str.trim().split(/\\s+/g);\n}\n\n/**\n * find if a array contains the object using indexOf or a simple polyFill\n * @param {Array} src\n * @param {String} find\n * @param {String} [findByKey]\n * @return {Boolean|Number} false when not found, or the index\n */\nfunction inArray(src, find, findByKey) {\n if (src.indexOf && !findByKey) {\n return src.indexOf(find);\n } else {\n var i = 0;\n while (i < src.length) {\n if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {\n return i;\n }\n i++;\n }\n return -1;\n }\n}\n\n/**\n * convert array-like objects to real arrays\n * @param {Object} obj\n * @returns {Array}\n */\nfunction toArray(obj) {\n return Array.prototype.slice.call(obj, 0);\n}\n\n/**\n * unique array with objects based on a key (like 'id') or just by the array's value\n * @param {Array} src [{id:1},{id:2},{id:1}]\n * @param {String} [key]\n * @param {Boolean} [sort=False]\n * @returns {Array} [{id:1},{id:2}]\n */\nfunction uniqueArray(src, key, sort) {\n var results = [];\n var values = [];\n var i = 0;\n\n while (i < src.length) {\n var val = key ? src[i][key] : src[i];\n if (inArray(values, val) < 0) {\n results.push(src[i]);\n }\n values[i] = val;\n i++;\n }\n\n if (sort) {\n if (!key) {\n results = results.sort();\n } else {\n results = results.sort(function sortUniqueArray(a, b) {\n return a[key] > b[key];\n });\n }\n }\n\n return results;\n}\n\n/**\n * get the prefixed property\n * @param {Object} obj\n * @param {String} property\n * @returns {String|Undefined} prefixed\n */\nfunction prefixed(obj, property) {\n var prefix, prop;\n var camelProp = property[0].toUpperCase() + property.slice(1);\n\n var i = 0;\n while (i < VENDOR_PREFIXES.length) {\n prefix = VENDOR_PREFIXES[i];\n prop = (prefix) ? prefix + camelProp : property;\n\n if (prop in obj) {\n return prop;\n }\n i++;\n }\n return undefined;\n}\n\n/**\n * get a unique id\n * @returns {number} uniqueId\n */\nvar _uniqueId = 1;\nfunction uniqueId() {\n return _uniqueId++;\n}\n\n/**\n * get the window object of an element\n * @param {HTMLElement} element\n * @returns {DocumentView|Window}\n */\nfunction getWindowForElement(element) {\n var doc = element.ownerDocument || element;\n return (doc.defaultView || doc.parentWindow || window);\n}\n\nvar MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;\n\nvar SUPPORT_TOUCH = ('ontouchstart' in window);\nvar SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;\nvar SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);\n\nvar INPUT_TYPE_TOUCH = 'touch';\nvar INPUT_TYPE_PEN = 'pen';\nvar INPUT_TYPE_MOUSE = 'mouse';\nvar INPUT_TYPE_KINECT = 'kinect';\n\nvar COMPUTE_INTERVAL = 25;\n\nvar INPUT_START = 1;\nvar INPUT_MOVE = 2;\nvar INPUT_END = 4;\nvar INPUT_CANCEL = 8;\n\nvar DIRECTION_NONE = 1;\nvar DIRECTION_LEFT = 2;\nvar DIRECTION_RIGHT = 4;\nvar DIRECTION_UP = 8;\nvar DIRECTION_DOWN = 16;\n\nvar DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;\nvar DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;\nvar DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;\n\nvar PROPS_XY = ['x', 'y'];\nvar PROPS_CLIENT_XY = ['clientX', 'clientY'];\n\n/**\n * create new input type manager\n * @param {Manager} manager\n * @param {Function} callback\n * @returns {Input}\n * @constructor\n */\nfunction Input(manager, callback) {\n var self = this;\n this.manager = manager;\n this.callback = callback;\n this.element = manager.element;\n this.target = manager.options.inputTarget;\n\n // smaller wrapper around the handler, for the scope and the enabled state of the manager,\n // so when disabled the input events are completely bypassed.\n this.domHandler = function(ev) {\n if (boolOrFn(manager.options.enable, [manager])) {\n self.handler(ev);\n }\n };\n\n this.init();\n\n}\n\nInput.prototype = {\n /**\n * should handle the inputEvent data and trigger the callback\n * @virtual\n */\n handler: function() { },\n\n /**\n * bind the events\n */\n init: function() {\n this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);\n this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);\n this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n },\n\n /**\n * unbind the events\n */\n destroy: function() {\n this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);\n this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);\n this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n }\n};\n\n/**\n * create new input type manager\n * called by the Manager constructor\n * @param {Hammer} manager\n * @returns {Input}\n */\nfunction createInputInstance(manager) {\n var Type;\n var inputClass = manager.options.inputClass;\n\n if (inputClass) {\n Type = inputClass;\n } else if (SUPPORT_POINTER_EVENTS) {\n Type = PointerEventInput;\n } else if (SUPPORT_ONLY_TOUCH) {\n Type = TouchInput;\n } else if (!SUPPORT_TOUCH) {\n Type = MouseInput;\n } else {\n Type = TouchMouseInput;\n }\n return new (Type)(manager, inputHandler);\n}\n\n/**\n * handle input events\n * @param {Manager} manager\n * @param {String} eventType\n * @param {Object} input\n */\nfunction inputHandler(manager, eventType, input) {\n var pointersLen = input.pointers.length;\n var changedPointersLen = input.changedPointers.length;\n var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));\n var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));\n\n input.isFirst = !!isFirst;\n input.isFinal = !!isFinal;\n\n if (isFirst) {\n manager.session = {};\n }\n\n // source event is the normalized value of the domEvents\n // like 'touchstart, mouseup, pointerdown'\n input.eventType = eventType;\n\n // compute scale, rotation etc\n computeInputData(manager, input);\n\n // emit secret event\n manager.emit('hammer.input', input);\n\n manager.recognize(input);\n manager.session.prevInput = input;\n}\n\n/**\n * extend the data with some usable properties like scale, rotate, velocity etc\n * @param {Object} manager\n * @param {Object} input\n */\nfunction computeInputData(manager, input) {\n var session = manager.session;\n var pointers = input.pointers;\n var pointersLength = pointers.length;\n\n // store the first input to calculate the distance and direction\n if (!session.firstInput) {\n session.firstInput = simpleCloneInputData(input);\n }\n\n // to compute scale and rotation we need to store the multiple touches\n if (pointersLength > 1 && !session.firstMultiple) {\n session.firstMultiple = simpleCloneInputData(input);\n } else if (pointersLength === 1) {\n session.firstMultiple = false;\n }\n\n var firstInput = session.firstInput;\n var firstMultiple = session.firstMultiple;\n var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;\n\n var center = input.center = getCenter(pointers);\n input.timeStamp = now();\n input.deltaTime = input.timeStamp - firstInput.timeStamp;\n\n input.angle = getAngle(offsetCenter, center);\n input.distance = getDistance(offsetCenter, center);\n\n computeDeltaXY(session, input);\n input.offsetDirection = getDirection(input.deltaX, input.deltaY);\n\n var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);\n input.overallVelocityX = overallVelocity.x;\n input.overallVelocityY = overallVelocity.y;\n input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;\n\n input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;\n input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;\n\n input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >\n session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);\n\n computeIntervalInputData(session, input);\n\n // find the correct target\n var target = manager.element;\n if (hasParent(input.srcEvent.target, target)) {\n target = input.srcEvent.target;\n }\n input.target = target;\n}\n\nfunction computeDeltaXY(session, input) {\n var center = input.center;\n var offset = session.offsetDelta || {};\n var prevDelta = session.prevDelta || {};\n var prevInput = session.prevInput || {};\n\n if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {\n prevDelta = session.prevDelta = {\n x: prevInput.deltaX || 0,\n y: prevInput.deltaY || 0\n };\n\n offset = session.offsetDelta = {\n x: center.x,\n y: center.y\n };\n }\n\n input.deltaX = prevDelta.x + (center.x - offset.x);\n input.deltaY = prevDelta.y + (center.y - offset.y);\n}\n\n/**\n * velocity is calculated every x ms\n * @param {Object} session\n * @param {Object} input\n */\nfunction computeIntervalInputData(session, input) {\n var last = session.lastInterval || input,\n deltaTime = input.timeStamp - last.timeStamp,\n velocity, velocityX, velocityY, direction;\n\n if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {\n var deltaX = input.deltaX - last.deltaX;\n var deltaY = input.deltaY - last.deltaY;\n\n var v = getVelocity(deltaTime, deltaX, deltaY);\n velocityX = v.x;\n velocityY = v.y;\n velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;\n direction = getDirection(deltaX, deltaY);\n\n session.lastInterval = input;\n } else {\n // use latest velocity info if it doesn't overtake a minimum period\n velocity = last.velocity;\n velocityX = last.velocityX;\n velocityY = last.velocityY;\n direction = last.direction;\n }\n\n input.velocity = velocity;\n input.velocityX = velocityX;\n input.velocityY = velocityY;\n input.direction = direction;\n}\n\n/**\n * create a simple clone from the input used for storage of firstInput and firstMultiple\n * @param {Object} input\n * @returns {Object} clonedInputData\n */\nfunction simpleCloneInputData(input) {\n // make a simple copy of the pointers because we will get a reference if we don't\n // we only need clientXY for the calculations\n var pointers = [];\n var i = 0;\n while (i < input.pointers.length) {\n pointers[i] = {\n clientX: round(input.pointers[i].clientX),\n clientY: round(input.pointers[i].clientY)\n };\n i++;\n }\n\n return {\n timeStamp: now(),\n pointers: pointers,\n center: getCenter(pointers),\n deltaX: input.deltaX,\n deltaY: input.deltaY\n };\n}\n\n/**\n * get the center of all the pointers\n * @param {Array} pointers\n * @return {Object} center contains `x` and `y` properties\n */\nfunction getCenter(pointers) {\n var pointersLength = pointers.length;\n\n // no need to loop when only one touch\n if (pointersLength === 1) {\n return {\n x: round(pointers[0].clientX),\n y: round(pointers[0].clientY)\n };\n }\n\n var x = 0, y = 0, i = 0;\n while (i < pointersLength) {\n x += pointers[i].clientX;\n y += pointers[i].clientY;\n i++;\n }\n\n return {\n x: round(x / pointersLength),\n y: round(y / pointersLength)\n };\n}\n\n/**\n * calculate the velocity between two points. unit is in px per ms.\n * @param {Number} deltaTime\n * @param {Number} x\n * @param {Number} y\n * @return {Object} velocity `x` and `y`\n */\nfunction getVelocity(deltaTime, x, y) {\n return {\n x: x / deltaTime || 0,\n y: y / deltaTime || 0\n };\n}\n\n/**\n * get the direction between two points\n * @param {Number} x\n * @param {Number} y\n * @return {Number} direction\n */\nfunction getDirection(x, y) {\n if (x === y) {\n return DIRECTION_NONE;\n }\n\n if (abs(x) >= abs(y)) {\n return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;\n }\n return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;\n}\n\n/**\n * calculate the absolute distance between two points\n * @param {Object} p1 {x, y}\n * @param {Object} p2 {x, y}\n * @param {Array} [props] containing x and y keys\n * @return {Number} distance\n */\nfunction getDistance(p1, p2, props) {\n if (!props) {\n props = PROPS_XY;\n }\n var x = p2[props[0]] - p1[props[0]],\n y = p2[props[1]] - p1[props[1]];\n\n return Math.sqrt((x * x) + (y * y));\n}\n\n/**\n * calculate the angle between two coordinates\n * @param {Object} p1\n * @param {Object} p2\n * @param {Array} [props] containing x and y keys\n * @return {Number} angle\n */\nfunction getAngle(p1, p2, props) {\n if (!props) {\n props = PROPS_XY;\n }\n var x = p2[props[0]] - p1[props[0]],\n y = p2[props[1]] - p1[props[1]];\n return Math.atan2(y, x) * 180 / Math.PI;\n}\n\n/**\n * calculate the rotation degrees between two pointersets\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} rotation\n */\nfunction getRotation(start, end) {\n return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);\n}\n\n/**\n * calculate the scale factor between two pointersets\n * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} scale\n */\nfunction getScale(start, end) {\n return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);\n}\n\nvar MOUSE_INPUT_MAP = {\n mousedown: INPUT_START,\n mousemove: INPUT_MOVE,\n mouseup: INPUT_END\n};\n\nvar MOUSE_ELEMENT_EVENTS = 'mousedown';\nvar MOUSE_WINDOW_EVENTS = 'mousemove mouseup';\n\n/**\n * Mouse events input\n * @constructor\n * @extends Input\n */\nfunction MouseInput() {\n this.evEl = MOUSE_ELEMENT_EVENTS;\n this.evWin = MOUSE_WINDOW_EVENTS;\n\n this.pressed = false; // mousedown state\n\n Input.apply(this, arguments);\n}\n\ninherit(MouseInput, Input, {\n /**\n * handle mouse events\n * @param {Object} ev\n */\n handler: function MEhandler(ev) {\n var eventType = MOUSE_INPUT_MAP[ev.type];\n\n // on start we want to have the left mouse button down\n if (eventType & INPUT_START && ev.button === 0) {\n this.pressed = true;\n }\n\n if (eventType & INPUT_MOVE && ev.which !== 1) {\n eventType = INPUT_END;\n }\n\n // mouse must be down\n if (!this.pressed) {\n return;\n }\n\n if (eventType & INPUT_END) {\n this.pressed = false;\n }\n\n this.callback(this.manager, eventType, {\n pointers: [ev],\n changedPointers: [ev],\n pointerType: INPUT_TYPE_MOUSE,\n srcEvent: ev\n });\n }\n});\n\nvar POINTER_INPUT_MAP = {\n pointerdown: INPUT_START,\n pointermove: INPUT_MOVE,\n pointerup: INPUT_END,\n pointercancel: INPUT_CANCEL,\n pointerout: INPUT_CANCEL\n};\n\n// in IE10 the pointer types is defined as an enum\nvar IE10_POINTER_TYPE_ENUM = {\n 2: INPUT_TYPE_TOUCH,\n 3: INPUT_TYPE_PEN,\n 4: INPUT_TYPE_MOUSE,\n 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816\n};\n\nvar POINTER_ELEMENT_EVENTS = 'pointerdown';\nvar POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';\n\n// IE10 has prefixed support, and case-sensitive\nif (window.MSPointerEvent && !window.PointerEvent) {\n POINTER_ELEMENT_EVENTS = 'MSPointerDown';\n POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';\n}\n\n/**\n * Pointer events input\n * @constructor\n * @extends Input\n */\nfunction PointerEventInput() {\n this.evEl = POINTER_ELEMENT_EVENTS;\n this.evWin = POINTER_WINDOW_EVENTS;\n\n Input.apply(this, arguments);\n\n this.store = (this.manager.session.pointerEvents = []);\n}\n\ninherit(PointerEventInput, Input, {\n /**\n * handle mouse events\n * @param {Object} ev\n */\n handler: function PEhandler(ev) {\n var store = this.store;\n var removePointer = false;\n\n var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');\n var eventType = POINTER_INPUT_MAP[eventTypeNormalized];\n var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;\n\n var isTouch = (pointerType == INPUT_TYPE_TOUCH);\n\n // get index of the event in the store\n var storeIndex = inArray(store, ev.pointerId, 'pointerId');\n\n // start and mouse must be down\n if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {\n if (storeIndex < 0) {\n store.push(ev);\n storeIndex = store.length - 1;\n }\n } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n removePointer = true;\n }\n\n // it not found, so the pointer hasn't been down (so it's probably a hover)\n if (storeIndex < 0) {\n return;\n }\n\n // update the event in the store\n store[storeIndex] = ev;\n\n this.callback(this.manager, eventType, {\n pointers: store,\n changedPointers: [ev],\n pointerType: pointerType,\n srcEvent: ev\n });\n\n if (removePointer) {\n // remove from the store\n store.splice(storeIndex, 1);\n }\n }\n});\n\nvar SINGLE_TOUCH_INPUT_MAP = {\n touchstart: INPUT_START,\n touchmove: INPUT_MOVE,\n touchend: INPUT_END,\n touchcancel: INPUT_CANCEL\n};\n\nvar SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';\nvar SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';\n\n/**\n * Touch events input\n * @constructor\n * @extends Input\n */\nfunction SingleTouchInput() {\n this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;\n this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;\n this.started = false;\n\n Input.apply(this, arguments);\n}\n\ninherit(SingleTouchInput, Input, {\n handler: function TEhandler(ev) {\n var type = SINGLE_TOUCH_INPUT_MAP[ev.type];\n\n // should we handle the touch events?\n if (type === INPUT_START) {\n this.started = true;\n }\n\n if (!this.started) {\n return;\n }\n\n var touches = normalizeSingleTouches.call(this, ev, type);\n\n // when done, reset the started state\n if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {\n this.started = false;\n }\n\n this.callback(this.manager, type, {\n pointers: touches[0],\n changedPointers: touches[1],\n pointerType: INPUT_TYPE_TOUCH,\n srcEvent: ev\n });\n }\n});\n\n/**\n * @this {TouchInput}\n * @param {Object} ev\n * @param {Number} type flag\n * @returns {undefined|Array} [all, changed]\n */\nfunction normalizeSingleTouches(ev, type) {\n var all = toArray(ev.touches);\n var changed = toArray(ev.changedTouches);\n\n if (type & (INPUT_END | INPUT_CANCEL)) {\n all = uniqueArray(all.concat(changed), 'identifier', true);\n }\n\n return [all, changed];\n}\n\nvar TOUCH_INPUT_MAP = {\n touchstart: INPUT_START,\n touchmove: INPUT_MOVE,\n touchend: INPUT_END,\n touchcancel: INPUT_CANCEL\n};\n\nvar TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';\n\n/**\n * Multi-user touch events input\n * @constructor\n * @extends Input\n */\nfunction TouchInput() {\n this.evTarget = TOUCH_TARGET_EVENTS;\n this.targetIds = {};\n\n Input.apply(this, arguments);\n}\n\ninherit(TouchInput, Input, {\n handler: function MTEhandler(ev) {\n var type = TOUCH_INPUT_MAP[ev.type];\n var touches = getTouches.call(this, ev, type);\n if (!touches) {\n return;\n }\n\n this.callback(this.manager, type, {\n pointers: touches[0],\n changedPointers: touches[1],\n pointerType: INPUT_TYPE_TOUCH,\n srcEvent: ev\n });\n }\n});\n\n/**\n * @this {TouchInput}\n * @param {Object} ev\n * @param {Number} type flag\n * @returns {undefined|Array} [all, changed]\n */\nfunction getTouches(ev, type) {\n var allTouches = toArray(ev.touches);\n var targetIds = this.targetIds;\n\n // when there is only one touch, the process can be simplified\n if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {\n targetIds[allTouches[0].identifier] = true;\n return [allTouches, allTouches];\n }\n\n var i,\n targetTouches,\n changedTouches = toArray(ev.changedTouches),\n changedTargetTouches = [],\n target = this.target;\n\n // get target touches from touches\n targetTouches = allTouches.filter(function(touch) {\n return hasParent(touch.target, target);\n });\n\n // collect touches\n if (type === INPUT_START) {\n i = 0;\n while (i < targetTouches.length) {\n targetIds[targetTouches[i].identifier] = true;\n i++;\n }\n }\n\n // filter changed touches to only contain touches that exist in the collected target ids\n i = 0;\n while (i < changedTouches.length) {\n if (targetIds[changedTouches[i].identifier]) {\n changedTargetTouches.push(changedTouches[i]);\n }\n\n // cleanup removed touches\n if (type & (INPUT_END | INPUT_CANCEL)) {\n delete targetIds[changedTouches[i].identifier];\n }\n i++;\n }\n\n if (!changedTargetTouches.length) {\n return;\n }\n\n return [\n // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'\n uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),\n changedTargetTouches\n ];\n}\n\n/**\n * Combined touch and mouse input\n *\n * Touch has a higher priority then mouse, and while touching no mouse events are allowed.\n * This because touch devices also emit mouse events while doing a touch.\n *\n * @constructor\n * @extends Input\n */\n\nvar DEDUP_TIMEOUT = 2500;\nvar DEDUP_DISTANCE = 25;\n\nfunction TouchMouseInput() {\n Input.apply(this, arguments);\n\n var handler = bindFn(this.handler, this);\n this.touch = new TouchInput(this.manager, handler);\n this.mouse = new MouseInput(this.manager, handler);\n\n this.primaryTouch = null;\n this.lastTouches = [];\n}\n\ninherit(TouchMouseInput, Input, {\n /**\n * handle mouse and touch events\n * @param {Hammer} manager\n * @param {String} inputEvent\n * @param {Object} inputData\n */\n handler: function TMEhandler(manager, inputEvent, inputData) {\n var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),\n isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);\n\n if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {\n return;\n }\n\n // when we're in a touch event, record touches to de-dupe synthetic mouse event\n if (isTouch) {\n recordTouches.call(this, inputEvent, inputData);\n } else if (isMouse && isSyntheticEvent.call(this, inputData)) {\n return;\n }\n\n this.callback(manager, inputEvent, inputData);\n },\n\n /**\n * remove the event listeners\n */\n destroy: function destroy() {\n this.touch.destroy();\n this.mouse.destroy();\n }\n});\n\nfunction recordTouches(eventType, eventData) {\n if (eventType & INPUT_START) {\n this.primaryTouch = eventData.changedPointers[0].identifier;\n setLastTouch.call(this, eventData);\n } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n setLastTouch.call(this, eventData);\n }\n}\n\nfunction setLastTouch(eventData) {\n var touch = eventData.changedPointers[0];\n\n if (touch.identifier === this.primaryTouch) {\n var lastTouch = {x: touch.clientX, y: touch.clientY};\n this.lastTouches.push(lastTouch);\n var lts = this.lastTouches;\n var removeLastTouch = function() {\n var i = lts.indexOf(lastTouch);\n if (i > -1) {\n lts.splice(i, 1);\n }\n };\n setTimeout(removeLastTouch, DEDUP_TIMEOUT);\n }\n}\n\nfunction isSyntheticEvent(eventData) {\n var x = eventData.srcEvent.clientX, y = eventData.srcEvent.clientY;\n for (var i = 0; i < this.lastTouches.length; i++) {\n var t = this.lastTouches[i];\n var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y);\n if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {\n return true;\n }\n }\n return false;\n}\n\nvar PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');\nvar NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;\n\n// magical touchAction value\nvar TOUCH_ACTION_COMPUTE = 'compute';\nvar TOUCH_ACTION_AUTO = 'auto';\nvar TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented\nvar TOUCH_ACTION_NONE = 'none';\nvar TOUCH_ACTION_PAN_X = 'pan-x';\nvar TOUCH_ACTION_PAN_Y = 'pan-y';\nvar TOUCH_ACTION_MAP = getTouchActionProps();\n\n/**\n * Touch Action\n * sets the touchAction property or uses the js alternative\n * @param {Manager} manager\n * @param {String} value\n * @constructor\n */\nfunction TouchAction(manager, value) {\n this.manager = manager;\n this.set(value);\n}\n\nTouchAction.prototype = {\n /**\n * set the touchAction value on the element or enable the polyfill\n * @param {String} value\n */\n set: function(value) {\n // find out the touch-action by the event handlers\n if (value == TOUCH_ACTION_COMPUTE) {\n value = this.compute();\n }\n\n if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {\n this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;\n }\n this.actions = value.toLowerCase().trim();\n },\n\n /**\n * just re-set the touchAction value\n */\n update: function() {\n this.set(this.manager.options.touchAction);\n },\n\n /**\n * compute the value for the touchAction property based on the recognizer's settings\n * @returns {String} value\n */\n compute: function() {\n var actions = [];\n each(this.manager.recognizers, function(recognizer) {\n if (boolOrFn(recognizer.options.enable, [recognizer])) {\n actions = actions.concat(recognizer.getTouchAction());\n }\n });\n return cleanTouchActions(actions.join(' '));\n },\n\n /**\n * this method is called on each input cycle and provides the preventing of the browser behavior\n * @param {Object} input\n */\n preventDefaults: function(input) {\n var srcEvent = input.srcEvent;\n var direction = input.offsetDirection;\n\n // if the touch action did prevented once this session\n if (this.manager.session.prevented) {\n srcEvent.preventDefault();\n return;\n }\n\n var actions = this.actions;\n var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];\n\n if (hasNone) {\n //do not prevent defaults if this is a tap gesture\n\n var isTapPointer = input.pointers.length === 1;\n var isTapMovement = input.distance < 2;\n var isTapTouchTime = input.deltaTime < 250;\n\n if (isTapPointer && isTapMovement && isTapTouchTime) {\n return;\n }\n }\n\n if (hasPanX && hasPanY) {\n // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent\n return;\n }\n\n if (hasNone ||\n (hasPanY && direction & DIRECTION_HORIZONTAL) ||\n (hasPanX && direction & DIRECTION_VERTICAL)) {\n return this.preventSrc(srcEvent);\n }\n },\n\n /**\n * call preventDefault to prevent the browser's default behavior (scrolling in most cases)\n * @param {Object} srcEvent\n */\n preventSrc: function(srcEvent) {\n this.manager.session.prevented = true;\n srcEvent.preventDefault();\n }\n};\n\n/**\n * when the touchActions are collected they are not a valid value, so we need to clean things up. *\n * @param {String} actions\n * @returns {*}\n */\nfunction cleanTouchActions(actions) {\n // none\n if (inStr(actions, TOUCH_ACTION_NONE)) {\n return TOUCH_ACTION_NONE;\n }\n\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);\n\n // if both pan-x and pan-y are set (different recognizers\n // for different directions, e.g. horizontal pan but vertical swipe?)\n // we need none (as otherwise with pan-x pan-y combined none of these\n // recognizers will work, since the browser would handle all panning\n if (hasPanX && hasPanY) {\n return TOUCH_ACTION_NONE;\n }\n\n // pan-x OR pan-y\n if (hasPanX || hasPanY) {\n return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;\n }\n\n // manipulation\n if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {\n return TOUCH_ACTION_MANIPULATION;\n }\n\n return TOUCH_ACTION_AUTO;\n}\n\nfunction getTouchActionProps() {\n if (!NATIVE_TOUCH_ACTION) {\n return false;\n }\n var touchMap = {};\n var cssSupports = window.CSS && window.CSS.supports;\n ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function(val) {\n\n // If css.supports is not supported but there is native touch-action assume it supports\n // all values. This is the case for IE 10 and 11.\n touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true;\n });\n return touchMap;\n}\n\n/**\n * Recognizer flow explained; *\n * All recognizers have the initial state of POSSIBLE when a input session starts.\n * The definition of a input session is from the first input until the last input, with all it's movement in it. *\n * Example session for mouse-input: mousedown -> mousemove -> mouseup\n *\n * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed\n * which determines with state it should be.\n *\n * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to\n * POSSIBLE to give it another change on the next cycle.\n *\n * Possible\n * |\n * +-----+---------------+\n * | |\n * +-----+-----+ |\n * | | |\n * Failed Cancelled |\n * +-------+------+\n * | |\n * Recognized Began\n * |\n * Changed\n * |\n * Ended/Recognized\n */\nvar STATE_POSSIBLE = 1;\nvar STATE_BEGAN = 2;\nvar STATE_CHANGED = 4;\nvar STATE_ENDED = 8;\nvar STATE_RECOGNIZED = STATE_ENDED;\nvar STATE_CANCELLED = 16;\nvar STATE_FAILED = 32;\n\n/**\n * Recognizer\n * Every recognizer needs to extend from this class.\n * @constructor\n * @param {Object} options\n */\nfunction Recognizer(options) {\n this.options = assign({}, this.defaults, options || {});\n\n this.id = uniqueId();\n\n this.manager = null;\n\n // default is enable true\n this.options.enable = ifUndefined(this.options.enable, true);\n\n this.state = STATE_POSSIBLE;\n\n this.simultaneous = {};\n this.requireFail = [];\n}\n\nRecognizer.prototype = {\n /**\n * @virtual\n * @type {Object}\n */\n defaults: {},\n\n /**\n * set options\n * @param {Object} options\n * @return {Recognizer}\n */\n set: function(options) {\n assign(this.options, options);\n\n // also update the touchAction, in case something changed about the directions/enabled state\n this.manager && this.manager.touchAction.update();\n return this;\n },\n\n /**\n * recognize simultaneous with an other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n recognizeWith: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {\n return this;\n }\n\n var simultaneous = this.simultaneous;\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n if (!simultaneous[otherRecognizer.id]) {\n simultaneous[otherRecognizer.id] = otherRecognizer;\n otherRecognizer.recognizeWith(this);\n }\n return this;\n },\n\n /**\n * drop the simultaneous link. it doesnt remove the link on the other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n dropRecognizeWith: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {\n return this;\n }\n\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n delete this.simultaneous[otherRecognizer.id];\n return this;\n },\n\n /**\n * recognizer can only run when an other is failing\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n requireFailure: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {\n return this;\n }\n\n var requireFail = this.requireFail;\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n if (inArray(requireFail, otherRecognizer) === -1) {\n requireFail.push(otherRecognizer);\n otherRecognizer.requireFailure(this);\n }\n return this;\n },\n\n /**\n * drop the requireFailure link. it does not remove the link on the other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n dropRequireFailure: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {\n return this;\n }\n\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n var index = inArray(this.requireFail, otherRecognizer);\n if (index > -1) {\n this.requireFail.splice(index, 1);\n }\n return this;\n },\n\n /**\n * has require failures boolean\n * @returns {boolean}\n */\n hasRequireFailures: function() {\n return this.requireFail.length > 0;\n },\n\n /**\n * if the recognizer can recognize simultaneous with an other recognizer\n * @param {Recognizer} otherRecognizer\n * @returns {Boolean}\n */\n canRecognizeWith: function(otherRecognizer) {\n return !!this.simultaneous[otherRecognizer.id];\n },\n\n /**\n * You should use `tryEmit` instead of `emit` directly to check\n * that all the needed recognizers has failed before emitting.\n * @param {Object} input\n */\n emit: function(input) {\n var self = this;\n var state = this.state;\n\n function emit(event) {\n self.manager.emit(event, input);\n }\n\n // 'panstart' and 'panmove'\n if (state < STATE_ENDED) {\n emit(self.options.event + stateStr(state));\n }\n\n emit(self.options.event); // simple 'eventName' events\n\n if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...)\n emit(input.additionalEvent);\n }\n\n // panend and pancancel\n if (state >= STATE_ENDED) {\n emit(self.options.event + stateStr(state));\n }\n },\n\n /**\n * Check that all the require failure recognizers has failed,\n * if true, it emits a gesture event,\n * otherwise, setup the state to FAILED.\n * @param {Object} input\n */\n tryEmit: function(input) {\n if (this.canEmit()) {\n return this.emit(input);\n }\n // it's failing anyway\n this.state = STATE_FAILED;\n },\n\n /**\n * can we emit?\n * @returns {boolean}\n */\n canEmit: function() {\n var i = 0;\n while (i < this.requireFail.length) {\n if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {\n return false;\n }\n i++;\n }\n return true;\n },\n\n /**\n * update the recognizer\n * @param {Object} inputData\n */\n recognize: function(inputData) {\n // make a new copy of the inputData\n // so we can change the inputData without messing up the other recognizers\n var inputDataClone = assign({}, inputData);\n\n // is is enabled and allow recognizing?\n if (!boolOrFn(this.options.enable, [this, inputDataClone])) {\n this.reset();\n this.state = STATE_FAILED;\n return;\n }\n\n // reset when we've reached the end\n if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {\n this.state = STATE_POSSIBLE;\n }\n\n this.state = this.process(inputDataClone);\n\n // the recognizer has recognized a gesture\n // so trigger an event\n if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {\n this.tryEmit(inputDataClone);\n }\n },\n\n /**\n * return the state of the recognizer\n * the actual recognizing happens in this method\n * @virtual\n * @param {Object} inputData\n * @returns {Const} STATE\n */\n process: function(inputData) { }, // jshint ignore:line\n\n /**\n * return the preferred touch-action\n * @virtual\n * @returns {Array}\n */\n getTouchAction: function() { },\n\n /**\n * called when the gesture isn't allowed to recognize\n * like when another is being recognized or it is disabled\n * @virtual\n */\n reset: function() { }\n};\n\n/**\n * get a usable string, used as event postfix\n * @param {Const} state\n * @returns {String} state\n */\nfunction stateStr(state) {\n if (state & STATE_CANCELLED) {\n return 'cancel';\n } else if (state & STATE_ENDED) {\n return 'end';\n } else if (state & STATE_CHANGED) {\n return 'move';\n } else if (state & STATE_BEGAN) {\n return 'start';\n }\n return '';\n}\n\n/**\n * direction cons to string\n * @param {Const} direction\n * @returns {String}\n */\nfunction directionStr(direction) {\n if (direction == DIRECTION_DOWN) {\n return 'down';\n } else if (direction == DIRECTION_UP) {\n return 'up';\n } else if (direction == DIRECTION_LEFT) {\n return 'left';\n } else if (direction == DIRECTION_RIGHT) {\n return 'right';\n }\n return '';\n}\n\n/**\n * get a recognizer by name if it is bound to a manager\n * @param {Recognizer|String} otherRecognizer\n * @param {Recognizer} recognizer\n * @returns {Recognizer}\n */\nfunction getRecognizerByNameIfManager(otherRecognizer, recognizer) {\n var manager = recognizer.manager;\n if (manager) {\n return manager.get(otherRecognizer);\n }\n return otherRecognizer;\n}\n\n/**\n * This recognizer is just used as a base for the simple attribute recognizers.\n * @constructor\n * @extends Recognizer\n */\nfunction AttrRecognizer() {\n Recognizer.apply(this, arguments);\n}\n\ninherit(AttrRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof AttrRecognizer\n */\n defaults: {\n /**\n * @type {Number}\n * @default 1\n */\n pointers: 1\n },\n\n /**\n * Used to check if it the recognizer receives valid input, like input.distance > 10.\n * @memberof AttrRecognizer\n * @param {Object} input\n * @returns {Boolean} recognized\n */\n attrTest: function(input) {\n var optionPointers = this.options.pointers;\n return optionPointers === 0 || input.pointers.length === optionPointers;\n },\n\n /**\n * Process the input and return the state for the recognizer\n * @memberof AttrRecognizer\n * @param {Object} input\n * @returns {*} State\n */\n process: function(input) {\n var state = this.state;\n var eventType = input.eventType;\n\n var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);\n var isValid = this.attrTest(input);\n\n // on cancel input and we've recognized before, return STATE_CANCELLED\n if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {\n return state | STATE_CANCELLED;\n } else if (isRecognized || isValid) {\n if (eventType & INPUT_END) {\n return state | STATE_ENDED;\n } else if (!(state & STATE_BEGAN)) {\n return STATE_BEGAN;\n }\n return state | STATE_CHANGED;\n }\n return STATE_FAILED;\n }\n});\n\n/**\n * Pan\n * Recognized when the pointer is down and moved in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}\n\ninherit(PanRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof PanRecognizer\n */\n defaults: {\n event: 'pan',\n threshold: 10,\n pointers: 1,\n direction: DIRECTION_ALL\n },\n\n getTouchAction: function() {\n var direction = this.options.direction;\n var actions = [];\n if (direction & DIRECTION_HORIZONTAL) {\n actions.push(TOUCH_ACTION_PAN_Y);\n }\n if (direction & DIRECTION_VERTICAL) {\n actions.push(TOUCH_ACTION_PAN_X);\n }\n return actions;\n },\n\n directionTest: function(input) {\n var options = this.options;\n var hasMoved = true;\n var distance = input.distance;\n var direction = input.direction;\n var x = input.deltaX;\n var y = input.deltaY;\n\n // lock to axis?\n if (!(direction & options.direction)) {\n if (options.direction & DIRECTION_HORIZONTAL) {\n direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;\n hasMoved = x != this.pX;\n distance = Math.abs(input.deltaX);\n } else {\n direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;\n hasMoved = y != this.pY;\n distance = Math.abs(input.deltaY);\n }\n }\n input.direction = direction;\n return hasMoved && distance > options.threshold && direction & options.direction;\n },\n\n attrTest: function(input) {\n return AttrRecognizer.prototype.attrTest.call(this, input) &&\n (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));\n },\n\n emit: function(input) {\n\n this.pX = input.deltaX;\n this.pY = input.deltaY;\n\n var direction = directionStr(input.direction);\n\n if (direction) {\n input.additionalEvent = this.options.event + direction;\n }\n this._super.emit.call(this, input);\n }\n});\n\n/**\n * Pinch\n * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).\n * @constructor\n * @extends AttrRecognizer\n */\nfunction PinchRecognizer() {\n AttrRecognizer.apply(this, arguments);\n}\n\ninherit(PinchRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof PinchRecognizer\n */\n defaults: {\n event: 'pinch',\n threshold: 0,\n pointers: 2\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_NONE];\n },\n\n attrTest: function(input) {\n return this._super.attrTest.call(this, input) &&\n (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);\n },\n\n emit: function(input) {\n if (input.scale !== 1) {\n var inOut = input.scale < 1 ? 'in' : 'out';\n input.additionalEvent = this.options.event + inOut;\n }\n this._super.emit.call(this, input);\n }\n});\n\n/**\n * Press\n * Recognized when the pointer is down for x ms without any movement.\n * @constructor\n * @extends Recognizer\n */\nfunction PressRecognizer() {\n Recognizer.apply(this, arguments);\n\n this._timer = null;\n this._input = null;\n}\n\ninherit(PressRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof PressRecognizer\n */\n defaults: {\n event: 'press',\n pointers: 1,\n time: 251, // minimal time of the pointer to be pressed\n threshold: 9 // a minimal movement is ok, but keep it low\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_AUTO];\n },\n\n process: function(input) {\n var options = this.options;\n var validPointers = input.pointers.length === options.pointers;\n var validMovement = input.distance < options.threshold;\n var validTime = input.deltaTime > options.time;\n\n this._input = input;\n\n // we only allow little movement\n // and we've reached an end event, so a tap is possible\n if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {\n this.reset();\n } else if (input.eventType & INPUT_START) {\n this.reset();\n this._timer = setTimeoutContext(function() {\n this.state = STATE_RECOGNIZED;\n this.tryEmit();\n }, options.time, this);\n } else if (input.eventType & INPUT_END) {\n return STATE_RECOGNIZED;\n }\n return STATE_FAILED;\n },\n\n reset: function() {\n clearTimeout(this._timer);\n },\n\n emit: function(input) {\n if (this.state !== STATE_RECOGNIZED) {\n return;\n }\n\n if (input && (input.eventType & INPUT_END)) {\n this.manager.emit(this.options.event + 'up', input);\n } else {\n this._input.timeStamp = now();\n this.manager.emit(this.options.event, this._input);\n }\n }\n});\n\n/**\n * Rotate\n * Recognized when two or more pointer are moving in a circular motion.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction RotateRecognizer() {\n AttrRecognizer.apply(this, arguments);\n}\n\ninherit(RotateRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof RotateRecognizer\n */\n defaults: {\n event: 'rotate',\n threshold: 0,\n pointers: 2\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_NONE];\n },\n\n attrTest: function(input) {\n return this._super.attrTest.call(this, input) &&\n (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);\n }\n});\n\n/**\n * Swipe\n * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction SwipeRecognizer() {\n AttrRecognizer.apply(this, arguments);\n}\n\ninherit(SwipeRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof SwipeRecognizer\n */\n defaults: {\n event: 'swipe',\n threshold: 10,\n velocity: 0.3,\n direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,\n pointers: 1\n },\n\n getTouchAction: function() {\n return PanRecognizer.prototype.getTouchAction.call(this);\n },\n\n attrTest: function(input) {\n var direction = this.options.direction;\n var velocity;\n\n if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {\n velocity = input.overallVelocity;\n } else if (direction & DIRECTION_HORIZONTAL) {\n velocity = input.overallVelocityX;\n } else if (direction & DIRECTION_VERTICAL) {\n velocity = input.overallVelocityY;\n }\n\n return this._super.attrTest.call(this, input) &&\n direction & input.offsetDirection &&\n input.distance > this.options.threshold &&\n input.maxPointers == this.options.pointers &&\n abs(velocity) > this.options.velocity && input.eventType & INPUT_END;\n },\n\n emit: function(input) {\n var direction = directionStr(input.offsetDirection);\n if (direction) {\n this.manager.emit(this.options.event + direction, input);\n }\n\n this.manager.emit(this.options.event, input);\n }\n});\n\n/**\n * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur\n * between the given interval and position. The delay option can be used to recognize multi-taps without firing\n * a single tap.\n *\n * The eventData from the emitted event contains the property `tapCount`, which contains the amount of\n * multi-taps being recognized.\n * @constructor\n * @extends Recognizer\n */\nfunction TapRecognizer() {\n Recognizer.apply(this, arguments);\n\n // previous time and center,\n // used for tap counting\n this.pTime = false;\n this.pCenter = false;\n\n this._timer = null;\n this._input = null;\n this.count = 0;\n}\n\ninherit(TapRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof PinchRecognizer\n */\n defaults: {\n event: 'tap',\n pointers: 1,\n taps: 1,\n interval: 300, // max time between the multi-tap taps\n time: 250, // max time of the pointer to be down (like finger on the screen)\n threshold: 9, // a minimal movement is ok, but keep it low\n posThreshold: 10 // a multi-tap can be a bit off the initial position\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_MANIPULATION];\n },\n\n process: function(input) {\n var options = this.options;\n\n var validPointers = input.pointers.length === options.pointers;\n var validMovement = input.distance < options.threshold;\n var validTouchTime = input.deltaTime < options.time;\n\n this.reset();\n\n if ((input.eventType & INPUT_START) && (this.count === 0)) {\n return this.failTimeout();\n }\n\n // we only allow little movement\n // and we've reached an end event, so a tap is possible\n if (validMovement && validTouchTime && validPointers) {\n if (input.eventType != INPUT_END) {\n return this.failTimeout();\n }\n\n var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;\n var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;\n\n this.pTime = input.timeStamp;\n this.pCenter = input.center;\n\n if (!validMultiTap || !validInterval) {\n this.count = 1;\n } else {\n this.count += 1;\n }\n\n this._input = input;\n\n // if tap count matches we have recognized it,\n // else it has began recognizing...\n var tapCount = this.count % options.taps;\n if (tapCount === 0) {\n // no failing requirements, immediately trigger the tap event\n // or wait as long as the multitap interval to trigger\n if (!this.hasRequireFailures()) {\n return STATE_RECOGNIZED;\n } else {\n this._timer = setTimeoutContext(function() {\n this.state = STATE_RECOGNIZED;\n this.tryEmit();\n }, options.interval, this);\n return STATE_BEGAN;\n }\n }\n }\n return STATE_FAILED;\n },\n\n failTimeout: function() {\n this._timer = setTimeoutContext(function() {\n this.state = STATE_FAILED;\n }, this.options.interval, this);\n return STATE_FAILED;\n },\n\n reset: function() {\n clearTimeout(this._timer);\n },\n\n emit: function() {\n if (this.state == STATE_RECOGNIZED) {\n this._input.tapCount = this.count;\n this.manager.emit(this.options.event, this._input);\n }\n }\n});\n\n/**\n * Simple way to create a manager with a default set of recognizers.\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\nfunction Hammer(element, options) {\n options = options || {};\n options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);\n return new Manager(element, options);\n}\n\n/**\n * @const {string}\n */\nHammer.VERSION = '2.0.7';\n\n/**\n * default settings\n * @namespace\n */\nHammer.defaults = {\n /**\n * set if DOM events are being triggered.\n * But this is slower and unused by simple implementations, so disabled by default.\n * @type {Boolean}\n * @default false\n */\n domEvents: false,\n\n /**\n * The value for the touchAction property/fallback.\n * When set to `compute` it will magically set the correct value based on the added recognizers.\n * @type {String}\n * @default compute\n */\n touchAction: TOUCH_ACTION_COMPUTE,\n\n /**\n * @type {Boolean}\n * @default true\n */\n enable: true,\n\n /**\n * EXPERIMENTAL FEATURE -- can be removed/changed\n * Change the parent input target element.\n * If Null, then it is being set the to main element.\n * @type {Null|EventTarget}\n * @default null\n */\n inputTarget: null,\n\n /**\n * force an input class\n * @type {Null|Function}\n * @default null\n */\n inputClass: null,\n\n /**\n * Default recognizer setup when calling `Hammer()`\n * When creating a new Manager these will be skipped.\n * @type {Array}\n */\n preset: [\n // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]\n [RotateRecognizer, {enable: false}],\n [PinchRecognizer, {enable: false}, ['rotate']],\n [SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}],\n [PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']],\n [TapRecognizer],\n [TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']],\n [PressRecognizer]\n ],\n\n /**\n * Some CSS properties can be used to improve the working of Hammer.\n * Add them to this method and they will be set when creating a new Manager.\n * @namespace\n */\n cssProps: {\n /**\n * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.\n * @type {String}\n * @default 'none'\n */\n userSelect: 'none',\n\n /**\n * Disable the Windows Phone grippers when pressing an element.\n * @type {String}\n * @default 'none'\n */\n touchSelect: 'none',\n\n /**\n * Disables the default callout shown when you touch and hold a touch target.\n * On iOS, when you touch and hold a touch target such as a link, Safari displays\n * a callout containing information about the link. This property allows you to disable that callout.\n * @type {String}\n * @default 'none'\n */\n touchCallout: 'none',\n\n /**\n * Specifies whether zooming is enabled. Used by IE10>\n * @type {String}\n * @default 'none'\n */\n contentZooming: 'none',\n\n /**\n * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.\n * @type {String}\n * @default 'none'\n */\n userDrag: 'none',\n\n /**\n * Overrides the highlight color shown when the user taps a link or a JavaScript\n * clickable element in iOS. This property obeys the alpha value, if specified.\n * @type {String}\n * @default 'rgba(0,0,0,0)'\n */\n tapHighlightColor: 'rgba(0,0,0,0)'\n }\n};\n\nvar STOP = 1;\nvar FORCED_STOP = 2;\n\n/**\n * Manager\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\nfunction Manager(element, options) {\n this.options = assign({}, Hammer.defaults, options || {});\n\n this.options.inputTarget = this.options.inputTarget || element;\n\n this.handlers = {};\n this.session = {};\n this.recognizers = [];\n this.oldCssProps = {};\n\n this.element = element;\n this.input = createInputInstance(this);\n this.touchAction = new TouchAction(this, this.options.touchAction);\n\n toggleCssProps(this, true);\n\n each(this.options.recognizers, function(item) {\n var recognizer = this.add(new (item[0])(item[1]));\n item[2] && recognizer.recognizeWith(item[2]);\n item[3] && recognizer.requireFailure(item[3]);\n }, this);\n}\n\nManager.prototype = {\n /**\n * set options\n * @param {Object} options\n * @returns {Manager}\n */\n set: function(options) {\n assign(this.options, options);\n\n // Options that need a little more setup\n if (options.touchAction) {\n this.touchAction.update();\n }\n if (options.inputTarget) {\n // Clean up existing event listeners and reinitialize\n this.input.destroy();\n this.input.target = options.inputTarget;\n this.input.init();\n }\n return this;\n },\n\n /**\n * stop recognizing for this session.\n * This session will be discarded, when a new [input]start event is fired.\n * When forced, the recognizer cycle is stopped immediately.\n * @param {Boolean} [force]\n */\n stop: function(force) {\n this.session.stopped = force ? FORCED_STOP : STOP;\n },\n\n /**\n * run the recognizers!\n * called by the inputHandler function on every movement of the pointers (touches)\n * it walks through all the recognizers and tries to detect the gesture that is being made\n * @param {Object} inputData\n */\n recognize: function(inputData) {\n var session = this.session;\n if (session.stopped) {\n return;\n }\n\n // run the touch-action polyfill\n this.touchAction.preventDefaults(inputData);\n\n var recognizer;\n var recognizers = this.recognizers;\n\n // this holds the recognizer that is being recognized.\n // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED\n // if no recognizer is detecting a thing, it is set to `null`\n var curRecognizer = session.curRecognizer;\n\n // reset when the last recognizer is recognized\n // or when we're in a new session\n if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {\n curRecognizer = session.curRecognizer = null;\n }\n\n var i = 0;\n while (i < recognizers.length) {\n recognizer = recognizers[i];\n\n // find out if we are allowed try to recognize the input for this one.\n // 1. allow if the session is NOT forced stopped (see the .stop() method)\n // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one\n // that is being recognized.\n // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.\n // this can be setup with the `recognizeWith()` method on the recognizer.\n if (session.stopped !== FORCED_STOP && ( // 1\n !curRecognizer || recognizer == curRecognizer || // 2\n recognizer.canRecognizeWith(curRecognizer))) { // 3\n recognizer.recognize(inputData);\n } else {\n recognizer.reset();\n }\n\n // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the\n // current active recognizer. but only if we don't already have an active recognizer\n if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {\n curRecognizer = session.curRecognizer = recognizer;\n }\n i++;\n }\n },\n\n /**\n * get a recognizer by its event name.\n * @param {Recognizer|String} recognizer\n * @returns {Recognizer|Null}\n */\n get: function(recognizer) {\n if (recognizer instanceof Recognizer) {\n return recognizer;\n }\n\n var recognizers = this.recognizers;\n for (var i = 0; i < recognizers.length; i++) {\n if (recognizers[i].options.event == recognizer) {\n return recognizers[i];\n }\n }\n return null;\n },\n\n /**\n * add a recognizer to the manager\n * existing recognizers with the same event name will be removed\n * @param {Recognizer} recognizer\n * @returns {Recognizer|Manager}\n */\n add: function(recognizer) {\n if (invokeArrayArg(recognizer, 'add', this)) {\n return this;\n }\n\n // remove existing\n var existing = this.get(recognizer.options.event);\n if (existing) {\n this.remove(existing);\n }\n\n this.recognizers.push(recognizer);\n recognizer.manager = this;\n\n this.touchAction.update();\n return recognizer;\n },\n\n /**\n * remove a recognizer by name or instance\n * @param {Recognizer|String} recognizer\n * @returns {Manager}\n */\n remove: function(recognizer) {\n if (invokeArrayArg(recognizer, 'remove', this)) {\n return this;\n }\n\n recognizer = this.get(recognizer);\n\n // let's make sure this recognizer exists\n if (recognizer) {\n var recognizers = this.recognizers;\n var index = inArray(recognizers, recognizer);\n\n if (index !== -1) {\n recognizers.splice(index, 1);\n this.touchAction.update();\n }\n }\n\n return this;\n },\n\n /**\n * bind event\n * @param {String} events\n * @param {Function} handler\n * @returns {EventEmitter} this\n */\n on: function(events, handler) {\n if (events === undefined) {\n return;\n }\n if (handler === undefined) {\n return;\n }\n\n var handlers = this.handlers;\n each(splitStr(events), function(event) {\n handlers[event] = handlers[event] || [];\n handlers[event].push(handler);\n });\n return this;\n },\n\n /**\n * unbind event, leave emit blank to remove all handlers\n * @param {String} events\n * @param {Function} [handler]\n * @returns {EventEmitter} this\n */\n off: function(events, handler) {\n if (events === undefined) {\n return;\n }\n\n var handlers = this.handlers;\n each(splitStr(events), function(event) {\n if (!handler) {\n delete handlers[event];\n } else {\n handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);\n }\n });\n return this;\n },\n\n /**\n * emit event to the listeners\n * @param {String} event\n * @param {Object} data\n */\n emit: function(event, data) {\n // we also want to trigger dom events\n if (this.options.domEvents) {\n triggerDomEvent(event, data);\n }\n\n // no handlers, so skip it all\n var handlers = this.handlers[event] && this.handlers[event].slice();\n if (!handlers || !handlers.length) {\n return;\n }\n\n data.type = event;\n data.preventDefault = function() {\n data.srcEvent.preventDefault();\n };\n\n var i = 0;\n while (i < handlers.length) {\n handlers[i](data);\n i++;\n }\n },\n\n /**\n * destroy the manager and unbinds all events\n * it doesn't unbind dom events, that is the user own responsibility\n */\n destroy: function() {\n this.element && toggleCssProps(this, false);\n\n this.handlers = {};\n this.session = {};\n this.input.destroy();\n this.element = null;\n }\n};\n\n/**\n * add/remove the css properties as defined in manager.options.cssProps\n * @param {Manager} manager\n * @param {Boolean} add\n */\nfunction toggleCssProps(manager, add) {\n var element = manager.element;\n if (!element.style) {\n return;\n }\n var prop;\n each(manager.options.cssProps, function(value, name) {\n prop = prefixed(element.style, name);\n if (add) {\n manager.oldCssProps[prop] = element.style[prop];\n element.style[prop] = value;\n } else {\n element.style[prop] = manager.oldCssProps[prop] || '';\n }\n });\n if (!add) {\n manager.oldCssProps = {};\n }\n}\n\n/**\n * trigger dom event\n * @param {String} event\n * @param {Object} data\n */\nfunction triggerDomEvent(event, data) {\n var gestureEvent = document.createEvent('Event');\n gestureEvent.initEvent(event, true, true);\n gestureEvent.gesture = data;\n data.target.dispatchEvent(gestureEvent);\n}\n\nassign(Hammer, {\n INPUT_START: INPUT_START,\n INPUT_MOVE: INPUT_MOVE,\n INPUT_END: INPUT_END,\n INPUT_CANCEL: INPUT_CANCEL,\n\n STATE_POSSIBLE: STATE_POSSIBLE,\n STATE_BEGAN: STATE_BEGAN,\n STATE_CHANGED: STATE_CHANGED,\n STATE_ENDED: STATE_ENDED,\n STATE_RECOGNIZED: STATE_RECOGNIZED,\n STATE_CANCELLED: STATE_CANCELLED,\n STATE_FAILED: STATE_FAILED,\n\n DIRECTION_NONE: DIRECTION_NONE,\n DIRECTION_LEFT: DIRECTION_LEFT,\n DIRECTION_RIGHT: DIRECTION_RIGHT,\n DIRECTION_UP: DIRECTION_UP,\n DIRECTION_DOWN: DIRECTION_DOWN,\n DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,\n DIRECTION_VERTICAL: DIRECTION_VERTICAL,\n DIRECTION_ALL: DIRECTION_ALL,\n\n Manager: Manager,\n Input: Input,\n TouchAction: TouchAction,\n\n TouchInput: TouchInput,\n MouseInput: MouseInput,\n PointerEventInput: PointerEventInput,\n TouchMouseInput: TouchMouseInput,\n SingleTouchInput: SingleTouchInput,\n\n Recognizer: Recognizer,\n AttrRecognizer: AttrRecognizer,\n Tap: TapRecognizer,\n Pan: PanRecognizer,\n Swipe: SwipeRecognizer,\n Pinch: PinchRecognizer,\n Rotate: RotateRecognizer,\n Press: PressRecognizer,\n\n on: addEventListeners,\n off: removeEventListeners,\n each: each,\n merge: merge,\n extend: extend,\n assign: assign,\n inherit: inherit,\n bindFn: bindFn,\n prefixed: prefixed\n});\n\n// this prevents errors when Hammer is loaded in the presence of an AMD\n// style loader but by script tag, not by the loader.\nvar freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line\nfreeGlobal.Hammer = Hammer;\n\nif (true) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {\n return Hammer;\n }).call(exports, __webpack_require__, exports, module),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n} else {}\n\n})(window, document, 'Hammer');\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/hammerjs/hammer.js?"); + +/***/ }), + +/***/ "./node_modules/ag-grid-community/styles/ag-grid.css": +/*!***********************************************************!*\ + !*** ./node_modules/ag-grid-community/styles/ag-grid.css ***! + \***********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/ag-grid-community/styles/ag-grid.css?"); + +/***/ }), + +/***/ "./node_modules/ag-grid-community/styles/ag-theme-quartz.css": +/*!*******************************************************************!*\ + !*** ./node_modules/ag-grid-community/styles/ag-theme-quartz.css ***! + \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _xenova_transformers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @xenova/transformers */ \"./node_modules/@xenova/transformers/src/transformers.js\");\n/* harmony import */ var ag_grid_community__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ag-grid-community */ \"./node_modules/ag-grid-community/dist/ag-grid-community.auto.esm.js\");\n/* harmony import */ var xlsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! xlsx */ \"./node_modules/xlsx/xlsx.mjs\");\n/* harmony import */ var ag_grid_community_styles_ag_grid_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ag-grid-community/styles/ag-grid.css */ \"./node_modules/ag-grid-community/styles/ag-grid.css\");\n/* harmony import */ var ag_grid_community_styles_ag_theme_quartz_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ag-grid-community/styles/ag-theme-quartz.css */ \"./node_modules/ag-grid-community/styles/ag-theme-quartz.css\");\n\r\n\r\n\r\n\r\n\r\n\r\nconst loadingElement = document.getElementById(\"loading\");\r\nconst submitButton = document.getElementById(\"submit_button\");\r\nconst submit_button_text = document.getElementById(\"submit_button_text\")\r\nconst filterTextBox = document.getElementById('filter-text-box');\r\nconst eGridDiv = document.querySelector('#myGrid');\r\n\r\nlet searchResults;\r\nlet embedder;\r\nlet loadedModelName = null;\r\nlet quantizedFlag = true;\r\nlet thisCollection;\r\nlet lastCollection = \"\";\r\n\r\nconst special_vector = [] // A special vector can be hardcoded here, so that instead of calculating it with the model, this vector is used. Will be displayed bold. \r\n\r\n// Function to update URL with form parameters\r\nfunction updateURL() {\r\n const qdrantURL = document.getElementById('QdrantURL').value;\r\n const qdrantLimit = document.getElementById('QdrantLimit').value;\r\n const hfModel = document.getElementById('HFModel').value;\r\n const quantizedToggle = document.getElementById('quantizedToggle').checked;\r\n\r\n // Select all query containers\r\n const queryContainers = document.querySelectorAll('.queryContainer');\r\n let queries = [];\r\n\r\n queryContainers.forEach((container, index) => {\r\n // Adjusted selectors to match the updated HTML\r\n const inputText = container.querySelector('.inputText').value;\r\n const queryWeight = container.querySelector('.queryWeight').value;\r\n const activeState = container.querySelector(`.activeToggle`).checked;\r\n\r\n // Create an object for each query with its parameters and index\r\n const query = {\r\n index, // Add the index of the query row\r\n inputText,\r\n queryWeight,\r\n activeState\r\n };\r\n\r\n // Add the query object to the queries array\r\n queries.push(query);\r\n });\r\n\r\n // Convert the queries array to a string for the URL parameters\r\n const queriesString = JSON.stringify(queries);\r\n\r\n const params = new URLSearchParams({\r\n qdrantURL,\r\n queries: queriesString, // This now includes the index of each query row\r\n qdrantLimit,\r\n hfModel,\r\n quantizedToggle\r\n });\r\n\r\n window.history.replaceState({}, '', `?${params}`);\r\n}\r\n\r\nfunction setFormInputsFromURL() {\r\n // Parse the current URL\r\n const url = new URL(window.location.href);\r\n const urlParams = url.searchParams;\r\n\r\n // Check if there are any parameters in the URL\r\n if (urlParams.toString() === \"\") {\r\n return; // If no parameters, do nothing\r\n }\r\n\r\n // Update form inputs with URL parameters\r\n const qdrantURLParam = urlParams.get('qdrantURL');\r\n document.getElementById('QdrantURL').value = qdrantURLParam || '';\r\n\r\n const qdrantLimitParam = urlParams.get('qdrantLimit');\r\n document.getElementById('QdrantLimit').value = qdrantLimitParam || '';\r\n\r\n const hfModelParam = urlParams.get('hfModel');\r\n document.getElementById('HFModel').value = hfModelParam || '';\r\n\r\n const quantizedToggleParam = urlParams.get('quantizedToggle');\r\n document.getElementById('quantizedToggle').checked = quantizedToggleParam === 'true';\r\n\r\n // Handle query parameters\r\n const queriesParam = urlParams.get('queries');\r\n if (queriesParam) {\r\n const queries = JSON.parse(queriesParam);\r\n let rowCount = 1; // Reset row count for dynamic rows\r\n\r\n // Directly update the first row if it's part of the queries\r\n if (queries.length > 0 && queries[0].hasOwnProperty('inputText')) {\r\n const firstQuery = queries.shift(); // Remove the first query from the array\r\n\r\n const inputText0 = document.getElementById('inputText0')\r\n inputText0.value = firstQuery.inputText || '';\r\n\r\n if (inputText0.value === \"special_vector\") {\r\n // If the condition is met, apply italic text and grey background\r\n inputText0.style.fontStyle = 'italic';\r\n //event.target.style.backgroundColor = 'grey';\r\n } else {\r\n // If the condition is not met, remove italic text and grey background\r\n inputText0.style.fontStyle = 'normal';\r\n //event.target.style.backgroundColor = '';\r\n }\r\n\r\n document.getElementById('weight0').value = firstQuery.queryWeight || '';\r\n document.getElementById('activeToggle0').checked = firstQuery.activeState;\r\n }\r\n\r\n // Remove existing query rows\r\n //const queryRowsContainer = document.getElementById('queryRowsContainer');\r\n // Assuming you want to clear all existing dynamic rows before adding new ones\r\n //queryRowsContainer.innerHTML = '';\r\n\r\n // Dynamically create query rows based on URL parameters\r\n queries.forEach((query, index) => {\r\n addRow(query, index + 1); // Pass query data and the new row number\r\n });\r\n }\r\n}\r\n\r\n// Function to remove a row\r\nfunction removeRow(rowToRemove) {\r\n rowToRemove.remove();\r\n // Adjust IDs of all remaining rows\r\n let remainingRows = document.querySelectorAll('.queryContainer');\r\n for (let i = 0; i < remainingRows.length; i++) {\r\n remainingRows[i].querySelectorAll('input, button').forEach(function (element) {\r\n const currentId = element.id;\r\n const newId = currentId.replace(/\\d+$/, i + 1); // Adjust the ID to reflect the new row count\r\n element.id = newId;\r\n });\r\n }\r\n}\r\n\r\nfunction addRow(queryData, rowNumber) {\r\n const originalRow = document.getElementById('initialQueryContainer');\r\n const clone = originalRow.cloneNode(true);\r\n clone.id = 'queryContainer' + rowNumber; // Adjust the ID of the cloned row\r\n\r\n // Adjust IDs of all elements within the cloned row\r\n clone.querySelectorAll('input, button').forEach(function (element) {\r\n const currentId = element.id;\r\n const newId = currentId.replace(/\\d+$/, rowNumber); // Replace the last digit(s) with the current rowNumber\r\n element.id = newId;\r\n });\r\n\r\n // Set values from queryData\r\n clone.querySelector('.inputText').value = queryData.inputText || '';\r\n\r\n // Set values from queryData\r\n const inputTextX = clone.querySelector('.inputText')\r\n inputTextX.value = queryData.inputText || '';\r\n\r\n if (inputTextX.value === \"special_vector\") {\r\n // If the condition is met, apply italic text and grey background\r\n inputTextX.style.fontStyle = 'italic';\r\n //event.target.style.backgroundColor = 'grey';\r\n } else {\r\n // If the condition is not met, remove italic text and grey background\r\n inputTextX.style.fontStyle = 'normal';\r\n //event.target.style.backgroundColor = '';\r\n }\r\n\r\n\r\n clone.querySelector('.queryWeight').value = queryData.queryWeight || '';\r\n clone.querySelector('.activeToggle').checked = queryData.activeState;\r\n\r\n const minusButton = clone.querySelector('.queryButton');\r\n // must use SVG here as emoji create problems with npm\r\n minusButton.innerHTML = `\r\n \r\n `\r\n minusButton.title = 'Remove query';\r\n minusButton.addEventListener('click', function () { removeRow(clone); }); // Attach event listener to the minus button\r\n\r\n document.getElementById('queryRowsContainer').appendChild(clone);\r\n}\r\n\r\nasync function loadModel(model, quantized = true) {\r\n if (model !== loadedModelName || quantized !== quantizedFlag) { // Check if model or quantized flag changed\r\n submitButton.setAttribute(\"disabled\", \"\");\r\n loadingElement.style.display = \"\";\r\n submit_button_text.textContent = \"Loading model...\";\r\n\r\n embedder = await (0,_xenova_transformers__WEBPACK_IMPORTED_MODULE_0__.pipeline)(\"feature-extraction\", model, { quantized: quantized });\r\n loadedModelName = model;\r\n quantizedFlag = quantized; // Update quantized flag\r\n console.log(\"Model loaded:\", loadedModelName, \" quantized: \", quantized);\r\n } else {\r\n console.log(\"Model already loaded:\", loadedModelName, \" quantized: \", quantized);\r\n }\r\n}\r\n\r\nsubmitButton.onclick = () => {\r\n const modelName = document.getElementById(\"HFModel\").value;\r\n const quantized = document.getElementById(\"quantizedToggle\").checked;\r\n loadModel(modelName, quantized).then(() => {\r\n sendRequest();\r\n });\r\n};\r\n\r\ndownload_csv.onclick = () => {\r\n exportData(searchResults, \"csv\");\r\n};\r\n\r\ndownload_xlsx.onclick = () => {\r\n exportData(searchResults, \"excel\");\r\n};\r\n\r\ndownload_json.onclick = () => {\r\n exportData(searchResults, \"json\");\r\n};\r\n\r\n////////////////////////////////////////////////////////////////////\r\n\r\nasync function searchPoints(collectionName, vectorData, filter, limit, offset, withPayload, withVector, scoreThreshold) {\r\n var reqBody = JSON.stringify({\r\n vector: vectorData,\r\n filter: filter,\r\n limit: limit,\r\n offset: offset,\r\n with_payload: withPayload,\r\n with_vector: withVector,\r\n score_threshold: scoreThreshold,\r\n });\r\n\r\n const requestOptions = {\r\n method: \"POST\",\r\n headers: { \"Content-Type\": \"application/json\" },\r\n body: reqBody,\r\n };\r\n\r\n thisCollection = document.getElementById(\"QdrantURL\").value\r\n const response = await fetch(`${thisCollection}/points/search`, requestOptions);\r\n const data = await response.json();\r\n\r\n return data;\r\n}\r\n\r\n\r\nfunction getQueryTextsAndWeigths() {\r\n const queryContainers = document.querySelectorAll('.queryContainer');\r\n\r\n const activeQueries = Array.from(queryContainers).filter(container => {\r\n const activeToggle = container.querySelector('.activeToggle');\r\n return activeToggle.checked;\r\n }).map(container => {\r\n const inputText = container.querySelector('.inputText').value.trim();\r\n const weight = container.querySelector('.queryWeight').value;\r\n return { inputText, weight };\r\n });\r\n\r\n const jsonObject = JSON.stringify(activeQueries);\r\n\r\n console.log(jsonObject); // Logs the JSON string of active queries\r\n\r\n return jsonObject\r\n}\r\n\r\nasync function processInputText(inputText) {\r\n\r\n if (inputText == \"special_vector\") {\r\n return special_vector\r\n }\r\n else {\r\n const output = await embedder(inputText, { pooling: 'mean', normalize: true });\r\n const vectorArray = Array.from(output[\"data\"]);\r\n return vectorArray;\r\n }\r\n}\r\n\r\nasync function processQueries() {\r\n const jsonObject = getQueryTextsAndWeigths();\r\n const queries = JSON.parse(jsonObject);\r\n\r\n // Step 1: Calculate the vector for each text\r\n const vectors = await Promise.all(queries.map(async query => {\r\n const { inputText } = query\r\n return await processInputText(inputText)\r\n }));\r\n\r\n // Step 2: Calculate the weighted average vector\r\n const weightedAverageVector = vectors.reduce((acc, vector, index) => {\r\n const weight = queries[index].weight;\r\n return acc.map((val, i) => val + vector[i] * weight);\r\n }, new Array(vectors[0].length).fill(0));\r\n\r\n // Normalize the weighted average vector\r\n const magnitude = Math.sqrt(weightedAverageVector.reduce((sum, val) => sum + val * val, 0));\r\n const normalizedWeightedAverageVector = weightedAverageVector.map(val => val / magnitude);\r\n\r\n console.log(normalizedWeightedAverageVector); // Logs the normalized weighted average vector\r\n return normalizedWeightedAverageVector\r\n}\r\n\r\n// Define global variables for the grid API and options\r\nlet gridApi;\r\nlet gridOptions;\r\n\r\n\r\nasync function sendRequest() {\r\n try {\r\n gridApi.showLoadingOverlay();\r\n }\r\n catch (error) {\r\n }\r\n loadingElement.style.display = \"\";\r\n submit_button_text.textContent = \"Loading results...\";\r\n submitButton.setAttribute(\"disabled\", \"\");\r\n\r\n let inputText = document.getElementsByClassName(\"inputText\")[0].value.trim();\r\n //const trimmedInputTexts = Array.from(document.getElementsByClassName(\"inputText\")).map(input => input.value.trim());\r\n\r\n if (inputText !== \"\") {\r\n //let output = await embedder(inputText, { pooling: 'mean', normalize: true });\r\n const collectionName = \"test_collection\";\r\n const vectorData = await processQueries();//Array.from(output[\"data\"]);\r\n const filter = {};\r\n const limit = parseInt(document.getElementById(\"QdrantLimit\").value);\r\n const offset = 0;\r\n const withPayload = true;\r\n const withVector = false;\r\n const scoreThreshold = null;\r\n\r\n try {\r\n\r\n searchResults = await searchPoints(collectionName, vectorData, filter, limit, offset, withPayload, withVector, scoreThreshold);\r\n //console.log(searchResults);\r\n\r\n // Extract payload keys\r\n const payloadKeys = Object.keys(searchResults.result[0].payload);\r\n\r\n function isHyperlink(value) {\r\n return /^https?:\\/\\//.test(value);\r\n }\r\n\r\n // Custom cell renderer\r\n function customRenderer(params) {\r\n const nestedKey = Object.keys(params.data.payload).find(key => typeof params.data.payload[key] === 'object');\r\n const value = params.data.payload[params.colDef.field.split('.')[1]];\r\n\r\n if (params.colDef.field.endsWith(`.${nestedKey}`)) {\r\n return typeof value === 'object' ? JSON.stringify(value) : value; // Render nested element as string\r\n } else if (isHyperlink(value)) {\r\n return `
${value}`;\r\n } else {\r\n return value;\r\n }\r\n }\r\n\r\n // Update your column definition\r\n const columnDefs = [\r\n { headerName: 'id', field: 'id' },\r\n { headerName: 'score', field: 'score' },\r\n ...payloadKeys.map(key => ({\r\n headerName: key,\r\n field: `payload.${key}`,\r\n maxWidth: 300,\r\n editable: true,\r\n valueGetter: params => params.data.payload[key],\r\n tooltipValueGetter: (params) => params.value,\r\n filter: true,\r\n autoHeight: true,\r\n cellRenderer: customRenderer // Use the custom cell renderer\r\n })),\r\n ];\r\n\r\n\r\n // Check if the grid has already been initialized\r\n if (gridApi && thisCollection === lastCollection) {\r\n // If the grid is already initialized, update the row data\r\n gridApi.setRowData(searchResults.result);\r\n } else {\r\n\r\n try {\r\n //gridOptions.api.destroy()\r\n //document.getElementById(\"myGrid\").innerHTML = \"\";\r\n if (thisCollection !== lastCollection) {\r\n // update column headers if needed\r\n gridApi.updateGridOptions({ columnDefs: columnDefs })\r\n }\r\n gridApi.setRowData(searchResults.result);\r\n loadingElement.style.display = \"none\";\r\n submit_button_text.textContent = \"Submit\";\r\n submitButton.removeAttribute(\"disabled\");\r\n\r\n lastCollection = thisCollection\r\n return\r\n }\r\n catch { }\r\n\r\n // If the grid is not initialized, create the grid\r\n gridOptions = {\r\n autoSizeStrategy: {\r\n type: 'fitCellContents'\r\n },\r\n domLayout: 'autoHeight', // Add this line to enable auto height\r\n columnDefs: columnDefs,\r\n rowData: searchResults.result,\r\n tooltipShowDelay: 0,\r\n overlayLoadingTemplate:\r\n '
',\r\n overlayNoRowsTemplate:\r\n 'This is a custom \\'no rows\\' overlay',\r\n\r\n };\r\n\r\n gridApi = (0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.createGrid)(eGridDiv, gridOptions);\r\n document.getElementById(\"exportDropdown\").removeAttribute(\"disabled\")\r\n document.getElementById(\"quickFilter\").style.display = \"\";\r\n\r\n }\r\n\r\n loadingElement.style.display = \"none\";\r\n submit_button_text.textContent = \"Submit\";\r\n submitButton.removeAttribute(\"disabled\");\r\n\r\n // on first click add the quick filter listener\r\n if (lastCollection == \"\" && !filterTextBox._listenerInitialized) {\r\n function onFilterTextBoxChanged() {\r\n gridApi.setGridOption(\r\n 'quickFilterText',\r\n document.getElementById('filter-text-box').value\r\n );\r\n }\r\n\r\n filterTextBox.addEventListener('input', () => {\r\n onFilterTextBoxChanged();\r\n });\r\n\r\n // Mark listener as initialized\r\n filterTextBox._listenerInitialized = true;\r\n\r\n }\r\n\r\n\r\n lastCollection = thisCollection\r\n\r\n\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n }\r\n}\r\n\r\nasync function exportData(data, format) {\r\n // Function to flatten the payload object within each object\r\n function flattenPayload(jsonData) {\r\n // Check if jsonData is an array\r\n if (!Array.isArray(jsonData)) {\r\n console.error('jsonData is not an array');\r\n return jsonData;\r\n }\r\n\r\n // Check if every element in the array is an object\r\n if (!jsonData.every(item => typeof item === 'object')) {\r\n console.error('One or more elements in jsonData are not objects');\r\n return jsonData;\r\n }\r\n\r\n // Map over the array and flatten the payload object\r\n return jsonData.map(item => {\r\n const { payload, ...rest } = item;\r\n return { ...rest, ...payload };\r\n });\r\n }\r\n\r\n // Flatten the payload object within each object\r\n let jsonData = flattenPayload(data.result);\r\n\r\n // Based on the format parameter, generate the output accordingly\r\n if (format === 'excel') {\r\n // Create a new workbook\r\n const workbook = xlsx__WEBPACK_IMPORTED_MODULE_4__.utils.book_new();\r\n\r\n // Convert JSON to worksheet\r\n const worksheet = xlsx__WEBPACK_IMPORTED_MODULE_4__.utils.json_to_sheet(jsonData);\r\n\r\n // Add the worksheet to the workbook\r\n xlsx__WEBPACK_IMPORTED_MODULE_4__.utils.book_append_sheet(workbook, worksheet, 'Sheet1');\r\n\r\n // Generate a blob from the workbook\r\n const excelBlob = new Blob([xlsx__WEBPACK_IMPORTED_MODULE_4__.write(workbook, { type: 'array', bookType: 'xlsx' })], {\r\n type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\r\n });\r\n\r\n // Create a temporary URL for the blob\r\n const excelUrl = URL.createObjectURL(excelBlob);\r\n\r\n // Create a link element\r\n const link = document.createElement('a');\r\n link.href = excelUrl;\r\n link.download = `${document.getElementById(\"inputText\").value.trim()}.xlsx`;\r\n\r\n // Append the link to the document body and trigger the download\r\n document.body.appendChild(link);\r\n link.click();\r\n\r\n // Clean up\r\n URL.revokeObjectURL(excelUrl);\r\n document.body.removeChild(link);\r\n } else if (format === 'csv') {\r\n // Convert JSON to CSV\r\n const csvContent = jsonData.map(row => {\r\n return Object.values(row).map(value => {\r\n if (typeof value === 'string') {\r\n // Escape double quotes within the value and enclose it in double quotes\r\n return '\"' + value.replace(/\"/g, '\"\"') + '\"';\r\n }\r\n return value;\r\n }).join(',');\r\n }).join('\\n');\r\n\r\n // Create a blob from the CSV content\r\n const csvBlob = new Blob([csvContent], { type: 'text/csv' });\r\n const csvUrl = URL.createObjectURL(csvBlob);\r\n\r\n // Create a link element\r\n const link = document.createElement('a');\r\n link.href = csvUrl;\r\n link.download = `${document.getElementById(\"inputText\").value.trim()}.csv`;\r\n\r\n // Append the link to the document body and trigger the download\r\n document.body.appendChild(link);\r\n link.click();\r\n\r\n // Clean up\r\n URL.revokeObjectURL(csvUrl);\r\n document.body.removeChild(link);\r\n\r\n\r\n } else if (format === 'json') {\r\n // Convert JSON to string\r\n const jsonString = JSON.stringify(jsonData, null, 2);\r\n\r\n // Create a blob from the JSON string\r\n const jsonBlob = new Blob([jsonString], { type: 'application/json' });\r\n\r\n // Create a temporary URL for the blob\r\n const jsonUrl = URL.createObjectURL(jsonBlob);\r\n\r\n // Create a link element\r\n const link = document.createElement('a');\r\n link.href = jsonUrl;\r\n link.download = `${document.getElementById(\"inputText\").value.trim()}.json`;\r\n\r\n // Append the link to the document body and trigger the download\r\n document.body.appendChild(link);\r\n link.click();\r\n\r\n // Clean up\r\n URL.revokeObjectURL(jsonUrl);\r\n document.body.removeChild(link);\r\n } else {\r\n console.error('Unsupported format');\r\n }\r\n}\r\n\r\ndocument.getElementById('copyURLButton').addEventListener('click', function () {\r\n var urlToCopy = window.location.href;\r\n\r\n navigator.clipboard.writeText(urlToCopy)\r\n .then(function () {\r\n console.log('URL copied to clipboard successfully: ' + urlToCopy);\r\n // You can also show a success message here if needed\r\n })\r\n .catch(function (err) {\r\n console.error('Failed to copy URL to clipboard: ', err);\r\n // You can also show an error message here if needed\r\n });\r\n});\r\n\r\ndocument.addEventListener('DOMContentLoaded', function () {\r\n // Initialize a counter for the current row count\r\n let rowCount = 1; // Assuming the initial row is already present\r\n\r\n // Function to clone the row and replace the plus button with a minus button\r\n function TaddRow() {\r\n const originalRow = document.getElementById('initialQueryContainer');\r\n const clone = originalRow.cloneNode(true);\r\n clone.id = 'queryContainer' + rowCount; // Adjust the ID of the cloned row\r\n\r\n // Adjust IDs of all elements within the cloned row\r\n clone.querySelectorAll('input, button').forEach(function (element) {\r\n const currentId = element.id;\r\n const newId = currentId.replace(/\\d+$/, rowCount); // Replace the last digit(s) with the current rowCount\r\n element.id = newId;\r\n });\r\n\r\n const minusButton = clone.querySelector('.queryButton');\r\n minusButton.innerHTML = `\r\n \r\n `\r\n minusButton.title = 'Remove query';\r\n minusButton.addEventListener('click', function () { removeRow(clone); }); // Attach event listener to the minus button\r\n\r\n document.getElementById('queryRowsContainer').appendChild(clone);\r\n rowCount++; // Increment the row count\r\n }\r\n\r\n // Add event listener to the plus button\r\n const plusButton = document.querySelector('.btn-light');\r\n plusButton.addEventListener('click', TaddRow);\r\n});\r\n\r\nvar URLModeHidden = document.getElementById(\"copyURLButton\").hidden;\r\n\r\nif (URLModeHidden) {\r\n\r\n} else {\r\n // Call the function initially to set form inputs from URL parameters\r\n document.addEventListener('DOMContentLoaded', function () {\r\n // Your code here\r\n setFormInputsFromURL();\r\n\r\n // Use event delegation to handle inputs dynamically added\r\n document.body.addEventListener('input', function (event) {\r\n if (event.target.matches('.form-control, .form-check-input')) {\r\n updateURL(event);\r\n }\r\n\r\n if (event.target.matches('.inputText')) {\r\n // Check if the trimmed value of the input is \"special_vector\"\r\n if (event.target.value.trim() === \"special_vector\") {\r\n // If the condition is met, apply italic text and grey background\r\n event.target.style.fontStyle = 'italic';\r\n //event.target.style.backgroundColor = 'grey';\r\n } else {\r\n // If the condition is not met, remove italic text and grey background\r\n event.target.style.fontStyle = 'normal';\r\n //event.target.style.backgroundColor = '';\r\n }\r\n }\r\n });\r\n\r\n document.body.addEventListener('click', function (event) {\r\n if (event.target.matches('.queryButton')) {\r\n updateURL(event);\r\n }\r\n });\r\n\r\n });\r\n}\r\n\n\n//# sourceURL=webpack://qdrant-frontend/./index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/ag-grid-community/styles/ag-theme-quartz.css?"); /***/ }), -/***/ "./node_modules/ag-grid-community/dist/ag-grid-community.auto.esm.js": -/*!***************************************************************************!*\ - !*** ./node_modules/ag-grid-community/dist/ag-grid-community.auto.esm.js ***! - \***************************************************************************/ +/***/ "./node_modules/mjolnir.js/dist/esm/constants.js": +/*!*******************************************************!*\ + !*** ./node_modules/mjolnir.js/dist/esm/constants.js ***! + \*******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AbstractHeaderCellCtrl: () => (/* binding */ AbstractHeaderCellCtrl),\n/* harmony export */ AgAbstractField: () => (/* binding */ AgAbstractField),\n/* harmony export */ AgAbstractLabel: () => (/* binding */ AgAbstractLabel),\n/* harmony export */ AgAutocomplete: () => (/* binding */ AgAutocomplete),\n/* harmony export */ AgCheckbox: () => (/* binding */ AgCheckbox),\n/* harmony export */ AgDialog: () => (/* binding */ AgDialog),\n/* harmony export */ AgGroupComponent: () => (/* binding */ AgGroupComponent),\n/* harmony export */ AgInputDateField: () => (/* binding */ AgInputDateField),\n/* harmony export */ AgInputNumberField: () => (/* binding */ AgInputNumberField),\n/* harmony export */ AgInputRange: () => (/* binding */ AgInputRange),\n/* harmony export */ AgInputTextArea: () => (/* binding */ AgInputTextArea),\n/* harmony export */ AgInputTextField: () => (/* binding */ AgInputTextField),\n/* harmony export */ AgMenuItemComponent: () => (/* binding */ AgMenuItemComponent),\n/* harmony export */ AgMenuItemRenderer: () => (/* binding */ AgMenuItemRenderer),\n/* harmony export */ AgMenuList: () => (/* binding */ AgMenuList),\n/* harmony export */ AgMenuPanel: () => (/* binding */ AgMenuPanel),\n/* harmony export */ AgPanel: () => (/* binding */ AgPanel),\n/* harmony export */ AgPickerField: () => (/* binding */ AgPickerField),\n/* harmony export */ AgPromise: () => (/* binding */ AgPromise),\n/* harmony export */ AgPromiseStatus: () => (/* binding */ AgPromiseStatus),\n/* harmony export */ AgRadioButton: () => (/* binding */ AgRadioButton),\n/* harmony export */ AgRichSelect: () => (/* binding */ AgRichSelect),\n/* harmony export */ AgSelect: () => (/* binding */ AgSelect),\n/* harmony export */ AgSlider: () => (/* binding */ AgSlider),\n/* harmony export */ AgStackComponentsRegistry: () => (/* binding */ AgStackComponentsRegistry),\n/* harmony export */ AgToggleButton: () => (/* binding */ AgToggleButton),\n/* harmony export */ AlignedGridsService: () => (/* binding */ AlignedGridsService),\n/* harmony export */ AllCommunityModules: () => (/* binding */ AllCommunityModules),\n/* harmony export */ AnimateShowChangeCellRenderer: () => (/* binding */ AnimateShowChangeCellRenderer),\n/* harmony export */ AnimateSlideCellRenderer: () => (/* binding */ AnimateSlideCellRenderer),\n/* harmony export */ AnimationFrameService: () => (/* binding */ AnimationFrameService),\n/* harmony export */ AutoScrollService: () => (/* binding */ AutoScrollService),\n/* harmony export */ AutoWidthCalculator: () => (/* binding */ AutoWidthCalculator),\n/* harmony export */ Autowired: () => (/* binding */ Autowired),\n/* harmony export */ BarColumnLabelPlacement: () => (/* binding */ BarColumnLabelPlacement),\n/* harmony export */ BaseComponentWrapper: () => (/* binding */ BaseComponentWrapper),\n/* harmony export */ BaseCreator: () => (/* binding */ BaseCreator),\n/* harmony export */ BaseGridSerializingSession: () => (/* binding */ BaseGridSerializingSession),\n/* harmony export */ Bean: () => (/* binding */ Bean),\n/* harmony export */ BeanStub: () => (/* binding */ BeanStub),\n/* harmony export */ Beans: () => (/* binding */ Beans),\n/* harmony export */ BodyDropPivotTarget: () => (/* binding */ BodyDropPivotTarget),\n/* harmony export */ BodyDropTarget: () => (/* binding */ BodyDropTarget),\n/* harmony export */ CHART_TOOLBAR_ALLOW_LIST: () => (/* binding */ CHART_TOOLBAR_ALLOW_LIST),\n/* harmony export */ CHART_TOOL_PANEL_ALLOW_LIST: () => (/* binding */ CHART_TOOL_PANEL_ALLOW_LIST),\n/* harmony export */ CHART_TOOL_PANEL_MENU_OPTIONS: () => (/* binding */ CHART_TOOL_PANEL_MENU_OPTIONS),\n/* harmony export */ CellComp: () => (/* binding */ CellComp),\n/* harmony export */ CellCtrl: () => (/* binding */ CellCtrl),\n/* harmony export */ CellNavigationService: () => (/* binding */ CellNavigationService),\n/* harmony export */ CellPositionUtils: () => (/* binding */ CellPositionUtils),\n/* harmony export */ CellRangeType: () => (/* binding */ CellRangeType),\n/* harmony export */ ChangedPath: () => (/* binding */ ChangedPath),\n/* harmony export */ CheckboxCellEditor: () => (/* binding */ CheckboxCellEditor),\n/* harmony export */ CheckboxCellRenderer: () => (/* binding */ CheckboxCellRenderer),\n/* harmony export */ CheckboxSelectionComponent: () => (/* binding */ CheckboxSelectionComponent),\n/* harmony export */ ClientSideRowModelModule: () => (/* binding */ ClientSideRowModelModule),\n/* harmony export */ ClientSideRowModelSteps: () => (/* binding */ ClientSideRowModelSteps),\n/* harmony export */ ColDefUtil: () => (/* binding */ ColDefUtil),\n/* harmony export */ Column: () => (/* binding */ Column),\n/* harmony export */ ColumnApi: () => (/* binding */ ColumnApi),\n/* harmony export */ ColumnFactory: () => (/* binding */ ColumnFactory),\n/* harmony export */ ColumnGroup: () => (/* binding */ ColumnGroup),\n/* harmony export */ ColumnKeyCreator: () => (/* binding */ ColumnKeyCreator),\n/* harmony export */ ColumnModel: () => (/* binding */ ColumnModel),\n/* harmony export */ ColumnUtils: () => (/* binding */ ColumnUtils),\n/* harmony export */ Component: () => (/* binding */ Component),\n/* harmony export */ ComponentUtil: () => (/* binding */ ComponentUtil),\n/* harmony export */ Context: () => (/* binding */ Context),\n/* harmony export */ CssClassApplier: () => (/* binding */ CssClassApplier),\n/* harmony export */ CssClassManager: () => (/* binding */ CssClassManager),\n/* harmony export */ CsvCreator: () => (/* binding */ CsvCreator),\n/* harmony export */ CsvExportModule: () => (/* binding */ CsvExportModule),\n/* harmony export */ CtrlsService: () => (/* binding */ CtrlsService),\n/* harmony export */ CustomTooltipFeature: () => (/* binding */ CustomTooltipFeature),\n/* harmony export */ DEFAULT_CHART_GROUPS: () => (/* binding */ DEFAULT_CHART_GROUPS),\n/* harmony export */ DataTypeService: () => (/* binding */ DataTypeService),\n/* harmony export */ DateCellEditor: () => (/* binding */ DateCellEditor),\n/* harmony export */ DateFilter: () => (/* binding */ DateFilter),\n/* harmony export */ DateStringCellEditor: () => (/* binding */ DateStringCellEditor),\n/* harmony export */ DisplayedGroupCreator: () => (/* binding */ DisplayedGroupCreator),\n/* harmony export */ Downloader: () => (/* binding */ Downloader),\n/* harmony export */ DragAndDropService: () => (/* binding */ DragAndDropService),\n/* harmony export */ DragService: () => (/* binding */ DragService),\n/* harmony export */ DragSourceType: () => (/* binding */ DragSourceType),\n/* harmony export */ Environment: () => (/* binding */ Environment),\n/* harmony export */ EventService: () => (/* binding */ EventService),\n/* harmony export */ Events: () => (/* binding */ Events),\n/* harmony export */ ExcelFactoryMode: () => (/* binding */ ExcelFactoryMode),\n/* harmony export */ ExpansionService: () => (/* binding */ ExpansionService),\n/* harmony export */ ExpressionService: () => (/* binding */ ExpressionService),\n/* harmony export */ FilterManager: () => (/* binding */ FilterManager),\n/* harmony export */ FloatingFilterMapper: () => (/* binding */ FloatingFilterMapper),\n/* harmony export */ FocusService: () => (/* binding */ FocusService),\n/* harmony export */ GROUP_AUTO_COLUMN_ID: () => (/* binding */ GROUP_AUTO_COLUMN_ID),\n/* harmony export */ Grid: () => (/* binding */ Grid),\n/* harmony export */ GridApi: () => (/* binding */ GridApi),\n/* harmony export */ GridBodyComp: () => (/* binding */ GridBodyComp),\n/* harmony export */ GridBodyCtrl: () => (/* binding */ GridBodyCtrl),\n/* harmony export */ GridComp: () => (/* binding */ GridComp),\n/* harmony export */ GridCoreCreator: () => (/* binding */ GridCoreCreator),\n/* harmony export */ GridCtrl: () => (/* binding */ GridCtrl),\n/* harmony export */ GridHeaderComp: () => (/* binding */ GridHeaderComp),\n/* harmony export */ GridHeaderCtrl: () => (/* binding */ GridHeaderCtrl),\n/* harmony export */ GridOptionsService: () => (/* binding */ GridOptionsService),\n/* harmony export */ GridSerializer: () => (/* binding */ GridSerializer),\n/* harmony export */ GroupCellRenderer: () => (/* binding */ GroupCellRenderer),\n/* harmony export */ GroupCellRendererCtrl: () => (/* binding */ GroupCellRendererCtrl),\n/* harmony export */ GroupInstanceIdCreator: () => (/* binding */ GroupInstanceIdCreator),\n/* harmony export */ HeaderCellCtrl: () => (/* binding */ HeaderCellCtrl),\n/* harmony export */ HeaderFilterCellComp: () => (/* binding */ HeaderFilterCellComp),\n/* harmony export */ HeaderFilterCellCtrl: () => (/* binding */ HeaderFilterCellCtrl),\n/* harmony export */ HeaderGroupCellCtrl: () => (/* binding */ HeaderGroupCellCtrl),\n/* harmony export */ HeaderNavigationDirection: () => (/* binding */ HeaderNavigationDirection),\n/* harmony export */ HeaderNavigationService: () => (/* binding */ HeaderNavigationService),\n/* harmony export */ HeaderPositionUtils: () => (/* binding */ HeaderPositionUtils),\n/* harmony export */ HeaderRowComp: () => (/* binding */ HeaderRowComp),\n/* harmony export */ HeaderRowContainerComp: () => (/* binding */ HeaderRowContainerComp),\n/* harmony export */ HeaderRowContainerCtrl: () => (/* binding */ HeaderRowContainerCtrl),\n/* harmony export */ HeaderRowCtrl: () => (/* binding */ HeaderRowCtrl),\n/* harmony export */ HeaderRowType: () => (/* binding */ HeaderRowType),\n/* harmony export */ HorizontalDirection: () => (/* binding */ HorizontalDirection),\n/* harmony export */ HorizontalResizeService: () => (/* binding */ HorizontalResizeService),\n/* harmony export */ InfiniteRowModelModule: () => (/* binding */ InfiniteRowModelModule),\n/* harmony export */ KeyCode: () => (/* binding */ KeyCode),\n/* harmony export */ LargeTextCellEditor: () => (/* binding */ LargeTextCellEditor),\n/* harmony export */ LayoutCssClasses: () => (/* binding */ LayoutCssClasses),\n/* harmony export */ LocaleService: () => (/* binding */ LocaleService),\n/* harmony export */ Logger: () => (/* binding */ Logger),\n/* harmony export */ LoggerFactory: () => (/* binding */ LoggerFactory),\n/* harmony export */ ManagedFocusFeature: () => (/* binding */ ManagedFocusFeature),\n/* harmony export */ MenuService: () => (/* binding */ MenuService),\n/* harmony export */ ModuleNames: () => (/* binding */ ModuleNames),\n/* harmony export */ ModuleRegistry: () => (/* binding */ ModuleRegistry),\n/* harmony export */ MouseEventService: () => (/* binding */ MouseEventService),\n/* harmony export */ MoveColumnFeature: () => (/* binding */ MoveColumnFeature),\n/* harmony export */ NavigationService: () => (/* binding */ NavigationService),\n/* harmony export */ NumberCellEditor: () => (/* binding */ NumberCellEditor),\n/* harmony export */ NumberFilter: () => (/* binding */ NumberFilter),\n/* harmony export */ NumberSequence: () => (/* binding */ NumberSequence),\n/* harmony export */ Optional: () => (/* binding */ Optional),\n/* harmony export */ PaginationProxy: () => (/* binding */ PaginationProxy),\n/* harmony export */ PinnedRowModel: () => (/* binding */ PinnedRowModel),\n/* harmony export */ PopupComponent: () => (/* binding */ PopupComponent),\n/* harmony export */ PopupEditorWrapper: () => (/* binding */ PopupEditorWrapper),\n/* harmony export */ PopupService: () => (/* binding */ PopupService),\n/* harmony export */ PositionableFeature: () => (/* binding */ PositionableFeature),\n/* harmony export */ PostConstruct: () => (/* binding */ PostConstruct),\n/* harmony export */ PreConstruct: () => (/* binding */ PreConstruct),\n/* harmony export */ PreDestroy: () => (/* binding */ PreDestroy),\n/* harmony export */ PropertyKeys: () => (/* binding */ PropertyKeys),\n/* harmony export */ ProvidedColumnGroup: () => (/* binding */ ProvidedColumnGroup),\n/* harmony export */ ProvidedFilter: () => (/* binding */ ProvidedFilter),\n/* harmony export */ Qualifier: () => (/* binding */ Qualifier),\n/* harmony export */ QuerySelector: () => (/* binding */ QuerySelector),\n/* harmony export */ RefSelector: () => (/* binding */ RefSelector),\n/* harmony export */ ResizeObserverService: () => (/* binding */ ResizeObserverService),\n/* harmony export */ RowAnimationCssClasses: () => (/* binding */ RowAnimationCssClasses),\n/* harmony export */ RowContainerComp: () => (/* binding */ RowContainerComp),\n/* harmony export */ RowContainerCtrl: () => (/* binding */ RowContainerCtrl),\n/* harmony export */ RowContainerName: () => (/* binding */ RowContainerName),\n/* harmony export */ RowContainerType: () => (/* binding */ RowContainerType),\n/* harmony export */ RowCtrl: () => (/* binding */ RowCtrl),\n/* harmony export */ RowHighlightPosition: () => (/* binding */ RowHighlightPosition),\n/* harmony export */ RowNode: () => (/* binding */ RowNode),\n/* harmony export */ RowNodeBlock: () => (/* binding */ RowNodeBlock),\n/* harmony export */ RowNodeBlockLoader: () => (/* binding */ RowNodeBlockLoader),\n/* harmony export */ RowNodeSorter: () => (/* binding */ RowNodeSorter),\n/* harmony export */ RowPositionUtils: () => (/* binding */ RowPositionUtils),\n/* harmony export */ RowRenderer: () => (/* binding */ RowRenderer),\n/* harmony export */ RowType: () => (/* binding */ RowType),\n/* harmony export */ ScalarFilter: () => (/* binding */ ScalarFilter),\n/* harmony export */ ScrollVisibleService: () => (/* binding */ ScrollVisibleService),\n/* harmony export */ SelectCellEditor: () => (/* binding */ SelectCellEditor),\n/* harmony export */ SelectableService: () => (/* binding */ SelectableService),\n/* harmony export */ SelectionHandleType: () => (/* binding */ SelectionHandleType),\n/* harmony export */ ServerSideTransactionResultStatus: () => (/* binding */ ServerSideTransactionResultStatus),\n/* harmony export */ SetLeftFeature: () => (/* binding */ SetLeftFeature),\n/* harmony export */ SimpleFilter: () => (/* binding */ SimpleFilter),\n/* harmony export */ SortController: () => (/* binding */ SortController),\n/* harmony export */ SortIndicatorComp: () => (/* binding */ SortIndicatorComp),\n/* harmony export */ StandardMenuFactory: () => (/* binding */ StandardMenuFactory),\n/* harmony export */ StylingService: () => (/* binding */ StylingService),\n/* harmony export */ TabGuardClassNames: () => (/* binding */ TabGuardClassNames),\n/* harmony export */ TabGuardComp: () => (/* binding */ TabGuardComp),\n/* harmony export */ TabGuardCtrl: () => (/* binding */ TabGuardCtrl),\n/* harmony export */ TabbedLayout: () => (/* binding */ TabbedLayout),\n/* harmony export */ TemplateService: () => (/* binding */ TemplateService),\n/* harmony export */ TextCellEditor: () => (/* binding */ TextCellEditor),\n/* harmony export */ TextFilter: () => (/* binding */ TextFilter),\n/* harmony export */ TextFloatingFilter: () => (/* binding */ TextFloatingFilter),\n/* harmony export */ Timer: () => (/* binding */ Timer),\n/* harmony export */ TooltipFeature: () => (/* binding */ TooltipFeature),\n/* harmony export */ TouchListener: () => (/* binding */ TouchListener),\n/* harmony export */ UserComponentFactory: () => (/* binding */ UserComponentFactory),\n/* harmony export */ UserComponentRegistry: () => (/* binding */ UserComponentRegistry),\n/* harmony export */ ValueCache: () => (/* binding */ ValueCache),\n/* harmony export */ ValueFormatterService: () => (/* binding */ ValueFormatterService),\n/* harmony export */ ValueParserService: () => (/* binding */ ValueParserService),\n/* harmony export */ ValueService: () => (/* binding */ ValueService),\n/* harmony export */ VanillaFrameworkOverrides: () => (/* binding */ VanillaFrameworkOverrides),\n/* harmony export */ VerticalDirection: () => (/* binding */ VerticalDirection),\n/* harmony export */ VirtualList: () => (/* binding */ VirtualList),\n/* harmony export */ VirtualListDragFeature: () => (/* binding */ VirtualListDragFeature),\n/* harmony export */ XmlFactory: () => (/* binding */ XmlFactory),\n/* harmony export */ ZipContainer: () => (/* binding */ ZipContainer),\n/* harmony export */ _: () => (/* binding */ _),\n/* harmony export */ __FORCE_MODULE_DETECTION: () => (/* binding */ __FORCE_MODULE_DETECTION),\n/* harmony export */ createGrid: () => (/* binding */ createGrid),\n/* harmony export */ getRowContainerTypeForName: () => (/* binding */ getRowContainerTypeForName)\n/* harmony export */ });\n/**\n * @ag-grid-community/all-modules - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.1.1\n * @link https://www.ag-grid.com/\n * @license MIT\n */\n/**\n * If value is undefined, null or blank, returns null, otherwise returns the value\n * @param {T} value\n * @returns {T | null}\n */\nfunction makeNull(value) {\n if (value == null || value === '') {\n return null;\n }\n return value;\n}\nfunction exists(value, allowEmptyString) {\n if (allowEmptyString === void 0) { allowEmptyString = false; }\n return value != null && (value !== '' || allowEmptyString);\n}\nfunction missing(value) {\n return !exists(value);\n}\nfunction missingOrEmpty(value) {\n return value == null || value.length === 0;\n}\nfunction toStringOrNull(value) {\n return value != null && typeof value.toString === 'function' ? value.toString() : null;\n}\n// for parsing html attributes, where we want empty strings and missing attributes to be undefined\nfunction attrToNumber(value) {\n if (value === undefined) {\n // undefined or empty means ignore the value\n return;\n }\n if (value === null || value === '') {\n // null or blank means clear\n return null;\n }\n if (typeof value === 'number') {\n return isNaN(value) ? undefined : value;\n }\n var valueParsed = parseInt(value, 10);\n return isNaN(valueParsed) ? undefined : valueParsed;\n}\n// for parsing html attributes, where we want empty strings and missing attributes to be undefined\nfunction attrToBoolean(value) {\n if (value === undefined) {\n // undefined or empty means ignore the value\n return;\n }\n if (value === null || value === '') {\n // null means clear\n return false;\n }\n if (typeof value === 'boolean') {\n // if simple boolean, return the boolean\n return value;\n }\n // if equal to the string 'true' (ignoring case) then return true\n return (/true/i).test(value);\n}\n// for parsing html attributes, where we want empty strings and missing attributes to be undefined\nfunction attrToString(value) {\n if (value == null || value === '') {\n return;\n }\n return value;\n}\nfunction jsonEquals(val1, val2) {\n var val1Json = val1 ? JSON.stringify(val1) : null;\n var val2Json = val2 ? JSON.stringify(val2) : null;\n return val1Json === val2Json;\n}\nfunction defaultComparator(valueA, valueB, accentedCompare) {\n if (accentedCompare === void 0) { accentedCompare = false; }\n var valueAMissing = valueA == null;\n var valueBMissing = valueB == null;\n // this is for aggregations sum and avg, where the result can be a number that is wrapped.\n // if we didn't do this, then the toString() value would be used, which would result in\n // the strings getting used instead of the numbers.\n if (valueA && valueA.toNumber) {\n valueA = valueA.toNumber();\n }\n if (valueB && valueB.toNumber) {\n valueB = valueB.toNumber();\n }\n if (valueAMissing && valueBMissing) {\n return 0;\n }\n if (valueAMissing) {\n return -1;\n }\n if (valueBMissing) {\n return 1;\n }\n function doQuickCompare(a, b) {\n return (a > b ? 1 : (a < b ? -1 : 0));\n }\n if (typeof valueA !== 'string') {\n return doQuickCompare(valueA, valueB);\n }\n if (!accentedCompare) {\n return doQuickCompare(valueA, valueB);\n }\n try {\n // using local compare also allows chinese comparisons\n return valueA.localeCompare(valueB);\n }\n catch (e) {\n // if something wrong with localeCompare, eg not supported\n // by browser, then just continue with the quick one\n return doQuickCompare(valueA, valueB);\n }\n}\nfunction values(object) {\n if (object instanceof Set || object instanceof Map) {\n var arr_1 = [];\n object.forEach(function (value) { return arr_1.push(value); });\n return arr_1;\n }\n return Object.values(object);\n}\n\nvar GenericUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n makeNull: makeNull,\n exists: exists,\n missing: missing,\n missingOrEmpty: missingOrEmpty,\n toStringOrNull: toStringOrNull,\n attrToNumber: attrToNumber,\n attrToBoolean: attrToBoolean,\n attrToString: attrToString,\n jsonEquals: jsonEquals,\n defaultComparator: defaultComparator,\n values: values\n});\n\n// class returns a unique id to use for the column. it checks the existing columns, and if the requested\nvar ColumnKeyCreator = /** @class */ (function () {\n function ColumnKeyCreator() {\n this.existingKeys = {};\n }\n ColumnKeyCreator.prototype.addExistingKeys = function (keys) {\n for (var i = 0; i < keys.length; i++) {\n this.existingKeys[keys[i]] = true;\n }\n };\n ColumnKeyCreator.prototype.getUniqueKey = function (colId, colField) {\n // in case user passed in number for colId, convert to string\n colId = toStringOrNull(colId);\n var count = 0;\n while (true) {\n var idToTry = void 0;\n if (colId) {\n idToTry = colId;\n if (count !== 0) {\n idToTry += '_' + count;\n }\n }\n else if (colField) {\n idToTry = colField;\n if (count !== 0) {\n idToTry += '_' + count;\n }\n }\n else {\n // no point in stringing this, object treats it the same anyway.\n idToTry = count;\n }\n if (!this.existingKeys[idToTry]) {\n this.existingKeys[idToTry] = true;\n return String(idToTry);\n }\n count++;\n }\n };\n return ColumnKeyCreator;\n}());\n\nvar __values$b = ( false) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$D = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nfunction iterateObject(object, callback) {\n var e_1, _a;\n if (object == null) {\n return;\n }\n if (Array.isArray(object)) {\n for (var i = 0; i < object.length; i++) {\n callback(i.toString(), object[i]);\n }\n return;\n }\n try {\n for (var _b = __values$b(Object.entries(object)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = __read$D(_c.value, 2), key = _d[0], value = _d[1];\n callback(key, value);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n}\nfunction cloneObject(object) {\n var copy = {};\n var keys = Object.keys(object);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = object[key];\n copy[key] = value;\n }\n return copy;\n}\n// returns copy of an object, doing a deep clone of any objects with that object.\n// this is used for eg creating copies of Column Definitions, where we want to\n// deep copy all objects, but do not want to deep copy functions (eg when user provides\n// a function or class for colDef.cellRenderer)\nfunction deepCloneDefinition(object, keysToSkip) {\n if (!object) {\n return;\n }\n var obj = object;\n var res = {};\n Object.keys(obj).forEach(function (key) {\n if (keysToSkip && keysToSkip.indexOf(key) >= 0) {\n return;\n }\n var value = obj[key];\n // 'simple object' means a bunch of key/value pairs, eg {filter: 'myFilter'}. it does\n // NOT include the following:\n // 1) arrays\n // 2) functions or classes (eg ColumnAPI instance)\n var sourceIsSimpleObject = isNonNullObject(value) && value.constructor === Object;\n if (sourceIsSimpleObject) {\n res[key] = deepCloneDefinition(value);\n }\n else {\n res[key] = value;\n }\n });\n return res;\n}\nfunction getAllValuesInObject(obj) {\n if (!obj) {\n return [];\n }\n var anyObject = Object;\n if (typeof anyObject.values === 'function') {\n return anyObject.values(obj);\n }\n var ret = [];\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj.propertyIsEnumerable(key)) {\n ret.push(obj[key]);\n }\n }\n return ret;\n}\nfunction mergeDeep(dest, source, copyUndefined, makeCopyOfSimpleObjects) {\n if (copyUndefined === void 0) { copyUndefined = true; }\n if (makeCopyOfSimpleObjects === void 0) { makeCopyOfSimpleObjects = false; }\n if (!exists(source)) {\n return;\n }\n iterateObject(source, function (key, sourceValue) {\n var destValue = dest[key];\n if (destValue === sourceValue) {\n return;\n }\n // when creating params, we don't want to just copy objects over. otherwise merging ColDefs (eg DefaultColDef\n // and Column Types) would result in params getting shared between objects.\n // by putting an empty value into destValue first, it means we end up copying over values from\n // the source object, rather than just copying in the source object in it's entirety.\n if (makeCopyOfSimpleObjects) {\n var objectIsDueToBeCopied = destValue == null && sourceValue != null;\n if (objectIsDueToBeCopied) {\n // 'simple object' means a bunch of key/value pairs, eg {filter: 'myFilter'}, as opposed\n // to a Class instance (such as ColumnAPI instance).\n var sourceIsSimpleObject = typeof sourceValue === 'object' && sourceValue.constructor === Object;\n var dontCopy = sourceIsSimpleObject;\n if (dontCopy) {\n destValue = {};\n dest[key] = destValue;\n }\n }\n }\n if (isNonNullObject(sourceValue) && isNonNullObject(destValue) && !Array.isArray(destValue)) {\n mergeDeep(destValue, sourceValue, copyUndefined, makeCopyOfSimpleObjects);\n }\n else if (copyUndefined || sourceValue !== undefined) {\n dest[key] = sourceValue;\n }\n });\n}\nfunction getValueUsingField(data, field, fieldContainsDots) {\n if (!field || !data) {\n return;\n }\n // if no '.', then it's not a deep value\n if (!fieldContainsDots) {\n return data[field];\n }\n // otherwise it is a deep value, so need to dig for it\n var fields = field.split('.');\n var currentObject = data;\n for (var i = 0; i < fields.length; i++) {\n if (currentObject == null) {\n return undefined;\n }\n currentObject = currentObject[fields[i]];\n }\n return currentObject;\n}\n// used by GridAPI to remove all references, so keeping grid in memory resulting in a\n// memory leak if user is not disposing of the GridAPI references\nfunction removeAllReferences(obj, preserveKeys, preDestroyLink) {\n if (preserveKeys === void 0) { preserveKeys = []; }\n Object.keys(obj).forEach(function (key) {\n var value = obj[key];\n // we want to replace all the @autowired services, which are objects. any simple types (boolean, string etc)\n // we don't care about\n if (typeof value === 'object' && !preserveKeys.includes(key)) {\n obj[key] = undefined;\n }\n });\n var proto = Object.getPrototypeOf(obj);\n var properties = {};\n var msgFunc = function (key) {\n return \"AG Grid: Grid API function \".concat(key, \"() cannot be called as the grid has been destroyed.\\n It is recommended to remove local references to the grid api. Alternatively, check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.\\n To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: \").concat(preDestroyLink);\n };\n Object.getOwnPropertyNames(proto).forEach(function (key) {\n var value = proto[key];\n // leave all basic types and preserveKeys this is needed for GridAPI to leave the \"destroyed: boolean\" attribute and isDestroyed() function.\n if (typeof value === 'function' && !preserveKeys.includes(key)) {\n var func = function () {\n console.warn(msgFunc(key));\n };\n properties[key] = { value: func, writable: true };\n }\n });\n Object.defineProperties(obj, properties);\n}\nfunction isNonNullObject(value) {\n return typeof value === 'object' && value !== null;\n}\n\nvar ObjectUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n iterateObject: iterateObject,\n cloneObject: cloneObject,\n deepCloneDefinition: deepCloneDefinition,\n getAllValuesInObject: getAllValuesInObject,\n mergeDeep: mergeDeep,\n getValueUsingField: getValueUsingField,\n removeAllReferences: removeAllReferences,\n isNonNullObject: isNonNullObject\n});\n\nvar doOnceFlags = {};\n/**\n * If the key was passed before, then doesn't execute the func\n * @param {Function} func\n * @param {string} key\n */\nfunction doOnce(func, key) {\n if (doOnceFlags[key]) {\n return;\n }\n func();\n doOnceFlags[key] = true;\n}\nfunction warnOnce(msg) {\n doOnce(function () { return console.warn(\"AG Grid: \" + msg); }, msg);\n}\nfunction errorOnce(msg) {\n doOnce(function () { return console.error(\"AG Grid: \" + msg); }, msg);\n}\nfunction getFunctionName(funcConstructor) {\n // for every other browser in the world\n if (funcConstructor.name) {\n return funcConstructor.name;\n }\n // for the pestilence that is ie11\n var matches = /function\\s+([^\\(]+)/.exec(funcConstructor.toString());\n return matches && matches.length === 2 ? matches[1].trim() : null;\n}\nfunction isFunction(val) {\n return !!(val && val.constructor && val.call && val.apply);\n}\nfunction executeInAWhile(funcs) {\n executeAfter(funcs, 400);\n}\nvar executeNextVMTurnFuncs = [];\nvar executeNextVMTurnPending = false;\nfunction executeNextVMTurn(func) {\n executeNextVMTurnFuncs.push(func);\n if (executeNextVMTurnPending) {\n return;\n }\n executeNextVMTurnPending = true;\n window.setTimeout(function () {\n var funcsCopy = executeNextVMTurnFuncs.slice();\n executeNextVMTurnFuncs.length = 0;\n executeNextVMTurnPending = false;\n funcsCopy.forEach(function (func) { return func(); });\n }, 0);\n}\nfunction executeAfter(funcs, milliseconds) {\n if (milliseconds === void 0) { milliseconds = 0; }\n if (funcs.length > 0) {\n window.setTimeout(function () { return funcs.forEach(function (func) { return func(); }); }, milliseconds);\n }\n}\n/**\n * @param {Function} func The function to be debounced\n * @param {number} delay The time in ms to debounce\n * @return {Function} The debounced function\n */\nfunction debounce(func, delay) {\n var timeout;\n // Calling debounce returns a new anonymous function\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var context = this;\n window.clearTimeout(timeout);\n // Set the new timeout\n timeout = window.setTimeout(function () {\n func.apply(context, args);\n }, delay);\n };\n}\n/**\n * @param {Function} func The function to be throttled\n * @param {number} wait The time in ms to throttle\n * @return {Function} The throttled function\n */\nfunction throttle(func, wait) {\n var previousCall = 0;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var context = this;\n var currentCall = new Date().getTime();\n if (currentCall - previousCall < wait) {\n return;\n }\n previousCall = currentCall;\n func.apply(context, args);\n };\n}\nfunction waitUntil(condition, callback, timeout, timeoutMessage) {\n if (timeout === void 0) { timeout = 100; }\n var timeStamp = new Date().getTime();\n var interval = null;\n var executed = false;\n var internalCallback = function () {\n var reachedTimeout = ((new Date().getTime()) - timeStamp) > timeout;\n if (condition() || reachedTimeout) {\n callback();\n executed = true;\n if (interval != null) {\n window.clearInterval(interval);\n interval = null;\n }\n if (reachedTimeout && timeoutMessage) {\n console.warn(timeoutMessage);\n }\n }\n };\n internalCallback();\n if (!executed) {\n interval = window.setInterval(internalCallback, 10);\n }\n}\nfunction compose() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return function (arg) { return fns.reduce(function (composed, f) { return f(composed); }, arg); };\n}\nvar noop = function () { return; };\n\nvar FunctionUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n doOnce: doOnce,\n warnOnce: warnOnce,\n errorOnce: errorOnce,\n getFunctionName: getFunctionName,\n isFunction: isFunction,\n executeInAWhile: executeInAWhile,\n executeNextVMTurn: executeNextVMTurn,\n executeAfter: executeAfter,\n debounce: debounce,\n throttle: throttle,\n waitUntil: waitUntil,\n compose: compose,\n noop: noop\n});\n\nvar ModuleNames;\n(function (ModuleNames) {\n ModuleNames[\"CommunityCoreModule\"] = \"@ag-grid-community/core\";\n // community modules\n ModuleNames[\"InfiniteRowModelModule\"] = \"@ag-grid-community/infinite-row-model\";\n ModuleNames[\"ClientSideRowModelModule\"] = \"@ag-grid-community/client-side-row-model\";\n ModuleNames[\"CsvExportModule\"] = \"@ag-grid-community/csv-export\";\n // enterprise core - users don't need to import on this, but other enterprise modules do\n ModuleNames[\"EnterpriseCoreModule\"] = \"@ag-grid-enterprise/core\";\n // enterprise modules\n ModuleNames[\"RowGroupingModule\"] = \"@ag-grid-enterprise/row-grouping\";\n ModuleNames[\"ColumnsToolPanelModule\"] = \"@ag-grid-enterprise/column-tool-panel\";\n ModuleNames[\"FiltersToolPanelModule\"] = \"@ag-grid-enterprise/filter-tool-panel\";\n ModuleNames[\"MenuModule\"] = \"@ag-grid-enterprise/menu\";\n ModuleNames[\"SetFilterModule\"] = \"@ag-grid-enterprise/set-filter\";\n ModuleNames[\"MultiFilterModule\"] = \"@ag-grid-enterprise/multi-filter\";\n ModuleNames[\"StatusBarModule\"] = \"@ag-grid-enterprise/status-bar\";\n ModuleNames[\"SideBarModule\"] = \"@ag-grid-enterprise/side-bar\";\n ModuleNames[\"RangeSelectionModule\"] = \"@ag-grid-enterprise/range-selection\";\n ModuleNames[\"MasterDetailModule\"] = \"@ag-grid-enterprise/master-detail\";\n ModuleNames[\"RichSelectModule\"] = \"@ag-grid-enterprise/rich-select\";\n ModuleNames[\"GridChartsModule\"] = \"@ag-grid-enterprise/charts\";\n ModuleNames[\"ViewportRowModelModule\"] = \"@ag-grid-enterprise/viewport-row-model\";\n ModuleNames[\"ServerSideRowModelModule\"] = \"@ag-grid-enterprise/server-side-row-model\";\n ModuleNames[\"ExcelExportModule\"] = \"@ag-grid-enterprise/excel-export\";\n ModuleNames[\"ClipboardModule\"] = \"@ag-grid-enterprise/clipboard\";\n ModuleNames[\"SparklinesModule\"] = \"@ag-grid-enterprise/sparklines\";\n ModuleNames[\"AdvancedFilterModule\"] = \"@ag-grid-enterprise/advanced-filter\";\n // framework wrappers currently don't provide beans, comps etc, so no need to be modules,\n // however i argue they should be as in theory they 'could' provide beans etc\n ModuleNames[\"AngularModule\"] = \"@ag-grid-community/angular\";\n ModuleNames[\"ReactModule\"] = \"@ag-grid-community/react\";\n ModuleNames[\"VueModule\"] = \"@ag-grid-community/vue\";\n // and then this, which is definitely not a grid module, as it should not have any dependency\n // on the grid (ie shouldn't even reference the Module interface)\n // ChartsModule = \"@ag-grid-community/charts-core\",\n})(ModuleNames || (ModuleNames = {}));\n\nvar __read$C = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$u = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar ModuleRegistry = /** @class */ (function () {\n function ModuleRegistry() {\n }\n /**\n * Globally register the given module for all grids.\n * @param module - module to register\n */\n ModuleRegistry.register = function (module) {\n ModuleRegistry.__register(module, true, undefined);\n };\n /**\n * Globally register the given modules for all grids.\n * @param modules - modules to register\n */\n ModuleRegistry.registerModules = function (modules) {\n ModuleRegistry.__registerModules(modules, true, undefined);\n };\n /** AG GRID INTERNAL - Module registration helper. */\n ModuleRegistry.__register = function (module, moduleBased, gridId) {\n ModuleRegistry.runVersionChecks(module);\n if (gridId !== undefined) {\n ModuleRegistry.areGridScopedModules = true;\n if (ModuleRegistry.gridModulesMap[gridId] === undefined) {\n ModuleRegistry.gridModulesMap[gridId] = {};\n }\n ModuleRegistry.gridModulesMap[gridId][module.moduleName] = module;\n }\n else {\n ModuleRegistry.globalModulesMap[module.moduleName] = module;\n }\n ModuleRegistry.setModuleBased(moduleBased);\n };\n /** AG GRID INTERNAL - Unregister grid scoped module. */\n ModuleRegistry.__unRegisterGridModules = function (gridId) {\n delete ModuleRegistry.gridModulesMap[gridId];\n };\n /** AG GRID INTERNAL - Module registration helper. */\n ModuleRegistry.__registerModules = function (modules, moduleBased, gridId) {\n ModuleRegistry.setModuleBased(moduleBased);\n if (!modules) {\n return;\n }\n modules.forEach(function (module) { return ModuleRegistry.__register(module, moduleBased, gridId); });\n };\n ModuleRegistry.isValidModuleVersion = function (module) {\n var _a = __read$C(module.version.split('.') || [], 2), moduleMajor = _a[0], moduleMinor = _a[1];\n var _b = __read$C(ModuleRegistry.currentModuleVersion.split('.') || [], 2), currentModuleMajor = _b[0], currentModuleMinor = _b[1];\n return moduleMajor === currentModuleMajor && moduleMinor === currentModuleMinor;\n };\n ModuleRegistry.runVersionChecks = function (module) {\n if (!ModuleRegistry.currentModuleVersion) {\n ModuleRegistry.currentModuleVersion = module.version;\n }\n if (!module.version) {\n console.error(\"AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '\".concat(module.moduleName, \"' is incompatible. Please update all modules to the same version.\"));\n }\n else if (!ModuleRegistry.isValidModuleVersion(module)) {\n console.error(\"AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '\".concat(module.moduleName, \"' is version \").concat(module.version, \" but the other modules are version \").concat(this.currentModuleVersion, \". Please update all modules to the same version.\"));\n }\n if (module.validate) {\n var result = module.validate();\n if (!result.isValid) {\n var errorResult = result;\n console.error(\"AG Grid: \".concat(errorResult.message));\n }\n }\n };\n ModuleRegistry.setModuleBased = function (moduleBased) {\n if (ModuleRegistry.moduleBased === undefined) {\n ModuleRegistry.moduleBased = moduleBased;\n }\n else {\n if (ModuleRegistry.moduleBased !== moduleBased) {\n doOnce(function () {\n console.warn(\"AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms.\");\n console.warn('Please see https://www.ag-grid.com/javascript-grid/packages-modules/ for more information.');\n }, 'ModulePackageCheck');\n }\n }\n };\n /**\n * AG GRID INTERNAL - Set if files are being served from a single UMD bundle to provide accurate enterprise upgrade steps.\n */\n ModuleRegistry.__setIsBundled = function () {\n ModuleRegistry.isBundled = true;\n };\n /** AG GRID INTERNAL - Assert a given module has been register, globally or individually with this grid. */\n ModuleRegistry.__assertRegistered = function (moduleName, reason, gridId) {\n var _a;\n if (this.__isRegistered(moduleName, gridId)) {\n return true;\n }\n var warningKey = reason + moduleName;\n var warningMessage;\n if (ModuleRegistry.isBundled) {\n {\n warningMessage =\n \"AG Grid: unable to use \".concat(reason, \" as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:\\n \\n \\n \\nFor more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise\");\n }\n }\n else if (ModuleRegistry.moduleBased || ModuleRegistry.moduleBased === undefined) {\n var modName = (_a = Object.entries(ModuleNames).find(function (_a) {\n var _b = __read$C(_a, 2); _b[0]; var v = _b[1];\n return v === moduleName;\n })) === null || _a === void 0 ? void 0 : _a[0];\n warningMessage =\n \"AG Grid: unable to use \".concat(reason, \" as the \").concat(modName, \" is not registered\").concat(ModuleRegistry.areGridScopedModules ? \" for gridId: \".concat(gridId) : '', \". Check if you have registered the module:\\n \\n import { ModuleRegistry } from '@ag-grid-community/core';\\n import { \").concat(modName, \" } from '\").concat(moduleName, \"';\\n \\n ModuleRegistry.registerModules([ \").concat(modName, \" ]);\\n\\nFor more info see: https://www.ag-grid.com/javascript-grid/modules/\");\n }\n else {\n warningMessage =\n \"AG Grid: unable to use \".concat(reason, \" as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:\\n \\n import 'ag-grid-enterprise';\\n \\nFor more info see: https://www.ag-grid.com/javascript-grid/packages/\");\n }\n doOnce(function () {\n console.warn(warningMessage);\n }, warningKey);\n return false;\n };\n /**\n * AG GRID INTERNAL - Warn that a given integrated chart type is not supported under the community distribution.\n */\n ModuleRegistry.__warnEnterpriseChartDisabled = function (chartType) {\n var reason = 'ag-charts-enterprise';\n var warningKey = reason + ':' + chartType;\n var url = 'https://ag-grid.com/javascript-data-grid/integrated-charts/';\n var warningMessage = \"AG Grid: the '\".concat(chartType, \"' chart type is not supported in AG Charts Community. See \").concat(url, \" for more details.\");\n doOnce(function () {\n console.warn(warningMessage);\n }, warningKey);\n };\n /** AG GRID INTERNAL - Is the given module registered, globally or individually with this grid. */\n ModuleRegistry.__isRegistered = function (moduleName, gridId) {\n var _a;\n return !!ModuleRegistry.globalModulesMap[moduleName] || !!((_a = ModuleRegistry.gridModulesMap[gridId]) === null || _a === void 0 ? void 0 : _a[moduleName]);\n };\n /** AG GRID INTERNAL - Get all registered modules globally / individually for this grid. */\n ModuleRegistry.__getRegisteredModules = function (gridId) {\n return __spreadArray$u(__spreadArray$u([], __read$C(values(ModuleRegistry.globalModulesMap)), false), __read$C(values(ModuleRegistry.gridModulesMap[gridId] || {})), false);\n };\n /** AG GRID INTERNAL - Get the list of modules registered individually for this grid. */\n ModuleRegistry.__getGridRegisteredModules = function (gridId) {\n var _a;\n return values((_a = ModuleRegistry.gridModulesMap[gridId]) !== null && _a !== void 0 ? _a : {}) || [];\n };\n /** INTERNAL */\n ModuleRegistry.__isPackageBased = function () {\n return !ModuleRegistry.moduleBased;\n };\n // having in a map a) removes duplicates and b) allows fast lookup\n ModuleRegistry.globalModulesMap = {};\n ModuleRegistry.gridModulesMap = {};\n ModuleRegistry.areGridScopedModules = false;\n return ModuleRegistry;\n}());\n\nvar __read$B = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$t = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar Context = /** @class */ (function () {\n function Context(params, logger) {\n this.beanWrappers = {};\n this.destroyed = false;\n if (!params || !params.beanClasses) {\n return;\n }\n this.contextParams = params;\n this.logger = logger;\n this.logger.log(\">> creating ag-Application Context\");\n this.createBeans();\n var beanInstances = this.getBeanInstances();\n this.wireBeans(beanInstances);\n this.logger.log(\">> ag-Application Context ready - component is alive\");\n }\n Context.prototype.getBeanInstances = function () {\n return values(this.beanWrappers).map(function (beanEntry) { return beanEntry.beanInstance; });\n };\n Context.prototype.createBean = function (bean, afterPreCreateCallback) {\n if (!bean) {\n throw Error(\"Can't wire to bean since it is null\");\n }\n this.wireBeans([bean], afterPreCreateCallback);\n return bean;\n };\n Context.prototype.wireBeans = function (beanInstances, afterPreCreateCallback) {\n this.autoWireBeans(beanInstances);\n this.methodWireBeans(beanInstances);\n this.callLifeCycleMethods(beanInstances, 'preConstructMethods');\n // the callback sets the attributes, so the component has access to attributes\n // before postConstruct methods in the component are executed\n if (exists(afterPreCreateCallback)) {\n beanInstances.forEach(afterPreCreateCallback);\n }\n this.callLifeCycleMethods(beanInstances, 'postConstructMethods');\n };\n Context.prototype.createBeans = function () {\n var _this = this;\n // register all normal beans\n this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this));\n // register override beans, these will overwrite beans above of same name\n // instantiate all beans - overridden beans will be left out\n iterateObject(this.beanWrappers, function (key, beanEntry) {\n var constructorParamsMeta;\n if (beanEntry.bean.__agBeanMetaData && beanEntry.bean.__agBeanMetaData.autowireMethods && beanEntry.bean.__agBeanMetaData.autowireMethods.agConstructor) {\n constructorParamsMeta = beanEntry.bean.__agBeanMetaData.autowireMethods.agConstructor;\n }\n var constructorParams = _this.getBeansForParameters(constructorParamsMeta, beanEntry.bean.name);\n var newInstance = new (beanEntry.bean.bind.apply(beanEntry.bean, __spreadArray$t([null], __read$B(constructorParams), false)));\n beanEntry.beanInstance = newInstance;\n });\n var createdBeanNames = Object.keys(this.beanWrappers).join(', ');\n this.logger.log(\"created beans: \".concat(createdBeanNames));\n };\n // tslint:disable-next-line\n Context.prototype.createBeanWrapper = function (BeanClass) {\n var metaData = BeanClass.__agBeanMetaData;\n if (!metaData) {\n var beanName = void 0;\n if (BeanClass.prototype.constructor) {\n beanName = getFunctionName(BeanClass.prototype.constructor);\n }\n else {\n beanName = \"\" + BeanClass;\n }\n console.error(\"Context item \".concat(beanName, \" is not a bean\"));\n return;\n }\n var beanEntry = {\n bean: BeanClass,\n beanInstance: null,\n beanName: metaData.beanName\n };\n this.beanWrappers[metaData.beanName] = beanEntry;\n };\n Context.prototype.autoWireBeans = function (beanInstances) {\n var _this = this;\n beanInstances.forEach(function (beanInstance) {\n _this.forEachMetaDataInHierarchy(beanInstance, function (metaData, beanName) {\n var attributes = metaData.agClassAttributes;\n if (!attributes) {\n return;\n }\n attributes.forEach(function (attribute) {\n var otherBean = _this.lookupBeanInstance(beanName, attribute.beanName, attribute.optional);\n beanInstance[attribute.attributeName] = otherBean;\n });\n });\n });\n };\n Context.prototype.methodWireBeans = function (beanInstances) {\n var _this = this;\n beanInstances.forEach(function (beanInstance) {\n _this.forEachMetaDataInHierarchy(beanInstance, function (metaData, beanName) {\n iterateObject(metaData.autowireMethods, function (methodName, wireParams) {\n // skip constructor, as this is dealt with elsewhere\n if (methodName === \"agConstructor\") {\n return;\n }\n var initParams = _this.getBeansForParameters(wireParams, beanName);\n beanInstance[methodName].apply(beanInstance, initParams);\n });\n });\n });\n };\n Context.prototype.forEachMetaDataInHierarchy = function (beanInstance, callback) {\n var prototype = Object.getPrototypeOf(beanInstance);\n while (prototype != null) {\n var constructor = prototype.constructor;\n if (constructor.hasOwnProperty('__agBeanMetaData')) {\n var metaData = constructor.__agBeanMetaData;\n var beanName = this.getBeanName(constructor);\n callback(metaData, beanName);\n }\n prototype = Object.getPrototypeOf(prototype);\n }\n };\n Context.prototype.getBeanName = function (constructor) {\n if (constructor.__agBeanMetaData && constructor.__agBeanMetaData.beanName) {\n return constructor.__agBeanMetaData.beanName;\n }\n var constructorString = constructor.toString();\n var beanName = constructorString.substring(9, constructorString.indexOf(\"(\"));\n return beanName;\n };\n Context.prototype.getBeansForParameters = function (parameters, beanName) {\n var _this = this;\n var beansList = [];\n if (parameters) {\n iterateObject(parameters, function (paramIndex, otherBeanName) {\n var otherBean = _this.lookupBeanInstance(beanName, otherBeanName);\n beansList[Number(paramIndex)] = otherBean;\n });\n }\n return beansList;\n };\n Context.prototype.lookupBeanInstance = function (wiringBean, beanName, optional) {\n if (optional === void 0) { optional = false; }\n if (this.destroyed) {\n this.logger.log(\"AG Grid: bean reference \".concat(beanName, \" is used after the grid is destroyed!\"));\n return null;\n }\n if (beanName === \"context\") {\n return this;\n }\n if (this.contextParams.providedBeanInstances && this.contextParams.providedBeanInstances.hasOwnProperty(beanName)) {\n return this.contextParams.providedBeanInstances[beanName];\n }\n var beanEntry = this.beanWrappers[beanName];\n if (beanEntry) {\n return beanEntry.beanInstance;\n }\n if (!optional) {\n console.error(\"AG Grid: unable to find bean reference \".concat(beanName, \" while initialising \").concat(wiringBean));\n }\n return null;\n };\n Context.prototype.callLifeCycleMethods = function (beanInstances, lifeCycleMethod) {\n var _this = this;\n beanInstances.forEach(function (beanInstance) { return _this.callLifeCycleMethodsOnBean(beanInstance, lifeCycleMethod); });\n };\n Context.prototype.callLifeCycleMethodsOnBean = function (beanInstance, lifeCycleMethod, methodToIgnore) {\n // putting all methods into a map removes duplicates\n var allMethods = {};\n // dump methods from each level of the metadata hierarchy\n this.forEachMetaDataInHierarchy(beanInstance, function (metaData) {\n var methods = metaData[lifeCycleMethod];\n if (methods) {\n methods.forEach(function (methodName) {\n if (methodName != methodToIgnore) {\n allMethods[methodName] = true;\n }\n });\n }\n });\n var allMethodsList = Object.keys(allMethods);\n allMethodsList.forEach(function (methodName) { return beanInstance[methodName](); });\n };\n Context.prototype.getBean = function (name) {\n return this.lookupBeanInstance(\"getBean\", name, true);\n };\n Context.prototype.destroy = function () {\n if (this.destroyed) {\n return;\n }\n // Set before doing the destroy, so if context.destroy() gets called via another bean\n // we are marked as destroyed already to prevent running destroy() twice\n this.destroyed = true;\n this.logger.log(\">> Shutting down ag-Application Context\");\n var beanInstances = this.getBeanInstances();\n this.destroyBeans(beanInstances);\n this.contextParams.providedBeanInstances = null;\n ModuleRegistry.__unRegisterGridModules(this.contextParams.gridId);\n this.logger.log(\">> ag-Application Context shut down - component is dead\");\n };\n Context.prototype.destroyBean = function (bean) {\n if (!bean) {\n return;\n }\n this.destroyBeans([bean]);\n };\n Context.prototype.destroyBeans = function (beans) {\n var _this = this;\n if (!beans) {\n return [];\n }\n beans.forEach(function (bean) {\n _this.callLifeCycleMethodsOnBean(bean, 'preDestroyMethods', 'destroy');\n // call destroy() explicitly if it exists\n var beanAny = bean;\n if (typeof beanAny.destroy === 'function') {\n beanAny.destroy();\n }\n });\n return [];\n };\n Context.prototype.isDestroyed = function () {\n return this.destroyed;\n };\n Context.prototype.getGridId = function () {\n return this.contextParams.gridId;\n };\n return Context;\n}());\nfunction PreConstruct(target, methodName, descriptor) {\n var props = getOrCreateProps$1(target.constructor);\n if (!props.preConstructMethods) {\n props.preConstructMethods = [];\n }\n props.preConstructMethods.push(methodName);\n}\nfunction PostConstruct(target, methodName, descriptor) {\n var props = getOrCreateProps$1(target.constructor);\n if (!props.postConstructMethods) {\n props.postConstructMethods = [];\n }\n props.postConstructMethods.push(methodName);\n}\nfunction PreDestroy(target, methodName, descriptor) {\n var props = getOrCreateProps$1(target.constructor);\n if (!props.preDestroyMethods) {\n props.preDestroyMethods = [];\n }\n props.preDestroyMethods.push(methodName);\n}\nfunction Bean(beanName) {\n return function (classConstructor) {\n var props = getOrCreateProps$1(classConstructor);\n props.beanName = beanName;\n };\n}\nfunction Autowired(name) {\n return function (target, propertyKey, descriptor) {\n autowiredFunc(target, name, false, target, propertyKey, null);\n };\n}\nfunction Optional(name) {\n return function (target, propertyKey, descriptor) {\n autowiredFunc(target, name, true, target, propertyKey, null);\n };\n}\nfunction autowiredFunc(target, name, optional, classPrototype, methodOrAttributeName, index) {\n if (name === null) {\n console.error(\"AG Grid: Autowired name should not be null\");\n return;\n }\n if (typeof index === \"number\") {\n console.error(\"AG Grid: Autowired should be on an attribute\");\n return;\n }\n // it's an attribute on the class\n var props = getOrCreateProps$1(target.constructor);\n if (!props.agClassAttributes) {\n props.agClassAttributes = [];\n }\n props.agClassAttributes.push({\n attributeName: methodOrAttributeName,\n beanName: name,\n optional: optional\n });\n}\nfunction Qualifier(name) {\n return function (classPrototype, methodOrAttributeName, index) {\n var constructor = typeof classPrototype == \"function\" ? classPrototype : classPrototype.constructor;\n var props;\n if (typeof index === \"number\") {\n // it's a parameter on a method\n var methodName = void 0;\n if (methodOrAttributeName) {\n props = getOrCreateProps$1(constructor);\n methodName = methodOrAttributeName;\n }\n else {\n props = getOrCreateProps$1(constructor);\n methodName = \"agConstructor\";\n }\n if (!props.autowireMethods) {\n props.autowireMethods = {};\n }\n if (!props.autowireMethods[methodName]) {\n props.autowireMethods[methodName] = {};\n }\n props.autowireMethods[methodName][index] = name;\n }\n };\n}\nfunction getOrCreateProps$1(target) {\n if (!target.hasOwnProperty(\"__agBeanMetaData\")) {\n target.__agBeanMetaData = {};\n }\n return target.__agBeanMetaData;\n}\n\nvar __decorate$2O = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param$8 = ( false) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar EventService = /** @class */ (function () {\n function EventService() {\n this.allSyncListeners = new Map();\n this.allAsyncListeners = new Map();\n this.globalSyncListeners = new Set();\n this.globalAsyncListeners = new Set();\n this.asyncFunctionsQueue = [];\n this.scheduled = false;\n // using an object performs better than a Set for the number of different events we have\n this.firedEvents = {};\n }\n // because this class is used both inside the context and outside the context, we do not\n // use autowired attributes, as that would be confusing, as sometimes the attributes\n // would be wired, and sometimes not.\n //\n // the global event servers used by AG Grid is autowired by the context once, and this\n // setBeans method gets called once.\n //\n // the times when this class is used outside of the context (eg RowNode has an instance of this\n // class) then it is not a bean, and this setBeans method is not called.\n EventService.prototype.setBeans = function (gridOptionsService, frameworkOverrides, globalEventListener, globalSyncEventListener) {\n if (globalEventListener === void 0) { globalEventListener = null; }\n if (globalSyncEventListener === void 0) { globalSyncEventListener = null; }\n this.frameworkOverrides = frameworkOverrides;\n this.gridOptionsService = gridOptionsService;\n if (globalEventListener) {\n var async = gridOptionsService.useAsyncEvents();\n this.addGlobalListener(globalEventListener, async);\n }\n if (globalSyncEventListener) {\n this.addGlobalListener(globalSyncEventListener, false);\n }\n };\n EventService.prototype.setFrameworkOverrides = function (frameworkOverrides) {\n this.frameworkOverrides = frameworkOverrides;\n };\n EventService.prototype.getListeners = function (eventType, async, autoCreateListenerCollection) {\n var listenerMap = async ? this.allAsyncListeners : this.allSyncListeners;\n var listeners = listenerMap.get(eventType);\n // Note: 'autoCreateListenerCollection' should only be 'true' if a listener is about to be added. For instance\n // getListeners() is also called during event dispatch even though no listeners are added. This measure protects\n // against 'memory bloat' as empty collections will prevent the RowNode's event service from being removed after\n // the RowComp is destroyed, see noRegisteredListenersExist() below.\n if (!listeners && autoCreateListenerCollection) {\n listeners = new Set();\n listenerMap.set(eventType, listeners);\n }\n return listeners;\n };\n EventService.prototype.noRegisteredListenersExist = function () {\n return this.allSyncListeners.size === 0 && this.allAsyncListeners.size === 0 &&\n this.globalSyncListeners.size === 0 && this.globalAsyncListeners.size === 0;\n };\n EventService.prototype.addEventListener = function (eventType, listener, async) {\n if (async === void 0) { async = false; }\n this.getListeners(eventType, async, true).add(listener);\n };\n EventService.prototype.removeEventListener = function (eventType, listener, async) {\n if (async === void 0) { async = false; }\n var listeners = this.getListeners(eventType, async, false);\n if (!listeners) {\n return;\n }\n listeners.delete(listener);\n if (listeners.size === 0) {\n var listenerMap = async ? this.allAsyncListeners : this.allSyncListeners;\n listenerMap.delete(eventType);\n }\n };\n EventService.prototype.addGlobalListener = function (listener, async) {\n if (async === void 0) { async = false; }\n (async ? this.globalAsyncListeners : this.globalSyncListeners).add(listener);\n };\n EventService.prototype.removeGlobalListener = function (listener, async) {\n if (async === void 0) { async = false; }\n (async ? this.globalAsyncListeners : this.globalSyncListeners).delete(listener);\n };\n EventService.prototype.dispatchEvent = function (event) {\n var agEvent = event;\n if (this.gridOptionsService) {\n // Apply common properties to all dispatched events if this event service has had its beans set with gridOptionsService.\n // Note there are multiple instances of EventService that are used local to components which do not set gridOptionsService.\n this.gridOptionsService.addGridCommonParams(agEvent);\n }\n this.dispatchToListeners(agEvent, true);\n this.dispatchToListeners(agEvent, false);\n this.firedEvents[agEvent.type] = true;\n };\n EventService.prototype.dispatchEventOnce = function (event) {\n if (!this.firedEvents[event.type]) {\n this.dispatchEvent(event);\n }\n };\n EventService.prototype.dispatchToListeners = function (event, async) {\n var _this = this;\n var _a;\n var eventType = event.type;\n if (async && 'event' in event) {\n var browserEvent = event.event;\n if (browserEvent instanceof Event) {\n // AG-7893 - Persist composedPath() so that its result can still be accessed by the user asynchronously.\n // Within an async event handler if they call composedPath() on the event it will always return an empty [].\n event.eventPath = browserEvent.composedPath();\n }\n }\n var processEventListeners = function (listeners, originalListeners) { return listeners.forEach(function (listener) {\n if (!originalListeners.has(listener)) {\n // A listener could have been removed by a previously processed listener. In this case we don't want to call \n return;\n }\n var callback = _this.frameworkOverrides\n ? function () { return _this.frameworkOverrides.wrapIncoming(function () { return listener(event); }); }\n : function () { return listener(event); };\n if (async) {\n _this.dispatchAsync(callback);\n }\n else {\n callback();\n }\n }); };\n var originalListeners = (_a = this.getListeners(eventType, async, false)) !== null && _a !== void 0 ? _a : new Set();\n // create a shallow copy to prevent listeners cyclically adding more listeners to capture this event\n var listeners = new Set(originalListeners);\n if (listeners.size > 0) {\n processEventListeners(listeners, originalListeners);\n }\n var globalListeners = new Set(async ? this.globalAsyncListeners : this.globalSyncListeners);\n globalListeners.forEach(function (listener) {\n var callback = _this.frameworkOverrides\n ? function () { return _this.frameworkOverrides.wrapIncoming(function () { return listener(eventType, event); }); }\n : function () { return listener(eventType, event); };\n if (async) {\n _this.dispatchAsync(callback);\n }\n else {\n callback();\n }\n });\n };\n // this gets called inside the grid's thread, for each event that it\n // wants to set async. the grid then batches the events into one setTimeout()\n // because setTimeout() is an expensive operation. ideally we would have\n // each event in it's own setTimeout(), but we batch for performance.\n EventService.prototype.dispatchAsync = function (func) {\n var _this = this;\n // add to the queue for executing later in the next VM turn\n this.asyncFunctionsQueue.push(func);\n // check if timeout is already scheduled. the first time the grid calls\n // this within it's thread turn, this should be false, so it will schedule\n // the 'flush queue' method the first time it comes here. then the flag is\n // set to 'true' so it will know it's already scheduled for subsequent calls.\n if (!this.scheduled) {\n // if not scheduled, schedule one\n this.frameworkOverrides.wrapIncoming(function () {\n window.setTimeout(_this.flushAsyncQueue.bind(_this), 0);\n });\n // mark that it is scheduled\n this.scheduled = true;\n }\n };\n // this happens in the next VM turn only, and empties the queue of events\n EventService.prototype.flushAsyncQueue = function () {\n this.scheduled = false;\n // we take a copy, because the event listener could be using\n // the grid, which would cause more events, which would be potentially\n // added to the queue, so safe to take a copy, the new events will\n // get executed in a later VM turn rather than risk updating the\n // queue as we are flushing it.\n var queueCopy = this.asyncFunctionsQueue.slice();\n this.asyncFunctionsQueue = [];\n // execute the queue\n queueCopy.forEach(function (func) { return func(); });\n };\n __decorate$2O([\n __param$8(0, Qualifier('gridOptionsService')),\n __param$8(1, Qualifier('frameworkOverrides')),\n __param$8(2, Qualifier('globalEventListener')),\n __param$8(3, Qualifier('globalSyncEventListener'))\n ], EventService.prototype, \"setBeans\", null);\n EventService = __decorate$2O([\n Bean('eventService')\n ], EventService);\n return EventService;\n}());\n\nvar FrameworkEventListenerService = /** @class */ (function () {\n function FrameworkEventListenerService(frameworkOverrides) {\n this.frameworkOverrides = frameworkOverrides;\n // Map from user listener to wrapped listener so we can remove listener provided by user\n this.wrappedListeners = new Map();\n this.wrappedGlobalListeners = new Map();\n }\n FrameworkEventListenerService.prototype.wrap = function (userListener) {\n var _this = this;\n var listener = userListener;\n if (this.frameworkOverrides.shouldWrapOutgoing) {\n listener = function (event) {\n _this.frameworkOverrides.wrapOutgoing(function () { return userListener(event); });\n };\n this.wrappedListeners.set(userListener, listener);\n }\n return listener;\n };\n FrameworkEventListenerService.prototype.wrapGlobal = function (userListener) {\n var _this = this;\n var listener = userListener;\n if (this.frameworkOverrides.shouldWrapOutgoing) {\n listener = function (eventType, event) {\n _this.frameworkOverrides.wrapOutgoing(function () { return userListener(eventType, event); });\n };\n this.wrappedGlobalListeners.set(userListener, listener);\n }\n return listener;\n };\n FrameworkEventListenerService.prototype.unwrap = function (userListener) {\n var _a;\n return (_a = this.wrappedListeners.get(userListener)) !== null && _a !== void 0 ? _a : userListener;\n };\n FrameworkEventListenerService.prototype.unwrapGlobal = function (userListener) {\n var _a;\n return (_a = this.wrappedGlobalListeners.get(userListener)) !== null && _a !== void 0 ? _a : userListener;\n };\n return FrameworkEventListenerService;\n}());\n\nvar __decorate$2N = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar COL_DEF_DEFAULTS = {\n resizable: true,\n sortable: true\n};\nvar instanceIdSequence$4 = 0;\nfunction getNextColInstanceId() {\n return instanceIdSequence$4++;\n}\n// Wrapper around a user provide column definition. The grid treats the column definition as ready only.\n// This class contains all the runtime information about a column, plus some logic (the definition has no logic).\n// This class implements both interfaces ColumnGroupChild and ProvidedColumnGroupChild as the class can\n// appear as a child of either the original tree or the displayed tree. However the relevant group classes\n// for each type only implements one, as each group can only appear in it's associated tree (eg ProvidedColumnGroup\n// can only appear in OriginalColumn tree).\nvar Column = /** @class */ (function () {\n function Column(colDef, userProvidedColDef, colId, primary) {\n // used by React (and possibly other frameworks) as key for rendering. also used to\n // identify old vs new columns for destroying cols when no longer used.\n this.instanceId = getNextColInstanceId();\n // The measured height of this column's header when autoHeaderHeight is enabled\n this.autoHeaderHeight = null;\n this.moving = false;\n this.menuVisible = false;\n this.lastLeftPinned = false;\n this.firstRightPinned = false;\n this.filterActive = false;\n this.eventService = new EventService();\n this.tooltipEnabled = false;\n this.rowGroupActive = false;\n this.pivotActive = false;\n this.aggregationActive = false;\n this.colDef = colDef;\n this.userProvidedColDef = userProvidedColDef;\n this.colId = colId;\n this.primary = primary;\n this.setState(colDef);\n }\n Column.prototype.getInstanceId = function () {\n return this.instanceId;\n };\n Column.prototype.setState = function (colDef) {\n // sort\n if (colDef.sort !== undefined) {\n if (colDef.sort === 'asc' || colDef.sort === 'desc') {\n this.sort = colDef.sort;\n }\n }\n else {\n if (colDef.initialSort === 'asc' || colDef.initialSort === 'desc') {\n this.sort = colDef.initialSort;\n }\n }\n // sortIndex\n var sortIndex = colDef.sortIndex;\n var initialSortIndex = colDef.initialSortIndex;\n if (sortIndex !== undefined) {\n if (sortIndex !== null) {\n this.sortIndex = sortIndex;\n }\n }\n else {\n if (initialSortIndex !== null) {\n this.sortIndex = initialSortIndex;\n }\n }\n // hide\n var hide = colDef.hide;\n var initialHide = colDef.initialHide;\n if (hide !== undefined) {\n this.visible = !hide;\n }\n else {\n this.visible = !initialHide;\n }\n // pinned\n if (colDef.pinned !== undefined) {\n this.setPinned(colDef.pinned);\n }\n else {\n this.setPinned(colDef.initialPinned);\n }\n // flex\n var flex = colDef.flex;\n var initialFlex = colDef.initialFlex;\n if (flex !== undefined) {\n this.flex = flex;\n }\n else if (initialFlex !== undefined) {\n this.flex = initialFlex;\n }\n };\n // gets called when user provides an alternative colDef, eg\n Column.prototype.setColDef = function (colDef, userProvidedColDef, source) {\n this.colDef = colDef;\n this.userProvidedColDef = userProvidedColDef;\n this.initMinAndMaxWidths();\n this.initDotNotation();\n this.initTooltip();\n this.eventService.dispatchEvent(this.createColumnEvent('colDefChanged', source));\n };\n /**\n * Returns the column definition provided by the application.\n * This may not be correct, as items can be superseded by default column options.\n * However it's useful for comparison, eg to know which application column definition matches that column.\n */\n Column.prototype.getUserProvidedColDef = function () {\n return this.userProvidedColDef;\n };\n Column.prototype.setParent = function (parent) {\n this.parent = parent;\n };\n /** Returns the parent column group, if column grouping is active. */\n Column.prototype.getParent = function () {\n return this.parent;\n };\n Column.prototype.setOriginalParent = function (originalParent) {\n this.originalParent = originalParent;\n };\n /**\n * Used for marryChildren, helps with comparing when duplicate groups have been created to manage split groups.\n *\n * Parent may contain a duplicate but not identical group when the group is split.\n */\n Column.prototype.getOriginalParent = function () {\n return this.originalParent;\n };\n // this is done after constructor as it uses gridOptionsService\n Column.prototype.initialise = function () {\n this.initMinAndMaxWidths();\n this.resetActualWidth('gridInitializing');\n this.initDotNotation();\n this.initTooltip();\n };\n Column.prototype.initDotNotation = function () {\n var suppressDotNotation = this.gridOptionsService.get('suppressFieldDotNotation');\n this.fieldContainsDots = exists(this.colDef.field) && this.colDef.field.indexOf('.') >= 0 && !suppressDotNotation;\n this.tooltipFieldContainsDots = exists(this.colDef.tooltipField) && this.colDef.tooltipField.indexOf('.') >= 0 && !suppressDotNotation;\n };\n Column.prototype.initMinAndMaxWidths = function () {\n var colDef = this.colDef;\n this.minWidth = this.columnUtils.calculateColMinWidth(colDef);\n this.maxWidth = this.columnUtils.calculateColMaxWidth(colDef);\n };\n Column.prototype.initTooltip = function () {\n this.tooltipEnabled = exists(this.colDef.tooltipField) ||\n exists(this.colDef.tooltipValueGetter) ||\n exists(this.colDef.tooltipComponent);\n };\n Column.prototype.resetActualWidth = function (source) {\n var initialWidth = this.columnUtils.calculateColInitialWidth(this.colDef);\n this.setActualWidth(initialWidth, source, true);\n };\n Column.prototype.isEmptyGroup = function () {\n return false;\n };\n Column.prototype.isRowGroupDisplayed = function (colId) {\n if (missing(this.colDef) || missing(this.colDef.showRowGroup)) {\n return false;\n }\n var showingAllGroups = this.colDef.showRowGroup === true;\n var showingThisGroup = this.colDef.showRowGroup === colId;\n return showingAllGroups || showingThisGroup;\n };\n /** Returns `true` if column is a primary column, `false` if secondary. Secondary columns are used for pivoting. */\n Column.prototype.isPrimary = function () {\n return this.primary;\n };\n /** Returns `true` if column filtering is allowed. */\n Column.prototype.isFilterAllowed = function () {\n // filter defined means it's a string, class or true.\n // if its false, null or undefined then it's false.\n var filterDefined = !!this.colDef.filter;\n return filterDefined;\n };\n Column.prototype.isFieldContainsDots = function () {\n return this.fieldContainsDots;\n };\n Column.prototype.isTooltipEnabled = function () {\n return this.tooltipEnabled;\n };\n Column.prototype.isTooltipFieldContainsDots = function () {\n return this.tooltipFieldContainsDots;\n };\n /** Add an event listener to the column. */\n Column.prototype.addEventListener = function (eventType, userListener) {\n var _a, _b;\n if (this.frameworkOverrides.shouldWrapOutgoing && !this.frameworkEventListenerService) {\n // Only construct if we need it, as it's an overhead for column construction\n this.eventService.setFrameworkOverrides(this.frameworkOverrides);\n this.frameworkEventListenerService = new FrameworkEventListenerService(this.frameworkOverrides);\n }\n var listener = (_b = (_a = this.frameworkEventListenerService) === null || _a === void 0 ? void 0 : _a.wrap(userListener)) !== null && _b !== void 0 ? _b : userListener;\n this.eventService.addEventListener(eventType, listener);\n };\n /** Remove event listener from the column. */\n Column.prototype.removeEventListener = function (eventType, userListener) {\n var _a, _b;\n var listener = (_b = (_a = this.frameworkEventListenerService) === null || _a === void 0 ? void 0 : _a.unwrap(userListener)) !== null && _b !== void 0 ? _b : userListener;\n this.eventService.removeEventListener(eventType, listener);\n };\n Column.prototype.createColumnFunctionCallbackParams = function (rowNode) {\n return this.gridOptionsService.addGridCommonParams({\n node: rowNode,\n data: rowNode.data,\n column: this,\n colDef: this.colDef\n });\n };\n Column.prototype.isSuppressNavigable = function (rowNode) {\n // if boolean set, then just use it\n if (typeof this.colDef.suppressNavigable === 'boolean') {\n return this.colDef.suppressNavigable;\n }\n // if function, then call the function to find out\n if (typeof this.colDef.suppressNavigable === 'function') {\n var params = this.createColumnFunctionCallbackParams(rowNode);\n var userFunc = this.colDef.suppressNavigable;\n return userFunc(params);\n }\n return false;\n };\n /**\n * Returns `true` if the cell for this column is editable for the given `rowNode`, otherwise `false`.\n */\n Column.prototype.isCellEditable = function (rowNode) {\n // only allow editing of groups if the user has this option enabled\n if (rowNode.group && !this.gridOptionsService.get('enableGroupEdit')) {\n return false;\n }\n return this.isColumnFunc(rowNode, this.colDef.editable);\n };\n Column.prototype.isSuppressFillHandle = function () {\n return !!this.colDef.suppressFillHandle;\n };\n Column.prototype.isAutoHeight = function () {\n return !!this.colDef.autoHeight;\n };\n Column.prototype.isAutoHeaderHeight = function () {\n return !!this.colDef.autoHeaderHeight;\n };\n Column.prototype.isRowDrag = function (rowNode) {\n return this.isColumnFunc(rowNode, this.colDef.rowDrag);\n };\n Column.prototype.isDndSource = function (rowNode) {\n return this.isColumnFunc(rowNode, this.colDef.dndSource);\n };\n Column.prototype.isCellCheckboxSelection = function (rowNode) {\n return this.isColumnFunc(rowNode, this.colDef.checkboxSelection);\n };\n Column.prototype.isSuppressPaste = function (rowNode) {\n return this.isColumnFunc(rowNode, this.colDef ? this.colDef.suppressPaste : null);\n };\n Column.prototype.isResizable = function () {\n return !!this.getColDefValue('resizable');\n };\n /** Get value from ColDef or default if it exists. */\n Column.prototype.getColDefValue = function (key) {\n var _a;\n return (_a = this.colDef[key]) !== null && _a !== void 0 ? _a : COL_DEF_DEFAULTS[key];\n };\n Column.prototype.isColumnFunc = function (rowNode, value) {\n // if boolean set, then just use it\n if (typeof value === 'boolean') {\n return value;\n }\n // if function, then call the function to find out\n if (typeof value === 'function') {\n var params = this.createColumnFunctionCallbackParams(rowNode);\n var editableFunc = value;\n return editableFunc(params);\n }\n return false;\n };\n Column.prototype.setMoving = function (moving, source) {\n this.moving = moving;\n this.eventService.dispatchEvent(this.createColumnEvent('movingChanged', source));\n };\n Column.prototype.createColumnEvent = function (type, source) {\n return this.gridOptionsService.addGridCommonParams({\n type: type,\n column: this,\n columns: [this],\n source: source\n });\n };\n Column.prototype.isMoving = function () {\n return this.moving;\n };\n /** If sorting is active, returns the sort direction e.g. `'asc'` or `'desc'`. */\n Column.prototype.getSort = function () {\n return this.sort;\n };\n Column.prototype.setSort = function (sort, source) {\n if (this.sort !== sort) {\n this.sort = sort;\n this.eventService.dispatchEvent(this.createColumnEvent('sortChanged', source));\n }\n this.dispatchStateUpdatedEvent('sort');\n };\n Column.prototype.setMenuVisible = function (visible, source) {\n if (this.menuVisible !== visible) {\n this.menuVisible = visible;\n this.eventService.dispatchEvent(this.createColumnEvent('menuVisibleChanged', source));\n }\n };\n Column.prototype.isMenuVisible = function () {\n return this.menuVisible;\n };\n Column.prototype.isSortable = function () {\n return !!this.getColDefValue('sortable');\n };\n Column.prototype.isSortAscending = function () {\n return this.sort === 'asc';\n };\n Column.prototype.isSortDescending = function () {\n return this.sort === 'desc';\n };\n Column.prototype.isSortNone = function () {\n return missing(this.sort);\n };\n Column.prototype.isSorting = function () {\n return exists(this.sort);\n };\n Column.prototype.getSortIndex = function () {\n return this.sortIndex;\n };\n Column.prototype.setSortIndex = function (sortOrder) {\n this.sortIndex = sortOrder;\n this.dispatchStateUpdatedEvent('sortIndex');\n };\n Column.prototype.setAggFunc = function (aggFunc) {\n this.aggFunc = aggFunc;\n this.dispatchStateUpdatedEvent('aggFunc');\n };\n /** If aggregation is set for the column, returns the aggregation function. */\n Column.prototype.getAggFunc = function () {\n return this.aggFunc;\n };\n Column.prototype.getLeft = function () {\n return this.left;\n };\n Column.prototype.getOldLeft = function () {\n return this.oldLeft;\n };\n Column.prototype.getRight = function () {\n return this.left + this.actualWidth;\n };\n Column.prototype.setLeft = function (left, source) {\n this.oldLeft = this.left;\n if (this.left !== left) {\n this.left = left;\n this.eventService.dispatchEvent(this.createColumnEvent('leftChanged', source));\n }\n };\n /** Returns `true` if filter is active on the column. */\n Column.prototype.isFilterActive = function () {\n return this.filterActive;\n };\n // additionalEventAttributes is used by provided simple floating filter, so it can add 'floatingFilter=true' to the event\n Column.prototype.setFilterActive = function (active, source, additionalEventAttributes) {\n if (this.filterActive !== active) {\n this.filterActive = active;\n this.eventService.dispatchEvent(this.createColumnEvent('filterActiveChanged', source));\n }\n var filterChangedEvent = this.createColumnEvent('filterChanged', source);\n if (additionalEventAttributes) {\n mergeDeep(filterChangedEvent, additionalEventAttributes);\n }\n this.eventService.dispatchEvent(filterChangedEvent);\n };\n /** Returns `true` when this `Column` is hovered, otherwise `false` */\n Column.prototype.isHovered = function () {\n return this.columnHoverService.isHovered(this);\n };\n Column.prototype.setPinned = function (pinned) {\n if (pinned === true || pinned === 'left') {\n this.pinned = 'left';\n }\n else if (pinned === 'right') {\n this.pinned = 'right';\n }\n else {\n this.pinned = null;\n }\n this.dispatchStateUpdatedEvent('pinned');\n };\n Column.prototype.setFirstRightPinned = function (firstRightPinned, source) {\n if (this.firstRightPinned !== firstRightPinned) {\n this.firstRightPinned = firstRightPinned;\n this.eventService.dispatchEvent(this.createColumnEvent('firstRightPinnedChanged', source));\n }\n };\n Column.prototype.setLastLeftPinned = function (lastLeftPinned, source) {\n if (this.lastLeftPinned !== lastLeftPinned) {\n this.lastLeftPinned = lastLeftPinned;\n this.eventService.dispatchEvent(this.createColumnEvent('lastLeftPinnedChanged', source));\n }\n };\n Column.prototype.isFirstRightPinned = function () {\n return this.firstRightPinned;\n };\n Column.prototype.isLastLeftPinned = function () {\n return this.lastLeftPinned;\n };\n Column.prototype.isPinned = function () {\n return this.pinned === 'left' || this.pinned === 'right';\n };\n Column.prototype.isPinnedLeft = function () {\n return this.pinned === 'left';\n };\n Column.prototype.isPinnedRight = function () {\n return this.pinned === 'right';\n };\n Column.prototype.getPinned = function () {\n return this.pinned;\n };\n Column.prototype.setVisible = function (visible, source) {\n var newValue = visible === true;\n if (this.visible !== newValue) {\n this.visible = newValue;\n this.eventService.dispatchEvent(this.createColumnEvent('visibleChanged', source));\n }\n this.dispatchStateUpdatedEvent('hide');\n };\n Column.prototype.isVisible = function () {\n return this.visible;\n };\n Column.prototype.isSpanHeaderHeight = function () {\n var colDef = this.getColDef();\n return !colDef.suppressSpanHeaderHeight && !colDef.autoHeaderHeight;\n };\n Column.prototype.getColumnGroupPaddingInfo = function () {\n var parent = this.getParent();\n if (!parent || !parent.isPadding()) {\n return { numberOfParents: 0, isSpanningTotal: false };\n }\n var numberOfParents = parent.getPaddingLevel() + 1;\n var isSpanningTotal = true;\n while (parent) {\n if (!parent.isPadding()) {\n isSpanningTotal = false;\n break;\n }\n parent = parent.getParent();\n }\n return { numberOfParents: numberOfParents, isSpanningTotal: isSpanningTotal };\n };\n /** Returns the column definition for this column.\n * The column definition will be the result of merging the application provided column definition with any provided defaults\n * (e.g. `defaultColDef` grid option, or column types.\n *\n * Equivalent: `getDefinition` */\n Column.prototype.getColDef = function () {\n return this.colDef;\n };\n Column.prototype.getColumnGroupShow = function () {\n return this.colDef.columnGroupShow;\n };\n /**\n * Returns the unique ID for the column.\n *\n * Equivalent: `getId`, `getUniqueId` */\n Column.prototype.getColId = function () {\n return this.colId;\n };\n /**\n * Returns the unique ID for the column.\n *\n * Equivalent: `getColId`, `getUniqueId` */\n Column.prototype.getId = function () {\n return this.colId;\n };\n /**\n * Returns the unique ID for the column.\n *\n * Equivalent: `getColId`, `getId` */\n Column.prototype.getUniqueId = function () {\n return this.colId;\n };\n Column.prototype.getDefinition = function () {\n return this.colDef;\n };\n /** Returns the current width of the column. If the column is resized, the actual width is the new size. */\n Column.prototype.getActualWidth = function () {\n return this.actualWidth;\n };\n Column.prototype.getAutoHeaderHeight = function () {\n return this.autoHeaderHeight;\n };\n /** Returns true if the header height has changed */\n Column.prototype.setAutoHeaderHeight = function (height) {\n var changed = height !== this.autoHeaderHeight;\n this.autoHeaderHeight = height;\n return changed;\n };\n Column.prototype.createBaseColDefParams = function (rowNode) {\n var params = this.gridOptionsService.addGridCommonParams({\n node: rowNode,\n data: rowNode.data,\n colDef: this.colDef,\n column: this\n });\n return params;\n };\n Column.prototype.getColSpan = function (rowNode) {\n if (missing(this.colDef.colSpan)) {\n return 1;\n }\n var params = this.createBaseColDefParams(rowNode);\n var colSpan = this.colDef.colSpan(params);\n // colSpan must be number equal to or greater than 1\n return Math.max(colSpan, 1);\n };\n Column.prototype.getRowSpan = function (rowNode) {\n if (missing(this.colDef.rowSpan)) {\n return 1;\n }\n var params = this.createBaseColDefParams(rowNode);\n var rowSpan = this.colDef.rowSpan(params);\n // rowSpan must be number equal to or greater than 1\n return Math.max(rowSpan, 1);\n };\n Column.prototype.setActualWidth = function (actualWidth, source, silent) {\n if (silent === void 0) { silent = false; }\n if (this.minWidth != null) {\n actualWidth = Math.max(actualWidth, this.minWidth);\n }\n if (this.maxWidth != null) {\n actualWidth = Math.min(actualWidth, this.maxWidth);\n }\n if (this.actualWidth !== actualWidth) {\n // disable flex for this column if it was manually resized.\n this.actualWidth = actualWidth;\n if (this.flex && source !== 'flex' && source !== 'gridInitializing') {\n this.flex = null;\n }\n if (!silent) {\n this.fireColumnWidthChangedEvent(source);\n }\n }\n this.dispatchStateUpdatedEvent('width');\n };\n Column.prototype.fireColumnWidthChangedEvent = function (source) {\n this.eventService.dispatchEvent(this.createColumnEvent('widthChanged', source));\n };\n Column.prototype.isGreaterThanMax = function (width) {\n if (this.maxWidth != null) {\n return width > this.maxWidth;\n }\n return false;\n };\n Column.prototype.getMinWidth = function () {\n return this.minWidth;\n };\n Column.prototype.getMaxWidth = function () {\n return this.maxWidth;\n };\n Column.prototype.getFlex = function () {\n return this.flex || 0;\n };\n // this method should only be used by the columnModel to\n // change flex when required by the applyColumnState method.\n Column.prototype.setFlex = function (flex) {\n if (this.flex !== flex) {\n this.flex = flex;\n }\n this.dispatchStateUpdatedEvent('flex');\n };\n Column.prototype.setMinimum = function (source) {\n if (exists(this.minWidth)) {\n this.setActualWidth(this.minWidth, source);\n }\n };\n Column.prototype.setRowGroupActive = function (rowGroup, source) {\n if (this.rowGroupActive !== rowGroup) {\n this.rowGroupActive = rowGroup;\n this.eventService.dispatchEvent(this.createColumnEvent('columnRowGroupChanged', source));\n }\n this.dispatchStateUpdatedEvent('rowGroup');\n };\n /** Returns `true` if row group is currently active for this column. */\n Column.prototype.isRowGroupActive = function () {\n return this.rowGroupActive;\n };\n Column.prototype.setPivotActive = function (pivot, source) {\n if (this.pivotActive !== pivot) {\n this.pivotActive = pivot;\n this.eventService.dispatchEvent(this.createColumnEvent('columnPivotChanged', source));\n }\n this.dispatchStateUpdatedEvent('pivot');\n };\n /** Returns `true` if pivot is currently active for this column. */\n Column.prototype.isPivotActive = function () {\n return this.pivotActive;\n };\n Column.prototype.isAnyFunctionActive = function () {\n return this.isPivotActive() || this.isRowGroupActive() || this.isValueActive();\n };\n Column.prototype.isAnyFunctionAllowed = function () {\n return this.isAllowPivot() || this.isAllowRowGroup() || this.isAllowValue();\n };\n Column.prototype.setValueActive = function (value, source) {\n if (this.aggregationActive !== value) {\n this.aggregationActive = value;\n this.eventService.dispatchEvent(this.createColumnEvent('columnValueChanged', source));\n }\n };\n /** Returns `true` if value (aggregation) is currently active for this column. */\n Column.prototype.isValueActive = function () {\n return this.aggregationActive;\n };\n Column.prototype.isAllowPivot = function () {\n return this.colDef.enablePivot === true;\n };\n Column.prototype.isAllowValue = function () {\n return this.colDef.enableValue === true;\n };\n Column.prototype.isAllowRowGroup = function () {\n return this.colDef.enableRowGroup === true;\n };\n /**\n * @deprecated v31.1 Use `getColDef().menuTabs ?? defaultValues` instead.\n */\n Column.prototype.getMenuTabs = function (defaultValues) {\n warnOnce(\"As of v31.1, 'getMenuTabs' is deprecated. Use 'getColDef().menuTabs ?? defaultValues' instead.\");\n var menuTabs = this.getColDef().menuTabs;\n if (menuTabs == null) {\n menuTabs = defaultValues;\n }\n return menuTabs;\n };\n Column.prototype.dispatchStateUpdatedEvent = function (key) {\n this.eventService.dispatchEvent({\n type: Column.EVENT_STATE_UPDATED,\n key: key\n });\n };\n // + renderedHeaderCell - for making header cell transparent when moving\n Column.EVENT_MOVING_CHANGED = 'movingChanged';\n // + renderedCell - changing left position\n Column.EVENT_LEFT_CHANGED = 'leftChanged';\n // + renderedCell - changing width\n Column.EVENT_WIDTH_CHANGED = 'widthChanged';\n // + renderedCell - for changing pinned classes\n Column.EVENT_LAST_LEFT_PINNED_CHANGED = 'lastLeftPinnedChanged';\n Column.EVENT_FIRST_RIGHT_PINNED_CHANGED = 'firstRightPinnedChanged';\n // + renderedColumn - for changing visibility icon\n Column.EVENT_VISIBLE_CHANGED = 'visibleChanged';\n // + every time the filter changes, used in the floating filters\n Column.EVENT_FILTER_CHANGED = 'filterChanged';\n // + renderedHeaderCell - marks the header with filter icon\n Column.EVENT_FILTER_ACTIVE_CHANGED = 'filterActiveChanged';\n // + renderedHeaderCell - marks the header with sort icon\n Column.EVENT_SORT_CHANGED = 'sortChanged';\n // + renderedHeaderCell - marks the header with sort icon\n Column.EVENT_COL_DEF_CHANGED = 'colDefChanged';\n Column.EVENT_MENU_VISIBLE_CHANGED = 'menuVisibleChanged';\n // + toolpanel, for gui updates\n Column.EVENT_ROW_GROUP_CHANGED = 'columnRowGroupChanged';\n // + toolpanel, for gui updates\n Column.EVENT_PIVOT_CHANGED = 'columnPivotChanged';\n // + toolpanel, for gui updates\n Column.EVENT_VALUE_CHANGED = 'columnValueChanged';\n // + dataTypeService - when waiting to infer cell data types\n Column.EVENT_STATE_UPDATED = 'columnStateUpdated';\n __decorate$2N([\n Autowired('gridOptionsService')\n ], Column.prototype, \"gridOptionsService\", void 0);\n __decorate$2N([\n Autowired('columnUtils')\n ], Column.prototype, \"columnUtils\", void 0);\n __decorate$2N([\n Autowired('columnHoverService')\n ], Column.prototype, \"columnHoverService\", void 0);\n __decorate$2N([\n Autowired('frameworkOverrides')\n ], Column.prototype, \"frameworkOverrides\", void 0);\n __decorate$2N([\n PostConstruct\n ], Column.prototype, \"initialise\", null);\n return Column;\n}());\n\nvar __decorate$2M = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ProvidedColumnGroup = /** @class */ (function () {\n function ProvidedColumnGroup(colGroupDef, groupId, padding, level) {\n this.localEventService = new EventService();\n this.expandable = false;\n // used by React (and possibly other frameworks) as key for rendering. also used to\n // identify old vs new columns for destroying cols when no longer used.\n this.instanceId = getNextColInstanceId();\n this.expandableListenerRemoveCallback = null;\n this.colGroupDef = colGroupDef;\n this.groupId = groupId;\n this.expanded = !!colGroupDef && !!colGroupDef.openByDefault;\n this.padding = padding;\n this.level = level;\n }\n ProvidedColumnGroup.prototype.destroy = function () {\n if (this.expandableListenerRemoveCallback) {\n this.reset(null, undefined);\n }\n };\n ProvidedColumnGroup.prototype.reset = function (colGroupDef, level) {\n this.colGroupDef = colGroupDef;\n this.level = level;\n this.originalParent = null;\n if (this.expandableListenerRemoveCallback) {\n this.expandableListenerRemoveCallback();\n }\n // we use ! below, as we want to set the object back to the\n // way it was when it was first created\n this.children = undefined;\n this.expandable = undefined;\n };\n ProvidedColumnGroup.prototype.getInstanceId = function () {\n return this.instanceId;\n };\n ProvidedColumnGroup.prototype.setOriginalParent = function (originalParent) {\n this.originalParent = originalParent;\n };\n ProvidedColumnGroup.prototype.getOriginalParent = function () {\n return this.originalParent;\n };\n ProvidedColumnGroup.prototype.getLevel = function () {\n return this.level;\n };\n ProvidedColumnGroup.prototype.isVisible = function () {\n // return true if at least one child is visible\n if (this.children) {\n return this.children.some(function (child) { return child.isVisible(); });\n }\n return false;\n };\n ProvidedColumnGroup.prototype.isPadding = function () {\n return this.padding;\n };\n ProvidedColumnGroup.prototype.setExpanded = function (expanded) {\n this.expanded = expanded === undefined ? false : expanded;\n var event = {\n type: ProvidedColumnGroup.EVENT_EXPANDED_CHANGED\n };\n this.localEventService.dispatchEvent(event);\n };\n ProvidedColumnGroup.prototype.isExpandable = function () {\n return this.expandable;\n };\n ProvidedColumnGroup.prototype.isExpanded = function () {\n return this.expanded;\n };\n ProvidedColumnGroup.prototype.getGroupId = function () {\n return this.groupId;\n };\n ProvidedColumnGroup.prototype.getId = function () {\n return this.getGroupId();\n };\n ProvidedColumnGroup.prototype.setChildren = function (children) {\n this.children = children;\n };\n ProvidedColumnGroup.prototype.getChildren = function () {\n return this.children;\n };\n ProvidedColumnGroup.prototype.getColGroupDef = function () {\n return this.colGroupDef;\n };\n ProvidedColumnGroup.prototype.getLeafColumns = function () {\n var result = [];\n this.addLeafColumns(result);\n return result;\n };\n ProvidedColumnGroup.prototype.addLeafColumns = function (leafColumns) {\n if (!this.children) {\n return;\n }\n this.children.forEach(function (child) {\n if (child instanceof Column) {\n leafColumns.push(child);\n }\n else if (child instanceof ProvidedColumnGroup) {\n child.addLeafColumns(leafColumns);\n }\n });\n };\n ProvidedColumnGroup.prototype.getColumnGroupShow = function () {\n var colGroupDef = this.colGroupDef;\n if (!colGroupDef) {\n return;\n }\n return colGroupDef.columnGroupShow;\n };\n // need to check that this group has at least one col showing when both expanded and contracted.\n // if not, then we don't allow expanding and contracting on this group\n ProvidedColumnGroup.prototype.setupExpandable = function () {\n var _this = this;\n this.setExpandable();\n if (this.expandableListenerRemoveCallback) {\n this.expandableListenerRemoveCallback();\n }\n var listener = this.onColumnVisibilityChanged.bind(this);\n this.getLeafColumns().forEach(function (col) { return col.addEventListener('visibleChanged', listener); });\n this.expandableListenerRemoveCallback = function () {\n _this.getLeafColumns().forEach(function (col) { return col.removeEventListener('visibleChanged', listener); });\n _this.expandableListenerRemoveCallback = null;\n };\n };\n ProvidedColumnGroup.prototype.setExpandable = function () {\n if (this.isPadding()) {\n return;\n }\n // want to make sure the group doesn't disappear when it's open\n var atLeastOneShowingWhenOpen = false;\n // want to make sure the group doesn't disappear when it's closed\n var atLeastOneShowingWhenClosed = false;\n // want to make sure the group has something to show / hide\n var atLeastOneChangeable = false;\n var children = this.findChildrenRemovingPadding();\n for (var i = 0, j = children.length; i < j; i++) {\n var abstractColumn = children[i];\n if (!abstractColumn.isVisible()) {\n continue;\n }\n // if the abstractColumn is a grid generated group, there will be no colDef\n var headerGroupShow = abstractColumn.getColumnGroupShow();\n if (headerGroupShow === 'open') {\n atLeastOneShowingWhenOpen = true;\n atLeastOneChangeable = true;\n }\n else if (headerGroupShow === 'closed') {\n atLeastOneShowingWhenClosed = true;\n atLeastOneChangeable = true;\n }\n else {\n atLeastOneShowingWhenOpen = true;\n atLeastOneShowingWhenClosed = true;\n }\n }\n var expandable = atLeastOneShowingWhenOpen && atLeastOneShowingWhenClosed && atLeastOneChangeable;\n if (this.expandable !== expandable) {\n this.expandable = expandable;\n var event_1 = {\n type: ProvidedColumnGroup.EVENT_EXPANDABLE_CHANGED\n };\n this.localEventService.dispatchEvent(event_1);\n }\n };\n ProvidedColumnGroup.prototype.findChildrenRemovingPadding = function () {\n var res = [];\n var process = function (items) {\n items.forEach(function (item) {\n // if padding, we add this children instead of the padding\n var skipBecausePadding = item instanceof ProvidedColumnGroup && item.isPadding();\n if (skipBecausePadding) {\n process(item.children);\n }\n else {\n res.push(item);\n }\n });\n };\n process(this.children);\n return res;\n };\n ProvidedColumnGroup.prototype.onColumnVisibilityChanged = function () {\n this.setExpandable();\n };\n ProvidedColumnGroup.prototype.addEventListener = function (eventType, listener) {\n this.localEventService.addEventListener(eventType, listener);\n };\n ProvidedColumnGroup.prototype.removeEventListener = function (eventType, listener) {\n this.localEventService.removeEventListener(eventType, listener);\n };\n ProvidedColumnGroup.EVENT_EXPANDED_CHANGED = 'expandedChanged';\n ProvidedColumnGroup.EVENT_EXPANDABLE_CHANGED = 'expandableChanged';\n __decorate$2M([\n PreDestroy\n ], ProvidedColumnGroup.prototype, \"destroy\", null);\n return ProvidedColumnGroup;\n}());\n\nvar DefaultColumnTypes = {\n numericColumn: {\n headerClass: 'ag-right-aligned-header',\n cellClass: 'ag-right-aligned-cell'\n },\n rightAligned: {\n headerClass: 'ag-right-aligned-header',\n cellClass: 'ag-right-aligned-cell'\n }\n};\n\nfunction existsAndNotEmpty(value) {\n return value != null && value.length > 0;\n}\nfunction last(arr) {\n if (!arr || !arr.length) {\n return;\n }\n return arr[arr.length - 1];\n}\nfunction areEqual(a, b, comparator) {\n if (a == null && b == null) {\n return true;\n }\n return a != null &&\n b != null &&\n a.length === b.length &&\n a.every(function (value, index) { return comparator ? comparator(value, b[index]) : b[index] === value; });\n}\nfunction shallowCompare(arr1, arr2) {\n return areEqual(arr1, arr2);\n}\nfunction sortNumerically(array) {\n return array.sort(function (a, b) { return a - b; });\n}\nfunction removeRepeatsFromArray(array, object) {\n if (!array) {\n return;\n }\n for (var index = array.length - 2; index >= 0; index--) {\n var thisOneMatches = array[index] === object;\n var nextOneMatches = array[index + 1] === object;\n if (thisOneMatches && nextOneMatches) {\n array.splice(index + 1, 1);\n }\n }\n}\nfunction removeFromUnorderedArray(array, object) {\n var index = array.indexOf(object);\n if (index >= 0) {\n // preserve the last element, then shorten array length by 1 to delete index\n array[index] = array[array.length - 1];\n array.pop();\n }\n}\nfunction removeFromArray(array, object) {\n var index = array.indexOf(object);\n if (index >= 0) {\n array.splice(index, 1);\n }\n}\nfunction removeAllFromUnorderedArray(array, toRemove) {\n for (var i = 0; i < toRemove.length; i++) {\n removeFromUnorderedArray(array, toRemove[i]);\n }\n}\nfunction removeAllFromArray(array, toRemove) {\n for (var i = 0; i < toRemove.length; i++) {\n removeFromArray(array, toRemove[i]);\n }\n}\nfunction insertIntoArray(array, object, toIndex) {\n array.splice(toIndex, 0, object);\n}\nfunction insertArrayIntoArray(dest, src, toIndex) {\n if (dest == null || src == null) {\n return;\n }\n // put items in backwards, otherwise inserted items end up in reverse order\n for (var i = src.length - 1; i >= 0; i--) {\n var item = src[i];\n insertIntoArray(dest, item, toIndex);\n }\n}\nfunction moveInArray(array, objectsToMove, toIndex) {\n // first take out items from the array\n removeAllFromArray(array, objectsToMove);\n // now add the objects, in same order as provided to us, that means we start at the end\n // as the objects will be pushed to the right as they are inserted\n objectsToMove.slice().reverse().forEach(function (obj) { return insertIntoArray(array, obj, toIndex); });\n}\nfunction includes(array, value) {\n return array.indexOf(value) > -1;\n}\nfunction flatten(arrayOfArrays) {\n return [].concat.apply([], arrayOfArrays);\n}\nfunction pushAll(target, source) {\n if (source == null || target == null) {\n return;\n }\n source.forEach(function (value) { return target.push(value); });\n}\nfunction toStrings(array) {\n return array.map(toStringOrNull);\n}\nfunction forEachReverse(list, action) {\n if (list == null) {\n return;\n }\n for (var i = list.length - 1; i >= 0; i--) {\n action(list[i], i);\n }\n}\n\nvar ArrayUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n existsAndNotEmpty: existsAndNotEmpty,\n last: last,\n areEqual: areEqual,\n shallowCompare: shallowCompare,\n sortNumerically: sortNumerically,\n removeRepeatsFromArray: removeRepeatsFromArray,\n removeFromUnorderedArray: removeFromUnorderedArray,\n removeFromArray: removeFromArray,\n removeAllFromUnorderedArray: removeAllFromUnorderedArray,\n removeAllFromArray: removeAllFromArray,\n insertIntoArray: insertIntoArray,\n insertArrayIntoArray: insertArrayIntoArray,\n moveInArray: moveInArray,\n includes: includes,\n flatten: flatten,\n pushAll: pushAll,\n toStrings: toStrings,\n forEachReverse: forEachReverse\n});\n\nvar AG_GRID_STOP_PROPAGATION = '__ag_Grid_Stop_Propagation';\nvar PASSIVE_EVENTS$1 = ['touchstart', 'touchend', 'touchmove', 'touchcancel', 'scroll'];\nvar supports = {};\n/**\n * a user once raised an issue - they said that when you opened a popup (eg context menu)\n * and then clicked on a selection checkbox, the popup wasn't closed. this is because the\n * popup listens for clicks on the body, however ag-grid WAS stopping propagation on the\n * checkbox clicks (so the rows didn't pick them up as row selection selection clicks).\n * to get around this, we have a pattern to stop propagation for the purposes of AG Grid,\n * but we still let the event pass back to the body.\n * @param {Event} event\n */\nfunction stopPropagationForAgGrid(event) {\n event[AG_GRID_STOP_PROPAGATION] = true;\n}\nfunction isStopPropagationForAgGrid(event) {\n return event[AG_GRID_STOP_PROPAGATION] === true;\n}\nvar isEventSupported = (function () {\n var tags = {\n select: 'input',\n change: 'input',\n submit: 'form',\n reset: 'form',\n error: 'img',\n load: 'img',\n abort: 'img'\n };\n var eventChecker = function (eventName) {\n if (typeof supports[eventName] === 'boolean') {\n return supports[eventName];\n }\n var el = document.createElement(tags[eventName] || 'div');\n eventName = 'on' + eventName;\n return supports[eventName] = (eventName in el);\n };\n return eventChecker;\n})();\nfunction getCtrlForEventTarget(gridOptionsService, eventTarget, type) {\n var sourceElement = eventTarget;\n while (sourceElement) {\n var renderedComp = gridOptionsService.getDomData(sourceElement, type);\n if (renderedComp) {\n return renderedComp;\n }\n sourceElement = sourceElement.parentElement;\n }\n return null;\n}\nfunction isElementInEventPath(element, event) {\n if (!event || !element) {\n return false;\n }\n return getEventPath(event).indexOf(element) >= 0;\n}\nfunction createEventPath(event) {\n var res = [];\n var pointer = event.target;\n while (pointer) {\n res.push(pointer);\n pointer = pointer.parentElement;\n }\n return res;\n}\n/**\n * Gets the path for a browser Event or from the target on an AG Grid Event\n * https://developer.mozilla.org/en-US/docs/Web/API/Event\n * @param {Event| { target: EventTarget }} event\n * @returns {EventTarget[]}\n */\nfunction getEventPath(event) {\n // This can be called with either a browser event or an AG Grid Event that has a target property.\n var eventNoType = event;\n if (eventNoType.path) {\n return eventNoType.path;\n }\n if (eventNoType.composedPath) {\n return eventNoType.composedPath();\n }\n // If this is an AG Grid event build the path ourselves\n return createEventPath(eventNoType);\n}\nfunction addSafePassiveEventListener(frameworkOverrides, eElement, event, listener) {\n var isPassive = includes(PASSIVE_EVENTS$1, event);\n var options = isPassive ? { passive: true } : undefined;\n // this check is here for certain scenarios where I believe the user must be destroying\n // the grid somehow but continuing for it to be used\n if (frameworkOverrides && frameworkOverrides.addEventListener) {\n frameworkOverrides.addEventListener(eElement, event, listener, options);\n }\n}\n\nvar EventUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n stopPropagationForAgGrid: stopPropagationForAgGrid,\n isStopPropagationForAgGrid: isStopPropagationForAgGrid,\n isEventSupported: isEventSupported,\n getCtrlForEventTarget: getCtrlForEventTarget,\n isElementInEventPath: isElementInEventPath,\n createEventPath: createEventPath,\n getEventPath: getEventPath,\n addSafePassiveEventListener: addSafePassiveEventListener\n});\n\nvar __decorate$2L = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar BeanStub = /** @class */ (function () {\n function BeanStub() {\n var _this = this;\n this.destroyFunctions = [];\n this.destroyed = false;\n // for vue 3 - prevents Vue from trying to make this (and obviously any sub classes) from being reactive\n // prevents vue from creating proxies for created objects and prevents identity related issues\n this.__v_skip = true;\n // this was a test constructor niall built, when active, it prints after 5 seconds all beans/components that are\n // not destroyed. to use, create a new grid, then api.destroy() before 5 seconds. then anything that gets printed\n // points to a bean or component that was not properly disposed of.\n // constructor() {\n // setTimeout(()=> {\n // if (this.isAlive()) {\n // let prototype: any = Object.getPrototypeOf(this);\n // const constructor: any = prototype.constructor;\n // const constructorString = constructor.toString();\n // const beanName = constructorString.substring(9, constructorString.indexOf(\"(\"));\n // console.log('is alive ' + beanName);\n // }\n // }, 5000);\n // }\n // Enable multiple grid properties to be updated together by the user but only trigger shared logic once.\n // Closely related to logic in ComponentUtil.ts\n this.lastChangeSetIdLookup = {};\n this.propertyListenerId = 0;\n this.isAlive = function () { return !_this.destroyed; };\n }\n // CellComp and GridComp and override this because they get the FrameworkOverrides from the Beans bean\n BeanStub.prototype.getFrameworkOverrides = function () {\n return this.frameworkOverrides;\n };\n BeanStub.prototype.getContext = function () {\n return this.context;\n };\n BeanStub.prototype.destroy = function () {\n // let prototype: any = Object.getPrototypeOf(this);\n // const constructor: any = prototype.constructor;\n // const constructorString = constructor.toString();\n // const beanName = constructorString.substring(9, constructorString.indexOf(\"(\"));\n this.destroyFunctions.forEach(function (func) { return func(); });\n this.destroyFunctions.length = 0;\n this.destroyed = true;\n this.dispatchEvent({ type: BeanStub.EVENT_DESTROYED });\n };\n BeanStub.prototype.addEventListener = function (eventType, listener) {\n if (!this.localEventService) {\n this.localEventService = new EventService();\n }\n this.localEventService.addEventListener(eventType, listener);\n };\n BeanStub.prototype.removeEventListener = function (eventType, listener) {\n if (this.localEventService) {\n this.localEventService.removeEventListener(eventType, listener);\n }\n };\n BeanStub.prototype.dispatchEvent = function (event) {\n if (this.localEventService) {\n this.localEventService.dispatchEvent(event);\n }\n };\n BeanStub.prototype.addManagedListener = function (object, event, listener) {\n var _this = this;\n if (this.destroyed) {\n return;\n }\n if (object instanceof HTMLElement) {\n addSafePassiveEventListener(this.getFrameworkOverrides(), object, event, listener);\n }\n else {\n object.addEventListener(event, listener);\n }\n var destroyFunc = function () {\n object.removeEventListener(event, listener);\n _this.destroyFunctions = _this.destroyFunctions.filter(function (fn) { return fn !== destroyFunc; });\n return null;\n };\n this.destroyFunctions.push(destroyFunc);\n return destroyFunc;\n };\n BeanStub.prototype.setupGridOptionListener = function (event, listener) {\n var _this = this;\n this.gridOptionsService.addEventListener(event, listener);\n var destroyFunc = function () {\n _this.gridOptionsService.removeEventListener(event, listener);\n _this.destroyFunctions = _this.destroyFunctions.filter(function (fn) { return fn !== destroyFunc; });\n return null;\n };\n this.destroyFunctions.push(destroyFunc);\n return destroyFunc;\n };\n /**\n * Setup a managed property listener for the given GridOption property.\n * @param event GridOption property to listen to changes for.\n * @param listener Listener to run when property value changes\n */\n BeanStub.prototype.addManagedPropertyListener = function (event, listener) {\n if (this.destroyed) {\n return function () { return null; };\n }\n return this.setupGridOptionListener(event, listener);\n };\n /**\n * Setup managed property listeners for the given set of GridOption properties.\n * The listener will be run if any of the property changes but will only run once if\n * multiple of the properties change within the same framework lifecycle event.\n * Works on the basis that GridOptionsService updates all properties *before* any property change events are fired.\n * @param events Array of GridOption properties to listen for changes too.\n * @param listener Shared listener to run if any of the properties change\n */\n BeanStub.prototype.addManagedPropertyListeners = function (events, listener) {\n var _this = this;\n if (this.destroyed) {\n return;\n }\n // Ensure each set of events can run for the same changeSetId\n var eventsKey = events.join('-') + this.propertyListenerId++;\n var wrappedListener = function (event) {\n if (event.changeSet) {\n // ChangeSet is only set when the property change is part of a group of changes from ComponentUtils\n // Direct api calls should always be run as \n if (event.changeSet && event.changeSet.id === _this.lastChangeSetIdLookup[eventsKey]) {\n // Already run the listener for this set of prop changes so don't run again\n return;\n }\n _this.lastChangeSetIdLookup[eventsKey] = event.changeSet.id;\n }\n // Don't expose the underlying event value changes to the group listener.\n var propertiesChangeEvent = {\n type: 'gridPropertyChanged',\n changeSet: event.changeSet,\n source: event.source\n };\n listener(propertiesChangeEvent);\n };\n events.forEach(function (event) { return _this.setupGridOptionListener(event, wrappedListener); });\n };\n BeanStub.prototype.addDestroyFunc = function (func) {\n // if we are already destroyed, we execute the func now\n if (this.isAlive()) {\n this.destroyFunctions.push(func);\n }\n else {\n func();\n }\n };\n BeanStub.prototype.createManagedBean = function (bean, context) {\n var res = this.createBean(bean, context);\n this.addDestroyFunc(this.destroyBean.bind(this, bean, context));\n return res;\n };\n BeanStub.prototype.createBean = function (bean, context, afterPreCreateCallback) {\n return (context || this.getContext()).createBean(bean, afterPreCreateCallback);\n };\n BeanStub.prototype.destroyBean = function (bean, context) {\n return (context || this.getContext()).destroyBean(bean);\n };\n BeanStub.prototype.destroyBeans = function (beans, context) {\n var _this = this;\n if (beans) {\n beans.forEach(function (bean) { return _this.destroyBean(bean, context); });\n }\n return [];\n };\n BeanStub.EVENT_DESTROYED = 'destroyed';\n __decorate$2L([\n Autowired('frameworkOverrides')\n ], BeanStub.prototype, \"frameworkOverrides\", void 0);\n __decorate$2L([\n Autowired('context')\n ], BeanStub.prototype, \"context\", void 0);\n __decorate$2L([\n Autowired('eventService')\n ], BeanStub.prototype, \"eventService\", void 0);\n __decorate$2L([\n Autowired('gridOptionsService')\n ], BeanStub.prototype, \"gridOptionsService\", void 0);\n __decorate$2L([\n Autowired('localeService')\n ], BeanStub.prototype, \"localeService\", void 0);\n __decorate$2L([\n Autowired('environment')\n ], BeanStub.prototype, \"environment\", void 0);\n __decorate$2L([\n PreDestroy\n ], BeanStub.prototype, \"destroy\", null);\n return BeanStub;\n}());\n\nvar __extends$3g = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2K = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param$7 = ( false) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\n// takes ColDefs and ColGroupDefs and turns them into Columns and OriginalGroups\nvar ColumnFactory = /** @class */ (function (_super) {\n __extends$3g(ColumnFactory, _super);\n function ColumnFactory() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ColumnFactory.prototype.setBeans = function (loggerFactory) {\n this.logger = loggerFactory.create('ColumnFactory');\n };\n ColumnFactory.prototype.createColumnTree = function (defs, primaryColumns, existingTree, source) {\n // column key creator dishes out unique column id's in a deterministic way,\n // so if we have two grids (that could be master/slave) with same column definitions,\n // then this ensures the two grids use identical id's.\n var columnKeyCreator = new ColumnKeyCreator();\n var _a = this.extractExistingTreeData(existingTree), existingCols = _a.existingCols, existingGroups = _a.existingGroups, existingColKeys = _a.existingColKeys;\n columnKeyCreator.addExistingKeys(existingColKeys);\n // create am unbalanced tree that maps the provided definitions\n var unbalancedTree = this.recursivelyCreateColumns(defs, 0, primaryColumns, existingCols, columnKeyCreator, existingGroups, source);\n var treeDept = this.findMaxDept(unbalancedTree, 0);\n this.logger.log('Number of levels for grouped columns is ' + treeDept);\n var columnTree = this.balanceColumnTree(unbalancedTree, 0, treeDept, columnKeyCreator);\n var deptFirstCallback = function (child, parent) {\n if (child instanceof ProvidedColumnGroup) {\n child.setupExpandable();\n }\n // we set the original parents at the end, rather than when we go along, as balancing the tree\n // adds extra levels into the tree. so we can only set parents when balancing is done.\n child.setOriginalParent(parent);\n };\n this.columnUtils.depthFirstOriginalTreeSearch(null, columnTree, deptFirstCallback);\n return {\n columnTree: columnTree,\n treeDept: treeDept\n };\n };\n ColumnFactory.prototype.extractExistingTreeData = function (existingTree) {\n var existingCols = [];\n var existingGroups = [];\n var existingColKeys = [];\n if (existingTree) {\n this.columnUtils.depthFirstOriginalTreeSearch(null, existingTree, function (item) {\n if (item instanceof ProvidedColumnGroup) {\n var group = item;\n existingGroups.push(group);\n }\n else {\n var col = item;\n existingColKeys.push(col.getId());\n existingCols.push(col);\n }\n });\n }\n return { existingCols: existingCols, existingGroups: existingGroups, existingColKeys: existingColKeys };\n };\n ColumnFactory.prototype.createForAutoGroups = function (autoGroupCols, gridBalancedTree) {\n var _this = this;\n return autoGroupCols.map(function (col) { return _this.createAutoGroupTreeItem(gridBalancedTree, col); });\n };\n ColumnFactory.prototype.createAutoGroupTreeItem = function (balancedColumnTree, column) {\n var dept = this.findDepth(balancedColumnTree);\n // at the end, this will be the top of the tree item.\n var nextChild = column;\n for (var i = dept - 1; i >= 0; i--) {\n var autoGroup = new ProvidedColumnGroup(null, \"FAKE_PATH_\".concat(column.getId(), \"}_\").concat(i), true, i);\n this.createBean(autoGroup);\n autoGroup.setChildren([nextChild]);\n nextChild.setOriginalParent(autoGroup);\n nextChild = autoGroup;\n }\n if (dept === 0) {\n column.setOriginalParent(null);\n }\n // at this point, the nextChild is the top most item in the tree\n return nextChild;\n };\n ColumnFactory.prototype.findDepth = function (balancedColumnTree) {\n var dept = 0;\n var pointer = balancedColumnTree;\n while (pointer && pointer[0] && pointer[0] instanceof ProvidedColumnGroup) {\n dept++;\n pointer = pointer[0].getChildren();\n }\n return dept;\n };\n ColumnFactory.prototype.balanceColumnTree = function (unbalancedTree, currentDept, columnDept, columnKeyCreator) {\n var result = [];\n // go through each child, for groups, recurse a level deeper,\n // for columns we need to pad\n for (var i = 0; i < unbalancedTree.length; i++) {\n var child = unbalancedTree[i];\n if (child instanceof ProvidedColumnGroup) {\n // child is a group, all we do is go to the next level of recursion\n var originalGroup = child;\n var newChildren = this.balanceColumnTree(originalGroup.getChildren(), currentDept + 1, columnDept, columnKeyCreator);\n originalGroup.setChildren(newChildren);\n result.push(originalGroup);\n }\n else {\n // child is a column - so here we add in the padded column groups if needed\n var firstPaddedGroup = void 0;\n var currentPaddedGroup = void 0;\n // this for loop will NOT run any loops if no padded column groups are needed\n for (var j = columnDept - 1; j >= currentDept; j--) {\n var newColId = columnKeyCreator.getUniqueKey(null, null);\n var colGroupDefMerged = this.createMergedColGroupDef(null);\n var paddedGroup = new ProvidedColumnGroup(colGroupDefMerged, newColId, true, currentDept);\n this.createBean(paddedGroup);\n if (currentPaddedGroup) {\n currentPaddedGroup.setChildren([paddedGroup]);\n }\n currentPaddedGroup = paddedGroup;\n if (!firstPaddedGroup) {\n firstPaddedGroup = currentPaddedGroup;\n }\n }\n // likewise this if statement will not run if no padded groups\n if (firstPaddedGroup && currentPaddedGroup) {\n result.push(firstPaddedGroup);\n var hasGroups = unbalancedTree.some(function (leaf) { return leaf instanceof ProvidedColumnGroup; });\n if (hasGroups) {\n currentPaddedGroup.setChildren([child]);\n continue;\n }\n else {\n currentPaddedGroup.setChildren(unbalancedTree);\n break;\n }\n }\n result.push(child);\n }\n }\n return result;\n };\n ColumnFactory.prototype.findMaxDept = function (treeChildren, dept) {\n var maxDeptThisLevel = dept;\n for (var i = 0; i < treeChildren.length; i++) {\n var abstractColumn = treeChildren[i];\n if (abstractColumn instanceof ProvidedColumnGroup) {\n var originalGroup = abstractColumn;\n var newDept = this.findMaxDept(originalGroup.getChildren(), dept + 1);\n if (maxDeptThisLevel < newDept) {\n maxDeptThisLevel = newDept;\n }\n }\n }\n return maxDeptThisLevel;\n };\n ColumnFactory.prototype.recursivelyCreateColumns = function (defs, level, primaryColumns, existingColsCopy, columnKeyCreator, existingGroups, source) {\n if (!defs)\n return [];\n var result = new Array(defs.length);\n for (var i = 0; i < result.length; i++) {\n var def = defs[i];\n if (this.isColumnGroup(def)) {\n result[i] = this.createColumnGroup(primaryColumns, def, level, existingColsCopy, columnKeyCreator, existingGroups, source);\n }\n else {\n result[i] = this.createColumn(primaryColumns, def, existingColsCopy, columnKeyCreator, source);\n }\n }\n return result;\n };\n ColumnFactory.prototype.createColumnGroup = function (primaryColumns, colGroupDef, level, existingColumns, columnKeyCreator, existingGroups, source) {\n var colGroupDefMerged = this.createMergedColGroupDef(colGroupDef);\n var groupId = columnKeyCreator.getUniqueKey(colGroupDefMerged.groupId || null, null);\n var providedGroup = new ProvidedColumnGroup(colGroupDefMerged, groupId, false, level);\n this.createBean(providedGroup);\n var existingGroupAndIndex = this.findExistingGroup(colGroupDef, existingGroups);\n // make sure we remove, so if user provided duplicate id, then we don't have more than\n // one column instance for colDef with common id\n if (existingGroupAndIndex) {\n existingGroups.splice(existingGroupAndIndex.idx, 1);\n }\n var existingGroup = existingGroupAndIndex === null || existingGroupAndIndex === void 0 ? void 0 : existingGroupAndIndex.group;\n if (existingGroup) {\n providedGroup.setExpanded(existingGroup.isExpanded());\n }\n var children = this.recursivelyCreateColumns(colGroupDefMerged.children, level + 1, primaryColumns, existingColumns, columnKeyCreator, existingGroups, source);\n providedGroup.setChildren(children);\n return providedGroup;\n };\n ColumnFactory.prototype.createMergedColGroupDef = function (colGroupDef) {\n var colGroupDefMerged = {};\n Object.assign(colGroupDefMerged, this.gridOptionsService.get('defaultColGroupDef'));\n Object.assign(colGroupDefMerged, colGroupDef);\n return colGroupDefMerged;\n };\n ColumnFactory.prototype.createColumn = function (primaryColumns, colDef, existingColsCopy, columnKeyCreator, source) {\n // see if column already exists\n var existingColAndIndex = this.findExistingColumn(colDef, existingColsCopy);\n // make sure we remove, so if user provided duplicate id, then we don't have more than\n // one column instance for colDef with common id\n if (existingColAndIndex) {\n existingColsCopy === null || existingColsCopy === void 0 ? void 0 : existingColsCopy.splice(existingColAndIndex.idx, 1);\n }\n var column = existingColAndIndex === null || existingColAndIndex === void 0 ? void 0 : existingColAndIndex.column;\n if (!column) {\n // no existing column, need to create one\n var colId = columnKeyCreator.getUniqueKey(colDef.colId, colDef.field);\n var colDefMerged = this.addColumnDefaultAndTypes(colDef, colId);\n column = new Column(colDefMerged, colDef, colId, primaryColumns);\n this.context.createBean(column);\n }\n else {\n var colDefMerged = this.addColumnDefaultAndTypes(colDef, column.getColId());\n column.setColDef(colDefMerged, colDef, source);\n this.applyColumnState(column, colDefMerged, source);\n }\n this.dataTypeService.addColumnListeners(column);\n return column;\n };\n ColumnFactory.prototype.applyColumnState = function (column, colDef, source) {\n // flex\n var flex = attrToNumber(colDef.flex);\n if (flex !== undefined) {\n column.setFlex(flex);\n }\n // width - we only set width if column is not flexing\n var noFlexThisCol = column.getFlex() <= 0;\n if (noFlexThisCol) {\n // both null and undefined means we skip, as it's not possible to 'clear' width (a column must have a width)\n var width = attrToNumber(colDef.width);\n if (width != null) {\n column.setActualWidth(width, source);\n }\n else {\n // otherwise set the width again, in case min or max width has changed,\n // and width needs to be adjusted.\n var widthBeforeUpdate = column.getActualWidth();\n column.setActualWidth(widthBeforeUpdate, source);\n }\n }\n // sort - anything but undefined will set sort, thus null or empty string will clear the sort\n if (colDef.sort !== undefined) {\n if (colDef.sort == 'asc' || colDef.sort == 'desc') {\n column.setSort(colDef.sort, source);\n }\n else {\n column.setSort(undefined, source);\n }\n }\n // sorted at - anything but undefined, thus null will clear the sortIndex\n var sortIndex = attrToNumber(colDef.sortIndex);\n if (sortIndex !== undefined) {\n column.setSortIndex(sortIndex);\n }\n // hide - anything but undefined, thus null will clear the hide\n var hide = attrToBoolean(colDef.hide);\n if (hide !== undefined) {\n column.setVisible(!hide, source);\n }\n // pinned - anything but undefined, thus null or empty string will remove pinned\n if (colDef.pinned !== undefined) {\n column.setPinned(colDef.pinned);\n }\n };\n ColumnFactory.prototype.findExistingColumn = function (newColDef, existingColsCopy) {\n if (!existingColsCopy)\n return undefined;\n for (var i = 0; i < existingColsCopy.length; i++) {\n var def = existingColsCopy[i].getUserProvidedColDef();\n if (!def)\n continue;\n var newHasId = newColDef.colId != null;\n if (newHasId) {\n if (existingColsCopy[i].getId() === newColDef.colId) {\n return { idx: i, column: existingColsCopy[i] };\n }\n continue;\n }\n var newHasField = newColDef.field != null;\n if (newHasField) {\n if (def.field === newColDef.field) {\n return { idx: i, column: existingColsCopy[i] };\n }\n continue;\n }\n if (def === newColDef) {\n return { idx: i, column: existingColsCopy[i] };\n }\n }\n return undefined;\n };\n ColumnFactory.prototype.findExistingGroup = function (newGroupDef, existingGroups) {\n var newHasId = newGroupDef.groupId != null;\n if (!newHasId) {\n return undefined;\n }\n for (var i = 0; i < existingGroups.length; i++) {\n var existingGroup = existingGroups[i];\n var existingDef = existingGroup.getColGroupDef();\n if (!existingDef) {\n continue;\n }\n if (existingGroup.getId() === newGroupDef.groupId) {\n return { idx: i, group: existingGroup };\n }\n }\n return undefined;\n };\n ColumnFactory.prototype.addColumnDefaultAndTypes = function (colDef, colId) {\n // start with empty merged definition\n var res = {};\n // merge properties from default column definitions\n var defaultColDef = this.gridOptionsService.get('defaultColDef');\n mergeDeep(res, defaultColDef, false, true);\n var columnType = this.dataTypeService.updateColDefAndGetColumnType(res, colDef, colId);\n if (columnType) {\n this.assignColumnTypes(columnType, res);\n }\n // merge properties from column definitions\n mergeDeep(res, colDef, false, true);\n var autoGroupColDef = this.gridOptionsService.get('autoGroupColumnDef');\n var isSortingCoupled = this.gridOptionsService.isColumnsSortingCoupledToGroup();\n if (colDef.rowGroup && autoGroupColDef && isSortingCoupled) {\n // override the sort for row group columns where the autoGroupColDef defines these values.\n mergeDeep(res, { sort: autoGroupColDef.sort, initialSort: autoGroupColDef.initialSort }, false, true);\n }\n this.dataTypeService.validateColDef(res);\n return res;\n };\n ColumnFactory.prototype.assignColumnTypes = function (typeKeys, colDefMerged) {\n if (!typeKeys.length) {\n return;\n }\n // merge user defined with default column types\n var allColumnTypes = Object.assign({}, DefaultColumnTypes);\n var userTypes = this.gridOptionsService.get('columnTypes') || {};\n iterateObject(userTypes, function (key, value) {\n if (key in allColumnTypes) {\n console.warn(\"AG Grid: the column type '\".concat(key, \"' is a default column type and cannot be overridden.\"));\n }\n else {\n var colType = value;\n if (colType.type) {\n warnOnce(\"Column type definitions 'columnTypes' with a 'type' attribute are not supported \" +\n \"because a column type cannot refer to another column type. Only column definitions \" +\n \"'columnDefs' can use the 'type' attribute to refer to a column type.\");\n }\n allColumnTypes[key] = value;\n }\n });\n typeKeys.forEach(function (t) {\n var typeColDef = allColumnTypes[t.trim()];\n if (typeColDef) {\n mergeDeep(colDefMerged, typeColDef, false, true);\n }\n else {\n console.warn(\"AG Grid: colDef.type '\" + t + \"' does not correspond to defined gridOptions.columnTypes\");\n }\n });\n };\n // if object has children, we assume it's a group\n ColumnFactory.prototype.isColumnGroup = function (abstractColDef) {\n return abstractColDef.children !== undefined;\n };\n __decorate$2K([\n Autowired('columnUtils')\n ], ColumnFactory.prototype, \"columnUtils\", void 0);\n __decorate$2K([\n Autowired('dataTypeService')\n ], ColumnFactory.prototype, \"dataTypeService\", void 0);\n __decorate$2K([\n __param$7(0, Qualifier('loggerFactory'))\n ], ColumnFactory.prototype, \"setBeans\", null);\n ColumnFactory = __decorate$2K([\n Bean('columnFactory')\n ], ColumnFactory);\n return ColumnFactory;\n}(BeanStub));\n\nvar __decorate$2J = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ColumnGroup = /** @class */ (function () {\n function ColumnGroup(providedColumnGroup, groupId, partId, pinned) {\n // depends on the open/closed state of the group, only displaying columns are stored here\n this.displayedChildren = [];\n this.localEventService = new EventService();\n this.groupId = groupId;\n this.partId = partId;\n this.providedColumnGroup = providedColumnGroup;\n this.pinned = pinned;\n }\n // this is static, a it is used outside of this class\n ColumnGroup.createUniqueId = function (groupId, instanceId) {\n return groupId + '_' + instanceId;\n };\n // as the user is adding and removing columns, the groups are recalculated.\n // this reset clears out all children, ready for children to be added again\n ColumnGroup.prototype.reset = function () {\n this.parent = null;\n this.children = null;\n this.displayedChildren = null;\n };\n ColumnGroup.prototype.getParent = function () {\n return this.parent;\n };\n ColumnGroup.prototype.setParent = function (parent) {\n this.parent = parent;\n };\n ColumnGroup.prototype.getUniqueId = function () {\n return ColumnGroup.createUniqueId(this.groupId, this.partId);\n };\n ColumnGroup.prototype.isEmptyGroup = function () {\n return this.displayedChildren.length === 0;\n };\n ColumnGroup.prototype.isMoving = function () {\n var allLeafColumns = this.getProvidedColumnGroup().getLeafColumns();\n if (!allLeafColumns || allLeafColumns.length === 0) {\n return false;\n }\n return allLeafColumns.every(function (col) { return col.isMoving(); });\n };\n ColumnGroup.prototype.checkLeft = function () {\n // first get all children to setLeft, as it impacts our decision below\n this.displayedChildren.forEach(function (child) {\n if (child instanceof ColumnGroup) {\n child.checkLeft();\n }\n });\n // set our left based on first displayed column\n if (this.displayedChildren.length > 0) {\n if (this.gridOptionsService.get('enableRtl')) {\n var lastChild = last(this.displayedChildren);\n var lastChildLeft = lastChild.getLeft();\n this.setLeft(lastChildLeft);\n }\n else {\n var firstChildLeft = this.displayedChildren[0].getLeft();\n this.setLeft(firstChildLeft);\n }\n }\n else {\n // this should never happen, as if we have no displayed columns, then\n // this groups should not even exist.\n this.setLeft(null);\n }\n };\n ColumnGroup.prototype.getLeft = function () {\n return this.left;\n };\n ColumnGroup.prototype.getOldLeft = function () {\n return this.oldLeft;\n };\n ColumnGroup.prototype.setLeft = function (left) {\n this.oldLeft = this.left;\n if (this.left !== left) {\n this.left = left;\n this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_LEFT_CHANGED));\n }\n };\n ColumnGroup.prototype.getPinned = function () {\n return this.pinned;\n };\n ColumnGroup.prototype.createAgEvent = function (type) {\n return { type: type };\n };\n ColumnGroup.prototype.addEventListener = function (eventType, listener) {\n this.localEventService.addEventListener(eventType, listener);\n };\n ColumnGroup.prototype.removeEventListener = function (eventType, listener) {\n this.localEventService.removeEventListener(eventType, listener);\n };\n ColumnGroup.prototype.getGroupId = function () {\n return this.groupId;\n };\n ColumnGroup.prototype.getPartId = function () {\n return this.partId;\n };\n ColumnGroup.prototype.isChildInThisGroupDeepSearch = function (wantedChild) {\n var result = false;\n this.children.forEach(function (foundChild) {\n if (wantedChild === foundChild) {\n result = true;\n }\n if (foundChild instanceof ColumnGroup) {\n if (foundChild.isChildInThisGroupDeepSearch(wantedChild)) {\n result = true;\n }\n }\n });\n return result;\n };\n ColumnGroup.prototype.getActualWidth = function () {\n var groupActualWidth = 0;\n if (this.displayedChildren) {\n this.displayedChildren.forEach(function (child) {\n groupActualWidth += child.getActualWidth();\n });\n }\n return groupActualWidth;\n };\n ColumnGroup.prototype.isResizable = function () {\n if (!this.displayedChildren) {\n return false;\n }\n // if at least one child is resizable, then the group is resizable\n var result = false;\n this.displayedChildren.forEach(function (child) {\n if (child.isResizable()) {\n result = true;\n }\n });\n return result;\n };\n ColumnGroup.prototype.getMinWidth = function () {\n var result = 0;\n this.displayedChildren.forEach(function (groupChild) {\n result += groupChild.getMinWidth() || 0;\n });\n return result;\n };\n ColumnGroup.prototype.addChild = function (child) {\n if (!this.children) {\n this.children = [];\n }\n this.children.push(child);\n };\n ColumnGroup.prototype.getDisplayedChildren = function () {\n return this.displayedChildren;\n };\n ColumnGroup.prototype.getLeafColumns = function () {\n var result = [];\n this.addLeafColumns(result);\n return result;\n };\n ColumnGroup.prototype.getDisplayedLeafColumns = function () {\n var result = [];\n this.addDisplayedLeafColumns(result);\n return result;\n };\n ColumnGroup.prototype.getDefinition = function () {\n return this.providedColumnGroup.getColGroupDef();\n };\n ColumnGroup.prototype.getColGroupDef = function () {\n return this.providedColumnGroup.getColGroupDef();\n };\n ColumnGroup.prototype.isPadding = function () {\n return this.providedColumnGroup.isPadding();\n };\n ColumnGroup.prototype.isExpandable = function () {\n return this.providedColumnGroup.isExpandable();\n };\n ColumnGroup.prototype.isExpanded = function () {\n return this.providedColumnGroup.isExpanded();\n };\n ColumnGroup.prototype.setExpanded = function (expanded) {\n this.providedColumnGroup.setExpanded(expanded);\n };\n ColumnGroup.prototype.addDisplayedLeafColumns = function (leafColumns) {\n this.displayedChildren.forEach(function (child) {\n if (child instanceof Column) {\n leafColumns.push(child);\n }\n else if (child instanceof ColumnGroup) {\n child.addDisplayedLeafColumns(leafColumns);\n }\n });\n };\n ColumnGroup.prototype.addLeafColumns = function (leafColumns) {\n this.children.forEach(function (child) {\n if (child instanceof Column) {\n leafColumns.push(child);\n }\n else if (child instanceof ColumnGroup) {\n child.addLeafColumns(leafColumns);\n }\n });\n };\n ColumnGroup.prototype.getChildren = function () {\n return this.children;\n };\n ColumnGroup.prototype.getColumnGroupShow = function () {\n return this.providedColumnGroup.getColumnGroupShow();\n };\n ColumnGroup.prototype.getProvidedColumnGroup = function () {\n return this.providedColumnGroup;\n };\n ColumnGroup.prototype.getPaddingLevel = function () {\n var parent = this.getParent();\n if (!this.isPadding() || !parent || !parent.isPadding()) {\n return 0;\n }\n return 1 + parent.getPaddingLevel();\n };\n ColumnGroup.prototype.calculateDisplayedColumns = function () {\n var _this = this;\n // clear out last time we calculated\n this.displayedChildren = [];\n // find the column group that is controlling expandable. this is relevant when we have padding (empty)\n // groups, where the expandable is actually the first parent that is not a padding group.\n var parentWithExpansion = this;\n while (parentWithExpansion != null && parentWithExpansion.isPadding()) {\n parentWithExpansion = parentWithExpansion.getParent();\n }\n var isExpandable = parentWithExpansion ? parentWithExpansion.providedColumnGroup.isExpandable() : false;\n // it not expandable, everything is visible\n if (!isExpandable) {\n this.displayedChildren = this.children;\n this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED));\n return;\n }\n // Add cols based on columnGroupShow\n // Note - the below also adds padding groups, these are always added because they never have\n // colDef.columnGroupShow set.\n this.children.forEach(function (child) {\n // never add empty groups\n var emptyGroup = child instanceof ColumnGroup && (!child.displayedChildren || !child.displayedChildren.length);\n if (emptyGroup) {\n return;\n }\n var headerGroupShow = child.getColumnGroupShow();\n switch (headerGroupShow) {\n case 'open':\n // when set to open, only show col if group is open\n if (parentWithExpansion.providedColumnGroup.isExpanded()) {\n _this.displayedChildren.push(child);\n }\n break;\n case 'closed':\n // when set to open, only show col if group is open\n if (!parentWithExpansion.providedColumnGroup.isExpanded()) {\n _this.displayedChildren.push(child);\n }\n break;\n default:\n _this.displayedChildren.push(child);\n break;\n }\n });\n this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED));\n };\n ColumnGroup.EVENT_LEFT_CHANGED = 'leftChanged';\n ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED = 'displayedChildrenChanged';\n __decorate$2J([\n Autowired('gridOptionsService')\n ], ColumnGroup.prototype, \"gridOptionsService\", void 0);\n return ColumnGroup;\n}());\n\nvar Events = /** @class */ (function () {\n function Events() {\n }\n /** Everything has changed with the columns. Either complete new set of columns set, or user called applyColumnState() */\n /** @deprecated - grid no longer uses this, and setSate() also fires individual events */\n Events.EVENT_COLUMN_EVERYTHING_CHANGED = 'columnEverythingChanged';\n /** User has set in new columns. */\n Events.EVENT_NEW_COLUMNS_LOADED = 'newColumnsLoaded';\n /** The pivot mode flag was changed */\n Events.EVENT_COLUMN_PIVOT_MODE_CHANGED = 'columnPivotModeChanged';\n /** A row group column was added, removed or order changed. */\n Events.EVENT_COLUMN_ROW_GROUP_CHANGED = 'columnRowGroupChanged';\n /** expandAll / collapseAll was called from the api. */\n Events.EVENT_EXPAND_COLLAPSE_ALL = 'expandOrCollapseAll';\n /** A pivot column was added, removed or order changed. */\n Events.EVENT_COLUMN_PIVOT_CHANGED = 'columnPivotChanged';\n /** The list of grid columns has changed. */\n Events.EVENT_GRID_COLUMNS_CHANGED = 'gridColumnsChanged';\n /** A value column was added, removed or agg function was changed. */\n Events.EVENT_COLUMN_VALUE_CHANGED = 'columnValueChanged';\n /** A column was moved */\n Events.EVENT_COLUMN_MOVED = 'columnMoved';\n /** One or more columns was shown / hidden */\n Events.EVENT_COLUMN_VISIBLE = 'columnVisible';\n /** One or more columns was pinned / unpinned*/\n Events.EVENT_COLUMN_PINNED = 'columnPinned';\n /** A column group was opened / closed */\n Events.EVENT_COLUMN_GROUP_OPENED = 'columnGroupOpened';\n /** One or more columns was resized. If just one, the column in the event is set. */\n Events.EVENT_COLUMN_RESIZED = 'columnResized';\n /** The list of displayed columns has changed, can result from columns open / close, column move, pivot, group, etc */\n Events.EVENT_DISPLAYED_COLUMNS_CHANGED = 'displayedColumnsChanged';\n /** The grid option related to suppressing movable columns has changed */\n Events.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED = 'suppressMovableColumns';\n /** The grid option related to suppressing column group selection has changed */\n Events.EVENT_SUPPRESS_MENU_HIDE_CHANGED = 'suppressMenuHide';\n /** The grid option related to suppressing movable columns has changed */\n Events.EVENT_SUPPRESS_FIELD_DOT_NOTATION = 'suppressFieldDotNotation';\n /** The list of virtual columns has changed, results from viewport changing */\n Events.EVENT_VIRTUAL_COLUMNS_CHANGED = 'virtualColumnsChanged';\n /** Column header mouse over */\n Events.EVENT_COLUMN_HEADER_MOUSE_OVER = 'columnHeaderMouseOver';\n /** Column header mouse leave */\n Events.EVENT_COLUMN_HEADER_MOUSE_LEAVE = 'columnHeaderMouseLeave';\n /** Column header clicked */\n Events.EVENT_COLUMN_HEADER_CLICKED = 'columnHeaderClicked';\n /** Column header context menu event, such as right-click or context menu key press */\n Events.EVENT_COLUMN_HEADER_CONTEXT_MENU = 'columnHeaderContextMenu';\n /** Async Transactions Executed */\n Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED = 'asyncTransactionsFlushed';\n /** A row group was opened / closed */\n Events.EVENT_ROW_GROUP_OPENED = 'rowGroupOpened';\n /** Client-Side Row Model only. The client has updated data for the grid */\n Events.EVENT_ROW_DATA_UPDATED = 'rowDataUpdated';\n /** The client has set new floating data into the grid */\n Events.EVENT_PINNED_ROW_DATA_CHANGED = 'pinnedRowDataChanged';\n /** Range selection has changed */\n Events.EVENT_RANGE_SELECTION_CHANGED = 'rangeSelectionChanged';\n /** Chart was created */\n Events.EVENT_CHART_CREATED = 'chartCreated';\n /** Chart Range selection has changed */\n Events.EVENT_CHART_RANGE_SELECTION_CHANGED = 'chartRangeSelectionChanged';\n /** Chart Options have changed */\n Events.EVENT_CHART_OPTIONS_CHANGED = 'chartOptionsChanged';\n /** Chart was destroyed */\n Events.EVENT_CHART_DESTROYED = 'chartDestroyed';\n /** For when the tool panel is shown / hidden */\n Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED = 'toolPanelVisibleChanged';\n Events.EVENT_TOOL_PANEL_SIZE_CHANGED = 'toolPanelSizeChanged';\n Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START = 'columnPanelItemDragStart';\n Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END = 'columnPanelItemDragEnd';\n /** Model was updated - grid updates the drawn rows when this happens */\n Events.EVENT_MODEL_UPDATED = 'modelUpdated';\n Events.EVENT_CUT_START = 'cutStart';\n Events.EVENT_CUT_END = 'cutEnd';\n Events.EVENT_PASTE_START = 'pasteStart';\n Events.EVENT_PASTE_END = 'pasteEnd';\n Events.EVENT_FILL_START = 'fillStart';\n Events.EVENT_FILL_END = 'fillEnd';\n Events.EVENT_RANGE_DELETE_START = 'rangeDeleteStart';\n Events.EVENT_RANGE_DELETE_END = 'rangeDeleteEnd';\n /** Undo operation has started. */\n Events.EVENT_UNDO_STARTED = 'undoStarted';\n /** Undo operation has ended. */\n Events.EVENT_UNDO_ENDED = 'undoEnded';\n /** Redo operation has started. */\n Events.EVENT_REDO_STARTED = 'redoStarted';\n /** Redo operation has ended. */\n Events.EVENT_REDO_ENDED = 'redoEnded';\n Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START = 'keyShortcutChangedCellStart';\n Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END = 'keyShortcutChangedCellEnd';\n Events.EVENT_CELL_CLICKED = 'cellClicked';\n Events.EVENT_CELL_DOUBLE_CLICKED = 'cellDoubleClicked';\n Events.EVENT_CELL_MOUSE_DOWN = 'cellMouseDown';\n Events.EVENT_CELL_CONTEXT_MENU = 'cellContextMenu';\n Events.EVENT_CELL_VALUE_CHANGED = 'cellValueChanged';\n Events.EVENT_CELL_EDIT_REQUEST = 'cellEditRequest';\n Events.EVENT_ROW_VALUE_CHANGED = 'rowValueChanged';\n Events.EVENT_CELL_FOCUSED = 'cellFocused';\n Events.EVENT_CELL_FOCUS_CLEARED = 'cellFocusCleared';\n Events.EVENT_FULL_WIDTH_ROW_FOCUSED = 'fullWidthRowFocused';\n Events.EVENT_ROW_SELECTED = 'rowSelected';\n Events.EVENT_SELECTION_CHANGED = 'selectionChanged';\n Events.EVENT_TOOLTIP_SHOW = 'tooltipShow';\n Events.EVENT_TOOLTIP_HIDE = 'tooltipHide';\n Events.EVENT_CELL_KEY_DOWN = 'cellKeyDown';\n Events.EVENT_CELL_MOUSE_OVER = 'cellMouseOver';\n Events.EVENT_CELL_MOUSE_OUT = 'cellMouseOut';\n /** 2 events for filtering. The grid LISTENS for filterChanged and afterFilterChanged */\n Events.EVENT_FILTER_CHANGED = 'filterChanged';\n /** Filter was change but not applied. Only useful if apply buttons are used in filters. */\n Events.EVENT_FILTER_MODIFIED = 'filterModified';\n Events.EVENT_FILTER_OPENED = 'filterOpened';\n Events.EVENT_ADVANCED_FILTER_BUILDER_VISIBLE_CHANGED = 'advancedFilterBuilderVisibleChanged';\n Events.EVENT_SORT_CHANGED = 'sortChanged';\n /** A row was removed from the dom, for any reason. Use to clean up resources (if any) used by the row. */\n Events.EVENT_VIRTUAL_ROW_REMOVED = 'virtualRowRemoved';\n Events.EVENT_ROW_CLICKED = 'rowClicked';\n Events.EVENT_ROW_DOUBLE_CLICKED = 'rowDoubleClicked';\n /** Gets called once after the grid has finished initialising. */\n Events.EVENT_GRID_READY = 'gridReady';\n /** Called once when the grid is about to get destroyed. */\n Events.EVENT_GRID_PRE_DESTROYED = 'gridPreDestroyed';\n /** Width of height of the main grid div has changed. Grid listens for this and does layout of grid if it's\n * changed, so always filling the space it was given. */\n Events.EVENT_GRID_SIZE_CHANGED = 'gridSizeChanged';\n /** The indexes of the rows rendered has changed, eg user has scrolled to a new vertical position. */\n Events.EVENT_VIEWPORT_CHANGED = 'viewportChanged';\n /* The width of the scrollbar has been calculated */\n Events.EVENT_SCROLLBAR_WIDTH_CHANGED = 'scrollbarWidthChanged';\n /** Rows were rendered for the first time (ie on async data load). */\n Events.EVENT_FIRST_DATA_RENDERED = 'firstDataRendered';\n /** A column drag has started, either resizing a column or moving a column. */\n Events.EVENT_DRAG_STARTED = 'dragStarted';\n /** A column drag has stopped */\n Events.EVENT_DRAG_STOPPED = 'dragStopped';\n Events.EVENT_CHECKBOX_CHANGED = 'checkboxChanged';\n Events.EVENT_ROW_EDITING_STARTED = 'rowEditingStarted';\n Events.EVENT_ROW_EDITING_STOPPED = 'rowEditingStopped';\n Events.EVENT_CELL_EDITING_STARTED = 'cellEditingStarted';\n Events.EVENT_CELL_EDITING_STOPPED = 'cellEditingStopped';\n /** Main body of grid has scrolled, either horizontally or vertically */\n Events.EVENT_BODY_SCROLL = 'bodyScroll';\n /** Main body of the grid has stopped scrolling, either horizontally or vertically */\n Events.EVENT_BODY_SCROLL_END = 'bodyScrollEnd';\n Events.EVENT_HEIGHT_SCALE_CHANGED = 'heightScaleChanged';\n /** The displayed page for pagination has changed. For example the data was filtered or sorted,\n * or the user has moved to a different page. */\n Events.EVENT_PAGINATION_CHANGED = 'paginationChanged';\n /** Only used by React, Angular, Web Components and VueJS AG Grid components\n * (not used if doing plain JavaScript). If the grid receives changes due\n * to bound properties, this event fires after the grid has finished processing the change. */\n Events.EVENT_COMPONENT_STATE_CHANGED = 'componentStateChanged';\n /** Only used by the SSRM, called when the grid has no more rows to refresh */\n Events.EVENT_STORE_REFRESHED = 'storeRefreshed';\n Events.EVENT_STATE_UPDATED = 'stateUpdated';\n /** The visibility of the column menu has changed. */\n Events.EVENT_COLUMN_MENU_VISIBLE_CHANGED = 'columnMenuVisibleChanged';\n /***************************** INTERNAL EVENTS: START ******************************************* */\n /** Please remember to add to ComponentUtil.EXCLUDED_INTERNAL_EVENTS to not have these events exposed to framework components. */\n /** All items from here down are used internally by the grid, not intended for external use. */\n // not documented, either experimental, or we just don't want users using an depending on them\n Events.EVENT_BODY_HEIGHT_CHANGED = 'bodyHeightChanged';\n Events.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED = 'columnContainerWidthChanged';\n Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED = 'displayedColumnsWidthChanged';\n Events.EVENT_SCROLL_VISIBILITY_CHANGED = 'scrollVisibilityChanged';\n Events.EVENT_COLUMN_HOVER_CHANGED = 'columnHoverChanged';\n Events.EVENT_FLASH_CELLS = 'flashCells';\n Events.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED = 'paginationPixelOffsetChanged';\n Events.EVENT_DISPLAYED_ROWS_CHANGED = 'displayedRowsChanged';\n Events.EVENT_LEFT_PINNED_WIDTH_CHANGED = 'leftPinnedWidthChanged';\n Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED = 'rightPinnedWidthChanged';\n Events.EVENT_ROW_CONTAINER_HEIGHT_CHANGED = 'rowContainerHeightChanged';\n Events.EVENT_HEADER_HEIGHT_CHANGED = 'headerHeightChanged';\n Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED = 'columnHeaderHeightChanged';\n Events.EVENT_ROW_DRAG_ENTER = 'rowDragEnter';\n Events.EVENT_ROW_DRAG_MOVE = 'rowDragMove';\n Events.EVENT_ROW_DRAG_LEAVE = 'rowDragLeave';\n Events.EVENT_ROW_DRAG_END = 'rowDragEnd';\n // environment\n Events.EVENT_GRID_STYLES_CHANGED = 'gridStylesChanged';\n // primarily for charts\n Events.EVENT_POPUP_TO_FRONT = 'popupToFront';\n // these are used for server side group and agg - only used by CS with Viewport Row Model - intention is\n // to design these better around server side functions and then release to general public when fully working with\n // all the row models.\n Events.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST = 'columnRowGroupChangeRequest';\n Events.EVENT_COLUMN_PIVOT_CHANGE_REQUEST = 'columnPivotChangeRequest';\n Events.EVENT_COLUMN_VALUE_CHANGE_REQUEST = 'columnValueChangeRequest';\n Events.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST = 'columnAggFuncChangeRequest';\n Events.EVENT_STORE_UPDATED = 'storeUpdated';\n Events.EVENT_FILTER_DESTROYED = 'filterDestroyed';\n Events.EVENT_ROW_DATA_UPDATE_STARTED = 'rowDataUpdateStarted';\n Events.EVENT_ROW_COUNT_READY = 'rowCountReady';\n // Advanced Filters\n Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED = 'advancedFilterEnabledChanged';\n Events.EVENT_DATA_TYPES_INFERRED = 'dataTypesInferred';\n // Widgets\n Events.EVENT_FIELD_VALUE_CHANGED = 'fieldValueChanged';\n Events.EVENT_FIELD_PICKER_VALUE_SELECTED = 'fieldPickerValueSelected';\n Events.EVENT_SIDE_BAR_UPDATED = 'sideBarUpdated';\n return Events;\n}());\n\n// class returns unique instance id's for columns.\n// eg, the following calls (in this order) will result in:\n//\n// getInstanceIdForKey('country') => 0\n// getInstanceIdForKey('country') => 1\n// getInstanceIdForKey('country') => 2\n// getInstanceIdForKey('country') => 3\n// getInstanceIdForKey('age') => 0\n// getInstanceIdForKey('age') => 1\n// getInstanceIdForKey('country') => 4\nvar GroupInstanceIdCreator = /** @class */ (function () {\n function GroupInstanceIdCreator() {\n // this map contains keys to numbers, so we remember what the last call was\n this.existingIds = {};\n }\n GroupInstanceIdCreator.prototype.getInstanceIdForKey = function (key) {\n var lastResult = this.existingIds[key];\n var result;\n if (typeof lastResult !== 'number') {\n // first time this key\n result = 0;\n }\n else {\n result = lastResult + 1;\n }\n this.existingIds[key] = result;\n return result;\n };\n return GroupInstanceIdCreator;\n}());\n\nvar __extends$3f = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2I = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar GROUP_AUTO_COLUMN_ID = 'ag-Grid-AutoColumn';\nvar AutoGroupColService = /** @class */ (function (_super) {\n __extends$3f(AutoGroupColService, _super);\n function AutoGroupColService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AutoGroupColService.prototype.createAutoGroupColumns = function (rowGroupColumns) {\n var _this = this;\n var groupAutoColumns = [];\n var doingTreeData = this.gridOptionsService.get('treeData');\n var doingMultiAutoColumn = this.gridOptionsService.isGroupMultiAutoColumn();\n if (doingTreeData && doingMultiAutoColumn) {\n console.warn('AG Grid: you cannot mix groupDisplayType = \"multipleColumns\" with treeData, only one column can be used to display groups when doing tree data');\n doingMultiAutoColumn = false;\n }\n // if doing groupDisplayType = \"multipleColumns\", then we call the method multiple times, once\n // for each column we are grouping by\n if (doingMultiAutoColumn) {\n rowGroupColumns.forEach(function (rowGroupCol, index) {\n groupAutoColumns.push(_this.createOneAutoGroupColumn(rowGroupCol, index));\n });\n }\n else {\n groupAutoColumns.push(this.createOneAutoGroupColumn());\n }\n return groupAutoColumns;\n };\n AutoGroupColService.prototype.updateAutoGroupColumns = function (autoGroupColumns, source) {\n var _this = this;\n autoGroupColumns.forEach(function (column, index) { return _this.updateOneAutoGroupColumn(column, index, source); });\n };\n // rowGroupCol and index are missing if groupDisplayType != \"multipleColumns\"\n AutoGroupColService.prototype.createOneAutoGroupColumn = function (rowGroupCol, index) {\n // if doing multi, set the field\n var colId;\n if (rowGroupCol) {\n colId = \"\".concat(GROUP_AUTO_COLUMN_ID, \"-\").concat(rowGroupCol.getId());\n }\n else {\n colId = GROUP_AUTO_COLUMN_ID;\n }\n var colDef = this.createAutoGroupColDef(colId, rowGroupCol, index);\n colDef.colId = colId;\n var newCol = new Column(colDef, null, colId, true);\n this.context.createBean(newCol);\n return newCol;\n };\n /**\n * Refreshes an auto group col to load changes from defaultColDef or autoGroupColDef\n */\n AutoGroupColService.prototype.updateOneAutoGroupColumn = function (colToUpdate, index, source) {\n var oldColDef = colToUpdate.getColDef();\n var underlyingColId = typeof oldColDef.showRowGroup == 'string' ? oldColDef.showRowGroup : undefined;\n var underlyingColumn = underlyingColId != null ? this.columnModel.getPrimaryColumn(underlyingColId) : undefined;\n var colDef = this.createAutoGroupColDef(colToUpdate.getId(), underlyingColumn !== null && underlyingColumn !== void 0 ? underlyingColumn : undefined, index);\n colToUpdate.setColDef(colDef, null, source);\n this.columnFactory.applyColumnState(colToUpdate, colDef, source);\n };\n AutoGroupColService.prototype.createAutoGroupColDef = function (colId, underlyingColumn, index) {\n // if one provided by user, use it, otherwise create one\n var res = this.createBaseColDef(underlyingColumn);\n var autoGroupColumnDef = this.gridOptionsService.get('autoGroupColumnDef');\n mergeDeep(res, autoGroupColumnDef);\n res = this.columnFactory.addColumnDefaultAndTypes(res, colId);\n // For tree data the filter is always allowed\n if (!this.gridOptionsService.get('treeData')) {\n // we would only allow filter if the user has provided field or value getter. otherwise the filter\n // would not be able to work.\n var noFieldOrValueGetter = missing(res.field) &&\n missing(res.valueGetter) &&\n missing(res.filterValueGetter) &&\n res.filter !== 'agGroupColumnFilter';\n if (noFieldOrValueGetter) {\n res.filter = false;\n }\n }\n // if showing many cols, we don't want to show more than one with a checkbox for selection\n if (index && index > 0) {\n res.headerCheckboxSelection = false;\n }\n var isSortingCoupled = this.gridOptionsService.isColumnsSortingCoupledToGroup();\n var hasOwnData = res.valueGetter || res.field != null;\n if (isSortingCoupled && !hasOwnData) {\n // if col is coupled sorting, and has sort attribute, we want to ignore this\n // because we only accept the sort on creation of the col\n res.sortIndex = undefined;\n res.initialSort = undefined;\n }\n return res;\n };\n AutoGroupColService.prototype.createBaseColDef = function (rowGroupCol) {\n var userDef = this.gridOptionsService.get('autoGroupColumnDef');\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var res = {\n headerName: localeTextFunc('group', 'Group')\n };\n var userHasProvidedGroupCellRenderer = userDef &&\n (userDef.cellRenderer || userDef.cellRendererSelector);\n // only add the default group cell renderer if user hasn't provided one\n if (!userHasProvidedGroupCellRenderer) {\n res.cellRenderer = 'agGroupCellRenderer';\n }\n // we never allow moving the group column\n // defaultAutoColDef.suppressMovable = true;\n if (rowGroupCol) {\n var colDef = rowGroupCol.getColDef();\n Object.assign(res, {\n // cellRendererParams.groupKey: colDefToCopy.field;\n headerName: this.columnModel.getDisplayNameForColumn(rowGroupCol, 'header'),\n headerValueGetter: colDef.headerValueGetter\n });\n if (colDef.cellRenderer) {\n Object.assign(res, {\n cellRendererParams: {\n innerRenderer: colDef.cellRenderer,\n innerRendererParams: colDef.cellRendererParams\n }\n });\n }\n res.showRowGroup = rowGroupCol.getColId();\n }\n else {\n res.showRowGroup = true;\n }\n return res;\n };\n __decorate$2I([\n Autowired('columnModel')\n ], AutoGroupColService.prototype, \"columnModel\", void 0);\n __decorate$2I([\n Autowired('columnFactory')\n ], AutoGroupColService.prototype, \"columnFactory\", void 0);\n AutoGroupColService = __decorate$2I([\n Bean('autoGroupColService')\n ], AutoGroupColService);\n return AutoGroupColService;\n}(BeanStub));\n\nvar reUnescapedHtml = /[&<>\"']/g;\n/**\n * HTML Escapes.\n */\nvar HTML_ESCAPES = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\n/**\n * It encodes any string in UTF-8 format\n * taken from https://github.com/mathiasbynens/utf8.js\n * @param {string} s\n * @returns {string}\n */\nfunction utf8_encode$1(s) {\n var stringFromCharCode = String.fromCharCode;\n function ucs2decode(string) {\n var output = [];\n if (!string) {\n return [];\n }\n var len = string.length;\n var counter = 0;\n var value;\n var extra;\n while (counter < len) {\n value = string.charCodeAt(counter++);\n if (value >= 0xD800 && value <= 0xDBFF && counter < len) {\n // high surrogate, and there is a next character\n extra = string.charCodeAt(counter++);\n if ((extra & 0xFC00) == 0xDC00) { // low surrogate\n output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n }\n else {\n // unmatched surrogate; only append this code unit, in case the next\n // code unit is the high surrogate of a surrogate pair\n output.push(value);\n counter--;\n }\n }\n else {\n output.push(value);\n }\n }\n return output;\n }\n function checkScalarValue(point) {\n if (point >= 0xD800 && point <= 0xDFFF) {\n throw Error('Lone surrogate U+' + point.toString(16).toUpperCase() +\n ' is not a scalar value');\n }\n }\n function createByte(point, shift) {\n return stringFromCharCode(((point >> shift) & 0x3F) | 0x80);\n }\n function encodeCodePoint(point) {\n if ((point >= 0 && point <= 31 && point !== 10)) {\n var convertedCode = point.toString(16).toUpperCase();\n var paddedCode = convertedCode.padStart(4, '0');\n return \"_x\".concat(paddedCode, \"_\");\n }\n if ((point & 0xFFFFFF80) == 0) { // 1-byte sequence\n return stringFromCharCode(point);\n }\n var symbol = '';\n if ((point & 0xFFFFF800) == 0) { // 2-byte sequence\n symbol = stringFromCharCode(((point >> 6) & 0x1F) | 0xC0);\n }\n else if ((point & 0xFFFF0000) == 0) { // 3-byte sequence\n checkScalarValue(point);\n symbol = stringFromCharCode(((point >> 12) & 0x0F) | 0xE0);\n symbol += createByte(point, 6);\n }\n else if ((point & 0xFFE00000) == 0) { // 4-byte sequence\n symbol = stringFromCharCode(((point >> 18) & 0x07) | 0xF0);\n symbol += createByte(point, 12);\n symbol += createByte(point, 6);\n }\n symbol += stringFromCharCode((point & 0x3F) | 0x80);\n return symbol;\n }\n var codePoints = ucs2decode(s);\n var length = codePoints.length;\n var index = -1;\n var codePoint;\n var byteString = '';\n while (++index < length) {\n codePoint = codePoints[index];\n byteString += encodeCodePoint(codePoint);\n }\n return byteString;\n}\nfunction capitalise(str) {\n return str[0].toUpperCase() + str.substring(1).toLowerCase();\n}\nfunction escapeString(toEscape, skipEscapingHtmlChars) {\n if (toEscape == null) {\n return null;\n }\n // we call toString() twice, in case value is an object, where user provides\n // a toString() method, and first call to toString() returns back something other\n // than a string (eg a number to render)\n var stringResult = toEscape.toString().toString();\n if (skipEscapingHtmlChars) {\n return stringResult;\n }\n // in react we don't need to escape html characters, as it's done by the framework\n return stringResult.replace(reUnescapedHtml, function (chr) { return HTML_ESCAPES[chr]; });\n}\n/**\n * Converts a camelCase string into startCase\n * @param {string} camelCase\n * @return {string}\n */\nfunction camelCaseToHumanText(camelCase) {\n if (!camelCase || camelCase == null) {\n return null;\n }\n // either split on a lowercase followed by uppercase ie asHereTo -> as Here To\n var rex = /([a-z])([A-Z])/g;\n // or starts with uppercase and we take all expect the last which is assumed to be part of next word if followed by lowercase HEREToThere -> HERE To There\n var rexCaps = /([A-Z]+)([A-Z])([a-z])/g;\n var words = camelCase\n .replace(rex, '$1 $2')\n .replace(rexCaps, '$1 $2$3')\n .replace(/\\./g, ' ')\n .split(' ');\n return words.map(function (word) { return word.substring(0, 1).toUpperCase() + ((word.length > 1) ? word.substring(1, word.length) : ''); }).join(' ');\n}\n/**\n * Converts a camelCase string into hyphenated string\n * @param {string} camelCase\n * @return {string}\n */\nfunction camelCaseToHyphenated(camelCase) {\n return camelCase.replace(/[A-Z]/g, function (s) { return \"-\".concat(s.toLocaleLowerCase()); });\n}\n\nvar StringUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n utf8_encode: utf8_encode$1,\n capitalise: capitalise,\n escapeString: escapeString,\n camelCaseToHumanText: camelCaseToHumanText,\n camelCaseToHyphenated: camelCaseToHyphenated\n});\n\nfunction convertToMap(arr) {\n var map = new Map();\n arr.forEach(function (pair) { return map.set(pair[0], pair[1]); });\n return map;\n}\n// handy for organising a list into a map, where each item is mapped by an attribute, eg mapping Columns by ID\nfunction mapById(arr, callback) {\n var map = new Map();\n arr.forEach(function (item) { return map.set(callback(item), item); });\n return map;\n}\nfunction keys(map) {\n var arr = [];\n map.forEach(function (_, key) { return arr.push(key); });\n return arr;\n}\n\nvar MapUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n convertToMap: convertToMap,\n mapById: mapById,\n keys: keys\n});\n\nvar __extends$3e = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2H = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param$6 = ( false) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar __rest = ( false) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __read$A = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$s = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar __values$a = ( false) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar ColumnModel = /** @class */ (function (_super) {\n __extends$3e(ColumnModel, _super);\n function ColumnModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n // header row count, based on user provided columns\n _this.primaryHeaderRowCount = 0;\n _this.secondaryHeaderRowCount = 0;\n // header row count, either above, or based on pivoting if we are pivoting\n _this.gridHeaderRowCount = 0;\n // leave level columns of the displayed trees\n _this.displayedColumnsLeft = [];\n _this.displayedColumnsRight = [];\n _this.displayedColumnsCenter = [];\n // all three lists above combined\n _this.displayedColumns = [];\n // for fast lookup, to see if a column or group is still displayed\n _this.displayedColumnsAndGroupsMap = {};\n // all columns to be rendered\n _this.viewportColumns = [];\n // A hash key to keep track of changes in viewport columns\n _this.viewportColumnsHash = '';\n // same as viewportColumns, except we always include columns with headerAutoHeight\n _this.headerViewportColumns = [];\n // all columns to be rendered in the centre\n _this.viewportColumnsCenter = [];\n // same as viewportColumnsCenter, except we always include columns with headerAutoHeight\n _this.headerViewportColumnsCenter = [];\n // all columns & groups to be rendered, index by row. used by header rows to get all items\n // to render for that row.\n _this.viewportRowLeft = {};\n _this.viewportRowRight = {};\n _this.viewportRowCenter = {};\n _this.autoHeightActiveAtLeastOnce = false;\n _this.rowGroupColumns = [];\n _this.valueColumns = [];\n _this.pivotColumns = [];\n _this.ready = false;\n _this.changeEventsDispatching = false;\n _this.autoGroupsNeedBuilding = false;\n _this.forceRecreateAutoGroups = false;\n _this.pivotMode = false;\n _this.bodyWidth = 0;\n _this.leftWidth = 0;\n _this.rightWidth = 0;\n _this.bodyWidthDirty = true;\n // when we're waiting for cell data types to be inferred, we need to defer column resizing\n _this.shouldQueueResizeOperations = false;\n _this.resizeOperationQueue = [];\n return _this;\n }\n ColumnModel.prototype.init = function () {\n var _this = this;\n this.suppressColumnVirtualisation = this.gridOptionsService.get('suppressColumnVirtualisation');\n var pivotMode = this.gridOptionsService.get('pivotMode');\n if (this.isPivotSettingAllowed(pivotMode)) {\n this.pivotMode = pivotMode;\n }\n this.addManagedPropertyListeners(['groupDisplayType', 'treeData', 'treeDataDisplayType', 'groupHideOpenParents'], function (event) { return _this.buildAutoGroupColumns(convertSourceType(event.source)); });\n this.addManagedPropertyListener('autoGroupColumnDef', function (event) { return _this.onAutoGroupColumnDefChanged(convertSourceType(event.source)); });\n this.addManagedPropertyListeners(['defaultColDef', 'columnTypes', 'suppressFieldDotNotation'], function (event) { return _this.onSharedColDefChanged(convertSourceType(event.source)); });\n this.addManagedPropertyListener('pivotMode', function (event) { return _this.setPivotMode(_this.gridOptionsService.get('pivotMode'), convertSourceType(event.source)); });\n this.addManagedListener(this.eventService, Events.EVENT_FIRST_DATA_RENDERED, function () { return _this.onFirstDataRendered(); });\n };\n ColumnModel.prototype.buildAutoGroupColumns = function (source) {\n // Possible for update to be called before columns are present in which case there is nothing to do here.\n if (!this.columnDefs) {\n return;\n }\n this.autoGroupsNeedBuilding = true;\n this.forceRecreateAutoGroups = true;\n this.updateGridColumns();\n this.updateDisplayedColumns(source);\n };\n ColumnModel.prototype.onAutoGroupColumnDefChanged = function (source) {\n if (this.groupAutoColumns) {\n this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns, source);\n }\n };\n ColumnModel.prototype.onSharedColDefChanged = function (source) {\n if (!this.gridColumns) {\n return;\n }\n // if we aren't going to force, update the auto cols in place\n if (this.groupAutoColumns) {\n this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns, source);\n }\n this.createColumnsFromColumnDefs(true, source);\n };\n ColumnModel.prototype.setColumnDefs = function (columnDefs, source) {\n var colsPreviouslyExisted = !!this.columnDefs;\n this.columnDefs = columnDefs;\n this.createColumnsFromColumnDefs(colsPreviouslyExisted, source);\n };\n ColumnModel.prototype.recreateColumnDefs = function (source) {\n this.onSharedColDefChanged(source);\n };\n ColumnModel.prototype.destroyOldColumns = function (oldTree, newTree) {\n var oldObjectsById = {};\n if (!oldTree) {\n return;\n }\n // add in all old columns to be destroyed\n this.columnUtils.depthFirstOriginalTreeSearch(null, oldTree, function (child) {\n oldObjectsById[child.getInstanceId()] = child;\n });\n // however we don't destroy anything in the new tree. if destroying the grid, there is no new tree\n if (newTree) {\n this.columnUtils.depthFirstOriginalTreeSearch(null, newTree, function (child) {\n oldObjectsById[child.getInstanceId()] = null;\n });\n }\n // what's left can be destroyed\n var colsToDestroy = Object.values(oldObjectsById).filter(function (item) { return item != null; });\n this.destroyBeans(colsToDestroy);\n };\n ColumnModel.prototype.destroyColumns = function () {\n this.destroyOldColumns(this.primaryColumnTree);\n this.destroyOldColumns(this.secondaryBalancedTree);\n this.destroyOldColumns(this.groupAutoColsBalancedTree);\n };\n ColumnModel.prototype.createColumnsFromColumnDefs = function (colsPreviouslyExisted, source) {\n var _this = this;\n // only need to dispatch before/after events if updating columns, never if setting columns for first time\n var dispatchEventsFunc = colsPreviouslyExisted ? this.compareColumnStatesAndDispatchEvents(source) : undefined;\n // always invalidate cache on changing columns, as the column id's for the new columns\n // could overlap with the old id's, so the cache would return old values for new columns.\n this.valueCache.expire();\n // NOTE ==================\n // we should be destroying the existing columns and groups if they exist, for example, the original column\n // group adds a listener to the columns, it should be also removing the listeners\n this.autoGroupsNeedBuilding = true;\n var oldPrimaryColumns = this.primaryColumns;\n var oldPrimaryTree = this.primaryColumnTree;\n var balancedTreeResult = this.columnFactory.createColumnTree(this.columnDefs, true, oldPrimaryTree, source);\n this.destroyOldColumns(this.primaryColumnTree, balancedTreeResult.columnTree);\n this.primaryColumnTree = balancedTreeResult.columnTree;\n this.primaryHeaderRowCount = balancedTreeResult.treeDept + 1;\n this.primaryColumns = this.getColumnsFromTree(this.primaryColumnTree);\n this.primaryColumnsMap = {};\n this.primaryColumns.forEach(function (col) { return _this.primaryColumnsMap[col.getId()] = col; });\n this.extractRowGroupColumns(source, oldPrimaryColumns);\n this.extractPivotColumns(source, oldPrimaryColumns);\n this.extractValueColumns(source, oldPrimaryColumns);\n this.ready = true;\n // if we are showing secondary columns, then no need to update grid columns\n // unless the auto column needs rebuilt, as it's the pivot service responsibility to change these\n // if we are no longer pivoting (ie and need to revert back to primary, otherwise\n // we shouldn't be touching the primary).\n var gridColsNotProcessed = this.gridColsArePrimary === undefined;\n var processGridCols = this.gridColsArePrimary || gridColsNotProcessed || this.autoGroupsNeedBuilding;\n if (processGridCols) {\n this.updateGridColumns();\n if (colsPreviouslyExisted && this.gridColsArePrimary && !this.gridOptionsService.get('maintainColumnOrder')) {\n this.orderGridColumnsLikePrimary();\n }\n this.updateDisplayedColumns(source);\n this.checkViewportColumns();\n }\n // this event is not used by AG Grid, but left here for backwards compatibility,\n // in case applications use it\n this.dispatchEverythingChanged(source);\n // Row Models react to all of these events as well as new columns loaded,\n // this flag instructs row model to ignore these events to reduce refreshes.\n this.changeEventsDispatching = true;\n if (dispatchEventsFunc) {\n dispatchEventsFunc();\n }\n this.changeEventsDispatching = false;\n this.dispatchNewColumnsLoaded(source);\n };\n ColumnModel.prototype.shouldRowModelIgnoreRefresh = function () {\n return this.changeEventsDispatching;\n };\n ColumnModel.prototype.dispatchNewColumnsLoaded = function (source) {\n var newColumnsLoadedEvent = {\n type: Events.EVENT_NEW_COLUMNS_LOADED,\n source: source\n };\n this.eventService.dispatchEvent(newColumnsLoadedEvent);\n if (source === 'gridInitializing') {\n this.onColumnsReady();\n }\n };\n // this event is legacy, no grid code listens to it. instead the grid listens to New Columns Loaded\n ColumnModel.prototype.dispatchEverythingChanged = function (source) {\n var eventEverythingChanged = {\n type: Events.EVENT_COLUMN_EVERYTHING_CHANGED,\n source: source\n };\n this.eventService.dispatchEvent(eventEverythingChanged);\n };\n ColumnModel.prototype.orderGridColumnsLikePrimary = function () {\n var _this = this;\n var primaryColumns = this.primaryColumns;\n if (!primaryColumns) {\n return;\n }\n var primaryColsOrdered = primaryColumns.filter(function (col) { return _this.gridColumns.indexOf(col) >= 0; });\n var otherCols = this.gridColumns.filter(function (col) { return primaryColsOrdered.indexOf(col) < 0; });\n this.gridColumns = __spreadArray$s(__spreadArray$s([], __read$A(otherCols), false), __read$A(primaryColsOrdered), false);\n this.gridColumns = this.placeLockedColumns(this.gridColumns);\n };\n ColumnModel.prototype.getAllDisplayedAutoHeightCols = function () {\n return this.displayedAutoHeightCols;\n };\n ColumnModel.prototype.setViewport = function () {\n if (this.gridOptionsService.get('enableRtl')) {\n this.viewportLeft = this.bodyWidth - this.scrollPosition - this.scrollWidth;\n this.viewportRight = this.bodyWidth - this.scrollPosition;\n }\n else {\n this.viewportLeft = this.scrollPosition;\n this.viewportRight = this.scrollWidth + this.scrollPosition;\n }\n };\n // used by clipboard service, to know what columns to paste into\n ColumnModel.prototype.getDisplayedColumnsStartingAt = function (column) {\n var currentColumn = column;\n var columns = [];\n while (currentColumn != null) {\n columns.push(currentColumn);\n currentColumn = this.getDisplayedColAfter(currentColumn);\n }\n return columns;\n };\n // checks what columns are currently displayed due to column virtualisation. dispatches an event\n // if the list of columns has changed.\n // + setColumnWidth(), setViewportPosition(), setColumnDefs(), sizeColumnsToFit()\n ColumnModel.prototype.checkViewportColumns = function (afterScroll) {\n if (afterScroll === void 0) { afterScroll = false; }\n // check displayCenterColumnTree exists first, as it won't exist when grid is initialising\n if (this.displayedColumnsCenter == null) {\n return;\n }\n var viewportColumnsChanged = this.extractViewport();\n if (!viewportColumnsChanged) {\n return;\n }\n var event = {\n type: Events.EVENT_VIRTUAL_COLUMNS_CHANGED,\n afterScroll: afterScroll,\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.setViewportPosition = function (scrollWidth, scrollPosition, afterScroll) {\n if (afterScroll === void 0) { afterScroll = false; }\n if (scrollWidth !== this.scrollWidth || scrollPosition !== this.scrollPosition || this.bodyWidthDirty) {\n this.scrollWidth = scrollWidth;\n this.scrollPosition = scrollPosition;\n // we need to call setVirtualViewportLeftAndRight() at least once after the body width changes,\n // as the viewport can stay the same, but in RTL, if body width changes, we need to work out the\n // virtual columns again\n this.bodyWidthDirty = true;\n this.setViewport();\n if (this.ready) {\n this.checkViewportColumns(afterScroll);\n }\n }\n };\n ColumnModel.prototype.isPivotMode = function () {\n return this.pivotMode;\n };\n ColumnModel.prototype.isPivotSettingAllowed = function (pivot) {\n if (pivot && this.gridOptionsService.get('treeData')) {\n console.warn(\"AG Grid: Pivot mode not available in conjunction Tree Data i.e. 'gridOptions.treeData: true'\");\n return false;\n }\n return true;\n };\n ColumnModel.prototype.setPivotMode = function (pivotMode, source) {\n if (pivotMode === this.pivotMode || !this.isPivotSettingAllowed(this.pivotMode)) {\n return;\n }\n this.pivotMode = pivotMode;\n if (!this.gridColumns) {\n return;\n }\n // we need to update grid columns to cover the scenario where user has groupDisplayType = 'custom', as\n // this means we don't use auto group column UNLESS we are in pivot mode (it's mandatory in pivot mode),\n // so need to updateGridColumn() to check it autoGroupCol needs to be added / removed\n this.autoGroupsNeedBuilding = true;\n this.updateGridColumns();\n this.updateDisplayedColumns(source);\n var event = {\n type: Events.EVENT_COLUMN_PIVOT_MODE_CHANGED\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.getSecondaryPivotColumn = function (pivotKeys, valueColKey) {\n if (missing(this.secondaryColumns)) {\n return null;\n }\n var valueColumnToFind = this.getPrimaryColumn(valueColKey);\n var foundColumn = null;\n this.secondaryColumns.forEach(function (column) {\n var thisPivotKeys = column.getColDef().pivotKeys;\n var pivotValueColumn = column.getColDef().pivotValueColumn;\n var pivotKeyMatches = areEqual(thisPivotKeys, pivotKeys);\n var pivotValueMatches = pivotValueColumn === valueColumnToFind;\n if (pivotKeyMatches && pivotValueMatches) {\n foundColumn = column;\n }\n });\n return foundColumn;\n };\n ColumnModel.prototype.setBeans = function (loggerFactory) {\n this.logger = loggerFactory.create('columnModel');\n };\n ColumnModel.prototype.setFirstRightAndLastLeftPinned = function (source) {\n var lastLeft;\n var firstRight;\n if (this.gridOptionsService.get('enableRtl')) {\n lastLeft = this.displayedColumnsLeft ? this.displayedColumnsLeft[0] : null;\n firstRight = this.displayedColumnsRight ? last(this.displayedColumnsRight) : null;\n }\n else {\n lastLeft = this.displayedColumnsLeft ? last(this.displayedColumnsLeft) : null;\n firstRight = this.displayedColumnsRight ? this.displayedColumnsRight[0] : null;\n }\n this.gridColumns.forEach(function (column) {\n column.setLastLeftPinned(column === lastLeft, source);\n column.setFirstRightPinned(column === firstRight, source);\n });\n };\n ColumnModel.prototype.autoSizeColumns = function (params) {\n var _this = this;\n if (this.shouldQueueResizeOperations) {\n this.resizeOperationQueue.push(function () { return _this.autoSizeColumns(params); });\n return;\n }\n var columns = params.columns, skipHeader = params.skipHeader, skipHeaderGroups = params.skipHeaderGroups, stopAtGroup = params.stopAtGroup, _a = params.source, source = _a === void 0 ? 'api' : _a;\n // because of column virtualisation, we can only do this function on columns that are\n // actually rendered, as non-rendered columns (outside the viewport and not rendered\n // due to column virtualisation) are not present. this can result in all rendered columns\n // getting narrowed, which in turn introduces more rendered columns on the RHS which\n // did not get autosized in the original run, leaving the visible grid with columns on\n // the LHS sized, but RHS no. so we keep looping through the visible columns until\n // no more cols are available (rendered) to be resized\n // we autosize after animation frames finish in case any cell renderers need to complete first. this can\n // happen eg if client code is calling api.autoSizeAllColumns() straight after grid is initialised, but grid\n // hasn't fully drawn out all the cells yet (due to cell renderers in animation frames).\n this.animationFrameService.flushAllFrames();\n // keep track of which cols we have resized in here\n var columnsAutosized = [];\n // initialise with anything except 0 so that while loop executes at least once\n var changesThisTimeAround = -1;\n var shouldSkipHeader = skipHeader != null ? skipHeader : this.gridOptionsService.get('skipHeaderOnAutoSize');\n var shouldSkipHeaderGroups = skipHeaderGroups != null ? skipHeaderGroups : shouldSkipHeader;\n while (changesThisTimeAround !== 0) {\n changesThisTimeAround = 0;\n this.actionOnGridColumns(columns, function (column) {\n // if already autosized, skip it\n if (columnsAutosized.indexOf(column) >= 0) {\n return false;\n }\n // get how wide this col should be\n var preferredWidth = _this.autoWidthCalculator.getPreferredWidthForColumn(column, shouldSkipHeader);\n // preferredWidth = -1 if this col is not on the screen\n if (preferredWidth > 0) {\n var newWidth = _this.normaliseColumnWidth(column, preferredWidth);\n column.setActualWidth(newWidth, source);\n columnsAutosized.push(column);\n changesThisTimeAround++;\n }\n return true;\n }, source);\n }\n if (!shouldSkipHeaderGroups) {\n this.autoSizeColumnGroupsByColumns(columns, source, stopAtGroup);\n }\n this.dispatchColumnResizedEvent(columnsAutosized, true, 'autosizeColumns');\n };\n ColumnModel.prototype.dispatchColumnResizedEvent = function (columns, finished, source, flexColumns) {\n if (flexColumns === void 0) { flexColumns = null; }\n if (columns && columns.length) {\n var event_1 = {\n type: Events.EVENT_COLUMN_RESIZED,\n columns: columns,\n column: columns.length === 1 ? columns[0] : null,\n flexColumns: flexColumns,\n finished: finished,\n source: source\n };\n this.eventService.dispatchEvent(event_1);\n }\n };\n ColumnModel.prototype.dispatchColumnChangedEvent = function (type, columns, source) {\n var event = {\n type: type,\n columns: columns,\n column: (columns && columns.length == 1) ? columns[0] : null,\n source: source\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.dispatchColumnMovedEvent = function (params) {\n var movedColumns = params.movedColumns, source = params.source, toIndex = params.toIndex, finished = params.finished;\n var event = {\n type: Events.EVENT_COLUMN_MOVED,\n columns: movedColumns,\n column: movedColumns && movedColumns.length === 1 ? movedColumns[0] : null,\n toIndex: toIndex,\n finished: finished,\n source: source\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.dispatchColumnPinnedEvent = function (changedColumns, source) {\n if (!changedColumns.length) {\n return;\n }\n // if just one column, we use this, otherwise we don't include the col\n var column = changedColumns.length === 1 ? changedColumns[0] : null;\n // only include visible if it's common in all columns\n var pinned = this.getCommonValue(changedColumns, function (col) { return col.getPinned(); });\n var event = {\n type: Events.EVENT_COLUMN_PINNED,\n // mistake in typing, 'undefined' should be allowed, as 'null' means 'not pinned'\n pinned: pinned != null ? pinned : null,\n columns: changedColumns,\n column: column,\n source: source\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.dispatchColumnVisibleEvent = function (changedColumns, source) {\n if (!changedColumns.length) {\n return;\n }\n // if just one column, we use this, otherwise we don't include the col\n var column = changedColumns.length === 1 ? changedColumns[0] : null;\n // only include visible if it's common in all columns\n var visible = this.getCommonValue(changedColumns, function (col) { return col.isVisible(); });\n var event = {\n type: Events.EVENT_COLUMN_VISIBLE,\n visible: visible,\n columns: changedColumns,\n column: column,\n source: source\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.autoSizeColumn = function (key, source, skipHeader) {\n if (key) {\n this.autoSizeColumns({ columns: [key], skipHeader: skipHeader, skipHeaderGroups: true, source: source });\n }\n };\n ColumnModel.prototype.autoSizeColumnGroupsByColumns = function (keys, source, stopAtGroup) {\n var e_1, _a, e_2, _b;\n var columnGroups = new Set();\n var columns = this.getGridColumns(keys);\n columns.forEach(function (col) {\n var parent = col.getParent();\n while (parent && parent != stopAtGroup) {\n if (!parent.isPadding()) {\n columnGroups.add(parent);\n }\n parent = parent.getParent();\n }\n });\n var headerGroupCtrl;\n var resizedColumns = [];\n try {\n for (var columnGroups_1 = __values$a(columnGroups), columnGroups_1_1 = columnGroups_1.next(); !columnGroups_1_1.done; columnGroups_1_1 = columnGroups_1.next()) {\n var columnGroup = columnGroups_1_1.value;\n try {\n for (var _c = (e_2 = void 0, __values$a(this.ctrlsService.getHeaderRowContainerCtrls())), _d = _c.next(); !_d.done; _d = _c.next()) {\n var headerContainerCtrl = _d.value;\n headerGroupCtrl = headerContainerCtrl.getHeaderCtrlForColumn(columnGroup);\n if (headerGroupCtrl) {\n break;\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\n }\n finally { if (e_2) throw e_2.error; }\n }\n if (headerGroupCtrl) {\n headerGroupCtrl.resizeLeafColumnsToFit(source);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (columnGroups_1_1 && !columnGroups_1_1.done && (_a = columnGroups_1.return)) _a.call(columnGroups_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return resizedColumns;\n };\n ColumnModel.prototype.autoSizeAllColumns = function (source, skipHeader) {\n var _this = this;\n if (this.shouldQueueResizeOperations) {\n this.resizeOperationQueue.push(function () { return _this.autoSizeAllColumns(source, skipHeader); });\n return;\n }\n var allDisplayedColumns = this.getAllDisplayedColumns();\n this.autoSizeColumns({ columns: allDisplayedColumns, skipHeader: skipHeader, source: source });\n };\n // Possible candidate for reuse (alot of recursive traversal duplication)\n ColumnModel.prototype.getColumnsFromTree = function (rootColumns) {\n var result = [];\n var recursiveFindColumns = function (childColumns) {\n for (var i = 0; i < childColumns.length; i++) {\n var child = childColumns[i];\n if (child instanceof Column) {\n result.push(child);\n }\n else if (child instanceof ProvidedColumnGroup) {\n recursiveFindColumns(child.getChildren());\n }\n }\n };\n recursiveFindColumns(rootColumns);\n return result;\n };\n ColumnModel.prototype.getAllDisplayedTrees = function () {\n if (this.displayedTreeLeft && this.displayedTreeRight && this.displayedTreeCentre) {\n return this.displayedTreeLeft\n .concat(this.displayedTreeCentre)\n .concat(this.displayedTreeRight);\n }\n return null;\n };\n // + columnSelectPanel\n ColumnModel.prototype.getPrimaryColumnTree = function () {\n return this.primaryColumnTree;\n };\n // + gridPanel -> for resizing the body and setting top margin\n ColumnModel.prototype.getHeaderRowCount = function () {\n return this.gridHeaderRowCount;\n };\n // + headerRenderer -> setting pinned body width\n ColumnModel.prototype.getDisplayedTreeLeft = function () {\n return this.displayedTreeLeft;\n };\n // + headerRenderer -> setting pinned body width\n ColumnModel.prototype.getDisplayedTreeRight = function () {\n return this.displayedTreeRight;\n };\n // + headerRenderer -> setting pinned body width\n ColumnModel.prototype.getDisplayedTreeCentre = function () {\n return this.displayedTreeCentre;\n };\n // gridPanel -> ensureColumnVisible\n ColumnModel.prototype.isColumnDisplayed = function (column) {\n return this.getAllDisplayedColumns().indexOf(column) >= 0;\n };\n // + csvCreator\n ColumnModel.prototype.getAllDisplayedColumns = function () {\n return this.displayedColumns;\n };\n ColumnModel.prototype.getViewportColumns = function () {\n return this.viewportColumns;\n };\n ColumnModel.prototype.getDisplayedLeftColumnsForRow = function (rowNode) {\n if (!this.colSpanActive) {\n return this.displayedColumnsLeft;\n }\n return this.getDisplayedColumnsForRow(rowNode, this.displayedColumnsLeft);\n };\n ColumnModel.prototype.getDisplayedRightColumnsForRow = function (rowNode) {\n if (!this.colSpanActive) {\n return this.displayedColumnsRight;\n }\n return this.getDisplayedColumnsForRow(rowNode, this.displayedColumnsRight);\n };\n ColumnModel.prototype.isColSpanActive = function () {\n return this.colSpanActive;\n };\n ColumnModel.prototype.getDisplayedColumnsForRow = function (rowNode, displayedColumns, filterCallback, emptySpaceBeforeColumn) {\n var result = [];\n var lastConsideredCol = null;\n var _loop_1 = function (i) {\n var col = displayedColumns[i];\n var maxAllowedColSpan = displayedColumns.length - i;\n var colSpan = Math.min(col.getColSpan(rowNode), maxAllowedColSpan);\n var columnsToCheckFilter = [col];\n if (colSpan > 1) {\n var colsToRemove = colSpan - 1;\n for (var j = 1; j <= colsToRemove; j++) {\n columnsToCheckFilter.push(displayedColumns[i + j]);\n }\n i += colsToRemove;\n }\n // see which cols we should take out for column virtualisation\n var filterPasses;\n if (filterCallback) {\n // if user provided a callback, means some columns may not be in the viewport.\n // the user will NOT provide a callback if we are talking about pinned areas,\n // as pinned areas have no horizontal scroll and do not virtualise the columns.\n // if lots of columns, that means column spanning, and we set filterPasses = true\n // if one or more of the columns spanned pass the filter.\n filterPasses = false;\n columnsToCheckFilter.forEach(function (colForFilter) {\n if (filterCallback(colForFilter)) {\n filterPasses = true;\n }\n });\n }\n else {\n filterPasses = true;\n }\n if (filterPasses) {\n if (result.length === 0 && lastConsideredCol) {\n var gapBeforeColumn = emptySpaceBeforeColumn ? emptySpaceBeforeColumn(col) : false;\n if (gapBeforeColumn) {\n result.push(lastConsideredCol);\n }\n }\n result.push(col);\n }\n lastConsideredCol = col;\n out_i_1 = i;\n };\n var out_i_1;\n for (var i = 0; i < displayedColumns.length; i++) {\n _loop_1(i);\n i = out_i_1;\n }\n return result;\n };\n // + rowRenderer\n // if we are not column spanning, this just returns back the virtual centre columns,\n // however if we are column spanning, then different rows can have different virtual\n // columns, so we have to work out the list for each individual row.\n ColumnModel.prototype.getViewportCenterColumnsForRow = function (rowNode) {\n var _this = this;\n if (!this.colSpanActive) {\n return this.viewportColumnsCenter;\n }\n var emptySpaceBeforeColumn = function (col) {\n var left = col.getLeft();\n return exists(left) && left > _this.viewportLeft;\n };\n // if doing column virtualisation, then we filter based on the viewport.\n var filterCallback = this.isColumnVirtualisationSuppressed() ? null : this.isColumnInRowViewport.bind(this);\n return this.getDisplayedColumnsForRow(rowNode, this.displayedColumnsCenter, filterCallback, emptySpaceBeforeColumn);\n };\n ColumnModel.prototype.isColumnAtEdge = function (col, edge) {\n var allColumns = this.getAllDisplayedColumns();\n if (!allColumns.length) {\n return false;\n }\n var isFirst = edge === 'first';\n var columnToCompare;\n if (col instanceof ColumnGroup) {\n var leafColumns = col.getDisplayedLeafColumns();\n if (!leafColumns.length) {\n return false;\n }\n columnToCompare = isFirst ? leafColumns[0] : last(leafColumns);\n }\n else {\n columnToCompare = col;\n }\n return (isFirst ? allColumns[0] : last(allColumns)) === columnToCompare;\n };\n ColumnModel.prototype.getAriaColumnIndex = function (col) {\n var targetColumn;\n if (col instanceof ColumnGroup) {\n targetColumn = col.getLeafColumns()[0];\n }\n else {\n targetColumn = col;\n }\n return this.ariaOrderColumns.indexOf(targetColumn) + 1;\n };\n ColumnModel.prototype.isColumnInHeaderViewport = function (col) {\n // for headers, we never filter out autoHeaderHeight columns, if calculating\n if (col.isAutoHeaderHeight()) {\n return true;\n }\n return this.isColumnInRowViewport(col);\n };\n ColumnModel.prototype.isColumnInRowViewport = function (col) {\n // we never filter out autoHeight columns, as we need them in the DOM for calculating Auto Height\n if (col.isAutoHeight()) {\n return true;\n }\n var columnLeft = col.getLeft() || 0;\n var columnRight = columnLeft + col.getActualWidth();\n // adding 200 for buffer size, so some cols off viewport are rendered.\n // this helps horizontal scrolling so user rarely sees white space (unless\n // they scroll horizontally fast). however we are conservative, as the more\n // buffer the slower the vertical redraw speed\n var leftBounds = this.viewportLeft - 200;\n var rightBounds = this.viewportRight + 200;\n var columnToMuchLeft = columnLeft < leftBounds && columnRight < leftBounds;\n var columnToMuchRight = columnLeft > rightBounds && columnRight > rightBounds;\n return !columnToMuchLeft && !columnToMuchRight;\n };\n // used by:\n // + angularGrid -> setting pinned body width\n // note: this should be cached\n ColumnModel.prototype.getDisplayedColumnsLeftWidth = function () {\n return this.getWidthOfColsInList(this.displayedColumnsLeft);\n };\n // note: this should be cached\n ColumnModel.prototype.getDisplayedColumnsRightWidth = function () {\n return this.getWidthOfColsInList(this.displayedColumnsRight);\n };\n ColumnModel.prototype.updatePrimaryColumnList = function (keys, masterList, actionIsAdd, columnCallback, eventType, source) {\n var _this = this;\n if (!keys || missingOrEmpty(keys)) {\n return;\n }\n var atLeastOne = false;\n keys.forEach(function (key) {\n if (!key) {\n return;\n }\n var columnToAdd = _this.getPrimaryColumn(key);\n if (!columnToAdd) {\n return;\n }\n if (actionIsAdd) {\n if (masterList.indexOf(columnToAdd) >= 0) {\n return;\n }\n masterList.push(columnToAdd);\n }\n else {\n if (masterList.indexOf(columnToAdd) < 0) {\n return;\n }\n removeFromArray(masterList, columnToAdd);\n }\n columnCallback(columnToAdd);\n atLeastOne = true;\n });\n if (!atLeastOne) {\n return;\n }\n if (this.autoGroupsNeedBuilding) {\n this.updateGridColumns();\n }\n this.updateDisplayedColumns(source);\n var event = {\n type: eventType,\n columns: masterList,\n column: masterList.length === 1 ? masterList[0] : null,\n source: source\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.setRowGroupColumns = function (colKeys, source) {\n this.autoGroupsNeedBuilding = true;\n this.setPrimaryColumnList(colKeys, this.rowGroupColumns, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, true, this.setRowGroupActive.bind(this), source);\n };\n ColumnModel.prototype.setRowGroupActive = function (active, column, source) {\n if (active === column.isRowGroupActive()) {\n return;\n }\n column.setRowGroupActive(active, source);\n if (active && !this.gridOptionsService.get('suppressRowGroupHidesColumns')) {\n this.setColumnsVisible([column], false, source);\n }\n if (!active && !this.gridOptionsService.get('suppressMakeColumnVisibleAfterUnGroup')) {\n this.setColumnsVisible([column], true, source);\n }\n };\n ColumnModel.prototype.addRowGroupColumns = function (keys, source) {\n this.autoGroupsNeedBuilding = true;\n this.updatePrimaryColumnList(keys, this.rowGroupColumns, true, this.setRowGroupActive.bind(this, true), Events.EVENT_COLUMN_ROW_GROUP_CHANGED, source);\n };\n ColumnModel.prototype.removeRowGroupColumns = function (keys, source) {\n this.autoGroupsNeedBuilding = true;\n this.updatePrimaryColumnList(keys, this.rowGroupColumns, false, this.setRowGroupActive.bind(this, false), Events.EVENT_COLUMN_ROW_GROUP_CHANGED, source);\n };\n ColumnModel.prototype.addPivotColumns = function (keys, source) {\n this.updatePrimaryColumnList(keys, this.pivotColumns, true, function (column) { return column.setPivotActive(true, source); }, Events.EVENT_COLUMN_PIVOT_CHANGED, source);\n };\n ColumnModel.prototype.setPivotColumns = function (colKeys, source) {\n this.setPrimaryColumnList(colKeys, this.pivotColumns, Events.EVENT_COLUMN_PIVOT_CHANGED, true, function (added, column) {\n column.setPivotActive(added, source);\n }, source);\n };\n ColumnModel.prototype.removePivotColumns = function (keys, source) {\n this.updatePrimaryColumnList(keys, this.pivotColumns, false, function (column) { return column.setPivotActive(false, source); }, Events.EVENT_COLUMN_PIVOT_CHANGED, source);\n };\n ColumnModel.prototype.setPrimaryColumnList = function (colKeys, masterList, eventName, detectOrderChange, columnCallback, source) {\n var _this = this;\n if (!this.gridColumns) {\n return;\n }\n var changes = new Map();\n // store all original cols and their index.\n masterList.forEach(function (col, idx) { return changes.set(col, idx); });\n masterList.length = 0;\n if (exists(colKeys)) {\n colKeys.forEach(function (key) {\n var column = _this.getPrimaryColumn(key);\n if (column) {\n masterList.push(column);\n }\n });\n }\n masterList.forEach(function (col, idx) {\n var oldIndex = changes.get(col);\n // if the column was not in the list, we add it as it's a change\n // idx is irrelevant now.\n if (oldIndex === undefined) {\n changes.set(col, 0);\n return;\n }\n if (detectOrderChange && oldIndex !== idx) {\n // if we're detecting order changes, and the indexes differ, we retain this as it's changed\n return;\n }\n // otherwise remove this col, as it's unchanged.\n changes.delete(col);\n });\n (this.primaryColumns || []).forEach(function (column) {\n var added = masterList.indexOf(column) >= 0;\n columnCallback(added, column);\n });\n if (this.autoGroupsNeedBuilding) {\n this.updateGridColumns();\n }\n this.updateDisplayedColumns(source);\n this.dispatchColumnChangedEvent(eventName, __spreadArray$s([], __read$A(changes.keys()), false), source);\n };\n ColumnModel.prototype.setValueColumns = function (colKeys, source) {\n this.setPrimaryColumnList(colKeys, this.valueColumns, Events.EVENT_COLUMN_VALUE_CHANGED, false, this.setValueActive.bind(this), source);\n };\n ColumnModel.prototype.setValueActive = function (active, column, source) {\n if (active === column.isValueActive()) {\n return;\n }\n column.setValueActive(active, source);\n if (active && !column.getAggFunc()) {\n var initialAggFunc = this.aggFuncService.getDefaultAggFunc(column);\n column.setAggFunc(initialAggFunc);\n }\n };\n ColumnModel.prototype.addValueColumns = function (keys, source) {\n this.updatePrimaryColumnList(keys, this.valueColumns, true, this.setValueActive.bind(this, true), Events.EVENT_COLUMN_VALUE_CHANGED, source);\n };\n ColumnModel.prototype.removeValueColumns = function (keys, source) {\n this.updatePrimaryColumnList(keys, this.valueColumns, false, this.setValueActive.bind(this, false), Events.EVENT_COLUMN_VALUE_CHANGED, source);\n };\n // returns the width we can set to this col, taking into consideration min and max widths\n ColumnModel.prototype.normaliseColumnWidth = function (column, newWidth) {\n var minWidth = column.getMinWidth();\n if (exists(minWidth) && newWidth < minWidth) {\n newWidth = minWidth;\n }\n var maxWidth = column.getMaxWidth();\n if (exists(maxWidth) && column.isGreaterThanMax(newWidth)) {\n newWidth = maxWidth;\n }\n return newWidth;\n };\n ColumnModel.prototype.getPrimaryOrGridColumn = function (key) {\n var column = this.getPrimaryColumn(key);\n return column || this.getGridColumn(key);\n };\n ColumnModel.prototype.setColumnWidths = function (columnWidths, shiftKey, // @takeFromAdjacent - if user has 'shift' pressed, then pixels are taken from adjacent column\n finished, // @finished - ends up in the event, tells the user if more events are to come\n source) {\n var _this = this;\n var sets = [];\n columnWidths.forEach(function (columnWidth) {\n var col = _this.getPrimaryOrGridColumn(columnWidth.key);\n if (!col) {\n return;\n }\n sets.push({\n width: columnWidth.newWidth,\n ratios: [1],\n columns: [col]\n });\n // if user wants to do shift resize by default, then we invert the shift operation\n var defaultIsShift = _this.gridOptionsService.get('colResizeDefault') === 'shift';\n if (defaultIsShift) {\n shiftKey = !shiftKey;\n }\n if (shiftKey) {\n var otherCol = _this.getDisplayedColAfter(col);\n if (!otherCol) {\n return;\n }\n var widthDiff = col.getActualWidth() - columnWidth.newWidth;\n var otherColWidth = otherCol.getActualWidth() + widthDiff;\n sets.push({\n width: otherColWidth,\n ratios: [1],\n columns: [otherCol]\n });\n }\n });\n if (sets.length === 0) {\n return;\n }\n this.resizeColumnSets({\n resizeSets: sets,\n finished: finished,\n source: source\n });\n };\n ColumnModel.prototype.checkMinAndMaxWidthsForSet = function (columnResizeSet) {\n var columns = columnResizeSet.columns, width = columnResizeSet.width;\n // every col has a min width, so sum them all up and see if we have enough room\n // for all the min widths\n var minWidthAccumulated = 0;\n var maxWidthAccumulated = 0;\n var maxWidthActive = true;\n columns.forEach(function (col) {\n var minWidth = col.getMinWidth();\n minWidthAccumulated += minWidth || 0;\n var maxWidth = col.getMaxWidth();\n if (exists(maxWidth) && maxWidth > 0) {\n maxWidthAccumulated += maxWidth;\n }\n else {\n // if at least one columns has no max width, it means the group of columns\n // then has no max width, as at least one column can take as much width as possible\n maxWidthActive = false;\n }\n });\n var minWidthPasses = width >= minWidthAccumulated;\n var maxWidthPasses = !maxWidthActive || (width <= maxWidthAccumulated);\n return minWidthPasses && maxWidthPasses;\n };\n // method takes sets of columns and resizes them. either all sets will be resized, or nothing\n // be resized. this is used for example when user tries to resize a group and holds shift key,\n // then both the current group (grows), and the adjacent group (shrinks), will get resized,\n // so that's two sets for this method.\n ColumnModel.prototype.resizeColumnSets = function (params) {\n var _this = this;\n var resizeSets = params.resizeSets, finished = params.finished, source = params.source;\n var passMinMaxCheck = !resizeSets || resizeSets.every(function (columnResizeSet) { return _this.checkMinAndMaxWidthsForSet(columnResizeSet); });\n if (!passMinMaxCheck) {\n // even though we are not going to resize beyond min/max size, we still need to dispatch event when finished\n if (finished) {\n var columns = resizeSets && resizeSets.length > 0 ? resizeSets[0].columns : null;\n this.dispatchColumnResizedEvent(columns, finished, source);\n }\n return; // don't resize!\n }\n var changedCols = [];\n var allResizedCols = [];\n resizeSets.forEach(function (set) {\n var width = set.width, columns = set.columns, ratios = set.ratios;\n // keep track of pixels used, and last column gets the remaining,\n // to cater for rounding errors, and min width adjustments\n var newWidths = {};\n var finishedCols = {};\n columns.forEach(function (col) { return allResizedCols.push(col); });\n // the loop below goes through each col. if a col exceeds it's min/max width,\n // it then gets set to its min/max width and the column is removed marked as 'finished'\n // and the calculation is done again leaving this column out. take for example columns\n // {A, width: 50, maxWidth: 100}\n // {B, width: 50}\n // {C, width: 50}\n // and then the set is set to width 600 - on the first pass the grid tries to set each column\n // to 200. it checks A and sees 200 > 100 and so sets the width to 100. col A is then marked\n // as 'finished' and the calculation is done again with the remaining cols B and C, which end up\n // splitting the remaining 500 pixels.\n var finishedColsGrew = true;\n var loopCount = 0;\n var _loop_2 = function () {\n loopCount++;\n if (loopCount > 1000) {\n // this should never happen, but in the future, someone might introduce a bug here,\n // so we stop the browser from hanging and report bug properly\n console.error('AG Grid: infinite loop in resizeColumnSets');\n return \"break\";\n }\n finishedColsGrew = false;\n var subsetCols = [];\n var subsetRatioTotal = 0;\n var pixelsToDistribute = width;\n columns.forEach(function (col, index) {\n var thisColFinished = finishedCols[col.getId()];\n if (thisColFinished) {\n pixelsToDistribute -= newWidths[col.getId()];\n }\n else {\n subsetCols.push(col);\n var ratioThisCol = ratios[index];\n subsetRatioTotal += ratioThisCol;\n }\n });\n // because we are not using all of the ratios (cols can be missing),\n // we scale the ratio. if all columns are included, then subsetRatioTotal=1,\n // and so the ratioScale will be 1.\n var ratioScale = 1 / subsetRatioTotal;\n subsetCols.forEach(function (col, index) {\n var lastCol = index === (subsetCols.length - 1);\n var colNewWidth;\n if (lastCol) {\n colNewWidth = pixelsToDistribute;\n }\n else {\n colNewWidth = Math.round(ratios[index] * width * ratioScale);\n pixelsToDistribute -= colNewWidth;\n }\n var minWidth = col.getMinWidth();\n var maxWidth = col.getMaxWidth();\n if (exists(minWidth) && colNewWidth < minWidth) {\n colNewWidth = minWidth;\n finishedCols[col.getId()] = true;\n finishedColsGrew = true;\n }\n else if (exists(maxWidth) && maxWidth > 0 && colNewWidth > maxWidth) {\n colNewWidth = maxWidth;\n finishedCols[col.getId()] = true;\n finishedColsGrew = true;\n }\n newWidths[col.getId()] = colNewWidth;\n });\n };\n while (finishedColsGrew) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n columns.forEach(function (col) {\n var newWidth = newWidths[col.getId()];\n var actualWidth = col.getActualWidth();\n if (actualWidth !== newWidth) {\n col.setActualWidth(newWidth, source);\n changedCols.push(col);\n }\n });\n });\n // if no cols changed, then no need to update more or send event.\n var atLeastOneColChanged = changedCols.length > 0;\n var flexedCols = [];\n if (atLeastOneColChanged) {\n flexedCols = this.refreshFlexedColumns({ resizingCols: allResizedCols, skipSetLeft: true });\n this.setLeftValues(source);\n this.updateBodyWidths();\n this.checkViewportColumns();\n }\n // check for change first, to avoid unnecessary firing of events\n // however we always dispatch 'finished' events. this is important\n // when groups are resized, as if the group is changing slowly,\n // eg 1 pixel at a time, then each change will dispatch change events\n // in all the columns in the group, but only one with get the pixel.\n var colsForEvent = allResizedCols.concat(flexedCols);\n if (atLeastOneColChanged || finished) {\n this.dispatchColumnResizedEvent(colsForEvent, finished, source, flexedCols);\n }\n };\n ColumnModel.prototype.setColumnAggFunc = function (key, aggFunc, source) {\n if (!key) {\n return;\n }\n var column = this.getPrimaryColumn(key);\n if (!column) {\n return;\n }\n column.setAggFunc(aggFunc);\n this.dispatchColumnChangedEvent(Events.EVENT_COLUMN_VALUE_CHANGED, [column], source);\n };\n ColumnModel.prototype.moveRowGroupColumn = function (fromIndex, toIndex, source) {\n if (this.isRowGroupEmpty()) {\n return;\n }\n var column = this.rowGroupColumns[fromIndex];\n var impactedColumns = this.rowGroupColumns.slice(fromIndex, toIndex);\n this.rowGroupColumns.splice(fromIndex, 1);\n this.rowGroupColumns.splice(toIndex, 0, column);\n var event = {\n type: Events.EVENT_COLUMN_ROW_GROUP_CHANGED,\n columns: impactedColumns,\n column: impactedColumns.length === 1 ? impactedColumns[0] : null,\n source: source\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.moveColumns = function (columnsToMoveKeys, toIndex, source, finished) {\n if (finished === void 0) { finished = true; }\n if (!this.gridColumns) {\n return;\n }\n this.columnAnimationService.start();\n if (toIndex > this.gridColumns.length - columnsToMoveKeys.length) {\n console.warn('AG Grid: tried to insert columns in invalid location, toIndex = ' + toIndex);\n console.warn('AG Grid: remember that you should not count the moving columns when calculating the new index');\n return;\n }\n // we want to pull all the columns out first and put them into an ordered list\n var movedColumns = this.getGridColumns(columnsToMoveKeys);\n var failedRules = !this.doesMovePassRules(movedColumns, toIndex);\n if (failedRules) {\n return;\n }\n moveInArray(this.gridColumns, movedColumns, toIndex);\n this.updateDisplayedColumns(source);\n this.dispatchColumnMovedEvent({ movedColumns: movedColumns, source: source, toIndex: toIndex, finished: finished });\n this.columnAnimationService.finish();\n };\n ColumnModel.prototype.doesMovePassRules = function (columnsToMove, toIndex) {\n // make a copy of what the grid columns would look like after the move\n var proposedColumnOrder = this.getProposedColumnOrder(columnsToMove, toIndex);\n return this.doesOrderPassRules(proposedColumnOrder);\n };\n ColumnModel.prototype.doesOrderPassRules = function (gridOrder) {\n if (!this.doesMovePassMarryChildren(gridOrder)) {\n return false;\n }\n if (!this.doesMovePassLockedPositions(gridOrder)) {\n return false;\n }\n return true;\n };\n ColumnModel.prototype.getProposedColumnOrder = function (columnsToMove, toIndex) {\n var proposedColumnOrder = this.gridColumns.slice();\n moveInArray(proposedColumnOrder, columnsToMove, toIndex);\n return proposedColumnOrder;\n };\n // returns the provided cols sorted in same order as they appear in grid columns. eg if grid columns\n // contains [a,b,c,d,e] and col passed is [e,a] then the passed cols are sorted into [a,e]\n ColumnModel.prototype.sortColumnsLikeGridColumns = function (cols) {\n var _this = this;\n if (!cols || cols.length <= 1) {\n return;\n }\n var notAllColsInGridColumns = cols.filter(function (c) { return _this.gridColumns.indexOf(c) < 0; }).length > 0;\n if (notAllColsInGridColumns) {\n return;\n }\n cols.sort(function (a, b) {\n var indexA = _this.gridColumns.indexOf(a);\n var indexB = _this.gridColumns.indexOf(b);\n return indexA - indexB;\n });\n };\n ColumnModel.prototype.doesMovePassLockedPositions = function (proposedColumnOrder) {\n // Placement is a number indicating 'left' 'center' or 'right' as 0 1 2\n var lastPlacement = 0;\n var rulePassed = true;\n var lockPositionToPlacement = function (position) {\n if (!position) { // false or undefined\n return 1;\n }\n if (position === true) {\n return 0;\n }\n return position === 'left' ? 0 : 2; // Otherwise 'right'\n };\n proposedColumnOrder.forEach(function (col) {\n var placement = lockPositionToPlacement(col.getColDef().lockPosition);\n if (placement < lastPlacement) { // If placement goes down, we're not in the correct order\n rulePassed = false;\n }\n lastPlacement = placement;\n });\n return rulePassed;\n };\n ColumnModel.prototype.doesMovePassMarryChildren = function (allColumnsCopy) {\n var rulePassed = true;\n this.columnUtils.depthFirstOriginalTreeSearch(null, this.gridBalancedTree, function (child) {\n if (!(child instanceof ProvidedColumnGroup)) {\n return;\n }\n var columnGroup = child;\n var colGroupDef = columnGroup.getColGroupDef();\n var marryChildren = colGroupDef && colGroupDef.marryChildren;\n if (!marryChildren) {\n return;\n }\n var newIndexes = [];\n columnGroup.getLeafColumns().forEach(function (col) {\n var newColIndex = allColumnsCopy.indexOf(col);\n newIndexes.push(newColIndex);\n });\n var maxIndex = Math.max.apply(Math, newIndexes);\n var minIndex = Math.min.apply(Math, newIndexes);\n // spread is how far the first column in this group is away from the last column\n var spread = maxIndex - minIndex;\n var maxSpread = columnGroup.getLeafColumns().length - 1;\n // if the columns\n if (spread > maxSpread) {\n rulePassed = false;\n }\n // console.log(`maxIndex = ${maxIndex}, minIndex = ${minIndex}, spread = ${spread}, maxSpread = ${maxSpread}, fail = ${spread > (count-1)}`)\n // console.log(allColumnsCopy.map( col => col.getColDef().field).join(','));\n });\n return rulePassed;\n };\n ColumnModel.prototype.moveColumnByIndex = function (fromIndex, toIndex, source) {\n if (!this.gridColumns) {\n return;\n }\n var column = this.gridColumns[fromIndex];\n this.moveColumns([column], toIndex, source);\n };\n ColumnModel.prototype.getColumnDefs = function () {\n var _this = this;\n if (!this.primaryColumns) {\n return;\n }\n var cols = this.primaryColumns.slice();\n if (this.gridColsArePrimary) {\n cols.sort(function (a, b) { return _this.gridColumns.indexOf(a) - _this.gridColumns.indexOf(b); });\n }\n else if (this.lastPrimaryOrder) {\n cols.sort(function (a, b) { return _this.lastPrimaryOrder.indexOf(a) - _this.lastPrimaryOrder.indexOf(b); });\n }\n return this.columnDefFactory.buildColumnDefs(cols, this.rowGroupColumns, this.pivotColumns);\n };\n // used by:\n // + angularGrid -> for setting body width\n // + rowController -> setting main row widths (when inserting and resizing)\n // need to cache this\n ColumnModel.prototype.getBodyContainerWidth = function () {\n return this.bodyWidth;\n };\n ColumnModel.prototype.getContainerWidth = function (pinned) {\n switch (pinned) {\n case 'left':\n return this.leftWidth;\n case 'right':\n return this.rightWidth;\n default:\n return this.bodyWidth;\n }\n };\n // after setColumnWidth or updateGroupsAndDisplayedColumns\n ColumnModel.prototype.updateBodyWidths = function () {\n var newBodyWidth = this.getWidthOfColsInList(this.displayedColumnsCenter);\n var newLeftWidth = this.getWidthOfColsInList(this.displayedColumnsLeft);\n var newRightWidth = this.getWidthOfColsInList(this.displayedColumnsRight);\n // this is used by virtual col calculation, for RTL only, as a change to body width can impact displayed\n // columns, due to RTL inverting the y coordinates\n this.bodyWidthDirty = this.bodyWidth !== newBodyWidth;\n var atLeastOneChanged = this.bodyWidth !== newBodyWidth || this.leftWidth !== newLeftWidth || this.rightWidth !== newRightWidth;\n if (atLeastOneChanged) {\n this.bodyWidth = newBodyWidth;\n this.leftWidth = newLeftWidth;\n this.rightWidth = newRightWidth;\n // this event is fired to allow the grid viewport to resize before the\n // scrollbar tries to update its visibility.\n var evt = {\n type: Events.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,\n };\n this.eventService.dispatchEvent(evt);\n // when this fires, it is picked up by the gridPanel, which ends up in\n // gridPanel calling setWidthAndScrollPosition(), which in turn calls setViewportPosition()\n var event_2 = {\n type: Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,\n };\n this.eventService.dispatchEvent(event_2);\n }\n };\n // + rowController\n ColumnModel.prototype.getValueColumns = function () {\n return this.valueColumns ? this.valueColumns : [];\n };\n // + rowController\n ColumnModel.prototype.getPivotColumns = function () {\n return this.pivotColumns ? this.pivotColumns : [];\n };\n // + clientSideRowModel\n ColumnModel.prototype.isPivotActive = function () {\n return this.pivotColumns && this.pivotColumns.length > 0 && this.pivotMode;\n };\n // + toolPanel\n ColumnModel.prototype.getRowGroupColumns = function () {\n return this.rowGroupColumns ? this.rowGroupColumns : [];\n };\n // + rowController -> while inserting rows\n ColumnModel.prototype.getDisplayedCenterColumns = function () {\n return this.displayedColumnsCenter;\n };\n // + rowController -> while inserting rows\n ColumnModel.prototype.getDisplayedLeftColumns = function () {\n return this.displayedColumnsLeft;\n };\n ColumnModel.prototype.getDisplayedRightColumns = function () {\n return this.displayedColumnsRight;\n };\n ColumnModel.prototype.getDisplayedColumns = function (type) {\n switch (type) {\n case 'left':\n return this.getDisplayedLeftColumns();\n case 'right':\n return this.getDisplayedRightColumns();\n default:\n return this.getDisplayedCenterColumns();\n }\n };\n // used by:\n // + clientSideRowController -> sorting, building quick filter text\n // + headerRenderer -> sorting (clearing icon)\n ColumnModel.prototype.getAllPrimaryColumns = function () {\n return this.primaryColumns ? this.primaryColumns : null;\n };\n ColumnModel.prototype.getSecondaryColumns = function () {\n return this.secondaryColumns ? this.secondaryColumns : null;\n };\n ColumnModel.prototype.getAllColumnsForQuickFilter = function () {\n return this.columnsForQuickFilter;\n };\n // + moveColumnController\n ColumnModel.prototype.getAllGridColumns = function () {\n var _a;\n return (_a = this.gridColumns) !== null && _a !== void 0 ? _a : [];\n };\n ColumnModel.prototype.isEmpty = function () {\n return missingOrEmpty(this.gridColumns);\n };\n ColumnModel.prototype.isRowGroupEmpty = function () {\n return missingOrEmpty(this.rowGroupColumns);\n };\n ColumnModel.prototype.setColumnsVisible = function (keys, visible, source) {\n if (visible === void 0) { visible = false; }\n this.applyColumnState({\n state: keys.map(function (key) { return ({\n colId: typeof key === 'string' ? key : key.getColId(),\n hide: !visible,\n }); }),\n }, source);\n };\n ColumnModel.prototype.setColumnsPinned = function (keys, pinned, source) {\n if (!this.gridColumns) {\n return;\n }\n if (this.gridOptionsService.isDomLayout('print')) {\n console.warn(\"AG Grid: Changing the column pinning status is not allowed with domLayout='print'\");\n return;\n }\n this.columnAnimationService.start();\n var actualPinned;\n if (pinned === true || pinned === 'left') {\n actualPinned = 'left';\n }\n else if (pinned === 'right') {\n actualPinned = 'right';\n }\n else {\n actualPinned = null;\n }\n this.actionOnGridColumns(keys, function (col) {\n if (col.getPinned() !== actualPinned) {\n col.setPinned(actualPinned);\n return true;\n }\n return false;\n }, source, function () {\n var event = {\n type: Events.EVENT_COLUMN_PINNED,\n pinned: actualPinned,\n column: null,\n columns: null,\n source: source\n };\n return event;\n });\n this.columnAnimationService.finish();\n };\n // does an action on a set of columns. provides common functionality for looking up the\n // columns based on key, getting a list of effected columns, and then updated the event\n // with either one column (if it was just one col) or a list of columns\n // used by: autoResize, setVisible, setPinned\n ColumnModel.prototype.actionOnGridColumns = function (// the column keys this action will be on\n keys, \n // the action to do - if this returns false, the column was skipped\n // and won't be included in the event\n action, \n // should return back a column event of the right type\n source, createEvent) {\n var _this = this;\n if (missingOrEmpty(keys)) {\n return;\n }\n var updatedColumns = [];\n keys.forEach(function (key) {\n if (!key) {\n return;\n }\n var column = _this.getGridColumn(key);\n if (!column) {\n return;\n }\n // need to check for false with type (ie !== instead of !=)\n // as not returning anything (undefined) would also be false\n var resultOfAction = action(column);\n if (resultOfAction !== false) {\n updatedColumns.push(column);\n }\n });\n if (!updatedColumns.length) {\n return;\n }\n this.updateDisplayedColumns(source);\n if (exists(createEvent) && createEvent) {\n var event_3 = createEvent();\n event_3.columns = updatedColumns;\n event_3.column = updatedColumns.length === 1 ? updatedColumns[0] : null;\n this.eventService.dispatchEvent(event_3);\n }\n };\n ColumnModel.prototype.getDisplayedColBefore = function (col) {\n var allDisplayedColumns = this.getAllDisplayedColumns();\n var oldIndex = allDisplayedColumns.indexOf(col);\n if (oldIndex > 0) {\n return allDisplayedColumns[oldIndex - 1];\n }\n return null;\n };\n // used by:\n // + rowRenderer -> for navigation\n ColumnModel.prototype.getDisplayedColAfter = function (col) {\n var allDisplayedColumns = this.getAllDisplayedColumns();\n var oldIndex = allDisplayedColumns.indexOf(col);\n if (oldIndex < (allDisplayedColumns.length - 1)) {\n return allDisplayedColumns[oldIndex + 1];\n }\n return null;\n };\n ColumnModel.prototype.getDisplayedGroupAfter = function (columnGroup) {\n return this.getDisplayedGroupAtDirection(columnGroup, 'After');\n };\n ColumnModel.prototype.getDisplayedGroupBefore = function (columnGroup) {\n return this.getDisplayedGroupAtDirection(columnGroup, 'Before');\n };\n ColumnModel.prototype.getDisplayedGroupAtDirection = function (columnGroup, direction) {\n // pick the last displayed column in this group\n var requiredLevel = columnGroup.getProvidedColumnGroup().getLevel() + columnGroup.getPaddingLevel();\n var colGroupLeafColumns = columnGroup.getDisplayedLeafColumns();\n var col = direction === 'After' ? last(colGroupLeafColumns) : colGroupLeafColumns[0];\n var getDisplayColMethod = \"getDisplayedCol\".concat(direction);\n while (true) {\n // keep moving to the next col, until we get to another group\n var column = this[getDisplayColMethod](col);\n if (!column) {\n return null;\n }\n var groupPointer = this.getColumnGroupAtLevel(column, requiredLevel);\n if (groupPointer !== columnGroup) {\n return groupPointer;\n }\n }\n };\n ColumnModel.prototype.getColumnGroupAtLevel = function (column, level) {\n // get group at same level as the one we are looking for\n var groupPointer = column.getParent();\n var originalGroupLevel;\n var groupPointerLevel;\n while (true) {\n var groupPointerProvidedColumnGroup = groupPointer.getProvidedColumnGroup();\n originalGroupLevel = groupPointerProvidedColumnGroup.getLevel();\n groupPointerLevel = groupPointer.getPaddingLevel();\n if (originalGroupLevel + groupPointerLevel <= level) {\n break;\n }\n groupPointer = groupPointer.getParent();\n }\n return groupPointer;\n };\n ColumnModel.prototype.isPinningLeft = function () {\n return this.displayedColumnsLeft.length > 0;\n };\n ColumnModel.prototype.isPinningRight = function () {\n return this.displayedColumnsRight.length > 0;\n };\n ColumnModel.prototype.getPrimaryAndSecondaryAndAutoColumns = function () {\n var _a;\n return (_a = []).concat.apply(_a, [\n this.primaryColumns || [],\n this.groupAutoColumns || [],\n this.secondaryColumns || [],\n ]);\n };\n ColumnModel.prototype.createStateItemFromColumn = function (column) {\n var rowGroupIndex = column.isRowGroupActive() ? this.rowGroupColumns.indexOf(column) : null;\n var pivotIndex = column.isPivotActive() ? this.pivotColumns.indexOf(column) : null;\n var aggFunc = column.isValueActive() ? column.getAggFunc() : null;\n var sort = column.getSort() != null ? column.getSort() : null;\n var sortIndex = column.getSortIndex() != null ? column.getSortIndex() : null;\n var flex = column.getFlex() != null && column.getFlex() > 0 ? column.getFlex() : null;\n var res = {\n colId: column.getColId(),\n width: column.getActualWidth(),\n hide: !column.isVisible(),\n pinned: column.getPinned(),\n sort: sort,\n sortIndex: sortIndex,\n aggFunc: aggFunc,\n rowGroup: column.isRowGroupActive(),\n rowGroupIndex: rowGroupIndex,\n pivot: column.isPivotActive(),\n pivotIndex: pivotIndex,\n flex: flex\n };\n return res;\n };\n ColumnModel.prototype.getColumnState = function () {\n if (missing(this.primaryColumns) || !this.isAlive()) {\n return [];\n }\n var colsForState = this.getPrimaryAndSecondaryAndAutoColumns();\n var res = colsForState.map(this.createStateItemFromColumn.bind(this));\n this.orderColumnStateList(res);\n return res;\n };\n ColumnModel.prototype.orderColumnStateList = function (columnStateList) {\n // for fast looking, store the index of each column\n var colIdToGridIndexMap = convertToMap(this.gridColumns.map(function (col, index) { return [col.getColId(), index]; }));\n columnStateList.sort(function (itemA, itemB) {\n var posA = colIdToGridIndexMap.has(itemA.colId) ? colIdToGridIndexMap.get(itemA.colId) : -1;\n var posB = colIdToGridIndexMap.has(itemB.colId) ? colIdToGridIndexMap.get(itemB.colId) : -1;\n return posA - posB;\n });\n };\n ColumnModel.prototype.resetColumnState = function (source) {\n var _this = this;\n if (missingOrEmpty(this.primaryColumns)) {\n return;\n }\n // NOTE = there is one bug here that no customer has noticed - if a column has colDef.lockPosition,\n // this is ignored below when ordering the cols. to work, we should always put lockPosition cols first.\n // As a work around, developers should just put lockPosition columns first in their colDef list.\n // we can't use 'allColumns' as the order might of messed up, so get the primary ordered list\n var primaryColumns = this.getColumnsFromTree(this.primaryColumnTree);\n var columnStates = [];\n // we start at 1000, so if user has mix of rowGroup and group specified, it will work with both.\n // eg IF user has ColA.rowGroupIndex=0, ColB.rowGroupIndex=1, ColC.rowGroup=true,\n // THEN result will be ColA.rowGroupIndex=0, ColB.rowGroupIndex=1, ColC.rowGroup=1000\n var letRowGroupIndex = 1000;\n var letPivotIndex = 1000;\n var colsToProcess = [];\n if (this.groupAutoColumns) {\n colsToProcess = colsToProcess.concat(this.groupAutoColumns);\n }\n if (primaryColumns) {\n colsToProcess = colsToProcess.concat(primaryColumns);\n }\n colsToProcess.forEach(function (column) {\n var stateItem = _this.getColumnStateFromColDef(column);\n if (missing(stateItem.rowGroupIndex) && stateItem.rowGroup) {\n stateItem.rowGroupIndex = letRowGroupIndex++;\n }\n if (missing(stateItem.pivotIndex) && stateItem.pivot) {\n stateItem.pivotIndex = letPivotIndex++;\n }\n columnStates.push(stateItem);\n });\n this.applyColumnState({ state: columnStates, applyOrder: true }, source);\n };\n ColumnModel.prototype.getColumnStateFromColDef = function (column) {\n var getValueOrNull = function (a, b) { return a != null ? a : b != null ? b : null; };\n var colDef = column.getColDef();\n var sort = getValueOrNull(colDef.sort, colDef.initialSort);\n var sortIndex = getValueOrNull(colDef.sortIndex, colDef.initialSortIndex);\n var hide = getValueOrNull(colDef.hide, colDef.initialHide);\n var pinned = getValueOrNull(colDef.pinned, colDef.initialPinned);\n var width = getValueOrNull(colDef.width, colDef.initialWidth);\n var flex = getValueOrNull(colDef.flex, colDef.initialFlex);\n var rowGroupIndex = getValueOrNull(colDef.rowGroupIndex, colDef.initialRowGroupIndex);\n var rowGroup = getValueOrNull(colDef.rowGroup, colDef.initialRowGroup);\n if (rowGroupIndex == null && (rowGroup == null || rowGroup == false)) {\n rowGroupIndex = null;\n rowGroup = null;\n }\n var pivotIndex = getValueOrNull(colDef.pivotIndex, colDef.initialPivotIndex);\n var pivot = getValueOrNull(colDef.pivot, colDef.initialPivot);\n if (pivotIndex == null && (pivot == null || pivot == false)) {\n pivotIndex = null;\n pivot = null;\n }\n var aggFunc = getValueOrNull(colDef.aggFunc, colDef.initialAggFunc);\n return {\n colId: column.getColId(),\n sort: sort,\n sortIndex: sortIndex,\n hide: hide,\n pinned: pinned,\n width: width,\n flex: flex,\n rowGroup: rowGroup,\n rowGroupIndex: rowGroupIndex,\n pivot: pivot,\n pivotIndex: pivotIndex,\n aggFunc: aggFunc,\n };\n };\n ColumnModel.prototype.applyColumnState = function (params, source) {\n var _this = this;\n if (missingOrEmpty(this.primaryColumns)) {\n return false;\n }\n if (params && params.state && !params.state.forEach) {\n console.warn('AG Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state.');\n return false;\n }\n var applyStates = function (states, existingColumns, getById) {\n var dispatchEventsFunc = _this.compareColumnStatesAndDispatchEvents(source);\n _this.autoGroupsNeedBuilding = true;\n // at the end below, this list will have all columns we got no state for\n var columnsWithNoState = existingColumns.slice();\n var rowGroupIndexes = {};\n var pivotIndexes = {};\n var autoGroupColumnStates = [];\n // If pivoting is modified, these are the states we try to reapply after\n // the secondary columns are re-generated\n var unmatchedAndAutoStates = [];\n var unmatchedCount = 0;\n var previousRowGroupCols = _this.rowGroupColumns.slice();\n var previousPivotCols = _this.pivotColumns.slice();\n states.forEach(function (state) {\n var colId = state.colId || '';\n // auto group columns are re-created so deferring syncing with ColumnState\n var isAutoGroupColumn = colId.startsWith(GROUP_AUTO_COLUMN_ID);\n if (isAutoGroupColumn) {\n autoGroupColumnStates.push(state);\n unmatchedAndAutoStates.push(state);\n return;\n }\n var column = getById(colId);\n if (!column) {\n unmatchedAndAutoStates.push(state);\n unmatchedCount += 1;\n }\n else {\n _this.syncColumnWithStateItem(column, state, params.defaultState, rowGroupIndexes, pivotIndexes, false, source);\n removeFromArray(columnsWithNoState, column);\n }\n });\n // anything left over, we got no data for, so add in the column as non-value, non-rowGroup and hidden\n var applyDefaultsFunc = function (col) {\n return _this.syncColumnWithStateItem(col, null, params.defaultState, rowGroupIndexes, pivotIndexes, false, source);\n };\n columnsWithNoState.forEach(applyDefaultsFunc);\n // sort the lists according to the indexes that were provided\n var comparator = function (indexes, oldList, colA, colB) {\n var indexA = indexes[colA.getId()];\n var indexB = indexes[colB.getId()];\n var aHasIndex = indexA != null;\n var bHasIndex = indexB != null;\n if (aHasIndex && bHasIndex) {\n // both a and b are new cols with index, so sort on index\n return indexA - indexB;\n }\n if (aHasIndex) {\n // a has an index, so it should be before a\n return -1;\n }\n if (bHasIndex) {\n // b has an index, so it should be before a\n return 1;\n }\n var oldIndexA = oldList.indexOf(colA);\n var oldIndexB = oldList.indexOf(colB);\n var aHasOldIndex = oldIndexA >= 0;\n var bHasOldIndex = oldIndexB >= 0;\n if (aHasOldIndex && bHasOldIndex) {\n // both a and b are old cols, so sort based on last order\n return oldIndexA - oldIndexB;\n }\n if (aHasOldIndex) {\n // a is old, b is new, so b is first\n return -1;\n }\n // this bit does matter, means both are new cols\n // but without index or that b is old and a is new\n return 1;\n };\n _this.rowGroupColumns.sort(comparator.bind(_this, rowGroupIndexes, previousRowGroupCols));\n _this.pivotColumns.sort(comparator.bind(_this, pivotIndexes, previousPivotCols));\n _this.updateGridColumns();\n // sync newly created auto group columns with ColumnState\n var autoGroupColsCopy = _this.groupAutoColumns ? _this.groupAutoColumns.slice() : [];\n autoGroupColumnStates.forEach(function (stateItem) {\n var autoCol = _this.getAutoColumn(stateItem.colId);\n removeFromArray(autoGroupColsCopy, autoCol);\n _this.syncColumnWithStateItem(autoCol, stateItem, params.defaultState, null, null, true, source);\n });\n // autogroup cols with nothing else, apply the default\n autoGroupColsCopy.forEach(applyDefaultsFunc);\n _this.applyOrderAfterApplyState(params);\n _this.updateDisplayedColumns(source);\n _this.dispatchEverythingChanged(source);\n dispatchEventsFunc(); // Will trigger secondary column changes if pivoting modified\n return { unmatchedAndAutoStates: unmatchedAndAutoStates, unmatchedCount: unmatchedCount };\n };\n this.columnAnimationService.start();\n var _a = applyStates(params.state || [], this.primaryColumns || [], function (id) { return _this.getPrimaryColumn(id); }), unmatchedAndAutoStates = _a.unmatchedAndAutoStates, unmatchedCount = _a.unmatchedCount;\n // If there are still states left over, see if we can apply them to newly generated\n // secondary or auto columns. Also if defaults exist, ensure they are applied to secondary cols\n if (unmatchedAndAutoStates.length > 0 || exists(params.defaultState)) {\n unmatchedCount = applyStates(unmatchedAndAutoStates, this.secondaryColumns || [], function (id) { return _this.getSecondaryColumn(id); }).unmatchedCount;\n }\n this.columnAnimationService.finish();\n return unmatchedCount === 0; // Successful if no states unaccounted for\n };\n ColumnModel.prototype.applyOrderAfterApplyState = function (params) {\n var _this = this;\n if (!params.applyOrder || !params.state) {\n return;\n }\n var newOrder = [];\n var processedColIds = {};\n params.state.forEach(function (item) {\n if (!item.colId || processedColIds[item.colId]) {\n return;\n }\n var col = _this.gridColumnsMap[item.colId];\n if (col) {\n newOrder.push(col);\n processedColIds[item.colId] = true;\n }\n });\n // add in all other columns\n var autoGroupInsertIndex = 0;\n this.gridColumns.forEach(function (col) {\n var colId = col.getColId();\n var alreadyProcessed = processedColIds[colId] != null;\n if (alreadyProcessed) {\n return;\n }\n var isAutoGroupCol = colId.startsWith(GROUP_AUTO_COLUMN_ID);\n if (isAutoGroupCol) {\n // auto group columns, if missing from state list, are added to the start.\n // it's common to have autoGroup missing, as grouping could be on by default\n // on a column, but the user could of since removed the grouping via the UI.\n // if we don't inc the insert index, autoGroups will be inserted in reverse order\n insertIntoArray(newOrder, col, autoGroupInsertIndex++);\n }\n else {\n // normal columns, if missing from state list, are added at the end\n newOrder.push(col);\n }\n });\n // this is already done in updateGridColumns, however we changed the order above (to match the order of the state\n // columns) so we need to do it again. we could of put logic into the order above to take into account fixed\n // columns, however if we did then we would have logic for updating fixed columns twice. reusing the logic here\n // is less sexy for the code here, but it keeps consistency.\n newOrder = this.placeLockedColumns(newOrder);\n if (!this.doesMovePassMarryChildren(newOrder)) {\n console.warn('AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.');\n return;\n }\n this.gridColumns = newOrder;\n };\n ColumnModel.prototype.compareColumnStatesAndDispatchEvents = function (source) {\n var _this = this;\n var startState = {\n rowGroupColumns: this.rowGroupColumns.slice(),\n pivotColumns: this.pivotColumns.slice(),\n valueColumns: this.valueColumns.slice()\n };\n var columnStateBefore = this.getColumnState();\n var columnStateBeforeMap = {};\n columnStateBefore.forEach(function (col) {\n columnStateBeforeMap[col.colId] = col;\n });\n return function () {\n var colsForState = _this.getPrimaryAndSecondaryAndAutoColumns();\n // dispatches generic ColumnEvents where all columns are returned rather than what has changed\n var dispatchWhenListsDifferent = function (eventType, colsBefore, colsAfter, idMapper) {\n var beforeList = colsBefore.map(idMapper);\n var afterList = colsAfter.map(idMapper);\n var unchanged = areEqual(beforeList, afterList);\n if (unchanged) {\n return;\n }\n var changes = new Set(colsBefore);\n colsAfter.forEach(function (id) {\n // if the first list had it, delete it, as it's unchanged.\n if (!changes.delete(id)) {\n // if the second list has it, and first doesn't, add it.\n changes.add(id);\n }\n });\n var changesArr = __spreadArray$s([], __read$A(changes), false);\n var event = {\n type: eventType,\n columns: changesArr,\n column: changesArr.length === 1 ? changesArr[0] : null,\n source: source\n };\n _this.eventService.dispatchEvent(event);\n };\n // determines which columns have changed according to supplied predicate\n var getChangedColumns = function (changedPredicate) {\n var changedColumns = [];\n colsForState.forEach(function (column) {\n var colStateBefore = columnStateBeforeMap[column.getColId()];\n if (colStateBefore && changedPredicate(colStateBefore, column)) {\n changedColumns.push(column);\n }\n });\n return changedColumns;\n };\n var columnIdMapper = function (c) { return c.getColId(); };\n dispatchWhenListsDifferent(Events.EVENT_COLUMN_ROW_GROUP_CHANGED, startState.rowGroupColumns, _this.rowGroupColumns, columnIdMapper);\n dispatchWhenListsDifferent(Events.EVENT_COLUMN_PIVOT_CHANGED, startState.pivotColumns, _this.pivotColumns, columnIdMapper);\n var valueChangePredicate = function (cs, c) {\n var oldActive = cs.aggFunc != null;\n var activeChanged = oldActive != c.isValueActive();\n // we only check aggFunc if the agg is active\n var aggFuncChanged = oldActive && cs.aggFunc != c.getAggFunc();\n return activeChanged || aggFuncChanged;\n };\n var changedValues = getChangedColumns(valueChangePredicate);\n if (changedValues.length > 0) {\n _this.dispatchColumnChangedEvent(Events.EVENT_COLUMN_VALUE_CHANGED, changedValues, source);\n }\n var resizeChangePredicate = function (cs, c) { return cs.width != c.getActualWidth(); };\n _this.dispatchColumnResizedEvent(getChangedColumns(resizeChangePredicate), true, source);\n var pinnedChangePredicate = function (cs, c) { return cs.pinned != c.getPinned(); };\n _this.dispatchColumnPinnedEvent(getChangedColumns(pinnedChangePredicate), source);\n var visibilityChangePredicate = function (cs, c) { return cs.hide == c.isVisible(); };\n _this.dispatchColumnVisibleEvent(getChangedColumns(visibilityChangePredicate), source);\n var sortChangePredicate = function (cs, c) { return cs.sort != c.getSort() || cs.sortIndex != c.getSortIndex(); };\n var changedColumns = getChangedColumns(sortChangePredicate);\n if (changedColumns.length > 0) {\n _this.sortController.dispatchSortChangedEvents(source, changedColumns);\n }\n // special handling for moved column events\n _this.normaliseColumnMovedEventForColumnState(columnStateBefore, source);\n };\n };\n ColumnModel.prototype.getCommonValue = function (cols, valueGetter) {\n if (!cols || cols.length == 0) {\n return undefined;\n }\n // compare each value to the first value. if nothing differs, then value is common so return it.\n var firstValue = valueGetter(cols[0]);\n for (var i = 1; i < cols.length; i++) {\n if (firstValue !== valueGetter(cols[i])) {\n // values differ, no common value\n return undefined;\n }\n }\n return firstValue;\n };\n ColumnModel.prototype.normaliseColumnMovedEventForColumnState = function (colStateBefore, source) {\n // we are only interested in columns that were both present and visible before and after\n var _this = this;\n var colStateAfter = this.getColumnState();\n var colStateAfterMapped = {};\n colStateAfter.forEach(function (s) { return colStateAfterMapped[s.colId] = s; });\n // get id's of cols in both before and after lists\n var colsIntersectIds = {};\n colStateBefore.forEach(function (s) {\n if (colStateAfterMapped[s.colId]) {\n colsIntersectIds[s.colId] = true;\n }\n });\n // filter state lists, so we only have cols that were present before and after\n var beforeFiltered = colStateBefore.filter(function (c) { return colsIntersectIds[c.colId]; });\n var afterFiltered = colStateAfter.filter(function (c) { return colsIntersectIds[c.colId]; });\n // see if any cols are in a different location\n var movedColumns = [];\n afterFiltered.forEach(function (csAfter, index) {\n var csBefore = beforeFiltered && beforeFiltered[index];\n if (csBefore && csBefore.colId !== csAfter.colId) {\n var gridCol = _this.getGridColumn(csBefore.colId);\n if (gridCol) {\n movedColumns.push(gridCol);\n }\n }\n });\n if (!movedColumns.length) {\n return;\n }\n this.dispatchColumnMovedEvent({ movedColumns: movedColumns, source: source, finished: true });\n };\n ColumnModel.prototype.syncColumnWithStateItem = function (column, stateItem, defaultState, rowGroupIndexes, pivotIndexes, autoCol, source) {\n if (!column) {\n return;\n }\n var getValue = function (key1, key2) {\n var obj = { value1: undefined, value2: undefined };\n var calculated = false;\n if (stateItem) {\n if (stateItem[key1] !== undefined) {\n obj.value1 = stateItem[key1];\n calculated = true;\n }\n if (exists(key2) && stateItem[key2] !== undefined) {\n obj.value2 = stateItem[key2];\n calculated = true;\n }\n }\n if (!calculated && defaultState) {\n if (defaultState[key1] !== undefined) {\n obj.value1 = defaultState[key1];\n }\n if (exists(key2) && defaultState[key2] !== undefined) {\n obj.value2 = defaultState[key2];\n }\n }\n return obj;\n };\n // following ensures we are left with boolean true or false, eg converts (null, undefined, 0) all to true\n var hide = getValue('hide').value1;\n if (hide !== undefined) {\n column.setVisible(!hide, source);\n }\n // sets pinned to 'left' or 'right'\n var pinned = getValue('pinned').value1;\n if (pinned !== undefined) {\n column.setPinned(pinned);\n }\n // if width provided and valid, use it, otherwise stick with the old width\n var minColWidth = this.columnUtils.calculateColMinWidth(column.getColDef());\n // flex\n var flex = getValue('flex').value1;\n // if flex is null or a value, set into the col\n if (flex !== undefined) {\n column.setFlex(flex);\n }\n // if flex is null or undefined, fall back to setting width\n if (flex == null) {\n // if no flex, then use width if it's there\n var width = getValue('width').value1;\n if (width != null) {\n if (minColWidth != null && width >= minColWidth) {\n column.setActualWidth(width, source);\n }\n }\n }\n var sort = getValue('sort').value1;\n if (sort !== undefined) {\n if (sort === 'desc' || sort === 'asc') {\n column.setSort(sort, source);\n }\n else {\n column.setSort(undefined, source);\n }\n }\n var sortIndex = getValue('sortIndex').value1;\n if (sortIndex !== undefined) {\n column.setSortIndex(sortIndex);\n }\n // we do not do aggFunc, rowGroup or pivot for auto cols or secondary cols\n if (autoCol || !column.isPrimary()) {\n return;\n }\n var aggFunc = getValue('aggFunc').value1;\n if (aggFunc !== undefined) {\n if (typeof aggFunc === 'string') {\n column.setAggFunc(aggFunc);\n if (!column.isValueActive()) {\n column.setValueActive(true, source);\n this.valueColumns.push(column);\n }\n }\n else {\n if (exists(aggFunc)) {\n console.warn('AG Grid: stateItem.aggFunc must be a string. if using your own aggregation ' +\n 'functions, register the functions first before using them in get/set state. This is because it is ' +\n 'intended for the column state to be stored and retrieved as simple JSON.');\n }\n // Note: we do not call column.setAggFunc(null), so that next time we aggregate\n // by this column (eg drag the column to the agg section int he toolpanel) it will\n // default to the last aggregation function.\n if (column.isValueActive()) {\n column.setValueActive(false, source);\n removeFromArray(this.valueColumns, column);\n }\n }\n }\n var _a = getValue('rowGroup', 'rowGroupIndex'), rowGroup = _a.value1, rowGroupIndex = _a.value2;\n if (rowGroup !== undefined || rowGroupIndex !== undefined) {\n if (typeof rowGroupIndex === 'number' || rowGroup) {\n if (!column.isRowGroupActive()) {\n column.setRowGroupActive(true, source);\n this.rowGroupColumns.push(column);\n }\n if (rowGroupIndexes && typeof rowGroupIndex === 'number') {\n rowGroupIndexes[column.getId()] = rowGroupIndex;\n }\n }\n else {\n if (column.isRowGroupActive()) {\n column.setRowGroupActive(false, source);\n removeFromArray(this.rowGroupColumns, column);\n }\n }\n }\n var _b = getValue('pivot', 'pivotIndex'), pivot = _b.value1, pivotIndex = _b.value2;\n if (pivot !== undefined || pivotIndex !== undefined) {\n if (typeof pivotIndex === 'number' || pivot) {\n if (!column.isPivotActive()) {\n column.setPivotActive(true, source);\n this.pivotColumns.push(column);\n }\n if (pivotIndexes && typeof pivotIndex === 'number') {\n pivotIndexes[column.getId()] = pivotIndex;\n }\n }\n else {\n if (column.isPivotActive()) {\n column.setPivotActive(false, source);\n removeFromArray(this.pivotColumns, column);\n }\n }\n }\n };\n ColumnModel.prototype.getGridColumns = function (keys) {\n return this.getColumns(keys, this.getGridColumn.bind(this));\n };\n ColumnModel.prototype.getColumns = function (keys, columnLookupCallback) {\n var foundColumns = [];\n if (keys) {\n keys.forEach(function (key) {\n var column = columnLookupCallback(key);\n if (column) {\n foundColumns.push(column);\n }\n });\n }\n return foundColumns;\n };\n // used by growGroupPanel\n ColumnModel.prototype.getColumnWithValidation = function (key) {\n if (key == null) {\n return null;\n }\n var column = this.getGridColumn(key);\n if (!column) {\n console.warn('AG Grid: could not find column ' + key);\n }\n return column;\n };\n ColumnModel.prototype.getPrimaryColumn = function (key) {\n if (!this.primaryColumns) {\n return null;\n }\n return this.getColumn(key, this.primaryColumns, this.primaryColumnsMap);\n };\n ColumnModel.prototype.getGridColumn = function (key) {\n return this.getColumn(key, this.gridColumns, this.gridColumnsMap);\n };\n ColumnModel.prototype.lookupGridColumn = function (key) {\n return this.gridColumnsMap[key];\n };\n ColumnModel.prototype.getSecondaryColumn = function (key) {\n if (!this.secondaryColumns) {\n return null;\n }\n return this.getColumn(key, this.secondaryColumns, this.secondaryColumnsMap);\n };\n ColumnModel.prototype.getColumn = function (key, columnList, columnMap) {\n if (!key || !columnMap) {\n return null;\n }\n // most of the time this method gets called the key is a string, so we put this shortcut in\n // for performance reasons, to see if we can match for ID (it doesn't do auto columns, that's done below)\n if (typeof key == 'string' && columnMap[key]) {\n return columnMap[key];\n }\n for (var i = 0; i < columnList.length; i++) {\n if (this.columnsMatch(columnList[i], key)) {\n return columnList[i];\n }\n }\n return this.getAutoColumn(key);\n };\n ColumnModel.prototype.getSourceColumnsForGroupColumn = function (groupCol) {\n var sourceColumnId = groupCol.getColDef().showRowGroup;\n if (!sourceColumnId) {\n return null;\n }\n if (sourceColumnId === true) {\n return this.rowGroupColumns.slice(0);\n }\n var column = this.getPrimaryColumn(sourceColumnId);\n return column ? [column] : null;\n };\n ColumnModel.prototype.getAutoColumn = function (key) {\n var _this = this;\n if (!this.groupAutoColumns ||\n !exists(this.groupAutoColumns) ||\n missing(this.groupAutoColumns)) {\n return null;\n }\n return this.groupAutoColumns.find(function (groupCol) { return _this.columnsMatch(groupCol, key); }) || null;\n };\n ColumnModel.prototype.columnsMatch = function (column, key) {\n var columnMatches = column === key;\n var colDefMatches = column.getColDef() === key;\n var idMatches = column.getColId() == key;\n return columnMatches || colDefMatches || idMatches;\n };\n ColumnModel.prototype.getDisplayNameForColumn = function (column, location, includeAggFunc) {\n if (includeAggFunc === void 0) { includeAggFunc = false; }\n if (!column) {\n return null;\n }\n var headerName = this.getHeaderName(column.getColDef(), column, null, null, location);\n if (includeAggFunc) {\n return this.wrapHeaderNameWithAggFunc(column, headerName);\n }\n return headerName;\n };\n ColumnModel.prototype.getDisplayNameForProvidedColumnGroup = function (columnGroup, providedColumnGroup, location) {\n var colGroupDef = providedColumnGroup ? providedColumnGroup.getColGroupDef() : null;\n if (colGroupDef) {\n return this.getHeaderName(colGroupDef, null, columnGroup, providedColumnGroup, location);\n }\n return null;\n };\n ColumnModel.prototype.getDisplayNameForColumnGroup = function (columnGroup, location) {\n return this.getDisplayNameForProvidedColumnGroup(columnGroup, columnGroup.getProvidedColumnGroup(), location);\n };\n // location is where the column is going to appear, ie who is calling us\n ColumnModel.prototype.getHeaderName = function (colDef, column, columnGroup, providedColumnGroup, location) {\n var headerValueGetter = colDef.headerValueGetter;\n if (headerValueGetter) {\n var params = this.gridOptionsService.addGridCommonParams({\n colDef: colDef,\n column: column,\n columnGroup: columnGroup,\n providedColumnGroup: providedColumnGroup,\n location: location\n });\n if (typeof headerValueGetter === 'function') {\n // valueGetter is a function, so just call it\n return headerValueGetter(params);\n }\n else if (typeof headerValueGetter === 'string') {\n // valueGetter is an expression, so execute the expression\n return this.expressionService.evaluate(headerValueGetter, params);\n }\n console.warn('AG Grid: headerValueGetter must be a function or a string');\n return '';\n }\n else if (colDef.headerName != null) {\n return colDef.headerName;\n }\n else if (colDef.field) {\n return camelCaseToHumanText(colDef.field);\n }\n return '';\n };\n ColumnModel.prototype.wrapHeaderNameWithAggFunc = function (column, headerName) {\n if (this.gridOptionsService.get('suppressAggFuncInHeader')) {\n return headerName;\n }\n // only columns with aggregation active can have aggregations\n var pivotValueColumn = column.getColDef().pivotValueColumn;\n var pivotActiveOnThisColumn = exists(pivotValueColumn);\n var aggFunc = null;\n var aggFuncFound;\n // otherwise we have a measure that is active, and we are doing aggregation on it\n if (pivotActiveOnThisColumn) {\n var isCollapsedHeaderEnabled = this.gridOptionsService.get('removePivotHeaderRowWhenSingleValueColumn') && this.valueColumns.length === 1;\n var isTotalColumn = column.getColDef().pivotTotalColumnIds !== undefined;\n if (isCollapsedHeaderEnabled && !isTotalColumn) {\n return headerName; // Skip decorating the header - in this case the label is the pivot key, not the value col\n }\n aggFunc = pivotValueColumn ? pivotValueColumn.getAggFunc() : null;\n aggFuncFound = true;\n }\n else {\n var measureActive = column.isValueActive();\n var aggregationPresent = this.pivotMode || !this.isRowGroupEmpty();\n if (measureActive && aggregationPresent) {\n aggFunc = column.getAggFunc();\n aggFuncFound = true;\n }\n else {\n aggFuncFound = false;\n }\n }\n if (aggFuncFound) {\n var aggFuncString = (typeof aggFunc === 'string') ? aggFunc : 'func';\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var aggFuncStringTranslated = localeTextFunc(aggFuncString, aggFuncString);\n return \"\".concat(aggFuncStringTranslated, \"(\").concat(headerName, \")\");\n }\n return headerName;\n };\n // returns the group with matching colId and instanceId. If instanceId is missing,\n // matches only on the colId.\n ColumnModel.prototype.getColumnGroup = function (colId, partId) {\n if (!colId) {\n return null;\n }\n if (colId instanceof ColumnGroup) {\n return colId;\n }\n var allColumnGroups = this.getAllDisplayedTrees();\n var checkPartId = typeof partId === 'number';\n var result = null;\n this.columnUtils.depthFirstAllColumnTreeSearch(allColumnGroups, function (child) {\n if (child instanceof ColumnGroup) {\n var columnGroup = child;\n var matched = void 0;\n if (checkPartId) {\n matched = colId === columnGroup.getGroupId() && partId === columnGroup.getPartId();\n }\n else {\n matched = colId === columnGroup.getGroupId();\n }\n if (matched) {\n result = columnGroup;\n }\n }\n });\n return result;\n };\n ColumnModel.prototype.isReady = function () {\n return this.ready;\n };\n ColumnModel.prototype.extractValueColumns = function (source, oldPrimaryColumns) {\n this.valueColumns = this.extractColumns(oldPrimaryColumns, this.valueColumns, function (col, flag) { return col.setValueActive(flag, source); }, \n // aggFunc doesn't have index variant, cos order of value cols doesn't matter, so always return null\n function () { return undefined; }, function () { return undefined; }, \n // aggFunc is a string, so return it's existence\n function (colDef) {\n var aggFunc = colDef.aggFunc;\n // null or empty string means clear\n if (aggFunc === null || aggFunc === '') {\n return null;\n }\n if (aggFunc === undefined) {\n return;\n }\n return !!aggFunc;\n }, function (colDef) {\n // return false if any of the following: null, undefined, empty string\n return colDef.initialAggFunc != null && colDef.initialAggFunc != '';\n });\n // all new columns added will have aggFunc missing, so set it to what is in the colDef\n this.valueColumns.forEach(function (col) {\n var colDef = col.getColDef();\n // if aggFunc provided, we always override, as reactive property\n if (colDef.aggFunc != null && colDef.aggFunc != '') {\n col.setAggFunc(colDef.aggFunc);\n }\n else {\n // otherwise we use initialAggFunc only if no agg func set - which happens when new column only\n if (!col.getAggFunc()) {\n col.setAggFunc(colDef.initialAggFunc);\n }\n }\n });\n };\n ColumnModel.prototype.extractRowGroupColumns = function (source, oldPrimaryColumns) {\n this.rowGroupColumns = this.extractColumns(oldPrimaryColumns, this.rowGroupColumns, function (col, flag) { return col.setRowGroupActive(flag, source); }, function (colDef) { return colDef.rowGroupIndex; }, function (colDef) { return colDef.initialRowGroupIndex; }, function (colDef) { return colDef.rowGroup; }, function (colDef) { return colDef.initialRowGroup; });\n };\n ColumnModel.prototype.extractColumns = function (oldPrimaryColumns, previousCols, setFlagFunc, getIndexFunc, getInitialIndexFunc, getValueFunc, getInitialValueFunc) {\n if (oldPrimaryColumns === void 0) { oldPrimaryColumns = []; }\n if (previousCols === void 0) { previousCols = []; }\n var colsWithIndex = [];\n var colsWithValue = [];\n // go though all cols.\n // if value, change\n // if default only, change only if new\n (this.primaryColumns || []).forEach(function (col) {\n var colIsNew = oldPrimaryColumns.indexOf(col) < 0;\n var colDef = col.getColDef();\n var value = attrToBoolean(getValueFunc(colDef));\n var initialValue = attrToBoolean(getInitialValueFunc(colDef));\n var index = attrToNumber(getIndexFunc(colDef));\n var initialIndex = attrToNumber(getInitialIndexFunc(colDef));\n var include;\n var valuePresent = value !== undefined;\n var indexPresent = index !== undefined;\n var initialValuePresent = initialValue !== undefined;\n var initialIndexPresent = initialIndex !== undefined;\n if (valuePresent) {\n include = value; // boolean value is guaranteed as attrToBoolean() is used above\n }\n else if (indexPresent) {\n if (index === null) {\n // if col is new we don't want to use the default / initial if index is set to null. Similarly,\n // we don't want to include the property for existing columns, i.e. we want to 'clear' it.\n include = false;\n }\n else {\n // note that 'null >= 0' evaluates to true which means 'rowGroupIndex = null' would enable row\n // grouping if the null check didn't exist above.\n include = index >= 0;\n }\n }\n else {\n if (colIsNew) {\n // as no value or index is 'present' we use the default / initial when col is new\n if (initialValuePresent) {\n include = initialValue;\n }\n else if (initialIndexPresent) {\n include = initialIndex != null && initialIndex >= 0;\n }\n else {\n include = false;\n }\n }\n else {\n // otherwise include it if included last time, e.g. if we are extracting row group cols and this col\n // is an existing row group col (i.e. it exists in 'previousCols') then we should include it.\n include = previousCols.indexOf(col) >= 0;\n }\n }\n if (include) {\n var useIndex = colIsNew ? (index != null || initialIndex != null) : index != null;\n useIndex ? colsWithIndex.push(col) : colsWithValue.push(col);\n }\n });\n var getIndexForCol = function (col) {\n var index = getIndexFunc(col.getColDef());\n var defaultIndex = getInitialIndexFunc(col.getColDef());\n return index != null ? index : defaultIndex;\n };\n // sort cols with index, and add these first\n colsWithIndex.sort(function (colA, colB) {\n var indexA = getIndexForCol(colA);\n var indexB = getIndexForCol(colB);\n if (indexA === indexB) {\n return 0;\n }\n if (indexA < indexB) {\n return -1;\n }\n return 1;\n });\n var res = [].concat(colsWithIndex);\n // second add columns that were there before and in the same order as they were before,\n // so we are preserving order of current grouping of columns that simply have rowGroup=true\n previousCols.forEach(function (col) {\n if (colsWithValue.indexOf(col) >= 0) {\n res.push(col);\n }\n });\n // lastly put in all remaining cols\n colsWithValue.forEach(function (col) {\n if (res.indexOf(col) < 0) {\n res.push(col);\n }\n });\n // set flag=false for removed cols\n previousCols.forEach(function (col) {\n if (res.indexOf(col) < 0) {\n setFlagFunc(col, false);\n }\n });\n // set flag=true for newly added cols\n res.forEach(function (col) {\n if (previousCols.indexOf(col) < 0) {\n setFlagFunc(col, true);\n }\n });\n return res;\n };\n ColumnModel.prototype.extractPivotColumns = function (source, oldPrimaryColumns) {\n this.pivotColumns = this.extractColumns(oldPrimaryColumns, this.pivotColumns, function (col, flag) { return col.setPivotActive(flag, source); }, function (colDef) { return colDef.pivotIndex; }, function (colDef) { return colDef.initialPivotIndex; }, function (colDef) { return colDef.pivot; }, function (colDef) { return colDef.initialPivot; });\n };\n ColumnModel.prototype.resetColumnGroupState = function (source) {\n if (!this.primaryColumnTree) {\n return;\n }\n var stateItems = [];\n this.columnUtils.depthFirstOriginalTreeSearch(null, this.primaryColumnTree, function (child) {\n if (child instanceof ProvidedColumnGroup) {\n var colGroupDef = child.getColGroupDef();\n var groupState = {\n groupId: child.getGroupId(),\n open: !colGroupDef ? undefined : colGroupDef.openByDefault\n };\n stateItems.push(groupState);\n }\n });\n this.setColumnGroupState(stateItems, source);\n };\n ColumnModel.prototype.getColumnGroupState = function () {\n var columnGroupState = [];\n this.columnUtils.depthFirstOriginalTreeSearch(null, this.gridBalancedTree, function (node) {\n if (node instanceof ProvidedColumnGroup) {\n columnGroupState.push({\n groupId: node.getGroupId(),\n open: node.isExpanded()\n });\n }\n });\n return columnGroupState;\n };\n ColumnModel.prototype.setColumnGroupState = function (stateItems, source) {\n var _this = this;\n if (!this.gridBalancedTree) {\n return;\n }\n this.columnAnimationService.start();\n var impactedGroups = [];\n stateItems.forEach(function (stateItem) {\n var groupKey = stateItem.groupId;\n var newValue = stateItem.open;\n var providedColumnGroup = _this.getProvidedColumnGroup(groupKey);\n if (!providedColumnGroup) {\n return;\n }\n if (providedColumnGroup.isExpanded() === newValue) {\n return;\n }\n _this.logger.log('columnGroupOpened(' + providedColumnGroup.getGroupId() + ',' + newValue + ')');\n providedColumnGroup.setExpanded(newValue);\n impactedGroups.push(providedColumnGroup);\n });\n this.updateGroupsAndDisplayedColumns(source);\n this.setFirstRightAndLastLeftPinned(source);\n if (impactedGroups.length) {\n var event_4 = {\n type: Events.EVENT_COLUMN_GROUP_OPENED,\n columnGroup: ProvidedColumnGroup.length === 1 ? impactedGroups[0] : undefined,\n columnGroups: impactedGroups,\n };\n this.eventService.dispatchEvent(event_4);\n }\n this.columnAnimationService.finish();\n };\n // called by headerRenderer - when a header is opened or closed\n ColumnModel.prototype.setColumnGroupOpened = function (key, newValue, source) {\n var keyAsString;\n if (key instanceof ProvidedColumnGroup) {\n keyAsString = key.getId();\n }\n else {\n keyAsString = key || '';\n }\n this.setColumnGroupState([{ groupId: keyAsString, open: newValue }], source);\n };\n ColumnModel.prototype.getProvidedColumnGroup = function (key) {\n // if (key instanceof ProvidedColumnGroup) { return key; }\n if (typeof key !== 'string') {\n console.error('AG Grid: group key must be a string');\n }\n // otherwise, search for the column group by id\n var res = null;\n this.columnUtils.depthFirstOriginalTreeSearch(null, this.gridBalancedTree, function (node) {\n if (node instanceof ProvidedColumnGroup) {\n if (node.getId() === key) {\n res = node;\n }\n }\n });\n return res;\n };\n ColumnModel.prototype.calculateColumnsForDisplay = function () {\n var _this = this;\n var columnsForDisplay;\n if (this.pivotMode && missing(this.secondaryColumns)) {\n // pivot mode is on, but we are not pivoting, so we only\n // show columns we are aggregating on\n columnsForDisplay = this.gridColumns.filter(function (column) {\n var isAutoGroupCol = _this.groupAutoColumns && includes(_this.groupAutoColumns, column);\n var isValueCol = _this.valueColumns && includes(_this.valueColumns, column);\n return isAutoGroupCol || isValueCol;\n });\n }\n else {\n // otherwise continue as normal. this can be working on the primary\n // or secondary columns, whatever the gridColumns are set to\n columnsForDisplay = this.gridColumns.filter(function (column) {\n // keep col if a) it's auto-group or b) it's visible\n var isAutoGroupCol = _this.groupAutoColumns && includes(_this.groupAutoColumns, column);\n return isAutoGroupCol || column.isVisible();\n });\n }\n return columnsForDisplay;\n };\n ColumnModel.prototype.checkColSpanActiveInCols = function (columns) {\n var result = false;\n columns.forEach(function (col) {\n if (exists(col.getColDef().colSpan)) {\n result = true;\n }\n });\n return result;\n };\n ColumnModel.prototype.calculateColumnsForGroupDisplay = function () {\n var _this = this;\n this.groupDisplayColumns = [];\n this.groupDisplayColumnsMap = {};\n var checkFunc = function (col) {\n var colDef = col.getColDef();\n var underlyingColumn = colDef.showRowGroup;\n if (colDef && exists(underlyingColumn)) {\n _this.groupDisplayColumns.push(col);\n if (typeof underlyingColumn === 'string') {\n _this.groupDisplayColumnsMap[underlyingColumn] = col;\n }\n else if (underlyingColumn === true) {\n _this.getRowGroupColumns().forEach(function (rowGroupCol) {\n _this.groupDisplayColumnsMap[rowGroupCol.getId()] = col;\n });\n }\n }\n };\n this.gridColumns.forEach(checkFunc);\n };\n ColumnModel.prototype.getGroupDisplayColumns = function () {\n return this.groupDisplayColumns;\n };\n ColumnModel.prototype.getGroupDisplayColumnForGroup = function (rowGroupColumnId) {\n return this.groupDisplayColumnsMap[rowGroupColumnId];\n };\n ColumnModel.prototype.updateDisplayedColumns = function (source) {\n var columnsForDisplay = this.calculateColumnsForDisplay();\n this.buildDisplayedTrees(columnsForDisplay);\n // also called when group opened/closed\n this.updateGroupsAndDisplayedColumns(source);\n // also called when group opened/closed\n this.setFirstRightAndLastLeftPinned(source);\n };\n ColumnModel.prototype.isSecondaryColumnsPresent = function () {\n return exists(this.secondaryColumns);\n };\n ColumnModel.prototype.setSecondaryColumns = function (colDefs, source) {\n var _this = this;\n if (!this.gridColumns) {\n return;\n }\n var newColsPresent = colDefs && colDefs.length > 0;\n // if not cols passed, and we had no cols anyway, then do nothing\n if (!newColsPresent && missing(this.secondaryColumns)) {\n return;\n }\n if (newColsPresent) {\n this.processSecondaryColumnDefinitions(colDefs);\n var balancedTreeResult = this.columnFactory.createColumnTree(colDefs, false, this.secondaryBalancedTree || this.previousSecondaryColumns || undefined, source);\n this.destroyOldColumns(this.secondaryBalancedTree, balancedTreeResult.columnTree);\n this.secondaryBalancedTree = balancedTreeResult.columnTree;\n this.secondaryHeaderRowCount = balancedTreeResult.treeDept + 1;\n this.secondaryColumns = this.getColumnsFromTree(this.secondaryBalancedTree);\n this.secondaryColumnsMap = {};\n this.secondaryColumns.forEach(function (col) { return _this.secondaryColumnsMap[col.getId()] = col; });\n this.previousSecondaryColumns = null;\n }\n else {\n this.previousSecondaryColumns = this.secondaryBalancedTree;\n this.secondaryBalancedTree = null;\n this.secondaryHeaderRowCount = -1;\n this.secondaryColumns = null;\n this.secondaryColumnsMap = {};\n }\n this.updateGridColumns();\n this.updateDisplayedColumns(source);\n };\n ColumnModel.prototype.processSecondaryColumnDefinitions = function (colDefs) {\n var columnCallback = this.gridOptionsService.get('processPivotResultColDef');\n var groupCallback = this.gridOptionsService.get('processPivotResultColGroupDef');\n if (!columnCallback && !groupCallback) {\n return undefined;\n }\n var searchForColDefs = function (colDefs2) {\n colDefs2.forEach(function (abstractColDef) {\n var isGroup = exists(abstractColDef.children);\n if (isGroup) {\n var colGroupDef = abstractColDef;\n if (groupCallback) {\n groupCallback(colGroupDef);\n }\n searchForColDefs(colGroupDef.children);\n }\n else {\n var colDef = abstractColDef;\n if (columnCallback) {\n columnCallback(colDef);\n }\n }\n });\n };\n if (colDefs) {\n searchForColDefs(colDefs);\n }\n };\n // called from: applyColumnState, setColumnDefs, setSecondaryColumns\n ColumnModel.prototype.updateGridColumns = function () {\n var _this = this;\n var prevGridCols = this.gridBalancedTree;\n if (this.gridColsArePrimary) {\n this.lastPrimaryOrder = this.gridColumns;\n }\n else {\n this.lastSecondaryOrder = this.gridColumns;\n }\n // create the new auto columns\n var areAutoColsChanged = this.createGroupAutoColumnsIfNeeded();\n // if auto group cols have changed, and we have a sort order, we need to move auto cols to the start\n if (areAutoColsChanged) {\n var groupAutoColsMap_1 = convertToMap(this.groupAutoColumns.map(function (col) { return [col, true]; }));\n // if group cols have changed, remove them from any previous orders and add them to the start.\n if (this.lastPrimaryOrder) {\n this.lastPrimaryOrder = this.lastPrimaryOrder.filter(function (col) { return !groupAutoColsMap_1.has(col); });\n this.lastPrimaryOrder = __spreadArray$s(__spreadArray$s([], __read$A(this.groupAutoColumns), false), __read$A(this.lastPrimaryOrder), false);\n }\n if (this.lastSecondaryOrder) {\n this.lastSecondaryOrder = this.lastSecondaryOrder.filter(function (col) { return !groupAutoColsMap_1.has(col); });\n this.lastSecondaryOrder = __spreadArray$s(__spreadArray$s([], __read$A(this.groupAutoColumns), false), __read$A(this.lastSecondaryOrder), false);\n }\n }\n var sortOrderToRecover;\n if (this.secondaryColumns && this.secondaryBalancedTree) {\n var hasSameColumns = this.secondaryColumns.some(function (col) {\n return _this.gridColumnsMap[col.getColId()] !== undefined;\n });\n this.gridBalancedTree = this.secondaryBalancedTree.slice();\n this.gridHeaderRowCount = this.secondaryHeaderRowCount;\n this.gridColumns = this.secondaryColumns.slice();\n this.gridColsArePrimary = false;\n // If the current columns are the same or a subset of the previous\n // we keep the previous order, otherwise we go back to the order the pivot\n // cols are generated in\n if (hasSameColumns) {\n sortOrderToRecover = this.lastSecondaryOrder;\n }\n }\n else if (this.primaryColumns) {\n this.gridBalancedTree = this.primaryColumnTree.slice();\n this.gridHeaderRowCount = this.primaryHeaderRowCount;\n this.gridColumns = this.primaryColumns.slice();\n this.gridColsArePrimary = true;\n // updateGridColumns gets called after user adds a row group. we want to maintain the order of the columns\n // when this happens (eg if user moved a column) rather than revert back to the original column order.\n // likewise if changing in/out of pivot mode, we want to maintain the order of the cols\n sortOrderToRecover = this.lastPrimaryOrder;\n }\n this.addAutoGroupToGridColumns();\n this.orderGridColsLike(sortOrderToRecover);\n this.gridColumns = this.placeLockedColumns(this.gridColumns);\n this.calculateColumnsForGroupDisplay();\n this.refreshQuickFilterColumns();\n this.clearDisplayedAndViewportColumns();\n this.colSpanActive = this.checkColSpanActiveInCols(this.gridColumns);\n this.gridColumnsMap = {};\n this.gridColumns.forEach(function (col) { return _this.gridColumnsMap[col.getId()] = col; });\n this.setAutoHeightActive();\n if (!areEqual(prevGridCols, this.gridBalancedTree)) {\n var event_5 = {\n type: Events.EVENT_GRID_COLUMNS_CHANGED\n };\n this.eventService.dispatchEvent(event_5);\n }\n };\n ColumnModel.prototype.setAutoHeightActive = function () {\n this.autoHeightActive = this.gridColumns.filter(function (col) { return col.isAutoHeight(); }).length > 0;\n if (this.autoHeightActive) {\n this.autoHeightActiveAtLeastOnce = true;\n var supportedRowModel = this.gridOptionsService.isRowModelType('clientSide') || this.gridOptionsService.isRowModelType('serverSide');\n if (!supportedRowModel) {\n warnOnce('autoHeight columns only work with Client Side Row Model and Server Side Row Model.');\n }\n }\n };\n ColumnModel.prototype.orderGridColsLike = function (colsOrder) {\n if (missing(colsOrder)) {\n return;\n }\n var lastOrderMapped = convertToMap(colsOrder.map(function (col, index) { return [col, index]; }));\n // only do the sort if at least one column is accounted for. columns will be not accounted for\n // if changing from secondary to primary columns\n var noColsFound = true;\n this.gridColumns.forEach(function (col) {\n if (lastOrderMapped.has(col)) {\n noColsFound = false;\n }\n });\n if (noColsFound) {\n return;\n }\n // order cols in the same order as before. we need to make sure that all\n // cols still exists, so filter out any that no longer exist.\n var gridColsMap = convertToMap(this.gridColumns.map(function (col) { return [col, true]; }));\n var oldColsOrdered = colsOrder.filter(function (col) { return gridColsMap.has(col); });\n var oldColsMap = convertToMap(oldColsOrdered.map(function (col) { return [col, true]; }));\n var newColsOrdered = this.gridColumns.filter(function (col) { return !oldColsMap.has(col); });\n // add in the new columns, at the end (if no group), or at the end of the group (if a group)\n var newGridColumns = oldColsOrdered.slice();\n newColsOrdered.forEach(function (newCol) {\n var parent = newCol.getOriginalParent();\n // if no parent, means we are not grouping, so just add the column to the end\n if (!parent) {\n newGridColumns.push(newCol);\n return;\n }\n // find the group the column belongs to. if no siblings at the current level (eg col in group on it's\n // own) then go up one level and look for siblings there.\n var siblings = [];\n while (!siblings.length && parent) {\n var leafCols = parent.getLeafColumns();\n leafCols.forEach(function (leafCol) {\n var presentInNewGriColumns = newGridColumns.indexOf(leafCol) >= 0;\n var noYetInSiblings = siblings.indexOf(leafCol) < 0;\n if (presentInNewGriColumns && noYetInSiblings) {\n siblings.push(leafCol);\n }\n });\n parent = parent.getOriginalParent();\n }\n // if no siblings exist at any level, this means the col is in a group (or parent groups) on it's own\n if (!siblings.length) {\n newGridColumns.push(newCol);\n return;\n }\n // find index of last column in the group\n var indexes = siblings.map(function (col) { return newGridColumns.indexOf(col); });\n var lastIndex = Math.max.apply(Math, __spreadArray$s([], __read$A(indexes), false));\n insertIntoArray(newGridColumns, newCol, lastIndex + 1);\n });\n this.gridColumns = newGridColumns;\n };\n ColumnModel.prototype.isPrimaryColumnGroupsPresent = function () {\n return this.primaryHeaderRowCount > 1;\n };\n // if we are using autoGroupCols, then they should be included for quick filter. this covers the\n // following scenarios:\n // a) user provides 'field' into autoGroupCol of normal grid, so now because a valid col to filter leafs on\n // b) using tree data and user depends on autoGroupCol for first col, and we also want to filter on this\n // (tree data is a bit different, as parent rows can be filtered on, unlike row grouping)\n ColumnModel.prototype.refreshQuickFilterColumns = function () {\n var _a;\n var columnsForQuickFilter = (_a = (this.isPivotMode() ? this.secondaryColumns : this.primaryColumns)) !== null && _a !== void 0 ? _a : [];\n if (this.groupAutoColumns) {\n columnsForQuickFilter = columnsForQuickFilter.concat(this.groupAutoColumns);\n }\n this.columnsForQuickFilter = this.gridOptionsService.get('includeHiddenColumnsInQuickFilter')\n ? columnsForQuickFilter\n : columnsForQuickFilter.filter(function (col) { return col.isVisible() || col.isRowGroupActive(); });\n };\n ColumnModel.prototype.placeLockedColumns = function (cols) {\n var left = [];\n var normal = [];\n var right = [];\n cols.forEach(function (col) {\n var position = col.getColDef().lockPosition;\n if (position === 'right') {\n right.push(col);\n }\n else if (position === 'left' || position === true) {\n left.push(col);\n }\n else {\n normal.push(col);\n }\n });\n return __spreadArray$s(__spreadArray$s(__spreadArray$s([], __read$A(left), false), __read$A(normal), false), __read$A(right), false);\n };\n ColumnModel.prototype.addAutoGroupToGridColumns = function () {\n if (missing(this.groupAutoColumns)) {\n this.destroyOldColumns(this.groupAutoColsBalancedTree);\n this.groupAutoColsBalancedTree = null;\n return;\n }\n this.gridColumns = this.groupAutoColumns ? this.groupAutoColumns.concat(this.gridColumns) : this.gridColumns;\n var newAutoColsTree = this.columnFactory.createForAutoGroups(this.groupAutoColumns, this.gridBalancedTree);\n this.destroyOldColumns(this.groupAutoColsBalancedTree, newAutoColsTree);\n this.groupAutoColsBalancedTree = newAutoColsTree;\n this.gridBalancedTree = newAutoColsTree.concat(this.gridBalancedTree);\n };\n // gets called after we copy down grid columns, to make sure any part of the gui\n // that tries to draw, eg the header, it will get empty lists of columns rather\n // than stale columns. for example, the header will received gridColumnsChanged\n // event, so will try and draw, but it will draw successfully when it acts on the\n // virtualColumnsChanged event\n ColumnModel.prototype.clearDisplayedAndViewportColumns = function () {\n this.viewportRowLeft = {};\n this.viewportRowRight = {};\n this.viewportRowCenter = {};\n this.displayedColumnsLeft = [];\n this.displayedColumnsRight = [];\n this.displayedColumnsCenter = [];\n this.displayedColumns = [];\n this.ariaOrderColumns = [];\n this.viewportColumns = [];\n this.headerViewportColumns = [];\n this.viewportColumnsHash = '';\n };\n ColumnModel.prototype.updateGroupsAndDisplayedColumns = function (source) {\n this.updateOpenClosedVisibilityInColumnGroups();\n this.deriveDisplayedColumns(source);\n this.refreshFlexedColumns();\n this.extractViewport();\n this.updateBodyWidths();\n // this event is picked up by the gui, headerRenderer and rowRenderer, to recalculate what columns to display\n var event = {\n type: Events.EVENT_DISPLAYED_COLUMNS_CHANGED\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.deriveDisplayedColumns = function (source) {\n this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft, this.displayedColumnsLeft);\n this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre, this.displayedColumnsCenter);\n this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight, this.displayedColumnsRight);\n this.joinColumnsAriaOrder();\n this.joinDisplayedColumns();\n this.setLeftValues(source);\n this.displayedAutoHeightCols = this.displayedColumns.filter(function (col) { return col.isAutoHeight(); });\n };\n ColumnModel.prototype.isAutoRowHeightActive = function () {\n return this.autoHeightActive;\n };\n ColumnModel.prototype.wasAutoRowHeightEverActive = function () {\n return this.autoHeightActiveAtLeastOnce;\n };\n ColumnModel.prototype.joinColumnsAriaOrder = function () {\n var e_3, _a;\n var allColumns = this.getAllGridColumns();\n var pinnedLeft = [];\n var center = [];\n var pinnedRight = [];\n try {\n for (var allColumns_1 = __values$a(allColumns), allColumns_1_1 = allColumns_1.next(); !allColumns_1_1.done; allColumns_1_1 = allColumns_1.next()) {\n var col = allColumns_1_1.value;\n var pinned = col.getPinned();\n if (!pinned) {\n center.push(col);\n }\n else if (pinned === true || pinned === 'left') {\n pinnedLeft.push(col);\n }\n else {\n pinnedRight.push(col);\n }\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (allColumns_1_1 && !allColumns_1_1.done && (_a = allColumns_1.return)) _a.call(allColumns_1);\n }\n finally { if (e_3) throw e_3.error; }\n }\n this.ariaOrderColumns = pinnedLeft.concat(center).concat(pinnedRight);\n };\n ColumnModel.prototype.joinDisplayedColumns = function () {\n if (this.gridOptionsService.get('enableRtl')) {\n this.displayedColumns = this.displayedColumnsRight\n .concat(this.displayedColumnsCenter)\n .concat(this.displayedColumnsLeft);\n }\n else {\n this.displayedColumns = this.displayedColumnsLeft\n .concat(this.displayedColumnsCenter)\n .concat(this.displayedColumnsRight);\n }\n };\n // sets the left pixel position of each column\n ColumnModel.prototype.setLeftValues = function (source) {\n this.setLeftValuesOfColumns(source);\n this.setLeftValuesOfGroups();\n };\n ColumnModel.prototype.setLeftValuesOfColumns = function (source) {\n var _this = this;\n if (!this.primaryColumns) {\n return;\n }\n // go through each list of displayed columns\n var allColumns = this.getPrimaryAndSecondaryAndAutoColumns().slice(0);\n // let totalColumnWidth = this.getWidthOfColsInList()\n var doingRtl = this.gridOptionsService.get('enableRtl');\n [\n this.displayedColumnsLeft,\n this.displayedColumnsRight,\n this.displayedColumnsCenter\n ].forEach(function (columns) {\n if (doingRtl) {\n // when doing RTL, we start at the top most pixel (ie RHS) and work backwards\n var left_1 = _this.getWidthOfColsInList(columns);\n columns.forEach(function (column) {\n left_1 -= column.getActualWidth();\n column.setLeft(left_1, source);\n });\n }\n else {\n // otherwise normal LTR, we start at zero\n var left_2 = 0;\n columns.forEach(function (column) {\n column.setLeft(left_2, source);\n left_2 += column.getActualWidth();\n });\n }\n removeAllFromUnorderedArray(allColumns, columns);\n });\n // items left in allColumns are columns not displayed, so remove the left position. this is\n // important for the rows, as if a col is made visible, then taken out, then made visible again,\n // we don't want the animation of the cell floating in from the old position, whatever that was.\n allColumns.forEach(function (column) {\n column.setLeft(null, source);\n });\n };\n ColumnModel.prototype.setLeftValuesOfGroups = function () {\n // a groups left value is the lest left value of it's children\n [\n this.displayedTreeLeft,\n this.displayedTreeRight,\n this.displayedTreeCentre\n ].forEach(function (columns) {\n columns.forEach(function (column) {\n if (column instanceof ColumnGroup) {\n var columnGroup = column;\n columnGroup.checkLeft();\n }\n });\n });\n };\n ColumnModel.prototype.derivedDisplayedColumnsFromDisplayedTree = function (tree, columns) {\n columns.length = 0;\n this.columnUtils.depthFirstDisplayedColumnTreeSearch(tree, function (child) {\n if (child instanceof Column) {\n columns.push(child);\n }\n });\n };\n ColumnModel.prototype.isColumnVirtualisationSuppressed = function () {\n // When running within jsdom the viewportRight is always 0, so we need to return true to allow\n // tests to validate all the columns.\n return this.suppressColumnVirtualisation || this.viewportRight === 0;\n };\n ColumnModel.prototype.extractViewportColumns = function () {\n if (this.isColumnVirtualisationSuppressed()) {\n // no virtualisation, so don't filter\n this.viewportColumnsCenter = this.displayedColumnsCenter;\n this.headerViewportColumnsCenter = this.displayedColumnsCenter;\n }\n else {\n // filter out what should be visible\n this.viewportColumnsCenter = this.displayedColumnsCenter.filter(this.isColumnInRowViewport.bind(this));\n this.headerViewportColumnsCenter = this.displayedColumnsCenter.filter(this.isColumnInHeaderViewport.bind(this));\n }\n this.viewportColumns = this.viewportColumnsCenter\n .concat(this.displayedColumnsLeft)\n .concat(this.displayedColumnsRight);\n this.headerViewportColumns = this.headerViewportColumnsCenter\n .concat(this.displayedColumnsLeft)\n .concat(this.displayedColumnsRight);\n };\n ColumnModel.prototype.getVirtualHeaderGroupRow = function (type, dept) {\n var result;\n switch (type) {\n case 'left':\n result = this.viewportRowLeft[dept];\n break;\n case 'right':\n result = this.viewportRowRight[dept];\n break;\n default:\n result = this.viewportRowCenter[dept];\n break;\n }\n if (missing(result)) {\n result = [];\n }\n return result;\n };\n ColumnModel.prototype.calculateHeaderRows = function () {\n // go through each group, see if any of it's cols are displayed, and if yes,\n // then this group is included\n this.viewportRowLeft = {};\n this.viewportRowRight = {};\n this.viewportRowCenter = {};\n // for easy lookup when building the groups.\n var virtualColIds = {};\n this.headerViewportColumns.forEach(function (col) { return virtualColIds[col.getId()] = true; });\n var testGroup = function (children, result, dept) {\n var returnValue = false;\n for (var i = 0; i < children.length; i++) {\n // see if this item is within viewport\n var child = children[i];\n var addThisItem = false;\n if (child instanceof Column) {\n // for column, test if column is included\n addThisItem = virtualColIds[child.getId()] === true;\n }\n else {\n // if group, base decision on children\n var columnGroup = child;\n var displayedChildren = columnGroup.getDisplayedChildren();\n if (displayedChildren) {\n addThisItem = testGroup(displayedChildren, result, dept + 1);\n }\n }\n if (addThisItem) {\n returnValue = true;\n if (!result[dept]) {\n result[dept] = [];\n }\n result[dept].push(child);\n }\n }\n return returnValue;\n };\n testGroup(this.displayedTreeLeft, this.viewportRowLeft, 0);\n testGroup(this.displayedTreeRight, this.viewportRowRight, 0);\n testGroup(this.displayedTreeCentre, this.viewportRowCenter, 0);\n };\n ColumnModel.prototype.extractViewport = function () {\n var hashColumn = function (c) { return \"\".concat(c.getId(), \"-\").concat(c.getPinned() || 'normal'); };\n this.extractViewportColumns();\n var newHash = this.viewportColumns.map(hashColumn).join('#');\n var changed = this.viewportColumnsHash !== newHash;\n if (changed) {\n this.viewportColumnsHash = newHash;\n this.calculateHeaderRows();\n }\n return changed;\n };\n ColumnModel.prototype.refreshFlexedColumns = function (params) {\n var _a;\n if (params === void 0) { params = {}; }\n var source = params.source ? params.source : 'flex';\n if (params.viewportWidth != null) {\n this.flexViewportWidth = params.viewportWidth;\n }\n if (!this.flexViewportWidth) {\n return [];\n }\n // If the grid has left-over space, divide it between flexing columns in proportion to their flex value.\n // A \"flexing column\" is one that has a 'flex' value set and is not currently being constrained by its\n // minWidth or maxWidth rules.\n var flexAfterDisplayIndex = -1;\n if (params.resizingCols) {\n var allResizingCols = new Set(params.resizingCols);\n // find the last resizing col, as only cols after this one are affected by the resizing\n var displayedCols = this.displayedColumnsCenter;\n for (var i = displayedCols.length - 1; i >= 0; i--) {\n if (allResizingCols.has(displayedCols[i])) {\n flexAfterDisplayIndex = i;\n break;\n }\n }\n }\n // the width of all of the columns for which the width has been determined\n var knownColumnsWidth = 0;\n var flexingColumns = [];\n // store the minimum width of all the flex columns, so we can determine if flex is even possible more quickly\n var minimumFlexedWidth = 0;\n var totalFlex = 0;\n for (var i = 0; i < this.displayedColumnsCenter.length; i++) {\n var isFlex = this.displayedColumnsCenter[i].getFlex() && i > flexAfterDisplayIndex;\n if (isFlex) {\n flexingColumns.push(this.displayedColumnsCenter[i]);\n totalFlex += this.displayedColumnsCenter[i].getFlex();\n minimumFlexedWidth += (_a = this.displayedColumnsCenter[i].getMinWidth()) !== null && _a !== void 0 ? _a : 0;\n }\n else {\n knownColumnsWidth += this.displayedColumnsCenter[i].getActualWidth();\n }\n }\n if (!flexingColumns.length) {\n return [];\n }\n var changedColumns = [];\n // this is for performance to prevent trying to flex when unnecessary\n if (knownColumnsWidth + minimumFlexedWidth > this.flexViewportWidth) {\n // known columns and the minimum width of all the flex cols are too wide for viewport\n // so don't flex\n flexingColumns.forEach(function (col) { var _a; return col.setActualWidth((_a = col.getMinWidth()) !== null && _a !== void 0 ? _a : 0, source); });\n // No columns should flex, but all have been changed. Swap arrays so events fire properly.\n // Expensive logic won't execute as flex columns is empty.\n changedColumns = flexingColumns;\n flexingColumns = [];\n }\n var flexingColumnSizes = [];\n var spaceForFlexingColumns;\n outer: while (true) {\n spaceForFlexingColumns = this.flexViewportWidth - knownColumnsWidth;\n var spacePerFlex = spaceForFlexingColumns / totalFlex;\n for (var i = 0; i < flexingColumns.length; i++) {\n var col = flexingColumns[i];\n var widthByFlexRule = spacePerFlex * col.getFlex();\n var constrainedWidth = 0;\n var minWidth = col.getMinWidth();\n var maxWidth = col.getMaxWidth();\n if (exists(minWidth) && widthByFlexRule < minWidth) {\n constrainedWidth = minWidth;\n }\n else if (exists(maxWidth) && widthByFlexRule > maxWidth) {\n constrainedWidth = maxWidth;\n }\n if (constrainedWidth) {\n // This column is not in fact flexing as it is being constrained to a specific size\n // so remove it from the list of flexing columns and start again\n col.setActualWidth(constrainedWidth, source);\n removeFromUnorderedArray(flexingColumns, col);\n totalFlex -= col.getFlex();\n changedColumns.push(col);\n knownColumnsWidth += col.getActualWidth();\n continue outer;\n }\n flexingColumnSizes[i] = Math.round(widthByFlexRule);\n }\n break;\n }\n var remainingSpace = spaceForFlexingColumns;\n flexingColumns.forEach(function (col, i) {\n col.setActualWidth(Math.min(flexingColumnSizes[i], remainingSpace), source);\n changedColumns.push(col);\n remainingSpace -= flexingColumnSizes[i];\n });\n if (!params.skipSetLeft) {\n this.setLeftValues(source);\n }\n if (params.updateBodyWidths) {\n this.updateBodyWidths();\n }\n if (params.fireResizedEvent) {\n this.dispatchColumnResizedEvent(changedColumns, true, source, flexingColumns);\n }\n return flexingColumns;\n };\n // called from api\n ColumnModel.prototype.sizeColumnsToFit = function (gridWidth, source, silent, params) {\n var _this = this;\n var _a, _b, _c, _d, _e;\n if (source === void 0) { source = \"sizeColumnsToFit\"; }\n if (this.shouldQueueResizeOperations) {\n this.resizeOperationQueue.push(function () { return _this.sizeColumnsToFit(gridWidth, source, silent, params); });\n return;\n }\n var limitsMap = {};\n if (params) {\n (_a = params === null || params === void 0 ? void 0 : params.columnLimits) === null || _a === void 0 ? void 0 : _a.forEach(function (_a) {\n var key = _a.key, dimensions = __rest(_a, [\"key\"]);\n limitsMap[typeof key === 'string' ? key : key.getColId()] = dimensions;\n });\n }\n // avoid divide by zero\n var allDisplayedColumns = this.getAllDisplayedColumns();\n var doColumnsAlreadyFit = gridWidth === this.getWidthOfColsInList(allDisplayedColumns);\n if (gridWidth <= 0 || !allDisplayedColumns.length || doColumnsAlreadyFit) {\n return;\n }\n var colsToSpread = [];\n var colsToNotSpread = [];\n allDisplayedColumns.forEach(function (column) {\n if (column.getColDef().suppressSizeToFit === true) {\n colsToNotSpread.push(column);\n }\n else {\n colsToSpread.push(column);\n }\n });\n // make a copy of the cols that are going to be resized\n var colsToDispatchEventFor = colsToSpread.slice(0);\n var finishedResizing = false;\n var moveToNotSpread = function (column) {\n removeFromArray(colsToSpread, column);\n colsToNotSpread.push(column);\n };\n // resetting cols to their original width makes the sizeColumnsToFit more deterministic,\n // rather than depending on the current size of the columns. most users call sizeColumnsToFit\n // immediately after grid is created, so will make no difference. however if application is calling\n // sizeColumnsToFit repeatedly (eg after column group is opened / closed repeatedly) we don't want\n // the columns to start shrinking / growing over time.\n //\n // NOTE: the process below will assign values to `this.actualWidth` of each column without firing events\n // for this reason we need to manually dispatch resize events after the resize has been done for each column.\n colsToSpread.forEach(function (column) {\n var _a, _b;\n column.resetActualWidth(source);\n var widthOverride = limitsMap === null || limitsMap === void 0 ? void 0 : limitsMap[column.getId()];\n var minOverride = ((_a = widthOverride === null || widthOverride === void 0 ? void 0 : widthOverride.minWidth) !== null && _a !== void 0 ? _a : params === null || params === void 0 ? void 0 : params.defaultMinWidth);\n var maxOverride = ((_b = widthOverride === null || widthOverride === void 0 ? void 0 : widthOverride.maxWidth) !== null && _b !== void 0 ? _b : params === null || params === void 0 ? void 0 : params.defaultMaxWidth);\n var colWidth = column.getActualWidth();\n if (typeof minOverride === 'number' && colWidth < minOverride) {\n column.setActualWidth(minOverride, source, true);\n }\n else if (typeof maxOverride === 'number' && colWidth > maxOverride) {\n column.setActualWidth(maxOverride, source, true);\n }\n });\n while (!finishedResizing) {\n finishedResizing = true;\n var availablePixels = gridWidth - this.getWidthOfColsInList(colsToNotSpread);\n if (availablePixels <= 0) {\n // no width, set everything to minimum\n colsToSpread.forEach(function (column) {\n var _a, _b;\n var widthOverride = (_b = (_a = limitsMap === null || limitsMap === void 0 ? void 0 : limitsMap[column.getId()]) === null || _a === void 0 ? void 0 : _a.minWidth) !== null && _b !== void 0 ? _b : params === null || params === void 0 ? void 0 : params.defaultMinWidth;\n if (typeof widthOverride === 'number') {\n column.setActualWidth(widthOverride, source, true);\n return;\n }\n column.setMinimum(source);\n });\n }\n else {\n var scale = availablePixels / this.getWidthOfColsInList(colsToSpread);\n // we set the pixels for the last col based on what's left, as otherwise\n // we could be a pixel or two short or extra because of rounding errors.\n var pixelsForLastCol = availablePixels;\n // backwards through loop, as we are removing items as we go\n for (var i = colsToSpread.length - 1; i >= 0; i--) {\n var column = colsToSpread[i];\n var widthOverride = limitsMap === null || limitsMap === void 0 ? void 0 : limitsMap[column.getId()];\n var minOverride = ((_b = widthOverride === null || widthOverride === void 0 ? void 0 : widthOverride.minWidth) !== null && _b !== void 0 ? _b : params === null || params === void 0 ? void 0 : params.defaultMinWidth);\n var maxOverride = ((_c = widthOverride === null || widthOverride === void 0 ? void 0 : widthOverride.maxWidth) !== null && _c !== void 0 ? _c : params === null || params === void 0 ? void 0 : params.defaultMaxWidth);\n var colMinWidth = (_d = column.getMinWidth()) !== null && _d !== void 0 ? _d : 0;\n var colMaxWidth = (_e = column.getMaxWidth()) !== null && _e !== void 0 ? _e : Number.MAX_VALUE;\n var minWidth = typeof minOverride === 'number' && minOverride > colMinWidth ? minOverride : column.getMinWidth();\n var maxWidth = typeof maxOverride === 'number' && maxOverride < colMaxWidth ? maxOverride : column.getMaxWidth();\n var newWidth = Math.round(column.getActualWidth() * scale);\n if (exists(minWidth) && newWidth < minWidth) {\n newWidth = minWidth;\n moveToNotSpread(column);\n finishedResizing = false;\n }\n else if (exists(maxWidth) && newWidth > maxWidth) {\n newWidth = maxWidth;\n moveToNotSpread(column);\n finishedResizing = false;\n }\n else if (i === 0) { // if this is the last column\n newWidth = pixelsForLastCol;\n }\n column.setActualWidth(newWidth, source, true);\n pixelsForLastCol -= newWidth;\n }\n }\n }\n // see notes above\n colsToDispatchEventFor.forEach(function (col) {\n col.fireColumnWidthChangedEvent(source);\n });\n this.setLeftValues(source);\n this.updateBodyWidths();\n if (silent) {\n return;\n }\n this.dispatchColumnResizedEvent(colsToDispatchEventFor, true, source);\n };\n ColumnModel.prototype.buildDisplayedTrees = function (visibleColumns) {\n var leftVisibleColumns = [];\n var rightVisibleColumns = [];\n var centerVisibleColumns = [];\n visibleColumns.forEach(function (column) {\n switch (column.getPinned()) {\n case \"left\":\n leftVisibleColumns.push(column);\n break;\n case \"right\":\n rightVisibleColumns.push(column);\n break;\n default:\n centerVisibleColumns.push(column);\n break;\n }\n });\n var groupInstanceIdCreator = new GroupInstanceIdCreator();\n this.displayedTreeLeft = this.displayedGroupCreator.createDisplayedGroups(leftVisibleColumns, groupInstanceIdCreator, 'left', this.displayedTreeLeft);\n this.displayedTreeRight = this.displayedGroupCreator.createDisplayedGroups(rightVisibleColumns, groupInstanceIdCreator, 'right', this.displayedTreeRight);\n this.displayedTreeCentre = this.displayedGroupCreator.createDisplayedGroups(centerVisibleColumns, groupInstanceIdCreator, null, this.displayedTreeCentre);\n this.updateDisplayedMap();\n };\n ColumnModel.prototype.updateDisplayedMap = function () {\n var _this = this;\n this.displayedColumnsAndGroupsMap = {};\n var func = function (child) {\n _this.displayedColumnsAndGroupsMap[child.getUniqueId()] = child;\n };\n this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeCentre, func);\n this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeLeft, func);\n this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeRight, func);\n };\n ColumnModel.prototype.isDisplayed = function (item) {\n var fromMap = this.displayedColumnsAndGroupsMap[item.getUniqueId()];\n // check for reference, in case new column / group with same id is now present\n return fromMap === item;\n };\n ColumnModel.prototype.updateOpenClosedVisibilityInColumnGroups = function () {\n var allColumnGroups = this.getAllDisplayedTrees();\n this.columnUtils.depthFirstAllColumnTreeSearch(allColumnGroups, function (child) {\n if (child instanceof ColumnGroup) {\n child.calculateDisplayedColumns();\n }\n });\n };\n ColumnModel.prototype.getGroupAutoColumns = function () {\n return this.groupAutoColumns;\n };\n /**\n * Creates new auto group columns if required\n * @returns whether auto cols have changed\n */\n ColumnModel.prototype.createGroupAutoColumnsIfNeeded = function () {\n var forceRecreateAutoGroups = this.forceRecreateAutoGroups;\n this.forceRecreateAutoGroups = false;\n if (!this.autoGroupsNeedBuilding) {\n return false;\n }\n this.autoGroupsNeedBuilding = false;\n var groupFullWidthRow = this.gridOptionsService.isGroupUseEntireRow(this.pivotMode);\n // we need to allow suppressing auto-column separately for group and pivot as the normal situation\n // is CSRM and user provides group column themselves for normal view, but when they go into pivot the\n // columns are generated by the grid so no opportunity for user to provide group column. so need a way\n // to suppress auto-col for grouping only, and not pivot.\n // however if using Viewport RM or SSRM and user is providing the columns, the user may wish full control\n // of the group column in this instance.\n var suppressAutoColumn = this.pivotMode ?\n this.gridOptionsService.get('pivotSuppressAutoColumn') : this.isGroupSuppressAutoColumn();\n var groupingActive = this.rowGroupColumns.length > 0 || this.gridOptionsService.get('treeData');\n var needAutoColumns = groupingActive && !suppressAutoColumn && !groupFullWidthRow;\n if (needAutoColumns) {\n var newAutoGroupCols = this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns);\n var autoColsDifferent = !this.autoColsEqual(newAutoGroupCols, this.groupAutoColumns);\n // we force recreate so new group cols pick up the new\n // definitions. otherwise we could ignore the new cols because they appear to be the same.\n if (autoColsDifferent || forceRecreateAutoGroups) {\n this.groupAutoColumns = newAutoGroupCols;\n return true;\n }\n }\n else {\n this.groupAutoColumns = null;\n }\n return false;\n };\n ColumnModel.prototype.isGroupSuppressAutoColumn = function () {\n var groupDisplayType = this.gridOptionsService.get('groupDisplayType');\n var isCustomRowGroups = groupDisplayType === 'custom';\n if (isCustomRowGroups) {\n return true;\n }\n var treeDataDisplayType = this.gridOptionsService.get('treeDataDisplayType');\n return treeDataDisplayType === 'custom';\n };\n ColumnModel.prototype.autoColsEqual = function (colsA, colsB) {\n return areEqual(colsA, colsB, function (a, b) { return a.getColId() === b.getColId(); });\n };\n ColumnModel.prototype.getWidthOfColsInList = function (columnList) {\n return columnList.reduce(function (width, col) { return width + col.getActualWidth(); }, 0);\n };\n ColumnModel.prototype.getFirstDisplayedColumn = function () {\n var isRtl = this.gridOptionsService.get('enableRtl');\n var queryOrder = [\n 'getDisplayedLeftColumns',\n 'getDisplayedCenterColumns',\n 'getDisplayedRightColumns'\n ];\n if (isRtl) {\n queryOrder.reverse();\n }\n for (var i = 0; i < queryOrder.length; i++) {\n var container = this[queryOrder[i]]();\n if (container.length) {\n return isRtl ? last(container) : container[0];\n }\n }\n return null;\n };\n ColumnModel.prototype.setColumnHeaderHeight = function (col, height) {\n var changed = col.setAutoHeaderHeight(height);\n if (changed) {\n var event_6 = {\n type: Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,\n column: col,\n columns: [col],\n source: 'autosizeColumnHeaderHeight',\n };\n this.eventService.dispatchEvent(event_6);\n }\n };\n ColumnModel.prototype.getColumnGroupHeaderRowHeight = function () {\n if (this.isPivotMode()) {\n return this.getPivotGroupHeaderHeight();\n }\n return this.getGroupHeaderHeight();\n };\n ColumnModel.prototype.getColumnHeaderRowHeight = function () {\n var defaultHeight = (this.isPivotMode() ?\n this.getPivotHeaderHeight() :\n this.getHeaderHeight());\n var displayedHeights = this.getAllDisplayedColumns()\n .filter(function (col) { return col.isAutoHeaderHeight(); })\n .map(function (col) { return col.getAutoHeaderHeight() || 0; });\n return Math.max.apply(Math, __spreadArray$s([defaultHeight], __read$A(displayedHeights), false));\n };\n ColumnModel.prototype.getHeaderHeight = function () {\n var _a;\n return (_a = this.gridOptionsService.get('headerHeight')) !== null && _a !== void 0 ? _a : this.environment.getFromTheme(25, 'headerHeight');\n };\n ColumnModel.prototype.getFloatingFiltersHeight = function () {\n var _a;\n return (_a = this.gridOptionsService.get('floatingFiltersHeight')) !== null && _a !== void 0 ? _a : this.getHeaderHeight();\n };\n ColumnModel.prototype.getGroupHeaderHeight = function () {\n var _a;\n return (_a = this.gridOptionsService.get('groupHeaderHeight')) !== null && _a !== void 0 ? _a : this.getHeaderHeight();\n };\n ColumnModel.prototype.getPivotHeaderHeight = function () {\n var _a;\n return (_a = this.gridOptionsService.get('pivotHeaderHeight')) !== null && _a !== void 0 ? _a : this.getHeaderHeight();\n };\n ColumnModel.prototype.getPivotGroupHeaderHeight = function () {\n var _a;\n return (_a = this.gridOptionsService.get('pivotGroupHeaderHeight')) !== null && _a !== void 0 ? _a : this.getGroupHeaderHeight();\n };\n ColumnModel.prototype.queueResizeOperations = function () {\n this.shouldQueueResizeOperations = true;\n };\n ColumnModel.prototype.processResizeOperations = function () {\n this.shouldQueueResizeOperations = false;\n this.resizeOperationQueue.forEach(function (resizeOperation) { return resizeOperation(); });\n this.resizeOperationQueue = [];\n };\n ColumnModel.prototype.resetColumnDefIntoColumn = function (column, source) {\n var userColDef = column.getUserProvidedColDef();\n if (!userColDef) {\n return false;\n }\n var newColDef = this.columnFactory.addColumnDefaultAndTypes(userColDef, column.getColId());\n column.setColDef(newColDef, userColDef, source);\n return true;\n };\n ColumnModel.prototype.isColumnGroupingLocked = function (column) {\n var groupLockGroupColumns = this.gridOptionsService.get('groupLockGroupColumns');\n if (!column.isRowGroupActive() || groupLockGroupColumns === 0) {\n return false;\n }\n if (groupLockGroupColumns === -1) {\n return true;\n }\n var colIndex = this.rowGroupColumns.findIndex(function (groupCol) { return groupCol.getColId() === column.getColId(); });\n return groupLockGroupColumns > colIndex;\n };\n ColumnModel.prototype.generateColumnStateForRowGroupAndPivotIndexes = function (updatedRowGroupColumnState, updatedPivotColumnState) {\n // Generally columns should appear in the order they were before. For any new columns, these should appear in the original col def order.\n // The exception is for columns that were added via `addGroupColumns`. These should appear at the end.\n // We don't have to worry about full updates, as in this case the arrays are correct, and they won't appear in the updated lists.\n var _this = this;\n var existingColumnStateUpdates = {};\n var orderColumns = function (updatedColumnState, colList, enableProp, initialEnableProp, indexProp, initialIndexProp) {\n if (!colList.length || !_this.primaryColumns) {\n return [];\n }\n var updatedColIdArray = Object.keys(updatedColumnState);\n var updatedColIds = new Set(updatedColIdArray);\n var newColIds = new Set(updatedColIdArray);\n var allColIds = new Set(colList.map(function (column) {\n var colId = column.getColId();\n newColIds.delete(colId);\n return colId;\n }).concat(updatedColIdArray));\n var colIdsInOriginalOrder = [];\n var originalOrderMap = {};\n var orderIndex = 0;\n for (var i = 0; i < _this.primaryColumns.length; i++) {\n var colId = _this.primaryColumns[i].getColId();\n if (allColIds.has(colId)) {\n colIdsInOriginalOrder.push(colId);\n originalOrderMap[colId] = orderIndex++;\n }\n }\n // follow approach in `resetColumnState`\n var index = 1000;\n var hasAddedNewCols = false;\n var lastIndex = 0;\n var processPrecedingNewCols = function (colId) {\n var originalOrderIndex = originalOrderMap[colId];\n for (var i = lastIndex; i < originalOrderIndex; i++) {\n var newColId = colIdsInOriginalOrder[i];\n if (newColIds.has(newColId)) {\n updatedColumnState[newColId][indexProp] = index++;\n newColIds.delete(newColId);\n }\n }\n lastIndex = originalOrderIndex;\n };\n colList.forEach(function (column) {\n var colId = column.getColId();\n if (updatedColIds.has(colId)) {\n // New col already exists. Add any other new cols that should be before it.\n processPrecedingNewCols(colId);\n updatedColumnState[colId][indexProp] = index++;\n }\n else {\n var colDef = column.getColDef();\n var missingIndex = colDef[indexProp] === null || (colDef[indexProp] === undefined && colDef[initialIndexProp] == null);\n if (missingIndex) {\n if (!hasAddedNewCols) {\n var propEnabled = colDef[enableProp] || (colDef[enableProp] === undefined && colDef[initialEnableProp]);\n if (propEnabled) {\n processPrecedingNewCols(colId);\n }\n else {\n // Reached the first manually added column. Add all the new columns now.\n newColIds.forEach(function (newColId) {\n // Rather than increment the index, just use the original order index - doesn't need to be contiguous.\n updatedColumnState[newColId][indexProp] = index + originalOrderMap[newColId];\n });\n index += colIdsInOriginalOrder.length;\n hasAddedNewCols = true;\n }\n }\n if (!existingColumnStateUpdates[colId]) {\n existingColumnStateUpdates[colId] = { colId: colId };\n }\n existingColumnStateUpdates[colId][indexProp] = index++;\n }\n }\n });\n };\n orderColumns(updatedRowGroupColumnState, this.rowGroupColumns, 'rowGroup', 'initialRowGroup', 'rowGroupIndex', 'initialRowGroupIndex');\n orderColumns(updatedPivotColumnState, this.pivotColumns, 'pivot', 'initialPivot', 'pivotIndex', 'initialPivotIndex');\n return Object.values(existingColumnStateUpdates);\n };\n ColumnModel.prototype.onColumnsReady = function () {\n var _this = this;\n var autoSizeStrategy = this.gridOptionsService.get('autoSizeStrategy');\n if (!autoSizeStrategy) {\n return;\n }\n var type = autoSizeStrategy.type;\n // ensure things like aligned grids have linked first\n setTimeout(function () {\n if (type === 'fitGridWidth') {\n var propColumnLimits = autoSizeStrategy.columnLimits, defaultMinWidth = autoSizeStrategy.defaultMinWidth, defaultMaxWidth = autoSizeStrategy.defaultMaxWidth;\n var columnLimits = propColumnLimits === null || propColumnLimits === void 0 ? void 0 : propColumnLimits.map(function (_a) {\n var key = _a.colId, minWidth = _a.minWidth, maxWidth = _a.maxWidth;\n return ({\n key: key,\n minWidth: minWidth,\n maxWidth: maxWidth\n });\n });\n _this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({\n defaultMinWidth: defaultMinWidth,\n defaultMaxWidth: defaultMaxWidth,\n columnLimits: columnLimits\n });\n }\n else if (type === 'fitProvidedWidth') {\n _this.sizeColumnsToFit(autoSizeStrategy.width, 'sizeColumnsToFit');\n }\n });\n };\n ColumnModel.prototype.onFirstDataRendered = function () {\n var _this = this;\n var autoSizeStrategy = this.gridOptionsService.get('autoSizeStrategy');\n if ((autoSizeStrategy === null || autoSizeStrategy === void 0 ? void 0 : autoSizeStrategy.type) !== 'fitCellContents') {\n return;\n }\n var columns = autoSizeStrategy.colIds, skipHeader = autoSizeStrategy.skipHeader;\n // ensure render has finished\n setTimeout(function () {\n if (columns) {\n _this.autoSizeColumns({\n columns: columns,\n skipHeader: skipHeader,\n source: 'autosizeColumns'\n });\n }\n else {\n _this.autoSizeAllColumns('autosizeColumns', skipHeader);\n }\n });\n };\n __decorate$2H([\n Autowired('expressionService')\n ], ColumnModel.prototype, \"expressionService\", void 0);\n __decorate$2H([\n Autowired('columnFactory')\n ], ColumnModel.prototype, \"columnFactory\", void 0);\n __decorate$2H([\n Autowired('displayedGroupCreator')\n ], ColumnModel.prototype, \"displayedGroupCreator\", void 0);\n __decorate$2H([\n Autowired('ctrlsService')\n ], ColumnModel.prototype, \"ctrlsService\", void 0);\n __decorate$2H([\n Autowired('autoWidthCalculator')\n ], ColumnModel.prototype, \"autoWidthCalculator\", void 0);\n __decorate$2H([\n Autowired('columnUtils')\n ], ColumnModel.prototype, \"columnUtils\", void 0);\n __decorate$2H([\n Autowired('columnAnimationService')\n ], ColumnModel.prototype, \"columnAnimationService\", void 0);\n __decorate$2H([\n Autowired('autoGroupColService')\n ], ColumnModel.prototype, \"autoGroupColService\", void 0);\n __decorate$2H([\n Optional('aggFuncService')\n ], ColumnModel.prototype, \"aggFuncService\", void 0);\n __decorate$2H([\n Optional('valueCache')\n ], ColumnModel.prototype, \"valueCache\", void 0);\n __decorate$2H([\n Optional('animationFrameService')\n ], ColumnModel.prototype, \"animationFrameService\", void 0);\n __decorate$2H([\n Autowired('sortController')\n ], ColumnModel.prototype, \"sortController\", void 0);\n __decorate$2H([\n Autowired('columnDefFactory')\n ], ColumnModel.prototype, \"columnDefFactory\", void 0);\n __decorate$2H([\n PostConstruct\n ], ColumnModel.prototype, \"init\", null);\n __decorate$2H([\n PreDestroy\n ], ColumnModel.prototype, \"destroyColumns\", null);\n __decorate$2H([\n __param$6(0, Qualifier('loggerFactory'))\n ], ColumnModel.prototype, \"setBeans\", null);\n ColumnModel = __decorate$2H([\n Bean('columnModel')\n ], ColumnModel);\n return ColumnModel;\n}(BeanStub));\nfunction convertSourceType(source) {\n // unfortunately they do not match so need to perform conversion\n return source === 'gridOptionsUpdated' ? 'gridOptionsChanged' : source;\n}\n\nvar __extends$3d = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2G = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n// takes in a list of columns, as specified by the column definitions, and returns column groups\nvar ColumnUtils = /** @class */ (function (_super) {\n __extends$3d(ColumnUtils, _super);\n function ColumnUtils() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ColumnUtils.prototype.calculateColMinWidth = function (colDef) {\n return colDef.minWidth != null ? colDef.minWidth : this.environment.getMinColWidth();\n };\n ColumnUtils.prototype.calculateColMaxWidth = function (colDef) {\n return colDef.maxWidth != null ? colDef.maxWidth : Number.MAX_SAFE_INTEGER;\n };\n ColumnUtils.prototype.calculateColInitialWidth = function (colDef) {\n var minColWidth = this.calculateColMinWidth(colDef);\n var maxColWidth = this.calculateColMaxWidth(colDef);\n var width;\n var colDefWidth = attrToNumber(colDef.width);\n var colDefInitialWidth = attrToNumber(colDef.initialWidth);\n if (colDefWidth != null) {\n width = colDefWidth;\n }\n else if (colDefInitialWidth != null) {\n width = colDefInitialWidth;\n }\n else {\n width = 200;\n }\n return Math.max(Math.min(width, maxColWidth), minColWidth);\n };\n ColumnUtils.prototype.getOriginalPathForColumn = function (column, originalBalancedTree) {\n var result = [];\n var found = false;\n var recursePath = function (balancedColumnTree, dept) {\n for (var i = 0; i < balancedColumnTree.length; i++) {\n if (found) {\n return;\n }\n // quit the search, so 'result' is kept with the found result\n var node = balancedColumnTree[i];\n if (node instanceof ProvidedColumnGroup) {\n var nextNode = node;\n recursePath(nextNode.getChildren(), dept + 1);\n result[dept] = node;\n }\n else if (node === column) {\n found = true;\n }\n }\n };\n recursePath(originalBalancedTree, 0);\n // we should always find the path, but in case there is a bug somewhere, returning null\n // will make it fail rather than provide a 'hard to track down' bug\n return found ? result : null;\n };\n ColumnUtils.prototype.depthFirstOriginalTreeSearch = function (parent, tree, callback) {\n var _this = this;\n if (!tree) {\n return;\n }\n tree.forEach(function (child) {\n if (child instanceof ProvidedColumnGroup) {\n _this.depthFirstOriginalTreeSearch(child, child.getChildren(), callback);\n }\n callback(child, parent);\n });\n };\n ColumnUtils.prototype.depthFirstAllColumnTreeSearch = function (tree, callback) {\n var _this = this;\n if (!tree) {\n return;\n }\n tree.forEach(function (child) {\n if (child instanceof ColumnGroup) {\n _this.depthFirstAllColumnTreeSearch(child.getChildren(), callback);\n }\n callback(child);\n });\n };\n ColumnUtils.prototype.depthFirstDisplayedColumnTreeSearch = function (tree, callback) {\n var _this = this;\n if (!tree) {\n return;\n }\n tree.forEach(function (child) {\n if (child instanceof ColumnGroup) {\n _this.depthFirstDisplayedColumnTreeSearch(child.getDisplayedChildren(), callback);\n }\n callback(child);\n });\n };\n ColumnUtils = __decorate$2G([\n Bean('columnUtils')\n ], ColumnUtils);\n return ColumnUtils;\n}(BeanStub));\n\nvar __extends$3c = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2F = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n// takes in a list of columns, as specified by the column definitions, and returns column groups\nvar DisplayedGroupCreator = /** @class */ (function (_super) {\n __extends$3c(DisplayedGroupCreator, _super);\n function DisplayedGroupCreator() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DisplayedGroupCreator.prototype.createDisplayedGroups = function (\n // all displayed columns sorted - this is the columns the grid should show\n sortedVisibleColumns, \n // creates unique id's for the group\n groupInstanceIdCreator, \n // whether it's left, right or center col\n pinned, \n // we try to reuse old groups if we can, to allow gui to do animation\n oldDisplayedGroups) {\n var _this = this;\n var oldColumnsMapped = this.mapOldGroupsById(oldDisplayedGroups);\n /**\n * The following logic starts at the leaf level of columns, iterating through them to build their parent\n * groups when the parents match.\n *\n * The created groups are then added to an array, and similarly iterated on until we reach the top level.\n *\n * When row groups have no original parent, it's added to the result.\n */\n var topLevelResultCols = [];\n // this is an array of cols or col groups at one level of depth, starting from leaf and ending at root\n var groupsOrColsAtCurrentLevel = sortedVisibleColumns;\n var _loop_1 = function () {\n // store what's currently iterating so the function can build the next level of col groups\n var currentlyIterating = groupsOrColsAtCurrentLevel;\n groupsOrColsAtCurrentLevel = [];\n // store the index of the last row which was different from the previous row, this is used as a slice\n // index for finding the children to group together\n var lastGroupedColIdx = 0;\n // create a group of children from lastGroupedColIdx to the provided `to` parameter\n var createGroupToIndex = function (to) {\n var from = lastGroupedColIdx;\n lastGroupedColIdx = to;\n var previousNode = currentlyIterating[from];\n var previousNodeProvided = previousNode instanceof ColumnGroup ? previousNode.getProvidedColumnGroup() : previousNode;\n var previousNodeParent = previousNodeProvided.getOriginalParent();\n if (previousNodeParent == null) {\n // if the last node was different, and had a null parent, then we add all the nodes to the final\n // results)\n for (var i = from; i < to; i++) {\n topLevelResultCols.push(currentlyIterating[i]);\n }\n return;\n }\n // the parent differs from the previous node, so we create a group from the previous node\n // and add all to the result array, except the current node.\n var newGroup = _this.createColumnGroup(previousNodeParent, groupInstanceIdCreator, oldColumnsMapped, pinned);\n for (var i = from; i < to; i++) {\n newGroup.addChild(currentlyIterating[i]);\n }\n groupsOrColsAtCurrentLevel.push(newGroup);\n };\n for (var i = 1; i < currentlyIterating.length; i++) {\n var thisNode = currentlyIterating[i];\n var thisNodeProvided = thisNode instanceof ColumnGroup ? thisNode.getProvidedColumnGroup() : thisNode;\n var thisNodeParent = thisNodeProvided.getOriginalParent();\n var previousNode = currentlyIterating[lastGroupedColIdx];\n var previousNodeProvided = previousNode instanceof ColumnGroup ? previousNode.getProvidedColumnGroup() : previousNode;\n var previousNodeParent = previousNodeProvided.getOriginalParent();\n if (thisNodeParent !== previousNodeParent) {\n createGroupToIndex(i);\n }\n }\n if (lastGroupedColIdx < currentlyIterating.length) {\n createGroupToIndex(currentlyIterating.length);\n }\n };\n while (groupsOrColsAtCurrentLevel.length) {\n _loop_1();\n }\n this.setupParentsIntoColumns(topLevelResultCols, null);\n return topLevelResultCols;\n };\n DisplayedGroupCreator.prototype.createColumnGroup = function (providedGroup, groupInstanceIdCreator, oldColumnsMapped, pinned) {\n var groupId = providedGroup.getGroupId();\n var instanceId = groupInstanceIdCreator.getInstanceIdForKey(groupId);\n var uniqueId = ColumnGroup.createUniqueId(groupId, instanceId);\n var columnGroup = oldColumnsMapped[uniqueId];\n // if the user is setting new colDefs, it is possible that the id's overlap, and we\n // would have a false match from above. so we double check we are talking about the\n // same original column group.\n if (columnGroup && columnGroup.getProvidedColumnGroup() !== providedGroup) {\n columnGroup = null;\n }\n if (exists(columnGroup)) {\n // clean out the old column group here, as we will be adding children into it again\n columnGroup.reset();\n }\n else {\n columnGroup = new ColumnGroup(providedGroup, groupId, instanceId, pinned);\n this.context.createBean(columnGroup);\n }\n return columnGroup;\n };\n // returns back a 2d map of ColumnGroup as follows: groupId -> instanceId -> ColumnGroup\n DisplayedGroupCreator.prototype.mapOldGroupsById = function (displayedGroups) {\n var result = {};\n var recursive = function (columnsOrGroups) {\n columnsOrGroups.forEach(function (columnOrGroup) {\n if (columnOrGroup instanceof ColumnGroup) {\n var columnGroup = columnOrGroup;\n result[columnOrGroup.getUniqueId()] = columnGroup;\n recursive(columnGroup.getChildren());\n }\n });\n };\n if (displayedGroups) {\n recursive(displayedGroups);\n }\n return result;\n };\n DisplayedGroupCreator.prototype.setupParentsIntoColumns = function (columnsOrGroups, parent) {\n var _this = this;\n columnsOrGroups.forEach(function (columnsOrGroup) {\n columnsOrGroup.setParent(parent);\n if (columnsOrGroup instanceof ColumnGroup) {\n var columnGroup = columnsOrGroup;\n _this.setupParentsIntoColumns(columnGroup.getChildren(), columnGroup);\n }\n });\n };\n DisplayedGroupCreator = __decorate$2F([\n Bean('displayedGroupCreator')\n ], DisplayedGroupCreator);\n return DisplayedGroupCreator;\n}(BeanStub));\n\nvar __read$z = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$r = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar INITIAL_GRID_OPTION_KEYS = {\n enableBrowserTooltips: true,\n tooltipTrigger: true,\n tooltipMouseTrack: true,\n tooltipInteraction: true,\n defaultColGroupDef: true,\n suppressAutoSize: true,\n skipHeaderOnAutoSize: true,\n autoSizeStrategy: true,\n components: true,\n stopEditingWhenCellsLoseFocus: true,\n undoRedoCellEditing: true,\n undoRedoCellEditingLimit: true,\n excelStyles: true,\n cacheQuickFilter: true,\n excludeHiddenColumnsFromQuickFilter: true,\n advancedFilterModel: true,\n customChartThemes: true,\n chartThemeOverrides: true,\n enableChartToolPanelsButton: true,\n suppressChartToolPanelsButton: true,\n chartToolPanelsDef: true,\n loadingCellRendererSelector: true,\n localeText: true,\n keepDetailRows: true,\n keepDetailRowsCount: true,\n detailRowHeight: true,\n detailRowAutoHeight: true,\n tabIndex: true,\n valueCache: true,\n valueCacheNeverExpires: true,\n enableCellExpressions: true,\n suppressParentsInRowNodes: true,\n suppressTouch: true,\n suppressAsyncEvents: true,\n suppressBrowserResizeObserver: true,\n suppressPropertyNamesCheck: true,\n debug: true,\n loadingOverlayComponent: true,\n suppressLoadingOverlay: true,\n noRowsOverlayComponent: true,\n paginationPageSizeSelector: true,\n paginateChildRows: true,\n pivotPanelShow: true,\n pivotSuppressAutoColumn: true,\n suppressExpandablePivotGroups: true,\n aggFuncs: true,\n suppressAggFuncInHeader: true,\n suppressAggAtRootLevel: true,\n removePivotHeaderRowWhenSingleValueColumn: true,\n allowShowChangeAfterFilter: true,\n ensureDomOrder: true,\n enableRtl: true,\n suppressColumnVirtualisation: true,\n suppressMaxRenderedRowRestriction: true,\n suppressRowVirtualisation: true,\n rowDragText: true,\n suppressGroupMaintainValueType: true,\n groupLockGroupColumns: true,\n rowGroupPanelSuppressSort: true,\n suppressGroupRowsSticky: true,\n rowModelType: true,\n cacheOverflowSize: true,\n infiniteInitialRowCount: true,\n serverSideInitialRowCount: true,\n suppressServerSideInfiniteScroll: true,\n maxBlocksInCache: true,\n maxConcurrentDatasourceRequests: true,\n blockLoadDebounceMillis: true,\n serverSideOnlyRefreshFilteredGroups: true,\n serverSidePivotResultFieldSeparator: true,\n viewportRowModelPageSize: true,\n viewportRowModelBufferSize: true,\n debounceVerticalScrollbar: true,\n suppressAnimationFrame: true,\n suppressPreventDefaultOnMouseWheel: true,\n scrollbarWidth: true,\n icons: true,\n suppressRowTransform: true,\n gridId: true,\n functionsPassive: true,\n enableGroupEdit: true,\n initialState: true,\n processUnpinnedColumns: true,\n createChartContainer: true,\n getLocaleText: true,\n getRowId: true,\n reactiveCustomComponents: true,\n columnMenu: true,\n};\n/**\n * These keys are used for validating properties supplied on a gridOptions object, and for code generation.\n * If you change the properties on the gridOptions interface, you *must* update this file as well to be consistent.\n */\nvar PropertyKeys = /** @class */ (function () {\n function PropertyKeys() {\n }\n PropertyKeys.STRING_PROPERTIES = [\n 'rowSelection', 'overlayLoadingTemplate', 'overlayNoRowsTemplate', 'gridId', 'quickFilterText', 'rowModelType', 'editType', 'domLayout',\n 'clipboardDelimiter', 'rowGroupPanelShow', 'multiSortKey', 'pivotColumnGroupTotals', 'pivotRowTotals', 'pivotPanelShow', 'fillHandleDirection',\n 'groupDisplayType', 'treeDataDisplayType', 'colResizeDefault', 'tooltipTrigger', 'serverSidePivotResultFieldSeparator', 'columnMenu',\n ];\n PropertyKeys.OBJECT_PROPERTIES = [\n 'components', 'rowStyle', 'context', 'autoGroupColumnDef', 'localeText', 'icons', 'datasource', 'serverSideDatasource', 'viewportDatasource',\n 'groupRowRendererParams', 'aggFuncs', 'fullWidthCellRendererParams', 'defaultColGroupDef', 'defaultColDef', 'defaultCsvExportParams',\n 'defaultExcelExportParams', 'columnTypes', 'rowClassRules', 'detailCellRendererParams', 'loadingCellRendererParams', 'loadingOverlayComponentParams',\n 'noRowsOverlayComponentParams', 'popupParent', 'statusBar', 'sideBar', 'chartThemeOverrides', 'customChartThemes', 'chartToolPanelsDef',\n 'dataTypeDefinitions', 'advancedFilterModel', 'advancedFilterParent', 'advancedFilterBuilderParams', 'initialState', 'autoSizeStrategy',\n ];\n PropertyKeys.ARRAY_PROPERTIES = [\n 'sortingOrder', 'alignedGrids', 'rowData', 'columnDefs', 'excelStyles', 'pinnedTopRowData', 'pinnedBottomRowData', 'chartThemes',\n 'rowClass', 'paginationPageSizeSelector',\n ];\n PropertyKeys.NUMBER_PROPERTIES = [\n 'rowHeight', 'detailRowHeight', 'rowBuffer', 'headerHeight', 'groupHeaderHeight', 'groupLockGroupColumns', 'floatingFiltersHeight',\n 'pivotHeaderHeight', 'pivotGroupHeaderHeight', 'groupDefaultExpanded', 'pivotDefaultExpanded', 'viewportRowModelPageSize',\n 'viewportRowModelBufferSize', 'autoSizePadding', 'maxBlocksInCache', 'maxConcurrentDatasourceRequests', 'tooltipShowDelay',\n 'tooltipHideDelay', 'cacheOverflowSize', 'paginationPageSize', 'cacheBlockSize', 'infiniteInitialRowCount', 'serverSideInitialRowCount',\n 'scrollbarWidth', 'asyncTransactionWaitMillis', 'blockLoadDebounceMillis', 'keepDetailRowsCount', 'undoRedoCellEditingLimit',\n 'cellFlashDelay', 'cellFadeDelay', 'cellFlashDuration', 'cellFadeDuration', 'tabIndex'\n ];\n PropertyKeys.BOOLEAN_PROPERTIES = [\n 'suppressMakeColumnVisibleAfterUnGroup', 'suppressRowClickSelection', 'suppressCellFocus', 'suppressHeaderFocus', 'suppressHorizontalScroll', 'groupSelectsChildren',\n 'alwaysShowHorizontalScroll', 'alwaysShowVerticalScroll', 'debug', 'enableBrowserTooltips', 'enableCellExpressions', 'groupIncludeTotalFooter',\n 'groupSuppressBlankHeader', 'suppressMenuHide', 'suppressRowDeselection', 'unSortIcon', 'suppressMultiSort', 'alwaysMultiSort', 'singleClickEdit',\n 'suppressLoadingOverlay', 'suppressNoRowsOverlay', 'suppressAutoSize', 'skipHeaderOnAutoSize', 'suppressParentsInRowNodes', 'suppressColumnMoveAnimation',\n 'suppressMovableColumns', 'suppressFieldDotNotation', 'enableRangeSelection', 'enableRangeHandle', 'enableFillHandle', 'suppressClearOnFillReduction',\n 'deltaSort', 'suppressTouch', 'suppressAsyncEvents', 'allowContextMenuWithControlKey', 'suppressContextMenu', 'enableCellChangeFlash',\n 'suppressDragLeaveHidesColumns', 'suppressRowGroupHidesColumns', 'suppressMiddleClickScrolls', 'suppressPreventDefaultOnMouseWheel',\n 'suppressCopyRowsToClipboard', 'copyHeadersToClipboard', 'copyGroupHeadersToClipboard', 'pivotMode', 'suppressAggFuncInHeader',\n 'suppressColumnVirtualisation', 'alwaysAggregateAtRootLevel', 'suppressAggAtRootLevel', 'suppressFocusAfterRefresh', 'functionsPassive',\n 'functionsReadOnly', 'animateRows', 'groupSelectsFiltered', 'groupRemoveSingleChildren', 'groupRemoveLowestSingleChildren', 'enableRtl',\n 'suppressClickEdit', 'rowDragEntireRow', 'rowDragManaged', 'suppressRowDrag', 'suppressMoveWhenRowDragging', 'rowDragMultiRow', 'enableGroupEdit',\n 'embedFullWidthRows', 'suppressPaginationPanel', 'groupHideOpenParents', 'groupAllowUnbalanced', 'pagination', 'paginationAutoPageSize',\n 'suppressScrollOnNewData', 'suppressScrollWhenPopupsAreOpen', 'purgeClosedRowNodes', 'cacheQuickFilter', 'includeHiddenColumnsInQuickFilter',\n 'excludeHiddenColumnsFromQuickFilter', 'ensureDomOrder', 'accentedSort', 'suppressChangeDetection', 'valueCache', 'valueCacheNeverExpires',\n 'aggregateOnlyChangedColumns', 'suppressAnimationFrame', 'suppressExcelExport', 'suppressCsvExport', 'includeHiddenColumnsInAdvancedFilter',\n 'suppressMultiRangeSelection', 'enterMovesDown', 'enterMovesDownAfterEdit', 'enterNavigatesVerticallyAfterEdit', 'enterNavigatesVertically',\n 'suppressPropertyNamesCheck', 'rowMultiSelectWithClick', 'suppressRowHoverHighlight', 'suppressRowTransform', 'suppressClipboardPaste',\n 'suppressLastEmptyLineOnPaste', 'enableCharts', 'enableChartToolPanelsButton', 'suppressChartToolPanelsButton', 'suppressMaintainUnsortedOrder',\n 'enableCellTextSelection', 'suppressBrowserResizeObserver', 'suppressMaxRenderedRowRestriction', 'excludeChildrenWhenTreeDataFiltering',\n 'tooltipMouseTrack', 'tooltipInteraction', 'keepDetailRows', 'paginateChildRows', 'preventDefaultOnContextMenu', 'undoRedoCellEditing',\n 'allowDragFromColumnsToolPanel', 'pivotSuppressAutoColumn', 'suppressExpandablePivotGroups', 'debounceVerticalScrollbar', 'detailRowAutoHeight',\n 'serverSideFilterAllLevels', 'serverSideSortAllLevels', 'serverSideEnableClientSideSort', 'serverSideOnlyRefreshFilteredGroups', 'serverSideSortOnServer', 'serverSideFilterOnServer',\n 'suppressAggFilteredOnly', 'showOpenedGroup', 'suppressClipboardApi', 'suppressModelUpdateAfterUpdateTransaction', 'stopEditingWhenCellsLoseFocus',\n 'maintainColumnOrder', 'groupMaintainOrder', 'columnHoverHighlight', 'readOnlyEdit', 'suppressRowVirtualisation', 'enableCellEditingOnBackspace',\n 'resetRowDataOnUpdate', 'removePivotHeaderRowWhenSingleValueColumn', 'suppressCopySingleCellRanges', 'suppressGroupRowsSticky', 'suppressCutToClipboard',\n 'suppressServerSideInfiniteScroll', 'rowGroupPanelSuppressSort', 'allowShowChangeAfterFilter', 'enableAdvancedFilter', 'masterDetail', 'treeData',\n 'suppressGroupMaintainValueType', 'reactiveCustomComponents'\n ];\n /** You do not need to include event callbacks in this list, as they are generated automatically. */\n PropertyKeys.FUNCTIONAL_PROPERTIES = [\n 'doesExternalFilterPass', 'processPivotResultColDef', 'processPivotResultColGroupDef', 'getBusinessKeyForNode', 'isRowSelectable', 'rowDragText',\n 'groupRowRenderer', 'fullWidthCellRenderer', 'loadingCellRenderer', 'loadingOverlayComponent', 'noRowsOverlayComponent', 'detailCellRenderer',\n 'quickFilterParser', 'quickFilterMatcher'\n ];\n /** These callbacks extend AgGridCommon interface */\n PropertyKeys.CALLBACK_PROPERTIES = [\n 'getLocaleText', 'isExternalFilterPresent', 'getRowHeight', 'getRowClass', 'getRowStyle', 'getContextMenuItems', 'getMainMenuItems',\n 'processRowPostCreate', 'processCellForClipboard', 'getGroupRowAgg', 'isFullWidthRow', 'sendToClipboard', 'navigateToNextHeader',\n 'tabToNextHeader', 'navigateToNextCell', 'tabToNextCell', 'processCellFromClipboard', 'getDocument', 'postProcessPopup', 'getChildCount',\n 'getDataPath', 'isRowMaster', 'postSortRows', 'processHeaderForClipboard', 'processUnpinnedColumns', 'processGroupHeaderForClipboard',\n 'paginationNumberFormatter', 'processDataFromClipboard', 'getServerSideGroupKey', 'isServerSideGroup', 'createChartContainer',\n 'getChartToolbarItems', 'fillOperation', 'isApplyServerSideTransaction', 'getServerSideGroupLevelParams', 'isServerSideGroupOpenByDefault',\n 'isGroupOpenByDefault', 'initialGroupOrderComparator', 'groupIncludeFooter', 'loadingCellRendererSelector', 'getRowId', 'groupAggFiltering'\n ];\n PropertyKeys.FUNCTION_PROPERTIES = __spreadArray$r(__spreadArray$r([], __read$z(PropertyKeys.FUNCTIONAL_PROPERTIES), false), __read$z(PropertyKeys.CALLBACK_PROPERTIES), false);\n PropertyKeys.ALL_PROPERTIES = __spreadArray$r(__spreadArray$r(__spreadArray$r(__spreadArray$r(__spreadArray$r(__spreadArray$r([], __read$z(PropertyKeys.ARRAY_PROPERTIES), false), __read$z(PropertyKeys.OBJECT_PROPERTIES), false), __read$z(PropertyKeys.STRING_PROPERTIES), false), __read$z(PropertyKeys.NUMBER_PROPERTIES), false), __read$z(PropertyKeys.FUNCTION_PROPERTIES), false), __read$z(PropertyKeys.BOOLEAN_PROPERTIES), false);\n return PropertyKeys;\n}());\n\nvar __assign$q = ( false) || function () {\n __assign$q = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$q.apply(this, arguments);\n};\nvar __read$y = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$q = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar ComponentUtil = /** @class */ (function () {\n function ComponentUtil() {\n }\n ComponentUtil.getCallbackForEvent = function (eventName) {\n if (!eventName || eventName.length < 2) {\n return eventName;\n }\n return 'on' + eventName[0].toUpperCase() + eventName.substring(1);\n };\n ComponentUtil.getGridOptionKeys = function () {\n // Vue does not have keys in prod so instead need to run through all the \n // gridOptions checking for presence of a gridOption key.\n return this.ALL_PROPERTIES_AND_CALLBACKS;\n };\n /** Combines component props / attributes with the provided gridOptions returning a new combined gridOptions object */\n ComponentUtil.combineAttributesAndGridOptions = function (gridOptions, component) {\n // create empty grid options if none were passed\n if (typeof gridOptions !== 'object') {\n gridOptions = {};\n }\n // shallow copy (so we don't change the provided object)\n var mergedOptions = __assign$q({}, gridOptions);\n var keys = ComponentUtil.getGridOptionKeys();\n // Loop through component props, if they are not undefined and a valid gridOption copy to gridOptions\n keys.forEach(function (key) {\n var value = component[key];\n if (typeof value !== 'undefined' && value !== ComponentUtil.VUE_OMITTED_PROPERTY) {\n mergedOptions[key] = value;\n }\n });\n return mergedOptions;\n };\n ComponentUtil.processOnChange = function (changes, api) {\n if (!changes) {\n return;\n }\n // Only process changes to properties that are part of the gridOptions\n var gridChanges = {};\n var hasChanges = false;\n Object.keys(changes)\n .filter(function (key) { return ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS_SET.has(key); })\n .forEach(function (key) {\n gridChanges[key] = changes[key];\n hasChanges = true;\n });\n if (!hasChanges) {\n return;\n }\n api.__internalUpdateGridOptions(gridChanges);\n // copy gridChanges into an event for dispatch\n var event = {\n type: Events.EVENT_COMPONENT_STATE_CHANGED\n };\n iterateObject(gridChanges, function (key, value) {\n event[key] = value;\n });\n api.dispatchEvent(event);\n };\n var _a;\n _a = ComponentUtil;\n // all events\n ComponentUtil.EVENTS = values(Events);\n ComponentUtil.VUE_OMITTED_PROPERTY = 'AG-VUE-OMITTED-PROPERTY';\n // events that are internal to AG Grid and should not be exposed to users via documentation or generated framework components\n /** Exclude the following internal events from code generation to prevent exposing these events via framework components */\n ComponentUtil.EXCLUDED_INTERNAL_EVENTS = [\n Events.EVENT_SCROLLBAR_WIDTH_CHANGED,\n Events.EVENT_CHECKBOX_CHANGED,\n Events.EVENT_HEIGHT_SCALE_CHANGED,\n Events.EVENT_BODY_HEIGHT_CHANGED,\n Events.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,\n Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,\n Events.EVENT_SCROLL_VISIBILITY_CHANGED,\n Events.EVENT_COLUMN_HOVER_CHANGED,\n Events.EVENT_FLASH_CELLS,\n Events.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,\n Events.EVENT_DISPLAYED_ROWS_CHANGED,\n Events.EVENT_LEFT_PINNED_WIDTH_CHANGED,\n Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED,\n Events.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,\n Events.EVENT_POPUP_TO_FRONT,\n Events.EVENT_STORE_UPDATED,\n Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,\n Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END,\n Events.EVENT_FILL_START,\n Events.EVENT_FILL_END,\n Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,\n Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,\n Events.EVENT_FULL_WIDTH_ROW_FOCUSED,\n Events.EVENT_HEADER_HEIGHT_CHANGED,\n Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,\n Events.EVENT_CELL_FOCUS_CLEARED,\n Events.EVENT_GRID_STYLES_CHANGED,\n Events.EVENT_FILTER_DESTROYED,\n Events.EVENT_ROW_DATA_UPDATE_STARTED,\n Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,\n Events.EVENT_DATA_TYPES_INFERRED,\n Events.EVENT_FIELD_VALUE_CHANGED,\n Events.EVENT_FIELD_PICKER_VALUE_SELECTED,\n Events.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,\n Events.EVENT_SUPPRESS_MENU_HIDE_CHANGED,\n Events.EVENT_SUPPRESS_FIELD_DOT_NOTATION,\n Events.EVENT_ROW_COUNT_READY,\n Events.EVENT_SIDE_BAR_UPDATED,\n ];\n // events that are available for use by users of AG Grid and so should be documented\n /** EVENTS that should be exposed via code generation for the framework components. */\n ComponentUtil.PUBLIC_EVENTS = ComponentUtil.EVENTS.filter(function (e) { return !includes(ComponentUtil.EXCLUDED_INTERNAL_EVENTS, e); });\n // onXXX methods, based on the above events\n ComponentUtil.EVENT_CALLBACKS = ComponentUtil.EVENTS.map(function (event) { return ComponentUtil.getCallbackForEvent(event); });\n ComponentUtil.STRING_PROPERTIES = PropertyKeys.STRING_PROPERTIES;\n ComponentUtil.OBJECT_PROPERTIES = PropertyKeys.OBJECT_PROPERTIES;\n ComponentUtil.ARRAY_PROPERTIES = PropertyKeys.ARRAY_PROPERTIES;\n ComponentUtil.NUMBER_PROPERTIES = PropertyKeys.NUMBER_PROPERTIES;\n ComponentUtil.BOOLEAN_PROPERTIES = PropertyKeys.BOOLEAN_PROPERTIES;\n ComponentUtil.FUNCTION_PROPERTIES = PropertyKeys.FUNCTION_PROPERTIES;\n ComponentUtil.ALL_PROPERTIES = PropertyKeys.ALL_PROPERTIES;\n ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS = __spreadArray$q(__spreadArray$q([], __read$y(_a.ALL_PROPERTIES), false), __read$y(_a.EVENT_CALLBACKS), false);\n ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS_SET = new Set(ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS);\n return ComponentUtil;\n}());\n\nvar __extends$3b = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2E = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AgStackComponentsRegistry = /** @class */ (function (_super) {\n __extends$3b(AgStackComponentsRegistry, _super);\n function AgStackComponentsRegistry() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.componentsMappedByName = {};\n return _this;\n }\n AgStackComponentsRegistry.prototype.setupComponents = function (components) {\n var _this = this;\n if (components) {\n components.forEach(function (componentMeta) { return _this.addComponent(componentMeta); });\n }\n };\n AgStackComponentsRegistry.prototype.addComponent = function (componentMeta) {\n // get name of the class as a string\n // insert a dash after every capital letter\n // let classEscaped = className.replace(/([A-Z])/g, \"-$1\").toLowerCase();\n var classEscaped = componentMeta.componentName.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n // put all to upper case\n var classUpperCase = classEscaped.toUpperCase();\n // finally store\n this.componentsMappedByName[classUpperCase] = componentMeta.componentClass;\n };\n AgStackComponentsRegistry.prototype.getComponentClass = function (htmlTag) {\n return this.componentsMappedByName[htmlTag];\n };\n AgStackComponentsRegistry = __decorate$2E([\n Bean('agStackComponentsRegistry')\n ], AgStackComponentsRegistry);\n return AgStackComponentsRegistry;\n}(BeanStub));\n\n// ARIA HELPER FUNCTIONS\nfunction toggleAriaAttribute(element, attribute, value) {\n if (value == null || (typeof value === 'string' && value == '')) {\n removeAriaAttribute(element, attribute);\n }\n else {\n setAriaAttribute(element, attribute, value);\n }\n}\nfunction setAriaAttribute(element, attribute, value) {\n element.setAttribute(ariaAttributeName(attribute), value.toString());\n}\nfunction removeAriaAttribute(element, attribute) {\n element.removeAttribute(ariaAttributeName(attribute));\n}\nfunction ariaAttributeName(attribute) {\n return \"aria-\".concat(attribute);\n}\nfunction setAriaRole(element, role) {\n if (role) {\n element.setAttribute('role', role);\n }\n else {\n element.removeAttribute('role');\n }\n}\nfunction getAriaSortState(sortDirection) {\n var sort;\n if (sortDirection === 'asc') {\n sort = 'ascending';\n }\n else if (sortDirection === 'desc') {\n sort = 'descending';\n }\n else if (sortDirection === 'mixed') {\n sort = 'other';\n }\n else {\n sort = 'none';\n }\n return sort;\n}\n// ARIA ATTRIBUTE GETTERS\nfunction getAriaLevel(element) {\n return parseInt(element.getAttribute('aria-level'), 10);\n}\nfunction getAriaPosInSet(element) {\n return parseInt(element.getAttribute('aria-posinset'), 10);\n}\nfunction getAriaLabel(element) {\n return element.getAttribute('aria-label');\n}\n// ARIA ATTRIBUTE SETTERS\nfunction setAriaLabel(element, label) {\n toggleAriaAttribute(element, 'label', label);\n}\nfunction setAriaLabelledBy(element, labelledBy) {\n toggleAriaAttribute(element, 'labelledby', labelledBy);\n}\nfunction setAriaDescribedBy(element, describedby) {\n toggleAriaAttribute(element, 'describedby', describedby);\n}\nfunction setAriaLive(element, live) {\n toggleAriaAttribute(element, 'live', live);\n}\nfunction setAriaAtomic(element, atomic) {\n toggleAriaAttribute(element, 'atomic', atomic);\n}\nfunction setAriaRelevant(element, relevant) {\n toggleAriaAttribute(element, 'relevant', relevant);\n}\nfunction setAriaLevel(element, level) {\n toggleAriaAttribute(element, 'level', level);\n}\nfunction setAriaDisabled(element, disabled) {\n toggleAriaAttribute(element, 'disabled', disabled);\n}\nfunction setAriaHidden(element, hidden) {\n toggleAriaAttribute(element, 'hidden', hidden);\n}\nfunction setAriaActiveDescendant(element, descendantId) {\n toggleAriaAttribute(element, 'activedescendant', descendantId);\n}\nfunction setAriaExpanded(element, expanded) {\n setAriaAttribute(element, 'expanded', expanded);\n}\nfunction removeAriaExpanded(element) {\n removeAriaAttribute(element, 'expanded');\n}\nfunction setAriaSetSize(element, setsize) {\n setAriaAttribute(element, 'setsize', setsize);\n}\nfunction setAriaPosInSet(element, position) {\n setAriaAttribute(element, 'posinset', position);\n}\nfunction setAriaMultiSelectable(element, multiSelectable) {\n setAriaAttribute(element, 'multiselectable', multiSelectable);\n}\nfunction setAriaRowCount(element, rowCount) {\n setAriaAttribute(element, 'rowcount', rowCount);\n}\nfunction setAriaRowIndex(element, rowIndex) {\n setAriaAttribute(element, 'rowindex', rowIndex);\n}\nfunction setAriaColCount(element, colCount) {\n setAriaAttribute(element, 'colcount', colCount);\n}\nfunction setAriaColIndex(element, colIndex) {\n setAriaAttribute(element, 'colindex', colIndex);\n}\nfunction setAriaColSpan(element, colSpan) {\n setAriaAttribute(element, 'colspan', colSpan);\n}\nfunction setAriaSort(element, sort) {\n setAriaAttribute(element, 'sort', sort);\n}\nfunction removeAriaSort(element) {\n removeAriaAttribute(element, 'sort');\n}\nfunction setAriaSelected(element, selected) {\n toggleAriaAttribute(element, 'selected', selected);\n}\nfunction setAriaChecked(element, checked) {\n setAriaAttribute(element, 'checked', checked === undefined ? 'mixed' : checked);\n}\nfunction setAriaControls(controllerElement, controlledElement) {\n toggleAriaAttribute(controllerElement, 'controls', controlledElement.id);\n setAriaLabelledBy(controlledElement, controllerElement.id);\n}\nfunction getAriaCheckboxStateName(translate, state) {\n return state === undefined\n ? translate('ariaIndeterminate', 'indeterminate')\n : (state === true\n ? translate('ariaChecked', 'checked')\n : translate('ariaUnchecked', 'unchecked'));\n}\n\nvar AriaUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n setAriaRole: setAriaRole,\n getAriaSortState: getAriaSortState,\n getAriaLevel: getAriaLevel,\n getAriaPosInSet: getAriaPosInSet,\n getAriaLabel: getAriaLabel,\n setAriaLabel: setAriaLabel,\n setAriaLabelledBy: setAriaLabelledBy,\n setAriaDescribedBy: setAriaDescribedBy,\n setAriaLive: setAriaLive,\n setAriaAtomic: setAriaAtomic,\n setAriaRelevant: setAriaRelevant,\n setAriaLevel: setAriaLevel,\n setAriaDisabled: setAriaDisabled,\n setAriaHidden: setAriaHidden,\n setAriaActiveDescendant: setAriaActiveDescendant,\n setAriaExpanded: setAriaExpanded,\n removeAriaExpanded: removeAriaExpanded,\n setAriaSetSize: setAriaSetSize,\n setAriaPosInSet: setAriaPosInSet,\n setAriaMultiSelectable: setAriaMultiSelectable,\n setAriaRowCount: setAriaRowCount,\n setAriaRowIndex: setAriaRowIndex,\n setAriaColCount: setAriaColCount,\n setAriaColIndex: setAriaColIndex,\n setAriaColSpan: setAriaColSpan,\n setAriaSort: setAriaSort,\n removeAriaSort: removeAriaSort,\n setAriaSelected: setAriaSelected,\n setAriaChecked: setAriaChecked,\n setAriaControls: setAriaControls,\n getAriaCheckboxStateName: getAriaCheckboxStateName\n});\n\n/**\n * These variables are lazy loaded, as otherwise they try and get initialised when we are loading\n * unit tests and we don't have references to window or document in the unit tests\n */\nvar isSafari;\nvar safariVersion;\nvar isChrome;\nvar isFirefox;\nvar isMacOs;\nvar isIOS;\nvar invisibleScrollbar;\nvar browserScrollbarWidth;\nfunction isBrowserSafari() {\n if (isSafari === undefined) {\n isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n }\n return isSafari;\n}\nfunction getSafariVersion() {\n if (safariVersion === undefined) {\n if (isBrowserSafari()) {\n var versionMatch = navigator.userAgent.match(/version\\/(\\d+)/i);\n if (versionMatch) {\n safariVersion = versionMatch[1] != null ? parseFloat(versionMatch[1]) : 0;\n }\n }\n else {\n safariVersion = 0;\n }\n }\n return safariVersion;\n}\n/**\n * Returns true for Chrome and also for Edge (Chromium)\n */\nfunction isBrowserChrome() {\n if (isChrome === undefined) {\n var win = window;\n isChrome = (!!win.chrome && (!!win.chrome.webstore || !!win.chrome.runtime)) ||\n (/Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor));\n }\n return isChrome;\n}\nfunction isBrowserFirefox() {\n if (isFirefox === undefined) {\n isFirefox = /(firefox)/i.test(navigator.userAgent);\n }\n return isFirefox;\n}\nfunction isMacOsUserAgent() {\n if (isMacOs === undefined) {\n isMacOs = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);\n }\n return isMacOs;\n}\nfunction isIOSUserAgent() {\n if (isIOS === undefined) {\n isIOS = (/iPad|iPhone|iPod/.test(navigator.platform) ||\n // eslint-disable-next-line\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));\n }\n return isIOS;\n}\nfunction browserSupportsPreventScroll() {\n // all browsers except safari support focus({ preventScroll: true }).\n // this feature was added on Safari 15+\n return !isBrowserSafari() || getSafariVersion() >= 15;\n}\nfunction getTabIndex(el) {\n if (!el) {\n return null;\n }\n var numberTabIndex = el.tabIndex;\n var tabIndex = el.getAttribute('tabIndex');\n if (numberTabIndex === -1 && (tabIndex === null || (tabIndex === '' && !isBrowserFirefox()))) {\n return null;\n }\n return numberTabIndex.toString();\n}\nfunction getMaxDivHeight() {\n if (!document.body) {\n return -1;\n }\n var res = 1000000;\n // FF reports the height back but still renders blank after ~6M px\n var testUpTo = navigator.userAgent.toLowerCase().match(/firefox/) ? 6000000 : 1000000000;\n var div = document.createElement('div');\n document.body.appendChild(div);\n while (true) {\n var test = res * 2;\n div.style.height = test + 'px';\n if (test > testUpTo || div.clientHeight !== test) {\n break;\n }\n else {\n res = test;\n }\n }\n document.body.removeChild(div);\n return res;\n}\nfunction getBodyWidth() {\n var _a, _b, _c;\n return (_b = (_a = document.body) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : (window.innerHeight || ((_c = document.documentElement) === null || _c === void 0 ? void 0 : _c.clientWidth) || -1);\n}\nfunction getBodyHeight() {\n var _a, _b, _c;\n return (_b = (_a = document.body) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : (window.innerHeight || ((_c = document.documentElement) === null || _c === void 0 ? void 0 : _c.clientHeight) || -1);\n}\nfunction getScrollbarWidth() {\n if (browserScrollbarWidth == null) {\n initScrollbarWidthAndVisibility();\n }\n return browserScrollbarWidth;\n}\nfunction initScrollbarWidthAndVisibility() {\n var body = document.body;\n var div = document.createElement('div');\n div.style.width = div.style.height = '100px';\n div.style.opacity = '0';\n div.style.overflow = 'scroll';\n div.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps\n div.style.position = 'absolute';\n body.appendChild(div);\n var width = div.offsetWidth - div.clientWidth;\n // if width is 0 and client width is 0, means the DOM isn't ready\n if (width === 0 && div.clientWidth === 0) {\n width = null;\n }\n // remove div\n if (div.parentNode) {\n div.parentNode.removeChild(div);\n }\n if (width != null) {\n browserScrollbarWidth = width;\n invisibleScrollbar = width === 0;\n }\n}\nfunction isInvisibleScrollbar() {\n if (invisibleScrollbar == null) {\n initScrollbarWidthAndVisibility();\n }\n return invisibleScrollbar;\n}\n\nvar BrowserUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n isBrowserSafari: isBrowserSafari,\n getSafariVersion: getSafariVersion,\n isBrowserChrome: isBrowserChrome,\n isBrowserFirefox: isBrowserFirefox,\n isMacOsUserAgent: isMacOsUserAgent,\n isIOSUserAgent: isIOSUserAgent,\n browserSupportsPreventScroll: browserSupportsPreventScroll,\n getTabIndex: getTabIndex,\n getMaxDivHeight: getMaxDivHeight,\n getBodyWidth: getBodyWidth,\n getBodyHeight: getBodyHeight,\n getScrollbarWidth: getScrollbarWidth,\n isInvisibleScrollbar: isInvisibleScrollbar\n});\n\nfunction padStartWidthZeros(value, totalStringSize) {\n return value.toString().padStart(totalStringSize, '0');\n}\nfunction createArrayOfNumbers(first, last) {\n var result = [];\n for (var i = first; i <= last; i++) {\n result.push(i);\n }\n return result;\n}\nfunction cleanNumber(value) {\n if (typeof value === 'string') {\n value = parseInt(value, 10);\n }\n if (typeof value === 'number') {\n return Math.floor(value);\n }\n return null;\n}\nfunction decToHex(number, bytes) {\n var hex = '';\n for (var i = 0; i < bytes; i++) {\n hex += String.fromCharCode(number & 0xff);\n number >>>= 8;\n }\n return hex;\n}\nfunction formatNumberTwoDecimalPlacesAndCommas(value, thousandSeparator, decimalSeparator) {\n if (typeof value !== 'number') {\n return '';\n }\n return formatNumberCommas(Math.round(value * 100) / 100, thousandSeparator, decimalSeparator);\n}\n/**\n * the native method number.toLocaleString(undefined, {minimumFractionDigits: 0})\n * puts in decimal places in IE, so we use this method instead\n * from: http://blog.tompawlak.org/number-currency-formatting-javascript\n * @param {number} value\n * @returns {string}\n */\nfunction formatNumberCommas(value, thousandSeparator, decimalSeparator) {\n if (typeof value !== 'number') {\n return '';\n }\n return value.toString().replace('.', decimalSeparator).replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, \"$1\".concat(thousandSeparator));\n}\nfunction sum(values) {\n return values == null ? null : values.reduce(function (total, value) { return total + value; }, 0);\n}\n\nvar NumberUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n padStartWidthZeros: padStartWidthZeros,\n createArrayOfNumbers: createArrayOfNumbers,\n cleanNumber: cleanNumber,\n decToHex: decToHex,\n formatNumberTwoDecimalPlacesAndCommas: formatNumberTwoDecimalPlacesAndCommas,\n formatNumberCommas: formatNumberCommas,\n sum: sum\n});\n\nvar __read$x = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\n/**\n * Serialises a Date to a string of format `yyyy-MM-dd HH:mm:ss`.\n * An alternative separator can be provided to be used instead of hyphens.\n * @param date The date to serialise\n * @param includeTime Whether to include the time in the serialised string\n * @param separator The separator to use between date parts\n */\nfunction serialiseDate(date, includeTime, separator) {\n if (includeTime === void 0) { includeTime = true; }\n if (separator === void 0) { separator = '-'; }\n if (!date) {\n return null;\n }\n var serialised = [date.getFullYear(), date.getMonth() + 1, date.getDate()].map(function (part) { return padStartWidthZeros(part, 2); }).join(separator);\n if (includeTime) {\n serialised += ' ' + [date.getHours(), date.getMinutes(), date.getSeconds()].map(function (part) { return padStartWidthZeros(part, 2); }).join(':');\n }\n return serialised;\n}\nvar calculateOrdinal = function (value) {\n if (value > 3 && value < 21) {\n return 'th';\n }\n var remainder = value % 10;\n switch (remainder) {\n case 1: return \"st\";\n case 2: return \"nd\";\n case 3: return \"rd\";\n }\n return 'th';\n};\n/**\n * Serialises a Date to a string of format the defined format, does not include time.\n * @param date The date to serialise\n * @param format The string to format the date to, defaults to YYYY-MM-DD\n */\nfunction dateToFormattedString(date, format) {\n if (format === void 0) { format = 'YYYY-MM-DD'; }\n var fullYear = padStartWidthZeros(date.getFullYear(), 4);\n var months = [\n 'January', 'February', 'March', 'April', 'May', 'June',\n 'July', 'August', 'September', 'October', 'November', 'December',\n ];\n var days = [\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday',\n ];\n var replace = {\n YYYY: function () { return fullYear.slice(fullYear.length - 4, fullYear.length); },\n YY: function () { return fullYear.slice(fullYear.length - 2, fullYear.length); },\n Y: function () { return \"\".concat(date.getFullYear()); },\n MMMM: function () { return months[date.getMonth()]; },\n MMM: function () { return months[date.getMonth()].slice(0, 3); },\n MM: function () { return padStartWidthZeros(date.getMonth() + 1, 2); },\n Mo: function () { return \"\".concat(date.getMonth() + 1).concat(calculateOrdinal(date.getMonth() + 1)); },\n M: function () { return \"\".concat(date.getMonth() + 1); },\n Do: function () { return \"\".concat(date.getDate()).concat(calculateOrdinal(date.getDate())); },\n DD: function () { return padStartWidthZeros(date.getDate(), 2); },\n D: function () { return \"\".concat(date.getDate()); },\n dddd: function () { return days[date.getDay()]; },\n ddd: function () { return days[date.getDay()].slice(0, 3); },\n dd: function () { return days[date.getDay()].slice(0, 2); },\n do: function () { return \"\".concat(date.getDay()).concat(calculateOrdinal(date.getDay())); },\n d: function () { return \"\".concat(date.getDay()); },\n };\n var regexp = new RegExp(Object.keys(replace).join('|'), 'g');\n return format.replace(regexp, function (match) {\n if (match in replace) {\n return replace[match]();\n }\n return match;\n });\n}\n/**\n * Parses a date and time from a string in the format `yyyy-MM-dd HH:mm:ss`\n */\nfunction parseDateTimeFromString(value) {\n if (!value) {\n return null;\n }\n var _a = __read$x(value.split(' '), 2), dateStr = _a[0], timeStr = _a[1];\n if (!dateStr) {\n return null;\n }\n var fields = dateStr.split('-').map(function (f) { return parseInt(f, 10); });\n if (fields.filter(function (f) { return !isNaN(f); }).length !== 3) {\n return null;\n }\n var _b = __read$x(fields, 3), year = _b[0], month = _b[1], day = _b[2];\n var date = new Date(year, month - 1, day);\n if (date.getFullYear() !== year ||\n date.getMonth() !== month - 1 ||\n date.getDate() !== day) {\n // date was not parsed as expected so must have been invalid\n return null;\n }\n if (!timeStr || timeStr === '00:00:00') {\n return date;\n }\n var _c = __read$x(timeStr.split(':').map(function (part) { return parseInt(part, 10); }), 3), hours = _c[0], minutes = _c[1], seconds = _c[2];\n if (hours >= 0 && hours < 24) {\n date.setHours(hours);\n }\n if (minutes >= 0 && minutes < 60) {\n date.setMinutes(minutes);\n }\n if (seconds >= 0 && seconds < 60) {\n date.setSeconds(seconds);\n }\n return date;\n}\n\nvar DateUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n serialiseDate: serialiseDate,\n dateToFormattedString: dateToFormattedString,\n parseDateTimeFromString: parseDateTimeFromString\n});\n\nvar __values$9 = ( false) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$w = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar rtlNegativeScroll;\n/**\n * This method adds a class to an element and remove that class from all siblings.\n * Useful for toggling state.\n * @param {HTMLElement} element The element to receive the class\n * @param {string} elementClass The class to be assigned to the element\n * @param {boolean} otherElementClass The class to be assigned to siblings of the element, but not the element itself\n */\nfunction radioCssClass(element, elementClass, otherElementClass) {\n var parent = element.parentElement;\n var sibling = parent && parent.firstChild;\n while (sibling) {\n if (elementClass) {\n sibling.classList.toggle(elementClass, sibling === element);\n }\n if (otherElementClass) {\n sibling.classList.toggle(otherElementClass, sibling !== element);\n }\n sibling = sibling.nextSibling;\n }\n}\nvar FOCUSABLE_SELECTOR = '[tabindex], input, select, button, textarea, [href]';\nvar FOCUSABLE_EXCLUDE = '[disabled], .ag-disabled:not(.ag-button), .ag-disabled *';\nfunction isFocusableFormField(element) {\n var matches = Element.prototype.matches || Element.prototype.msMatchesSelector;\n var inputSelector = 'input, select, button, textarea';\n var isFocusable = matches.call(element, inputSelector);\n var isNotFocusable = matches.call(element, FOCUSABLE_EXCLUDE);\n var isElementVisible = isVisible(element);\n var focusable = isFocusable && !isNotFocusable && isElementVisible;\n return focusable;\n}\nfunction setDisplayed(element, displayed, options) {\n if (options === void 0) { options = {}; }\n var skipAriaHidden = options.skipAriaHidden;\n element.classList.toggle('ag-hidden', !displayed);\n if (!skipAriaHidden) {\n setAriaHidden(element, !displayed);\n }\n}\nfunction setVisible(element, visible, options) {\n if (options === void 0) { options = {}; }\n var skipAriaHidden = options.skipAriaHidden;\n element.classList.toggle('ag-invisible', !visible);\n if (!skipAriaHidden) {\n setAriaHidden(element, !visible);\n }\n}\nfunction setDisabled(element, disabled) {\n var attributeName = 'disabled';\n var addOrRemoveDisabledAttribute = disabled ?\n function (e) { return e.setAttribute(attributeName, ''); } :\n function (e) { return e.removeAttribute(attributeName); };\n addOrRemoveDisabledAttribute(element);\n nodeListForEach(element.querySelectorAll('input'), function (input) { return addOrRemoveDisabledAttribute(input); });\n}\nfunction isElementChildOfClass(element, cls, maxNest) {\n var counter = 0;\n while (element) {\n if (element.classList.contains(cls)) {\n return true;\n }\n element = element.parentElement;\n if (typeof maxNest == 'number') {\n if (++counter > maxNest) {\n break;\n }\n }\n else if (element === maxNest) {\n break;\n }\n }\n return false;\n}\n// returns back sizes as doubles instead of strings. similar to\n// getBoundingClientRect, however getBoundingClientRect does not:\n// a) work with fractions (eg browser is zooming)\n// b) has CSS transitions applied (eg CSS scale, browser zoom), which we don't want, we want the un-transitioned values\nfunction getElementSize(el) {\n var _a = window.getComputedStyle(el), height = _a.height, width = _a.width, borderTopWidth = _a.borderTopWidth, borderRightWidth = _a.borderRightWidth, borderBottomWidth = _a.borderBottomWidth, borderLeftWidth = _a.borderLeftWidth, paddingTop = _a.paddingTop, paddingRight = _a.paddingRight, paddingBottom = _a.paddingBottom, paddingLeft = _a.paddingLeft, marginTop = _a.marginTop, marginRight = _a.marginRight, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, boxSizing = _a.boxSizing;\n return {\n height: parseFloat(height || '0'),\n width: parseFloat(width || '0'),\n borderTopWidth: parseFloat(borderTopWidth || '0'),\n borderRightWidth: parseFloat(borderRightWidth || '0'),\n borderBottomWidth: parseFloat(borderBottomWidth || '0'),\n borderLeftWidth: parseFloat(borderLeftWidth || '0'),\n paddingTop: parseFloat(paddingTop || '0'),\n paddingRight: parseFloat(paddingRight || '0'),\n paddingBottom: parseFloat(paddingBottom || '0'),\n paddingLeft: parseFloat(paddingLeft || '0'),\n marginTop: parseFloat(marginTop || '0'),\n marginRight: parseFloat(marginRight || '0'),\n marginBottom: parseFloat(marginBottom || '0'),\n marginLeft: parseFloat(marginLeft || '0'),\n boxSizing: boxSizing\n };\n}\nfunction getInnerHeight(el) {\n var size = getElementSize(el);\n if (size.boxSizing === 'border-box') {\n return size.height - size.paddingTop - size.paddingBottom;\n }\n return size.height;\n}\nfunction getInnerWidth(el) {\n var size = getElementSize(el);\n if (size.boxSizing === 'border-box') {\n return size.width - size.paddingLeft - size.paddingRight;\n }\n return size.width;\n}\nfunction getAbsoluteHeight(el) {\n var size = getElementSize(el);\n var marginRight = size.marginBottom + size.marginTop;\n return Math.ceil(el.offsetHeight + marginRight);\n}\nfunction getAbsoluteWidth(el) {\n var size = getElementSize(el);\n var marginWidth = size.marginLeft + size.marginRight;\n return Math.ceil(el.offsetWidth + marginWidth);\n}\nfunction getElementRectWithOffset(el) {\n var offsetElementRect = el.getBoundingClientRect();\n var _a = getElementSize(el), borderTopWidth = _a.borderTopWidth, borderLeftWidth = _a.borderLeftWidth, borderRightWidth = _a.borderRightWidth, borderBottomWidth = _a.borderBottomWidth;\n return {\n top: offsetElementRect.top + (borderTopWidth || 0),\n left: offsetElementRect.left + (borderLeftWidth || 0),\n right: offsetElementRect.right + (borderRightWidth || 0),\n bottom: offsetElementRect.bottom + (borderBottomWidth || 0),\n };\n}\nfunction isRtlNegativeScroll() {\n if (typeof rtlNegativeScroll === \"boolean\") {\n return rtlNegativeScroll;\n }\n var template = document.createElement('div');\n template.style.direction = 'rtl';\n template.style.width = '1px';\n template.style.height = '1px';\n template.style.position = 'fixed';\n template.style.top = '0px';\n template.style.overflow = 'hidden';\n template.dir = 'rtl';\n template.innerHTML = /* html */\n \"
\\n \\n \\n
\";\n document.body.appendChild(template);\n template.scrollLeft = 1;\n rtlNegativeScroll = Math.floor(template.scrollLeft) === 0;\n document.body.removeChild(template);\n return rtlNegativeScroll;\n}\nfunction getScrollLeft(element, rtl) {\n var scrollLeft = element.scrollLeft;\n if (rtl) {\n // Absolute value - for FF that reports RTL scrolls in negative numbers\n scrollLeft = Math.abs(scrollLeft);\n if (isBrowserChrome() && !isRtlNegativeScroll()) {\n scrollLeft = element.scrollWidth - element.clientWidth - scrollLeft;\n }\n }\n return scrollLeft;\n}\nfunction setScrollLeft(element, value, rtl) {\n if (rtl) {\n // Chrome and Safari when doing RTL have the END position of the scroll as zero, not the start\n if (isRtlNegativeScroll()) {\n value *= -1;\n }\n else if (isBrowserSafari() || isBrowserChrome()) {\n value = element.scrollWidth - element.clientWidth - value;\n }\n }\n element.scrollLeft = value;\n}\nfunction clearElement(el) {\n while (el && el.firstChild) {\n el.removeChild(el.firstChild);\n }\n}\nfunction removeFromParent(node) {\n if (node && node.parentNode) {\n node.parentNode.removeChild(node);\n }\n}\nfunction isInDOM(element) {\n return !!element.offsetParent;\n}\nfunction isVisible(element) {\n var el = element;\n if (el.checkVisibility) {\n return el.checkVisibility({ checkVisibilityCSS: true });\n }\n var isHidden = !isInDOM(element) || window.getComputedStyle(element).visibility !== 'visible';\n return !isHidden;\n}\n/**\n * Loads the template and returns it as an element. makes up for no simple way in\n * the dom api to load html directly, eg we cannot do this: document.createElement(template)\n * @param {string} template\n * @returns {HTMLElement}\n */\nfunction loadTemplate(template) {\n var tempDiv = document.createElement('div');\n tempDiv.innerHTML = (template || '').trim();\n return tempDiv.firstChild;\n}\nfunction ensureDomOrder(eContainer, eChild, eChildBefore) {\n // if already in right order, do nothing\n if (eChildBefore && eChildBefore.nextSibling === eChild) {\n return;\n }\n if (eChildBefore) {\n if (eChildBefore.nextSibling) {\n // insert between the eRowBefore and the row after it\n eContainer.insertBefore(eChild, eChildBefore.nextSibling);\n }\n else {\n // if nextSibling is missing, means other row is at end, so just append new row at the end\n eContainer.appendChild(eChild);\n }\n }\n else {\n // otherwise put at start\n if (eContainer.firstChild && eContainer.firstChild !== eChild) {\n // insert it at the first location\n eContainer.insertAdjacentElement('afterbegin', eChild);\n }\n }\n}\nfunction setDomChildOrder(eContainer, orderedChildren) {\n for (var i = 0; i < orderedChildren.length; i++) {\n var correctCellAtIndex = orderedChildren[i];\n var actualCellAtIndex = eContainer.children[i];\n if (actualCellAtIndex !== correctCellAtIndex) {\n eContainer.insertBefore(correctCellAtIndex, actualCellAtIndex);\n }\n }\n}\nfunction insertWithDomOrder(eContainer, eToInsert, eChildBefore) {\n if (eChildBefore) {\n // if previous element exists, just slot in after the previous element\n eChildBefore.insertAdjacentElement('afterend', eToInsert);\n }\n else {\n if (eContainer.firstChild) {\n // insert it at the first location\n eContainer.insertAdjacentElement('afterbegin', eToInsert);\n }\n else {\n // otherwise eContainer is empty, so just append it\n eContainer.appendChild(eToInsert);\n }\n }\n}\nfunction addStylesToElement(eElement, styles) {\n var e_1, _a;\n if (!styles) {\n return;\n }\n try {\n for (var _b = __values$9(Object.entries(styles)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = __read$w(_c.value, 2), key = _d[0], value = _d[1];\n if (!key || !key.length || value == null) {\n continue;\n }\n // changes the key from camelCase into a hyphenated-string\n var parsedKey = camelCaseToHyphenated(key);\n var valueAsString = value.toString();\n var parsedValue = valueAsString.replace(/\\s*!important/g, '');\n var priority = parsedValue.length != valueAsString.length ? 'important' : undefined;\n eElement.style.setProperty(parsedKey, parsedValue, priority);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n}\nfunction isHorizontalScrollShowing(element) {\n return element.clientWidth < element.scrollWidth;\n}\nfunction isVerticalScrollShowing(element) {\n return element.clientHeight < element.scrollHeight;\n}\nfunction setElementWidth(element, width) {\n if (width === 'flex') {\n element.style.removeProperty('width');\n element.style.removeProperty('minWidth');\n element.style.removeProperty('maxWidth');\n element.style.flex = '1 1 auto';\n }\n else {\n setFixedWidth(element, width);\n }\n}\nfunction setFixedWidth(element, width) {\n width = formatSize(width);\n element.style.width = width.toString();\n element.style.maxWidth = width.toString();\n element.style.minWidth = width.toString();\n}\nfunction setElementHeight(element, height) {\n if (height === 'flex') {\n element.style.removeProperty('height');\n element.style.removeProperty('minHeight');\n element.style.removeProperty('maxHeight');\n element.style.flex = '1 1 auto';\n }\n else {\n setFixedHeight(element, height);\n }\n}\nfunction setFixedHeight(element, height) {\n height = formatSize(height);\n element.style.height = height.toString();\n element.style.maxHeight = height.toString();\n element.style.minHeight = height.toString();\n}\nfunction formatSize(size) {\n if (typeof size === 'number') {\n return \"\".concat(size, \"px\");\n }\n return size;\n}\nfunction isNodeOrElement(o) {\n return o instanceof Node || o instanceof HTMLElement;\n}\n/**\n * Makes a copy of a node list into a list\n * @param {NodeList} nodeList\n * @returns {Node[]}\n */\nfunction copyNodeList(nodeList) {\n if (nodeList == null) {\n return [];\n }\n var result = [];\n nodeListForEach(nodeList, function (node) { return result.push(node); });\n return result;\n}\nfunction iterateNamedNodeMap(map, callback) {\n if (!map) {\n return;\n }\n for (var i = 0; i < map.length; i++) {\n var attr = map[i];\n callback(attr.name, attr.value);\n }\n}\nfunction addOrRemoveAttribute(element, name, value) {\n if (value == null) {\n element.removeAttribute(name);\n }\n else {\n element.setAttribute(name, value.toString());\n }\n}\nfunction nodeListForEach(nodeList, action) {\n if (nodeList == null) {\n return;\n }\n for (var i = 0; i < nodeList.length; i++) {\n action(nodeList[i]);\n }\n}\n/**\n * cell renderers are used in a few places. they bind to dom slightly differently to other cell renders as they\n * can return back strings (instead of html element) in the getGui() method. common code placed here to handle that.\n * @param {AgPromise} cellRendererPromise\n * @param {HTMLElement} eTarget\n */\nfunction bindCellRendererToHtmlElement(cellRendererPromise, eTarget) {\n cellRendererPromise.then(function (cellRenderer) {\n var gui = cellRenderer.getGui();\n if (gui != null) {\n if (typeof gui === 'object') {\n eTarget.appendChild(gui);\n }\n else {\n eTarget.innerHTML = gui;\n }\n }\n });\n}\n\nvar DomUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n radioCssClass: radioCssClass,\n FOCUSABLE_SELECTOR: FOCUSABLE_SELECTOR,\n FOCUSABLE_EXCLUDE: FOCUSABLE_EXCLUDE,\n isFocusableFormField: isFocusableFormField,\n setDisplayed: setDisplayed,\n setVisible: setVisible,\n setDisabled: setDisabled,\n isElementChildOfClass: isElementChildOfClass,\n getElementSize: getElementSize,\n getInnerHeight: getInnerHeight,\n getInnerWidth: getInnerWidth,\n getAbsoluteHeight: getAbsoluteHeight,\n getAbsoluteWidth: getAbsoluteWidth,\n getElementRectWithOffset: getElementRectWithOffset,\n isRtlNegativeScroll: isRtlNegativeScroll,\n getScrollLeft: getScrollLeft,\n setScrollLeft: setScrollLeft,\n clearElement: clearElement,\n removeFromParent: removeFromParent,\n isInDOM: isInDOM,\n isVisible: isVisible,\n loadTemplate: loadTemplate,\n ensureDomOrder: ensureDomOrder,\n setDomChildOrder: setDomChildOrder,\n insertWithDomOrder: insertWithDomOrder,\n addStylesToElement: addStylesToElement,\n isHorizontalScrollShowing: isHorizontalScrollShowing,\n isVerticalScrollShowing: isVerticalScrollShowing,\n setElementWidth: setElementWidth,\n setFixedWidth: setFixedWidth,\n setElementHeight: setElementHeight,\n setFixedHeight: setFixedHeight,\n formatSize: formatSize,\n isNodeOrElement: isNodeOrElement,\n copyNodeList: copyNodeList,\n iterateNamedNodeMap: iterateNamedNodeMap,\n addOrRemoveAttribute: addOrRemoveAttribute,\n nodeListForEach: nodeListForEach,\n bindCellRendererToHtmlElement: bindCellRendererToHtmlElement\n});\n\nvar __values$8 = ( false) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nfunction fuzzyCheckStrings(inputValues, validValues, allSuggestions) {\n var fuzzyMatches = {};\n var invalidInputs = inputValues.filter(function (inputValue) {\n return !validValues.some(function (validValue) { return validValue === inputValue; });\n });\n if (invalidInputs.length > 0) {\n invalidInputs.forEach(function (invalidInput) {\n return fuzzyMatches[invalidInput] = fuzzySuggestions(invalidInput, allSuggestions).values;\n });\n }\n return fuzzyMatches;\n}\n/**\n *\n * @param {String} inputValue The value to be compared against a list of strings\n * @param allSuggestions The list of strings to be compared against\n */\nfunction fuzzySuggestions(inputValue, allSuggestions, hideIrrelevant, filterByPercentageOfBestMatch) {\n var e_1, _a;\n var thisSuggestions = allSuggestions.map(function (text, idx) { return ({\n value: text,\n relevance: stringWeightedDistances(inputValue.toLowerCase(), text.toLocaleLowerCase()),\n idx: idx\n }); });\n thisSuggestions.sort(function (a, b) { return b.relevance - a.relevance; });\n if (hideIrrelevant) {\n thisSuggestions = thisSuggestions.filter(function (suggestion) { return suggestion.relevance !== 0; });\n }\n if (thisSuggestions.length > 0 && filterByPercentageOfBestMatch && filterByPercentageOfBestMatch > 0) {\n var bestMatch = thisSuggestions[0].relevance;\n var limit_1 = bestMatch * filterByPercentageOfBestMatch;\n thisSuggestions = thisSuggestions.filter(function (suggestion) { return limit_1 - suggestion.relevance < 0; });\n }\n var values = [];\n var indices = [];\n try {\n for (var thisSuggestions_1 = __values$8(thisSuggestions), thisSuggestions_1_1 = thisSuggestions_1.next(); !thisSuggestions_1_1.done; thisSuggestions_1_1 = thisSuggestions_1.next()) {\n var suggestion = thisSuggestions_1_1.value;\n values.push(suggestion.value);\n indices.push(suggestion.idx);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (thisSuggestions_1_1 && !thisSuggestions_1_1.done && (_a = thisSuggestions_1.return)) _a.call(thisSuggestions_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return { values: values, indices: indices };\n}\nfunction stringWeightedDistances(str1, str2) {\n var a = str1.replace(/\\s/g, '');\n var b = str2.replace(/\\s/g, '');\n var weight = 0;\n var lastIndex = -1;\n for (var i = 0; i < a.length; i++) {\n var idx = b.indexOf(a[i], lastIndex + 1);\n if (idx === -1) {\n continue;\n }\n lastIndex = idx;\n weight += (100 - (lastIndex * 100 / 10000) * 100);\n }\n return weight;\n}\n\nvar FuzzyMatchUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n fuzzyCheckStrings: fuzzyCheckStrings,\n fuzzySuggestions: fuzzySuggestions\n});\n\n//\n// IMPORTANT NOTE!\n//\n// If you change the list below, copy/paste the new content into the docs page custom-icons\n//\nvar iconNameClassMap = {\n // header column group shown when expanded (click to contract)\n columnGroupOpened: 'expanded',\n // header column group shown when contracted (click to expand)\n columnGroupClosed: 'contracted',\n // tool panel column group contracted (click to expand)\n columnSelectClosed: 'tree-closed',\n // tool panel column group expanded (click to contract)\n columnSelectOpen: 'tree-open',\n // column tool panel header expand/collapse all button, shown when some children are expanded and\n // others are collapsed\n columnSelectIndeterminate: 'tree-indeterminate',\n // shown on ghost icon while dragging column to the side of the grid to pin\n columnMovePin: 'pin',\n // shown on ghost icon while dragging over part of the page that is not a drop zone\n columnMoveHide: 'eye-slash',\n // shown on ghost icon while dragging columns to reorder\n columnMoveMove: 'arrows',\n // animating icon shown when dragging a column to the right of the grid causes horizontal scrolling\n columnMoveLeft: 'left',\n // animating icon shown when dragging a column to the left of the grid causes horizontal scrolling\n columnMoveRight: 'right',\n // shown on ghost icon while dragging over Row Groups drop zone\n columnMoveGroup: 'group',\n // shown on ghost icon while dragging over Values drop zone\n columnMoveValue: 'aggregation',\n // shown on ghost icon while dragging over pivot drop zone\n columnMovePivot: 'pivot',\n // shown on ghost icon while dragging over drop zone that doesn't support it, e.g.\n // string column over aggregation drop zone\n dropNotAllowed: 'not-allowed',\n // shown on row group when contracted (click to expand)\n groupContracted: 'tree-closed',\n // shown on row group when expanded (click to contract)\n groupExpanded: 'tree-open',\n // set filter tree list group contracted (click to expand)\n setFilterGroupClosed: 'tree-closed',\n // set filter tree list group expanded (click to contract)\n setFilterGroupOpen: 'tree-open',\n // set filter tree list expand/collapse all button, shown when some children are expanded and\n // others are collapsed\n setFilterGroupIndeterminate: 'tree-indeterminate',\n // context menu chart item\n chart: 'chart',\n // chart window title bar\n close: 'cross',\n // X (remove) on column 'pill' after adding it to a drop zone list\n cancel: 'cancel',\n // indicates the currently active pin state in the \"Pin column\" sub-menu of the column menu\n check: 'tick',\n // \"go to first\" button in pagination controls\n first: 'first',\n // \"go to previous\" button in pagination controls\n previous: 'previous',\n // \"go to next\" button in pagination controls\n next: 'next',\n // \"go to last\" button in pagination controls\n last: 'last',\n // shown on top right of chart when chart is linked to range data (click to unlink)\n linked: 'linked',\n // shown on top right of chart when chart is not linked to range data (click to link)\n unlinked: 'unlinked',\n // \"Choose colour\" button on chart settings tab\n colorPicker: 'color-picker',\n // rotating spinner shown by the loading cell renderer\n groupLoading: 'loading',\n // button to launch enterprise column menu\n menu: 'menu',\n menuAlt: 'menu-alt',\n // filter tool panel tab\n filter: 'filter',\n // column tool panel tab\n columns: 'columns',\n // button in chart regular size window title bar (click to maximise)\n maximize: 'maximize',\n // button in chart maximised window title bar (click to make regular size)\n minimize: 'minimize',\n // \"Pin column\" item in column header menu\n menuPin: 'pin',\n // \"Value aggregation\" column menu item (shown on numeric columns when grouping is active)\"\n menuValue: 'aggregation',\n // \"Group by {column-name}\" item in column header menu\n menuAddRowGroup: 'group',\n // \"Un-Group by {column-name}\" item in column header menu\n menuRemoveRowGroup: 'group',\n // context menu copy item\n clipboardCopy: 'copy',\n // context menu cut item\n clipboardCut: 'cut',\n // context menu paste item\n clipboardPaste: 'paste',\n // identifies the pivot drop zone\n pivotPanel: 'pivot',\n // \"Row groups\" drop zone in column tool panel\n rowGroupPanel: 'group',\n // columns tool panel Values drop zone\n valuePanel: 'aggregation',\n // drag handle used to pick up draggable columns\n columnDrag: 'grip',\n // drag handle used to pick up draggable rows\n rowDrag: 'grip',\n // context menu export item\n save: 'save',\n // csv export\n csvExport: 'csv',\n // excel export,\n excelExport: 'excel',\n // icon on dropdown editors\n smallDown: 'small-down',\n // version of small-right used in RTL mode\n smallLeft: 'small-left',\n // separater between column 'pills' when you add multiple columns to the header drop zone\n smallRight: 'small-right',\n smallUp: 'small-up',\n // show on column header when column is sorted ascending\n sortAscending: 'asc',\n // show on column header when column is sorted descending\n sortDescending: 'desc',\n // show on column header when column has no sort, only when enabled with gridOptions.unSortIcon=true\n sortUnSort: 'none',\n // Builder button in Advanced Filter\n advancedFilterBuilder: 'group',\n // drag handle used to pick up Advanced Filter Builder rows\n advancedFilterBuilderDrag: 'grip',\n // Advanced Filter Builder row validation error\n advancedFilterBuilderInvalid: 'not-allowed',\n // shown on Advanced Filter Builder rows to move them up\n advancedFilterBuilderMoveUp: 'up',\n // shown on Advanced Filter Builder rows to move them down\n advancedFilterBuilderMoveDown: 'down',\n // shown on Advanced Filter Builder rows to add new rows\n advancedFilterBuilderAdd: 'plus',\n // shown on Advanced Filter Builder rows to remove row\n advancedFilterBuilderRemove: 'minus',\n};\n/**\n * If icon provided, use this (either a string, or a function callback).\n * if not, then use the default icon from the theme\n * @param {string} iconName\n * @param {GridOptionsService} gridOptionsService\n * @param {Column | null} [column]\n * @returns {Element}\n */\nfunction createIcon(iconName, gridOptionsService, column) {\n var iconContents = createIconNoSpan(iconName, gridOptionsService, column);\n if (iconContents) {\n var className = iconContents.className;\n if ((typeof className === 'string' && className.indexOf('ag-icon') > -1) ||\n (typeof className === 'object' && className['ag-icon'])) {\n return iconContents;\n }\n }\n var eResult = document.createElement('span');\n eResult.appendChild(iconContents);\n return eResult;\n}\nfunction createIconNoSpan(iconName, gridOptionsService, column, forceCreate) {\n var userProvidedIcon = null;\n // check col for icon first\n var icons = column && column.getColDef().icons;\n if (icons) {\n userProvidedIcon = icons[iconName];\n }\n // if not in col, try grid options\n if (gridOptionsService && !userProvidedIcon) {\n var optionsIcons = gridOptionsService.get('icons');\n if (optionsIcons) {\n userProvidedIcon = optionsIcons[iconName];\n }\n }\n // now if user provided, use it\n if (userProvidedIcon) {\n var rendererResult = void 0;\n if (typeof userProvidedIcon === 'function') {\n rendererResult = userProvidedIcon();\n }\n else if (typeof userProvidedIcon === 'string') {\n rendererResult = userProvidedIcon;\n }\n else {\n throw new Error('icon from grid options needs to be a string or a function');\n }\n if (typeof rendererResult === 'string') {\n return loadTemplate(rendererResult);\n }\n if (isNodeOrElement(rendererResult)) {\n return rendererResult;\n }\n console.warn('AG Grid: iconRenderer should return back a string or a dom object');\n }\n else {\n var span = document.createElement('span');\n var cssClass = iconNameClassMap[iconName];\n if (!cssClass) {\n if (!forceCreate) {\n console.warn(\"AG Grid: Did not find icon \".concat(iconName));\n cssClass = '';\n }\n else {\n cssClass = iconName;\n }\n }\n span.setAttribute('class', \"ag-icon ag-icon-\".concat(cssClass));\n span.setAttribute('unselectable', 'on');\n setAriaRole(span, 'presentation');\n return span;\n }\n}\n\nvar IconUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n iconNameClassMap: iconNameClassMap,\n createIcon: createIcon,\n createIconNoSpan: createIconNoSpan\n});\n\nvar KeyCode = /** @class */ (function () {\n function KeyCode() {\n }\n KeyCode.BACKSPACE = 'Backspace';\n KeyCode.TAB = 'Tab';\n KeyCode.ENTER = 'Enter';\n KeyCode.ESCAPE = 'Escape';\n KeyCode.SPACE = ' ';\n KeyCode.LEFT = 'ArrowLeft';\n KeyCode.UP = 'ArrowUp';\n KeyCode.RIGHT = 'ArrowRight';\n KeyCode.DOWN = 'ArrowDown';\n KeyCode.DELETE = 'Delete';\n KeyCode.F2 = 'F2';\n KeyCode.PAGE_UP = 'PageUp';\n KeyCode.PAGE_DOWN = 'PageDown';\n KeyCode.PAGE_HOME = 'Home';\n KeyCode.PAGE_END = 'End';\n // these should be used with `event.code` instead of `event.key`\n // as `event.key` changes when non-latin keyboards are used\n KeyCode.A = 'KeyA';\n KeyCode.C = 'KeyC';\n KeyCode.D = 'KeyD';\n KeyCode.V = 'KeyV';\n KeyCode.X = 'KeyX';\n KeyCode.Y = 'KeyY';\n KeyCode.Z = 'KeyZ';\n return KeyCode;\n}());\n\nvar A_KEYCODE = 65;\nvar C_KEYCODE = 67;\nvar V_KEYCODE = 86;\nvar D_KEYCODE = 68;\nvar Z_KEYCODE = 90;\nvar Y_KEYCODE = 89;\nfunction isEventFromPrintableCharacter(event) {\n // no allowed printable chars have alt or ctrl key combinations\n if (event.altKey || event.ctrlKey || event.metaKey) {\n return false;\n }\n // if key is length 1, eg if it is 'a' for the a key, or '2' for the '2' key.\n // non-printable characters have names, eg 'Enter' or 'Backspace'.\n var printableCharacter = event.key.length === 1;\n return printableCharacter;\n}\n/**\n * Allows user to tell the grid to skip specific keyboard events\n * @param {GridOptionsService} gridOptionsService\n * @param {KeyboardEvent} keyboardEvent\n * @param {IRowNode} rowNode\n * @param {Column} column\n * @param {boolean} editing\n * @returns {boolean}\n */\nfunction isUserSuppressingKeyboardEvent(gridOptionsService, keyboardEvent, rowNode, column, editing) {\n var colDefFunc = column ? column.getColDef().suppressKeyboardEvent : undefined;\n // if no callbacks provided by user, then do nothing\n if (!colDefFunc) {\n return false;\n }\n var params = gridOptionsService.addGridCommonParams({\n event: keyboardEvent,\n editing: editing,\n column: column,\n node: rowNode,\n data: rowNode.data,\n colDef: column.getColDef()\n });\n // colDef get first preference on suppressing events\n if (colDefFunc) {\n var colDefFuncResult = colDefFunc(params);\n // if colDef func suppressed, then return now, no need to call gridOption func\n if (colDefFuncResult) {\n return true;\n }\n }\n // otherwise return false, don't suppress, as colDef didn't suppress and no func on gridOptions\n return false;\n}\nfunction isUserSuppressingHeaderKeyboardEvent(gridOptionsService, keyboardEvent, headerRowIndex, column) {\n var colDef = column.getDefinition();\n var colDefFunc = colDef && colDef.suppressHeaderKeyboardEvent;\n if (!exists(colDefFunc)) {\n return false;\n }\n var params = gridOptionsService.addGridCommonParams({\n colDef: colDef,\n column: column,\n headerRowIndex: headerRowIndex,\n event: keyboardEvent\n });\n return !!colDefFunc(params);\n}\nfunction normaliseQwertyAzerty(keyboardEvent) {\n var keyCode = keyboardEvent.keyCode;\n var code;\n switch (keyCode) {\n case A_KEYCODE:\n code = KeyCode.A;\n break;\n case C_KEYCODE:\n code = KeyCode.C;\n break;\n case V_KEYCODE:\n code = KeyCode.V;\n break;\n case D_KEYCODE:\n code = KeyCode.D;\n break;\n case Z_KEYCODE:\n code = KeyCode.Z;\n break;\n case Y_KEYCODE:\n code = KeyCode.Y;\n break;\n default:\n code = keyboardEvent.code;\n }\n return code;\n}\nfunction isDeleteKey(key, alwaysReturnFalseOnBackspace) {\n if (alwaysReturnFalseOnBackspace === void 0) { alwaysReturnFalseOnBackspace = false; }\n if (key === KeyCode.DELETE) {\n return true;\n }\n if (!alwaysReturnFalseOnBackspace && key === KeyCode.BACKSPACE) {\n return isMacOsUserAgent();\n }\n return false;\n}\n\nvar KeyboardUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n isEventFromPrintableCharacter: isEventFromPrintableCharacter,\n isUserSuppressingKeyboardEvent: isUserSuppressingKeyboardEvent,\n isUserSuppressingHeaderKeyboardEvent: isUserSuppressingHeaderKeyboardEvent,\n normaliseQwertyAzerty: normaliseQwertyAzerty,\n isDeleteKey: isDeleteKey\n});\n\n/**\n * `True` if the event is close to the original event by X pixels either vertically or horizontally.\n * we only start dragging after X pixels so this allows us to know if we should start dragging yet.\n * @param {MouseEvent | TouchEvent} e1\n * @param {MouseEvent | TouchEvent} e2\n * @param {number} pixelCount\n * @returns {boolean}\n */\nfunction areEventsNear(e1, e2, pixelCount) {\n // by default, we wait 4 pixels before starting the drag\n if (pixelCount === 0) {\n return false;\n }\n var diffX = Math.abs(e1.clientX - e2.clientX);\n var diffY = Math.abs(e1.clientY - e2.clientY);\n return Math.max(diffX, diffY) <= pixelCount;\n}\n\nvar MouseUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n areEventsNear: areEventsNear\n});\n\n/**\n * Gets called by: a) ClientSideNodeManager and b) GroupStage to do sorting.\n * when in ClientSideNodeManager we always have indexes (as this sorts the items the\n * user provided) but when in GroupStage, the nodes can contain filler nodes that\n * don't have order id's\n * @param {RowNode[]} rowNodes\n * @param {Object} rowNodeOrder\n *\n * @returns a boolean representing whether nodes were reordered\n */\nfunction sortRowNodesByOrder(rowNodes, rowNodeOrder) {\n if (!rowNodes) {\n return false;\n }\n var comparator = function (nodeA, nodeB) {\n var positionA = rowNodeOrder[nodeA.id];\n var positionB = rowNodeOrder[nodeB.id];\n var aHasIndex = positionA !== undefined;\n var bHasIndex = positionB !== undefined;\n var bothNodesAreUserNodes = aHasIndex && bHasIndex;\n var bothNodesAreFillerNodes = !aHasIndex && !bHasIndex;\n if (bothNodesAreUserNodes) {\n // when comparing two nodes the user has provided, they always\n // have indexes\n return positionA - positionB;\n }\n if (bothNodesAreFillerNodes) {\n // when comparing two filler nodes, we have no index to compare them\n // against, however we want this sorting to be deterministic, so that\n // the rows don't jump around as the user does delta updates. so we\n // want the same sort result. so we use the __objectId - which doesn't make sense\n // from a sorting point of view, but does give consistent behaviour between\n // calls. otherwise groups jump around as delta updates are done.\n // note: previously here we used nodeId, however this gave a strange order\n // as string ordering of numbers is wrong, so using id based on creation order\n // as least gives better looking order.\n return nodeA.__objectId - nodeB.__objectId;\n }\n if (aHasIndex) {\n return 1;\n }\n return -1;\n };\n // check if the list first needs sorting\n var rowNodeA;\n var rowNodeB;\n var atLeastOneOutOfOrder = false;\n for (var i = 0; i < rowNodes.length - 1; i++) {\n rowNodeA = rowNodes[i];\n rowNodeB = rowNodes[i + 1];\n if (comparator(rowNodeA, rowNodeB) > 0) {\n atLeastOneOutOfOrder = true;\n break;\n }\n }\n if (atLeastOneOutOfOrder) {\n rowNodes.sort(comparator);\n return true;\n }\n return false;\n}\n\nvar RowNodeUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n sortRowNodesByOrder: sortRowNodesByOrder\n});\n\nfunction convertToSet(list) {\n var set = new Set();\n list.forEach(function (x) { return set.add(x); });\n return set;\n}\n\nvar SetUtils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n convertToSet: convertToSet\n});\n\nvar __assign$p = ( false) || function () {\n __assign$p = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$p.apply(this, arguments);\n};\nvar utils = __assign$p(__assign$p(__assign$p(__assign$p(__assign$p(__assign$p(__assign$p(__assign$p(__assign$p(__assign$p(__assign$p(__assign$p(__assign$p(__assign$p(__assign$p(__assign$p(__assign$p(__assign$p({}, AriaUtils), ArrayUtils), BrowserUtils), DateUtils), DomUtils), EventUtils), FunctionUtils), FuzzyMatchUtils), GenericUtils), IconUtils), KeyboardUtils), MapUtils), MouseUtils), NumberUtils), ObjectUtils), RowNodeUtils), SetUtils), StringUtils);\nvar _ = utils;\n\nvar NumberSequence = /** @class */ (function () {\n function NumberSequence(initValue, step) {\n if (initValue === void 0) { initValue = 0; }\n if (step === void 0) { step = 1; }\n this.nextValue = initValue;\n this.step = step;\n }\n NumberSequence.prototype.next = function () {\n var valToReturn = this.nextValue;\n this.nextValue += this.step;\n return valToReturn;\n };\n NumberSequence.prototype.peek = function () {\n return this.nextValue;\n };\n NumberSequence.prototype.skip = function (count) {\n this.nextValue += count;\n };\n return NumberSequence;\n}());\n\nvar AgPromiseStatus;\n(function (AgPromiseStatus) {\n AgPromiseStatus[AgPromiseStatus[\"IN_PROGRESS\"] = 0] = \"IN_PROGRESS\";\n AgPromiseStatus[AgPromiseStatus[\"RESOLVED\"] = 1] = \"RESOLVED\";\n})(AgPromiseStatus || (AgPromiseStatus = {}));\nvar AgPromise = /** @class */ (function () {\n function AgPromise(callback) {\n var _this = this;\n this.status = AgPromiseStatus.IN_PROGRESS;\n this.resolution = null;\n this.waiters = [];\n callback(function (value) { return _this.onDone(value); }, function (params) { return _this.onReject(params); });\n }\n AgPromise.all = function (promises) {\n return new AgPromise(function (resolve) {\n var remainingToResolve = promises.length;\n var combinedValues = new Array(remainingToResolve);\n promises.forEach(function (promise, index) {\n promise.then(function (value) {\n combinedValues[index] = value;\n remainingToResolve--;\n if (remainingToResolve === 0) {\n resolve(combinedValues);\n }\n });\n });\n });\n };\n AgPromise.resolve = function (value) {\n if (value === void 0) { value = null; }\n return new AgPromise(function (resolve) { return resolve(value); });\n };\n AgPromise.prototype.then = function (func) {\n var _this = this;\n return new AgPromise(function (resolve) {\n if (_this.status === AgPromiseStatus.RESOLVED) {\n resolve(func(_this.resolution));\n }\n else {\n _this.waiters.push(function (value) { return resolve(func(value)); });\n }\n });\n };\n AgPromise.prototype.resolveNow = function (ifNotResolvedValue, ifResolved) {\n return this.status === AgPromiseStatus.RESOLVED ? ifResolved(this.resolution) : ifNotResolvedValue;\n };\n AgPromise.prototype.onDone = function (value) {\n this.status = AgPromiseStatus.RESOLVED;\n this.resolution = value;\n this.waiters.forEach(function (waiter) { return waiter(value); });\n };\n AgPromise.prototype.onReject = function (params) {\n console.warn('TBI');\n };\n return AgPromise;\n}());\n\n/**\n * A Util Class only used when debugging for printing time to console\n */\nvar Timer = /** @class */ (function () {\n function Timer() {\n this.timestamp = new Date().getTime();\n }\n Timer.prototype.print = function (msg) {\n var duration = (new Date().getTime()) - this.timestamp;\n console.info(\"\".concat(msg, \" = \").concat(duration));\n this.timestamp = new Date().getTime();\n };\n return Timer;\n}());\n\nvar __extends$3a = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$o = ( false) || function () {\n __assign$o = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$o.apply(this, arguments);\n};\nvar __decorate$2D = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar TooltipStates;\n(function (TooltipStates) {\n TooltipStates[TooltipStates[\"NOTHING\"] = 0] = \"NOTHING\";\n TooltipStates[TooltipStates[\"WAITING_TO_SHOW\"] = 1] = \"WAITING_TO_SHOW\";\n TooltipStates[TooltipStates[\"SHOWING\"] = 2] = \"SHOWING\";\n})(TooltipStates || (TooltipStates = {}));\nvar TooltipTrigger;\n(function (TooltipTrigger) {\n TooltipTrigger[TooltipTrigger[\"HOVER\"] = 0] = \"HOVER\";\n TooltipTrigger[TooltipTrigger[\"FOCUS\"] = 1] = \"FOCUS\";\n})(TooltipTrigger || (TooltipTrigger = {}));\nvar CustomTooltipFeature = /** @class */ (function (_super) {\n __extends$3a(CustomTooltipFeature, _super);\n function CustomTooltipFeature(parentComp, tooltipShowDelayOverride, tooltipHideDelayOverride) {\n var _this = _super.call(this) || this;\n _this.parentComp = parentComp;\n _this.tooltipShowDelayOverride = tooltipShowDelayOverride;\n _this.tooltipHideDelayOverride = tooltipHideDelayOverride;\n _this.SHOW_QUICK_TOOLTIP_DIFF = 1000;\n _this.FADE_OUT_TOOLTIP_TIMEOUT = 1000;\n _this.INTERACTIVE_HIDE_DELAY = 100;\n _this.interactionEnabled = false;\n _this.isInteractingWithTooltip = false;\n _this.state = TooltipStates.NOTHING;\n // when showing the tooltip, we need to make sure it's the most recent instance we request, as due to\n // async we could request two tooltips before the first instance returns, in which case we should\n // disregard the second instance.\n _this.tooltipInstanceCount = 0;\n _this.tooltipMouseTrack = false;\n return _this;\n }\n CustomTooltipFeature.prototype.postConstruct = function () {\n if (this.gridOptionsService.get('tooltipInteraction')) {\n this.interactionEnabled = true;\n }\n this.tooltipTrigger = this.getTooltipTrigger();\n this.tooltipMouseTrack = this.gridOptionsService.get('tooltipMouseTrack');\n var el = this.parentComp.getGui();\n if (this.tooltipTrigger === TooltipTrigger.HOVER) {\n this.addManagedListener(el, 'mouseenter', this.onMouseEnter.bind(this));\n this.addManagedListener(el, 'mouseleave', this.onMouseLeave.bind(this));\n }\n if (this.tooltipTrigger === TooltipTrigger.FOCUS) {\n this.addManagedListener(el, 'focusin', this.onFocusIn.bind(this));\n this.addManagedListener(el, 'focusout', this.onFocusOut.bind(this));\n }\n this.addManagedListener(el, 'mousemove', this.onMouseMove.bind(this));\n if (!this.interactionEnabled) {\n this.addManagedListener(el, 'mousedown', this.onMouseDown.bind(this));\n this.addManagedListener(el, 'keydown', this.onKeyDown.bind(this));\n }\n };\n CustomTooltipFeature.prototype.getGridOptionsTooltipDelay = function (delayOption) {\n var delay = this.gridOptionsService.get(delayOption);\n if (delay < 0) {\n warnOnce(\"\".concat(delayOption, \" should not be lower than 0\"));\n }\n return Math.max(200, delay);\n };\n CustomTooltipFeature.prototype.getTooltipDelay = function (type) {\n var _a, _b;\n if (type === 'show') {\n return (_a = this.tooltipShowDelayOverride) !== null && _a !== void 0 ? _a : this.getGridOptionsTooltipDelay('tooltipShowDelay');\n }\n else {\n return (_b = this.tooltipHideDelayOverride) !== null && _b !== void 0 ? _b : this.getGridOptionsTooltipDelay('tooltipHideDelay');\n }\n };\n CustomTooltipFeature.prototype.destroy = function () {\n // if this component gets destroyed while tooltip is showing, need to make sure\n // we don't end with no mouseLeave event resulting in zombie tooltip\n this.setToDoNothing();\n _super.prototype.destroy.call(this);\n };\n CustomTooltipFeature.prototype.getTooltipTrigger = function () {\n var trigger = this.gridOptionsService.get('tooltipTrigger');\n if (!trigger || trigger === 'hover') {\n return TooltipTrigger.HOVER;\n }\n return TooltipTrigger.FOCUS;\n };\n CustomTooltipFeature.prototype.onMouseEnter = function (e) {\n var _this = this;\n // if `interactiveTooltipTimeoutId` is set, it means that this cell has a tooltip\n // and we are in the process of moving the cursor from the tooltip back to the cell\n // so we need to unlock this service here.\n if (this.interactionEnabled && this.interactiveTooltipTimeoutId) {\n this.unlockService();\n this.startHideTimeout();\n }\n if (isIOSUserAgent()) {\n return;\n }\n if (CustomTooltipFeature.isLocked) {\n this.showTooltipTimeoutId = window.setTimeout(function () {\n _this.prepareToShowTooltip(e);\n }, this.INTERACTIVE_HIDE_DELAY);\n }\n else {\n this.prepareToShowTooltip(e);\n }\n };\n CustomTooltipFeature.prototype.onMouseMove = function (e) {\n // there is a delay from the time we mouseOver a component and the time the\n // tooltip is displayed, so we need to track mousemove to be able to correctly\n // position the tooltip when showTooltip is called.\n if (this.lastMouseEvent) {\n this.lastMouseEvent = e;\n }\n if (this.tooltipMouseTrack &&\n this.state === TooltipStates.SHOWING &&\n this.tooltipComp) {\n this.positionTooltip();\n }\n };\n CustomTooltipFeature.prototype.onMouseDown = function () {\n this.setToDoNothing();\n };\n CustomTooltipFeature.prototype.onMouseLeave = function () {\n // if interaction is enabled, we need to verify if the user is moving\n // the cursor from the cell onto the tooltip, so we lock the service \n // for 100ms to prevent other tooltips from being created while this is happening.\n if (this.interactionEnabled) {\n this.lockService();\n }\n else {\n this.setToDoNothing();\n }\n };\n CustomTooltipFeature.prototype.onFocusIn = function () {\n this.prepareToShowTooltip();\n };\n CustomTooltipFeature.prototype.onFocusOut = function (e) {\n var _a;\n var relatedTarget = e.relatedTarget;\n var parentCompGui = this.parentComp.getGui();\n var tooltipGui = (_a = this.tooltipComp) === null || _a === void 0 ? void 0 : _a.getGui();\n if (this.isInteractingWithTooltip ||\n parentCompGui.contains(relatedTarget) ||\n (this.interactionEnabled && (tooltipGui === null || tooltipGui === void 0 ? void 0 : tooltipGui.contains(relatedTarget)))) {\n return;\n }\n this.setToDoNothing();\n };\n CustomTooltipFeature.prototype.onKeyDown = function () {\n this.setToDoNothing();\n };\n CustomTooltipFeature.prototype.prepareToShowTooltip = function (mouseEvent) {\n // every mouseenter should be following by a mouseleave, however for some unknown, it's possible for\n // mouseenter to be called twice in a row, which can happen if editing the cell. this was reported\n // in https://ag-grid.atlassian.net/browse/AG-4422. to get around this, we check the state, and if\n // state is != nothing, then we know mouseenter was already received.\n if (this.state != TooltipStates.NOTHING || CustomTooltipFeature.isLocked) {\n return false;\n }\n // if we are showing the tooltip because of focus, no delay at all\n // if another tooltip was hidden very recently, we only wait 200ms to show, not the normal waiting time\n var delay = 0;\n if (mouseEvent) {\n delay = this.isLastTooltipHiddenRecently() ? 200 : this.getTooltipDelay('show');\n }\n this.lastMouseEvent = mouseEvent || null;\n this.showTooltipTimeoutId = window.setTimeout(this.showTooltip.bind(this), delay);\n this.state = TooltipStates.WAITING_TO_SHOW;\n return true;\n };\n CustomTooltipFeature.prototype.isLastTooltipHiddenRecently = function () {\n // return true if <1000ms since last time we hid a tooltip\n var now = new Date().getTime();\n var then = CustomTooltipFeature.lastTooltipHideTime;\n return (now - then) < this.SHOW_QUICK_TOOLTIP_DIFF;\n };\n CustomTooltipFeature.prototype.setToDoNothing = function () {\n if (this.state === TooltipStates.SHOWING) {\n this.hideTooltip();\n }\n if (this.onBodyScrollEventCallback) {\n this.onBodyScrollEventCallback();\n this.onBodyScrollEventCallback = undefined;\n }\n if (this.onColumnMovedEventCallback) {\n this.onColumnMovedEventCallback();\n this.onColumnMovedEventCallback = undefined;\n }\n this.clearTimeouts();\n this.state = TooltipStates.NOTHING;\n this.lastMouseEvent = null;\n };\n CustomTooltipFeature.prototype.showTooltip = function () {\n var params = __assign$o({}, this.parentComp.getTooltipParams());\n if (!exists(params.value)) {\n this.setToDoNothing();\n return;\n }\n this.state = TooltipStates.SHOWING;\n this.tooltipInstanceCount++;\n // we pass in tooltipInstanceCount so the callback knows what the count was when\n // we requested the tooltip, so if another tooltip was requested in the mean time\n // we disregard it\n var callback = this.newTooltipComponentCallback.bind(this, this.tooltipInstanceCount);\n var userDetails = this.userComponentFactory.getTooltipCompDetails(params);\n userDetails.newAgStackInstance().then(callback);\n };\n CustomTooltipFeature.prototype.hideTooltip = function (forceHide) {\n if (!forceHide && this.isInteractingWithTooltip) {\n return;\n }\n // check if comp exists - due to async, although we asked for\n // one, the instance may not be back yet\n if (this.tooltipComp) {\n this.destroyTooltipComp();\n CustomTooltipFeature.lastTooltipHideTime = new Date().getTime();\n }\n var event = {\n type: Events.EVENT_TOOLTIP_HIDE,\n parentGui: this.parentComp.getGui()\n };\n this.eventService.dispatchEvent(event);\n this.state = TooltipStates.NOTHING;\n };\n CustomTooltipFeature.prototype.newTooltipComponentCallback = function (tooltipInstanceCopy, tooltipComp) {\n var compNoLongerNeeded = this.state !== TooltipStates.SHOWING || this.tooltipInstanceCount !== tooltipInstanceCopy;\n if (compNoLongerNeeded) {\n this.getContext().destroyBean(tooltipComp);\n return;\n }\n var eGui = tooltipComp.getGui();\n this.tooltipComp = tooltipComp;\n if (!eGui.classList.contains('ag-tooltip')) {\n eGui.classList.add('ag-tooltip-custom');\n }\n if (this.tooltipTrigger === TooltipTrigger.HOVER) {\n eGui.classList.add('ag-tooltip-animate');\n }\n if (this.interactionEnabled) {\n eGui.classList.add('ag-tooltip-interactive');\n }\n var translate = this.localeService.getLocaleTextFunc();\n var addPopupRes = this.popupService.addPopup({\n eChild: eGui,\n ariaLabel: translate('ariaLabelTooltip', 'Tooltip')\n });\n if (addPopupRes) {\n this.tooltipPopupDestroyFunc = addPopupRes.hideFunc;\n }\n this.positionTooltip();\n if (this.tooltipTrigger === TooltipTrigger.FOCUS) {\n this.onBodyScrollEventCallback = this.addManagedListener(this.eventService, Events.EVENT_BODY_SCROLL, this.setToDoNothing.bind(this));\n this.onColumnMovedEventCallback = this.addManagedListener(this.eventService, Events.EVENT_COLUMN_MOVED, this.setToDoNothing.bind(this));\n }\n if (this.interactionEnabled) {\n if (this.tooltipTrigger === TooltipTrigger.HOVER) {\n this.tooltipMouseEnterListener = this.addManagedListener(eGui, 'mouseenter', this.onTooltipMouseEnter.bind(this)) || null;\n this.tooltipMouseLeaveListener = this.addManagedListener(eGui, 'mouseleave', this.onTooltipMouseLeave.bind(this)) || null;\n }\n else {\n this.tooltipFocusInListener = this.addManagedListener(eGui, 'focusin', this.onTooltipFocusIn.bind(this)) || null;\n this.tooltipFocusOutListener = this.addManagedListener(eGui, 'focusout', this.onTooltipFocusOut.bind(this)) || null;\n }\n }\n var event = {\n type: Events.EVENT_TOOLTIP_SHOW,\n tooltipGui: eGui,\n parentGui: this.parentComp.getGui()\n };\n this.eventService.dispatchEvent(event);\n this.startHideTimeout();\n };\n CustomTooltipFeature.prototype.onTooltipMouseEnter = function () {\n this.isInteractingWithTooltip = true;\n this.unlockService();\n };\n CustomTooltipFeature.prototype.onTooltipMouseLeave = function () {\n this.isInteractingWithTooltip = false;\n this.lockService();\n };\n CustomTooltipFeature.prototype.onTooltipFocusIn = function () {\n this.isInteractingWithTooltip = true;\n };\n CustomTooltipFeature.prototype.onTooltipFocusOut = function (e) {\n var _a;\n var parentGui = this.parentComp.getGui();\n var tooltipGui = (_a = this.tooltipComp) === null || _a === void 0 ? void 0 : _a.getGui();\n var relatedTarget = e.relatedTarget;\n // focusout is dispatched when inner elements lose focus\n // so we need to verify if focus is contained within the tooltip\n if (tooltipGui === null || tooltipGui === void 0 ? void 0 : tooltipGui.contains(relatedTarget)) {\n return;\n }\n this.isInteractingWithTooltip = false;\n // if we move the focus from the tooltip back to the original cell\n // the tooltip should remain open, but we need to restart the hide timeout counter\n if (parentGui.contains(relatedTarget)) {\n this.startHideTimeout();\n }\n // if the parent cell doesn't contain the focus, simply hide the tooltip\n else {\n this.hideTooltip();\n }\n };\n CustomTooltipFeature.prototype.positionTooltip = function () {\n var params = {\n type: 'tooltip',\n ePopup: this.tooltipComp.getGui(),\n nudgeY: 18,\n skipObserver: this.tooltipMouseTrack\n };\n if (this.lastMouseEvent) {\n this.popupService.positionPopupUnderMouseEvent(__assign$o(__assign$o({}, params), { mouseEvent: this.lastMouseEvent }));\n }\n else {\n this.popupService.positionPopupByComponent(__assign$o(__assign$o({}, params), { eventSource: this.parentComp.getGui(), position: 'under', keepWithinBounds: true, nudgeY: 5 }));\n }\n };\n CustomTooltipFeature.prototype.destroyTooltipComp = function () {\n var _this = this;\n // add class to fade out the tooltip\n this.tooltipComp.getGui().classList.add('ag-tooltip-hiding');\n // make local copies of these variables, as we use them in the async function below,\n // and we clear then to 'undefined' later, so need to take a copy before they are undefined.\n var tooltipPopupDestroyFunc = this.tooltipPopupDestroyFunc;\n var tooltipComp = this.tooltipComp;\n var delay = this.tooltipTrigger === TooltipTrigger.HOVER ? this.FADE_OUT_TOOLTIP_TIMEOUT : 0;\n window.setTimeout(function () {\n tooltipPopupDestroyFunc();\n _this.getContext().destroyBean(tooltipComp);\n }, delay);\n this.clearTooltipListeners();\n this.tooltipPopupDestroyFunc = undefined;\n this.tooltipComp = undefined;\n };\n CustomTooltipFeature.prototype.clearTooltipListeners = function () {\n [\n this.tooltipMouseEnterListener, this.tooltipMouseLeaveListener,\n this.tooltipFocusInListener, this.tooltipFocusOutListener\n ].forEach(function (listener) {\n if (listener) {\n listener();\n }\n });\n this.tooltipMouseEnterListener = this.tooltipMouseLeaveListener =\n this.tooltipFocusInListener = this.tooltipFocusOutListener = null;\n };\n CustomTooltipFeature.prototype.lockService = function () {\n var _this = this;\n CustomTooltipFeature.isLocked = true;\n this.interactiveTooltipTimeoutId = window.setTimeout(function () {\n _this.unlockService();\n _this.setToDoNothing();\n }, this.INTERACTIVE_HIDE_DELAY);\n };\n CustomTooltipFeature.prototype.unlockService = function () {\n CustomTooltipFeature.isLocked = false;\n this.clearInteractiveTimeout();\n };\n CustomTooltipFeature.prototype.startHideTimeout = function () {\n this.clearHideTimeout();\n this.hideTooltipTimeoutId = window.setTimeout(this.hideTooltip.bind(this), this.getTooltipDelay('hide'));\n };\n CustomTooltipFeature.prototype.clearShowTimeout = function () {\n if (!this.showTooltipTimeoutId) {\n return;\n }\n window.clearTimeout(this.showTooltipTimeoutId);\n this.showTooltipTimeoutId = undefined;\n };\n CustomTooltipFeature.prototype.clearHideTimeout = function () {\n if (!this.hideTooltipTimeoutId) {\n return;\n }\n window.clearTimeout(this.hideTooltipTimeoutId);\n this.hideTooltipTimeoutId = undefined;\n };\n CustomTooltipFeature.prototype.clearInteractiveTimeout = function () {\n if (!this.interactiveTooltipTimeoutId) {\n return;\n }\n window.clearTimeout(this.interactiveTooltipTimeoutId);\n this.interactiveTooltipTimeoutId = undefined;\n };\n CustomTooltipFeature.prototype.clearTimeouts = function () {\n this.clearShowTimeout();\n this.clearHideTimeout();\n this.clearInteractiveTimeout();\n };\n CustomTooltipFeature.isLocked = false;\n __decorate$2D([\n Autowired('popupService')\n ], CustomTooltipFeature.prototype, \"popupService\", void 0);\n __decorate$2D([\n Autowired('userComponentFactory')\n ], CustomTooltipFeature.prototype, \"userComponentFactory\", void 0);\n __decorate$2D([\n PostConstruct\n ], CustomTooltipFeature.prototype, \"postConstruct\", null);\n return CustomTooltipFeature;\n}(BeanStub));\n\nvar CssClassManager = /** @class */ (function () {\n function CssClassManager(getGui) {\n // to minimise DOM hits, we only apply CSS classes if they have changed. as adding a CSS class that is already\n // there, or removing one that wasn't present, all takes CPU.\n this.cssClassStates = {};\n this.getGui = getGui;\n }\n CssClassManager.prototype.addCssClass = function (className) {\n var _this = this;\n var list = (className || '').split(' ');\n if (list.length > 1) {\n list.forEach(function (cls) { return _this.addCssClass(cls); });\n return;\n }\n var updateNeeded = this.cssClassStates[className] !== true;\n if (updateNeeded && className.length) {\n var eGui = this.getGui();\n if (eGui) {\n eGui.classList.add(className);\n }\n this.cssClassStates[className] = true;\n }\n };\n CssClassManager.prototype.removeCssClass = function (className) {\n var _this = this;\n var list = (className || '').split(' ');\n if (list.length > 1) {\n list.forEach(function (cls) { return _this.removeCssClass(cls); });\n return;\n }\n var updateNeeded = this.cssClassStates[className] !== false;\n if (updateNeeded && className.length) {\n var eGui = this.getGui();\n if (eGui) {\n eGui.classList.remove(className);\n }\n this.cssClassStates[className] = false;\n }\n };\n CssClassManager.prototype.containsCssClass = function (className) {\n var eGui = this.getGui();\n if (!eGui) {\n return false;\n }\n return eGui.classList.contains(className);\n };\n CssClassManager.prototype.addOrRemoveCssClass = function (className, addOrRemove) {\n var _this = this;\n if (!className) {\n return;\n }\n // we check for spaces before doing the split, as doing the split\n // created a performance problem (on windows only, see AG-6765)\n if (className.indexOf(' ') >= 0) {\n var list = (className || '').split(' ');\n if (list.length > 1) {\n list.forEach(function (cls) { return _this.addOrRemoveCssClass(cls, addOrRemove); });\n return;\n }\n }\n var updateNeeded = this.cssClassStates[className] !== addOrRemove;\n if (updateNeeded && className.length) {\n var eGui = this.getGui();\n if (eGui) {\n eGui.classList.toggle(className, addOrRemove);\n }\n this.cssClassStates[className] = addOrRemove;\n }\n };\n return CssClassManager;\n}());\n\nvar __extends$39 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2C = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar compIdSequence = new NumberSequence();\nvar Component = /** @class */ (function (_super) {\n __extends$39(Component, _super);\n function Component(template) {\n var _this = _super.call(this) || this;\n // if false, then CSS class \"ag-hidden\" is applied, which sets \"display: none\"\n _this.displayed = true;\n // if false, then CSS class \"ag-invisible\" is applied, which sets \"visibility: hidden\"\n _this.visible = true;\n // unique id for this row component. this is used for getting a reference to the HTML dom.\n // we cannot use the RowNode id as this is not unique (due to animation, old rows can be lying\n // around as we create a new rowComp instance for the same row node).\n _this.compId = compIdSequence.next();\n _this.cssClassManager = new CssClassManager(function () { return _this.eGui; });\n if (template) {\n _this.setTemplate(template);\n }\n return _this;\n }\n Component.prototype.preConstructOnComponent = function () {\n this.usingBrowserTooltips = this.gridOptionsService.get('enableBrowserTooltips');\n };\n Component.prototype.getCompId = function () {\n return this.compId;\n };\n Component.prototype.getTooltipParams = function () {\n return {\n value: this.tooltipText,\n location: 'UNKNOWN'\n };\n };\n Component.prototype.setTooltip = function (newTooltipText, showDelayOverride, hideDelayOverride) {\n var _this = this;\n var removeTooltip = function () {\n if (_this.usingBrowserTooltips) {\n _this.getGui().removeAttribute('title');\n }\n else {\n _this.tooltipFeature = _this.destroyBean(_this.tooltipFeature);\n }\n };\n var addTooltip = function () {\n if (_this.usingBrowserTooltips) {\n _this.getGui().setAttribute('title', _this.tooltipText);\n }\n else {\n _this.tooltipFeature = _this.createBean(new CustomTooltipFeature(_this, showDelayOverride, hideDelayOverride));\n }\n };\n if (this.tooltipText != newTooltipText) {\n if (this.tooltipText) {\n removeTooltip();\n }\n if (newTooltipText != null) {\n this.tooltipText = newTooltipText;\n if (this.tooltipText) {\n addTooltip();\n }\n }\n }\n };\n // for registered components only, eg creates AgCheckbox instance from ag-checkbox HTML tag\n Component.prototype.createChildComponentsFromTags = function (parentNode, paramsMap) {\n var _this = this;\n // we MUST take a copy of the list first, as the 'swapComponentForNode' adds comments into the DOM\n // which messes up the traversal order of the children.\n var childNodeList = copyNodeList(parentNode.childNodes);\n childNodeList.forEach(function (childNode) {\n if (!(childNode instanceof HTMLElement)) {\n return;\n }\n var childComp = _this.createComponentFromElement(childNode, function (childComp) {\n // copy over all attributes, including css classes, so any attributes user put on the tag\n // wll be carried across\n var childGui = childComp.getGui();\n if (childGui) {\n _this.copyAttributesFromNode(childNode, childComp.getGui());\n }\n }, paramsMap);\n if (childComp) {\n if (childComp.addItems && childNode.children.length) {\n _this.createChildComponentsFromTags(childNode, paramsMap);\n // converting from HTMLCollection to Array\n var items = Array.prototype.slice.call(childNode.children);\n childComp.addItems(items);\n }\n // replace the tag (eg ag-checkbox) with the proper HTMLElement (eg 'div') in the dom\n _this.swapComponentForNode(childComp, parentNode, childNode);\n }\n else if (childNode.childNodes) {\n _this.createChildComponentsFromTags(childNode, paramsMap);\n }\n });\n };\n Component.prototype.createComponentFromElement = function (element, afterPreCreateCallback, paramsMap) {\n var key = element.nodeName;\n var componentParams = paramsMap ? paramsMap[element.getAttribute('ref')] : undefined;\n var ComponentClass = this.agStackComponentsRegistry.getComponentClass(key);\n if (ComponentClass) {\n Component.elementGettingCreated = element;\n var newComponent = new ComponentClass(componentParams);\n newComponent.setParentComponent(this);\n this.createBean(newComponent, null, afterPreCreateCallback);\n return newComponent;\n }\n return null;\n };\n Component.prototype.copyAttributesFromNode = function (source, dest) {\n iterateNamedNodeMap(source.attributes, function (name, value) { return dest.setAttribute(name, value); });\n };\n Component.prototype.swapComponentForNode = function (newComponent, parentNode, childNode) {\n var eComponent = newComponent.getGui();\n parentNode.replaceChild(eComponent, childNode);\n parentNode.insertBefore(document.createComment(childNode.nodeName), eComponent);\n this.addDestroyFunc(this.destroyBean.bind(this, newComponent));\n this.swapInComponentForQuerySelectors(newComponent, childNode);\n };\n Component.prototype.swapInComponentForQuerySelectors = function (newComponent, childNode) {\n var thisNoType = this;\n this.iterateOverQuerySelectors(function (querySelector) {\n if (thisNoType[querySelector.attributeName] === childNode) {\n thisNoType[querySelector.attributeName] = newComponent;\n }\n });\n };\n Component.prototype.iterateOverQuerySelectors = function (action) {\n var thisPrototype = Object.getPrototypeOf(this);\n while (thisPrototype != null) {\n var metaData = thisPrototype.__agComponentMetaData;\n var currentProtoName = getFunctionName(thisPrototype.constructor);\n if (metaData && metaData[currentProtoName] && metaData[currentProtoName].querySelectors) {\n metaData[currentProtoName].querySelectors.forEach(function (querySelector) { return action(querySelector); });\n }\n thisPrototype = Object.getPrototypeOf(thisPrototype);\n }\n };\n Component.prototype.activateTabIndex = function (elements) {\n var tabIndex = this.gridOptionsService.get('tabIndex');\n if (!elements) {\n elements = [];\n }\n if (!elements.length) {\n elements.push(this.getGui());\n }\n elements.forEach(function (el) { return el.setAttribute('tabindex', tabIndex.toString()); });\n };\n Component.prototype.setTemplate = function (template, paramsMap) {\n var eGui = loadTemplate(template);\n this.setTemplateFromElement(eGui, paramsMap);\n };\n Component.prototype.setTemplateFromElement = function (element, paramsMap) {\n this.eGui = element;\n this.eGui.__agComponent = this;\n this.wireQuerySelectors();\n // context will not be available when user sets template in constructor\n if (!!this.getContext()) {\n this.createChildComponentsFromTags(this.getGui(), paramsMap);\n }\n };\n Component.prototype.createChildComponentsPreConstruct = function () {\n // ui exists if user sets template in constructor. when this happens, we have to wait for the context\n // to be autoWired first before we can create child components.\n if (!!this.getGui()) {\n this.createChildComponentsFromTags(this.getGui());\n }\n };\n Component.prototype.wireQuerySelectors = function () {\n var _this = this;\n if (!this.eGui) {\n return;\n }\n var thisNoType = this;\n this.iterateOverQuerySelectors(function (querySelector) {\n var setResult = function (result) { return thisNoType[querySelector.attributeName] = result; };\n // if it's a ref selector, and match is on top level component, we return\n // the element. otherwise no way of components putting ref=xxx on the top\n // level element as querySelector only looks at children.\n var topLevelRefMatch = querySelector.refSelector\n && _this.getAttribute('ref') === querySelector.refSelector;\n if (topLevelRefMatch) {\n setResult(_this.eGui);\n }\n else {\n // otherwise use querySelector, which looks at children\n var resultOfQuery = _this.eGui.querySelector(querySelector.querySelector);\n if (resultOfQuery) {\n setResult(resultOfQuery.__agComponent || resultOfQuery);\n }\n }\n });\n };\n Component.prototype.getGui = function () {\n return this.eGui;\n };\n Component.prototype.getFocusableElement = function () {\n return this.eGui;\n };\n Component.prototype.getAriaElement = function () {\n return this.getFocusableElement();\n };\n Component.prototype.setParentComponent = function (component) {\n this.parentComponent = component;\n };\n Component.prototype.getParentComponent = function () {\n return this.parentComponent;\n };\n // this method is for older code, that wants to provide the gui element,\n // it is not intended for this to be in ag-Stack\n Component.prototype.setGui = function (eGui) {\n this.eGui = eGui;\n };\n Component.prototype.queryForHtmlElement = function (cssSelector) {\n return this.eGui.querySelector(cssSelector);\n };\n Component.prototype.queryForHtmlInputElement = function (cssSelector) {\n return this.eGui.querySelector(cssSelector);\n };\n Component.prototype.appendChild = function (newChild, container) {\n if (newChild == null) {\n return;\n }\n if (!container) {\n container = this.eGui;\n }\n if (isNodeOrElement(newChild)) {\n container.appendChild(newChild);\n }\n else {\n var childComponent = newChild;\n container.appendChild(childComponent.getGui());\n }\n };\n Component.prototype.isDisplayed = function () {\n return this.displayed;\n };\n Component.prototype.setVisible = function (visible, options) {\n if (options === void 0) { options = {}; }\n if (visible !== this.visible) {\n this.visible = visible;\n var skipAriaHidden = options.skipAriaHidden;\n setVisible(this.eGui, visible, { skipAriaHidden: skipAriaHidden });\n }\n };\n Component.prototype.setDisplayed = function (displayed, options) {\n if (options === void 0) { options = {}; }\n if (displayed !== this.displayed) {\n this.displayed = displayed;\n var skipAriaHidden = options.skipAriaHidden;\n setDisplayed(this.eGui, displayed, { skipAriaHidden: skipAriaHidden });\n var event_1 = {\n type: Component.EVENT_DISPLAYED_CHANGED,\n visible: this.displayed\n };\n this.dispatchEvent(event_1);\n }\n };\n Component.prototype.destroy = function () {\n if (this.tooltipFeature) {\n this.tooltipFeature = this.destroyBean(this.tooltipFeature);\n }\n if (this.parentComponent) {\n this.parentComponent = undefined;\n }\n var eGui = this.eGui;\n if (eGui && eGui.__agComponent) {\n eGui.__agComponent = undefined;\n }\n _super.prototype.destroy.call(this);\n };\n Component.prototype.addGuiEventListener = function (event, listener, options) {\n var _this = this;\n this.eGui.addEventListener(event, listener, options);\n this.addDestroyFunc(function () { return _this.eGui.removeEventListener(event, listener); });\n };\n Component.prototype.addCssClass = function (className) {\n this.cssClassManager.addCssClass(className);\n };\n Component.prototype.removeCssClass = function (className) {\n this.cssClassManager.removeCssClass(className);\n };\n Component.prototype.containsCssClass = function (className) {\n return this.cssClassManager.containsCssClass(className);\n };\n Component.prototype.addOrRemoveCssClass = function (className, addOrRemove) {\n this.cssClassManager.addOrRemoveCssClass(className, addOrRemove);\n };\n Component.prototype.getAttribute = function (key) {\n var eGui = this.eGui;\n return eGui ? eGui.getAttribute(key) : null;\n };\n Component.prototype.getRefElement = function (refName) {\n return this.queryForHtmlElement(\"[ref=\\\"\".concat(refName, \"\\\"]\"));\n };\n Component.EVENT_DISPLAYED_CHANGED = 'displayedChanged';\n __decorate$2C([\n Autowired('agStackComponentsRegistry')\n ], Component.prototype, \"agStackComponentsRegistry\", void 0);\n __decorate$2C([\n PreConstruct\n ], Component.prototype, \"preConstructOnComponent\", null);\n __decorate$2C([\n PreConstruct\n ], Component.prototype, \"createChildComponentsPreConstruct\", null);\n return Component;\n}(BeanStub));\n\nfunction QuerySelector(selector) {\n return querySelectorFunc.bind(this, selector, undefined);\n}\nfunction RefSelector(ref) {\n return querySelectorFunc.bind(this, \"[ref=\".concat(ref, \"]\"), ref);\n}\nfunction querySelectorFunc(selector, refSelector, classPrototype, methodOrAttributeName, index) {\n if (selector === null) {\n console.error('AG Grid: QuerySelector selector should not be null');\n return;\n }\n if (typeof index === 'number') {\n console.error('AG Grid: QuerySelector should be on an attribute');\n return;\n }\n addToObjectProps(classPrototype, 'querySelectors', {\n attributeName: methodOrAttributeName,\n querySelector: selector,\n refSelector: refSelector\n });\n}\n// // think we should take this out, put property bindings on the\n// export function Method(eventName?: string): Function {\n// return methodFunc.bind(this, eventName);\n// }\n//\n// function methodFunc(alias: string, target: Object, methodName: string) {\n// if (alias === null) {\n// console.error(\"AG Grid: EventListener eventName should not be null\");\n// return;\n// }\n//\n// addToObjectProps(target, 'methods', {\n// methodName: methodName,\n// alias: alias\n// });\n// }\nfunction addToObjectProps(target, key, value) {\n // it's an attribute on the class\n var props = getOrCreateProps(target, getFunctionName(target.constructor));\n if (!props[key]) {\n props[key] = [];\n }\n props[key].push(value);\n}\nfunction getOrCreateProps(target, instanceName) {\n if (!target.__agComponentMetaData) {\n target.__agComponentMetaData = {};\n }\n if (!target.__agComponentMetaData[instanceName]) {\n target.__agComponentMetaData[instanceName] = {};\n }\n return target.__agComponentMetaData[instanceName];\n}\n\nvar __extends$38 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2B = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n// optional floating filter for user provided filters - instead of providing a floating filter,\n// they can provide a getModelAsString() method on the filter instead. this class just displays\n// the string returned from getModelAsString()\nvar ReadOnlyFloatingFilter = /** @class */ (function (_super) {\n __extends$38(ReadOnlyFloatingFilter, _super);\n function ReadOnlyFloatingFilter() {\n return _super.call(this, /* html */ \"\\n
\\n \\n
\") || this;\n }\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n ReadOnlyFloatingFilter.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n ReadOnlyFloatingFilter.prototype.init = function (params) {\n this.params = params;\n var displayName = this.columnModel.getDisplayNameForColumn(params.column, 'header', true);\n var translate = this.localeService.getLocaleTextFunc();\n this.eFloatingFilterText\n .setDisabled(true)\n .setInputAriaLabel(\"\".concat(displayName, \" \").concat(translate('ariaFilterInput', 'Filter Input')));\n };\n ReadOnlyFloatingFilter.prototype.onParentModelChanged = function (parentModel) {\n var _this = this;\n if (parentModel == null) {\n this.eFloatingFilterText.setValue('');\n return;\n }\n this.params.parentFilterInstance(function (filterInstance) {\n // it would be nice to check if getModelAsString was present before creating this component,\n // however that is not possible, as React Hooks and VueJS don't attached the methods to the Filter until\n // AFTER the filter is created, not allowing inspection before this (we create floating filters as columns\n // are drawn, but the parent filters are only created when needed).\n if (filterInstance.getModelAsString) {\n var modelAsString = filterInstance.getModelAsString(parentModel);\n _this.eFloatingFilterText.setValue(modelAsString);\n }\n });\n };\n ReadOnlyFloatingFilter.prototype.onParamsUpdated = function (params) {\n this.refresh(params);\n };\n ReadOnlyFloatingFilter.prototype.refresh = function (params) {\n this.init(params);\n };\n __decorate$2B([\n RefSelector('eFloatingFilterText')\n ], ReadOnlyFloatingFilter.prototype, \"eFloatingFilterText\", void 0);\n __decorate$2B([\n Autowired('columnModel')\n ], ReadOnlyFloatingFilter.prototype, \"columnModel\", void 0);\n return ReadOnlyFloatingFilter;\n}(Component));\n\n/** Provides sync access to async component. Date component can be lazy created - this class encapsulates\n * this by keeping value locally until DateComp has loaded, then passing DateComp the value. */\nvar DateCompWrapper = /** @class */ (function () {\n function DateCompWrapper(context, userComponentFactory, dateComponentParams, eParent) {\n var _this = this;\n this.alive = true;\n this.context = context;\n this.eParent = eParent;\n var compDetails = userComponentFactory.getDateCompDetails(dateComponentParams);\n var promise = compDetails.newAgStackInstance();\n promise.then(function (dateComp) {\n // because async, check the filter still exists after component comes back\n if (!_this.alive) {\n context.destroyBean(dateComp);\n return;\n }\n _this.dateComp = dateComp;\n if (!dateComp) {\n return;\n }\n eParent.appendChild(dateComp.getGui());\n if (dateComp.afterGuiAttached) {\n dateComp.afterGuiAttached();\n }\n if (_this.tempValue) {\n dateComp.setDate(_this.tempValue);\n }\n if (_this.disabled != null) {\n _this.setDateCompDisabled(_this.disabled);\n }\n });\n }\n DateCompWrapper.prototype.destroy = function () {\n this.alive = false;\n this.dateComp = this.context.destroyBean(this.dateComp);\n };\n DateCompWrapper.prototype.getDate = function () {\n return this.dateComp ? this.dateComp.getDate() : this.tempValue;\n };\n DateCompWrapper.prototype.setDate = function (value) {\n if (this.dateComp) {\n this.dateComp.setDate(value);\n }\n else {\n this.tempValue = value;\n }\n };\n DateCompWrapper.prototype.setDisabled = function (disabled) {\n if (this.dateComp) {\n this.setDateCompDisabled(disabled);\n }\n else {\n this.disabled = disabled;\n }\n };\n DateCompWrapper.prototype.setDisplayed = function (displayed) {\n setDisplayed(this.eParent, displayed);\n };\n DateCompWrapper.prototype.setInputPlaceholder = function (placeholder) {\n if (this.dateComp && this.dateComp.setInputPlaceholder) {\n this.dateComp.setInputPlaceholder(placeholder);\n }\n };\n DateCompWrapper.prototype.setInputAriaLabel = function (label) {\n if (this.dateComp && this.dateComp.setInputAriaLabel) {\n this.dateComp.setInputAriaLabel(label);\n }\n };\n DateCompWrapper.prototype.afterGuiAttached = function (params) {\n if (this.dateComp && typeof this.dateComp.afterGuiAttached === 'function') {\n this.dateComp.afterGuiAttached(params);\n }\n };\n DateCompWrapper.prototype.updateParams = function (params) {\n var _a, _b;\n var hasRefreshed = false;\n if (((_a = this.dateComp) === null || _a === void 0 ? void 0 : _a.refresh) && typeof this.dateComp.refresh === 'function') {\n var result = this.dateComp.refresh(params);\n // framework wrapper always implements optional methods, but returns null if no underlying method\n if (result !== null) {\n hasRefreshed = true;\n }\n }\n if (!hasRefreshed && ((_b = this.dateComp) === null || _b === void 0 ? void 0 : _b.onParamsUpdated) && typeof this.dateComp.onParamsUpdated === 'function') {\n var result = this.dateComp.onParamsUpdated(params);\n if (result !== null) {\n warnOnce(\"Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.\");\n }\n }\n };\n DateCompWrapper.prototype.setDateCompDisabled = function (disabled) {\n if (this.dateComp == null) {\n return;\n }\n if (this.dateComp.setDisabled == null) {\n return;\n }\n this.dateComp.setDisabled(disabled);\n };\n return DateCompWrapper;\n}());\n\n/* Common logic for options, used by both filters and floating filters. */\nvar OptionsFactory = /** @class */ (function () {\n function OptionsFactory() {\n this.customFilterOptions = {};\n }\n OptionsFactory.prototype.init = function (params, defaultOptions) {\n this.filterOptions = params.filterOptions || defaultOptions;\n this.mapCustomOptions();\n this.selectDefaultItem(params);\n };\n OptionsFactory.prototype.getFilterOptions = function () {\n return this.filterOptions;\n };\n OptionsFactory.prototype.mapCustomOptions = function () {\n var _this = this;\n if (!this.filterOptions) {\n return;\n }\n this.filterOptions.forEach(function (filterOption) {\n if (typeof filterOption === 'string') {\n return;\n }\n var requiredProperties = [['displayKey'], ['displayName'], ['predicate', 'test']];\n var propertyCheck = function (keys) {\n if (!keys.some(function (key) { return filterOption[key] != null; })) {\n console.warn(\"AG Grid: ignoring FilterOptionDef as it doesn't contain one of '\".concat(keys, \"'\"));\n return false;\n }\n return true;\n };\n if (!requiredProperties.every(propertyCheck)) {\n _this.filterOptions = _this.filterOptions.filter(function (v) { return v === filterOption; }) || [];\n return;\n }\n _this.customFilterOptions[filterOption.displayKey] = filterOption;\n });\n };\n OptionsFactory.prototype.selectDefaultItem = function (params) {\n if (params.defaultOption) {\n this.defaultOption = params.defaultOption;\n }\n else if (this.filterOptions.length >= 1) {\n var firstFilterOption = this.filterOptions[0];\n if (typeof firstFilterOption === 'string') {\n this.defaultOption = firstFilterOption;\n }\n else if (firstFilterOption.displayKey) {\n this.defaultOption = firstFilterOption.displayKey;\n }\n else {\n console.warn(\"AG Grid: invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'\");\n }\n }\n else {\n console.warn('AG Grid: no filter options for filter');\n }\n };\n OptionsFactory.prototype.getDefaultOption = function () {\n return this.defaultOption;\n };\n OptionsFactory.prototype.getCustomOption = function (name) {\n return this.customFilterOptions[name];\n };\n return OptionsFactory;\n}());\n\nvar FILTER_LOCALE_TEXT = {\n applyFilter: 'Apply',\n clearFilter: 'Clear',\n resetFilter: 'Reset',\n cancelFilter: 'Cancel',\n textFilter: 'Text Filter',\n numberFilter: 'Number Filter',\n dateFilter: 'Date Filter',\n setFilter: 'Set Filter',\n filterOoo: 'Filter...',\n empty: 'Choose one',\n equals: 'Equals',\n notEqual: 'Does not equal',\n lessThan: 'Less than',\n greaterThan: 'Greater than',\n inRange: 'Between',\n inRangeStart: 'From',\n inRangeEnd: 'To',\n lessThanOrEqual: 'Less than or equal to',\n greaterThanOrEqual: 'Greater than or equal to',\n contains: 'Contains',\n notContains: 'Does not contain',\n startsWith: 'Begins with',\n endsWith: 'Ends with',\n blank: 'Blank',\n notBlank: 'Not blank',\n before: 'Before',\n after: 'After',\n andCondition: 'AND',\n orCondition: 'OR',\n dateFormatOoo: 'yyyy-mm-dd',\n};\n\nvar __extends$37 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$n = ( false) || function () {\n __assign$n = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$n.apply(this, arguments);\n};\nvar __decorate$2A = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ManagedFocusFeature = /** @class */ (function (_super) {\n __extends$37(ManagedFocusFeature, _super);\n function ManagedFocusFeature(eFocusableElement, callbacks) {\n if (callbacks === void 0) { callbacks = {}; }\n var _this = _super.call(this) || this;\n _this.eFocusableElement = eFocusableElement;\n _this.callbacks = callbacks;\n _this.callbacks = __assign$n({ shouldStopEventPropagation: function () { return false; }, onTabKeyDown: function (e) {\n if (e.defaultPrevented) {\n return;\n }\n var nextRoot = _this.focusService.findNextFocusableElement(_this.eFocusableElement, false, e.shiftKey);\n if (!nextRoot) {\n return;\n }\n nextRoot.focus();\n e.preventDefault();\n } }, callbacks);\n return _this;\n }\n ManagedFocusFeature.prototype.postConstruct = function () {\n this.eFocusableElement.classList.add(ManagedFocusFeature.FOCUS_MANAGED_CLASS);\n this.addKeyDownListeners(this.eFocusableElement);\n if (this.callbacks.onFocusIn) {\n this.addManagedListener(this.eFocusableElement, 'focusin', this.callbacks.onFocusIn);\n }\n if (this.callbacks.onFocusOut) {\n this.addManagedListener(this.eFocusableElement, 'focusout', this.callbacks.onFocusOut);\n }\n };\n ManagedFocusFeature.prototype.addKeyDownListeners = function (eGui) {\n var _this = this;\n this.addManagedListener(eGui, 'keydown', function (e) {\n if (e.defaultPrevented || isStopPropagationForAgGrid(e)) {\n return;\n }\n if (_this.callbacks.shouldStopEventPropagation(e)) {\n stopPropagationForAgGrid(e);\n return;\n }\n if (e.key === KeyCode.TAB) {\n _this.callbacks.onTabKeyDown(e);\n }\n else if (_this.callbacks.handleKeyDown) {\n _this.callbacks.handleKeyDown(e);\n }\n });\n };\n ManagedFocusFeature.FOCUS_MANAGED_CLASS = 'ag-focus-managed';\n __decorate$2A([\n Autowired('focusService')\n ], ManagedFocusFeature.prototype, \"focusService\", void 0);\n __decorate$2A([\n PostConstruct\n ], ManagedFocusFeature.prototype, \"postConstruct\", null);\n return ManagedFocusFeature;\n}(BeanStub));\n\nvar __extends$36 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2z = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar RESIZE_CONTAINER_STYLE = 'ag-resizer-wrapper';\nvar RESIZE_TEMPLATE = /* html */ \"
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\");\nvar PositionableFeature = /** @class */ (function (_super) {\n __extends$36(PositionableFeature, _super);\n function PositionableFeature(element, config) {\n var _this = _super.call(this) || this;\n _this.element = element;\n _this.dragStartPosition = {\n x: 0,\n y: 0\n };\n _this.position = {\n x: 0,\n y: 0\n };\n _this.lastSize = {\n width: -1,\n height: -1\n };\n _this.positioned = false;\n _this.resizersAdded = false;\n _this.resizeListeners = [];\n _this.boundaryEl = null;\n _this.isResizing = false;\n _this.isMoving = false;\n _this.resizable = {};\n _this.movable = false;\n _this.currentResizer = null;\n _this.config = Object.assign({}, { popup: false }, config);\n return _this;\n }\n PositionableFeature.prototype.center = function () {\n var _a = this.offsetParent, clientHeight = _a.clientHeight, clientWidth = _a.clientWidth;\n var x = (clientWidth / 2) - (this.getWidth() / 2);\n var y = (clientHeight / 2) - (this.getHeight() / 2);\n this.offsetElement(x, y);\n };\n PositionableFeature.prototype.initialisePosition = function () {\n if (this.positioned) {\n return;\n }\n var _a = this.config, centered = _a.centered, forcePopupParentAsOffsetParent = _a.forcePopupParentAsOffsetParent, minWidth = _a.minWidth, width = _a.width, minHeight = _a.minHeight, height = _a.height, x = _a.x, y = _a.y;\n if (!this.offsetParent) {\n this.setOffsetParent();\n }\n var computedMinHeight = 0;\n var computedMinWidth = 0;\n // here we don't use the main offset parent but the element's offsetParent\n // in order to calculated the minWidth and minHeight correctly\n var isElementVisible = isVisible(this.element);\n if (isElementVisible) {\n var boundaryEl = this.findBoundaryElement();\n var offsetParentComputedStyles = window.getComputedStyle(boundaryEl);\n if (offsetParentComputedStyles.minWidth != null) {\n var paddingWidth = boundaryEl.offsetWidth - this.element.offsetWidth;\n computedMinWidth = parseInt(offsetParentComputedStyles.minWidth, 10) - paddingWidth;\n }\n if (offsetParentComputedStyles.minHeight != null) {\n var paddingHeight = boundaryEl.offsetHeight - this.element.offsetHeight;\n computedMinHeight = parseInt(offsetParentComputedStyles.minHeight, 10) - paddingHeight;\n }\n }\n this.minHeight = minHeight || computedMinHeight;\n this.minWidth = minWidth || computedMinWidth;\n if (width) {\n this.setWidth(width);\n }\n if (height) {\n this.setHeight(height);\n }\n if (!width || !height) {\n this.refreshSize();\n }\n if (centered) {\n this.center();\n }\n else if (x || y) {\n this.offsetElement(x, y);\n }\n else if (isElementVisible && forcePopupParentAsOffsetParent) {\n var boundaryEl = this.boundaryEl;\n var initialisedDuringPositioning = true;\n if (!boundaryEl) {\n boundaryEl = this.findBoundaryElement();\n initialisedDuringPositioning = false;\n }\n if (boundaryEl) {\n var top_1 = parseFloat(boundaryEl.style.top);\n var left = parseFloat(boundaryEl.style.left);\n if (initialisedDuringPositioning) {\n this.offsetElement(isNaN(left) ? 0 : left, isNaN(top_1) ? 0 : top_1);\n }\n else {\n this.setPosition(left, top_1);\n }\n }\n }\n this.positioned = !!this.offsetParent;\n };\n PositionableFeature.prototype.isPositioned = function () {\n return this.positioned;\n };\n PositionableFeature.prototype.getPosition = function () {\n return this.position;\n };\n PositionableFeature.prototype.setMovable = function (movable, moveElement) {\n if (!this.config.popup || movable === this.movable) {\n return;\n }\n this.movable = movable;\n var params = this.moveElementDragListener || {\n eElement: moveElement,\n onDragStart: this.onMoveStart.bind(this),\n onDragging: this.onMove.bind(this),\n onDragStop: this.onMoveEnd.bind(this)\n };\n if (movable) {\n this.dragService.addDragSource(params);\n this.moveElementDragListener = params;\n }\n else {\n this.dragService.removeDragSource(params);\n this.moveElementDragListener = undefined;\n }\n };\n PositionableFeature.prototype.setResizable = function (resizable) {\n var _this = this;\n this.clearResizeListeners();\n if (resizable) {\n this.addResizers();\n }\n else {\n this.removeResizers();\n }\n if (typeof resizable === 'boolean') {\n if (resizable === false) {\n return;\n }\n resizable = {\n topLeft: resizable,\n top: resizable,\n topRight: resizable,\n right: resizable,\n bottomRight: resizable,\n bottom: resizable,\n bottomLeft: resizable,\n left: resizable\n };\n }\n Object.keys(resizable).forEach(function (side) {\n var resizableStructure = resizable;\n var isSideResizable = !!resizableStructure[side];\n var resizerEl = _this.getResizerElement(side);\n var params = {\n dragStartPixels: 0,\n eElement: resizerEl,\n onDragStart: function (e) { return _this.onResizeStart(e, side); },\n onDragging: _this.onResize.bind(_this),\n onDragStop: function (e) { return _this.onResizeEnd(e, side); },\n };\n if (isSideResizable || (!_this.isAlive() && !isSideResizable)) {\n if (isSideResizable) {\n _this.dragService.addDragSource(params);\n _this.resizeListeners.push(params);\n resizerEl.style.pointerEvents = 'all';\n }\n else {\n resizerEl.style.pointerEvents = 'none';\n }\n _this.resizable[side] = isSideResizable;\n }\n });\n };\n PositionableFeature.prototype.removeSizeFromEl = function () {\n this.element.style.removeProperty('height');\n this.element.style.removeProperty('width');\n this.element.style.removeProperty('flex');\n };\n PositionableFeature.prototype.restoreLastSize = function () {\n this.element.style.flex = '0 0 auto';\n var _a = this.lastSize, height = _a.height, width = _a.width;\n if (width !== -1) {\n this.element.style.width = \"\".concat(width, \"px\");\n }\n if (height !== -1) {\n this.element.style.height = \"\".concat(height, \"px\");\n }\n };\n PositionableFeature.prototype.getHeight = function () {\n return this.element.offsetHeight;\n };\n PositionableFeature.prototype.setHeight = function (height) {\n var popup = this.config.popup;\n var eGui = this.element;\n var isPercent = false;\n if (typeof height === 'string' && height.indexOf('%') !== -1) {\n setFixedHeight(eGui, height);\n height = getAbsoluteHeight(eGui);\n isPercent = true;\n }\n else {\n height = Math.max(this.minHeight, height);\n if (this.positioned) {\n var availableHeight = this.getAvailableHeight();\n if (availableHeight && height > availableHeight) {\n height = availableHeight;\n }\n }\n }\n if (this.getHeight() === height) {\n return;\n }\n if (!isPercent) {\n if (popup) {\n setFixedHeight(eGui, height);\n }\n else {\n eGui.style.height = \"\".concat(height, \"px\");\n eGui.style.flex = '0 0 auto';\n this.lastSize.height = typeof height === 'number' ? height : parseFloat(height);\n }\n }\n else {\n eGui.style.maxHeight = 'unset';\n eGui.style.minHeight = 'unset';\n }\n };\n PositionableFeature.prototype.getAvailableHeight = function () {\n var _a = this.config, popup = _a.popup, forcePopupParentAsOffsetParent = _a.forcePopupParentAsOffsetParent;\n if (!this.positioned) {\n this.initialisePosition();\n }\n var clientHeight = this.offsetParent.clientHeight;\n if (!clientHeight) {\n return null;\n }\n var elRect = this.element.getBoundingClientRect();\n var offsetParentRect = this.offsetParent.getBoundingClientRect();\n var yPosition = popup ? this.position.y : elRect.top;\n var parentTop = popup ? 0 : offsetParentRect.top;\n // When `forcePopupParentAsOffsetParent`, there may be elements that appear after the resizable element, but aren't included in the height.\n // Take these into account here\n var additionalHeight = 0;\n if (forcePopupParentAsOffsetParent) {\n var parentEl = this.element.parentElement;\n if (parentEl) {\n var bottom = parentEl.getBoundingClientRect().bottom;\n additionalHeight = bottom - elRect.bottom;\n }\n }\n var availableHeight = clientHeight + parentTop - yPosition - additionalHeight;\n return availableHeight;\n };\n PositionableFeature.prototype.getWidth = function () {\n return this.element.offsetWidth;\n };\n PositionableFeature.prototype.setWidth = function (width) {\n var eGui = this.element;\n var popup = this.config.popup;\n var isPercent = false;\n if (typeof width === 'string' && width.indexOf('%') !== -1) {\n setFixedWidth(eGui, width);\n width = getAbsoluteWidth(eGui);\n isPercent = true;\n }\n else if (this.positioned) {\n width = Math.max(this.minWidth, width);\n var clientWidth = this.offsetParent.clientWidth;\n var xPosition = popup ? this.position.x : this.element.getBoundingClientRect().left;\n if (clientWidth && (width + xPosition > clientWidth)) {\n width = clientWidth - xPosition;\n }\n }\n if (this.getWidth() === width) {\n return;\n }\n if (!isPercent) {\n if (this.config.popup) {\n setFixedWidth(eGui, width);\n }\n else {\n eGui.style.width = \"\".concat(width, \"px\");\n eGui.style.flex = ' unset';\n this.lastSize.width = typeof width === 'number' ? width : parseFloat(width);\n }\n }\n else {\n eGui.style.maxWidth = 'unset';\n eGui.style.minWidth = 'unset';\n }\n };\n PositionableFeature.prototype.offsetElement = function (x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n var forcePopupParentAsOffsetParent = this.config.forcePopupParentAsOffsetParent;\n var ePopup = forcePopupParentAsOffsetParent ? this.boundaryEl : this.element;\n if (!ePopup) {\n return;\n }\n this.popupService.positionPopup({\n ePopup: ePopup,\n keepWithinBounds: true,\n skipObserver: this.movable || this.isResizable(),\n updatePosition: function () { return ({ x: x, y: y }); }\n });\n this.setPosition(parseFloat(ePopup.style.left), parseFloat(ePopup.style.top));\n };\n PositionableFeature.prototype.constrainSizeToAvailableHeight = function (constrain) {\n var _this = this;\n if (!this.config.forcePopupParentAsOffsetParent) {\n return;\n }\n var applyMaxHeightToElement = function () {\n var availableHeight = _this.getAvailableHeight();\n _this.element.style.setProperty('max-height', \"\".concat(availableHeight, \"px\"));\n };\n if (constrain) {\n this.resizeObserverSubscriber = this.resizeObserverService.observeResize(this.popupService.getPopupParent(), applyMaxHeightToElement);\n }\n else {\n this.element.style.removeProperty('max-height');\n if (this.resizeObserverSubscriber) {\n this.resizeObserverSubscriber();\n this.resizeObserverSubscriber = undefined;\n }\n }\n };\n PositionableFeature.prototype.setPosition = function (x, y) {\n this.position.x = x;\n this.position.y = y;\n };\n PositionableFeature.prototype.updateDragStartPosition = function (x, y) {\n this.dragStartPosition = { x: x, y: y };\n };\n PositionableFeature.prototype.calculateMouseMovement = function (params) {\n var e = params.e, isLeft = params.isLeft, isTop = params.isTop, anywhereWithin = params.anywhereWithin, topBuffer = params.topBuffer;\n var xDiff = e.clientX - this.dragStartPosition.x;\n var yDiff = e.clientY - this.dragStartPosition.y;\n var movementX = this.shouldSkipX(e, !!isLeft, !!anywhereWithin, xDiff) ? 0 : xDiff;\n var movementY = this.shouldSkipY(e, !!isTop, topBuffer, yDiff) ? 0 : yDiff;\n return { movementX: movementX, movementY: movementY };\n };\n PositionableFeature.prototype.shouldSkipX = function (e, isLeft, anywhereWithin, diff) {\n var elRect = this.element.getBoundingClientRect();\n var parentRect = this.offsetParent.getBoundingClientRect();\n var boundaryElRect = this.boundaryEl.getBoundingClientRect();\n var xPosition = this.config.popup ? this.position.x : elRect.left;\n // skip if cursor is outside of popupParent horizontally\n var skipX = ((xPosition <= 0 && parentRect.left >= e.clientX) ||\n (parentRect.right <= e.clientX && parentRect.right <= boundaryElRect.right));\n if (skipX) {\n return true;\n }\n if (isLeft) {\n skipX = (\n // skip if we are moving to the left and the cursor\n // is positioned to the right of the left side anchor\n (diff < 0 && e.clientX > xPosition + parentRect.left) ||\n // skip if we are moving to the right and the cursor\n // is positioned to the left of the dialog\n (diff > 0 && e.clientX < xPosition + parentRect.left));\n }\n else {\n if (anywhereWithin) {\n // if anywhereWithin is true, we allow to move\n // as long as the cursor is within the dialog\n skipX = ((diff < 0 && e.clientX > boundaryElRect.right) ||\n (diff > 0 && e.clientX < xPosition + parentRect.left));\n }\n else {\n skipX = (\n // if the movement is bound to the right side of the dialog\n // we skip if we are moving to the left and the cursor\n // is to the right of the dialog\n (diff < 0 && e.clientX > boundaryElRect.right) ||\n // or skip if we are moving to the right and the cursor\n // is to the left of the right side anchor\n (diff > 0 && e.clientX < boundaryElRect.right));\n }\n }\n return skipX;\n };\n PositionableFeature.prototype.shouldSkipY = function (e, isTop, topBuffer, diff) {\n if (topBuffer === void 0) { topBuffer = 0; }\n var elRect = this.element.getBoundingClientRect();\n var parentRect = this.offsetParent.getBoundingClientRect();\n var boundaryElRect = this.boundaryEl.getBoundingClientRect();\n var yPosition = this.config.popup ? this.position.y : elRect.top;\n // skip if cursor is outside of popupParent vertically\n var skipY = ((yPosition <= 0 && parentRect.top >= e.clientY) ||\n (parentRect.bottom <= e.clientY && parentRect.bottom <= boundaryElRect.bottom));\n if (skipY) {\n return true;\n }\n if (isTop) {\n skipY = (\n // skip if we are moving to towards top and the cursor is\n // below the top anchor + topBuffer\n // note: topBuffer is used when moving the dialog using the title bar\n (diff < 0 && e.clientY > yPosition + parentRect.top + topBuffer) ||\n // skip if we are moving to the bottom and the cursor is\n // above the top anchor\n (diff > 0 && e.clientY < yPosition + parentRect.top));\n }\n else {\n skipY = (\n // skip if we are moving towards the top and the cursor\n // is below the bottom anchor\n (diff < 0 && e.clientY > boundaryElRect.bottom) ||\n // skip if we are moving towards the bottom and the cursor\n // is above the bottom anchor\n (diff > 0 && e.clientY < boundaryElRect.bottom));\n }\n return skipY;\n };\n PositionableFeature.prototype.createResizeMap = function () {\n var eGui = this.element;\n this.resizerMap = {\n topLeft: { element: eGui.querySelector('[ref=eTopLeftResizer]') },\n top: { element: eGui.querySelector('[ref=eTopResizer]') },\n topRight: { element: eGui.querySelector('[ref=eTopRightResizer]') },\n right: { element: eGui.querySelector('[ref=eRightResizer]') },\n bottomRight: { element: eGui.querySelector('[ref=eBottomRightResizer]') },\n bottom: { element: eGui.querySelector('[ref=eBottomResizer]') },\n bottomLeft: { element: eGui.querySelector('[ref=eBottomLeftResizer]') },\n left: { element: eGui.querySelector('[ref=eLeftResizer]') }\n };\n };\n PositionableFeature.prototype.addResizers = function () {\n if (this.resizersAdded) {\n return;\n }\n var eGui = this.element;\n if (!eGui) {\n return;\n }\n var parser = new DOMParser();\n var resizers = parser.parseFromString(RESIZE_TEMPLATE, 'text/html').body;\n eGui.appendChild(resizers.firstChild);\n this.createResizeMap();\n this.resizersAdded = true;\n };\n PositionableFeature.prototype.removeResizers = function () {\n this.resizerMap = undefined;\n var resizerEl = this.element.querySelector(\".\".concat(RESIZE_CONTAINER_STYLE));\n if (resizerEl) {\n this.element.removeChild(resizerEl);\n }\n this.resizersAdded = false;\n };\n PositionableFeature.prototype.getResizerElement = function (side) {\n return this.resizerMap[side].element;\n };\n PositionableFeature.prototype.onResizeStart = function (e, side) {\n this.boundaryEl = this.findBoundaryElement();\n if (!this.positioned) {\n this.initialisePosition();\n }\n this.currentResizer = {\n isTop: !!side.match(/top/i),\n isRight: !!side.match(/right/i),\n isBottom: !!side.match(/bottom/i),\n isLeft: !!side.match(/left/i),\n };\n this.element.classList.add('ag-resizing');\n this.resizerMap[side].element.classList.add('ag-active');\n var _a = this.config, popup = _a.popup, forcePopupParentAsOffsetParent = _a.forcePopupParentAsOffsetParent;\n if (!popup && !forcePopupParentAsOffsetParent) {\n this.applySizeToSiblings(this.currentResizer.isBottom || this.currentResizer.isTop);\n }\n this.isResizing = true;\n this.updateDragStartPosition(e.clientX, e.clientY);\n };\n PositionableFeature.prototype.getSiblings = function () {\n var element = this.element;\n var parent = element.parentElement;\n if (!parent) {\n return null;\n }\n return Array.prototype.slice.call(parent.children).filter(function (el) { return !el.classList.contains('ag-hidden'); });\n };\n PositionableFeature.prototype.getMinSizeOfSiblings = function () {\n var siblings = this.getSiblings() || [];\n var height = 0;\n var width = 0;\n for (var i = 0; i < siblings.length; i++) {\n var currentEl = siblings[i];\n var isFlex = !!currentEl.style.flex && currentEl.style.flex !== '0 0 auto';\n if (currentEl === this.element) {\n continue;\n }\n var nextHeight = this.minHeight || 0;\n var nextWidth = this.minWidth || 0;\n if (isFlex) {\n var computedStyle = window.getComputedStyle(currentEl);\n if (computedStyle.minHeight) {\n nextHeight = parseInt(computedStyle.minHeight, 10);\n }\n if (computedStyle.minWidth) {\n nextWidth = parseInt(computedStyle.minWidth, 10);\n }\n }\n else {\n nextHeight = currentEl.offsetHeight;\n nextWidth = currentEl.offsetWidth;\n }\n height += nextHeight;\n width += nextWidth;\n }\n return { height: height, width: width };\n };\n PositionableFeature.prototype.applySizeToSiblings = function (vertical) {\n var containerToFlex = null;\n var siblings = this.getSiblings();\n if (!siblings) {\n return;\n }\n for (var i = 0; i < siblings.length; i++) {\n var el = siblings[i];\n if (el === containerToFlex) {\n continue;\n }\n if (vertical) {\n el.style.height = \"\".concat(el.offsetHeight, \"px\");\n }\n else {\n el.style.width = \"\".concat(el.offsetWidth, \"px\");\n }\n el.style.flex = '0 0 auto';\n if (el === this.element) {\n containerToFlex = siblings[i + 1];\n }\n }\n if (containerToFlex) {\n containerToFlex.style.removeProperty('height');\n containerToFlex.style.removeProperty('min-height');\n containerToFlex.style.removeProperty('max-height');\n containerToFlex.style.flex = '1 1 auto';\n }\n };\n PositionableFeature.prototype.isResizable = function () {\n return Object.values(this.resizable).some(function (value) { return value; });\n };\n PositionableFeature.prototype.onResize = function (e) {\n if (!this.isResizing || !this.currentResizer) {\n return;\n }\n var _a = this.config, popup = _a.popup, forcePopupParentAsOffsetParent = _a.forcePopupParentAsOffsetParent;\n var _b = this.currentResizer, isTop = _b.isTop, isRight = _b.isRight, isBottom = _b.isBottom, isLeft = _b.isLeft;\n var isHorizontal = isRight || isLeft;\n var isVertical = isBottom || isTop;\n var _c = this.calculateMouseMovement({ e: e, isLeft: isLeft, isTop: isTop }), movementX = _c.movementX, movementY = _c.movementY;\n var xPosition = this.position.x;\n var yPosition = this.position.y;\n var offsetLeft = 0;\n var offsetTop = 0;\n if (isHorizontal && movementX) {\n var direction = isLeft ? -1 : 1;\n var oldWidth = this.getWidth();\n var newWidth = oldWidth + (movementX * direction);\n var skipWidth = false;\n if (isLeft) {\n offsetLeft = oldWidth - newWidth;\n if (xPosition + offsetLeft <= 0 || newWidth <= this.minWidth) {\n skipWidth = true;\n offsetLeft = 0;\n }\n }\n if (!skipWidth) {\n this.setWidth(newWidth);\n }\n }\n if (isVertical && movementY) {\n var direction = isTop ? -1 : 1;\n var oldHeight = this.getHeight();\n var newHeight = oldHeight + (movementY * direction);\n var skipHeight = false;\n if (isTop) {\n offsetTop = oldHeight - newHeight;\n if (yPosition + offsetTop <= 0 || newHeight <= this.minHeight) {\n skipHeight = true;\n offsetTop = 0;\n }\n }\n else {\n // do not let the size of all siblings be higher than the parent container\n if (!this.config.popup &&\n !this.config.forcePopupParentAsOffsetParent &&\n oldHeight < newHeight &&\n (this.getMinSizeOfSiblings().height + newHeight) > this.element.parentElement.offsetHeight) {\n skipHeight = true;\n }\n }\n if (!skipHeight) {\n this.setHeight(newHeight);\n }\n }\n this.updateDragStartPosition(e.clientX, e.clientY);\n if ((popup || forcePopupParentAsOffsetParent) && offsetLeft || offsetTop) {\n this.offsetElement(xPosition + offsetLeft, yPosition + offsetTop);\n }\n };\n PositionableFeature.prototype.onResizeEnd = function (e, side) {\n this.isResizing = false;\n this.currentResizer = null;\n this.boundaryEl = null;\n var params = {\n type: 'resize'\n };\n this.element.classList.remove('ag-resizing');\n this.resizerMap[side].element.classList.remove('ag-active');\n this.dispatchEvent(params);\n };\n PositionableFeature.prototype.refreshSize = function () {\n var eGui = this.element;\n if (this.config.popup) {\n if (!this.config.width) {\n this.setWidth(eGui.offsetWidth);\n }\n if (!this.config.height) {\n this.setHeight(eGui.offsetHeight);\n }\n }\n };\n PositionableFeature.prototype.onMoveStart = function (e) {\n this.boundaryEl = this.findBoundaryElement();\n if (!this.positioned) {\n this.initialisePosition();\n }\n this.isMoving = true;\n this.element.classList.add('ag-moving');\n this.updateDragStartPosition(e.clientX, e.clientY);\n };\n PositionableFeature.prototype.onMove = function (e) {\n if (!this.isMoving) {\n return;\n }\n var _a = this.position, x = _a.x, y = _a.y;\n var topBuffer;\n if (this.config.calculateTopBuffer) {\n topBuffer = this.config.calculateTopBuffer();\n }\n var _b = this.calculateMouseMovement({\n e: e,\n isTop: true,\n anywhereWithin: true,\n topBuffer: topBuffer\n }), movementX = _b.movementX, movementY = _b.movementY;\n this.offsetElement(x + movementX, y + movementY);\n this.updateDragStartPosition(e.clientX, e.clientY);\n };\n PositionableFeature.prototype.onMoveEnd = function () {\n this.isMoving = false;\n this.boundaryEl = null;\n this.element.classList.remove('ag-moving');\n };\n PositionableFeature.prototype.setOffsetParent = function () {\n if (this.config.forcePopupParentAsOffsetParent) {\n this.offsetParent = this.popupService.getPopupParent();\n }\n else {\n this.offsetParent = this.element.offsetParent;\n }\n };\n PositionableFeature.prototype.findBoundaryElement = function () {\n var el = this.element;\n while (el) {\n if (window.getComputedStyle(el).position !== 'static') {\n return el;\n }\n el = el.parentElement;\n }\n return this.element;\n };\n PositionableFeature.prototype.clearResizeListeners = function () {\n while (this.resizeListeners.length) {\n var params = this.resizeListeners.pop();\n this.dragService.removeDragSource(params);\n }\n };\n PositionableFeature.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n if (this.moveElementDragListener) {\n this.dragService.removeDragSource(this.moveElementDragListener);\n }\n this.constrainSizeToAvailableHeight(false);\n this.clearResizeListeners();\n this.removeResizers();\n };\n __decorate$2z([\n Autowired('popupService')\n ], PositionableFeature.prototype, \"popupService\", void 0);\n __decorate$2z([\n Autowired('resizeObserverService')\n ], PositionableFeature.prototype, \"resizeObserverService\", void 0);\n __decorate$2z([\n Autowired('dragService')\n ], PositionableFeature.prototype, \"dragService\", void 0);\n return PositionableFeature;\n}(BeanStub));\n\nvar __extends$35 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2y = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n/**\n * Contains common logic to all provided filters (apply button, clear button, etc).\n * All the filters that come with AG Grid extend this class. User filters do not\n * extend this class.\n *\n * @param M type of filter-model managed by the concrete sub-class that extends this type\n * @param V type of value managed by the concrete sub-class that extends this type\n */\nvar ProvidedFilter = /** @class */ (function (_super) {\n __extends$35(ProvidedFilter, _super);\n function ProvidedFilter(filterNameKey) {\n var _this = _super.call(this) || this;\n _this.filterNameKey = filterNameKey;\n _this.applyActive = false;\n _this.hidePopup = null;\n _this.debouncePending = false;\n // after the user hits 'apply' the model gets copied to here. this is then the model that we use for\n // all filtering. so if user changes UI but doesn't hit apply, then the UI will be out of sync with this model.\n // this is what we want, as the UI should only become the 'active' filter once it's applied. when apply is\n // inactive, this model will be in sync (following the debounce ms). if the UI is not a valid filter\n // (eg the value is missing so nothing to filter on, or for set filter all checkboxes are checked so filter\n // not active) then this appliedModel will be null/undefined.\n _this.appliedModel = null;\n _this.buttonListeners = [];\n return _this;\n }\n ProvidedFilter.prototype.postConstruct = function () {\n this.resetTemplate(); // do this first to create the DOM\n this.createManagedBean(new ManagedFocusFeature(this.getFocusableElement(), {\n handleKeyDown: this.handleKeyDown.bind(this)\n }));\n this.positionableFeature = new PositionableFeature(this.getPositionableElement(), {\n forcePopupParentAsOffsetParent: true\n });\n this.createBean(this.positionableFeature);\n };\n // override\n ProvidedFilter.prototype.handleKeyDown = function (e) { };\n ProvidedFilter.prototype.getFilterTitle = function () {\n return this.translate(this.filterNameKey);\n };\n ProvidedFilter.prototype.isFilterActive = function () {\n // filter is active if we have a valid applied model\n return !!this.appliedModel;\n };\n ProvidedFilter.prototype.resetTemplate = function (paramsMap) {\n var eGui = this.getGui();\n if (eGui) {\n eGui.removeEventListener('submit', this.onFormSubmit);\n }\n var templateString = /* html */ \"\\n
\\n
\\n \").concat(this.createBodyTemplate(), \"\\n
\\n
\");\n this.setTemplate(templateString, paramsMap);\n eGui = this.getGui();\n if (eGui) {\n eGui.addEventListener('submit', this.onFormSubmit);\n }\n };\n ProvidedFilter.prototype.isReadOnly = function () {\n return !!this.providedFilterParams.readOnly;\n };\n ProvidedFilter.prototype.init = function (params) {\n var _this = this;\n this.setParams(params);\n this.resetUiToDefaults(true).then(function () {\n _this.updateUiVisibility();\n _this.setupOnBtApplyDebounce();\n });\n };\n ProvidedFilter.prototype.setParams = function (params) {\n this.providedFilterParams = params;\n this.applyActive = ProvidedFilter.isUseApplyButton(params);\n this.resetButtonsPanel();\n };\n ProvidedFilter.prototype.updateParams = function (params) {\n var _this = this;\n this.providedFilterParams = params;\n this.applyActive = ProvidedFilter.isUseApplyButton(params);\n this.resetUiToActiveModel(this.getModel(), function () {\n _this.updateUiVisibility();\n _this.setupOnBtApplyDebounce();\n });\n };\n ProvidedFilter.prototype.resetButtonsPanel = function () {\n var _this = this;\n var buttons = this.providedFilterParams.buttons;\n var hasButtons = buttons && buttons.length > 0 && !this.isReadOnly();\n if (!this.eButtonsPanel) {\n // Only create the buttons panel if we need to\n if (hasButtons) {\n this.eButtonsPanel = document.createElement('div');\n this.eButtonsPanel.classList.add('ag-filter-apply-panel');\n }\n }\n else {\n // Always empty the buttons panel before adding new buttons\n clearElement(this.eButtonsPanel);\n this.buttonListeners.forEach(function (destroyFunc) { return destroyFunc === null || destroyFunc === void 0 ? void 0 : destroyFunc(); });\n this.buttonListeners = [];\n }\n if (!hasButtons) {\n // The case when we need to hide the buttons panel because there are no buttons\n if (this.eButtonsPanel) {\n removeFromParent(this.eButtonsPanel);\n }\n return;\n }\n // At this point we know we have a buttons and a buttons panel has been created.\n // Instead of appending each button to the DOM individually, we create a fragment and append that\n // to the DOM once. This is much faster than appending each button individually.\n var fragment = document.createDocumentFragment();\n var addButton = function (type) {\n var text;\n var clickListener;\n switch (type) {\n case 'apply':\n text = _this.translate('applyFilter');\n clickListener = function (e) { return _this.onBtApply(false, false, e); };\n break;\n case 'clear':\n text = _this.translate('clearFilter');\n clickListener = function () { return _this.onBtClear(); };\n break;\n case 'reset':\n text = _this.translate('resetFilter');\n clickListener = function () { return _this.onBtReset(); };\n break;\n case 'cancel':\n text = _this.translate('cancelFilter');\n clickListener = function (e) { _this.onBtCancel(e); };\n break;\n default:\n console.warn('AG Grid: Unknown button type specified');\n return;\n }\n var buttonType = type === 'apply' ? 'submit' : 'button';\n var button = loadTemplate(\n /* html */\n \"\").concat(text, \"\\n \"));\n _this.buttonListeners.push(_this.addManagedListener(button, 'click', clickListener));\n fragment.append(button);\n };\n convertToSet(buttons).forEach(function (type) { return addButton(type); });\n this.eButtonsPanel.append(fragment);\n this.getGui().appendChild(this.eButtonsPanel);\n };\n // subclasses can override this to provide alternative debounce defaults\n ProvidedFilter.prototype.getDefaultDebounceMs = function () {\n return 0;\n };\n ProvidedFilter.prototype.setupOnBtApplyDebounce = function () {\n var _this = this;\n var debounceMs = ProvidedFilter.getDebounceMs(this.providedFilterParams, this.getDefaultDebounceMs());\n var debounceFunc = debounce(this.checkApplyDebounce.bind(this), debounceMs);\n this.onBtApplyDebounce = function () {\n _this.debouncePending = true;\n debounceFunc();\n };\n };\n ProvidedFilter.prototype.checkApplyDebounce = function () {\n if (this.debouncePending) {\n // May already have been applied, so don't apply again (e.g. closing filter before debounce timeout)\n this.debouncePending = false;\n this.onBtApply();\n }\n };\n ProvidedFilter.prototype.getModel = function () {\n return this.appliedModel ? this.appliedModel : null;\n };\n ProvidedFilter.prototype.setModel = function (model) {\n var _this = this;\n var promise = model != null ? this.setModelIntoUi(model) : this.resetUiToDefaults();\n return promise.then(function () {\n _this.updateUiVisibility();\n // we set the model from the GUI, rather than the provided model,\n // so the model is consistent, e.g. handling of null/undefined will be the same,\n // or if model is case-insensitive, then casing is removed.\n _this.applyModel('api');\n });\n };\n ProvidedFilter.prototype.onBtCancel = function (e) {\n var _this = this;\n this.resetUiToActiveModel(this.getModel(), function () {\n _this.handleCancelEnd(e);\n });\n };\n ProvidedFilter.prototype.handleCancelEnd = function (e) {\n if (this.providedFilterParams.closeOnApply) {\n this.close(e);\n }\n };\n ProvidedFilter.prototype.resetUiToActiveModel = function (currentModel, afterUiUpdatedFunc) {\n var _this = this;\n var afterAppliedFunc = function () {\n _this.onUiChanged(false, 'prevent');\n afterUiUpdatedFunc === null || afterUiUpdatedFunc === void 0 ? void 0 : afterUiUpdatedFunc();\n };\n if (currentModel != null) {\n this.setModelIntoUi(currentModel).then(afterAppliedFunc);\n }\n else {\n this.resetUiToDefaults().then(afterAppliedFunc);\n }\n };\n ProvidedFilter.prototype.onBtClear = function () {\n var _this = this;\n this.resetUiToDefaults().then(function () { return _this.onUiChanged(); });\n };\n ProvidedFilter.prototype.onBtReset = function () {\n this.onBtClear();\n this.onBtApply();\n };\n /**\n * Applies changes made in the UI to the filter, and returns true if the model has changed.\n */\n ProvidedFilter.prototype.applyModel = function (source) {\n var newModel = this.getModelFromUi();\n if (!this.isModelValid(newModel)) {\n return false;\n }\n var previousModel = this.appliedModel;\n this.appliedModel = newModel;\n // models can be same if user pasted same content into text field, or maybe just changed the case\n // and it's a case insensitive filter\n return !this.areModelsEqual(previousModel, newModel);\n };\n ProvidedFilter.prototype.isModelValid = function (model) {\n return true;\n };\n ProvidedFilter.prototype.onFormSubmit = function (e) {\n e.preventDefault();\n };\n ProvidedFilter.prototype.onBtApply = function (afterFloatingFilter, afterDataChange, e) {\n if (afterFloatingFilter === void 0) { afterFloatingFilter = false; }\n if (afterDataChange === void 0) { afterDataChange = false; }\n // Prevent form submission\n if (e) {\n e.preventDefault();\n }\n if (this.applyModel(afterDataChange ? 'rowDataUpdated' : 'ui')) {\n // the floating filter uses 'afterFloatingFilter' info, so it doesn't refresh after filter changed if change\n // came from floating filter\n var source = 'columnFilter';\n this.providedFilterParams.filterChangedCallback({ afterFloatingFilter: afterFloatingFilter, afterDataChange: afterDataChange, source: source });\n }\n var closeOnApply = this.providedFilterParams.closeOnApply;\n // only close if an apply button is visible, otherwise we'd be closing every time a change was made!\n if (closeOnApply && this.applyActive && !afterFloatingFilter && !afterDataChange) {\n this.close(e);\n }\n };\n ProvidedFilter.prototype.onNewRowsLoaded = function () {\n };\n ProvidedFilter.prototype.close = function (e) {\n if (!this.hidePopup) {\n return;\n }\n var keyboardEvent = e;\n var key = keyboardEvent && keyboardEvent.key;\n var params;\n if (key === 'Enter' || key === 'Space') {\n params = { keyboardEvent: keyboardEvent };\n }\n this.hidePopup(params);\n this.hidePopup = null;\n };\n /**\n * By default, if the change came from a floating filter it will be applied immediately, otherwise if there is no\n * apply button it will be applied after a debounce, otherwise it will not be applied at all. This behaviour can\n * be adjusted by using the apply parameter.\n */\n ProvidedFilter.prototype.onUiChanged = function (fromFloatingFilter, apply) {\n if (fromFloatingFilter === void 0) { fromFloatingFilter = false; }\n this.updateUiVisibility();\n this.providedFilterParams.filterModifiedCallback();\n if (this.applyActive && !this.isReadOnly()) {\n var isValid = this.isModelValid(this.getModelFromUi());\n var applyFilterButton = this.getRefElement('applyFilterButton');\n if (applyFilterButton) {\n setDisabled(applyFilterButton, !isValid);\n }\n }\n if ((fromFloatingFilter && !apply) || apply === 'immediately') {\n this.onBtApply(fromFloatingFilter);\n }\n else if ((!this.applyActive && !apply) || apply === 'debounce') {\n this.onBtApplyDebounce();\n }\n };\n ProvidedFilter.prototype.afterGuiAttached = function (params) {\n if (params) {\n this.hidePopup = params.hidePopup;\n }\n this.refreshFilterResizer(params === null || params === void 0 ? void 0 : params.container);\n };\n ProvidedFilter.prototype.refreshFilterResizer = function (containerType) {\n // tool panel is scrollable, so don't need to size\n if (!this.positionableFeature || containerType === 'toolPanel') {\n return;\n }\n var isResizable = containerType === 'floatingFilter' || containerType === 'columnFilter';\n var _a = this, positionableFeature = _a.positionableFeature, gridOptionsService = _a.gridOptionsService;\n if (isResizable) {\n positionableFeature.restoreLastSize();\n positionableFeature.setResizable(gridOptionsService.get('enableRtl')\n ? { bottom: true, bottomLeft: true, left: true }\n : { bottom: true, bottomRight: true, right: true });\n }\n else {\n this.positionableFeature.removeSizeFromEl();\n this.positionableFeature.setResizable(false);\n }\n this.positionableFeature.constrainSizeToAvailableHeight(true);\n };\n ProvidedFilter.prototype.afterGuiDetached = function () {\n this.checkApplyDebounce();\n if (this.positionableFeature) {\n this.positionableFeature.constrainSizeToAvailableHeight(false);\n }\n };\n // static, as used by floating filter also\n ProvidedFilter.getDebounceMs = function (params, debounceDefault) {\n if (ProvidedFilter.isUseApplyButton(params)) {\n if (params.debounceMs != null) {\n console.warn('AG Grid: debounceMs is ignored when apply button is present');\n }\n return 0;\n }\n return params.debounceMs != null ? params.debounceMs : debounceDefault;\n };\n // static, as used by floating filter also\n ProvidedFilter.isUseApplyButton = function (params) {\n return !!params.buttons && params.buttons.indexOf('apply') >= 0;\n };\n ProvidedFilter.prototype.refresh = function (newParams) {\n this.providedFilterParams = newParams;\n return true;\n };\n ProvidedFilter.prototype.destroy = function () {\n var eGui = this.getGui();\n if (eGui) {\n eGui.removeEventListener('submit', this.onFormSubmit);\n }\n this.hidePopup = null;\n if (this.positionableFeature) {\n this.positionableFeature = this.destroyBean(this.positionableFeature);\n }\n this.appliedModel = null;\n _super.prototype.destroy.call(this);\n };\n ProvidedFilter.prototype.translate = function (key) {\n var translate = this.localeService.getLocaleTextFunc();\n return translate(key, FILTER_LOCALE_TEXT[key]);\n };\n ProvidedFilter.prototype.getCellValue = function (rowNode) {\n return this.providedFilterParams.getValue(rowNode);\n };\n // override to control positionable feature\n ProvidedFilter.prototype.getPositionableElement = function () {\n return this.eFilterBody;\n };\n __decorate$2y([\n Autowired('rowModel')\n ], ProvidedFilter.prototype, \"rowModel\", void 0);\n __decorate$2y([\n RefSelector('eFilterBody')\n ], ProvidedFilter.prototype, \"eFilterBody\", void 0);\n __decorate$2y([\n PostConstruct\n ], ProvidedFilter.prototype, \"postConstruct\", null);\n return ProvidedFilter;\n}(Component));\n\nvar __extends$34 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2x = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AgAbstractLabel = /** @class */ (function (_super) {\n __extends$34(AgAbstractLabel, _super);\n function AgAbstractLabel(config, template) {\n var _this = _super.call(this, template) || this;\n _this.labelSeparator = '';\n _this.labelAlignment = 'left';\n _this.disabled = false;\n _this.label = '';\n _this.config = config || {};\n return _this;\n }\n AgAbstractLabel.prototype.postConstruct = function () {\n this.addCssClass('ag-labeled');\n this.eLabel.classList.add('ag-label');\n var _a = this.config, labelSeparator = _a.labelSeparator, label = _a.label, labelWidth = _a.labelWidth, labelAlignment = _a.labelAlignment;\n if (labelSeparator != null) {\n this.setLabelSeparator(labelSeparator);\n }\n if (label != null) {\n this.setLabel(label);\n }\n if (labelWidth != null) {\n this.setLabelWidth(labelWidth);\n }\n this.setLabelAlignment(labelAlignment || this.labelAlignment);\n this.refreshLabel();\n };\n AgAbstractLabel.prototype.refreshLabel = function () {\n clearElement(this.eLabel);\n if (typeof this.label === 'string') {\n this.eLabel.innerText = this.label + this.labelSeparator;\n }\n else if (this.label) {\n this.eLabel.appendChild(this.label);\n }\n if (this.label === '') {\n setDisplayed(this.eLabel, false);\n setAriaRole(this.eLabel, 'presentation');\n }\n else {\n setDisplayed(this.eLabel, true);\n setAriaRole(this.eLabel, null);\n }\n };\n AgAbstractLabel.prototype.setLabelSeparator = function (labelSeparator) {\n if (this.labelSeparator === labelSeparator) {\n return this;\n }\n this.labelSeparator = labelSeparator;\n if (this.label != null) {\n this.refreshLabel();\n }\n return this;\n };\n AgAbstractLabel.prototype.getLabelId = function () {\n this.eLabel.id = this.eLabel.id || \"ag-\".concat(this.getCompId(), \"-label\");\n return this.eLabel.id;\n };\n AgAbstractLabel.prototype.getLabel = function () {\n return this.label;\n };\n AgAbstractLabel.prototype.setLabel = function (label) {\n if (this.label === label) {\n return this;\n }\n this.label = label;\n this.refreshLabel();\n return this;\n };\n AgAbstractLabel.prototype.setLabelAlignment = function (alignment) {\n var eGui = this.getGui();\n var eGuiClassList = eGui.classList;\n eGuiClassList.toggle('ag-label-align-left', alignment === 'left');\n eGuiClassList.toggle('ag-label-align-right', alignment === 'right');\n eGuiClassList.toggle('ag-label-align-top', alignment === 'top');\n return this;\n };\n AgAbstractLabel.prototype.setLabelEllipsis = function (hasEllipsis) {\n this.eLabel.classList.toggle('ag-label-ellipsis', hasEllipsis);\n return this;\n };\n AgAbstractLabel.prototype.setLabelWidth = function (width) {\n if (this.label == null) {\n return this;\n }\n setElementWidth(this.eLabel, width);\n return this;\n };\n AgAbstractLabel.prototype.setDisabled = function (disabled) {\n disabled = !!disabled;\n var element = this.getGui();\n setDisabled(element, disabled);\n element.classList.toggle('ag-disabled', disabled);\n this.disabled = disabled;\n return this;\n };\n AgAbstractLabel.prototype.isDisabled = function () {\n return !!this.disabled;\n };\n __decorate$2x([\n PostConstruct\n ], AgAbstractLabel.prototype, \"postConstruct\", null);\n return AgAbstractLabel;\n}(Component));\n\nvar __extends$33 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar AgAbstractField = /** @class */ (function (_super) {\n __extends$33(AgAbstractField, _super);\n function AgAbstractField(config, template, className) {\n var _this = _super.call(this, config, template) || this;\n _this.className = className;\n return _this;\n }\n AgAbstractField.prototype.postConstruct = function () {\n _super.prototype.postConstruct.call(this);\n if (this.className) {\n this.addCssClass(this.className);\n }\n this.refreshAriaLabelledBy();\n };\n AgAbstractField.prototype.refreshAriaLabelledBy = function () {\n var ariaEl = this.getAriaElement();\n var labelId = this.getLabelId();\n if (getAriaLabel(ariaEl) !== null) {\n setAriaLabelledBy(ariaEl, '');\n }\n else {\n setAriaLabelledBy(ariaEl, labelId !== null && labelId !== void 0 ? labelId : '');\n }\n };\n AgAbstractField.prototype.setAriaLabel = function (label) {\n setAriaLabel(this.getAriaElement(), label);\n this.refreshAriaLabelledBy();\n return this;\n };\n AgAbstractField.prototype.onValueChange = function (callbackFn) {\n var _this = this;\n this.addManagedListener(this, Events.EVENT_FIELD_VALUE_CHANGED, function () { return callbackFn(_this.getValue()); });\n return this;\n };\n AgAbstractField.prototype.getWidth = function () {\n return this.getGui().clientWidth;\n };\n AgAbstractField.prototype.setWidth = function (width) {\n setFixedWidth(this.getGui(), width);\n return this;\n };\n AgAbstractField.prototype.getPreviousValue = function () {\n return this.previousValue;\n };\n AgAbstractField.prototype.getValue = function () {\n return this.value;\n };\n AgAbstractField.prototype.setValue = function (value, silent) {\n if (this.value === value) {\n return this;\n }\n this.previousValue = this.value;\n this.value = value;\n if (!silent) {\n this.dispatchEvent({ type: Events.EVENT_FIELD_VALUE_CHANGED });\n }\n return this;\n };\n return AgAbstractField;\n}(AgAbstractLabel));\n\nvar __extends$32 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2w = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar TEMPLATE$1 = /* html */ \"\\n
\\n
\\n
\\n
\\n
\\n
\\n
\";\nvar AgPickerField = /** @class */ (function (_super) {\n __extends$32(AgPickerField, _super);\n function AgPickerField(config) {\n var _this = _super.call(this, config, (config === null || config === void 0 ? void 0 : config.template) || TEMPLATE$1, config === null || config === void 0 ? void 0 : config.className) || this;\n _this.isPickerDisplayed = false;\n _this.skipClick = false;\n _this.pickerGap = 4;\n _this.hideCurrentPicker = null;\n _this.ariaRole = config === null || config === void 0 ? void 0 : config.ariaRole;\n _this.onPickerFocusIn = _this.onPickerFocusIn.bind(_this);\n _this.onPickerFocusOut = _this.onPickerFocusOut.bind(_this);\n if (!config) {\n return _this;\n }\n var pickerGap = config.pickerGap, maxPickerHeight = config.maxPickerHeight, variableWidth = config.variableWidth, minPickerWidth = config.minPickerWidth, maxPickerWidth = config.maxPickerWidth;\n if (pickerGap != null) {\n _this.pickerGap = pickerGap;\n }\n _this.variableWidth = !!variableWidth;\n if (maxPickerHeight != null) {\n _this.setPickerMaxHeight(maxPickerHeight);\n }\n if (minPickerWidth != null) {\n _this.setPickerMinWidth(minPickerWidth);\n }\n if (maxPickerWidth != null) {\n _this.setPickerMaxWidth(maxPickerWidth);\n }\n return _this;\n }\n AgPickerField.prototype.postConstruct = function () {\n _super.prototype.postConstruct.call(this);\n this.setupAria();\n var displayId = \"ag-\".concat(this.getCompId(), \"-display\");\n this.eDisplayField.setAttribute('id', displayId);\n var ariaEl = this.getAriaElement();\n this.addManagedListener(ariaEl, 'keydown', this.onKeyDown.bind(this));\n this.addManagedListener(this.eLabel, 'mousedown', this.onLabelOrWrapperMouseDown.bind(this));\n this.addManagedListener(this.eWrapper, 'mousedown', this.onLabelOrWrapperMouseDown.bind(this));\n var pickerIcon = this.config.pickerIcon;\n if (pickerIcon) {\n var icon = createIconNoSpan(pickerIcon, this.gridOptionsService);\n if (icon) {\n this.eIcon.appendChild(icon);\n }\n }\n };\n AgPickerField.prototype.setupAria = function () {\n var ariaEl = this.getAriaElement();\n ariaEl.setAttribute('tabindex', (this.gridOptionsService.get('tabIndex')).toString());\n setAriaExpanded(ariaEl, false);\n if (this.ariaRole) {\n setAriaRole(ariaEl, this.ariaRole);\n }\n };\n AgPickerField.prototype.onLabelOrWrapperMouseDown = function (e) {\n if (e) {\n var focusableEl = this.getFocusableElement();\n // if the focusableEl is not the wrapper and the mousedown\n // targets the focusableEl, we should not expand/collapse the picker.\n // Note: this will happen when AgRichSelect is set with `allowTyping=true`\n if (focusableEl !== this.eWrapper && (e === null || e === void 0 ? void 0 : e.target) === focusableEl) {\n return;\n }\n // this prevents a BUG where MouseDown causes the element to be focused\n // after the picker is shown and focus ends up being lost.\n e.preventDefault();\n this.getFocusableElement().focus();\n }\n if (this.skipClick) {\n this.skipClick = false;\n return;\n }\n if (this.isDisabled()) {\n return;\n }\n if (this.isPickerDisplayed) {\n this.hidePicker();\n }\n else {\n this.showPicker();\n }\n };\n AgPickerField.prototype.onKeyDown = function (e) {\n switch (e.key) {\n case KeyCode.UP:\n case KeyCode.DOWN:\n case KeyCode.ENTER:\n case KeyCode.SPACE:\n e.preventDefault();\n this.onLabelOrWrapperMouseDown();\n break;\n case KeyCode.ESCAPE:\n if (this.isPickerDisplayed) {\n e.preventDefault();\n e.stopPropagation();\n if (this.hideCurrentPicker) {\n this.hideCurrentPicker();\n }\n }\n break;\n }\n };\n AgPickerField.prototype.showPicker = function () {\n this.isPickerDisplayed = true;\n if (!this.pickerComponent) {\n this.pickerComponent = this.createPickerComponent();\n }\n var pickerGui = this.pickerComponent.getGui();\n pickerGui.addEventListener('focusin', this.onPickerFocusIn);\n pickerGui.addEventListener('focusout', this.onPickerFocusOut);\n this.hideCurrentPicker = this.renderAndPositionPicker();\n this.toggleExpandedStyles(true);\n };\n AgPickerField.prototype.renderAndPositionPicker = function () {\n var _this = this;\n var eDocument = this.gridOptionsService.getDocument();\n var ePicker = this.pickerComponent.getGui();\n if (!this.gridOptionsService.get('suppressScrollWhenPopupsAreOpen')) {\n this.destroyMouseWheelFunc = this.addManagedListener(this.eventService, Events.EVENT_BODY_SCROLL, function () {\n _this.hidePicker();\n });\n }\n var translate = this.localeService.getLocaleTextFunc();\n var _a = this.config, pickerAriaLabelKey = _a.pickerAriaLabelKey, pickerAriaLabelValue = _a.pickerAriaLabelValue, _b = _a.modalPicker, modalPicker = _b === void 0 ? true : _b;\n var popupParams = {\n modal: modalPicker,\n eChild: ePicker,\n closeOnEsc: true,\n closedCallback: function () {\n var shouldRestoreFocus = eDocument.activeElement === eDocument.body;\n _this.beforeHidePicker();\n if (shouldRestoreFocus && _this.isAlive()) {\n _this.getFocusableElement().focus();\n }\n },\n ariaLabel: translate(pickerAriaLabelKey, pickerAriaLabelValue),\n };\n var addPopupRes = this.popupService.addPopup(popupParams);\n var _c = this, maxPickerHeight = _c.maxPickerHeight, minPickerWidth = _c.minPickerWidth, maxPickerWidth = _c.maxPickerWidth, variableWidth = _c.variableWidth;\n if (variableWidth) {\n if (minPickerWidth) {\n ePicker.style.minWidth = minPickerWidth;\n }\n ePicker.style.width = formatSize(getAbsoluteWidth(this.eWrapper));\n if (maxPickerWidth) {\n ePicker.style.maxWidth = maxPickerWidth;\n }\n }\n else {\n setElementWidth(ePicker, maxPickerWidth !== null && maxPickerWidth !== void 0 ? maxPickerWidth : getAbsoluteWidth(this.eWrapper));\n }\n var maxHeight = maxPickerHeight !== null && maxPickerHeight !== void 0 ? maxPickerHeight : \"\".concat(getInnerHeight(this.popupService.getPopupParent()), \"px\");\n ePicker.style.setProperty('max-height', maxHeight);\n ePicker.style.position = 'absolute';\n this.alignPickerToComponent();\n return addPopupRes.hideFunc;\n };\n AgPickerField.prototype.alignPickerToComponent = function () {\n if (!this.pickerComponent) {\n return;\n }\n var pickerType = this.config.pickerType;\n var pickerGap = this.pickerGap;\n var alignSide = this.gridOptionsService.get('enableRtl') ? 'right' : 'left';\n this.popupService.positionPopupByComponent({\n type: pickerType,\n eventSource: this.eWrapper,\n ePopup: this.pickerComponent.getGui(),\n position: 'under',\n alignSide: alignSide,\n keepWithinBounds: true,\n nudgeY: pickerGap\n });\n };\n AgPickerField.prototype.beforeHidePicker = function () {\n if (this.destroyMouseWheelFunc) {\n this.destroyMouseWheelFunc();\n this.destroyMouseWheelFunc = undefined;\n }\n this.toggleExpandedStyles(false);\n var pickerGui = this.pickerComponent.getGui();\n pickerGui.removeEventListener('focusin', this.onPickerFocusIn);\n pickerGui.removeEventListener('focusout', this.onPickerFocusOut);\n this.isPickerDisplayed = false;\n this.pickerComponent = undefined;\n this.hideCurrentPicker = null;\n };\n AgPickerField.prototype.toggleExpandedStyles = function (expanded) {\n if (!this.isAlive()) {\n return;\n }\n var ariaEl = this.getAriaElement();\n setAriaExpanded(ariaEl, expanded);\n this.eWrapper.classList.toggle('ag-picker-expanded', expanded);\n this.eWrapper.classList.toggle('ag-picker-collapsed', !expanded);\n };\n AgPickerField.prototype.onPickerFocusIn = function () {\n this.togglePickerHasFocus(true);\n };\n AgPickerField.prototype.onPickerFocusOut = function (e) {\n var _a;\n if (!((_a = this.pickerComponent) === null || _a === void 0 ? void 0 : _a.getGui().contains(e.relatedTarget))) {\n this.togglePickerHasFocus(false);\n }\n };\n AgPickerField.prototype.togglePickerHasFocus = function (focused) {\n if (!this.pickerComponent) {\n return;\n }\n this.eWrapper.classList.toggle('ag-picker-has-focus', focused);\n };\n AgPickerField.prototype.hidePicker = function () {\n if (this.hideCurrentPicker) {\n this.hideCurrentPicker();\n }\n };\n AgPickerField.prototype.setInputWidth = function (width) {\n setElementWidth(this.eWrapper, width);\n return this;\n };\n AgPickerField.prototype.getFocusableElement = function () {\n return this.eWrapper;\n };\n AgPickerField.prototype.setPickerGap = function (gap) {\n this.pickerGap = gap;\n return this;\n };\n AgPickerField.prototype.setPickerMinWidth = function (width) {\n if (typeof width === 'number') {\n width = \"\".concat(width, \"px\");\n }\n this.minPickerWidth = width == null ? undefined : width;\n return this;\n };\n AgPickerField.prototype.setPickerMaxWidth = function (width) {\n if (typeof width === 'number') {\n width = \"\".concat(width, \"px\");\n }\n this.maxPickerWidth = width == null ? undefined : width;\n return this;\n };\n AgPickerField.prototype.setPickerMaxHeight = function (height) {\n if (typeof height === 'number') {\n height = \"\".concat(height, \"px\");\n }\n this.maxPickerHeight = height == null ? undefined : height;\n return this;\n };\n AgPickerField.prototype.destroy = function () {\n this.hidePicker();\n _super.prototype.destroy.call(this);\n };\n __decorate$2w([\n Autowired('popupService')\n ], AgPickerField.prototype, \"popupService\", void 0);\n __decorate$2w([\n RefSelector('eLabel')\n ], AgPickerField.prototype, \"eLabel\", void 0);\n __decorate$2w([\n RefSelector('eWrapper')\n ], AgPickerField.prototype, \"eWrapper\", void 0);\n __decorate$2w([\n RefSelector('eDisplayField')\n ], AgPickerField.prototype, \"eDisplayField\", void 0);\n __decorate$2w([\n RefSelector('eIcon')\n ], AgPickerField.prototype, \"eIcon\", void 0);\n return AgPickerField;\n}(AgAbstractField));\n\nvar __extends$31 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2v = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AgList = /** @class */ (function (_super) {\n __extends$31(AgList, _super);\n function AgList(cssIdentifier) {\n if (cssIdentifier === void 0) { cssIdentifier = 'default'; }\n var _this = _super.call(this, /* html */ \"
\")) || this;\n _this.cssIdentifier = cssIdentifier;\n _this.options = [];\n _this.itemEls = [];\n return _this;\n }\n AgList.prototype.init = function () {\n this.addManagedListener(this.getGui(), 'keydown', this.handleKeyDown.bind(this));\n };\n AgList.prototype.handleKeyDown = function (e) {\n var key = e.key;\n switch (key) {\n case KeyCode.ENTER:\n if (!this.highlightedEl) {\n this.setValue(this.getValue());\n }\n else {\n var pos = this.itemEls.indexOf(this.highlightedEl);\n this.setValueByIndex(pos);\n }\n break;\n case KeyCode.DOWN:\n case KeyCode.UP:\n var isDown = key === KeyCode.DOWN;\n var itemToHighlight = void 0;\n e.preventDefault();\n if (!this.highlightedEl) {\n itemToHighlight = this.itemEls[isDown ? 0 : this.itemEls.length - 1];\n }\n else {\n var currentIdx = this.itemEls.indexOf(this.highlightedEl);\n var nextPos = currentIdx + (isDown ? 1 : -1);\n nextPos = Math.min(Math.max(nextPos, 0), this.itemEls.length - 1);\n itemToHighlight = this.itemEls[nextPos];\n }\n this.highlightItem(itemToHighlight);\n break;\n }\n };\n AgList.prototype.addOptions = function (listOptions) {\n var _this = this;\n listOptions.forEach(function (listOption) { return _this.addOption(listOption); });\n return this;\n };\n AgList.prototype.addOption = function (listOption) {\n var value = listOption.value, text = listOption.text;\n var sanitisedText = escapeString(text || value);\n this.options.push({ value: value, text: sanitisedText });\n this.renderOption(value, sanitisedText);\n this.updateIndices();\n return this;\n };\n AgList.prototype.updateIndices = function () {\n var options = this.getGui().querySelectorAll('.ag-list-item');\n options.forEach(function (option, idx) {\n setAriaPosInSet(option, idx + 1);\n setAriaSetSize(option, options.length);\n });\n };\n AgList.prototype.renderOption = function (value, text) {\n var _this = this;\n var itemEl = document.createElement('div');\n setAriaRole(itemEl, 'option');\n itemEl.classList.add('ag-list-item', \"ag-\".concat(this.cssIdentifier, \"-list-item\"));\n itemEl.innerHTML = \"\".concat(text, \"\");\n itemEl.tabIndex = -1;\n this.itemEls.push(itemEl);\n this.addManagedListener(itemEl, 'mouseover', function () { return _this.highlightItem(itemEl); });\n this.addManagedListener(itemEl, 'mouseleave', function () { return _this.clearHighlighted(); });\n this.addManagedListener(itemEl, 'click', function () { return _this.setValue(value); });\n this.getGui().appendChild(itemEl);\n };\n AgList.prototype.setValue = function (value, silent) {\n if (this.value === value) {\n this.fireItemSelected();\n return this;\n }\n if (value == null) {\n this.reset();\n return this;\n }\n var idx = this.options.findIndex(function (option) { return option.value === value; });\n if (idx !== -1) {\n var option = this.options[idx];\n this.value = option.value;\n this.displayValue = option.text != null ? option.text : option.value;\n this.highlightItem(this.itemEls[idx]);\n if (!silent) {\n this.fireChangeEvent();\n }\n }\n return this;\n };\n AgList.prototype.setValueByIndex = function (idx) {\n return this.setValue(this.options[idx].value);\n };\n AgList.prototype.getValue = function () {\n return this.value;\n };\n AgList.prototype.getDisplayValue = function () {\n return this.displayValue;\n };\n AgList.prototype.refreshHighlighted = function () {\n var _this = this;\n this.clearHighlighted();\n var idx = this.options.findIndex(function (option) { return option.value === _this.value; });\n if (idx !== -1) {\n this.highlightItem(this.itemEls[idx]);\n }\n };\n AgList.prototype.reset = function () {\n this.value = null;\n this.displayValue = null;\n this.clearHighlighted();\n this.fireChangeEvent();\n };\n AgList.prototype.highlightItem = function (el) {\n if (!isVisible(el)) {\n return;\n }\n this.clearHighlighted();\n this.highlightedEl = el;\n this.highlightedEl.classList.add(AgList.ACTIVE_CLASS);\n setAriaSelected(this.highlightedEl, true);\n this.highlightedEl.focus();\n };\n AgList.prototype.clearHighlighted = function () {\n if (!this.highlightedEl || !isVisible(this.highlightedEl)) {\n return;\n }\n this.highlightedEl.classList.remove(AgList.ACTIVE_CLASS);\n setAriaSelected(this.highlightedEl, false);\n this.highlightedEl = null;\n };\n AgList.prototype.fireChangeEvent = function () {\n this.dispatchEvent({ type: Events.EVENT_FIELD_VALUE_CHANGED });\n this.fireItemSelected();\n };\n AgList.prototype.fireItemSelected = function () {\n this.dispatchEvent({ type: AgList.EVENT_ITEM_SELECTED });\n };\n AgList.EVENT_ITEM_SELECTED = 'selectedItem';\n AgList.ACTIVE_CLASS = 'ag-active-item';\n __decorate$2v([\n PostConstruct\n ], AgList.prototype, \"init\", null);\n return AgList;\n}(Component));\n\nvar __extends$30 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$m = ( false) || function () {\n __assign$m = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$m.apply(this, arguments);\n};\nvar AgSelect = /** @class */ (function (_super) {\n __extends$30(AgSelect, _super);\n function AgSelect(config) {\n return _super.call(this, __assign$m({ pickerAriaLabelKey: 'ariaLabelSelectField', pickerAriaLabelValue: 'Select Field', pickerType: 'ag-list', className: 'ag-select', pickerIcon: 'smallDown', ariaRole: 'combobox' }, config)) || this;\n }\n AgSelect.prototype.postConstruct = function () {\n _super.prototype.postConstruct.call(this);\n this.createListComponent();\n this.eWrapper.tabIndex = this.gridOptionsService.get('tabIndex');\n };\n AgSelect.prototype.createListComponent = function () {\n var _this = this;\n this.listComponent = this.createBean(new AgList('select'));\n this.listComponent.setParentComponent(this);\n var eListAriaEl = this.listComponent.getAriaElement();\n var listId = \"ag-select-list-\".concat(this.listComponent.getCompId());\n eListAriaEl.setAttribute('id', listId);\n setAriaControls(this.getAriaElement(), eListAriaEl);\n this.listComponent.addGuiEventListener('keydown', function (e) {\n if (e.key === KeyCode.TAB) {\n e.preventDefault();\n e.stopImmediatePropagation();\n _this.getGui().dispatchEvent(new KeyboardEvent('keydown', {\n key: e.key,\n shiftKey: e.shiftKey,\n ctrlKey: e.ctrlKey,\n bubbles: true\n }));\n }\n });\n this.listComponent.addManagedListener(this.listComponent, AgList.EVENT_ITEM_SELECTED, function () {\n _this.hidePicker();\n _this.dispatchEvent({ type: AgSelect.EVENT_ITEM_SELECTED });\n });\n this.listComponent.addManagedListener(this.listComponent, Events.EVENT_FIELD_VALUE_CHANGED, function () {\n if (!_this.listComponent) {\n return;\n }\n _this.setValue(_this.listComponent.getValue(), false, true);\n _this.hidePicker();\n });\n };\n AgSelect.prototype.createPickerComponent = function () {\n // do not create the picker every time to save state\n return this.listComponent;\n };\n AgSelect.prototype.showPicker = function () {\n if (!this.listComponent) {\n return;\n }\n _super.prototype.showPicker.call(this);\n this.listComponent.refreshHighlighted();\n };\n AgSelect.prototype.addOptions = function (options) {\n var _this = this;\n options.forEach(function (option) { return _this.addOption(option); });\n return this;\n };\n AgSelect.prototype.addOption = function (option) {\n this.listComponent.addOption(option);\n return this;\n };\n AgSelect.prototype.setValue = function (value, silent, fromPicker) {\n if (this.value === value || !this.listComponent) {\n return this;\n }\n if (!fromPicker) {\n this.listComponent.setValue(value, true);\n }\n var newValue = this.listComponent.getValue();\n if (newValue === this.getValue()) {\n return this;\n }\n this.eDisplayField.innerHTML = this.listComponent.getDisplayValue();\n return _super.prototype.setValue.call(this, value, silent);\n };\n AgSelect.prototype.destroy = function () {\n if (this.listComponent) {\n this.destroyBean(this.listComponent);\n this.listComponent = undefined;\n }\n _super.prototype.destroy.call(this);\n };\n AgSelect.EVENT_ITEM_SELECTED = 'selectedItem';\n return AgSelect;\n}(AgPickerField));\n\nvar __extends$2$ = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2u = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AgAbstractInputField = /** @class */ (function (_super) {\n __extends$2$(AgAbstractInputField, _super);\n function AgAbstractInputField(config, className, inputType, displayFieldTag) {\n if (inputType === void 0) { inputType = 'text'; }\n if (displayFieldTag === void 0) { displayFieldTag = 'input'; }\n var _this = _super.call(this, config, /* html */ \"\\n
\\n
\\n
\\n <\".concat(displayFieldTag, \" ref=\\\"eInput\\\" class=\\\"ag-input-field-input\\\">\\n
\\n
\"), className) || this;\n _this.inputType = inputType;\n _this.displayFieldTag = displayFieldTag;\n return _this;\n }\n AgAbstractInputField.prototype.postConstruct = function () {\n _super.prototype.postConstruct.call(this);\n this.setInputType();\n this.eLabel.classList.add(\"\".concat(this.className, \"-label\"));\n this.eWrapper.classList.add(\"\".concat(this.className, \"-input-wrapper\"));\n this.eInput.classList.add(\"\".concat(this.className, \"-input\"));\n this.addCssClass('ag-input-field');\n this.eInput.id = this.eInput.id || \"ag-\".concat(this.getCompId(), \"-input\");\n var _a = this.config, width = _a.width, value = _a.value;\n if (width != null) {\n this.setWidth(width);\n }\n if (value != null) {\n this.setValue(value);\n }\n this.addInputListeners();\n this.activateTabIndex([this.eInput]);\n };\n AgAbstractInputField.prototype.addInputListeners = function () {\n var _this = this;\n this.addManagedListener(this.eInput, 'input', function (e) { return _this.setValue(e.target.value); });\n };\n AgAbstractInputField.prototype.setInputType = function () {\n if (this.displayFieldTag === 'input') {\n this.eInput.setAttribute('type', this.inputType);\n }\n };\n AgAbstractInputField.prototype.getInputElement = function () {\n return this.eInput;\n };\n AgAbstractInputField.prototype.setInputWidth = function (width) {\n setElementWidth(this.eWrapper, width);\n return this;\n };\n AgAbstractInputField.prototype.setInputName = function (name) {\n this.getInputElement().setAttribute('name', name);\n return this;\n };\n AgAbstractInputField.prototype.getFocusableElement = function () {\n return this.eInput;\n };\n AgAbstractInputField.prototype.setMaxLength = function (length) {\n var eInput = this.eInput;\n eInput.maxLength = length;\n return this;\n };\n AgAbstractInputField.prototype.setInputPlaceholder = function (placeholder) {\n addOrRemoveAttribute(this.eInput, 'placeholder', placeholder);\n return this;\n };\n AgAbstractInputField.prototype.setInputAriaLabel = function (label) {\n setAriaLabel(this.eInput, label);\n this.refreshAriaLabelledBy();\n return this;\n };\n AgAbstractInputField.prototype.setDisabled = function (disabled) {\n setDisabled(this.eInput, disabled);\n return _super.prototype.setDisabled.call(this, disabled);\n };\n AgAbstractInputField.prototype.setAutoComplete = function (value) {\n if (value === true) {\n // Remove the autocomplete attribute if the value is explicitly set to true\n // to allow the default browser autocomplete/autofill behaviour.\n addOrRemoveAttribute(this.eInput, 'autocomplete', null);\n }\n else {\n // When a string is provided, use it as the value of the autocomplete attribute.\n // This enables users to specify how they want to the browser to handle the autocomplete on the input, as per spec:\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n var autoCompleteValue = typeof value === 'string' ? value : 'off';\n addOrRemoveAttribute(this.eInput, 'autocomplete', autoCompleteValue);\n }\n return this;\n };\n __decorate$2u([\n RefSelector('eLabel')\n ], AgAbstractInputField.prototype, \"eLabel\", void 0);\n __decorate$2u([\n RefSelector('eWrapper')\n ], AgAbstractInputField.prototype, \"eWrapper\", void 0);\n __decorate$2u([\n RefSelector('eInput')\n ], AgAbstractInputField.prototype, \"eInput\", void 0);\n return AgAbstractInputField;\n}(AgAbstractField));\n\nvar __extends$2_ = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar AgCheckbox = /** @class */ (function (_super) {\n __extends$2_(AgCheckbox, _super);\n function AgCheckbox(config, className, inputType) {\n if (className === void 0) { className = 'ag-checkbox'; }\n if (inputType === void 0) { inputType = 'checkbox'; }\n var _this = _super.call(this, config, className, inputType) || this;\n _this.labelAlignment = 'right';\n _this.selected = false;\n _this.readOnly = false;\n _this.passive = false;\n return _this;\n }\n AgCheckbox.prototype.addInputListeners = function () {\n this.addManagedListener(this.eInput, 'click', this.onCheckboxClick.bind(this));\n this.addManagedListener(this.eLabel, 'click', this.toggle.bind(this));\n };\n AgCheckbox.prototype.getNextValue = function () {\n return this.selected === undefined ? true : !this.selected;\n };\n AgCheckbox.prototype.setPassive = function (passive) {\n this.passive = passive;\n };\n AgCheckbox.prototype.isReadOnly = function () {\n return this.readOnly;\n };\n AgCheckbox.prototype.setReadOnly = function (readOnly) {\n this.eWrapper.classList.toggle('ag-disabled', readOnly);\n this.eInput.disabled = readOnly;\n this.readOnly = readOnly;\n };\n AgCheckbox.prototype.setDisabled = function (disabled) {\n this.eWrapper.classList.toggle('ag-disabled', disabled);\n return _super.prototype.setDisabled.call(this, disabled);\n };\n AgCheckbox.prototype.toggle = function () {\n if (this.eInput.disabled) {\n return;\n }\n var previousValue = this.isSelected();\n var nextValue = this.getNextValue();\n if (this.passive) {\n this.dispatchChange(nextValue, previousValue);\n }\n else {\n this.setValue(nextValue);\n }\n };\n AgCheckbox.prototype.getValue = function () {\n return this.isSelected();\n };\n AgCheckbox.prototype.setValue = function (value, silent) {\n this.refreshSelectedClass(value);\n this.setSelected(value, silent);\n return this;\n };\n AgCheckbox.prototype.setName = function (name) {\n var input = this.getInputElement();\n input.name = name;\n return this;\n };\n AgCheckbox.prototype.isSelected = function () {\n return this.selected;\n };\n AgCheckbox.prototype.setSelected = function (selected, silent) {\n if (this.isSelected() === selected) {\n return;\n }\n this.previousValue = this.isSelected();\n selected = this.selected = typeof selected === 'boolean' ? selected : undefined;\n this.eInput.checked = selected;\n this.eInput.indeterminate = selected === undefined;\n if (!silent) {\n this.dispatchChange(this.selected, this.previousValue);\n }\n };\n AgCheckbox.prototype.dispatchChange = function (selected, previousValue, event) {\n this.dispatchEvent({ type: Events.EVENT_FIELD_VALUE_CHANGED, selected: selected, previousValue: previousValue, event: event });\n var input = this.getInputElement();\n var checkboxChangedEvent = {\n type: Events.EVENT_CHECKBOX_CHANGED,\n id: input.id,\n name: input.name,\n selected: selected,\n previousValue: previousValue\n };\n this.eventService.dispatchEvent(checkboxChangedEvent);\n };\n AgCheckbox.prototype.onCheckboxClick = function (e) {\n if (this.passive || this.eInput.disabled) {\n return;\n }\n var previousValue = this.isSelected();\n var selected = this.selected = e.target.checked;\n this.refreshSelectedClass(selected);\n this.dispatchChange(selected, previousValue, e);\n };\n AgCheckbox.prototype.refreshSelectedClass = function (value) {\n this.eWrapper.classList.toggle('ag-checked', value === true);\n this.eWrapper.classList.toggle('ag-indeterminate', value == null);\n };\n return AgCheckbox;\n}(AgAbstractInputField));\n\nvar __extends$2Z = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar AgRadioButton = /** @class */ (function (_super) {\n __extends$2Z(AgRadioButton, _super);\n function AgRadioButton(config) {\n return _super.call(this, config, 'ag-radio-button', 'radio') || this;\n }\n AgRadioButton.prototype.isSelected = function () {\n return this.eInput.checked;\n };\n AgRadioButton.prototype.toggle = function () {\n if (this.eInput.disabled) {\n return;\n }\n // do not allow an active radio button to be deselected\n if (!this.isSelected()) {\n this.setValue(true);\n }\n };\n AgRadioButton.prototype.addInputListeners = function () {\n _super.prototype.addInputListeners.call(this);\n this.addManagedListener(this.eventService, Events.EVENT_CHECKBOX_CHANGED, this.onChange.bind(this));\n };\n /**\n * This ensures that if another radio button in the same named group is selected, we deselect this radio button.\n * By default the browser does this for you, but we are managing classes ourselves in order to ensure input\n * elements are styled correctly in IE11, and the DOM 'changed' event is only fired when a button is selected,\n * not deselected, so we need to use our own event.\n */\n AgRadioButton.prototype.onChange = function (event) {\n if (event.selected &&\n event.name &&\n this.eInput.name &&\n this.eInput.name === event.name &&\n event.id &&\n this.eInput.id !== event.id) {\n this.setValue(false, true);\n }\n };\n return AgRadioButton;\n}(AgCheckbox));\n\nvar __extends$2Y = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __read$v = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$p = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar SimpleFilterModelFormatter = /** @class */ (function () {\n function SimpleFilterModelFormatter(localeService, optionsFactory, valueFormatter) {\n this.localeService = localeService;\n this.optionsFactory = optionsFactory;\n this.valueFormatter = valueFormatter;\n }\n // used by:\n // 1) NumberFloatingFilter & TextFloatingFilter: Always, for both when editable and read only.\n // 2) DateFloatingFilter: Only when read only (as we show text rather than a date picker when read only)\n SimpleFilterModelFormatter.prototype.getModelAsString = function (model) {\n var _this = this;\n if (!model) {\n return null;\n }\n var isCombined = model.operator != null;\n var translate = this.localeService.getLocaleTextFunc();\n if (isCombined) {\n var combinedModel = model;\n var conditions = combinedModel.conditions;\n if (!conditions) {\n var condition1 = combinedModel.condition1, condition2 = combinedModel.condition2;\n conditions = [condition1, condition2];\n }\n var customOptions = conditions.map(function (condition) { return _this.getModelAsString(condition); });\n var joinOperatorTranslateKey = combinedModel.operator === 'AND' ? 'andCondition' : 'orCondition';\n return customOptions.join(\" \".concat(translate(joinOperatorTranslateKey, FILTER_LOCALE_TEXT[joinOperatorTranslateKey]), \" \"));\n }\n else if (model.type === SimpleFilter.BLANK || model.type === SimpleFilter.NOT_BLANK) {\n return translate(model.type, model.type);\n }\n else {\n var condition = model;\n var customOption = this.optionsFactory.getCustomOption(condition.type);\n // For custom filter options we display the Name of the filter instead\n // of displaying the `from` value, as it wouldn't be relevant\n var _a = customOption || {}, displayKey = _a.displayKey, displayName = _a.displayName, numberOfInputs = _a.numberOfInputs;\n if (displayKey && displayName && numberOfInputs === 0) {\n translate(displayKey, displayName);\n return displayName;\n }\n return this.conditionToString(condition, customOption);\n }\n };\n SimpleFilterModelFormatter.prototype.updateParams = function (params) {\n this.optionsFactory = params.optionsFactory;\n };\n SimpleFilterModelFormatter.prototype.formatValue = function (value) {\n var _a;\n return this.valueFormatter ? ((_a = this.valueFormatter(value !== null && value !== void 0 ? value : null)) !== null && _a !== void 0 ? _a : '') : String(value);\n };\n return SimpleFilterModelFormatter;\n}());\n/**\n * Every filter with a dropdown where the user can specify a comparing type against the filter values.\n *\n * @param M type of filter-model managed by the concrete sub-class that extends this type\n * @param V type of value managed by the concrete sub-class that extends this type\n * @param E type of UI element used for collecting user-input\n */\nvar SimpleFilter = /** @class */ (function (_super) {\n __extends$2Y(SimpleFilter, _super);\n function SimpleFilter() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.eTypes = [];\n _this.eJoinOperatorPanels = [];\n _this.eJoinOperatorsAnd = [];\n _this.eJoinOperatorsOr = [];\n _this.eConditionBodies = [];\n _this.listener = function () { return _this.onUiChanged(); };\n _this.lastUiCompletePosition = null;\n _this.joinOperatorId = 0;\n return _this;\n }\n SimpleFilter.prototype.getNumberOfInputs = function (type) {\n var customOpts = this.optionsFactory.getCustomOption(type);\n if (customOpts) {\n var numberOfInputs = customOpts.numberOfInputs;\n return numberOfInputs != null ? numberOfInputs : 1;\n }\n var zeroInputTypes = [\n SimpleFilter.EMPTY, SimpleFilter.NOT_BLANK, SimpleFilter.BLANK,\n ];\n if (type && zeroInputTypes.indexOf(type) >= 0) {\n return 0;\n }\n else if (type === SimpleFilter.IN_RANGE) {\n return 2;\n }\n return 1;\n };\n // floating filter calls this when user applies filter from floating filter\n SimpleFilter.prototype.onFloatingFilterChanged = function (type, value) {\n this.setTypeFromFloatingFilter(type);\n this.setValueFromFloatingFilter(value);\n this.onUiChanged(true);\n };\n SimpleFilter.prototype.setTypeFromFloatingFilter = function (type) {\n var _this = this;\n this.eTypes.forEach(function (eType, position) {\n if (position === 0) {\n eType.setValue(type, true);\n }\n else {\n eType.setValue(_this.optionsFactory.getDefaultOption(), true);\n }\n });\n };\n SimpleFilter.prototype.getModelFromUi = function () {\n var conditions = this.getUiCompleteConditions();\n if (conditions.length === 0) {\n return null;\n }\n if (this.maxNumConditions > 1 && conditions.length > 1) {\n return {\n filterType: this.getFilterType(),\n operator: this.getJoinOperator(),\n condition1: conditions[0],\n condition2: conditions[1],\n conditions: conditions\n };\n }\n return conditions[0];\n };\n SimpleFilter.prototype.getConditionTypes = function () {\n return this.eTypes.map(function (eType) { return eType.getValue(); });\n };\n SimpleFilter.prototype.getConditionType = function (position) {\n return this.eTypes[position].getValue();\n };\n SimpleFilter.prototype.getJoinOperator = function () {\n if (this.eJoinOperatorsOr.length === 0) {\n return this.defaultJoinOperator;\n }\n return this.eJoinOperatorsOr[0].getValue() === true ? 'OR' : 'AND';\n };\n SimpleFilter.prototype.areModelsEqual = function (a, b) {\n var _this = this;\n // both are missing\n if (!a && !b) {\n return true;\n }\n // one is missing, other present\n if ((!a && b) || (a && !b)) {\n return false;\n }\n // one is combined, the other is not\n var aIsSimple = !a.operator;\n var bIsSimple = !b.operator;\n var oneSimpleOneCombined = (!aIsSimple && bIsSimple) || (aIsSimple && !bIsSimple);\n if (oneSimpleOneCombined) {\n return false;\n }\n var res;\n // otherwise both present, so compare\n if (aIsSimple) {\n var aSimple = a;\n var bSimple = b;\n res = this.areSimpleModelsEqual(aSimple, bSimple);\n }\n else {\n var aCombined = a;\n var bCombined = b;\n res = aCombined.operator === bCombined.operator\n && areEqual(aCombined.conditions, bCombined.conditions, function (aModel, bModel) { return _this.areSimpleModelsEqual(aModel, bModel); });\n }\n return res;\n };\n SimpleFilter.prototype.shouldRefresh = function (newParams) {\n var _a, _b, _c;\n var model = this.getModel();\n var conditions = model ? ((_a = model.conditions) !== null && _a !== void 0 ? _a : [model]) : null;\n // Do Not refresh when one of the existing condition options is not in new options list\n var newOptionsList = (_c = (_b = newParams.filterOptions) === null || _b === void 0 ? void 0 : _b.map(function (option) { return typeof option === 'string' ? option : option.displayKey; })) !== null && _c !== void 0 ? _c : this.getDefaultFilterOptions();\n var allConditionsExistInNewOptionsList = !conditions || conditions.every(function (condition) {\n return newOptionsList.find(function (option) { return option === condition.type; }) !== undefined;\n });\n if (!allConditionsExistInNewOptionsList) {\n return false;\n }\n // Check number of conditions vs maxNumConditions\n if (typeof newParams.maxNumConditions === 'number' && conditions && conditions.length > newParams.maxNumConditions) {\n return false;\n }\n return true;\n };\n SimpleFilter.prototype.refresh = function (newParams) {\n if (!this.shouldRefresh(newParams)) {\n return false;\n }\n var parentRefreshed = _super.prototype.refresh.call(this, newParams);\n if (!parentRefreshed) {\n return false;\n }\n this.setParams(newParams);\n this.removeConditionsAndOperators(0);\n this.createOption();\n this.setModel(this.getModel());\n return true;\n };\n SimpleFilter.prototype.setModelIntoUi = function (model) {\n var _this = this;\n var isCombined = model.operator;\n if (isCombined) {\n var combinedModel = model;\n if (!combinedModel.conditions) {\n combinedModel.conditions = [\n combinedModel.condition1,\n combinedModel.condition2\n ];\n }\n var numConditions = this.validateAndUpdateConditions(combinedModel.conditions);\n var numPrevConditions = this.getNumConditions();\n if (numConditions < numPrevConditions) {\n this.removeConditionsAndOperators(numConditions);\n }\n else if (numConditions > numPrevConditions) {\n for (var i = numPrevConditions; i < numConditions; i++) {\n this.createJoinOperatorPanel();\n this.createOption();\n }\n }\n var orChecked_1 = combinedModel.operator === 'OR';\n this.eJoinOperatorsAnd.forEach(function (eJoinOperatorAnd) { return eJoinOperatorAnd.setValue(!orChecked_1, true); });\n this.eJoinOperatorsOr.forEach(function (eJoinOperatorOr) { return eJoinOperatorOr.setValue(orChecked_1, true); });\n combinedModel.conditions.forEach(function (condition, position) {\n _this.eTypes[position].setValue(condition.type, true);\n _this.setConditionIntoUi(condition, position);\n });\n }\n else {\n var simpleModel = model;\n if (this.getNumConditions() > 1) {\n this.removeConditionsAndOperators(1);\n }\n this.eTypes[0].setValue(simpleModel.type, true);\n this.setConditionIntoUi(simpleModel, 0);\n }\n this.lastUiCompletePosition = this.getNumConditions() - 1;\n this.createMissingConditionsAndOperators();\n this.onUiChanged();\n return AgPromise.resolve();\n };\n SimpleFilter.prototype.validateAndUpdateConditions = function (conditions) {\n var numConditions = conditions.length;\n if (numConditions > this.maxNumConditions) {\n conditions.splice(this.maxNumConditions);\n warnOnce('Filter Model contains more conditions than \"filterParams.maxNumConditions\". Additional conditions have been ignored.');\n numConditions = this.maxNumConditions;\n }\n return numConditions;\n };\n SimpleFilter.prototype.doesFilterPass = function (params) {\n var _this = this;\n var _a;\n var model = this.getModel();\n if (model == null) {\n return true;\n }\n var operator = model.operator;\n var models = [];\n if (operator) {\n var combinedModel = model;\n models.push.apply(models, __spreadArray$p([], __read$v(((_a = combinedModel.conditions) !== null && _a !== void 0 ? _a : [])), false));\n }\n else {\n models.push(model);\n }\n var combineFunction = operator && operator === 'OR' ? 'some' : 'every';\n return models[combineFunction](function (m) { return _this.individualConditionPasses(params, m); });\n };\n SimpleFilter.prototype.setParams = function (params) {\n _super.prototype.setParams.call(this, params);\n this.setNumConditions(params);\n this.defaultJoinOperator = this.getDefaultJoinOperator(params.defaultJoinOperator);\n this.filterPlaceholder = params.filterPlaceholder;\n this.optionsFactory = new OptionsFactory();\n this.optionsFactory.init(params, this.getDefaultFilterOptions());\n this.createFilterListOptions();\n this.createOption();\n this.createMissingConditionsAndOperators();\n if (this.isReadOnly()) {\n // only do this when read only (so no other focusable elements), otherwise the tab order breaks\n // as the tabbed layout managed focus feature will focus the body when it shouldn't\n this.eFilterBody.setAttribute('tabindex', '-1');\n }\n };\n SimpleFilter.prototype.setNumConditions = function (params) {\n var _a, _b;\n if (params.suppressAndOrCondition != null) {\n warnOnce('Since v29.2 \"filterParams.suppressAndOrCondition\" is deprecated. Use \"filterParams.maxNumConditions = 1\" instead.');\n }\n if (params.alwaysShowBothConditions != null) {\n warnOnce('Since v29.2 \"filterParams.alwaysShowBothConditions\" is deprecated. Use \"filterParams.numAlwaysVisibleConditions = 2\" instead.');\n }\n this.maxNumConditions = (_a = params.maxNumConditions) !== null && _a !== void 0 ? _a : (params.suppressAndOrCondition ? 1 : 2);\n if (this.maxNumConditions < 1) {\n warnOnce('\"filterParams.maxNumConditions\" must be greater than or equal to zero.');\n this.maxNumConditions = 1;\n }\n this.numAlwaysVisibleConditions = (_b = params.numAlwaysVisibleConditions) !== null && _b !== void 0 ? _b : (params.alwaysShowBothConditions ? 2 : 1);\n if (this.numAlwaysVisibleConditions < 1) {\n warnOnce('\"filterParams.numAlwaysVisibleConditions\" must be greater than or equal to zero.');\n this.numAlwaysVisibleConditions = 1;\n }\n if (this.numAlwaysVisibleConditions > this.maxNumConditions) {\n warnOnce('\"filterParams.numAlwaysVisibleConditions\" cannot be greater than \"filterParams.maxNumConditions\".');\n this.numAlwaysVisibleConditions = this.maxNumConditions;\n }\n };\n SimpleFilter.prototype.createOption = function () {\n var _this = this;\n var eType = this.createManagedBean(new AgSelect());\n this.eTypes.push(eType);\n eType.addCssClass('ag-filter-select');\n this.eFilterBody.appendChild(eType.getGui());\n var eConditionBody = this.createValueElement();\n this.eConditionBodies.push(eConditionBody);\n this.eFilterBody.appendChild(eConditionBody);\n this.putOptionsIntoDropdown(eType);\n this.resetType(eType);\n var position = this.getNumConditions() - 1;\n this.forEachPositionInput(position, function (element) { return _this.resetInput(element); });\n this.addChangedListeners(eType, position);\n };\n SimpleFilter.prototype.createJoinOperatorPanel = function () {\n var eJoinOperatorPanel = document.createElement('div');\n this.eJoinOperatorPanels.push(eJoinOperatorPanel);\n eJoinOperatorPanel.classList.add('ag-filter-condition');\n var eJoinOperatorAnd = this.createJoinOperator(this.eJoinOperatorsAnd, eJoinOperatorPanel, 'and');\n var eJoinOperatorOr = this.createJoinOperator(this.eJoinOperatorsOr, eJoinOperatorPanel, 'or');\n this.eFilterBody.appendChild(eJoinOperatorPanel);\n var index = this.eJoinOperatorPanels.length - 1;\n var uniqueGroupId = this.joinOperatorId++;\n this.resetJoinOperatorAnd(eJoinOperatorAnd, index, uniqueGroupId);\n this.resetJoinOperatorOr(eJoinOperatorOr, index, uniqueGroupId);\n if (!this.isReadOnly()) {\n eJoinOperatorAnd.onValueChange(this.listener);\n eJoinOperatorOr.onValueChange(this.listener);\n }\n };\n SimpleFilter.prototype.createJoinOperator = function (eJoinOperators, eJoinOperatorPanel, andOr) {\n var eJoinOperator = this.createManagedBean(new AgRadioButton());\n eJoinOperators.push(eJoinOperator);\n eJoinOperator.addCssClass('ag-filter-condition-operator');\n eJoinOperator.addCssClass(\"ag-filter-condition-operator-\".concat(andOr));\n eJoinOperatorPanel.appendChild(eJoinOperator.getGui());\n return eJoinOperator;\n };\n SimpleFilter.prototype.getDefaultJoinOperator = function (defaultJoinOperator) {\n return defaultJoinOperator === 'AND' || defaultJoinOperator === 'OR' ? defaultJoinOperator : 'AND';\n };\n SimpleFilter.prototype.createFilterListOptions = function () {\n var _this = this;\n var filterOptions = this.optionsFactory.getFilterOptions();\n this.filterListOptions = filterOptions.map(function (option) {\n return typeof option === 'string' ?\n _this.createBoilerplateListOption(option) :\n _this.createCustomListOption(option);\n });\n };\n SimpleFilter.prototype.putOptionsIntoDropdown = function (eType) {\n // Add specified options to condition drop-down.\n this.filterListOptions.forEach(function (listOption) {\n eType.addOption(listOption);\n });\n // Make drop-downs read-only if there is only one option.\n eType.setDisabled(this.filterListOptions.length <= 1);\n };\n SimpleFilter.prototype.createBoilerplateListOption = function (option) {\n return { value: option, text: this.translate(option) };\n };\n SimpleFilter.prototype.createCustomListOption = function (option) {\n var displayKey = option.displayKey;\n var customOption = this.optionsFactory.getCustomOption(option.displayKey);\n return {\n value: displayKey,\n text: customOption ?\n this.localeService.getLocaleTextFunc()(customOption.displayKey, customOption.displayName) :\n this.translate(displayKey),\n };\n };\n /**\n * @deprecated As of v29.2 filters can have more than two conditions. Check `colDef.filterParams.maxNumConditions` instead.\n */\n SimpleFilter.prototype.isAllowTwoConditions = function () {\n return this.maxNumConditions >= 2;\n };\n SimpleFilter.prototype.createBodyTemplate = function () {\n // created dynamically\n return '';\n };\n SimpleFilter.prototype.getCssIdentifier = function () {\n return 'simple-filter';\n };\n SimpleFilter.prototype.updateUiVisibility = function () {\n var joinOperator = this.getJoinOperator();\n this.updateNumConditions();\n // from here, the number of elements in all the collections is correct, so can just update the values/statuses\n this.updateConditionStatusesAndValues(this.lastUiCompletePosition, joinOperator);\n };\n SimpleFilter.prototype.updateNumConditions = function () {\n var _a;\n // Collection sizes are already correct if updated via API, so only need to handle UI updates here\n var lastUiCompletePosition = -1;\n var areAllConditionsUiComplete = true;\n for (var position = 0; position < this.getNumConditions(); position++) {\n if (this.isConditionUiComplete(position)) {\n lastUiCompletePosition = position;\n }\n else {\n areAllConditionsUiComplete = false;\n }\n }\n if (this.shouldAddNewConditionAtEnd(areAllConditionsUiComplete)) {\n this.createJoinOperatorPanel();\n this.createOption();\n }\n else {\n var activePosition = (_a = this.lastUiCompletePosition) !== null && _a !== void 0 ? _a : this.getNumConditions() - 2;\n if (lastUiCompletePosition < activePosition) {\n // remove any incomplete conditions at the end, excluding the active position\n this.removeConditionsAndOperators(activePosition + 1);\n var removeStartPosition = lastUiCompletePosition + 1;\n var numConditionsToRemove = activePosition - removeStartPosition;\n if (numConditionsToRemove > 0) {\n this.removeConditionsAndOperators(removeStartPosition, numConditionsToRemove);\n }\n this.createMissingConditionsAndOperators();\n }\n }\n this.lastUiCompletePosition = lastUiCompletePosition;\n };\n SimpleFilter.prototype.updateConditionStatusesAndValues = function (lastUiCompletePosition, joinOperator) {\n var _this = this;\n this.eTypes.forEach(function (eType, position) {\n var disabled = _this.isConditionDisabled(position, lastUiCompletePosition);\n eType.setDisabled(disabled || _this.filterListOptions.length <= 1);\n if (position === 1) {\n setDisabled(_this.eJoinOperatorPanels[0], disabled);\n _this.eJoinOperatorsAnd[0].setDisabled(disabled);\n _this.eJoinOperatorsOr[0].setDisabled(disabled);\n }\n });\n this.eConditionBodies.forEach(function (element, index) {\n setDisplayed(element, _this.isConditionBodyVisible(index));\n });\n var orChecked = (joinOperator !== null && joinOperator !== void 0 ? joinOperator : this.getJoinOperator()) === 'OR';\n this.eJoinOperatorsAnd.forEach(function (eJoinOperatorAnd, index) {\n eJoinOperatorAnd.setValue(!orChecked, true);\n });\n this.eJoinOperatorsOr.forEach(function (eJoinOperatorOr, index) {\n eJoinOperatorOr.setValue(orChecked, true);\n });\n this.forEachInput(function (element, index, position, numberOfInputs) {\n _this.setElementDisplayed(element, index < numberOfInputs);\n _this.setElementDisabled(element, _this.isConditionDisabled(position, lastUiCompletePosition));\n });\n this.resetPlaceholder();\n };\n SimpleFilter.prototype.shouldAddNewConditionAtEnd = function (areAllConditionsUiComplete) {\n return areAllConditionsUiComplete && this.getNumConditions() < this.maxNumConditions && !this.isReadOnly();\n };\n SimpleFilter.prototype.removeConditionsAndOperators = function (startPosition, deleteCount) {\n if (startPosition >= this.getNumConditions()) {\n return;\n }\n this.removeComponents(this.eTypes, startPosition, deleteCount);\n this.removeElements(this.eConditionBodies, startPosition, deleteCount);\n this.removeValueElements(startPosition, deleteCount);\n var joinOperatorIndex = Math.max(startPosition - 1, 0);\n this.removeElements(this.eJoinOperatorPanels, joinOperatorIndex, deleteCount);\n this.removeComponents(this.eJoinOperatorsAnd, joinOperatorIndex, deleteCount);\n this.removeComponents(this.eJoinOperatorsOr, joinOperatorIndex, deleteCount);\n };\n SimpleFilter.prototype.removeElements = function (elements, startPosition, deleteCount) {\n var removedElements = this.removeItems(elements, startPosition, deleteCount);\n removedElements.forEach(function (element) { return removeFromParent(element); });\n };\n SimpleFilter.prototype.removeComponents = function (components, startPosition, deleteCount) {\n var _this = this;\n var removedComponents = this.removeItems(components, startPosition, deleteCount);\n removedComponents.forEach(function (comp) {\n removeFromParent(comp.getGui());\n _this.destroyBean(comp);\n });\n };\n SimpleFilter.prototype.removeItems = function (items, startPosition, deleteCount) {\n return deleteCount == null ? items.splice(startPosition) : items.splice(startPosition, deleteCount);\n };\n SimpleFilter.prototype.afterGuiAttached = function (params) {\n _super.prototype.afterGuiAttached.call(this, params);\n this.resetPlaceholder();\n if (!(params === null || params === void 0 ? void 0 : params.suppressFocus)) {\n if (this.isReadOnly()) {\n // something needs focus otherwise keyboard navigation breaks, so focus the filter body\n this.eFilterBody.focus();\n }\n else {\n var firstInput = this.getInputs(0)[0];\n if (!firstInput) {\n return;\n }\n if (firstInput instanceof AgAbstractInputField) {\n firstInput.getInputElement().focus();\n }\n }\n }\n };\n SimpleFilter.prototype.afterGuiDetached = function () {\n _super.prototype.afterGuiDetached.call(this);\n var appliedModel = this.getModel();\n // Reset temporary UI state that was applied to the DOM but not committed to the model\n this.resetUiToActiveModel(appliedModel);\n // remove incomplete positions\n var lastUiCompletePosition = -1;\n // as we remove incomplete positions, the last UI complete position will change\n var updatedLastUiCompletePosition = -1;\n var conditionsRemoved = false;\n var joinOperator = this.getJoinOperator();\n for (var position = this.getNumConditions() - 1; position >= 0; position--) {\n if (this.isConditionUiComplete(position)) {\n if (lastUiCompletePosition === -1) {\n lastUiCompletePosition = position;\n updatedLastUiCompletePosition = position;\n }\n }\n else {\n var shouldRemovePositionAtEnd = position >= this.numAlwaysVisibleConditions && !this.isConditionUiComplete(position - 1);\n var positionBeforeLastUiCompletePosition = position < lastUiCompletePosition;\n if (shouldRemovePositionAtEnd || positionBeforeLastUiCompletePosition) {\n this.removeConditionsAndOperators(position, 1);\n conditionsRemoved = true;\n if (positionBeforeLastUiCompletePosition) {\n updatedLastUiCompletePosition--;\n }\n }\n }\n }\n var shouldUpdateConditionStatusesAndValues = false;\n if (this.getNumConditions() < this.numAlwaysVisibleConditions) {\n // if conditions have been removed, need to recreate new ones at the end up to the number required\n this.createMissingConditionsAndOperators();\n shouldUpdateConditionStatusesAndValues = true;\n }\n if (this.shouldAddNewConditionAtEnd(updatedLastUiCompletePosition === this.getNumConditions() - 1)) {\n this.createJoinOperatorPanel();\n this.createOption();\n shouldUpdateConditionStatusesAndValues = true;\n }\n if (shouldUpdateConditionStatusesAndValues) {\n this.updateConditionStatusesAndValues(updatedLastUiCompletePosition, joinOperator);\n }\n if (conditionsRemoved) {\n this.updateJoinOperatorsDisabled();\n }\n this.lastUiCompletePosition = updatedLastUiCompletePosition;\n };\n SimpleFilter.prototype.getPlaceholderText = function (defaultPlaceholder, position) {\n var placeholder = this.translate(defaultPlaceholder);\n if (isFunction(this.filterPlaceholder)) {\n var filterPlaceholderFn = this.filterPlaceholder;\n var filterOptionKey = this.eTypes[position].getValue();\n var filterOption = this.translate(filterOptionKey);\n placeholder = filterPlaceholderFn({\n filterOptionKey: filterOptionKey,\n filterOption: filterOption,\n placeholder: placeholder\n });\n }\n else if (typeof this.filterPlaceholder === 'string') {\n placeholder = this.filterPlaceholder;\n }\n return placeholder;\n };\n // allow sub-classes to reset HTML placeholders after UI update.\n SimpleFilter.prototype.resetPlaceholder = function () {\n var _this = this;\n var globalTranslate = this.localeService.getLocaleTextFunc();\n this.forEachInput(function (element, index, position, numberOfInputs) {\n if (!(element instanceof AgAbstractInputField)) {\n return;\n }\n var placeholder = index === 0 && numberOfInputs > 1 ? 'inRangeStart' :\n index === 0 ? 'filterOoo' :\n 'inRangeEnd';\n var ariaLabel = index === 0 && numberOfInputs > 1 ? globalTranslate('ariaFilterFromValue', 'Filter from value') :\n index === 0 ? globalTranslate('ariaFilterValue', 'Filter Value') :\n globalTranslate('ariaFilterToValue', 'Filter to Value');\n element.setInputPlaceholder(_this.getPlaceholderText(placeholder, position));\n element.setInputAriaLabel(ariaLabel);\n });\n };\n SimpleFilter.prototype.setElementValue = function (element, value, fromFloatingFilter) {\n if (element instanceof AgAbstractInputField) {\n element.setValue(value != null ? String(value) : null, true);\n }\n };\n SimpleFilter.prototype.setElementDisplayed = function (element, displayed) {\n if (element instanceof Component) {\n setDisplayed(element.getGui(), displayed);\n }\n };\n SimpleFilter.prototype.setElementDisabled = function (element, disabled) {\n if (element instanceof Component) {\n setDisabled(element.getGui(), disabled);\n }\n };\n SimpleFilter.prototype.attachElementOnChange = function (element, listener) {\n if (element instanceof AgAbstractInputField) {\n element.onValueChange(listener);\n }\n };\n SimpleFilter.prototype.forEachInput = function (cb) {\n var _this = this;\n this.getConditionTypes().forEach(function (type, position) {\n _this.forEachPositionTypeInput(position, type, cb);\n });\n };\n SimpleFilter.prototype.forEachPositionInput = function (position, cb) {\n var type = this.getConditionType(position);\n this.forEachPositionTypeInput(position, type, cb);\n };\n SimpleFilter.prototype.forEachPositionTypeInput = function (position, type, cb) {\n var numberOfInputs = this.getNumberOfInputs(type);\n var inputs = this.getInputs(position);\n for (var index = 0; index < inputs.length; index++) {\n var input = inputs[index];\n if (input != null) {\n cb(input, index, position, numberOfInputs);\n }\n }\n };\n SimpleFilter.prototype.isConditionDisabled = function (position, lastUiCompletePosition) {\n if (this.isReadOnly()) {\n return true;\n } // Read-only mode trumps everything.\n if (position === 0) {\n return false;\n } // Position 0 should typically be editable.\n // Only allow editing of a 2nd or later condition if the previous condition is complete and no subsequent conditions are complete.\n return position > lastUiCompletePosition + 1;\n };\n SimpleFilter.prototype.isConditionBodyVisible = function (position) {\n // Check that the condition needs inputs.\n var type = this.getConditionType(position);\n var numberOfInputs = this.getNumberOfInputs(type);\n return numberOfInputs > 0;\n };\n // returns true if the UI represents a working filter, eg all parts are filled out.\n // eg if text filter and textfield blank then returns false.\n SimpleFilter.prototype.isConditionUiComplete = function (position) {\n if (position >= this.getNumConditions()) {\n return false;\n } // Condition doesn't exist.\n var type = this.getConditionType(position);\n if (type === SimpleFilter.EMPTY) {\n return false;\n }\n if (this.getValues(position).some(function (v) { return v == null; })) {\n return false;\n }\n return true;\n };\n SimpleFilter.prototype.getNumConditions = function () {\n return this.eTypes.length;\n };\n SimpleFilter.prototype.getUiCompleteConditions = function () {\n var conditions = [];\n for (var position = 0; position < this.getNumConditions(); position++) {\n if (this.isConditionUiComplete(position)) {\n conditions.push(this.createCondition(position));\n }\n }\n return conditions;\n };\n SimpleFilter.prototype.createMissingConditionsAndOperators = function () {\n if (this.isReadOnly()) {\n return;\n } // don't show incomplete conditions when read only\n for (var i = this.getNumConditions(); i < this.numAlwaysVisibleConditions; i++) {\n this.createJoinOperatorPanel();\n this.createOption();\n }\n };\n SimpleFilter.prototype.resetUiToDefaults = function (silent) {\n var _this = this;\n this.removeConditionsAndOperators(this.isReadOnly() ? 1 : this.numAlwaysVisibleConditions);\n this.eTypes.forEach(function (eType) { return _this.resetType(eType); });\n this.eJoinOperatorsAnd.forEach(function (eJoinOperatorAnd, index) { return _this.resetJoinOperatorAnd(eJoinOperatorAnd, index, _this.joinOperatorId + index); });\n this.eJoinOperatorsOr.forEach(function (eJoinOperatorOr, index) { return _this.resetJoinOperatorOr(eJoinOperatorOr, index, _this.joinOperatorId + index); });\n this.joinOperatorId++;\n this.forEachInput(function (element) { return _this.resetInput(element); });\n this.resetPlaceholder();\n this.createMissingConditionsAndOperators();\n this.lastUiCompletePosition = null;\n if (!silent) {\n this.onUiChanged();\n }\n return AgPromise.resolve();\n };\n SimpleFilter.prototype.resetType = function (eType) {\n var translate = this.localeService.getLocaleTextFunc();\n var filteringLabel = translate('ariaFilteringOperator', 'Filtering operator');\n eType\n .setValue(this.optionsFactory.getDefaultOption(), true)\n .setAriaLabel(filteringLabel)\n .setDisabled(this.isReadOnly() || this.filterListOptions.length <= 1);\n };\n SimpleFilter.prototype.resetJoinOperatorAnd = function (eJoinOperatorAnd, index, uniqueGroupId) {\n this.resetJoinOperator(eJoinOperatorAnd, index, this.isDefaultOperator('AND'), this.translate('andCondition'), uniqueGroupId);\n };\n SimpleFilter.prototype.resetJoinOperatorOr = function (eJoinOperatorOr, index, uniqueGroupId) {\n this.resetJoinOperator(eJoinOperatorOr, index, this.isDefaultOperator('OR'), this.translate('orCondition'), uniqueGroupId);\n };\n SimpleFilter.prototype.resetJoinOperator = function (eJoinOperator, index, value, label, uniqueGroupId) {\n this.updateJoinOperatorDisabled(eJoinOperator\n .setValue(value, true)\n .setName(\"ag-simple-filter-and-or-\".concat(this.getCompId(), \"-\").concat(uniqueGroupId))\n .setLabel(label), index);\n };\n SimpleFilter.prototype.updateJoinOperatorsDisabled = function () {\n var _this = this;\n this.eJoinOperatorsAnd.forEach(function (eJoinOperator, index) { return _this.updateJoinOperatorDisabled(eJoinOperator, index); });\n this.eJoinOperatorsOr.forEach(function (eJoinOperator, index) { return _this.updateJoinOperatorDisabled(eJoinOperator, index); });\n };\n SimpleFilter.prototype.updateJoinOperatorDisabled = function (eJoinOperator, index) {\n eJoinOperator.setDisabled(this.isReadOnly() || index > 0);\n };\n SimpleFilter.prototype.resetInput = function (element) {\n this.setElementValue(element, null);\n this.setElementDisabled(element, this.isReadOnly());\n };\n // puts model values into the UI\n SimpleFilter.prototype.setConditionIntoUi = function (model, position) {\n var _this = this;\n var values = this.mapValuesFromModel(model);\n this.forEachInput(function (element, index, elPosition, _) {\n if (elPosition !== position) {\n return;\n }\n _this.setElementValue(element, values[index] != null ? values[index] : null);\n });\n };\n // after floating filter changes, this sets the 'value' section. this is implemented by the base class\n // (as that's where value is controlled), the 'type' part from the floating filter is dealt with in this class.\n SimpleFilter.prototype.setValueFromFloatingFilter = function (value) {\n var _this = this;\n this.forEachInput(function (element, index, position, _) {\n _this.setElementValue(element, index === 0 && position === 0 ? value : null, true);\n });\n };\n SimpleFilter.prototype.isDefaultOperator = function (operator) {\n return operator === this.defaultJoinOperator;\n };\n SimpleFilter.prototype.addChangedListeners = function (eType, position) {\n var _this = this;\n if (this.isReadOnly()) {\n return;\n }\n eType.onValueChange(this.listener);\n this.forEachPositionInput(position, function (element) {\n _this.attachElementOnChange(element, _this.listener);\n });\n };\n /** returns true if the row passes the said condition */\n SimpleFilter.prototype.individualConditionPasses = function (params, filterModel) {\n var cellValue = this.getCellValue(params.node);\n var values = this.mapValuesFromModel(filterModel);\n var customFilterOption = this.optionsFactory.getCustomOption(filterModel.type);\n var customFilterResult = this.evaluateCustomFilter(customFilterOption, values, cellValue);\n if (customFilterResult != null) {\n return customFilterResult;\n }\n if (cellValue == null) {\n return this.evaluateNullValue(filterModel.type);\n }\n return this.evaluateNonNullValue(values, cellValue, filterModel, params);\n };\n SimpleFilter.prototype.evaluateCustomFilter = function (customFilterOption, values, cellValue) {\n if (customFilterOption == null) {\n return;\n }\n var predicate = customFilterOption.predicate;\n // only execute the custom filter if a value exists or a value isn't required, i.e. input is hidden\n if (predicate != null && !values.some(function (v) { return v == null; })) {\n return predicate(values, cellValue);\n }\n // No custom filter invocation, indicate that to the caller.\n return;\n };\n SimpleFilter.prototype.isBlank = function (cellValue) {\n return cellValue == null ||\n (typeof cellValue === 'string' && cellValue.trim().length === 0);\n };\n SimpleFilter.prototype.hasInvalidInputs = function () {\n return false;\n };\n SimpleFilter.EMPTY = 'empty';\n SimpleFilter.BLANK = 'blank';\n SimpleFilter.NOT_BLANK = 'notBlank';\n SimpleFilter.EQUALS = 'equals';\n SimpleFilter.NOT_EQUAL = 'notEqual';\n SimpleFilter.LESS_THAN = 'lessThan';\n SimpleFilter.LESS_THAN_OR_EQUAL = 'lessThanOrEqual';\n SimpleFilter.GREATER_THAN = 'greaterThan';\n SimpleFilter.GREATER_THAN_OR_EQUAL = 'greaterThanOrEqual';\n SimpleFilter.IN_RANGE = 'inRange';\n SimpleFilter.CONTAINS = 'contains';\n SimpleFilter.NOT_CONTAINS = 'notContains';\n SimpleFilter.STARTS_WITH = 'startsWith';\n SimpleFilter.ENDS_WITH = 'endsWith';\n return SimpleFilter;\n}(ProvidedFilter));\n\nvar __extends$2X = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar ScalarFilter = /** @class */ (function (_super) {\n __extends$2X(ScalarFilter, _super);\n function ScalarFilter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ScalarFilter.prototype.setParams = function (params) {\n _super.prototype.setParams.call(this, params);\n this.scalarFilterParams = params;\n };\n ScalarFilter.prototype.evaluateNullValue = function (filterType) {\n switch (filterType) {\n case ScalarFilter.EQUALS:\n case ScalarFilter.NOT_EQUAL:\n if (this.scalarFilterParams.includeBlanksInEquals) {\n return true;\n }\n break;\n case ScalarFilter.GREATER_THAN:\n case ScalarFilter.GREATER_THAN_OR_EQUAL:\n if (this.scalarFilterParams.includeBlanksInGreaterThan) {\n return true;\n }\n break;\n case ScalarFilter.LESS_THAN:\n case ScalarFilter.LESS_THAN_OR_EQUAL:\n if (this.scalarFilterParams.includeBlanksInLessThan) {\n return true;\n }\n break;\n case ScalarFilter.IN_RANGE:\n if (this.scalarFilterParams.includeBlanksInRange) {\n return true;\n }\n break;\n case ScalarFilter.BLANK:\n return true;\n case ScalarFilter.NOT_BLANK:\n return false;\n }\n return false;\n };\n ScalarFilter.prototype.evaluateNonNullValue = function (values, cellValue, filterModel) {\n var comparator = this.comparator();\n var compareResult = values[0] != null ? comparator(values[0], cellValue) : 0;\n switch (filterModel.type) {\n case ScalarFilter.EQUALS:\n return compareResult === 0;\n case ScalarFilter.NOT_EQUAL:\n return compareResult !== 0;\n case ScalarFilter.GREATER_THAN:\n return compareResult > 0;\n case ScalarFilter.GREATER_THAN_OR_EQUAL:\n return compareResult >= 0;\n case ScalarFilter.LESS_THAN:\n return compareResult < 0;\n case ScalarFilter.LESS_THAN_OR_EQUAL:\n return compareResult <= 0;\n case ScalarFilter.IN_RANGE: {\n var compareToResult = comparator(values[1], cellValue);\n return this.scalarFilterParams.inRangeInclusive ?\n compareResult >= 0 && compareToResult <= 0 :\n compareResult > 0 && compareToResult < 0;\n }\n case ScalarFilter.BLANK:\n return this.isBlank(cellValue);\n case ScalarFilter.NOT_BLANK:\n return !this.isBlank(cellValue);\n default:\n console.warn('AG Grid: Unexpected type of filter \"' + filterModel.type + '\", it looks like the filter was configured with incorrect Filter Options');\n return true;\n }\n };\n return ScalarFilter;\n}(SimpleFilter));\n\nvar __extends$2W = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$l = ( false) || function () {\n __assign$l = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$l.apply(this, arguments);\n};\nvar __decorate$2t = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar DEFAULT_MIN_YEAR = 1000;\nvar DEFAULT_MAX_YEAR = Infinity;\nvar DateFilterModelFormatter = /** @class */ (function (_super) {\n __extends$2W(DateFilterModelFormatter, _super);\n function DateFilterModelFormatter(dateFilterParams, localeService, optionsFactory) {\n var _this = _super.call(this, localeService, optionsFactory) || this;\n _this.dateFilterParams = dateFilterParams;\n return _this;\n }\n DateFilterModelFormatter.prototype.conditionToString = function (condition, options) {\n var type = condition.type;\n var numberOfInputs = (options || {}).numberOfInputs;\n var isRange = type == SimpleFilter.IN_RANGE || numberOfInputs === 2;\n var dateFrom = parseDateTimeFromString(condition.dateFrom);\n var dateTo = parseDateTimeFromString(condition.dateTo);\n var format = this.dateFilterParams.inRangeFloatingFilterDateFormat;\n if (isRange) {\n var formattedFrom = dateFrom !== null ? dateToFormattedString(dateFrom, format) : 'null';\n var formattedTo = dateTo !== null ? dateToFormattedString(dateTo, format) : 'null';\n return \"\".concat(formattedFrom, \"-\").concat(formattedTo);\n }\n if (dateFrom != null) {\n return dateToFormattedString(dateFrom, format);\n }\n // cater for when the type doesn't need a value\n return \"\".concat(type);\n };\n DateFilterModelFormatter.prototype.updateParams = function (params) {\n _super.prototype.updateParams.call(this, params);\n this.dateFilterParams = params.dateFilterParams;\n };\n return DateFilterModelFormatter;\n}(SimpleFilterModelFormatter));\nvar DateFilter = /** @class */ (function (_super) {\n __extends$2W(DateFilter, _super);\n function DateFilter() {\n var _this = _super.call(this, 'dateFilter') || this;\n _this.eConditionPanelsFrom = [];\n _this.eConditionPanelsTo = [];\n _this.dateConditionFromComps = [];\n _this.dateConditionToComps = [];\n _this.minValidYear = DEFAULT_MIN_YEAR;\n _this.maxValidYear = DEFAULT_MAX_YEAR;\n _this.minValidDate = null;\n _this.maxValidDate = null;\n return _this;\n }\n DateFilter.prototype.afterGuiAttached = function (params) {\n _super.prototype.afterGuiAttached.call(this, params);\n this.dateConditionFromComps[0].afterGuiAttached(params);\n };\n DateFilter.prototype.mapValuesFromModel = function (filterModel) {\n // unlike the other filters, we do two things here:\n // 1) allow for different attribute names (same as done for other filters) (eg the 'from' and 'to'\n // are in different locations in Date and Number filter models)\n // 2) convert the type (because Date filter uses Dates, however model is 'string')\n //\n // NOTE: The conversion of string to date also removes the timezone - i.e. when user picks\n // a date from the UI, it will have timezone info in it. This is lost when creating\n // the model. When we recreate the date again here, it's without a timezone.\n var _a = filterModel || {}, dateFrom = _a.dateFrom, dateTo = _a.dateTo, type = _a.type;\n return [\n dateFrom && parseDateTimeFromString(dateFrom) || null,\n dateTo && parseDateTimeFromString(dateTo) || null,\n ].slice(0, this.getNumberOfInputs(type));\n };\n DateFilter.prototype.comparator = function () {\n return this.dateFilterParams.comparator ? this.dateFilterParams.comparator : this.defaultComparator.bind(this);\n };\n DateFilter.prototype.defaultComparator = function (filterDate, cellValue) {\n // The default comparator assumes that the cellValue is a date\n var cellAsDate = cellValue;\n if (cellValue == null || cellAsDate < filterDate) {\n return -1;\n }\n if (cellAsDate > filterDate) {\n return 1;\n }\n return 0;\n };\n DateFilter.prototype.setParams = function (params) {\n this.dateFilterParams = params;\n _super.prototype.setParams.call(this, params);\n var yearParser = function (param, fallback) {\n if (params[param] != null) {\n if (!isNaN(params[param])) {\n return params[param] == null ? fallback : Number(params[param]);\n }\n else {\n console.warn(\"AG Grid: DateFilter \".concat(param, \" is not a number\"));\n }\n }\n return fallback;\n };\n this.minValidYear = yearParser('minValidYear', DEFAULT_MIN_YEAR);\n this.maxValidYear = yearParser('maxValidYear', DEFAULT_MAX_YEAR);\n if (this.minValidYear > this.maxValidYear) {\n console.warn(\"AG Grid: DateFilter minValidYear should be <= maxValidYear\");\n }\n if (params.minValidDate) {\n this.minValidDate = params.minValidDate instanceof Date ? params.minValidDate : parseDateTimeFromString(params.minValidDate);\n }\n else {\n this.minValidDate = null;\n }\n if (params.maxValidDate) {\n this.maxValidDate = params.maxValidDate instanceof Date ? params.maxValidDate : parseDateTimeFromString(params.maxValidDate);\n }\n else {\n this.maxValidDate = null;\n }\n if (this.minValidDate && this.maxValidDate && this.minValidDate > this.maxValidDate) {\n console.warn(\"AG Grid: DateFilter minValidDate should be <= maxValidDate\");\n }\n this.filterModelFormatter = new DateFilterModelFormatter(this.dateFilterParams, this.localeService, this.optionsFactory);\n };\n DateFilter.prototype.createDateCompWrapper = function (element) {\n var _this = this;\n var dateCompWrapper = new DateCompWrapper(this.getContext(), this.userComponentFactory, {\n onDateChanged: function () { return _this.onUiChanged(); },\n filterParams: this.dateFilterParams\n }, element);\n this.addDestroyFunc(function () { return dateCompWrapper.destroy(); });\n return dateCompWrapper;\n };\n DateFilter.prototype.setElementValue = function (element, value) {\n element.setDate(value);\n };\n DateFilter.prototype.setElementDisplayed = function (element, displayed) {\n element.setDisplayed(displayed);\n };\n DateFilter.prototype.setElementDisabled = function (element, disabled) {\n element.setDisabled(disabled);\n };\n DateFilter.prototype.getDefaultFilterOptions = function () {\n return DateFilter.DEFAULT_FILTER_OPTIONS;\n };\n DateFilter.prototype.createValueElement = function () {\n var eCondition = document.createElement('div');\n eCondition.classList.add('ag-filter-body');\n this.createFromToElement(eCondition, this.eConditionPanelsFrom, this.dateConditionFromComps, 'from');\n this.createFromToElement(eCondition, this.eConditionPanelsTo, this.dateConditionToComps, 'to');\n return eCondition;\n };\n DateFilter.prototype.createFromToElement = function (eCondition, eConditionPanels, dateConditionComps, fromTo) {\n var eConditionPanel = document.createElement('div');\n eConditionPanel.classList.add(\"ag-filter-\".concat(fromTo));\n eConditionPanel.classList.add(\"ag-filter-date-\".concat(fromTo));\n eConditionPanels.push(eConditionPanel);\n eCondition.appendChild(eConditionPanel);\n dateConditionComps.push(this.createDateCompWrapper(eConditionPanel));\n };\n DateFilter.prototype.removeValueElements = function (startPosition, deleteCount) {\n this.removeDateComps(this.dateConditionFromComps, startPosition, deleteCount);\n this.removeDateComps(this.dateConditionToComps, startPosition, deleteCount);\n this.removeItems(this.eConditionPanelsFrom, startPosition, deleteCount);\n this.removeItems(this.eConditionPanelsTo, startPosition, deleteCount);\n };\n DateFilter.prototype.removeDateComps = function (components, startPosition, deleteCount) {\n var removedComponents = this.removeItems(components, startPosition, deleteCount);\n removedComponents.forEach(function (comp) { return comp.destroy(); });\n };\n DateFilter.prototype.isValidDateValue = function (value) {\n if (value === null) {\n return false;\n }\n if (this.minValidDate) {\n if (value < this.minValidDate) {\n return false;\n }\n }\n else {\n if (value.getUTCFullYear() < this.minValidYear) {\n return false;\n }\n }\n if (this.maxValidDate) {\n if (value > this.maxValidDate) {\n return false;\n }\n }\n else {\n if (value.getUTCFullYear() > this.maxValidYear) {\n return false;\n }\n }\n return true;\n };\n DateFilter.prototype.isConditionUiComplete = function (position) {\n var _this = this;\n if (!_super.prototype.isConditionUiComplete.call(this, position)) {\n return false;\n }\n var valid = true;\n this.forEachInput(function (element, index, elPosition, numberOfInputs) {\n if (elPosition !== position || !valid || index >= numberOfInputs) {\n return;\n }\n valid = valid && _this.isValidDateValue(element.getDate());\n });\n return valid;\n };\n DateFilter.prototype.areSimpleModelsEqual = function (aSimple, bSimple) {\n return aSimple.dateFrom === bSimple.dateFrom\n && aSimple.dateTo === bSimple.dateTo\n && aSimple.type === bSimple.type;\n };\n DateFilter.prototype.getFilterType = function () {\n return 'date';\n };\n DateFilter.prototype.createCondition = function (position) {\n var type = this.getConditionType(position);\n var model = {};\n var values = this.getValues(position);\n if (values.length > 0) {\n model.dateFrom = serialiseDate(values[0]);\n }\n if (values.length > 1) {\n model.dateTo = serialiseDate(values[1]);\n }\n return __assign$l({ dateFrom: null, dateTo: null, filterType: this.getFilterType(), type: type }, model);\n };\n DateFilter.prototype.resetPlaceholder = function () {\n var globalTranslate = this.localeService.getLocaleTextFunc();\n var placeholder = this.translate('dateFormatOoo');\n var ariaLabel = globalTranslate('ariaFilterValue', 'Filter Value');\n this.forEachInput(function (element) {\n element.setInputPlaceholder(placeholder);\n element.setInputAriaLabel(ariaLabel);\n });\n };\n DateFilter.prototype.getInputs = function (position) {\n if (position >= this.dateConditionFromComps.length) {\n return [null, null];\n }\n return [this.dateConditionFromComps[position], this.dateConditionToComps[position]];\n };\n DateFilter.prototype.getValues = function (position) {\n var result = [];\n this.forEachPositionInput(position, function (element, index, _elPosition, numberOfInputs) {\n if (index < numberOfInputs) {\n result.push(element.getDate());\n }\n });\n return result;\n };\n DateFilter.prototype.translate = function (key) {\n if (key === ScalarFilter.LESS_THAN) {\n return _super.prototype.translate.call(this, 'before');\n }\n if (key === ScalarFilter.GREATER_THAN) {\n return _super.prototype.translate.call(this, 'after');\n }\n return _super.prototype.translate.call(this, key);\n };\n DateFilter.prototype.getModelAsString = function (model) {\n var _a;\n return (_a = this.filterModelFormatter.getModelAsString(model)) !== null && _a !== void 0 ? _a : '';\n };\n DateFilter.DEFAULT_FILTER_OPTIONS = [\n ScalarFilter.EQUALS,\n ScalarFilter.NOT_EQUAL,\n ScalarFilter.LESS_THAN,\n ScalarFilter.GREATER_THAN,\n ScalarFilter.IN_RANGE,\n ScalarFilter.BLANK,\n ScalarFilter.NOT_BLANK,\n ];\n __decorate$2t([\n Autowired('userComponentFactory')\n ], DateFilter.prototype, \"userComponentFactory\", void 0);\n return DateFilter;\n}(ScalarFilter));\n\nvar __extends$2V = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar SimpleFloatingFilter = /** @class */ (function (_super) {\n __extends$2V(SimpleFloatingFilter, _super);\n function SimpleFloatingFilter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SimpleFloatingFilter.prototype.getDefaultDebounceMs = function () {\n return 0;\n };\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n SimpleFloatingFilter.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n SimpleFloatingFilter.prototype.isEventFromFloatingFilter = function (event) {\n return event && event.afterFloatingFilter;\n };\n SimpleFloatingFilter.prototype.isEventFromDataChange = function (event) {\n return event === null || event === void 0 ? void 0 : event.afterDataChange;\n };\n SimpleFloatingFilter.prototype.getLastType = function () {\n return this.lastType;\n };\n SimpleFloatingFilter.prototype.isReadOnly = function () {\n return this.readOnly;\n };\n SimpleFloatingFilter.prototype.setLastTypeFromModel = function (model) {\n // if no model provided by the parent filter use default\n if (!model) {\n this.lastType = this.optionsFactory.getDefaultOption();\n return;\n }\n var isCombined = model.operator;\n var condition;\n if (isCombined) {\n var combinedModel = model;\n condition = combinedModel.conditions[0];\n }\n else {\n condition = model;\n }\n this.lastType = condition.type;\n };\n SimpleFloatingFilter.prototype.canWeEditAfterModelFromParentFilter = function (model) {\n if (!model) {\n // if no model, then we can edit as long as the lastType is something we can edit, as this\n // is the type we will provide to the parent filter if the user decides to use the floating filter.\n return this.isTypeEditable(this.lastType);\n }\n // never allow editing if the filter is combined (ie has two parts)\n var isCombined = model.operator;\n if (isCombined) {\n return false;\n }\n var simpleModel = model;\n return this.isTypeEditable(simpleModel.type);\n };\n SimpleFloatingFilter.prototype.init = function (params) {\n this.setSimpleParams(params, false);\n };\n SimpleFloatingFilter.prototype.setSimpleParams = function (params, update) {\n if (update === void 0) { update = true; }\n this.optionsFactory = new OptionsFactory();\n this.optionsFactory.init(params.filterParams, this.getDefaultFilterOptions());\n // Initial call\n if (!update) {\n this.lastType = this.optionsFactory.getDefaultOption();\n }\n // readOnly is a property of ProvidedFilterParams - we need to find a better (type-safe)\n // way to support reading this in the future.\n this.readOnly = !!params.filterParams.readOnly;\n // we are editable if:\n // 1) there is a type (user has configured filter wrong if not type)\n // AND\n // 2) the default type is not 'inRange'\n var editable = this.isTypeEditable(this.optionsFactory.getDefaultOption());\n this.setEditable(editable);\n };\n SimpleFloatingFilter.prototype.onParamsUpdated = function (params) {\n this.refresh(params);\n };\n SimpleFloatingFilter.prototype.refresh = function (params) {\n this.setSimpleParams(params);\n };\n SimpleFloatingFilter.prototype.doesFilterHaveSingleInput = function (filterType) {\n var customFilterOption = this.optionsFactory.getCustomOption(filterType);\n var numberOfInputs = (customFilterOption || {}).numberOfInputs;\n return numberOfInputs == null || numberOfInputs == 1;\n };\n SimpleFloatingFilter.prototype.isTypeEditable = function (type) {\n var uneditableTypes = [\n SimpleFilter.IN_RANGE, SimpleFilter.EMPTY, SimpleFilter.BLANK, SimpleFilter.NOT_BLANK,\n ];\n return !!type &&\n !this.isReadOnly() &&\n this.doesFilterHaveSingleInput(type) &&\n uneditableTypes.indexOf(type) < 0;\n };\n return SimpleFloatingFilter;\n}(Component));\n\nvar __extends$2U = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2s = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar DateFloatingFilter = /** @class */ (function (_super) {\n __extends$2U(DateFloatingFilter, _super);\n function DateFloatingFilter() {\n return _super.call(this, /* html */ \"\\n
\\n \\n
\\n
\") || this;\n }\n DateFloatingFilter.prototype.getDefaultFilterOptions = function () {\n return DateFilter.DEFAULT_FILTER_OPTIONS;\n };\n DateFloatingFilter.prototype.init = function (params) {\n _super.prototype.init.call(this, params);\n this.params = params;\n this.filterParams = params.filterParams;\n this.createDateComponent();\n this.filterModelFormatter = new DateFilterModelFormatter(this.filterParams, this.localeService, this.optionsFactory);\n var translate = this.localeService.getLocaleTextFunc();\n this.eReadOnlyText\n .setDisabled(true)\n .setInputAriaLabel(translate('ariaDateFilterInput', 'Date Filter Input'));\n };\n DateFloatingFilter.prototype.onParamsUpdated = function (params) {\n this.refresh(params);\n };\n DateFloatingFilter.prototype.refresh = function (params) {\n _super.prototype.refresh.call(this, params);\n this.params = params;\n this.filterParams = params.filterParams;\n this.updateDateComponent();\n this.filterModelFormatter.updateParams({ optionsFactory: this.optionsFactory, dateFilterParams: this.filterParams });\n this.updateCompOnModelChange(params.currentParentModel());\n };\n DateFloatingFilter.prototype.updateCompOnModelChange = function (model) {\n // Update the read-only text field\n var allowEditing = !this.isReadOnly() && this.canWeEditAfterModelFromParentFilter(model);\n this.setEditable(allowEditing);\n if (allowEditing) {\n if (model) {\n var dateModel = model;\n this.dateComp.setDate(parseDateTimeFromString(dateModel.dateFrom));\n }\n else {\n this.dateComp.setDate(null);\n }\n this.eReadOnlyText.setValue('');\n }\n else {\n this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(model));\n this.dateComp.setDate(null);\n }\n };\n DateFloatingFilter.prototype.setEditable = function (editable) {\n setDisplayed(this.eDateWrapper, editable);\n setDisplayed(this.eReadOnlyText.getGui(), !editable);\n };\n DateFloatingFilter.prototype.onParentModelChanged = function (model, event) {\n // We don't want to update the floating filter if the floating filter caused the change,\n // because the UI is already in sync. if we didn't do this, the UI would behave strangely\n // as it would be updating as the user is typing.\n // This is similar for data changes, which don't affect provided date floating filters\n if (this.isEventFromFloatingFilter(event) || this.isEventFromDataChange(event)) {\n return;\n }\n _super.prototype.setLastTypeFromModel.call(this, model);\n this.updateCompOnModelChange(model);\n };\n DateFloatingFilter.prototype.onDateChanged = function () {\n var _this = this;\n var filterValueDate = this.dateComp.getDate();\n var filterValueText = serialiseDate(filterValueDate);\n this.params.parentFilterInstance(function (filterInstance) {\n if (filterInstance) {\n var date = parseDateTimeFromString(filterValueText);\n filterInstance.onFloatingFilterChanged(_this.getLastType() || null, date);\n }\n });\n };\n DateFloatingFilter.prototype.getDateComponentParams = function () {\n var debounceMs = ProvidedFilter.getDebounceMs(this.params.filterParams, this.getDefaultDebounceMs());\n return {\n onDateChanged: debounce(this.onDateChanged.bind(this), debounceMs),\n filterParams: this.params.column.getColDef().filterParams\n };\n };\n DateFloatingFilter.prototype.createDateComponent = function () {\n var _this = this;\n this.dateComp = new DateCompWrapper(this.getContext(), this.userComponentFactory, this.getDateComponentParams(), this.eDateWrapper);\n this.addDestroyFunc(function () { return _this.dateComp.destroy(); });\n };\n DateFloatingFilter.prototype.updateDateComponent = function () {\n var params = this.gridOptionsService.addGridCommonParams(this.getDateComponentParams());\n this.dateComp.updateParams(params);\n };\n DateFloatingFilter.prototype.getFilterModelFormatter = function () {\n return this.filterModelFormatter;\n };\n __decorate$2s([\n Autowired('userComponentFactory')\n ], DateFloatingFilter.prototype, \"userComponentFactory\", void 0);\n __decorate$2s([\n RefSelector('eReadOnlyText')\n ], DateFloatingFilter.prototype, \"eReadOnlyText\", void 0);\n __decorate$2s([\n RefSelector('eDateWrapper')\n ], DateFloatingFilter.prototype, \"eDateWrapper\", void 0);\n return DateFloatingFilter;\n}(SimpleFloatingFilter));\n\nvar __extends$2T = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2r = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$u = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar DefaultDateComponent = /** @class */ (function (_super) {\n __extends$2T(DefaultDateComponent, _super);\n function DefaultDateComponent() {\n return _super.call(this, /* html */ \"\\n
\\n \\n
\") || this;\n }\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n DefaultDateComponent.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n DefaultDateComponent.prototype.init = function (params) {\n var _this = this;\n this.params = params;\n this.setParams(params);\n var eDocument = this.gridOptionsService.getDocument();\n var inputElement = this.eDateInput.getInputElement();\n // ensures that the input element is focussed when a clear button is clicked,\n // unless using safari as there is no clear button and focus does not work properly\n this.addManagedListener(inputElement, 'mousedown', function () {\n if (_this.eDateInput.isDisabled() || _this.usingSafariDatePicker) {\n return;\n }\n inputElement.focus();\n });\n this.addManagedListener(inputElement, 'input', function (e) {\n if (e.target !== eDocument.activeElement) {\n return;\n }\n if (_this.eDateInput.isDisabled()) {\n return;\n }\n _this.params.onDateChanged();\n });\n };\n DefaultDateComponent.prototype.setParams = function (params) {\n var inputElement = this.eDateInput.getInputElement();\n var shouldUseBrowserDatePicker = this.shouldUseBrowserDatePicker(params);\n this.usingSafariDatePicker = shouldUseBrowserDatePicker && isBrowserSafari();\n inputElement.type = shouldUseBrowserDatePicker ? 'date' : 'text';\n var _a = params.filterParams || {}, minValidYear = _a.minValidYear, maxValidYear = _a.maxValidYear, minValidDate = _a.minValidDate, maxValidDate = _a.maxValidDate;\n if (minValidDate && minValidYear) {\n warnOnce('DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored.');\n }\n if (maxValidDate && maxValidYear) {\n warnOnce('DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored.');\n }\n if (minValidDate && maxValidDate) {\n var _b = __read$u([minValidDate, maxValidDate]\n .map(function (v) { return v instanceof Date ? v : parseDateTimeFromString(v); }), 2), parsedMinValidDate = _b[0], parsedMaxValidDate = _b[1];\n if (parsedMinValidDate && parsedMaxValidDate && parsedMinValidDate.getTime() > parsedMaxValidDate.getTime()) {\n warnOnce('DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.');\n }\n }\n if (minValidDate) {\n if (minValidDate instanceof Date) {\n inputElement.min = dateToFormattedString(minValidDate);\n }\n else {\n inputElement.min = minValidDate;\n }\n }\n else {\n if (minValidYear) {\n inputElement.min = \"\".concat(minValidYear, \"-01-01\");\n }\n }\n if (maxValidDate) {\n if (maxValidDate instanceof Date) {\n inputElement.max = dateToFormattedString(maxValidDate);\n }\n else {\n inputElement.max = maxValidDate;\n }\n }\n else {\n if (maxValidYear) {\n inputElement.max = \"\".concat(maxValidYear, \"-12-31\");\n }\n }\n };\n DefaultDateComponent.prototype.onParamsUpdated = function (params) {\n this.refresh(params);\n };\n DefaultDateComponent.prototype.refresh = function (params) {\n this.params = params;\n this.setParams(params);\n };\n DefaultDateComponent.prototype.getDate = function () {\n return parseDateTimeFromString(this.eDateInput.getValue());\n };\n DefaultDateComponent.prototype.setDate = function (date) {\n this.eDateInput.setValue(serialiseDate(date, false));\n };\n DefaultDateComponent.prototype.setInputPlaceholder = function (placeholder) {\n this.eDateInput.setInputPlaceholder(placeholder);\n };\n DefaultDateComponent.prototype.setDisabled = function (disabled) {\n this.eDateInput.setDisabled(disabled);\n };\n DefaultDateComponent.prototype.afterGuiAttached = function (params) {\n if (!params || !params.suppressFocus) {\n this.eDateInput.getInputElement().focus();\n }\n };\n DefaultDateComponent.prototype.shouldUseBrowserDatePicker = function (params) {\n if (params.filterParams && params.filterParams.browserDatePicker != null) {\n return params.filterParams.browserDatePicker;\n }\n return isBrowserChrome() || isBrowserFirefox() || (isBrowserSafari() && getSafariVersion() >= 14.1);\n };\n __decorate$2r([\n RefSelector('eDateInput')\n ], DefaultDateComponent.prototype, \"eDateInput\", void 0);\n return DefaultDateComponent;\n}(Component));\n\nvar __extends$2S = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar AgInputTextField = /** @class */ (function (_super) {\n __extends$2S(AgInputTextField, _super);\n function AgInputTextField(config, className, inputType) {\n if (className === void 0) { className = 'ag-text-field'; }\n if (inputType === void 0) { inputType = 'text'; }\n return _super.call(this, config, className, inputType) || this;\n }\n AgInputTextField.prototype.postConstruct = function () {\n _super.prototype.postConstruct.call(this);\n if (this.config.allowedCharPattern) {\n this.preventDisallowedCharacters();\n }\n };\n AgInputTextField.prototype.setValue = function (value, silent) {\n // update the input before we call super.setValue, so it's updated before the value changed event is fired\n if (this.eInput.value !== value) {\n this.eInput.value = exists(value) ? value : '';\n }\n return _super.prototype.setValue.call(this, value, silent);\n };\n /** Used to set an initial value into the input without necessarily setting `this.value` or triggering events (e.g. to set an invalid value) */\n AgInputTextField.prototype.setStartValue = function (value) {\n this.setValue(value, true);\n };\n AgInputTextField.prototype.preventDisallowedCharacters = function () {\n var pattern = new RegExp(\"[\".concat(this.config.allowedCharPattern, \"]\"));\n var preventCharacters = function (event) {\n if (!isEventFromPrintableCharacter(event)) {\n return;\n }\n if (event.key && !pattern.test(event.key)) {\n event.preventDefault();\n }\n };\n this.addManagedListener(this.eInput, 'keydown', preventCharacters);\n this.addManagedListener(this.eInput, 'paste', function (e) {\n var _a;\n var text = (_a = e.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text');\n if (text && text.split('').some(function (c) { return !pattern.test(c); })) {\n e.preventDefault();\n }\n });\n };\n return AgInputTextField;\n}(AgAbstractInputField));\n\nvar __extends$2R = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar AgInputNumberField = /** @class */ (function (_super) {\n __extends$2R(AgInputNumberField, _super);\n function AgInputNumberField(config) {\n return _super.call(this, config, 'ag-number-field', 'number') || this;\n }\n AgInputNumberField.prototype.postConstruct = function () {\n var _this = this;\n _super.prototype.postConstruct.call(this);\n this.addManagedListener(this.eInput, 'blur', function () {\n var floatedValue = parseFloat(_this.eInput.value);\n var value = isNaN(floatedValue) ? '' : _this.normalizeValue(floatedValue.toString());\n if (_this.value !== value) {\n _this.setValue(value);\n }\n });\n this.addManagedListener(this.eInput, 'wheel', this.onWheel.bind(this));\n this.eInput.step = 'any';\n };\n AgInputNumberField.prototype.onWheel = function (e) {\n // Prevent default scroll events from incrementing / decrementing the input, since its inconsistent between browsers\n if (document.activeElement === this.eInput) {\n e.preventDefault();\n }\n };\n AgInputNumberField.prototype.normalizeValue = function (value) {\n if (value === '') {\n return '';\n }\n if (this.precision != null) {\n value = this.adjustPrecision(value);\n }\n var val = parseFloat(value);\n if (this.min != null && val < this.min) {\n value = this.min.toString();\n }\n else if (this.max != null && val > this.max) {\n value = this.max.toString();\n }\n return value;\n };\n AgInputNumberField.prototype.adjustPrecision = function (value, isScientificNotation) {\n if (this.precision == null) {\n return value;\n }\n if (isScientificNotation) {\n var floatString = parseFloat(value).toFixed(this.precision);\n return parseFloat(floatString).toString();\n }\n // can't use toFixed here because we don't want to round up\n var parts = String(value).split('.');\n if (parts.length > 1) {\n if (parts[1].length <= this.precision) {\n return value;\n }\n else if (this.precision > 0) {\n return \"\".concat(parts[0], \".\").concat(parts[1].slice(0, this.precision));\n }\n }\n return parts[0];\n };\n AgInputNumberField.prototype.setMin = function (min) {\n if (this.min === min) {\n return this;\n }\n this.min = min;\n addOrRemoveAttribute(this.eInput, 'min', min);\n return this;\n };\n AgInputNumberField.prototype.setMax = function (max) {\n if (this.max === max) {\n return this;\n }\n this.max = max;\n addOrRemoveAttribute(this.eInput, 'max', max);\n return this;\n };\n AgInputNumberField.prototype.setPrecision = function (precision) {\n this.precision = precision;\n return this;\n };\n AgInputNumberField.prototype.setStep = function (step) {\n if (this.step === step) {\n return this;\n }\n this.step = step;\n addOrRemoveAttribute(this.eInput, 'step', step);\n return this;\n };\n AgInputNumberField.prototype.setValue = function (value, silent) {\n var _this = this;\n return this.setValueOrInputValue(function (v) { return _super.prototype.setValue.call(_this, v, silent); }, function () { return _this; }, value);\n };\n AgInputNumberField.prototype.setStartValue = function (value) {\n var _this = this;\n return this.setValueOrInputValue(function (v) { return _super.prototype.setValue.call(_this, v, true); }, function (v) { _this.eInput.value = v; }, value);\n };\n AgInputNumberField.prototype.setValueOrInputValue = function (setValueFunc, setInputValueOnlyFunc, value) {\n if (exists(value)) {\n // need to maintain the scientific notation format whilst typing (e.g. 1e10)\n var setInputValueOnly = this.isScientificNotation(value);\n if (setInputValueOnly && this.eInput.validity.valid) {\n return setValueFunc(value);\n }\n if (!setInputValueOnly) {\n value = this.adjustPrecision(value);\n var normalizedValue = this.normalizeValue(value);\n // outside of valid range\n setInputValueOnly = value != normalizedValue;\n }\n if (setInputValueOnly) {\n return setInputValueOnlyFunc(value);\n }\n }\n return setValueFunc(value);\n };\n AgInputNumberField.prototype.getValue = function () {\n if (!this.eInput.validity.valid) {\n return undefined;\n }\n var inputValue = this.eInput.value;\n if (this.isScientificNotation(inputValue)) {\n return this.adjustPrecision(inputValue, true);\n }\n return _super.prototype.getValue.call(this);\n };\n AgInputNumberField.prototype.isScientificNotation = function (value) {\n return typeof value === 'string' && value.includes('e');\n };\n return AgInputNumberField;\n}(AgInputTextField));\n\nvar __extends$2Q = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar NumberFilterModelFormatter = /** @class */ (function (_super) {\n __extends$2Q(NumberFilterModelFormatter, _super);\n function NumberFilterModelFormatter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NumberFilterModelFormatter.prototype.conditionToString = function (condition, options) {\n var numberOfInputs = (options || {}).numberOfInputs;\n var isRange = condition.type == SimpleFilter.IN_RANGE || numberOfInputs === 2;\n if (isRange) {\n return \"\".concat(this.formatValue(condition.filter), \"-\").concat(this.formatValue(condition.filterTo));\n }\n // cater for when the type doesn't need a value\n if (condition.filter != null) {\n return this.formatValue(condition.filter);\n }\n return \"\".concat(condition.type);\n };\n return NumberFilterModelFormatter;\n}(SimpleFilterModelFormatter));\nfunction getAllowedCharPattern(filterParams) {\n var allowedCharPattern = (filterParams !== null && filterParams !== void 0 ? filterParams : {}).allowedCharPattern;\n return allowedCharPattern !== null && allowedCharPattern !== void 0 ? allowedCharPattern : null;\n}\nvar NumberFilter = /** @class */ (function (_super) {\n __extends$2Q(NumberFilter, _super);\n function NumberFilter() {\n var _this = _super.call(this, 'numberFilter') || this;\n _this.eValuesFrom = [];\n _this.eValuesTo = [];\n return _this;\n }\n NumberFilter.prototype.refresh = function (params) {\n if (this.numberFilterParams.allowedCharPattern !== params.allowedCharPattern) {\n return false;\n }\n return _super.prototype.refresh.call(this, params);\n };\n NumberFilter.prototype.mapValuesFromModel = function (filterModel) {\n var _a = filterModel || {}, filter = _a.filter, filterTo = _a.filterTo, type = _a.type;\n return [\n this.processValue(filter),\n this.processValue(filterTo),\n ].slice(0, this.getNumberOfInputs(type));\n };\n NumberFilter.prototype.getDefaultDebounceMs = function () {\n return 500;\n };\n NumberFilter.prototype.comparator = function () {\n return function (left, right) {\n if (left === right) {\n return 0;\n }\n return left < right ? 1 : -1;\n };\n };\n NumberFilter.prototype.setParams = function (params) {\n this.numberFilterParams = params;\n _super.prototype.setParams.call(this, params);\n this.filterModelFormatter = new NumberFilterModelFormatter(this.localeService, this.optionsFactory, this.numberFilterParams.numberFormatter);\n };\n NumberFilter.prototype.getDefaultFilterOptions = function () {\n return NumberFilter.DEFAULT_FILTER_OPTIONS;\n };\n NumberFilter.prototype.setElementValue = function (element, value, fromFloatingFilter) {\n // values from floating filter are directly from the input, not from the model\n var valueToSet = !fromFloatingFilter && this.numberFilterParams.numberFormatter\n ? this.numberFilterParams.numberFormatter(value !== null && value !== void 0 ? value : null)\n : value;\n _super.prototype.setElementValue.call(this, element, valueToSet);\n };\n NumberFilter.prototype.createValueElement = function () {\n var allowedCharPattern = getAllowedCharPattern(this.numberFilterParams);\n var eCondition = document.createElement('div');\n eCondition.classList.add('ag-filter-body');\n setAriaRole(eCondition, 'presentation');\n this.createFromToElement(eCondition, this.eValuesFrom, 'from', allowedCharPattern);\n this.createFromToElement(eCondition, this.eValuesTo, 'to', allowedCharPattern);\n return eCondition;\n };\n NumberFilter.prototype.createFromToElement = function (eCondition, eValues, fromTo, allowedCharPattern) {\n var eValue = this.createManagedBean(allowedCharPattern ? new AgInputTextField({ allowedCharPattern: allowedCharPattern }) : new AgInputNumberField());\n eValue.addCssClass(\"ag-filter-\".concat(fromTo));\n eValue.addCssClass('ag-filter-filter');\n eValues.push(eValue);\n eCondition.appendChild(eValue.getGui());\n };\n NumberFilter.prototype.removeValueElements = function (startPosition, deleteCount) {\n this.removeComponents(this.eValuesFrom, startPosition, deleteCount);\n this.removeComponents(this.eValuesTo, startPosition, deleteCount);\n };\n NumberFilter.prototype.getValues = function (position) {\n var _this = this;\n var result = [];\n this.forEachPositionInput(position, function (element, index, _elPosition, numberOfInputs) {\n if (index < numberOfInputs) {\n result.push(_this.processValue(_this.stringToFloat(element.getValue())));\n }\n });\n return result;\n };\n NumberFilter.prototype.areSimpleModelsEqual = function (aSimple, bSimple) {\n return aSimple.filter === bSimple.filter\n && aSimple.filterTo === bSimple.filterTo\n && aSimple.type === bSimple.type;\n };\n NumberFilter.prototype.getFilterType = function () {\n return 'number';\n };\n NumberFilter.prototype.processValue = function (value) {\n if (value == null) {\n return null;\n }\n return isNaN(value) ? null : value;\n };\n NumberFilter.prototype.stringToFloat = function (value) {\n if (typeof value === 'number') {\n return value;\n }\n var filterText = makeNull(value);\n if (filterText != null && filterText.trim() === '') {\n filterText = null;\n }\n if (this.numberFilterParams.numberParser) {\n return this.numberFilterParams.numberParser(filterText);\n }\n return filterText == null || filterText.trim() === '-' ? null : parseFloat(filterText);\n };\n NumberFilter.prototype.createCondition = function (position) {\n var type = this.getConditionType(position);\n var model = {\n filterType: this.getFilterType(),\n type: type\n };\n var values = this.getValues(position);\n if (values.length > 0) {\n model.filter = values[0];\n }\n if (values.length > 1) {\n model.filterTo = values[1];\n }\n return model;\n };\n NumberFilter.prototype.getInputs = function (position) {\n if (position >= this.eValuesFrom.length) {\n return [null, null];\n }\n return [this.eValuesFrom[position], this.eValuesTo[position]];\n };\n NumberFilter.prototype.getModelAsString = function (model) {\n var _a;\n return (_a = this.filterModelFormatter.getModelAsString(model)) !== null && _a !== void 0 ? _a : '';\n };\n NumberFilter.prototype.hasInvalidInputs = function () {\n var invalidInputs = false;\n this.forEachInput(function (element) {\n if (!element.getInputElement().validity.valid) {\n invalidInputs = true;\n return;\n }\n });\n return invalidInputs;\n };\n NumberFilter.DEFAULT_FILTER_OPTIONS = [\n ScalarFilter.EQUALS,\n ScalarFilter.NOT_EQUAL,\n ScalarFilter.GREATER_THAN,\n ScalarFilter.GREATER_THAN_OR_EQUAL,\n ScalarFilter.LESS_THAN,\n ScalarFilter.LESS_THAN_OR_EQUAL,\n ScalarFilter.IN_RANGE,\n ScalarFilter.BLANK,\n ScalarFilter.NOT_BLANK,\n ];\n return NumberFilter;\n}(ScalarFilter));\n\nvar __extends$2P = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$k = ( false) || function () {\n __assign$k = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$k.apply(this, arguments);\n};\nvar TextFilterModelFormatter = /** @class */ (function (_super) {\n __extends$2P(TextFilterModelFormatter, _super);\n function TextFilterModelFormatter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TextFilterModelFormatter.prototype.conditionToString = function (condition, options) {\n var numberOfInputs = (options || {}).numberOfInputs;\n var isRange = condition.type == SimpleFilter.IN_RANGE || numberOfInputs === 2;\n if (isRange) {\n return \"\".concat(condition.filter, \"-\").concat(condition.filterTo);\n }\n // cater for when the type doesn't need a value\n if (condition.filter != null) {\n return \"\".concat(condition.filter);\n }\n return \"\".concat(condition.type);\n };\n return TextFilterModelFormatter;\n}(SimpleFilterModelFormatter));\nvar TextFilter = /** @class */ (function (_super) {\n __extends$2P(TextFilter, _super);\n function TextFilter() {\n var _this = _super.call(this, 'textFilter') || this;\n _this.eValuesFrom = [];\n _this.eValuesTo = [];\n return _this;\n }\n TextFilter.trimInput = function (value) {\n var trimmedInput = value && value.trim();\n // trim the input, unless it is all whitespace (this is consistent with Excel behaviour)\n return trimmedInput === '' ? value : trimmedInput;\n };\n TextFilter.prototype.getDefaultDebounceMs = function () {\n return 500;\n };\n TextFilter.prototype.setParams = function (params) {\n this.textFilterParams = params;\n _super.prototype.setParams.call(this, params);\n this.matcher = this.getTextMatcher();\n this.formatter = this.textFilterParams.textFormatter ||\n (this.textFilterParams.caseSensitive ? TextFilter.DEFAULT_FORMATTER : TextFilter.DEFAULT_LOWERCASE_FORMATTER);\n this.filterModelFormatter = new TextFilterModelFormatter(this.localeService, this.optionsFactory);\n };\n TextFilter.prototype.getTextMatcher = function () {\n var legacyComparator = this.textFilterParams.textCustomComparator;\n if (legacyComparator) {\n _.warnOnce('textCustomComparator is deprecated, use textMatcher instead.');\n return function (_a) {\n var filterOption = _a.filterOption, value = _a.value, filterText = _a.filterText;\n return legacyComparator(filterOption, value, filterText);\n };\n }\n return this.textFilterParams.textMatcher || TextFilter.DEFAULT_MATCHER;\n };\n TextFilter.prototype.createCondition = function (position) {\n var type = this.getConditionType(position);\n var model = {\n filterType: this.getFilterType(),\n type: type,\n };\n var values = this.getValuesWithSideEffects(position, true);\n if (values.length > 0) {\n model.filter = values[0];\n }\n if (values.length > 1) {\n model.filterTo = values[1];\n }\n return model;\n };\n TextFilter.prototype.getFilterType = function () {\n return 'text';\n };\n TextFilter.prototype.areSimpleModelsEqual = function (aSimple, bSimple) {\n return aSimple.filter === bSimple.filter &&\n aSimple.filterTo === bSimple.filterTo &&\n aSimple.type === bSimple.type;\n };\n TextFilter.prototype.getInputs = function (position) {\n if (position >= this.eValuesFrom.length) {\n return [null, null];\n }\n return [this.eValuesFrom[position], this.eValuesTo[position]];\n };\n TextFilter.prototype.getValues = function (position) {\n return this.getValuesWithSideEffects(position, false);\n };\n TextFilter.prototype.getValuesWithSideEffects = function (position, applySideEffects) {\n var _this = this;\n var result = [];\n this.forEachPositionInput(position, function (element, index, _elPosition, numberOfInputs) {\n var _a;\n if (index < numberOfInputs) {\n var value = makeNull(element.getValue());\n if (applySideEffects && _this.textFilterParams.trimInput) {\n value = (_a = TextFilter.trimInput(value)) !== null && _a !== void 0 ? _a : null;\n element.setValue(value, true); // ensure clean value is visible\n }\n result.push(value);\n }\n });\n return result;\n };\n TextFilter.prototype.getDefaultFilterOptions = function () {\n return TextFilter.DEFAULT_FILTER_OPTIONS;\n };\n TextFilter.prototype.createValueElement = function () {\n var eCondition = document.createElement('div');\n eCondition.classList.add('ag-filter-body');\n setAriaRole(eCondition, 'presentation');\n this.createFromToElement(eCondition, this.eValuesFrom, 'from');\n this.createFromToElement(eCondition, this.eValuesTo, 'to');\n return eCondition;\n };\n TextFilter.prototype.createFromToElement = function (eCondition, eValues, fromTo) {\n var eValue = this.createManagedBean(new AgInputTextField());\n eValue.addCssClass(\"ag-filter-\".concat(fromTo));\n eValue.addCssClass('ag-filter-filter');\n eValues.push(eValue);\n eCondition.appendChild(eValue.getGui());\n };\n TextFilter.prototype.removeValueElements = function (startPosition, deleteCount) {\n this.removeComponents(this.eValuesFrom, startPosition, deleteCount);\n this.removeComponents(this.eValuesTo, startPosition, deleteCount);\n };\n TextFilter.prototype.mapValuesFromModel = function (filterModel) {\n var _a = filterModel || {}, filter = _a.filter, filterTo = _a.filterTo, type = _a.type;\n return [\n filter || null,\n filterTo || null,\n ].slice(0, this.getNumberOfInputs(type));\n };\n TextFilter.prototype.evaluateNullValue = function (filterType) {\n var filterTypesAllowNulls = [\n SimpleFilter.NOT_EQUAL, SimpleFilter.NOT_CONTAINS, SimpleFilter.BLANK,\n ];\n return filterType ? filterTypesAllowNulls.indexOf(filterType) >= 0 : false;\n };\n TextFilter.prototype.evaluateNonNullValue = function (values, cellValue, filterModel, params) {\n var _this = this;\n var formattedValues = values.map(function (v) { return _this.formatter(v); }) || [];\n var cellValueFormatted = this.formatter(cellValue);\n var _a = this.textFilterParams, api = _a.api, colDef = _a.colDef, column = _a.column, columnApi = _a.columnApi, context = _a.context, textFormatter = _a.textFormatter;\n if (filterModel.type === SimpleFilter.BLANK) {\n return this.isBlank(cellValue);\n }\n else if (filterModel.type === SimpleFilter.NOT_BLANK) {\n return !this.isBlank(cellValue);\n }\n var matcherParams = {\n api: api,\n colDef: colDef,\n column: column,\n columnApi: columnApi,\n context: context,\n node: params.node,\n data: params.data,\n filterOption: filterModel.type,\n value: cellValueFormatted,\n textFormatter: textFormatter,\n };\n return formattedValues.some(function (v) { return _this.matcher(__assign$k(__assign$k({}, matcherParams), { filterText: v })); });\n };\n TextFilter.prototype.getModelAsString = function (model) {\n var _a;\n return (_a = this.filterModelFormatter.getModelAsString(model)) !== null && _a !== void 0 ? _a : '';\n };\n TextFilter.DEFAULT_FILTER_OPTIONS = [\n SimpleFilter.CONTAINS,\n SimpleFilter.NOT_CONTAINS,\n SimpleFilter.EQUALS,\n SimpleFilter.NOT_EQUAL,\n SimpleFilter.STARTS_WITH,\n SimpleFilter.ENDS_WITH,\n SimpleFilter.BLANK,\n SimpleFilter.NOT_BLANK,\n ];\n TextFilter.DEFAULT_FORMATTER = function (from) { return from; };\n TextFilter.DEFAULT_LOWERCASE_FORMATTER = function (from) { return from == null ? null : from.toString().toLowerCase(); };\n TextFilter.DEFAULT_MATCHER = function (_a) {\n var filterOption = _a.filterOption, value = _a.value, filterText = _a.filterText;\n if (filterText == null) {\n return false;\n }\n switch (filterOption) {\n case TextFilter.CONTAINS:\n return value.indexOf(filterText) >= 0;\n case TextFilter.NOT_CONTAINS:\n return value.indexOf(filterText) < 0;\n case TextFilter.EQUALS:\n return value === filterText;\n case TextFilter.NOT_EQUAL:\n return value != filterText;\n case TextFilter.STARTS_WITH:\n return value.indexOf(filterText) === 0;\n case TextFilter.ENDS_WITH:\n var index = value.lastIndexOf(filterText);\n return index >= 0 && index === (value.length - filterText.length);\n default:\n return false;\n }\n };\n return TextFilter;\n}(SimpleFilter));\n\nvar __extends$2O = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2q = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar FloatingFilterTextInputService = /** @class */ (function (_super) {\n __extends$2O(FloatingFilterTextInputService, _super);\n function FloatingFilterTextInputService(params) {\n var _this = _super.call(this) || this;\n _this.params = params;\n _this.valueChangedListener = function () { };\n return _this;\n }\n FloatingFilterTextInputService.prototype.setupGui = function (parentElement) {\n var _this = this;\n var _a;\n this.eFloatingFilterTextInput = this.createManagedBean(new AgInputTextField((_a = this.params) === null || _a === void 0 ? void 0 : _a.config));\n var eInput = this.eFloatingFilterTextInput.getGui();\n parentElement.appendChild(eInput);\n this.addManagedListener(eInput, 'input', function (e) { return _this.valueChangedListener(e); });\n this.addManagedListener(eInput, 'keydown', function (e) { return _this.valueChangedListener(e); });\n };\n FloatingFilterTextInputService.prototype.setEditable = function (editable) {\n this.eFloatingFilterTextInput.setDisabled(!editable);\n };\n FloatingFilterTextInputService.prototype.setAutoComplete = function (autoComplete) {\n this.eFloatingFilterTextInput.setAutoComplete(autoComplete);\n };\n FloatingFilterTextInputService.prototype.getValue = function () {\n return this.eFloatingFilterTextInput.getValue();\n };\n FloatingFilterTextInputService.prototype.setValue = function (value, silent) {\n this.eFloatingFilterTextInput.setValue(value, silent);\n };\n FloatingFilterTextInputService.prototype.setValueChangedListener = function (listener) {\n this.valueChangedListener = listener;\n };\n FloatingFilterTextInputService.prototype.setParams = function (params) {\n this.setAriaLabel(params.ariaLabel);\n if (params.autoComplete !== undefined) {\n this.setAutoComplete(params.autoComplete);\n }\n };\n FloatingFilterTextInputService.prototype.setAriaLabel = function (ariaLabel) {\n this.eFloatingFilterTextInput.setInputAriaLabel(ariaLabel);\n };\n return FloatingFilterTextInputService;\n}(BeanStub));\nvar TextInputFloatingFilter = /** @class */ (function (_super) {\n __extends$2O(TextInputFloatingFilter, _super);\n function TextInputFloatingFilter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TextInputFloatingFilter.prototype.postConstruct = function () {\n this.setTemplate(/* html */ \"\\n
\\n \");\n };\n TextInputFloatingFilter.prototype.getDefaultDebounceMs = function () {\n return 500;\n };\n TextInputFloatingFilter.prototype.onParentModelChanged = function (model, event) {\n if (this.isEventFromFloatingFilter(event) || this.isEventFromDataChange(event)) {\n // if the floating filter triggered the change, it is already in sync.\n // Data changes also do not affect provided text floating filters\n return;\n }\n this.setLastTypeFromModel(model);\n this.setEditable(this.canWeEditAfterModelFromParentFilter(model));\n this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(model));\n };\n TextInputFloatingFilter.prototype.init = function (params) {\n this.setupFloatingFilterInputService(params);\n _super.prototype.init.call(this, params);\n this.setTextInputParams(params);\n };\n TextInputFloatingFilter.prototype.setupFloatingFilterInputService = function (params) {\n this.floatingFilterInputService = this.createFloatingFilterInputService(params);\n this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer);\n };\n TextInputFloatingFilter.prototype.setTextInputParams = function (params) {\n var _a;\n this.params = params;\n var autoComplete = (_a = params.browserAutoComplete) !== null && _a !== void 0 ? _a : false;\n this.floatingFilterInputService.setParams({\n ariaLabel: this.getAriaLabel(params),\n autoComplete: autoComplete,\n });\n this.applyActive = ProvidedFilter.isUseApplyButton(this.params.filterParams);\n if (!this.isReadOnly()) {\n var debounceMs = ProvidedFilter.getDebounceMs(this.params.filterParams, this.getDefaultDebounceMs());\n var toDebounce = debounce(this.syncUpWithParentFilter.bind(this), debounceMs);\n this.floatingFilterInputService.setValueChangedListener(toDebounce);\n }\n };\n TextInputFloatingFilter.prototype.onParamsUpdated = function (params) {\n this.refresh(params);\n };\n TextInputFloatingFilter.prototype.refresh = function (params) {\n _super.prototype.refresh.call(this, params);\n this.setTextInputParams(params);\n };\n TextInputFloatingFilter.prototype.recreateFloatingFilterInputService = function (params) {\n var value = this.floatingFilterInputService.getValue();\n clearElement(this.eFloatingFilterInputContainer);\n this.destroyBean(this.floatingFilterInputService);\n this.setupFloatingFilterInputService(params);\n this.floatingFilterInputService.setValue(value, true);\n };\n TextInputFloatingFilter.prototype.getAriaLabel = function (params) {\n var displayName = this.columnModel.getDisplayNameForColumn(params.column, 'header', true);\n var translate = this.localeService.getLocaleTextFunc();\n return \"\".concat(displayName, \" \").concat(translate('ariaFilterInput', 'Filter Input'));\n };\n TextInputFloatingFilter.prototype.syncUpWithParentFilter = function (e) {\n var _this = this;\n var isEnterKey = e.key === KeyCode.ENTER;\n if (this.applyActive && !isEnterKey) {\n return;\n }\n var value = this.floatingFilterInputService.getValue();\n if (this.params.filterParams.trimInput) {\n value = TextFilter.trimInput(value);\n this.floatingFilterInputService.setValue(value, true); // ensure visible value is trimmed\n }\n this.params.parentFilterInstance(function (filterInstance) {\n if (filterInstance) {\n // NumberFilter is typed as number, but actually receives string values\n filterInstance.onFloatingFilterChanged(_this.getLastType() || null, value || null);\n }\n });\n };\n TextInputFloatingFilter.prototype.setEditable = function (editable) {\n this.floatingFilterInputService.setEditable(editable);\n };\n __decorate$2q([\n Autowired('columnModel')\n ], TextInputFloatingFilter.prototype, \"columnModel\", void 0);\n __decorate$2q([\n RefSelector('eFloatingFilterInputContainer')\n ], TextInputFloatingFilter.prototype, \"eFloatingFilterInputContainer\", void 0);\n __decorate$2q([\n PostConstruct\n ], TextInputFloatingFilter.prototype, \"postConstruct\", null);\n return TextInputFloatingFilter;\n}(SimpleFloatingFilter));\n\nvar __extends$2N = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar FloatingFilterNumberInputService = /** @class */ (function (_super) {\n __extends$2N(FloatingFilterNumberInputService, _super);\n function FloatingFilterNumberInputService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.valueChangedListener = function () { };\n _this.numberInputActive = true;\n return _this;\n }\n FloatingFilterNumberInputService.prototype.setupGui = function (parentElement) {\n var _this = this;\n this.eFloatingFilterNumberInput = this.createManagedBean(new AgInputNumberField());\n this.eFloatingFilterTextInput = this.createManagedBean(new AgInputTextField());\n this.eFloatingFilterTextInput.setDisabled(true);\n var eNumberInput = this.eFloatingFilterNumberInput.getGui();\n var eTextInput = this.eFloatingFilterTextInput.getGui();\n parentElement.appendChild(eNumberInput);\n parentElement.appendChild(eTextInput);\n this.setupListeners(eNumberInput, function (e) { return _this.valueChangedListener(e); });\n this.setupListeners(eTextInput, function (e) { return _this.valueChangedListener(e); });\n };\n FloatingFilterNumberInputService.prototype.setEditable = function (editable) {\n this.numberInputActive = editable;\n this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive);\n this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive);\n };\n FloatingFilterNumberInputService.prototype.setAutoComplete = function (autoComplete) {\n this.eFloatingFilterNumberInput.setAutoComplete(autoComplete);\n this.eFloatingFilterTextInput.setAutoComplete(autoComplete);\n };\n FloatingFilterNumberInputService.prototype.getValue = function () {\n return this.getActiveInputElement().getValue();\n };\n FloatingFilterNumberInputService.prototype.setValue = function (value, silent) {\n this.getActiveInputElement().setValue(value, silent);\n };\n FloatingFilterNumberInputService.prototype.getActiveInputElement = function () {\n return this.numberInputActive ? this.eFloatingFilterNumberInput : this.eFloatingFilterTextInput;\n };\n FloatingFilterNumberInputService.prototype.setValueChangedListener = function (listener) {\n this.valueChangedListener = listener;\n };\n FloatingFilterNumberInputService.prototype.setupListeners = function (element, listener) {\n this.addManagedListener(element, 'input', listener);\n this.addManagedListener(element, 'keydown', listener);\n };\n FloatingFilterNumberInputService.prototype.setParams = function (params) {\n this.setAriaLabel(params.ariaLabel);\n if (params.autoComplete !== undefined) {\n this.setAutoComplete(params.autoComplete);\n }\n };\n FloatingFilterNumberInputService.prototype.setAriaLabel = function (ariaLabel) {\n this.eFloatingFilterNumberInput.setInputAriaLabel(ariaLabel);\n this.eFloatingFilterTextInput.setInputAriaLabel(ariaLabel);\n };\n return FloatingFilterNumberInputService;\n}(BeanStub));\nvar NumberFloatingFilter = /** @class */ (function (_super) {\n __extends$2N(NumberFloatingFilter, _super);\n function NumberFloatingFilter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NumberFloatingFilter.prototype.init = function (params) {\n var _a;\n _super.prototype.init.call(this, params);\n this.filterModelFormatter = new NumberFilterModelFormatter(this.localeService, this.optionsFactory, (_a = params.filterParams) === null || _a === void 0 ? void 0 : _a.numberFormatter);\n };\n NumberFloatingFilter.prototype.onParamsUpdated = function (params) {\n this.refresh(params);\n };\n NumberFloatingFilter.prototype.refresh = function (params) {\n var allowedCharPattern = getAllowedCharPattern(params.filterParams);\n if (allowedCharPattern !== this.allowedCharPattern) {\n this.recreateFloatingFilterInputService(params);\n }\n _super.prototype.refresh.call(this, params);\n this.filterModelFormatter.updateParams({ optionsFactory: this.optionsFactory });\n };\n NumberFloatingFilter.prototype.getDefaultFilterOptions = function () {\n return NumberFilter.DEFAULT_FILTER_OPTIONS;\n };\n NumberFloatingFilter.prototype.getFilterModelFormatter = function () {\n return this.filterModelFormatter;\n };\n NumberFloatingFilter.prototype.createFloatingFilterInputService = function (params) {\n this.allowedCharPattern = getAllowedCharPattern(params.filterParams);\n if (this.allowedCharPattern) {\n // need to use text input\n return this.createManagedBean(new FloatingFilterTextInputService({\n config: { allowedCharPattern: this.allowedCharPattern },\n }));\n }\n return this.createManagedBean(new FloatingFilterNumberInputService());\n };\n return NumberFloatingFilter;\n}(TextInputFloatingFilter));\n\nvar __extends$2M = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar TextFloatingFilter = /** @class */ (function (_super) {\n __extends$2M(TextFloatingFilter, _super);\n function TextFloatingFilter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TextFloatingFilter.prototype.init = function (params) {\n _super.prototype.init.call(this, params);\n this.filterModelFormatter = new TextFilterModelFormatter(this.localeService, this.optionsFactory);\n };\n TextFloatingFilter.prototype.onParamsUpdated = function (params) {\n this.refresh(params);\n };\n TextFloatingFilter.prototype.refresh = function (params) {\n _super.prototype.refresh.call(this, params);\n this.filterModelFormatter.updateParams({ optionsFactory: this.optionsFactory });\n };\n TextFloatingFilter.prototype.getDefaultFilterOptions = function () {\n return TextFilter.DEFAULT_FILTER_OPTIONS;\n };\n TextFloatingFilter.prototype.getFilterModelFormatter = function () {\n return this.filterModelFormatter;\n };\n TextFloatingFilter.prototype.createFloatingFilterInputService = function () {\n return this.createManagedBean(new FloatingFilterTextInputService());\n };\n return TextFloatingFilter;\n}(TextInputFloatingFilter));\n\nvar TouchListener = /** @class */ (function () {\n function TouchListener(eElement, preventMouseClick) {\n if (preventMouseClick === void 0) { preventMouseClick = false; }\n var _this = this;\n this.destroyFuncs = [];\n this.touching = false;\n this.eventService = new EventService();\n this.eElement = eElement;\n this.preventMouseClick = preventMouseClick;\n var startListener = this.onTouchStart.bind(this);\n var moveListener = this.onTouchMove.bind(this);\n var endListener = this.onTouchEnd.bind(this);\n this.eElement.addEventListener(\"touchstart\", startListener, { passive: true });\n this.eElement.addEventListener(\"touchmove\", moveListener, { passive: true });\n // we set passive=false, as we want to prevent default on this event\n this.eElement.addEventListener(\"touchend\", endListener, { passive: false });\n this.destroyFuncs.push(function () {\n _this.eElement.removeEventListener(\"touchstart\", startListener, { passive: true });\n _this.eElement.removeEventListener(\"touchmove\", moveListener, { passive: true });\n _this.eElement.removeEventListener(\"touchend\", endListener, { passive: false });\n });\n }\n TouchListener.prototype.getActiveTouch = function (touchList) {\n for (var i = 0; i < touchList.length; i++) {\n var matches = touchList[i].identifier === this.touchStart.identifier;\n if (matches) {\n return touchList[i];\n }\n }\n return null;\n };\n TouchListener.prototype.addEventListener = function (eventType, listener) {\n this.eventService.addEventListener(eventType, listener);\n };\n TouchListener.prototype.removeEventListener = function (eventType, listener) {\n this.eventService.removeEventListener(eventType, listener);\n };\n TouchListener.prototype.onTouchStart = function (touchEvent) {\n var _this = this;\n // only looking at one touch point at any time\n if (this.touching) {\n return;\n }\n this.touchStart = touchEvent.touches[0];\n this.touching = true;\n this.moved = false;\n var touchStartCopy = this.touchStart;\n window.setTimeout(function () {\n var touchesMatch = _this.touchStart === touchStartCopy;\n if (_this.touching && touchesMatch && !_this.moved) {\n _this.moved = true;\n var event_1 = {\n type: TouchListener.EVENT_LONG_TAP,\n touchStart: _this.touchStart,\n touchEvent: touchEvent\n };\n _this.eventService.dispatchEvent(event_1);\n }\n }, 500);\n };\n TouchListener.prototype.onTouchMove = function (touchEvent) {\n if (!this.touching) {\n return;\n }\n var touch = this.getActiveTouch(touchEvent.touches);\n if (!touch) {\n return;\n }\n var eventIsFarAway = !areEventsNear(touch, this.touchStart, 4);\n if (eventIsFarAway) {\n this.moved = true;\n }\n };\n TouchListener.prototype.onTouchEnd = function (touchEvent) {\n if (!this.touching) {\n return;\n }\n if (!this.moved) {\n var event_2 = {\n type: TouchListener.EVENT_TAP,\n touchStart: this.touchStart\n };\n this.eventService.dispatchEvent(event_2);\n this.checkForDoubleTap();\n }\n // stops the tap from also been processed as a mouse click\n if (this.preventMouseClick && touchEvent.cancelable) {\n touchEvent.preventDefault();\n }\n this.touching = false;\n };\n TouchListener.prototype.checkForDoubleTap = function () {\n var now = new Date().getTime();\n if (this.lastTapTime && this.lastTapTime > 0) {\n // if previous tap, see if duration is short enough to be considered double tap\n var interval = now - this.lastTapTime;\n if (interval > TouchListener.DOUBLE_TAP_MILLIS) {\n // dispatch double tap event\n var event_3 = {\n type: TouchListener.EVENT_DOUBLE_TAP,\n touchStart: this.touchStart\n };\n this.eventService.dispatchEvent(event_3);\n // this stops a tripple tap ending up as two double taps\n this.lastTapTime = null;\n }\n else {\n this.lastTapTime = now;\n }\n }\n else {\n this.lastTapTime = now;\n }\n };\n TouchListener.prototype.destroy = function () {\n this.destroyFuncs.forEach(function (func) { return func(); });\n };\n TouchListener.EVENT_TAP = \"tap\";\n TouchListener.EVENT_DOUBLE_TAP = \"doubleTap\";\n TouchListener.EVENT_LONG_TAP = \"longTap\";\n TouchListener.DOUBLE_TAP_MILLIS = 500;\n return TouchListener;\n}());\n\nvar __extends$2L = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2p = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SortIndicatorComp = /** @class */ (function (_super) {\n __extends$2L(SortIndicatorComp, _super);\n function SortIndicatorComp(skipTemplate) {\n var _this = _super.call(this) || this;\n if (!skipTemplate) {\n _this.setTemplate(SortIndicatorComp.TEMPLATE);\n }\n return _this;\n }\n SortIndicatorComp.prototype.attachCustomElements = function (eSortOrder, eSortAsc, eSortDesc, eSortMixed, eSortNone) {\n this.eSortOrder = eSortOrder;\n this.eSortAsc = eSortAsc;\n this.eSortDesc = eSortDesc;\n this.eSortMixed = eSortMixed;\n this.eSortNone = eSortNone;\n };\n SortIndicatorComp.prototype.setupSort = function (column, suppressOrder) {\n var _this = this;\n if (suppressOrder === void 0) { suppressOrder = false; }\n this.column = column;\n this.suppressOrder = suppressOrder;\n this.setupMultiSortIndicator();\n if (!this.column.isSortable()) {\n return;\n }\n this.addInIcon('sortAscending', this.eSortAsc, column);\n this.addInIcon('sortDescending', this.eSortDesc, column);\n this.addInIcon('sortUnSort', this.eSortNone, column);\n this.addManagedPropertyListener('unSortIcon', function () { return _this.updateIcons(); });\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, function () { return _this.updateIcons(); });\n // Watch global events, as row group columns can effect their display column.\n this.addManagedListener(this.eventService, Events.EVENT_SORT_CHANGED, function () { return _this.onSortChanged(); });\n // when grouping changes so can sort indexes and icons\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, function () { return _this.onSortChanged(); });\n this.onSortChanged();\n };\n SortIndicatorComp.prototype.addInIcon = function (iconName, eParent, column) {\n if (eParent == null) {\n return;\n }\n var eIcon = createIconNoSpan(iconName, this.gridOptionsService, column);\n if (eIcon) {\n eParent.appendChild(eIcon);\n }\n };\n SortIndicatorComp.prototype.onSortChanged = function () {\n this.updateIcons();\n if (!this.suppressOrder) {\n this.updateSortOrder();\n }\n };\n SortIndicatorComp.prototype.updateIcons = function () {\n var sortDirection = this.sortController.getDisplaySortForColumn(this.column);\n if (this.eSortAsc) {\n var isAscending = sortDirection === 'asc';\n setDisplayed(this.eSortAsc, isAscending, { skipAriaHidden: true });\n }\n if (this.eSortDesc) {\n var isDescending = sortDirection === 'desc';\n setDisplayed(this.eSortDesc, isDescending, { skipAriaHidden: true });\n }\n if (this.eSortNone) {\n var alwaysHideNoSort = !this.column.getColDef().unSortIcon && !this.gridOptionsService.get('unSortIcon');\n var isNone = sortDirection === null || sortDirection === undefined;\n setDisplayed(this.eSortNone, !alwaysHideNoSort && isNone, { skipAriaHidden: true });\n }\n };\n SortIndicatorComp.prototype.setupMultiSortIndicator = function () {\n var _this = this;\n this.addInIcon('sortUnSort', this.eSortMixed, this.column);\n var isColumnShowingRowGroup = this.column.getColDef().showRowGroup;\n var areGroupsCoupled = this.gridOptionsService.isColumnsSortingCoupledToGroup();\n if (areGroupsCoupled && isColumnShowingRowGroup) {\n // Watch global events, as row group columns can effect their display column.\n this.addManagedListener(this.eventService, Events.EVENT_SORT_CHANGED, function () { return _this.updateMultiSortIndicator(); });\n // when grouping changes so can sort indexes and icons\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, function () { return _this.updateMultiSortIndicator(); });\n this.updateMultiSortIndicator();\n }\n };\n SortIndicatorComp.prototype.updateMultiSortIndicator = function () {\n if (this.eSortMixed) {\n var isMixedSort = this.sortController.getDisplaySortForColumn(this.column) === 'mixed';\n setDisplayed(this.eSortMixed, isMixedSort, { skipAriaHidden: true });\n }\n };\n // we listen here for global sort events, NOT column sort events, as we want to do this\n // when sorting has been set on all column (if we listened just for our col (where we\n // set the asc / desc icons) then it's possible other cols are yet to get their sorting state.\n SortIndicatorComp.prototype.updateSortOrder = function () {\n var _this = this;\n var _a;\n if (!this.eSortOrder) {\n return;\n }\n var allColumnsWithSorting = this.sortController.getColumnsWithSortingOrdered();\n var indexThisCol = (_a = this.sortController.getDisplaySortIndexForColumn(this.column)) !== null && _a !== void 0 ? _a : -1;\n var moreThanOneColSorting = allColumnsWithSorting.some(function (col) { var _a; return (_a = _this.sortController.getDisplaySortIndexForColumn(col)) !== null && _a !== void 0 ? _a : -1 >= 1; });\n var showIndex = indexThisCol >= 0 && moreThanOneColSorting;\n setDisplayed(this.eSortOrder, showIndex, { skipAriaHidden: true });\n if (indexThisCol >= 0) {\n this.eSortOrder.textContent = (indexThisCol + 1).toString();\n }\n else {\n clearElement(this.eSortOrder);\n }\n };\n SortIndicatorComp.TEMPLATE = \"\\n \\n \\n \\n \\n \\n \";\n __decorate$2p([\n RefSelector('eSortOrder')\n ], SortIndicatorComp.prototype, \"eSortOrder\", void 0);\n __decorate$2p([\n RefSelector('eSortAsc')\n ], SortIndicatorComp.prototype, \"eSortAsc\", void 0);\n __decorate$2p([\n RefSelector('eSortDesc')\n ], SortIndicatorComp.prototype, \"eSortDesc\", void 0);\n __decorate$2p([\n RefSelector('eSortMixed')\n ], SortIndicatorComp.prototype, \"eSortMixed\", void 0);\n __decorate$2p([\n RefSelector('eSortNone')\n ], SortIndicatorComp.prototype, \"eSortNone\", void 0);\n __decorate$2p([\n Autowired('columnModel')\n ], SortIndicatorComp.prototype, \"columnModel\", void 0);\n __decorate$2p([\n Autowired('sortController')\n ], SortIndicatorComp.prototype, \"sortController\", void 0);\n return SortIndicatorComp;\n}(Component));\n\nvar __extends$2K = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2o = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar HeaderComp = /** @class */ (function (_super) {\n __extends$2K(HeaderComp, _super);\n function HeaderComp() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.lastMovingChanged = 0;\n return _this;\n }\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n HeaderComp.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n HeaderComp.prototype.refresh = function (params) {\n this.params = params;\n // if template changed, then recreate the whole comp, the code required to manage\n // a changing template is to difficult for what it's worth.\n if (this.workOutTemplate() != this.currentTemplate) {\n return false;\n }\n if (this.workOutShowMenu() != this.currentShowMenu) {\n return false;\n }\n if (this.workOutSort() != this.currentSort) {\n return false;\n }\n if (this.shouldSuppressMenuHide() != this.currentSuppressMenuHide) {\n return false;\n }\n this.setDisplayName(params);\n return true;\n };\n HeaderComp.prototype.workOutTemplate = function () {\n var _a;\n var template = (_a = this.params.template) !== null && _a !== void 0 ? _a : HeaderComp.TEMPLATE;\n // take account of any newlines & whitespace before/after the actual template\n template = template && template.trim ? template.trim() : template;\n return template;\n };\n HeaderComp.prototype.init = function (params) {\n this.params = params;\n this.currentTemplate = this.workOutTemplate();\n this.setTemplate(this.currentTemplate);\n this.setupTap();\n this.setMenu();\n this.setupSort();\n this.setupFilterIcon();\n this.setupFilterButton();\n this.setDisplayName(params);\n };\n HeaderComp.prototype.setDisplayName = function (params) {\n if (this.currentDisplayName != params.displayName) {\n this.currentDisplayName = params.displayName;\n var displayNameSanitised = escapeString(this.currentDisplayName, true);\n if (this.eText) {\n this.eText.textContent = displayNameSanitised;\n }\n }\n };\n HeaderComp.prototype.addInIcon = function (iconName, eParent, column) {\n if (eParent == null) {\n return;\n }\n var eIcon = createIconNoSpan(iconName, this.gridOptionsService, column);\n if (eIcon) {\n eParent.appendChild(eIcon);\n }\n };\n HeaderComp.prototype.setupTap = function () {\n var _this = this;\n var gridOptionsService = this.gridOptionsService;\n if (gridOptionsService.get('suppressTouch')) {\n return;\n }\n var touchListener = new TouchListener(this.getGui(), true);\n var suppressMenuHide = this.shouldSuppressMenuHide();\n var tapMenuButton = suppressMenuHide && exists(this.eMenu);\n var menuTouchListener = tapMenuButton ? new TouchListener(this.eMenu, true) : touchListener;\n if (this.params.enableMenu) {\n var eventType = tapMenuButton ? 'EVENT_TAP' : 'EVENT_LONG_TAP';\n var showMenuFn = function (event) { return _this.params.showColumnMenuAfterMouseClick(event.touchStart); };\n this.addManagedListener(menuTouchListener, TouchListener[eventType], showMenuFn);\n }\n if (this.params.enableSorting) {\n var tapListener = function (event) {\n var _a, _b;\n var target = event.touchStart.target;\n // When suppressMenuHide is true, a tap on the menu icon or filter button will bubble up\n // to the header container, in that case we should not sort\n if (suppressMenuHide && (((_a = _this.eMenu) === null || _a === void 0 ? void 0 : _a.contains(target)) || ((_b = _this.eFilterButton) === null || _b === void 0 ? void 0 : _b.contains(target)))) {\n return;\n }\n _this.sortController.progressSort(_this.params.column, false, \"uiColumnSorted\");\n };\n this.addManagedListener(touchListener, TouchListener.EVENT_TAP, tapListener);\n }\n if (this.params.enableFilterButton) {\n var filterButtonTouchListener_1 = new TouchListener(this.eFilterButton, true);\n this.addManagedListener(filterButtonTouchListener_1, 'tap', function () { return _this.params.showFilter(_this.eFilterButton); });\n this.addDestroyFunc(function () { return filterButtonTouchListener_1.destroy(); });\n }\n // if tapMenuButton is true `touchListener` and `menuTouchListener` are different\n // so we need to make sure to destroy both listeners here\n this.addDestroyFunc(function () { return touchListener.destroy(); });\n if (tapMenuButton) {\n this.addDestroyFunc(function () { return menuTouchListener.destroy(); });\n }\n };\n HeaderComp.prototype.workOutShowMenu = function () {\n return this.params.enableMenu && this.menuService.isHeaderMenuButtonEnabled();\n };\n HeaderComp.prototype.shouldSuppressMenuHide = function () {\n return this.menuService.isHeaderMenuButtonAlwaysShowEnabled();\n };\n HeaderComp.prototype.setMenu = function () {\n var _this = this;\n // if no menu provided in template, do nothing\n if (!this.eMenu) {\n return;\n }\n this.currentShowMenu = this.workOutShowMenu();\n if (!this.currentShowMenu) {\n removeFromParent(this.eMenu);\n this.eMenu = undefined;\n return;\n }\n var isLegacyMenu = this.menuService.isLegacyMenuEnabled();\n this.addInIcon(isLegacyMenu ? 'menu' : 'menuAlt', this.eMenu, this.params.column);\n this.eMenu.classList.toggle('ag-header-menu-icon', !isLegacyMenu);\n this.currentSuppressMenuHide = this.shouldSuppressMenuHide();\n this.addManagedListener(this.eMenu, 'click', function () { return _this.params.showColumnMenu(_this.eMenu); });\n this.eMenu.classList.toggle('ag-header-menu-always-show', this.currentSuppressMenuHide);\n };\n HeaderComp.prototype.onMenuKeyboardShortcut = function (isFilterShortcut) {\n var _a, _b, _c, _d;\n var column = this.params.column;\n var isLegacyMenuEnabled = this.menuService.isLegacyMenuEnabled();\n if (isFilterShortcut && !isLegacyMenuEnabled) {\n if (this.menuService.isFilterMenuInHeaderEnabled(column)) {\n this.params.showFilter((_b = (_a = this.eFilterButton) !== null && _a !== void 0 ? _a : this.eMenu) !== null && _b !== void 0 ? _b : this.getGui());\n return true;\n }\n }\n else if (this.params.enableMenu) {\n this.params.showColumnMenu((_d = (_c = this.eMenu) !== null && _c !== void 0 ? _c : this.eFilterButton) !== null && _d !== void 0 ? _d : this.getGui());\n return true;\n }\n return false;\n };\n HeaderComp.prototype.workOutSort = function () {\n return this.params.enableSorting;\n };\n HeaderComp.prototype.setupSort = function () {\n var _this = this;\n this.currentSort = this.params.enableSorting;\n // eSortIndicator will not be present when customers provided custom header\n // templates, in that case, we need to look for provided sort elements and\n // manually create eSortIndicator.\n if (!this.eSortIndicator) {\n this.eSortIndicator = this.context.createBean(new SortIndicatorComp(true));\n this.eSortIndicator.attachCustomElements(this.eSortOrder, this.eSortAsc, this.eSortDesc, this.eSortMixed, this.eSortNone);\n }\n this.eSortIndicator.setupSort(this.params.column);\n // we set up the indicator prior to the check for whether this column is sortable, as it allows the indicator to\n // set up the multi sort indicator which can appear irrelevant of whether this column can itself be sorted.\n // this can occur in the case of a non-sortable group display column.\n if (!this.currentSort) {\n return;\n }\n // keep track of last time the moving changed flag was set\n this.addManagedListener(this.params.column, Column.EVENT_MOVING_CHANGED, function () {\n _this.lastMovingChanged = new Date().getTime();\n });\n // add the event on the header, so when clicked, we do sorting\n if (this.eLabel) {\n this.addManagedListener(this.eLabel, 'click', function (event) {\n // sometimes when moving a column via dragging, this was also firing a clicked event.\n // here is issue raised by user: https://ag-grid.zendesk.com/agent/tickets/1076\n // this check stops sort if a) column is moving or b) column moved less than 200ms ago (so caters for race condition)\n var moving = _this.params.column.isMoving();\n var nowTime = new Date().getTime();\n // typically there is <2ms if moving flag was set recently, as it would be done in same VM turn\n var movedRecently = (nowTime - _this.lastMovingChanged) < 50;\n var columnMoving = moving || movedRecently;\n if (!columnMoving) {\n var sortUsingCtrl = _this.gridOptionsService.get('multiSortKey') === 'ctrl';\n var multiSort = sortUsingCtrl ? (event.ctrlKey || event.metaKey) : event.shiftKey;\n _this.params.progressSort(multiSort);\n }\n });\n }\n var onSortingChanged = function () {\n _this.addOrRemoveCssClass('ag-header-cell-sorted-asc', _this.params.column.isSortAscending());\n _this.addOrRemoveCssClass('ag-header-cell-sorted-desc', _this.params.column.isSortDescending());\n _this.addOrRemoveCssClass('ag-header-cell-sorted-none', _this.params.column.isSortNone());\n if (_this.params.column.getColDef().showRowGroup) {\n var sourceColumns = _this.columnModel.getSourceColumnsForGroupColumn(_this.params.column);\n // this == is intentional, as it allows null and undefined to match, which are both unsorted states\n var sortDirectionsMatch = sourceColumns === null || sourceColumns === void 0 ? void 0 : sourceColumns.every(function (sourceCol) { return _this.params.column.getSort() == sourceCol.getSort(); });\n var isMultiSorting = !sortDirectionsMatch;\n _this.addOrRemoveCssClass('ag-header-cell-sorted-mixed', isMultiSorting);\n }\n };\n this.addManagedListener(this.eventService, Events.EVENT_SORT_CHANGED, onSortingChanged);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, onSortingChanged);\n };\n HeaderComp.prototype.setupFilterIcon = function () {\n if (!this.eFilter) {\n return;\n }\n this.configureFilter(this.params.enableFilterIcon, this.eFilter, this.onFilterChangedIcon.bind(this));\n };\n HeaderComp.prototype.setupFilterButton = function () {\n var _this = this;\n if (!this.eFilterButton) {\n return;\n }\n var configured = this.configureFilter(this.params.enableFilterButton, this.eFilterButton, this.onFilterChangedButton.bind(this));\n if (configured) {\n this.addManagedListener(this.eFilterButton, 'click', function () { return _this.params.showFilter(_this.eFilterButton); });\n }\n else {\n this.eFilterButton = undefined;\n }\n };\n HeaderComp.prototype.configureFilter = function (enabled, element, filterChangedCallback) {\n if (!enabled) {\n removeFromParent(element);\n return false;\n }\n var column = this.params.column;\n this.addInIcon('filter', element, column);\n this.addManagedListener(column, Column.EVENT_FILTER_CHANGED, filterChangedCallback);\n filterChangedCallback();\n return true;\n };\n HeaderComp.prototype.onFilterChangedIcon = function () {\n var filterPresent = this.params.column.isFilterActive();\n setDisplayed(this.eFilter, filterPresent, { skipAriaHidden: true });\n };\n HeaderComp.prototype.onFilterChangedButton = function () {\n var filterPresent = this.params.column.isFilterActive();\n this.eFilterButton.classList.toggle('ag-filter-active', filterPresent);\n };\n HeaderComp.prototype.getAnchorElementForMenu = function (isFilter) {\n var _a, _b, _c, _d;\n if (isFilter) {\n return (_b = (_a = this.eFilterButton) !== null && _a !== void 0 ? _a : this.eMenu) !== null && _b !== void 0 ? _b : this.getGui();\n }\n return (_d = (_c = this.eMenu) !== null && _c !== void 0 ? _c : this.eFilterButton) !== null && _d !== void 0 ? _d : this.getGui();\n };\n HeaderComp.TEMPLATE = \"
\\n \\n \\n
\\n \\n \\n \\n
\\n
\";\n __decorate$2o([\n Autowired('sortController')\n ], HeaderComp.prototype, \"sortController\", void 0);\n __decorate$2o([\n Autowired('menuService')\n ], HeaderComp.prototype, \"menuService\", void 0);\n __decorate$2o([\n Autowired('columnModel')\n ], HeaderComp.prototype, \"columnModel\", void 0);\n __decorate$2o([\n RefSelector('eFilter')\n ], HeaderComp.prototype, \"eFilter\", void 0);\n __decorate$2o([\n RefSelector('eFilterButton')\n ], HeaderComp.prototype, \"eFilterButton\", void 0);\n __decorate$2o([\n RefSelector('eSortIndicator')\n ], HeaderComp.prototype, \"eSortIndicator\", void 0);\n __decorate$2o([\n RefSelector('eMenu')\n ], HeaderComp.prototype, \"eMenu\", void 0);\n __decorate$2o([\n RefSelector('eLabel')\n ], HeaderComp.prototype, \"eLabel\", void 0);\n __decorate$2o([\n RefSelector('eText')\n ], HeaderComp.prototype, \"eText\", void 0);\n __decorate$2o([\n RefSelector('eSortOrder')\n ], HeaderComp.prototype, \"eSortOrder\", void 0);\n __decorate$2o([\n RefSelector('eSortAsc')\n ], HeaderComp.prototype, \"eSortAsc\", void 0);\n __decorate$2o([\n RefSelector('eSortDesc')\n ], HeaderComp.prototype, \"eSortDesc\", void 0);\n __decorate$2o([\n RefSelector('eSortMixed')\n ], HeaderComp.prototype, \"eSortMixed\", void 0);\n __decorate$2o([\n RefSelector('eSortNone')\n ], HeaderComp.prototype, \"eSortNone\", void 0);\n return HeaderComp;\n}(Component));\n\nvar __extends$2J = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2n = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar HeaderGroupComp = /** @class */ (function (_super) {\n __extends$2J(HeaderGroupComp, _super);\n function HeaderGroupComp() {\n return _super.call(this, HeaderGroupComp.TEMPLATE) || this;\n }\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n HeaderGroupComp.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n HeaderGroupComp.prototype.init = function (params) {\n this.params = params;\n this.checkWarnings();\n this.setupLabel();\n this.addGroupExpandIcon();\n this.setupExpandIcons();\n };\n HeaderGroupComp.prototype.checkWarnings = function () {\n var paramsAny = this.params;\n if (paramsAny.template) {\n warnOnce(\"A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)\");\n }\n };\n HeaderGroupComp.prototype.setupExpandIcons = function () {\n var _this = this;\n this.addInIcon(\"columnGroupOpened\", \"agOpened\");\n this.addInIcon(\"columnGroupClosed\", \"agClosed\");\n var expandAction = function (event) {\n if (isStopPropagationForAgGrid(event)) {\n return;\n }\n var newExpandedValue = !_this.params.columnGroup.isExpanded();\n _this.columnModel.setColumnGroupOpened(_this.params.columnGroup.getProvidedColumnGroup(), newExpandedValue, \"uiColumnExpanded\");\n };\n this.addTouchAndClickListeners(this.eCloseIcon, expandAction);\n this.addTouchAndClickListeners(this.eOpenIcon, expandAction);\n var stopPropagationAction = function (event) {\n stopPropagationForAgGrid(event);\n };\n // adding stopPropagation to the double click for the icons prevents double click action happening\n // when the icons are clicked. if the icons are double clicked, then the groups should open and\n // then close again straight away. if we also listened to double click, then the group would open,\n // close, then open, which is not what we want. double click should only action if the user double\n // clicks outside of the icons.\n this.addManagedListener(this.eCloseIcon, \"dblclick\", stopPropagationAction);\n this.addManagedListener(this.eOpenIcon, \"dblclick\", stopPropagationAction);\n this.addManagedListener(this.getGui(), \"dblclick\", expandAction);\n this.updateIconVisibility();\n var providedColumnGroup = this.params.columnGroup.getProvidedColumnGroup();\n this.addManagedListener(providedColumnGroup, ProvidedColumnGroup.EVENT_EXPANDED_CHANGED, this.updateIconVisibility.bind(this));\n this.addManagedListener(providedColumnGroup, ProvidedColumnGroup.EVENT_EXPANDABLE_CHANGED, this.updateIconVisibility.bind(this));\n };\n HeaderGroupComp.prototype.addTouchAndClickListeners = function (eElement, action) {\n var touchListener = new TouchListener(eElement, true);\n this.addManagedListener(touchListener, TouchListener.EVENT_TAP, action);\n this.addDestroyFunc(function () { return touchListener.destroy(); });\n this.addManagedListener(eElement, \"click\", action);\n };\n HeaderGroupComp.prototype.updateIconVisibility = function () {\n var columnGroup = this.params.columnGroup;\n if (columnGroup.isExpandable()) {\n var expanded = this.params.columnGroup.isExpanded();\n setDisplayed(this.eOpenIcon, expanded);\n setDisplayed(this.eCloseIcon, !expanded);\n }\n else {\n setDisplayed(this.eOpenIcon, false);\n setDisplayed(this.eCloseIcon, false);\n }\n };\n HeaderGroupComp.prototype.addInIcon = function (iconName, refName) {\n var eIcon = createIconNoSpan(iconName, this.gridOptionsService, null);\n if (eIcon) {\n this.getRefElement(refName).appendChild(eIcon);\n }\n };\n HeaderGroupComp.prototype.addGroupExpandIcon = function () {\n if (!this.params.columnGroup.isExpandable()) {\n setDisplayed(this.eOpenIcon, false);\n setDisplayed(this.eCloseIcon, false);\n return;\n }\n };\n HeaderGroupComp.prototype.setupLabel = function () {\n var _a;\n // no renderer, default text render\n var _b = this.params, displayName = _b.displayName, columnGroup = _b.columnGroup;\n if (exists(displayName)) {\n var displayNameSanitised = escapeString(displayName, true);\n this.getRefElement('agLabel').textContent = displayNameSanitised;\n }\n this.addOrRemoveCssClass('ag-sticky-label', !((_a = columnGroup.getColGroupDef()) === null || _a === void 0 ? void 0 : _a.suppressStickyLabel));\n };\n HeaderGroupComp.TEMPLATE = \"
\\n \\n \\n \\n
\";\n __decorate$2n([\n Autowired(\"columnModel\")\n ], HeaderGroupComp.prototype, \"columnModel\", void 0);\n __decorate$2n([\n RefSelector(\"agOpened\")\n ], HeaderGroupComp.prototype, \"eOpenIcon\", void 0);\n __decorate$2n([\n RefSelector(\"agClosed\")\n ], HeaderGroupComp.prototype, \"eCloseIcon\", void 0);\n return HeaderGroupComp;\n}(Component));\n\nvar __extends$2I = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar PopupComponent = /** @class */ (function (_super) {\n __extends$2I(PopupComponent, _super);\n function PopupComponent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PopupComponent.prototype.isPopup = function () {\n return true;\n };\n PopupComponent.prototype.setParentComponent = function (container) {\n container.addCssClass('ag-has-popup');\n _super.prototype.setParentComponent.call(this, container);\n };\n PopupComponent.prototype.destroy = function () {\n var parentComp = this.parentComponent;\n var hasParent = parentComp && parentComp.isAlive();\n if (hasParent) {\n parentComp.getGui().classList.remove('ag-has-popup');\n }\n _super.prototype.destroy.call(this);\n };\n return PopupComponent;\n}(Component));\n\nvar __extends$2H = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2m = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar LargeTextCellEditor = /** @class */ (function (_super) {\n __extends$2H(LargeTextCellEditor, _super);\n function LargeTextCellEditor() {\n return _super.call(this, LargeTextCellEditor.TEMPLATE) || this;\n }\n LargeTextCellEditor.prototype.init = function (params) {\n this.params = params;\n this.focusAfterAttached = params.cellStartedEdit;\n this.eTextArea\n .setMaxLength(params.maxLength || 200)\n .setCols(params.cols || 60)\n .setRows(params.rows || 10);\n if (exists(params.value, true)) {\n this.eTextArea.setValue(params.value.toString(), true);\n }\n this.addGuiEventListener('keydown', this.onKeyDown.bind(this));\n this.activateTabIndex();\n };\n LargeTextCellEditor.prototype.onKeyDown = function (event) {\n var key = event.key;\n if (key === KeyCode.LEFT ||\n key === KeyCode.UP ||\n key === KeyCode.RIGHT ||\n key === KeyCode.DOWN ||\n (event.shiftKey && key === KeyCode.ENTER)) { // shift+enter allows for newlines\n event.stopPropagation();\n }\n };\n LargeTextCellEditor.prototype.afterGuiAttached = function () {\n var translate = this.localeService.getLocaleTextFunc();\n this.eTextArea.setInputAriaLabel(translate('ariaInputEditor', 'Input Editor'));\n if (this.focusAfterAttached) {\n this.eTextArea.getFocusableElement().focus();\n }\n };\n LargeTextCellEditor.prototype.getValue = function () {\n var value = this.eTextArea.getValue();\n if (!exists(value) && !exists(this.params.value)) {\n return this.params.value;\n }\n return this.params.parseValue(value);\n };\n LargeTextCellEditor.TEMPLATE = \"
\\n \\n
\";\n __decorate$2m([\n RefSelector(\"eTextArea\")\n ], LargeTextCellEditor.prototype, \"eTextArea\", void 0);\n return LargeTextCellEditor;\n}(PopupComponent));\n\nvar __extends$2G = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2l = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SelectCellEditor = /** @class */ (function (_super) {\n __extends$2G(SelectCellEditor, _super);\n function SelectCellEditor() {\n var _this = _super.call(this, /* html */ \"
\\n \\n
\") || this;\n _this.startedByEnter = false;\n return _this;\n }\n SelectCellEditor.prototype.init = function (params) {\n this.focusAfterAttached = params.cellStartedEdit;\n var _a = this, eSelect = _a.eSelect, valueFormatterService = _a.valueFormatterService, gridOptionsService = _a.gridOptionsService;\n var values = params.values, value = params.value, eventKey = params.eventKey;\n if (missing(values)) {\n console.warn('AG Grid: no values found for select cellEditor');\n return;\n }\n this.startedByEnter = eventKey != null ? eventKey === KeyCode.ENTER : false;\n var hasValue = false;\n values.forEach(function (currentValue) {\n var option = { value: currentValue };\n var valueFormatted = valueFormatterService.formatValue(params.column, null, currentValue);\n var valueFormattedExits = valueFormatted !== null && valueFormatted !== undefined;\n option.text = valueFormattedExits ? valueFormatted : currentValue;\n eSelect.addOption(option);\n hasValue = hasValue || value === currentValue;\n });\n if (hasValue) {\n eSelect.setValue(params.value, true);\n }\n else if (params.values.length) {\n eSelect.setValue(params.values[0], true);\n }\n var valueListGap = params.valueListGap, valueListMaxWidth = params.valueListMaxWidth, valueListMaxHeight = params.valueListMaxHeight;\n if (valueListGap != null) {\n eSelect.setPickerGap(valueListGap);\n }\n if (valueListMaxHeight != null) {\n eSelect.setPickerMaxHeight(valueListMaxHeight);\n }\n if (valueListMaxWidth != null) {\n eSelect.setPickerMaxWidth(valueListMaxWidth);\n }\n // we don't want to add this if full row editing, otherwise selecting will stop the\n // full row editing.\n if (gridOptionsService.get('editType') !== 'fullRow') {\n this.addManagedListener(this.eSelect, AgSelect.EVENT_ITEM_SELECTED, function () { return params.stopEditing(); });\n }\n };\n SelectCellEditor.prototype.afterGuiAttached = function () {\n var _this = this;\n if (this.focusAfterAttached) {\n this.eSelect.getFocusableElement().focus();\n }\n if (this.startedByEnter) {\n setTimeout(function () {\n if (_this.isAlive()) {\n _this.eSelect.showPicker();\n }\n });\n }\n };\n SelectCellEditor.prototype.focusIn = function () {\n this.eSelect.getFocusableElement().focus();\n };\n SelectCellEditor.prototype.getValue = function () {\n return this.eSelect.getValue();\n };\n SelectCellEditor.prototype.isPopup = function () {\n return false;\n };\n __decorate$2l([\n Autowired('valueFormatterService')\n ], SelectCellEditor.prototype, \"valueFormatterService\", void 0);\n __decorate$2l([\n RefSelector('eSelect')\n ], SelectCellEditor.prototype, \"eSelect\", void 0);\n return SelectCellEditor;\n}(PopupComponent));\n\nvar __extends$2F = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2k = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SimpleCellEditor = /** @class */ (function (_super) {\n __extends$2F(SimpleCellEditor, _super);\n function SimpleCellEditor(cellEditorInput) {\n var _this = _super.call(this, /* html */ \"\\n
\\n \".concat(cellEditorInput.getTemplate(), \"\\n
\")) || this;\n _this.cellEditorInput = cellEditorInput;\n return _this;\n }\n SimpleCellEditor.prototype.init = function (params) {\n this.params = params;\n var eInput = this.eInput;\n this.cellEditorInput.init(eInput, params);\n var startValue;\n // cellStartedEdit is only false if we are doing fullRow editing\n if (params.cellStartedEdit) {\n this.focusAfterAttached = true;\n var eventKey = params.eventKey;\n if (eventKey === KeyCode.BACKSPACE || params.eventKey === KeyCode.DELETE) {\n startValue = '';\n }\n else if (eventKey && eventKey.length === 1) {\n startValue = eventKey;\n }\n else {\n startValue = this.cellEditorInput.getStartValue();\n if (eventKey !== KeyCode.F2) {\n this.highlightAllOnFocus = true;\n }\n }\n }\n else {\n this.focusAfterAttached = false;\n startValue = this.cellEditorInput.getStartValue();\n }\n if (startValue != null) {\n eInput.setStartValue(startValue);\n }\n this.addManagedListener(eInput.getGui(), 'keydown', function (event) {\n var key = event.key;\n if (key === KeyCode.PAGE_UP || key === KeyCode.PAGE_DOWN) {\n event.preventDefault();\n }\n });\n };\n SimpleCellEditor.prototype.afterGuiAttached = function () {\n var _a, _b;\n var translate = this.localeService.getLocaleTextFunc();\n var eInput = this.eInput;\n eInput.setInputAriaLabel(translate('ariaInputEditor', 'Input Editor'));\n if (!this.focusAfterAttached) {\n return;\n }\n // Added for AG-3238. We can't remove this explicit focus() because Chrome requires an input\n // to be focused before setSelectionRange will work. But it triggers a bug in Safari where\n // explicitly focusing then blurring an empty field will cause the parent container to scroll.\n if (!isBrowserSafari()) {\n eInput.getFocusableElement().focus();\n }\n var inputEl = eInput.getInputElement();\n if (this.highlightAllOnFocus) {\n inputEl.select();\n }\n else {\n (_b = (_a = this.cellEditorInput).setCaret) === null || _b === void 0 ? void 0 : _b.call(_a);\n }\n };\n // gets called when tabbing through cells and in full row edit mode\n SimpleCellEditor.prototype.focusIn = function () {\n var eInput = this.eInput;\n var focusEl = eInput.getFocusableElement();\n var inputEl = eInput.getInputElement();\n focusEl.focus();\n inputEl.select();\n };\n SimpleCellEditor.prototype.getValue = function () {\n return this.cellEditorInput.getValue();\n };\n SimpleCellEditor.prototype.isPopup = function () {\n return false;\n };\n __decorate$2k([\n RefSelector('eInput')\n ], SimpleCellEditor.prototype, \"eInput\", void 0);\n return SimpleCellEditor;\n}(PopupComponent));\n\nvar __extends$2E = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar TextCellEditorInput = /** @class */ (function () {\n function TextCellEditorInput() {\n }\n TextCellEditorInput.prototype.getTemplate = function () {\n return /* html */ \"\";\n };\n TextCellEditorInput.prototype.init = function (eInput, params) {\n this.eInput = eInput;\n this.params = params;\n if (params.maxLength != null) {\n eInput.setMaxLength(params.maxLength);\n }\n };\n TextCellEditorInput.prototype.getValue = function () {\n var value = this.eInput.getValue();\n if (!exists(value) && !exists(this.params.value)) {\n return this.params.value;\n }\n return this.params.parseValue(value);\n };\n TextCellEditorInput.prototype.getStartValue = function () {\n var formatValue = this.params.useFormatter || this.params.column.getColDef().refData;\n return formatValue ? this.params.formatValue(this.params.value) : this.params.value;\n };\n TextCellEditorInput.prototype.setCaret = function () {\n // when we started editing, we want the caret at the end, not the start.\n // this comes into play in two scenarios:\n // a) when user hits F2\n // b) when user hits a printable character\n var value = this.eInput.getValue();\n var len = (exists(value) && value.length) || 0;\n if (len) {\n this.eInput.getInputElement().setSelectionRange(len, len);\n }\n };\n return TextCellEditorInput;\n}());\nvar TextCellEditor = /** @class */ (function (_super) {\n __extends$2E(TextCellEditor, _super);\n function TextCellEditor() {\n return _super.call(this, new TextCellEditorInput()) || this;\n }\n return TextCellEditor;\n}(SimpleCellEditor));\n\nvar __extends$2D = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2j = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ARROW_UP = '\\u2191';\nvar ARROW_DOWN = '\\u2193';\nvar AnimateShowChangeCellRenderer = /** @class */ (function (_super) {\n __extends$2D(AnimateShowChangeCellRenderer, _super);\n function AnimateShowChangeCellRenderer() {\n var _this = _super.call(this) || this;\n _this.refreshCount = 0;\n var template = document.createElement('span');\n var delta = document.createElement('span');\n delta.setAttribute('class', 'ag-value-change-delta');\n var value = document.createElement('span');\n value.setAttribute('class', 'ag-value-change-value');\n template.appendChild(delta);\n template.appendChild(value);\n _this.setTemplateFromElement(template);\n return _this;\n }\n AnimateShowChangeCellRenderer.prototype.init = function (params) {\n this.eValue = this.queryForHtmlElement('.ag-value-change-value');\n this.eDelta = this.queryForHtmlElement('.ag-value-change-delta');\n this.refresh(params, true);\n };\n AnimateShowChangeCellRenderer.prototype.showDelta = function (params, delta) {\n var absDelta = Math.abs(delta);\n var valueFormatted = params.formatValue(absDelta);\n var valueToUse = exists(valueFormatted) ? valueFormatted : absDelta;\n var deltaUp = (delta >= 0);\n if (deltaUp) {\n this.eDelta.textContent = ARROW_UP + valueToUse;\n }\n else {\n // because negative, use ABS to remove sign\n this.eDelta.textContent = ARROW_DOWN + valueToUse;\n }\n this.eDelta.classList.toggle('ag-value-change-delta-up', deltaUp);\n this.eDelta.classList.toggle('ag-value-change-delta-down', !deltaUp);\n };\n AnimateShowChangeCellRenderer.prototype.setTimerToRemoveDelta = function () {\n var _this = this;\n // the refreshCount makes sure that if the value updates again while\n // the below timer is waiting, then the below timer will realise it\n // is not the most recent and will not try to remove the delta value.\n this.refreshCount++;\n var refreshCountCopy = this.refreshCount;\n this.getFrameworkOverrides().wrapIncoming(function () {\n window.setTimeout(function () {\n if (refreshCountCopy === _this.refreshCount) {\n _this.hideDeltaValue();\n }\n }, 2000);\n });\n };\n AnimateShowChangeCellRenderer.prototype.hideDeltaValue = function () {\n this.eValue.classList.remove('ag-value-change-value-highlight');\n clearElement(this.eDelta);\n };\n AnimateShowChangeCellRenderer.prototype.refresh = function (params, isInitialRender) {\n if (isInitialRender === void 0) { isInitialRender = false; }\n var value = params.value;\n if (value === this.lastValue) {\n return false;\n }\n if (exists(params.valueFormatted)) {\n this.eValue.textContent = params.valueFormatted;\n }\n else if (exists(params.value)) {\n this.eValue.textContent = value;\n }\n else {\n clearElement(this.eValue);\n }\n // we don't show the delta if we are in the middle of a filter. see comment on FilterManager\n // with regards processingFilterChange\n if (this.filterManager.isSuppressFlashingCellsBecauseFiltering()) {\n return false;\n }\n if (typeof value === 'number' && typeof this.lastValue === 'number') {\n var delta = value - this.lastValue;\n this.showDelta(params, delta);\n }\n // highlight the current value, but only if it's not new, otherwise it\n // would get highlighted first time the value is shown\n if (this.lastValue) {\n this.eValue.classList.add('ag-value-change-value-highlight');\n }\n if (!isInitialRender) {\n this.setTimerToRemoveDelta();\n }\n this.lastValue = value;\n return true;\n };\n __decorate$2j([\n Autowired('filterManager')\n ], AnimateShowChangeCellRenderer.prototype, \"filterManager\", void 0);\n return AnimateShowChangeCellRenderer;\n}(Component));\n\nvar __extends$2C = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2i = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AnimateSlideCellRenderer = /** @class */ (function (_super) {\n __extends$2C(AnimateSlideCellRenderer, _super);\n function AnimateSlideCellRenderer() {\n var _this = _super.call(this) || this;\n _this.refreshCount = 0;\n var template = document.createElement('span');\n var slide = document.createElement('span');\n slide.setAttribute('class', 'ag-value-slide-current');\n template.appendChild(slide);\n _this.setTemplateFromElement(template);\n _this.eCurrent = _this.queryForHtmlElement('.ag-value-slide-current');\n return _this;\n }\n AnimateSlideCellRenderer.prototype.init = function (params) {\n this.refresh(params, true);\n };\n AnimateSlideCellRenderer.prototype.addSlideAnimation = function () {\n var _this = this;\n this.refreshCount++;\n // below we keep checking this, and stop working on the animation\n // if it no longer matches - this means another animation has started\n // and this one is stale.\n var refreshCountCopy = this.refreshCount;\n // if old animation, remove it\n if (this.ePrevious) {\n this.getGui().removeChild(this.ePrevious);\n }\n var prevElement = document.createElement('span');\n prevElement.setAttribute('class', 'ag-value-slide-previous ag-value-slide-out');\n this.ePrevious = prevElement;\n this.ePrevious.textContent = this.eCurrent.textContent;\n this.getGui().insertBefore(this.ePrevious, this.eCurrent);\n // having timeout of 0 allows use to skip to the next css turn,\n // so we know the previous css classes have been applied. so the\n // complex set of setTimeout below creates the animation\n this.getFrameworkOverrides().wrapIncoming(function () {\n window.setTimeout(function () {\n if (refreshCountCopy !== _this.refreshCount) {\n return;\n }\n _this.ePrevious.classList.add('ag-value-slide-out-end');\n }, 50);\n window.setTimeout(function () {\n if (refreshCountCopy !== _this.refreshCount) {\n return;\n }\n _this.getGui().removeChild(_this.ePrevious);\n _this.ePrevious = null;\n }, 3000);\n });\n };\n AnimateSlideCellRenderer.prototype.refresh = function (params, isInitialRender) {\n if (isInitialRender === void 0) { isInitialRender = false; }\n var value = params.value;\n if (missing(value)) {\n value = '';\n }\n if (value === this.lastValue) {\n return false;\n }\n // we don't show the delta if we are in the middle of a filter. see comment on FilterManager\n // with regards processingFilterChange\n if (this.filterManager.isSuppressFlashingCellsBecauseFiltering()) {\n return false;\n }\n if (!isInitialRender) {\n this.addSlideAnimation();\n }\n this.lastValue = value;\n if (exists(params.valueFormatted)) {\n this.eCurrent.textContent = params.valueFormatted;\n }\n else if (exists(params.value)) {\n this.eCurrent.textContent = value;\n }\n else {\n clearElement(this.eCurrent);\n }\n return true;\n };\n __decorate$2i([\n Autowired('filterManager')\n ], AnimateSlideCellRenderer.prototype, \"filterManager\", void 0);\n return AnimateSlideCellRenderer;\n}(Component));\n\nvar __assign$j = ( false) || function () {\n __assign$j = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$j.apply(this, arguments);\n};\nvar RowNode = /** @class */ (function () {\n function RowNode(beans) {\n /** The current row index. If the row is filtered out or in a collapsed group, this value will be `null`. */\n this.rowIndex = null;\n /** The key for the group eg Ireland, UK, USA */\n this.key = null;\n /** Children mapped by the pivot columns. */\n this.childrenMapped = {};\n /**\n * This will be `true` if it has a rowIndex assigned, otherwise `false`.\n */\n this.displayed = false;\n /** The row top position in pixels. */\n this.rowTop = null;\n /** The top pixel for this row last time, makes sense if data set was ordered or filtered,\n * it is used so new rows can animate in from their old position. */\n this.oldRowTop = null;\n /** `true` by default - can be overridden via gridOptions.isRowSelectable(rowNode) */\n this.selectable = true;\n /** Used by sorting service - to give deterministic sort to groups. Previously we\n * just id for this, however id is a string and had slower sorting compared to numbers. */\n this.__objectId = RowNode.OBJECT_ID_SEQUENCE++;\n /** When one or more Columns are using autoHeight, this keeps track of height of each autoHeight Cell,\n * indexed by the Column ID. */\n this.__autoHeights = {};\n /** `true` when nodes with the same id are being removed and added as part of the same batch transaction */\n this.alreadyRendered = false;\n this.highlighted = null;\n this.hovered = false;\n this.selected = false;\n this.beans = beans;\n }\n /**\n * Replaces the data on the `rowNode`. When this method is called, the grid will refresh the entire rendered row if it is displayed.\n */\n RowNode.prototype.setData = function (data) {\n this.setDataCommon(data, false);\n };\n // similar to setRowData, however it is expected that the data is the same data item. this\n // is intended to be used with Redux type stores, where the whole data can be changed. we are\n // guaranteed that the data is the same entity (so grid doesn't need to worry about the id of the\n // underlying data changing, hence doesn't need to worry about selection). the grid, upon receiving\n // dataChanged event, will refresh the cells rather than rip them all out (so user can show transitions).\n /**\n * Updates the data on the `rowNode`. When this method is called, the grid will refresh the entire rendered row if it is displayed.\n */\n RowNode.prototype.updateData = function (data) {\n this.setDataCommon(data, true);\n };\n RowNode.prototype.setDataCommon = function (data, update) {\n var oldData = this.data;\n this.data = data;\n this.beans.valueCache.onDataChanged();\n this.updateDataOnDetailNode();\n this.checkRowSelectable();\n this.resetQuickFilterAggregateText();\n var event = this.createDataChangedEvent(data, oldData, update);\n this.dispatchLocalEvent(event);\n };\n // when we are doing master / detail, the detail node is lazy created, but then kept around.\n // so if we show / hide the detail, the same detail rowNode is used. so we need to keep the data\n // in sync, otherwise expand/collapse of the detail would still show the old values.\n RowNode.prototype.updateDataOnDetailNode = function () {\n if (this.detailNode) {\n this.detailNode.data = this.data;\n }\n };\n RowNode.prototype.createDataChangedEvent = function (newData, oldData, update) {\n return {\n type: RowNode.EVENT_DATA_CHANGED,\n node: this,\n oldData: oldData,\n newData: newData,\n update: update\n };\n };\n RowNode.prototype.createLocalRowEvent = function (type) {\n return {\n type: type,\n node: this\n };\n };\n RowNode.prototype.getRowIndexString = function () {\n if (this.rowPinned === 'top') {\n return 't-' + this.rowIndex;\n }\n if (this.rowPinned === 'bottom') {\n return 'b-' + this.rowIndex;\n }\n return this.rowIndex.toString();\n };\n RowNode.prototype.createDaemonNode = function () {\n var oldNode = new RowNode(this.beans);\n // just copy the id and data, this is enough for the node to be used\n // in the selection controller (the selection controller is the only\n // place where daemon nodes can live).\n oldNode.id = this.id;\n oldNode.data = this.data;\n oldNode.__daemon = true;\n oldNode.selected = this.selected;\n oldNode.level = this.level;\n return oldNode;\n };\n RowNode.prototype.setDataAndId = function (data, id) {\n var oldNode = exists(this.id) ? this.createDaemonNode() : null;\n var oldData = this.data;\n this.data = data;\n this.updateDataOnDetailNode();\n this.setId(id);\n this.checkRowSelectable();\n this.beans.selectionService.syncInRowNode(this, oldNode);\n var event = this.createDataChangedEvent(data, oldData, false);\n this.dispatchLocalEvent(event);\n };\n RowNode.prototype.checkRowSelectable = function () {\n var isRowSelectableFunc = this.beans.gridOptionsService.get('isRowSelectable');\n this.setRowSelectable(isRowSelectableFunc ? isRowSelectableFunc(this) : true);\n };\n RowNode.prototype.setRowSelectable = function (newVal, suppressSelectionUpdate) {\n if (this.selectable !== newVal) {\n this.selectable = newVal;\n if (this.eventService) {\n this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_SELECTABLE_CHANGED));\n }\n if (suppressSelectionUpdate) {\n return;\n }\n var isGroupSelectsChildren = this.beans.gridOptionsService.get('groupSelectsChildren');\n if (isGroupSelectsChildren) {\n var selected = this.calculateSelectedFromChildren();\n this.setSelectedParams({\n newValue: selected !== null && selected !== void 0 ? selected : false,\n source: 'selectableChanged',\n });\n return;\n }\n // if row is selected but shouldn't be selectable, then deselect.\n if (this.isSelected() && !this.selectable) {\n this.setSelectedParams({\n newValue: false,\n source: 'selectableChanged',\n });\n }\n }\n };\n RowNode.prototype.setId = function (id) {\n // see if user is providing the id's\n var getRowIdFunc = this.beans.gridOptionsService.getCallback('getRowId');\n if (getRowIdFunc) {\n // if user is providing the id's, then we set the id only after the data has been set.\n // this is important for virtual pagination and viewport, where empty rows exist.\n if (this.data) {\n // we pass 'true' as we skip this level when generating keys,\n // as we don't always have the key for this level (eg when updating\n // data via transaction on SSRM, we are getting key to look up the\n // RowNode, don't have the RowNode yet, thus no way to get the current key)\n var parentKeys = this.getGroupKeys(true);\n this.id = getRowIdFunc({\n data: this.data,\n parentKeys: parentKeys.length > 0 ? parentKeys : undefined,\n level: this.level\n });\n // make sure id provided doesn't start with 'row-group-' as this is reserved. also check that\n // it has 'startsWith' in case the user provided a number.\n if (this.id !== null && typeof this.id === 'string' && this.id.startsWith(RowNode.ID_PREFIX_ROW_GROUP)) {\n console.error(\"AG Grid: Row IDs cannot start with \".concat(RowNode.ID_PREFIX_ROW_GROUP, \", this is a reserved prefix for AG Grid's row grouping feature.\"));\n }\n // force id to be a string\n if (this.id !== null && typeof this.id !== 'string') {\n this.id = '' + this.id;\n }\n }\n else {\n // this can happen if user has set blank into the rowNode after the row previously\n // having data. this happens in virtual page row model, when data is delete and\n // the page is refreshed.\n this.id = undefined;\n }\n }\n else {\n this.id = id;\n }\n };\n RowNode.prototype.getGroupKeys = function (excludeSelf) {\n if (excludeSelf === void 0) { excludeSelf = false; }\n var keys = [];\n var pointer = this;\n if (excludeSelf) {\n pointer = pointer.parent;\n }\n while (pointer && pointer.level >= 0) {\n keys.push(pointer.key);\n pointer = pointer.parent;\n }\n keys.reverse();\n return keys;\n };\n RowNode.prototype.isPixelInRange = function (pixel) {\n if (!exists(this.rowTop) || !exists(this.rowHeight)) {\n return false;\n }\n return pixel >= this.rowTop && pixel < (this.rowTop + this.rowHeight);\n };\n RowNode.prototype.setFirstChild = function (firstChild) {\n if (this.firstChild === firstChild) {\n return;\n }\n this.firstChild = firstChild;\n if (this.eventService) {\n this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_FIRST_CHILD_CHANGED));\n }\n };\n RowNode.prototype.setLastChild = function (lastChild) {\n if (this.lastChild === lastChild) {\n return;\n }\n this.lastChild = lastChild;\n if (this.eventService) {\n this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_LAST_CHILD_CHANGED));\n }\n };\n RowNode.prototype.setChildIndex = function (childIndex) {\n if (this.childIndex === childIndex) {\n return;\n }\n this.childIndex = childIndex;\n if (this.eventService) {\n this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_CHILD_INDEX_CHANGED));\n }\n };\n RowNode.prototype.setRowTop = function (rowTop) {\n this.oldRowTop = this.rowTop;\n if (this.rowTop === rowTop) {\n return;\n }\n this.rowTop = rowTop;\n if (this.eventService) {\n this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_TOP_CHANGED));\n }\n this.setDisplayed(rowTop !== null);\n };\n RowNode.prototype.clearRowTopAndRowIndex = function () {\n this.oldRowTop = null;\n this.setRowTop(null);\n this.setRowIndex(null);\n };\n RowNode.prototype.setDisplayed = function (displayed) {\n if (this.displayed === displayed) {\n return;\n }\n this.displayed = displayed;\n if (this.eventService) {\n this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_DISPLAYED_CHANGED));\n }\n };\n RowNode.prototype.setDragging = function (dragging) {\n if (this.dragging === dragging) {\n return;\n }\n this.dragging = dragging;\n if (this.eventService) {\n this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_DRAGGING_CHANGED));\n }\n };\n RowNode.prototype.setHighlighted = function (highlighted) {\n if (highlighted === this.highlighted) {\n return;\n }\n this.highlighted = highlighted;\n if (this.eventService) {\n this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_HIGHLIGHT_CHANGED));\n }\n };\n RowNode.prototype.setHovered = function (hovered) {\n if (this.hovered === hovered) {\n return;\n }\n this.hovered = hovered;\n };\n RowNode.prototype.isHovered = function () {\n return this.hovered;\n };\n RowNode.prototype.setAllChildrenCount = function (allChildrenCount) {\n if (this.allChildrenCount === allChildrenCount) {\n return;\n }\n this.allChildrenCount = allChildrenCount;\n if (this.eventService) {\n this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED));\n }\n };\n RowNode.prototype.setMaster = function (master) {\n if (this.master === master) {\n return;\n }\n // if changing AWAY from master, then unexpand, otherwise\n // next time it's shown it is expanded again\n if (this.master && !master) {\n this.expanded = false;\n }\n this.master = master;\n if (this.eventService) {\n this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_MASTER_CHANGED));\n }\n };\n RowNode.prototype.setGroup = function (group) {\n if (this.group === group) {\n return;\n }\n // if we used to be a group, and no longer, then close the node\n if (this.group && !group) {\n this.expanded = false;\n }\n this.group = group;\n this.updateHasChildren();\n if (this.eventService) {\n this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_GROUP_CHANGED));\n }\n };\n /**\n * Sets the row height.\n * Call if you want to change the height initially assigned to the row.\n * After calling, you must call `api.onRowHeightChanged()` so the grid knows it needs to work out the placement of the rows. */\n RowNode.prototype.setRowHeight = function (rowHeight, estimated) {\n if (estimated === void 0) { estimated = false; }\n this.rowHeight = rowHeight;\n this.rowHeightEstimated = estimated;\n if (this.eventService) {\n this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_HEIGHT_CHANGED));\n }\n };\n RowNode.prototype.setRowAutoHeight = function (cellHeight, column) {\n if (!this.__autoHeights) {\n this.__autoHeights = {};\n }\n this.__autoHeights[column.getId()] = cellHeight;\n if (cellHeight != null) {\n if (this.checkAutoHeightsDebounced == null) {\n this.checkAutoHeightsDebounced = debounce(this.checkAutoHeights.bind(this), 1);\n }\n this.checkAutoHeightsDebounced();\n }\n };\n RowNode.prototype.checkAutoHeights = function () {\n var _this = this;\n var notAllPresent = false;\n var nonePresent = true;\n var newRowHeight = 0;\n var autoHeights = this.__autoHeights;\n if (autoHeights == null) {\n return;\n }\n var displayedAutoHeightCols = this.beans.columnModel.getAllDisplayedAutoHeightCols();\n displayedAutoHeightCols.forEach(function (col) {\n var cellHeight = autoHeights[col.getId()];\n if (cellHeight == null) {\n // If column spanning is active a column may not provide auto height for a row if that\n // cell is not present for the given row due to a previous cell spanning over the auto height column.\n if (_this.beans.columnModel.isColSpanActive()) {\n var activeColsForRow = [];\n switch (col.getPinned()) {\n case 'left':\n activeColsForRow = _this.beans.columnModel.getDisplayedLeftColumnsForRow(_this);\n break;\n case 'right':\n activeColsForRow = _this.beans.columnModel.getDisplayedRightColumnsForRow(_this);\n break;\n case null:\n activeColsForRow = _this.beans.columnModel.getViewportCenterColumnsForRow(_this);\n break;\n }\n if (activeColsForRow.includes(col)) {\n // Column is present in the row, i.e not spanned over, but no auto height was provided so we cannot calculate the row height\n notAllPresent = true;\n return;\n }\n // Ignore this column as it is spanned over and not present in the row\n cellHeight = -1;\n }\n else {\n notAllPresent = true;\n return;\n }\n }\n else {\n // At least one auto height is present\n nonePresent = false;\n }\n if (cellHeight > newRowHeight) {\n newRowHeight = cellHeight;\n }\n });\n if (notAllPresent) {\n return;\n }\n // we take min of 10, so we don't adjust for empty rows. if <10, we put to default.\n // this prevents the row starting very small when waiting for async components,\n // which would then mean the grid squashes in far to many rows (as small heights\n // means more rows fit in) which looks crap. so best ignore small values and assume\n // we are still waiting for values to render.\n if (nonePresent || newRowHeight < 10) {\n newRowHeight = this.beans.gridOptionsService.getRowHeightForNode(this).height;\n }\n if (newRowHeight == this.rowHeight) {\n return;\n }\n this.setRowHeight(newRowHeight);\n var rowModel = this.beans.rowModel;\n if (rowModel.onRowHeightChangedDebounced) {\n rowModel.onRowHeightChangedDebounced();\n }\n };\n RowNode.prototype.setRowIndex = function (rowIndex) {\n if (this.rowIndex === rowIndex) {\n return;\n }\n this.rowIndex = rowIndex;\n if (this.eventService) {\n this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_ROW_INDEX_CHANGED));\n }\n };\n RowNode.prototype.setUiLevel = function (uiLevel) {\n if (this.uiLevel === uiLevel) {\n return;\n }\n this.uiLevel = uiLevel;\n if (this.eventService) {\n this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_UI_LEVEL_CHANGED));\n }\n };\n /**\n * Set the expanded state of this rowNode. Pass `true` to expand and `false` to collapse.\n */\n RowNode.prototype.setExpanded = function (expanded, e) {\n if (this.expanded === expanded) {\n return;\n }\n this.expanded = expanded;\n if (this.eventService) {\n this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_EXPANDED_CHANGED));\n }\n var event = Object.assign({}, this.createGlobalRowEvent(Events.EVENT_ROW_GROUP_OPENED), {\n expanded: expanded,\n event: e || null\n });\n this.beans.rowNodeEventThrottle.dispatchExpanded(event);\n // when using footers we need to refresh the group row, as the aggregation\n // values jump between group and footer\n if (this.sibling) {\n this.beans.rowRenderer.refreshCells({ rowNodes: [this] });\n }\n };\n RowNode.prototype.createGlobalRowEvent = function (type) {\n return this.beans.gridOptionsService.addGridCommonParams({\n type: type,\n node: this,\n data: this.data,\n rowIndex: this.rowIndex,\n rowPinned: this.rowPinned\n });\n };\n RowNode.prototype.dispatchLocalEvent = function (event) {\n if (this.eventService) {\n this.eventService.dispatchEvent(event);\n }\n };\n /**\n * Replaces the value on the `rowNode` for the specified column. When complete,\n * the grid will refresh the rendered cell on the required row only.\n * **Note**: This method only fires `onCellEditRequest` when the Grid is in **Read Only** mode.\n *\n * @param colKey The column where the value should be updated\n * @param newValue The new value\n * @param eventSource The source of the event\n * @returns `true` if the value was changed, otherwise `false`.\n */\n RowNode.prototype.setDataValue = function (colKey, newValue, eventSource) {\n var _this = this;\n var getColumnFromKey = function () {\n var _a;\n if (typeof colKey !== 'string') {\n return colKey;\n }\n // if in pivot mode, grid columns wont include primary columns\n return (_a = _this.beans.columnModel.getGridColumn(colKey)) !== null && _a !== void 0 ? _a : _this.beans.columnModel.getPrimaryColumn(colKey);\n };\n // When it is done via the editors, no 'cell changed' event gets fired, as it's assumed that\n // the cell knows about the change given it's in charge of the editing.\n // this method is for the client to call, so the cell listens for the change\n // event, and also flashes the cell when the change occurs.\n var column = getColumnFromKey();\n var oldValue = this.getValueFromValueService(column);\n if (this.beans.gridOptionsService.get('readOnlyEdit')) {\n this.dispatchEventForSaveValueReadOnly(column, oldValue, newValue, eventSource);\n return false;\n }\n var valueChanged = this.beans.valueService.setValue(this, column, newValue, eventSource);\n this.dispatchCellChangedEvent(column, newValue, oldValue);\n this.checkRowSelectable();\n return valueChanged;\n };\n RowNode.prototype.getValueFromValueService = function (column) {\n // if we don't check this, then the grid will render leaf groups as open even if we are not\n // allowing the user to open leaf groups. confused? remember for pivot mode we don't allow\n // opening leaf groups, so we have to force leafGroups to be closed in case the user expanded\n // them via the API, or user user expanded them in the UI before turning on pivot mode\n var lockedClosedGroup = this.leafGroup && this.beans.columnModel.isPivotMode();\n var isOpenGroup = this.group && this.expanded && !this.footer && !lockedClosedGroup;\n // are we showing group footers\n var getGroupIncludeFooter = this.beans.gridOptionsService.getGroupIncludeFooter();\n var groupFootersEnabled = getGroupIncludeFooter({ node: this });\n // if doing footers, we normally don't show agg data at group level when group is open\n var groupAlwaysShowAggData = this.beans.gridOptionsService.get('groupSuppressBlankHeader');\n // if doing grouping and footers, we don't want to include the agg value\n // in the header when the group is open\n var ignoreAggData = (isOpenGroup && groupFootersEnabled) && !groupAlwaysShowAggData;\n var value = this.beans.valueService.getValue(column, this, false, ignoreAggData);\n return value;\n };\n RowNode.prototype.dispatchEventForSaveValueReadOnly = function (column, oldValue, newValue, eventSource) {\n var event = this.beans.gridOptionsService.addGridCommonParams({\n type: Events.EVENT_CELL_EDIT_REQUEST,\n event: null,\n rowIndex: this.rowIndex,\n rowPinned: this.rowPinned,\n column: column,\n colDef: column.getColDef(),\n data: this.data,\n node: this,\n oldValue: oldValue,\n newValue: newValue,\n value: newValue,\n source: eventSource\n });\n this.beans.eventService.dispatchEvent(event);\n };\n RowNode.prototype.setGroupValue = function (colKey, newValue) {\n var column = this.beans.columnModel.getGridColumn(colKey);\n if (missing(this.groupData)) {\n this.groupData = {};\n }\n var columnId = column.getColId();\n var oldValue = this.groupData[columnId];\n if (oldValue === newValue) {\n return;\n }\n this.groupData[columnId] = newValue;\n this.dispatchCellChangedEvent(column, newValue, oldValue);\n };\n // sets the data for an aggregation\n RowNode.prototype.setAggData = function (newAggData) {\n var _this = this;\n var oldAggData = this.aggData;\n this.aggData = newAggData;\n // if no event service, nobody has registered for events, so no need fire event\n if (this.eventService) {\n var eventFunc = function (colId) {\n var value = _this.aggData ? _this.aggData[colId] : undefined;\n var oldValue = oldAggData ? oldAggData[colId] : undefined;\n if (value === oldValue) {\n return;\n }\n // do a quick lookup - despite the event it's possible the column no longer exists\n var column = _this.beans.columnModel.lookupGridColumn(colId);\n if (!column) {\n return;\n }\n _this.dispatchCellChangedEvent(column, value, oldValue);\n };\n for (var key in this.aggData) {\n eventFunc(key);\n }\n for (var key in newAggData) {\n if (key in this.aggData) {\n continue;\n } // skip if already fired an event.\n eventFunc(key);\n }\n }\n };\n RowNode.prototype.updateHasChildren = function () {\n // in CSRM, the group property will be set before the childrenAfterGroup property, check both to prevent flickering\n var newValue = (this.group && !this.footer) || (this.childrenAfterGroup && this.childrenAfterGroup.length > 0);\n var isSsrm = this.beans.gridOptionsService.isRowModelType('serverSide');\n if (isSsrm) {\n var isTreeData = this.beans.gridOptionsService.get('treeData');\n var isGroupFunc = this.beans.gridOptionsService.get('isServerSideGroup');\n // stubs and footers can never have children, as they're grid rows. if tree data the presence of children\n // is determined by the isServerSideGroup callback, if not tree data then the rows group property will be set.\n newValue = !this.stub && !this.footer && (isTreeData ? !!isGroupFunc && isGroupFunc(this.data) : !!this.group);\n }\n if (newValue !== this.__hasChildren) {\n this.__hasChildren = !!newValue;\n if (this.eventService) {\n this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_HAS_CHILDREN_CHANGED));\n }\n }\n };\n RowNode.prototype.hasChildren = function () {\n if (this.__hasChildren == null) {\n this.updateHasChildren();\n }\n return this.__hasChildren;\n };\n RowNode.prototype.isEmptyRowGroupNode = function () {\n return this.group && missingOrEmpty(this.childrenAfterGroup);\n };\n RowNode.prototype.dispatchCellChangedEvent = function (column, newValue, oldValue) {\n var cellChangedEvent = {\n type: RowNode.EVENT_CELL_CHANGED,\n node: this,\n column: column,\n newValue: newValue,\n oldValue: oldValue\n };\n this.dispatchLocalEvent(cellChangedEvent);\n };\n /**\n * The first time `quickFilter` runs, the grid creates a one-off string representation of the row.\n * This string is then used for the quick filter instead of hitting each column separately.\n * When you edit, using grid editing, this string gets cleared down.\n * However if you edit without using grid editing, you will need to clear this string down for the row to be updated with the new values.\n * Otherwise new values will not work with the `quickFilter`. */\n RowNode.prototype.resetQuickFilterAggregateText = function () {\n this.quickFilterAggregateText = null;\n };\n /** Returns:\n * - `true` if the node can be expanded, i.e it is a group or master row.\n * - `false` if the node cannot be expanded\n */\n RowNode.prototype.isExpandable = function () {\n if (this.footer) {\n return false;\n }\n if (this.beans.columnModel.isPivotMode()) {\n // master detail and leaf groups aren't expandable in pivot mode.\n return this.hasChildren() && !this.leafGroup;\n }\n return this.hasChildren() || !!this.master;\n };\n /** Returns:\n * - `true` if node is selected,\n * - `false` if the node isn't selected\n * - `undefined` if it's partially selected (group where not all children are selected). */\n RowNode.prototype.isSelected = function () {\n // for footers, we just return what our sibling selected state is, as cannot select a footer\n if (this.footer) {\n return this.sibling.isSelected();\n }\n return this.selected;\n };\n /** Perform a depth-first search of this node and its children. */\n RowNode.prototype.depthFirstSearch = function (callback) {\n if (this.childrenAfterGroup) {\n this.childrenAfterGroup.forEach(function (child) { return child.depthFirstSearch(callback); });\n }\n callback(this);\n };\n // + selectionController.calculatedSelectedForAllGroupNodes()\n RowNode.prototype.calculateSelectedFromChildren = function () {\n var _a;\n var atLeastOneSelected = false;\n var atLeastOneDeSelected = false;\n var atLeastOneMixed = false;\n if (!((_a = this.childrenAfterGroup) === null || _a === void 0 ? void 0 : _a.length)) {\n return this.selectable ? this.selected : null;\n }\n for (var i = 0; i < this.childrenAfterGroup.length; i++) {\n var child = this.childrenAfterGroup[i];\n var childState = child.isSelected();\n // non-selectable nodes must be calculated from their children, or ignored if no value results.\n if (!child.selectable) {\n var selectable = child.calculateSelectedFromChildren();\n if (selectable === null) {\n continue;\n }\n childState = selectable;\n }\n switch (childState) {\n case true:\n atLeastOneSelected = true;\n break;\n case false:\n atLeastOneDeSelected = true;\n break;\n default:\n atLeastOneMixed = true;\n break;\n }\n }\n if (atLeastOneMixed || (atLeastOneSelected && atLeastOneDeSelected)) {\n return undefined;\n }\n if (atLeastOneSelected) {\n return true;\n }\n if (atLeastOneDeSelected) {\n return false;\n }\n if (!this.selectable) {\n return null;\n }\n return this.selected;\n };\n RowNode.prototype.setSelectedInitialValue = function (selected) {\n this.selected = selected;\n };\n RowNode.prototype.selectThisNode = function (newValue, e, source) {\n if (source === void 0) { source = 'api'; }\n // we only check selectable when newValue=true (ie selecting) to allow unselecting values,\n // as selectable is dynamic, need a way to unselect rows when selectable becomes false.\n var selectionNotAllowed = !this.selectable && newValue;\n var selectionNotChanged = this.selected === newValue;\n if (selectionNotAllowed || selectionNotChanged) {\n return false;\n }\n this.selected = newValue;\n if (this.eventService) {\n this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_ROW_SELECTED));\n var sibling = this.sibling;\n if (sibling && sibling.footer) {\n sibling.dispatchLocalEvent(sibling.createLocalRowEvent(RowNode.EVENT_ROW_SELECTED));\n }\n }\n var event = __assign$j(__assign$j({}, this.createGlobalRowEvent(Events.EVENT_ROW_SELECTED)), { event: e || null, source: source });\n this.beans.eventService.dispatchEvent(event);\n return true;\n };\n /**\n * Select (or deselect) the node.\n * @param newValue -`true` for selection, `false` for deselection.\n * @param clearSelection - If selecting, then passing `true` will select the node exclusively (i.e. NOT do multi select). If doing deselection, `clearSelection` has no impact.\n * @param source - Source property that will appear in the `selectionChanged` event.\n */\n RowNode.prototype.setSelected = function (newValue, clearSelection, source) {\n if (clearSelection === void 0) { clearSelection = false; }\n if (source === void 0) { source = 'api'; }\n if (typeof source === 'boolean') {\n console.warn('AG Grid: since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.');\n return;\n }\n this.setSelectedParams({\n newValue: newValue,\n clearSelection: clearSelection,\n rangeSelect: false,\n source: source\n });\n };\n // this is for internal use only. To make calling code more readable, this is the same method as setSelected except it takes names parameters\n RowNode.prototype.setSelectedParams = function (params) {\n if (this.rowPinned) {\n console.warn('AG Grid: cannot select pinned rows');\n return 0;\n }\n if (this.id === undefined) {\n console.warn('AG Grid: cannot select node until id for node is known');\n return 0;\n }\n return this.beans.selectionService.setNodesSelected(__assign$j(__assign$j({}, params), { nodes: [this.footer ? this.sibling : this] }));\n };\n /**\n * Returns:\n * - `true` if node is either pinned to the `top` or `bottom`\n * - `false` if the node isn't pinned\n */\n RowNode.prototype.isRowPinned = function () {\n return this.rowPinned === 'top' || this.rowPinned === 'bottom';\n };\n RowNode.prototype.isParentOfNode = function (potentialParent) {\n var parentNode = this.parent;\n while (parentNode) {\n if (parentNode === potentialParent) {\n return true;\n }\n parentNode = parentNode.parent;\n }\n return false;\n };\n /** Add an event listener. */\n RowNode.prototype.addEventListener = function (eventType, userListener) {\n var _a, _b;\n if (!this.eventService) {\n this.eventService = new EventService();\n }\n if (this.beans.frameworkOverrides.shouldWrapOutgoing && !this.frameworkEventListenerService) {\n this.eventService.setFrameworkOverrides(this.beans.frameworkOverrides);\n this.frameworkEventListenerService = new FrameworkEventListenerService(this.beans.frameworkOverrides);\n }\n var listener = (_b = (_a = this.frameworkEventListenerService) === null || _a === void 0 ? void 0 : _a.wrap(userListener)) !== null && _b !== void 0 ? _b : userListener;\n this.eventService.addEventListener(eventType, listener);\n };\n /** Remove event listener. */\n RowNode.prototype.removeEventListener = function (eventType, userListener) {\n var _a, _b;\n if (!this.eventService) {\n return;\n }\n var listener = (_b = (_a = this.frameworkEventListenerService) === null || _a === void 0 ? void 0 : _a.unwrap(userListener)) !== null && _b !== void 0 ? _b : userListener;\n this.eventService.removeEventListener(eventType, listener);\n if (this.eventService.noRegisteredListenersExist()) {\n this.eventService = null;\n }\n };\n RowNode.prototype.onMouseEnter = function () {\n this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_MOUSE_ENTER));\n };\n RowNode.prototype.onMouseLeave = function () {\n this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_MOUSE_LEAVE));\n };\n RowNode.prototype.getFirstChildOfFirstChild = function (rowGroupColumn) {\n var currentRowNode = this;\n var isCandidate = true;\n var foundFirstChildPath = false;\n var nodeToSwapIn = null;\n // if we are hiding groups, then if we are the first child, of the first child,\n // all the way up to the column we are interested in, then we show the group cell.\n while (isCandidate && !foundFirstChildPath) {\n var parentRowNode = currentRowNode.parent;\n var firstChild = exists(parentRowNode) && currentRowNode.firstChild;\n if (firstChild) {\n if (parentRowNode.rowGroupColumn === rowGroupColumn) {\n foundFirstChildPath = true;\n nodeToSwapIn = parentRowNode;\n }\n }\n else {\n isCandidate = false;\n }\n currentRowNode = parentRowNode;\n }\n return foundFirstChildPath ? nodeToSwapIn : null;\n };\n /**\n * Returns:\n * - `true` if the node is a full width cell\n * - `false` if the node is not a full width cell\n */\n RowNode.prototype.isFullWidthCell = function () {\n if (this.detail) {\n return true;\n }\n var isFullWidthCellFunc = this.beans.gridOptionsService.getCallback('isFullWidthRow');\n return isFullWidthCellFunc ? isFullWidthCellFunc({ rowNode: this }) : false;\n };\n /**\n * Returns the route of the row node. If the Row Node is a group, it returns the route to that Row Node.\n * If the Row Node is not a group, it returns `undefined`.\n */\n RowNode.prototype.getRoute = function () {\n if (this.key == null) {\n return;\n }\n var res = [];\n var pointer = this;\n while (pointer.key != null) {\n res.push(pointer.key);\n pointer = pointer.parent;\n }\n return res.reverse();\n };\n RowNode.prototype.createFooter = function () {\n var _this = this;\n // only create footer node once, otherwise we have daemons and\n // the animate screws up with the daemons hanging around\n if (this.sibling) {\n return;\n }\n // we don't copy these properties as they cause the footer node\n // to have properties which should be unique to the row.\n var ignoredProperties = new Set([\n 'eventService',\n '__objectId',\n 'sticky',\n ]);\n var footerNode = new RowNode(this.beans);\n Object.keys(this).forEach(function (key) {\n if (ignoredProperties.has(key)) {\n return;\n }\n footerNode[key] = _this[key];\n });\n footerNode.footer = true;\n footerNode.setRowTop(null);\n footerNode.setRowIndex(null);\n // manually set oldRowTop to null so we discard any\n // previous information about its position.\n footerNode.oldRowTop = null;\n footerNode.id = 'rowGroupFooter_' + this.id;\n // get both header and footer to reference each other as siblings. this is never undone,\n // only overwritten. so if a group is expanded, then contracted, it will have a ghost\n // sibling - but that's fine, as we can ignore this if the header is contracted.\n footerNode.sibling = this;\n this.sibling = footerNode;\n };\n // Only used by SSRM. In CSRM this is never used as footers should always be present for\n // the purpose of exporting collapsed groups. In SSRM it is not possible to export collapsed\n // groups anyway, so can destroy footers.\n RowNode.prototype.destroyFooter = function () {\n if (!this.sibling) {\n return;\n }\n this.sibling.setRowTop(null);\n this.sibling.setRowIndex(null);\n this.sibling = undefined;\n };\n RowNode.ID_PREFIX_ROW_GROUP = 'row-group-';\n RowNode.ID_PREFIX_TOP_PINNED = 't-';\n RowNode.ID_PREFIX_BOTTOM_PINNED = 'b-';\n RowNode.OBJECT_ID_SEQUENCE = 0;\n RowNode.EVENT_ROW_SELECTED = 'rowSelected';\n RowNode.EVENT_DATA_CHANGED = 'dataChanged';\n RowNode.EVENT_CELL_CHANGED = 'cellChanged';\n RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED = 'allChildrenCountChanged';\n RowNode.EVENT_MASTER_CHANGED = 'masterChanged';\n RowNode.EVENT_GROUP_CHANGED = 'groupChanged';\n RowNode.EVENT_MOUSE_ENTER = 'mouseEnter';\n RowNode.EVENT_MOUSE_LEAVE = 'mouseLeave';\n RowNode.EVENT_HEIGHT_CHANGED = 'heightChanged';\n RowNode.EVENT_TOP_CHANGED = 'topChanged';\n RowNode.EVENT_DISPLAYED_CHANGED = 'displayedChanged';\n RowNode.EVENT_FIRST_CHILD_CHANGED = 'firstChildChanged';\n RowNode.EVENT_LAST_CHILD_CHANGED = 'lastChildChanged';\n RowNode.EVENT_CHILD_INDEX_CHANGED = 'childIndexChanged';\n RowNode.EVENT_ROW_INDEX_CHANGED = 'rowIndexChanged';\n RowNode.EVENT_EXPANDED_CHANGED = 'expandedChanged';\n RowNode.EVENT_HAS_CHILDREN_CHANGED = 'hasChildrenChanged';\n RowNode.EVENT_SELECTABLE_CHANGED = 'selectableChanged';\n RowNode.EVENT_UI_LEVEL_CHANGED = 'uiLevelChanged';\n RowNode.EVENT_HIGHLIGHT_CHANGED = 'rowHighlightChanged';\n RowNode.EVENT_DRAGGING_CHANGED = 'draggingChanged';\n return RowNode;\n}());\n\nvar __extends$2B = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$i = ( false) || function () {\n __assign$i = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$i.apply(this, arguments);\n};\nvar __decorate$2h = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar CheckboxSelectionComponent = /** @class */ (function (_super) {\n __extends$2B(CheckboxSelectionComponent, _super);\n function CheckboxSelectionComponent() {\n return _super.call(this, /* html*/ \"\\n
\\n \\n
\") || this;\n }\n CheckboxSelectionComponent.prototype.postConstruct = function () {\n this.eCheckbox.setPassive(true);\n };\n CheckboxSelectionComponent.prototype.getCheckboxId = function () {\n return this.eCheckbox.getInputElement().id;\n };\n CheckboxSelectionComponent.prototype.onDataChanged = function () {\n // when rows are loaded for the second time, this can impact the selection, as a row\n // could be loaded as already selected (if user scrolls down, and then up again).\n this.onSelectionChanged();\n };\n CheckboxSelectionComponent.prototype.onSelectableChanged = function () {\n this.showOrHideSelect();\n };\n CheckboxSelectionComponent.prototype.onSelectionChanged = function () {\n var state = this.rowNode.isSelected();\n this.eCheckbox.setValue(state, true);\n };\n CheckboxSelectionComponent.prototype.onClicked = function (newValue, groupSelectsFiltered, event) {\n return this.rowNode.setSelectedParams({ newValue: newValue, rangeSelect: event.shiftKey, groupSelectsFiltered: groupSelectsFiltered, event: event, source: 'checkboxSelected' });\n };\n CheckboxSelectionComponent.prototype.init = function (params) {\n var _this = this;\n this.rowNode = params.rowNode;\n this.column = params.column;\n this.overrides = params.overrides;\n this.onSelectionChanged();\n // we don't want double click on this icon to open a group\n this.addManagedListener(this.eCheckbox.getInputElement(), 'dblclick', function (event) {\n stopPropagationForAgGrid(event);\n });\n this.addManagedListener(this.eCheckbox.getInputElement(), 'click', function (event) {\n // we don't want the row clicked event to fire when selecting the checkbox, otherwise the row\n // would possibly get selected twice\n stopPropagationForAgGrid(event);\n var groupSelectsFiltered = _this.gridOptionsService.get('groupSelectsFiltered');\n var isSelected = _this.eCheckbox.getValue();\n if (_this.shouldHandleIndeterminateState(isSelected, groupSelectsFiltered)) {\n // try toggling children to determine action.\n var result = _this.onClicked(true, groupSelectsFiltered, event || {});\n if (result === 0) {\n _this.onClicked(false, groupSelectsFiltered, event);\n }\n }\n else if (isSelected) {\n _this.onClicked(false, groupSelectsFiltered, event);\n }\n else {\n _this.onClicked(true, groupSelectsFiltered, event || {});\n }\n });\n this.addManagedListener(this.rowNode, RowNode.EVENT_ROW_SELECTED, this.onSelectionChanged.bind(this));\n this.addManagedListener(this.rowNode, RowNode.EVENT_DATA_CHANGED, this.onDataChanged.bind(this));\n this.addManagedListener(this.rowNode, RowNode.EVENT_SELECTABLE_CHANGED, this.onSelectableChanged.bind(this));\n var isRowSelectableFunc = this.gridOptionsService.get('isRowSelectable');\n var checkboxVisibleIsDynamic = isRowSelectableFunc || typeof this.getIsVisible() === 'function';\n if (checkboxVisibleIsDynamic) {\n var showOrHideSelectListener = this.showOrHideSelect.bind(this);\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, showOrHideSelectListener);\n this.addManagedListener(this.rowNode, RowNode.EVENT_DATA_CHANGED, showOrHideSelectListener);\n this.addManagedListener(this.rowNode, RowNode.EVENT_CELL_CHANGED, showOrHideSelectListener);\n this.showOrHideSelect();\n }\n this.eCheckbox.getInputElement().setAttribute('tabindex', '-1');\n };\n CheckboxSelectionComponent.prototype.shouldHandleIndeterminateState = function (isSelected, groupSelectsFiltered) {\n // for CSRM groupSelectsFiltered, we can get an indeterminate state where all filtered children are selected,\n // and we would expect clicking to deselect all rather than select all\n return groupSelectsFiltered &&\n (this.eCheckbox.getPreviousValue() === undefined || isSelected === undefined) &&\n this.gridOptionsService.isRowModelType('clientSide');\n };\n CheckboxSelectionComponent.prototype.showOrHideSelect = function () {\n var _a, _b, _c, _d;\n // if the isRowSelectable() is not provided the row node is selectable by default\n var selectable = this.rowNode.selectable;\n // checkboxSelection callback is deemed a legacy solution however we will still consider it's result.\n // If selectable, then also check the colDef callback. if not selectable, this it short circuits - no need\n // to call the colDef callback.\n var isVisible = this.getIsVisible();\n if (selectable) {\n if (typeof isVisible === 'function') {\n var extraParams = (_a = this.overrides) === null || _a === void 0 ? void 0 : _a.callbackParams;\n var params = (_b = this.column) === null || _b === void 0 ? void 0 : _b.createColumnFunctionCallbackParams(this.rowNode);\n selectable = params ? isVisible(__assign$i(__assign$i({}, extraParams), params)) : false;\n }\n else {\n selectable = isVisible !== null && isVisible !== void 0 ? isVisible : false;\n }\n }\n var disableInsteadOfHide = (_c = this.column) === null || _c === void 0 ? void 0 : _c.getColDef().showDisabledCheckboxes;\n if (disableInsteadOfHide) {\n this.eCheckbox.setDisabled(!selectable);\n this.setVisible(true);\n this.setDisplayed(true);\n return;\n }\n if ((_d = this.overrides) === null || _d === void 0 ? void 0 : _d.removeHidden) {\n this.setDisplayed(selectable);\n return;\n }\n this.setVisible(selectable);\n };\n CheckboxSelectionComponent.prototype.getIsVisible = function () {\n var _a, _b;\n if (this.overrides) {\n return this.overrides.isVisible;\n }\n // column will be missing if groupDisplayType = 'groupRows'\n return (_b = (_a = this.column) === null || _a === void 0 ? void 0 : _a.getColDef()) === null || _b === void 0 ? void 0 : _b.checkboxSelection;\n };\n __decorate$2h([\n RefSelector('eCheckbox')\n ], CheckboxSelectionComponent.prototype, \"eCheckbox\", void 0);\n __decorate$2h([\n PostConstruct\n ], CheckboxSelectionComponent.prototype, \"postConstruct\", null);\n return CheckboxSelectionComponent;\n}(Component));\n\nvar VerticalDirection;\n(function (VerticalDirection) {\n VerticalDirection[VerticalDirection[\"Up\"] = 0] = \"Up\";\n VerticalDirection[VerticalDirection[\"Down\"] = 1] = \"Down\";\n})(VerticalDirection || (VerticalDirection = {}));\nvar HorizontalDirection;\n(function (HorizontalDirection) {\n HorizontalDirection[HorizontalDirection[\"Left\"] = 0] = \"Left\";\n HorizontalDirection[HorizontalDirection[\"Right\"] = 1] = \"Right\";\n})(HorizontalDirection || (HorizontalDirection = {}));\n\nvar __extends$2A = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2g = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __values$7 = ( false) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar DragSourceType;\n(function (DragSourceType) {\n DragSourceType[DragSourceType[\"ToolPanel\"] = 0] = \"ToolPanel\";\n DragSourceType[DragSourceType[\"HeaderCell\"] = 1] = \"HeaderCell\";\n DragSourceType[DragSourceType[\"RowDrag\"] = 2] = \"RowDrag\";\n DragSourceType[DragSourceType[\"ChartPanel\"] = 3] = \"ChartPanel\";\n DragSourceType[DragSourceType[\"AdvancedFilterBuilder\"] = 4] = \"AdvancedFilterBuilder\";\n})(DragSourceType || (DragSourceType = {}));\nvar DragAndDropService = /** @class */ (function (_super) {\n __extends$2A(DragAndDropService, _super);\n function DragAndDropService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.dragSourceAndParamsList = [];\n _this.dropTargets = [];\n return _this;\n }\n DragAndDropService_1 = DragAndDropService;\n DragAndDropService.prototype.init = function () {\n this.ePinnedIcon = createIcon('columnMovePin', this.gridOptionsService, null);\n this.eHideIcon = createIcon('columnMoveHide', this.gridOptionsService, null);\n this.eMoveIcon = createIcon('columnMoveMove', this.gridOptionsService, null);\n this.eLeftIcon = createIcon('columnMoveLeft', this.gridOptionsService, null);\n this.eRightIcon = createIcon('columnMoveRight', this.gridOptionsService, null);\n this.eGroupIcon = createIcon('columnMoveGroup', this.gridOptionsService, null);\n this.eAggregateIcon = createIcon('columnMoveValue', this.gridOptionsService, null);\n this.ePivotIcon = createIcon('columnMovePivot', this.gridOptionsService, null);\n this.eDropNotAllowedIcon = createIcon('dropNotAllowed', this.gridOptionsService, null);\n };\n DragAndDropService.prototype.addDragSource = function (dragSource, allowTouch) {\n if (allowTouch === void 0) { allowTouch = false; }\n var params = {\n eElement: dragSource.eElement,\n dragStartPixels: dragSource.dragStartPixels,\n onDragStart: this.onDragStart.bind(this, dragSource),\n onDragStop: this.onDragStop.bind(this),\n onDragging: this.onDragging.bind(this),\n includeTouch: allowTouch\n };\n this.dragSourceAndParamsList.push({ params: params, dragSource: dragSource });\n this.dragService.addDragSource(params);\n };\n DragAndDropService.prototype.removeDragSource = function (dragSource) {\n var sourceAndParams = this.dragSourceAndParamsList.find(function (item) { return item.dragSource === dragSource; });\n if (sourceAndParams) {\n this.dragService.removeDragSource(sourceAndParams.params);\n removeFromArray(this.dragSourceAndParamsList, sourceAndParams);\n }\n };\n DragAndDropService.prototype.clearDragSourceParamsList = function () {\n var _this = this;\n this.dragSourceAndParamsList.forEach(function (sourceAndParams) { return _this.dragService.removeDragSource(sourceAndParams.params); });\n this.dragSourceAndParamsList.length = 0;\n this.dropTargets.length = 0;\n };\n DragAndDropService.prototype.nudge = function () {\n if (this.dragging) {\n this.onDragging(this.eventLastTime, true);\n }\n };\n DragAndDropService.prototype.onDragStart = function (dragSource, mouseEvent) {\n this.dragging = true;\n this.dragSource = dragSource;\n this.eventLastTime = mouseEvent;\n this.dragItem = this.dragSource.getDragItem();\n if (this.dragSource.onDragStarted) {\n this.dragSource.onDragStarted();\n }\n this.createGhost();\n };\n DragAndDropService.prototype.onDragStop = function (mouseEvent) {\n this.eventLastTime = null;\n this.dragging = false;\n if (this.dragSource.onDragStopped) {\n this.dragSource.onDragStopped();\n }\n if (this.lastDropTarget && this.lastDropTarget.onDragStop) {\n var draggingEvent = this.createDropTargetEvent(this.lastDropTarget, mouseEvent, null, null, false);\n this.lastDropTarget.onDragStop(draggingEvent);\n }\n this.lastDropTarget = null;\n this.dragItem = null;\n this.removeGhost();\n };\n DragAndDropService.prototype.onDragging = function (mouseEvent, fromNudge) {\n var _this = this;\n var _a, _b, _c, _d;\n var hDirection = this.getHorizontalDirection(mouseEvent);\n var vDirection = this.getVerticalDirection(mouseEvent);\n this.eventLastTime = mouseEvent;\n this.positionGhost(mouseEvent);\n // check if mouseEvent intersects with any of the drop targets\n var validDropTargets = this.dropTargets.filter(function (target) { return _this.isMouseOnDropTarget(mouseEvent, target); });\n var dropTarget = this.findCurrentDropTarget(mouseEvent, validDropTargets);\n if (dropTarget !== this.lastDropTarget) {\n this.leaveLastTargetIfExists(mouseEvent, hDirection, vDirection, fromNudge);\n if (this.lastDropTarget !== null && dropTarget === null) {\n (_b = (_a = this.dragSource).onGridExit) === null || _b === void 0 ? void 0 : _b.call(_a, this.dragItem);\n }\n if (this.lastDropTarget === null && dropTarget !== null) {\n (_d = (_c = this.dragSource).onGridEnter) === null || _d === void 0 ? void 0 : _d.call(_c, this.dragItem);\n }\n this.enterDragTargetIfExists(dropTarget, mouseEvent, hDirection, vDirection, fromNudge);\n this.lastDropTarget = dropTarget;\n }\n else if (dropTarget && dropTarget.onDragging) {\n var draggingEvent = this.createDropTargetEvent(dropTarget, mouseEvent, hDirection, vDirection, fromNudge);\n dropTarget.onDragging(draggingEvent);\n }\n };\n DragAndDropService.prototype.getAllContainersFromDropTarget = function (dropTarget) {\n var secondaryContainers = dropTarget.getSecondaryContainers ? dropTarget.getSecondaryContainers() : null;\n var containers = [[dropTarget.getContainer()]];\n return secondaryContainers ? containers.concat(secondaryContainers) : containers;\n };\n DragAndDropService.prototype.allContainersIntersect = function (mouseEvent, containers) {\n var e_1, _a;\n try {\n for (var containers_1 = __values$7(containers), containers_1_1 = containers_1.next(); !containers_1_1.done; containers_1_1 = containers_1.next()) {\n var container = containers_1_1.value;\n var rect = container.getBoundingClientRect();\n // if element is not visible, then width and height are zero\n if (rect.width === 0 || rect.height === 0) {\n return false;\n }\n var horizontalFit = mouseEvent.clientX >= rect.left && mouseEvent.clientX < rect.right;\n var verticalFit = mouseEvent.clientY >= rect.top && mouseEvent.clientY < rect.bottom;\n if (!horizontalFit || !verticalFit) {\n return false;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (containers_1_1 && !containers_1_1.done && (_a = containers_1.return)) _a.call(containers_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return true;\n };\n // checks if the mouse is on the drop target. it checks eContainer and eSecondaryContainers\n DragAndDropService.prototype.isMouseOnDropTarget = function (mouseEvent, dropTarget) {\n var e_2, _a;\n var allContainersFromDropTarget = this.getAllContainersFromDropTarget(dropTarget);\n var mouseOverTarget = false;\n try {\n for (var allContainersFromDropTarget_1 = __values$7(allContainersFromDropTarget), allContainersFromDropTarget_1_1 = allContainersFromDropTarget_1.next(); !allContainersFromDropTarget_1_1.done; allContainersFromDropTarget_1_1 = allContainersFromDropTarget_1.next()) {\n var currentContainers = allContainersFromDropTarget_1_1.value;\n if (this.allContainersIntersect(mouseEvent, currentContainers)) {\n mouseOverTarget = true;\n break;\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (allContainersFromDropTarget_1_1 && !allContainersFromDropTarget_1_1.done && (_a = allContainersFromDropTarget_1.return)) _a.call(allContainersFromDropTarget_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n if (dropTarget.targetContainsSource && !dropTarget.getContainer().contains(this.dragSource.eElement)) {\n return false;\n }\n return mouseOverTarget && dropTarget.isInterestedIn(this.dragSource.type, this.dragSource.eElement);\n };\n DragAndDropService.prototype.findCurrentDropTarget = function (mouseEvent, validDropTargets) {\n var e_3, _a, e_4, _b;\n var len = validDropTargets.length;\n if (len === 0) {\n return null;\n }\n if (len === 1) {\n return validDropTargets[0];\n }\n var rootNode = this.gridOptionsService.getRootNode();\n // elementsFromPoint return a list of elements under\n // the mouseEvent sorted from topMost to bottomMost\n var elementStack = rootNode.elementsFromPoint(mouseEvent.clientX, mouseEvent.clientY);\n try {\n // loop over the sorted elementStack to find which dropTarget comes first\n for (var elementStack_1 = __values$7(elementStack), elementStack_1_1 = elementStack_1.next(); !elementStack_1_1.done; elementStack_1_1 = elementStack_1.next()) {\n var el = elementStack_1_1.value;\n try {\n for (var validDropTargets_1 = (e_4 = void 0, __values$7(validDropTargets)), validDropTargets_1_1 = validDropTargets_1.next(); !validDropTargets_1_1.done; validDropTargets_1_1 = validDropTargets_1.next()) {\n var dropTarget = validDropTargets_1_1.value;\n var containers = flatten(this.getAllContainersFromDropTarget(dropTarget));\n if (containers.indexOf(el) !== -1) {\n return dropTarget;\n }\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (validDropTargets_1_1 && !validDropTargets_1_1.done && (_b = validDropTargets_1.return)) _b.call(validDropTargets_1);\n }\n finally { if (e_4) throw e_4.error; }\n }\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (elementStack_1_1 && !elementStack_1_1.done && (_a = elementStack_1.return)) _a.call(elementStack_1);\n }\n finally { if (e_3) throw e_3.error; }\n }\n // we should never hit this point of the code because only\n // valid dropTargets should be provided to this method.\n return null;\n };\n DragAndDropService.prototype.enterDragTargetIfExists = function (dropTarget, mouseEvent, hDirection, vDirection, fromNudge) {\n if (!dropTarget) {\n return;\n }\n if (dropTarget.onDragEnter) {\n var dragEnterEvent = this.createDropTargetEvent(dropTarget, mouseEvent, hDirection, vDirection, fromNudge);\n dropTarget.onDragEnter(dragEnterEvent);\n }\n this.setGhostIcon(dropTarget.getIconName ? dropTarget.getIconName() : null);\n };\n DragAndDropService.prototype.leaveLastTargetIfExists = function (mouseEvent, hDirection, vDirection, fromNudge) {\n if (!this.lastDropTarget) {\n return;\n }\n if (this.lastDropTarget.onDragLeave) {\n var dragLeaveEvent = this.createDropTargetEvent(this.lastDropTarget, mouseEvent, hDirection, vDirection, fromNudge);\n this.lastDropTarget.onDragLeave(dragLeaveEvent);\n }\n this.setGhostIcon(null);\n };\n DragAndDropService.prototype.addDropTarget = function (dropTarget) {\n this.dropTargets.push(dropTarget);\n };\n DragAndDropService.prototype.removeDropTarget = function (dropTarget) {\n this.dropTargets = this.dropTargets.filter(function (target) { return target.getContainer() !== dropTarget.getContainer(); });\n };\n DragAndDropService.prototype.hasExternalDropZones = function () {\n return this.dropTargets.some(function (zones) { return zones.external; });\n };\n DragAndDropService.prototype.findExternalZone = function (params) {\n var externalTargets = this.dropTargets.filter(function (target) { return target.external; });\n return externalTargets.find(function (zone) { return zone.getContainer() === params.getContainer(); }) || null;\n };\n DragAndDropService.prototype.getHorizontalDirection = function (event) {\n var clientX = this.eventLastTime && this.eventLastTime.clientX;\n var eClientX = event.clientX;\n if (clientX === eClientX) {\n return null;\n }\n return clientX > eClientX ? HorizontalDirection.Left : HorizontalDirection.Right;\n };\n DragAndDropService.prototype.getVerticalDirection = function (event) {\n var clientY = this.eventLastTime && this.eventLastTime.clientY;\n var eClientY = event.clientY;\n if (clientY === eClientY) {\n return null;\n }\n return clientY > eClientY ? VerticalDirection.Up : VerticalDirection.Down;\n };\n DragAndDropService.prototype.createDropTargetEvent = function (dropTarget, event, hDirection, vDirection, fromNudge) {\n // localise x and y to the target\n var dropZoneTarget = dropTarget.getContainer();\n var rect = dropZoneTarget.getBoundingClientRect();\n var _a = this, api = _a.gridApi, columnApi = _a.columnApi, dragItem = _a.dragItem, dragSource = _a.dragSource;\n var x = event.clientX - rect.left;\n var y = event.clientY - rect.top;\n return { event: event, x: x, y: y, vDirection: vDirection, hDirection: hDirection, dragSource: dragSource, fromNudge: fromNudge, dragItem: dragItem, api: api, columnApi: columnApi, dropZoneTarget: dropZoneTarget };\n };\n DragAndDropService.prototype.positionGhost = function (event) {\n var ghost = this.eGhost;\n if (!ghost) {\n return;\n }\n var ghostRect = ghost.getBoundingClientRect();\n var ghostHeight = ghostRect.height;\n var browserWidth = getBodyWidth() - 2; // 2px for 1px borderLeft and 1px borderRight\n var browserHeight = getBodyHeight() - 2; // 2px for 1px borderTop and 1px borderBottom\n var offsetParentSize = getElementRectWithOffset(ghost.offsetParent);\n var clientY = event.clientY, clientX = event.clientX;\n var top = (clientY - offsetParentSize.top) - (ghostHeight / 2);\n var left = (clientX - offsetParentSize.left) - 10;\n var eDocument = this.gridOptionsService.getDocument();\n var win = (eDocument.defaultView || window);\n var windowScrollY = win.pageYOffset || eDocument.documentElement.scrollTop;\n var windowScrollX = win.pageXOffset || eDocument.documentElement.scrollLeft;\n // check ghost is not positioned outside of the browser\n if (browserWidth > 0 && ((left + ghost.clientWidth) > (browserWidth + windowScrollX))) {\n left = browserWidth + windowScrollX - ghost.clientWidth;\n }\n if (left < 0) {\n left = 0;\n }\n if (browserHeight > 0 && ((top + ghost.clientHeight) > (browserHeight + windowScrollY))) {\n top = browserHeight + windowScrollY - ghost.clientHeight;\n }\n if (top < 0) {\n top = 0;\n }\n ghost.style.left = \"\".concat(left, \"px\");\n ghost.style.top = \"\".concat(top, \"px\");\n };\n DragAndDropService.prototype.removeGhost = function () {\n if (this.eGhost && this.eGhostParent) {\n this.eGhostParent.removeChild(this.eGhost);\n }\n this.eGhost = null;\n };\n DragAndDropService.prototype.createGhost = function () {\n this.eGhost = loadTemplate(DragAndDropService_1.GHOST_TEMPLATE);\n this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost);\n var theme = this.environment.getTheme().theme;\n if (theme) {\n this.eGhost.classList.add(theme);\n }\n this.eGhostIcon = this.eGhost.querySelector('.ag-dnd-ghost-icon');\n this.setGhostIcon(null);\n var eText = this.eGhost.querySelector('.ag-dnd-ghost-label');\n var dragItemName = this.dragSource.dragItemName;\n if (isFunction(dragItemName)) {\n dragItemName = dragItemName();\n }\n eText.innerHTML = escapeString(dragItemName) || '';\n this.eGhost.style.height = '25px';\n this.eGhost.style.top = '20px';\n this.eGhost.style.left = '20px';\n var eDocument = this.gridOptionsService.getDocument();\n var rootNode = null;\n var targetEl = null;\n try {\n rootNode = eDocument.fullscreenElement;\n }\n catch (e) {\n // some environments like SalesForce will throw errors\n // simply by trying to read the fullscreenElement property\n }\n finally {\n if (!rootNode) {\n rootNode = this.gridOptionsService.getRootNode();\n }\n var body = rootNode.querySelector('body');\n if (body) {\n targetEl = body;\n }\n else if (rootNode instanceof ShadowRoot) {\n targetEl = rootNode;\n }\n else if (rootNode instanceof Document) {\n targetEl = rootNode === null || rootNode === void 0 ? void 0 : rootNode.documentElement;\n }\n else {\n targetEl = rootNode;\n }\n }\n this.eGhostParent = targetEl;\n if (!this.eGhostParent) {\n console.warn('AG Grid: could not find document body, it is needed for dragging columns');\n }\n else {\n this.eGhostParent.appendChild(this.eGhost);\n }\n };\n DragAndDropService.prototype.setGhostIcon = function (iconName, shake) {\n if (shake === void 0) { shake = false; }\n clearElement(this.eGhostIcon);\n var eIcon = null;\n if (!iconName) {\n iconName = this.dragSource.getDefaultIconName ? this.dragSource.getDefaultIconName() : DragAndDropService_1.ICON_NOT_ALLOWED;\n }\n switch (iconName) {\n case DragAndDropService_1.ICON_PINNED:\n eIcon = this.ePinnedIcon;\n break;\n case DragAndDropService_1.ICON_MOVE:\n eIcon = this.eMoveIcon;\n break;\n case DragAndDropService_1.ICON_LEFT:\n eIcon = this.eLeftIcon;\n break;\n case DragAndDropService_1.ICON_RIGHT:\n eIcon = this.eRightIcon;\n break;\n case DragAndDropService_1.ICON_GROUP:\n eIcon = this.eGroupIcon;\n break;\n case DragAndDropService_1.ICON_AGGREGATE:\n eIcon = this.eAggregateIcon;\n break;\n case DragAndDropService_1.ICON_PIVOT:\n eIcon = this.ePivotIcon;\n break;\n case DragAndDropService_1.ICON_NOT_ALLOWED:\n eIcon = this.eDropNotAllowedIcon;\n break;\n case DragAndDropService_1.ICON_HIDE:\n eIcon = this.eHideIcon;\n break;\n }\n this.eGhostIcon.classList.toggle('ag-shake-left-to-right', shake);\n if (eIcon === this.eHideIcon && this.gridOptionsService.get('suppressDragLeaveHidesColumns')) {\n return;\n }\n if (eIcon) {\n this.eGhostIcon.appendChild(eIcon);\n }\n };\n var DragAndDropService_1;\n DragAndDropService.ICON_PINNED = 'pinned';\n DragAndDropService.ICON_MOVE = 'move';\n DragAndDropService.ICON_LEFT = 'left';\n DragAndDropService.ICON_RIGHT = 'right';\n DragAndDropService.ICON_GROUP = 'group';\n DragAndDropService.ICON_AGGREGATE = 'aggregate';\n DragAndDropService.ICON_PIVOT = 'pivot';\n DragAndDropService.ICON_NOT_ALLOWED = 'notAllowed';\n DragAndDropService.ICON_HIDE = 'hide';\n DragAndDropService.GHOST_TEMPLATE = \"
\\n \\n
\\n
\";\n __decorate$2g([\n Autowired('dragService')\n ], DragAndDropService.prototype, \"dragService\", void 0);\n __decorate$2g([\n Autowired('mouseEventService')\n ], DragAndDropService.prototype, \"mouseEventService\", void 0);\n __decorate$2g([\n Autowired('columnApi')\n ], DragAndDropService.prototype, \"columnApi\", void 0);\n __decorate$2g([\n Autowired('gridApi')\n ], DragAndDropService.prototype, \"gridApi\", void 0);\n __decorate$2g([\n PostConstruct\n ], DragAndDropService.prototype, \"init\", null);\n __decorate$2g([\n PreDestroy\n ], DragAndDropService.prototype, \"clearDragSourceParamsList\", null);\n DragAndDropService = DragAndDropService_1 = __decorate$2g([\n Bean('dragAndDropService')\n ], DragAndDropService);\n return DragAndDropService;\n}(BeanStub));\n\nvar __extends$2z = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2f = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar RowDragComp = /** @class */ (function (_super) {\n __extends$2z(RowDragComp, _super);\n function RowDragComp(cellValueFn, rowNode, column, customGui, dragStartPixels, suppressVisibilityChange) {\n var _this = _super.call(this) || this;\n _this.cellValueFn = cellValueFn;\n _this.rowNode = rowNode;\n _this.column = column;\n _this.customGui = customGui;\n _this.dragStartPixels = dragStartPixels;\n _this.suppressVisibilityChange = suppressVisibilityChange;\n _this.dragSource = null;\n return _this;\n }\n RowDragComp.prototype.isCustomGui = function () {\n return this.customGui != null;\n };\n RowDragComp.prototype.postConstruct = function () {\n if (!this.customGui) {\n this.setTemplate(/* html */ \"
\");\n this.getGui().appendChild(createIconNoSpan('rowDrag', this.gridOptionsService, null));\n this.addDragSource();\n }\n else {\n this.setDragElement(this.customGui, this.dragStartPixels);\n }\n this.checkCompatibility();\n if (!this.suppressVisibilityChange) {\n var strategy = this.gridOptionsService.get('rowDragManaged') ?\n new ManagedVisibilityStrategy(this, this.beans, this.rowNode, this.column) :\n new NonManagedVisibilityStrategy(this, this.beans, this.rowNode, this.column);\n this.createManagedBean(strategy, this.beans.context);\n }\n };\n RowDragComp.prototype.setDragElement = function (dragElement, dragStartPixels) {\n this.setTemplateFromElement(dragElement);\n this.addDragSource(dragStartPixels);\n };\n RowDragComp.prototype.getSelectedNodes = function () {\n var isRowDragMultiRow = this.gridOptionsService.get('rowDragMultiRow');\n if (!isRowDragMultiRow) {\n return [this.rowNode];\n }\n var selection = this.beans.selectionService.getSelectedNodes();\n return selection.indexOf(this.rowNode) !== -1 ? selection : [this.rowNode];\n };\n // returns true if all compatibility items work out\n RowDragComp.prototype.checkCompatibility = function () {\n var managed = this.gridOptionsService.get('rowDragManaged');\n var treeData = this.gridOptionsService.get('treeData');\n if (treeData && managed) {\n warnOnce('If using row drag with tree data, you cannot have rowDragManaged=true');\n }\n };\n RowDragComp.prototype.getDragItem = function () {\n return {\n rowNode: this.rowNode,\n rowNodes: this.getSelectedNodes(),\n columns: this.column ? [this.column] : undefined,\n defaultTextValue: this.cellValueFn(),\n };\n };\n RowDragComp.prototype.getRowDragText = function (column) {\n if (column) {\n var colDef = column.getColDef();\n if (colDef.rowDragText) {\n return colDef.rowDragText;\n }\n }\n return this.gridOptionsService.get('rowDragText');\n };\n RowDragComp.prototype.addDragSource = function (dragStartPixels) {\n var _this = this;\n if (dragStartPixels === void 0) { dragStartPixels = 4; }\n // if this is changing the drag element, delete the previous dragSource\n if (this.dragSource) {\n this.removeDragSource();\n }\n var translate = this.localeService.getLocaleTextFunc();\n this.dragSource = {\n type: DragSourceType.RowDrag,\n eElement: this.getGui(),\n dragItemName: function () {\n var _a;\n var dragItem = _this.getDragItem();\n var dragItemCount = ((_a = dragItem.rowNodes) === null || _a === void 0 ? void 0 : _a.length) || 1;\n var rowDragText = _this.getRowDragText(_this.column);\n if (rowDragText) {\n return rowDragText(dragItem, dragItemCount);\n }\n return dragItemCount === 1 ? _this.cellValueFn() : \"\".concat(dragItemCount, \" \").concat(translate('rowDragRows', 'rows'));\n },\n getDragItem: function () { return _this.getDragItem(); },\n dragStartPixels: dragStartPixels,\n dragSourceDomDataKey: this.gridOptionsService.getDomDataKey()\n };\n this.beans.dragAndDropService.addDragSource(this.dragSource, true);\n };\n RowDragComp.prototype.removeDragSource = function () {\n if (this.dragSource) {\n this.beans.dragAndDropService.removeDragSource(this.dragSource);\n }\n this.dragSource = null;\n };\n __decorate$2f([\n Autowired('beans')\n ], RowDragComp.prototype, \"beans\", void 0);\n __decorate$2f([\n PostConstruct\n ], RowDragComp.prototype, \"postConstruct\", null);\n __decorate$2f([\n PreDestroy\n ], RowDragComp.prototype, \"removeDragSource\", null);\n return RowDragComp;\n}(Component));\nvar VisibilityStrategy = /** @class */ (function (_super) {\n __extends$2z(VisibilityStrategy, _super);\n function VisibilityStrategy(parent, rowNode, column) {\n var _this = _super.call(this) || this;\n _this.parent = parent;\n _this.rowNode = rowNode;\n _this.column = column;\n return _this;\n }\n VisibilityStrategy.prototype.setDisplayedOrVisible = function (neverDisplayed) {\n var displayedOptions = { skipAriaHidden: true };\n if (neverDisplayed) {\n this.parent.setDisplayed(false, displayedOptions);\n }\n else {\n var shown = true;\n var isShownSometimes = false;\n if (this.column) {\n shown = this.column.isRowDrag(this.rowNode) || this.parent.isCustomGui();\n isShownSometimes = isFunction(this.column.getColDef().rowDrag);\n }\n // if shown sometimes, them some rows can have drag handle while other don't,\n // so we use setVisible to keep the handles horizontally aligned (as setVisible\n // keeps the empty space, whereas setDisplayed looses the space)\n if (isShownSometimes) {\n this.parent.setDisplayed(true, displayedOptions);\n this.parent.setVisible(shown, displayedOptions);\n }\n else {\n this.parent.setDisplayed(shown, displayedOptions);\n this.parent.setVisible(true, displayedOptions);\n }\n }\n };\n return VisibilityStrategy;\n}(BeanStub));\n// when non managed, the visibility depends on suppressRowDrag property only\nvar NonManagedVisibilityStrategy = /** @class */ (function (_super) {\n __extends$2z(NonManagedVisibilityStrategy, _super);\n function NonManagedVisibilityStrategy(parent, beans, rowNode, column) {\n var _this = _super.call(this, parent, rowNode, column) || this;\n _this.beans = beans;\n return _this;\n }\n NonManagedVisibilityStrategy.prototype.postConstruct = function () {\n this.addManagedPropertyListener('suppressRowDrag', this.onSuppressRowDrag.bind(this));\n // in case data changes, then we need to update visibility of drag item\n this.addManagedListener(this.rowNode, RowNode.EVENT_DATA_CHANGED, this.workOutVisibility.bind(this));\n this.addManagedListener(this.rowNode, RowNode.EVENT_CELL_CHANGED, this.workOutVisibility.bind(this));\n this.addManagedListener(this.rowNode, RowNode.EVENT_CELL_CHANGED, this.workOutVisibility.bind(this));\n this.addManagedListener(this.beans.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.workOutVisibility.bind(this));\n this.workOutVisibility();\n };\n NonManagedVisibilityStrategy.prototype.onSuppressRowDrag = function () {\n this.workOutVisibility();\n };\n NonManagedVisibilityStrategy.prototype.workOutVisibility = function () {\n // only show the drag if both sort and filter are not present\n var neverDisplayed = this.gridOptionsService.get('suppressRowDrag');\n this.setDisplayedOrVisible(neverDisplayed);\n };\n __decorate$2f([\n PostConstruct\n ], NonManagedVisibilityStrategy.prototype, \"postConstruct\", null);\n return NonManagedVisibilityStrategy;\n}(VisibilityStrategy));\n// when managed, the visibility depends on sort, filter and row group, as well as suppressRowDrag property\nvar ManagedVisibilityStrategy = /** @class */ (function (_super) {\n __extends$2z(ManagedVisibilityStrategy, _super);\n function ManagedVisibilityStrategy(parent, beans, rowNode, column) {\n var _this = _super.call(this, parent, rowNode, column) || this;\n _this.beans = beans;\n return _this;\n }\n ManagedVisibilityStrategy.prototype.postConstruct = function () {\n // we do not show the component if sort, filter or grouping is active\n this.addManagedListener(this.beans.eventService, Events.EVENT_SORT_CHANGED, this.workOutVisibility.bind(this));\n this.addManagedListener(this.beans.eventService, Events.EVENT_FILTER_CHANGED, this.workOutVisibility.bind(this));\n this.addManagedListener(this.beans.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.workOutVisibility.bind(this));\n this.addManagedListener(this.beans.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.workOutVisibility.bind(this));\n // in case data changes, then we need to update visibility of drag item\n this.addManagedListener(this.rowNode, RowNode.EVENT_DATA_CHANGED, this.workOutVisibility.bind(this));\n this.addManagedListener(this.rowNode, RowNode.EVENT_CELL_CHANGED, this.workOutVisibility.bind(this));\n this.addManagedPropertyListener('suppressRowDrag', this.onSuppressRowDrag.bind(this));\n this.workOutVisibility();\n };\n ManagedVisibilityStrategy.prototype.onSuppressRowDrag = function () {\n this.workOutVisibility();\n };\n ManagedVisibilityStrategy.prototype.workOutVisibility = function () {\n // only show the drag if both sort and filter are not present\n var gridBodyCon = this.beans.ctrlsService.getGridBodyCtrl();\n var rowDragFeature = gridBodyCon.getRowDragFeature();\n var shouldPreventRowMove = rowDragFeature && rowDragFeature.shouldPreventRowMove();\n var suppressRowDrag = this.gridOptionsService.get('suppressRowDrag');\n var hasExternalDropZones = this.beans.dragAndDropService.hasExternalDropZones();\n var neverDisplayed = (shouldPreventRowMove && !hasExternalDropZones) || suppressRowDrag;\n this.setDisplayedOrVisible(neverDisplayed);\n };\n __decorate$2f([\n PostConstruct\n ], ManagedVisibilityStrategy.prototype, \"postConstruct\", null);\n return ManagedVisibilityStrategy;\n}(VisibilityStrategy));\n\nvar __extends$2y = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$h = ( false) || function () {\n __assign$h = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$h.apply(this, arguments);\n};\nvar __decorate$2e = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar GroupCellRendererCtrl = /** @class */ (function (_super) {\n __extends$2y(GroupCellRendererCtrl, _super);\n function GroupCellRendererCtrl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n GroupCellRendererCtrl.prototype.init = function (comp, eGui, eCheckbox, eExpanded, eContracted, compClass, params) {\n var _a, _b, _c, _d;\n this.params = params;\n this.eGui = eGui;\n this.eCheckbox = eCheckbox;\n this.eExpanded = eExpanded;\n this.eContracted = eContracted;\n this.comp = comp;\n this.compClass = compClass;\n var node = params.node; params.value; var colDef = params.colDef;\n var topLevelFooter = this.isTopLevelFooter();\n // logic for skipping cells follows, never skip top level footer cell.\n if (!topLevelFooter) {\n var embeddedRowMismatch = this.isEmbeddedRowMismatch();\n if (embeddedRowMismatch) {\n return;\n }\n // this footer should only be non-top level. Don't need to check groupIncludeFooter\n // as we won't have footer rows in that instance.\n if (node.footer && this.gridOptionsService.get('groupHideOpenParents')) {\n var showRowGroup = colDef && colDef.showRowGroup;\n var rowGroupColumnId = node.rowGroupColumn && node.rowGroupColumn.getColId();\n // if the groupCellRenderer is inside of a footer and groupHideOpenParents is true\n // we should only display the groupCellRenderer if the current column is the rowGroupedColumn\n if (showRowGroup !== rowGroupColumnId) {\n return;\n }\n }\n }\n this.setupShowingValueForOpenedParent();\n this.findDisplayedGroupNode();\n if (!topLevelFooter) {\n var showingFooterTotal = params.node.footer && params.node.rowGroupIndex === this.columnModel.getRowGroupColumns().findIndex(function (c) { var _a; return c.getColId() === ((_a = params.colDef) === null || _a === void 0 ? void 0 : _a.showRowGroup); });\n // if we're always showing a group value\n var isAlwaysShowing = this.gridOptionsService.get('groupDisplayType') != 'multipleColumns' || this.gridOptionsService.get('treeData');\n // if the cell is populated with a parent value due to `showOpenedGroup`\n var showOpenGroupValue = (isAlwaysShowing || (this.gridOptionsService.get('showOpenedGroup') && !params.node.footer && ((!params.node.group ||\n (params.node.rowGroupIndex != null &&\n params.node.rowGroupIndex > this.columnModel.getRowGroupColumns().findIndex(function (c) { var _a; return c.getColId() === ((_a = params.colDef) === null || _a === void 0 ? void 0 : _a.showRowGroup); }))))));\n // not showing a leaf value (field/valueGetter)\n var leafWithValues = !node.group && (((_a = this.params.colDef) === null || _a === void 0 ? void 0 : _a.field) || ((_b = this.params.colDef) === null || _b === void 0 ? void 0 : _b.valueGetter));\n // doesn't have expand/collapse chevron\n var isExpandable = this.isExpandable();\n // is showing pivot leaf cell\n var showPivotModeLeafValue = this.columnModel.isPivotMode() && node.leafGroup && ((_c = node.rowGroupColumn) === null || _c === void 0 ? void 0 : _c.getColId()) === ((_d = params.column) === null || _d === void 0 ? void 0 : _d.getColDef().showRowGroup);\n // if not showing any values or chevron, skip cell.\n var canSkipRenderingCell = !this.showingValueForOpenedParent && !isExpandable && !leafWithValues && !showOpenGroupValue && !showingFooterTotal && !showPivotModeLeafValue;\n if (canSkipRenderingCell) {\n return;\n }\n }\n this.addExpandAndContract();\n this.addFullWidthRowDraggerIfNeeded();\n this.addCheckboxIfNeeded();\n this.addValueElement();\n this.setupIndent();\n this.refreshAriaExpanded();\n };\n GroupCellRendererCtrl.prototype.getCellAriaRole = function () {\n var _a, _b;\n var colDefAriaRole = (_a = this.params.colDef) === null || _a === void 0 ? void 0 : _a.cellAriaRole;\n var columnColDefAriaRole = (_b = this.params.column) === null || _b === void 0 ? void 0 : _b.getColDef().cellAriaRole;\n return colDefAriaRole || columnColDefAriaRole || 'gridcell';\n };\n GroupCellRendererCtrl.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n // property cleanup to avoid memory leaks\n this.expandListener = null;\n };\n GroupCellRendererCtrl.prototype.refreshAriaExpanded = function () {\n var _a = this.params, node = _a.node, eGridCell = _a.eGridCell;\n if (this.expandListener) {\n this.expandListener = this.expandListener();\n }\n if (!this.isExpandable()) {\n removeAriaExpanded(eGridCell);\n return;\n }\n var listener = function () {\n // for react, we don't use JSX, as setting attributes via jsx is slower\n setAriaExpanded(eGridCell, !!node.expanded);\n };\n this.expandListener = this.addManagedListener(node, RowNode.EVENT_EXPANDED_CHANGED, listener) || null;\n listener();\n };\n GroupCellRendererCtrl.prototype.isTopLevelFooter = function () {\n if (!this.gridOptionsService.get('groupIncludeTotalFooter')) {\n return false;\n }\n if (this.params.value != null || this.params.node.level != -1) {\n return false;\n }\n // at this point, we know it's the root node and there is no value present, so it's a footer cell.\n // the only thing to work out is if we are displaying groups across multiple\n // columns (groupDisplayType: 'multipleColumns'), we only want 'total' to appear in the first column.\n var colDef = this.params.colDef;\n var doingFullWidth = colDef == null;\n if (doingFullWidth) {\n return true;\n }\n if (colDef.showRowGroup === true) {\n return true;\n }\n var rowGroupCols = this.columnModel.getRowGroupColumns();\n // this is a sanity check, rowGroupCols should always be present\n if (!rowGroupCols || rowGroupCols.length === 0) {\n return true;\n }\n var firstRowGroupCol = rowGroupCols[0];\n return firstRowGroupCol.getId() === colDef.showRowGroup;\n };\n // if we are doing embedded full width rows, we only show the renderer when\n // in the body, or if pinning in the pinned section, or if pinning and RTL,\n // in the right section. otherwise we would have the cell repeated in each section.\n GroupCellRendererCtrl.prototype.isEmbeddedRowMismatch = function () {\n if (!this.params.fullWidth || !this.gridOptionsService.get('embedFullWidthRows')) {\n return false;\n }\n var pinnedLeftCell = this.params.pinned === 'left';\n var pinnedRightCell = this.params.pinned === 'right';\n var bodyCell = !pinnedLeftCell && !pinnedRightCell;\n if (this.gridOptionsService.get('enableRtl')) {\n if (this.columnModel.isPinningLeft()) {\n return !pinnedRightCell;\n }\n return !bodyCell;\n }\n if (this.columnModel.isPinningLeft()) {\n return !pinnedLeftCell;\n }\n return !bodyCell;\n };\n GroupCellRendererCtrl.prototype.findDisplayedGroupNode = function () {\n var column = this.params.column;\n var rowNode = this.params.node;\n if (this.showingValueForOpenedParent) {\n var pointer = rowNode.parent;\n while (pointer != null) {\n if (pointer.rowGroupColumn && column.isRowGroupDisplayed(pointer.rowGroupColumn.getId())) {\n this.displayedGroupNode = pointer;\n break;\n }\n pointer = pointer.parent;\n }\n }\n // if we didn't find a displayed group, set it to the row node\n if (missing(this.displayedGroupNode)) {\n this.displayedGroupNode = rowNode;\n }\n };\n GroupCellRendererCtrl.prototype.setupShowingValueForOpenedParent = function () {\n // note - this code depends on sortService.updateGroupDataForHiddenOpenParents, where group data\n // is updated to reflect the dragged down parents\n var rowNode = this.params.node;\n var column = this.params.column;\n if (!this.gridOptionsService.get('groupHideOpenParents')) {\n this.showingValueForOpenedParent = false;\n return;\n }\n // hideOpenParents means rowNode.groupData can have data for the group this column is displaying, even though\n // this rowNode isn't grouping by the column we are displaying\n // if no groupData at all, we are not showing a parent value\n if (!rowNode.groupData) {\n this.showingValueForOpenedParent = false;\n return;\n }\n // this is the normal case, in that we are showing a group for which this column is configured. note that\n // this means the Row Group is closed (if it was open, we would not be displaying it)\n var showingGroupNode = rowNode.rowGroupColumn != null;\n if (showingGroupNode) {\n var keyOfGroupingColumn = rowNode.rowGroupColumn.getId();\n var configuredToShowThisGroupLevel = column.isRowGroupDisplayed(keyOfGroupingColumn);\n // if showing group as normal, we didn't take group info from parent\n if (configuredToShowThisGroupLevel) {\n this.showingValueForOpenedParent = false;\n return;\n }\n }\n // see if we are showing a Group Value for the Displayed Group. if we are showing a group value, and this Row Node\n // is not grouping by this Displayed Group, we must of gotten the value from a parent node\n var valPresent = rowNode.groupData[column.getId()] != null;\n this.showingValueForOpenedParent = valPresent;\n };\n GroupCellRendererCtrl.prototype.addValueElement = function () {\n if (this.displayedGroupNode.footer) {\n this.addFooterValue();\n }\n else {\n this.addGroupValue();\n this.addChildCount();\n }\n };\n GroupCellRendererCtrl.prototype.addGroupValue = function () {\n var _a;\n // we try and use the cellRenderer of the column used for the grouping if we can\n var paramsAdjusted = this.adjustParamsWithDetailsFromRelatedColumn();\n var innerCompDetails = this.getInnerCompDetails(paramsAdjusted);\n var valueFormatted = paramsAdjusted.valueFormatted, value = paramsAdjusted.value;\n var valueWhenNoRenderer = valueFormatted;\n if (valueWhenNoRenderer == null) {\n var isGroupColForNode = (this.displayedGroupNode.rowGroupColumn && ((_a = this.params.column) === null || _a === void 0 ? void 0 : _a.isRowGroupDisplayed(this.displayedGroupNode.rowGroupColumn.getId())));\n if (this.displayedGroupNode.key === \"\" && this.displayedGroupNode.group && isGroupColForNode) {\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n valueWhenNoRenderer = localeTextFunc('blanks', '(Blanks)');\n }\n else {\n valueWhenNoRenderer = value !== null && value !== void 0 ? value : null;\n }\n }\n this.comp.setInnerRenderer(innerCompDetails, valueWhenNoRenderer);\n };\n GroupCellRendererCtrl.prototype.adjustParamsWithDetailsFromRelatedColumn = function () {\n var relatedColumn = this.displayedGroupNode.rowGroupColumn;\n var column = this.params.column;\n if (!relatedColumn) {\n return this.params;\n }\n var notFullWidth = column != null;\n if (notFullWidth) {\n var showingThisRowGroup = column.isRowGroupDisplayed(relatedColumn.getId());\n if (!showingThisRowGroup) {\n return this.params;\n }\n }\n var params = this.params;\n var _a = this.params, value = _a.value, node = _a.node;\n var valueFormatted = this.valueFormatterService.formatValue(relatedColumn, node, value);\n // we don't update the original params, as they could of come through React,\n // as react has RowGroupCellRenderer, which means the params could be props which\n // would be read only\n var paramsAdjusted = __assign$h(__assign$h({}, params), { valueFormatted: valueFormatted });\n return paramsAdjusted;\n };\n GroupCellRendererCtrl.prototype.addFooterValue = function () {\n var footerValueGetter = this.params.footerValueGetter;\n var footerValue = '';\n if (footerValueGetter) {\n // params is same as we were given, except we set the value as the item to display\n var paramsClone = cloneObject(this.params);\n paramsClone.value = this.params.value;\n if (typeof footerValueGetter === 'function') {\n footerValue = footerValueGetter(paramsClone);\n }\n else if (typeof footerValueGetter === 'string') {\n footerValue = this.expressionService.evaluate(footerValueGetter, paramsClone);\n }\n else {\n console.warn('AG Grid: footerValueGetter should be either a function or a string (expression)');\n }\n }\n else {\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var footerTotalPrefix = localeTextFunc('footerTotal', 'Total');\n footerValue = footerTotalPrefix + ' ' + (this.params.value != null ? this.params.value : '');\n }\n var innerCompDetails = this.getInnerCompDetails(this.params);\n this.comp.setInnerRenderer(innerCompDetails, footerValue);\n };\n GroupCellRendererCtrl.prototype.getInnerCompDetails = function (params) {\n var _this = this;\n // for full width rows, we don't do any of the below\n if (params.fullWidth) {\n return this.userComponentFactory.getFullWidthGroupRowInnerCellRenderer(this.gridOptionsService.get('groupRowRendererParams'), params);\n }\n // when grouping, the normal case is we use the cell renderer of the grouped column. eg if grouping by country\n // and then rating, we will use the country cell renderer for each country group row and likewise the rating\n // cell renderer for each rating group row.\n //\n // however if the user has innerCellRenderer defined, this gets preference and we don't use cell renderers\n // of the grouped columns.\n //\n // so we check and use in the following order:\n //\n // 1) thisColDef.cellRendererParams.innerRenderer of the column showing the groups (eg auto group column)\n // 2) groupedColDef.cellRenderer of the grouped column\n // 3) groupedColDef.cellRendererParams.innerRenderer\n // we check if cell renderer provided for the group cell renderer, eg colDef.cellRendererParams.innerRenderer\n var innerCompDetails = this.userComponentFactory\n .getInnerRendererDetails(params, params);\n // avoid using GroupCellRenderer again, otherwise stack overflow, as we insert same renderer again and again.\n // this covers off chance user is grouping by a column that is also configured with GroupCellRenderer\n var isGroupRowRenderer = function (details) { return details && details.componentClass == _this.compClass; };\n if (innerCompDetails && !isGroupRowRenderer(innerCompDetails)) {\n // use the renderer defined in cellRendererParams.innerRenderer\n return innerCompDetails;\n }\n var relatedColumn = this.displayedGroupNode.rowGroupColumn;\n var relatedColDef = relatedColumn ? relatedColumn.getColDef() : undefined;\n if (!relatedColDef) {\n return;\n }\n // otherwise see if we can use the cellRenderer of the column we are grouping by\n var relatedCompDetails = this.userComponentFactory\n .getCellRendererDetails(relatedColDef, params);\n if (relatedCompDetails && !isGroupRowRenderer(relatedCompDetails)) {\n // Only if the original column is using a specific renderer, it it is a using a DEFAULT one ignore it\n return relatedCompDetails;\n }\n if (isGroupRowRenderer(relatedCompDetails) &&\n relatedColDef.cellRendererParams &&\n relatedColDef.cellRendererParams.innerRenderer) {\n // edge case - this comes from a column which has been grouped dynamically, that has a renderer 'group'\n // and has an inner cell renderer\n var res = this.userComponentFactory.getInnerRendererDetails(relatedColDef.cellRendererParams, params);\n return res;\n }\n };\n GroupCellRendererCtrl.prototype.addChildCount = function () {\n // only include the child count if it's included, eg if user doing custom aggregation,\n // then this could be left out, or set to -1, ie no child count\n if (this.params.suppressCount) {\n return;\n }\n this.addManagedListener(this.displayedGroupNode, RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED, this.updateChildCount.bind(this));\n // filtering changes the child count, so need to cater for it\n this.updateChildCount();\n };\n GroupCellRendererCtrl.prototype.updateChildCount = function () {\n var allChildrenCount = this.displayedGroupNode.allChildrenCount;\n var showingGroupForThisNode = this.isShowRowGroupForThisRow();\n var showCount = showingGroupForThisNode && allChildrenCount != null && allChildrenCount >= 0;\n var countString = showCount ? \"(\".concat(allChildrenCount, \")\") : \"\";\n this.comp.setChildCount(countString);\n };\n GroupCellRendererCtrl.prototype.isShowRowGroupForThisRow = function () {\n if (this.gridOptionsService.get('treeData')) {\n return true;\n }\n var rowGroupColumn = this.displayedGroupNode.rowGroupColumn;\n if (!rowGroupColumn) {\n return false;\n }\n // column is null for fullWidthRows\n var column = this.params.column;\n var thisColumnIsInterested = column == null || column.isRowGroupDisplayed(rowGroupColumn.getId());\n return thisColumnIsInterested;\n };\n GroupCellRendererCtrl.prototype.addExpandAndContract = function () {\n var _a;\n var params = this.params;\n var eExpandedIcon = createIconNoSpan('groupExpanded', this.gridOptionsService, null);\n var eContractedIcon = createIconNoSpan('groupContracted', this.gridOptionsService, null);\n if (eExpandedIcon) {\n this.eExpanded.appendChild(eExpandedIcon);\n }\n if (eContractedIcon) {\n this.eContracted.appendChild(eContractedIcon);\n }\n var eGroupCell = params.eGridCell;\n // if editing groups, then double click is to start editing\n var isDoubleClickEdit = ((_a = this.params.column) === null || _a === void 0 ? void 0 : _a.isCellEditable(params.node)) && this.gridOptionsService.get('enableGroupEdit');\n if (!isDoubleClickEdit && this.isExpandable() && !params.suppressDoubleClickExpand) {\n this.addManagedListener(eGroupCell, 'dblclick', this.onCellDblClicked.bind(this));\n }\n this.addManagedListener(this.eExpanded, 'click', this.onExpandClicked.bind(this));\n this.addManagedListener(this.eContracted, 'click', this.onExpandClicked.bind(this));\n // expand / contract as the user hits enter\n this.addManagedListener(eGroupCell, 'keydown', this.onKeyDown.bind(this));\n this.addManagedListener(params.node, RowNode.EVENT_EXPANDED_CHANGED, this.showExpandAndContractIcons.bind(this));\n this.showExpandAndContractIcons();\n // because we don't show the expand / contract when there are no children, we need to check every time\n // the number of children change.\n var expandableChangedListener = this.onRowNodeIsExpandableChanged.bind(this);\n this.addManagedListener(this.displayedGroupNode, RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED, expandableChangedListener);\n this.addManagedListener(this.displayedGroupNode, RowNode.EVENT_MASTER_CHANGED, expandableChangedListener);\n this.addManagedListener(this.displayedGroupNode, RowNode.EVENT_GROUP_CHANGED, expandableChangedListener);\n this.addManagedListener(this.displayedGroupNode, RowNode.EVENT_HAS_CHILDREN_CHANGED, expandableChangedListener);\n };\n GroupCellRendererCtrl.prototype.onExpandClicked = function (mouseEvent) {\n if (isStopPropagationForAgGrid(mouseEvent)) {\n return;\n }\n // so if we expand a node, it does not also get selected.\n stopPropagationForAgGrid(mouseEvent);\n this.onExpandOrContract(mouseEvent);\n };\n GroupCellRendererCtrl.prototype.onExpandOrContract = function (e) {\n // must use the displayedGroup, so if data was dragged down, we expand the parent, not this row\n var rowNode = this.displayedGroupNode;\n var nextExpandState = !rowNode.expanded;\n if (!nextExpandState && rowNode.sticky) {\n this.scrollToStickyNode(rowNode);\n }\n rowNode.setExpanded(nextExpandState, e);\n };\n GroupCellRendererCtrl.prototype.scrollToStickyNode = function (rowNode) {\n var gridBodyCtrl = this.ctrlsService.getGridBodyCtrl();\n var scrollFeature = gridBodyCtrl.getScrollFeature();\n scrollFeature.setVerticalScrollPosition(rowNode.rowTop - rowNode.stickyRowTop);\n };\n GroupCellRendererCtrl.prototype.isExpandable = function () {\n if (this.showingValueForOpenedParent) {\n return true;\n }\n var rowNode = this.displayedGroupNode;\n var reducedLeafNode = this.columnModel.isPivotMode() && rowNode.leafGroup;\n var expandableGroup = rowNode.isExpandable() && !rowNode.footer && !reducedLeafNode;\n if (!expandableGroup) {\n return false;\n }\n // column is null for fullWidthRows\n var column = this.params.column;\n var displayingForOneColumnOnly = column != null && typeof column.getColDef().showRowGroup === 'string';\n if (displayingForOneColumnOnly) {\n var showing = this.isShowRowGroupForThisRow();\n return showing;\n }\n return true;\n };\n GroupCellRendererCtrl.prototype.showExpandAndContractIcons = function () {\n var _a = this, params = _a.params, displayedGroup = _a.displayedGroupNode, columnModel = _a.columnModel;\n var node = params.node;\n var isExpandable = this.isExpandable();\n if (isExpandable) {\n // if expandable, show one based on expand state.\n // if we were dragged down, means our parent is always expanded\n var expanded = this.showingValueForOpenedParent ? true : node.expanded;\n this.comp.setExpandedDisplayed(expanded);\n this.comp.setContractedDisplayed(!expanded);\n }\n else {\n // it not expandable, show neither\n this.comp.setExpandedDisplayed(false);\n this.comp.setContractedDisplayed(false);\n }\n // compensation padding for leaf nodes, so there is blank space instead of the expand icon\n var pivotMode = columnModel.isPivotMode();\n var pivotModeAndLeafGroup = pivotMode && displayedGroup.leafGroup;\n var addExpandableCss = isExpandable && !pivotModeAndLeafGroup;\n var isTotalFooterNode = node.footer && node.level === -1;\n this.comp.addOrRemoveCssClass('ag-cell-expandable', addExpandableCss);\n this.comp.addOrRemoveCssClass('ag-row-group', addExpandableCss);\n if (pivotMode) {\n this.comp.addOrRemoveCssClass('ag-pivot-leaf-group', pivotModeAndLeafGroup);\n }\n else if (!isTotalFooterNode) {\n this.comp.addOrRemoveCssClass('ag-row-group-leaf-indent', !addExpandableCss);\n }\n };\n GroupCellRendererCtrl.prototype.onRowNodeIsExpandableChanged = function () {\n // maybe if no children now, we should hide the expand / contract icons\n this.showExpandAndContractIcons();\n // if we have no children, this impacts the indent\n this.setIndent();\n this.refreshAriaExpanded();\n };\n GroupCellRendererCtrl.prototype.setupIndent = function () {\n // only do this if an indent - as this overwrites the padding that\n // the theme set, which will make things look 'not aligned' for the\n // first group level.\n var node = this.params.node;\n var suppressPadding = this.params.suppressPadding;\n if (!suppressPadding) {\n this.addManagedListener(node, RowNode.EVENT_UI_LEVEL_CHANGED, this.setIndent.bind(this));\n this.setIndent();\n }\n };\n GroupCellRendererCtrl.prototype.setIndent = function () {\n if (this.gridOptionsService.get('groupHideOpenParents')) {\n return;\n }\n var params = this.params;\n var rowNode = params.node;\n // if we are only showing one group column, we don't want to be indenting based on level\n var fullWithRow = !!params.colDef;\n var treeData = this.gridOptionsService.get('treeData');\n var manyDimensionThisColumn = !fullWithRow || treeData || params.colDef.showRowGroup === true;\n var paddingCount = manyDimensionThisColumn ? rowNode.uiLevel : 0;\n if (this.indentClass) {\n this.comp.addOrRemoveCssClass(this.indentClass, false);\n }\n this.indentClass = 'ag-row-group-indent-' + paddingCount;\n this.comp.addOrRemoveCssClass(this.indentClass, true);\n };\n GroupCellRendererCtrl.prototype.addFullWidthRowDraggerIfNeeded = function () {\n var _this = this;\n if (!this.params.fullWidth || !this.params.rowDrag) {\n return;\n }\n var rowDragComp = new RowDragComp(function () { return _this.params.value; }, this.params.node);\n this.createManagedBean(rowDragComp, this.context);\n this.eGui.insertAdjacentElement('afterbegin', rowDragComp.getGui());\n };\n GroupCellRendererCtrl.prototype.isUserWantsSelected = function () {\n var paramsCheckbox = this.params.checkbox;\n // if a function, we always return true as change detection can show or hide the checkbox.\n return typeof paramsCheckbox === 'function' || paramsCheckbox === true;\n };\n GroupCellRendererCtrl.prototype.addCheckboxIfNeeded = function () {\n var _this = this;\n var rowNode = this.displayedGroupNode;\n var checkboxNeeded = this.isUserWantsSelected() &&\n // footers cannot be selected\n !rowNode.footer &&\n // pinned rows cannot be selected\n !rowNode.rowPinned &&\n // details cannot be selected\n !rowNode.detail;\n if (checkboxNeeded) {\n var cbSelectionComponent_1 = new CheckboxSelectionComponent();\n this.getContext().createBean(cbSelectionComponent_1);\n cbSelectionComponent_1.init({\n rowNode: this.params.node,\n column: this.params.column,\n overrides: {\n isVisible: this.params.checkbox,\n callbackParams: this.params,\n removeHidden: true,\n },\n });\n this.eCheckbox.appendChild(cbSelectionComponent_1.getGui());\n this.addDestroyFunc(function () { return _this.getContext().destroyBean(cbSelectionComponent_1); });\n }\n this.comp.setCheckboxVisible(checkboxNeeded);\n };\n GroupCellRendererCtrl.prototype.onKeyDown = function (event) {\n var isEnterKey = event.key === KeyCode.ENTER;\n if (!isEnterKey || this.params.suppressEnterExpand) {\n return;\n }\n var cellEditable = this.params.column && this.params.column.isCellEditable(this.params.node);\n if (cellEditable) {\n return;\n }\n this.onExpandOrContract(event);\n };\n GroupCellRendererCtrl.prototype.onCellDblClicked = function (mouseEvent) {\n if (isStopPropagationForAgGrid(mouseEvent)) {\n return;\n }\n // we want to avoid acting on double click events on the expand / contract icon,\n // as that icons already has expand / collapse functionality on it. otherwise if\n // the icon was double clicked, we would get 'click', 'click', 'dblclick' which\n // is open->close->open, however double click should be open->close only.\n var targetIsExpandIcon = isElementInEventPath(this.eExpanded, mouseEvent)\n || isElementInEventPath(this.eContracted, mouseEvent);\n if (!targetIsExpandIcon) {\n this.onExpandOrContract(mouseEvent);\n }\n };\n __decorate$2e([\n Autowired('expressionService')\n ], GroupCellRendererCtrl.prototype, \"expressionService\", void 0);\n __decorate$2e([\n Autowired('valueFormatterService')\n ], GroupCellRendererCtrl.prototype, \"valueFormatterService\", void 0);\n __decorate$2e([\n Autowired('columnModel')\n ], GroupCellRendererCtrl.prototype, \"columnModel\", void 0);\n __decorate$2e([\n Autowired('userComponentFactory')\n ], GroupCellRendererCtrl.prototype, \"userComponentFactory\", void 0);\n __decorate$2e([\n Autowired(\"ctrlsService\")\n ], GroupCellRendererCtrl.prototype, \"ctrlsService\", void 0);\n return GroupCellRendererCtrl;\n}(BeanStub));\n\nvar __extends$2x = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2d = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar GroupCellRenderer = /** @class */ (function (_super) {\n __extends$2x(GroupCellRenderer, _super);\n function GroupCellRenderer() {\n return _super.call(this, GroupCellRenderer.TEMPLATE) || this;\n }\n GroupCellRenderer.prototype.init = function (params) {\n var _this = this;\n var compProxy = {\n setInnerRenderer: function (compDetails, valueToDisplay) { return _this.setRenderDetails(compDetails, valueToDisplay); },\n setChildCount: function (count) { return _this.eChildCount.textContent = count; },\n addOrRemoveCssClass: function (cssClass, value) { return _this.addOrRemoveCssClass(cssClass, value); },\n setContractedDisplayed: function (expanded) { return setDisplayed(_this.eContracted, expanded); },\n setExpandedDisplayed: function (expanded) { return setDisplayed(_this.eExpanded, expanded); },\n setCheckboxVisible: function (visible) { return _this.eCheckbox.classList.toggle('ag-invisible', !visible); }\n };\n var ctrl = this.createManagedBean(new GroupCellRendererCtrl());\n var fullWidth = !params.colDef;\n var eGui = this.getGui();\n ctrl.init(compProxy, eGui, this.eCheckbox, this.eExpanded, this.eContracted, this.constructor, params);\n if (fullWidth) {\n setAriaRole(eGui, ctrl.getCellAriaRole());\n }\n };\n GroupCellRenderer.prototype.setRenderDetails = function (compDetails, valueToDisplay) {\n var _this = this;\n if (compDetails) {\n var componentPromise = compDetails.newAgStackInstance();\n if (!componentPromise) {\n return;\n }\n componentPromise.then(function (comp) {\n if (!comp) {\n return;\n }\n var destroyComp = function () { return _this.context.destroyBean(comp); };\n if (_this.isAlive()) {\n _this.eValue.appendChild(comp.getGui());\n _this.addDestroyFunc(destroyComp);\n }\n else {\n destroyComp();\n }\n });\n }\n else {\n this.eValue.innerText = valueToDisplay;\n }\n };\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to have public here instead of private or protected\n GroupCellRenderer.prototype.destroy = function () {\n this.getContext().destroyBean(this.innerCellRenderer);\n _super.prototype.destroy.call(this);\n };\n GroupCellRenderer.prototype.refresh = function () {\n return false;\n };\n GroupCellRenderer.TEMPLATE = \"\\n \\n \\n \\n \\n \\n \";\n __decorate$2d([\n RefSelector('eExpanded')\n ], GroupCellRenderer.prototype, \"eExpanded\", void 0);\n __decorate$2d([\n RefSelector('eContracted')\n ], GroupCellRenderer.prototype, \"eContracted\", void 0);\n __decorate$2d([\n RefSelector('eCheckbox')\n ], GroupCellRenderer.prototype, \"eCheckbox\", void 0);\n __decorate$2d([\n RefSelector('eValue')\n ], GroupCellRenderer.prototype, \"eValue\", void 0);\n __decorate$2d([\n RefSelector('eChildCount')\n ], GroupCellRenderer.prototype, \"eChildCount\", void 0);\n return GroupCellRenderer;\n}(Component));\n\nvar __extends$2w = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2c = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar LoadingCellRenderer = /** @class */ (function (_super) {\n __extends$2w(LoadingCellRenderer, _super);\n function LoadingCellRenderer() {\n return _super.call(this, LoadingCellRenderer.TEMPLATE) || this;\n }\n LoadingCellRenderer.prototype.init = function (params) {\n params.node.failedLoad ? this.setupFailed() : this.setupLoading();\n };\n LoadingCellRenderer.prototype.setupFailed = function () {\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n this.eLoadingText.innerText = localeTextFunc('loadingError', 'ERR');\n };\n LoadingCellRenderer.prototype.setupLoading = function () {\n var eLoadingIcon = createIconNoSpan('groupLoading', this.gridOptionsService, null);\n if (eLoadingIcon) {\n this.eLoadingIcon.appendChild(eLoadingIcon);\n }\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n this.eLoadingText.innerText = localeTextFunc('loadingOoo', 'Loading');\n };\n LoadingCellRenderer.prototype.refresh = function (params) {\n return false;\n };\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n LoadingCellRenderer.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n LoadingCellRenderer.TEMPLATE = \"
\\n \\n \\n
\";\n __decorate$2c([\n RefSelector('eLoadingIcon')\n ], LoadingCellRenderer.prototype, \"eLoadingIcon\", void 0);\n __decorate$2c([\n RefSelector('eLoadingText')\n ], LoadingCellRenderer.prototype, \"eLoadingText\", void 0);\n return LoadingCellRenderer;\n}(Component));\n\nvar __extends$2v = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar LoadingOverlayComponent$1 = /** @class */ (function (_super) {\n __extends$2v(LoadingOverlayComponent, _super);\n function LoadingOverlayComponent() {\n return _super.call(this) || this;\n }\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n LoadingOverlayComponent.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n LoadingOverlayComponent.prototype.init = function (params) {\n var _this = this;\n var customTemplate = this.gridOptionsService.get('overlayLoadingTemplate');\n this.setTemplate(customTemplate !== null && customTemplate !== void 0 ? customTemplate : LoadingOverlayComponent.DEFAULT_LOADING_OVERLAY_TEMPLATE);\n if (!customTemplate) {\n var localeTextFunc_1 = this.localeService.getLocaleTextFunc();\n // setTimeout is used because some screen readers only announce `aria-live` text when\n // there is a \"text change\", so we force a change from empty.\n setTimeout(function () {\n _this.getGui().textContent = localeTextFunc_1('loadingOoo', 'Loading...');\n });\n }\n };\n LoadingOverlayComponent.DEFAULT_LOADING_OVERLAY_TEMPLATE = \"\";\n return LoadingOverlayComponent;\n}(Component));\n\nvar __extends$2u = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar NoRowsOverlayComponent$1 = /** @class */ (function (_super) {\n __extends$2u(NoRowsOverlayComponent, _super);\n function NoRowsOverlayComponent() {\n return _super.call(this) || this;\n }\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n NoRowsOverlayComponent.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n NoRowsOverlayComponent.prototype.init = function (params) {\n var _this = this;\n var customTemplate = this.gridOptionsService.get('overlayNoRowsTemplate');\n this.setTemplate(customTemplate !== null && customTemplate !== void 0 ? customTemplate : NoRowsOverlayComponent.DEFAULT_NO_ROWS_TEMPLATE);\n if (!customTemplate) {\n var localeTextFunc_1 = this.localeService.getLocaleTextFunc();\n // setTimeout is used because some screen readers only announce `aria-live` text when\n // there is a \"text change\", so we force a change from empty.\n setTimeout(function () {\n _this.getGui().textContent = localeTextFunc_1('noRowsToShow', 'No Rows To Show');\n });\n }\n };\n NoRowsOverlayComponent.DEFAULT_NO_ROWS_TEMPLATE = \"\";\n return NoRowsOverlayComponent;\n}(Component));\n\nvar __extends$2t = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar TooltipComponent$1 = /** @class */ (function (_super) {\n __extends$2t(TooltipComponent, _super);\n function TooltipComponent() {\n return _super.call(this, /* html */ \"
\") || this;\n }\n // will need to type params\n TooltipComponent.prototype.init = function (params) {\n var value = params.value;\n this.getGui().textContent = escapeString(value, true);\n };\n return TooltipComponent;\n}(PopupComponent));\n\nvar __extends$2s = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar NumberCellEditorInput = /** @class */ (function () {\n function NumberCellEditorInput() {\n }\n NumberCellEditorInput.prototype.getTemplate = function () {\n return /* html */ \"\";\n };\n NumberCellEditorInput.prototype.init = function (eInput, params) {\n this.eInput = eInput;\n this.params = params;\n if (params.max != null) {\n eInput.setMax(params.max);\n }\n if (params.min != null) {\n eInput.setMin(params.min);\n }\n if (params.precision != null) {\n eInput.setPrecision(params.precision);\n }\n if (params.step != null) {\n eInput.setStep(params.step);\n }\n var inputEl = eInput.getInputElement();\n if (params.preventStepping) {\n eInput.addManagedListener(inputEl, 'keydown', this.preventStepping);\n }\n else if (params.showStepperButtons) {\n inputEl.classList.add('ag-number-field-input-stepper');\n }\n };\n NumberCellEditorInput.prototype.preventStepping = function (e) {\n if (e.key === KeyCode.UP || e.key === KeyCode.DOWN) {\n e.preventDefault();\n }\n };\n NumberCellEditorInput.prototype.getValue = function () {\n var value = this.eInput.getValue();\n if (!exists(value) && !exists(this.params.value)) {\n return this.params.value;\n }\n var parsedValue = this.params.parseValue(value);\n if (parsedValue == null) {\n return parsedValue;\n }\n if (typeof parsedValue === 'string') {\n if (parsedValue === '') {\n return null;\n }\n parsedValue = Number(parsedValue);\n }\n return isNaN(parsedValue) ? null : parsedValue;\n };\n NumberCellEditorInput.prototype.getStartValue = function () {\n return this.params.value;\n };\n return NumberCellEditorInput;\n}());\nvar NumberCellEditor = /** @class */ (function (_super) {\n __extends$2s(NumberCellEditor, _super);\n function NumberCellEditor() {\n return _super.call(this, new NumberCellEditorInput()) || this;\n }\n return NumberCellEditor;\n}(SimpleCellEditor));\n\nvar __extends$2r = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar DateCellEditorInput = /** @class */ (function () {\n function DateCellEditorInput() {\n }\n DateCellEditorInput.prototype.getTemplate = function () {\n return /* html */ \"\";\n };\n DateCellEditorInput.prototype.init = function (eInput, params) {\n this.eInput = eInput;\n this.params = params;\n if (params.min != null) {\n eInput.setMin(params.min);\n }\n if (params.max != null) {\n eInput.setMax(params.max);\n }\n if (params.step != null) {\n eInput.setStep(params.step);\n }\n };\n DateCellEditorInput.prototype.getValue = function () {\n var value = this.eInput.getDate();\n if (!exists(value) && !exists(this.params.value)) {\n return this.params.value;\n }\n return value !== null && value !== void 0 ? value : null;\n };\n DateCellEditorInput.prototype.getStartValue = function () {\n var value = this.params.value;\n if (!(value instanceof Date)) {\n return undefined;\n }\n return serialiseDate(value, false);\n };\n return DateCellEditorInput;\n}());\nvar DateCellEditor = /** @class */ (function (_super) {\n __extends$2r(DateCellEditor, _super);\n function DateCellEditor() {\n return _super.call(this, new DateCellEditorInput()) || this;\n }\n return DateCellEditor;\n}(SimpleCellEditor));\n\nvar __extends$2q = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2b = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar DateStringCellEditorInput = /** @class */ (function () {\n function DateStringCellEditorInput(getDataTypeService) {\n this.getDataTypeService = getDataTypeService;\n }\n DateStringCellEditorInput.prototype.getTemplate = function () {\n return /* html */ \"\";\n };\n DateStringCellEditorInput.prototype.init = function (eInput, params) {\n this.eInput = eInput;\n this.params = params;\n if (params.min != null) {\n eInput.setMin(params.min);\n }\n if (params.max != null) {\n eInput.setMax(params.max);\n }\n if (params.step != null) {\n eInput.setStep(params.step);\n }\n };\n DateStringCellEditorInput.prototype.getValue = function () {\n var value = this.formatDate(this.eInput.getDate());\n if (!exists(value) && !exists(this.params.value)) {\n return this.params.value;\n }\n return this.params.parseValue(value !== null && value !== void 0 ? value : '');\n };\n DateStringCellEditorInput.prototype.getStartValue = function () {\n var _a, _b;\n return serialiseDate((_b = this.parseDate((_a = this.params.value) !== null && _a !== void 0 ? _a : undefined)) !== null && _b !== void 0 ? _b : null, false);\n };\n DateStringCellEditorInput.prototype.parseDate = function (value) {\n return this.getDataTypeService().getDateParserFunction(this.params.column)(value);\n };\n DateStringCellEditorInput.prototype.formatDate = function (value) {\n return this.getDataTypeService().getDateFormatterFunction(this.params.column)(value);\n };\n return DateStringCellEditorInput;\n}());\nvar DateStringCellEditor = /** @class */ (function (_super) {\n __extends$2q(DateStringCellEditor, _super);\n function DateStringCellEditor() {\n var _this = _super.call(this, new DateStringCellEditorInput(function () { return _this.dataTypeService; })) || this;\n return _this;\n }\n __decorate$2b([\n Autowired('dataTypeService')\n ], DateStringCellEditor.prototype, \"dataTypeService\", void 0);\n return DateStringCellEditor;\n}(SimpleCellEditor));\n\nvar __extends$2p = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2a = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar CheckboxCellRenderer = /** @class */ (function (_super) {\n __extends$2p(CheckboxCellRenderer, _super);\n function CheckboxCellRenderer() {\n return _super.call(this, CheckboxCellRenderer.TEMPLATE) || this;\n }\n CheckboxCellRenderer.prototype.init = function (params) {\n var _this = this;\n this.params = params;\n this.updateCheckbox(params);\n var inputEl = this.eCheckbox.getInputElement();\n inputEl.setAttribute('tabindex', '-1');\n setAriaLive(inputEl, 'polite');\n this.addManagedListener(inputEl, 'click', function (event) {\n stopPropagationForAgGrid(event);\n if (_this.eCheckbox.isDisabled()) {\n return;\n }\n var isSelected = _this.eCheckbox.getValue();\n _this.onCheckboxChanged(isSelected);\n });\n this.addManagedListener(inputEl, 'dblclick', function (event) {\n stopPropagationForAgGrid(event);\n });\n var eDocument = this.gridOptionsService.getDocument();\n this.addManagedListener(this.params.eGridCell, 'keydown', function (event) {\n if (event.key === KeyCode.SPACE && !_this.eCheckbox.isDisabled()) {\n if (_this.params.eGridCell === eDocument.activeElement) {\n _this.eCheckbox.toggle();\n }\n var isSelected = _this.eCheckbox.getValue();\n _this.onCheckboxChanged(isSelected);\n event.preventDefault();\n }\n });\n };\n CheckboxCellRenderer.prototype.refresh = function (params) {\n this.params = params;\n this.updateCheckbox(params);\n return true;\n };\n CheckboxCellRenderer.prototype.updateCheckbox = function (params) {\n var _a, _b, _c;\n var isSelected;\n var displayed = true;\n if (params.node.group && params.column) {\n var colId = params.column.getColId();\n if (colId.startsWith(GROUP_AUTO_COLUMN_ID)) {\n // if we're grouping by this column then the value is a string and we need to parse it\n isSelected = params.value == null || params.value === '' ? undefined : params.value === 'true';\n }\n else if (params.node.aggData && params.node.aggData[colId] !== undefined) {\n isSelected = (_a = params.value) !== null && _a !== void 0 ? _a : undefined;\n }\n else {\n displayed = false;\n }\n }\n else {\n isSelected = (_b = params.value) !== null && _b !== void 0 ? _b : undefined;\n }\n if (!displayed) {\n this.eCheckbox.setDisplayed(false);\n return;\n }\n this.eCheckbox.setValue(isSelected);\n var disabled = params.disabled != null ? params.disabled : !((_c = params.column) === null || _c === void 0 ? void 0 : _c.isCellEditable(params.node));\n this.eCheckbox.setDisabled(disabled);\n var translate = this.localeService.getLocaleTextFunc();\n var stateName = getAriaCheckboxStateName(translate, isSelected);\n var ariaLabel = disabled\n ? stateName\n : \"\".concat(translate('ariaToggleCellValue', 'Press SPACE to toggle cell value'), \" (\").concat(stateName, \")\");\n this.eCheckbox.setInputAriaLabel(ariaLabel);\n };\n CheckboxCellRenderer.prototype.onCheckboxChanged = function (isSelected) {\n var _a = this.params, column = _a.column, node = _a.node, rowIndex = _a.rowIndex, value = _a.value;\n var eventStarted = {\n type: Events.EVENT_CELL_EDITING_STARTED,\n column: column,\n colDef: column === null || column === void 0 ? void 0 : column.getColDef(),\n data: node.data,\n node: node,\n rowIndex: rowIndex,\n rowPinned: node.rowPinned,\n value: value\n };\n this.eventService.dispatchEvent(eventStarted);\n var valueChanged = this.params.node.setDataValue(this.params.column, isSelected, 'edit');\n var eventStopped = {\n type: Events.EVENT_CELL_EDITING_STOPPED,\n column: column,\n colDef: column === null || column === void 0 ? void 0 : column.getColDef(),\n data: node.data,\n node: node,\n rowIndex: rowIndex,\n rowPinned: node.rowPinned,\n value: value,\n oldValue: value,\n newValue: isSelected,\n valueChanged: valueChanged\n };\n this.eventService.dispatchEvent(eventStopped);\n };\n CheckboxCellRenderer.TEMPLATE = \"\\n
\\n \\n
\";\n __decorate$2a([\n RefSelector('eCheckbox')\n ], CheckboxCellRenderer.prototype, \"eCheckbox\", void 0);\n return CheckboxCellRenderer;\n}(Component));\n\nvar __extends$2o = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$29 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar CheckboxCellEditor = /** @class */ (function (_super) {\n __extends$2o(CheckboxCellEditor, _super);\n function CheckboxCellEditor() {\n return _super.call(this, /* html */ \"\\n
\\n \\n
\") || this;\n }\n CheckboxCellEditor.prototype.init = function (params) {\n var _this = this;\n var _a;\n this.params = params;\n var isSelected = (_a = params.value) !== null && _a !== void 0 ? _a : undefined;\n this.eCheckbox.setValue(isSelected);\n var inputEl = this.eCheckbox.getInputElement();\n inputEl.setAttribute('tabindex', '-1');\n this.setAriaLabel(isSelected);\n this.addManagedListener(this.eCheckbox, Events.EVENT_FIELD_VALUE_CHANGED, function (event) { return _this.setAriaLabel(event.selected); });\n };\n CheckboxCellEditor.prototype.getValue = function () {\n return this.eCheckbox.getValue();\n };\n CheckboxCellEditor.prototype.focusIn = function () {\n this.eCheckbox.getFocusableElement().focus();\n };\n CheckboxCellEditor.prototype.afterGuiAttached = function () {\n if (this.params.cellStartedEdit) {\n this.focusIn();\n }\n };\n CheckboxCellEditor.prototype.isPopup = function () {\n return false;\n };\n CheckboxCellEditor.prototype.setAriaLabel = function (isSelected) {\n var translate = this.localeService.getLocaleTextFunc();\n var stateName = getAriaCheckboxStateName(translate, isSelected);\n var ariaLabel = translate('ariaToggleCellValue', 'Press SPACE to toggle cell value');\n this.eCheckbox.setInputAriaLabel(\"\".concat(ariaLabel, \" (\").concat(stateName, \")\"));\n };\n __decorate$29([\n RefSelector('eCheckbox')\n ], CheckboxCellEditor.prototype, \"eCheckbox\", void 0);\n return CheckboxCellEditor;\n}(PopupComponent));\n\nvar __extends$2n = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar AgMenuItemRenderer = /** @class */ (function (_super) {\n __extends$2n(AgMenuItemRenderer, _super);\n function AgMenuItemRenderer() {\n var _this = _super.call(this) || this;\n _this.setTemplate(/* html */ \"
\");\n return _this;\n }\n AgMenuItemRenderer.prototype.init = function (params) {\n var _a;\n this.params = params;\n this.cssClassPrefix = (_a = this.params.cssClassPrefix) !== null && _a !== void 0 ? _a : 'ag-menu-option';\n this.addIcon();\n this.addName();\n this.addShortcut();\n this.addSubMenu();\n };\n AgMenuItemRenderer.prototype.configureDefaults = function () {\n return true;\n };\n AgMenuItemRenderer.prototype.addIcon = function () {\n if (this.params.isCompact) {\n return;\n }\n var icon = loadTemplate(/* html */ \"\"));\n if (this.params.checked) {\n icon.appendChild(createIconNoSpan('check', this.gridOptionsService));\n }\n else if (this.params.icon) {\n if (isNodeOrElement(this.params.icon)) {\n icon.appendChild(this.params.icon);\n }\n else if (typeof this.params.icon === 'string') {\n icon.innerHTML = this.params.icon;\n }\n else {\n console.warn('AG Grid: menu item icon must be DOM node or string');\n }\n }\n this.getGui().appendChild(icon);\n };\n AgMenuItemRenderer.prototype.addName = function () {\n var name = loadTemplate(/* html */ \"\").concat(this.params.name || '', \"\"));\n this.getGui().appendChild(name);\n };\n AgMenuItemRenderer.prototype.addShortcut = function () {\n if (this.params.isCompact) {\n return;\n }\n var shortcut = loadTemplate(/* html */ \"\").concat(this.params.shortcut || '', \"\"));\n this.getGui().appendChild(shortcut);\n };\n AgMenuItemRenderer.prototype.addSubMenu = function () {\n var pointer = loadTemplate(/* html */ \"\"));\n var eGui = this.getGui();\n if (this.params.subMenu) {\n var iconName = this.gridOptionsService.get('enableRtl') ? 'smallLeft' : 'smallRight';\n setAriaExpanded(eGui, false);\n pointer.appendChild(createIconNoSpan(iconName, this.gridOptionsService));\n }\n eGui.appendChild(pointer);\n };\n AgMenuItemRenderer.prototype.getClassName = function (suffix) {\n return \"\".concat(this.cssClassPrefix, \"-\").concat(suffix);\n };\n AgMenuItemRenderer.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n return AgMenuItemRenderer;\n}(Component));\n\nvar __extends$2m = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$28 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$t = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$o = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar UserComponentRegistry = /** @class */ (function (_super) {\n __extends$2m(UserComponentRegistry, _super);\n function UserComponentRegistry() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.agGridDefaults = {\n //date\n agDateInput: DefaultDateComponent,\n //header\n agColumnHeader: HeaderComp,\n agColumnGroupHeader: HeaderGroupComp,\n agSortIndicator: SortIndicatorComp,\n //floating filters\n agTextColumnFloatingFilter: TextFloatingFilter,\n agNumberColumnFloatingFilter: NumberFloatingFilter,\n agDateColumnFloatingFilter: DateFloatingFilter,\n agReadOnlyFloatingFilter: ReadOnlyFloatingFilter,\n // renderers\n agAnimateShowChangeCellRenderer: AnimateShowChangeCellRenderer,\n agAnimateSlideCellRenderer: AnimateSlideCellRenderer,\n agGroupCellRenderer: GroupCellRenderer,\n agGroupRowRenderer: GroupCellRenderer,\n agLoadingCellRenderer: LoadingCellRenderer,\n agCheckboxCellRenderer: CheckboxCellRenderer,\n //editors\n agCellEditor: TextCellEditor,\n agTextCellEditor: TextCellEditor,\n agNumberCellEditor: NumberCellEditor,\n agDateCellEditor: DateCellEditor,\n agDateStringCellEditor: DateStringCellEditor,\n agSelectCellEditor: SelectCellEditor,\n agLargeTextCellEditor: LargeTextCellEditor,\n agCheckboxCellEditor: CheckboxCellEditor,\n //filter\n agTextColumnFilter: TextFilter,\n agNumberColumnFilter: NumberFilter,\n agDateColumnFilter: DateFilter,\n //overlays\n agLoadingOverlay: LoadingOverlayComponent$1,\n agNoRowsOverlay: NoRowsOverlayComponent$1,\n // tooltips\n agTooltipComponent: TooltipComponent$1,\n // menu item\n agMenuItem: AgMenuItemRenderer\n };\n /** Used to provide useful error messages if a user is trying to use an enterprise component without loading the module. */\n _this.enterpriseAgDefaultCompsModule = {\n agSetColumnFilter: ModuleNames.SetFilterModule,\n agSetColumnFloatingFilter: ModuleNames.SetFilterModule,\n agMultiColumnFilter: ModuleNames.MultiFilterModule,\n agMultiColumnFloatingFilter: ModuleNames.MultiFilterModule,\n agGroupColumnFilter: ModuleNames.RowGroupingModule,\n agGroupColumnFloatingFilter: ModuleNames.RowGroupingModule,\n agRichSelect: ModuleNames.RichSelectModule,\n agRichSelectCellEditor: ModuleNames.RichSelectModule,\n agDetailCellRenderer: ModuleNames.MasterDetailModule,\n agSparklineCellRenderer: ModuleNames.SparklinesModule\n };\n _this.jsComps = {};\n return _this;\n }\n UserComponentRegistry.prototype.init = function () {\n var _this = this;\n if (this.gridOptions.components != null) {\n iterateObject(this.gridOptions.components, function (key, component) { return _this.registerJsComponent(key, component); });\n }\n };\n UserComponentRegistry.prototype.registerDefaultComponent = function (name, component) {\n if (this.agGridDefaults[name]) {\n console.error(\"Trying to overwrite a default component. You should call registerComponent\");\n return;\n }\n this.agGridDefaults[name] = component;\n };\n UserComponentRegistry.prototype.registerJsComponent = function (name, component) {\n this.jsComps[name] = component;\n };\n UserComponentRegistry.prototype.retrieve = function (propertyName, name) {\n var _this = this;\n var createResult = function (component, componentFromFramework) { return ({ componentFromFramework: componentFromFramework, component: component }); };\n // FrameworkOverrides.frameworkComponent() is used in two locations:\n // 1) for Vue, user provided components get registered via a framework specific way.\n // 2) for React, it's how the React UI provides alternative default components (eg GroupCellRenderer and DetailCellRenderer)\n var registeredViaFrameworkComp = this.getFrameworkOverrides().frameworkComponent(name, this.gridOptions.components);\n if (registeredViaFrameworkComp != null) {\n return createResult(registeredViaFrameworkComp, true);\n }\n var jsComponent = this.jsComps[name];\n if (jsComponent) {\n var isFwkComp = this.getFrameworkOverrides().isFrameworkComponent(jsComponent);\n return createResult(jsComponent, isFwkComp);\n }\n var defaultComponent = this.agGridDefaults[name];\n if (defaultComponent) {\n return createResult(defaultComponent, false);\n }\n var moduleForComponent = this.enterpriseAgDefaultCompsModule[name];\n if (moduleForComponent) {\n ModuleRegistry.__assertRegistered(moduleForComponent, \"AG Grid '\".concat(propertyName, \"' component: \").concat(name), this.context.getGridId());\n }\n else {\n doOnce(function () { _this.warnAboutMissingComponent(propertyName, name); }, \"MissingComp\" + name);\n }\n return null;\n };\n UserComponentRegistry.prototype.warnAboutMissingComponent = function (propertyName, componentName) {\n var validComponents = __spreadArray$o(__spreadArray$o([], __read$t(Object.keys(this.agGridDefaults).filter(function (k) { return !['agCellEditor', 'agGroupRowRenderer', 'agSortIndicator'].includes(k); })), false), __read$t(Object.keys(this.jsComps)), false);\n var suggestions = fuzzySuggestions(componentName, validComponents, true, 0.8).values;\n console.warn(\"AG Grid: Could not find '\".concat(componentName, \"' component. It was configured as \\\"\").concat(propertyName, \": '\").concat(componentName, \"'\\\" but it wasn't found in the list of registered components.\"));\n if (suggestions.length > 0) {\n console.warn(\" Did you mean: [\".concat(suggestions.slice(0, 3), \"]?\"));\n }\n console.warn(\"If using a custom component check it has been registered as described in: \".concat(this.getFrameworkOverrides().getDocLink('components/')));\n };\n __decorate$28([\n Autowired('gridOptions')\n ], UserComponentRegistry.prototype, \"gridOptions\", void 0);\n __decorate$28([\n PostConstruct\n ], UserComponentRegistry.prototype, \"init\", null);\n UserComponentRegistry = __decorate$28([\n Bean('userComponentRegistry')\n ], UserComponentRegistry);\n return UserComponentRegistry;\n}(BeanStub));\n\nvar DateComponent = {\n propertyName: 'dateComponent',\n cellRenderer: false\n};\nvar HeaderComponent = {\n propertyName: 'headerComponent',\n cellRenderer: false\n};\nvar HeaderGroupComponent = {\n propertyName: 'headerGroupComponent',\n cellRenderer: false\n};\nvar CellRendererComponent = {\n propertyName: 'cellRenderer',\n cellRenderer: true\n};\nvar CellEditorComponent = {\n propertyName: 'cellEditor',\n cellRenderer: false\n};\nvar InnerRendererComponent = {\n propertyName: 'innerRenderer',\n cellRenderer: true\n};\nvar LoadingOverlayComponent = {\n propertyName: 'loadingOverlayComponent',\n cellRenderer: false\n};\nvar NoRowsOverlayComponent = {\n propertyName: 'noRowsOverlayComponent',\n cellRenderer: false\n};\nvar TooltipComponent = {\n propertyName: 'tooltipComponent',\n cellRenderer: false\n};\nvar FilterComponent = {\n propertyName: 'filter',\n cellRenderer: false\n};\nvar FloatingFilterComponent = {\n propertyName: 'floatingFilterComponent',\n cellRenderer: false\n};\nvar ToolPanelComponent = {\n propertyName: 'toolPanel',\n cellRenderer: false\n};\nvar StatusPanelComponent = {\n propertyName: 'statusPanel',\n cellRenderer: false\n};\nvar FullWidth = {\n propertyName: 'fullWidthCellRenderer',\n cellRenderer: true\n};\nvar FullWidthLoading = {\n propertyName: 'loadingCellRenderer',\n cellRenderer: true\n};\nvar FullWidthGroup = {\n propertyName: 'groupRowRenderer',\n cellRenderer: true\n};\nvar FullWidthDetail = {\n propertyName: 'detailCellRenderer',\n cellRenderer: true\n};\nvar MenuItemComponent = {\n propertyName: 'menuItem',\n cellRenderer: false\n};\n\nvar FloatingFilterMapper = /** @class */ (function () {\n function FloatingFilterMapper() {\n }\n FloatingFilterMapper.getFloatingFilterType = function (filterType) {\n return this.filterToFloatingFilterMapping[filterType];\n };\n FloatingFilterMapper.filterToFloatingFilterMapping = {\n set: 'agSetColumnFloatingFilter',\n agSetColumnFilter: 'agSetColumnFloatingFilter',\n multi: 'agMultiColumnFloatingFilter',\n agMultiColumnFilter: 'agMultiColumnFloatingFilter',\n group: 'agGroupColumnFloatingFilter',\n agGroupColumnFilter: 'agGroupColumnFloatingFilter',\n number: 'agNumberColumnFloatingFilter',\n agNumberColumnFilter: 'agNumberColumnFloatingFilter',\n date: 'agDateColumnFloatingFilter',\n agDateColumnFilter: 'agDateColumnFloatingFilter',\n text: 'agTextColumnFloatingFilter',\n agTextColumnFilter: 'agTextColumnFloatingFilter'\n };\n return FloatingFilterMapper;\n}());\n\nvar __extends$2l = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$27 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar UserComponentFactory = /** @class */ (function (_super) {\n __extends$2l(UserComponentFactory, _super);\n function UserComponentFactory() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n UserComponentFactory.prototype.getHeaderCompDetails = function (colDef, params) {\n return this.getCompDetails(colDef, HeaderComponent, 'agColumnHeader', params);\n };\n UserComponentFactory.prototype.getHeaderGroupCompDetails = function (params) {\n var colGroupDef = params.columnGroup.getColGroupDef();\n return this.getCompDetails(colGroupDef, HeaderGroupComponent, 'agColumnGroupHeader', params);\n };\n // this one is unusual, as it can be LoadingCellRenderer, DetailCellRenderer, FullWidthCellRenderer or GroupRowRenderer.\n // so we have to pass the type in.\n UserComponentFactory.prototype.getFullWidthCellRendererDetails = function (params) {\n return this.getCompDetails(this.gridOptions, FullWidth, null, params, true);\n };\n UserComponentFactory.prototype.getFullWidthLoadingCellRendererDetails = function (params) {\n return this.getCompDetails(this.gridOptions, FullWidthLoading, 'agLoadingCellRenderer', params, true);\n };\n UserComponentFactory.prototype.getFullWidthGroupCellRendererDetails = function (params) {\n return this.getCompDetails(this.gridOptions, FullWidthGroup, 'agGroupRowRenderer', params, true);\n };\n UserComponentFactory.prototype.getFullWidthDetailCellRendererDetails = function (params) {\n return this.getCompDetails(this.gridOptions, FullWidthDetail, 'agDetailCellRenderer', params, true);\n };\n // CELL RENDERER\n UserComponentFactory.prototype.getInnerRendererDetails = function (def, params) {\n return this.getCompDetails(def, InnerRendererComponent, null, params);\n };\n UserComponentFactory.prototype.getFullWidthGroupRowInnerCellRenderer = function (def, params) {\n return this.getCompDetails(def, InnerRendererComponent, null, params);\n };\n UserComponentFactory.prototype.getCellRendererDetails = function (def, params) {\n return this.getCompDetails(def, CellRendererComponent, null, params);\n };\n // CELL EDITOR\n UserComponentFactory.prototype.getCellEditorDetails = function (def, params) {\n return this.getCompDetails(def, CellEditorComponent, 'agCellEditor', params, true);\n };\n // FILTER\n UserComponentFactory.prototype.getFilterDetails = function (def, params, defaultFilter) {\n return this.getCompDetails(def, FilterComponent, defaultFilter, params, true);\n };\n UserComponentFactory.prototype.getDateCompDetails = function (params) {\n return this.getCompDetails(this.gridOptions, DateComponent, 'agDateInput', params, true);\n };\n UserComponentFactory.prototype.getLoadingOverlayCompDetails = function (params) {\n return this.getCompDetails(this.gridOptions, LoadingOverlayComponent, 'agLoadingOverlay', params, true);\n };\n UserComponentFactory.prototype.getNoRowsOverlayCompDetails = function (params) {\n return this.getCompDetails(this.gridOptions, NoRowsOverlayComponent, 'agNoRowsOverlay', params, true);\n };\n UserComponentFactory.prototype.getTooltipCompDetails = function (params) {\n return this.getCompDetails(params.colDef, TooltipComponent, 'agTooltipComponent', params, true);\n };\n UserComponentFactory.prototype.getSetFilterCellRendererDetails = function (def, params) {\n return this.getCompDetails(def, CellRendererComponent, null, params);\n };\n UserComponentFactory.prototype.getFloatingFilterCompDetails = function (def, params, defaultFloatingFilter) {\n return this.getCompDetails(def, FloatingFilterComponent, defaultFloatingFilter, params);\n };\n UserComponentFactory.prototype.getToolPanelCompDetails = function (toolPanelDef, params) {\n return this.getCompDetails(toolPanelDef, ToolPanelComponent, null, params, true);\n };\n UserComponentFactory.prototype.getStatusPanelCompDetails = function (def, params) {\n return this.getCompDetails(def, StatusPanelComponent, null, params, true);\n };\n UserComponentFactory.prototype.getMenuItemCompDetails = function (def, params) {\n return this.getCompDetails(def, MenuItemComponent, 'agMenuItem', params, true);\n };\n UserComponentFactory.prototype.getCompDetails = function (defObject, type, defaultName, params, mandatory) {\n var _this = this;\n if (mandatory === void 0) { mandatory = false; }\n var propertyName = type.propertyName, cellRenderer = type.cellRenderer;\n var _a = this.getCompKeys(defObject, type, params), compName = _a.compName, jsComp = _a.jsComp, fwComp = _a.fwComp, paramsFromSelector = _a.paramsFromSelector, popupFromSelector = _a.popupFromSelector, popupPositionFromSelector = _a.popupPositionFromSelector;\n var lookupFromRegistry = function (key) {\n var item = _this.userComponentRegistry.retrieve(propertyName, key);\n if (item) {\n jsComp = !item.componentFromFramework ? item.component : undefined;\n fwComp = item.componentFromFramework ? item.component : undefined;\n }\n };\n // if compOption is a string, means we need to look the item up\n if (compName != null) {\n lookupFromRegistry(compName);\n }\n // if lookup brought nothing back, and we have a default, lookup the default\n if (jsComp == null && fwComp == null && defaultName != null) {\n lookupFromRegistry(defaultName);\n }\n // if we have a comp option, and it's a function, replace it with an object equivalent adaptor\n if (jsComp && cellRenderer && !this.agComponentUtils.doesImplementIComponent(jsComp)) {\n jsComp = this.agComponentUtils.adaptFunction(propertyName, jsComp);\n }\n if (!jsComp && !fwComp) {\n if (mandatory) {\n console.error(\"AG Grid: Could not find component \".concat(compName, \", did you forget to configure this component?\"));\n }\n return;\n }\n var paramsMerged = this.mergeParamsWithApplicationProvidedParams(defObject, type, params, paramsFromSelector);\n var componentFromFramework = jsComp == null;\n var componentClass = jsComp ? jsComp : fwComp;\n return {\n componentFromFramework: componentFromFramework,\n componentClass: componentClass,\n params: paramsMerged,\n type: type,\n popupFromSelector: popupFromSelector,\n popupPositionFromSelector: popupPositionFromSelector,\n newAgStackInstance: function () { return _this.newAgStackInstance(componentClass, componentFromFramework, paramsMerged, type); }\n };\n };\n UserComponentFactory.prototype.getCompKeys = function (defObject, type, params) {\n var _this = this;\n var propertyName = type.propertyName;\n var compName;\n var jsComp;\n var fwComp;\n var paramsFromSelector;\n var popupFromSelector;\n var popupPositionFromSelector;\n // there are two types of js comps, class based and func based. we can only check for\n // class based, by checking if getGui() exists. no way to differentiate js func based vs eg react func based\n // const isJsClassComp = (comp: any) => this.agComponentUtils.doesImplementIComponent(comp);\n // const fwActive = this.frameworkComponentWrapper != null;\n // pull from defObject if available\n if (defObject) {\n var defObjectAny = defObject;\n // if selector, use this\n var selectorFunc = defObjectAny[propertyName + 'Selector'];\n var selectorRes = selectorFunc ? selectorFunc(params) : null;\n var assignComp = function (providedJsComp) {\n if (typeof providedJsComp === 'string') {\n compName = providedJsComp;\n }\n else if (providedJsComp != null && providedJsComp !== true) {\n var isFwkComp = _this.getFrameworkOverrides().isFrameworkComponent(providedJsComp);\n if (isFwkComp) {\n fwComp = providedJsComp;\n }\n else {\n jsComp = providedJsComp;\n }\n }\n };\n if (selectorRes) {\n assignComp(selectorRes.component);\n paramsFromSelector = selectorRes.params;\n popupFromSelector = selectorRes.popup;\n popupPositionFromSelector = selectorRes.popupPosition;\n }\n else {\n // if no selector, or result of selector is empty, take from defObject\n assignComp(defObjectAny[propertyName]);\n }\n }\n return { compName: compName, jsComp: jsComp, fwComp: fwComp, paramsFromSelector: paramsFromSelector, popupFromSelector: popupFromSelector, popupPositionFromSelector: popupPositionFromSelector };\n };\n UserComponentFactory.prototype.newAgStackInstance = function (ComponentClass, componentFromFramework, params, type) {\n var propertyName = type.propertyName;\n var jsComponent = !componentFromFramework;\n // using javascript component\n var instance;\n if (jsComponent) {\n instance = new ComponentClass();\n }\n else {\n // Using framework component\n var thisComponentConfig = this.componentMetadataProvider.retrieve(propertyName);\n instance = this.frameworkComponentWrapper.wrap(ComponentClass, thisComponentConfig.mandatoryMethodList, thisComponentConfig.optionalMethodList, type);\n }\n var deferredInit = this.initComponent(instance, params);\n if (deferredInit == null) {\n return AgPromise.resolve(instance);\n }\n return deferredInit.then(function () { return instance; });\n };\n // used by Floating Filter\n UserComponentFactory.prototype.mergeParamsWithApplicationProvidedParams = function (defObject, type, paramsFromGrid, paramsFromSelector) {\n if (paramsFromSelector === void 0) { paramsFromSelector = null; }\n var params = this.gridOptionsService.getGridCommonParams();\n mergeDeep(params, paramsFromGrid);\n // pull user params from either the old prop name and new prop name\n // eg either cellRendererParams and cellCompParams\n var defObjectAny = defObject;\n var userParams = defObjectAny && defObjectAny[type.propertyName + 'Params'];\n if (typeof userParams === 'function') {\n var userParamsFromFunc = userParams(paramsFromGrid);\n mergeDeep(params, userParamsFromFunc);\n }\n else if (typeof userParams === 'object') {\n mergeDeep(params, userParams);\n }\n mergeDeep(params, paramsFromSelector);\n return params;\n };\n UserComponentFactory.prototype.initComponent = function (component, params) {\n this.context.createBean(component);\n if (component.init == null) {\n return;\n }\n return component.init(params);\n };\n UserComponentFactory.prototype.getDefaultFloatingFilterType = function (def, getFromDefault) {\n if (def == null) {\n return null;\n }\n var defaultFloatingFilterType = null;\n var _a = this.getCompKeys(def, FilterComponent), compName = _a.compName, jsComp = _a.jsComp, fwComp = _a.fwComp;\n if (compName) {\n // will be undefined if not in the map\n defaultFloatingFilterType = FloatingFilterMapper.getFloatingFilterType(compName);\n }\n else {\n var usingDefaultFilter = (jsComp == null && fwComp == null) && (def.filter === true);\n if (usingDefaultFilter) {\n defaultFloatingFilterType = getFromDefault();\n }\n }\n return defaultFloatingFilterType;\n };\n __decorate$27([\n Autowired('gridOptions')\n ], UserComponentFactory.prototype, \"gridOptions\", void 0);\n __decorate$27([\n Autowired('agComponentUtils')\n ], UserComponentFactory.prototype, \"agComponentUtils\", void 0);\n __decorate$27([\n Autowired('componentMetadataProvider')\n ], UserComponentFactory.prototype, \"componentMetadataProvider\", void 0);\n __decorate$27([\n Autowired('userComponentRegistry')\n ], UserComponentFactory.prototype, \"userComponentRegistry\", void 0);\n __decorate$27([\n Optional('frameworkComponentWrapper')\n ], UserComponentFactory.prototype, \"frameworkComponentWrapper\", void 0);\n UserComponentFactory = __decorate$27([\n Bean('userComponentFactory')\n ], UserComponentFactory);\n return UserComponentFactory;\n}(BeanStub));\n\nvar ColDefUtil = /** @class */ (function () {\n function ColDefUtil() {\n }\n ColDefUtil.ColDefPropertyMap = {\n headerName: undefined,\n columnGroupShow: undefined,\n headerClass: undefined,\n toolPanelClass: undefined,\n headerValueGetter: undefined,\n pivotKeys: undefined,\n groupId: undefined,\n colId: undefined,\n sort: undefined,\n initialSort: undefined,\n field: undefined,\n type: undefined,\n cellDataType: undefined,\n tooltipComponent: undefined,\n tooltipField: undefined,\n headerTooltip: undefined,\n cellClass: undefined,\n showRowGroup: undefined,\n filter: undefined,\n initialAggFunc: undefined,\n defaultAggFunc: undefined,\n aggFunc: undefined,\n pinned: undefined,\n initialPinned: undefined,\n chartDataType: undefined,\n cellAriaRole: undefined,\n cellEditorPopupPosition: undefined,\n headerGroupComponent: undefined,\n headerGroupComponentParams: undefined,\n cellStyle: undefined,\n cellRenderer: undefined,\n cellRendererParams: undefined,\n cellEditor: undefined,\n cellEditorParams: undefined,\n filterParams: undefined,\n pivotValueColumn: undefined,\n headerComponent: undefined,\n headerComponentParams: undefined,\n floatingFilterComponent: undefined,\n floatingFilterComponentParams: undefined,\n tooltipComponentParams: undefined,\n refData: undefined,\n columnsMenuParams: undefined,\n columnChooserParams: undefined,\n children: undefined,\n sortingOrder: undefined,\n allowedAggFuncs: undefined,\n menuTabs: undefined,\n pivotTotalColumnIds: undefined,\n cellClassRules: undefined,\n icons: undefined,\n sortIndex: undefined,\n initialSortIndex: undefined,\n flex: undefined,\n initialFlex: undefined,\n width: undefined,\n initialWidth: undefined,\n minWidth: undefined,\n maxWidth: undefined,\n rowGroupIndex: undefined,\n initialRowGroupIndex: undefined,\n pivotIndex: undefined,\n initialPivotIndex: undefined,\n suppressCellFlash: undefined,\n suppressColumnsToolPanel: undefined,\n suppressFiltersToolPanel: undefined,\n openByDefault: undefined,\n marryChildren: undefined,\n suppressStickyLabel: undefined,\n hide: undefined,\n initialHide: undefined,\n rowGroup: undefined,\n initialRowGroup: undefined,\n pivot: undefined,\n initialPivot: undefined,\n checkboxSelection: undefined,\n showDisabledCheckboxes: undefined,\n headerCheckboxSelection: undefined,\n headerCheckboxSelectionFilteredOnly: undefined,\n headerCheckboxSelectionCurrentPageOnly: undefined,\n suppressMenu: undefined,\n suppressHeaderMenuButton: undefined,\n suppressMovable: undefined,\n lockPosition: undefined,\n lockVisible: undefined,\n lockPinned: undefined,\n unSortIcon: undefined,\n suppressSizeToFit: undefined,\n suppressAutoSize: undefined,\n enableRowGroup: undefined,\n enablePivot: undefined,\n enableValue: undefined,\n editable: undefined,\n suppressPaste: undefined,\n suppressNavigable: undefined,\n enableCellChangeFlash: undefined,\n rowDrag: undefined,\n dndSource: undefined,\n autoHeight: undefined,\n wrapText: undefined,\n sortable: undefined,\n resizable: undefined,\n singleClickEdit: undefined,\n floatingFilter: undefined,\n cellEditorPopup: undefined,\n suppressFillHandle: undefined,\n wrapHeaderText: undefined,\n autoHeaderHeight: undefined,\n dndSourceOnRowDrag: undefined,\n valueGetter: undefined,\n valueSetter: undefined,\n filterValueGetter: undefined,\n keyCreator: undefined,\n valueFormatter: undefined,\n valueParser: undefined,\n comparator: undefined,\n equals: undefined,\n pivotComparator: undefined,\n suppressKeyboardEvent: undefined,\n suppressHeaderKeyboardEvent: undefined,\n colSpan: undefined,\n rowSpan: undefined,\n getQuickFilterText: undefined,\n onCellValueChanged: undefined,\n onCellClicked: undefined,\n onCellDoubleClicked: undefined,\n onCellContextMenu: undefined,\n rowDragText: undefined,\n tooltipValueGetter: undefined,\n cellRendererSelector: undefined,\n cellEditorSelector: undefined,\n suppressSpanHeaderHeight: undefined,\n useValueFormatterForExport: undefined,\n useValueParserForImport: undefined,\n mainMenuItems: undefined,\n contextMenuItems: undefined,\n suppressFloatingFilterButton: undefined,\n suppressHeaderFilterButton: undefined,\n suppressHeaderContextMenu: undefined,\n };\n ColDefUtil.ALL_PROPERTIES = Object.keys(ColDefUtil.ColDefPropertyMap);\n return ColDefUtil;\n}());\n\n// Excel Export\nvar ExcelFactoryMode;\n(function (ExcelFactoryMode) {\n ExcelFactoryMode[ExcelFactoryMode[\"SINGLE_SHEET\"] = 0] = \"SINGLE_SHEET\";\n ExcelFactoryMode[ExcelFactoryMode[\"MULTI_SHEET\"] = 1] = \"MULTI_SHEET\";\n})(ExcelFactoryMode || (ExcelFactoryMode = {}));\n\nvar __extends$2k = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$26 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n/** Adds drag listening onto an element. In AG Grid this is used twice, first is resizing columns,\n * second is moving the columns and column groups around (ie the 'drag' part of Drag and Drop. */\nvar DragService = /** @class */ (function (_super) {\n __extends$2k(DragService, _super);\n function DragService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.dragEndFunctions = [];\n _this.dragSources = [];\n return _this;\n }\n DragService.prototype.removeAllListeners = function () {\n this.dragSources.forEach(this.removeListener.bind(this));\n this.dragSources.length = 0;\n };\n DragService.prototype.removeListener = function (dragSourceAndListener) {\n var element = dragSourceAndListener.dragSource.eElement;\n var mouseDownListener = dragSourceAndListener.mouseDownListener;\n element.removeEventListener('mousedown', mouseDownListener);\n // remove touch listener only if it exists\n if (dragSourceAndListener.touchEnabled) {\n var touchStartListener = dragSourceAndListener.touchStartListener;\n element.removeEventListener('touchstart', touchStartListener, { passive: true });\n }\n };\n DragService.prototype.removeDragSource = function (params) {\n var dragSourceAndListener = this.dragSources.find(function (item) { return item.dragSource === params; });\n if (!dragSourceAndListener) {\n return;\n }\n this.removeListener(dragSourceAndListener);\n removeFromArray(this.dragSources, dragSourceAndListener);\n };\n DragService.prototype.isDragging = function () {\n return this.dragging;\n };\n DragService.prototype.addDragSource = function (params) {\n var _this = this;\n var mouseListener = this.onMouseDown.bind(this, params);\n var eElement = params.eElement, includeTouch = params.includeTouch, stopPropagationForTouch = params.stopPropagationForTouch;\n eElement.addEventListener('mousedown', mouseListener);\n var touchListener = null;\n var suppressTouch = this.gridOptionsService.get('suppressTouch');\n if (includeTouch && !suppressTouch) {\n touchListener = function (touchEvent) {\n if (isFocusableFormField(touchEvent.target)) {\n return;\n }\n if (touchEvent.cancelable) {\n touchEvent.preventDefault();\n if (stopPropagationForTouch) {\n touchEvent.stopPropagation();\n }\n }\n _this.onTouchStart(params, touchEvent);\n };\n // we set passive=false, as we want to prevent default on this event\n eElement.addEventListener('touchstart', touchListener, { passive: false });\n }\n this.dragSources.push({\n dragSource: params,\n mouseDownListener: mouseListener,\n touchStartListener: touchListener,\n touchEnabled: !!includeTouch\n });\n };\n DragService.prototype.getStartTarget = function () {\n return this.startTarget;\n };\n // gets called whenever mouse down on any drag source\n DragService.prototype.onTouchStart = function (params, touchEvent) {\n var _this = this;\n this.currentDragParams = params;\n this.dragging = false;\n var touch = touchEvent.touches[0];\n this.touchLastTime = touch;\n this.touchStart = touch;\n var touchMoveEvent = function (e) { return _this.onTouchMove(e, params.eElement); };\n var touchEndEvent = function (e) { return _this.onTouchUp(e, params.eElement); };\n var documentTouchMove = function (e) { if (e.cancelable) {\n e.preventDefault();\n } };\n var target = touchEvent.target;\n var events = [\n // Prevents the page document from moving while we are dragging items around.\n // preventDefault needs to be called in the touchmove listener and never inside the\n // touchstart, because using touchstart causes the click event to be cancelled on touch devices.\n { target: this.gridOptionsService.getRootNode(), type: 'touchmove', listener: documentTouchMove, options: { passive: false } },\n { target: target, type: 'touchmove', listener: touchMoveEvent, options: { passive: true } },\n { target: target, type: 'touchend', listener: touchEndEvent, options: { passive: true } },\n { target: target, type: 'touchcancel', listener: touchEndEvent, options: { passive: true } }\n ];\n // temporally add these listeners, for the duration of the drag\n this.addTemporaryEvents(events);\n // see if we want to start dragging straight away\n if (params.dragStartPixels === 0) {\n this.onCommonMove(touch, this.touchStart, params.eElement);\n }\n };\n // gets called whenever mouse down on any drag source\n DragService.prototype.onMouseDown = function (params, mouseEvent) {\n var _this = this;\n var e = mouseEvent;\n if (params.skipMouseEvent && params.skipMouseEvent(mouseEvent)) {\n return;\n }\n // if there are two elements with parent / child relationship, and both are draggable,\n // when we drag the child, we should NOT drag the parent. an example of this is row moving\n // and range selection - row moving should get preference when use drags the rowDrag component.\n if (e._alreadyProcessedByDragService) {\n return;\n }\n e._alreadyProcessedByDragService = true;\n // only interested in left button clicks\n if (mouseEvent.button !== 0) {\n return;\n }\n if (this.shouldPreventMouseEvent(mouseEvent)) {\n mouseEvent.preventDefault();\n }\n this.currentDragParams = params;\n this.dragging = false;\n this.mouseStartEvent = mouseEvent;\n this.startTarget = mouseEvent.target;\n var mouseMoveEvent = function (event) { return _this.onMouseMove(event, params.eElement); };\n var mouseUpEvent = function (event) { return _this.onMouseUp(event, params.eElement); };\n var contextEvent = function (event) { return event.preventDefault(); };\n var target = this.gridOptionsService.getRootNode();\n var events = [\n { target: target, type: 'mousemove', listener: mouseMoveEvent },\n { target: target, type: 'mouseup', listener: mouseUpEvent },\n { target: target, type: 'contextmenu', listener: contextEvent }\n ];\n // temporally add these listeners, for the duration of the drag\n this.addTemporaryEvents(events);\n //see if we want to start dragging straight away\n if (params.dragStartPixels === 0) {\n this.onMouseMove(mouseEvent, params.eElement);\n }\n };\n DragService.prototype.addTemporaryEvents = function (events) {\n events.forEach(function (currentEvent) {\n var target = currentEvent.target, type = currentEvent.type, listener = currentEvent.listener, options = currentEvent.options;\n target.addEventListener(type, listener, options);\n });\n this.dragEndFunctions.push(function () {\n events.forEach(function (currentEvent) {\n var target = currentEvent.target, type = currentEvent.type, listener = currentEvent.listener, options = currentEvent.options;\n target.removeEventListener(type, listener, options);\n });\n });\n };\n // returns true if the event is close to the original event by X pixels either vertically or horizontally.\n // we only start dragging after X pixels so this allows us to know if we should start dragging yet.\n DragService.prototype.isEventNearStartEvent = function (currentEvent, startEvent) {\n // by default, we wait 4 pixels before starting the drag\n var dragStartPixels = this.currentDragParams.dragStartPixels;\n var requiredPixelDiff = exists(dragStartPixels) ? dragStartPixels : 4;\n return areEventsNear(currentEvent, startEvent, requiredPixelDiff);\n };\n DragService.prototype.getFirstActiveTouch = function (touchList) {\n for (var i = 0; i < touchList.length; i++) {\n if (touchList[i].identifier === this.touchStart.identifier) {\n return touchList[i];\n }\n }\n return null;\n };\n DragService.prototype.onCommonMove = function (currentEvent, startEvent, el) {\n if (!this.dragging) {\n // if mouse hasn't travelled from the start position enough, do nothing\n if (!this.dragging && this.isEventNearStartEvent(currentEvent, startEvent)) {\n return;\n }\n this.dragging = true;\n var event_1 = {\n type: Events.EVENT_DRAG_STARTED,\n target: el\n };\n this.eventService.dispatchEvent(event_1);\n this.currentDragParams.onDragStart(startEvent);\n // we need ONE drag action at the startEvent, so that we are guaranteed the drop target\n // at the start gets notified. this is because the drag can start outside of the element\n // that started it, as the mouse is allowed drag away from the mouse down before it's\n // considered a drag (the isEventNearStartEvent() above). if we didn't do this, then\n // it would be possible to click a column by the edge, then drag outside of the drop zone\n // in less than 4 pixels and the drag officially starts outside of the header but the header\n // wouldn't be notified of the dragging.\n this.currentDragParams.onDragging(startEvent);\n }\n this.currentDragParams.onDragging(currentEvent);\n };\n DragService.prototype.onTouchMove = function (touchEvent, el) {\n var touch = this.getFirstActiveTouch(touchEvent.touches);\n if (!touch) {\n return;\n }\n // this.___statusPanel.setInfoText(Math.random() + ' onTouchMove preventDefault stopPropagation');\n this.onCommonMove(touch, this.touchStart, el);\n };\n // only gets called after a mouse down - as this is only added after mouseDown\n // and is removed when mouseUp happens\n DragService.prototype.onMouseMove = function (mouseEvent, el) {\n var _a;\n if (isBrowserSafari()) {\n var eDocument = this.gridOptionsService.getDocument();\n (_a = eDocument.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();\n }\n if (this.shouldPreventMouseEvent(mouseEvent)) {\n mouseEvent.preventDefault();\n }\n this.onCommonMove(mouseEvent, this.mouseStartEvent, el);\n };\n DragService.prototype.shouldPreventMouseEvent = function (mouseEvent) {\n var isEnableCellTextSelect = this.gridOptionsService.get('enableCellTextSelection');\n var isMouseMove = mouseEvent.type === 'mousemove';\n return (\n // when `isEnableCellTextSelect` is `true`, we need to preventDefault on mouseMove\n // to avoid the grid text being selected while dragging components.\n ((isEnableCellTextSelect && isMouseMove)) &&\n mouseEvent.cancelable &&\n this.mouseEventService.isEventFromThisGrid(mouseEvent) &&\n !this.isOverFormFieldElement(mouseEvent));\n };\n DragService.prototype.isOverFormFieldElement = function (mouseEvent) {\n var el = mouseEvent.target;\n var tagName = el === null || el === void 0 ? void 0 : el.tagName.toLocaleLowerCase();\n return !!(tagName === null || tagName === void 0 ? void 0 : tagName.match('^a$|textarea|input|select|button'));\n };\n DragService.prototype.onTouchUp = function (touchEvent, el) {\n var touch = this.getFirstActiveTouch(touchEvent.changedTouches);\n // i haven't worked this out yet, but there is no matching touch\n // when we get the touch up event. to get around this, we swap in\n // the last touch. this is a hack to 'get it working' while we\n // figure out what's going on, why we are not getting a touch in\n // current event.\n if (!touch) {\n touch = this.touchLastTime;\n }\n // if mouse was left up before we started to move, then this is a tap.\n // we check this before onUpCommon as onUpCommon resets the dragging\n // let tap = !this.dragging;\n // let tapTarget = this.currentDragParams.eElement;\n this.onUpCommon(touch, el);\n // if tap, tell user\n // console.log(`${Math.random()} tap = ${tap}`);\n // if (tap) {\n // tapTarget.click();\n // }\n };\n DragService.prototype.onMouseUp = function (mouseEvent, el) {\n this.onUpCommon(mouseEvent, el);\n };\n DragService.prototype.onUpCommon = function (eventOrTouch, el) {\n if (this.dragging) {\n this.dragging = false;\n this.currentDragParams.onDragStop(eventOrTouch);\n var event_2 = {\n type: Events.EVENT_DRAG_STOPPED,\n target: el\n };\n this.eventService.dispatchEvent(event_2);\n }\n this.mouseStartEvent = null;\n this.startTarget = null;\n this.touchStart = null;\n this.touchLastTime = null;\n this.currentDragParams = null;\n this.dragEndFunctions.forEach(function (func) { return func(); });\n this.dragEndFunctions.length = 0;\n };\n __decorate$26([\n Autowired('mouseEventService')\n ], DragService.prototype, \"mouseEventService\", void 0);\n __decorate$26([\n PreDestroy\n ], DragService.prototype, \"removeAllListeners\", null);\n DragService = __decorate$26([\n Bean('dragService')\n ], DragService);\n return DragService;\n}(BeanStub));\n\nvar AutoScrollService = /** @class */ (function () {\n function AutoScrollService(params) {\n this.tickingInterval = null;\n this.onScrollCallback = null;\n this.scrollContainer = params.scrollContainer;\n this.scrollHorizontally = params.scrollAxis.indexOf('x') !== -1;\n this.scrollVertically = params.scrollAxis.indexOf('y') !== -1;\n this.scrollByTick = params.scrollByTick != null ? params.scrollByTick : 20;\n if (params.onScrollCallback) {\n this.onScrollCallback = params.onScrollCallback;\n }\n if (this.scrollVertically) {\n this.getVerticalPosition = params.getVerticalPosition;\n this.setVerticalPosition = params.setVerticalPosition;\n }\n if (this.scrollHorizontally) {\n this.getHorizontalPosition = params.getHorizontalPosition;\n this.setHorizontalPosition = params.setHorizontalPosition;\n }\n this.shouldSkipVerticalScroll = params.shouldSkipVerticalScroll || (function () { return false; });\n this.shouldSkipHorizontalScroll = params.shouldSkipHorizontalScroll || (function () { return false; });\n }\n AutoScrollService.prototype.check = function (mouseEvent, forceSkipVerticalScroll) {\n if (forceSkipVerticalScroll === void 0) { forceSkipVerticalScroll = false; }\n var skipVerticalScroll = forceSkipVerticalScroll || this.shouldSkipVerticalScroll();\n if (skipVerticalScroll && this.shouldSkipHorizontalScroll()) {\n return;\n }\n var rect = this.scrollContainer.getBoundingClientRect();\n var scrollTick = this.scrollByTick;\n this.tickLeft = mouseEvent.clientX < (rect.left + scrollTick);\n this.tickRight = mouseEvent.clientX > (rect.right - scrollTick);\n this.tickUp = mouseEvent.clientY < (rect.top + scrollTick) && !skipVerticalScroll;\n this.tickDown = mouseEvent.clientY > (rect.bottom - scrollTick) && !skipVerticalScroll;\n if (this.tickLeft || this.tickRight || this.tickUp || this.tickDown) {\n this.ensureTickingStarted();\n }\n else {\n this.ensureCleared();\n }\n };\n AutoScrollService.prototype.ensureTickingStarted = function () {\n if (this.tickingInterval === null) {\n this.tickingInterval = window.setInterval(this.doTick.bind(this), 100);\n this.tickCount = 0;\n }\n };\n AutoScrollService.prototype.doTick = function () {\n this.tickCount++;\n var tickAmount;\n tickAmount = this.tickCount > 20 ? 200 : (this.tickCount > 10 ? 80 : 40);\n if (this.scrollVertically) {\n var vScrollPosition = this.getVerticalPosition();\n if (this.tickUp) {\n this.setVerticalPosition(vScrollPosition - tickAmount);\n }\n if (this.tickDown) {\n this.setVerticalPosition(vScrollPosition + tickAmount);\n }\n }\n if (this.scrollHorizontally) {\n var hScrollPosition = this.getHorizontalPosition();\n if (this.tickLeft) {\n this.setHorizontalPosition(hScrollPosition - tickAmount);\n }\n if (this.tickRight) {\n this.setHorizontalPosition(hScrollPosition + tickAmount);\n }\n }\n if (this.onScrollCallback) {\n this.onScrollCallback();\n }\n };\n AutoScrollService.prototype.ensureCleared = function () {\n if (this.tickingInterval) {\n window.clearInterval(this.tickingInterval);\n this.tickingInterval = null;\n }\n };\n return AutoScrollService;\n}());\n\nvar __extends$2j = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$25 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar LIST_ITEM_HOVERED = 'ag-list-item-hovered';\nvar VirtualListDragFeature = /** @class */ (function (_super) {\n __extends$2j(VirtualListDragFeature, _super);\n function VirtualListDragFeature(comp, virtualList, params) {\n var _this = _super.call(this) || this;\n _this.comp = comp;\n _this.virtualList = virtualList;\n _this.params = params;\n _this.currentDragValue = null;\n _this.lastHoveredListItem = null;\n return _this;\n }\n VirtualListDragFeature.prototype.postConstruct = function () {\n this.addManagedListener(this.params.eventSource, this.params.listItemDragStartEvent, this.listItemDragStart.bind(this));\n this.addManagedListener(this.params.eventSource, this.params.listItemDragEndEvent, this.listItemDragEnd.bind(this));\n this.createDropTarget();\n this.createAutoScrollService();\n };\n VirtualListDragFeature.prototype.listItemDragStart = function (event) {\n this.currentDragValue = this.params.getCurrentDragValue(event);\n this.moveBlocked = this.params.isMoveBlocked(this.currentDragValue);\n };\n VirtualListDragFeature.prototype.listItemDragEnd = function () {\n var _this = this;\n window.setTimeout(function () {\n _this.currentDragValue = null;\n _this.moveBlocked = false;\n }, 10);\n };\n VirtualListDragFeature.prototype.createDropTarget = function () {\n var _this = this;\n var dropTarget = {\n isInterestedIn: function (type) { return type === _this.params.dragSourceType; },\n getIconName: function () { return _this.moveBlocked ? DragAndDropService.ICON_PINNED : DragAndDropService.ICON_MOVE; },\n getContainer: function () { return _this.comp.getGui(); },\n onDragging: function (e) { return _this.onDragging(e); },\n onDragStop: function () { return _this.onDragStop(); },\n onDragLeave: function () { return _this.onDragLeave(); }\n };\n this.dragAndDropService.addDropTarget(dropTarget);\n };\n VirtualListDragFeature.prototype.createAutoScrollService = function () {\n var virtualListGui = this.virtualList.getGui();\n this.autoScrollService = new AutoScrollService({\n scrollContainer: virtualListGui,\n scrollAxis: 'y',\n getVerticalPosition: function () { return virtualListGui.scrollTop; },\n setVerticalPosition: function (position) { return virtualListGui.scrollTop = position; }\n });\n };\n VirtualListDragFeature.prototype.onDragging = function (e) {\n if (!this.currentDragValue || this.moveBlocked) {\n return;\n }\n var hoveredListItem = this.getListDragItem(e);\n var comp = this.virtualList.getComponentAt(hoveredListItem.rowIndex);\n if (!comp) {\n return;\n }\n var el = comp.getGui().parentElement;\n if (this.lastHoveredListItem &&\n this.lastHoveredListItem.rowIndex === hoveredListItem.rowIndex &&\n this.lastHoveredListItem.position === hoveredListItem.position) {\n return;\n }\n this.autoScrollService.check(e.event);\n this.clearHoveredItems();\n this.lastHoveredListItem = hoveredListItem;\n radioCssClass(el, LIST_ITEM_HOVERED);\n radioCssClass(el, \"ag-item-highlight-\".concat(hoveredListItem.position));\n };\n VirtualListDragFeature.prototype.getListDragItem = function (e) {\n var virtualListGui = this.virtualList.getGui();\n var paddingTop = parseFloat(window.getComputedStyle(virtualListGui).paddingTop);\n var rowHeight = this.virtualList.getRowHeight();\n var scrollTop = this.virtualList.getScrollTop();\n var rowIndex = Math.max(0, (e.y - paddingTop + scrollTop) / rowHeight);\n var maxLen = this.params.getNumRows(this.comp) - 1;\n var normalizedRowIndex = Math.min(maxLen, rowIndex) | 0;\n return {\n rowIndex: normalizedRowIndex,\n position: (Math.round(rowIndex) > rowIndex || rowIndex > maxLen) ? 'bottom' : 'top',\n component: this.virtualList.getComponentAt(normalizedRowIndex)\n };\n };\n VirtualListDragFeature.prototype.onDragStop = function () {\n if (this.moveBlocked) {\n return;\n }\n this.params.moveItem(this.currentDragValue, this.lastHoveredListItem);\n this.clearHoveredItems();\n this.autoScrollService.ensureCleared();\n };\n VirtualListDragFeature.prototype.onDragLeave = function () {\n this.clearHoveredItems();\n this.autoScrollService.ensureCleared();\n };\n VirtualListDragFeature.prototype.clearHoveredItems = function () {\n var virtualListGui = this.virtualList.getGui();\n virtualListGui.querySelectorAll(\".\".concat(LIST_ITEM_HOVERED)).forEach(function (el) {\n [\n LIST_ITEM_HOVERED,\n 'ag-item-highlight-top',\n 'ag-item-highlight-bottom'\n ].forEach(function (cls) {\n el.classList.remove(cls);\n });\n });\n this.lastHoveredListItem = null;\n };\n __decorate$25([\n Autowired('dragAndDropService')\n ], VirtualListDragFeature.prototype, \"dragAndDropService\", void 0);\n __decorate$25([\n PostConstruct\n ], VirtualListDragFeature.prototype, \"postConstruct\", null);\n return VirtualListDragFeature;\n}(BeanStub));\n\nvar RowHighlightPosition;\n(function (RowHighlightPosition) {\n RowHighlightPosition[RowHighlightPosition[\"Above\"] = 0] = \"Above\";\n RowHighlightPosition[RowHighlightPosition[\"Below\"] = 1] = \"Below\";\n})(RowHighlightPosition || (RowHighlightPosition = {}));\n\nvar __decorate$24 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nfunction unwrapUserComp(comp) {\n var compAsAny = comp;\n var isProxy = compAsAny != null && compAsAny.getFrameworkComponentInstance != null;\n return isProxy ? compAsAny.getFrameworkComponentInstance() : comp;\n}\nvar GridApi = /** @class */ (function () {\n function GridApi() {\n this.detailGridInfoMap = {};\n this.destroyCalled = false;\n }\n GridApi.prototype.init = function () {\n var _this = this;\n switch (this.rowModel.getType()) {\n case 'clientSide':\n this.clientSideRowModel = this.rowModel;\n break;\n case 'infinite':\n this.infiniteRowModel = this.rowModel;\n break;\n case 'serverSide':\n this.serverSideRowModel = this.rowModel;\n break;\n }\n this.ctrlsService.whenReady(function () {\n _this.gridBodyCtrl = _this.ctrlsService.getGridBodyCtrl();\n });\n };\n /** Used internally by grid. Not intended to be used by the client. Interface may change between releases. */\n GridApi.prototype.__getAlignedGridService = function () {\n return this.alignedGridsService;\n };\n /** Used internally by grid. Not intended to be used by the client. Interface may change between releases. */\n GridApi.prototype.__getContext = function () {\n return this.context;\n };\n /** Used internally by grid. Not intended to be used by the client. Interface may change between releases. */\n GridApi.prototype.__getModel = function () {\n return this.rowModel;\n };\n /** Returns the `gridId` for the current grid as specified via the gridOptions property `gridId` or the auto assigned grid id if none was provided. */\n GridApi.prototype.getGridId = function () {\n return this.context.getGridId();\n };\n /** Register a detail grid with the master grid when it is created. */\n GridApi.prototype.addDetailGridInfo = function (id, gridInfo) {\n this.detailGridInfoMap[id] = gridInfo;\n };\n /** Unregister a detail grid from the master grid when it is destroyed. */\n GridApi.prototype.removeDetailGridInfo = function (id) {\n this.detailGridInfoMap[id] = undefined;\n };\n /** Returns the `DetailGridInfo` corresponding to the supplied `detailGridId`. */\n GridApi.prototype.getDetailGridInfo = function (id) {\n return this.detailGridInfoMap[id];\n };\n /** Iterates through each `DetailGridInfo` in the grid and calls the supplied callback on each. */\n GridApi.prototype.forEachDetailGridInfo = function (callback) {\n var index = 0;\n iterateObject(this.detailGridInfoMap, function (id, gridInfo) {\n // check for undefined, as old references will still be lying around\n if (exists(gridInfo)) {\n callback(gridInfo, index);\n index++;\n }\n });\n };\n /** Similar to `exportDataAsCsv`, except returns the result as a string rather than download it. */\n GridApi.prototype.getDataAsCsv = function (params) {\n if (ModuleRegistry.__assertRegistered(ModuleNames.CsvExportModule, 'api.getDataAsCsv', this.context.getGridId())) {\n return this.csvCreator.getDataAsCsv(params);\n }\n };\n /** Downloads a CSV export of the grid's data. */\n GridApi.prototype.exportDataAsCsv = function (params) {\n if (ModuleRegistry.__assertRegistered(ModuleNames.CsvExportModule, 'api.exportDataAsCSv', this.context.getGridId())) {\n this.csvCreator.exportDataAsCsv(params);\n }\n };\n GridApi.prototype.assertNotExcelMultiSheet = function (method, params) {\n if (!ModuleRegistry.__assertRegistered(ModuleNames.ExcelExportModule, 'api.' + method, this.context.getGridId())) {\n return false;\n }\n if (this.excelCreator.getFactoryMode() === ExcelFactoryMode.MULTI_SHEET) {\n console.warn(\"AG Grid: The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'\");\n return false;\n }\n return true;\n };\n /** Similar to `exportDataAsExcel`, except instead of downloading a file, it will return a [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) to be processed by the user. */\n GridApi.prototype.getDataAsExcel = function (params) {\n if (this.assertNotExcelMultiSheet('getDataAsExcel', params)) {\n return this.excelCreator.getDataAsExcel(params);\n }\n };\n /** Downloads an Excel export of the grid's data. */\n GridApi.prototype.exportDataAsExcel = function (params) {\n if (this.assertNotExcelMultiSheet('exportDataAsExcel', params)) {\n this.excelCreator.exportDataAsExcel(params);\n }\n };\n /** This is method to be used to get the grid's data as a sheet, that will later be exported either by `getMultipleSheetsAsExcel()` or `exportMultipleSheetsAsExcel()`. */\n GridApi.prototype.getSheetDataForExcel = function (params) {\n if (!ModuleRegistry.__assertRegistered(ModuleNames.ExcelExportModule, 'api.getSheetDataForExcel', this.context.getGridId())) {\n return;\n }\n this.excelCreator.setFactoryMode(ExcelFactoryMode.MULTI_SHEET);\n return this.excelCreator.getSheetDataForExcel(params);\n };\n /** Similar to `exportMultipleSheetsAsExcel`, except instead of downloading a file, it will return a [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) to be processed by the user. */\n GridApi.prototype.getMultipleSheetsAsExcel = function (params) {\n if (ModuleRegistry.__assertRegistered(ModuleNames.ExcelExportModule, 'api.getMultipleSheetsAsExcel', this.context.getGridId())) {\n return this.excelCreator.getMultipleSheetsAsExcel(params);\n }\n };\n /** Downloads an Excel export of multiple sheets in one file. */\n GridApi.prototype.exportMultipleSheetsAsExcel = function (params) {\n if (ModuleRegistry.__assertRegistered(ModuleNames.ExcelExportModule, 'api.exportMultipleSheetsAsExcel', this.context.getGridId())) {\n this.excelCreator.exportMultipleSheetsAsExcel(params);\n }\n };\n /**\n * Sets an ARIA property in the grid panel (element with `role=\\\"grid\\\"`), and removes an ARIA property when the value is null.\n *\n * Example: `api.setGridAriaProperty('label', 'my grid')` will set `aria-label=\\\"my grid\\\"`.\n *\n * `api.setGridAriaProperty('label', null)` will remove the `aria-label` attribute from the grid element.\n */\n GridApi.prototype.setGridAriaProperty = function (property, value) {\n if (!property) {\n return;\n }\n var eGrid = this.ctrlsService.getGridBodyCtrl().getGui();\n var ariaProperty = \"aria-\".concat(property);\n if (value === null) {\n eGrid.removeAttribute(ariaProperty);\n }\n else {\n eGrid.setAttribute(ariaProperty, value);\n }\n };\n GridApi.prototype.logMissingRowModel = function (apiMethod) {\n var requiredRowModels = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n requiredRowModels[_i - 1] = arguments[_i];\n }\n console.error(\"AG Grid: api.\".concat(apiMethod, \" can only be called when gridOptions.rowModelType is \").concat(requiredRowModels.join(' or ')));\n };\n GridApi.prototype.logDeprecation = function (version, apiMethod, replacement, message) {\n warnOnce(\"Since \".concat(version, \" api.\").concat(apiMethod, \" is deprecated. Please use \").concat(replacement, \" instead. \").concat(message));\n };\n /** Gets the number of top pinned rows. */\n GridApi.prototype.getPinnedTopRowCount = function () {\n return this.pinnedRowModel.getPinnedTopRowCount();\n };\n /** Gets the number of bottom pinned rows. */\n GridApi.prototype.getPinnedBottomRowCount = function () {\n return this.pinnedRowModel.getPinnedBottomRowCount();\n };\n /** Gets the top pinned row with the specified index. */\n GridApi.prototype.getPinnedTopRow = function (index) {\n return this.pinnedRowModel.getPinnedTopRow(index);\n };\n /** Gets the bottom pinned row with the specified index. */\n GridApi.prototype.getPinnedBottomRow = function (index) {\n return this.pinnedRowModel.getPinnedBottomRow(index);\n };\n GridApi.prototype.expireValueCache = function () {\n this.valueCache.expire();\n };\n /**\n * Returns an object with two properties:\n * - `top`: The top pixel position of the current scroll in the grid\n * - `bottom`: The bottom pixel position of the current scroll in the grid\n */\n GridApi.prototype.getVerticalPixelRange = function () {\n return this.gridBodyCtrl.getScrollFeature().getVScrollPosition();\n };\n /**\n * Returns an object with two properties:\n * - `left`: The left pixel position of the current scroll in the grid\n * - `right`: The right pixel position of the current scroll in the grid\n */\n GridApi.prototype.getHorizontalPixelRange = function () {\n return this.gridBodyCtrl.getScrollFeature().getHScrollPosition();\n };\n /** Performs change detection on all cells, refreshing cells where required. */\n GridApi.prototype.refreshCells = function (params) {\n var _this = this;\n if (params === void 0) { params = {}; }\n this.frameworkOverrides.wrapIncoming(function () { return _this.rowRenderer.refreshCells(params); });\n };\n /** Flash rows, columns or individual cells. */\n GridApi.prototype.flashCells = function (params) {\n var _this = this;\n if (params === void 0) { params = {}; }\n var warning = function (prop) { return warnOnce(\"Since v31.1 api.flashCells parameter '\".concat(prop, \"Delay' is deprecated. Please use '\").concat(prop, \"Duration' instead.\")); };\n if (exists(params.fadeDelay)) {\n warning('fade');\n }\n if (exists(params.flashDelay)) {\n warning('flash');\n }\n this.frameworkOverrides.wrapIncoming(function () { return _this.rowRenderer.flashCells(params); });\n };\n /** Remove row(s) from the DOM and recreate them again from scratch. */\n GridApi.prototype.redrawRows = function (params) {\n var _this = this;\n if (params === void 0) { params = {}; }\n var rowNodes = params ? params.rowNodes : undefined;\n this.frameworkOverrides.wrapIncoming(function () { return _this.rowRenderer.redrawRows(rowNodes); });\n };\n /** Redraws the header. Useful if a column name changes, or something else that changes how the column header is displayed. */\n GridApi.prototype.refreshHeader = function () {\n var _this = this;\n this.frameworkOverrides.wrapIncoming(function () { return _this.ctrlsService.getHeaderRowContainerCtrls().forEach(function (c) { return c.refresh(); }); });\n };\n /** Returns `true` if any filter is set. This includes quick filter, column filter, external filter or advanced filter. */\n GridApi.prototype.isAnyFilterPresent = function () {\n return this.filterManager.isAnyFilterPresent();\n };\n /** Returns `true` if any column filter is set, otherwise `false`. */\n GridApi.prototype.isColumnFilterPresent = function () {\n return this.filterManager.isColumnFilterPresent() || this.filterManager.isAggregateFilterPresent();\n };\n /** Returns `true` if the Quick Filter is set, otherwise `false`. */\n GridApi.prototype.isQuickFilterPresent = function () {\n return this.filterManager.isQuickFilterPresent();\n };\n /**\n * Returns the row model inside the table.\n * From here you can see the original rows, rows after filter has been applied,\n * rows after aggregation has been applied, and the final set of 'to be displayed' rows.\n *\n * @deprecated As of v31.1, getModel() is deprecated and will not be available in future versions.\n * Please use the appropriate grid API methods instead\n */\n GridApi.prototype.getModel = function () {\n warnOnce('Since v31.1 getModel() is deprecated. Please use the appropriate grid API methods instead.');\n return this.rowModel;\n };\n /** Expand or collapse a specific row node, optionally expanding/collapsing all of its parent nodes. */\n GridApi.prototype.setRowNodeExpanded = function (rowNode, expanded, expandParents) {\n this.expansionService.setRowNodeExpanded(rowNode, expanded, expandParents);\n };\n /**\n * Informs the grid that row group expanded state has changed and it needs to rerender the group nodes.\n * Typically called after updating the row node expanded state explicitly, i.e `rowNode.expanded = false`,\n * across multiple groups and you want to update the grid view in a single rerender instead of on every group change.\n */\n GridApi.prototype.onGroupExpandedOrCollapsed = function () {\n if (missing(this.clientSideRowModel)) {\n this.logMissingRowModel('onGroupExpandedOrCollapsed', 'clientSide');\n return;\n }\n this.expansionService.onGroupExpandedOrCollapsed();\n };\n /**\n * Refresh the Client-Side Row Model, executing the grouping, filtering and sorting again.\n * Optionally provide the step you wish the refresh to apply from. Defaults to `everything`.\n */\n GridApi.prototype.refreshClientSideRowModel = function (step) {\n if (missing(this.clientSideRowModel)) {\n this.logMissingRowModel('refreshClientSideRowModel', 'clientSide');\n return;\n }\n this.clientSideRowModel.refreshModel(step);\n };\n /** Returns `true` when there are no more animation frames left to process. */\n GridApi.prototype.isAnimationFrameQueueEmpty = function () {\n return this.animationFrameService.isQueueEmpty();\n };\n GridApi.prototype.flushAllAnimationFrames = function () {\n this.animationFrameService.flushAllFrames();\n };\n /**\n * Returns the row node with the given ID.\n * The row node ID is the one you provide from the callback `getRowId(params)`,\n * otherwise the ID is a number (cast as string) auto-generated by the grid when\n * the row data is set.\n */\n GridApi.prototype.getRowNode = function (id) {\n return this.rowModel.getRowNode(id);\n };\n /**\n * Gets the sizes that various UI elements will be rendered at with the current theme.\n * If you override the row or header height using `gridOptions`, the override value you provided will be returned.\n */\n GridApi.prototype.getSizesForCurrentTheme = function () {\n return {\n rowHeight: this.gos.getRowHeightAsNumber(),\n headerHeight: this.columnModel.getHeaderHeight()\n };\n };\n /** Expand all groups. */\n GridApi.prototype.expandAll = function () {\n if (this.clientSideRowModel || this.serverSideRowModel) {\n this.expansionService.expandAll(true);\n }\n else {\n this.logMissingRowModel('expandAll', 'clientSide', 'serverSide');\n }\n };\n /** Collapse all groups. */\n GridApi.prototype.collapseAll = function () {\n if (this.clientSideRowModel || this.serverSideRowModel) {\n this.expansionService.expandAll(false);\n }\n else {\n this.logMissingRowModel('collapseAll', 'clientSide', 'serverSide');\n }\n };\n /**\n * Registers a callback to a virtual row.\n * A virtual row is a row that is visually rendered on the screen (rows that are not visible because of the scroll position are not rendered).\n * Unlike normal events, you do not need to unregister rendered row listeners.\n * When the rendered row is removed from the grid, all associated rendered row listeners will also be removed.\n * listen for this event if your `cellRenderer` needs to do cleanup when the row no longer exists.\n */\n GridApi.prototype.addRenderedRowListener = function (eventName, rowIndex, callback) {\n this.rowRenderer.addRenderedRowListener(eventName, rowIndex, callback);\n };\n /** Get the current Quick Filter text from the grid, or `undefined` if none is set. */\n GridApi.prototype.getQuickFilter = function () {\n return this.gos.get('quickFilterText');\n };\n /** Get the state of the Advanced Filter. Used for saving Advanced Filter state */\n GridApi.prototype.getAdvancedFilterModel = function () {\n if (ModuleRegistry.__assertRegistered(ModuleNames.AdvancedFilterModule, 'api.getAdvancedFilterModel', this.context.getGridId())) {\n return this.filterManager.getAdvancedFilterModel();\n }\n return null;\n };\n /** Set the state of the Advanced Filter. Used for restoring Advanced Filter state */\n GridApi.prototype.setAdvancedFilterModel = function (advancedFilterModel) {\n this.filterManager.setAdvancedFilterModel(advancedFilterModel);\n };\n /** Open the Advanced Filter Builder dialog (if enabled). */\n GridApi.prototype.showAdvancedFilterBuilder = function () {\n if (ModuleRegistry.__assertRegistered(ModuleNames.AdvancedFilterModule, 'api.setAdvancedFilterModel', this.context.getGridId())) {\n this.filterManager.showAdvancedFilterBuilder('api');\n }\n };\n /**\n * Set all of the provided nodes selection state to the provided value.\n */\n GridApi.prototype.setNodesSelected = function (params) {\n var allNodesValid = params.nodes.every(function (node) {\n if (node.rowPinned) {\n console.warn('AG Grid: cannot select pinned rows');\n return false;\n }\n if (node.id === undefined) {\n console.warn('AG Grid: cannot select node until id for node is known');\n return false;\n }\n return true;\n });\n if (!allNodesValid) {\n return;\n }\n var nodes = params.nodes, source = params.source, newValue = params.newValue;\n var nodesAsRowNode = nodes;\n this.selectionService.setNodesSelected({ nodes: nodesAsRowNode, source: source !== null && source !== void 0 ? source : 'api', newValue: newValue });\n };\n /**\n * Select all rows, regardless of filtering and rows that are not visible due to grouping being enabled and their groups not expanded.\n * @param source Source property that will appear in the `selectionChanged` event, defaults to `'apiSelectAll'`\n */\n GridApi.prototype.selectAll = function (source) {\n if (source === void 0) { source = 'apiSelectAll'; }\n this.selectionService.selectAllRowNodes({ source: source });\n };\n /**\n * Clear all row selections, regardless of filtering.\n * @param source Source property that will appear in the `selectionChanged` event, defaults to `'apiSelectAll'`\n */\n GridApi.prototype.deselectAll = function (source) {\n if (source === void 0) { source = 'apiSelectAll'; }\n this.selectionService.deselectAllRowNodes({ source: source });\n };\n /**\n * Select all filtered rows.\n * @param source Source property that will appear in the `selectionChanged` event, defaults to `'apiSelectAllFiltered'`\n */\n GridApi.prototype.selectAllFiltered = function (source) {\n if (source === void 0) { source = 'apiSelectAllFiltered'; }\n this.selectionService.selectAllRowNodes({ source: source, justFiltered: true });\n };\n /**\n * Clear all filtered selections.\n * @param source Source property that will appear in the `selectionChanged` event, defaults to `'apiSelectAllFiltered'`\n */\n GridApi.prototype.deselectAllFiltered = function (source) {\n if (source === void 0) { source = 'apiSelectAllFiltered'; }\n this.selectionService.deselectAllRowNodes({ source: source, justFiltered: true });\n };\n /**\n * Returns an object containing rules matching the selected rows in the SSRM.\n *\n * If `groupSelectsChildren=false` the returned object will be flat, and will conform to IServerSideSelectionState.\n * If `groupSelectsChildren=true` the returned object will be hierarchical, and will conform to IServerSideGroupSelectionState.\n */\n GridApi.prototype.getServerSideSelectionState = function () {\n if (missing(this.serverSideRowModel)) {\n this.logMissingRowModel('getServerSideSelectionState', 'serverSide');\n return null;\n }\n return this.selectionService.getSelectionState();\n };\n /**\n * Set the rules matching the selected rows in the SSRM.\n *\n * If `groupSelectsChildren=false` the param will be flat, and should conform to IServerSideSelectionState.\n * If `groupSelectsChildren=true` the param will be hierarchical, and should conform to IServerSideGroupSelectionState.\n */\n GridApi.prototype.setServerSideSelectionState = function (state) {\n if (missing(this.serverSideRowModel)) {\n this.logMissingRowModel('setServerSideSelectionState', 'serverSide');\n return;\n }\n this.selectionService.setSelectionState(state, 'api');\n };\n /**\n * Select all rows on the current page.\n * @param source Source property that will appear in the `selectionChanged` event, defaults to `'apiSelectAllCurrentPage'`\n */\n GridApi.prototype.selectAllOnCurrentPage = function (source) {\n if (source === void 0) { source = 'apiSelectAllCurrentPage'; }\n this.selectionService.selectAllRowNodes({ source: source, justCurrentPage: true });\n };\n /**\n * Clear all filtered on the current page.\n * @param source Source property that will appear in the `selectionChanged` event, defaults to `'apiSelectAllCurrentPage'`\n */\n GridApi.prototype.deselectAllOnCurrentPage = function (source) {\n if (source === void 0) { source = 'apiSelectAllCurrentPage'; }\n this.selectionService.deselectAllRowNodes({ source: source, justCurrentPage: true });\n };\n /** Show the 'loading' overlay. */\n GridApi.prototype.showLoadingOverlay = function () {\n this.overlayService.showLoadingOverlay();\n };\n /** Show the 'no rows' overlay. */\n GridApi.prototype.showNoRowsOverlay = function () {\n this.overlayService.showNoRowsOverlay();\n };\n /** Hides the overlay if showing. */\n GridApi.prototype.hideOverlay = function () {\n this.overlayService.hideOverlay();\n };\n /**\n * Returns an unsorted list of selected nodes.\n * Getting the underlying node (rather than the data) is useful when working with tree / aggregated data,\n * as the node can be traversed.\n */\n GridApi.prototype.getSelectedNodes = function () {\n return this.selectionService.getSelectedNodes();\n };\n /** Returns an unsorted list of selected rows (i.e. row data that you provided). */\n GridApi.prototype.getSelectedRows = function () {\n return this.selectionService.getSelectedRows();\n };\n /**\n * Returns a list of all selected nodes at 'best cost', a feature to be used with groups / trees.\n * If a group has all its children selected, then the group appears in the result, but not the children.\n * Designed for use with `'children'` as the group selection type, where groups don't actually appear in the selection normally.\n */\n GridApi.prototype.getBestCostNodeSelection = function () {\n if (missing(this.clientSideRowModel)) {\n this.logMissingRowModel('getBestCostNodeSelection', 'clientSide');\n return;\n }\n return this.selectionService.getBestCostNodeSelection();\n };\n /** Retrieve rendered nodes. Due to virtualisation this will contain only the current visible rows and those in the buffer. */\n GridApi.prototype.getRenderedNodes = function () {\n return this.rowRenderer.getRenderedNodes();\n };\n /**\n * Ensures the column is visible by scrolling the table if needed.\n *\n * This will have no effect before the firstDataRendered event has fired.\n *\n * @param key - The column to ensure visible\n * @param position - Where the column will be positioned.\n * - `auto` - Scrolls the minimum amount to make sure the column is visible.\n * - `start` - Scrolls the column to the start of the viewport.\n * - `middle` - Scrolls the column to the middle of the viewport.\n * - `end` - Scrolls the column to the end of the viewport.\n */\n GridApi.prototype.ensureColumnVisible = function (key, position) {\n var _this = this;\n if (position === void 0) { position = 'auto'; }\n this.frameworkOverrides.wrapIncoming(function () { return _this.gridBodyCtrl.getScrollFeature().ensureColumnVisible(key, position); }, 'ensureVisible');\n };\n /**\n * Vertically scrolls the grid until the provided row index is inside the visible viewport.\n * If a position is provided, the grid will attempt to scroll until the row is at the given position within the viewport.\n * This will have no effect before the firstDataRendered event has fired.\n */\n GridApi.prototype.ensureIndexVisible = function (index, position) {\n var _this = this;\n this.frameworkOverrides.wrapIncoming(function () { return _this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(index, position); }, 'ensureVisible');\n };\n /**\n * Vertically scrolls the grid until the provided row (or a row matching the provided comparator) is inside the visible viewport.\n * If a position is provided, the grid will attempt to scroll until the row is at the given position within the viewport.\n * This will have no effect before the firstDataRendered event has fired.\n */\n GridApi.prototype.ensureNodeVisible = function (nodeSelector, position) {\n var _this = this;\n if (position === void 0) { position = null; }\n this.frameworkOverrides.wrapIncoming(function () { return _this.gridBodyCtrl.getScrollFeature().ensureNodeVisible(nodeSelector, position); }, 'ensureVisible');\n };\n /**\n * Similar to `forEachNode`, except lists all the leaf nodes.\n * This effectively goes through all the data that you provided to the grid before the grid performed any grouping.\n * If using tree data, goes through all the nodes for the data you provided, including nodes that have children,\n * but excluding groups the grid created where gaps were missing in the hierarchy.\n */\n GridApi.prototype.forEachLeafNode = function (callback) {\n if (missing(this.clientSideRowModel)) {\n this.logMissingRowModel('forEachLeafNode', 'clientSide');\n return;\n }\n this.clientSideRowModel.forEachLeafNode(callback);\n };\n /**\n * Iterates through each node (row) in the grid and calls the callback for each node.\n * This works similar to the `forEach` method on a JavaScript array.\n * This is called for every node, ignoring any filtering or sorting applied within the grid.\n * If using the Infinite Row Model, then this gets called for each page loaded in the page cache.\n */\n GridApi.prototype.forEachNode = function (callback, includeFooterNodes) {\n this.rowModel.forEachNode(callback, includeFooterNodes);\n };\n /** Similar to `forEachNode`, except skips any filtered out data. */\n GridApi.prototype.forEachNodeAfterFilter = function (callback) {\n if (missing(this.clientSideRowModel)) {\n this.logMissingRowModel('forEachNodeAfterFilter', 'clientSide');\n return;\n }\n this.clientSideRowModel.forEachNodeAfterFilter(callback);\n };\n /** Similar to `forEachNodeAfterFilter`, except the callbacks are called in the order the rows are displayed in the grid. */\n GridApi.prototype.forEachNodeAfterFilterAndSort = function (callback) {\n if (missing(this.clientSideRowModel)) {\n this.logMissingRowModel('forEachNodeAfterFilterAndSort', 'clientSide');\n return;\n }\n this.clientSideRowModel.forEachNodeAfterFilterAndSort(callback);\n };\n /**\n * @deprecated v31.1 To get/set individual filter models, use `getColumnFilterModel` or `setColumnFilterModel` instead.\n * To get hold of the filter instance, use `getColumnFilterInstance` which returns the instance asynchronously.\n */\n GridApi.prototype.getFilterInstance = function (key, callback) {\n warnOnce(\"'getFilterInstance' is deprecated. To get/set individual filter models, use 'getColumnFilterModel' or 'setColumnFilterModel' instead. To get hold of the filter instance, use 'getColumnFilterInstance' which returns the instance asynchronously.\");\n return this.filterManager.getFilterInstance(key, callback);\n };\n /**\n * Returns the filter component instance for a column.\n * For getting/setting models for individual column filters, use `getColumnFilterModel` and `setColumnFilterModel` instead of this.\n * `key` can be a column ID or a `Column` object.\n */\n GridApi.prototype.getColumnFilterInstance = function (key) {\n return this.filterManager.getColumnFilterInstance(key);\n };\n /** Destroys a filter. Useful to force a particular filter to be created from scratch again. */\n GridApi.prototype.destroyFilter = function (key) {\n var column = this.columnModel.getPrimaryColumn(key);\n if (column) {\n return this.filterManager.destroyFilter(column, 'api');\n }\n };\n /** Gets the status panel instance corresponding to the supplied `id`. */\n GridApi.prototype.getStatusPanel = function (key) {\n if (!ModuleRegistry.__assertRegistered(ModuleNames.StatusBarModule, 'api.getStatusPanel', this.context.getGridId())) {\n return;\n }\n var comp = this.statusBarService.getStatusPanel(key);\n return unwrapUserComp(comp);\n };\n GridApi.prototype.getColumnDef = function (key) {\n var column = this.columnModel.getPrimaryColumn(key);\n if (column) {\n return column.getColDef();\n }\n return null;\n };\n /**\n * Returns the current column definitions.\n */\n GridApi.prototype.getColumnDefs = function () { return this.columnModel.getColumnDefs(); };\n /**\n * Informs the grid that a filter has changed. This is typically called after a filter change through one of the filter APIs.\n * @param source The source of the filter change event. If not specified defaults to `'api'`.\n */\n GridApi.prototype.onFilterChanged = function (source) {\n if (source === void 0) { source = 'api'; }\n this.filterManager.onFilterChanged({ source: source });\n };\n /**\n * Gets the grid to act as if the sort was changed.\n * Useful if you update some values and want to get the grid to reorder them according to the new values.\n */\n GridApi.prototype.onSortChanged = function () {\n this.sortController.onSortChanged('api');\n };\n /**\n * Sets the state of all the column filters. Provide it with what you get from `getFilterModel()` to restore filter state.\n * If inferring cell data types, and row data is provided asynchronously and is yet to be set,\n * the filter model will be applied asynchronously after row data is added.\n * To always perform this synchronously, set `cellDataType = false` on the default column definition,\n * or provide cell data types for every column.\n */\n GridApi.prototype.setFilterModel = function (model) {\n var _this = this;\n this.frameworkOverrides.wrapIncoming(function () { return _this.filterManager.setFilterModel(model); });\n };\n /** Gets the current state of all the column filters. Used for saving filter state. */\n GridApi.prototype.getFilterModel = function () {\n return this.filterManager.getFilterModel();\n };\n /**\n * Gets the current filter model for the specified column.\n * Will return `null` if no active filter.\n */\n GridApi.prototype.getColumnFilterModel = function (column) {\n return this.filterManager.getColumnFilterModel(column);\n };\n /**\n * Sets the filter model for the specified column.\n * Setting a `model` of `null` will reset the filter (make inactive).\n * Must wait on the response before calling `api.onFilterChanged()`.\n */\n GridApi.prototype.setColumnFilterModel = function (column, model) {\n return this.filterManager.setColumnFilterModel(column, model);\n };\n /** Returns the focused cell (or the last focused cell if the grid lost focus). */\n GridApi.prototype.getFocusedCell = function () {\n return this.focusService.getFocusedCell();\n };\n /** Clears the focused cell. */\n GridApi.prototype.clearFocusedCell = function () {\n return this.focusService.clearFocusedCell();\n };\n /** Sets the focus to the specified cell. `rowPinned` can be either 'top', 'bottom' or null (for not pinned). */\n GridApi.prototype.setFocusedCell = function (rowIndex, colKey, rowPinned) {\n this.focusService.setFocusedCell({ rowIndex: rowIndex, column: colKey, rowPinned: rowPinned, forceBrowserFocus: true });\n };\n /** Adds a drop zone outside of the grid where rows can be dropped. */\n GridApi.prototype.addRowDropZone = function (params) {\n this.gridBodyCtrl.getRowDragFeature().addRowDropZone(params);\n };\n /** Removes an external drop zone added by `addRowDropZone`. */\n GridApi.prototype.removeRowDropZone = function (params) {\n var activeDropTarget = this.dragAndDropService.findExternalZone(params);\n if (activeDropTarget) {\n this.dragAndDropService.removeDropTarget(activeDropTarget);\n }\n };\n /** Returns the `RowDropZoneParams` to be used by another grid's `addRowDropZone` method. */\n GridApi.prototype.getRowDropZoneParams = function (events) {\n return this.gridBodyCtrl.getRowDragFeature().getRowDropZone(events);\n };\n GridApi.prototype.assertSideBarLoaded = function (apiMethod) {\n return ModuleRegistry.__assertRegistered(ModuleNames.SideBarModule, 'api.' + apiMethod, this.context.getGridId());\n };\n /** Returns `true` if the side bar is visible. */\n GridApi.prototype.isSideBarVisible = function () {\n return this.assertSideBarLoaded('isSideBarVisible') && this.sideBarService.getSideBarComp().isDisplayed();\n };\n /** Show/hide the entire side bar, including any visible panel and the tab buttons. */\n GridApi.prototype.setSideBarVisible = function (show) {\n if (this.assertSideBarLoaded('setSideBarVisible')) {\n this.sideBarService.getSideBarComp().setDisplayed(show);\n }\n };\n /** Sets the side bar position relative to the grid. Possible values are `'left'` or `'right'`. */\n GridApi.prototype.setSideBarPosition = function (position) {\n if (this.assertSideBarLoaded('setSideBarPosition')) {\n this.sideBarService.getSideBarComp().setSideBarPosition(position);\n }\n };\n /** Opens a particular tool panel. Provide the ID of the tool panel to open. */\n GridApi.prototype.openToolPanel = function (key) {\n if (this.assertSideBarLoaded('openToolPanel')) {\n this.sideBarService.getSideBarComp().openToolPanel(key, 'api');\n }\n };\n /** Closes the currently open tool panel (if any). */\n GridApi.prototype.closeToolPanel = function () {\n if (this.assertSideBarLoaded('closeToolPanel')) {\n this.sideBarService.getSideBarComp().close('api');\n }\n };\n /** Returns the ID of the currently shown tool panel if any, otherwise `null`. */\n GridApi.prototype.getOpenedToolPanel = function () {\n if (this.assertSideBarLoaded('getOpenedToolPanel')) {\n return this.sideBarService.getSideBarComp().openedItem();\n }\n return null;\n };\n /** Force refresh all tool panels by calling their `refresh` method. */\n GridApi.prototype.refreshToolPanel = function () {\n if (this.assertSideBarLoaded('refreshToolPanel')) {\n this.sideBarService.getSideBarComp().refresh();\n }\n };\n /** Returns `true` if the tool panel is showing, otherwise `false`. */\n GridApi.prototype.isToolPanelShowing = function () {\n return this.assertSideBarLoaded('isToolPanelShowing') && this.sideBarService.getSideBarComp().isToolPanelShowing();\n };\n /** Gets the tool panel instance corresponding to the supplied `id`. */\n GridApi.prototype.getToolPanelInstance = function (id) {\n if (this.assertSideBarLoaded('getToolPanelInstance')) {\n var comp = this.sideBarService.getSideBarComp().getToolPanelInstance(id);\n return unwrapUserComp(comp);\n }\n };\n /** Returns the current side bar configuration. If a shortcut was used, returns the detailed long form. */\n GridApi.prototype.getSideBar = function () {\n if (this.assertSideBarLoaded('getSideBar')) {\n return this.sideBarService.getSideBarComp().getDef();\n }\n return undefined;\n };\n /** Tells the grid to recalculate the row heights. */\n GridApi.prototype.resetRowHeights = function () {\n if (exists(this.clientSideRowModel)) {\n if (this.columnModel.isAutoRowHeightActive()) {\n console.warn('AG Grid: calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.');\n return;\n }\n this.clientSideRowModel.resetRowHeights();\n }\n };\n /**\n * Sets the `rowCount` and `maxRowFound` properties.\n * The second parameter, `maxRowFound`, is optional and if left out, only `rowCount` is set.\n * Set `rowCount` to adjust the height of the vertical scroll.\n * Set `maxRowFound` to enable / disable searching for more rows.\n * Use this method if you add or remove rows into the dataset and need to reset the number of rows or instruct the grid that the entire row count is no longer known.\n */\n GridApi.prototype.setRowCount = function (rowCount, maxRowFound) {\n if (this.serverSideRowModel) {\n if (this.columnModel.isRowGroupEmpty()) {\n this.serverSideRowModel.setRowCount(rowCount, maxRowFound);\n return;\n }\n console.error('AG Grid: setRowCount cannot be used while using row grouping.');\n return;\n }\n if (this.infiniteRowModel) {\n this.infiniteRowModel.setRowCount(rowCount, maxRowFound);\n return;\n }\n this.logMissingRowModel('setRowCount', 'infinite', 'serverSide');\n };\n /** Tells the grid a row height has changed. To be used after calling `rowNode.setRowHeight(newHeight)`. */\n GridApi.prototype.onRowHeightChanged = function () {\n if (this.clientSideRowModel) {\n this.clientSideRowModel.onRowHeightChanged();\n }\n else if (this.serverSideRowModel) {\n this.serverSideRowModel.onRowHeightChanged();\n }\n };\n /**\n * Gets the value for a column for a particular `rowNode` (row).\n * This is useful if you want the raw value of a cell e.g. if implementing your own CSV export.\n */\n GridApi.prototype.getValue = function (colKey, rowNode) {\n var column = this.columnModel.getPrimaryColumn(colKey);\n if (missing(column)) {\n column = this.columnModel.getGridColumn(colKey);\n }\n if (missing(column)) {\n return null;\n }\n return this.valueService.getValue(column, rowNode);\n };\n /**\n * Add an event listener for the specified `eventType`.\n * Works similar to `addEventListener` for a browser DOM element.\n * Listeners will be automatically removed when the grid is destroyed.\n */\n GridApi.prototype.addEventListener = function (eventType, listener) {\n this.apiEventService.addEventListener(eventType, listener);\n };\n /**\n * Add an event listener for all event types coming from the grid.\n * Listeners will be automatically removed when the grid is destroyed.\n */\n GridApi.prototype.addGlobalListener = function (listener) {\n this.apiEventService.addGlobalListener(listener);\n };\n /** Remove an event listener. */\n GridApi.prototype.removeEventListener = function (eventType, listener) {\n this.apiEventService.removeEventListener(eventType, listener);\n };\n /** Remove a global event listener. */\n GridApi.prototype.removeGlobalListener = function (listener) {\n this.apiEventService.removeGlobalListener(listener);\n };\n GridApi.prototype.dispatchEvent = function (event) {\n this.eventService.dispatchEvent(event);\n };\n /** Will destroy the grid and release resources. If you are using a framework you do not need to call this, as the grid links in with the framework lifecycle. However if you are using Web Components or native JavaScript, you do need to call this, to avoid a memory leak in your application. */\n GridApi.prototype.destroy = function () {\n // Get framework link before this is destroyed\n var preDestroyLink = \"See \".concat(this.frameworkOverrides.getDocLink('grid-lifecycle/#grid-pre-destroyed'));\n // this is needed as GridAPI is a bean, and GridAPI.destroy() is called as part\n // of context.destroy(). so we need to stop the infinite loop.\n if (this.destroyCalled) {\n return;\n }\n var event = {\n type: Events.EVENT_GRID_PRE_DESTROYED,\n state: this.getState()\n };\n this.dispatchEvent(event);\n // Set after pre-destroy so user can still use the api in pre-destroy event and it is not marked as destroyed yet.\n this.destroyCalled = true;\n // destroy the UI first (as they use the services)\n var gridCtrl = this.ctrlsService.getGridCtrl();\n if (gridCtrl) {\n gridCtrl.destroyGridUi();\n }\n // destroy the services\n this.context.destroy();\n // some users were raising support issues with regards memory leaks. the problem was the customers applications\n // were keeping references to the API. trying to educate them all would be difficult, easier to just remove\n // all references in the API so at least the core grid can be garbage collected.\n removeAllReferences(this, ['isDestroyed'], preDestroyLink);\n };\n /** Returns `true` if the grid has been destroyed. */\n GridApi.prototype.isDestroyed = function () {\n return this.destroyCalled;\n };\n /** Reset the Quick Filter cache text on every rowNode. */\n GridApi.prototype.resetQuickFilter = function () {\n this.filterManager.resetQuickFilterCache();\n };\n /** Returns the list of selected cell ranges. */\n GridApi.prototype.getCellRanges = function () {\n if (this.rangeService) {\n return this.rangeService.getCellRanges();\n }\n ModuleRegistry.__assertRegistered(ModuleNames.RangeSelectionModule, 'api.getCellRanges', this.context.getGridId());\n return null;\n };\n /** Adds the provided cell range to the selected ranges. */\n GridApi.prototype.addCellRange = function (params) {\n if (this.rangeService) {\n this.rangeService.addCellRange(params);\n return;\n }\n ModuleRegistry.__assertRegistered(ModuleNames.RangeSelectionModule, 'api.addCellRange', this.context.getGridId());\n };\n /** Clears the selected ranges. */\n GridApi.prototype.clearRangeSelection = function () {\n if (this.rangeService) {\n this.rangeService.removeAllCellRanges();\n }\n ModuleRegistry.__assertRegistered(ModuleNames.RangeSelectionModule, 'gridApi.clearRangeSelection', this.context.getGridId());\n };\n /** Reverts the last cell edit. */\n GridApi.prototype.undoCellEditing = function () {\n this.undoRedoService.undo('api');\n };\n /** Re-applies the most recently undone cell edit. */\n GridApi.prototype.redoCellEditing = function () {\n this.undoRedoService.redo('api');\n };\n /** Returns current number of available cell edit undo operations. */\n GridApi.prototype.getCurrentUndoSize = function () {\n return this.undoRedoService.getCurrentUndoStackSize();\n };\n /** Returns current number of available cell edit redo operations. */\n GridApi.prototype.getCurrentRedoSize = function () {\n return this.undoRedoService.getCurrentRedoStackSize();\n };\n GridApi.prototype.assertChart = function (methodName, func) {\n if (ModuleRegistry.__assertRegistered(ModuleNames.GridChartsModule, 'api.' + methodName, this.context.getGridId())) {\n return this.frameworkOverrides.wrapIncoming(function () { return func(); });\n }\n };\n /** Returns a list of models with information about the charts that are currently rendered from the grid. */\n GridApi.prototype.getChartModels = function () {\n var _this = this;\n return this.assertChart('getChartModels', function () { return _this.chartService.getChartModels(); });\n };\n /** Returns the `ChartRef` using the supplied `chartId`. */\n GridApi.prototype.getChartRef = function (chartId) {\n var _this = this;\n return this.assertChart('getChartRef', function () { return _this.chartService.getChartRef(chartId); });\n };\n /** Returns a base64-encoded image data URL for the referenced chartId. */\n GridApi.prototype.getChartImageDataURL = function (params) {\n var _this = this;\n return this.assertChart('getChartImageDataURL', function () { return _this.chartService.getChartImageDataURL(params); });\n };\n /** Starts a browser-based image download for the referenced chartId. */\n GridApi.prototype.downloadChart = function (params) {\n var _this = this;\n return this.assertChart('downloadChart', function () { return _this.chartService.downloadChart(params); });\n };\n /** Open the Chart Tool Panel. */\n GridApi.prototype.openChartToolPanel = function (params) {\n var _this = this;\n return this.assertChart('openChartToolPanel', function () { return _this.chartService.openChartToolPanel(params); });\n };\n /** Close the Chart Tool Panel. */\n GridApi.prototype.closeChartToolPanel = function (params) {\n var _this = this;\n return this.assertChart('closeChartToolPanel', function () { return _this.chartService.closeChartToolPanel(params.chartId); });\n };\n /** Used to programmatically create charts from a range. */\n GridApi.prototype.createRangeChart = function (params) {\n var _this = this;\n return this.assertChart('createRangeChart', function () { return _this.chartService.createRangeChart(params); });\n };\n /** Used to programmatically create pivot charts from a grid. */\n GridApi.prototype.createPivotChart = function (params) {\n var _this = this;\n return this.assertChart('createPivotChart', function () { return _this.chartService.createPivotChart(params); });\n };\n /** Used to programmatically create cross filter charts from a range. */\n GridApi.prototype.createCrossFilterChart = function (params) {\n var _this = this;\n return this.assertChart('createCrossFilterChart', function () { return _this.chartService.createCrossFilterChart(params); });\n };\n /** Used to programmatically update a chart. */\n GridApi.prototype.updateChart = function (params) {\n var _this = this;\n return this.assertChart('updateChart', function () { return _this.chartService.updateChart(params); });\n };\n /** Restores a chart using the `ChartModel` that was previously obtained from `getChartModels()`. */\n GridApi.prototype.restoreChart = function (chartModel, chartContainer) {\n var _this = this;\n return this.assertChart('restoreChart', function () { return _this.chartService.restoreChart(chartModel, chartContainer); });\n };\n GridApi.prototype.assertClipboard = function (methodName, func) {\n if (ModuleRegistry.__assertRegistered(ModuleNames.ClipboardModule, 'api' + methodName, this.context.getGridId())) {\n func();\n }\n };\n /** Copies data to clipboard by following the same rules as pressing Ctrl+C. */\n GridApi.prototype.copyToClipboard = function (params) {\n var _this = this;\n this.assertClipboard('copyToClipboard', function () { return _this.clipboardService.copyToClipboard(params); });\n };\n /** Cuts data to clipboard by following the same rules as pressing Ctrl+X. */\n GridApi.prototype.cutToClipboard = function (params) {\n var _this = this;\n this.assertClipboard('cutToClipboard', function () { return _this.clipboardService.cutToClipboard(params); });\n };\n /** Copies the selected rows to the clipboard. */\n GridApi.prototype.copySelectedRowsToClipboard = function (params) {\n var _this = this;\n this.assertClipboard('copySelectedRowsToClipboard', function () { return _this.clipboardService.copySelectedRowsToClipboard(params); });\n };\n /** Copies the selected ranges to the clipboard. */\n GridApi.prototype.copySelectedRangeToClipboard = function (params) {\n var _this = this;\n this.assertClipboard('copySelectedRangeToClipboard', function () { return _this.clipboardService.copySelectedRangeToClipboard(params); });\n };\n /** Copies the selected range down, similar to `Ctrl + D` in Excel. */\n GridApi.prototype.copySelectedRangeDown = function () {\n var _this = this;\n this.assertClipboard('copySelectedRangeDown', function () { return _this.clipboardService.copyRangeDown(); });\n };\n /** Pastes the data from the Clipboard into the focused cell of the grid. If no grid cell is focused, calling this method has no effect. */\n GridApi.prototype.pasteFromClipboard = function () {\n var _this = this;\n this.assertClipboard('pasteFromClipboard', function () { return _this.clipboardService.pasteFromClipboard(); });\n };\n /** @deprecated v31.1 Use `IHeaderParams.showColumnMenu` within a header component, or `api.showColumnMenu` elsewhere. */\n GridApi.prototype.showColumnMenuAfterButtonClick = function (colKey, buttonElement) {\n warnOnce(\"'showColumnMenuAfterButtonClick' is deprecated. Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere.\");\n // use grid column so works with pivot mode\n var column = this.columnModel.getGridColumn(colKey);\n this.menuService.showColumnMenu({\n column: column,\n buttonElement: buttonElement,\n positionBy: 'button'\n });\n };\n /** @deprecated v31.1 Use `IHeaderParams.showColumnMenuAfterMouseClick` within a header component, or `api.showColumnMenu` elsewhere. */\n GridApi.prototype.showColumnMenuAfterMouseClick = function (colKey, mouseEvent) {\n warnOnce(\"'showColumnMenuAfterMouseClick' is deprecated. Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere.\");\n // use grid column so works with pivot mode\n var column = this.columnModel.getGridColumn(colKey);\n if (!column) {\n column = this.columnModel.getPrimaryColumn(colKey);\n }\n if (!column) {\n console.error(\"AG Grid: column '\".concat(colKey, \"' not found\"));\n return;\n }\n this.menuService.showColumnMenu({\n column: column,\n mouseEvent: mouseEvent,\n positionBy: 'mouse'\n });\n };\n /** Show the column chooser. */\n GridApi.prototype.showColumnChooser = function (params) {\n this.menuService.showColumnChooser({ chooserParams: params });\n };\n /** Show the filter for the provided column. */\n GridApi.prototype.showColumnFilter = function (colKey) {\n var column = this.columnModel.getGridColumn(colKey);\n if (!column) {\n console.error(\"AG Grid: column '\".concat(colKey, \"' not found\"));\n return;\n }\n this.menuService.showFilterMenu({\n column: column,\n containerType: 'columnFilter',\n positionBy: 'auto'\n });\n };\n /** Show the column menu for the provided column. */\n GridApi.prototype.showColumnMenu = function (colKey) {\n var column = this.columnModel.getGridColumn(colKey);\n if (!column) {\n console.error(\"AG Grid: column '\".concat(colKey, \"' not found\"));\n return;\n }\n this.menuService.showColumnMenu({\n column: column,\n positionBy: 'auto'\n });\n };\n /** Hides any visible context menu or column menu. */\n GridApi.prototype.hidePopupMenu = function () {\n this.menuService.hidePopupMenu();\n };\n /** Hide the column chooser if visible. */\n GridApi.prototype.hideColumnChooser = function () {\n this.menuService.hideColumnChooser();\n };\n /** Navigates the grid focus to the next cell, as if tabbing. */\n GridApi.prototype.tabToNextCell = function (event) {\n return this.navigationService.tabToNextCell(false, event);\n };\n /** Navigates the grid focus to the previous cell, as if shift-tabbing. */\n GridApi.prototype.tabToPreviousCell = function (event) {\n return this.navigationService.tabToNextCell(true, event);\n };\n /** Returns the list of active cell renderer instances. */\n GridApi.prototype.getCellRendererInstances = function (params) {\n if (params === void 0) { params = {}; }\n var res = this.rowRenderer.getCellRendererInstances(params);\n var unwrapped = res.map(unwrapUserComp);\n return unwrapped;\n };\n /** Returns the list of active cell editor instances. Optionally provide parameters to restrict to certain columns / row nodes. */\n GridApi.prototype.getCellEditorInstances = function (params) {\n if (params === void 0) { params = {}; }\n var res = this.rowRenderer.getCellEditorInstances(params);\n var unwrapped = res.map(unwrapUserComp);\n return unwrapped;\n };\n /** If the grid is editing, returns back details of the editing cell(s). */\n GridApi.prototype.getEditingCells = function () {\n return this.rowRenderer.getEditingCells();\n };\n /** If a cell is editing, it stops the editing. Pass `true` if you want to cancel the editing (i.e. don't accept changes). */\n GridApi.prototype.stopEditing = function (cancel) {\n if (cancel === void 0) { cancel = false; }\n this.rowRenderer.stopEditing(cancel);\n };\n /** Start editing the provided cell. If another cell is editing, the editing will be stopped in that other cell. */\n GridApi.prototype.startEditingCell = function (params) {\n var column = this.columnModel.getGridColumn(params.colKey);\n if (!column) {\n console.warn(\"AG Grid: no column found for \".concat(params.colKey));\n return;\n }\n var cellPosition = {\n rowIndex: params.rowIndex,\n rowPinned: params.rowPinned || null,\n column: column\n };\n var notPinned = params.rowPinned == null;\n if (notPinned) {\n this.ensureIndexVisible(params.rowIndex);\n }\n this.ensureColumnVisible(params.colKey);\n var cell = this.navigationService.getCellByPosition(cellPosition);\n if (!cell) {\n return;\n }\n if (!this.focusService.isCellFocused(cellPosition)) {\n this.focusService.setFocusedCell(cellPosition);\n }\n cell.startRowOrCellEdit(params.key);\n };\n /** @deprecated v31.1 addAggFunc(key, func) is deprecated, please use addAggFuncs({ key: func }) instead. */\n GridApi.prototype.addAggFunc = function (key, aggFunc) {\n this.logDeprecation('v31.1', 'addAggFunc(key, func)', 'addAggFuncs({ key: func })');\n if (this.aggFuncService) {\n this.aggFuncService.addAggFuncs({ key: aggFunc });\n }\n };\n /** Add aggregations function with the specified keys. */\n GridApi.prototype.addAggFuncs = function (aggFuncs) {\n if (this.aggFuncService) {\n this.aggFuncService.addAggFuncs(aggFuncs);\n }\n };\n /** Clears all aggregation functions (including those provided by the grid). */\n GridApi.prototype.clearAggFuncs = function () {\n if (this.aggFuncService) {\n this.aggFuncService.clear();\n }\n };\n /** Apply transactions to the server side row model. */\n GridApi.prototype.applyServerSideTransaction = function (transaction) {\n if (!this.serverSideTransactionManager) {\n this.logMissingRowModel('applyServerSideTransaction', 'serverSide');\n return;\n }\n return this.serverSideTransactionManager.applyTransaction(transaction);\n };\n /** Batch apply transactions to the server side row model. */\n GridApi.prototype.applyServerSideTransactionAsync = function (transaction, callback) {\n if (!this.serverSideTransactionManager) {\n this.logMissingRowModel('applyServerSideTransactionAsync', 'serverSide');\n return;\n }\n return this.serverSideTransactionManager.applyTransactionAsync(transaction, callback);\n };\n /**\n * Applies row data to a server side store.\n * New rows will overwrite rows at the same index in the same way as if provided by a datasource success callback.\n */\n GridApi.prototype.applyServerSideRowData = function (params) {\n var _a, _b;\n var startRow = (_a = params.startRow) !== null && _a !== void 0 ? _a : 0;\n var route = (_b = params.route) !== null && _b !== void 0 ? _b : [];\n if (startRow < 0) {\n console.warn(\"AG Grid: invalid value \".concat(params.startRow, \" for startRow, the value should be >= 0\"));\n return;\n }\n if (this.serverSideRowModel) {\n this.serverSideRowModel.applyRowData(params.successParams, startRow, route);\n }\n else {\n this.logMissingRowModel('setServerSideDatasource', 'serverSide');\n }\n };\n /** Gets all failed server side loads to retry. */\n GridApi.prototype.retryServerSideLoads = function () {\n if (!this.serverSideRowModel) {\n this.logMissingRowModel('retryServerSideLoads', 'serverSide');\n return;\n }\n this.serverSideRowModel.retryLoads();\n };\n GridApi.prototype.flushServerSideAsyncTransactions = function () {\n if (!this.serverSideTransactionManager) {\n this.logMissingRowModel('flushServerSideAsyncTransactions', 'serverSide');\n return;\n }\n return this.serverSideTransactionManager.flushAsyncTransactions();\n };\n /** Update row data. Pass a transaction object with lists for `add`, `remove` and `update`. */\n GridApi.prototype.applyTransaction = function (rowDataTransaction) {\n var _this = this;\n if (!this.clientSideRowModel) {\n this.logMissingRowModel('applyTransaction', 'clientSide');\n return;\n }\n return this.frameworkOverrides.wrapIncoming(function () { return _this.clientSideRowModel.updateRowData(rowDataTransaction); });\n };\n /** Same as `applyTransaction` except executes asynchronously for efficiency. */\n GridApi.prototype.applyTransactionAsync = function (rowDataTransaction, callback) {\n var _this = this;\n if (!this.clientSideRowModel) {\n this.logMissingRowModel('applyTransactionAsync', 'clientSide');\n return;\n }\n this.frameworkOverrides.wrapIncoming(function () { return _this.clientSideRowModel.batchUpdateRowData(rowDataTransaction, callback); });\n };\n /** Executes any remaining asynchronous grid transactions, if any are waiting to be executed. */\n GridApi.prototype.flushAsyncTransactions = function () {\n var _this = this;\n if (!this.clientSideRowModel) {\n this.logMissingRowModel('flushAsyncTransactions', 'clientSide');\n return;\n }\n this.frameworkOverrides.wrapIncoming(function () { return _this.clientSideRowModel.flushAsyncTransactions(); });\n };\n /**\n * Marks all the currently loaded blocks in the cache for reload.\n * If you have 10 blocks in the cache, all 10 will be marked for reload.\n * The old data will continue to be displayed until the new data is loaded.\n */\n GridApi.prototype.refreshInfiniteCache = function () {\n if (this.infiniteRowModel) {\n this.infiniteRowModel.refreshCache();\n }\n else {\n this.logMissingRowModel('refreshInfiniteCache', 'infinite');\n }\n };\n /**\n * Purges the cache.\n * The grid is then told to refresh. Only the blocks required to display the current data on screen are fetched (typically no more than 2).\n * The grid will display nothing while the new blocks are loaded.\n * Use this to immediately remove the old data from the user.\n */\n GridApi.prototype.purgeInfiniteCache = function () {\n if (this.infiniteRowModel) {\n this.infiniteRowModel.purgeCache();\n }\n else {\n this.logMissingRowModel('purgeInfiniteCache', 'infinite');\n }\n };\n /**\n * Refresh a server-side store level.\n * If you pass no parameters, then the top level store is refreshed.\n * To refresh a child level, pass in the string of keys to get to the desired level.\n * Once the store refresh is complete, the storeRefreshed event is fired.\n */\n GridApi.prototype.refreshServerSide = function (params) {\n if (!this.serverSideRowModel) {\n this.logMissingRowModel('refreshServerSide', 'serverSide');\n return;\n }\n this.serverSideRowModel.refreshStore(params);\n };\n /** Returns info on all server side group levels. */\n GridApi.prototype.getServerSideGroupLevelState = function () {\n if (!this.serverSideRowModel) {\n this.logMissingRowModel('getServerSideGroupLevelState', 'serverSide');\n return [];\n }\n return this.serverSideRowModel.getStoreState();\n };\n /** The row count defines how many rows the grid allows scrolling to. */\n GridApi.prototype.getInfiniteRowCount = function () {\n if (this.infiniteRowModel) {\n return this.infiniteRowModel.getRowCount();\n }\n else {\n this.logMissingRowModel('getInfiniteRowCount', 'infinite');\n }\n };\n /** Returns `true` if grid allows for scrolling past the last row to load more rows, thus providing infinite scroll. */\n GridApi.prototype.isLastRowIndexKnown = function () {\n if (this.infiniteRowModel) {\n return this.infiniteRowModel.isLastRowIndexKnown();\n }\n else {\n this.logMissingRowModel('isLastRowIndexKnown', 'infinite');\n }\n };\n /**\n * Returns an object representing the state of the cache. This is useful for debugging and understanding how the cache is working.\n */\n GridApi.prototype.getCacheBlockState = function () {\n return this.rowNodeBlockLoader.getBlockState();\n };\n /** @deprecated v31.1 `getFirstDisplayedRow` is deprecated. Please use `getFirstDisplayedRowIndex` instead. */\n GridApi.prototype.getFirstDisplayedRow = function () {\n this.logDeprecation('v31.1', 'getFirstDisplayedRow', 'getFirstDisplayedRowIndex');\n return this.getFirstDisplayedRowIndex();\n };\n /** Get the index of the first displayed row due to scrolling (includes invisible rendered rows in the buffer). */\n GridApi.prototype.getFirstDisplayedRowIndex = function () {\n return this.rowRenderer.getFirstVirtualRenderedRow();\n };\n /** @deprecated v31.1 `getLastDisplayedRow` is deprecated. Please use `getLastDisplayedRowIndex` instead. */\n GridApi.prototype.getLastDisplayedRow = function () {\n this.logDeprecation('v31.1', 'getLastDisplayedRow', 'getLastDisplayedRowIndex');\n return this.getLastDisplayedRowIndex();\n };\n /** Get the index of the last displayed row due to scrolling (includes invisible rendered rows in the buffer). */\n GridApi.prototype.getLastDisplayedRowIndex = function () {\n return this.rowRenderer.getLastVirtualRenderedRow();\n };\n /** Returns the displayed `RowNode` at the given `index`. */\n GridApi.prototype.getDisplayedRowAtIndex = function (index) {\n return this.rowModel.getRow(index);\n };\n /** Returns the total number of displayed rows. */\n GridApi.prototype.getDisplayedRowCount = function () {\n return this.rowModel.getRowCount();\n };\n /**\n * Returns `true` when the last page is known.\n * This will always be `true` if you are using the Client-Side Row Model for pagination.\n * Returns `false` when the last page is not known; this only happens when using Infinite Row Model.\n */\n GridApi.prototype.paginationIsLastPageFound = function () {\n return this.paginationProxy.isLastPageFound();\n };\n /** Returns how many rows are being shown per page. */\n GridApi.prototype.paginationGetPageSize = function () {\n return this.paginationProxy.getPageSize();\n };\n /** Returns the 0-based index of the page which is showing. */\n GridApi.prototype.paginationGetCurrentPage = function () {\n return this.paginationProxy.getCurrentPage();\n };\n /** Returns the total number of pages. Returns `null` if `paginationIsLastPageFound() === false`. */\n GridApi.prototype.paginationGetTotalPages = function () {\n return this.paginationProxy.getTotalPages();\n };\n /** The total number of rows. Returns `null` if `paginationIsLastPageFound() === false`. */\n GridApi.prototype.paginationGetRowCount = function () {\n return this.paginationProxy.getMasterRowCount();\n };\n /** Navigates to the next page. */\n GridApi.prototype.paginationGoToNextPage = function () {\n this.paginationProxy.goToNextPage();\n };\n /** Navigates to the previous page. */\n GridApi.prototype.paginationGoToPreviousPage = function () {\n this.paginationProxy.goToPreviousPage();\n };\n /** Navigates to the first page. */\n GridApi.prototype.paginationGoToFirstPage = function () {\n this.paginationProxy.goToFirstPage();\n };\n /** Navigates to the last page. */\n GridApi.prototype.paginationGoToLastPage = function () {\n this.paginationProxy.goToLastPage();\n };\n /** Goes to the specified page. If the page requested doesn't exist, it will go to the last page. */\n GridApi.prototype.paginationGoToPage = function (page) {\n this.paginationProxy.goToPage(page);\n };\n // Methods migrated from old ColumnApi\n /**\n * Adjusts the size of columns to fit the available horizontal space.\n *\n * Note: it is not recommended to call this method rapidly e.g. in response\n * to window resize events or as the container size is animated. This can\n * cause the scrollbar to flicker. Use column flex for smoother results.\n *\n * If inferring cell data types with custom column types\n * and row data is provided asynchronously, the column sizing will happen asynchronously when row data is added.\n * To always perform this synchronously, set `cellDataType = false` on the default column definition.\n **/\n GridApi.prototype.sizeColumnsToFit = function (paramsOrGridWidth) {\n if (typeof paramsOrGridWidth === 'number') {\n this.columnModel.sizeColumnsToFit(paramsOrGridWidth, 'api');\n }\n else {\n this.gridBodyCtrl.sizeColumnsToFit(paramsOrGridWidth);\n }\n };\n /** Call this if you want to open or close a column group. */\n GridApi.prototype.setColumnGroupOpened = function (group, newValue) { this.columnModel.setColumnGroupOpened(group, newValue, 'api'); };\n /** Returns the column group with the given name. */\n GridApi.prototype.getColumnGroup = function (name, instanceId) { return this.columnModel.getColumnGroup(name, instanceId); };\n /** Returns the provided column group with the given name. */\n GridApi.prototype.getProvidedColumnGroup = function (name) { return this.columnModel.getProvidedColumnGroup(name); };\n /** Returns the display name for a column. Useful if you are doing your own header rendering and want the grid to work out if `headerValueGetter` is used, or if you are doing your own column management GUI, to know what to show as the column name. */\n GridApi.prototype.getDisplayNameForColumn = function (column, location) { return this.columnModel.getDisplayNameForColumn(column, location) || ''; };\n /** Returns the display name for a column group (when grouping columns). */\n GridApi.prototype.getDisplayNameForColumnGroup = function (columnGroup, location) { return this.columnModel.getDisplayNameForColumnGroup(columnGroup, location) || ''; };\n /** Returns the column with the given `colKey`, which can either be the `colId` (a string) or the `colDef` (an object). */\n GridApi.prototype.getColumn = function (key) { return this.columnModel.getPrimaryColumn(key); };\n /** Returns all the columns, regardless of visible or not. */\n GridApi.prototype.getColumns = function () { return this.columnModel.getAllPrimaryColumns(); };\n /** Applies the state of the columns from a previous state. Returns `false` if one or more columns could not be found. */\n GridApi.prototype.applyColumnState = function (params) { return this.columnModel.applyColumnState(params, 'api'); };\n /** Gets the state of the columns. Typically used when saving column state. */\n GridApi.prototype.getColumnState = function () { return this.columnModel.getColumnState(); };\n /** Sets the state back to match the originally provided column definitions. */\n GridApi.prototype.resetColumnState = function () { this.columnModel.resetColumnState('api'); };\n /** Gets the state of the column groups. Typically used when saving column group state. */\n GridApi.prototype.getColumnGroupState = function () { return this.columnModel.getColumnGroupState(); };\n /** Sets the state of the column group state from a previous state. */\n GridApi.prototype.setColumnGroupState = function (stateItems) { this.columnModel.setColumnGroupState(stateItems, 'api'); };\n /** Sets the state back to match the originally provided column definitions. */\n GridApi.prototype.resetColumnGroupState = function () { this.columnModel.resetColumnGroupState('api'); };\n /** Returns `true` if pinning left or right, otherwise `false`. */\n GridApi.prototype.isPinning = function () { return this.columnModel.isPinningLeft() || this.columnModel.isPinningRight(); };\n /** Returns `true` if pinning left, otherwise `false`. */\n GridApi.prototype.isPinningLeft = function () { return this.columnModel.isPinningLeft(); };\n /** Returns `true` if pinning right, otherwise `false`. */\n GridApi.prototype.isPinningRight = function () { return this.columnModel.isPinningRight(); };\n /** Returns the column to the right of the provided column, taking into consideration open / closed column groups and visible columns. This is useful if you need to know what column is beside yours e.g. if implementing your own cell navigation. */\n GridApi.prototype.getDisplayedColAfter = function (col) { return this.columnModel.getDisplayedColAfter(col); };\n /** Same as `getVisibleColAfter` except gives column to the left. */\n GridApi.prototype.getDisplayedColBefore = function (col) { return this.columnModel.getDisplayedColBefore(col); };\n /** @deprecated v31.1 setColumnVisible(key, visible) deprecated, please use setColumnsVisible([key], visible) instead. */\n GridApi.prototype.setColumnVisible = function (key, visible) {\n this.logDeprecation('v31.1', 'setColumnVisible(key,visible)', 'setColumnsVisible([key],visible)');\n this.columnModel.setColumnsVisible([key], visible, 'api');\n };\n /** Sets the visibility of columns. Key can be the column ID or `Column` object. */\n GridApi.prototype.setColumnsVisible = function (keys, visible) { this.columnModel.setColumnsVisible(keys, visible, 'api'); };\n /** @deprecated v31.1 setColumnPinned(key, pinned) deprecated, please use setColumnsPinned([key], pinned) instead. */\n GridApi.prototype.setColumnPinned = function (key, pinned) {\n this.logDeprecation('v31.1', 'setColumnPinned(key,pinned)', 'setColumnsPinned([key],pinned)');\n this.columnModel.setColumnsPinned([key], pinned, 'api');\n };\n /** Set a column's pinned / unpinned state. Key can be the column ID, field, `ColDef` object or `Column` object. */\n GridApi.prototype.setColumnsPinned = function (keys, pinned) { this.columnModel.setColumnsPinned(keys, pinned, 'api'); };\n /**\n * Returns all the grid columns, same as `getColumns()`, except\n *\n * a) it has the order of the columns that are presented in the grid\n *\n * b) it's after the 'pivot' step, so if pivoting, has the value columns for the pivot.\n */\n GridApi.prototype.getAllGridColumns = function () { return this.columnModel.getAllGridColumns(); };\n /** Same as `getAllDisplayedColumns` but just for the pinned left portion of the grid. */\n GridApi.prototype.getDisplayedLeftColumns = function () { return this.columnModel.getDisplayedLeftColumns(); };\n /** Same as `getAllDisplayedColumns` but just for the center portion of the grid. */\n GridApi.prototype.getDisplayedCenterColumns = function () { return this.columnModel.getDisplayedCenterColumns(); };\n /** Same as `getAllDisplayedColumns` but just for the pinned right portion of the grid. */\n GridApi.prototype.getDisplayedRightColumns = function () { return this.columnModel.getDisplayedRightColumns(); };\n /** Returns all columns currently displayed (e.g. are visible and if in a group, the group is showing the columns) for the pinned left, centre and pinned right portions of the grid. */\n GridApi.prototype.getAllDisplayedColumns = function () { return this.columnModel.getAllDisplayedColumns(); };\n /** Same as `getAllGridColumns()`, except only returns rendered columns, i.e. columns that are not within the viewport and therefore not rendered, due to column virtualisation, are not displayed. */\n GridApi.prototype.getAllDisplayedVirtualColumns = function () { return this.columnModel.getViewportColumns(); };\n /** @deprecated v31.1 moveColumn(key, toIndex) deprecated, please use moveColumns([key], toIndex) instead. */\n GridApi.prototype.moveColumn = function (key, toIndex) {\n this.logDeprecation('v31.1', 'moveColumn(key, toIndex)', 'moveColumns([key], toIndex)');\n this.columnModel.moveColumns([key], toIndex, 'api');\n };\n /** Moves the column at `fromIdex` to `toIndex`. The column is first removed, then added at the `toIndex` location, thus index locations will change to the right of the column after the removal. */\n GridApi.prototype.moveColumnByIndex = function (fromIndex, toIndex) { this.columnModel.moveColumnByIndex(fromIndex, toIndex, 'api'); };\n /** Moves columns to `toIndex`. The columns are first removed, then added at the `toIndex` location, thus index locations will change to the right of the column after the removal. */\n GridApi.prototype.moveColumns = function (columnsToMoveKeys, toIndex) { this.columnModel.moveColumns(columnsToMoveKeys, toIndex, 'api'); };\n /** Move the column to a new position in the row grouping order. */\n GridApi.prototype.moveRowGroupColumn = function (fromIndex, toIndex) { this.columnModel.moveRowGroupColumn(fromIndex, toIndex, 'api'); };\n /** Sets the agg function for a column. `aggFunc` can be one of the built-in aggregations or a custom aggregation by name or direct function. */\n GridApi.prototype.setColumnAggFunc = function (key, aggFunc) { this.columnModel.setColumnAggFunc(key, aggFunc, 'api'); };\n /** @deprecated v31.1 setColumnWidths(key, newWidth) deprecated, please use setColumnWidths( [{key: newWidth}] ) instead. */\n GridApi.prototype.setColumnWidth = function (key, newWidth, finished, source) {\n if (finished === void 0) { finished = true; }\n if (source === void 0) { source = 'api'; }\n this.logDeprecation('v31.1', 'setColumnWidth(col, width)', 'setColumnWidths([{key: col, newWidth: width}])');\n this.columnModel.setColumnWidths([{ key: key, newWidth: newWidth }], false, finished, source);\n };\n /** Sets the column widths of the columns provided. The finished flag gets included in the resulting event and not used internally by the grid. The finished flag is intended for dragging, where a dragging action will produce many `columnWidth` events, so the consumer of events knows when it receives the last event in a stream. The finished parameter is optional, and defaults to `true`. */\n GridApi.prototype.setColumnWidths = function (columnWidths, finished, source) {\n if (finished === void 0) { finished = true; }\n if (source === void 0) { source = 'api'; }\n this.columnModel.setColumnWidths(columnWidths, false, finished, source);\n };\n /** Get the pivot mode. */\n GridApi.prototype.isPivotMode = function () { return this.columnModel.isPivotMode(); };\n /** Returns the pivot result column for the given `pivotKeys` and `valueColId`. Useful to then call operations on the pivot column. */\n GridApi.prototype.getPivotResultColumn = function (pivotKeys, valueColKey) { return this.columnModel.getSecondaryPivotColumn(pivotKeys, valueColKey); };\n /** Set the value columns to the provided list of columns. */\n GridApi.prototype.setValueColumns = function (colKeys) { this.columnModel.setValueColumns(colKeys, 'api'); };\n /** Get a list of the existing value columns. */\n GridApi.prototype.getValueColumns = function () { return this.columnModel.getValueColumns(); };\n /** @deprecated v31.1 removeValueColumn(colKey) deprecated, please use removeValueColumns([colKey]) instead. */\n GridApi.prototype.removeValueColumn = function (colKey) {\n this.logDeprecation('v31.1', 'removeValueColumn(colKey)', 'removeValueColumns([colKey])');\n this.columnModel.removeValueColumns([colKey], 'api');\n };\n /** Remove the given list of columns from the existing set of value columns. */\n GridApi.prototype.removeValueColumns = function (colKeys) { this.columnModel.removeValueColumns(colKeys, 'api'); };\n /** @deprecated v31.1 addValueColumn(colKey) deprecated, please use addValueColumns([colKey]) instead. */\n GridApi.prototype.addValueColumn = function (colKey) {\n this.logDeprecation('v31.1', 'addValueColumn(colKey)', 'addValueColumns([colKey])');\n this.columnModel.addValueColumns([colKey], 'api');\n };\n /** Add the given list of columns to the existing set of value columns. */\n GridApi.prototype.addValueColumns = function (colKeys) { this.columnModel.addValueColumns(colKeys, 'api'); };\n /** Set the row group columns. */\n GridApi.prototype.setRowGroupColumns = function (colKeys) { this.columnModel.setRowGroupColumns(colKeys, 'api'); };\n /** @deprecated v31.1 removeRowGroupColumn(colKey) deprecated, please use removeRowGroupColumns([colKey]) instead. */\n GridApi.prototype.removeRowGroupColumn = function (colKey) {\n this.logDeprecation('v31.1', 'removeRowGroupColumn(colKey)', 'removeRowGroupColumns([colKey])');\n this.columnModel.removeRowGroupColumns([colKey], 'api');\n };\n /** Remove columns from the row groups. */\n GridApi.prototype.removeRowGroupColumns = function (colKeys) { this.columnModel.removeRowGroupColumns(colKeys, 'api'); };\n /** @deprecated v31.1 addRowGroupColumn(colKey) deprecated, please use addRowGroupColumns([colKey]) instead. */\n GridApi.prototype.addRowGroupColumn = function (colKey) {\n this.logDeprecation('v31.1', 'addRowGroupColumn(colKey)', 'addRowGroupColumns([colKey])');\n this.columnModel.addRowGroupColumns([colKey], 'api');\n };\n /** Add columns to the row groups. */\n GridApi.prototype.addRowGroupColumns = function (colKeys) { this.columnModel.addRowGroupColumns(colKeys, 'api'); };\n /** Get row group columns. */\n GridApi.prototype.getRowGroupColumns = function () { return this.columnModel.getRowGroupColumns(); };\n /** Set the pivot columns. */\n GridApi.prototype.setPivotColumns = function (colKeys) { this.columnModel.setPivotColumns(colKeys, 'api'); };\n /** @deprecated v31.1 removePivotColumn(colKey) deprecated, please use removePivotColumns([colKey]) instead. */\n GridApi.prototype.removePivotColumn = function (colKey) {\n this.logDeprecation('v31.1', 'removePivotColumn(colKey)', 'removePivotColumns([colKey])');\n this.columnModel.removePivotColumns([colKey], 'api');\n };\n /** Remove pivot columns. */\n GridApi.prototype.removePivotColumns = function (colKeys) { this.columnModel.removePivotColumns(colKeys, 'api'); };\n /** @deprecated v31.1 addPivotColumn(colKey) deprecated, please use addPivotColumns([colKey]) instead. */\n GridApi.prototype.addPivotColumn = function (colKey) {\n this.logDeprecation('v31.1', 'addPivotColumn(colKey)', 'addPivotColumns([colKey])');\n this.columnModel.addPivotColumns([colKey], 'api');\n };\n /** Add pivot columns. */\n GridApi.prototype.addPivotColumns = function (colKeys) { this.columnModel.addPivotColumns(colKeys, 'api'); };\n /** Get the pivot columns. */\n GridApi.prototype.getPivotColumns = function () { return this.columnModel.getPivotColumns(); };\n /** Same as `getAllDisplayedColumnGroups` but just for the pinned left portion of the grid. */\n GridApi.prototype.getLeftDisplayedColumnGroups = function () { return this.columnModel.getDisplayedTreeLeft(); };\n /** Same as `getAllDisplayedColumnGroups` but just for the center portion of the grid. */\n GridApi.prototype.getCenterDisplayedColumnGroups = function () { return this.columnModel.getDisplayedTreeCentre(); };\n /** Same as `getAllDisplayedColumnGroups` but just for the pinned right portion of the grid. */\n GridApi.prototype.getRightDisplayedColumnGroups = function () { return this.columnModel.getDisplayedTreeRight(); };\n /** Returns all 'root' column headers. If you are not grouping columns, these return the columns. If you are grouping, these return the top level groups - you can navigate down through each one to get the other lower level headers and finally the columns at the bottom. */\n GridApi.prototype.getAllDisplayedColumnGroups = function () { return this.columnModel.getAllDisplayedTrees(); };\n /** @deprecated v31.1 autoSizeColumn(key) deprecated, please use autoSizeColumns([colKey]) instead. */\n GridApi.prototype.autoSizeColumn = function (key, skipHeader) {\n this.logDeprecation('v31.1', 'autoSizeColumn(key, skipHeader)', 'autoSizeColumns([key], skipHeader)');\n return this.columnModel.autoSizeColumns({ columns: [key], skipHeader: skipHeader, source: 'api' });\n };\n /**\n * Auto-sizes columns based on their contents. If inferring cell data types with custom column types\n * and row data is provided asynchronously, the column sizing will happen asynchronously when row data is added.\n * To always perform this synchronously, set `cellDataType = false` on the default column definition.\n */\n GridApi.prototype.autoSizeColumns = function (keys, skipHeader) {\n this.columnModel.autoSizeColumns({ columns: keys, skipHeader: skipHeader, source: 'api' });\n };\n /**\n * Calls `autoSizeColumns` on all displayed columns. If inferring cell data types with custom column types\n * and row data is provided asynchronously, the column sizing will happen asynchronously when row data is added.\n * To always perform this synchronously, set `cellDataType = false` on the default column definition.\n */\n GridApi.prototype.autoSizeAllColumns = function (skipHeader) { this.columnModel.autoSizeAllColumns('api', skipHeader); };\n /** Set the pivot result columns. */\n GridApi.prototype.setPivotResultColumns = function (colDefs) { this.columnModel.setSecondaryColumns(colDefs, 'api'); };\n /** Returns the grid's pivot result columns. */\n GridApi.prototype.getPivotResultColumns = function () { return this.columnModel.getSecondaryColumns(); };\n /** Get the current state of the grid. Can be used in conjunction with the `initialState` grid option to save and restore grid state. */\n GridApi.prototype.getState = function () {\n return this.stateService.getState();\n };\n /**\n * Returns the grid option value for a provided key.\n */\n GridApi.prototype.getGridOption = function (key) {\n return this.gos.get(key);\n };\n /**\n * Updates a single gridOption to the new value provided. (Cannot be used on `Initial` properties.)\n * If updating multiple options, it is recommended to instead use `api.updateGridOptions()` which batches update logic.\n */\n GridApi.prototype.setGridOption = function (key, value) {\n var _a;\n this.updateGridOptions((_a = {}, _a[key] = value, _a));\n };\n /**\n * Updates the provided subset of gridOptions with the provided values. (Cannot be used on `Initial` properties.)\n */\n GridApi.prototype.updateGridOptions = function (options) {\n // NOTE: The TDataUpdate generic is used to ensure that the update options match the generic passed into the GridApi above as TData.\n // This is required because if we just use TData directly then Typescript will get into an infinite loop due to callbacks which recursively include the GridApi.\n this.gos.updateGridOptions({ options: options });\n };\n /** Used internally by grid. Not intended to be used by the client. Interface may change between releases. */\n GridApi.prototype.__internalUpdateGridOptions = function (options) {\n this.gos.updateGridOptions({ options: options, source: 'gridOptionsUpdated' });\n };\n GridApi.prototype.deprecatedUpdateGridOption = function (key, value) {\n warnOnce(\"set\".concat(key.charAt(0).toUpperCase()).concat(key.slice(1, key.length), \" is deprecated. Please use 'api.setGridOption('\").concat(key, \"', newValue)' or 'api.updateGridOptions({ \").concat(key, \": newValue })' instead.\"));\n this.setGridOption(key, value);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Set the top pinned rows. Call with no rows / undefined to clear top pinned rows.\n **/\n GridApi.prototype.setPivotMode = function (pivotMode) {\n this.deprecatedUpdateGridOption('pivotMode', pivotMode);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Set the top pinned rows. Call with no rows / undefined to clear top pinned rows.\n **/\n GridApi.prototype.setPinnedTopRowData = function (rows) {\n this.deprecatedUpdateGridOption('pinnedTopRowData', rows);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Set the bottom pinned rows. Call with no rows / undefined to clear bottom pinned rows.\n * */\n GridApi.prototype.setPinnedBottomRowData = function (rows) {\n this.deprecatedUpdateGridOption('pinnedBottomRowData', rows);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * DOM element to use as the popup parent for grid popups (context menu, column menu etc).\n * */\n GridApi.prototype.setPopupParent = function (ePopupParent) {\n this.deprecatedUpdateGridOption('popupParent', ePopupParent);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n */\n GridApi.prototype.setSuppressModelUpdateAfterUpdateTransaction = function (value) {\n this.deprecatedUpdateGridOption('suppressModelUpdateAfterUpdateTransaction', value);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Resets the data type definitions. This will update the columns in the grid.\n * */\n GridApi.prototype.setDataTypeDefinitions = function (dataTypeDefinitions) {\n this.deprecatedUpdateGridOption('dataTypeDefinitions', dataTypeDefinitions);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Set whether the grid paginates the data or not.\n * - `true` to enable pagination\n * - `false` to disable pagination\n */\n GridApi.prototype.setPagination = function (value) {\n this.deprecatedUpdateGridOption('pagination', value);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Sets the `paginationPageSize`, then re-paginates the grid so the changes are applied immediately.\n * */\n GridApi.prototype.paginationSetPageSize = function (size) {\n this.deprecatedUpdateGridOption('paginationPageSize', size);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Resets the side bar to the provided configuration. The parameter is the same as the sideBar grid property. The side bar is re-created from scratch with the new config.\n * */\n GridApi.prototype.setSideBar = function (def) {\n this.deprecatedUpdateGridOption('sideBar', def);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n */\n GridApi.prototype.setSuppressClipboardPaste = function (value) {\n this.deprecatedUpdateGridOption('suppressClipboardPaste', value);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n */\n GridApi.prototype.setGroupRemoveSingleChildren = function (value) {\n this.deprecatedUpdateGridOption('groupRemoveSingleChildren', value);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n */\n GridApi.prototype.setGroupRemoveLowestSingleChildren = function (value) {\n this.deprecatedUpdateGridOption('groupRemoveLowestSingleChildren', value);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n */\n GridApi.prototype.setGroupDisplayType = function (value) {\n this.deprecatedUpdateGridOption('groupDisplayType', value);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Sets the `groupIncludeFooter` property\n */\n GridApi.prototype.setGroupIncludeFooter = function (value) {\n this.deprecatedUpdateGridOption('groupIncludeFooter', value);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Sets the `groupIncludeTotalFooter` property\n */\n GridApi.prototype.setGroupIncludeTotalFooter = function (value) {\n this.deprecatedUpdateGridOption('groupIncludeTotalFooter', value);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n */\n GridApi.prototype.setRowClass = function (className) {\n this.deprecatedUpdateGridOption('rowClass', className);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Sets the `deltaSort` property\n * */\n GridApi.prototype.setDeltaSort = function (enable) {\n this.deprecatedUpdateGridOption('deltaSort', enable);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Sets the `suppressRowDrag` property.\n * */\n GridApi.prototype.setSuppressRowDrag = function (value) {\n this.deprecatedUpdateGridOption('suppressRowDrag', value);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Sets the `suppressMoveWhenRowDragging` property.\n * */\n GridApi.prototype.setSuppressMoveWhenRowDragging = function (value) {\n this.deprecatedUpdateGridOption('suppressMoveWhenRowDragging', value);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Sets the `suppressRowClickSelection` property.\n * */\n GridApi.prototype.setSuppressRowClickSelection = function (value) {\n this.deprecatedUpdateGridOption('suppressRowClickSelection', value);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Enable/disable the Advanced Filter\n * */\n GridApi.prototype.setEnableAdvancedFilter = function (enabled) {\n this.deprecatedUpdateGridOption('enableAdvancedFilter', enabled);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Updates the `includeHiddenColumnsInAdvancedFilter` grid option.\n * By default hidden columns are excluded from the Advanced Filter.\n * Set to `true` to include them.\n */\n GridApi.prototype.setIncludeHiddenColumnsInAdvancedFilter = function (value) {\n this.deprecatedUpdateGridOption('includeHiddenColumnsInAdvancedFilter', value);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * DOM element to use as the parent for the Advanced Filter, to allow it to appear outside of the grid.\n * Set to `null` to appear inside the grid.\n */\n GridApi.prototype.setAdvancedFilterParent = function (advancedFilterParent) {\n this.deprecatedUpdateGridOption('advancedFilterParent', advancedFilterParent);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Updates the Advanced Filter Builder parameters.\n * */\n GridApi.prototype.setAdvancedFilterBuilderParams = function (params) {\n this.deprecatedUpdateGridOption('advancedFilterBuilderParams', params);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Pass a Quick Filter text into the grid for filtering.\n * */\n GridApi.prototype.setQuickFilter = function (newFilter) {\n warnOnce(\"setQuickFilter is deprecated. Please use 'api.setGridOption('quickFilterText', newValue)' or 'api.updateGridOptions({ quickFilterText: newValue })' instead.\");\n this.gos.updateGridOptions({ options: { quickFilterText: newFilter } });\n };\n /**\n * @deprecated As of v30, hidden columns are excluded from the Quick Filter by default. To include hidden columns, use `setIncludeHiddenColumnsInQuickFilter` instead.\n */\n GridApi.prototype.setExcludeHiddenColumnsFromQuickFilter = function (value) {\n this.deprecatedUpdateGridOption('includeHiddenColumnsInQuickFilter', !value);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Updates the `includeHiddenColumnsInQuickFilter` grid option.\n * By default hidden columns are excluded from the Quick Filter.\n * Set to `true` to include them.\n */\n GridApi.prototype.setIncludeHiddenColumnsInQuickFilter = function (value) {\n this.deprecatedUpdateGridOption('includeHiddenColumnsInQuickFilter', value);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Updates the `quickFilterParser` grid option,\n * which changes how the Quick Filter splits the Quick Filter text into search terms.\n */\n GridApi.prototype.setQuickFilterParser = function (quickFilterParser) {\n this.deprecatedUpdateGridOption('quickFilterParser', quickFilterParser);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Updates the `quickFilterMatcher` grid option,\n * which changes the matching logic for whether a row passes the Quick Filter.\n */\n GridApi.prototype.setQuickFilterMatcher = function (quickFilterMatcher) {\n this.deprecatedUpdateGridOption('quickFilterMatcher', quickFilterMatcher);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * If `true`, the horizontal scrollbar will always be present, even if not required. Otherwise, it will only be displayed when necessary.\n * */\n GridApi.prototype.setAlwaysShowHorizontalScroll = function (show) {\n this.deprecatedUpdateGridOption('alwaysShowHorizontalScroll', show);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * If `true`, the vertical scrollbar will always be present, even if not required. Otherwise it will only be displayed when necessary.\n * */\n GridApi.prototype.setAlwaysShowVerticalScroll = function (show) {\n this.deprecatedUpdateGridOption('alwaysShowVerticalScroll', show);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n */\n GridApi.prototype.setFunctionsReadOnly = function (readOnly) {\n this.deprecatedUpdateGridOption('functionsReadOnly', readOnly);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Call to set new column definitions. The grid will redraw all the column headers, and then redraw all of the rows.\n */\n GridApi.prototype.setColumnDefs = function (colDefs, source) {\n if (source === void 0) { source = \"api\"; }\n warnOnce(\"setColumnDefs is deprecated. Please use 'api.setGridOption('columnDefs', newValue)' or 'api.updateGridOptions({ columnDefs: newValue })' instead.\");\n this.gos.updateGridOptions({\n options: { columnDefs: colDefs },\n source: source,\n });\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Call to set new auto group column definition. The grid will recreate any auto-group columns if present.\n * */\n GridApi.prototype.setAutoGroupColumnDef = function (colDef, source) {\n if (source === void 0) { source = \"api\"; }\n warnOnce(\"setAutoGroupColumnDef is deprecated. Please use 'api.setGridOption('autoGroupColumnDef', newValue)' or 'api.updateGridOptions({ autoGroupColumnDef: newValue })' instead.\");\n this.gos.updateGridOptions({\n options: { autoGroupColumnDef: colDef },\n source: source,\n });\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Call to set new Default Column Definition.\n * */\n GridApi.prototype.setDefaultColDef = function (colDef, source) {\n if (source === void 0) { source = \"api\"; }\n warnOnce(\"setDefaultColDef is deprecated. Please use 'api.setGridOption('defaultColDef', newValue)' or 'api.updateGridOptions({ defaultColDef: newValue })' instead.\");\n this.gos.updateGridOptions({\n options: { defaultColDef: colDef },\n source: source,\n });\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Call to set new Column Types.\n * */\n GridApi.prototype.setColumnTypes = function (columnTypes, source) {\n if (source === void 0) { source = \"api\"; }\n warnOnce(\"setColumnTypes is deprecated. Please use 'api.setGridOption('columnTypes', newValue)' or 'api.updateGridOptions({ columnTypes: newValue })' instead.\");\n this.gos.updateGridOptions({\n options: { columnTypes: columnTypes },\n source: source,\n });\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Sets the `treeData` property.\n * */\n GridApi.prototype.setTreeData = function (newTreeData) {\n this.deprecatedUpdateGridOption('treeData', newTreeData);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Set new datasource for Server-Side Row Model.\n * */\n GridApi.prototype.setServerSideDatasource = function (datasource) {\n this.deprecatedUpdateGridOption('serverSideDatasource', datasource);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n *\n * Note this purges all the cached data and reloads all the rows of the grid.\n * */\n GridApi.prototype.setCacheBlockSize = function (blockSize) {\n this.deprecatedUpdateGridOption('cacheBlockSize', blockSize);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Set new datasource for Infinite Row Model.\n * */\n GridApi.prototype.setDatasource = function (datasource) {\n this.deprecatedUpdateGridOption('datasource', datasource);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Set new datasource for Viewport Row Model.\n * */\n GridApi.prototype.setViewportDatasource = function (viewportDatasource) {\n this.deprecatedUpdateGridOption('viewportDatasource', viewportDatasource);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Set the row data.\n * */\n GridApi.prototype.setRowData = function (rowData) {\n this.deprecatedUpdateGridOption('rowData', rowData);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Sets the `enableCellTextSelection` property.\n * */\n GridApi.prototype.setEnableCellTextSelection = function (selectable) {\n this.deprecatedUpdateGridOption('enableCellTextSelection', selectable);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Sets the height in pixels for the row containing the column label header.\n * */\n GridApi.prototype.setHeaderHeight = function (headerHeight) {\n this.deprecatedUpdateGridOption('headerHeight', headerHeight);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Switch between layout options: `normal`, `autoHeight`, `print`.\n * Defaults to `normal` if no domLayout provided.\n */\n GridApi.prototype.setDomLayout = function (domLayout) {\n this.deprecatedUpdateGridOption('domLayout', domLayout);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Sets the preferred direction for the selection fill handle.\n * */\n GridApi.prototype.setFillHandleDirection = function (direction) {\n this.deprecatedUpdateGridOption('fillHandleDirection', direction);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Sets the height in pixels for the rows containing header column groups.\n * */\n GridApi.prototype.setGroupHeaderHeight = function (headerHeight) {\n this.deprecatedUpdateGridOption('groupHeaderHeight', headerHeight);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Sets the height in pixels for the row containing the floating filters.\n * */\n GridApi.prototype.setFloatingFiltersHeight = function (headerHeight) {\n this.deprecatedUpdateGridOption('floatingFiltersHeight', headerHeight);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Sets the height in pixels for the row containing the columns when in pivot mode.\n * */\n GridApi.prototype.setPivotHeaderHeight = function (headerHeight) {\n this.deprecatedUpdateGridOption('pivotHeaderHeight', headerHeight);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * Sets the height in pixels for the row containing header column groups when in pivot mode.\n * */\n GridApi.prototype.setPivotGroupHeaderHeight = function (headerHeight) {\n this.deprecatedUpdateGridOption('pivotGroupHeaderHeight', headerHeight);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setAnimateRows = function (animateRows) {\n this.deprecatedUpdateGridOption('animateRows', animateRows);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setIsExternalFilterPresent = function (isExternalFilterPresentFunc) {\n this.deprecatedUpdateGridOption('isExternalFilterPresent', isExternalFilterPresentFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setDoesExternalFilterPass = function (doesExternalFilterPassFunc) {\n this.deprecatedUpdateGridOption('doesExternalFilterPass', doesExternalFilterPassFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setNavigateToNextCell = function (navigateToNextCellFunc) {\n this.deprecatedUpdateGridOption('navigateToNextCell', navigateToNextCellFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setTabToNextCell = function (tabToNextCellFunc) {\n this.deprecatedUpdateGridOption('tabToNextCell', tabToNextCellFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setTabToNextHeader = function (tabToNextHeaderFunc) {\n this.deprecatedUpdateGridOption('tabToNextHeader', tabToNextHeaderFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setNavigateToNextHeader = function (navigateToNextHeaderFunc) {\n this.deprecatedUpdateGridOption('navigateToNextHeader', navigateToNextHeaderFunc);\n };\n GridApi.prototype.setRowGroupPanelShow = function (rowGroupPanelShow) {\n this.deprecatedUpdateGridOption('rowGroupPanelShow', rowGroupPanelShow);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setGetGroupRowAgg = function (getGroupRowAggFunc) {\n this.deprecatedUpdateGridOption('getGroupRowAgg', getGroupRowAggFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setGetBusinessKeyForNode = function (getBusinessKeyForNodeFunc) {\n this.deprecatedUpdateGridOption('getBusinessKeyForNode', getBusinessKeyForNodeFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setGetChildCount = function (getChildCountFunc) {\n this.deprecatedUpdateGridOption('getChildCount', getChildCountFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setProcessRowPostCreate = function (processRowPostCreateFunc) {\n this.deprecatedUpdateGridOption('processRowPostCreate', processRowPostCreateFunc);\n };\n /**\n * @deprecated v31 `getRowId` is a static property and cannot be updated.\n * */\n GridApi.prototype.setGetRowId = function (getRowIdFunc) {\n warnOnce(\"getRowId is a static property and can no longer be updated.\");\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setGetRowClass = function (rowClassFunc) {\n this.deprecatedUpdateGridOption('getRowClass', rowClassFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setIsFullWidthRow = function (isFullWidthRowFunc) {\n this.deprecatedUpdateGridOption('isFullWidthRow', isFullWidthRowFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setIsRowSelectable = function (isRowSelectableFunc) {\n this.deprecatedUpdateGridOption('isRowSelectable', isRowSelectableFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setIsRowMaster = function (isRowMasterFunc) {\n this.deprecatedUpdateGridOption('isRowMaster', isRowMasterFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setPostSortRows = function (postSortRowsFunc) {\n this.deprecatedUpdateGridOption('postSortRows', postSortRowsFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setGetDocument = function (getDocumentFunc) {\n this.deprecatedUpdateGridOption('getDocument', getDocumentFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setGetContextMenuItems = function (getContextMenuItemsFunc) {\n this.deprecatedUpdateGridOption('getContextMenuItems', getContextMenuItemsFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setGetMainMenuItems = function (getMainMenuItemsFunc) {\n this.deprecatedUpdateGridOption('getMainMenuItems', getMainMenuItemsFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setProcessCellForClipboard = function (processCellForClipboardFunc) {\n this.deprecatedUpdateGridOption('processCellForClipboard', processCellForClipboardFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setSendToClipboard = function (sendToClipboardFunc) {\n this.deprecatedUpdateGridOption('sendToClipboard', sendToClipboardFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setProcessCellFromClipboard = function (processCellFromClipboardFunc) {\n this.deprecatedUpdateGridOption('processCellFromClipboard', processCellFromClipboardFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setProcessPivotResultColDef = function (processPivotResultColDefFunc) {\n this.deprecatedUpdateGridOption('processPivotResultColDef', processPivotResultColDefFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setProcessPivotResultColGroupDef = function (processPivotResultColGroupDefFunc) {\n this.deprecatedUpdateGridOption('processPivotResultColGroupDef', processPivotResultColGroupDefFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setPostProcessPopup = function (postProcessPopupFunc) {\n this.deprecatedUpdateGridOption('postProcessPopup', postProcessPopupFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setInitialGroupOrderComparator = function (initialGroupOrderComparatorFunc) {\n this.deprecatedUpdateGridOption('initialGroupOrderComparator', initialGroupOrderComparatorFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setGetChartToolbarItems = function (getChartToolbarItemsFunc) {\n this.deprecatedUpdateGridOption('getChartToolbarItems', getChartToolbarItemsFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setPaginationNumberFormatter = function (paginationNumberFormatterFunc) {\n this.deprecatedUpdateGridOption('paginationNumberFormatter', paginationNumberFormatterFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setGetServerSideGroupLevelParams = function (getServerSideGroupLevelParamsFunc) {\n this.deprecatedUpdateGridOption('getServerSideGroupLevelParams', getServerSideGroupLevelParamsFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setIsServerSideGroupOpenByDefault = function (isServerSideGroupOpenByDefaultFunc) {\n this.deprecatedUpdateGridOption('isServerSideGroupOpenByDefault', isServerSideGroupOpenByDefaultFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setIsApplyServerSideTransaction = function (isApplyServerSideTransactionFunc) {\n this.deprecatedUpdateGridOption('isApplyServerSideTransaction', isApplyServerSideTransactionFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setIsServerSideGroup = function (isServerSideGroupFunc) {\n this.deprecatedUpdateGridOption('isServerSideGroup', isServerSideGroupFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setGetServerSideGroupKey = function (getServerSideGroupKeyFunc) {\n this.deprecatedUpdateGridOption('getServerSideGroupKey', getServerSideGroupKeyFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setGetRowStyle = function (rowStyleFunc) {\n this.deprecatedUpdateGridOption('getRowStyle', rowStyleFunc);\n };\n /**\n * @deprecated v31 Use `api.setGridOption` or `api.updateGridOptions` instead.\n * */\n GridApi.prototype.setGetRowHeight = function (rowHeightFunc) {\n this.deprecatedUpdateGridOption('getRowHeight', rowHeightFunc);\n };\n __decorate$24([\n Optional('csvCreator')\n ], GridApi.prototype, \"csvCreator\", void 0);\n __decorate$24([\n Optional('excelCreator')\n ], GridApi.prototype, \"excelCreator\", void 0);\n __decorate$24([\n Autowired('rowRenderer')\n ], GridApi.prototype, \"rowRenderer\", void 0);\n __decorate$24([\n Autowired('navigationService')\n ], GridApi.prototype, \"navigationService\", void 0);\n __decorate$24([\n Autowired('filterManager')\n ], GridApi.prototype, \"filterManager\", void 0);\n __decorate$24([\n Autowired('columnModel')\n ], GridApi.prototype, \"columnModel\", void 0);\n __decorate$24([\n Autowired('selectionService')\n ], GridApi.prototype, \"selectionService\", void 0);\n __decorate$24([\n Autowired('gridOptionsService')\n ], GridApi.prototype, \"gos\", void 0);\n __decorate$24([\n Autowired('valueService')\n ], GridApi.prototype, \"valueService\", void 0);\n __decorate$24([\n Autowired('alignedGridsService')\n ], GridApi.prototype, \"alignedGridsService\", void 0);\n __decorate$24([\n Autowired('eventService')\n ], GridApi.prototype, \"eventService\", void 0);\n __decorate$24([\n Autowired('pinnedRowModel')\n ], GridApi.prototype, \"pinnedRowModel\", void 0);\n __decorate$24([\n Autowired('context')\n ], GridApi.prototype, \"context\", void 0);\n __decorate$24([\n Autowired('rowModel')\n ], GridApi.prototype, \"rowModel\", void 0);\n __decorate$24([\n Autowired('sortController')\n ], GridApi.prototype, \"sortController\", void 0);\n __decorate$24([\n Autowired('paginationProxy')\n ], GridApi.prototype, \"paginationProxy\", void 0);\n __decorate$24([\n Autowired('focusService')\n ], GridApi.prototype, \"focusService\", void 0);\n __decorate$24([\n Autowired('dragAndDropService')\n ], GridApi.prototype, \"dragAndDropService\", void 0);\n __decorate$24([\n Optional('rangeService')\n ], GridApi.prototype, \"rangeService\", void 0);\n __decorate$24([\n Optional('clipboardService')\n ], GridApi.prototype, \"clipboardService\", void 0);\n __decorate$24([\n Optional('aggFuncService')\n ], GridApi.prototype, \"aggFuncService\", void 0);\n __decorate$24([\n Autowired('menuService')\n ], GridApi.prototype, \"menuService\", void 0);\n __decorate$24([\n Autowired('valueCache')\n ], GridApi.prototype, \"valueCache\", void 0);\n __decorate$24([\n Autowired('animationFrameService')\n ], GridApi.prototype, \"animationFrameService\", void 0);\n __decorate$24([\n Optional('statusBarService')\n ], GridApi.prototype, \"statusBarService\", void 0);\n __decorate$24([\n Optional('chartService')\n ], GridApi.prototype, \"chartService\", void 0);\n __decorate$24([\n Optional('undoRedoService')\n ], GridApi.prototype, \"undoRedoService\", void 0);\n __decorate$24([\n Optional('rowNodeBlockLoader')\n ], GridApi.prototype, \"rowNodeBlockLoader\", void 0);\n __decorate$24([\n Optional('ssrmTransactionManager')\n ], GridApi.prototype, \"serverSideTransactionManager\", void 0);\n __decorate$24([\n Autowired('ctrlsService')\n ], GridApi.prototype, \"ctrlsService\", void 0);\n __decorate$24([\n Autowired('overlayService')\n ], GridApi.prototype, \"overlayService\", void 0);\n __decorate$24([\n Optional('sideBarService')\n ], GridApi.prototype, \"sideBarService\", void 0);\n __decorate$24([\n Autowired('stateService')\n ], GridApi.prototype, \"stateService\", void 0);\n __decorate$24([\n Autowired('expansionService')\n ], GridApi.prototype, \"expansionService\", void 0);\n __decorate$24([\n Autowired('apiEventService')\n ], GridApi.prototype, \"apiEventService\", void 0);\n __decorate$24([\n Autowired('frameworkOverrides')\n ], GridApi.prototype, \"frameworkOverrides\", void 0);\n __decorate$24([\n PostConstruct\n ], GridApi.prototype, \"init\", null);\n GridApi = __decorate$24([\n Bean('gridApi')\n ], GridApi);\n return GridApi;\n}());\n\nvar __extends$2i = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$23 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar QuickFilterService = /** @class */ (function (_super) {\n __extends$2i(QuickFilterService, _super);\n function QuickFilterService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.quickFilter = null;\n _this.quickFilterParts = null;\n return _this;\n }\n QuickFilterService_1 = QuickFilterService;\n QuickFilterService.prototype.postConstruct = function () {\n var _this = this;\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, function () { return _this.resetQuickFilterCache(); });\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, function () { return _this.resetQuickFilterCache(); });\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, function () { return _this.resetQuickFilterCache(); });\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VISIBLE, function () {\n if (!_this.gridOptionsService.get('includeHiddenColumnsInQuickFilter')) {\n _this.resetQuickFilterCache();\n }\n });\n this.addManagedPropertyListener('quickFilterText', function (e) { return _this.setQuickFilter(e.currentValue); });\n this.addManagedPropertyListener('includeHiddenColumnsInQuickFilter', function () { return _this.onIncludeHiddenColumnsInQuickFilterChanged(); });\n this.quickFilter = this.parseQuickFilter(this.gridOptionsService.get('quickFilterText'));\n this.parser = this.gridOptionsService.get('quickFilterParser');\n this.matcher = this.gridOptionsService.get('quickFilterMatcher');\n this.setQuickFilterParts();\n this.addManagedPropertyListeners(['quickFilterMatcher', 'quickFilterParser'], function () { return _this.setQuickFilterParserAndMatcher(); });\n };\n QuickFilterService.prototype.isQuickFilterPresent = function () {\n return this.quickFilter !== null;\n };\n QuickFilterService.prototype.doesRowPassQuickFilter = function (node) {\n var _this = this;\n var usingCache = this.gridOptionsService.get('cacheQuickFilter');\n if (this.matcher) {\n return this.doesRowPassQuickFilterMatcher(usingCache, node);\n }\n // each part must pass, if any fails, then the whole filter fails\n return this.quickFilterParts.every(function (part) {\n return usingCache ? _this.doesRowPassQuickFilterCache(node, part) : _this.doesRowPassQuickFilterNoCache(node, part);\n });\n };\n QuickFilterService.prototype.resetQuickFilterCache = function () {\n this.rowModel.forEachNode(function (node) { return node.quickFilterAggregateText = null; });\n };\n QuickFilterService.prototype.setQuickFilterParts = function () {\n var _a = this, quickFilter = _a.quickFilter, parser = _a.parser;\n if (quickFilter) {\n this.quickFilterParts = parser ? parser(quickFilter) : quickFilter.split(' ');\n }\n else {\n this.quickFilterParts = null;\n }\n };\n QuickFilterService.prototype.parseQuickFilter = function (newFilter) {\n if (!exists(newFilter)) {\n return null;\n }\n if (!this.gridOptionsService.isRowModelType('clientSide')) {\n console.warn('AG Grid - Quick filtering only works with the Client-Side Row Model');\n return null;\n }\n return newFilter.toUpperCase();\n };\n QuickFilterService.prototype.setQuickFilter = function (newFilter) {\n if (newFilter != null && typeof newFilter !== 'string') {\n console.warn(\"AG Grid - Grid option quickFilterText only supports string inputs, received: \".concat(typeof newFilter));\n return;\n }\n var parsedFilter = this.parseQuickFilter(newFilter);\n if (this.quickFilter !== parsedFilter) {\n this.quickFilter = parsedFilter;\n this.setQuickFilterParts();\n this.dispatchEvent({ type: QuickFilterService_1.EVENT_QUICK_FILTER_CHANGED });\n }\n };\n QuickFilterService.prototype.setQuickFilterParserAndMatcher = function () {\n var parser = this.gridOptionsService.get('quickFilterParser');\n var matcher = this.gridOptionsService.get('quickFilterMatcher');\n var hasChanged = parser !== this.parser || matcher !== this.matcher;\n this.parser = parser;\n this.matcher = matcher;\n if (hasChanged) {\n this.setQuickFilterParts();\n this.dispatchEvent({ type: QuickFilterService_1.EVENT_QUICK_FILTER_CHANGED });\n }\n };\n QuickFilterService.prototype.onIncludeHiddenColumnsInQuickFilterChanged = function () {\n this.columnModel.refreshQuickFilterColumns();\n this.resetQuickFilterCache();\n if (this.isQuickFilterPresent()) {\n this.dispatchEvent({ type: QuickFilterService_1.EVENT_QUICK_FILTER_CHANGED });\n }\n };\n QuickFilterService.prototype.doesRowPassQuickFilterNoCache = function (node, filterPart) {\n var _this = this;\n var columns = this.columnModel.getAllColumnsForQuickFilter();\n return columns.some(function (column) {\n var part = _this.getQuickFilterTextForColumn(column, node);\n return exists(part) && part.indexOf(filterPart) >= 0;\n });\n };\n QuickFilterService.prototype.doesRowPassQuickFilterCache = function (node, filterPart) {\n this.checkGenerateQuickFilterAggregateText(node);\n return node.quickFilterAggregateText.indexOf(filterPart) >= 0;\n };\n QuickFilterService.prototype.doesRowPassQuickFilterMatcher = function (usingCache, node) {\n var quickFilterAggregateText;\n if (usingCache) {\n this.checkGenerateQuickFilterAggregateText(node);\n quickFilterAggregateText = node.quickFilterAggregateText;\n }\n else {\n quickFilterAggregateText = this.getQuickFilterAggregateText(node);\n }\n var _a = this, quickFilterParts = _a.quickFilterParts, matcher = _a.matcher;\n return matcher(quickFilterParts, quickFilterAggregateText);\n };\n QuickFilterService.prototype.checkGenerateQuickFilterAggregateText = function (node) {\n if (!node.quickFilterAggregateText) {\n node.quickFilterAggregateText = this.getQuickFilterAggregateText(node);\n }\n };\n QuickFilterService.prototype.getQuickFilterTextForColumn = function (column, node) {\n var value = this.valueService.getValue(column, node, true);\n var colDef = column.getColDef();\n if (colDef.getQuickFilterText) {\n var params = this.gridOptionsService.addGridCommonParams({\n value: value,\n node: node,\n data: node.data,\n column: column,\n colDef: colDef\n });\n value = colDef.getQuickFilterText(params);\n }\n return exists(value) ? value.toString().toUpperCase() : null;\n };\n QuickFilterService.prototype.getQuickFilterAggregateText = function (node) {\n var _this = this;\n var stringParts = [];\n var columns = this.columnModel.getAllColumnsForQuickFilter();\n columns.forEach(function (column) {\n var part = _this.getQuickFilterTextForColumn(column, node);\n if (exists(part)) {\n stringParts.push(part);\n }\n });\n return stringParts.join(QuickFilterService_1.QUICK_FILTER_SEPARATOR);\n };\n var QuickFilterService_1;\n QuickFilterService.EVENT_QUICK_FILTER_CHANGED = 'quickFilterChanged';\n QuickFilterService.QUICK_FILTER_SEPARATOR = '\\n';\n __decorate$23([\n Autowired('valueService')\n ], QuickFilterService.prototype, \"valueService\", void 0);\n __decorate$23([\n Autowired('columnModel')\n ], QuickFilterService.prototype, \"columnModel\", void 0);\n __decorate$23([\n Autowired('rowModel')\n ], QuickFilterService.prototype, \"rowModel\", void 0);\n __decorate$23([\n PostConstruct\n ], QuickFilterService.prototype, \"postConstruct\", null);\n QuickFilterService = QuickFilterService_1 = __decorate$23([\n Bean('quickFilterService')\n ], QuickFilterService);\n return QuickFilterService;\n}(BeanStub));\n\nvar __extends$2h = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$g = ( false) || function () {\n __assign$g = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$g.apply(this, arguments);\n};\nvar __decorate$22 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar FilterManager = /** @class */ (function (_super) {\n __extends$2h(FilterManager, _super);\n function FilterManager() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.allColumnFilters = new Map();\n _this.allColumnListeners = new Map();\n _this.activeAggregateFilters = [];\n _this.activeColumnFilters = [];\n // this is true when the grid is processing the filter change. this is used by the cell comps, so that they\n // don't flash when data changes due to filter changes. there is no need to flash when filter changes as the\n // user is in control, so doesn't make sense to show flashing changes. for example, go to main demo where\n // this feature is turned off (hack code to always return false for isSuppressFlashingCellsBecauseFiltering(), put in)\n // 100,000 rows and group by country. then do some filtering. all the cells flash, which is silly.\n _this.processingFilterChange = false;\n // when we're waiting for cell data types to be inferred, we need to defer filter model updates\n _this.filterModelUpdateQueue = [];\n _this.columnFilterModelUpdateQueue = [];\n _this.advancedFilterModelUpdateQueue = [];\n return _this;\n }\n FilterManager.prototype.init = function () {\n var _this = this;\n var _a, _b, _c;\n this.addManagedListener(this.eventService, Events.EVENT_GRID_COLUMNS_CHANGED, function () { return _this.onColumnsChanged(); });\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VALUE_CHANGED, function () { return _this.refreshFiltersForAggregations(); });\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_CHANGED, function () { return _this.refreshFiltersForAggregations(); });\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, function () { return _this.refreshFiltersForAggregations(); });\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, function () { return _this.updateAdvancedFilterColumns(); });\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VISIBLE, function () { return _this.updateAdvancedFilterColumns(); });\n this.addManagedListener(this.eventService, Events.EVENT_ROW_DATA_UPDATED, function () { return _this.onNewRowsLoaded('rowDataUpdated'); });\n this.externalFilterPresent = this.isExternalFilterPresentCallback();\n this.addManagedPropertyListeners(['isExternalFilterPresent', 'doesExternalFilterPass'], function () {\n _this.onFilterChanged({ source: 'api' });\n });\n this.updateAggFiltering();\n this.addManagedPropertyListener('groupAggFiltering', function () {\n _this.updateAggFiltering();\n _this.onFilterChanged();\n });\n this.addManagedPropertyListener('advancedFilterModel', function (event) { return _this.setAdvancedFilterModel(event.currentValue); });\n this.addManagedListener(this.eventService, Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED, function (_a) {\n var enabled = _a.enabled;\n return _this.onAdvancedFilterEnabledChanged(enabled);\n });\n this.addManagedListener(this.eventService, Events.EVENT_DATA_TYPES_INFERRED, function () { return _this.processFilterModelUpdateQueue(); });\n this.addManagedListener(this.quickFilterService, QuickFilterService.EVENT_QUICK_FILTER_CHANGED, function () { return _this.onFilterChanged({ source: 'quickFilter' }); });\n this.initialFilterModel = __assign$g({}, (_c = (_b = (_a = this.gridOptionsService.get('initialState')) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.filterModel) !== null && _c !== void 0 ? _c : {});\n };\n FilterManager.prototype.isExternalFilterPresentCallback = function () {\n var isFilterPresent = this.gridOptionsService.getCallback('isExternalFilterPresent');\n if (typeof isFilterPresent === 'function') {\n return isFilterPresent({});\n }\n return false;\n };\n FilterManager.prototype.doesExternalFilterPass = function (node) {\n var doesFilterPass = this.gridOptionsService.get('doesExternalFilterPass');\n if (typeof doesFilterPass === 'function') {\n return doesFilterPass(node);\n }\n return false;\n };\n FilterManager.prototype.setFilterModel = function (model, source) {\n var _this = this;\n if (source === void 0) { source = 'api'; }\n if (this.isAdvancedFilterEnabled()) {\n this.warnAdvancedFilters();\n return;\n }\n if (this.dataTypeService.isPendingInference()) {\n this.filterModelUpdateQueue.push({ model: model, source: source });\n return;\n }\n var allPromises = [];\n var previousModel = this.getFilterModel();\n if (model) {\n // mark the filters as we set them, so any active filters left over we stop\n var modelKeys_1 = convertToSet(Object.keys(model));\n this.allColumnFilters.forEach(function (filterWrapper, colId) {\n var newModel = model[colId];\n allPromises.push(_this.setModelOnFilterWrapper(filterWrapper.filterPromise, newModel));\n modelKeys_1.delete(colId);\n });\n // at this point, processedFields contains data for which we don't have a filter working yet\n modelKeys_1.forEach(function (colId) {\n var column = _this.columnModel.getPrimaryColumn(colId) || _this.columnModel.getGridColumn(colId);\n if (!column) {\n console.warn('AG Grid: setFilterModel() - no column found for colId: ' + colId);\n return;\n }\n if (!column.isFilterAllowed()) {\n console.warn('AG Grid: setFilterModel() - unable to fully apply model, filtering disabled for colId: ' + colId);\n return;\n }\n var filterWrapper = _this.getOrCreateFilterWrapper(column, 'NO_UI');\n if (!filterWrapper) {\n console.warn('AG-Grid: setFilterModel() - unable to fully apply model, unable to create filter for colId: ' + colId);\n return;\n }\n allPromises.push(_this.setModelOnFilterWrapper(filterWrapper.filterPromise, model[colId]));\n });\n }\n else {\n this.allColumnFilters.forEach(function (filterWrapper) {\n allPromises.push(_this.setModelOnFilterWrapper(filterWrapper.filterPromise, null));\n });\n }\n AgPromise.all(allPromises).then(function () {\n var currentModel = _this.getFilterModel();\n var columns = [];\n _this.allColumnFilters.forEach(function (filterWrapper, colId) {\n var before = previousModel ? previousModel[colId] : null;\n var after = currentModel ? currentModel[colId] : null;\n if (!_.jsonEquals(before, after)) {\n columns.push(filterWrapper.column);\n }\n });\n if (columns.length > 0) {\n _this.onFilterChanged({ columns: columns, source: source });\n }\n });\n };\n FilterManager.prototype.setModelOnFilterWrapper = function (filterPromise, newModel) {\n return new AgPromise(function (resolve) {\n filterPromise.then(function (filter) {\n if (typeof filter.setModel !== 'function') {\n console.warn('AG Grid: filter missing setModel method, which is needed for setFilterModel');\n resolve();\n }\n (filter.setModel(newModel) || AgPromise.resolve()).then(function () { return resolve(); });\n });\n });\n };\n FilterManager.prototype.getFilterModel = function () {\n var _this = this;\n var result = {};\n this.allColumnFilters.forEach(function (filterWrapper, key) {\n var model = _this.getModelFromFilterWrapper(filterWrapper);\n if (exists(model)) {\n result[key] = model;\n }\n });\n return result;\n };\n FilterManager.prototype.getModelFromFilterWrapper = function (filterWrapper) {\n var _a;\n // because user can provide filters, we provide useful error checking and messages\n var filterPromise = filterWrapper.filterPromise;\n var filter = filterPromise.resolveNow(null, function (promiseFilter) { return promiseFilter; });\n if (filter == null) {\n // filter still being created. returned initial state if it exists and hasn't been applied yet\n return (_a = this.initialFilterModel[filterWrapper.column.getColId()]) !== null && _a !== void 0 ? _a : null;\n }\n if (typeof filter.getModel !== 'function') {\n console.warn('AG Grid: filter API missing getModel method, which is needed for getFilterModel');\n return null;\n }\n return filter.getModel();\n };\n FilterManager.prototype.isColumnFilterPresent = function () {\n return this.activeColumnFilters.length > 0;\n };\n FilterManager.prototype.isAggregateFilterPresent = function () {\n return !!this.activeAggregateFilters.length;\n };\n FilterManager.prototype.isExternalFilterPresent = function () {\n return this.externalFilterPresent;\n };\n FilterManager.prototype.isChildFilterPresent = function () {\n return this.isColumnFilterPresent()\n || this.isQuickFilterPresent()\n || this.isExternalFilterPresent()\n || this.isAdvancedFilterPresent();\n };\n FilterManager.prototype.isAdvancedFilterPresent = function () {\n return this.isAdvancedFilterEnabled() && this.advancedFilterService.isFilterPresent();\n };\n FilterManager.prototype.onAdvancedFilterEnabledChanged = function (enabled) {\n var _this = this;\n var _a;\n if (enabled) {\n if (this.allColumnFilters.size) {\n this.allColumnFilters.forEach(function (filterWrapper) { return _this.disposeFilterWrapper(filterWrapper, 'advancedFilterEnabled'); });\n this.onFilterChanged({ source: 'advancedFilter' });\n }\n }\n else {\n if ((_a = this.advancedFilterService) === null || _a === void 0 ? void 0 : _a.isFilterPresent()) {\n this.advancedFilterService.setModel(null);\n this.onFilterChanged({ source: 'advancedFilter' });\n }\n }\n };\n FilterManager.prototype.isAdvancedFilterEnabled = function () {\n var _a;\n return (_a = this.advancedFilterService) === null || _a === void 0 ? void 0 : _a.isEnabled();\n };\n FilterManager.prototype.isAdvancedFilterHeaderActive = function () {\n return this.isAdvancedFilterEnabled() && this.advancedFilterService.isHeaderActive();\n };\n FilterManager.prototype.doAggregateFiltersPass = function (node, filterToSkip) {\n return this.doColumnFiltersPass(node, filterToSkip, true);\n };\n // called by:\n // 1) onFilterChanged()\n // 2) onNewRowsLoaded()\n FilterManager.prototype.updateActiveFilters = function () {\n var _this = this;\n this.activeColumnFilters.length = 0;\n this.activeAggregateFilters.length = 0;\n var isFilterActive = function (filter) {\n if (!filter) {\n return false;\n } // this never happens, including to avoid compile error\n if (!filter.isFilterActive) {\n console.warn('AG Grid: Filter is missing isFilterActive() method');\n return false;\n }\n return filter.isFilterActive();\n };\n var groupFilterEnabled = !!this.gridOptionsService.getGroupAggFiltering();\n var isAggFilter = function (column) {\n var isSecondary = !column.isPrimary();\n // the only filters that can appear on secondary columns are groupAgg filters\n if (isSecondary) {\n return true;\n }\n var isShowingPrimaryColumns = !_this.columnModel.isPivotActive();\n var isValueActive = column.isValueActive();\n // primary columns are only ever groupAgg filters if a) value is active and b) showing primary columns\n if (!isValueActive || !isShowingPrimaryColumns) {\n return false;\n }\n // from here on we know: isPrimary=true, isValueActive=true, isShowingPrimaryColumns=true\n if (_this.columnModel.isPivotMode()) {\n // primary column is pretending to be a pivot column, ie pivotMode=true, but we are\n // still showing primary columns\n return true;\n }\n // we are not pivoting, so we groupFilter when it's an agg column\n return groupFilterEnabled;\n };\n this.allColumnFilters.forEach(function (filterWrapper) {\n if (filterWrapper.filterPromise.resolveNow(false, isFilterActive)) {\n var filterComp = filterWrapper.filterPromise.resolveNow(null, function (filter) { return filter; });\n if (isAggFilter(filterWrapper.column)) {\n _this.activeAggregateFilters.push(filterComp);\n }\n else {\n _this.activeColumnFilters.push(filterComp);\n }\n }\n });\n };\n FilterManager.prototype.updateFilterFlagInColumns = function (source, additionalEventAttributes) {\n this.allColumnFilters.forEach(function (filterWrapper) {\n var isFilterActive = filterWrapper.filterPromise.resolveNow(false, function (filter) { return filter.isFilterActive(); });\n filterWrapper.column.setFilterActive(isFilterActive, source, additionalEventAttributes);\n });\n };\n FilterManager.prototype.isAnyFilterPresent = function () {\n return this.isQuickFilterPresent() || this.isColumnFilterPresent() || this.isAggregateFilterPresent() || this.isExternalFilterPresent() || this.isAdvancedFilterPresent();\n };\n FilterManager.prototype.doColumnFiltersPass = function (node, filterToSkip, targetAggregates) {\n var data = node.data, aggData = node.aggData;\n var targetedFilters = targetAggregates ? this.activeAggregateFilters : this.activeColumnFilters;\n var targetedData = targetAggregates ? aggData : data;\n for (var i = 0; i < targetedFilters.length; i++) {\n var filter = targetedFilters[i];\n if (filter == null || filter === filterToSkip) {\n continue;\n }\n if (typeof filter.doesFilterPass !== 'function') {\n // because users can do custom filters, give nice error message\n throw new Error('Filter is missing method doesFilterPass');\n }\n if (!filter.doesFilterPass({ node: node, data: targetedData })) {\n return false;\n }\n }\n return true;\n };\n FilterManager.prototype.resetQuickFilterCache = function () {\n this.quickFilterService.resetQuickFilterCache();\n };\n FilterManager.prototype.refreshFiltersForAggregations = function () {\n var isAggFiltering = this.gridOptionsService.getGroupAggFiltering();\n if (isAggFiltering) {\n this.onFilterChanged();\n }\n };\n // sometimes (especially in React) the filter can call onFilterChanged when we are in the middle\n // of a render cycle. this would be bad, so we wait for render cycle to complete when this happens.\n // this happens in react when we change React State in the grid (eg setting RowCtrl's in RowContainer)\n // which results in React State getting applied in the main application, triggering a useEffect() to\n // be kicked off adn then the application calling the grid's API. in AG-6554, the custom filter was\n // getting it's useEffect() triggered in this way.\n FilterManager.prototype.callOnFilterChangedOutsideRenderCycle = function (params) {\n var _this = this;\n var action = function () { return _this.onFilterChanged(params); };\n if (this.rowRenderer.isRefreshInProgress()) {\n setTimeout(action, 0);\n }\n else {\n action();\n }\n };\n FilterManager.prototype.onFilterChanged = function (params) {\n if (params === void 0) { params = {}; }\n var source = params.source, filterInstance = params.filterInstance, additionalEventAttributes = params.additionalEventAttributes, columns = params.columns;\n this.updateDependantFilters();\n this.updateActiveFilters();\n this.updateFilterFlagInColumns('filterChanged', additionalEventAttributes);\n this.externalFilterPresent = this.isExternalFilterPresentCallback();\n this.allColumnFilters.forEach(function (filterWrapper) {\n if (!filterWrapper.filterPromise) {\n return;\n }\n filterWrapper.filterPromise.then(function (filter) {\n if (filter && filter !== filterInstance && filter.onAnyFilterChanged) {\n filter.onAnyFilterChanged();\n }\n });\n });\n var filterChangedEvent = {\n source: source,\n type: Events.EVENT_FILTER_CHANGED,\n columns: columns || [],\n };\n if (additionalEventAttributes) {\n mergeDeep(filterChangedEvent, additionalEventAttributes);\n }\n // because internal events are not async in ag-grid, when the dispatchEvent\n // method comes back, we know all listeners have finished executing.\n this.processingFilterChange = true;\n this.eventService.dispatchEvent(filterChangedEvent);\n this.processingFilterChange = false;\n };\n FilterManager.prototype.isSuppressFlashingCellsBecauseFiltering = function () {\n var _a;\n // if user has elected to always flash cell changes, then always return false, otherwise we suppress flashing\n // changes when filtering\n var allowShowChangeAfterFilter = (_a = this.gridOptionsService.get('allowShowChangeAfterFilter')) !== null && _a !== void 0 ? _a : false;\n return !allowShowChangeAfterFilter && this.processingFilterChange;\n };\n FilterManager.prototype.isQuickFilterPresent = function () {\n return this.quickFilterService.isQuickFilterPresent();\n };\n FilterManager.prototype.updateAggFiltering = function () {\n this.aggFiltering = !!this.gridOptionsService.getGroupAggFiltering();\n };\n FilterManager.prototype.isAggregateQuickFilterPresent = function () {\n return this.isQuickFilterPresent() && (this.aggFiltering || this.columnModel.isPivotMode());\n };\n FilterManager.prototype.isNonAggregateQuickFilterPresent = function () {\n return this.isQuickFilterPresent() && !(this.aggFiltering || this.columnModel.isPivotMode());\n };\n FilterManager.prototype.doesRowPassOtherFilters = function (filterToSkip, node) {\n return this.doesRowPassFilter({ rowNode: node, filterInstanceToSkip: filterToSkip });\n };\n FilterManager.prototype.doesRowPassAggregateFilters = function (params) {\n // check quick filter\n if (this.isAggregateQuickFilterPresent() && !this.quickFilterService.doesRowPassQuickFilter(params.rowNode)) {\n return false;\n }\n if (this.isAggregateFilterPresent() && !this.doAggregateFiltersPass(params.rowNode, params.filterInstanceToSkip)) {\n return false;\n }\n // got this far, all filters pass\n return true;\n };\n FilterManager.prototype.doesRowPassFilter = function (params) {\n // the row must pass ALL of the filters, so if any of them fail,\n // we return true. that means if a row passes the quick filter,\n // but fails the column filter, it fails overall\n // first up, check quick filter\n if (this.isNonAggregateQuickFilterPresent() && !this.quickFilterService.doesRowPassQuickFilter(params.rowNode)) {\n return false;\n }\n // secondly, give the client a chance to reject this row\n if (this.isExternalFilterPresent() && !this.doesExternalFilterPass(params.rowNode)) {\n return false;\n }\n // lastly, check column filter\n if (this.isColumnFilterPresent() && !this.doColumnFiltersPass(params.rowNode, params.filterInstanceToSkip)) {\n return false;\n }\n if (this.isAdvancedFilterPresent() && !this.advancedFilterService.doesFilterPass(params.rowNode)) {\n return false;\n }\n // got this far, all filters pass\n return true;\n };\n FilterManager.prototype.onNewRowsLoaded = function (source) {\n this.allColumnFilters.forEach(function (filterWrapper) {\n filterWrapper.filterPromise.then(function (filter) {\n if (filter.onNewRowsLoaded) {\n filter.onNewRowsLoaded();\n }\n });\n });\n this.updateFilterFlagInColumns(source, { afterDataChange: true });\n this.updateActiveFilters();\n };\n FilterManager.prototype.createValueGetter = function (column) {\n var _this = this;\n return function (_a) {\n var node = _a.node;\n return _this.valueService.getValue(column, node, true);\n };\n };\n FilterManager.prototype.createGetValue = function (filterColumn) {\n var _this = this;\n return function (rowNode, column) {\n var columnToUse = column ? _this.columnModel.getGridColumn(column) : filterColumn;\n return columnToUse ? _this.valueService.getValue(columnToUse, rowNode, true) : undefined;\n };\n };\n FilterManager.prototype.getFilterComponent = function (column, source, createIfDoesNotExist) {\n var _a;\n if (createIfDoesNotExist === void 0) { createIfDoesNotExist = true; }\n if (createIfDoesNotExist) {\n return ((_a = this.getOrCreateFilterWrapper(column, source)) === null || _a === void 0 ? void 0 : _a.filterPromise) || null;\n }\n var filterWrapper = this.cachedFilter(column);\n return filterWrapper ? filterWrapper.filterPromise : null;\n };\n FilterManager.prototype.isFilterActive = function (column) {\n var filterWrapper = this.cachedFilter(column);\n return !!filterWrapper && filterWrapper.filterPromise.resolveNow(false, function (filter) { return filter.isFilterActive(); });\n };\n FilterManager.prototype.getOrCreateFilterWrapper = function (column, source) {\n if (!column.isFilterAllowed()) {\n return null;\n }\n var filterWrapper = this.cachedFilter(column);\n if (!filterWrapper) {\n filterWrapper = this.createFilterWrapper(column, source);\n this.setColumnFilterWrapper(column, filterWrapper);\n }\n else if (source !== 'NO_UI') {\n this.putIntoGui(filterWrapper, source);\n }\n return filterWrapper;\n };\n FilterManager.prototype.cachedFilter = function (column) {\n return this.allColumnFilters.get(column.getColId());\n };\n FilterManager.prototype.getDefaultFilter = function (column) {\n var defaultFilter;\n if (ModuleRegistry.__isRegistered(ModuleNames.SetFilterModule, this.context.getGridId())) {\n defaultFilter = 'agSetColumnFilter';\n }\n else {\n var cellDataType = this.dataTypeService.getBaseDataType(column);\n if (cellDataType === 'number') {\n defaultFilter = 'agNumberColumnFilter';\n }\n else if (cellDataType === 'date' || cellDataType === 'dateString') {\n defaultFilter = 'agDateColumnFilter';\n }\n else {\n defaultFilter = 'agTextColumnFilter';\n }\n }\n return defaultFilter;\n };\n FilterManager.prototype.getDefaultFloatingFilter = function (column) {\n var defaultFloatingFilterType;\n if (ModuleRegistry.__isRegistered(ModuleNames.SetFilterModule, this.context.getGridId())) {\n defaultFloatingFilterType = 'agSetColumnFloatingFilter';\n }\n else {\n var cellDataType = this.dataTypeService.getBaseDataType(column);\n if (cellDataType === 'number') {\n defaultFloatingFilterType = 'agNumberColumnFloatingFilter';\n }\n else if (cellDataType === 'date' || cellDataType === 'dateString') {\n defaultFloatingFilterType = 'agDateColumnFloatingFilter';\n }\n else {\n defaultFloatingFilterType = 'agTextColumnFloatingFilter';\n }\n }\n return defaultFloatingFilterType;\n };\n FilterManager.prototype.createFilterInstance = function (column) {\n var _this = this;\n var defaultFilter = this.getDefaultFilter(column);\n var colDef = column.getColDef();\n var filterInstance;\n var params = __assign$g(__assign$g({}, this.createFilterParams(column, colDef)), { filterModifiedCallback: function () { return _this.filterModifiedCallbackFactory(filterInstance, column)(); }, filterChangedCallback: function (additionalEventAttributes) { return _this.filterChangedCallbackFactory(filterInstance, column)(additionalEventAttributes); }, doesRowPassOtherFilter: function (node) { return _this.doesRowPassOtherFilters(filterInstance, node); } });\n var compDetails = this.userComponentFactory.getFilterDetails(colDef, params, defaultFilter);\n if (!compDetails) {\n return { filterPromise: null, compDetails: null };\n }\n return {\n filterPromise: function () {\n var filterPromise = compDetails.newAgStackInstance();\n if (filterPromise) {\n filterPromise.then(function (r) { return filterInstance = r; });\n }\n return filterPromise;\n },\n compDetails: compDetails\n };\n };\n FilterManager.prototype.createFilterParams = function (column, colDef) {\n var params = this.gridOptionsService.addGridCommonParams({\n column: column,\n colDef: cloneObject(colDef),\n rowModel: this.rowModel,\n filterChangedCallback: function () { },\n filterModifiedCallback: function () { },\n valueGetter: this.createValueGetter(column),\n getValue: this.createGetValue(column),\n doesRowPassOtherFilter: function () { return true; },\n });\n return params;\n };\n FilterManager.prototype.createFilterWrapper = function (column, source) {\n var _a;\n var filterWrapper = {\n column: column,\n filterPromise: null,\n compiledElement: null,\n guiPromise: AgPromise.resolve(null),\n compDetails: null\n };\n var _b = this.createFilterInstance(column), filterPromise = _b.filterPromise, compDetails = _b.compDetails;\n filterWrapper.filterPromise = (_a = filterPromise === null || filterPromise === void 0 ? void 0 : filterPromise()) !== null && _a !== void 0 ? _a : null;\n filterWrapper.compDetails = compDetails;\n if (filterPromise) {\n this.putIntoGui(filterWrapper, source);\n }\n return filterWrapper;\n };\n FilterManager.prototype.putIntoGui = function (filterWrapper, source) {\n var _this = this;\n var eFilterGui = document.createElement('div');\n eFilterGui.className = 'ag-filter';\n filterWrapper.guiPromise = new AgPromise(function (resolve) {\n filterWrapper.filterPromise.then(function (filter) {\n var guiFromFilter = filter.getGui();\n if (!exists(guiFromFilter)) {\n console.warn(\"AG Grid: getGui method from filter returned \".concat(guiFromFilter, \", it should be a DOM element or an HTML template string.\"));\n }\n // for backwards compatibility with Angular 1 - we\n // used to allow providing back HTML from getGui().\n // once we move away from supporting Angular 1\n // directly, we can change this.\n if (typeof guiFromFilter === 'string') {\n guiFromFilter = loadTemplate(guiFromFilter);\n }\n eFilterGui.appendChild(guiFromFilter);\n resolve(eFilterGui);\n var event = {\n type: Events.EVENT_FILTER_OPENED,\n column: filterWrapper.column,\n source: source,\n eGui: eFilterGui\n };\n _this.eventService.dispatchEvent(event);\n });\n });\n };\n FilterManager.prototype.onColumnsChanged = function () {\n var _this = this;\n var columns = [];\n this.allColumnFilters.forEach(function (wrapper, colId) {\n var currentColumn;\n if (wrapper.column.isPrimary()) {\n currentColumn = _this.columnModel.getPrimaryColumn(colId);\n }\n else {\n currentColumn = _this.columnModel.getGridColumn(colId);\n }\n if (currentColumn) {\n return;\n }\n columns.push(wrapper.column);\n _this.disposeFilterWrapper(wrapper, 'columnChanged');\n _this.disposeColumnListener(colId);\n });\n if (columns.length > 0) {\n // When a filter changes as a side effect of a column changes,\n // we report 'api' as the source, so that the client can distinguish\n this.onFilterChanged({ columns: columns, source: 'api' });\n }\n else {\n // onFilterChanged does this already\n this.updateDependantFilters();\n }\n };\n FilterManager.prototype.updateDependantFilters = function () {\n var _this = this;\n // Group column filters can be dependant on underlying column filters, but don't normally get created until they're used for the first time.\n // Instead, create them by default when any filter changes.\n var groupColumns = this.columnModel.getGroupAutoColumns();\n groupColumns === null || groupColumns === void 0 ? void 0 : groupColumns.forEach(function (groupColumn) {\n if (groupColumn.getColDef().filter === 'agGroupColumnFilter') {\n _this.getOrCreateFilterWrapper(groupColumn, 'NO_UI');\n }\n });\n };\n // for group filters, can change dynamically whether they are allowed or not\n FilterManager.prototype.isFilterAllowed = function (column) {\n var _a, _b;\n if (this.isAdvancedFilterEnabled()) {\n return false;\n }\n var isFilterAllowed = column.isFilterAllowed();\n if (!isFilterAllowed) {\n return false;\n }\n var filterWrapper = this.allColumnFilters.get(column.getColId());\n return (_b = (_a = filterWrapper === null || filterWrapper === void 0 ? void 0 : filterWrapper.filterPromise) === null || _a === void 0 ? void 0 : _a.resolveNow(true, \n // defer to filter component isFilterAllowed if it exists\n function (filter) { return (typeof (filter === null || filter === void 0 ? void 0 : filter.isFilterAllowed) === 'function')\n ? filter === null || filter === void 0 ? void 0 : filter.isFilterAllowed()\n : true; })) !== null && _b !== void 0 ? _b : true;\n };\n FilterManager.prototype.getFloatingFilterCompDetails = function (column, showParentFilter) {\n var _this = this;\n var parentFilterInstance = function (callback) {\n var filterComponent = _this.getFilterComponent(column, 'NO_UI');\n if (filterComponent == null) {\n return;\n }\n filterComponent.then(function (instance) {\n callback(unwrapUserComp(instance));\n });\n };\n var colDef = column.getColDef();\n var filterParams = __assign$g(__assign$g({}, this.createFilterParams(column, colDef)), { filterChangedCallback: function () { return parentFilterInstance(function (filterInstance) { return _this.filterChangedCallbackFactory(filterInstance, column)(); }); } });\n var finalFilterParams = this.userComponentFactory.mergeParamsWithApplicationProvidedParams(colDef, FilterComponent, filterParams);\n var defaultFloatingFilterType = this.userComponentFactory.getDefaultFloatingFilterType(colDef, function () { return _this.getDefaultFloatingFilter(column); });\n if (defaultFloatingFilterType == null) {\n defaultFloatingFilterType = 'agReadOnlyFloatingFilter';\n }\n var params = {\n column: column,\n filterParams: finalFilterParams,\n currentParentModel: function () { return _this.getCurrentFloatingFilterParentModel(column); },\n parentFilterInstance: parentFilterInstance,\n showParentFilter: showParentFilter,\n suppressFilterButton: false // This one might be overridden from the colDef\n };\n return this.userComponentFactory.getFloatingFilterCompDetails(colDef, params, defaultFloatingFilterType);\n };\n FilterManager.prototype.getCurrentFloatingFilterParentModel = function (column) {\n var filterComponent = this.getFilterComponent(column, 'NO_UI', false);\n return filterComponent ? filterComponent.resolveNow(null, function (filter) { return filter && filter.getModel(); }) : null;\n };\n // destroys the filter, so it no longer takes part\n FilterManager.prototype.destroyFilter = function (column, source) {\n if (source === void 0) { source = 'api'; }\n var colId = column.getColId();\n var filterWrapper = this.allColumnFilters.get(colId);\n this.disposeColumnListener(colId);\n delete this.initialFilterModel[colId];\n if (filterWrapper) {\n this.disposeFilterWrapper(filterWrapper, source);\n this.onFilterChanged({\n columns: [column],\n source: 'api',\n });\n }\n };\n FilterManager.prototype.disposeColumnListener = function (colId) {\n var columnListener = this.allColumnListeners.get(colId);\n if (columnListener) {\n this.allColumnListeners.delete(colId);\n columnListener();\n }\n };\n FilterManager.prototype.disposeFilterWrapper = function (filterWrapper, source) {\n var _this = this;\n filterWrapper.filterPromise.then(function (filter) {\n _this.getContext().destroyBean(filter);\n filterWrapper.column.setFilterActive(false, 'filterDestroyed');\n _this.allColumnFilters.delete(filterWrapper.column.getColId());\n var event = {\n type: Events.EVENT_FILTER_DESTROYED,\n source: source,\n column: filterWrapper.column,\n };\n _this.eventService.dispatchEvent(event);\n });\n };\n FilterManager.prototype.filterModifiedCallbackFactory = function (filter, column) {\n var _this = this;\n return function () {\n var event = {\n type: Events.EVENT_FILTER_MODIFIED,\n column: column,\n filterInstance: filter,\n };\n _this.eventService.dispatchEvent(event);\n };\n };\n FilterManager.prototype.filterChangedCallbackFactory = function (filter, column) {\n var _this = this;\n return function (additionalEventAttributes) {\n var _a;\n var source = (_a = additionalEventAttributes === null || additionalEventAttributes === void 0 ? void 0 : additionalEventAttributes.source) !== null && _a !== void 0 ? _a : 'api';\n var params = {\n filter: filter,\n additionalEventAttributes: additionalEventAttributes,\n columns: [column],\n source: source,\n };\n _this.callOnFilterChangedOutsideRenderCycle(params);\n };\n };\n FilterManager.prototype.checkDestroyFilter = function (colId) {\n var _this = this;\n var filterWrapper = this.allColumnFilters.get(colId);\n if (!filterWrapper) {\n return;\n }\n var column = filterWrapper.column;\n var compDetails = (column.isFilterAllowed()\n ? this.createFilterInstance(column)\n : { compDetails: null }).compDetails;\n // Case when filter component changes\n if (this.areFilterCompsDifferent(filterWrapper.compDetails, compDetails)) {\n this.destroyFilter(column, 'paramsUpdated');\n return;\n }\n // Case when filter params changes\n var newFilterParams = column.getColDef().filterParams;\n // When filter wrapper does not have promise to retrieve FilterComp, destroy\n if (!filterWrapper.filterPromise) {\n this.destroyFilter(column, 'paramsUpdated');\n return;\n }\n // Otherwise - Check for refresh method before destruction\n // If refresh() method is implemented - call it and destroy filter if it returns false\n // Otherwise - do nothing ( filter will not be destroyed - we assume new params are compatible with old ones )\n filterWrapper.filterPromise.then(function (filter) {\n var shouldRefreshFilter = (filter === null || filter === void 0 ? void 0 : filter.refresh) ? filter.refresh(__assign$g(__assign$g(__assign$g({}, _this.createFilterParams(column, column.getColDef())), { filterModifiedCallback: _this.filterModifiedCallbackFactory(filter, column), filterChangedCallback: _this.filterChangedCallbackFactory(filter, column), doesRowPassOtherFilter: function (node) { return _this.doesRowPassOtherFilters(filter, node); } }), newFilterParams)) : true;\n // framework wrapper always implements optional methods, but returns null if no underlying method\n if (shouldRefreshFilter === false) {\n _this.destroyFilter(column, 'paramsUpdated');\n }\n });\n };\n FilterManager.prototype.setColumnFilterWrapper = function (column, filterWrapper) {\n var _this = this;\n var colId = column.getColId();\n this.allColumnFilters.set(colId, filterWrapper);\n this.allColumnListeners.set(colId, this.addManagedListener(column, Column.EVENT_COL_DEF_CHANGED, function () { return _this.checkDestroyFilter(colId); }));\n };\n FilterManager.prototype.areFilterCompsDifferent = function (oldCompDetails, newCompDetails) {\n if (!newCompDetails || !oldCompDetails) {\n return true;\n }\n var oldComponentClass = oldCompDetails.componentClass;\n var newComponentClass = newCompDetails.componentClass;\n var isSameComponentClass = oldComponentClass === newComponentClass ||\n // react hooks returns new wrappers, so check nested render method\n ((oldComponentClass === null || oldComponentClass === void 0 ? void 0 : oldComponentClass.render) && (newComponentClass === null || newComponentClass === void 0 ? void 0 : newComponentClass.render) &&\n oldComponentClass.render === newComponentClass.render);\n return !isSameComponentClass;\n };\n FilterManager.prototype.getAdvancedFilterModel = function () {\n return this.isAdvancedFilterEnabled() ? this.advancedFilterService.getModel() : null;\n };\n FilterManager.prototype.setAdvancedFilterModel = function (expression) {\n if (!this.isAdvancedFilterEnabled()) {\n return;\n }\n if (this.dataTypeService.isPendingInference()) {\n this.advancedFilterModelUpdateQueue.push(expression);\n return;\n }\n this.advancedFilterService.setModel(expression !== null && expression !== void 0 ? expression : null);\n this.onFilterChanged({ source: 'advancedFilter' });\n };\n FilterManager.prototype.showAdvancedFilterBuilder = function (source) {\n if (!this.isAdvancedFilterEnabled()) {\n return;\n }\n this.advancedFilterService.getCtrl().toggleFilterBuilder(source, true);\n };\n FilterManager.prototype.updateAdvancedFilterColumns = function () {\n if (!this.isAdvancedFilterEnabled()) {\n return;\n }\n if (this.advancedFilterService.updateValidity()) {\n this.onFilterChanged({ source: 'advancedFilter' });\n }\n };\n FilterManager.prototype.hasFloatingFilters = function () {\n if (this.isAdvancedFilterEnabled()) {\n return false;\n }\n var gridColumns = this.columnModel.getAllGridColumns();\n return gridColumns.some(function (col) { return col.getColDef().floatingFilter; });\n };\n FilterManager.prototype.getFilterInstance = function (key, callback) {\n if (this.isAdvancedFilterEnabled()) {\n this.warnAdvancedFilters();\n return undefined;\n }\n var res = this.getFilterInstanceImpl(key, function (instance) {\n if (!callback) {\n return;\n }\n var unwrapped = unwrapUserComp(instance);\n callback(unwrapped);\n });\n var unwrapped = unwrapUserComp(res);\n return unwrapped;\n };\n FilterManager.prototype.getColumnFilterInstance = function (key) {\n var _this = this;\n return new Promise(function (resolve) {\n _this.getFilterInstance(key, function (filter) {\n resolve(filter);\n });\n });\n };\n FilterManager.prototype.getFilterInstanceImpl = function (key, callback) {\n var column = this.columnModel.getPrimaryColumn(key);\n if (!column) {\n return undefined;\n }\n var filterPromise = this.getFilterComponent(column, 'NO_UI');\n var currentValue = filterPromise && filterPromise.resolveNow(null, function (filterComp) { return filterComp; });\n if (currentValue) {\n setTimeout(callback, 0, currentValue);\n }\n else if (filterPromise) {\n filterPromise.then(function (comp) {\n callback(comp);\n });\n }\n return currentValue;\n };\n FilterManager.prototype.warnAdvancedFilters = function () {\n warnOnce('Column Filter API methods have been disabled as Advanced Filters are enabled.');\n };\n FilterManager.prototype.setupAdvancedFilterHeaderComp = function (eCompToInsertBefore) {\n var _a;\n (_a = this.advancedFilterService) === null || _a === void 0 ? void 0 : _a.getCtrl().setupHeaderComp(eCompToInsertBefore);\n };\n FilterManager.prototype.getHeaderRowCount = function () {\n return this.isAdvancedFilterHeaderActive() ? 1 : 0;\n };\n FilterManager.prototype.getHeaderHeight = function () {\n return this.isAdvancedFilterHeaderActive() ? this.advancedFilterService.getCtrl().getHeaderHeight() : 0;\n };\n FilterManager.prototype.processFilterModelUpdateQueue = function () {\n var _this = this;\n this.filterModelUpdateQueue.forEach(function (_a) {\n var model = _a.model, source = _a.source;\n return _this.setFilterModel(model, source);\n });\n this.filterModelUpdateQueue = [];\n this.columnFilterModelUpdateQueue.forEach(function (_a) {\n var key = _a.key, model = _a.model, resolve = _a.resolve;\n _this.setColumnFilterModel(key, model).then(function () { return resolve(); });\n });\n this.columnFilterModelUpdateQueue = [];\n this.advancedFilterModelUpdateQueue.forEach(function (model) { return _this.setAdvancedFilterModel(model); });\n this.advancedFilterModelUpdateQueue = [];\n };\n FilterManager.prototype.getColumnFilterModel = function (key) {\n var filterWrapper = this.getFilterWrapper(key);\n return filterWrapper ? this.getModelFromFilterWrapper(filterWrapper) : null;\n };\n FilterManager.prototype.setColumnFilterModel = function (key, model) {\n if (this.isAdvancedFilterEnabled()) {\n this.warnAdvancedFilters();\n return Promise.resolve();\n }\n if (this.dataTypeService.isPendingInference()) {\n var resolve_1 = function () { };\n var promise = new Promise(function (res) {\n resolve_1 = res;\n });\n this.columnFilterModelUpdateQueue.push({ key: key, model: model, resolve: resolve_1 });\n return promise;\n }\n var column = this.columnModel.getPrimaryColumn(key);\n var filterWrapper = column ? this.getOrCreateFilterWrapper(column, 'NO_UI') : null;\n var convertPromise = function (promise) {\n return new Promise(function (resolve) {\n promise.then(function (result) { return resolve(result); });\n });\n };\n return filterWrapper ? convertPromise(this.setModelOnFilterWrapper(filterWrapper.filterPromise, model)) : Promise.resolve();\n };\n FilterManager.prototype.getFilterWrapper = function (key) {\n var _a;\n var column = this.columnModel.getPrimaryColumn(key);\n return column ? (_a = this.cachedFilter(column)) !== null && _a !== void 0 ? _a : null : null;\n };\n FilterManager.prototype.destroy = function () {\n var _this = this;\n _super.prototype.destroy.call(this);\n this.allColumnFilters.forEach(function (filterWrapper) { return _this.disposeFilterWrapper(filterWrapper, 'gridDestroyed'); });\n // don't need to destroy the listeners as they are managed listeners\n this.allColumnListeners.clear();\n };\n __decorate$22([\n Autowired('valueService')\n ], FilterManager.prototype, \"valueService\", void 0);\n __decorate$22([\n Autowired('columnModel')\n ], FilterManager.prototype, \"columnModel\", void 0);\n __decorate$22([\n Autowired('rowModel')\n ], FilterManager.prototype, \"rowModel\", void 0);\n __decorate$22([\n Autowired('userComponentFactory')\n ], FilterManager.prototype, \"userComponentFactory\", void 0);\n __decorate$22([\n Autowired('rowRenderer')\n ], FilterManager.prototype, \"rowRenderer\", void 0);\n __decorate$22([\n Autowired('dataTypeService')\n ], FilterManager.prototype, \"dataTypeService\", void 0);\n __decorate$22([\n Autowired('quickFilterService')\n ], FilterManager.prototype, \"quickFilterService\", void 0);\n __decorate$22([\n Optional('advancedFilterService')\n ], FilterManager.prototype, \"advancedFilterService\", void 0);\n __decorate$22([\n PostConstruct\n ], FilterManager.prototype, \"init\", null);\n FilterManager = __decorate$22([\n Bean('filterManager')\n ], FilterManager);\n return FilterManager;\n}(BeanStub));\n\nvar __extends$2g = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar AbstractHeaderCellComp = /** @class */ (function (_super) {\n __extends$2g(AbstractHeaderCellComp, _super);\n function AbstractHeaderCellComp(template, ctrl) {\n var _this = _super.call(this, template) || this;\n _this.ctrl = ctrl;\n return _this;\n }\n AbstractHeaderCellComp.prototype.getCtrl = function () {\n return this.ctrl;\n };\n return AbstractHeaderCellComp;\n}(Component));\n\nvar __extends$2f = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$21 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar HeaderFilterCellComp = /** @class */ (function (_super) {\n __extends$2f(HeaderFilterCellComp, _super);\n function HeaderFilterCellComp(ctrl) {\n return _super.call(this, HeaderFilterCellComp.TEMPLATE, ctrl) || this;\n }\n HeaderFilterCellComp.prototype.postConstruct = function () {\n var _this = this;\n var eGui = this.getGui();\n var compProxy = {\n addOrRemoveCssClass: function (cssClassName, on) { return _this.addOrRemoveCssClass(cssClassName, on); },\n addOrRemoveBodyCssClass: function (cssClassName, on) { return _this.eFloatingFilterBody.classList.toggle(cssClassName, on); },\n setButtonWrapperDisplayed: function (displayed) { return setDisplayed(_this.eButtonWrapper, displayed); },\n setCompDetails: function (compDetails) { return _this.setCompDetails(compDetails); },\n getFloatingFilterComp: function () { return _this.compPromise; },\n setWidth: function (width) { return eGui.style.width = width; },\n setMenuIcon: function (eIcon) { return _this.eButtonShowMainFilter.appendChild(eIcon); }\n };\n this.ctrl.setComp(compProxy, eGui, this.eButtonShowMainFilter, this.eFloatingFilterBody);\n };\n HeaderFilterCellComp.prototype.setCompDetails = function (compDetails) {\n var _this = this;\n if (!compDetails) {\n this.destroyFloatingFilterComp();\n this.compPromise = null;\n return;\n }\n // because we are providing defaultFloatingFilterType, we know it will never be undefined;\n this.compPromise = compDetails.newAgStackInstance();\n this.compPromise.then(function (comp) { return _this.afterCompCreated(comp); });\n };\n HeaderFilterCellComp.prototype.destroyFloatingFilterComp = function () {\n if (this.floatingFilterComp) {\n this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui());\n this.floatingFilterComp = this.destroyBean(this.floatingFilterComp);\n }\n };\n HeaderFilterCellComp.prototype.afterCompCreated = function (comp) {\n if (!comp) {\n return;\n }\n if (!this.isAlive()) {\n this.destroyBean(comp);\n return;\n }\n this.destroyFloatingFilterComp();\n this.floatingFilterComp = comp;\n this.eFloatingFilterBody.appendChild(comp.getGui());\n if (comp.afterGuiAttached) {\n comp.afterGuiAttached();\n }\n };\n HeaderFilterCellComp.TEMPLATE = \"
\\n
\\n
\\n \\n
\\n
\";\n __decorate$21([\n RefSelector('eFloatingFilterBody')\n ], HeaderFilterCellComp.prototype, \"eFloatingFilterBody\", void 0);\n __decorate$21([\n RefSelector('eButtonWrapper')\n ], HeaderFilterCellComp.prototype, \"eButtonWrapper\", void 0);\n __decorate$21([\n RefSelector('eButtonShowMainFilter')\n ], HeaderFilterCellComp.prototype, \"eButtonShowMainFilter\", void 0);\n __decorate$21([\n PostConstruct\n ], HeaderFilterCellComp.prototype, \"postConstruct\", null);\n __decorate$21([\n PreDestroy\n ], HeaderFilterCellComp.prototype, \"destroyFloatingFilterComp\", null);\n return HeaderFilterCellComp;\n}(AbstractHeaderCellComp));\n\nvar __extends$2e = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$20 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar LayoutCssClasses;\n(function (LayoutCssClasses) {\n LayoutCssClasses[\"AUTO_HEIGHT\"] = \"ag-layout-auto-height\";\n LayoutCssClasses[\"NORMAL\"] = \"ag-layout-normal\";\n LayoutCssClasses[\"PRINT\"] = \"ag-layout-print\";\n})(LayoutCssClasses || (LayoutCssClasses = {}));\nvar LayoutFeature = /** @class */ (function (_super) {\n __extends$2e(LayoutFeature, _super);\n function LayoutFeature(view) {\n var _this = _super.call(this) || this;\n _this.view = view;\n return _this;\n }\n LayoutFeature.prototype.postConstruct = function () {\n this.addManagedPropertyListener('domLayout', this.updateLayoutClasses.bind(this));\n this.updateLayoutClasses();\n };\n LayoutFeature.prototype.updateLayoutClasses = function () {\n var domLayout = this.getDomLayout();\n var params = {\n autoHeight: domLayout === 'autoHeight',\n normal: domLayout === 'normal',\n print: domLayout === 'print'\n };\n var cssClass = params.autoHeight ? LayoutCssClasses.AUTO_HEIGHT :\n params.print ? LayoutCssClasses.PRINT : LayoutCssClasses.NORMAL;\n this.view.updateLayoutClasses(cssClass, params);\n };\n // returns either 'print', 'autoHeight' or 'normal' (normal is the default)\n LayoutFeature.prototype.getDomLayout = function () {\n var _a;\n var domLayout = (_a = this.gridOptionsService.get('domLayout')) !== null && _a !== void 0 ? _a : 'normal';\n var validLayouts = ['normal', 'print', 'autoHeight'];\n if (validLayouts.indexOf(domLayout) === -1) {\n warnOnce(\"\".concat(domLayout, \" is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.\"));\n return 'normal';\n }\n return domLayout;\n };\n __decorate$20([\n PostConstruct\n ], LayoutFeature.prototype, \"postConstruct\", null);\n return LayoutFeature;\n}(BeanStub));\n\nvar __extends$2d = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$f = ( false) || function () {\n __assign$f = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$f.apply(this, arguments);\n};\nvar __decorate$1$ = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ScrollDirection;\n(function (ScrollDirection) {\n ScrollDirection[ScrollDirection[\"Vertical\"] = 0] = \"Vertical\";\n ScrollDirection[ScrollDirection[\"Horizontal\"] = 1] = \"Horizontal\";\n})(ScrollDirection || (ScrollDirection = {}));\nvar ScrollSource;\n(function (ScrollSource) {\n ScrollSource[ScrollSource[\"Container\"] = 0] = \"Container\";\n ScrollSource[ScrollSource[\"FakeContainer\"] = 1] = \"FakeContainer\";\n})(ScrollSource || (ScrollSource = {}));\nvar GridBodyScrollFeature = /** @class */ (function (_super) {\n __extends$2d(GridBodyScrollFeature, _super);\n function GridBodyScrollFeature(eBodyViewport) {\n var _this = _super.call(this) || this;\n _this.lastScrollSource = [null, null];\n _this.scrollLeft = -1;\n _this.nextScrollTop = -1;\n _this.scrollTop = -1;\n // Used to provide approximate values of scrollTop and offsetHeight\n // without forcing the browser to recalculate styles.\n _this.lastOffsetHeight = -1;\n _this.lastScrollTop = -1;\n _this.eBodyViewport = eBodyViewport;\n _this.resetLastHScrollDebounced = debounce(function () { return _this.lastScrollSource[ScrollDirection.Horizontal] = null; }, 500);\n _this.resetLastVScrollDebounced = debounce(function () { return _this.lastScrollSource[ScrollDirection.Vertical] = null; }, 500);\n return _this;\n }\n GridBodyScrollFeature.prototype.postConstruct = function () {\n var _this = this;\n this.enableRtl = this.gridOptionsService.get('enableRtl');\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, this.onDisplayedColumnsWidthChanged.bind(this));\n this.ctrlsService.whenReady(function (p) {\n _this.centerRowContainerCtrl = p.centerRowContainerCtrl;\n _this.onDisplayedColumnsWidthChanged();\n _this.addScrollListener();\n });\n };\n GridBodyScrollFeature.prototype.addScrollListener = function () {\n var fakeHScroll = this.ctrlsService.getFakeHScrollComp();\n var fakeVScroll = this.ctrlsService.getFakeVScrollComp();\n this.addManagedListener(this.centerRowContainerCtrl.getViewportElement(), 'scroll', this.onHScroll.bind(this));\n fakeHScroll.onScrollCallback(this.onFakeHScroll.bind(this));\n var isDebounce = this.gridOptionsService.get('debounceVerticalScrollbar');\n var onVScroll = isDebounce ?\n debounce(this.onVScroll.bind(this), 100) : this.onVScroll.bind(this);\n var onFakeVScroll = isDebounce ?\n debounce(this.onFakeVScroll.bind(this), 100) : this.onFakeVScroll.bind(this);\n this.addManagedListener(this.eBodyViewport, 'scroll', onVScroll);\n fakeVScroll.onScrollCallback(onFakeVScroll);\n };\n GridBodyScrollFeature.prototype.onDisplayedColumnsWidthChanged = function () {\n if (this.enableRtl) {\n // because RTL is all backwards, a change in the width of the row\n // can cause a change in the scroll position, without a scroll event,\n // because the scroll position in RTL is a function that depends on\n // the width. to be convinced of this, take out this line, enable RTL,\n // scroll all the way to the left and then resize a column\n this.horizontallyScrollHeaderCenterAndFloatingCenter();\n }\n };\n GridBodyScrollFeature.prototype.horizontallyScrollHeaderCenterAndFloatingCenter = function (scrollLeft) {\n // when doing RTL, this method gets called once prematurely\n var notYetInitialised = this.centerRowContainerCtrl == null;\n if (notYetInitialised) {\n return;\n }\n if (scrollLeft === undefined) {\n scrollLeft = this.centerRowContainerCtrl.getCenterViewportScrollLeft();\n }\n var offset = this.enableRtl ? scrollLeft : -scrollLeft;\n var topCenterContainer = this.ctrlsService.getTopCenterRowContainerCtrl();\n var stickyTopCenterContainer = this.ctrlsService.getStickyTopCenterRowContainerCtrl();\n var bottomCenterContainer = this.ctrlsService.getBottomCenterRowContainerCtrl();\n var fakeHScroll = this.ctrlsService.getFakeHScrollComp();\n var centerHeaderContainer = this.ctrlsService.getHeaderRowContainerCtrl();\n centerHeaderContainer.setHorizontalScroll(-offset);\n bottomCenterContainer.setContainerTranslateX(offset);\n topCenterContainer.setContainerTranslateX(offset);\n stickyTopCenterContainer.setContainerTranslateX(offset);\n var centerViewport = this.centerRowContainerCtrl.getViewportElement();\n var isCenterViewportLastHorizontal = this.lastScrollSource[ScrollDirection.Horizontal] === ScrollSource.Container;\n scrollLeft = Math.abs(scrollLeft);\n if (isCenterViewportLastHorizontal) {\n fakeHScroll.setScrollPosition(scrollLeft);\n }\n else {\n setScrollLeft(centerViewport, scrollLeft, this.enableRtl);\n }\n };\n GridBodyScrollFeature.prototype.isControllingScroll = function (source, direction) {\n if (this.lastScrollSource[direction] == null) {\n this.lastScrollSource[direction] = source;\n return true;\n }\n return this.lastScrollSource[direction] === source;\n };\n GridBodyScrollFeature.prototype.onFakeHScroll = function () {\n if (!this.isControllingScroll(ScrollSource.FakeContainer, ScrollDirection.Horizontal)) {\n return;\n }\n this.onHScrollCommon(ScrollSource.FakeContainer);\n };\n GridBodyScrollFeature.prototype.onHScroll = function () {\n if (!this.isControllingScroll(ScrollSource.Container, ScrollDirection.Horizontal)) {\n return;\n }\n this.onHScrollCommon(ScrollSource.Container);\n };\n GridBodyScrollFeature.prototype.onHScrollCommon = function (source) {\n var centerContainerViewport = this.centerRowContainerCtrl.getViewportElement();\n var scrollLeft = centerContainerViewport.scrollLeft;\n if (this.shouldBlockScrollUpdate(ScrollDirection.Horizontal, scrollLeft, true)) {\n return;\n }\n var newScrollLeft;\n if (source === ScrollSource.Container) {\n newScrollLeft = getScrollLeft(centerContainerViewport, this.enableRtl);\n }\n else {\n newScrollLeft = this.ctrlsService.getFakeHScrollComp().getScrollPosition();\n }\n // we do Math.round() rather than Math.floor(), to mirror how scroll values are applied.\n // eg if a scale is applied (ie user has zoomed the browser), then applying scroll=200\n // could result in 199.88, which then floor(199.88) = 199, however round(199.88) = 200.\n // initially Math.floor() was used, however this caused (almost) infinite loop with aligned grids,\n // as the scroll would move 1px at at time bouncing from one grid to the next (eg one grid would cause\n // scroll to 200px, the next to 199px, then the first back to 198px and so on).\n this.doHorizontalScroll(Math.round(newScrollLeft));\n this.resetLastHScrollDebounced();\n };\n GridBodyScrollFeature.prototype.onFakeVScroll = function () {\n if (!this.isControllingScroll(ScrollSource.FakeContainer, ScrollDirection.Vertical)) {\n return;\n }\n this.onVScrollCommon(ScrollSource.FakeContainer);\n };\n GridBodyScrollFeature.prototype.onVScroll = function () {\n if (!this.isControllingScroll(ScrollSource.Container, ScrollDirection.Vertical)) {\n return;\n }\n this.onVScrollCommon(ScrollSource.Container);\n };\n GridBodyScrollFeature.prototype.onVScrollCommon = function (source) {\n var scrollTop;\n if (source === ScrollSource.Container) {\n scrollTop = this.eBodyViewport.scrollTop;\n }\n else {\n scrollTop = this.ctrlsService.getFakeVScrollComp().getScrollPosition();\n }\n if (this.shouldBlockScrollUpdate(ScrollDirection.Vertical, scrollTop, true)) {\n return;\n }\n this.animationFrameService.setScrollTop(scrollTop);\n this.nextScrollTop = scrollTop;\n if (source === ScrollSource.Container) {\n this.ctrlsService.getFakeVScrollComp().setScrollPosition(scrollTop);\n }\n else {\n this.eBodyViewport.scrollTop = scrollTop;\n }\n // the `scrollGridIfNeeded` will recalculate the rows to be rendered by the grid\n // so it should only be called after `eBodyViewport` has been scrolled to the correct\n // position, otherwise the `first` and `last` row could be miscalculated.\n if (this.gridOptionsService.get('suppressAnimationFrame')) {\n this.scrollGridIfNeeded();\n }\n else {\n this.animationFrameService.schedule();\n }\n this.resetLastVScrollDebounced();\n };\n GridBodyScrollFeature.prototype.doHorizontalScroll = function (scrollLeft) {\n var fakeScrollLeft = this.ctrlsService.getFakeHScrollComp().getScrollPosition();\n if (this.scrollLeft === scrollLeft && scrollLeft === fakeScrollLeft) {\n return;\n }\n this.scrollLeft = scrollLeft;\n this.fireScrollEvent(ScrollDirection.Horizontal);\n this.horizontallyScrollHeaderCenterAndFloatingCenter(scrollLeft);\n this.centerRowContainerCtrl.onHorizontalViewportChanged(true);\n };\n GridBodyScrollFeature.prototype.fireScrollEvent = function (direction) {\n var _this = this;\n var bodyScrollEvent = {\n type: Events.EVENT_BODY_SCROLL,\n direction: direction === ScrollDirection.Horizontal ? 'horizontal' : 'vertical',\n left: this.scrollLeft,\n top: this.scrollTop\n };\n this.eventService.dispatchEvent(bodyScrollEvent);\n window.clearTimeout(this.scrollTimer);\n this.scrollTimer = undefined;\n this.scrollTimer = window.setTimeout(function () {\n var bodyScrollEndEvent = __assign$f(__assign$f({}, bodyScrollEvent), { type: Events.EVENT_BODY_SCROLL_END });\n _this.eventService.dispatchEvent(bodyScrollEndEvent);\n }, 100);\n };\n GridBodyScrollFeature.prototype.shouldBlockScrollUpdate = function (direction, scrollTo, touchOnly) {\n // touch devices allow elastic scroll - which temporally scrolls the panel outside of the viewport\n // (eg user uses touch to go to the left of the grid, but drags past the left, the rows will actually\n // scroll past the left until the user releases the mouse). when this happens, we want ignore the scroll,\n // as otherwise it was causing the rows and header to flicker.\n if (touchOnly === void 0) { touchOnly = false; }\n // sometimes when scrolling, we got values that extended the maximum scroll allowed. we used to\n // ignore these scrolls. problem is the max scroll position could be skipped (eg the previous scroll event\n // could be 10px before the max position, and then current scroll event could be 20px after the max position).\n // if we just ignored the last event, we would be setting the scroll to 10px before the max position, when in\n // actual fact the user has exceeded the max scroll and thus scroll should be set to the max.\n if (touchOnly && !isIOSUserAgent()) {\n return false;\n }\n if (direction === ScrollDirection.Vertical) {\n return this.shouldBlockVerticalScroll(scrollTo);\n }\n return this.shouldBlockHorizontalScroll(scrollTo);\n };\n GridBodyScrollFeature.prototype.shouldBlockVerticalScroll = function (scrollTo) {\n var clientHeight = getInnerHeight(this.eBodyViewport);\n var scrollHeight = this.eBodyViewport.scrollHeight;\n if (scrollTo < 0 || (scrollTo + clientHeight > scrollHeight)) {\n return true;\n }\n return false;\n };\n GridBodyScrollFeature.prototype.shouldBlockHorizontalScroll = function (scrollTo) {\n var clientWidth = this.centerRowContainerCtrl.getCenterWidth();\n var scrollWidth = this.centerRowContainerCtrl.getViewportElement().scrollWidth;\n if (this.enableRtl && isRtlNegativeScroll()) {\n if (scrollTo > 0) {\n return true;\n }\n }\n else if (scrollTo < 0) {\n return true;\n }\n if (Math.abs(scrollTo) + clientWidth > scrollWidth) {\n return true;\n }\n return false;\n };\n GridBodyScrollFeature.prototype.redrawRowsAfterScroll = function () {\n this.fireScrollEvent(ScrollDirection.Vertical);\n };\n // this is to cater for AG-3274, where grid is removed from the dom and then inserted back in again.\n // (which happens with some implementations of tabbing). this can result in horizontal scroll getting\n // reset back to the left, however no scroll event is fired. so we need to get header to also scroll\n // back to the left to be kept in sync.\n // adding and removing the grid from the DOM both resets the scroll position and\n // triggers a resize event, so notify listeners if the scroll position has changed\n GridBodyScrollFeature.prototype.checkScrollLeft = function () {\n if (this.scrollLeft !== this.centerRowContainerCtrl.getCenterViewportScrollLeft()) {\n this.onHScrollCommon(ScrollSource.Container);\n }\n };\n GridBodyScrollFeature.prototype.scrollGridIfNeeded = function () {\n var frameNeeded = this.scrollTop != this.nextScrollTop;\n if (frameNeeded) {\n this.scrollTop = this.nextScrollTop;\n this.redrawRowsAfterScroll();\n }\n return frameNeeded;\n };\n // called by scrollHorizontally method and alignedGridsService\n GridBodyScrollFeature.prototype.setHorizontalScrollPosition = function (hScrollPosition, fromAlignedGridsService) {\n if (fromAlignedGridsService === void 0) { fromAlignedGridsService = false; }\n var minScrollLeft = 0;\n var maxScrollLeft = this.centerRowContainerCtrl.getViewportElement().scrollWidth - this.centerRowContainerCtrl.getCenterWidth();\n // if this is call is coming from the alignedGridsService, we don't need to validate the\n // scroll, because it has already been validated by the grid firing the scroll event.\n if (!fromAlignedGridsService && this.shouldBlockScrollUpdate(ScrollDirection.Horizontal, hScrollPosition)) {\n if (this.enableRtl && isRtlNegativeScroll()) {\n hScrollPosition = hScrollPosition > 0 ? 0 : maxScrollLeft;\n }\n else {\n hScrollPosition = Math.min(Math.max(hScrollPosition, minScrollLeft), maxScrollLeft);\n }\n }\n setScrollLeft(this.centerRowContainerCtrl.getViewportElement(), Math.abs(hScrollPosition), this.enableRtl);\n // we need to manually do the event handling (rather than wait for the event)\n // for the alignedGridsService, as if we don't, the aligned grid service gets\n // notified async, and then it's 'consuming' flag doesn't get used right, and\n // we can end up with an infinite loop\n this.doHorizontalScroll(hScrollPosition);\n };\n GridBodyScrollFeature.prototype.setVerticalScrollPosition = function (vScrollPosition) {\n this.eBodyViewport.scrollTop = vScrollPosition;\n };\n GridBodyScrollFeature.prototype.getVScrollPosition = function () {\n this.lastScrollTop = this.eBodyViewport.scrollTop;\n this.lastOffsetHeight = this.eBodyViewport.offsetHeight;\n var result = {\n top: this.lastScrollTop,\n bottom: this.lastScrollTop + this.lastOffsetHeight\n };\n return result;\n };\n /** Get an approximate scroll position that returns the last real value read.\n * This is useful for avoiding repeated DOM reads that force the browser to recalculate styles.\n * This can have big performance improvements but may not be 100% accurate so only use if this is acceptable.\n */\n GridBodyScrollFeature.prototype.getApproximateVScollPosition = function () {\n if (this.lastScrollTop >= 0 && this.lastOffsetHeight >= 0) {\n return {\n top: this.scrollTop,\n bottom: this.scrollTop + this.lastOffsetHeight\n };\n }\n return this.getVScrollPosition();\n };\n GridBodyScrollFeature.prototype.getHScrollPosition = function () {\n return this.centerRowContainerCtrl.getHScrollPosition();\n };\n GridBodyScrollFeature.prototype.isHorizontalScrollShowing = function () {\n return this.centerRowContainerCtrl.isHorizontalScrollShowing();\n };\n // called by the headerRootComp and moveColumnController\n GridBodyScrollFeature.prototype.scrollHorizontally = function (pixels) {\n var oldScrollPosition = this.centerRowContainerCtrl.getViewportElement().scrollLeft;\n this.setHorizontalScrollPosition(oldScrollPosition + pixels);\n return this.centerRowContainerCtrl.getViewportElement().scrollLeft - oldScrollPosition;\n };\n // gets called by rowRenderer when new data loaded, as it will want to scroll to the top\n GridBodyScrollFeature.prototype.scrollToTop = function () {\n this.eBodyViewport.scrollTop = 0;\n };\n // Valid values for position are bottom, middle and top\n GridBodyScrollFeature.prototype.ensureNodeVisible = function (comparator, position) {\n if (position === void 0) { position = null; }\n // look for the node index we want to display\n var rowCount = this.rowModel.getRowCount();\n var indexToSelect = -1;\n // go through all the nodes, find the one we want to show\n for (var i = 0; i < rowCount; i++) {\n var node = this.rowModel.getRow(i);\n if (typeof comparator === 'function') {\n // Have to assert type here, as type could be TData & Function\n var predicate = comparator;\n if (node && predicate(node)) {\n indexToSelect = i;\n break;\n }\n }\n else {\n // check object equality against node and data\n if (comparator === node || comparator === node.data) {\n indexToSelect = i;\n break;\n }\n }\n }\n if (indexToSelect >= 0) {\n this.ensureIndexVisible(indexToSelect, position);\n }\n };\n // Valid values for position are bottom, middle and top\n // position should be {'top','middle','bottom', or undefined/null}.\n // if undefined/null, then the grid will to the minimal amount of scrolling,\n // eg if grid needs to scroll up, it scrolls until row is on top,\n // if grid needs to scroll down, it scrolls until row is on bottom,\n // if row is already in view, grid does not scroll\n GridBodyScrollFeature.prototype.ensureIndexVisible = function (index, position) {\n var _this = this;\n // if for print or auto height, everything is always visible\n if (this.gridOptionsService.isDomLayout('print')) {\n return;\n }\n var rowCount = this.paginationProxy.getRowCount();\n if (typeof index !== 'number' || index < 0 || index >= rowCount) {\n console.warn('AG Grid: Invalid row index for ensureIndexVisible: ' + index);\n return;\n }\n var isPaging = this.gridOptionsService.get('pagination');\n var paginationPanelEnabled = isPaging && !this.gridOptionsService.get('suppressPaginationPanel');\n this.getFrameworkOverrides().wrapIncoming(function () {\n if (!paginationPanelEnabled) {\n _this.paginationProxy.goToPageWithIndex(index);\n }\n var gridBodyCtrl = _this.ctrlsService.getGridBodyCtrl();\n var stickyTopHeight = gridBodyCtrl.getStickyTopHeight();\n var rowNode = _this.paginationProxy.getRow(index);\n var rowGotShiftedDuringOperation;\n do {\n var startingRowTop = rowNode.rowTop;\n var startingRowHeight = rowNode.rowHeight;\n var paginationOffset = _this.paginationProxy.getPixelOffset();\n var rowTopPixel = rowNode.rowTop - paginationOffset;\n var rowBottomPixel = rowTopPixel + rowNode.rowHeight;\n var scrollPosition = _this.getVScrollPosition();\n var heightOffset = _this.heightScaler.getDivStretchOffset();\n var vScrollTop = scrollPosition.top + heightOffset;\n var vScrollBottom = scrollPosition.bottom + heightOffset;\n var viewportHeight = vScrollBottom - vScrollTop;\n // work out the pixels for top, middle and bottom up front,\n // make the if/else below easier to read\n var pxTop = _this.heightScaler.getScrollPositionForPixel(rowTopPixel);\n var pxBottom = _this.heightScaler.getScrollPositionForPixel(rowBottomPixel - viewportHeight);\n // make sure if middle, the row is not outside the top of the grid\n var pxMiddle = Math.min((pxTop + pxBottom) / 2, rowTopPixel);\n var rowAboveViewport = (vScrollTop + stickyTopHeight) > rowTopPixel;\n var rowBelowViewport = vScrollBottom < rowBottomPixel;\n var newScrollPosition = null;\n if (position === 'top') {\n newScrollPosition = pxTop;\n }\n else if (position === 'bottom') {\n newScrollPosition = pxBottom;\n }\n else if (position === 'middle') {\n newScrollPosition = pxMiddle;\n }\n else if (rowAboveViewport) {\n // if row is before, scroll up with row at top\n newScrollPosition = pxTop - stickyTopHeight;\n }\n else if (rowBelowViewport) {\n // if row is after, scroll down with row at bottom\n newScrollPosition = pxBottom;\n }\n if (newScrollPosition !== null) {\n _this.setVerticalScrollPosition(newScrollPosition);\n _this.rowRenderer.redraw({ afterScroll: true });\n }\n // the row can get shifted if during the rendering (during rowRenderer.redraw()),\n // the height of a row changes due to lazy calculation of row heights when using\n // colDef.autoHeight or gridOptions.getRowHeight.\n // if row was shifted, then the position we scrolled to is incorrect.\n rowGotShiftedDuringOperation = (startingRowTop !== rowNode.rowTop)\n || (startingRowHeight !== rowNode.rowHeight);\n } while (rowGotShiftedDuringOperation);\n // so when we return back to user, the cells have rendered\n _this.animationFrameService.flushAllFrames();\n });\n };\n GridBodyScrollFeature.prototype.ensureColumnVisible = function (key, position) {\n var _this = this;\n if (position === void 0) { position = 'auto'; }\n var column = this.columnModel.getGridColumn(key);\n if (!column) {\n return;\n }\n // calling ensureColumnVisible on a pinned column doesn't make sense\n if (column.isPinned()) {\n return;\n }\n // defensive\n if (!this.columnModel.isColumnDisplayed(column)) {\n return;\n }\n var newHorizontalScroll = this.getPositionedHorizontalScroll(column, position);\n this.getFrameworkOverrides().wrapIncoming(function () {\n if (newHorizontalScroll !== null) {\n _this.centerRowContainerCtrl.setCenterViewportScrollLeft(newHorizontalScroll);\n }\n // this will happen anyway, as the move will cause a 'scroll' event on the body, however\n // it is possible that the ensureColumnVisible method is called from within AG Grid and\n // the caller will need to have the columns rendered to continue, which will be before\n // the event has been worked on (which is the case for cell navigation).\n _this.centerRowContainerCtrl.onHorizontalViewportChanged();\n // so when we return back to user, the cells have rendered\n _this.animationFrameService.flushAllFrames();\n });\n };\n GridBodyScrollFeature.prototype.setScrollPosition = function (top, left) {\n var _this = this;\n this.getFrameworkOverrides().wrapIncoming(function () {\n _this.centerRowContainerCtrl.setCenterViewportScrollLeft(left);\n _this.setVerticalScrollPosition(top);\n _this.rowRenderer.redraw({ afterScroll: true });\n _this.animationFrameService.flushAllFrames();\n });\n };\n GridBodyScrollFeature.prototype.getPositionedHorizontalScroll = function (column, position) {\n var _a = this.isColumnOutsideViewport(column), columnBeforeStart = _a.columnBeforeStart, columnAfterEnd = _a.columnAfterEnd;\n var viewportTooSmallForColumn = this.centerRowContainerCtrl.getCenterWidth() < column.getActualWidth();\n var viewportWidth = this.centerRowContainerCtrl.getCenterWidth();\n var isRtl = this.enableRtl;\n var alignColToStart = (isRtl ? columnBeforeStart : columnAfterEnd) || viewportTooSmallForColumn;\n var alignColToEnd = isRtl ? columnAfterEnd : columnBeforeStart;\n if (position !== 'auto') {\n alignColToStart = position === 'start';\n alignColToEnd = position === 'end';\n }\n var isMiddle = position === 'middle';\n if (alignColToStart || alignColToEnd || isMiddle) {\n var _b = this.getColumnBounds(column), colLeft = _b.colLeft, colMiddle = _b.colMiddle, colRight = _b.colRight;\n if (isMiddle) {\n return colMiddle - viewportWidth / 2;\n }\n if (alignColToStart) {\n return isRtl ? colRight : colLeft;\n }\n return isRtl ? (colLeft - viewportWidth) : (colRight - viewportWidth);\n }\n return null;\n };\n GridBodyScrollFeature.prototype.isColumnOutsideViewport = function (column) {\n var _a = this.getViewportBounds(), viewportStart = _a.start, viewportEnd = _a.end;\n var _b = this.getColumnBounds(column), colLeft = _b.colLeft, colRight = _b.colRight;\n var isRtl = this.enableRtl;\n var columnBeforeStart = isRtl ? (viewportStart > colRight) : (viewportEnd < colRight);\n var columnAfterEnd = isRtl ? (viewportEnd < colLeft) : (viewportStart > colLeft);\n return { columnBeforeStart: columnBeforeStart, columnAfterEnd: columnAfterEnd };\n };\n GridBodyScrollFeature.prototype.getColumnBounds = function (column) {\n var isRtl = this.enableRtl;\n var bodyWidth = this.columnModel.getBodyContainerWidth();\n var colWidth = column.getActualWidth();\n var colLeft = column.getLeft();\n var multiplier = isRtl ? -1 : 1;\n var colLeftPixel = isRtl ? (bodyWidth - colLeft) : colLeft;\n var colRightPixel = colLeftPixel + colWidth * multiplier;\n var colMidPixel = colLeftPixel + colWidth / 2 * multiplier;\n return { colLeft: colLeftPixel, colMiddle: colMidPixel, colRight: colRightPixel };\n };\n GridBodyScrollFeature.prototype.getViewportBounds = function () {\n var viewportWidth = this.centerRowContainerCtrl.getCenterWidth();\n var scrollPosition = this.centerRowContainerCtrl.getCenterViewportScrollLeft();\n var viewportStartPixel = scrollPosition;\n var viewportEndPixel = viewportWidth + scrollPosition;\n return { start: viewportStartPixel, end: viewportEndPixel, width: viewportWidth };\n };\n __decorate$1$([\n Autowired('ctrlsService')\n ], GridBodyScrollFeature.prototype, \"ctrlsService\", void 0);\n __decorate$1$([\n Autowired('animationFrameService')\n ], GridBodyScrollFeature.prototype, \"animationFrameService\", void 0);\n __decorate$1$([\n Autowired('paginationProxy')\n ], GridBodyScrollFeature.prototype, \"paginationProxy\", void 0);\n __decorate$1$([\n Autowired('rowModel')\n ], GridBodyScrollFeature.prototype, \"rowModel\", void 0);\n __decorate$1$([\n Autowired('rowContainerHeightService')\n ], GridBodyScrollFeature.prototype, \"heightScaler\", void 0);\n __decorate$1$([\n Autowired('rowRenderer')\n ], GridBodyScrollFeature.prototype, \"rowRenderer\", void 0);\n __decorate$1$([\n Autowired('columnModel')\n ], GridBodyScrollFeature.prototype, \"columnModel\", void 0);\n __decorate$1$([\n PostConstruct\n ], GridBodyScrollFeature.prototype, \"postConstruct\", null);\n return GridBodyScrollFeature;\n}(BeanStub));\n\nvar __extends$2c = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$e = ( false) || function () {\n __assign$e = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$e.apply(this, arguments);\n};\nvar __decorate$1_ = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$s = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$n = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar RowDragFeature = /** @class */ (function (_super) {\n __extends$2c(RowDragFeature, _super);\n function RowDragFeature(eContainer) {\n var _this = _super.call(this) || this;\n _this.isMultiRowDrag = false;\n _this.eContainer = eContainer;\n return _this;\n }\n RowDragFeature.prototype.postConstruct = function () {\n var _this = this;\n if (this.gridOptionsService.isRowModelType('clientSide')) {\n this.clientSideRowModel = this.rowModel;\n }\n this.ctrlsService.whenReady(function () {\n var gridBodyCon = _this.ctrlsService.getGridBodyCtrl();\n _this.autoScrollService = new AutoScrollService({\n scrollContainer: gridBodyCon.getBodyViewportElement(),\n scrollAxis: 'y',\n getVerticalPosition: function () { return gridBodyCon.getScrollFeature().getVScrollPosition().top; },\n setVerticalPosition: function (position) { return gridBodyCon.getScrollFeature().setVerticalScrollPosition(position); },\n onScrollCallback: function () { _this.onDragging(_this.lastDraggingEvent); }\n });\n });\n };\n RowDragFeature.prototype.getContainer = function () {\n return this.eContainer;\n };\n RowDragFeature.prototype.isInterestedIn = function (type) {\n return type === DragSourceType.RowDrag;\n };\n RowDragFeature.prototype.getIconName = function () {\n var managedDrag = this.gridOptionsService.get('rowDragManaged');\n if (managedDrag && this.shouldPreventRowMove()) {\n return DragAndDropService.ICON_NOT_ALLOWED;\n }\n return DragAndDropService.ICON_MOVE;\n };\n RowDragFeature.prototype.shouldPreventRowMove = function () {\n var rowGroupCols = this.columnModel.getRowGroupColumns();\n if (rowGroupCols.length) {\n return true;\n }\n var isFilterPresent = this.filterManager.isAnyFilterPresent();\n if (isFilterPresent) {\n return true;\n }\n var isSortActive = this.sortController.isSortActive();\n if (isSortActive) {\n return true;\n }\n return false;\n };\n RowDragFeature.prototype.getRowNodes = function (draggingEvent) {\n var _this = this;\n if (!this.isFromThisGrid(draggingEvent)) {\n return (draggingEvent.dragItem.rowNodes || []);\n }\n var isRowDragMultiRow = this.gridOptionsService.get('rowDragMultiRow');\n var selectedNodes = __spreadArray$n([], __read$s(this.selectionService.getSelectedNodes()), false).sort(function (a, b) {\n if (a.rowIndex == null || b.rowIndex == null) {\n return 0;\n }\n return _this.getRowIndexNumber(a) - _this.getRowIndexNumber(b);\n });\n var currentNode = draggingEvent.dragItem.rowNode;\n if (isRowDragMultiRow && selectedNodes.indexOf(currentNode) !== -1) {\n this.isMultiRowDrag = true;\n return selectedNodes;\n }\n this.isMultiRowDrag = false;\n return [currentNode];\n };\n RowDragFeature.prototype.onDragEnter = function (draggingEvent) {\n // builds a lits of all rows being dragged before firing events\n draggingEvent.dragItem.rowNodes = this.getRowNodes(draggingEvent);\n // when entering, we fire the enter event, then in onEnterOrDragging,\n // we also fire the move event. so we get both events when entering.\n this.dispatchGridEvent(Events.EVENT_ROW_DRAG_ENTER, draggingEvent);\n this.getRowNodes(draggingEvent).forEach(function (rowNode) {\n rowNode.setDragging(true);\n });\n this.onEnterOrDragging(draggingEvent);\n };\n RowDragFeature.prototype.onDragging = function (draggingEvent) {\n this.onEnterOrDragging(draggingEvent);\n };\n RowDragFeature.prototype.isFromThisGrid = function (draggingEvent) {\n var dragSourceDomDataKey = draggingEvent.dragSource.dragSourceDomDataKey;\n return dragSourceDomDataKey === this.gridOptionsService.getDomDataKey();\n };\n RowDragFeature.prototype.isDropZoneWithinThisGrid = function (draggingEvent) {\n var gridBodyCon = this.ctrlsService.getGridBodyCtrl();\n var gridGui = gridBodyCon.getGui();\n var dropZoneTarget = draggingEvent.dropZoneTarget;\n return !gridGui.contains(dropZoneTarget);\n };\n RowDragFeature.prototype.onEnterOrDragging = function (draggingEvent) {\n // this event is fired for enter and move\n this.dispatchGridEvent(Events.EVENT_ROW_DRAG_MOVE, draggingEvent);\n this.lastDraggingEvent = draggingEvent;\n var pixel = this.mouseEventService.getNormalisedPosition(draggingEvent).y;\n var managedDrag = this.gridOptionsService.get('rowDragManaged');\n if (managedDrag) {\n this.doManagedDrag(draggingEvent, pixel);\n }\n this.autoScrollService.check(draggingEvent.event);\n };\n RowDragFeature.prototype.doManagedDrag = function (draggingEvent, pixel) {\n var isFromThisGrid = this.isFromThisGrid(draggingEvent);\n var managedDrag = this.gridOptionsService.get('rowDragManaged');\n var rowNodes = draggingEvent.dragItem.rowNodes;\n if (managedDrag && this.shouldPreventRowMove()) {\n return;\n }\n if (this.gridOptionsService.get('suppressMoveWhenRowDragging') || !isFromThisGrid) {\n if (!this.isDropZoneWithinThisGrid(draggingEvent)) {\n this.clientSideRowModel.highlightRowAtPixel(rowNodes[0], pixel);\n }\n }\n else {\n this.moveRows(rowNodes, pixel);\n }\n };\n RowDragFeature.prototype.getRowIndexNumber = function (rowNode) {\n return parseInt(last(rowNode.getRowIndexString().split('-')), 10);\n };\n RowDragFeature.prototype.moveRowAndClearHighlight = function (draggingEvent) {\n var _this = this;\n var lastHighlightedRowNode = this.clientSideRowModel.getLastHighlightedRowNode();\n var isBelow = lastHighlightedRowNode && lastHighlightedRowNode.highlighted === RowHighlightPosition.Below;\n var pixel = this.mouseEventService.getNormalisedPosition(draggingEvent).y;\n var rowNodes = draggingEvent.dragItem.rowNodes;\n var increment = isBelow ? 1 : 0;\n if (this.isFromThisGrid(draggingEvent)) {\n rowNodes.forEach(function (rowNode) {\n if (rowNode.rowTop < pixel) {\n increment -= 1;\n }\n });\n this.moveRows(rowNodes, pixel, increment);\n }\n else {\n var getRowIdFunc_1 = this.gridOptionsService.getCallback('getRowId');\n var addIndex = this.clientSideRowModel.getRowIndexAtPixel(pixel) + 1;\n if (this.clientSideRowModel.getHighlightPosition(pixel) === RowHighlightPosition.Above) {\n addIndex--;\n }\n this.clientSideRowModel.updateRowData({\n add: rowNodes\n .map(function (node) { return node.data; })\n .filter(function (data) { return !_this.clientSideRowModel.getRowNode(getRowIdFunc_1 ? getRowIdFunc_1({ data: data, level: 0 }) : data.id); }),\n addIndex: addIndex\n });\n }\n this.clearRowHighlight();\n };\n RowDragFeature.prototype.clearRowHighlight = function () {\n this.clientSideRowModel.highlightRowAtPixel(null);\n };\n RowDragFeature.prototype.moveRows = function (rowNodes, pixel, increment) {\n if (increment === void 0) { increment = 0; }\n var rowWasMoved = this.clientSideRowModel.ensureRowsAtPixel(rowNodes, pixel, increment);\n if (rowWasMoved) {\n this.focusService.clearFocusedCell();\n if (this.rangeService) {\n this.rangeService.removeAllCellRanges();\n }\n }\n };\n RowDragFeature.prototype.addRowDropZone = function (params) {\n var _this = this;\n if (!params.getContainer()) {\n warnOnce('addRowDropZone - A container target needs to be provided');\n return;\n }\n if (this.dragAndDropService.findExternalZone(params)) {\n console.warn('AG Grid: addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.');\n return;\n }\n var processedParams = {\n getContainer: params.getContainer\n };\n if (params.fromGrid) {\n params.fromGrid = undefined;\n processedParams = params;\n }\n else {\n if (params.onDragEnter) {\n processedParams.onDragEnter = function (e) {\n params.onDragEnter(_this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_ENTER, e));\n };\n }\n if (params.onDragLeave) {\n processedParams.onDragLeave = function (e) {\n params.onDragLeave(_this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_LEAVE, e));\n };\n }\n if (params.onDragging) {\n processedParams.onDragging = function (e) {\n params.onDragging(_this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_MOVE, e));\n };\n }\n if (params.onDragStop) {\n processedParams.onDragStop = function (e) {\n params.onDragStop(_this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_END, e));\n };\n }\n }\n this.dragAndDropService.addDropTarget(__assign$e({ isInterestedIn: function (type) { return type === DragSourceType.RowDrag; }, getIconName: function () { return DragAndDropService.ICON_MOVE; }, external: true }, processedParams));\n };\n RowDragFeature.prototype.getRowDropZone = function (events) {\n var _this = this;\n var getContainer = this.getContainer.bind(this);\n var onDragEnter = this.onDragEnter.bind(this);\n var onDragLeave = this.onDragLeave.bind(this);\n var onDragging = this.onDragging.bind(this);\n var onDragStop = this.onDragStop.bind(this);\n if (!events) {\n return { getContainer: getContainer, onDragEnter: onDragEnter, onDragLeave: onDragLeave, onDragging: onDragging, onDragStop: onDragStop, /* @private */ fromGrid: true };\n }\n return {\n getContainer: getContainer,\n onDragEnter: events.onDragEnter\n ? (function (e) {\n onDragEnter(e);\n events.onDragEnter(_this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_ENTER, e));\n })\n : onDragEnter,\n onDragLeave: events.onDragLeave\n ? (function (e) {\n onDragLeave(e);\n events.onDragLeave(_this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_LEAVE, e));\n })\n : onDragLeave,\n onDragging: events.onDragging\n ? (function (e) {\n onDragging(e);\n events.onDragging(_this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_MOVE, e));\n })\n : onDragging,\n onDragStop: events.onDragStop\n ? (function (e) {\n onDragStop(e);\n events.onDragStop(_this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_END, e));\n })\n : onDragStop,\n fromGrid: true /* @private */\n };\n };\n RowDragFeature.prototype.draggingToRowDragEvent = function (type, draggingEvent) {\n var yNormalised = this.mouseEventService.getNormalisedPosition(draggingEvent).y;\n var mouseIsPastLastRow = yNormalised > this.paginationProxy.getCurrentPageHeight();\n var overIndex = -1;\n var overNode;\n if (!mouseIsPastLastRow) {\n overIndex = this.rowModel.getRowIndexAtPixel(yNormalised);\n overNode = this.rowModel.getRow(overIndex);\n }\n var vDirectionString;\n switch (draggingEvent.vDirection) {\n case VerticalDirection.Down:\n vDirectionString = 'down';\n break;\n case VerticalDirection.Up:\n vDirectionString = 'up';\n break;\n default:\n vDirectionString = null;\n break;\n }\n var event = this.gridOptionsService.addGridCommonParams({\n type: type,\n event: draggingEvent.event,\n node: draggingEvent.dragItem.rowNode,\n nodes: draggingEvent.dragItem.rowNodes,\n overIndex: overIndex,\n overNode: overNode,\n y: yNormalised,\n vDirection: vDirectionString\n });\n return event;\n };\n RowDragFeature.prototype.dispatchGridEvent = function (type, draggingEvent) {\n var event = this.draggingToRowDragEvent(type, draggingEvent);\n this.eventService.dispatchEvent(event);\n };\n RowDragFeature.prototype.onDragLeave = function (draggingEvent) {\n this.dispatchGridEvent(Events.EVENT_ROW_DRAG_LEAVE, draggingEvent);\n this.stopDragging(draggingEvent);\n if (this.gridOptionsService.get('rowDragManaged')) {\n this.clearRowHighlight();\n }\n if (this.isFromThisGrid(draggingEvent)) {\n this.isMultiRowDrag = false;\n }\n };\n RowDragFeature.prototype.onDragStop = function (draggingEvent) {\n this.dispatchGridEvent(Events.EVENT_ROW_DRAG_END, draggingEvent);\n this.stopDragging(draggingEvent);\n if (this.gridOptionsService.get('rowDragManaged') &&\n (this.gridOptionsService.get('suppressMoveWhenRowDragging') || !this.isFromThisGrid(draggingEvent)) &&\n !this.isDropZoneWithinThisGrid(draggingEvent)) {\n this.moveRowAndClearHighlight(draggingEvent);\n }\n };\n RowDragFeature.prototype.stopDragging = function (draggingEvent) {\n this.autoScrollService.ensureCleared();\n this.getRowNodes(draggingEvent).forEach(function (rowNode) {\n rowNode.setDragging(false);\n });\n };\n __decorate$1_([\n Autowired('dragAndDropService')\n ], RowDragFeature.prototype, \"dragAndDropService\", void 0);\n __decorate$1_([\n Autowired('rowModel')\n ], RowDragFeature.prototype, \"rowModel\", void 0);\n __decorate$1_([\n Autowired('paginationProxy')\n ], RowDragFeature.prototype, \"paginationProxy\", void 0);\n __decorate$1_([\n Autowired('columnModel')\n ], RowDragFeature.prototype, \"columnModel\", void 0);\n __decorate$1_([\n Autowired('focusService')\n ], RowDragFeature.prototype, \"focusService\", void 0);\n __decorate$1_([\n Autowired('sortController')\n ], RowDragFeature.prototype, \"sortController\", void 0);\n __decorate$1_([\n Autowired('filterManager')\n ], RowDragFeature.prototype, \"filterManager\", void 0);\n __decorate$1_([\n Autowired('selectionService')\n ], RowDragFeature.prototype, \"selectionService\", void 0);\n __decorate$1_([\n Autowired('mouseEventService')\n ], RowDragFeature.prototype, \"mouseEventService\", void 0);\n __decorate$1_([\n Autowired('ctrlsService')\n ], RowDragFeature.prototype, \"ctrlsService\", void 0);\n __decorate$1_([\n Optional('rangeService')\n ], RowDragFeature.prototype, \"rangeService\", void 0);\n __decorate$1_([\n PostConstruct\n ], RowDragFeature.prototype, \"postConstruct\", null);\n return RowDragFeature;\n}(BeanStub));\n\nvar __extends$2b = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1Z = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar RowAnimationCssClasses;\n(function (RowAnimationCssClasses) {\n RowAnimationCssClasses[\"ANIMATION_ON\"] = \"ag-row-animation\";\n RowAnimationCssClasses[\"ANIMATION_OFF\"] = \"ag-row-no-animation\";\n})(RowAnimationCssClasses || (RowAnimationCssClasses = {}));\nvar CSS_CLASS_FORCE_VERTICAL_SCROLL = 'ag-force-vertical-scroll';\nvar CSS_CLASS_CELL_SELECTABLE = 'ag-selectable';\nvar CSS_CLASS_COLUMN_MOVING = 'ag-column-moving';\nvar GridBodyCtrl = /** @class */ (function (_super) {\n __extends$2b(GridBodyCtrl, _super);\n function GridBodyCtrl() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.stickyTopHeight = 0;\n return _this;\n }\n GridBodyCtrl.prototype.getScrollFeature = function () {\n return this.bodyScrollFeature;\n };\n GridBodyCtrl.prototype.getBodyViewportElement = function () {\n return this.eBodyViewport;\n };\n GridBodyCtrl.prototype.setComp = function (comp, eGridBody, eBodyViewport, eTop, eBottom, eStickyTop) {\n var _this = this;\n this.comp = comp;\n this.eGridBody = eGridBody;\n this.eBodyViewport = eBodyViewport;\n this.eTop = eTop;\n this.eBottom = eBottom;\n this.eStickyTop = eStickyTop;\n this.setCellTextSelection(this.gridOptionsService.get('enableCellTextSelection'));\n this.addManagedPropertyListener('enableCellTextSelection', function (props) { return _this.setCellTextSelection(props.currentValue); });\n this.createManagedBean(new LayoutFeature(this.comp));\n this.bodyScrollFeature = this.createManagedBean(new GridBodyScrollFeature(this.eBodyViewport));\n this.addRowDragListener();\n this.setupRowAnimationCssClass();\n this.addEventListeners();\n this.addFocusListeners([eTop, eBodyViewport, eBottom, eStickyTop]);\n this.onGridColumnsChanged();\n this.addBodyViewportListener();\n this.setFloatingHeights();\n this.disableBrowserDragging();\n this.addStopEditingWhenGridLosesFocus();\n this.filterManager.setupAdvancedFilterHeaderComp(eTop);\n this.ctrlsService.registerGridBodyCtrl(this);\n };\n GridBodyCtrl.prototype.getComp = function () {\n return this.comp;\n };\n GridBodyCtrl.prototype.addEventListeners = function () {\n this.addManagedListener(this.eventService, Events.EVENT_GRID_COLUMNS_CHANGED, this.onGridColumnsChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_SCROLL_VISIBILITY_CHANGED, this.onScrollVisibilityChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_PINNED_ROW_DATA_CHANGED, this.onPinnedRowDataChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_HEADER_HEIGHT_CHANGED, this.onHeaderHeightChanged.bind(this));\n };\n GridBodyCtrl.prototype.addFocusListeners = function (elements) {\n var _this = this;\n elements.forEach(function (element) {\n _this.addManagedListener(element, 'focusin', function (e) {\n var target = e.target;\n // element being focused is nested?\n var isFocusedElementNested = isElementChildOfClass(target, 'ag-root', element);\n element.classList.toggle('ag-has-focus', !isFocusedElementNested);\n });\n _this.addManagedListener(element, 'focusout', function (e) {\n var target = e.target, relatedTarget = e.relatedTarget;\n var gridContainRelatedTarget = element.contains(relatedTarget);\n var isNestedRelatedTarget = isElementChildOfClass(relatedTarget, 'ag-root', element);\n var isNestedTarget = isElementChildOfClass(target, 'ag-root', element);\n // element losing focus belongs to a nested grid,\n // it should not be handled here.\n if (isNestedTarget) {\n return;\n }\n // the grid does not contain, or the focus element is within\n // a nested grid\n if (!gridContainRelatedTarget || isNestedRelatedTarget) {\n element.classList.remove('ag-has-focus');\n }\n });\n });\n };\n // used by ColumnAnimationService\n GridBodyCtrl.prototype.setColumnMovingCss = function (moving) {\n this.comp.setColumnMovingCss(CSS_CLASS_COLUMN_MOVING, moving);\n };\n GridBodyCtrl.prototype.setCellTextSelection = function (selectable) {\n if (selectable === void 0) { selectable = false; }\n this.comp.setCellSelectableCss(CSS_CLASS_CELL_SELECTABLE, selectable);\n };\n GridBodyCtrl.prototype.onScrollVisibilityChanged = function () {\n var _this = this;\n var visible = this.scrollVisibleService.isVerticalScrollShowing();\n this.setVerticalScrollPaddingVisible(visible);\n this.setStickyTopWidth(visible);\n var scrollbarWidth = visible ? (this.gridOptionsService.getScrollbarWidth() || 0) : 0;\n var pad = isInvisibleScrollbar() ? 16 : 0;\n var width = \"calc(100% + \".concat(scrollbarWidth + pad, \"px)\");\n this.animationFrameService.requestAnimationFrame(function () { return _this.comp.setBodyViewportWidth(width); });\n };\n GridBodyCtrl.prototype.onGridColumnsChanged = function () {\n var columns = this.columnModel.getAllGridColumns();\n this.comp.setColumnCount(columns.length);\n };\n // if we do not do this, then the user can select a pic in the grid (eg an image in a custom cell renderer)\n // and then that will start the browser native drag n' drop, which messes up with our own drag and drop.\n GridBodyCtrl.prototype.disableBrowserDragging = function () {\n this.addManagedListener(this.eGridBody, 'dragstart', function (event) {\n if (event.target instanceof HTMLImageElement) {\n event.preventDefault();\n return false;\n }\n });\n };\n GridBodyCtrl.prototype.addStopEditingWhenGridLosesFocus = function () {\n var _this = this;\n if (!this.gridOptionsService.get('stopEditingWhenCellsLoseFocus')) {\n return;\n }\n var focusOutListener = function (event) {\n // this is the element the focus is moving to\n var elementWithFocus = event.relatedTarget;\n if (getTabIndex(elementWithFocus) === null) {\n _this.rowRenderer.stopEditing();\n return;\n }\n var clickInsideGrid = \n // see if click came from inside the viewports\n viewports.some(function (viewport) { return viewport.contains(elementWithFocus); })\n // and also that it's not from a detail grid\n && _this.mouseEventService.isElementInThisGrid(elementWithFocus);\n if (!clickInsideGrid) {\n var popupService = _this.popupService;\n clickInsideGrid =\n popupService.getActivePopups().some(function (popup) { return popup.contains(elementWithFocus); }) ||\n popupService.isElementWithinCustomPopup(elementWithFocus);\n }\n if (!clickInsideGrid) {\n _this.rowRenderer.stopEditing();\n }\n };\n var viewports = [this.eBodyViewport, this.eBottom, this.eTop, this.eStickyTop];\n viewports.forEach(function (viewport) { return _this.addManagedListener(viewport, 'focusout', focusOutListener); });\n };\n GridBodyCtrl.prototype.updateRowCount = function () {\n var headerCount = this.headerNavigationService.getHeaderRowCount() + this.filterManager.getHeaderRowCount();\n var rowCount = this.rowModel.isLastRowIndexKnown() ? this.rowModel.getRowCount() : -1;\n var total = rowCount === -1 ? -1 : (headerCount + rowCount);\n this.comp.setRowCount(total);\n };\n GridBodyCtrl.prototype.registerBodyViewportResizeListener = function (listener) {\n this.comp.registerBodyViewportResizeListener(listener);\n };\n GridBodyCtrl.prototype.setVerticalScrollPaddingVisible = function (visible) {\n var overflowY = visible ? 'scroll' : 'hidden';\n this.comp.setPinnedTopBottomOverflowY(overflowY);\n };\n GridBodyCtrl.prototype.isVerticalScrollShowing = function () {\n var show = this.gridOptionsService.get('alwaysShowVerticalScroll');\n var cssClass = show ? CSS_CLASS_FORCE_VERTICAL_SCROLL : null;\n var allowVerticalScroll = this.gridOptionsService.isDomLayout('normal');\n this.comp.setAlwaysVerticalScrollClass(cssClass, show);\n return show || (allowVerticalScroll && isVerticalScrollShowing(this.eBodyViewport));\n };\n GridBodyCtrl.prototype.setupRowAnimationCssClass = function () {\n var _this = this;\n var listener = function () {\n // we don't want to use row animation if scaling, as rows jump strangely as you scroll,\n // when scaling and doing row animation.\n var animateRows = _this.gridOptionsService.isAnimateRows() && !_this.rowContainerHeightService.isStretching();\n var animateRowsCssClass = animateRows ? RowAnimationCssClasses.ANIMATION_ON : RowAnimationCssClasses.ANIMATION_OFF;\n _this.comp.setRowAnimationCssOnBodyViewport(animateRowsCssClass, animateRows);\n };\n listener();\n this.addManagedListener(this.eventService, Events.EVENT_HEIGHT_SCALE_CHANGED, listener);\n this.addManagedPropertyListener('animateRows', listener);\n };\n GridBodyCtrl.prototype.getGridBodyElement = function () {\n return this.eGridBody;\n };\n GridBodyCtrl.prototype.addBodyViewportListener = function () {\n // we want to listen for clicks directly on the eBodyViewport, so the user has a way of showing\n // the context menu if no rows or columns are displayed, or user simply clicks outside of a cell\n var listener = this.onBodyViewportContextMenu.bind(this);\n this.addManagedListener(this.eBodyViewport, 'contextmenu', listener);\n this.mockContextMenuForIPad(listener);\n this.addManagedListener(this.eBodyViewport, 'wheel', this.onBodyViewportWheel.bind(this));\n this.addManagedListener(this.eStickyTop, 'wheel', this.onStickyTopWheel.bind(this));\n // allow mouseWheel on the Full Width Container to Scroll the Viewport\n this.addFullWidthContainerWheelListener();\n };\n GridBodyCtrl.prototype.addFullWidthContainerWheelListener = function () {\n var _this = this;\n var fullWidthContainer = this.eBodyViewport.querySelector('.ag-full-width-container');\n var eCenterColsViewport = this.eBodyViewport.querySelector('.ag-center-cols-viewport');\n if (fullWidthContainer && eCenterColsViewport) {\n this.addManagedListener(fullWidthContainer, 'wheel', function (e) { return _this.onFullWidthContainerWheel(e, eCenterColsViewport); });\n }\n };\n GridBodyCtrl.prototype.onFullWidthContainerWheel = function (e, eCenterColsViewport) {\n if (!e.deltaX ||\n Math.abs(e.deltaY) > Math.abs(e.deltaX) ||\n !this.mouseEventService.isEventFromThisGrid(e)) {\n return;\n }\n e.preventDefault();\n eCenterColsViewport.scrollBy({ left: e.deltaX });\n };\n GridBodyCtrl.prototype.onBodyViewportContextMenu = function (mouseEvent, touch, touchEvent) {\n if (!mouseEvent && !touchEvent) {\n return;\n }\n if (this.gridOptionsService.get('preventDefaultOnContextMenu')) {\n var event_1 = (mouseEvent || touchEvent);\n event_1.preventDefault();\n }\n var target = (mouseEvent || touch).target;\n if (target === this.eBodyViewport || target === this.ctrlsService.getCenterRowContainerCtrl().getViewportElement()) {\n // show it\n this.menuService.showContextMenu({ mouseEvent: mouseEvent, touchEvent: touchEvent, value: null, anchorToElement: this.eGridBody });\n }\n };\n GridBodyCtrl.prototype.mockContextMenuForIPad = function (listener) {\n // we do NOT want this when not in iPad\n if (!isIOSUserAgent()) {\n return;\n }\n var touchListener = new TouchListener(this.eBodyViewport);\n var longTapListener = function (event) {\n listener(undefined, event.touchStart, event.touchEvent);\n };\n this.addManagedListener(touchListener, TouchListener.EVENT_LONG_TAP, longTapListener);\n this.addDestroyFunc(function () { return touchListener.destroy(); });\n };\n GridBodyCtrl.prototype.onBodyViewportWheel = function (e) {\n if (!this.gridOptionsService.get('suppressScrollWhenPopupsAreOpen')) {\n return;\n }\n if (this.popupService.hasAnchoredPopup()) {\n e.preventDefault();\n }\n };\n GridBodyCtrl.prototype.onStickyTopWheel = function (e) {\n e.preventDefault();\n if (e.offsetY) {\n this.scrollVertically(e.deltaY);\n }\n };\n GridBodyCtrl.prototype.getGui = function () {\n return this.eGridBody;\n };\n // called by rowDragFeature\n GridBodyCtrl.prototype.scrollVertically = function (pixels) {\n var oldScrollPosition = this.eBodyViewport.scrollTop;\n this.bodyScrollFeature.setVerticalScrollPosition(oldScrollPosition + pixels);\n return this.eBodyViewport.scrollTop - oldScrollPosition;\n };\n GridBodyCtrl.prototype.addRowDragListener = function () {\n this.rowDragFeature = this.createManagedBean(new RowDragFeature(this.eBodyViewport));\n this.dragAndDropService.addDropTarget(this.rowDragFeature);\n };\n GridBodyCtrl.prototype.getRowDragFeature = function () {\n return this.rowDragFeature;\n };\n GridBodyCtrl.prototype.onPinnedRowDataChanged = function () {\n this.setFloatingHeights();\n };\n GridBodyCtrl.prototype.setFloatingHeights = function () {\n var pinnedRowModel = this.pinnedRowModel;\n var floatingTopHeight = pinnedRowModel.getPinnedTopTotalHeight();\n var floatingBottomHeight = pinnedRowModel.getPinnedBottomTotalHeight();\n this.comp.setTopHeight(floatingTopHeight);\n this.comp.setBottomHeight(floatingBottomHeight);\n this.comp.setTopDisplay(floatingTopHeight ? 'inherit' : 'none');\n this.comp.setBottomDisplay(floatingBottomHeight ? 'inherit' : 'none');\n this.setStickyTopOffsetTop();\n };\n GridBodyCtrl.prototype.setStickyTopHeight = function (height) {\n if (height === void 0) { height = 0; }\n // console.log('setting sticky top height ' + height);\n this.comp.setStickyTopHeight(\"\".concat(height, \"px\"));\n this.stickyTopHeight = height;\n };\n GridBodyCtrl.prototype.getStickyTopHeight = function () {\n return this.stickyTopHeight;\n };\n GridBodyCtrl.prototype.setStickyTopWidth = function (vScrollVisible) {\n if (!vScrollVisible) {\n this.comp.setStickyTopWidth('100%');\n }\n else {\n var scrollbarWidth = this.gridOptionsService.getScrollbarWidth();\n this.comp.setStickyTopWidth(\"calc(100% - \".concat(scrollbarWidth, \"px)\"));\n }\n };\n GridBodyCtrl.prototype.onHeaderHeightChanged = function () {\n this.setStickyTopOffsetTop();\n };\n GridBodyCtrl.prototype.setStickyTopOffsetTop = function () {\n var headerCtrl = this.ctrlsService.getGridHeaderCtrl();\n var headerHeight = headerCtrl.getHeaderHeight() + this.filterManager.getHeaderHeight();\n var pinnedTopHeight = this.pinnedRowModel.getPinnedTopTotalHeight();\n var height = 0;\n if (headerHeight > 0) {\n height += headerHeight + 1;\n }\n if (pinnedTopHeight > 0) {\n height += pinnedTopHeight + 1;\n }\n this.comp.setStickyTopTop(\"\".concat(height, \"px\"));\n };\n // method will call itself if no available width. this covers if the grid\n // isn't visible, but is just about to be visible.\n GridBodyCtrl.prototype.sizeColumnsToFit = function (params, nextTimeout) {\n var _this = this;\n var removeScrollWidth = this.isVerticalScrollShowing();\n var scrollWidthToRemove = removeScrollWidth ? this.gridOptionsService.getScrollbarWidth() : 0;\n // bodyViewportWidth should be calculated from eGridBody, not eBodyViewport\n // because we change the width of the bodyViewport to hide the real browser scrollbar\n var bodyViewportWidth = getInnerWidth(this.eGridBody);\n var availableWidth = bodyViewportWidth - scrollWidthToRemove;\n if (availableWidth > 0) {\n this.columnModel.sizeColumnsToFit(availableWidth, \"sizeColumnsToFit\", false, params);\n return;\n }\n if (nextTimeout === undefined) {\n window.setTimeout(function () {\n _this.sizeColumnsToFit(params, 100);\n }, 0);\n }\n else if (nextTimeout === 100) {\n window.setTimeout(function () {\n _this.sizeColumnsToFit(params, 500);\n }, 100);\n }\n else if (nextTimeout === 500) {\n window.setTimeout(function () {\n _this.sizeColumnsToFit(params, -1);\n }, 500);\n }\n else {\n console.warn('AG Grid: tried to call sizeColumnsToFit() but the grid is coming back with ' +\n 'zero width, maybe the grid is not visible yet on the screen?');\n }\n };\n // + rangeService\n GridBodyCtrl.prototype.addScrollEventListener = function (listener) {\n this.eBodyViewport.addEventListener('scroll', listener, { passive: true });\n };\n // + focusService\n GridBodyCtrl.prototype.removeScrollEventListener = function (listener) {\n this.eBodyViewport.removeEventListener('scroll', listener);\n };\n __decorate$1Z([\n Autowired('animationFrameService')\n ], GridBodyCtrl.prototype, \"animationFrameService\", void 0);\n __decorate$1Z([\n Autowired('rowContainerHeightService')\n ], GridBodyCtrl.prototype, \"rowContainerHeightService\", void 0);\n __decorate$1Z([\n Autowired('ctrlsService')\n ], GridBodyCtrl.prototype, \"ctrlsService\", void 0);\n __decorate$1Z([\n Autowired('columnModel')\n ], GridBodyCtrl.prototype, \"columnModel\", void 0);\n __decorate$1Z([\n Autowired('scrollVisibleService')\n ], GridBodyCtrl.prototype, \"scrollVisibleService\", void 0);\n __decorate$1Z([\n Autowired('menuService')\n ], GridBodyCtrl.prototype, \"menuService\", void 0);\n __decorate$1Z([\n Autowired('headerNavigationService')\n ], GridBodyCtrl.prototype, \"headerNavigationService\", void 0);\n __decorate$1Z([\n Autowired('dragAndDropService')\n ], GridBodyCtrl.prototype, \"dragAndDropService\", void 0);\n __decorate$1Z([\n Autowired('pinnedRowModel')\n ], GridBodyCtrl.prototype, \"pinnedRowModel\", void 0);\n __decorate$1Z([\n Autowired('rowRenderer')\n ], GridBodyCtrl.prototype, \"rowRenderer\", void 0);\n __decorate$1Z([\n Autowired('popupService')\n ], GridBodyCtrl.prototype, \"popupService\", void 0);\n __decorate$1Z([\n Autowired('mouseEventService')\n ], GridBodyCtrl.prototype, \"mouseEventService\", void 0);\n __decorate$1Z([\n Autowired('rowModel')\n ], GridBodyCtrl.prototype, \"rowModel\", void 0);\n __decorate$1Z([\n Autowired('filterManager')\n ], GridBodyCtrl.prototype, \"filterManager\", void 0);\n return GridBodyCtrl;\n}(BeanStub));\n\nvar SelectionHandleType;\n(function (SelectionHandleType) {\n SelectionHandleType[SelectionHandleType[\"FILL\"] = 0] = \"FILL\";\n SelectionHandleType[SelectionHandleType[\"RANGE\"] = 1] = \"RANGE\";\n})(SelectionHandleType || (SelectionHandleType = {}));\nvar CellRangeType;\n(function (CellRangeType) {\n CellRangeType[CellRangeType[\"VALUE\"] = 0] = \"VALUE\";\n CellRangeType[CellRangeType[\"DIMENSION\"] = 1] = \"DIMENSION\";\n})(CellRangeType || (CellRangeType = {}));\n\nvar CSS_CELL_RANGE_SELECTED = 'ag-cell-range-selected';\nvar CSS_CELL_RANGE_CHART = 'ag-cell-range-chart';\nvar CSS_CELL_RANGE_SINGLE_CELL = 'ag-cell-range-single-cell';\nvar CSS_CELL_RANGE_CHART_CATEGORY = 'ag-cell-range-chart-category';\nvar CSS_CELL_RANGE_HANDLE = 'ag-cell-range-handle';\nvar CSS_CELL_RANGE_TOP = 'ag-cell-range-top';\nvar CSS_CELL_RANGE_RIGHT = 'ag-cell-range-right';\nvar CSS_CELL_RANGE_BOTTOM = 'ag-cell-range-bottom';\nvar CSS_CELL_RANGE_LEFT = 'ag-cell-range-left';\nvar CellRangeFeature = /** @class */ (function () {\n function CellRangeFeature(beans, ctrl) {\n this.beans = beans;\n this.cellCtrl = ctrl;\n }\n CellRangeFeature.prototype.setComp = function (cellComp, eGui) {\n this.cellComp = cellComp;\n this.eGui = eGui;\n this.onRangeSelectionChanged();\n };\n CellRangeFeature.prototype.onRangeSelectionChanged = function () {\n // when using reactUi, given UI is async, it's possible this method is called before the comp is registered\n if (!this.cellComp) {\n return;\n }\n this.rangeCount = this.beans.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition());\n this.hasChartRange = this.getHasChartRange();\n this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_SELECTED, this.rangeCount !== 0);\n this.cellComp.addOrRemoveCssClass(\"\".concat(CSS_CELL_RANGE_SELECTED, \"-1\"), this.rangeCount === 1);\n this.cellComp.addOrRemoveCssClass(\"\".concat(CSS_CELL_RANGE_SELECTED, \"-2\"), this.rangeCount === 2);\n this.cellComp.addOrRemoveCssClass(\"\".concat(CSS_CELL_RANGE_SELECTED, \"-3\"), this.rangeCount === 3);\n this.cellComp.addOrRemoveCssClass(\"\".concat(CSS_CELL_RANGE_SELECTED, \"-4\"), this.rangeCount >= 4);\n this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_CHART, this.hasChartRange);\n setAriaSelected(this.eGui, this.rangeCount > 0 ? true : undefined);\n this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_SINGLE_CELL, this.isSingleCell());\n this.updateRangeBorders();\n this.refreshHandle();\n };\n CellRangeFeature.prototype.updateRangeBorders = function () {\n var rangeBorders = this.getRangeBorders();\n var isSingleCell = this.isSingleCell();\n var isTop = !isSingleCell && rangeBorders.top;\n var isRight = !isSingleCell && rangeBorders.right;\n var isBottom = !isSingleCell && rangeBorders.bottom;\n var isLeft = !isSingleCell && rangeBorders.left;\n this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_TOP, isTop);\n this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_RIGHT, isRight);\n this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_BOTTOM, isBottom);\n this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_LEFT, isLeft);\n };\n CellRangeFeature.prototype.isSingleCell = function () {\n var rangeService = this.beans.rangeService;\n return this.rangeCount === 1 && rangeService && !rangeService.isMoreThanOneCell();\n };\n CellRangeFeature.prototype.getHasChartRange = function () {\n var rangeService = this.beans.rangeService;\n if (!this.rangeCount || !rangeService) {\n return false;\n }\n var cellRanges = rangeService.getCellRanges();\n return cellRanges.length > 0 && cellRanges.every(function (range) { return includes([CellRangeType.DIMENSION, CellRangeType.VALUE], range.type); });\n };\n CellRangeFeature.prototype.updateRangeBordersIfRangeCount = function () {\n // we only need to update range borders if we are in a range\n if (this.rangeCount > 0) {\n this.updateRangeBorders();\n this.refreshHandle();\n }\n };\n CellRangeFeature.prototype.getRangeBorders = function () {\n var _this = this;\n var isRtl = this.beans.gridOptionsService.get('enableRtl');\n var top = false;\n var right = false;\n var bottom = false;\n var left = false;\n var thisCol = this.cellCtrl.getCellPosition().column;\n var _a = this.beans, rangeService = _a.rangeService, columnModel = _a.columnModel;\n var leftCol;\n var rightCol;\n if (isRtl) {\n leftCol = columnModel.getDisplayedColAfter(thisCol);\n rightCol = columnModel.getDisplayedColBefore(thisCol);\n }\n else {\n leftCol = columnModel.getDisplayedColBefore(thisCol);\n rightCol = columnModel.getDisplayedColAfter(thisCol);\n }\n var ranges = rangeService.getCellRanges().filter(function (range) { return rangeService.isCellInSpecificRange(_this.cellCtrl.getCellPosition(), range); });\n // this means we are the first column in the grid\n if (!leftCol) {\n left = true;\n }\n // this means we are the last column in the grid\n if (!rightCol) {\n right = true;\n }\n for (var i = 0; i < ranges.length; i++) {\n if (top && right && bottom && left) {\n break;\n }\n var range = ranges[i];\n var startRow = rangeService.getRangeStartRow(range);\n var endRow = rangeService.getRangeEndRow(range);\n if (!top && this.beans.rowPositionUtils.sameRow(startRow, this.cellCtrl.getCellPosition())) {\n top = true;\n }\n if (!bottom && this.beans.rowPositionUtils.sameRow(endRow, this.cellCtrl.getCellPosition())) {\n bottom = true;\n }\n if (!left && leftCol && range.columns.indexOf(leftCol) < 0) {\n left = true;\n }\n if (!right && rightCol && range.columns.indexOf(rightCol) < 0) {\n right = true;\n }\n }\n return { top: top, right: right, bottom: bottom, left: left };\n };\n CellRangeFeature.prototype.refreshHandle = function () {\n if (!this.beans.rangeService || this.beans.context.isDestroyed()) {\n return;\n }\n var shouldHaveSelectionHandle = this.shouldHaveSelectionHandle();\n if (this.selectionHandle && !shouldHaveSelectionHandle) {\n this.selectionHandle = this.beans.context.destroyBean(this.selectionHandle);\n }\n if (shouldHaveSelectionHandle) {\n this.addSelectionHandle();\n }\n this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_HANDLE, !!this.selectionHandle);\n };\n CellRangeFeature.prototype.shouldHaveSelectionHandle = function () {\n var _a = this.beans, gridOptionsService = _a.gridOptionsService, rangeService = _a.rangeService;\n var cellRanges = rangeService.getCellRanges();\n var rangesLen = cellRanges.length;\n if (this.rangeCount < 1 || rangesLen < 1) {\n return false;\n }\n var cellRange = last(cellRanges);\n var cellPosition = this.cellCtrl.getCellPosition();\n var isFillHandleAvailable = gridOptionsService.get('enableFillHandle') && !this.cellCtrl.isSuppressFillHandle();\n var isRangeHandleAvailable = gridOptionsService.get('enableRangeHandle');\n var handleIsAvailable = rangesLen === 1 && !this.cellCtrl.isEditing() && (isFillHandleAvailable || isRangeHandleAvailable);\n if (this.hasChartRange) {\n var hasCategoryRange = cellRanges[0].type === CellRangeType.DIMENSION;\n var isCategoryCell = hasCategoryRange && rangeService.isCellInSpecificRange(cellPosition, cellRanges[0]);\n this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_CHART_CATEGORY, isCategoryCell);\n handleIsAvailable = cellRange.type === CellRangeType.VALUE;\n }\n return handleIsAvailable &&\n cellRange.endRow != null &&\n rangeService.isContiguousRange(cellRange) &&\n rangeService.isBottomRightCell(cellRange, cellPosition);\n };\n CellRangeFeature.prototype.addSelectionHandle = function () {\n var _a = this.beans, gridOptionsService = _a.gridOptionsService, rangeService = _a.rangeService;\n var cellRangeType = last(rangeService.getCellRanges()).type;\n var selectionHandleFill = gridOptionsService.get('enableFillHandle') && missing(cellRangeType);\n var type = selectionHandleFill ? SelectionHandleType.FILL : SelectionHandleType.RANGE;\n if (this.selectionHandle && this.selectionHandle.getType() !== type) {\n this.selectionHandle = this.beans.context.destroyBean(this.selectionHandle);\n }\n if (!this.selectionHandle) {\n this.selectionHandle = this.beans.selectionHandleFactory.createSelectionHandle(type);\n }\n this.selectionHandle.refresh(this.cellCtrl);\n };\n CellRangeFeature.prototype.destroy = function () {\n this.beans.context.destroyBean(this.selectionHandle);\n };\n return CellRangeFeature;\n}());\n\nvar __extends$2a = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * Takes care of:\n * #) Cell Width (including when doing cell spanning, which makes width cover many columns)\n * #) Cell Height (when doing row span, otherwise we don't touch the height as it's just row height)\n * #) Cell Left (the horizontal positioning of the cell, the vertical positioning is on the row)\n */\nvar CellPositionFeature = /** @class */ (function (_super) {\n __extends$2a(CellPositionFeature, _super);\n function CellPositionFeature(ctrl, beans) {\n var _this = _super.call(this) || this;\n _this.cellCtrl = ctrl;\n _this.beans = beans;\n _this.column = ctrl.getColumn();\n _this.rowNode = ctrl.getRowNode();\n _this.setupColSpan();\n _this.setupRowSpan();\n return _this;\n }\n CellPositionFeature.prototype.setupRowSpan = function () {\n var _this = this;\n this.rowSpan = this.column.getRowSpan(this.rowNode);\n this.addManagedListener(this.beans.eventService, Events.EVENT_NEW_COLUMNS_LOADED, function () { return _this.onNewColumnsLoaded(); });\n };\n CellPositionFeature.prototype.setComp = function (eGui) {\n this.eGui = eGui;\n this.onLeftChanged();\n this.onWidthChanged();\n this.applyRowSpan();\n };\n CellPositionFeature.prototype.onNewColumnsLoaded = function () {\n var rowSpan = this.column.getRowSpan(this.rowNode);\n if (this.rowSpan === rowSpan) {\n return;\n }\n this.rowSpan = rowSpan;\n this.applyRowSpan(true);\n };\n CellPositionFeature.prototype.onDisplayColumnsChanged = function () {\n var colsSpanning = this.getColSpanningList();\n if (!areEqual(this.colsSpanning, colsSpanning)) {\n this.colsSpanning = colsSpanning;\n this.onWidthChanged();\n this.onLeftChanged(); // left changes when doing RTL\n }\n };\n CellPositionFeature.prototype.setupColSpan = function () {\n // if no col span is active, then we don't set it up, as it would be wasteful of CPU\n if (this.column.getColDef().colSpan == null) {\n return;\n }\n this.colsSpanning = this.getColSpanningList();\n // because we are col spanning, a reorder of the cols can change what cols we are spanning over\n this.addManagedListener(this.beans.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayColumnsChanged.bind(this));\n // because we are spanning over multiple cols, we check for width any time any cols width changes.\n // this is expensive - really we should be explicitly checking only the cols we are spanning over\n // instead of every col, however it would be tricky code to track the cols we are spanning over, so\n // because hardly anyone will be using colSpan, am favouring this easier way for more maintainable code.\n this.addManagedListener(this.beans.eventService, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, this.onWidthChanged.bind(this));\n };\n CellPositionFeature.prototype.onWidthChanged = function () {\n if (!this.eGui) {\n return;\n }\n var width = this.getCellWidth();\n this.eGui.style.width = \"\".concat(width, \"px\");\n };\n CellPositionFeature.prototype.getCellWidth = function () {\n if (!this.colsSpanning) {\n return this.column.getActualWidth();\n }\n return this.colsSpanning.reduce(function (width, col) { return width + col.getActualWidth(); }, 0);\n };\n CellPositionFeature.prototype.getColSpanningList = function () {\n var colSpan = this.column.getColSpan(this.rowNode);\n var colsSpanning = [];\n // if just one col, the col span is just the column we are in\n if (colSpan === 1) {\n colsSpanning.push(this.column);\n }\n else {\n var pointer = this.column;\n var pinned = this.column.getPinned();\n for (var i = 0; pointer && i < colSpan; i++) {\n colsSpanning.push(pointer);\n pointer = this.beans.columnModel.getDisplayedColAfter(pointer);\n if (!pointer || missing(pointer)) {\n break;\n }\n // we do not allow col spanning to span outside of pinned areas\n if (pinned !== pointer.getPinned()) {\n break;\n }\n }\n }\n return colsSpanning;\n };\n CellPositionFeature.prototype.onLeftChanged = function () {\n if (!this.eGui) {\n return;\n }\n var left = this.modifyLeftForPrintLayout(this.getCellLeft());\n this.eGui.style.left = left + 'px';\n };\n CellPositionFeature.prototype.getCellLeft = function () {\n var mostLeftCol;\n if (this.beans.gridOptionsService.get('enableRtl') && this.colsSpanning) {\n mostLeftCol = last(this.colsSpanning);\n }\n else {\n mostLeftCol = this.column;\n }\n return mostLeftCol.getLeft();\n };\n CellPositionFeature.prototype.modifyLeftForPrintLayout = function (leftPosition) {\n if (!this.cellCtrl.isPrintLayout() || this.column.getPinned() === 'left') {\n return leftPosition;\n }\n var leftWidth = this.beans.columnModel.getDisplayedColumnsLeftWidth();\n if (this.column.getPinned() === 'right') {\n var bodyWidth = this.beans.columnModel.getBodyContainerWidth();\n return leftWidth + bodyWidth + (leftPosition || 0);\n }\n // is in body\n return leftWidth + (leftPosition || 0);\n };\n CellPositionFeature.prototype.applyRowSpan = function (force) {\n if (this.rowSpan === 1 && !force) {\n return;\n }\n var singleRowHeight = this.beans.gridOptionsService.getRowHeightAsNumber();\n var totalRowHeight = singleRowHeight * this.rowSpan;\n this.eGui.style.height = \"\".concat(totalRowHeight, \"px\");\n this.eGui.style.zIndex = '1';\n };\n // overriding to make public, as we don't dispose this bean via context\n CellPositionFeature.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n return CellPositionFeature;\n}(BeanStub));\n\nvar __extends$29 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar CellCustomStyleFeature = /** @class */ (function (_super) {\n __extends$29(CellCustomStyleFeature, _super);\n function CellCustomStyleFeature(ctrl, beans) {\n var _this = _super.call(this) || this;\n _this.staticClasses = [];\n _this.cellCtrl = ctrl;\n _this.beans = beans;\n _this.column = ctrl.getColumn();\n _this.rowNode = ctrl.getRowNode();\n return _this;\n }\n CellCustomStyleFeature.prototype.setComp = function (comp) {\n this.cellComp = comp;\n this.applyUserStyles();\n this.applyCellClassRules();\n this.applyClassesFromColDef();\n };\n CellCustomStyleFeature.prototype.applyCellClassRules = function () {\n var _this = this;\n var colDef = this.column.getColDef();\n var cellClassRules = colDef.cellClassRules;\n var cellClassParams = this.beans.gridOptionsService.addGridCommonParams({\n value: this.cellCtrl.getValue(),\n data: this.rowNode.data,\n node: this.rowNode,\n colDef: colDef,\n column: this.column,\n rowIndex: this.rowNode.rowIndex\n });\n this.beans.stylingService.processClassRules(\n // if current was previous, skip\n cellClassRules === this.cellClassRules ? undefined : this.cellClassRules, cellClassRules, cellClassParams, function (className) { return _this.cellComp.addOrRemoveCssClass(className, true); }, function (className) { return _this.cellComp.addOrRemoveCssClass(className, false); });\n this.cellClassRules = cellClassRules;\n };\n CellCustomStyleFeature.prototype.applyUserStyles = function () {\n var colDef = this.column.getColDef();\n if (!colDef.cellStyle) {\n return;\n }\n var styles;\n if (typeof colDef.cellStyle === 'function') {\n var cellStyleParams = this.beans.gridOptionsService.addGridCommonParams({\n column: this.column,\n value: this.cellCtrl.getValue(),\n colDef: colDef,\n data: this.rowNode.data,\n node: this.rowNode,\n rowIndex: this.rowNode.rowIndex\n });\n var cellStyleFunc = colDef.cellStyle;\n styles = cellStyleFunc(cellStyleParams);\n }\n else {\n styles = colDef.cellStyle;\n }\n if (styles) {\n this.cellComp.setUserStyles(styles);\n }\n };\n CellCustomStyleFeature.prototype.applyClassesFromColDef = function () {\n var _this = this;\n var colDef = this.column.getColDef();\n var cellClassParams = this.beans.gridOptionsService.addGridCommonParams({\n value: this.cellCtrl.getValue(),\n data: this.rowNode.data,\n node: this.rowNode,\n column: this.column,\n colDef: colDef,\n rowIndex: this.rowNode.rowIndex\n });\n if (this.staticClasses.length) {\n this.staticClasses.forEach(function (className) { return _this.cellComp.addOrRemoveCssClass(className, false); });\n }\n this.staticClasses = this.beans.stylingService.getStaticCellClasses(colDef, cellClassParams);\n if (this.staticClasses.length) {\n this.staticClasses.forEach(function (className) { return _this.cellComp.addOrRemoveCssClass(className, true); });\n }\n };\n // overriding to make public, as we don't dispose this bean via context\n CellCustomStyleFeature.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n return CellCustomStyleFeature;\n}(BeanStub));\n\nvar __extends$28 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar TooltipFeature = /** @class */ (function (_super) {\n __extends$28(TooltipFeature, _super);\n function TooltipFeature(ctrl, beans) {\n var _this = _super.call(this) || this;\n _this.ctrl = ctrl;\n _this.beans = beans;\n return _this;\n }\n TooltipFeature.prototype.setComp = function (eGui) {\n this.eGui = eGui;\n this.setupTooltip();\n };\n TooltipFeature.prototype.setBrowserTooltip = function (tooltip) {\n var name = 'title';\n if (tooltip != null && tooltip != '') {\n this.eGui.setAttribute(name, tooltip);\n }\n else {\n this.eGui.removeAttribute(name);\n }\n };\n TooltipFeature.prototype.setupTooltip = function () {\n this.browserTooltips = this.beans.gridOptionsService.get('enableBrowserTooltips');\n this.updateTooltipText();\n if (this.browserTooltips) {\n this.setBrowserTooltip(this.tooltip);\n }\n else {\n this.createTooltipFeatureIfNeeded();\n }\n };\n TooltipFeature.prototype.updateTooltipText = function () {\n this.tooltip = this.ctrl.getTooltipValue();\n };\n TooltipFeature.prototype.createTooltipFeatureIfNeeded = function () {\n var _this = this;\n var _a, _b, _c, _d;\n if (this.genericTooltipFeature != null) {\n return;\n }\n var parent = {\n getTooltipParams: function () { return _this.getTooltipParams(); },\n getGui: function () { return _this.ctrl.getGui(); }\n };\n this.genericTooltipFeature = this.createManagedBean(new CustomTooltipFeature(parent, (_b = (_a = this.ctrl).getTooltipShowDelayOverride) === null || _b === void 0 ? void 0 : _b.call(_a), (_d = (_c = this.ctrl).getTooltipHideDelayOverride) === null || _d === void 0 ? void 0 : _d.call(_c)), this.beans.context);\n };\n TooltipFeature.prototype.refreshToolTip = function () {\n this.updateTooltipText();\n if (this.browserTooltips) {\n this.setBrowserTooltip(this.tooltip);\n }\n };\n TooltipFeature.prototype.getTooltipParams = function () {\n var _this = this;\n var ctrl = this.ctrl;\n var column = ctrl.getColumn ? ctrl.getColumn() : undefined;\n var colDef = ctrl.getColDef ? ctrl.getColDef() : undefined;\n var rowNode = ctrl.getRowNode ? ctrl.getRowNode() : undefined;\n return {\n location: ctrl.getLocation(),\n colDef: colDef,\n column: column,\n rowIndex: ctrl.getRowIndex ? ctrl.getRowIndex() : undefined,\n node: rowNode,\n data: rowNode ? rowNode.data : undefined,\n value: this.getTooltipText(),\n valueFormatted: ctrl.getValueFormatted ? ctrl.getValueFormatted() : undefined,\n hideTooltipCallback: function () { return _this.genericTooltipFeature.hideTooltip(true); }\n };\n };\n TooltipFeature.prototype.getTooltipText = function () {\n return this.tooltip;\n };\n // overriding to make public, as we don't dispose this bean via context\n TooltipFeature.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n return TooltipFeature;\n}(BeanStub));\n\nvar __decorate$1Y = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n/** Using the IoC has a slight performance consideration, which is no problem most of the\n * time, unless we are trashing objects - which is the case when scrolling and rowComp\n * and cellComp. So for performance reasons, RowComp and CellComp do not get autowired\n * with the IoC. Instead they get passed this object which is all the beans the RowComp\n * and CellComp need. Not autowiring all the cells gives performance improvement. */\nvar Beans = /** @class */ (function () {\n function Beans() {\n }\n Beans.prototype.postConstruct = function () {\n if (this.gridOptionsService.isRowModelType('clientSide')) {\n this.clientSideRowModel = this.rowModel;\n }\n if (this.gridOptionsService.isRowModelType('serverSide')) {\n this.serverSideRowModel = this.rowModel;\n }\n };\n __decorate$1Y([\n Autowired('resizeObserverService')\n ], Beans.prototype, \"resizeObserverService\", void 0);\n __decorate$1Y([\n Autowired('paginationProxy')\n ], Beans.prototype, \"paginationProxy\", void 0);\n __decorate$1Y([\n Autowired('context')\n ], Beans.prototype, \"context\", void 0);\n __decorate$1Y([\n Autowired('columnApi')\n ], Beans.prototype, \"columnApi\", void 0);\n __decorate$1Y([\n Autowired('gridApi')\n ], Beans.prototype, \"gridApi\", void 0);\n __decorate$1Y([\n Autowired('gridOptionsService')\n ], Beans.prototype, \"gridOptionsService\", void 0);\n __decorate$1Y([\n Autowired('expressionService')\n ], Beans.prototype, \"expressionService\", void 0);\n __decorate$1Y([\n Autowired('environment')\n ], Beans.prototype, \"environment\", void 0);\n __decorate$1Y([\n Autowired('rowRenderer')\n ], Beans.prototype, \"rowRenderer\", void 0);\n __decorate$1Y([\n Autowired('templateService')\n ], Beans.prototype, \"templateService\", void 0);\n __decorate$1Y([\n Autowired('valueService')\n ], Beans.prototype, \"valueService\", void 0);\n __decorate$1Y([\n Autowired('eventService')\n ], Beans.prototype, \"eventService\", void 0);\n __decorate$1Y([\n Autowired('columnModel')\n ], Beans.prototype, \"columnModel\", void 0);\n __decorate$1Y([\n Autowired('headerNavigationService')\n ], Beans.prototype, \"headerNavigationService\", void 0);\n __decorate$1Y([\n Autowired('navigationService')\n ], Beans.prototype, \"navigationService\", void 0);\n __decorate$1Y([\n Autowired('columnAnimationService')\n ], Beans.prototype, \"columnAnimationService\", void 0);\n __decorate$1Y([\n Optional('rangeService')\n ], Beans.prototype, \"rangeService\", void 0);\n __decorate$1Y([\n Autowired('focusService')\n ], Beans.prototype, \"focusService\", void 0);\n __decorate$1Y([\n Autowired('popupService')\n ], Beans.prototype, \"popupService\", void 0);\n __decorate$1Y([\n Autowired('valueFormatterService')\n ], Beans.prototype, \"valueFormatterService\", void 0);\n __decorate$1Y([\n Autowired('stylingService')\n ], Beans.prototype, \"stylingService\", void 0);\n __decorate$1Y([\n Autowired('columnHoverService')\n ], Beans.prototype, \"columnHoverService\", void 0);\n __decorate$1Y([\n Autowired('userComponentFactory')\n ], Beans.prototype, \"userComponentFactory\", void 0);\n __decorate$1Y([\n Autowired('userComponentRegistry')\n ], Beans.prototype, \"userComponentRegistry\", void 0);\n __decorate$1Y([\n Autowired('animationFrameService')\n ], Beans.prototype, \"animationFrameService\", void 0);\n __decorate$1Y([\n Autowired('dragService')\n ], Beans.prototype, \"dragService\", void 0);\n __decorate$1Y([\n Autowired('dragAndDropService')\n ], Beans.prototype, \"dragAndDropService\", void 0);\n __decorate$1Y([\n Autowired('sortController')\n ], Beans.prototype, \"sortController\", void 0);\n __decorate$1Y([\n Autowired('filterManager')\n ], Beans.prototype, \"filterManager\", void 0);\n __decorate$1Y([\n Autowired('rowContainerHeightService')\n ], Beans.prototype, \"rowContainerHeightService\", void 0);\n __decorate$1Y([\n Autowired('frameworkOverrides')\n ], Beans.prototype, \"frameworkOverrides\", void 0);\n __decorate$1Y([\n Autowired('cellPositionUtils')\n ], Beans.prototype, \"cellPositionUtils\", void 0);\n __decorate$1Y([\n Autowired('rowPositionUtils')\n ], Beans.prototype, \"rowPositionUtils\", void 0);\n __decorate$1Y([\n Autowired('selectionService')\n ], Beans.prototype, \"selectionService\", void 0);\n __decorate$1Y([\n Optional('selectionHandleFactory')\n ], Beans.prototype, \"selectionHandleFactory\", void 0);\n __decorate$1Y([\n Autowired('rowCssClassCalculator')\n ], Beans.prototype, \"rowCssClassCalculator\", void 0);\n __decorate$1Y([\n Autowired('rowModel')\n ], Beans.prototype, \"rowModel\", void 0);\n __decorate$1Y([\n Autowired('ctrlsService')\n ], Beans.prototype, \"ctrlsService\", void 0);\n __decorate$1Y([\n Autowired('ctrlsFactory')\n ], Beans.prototype, \"ctrlsFactory\", void 0);\n __decorate$1Y([\n Autowired('agStackComponentsRegistry')\n ], Beans.prototype, \"agStackComponentsRegistry\", void 0);\n __decorate$1Y([\n Autowired('valueCache')\n ], Beans.prototype, \"valueCache\", void 0);\n __decorate$1Y([\n Autowired('rowNodeEventThrottle')\n ], Beans.prototype, \"rowNodeEventThrottle\", void 0);\n __decorate$1Y([\n Autowired('localeService')\n ], Beans.prototype, \"localeService\", void 0);\n __decorate$1Y([\n Autowired('valueParserService')\n ], Beans.prototype, \"valueParserService\", void 0);\n __decorate$1Y([\n Autowired('syncService')\n ], Beans.prototype, \"syncService\", void 0);\n __decorate$1Y([\n Autowired('ariaAnnouncementService')\n ], Beans.prototype, \"ariaAnnouncementService\", void 0);\n __decorate$1Y([\n PostConstruct\n ], Beans.prototype, \"postConstruct\", null);\n Beans = __decorate$1Y([\n Bean('beans')\n ], Beans);\n return Beans;\n}());\n\nvar __extends$27 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar CellMouseListenerFeature = /** @class */ (function (_super) {\n __extends$27(CellMouseListenerFeature, _super);\n function CellMouseListenerFeature(ctrl, beans, column) {\n var _this = _super.call(this) || this;\n _this.cellCtrl = ctrl;\n _this.beans = beans;\n _this.column = column;\n return _this;\n }\n CellMouseListenerFeature.prototype.onMouseEvent = function (eventName, mouseEvent) {\n if (isStopPropagationForAgGrid(mouseEvent)) {\n return;\n }\n switch (eventName) {\n case 'click':\n this.onCellClicked(mouseEvent);\n break;\n case 'mousedown':\n case 'touchstart':\n this.onMouseDown(mouseEvent);\n break;\n case 'dblclick':\n this.onCellDoubleClicked(mouseEvent);\n break;\n case 'mouseout':\n this.onMouseOut(mouseEvent);\n break;\n case 'mouseover':\n this.onMouseOver(mouseEvent);\n break;\n }\n };\n CellMouseListenerFeature.prototype.onCellClicked = function (mouseEvent) {\n var _this = this;\n // iPad doesn't have double click - so we need to mimic it to enable editing for iPad.\n if (this.isDoubleClickOnIPad()) {\n this.onCellDoubleClicked(mouseEvent);\n mouseEvent.preventDefault(); // if we don't do this, then iPad zooms in\n return;\n }\n var _a = this.beans, eventService = _a.eventService, rangeService = _a.rangeService, gridOptionsService = _a.gridOptionsService;\n var isMultiKey = mouseEvent.ctrlKey || mouseEvent.metaKey;\n if (rangeService && isMultiKey) {\n // the mousedown event has created the range already, so we only intersect if there is more than one\n // range on this cell\n if (rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()) > 1) {\n rangeService.intersectLastRange(true);\n }\n }\n var cellClickedEvent = this.cellCtrl.createEvent(mouseEvent, Events.EVENT_CELL_CLICKED);\n eventService.dispatchEvent(cellClickedEvent);\n var colDef = this.column.getColDef();\n if (colDef.onCellClicked) {\n // to make callback async, do in a timeout\n window.setTimeout(function () {\n _this.beans.frameworkOverrides.wrapOutgoing(function () {\n colDef.onCellClicked(cellClickedEvent);\n });\n }, 0);\n }\n var editOnSingleClick = (gridOptionsService.get('singleClickEdit') || colDef.singleClickEdit)\n && !gridOptionsService.get('suppressClickEdit');\n // edit on single click, but not if extending a range\n if (editOnSingleClick && !(mouseEvent.shiftKey && (rangeService === null || rangeService === void 0 ? void 0 : rangeService.getCellRanges().length) != 0)) {\n this.cellCtrl.startRowOrCellEdit();\n }\n };\n // returns true if on iPad and this is second 'click' event in 200ms\n CellMouseListenerFeature.prototype.isDoubleClickOnIPad = function () {\n if (!isIOSUserAgent() || isEventSupported('dblclick')) {\n return false;\n }\n var nowMillis = new Date().getTime();\n var res = nowMillis - this.lastIPadMouseClickEvent < 200;\n this.lastIPadMouseClickEvent = nowMillis;\n return res;\n };\n CellMouseListenerFeature.prototype.onCellDoubleClicked = function (mouseEvent) {\n var _this = this;\n var colDef = this.column.getColDef();\n // always dispatch event to eventService\n var cellDoubleClickedEvent = this.cellCtrl.createEvent(mouseEvent, Events.EVENT_CELL_DOUBLE_CLICKED);\n this.beans.eventService.dispatchEvent(cellDoubleClickedEvent);\n // check if colDef also wants to handle event\n if (typeof colDef.onCellDoubleClicked === 'function') {\n // to make the callback async, do in a timeout\n window.setTimeout(function () {\n _this.beans.frameworkOverrides.wrapOutgoing(function () {\n colDef.onCellDoubleClicked(cellDoubleClickedEvent);\n });\n }, 0);\n }\n var editOnDoubleClick = !this.beans.gridOptionsService.get('singleClickEdit')\n && !this.beans.gridOptionsService.get('suppressClickEdit');\n if (editOnDoubleClick) {\n this.cellCtrl.startRowOrCellEdit(null, mouseEvent);\n }\n };\n CellMouseListenerFeature.prototype.onMouseDown = function (mouseEvent) {\n var ctrlKey = mouseEvent.ctrlKey, metaKey = mouseEvent.metaKey, shiftKey = mouseEvent.shiftKey;\n var target = mouseEvent.target;\n var _a = this, cellCtrl = _a.cellCtrl, beans = _a.beans;\n var eventService = beans.eventService, rangeService = beans.rangeService, focusService = beans.focusService;\n // do not change the range for right-clicks inside an existing range\n if (this.isRightClickInExistingRange(mouseEvent)) {\n return;\n }\n var ranges = rangeService && rangeService.getCellRanges().length != 0;\n if (!shiftKey || !ranges) {\n // We only need to pass true to focusCell when the browser is Safari and we are trying\n // to focus the cell itself. This should never be true if the mousedown was triggered\n // due to a click on a cell editor for example.\n var forceBrowserFocus = (isBrowserSafari()) && !cellCtrl.isEditing() && !isFocusableFormField(target);\n cellCtrl.focusCell(forceBrowserFocus);\n }\n // if shift clicking, and a range exists, we keep the focus on the cell that started the\n // range as the user then changes the range selection.\n if (shiftKey && ranges && !focusService.isCellFocused(cellCtrl.getCellPosition())) {\n // this stops the cell from getting focused\n mouseEvent.preventDefault();\n var focusedCellPosition = focusService.getFocusedCell();\n if (focusedCellPosition) {\n var column = focusedCellPosition.column, rowIndex = focusedCellPosition.rowIndex, rowPinned = focusedCellPosition.rowPinned;\n var focusedRowCtrl = beans.rowRenderer.getRowByPosition({ rowIndex: rowIndex, rowPinned: rowPinned });\n var focusedCellCtrl = focusedRowCtrl === null || focusedRowCtrl === void 0 ? void 0 : focusedRowCtrl.getCellCtrl(column);\n // if the focused cell is editing, need to stop editing first\n if (focusedCellCtrl === null || focusedCellCtrl === void 0 ? void 0 : focusedCellCtrl.isEditing()) {\n focusedCellCtrl.stopEditing();\n }\n // focus could have been lost, so restore it to the starting cell in the range if needed\n focusService.setFocusedCell({\n column: column,\n rowIndex: rowIndex,\n rowPinned: rowPinned,\n forceBrowserFocus: true,\n preventScrollOnBrowserFocus: true,\n });\n }\n }\n // if we are clicking on a checkbox, we need to make sure the cell wrapping that checkbox\n // is focused but we don't want to change the range selection, so return here.\n if (this.containsWidget(target)) {\n return;\n }\n if (rangeService) {\n var thisCell = this.cellCtrl.getCellPosition();\n if (shiftKey) {\n rangeService.extendLatestRangeToCell(thisCell);\n }\n else {\n var isMultiKey = ctrlKey || metaKey;\n rangeService.setRangeToCell(thisCell, isMultiKey);\n }\n }\n eventService.dispatchEvent(this.cellCtrl.createEvent(mouseEvent, Events.EVENT_CELL_MOUSE_DOWN));\n };\n CellMouseListenerFeature.prototype.isRightClickInExistingRange = function (mouseEvent) {\n var rangeService = this.beans.rangeService;\n if (rangeService) {\n var cellInRange = rangeService.isCellInAnyRange(this.cellCtrl.getCellPosition());\n var isRightClick = mouseEvent.button === 2 || (mouseEvent.ctrlKey && this.beans.gridOptionsService.get('allowContextMenuWithControlKey'));\n if (cellInRange && isRightClick) {\n return true;\n }\n }\n return false;\n };\n CellMouseListenerFeature.prototype.containsWidget = function (target) {\n return isElementChildOfClass(target, 'ag-selection-checkbox', 3);\n };\n CellMouseListenerFeature.prototype.onMouseOut = function (mouseEvent) {\n if (this.mouseStayingInsideCell(mouseEvent)) {\n return;\n }\n var cellMouseOutEvent = this.cellCtrl.createEvent(mouseEvent, Events.EVENT_CELL_MOUSE_OUT);\n this.beans.eventService.dispatchEvent(cellMouseOutEvent);\n this.beans.columnHoverService.clearMouseOver();\n };\n CellMouseListenerFeature.prototype.onMouseOver = function (mouseEvent) {\n if (this.mouseStayingInsideCell(mouseEvent)) {\n return;\n }\n var cellMouseOverEvent = this.cellCtrl.createEvent(mouseEvent, Events.EVENT_CELL_MOUSE_OVER);\n this.beans.eventService.dispatchEvent(cellMouseOverEvent);\n this.beans.columnHoverService.setMouseOver([this.column]);\n };\n CellMouseListenerFeature.prototype.mouseStayingInsideCell = function (e) {\n if (!e.target || !e.relatedTarget) {\n return false;\n }\n var eGui = this.cellCtrl.getGui();\n var cellContainsTarget = eGui.contains(e.target);\n var cellContainsRelatedTarget = eGui.contains(e.relatedTarget);\n return cellContainsTarget && cellContainsRelatedTarget;\n };\n CellMouseListenerFeature.prototype.destroy = function () {\n };\n return CellMouseListenerFeature;\n}(Beans));\n\nvar __extends$26 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar CellKeyboardListenerFeature = /** @class */ (function (_super) {\n __extends$26(CellKeyboardListenerFeature, _super);\n function CellKeyboardListenerFeature(ctrl, beans, column, rowNode, rowCtrl) {\n var _this = _super.call(this) || this;\n _this.cellCtrl = ctrl;\n _this.beans = beans;\n _this.rowNode = rowNode;\n _this.rowCtrl = rowCtrl;\n return _this;\n }\n CellKeyboardListenerFeature.prototype.setComp = function (eGui) {\n this.eGui = eGui;\n };\n CellKeyboardListenerFeature.prototype.onKeyDown = function (event) {\n var key = event.key;\n switch (key) {\n case KeyCode.ENTER:\n this.onEnterKeyDown(event);\n break;\n case KeyCode.F2:\n this.onF2KeyDown(event);\n break;\n case KeyCode.ESCAPE:\n this.onEscapeKeyDown(event);\n break;\n case KeyCode.TAB:\n this.onTabKeyDown(event);\n break;\n case KeyCode.BACKSPACE:\n case KeyCode.DELETE:\n this.onBackspaceOrDeleteKeyDown(key, event);\n break;\n case KeyCode.DOWN:\n case KeyCode.UP:\n case KeyCode.RIGHT:\n case KeyCode.LEFT:\n this.onNavigationKeyDown(event, key);\n break;\n }\n };\n CellKeyboardListenerFeature.prototype.onNavigationKeyDown = function (event, key) {\n if (this.cellCtrl.isEditing()) {\n return;\n }\n if (event.shiftKey && this.cellCtrl.isRangeSelectionEnabled()) {\n this.onShiftRangeSelect(event);\n }\n else {\n this.beans.navigationService.navigateToNextCell(event, key, this.cellCtrl.getCellPosition(), true);\n }\n // if we don't prevent default, the grid will scroll with the navigation keys\n event.preventDefault();\n };\n CellKeyboardListenerFeature.prototype.onShiftRangeSelect = function (event) {\n if (!this.beans.rangeService) {\n return;\n }\n var endCell = this.beans.rangeService.extendLatestRangeInDirection(event);\n if (endCell) {\n this.beans.navigationService.ensureCellVisible(endCell);\n }\n };\n CellKeyboardListenerFeature.prototype.onTabKeyDown = function (event) {\n this.beans.navigationService.onTabKeyDown(this.cellCtrl, event);\n };\n CellKeyboardListenerFeature.prototype.onBackspaceOrDeleteKeyDown = function (key, event) {\n var _a = this, cellCtrl = _a.cellCtrl, beans = _a.beans, rowNode = _a.rowNode;\n var gridOptionsService = beans.gridOptionsService, rangeService = beans.rangeService, eventService = beans.eventService;\n if (cellCtrl.isEditing()) {\n return;\n }\n eventService.dispatchEvent({ type: Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START });\n if (isDeleteKey(key, gridOptionsService.get('enableCellEditingOnBackspace'))) {\n if (rangeService && gridOptionsService.get('enableRangeSelection')) {\n rangeService.clearCellRangeCellValues({ dispatchWrapperEvents: true, wrapperEventSource: 'deleteKey' });\n }\n else if (cellCtrl.isCellEditable()) {\n rowNode.setDataValue(cellCtrl.getColumn(), null, 'cellClear');\n }\n }\n else {\n cellCtrl.startRowOrCellEdit(key, event);\n }\n eventService.dispatchEvent({ type: Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END });\n };\n CellKeyboardListenerFeature.prototype.onEnterKeyDown = function (e) {\n if (this.cellCtrl.isEditing() || this.rowCtrl.isEditing()) {\n this.cellCtrl.stopEditingAndFocus(false, e.shiftKey);\n }\n else {\n if (this.beans.gridOptionsService.get('enterNavigatesVertically')) {\n var key = e.shiftKey ? KeyCode.UP : KeyCode.DOWN;\n this.beans.navigationService.navigateToNextCell(null, key, this.cellCtrl.getCellPosition(), false);\n }\n else {\n this.cellCtrl.startRowOrCellEdit(KeyCode.ENTER, e);\n if (this.cellCtrl.isEditing()) {\n // if we started editing, then we need to prevent default, otherwise the Enter action can get\n // applied to the cell editor. this happened, for example, with largeTextCellEditor where not\n // preventing default results in a 'new line' character getting inserted in the text area\n // when the editing was started\n e.preventDefault();\n }\n }\n }\n };\n CellKeyboardListenerFeature.prototype.onF2KeyDown = function (event) {\n if (!this.cellCtrl.isEditing()) {\n this.cellCtrl.startRowOrCellEdit(KeyCode.F2, event);\n }\n };\n CellKeyboardListenerFeature.prototype.onEscapeKeyDown = function (event) {\n if (this.cellCtrl.isEditing()) {\n this.cellCtrl.stopRowOrCellEdit(true);\n this.cellCtrl.focusCell(true);\n }\n };\n CellKeyboardListenerFeature.prototype.processCharacter = function (event) {\n // check this, in case focus is on a (for example) a text field inside the cell,\n // in which cse we should not be listening for these key pressed\n var eventTarget = event.target;\n var eventOnChildComponent = eventTarget !== this.eGui;\n if (eventOnChildComponent || this.cellCtrl.isEditing()) {\n return;\n }\n var key = event.key;\n if (key === ' ') {\n this.onSpaceKeyDown(event);\n }\n else {\n this.cellCtrl.startRowOrCellEdit(key, event);\n // if we don't prevent default, then the event also gets applied to the text field\n // (at least when doing the default editor), but we need to allow the editor to decide\n // what it wants to do. we only do this IF editing was started - otherwise it messes\n // up when the use is not doing editing, but using rendering with text fields in cellRenderer\n // (as it would block the the user from typing into text fields).\n event.preventDefault();\n }\n };\n CellKeyboardListenerFeature.prototype.onSpaceKeyDown = function (event) {\n var gridOptionsService = this.beans.gridOptionsService;\n if (!this.cellCtrl.isEditing() && gridOptionsService.isRowSelection()) {\n var currentSelection = this.rowNode.isSelected();\n var newSelection = !currentSelection;\n if (newSelection || !gridOptionsService.get('suppressRowDeselection')) {\n var groupSelectsFiltered = this.beans.gridOptionsService.get('groupSelectsFiltered');\n var updatedCount = this.rowNode.setSelectedParams({\n newValue: newSelection,\n rangeSelect: event.shiftKey,\n groupSelectsFiltered: groupSelectsFiltered,\n event: event,\n source: 'spaceKey',\n });\n if (currentSelection === undefined && updatedCount === 0) {\n this.rowNode.setSelectedParams({\n newValue: false,\n rangeSelect: event.shiftKey,\n groupSelectsFiltered: groupSelectsFiltered,\n event: event,\n source: 'spaceKey',\n });\n }\n }\n }\n // prevent default as space key, by default, moves browser scroll down\n event.preventDefault();\n };\n CellKeyboardListenerFeature.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n return CellKeyboardListenerFeature;\n}(BeanStub));\n\nvar __extends$25 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1X = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar DndSourceComp = /** @class */ (function (_super) {\n __extends$25(DndSourceComp, _super);\n function DndSourceComp(rowNode, column, eCell) {\n var _this = _super.call(this, /* html */ \"
\") || this;\n _this.rowNode = rowNode;\n _this.column = column;\n _this.eCell = eCell;\n return _this;\n }\n DndSourceComp.prototype.postConstruct = function () {\n var eGui = this.getGui();\n eGui.appendChild(createIconNoSpan('rowDrag', this.gridOptionsService, null));\n // we need to stop the event propagation here to avoid starting a range selection while dragging\n this.addGuiEventListener('mousedown', function (e) {\n e.stopPropagation();\n });\n this.addDragSource();\n this.checkVisibility();\n };\n DndSourceComp.prototype.addDragSource = function () {\n this.addGuiEventListener('dragstart', this.onDragStart.bind(this));\n };\n DndSourceComp.prototype.onDragStart = function (dragEvent) {\n var _this = this;\n var providedOnRowDrag = this.column.getColDef().dndSourceOnRowDrag;\n dragEvent.dataTransfer.setDragImage(this.eCell, 0, 0);\n // default behaviour is to convert data to json and set into drag component\n var defaultOnRowDrag = function () {\n try {\n var jsonData = JSON.stringify(_this.rowNode.data);\n dragEvent.dataTransfer.setData('application/json', jsonData);\n dragEvent.dataTransfer.setData('text/plain', jsonData);\n }\n catch (e) {\n // if we cannot convert the data to json, then we do not set the type\n }\n };\n if (providedOnRowDrag) {\n var params = this.gridOptionsService.addGridCommonParams({\n rowNode: this.rowNode, dragEvent: dragEvent\n });\n providedOnRowDrag(params);\n }\n else {\n defaultOnRowDrag();\n }\n };\n DndSourceComp.prototype.checkVisibility = function () {\n var visible = this.column.isDndSource(this.rowNode);\n this.setDisplayed(visible);\n };\n __decorate$1X([\n PostConstruct\n ], DndSourceComp.prototype, \"postConstruct\", null);\n return DndSourceComp;\n}(Component));\n\nvar __read$r = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$m = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar CSS_FIRST_COLUMN = 'ag-column-first';\nvar CSS_LAST_COLUMN = 'ag-column-last';\nvar CssClassApplier = /** @class */ (function () {\n function CssClassApplier() {\n }\n CssClassApplier.getHeaderClassesFromColDef = function (abstractColDef, gridOptionsService, column, columnGroup) {\n if (missing(abstractColDef)) {\n return [];\n }\n return this.getColumnClassesFromCollDef(abstractColDef.headerClass, abstractColDef, gridOptionsService, column, columnGroup);\n };\n CssClassApplier.getToolPanelClassesFromColDef = function (abstractColDef, gridOptionsService, column, columnGroup) {\n if (missing(abstractColDef)) {\n return [];\n }\n return this.getColumnClassesFromCollDef(abstractColDef.toolPanelClass, abstractColDef, gridOptionsService, column, columnGroup);\n };\n CssClassApplier.refreshFirstAndLastStyles = function (comp, column, columnModel) {\n comp.addOrRemoveCssClass(CSS_FIRST_COLUMN, columnModel.isColumnAtEdge(column, 'first'));\n comp.addOrRemoveCssClass(CSS_LAST_COLUMN, columnModel.isColumnAtEdge(column, 'last'));\n };\n CssClassApplier.getClassParams = function (abstractColDef, gridOptionsService, column, columnGroup) {\n return gridOptionsService.addGridCommonParams({\n // bad naming, as colDef here can be a group or a column,\n // however most people won't appreciate the difference,\n // so keeping it as colDef to avoid confusion.\n colDef: abstractColDef,\n column: column,\n columnGroup: columnGroup\n });\n };\n CssClassApplier.getColumnClassesFromCollDef = function (classesOrFunc, abstractColDef, gridOptionsService, column, columnGroup) {\n if (missing(classesOrFunc)) {\n return [];\n }\n var classToUse;\n if (typeof classesOrFunc === 'function') {\n var params = this.getClassParams(abstractColDef, gridOptionsService, column, columnGroup);\n classToUse = classesOrFunc(params);\n }\n else {\n classToUse = classesOrFunc;\n }\n if (typeof classToUse === 'string') {\n return [classToUse];\n }\n if (Array.isArray(classToUse)) {\n return __spreadArray$m([], __read$r(classToUse), false);\n }\n return [];\n };\n return CssClassApplier;\n}());\n\nvar __extends$24 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$d = ( false) || function () {\n __assign$d = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$d.apply(this, arguments);\n};\nvar CSS_CELL = 'ag-cell';\nvar CSS_AUTO_HEIGHT = 'ag-cell-auto-height';\nvar CSS_NORMAL_HEIGHT = 'ag-cell-normal-height';\nvar CSS_CELL_FOCUS = 'ag-cell-focus';\nvar CSS_CELL_FIRST_RIGHT_PINNED = 'ag-cell-first-right-pinned';\nvar CSS_CELL_LAST_LEFT_PINNED = 'ag-cell-last-left-pinned';\nvar CSS_CELL_NOT_INLINE_EDITING = 'ag-cell-not-inline-editing';\nvar CSS_COLUMN_HOVER = 'ag-column-hover';\nvar CSS_CELL_WRAP_TEXT = 'ag-cell-wrap-text';\nvar instanceIdSequence$3 = 0;\nvar CellCtrl = /** @class */ (function (_super) {\n __extends$24(CellCtrl, _super);\n function CellCtrl(column, rowNode, beans, rowCtrl) {\n var _this = _super.call(this) || this;\n _this.cellRangeFeature = null;\n _this.cellPositionFeature = null;\n _this.cellCustomStyleFeature = null;\n _this.tooltipFeature = null;\n _this.cellMouseListenerFeature = null;\n _this.cellKeyboardListenerFeature = null;\n _this.suppressRefreshCell = false;\n _this.onCellCompAttachedFuncs = [];\n _this.column = column;\n _this.rowNode = rowNode;\n _this.beans = beans;\n _this.rowCtrl = rowCtrl;\n // unique id to this instance, including the column ID to help with debugging in React as it's used in 'key'\n _this.instanceId = column.getId() + '-' + instanceIdSequence$3++;\n _this.colIdSanitised = escapeString(_this.column.getId());\n if (!beans.gridOptionsService.get('suppressCellFocus')) {\n _this.tabIndex = -1;\n }\n _this.createCellPosition();\n _this.addFeatures();\n _this.updateAndFormatValue(false);\n return _this;\n }\n CellCtrl.prototype.shouldRestoreFocus = function () {\n return this.beans.focusService.shouldRestoreFocus(this.cellPosition);\n };\n CellCtrl.prototype.addFeatures = function () {\n var _this = this;\n this.cellPositionFeature = new CellPositionFeature(this, this.beans);\n this.addDestroyFunc(function () { var _a; (_a = _this.cellPositionFeature) === null || _a === void 0 ? void 0 : _a.destroy(); _this.cellPositionFeature = null; });\n this.cellCustomStyleFeature = new CellCustomStyleFeature(this, this.beans);\n this.addDestroyFunc(function () { var _a; (_a = _this.cellCustomStyleFeature) === null || _a === void 0 ? void 0 : _a.destroy(); _this.cellCustomStyleFeature = null; });\n this.cellMouseListenerFeature = new CellMouseListenerFeature(this, this.beans, this.column);\n this.addDestroyFunc(function () { var _a; (_a = _this.cellMouseListenerFeature) === null || _a === void 0 ? void 0 : _a.destroy(); _this.cellMouseListenerFeature = null; });\n this.cellKeyboardListenerFeature = new CellKeyboardListenerFeature(this, this.beans, this.column, this.rowNode, this.rowCtrl);\n this.addDestroyFunc(function () { var _a; (_a = _this.cellKeyboardListenerFeature) === null || _a === void 0 ? void 0 : _a.destroy(); _this.cellKeyboardListenerFeature = null; });\n if (this.column.isTooltipEnabled()) {\n this.enableTooltipFeature();\n this.addDestroyFunc(function () { _this.disableTooltipFeature(); });\n }\n var rangeSelectionEnabled = this.beans.rangeService && this.beans.gridOptionsService.get('enableRangeSelection');\n if (rangeSelectionEnabled) {\n this.cellRangeFeature = new CellRangeFeature(this.beans, this);\n this.addDestroyFunc(function () { var _a; (_a = _this.cellRangeFeature) === null || _a === void 0 ? void 0 : _a.destroy(); _this.cellRangeFeature = null; });\n }\n };\n CellCtrl.prototype.enableTooltipFeature = function () {\n var _this = this;\n var getTooltipValue = function () {\n var colDef = _this.column.getColDef();\n var data = _this.rowNode.data;\n if (colDef.tooltipField && exists(data)) {\n return getValueUsingField(data, colDef.tooltipField, _this.column.isTooltipFieldContainsDots());\n }\n var valueGetter = colDef.tooltipValueGetter;\n if (valueGetter) {\n return valueGetter(_this.beans.gridOptionsService.addGridCommonParams({\n location: 'cell',\n colDef: _this.column.getColDef(),\n column: _this.column,\n rowIndex: _this.cellPosition.rowIndex,\n node: _this.rowNode,\n data: _this.rowNode.data,\n value: _this.value,\n valueFormatted: _this.valueFormatted,\n }));\n }\n return null;\n };\n var tooltipCtrl = {\n getColumn: function () { return _this.column; },\n getColDef: function () { return _this.column.getColDef(); },\n getRowIndex: function () { return _this.cellPosition.rowIndex; },\n getRowNode: function () { return _this.rowNode; },\n getGui: function () { return _this.getGui(); },\n getLocation: function () { return 'cell'; },\n getTooltipValue: getTooltipValue,\n // this makes no sense, why is the cell formatted value passed to the tooltip???\n getValueFormatted: function () { return _this.valueFormatted; }\n };\n this.tooltipFeature = new TooltipFeature(tooltipCtrl, this.beans);\n };\n CellCtrl.prototype.disableTooltipFeature = function () {\n if (!this.tooltipFeature) {\n return;\n }\n this.tooltipFeature.destroy();\n this.tooltipFeature = null;\n };\n CellCtrl.prototype.setComp = function (comp, eGui, eCellWrapper, printLayout, startEditing) {\n var _a, _b, _c, _d;\n this.cellComp = comp;\n this.eGui = eGui;\n this.printLayout = printLayout;\n this.addDomData();\n this.onCellFocused(this.focusEventToRestore);\n this.applyStaticCssClasses();\n this.setWrapText();\n this.onFirstRightPinnedChanged();\n this.onLastLeftPinnedChanged();\n this.onColumnHover();\n this.setupControlComps();\n this.setupAutoHeight(eCellWrapper);\n this.refreshFirstAndLastStyles();\n this.refreshAriaColIndex();\n (_a = this.cellPositionFeature) === null || _a === void 0 ? void 0 : _a.setComp(eGui);\n (_b = this.cellCustomStyleFeature) === null || _b === void 0 ? void 0 : _b.setComp(comp);\n (_c = this.tooltipFeature) === null || _c === void 0 ? void 0 : _c.setComp(eGui);\n (_d = this.cellKeyboardListenerFeature) === null || _d === void 0 ? void 0 : _d.setComp(this.eGui);\n if (this.cellRangeFeature) {\n this.cellRangeFeature.setComp(comp, eGui);\n }\n if (startEditing && this.isCellEditable()) {\n this.startEditing();\n }\n else {\n this.showValue();\n }\n if (this.onCellCompAttachedFuncs.length) {\n this.onCellCompAttachedFuncs.forEach(function (func) { return func(); });\n this.onCellCompAttachedFuncs = [];\n }\n };\n CellCtrl.prototype.setupAutoHeight = function (eCellWrapper) {\n var _this = this;\n this.isAutoHeight = this.column.isAutoHeight();\n if (!this.isAutoHeight || !eCellWrapper) {\n return;\n }\n var eParentCell = eCellWrapper.parentElement;\n // taking minRowHeight from getRowHeightForNode means the getRowHeight() callback is used,\n // thus allowing different min heights for different rows.\n var minRowHeight = this.beans.gridOptionsService.getRowHeightForNode(this.rowNode).height;\n var measureHeight = function (timesCalled) {\n if (_this.editing) {\n return;\n }\n // because of the retry's below, it's possible the retry's go beyond\n // the rows life.\n if (!_this.isAlive()) {\n return;\n }\n var _a = getElementSize(eParentCell), paddingTop = _a.paddingTop, paddingBottom = _a.paddingBottom, borderBottomWidth = _a.borderBottomWidth, borderTopWidth = _a.borderTopWidth;\n var extraHeight = paddingTop + paddingBottom + borderBottomWidth + borderTopWidth;\n var wrapperHeight = eCellWrapper.offsetHeight;\n var autoHeight = wrapperHeight + extraHeight;\n if (timesCalled < 5) {\n // if not in doc yet, means framework not yet inserted, so wait for next VM turn,\n // maybe it will be ready next VM turn\n var doc = _this.beans.gridOptionsService.getDocument();\n var notYetInDom = !doc || !doc.contains(eCellWrapper);\n // this happens in React, where React hasn't put any content in. we say 'possibly'\n // as a) may not be React and b) the cell could be empty anyway\n var possiblyNoContentYet = autoHeight == 0;\n if (notYetInDom || possiblyNoContentYet) {\n window.setTimeout(function () { return measureHeight(timesCalled + 1); }, 0);\n return;\n }\n }\n var newHeight = Math.max(autoHeight, minRowHeight);\n _this.rowNode.setRowAutoHeight(newHeight, _this.column);\n };\n var listener = function () { return measureHeight(0); };\n // do once to set size in case size doesn't change, common when cell is blank\n listener();\n var destroyResizeObserver = this.beans.resizeObserverService.observeResize(eCellWrapper, listener);\n this.addDestroyFunc(function () {\n destroyResizeObserver();\n _this.rowNode.setRowAutoHeight(undefined, _this.column);\n });\n };\n CellCtrl.prototype.getCellAriaRole = function () {\n var _a;\n return (_a = this.column.getColDef().cellAriaRole) !== null && _a !== void 0 ? _a : 'gridcell';\n };\n CellCtrl.prototype.getInstanceId = function () {\n return this.instanceId;\n };\n CellCtrl.prototype.getIncludeSelection = function () {\n return this.includeSelection;\n };\n CellCtrl.prototype.getIncludeRowDrag = function () {\n return this.includeRowDrag;\n };\n CellCtrl.prototype.getIncludeDndSource = function () {\n return this.includeDndSource;\n };\n CellCtrl.prototype.getColumnIdSanitised = function () {\n return this.colIdSanitised;\n };\n CellCtrl.prototype.getTabIndex = function () {\n return this.tabIndex;\n };\n CellCtrl.prototype.isCellRenderer = function () {\n var colDef = this.column.getColDef();\n return colDef.cellRenderer != null || colDef.cellRendererSelector != null;\n };\n CellCtrl.prototype.getValueToDisplay = function () {\n return this.valueFormatted != null ? this.valueFormatted : this.value;\n };\n CellCtrl.prototype.showValue = function (forceNewCellRendererInstance) {\n if (forceNewCellRendererInstance === void 0) { forceNewCellRendererInstance = false; }\n var valueToDisplay = this.getValueToDisplay();\n var compDetails;\n if (this.isCellRenderer()) {\n var params = this.createCellRendererParams();\n compDetails = this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(), params);\n }\n this.cellComp.setRenderDetails(compDetails, valueToDisplay, forceNewCellRendererInstance);\n this.refreshHandle();\n };\n CellCtrl.prototype.setupControlComps = function () {\n var colDef = this.column.getColDef();\n this.includeSelection = this.isIncludeControl(colDef.checkboxSelection);\n this.includeRowDrag = this.isIncludeControl(colDef.rowDrag);\n this.includeDndSource = this.isIncludeControl(colDef.dndSource);\n this.cellComp.setIncludeSelection(this.includeSelection);\n this.cellComp.setIncludeDndSource(this.includeDndSource);\n this.cellComp.setIncludeRowDrag(this.includeRowDrag);\n };\n CellCtrl.prototype.isForceWrapper = function () {\n // text selection requires the value to be wrapped in another element\n var forceWrapper = this.beans.gridOptionsService.get('enableCellTextSelection') || this.column.isAutoHeight();\n return forceWrapper;\n };\n CellCtrl.prototype.isIncludeControl = function (value) {\n var rowNodePinned = this.rowNode.rowPinned != null;\n var isFunc = typeof value === 'function';\n var res = rowNodePinned ? false : isFunc || value === true;\n return res;\n };\n CellCtrl.prototype.refreshShouldDestroy = function () {\n var colDef = this.column.getColDef();\n var selectionChanged = this.includeSelection != this.isIncludeControl(colDef.checkboxSelection);\n var rowDragChanged = this.includeRowDrag != this.isIncludeControl(colDef.rowDrag);\n var dndSourceChanged = this.includeDndSource != this.isIncludeControl(colDef.dndSource);\n return selectionChanged || rowDragChanged || dndSourceChanged;\n };\n // either called internally if single cell editing, or called by rowRenderer if row editing\n CellCtrl.prototype.startEditing = function (key, cellStartedEdit, event) {\n var _this = this;\n if (key === void 0) { key = null; }\n if (cellStartedEdit === void 0) { cellStartedEdit = false; }\n if (event === void 0) { event = null; }\n if (!this.isCellEditable() || this.editing) {\n return;\n }\n // because of async in React, the cellComp may not be set yet, if no cellComp then we are\n // yet to initialise the cell, so we re-schedule this operation for when celLComp is attached\n if (!this.cellComp) {\n this.onCellCompAttachedFuncs.push(function () { _this.startEditing(key, cellStartedEdit, event); });\n return;\n }\n var editorParams = this.createCellEditorParams(key, cellStartedEdit);\n var colDef = this.column.getColDef();\n var compDetails = this.beans.userComponentFactory.getCellEditorDetails(colDef, editorParams);\n this.editCompDetails = compDetails;\n // if cellEditorSelector was used, we give preference to popup and popupPosition from the selector\n var popup = (compDetails === null || compDetails === void 0 ? void 0 : compDetails.popupFromSelector) != null ? compDetails.popupFromSelector : !!colDef.cellEditorPopup;\n var position = (compDetails === null || compDetails === void 0 ? void 0 : compDetails.popupPositionFromSelector) != null ? compDetails.popupPositionFromSelector : colDef.cellEditorPopupPosition;\n this.setEditing(true);\n this.cellComp.setEditDetails(compDetails, popup, position, this.beans.gridOptionsService.get('reactiveCustomComponents'));\n var e = this.createEvent(event, Events.EVENT_CELL_EDITING_STARTED);\n this.beans.eventService.dispatchEvent(e);\n };\n CellCtrl.prototype.setEditing = function (editing) {\n if (this.editing === editing) {\n return;\n }\n this.editing = editing;\n this.refreshHandle();\n };\n // pass in 'true' to cancel the editing.\n CellCtrl.prototype.stopRowOrCellEdit = function (cancel) {\n if (cancel === void 0) { cancel = false; }\n if (this.beans.gridOptionsService.get('editType') === 'fullRow') {\n this.rowCtrl.stopEditing(cancel);\n }\n else {\n this.stopEditing(cancel);\n }\n };\n CellCtrl.prototype.onPopupEditorClosed = function () {\n if (!this.isEditing()) {\n return;\n }\n // note: this happens because of a click outside of the grid or if the popupEditor\n // is closed with `Escape` key. if another cell was clicked, then the editing will\n // have already stopped and returned on the conditional above.\n this.stopEditingAndFocus();\n };\n CellCtrl.prototype.takeValueFromCellEditor = function (cancel) {\n var noValueResult = { newValueExists: false };\n if (cancel) {\n return noValueResult;\n }\n var cellEditor = this.cellComp.getCellEditor();\n if (!cellEditor) {\n return noValueResult;\n }\n var userWantsToCancel = cellEditor.isCancelAfterEnd && cellEditor.isCancelAfterEnd();\n if (userWantsToCancel) {\n return noValueResult;\n }\n var newValue = cellEditor.getValue();\n return {\n newValue: newValue,\n newValueExists: true\n };\n };\n /**\n * @returns `True` if the value changes, otherwise `False`.\n */\n CellCtrl.prototype.saveNewValue = function (oldValue, newValue) {\n if (newValue === oldValue) {\n return false;\n }\n // we suppressRefreshCell because the call to rowNode.setDataValue() results in change detection\n // getting triggered, which results in all cells getting refreshed. we do not want this refresh\n // to happen on this call as we want to call it explicitly below. otherwise refresh gets called twice.\n // if we only did this refresh (and not the one below) then the cell would flash and not be forced.\n this.suppressRefreshCell = true;\n var valueChanged = this.rowNode.setDataValue(this.column, newValue, 'edit');\n this.suppressRefreshCell = false;\n return valueChanged;\n };\n /**\n * Ends the Cell Editing\n * @param cancel `True` if the edit process is being canceled.\n * @returns `True` if the value of the `GridCell` has been updated, otherwise `False`.\n */\n CellCtrl.prototype.stopEditing = function (cancel) {\n if (cancel === void 0) { cancel = false; }\n if (!this.editing) {\n return false;\n }\n var _a = this.takeValueFromCellEditor(cancel), newValue = _a.newValue, newValueExists = _a.newValueExists;\n var oldValue = this.rowNode.getValueFromValueService(this.column);\n var valueChanged = false;\n if (newValueExists) {\n valueChanged = this.saveNewValue(oldValue, newValue);\n }\n this.setEditing(false);\n this.cellComp.setEditDetails(); // passing nothing stops editing\n this.editCompDetails = undefined;\n this.updateAndFormatValue(false);\n this.refreshCell({ forceRefresh: true, suppressFlash: true });\n this.dispatchEditingStoppedEvent(oldValue, newValue, !cancel && !!valueChanged);\n return valueChanged;\n };\n CellCtrl.prototype.dispatchEditingStoppedEvent = function (oldValue, newValue, valueChanged) {\n var editingStoppedEvent = __assign$d(__assign$d({}, this.createEvent(null, Events.EVENT_CELL_EDITING_STOPPED)), { oldValue: oldValue, newValue: newValue, valueChanged: valueChanged });\n this.beans.eventService.dispatchEvent(editingStoppedEvent);\n };\n CellCtrl.prototype.createCellEditorParams = function (key, cellStartedEdit) {\n return this.beans.gridOptionsService.addGridCommonParams({\n value: this.rowNode.getValueFromValueService(this.column),\n eventKey: key,\n column: this.column,\n colDef: this.column.getColDef(),\n rowIndex: this.getCellPosition().rowIndex,\n node: this.rowNode,\n data: this.rowNode.data,\n cellStartedEdit: cellStartedEdit,\n onKeyDown: this.onKeyDown.bind(this),\n stopEditing: this.stopEditingAndFocus.bind(this),\n eGridCell: this.getGui(),\n parseValue: this.parseValue.bind(this),\n formatValue: this.formatValue.bind(this)\n });\n };\n CellCtrl.prototype.createCellRendererParams = function () {\n var _this = this;\n var res = this.beans.gridOptionsService.addGridCommonParams({\n value: this.value,\n valueFormatted: this.valueFormatted,\n getValue: function () { return _this.rowNode.getValueFromValueService(_this.column); },\n setValue: function (value) { return _this.beans.valueService.setValue(_this.rowNode, _this.column, value); },\n formatValue: this.formatValue.bind(this),\n data: this.rowNode.data,\n node: this.rowNode,\n pinned: this.column.getPinned(),\n colDef: this.column.getColDef(),\n column: this.column,\n rowIndex: this.getCellPosition().rowIndex,\n refreshCell: this.refreshCell.bind(this),\n eGridCell: this.getGui(),\n eParentOfValue: this.cellComp.getParentOfValue(),\n registerRowDragger: function (rowDraggerElement, dragStartPixels, value, suppressVisibilityChange) { return _this.registerRowDragger(rowDraggerElement, dragStartPixels, suppressVisibilityChange); },\n });\n return res;\n };\n CellCtrl.prototype.parseValue = function (newValue) {\n return this.beans.valueParserService.parseValue(this.column, this.rowNode, newValue, this.getValue());\n };\n CellCtrl.prototype.setFocusOutOnEditor = function () {\n if (!this.editing) {\n return;\n }\n var cellEditor = this.cellComp.getCellEditor();\n if (cellEditor && cellEditor.focusOut) {\n cellEditor.focusOut();\n }\n };\n CellCtrl.prototype.setFocusInOnEditor = function () {\n if (!this.editing) {\n return;\n }\n var cellEditor = this.cellComp.getCellEditor();\n if (cellEditor && cellEditor.focusIn) {\n // if the editor is present, then we just focus it\n cellEditor.focusIn();\n }\n else {\n // if the editor is not present, it means async cell editor (eg React fibre)\n // and we are trying to set focus before the cell editor is present, so we\n // focus the cell instead\n this.focusCell(true);\n }\n };\n CellCtrl.prototype.onCellChanged = function (event) {\n var eventImpactsThisCell = event.column === this.column;\n if (eventImpactsThisCell) {\n this.refreshCell({});\n }\n };\n CellCtrl.prototype.refreshOrDestroyCell = function (params) {\n var _a;\n if (this.refreshShouldDestroy()) {\n (_a = this.rowCtrl) === null || _a === void 0 ? void 0 : _a.refreshCell(this);\n }\n else {\n this.refreshCell(params);\n }\n };\n // + stop editing {forceRefresh: true, suppressFlash: true}\n // + event cellChanged {}\n // + cellRenderer.params.refresh() {} -> method passes 'as is' to the cellRenderer, so params could be anything\n // + rowCtrl: event dataChanged {suppressFlash: !update, newData: !update}\n // + rowCtrl: api refreshCells() {animate: true/false}\n // + rowRenderer: api softRefreshView() {}\n CellCtrl.prototype.refreshCell = function (params) {\n var _a, _b, _c;\n // if we are in the middle of 'stopEditing', then we don't refresh here, as refresh gets called explicitly\n if (this.suppressRefreshCell || this.editing) {\n return;\n }\n var colDef = this.column.getColDef();\n var newData = params != null && !!params.newData;\n var suppressFlash = (params != null && !!params.suppressFlash) || !!colDef.suppressCellFlash;\n // we always refresh if cell has no value - this can happen when user provides Cell Renderer and the\n // cell renderer doesn't rely on a value, instead it could be looking directly at the data, or maybe\n // printing the current time (which would be silly)???. Generally speaking\n // non of {field, valueGetter, showRowGroup} is bad in the users application, however for this edge case, it's\n // best always refresh and take the performance hit rather than never refresh and users complaining in support\n // that cells are not updating.\n var noValueProvided = colDef.field == null && colDef.valueGetter == null && colDef.showRowGroup == null;\n var forceRefresh = (params && params.forceRefresh) || noValueProvided || newData;\n var isCellCompReady = !!this.cellComp;\n // Only worth comparing values if the cellComp is ready\n var valuesDifferent = this.updateAndFormatValue(isCellCompReady);\n var dataNeedsUpdating = forceRefresh || valuesDifferent;\n // In React, due to async, it's possible a refresh was asked for before the CellComp was created and calls setComp()\n // So we do not run the cell comp refresh logic at this point in time.\n if (!isCellCompReady) {\n return;\n }\n if (dataNeedsUpdating) {\n // if it's 'new data', then we don't refresh the cellRenderer, even if refresh method is available.\n // this is because if the whole data is new (ie we are showing stock price 'BBA' now and not 'SSD')\n // then we are not showing a movement in the stock price, rather we are showing different stock.\n this.showValue(newData);\n // we don't want to flash the cells when processing a filter change, as otherwise the UI would\n // be to busy. see comment in FilterManager with regards processingFilterChange\n var processingFilterChange = this.beans.filterManager.isSuppressFlashingCellsBecauseFiltering();\n var flashCell = !suppressFlash && !processingFilterChange &&\n (this.beans.gridOptionsService.get('enableCellChangeFlash') || colDef.enableCellChangeFlash);\n if (flashCell) {\n this.flashCell();\n }\n (_a = this.cellCustomStyleFeature) === null || _a === void 0 ? void 0 : _a.applyUserStyles();\n (_b = this.cellCustomStyleFeature) === null || _b === void 0 ? void 0 : _b.applyClassesFromColDef();\n }\n this.refreshToolTip();\n // we do cellClassRules even if the value has not changed, so that users who have rules that\n // look at other parts of the row (where the other part of the row might of changed) will work.\n (_c = this.cellCustomStyleFeature) === null || _c === void 0 ? void 0 : _c.applyCellClassRules();\n };\n // cell editors call this, when they want to stop for reasons other\n // than what we pick up on. eg selecting from a dropdown ends editing.\n CellCtrl.prototype.stopEditingAndFocus = function (suppressNavigateAfterEdit, shiftKey) {\n if (suppressNavigateAfterEdit === void 0) { suppressNavigateAfterEdit = false; }\n if (shiftKey === void 0) { shiftKey = false; }\n this.stopRowOrCellEdit();\n this.focusCell(true);\n if (!suppressNavigateAfterEdit) {\n this.navigateAfterEdit(shiftKey);\n }\n };\n CellCtrl.prototype.navigateAfterEdit = function (shiftKey) {\n var enterNavigatesVerticallyAfterEdit = this.beans.gridOptionsService.get('enterNavigatesVerticallyAfterEdit');\n if (enterNavigatesVerticallyAfterEdit) {\n var key = shiftKey ? KeyCode.UP : KeyCode.DOWN;\n this.beans.navigationService.navigateToNextCell(null, key, this.getCellPosition(), false);\n }\n };\n // user can also call this via API\n CellCtrl.prototype.flashCell = function (delays) {\n var _a, _b;\n var flashDuration = (_a = delays === null || delays === void 0 ? void 0 : delays.flashDuration) !== null && _a !== void 0 ? _a : delays === null || delays === void 0 ? void 0 : delays.flashDelay;\n var fadeDuration = (_b = delays === null || delays === void 0 ? void 0 : delays.fadeDuration) !== null && _b !== void 0 ? _b : delays === null || delays === void 0 ? void 0 : delays.fadeDelay;\n this.animateCell('data-changed', flashDuration, fadeDuration);\n };\n CellCtrl.prototype.animateCell = function (cssName, flashDuration, fadeDuration) {\n var _this = this;\n if (!this.cellComp) {\n return;\n }\n var fullName = \"ag-cell-\".concat(cssName);\n var animationFullName = \"ag-cell-\".concat(cssName, \"-animation\");\n var gridOptionsService = this.beans.gridOptionsService;\n if (!flashDuration) {\n flashDuration = gridOptionsService.get('cellFlashDuration');\n }\n if (!exists(fadeDuration)) {\n fadeDuration = gridOptionsService.get('cellFadeDuration');\n }\n // we want to highlight the cells, without any animation\n this.cellComp.addOrRemoveCssClass(fullName, true);\n this.cellComp.addOrRemoveCssClass(animationFullName, false);\n // then once that is applied, we remove the highlight with animation\n this.beans.frameworkOverrides.wrapIncoming(function () {\n window.setTimeout(function () {\n if (!_this.isAlive()) {\n return;\n }\n _this.cellComp.addOrRemoveCssClass(fullName, false);\n _this.cellComp.addOrRemoveCssClass(animationFullName, true);\n _this.eGui.style.transition = \"background-color \".concat(fadeDuration, \"ms\");\n window.setTimeout(function () {\n if (!_this.isAlive()) {\n return;\n }\n // and then to leave things as we got them, we remove the animation\n _this.cellComp.addOrRemoveCssClass(animationFullName, false);\n _this.eGui.style.transition = '';\n }, fadeDuration);\n }, flashDuration);\n });\n };\n CellCtrl.prototype.onFlashCells = function (event) {\n if (!this.cellComp) {\n return;\n }\n var cellId = this.beans.cellPositionUtils.createId(this.getCellPosition());\n var shouldFlash = event.cells[cellId];\n if (shouldFlash) {\n this.animateCell('highlight');\n }\n };\n CellCtrl.prototype.isCellEditable = function () {\n return this.column.isCellEditable(this.rowNode);\n };\n CellCtrl.prototype.isSuppressFillHandle = function () {\n return this.column.isSuppressFillHandle();\n };\n CellCtrl.prototype.formatValue = function (value) {\n var _a;\n return (_a = this.callValueFormatter(value)) !== null && _a !== void 0 ? _a : value;\n };\n CellCtrl.prototype.callValueFormatter = function (value) {\n return this.beans.valueFormatterService.formatValue(this.column, this.rowNode, value);\n };\n CellCtrl.prototype.updateAndFormatValue = function (compareValues) {\n var oldValue = this.value;\n var oldValueFormatted = this.valueFormatted;\n this.value = this.rowNode.getValueFromValueService(this.column);\n this.valueFormatted = this.callValueFormatter(this.value);\n if (compareValues) {\n return !this.valuesAreEqual(oldValue, this.value) || this.valueFormatted != oldValueFormatted;\n }\n return true;\n };\n CellCtrl.prototype.valuesAreEqual = function (val1, val2) {\n // if the user provided an equals method, use that, otherwise do simple comparison\n var colDef = this.column.getColDef();\n return colDef.equals ? colDef.equals(val1, val2) : val1 === val2;\n };\n CellCtrl.prototype.getComp = function () {\n return this.cellComp;\n };\n CellCtrl.prototype.getValue = function () {\n return this.value;\n };\n CellCtrl.prototype.getValueFormatted = function () {\n return this.valueFormatted;\n };\n CellCtrl.prototype.addDomData = function () {\n var _this = this;\n var element = this.getGui();\n this.beans.gridOptionsService.setDomData(element, CellCtrl.DOM_DATA_KEY_CELL_CTRL, this);\n this.addDestroyFunc(function () { return _this.beans.gridOptionsService.setDomData(element, CellCtrl.DOM_DATA_KEY_CELL_CTRL, null); });\n };\n CellCtrl.prototype.createEvent = function (domEvent, eventType) {\n var event = this.beans.gridOptionsService.addGridCommonParams({\n type: eventType,\n node: this.rowNode,\n data: this.rowNode.data,\n value: this.value,\n column: this.column,\n colDef: this.column.getColDef(),\n rowPinned: this.rowNode.rowPinned,\n event: domEvent,\n rowIndex: this.rowNode.rowIndex\n });\n return event;\n };\n CellCtrl.prototype.processCharacter = function (event) {\n var _a;\n (_a = this.cellKeyboardListenerFeature) === null || _a === void 0 ? void 0 : _a.processCharacter(event);\n };\n CellCtrl.prototype.onKeyDown = function (event) {\n var _a;\n (_a = this.cellKeyboardListenerFeature) === null || _a === void 0 ? void 0 : _a.onKeyDown(event);\n };\n CellCtrl.prototype.onMouseEvent = function (eventName, mouseEvent) {\n var _a;\n (_a = this.cellMouseListenerFeature) === null || _a === void 0 ? void 0 : _a.onMouseEvent(eventName, mouseEvent);\n };\n CellCtrl.prototype.getGui = function () {\n return this.eGui;\n };\n CellCtrl.prototype.refreshToolTip = function () {\n var _a;\n (_a = this.tooltipFeature) === null || _a === void 0 ? void 0 : _a.refreshToolTip();\n };\n CellCtrl.prototype.getColSpanningList = function () {\n return this.cellPositionFeature.getColSpanningList();\n };\n CellCtrl.prototype.onLeftChanged = function () {\n var _a;\n if (!this.cellComp) {\n return;\n }\n (_a = this.cellPositionFeature) === null || _a === void 0 ? void 0 : _a.onLeftChanged();\n };\n CellCtrl.prototype.onDisplayedColumnsChanged = function () {\n if (!this.eGui) {\n return;\n }\n this.refreshAriaColIndex();\n this.refreshFirstAndLastStyles();\n };\n CellCtrl.prototype.refreshFirstAndLastStyles = function () {\n var _a = this, cellComp = _a.cellComp, column = _a.column, beans = _a.beans;\n CssClassApplier.refreshFirstAndLastStyles(cellComp, column, beans.columnModel);\n };\n CellCtrl.prototype.refreshAriaColIndex = function () {\n var colIdx = this.beans.columnModel.getAriaColumnIndex(this.column);\n setAriaColIndex(this.getGui(), colIdx); // for react, we don't use JSX, as it slowed down column moving\n };\n CellCtrl.prototype.isSuppressNavigable = function () {\n return this.column.isSuppressNavigable(this.rowNode);\n };\n CellCtrl.prototype.onWidthChanged = function () {\n var _a;\n return (_a = this.cellPositionFeature) === null || _a === void 0 ? void 0 : _a.onWidthChanged();\n };\n CellCtrl.prototype.getColumn = function () {\n return this.column;\n };\n CellCtrl.prototype.getRowNode = function () {\n return this.rowNode;\n };\n CellCtrl.prototype.getBeans = function () {\n return this.beans;\n };\n CellCtrl.prototype.isPrintLayout = function () {\n return this.printLayout;\n };\n CellCtrl.prototype.appendChild = function (htmlElement) {\n this.eGui.appendChild(htmlElement);\n };\n CellCtrl.prototype.refreshHandle = function () {\n if (this.cellRangeFeature) {\n this.cellRangeFeature.refreshHandle();\n }\n };\n CellCtrl.prototype.getCellPosition = function () {\n return this.cellPosition;\n };\n CellCtrl.prototype.isEditing = function () {\n return this.editing;\n };\n // called by rowRenderer when user navigates via tab key\n CellCtrl.prototype.startRowOrCellEdit = function (key, event) {\n var _this = this;\n if (event === void 0) { event = null; }\n // because of async in React, the cellComp may not be set yet, if no cellComp then we are\n // yet to initialise the cell, so we re-schedule this operation for when celLComp is attached\n if (!this.cellComp) {\n this.onCellCompAttachedFuncs.push(function () { _this.startRowOrCellEdit(key, event); });\n return;\n }\n if (this.beans.gridOptionsService.get('editType') === 'fullRow') {\n this.rowCtrl.startRowEditing(key, this);\n }\n else {\n this.startEditing(key, true, event);\n }\n };\n CellCtrl.prototype.getRowCtrl = function () {\n return this.rowCtrl;\n };\n CellCtrl.prototype.getRowPosition = function () {\n return {\n rowIndex: this.cellPosition.rowIndex,\n rowPinned: this.cellPosition.rowPinned\n };\n };\n CellCtrl.prototype.updateRangeBordersIfRangeCount = function () {\n if (!this.cellComp) {\n return;\n }\n if (this.cellRangeFeature) {\n this.cellRangeFeature.updateRangeBordersIfRangeCount();\n }\n };\n CellCtrl.prototype.onRangeSelectionChanged = function () {\n if (!this.cellComp) {\n return;\n }\n if (this.cellRangeFeature) {\n this.cellRangeFeature.onRangeSelectionChanged();\n }\n };\n CellCtrl.prototype.isRangeSelectionEnabled = function () {\n return this.cellRangeFeature != null;\n };\n CellCtrl.prototype.focusCell = function (forceBrowserFocus) {\n if (forceBrowserFocus === void 0) { forceBrowserFocus = false; }\n this.beans.focusService.setFocusedCell({\n rowIndex: this.getCellPosition().rowIndex,\n column: this.column,\n rowPinned: this.rowNode.rowPinned,\n forceBrowserFocus: forceBrowserFocus\n });\n };\n CellCtrl.prototype.onRowIndexChanged = function () {\n // when index changes, this influences items that need the index, so we update the\n // grid cell so they are working off the new index.\n this.createCellPosition();\n // when the index of the row changes, ie means the cell may have lost or gained focus\n this.onCellFocused();\n // check range selection\n if (this.cellRangeFeature) {\n this.cellRangeFeature.onRangeSelectionChanged();\n }\n };\n CellCtrl.prototype.onFirstRightPinnedChanged = function () {\n if (!this.cellComp) {\n return;\n }\n var firstRightPinned = this.column.isFirstRightPinned();\n this.cellComp.addOrRemoveCssClass(CSS_CELL_FIRST_RIGHT_PINNED, firstRightPinned);\n };\n CellCtrl.prototype.onLastLeftPinnedChanged = function () {\n if (!this.cellComp) {\n return;\n }\n var lastLeftPinned = this.column.isLastLeftPinned();\n this.cellComp.addOrRemoveCssClass(CSS_CELL_LAST_LEFT_PINNED, lastLeftPinned);\n };\n CellCtrl.prototype.onCellFocused = function (event) {\n if (this.beans.gridOptionsService.get('suppressCellFocus')) {\n return;\n }\n var cellFocused = this.beans.focusService.isCellFocused(this.cellPosition);\n if (!this.cellComp) {\n if (cellFocused && (event === null || event === void 0 ? void 0 : event.forceBrowserFocus)) {\n // The cell comp has not been rendered yet, but the browser focus is being forced for this cell\n // so lets save the event to apply it when setComp is called in the next turn.\n this.focusEventToRestore = event;\n }\n return;\n }\n // Clear the saved focus event\n this.focusEventToRestore = undefined;\n this.cellComp.addOrRemoveCssClass(CSS_CELL_FOCUS, cellFocused);\n // see if we need to force browser focus - this can happen if focus is programmatically set\n if (cellFocused && event && event.forceBrowserFocus) {\n var focusEl = this.cellComp.getFocusableElement();\n focusEl.focus({ preventScroll: !!event.preventScrollOnBrowserFocus });\n }\n // if another cell was focused, and we are editing, then stop editing\n var fullRowEdit = this.beans.gridOptionsService.get('editType') === 'fullRow';\n if (!cellFocused && !fullRowEdit && this.editing) {\n this.stopRowOrCellEdit();\n }\n if (cellFocused) {\n this.rowCtrl.announceDescription();\n }\n };\n CellCtrl.prototype.createCellPosition = function () {\n this.cellPosition = {\n rowIndex: this.rowNode.rowIndex,\n rowPinned: makeNull(this.rowNode.rowPinned),\n column: this.column\n };\n };\n // CSS Classes that only get applied once, they never change\n CellCtrl.prototype.applyStaticCssClasses = function () {\n this.cellComp.addOrRemoveCssClass(CSS_CELL, true);\n this.cellComp.addOrRemoveCssClass(CSS_CELL_NOT_INLINE_EDITING, true);\n // normal cells fill the height of the row. autoHeight cells have no height to let them\n // fit the height of content.\n var autoHeight = this.column.isAutoHeight() == true;\n this.cellComp.addOrRemoveCssClass(CSS_AUTO_HEIGHT, autoHeight);\n this.cellComp.addOrRemoveCssClass(CSS_NORMAL_HEIGHT, !autoHeight);\n };\n CellCtrl.prototype.onColumnHover = function () {\n if (!this.cellComp) {\n return;\n }\n if (!this.beans.gridOptionsService.get('columnHoverHighlight')) {\n return;\n }\n var isHovered = this.beans.columnHoverService.isHovered(this.column);\n this.cellComp.addOrRemoveCssClass(CSS_COLUMN_HOVER, isHovered);\n };\n CellCtrl.prototype.onColDefChanged = function () {\n var _a, _b;\n if (!this.cellComp) {\n return;\n }\n var isAutoHeight = this.column.isAutoHeight();\n if (isAutoHeight !== this.isAutoHeight) {\n // auto height uses wrappers, so need to destroy\n (_a = this.rowCtrl) === null || _a === void 0 ? void 0 : _a.refreshCell(this);\n }\n var isTooltipEnabled = this.column.isTooltipEnabled();\n if (isTooltipEnabled) {\n this.disableTooltipFeature();\n this.enableTooltipFeature();\n (_b = this.tooltipFeature) === null || _b === void 0 ? void 0 : _b.setComp(this.eGui);\n }\n else {\n this.disableTooltipFeature();\n }\n this.setWrapText();\n if (!this.editing) {\n this.refreshOrDestroyCell({ forceRefresh: true, suppressFlash: true });\n }\n else {\n var cellEditor = this.getCellEditor();\n if (cellEditor === null || cellEditor === void 0 ? void 0 : cellEditor.refresh) {\n var _c = this.editCompDetails.params, eventKey = _c.eventKey, cellStartedEdit = _c.cellStartedEdit;\n var editorParams = this.createCellEditorParams(eventKey, cellStartedEdit);\n var colDef = this.column.getColDef();\n var compDetails = this.beans.userComponentFactory.getCellEditorDetails(colDef, editorParams);\n cellEditor.refresh(compDetails.params);\n }\n }\n };\n CellCtrl.prototype.setWrapText = function () {\n var value = this.column.getColDef().wrapText == true;\n this.cellComp.addOrRemoveCssClass(CSS_CELL_WRAP_TEXT, value);\n };\n CellCtrl.prototype.dispatchCellContextMenuEvent = function (event) {\n var _this = this;\n var colDef = this.column.getColDef();\n var cellContextMenuEvent = this.createEvent(event, Events.EVENT_CELL_CONTEXT_MENU);\n this.beans.eventService.dispatchEvent(cellContextMenuEvent);\n if (colDef.onCellContextMenu) {\n // to make the callback async, do in a timeout\n window.setTimeout(function () {\n _this.beans.frameworkOverrides.wrapOutgoing(function () {\n colDef.onCellContextMenu(cellContextMenuEvent);\n });\n }, 0);\n }\n };\n CellCtrl.prototype.getCellRenderer = function () {\n return this.cellComp ? this.cellComp.getCellRenderer() : null;\n };\n CellCtrl.prototype.getCellEditor = function () {\n return this.cellComp ? this.cellComp.getCellEditor() : null;\n };\n CellCtrl.prototype.destroy = function () {\n this.onCellCompAttachedFuncs = [];\n _super.prototype.destroy.call(this);\n };\n CellCtrl.prototype.createSelectionCheckbox = function () {\n var cbSelectionComponent = new CheckboxSelectionComponent();\n this.beans.context.createBean(cbSelectionComponent);\n cbSelectionComponent.init({ rowNode: this.rowNode, column: this.column });\n // put the checkbox in before the value\n return cbSelectionComponent;\n };\n CellCtrl.prototype.createDndSource = function () {\n var dndSourceComp = new DndSourceComp(this.rowNode, this.column, this.eGui);\n this.beans.context.createBean(dndSourceComp);\n return dndSourceComp;\n };\n CellCtrl.prototype.registerRowDragger = function (customElement, dragStartPixels, suppressVisibilityChange) {\n var _this = this;\n // if previously existed, then we are only updating\n if (this.customRowDragComp) {\n this.customRowDragComp.setDragElement(customElement, dragStartPixels);\n return;\n }\n var newComp = this.createRowDragComp(customElement, dragStartPixels, suppressVisibilityChange);\n if (newComp) {\n this.customRowDragComp = newComp;\n this.addDestroyFunc(function () { _this.beans.context.destroyBean(newComp); _this.customRowDragComp = null; });\n }\n };\n CellCtrl.prototype.createRowDragComp = function (customElement, dragStartPixels, suppressVisibilityChange) {\n var _this = this;\n var pagination = this.beans.gridOptionsService.get('pagination');\n var rowDragManaged = this.beans.gridOptionsService.get('rowDragManaged');\n var clientSideRowModelActive = this.beans.gridOptionsService.isRowModelType('clientSide');\n if (rowDragManaged) {\n // row dragging only available in default row model\n if (!clientSideRowModelActive) {\n warnOnce('managed row dragging is only allowed in the Client Side Row Model');\n return;\n }\n if (pagination) {\n warnOnce('managed row dragging is not possible when doing pagination');\n return;\n }\n }\n // otherwise (normal case) we are creating a RowDraggingComp for the first time\n var rowDragComp = new RowDragComp(function () { return _this.value; }, this.rowNode, this.column, customElement, dragStartPixels, suppressVisibilityChange);\n this.beans.context.createBean(rowDragComp);\n return rowDragComp;\n };\n CellCtrl.DOM_DATA_KEY_CELL_CTRL = 'cellCtrl';\n return CellCtrl;\n}(BeanStub));\n\nvar __extends$23 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __values$6 = ( false) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$q = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$l = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar RowType$1;\n(function (RowType) {\n RowType[\"Normal\"] = \"Normal\";\n RowType[\"FullWidth\"] = \"FullWidth\";\n RowType[\"FullWidthLoading\"] = \"FullWidthLoading\";\n RowType[\"FullWidthGroup\"] = \"FullWidthGroup\";\n RowType[\"FullWidthDetail\"] = \"FullWidthDetail\";\n})(RowType$1 || (RowType$1 = {}));\nvar instanceIdSequence$2 = 0;\nvar RowCtrl = /** @class */ (function (_super) {\n __extends$23(RowCtrl, _super);\n function RowCtrl(rowNode, beans, animateIn, useAnimationFrameForCreate, printLayout) {\n var _this = _super.call(this) || this;\n _this.allRowGuis = [];\n _this.active = true;\n _this.centerCellCtrls = { list: [], map: {} };\n _this.leftCellCtrls = { list: [], map: {} };\n _this.rightCellCtrls = { list: [], map: {} };\n _this.slideInAnimation = {\n left: false,\n center: false,\n right: false,\n fullWidth: false\n };\n _this.fadeInAnimation = {\n left: false,\n center: false,\n right: false,\n fullWidth: false\n };\n _this.rowDragComps = [];\n _this.lastMouseDownOnDragger = false;\n _this.emptyStyle = {};\n _this.updateColumnListsPending = false;\n _this.rowId = null;\n _this.businessKeySanitised = null;\n _this.beans = beans;\n _this.gridOptionsService = beans.gridOptionsService;\n _this.rowNode = rowNode;\n _this.paginationPage = beans.paginationProxy.getCurrentPage();\n _this.useAnimationFrameForCreate = useAnimationFrameForCreate;\n _this.printLayout = printLayout;\n _this.suppressRowTransform = _this.gridOptionsService.get('suppressRowTransform');\n _this.instanceId = rowNode.id + '-' + instanceIdSequence$2++;\n _this.rowId = escapeString(rowNode.id);\n _this.initRowBusinessKey();\n _this.rowFocused = beans.focusService.isRowFocused(_this.rowNode.rowIndex, _this.rowNode.rowPinned);\n _this.rowLevel = beans.rowCssClassCalculator.calculateRowLevel(_this.rowNode);\n _this.setRowType();\n _this.setAnimateFlags(animateIn);\n _this.rowStyles = _this.processStylesFromGridOptions();\n // calls to `isFullWidth()` only work after `setRowType` has been called.\n if (_this.isFullWidth() && !_this.gridOptionsService.get('suppressCellFocus')) {\n _this.tabIndex = -1;\n }\n _this.addListeners();\n return _this;\n }\n RowCtrl.prototype.initRowBusinessKey = function () {\n this.businessKeyForNodeFunc = this.gridOptionsService.get('getBusinessKeyForNode');\n this.updateRowBusinessKey();\n };\n RowCtrl.prototype.updateRowBusinessKey = function () {\n if (typeof this.businessKeyForNodeFunc !== 'function') {\n return;\n }\n var businessKey = this.businessKeyForNodeFunc(this.rowNode);\n this.businessKeySanitised = escapeString(businessKey);\n };\n RowCtrl.prototype.getRowId = function () {\n return this.rowId;\n };\n RowCtrl.prototype.getRowStyles = function () {\n return this.rowStyles;\n };\n RowCtrl.prototype.getTabIndex = function () {\n return this.tabIndex;\n };\n RowCtrl.prototype.isSticky = function () {\n return this.rowNode.sticky;\n };\n RowCtrl.prototype.getBeans = function () {\n return this.beans;\n };\n RowCtrl.prototype.getInstanceId = function () {\n return this.instanceId;\n };\n RowCtrl.prototype.setComp = function (rowComp, element, containerType) {\n var gui = { rowComp: rowComp, element: element, containerType: containerType };\n this.allRowGuis.push(gui);\n if (containerType === RowContainerType.LEFT) {\n this.leftGui = gui;\n }\n else if (containerType === RowContainerType.RIGHT) {\n this.rightGui = gui;\n }\n else if (containerType === RowContainerType.FULL_WIDTH) {\n this.fullWidthGui = gui;\n }\n else {\n this.centerGui = gui;\n }\n this.initialiseRowComp(gui);\n // pinned rows render before the main grid body in the SSRM, only fire the event after the main body has rendered.\n if (this.rowType !== 'FullWidthLoading' && !this.rowNode.rowPinned) {\n // this is fired within setComp as we know that the component renderer is now trying to render.\n // linked with the fact the function implementation queues behind requestAnimationFrame should allow\n // us to be certain that all rendering is done by the time the event fires.\n this.beans.rowRenderer.dispatchFirstDataRenderedEvent();\n }\n };\n RowCtrl.prototype.unsetComp = function (containerType) {\n this.allRowGuis = this.allRowGuis\n .filter(function (rowGui) { return rowGui.containerType !== containerType; });\n switch (containerType) {\n case RowContainerType.LEFT:\n this.leftGui = undefined;\n break;\n case RowContainerType.RIGHT:\n this.rightGui = undefined;\n break;\n case RowContainerType.FULL_WIDTH:\n this.fullWidthGui = undefined;\n break;\n case RowContainerType.CENTER:\n this.centerGui = undefined;\n break;\n }\n };\n RowCtrl.prototype.isCacheable = function () {\n return this.rowType === RowType$1.FullWidthDetail\n && this.gridOptionsService.get('keepDetailRows');\n };\n RowCtrl.prototype.setCached = function (cached) {\n var displayValue = cached ? 'none' : '';\n this.allRowGuis.forEach(function (rg) { return rg.element.style.display = displayValue; });\n };\n RowCtrl.prototype.initialiseRowComp = function (gui) {\n var _this = this;\n var gos = this.gridOptionsService;\n this.listenOnDomOrder(gui);\n if (this.beans.columnModel.wasAutoRowHeightEverActive()) {\n this.rowNode.checkAutoHeights();\n }\n this.onRowHeightChanged(gui);\n this.updateRowIndexes(gui);\n this.setFocusedClasses(gui);\n this.setStylesFromGridOptions(false, gui); // no need to calculate styles already set in constructor\n if (gos.isRowSelection() && this.rowNode.selectable) {\n this.onRowSelected(gui);\n }\n this.updateColumnLists(!this.useAnimationFrameForCreate);\n var comp = gui.rowComp;\n var initialRowClasses = this.getInitialRowClasses(gui.containerType);\n initialRowClasses.forEach(function (name) { return comp.addOrRemoveCssClass(name, true); });\n this.executeSlideAndFadeAnimations(gui);\n if (this.rowNode.group) {\n setAriaExpanded(gui.element, this.rowNode.expanded == true);\n }\n this.setRowCompRowId(comp);\n this.setRowCompRowBusinessKey(comp);\n // DOM DATA\n gos.setDomData(gui.element, RowCtrl.DOM_DATA_KEY_ROW_CTRL, this);\n this.addDestroyFunc(function () { return gos.setDomData(gui.element, RowCtrl.DOM_DATA_KEY_ROW_CTRL, null); });\n // adding hover functionality adds listener to this row, so we\n // do it lazily in an animation frame\n if (this.useAnimationFrameForCreate) {\n this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this, gui.element), this.rowNode.rowIndex, 'createTasksP2');\n }\n else {\n this.addHoverFunctionality(gui.element);\n }\n if (this.isFullWidth()) {\n this.setupFullWidth(gui);\n }\n if (gos.get('rowDragEntireRow')) {\n this.addRowDraggerToRow(gui);\n }\n if (this.useAnimationFrameForCreate) {\n // the height animation we only want active after the row is alive for 1 second.\n // this stops the row animation working when rows are initially created. otherwise\n // auto-height rows get inserted into the dom and resized immediately, which gives\n // very bad UX (eg 10 rows get inserted, then all 10 expand, look particularly bad\n // when scrolling). so this makes sure when rows are shown for the first time, they\n // are resized immediately without animation.\n this.beans.animationFrameService.addDestroyTask(function () {\n if (!_this.isAlive()) {\n return;\n }\n gui.rowComp.addOrRemoveCssClass('ag-after-created', true);\n });\n }\n this.executeProcessRowPostCreateFunc();\n };\n RowCtrl.prototype.setRowCompRowBusinessKey = function (comp) {\n if (this.businessKeySanitised == null) {\n return;\n }\n comp.setRowBusinessKey(this.businessKeySanitised);\n };\n RowCtrl.prototype.getBusinessKey = function () {\n return this.businessKeySanitised;\n };\n RowCtrl.prototype.setRowCompRowId = function (comp) {\n this.rowId = escapeString(this.rowNode.id);\n if (this.rowId == null) {\n return;\n }\n comp.setRowId(this.rowId);\n };\n RowCtrl.prototype.executeSlideAndFadeAnimations = function (gui) {\n var _this = this;\n var containerType = gui.containerType;\n var shouldSlide = this.slideInAnimation[containerType];\n if (shouldSlide) {\n executeNextVMTurn(function () {\n _this.onTopChanged();\n });\n this.slideInAnimation[containerType] = false;\n }\n var shouldFade = this.fadeInAnimation[containerType];\n if (shouldFade) {\n executeNextVMTurn(function () {\n gui.rowComp.addOrRemoveCssClass('ag-opacity-zero', false);\n });\n this.fadeInAnimation[containerType] = false;\n }\n };\n RowCtrl.prototype.addRowDraggerToRow = function (gui) {\n if (this.gridOptionsService.get('enableRangeSelection')) {\n warnOnce('Setting `rowDragEntireRow: true` in the gridOptions doesn\\'t work with `enableRangeSelection: true`');\n return;\n }\n var translate = this.beans.localeService.getLocaleTextFunc();\n var rowDragComp = new RowDragComp(function () { return \"1 \".concat(translate('rowDragRow', 'row')); }, this.rowNode, undefined, gui.element, undefined, true);\n var rowDragBean = this.createBean(rowDragComp, this.beans.context);\n this.rowDragComps.push(rowDragBean);\n };\n RowCtrl.prototype.setupFullWidth = function (gui) {\n var pinned = this.getPinnedForContainer(gui.containerType);\n var params = this.createFullWidthParams(gui.element, pinned);\n if (this.rowType == RowType$1.FullWidthDetail) {\n if (!ModuleRegistry.__assertRegistered(ModuleNames.MasterDetailModule, \"cell renderer 'agDetailCellRenderer' (for master detail)\", this.beans.context.getGridId())) {\n return;\n }\n }\n var compDetails;\n switch (this.rowType) {\n case RowType$1.FullWidthDetail:\n compDetails = this.beans.userComponentFactory.getFullWidthDetailCellRendererDetails(params);\n break;\n case RowType$1.FullWidthGroup:\n compDetails = this.beans.userComponentFactory.getFullWidthGroupCellRendererDetails(params);\n break;\n case RowType$1.FullWidthLoading:\n compDetails = this.beans.userComponentFactory.getFullWidthLoadingCellRendererDetails(params);\n break;\n default:\n compDetails = this.beans.userComponentFactory.getFullWidthCellRendererDetails(params);\n break;\n }\n gui.rowComp.showFullWidth(compDetails);\n };\n RowCtrl.prototype.isPrintLayout = function () {\n return this.printLayout;\n };\n RowCtrl.prototype.getFullWidthCellRenderers = function () {\n var _a, _b;\n if (this.gridOptionsService.get('embedFullWidthRows')) {\n return this.allRowGuis.map(function (gui) { var _a; return (_a = gui === null || gui === void 0 ? void 0 : gui.rowComp) === null || _a === void 0 ? void 0 : _a.getFullWidthCellRenderer(); });\n }\n return [(_b = (_a = this.fullWidthGui) === null || _a === void 0 ? void 0 : _a.rowComp) === null || _b === void 0 ? void 0 : _b.getFullWidthCellRenderer()];\n };\n // use by autoWidthCalculator, as it clones the elements\n RowCtrl.prototype.getCellElement = function (column) {\n var cellCtrl = this.getCellCtrl(column);\n return cellCtrl ? cellCtrl.getGui() : null;\n };\n RowCtrl.prototype.executeProcessRowPostCreateFunc = function () {\n var func = this.gridOptionsService.getCallback('processRowPostCreate');\n if (!func || !this.areAllContainersReady()) {\n return;\n }\n var params = {\n // areAllContainersReady asserts that centerGui is not null\n eRow: this.centerGui.element,\n ePinnedLeftRow: this.leftGui ? this.leftGui.element : undefined,\n ePinnedRightRow: this.rightGui ? this.rightGui.element : undefined,\n node: this.rowNode,\n rowIndex: this.rowNode.rowIndex,\n addRenderedRowListener: this.addEventListener.bind(this),\n };\n func(params);\n };\n RowCtrl.prototype.areAllContainersReady = function () {\n var isLeftReady = !!this.leftGui || !this.beans.columnModel.isPinningLeft();\n var isCenterReady = !!this.centerGui;\n var isRightReady = !!this.rightGui || !this.beans.columnModel.isPinningRight();\n return isLeftReady && isCenterReady && isRightReady;\n };\n RowCtrl.prototype.setRowType = function () {\n var isStub = this.rowNode.stub;\n var isFullWidthCell = this.rowNode.isFullWidthCell();\n var isDetailCell = this.gridOptionsService.get('masterDetail') && this.rowNode.detail;\n var pivotMode = this.beans.columnModel.isPivotMode();\n // we only use full width for groups, not footers. it wouldn't make sense to include footers if not looking\n // for totals. if users complain about this, then we should introduce a new property 'footerUseEntireRow'\n // so each can be set independently (as a customer complained about footers getting full width, hence\n // introducing this logic)\n var isGroupRow = !!this.rowNode.group && !this.rowNode.footer;\n var isFullWidthGroup = isGroupRow && this.gridOptionsService.isGroupUseEntireRow(pivotMode);\n if (isStub) {\n this.rowType = RowType$1.FullWidthLoading;\n }\n else if (isDetailCell) {\n this.rowType = RowType$1.FullWidthDetail;\n }\n else if (isFullWidthCell) {\n this.rowType = RowType$1.FullWidth;\n }\n else if (isFullWidthGroup) {\n this.rowType = RowType$1.FullWidthGroup;\n }\n else {\n this.rowType = RowType$1.Normal;\n }\n };\n RowCtrl.prototype.updateColumnLists = function (suppressAnimationFrame, useFlushSync) {\n var _this = this;\n if (suppressAnimationFrame === void 0) { suppressAnimationFrame = false; }\n if (useFlushSync === void 0) { useFlushSync = false; }\n if (this.isFullWidth()) {\n return;\n }\n var noAnimation = suppressAnimationFrame\n || this.gridOptionsService.get('suppressAnimationFrame')\n || this.printLayout;\n if (noAnimation) {\n this.updateColumnListsImpl(useFlushSync);\n return;\n }\n if (this.updateColumnListsPending) {\n return;\n }\n this.beans.animationFrameService.createTask(function () {\n if (!_this.active) {\n return;\n }\n _this.updateColumnListsImpl(true);\n }, this.rowNode.rowIndex, 'createTasksP1');\n this.updateColumnListsPending = true;\n };\n RowCtrl.prototype.createCellCtrls = function (prev, cols, pinned) {\n var _this = this;\n if (pinned === void 0) { pinned = null; }\n var res = {\n list: [],\n map: {}\n };\n var addCell = function (colInstanceId, cellCtrl) {\n res.list.push(cellCtrl);\n res.map[colInstanceId] = cellCtrl;\n };\n cols.forEach(function (col) {\n // we use instanceId's rather than colId as it's possible there is a Column with same Id,\n // but it's referring to a different column instance. Happens a lot with pivot, as pivot col id's are\n // reused eg pivot_0, pivot_1 etc\n var colInstanceId = col.getInstanceId();\n var cellCtrl = prev.map[colInstanceId];\n if (!cellCtrl) {\n cellCtrl = new CellCtrl(col, _this.rowNode, _this.beans, _this);\n }\n addCell(colInstanceId, cellCtrl);\n });\n prev.list.forEach(function (prevCellCtrl) {\n var cellInResult = res.map[prevCellCtrl.getColumn().getInstanceId()] != null;\n if (cellInResult) {\n return;\n }\n var keepCell = !_this.isCellEligibleToBeRemoved(prevCellCtrl, pinned);\n if (keepCell) {\n addCell(prevCellCtrl.getColumn().getInstanceId(), prevCellCtrl);\n return;\n }\n prevCellCtrl.destroy();\n });\n return res;\n };\n RowCtrl.prototype.updateColumnListsImpl = function (useFlushSync) {\n this.updateColumnListsPending = false;\n this.createAllCellCtrls();\n this.setCellCtrls(useFlushSync);\n };\n RowCtrl.prototype.setCellCtrls = function (useFlushSync) {\n var _this = this;\n this.allRowGuis.forEach(function (item) {\n var cellControls = _this.getCellCtrlsForContainer(item.containerType);\n item.rowComp.setCellCtrls(cellControls, useFlushSync);\n });\n };\n RowCtrl.prototype.getCellCtrlsForContainer = function (containerType) {\n switch (containerType) {\n case RowContainerType.LEFT:\n return this.leftCellCtrls.list;\n case RowContainerType.RIGHT:\n return this.rightCellCtrls.list;\n case RowContainerType.FULL_WIDTH:\n return [];\n case RowContainerType.CENTER:\n return this.centerCellCtrls.list;\n default:\n var exhaustiveCheck = containerType;\n throw new Error(\"Unhandled case: \".concat(exhaustiveCheck));\n }\n };\n RowCtrl.prototype.createAllCellCtrls = function () {\n var columnModel = this.beans.columnModel;\n if (this.printLayout) {\n this.centerCellCtrls = this.createCellCtrls(this.centerCellCtrls, columnModel.getAllDisplayedColumns());\n this.leftCellCtrls = { list: [], map: {} };\n this.rightCellCtrls = { list: [], map: {} };\n }\n else {\n var centerCols = columnModel.getViewportCenterColumnsForRow(this.rowNode);\n this.centerCellCtrls = this.createCellCtrls(this.centerCellCtrls, centerCols);\n var leftCols = columnModel.getDisplayedLeftColumnsForRow(this.rowNode);\n this.leftCellCtrls = this.createCellCtrls(this.leftCellCtrls, leftCols, 'left');\n var rightCols = columnModel.getDisplayedRightColumnsForRow(this.rowNode);\n this.rightCellCtrls = this.createCellCtrls(this.rightCellCtrls, rightCols, 'right');\n }\n };\n RowCtrl.prototype.isCellEligibleToBeRemoved = function (cellCtrl, nextContainerPinned) {\n var REMOVE_CELL = true;\n var KEEP_CELL = false;\n // always remove the cell if it's not rendered or if it's in the wrong pinned location\n var column = cellCtrl.getColumn();\n if (column.getPinned() != nextContainerPinned) {\n return REMOVE_CELL;\n }\n // we want to try and keep editing and focused cells\n var editing = cellCtrl.isEditing();\n var focused = this.beans.focusService.isCellFocused(cellCtrl.getCellPosition());\n var mightWantToKeepCell = editing || focused;\n if (mightWantToKeepCell) {\n var column_1 = cellCtrl.getColumn();\n var displayedColumns = this.beans.columnModel.getAllDisplayedColumns();\n var cellStillDisplayed = displayedColumns.indexOf(column_1) >= 0;\n return cellStillDisplayed ? KEEP_CELL : REMOVE_CELL;\n }\n return REMOVE_CELL;\n };\n RowCtrl.prototype.getDomOrder = function () {\n var isEnsureDomOrder = this.gridOptionsService.get('ensureDomOrder');\n return isEnsureDomOrder || this.gridOptionsService.isDomLayout('print');\n };\n RowCtrl.prototype.listenOnDomOrder = function (gui) {\n var _this = this;\n var listener = function () {\n gui.rowComp.setDomOrder(_this.getDomOrder());\n };\n this.addManagedPropertyListener('domLayout', listener);\n this.addManagedPropertyListener('ensureDomOrder', listener);\n };\n RowCtrl.prototype.setAnimateFlags = function (animateIn) {\n if (this.isSticky() || !animateIn) {\n return;\n }\n var oldRowTopExists = exists(this.rowNode.oldRowTop);\n var pinningLeft = this.beans.columnModel.isPinningLeft();\n var pinningRight = this.beans.columnModel.isPinningRight();\n if (oldRowTopExists) {\n if (this.isFullWidth() && !this.gridOptionsService.get('embedFullWidthRows')) {\n this.slideInAnimation.fullWidth = true;\n return;\n }\n // if the row had a previous position, we slide it in\n this.slideInAnimation.center = true;\n this.slideInAnimation.left = pinningLeft;\n this.slideInAnimation.right = pinningRight;\n }\n else {\n if (this.isFullWidth() && !this.gridOptionsService.get('embedFullWidthRows')) {\n this.fadeInAnimation.fullWidth = true;\n return;\n }\n // if the row had no previous position, we fade it in\n this.fadeInAnimation.center = true;\n this.fadeInAnimation.left = pinningLeft;\n this.fadeInAnimation.right = pinningRight;\n }\n };\n RowCtrl.prototype.isEditing = function () {\n return this.editingRow;\n };\n RowCtrl.prototype.isFullWidth = function () {\n return this.rowType !== RowType$1.Normal;\n };\n RowCtrl.prototype.getRowType = function () {\n return this.rowType;\n };\n RowCtrl.prototype.refreshFullWidth = function () {\n var _this = this;\n // returns 'true' if refresh succeeded\n var tryRefresh = function (gui, pinned) {\n if (!gui) {\n return true;\n } // no refresh needed\n return gui.rowComp.refreshFullWidth(function () { return _this.createFullWidthParams(gui.element, pinned); });\n };\n var fullWidthSuccess = tryRefresh(this.fullWidthGui, null);\n var centerSuccess = tryRefresh(this.centerGui, null);\n var leftSuccess = tryRefresh(this.leftGui, 'left');\n var rightSuccess = tryRefresh(this.rightGui, 'right');\n var allFullWidthRowsRefreshed = fullWidthSuccess && centerSuccess && leftSuccess && rightSuccess;\n return allFullWidthRowsRefreshed;\n };\n RowCtrl.prototype.addListeners = function () {\n var _this = this;\n this.addManagedListener(this.rowNode, RowNode.EVENT_HEIGHT_CHANGED, function () { return _this.onRowHeightChanged(); });\n this.addManagedListener(this.rowNode, RowNode.EVENT_ROW_SELECTED, function () { return _this.onRowSelected(); });\n this.addManagedListener(this.rowNode, RowNode.EVENT_ROW_INDEX_CHANGED, this.onRowIndexChanged.bind(this));\n this.addManagedListener(this.rowNode, RowNode.EVENT_TOP_CHANGED, this.onTopChanged.bind(this));\n this.addManagedListener(this.rowNode, RowNode.EVENT_EXPANDED_CHANGED, this.updateExpandedCss.bind(this));\n this.addManagedListener(this.rowNode, RowNode.EVENT_HAS_CHILDREN_CHANGED, this.updateExpandedCss.bind(this));\n if (this.rowNode.detail) {\n // if the master row node has updated data, we also want to try to refresh the detail row\n this.addManagedListener(this.rowNode.parent, RowNode.EVENT_DATA_CHANGED, this.onRowNodeDataChanged.bind(this));\n }\n this.addManagedListener(this.rowNode, RowNode.EVENT_DATA_CHANGED, this.onRowNodeDataChanged.bind(this));\n this.addManagedListener(this.rowNode, RowNode.EVENT_CELL_CHANGED, this.postProcessCss.bind(this));\n this.addManagedListener(this.rowNode, RowNode.EVENT_HIGHLIGHT_CHANGED, this.onRowNodeHighlightChanged.bind(this));\n this.addManagedListener(this.rowNode, RowNode.EVENT_DRAGGING_CHANGED, this.postProcessRowDragging.bind(this));\n this.addManagedListener(this.rowNode, RowNode.EVENT_UI_LEVEL_CHANGED, this.onUiLevelChanged.bind(this));\n var eventService = this.beans.eventService;\n this.addManagedListener(eventService, Events.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED, this.onPaginationPixelOffsetChanged.bind(this));\n this.addManagedListener(eventService, Events.EVENT_HEIGHT_SCALE_CHANGED, this.onTopChanged.bind(this));\n this.addManagedListener(eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));\n this.addManagedListener(eventService, Events.EVENT_VIRTUAL_COLUMNS_CHANGED, this.onVirtualColumnsChanged.bind(this));\n this.addManagedListener(eventService, Events.EVENT_CELL_FOCUSED, this.onCellFocusChanged.bind(this));\n this.addManagedListener(eventService, Events.EVENT_CELL_FOCUS_CLEARED, this.onCellFocusChanged.bind(this));\n this.addManagedListener(eventService, Events.EVENT_PAGINATION_CHANGED, this.onPaginationChanged.bind(this));\n this.addManagedListener(eventService, Events.EVENT_MODEL_UPDATED, this.refreshFirstAndLastRowStyles.bind(this));\n this.addManagedListener(eventService, Events.EVENT_COLUMN_MOVED, this.updateColumnLists.bind(this));\n this.addDestroyFunc(function () {\n _this.destroyBeans(_this.rowDragComps, _this.beans.context);\n });\n this.addManagedPropertyListeners(['rowDragEntireRow'], function () {\n var useRowDragEntireRow = _this.gridOptionsService.get('rowDragEntireRow');\n if (useRowDragEntireRow) {\n _this.allRowGuis.forEach(function (gui) {\n _this.addRowDraggerToRow(gui);\n });\n return;\n }\n _this.destroyBeans(_this.rowDragComps, _this.beans.context);\n _this.rowDragComps = [];\n });\n this.addListenersForCellComps();\n };\n RowCtrl.prototype.addListenersForCellComps = function () {\n var _this = this;\n this.addManagedListener(this.rowNode, RowNode.EVENT_ROW_INDEX_CHANGED, function () {\n _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.onRowIndexChanged(); });\n });\n this.addManagedListener(this.rowNode, RowNode.EVENT_CELL_CHANGED, function (event) {\n _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.onCellChanged(event); });\n });\n };\n RowCtrl.prototype.onRowNodeDataChanged = function (event) {\n var _this = this;\n // if the row is rendered incorrectly, as the requirements for whether this is a FW row have changed, we force re-render this row.\n var fullWidthChanged = this.isFullWidth() !== !!this.rowNode.isFullWidthCell();\n if (fullWidthChanged) {\n this.beans.rowRenderer.redrawRow(this.rowNode);\n return;\n }\n // this bit of logic handles trying to refresh the FW row ctrl, or delegating to removing/recreating it if unsupported.\n if (this.isFullWidth()) {\n var refresh = this.refreshFullWidth();\n if (!refresh) {\n this.beans.rowRenderer.redrawRow(this.rowNode);\n }\n return;\n }\n // if this is an update, we want to refresh, as this will allow the user to put in a transition\n // into the cellRenderer refresh method. otherwise this might be completely new data, in which case\n // we will want to completely replace the cells\n this.getAllCellCtrls().forEach(function (cellCtrl) {\n return cellCtrl.refreshCell({\n suppressFlash: !event.update,\n newData: !event.update\n });\n });\n // as data has changed update the dom row id attributes\n this.allRowGuis.forEach(function (gui) {\n _this.setRowCompRowId(gui.rowComp);\n _this.updateRowBusinessKey();\n _this.setRowCompRowBusinessKey(gui.rowComp);\n });\n // check for selected also, as this could be after lazy loading of the row data, in which case\n // the id might of just gotten set inside the row and the row selected state may of changed\n // as a result. this is what happens when selected rows are loaded in virtual pagination.\n // - niall note - since moving to the stub component, this may no longer be true, as replacing\n // the stub component now replaces the entire row\n this.onRowSelected();\n // as data has changed, then the style and class needs to be recomputed\n this.postProcessCss();\n };\n RowCtrl.prototype.postProcessCss = function () {\n this.setStylesFromGridOptions(true);\n this.postProcessClassesFromGridOptions();\n this.postProcessRowClassRules();\n this.postProcessRowDragging();\n };\n RowCtrl.prototype.onRowNodeHighlightChanged = function () {\n var highlighted = this.rowNode.highlighted;\n this.allRowGuis.forEach(function (gui) {\n var aboveOn = highlighted === RowHighlightPosition.Above;\n var belowOn = highlighted === RowHighlightPosition.Below;\n gui.rowComp.addOrRemoveCssClass('ag-row-highlight-above', aboveOn);\n gui.rowComp.addOrRemoveCssClass('ag-row-highlight-below', belowOn);\n });\n };\n RowCtrl.prototype.postProcessRowDragging = function () {\n var dragging = this.rowNode.dragging;\n this.allRowGuis.forEach(function (gui) { return gui.rowComp.addOrRemoveCssClass('ag-row-dragging', dragging); });\n };\n RowCtrl.prototype.updateExpandedCss = function () {\n var expandable = this.rowNode.isExpandable();\n var expanded = this.rowNode.expanded == true;\n this.allRowGuis.forEach(function (gui) {\n gui.rowComp.addOrRemoveCssClass('ag-row-group', expandable);\n gui.rowComp.addOrRemoveCssClass('ag-row-group-expanded', expandable && expanded);\n gui.rowComp.addOrRemoveCssClass('ag-row-group-contracted', expandable && !expanded);\n setAriaExpanded(gui.element, expandable && expanded);\n });\n };\n RowCtrl.prototype.onDisplayedColumnsChanged = function () {\n // we skip animations for onDisplayedColumnChanged, as otherwise the client could remove columns and\n // then set data, and any old valueGetter's (ie from cols that were removed) would still get called.\n this.updateColumnLists(true);\n if (this.beans.columnModel.wasAutoRowHeightEverActive()) {\n this.rowNode.checkAutoHeights();\n }\n };\n RowCtrl.prototype.onVirtualColumnsChanged = function () {\n this.updateColumnLists(false, true);\n };\n RowCtrl.prototype.getRowPosition = function () {\n return {\n rowPinned: makeNull(this.rowNode.rowPinned),\n rowIndex: this.rowNode.rowIndex\n };\n };\n RowCtrl.prototype.onKeyboardNavigate = function (keyboardEvent) {\n var currentFullWidthComp = this.allRowGuis.find(function (c) { return c.element.contains(keyboardEvent.target); });\n var currentFullWidthContainer = currentFullWidthComp ? currentFullWidthComp.element : null;\n var isFullWidthContainerFocused = currentFullWidthContainer === keyboardEvent.target;\n if (!isFullWidthContainerFocused) {\n return;\n }\n var node = this.rowNode;\n var lastFocusedCell = this.beans.focusService.getFocusedCell();\n var cellPosition = {\n rowIndex: node.rowIndex,\n rowPinned: node.rowPinned,\n column: (lastFocusedCell && lastFocusedCell.column)\n };\n this.beans.navigationService.navigateToNextCell(keyboardEvent, keyboardEvent.key, cellPosition, true);\n keyboardEvent.preventDefault();\n };\n RowCtrl.prototype.onTabKeyDown = function (keyboardEvent) {\n if (keyboardEvent.defaultPrevented || isStopPropagationForAgGrid(keyboardEvent)) {\n return;\n }\n var currentFullWidthComp = this.allRowGuis.find(function (c) { return c.element.contains(keyboardEvent.target); });\n var currentFullWidthContainer = currentFullWidthComp ? currentFullWidthComp.element : null;\n var isFullWidthContainerFocused = currentFullWidthContainer === keyboardEvent.target;\n var nextEl = null;\n if (!isFullWidthContainerFocused) {\n nextEl = this.beans.focusService.findNextFocusableElement(currentFullWidthContainer, false, keyboardEvent.shiftKey);\n }\n if ((this.isFullWidth() && isFullWidthContainerFocused) || !nextEl) {\n this.beans.navigationService.onTabKeyDown(this, keyboardEvent);\n }\n };\n RowCtrl.prototype.onFullWidthRowFocused = function (event) {\n var _a;\n var node = this.rowNode;\n var isFocused = !event ? false : this.isFullWidth() && event.rowIndex === node.rowIndex && event.rowPinned == node.rowPinned;\n var element = this.fullWidthGui ? this.fullWidthGui.element : (_a = this.centerGui) === null || _a === void 0 ? void 0 : _a.element;\n if (!element) {\n return;\n } // can happen with react ui, comp not yet ready\n element.classList.toggle('ag-full-width-focus', isFocused);\n if (isFocused) {\n // we don't scroll normal rows into view when we focus them, so we don't want\n // to scroll Full Width rows either.\n element.focus({ preventScroll: true });\n }\n };\n RowCtrl.prototype.refreshCell = function (cellCtrl) {\n this.centerCellCtrls = this.removeCellCtrl(this.centerCellCtrls, cellCtrl);\n this.leftCellCtrls = this.removeCellCtrl(this.leftCellCtrls, cellCtrl);\n this.rightCellCtrls = this.removeCellCtrl(this.rightCellCtrls, cellCtrl);\n this.updateColumnLists();\n };\n RowCtrl.prototype.removeCellCtrl = function (prev, cellCtrlToRemove) {\n var res = {\n list: [],\n map: {}\n };\n prev.list.forEach(function (cellCtrl) {\n if (cellCtrl === cellCtrlToRemove) {\n return;\n }\n res.list.push(cellCtrl);\n res.map[cellCtrl.getInstanceId()] = cellCtrl;\n });\n return res;\n };\n RowCtrl.prototype.onMouseEvent = function (eventName, mouseEvent) {\n switch (eventName) {\n case 'dblclick':\n this.onRowDblClick(mouseEvent);\n break;\n case 'click':\n this.onRowClick(mouseEvent);\n break;\n case 'touchstart':\n case 'mousedown':\n this.onRowMouseDown(mouseEvent);\n break;\n }\n };\n RowCtrl.prototype.createRowEvent = function (type, domEvent) {\n return this.gridOptionsService.addGridCommonParams({\n type: type,\n node: this.rowNode,\n data: this.rowNode.data,\n rowIndex: this.rowNode.rowIndex,\n rowPinned: this.rowNode.rowPinned,\n event: domEvent\n });\n };\n RowCtrl.prototype.createRowEventWithSource = function (type, domEvent) {\n var event = this.createRowEvent(type, domEvent);\n // when first developing this, we included the rowComp in the event.\n // this seems very weird. so when introducing the event types, i left the 'source'\n // out of the type, and just include the source in the two places where this event\n // was fired (rowClicked and rowDoubleClicked). it doesn't make sense for any\n // users to be using this, as the rowComp isn't an object we expose, so would be\n // very surprising if a user was using it.\n event.source = this;\n return event;\n };\n RowCtrl.prototype.onRowDblClick = function (mouseEvent) {\n if (isStopPropagationForAgGrid(mouseEvent)) {\n return;\n }\n var agEvent = this.createRowEventWithSource(Events.EVENT_ROW_DOUBLE_CLICKED, mouseEvent);\n this.beans.eventService.dispatchEvent(agEvent);\n };\n RowCtrl.prototype.onRowMouseDown = function (mouseEvent) {\n this.lastMouseDownOnDragger = isElementChildOfClass(mouseEvent.target, 'ag-row-drag', 3);\n if (!this.isFullWidth()) {\n return;\n }\n var node = this.rowNode;\n var columnModel = this.beans.columnModel;\n if (this.beans.rangeService) {\n this.beans.rangeService.removeAllCellRanges();\n }\n this.beans.focusService.setFocusedCell({\n rowIndex: node.rowIndex,\n column: columnModel.getAllDisplayedColumns()[0],\n rowPinned: node.rowPinned,\n forceBrowserFocus: true\n });\n };\n RowCtrl.prototype.onRowClick = function (mouseEvent) {\n var stop = isStopPropagationForAgGrid(mouseEvent) || this.lastMouseDownOnDragger;\n if (stop) {\n return;\n }\n var agEvent = this.createRowEventWithSource(Events.EVENT_ROW_CLICKED, mouseEvent);\n this.beans.eventService.dispatchEvent(agEvent);\n // ctrlKey for windows, metaKey for Apple\n var isMultiKey = mouseEvent.ctrlKey || mouseEvent.metaKey;\n var isShiftKey = mouseEvent.shiftKey;\n // we do not allow selecting the group by clicking, when groupSelectChildren, as the logic to\n // handle this is broken. to observe, change the logic below and allow groups to be selected.\n // you will see the group gets selected, then all children get selected, then the grid unselects\n // the children (as the default behaviour when clicking is to unselect other rows) which results\n // in the group getting unselected (as all children are unselected). the correct thing would be\n // to change this, so that children of the selected group are not then subsequently un-selected.\n var groupSelectsChildren = this.gridOptionsService.get('groupSelectsChildren');\n if (\n // we do not allow selecting groups by clicking (as the click here expands the group), or if it's a detail row,\n // so return if it's a group row\n (groupSelectsChildren && this.rowNode.group) ||\n this.isRowSelectionBlocked() ||\n // if click selection suppressed, do nothing\n this.gridOptionsService.get('suppressRowClickSelection')) {\n return;\n }\n var multiSelectOnClick = this.gridOptionsService.get('rowMultiSelectWithClick');\n var rowDeselectionWithCtrl = !this.gridOptionsService.get('suppressRowDeselection');\n var source = 'rowClicked';\n if (this.rowNode.isSelected()) {\n if (multiSelectOnClick) {\n this.rowNode.setSelectedParams({ newValue: false, event: mouseEvent, source: source });\n }\n else if (isMultiKey) {\n if (rowDeselectionWithCtrl) {\n this.rowNode.setSelectedParams({ newValue: false, event: mouseEvent, source: source });\n }\n }\n else {\n // selected with no multi key, must make sure anything else is unselected\n this.rowNode.setSelectedParams({ newValue: true, clearSelection: !isShiftKey, rangeSelect: isShiftKey, event: mouseEvent, source: source });\n }\n }\n else {\n var clearSelection = multiSelectOnClick ? false : !isMultiKey;\n this.rowNode.setSelectedParams({ newValue: true, clearSelection: clearSelection, rangeSelect: isShiftKey, event: mouseEvent, source: source });\n }\n };\n RowCtrl.prototype.isRowSelectionBlocked = function () {\n return !this.rowNode.selectable || !!this.rowNode.rowPinned || !this.gridOptionsService.isRowSelection();\n };\n RowCtrl.prototype.setupDetailRowAutoHeight = function (eDetailGui) {\n var _this = this;\n if (this.rowType !== RowType$1.FullWidthDetail) {\n return;\n }\n if (!this.gridOptionsService.get('detailRowAutoHeight')) {\n return;\n }\n var checkRowSizeFunc = function () {\n var clientHeight = eDetailGui.clientHeight;\n // if the UI is not ready, the height can be 0, which we ignore, as otherwise a flicker will occur\n // as UI goes from the default height, to 0, then to the real height as UI becomes ready. this means\n // it's not possible for have 0 as auto-height, however this is an improbable use case, as even an\n // empty detail grid would still have some styling around it giving at least a few pixels.\n if (clientHeight != null && clientHeight > 0) {\n // we do the update in a timeout, to make sure we are not calling from inside the grid\n // doing another update\n var updateRowHeightFunc = function () {\n _this.rowNode.setRowHeight(clientHeight);\n if (_this.beans.clientSideRowModel) {\n _this.beans.clientSideRowModel.onRowHeightChanged();\n }\n else if (_this.beans.serverSideRowModel) {\n _this.beans.serverSideRowModel.onRowHeightChanged();\n }\n };\n window.setTimeout(updateRowHeightFunc, 0);\n }\n };\n var resizeObserverDestroyFunc = this.beans.resizeObserverService.observeResize(eDetailGui, checkRowSizeFunc);\n this.addDestroyFunc(resizeObserverDestroyFunc);\n checkRowSizeFunc();\n };\n RowCtrl.prototype.createFullWidthParams = function (eRow, pinned) {\n var _this = this;\n var params = this.gridOptionsService.addGridCommonParams({\n fullWidth: true,\n data: this.rowNode.data,\n node: this.rowNode,\n value: this.rowNode.key,\n valueFormatted: this.rowNode.key,\n rowIndex: this.rowNode.rowIndex,\n // these need to be taken out, as part of 'afterAttached' now\n eGridCell: eRow,\n eParentOfValue: eRow,\n pinned: pinned,\n addRenderedRowListener: this.addEventListener.bind(this),\n registerRowDragger: function (rowDraggerElement, dragStartPixels, value, suppressVisibilityChange) { return _this.addFullWidthRowDragging(rowDraggerElement, dragStartPixels, value, suppressVisibilityChange); }\n });\n return params;\n };\n RowCtrl.prototype.addFullWidthRowDragging = function (rowDraggerElement, dragStartPixels, value, suppressVisibilityChange) {\n if (value === void 0) { value = ''; }\n if (!this.isFullWidth()) {\n return;\n }\n var rowDragComp = new RowDragComp(function () { return value; }, this.rowNode, undefined, rowDraggerElement, dragStartPixels, suppressVisibilityChange);\n this.createManagedBean(rowDragComp, this.beans.context);\n };\n RowCtrl.prototype.onUiLevelChanged = function () {\n var newLevel = this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);\n if (this.rowLevel != newLevel) {\n var classToAdd_1 = 'ag-row-level-' + newLevel;\n var classToRemove_1 = 'ag-row-level-' + this.rowLevel;\n this.allRowGuis.forEach(function (gui) {\n gui.rowComp.addOrRemoveCssClass(classToAdd_1, true);\n gui.rowComp.addOrRemoveCssClass(classToRemove_1, false);\n });\n }\n this.rowLevel = newLevel;\n };\n RowCtrl.prototype.isFirstRowOnPage = function () {\n return this.rowNode.rowIndex === this.beans.paginationProxy.getPageFirstRow();\n };\n RowCtrl.prototype.isLastRowOnPage = function () {\n return this.rowNode.rowIndex === this.beans.paginationProxy.getPageLastRow();\n };\n RowCtrl.prototype.refreshFirstAndLastRowStyles = function () {\n var newFirst = this.isFirstRowOnPage();\n var newLast = this.isLastRowOnPage();\n if (this.firstRowOnPage !== newFirst) {\n this.firstRowOnPage = newFirst;\n this.allRowGuis.forEach(function (gui) { return gui.rowComp.addOrRemoveCssClass('ag-row-first', newFirst); });\n }\n if (this.lastRowOnPage !== newLast) {\n this.lastRowOnPage = newLast;\n this.allRowGuis.forEach(function (gui) { return gui.rowComp.addOrRemoveCssClass('ag-row-last', newLast); });\n }\n };\n RowCtrl.prototype.stopEditing = function (cancel) {\n var e_1, _a;\n if (cancel === void 0) { cancel = false; }\n // if we are already stopping row edit, there is\n // no need to start this process again.\n if (this.stoppingRowEdit) {\n return;\n }\n var cellControls = this.getAllCellCtrls();\n var isRowEdit = this.editingRow;\n this.stoppingRowEdit = true;\n var fireRowEditEvent = false;\n try {\n for (var cellControls_1 = __values$6(cellControls), cellControls_1_1 = cellControls_1.next(); !cellControls_1_1.done; cellControls_1_1 = cellControls_1.next()) {\n var ctrl = cellControls_1_1.value;\n var valueChanged = ctrl.stopEditing(cancel);\n if (isRowEdit && !cancel && !fireRowEditEvent && valueChanged) {\n fireRowEditEvent = true;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (cellControls_1_1 && !cellControls_1_1.done && (_a = cellControls_1.return)) _a.call(cellControls_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n if (fireRowEditEvent) {\n var event_1 = this.createRowEvent(Events.EVENT_ROW_VALUE_CHANGED);\n this.beans.eventService.dispatchEvent(event_1);\n }\n if (isRowEdit) {\n this.setEditingRow(false);\n }\n this.stoppingRowEdit = false;\n };\n RowCtrl.prototype.setInlineEditingCss = function (editing) {\n this.allRowGuis.forEach(function (gui) {\n gui.rowComp.addOrRemoveCssClass(\"ag-row-inline-editing\", editing);\n gui.rowComp.addOrRemoveCssClass(\"ag-row-not-inline-editing\", !editing);\n });\n };\n RowCtrl.prototype.setEditingRow = function (value) {\n this.editingRow = value;\n this.allRowGuis.forEach(function (gui) { return gui.rowComp.addOrRemoveCssClass('ag-row-editing', value); });\n var event = value ?\n this.createRowEvent(Events.EVENT_ROW_EDITING_STARTED)\n : this.createRowEvent(Events.EVENT_ROW_EDITING_STOPPED);\n this.beans.eventService.dispatchEvent(event);\n };\n RowCtrl.prototype.startRowEditing = function (key, sourceRenderedCell, event) {\n if (key === void 0) { key = null; }\n if (sourceRenderedCell === void 0) { sourceRenderedCell = null; }\n if (event === void 0) { event = null; }\n // don't do it if already editing\n if (this.editingRow) {\n return;\n }\n var atLeastOneEditing = this.getAllCellCtrls().reduce(function (prev, cellCtrl) {\n var cellStartedEdit = cellCtrl === sourceRenderedCell;\n if (cellStartedEdit) {\n cellCtrl.startEditing(key, cellStartedEdit, event);\n }\n else {\n cellCtrl.startEditing(null, cellStartedEdit, event);\n }\n if (prev) {\n return true;\n }\n return cellCtrl.isEditing();\n }, false);\n if (atLeastOneEditing) {\n this.setEditingRow(true);\n }\n };\n RowCtrl.prototype.getAllCellCtrls = function () {\n if (this.leftCellCtrls.list.length === 0 && this.rightCellCtrls.list.length === 0) {\n return this.centerCellCtrls.list;\n }\n var res = __spreadArray$l(__spreadArray$l(__spreadArray$l([], __read$q(this.centerCellCtrls.list), false), __read$q(this.leftCellCtrls.list), false), __read$q(this.rightCellCtrls.list), false);\n return res;\n };\n RowCtrl.prototype.postProcessClassesFromGridOptions = function () {\n var _this = this;\n var cssClasses = this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);\n if (!cssClasses || !cssClasses.length) {\n return;\n }\n cssClasses.forEach(function (classStr) {\n _this.allRowGuis.forEach(function (c) { return c.rowComp.addOrRemoveCssClass(classStr, true); });\n });\n };\n RowCtrl.prototype.postProcessRowClassRules = function () {\n var _this = this;\n this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode, function (className) {\n _this.allRowGuis.forEach(function (gui) { return gui.rowComp.addOrRemoveCssClass(className, true); });\n }, function (className) {\n _this.allRowGuis.forEach(function (gui) { return gui.rowComp.addOrRemoveCssClass(className, false); });\n });\n };\n RowCtrl.prototype.setStylesFromGridOptions = function (updateStyles, gui) {\n var _this = this;\n if (updateStyles) {\n this.rowStyles = this.processStylesFromGridOptions();\n }\n this.forEachGui(gui, function (gui) { return gui.rowComp.setUserStyles(_this.rowStyles); });\n };\n RowCtrl.prototype.getPinnedForContainer = function (rowContainerType) {\n var pinned = rowContainerType === RowContainerType.LEFT\n ? 'left'\n : rowContainerType === RowContainerType.RIGHT\n ? 'right'\n : null;\n return pinned;\n };\n RowCtrl.prototype.getInitialRowClasses = function (rowContainerType) {\n var pinned = this.getPinnedForContainer(rowContainerType);\n var params = {\n rowNode: this.rowNode,\n rowFocused: this.rowFocused,\n fadeRowIn: this.fadeInAnimation[rowContainerType],\n rowIsEven: this.rowNode.rowIndex % 2 === 0,\n rowLevel: this.rowLevel,\n fullWidthRow: this.isFullWidth(),\n firstRowOnPage: this.isFirstRowOnPage(),\n lastRowOnPage: this.isLastRowOnPage(),\n printLayout: this.printLayout,\n expandable: this.rowNode.isExpandable(),\n pinned: pinned\n };\n return this.beans.rowCssClassCalculator.getInitialRowClasses(params);\n };\n RowCtrl.prototype.processStylesFromGridOptions = function () {\n // part 1 - rowStyle\n var rowStyle = this.gridOptionsService.get('rowStyle');\n if (rowStyle && typeof rowStyle === 'function') {\n console.warn('AG Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead');\n return;\n }\n // part 1 - rowStyleFunc\n var rowStyleFunc = this.gridOptionsService.getCallback('getRowStyle');\n var rowStyleFuncResult;\n if (rowStyleFunc) {\n var params = {\n data: this.rowNode.data,\n node: this.rowNode,\n rowIndex: this.rowNode.rowIndex\n };\n rowStyleFuncResult = rowStyleFunc(params);\n }\n if (rowStyleFuncResult || rowStyle) {\n return Object.assign({}, rowStyle, rowStyleFuncResult);\n }\n // Return constant reference for React\n return this.emptyStyle;\n };\n RowCtrl.prototype.onRowSelected = function (gui) {\n var _this = this;\n var eDocument = this.beans.gridOptionsService.getDocument();\n // Treat undefined as false, if we pass undefined down it gets treated as toggle class, rather than explicitly\n // setting the required value\n var selected = !!this.rowNode.isSelected();\n this.forEachGui(gui, function (gui) {\n gui.rowComp.addOrRemoveCssClass('ag-row-selected', selected);\n setAriaSelected(gui.element, selected);\n var hasFocus = gui.element.contains(eDocument.activeElement);\n if (hasFocus && (gui === _this.centerGui || gui === _this.fullWidthGui)) {\n _this.announceDescription();\n }\n });\n };\n RowCtrl.prototype.announceDescription = function () {\n if (this.isRowSelectionBlocked()) {\n return;\n }\n var selected = this.rowNode.isSelected();\n if (selected && this.beans.gridOptionsService.get('suppressRowDeselection')) {\n return;\n }\n var translate = this.beans.localeService.getLocaleTextFunc();\n var label = translate(selected ? 'ariaRowDeselect' : 'ariaRowSelect', \"Press SPACE to \".concat(selected ? 'deselect' : 'select', \" this row.\"));\n this.beans.ariaAnnouncementService.announceValue(label);\n };\n RowCtrl.prototype.isUseAnimationFrameForCreate = function () {\n return this.useAnimationFrameForCreate;\n };\n RowCtrl.prototype.addHoverFunctionality = function (eRow) {\n var _this = this;\n // because we use animation frames to do this, it's possible the row no longer exists\n // by the time we get to add it\n if (!this.active) {\n return;\n }\n // because mouseenter and mouseleave do not propagate, we cannot listen on the gridPanel\n // like we do for all the other mouse events.\n // because of the pinning, we cannot simply add / remove the class based on the eRow. we\n // have to check all eRow's (body & pinned). so the trick is if any of the rows gets a\n // mouse hover, it sets such in the rowNode, and then all three reflect the change as\n // all are listening for event on the row node.\n // step 1 - add listener, to set flag on row node\n this.addManagedListener(eRow, 'mouseenter', function () { return _this.rowNode.onMouseEnter(); });\n this.addManagedListener(eRow, 'mouseleave', function () { return _this.rowNode.onMouseLeave(); });\n // step 2 - listen for changes on row node (which any eRow can trigger)\n this.addManagedListener(this.rowNode, RowNode.EVENT_MOUSE_ENTER, function () {\n // if hover turned off, we don't add the class. we do this here so that if the application\n // toggles this property mid way, we remove the hover form the last row, but we stop\n // adding hovers from that point onwards. Also, do not highlight while dragging elements around.\n if (!_this.beans.dragService.isDragging() &&\n !_this.gridOptionsService.get('suppressRowHoverHighlight')) {\n eRow.classList.add('ag-row-hover');\n _this.rowNode.setHovered(true);\n }\n });\n this.addManagedListener(this.rowNode, RowNode.EVENT_MOUSE_LEAVE, function () {\n eRow.classList.remove('ag-row-hover');\n _this.rowNode.setHovered(false);\n });\n };\n // for animation, we don't want to animate entry or exit to a very far away pixel,\n // otherwise the row would move so fast, it would appear to disappear. so this method\n // moves the row closer to the viewport if it is far away, so the row slide in / out\n // at a speed the user can see.\n RowCtrl.prototype.roundRowTopToBounds = function (rowTop) {\n var range = this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition();\n var minPixel = this.applyPaginationOffset(range.top, true) - 100;\n var maxPixel = this.applyPaginationOffset(range.bottom, true) + 100;\n return Math.min(Math.max(minPixel, rowTop), maxPixel);\n };\n RowCtrl.prototype.getFrameworkOverrides = function () {\n return this.beans.frameworkOverrides;\n };\n RowCtrl.prototype.forEachGui = function (gui, callback) {\n if (gui) {\n callback(gui);\n }\n else {\n this.allRowGuis.forEach(callback);\n }\n };\n RowCtrl.prototype.onRowHeightChanged = function (gui) {\n // check for exists first - if the user is resetting the row height, then\n // it will be null (or undefined) momentarily until the next time the flatten\n // stage is called where the row will then update again with a new height\n if (this.rowNode.rowHeight == null) {\n return;\n }\n var rowHeight = this.rowNode.rowHeight;\n var defaultRowHeight = this.beans.environment.getDefaultRowHeight();\n var isHeightFromFunc = this.gridOptionsService.isGetRowHeightFunction();\n var heightFromFunc = isHeightFromFunc ? this.gridOptionsService.getRowHeightForNode(this.rowNode).height : undefined;\n var lineHeight = heightFromFunc ? \"\".concat(Math.min(defaultRowHeight, heightFromFunc) - 2, \"px\") : undefined;\n this.forEachGui(gui, function (gui) {\n gui.element.style.height = \"\".concat(rowHeight, \"px\");\n // If the row height is coming from a function, this means some rows can\n // be smaller than the theme had intended. so we set --ag-line-height on\n // the row, which is picked up by the theme CSS and is used in a calc\n // for the CSS line-height property, which makes sure the line-height is\n // not bigger than the row height, otherwise the row text would not fit.\n // We do not use rowNode.rowHeight here, as this could be the result of autoHeight,\n // and we found using the autoHeight result causes a loop, where changing the\n // line-height them impacts the cell height, resulting in a new autoHeight,\n // resulting in a new line-height and so on loop.\n // const heightFromFunc = this.gridOptionsService.getRowHeightForNode(this.rowNode).height;\n if (lineHeight) {\n gui.element.style.setProperty('--ag-line-height', lineHeight);\n }\n });\n };\n RowCtrl.prototype.addEventListener = function (eventType, listener) {\n _super.prototype.addEventListener.call(this, eventType, listener);\n };\n RowCtrl.prototype.removeEventListener = function (eventType, listener) {\n _super.prototype.removeEventListener.call(this, eventType, listener);\n };\n // note - this is NOT called by context, as we don't wire / unwire the CellComp for performance reasons.\n RowCtrl.prototype.destroyFirstPass = function (suppressAnimation) {\n if (suppressAnimation === void 0) { suppressAnimation = false; }\n this.active = false;\n // why do we have this method? shouldn't everything below be added as a destroy func beside\n // the corresponding create logic?\n if (!suppressAnimation && this.gridOptionsService.isAnimateRows() && !this.isSticky()) {\n var rowStillVisibleJustNotInViewport = this.rowNode.rowTop != null;\n if (rowStillVisibleJustNotInViewport) {\n // if the row is not rendered, but in viewport, it means it has moved,\n // so we animate the row out. if the new location is very far away,\n // the animation will be so fast the row will look like it's just disappeared,\n // so instead we animate to a position just outside the viewport.\n var rowTop = this.roundRowTopToBounds(this.rowNode.rowTop);\n this.setRowTop(rowTop);\n }\n else {\n this.allRowGuis.forEach(function (gui) { return gui.rowComp.addOrRemoveCssClass('ag-opacity-zero', true); });\n }\n }\n this.rowNode.setHovered(false);\n var event = this.createRowEvent(Events.EVENT_VIRTUAL_ROW_REMOVED);\n this.dispatchEvent(event);\n this.beans.eventService.dispatchEvent(event);\n _super.prototype.destroy.call(this);\n };\n RowCtrl.prototype.destroySecondPass = function () {\n this.allRowGuis.length = 0;\n // if we are editing, destroying the row will stop editing\n this.stopEditing();\n var destroyCellCtrls = function (ctrls) {\n ctrls.list.forEach(function (c) { return c.destroy(); });\n return { list: [], map: {} };\n };\n this.centerCellCtrls = destroyCellCtrls(this.centerCellCtrls);\n this.leftCellCtrls = destroyCellCtrls(this.leftCellCtrls);\n this.rightCellCtrls = destroyCellCtrls(this.rightCellCtrls);\n };\n RowCtrl.prototype.setFocusedClasses = function (gui) {\n var _this = this;\n this.forEachGui(gui, function (gui) {\n gui.rowComp.addOrRemoveCssClass('ag-row-focus', _this.rowFocused);\n gui.rowComp.addOrRemoveCssClass('ag-row-no-focus', !_this.rowFocused);\n });\n };\n RowCtrl.prototype.onCellFocusChanged = function () {\n var rowFocused = this.beans.focusService.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned);\n if (rowFocused !== this.rowFocused) {\n this.rowFocused = rowFocused;\n this.setFocusedClasses();\n }\n // if we are editing, then moving the focus out of a row will stop editing\n if (!rowFocused && this.editingRow) {\n this.stopEditing(false);\n }\n };\n RowCtrl.prototype.onPaginationChanged = function () {\n var currentPage = this.beans.paginationProxy.getCurrentPage();\n // it is possible this row is in the new page, but the page number has changed, which means\n // it needs to reposition itself relative to the new page\n if (this.paginationPage !== currentPage) {\n this.paginationPage = currentPage;\n this.onTopChanged();\n }\n this.refreshFirstAndLastRowStyles();\n };\n RowCtrl.prototype.onTopChanged = function () {\n this.setRowTop(this.rowNode.rowTop);\n };\n RowCtrl.prototype.onPaginationPixelOffsetChanged = function () {\n // the pixel offset is used when calculating rowTop to set on the row DIV\n this.onTopChanged();\n };\n // applies pagination offset, eg if on second page, and page height is 500px, then removes\n // 500px from the top position, so a row with rowTop 600px is displayed at location 100px.\n // reverse will take the offset away rather than add.\n RowCtrl.prototype.applyPaginationOffset = function (topPx, reverse) {\n if (reverse === void 0) { reverse = false; }\n if (this.rowNode.isRowPinned() || this.rowNode.sticky) {\n return topPx;\n }\n var pixelOffset = this.beans.paginationProxy.getPixelOffset();\n var multiplier = reverse ? 1 : -1;\n return topPx + (pixelOffset * multiplier);\n };\n RowCtrl.prototype.setRowTop = function (pixels) {\n // print layout uses normal flow layout for row positioning\n if (this.printLayout) {\n return;\n }\n // need to make sure rowTop is not null, as this can happen if the node was once\n // visible (ie parent group was expanded) but is now not visible\n if (exists(pixels)) {\n var afterPaginationPixels = this.applyPaginationOffset(pixels);\n var skipScaling = this.rowNode.isRowPinned() || this.rowNode.sticky;\n var afterScalingPixels = skipScaling ? afterPaginationPixels : this.beans.rowContainerHeightService.getRealPixelPosition(afterPaginationPixels);\n var topPx = \"\".concat(afterScalingPixels, \"px\");\n this.setRowTopStyle(topPx);\n }\n };\n // the top needs to be set into the DOM element when the element is created, not updated afterwards.\n // otherwise the transition would not work, as it would be transitioning from zero (the unset value).\n // for example, suppose a row that is outside the viewport, then user does a filter to remove other rows\n // and this row now appears in the viewport, and the row moves up (ie it was under the viewport and not rendered,\n // but now is in the viewport) then a new RowComp is created, however it should have it's position initialised\n // to below the viewport, so the row will appear to animate up. if we didn't set the initial position at creation\n // time, the row would animate down (ie from position zero).\n RowCtrl.prototype.getInitialRowTop = function (rowContainerType) {\n return this.suppressRowTransform ? this.getInitialRowTopShared(rowContainerType) : undefined;\n };\n RowCtrl.prototype.getInitialTransform = function (rowContainerType) {\n return this.suppressRowTransform ? undefined : \"translateY(\".concat(this.getInitialRowTopShared(rowContainerType), \")\");\n };\n RowCtrl.prototype.getInitialRowTopShared = function (rowContainerType) {\n // print layout uses normal flow layout for row positioning\n if (this.printLayout) {\n return '';\n }\n var rowTop;\n if (this.isSticky()) {\n rowTop = this.rowNode.stickyRowTop;\n }\n else {\n // if sliding in, we take the old row top. otherwise we just set the current row top.\n var pixels = this.slideInAnimation[rowContainerType] ? this.roundRowTopToBounds(this.rowNode.oldRowTop) : this.rowNode.rowTop;\n var afterPaginationPixels = this.applyPaginationOffset(pixels);\n // we don't apply scaling if row is pinned\n rowTop = this.rowNode.isRowPinned() ? afterPaginationPixels : this.beans.rowContainerHeightService.getRealPixelPosition(afterPaginationPixels);\n }\n return rowTop + 'px';\n };\n RowCtrl.prototype.setRowTopStyle = function (topPx) {\n var _this = this;\n this.allRowGuis.forEach(function (gui) { return _this.suppressRowTransform ?\n gui.rowComp.setTop(topPx) :\n gui.rowComp.setTransform(\"translateY(\".concat(topPx, \")\")); });\n };\n RowCtrl.prototype.getRowNode = function () {\n return this.rowNode;\n };\n RowCtrl.prototype.getCellCtrl = function (column) {\n // first up, check for cell directly linked to this column\n var res = null;\n this.getAllCellCtrls().forEach(function (cellCtrl) {\n if (cellCtrl.getColumn() == column) {\n res = cellCtrl;\n }\n });\n if (res != null) {\n return res;\n }\n // second up, if not found, then check for spanned cols.\n // we do this second (and not at the same time) as this is\n // more expensive, as spanning cols is a\n // infrequently used feature so we don't need to do this most\n // of the time\n this.getAllCellCtrls().forEach(function (cellCtrl) {\n if (cellCtrl.getColSpanningList().indexOf(column) >= 0) {\n res = cellCtrl;\n }\n });\n return res;\n };\n RowCtrl.prototype.onRowIndexChanged = function () {\n // we only bother updating if the rowIndex is present. if it is not present, it means this row\n // is child of a group node, and the group node was closed, it's the only way to have no row index.\n // when this happens, row is about to be de-rendered, so we don't care, rowComp is about to die!\n if (this.rowNode.rowIndex != null) {\n this.onCellFocusChanged();\n this.updateRowIndexes();\n this.postProcessCss();\n }\n };\n RowCtrl.prototype.getRowIndex = function () {\n return this.rowNode.getRowIndexString();\n };\n RowCtrl.prototype.updateRowIndexes = function (gui) {\n var rowIndexStr = this.rowNode.getRowIndexString();\n var headerRowCount = this.beans.headerNavigationService.getHeaderRowCount() + this.beans.filterManager.getHeaderRowCount();\n var rowIsEven = this.rowNode.rowIndex % 2 === 0;\n var ariaRowIndex = headerRowCount + this.rowNode.rowIndex + 1;\n this.forEachGui(gui, function (c) {\n c.rowComp.setRowIndex(rowIndexStr);\n c.rowComp.addOrRemoveCssClass('ag-row-even', rowIsEven);\n c.rowComp.addOrRemoveCssClass('ag-row-odd', !rowIsEven);\n setAriaRowIndex(c.element, ariaRowIndex);\n });\n };\n RowCtrl.DOM_DATA_KEY_ROW_CTRL = 'renderedRow';\n return RowCtrl;\n}(BeanStub));\n\nvar __extends$22 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1W = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$p = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar RowContainerEventsFeature = /** @class */ (function (_super) {\n __extends$22(RowContainerEventsFeature, _super);\n function RowContainerEventsFeature(element) {\n var _this = _super.call(this) || this;\n _this.element = element;\n return _this;\n }\n RowContainerEventsFeature.prototype.postConstruct = function () {\n this.addKeyboardListeners();\n this.addMouseListeners();\n this.mockContextMenuForIPad();\n };\n RowContainerEventsFeature.prototype.addKeyboardListeners = function () {\n var eventName = 'keydown';\n var listener = this.processKeyboardEvent.bind(this, eventName);\n this.addManagedListener(this.element, eventName, listener);\n };\n RowContainerEventsFeature.prototype.addMouseListeners = function () {\n var _this = this;\n var mouseDownEvent = isEventSupported('touchstart') ? 'touchstart' : 'mousedown';\n var eventNames = ['dblclick', 'contextmenu', 'mouseover', 'mouseout', 'click', mouseDownEvent];\n eventNames.forEach(function (eventName) {\n var listener = _this.processMouseEvent.bind(_this, eventName);\n _this.addManagedListener(_this.element, eventName, listener);\n });\n };\n RowContainerEventsFeature.prototype.processMouseEvent = function (eventName, mouseEvent) {\n if (!this.mouseEventService.isEventFromThisGrid(mouseEvent) ||\n isStopPropagationForAgGrid(mouseEvent)) {\n return;\n }\n var rowComp = this.getRowForEvent(mouseEvent);\n var cellCtrl = this.mouseEventService.getRenderedCellForEvent(mouseEvent);\n if (eventName === \"contextmenu\") {\n this.handleContextMenuMouseEvent(mouseEvent, undefined, rowComp, cellCtrl);\n }\n else {\n if (cellCtrl) {\n cellCtrl.onMouseEvent(eventName, mouseEvent);\n }\n if (rowComp) {\n rowComp.onMouseEvent(eventName, mouseEvent);\n }\n }\n };\n RowContainerEventsFeature.prototype.mockContextMenuForIPad = function () {\n var _this = this;\n // we do NOT want this when not in iPad, otherwise we will be doing\n if (!isIOSUserAgent()) {\n return;\n }\n var touchListener = new TouchListener(this.element);\n var longTapListener = function (event) {\n var rowComp = _this.getRowForEvent(event.touchEvent);\n var cellComp = _this.mouseEventService.getRenderedCellForEvent(event.touchEvent);\n _this.handleContextMenuMouseEvent(undefined, event.touchEvent, rowComp, cellComp);\n };\n this.addManagedListener(touchListener, TouchListener.EVENT_LONG_TAP, longTapListener);\n this.addDestroyFunc(function () { return touchListener.destroy(); });\n };\n RowContainerEventsFeature.prototype.getRowForEvent = function (event) {\n var sourceElement = event.target;\n while (sourceElement) {\n var rowCon = this.gridOptionsService.getDomData(sourceElement, RowCtrl.DOM_DATA_KEY_ROW_CTRL);\n if (rowCon) {\n return rowCon;\n }\n sourceElement = sourceElement.parentElement;\n }\n return null;\n };\n RowContainerEventsFeature.prototype.handleContextMenuMouseEvent = function (mouseEvent, touchEvent, rowComp, cellCtrl) {\n var rowNode = rowComp ? rowComp.getRowNode() : null;\n var column = cellCtrl ? cellCtrl.getColumn() : null;\n var value = null;\n if (column) {\n var event_1 = mouseEvent ? mouseEvent : touchEvent;\n cellCtrl.dispatchCellContextMenuEvent(event_1 !== null && event_1 !== void 0 ? event_1 : null);\n value = this.valueService.getValue(column, rowNode);\n }\n // if user clicked on a cell, anchor to that cell, otherwise anchor to the grid panel\n var gridBodyCon = this.ctrlsService.getGridBodyCtrl();\n var anchorToElement = cellCtrl ? cellCtrl.getGui() : gridBodyCon.getGridBodyElement();\n this.menuService.showContextMenu({ mouseEvent: mouseEvent, touchEvent: touchEvent, rowNode: rowNode, column: column, value: value, anchorToElement: anchorToElement });\n };\n RowContainerEventsFeature.prototype.getControlsForEventTarget = function (target) {\n return {\n cellCtrl: getCtrlForEventTarget(this.gridOptionsService, target, CellCtrl.DOM_DATA_KEY_CELL_CTRL),\n rowCtrl: getCtrlForEventTarget(this.gridOptionsService, target, RowCtrl.DOM_DATA_KEY_ROW_CTRL)\n };\n };\n RowContainerEventsFeature.prototype.processKeyboardEvent = function (eventName, keyboardEvent) {\n var _a = this.getControlsForEventTarget(keyboardEvent.target), cellCtrl = _a.cellCtrl, rowCtrl = _a.rowCtrl;\n if (keyboardEvent.defaultPrevented) {\n return;\n }\n if (cellCtrl) {\n this.processCellKeyboardEvent(cellCtrl, eventName, keyboardEvent);\n }\n else if (rowCtrl && rowCtrl.isFullWidth()) {\n this.processFullWidthRowKeyboardEvent(rowCtrl, eventName, keyboardEvent);\n }\n };\n RowContainerEventsFeature.prototype.processCellKeyboardEvent = function (cellCtrl, eventName, keyboardEvent) {\n var rowNode = cellCtrl.getRowNode();\n var column = cellCtrl.getColumn();\n var editing = cellCtrl.isEditing();\n var gridProcessingAllowed = !isUserSuppressingKeyboardEvent(this.gridOptionsService, keyboardEvent, rowNode, column, editing);\n if (gridProcessingAllowed) {\n if (eventName === 'keydown') {\n // first see if it's a scroll key, page up / down, home / end etc\n var wasScrollKey = !editing && this.navigationService.handlePageScrollingKey(keyboardEvent);\n // if not a scroll key, then we pass onto cell\n if (!wasScrollKey) {\n cellCtrl.onKeyDown(keyboardEvent);\n }\n // perform clipboard and undo / redo operations\n this.doGridOperations(keyboardEvent, cellCtrl.isEditing());\n if (isEventFromPrintableCharacter(keyboardEvent)) {\n cellCtrl.processCharacter(keyboardEvent);\n }\n }\n }\n if (eventName === 'keydown') {\n var cellKeyDownEvent = cellCtrl.createEvent(keyboardEvent, Events.EVENT_CELL_KEY_DOWN);\n this.eventService.dispatchEvent(cellKeyDownEvent);\n }\n };\n RowContainerEventsFeature.prototype.processFullWidthRowKeyboardEvent = function (rowComp, eventName, keyboardEvent) {\n var rowNode = rowComp.getRowNode();\n var focusedCell = this.focusService.getFocusedCell();\n var column = (focusedCell && focusedCell.column);\n var gridProcessingAllowed = !isUserSuppressingKeyboardEvent(this.gridOptionsService, keyboardEvent, rowNode, column, false);\n if (gridProcessingAllowed) {\n var key = keyboardEvent.key;\n if (eventName === 'keydown') {\n switch (key) {\n case KeyCode.PAGE_HOME:\n case KeyCode.PAGE_END:\n case KeyCode.PAGE_UP:\n case KeyCode.PAGE_DOWN:\n this.navigationService.handlePageScrollingKey(keyboardEvent, true);\n break;\n case KeyCode.UP:\n case KeyCode.DOWN:\n rowComp.onKeyboardNavigate(keyboardEvent);\n break;\n case KeyCode.TAB:\n rowComp.onTabKeyDown(keyboardEvent);\n break;\n }\n }\n }\n if (eventName === 'keydown') {\n var cellKeyDownEvent = rowComp.createRowEvent(Events.EVENT_CELL_KEY_DOWN, keyboardEvent);\n this.eventService.dispatchEvent(cellKeyDownEvent);\n }\n };\n RowContainerEventsFeature.prototype.doGridOperations = function (keyboardEvent, editing) {\n // check if ctrl or meta key pressed\n if (!keyboardEvent.ctrlKey && !keyboardEvent.metaKey) {\n return;\n }\n // if the cell the event came from is editing, then we do not\n // want to do the default shortcut keys, otherwise the editor\n // (eg a text field) would not be able to do the normal cut/copy/paste\n if (editing) {\n return;\n }\n // for copy / paste, we don't want to execute when the event\n // was from a child grid (happens in master detail)\n if (!this.mouseEventService.isEventFromThisGrid(keyboardEvent)) {\n return;\n }\n var keyCode = normaliseQwertyAzerty(keyboardEvent);\n if (keyCode === KeyCode.A) {\n return this.onCtrlAndA(keyboardEvent);\n }\n if (keyCode === KeyCode.C) {\n return this.onCtrlAndC(keyboardEvent);\n }\n if (keyCode === KeyCode.D) {\n return this.onCtrlAndD(keyboardEvent);\n }\n if (keyCode === KeyCode.V) {\n return this.onCtrlAndV(keyboardEvent);\n }\n if (keyCode === KeyCode.X) {\n return this.onCtrlAndX(keyboardEvent);\n }\n if (keyCode === KeyCode.Y) {\n return this.onCtrlAndY();\n }\n if (keyCode === KeyCode.Z) {\n return this.onCtrlAndZ(keyboardEvent);\n }\n };\n RowContainerEventsFeature.prototype.onCtrlAndA = function (event) {\n var _a = this, pinnedRowModel = _a.pinnedRowModel, paginationProxy = _a.paginationProxy, rangeService = _a.rangeService;\n if (rangeService && paginationProxy.isRowsToRender()) {\n var _b = __read$p([\n pinnedRowModel.isEmpty('top'),\n pinnedRowModel.isEmpty('bottom')\n ], 2), isEmptyPinnedTop = _b[0], isEmptyPinnedBottom = _b[1];\n var floatingStart = isEmptyPinnedTop ? null : 'top';\n var floatingEnd = void 0;\n var rowEnd = void 0;\n if (isEmptyPinnedBottom) {\n floatingEnd = null;\n rowEnd = this.paginationProxy.getRowCount() - 1;\n }\n else {\n floatingEnd = 'bottom';\n rowEnd = pinnedRowModel.getPinnedBottomRowData().length - 1;\n }\n var allDisplayedColumns = this.columnModel.getAllDisplayedColumns();\n if (missingOrEmpty(allDisplayedColumns)) {\n return;\n }\n rangeService.setCellRange({\n rowStartIndex: 0,\n rowStartPinned: floatingStart,\n rowEndIndex: rowEnd,\n rowEndPinned: floatingEnd,\n columnStart: allDisplayedColumns[0],\n columnEnd: last(allDisplayedColumns)\n });\n }\n event.preventDefault();\n };\n RowContainerEventsFeature.prototype.onCtrlAndC = function (event) {\n if (!this.clipboardService || this.gridOptionsService.get('enableCellTextSelection')) {\n return;\n }\n var _a = this.getControlsForEventTarget(event.target), cellCtrl = _a.cellCtrl, rowCtrl = _a.rowCtrl;\n if ((cellCtrl === null || cellCtrl === void 0 ? void 0 : cellCtrl.isEditing()) || (rowCtrl === null || rowCtrl === void 0 ? void 0 : rowCtrl.isEditing())) {\n return;\n }\n event.preventDefault();\n this.clipboardService.copyToClipboard();\n };\n RowContainerEventsFeature.prototype.onCtrlAndX = function (event) {\n if (!this.clipboardService ||\n this.gridOptionsService.get('enableCellTextSelection') ||\n this.gridOptionsService.get('suppressCutToClipboard')) {\n return;\n }\n var _a = this.getControlsForEventTarget(event.target), cellCtrl = _a.cellCtrl, rowCtrl = _a.rowCtrl;\n if ((cellCtrl === null || cellCtrl === void 0 ? void 0 : cellCtrl.isEditing()) || (rowCtrl === null || rowCtrl === void 0 ? void 0 : rowCtrl.isEditing())) {\n return;\n }\n event.preventDefault();\n this.clipboardService.cutToClipboard(undefined, 'ui');\n };\n RowContainerEventsFeature.prototype.onCtrlAndV = function (event) {\n var _a = this.getControlsForEventTarget(event.target), cellCtrl = _a.cellCtrl, rowCtrl = _a.rowCtrl;\n if ((cellCtrl === null || cellCtrl === void 0 ? void 0 : cellCtrl.isEditing()) || (rowCtrl === null || rowCtrl === void 0 ? void 0 : rowCtrl.isEditing())) {\n return;\n }\n if (this.clipboardService && !this.gridOptionsService.get('suppressClipboardPaste')) {\n this.clipboardService.pasteFromClipboard();\n }\n };\n RowContainerEventsFeature.prototype.onCtrlAndD = function (event) {\n if (this.clipboardService && !this.gridOptionsService.get('suppressClipboardPaste')) {\n this.clipboardService.copyRangeDown();\n }\n event.preventDefault();\n };\n RowContainerEventsFeature.prototype.onCtrlAndZ = function (event) {\n if (!this.gridOptionsService.get('undoRedoCellEditing')) {\n return;\n }\n event.preventDefault();\n if (event.shiftKey) {\n this.undoRedoService.redo('ui');\n }\n else {\n this.undoRedoService.undo('ui');\n }\n };\n RowContainerEventsFeature.prototype.onCtrlAndY = function () {\n this.undoRedoService.redo('ui');\n };\n __decorate$1W([\n Autowired('mouseEventService')\n ], RowContainerEventsFeature.prototype, \"mouseEventService\", void 0);\n __decorate$1W([\n Autowired('valueService')\n ], RowContainerEventsFeature.prototype, \"valueService\", void 0);\n __decorate$1W([\n Autowired('menuService')\n ], RowContainerEventsFeature.prototype, \"menuService\", void 0);\n __decorate$1W([\n Autowired('ctrlsService')\n ], RowContainerEventsFeature.prototype, \"ctrlsService\", void 0);\n __decorate$1W([\n Autowired('navigationService')\n ], RowContainerEventsFeature.prototype, \"navigationService\", void 0);\n __decorate$1W([\n Autowired('focusService')\n ], RowContainerEventsFeature.prototype, \"focusService\", void 0);\n __decorate$1W([\n Autowired('undoRedoService')\n ], RowContainerEventsFeature.prototype, \"undoRedoService\", void 0);\n __decorate$1W([\n Autowired('columnModel')\n ], RowContainerEventsFeature.prototype, \"columnModel\", void 0);\n __decorate$1W([\n Autowired('paginationProxy')\n ], RowContainerEventsFeature.prototype, \"paginationProxy\", void 0);\n __decorate$1W([\n Autowired('pinnedRowModel')\n ], RowContainerEventsFeature.prototype, \"pinnedRowModel\", void 0);\n __decorate$1W([\n Optional('rangeService')\n ], RowContainerEventsFeature.prototype, \"rangeService\", void 0);\n __decorate$1W([\n Optional('clipboardService')\n ], RowContainerEventsFeature.prototype, \"clipboardService\", void 0);\n __decorate$1W([\n PostConstruct\n ], RowContainerEventsFeature.prototype, \"postConstruct\", null);\n return RowContainerEventsFeature;\n}(BeanStub));\n\nvar __extends$21 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1V = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$o = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$k = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n// listens to changes in the center viewport size, for column and row virtualisation,\n// and adjusts grid as necessary. there are two viewports, one for horizontal and one for\n// vertical scrolling.\nvar ViewportSizeFeature = /** @class */ (function (_super) {\n __extends$21(ViewportSizeFeature, _super);\n function ViewportSizeFeature(centerContainerCtrl) {\n var _this = _super.call(this) || this;\n _this.centerContainerCtrl = centerContainerCtrl;\n return _this;\n }\n ViewportSizeFeature.prototype.postConstruct = function () {\n var _this = this;\n this.ctrlsService.whenReady(function () {\n _this.gridBodyCtrl = _this.ctrlsService.getGridBodyCtrl();\n _this.listenForResize();\n });\n this.addManagedListener(this.eventService, Events.EVENT_SCROLLBAR_WIDTH_CHANGED, this.onScrollbarWidthChanged.bind(this));\n this.addManagedPropertyListeners(['alwaysShowHorizontalScroll', 'alwaysShowVerticalScroll'], function () {\n _this.checkViewportAndScrolls();\n });\n };\n ViewportSizeFeature.prototype.listenForResize = function () {\n var _this = this;\n var listener = function () { return _this.onCenterViewportResized(); };\n // centerContainer gets horizontal resizes\n this.centerContainerCtrl.registerViewportResizeListener(listener);\n // eBodyViewport gets vertical resizes\n this.gridBodyCtrl.registerBodyViewportResizeListener(listener);\n };\n ViewportSizeFeature.prototype.onScrollbarWidthChanged = function () {\n this.checkViewportAndScrolls();\n };\n ViewportSizeFeature.prototype.onCenterViewportResized = function () {\n if (this.centerContainerCtrl.isViewportInTheDOMTree()) {\n this.keepPinnedColumnsNarrowerThanViewport();\n this.checkViewportAndScrolls();\n var newWidth = this.centerContainerCtrl.getCenterWidth();\n if (newWidth !== this.centerWidth) {\n this.centerWidth = newWidth;\n this.columnModel.refreshFlexedColumns({ viewportWidth: this.centerWidth, updateBodyWidths: true, fireResizedEvent: true });\n }\n }\n else {\n this.bodyHeight = 0;\n }\n };\n ViewportSizeFeature.prototype.keepPinnedColumnsNarrowerThanViewport = function () {\n var eBodyViewport = this.gridBodyCtrl.getBodyViewportElement();\n var bodyWidth = getInnerWidth(eBodyViewport);\n if (bodyWidth <= 50) {\n return;\n }\n // remove 50px from the bodyWidth to give some margin\n var columnsToRemove = this.getPinnedColumnsOverflowingViewport(bodyWidth - 50);\n var processUnpinnedColumns = this.gridOptionsService.getCallback('processUnpinnedColumns');\n if (!columnsToRemove.length) {\n return;\n }\n if (processUnpinnedColumns) {\n var params = {\n columns: columnsToRemove,\n viewportWidth: bodyWidth\n };\n columnsToRemove = processUnpinnedColumns(params);\n }\n this.columnModel.setColumnsPinned(columnsToRemove, null, 'viewportSizeFeature');\n };\n ViewportSizeFeature.prototype.getPinnedColumnsOverflowingViewport = function (viewportWidth) {\n var pinnedRightWidth = this.pinnedWidthService.getPinnedRightWidth();\n var pinnedLeftWidth = this.pinnedWidthService.getPinnedLeftWidth();\n var totalPinnedWidth = pinnedRightWidth + pinnedLeftWidth;\n if (totalPinnedWidth < viewportWidth) {\n return [];\n }\n var pinnedLeftColumns = __spreadArray$k([], __read$o(this.columnModel.getDisplayedLeftColumns()), false);\n var pinnedRightColumns = __spreadArray$k([], __read$o(this.columnModel.getDisplayedRightColumns()), false);\n var indexRight = 0;\n var indexLeft = 0;\n var totalWidthRemoved = 0;\n var columnsToRemove = [];\n var spaceNecessary = (totalPinnedWidth - totalWidthRemoved) - viewportWidth;\n while ((indexLeft < pinnedLeftColumns.length || indexRight < pinnedRightColumns.length) && spaceNecessary > 0) {\n if (indexRight < pinnedRightColumns.length) {\n var currentColumn = pinnedRightColumns[indexRight++];\n spaceNecessary -= currentColumn.getActualWidth();\n columnsToRemove.push(currentColumn);\n }\n if (indexLeft < pinnedLeftColumns.length && spaceNecessary > 0) {\n var currentColumn = pinnedLeftColumns[indexLeft++];\n spaceNecessary -= currentColumn.getActualWidth();\n columnsToRemove.push(currentColumn);\n }\n }\n return columnsToRemove;\n };\n // gets called every time the viewport size changes. we use this to check visibility of scrollbars\n // in the grid panel, and also to check size and position of viewport for row and column virtualisation.\n ViewportSizeFeature.prototype.checkViewportAndScrolls = function () {\n // results in updating anything that depends on scroll showing\n this.updateScrollVisibleService();\n // fires event if height changes, used by PaginationService, HeightScalerService, RowRenderer\n this.checkBodyHeight();\n // check for virtual columns for ColumnController\n this.onHorizontalViewportChanged();\n this.gridBodyCtrl.getScrollFeature().checkScrollLeft();\n };\n ViewportSizeFeature.prototype.getBodyHeight = function () {\n return this.bodyHeight;\n };\n ViewportSizeFeature.prototype.checkBodyHeight = function () {\n var eBodyViewport = this.gridBodyCtrl.getBodyViewportElement();\n var bodyHeight = getInnerHeight(eBodyViewport);\n if (this.bodyHeight !== bodyHeight) {\n this.bodyHeight = bodyHeight;\n var event_1 = {\n type: Events.EVENT_BODY_HEIGHT_CHANGED\n };\n this.eventService.dispatchEvent(event_1);\n }\n };\n ViewportSizeFeature.prototype.updateScrollVisibleService = function () {\n // because of column animation (which takes 200ms), we have to do this twice.\n // eg if user removes cols anywhere except at the RHS, then the cols on the RHS\n // will animate to the left to fill the gap. this animation means just after\n // the cols are removed, the remaining cols are still in the original location\n // at the start of the animation, so pre animation the H scrollbar is still needed,\n // but post animation it is not.\n this.updateScrollVisibleServiceImpl();\n setTimeout(this.updateScrollVisibleServiceImpl.bind(this), 500);\n };\n ViewportSizeFeature.prototype.updateScrollVisibleServiceImpl = function () {\n var params = {\n horizontalScrollShowing: this.isHorizontalScrollShowing(),\n verticalScrollShowing: this.gridBodyCtrl.isVerticalScrollShowing()\n };\n this.scrollVisibleService.setScrollsVisible(params);\n };\n ViewportSizeFeature.prototype.isHorizontalScrollShowing = function () {\n return this.centerContainerCtrl.isHorizontalScrollShowing();\n };\n // this gets called whenever a change in the viewport, so we can inform column controller it has to work\n // out the virtual columns again. gets called from following locations:\n // + ensureColVisible, scroll, init, layoutChanged, displayedColumnsChanged\n ViewportSizeFeature.prototype.onHorizontalViewportChanged = function () {\n var scrollWidth = this.centerContainerCtrl.getCenterWidth();\n var scrollPosition = this.centerContainerCtrl.getViewportScrollLeft();\n this.columnModel.setViewportPosition(scrollWidth, scrollPosition);\n };\n __decorate$1V([\n Autowired('ctrlsService')\n ], ViewportSizeFeature.prototype, \"ctrlsService\", void 0);\n __decorate$1V([\n Autowired('pinnedWidthService')\n ], ViewportSizeFeature.prototype, \"pinnedWidthService\", void 0);\n __decorate$1V([\n Autowired('columnModel')\n ], ViewportSizeFeature.prototype, \"columnModel\", void 0);\n __decorate$1V([\n Autowired('scrollVisibleService')\n ], ViewportSizeFeature.prototype, \"scrollVisibleService\", void 0);\n __decorate$1V([\n PostConstruct\n ], ViewportSizeFeature.prototype, \"postConstruct\", null);\n return ViewportSizeFeature;\n}(BeanStub));\n\nvar __extends$20 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1U = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SetPinnedLeftWidthFeature = /** @class */ (function (_super) {\n __extends$20(SetPinnedLeftWidthFeature, _super);\n function SetPinnedLeftWidthFeature(element) {\n var _this = _super.call(this) || this;\n _this.element = element;\n return _this;\n }\n SetPinnedLeftWidthFeature.prototype.postConstruct = function () {\n this.addManagedListener(this.eventService, Events.EVENT_LEFT_PINNED_WIDTH_CHANGED, this.onPinnedLeftWidthChanged.bind(this));\n };\n SetPinnedLeftWidthFeature.prototype.onPinnedLeftWidthChanged = function () {\n var leftWidth = this.pinnedWidthService.getPinnedLeftWidth();\n var displayed = leftWidth > 0;\n setDisplayed(this.element, displayed);\n setFixedWidth(this.element, leftWidth);\n };\n SetPinnedLeftWidthFeature.prototype.getWidth = function () {\n return this.pinnedWidthService.getPinnedLeftWidth();\n };\n __decorate$1U([\n Autowired('pinnedWidthService')\n ], SetPinnedLeftWidthFeature.prototype, \"pinnedWidthService\", void 0);\n __decorate$1U([\n PostConstruct\n ], SetPinnedLeftWidthFeature.prototype, \"postConstruct\", null);\n return SetPinnedLeftWidthFeature;\n}(BeanStub));\n\nvar __extends$1$ = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1T = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SetPinnedRightWidthFeature = /** @class */ (function (_super) {\n __extends$1$(SetPinnedRightWidthFeature, _super);\n function SetPinnedRightWidthFeature(element) {\n var _this = _super.call(this) || this;\n _this.element = element;\n return _this;\n }\n SetPinnedRightWidthFeature.prototype.postConstruct = function () {\n this.addManagedListener(this.eventService, Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED, this.onPinnedRightWidthChanged.bind(this));\n };\n SetPinnedRightWidthFeature.prototype.onPinnedRightWidthChanged = function () {\n var rightWidth = this.pinnedWidthService.getPinnedRightWidth();\n var displayed = rightWidth > 0;\n setDisplayed(this.element, displayed);\n setFixedWidth(this.element, rightWidth);\n };\n SetPinnedRightWidthFeature.prototype.getWidth = function () {\n return this.pinnedWidthService.getPinnedRightWidth();\n };\n __decorate$1T([\n Autowired('pinnedWidthService')\n ], SetPinnedRightWidthFeature.prototype, \"pinnedWidthService\", void 0);\n __decorate$1T([\n PostConstruct\n ], SetPinnedRightWidthFeature.prototype, \"postConstruct\", null);\n return SetPinnedRightWidthFeature;\n}(BeanStub));\n\nvar __extends$1_ = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1S = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SetHeightFeature = /** @class */ (function (_super) {\n __extends$1_(SetHeightFeature, _super);\n function SetHeightFeature(eContainer, eViewport) {\n var _this = _super.call(this) || this;\n _this.eContainer = eContainer;\n _this.eViewport = eViewport;\n return _this;\n }\n SetHeightFeature.prototype.postConstruct = function () {\n this.addManagedListener(this.eventService, Events.EVENT_ROW_CONTAINER_HEIGHT_CHANGED, this.onHeightChanged.bind(this));\n };\n SetHeightFeature.prototype.onHeightChanged = function () {\n var height = this.maxDivHeightScaler.getUiContainerHeight();\n var heightString = height != null ? \"\".concat(height, \"px\") : \"\";\n this.eContainer.style.height = heightString;\n if (this.eViewport) {\n this.eViewport.style.height = heightString;\n }\n };\n __decorate$1S([\n Autowired(\"rowContainerHeightService\")\n ], SetHeightFeature.prototype, \"maxDivHeightScaler\", void 0);\n __decorate$1S([\n PostConstruct\n ], SetHeightFeature.prototype, \"postConstruct\", null);\n return SetHeightFeature;\n}(BeanStub));\n\nvar __extends$1Z = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1R = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar DragListenerFeature = /** @class */ (function (_super) {\n __extends$1Z(DragListenerFeature, _super);\n function DragListenerFeature(eContainer) {\n var _this = _super.call(this) || this;\n _this.eContainer = eContainer;\n return _this;\n }\n DragListenerFeature.prototype.postConstruct = function () {\n var _this = this;\n if (missing(this.rangeService)) {\n return;\n }\n this.params = {\n eElement: this.eContainer,\n onDragStart: this.rangeService.onDragStart.bind(this.rangeService),\n onDragStop: this.rangeService.onDragStop.bind(this.rangeService),\n onDragging: this.rangeService.onDragging.bind(this.rangeService)\n };\n this.addManagedPropertyListener('enableRangeSelection', function (props) {\n var isEnabled = props.currentValue;\n if (isEnabled) {\n _this.enableFeature();\n return;\n }\n _this.disableFeature();\n });\n this.addDestroyFunc(function () { return _this.disableFeature(); });\n var isRangeSelection = this.gridOptionsService.get('enableRangeSelection');\n if (isRangeSelection) {\n this.enableFeature();\n }\n };\n DragListenerFeature.prototype.enableFeature = function () {\n this.dragService.addDragSource(this.params);\n };\n DragListenerFeature.prototype.disableFeature = function () {\n this.dragService.removeDragSource(this.params);\n };\n __decorate$1R([\n Optional('rangeService')\n ], DragListenerFeature.prototype, \"rangeService\", void 0);\n __decorate$1R([\n Autowired('dragService')\n ], DragListenerFeature.prototype, \"dragService\", void 0);\n __decorate$1R([\n PostConstruct\n ], DragListenerFeature.prototype, \"postConstruct\", null);\n return DragListenerFeature;\n}(BeanStub));\n\nvar __extends$1Y = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1Q = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar CenterWidthFeature = /** @class */ (function (_super) {\n __extends$1Y(CenterWidthFeature, _super);\n function CenterWidthFeature(callback, addSpacer) {\n if (addSpacer === void 0) { addSpacer = false; }\n var _this = _super.call(this) || this;\n _this.callback = callback;\n _this.addSpacer = addSpacer;\n return _this;\n }\n CenterWidthFeature.prototype.postConstruct = function () {\n var listener = this.setWidth.bind(this);\n this.addManagedPropertyListener('domLayout', listener);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED, listener);\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, listener);\n this.addManagedListener(this.eventService, Events.EVENT_LEFT_PINNED_WIDTH_CHANGED, listener);\n if (this.addSpacer) {\n this.addManagedListener(this.eventService, Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED, listener);\n this.addManagedListener(this.eventService, Events.EVENT_SCROLL_VISIBILITY_CHANGED, listener);\n this.addManagedListener(this.eventService, Events.EVENT_SCROLLBAR_WIDTH_CHANGED, listener);\n }\n this.setWidth();\n };\n CenterWidthFeature.prototype.setWidth = function () {\n var columnModel = this.columnModel;\n var printLayout = this.gridOptionsService.isDomLayout('print');\n var centerWidth = columnModel.getBodyContainerWidth();\n var leftWidth = columnModel.getDisplayedColumnsLeftWidth();\n var rightWidth = columnModel.getDisplayedColumnsRightWidth();\n var totalWidth;\n if (printLayout) {\n totalWidth = centerWidth + leftWidth + rightWidth;\n }\n else {\n totalWidth = centerWidth;\n if (this.addSpacer) {\n var relevantWidth = this.gridOptionsService.get('enableRtl') ? leftWidth : rightWidth;\n if (relevantWidth === 0 && this.scrollVisibleService.isVerticalScrollShowing()) {\n totalWidth += this.gridOptionsService.getScrollbarWidth();\n }\n }\n }\n this.callback(totalWidth);\n };\n __decorate$1Q([\n Autowired('columnModel')\n ], CenterWidthFeature.prototype, \"columnModel\", void 0);\n __decorate$1Q([\n Autowired('scrollVisibleService')\n ], CenterWidthFeature.prototype, \"scrollVisibleService\", void 0);\n __decorate$1Q([\n PostConstruct\n ], CenterWidthFeature.prototype, \"postConstruct\", null);\n return CenterWidthFeature;\n}(BeanStub));\n\nvar __extends$1X = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1P = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$n = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$j = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar RowContainerName;\n(function (RowContainerName) {\n RowContainerName[\"LEFT\"] = \"left\";\n RowContainerName[\"RIGHT\"] = \"right\";\n RowContainerName[\"CENTER\"] = \"center\";\n RowContainerName[\"FULL_WIDTH\"] = \"fullWidth\";\n RowContainerName[\"TOP_LEFT\"] = \"topLeft\";\n RowContainerName[\"TOP_RIGHT\"] = \"topRight\";\n RowContainerName[\"TOP_CENTER\"] = \"topCenter\";\n RowContainerName[\"TOP_FULL_WIDTH\"] = \"topFullWidth\";\n RowContainerName[\"STICKY_TOP_LEFT\"] = \"stickyTopLeft\";\n RowContainerName[\"STICKY_TOP_RIGHT\"] = \"stickyTopRight\";\n RowContainerName[\"STICKY_TOP_CENTER\"] = \"stickyTopCenter\";\n RowContainerName[\"STICKY_TOP_FULL_WIDTH\"] = \"stickyTopFullWidth\";\n RowContainerName[\"BOTTOM_LEFT\"] = \"bottomLeft\";\n RowContainerName[\"BOTTOM_RIGHT\"] = \"bottomRight\";\n RowContainerName[\"BOTTOM_CENTER\"] = \"bottomCenter\";\n RowContainerName[\"BOTTOM_FULL_WIDTH\"] = \"bottomFullWidth\";\n})(RowContainerName || (RowContainerName = {}));\nvar RowContainerType;\n(function (RowContainerType) {\n RowContainerType[\"LEFT\"] = \"left\";\n RowContainerType[\"RIGHT\"] = \"right\";\n RowContainerType[\"CENTER\"] = \"center\";\n RowContainerType[\"FULL_WIDTH\"] = \"fullWidth\";\n})(RowContainerType || (RowContainerType = {}));\nfunction getRowContainerTypeForName(name) {\n switch (name) {\n case RowContainerName.CENTER:\n case RowContainerName.TOP_CENTER:\n case RowContainerName.STICKY_TOP_CENTER:\n case RowContainerName.BOTTOM_CENTER:\n return RowContainerType.CENTER;\n case RowContainerName.LEFT:\n case RowContainerName.TOP_LEFT:\n case RowContainerName.STICKY_TOP_LEFT:\n case RowContainerName.BOTTOM_LEFT:\n return RowContainerType.LEFT;\n case RowContainerName.RIGHT:\n case RowContainerName.TOP_RIGHT:\n case RowContainerName.STICKY_TOP_RIGHT:\n case RowContainerName.BOTTOM_RIGHT:\n return RowContainerType.RIGHT;\n case RowContainerName.FULL_WIDTH:\n case RowContainerName.TOP_FULL_WIDTH:\n case RowContainerName.STICKY_TOP_FULL_WIDTH:\n case RowContainerName.BOTTOM_FULL_WIDTH:\n return RowContainerType.FULL_WIDTH;\n default:\n throw Error('Invalid Row Container Type');\n }\n}\nvar ContainerCssClasses = convertToMap([\n [RowContainerName.CENTER, 'ag-center-cols-container'],\n [RowContainerName.LEFT, 'ag-pinned-left-cols-container'],\n [RowContainerName.RIGHT, 'ag-pinned-right-cols-container'],\n [RowContainerName.FULL_WIDTH, 'ag-full-width-container'],\n [RowContainerName.TOP_CENTER, 'ag-floating-top-container'],\n [RowContainerName.TOP_LEFT, 'ag-pinned-left-floating-top'],\n [RowContainerName.TOP_RIGHT, 'ag-pinned-right-floating-top'],\n [RowContainerName.TOP_FULL_WIDTH, 'ag-floating-top-full-width-container'],\n [RowContainerName.STICKY_TOP_CENTER, 'ag-sticky-top-container'],\n [RowContainerName.STICKY_TOP_LEFT, 'ag-pinned-left-sticky-top'],\n [RowContainerName.STICKY_TOP_RIGHT, 'ag-pinned-right-sticky-top'],\n [RowContainerName.STICKY_TOP_FULL_WIDTH, 'ag-sticky-top-full-width-container'],\n [RowContainerName.BOTTOM_CENTER, 'ag-floating-bottom-container'],\n [RowContainerName.BOTTOM_LEFT, 'ag-pinned-left-floating-bottom'],\n [RowContainerName.BOTTOM_RIGHT, 'ag-pinned-right-floating-bottom'],\n [RowContainerName.BOTTOM_FULL_WIDTH, 'ag-floating-bottom-full-width-container'],\n]);\nvar ViewportCssClasses = convertToMap([\n [RowContainerName.CENTER, 'ag-center-cols-viewport'],\n [RowContainerName.TOP_CENTER, 'ag-floating-top-viewport'],\n [RowContainerName.STICKY_TOP_CENTER, 'ag-sticky-top-viewport'],\n [RowContainerName.BOTTOM_CENTER, 'ag-floating-bottom-viewport'],\n]);\nvar RowContainerCtrl = /** @class */ (function (_super) {\n __extends$1X(RowContainerCtrl, _super);\n function RowContainerCtrl(name) {\n var _this = _super.call(this) || this;\n _this.visible = true;\n // Maintaining a constant reference enables optimization in React.\n _this.EMPTY_CTRLS = [];\n _this.name = name;\n _this.isFullWithContainer =\n _this.name === RowContainerName.TOP_FULL_WIDTH\n || _this.name === RowContainerName.STICKY_TOP_FULL_WIDTH\n || _this.name === RowContainerName.BOTTOM_FULL_WIDTH\n || _this.name === RowContainerName.FULL_WIDTH;\n return _this;\n }\n RowContainerCtrl.getRowContainerCssClasses = function (name) {\n var containerClass = ContainerCssClasses.get(name);\n var viewportClass = ViewportCssClasses.get(name);\n return { container: containerClass, viewport: viewportClass };\n };\n RowContainerCtrl.getPinned = function (name) {\n switch (name) {\n case RowContainerName.BOTTOM_LEFT:\n case RowContainerName.TOP_LEFT:\n case RowContainerName.STICKY_TOP_LEFT:\n case RowContainerName.LEFT:\n return 'left';\n case RowContainerName.BOTTOM_RIGHT:\n case RowContainerName.TOP_RIGHT:\n case RowContainerName.STICKY_TOP_RIGHT:\n case RowContainerName.RIGHT:\n return 'right';\n default:\n return null;\n }\n };\n RowContainerCtrl.prototype.postConstruct = function () {\n var _this = this;\n this.enableRtl = this.gridOptionsService.get('enableRtl');\n this.forContainers([RowContainerName.CENTER], function () { return _this.viewportSizeFeature = _this.createManagedBean(new ViewportSizeFeature(_this)); });\n };\n RowContainerCtrl.prototype.registerWithCtrlsService = function () {\n switch (this.name) {\n case RowContainerName.CENTER:\n this.ctrlsService.registerCenterRowContainerCtrl(this);\n break;\n case RowContainerName.LEFT:\n this.ctrlsService.registerLeftRowContainerCtrl(this);\n break;\n case RowContainerName.RIGHT:\n this.ctrlsService.registerRightRowContainerCtrl(this);\n break;\n case RowContainerName.TOP_CENTER:\n this.ctrlsService.registerTopCenterRowContainerCtrl(this);\n break;\n case RowContainerName.TOP_LEFT:\n this.ctrlsService.registerTopLeftRowContainerCon(this);\n break;\n case RowContainerName.TOP_RIGHT:\n this.ctrlsService.registerTopRightRowContainerCtrl(this);\n break;\n case RowContainerName.STICKY_TOP_CENTER:\n this.ctrlsService.registerStickyTopCenterRowContainerCtrl(this);\n break;\n case RowContainerName.STICKY_TOP_LEFT:\n this.ctrlsService.registerStickyTopLeftRowContainerCon(this);\n break;\n case RowContainerName.STICKY_TOP_RIGHT:\n this.ctrlsService.registerStickyTopRightRowContainerCtrl(this);\n break;\n case RowContainerName.BOTTOM_CENTER:\n this.ctrlsService.registerBottomCenterRowContainerCtrl(this);\n break;\n case RowContainerName.BOTTOM_LEFT:\n this.ctrlsService.registerBottomLeftRowContainerCtrl(this);\n break;\n case RowContainerName.BOTTOM_RIGHT:\n this.ctrlsService.registerBottomRightRowContainerCtrl(this);\n break;\n }\n };\n RowContainerCtrl.prototype.forContainers = function (names, callback) {\n if (names.indexOf(this.name) >= 0) {\n callback();\n }\n };\n RowContainerCtrl.prototype.getContainerElement = function () {\n return this.eContainer;\n };\n RowContainerCtrl.prototype.getViewportSizeFeature = function () {\n return this.viewportSizeFeature;\n };\n RowContainerCtrl.prototype.setComp = function (view, eContainer, eViewport) {\n var _this = this;\n this.comp = view;\n this.eContainer = eContainer;\n this.eViewport = eViewport;\n this.createManagedBean(new RowContainerEventsFeature(this.eContainer));\n this.addPreventScrollWhileDragging();\n this.listenOnDomOrder();\n this.stopHScrollOnPinnedRows();\n var allTopNoFW = [RowContainerName.TOP_CENTER, RowContainerName.TOP_LEFT, RowContainerName.TOP_RIGHT];\n var allStickyTopNoFW = [RowContainerName.STICKY_TOP_CENTER, RowContainerName.STICKY_TOP_LEFT, RowContainerName.STICKY_TOP_RIGHT];\n var allBottomNoFW = [RowContainerName.BOTTOM_CENTER, RowContainerName.BOTTOM_LEFT, RowContainerName.BOTTOM_RIGHT];\n var allMiddleNoFW = [RowContainerName.CENTER, RowContainerName.LEFT, RowContainerName.RIGHT];\n var allNoFW = __spreadArray$j(__spreadArray$j(__spreadArray$j(__spreadArray$j([], __read$n(allTopNoFW), false), __read$n(allBottomNoFW), false), __read$n(allMiddleNoFW), false), __read$n(allStickyTopNoFW), false);\n var allMiddle = [RowContainerName.CENTER, RowContainerName.LEFT, RowContainerName.RIGHT, RowContainerName.FULL_WIDTH];\n var allCenter = [RowContainerName.CENTER, RowContainerName.TOP_CENTER, RowContainerName.STICKY_TOP_CENTER, RowContainerName.BOTTOM_CENTER];\n var allLeft = [RowContainerName.LEFT, RowContainerName.BOTTOM_LEFT, RowContainerName.TOP_LEFT, RowContainerName.STICKY_TOP_LEFT];\n var allRight = [RowContainerName.RIGHT, RowContainerName.BOTTOM_RIGHT, RowContainerName.TOP_RIGHT, RowContainerName.STICKY_TOP_RIGHT];\n this.forContainers(allLeft, function () {\n _this.pinnedWidthFeature = _this.createManagedBean(new SetPinnedLeftWidthFeature(_this.eContainer));\n _this.addManagedListener(_this.eventService, Events.EVENT_LEFT_PINNED_WIDTH_CHANGED, function () { return _this.onPinnedWidthChanged(); });\n });\n this.forContainers(allRight, function () {\n _this.pinnedWidthFeature = _this.createManagedBean(new SetPinnedRightWidthFeature(_this.eContainer));\n _this.addManagedListener(_this.eventService, Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED, function () { return _this.onPinnedWidthChanged(); });\n });\n this.forContainers(allMiddle, function () { return _this.createManagedBean(new SetHeightFeature(_this.eContainer, _this.name === RowContainerName.CENTER ? eViewport : undefined)); });\n this.forContainers(allNoFW, function () { return _this.createManagedBean(new DragListenerFeature(_this.eContainer)); });\n this.forContainers(allCenter, function () { return _this.createManagedBean(new CenterWidthFeature(function (width) { return _this.comp.setContainerWidth(\"\".concat(width, \"px\")); })); });\n this.addListeners();\n this.registerWithCtrlsService();\n };\n RowContainerCtrl.prototype.addListeners = function () {\n var _this = this;\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, function () { return _this.onDisplayedColumnsChanged(); });\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, function () { return _this.onDisplayedColumnsWidthChanged(); });\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_ROWS_CHANGED, function (params) { return _this.onDisplayedRowsChanged(params.afterScroll); });\n this.onDisplayedColumnsChanged();\n this.onDisplayedColumnsWidthChanged();\n this.onDisplayedRowsChanged();\n };\n RowContainerCtrl.prototype.listenOnDomOrder = function () {\n var _this = this;\n // sticky section must show rows in set order\n var allStickyContainers = [RowContainerName.STICKY_TOP_CENTER, RowContainerName.STICKY_TOP_LEFT, RowContainerName.STICKY_TOP_RIGHT, RowContainerName.STICKY_TOP_FULL_WIDTH];\n var isStickContainer = allStickyContainers.indexOf(this.name) >= 0;\n if (isStickContainer) {\n this.comp.setDomOrder(true);\n return;\n }\n var listener = function () {\n var isEnsureDomOrder = _this.gridOptionsService.get('ensureDomOrder');\n var isPrintLayout = _this.gridOptionsService.isDomLayout('print');\n _this.comp.setDomOrder(isEnsureDomOrder || isPrintLayout);\n };\n this.addManagedPropertyListener('domLayout', listener);\n listener();\n };\n // when editing a pinned row, if the cell is half outside the scrollable area, the browser can\n // scroll the column into view. we do not want this, the pinned sections should never scroll.\n // so we listen to scrolls on these containers and reset the scroll if we find one.\n RowContainerCtrl.prototype.stopHScrollOnPinnedRows = function () {\n var _this = this;\n this.forContainers([RowContainerName.TOP_CENTER, RowContainerName.STICKY_TOP_CENTER, RowContainerName.BOTTOM_CENTER], function () {\n var resetScrollLeft = function () { return _this.eViewport.scrollLeft = 0; };\n _this.addManagedListener(_this.eViewport, 'scroll', resetScrollLeft);\n });\n };\n RowContainerCtrl.prototype.onDisplayedColumnsChanged = function () {\n var _this = this;\n this.forContainers([RowContainerName.CENTER], function () { return _this.onHorizontalViewportChanged(); });\n };\n RowContainerCtrl.prototype.onDisplayedColumnsWidthChanged = function () {\n var _this = this;\n this.forContainers([RowContainerName.CENTER], function () { return _this.onHorizontalViewportChanged(); });\n };\n // this methods prevents the grid views from being scrolled while the dragService is being used\n // eg. the view should not scroll up and down while dragging rows using the rowDragComp.\n RowContainerCtrl.prototype.addPreventScrollWhileDragging = function () {\n var _this = this;\n var preventScroll = function (e) {\n if (_this.dragService.isDragging()) {\n if (e.cancelable) {\n e.preventDefault();\n }\n }\n };\n this.eContainer.addEventListener('touchmove', preventScroll, { passive: false });\n this.addDestroyFunc(function () { return _this.eContainer.removeEventListener('touchmove', preventScroll); });\n };\n // this gets called whenever a change in the viewport, so we can inform column controller it has to work\n // out the virtual columns again. gets called from following locations:\n // + ensureColVisible, scroll, init, layoutChanged, displayedColumnsChanged\n RowContainerCtrl.prototype.onHorizontalViewportChanged = function (afterScroll) {\n if (afterScroll === void 0) { afterScroll = false; }\n var scrollWidth = this.getCenterWidth();\n var scrollPosition = this.getCenterViewportScrollLeft();\n this.columnModel.setViewportPosition(scrollWidth, scrollPosition, afterScroll);\n };\n RowContainerCtrl.prototype.getCenterWidth = function () {\n return getInnerWidth(this.eViewport);\n };\n RowContainerCtrl.prototype.getCenterViewportScrollLeft = function () {\n // we defer to a util, as how you calculated scrollLeft when doing RTL depends on the browser\n return getScrollLeft(this.eViewport, this.enableRtl);\n };\n RowContainerCtrl.prototype.registerViewportResizeListener = function (listener) {\n var unsubscribeFromResize = this.resizeObserverService.observeResize(this.eViewport, listener);\n this.addDestroyFunc(function () { return unsubscribeFromResize(); });\n };\n RowContainerCtrl.prototype.isViewportInTheDOMTree = function () {\n return isInDOM(this.eViewport);\n };\n RowContainerCtrl.prototype.getViewportScrollLeft = function () {\n return getScrollLeft(this.eViewport, this.enableRtl);\n };\n RowContainerCtrl.prototype.isHorizontalScrollShowing = function () {\n var isAlwaysShowHorizontalScroll = this.gridOptionsService.get('alwaysShowHorizontalScroll');\n return isAlwaysShowHorizontalScroll || isHorizontalScrollShowing(this.eViewport);\n };\n RowContainerCtrl.prototype.getViewportElement = function () {\n return this.eViewport;\n };\n RowContainerCtrl.prototype.setContainerTranslateX = function (amount) {\n this.eContainer.style.transform = \"translateX(\".concat(amount, \"px)\");\n };\n RowContainerCtrl.prototype.getHScrollPosition = function () {\n var res = {\n left: this.eViewport.scrollLeft,\n right: this.eViewport.scrollLeft + this.eViewport.offsetWidth\n };\n return res;\n };\n RowContainerCtrl.prototype.setCenterViewportScrollLeft = function (value) {\n // we defer to a util, as how you calculated scrollLeft when doing RTL depends on the browser\n setScrollLeft(this.eViewport, value, this.enableRtl);\n };\n RowContainerCtrl.prototype.isContainerVisible = function () {\n var pinned = RowContainerCtrl.getPinned(this.name);\n return !pinned || (!!this.pinnedWidthFeature && this.pinnedWidthFeature.getWidth() > 0);\n };\n RowContainerCtrl.prototype.onPinnedWidthChanged = function () {\n var visible = this.isContainerVisible();\n if (this.visible != visible) {\n this.visible = visible;\n this.onDisplayedRowsChanged();\n }\n };\n RowContainerCtrl.prototype.onDisplayedRowsChanged = function (afterScroll) {\n var _this = this;\n if (afterScroll === void 0) { afterScroll = false; }\n if (!this.visible) {\n this.comp.setRowCtrls({ rowCtrls: this.EMPTY_CTRLS });\n return;\n }\n var printLayout = this.gridOptionsService.isDomLayout('print');\n var embedFullWidthRows = this.gridOptionsService.get('embedFullWidthRows');\n var embedFW = embedFullWidthRows || printLayout;\n // this list contains either all pinned top, center or pinned bottom rows\n // this filters out rows not for this container, eg if it's a full with row, but we are not full with container\n var rowsThisContainer = this.getRowCtrls().filter(function (rowCtrl) {\n // this just justifies if the ctrl is in the correct place, this will be fed with zombie rows by the\n // row renderer, so should not block them as they still need to animate - the row renderer\n // will clean these up when they finish animating\n var fullWidthRow = rowCtrl.isFullWidth();\n var match = _this.isFullWithContainer ?\n !embedFW && fullWidthRow\n : embedFW || !fullWidthRow;\n return match;\n });\n this.comp.setRowCtrls({ rowCtrls: rowsThisContainer, useFlushSync: afterScroll });\n };\n RowContainerCtrl.prototype.getRowCtrls = function () {\n switch (this.name) {\n case RowContainerName.TOP_CENTER:\n case RowContainerName.TOP_LEFT:\n case RowContainerName.TOP_RIGHT:\n case RowContainerName.TOP_FULL_WIDTH:\n return this.rowRenderer.getTopRowCtrls();\n case RowContainerName.STICKY_TOP_CENTER:\n case RowContainerName.STICKY_TOP_LEFT:\n case RowContainerName.STICKY_TOP_RIGHT:\n case RowContainerName.STICKY_TOP_FULL_WIDTH:\n return this.rowRenderer.getStickyTopRowCtrls();\n case RowContainerName.BOTTOM_CENTER:\n case RowContainerName.BOTTOM_LEFT:\n case RowContainerName.BOTTOM_RIGHT:\n case RowContainerName.BOTTOM_FULL_WIDTH:\n return this.rowRenderer.getBottomRowCtrls();\n default:\n return this.rowRenderer.getCentreRowCtrls();\n }\n };\n __decorate$1P([\n Autowired('dragService')\n ], RowContainerCtrl.prototype, \"dragService\", void 0);\n __decorate$1P([\n Autowired('ctrlsService')\n ], RowContainerCtrl.prototype, \"ctrlsService\", void 0);\n __decorate$1P([\n Autowired('columnModel')\n ], RowContainerCtrl.prototype, \"columnModel\", void 0);\n __decorate$1P([\n Autowired('resizeObserverService')\n ], RowContainerCtrl.prototype, \"resizeObserverService\", void 0);\n __decorate$1P([\n Autowired('rowRenderer')\n ], RowContainerCtrl.prototype, \"rowRenderer\", void 0);\n __decorate$1P([\n PostConstruct\n ], RowContainerCtrl.prototype, \"postConstruct\", null);\n return RowContainerCtrl;\n}(BeanStub));\n\nvar __extends$1W = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1O = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar GRID_BODY_TEMPLATE = /* html */ \"
\\n \\n
\\n \\n \\n \\n \\n
\\n
\\n
\\n \\n \\n \\n \\n
\\n \\n
\\n
\\n \\n \\n \\n \\n
\\n
\\n \\n \\n \\n \\n
\\n \\n \\n
\");\nvar GridBodyComp = /** @class */ (function (_super) {\n __extends$1W(GridBodyComp, _super);\n function GridBodyComp() {\n return _super.call(this, GRID_BODY_TEMPLATE) || this;\n }\n GridBodyComp.prototype.init = function () {\n var _this = this;\n var setHeight = function (height, element) {\n var heightString = \"\".concat(height, \"px\");\n element.style.minHeight = heightString;\n element.style.height = heightString;\n };\n var compProxy = {\n setRowAnimationCssOnBodyViewport: function (cssClass, animate) { return _this.setRowAnimationCssOnBodyViewport(cssClass, animate); },\n setColumnCount: function (count) { return setAriaColCount(_this.getGui(), count); },\n setRowCount: function (count) { return setAriaRowCount(_this.getGui(), count); },\n setTopHeight: function (height) { return setHeight(height, _this.eTop); },\n setBottomHeight: function (height) { return setHeight(height, _this.eBottom); },\n setTopDisplay: function (display) { return _this.eTop.style.display = display; },\n setBottomDisplay: function (display) { return _this.eBottom.style.display = display; },\n setStickyTopHeight: function (height) { return _this.eStickyTop.style.height = height; },\n setStickyTopTop: function (top) { return _this.eStickyTop.style.top = top; },\n setStickyTopWidth: function (width) { return _this.eStickyTop.style.width = width; },\n setColumnMovingCss: function (cssClass, flag) { return _this.addOrRemoveCssClass(cssClass, flag); },\n updateLayoutClasses: function (cssClass, params) {\n var classLists = [\n _this.eBodyViewport.classList,\n _this.eBody.classList\n ];\n classLists.forEach(function (classList) {\n classList.toggle(LayoutCssClasses.AUTO_HEIGHT, params.autoHeight);\n classList.toggle(LayoutCssClasses.NORMAL, params.normal);\n classList.toggle(LayoutCssClasses.PRINT, params.print);\n });\n _this.addOrRemoveCssClass(LayoutCssClasses.AUTO_HEIGHT, params.autoHeight);\n _this.addOrRemoveCssClass(LayoutCssClasses.NORMAL, params.normal);\n _this.addOrRemoveCssClass(LayoutCssClasses.PRINT, params.print);\n },\n setAlwaysVerticalScrollClass: function (cssClass, on) {\n return _this.eBodyViewport.classList.toggle(CSS_CLASS_FORCE_VERTICAL_SCROLL, on);\n },\n registerBodyViewportResizeListener: function (listener) {\n var unsubscribeFromResize = _this.resizeObserverService.observeResize(_this.eBodyViewport, listener);\n _this.addDestroyFunc(function () { return unsubscribeFromResize(); });\n },\n setPinnedTopBottomOverflowY: function (overflow) { return _this.eTop.style.overflowY = _this.eBottom.style.overflowY = overflow; },\n setCellSelectableCss: function (cssClass, selectable) {\n [_this.eTop, _this.eBodyViewport, _this.eBottom]\n .forEach(function (ct) { return ct.classList.toggle(cssClass, selectable); });\n },\n setBodyViewportWidth: function (width) { return _this.eBodyViewport.style.width = width; }\n };\n this.ctrl = this.createManagedBean(new GridBodyCtrl());\n this.ctrl.setComp(compProxy, this.getGui(), this.eBodyViewport, this.eTop, this.eBottom, this.eStickyTop);\n if (this.rangeService && this.gridOptionsService.get('enableRangeSelection') || this.gridOptionsService.get('rowSelection') === 'multiple') {\n setAriaMultiSelectable(this.getGui(), true);\n }\n };\n GridBodyComp.prototype.setRowAnimationCssOnBodyViewport = function (cssClass, animateRows) {\n var bodyViewportClassList = this.eBodyViewport.classList;\n bodyViewportClassList.toggle(RowAnimationCssClasses.ANIMATION_ON, animateRows);\n bodyViewportClassList.toggle(RowAnimationCssClasses.ANIMATION_OFF, !animateRows);\n };\n GridBodyComp.prototype.getFloatingTopBottom = function () {\n return [this.eTop, this.eBottom];\n };\n __decorate$1O([\n Autowired('resizeObserverService')\n ], GridBodyComp.prototype, \"resizeObserverService\", void 0);\n __decorate$1O([\n Optional('rangeService')\n ], GridBodyComp.prototype, \"rangeService\", void 0);\n __decorate$1O([\n RefSelector('eBodyViewport')\n ], GridBodyComp.prototype, \"eBodyViewport\", void 0);\n __decorate$1O([\n RefSelector('eStickyTop')\n ], GridBodyComp.prototype, \"eStickyTop\", void 0);\n __decorate$1O([\n RefSelector('eTop')\n ], GridBodyComp.prototype, \"eTop\", void 0);\n __decorate$1O([\n RefSelector('eBottom')\n ], GridBodyComp.prototype, \"eBottom\", void 0);\n __decorate$1O([\n RefSelector('gridHeader')\n ], GridBodyComp.prototype, \"headerRootComp\", void 0);\n __decorate$1O([\n RefSelector('eBody')\n ], GridBodyComp.prototype, \"eBody\", void 0);\n __decorate$1O([\n PostConstruct\n ], GridBodyComp.prototype, \"init\", null);\n return GridBodyComp;\n}(Component));\n\nvar __extends$1V = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1N = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ScrollVisibleService = /** @class */ (function (_super) {\n __extends$1V(ScrollVisibleService, _super);\n function ScrollVisibleService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ScrollVisibleService.prototype.postConstruct = function () {\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, this.onDisplayedColumnsWidthChanged.bind(this));\n };\n ScrollVisibleService.prototype.onDisplayedColumnsChanged = function () {\n this.update();\n };\n ScrollVisibleService.prototype.onDisplayedColumnsWidthChanged = function () {\n this.update();\n };\n ScrollVisibleService.prototype.update = function () {\n var _this = this;\n // Because of column animation, if user removes cols anywhere except at the RHS, \n // then the cols on the RHS will animate to the left to fill the gap. This animation \n // means just after the cols are removed, the remaining cols are still in the original\n // location at the start of the animation, so pre animation the H scrollbar is still\n // needed, but post animation it is not. So if animation is active, we only update\n // after the animation has ended.\n if (this.columnAnimationService.isActive()) {\n this.columnAnimationService.executeLaterVMTurn(function () {\n _this.columnAnimationService.executeLaterVMTurn(function () { return _this.updateImpl(); });\n });\n }\n else {\n this.updateImpl();\n }\n };\n ScrollVisibleService.prototype.updateImpl = function () {\n var centerRowCtrl = this.ctrlsService.getCenterRowContainerCtrl();\n if (!centerRowCtrl || this.columnAnimationService.isActive()) {\n return;\n }\n var params = {\n horizontalScrollShowing: centerRowCtrl.isHorizontalScrollShowing(),\n verticalScrollShowing: this.isVerticalScrollShowing()\n };\n this.setScrollsVisible(params);\n };\n ScrollVisibleService.prototype.setScrollsVisible = function (params) {\n var atLeastOneDifferent = this.horizontalScrollShowing !== params.horizontalScrollShowing ||\n this.verticalScrollShowing !== params.verticalScrollShowing;\n if (atLeastOneDifferent) {\n this.horizontalScrollShowing = params.horizontalScrollShowing;\n this.verticalScrollShowing = params.verticalScrollShowing;\n var event_1 = {\n type: Events.EVENT_SCROLL_VISIBILITY_CHANGED\n };\n this.eventService.dispatchEvent(event_1);\n }\n };\n // used by pagination service - to know page height\n ScrollVisibleService.prototype.isHorizontalScrollShowing = function () {\n return this.horizontalScrollShowing;\n };\n // used by header container\n ScrollVisibleService.prototype.isVerticalScrollShowing = function () {\n return this.verticalScrollShowing;\n };\n __decorate$1N([\n Autowired('ctrlsService')\n ], ScrollVisibleService.prototype, \"ctrlsService\", void 0);\n __decorate$1N([\n Autowired('columnAnimationService')\n ], ScrollVisibleService.prototype, \"columnAnimationService\", void 0);\n __decorate$1N([\n PostConstruct\n ], ScrollVisibleService.prototype, \"postConstruct\", null);\n ScrollVisibleService = __decorate$1N([\n Bean('scrollVisibleService')\n ], ScrollVisibleService);\n return ScrollVisibleService;\n}(BeanStub));\n\nvar __extends$1U = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1M = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar MouseEventService = /** @class */ (function (_super) {\n __extends$1U(MouseEventService, _super);\n function MouseEventService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.gridInstanceId = MouseEventService_1.gridInstanceSequence.next();\n return _this;\n }\n MouseEventService_1 = MouseEventService;\n // we put the instance id onto the main DOM element. this is used for events, when grids are inside grids,\n // so the grid can work out if the even came from this grid or a grid inside this one. see the ctrl+v logic\n // for where this is used.\n MouseEventService.prototype.stampTopLevelGridCompWithGridInstance = function (eGridDiv) {\n eGridDiv[MouseEventService_1.GRID_DOM_KEY] = this.gridInstanceId;\n };\n MouseEventService.prototype.getRenderedCellForEvent = function (event) {\n return getCtrlForEventTarget(this.gridOptionsService, event.target, CellCtrl.DOM_DATA_KEY_CELL_CTRL);\n };\n // walks the path of the event, and returns true if this grid is the first one that it finds. if doing\n // master / detail grids, and a child grid is found, then it returns false. this stops things like copy/paste\n // getting executed on many grids at the same time.\n MouseEventService.prototype.isEventFromThisGrid = function (event) {\n var res = this.isElementInThisGrid(event.target);\n return res;\n };\n MouseEventService.prototype.isElementInThisGrid = function (element) {\n var pointer = element;\n while (pointer) {\n var instanceId = pointer[MouseEventService_1.GRID_DOM_KEY];\n if (exists(instanceId)) {\n var eventFromThisGrid = instanceId === this.gridInstanceId;\n return eventFromThisGrid;\n }\n pointer = pointer.parentElement;\n }\n return false;\n };\n MouseEventService.prototype.getCellPositionForEvent = function (event) {\n var cellComp = this.getRenderedCellForEvent(event);\n return cellComp ? cellComp.getCellPosition() : null;\n };\n MouseEventService.prototype.getNormalisedPosition = function (event) {\n var gridPanelHasScrolls = this.gridOptionsService.isDomLayout('normal');\n var e = event;\n var x;\n var y;\n if (e.clientX != null || e.clientY != null) {\n x = e.clientX;\n y = e.clientY;\n }\n else {\n x = e.x;\n y = e.y;\n }\n if (gridPanelHasScrolls) {\n var gridBodyCon = this.ctrlsService.getGridBodyCtrl();\n var vRange = gridBodyCon.getScrollFeature().getVScrollPosition();\n var hRange = gridBodyCon.getScrollFeature().getHScrollPosition();\n x += hRange.left;\n y += vRange.top;\n }\n return { x: x, y: y };\n };\n var MouseEventService_1;\n MouseEventService.gridInstanceSequence = new NumberSequence();\n MouseEventService.GRID_DOM_KEY = '__ag_grid_instance';\n __decorate$1M([\n Autowired('ctrlsService')\n ], MouseEventService.prototype, \"ctrlsService\", void 0);\n MouseEventService = MouseEventService_1 = __decorate$1M([\n Bean('mouseEventService')\n ], MouseEventService);\n return MouseEventService;\n}(BeanStub));\n\nvar __extends$1T = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$c = ( false) || function () {\n __assign$c = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$c.apply(this, arguments);\n};\nvar __decorate$1L = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar NavigationService = /** @class */ (function (_super) {\n __extends$1T(NavigationService, _super);\n function NavigationService() {\n var _this = _super.call(this) || this;\n _this.onPageDown = throttle(_this.onPageDown, 100);\n _this.onPageUp = throttle(_this.onPageUp, 100);\n return _this;\n }\n NavigationService.prototype.postConstruct = function () {\n var _this = this;\n this.ctrlsService.whenReady(function (p) {\n _this.gridBodyCon = p.gridBodyCtrl;\n });\n };\n NavigationService.prototype.handlePageScrollingKey = function (event, fromFullWidth) {\n if (fromFullWidth === void 0) { fromFullWidth = false; }\n var key = event.key;\n var alt = event.altKey;\n var ctrl = event.ctrlKey || event.metaKey;\n var rangeServiceShouldHandleShift = !!this.rangeService && event.shiftKey;\n // home and end can be processed without knowing the currently selected cell, this can occur for full width rows.\n var currentCell = this.mouseEventService.getCellPositionForEvent(event);\n var processed = false;\n switch (key) {\n case KeyCode.PAGE_HOME:\n case KeyCode.PAGE_END:\n // handle home and end when ctrl & alt are NOT pressed\n if (!ctrl && !alt) {\n this.onHomeOrEndKey(key);\n processed = true;\n }\n break;\n case KeyCode.LEFT:\n case KeyCode.RIGHT:\n case KeyCode.UP:\n case KeyCode.DOWN:\n if (!currentCell) {\n return false;\n }\n // handle when ctrl is pressed only, if shift is pressed\n // it will be handled by the rangeService\n if (ctrl && !alt && !rangeServiceShouldHandleShift) {\n this.onCtrlUpDownLeftRight(key, currentCell);\n processed = true;\n }\n break;\n case KeyCode.PAGE_DOWN:\n case KeyCode.PAGE_UP:\n // handle page up and page down when ctrl & alt are NOT pressed\n if (!ctrl && !alt) {\n processed = this.handlePageUpDown(key, currentCell, fromFullWidth);\n }\n break;\n }\n if (processed) {\n event.preventDefault();\n }\n return processed;\n };\n NavigationService.prototype.handlePageUpDown = function (key, currentCell, fromFullWidth) {\n if (fromFullWidth) {\n currentCell = this.focusService.getFocusedCell();\n }\n if (!currentCell) {\n return false;\n }\n if (key === KeyCode.PAGE_UP) {\n this.onPageUp(currentCell);\n }\n else {\n this.onPageDown(currentCell);\n }\n return true;\n };\n NavigationService.prototype.navigateTo = function (navigateParams) {\n var scrollIndex = navigateParams.scrollIndex, scrollType = navigateParams.scrollType, scrollColumn = navigateParams.scrollColumn, focusIndex = navigateParams.focusIndex, focusColumn = navigateParams.focusColumn;\n if (exists(scrollColumn) && !scrollColumn.isPinned()) {\n this.gridBodyCon.getScrollFeature().ensureColumnVisible(scrollColumn);\n }\n if (exists(scrollIndex)) {\n this.gridBodyCon.getScrollFeature().ensureIndexVisible(scrollIndex, scrollType);\n }\n // setFocusedCell relies on the browser default focus behavior to scroll the focused cell into view,\n // however, this behavior will cause the cell border to be cut off, or if we have sticky rows, the\n // cell will be completely hidden, so we call ensureIndexVisible without a position to guarantee\n // minimal scroll to get the row into view.\n if (!navigateParams.isAsync) {\n this.gridBodyCon.getScrollFeature().ensureIndexVisible(focusIndex);\n }\n // if we don't do this, the range will be left on the last cell, which will leave the last focused cell\n // highlighted.\n this.focusService.setFocusedCell({ rowIndex: focusIndex, column: focusColumn, rowPinned: null, forceBrowserFocus: true });\n if (this.rangeService) {\n var cellPosition = { rowIndex: focusIndex, rowPinned: null, column: focusColumn };\n this.rangeService.setRangeToCell(cellPosition);\n }\n };\n // this method is throttled, see the `constructor`\n NavigationService.prototype.onPageDown = function (gridCell) {\n var gridBodyCon = this.ctrlsService.getGridBodyCtrl();\n var scrollPosition = gridBodyCon.getScrollFeature().getVScrollPosition();\n var pixelsInOnePage = this.getViewportHeight();\n var pagingPixelOffset = this.paginationProxy.getPixelOffset();\n var currentPageBottomPixel = scrollPosition.top + pixelsInOnePage;\n var currentPageBottomRow = this.paginationProxy.getRowIndexAtPixel(currentPageBottomPixel + pagingPixelOffset);\n if (this.columnModel.isAutoRowHeightActive()) {\n this.navigateToNextPageWithAutoHeight(gridCell, currentPageBottomRow);\n }\n else {\n this.navigateToNextPage(gridCell, currentPageBottomRow);\n }\n };\n // this method is throttled, see the `constructor`\n NavigationService.prototype.onPageUp = function (gridCell) {\n var gridBodyCon = this.ctrlsService.getGridBodyCtrl();\n var scrollPosition = gridBodyCon.getScrollFeature().getVScrollPosition();\n var pagingPixelOffset = this.paginationProxy.getPixelOffset();\n var currentPageTopPixel = scrollPosition.top;\n var currentPageTopRow = this.paginationProxy.getRowIndexAtPixel(currentPageTopPixel + pagingPixelOffset);\n if (this.columnModel.isAutoRowHeightActive()) {\n this.navigateToNextPageWithAutoHeight(gridCell, currentPageTopRow, true);\n }\n else {\n this.navigateToNextPage(gridCell, currentPageTopRow, true);\n }\n };\n NavigationService.prototype.navigateToNextPage = function (gridCell, scrollIndex, up) {\n if (up === void 0) { up = false; }\n var pixelsInOnePage = this.getViewportHeight();\n var firstRow = this.paginationProxy.getPageFirstRow();\n var lastRow = this.paginationProxy.getPageLastRow();\n var pagingPixelOffset = this.paginationProxy.getPixelOffset();\n var currentRowNode = this.paginationProxy.getRow(gridCell.rowIndex);\n var rowPixelDiff = up\n ? ((currentRowNode === null || currentRowNode === void 0 ? void 0 : currentRowNode.rowHeight) - pixelsInOnePage - pagingPixelOffset)\n : (pixelsInOnePage - pagingPixelOffset);\n var nextCellPixel = (currentRowNode === null || currentRowNode === void 0 ? void 0 : currentRowNode.rowTop) + rowPixelDiff;\n var focusIndex = this.paginationProxy.getRowIndexAtPixel(nextCellPixel + pagingPixelOffset);\n if (focusIndex === gridCell.rowIndex) {\n var diff = up ? -1 : 1;\n scrollIndex = focusIndex = gridCell.rowIndex + diff;\n }\n var scrollType;\n if (up) {\n scrollType = 'bottom';\n if (focusIndex < firstRow) {\n focusIndex = firstRow;\n }\n if (scrollIndex < firstRow) {\n scrollIndex = firstRow;\n }\n }\n else {\n scrollType = 'top';\n if (focusIndex > lastRow) {\n focusIndex = lastRow;\n }\n if (scrollIndex > lastRow) {\n scrollIndex = lastRow;\n }\n }\n if (this.isRowTallerThanView(focusIndex)) {\n scrollIndex = focusIndex;\n scrollType = 'top';\n }\n this.navigateTo({\n scrollIndex: scrollIndex,\n scrollType: scrollType,\n scrollColumn: null,\n focusIndex: focusIndex,\n focusColumn: gridCell.column\n });\n };\n NavigationService.prototype.navigateToNextPageWithAutoHeight = function (gridCell, scrollIndex, up) {\n var _this = this;\n if (up === void 0) { up = false; }\n // because autoHeight will calculate the height of rows after scroll\n // first we scroll towards the required point, then we add a small\n // delay to allow the height to be recalculated, check which index\n // should be focused and then finally navigate to that index.\n // TODO: we should probably have an event fired once to scrollbar has\n // settled and all rowHeights have been calculated instead of relying\n // on a setTimeout of 50ms.\n this.navigateTo({\n scrollIndex: scrollIndex,\n scrollType: up ? 'bottom' : 'top',\n scrollColumn: null,\n focusIndex: scrollIndex,\n focusColumn: gridCell.column\n });\n setTimeout(function () {\n var focusIndex = _this.getNextFocusIndexForAutoHeight(gridCell, up);\n _this.navigateTo({\n scrollIndex: scrollIndex,\n scrollType: up ? 'bottom' : 'top',\n scrollColumn: null,\n focusIndex: focusIndex,\n focusColumn: gridCell.column,\n isAsync: true\n });\n }, 50);\n };\n NavigationService.prototype.getNextFocusIndexForAutoHeight = function (gridCell, up) {\n var _a;\n if (up === void 0) { up = false; }\n var step = up ? -1 : 1;\n var pixelsInOnePage = this.getViewportHeight();\n var lastRowIndex = this.paginationProxy.getPageLastRow();\n var pixelSum = 0;\n var currentIndex = gridCell.rowIndex;\n while (currentIndex >= 0 && currentIndex <= lastRowIndex) {\n var currentCell = this.paginationProxy.getRow(currentIndex);\n if (currentCell) {\n var currentCellHeight = (_a = currentCell.rowHeight) !== null && _a !== void 0 ? _a : 0;\n if (pixelSum + currentCellHeight > pixelsInOnePage) {\n break;\n }\n pixelSum += currentCellHeight;\n }\n currentIndex += step;\n }\n return Math.max(0, Math.min(currentIndex, lastRowIndex));\n };\n NavigationService.prototype.getViewportHeight = function () {\n var gridBodyCon = this.ctrlsService.getGridBodyCtrl();\n var scrollPosition = gridBodyCon.getScrollFeature().getVScrollPosition();\n var scrollbarWidth = this.gridOptionsService.getScrollbarWidth();\n var pixelsInOnePage = scrollPosition.bottom - scrollPosition.top;\n if (this.ctrlsService.getCenterRowContainerCtrl().isHorizontalScrollShowing()) {\n pixelsInOnePage -= scrollbarWidth;\n }\n return pixelsInOnePage;\n };\n NavigationService.prototype.isRowTallerThanView = function (rowIndex) {\n var rowNode = this.paginationProxy.getRow(rowIndex);\n if (!rowNode) {\n return false;\n }\n var rowHeight = rowNode.rowHeight;\n if (typeof rowHeight !== 'number') {\n return false;\n }\n return rowHeight > this.getViewportHeight();\n };\n NavigationService.prototype.onCtrlUpDownLeftRight = function (key, gridCell) {\n var cellToFocus = this.cellNavigationService.getNextCellToFocus(key, gridCell, true);\n var rowIndex = cellToFocus.rowIndex, column = cellToFocus.column;\n this.navigateTo({\n scrollIndex: rowIndex,\n scrollType: null,\n scrollColumn: column,\n focusIndex: rowIndex,\n focusColumn: column\n });\n };\n // home brings focus to top left cell, end brings focus to bottom right, grid scrolled to bring\n // same cell into view (which means either scroll all the way up, or all the way down).\n NavigationService.prototype.onHomeOrEndKey = function (key) {\n var homeKey = key === KeyCode.PAGE_HOME;\n var allColumns = this.columnModel.getAllDisplayedColumns();\n var columnToSelect = homeKey ? allColumns[0] : last(allColumns);\n var scrollIndex = homeKey ? this.paginationProxy.getPageFirstRow() : this.paginationProxy.getPageLastRow();\n this.navigateTo({\n scrollIndex: scrollIndex,\n scrollType: null,\n scrollColumn: columnToSelect,\n focusIndex: scrollIndex,\n focusColumn: columnToSelect\n });\n };\n // result of keyboard event\n NavigationService.prototype.onTabKeyDown = function (previous, keyboardEvent) {\n var backwards = keyboardEvent.shiftKey;\n var movedToNextCell = this.tabToNextCellCommon(previous, backwards, keyboardEvent);\n if (movedToNextCell) {\n // only prevent default if we found a cell. so if user is on last cell and hits tab, then we default\n // to the normal tabbing so user can exit the grid.\n keyboardEvent.preventDefault();\n return;\n }\n // if we didn't move to next cell, then need to tab out of the cells, ie to the header (if going\n // backwards)\n if (backwards) {\n var _a = previous.getRowPosition(), rowIndex = _a.rowIndex, rowPinned = _a.rowPinned;\n var firstRow = rowPinned ? rowIndex === 0 : rowIndex === this.paginationProxy.getPageFirstRow();\n if (firstRow) {\n if (this.gridOptionsService.get('headerHeight') === 0 || this.gridOptionsService.get('suppressHeaderFocus')) {\n this.focusService.focusNextGridCoreContainer(true, true);\n }\n else {\n keyboardEvent.preventDefault();\n this.focusService.focusPreviousFromFirstCell(keyboardEvent);\n }\n }\n }\n else {\n // if the case it's a popup editor, the focus is on the editor and not the previous cell.\n // in order for the tab navigation to work, we need to focus the browser back onto the\n // previous cell.\n if (previous instanceof CellCtrl) {\n previous.focusCell(true);\n }\n if (this.focusService.focusNextGridCoreContainer(backwards)) {\n keyboardEvent.preventDefault();\n }\n }\n };\n // comes from API\n NavigationService.prototype.tabToNextCell = function (backwards, event) {\n var focusedCell = this.focusService.getFocusedCell();\n // if no focus, then cannot navigate\n if (!focusedCell) {\n return false;\n }\n var cellOrRow = this.getCellByPosition(focusedCell);\n // if cell is not rendered, means user has scrolled away from the cell\n // or that the focusedCell is a Full Width Row\n if (!cellOrRow) {\n cellOrRow = this.rowRenderer.getRowByPosition(focusedCell);\n if (!cellOrRow || !cellOrRow.isFullWidth()) {\n return false;\n }\n }\n return this.tabToNextCellCommon(cellOrRow, backwards, event);\n };\n NavigationService.prototype.tabToNextCellCommon = function (previous, backwards, event) {\n var editing = previous.isEditing();\n // if cell is not editing, there is still chance row is editing if it's Full Row Editing\n if (!editing && previous instanceof CellCtrl) {\n var cell = previous;\n var row = cell.getRowCtrl();\n if (row) {\n editing = row.isEditing();\n }\n }\n var res;\n if (editing) {\n // if we are editing, we know it's not a Full Width Row (RowComp)\n if (this.gridOptionsService.get('editType') === 'fullRow') {\n res = this.moveToNextEditingRow(previous, backwards, event);\n }\n else {\n res = this.moveToNextEditingCell(previous, backwards, event);\n }\n }\n else {\n res = this.moveToNextCellNotEditing(previous, backwards);\n }\n // if a cell wasn't found, it's possible that focus was moved to the header\n return res || !!this.focusService.getFocusedHeader();\n };\n NavigationService.prototype.moveToNextEditingCell = function (previousCell, backwards, event) {\n if (event === void 0) { event = null; }\n var previousPos = previousCell.getCellPosition();\n // before we stop editing, we need to focus the cell element\n // so the grid doesn't detect that focus has left the grid\n previousCell.getGui().focus();\n // need to do this before getting next cell to edit, in case the next cell\n // has editable function (eg colDef.editable=func() ) and it depends on the\n // result of this cell, so need to save updates from the first edit, in case\n // the value is referenced in the function.\n previousCell.stopEditing();\n // find the next cell to start editing\n var nextCell = this.findNextCellToFocusOn(previousPos, backwards, true);\n if (nextCell == null) {\n return false;\n }\n // only prevent default if we found a cell. so if user is on last cell and hits tab, then we default\n // to the normal tabbing so user can exit the grid.\n nextCell.startEditing(null, true, event);\n nextCell.focusCell(false);\n return true;\n };\n NavigationService.prototype.moveToNextEditingRow = function (previousCell, backwards, event) {\n if (event === void 0) { event = null; }\n var previousPos = previousCell.getCellPosition();\n // find the next cell to start editing\n var nextCell = this.findNextCellToFocusOn(previousPos, backwards, true);\n if (nextCell == null) {\n return false;\n }\n var nextPos = nextCell.getCellPosition();\n var previousEditable = this.isCellEditable(previousPos);\n var nextEditable = this.isCellEditable(nextPos);\n var rowsMatch = nextPos && previousPos.rowIndex === nextPos.rowIndex && previousPos.rowPinned === nextPos.rowPinned;\n if (previousEditable) {\n previousCell.setFocusOutOnEditor();\n }\n if (!rowsMatch) {\n var pRow = previousCell.getRowCtrl();\n pRow.stopEditing();\n var nRow = nextCell.getRowCtrl();\n nRow.startRowEditing(undefined, undefined, event);\n }\n if (nextEditable) {\n nextCell.setFocusInOnEditor();\n nextCell.focusCell();\n }\n else {\n nextCell.focusCell(true);\n }\n return true;\n };\n NavigationService.prototype.moveToNextCellNotEditing = function (previousCell, backwards) {\n var displayedColumns = this.columnModel.getAllDisplayedColumns();\n var cellPos;\n if (previousCell instanceof RowCtrl) {\n cellPos = __assign$c(__assign$c({}, previousCell.getRowPosition()), { column: backwards ? displayedColumns[0] : last(displayedColumns) });\n }\n else {\n cellPos = previousCell.getCellPosition();\n }\n // find the next cell to start editing\n var nextCell = this.findNextCellToFocusOn(cellPos, backwards, false);\n // only prevent default if we found a cell. so if user is on last cell and hits tab, then we default\n // to the normal tabbing so user can exit the grid.\n if (nextCell instanceof CellCtrl) {\n nextCell.focusCell(true);\n }\n else if (nextCell) {\n return this.tryToFocusFullWidthRow(nextCell.getRowPosition(), backwards);\n }\n return exists(nextCell);\n };\n // called by the cell, when tab is pressed while editing.\n // @return: RenderedCell when navigation successful, otherwise null\n NavigationService.prototype.findNextCellToFocusOn = function (previousPosition, backwards, startEditing) {\n var nextPosition = previousPosition;\n while (true) {\n if (previousPosition !== nextPosition) {\n previousPosition = nextPosition;\n }\n if (!backwards) {\n nextPosition = this.getLastCellOfColSpan(nextPosition);\n }\n nextPosition = this.cellNavigationService.getNextTabbedCell(nextPosition, backwards);\n // allow user to override what cell to go to next\n var userFunc = this.gridOptionsService.getCallback('tabToNextCell');\n if (exists(userFunc)) {\n var params = {\n backwards: backwards,\n editing: startEditing,\n previousCellPosition: previousPosition,\n nextCellPosition: nextPosition ? nextPosition : null\n };\n var userCell = userFunc(params);\n if (exists(userCell)) {\n if (userCell.floating) {\n warnOnce(\"tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?\");\n userCell.rowPinned = userCell.floating;\n }\n nextPosition = {\n rowIndex: userCell.rowIndex,\n column: userCell.column,\n rowPinned: userCell.rowPinned\n };\n }\n else {\n nextPosition = null;\n }\n }\n // if no 'next cell', means we have got to last cell of grid, so nothing to move to,\n // so bottom right cell going forwards, or top left going backwards\n if (!nextPosition) {\n return null;\n }\n if (nextPosition.rowIndex < 0) {\n var headerLen = this.headerNavigationService.getHeaderRowCount();\n this.focusService.focusHeaderPosition({\n headerPosition: {\n headerRowIndex: headerLen + (nextPosition.rowIndex),\n column: nextPosition.column\n },\n fromCell: true\n });\n return null;\n }\n // if editing, but cell not editable, skip cell. we do this before we do all of\n // the 'ensure index visible' and 'flush all frames', otherwise if we are skipping\n // a bunch of cells (eg 10 rows) then all the work on ensuring cell visible is useless\n // (except for the last one) which causes grid to stall for a while.\n // note - for full row edit, we do focus non-editable cells, as the row stays in edit mode.\n var fullRowEdit = this.gridOptionsService.get('editType') === 'fullRow';\n if (startEditing && !fullRowEdit) {\n var cellIsEditable = this.isCellEditable(nextPosition);\n if (!cellIsEditable) {\n continue;\n }\n }\n this.ensureCellVisible(nextPosition);\n // we have to call this after ensureColumnVisible - otherwise it could be a virtual column\n // or row that is not currently in view, hence the renderedCell would not exist\n var nextCell = this.getCellByPosition(nextPosition);\n // if next cell is fullWidth row, then no rendered cell,\n // as fullWidth rows have no cells, so we skip it\n if (!nextCell) {\n var row = this.rowRenderer.getRowByPosition(nextPosition);\n if (!row || !row.isFullWidth() || startEditing) {\n continue;\n }\n return row;\n }\n if (nextCell.isSuppressNavigable()) {\n continue;\n }\n // by default, when we click a cell, it gets selected into a range, so to keep keyboard navigation\n // consistent, we set into range here also.\n if (this.rangeService) {\n this.rangeService.setRangeToCell(nextPosition);\n }\n // we successfully tabbed onto a grid cell, so return true\n return nextCell;\n }\n };\n NavigationService.prototype.isCellEditable = function (cell) {\n var rowNode = this.lookupRowNodeForCell(cell);\n if (rowNode) {\n return cell.column.isCellEditable(rowNode);\n }\n return false;\n };\n NavigationService.prototype.getCellByPosition = function (cellPosition) {\n var rowCtrl = this.rowRenderer.getRowByPosition(cellPosition);\n if (!rowCtrl) {\n return null;\n }\n return rowCtrl.getCellCtrl(cellPosition.column);\n };\n NavigationService.prototype.lookupRowNodeForCell = function (cell) {\n if (cell.rowPinned === 'top') {\n return this.pinnedRowModel.getPinnedTopRow(cell.rowIndex);\n }\n if (cell.rowPinned === 'bottom') {\n return this.pinnedRowModel.getPinnedBottomRow(cell.rowIndex);\n }\n return this.paginationProxy.getRow(cell.rowIndex);\n };\n // we use index for rows, but column object for columns, as the next column (by index) might not\n // be visible (header grouping) so it's not reliable, so using the column object instead.\n NavigationService.prototype.navigateToNextCell = function (event, key, currentCell, allowUserOverride) {\n // we keep searching for a next cell until we find one. this is how the group rows get skipped\n var nextCell = currentCell;\n var hitEdgeOfGrid = false;\n while (nextCell && (nextCell === currentCell || !this.isValidNavigateCell(nextCell))) {\n // if the current cell is spanning across multiple columns, we need to move\n // our current position to be the last cell on the right before finding the\n // the next target.\n if (this.gridOptionsService.get('enableRtl')) {\n if (key === KeyCode.LEFT) {\n nextCell = this.getLastCellOfColSpan(nextCell);\n }\n }\n else if (key === KeyCode.RIGHT) {\n nextCell = this.getLastCellOfColSpan(nextCell);\n }\n nextCell = this.cellNavigationService.getNextCellToFocus(key, nextCell);\n // eg if going down, and nextCell=undefined, means we are gone past the last row\n hitEdgeOfGrid = missing(nextCell);\n }\n if (hitEdgeOfGrid && event && event.key === KeyCode.UP) {\n nextCell = {\n rowIndex: -1,\n rowPinned: null,\n column: currentCell.column\n };\n }\n // allow user to override what cell to go to next. when doing normal cell navigation (with keys)\n // we allow this, however if processing 'enter after edit' we don't allow override\n if (allowUserOverride) {\n var userFunc = this.gridOptionsService.getCallback('navigateToNextCell');\n if (exists(userFunc)) {\n var params = {\n key: key,\n previousCellPosition: currentCell,\n nextCellPosition: nextCell ? nextCell : null,\n event: event\n };\n var userCell = userFunc(params);\n if (exists(userCell)) {\n if (userCell.floating) {\n warnOnce(\"tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?\");\n userCell.rowPinned = userCell.floating;\n }\n nextCell = {\n rowPinned: userCell.rowPinned,\n rowIndex: userCell.rowIndex,\n column: userCell.column\n };\n }\n else {\n nextCell = null;\n }\n }\n }\n // no next cell means we have reached a grid boundary, eg left, right, top or bottom of grid\n if (!nextCell) {\n return;\n }\n if (nextCell.rowIndex < 0) {\n var headerLen = this.headerNavigationService.getHeaderRowCount();\n this.focusService.focusHeaderPosition({\n headerPosition: { headerRowIndex: headerLen + (nextCell.rowIndex), column: currentCell.column },\n event: event || undefined,\n fromCell: true\n });\n return;\n }\n // in case we have col spanning we get the cellComp and use it to get the\n // position. This was we always focus the first cell inside the spanning.\n var normalisedPosition = this.getNormalisedPosition(nextCell);\n if (normalisedPosition) {\n this.focusPosition(normalisedPosition);\n }\n else {\n this.tryToFocusFullWidthRow(nextCell);\n }\n };\n NavigationService.prototype.getNormalisedPosition = function (cellPosition) {\n // ensureCellVisible first, to make sure cell at position is rendered.\n this.ensureCellVisible(cellPosition);\n var cellCtrl = this.getCellByPosition(cellPosition);\n // not guaranteed to have a cellComp when using the SSRM as blocks are loading.\n if (!cellCtrl) {\n return null;\n }\n cellPosition = cellCtrl.getCellPosition();\n // we call this again, as nextCell can be different to it's previous value due to Column Spanning\n // (ie if cursor moving from right to left, and cell is spanning columns, then nextCell was the\n // last column in the group, however now it's the first column in the group). if we didn't do\n // ensureCellVisible again, then we could only be showing the last portion (last column) of the\n // merged cells.\n this.ensureCellVisible(cellPosition);\n return cellPosition;\n };\n NavigationService.prototype.tryToFocusFullWidthRow = function (position, backwards) {\n if (backwards === void 0) { backwards = false; }\n var displayedColumns = this.columnModel.getAllDisplayedColumns();\n var rowComp = this.rowRenderer.getRowByPosition(position);\n if (!rowComp || !rowComp.isFullWidth()) {\n return false;\n }\n var currentCellFocused = this.focusService.getFocusedCell();\n var cellPosition = {\n rowIndex: position.rowIndex,\n rowPinned: position.rowPinned,\n column: position.column || (backwards ? last(displayedColumns) : displayedColumns[0])\n };\n this.focusPosition(cellPosition);\n var fromBelow = currentCellFocused != null ? this.rowPositionUtils.before(cellPosition, currentCellFocused) : false;\n var focusEvent = {\n type: Events.EVENT_FULL_WIDTH_ROW_FOCUSED,\n rowIndex: cellPosition.rowIndex,\n rowPinned: cellPosition.rowPinned,\n column: cellPosition.column,\n isFullWidthCell: true,\n floating: cellPosition.rowPinned,\n fromBelow: fromBelow\n };\n this.eventService.dispatchEvent(focusEvent);\n return true;\n };\n NavigationService.prototype.focusPosition = function (cellPosition) {\n this.focusService.setFocusedCell({\n rowIndex: cellPosition.rowIndex,\n column: cellPosition.column,\n rowPinned: cellPosition.rowPinned,\n forceBrowserFocus: true\n });\n if (this.rangeService) {\n this.rangeService.setRangeToCell(cellPosition);\n }\n };\n NavigationService.prototype.isValidNavigateCell = function (cell) {\n var rowNode = this.rowPositionUtils.getRowNode(cell);\n // we do not allow focusing on detail rows and full width rows\n return !!rowNode;\n };\n NavigationService.prototype.getLastCellOfColSpan = function (cell) {\n var cellCtrl = this.getCellByPosition(cell);\n if (!cellCtrl) {\n return cell;\n }\n var colSpanningList = cellCtrl.getColSpanningList();\n if (colSpanningList.length === 1) {\n return cell;\n }\n return {\n rowIndex: cell.rowIndex,\n column: last(colSpanningList),\n rowPinned: cell.rowPinned\n };\n };\n NavigationService.prototype.ensureCellVisible = function (gridCell) {\n var isGroupStickyEnabled = this.gridOptionsService.isGroupRowsSticky();\n var rowNode = this.rowModel.getRow(gridCell.rowIndex);\n // sticky rows are always visible, so the grid shouldn't scroll to focus them.\n var skipScrollToRow = isGroupStickyEnabled && (rowNode === null || rowNode === void 0 ? void 0 : rowNode.sticky);\n // this scrolls the row into view\n if (!skipScrollToRow && missing(gridCell.rowPinned)) {\n this.gridBodyCon.getScrollFeature().ensureIndexVisible(gridCell.rowIndex);\n }\n if (!gridCell.column.isPinned()) {\n this.gridBodyCon.getScrollFeature().ensureColumnVisible(gridCell.column);\n }\n };\n __decorate$1L([\n Autowired('mouseEventService')\n ], NavigationService.prototype, \"mouseEventService\", void 0);\n __decorate$1L([\n Autowired('paginationProxy')\n ], NavigationService.prototype, \"paginationProxy\", void 0);\n __decorate$1L([\n Autowired('focusService')\n ], NavigationService.prototype, \"focusService\", void 0);\n __decorate$1L([\n Optional('rangeService')\n ], NavigationService.prototype, \"rangeService\", void 0);\n __decorate$1L([\n Autowired('columnModel')\n ], NavigationService.prototype, \"columnModel\", void 0);\n __decorate$1L([\n Autowired('rowModel')\n ], NavigationService.prototype, \"rowModel\", void 0);\n __decorate$1L([\n Autowired('ctrlsService')\n ], NavigationService.prototype, \"ctrlsService\", void 0);\n __decorate$1L([\n Autowired('rowRenderer')\n ], NavigationService.prototype, \"rowRenderer\", void 0);\n __decorate$1L([\n Autowired('headerNavigationService')\n ], NavigationService.prototype, \"headerNavigationService\", void 0);\n __decorate$1L([\n Autowired(\"rowPositionUtils\")\n ], NavigationService.prototype, \"rowPositionUtils\", void 0);\n __decorate$1L([\n Autowired(\"cellNavigationService\")\n ], NavigationService.prototype, \"cellNavigationService\", void 0);\n __decorate$1L([\n Autowired(\"pinnedRowModel\")\n ], NavigationService.prototype, \"pinnedRowModel\", void 0);\n __decorate$1L([\n PostConstruct\n ], NavigationService.prototype, \"postConstruct\", null);\n NavigationService = __decorate$1L([\n Bean('navigationService')\n ], NavigationService);\n return NavigationService;\n}(BeanStub));\n\nvar __extends$1S = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1K = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar PopupEditorWrapper = /** @class */ (function (_super) {\n __extends$1S(PopupEditorWrapper, _super);\n function PopupEditorWrapper(params) {\n var _this = _super.call(this, /* html */ \"
\") || this;\n _this.params = params;\n return _this;\n }\n PopupEditorWrapper.prototype.postConstruct = function () {\n this.gridOptionsService.setDomData(this.getGui(), PopupEditorWrapper.DOM_KEY_POPUP_EDITOR_WRAPPER, true);\n this.addKeyDownListener();\n };\n PopupEditorWrapper.prototype.addKeyDownListener = function () {\n var _this = this;\n var eGui = this.getGui();\n var params = this.params;\n var listener = function (event) {\n if (!isUserSuppressingKeyboardEvent(_this.gridOptionsService, event, params.node, params.column, true)) {\n params.onKeyDown(event);\n }\n };\n this.addManagedListener(eGui, 'keydown', listener);\n };\n PopupEditorWrapper.DOM_KEY_POPUP_EDITOR_WRAPPER = 'popupEditorWrapper';\n __decorate$1K([\n PostConstruct\n ], PopupEditorWrapper.prototype, \"postConstruct\", null);\n return PopupEditorWrapper;\n}(PopupComponent));\n\nvar __extends$1R = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar CellComp = /** @class */ (function (_super) {\n __extends$1R(CellComp, _super);\n function CellComp(beans, cellCtrl, printLayout, eRow, editingRow) {\n var _this = _super.call(this) || this;\n // every time we go into edit mode, or back again, this gets incremented.\n // it's the components way of dealing with the async nature of framework components,\n // so if a framework component takes a while to be created, we know if the object\n // is still relevant when creating is finished. eg we could click edit / un-edit 20\n // times before the first React edit component comes back - we should discard\n // the first 19.\n _this.rendererVersion = 0;\n _this.editorVersion = 0;\n _this.beans = beans;\n _this.column = cellCtrl.getColumn();\n _this.rowNode = cellCtrl.getRowNode();\n _this.rowCtrl = cellCtrl.getRowCtrl();\n _this.eRow = eRow;\n _this.cellCtrl = cellCtrl;\n var cellDiv = document.createElement('div');\n cellDiv.setAttribute('comp-id', \"\".concat(_this.getCompId()));\n _this.setTemplateFromElement(cellDiv);\n var eGui = _this.getGui();\n _this.forceWrapper = cellCtrl.isForceWrapper();\n _this.refreshWrapper(false);\n var setAttribute = function (name, value) {\n if (value != null && value != '') {\n eGui.setAttribute(name, value);\n }\n else {\n eGui.removeAttribute(name);\n }\n };\n setAriaRole(eGui, cellCtrl.getCellAriaRole());\n setAttribute('col-id', cellCtrl.getColumnIdSanitised());\n var tabIndex = cellCtrl.getTabIndex();\n if (tabIndex !== undefined) {\n setAttribute('tabindex', tabIndex.toString());\n }\n var compProxy = {\n addOrRemoveCssClass: function (cssClassName, on) { return _this.addOrRemoveCssClass(cssClassName, on); },\n setUserStyles: function (styles) { return addStylesToElement(eGui, styles); },\n getFocusableElement: function () { return _this.getFocusableElement(); },\n setIncludeSelection: function (include) { return _this.includeSelection = include; },\n setIncludeRowDrag: function (include) { return _this.includeRowDrag = include; },\n setIncludeDndSource: function (include) { return _this.includeDndSource = include; },\n setRenderDetails: function (compDetails, valueToDisplay, force) {\n return _this.setRenderDetails(compDetails, valueToDisplay, force);\n },\n setEditDetails: function (compDetails, popup, position) {\n return _this.setEditDetails(compDetails, popup, position);\n },\n getCellEditor: function () { return _this.cellEditor || null; },\n getCellRenderer: function () { return _this.cellRenderer || null; },\n getParentOfValue: function () { return _this.getParentOfValue(); }\n };\n cellCtrl.setComp(compProxy, _this.getGui(), _this.eCellWrapper, printLayout, editingRow);\n return _this;\n }\n CellComp.prototype.getParentOfValue = function () {\n if (this.eCellValue) {\n // if not editing, and using wrapper, then value goes in eCellValue\n return this.eCellValue;\n }\n if (this.eCellWrapper) {\n // if editing, and using wrapper, value (cell editor) goes in eCellWrapper\n return this.eCellWrapper;\n }\n // if editing or rendering, and not using wrapper, value (or comp) is directly inside cell\n return this.getGui();\n };\n CellComp.prototype.setRenderDetails = function (compDetails, valueToDisplay, forceNewCellRendererInstance) {\n // this can happen if the users asks for the cell to refresh, but we are not showing the vale as we are editing\n var isInlineEditing = this.cellEditor && !this.cellEditorPopupWrapper;\n if (isInlineEditing) {\n return;\n }\n // this means firstRender will be true for one pass only, as it's initialised to undefined\n this.firstRender = this.firstRender == null;\n // if display template has changed, means any previous Cell Renderer is in the wrong location\n var controlWrapperChanged = this.refreshWrapper(false);\n this.refreshEditStyles(false);\n // all of these have dependencies on the eGui, so only do them after eGui is set\n if (compDetails) {\n var neverRefresh = forceNewCellRendererInstance || controlWrapperChanged;\n var cellRendererRefreshSuccessful = neverRefresh ? false : this.refreshCellRenderer(compDetails);\n if (!cellRendererRefreshSuccessful) {\n this.destroyRenderer();\n this.createCellRendererInstance(compDetails);\n }\n }\n else {\n this.destroyRenderer();\n this.insertValueWithoutCellRenderer(valueToDisplay);\n }\n };\n CellComp.prototype.setEditDetails = function (compDetails, popup, position) {\n if (compDetails) {\n this.createCellEditorInstance(compDetails, popup, position);\n }\n else {\n this.destroyEditor();\n }\n };\n CellComp.prototype.removeControls = function () {\n this.checkboxSelectionComp = this.beans.context.destroyBean(this.checkboxSelectionComp);\n this.dndSourceComp = this.beans.context.destroyBean(this.dndSourceComp);\n this.rowDraggingComp = this.beans.context.destroyBean(this.rowDraggingComp);\n };\n // returns true if wrapper was changed\n CellComp.prototype.refreshWrapper = function (editing) {\n var providingControls = this.includeRowDrag || this.includeDndSource || this.includeSelection;\n var usingWrapper = providingControls || this.forceWrapper;\n var putWrapperIn = usingWrapper && this.eCellWrapper == null;\n if (putWrapperIn) {\n var wrapperDiv = document.createElement('div');\n wrapperDiv.setAttribute('role', 'presentation');\n wrapperDiv.setAttribute('class', 'ag-cell-wrapper');\n this.eCellWrapper = wrapperDiv;\n this.getGui().appendChild(this.eCellWrapper);\n }\n var takeWrapperOut = !usingWrapper && this.eCellWrapper != null;\n if (takeWrapperOut) {\n removeFromParent(this.eCellWrapper);\n this.eCellWrapper = undefined;\n }\n this.addOrRemoveCssClass('ag-cell-value', !usingWrapper);\n var usingCellValue = !editing && usingWrapper;\n var putCellValueIn = usingCellValue && this.eCellValue == null;\n if (putCellValueIn) {\n var cellSpan = document.createElement('span');\n cellSpan.setAttribute('role', 'presentation');\n cellSpan.setAttribute('class', 'ag-cell-value');\n this.eCellValue = cellSpan;\n this.eCellWrapper.appendChild(this.eCellValue);\n }\n var takeCellValueOut = !usingCellValue && this.eCellValue != null;\n if (takeCellValueOut) {\n removeFromParent(this.eCellValue);\n this.eCellValue = undefined;\n }\n var templateChanged = putWrapperIn || takeWrapperOut || putCellValueIn || takeCellValueOut;\n if (templateChanged) {\n this.removeControls();\n }\n if (!editing) {\n if (providingControls) {\n this.addControls();\n }\n }\n return templateChanged;\n };\n CellComp.prototype.addControls = function () {\n if (this.includeRowDrag) {\n if (this.rowDraggingComp == null) {\n this.rowDraggingComp = this.cellCtrl.createRowDragComp();\n if (this.rowDraggingComp) {\n // put the checkbox in before the value\n this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(), this.eCellValue);\n }\n }\n }\n if (this.includeDndSource) {\n if (this.dndSourceComp == null) {\n this.dndSourceComp = this.cellCtrl.createDndSource();\n // put the checkbox in before the value\n this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(), this.eCellValue);\n }\n }\n if (this.includeSelection) {\n if (this.checkboxSelectionComp == null) {\n this.checkboxSelectionComp = this.cellCtrl.createSelectionCheckbox();\n this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(), this.eCellValue);\n }\n }\n };\n CellComp.prototype.createCellEditorInstance = function (compDetails, popup, position) {\n var _this = this;\n var versionCopy = this.editorVersion;\n var cellEditorPromise = compDetails.newAgStackInstance();\n if (!cellEditorPromise) {\n return;\n } // if empty, userComponentFactory already did a console message\n var params = compDetails.params;\n cellEditorPromise.then(function (c) { return _this.afterCellEditorCreated(versionCopy, c, params, popup, position); });\n // if we don't do this, and editor component is async, then there will be a period\n // when the component isn't present and keyboard navigation won't work - so example\n // of user hitting tab quickly (more quickly than renderers getting created) won't work\n var cellEditorAsync = missing(this.cellEditor);\n if (cellEditorAsync && params.cellStartedEdit) {\n this.cellCtrl.focusCell(true);\n }\n };\n CellComp.prototype.insertValueWithoutCellRenderer = function (valueToDisplay) {\n var eParent = this.getParentOfValue();\n clearElement(eParent);\n var escapedValue = valueToDisplay != null ? escapeString(valueToDisplay, true) : null;\n if (escapedValue != null) {\n eParent.textContent = escapedValue;\n }\n };\n CellComp.prototype.destroyEditorAndRenderer = function () {\n this.destroyRenderer();\n this.destroyEditor();\n };\n CellComp.prototype.destroyRenderer = function () {\n var context = this.beans.context;\n this.cellRenderer = context.destroyBean(this.cellRenderer);\n removeFromParent(this.cellRendererGui);\n this.cellRendererGui = null;\n this.rendererVersion++;\n };\n CellComp.prototype.destroyEditor = function () {\n var context = this.beans.context;\n if (this.hideEditorPopup) {\n this.hideEditorPopup();\n }\n this.hideEditorPopup = undefined;\n this.cellEditor = context.destroyBean(this.cellEditor);\n this.cellEditorPopupWrapper = context.destroyBean(this.cellEditorPopupWrapper);\n removeFromParent(this.cellEditorGui);\n this.cellEditorGui = null;\n this.editorVersion++;\n };\n CellComp.prototype.refreshCellRenderer = function (compClassAndParams) {\n if (this.cellRenderer == null || this.cellRenderer.refresh == null) {\n return false;\n }\n // if different Cell Renderer configured this time (eg user is using selector, and\n // returns different component) then don't refresh, force recreate of Cell Renderer\n if (this.cellRendererClass !== compClassAndParams.componentClass) {\n return false;\n }\n // take any custom params off of the user\n var result = this.cellRenderer.refresh(compClassAndParams.params);\n // NOTE on undefined: previous version of the cellRenderer.refresh() interface\n // returned nothing, if the method existed, we assumed it refreshed. so for\n // backwards compatibility, we assume if method exists and returns nothing,\n // that it was successful.\n return result === true || result === undefined;\n };\n CellComp.prototype.createCellRendererInstance = function (compDetails) {\n var _this = this;\n // never use task service if animation frame service is turned off.\n // and lastly we never use it if doing auto-height, as the auto-height service checks the\n // row height directly after the cell is created, it doesn't wait around for the tasks to complete \n var suppressAnimationFrame = this.beans.gridOptionsService.get('suppressAnimationFrame');\n var useTaskService = !suppressAnimationFrame;\n var displayComponentVersionCopy = this.rendererVersion;\n var componentClass = compDetails.componentClass;\n var createCellRendererFunc = function () {\n var staleTask = _this.rendererVersion !== displayComponentVersionCopy || !_this.isAlive();\n if (staleTask) {\n return;\n }\n // this can return null in the event that the user has switched from a renderer component to nothing, for example\n // when using a cellRendererSelect to return a component or null depending on row data etc\n var componentPromise = compDetails.newAgStackInstance();\n var callback = _this.afterCellRendererCreated.bind(_this, displayComponentVersionCopy, componentClass);\n if (componentPromise) {\n componentPromise.then(callback);\n }\n };\n // we only use task service when rendering for first time, which means it is not used when doing edits.\n // if we changed this (always use task service) would make sense, however it would break tests, possibly\n // test of users.\n if (useTaskService && this.firstRender) {\n this.beans.animationFrameService.createTask(createCellRendererFunc, this.rowNode.rowIndex, 'createTasksP2');\n }\n else {\n createCellRendererFunc();\n }\n };\n CellComp.prototype.getCtrl = function () {\n return this.cellCtrl;\n };\n CellComp.prototype.getRowCtrl = function () {\n return this.rowCtrl;\n };\n CellComp.prototype.getCellRenderer = function () {\n return this.cellRenderer;\n };\n CellComp.prototype.getCellEditor = function () {\n return this.cellEditor;\n };\n CellComp.prototype.afterCellRendererCreated = function (cellRendererVersion, cellRendererClass, cellRenderer) {\n var staleTask = !this.isAlive() || cellRendererVersion !== this.rendererVersion;\n if (staleTask) {\n this.beans.context.destroyBean(cellRenderer);\n return;\n }\n this.cellRenderer = cellRenderer;\n this.cellRendererClass = cellRendererClass;\n this.cellRendererGui = this.cellRenderer.getGui();\n if (this.cellRendererGui != null) {\n var eParent = this.getParentOfValue();\n clearElement(eParent);\n eParent.appendChild(this.cellRendererGui);\n }\n };\n CellComp.prototype.afterCellEditorCreated = function (requestVersion, cellEditor, params, popup, position) {\n // if editingCell=false, means user cancelled the editor before component was ready.\n // if versionMismatch, then user cancelled the edit, then started the edit again, and this\n // is the first editor which is now stale.\n var staleComp = requestVersion !== this.editorVersion;\n if (staleComp) {\n this.beans.context.destroyBean(cellEditor);\n return;\n }\n var editingCancelledByUserComp = cellEditor.isCancelBeforeStart && cellEditor.isCancelBeforeStart();\n if (editingCancelledByUserComp) {\n this.beans.context.destroyBean(cellEditor);\n this.cellCtrl.stopEditing(true);\n return;\n }\n if (!cellEditor.getGui) {\n console.warn(\"AG Grid: cellEditor for column \".concat(this.column.getId(), \" is missing getGui() method\"));\n this.beans.context.destroyBean(cellEditor);\n return;\n }\n this.cellEditor = cellEditor;\n this.cellEditorGui = cellEditor.getGui();\n var cellEditorInPopup = popup || (cellEditor.isPopup !== undefined && cellEditor.isPopup());\n if (cellEditorInPopup) {\n this.addPopupCellEditor(params, position);\n }\n else {\n this.addInCellEditor();\n }\n this.refreshEditStyles(true, cellEditorInPopup);\n if (cellEditor.afterGuiAttached) {\n cellEditor.afterGuiAttached();\n }\n };\n CellComp.prototype.refreshEditStyles = function (editing, isPopup) {\n var _a;\n this.addOrRemoveCssClass('ag-cell-inline-editing', editing && !isPopup);\n this.addOrRemoveCssClass('ag-cell-popup-editing', editing && !!isPopup);\n this.addOrRemoveCssClass('ag-cell-not-inline-editing', !editing || !!isPopup);\n (_a = this.rowCtrl) === null || _a === void 0 ? void 0 : _a.setInlineEditingCss(editing);\n };\n CellComp.prototype.addInCellEditor = function () {\n var eGui = this.getGui();\n // if focus is inside the cell, we move focus to the cell itself\n // before removing it's contents, otherwise errors could be thrown.\n var eDocument = this.beans.gridOptionsService.getDocument();\n if (eGui.contains(eDocument.activeElement)) {\n eGui.focus();\n }\n this.destroyRenderer();\n this.refreshWrapper(true);\n this.clearParentOfValue();\n if (this.cellEditorGui) {\n var eParent = this.getParentOfValue();\n eParent.appendChild(this.cellEditorGui);\n }\n };\n CellComp.prototype.addPopupCellEditor = function (params, position) {\n var _this = this;\n if (this.beans.gridOptionsService.get('editType') === 'fullRow') {\n console.warn('AG Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both ' +\n '- either turn off fullRowEdit, or stop using popup editors.');\n }\n var cellEditor = this.cellEditor;\n // if a popup, then we wrap in a popup editor and return the popup\n this.cellEditorPopupWrapper = this.beans.context.createBean(new PopupEditorWrapper(params));\n var ePopupGui = this.cellEditorPopupWrapper.getGui();\n if (this.cellEditorGui) {\n ePopupGui.appendChild(this.cellEditorGui);\n }\n var popupService = this.beans.popupService;\n var useModelPopup = this.beans.gridOptionsService.get('stopEditingWhenCellsLoseFocus');\n // see if position provided by colDef, if not then check old way of method on cellComp\n var positionToUse = position != null\n ? position\n : cellEditor.getPopupPosition\n ? cellEditor.getPopupPosition()\n : 'over';\n var isRtl = this.beans.gridOptionsService.get('enableRtl');\n var positionParams = {\n ePopup: ePopupGui,\n column: this.column,\n rowNode: this.rowNode,\n type: 'popupCellEditor',\n eventSource: this.getGui(),\n position: positionToUse,\n alignSide: isRtl ? 'right' : 'left',\n keepWithinBounds: true\n };\n var positionCallback = popupService.positionPopupByComponent.bind(popupService, positionParams);\n var translate = this.beans.localeService.getLocaleTextFunc();\n var addPopupRes = popupService.addPopup({\n modal: useModelPopup,\n eChild: ePopupGui,\n closeOnEsc: true,\n closedCallback: function () { _this.cellCtrl.onPopupEditorClosed(); },\n anchorToElement: this.getGui(),\n positionCallback: positionCallback,\n ariaLabel: translate('ariaLabelCellEditor', 'Cell Editor')\n });\n if (addPopupRes) {\n this.hideEditorPopup = addPopupRes.hideFunc;\n }\n };\n CellComp.prototype.detach = function () {\n this.eRow.removeChild(this.getGui());\n };\n // if the row is also getting destroyed, then we don't need to remove from dom,\n // as the row will also get removed, so no need to take out the cells from the row\n // if the row is going (removing is an expensive operation, so only need to remove\n // the top part)\n //\n // note - this is NOT called by context, as we don't wire / unwire the CellComp for performance reasons.\n CellComp.prototype.destroy = function () {\n this.cellCtrl.stopEditing();\n this.destroyEditorAndRenderer();\n this.removeControls();\n _super.prototype.destroy.call(this);\n };\n CellComp.prototype.clearParentOfValue = function () {\n var eGui = this.getGui();\n // if focus is inside the cell, we move focus to the cell itself\n // before removing it's contents, otherwise errors could be thrown.\n var eDocument = this.beans.gridOptionsService.getDocument();\n if (eGui.contains(eDocument.activeElement) && browserSupportsPreventScroll()) {\n eGui.focus({ preventScroll: true });\n }\n clearElement(this.getParentOfValue());\n };\n return CellComp;\n}(Component));\n\nvar __extends$1Q = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar RowComp = /** @class */ (function (_super) {\n __extends$1Q(RowComp, _super);\n function RowComp(ctrl, beans, containerType) {\n var _this = _super.call(this) || this;\n _this.cellComps = {};\n _this.beans = beans;\n _this.rowCtrl = ctrl;\n var rowDiv = document.createElement('div');\n rowDiv.setAttribute('comp-id', \"\".concat(_this.getCompId()));\n rowDiv.setAttribute('style', _this.getInitialStyle(containerType));\n _this.setTemplateFromElement(rowDiv);\n var eGui = _this.getGui();\n var style = eGui.style;\n _this.domOrder = _this.rowCtrl.getDomOrder();\n setAriaRole(eGui, 'row');\n var tabIndex = _this.rowCtrl.getTabIndex();\n if (tabIndex != null) {\n eGui.setAttribute('tabindex', tabIndex.toString());\n }\n var compProxy = {\n setDomOrder: function (domOrder) { return _this.domOrder = domOrder; },\n setCellCtrls: function (cellCtrls) { return _this.setCellCtrls(cellCtrls); },\n showFullWidth: function (compDetails) { return _this.showFullWidth(compDetails); },\n getFullWidthCellRenderer: function () { return _this.getFullWidthCellRenderer(); },\n addOrRemoveCssClass: function (name, on) { return _this.addOrRemoveCssClass(name, on); },\n setUserStyles: function (styles) { return addStylesToElement(eGui, styles); },\n setTop: function (top) { return style.top = top; },\n setTransform: function (transform) { return style.transform = transform; },\n setRowIndex: function (rowIndex) { return eGui.setAttribute('row-index', rowIndex); },\n setRowId: function (rowId) { return eGui.setAttribute('row-id', rowId); },\n setRowBusinessKey: function (businessKey) { return eGui.setAttribute('row-business-key', businessKey); },\n refreshFullWidth: function (getUpdatedParams) { return _this.refreshFullWidth(getUpdatedParams); }\n };\n ctrl.setComp(compProxy, _this.getGui(), containerType);\n _this.addDestroyFunc(function () {\n ctrl.unsetComp(containerType);\n });\n return _this;\n }\n RowComp.prototype.getInitialStyle = function (containerType) {\n var transform = this.rowCtrl.getInitialTransform(containerType);\n return transform ? \"transform: \".concat(transform) : \"top: \".concat(this.rowCtrl.getInitialRowTop(containerType));\n };\n RowComp.prototype.showFullWidth = function (compDetails) {\n var _this = this;\n var callback = function (cellRenderer) {\n if (_this.isAlive()) {\n var eGui = cellRenderer.getGui();\n _this.getGui().appendChild(eGui);\n _this.rowCtrl.setupDetailRowAutoHeight(eGui);\n _this.setFullWidthRowComp(cellRenderer);\n }\n else {\n _this.beans.context.destroyBean(cellRenderer);\n }\n };\n // if not in cache, create new one\n var res = compDetails.newAgStackInstance();\n if (!res) {\n return;\n }\n res.then(callback);\n };\n RowComp.prototype.setCellCtrls = function (cellCtrls) {\n var _this = this;\n var cellsToRemove = Object.assign({}, this.cellComps);\n cellCtrls.forEach(function (cellCtrl) {\n var key = cellCtrl.getInstanceId();\n var existingCellComp = _this.cellComps[key];\n if (existingCellComp == null) {\n _this.newCellComp(cellCtrl);\n }\n else {\n cellsToRemove[key] = null;\n }\n });\n var cellCompsToRemove = getAllValuesInObject(cellsToRemove)\n .filter(function (cellComp) { return cellComp != null; });\n this.destroyCells(cellCompsToRemove);\n this.ensureDomOrder(cellCtrls);\n };\n RowComp.prototype.ensureDomOrder = function (cellCtrls) {\n var _this = this;\n if (!this.domOrder) {\n return;\n }\n var elementsInOrder = [];\n cellCtrls.forEach(function (cellCtrl) {\n var cellComp = _this.cellComps[cellCtrl.getInstanceId()];\n if (cellComp) {\n elementsInOrder.push(cellComp.getGui());\n }\n });\n setDomChildOrder(this.getGui(), elementsInOrder);\n };\n RowComp.prototype.newCellComp = function (cellCtrl) {\n var cellComp = new CellComp(this.beans, cellCtrl, this.rowCtrl.isPrintLayout(), this.getGui(), this.rowCtrl.isEditing());\n this.cellComps[cellCtrl.getInstanceId()] = cellComp;\n this.getGui().appendChild(cellComp.getGui());\n };\n RowComp.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.destroyAllCells();\n };\n RowComp.prototype.destroyAllCells = function () {\n var cellsToDestroy = getAllValuesInObject(this.cellComps).filter(function (cp) { return cp != null; });\n this.destroyCells(cellsToDestroy);\n };\n RowComp.prototype.setFullWidthRowComp = function (fullWidthRowComponent) {\n var _this = this;\n if (this.fullWidthCellRenderer) {\n console.error('AG Grid - should not be setting fullWidthRowComponent twice');\n }\n this.fullWidthCellRenderer = fullWidthRowComponent;\n this.addDestroyFunc(function () {\n _this.fullWidthCellRenderer = _this.beans.context.destroyBean(_this.fullWidthCellRenderer);\n });\n };\n RowComp.prototype.getFullWidthCellRenderer = function () {\n return this.fullWidthCellRenderer;\n };\n RowComp.prototype.destroyCells = function (cellComps) {\n var _this = this;\n cellComps.forEach(function (cellComp) {\n // could be old reference, ie removed cell\n if (!cellComp) {\n return;\n }\n // check cellComp belongs in this container\n var instanceId = cellComp.getCtrl().getInstanceId();\n if (_this.cellComps[instanceId] !== cellComp) {\n return;\n }\n cellComp.detach();\n cellComp.destroy();\n _this.cellComps[instanceId] = null;\n });\n };\n RowComp.prototype.refreshFullWidth = function (getUpdatedParams) {\n var fullWidthCellRenderer = this.fullWidthCellRenderer;\n if (!fullWidthCellRenderer || !fullWidthCellRenderer.refresh) {\n return false;\n }\n var params = getUpdatedParams();\n return fullWidthCellRenderer.refresh(params);\n };\n return RowComp;\n}(Component));\n\nvar __extends$1P = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$b = ( false) || function () {\n __assign$b = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$b.apply(this, arguments);\n};\nvar __decorate$1J = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nfunction templateFactory() {\n var name = Component.elementGettingCreated.getAttribute('name');\n var cssClasses = RowContainerCtrl.getRowContainerCssClasses(name);\n var res;\n var centerTemplate = name === RowContainerName.CENTER ||\n name === RowContainerName.TOP_CENTER ||\n name === RowContainerName.STICKY_TOP_CENTER ||\n name === RowContainerName.BOTTOM_CENTER;\n if (centerTemplate) {\n res = /* html */\n \"
\\n
\\n
\");\n }\n else {\n res = /* html */\n \"
\");\n }\n return res;\n}\nvar RowContainerComp = /** @class */ (function (_super) {\n __extends$1P(RowContainerComp, _super);\n function RowContainerComp() {\n var _this = _super.call(this, templateFactory()) || this;\n _this.rowComps = {};\n _this.name = Component.elementGettingCreated.getAttribute('name');\n _this.type = getRowContainerTypeForName(_this.name);\n return _this;\n }\n RowContainerComp.prototype.postConstruct = function () {\n var _this = this;\n var compProxy = {\n setViewportHeight: function (height) { return _this.eViewport.style.height = height; },\n setRowCtrls: function (_a) {\n var rowCtrls = _a.rowCtrls;\n return _this.setRowCtrls(rowCtrls);\n },\n setDomOrder: function (domOrder) {\n _this.domOrder = domOrder;\n },\n setContainerWidth: function (width) { return _this.eContainer.style.width = width; }\n };\n var ctrl = this.createManagedBean(new RowContainerCtrl(this.name));\n ctrl.setComp(compProxy, this.eContainer, this.eViewport);\n };\n RowContainerComp.prototype.preDestroy = function () {\n // destroys all row comps\n this.setRowCtrls([]);\n };\n RowContainerComp.prototype.setRowCtrls = function (rowCtrls) {\n var _this = this;\n var oldRows = __assign$b({}, this.rowComps);\n this.rowComps = {};\n this.lastPlacedElement = null;\n var processRow = function (rowCon) {\n var instanceId = rowCon.getInstanceId();\n var existingRowComp = oldRows[instanceId];\n if (existingRowComp) {\n _this.rowComps[instanceId] = existingRowComp;\n delete oldRows[instanceId];\n _this.ensureDomOrder(existingRowComp.getGui());\n }\n else {\n // don't create new row comps for rows which are not displayed. still want the existing components\n // as they may be animating out.\n if (!rowCon.getRowNode().displayed) {\n return;\n }\n var rowComp = new RowComp(rowCon, _this.beans, _this.type);\n _this.rowComps[instanceId] = rowComp;\n _this.appendRow(rowComp.getGui());\n }\n };\n rowCtrls.forEach(processRow);\n getAllValuesInObject(oldRows).forEach(function (oldRowComp) {\n _this.eContainer.removeChild(oldRowComp.getGui());\n oldRowComp.destroy();\n });\n setAriaRole(this.eContainer, \"rowgroup\");\n };\n RowContainerComp.prototype.appendRow = function (element) {\n if (this.domOrder) {\n insertWithDomOrder(this.eContainer, element, this.lastPlacedElement);\n }\n else {\n this.eContainer.appendChild(element);\n }\n this.lastPlacedElement = element;\n };\n RowContainerComp.prototype.ensureDomOrder = function (eRow) {\n if (this.domOrder) {\n ensureDomOrder(this.eContainer, eRow, this.lastPlacedElement);\n this.lastPlacedElement = eRow;\n }\n };\n __decorate$1J([\n Autowired('beans')\n ], RowContainerComp.prototype, \"beans\", void 0);\n __decorate$1J([\n RefSelector('eViewport')\n ], RowContainerComp.prototype, \"eViewport\", void 0);\n __decorate$1J([\n RefSelector('eContainer')\n ], RowContainerComp.prototype, \"eContainer\", void 0);\n __decorate$1J([\n PostConstruct\n ], RowContainerComp.prototype, \"postConstruct\", null);\n __decorate$1J([\n PreDestroy\n ], RowContainerComp.prototype, \"preDestroy\", null);\n return RowContainerComp;\n}(Component));\n\nvar __decorate$1I = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar BodyDropPivotTarget = /** @class */ (function () {\n function BodyDropPivotTarget(pinned) {\n this.columnsToAggregate = [];\n this.columnsToGroup = [];\n this.columnsToPivot = [];\n this.pinned = pinned;\n }\n /** Callback for when drag enters */\n BodyDropPivotTarget.prototype.onDragEnter = function (draggingEvent) {\n var _this = this;\n this.clearColumnsList();\n // in pivot mode, we don't accept any drops if functions are read only\n if (this.gridOptionsService.get('functionsReadOnly')) {\n return;\n }\n var dragColumns = draggingEvent.dragItem.columns;\n if (!dragColumns) {\n return;\n }\n dragColumns.forEach(function (column) {\n // we don't allow adding secondary columns\n if (!column.isPrimary()) {\n return;\n }\n if (column.isAnyFunctionActive()) {\n return;\n }\n if (column.isAllowValue()) {\n _this.columnsToAggregate.push(column);\n }\n else if (column.isAllowRowGroup()) {\n _this.columnsToGroup.push(column);\n }\n else if (column.isAllowPivot()) {\n _this.columnsToPivot.push(column);\n }\n });\n };\n BodyDropPivotTarget.prototype.getIconName = function () {\n var totalColumns = this.columnsToAggregate.length + this.columnsToGroup.length + this.columnsToPivot.length;\n if (totalColumns > 0) {\n return this.pinned ? DragAndDropService.ICON_PINNED : DragAndDropService.ICON_MOVE;\n }\n return null;\n };\n /** Callback for when drag leaves */\n BodyDropPivotTarget.prototype.onDragLeave = function (draggingEvent) {\n // if we are taking columns out of the center, then we remove them from the report\n this.clearColumnsList();\n };\n BodyDropPivotTarget.prototype.clearColumnsList = function () {\n this.columnsToAggregate.length = 0;\n this.columnsToGroup.length = 0;\n this.columnsToPivot.length = 0;\n };\n /** Callback for when dragging */\n BodyDropPivotTarget.prototype.onDragging = function (draggingEvent) {\n };\n /** Callback for when drag stops */\n BodyDropPivotTarget.prototype.onDragStop = function (draggingEvent) {\n if (this.columnsToAggregate.length > 0) {\n this.columnModel.addValueColumns(this.columnsToAggregate, \"toolPanelDragAndDrop\");\n }\n if (this.columnsToGroup.length > 0) {\n this.columnModel.addRowGroupColumns(this.columnsToGroup, \"toolPanelDragAndDrop\");\n }\n if (this.columnsToPivot.length > 0) {\n this.columnModel.addPivotColumns(this.columnsToPivot, \"toolPanelDragAndDrop\");\n }\n };\n __decorate$1I([\n Autowired('columnModel')\n ], BodyDropPivotTarget.prototype, \"columnModel\", void 0);\n __decorate$1I([\n Autowired('gridOptionsService')\n ], BodyDropPivotTarget.prototype, \"gridOptionsService\", void 0);\n return BodyDropPivotTarget;\n}());\n\nvar __read$m = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar ColumnMoveHelper = /** @class */ (function () {\n function ColumnMoveHelper() {\n }\n ColumnMoveHelper.attemptMoveColumns = function (params) {\n var isFromHeader = params.isFromHeader, hDirection = params.hDirection, xPosition = params.xPosition, fromEnter = params.fromEnter, fakeEvent = params.fakeEvent, pinned = params.pinned, gridOptionsService = params.gridOptionsService, columnModel = params.columnModel;\n var draggingLeft = hDirection === HorizontalDirection.Left;\n var draggingRight = hDirection === HorizontalDirection.Right;\n var allMovingColumns = params.allMovingColumns;\n if (isFromHeader) {\n // If the columns we're dragging are the only visible columns of their group, move the hidden ones too\n var newCols_1 = [];\n allMovingColumns.forEach(function (col) {\n var _a;\n var movingGroup = null;\n var parent = col.getParent();\n while (parent != null && parent.getDisplayedLeafColumns().length === 1) {\n movingGroup = parent;\n parent = parent.getParent();\n }\n if (movingGroup != null) {\n var isMarryChildren = !!((_a = movingGroup.getColGroupDef()) === null || _a === void 0 ? void 0 : _a.marryChildren);\n var columnsToMove = isMarryChildren\n // when marry children is true, we also have to move hidden\n // columns within the group, so grab them from the `providedColumnGroup`\n ? movingGroup.getProvidedColumnGroup().getLeafColumns()\n : movingGroup.getLeafColumns();\n columnsToMove.forEach(function (newCol) {\n if (!newCols_1.includes(newCol)) {\n newCols_1.push(newCol);\n }\n });\n }\n else if (!newCols_1.includes(col)) {\n newCols_1.push(col);\n }\n });\n allMovingColumns = newCols_1;\n }\n // it is important to sort the moving columns as they are in grid columns, as the list of moving columns\n // could themselves be part of 'married children' groups, which means we need to maintain the order within\n // the moving list.\n var allMovingColumnsOrdered = allMovingColumns.slice();\n columnModel.sortColumnsLikeGridColumns(allMovingColumnsOrdered);\n var validMoves = this.calculateValidMoves({\n movingCols: allMovingColumnsOrdered,\n draggingRight: draggingRight,\n xPosition: xPosition,\n pinned: pinned,\n gridOptionsService: gridOptionsService,\n columnModel: columnModel\n });\n // if cols are not adjacent, then this returns null. when moving, we constrain the direction of the move\n // (ie left or right) to the mouse direction. however\n var oldIndex = this.calculateOldIndex(allMovingColumnsOrdered, columnModel);\n if (validMoves.length === 0) {\n return;\n }\n var firstValidMove = validMoves[0];\n // the two check below stop an error when the user grabs a group my a middle column, then\n // it is possible the mouse pointer is to the right of a column while been dragged left.\n // so we need to make sure that the mouse pointer is actually left of the left most column\n // if moving left, and right of the right most column if moving right\n // we check 'fromEnter' below so we move the column to the new spot if the mouse is coming from\n // outside the grid, eg if the column is moving from side panel, mouse is moving left, then we should\n // place the column to the RHS even if the mouse is moving left and the column is already on\n // the LHS. otherwise we stick to the rule described above.\n var constrainDirection = oldIndex !== null && !fromEnter;\n // don't consider 'fromEnter' when dragging header cells, otherwise group can jump to opposite direction of drag\n if (isFromHeader) {\n constrainDirection = oldIndex !== null;\n }\n // if the event was faked by a change in column pin state, then the original location of the column\n // is not reliable for dictating where the column may now be placed.\n if (constrainDirection && !fakeEvent) {\n // only allow left drag if this column is moving left\n if (draggingLeft && firstValidMove >= oldIndex) {\n return;\n }\n // only allow right drag if this column is moving right\n if (draggingRight && firstValidMove <= oldIndex) {\n return;\n }\n }\n // From when we find a move that passes all the rules\n // Remember what that move would look like in terms of displayed cols\n // keep going with further moves until we find a different result in displayed output\n // In this way potentialMoves contains all potential moves over 'hidden' columns\n var displayedCols = columnModel.getAllDisplayedColumns();\n var potentialMoves = [];\n var targetOrder = null;\n for (var i = 0; i < validMoves.length; i++) {\n var move = validMoves[i];\n var order = columnModel.getProposedColumnOrder(allMovingColumnsOrdered, move);\n if (!columnModel.doesOrderPassRules(order)) {\n continue;\n }\n var displayedOrder = order.filter(function (col) { return displayedCols.includes(col); });\n if (targetOrder === null) {\n targetOrder = displayedOrder;\n }\n else if (!areEqual(displayedOrder, targetOrder)) {\n break; // Stop looking for potential moves if the displayed result changes from the target\n }\n var fragCount = this.groupFragCount(order);\n potentialMoves.push({ move: move, fragCount: fragCount });\n }\n if (potentialMoves.length === 0) {\n return;\n }\n // The best move is the move with least group fragmentation\n potentialMoves.sort(function (a, b) { return a.fragCount - b.fragCount; });\n return this.moveColumns(allMovingColumns, potentialMoves[0].move, 'uiColumnMoved', false, columnModel);\n };\n ColumnMoveHelper.moveColumns = function (columns, toIndex, source, finished, columnModel) {\n columnModel.moveColumns(columns, toIndex, source, finished);\n return finished ? null : { columns: columns, toIndex: toIndex };\n };\n // returns the index of the first column in the list ONLY if the cols are all beside\n // each other. if the cols are not beside each other, then returns null\n ColumnMoveHelper.calculateOldIndex = function (movingCols, columnModel) {\n var gridCols = columnModel.getAllGridColumns();\n var indexes = sortNumerically(movingCols.map(function (col) { return gridCols.indexOf(col); }));\n var firstIndex = indexes[0];\n var lastIndex = last(indexes);\n var spread = lastIndex - firstIndex;\n var gapsExist = spread !== indexes.length - 1;\n return gapsExist ? null : firstIndex;\n };\n // A measure of how fragmented in terms of groups an order of columns is\n ColumnMoveHelper.groupFragCount = function (columns) {\n function parents(col) {\n var result = [];\n var parent = col.getOriginalParent();\n while (parent != null) {\n result.push(parent);\n parent = parent.getOriginalParent();\n }\n return result;\n }\n var count = 0;\n var _loop_1 = function (i) {\n var _a;\n var a = parents(columns[i]);\n var b = parents(columns[i + 1]);\n // iterate over the longest one\n _a = __read$m(a.length > b.length ? [a, b] : [b, a], 2), a = _a[0], b = _a[1];\n a.forEach(function (parent) {\n if (b.indexOf(parent) === -1) {\n count++; // More fragmented if other column doesn't share the parent\n }\n });\n };\n for (var i = 0; i < columns.length - 1; i++) {\n _loop_1(i);\n }\n return count;\n };\n ColumnMoveHelper.calculateValidMoves = function (params) {\n var movingCols = params.movingCols, draggingRight = params.draggingRight, xPosition = params.xPosition, pinned = params.pinned, gridOptionsService = params.gridOptionsService, columnModel = params.columnModel;\n var isMoveBlocked = gridOptionsService.get('suppressMovableColumns') || movingCols.some(function (col) { return col.getColDef().suppressMovable; });\n if (isMoveBlocked) {\n return [];\n }\n // this is the list of cols on the screen, so it's these we use when comparing the x mouse position\n var allDisplayedCols = columnModel.getDisplayedColumns(pinned);\n // but this list is the list of all cols, when we move a col it's the index within this list that gets used,\n // so the result we return has to be and index location for this list\n var allGridCols = columnModel.getAllGridColumns();\n var movingDisplayedCols = allDisplayedCols.filter(function (col) { return includes(movingCols, col); });\n var otherDisplayedCols = allDisplayedCols.filter(function (col) { return !includes(movingCols, col); });\n var otherGridCols = allGridCols.filter(function (col) { return !includes(movingCols, col); });\n // work out how many DISPLAYED columns fit before the 'x' position. this gives us the displayIndex.\n // for example, if cols are a,b,c,d and we find a,b fit before 'x', then we want to place the moving\n // col between b and c (so that it is under the mouse position).\n var displayIndex = 0;\n var availableWidth = xPosition;\n // if we are dragging right, then the columns will be to the left of the mouse, so we also want to\n // include the width of the moving columns\n if (draggingRight) {\n var widthOfMovingDisplayedCols_1 = 0;\n movingDisplayedCols.forEach(function (col) { return widthOfMovingDisplayedCols_1 += col.getActualWidth(); });\n availableWidth -= widthOfMovingDisplayedCols_1;\n }\n if (availableWidth > 0) {\n // now count how many of the displayed columns will fit to the left\n for (var i = 0; i < otherDisplayedCols.length; i++) {\n var col = otherDisplayedCols[i];\n availableWidth -= col.getActualWidth();\n if (availableWidth < 0) {\n break;\n }\n displayIndex++;\n }\n // trial and error, if going right, we adjust by one, i didn't manage to quantify why, but it works\n if (draggingRight) {\n displayIndex++;\n }\n }\n // the display index is with respect to all the showing columns, however when we move, it's with\n // respect to all grid columns, so we need to translate from display index to grid index\n var firstValidMove;\n if (displayIndex > 0) {\n var leftColumn = otherDisplayedCols[displayIndex - 1];\n firstValidMove = otherGridCols.indexOf(leftColumn) + 1;\n }\n else {\n firstValidMove = otherGridCols.indexOf(otherDisplayedCols[0]);\n if (firstValidMove === -1) {\n firstValidMove = 0;\n }\n }\n var validMoves = [firstValidMove];\n var numberComparator = function (a, b) { return a - b; };\n // add in other valid moves due to hidden columns and married children. for example, a particular\n // move might break a group that has married children (so move isn't valid), however there could\n // be hidden columns (not displayed) that we could jump over to make the move valid. because\n // they are hidden, user doesn't see any different, however it allows moves that would otherwise\n // not work. for example imagine a group with 9 columns and all columns are hidden except the\n // middle one (so 4 hidden to left, 4 hidden to right), then when moving 'firstValidMove' will\n // be relative to the not-shown column, however we need to consider the move jumping over all the\n // hidden children. if we didn't do this, then if the group just described was at the end (RHS) of the\n // grid, there would be no way to put a column after it (as the grid would only consider beside the\n // visible column, which would fail valid move rules).\n if (draggingRight) {\n // if dragging right, then we add all the additional moves to the right. so in other words\n // if the next move is not valid, find the next move to the right that is valid.\n var pointer = firstValidMove + 1;\n var lastIndex = allGridCols.length - 1;\n while (pointer <= lastIndex) {\n validMoves.push(pointer);\n pointer++;\n }\n // adding columns here means the order is now messed up\n validMoves.sort(numberComparator);\n }\n else {\n // if dragging left we do the reverse of dragging right, we add in all the valid moves to the\n // left. however we also have to consider moves to the right for all hidden columns first.\n // (this logic is hard to reason with, it was worked out with trial and error,\n // more observation rather than science).\n // add moves to the right\n var pointer = firstValidMove;\n var lastIndex = allGridCols.length - 1;\n var displacedCol = allGridCols[pointer];\n // takes into account visible=false and group=closed, ie it is not displayed\n while (pointer <= lastIndex && allDisplayedCols.indexOf(displacedCol) < 0) {\n pointer++;\n validMoves.push(pointer);\n displacedCol = allGridCols[pointer];\n }\n // add moves to the left\n pointer = firstValidMove - 1;\n var firstDisplayIndex = 0;\n while (pointer >= firstDisplayIndex) {\n validMoves.push(pointer);\n pointer--;\n }\n // adding columns here means the order is now messed up\n validMoves.sort(numberComparator).reverse();\n }\n return validMoves;\n };\n ColumnMoveHelper.normaliseX = function (x, pinned, fromKeyboard, gridOptionsService, ctrlsService) {\n var eViewport = ctrlsService.getHeaderRowContainerCtrl(pinned).getViewport();\n if (fromKeyboard) {\n x -= eViewport.getBoundingClientRect().left;\n }\n // flip the coordinate if doing RTL\n if (gridOptionsService.get('enableRtl')) {\n var clientWidth = eViewport.clientWidth;\n x = clientWidth - x;\n }\n // adjust for scroll only if centre container (the pinned containers don't scroll)\n if (pinned == null) {\n x += ctrlsService.getCenterRowContainerCtrl().getCenterViewportScrollLeft();\n }\n return x;\n };\n return ColumnMoveHelper;\n}());\n\nvar __decorate$1H = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar MoveColumnFeature = /** @class */ (function () {\n function MoveColumnFeature(pinned, eContainer) {\n this.needToMoveLeft = false;\n this.needToMoveRight = false;\n this.lastMovedInfo = null;\n this.pinned = pinned;\n this.eContainer = eContainer;\n this.centerContainer = !exists(pinned);\n }\n MoveColumnFeature.prototype.init = function () {\n var _this = this;\n this.ctrlsService.whenReady(function () {\n _this.gridBodyCon = _this.ctrlsService.getGridBodyCtrl();\n });\n };\n MoveColumnFeature.prototype.getIconName = function () {\n return this.pinned ? DragAndDropService.ICON_PINNED : DragAndDropService.ICON_MOVE;\n };\n MoveColumnFeature.prototype.onDragEnter = function (draggingEvent) {\n // we do dummy drag, so make sure column appears in the right location when first placed\n var columns = draggingEvent.dragItem.columns;\n var dragCameFromToolPanel = draggingEvent.dragSource.type === DragSourceType.ToolPanel;\n if (dragCameFromToolPanel) {\n // the if statement doesn't work if drag leaves grid, then enters again\n this.setColumnsVisible(columns, true, \"uiColumnDragged\");\n }\n else {\n // restore previous state of visible columns upon re-entering. this means if the user drags\n // a group out, and then drags the group back in, only columns that were originally visible\n // will be visible again. otherwise a group with three columns (but only two visible) could\n // be dragged out, then when it's dragged in again, all three are visible. this stops that.\n var visibleState_1 = draggingEvent.dragItem.visibleState;\n var visibleColumns = (columns || []).filter(function (column) { return visibleState_1[column.getId()]; });\n this.setColumnsVisible(visibleColumns, true, \"uiColumnDragged\");\n }\n this.setColumnsPinned(columns, this.pinned, \"uiColumnDragged\");\n this.onDragging(draggingEvent, true, true);\n };\n MoveColumnFeature.prototype.onDragLeave = function () {\n this.ensureIntervalCleared();\n this.lastMovedInfo = null;\n };\n MoveColumnFeature.prototype.setColumnsVisible = function (columns, visible, source) {\n if (columns) {\n var allowedCols = columns.filter(function (c) { return !c.getColDef().lockVisible; });\n this.columnModel.setColumnsVisible(allowedCols, visible, source);\n }\n };\n MoveColumnFeature.prototype.setColumnsPinned = function (columns, pinned, source) {\n if (columns) {\n var allowedCols = columns.filter(function (c) { return !c.getColDef().lockPinned; });\n this.columnModel.setColumnsPinned(allowedCols, pinned, source);\n }\n };\n MoveColumnFeature.prototype.onDragStop = function () {\n this.onDragging(this.lastDraggingEvent, false, true, true);\n this.ensureIntervalCleared();\n this.lastMovedInfo = null;\n };\n MoveColumnFeature.prototype.checkCenterForScrolling = function (xAdjustedForScroll) {\n if (this.centerContainer) {\n // scroll if the mouse has gone outside the grid (or just outside the scrollable part if pinning)\n // putting in 50 buffer, so even if user gets to edge of grid, a scroll will happen\n var firstVisiblePixel = this.ctrlsService.getCenterRowContainerCtrl().getCenterViewportScrollLeft();\n var lastVisiblePixel = firstVisiblePixel + this.ctrlsService.getCenterRowContainerCtrl().getCenterWidth();\n if (this.gridOptionsService.get('enableRtl')) {\n this.needToMoveRight = xAdjustedForScroll < (firstVisiblePixel + 50);\n this.needToMoveLeft = xAdjustedForScroll > (lastVisiblePixel - 50);\n }\n else {\n this.needToMoveLeft = xAdjustedForScroll < (firstVisiblePixel + 50);\n this.needToMoveRight = xAdjustedForScroll > (lastVisiblePixel - 50);\n }\n if (this.needToMoveLeft || this.needToMoveRight) {\n this.ensureIntervalStarted();\n }\n else {\n this.ensureIntervalCleared();\n }\n }\n };\n MoveColumnFeature.prototype.onDragging = function (draggingEvent, fromEnter, fakeEvent, finished) {\n var _this = this;\n var _a;\n if (draggingEvent === void 0) { draggingEvent = this.lastDraggingEvent; }\n if (fromEnter === void 0) { fromEnter = false; }\n if (fakeEvent === void 0) { fakeEvent = false; }\n if (finished === void 0) { finished = false; }\n if (finished) {\n if (this.lastMovedInfo) {\n var _b = this.lastMovedInfo, columns = _b.columns, toIndex = _b.toIndex;\n ColumnMoveHelper.moveColumns(columns, toIndex, 'uiColumnMoved', true, this.columnModel);\n }\n return;\n }\n this.lastDraggingEvent = draggingEvent;\n // if moving up or down (ie not left or right) then do nothing\n if (missing(draggingEvent.hDirection)) {\n return;\n }\n var mouseX = ColumnMoveHelper.normaliseX(draggingEvent.x, this.pinned, false, this.gridOptionsService, this.ctrlsService);\n // if the user is dragging into the panel, ie coming from the side panel into the main grid,\n // we don't want to scroll the grid this time, it would appear like the table is jumping\n // each time a column is dragged in.\n if (!fromEnter) {\n this.checkCenterForScrolling(mouseX);\n }\n var hDirection = this.normaliseDirection(draggingEvent.hDirection);\n var dragSourceType = draggingEvent.dragSource.type;\n var allMovingColumns = ((_a = draggingEvent.dragSource.getDragItem().columns) === null || _a === void 0 ? void 0 : _a.filter(function (col) {\n if (col.getColDef().lockPinned) {\n // if locked return true only if both col and container are same pin type.\n // double equals (==) here on purpose so that null==undefined is true (for not pinned options)\n return col.getPinned() == _this.pinned;\n }\n // if not pin locked, then always allowed to be in this container\n return true;\n })) || [];\n var lastMovedInfo = ColumnMoveHelper.attemptMoveColumns({\n allMovingColumns: allMovingColumns,\n isFromHeader: dragSourceType === DragSourceType.HeaderCell,\n hDirection: hDirection,\n xPosition: mouseX,\n pinned: this.pinned,\n fromEnter: fromEnter,\n fakeEvent: fakeEvent,\n gridOptionsService: this.gridOptionsService,\n columnModel: this.columnModel\n });\n if (lastMovedInfo) {\n this.lastMovedInfo = lastMovedInfo;\n }\n };\n MoveColumnFeature.prototype.normaliseDirection = function (hDirection) {\n if (this.gridOptionsService.get('enableRtl')) {\n switch (hDirection) {\n case HorizontalDirection.Left: return HorizontalDirection.Right;\n case HorizontalDirection.Right: return HorizontalDirection.Left;\n default: console.error(\"AG Grid: Unknown direction \".concat(hDirection));\n }\n }\n else {\n return hDirection;\n }\n };\n MoveColumnFeature.prototype.ensureIntervalStarted = function () {\n if (!this.movingIntervalId) {\n this.intervalCount = 0;\n this.failedMoveAttempts = 0;\n this.movingIntervalId = window.setInterval(this.moveInterval.bind(this), 100);\n if (this.needToMoveLeft) {\n this.dragAndDropService.setGhostIcon(DragAndDropService.ICON_LEFT, true);\n }\n else {\n this.dragAndDropService.setGhostIcon(DragAndDropService.ICON_RIGHT, true);\n }\n }\n };\n MoveColumnFeature.prototype.ensureIntervalCleared = function () {\n if (this.movingIntervalId) {\n window.clearInterval(this.movingIntervalId);\n this.movingIntervalId = null;\n this.dragAndDropService.setGhostIcon(DragAndDropService.ICON_MOVE);\n }\n };\n MoveColumnFeature.prototype.moveInterval = function () {\n // the amounts we move get bigger at each interval, so the speed accelerates, starting a bit slow\n // and getting faster. this is to give smoother user experience. we max at 100px to limit the speed.\n var pixelsToMove;\n this.intervalCount++;\n pixelsToMove = 10 + (this.intervalCount * 5);\n if (pixelsToMove > 100) {\n pixelsToMove = 100;\n }\n var pixelsMoved = null;\n var scrollFeature = this.gridBodyCon.getScrollFeature();\n if (this.needToMoveLeft) {\n pixelsMoved = scrollFeature.scrollHorizontally(-pixelsToMove);\n }\n else if (this.needToMoveRight) {\n pixelsMoved = scrollFeature.scrollHorizontally(pixelsToMove);\n }\n if (pixelsMoved !== 0) {\n this.onDragging(this.lastDraggingEvent);\n this.failedMoveAttempts = 0;\n }\n else {\n // we count the failed move attempts. if we fail to move 7 times, then we pin the column.\n // this is how we achieve pining by dragging the column to the edge of the grid.\n this.failedMoveAttempts++;\n var columns = this.lastDraggingEvent.dragItem.columns;\n var columnsThatCanPin = columns.filter(function (c) { return !c.getColDef().lockPinned; });\n if (columnsThatCanPin.length > 0) {\n this.dragAndDropService.setGhostIcon(DragAndDropService.ICON_PINNED);\n if (this.failedMoveAttempts > 7) {\n var pinType = this.needToMoveLeft ? 'left' : 'right';\n this.setColumnsPinned(columnsThatCanPin, pinType, \"uiColumnDragged\");\n this.dragAndDropService.nudge();\n }\n }\n }\n };\n __decorate$1H([\n Autowired('columnModel')\n ], MoveColumnFeature.prototype, \"columnModel\", void 0);\n __decorate$1H([\n Autowired('dragAndDropService')\n ], MoveColumnFeature.prototype, \"dragAndDropService\", void 0);\n __decorate$1H([\n Autowired('gridOptionsService')\n ], MoveColumnFeature.prototype, \"gridOptionsService\", void 0);\n __decorate$1H([\n Autowired('ctrlsService')\n ], MoveColumnFeature.prototype, \"ctrlsService\", void 0);\n __decorate$1H([\n PostConstruct\n ], MoveColumnFeature.prototype, \"init\", null);\n return MoveColumnFeature;\n}());\n\nvar __extends$1O = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1G = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar BodyDropTarget = /** @class */ (function (_super) {\n __extends$1O(BodyDropTarget, _super);\n function BodyDropTarget(pinned, eContainer) {\n var _this = _super.call(this) || this;\n _this.pinned = pinned;\n _this.eContainer = eContainer;\n return _this;\n }\n BodyDropTarget.prototype.postConstruct = function () {\n var _this = this;\n this.ctrlsService.whenReady(function (p) {\n switch (_this.pinned) {\n case 'left':\n _this.eSecondaryContainers = [\n [p.gridBodyCtrl.getBodyViewportElement(), p.leftRowContainerCtrl.getContainerElement()],\n [p.bottomLeftRowContainerCtrl.getContainerElement()],\n [p.topLeftRowContainerCtrl.getContainerElement()]\n ];\n break;\n case 'right':\n _this.eSecondaryContainers = [\n [p.gridBodyCtrl.getBodyViewportElement(), p.rightRowContainerCtrl.getContainerElement()],\n [p.bottomRightRowContainerCtrl.getContainerElement()],\n [p.topRightRowContainerCtrl.getContainerElement()]\n ];\n break;\n default:\n _this.eSecondaryContainers = [\n [p.gridBodyCtrl.getBodyViewportElement(), p.centerRowContainerCtrl.getViewportElement()],\n [p.bottomCenterRowContainerCtrl.getViewportElement()],\n [p.topCenterRowContainerCtrl.getViewportElement()]\n ];\n break;\n }\n });\n };\n BodyDropTarget.prototype.isInterestedIn = function (type) {\n return type === DragSourceType.HeaderCell ||\n (type === DragSourceType.ToolPanel && this.gridOptionsService.get('allowDragFromColumnsToolPanel'));\n };\n BodyDropTarget.prototype.getSecondaryContainers = function () {\n return this.eSecondaryContainers;\n };\n BodyDropTarget.prototype.getContainer = function () {\n return this.eContainer;\n };\n BodyDropTarget.prototype.init = function () {\n this.moveColumnFeature = this.createManagedBean(new MoveColumnFeature(this.pinned, this.eContainer));\n this.bodyDropPivotTarget = this.createManagedBean(new BodyDropPivotTarget(this.pinned));\n this.dragAndDropService.addDropTarget(this);\n };\n BodyDropTarget.prototype.getIconName = function () {\n return this.currentDropListener.getIconName();\n };\n // we want to use the bodyPivotTarget if the user is dragging columns in from the toolPanel\n // and we are in pivot mode, as it has to logic to set pivot/value/group on the columns when\n // dropped into the grid's body.\n BodyDropTarget.prototype.isDropColumnInPivotMode = function (draggingEvent) {\n // in pivot mode, then if moving a column (ie didn't come from toolpanel) then it's\n // a standard column move, however if it came from the toolpanel, then we are introducing\n // dimensions or values to the grid\n return this.columnModel.isPivotMode() && draggingEvent.dragSource.type === DragSourceType.ToolPanel;\n };\n BodyDropTarget.prototype.onDragEnter = function (draggingEvent) {\n // we pick the drop listener depending on whether we are in pivot mode are not. if we are\n // in pivot mode, then dropping cols changes the row group, pivot, value stats. otherwise\n // we change visibility state and position.\n this.currentDropListener = this.isDropColumnInPivotMode(draggingEvent) ? this.bodyDropPivotTarget : this.moveColumnFeature;\n this.currentDropListener.onDragEnter(draggingEvent);\n };\n BodyDropTarget.prototype.onDragLeave = function (params) {\n this.currentDropListener.onDragLeave(params);\n };\n BodyDropTarget.prototype.onDragging = function (params) {\n this.currentDropListener.onDragging(params);\n };\n BodyDropTarget.prototype.onDragStop = function (params) {\n this.currentDropListener.onDragStop(params);\n };\n __decorate$1G([\n Autowired('dragAndDropService')\n ], BodyDropTarget.prototype, \"dragAndDropService\", void 0);\n __decorate$1G([\n Autowired('columnModel')\n ], BodyDropTarget.prototype, \"columnModel\", void 0);\n __decorate$1G([\n Autowired('ctrlsService')\n ], BodyDropTarget.prototype, \"ctrlsService\", void 0);\n __decorate$1G([\n PostConstruct\n ], BodyDropTarget.prototype, \"postConstruct\", null);\n __decorate$1G([\n PostConstruct\n ], BodyDropTarget.prototype, \"init\", null);\n return BodyDropTarget;\n}(BeanStub));\n\nvar __extends$1N = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1F = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar HeaderCellComp = /** @class */ (function (_super) {\n __extends$1N(HeaderCellComp, _super);\n function HeaderCellComp(ctrl) {\n var _this = _super.call(this, HeaderCellComp.TEMPLATE, ctrl) || this;\n _this.headerCompVersion = 0;\n _this.column = ctrl.getColumnGroupChild();\n _this.pinned = ctrl.getPinned();\n return _this;\n }\n HeaderCellComp.prototype.postConstruct = function () {\n var _this = this;\n var eGui = this.getGui();\n var setAttribute = function (name, value) {\n if (value != null && value != '') {\n eGui.setAttribute(name, value);\n }\n else {\n eGui.removeAttribute(name);\n }\n };\n setAttribute('col-id', this.column.getColId());\n var compProxy = {\n setWidth: function (width) { return eGui.style.width = width; },\n addOrRemoveCssClass: function (cssClassName, on) { return _this.addOrRemoveCssClass(cssClassName, on); },\n setAriaSort: function (sort) { return sort ? setAriaSort(eGui, sort) : removeAriaSort(eGui); },\n setUserCompDetails: function (compDetails) { return _this.setUserCompDetails(compDetails); },\n getUserCompInstance: function () { return _this.headerComp; }\n };\n this.ctrl.setComp(compProxy, this.getGui(), this.eResize, this.eHeaderCompWrapper);\n var selectAllGui = this.ctrl.getSelectAllGui();\n this.eResize.insertAdjacentElement('afterend', selectAllGui);\n };\n HeaderCellComp.prototype.destroyHeaderComp = function () {\n if (this.headerComp) {\n this.eHeaderCompWrapper.removeChild(this.headerCompGui);\n this.headerComp = this.destroyBean(this.headerComp);\n this.headerCompGui = undefined;\n }\n };\n HeaderCellComp.prototype.setUserCompDetails = function (compDetails) {\n var _this = this;\n this.headerCompVersion++;\n var versionCopy = this.headerCompVersion;\n compDetails.newAgStackInstance().then(function (comp) { return _this.afterCompCreated(versionCopy, comp); });\n };\n HeaderCellComp.prototype.afterCompCreated = function (version, headerComp) {\n if (version != this.headerCompVersion || !this.isAlive()) {\n this.destroyBean(headerComp);\n return;\n }\n this.destroyHeaderComp();\n this.headerComp = headerComp;\n this.headerCompGui = headerComp.getGui();\n this.eHeaderCompWrapper.appendChild(this.headerCompGui);\n this.ctrl.setDragSource(this.getGui());\n };\n HeaderCellComp.TEMPLATE = \"
\\n
\\n
\\n
\";\n __decorate$1F([\n RefSelector('eResize')\n ], HeaderCellComp.prototype, \"eResize\", void 0);\n __decorate$1F([\n RefSelector('eHeaderCompWrapper')\n ], HeaderCellComp.prototype, \"eHeaderCompWrapper\", void 0);\n __decorate$1F([\n PostConstruct\n ], HeaderCellComp.prototype, \"postConstruct\", null);\n __decorate$1F([\n PreDestroy\n ], HeaderCellComp.prototype, \"destroyHeaderComp\", null);\n return HeaderCellComp;\n}(AbstractHeaderCellComp));\n\nvar __extends$1M = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1E = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar HeaderGroupCellComp = /** @class */ (function (_super) {\n __extends$1M(HeaderGroupCellComp, _super);\n function HeaderGroupCellComp(ctrl) {\n return _super.call(this, HeaderGroupCellComp.TEMPLATE, ctrl) || this;\n }\n HeaderGroupCellComp.prototype.postConstruct = function () {\n var _this = this;\n var eGui = this.getGui();\n var setAttribute = function (key, value) {\n return value != undefined ? eGui.setAttribute(key, value) : eGui.removeAttribute(key);\n };\n eGui.setAttribute(\"col-id\", this.ctrl.getColId());\n var compProxy = {\n addOrRemoveCssClass: function (cssClassName, on) { return _this.addOrRemoveCssClass(cssClassName, on); },\n setResizableDisplayed: function (displayed) { return setDisplayed(_this.eResize, displayed); },\n setWidth: function (width) { return eGui.style.width = width; },\n setAriaExpanded: function (expanded) { return setAttribute('aria-expanded', expanded); },\n setUserCompDetails: function (details) { return _this.setUserCompDetails(details); },\n getUserCompInstance: function () { return _this.headerGroupComp; },\n };\n this.ctrl.setComp(compProxy, eGui, this.eResize);\n };\n HeaderGroupCellComp.prototype.setUserCompDetails = function (details) {\n var _this = this;\n details.newAgStackInstance().then(function (comp) { return _this.afterHeaderCompCreated(comp); });\n };\n HeaderGroupCellComp.prototype.afterHeaderCompCreated = function (headerGroupComp) {\n var _this = this;\n var destroyFunc = function () { return _this.destroyBean(headerGroupComp); };\n if (!this.isAlive()) {\n destroyFunc();\n return;\n }\n var eGui = this.getGui();\n var eHeaderGroupGui = headerGroupComp.getGui();\n eGui.appendChild(eHeaderGroupGui);\n this.addDestroyFunc(destroyFunc);\n this.headerGroupComp = headerGroupComp;\n this.ctrl.setDragSource(eGui);\n };\n HeaderGroupCellComp.TEMPLATE = \"
\\n
\\n
\";\n __decorate$1E([\n RefSelector('eResize')\n ], HeaderGroupCellComp.prototype, \"eResize\", void 0);\n __decorate$1E([\n PostConstruct\n ], HeaderGroupCellComp.prototype, \"postConstruct\", null);\n return HeaderGroupCellComp;\n}(AbstractHeaderCellComp));\n\nvar __extends$1L = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1D = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar HeaderRowType;\n(function (HeaderRowType) {\n HeaderRowType[\"COLUMN_GROUP\"] = \"group\";\n HeaderRowType[\"COLUMN\"] = \"column\";\n HeaderRowType[\"FLOATING_FILTER\"] = \"filter\";\n})(HeaderRowType || (HeaderRowType = {}));\nvar HeaderRowComp = /** @class */ (function (_super) {\n __extends$1L(HeaderRowComp, _super);\n function HeaderRowComp(ctrl) {\n var _this = _super.call(this) || this;\n _this.headerComps = {};\n _this.ctrl = ctrl;\n _this.setTemplate(/* html */ \"
\"));\n return _this;\n }\n //noinspection JSUnusedLocalSymbols\n HeaderRowComp.prototype.init = function () {\n var _this = this;\n setAriaRowIndex(this.getGui(), this.ctrl.getAriaRowIndex());\n var compProxy = {\n setHeight: function (height) { return _this.getGui().style.height = height; },\n setTop: function (top) { return _this.getGui().style.top = top; },\n setHeaderCtrls: function (ctrls, forceOrder) { return _this.setHeaderCtrls(ctrls, forceOrder); },\n setWidth: function (width) { return _this.getGui().style.width = width; },\n };\n this.ctrl.setComp(compProxy);\n };\n HeaderRowComp.prototype.destroyHeaderCtrls = function () {\n this.setHeaderCtrls([], false);\n };\n HeaderRowComp.prototype.setHeaderCtrls = function (ctrls, forceOrder) {\n var _this = this;\n if (!this.isAlive()) {\n return;\n }\n var oldComps = this.headerComps;\n this.headerComps = {};\n ctrls.forEach(function (ctrl) {\n var id = ctrl.getInstanceId();\n var comp = oldComps[id];\n delete oldComps[id];\n if (comp == null) {\n comp = _this.createHeaderComp(ctrl);\n _this.getGui().appendChild(comp.getGui());\n }\n _this.headerComps[id] = comp;\n });\n iterateObject(oldComps, function (id, comp) {\n _this.getGui().removeChild(comp.getGui());\n _this.destroyBean(comp);\n });\n if (forceOrder) {\n var comps = getAllValuesInObject(this.headerComps);\n // ordering the columns by left position orders them in the order they appear on the screen\n comps.sort(function (a, b) {\n var leftA = a.getCtrl().getColumnGroupChild().getLeft();\n var leftB = b.getCtrl().getColumnGroupChild().getLeft();\n return leftA - leftB;\n });\n var elementsInOrder = comps.map(function (c) { return c.getGui(); });\n setDomChildOrder(this.getGui(), elementsInOrder);\n }\n };\n HeaderRowComp.prototype.createHeaderComp = function (headerCtrl) {\n var result;\n switch (this.ctrl.getType()) {\n case HeaderRowType.COLUMN_GROUP:\n result = new HeaderGroupCellComp(headerCtrl);\n break;\n case HeaderRowType.FLOATING_FILTER:\n result = new HeaderFilterCellComp(headerCtrl);\n break;\n default:\n result = new HeaderCellComp(headerCtrl);\n break;\n }\n this.createBean(result);\n result.setParentComponent(this);\n return result;\n };\n __decorate$1D([\n PostConstruct\n ], HeaderRowComp.prototype, \"init\", null);\n __decorate$1D([\n PreDestroy\n ], HeaderRowComp.prototype, \"destroyHeaderCtrls\", null);\n return HeaderRowComp;\n}(Component));\n\nvar __extends$1K = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1C = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar instanceIdSequence$1 = 0;\nvar AbstractHeaderCellCtrl = /** @class */ (function (_super) {\n __extends$1K(AbstractHeaderCellCtrl, _super);\n function AbstractHeaderCellCtrl(columnGroupChild, beans, parentRowCtrl) {\n var _this = _super.call(this) || this;\n _this.resizeToggleTimeout = 0;\n _this.resizeMultiplier = 1;\n _this.resizeFeature = null;\n _this.lastFocusEvent = null;\n _this.dragSource = null;\n _this.columnGroupChild = columnGroupChild;\n _this.parentRowCtrl = parentRowCtrl;\n _this.beans = beans;\n // unique id to this instance, including the column ID to help with debugging in React as it's used in 'key'\n _this.instanceId = columnGroupChild.getUniqueId() + '-' + instanceIdSequence$1++;\n return _this;\n }\n AbstractHeaderCellCtrl.prototype.postConstruct = function () {\n var _this = this;\n this.addManagedPropertyListeners(['suppressHeaderFocus'], function () { return _this.refreshTabIndex(); });\n };\n AbstractHeaderCellCtrl.prototype.shouldStopEventPropagation = function (e) {\n var _a = this.focusService.getFocusedHeader(), headerRowIndex = _a.headerRowIndex, column = _a.column;\n return isUserSuppressingHeaderKeyboardEvent(this.gridOptionsService, e, headerRowIndex, column);\n };\n AbstractHeaderCellCtrl.prototype.getWrapperHasFocus = function () {\n var eDocument = this.gridOptionsService.getDocument();\n var activeEl = eDocument.activeElement;\n return activeEl === this.eGui;\n };\n AbstractHeaderCellCtrl.prototype.setGui = function (eGui) {\n this.eGui = eGui;\n this.addDomData();\n this.addManagedListener(this.beans.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));\n this.onDisplayedColumnsChanged();\n this.refreshTabIndex();\n };\n AbstractHeaderCellCtrl.prototype.onDisplayedColumnsChanged = function () {\n if (!this.comp || !this.column) {\n return;\n }\n this.refreshFirstAndLastStyles();\n this.refreshAriaColIndex();\n };\n AbstractHeaderCellCtrl.prototype.refreshFirstAndLastStyles = function () {\n var _a = this, comp = _a.comp, column = _a.column, beans = _a.beans;\n CssClassApplier.refreshFirstAndLastStyles(comp, column, beans.columnModel);\n };\n AbstractHeaderCellCtrl.prototype.refreshAriaColIndex = function () {\n var _a = this, beans = _a.beans, column = _a.column;\n var colIdx = beans.columnModel.getAriaColumnIndex(column);\n setAriaColIndex(this.eGui, colIdx); // for react, we don't use JSX, as it slowed down column moving\n };\n AbstractHeaderCellCtrl.prototype.addResizeAndMoveKeyboardListeners = function () {\n if (!this.resizeFeature) {\n return;\n }\n this.addManagedListener(this.eGui, 'keydown', this.onGuiKeyDown.bind(this));\n this.addManagedListener(this.eGui, 'keyup', this.onGuiKeyUp.bind(this));\n };\n AbstractHeaderCellCtrl.prototype.refreshTabIndex = function () {\n var suppressHeaderFocus = this.gridOptionsService.get('suppressHeaderFocus');\n if (suppressHeaderFocus) {\n this.eGui.removeAttribute('tabindex');\n }\n else {\n this.eGui.setAttribute('tabindex', '-1');\n }\n };\n AbstractHeaderCellCtrl.prototype.onGuiKeyDown = function (e) {\n var _a;\n var eDocument = this.gridOptionsService.getDocument();\n var activeEl = eDocument.activeElement;\n var isLeftOrRight = e.key === KeyCode.LEFT || e.key === KeyCode.RIGHT;\n if (this.isResizing) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n if (\n // if elements within the header are focused, we don't process the event\n activeEl !== this.eGui ||\n // if shiftKey and altKey are not pressed, it's cell navigation so we don't process the event\n (!e.shiftKey && !e.altKey)) {\n return;\n }\n if (this.isResizing || isLeftOrRight) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n if (!isLeftOrRight) {\n return;\n }\n var isLeft = (e.key === KeyCode.LEFT) !== this.gridOptionsService.get('enableRtl');\n var direction = HorizontalDirection[isLeft ? 'Left' : 'Right'];\n if (e.altKey) {\n this.isResizing = true;\n this.resizeMultiplier += 1;\n var diff = this.getViewportAdjustedResizeDiff(e);\n this.resizeHeader(diff, e.shiftKey);\n (_a = this.resizeFeature) === null || _a === void 0 ? void 0 : _a.toggleColumnResizing(true);\n }\n else {\n this.moveHeader(direction);\n }\n };\n AbstractHeaderCellCtrl.prototype.getViewportAdjustedResizeDiff = function (e) {\n var diff = this.getResizeDiff(e);\n var pinned = this.column.getPinned();\n if (pinned) {\n var leftWidth = this.pinnedWidthService.getPinnedLeftWidth();\n var rightWidth = this.pinnedWidthService.getPinnedRightWidth();\n var bodyWidth = getInnerWidth(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement()) - 50;\n if (leftWidth + rightWidth + diff > bodyWidth) {\n if (bodyWidth > leftWidth + rightWidth) {\n // allow body width to ignore resize multiplier and fill space for last tick\n diff = bodyWidth - leftWidth - rightWidth;\n }\n else {\n return 0;\n }\n }\n }\n return diff;\n };\n AbstractHeaderCellCtrl.prototype.getResizeDiff = function (e) {\n var isLeft = (e.key === KeyCode.LEFT) !== this.gridOptionsService.get('enableRtl');\n var pinned = this.column.getPinned();\n var isRtl = this.gridOptionsService.get('enableRtl');\n if (pinned) {\n if (isRtl !== (pinned === 'right')) {\n isLeft = !isLeft;\n }\n }\n return (isLeft ? -1 : 1) * this.resizeMultiplier;\n };\n AbstractHeaderCellCtrl.prototype.onGuiKeyUp = function () {\n var _this = this;\n if (!this.isResizing) {\n return;\n }\n if (this.resizeToggleTimeout) {\n window.clearTimeout(this.resizeToggleTimeout);\n this.resizeToggleTimeout = 0;\n }\n this.isResizing = false;\n this.resizeMultiplier = 1;\n this.resizeToggleTimeout = setTimeout(function () {\n var _a;\n (_a = _this.resizeFeature) === null || _a === void 0 ? void 0 : _a.toggleColumnResizing(false);\n }, 150);\n };\n AbstractHeaderCellCtrl.prototype.handleKeyDown = function (e) {\n var wrapperHasFocus = this.getWrapperHasFocus();\n switch (e.key) {\n case KeyCode.PAGE_DOWN:\n case KeyCode.PAGE_UP:\n case KeyCode.PAGE_HOME:\n case KeyCode.PAGE_END:\n if (wrapperHasFocus) {\n e.preventDefault();\n }\n }\n };\n AbstractHeaderCellCtrl.prototype.addDomData = function () {\n var _this = this;\n var key = AbstractHeaderCellCtrl.DOM_DATA_KEY_HEADER_CTRL;\n this.gridOptionsService.setDomData(this.eGui, key, this);\n this.addDestroyFunc(function () { return _this.gridOptionsService.setDomData(_this.eGui, key, null); });\n };\n AbstractHeaderCellCtrl.prototype.getGui = function () {\n return this.eGui;\n };\n AbstractHeaderCellCtrl.prototype.focus = function (event) {\n if (!this.eGui) {\n return false;\n }\n this.lastFocusEvent = event || null;\n this.eGui.focus();\n return true;\n };\n AbstractHeaderCellCtrl.prototype.getRowIndex = function () {\n return this.parentRowCtrl.getRowIndex();\n };\n AbstractHeaderCellCtrl.prototype.getParentRowCtrl = function () {\n return this.parentRowCtrl;\n };\n AbstractHeaderCellCtrl.prototype.getPinned = function () {\n return this.parentRowCtrl.getPinned();\n };\n AbstractHeaderCellCtrl.prototype.getInstanceId = function () {\n return this.instanceId;\n };\n AbstractHeaderCellCtrl.prototype.getColumnGroupChild = function () {\n return this.columnGroupChild;\n };\n AbstractHeaderCellCtrl.prototype.removeDragSource = function () {\n if (this.dragSource) {\n this.dragAndDropService.removeDragSource(this.dragSource);\n this.dragSource = null;\n }\n };\n AbstractHeaderCellCtrl.prototype.handleContextMenuMouseEvent = function (mouseEvent, touchEvent, column) {\n var event = mouseEvent !== null && mouseEvent !== void 0 ? mouseEvent : touchEvent;\n if (this.gridOptionsService.get('preventDefaultOnContextMenu')) {\n event.preventDefault();\n }\n var columnToUse = column instanceof Column ? column : undefined;\n if (this.menuService.isHeaderContextMenuEnabled(columnToUse)) {\n this.menuService.showHeaderContextMenu(columnToUse, mouseEvent, touchEvent);\n }\n this.dispatchColumnMouseEvent(Events.EVENT_COLUMN_HEADER_CONTEXT_MENU, column);\n };\n AbstractHeaderCellCtrl.prototype.dispatchColumnMouseEvent = function (eventType, column) {\n var event = {\n type: eventType,\n column: column,\n };\n this.eventService.dispatchEvent(event);\n };\n AbstractHeaderCellCtrl.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.removeDragSource();\n this.comp = null;\n this.column = null;\n this.resizeFeature = null;\n this.lastFocusEvent = null;\n this.columnGroupChild = null;\n this.parentRowCtrl = null;\n this.eGui = null;\n };\n AbstractHeaderCellCtrl.DOM_DATA_KEY_HEADER_CTRL = 'headerCtrl';\n __decorate$1C([\n Autowired('pinnedWidthService')\n ], AbstractHeaderCellCtrl.prototype, \"pinnedWidthService\", void 0);\n __decorate$1C([\n Autowired('focusService')\n ], AbstractHeaderCellCtrl.prototype, \"focusService\", void 0);\n __decorate$1C([\n Autowired('userComponentFactory')\n ], AbstractHeaderCellCtrl.prototype, \"userComponentFactory\", void 0);\n __decorate$1C([\n Autowired('ctrlsService')\n ], AbstractHeaderCellCtrl.prototype, \"ctrlsService\", void 0);\n __decorate$1C([\n Autowired('dragAndDropService')\n ], AbstractHeaderCellCtrl.prototype, \"dragAndDropService\", void 0);\n __decorate$1C([\n Autowired('menuService')\n ], AbstractHeaderCellCtrl.prototype, \"menuService\", void 0);\n __decorate$1C([\n PostConstruct\n ], AbstractHeaderCellCtrl.prototype, \"postConstruct\", null);\n return AbstractHeaderCellCtrl;\n}(BeanStub));\n\nvar __extends$1J = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1B = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SetLeftFeature = /** @class */ (function (_super) {\n __extends$1J(SetLeftFeature, _super);\n function SetLeftFeature(columnOrGroup, eCell, beans, colsSpanning) {\n var _this = _super.call(this) || this;\n _this.columnOrGroup = columnOrGroup;\n _this.eCell = eCell;\n _this.ariaEl = _this.eCell.querySelector('[role=columnheader]') || _this.eCell;\n _this.colsSpanning = colsSpanning;\n _this.beans = beans;\n return _this;\n }\n SetLeftFeature.prototype.setColsSpanning = function (colsSpanning) {\n this.colsSpanning = colsSpanning;\n this.onLeftChanged();\n };\n SetLeftFeature.prototype.getColumnOrGroup = function () {\n if (this.beans.gridOptionsService.get('enableRtl') && this.colsSpanning) {\n return last(this.colsSpanning);\n }\n return this.columnOrGroup;\n };\n SetLeftFeature.prototype.postConstruct = function () {\n this.addManagedListener(this.columnOrGroup, Column.EVENT_LEFT_CHANGED, this.onLeftChanged.bind(this));\n this.setLeftFirstTime();\n // when in print layout, the left position is also dependent on the width of the pinned sections.\n // so additionally update left if any column width changes.\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, this.onLeftChanged.bind(this));\n // setting left has a dependency on print layout\n this.addManagedPropertyListener('domLayout', this.onLeftChanged.bind(this));\n };\n SetLeftFeature.prototype.setLeftFirstTime = function () {\n var suppressMoveAnimation = this.beans.gridOptionsService.get('suppressColumnMoveAnimation');\n var oldLeftExists = exists(this.columnOrGroup.getOldLeft());\n var animateColumnMove = this.beans.columnAnimationService.isActive() && oldLeftExists && !suppressMoveAnimation;\n if (animateColumnMove) {\n this.animateInLeft();\n }\n else {\n this.onLeftChanged();\n }\n };\n SetLeftFeature.prototype.animateInLeft = function () {\n var _this = this;\n var colOrGroup = this.getColumnOrGroup();\n var left = colOrGroup.getLeft();\n var oldLeft = colOrGroup.getOldLeft();\n var oldActualLeft = this.modifyLeftForPrintLayout(colOrGroup, oldLeft);\n var actualLeft = this.modifyLeftForPrintLayout(colOrGroup, left);\n this.setLeft(oldActualLeft);\n // we must keep track of the left we want to set to, as this would otherwise lead to a race\n // condition, if the user changed the left value many times in one VM turn, then we want to make\n // make sure the actualLeft we set in the timeout below (in the next VM turn) is the correct left\n // position. eg if user changes column position twice, then setLeft() below executes twice in next\n // VM turn, but only one (the correct one) should get applied.\n this.actualLeft = actualLeft;\n this.beans.columnAnimationService.executeNextVMTurn(function () {\n // test this left value is the latest one to be applied, and if not, do nothing\n if (_this.actualLeft === actualLeft) {\n _this.setLeft(actualLeft);\n }\n });\n };\n SetLeftFeature.prototype.onLeftChanged = function () {\n var colOrGroup = this.getColumnOrGroup();\n var left = colOrGroup.getLeft();\n this.actualLeft = this.modifyLeftForPrintLayout(colOrGroup, left);\n this.setLeft(this.actualLeft);\n };\n SetLeftFeature.prototype.modifyLeftForPrintLayout = function (colOrGroup, leftPosition) {\n var printLayout = this.beans.gridOptionsService.isDomLayout('print');\n if (!printLayout) {\n return leftPosition;\n }\n if (colOrGroup.getPinned() === 'left') {\n return leftPosition;\n }\n var leftWidth = this.beans.columnModel.getDisplayedColumnsLeftWidth();\n if (colOrGroup.getPinned() === 'right') {\n var bodyWidth = this.beans.columnModel.getBodyContainerWidth();\n return leftWidth + bodyWidth + leftPosition;\n }\n // is in body\n return leftWidth + leftPosition;\n };\n SetLeftFeature.prototype.setLeft = function (value) {\n // if the value is null, then that means the column is no longer\n // displayed. there is logic in the rendering to fade these columns\n // out, so we don't try and change their left positions.\n if (exists(value)) {\n this.eCell.style.left = \"\".concat(value, \"px\");\n }\n if (this.columnOrGroup instanceof Column) {\n this.columnOrGroup;\n }\n else {\n var columnGroup = this.columnOrGroup;\n var children = columnGroup.getLeafColumns();\n if (!children.length) {\n return;\n }\n if (children.length > 1) {\n setAriaColSpan(this.ariaEl, children.length);\n }\n children[0];\n }\n };\n __decorate$1B([\n PostConstruct\n ], SetLeftFeature.prototype, \"postConstruct\", null);\n return SetLeftFeature;\n}(BeanStub));\n\nvar __extends$1I = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1A = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar HoverFeature = /** @class */ (function (_super) {\n __extends$1I(HoverFeature, _super);\n function HoverFeature(columns, element) {\n var _this = _super.call(this) || this;\n _this.columns = columns;\n _this.element = element;\n return _this;\n }\n HoverFeature.prototype.postConstruct = function () {\n if (this.gridOptionsService.get('columnHoverHighlight')) {\n this.addMouseHoverListeners();\n }\n };\n HoverFeature.prototype.addMouseHoverListeners = function () {\n this.addManagedListener(this.element, 'mouseout', this.onMouseOut.bind(this));\n this.addManagedListener(this.element, 'mouseover', this.onMouseOver.bind(this));\n };\n HoverFeature.prototype.onMouseOut = function () {\n this.columnHoverService.clearMouseOver();\n };\n HoverFeature.prototype.onMouseOver = function () {\n this.columnHoverService.setMouseOver(this.columns);\n };\n __decorate$1A([\n Autowired('columnHoverService')\n ], HoverFeature.prototype, \"columnHoverService\", void 0);\n __decorate$1A([\n PostConstruct\n ], HoverFeature.prototype, \"postConstruct\", null);\n return HoverFeature;\n}(BeanStub));\n\nvar __extends$1H = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar HeaderFilterCellCtrl = /** @class */ (function (_super) {\n __extends$1H(HeaderFilterCellCtrl, _super);\n function HeaderFilterCellCtrl(column, beans, parentRowCtrl) {\n var _this = _super.call(this, column, beans, parentRowCtrl) || this;\n _this.iconCreated = false;\n _this.column = column;\n return _this;\n }\n HeaderFilterCellCtrl.prototype.setComp = function (comp, eGui, eButtonShowMainFilter, eFloatingFilterBody) {\n this.comp = comp;\n this.eButtonShowMainFilter = eButtonShowMainFilter;\n this.eFloatingFilterBody = eFloatingFilterBody;\n this.setGui(eGui);\n this.setupActive();\n this.setupWidth();\n this.setupLeft();\n this.setupHover();\n this.setupFocus();\n this.setupAria();\n this.setupFilterButton();\n this.setupUserComp();\n this.setupSyncWithFilter();\n this.setupUi();\n this.addManagedListener(this.eButtonShowMainFilter, 'click', this.showParentFilter.bind(this));\n this.setupFilterChangedListener();\n this.addManagedListener(this.column, Column.EVENT_COL_DEF_CHANGED, this.onColDefChanged.bind(this));\n };\n // empty abstract method\n HeaderFilterCellCtrl.prototype.resizeHeader = function () { };\n // empty abstract method\n HeaderFilterCellCtrl.prototype.moveHeader = function () { };\n HeaderFilterCellCtrl.prototype.setupActive = function () {\n var colDef = this.column.getColDef();\n var filterExists = !!colDef.filter;\n var floatingFilterExists = !!colDef.floatingFilter;\n this.active = filterExists && floatingFilterExists;\n };\n HeaderFilterCellCtrl.prototype.setupUi = function () {\n this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton && this.active);\n this.comp.addOrRemoveBodyCssClass('ag-floating-filter-full-body', this.suppressFilterButton);\n this.comp.addOrRemoveBodyCssClass('ag-floating-filter-body', !this.suppressFilterButton);\n if (!this.active || this.iconCreated) {\n return;\n }\n var eMenuIcon = createIconNoSpan('filter', this.gridOptionsService, this.column);\n if (eMenuIcon) {\n this.iconCreated = true;\n this.eButtonShowMainFilter.appendChild(eMenuIcon);\n }\n };\n HeaderFilterCellCtrl.prototype.setupFocus = function () {\n this.createManagedBean(new ManagedFocusFeature(this.eGui, {\n shouldStopEventPropagation: this.shouldStopEventPropagation.bind(this),\n onTabKeyDown: this.onTabKeyDown.bind(this),\n handleKeyDown: this.handleKeyDown.bind(this),\n onFocusIn: this.onFocusIn.bind(this)\n }));\n };\n HeaderFilterCellCtrl.prototype.setupAria = function () {\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n setAriaLabel(this.eButtonShowMainFilter, localeTextFunc('ariaFilterMenuOpen', 'Open Filter Menu'));\n };\n HeaderFilterCellCtrl.prototype.onTabKeyDown = function (e) {\n var eDocument = this.gridOptionsService.getDocument();\n var activeEl = eDocument.activeElement;\n var wrapperHasFocus = activeEl === this.eGui;\n if (wrapperHasFocus) {\n return;\n }\n var nextFocusableEl = this.focusService.findNextFocusableElement(this.eGui, null, e.shiftKey);\n if (nextFocusableEl) {\n this.beans.headerNavigationService.scrollToColumn(this.column);\n e.preventDefault();\n nextFocusableEl.focus();\n return;\n }\n var nextFocusableColumn = this.findNextColumnWithFloatingFilter(e.shiftKey);\n if (!nextFocusableColumn) {\n return;\n }\n if (this.focusService.focusHeaderPosition({\n headerPosition: {\n headerRowIndex: this.getParentRowCtrl().getRowIndex(),\n column: nextFocusableColumn\n },\n event: e\n })) {\n e.preventDefault();\n }\n };\n HeaderFilterCellCtrl.prototype.findNextColumnWithFloatingFilter = function (backwards) {\n var columnModel = this.beans.columnModel;\n var nextCol = this.column;\n do {\n nextCol = backwards\n ? columnModel.getDisplayedColBefore(nextCol)\n : columnModel.getDisplayedColAfter(nextCol);\n if (!nextCol) {\n break;\n }\n } while (!nextCol.getColDef().filter || !nextCol.getColDef().floatingFilter);\n return nextCol;\n };\n HeaderFilterCellCtrl.prototype.handleKeyDown = function (e) {\n _super.prototype.handleKeyDown.call(this, e);\n var wrapperHasFocus = this.getWrapperHasFocus();\n switch (e.key) {\n case KeyCode.UP:\n case KeyCode.DOWN:\n if (!wrapperHasFocus) {\n e.preventDefault();\n }\n case KeyCode.LEFT:\n case KeyCode.RIGHT:\n if (wrapperHasFocus) {\n return;\n }\n e.stopPropagation();\n case KeyCode.ENTER:\n if (wrapperHasFocus) {\n if (this.focusService.focusInto(this.eGui)) {\n e.preventDefault();\n }\n }\n break;\n case KeyCode.ESCAPE:\n if (!wrapperHasFocus) {\n this.eGui.focus();\n }\n }\n };\n HeaderFilterCellCtrl.prototype.onFocusIn = function (e) {\n var isRelatedWithin = this.eGui.contains(e.relatedTarget);\n // when the focus is already within the component,\n // we default to the browser's behavior\n if (isRelatedWithin) {\n return;\n }\n var notFromHeaderWrapper = !!e.relatedTarget && !e.relatedTarget.classList.contains('ag-floating-filter');\n var fromWithinHeader = !!e.relatedTarget && isElementChildOfClass(e.relatedTarget, 'ag-floating-filter');\n if (notFromHeaderWrapper && fromWithinHeader && e.target === this.eGui) {\n var lastFocusEvent = this.lastFocusEvent;\n var fromTab = !!(lastFocusEvent && lastFocusEvent.key === KeyCode.TAB);\n if (lastFocusEvent && fromTab) {\n var shouldFocusLast = lastFocusEvent.shiftKey;\n this.focusService.focusInto(this.eGui, shouldFocusLast);\n }\n }\n var rowIndex = this.getRowIndex();\n this.beans.focusService.setFocusedHeader(rowIndex, this.column);\n };\n HeaderFilterCellCtrl.prototype.setupHover = function () {\n var _this = this;\n this.createManagedBean(new HoverFeature([this.column], this.eGui));\n var listener = function () {\n if (!_this.gridOptionsService.get('columnHoverHighlight')) {\n return;\n }\n var hovered = _this.beans.columnHoverService.isHovered(_this.column);\n _this.comp.addOrRemoveCssClass('ag-column-hover', hovered);\n };\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_HOVER_CHANGED, listener);\n listener();\n };\n HeaderFilterCellCtrl.prototype.setupLeft = function () {\n var setLeftFeature = new SetLeftFeature(this.column, this.eGui, this.beans);\n this.createManagedBean(setLeftFeature);\n };\n HeaderFilterCellCtrl.prototype.setupFilterButton = function () {\n this.suppressFilterButton = !this.menuService.isFloatingFilterButtonEnabled(this.column);\n this.highlightFilterButtonWhenActive = !this.menuService.isLegacyMenuEnabled();\n };\n HeaderFilterCellCtrl.prototype.setupUserComp = function () {\n var _this = this;\n if (!this.active) {\n return;\n }\n var compDetails = this.beans.filterManager.getFloatingFilterCompDetails(this.column, function () { return _this.showParentFilter(); });\n if (compDetails) {\n this.setCompDetails(compDetails);\n }\n };\n HeaderFilterCellCtrl.prototype.setCompDetails = function (compDetails) {\n this.userCompDetails = compDetails;\n this.comp.setCompDetails(compDetails);\n };\n HeaderFilterCellCtrl.prototype.showParentFilter = function () {\n var eventSource = this.suppressFilterButton ? this.eFloatingFilterBody : this.eButtonShowMainFilter;\n this.menuService.showFilterMenu({\n column: this.column,\n buttonElement: eventSource,\n containerType: 'floatingFilter',\n positionBy: 'button'\n });\n };\n HeaderFilterCellCtrl.prototype.setupSyncWithFilter = function () {\n var _this = this;\n if (!this.active) {\n return;\n }\n var filterManager = this.beans.filterManager;\n var syncWithFilter = function (filterChangedEvent) {\n var compPromise = _this.comp.getFloatingFilterComp();\n if (!compPromise) {\n return;\n }\n compPromise.then(function (comp) {\n if (comp) {\n var parentModel = filterManager.getCurrentFloatingFilterParentModel(_this.column);\n comp.onParentModelChanged(parentModel, filterChangedEvent);\n }\n });\n };\n this.destroySyncListener = this.addManagedListener(this.column, Column.EVENT_FILTER_CHANGED, syncWithFilter);\n if (filterManager.isFilterActive(this.column)) {\n syncWithFilter(null);\n }\n };\n HeaderFilterCellCtrl.prototype.setupWidth = function () {\n var _this = this;\n var listener = function () {\n var width = \"\".concat(_this.column.getActualWidth(), \"px\");\n _this.comp.setWidth(width);\n };\n this.addManagedListener(this.column, Column.EVENT_WIDTH_CHANGED, listener);\n listener();\n };\n HeaderFilterCellCtrl.prototype.setupFilterChangedListener = function () {\n if (this.active) {\n this.destroyFilterChangedListener = this.addManagedListener(this.column, Column.EVENT_FILTER_CHANGED, this.updateFilterButton.bind(this));\n this.updateFilterButton();\n }\n };\n HeaderFilterCellCtrl.prototype.updateFilterButton = function () {\n if (!this.suppressFilterButton && this.comp) {\n var isFilterAllowed = this.beans.filterManager.isFilterAllowed(this.column);\n this.comp.setButtonWrapperDisplayed(isFilterAllowed);\n if (this.highlightFilterButtonWhenActive && isFilterAllowed) {\n this.eButtonShowMainFilter.classList.toggle('ag-filter-active', this.column.isFilterActive());\n }\n }\n };\n HeaderFilterCellCtrl.prototype.onColDefChanged = function () {\n var _this = this;\n var _a, _b;\n var wasActive = this.active;\n this.setupActive();\n var becomeActive = !wasActive && this.active;\n if (wasActive && !this.active) {\n (_a = this.destroySyncListener) === null || _a === void 0 ? void 0 : _a.call(this);\n (_b = this.destroyFilterChangedListener) === null || _b === void 0 ? void 0 : _b.call(this);\n }\n var newCompDetails = this.active\n ? this.beans.filterManager.getFloatingFilterCompDetails(this.column, function () { return _this.showParentFilter(); })\n : null;\n var compPromise = this.comp.getFloatingFilterComp();\n if (!compPromise || !newCompDetails) {\n this.updateCompDetails(newCompDetails, becomeActive);\n }\n else {\n compPromise.then(function (compInstance) {\n var _a;\n if (!compInstance || _this.beans.filterManager.areFilterCompsDifferent((_a = _this.userCompDetails) !== null && _a !== void 0 ? _a : null, newCompDetails)) {\n _this.updateCompDetails(newCompDetails, becomeActive);\n }\n else {\n _this.updateFloatingFilterParams(newCompDetails);\n }\n });\n }\n };\n HeaderFilterCellCtrl.prototype.updateCompDetails = function (compDetails, becomeActive) {\n if (!this.isAlive()) {\n return;\n }\n this.setCompDetails(compDetails);\n // filter button and UI can change based on params, so always want to update\n this.setupFilterButton();\n this.setupUi();\n if (becomeActive) {\n this.setupSyncWithFilter();\n this.setupFilterChangedListener();\n }\n };\n HeaderFilterCellCtrl.prototype.updateFloatingFilterParams = function (userCompDetails) {\n var _a;\n if (!userCompDetails) {\n return;\n }\n var params = userCompDetails.params;\n (_a = this.comp.getFloatingFilterComp()) === null || _a === void 0 ? void 0 : _a.then(function (floatingFilter) {\n var hasRefreshed = false;\n if ((floatingFilter === null || floatingFilter === void 0 ? void 0 : floatingFilter.refresh) && typeof floatingFilter.refresh === 'function') {\n var result = floatingFilter.refresh(params);\n // framework wrapper always implements optional methods, but returns null if no underlying method\n if (result !== null) {\n hasRefreshed = true;\n }\n }\n if (!hasRefreshed && (floatingFilter === null || floatingFilter === void 0 ? void 0 : floatingFilter.onParamsUpdated) && typeof floatingFilter.onParamsUpdated === 'function') {\n var result = floatingFilter.onParamsUpdated(params);\n if (result !== null) {\n warnOnce(\"Custom floating filter method 'onParamsUpdated' is deprecated. Use 'refresh' instead.\");\n }\n }\n });\n };\n HeaderFilterCellCtrl.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.eButtonShowMainFilter = null;\n this.eFloatingFilterBody = null;\n this.userCompDetails = null;\n this.destroySyncListener = null;\n this.destroyFilterChangedListener = null;\n };\n return HeaderFilterCellCtrl;\n}(AbstractHeaderCellCtrl));\n\nvar __extends$1G = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1z = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ResizeFeature = /** @class */ (function (_super) {\n __extends$1G(ResizeFeature, _super);\n function ResizeFeature(pinned, column, eResize, comp, ctrl) {\n var _this = _super.call(this) || this;\n _this.pinned = pinned;\n _this.column = column;\n _this.eResize = eResize;\n _this.comp = comp;\n _this.ctrl = ctrl;\n return _this;\n }\n ResizeFeature.prototype.postConstruct = function () {\n var _this = this;\n var destroyResizeFuncs = [];\n var canResize;\n var canAutosize;\n var addResize = function () {\n setDisplayed(_this.eResize, canResize);\n if (!canResize) {\n return;\n }\n var finishedWithResizeFunc = _this.horizontalResizeService.addResizeBar({\n eResizeBar: _this.eResize,\n onResizeStart: _this.onResizeStart.bind(_this),\n onResizing: _this.onResizing.bind(_this, false),\n onResizeEnd: _this.onResizing.bind(_this, true)\n });\n destroyResizeFuncs.push(finishedWithResizeFunc);\n if (canAutosize) {\n var skipHeaderOnAutoSize_1 = _this.gridOptionsService.get('skipHeaderOnAutoSize');\n var autoSizeColListener_1 = function () {\n _this.columnModel.autoSizeColumn(_this.column, \"uiColumnResized\", skipHeaderOnAutoSize_1);\n };\n _this.eResize.addEventListener('dblclick', autoSizeColListener_1);\n var touchListener_1 = new TouchListener(_this.eResize);\n touchListener_1.addEventListener(TouchListener.EVENT_DOUBLE_TAP, autoSizeColListener_1);\n destroyResizeFuncs.push(function () {\n _this.eResize.removeEventListener('dblclick', autoSizeColListener_1);\n touchListener_1.removeEventListener(TouchListener.EVENT_DOUBLE_TAP, autoSizeColListener_1);\n touchListener_1.destroy();\n });\n }\n };\n var removeResize = function () {\n destroyResizeFuncs.forEach(function (f) { return f(); });\n destroyResizeFuncs.length = 0;\n };\n var refresh = function () {\n var resize = _this.column.isResizable();\n var autoSize = !_this.gridOptionsService.get('suppressAutoSize') && !_this.column.getColDef().suppressAutoSize;\n var propertyChange = resize !== canResize || autoSize !== canAutosize;\n if (propertyChange) {\n canResize = resize;\n canAutosize = autoSize;\n removeResize();\n addResize();\n }\n };\n refresh();\n this.addDestroyFunc(removeResize);\n this.ctrl.addRefreshFunction(refresh);\n };\n ResizeFeature.prototype.onResizing = function (finished, resizeAmount) {\n var _a = this, key = _a.column, lastResizeAmount = _a.lastResizeAmount, resizeStartWidth = _a.resizeStartWidth;\n var resizeAmountNormalised = this.normaliseResizeAmount(resizeAmount);\n var newWidth = resizeStartWidth + resizeAmountNormalised;\n var columnWidths = [{ key: key, newWidth: newWidth }];\n if (this.column.getPinned()) {\n var leftWidth = this.pinnedWidthService.getPinnedLeftWidth();\n var rightWidth = this.pinnedWidthService.getPinnedRightWidth();\n var bodyWidth = getInnerWidth(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement()) - 50;\n if (leftWidth + rightWidth + (resizeAmountNormalised - lastResizeAmount) > bodyWidth) {\n return;\n }\n }\n this.lastResizeAmount = resizeAmountNormalised;\n this.columnModel.setColumnWidths(columnWidths, this.resizeWithShiftKey, finished, \"uiColumnResized\");\n if (finished) {\n this.toggleColumnResizing(false);\n }\n };\n ResizeFeature.prototype.onResizeStart = function (shiftKey) {\n this.resizeStartWidth = this.column.getActualWidth();\n this.lastResizeAmount = 0;\n this.resizeWithShiftKey = shiftKey;\n this.toggleColumnResizing(true);\n };\n ResizeFeature.prototype.toggleColumnResizing = function (resizing) {\n this.comp.addOrRemoveCssClass('ag-column-resizing', resizing);\n };\n // optionally inverts the drag, depending on pinned and RTL\n // note - this method is duplicated in RenderedHeaderGroupCell - should refactor out?\n ResizeFeature.prototype.normaliseResizeAmount = function (dragChange) {\n var result = dragChange;\n var notPinningLeft = this.pinned !== 'left';\n var pinningRight = this.pinned === 'right';\n if (this.gridOptionsService.get('enableRtl')) {\n // for RTL, dragging left makes the col bigger, except when pinning left\n if (notPinningLeft) {\n result *= -1;\n }\n }\n else {\n // for LTR (ie normal), dragging left makes the col smaller, except when pinning right\n if (pinningRight) {\n result *= -1;\n }\n }\n return result;\n };\n __decorate$1z([\n Autowired('horizontalResizeService')\n ], ResizeFeature.prototype, \"horizontalResizeService\", void 0);\n __decorate$1z([\n Autowired('pinnedWidthService')\n ], ResizeFeature.prototype, \"pinnedWidthService\", void 0);\n __decorate$1z([\n Autowired('ctrlsService')\n ], ResizeFeature.prototype, \"ctrlsService\", void 0);\n __decorate$1z([\n Autowired('columnModel')\n ], ResizeFeature.prototype, \"columnModel\", void 0);\n __decorate$1z([\n PostConstruct\n ], ResizeFeature.prototype, \"postConstruct\", null);\n return ResizeFeature;\n}(BeanStub));\n\nvar __extends$1F = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1y = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SelectAllFeature = /** @class */ (function (_super) {\n __extends$1F(SelectAllFeature, _super);\n function SelectAllFeature(column) {\n var _this = _super.call(this) || this;\n _this.cbSelectAllVisible = false;\n _this.processingEventFromCheckbox = false;\n _this.column = column;\n return _this;\n }\n SelectAllFeature.prototype.onSpaceKeyDown = function (e) {\n var checkbox = this.cbSelectAll;\n var eDocument = this.gridOptionsService.getDocument();\n if (checkbox.isDisplayed() && !checkbox.getGui().contains(eDocument.activeElement)) {\n e.preventDefault();\n checkbox.setValue(!checkbox.getValue());\n }\n };\n SelectAllFeature.prototype.getCheckboxGui = function () {\n return this.cbSelectAll.getGui();\n };\n SelectAllFeature.prototype.setComp = function (ctrl) {\n this.headerCellCtrl = ctrl;\n this.cbSelectAll = this.createManagedBean(new AgCheckbox());\n this.cbSelectAll.addCssClass('ag-header-select-all');\n setAriaRole(this.cbSelectAll.getGui(), 'presentation');\n this.showOrHideSelectAll();\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.onNewColumnsLoaded.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_SELECTION_CHANGED, this.onSelectionChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_PAGINATION_CHANGED, this.onSelectionChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_MODEL_UPDATED, this.onModelChanged.bind(this));\n this.addManagedListener(this.cbSelectAll, Events.EVENT_FIELD_VALUE_CHANGED, this.onCbSelectAll.bind(this));\n setAriaHidden(this.cbSelectAll.getGui(), true);\n this.cbSelectAll.getInputElement().setAttribute('tabindex', '-1');\n this.refreshSelectAllLabel();\n };\n SelectAllFeature.prototype.onNewColumnsLoaded = function () {\n this.showOrHideSelectAll();\n };\n SelectAllFeature.prototype.onDisplayedColumnsChanged = function () {\n if (!this.isAlive()) {\n return;\n }\n this.showOrHideSelectAll();\n };\n SelectAllFeature.prototype.showOrHideSelectAll = function () {\n this.cbSelectAllVisible = this.isCheckboxSelection();\n this.cbSelectAll.setDisplayed(this.cbSelectAllVisible, { skipAriaHidden: true });\n if (this.cbSelectAllVisible) {\n // in case user is trying this feature with the wrong model type\n this.checkRightRowModelType('selectAllCheckbox');\n // in case user is trying this feature with the wrong model type\n this.checkSelectionType('selectAllCheckbox');\n // make sure checkbox is showing the right state\n this.updateStateOfCheckbox();\n }\n this.refreshSelectAllLabel();\n };\n SelectAllFeature.prototype.onModelChanged = function () {\n if (!this.cbSelectAllVisible) {\n return;\n }\n this.updateStateOfCheckbox();\n };\n SelectAllFeature.prototype.onSelectionChanged = function () {\n if (!this.cbSelectAllVisible) {\n return;\n }\n this.updateStateOfCheckbox();\n };\n SelectAllFeature.prototype.updateStateOfCheckbox = function () {\n if (this.processingEventFromCheckbox) {\n return;\n }\n this.processingEventFromCheckbox = true;\n var allSelected = this.selectionService.getSelectAllState(this.isFilteredOnly(), this.isCurrentPageOnly());\n this.cbSelectAll.setValue(allSelected);\n var hasNodesToSelect = this.selectionService.hasNodesToSelect(this.isFilteredOnly(), this.isCurrentPageOnly());\n this.cbSelectAll.setDisabled(!hasNodesToSelect);\n this.refreshSelectAllLabel();\n this.processingEventFromCheckbox = false;\n };\n SelectAllFeature.prototype.refreshSelectAllLabel = function () {\n var translate = this.localeService.getLocaleTextFunc();\n var checked = this.cbSelectAll.getValue();\n var ariaStatus = checked ? translate('ariaChecked', 'checked') : translate('ariaUnchecked', 'unchecked');\n var ariaLabel = translate('ariaRowSelectAll', 'Press Space to toggle all rows selection');\n if (!this.cbSelectAllVisible) {\n this.headerCellCtrl.setAriaDescriptionProperty('selectAll', null);\n }\n else {\n this.headerCellCtrl.setAriaDescriptionProperty('selectAll', \"\".concat(ariaLabel, \" (\").concat(ariaStatus, \")\"));\n }\n this.cbSelectAll.setInputAriaLabel(\"\".concat(ariaLabel, \" (\").concat(ariaStatus, \")\"));\n this.headerCellCtrl.announceAriaDescription();\n };\n SelectAllFeature.prototype.checkSelectionType = function (feature) {\n var isMultiSelect = this.gridOptionsService.get('rowSelection') === 'multiple';\n if (!isMultiSelect) {\n console.warn(\"AG Grid: \".concat(feature, \" is only available if using 'multiple' rowSelection.\"));\n return false;\n }\n return true;\n };\n SelectAllFeature.prototype.checkRightRowModelType = function (feature) {\n var rowModelType = this.rowModel.getType();\n var rowModelMatches = rowModelType === 'clientSide' || rowModelType === 'serverSide';\n if (!rowModelMatches) {\n console.warn(\"AG Grid: \".concat(feature, \" is only available if using 'clientSide' or 'serverSide' rowModelType, you are using \").concat(rowModelType, \".\"));\n return false;\n }\n return true;\n };\n SelectAllFeature.prototype.onCbSelectAll = function () {\n if (this.processingEventFromCheckbox) {\n return;\n }\n if (!this.cbSelectAllVisible) {\n return;\n }\n var value = this.cbSelectAll.getValue();\n var justFiltered = this.isFilteredOnly();\n var justCurrentPage = this.isCurrentPageOnly();\n var source = 'uiSelectAll';\n if (justCurrentPage) {\n source = 'uiSelectAllCurrentPage';\n }\n else if (justFiltered) {\n source = 'uiSelectAllFiltered';\n }\n var params = {\n source: source,\n justFiltered: justFiltered,\n justCurrentPage: justCurrentPage,\n };\n if (value) {\n this.selectionService.selectAllRowNodes(params);\n }\n else {\n this.selectionService.deselectAllRowNodes(params);\n }\n };\n SelectAllFeature.prototype.isCheckboxSelection = function () {\n var result = this.column.getColDef().headerCheckboxSelection;\n if (typeof result === 'function') {\n var func = result;\n var params = this.gridOptionsService.addGridCommonParams({\n column: this.column,\n colDef: this.column.getColDef()\n });\n result = func(params);\n }\n if (result) {\n return this.checkRightRowModelType('headerCheckboxSelection') && this.checkSelectionType('headerCheckboxSelection');\n }\n return false;\n };\n SelectAllFeature.prototype.isFilteredOnly = function () {\n return !!this.column.getColDef().headerCheckboxSelectionFilteredOnly;\n };\n SelectAllFeature.prototype.isCurrentPageOnly = function () {\n return !!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly;\n };\n __decorate$1y([\n Autowired('rowModel')\n ], SelectAllFeature.prototype, \"rowModel\", void 0);\n __decorate$1y([\n Autowired('selectionService')\n ], SelectAllFeature.prototype, \"selectionService\", void 0);\n return SelectAllFeature;\n}(BeanStub));\n\nvar __extends$1E = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar HeaderCellCtrl = /** @class */ (function (_super) {\n __extends$1E(HeaderCellCtrl, _super);\n function HeaderCellCtrl(column, beans, parentRowCtrl) {\n var _this = _super.call(this, column, beans, parentRowCtrl) || this;\n _this.refreshFunctions = [];\n _this.userHeaderClasses = new Set();\n _this.ariaDescriptionProperties = new Map();\n _this.column = column;\n return _this;\n }\n HeaderCellCtrl.prototype.setComp = function (comp, eGui, eResize, eHeaderCompWrapper) {\n var _this = this;\n this.comp = comp;\n this.setGui(eGui);\n this.updateState();\n this.setupWidth();\n this.setupMovingCss();\n this.setupMenuClass();\n this.setupSortableClass();\n this.setupWrapTextClass();\n this.refreshSpanHeaderHeight();\n this.setupAutoHeight(eHeaderCompWrapper);\n this.addColumnHoverListener();\n this.setupFilterClass();\n this.setupClassesFromColDef();\n this.setupTooltip();\n this.addActiveHeaderMouseListeners();\n this.setupSelectAll();\n this.setupUserComp();\n this.refreshAria();\n this.resizeFeature = this.createManagedBean(new ResizeFeature(this.getPinned(), this.column, eResize, comp, this));\n this.createManagedBean(new HoverFeature([this.column], eGui));\n this.createManagedBean(new SetLeftFeature(this.column, eGui, this.beans));\n this.createManagedBean(new ManagedFocusFeature(eGui, {\n shouldStopEventPropagation: function (e) { return _this.shouldStopEventPropagation(e); },\n onTabKeyDown: function () { return null; },\n handleKeyDown: this.handleKeyDown.bind(this),\n onFocusIn: this.onFocusIn.bind(this),\n onFocusOut: this.onFocusOut.bind(this)\n }));\n this.addResizeAndMoveKeyboardListeners();\n this.addManagedPropertyListeners(['suppressMovableColumns', 'suppressMenuHide', 'suppressAggFuncInHeader'], this.refresh.bind(this));\n this.addManagedListener(this.column, Column.EVENT_COL_DEF_CHANGED, this.refresh.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VALUE_CHANGED, this.onColumnValueChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.onColumnRowGroupChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_CHANGED, this.onColumnPivotChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_HEADER_HEIGHT_CHANGED, this.onHeaderHeightChanged.bind(this));\n };\n HeaderCellCtrl.prototype.resizeHeader = function (delta, shiftKey) {\n var _a, _b;\n if (!this.column.isResizable()) {\n return;\n }\n var actualWidth = this.column.getActualWidth();\n var minWidth = (_a = this.column.getMinWidth()) !== null && _a !== void 0 ? _a : 0;\n var maxWidth = (_b = this.column.getMaxWidth()) !== null && _b !== void 0 ? _b : Number.MAX_SAFE_INTEGER;\n var newWidth = Math.min(Math.max(actualWidth + delta, minWidth), maxWidth);\n this.beans.columnModel.setColumnWidths([{ key: this.column, newWidth: newWidth }], shiftKey, true, 'uiColumnResized');\n };\n HeaderCellCtrl.prototype.moveHeader = function (hDirection) {\n var _a = this, eGui = _a.eGui, column = _a.column, gridOptionsService = _a.gridOptionsService, ctrlsService = _a.ctrlsService;\n var pinned = this.getPinned();\n var left = eGui.getBoundingClientRect().left;\n var width = column.getActualWidth();\n var isRtl = gridOptionsService.get('enableRtl');\n var isLeft = hDirection === HorizontalDirection.Left !== isRtl;\n var xPosition = ColumnMoveHelper.normaliseX(isLeft ? (left - 20) : (left + width + 20), pinned, true, gridOptionsService, ctrlsService);\n ColumnMoveHelper.attemptMoveColumns({\n allMovingColumns: [column],\n isFromHeader: true,\n hDirection: hDirection,\n xPosition: xPosition,\n pinned: pinned,\n fromEnter: false,\n fakeEvent: false,\n gridOptionsService: gridOptionsService,\n columnModel: this.beans.columnModel\n });\n ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(column, 'auto');\n };\n HeaderCellCtrl.prototype.setupUserComp = function () {\n var compDetails = this.lookupUserCompDetails();\n this.setCompDetails(compDetails);\n };\n HeaderCellCtrl.prototype.setCompDetails = function (compDetails) {\n this.userCompDetails = compDetails;\n this.comp.setUserCompDetails(compDetails);\n };\n HeaderCellCtrl.prototype.lookupUserCompDetails = function () {\n var params = this.createParams();\n var colDef = this.column.getColDef();\n return this.userComponentFactory.getHeaderCompDetails(colDef, params);\n };\n HeaderCellCtrl.prototype.createParams = function () {\n var _this = this;\n var params = this.gridOptionsService.addGridCommonParams({\n column: this.column,\n displayName: this.displayName,\n enableSorting: this.column.isSortable(),\n enableMenu: this.menuEnabled,\n enableFilterButton: this.openFilterEnabled && this.menuService.isHeaderFilterButtonEnabled(this.column),\n enableFilterIcon: !this.openFilterEnabled || this.menuService.isLegacyMenuEnabled(),\n showColumnMenu: function (buttonElement) {\n _this.menuService.showColumnMenu({\n column: _this.column,\n buttonElement: buttonElement,\n positionBy: 'button'\n });\n },\n showColumnMenuAfterMouseClick: function (mouseEvent) {\n _this.menuService.showColumnMenu({\n column: _this.column,\n mouseEvent: mouseEvent,\n positionBy: 'mouse'\n });\n },\n showFilter: function (buttonElement) {\n _this.menuService.showFilterMenu({\n column: _this.column,\n buttonElement: buttonElement,\n containerType: 'columnFilter',\n positionBy: 'button'\n });\n },\n progressSort: function (multiSort) {\n _this.beans.sortController.progressSort(_this.column, !!multiSort, \"uiColumnSorted\");\n },\n setSort: function (sort, multiSort) {\n _this.beans.sortController.setSortForColumn(_this.column, sort, !!multiSort, \"uiColumnSorted\");\n },\n eGridHeader: this.getGui()\n });\n return params;\n };\n HeaderCellCtrl.prototype.setupSelectAll = function () {\n this.selectAllFeature = this.createManagedBean(new SelectAllFeature(this.column));\n this.selectAllFeature.setComp(this);\n };\n HeaderCellCtrl.prototype.getSelectAllGui = function () {\n return this.selectAllFeature.getCheckboxGui();\n };\n HeaderCellCtrl.prototype.handleKeyDown = function (e) {\n _super.prototype.handleKeyDown.call(this, e);\n if (e.key === KeyCode.SPACE) {\n this.selectAllFeature.onSpaceKeyDown(e);\n }\n if (e.key === KeyCode.ENTER) {\n this.onEnterKeyDown(e);\n }\n if (e.key === KeyCode.DOWN && e.altKey) {\n this.showMenuOnKeyPress(e, false);\n }\n };\n HeaderCellCtrl.prototype.onEnterKeyDown = function (e) {\n if (e.ctrlKey || e.metaKey) {\n this.showMenuOnKeyPress(e, true);\n }\n else if (this.sortable) {\n var multiSort = e.shiftKey;\n this.beans.sortController.progressSort(this.column, multiSort, \"uiColumnSorted\");\n }\n };\n HeaderCellCtrl.prototype.showMenuOnKeyPress = function (e, isFilterShortcut) {\n var headerComp = this.comp.getUserCompInstance();\n if (!headerComp || !(headerComp instanceof HeaderComp)) {\n return;\n }\n // the header comp knows what features are enabled, so let it handle the shortcut\n if (headerComp.onMenuKeyboardShortcut(isFilterShortcut)) {\n e.preventDefault();\n }\n };\n HeaderCellCtrl.prototype.onFocusIn = function (e) {\n if (!this.getGui().contains(e.relatedTarget)) {\n var rowIndex = this.getRowIndex();\n this.focusService.setFocusedHeader(rowIndex, this.column);\n this.announceAriaDescription();\n }\n if (this.focusService.isKeyboardMode()) {\n this.setActiveHeader(true);\n }\n };\n HeaderCellCtrl.prototype.onFocusOut = function (e) {\n if (this.getGui().contains(e.relatedTarget)) {\n return;\n }\n this.setActiveHeader(false);\n };\n HeaderCellCtrl.prototype.setupTooltip = function () {\n var _this = this;\n var tooltipCtrl = {\n getColumn: function () { return _this.column; },\n getColDef: function () { return _this.column.getColDef(); },\n getGui: function () { return _this.eGui; },\n getLocation: function () { return 'header'; },\n getTooltipValue: function () {\n var res = _this.column.getColDef().headerTooltip;\n return res;\n },\n };\n var tooltipFeature = this.createManagedBean(new TooltipFeature(tooltipCtrl, this.beans));\n tooltipFeature.setComp(this.eGui);\n this.refreshFunctions.push(function () { return tooltipFeature.refreshToolTip(); });\n };\n HeaderCellCtrl.prototype.setupClassesFromColDef = function () {\n var _this = this;\n var refreshHeaderClasses = function () {\n var colDef = _this.column.getColDef();\n var classes = CssClassApplier.getHeaderClassesFromColDef(colDef, _this.gridOptionsService, _this.column, null);\n var oldClasses = _this.userHeaderClasses;\n _this.userHeaderClasses = new Set(classes);\n classes.forEach(function (c) {\n if (oldClasses.has(c)) {\n // class already added, no need to apply it, but remove from old set\n oldClasses.delete(c);\n }\n else {\n // class new since last time, so apply it\n _this.comp.addOrRemoveCssClass(c, true);\n }\n });\n // now old set only has classes that were applied last time, but not this time, so remove them\n oldClasses.forEach(function (c) { return _this.comp.addOrRemoveCssClass(c, false); });\n };\n this.refreshFunctions.push(refreshHeaderClasses);\n refreshHeaderClasses();\n };\n HeaderCellCtrl.prototype.setDragSource = function (eSource) {\n var _this = this;\n this.dragSourceElement = eSource;\n this.removeDragSource();\n if (!eSource || !this.draggable) {\n return;\n }\n var _a = this, column = _a.column, beans = _a.beans, displayName = _a.displayName, dragAndDropService = _a.dragAndDropService, gridOptionsService = _a.gridOptionsService;\n var columnModel = beans.columnModel;\n var hideColumnOnExit = !this.gridOptionsService.get('suppressDragLeaveHidesColumns');\n var dragSource = this.dragSource = {\n type: DragSourceType.HeaderCell,\n eElement: eSource,\n getDefaultIconName: function () { return hideColumnOnExit ? DragAndDropService.ICON_HIDE : DragAndDropService.ICON_NOT_ALLOWED; },\n getDragItem: function () { return _this.createDragItem(column); },\n dragItemName: displayName,\n onDragStarted: function () {\n hideColumnOnExit = !gridOptionsService.get('suppressDragLeaveHidesColumns');\n column.setMoving(true, \"uiColumnMoved\");\n },\n onDragStopped: function () { return column.setMoving(false, \"uiColumnMoved\"); },\n onGridEnter: function (dragItem) {\n var _a;\n if (hideColumnOnExit) {\n var unlockedColumns = ((_a = dragItem === null || dragItem === void 0 ? void 0 : dragItem.columns) === null || _a === void 0 ? void 0 : _a.filter(function (col) { return !col.getColDef().lockVisible; })) || [];\n columnModel.setColumnsVisible(unlockedColumns, true, \"uiColumnMoved\");\n }\n },\n onGridExit: function (dragItem) {\n var _a;\n if (hideColumnOnExit) {\n var unlockedColumns = ((_a = dragItem === null || dragItem === void 0 ? void 0 : dragItem.columns) === null || _a === void 0 ? void 0 : _a.filter(function (col) { return !col.getColDef().lockVisible; })) || [];\n columnModel.setColumnsVisible(unlockedColumns, false, \"uiColumnMoved\");\n }\n },\n };\n dragAndDropService.addDragSource(dragSource, true);\n };\n HeaderCellCtrl.prototype.createDragItem = function (column) {\n var visibleState = {};\n visibleState[column.getId()] = column.isVisible();\n return {\n columns: [column],\n visibleState: visibleState\n };\n };\n HeaderCellCtrl.prototype.updateState = function () {\n this.menuEnabled = this.menuService.isColumnMenuInHeaderEnabled(this.column);\n this.openFilterEnabled = this.menuService.isFilterMenuInHeaderEnabled(this.column);\n this.sortable = this.column.isSortable();\n this.displayName = this.calculateDisplayName();\n this.draggable = this.workOutDraggable();\n };\n HeaderCellCtrl.prototype.addRefreshFunction = function (func) {\n this.refreshFunctions.push(func);\n };\n HeaderCellCtrl.prototype.refresh = function () {\n this.updateState();\n this.refreshHeaderComp();\n this.refreshAria();\n this.refreshFunctions.forEach(function (f) { return f(); });\n };\n HeaderCellCtrl.prototype.refreshHeaderComp = function () {\n var newCompDetails = this.lookupUserCompDetails();\n var compInstance = this.comp.getUserCompInstance();\n // only try refresh if old comp exists adn it is the correct type\n var attemptRefresh = compInstance != null && this.userCompDetails.componentClass == newCompDetails.componentClass;\n var headerCompRefreshed = attemptRefresh ? this.attemptHeaderCompRefresh(newCompDetails.params) : false;\n if (headerCompRefreshed) {\n // we do this as a refresh happens after colDefs change, and it's possible the column has had it's\n // draggable property toggled. no need to call this if not refreshing, as setDragSource is done\n // as part of appendHeaderComp\n this.setDragSource(this.dragSourceElement);\n }\n else {\n this.setCompDetails(newCompDetails);\n }\n };\n HeaderCellCtrl.prototype.attemptHeaderCompRefresh = function (params) {\n var headerComp = this.comp.getUserCompInstance();\n if (!headerComp) {\n return false;\n }\n // if no refresh method, then we want to replace the headerComp\n if (!headerComp.refresh) {\n return false;\n }\n var res = headerComp.refresh(params);\n return res;\n };\n HeaderCellCtrl.prototype.calculateDisplayName = function () {\n return this.beans.columnModel.getDisplayNameForColumn(this.column, 'header', true);\n };\n HeaderCellCtrl.prototype.checkDisplayName = function () {\n // display name can change if aggFunc different, eg sum(Gold) is now max(Gold)\n if (this.displayName !== this.calculateDisplayName()) {\n this.refresh();\n }\n };\n HeaderCellCtrl.prototype.workOutDraggable = function () {\n var colDef = this.column.getColDef();\n var isSuppressMovableColumns = this.gridOptionsService.get('suppressMovableColumns');\n var colCanMove = !isSuppressMovableColumns && !colDef.suppressMovable && !colDef.lockPosition;\n // we should still be allowed drag the column, even if it can't be moved, if the column\n // can be dragged to a rowGroup or pivot drop zone\n return !!colCanMove || !!colDef.enableRowGroup || !!colDef.enablePivot;\n };\n HeaderCellCtrl.prototype.onColumnRowGroupChanged = function () {\n this.checkDisplayName();\n };\n HeaderCellCtrl.prototype.onColumnPivotChanged = function () {\n this.checkDisplayName();\n };\n HeaderCellCtrl.prototype.onColumnValueChanged = function () {\n this.checkDisplayName();\n };\n HeaderCellCtrl.prototype.setupWidth = function () {\n var _this = this;\n var listener = function () {\n var columnWidth = _this.column.getActualWidth();\n _this.comp.setWidth(\"\".concat(columnWidth, \"px\"));\n };\n this.addManagedListener(this.column, Column.EVENT_WIDTH_CHANGED, listener);\n listener();\n };\n HeaderCellCtrl.prototype.setupMovingCss = function () {\n var _this = this;\n var listener = function () {\n // this is what makes the header go dark when it is been moved (gives impression to\n // user that the column was picked up).\n _this.comp.addOrRemoveCssClass('ag-header-cell-moving', _this.column.isMoving());\n };\n this.addManagedListener(this.column, Column.EVENT_MOVING_CHANGED, listener);\n listener();\n };\n HeaderCellCtrl.prototype.setupMenuClass = function () {\n var _this = this;\n var listener = function () {\n _this.comp.addOrRemoveCssClass('ag-column-menu-visible', _this.column.isMenuVisible());\n };\n this.addManagedListener(this.column, Column.EVENT_MENU_VISIBLE_CHANGED, listener);\n listener();\n };\n HeaderCellCtrl.prototype.setupSortableClass = function () {\n var _this = this;\n var updateSortableCssClass = function () {\n _this.comp.addOrRemoveCssClass('ag-header-cell-sortable', !!_this.sortable);\n };\n updateSortableCssClass();\n this.addRefreshFunction(updateSortableCssClass);\n this.addManagedListener(this.eventService, Column.EVENT_SORT_CHANGED, this.refreshAriaSort.bind(this));\n };\n HeaderCellCtrl.prototype.setupFilterClass = function () {\n var _this = this;\n var listener = function () {\n var isFilterActive = _this.column.isFilterActive();\n _this.comp.addOrRemoveCssClass('ag-header-cell-filtered', isFilterActive);\n _this.refreshAria();\n };\n this.addManagedListener(this.column, Column.EVENT_FILTER_ACTIVE_CHANGED, listener);\n listener();\n };\n HeaderCellCtrl.prototype.setupWrapTextClass = function () {\n var _this = this;\n var listener = function () {\n var wrapText = !!_this.column.getColDef().wrapHeaderText;\n _this.comp.addOrRemoveCssClass('ag-header-cell-wrap-text', wrapText);\n };\n listener();\n this.addRefreshFunction(listener);\n };\n HeaderCellCtrl.prototype.onDisplayedColumnsChanged = function () {\n _super.prototype.onDisplayedColumnsChanged.call(this);\n if (!this.isAlive()) {\n return;\n }\n this.onHeaderHeightChanged();\n };\n HeaderCellCtrl.prototype.onHeaderHeightChanged = function () {\n this.refreshSpanHeaderHeight();\n };\n HeaderCellCtrl.prototype.refreshSpanHeaderHeight = function () {\n var _a = this, eGui = _a.eGui, column = _a.column, comp = _a.comp, beans = _a.beans;\n if (!column.isSpanHeaderHeight()) {\n eGui.style.removeProperty('top');\n eGui.style.removeProperty('height');\n comp.addOrRemoveCssClass('ag-header-span-height', false);\n comp.addOrRemoveCssClass('ag-header-span-total', false);\n return;\n }\n var _b = this.column.getColumnGroupPaddingInfo(), numberOfParents = _b.numberOfParents, isSpanningTotal = _b.isSpanningTotal;\n comp.addOrRemoveCssClass('ag-header-span-height', numberOfParents > 0);\n var columnModel = beans.columnModel;\n var headerHeight = columnModel.getColumnHeaderRowHeight();\n if (numberOfParents === 0) {\n // if spanning has stopped then need to reset these values.\n comp.addOrRemoveCssClass('ag-header-span-total', false);\n eGui.style.setProperty('top', \"0px\");\n eGui.style.setProperty('height', \"\".concat(headerHeight, \"px\"));\n return;\n }\n comp.addOrRemoveCssClass('ag-header-span-total', isSpanningTotal);\n var pivotMode = columnModel.isPivotMode();\n var groupHeaderHeight = pivotMode\n ? columnModel.getPivotGroupHeaderHeight()\n : columnModel.getGroupHeaderHeight();\n var extraHeight = numberOfParents * groupHeaderHeight;\n eGui.style.setProperty('top', \"\".concat(-extraHeight, \"px\"));\n eGui.style.setProperty('height', \"\".concat(headerHeight + extraHeight, \"px\"));\n };\n HeaderCellCtrl.prototype.setupAutoHeight = function (wrapperElement) {\n var _this = this;\n var _a = this.beans, columnModel = _a.columnModel, resizeObserverService = _a.resizeObserverService;\n var measureHeight = function (timesCalled) {\n if (!_this.isAlive()) {\n return;\n }\n var _a = getElementSize(_this.getGui()), paddingTop = _a.paddingTop, paddingBottom = _a.paddingBottom, borderBottomWidth = _a.borderBottomWidth, borderTopWidth = _a.borderTopWidth;\n var extraHeight = paddingTop + paddingBottom + borderBottomWidth + borderTopWidth;\n var wrapperHeight = wrapperElement.offsetHeight;\n var autoHeight = wrapperHeight + extraHeight;\n if (timesCalled < 5) {\n // if not in doc yet, means framework not yet inserted, so wait for next VM turn,\n // maybe it will be ready next VM turn\n var doc = _this.beans.gridOptionsService.getDocument();\n var notYetInDom = !doc || !doc.contains(wrapperElement);\n // this happens in React, where React hasn't put any content in. we say 'possibly'\n // as a) may not be React and b) the cell could be empty anyway\n var possiblyNoContentYet = autoHeight == 0;\n if (notYetInDom || possiblyNoContentYet) {\n window.setTimeout(function () { return measureHeight(timesCalled + 1); }, 0);\n return;\n }\n }\n columnModel.setColumnHeaderHeight(_this.column, autoHeight);\n };\n var isMeasuring = false;\n var stopResizeObserver;\n var checkMeasuring = function () {\n var newValue = _this.column.isAutoHeaderHeight();\n if (newValue && !isMeasuring) {\n startMeasuring();\n }\n if (!newValue && isMeasuring) {\n stopMeasuring();\n }\n };\n var startMeasuring = function () {\n isMeasuring = true;\n measureHeight(0);\n _this.comp.addOrRemoveCssClass('ag-header-cell-auto-height', true);\n stopResizeObserver = resizeObserverService.observeResize(wrapperElement, function () { return measureHeight(0); });\n };\n var stopMeasuring = function () {\n isMeasuring = false;\n if (stopResizeObserver) {\n stopResizeObserver();\n }\n _this.comp.addOrRemoveCssClass('ag-header-cell-auto-height', false);\n stopResizeObserver = undefined;\n };\n checkMeasuring();\n this.addDestroyFunc(function () { return stopMeasuring(); });\n // In theory we could rely on the resize observer for everything - but since it's debounced\n // it can be a little janky for smooth movement. in this case its better to react to our own events\n // And unfortunately we cant _just_ rely on our own events, since custom components can change whenever\n this.addManagedListener(this.column, Column.EVENT_WIDTH_CHANGED, function () { return isMeasuring && measureHeight(0); });\n // Displaying the sort icon changes the available area for text, so sort changes can affect height\n this.addManagedListener(this.eventService, Column.EVENT_SORT_CHANGED, function () {\n // Rendering changes for sort, happen after the event... not ideal\n if (isMeasuring) {\n window.setTimeout(function () { return measureHeight(0); });\n }\n });\n this.addRefreshFunction(checkMeasuring);\n };\n HeaderCellCtrl.prototype.refreshAriaSort = function () {\n if (this.sortable) {\n var translate = this.localeService.getLocaleTextFunc();\n var sort = this.beans.sortController.getDisplaySortForColumn(this.column) || null;\n this.comp.setAriaSort(getAriaSortState(sort));\n this.setAriaDescriptionProperty('sort', translate('ariaSortableColumn', 'Press ENTER to sort'));\n }\n else {\n this.comp.setAriaSort();\n this.setAriaDescriptionProperty('sort', null);\n }\n };\n HeaderCellCtrl.prototype.refreshAriaMenu = function () {\n if (this.menuEnabled) {\n var translate = this.localeService.getLocaleTextFunc();\n this.setAriaDescriptionProperty('menu', translate('ariaMenuColumn', 'Press ALT DOWN to open column menu'));\n }\n else {\n this.setAriaDescriptionProperty('menu', null);\n }\n };\n HeaderCellCtrl.prototype.refreshAriaFilterButton = function () {\n if (this.openFilterEnabled && !this.menuService.isLegacyMenuEnabled()) {\n var translate = this.localeService.getLocaleTextFunc();\n this.setAriaDescriptionProperty('filterButton', translate('ariaFilterColumn', 'Press CTRL ENTER to open filter'));\n }\n else {\n this.setAriaDescriptionProperty('filterButton', null);\n }\n };\n HeaderCellCtrl.prototype.refreshAriaFiltered = function () {\n var translate = this.localeService.getLocaleTextFunc();\n var isFilterActive = this.column.isFilterActive();\n if (isFilterActive) {\n this.setAriaDescriptionProperty('filter', translate('ariaColumnFiltered', 'Column Filtered'));\n }\n else {\n this.setAriaDescriptionProperty('filter', null);\n }\n };\n HeaderCellCtrl.prototype.setAriaDescriptionProperty = function (property, value) {\n if (value != null) {\n this.ariaDescriptionProperties.set(property, value);\n }\n else {\n this.ariaDescriptionProperties.delete(property);\n }\n };\n HeaderCellCtrl.prototype.announceAriaDescription = function () {\n var _this = this;\n var eDocument = this.beans.gridOptionsService.getDocument();\n if (!this.eGui.contains(eDocument.activeElement)) {\n return;\n }\n var ariaDescription = Array.from(this.ariaDescriptionProperties.keys())\n // always announce the filter description first\n .sort(function (a, b) { return a === 'filter' ? -1 : (b.charCodeAt(0) - a.charCodeAt(0)); })\n .map(function (key) { return _this.ariaDescriptionProperties.get(key); })\n .join('. ');\n this.beans.ariaAnnouncementService.announceValue(ariaDescription);\n };\n HeaderCellCtrl.prototype.refreshAria = function () {\n this.refreshAriaSort();\n this.refreshAriaMenu();\n this.refreshAriaFilterButton();\n this.refreshAriaFiltered();\n };\n HeaderCellCtrl.prototype.addColumnHoverListener = function () {\n var _this = this;\n var listener = function () {\n if (!_this.gridOptionsService.get('columnHoverHighlight')) {\n return;\n }\n var isHovered = _this.beans.columnHoverService.isHovered(_this.column);\n _this.comp.addOrRemoveCssClass('ag-column-hover', isHovered);\n };\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_HOVER_CHANGED, listener);\n listener();\n };\n HeaderCellCtrl.prototype.getColId = function () {\n return this.column.getColId();\n };\n HeaderCellCtrl.prototype.addActiveHeaderMouseListeners = function () {\n var _this = this;\n var listener = function (e) { return _this.handleMouseOverChange(e.type === 'mouseenter'); };\n var clickListener = function () { return _this.dispatchColumnMouseEvent(Events.EVENT_COLUMN_HEADER_CLICKED, _this.column); };\n var contextMenuListener = function (event) { return _this.handleContextMenuMouseEvent(event, undefined, _this.column); };\n this.addManagedListener(this.getGui(), 'mouseenter', listener);\n this.addManagedListener(this.getGui(), 'mouseleave', listener);\n this.addManagedListener(this.getGui(), 'click', clickListener);\n this.addManagedListener(this.getGui(), 'contextmenu', contextMenuListener);\n };\n HeaderCellCtrl.prototype.handleMouseOverChange = function (isMouseOver) {\n this.setActiveHeader(isMouseOver);\n var eventType = isMouseOver ?\n Events.EVENT_COLUMN_HEADER_MOUSE_OVER :\n Events.EVENT_COLUMN_HEADER_MOUSE_LEAVE;\n var event = {\n type: eventType,\n column: this.column,\n };\n this.eventService.dispatchEvent(event);\n };\n HeaderCellCtrl.prototype.setActiveHeader = function (active) {\n this.comp.addOrRemoveCssClass('ag-header-active', active);\n };\n HeaderCellCtrl.prototype.getAnchorElementForMenu = function (isFilter) {\n var headerComp = this.comp.getUserCompInstance();\n if (headerComp instanceof HeaderComp) {\n return headerComp.getAnchorElementForMenu(isFilter);\n }\n return this.getGui();\n };\n HeaderCellCtrl.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.refreshFunctions = null;\n this.selectAllFeature = null;\n this.dragSourceElement = null;\n this.userCompDetails = null;\n this.userHeaderClasses = null;\n this.ariaDescriptionProperties = null;\n };\n return HeaderCellCtrl;\n}(AbstractHeaderCellCtrl));\n\nvar __extends$1D = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1x = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar GroupResizeFeature = /** @class */ (function (_super) {\n __extends$1D(GroupResizeFeature, _super);\n function GroupResizeFeature(comp, eResize, pinned, columnGroup) {\n var _this = _super.call(this) || this;\n _this.eResize = eResize;\n _this.comp = comp;\n _this.pinned = pinned;\n _this.columnGroup = columnGroup;\n return _this;\n }\n GroupResizeFeature.prototype.postConstruct = function () {\n var _this = this;\n if (!this.columnGroup.isResizable()) {\n this.comp.setResizableDisplayed(false);\n return;\n }\n var finishedWithResizeFunc = this.horizontalResizeService.addResizeBar({\n eResizeBar: this.eResize,\n onResizeStart: this.onResizeStart.bind(this),\n onResizing: this.onResizing.bind(this, false),\n onResizeEnd: this.onResizing.bind(this, true)\n });\n this.addDestroyFunc(finishedWithResizeFunc);\n if (!this.gridOptionsService.get('suppressAutoSize')) {\n var skipHeaderOnAutoSize_1 = this.gridOptionsService.get('skipHeaderOnAutoSize');\n this.eResize.addEventListener('dblclick', function () {\n // get list of all the column keys we are responsible for\n var keys = [];\n var leafCols = _this.columnGroup.getDisplayedLeafColumns();\n leafCols.forEach(function (column) {\n // not all cols in the group may be participating with auto-resize\n if (!column.getColDef().suppressAutoSize) {\n keys.push(column.getColId());\n }\n });\n if (keys.length > 0) {\n _this.columnModel.autoSizeColumns({\n columns: keys,\n skipHeader: skipHeaderOnAutoSize_1,\n stopAtGroup: _this.columnGroup,\n source: 'uiColumnResized'\n });\n }\n _this.resizeLeafColumnsToFit('uiColumnResized');\n });\n }\n };\n GroupResizeFeature.prototype.onResizeStart = function (shiftKey) {\n var initialValues = this.getInitialValues(shiftKey);\n this.storeLocalValues(initialValues);\n this.toggleColumnResizing(true);\n };\n GroupResizeFeature.prototype.onResizing = function (finished, resizeAmount, source) {\n if (source === void 0) { source = 'uiColumnResized'; }\n var resizeAmountNormalised = this.normaliseDragChange(resizeAmount);\n var width = this.resizeStartWidth + resizeAmountNormalised;\n this.resizeColumnsFromLocalValues(width, source, finished);\n };\n GroupResizeFeature.prototype.getInitialValues = function (shiftKey) {\n var columnsToResize = this.getColumnsToResize();\n var resizeStartWidth = this.getInitialSizeOfColumns(columnsToResize);\n var resizeRatios = this.getSizeRatiosOfColumns(columnsToResize, resizeStartWidth);\n var columnSizeAndRatios = {\n columnsToResize: columnsToResize,\n resizeStartWidth: resizeStartWidth,\n resizeRatios: resizeRatios\n };\n var groupAfter = null;\n if (shiftKey) {\n groupAfter = this.columnModel.getDisplayedGroupAfter(this.columnGroup);\n }\n if (groupAfter) {\n var takeFromLeafCols = groupAfter.getDisplayedLeafColumns();\n var groupAfterColumns = columnSizeAndRatios.groupAfterColumns = takeFromLeafCols.filter(function (col) { return col.isResizable(); });\n var groupAfterStartWidth = columnSizeAndRatios.groupAfterStartWidth = this.getInitialSizeOfColumns(groupAfterColumns);\n columnSizeAndRatios.groupAfterRatios = this.getSizeRatiosOfColumns(groupAfterColumns, groupAfterStartWidth);\n }\n else {\n columnSizeAndRatios.groupAfterColumns = undefined;\n columnSizeAndRatios.groupAfterStartWidth = undefined;\n columnSizeAndRatios.groupAfterRatios = undefined;\n }\n return columnSizeAndRatios;\n };\n GroupResizeFeature.prototype.storeLocalValues = function (initialValues) {\n var columnsToResize = initialValues.columnsToResize, resizeStartWidth = initialValues.resizeStartWidth, resizeRatios = initialValues.resizeRatios, groupAfterColumns = initialValues.groupAfterColumns, groupAfterStartWidth = initialValues.groupAfterStartWidth, groupAfterRatios = initialValues.groupAfterRatios;\n this.resizeCols = columnsToResize;\n this.resizeStartWidth = resizeStartWidth;\n this.resizeRatios = resizeRatios;\n this.resizeTakeFromCols = groupAfterColumns;\n this.resizeTakeFromStartWidth = groupAfterStartWidth;\n this.resizeTakeFromRatios = groupAfterRatios;\n };\n GroupResizeFeature.prototype.clearLocalValues = function () {\n this.resizeCols = undefined;\n this.resizeRatios = undefined;\n this.resizeTakeFromCols = undefined;\n this.resizeTakeFromRatios = undefined;\n };\n GroupResizeFeature.prototype.resizeLeafColumnsToFit = function (source) {\n var preferredSize = this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup);\n var initialValues = this.getInitialValues();\n if (preferredSize > initialValues.resizeStartWidth) {\n this.resizeColumns(initialValues, preferredSize, source, true);\n }\n };\n GroupResizeFeature.prototype.resizeColumnsFromLocalValues = function (totalWidth, source, finished) {\n var _a, _b, _c;\n if (finished === void 0) { finished = true; }\n if (!this.resizeCols || !this.resizeRatios) {\n return;\n }\n var initialValues = {\n columnsToResize: this.resizeCols,\n resizeStartWidth: this.resizeStartWidth,\n resizeRatios: this.resizeRatios,\n groupAfterColumns: (_a = this.resizeTakeFromCols) !== null && _a !== void 0 ? _a : undefined,\n groupAfterStartWidth: (_b = this.resizeTakeFromStartWidth) !== null && _b !== void 0 ? _b : undefined,\n groupAfterRatios: (_c = this.resizeTakeFromRatios) !== null && _c !== void 0 ? _c : undefined\n };\n this.resizeColumns(initialValues, totalWidth, source, finished);\n };\n GroupResizeFeature.prototype.resizeColumns = function (initialValues, totalWidth, source, finished) {\n if (finished === void 0) { finished = true; }\n var columnsToResize = initialValues.columnsToResize, resizeStartWidth = initialValues.resizeStartWidth, resizeRatios = initialValues.resizeRatios, groupAfterColumns = initialValues.groupAfterColumns, groupAfterStartWidth = initialValues.groupAfterStartWidth, groupAfterRatios = initialValues.groupAfterRatios;\n var resizeSets = [];\n resizeSets.push({\n columns: columnsToResize,\n ratios: resizeRatios,\n width: totalWidth\n });\n if (groupAfterColumns) {\n var diff = totalWidth - resizeStartWidth;\n resizeSets.push({\n columns: groupAfterColumns,\n ratios: groupAfterRatios,\n width: groupAfterStartWidth - diff\n });\n }\n this.columnModel.resizeColumnSets({\n resizeSets: resizeSets,\n finished: finished,\n source: source\n });\n if (finished) {\n this.toggleColumnResizing(false);\n }\n };\n GroupResizeFeature.prototype.toggleColumnResizing = function (resizing) {\n this.comp.addOrRemoveCssClass('ag-column-resizing', resizing);\n };\n GroupResizeFeature.prototype.getColumnsToResize = function () {\n var leafCols = this.columnGroup.getDisplayedLeafColumns();\n return leafCols.filter(function (col) { return col.isResizable(); });\n };\n GroupResizeFeature.prototype.getInitialSizeOfColumns = function (columns) {\n return columns.reduce(function (totalWidth, column) { return totalWidth + column.getActualWidth(); }, 0);\n };\n GroupResizeFeature.prototype.getSizeRatiosOfColumns = function (columns, initialSizeOfColumns) {\n return columns.map(function (column) { return column.getActualWidth() / initialSizeOfColumns; });\n };\n // optionally inverts the drag, depending on pinned and RTL\n // note - this method is duplicated in RenderedHeaderCell - should refactor out?\n GroupResizeFeature.prototype.normaliseDragChange = function (dragChange) {\n var result = dragChange;\n if (this.gridOptionsService.get('enableRtl')) {\n // for RTL, dragging left makes the col bigger, except when pinning left\n if (this.pinned !== 'left') {\n result *= -1;\n }\n }\n else if (this.pinned === 'right') {\n // for LTR (ie normal), dragging left makes the col smaller, except when pinning right\n result *= -1;\n }\n return result;\n };\n GroupResizeFeature.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.clearLocalValues();\n };\n __decorate$1x([\n Autowired('horizontalResizeService')\n ], GroupResizeFeature.prototype, \"horizontalResizeService\", void 0);\n __decorate$1x([\n Autowired('autoWidthCalculator')\n ], GroupResizeFeature.prototype, \"autoWidthCalculator\", void 0);\n __decorate$1x([\n Autowired('columnModel')\n ], GroupResizeFeature.prototype, \"columnModel\", void 0);\n __decorate$1x([\n PostConstruct\n ], GroupResizeFeature.prototype, \"postConstruct\", null);\n return GroupResizeFeature;\n}(BeanStub));\n\nvar __extends$1C = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1w = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar GroupWidthFeature = /** @class */ (function (_super) {\n __extends$1C(GroupWidthFeature, _super);\n function GroupWidthFeature(comp, columnGroup) {\n var _this = _super.call(this) || this;\n // the children can change, we keep destroy functions related to listening to the children here\n _this.removeChildListenersFuncs = [];\n _this.columnGroup = columnGroup;\n _this.comp = comp;\n return _this;\n }\n GroupWidthFeature.prototype.postConstruct = function () {\n // we need to listen to changes in child columns, as they impact our width\n this.addListenersToChildrenColumns();\n // the children belonging to this group can change, so we need to add and remove listeners as they change\n this.addManagedListener(this.columnGroup, ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED, this.onDisplayedChildrenChanged.bind(this));\n this.onWidthChanged();\n // the child listeners are not tied to this components life-cycle, as children can get added and removed\n // to the group - hence they are on a different life-cycle. so we must make sure the existing children\n // listeners are removed when we finally get destroyed\n this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this));\n };\n GroupWidthFeature.prototype.addListenersToChildrenColumns = function () {\n var _this = this;\n // first destroy any old listeners\n this.removeListenersOnChildrenColumns();\n // now add new listeners to the new set of children\n var widthChangedListener = this.onWidthChanged.bind(this);\n this.columnGroup.getLeafColumns().forEach(function (column) {\n column.addEventListener('widthChanged', widthChangedListener);\n column.addEventListener('visibleChanged', widthChangedListener);\n _this.removeChildListenersFuncs.push(function () {\n column.removeEventListener('widthChanged', widthChangedListener);\n column.removeEventListener('visibleChanged', widthChangedListener);\n });\n });\n };\n GroupWidthFeature.prototype.removeListenersOnChildrenColumns = function () {\n this.removeChildListenersFuncs.forEach(function (func) { return func(); });\n this.removeChildListenersFuncs = [];\n };\n GroupWidthFeature.prototype.onDisplayedChildrenChanged = function () {\n this.addListenersToChildrenColumns();\n this.onWidthChanged();\n };\n GroupWidthFeature.prototype.onWidthChanged = function () {\n var columnWidth = this.columnGroup.getActualWidth();\n this.comp.setWidth(\"\".concat(columnWidth, \"px\"));\n this.comp.addOrRemoveCssClass('ag-hidden', columnWidth === 0);\n };\n __decorate$1w([\n PostConstruct\n ], GroupWidthFeature.prototype, \"postConstruct\", null);\n return GroupWidthFeature;\n}(BeanStub));\n\nvar __extends$1B = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$a = ( false) || function () {\n __assign$a = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$a.apply(this, arguments);\n};\nvar HeaderGroupCellCtrl = /** @class */ (function (_super) {\n __extends$1B(HeaderGroupCellCtrl, _super);\n function HeaderGroupCellCtrl(columnGroup, beans, parentRowCtrl) {\n var _this = _super.call(this, columnGroup, beans, parentRowCtrl) || this;\n _this.onSuppressColMoveChange = function () {\n if (!_this.isAlive() || _this.isSuppressMoving()) {\n _this.removeDragSource();\n }\n else {\n if (!_this.dragSource) {\n var eGui = _this.getGui();\n _this.setDragSource(eGui);\n }\n }\n };\n _this.column = columnGroup;\n return _this;\n }\n HeaderGroupCellCtrl.prototype.setComp = function (comp, eGui, eResize) {\n this.comp = comp;\n this.setGui(eGui);\n this.displayName = this.beans.columnModel.getDisplayNameForColumnGroup(this.column, 'header');\n this.addClasses();\n this.setupMovingCss();\n this.setupExpandable();\n this.setupTooltip();\n this.setupUserComp();\n this.addHeaderMouseListeners();\n var pinned = this.getParentRowCtrl().getPinned();\n var leafCols = this.column.getProvidedColumnGroup().getLeafColumns();\n this.createManagedBean(new HoverFeature(leafCols, eGui));\n this.createManagedBean(new SetLeftFeature(this.column, eGui, this.beans));\n this.createManagedBean(new GroupWidthFeature(comp, this.column));\n this.resizeFeature = this.createManagedBean(new GroupResizeFeature(comp, eResize, pinned, this.column));\n this.createManagedBean(new ManagedFocusFeature(eGui, {\n shouldStopEventPropagation: this.shouldStopEventPropagation.bind(this),\n onTabKeyDown: function () { return undefined; },\n handleKeyDown: this.handleKeyDown.bind(this),\n onFocusIn: this.onFocusIn.bind(this)\n }));\n this.addManagedPropertyListener(Events.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED, this.onSuppressColMoveChange);\n this.addResizeAndMoveKeyboardListeners();\n };\n HeaderGroupCellCtrl.prototype.resizeHeader = function (delta, shiftKey) {\n // check to avoid throwing when a component has not been setup yet (React 18)\n if (!this.resizeFeature) {\n return;\n }\n var initialValues = this.resizeFeature.getInitialValues(shiftKey);\n this.resizeFeature.resizeColumns(initialValues, initialValues.resizeStartWidth + delta, 'uiColumnResized', true);\n };\n HeaderGroupCellCtrl.prototype.moveHeader = function (hDirection) {\n var _a = this, beans = _a.beans, eGui = _a.eGui, column = _a.column, gridOptionsService = _a.gridOptionsService, ctrlsService = _a.ctrlsService;\n var isRtl = gridOptionsService.get('enableRtl');\n var isLeft = hDirection === HorizontalDirection.Left;\n var pinned = this.getPinned();\n var rect = eGui.getBoundingClientRect();\n var left = rect.left;\n var width = rect.width;\n var xPosition = ColumnMoveHelper.normaliseX(isLeft !== isRtl ? (left - 20) : (left + width + 20), pinned, true, gridOptionsService, ctrlsService);\n var id = column.getGroupId();\n var headerPosition = this.focusService.getFocusedHeader();\n ColumnMoveHelper.attemptMoveColumns({\n allMovingColumns: this.column.getLeafColumns(),\n isFromHeader: true,\n hDirection: hDirection,\n xPosition: xPosition,\n pinned: pinned,\n fromEnter: false,\n fakeEvent: false,\n gridOptionsService: gridOptionsService,\n columnModel: beans.columnModel\n });\n var displayedLeafColumns = column.getDisplayedLeafColumns();\n var targetColumn = isLeft ? displayedLeafColumns[0] : last(displayedLeafColumns);\n this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(targetColumn, 'auto');\n if (!this.isAlive() && headerPosition) {\n this.restoreFocus(id, column, headerPosition);\n }\n };\n HeaderGroupCellCtrl.prototype.restoreFocus = function (groupId, previousColumnGroup, previousPosition) {\n var leafCols = previousColumnGroup.getLeafColumns();\n if (!leafCols.length) {\n return;\n }\n var parent = leafCols[0].getParent();\n if (!parent) {\n return;\n }\n var newColumnGroup = this.findGroupWidthId(parent, groupId);\n if (newColumnGroup) {\n this.focusService.focusHeaderPosition({\n headerPosition: __assign$a(__assign$a({}, previousPosition), { column: newColumnGroup })\n });\n }\n };\n HeaderGroupCellCtrl.prototype.findGroupWidthId = function (columnGroup, id) {\n while (columnGroup) {\n if (columnGroup.getGroupId() === id) {\n return columnGroup;\n }\n columnGroup = columnGroup.getParent();\n }\n return null;\n };\n HeaderGroupCellCtrl.prototype.resizeLeafColumnsToFit = function (source) {\n // check to avoid throwing when a component has not been setup yet (React 18)\n if (!this.resizeFeature) {\n return;\n }\n this.resizeFeature.resizeLeafColumnsToFit(source);\n };\n HeaderGroupCellCtrl.prototype.setupUserComp = function () {\n var _this = this;\n var params = this.gridOptionsService.addGridCommonParams({\n displayName: this.displayName,\n columnGroup: this.column,\n setExpanded: function (expanded) {\n _this.beans.columnModel.setColumnGroupOpened(_this.column.getProvidedColumnGroup(), expanded, \"gridInitializing\");\n }\n });\n var compDetails = this.userComponentFactory.getHeaderGroupCompDetails(params);\n this.comp.setUserCompDetails(compDetails);\n };\n HeaderGroupCellCtrl.prototype.addHeaderMouseListeners = function () {\n var _this = this;\n var listener = function (e) { return _this.handleMouseOverChange(e.type === 'mouseenter'); };\n var clickListener = function () { return _this.dispatchColumnMouseEvent(Events.EVENT_COLUMN_HEADER_CLICKED, _this.column.getProvidedColumnGroup()); };\n var contextMenuListener = function (event) { return _this.handleContextMenuMouseEvent(event, undefined, _this.column.getProvidedColumnGroup()); };\n this.addManagedListener(this.getGui(), 'mouseenter', listener);\n this.addManagedListener(this.getGui(), 'mouseleave', listener);\n this.addManagedListener(this.getGui(), 'click', clickListener);\n this.addManagedListener(this.getGui(), 'contextmenu', contextMenuListener);\n };\n HeaderGroupCellCtrl.prototype.handleMouseOverChange = function (isMouseOver) {\n var eventType = isMouseOver ?\n Events.EVENT_COLUMN_HEADER_MOUSE_OVER :\n Events.EVENT_COLUMN_HEADER_MOUSE_LEAVE;\n var event = {\n type: eventType,\n column: this.column.getProvidedColumnGroup(),\n };\n this.eventService.dispatchEvent(event);\n };\n HeaderGroupCellCtrl.prototype.setupTooltip = function () {\n var _this = this;\n var colGroupDef = this.column.getColGroupDef();\n var tooltipCtrl = {\n getColumn: function () { return _this.column; },\n getGui: function () { return _this.eGui; },\n getLocation: function () { return 'headerGroup'; },\n getTooltipValue: function () { return colGroupDef && colGroupDef.headerTooltip; }\n };\n if (colGroupDef) {\n tooltipCtrl.getColDef = function () { return colGroupDef; };\n }\n var tooltipFeature = this.createManagedBean(new TooltipFeature(tooltipCtrl, this.beans));\n tooltipFeature.setComp(this.eGui);\n };\n HeaderGroupCellCtrl.prototype.setupExpandable = function () {\n var providedColGroup = this.column.getProvidedColumnGroup();\n this.refreshExpanded();\n this.addManagedListener(providedColGroup, ProvidedColumnGroup.EVENT_EXPANDABLE_CHANGED, this.refreshExpanded.bind(this));\n this.addManagedListener(providedColGroup, ProvidedColumnGroup.EVENT_EXPANDED_CHANGED, this.refreshExpanded.bind(this));\n };\n HeaderGroupCellCtrl.prototype.refreshExpanded = function () {\n var column = this.column;\n this.expandable = column.isExpandable();\n var expanded = column.isExpanded();\n if (this.expandable) {\n this.comp.setAriaExpanded(expanded ? 'true' : 'false');\n }\n else {\n this.comp.setAriaExpanded(undefined);\n }\n };\n HeaderGroupCellCtrl.prototype.getColId = function () {\n return this.column.getUniqueId();\n };\n HeaderGroupCellCtrl.prototype.addClasses = function () {\n var _this = this;\n var colGroupDef = this.column.getColGroupDef();\n var classes = CssClassApplier.getHeaderClassesFromColDef(colGroupDef, this.gridOptionsService, null, this.column);\n // having different classes below allows the style to not have a bottom border\n // on the group header, if no group is specified\n if (this.column.isPadding()) {\n classes.push('ag-header-group-cell-no-group');\n var leafCols = this.column.getLeafColumns();\n if (leafCols.every(function (col) { return col.isSpanHeaderHeight(); })) {\n classes.push('ag-header-span-height');\n }\n }\n else {\n classes.push('ag-header-group-cell-with-group');\n }\n classes.forEach(function (c) { return _this.comp.addOrRemoveCssClass(c, true); });\n };\n HeaderGroupCellCtrl.prototype.setupMovingCss = function () {\n var _this = this;\n var providedColumnGroup = this.column.getProvidedColumnGroup();\n var leafColumns = providedColumnGroup.getLeafColumns();\n // this function adds or removes the moving css, based on if the col is moving.\n // this is what makes the header go dark when it is been moved (gives impression to\n // user that the column was picked up).\n var listener = function () { return _this.comp.addOrRemoveCssClass('ag-header-cell-moving', _this.column.isMoving()); };\n leafColumns.forEach(function (col) {\n _this.addManagedListener(col, Column.EVENT_MOVING_CHANGED, listener);\n });\n listener();\n };\n HeaderGroupCellCtrl.prototype.onFocusIn = function (e) {\n if (!this.eGui.contains(e.relatedTarget)) {\n var rowIndex = this.getRowIndex();\n this.beans.focusService.setFocusedHeader(rowIndex, this.column);\n }\n };\n HeaderGroupCellCtrl.prototype.handleKeyDown = function (e) {\n _super.prototype.handleKeyDown.call(this, e);\n var wrapperHasFocus = this.getWrapperHasFocus();\n if (!this.expandable || !wrapperHasFocus) {\n return;\n }\n if (e.key === KeyCode.ENTER) {\n var column = this.column;\n var newExpandedValue = !column.isExpanded();\n this.beans.columnModel.setColumnGroupOpened(column.getProvidedColumnGroup(), newExpandedValue, \"uiColumnExpanded\");\n }\n };\n // unlike columns, this will only get called once, as we don't react on props on column groups\n // (we will always destroy and recreate this comp if something changes)\n HeaderGroupCellCtrl.prototype.setDragSource = function (eHeaderGroup) {\n var _this = this;\n if (!this.isAlive() || this.isSuppressMoving()) {\n return;\n }\n this.removeDragSource();\n if (!eHeaderGroup) {\n return;\n }\n var _a = this, beans = _a.beans, column = _a.column, displayName = _a.displayName, gridOptionsService = _a.gridOptionsService, dragAndDropService = _a.dragAndDropService;\n var columnModel = beans.columnModel;\n var allLeafColumns = column.getProvidedColumnGroup().getLeafColumns();\n var hideColumnOnExit = !gridOptionsService.get('suppressDragLeaveHidesColumns');\n var dragSource = this.dragSource = {\n type: DragSourceType.HeaderCell,\n eElement: eHeaderGroup,\n getDefaultIconName: function () { return hideColumnOnExit ? DragAndDropService.ICON_HIDE : DragAndDropService.ICON_NOT_ALLOWED; },\n dragItemName: displayName,\n // we add in the original group leaf columns, so we move both visible and non-visible items\n getDragItem: function () { return _this.getDragItemForGroup(column); },\n onDragStarted: function () {\n hideColumnOnExit = !gridOptionsService.get('suppressDragLeaveHidesColumns');\n allLeafColumns.forEach(function (col) { return col.setMoving(true, \"uiColumnDragged\"); });\n },\n onDragStopped: function () { return allLeafColumns.forEach(function (col) { return col.setMoving(false, \"uiColumnDragged\"); }); },\n onGridEnter: function (dragItem) {\n var _a;\n if (hideColumnOnExit) {\n var unlockedColumns = ((_a = dragItem === null || dragItem === void 0 ? void 0 : dragItem.columns) === null || _a === void 0 ? void 0 : _a.filter(function (col) { return !col.getColDef().lockVisible; })) || [];\n columnModel.setColumnsVisible(unlockedColumns, true, \"uiColumnMoved\");\n }\n },\n onGridExit: function (dragItem) {\n var _a;\n if (hideColumnOnExit) {\n var unlockedColumns = ((_a = dragItem === null || dragItem === void 0 ? void 0 : dragItem.columns) === null || _a === void 0 ? void 0 : _a.filter(function (col) { return !col.getColDef().lockVisible; })) || [];\n columnModel.setColumnsVisible(unlockedColumns, false, \"uiColumnMoved\");\n }\n },\n };\n dragAndDropService.addDragSource(dragSource, true);\n };\n // when moving the columns, we want to move all the columns (contained within the DragItem) in this group in one go,\n // and in the order they are currently in the screen.\n HeaderGroupCellCtrl.prototype.getDragItemForGroup = function (columnGroup) {\n var allColumnsOriginalOrder = columnGroup.getProvidedColumnGroup().getLeafColumns();\n // capture visible state, used when re-entering grid to dictate which columns should be visible\n var visibleState = {};\n allColumnsOriginalOrder.forEach(function (column) { return visibleState[column.getId()] = column.isVisible(); });\n var allColumnsCurrentOrder = [];\n this.beans.columnModel.getAllDisplayedColumns().forEach(function (column) {\n if (allColumnsOriginalOrder.indexOf(column) >= 0) {\n allColumnsCurrentOrder.push(column);\n removeFromArray(allColumnsOriginalOrder, column);\n }\n });\n // we are left with non-visible columns, stick these in at the end\n allColumnsOriginalOrder.forEach(function (column) { return allColumnsCurrentOrder.push(column); });\n // create and return dragItem\n return {\n columns: allColumnsCurrentOrder,\n visibleState: visibleState\n };\n };\n HeaderGroupCellCtrl.prototype.isSuppressMoving = function () {\n // if any child is fixed, then don't allow moving\n var childSuppressesMoving = false;\n this.column.getLeafColumns().forEach(function (column) {\n if (column.getColDef().suppressMovable || column.getColDef().lockPosition) {\n childSuppressesMoving = true;\n }\n });\n var result = childSuppressesMoving || this.gridOptionsService.get('suppressMovableColumns');\n return result;\n };\n return HeaderGroupCellCtrl;\n}(AbstractHeaderCellCtrl));\n\nvar __extends$1A = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1v = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __values$5 = ( false) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$l = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar instanceIdSequence = 0;\nvar HeaderRowCtrl = /** @class */ (function (_super) {\n __extends$1A(HeaderRowCtrl, _super);\n function HeaderRowCtrl(rowIndex, pinned, type) {\n var _this = _super.call(this) || this;\n _this.instanceId = instanceIdSequence++;\n _this.rowIndex = rowIndex;\n _this.pinned = pinned;\n _this.type = type;\n var typeClass = type == HeaderRowType.COLUMN_GROUP ? \"ag-header-row-column-group\" :\n type == HeaderRowType.FLOATING_FILTER ? \"ag-header-row-column-filter\" : \"ag-header-row-column\";\n _this.headerRowClass = \"ag-header-row \".concat(typeClass);\n return _this;\n }\n HeaderRowCtrl.prototype.postConstruct = function () {\n this.isPrintLayout = this.gridOptionsService.isDomLayout('print');\n this.isEnsureDomOrder = this.gridOptionsService.get('ensureDomOrder');\n };\n HeaderRowCtrl.prototype.getInstanceId = function () {\n return this.instanceId;\n };\n /**\n *\n * @param comp Proxy to the actual component\n * @param initCompState Should the component be initialised with the current state of the controller. Default: true\n */\n HeaderRowCtrl.prototype.setComp = function (comp, initCompState) {\n if (initCompState === void 0) { initCompState = true; }\n this.comp = comp;\n if (initCompState) {\n this.onRowHeightChanged();\n this.onVirtualColumnsChanged();\n }\n // width is managed directly regardless of framework and so is not included in initCompState\n this.setWidth();\n this.addEventListeners();\n };\n HeaderRowCtrl.prototype.getHeaderRowClass = function () {\n return this.headerRowClass;\n };\n HeaderRowCtrl.prototype.getAriaRowIndex = function () {\n return this.rowIndex + 1;\n };\n HeaderRowCtrl.prototype.addEventListeners = function () {\n var _this = this;\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_RESIZED, this.onColumnResized.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_VIRTUAL_COLUMNS_CHANGED, function (params) { return _this.onVirtualColumnsChanged(params.afterScroll); });\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED, this.onRowHeightChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_GRID_STYLES_CHANGED, this.onRowHeightChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED, this.onRowHeightChanged.bind(this));\n // when print layout changes, it changes what columns are in what section\n this.addManagedPropertyListener('domLayout', this.onDisplayedColumnsChanged.bind(this));\n this.addManagedPropertyListener('ensureDomOrder', function (e) { return _this.isEnsureDomOrder = e.currentValue; });\n this.addManagedPropertyListener('headerHeight', this.onRowHeightChanged.bind(this));\n this.addManagedPropertyListener('pivotHeaderHeight', this.onRowHeightChanged.bind(this));\n this.addManagedPropertyListener('groupHeaderHeight', this.onRowHeightChanged.bind(this));\n this.addManagedPropertyListener('pivotGroupHeaderHeight', this.onRowHeightChanged.bind(this));\n this.addManagedPropertyListener('floatingFiltersHeight', this.onRowHeightChanged.bind(this));\n };\n HeaderRowCtrl.prototype.getHeaderCellCtrl = function (column) {\n if (!this.headerCellCtrls) {\n return;\n }\n return values(this.headerCellCtrls).find(function (cellCtrl) { return cellCtrl.getColumnGroupChild() === column; });\n };\n HeaderRowCtrl.prototype.onDisplayedColumnsChanged = function () {\n this.isPrintLayout = this.gridOptionsService.isDomLayout('print');\n this.onVirtualColumnsChanged();\n this.setWidth();\n this.onRowHeightChanged();\n };\n HeaderRowCtrl.prototype.getType = function () {\n return this.type;\n };\n HeaderRowCtrl.prototype.onColumnResized = function () {\n this.setWidth();\n };\n HeaderRowCtrl.prototype.setWidth = function () {\n var width = this.getWidthForRow();\n this.comp.setWidth(\"\".concat(width, \"px\"));\n };\n HeaderRowCtrl.prototype.getWidthForRow = function () {\n var columnModel = this.beans.columnModel;\n if (this.isPrintLayout) {\n var pinned = this.pinned != null;\n if (pinned) {\n return 0;\n }\n return columnModel.getContainerWidth('right')\n + columnModel.getContainerWidth('left')\n + columnModel.getContainerWidth(null);\n }\n // if not printing, just return the width as normal\n return columnModel.getContainerWidth(this.pinned);\n };\n HeaderRowCtrl.prototype.onRowHeightChanged = function () {\n var _a = this.getTopAndHeight(), topOffset = _a.topOffset, rowHeight = _a.rowHeight;\n this.comp.setTop(topOffset + 'px');\n this.comp.setHeight(rowHeight + 'px');\n };\n HeaderRowCtrl.prototype.getTopAndHeight = function () {\n var _a = this.beans, columnModel = _a.columnModel, filterManager = _a.filterManager;\n var headerRowCount = columnModel.getHeaderRowCount();\n var sizes = [];\n var numberOfFloating = 0;\n if (filterManager.hasFloatingFilters()) {\n headerRowCount++;\n numberOfFloating = 1;\n }\n var groupHeight = columnModel.getColumnGroupHeaderRowHeight();\n var headerHeight = columnModel.getColumnHeaderRowHeight();\n var numberOfNonGroups = 1 + numberOfFloating;\n var numberOfGroups = headerRowCount - numberOfNonGroups;\n for (var i = 0; i < numberOfGroups; i++) {\n sizes.push(groupHeight);\n }\n sizes.push(headerHeight);\n for (var i = 0; i < numberOfFloating; i++) {\n sizes.push(columnModel.getFloatingFiltersHeight());\n }\n var topOffset = 0;\n for (var i = 0; i < this.rowIndex; i++) {\n topOffset += sizes[i];\n }\n var rowHeight = sizes[this.rowIndex];\n return { topOffset: topOffset, rowHeight: rowHeight };\n };\n HeaderRowCtrl.prototype.getPinned = function () {\n return this.pinned;\n };\n HeaderRowCtrl.prototype.getRowIndex = function () {\n return this.rowIndex;\n };\n HeaderRowCtrl.prototype.onVirtualColumnsChanged = function (afterScroll) {\n if (afterScroll === void 0) { afterScroll = false; }\n var ctrlsToDisplay = this.getHeaderCtrls();\n var forceOrder = this.isEnsureDomOrder || this.isPrintLayout;\n this.comp.setHeaderCtrls(ctrlsToDisplay, forceOrder, afterScroll);\n };\n HeaderRowCtrl.prototype.getHeaderCtrls = function () {\n var e_1, _a, e_2, _b;\n var _this = this;\n var oldCtrls = this.headerCellCtrls;\n this.headerCellCtrls = new Map();\n var columns = this.getColumnsInViewport();\n try {\n for (var columns_1 = __values$5(columns), columns_1_1 = columns_1.next(); !columns_1_1.done; columns_1_1 = columns_1.next()) {\n var child = columns_1_1.value;\n this.recycleAndCreateHeaderCtrls(child, oldCtrls);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (columns_1_1 && !columns_1_1.done && (_a = columns_1.return)) _a.call(columns_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n // we want to keep columns that are focused, otherwise keyboard navigation breaks\n var isFocusedAndDisplayed = function (ctrl) {\n var _a = _this.beans, focusService = _a.focusService, columnModel = _a.columnModel;\n var isFocused = focusService.isHeaderWrapperFocused(ctrl);\n if (!isFocused) {\n return false;\n }\n var isDisplayed = columnModel.isDisplayed(ctrl.getColumnGroupChild());\n return isDisplayed;\n };\n if (oldCtrls) {\n try {\n for (var oldCtrls_1 = __values$5(oldCtrls), oldCtrls_1_1 = oldCtrls_1.next(); !oldCtrls_1_1.done; oldCtrls_1_1 = oldCtrls_1.next()) {\n var _c = __read$l(oldCtrls_1_1.value, 2), id = _c[0], oldCtrl = _c[1];\n var keepCtrl = isFocusedAndDisplayed(oldCtrl);\n if (keepCtrl) {\n this.headerCellCtrls.set(id, oldCtrl);\n }\n else {\n this.destroyBean(oldCtrl);\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (oldCtrls_1_1 && !oldCtrls_1_1.done && (_b = oldCtrls_1.return)) _b.call(oldCtrls_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n var ctrlsToDisplay = Array.from(this.headerCellCtrls.values());\n return ctrlsToDisplay;\n };\n HeaderRowCtrl.prototype.recycleAndCreateHeaderCtrls = function (headerColumn, oldCtrls) {\n if (!this.headerCellCtrls) {\n return;\n }\n // skip groups that have no displayed children. this can happen when the group is broken,\n // and this section happens to have nothing to display for the open / closed state.\n // (a broken group is one that is split, ie columns in the group have a non-group column\n // in between them)\n if (headerColumn.isEmptyGroup()) {\n return;\n }\n var idOfChild = headerColumn.getUniqueId();\n // if we already have this cell rendered, do nothing\n var headerCtrl;\n if (oldCtrls) {\n headerCtrl = oldCtrls.get(idOfChild);\n oldCtrls.delete(idOfChild);\n }\n // it's possible there is a new Column with the same ID, but it's for a different Column.\n // this is common with pivoting, where the pivot cols change, but the id's are still pivot_0,\n // pivot_1 etc. so if new col but same ID, need to remove the old col here first as we are\n // about to replace it in the this.headerComps map.\n var forOldColumn = headerCtrl && headerCtrl.getColumnGroupChild() != headerColumn;\n if (forOldColumn) {\n this.destroyBean(headerCtrl);\n headerCtrl = undefined;\n }\n if (headerCtrl == null) {\n switch (this.type) {\n case HeaderRowType.FLOATING_FILTER:\n headerCtrl = this.createBean(new HeaderFilterCellCtrl(headerColumn, this.beans, this));\n break;\n case HeaderRowType.COLUMN_GROUP:\n headerCtrl = this.createBean(new HeaderGroupCellCtrl(headerColumn, this.beans, this));\n break;\n default:\n headerCtrl = this.createBean(new HeaderCellCtrl(headerColumn, this.beans, this));\n break;\n }\n }\n this.headerCellCtrls.set(idOfChild, headerCtrl);\n };\n HeaderRowCtrl.prototype.getColumnsInViewport = function () {\n return this.isPrintLayout ? this.getColumnsInViewportPrintLayout() : this.getColumnsInViewportNormalLayout();\n };\n HeaderRowCtrl.prototype.getColumnsInViewportPrintLayout = function () {\n // for print layout, we add all columns into the center\n if (this.pinned != null) {\n return [];\n }\n var viewportColumns = [];\n var actualDepth = this.getActualDepth();\n var columnModel = this.beans.columnModel;\n ['left', null, 'right'].forEach(function (pinned) {\n var items = columnModel.getVirtualHeaderGroupRow(pinned, actualDepth);\n viewportColumns = viewportColumns.concat(items);\n });\n return viewportColumns;\n };\n HeaderRowCtrl.prototype.getActualDepth = function () {\n return this.type == HeaderRowType.FLOATING_FILTER ? this.rowIndex - 1 : this.rowIndex;\n };\n HeaderRowCtrl.prototype.getColumnsInViewportNormalLayout = function () {\n // when in normal layout, we add the columns for that container only\n return this.beans.columnModel.getVirtualHeaderGroupRow(this.pinned, this.getActualDepth());\n };\n HeaderRowCtrl.prototype.focusHeader = function (column, event) {\n if (!this.headerCellCtrls) {\n return false;\n }\n var allCtrls = Array.from(this.headerCellCtrls.values());\n var ctrl = allCtrls.find(function (ctrl) { return ctrl.getColumnGroupChild() == column; });\n if (!ctrl) {\n return false;\n }\n return ctrl.focus(event);\n };\n HeaderRowCtrl.prototype.destroy = function () {\n var _this = this;\n if (this.headerCellCtrls) {\n this.headerCellCtrls.forEach(function (ctrl) {\n _this.destroyBean(ctrl);\n });\n }\n this.headerCellCtrls = undefined;\n _super.prototype.destroy.call(this);\n };\n __decorate$1v([\n Autowired('beans')\n ], HeaderRowCtrl.prototype, \"beans\", void 0);\n __decorate$1v([\n PostConstruct\n ], HeaderRowCtrl.prototype, \"postConstruct\", null);\n return HeaderRowCtrl;\n}(BeanStub));\n\nvar __extends$1z = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1u = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$k = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$i = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar HeaderRowContainerCtrl = /** @class */ (function (_super) {\n __extends$1z(HeaderRowContainerCtrl, _super);\n function HeaderRowContainerCtrl(pinned) {\n var _this = _super.call(this) || this;\n _this.hidden = false;\n _this.includeFloatingFilter = false;\n _this.groupsRowCtrls = [];\n _this.pinned = pinned;\n return _this;\n }\n HeaderRowContainerCtrl.prototype.setComp = function (comp, eGui) {\n this.comp = comp;\n this.eViewport = eGui;\n this.setupCenterWidth();\n this.setupPinnedWidth();\n this.setupDragAndDrop(this.eViewport);\n this.addManagedListener(this.eventService, Events.EVENT_GRID_COLUMNS_CHANGED, this.onGridColumnsChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED, this.onDisplayedColumnsChanged.bind(this));\n this.ctrlsService.registerHeaderContainer(this, this.pinned);\n if (this.columnModel.isReady()) {\n this.refresh();\n }\n };\n HeaderRowContainerCtrl.prototype.setupDragAndDrop = function (dropContainer) {\n var bodyDropTarget = new BodyDropTarget(this.pinned, dropContainer);\n this.createManagedBean(bodyDropTarget);\n };\n HeaderRowContainerCtrl.prototype.refresh = function (keepColumns) {\n var _this = this;\n if (keepColumns === void 0) { keepColumns = false; }\n var sequence = new NumberSequence();\n var focusedHeaderPosition = this.focusService.getFocusHeaderToUseAfterRefresh();\n var refreshColumnGroups = function () {\n var groupRowCount = _this.columnModel.getHeaderRowCount() - 1;\n _this.groupsRowCtrls = _this.destroyBeans(_this.groupsRowCtrls);\n for (var i = 0; i < groupRowCount; i++) {\n var ctrl = _this.createBean(new HeaderRowCtrl(sequence.next(), _this.pinned, HeaderRowType.COLUMN_GROUP));\n _this.groupsRowCtrls.push(ctrl);\n }\n };\n var refreshColumns = function () {\n var rowIndex = sequence.next();\n var needNewInstance = !_this.hidden && (_this.columnsRowCtrl == null || !keepColumns || _this.columnsRowCtrl.getRowIndex() !== rowIndex);\n var shouldDestroyInstance = needNewInstance || _this.hidden;\n if (shouldDestroyInstance) {\n _this.columnsRowCtrl = _this.destroyBean(_this.columnsRowCtrl);\n }\n if (needNewInstance) {\n _this.columnsRowCtrl = _this.createBean(new HeaderRowCtrl(rowIndex, _this.pinned, HeaderRowType.COLUMN));\n }\n };\n var refreshFilters = function () {\n _this.includeFloatingFilter = _this.filterManager.hasFloatingFilters() && !_this.hidden;\n var destroyPreviousComp = function () {\n _this.filtersRowCtrl = _this.destroyBean(_this.filtersRowCtrl);\n };\n if (!_this.includeFloatingFilter) {\n destroyPreviousComp();\n return;\n }\n var rowIndex = sequence.next();\n if (_this.filtersRowCtrl) {\n var rowIndexMismatch = _this.filtersRowCtrl.getRowIndex() !== rowIndex;\n if (!keepColumns || rowIndexMismatch) {\n destroyPreviousComp();\n }\n }\n if (!_this.filtersRowCtrl) {\n _this.filtersRowCtrl = _this.createBean(new HeaderRowCtrl(rowIndex, _this.pinned, HeaderRowType.FLOATING_FILTER));\n }\n };\n refreshColumnGroups();\n refreshColumns();\n refreshFilters();\n var allCtrls = this.getAllCtrls();\n this.comp.setCtrls(allCtrls);\n this.restoreFocusOnHeader(focusedHeaderPosition);\n };\n HeaderRowContainerCtrl.prototype.restoreFocusOnHeader = function (position) {\n if (position == null || position.column.getPinned() != this.pinned) {\n return;\n }\n this.focusService.focusHeaderPosition({ headerPosition: position });\n };\n HeaderRowContainerCtrl.prototype.getAllCtrls = function () {\n var res = __spreadArray$i([], __read$k(this.groupsRowCtrls), false);\n if (this.columnsRowCtrl) {\n res.push(this.columnsRowCtrl);\n }\n if (this.filtersRowCtrl) {\n res.push(this.filtersRowCtrl);\n }\n return res;\n };\n // grid cols have changed - this also means the number of rows in the header can have\n // changed. so we remove all the old rows and insert new ones for a complete refresh\n HeaderRowContainerCtrl.prototype.onGridColumnsChanged = function () {\n this.refresh(true);\n };\n HeaderRowContainerCtrl.prototype.onDisplayedColumnsChanged = function () {\n var includeFloatingFilter = this.filterManager.hasFloatingFilters() && !this.hidden;\n if (this.includeFloatingFilter !== includeFloatingFilter) {\n this.refresh(true);\n }\n };\n HeaderRowContainerCtrl.prototype.setupCenterWidth = function () {\n var _this = this;\n if (this.pinned != null) {\n return;\n }\n this.createManagedBean(new CenterWidthFeature(function (width) { return _this.comp.setCenterWidth(\"\".concat(width, \"px\")); }, true));\n };\n HeaderRowContainerCtrl.prototype.setHorizontalScroll = function (offset) {\n this.comp.setViewportScrollLeft(offset);\n };\n HeaderRowContainerCtrl.prototype.setupPinnedWidth = function () {\n var _this = this;\n if (this.pinned == null) {\n return;\n }\n var pinningLeft = this.pinned === 'left';\n var pinningRight = this.pinned === 'right';\n this.hidden = true;\n var listener = function () {\n var width = pinningLeft ? _this.pinnedWidthService.getPinnedLeftWidth() : _this.pinnedWidthService.getPinnedRightWidth();\n if (width == null) {\n return;\n } // can happen at initialisation, width not yet set\n var hidden = (width == 0);\n var hiddenChanged = _this.hidden !== hidden;\n var isRtl = _this.gridOptionsService.get('enableRtl');\n var scrollbarWidth = _this.gridOptionsService.getScrollbarWidth();\n // if there is a scroll showing (and taking up space, so Windows, and not iOS)\n // in the body, then we add extra space to keep header aligned with the body,\n // as body width fits the cols and the scrollbar\n var addPaddingForScrollbar = _this.scrollVisibleService.isVerticalScrollShowing() && ((isRtl && pinningLeft) || (!isRtl && pinningRight));\n var widthWithPadding = addPaddingForScrollbar ? width + scrollbarWidth : width;\n _this.comp.setPinnedContainerWidth(\"\".concat(widthWithPadding, \"px\"));\n _this.comp.setDisplayed(!hidden);\n if (hiddenChanged) {\n _this.hidden = hidden;\n _this.refresh();\n }\n };\n this.addManagedListener(this.eventService, Events.EVENT_LEFT_PINNED_WIDTH_CHANGED, listener);\n this.addManagedListener(this.eventService, Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED, listener);\n this.addManagedListener(this.eventService, Events.EVENT_SCROLL_VISIBILITY_CHANGED, listener);\n this.addManagedListener(this.eventService, Events.EVENT_SCROLLBAR_WIDTH_CHANGED, listener);\n };\n HeaderRowContainerCtrl.prototype.getHeaderCtrlForColumn = function (column) {\n if (column instanceof Column) {\n if (!this.columnsRowCtrl) {\n return;\n }\n return this.columnsRowCtrl.getHeaderCellCtrl(column);\n }\n if (this.groupsRowCtrls.length === 0) {\n return;\n }\n for (var i = 0; i < this.groupsRowCtrls.length; i++) {\n var ctrl = this.groupsRowCtrls[i].getHeaderCellCtrl(column);\n if (ctrl) {\n return ctrl;\n }\n }\n };\n HeaderRowContainerCtrl.prototype.getHtmlElementForColumnHeader = function (column) {\n /* tslint:enable */\n var cellCtrl = this.getHeaderCtrlForColumn(column);\n if (!cellCtrl) {\n return null;\n }\n return cellCtrl.getGui();\n };\n HeaderRowContainerCtrl.prototype.getRowType = function (rowIndex) {\n var allCtrls = this.getAllCtrls();\n var ctrl = allCtrls[rowIndex];\n return ctrl ? ctrl.getType() : undefined;\n };\n HeaderRowContainerCtrl.prototype.focusHeader = function (rowIndex, column, event) {\n var allCtrls = this.getAllCtrls();\n var ctrl = allCtrls[rowIndex];\n if (!ctrl) {\n return false;\n }\n return ctrl.focusHeader(column, event);\n };\n HeaderRowContainerCtrl.prototype.getViewport = function () {\n return this.eViewport;\n };\n HeaderRowContainerCtrl.prototype.getRowCount = function () {\n return this.groupsRowCtrls.length + (this.columnsRowCtrl ? 1 : 0) + (this.filtersRowCtrl ? 1 : 0);\n };\n HeaderRowContainerCtrl.prototype.destroy = function () {\n if (this.filtersRowCtrl) {\n this.filtersRowCtrl = this.destroyBean(this.filtersRowCtrl);\n }\n if (this.columnsRowCtrl) {\n this.columnsRowCtrl = this.destroyBean(this.columnsRowCtrl);\n }\n if (this.groupsRowCtrls && this.groupsRowCtrls.length) {\n this.groupsRowCtrls = this.destroyBeans(this.groupsRowCtrls);\n }\n _super.prototype.destroy.call(this);\n };\n __decorate$1u([\n Autowired('ctrlsService')\n ], HeaderRowContainerCtrl.prototype, \"ctrlsService\", void 0);\n __decorate$1u([\n Autowired('scrollVisibleService')\n ], HeaderRowContainerCtrl.prototype, \"scrollVisibleService\", void 0);\n __decorate$1u([\n Autowired('pinnedWidthService')\n ], HeaderRowContainerCtrl.prototype, \"pinnedWidthService\", void 0);\n __decorate$1u([\n Autowired('columnModel')\n ], HeaderRowContainerCtrl.prototype, \"columnModel\", void 0);\n __decorate$1u([\n Autowired('focusService')\n ], HeaderRowContainerCtrl.prototype, \"focusService\", void 0);\n __decorate$1u([\n Autowired('filterManager')\n ], HeaderRowContainerCtrl.prototype, \"filterManager\", void 0);\n return HeaderRowContainerCtrl;\n}(BeanStub));\n\nvar __extends$1y = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1t = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar HeaderRowContainerComp = /** @class */ (function (_super) {\n __extends$1y(HeaderRowContainerComp, _super);\n function HeaderRowContainerComp(pinned) {\n var _this = _super.call(this) || this;\n _this.headerRowComps = {};\n _this.rowCompsList = [];\n _this.pinned = pinned;\n return _this;\n }\n HeaderRowContainerComp.prototype.init = function () {\n var _this = this;\n this.selectAndSetTemplate();\n var compProxy = {\n setDisplayed: function (displayed) { return _this.setDisplayed(displayed); },\n setCtrls: function (ctrls) { return _this.setCtrls(ctrls); },\n // only gets called for center section\n setCenterWidth: function (width) { return _this.eCenterContainer.style.width = width; },\n setViewportScrollLeft: function (left) { return _this.getGui().scrollLeft = left; },\n // only gets called for pinned sections\n setPinnedContainerWidth: function (width) {\n var eGui = _this.getGui();\n eGui.style.width = width;\n eGui.style.maxWidth = width;\n eGui.style.minWidth = width;\n }\n };\n var ctrl = this.createManagedBean(new HeaderRowContainerCtrl(this.pinned));\n ctrl.setComp(compProxy, this.getGui());\n };\n HeaderRowContainerComp.prototype.selectAndSetTemplate = function () {\n var pinnedLeft = this.pinned == 'left';\n var pinnedRight = this.pinned == 'right';\n var template = pinnedLeft ? HeaderRowContainerComp.PINNED_LEFT_TEMPLATE :\n pinnedRight ? HeaderRowContainerComp.PINNED_RIGHT_TEMPLATE : HeaderRowContainerComp.CENTER_TEMPLATE;\n this.setTemplate(template);\n // for left and right, we add rows directly to the root element,\n // but for center container we add elements to the child container.\n this.eRowContainer = this.eCenterContainer ? this.eCenterContainer : this.getGui();\n };\n HeaderRowContainerComp.prototype.destroyRowComps = function () {\n this.setCtrls([]);\n };\n HeaderRowContainerComp.prototype.destroyRowComp = function (rowComp) {\n this.destroyBean(rowComp);\n this.eRowContainer.removeChild(rowComp.getGui());\n };\n HeaderRowContainerComp.prototype.setCtrls = function (ctrls) {\n var _this = this;\n var oldRowComps = this.headerRowComps;\n this.headerRowComps = {};\n this.rowCompsList = [];\n var prevGui;\n var appendEnsuringDomOrder = function (rowComp) {\n var eGui = rowComp.getGui();\n var notAlreadyIn = eGui.parentElement != _this.eRowContainer;\n if (notAlreadyIn) {\n _this.eRowContainer.appendChild(eGui);\n }\n if (prevGui) {\n ensureDomOrder(_this.eRowContainer, eGui, prevGui);\n }\n prevGui = eGui;\n };\n ctrls.forEach(function (ctrl) {\n var ctrlId = ctrl.getInstanceId();\n var existingComp = oldRowComps[ctrlId];\n delete oldRowComps[ctrlId];\n var rowComp = existingComp ? existingComp : _this.createBean(new HeaderRowComp(ctrl));\n _this.headerRowComps[ctrlId] = rowComp;\n _this.rowCompsList.push(rowComp);\n appendEnsuringDomOrder(rowComp);\n });\n getAllValuesInObject(oldRowComps).forEach(function (c) { return _this.destroyRowComp(c); });\n };\n HeaderRowContainerComp.PINNED_LEFT_TEMPLATE = \"
\";\n HeaderRowContainerComp.PINNED_RIGHT_TEMPLATE = \"
\";\n HeaderRowContainerComp.CENTER_TEMPLATE = \"
\\n
\\n
\";\n __decorate$1t([\n RefSelector('eCenterContainer')\n ], HeaderRowContainerComp.prototype, \"eCenterContainer\", void 0);\n __decorate$1t([\n PostConstruct\n ], HeaderRowContainerComp.prototype, \"init\", null);\n __decorate$1t([\n PreDestroy\n ], HeaderRowContainerComp.prototype, \"destroyRowComps\", null);\n return HeaderRowContainerComp;\n}(Component));\n\nvar __extends$1x = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1s = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar HeaderNavigationDirection;\n(function (HeaderNavigationDirection) {\n HeaderNavigationDirection[HeaderNavigationDirection[\"UP\"] = 0] = \"UP\";\n HeaderNavigationDirection[HeaderNavigationDirection[\"DOWN\"] = 1] = \"DOWN\";\n HeaderNavigationDirection[HeaderNavigationDirection[\"LEFT\"] = 2] = \"LEFT\";\n HeaderNavigationDirection[HeaderNavigationDirection[\"RIGHT\"] = 3] = \"RIGHT\";\n})(HeaderNavigationDirection || (HeaderNavigationDirection = {}));\nvar HeaderNavigationService = /** @class */ (function (_super) {\n __extends$1x(HeaderNavigationService, _super);\n function HeaderNavigationService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.currentHeaderRowWithoutSpan = -1;\n return _this;\n }\n HeaderNavigationService.prototype.postConstruct = function () {\n var _this = this;\n this.ctrlsService.whenReady(function (p) {\n _this.gridBodyCon = p.gridBodyCtrl;\n });\n var eDocument = this.gridOptionsService.getDocument();\n this.addManagedListener(eDocument, 'mousedown', function () { return _this.setCurrentHeaderRowWithoutSpan(-1); });\n };\n HeaderNavigationService.prototype.getHeaderRowCount = function () {\n var centerHeaderContainer = this.ctrlsService.getHeaderRowContainerCtrl();\n return centerHeaderContainer ? centerHeaderContainer.getRowCount() : 0;\n };\n /*\n * This method navigates grid header vertically\n * @return {boolean} true to preventDefault on the event that caused this navigation.\n */\n HeaderNavigationService.prototype.navigateVertically = function (direction, fromHeader, event) {\n if (!fromHeader) {\n fromHeader = this.focusService.getFocusedHeader();\n }\n if (!fromHeader) {\n return false;\n }\n var headerRowIndex = fromHeader.headerRowIndex, column = fromHeader.column;\n var rowLen = this.getHeaderRowCount();\n var isUp = direction === HeaderNavigationDirection.UP;\n var _a = isUp\n ? this.headerPositionUtils.getColumnVisibleParent(column, headerRowIndex)\n : this.headerPositionUtils.getColumnVisibleChild(column, headerRowIndex), nextRow = _a.headerRowIndex, nextFocusColumn = _a.column, headerRowIndexWithoutSpan = _a.headerRowIndexWithoutSpan;\n var skipColumn = false;\n if (nextRow < 0) {\n nextRow = 0;\n nextFocusColumn = column;\n skipColumn = true;\n }\n if (nextRow >= rowLen) {\n nextRow = -1; // -1 indicates the focus should move to grid rows.\n this.setCurrentHeaderRowWithoutSpan(-1);\n }\n else if (headerRowIndexWithoutSpan !== undefined) {\n this.currentHeaderRowWithoutSpan = headerRowIndexWithoutSpan;\n }\n if (!skipColumn && !nextFocusColumn) {\n return false;\n }\n return this.focusService.focusHeaderPosition({\n headerPosition: { headerRowIndex: nextRow, column: nextFocusColumn },\n allowUserOverride: true,\n event: event\n });\n };\n HeaderNavigationService.prototype.setCurrentHeaderRowWithoutSpan = function (row) {\n this.currentHeaderRowWithoutSpan = row;\n };\n /*\n * This method navigates grid header horizontally\n * @return {boolean} true to preventDefault on the event that caused this navigation.\n */\n HeaderNavigationService.prototype.navigateHorizontally = function (direction, fromTab, event) {\n if (fromTab === void 0) { fromTab = false; }\n var focusedHeader = this.focusService.getFocusedHeader();\n var isLeft = direction === HeaderNavigationDirection.LEFT;\n var isRtl = this.gridOptionsService.get('enableRtl');\n var nextHeader;\n var normalisedDirection;\n // either navigating to the left or isRtl (cannot be both)\n if (this.currentHeaderRowWithoutSpan !== -1) {\n focusedHeader.headerRowIndex = this.currentHeaderRowWithoutSpan;\n }\n else {\n this.currentHeaderRowWithoutSpan = focusedHeader.headerRowIndex;\n }\n if (isLeft !== isRtl) {\n normalisedDirection = 'Before';\n nextHeader = this.headerPositionUtils.findHeader(focusedHeader, normalisedDirection);\n }\n else {\n normalisedDirection = 'After';\n nextHeader = this.headerPositionUtils.findHeader(focusedHeader, normalisedDirection);\n }\n if (nextHeader || !fromTab) {\n return this.focusService.focusHeaderPosition({\n headerPosition: nextHeader,\n direction: normalisedDirection,\n fromTab: fromTab,\n allowUserOverride: true,\n event: event\n });\n }\n return this.focusNextHeaderRow(focusedHeader, normalisedDirection, event);\n };\n HeaderNavigationService.prototype.focusNextHeaderRow = function (focusedHeader, direction, event) {\n var currentIndex = focusedHeader.headerRowIndex;\n var nextPosition = null;\n var nextRowIndex;\n if (direction === 'Before') {\n if (currentIndex > 0) {\n nextRowIndex = currentIndex - 1;\n this.currentHeaderRowWithoutSpan -= 1;\n nextPosition = this.headerPositionUtils.findColAtEdgeForHeaderRow(nextRowIndex, 'end');\n }\n }\n else {\n nextRowIndex = currentIndex + 1;\n if (this.currentHeaderRowWithoutSpan < this.getHeaderRowCount()) {\n this.currentHeaderRowWithoutSpan += 1;\n }\n else {\n this.setCurrentHeaderRowWithoutSpan(-1);\n }\n nextPosition = this.headerPositionUtils.findColAtEdgeForHeaderRow(nextRowIndex, 'start');\n }\n if (!nextPosition) {\n return false;\n }\n var _a = this.headerPositionUtils.getHeaderIndexToFocus(nextPosition.column, nextPosition === null || nextPosition === void 0 ? void 0 : nextPosition.headerRowIndex), column = _a.column, headerRowIndex = _a.headerRowIndex;\n return this.focusService.focusHeaderPosition({\n headerPosition: { column: column, headerRowIndex: headerRowIndex },\n direction: direction,\n fromTab: true,\n allowUserOverride: true,\n event: event\n });\n };\n HeaderNavigationService.prototype.scrollToColumn = function (column, direction) {\n if (direction === void 0) { direction = 'After'; }\n if (column.getPinned()) {\n return;\n }\n var columnToScrollTo;\n if (column instanceof ColumnGroup) {\n var columns = column.getDisplayedLeafColumns();\n columnToScrollTo = direction === 'Before' ? last(columns) : columns[0];\n }\n else {\n columnToScrollTo = column;\n }\n this.gridBodyCon.getScrollFeature().ensureColumnVisible(columnToScrollTo);\n };\n __decorate$1s([\n Autowired('focusService')\n ], HeaderNavigationService.prototype, \"focusService\", void 0);\n __decorate$1s([\n Autowired('headerPositionUtils')\n ], HeaderNavigationService.prototype, \"headerPositionUtils\", void 0);\n __decorate$1s([\n Autowired('ctrlsService')\n ], HeaderNavigationService.prototype, \"ctrlsService\", void 0);\n __decorate$1s([\n PostConstruct\n ], HeaderNavigationService.prototype, \"postConstruct\", null);\n HeaderNavigationService = __decorate$1s([\n Bean('headerNavigationService')\n ], HeaderNavigationService);\n return HeaderNavigationService;\n}(BeanStub));\n\nvar __extends$1w = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1r = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar GridHeaderCtrl = /** @class */ (function (_super) {\n __extends$1w(GridHeaderCtrl, _super);\n function GridHeaderCtrl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n GridHeaderCtrl.prototype.setComp = function (comp, eGui, eFocusableElement) {\n this.comp = comp;\n this.eGui = eGui;\n this.createManagedBean(new ManagedFocusFeature(eFocusableElement, {\n onTabKeyDown: this.onTabKeyDown.bind(this),\n handleKeyDown: this.handleKeyDown.bind(this),\n onFocusOut: this.onFocusOut.bind(this)\n }));\n // for setting ag-pivot-on / ag-pivot-off CSS classes\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.onPivotModeChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));\n this.onPivotModeChanged();\n this.setupHeaderHeight();\n var listener = this.onHeaderContextMenu.bind(this);\n this.addManagedListener(this.eGui, 'contextmenu', listener);\n this.mockContextMenuForIPad(listener);\n this.ctrlsService.registerGridHeaderCtrl(this);\n };\n GridHeaderCtrl.prototype.setupHeaderHeight = function () {\n var listener = this.setHeaderHeight.bind(this);\n listener();\n this.addManagedPropertyListener('headerHeight', listener);\n this.addManagedPropertyListener('pivotHeaderHeight', listener);\n this.addManagedPropertyListener('groupHeaderHeight', listener);\n this.addManagedPropertyListener('pivotGroupHeaderHeight', listener);\n this.addManagedPropertyListener('floatingFiltersHeight', listener);\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, listener);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED, listener);\n this.addManagedListener(this.eventService, Events.EVENT_GRID_STYLES_CHANGED, listener);\n this.addManagedListener(this.eventService, Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED, listener);\n };\n GridHeaderCtrl.prototype.getHeaderHeight = function () {\n return this.headerHeight;\n };\n GridHeaderCtrl.prototype.setHeaderHeight = function () {\n var columnModel = this.columnModel;\n var numberOfFloating = 0;\n var headerRowCount = columnModel.getHeaderRowCount();\n var totalHeaderHeight;\n var hasFloatingFilters = this.filterManager.hasFloatingFilters();\n if (hasFloatingFilters) {\n headerRowCount++;\n numberOfFloating = 1;\n }\n var groupHeight = this.columnModel.getColumnGroupHeaderRowHeight();\n var headerHeight = this.columnModel.getColumnHeaderRowHeight();\n var numberOfNonGroups = 1 + numberOfFloating;\n var numberOfGroups = headerRowCount - numberOfNonGroups;\n totalHeaderHeight = numberOfFloating * columnModel.getFloatingFiltersHeight();\n totalHeaderHeight += numberOfGroups * groupHeight;\n totalHeaderHeight += headerHeight;\n if (this.headerHeight === totalHeaderHeight) {\n return;\n }\n this.headerHeight = totalHeaderHeight;\n // one extra pixel is needed here to account for the\n // height of the border\n var px = \"\".concat(totalHeaderHeight + 1, \"px\");\n this.comp.setHeightAndMinHeight(px);\n this.eventService.dispatchEvent({\n type: Events.EVENT_HEADER_HEIGHT_CHANGED\n });\n };\n GridHeaderCtrl.prototype.onPivotModeChanged = function () {\n var pivotMode = this.columnModel.isPivotMode();\n this.comp.addOrRemoveCssClass('ag-pivot-on', pivotMode);\n this.comp.addOrRemoveCssClass('ag-pivot-off', !pivotMode);\n };\n GridHeaderCtrl.prototype.onDisplayedColumnsChanged = function () {\n var columns = this.columnModel.getAllDisplayedColumns();\n var shouldAllowOverflow = columns.some(function (col) { return col.isSpanHeaderHeight(); });\n this.comp.addOrRemoveCssClass('ag-header-allow-overflow', shouldAllowOverflow);\n };\n GridHeaderCtrl.prototype.onTabKeyDown = function (e) {\n var isRtl = this.gridOptionsService.get('enableRtl');\n var direction = e.shiftKey !== isRtl\n ? HeaderNavigationDirection.LEFT\n : HeaderNavigationDirection.RIGHT;\n if (this.headerNavigationService.navigateHorizontally(direction, true, e) ||\n this.focusService.focusNextGridCoreContainer(e.shiftKey)) {\n e.preventDefault();\n }\n };\n GridHeaderCtrl.prototype.handleKeyDown = function (e) {\n var direction = null;\n switch (e.key) {\n case KeyCode.LEFT:\n direction = HeaderNavigationDirection.LEFT;\n case KeyCode.RIGHT:\n if (!exists(direction)) {\n direction = HeaderNavigationDirection.RIGHT;\n }\n this.headerNavigationService.navigateHorizontally(direction, false, e);\n break;\n case KeyCode.UP:\n direction = HeaderNavigationDirection.UP;\n case KeyCode.DOWN:\n if (!exists(direction)) {\n direction = HeaderNavigationDirection.DOWN;\n }\n if (this.headerNavigationService.navigateVertically(direction, null, e)) {\n e.preventDefault();\n }\n break;\n default:\n return;\n }\n };\n GridHeaderCtrl.prototype.onFocusOut = function (e) {\n var eDocument = this.gridOptionsService.getDocument();\n var relatedTarget = e.relatedTarget;\n if (!relatedTarget && this.eGui.contains(eDocument.activeElement)) {\n return;\n }\n if (!this.eGui.contains(relatedTarget)) {\n this.focusService.clearFocusedHeader();\n }\n };\n GridHeaderCtrl.prototype.onHeaderContextMenu = function (mouseEvent, touch, touchEvent) {\n if ((!mouseEvent && !touchEvent) || !this.menuService.isHeaderContextMenuEnabled()) {\n return;\n }\n var target = (mouseEvent !== null && mouseEvent !== void 0 ? mouseEvent : touch).target;\n if (target === this.eGui || target === this.ctrlsService.getHeaderRowContainerCtrl().getViewport()) {\n this.menuService.showHeaderContextMenu(undefined, mouseEvent, touchEvent);\n }\n };\n GridHeaderCtrl.prototype.mockContextMenuForIPad = function (listener) {\n // we do NOT want this when not in iPad\n if (!isIOSUserAgent()) {\n return;\n }\n var touchListener = new TouchListener(this.eGui);\n var longTapListener = function (event) {\n listener(undefined, event.touchStart, event.touchEvent);\n };\n this.addManagedListener(touchListener, TouchListener.EVENT_LONG_TAP, longTapListener);\n this.addDestroyFunc(function () { return touchListener.destroy(); });\n };\n __decorate$1r([\n Autowired('headerNavigationService')\n ], GridHeaderCtrl.prototype, \"headerNavigationService\", void 0);\n __decorate$1r([\n Autowired('focusService')\n ], GridHeaderCtrl.prototype, \"focusService\", void 0);\n __decorate$1r([\n Autowired('columnModel')\n ], GridHeaderCtrl.prototype, \"columnModel\", void 0);\n __decorate$1r([\n Autowired('ctrlsService')\n ], GridHeaderCtrl.prototype, \"ctrlsService\", void 0);\n __decorate$1r([\n Autowired('filterManager')\n ], GridHeaderCtrl.prototype, \"filterManager\", void 0);\n __decorate$1r([\n Autowired('menuService')\n ], GridHeaderCtrl.prototype, \"menuService\", void 0);\n return GridHeaderCtrl;\n}(BeanStub));\n\nvar __extends$1v = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1q = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar GridHeaderComp = /** @class */ (function (_super) {\n __extends$1v(GridHeaderComp, _super);\n function GridHeaderComp() {\n return _super.call(this, GridHeaderComp.TEMPLATE) || this;\n }\n GridHeaderComp.prototype.postConstruct = function () {\n var _this = this;\n var compProxy = {\n addOrRemoveCssClass: function (cssClassName, on) { return _this.addOrRemoveCssClass(cssClassName, on); },\n setHeightAndMinHeight: function (height) {\n _this.getGui().style.height = height;\n _this.getGui().style.minHeight = height;\n }\n };\n var ctrl = this.createManagedBean(new GridHeaderCtrl());\n ctrl.setComp(compProxy, this.getGui(), this.getFocusableElement());\n var addContainer = function (container) {\n _this.createManagedBean(container);\n _this.appendChild(container);\n };\n addContainer(new HeaderRowContainerComp('left'));\n addContainer(new HeaderRowContainerComp(null));\n addContainer(new HeaderRowContainerComp('right'));\n };\n GridHeaderComp.TEMPLATE = \"
\";\n __decorate$1q([\n PostConstruct\n ], GridHeaderComp.prototype, \"postConstruct\", null);\n return GridHeaderComp;\n}(Component));\n\nvar __extends$1u = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1p = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar HorizontalResizeService = /** @class */ (function (_super) {\n __extends$1u(HorizontalResizeService, _super);\n function HorizontalResizeService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n HorizontalResizeService.prototype.addResizeBar = function (params) {\n var _this = this;\n var dragSource = {\n dragStartPixels: params.dragStartPixels || 0,\n eElement: params.eResizeBar,\n onDragStart: this.onDragStart.bind(this, params),\n onDragStop: this.onDragStop.bind(this, params),\n onDragging: this.onDragging.bind(this, params),\n includeTouch: true,\n stopPropagationForTouch: true\n };\n this.dragService.addDragSource(dragSource);\n // we pass remove func back to the caller, so call can tell us when they\n // are finished, and then we remove the listener from the drag source\n var finishedWithResizeFunc = function () { return _this.dragService.removeDragSource(dragSource); };\n return finishedWithResizeFunc;\n };\n HorizontalResizeService.prototype.onDragStart = function (params, mouseEvent) {\n this.dragStartX = mouseEvent.clientX;\n this.setResizeIcons();\n var shiftKey = mouseEvent instanceof MouseEvent && mouseEvent.shiftKey === true;\n params.onResizeStart(shiftKey);\n };\n HorizontalResizeService.prototype.setResizeIcons = function () {\n var ctrl = this.ctrlsService.getGridCtrl();\n // change the body cursor, so when drag moves out of the drag bar, the cursor is still 'resize' (or 'move'\n ctrl.setResizeCursor(true);\n // we don't want text selection outside the grid (otherwise it looks weird as text highlights when we move)\n ctrl.disableUserSelect(true);\n };\n HorizontalResizeService.prototype.onDragStop = function (params, mouseEvent) {\n params.onResizeEnd(this.resizeAmount);\n this.resetIcons();\n };\n HorizontalResizeService.prototype.resetIcons = function () {\n var ctrl = this.ctrlsService.getGridCtrl();\n ctrl.setResizeCursor(false);\n ctrl.disableUserSelect(false);\n };\n HorizontalResizeService.prototype.onDragging = function (params, mouseEvent) {\n this.resizeAmount = mouseEvent.clientX - this.dragStartX;\n params.onResizing(this.resizeAmount);\n };\n __decorate$1p([\n Autowired('dragService')\n ], HorizontalResizeService.prototype, \"dragService\", void 0);\n __decorate$1p([\n Autowired('ctrlsService')\n ], HorizontalResizeService.prototype, \"ctrlsService\", void 0);\n HorizontalResizeService = __decorate$1p([\n Bean('horizontalResizeService')\n ], HorizontalResizeService);\n return HorizontalResizeService;\n}(BeanStub));\n\nvar __extends$1t = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1o = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar StandardMenuFactory = /** @class */ (function (_super) {\n __extends$1t(StandardMenuFactory, _super);\n function StandardMenuFactory() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n StandardMenuFactory.prototype.hideActiveMenu = function () {\n if (this.hidePopup) {\n this.hidePopup();\n }\n };\n StandardMenuFactory.prototype.showMenuAfterMouseEvent = function (column, mouseEvent, containerType) {\n var _this = this;\n this.showPopup(column, function (eMenu) {\n _this.popupService.positionPopupUnderMouseEvent({\n column: column,\n type: containerType,\n mouseEvent: mouseEvent,\n ePopup: eMenu\n });\n }, containerType, mouseEvent.target, this.menuService.isLegacyMenuEnabled());\n };\n StandardMenuFactory.prototype.showMenuAfterButtonClick = function (column, eventSource, containerType) {\n var _this = this;\n var multiplier = -1;\n var alignSide = 'left';\n var isLegacyMenuEnabled = this.menuService.isLegacyMenuEnabled();\n if (!isLegacyMenuEnabled && this.gridOptionsService.get('enableRtl')) {\n multiplier = 1;\n alignSide = 'right';\n }\n var nudgeX = isLegacyMenuEnabled ? undefined : (4 * multiplier);\n var nudgeY = isLegacyMenuEnabled ? undefined : 4;\n this.showPopup(column, function (eMenu) {\n _this.popupService.positionPopupByComponent({\n type: containerType,\n eventSource: eventSource,\n ePopup: eMenu,\n nudgeX: nudgeX,\n nudgeY: nudgeY,\n alignSide: alignSide,\n keepWithinBounds: true,\n position: 'under',\n column: column,\n });\n }, containerType, eventSource, isLegacyMenuEnabled);\n };\n StandardMenuFactory.prototype.showPopup = function (column, positionCallback, containerType, eventSource, isLegacyMenuEnabled) {\n var _this = this;\n var filterWrapper = column ? this.filterManager.getOrCreateFilterWrapper(column, 'COLUMN_MENU') : undefined;\n if (!filterWrapper || !column) {\n throw new Error('AG Grid - unable to show popup filter, filter instantiation failed');\n }\n var eMenu = document.createElement('div');\n setAriaRole(eMenu, 'presentation');\n eMenu.classList.add('ag-menu');\n if (!isLegacyMenuEnabled) {\n eMenu.classList.add('ag-filter-menu');\n }\n this.tabListener = this.addManagedListener(eMenu, 'keydown', function (e) { return _this.trapFocusWithin(e, eMenu); });\n filterWrapper.guiPromise.then(function (gui) { return eMenu.appendChild(gui); });\n var hidePopup;\n var afterGuiDetached = function () { var _a; return (_a = filterWrapper.filterPromise) === null || _a === void 0 ? void 0 : _a.then(function (filter) { var _a; return (_a = filter === null || filter === void 0 ? void 0 : filter.afterGuiDetached) === null || _a === void 0 ? void 0 : _a.call(filter); }); };\n var anchorToElement = this.menuService.isColumnMenuAnchoringEnabled() ? (eventSource !== null && eventSource !== void 0 ? eventSource : this.ctrlsService.getGridBodyCtrl().getGui()) : undefined;\n var closedCallback = function (e) {\n column.setMenuVisible(false, 'contextMenu');\n var isKeyboardEvent = e instanceof KeyboardEvent;\n if (_this.tabListener) {\n _this.tabListener = _this.tabListener();\n }\n if (isKeyboardEvent && eventSource && isVisible(eventSource)) {\n var focusableEl = _this.focusService.findTabbableParent(eventSource);\n if (focusableEl) {\n focusableEl.focus();\n }\n }\n afterGuiDetached();\n _this.dispatchVisibleChangedEvent(false, containerType, column);\n };\n var translate = this.localeService.getLocaleTextFunc();\n var ariaLabel = isLegacyMenuEnabled && containerType !== 'columnFilter'\n ? translate('ariaLabelColumnMenu', 'Column Menu')\n : translate('ariaLabelColumnFilter', 'Column Filter');\n var addPopupRes = this.popupService.addPopup({\n modal: true,\n eChild: eMenu,\n closeOnEsc: true,\n closedCallback: closedCallback,\n positionCallback: function () { return positionCallback(eMenu); },\n anchorToElement: anchorToElement,\n ariaLabel: ariaLabel\n });\n if (addPopupRes) {\n this.hidePopup = hidePopup = addPopupRes.hideFunc;\n }\n filterWrapper.filterPromise.then(function (filter) {\n // need to make sure the filter is present before positioning, as only\n // after filter it is visible can we find out what the width of it is\n positionCallback(eMenu);\n if (filter.afterGuiAttached) {\n filter.afterGuiAttached({ container: containerType, hidePopup: hidePopup });\n }\n });\n column.setMenuVisible(true, 'contextMenu');\n this.dispatchVisibleChangedEvent(true, containerType, column);\n };\n StandardMenuFactory.prototype.trapFocusWithin = function (e, menu) {\n if (e.key !== KeyCode.TAB ||\n e.defaultPrevented ||\n this.focusService.findNextFocusableElement(menu, false, e.shiftKey)) {\n return;\n }\n e.preventDefault();\n this.focusService.focusInto(menu, e.shiftKey);\n };\n StandardMenuFactory.prototype.dispatchVisibleChangedEvent = function (visible, containerType, column) {\n var displayedEvent = {\n type: Events.EVENT_COLUMN_MENU_VISIBLE_CHANGED,\n visible: visible,\n switchingTab: false,\n key: containerType,\n column: column !== null && column !== void 0 ? column : null\n };\n this.eventService.dispatchEvent(displayedEvent);\n };\n StandardMenuFactory.prototype.isMenuEnabled = function (column) {\n var _a;\n // for standard, we show menu if filter is enabled, and the menu is not suppressed by passing an empty array\n return column.isFilterAllowed() && ((_a = column.getColDef().menuTabs) !== null && _a !== void 0 ? _a : ['filterMenuTab']).includes('filterMenuTab');\n };\n StandardMenuFactory.prototype.showMenuAfterContextMenuEvent = function () {\n // not supported in standard menu\n };\n __decorate$1o([\n Autowired('filterManager')\n ], StandardMenuFactory.prototype, \"filterManager\", void 0);\n __decorate$1o([\n Autowired('popupService')\n ], StandardMenuFactory.prototype, \"popupService\", void 0);\n __decorate$1o([\n Autowired('focusService')\n ], StandardMenuFactory.prototype, \"focusService\", void 0);\n __decorate$1o([\n Autowired('ctrlsService')\n ], StandardMenuFactory.prototype, \"ctrlsService\", void 0);\n __decorate$1o([\n Autowired('menuService')\n ], StandardMenuFactory.prototype, \"menuService\", void 0);\n StandardMenuFactory = __decorate$1o([\n Bean('filterMenuFactory')\n ], StandardMenuFactory);\n return StandardMenuFactory;\n}(BeanStub));\n\nvar __extends$1s = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1n = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar TabGuardClassNames;\n(function (TabGuardClassNames) {\n TabGuardClassNames[\"TAB_GUARD\"] = \"ag-tab-guard\";\n TabGuardClassNames[\"TAB_GUARD_TOP\"] = \"ag-tab-guard-top\";\n TabGuardClassNames[\"TAB_GUARD_BOTTOM\"] = \"ag-tab-guard-bottom\";\n})(TabGuardClassNames || (TabGuardClassNames = {}));\nvar TabGuardCtrl = /** @class */ (function (_super) {\n __extends$1s(TabGuardCtrl, _super);\n function TabGuardCtrl(params) {\n var _this = _super.call(this) || this;\n _this.skipTabGuardFocus = false;\n _this.forcingFocusOut = false;\n var comp = params.comp, eTopGuard = params.eTopGuard, eBottomGuard = params.eBottomGuard, focusTrapActive = params.focusTrapActive, forceFocusOutWhenTabGuardsAreEmpty = params.forceFocusOutWhenTabGuardsAreEmpty, focusInnerElement = params.focusInnerElement, onFocusIn = params.onFocusIn, onFocusOut = params.onFocusOut, shouldStopEventPropagation = params.shouldStopEventPropagation, onTabKeyDown = params.onTabKeyDown, handleKeyDown = params.handleKeyDown, eFocusableElement = params.eFocusableElement;\n _this.comp = comp;\n _this.eTopGuard = eTopGuard;\n _this.eBottomGuard = eBottomGuard;\n _this.providedFocusInnerElement = focusInnerElement;\n _this.eFocusableElement = eFocusableElement;\n _this.focusTrapActive = !!focusTrapActive;\n _this.forceFocusOutWhenTabGuardsAreEmpty = !!forceFocusOutWhenTabGuardsAreEmpty;\n _this.providedFocusIn = onFocusIn;\n _this.providedFocusOut = onFocusOut;\n _this.providedShouldStopEventPropagation = shouldStopEventPropagation;\n _this.providedOnTabKeyDown = onTabKeyDown;\n _this.providedHandleKeyDown = handleKeyDown;\n return _this;\n }\n TabGuardCtrl.prototype.postConstruct = function () {\n var _this = this;\n this.createManagedBean(new ManagedFocusFeature(this.eFocusableElement, {\n shouldStopEventPropagation: function () { return _this.shouldStopEventPropagation(); },\n onTabKeyDown: function (e) { return _this.onTabKeyDown(e); },\n handleKeyDown: function (e) { return _this.handleKeyDown(e); },\n onFocusIn: function (e) { return _this.onFocusIn(e); },\n onFocusOut: function (e) { return _this.onFocusOut(e); }\n }));\n this.activateTabGuards();\n [this.eTopGuard, this.eBottomGuard].forEach(function (guard) { return _this.addManagedListener(guard, 'focus', _this.onFocus.bind(_this)); });\n };\n TabGuardCtrl.prototype.handleKeyDown = function (e) {\n if (this.providedHandleKeyDown) {\n this.providedHandleKeyDown(e);\n }\n };\n TabGuardCtrl.prototype.tabGuardsAreActive = function () {\n return !!this.eTopGuard && this.eTopGuard.hasAttribute('tabIndex');\n };\n TabGuardCtrl.prototype.shouldStopEventPropagation = function () {\n if (this.providedShouldStopEventPropagation) {\n return this.providedShouldStopEventPropagation();\n }\n return false;\n };\n TabGuardCtrl.prototype.activateTabGuards = function () {\n // Do not activate tabs while focus is being forced out\n if (this.forcingFocusOut) {\n return;\n }\n var tabIndex = this.gridOptionsService.get('tabIndex');\n this.comp.setTabIndex(tabIndex.toString());\n };\n TabGuardCtrl.prototype.deactivateTabGuards = function () {\n this.comp.setTabIndex();\n };\n TabGuardCtrl.prototype.onFocus = function (e) {\n if (this.skipTabGuardFocus) {\n this.skipTabGuardFocus = false;\n return;\n }\n // when there are no focusable items within the TabGuard, focus gets stuck\n // in the TabGuard itself and has nowhere to go, so we need to manually find\n // the closest element to focus by calling `forceFocusOutWhenTabGuardAreEmpty`.\n if (this.forceFocusOutWhenTabGuardsAreEmpty) {\n var isEmpty = this.focusService.findFocusableElements(this.eFocusableElement, '.ag-tab-guard').length === 0;\n if (isEmpty) {\n this.findNextElementOutsideAndFocus(e.target === this.eBottomGuard);\n return;\n }\n }\n var fromBottom = e.target === this.eBottomGuard;\n if (this.providedFocusInnerElement) {\n this.providedFocusInnerElement(fromBottom);\n }\n else {\n this.focusInnerElement(fromBottom);\n }\n };\n TabGuardCtrl.prototype.findNextElementOutsideAndFocus = function (up) {\n var eDocument = this.gridOptionsService.getDocument();\n var focusableEls = this.focusService.findFocusableElements(eDocument.body, null, true);\n var index = focusableEls.indexOf(up ? this.eTopGuard : this.eBottomGuard);\n if (index === -1) {\n return;\n }\n var start;\n var end;\n if (up) {\n start = 0;\n end = index;\n }\n else {\n start = index + 1;\n end = focusableEls.length;\n }\n var focusableRange = focusableEls.slice(start, end);\n var targetTabIndex = this.gridOptionsService.get('tabIndex');\n focusableRange.sort(function (a, b) {\n var indexA = parseInt(a.getAttribute('tabindex') || '0');\n var indexB = parseInt(b.getAttribute('tabindex') || '0');\n if (indexB === targetTabIndex) {\n return 1;\n }\n if (indexA === targetTabIndex) {\n return -1;\n }\n if (indexA === 0) {\n return 1;\n }\n if (indexB === 0) {\n return -1;\n }\n return indexA - indexB;\n });\n focusableRange[up ? (focusableRange.length - 1) : 0].focus();\n };\n TabGuardCtrl.prototype.onFocusIn = function (e) {\n if (this.focusTrapActive) {\n return;\n }\n if (this.providedFocusIn) {\n this.providedFocusIn(e);\n }\n this.deactivateTabGuards();\n };\n TabGuardCtrl.prototype.onFocusOut = function (e) {\n if (this.focusTrapActive) {\n return;\n }\n if (this.providedFocusOut) {\n this.providedFocusOut(e);\n }\n if (!this.eFocusableElement.contains(e.relatedTarget)) {\n this.activateTabGuards();\n }\n };\n TabGuardCtrl.prototype.onTabKeyDown = function (e) {\n var _this = this;\n if (this.providedOnTabKeyDown) {\n this.providedOnTabKeyDown(e);\n return;\n }\n if (this.focusTrapActive) {\n return;\n }\n if (e.defaultPrevented) {\n return;\n }\n var tabGuardsAreActive = this.tabGuardsAreActive();\n if (tabGuardsAreActive) {\n this.deactivateTabGuards();\n }\n var nextRoot = this.getNextFocusableElement(e.shiftKey);\n if (tabGuardsAreActive) {\n // ensure the tab guards are only re-instated once the event has finished processing, to avoid the browser\n // tabbing to the tab guard from inside the component\n setTimeout(function () { return _this.activateTabGuards(); }, 0);\n }\n if (!nextRoot) {\n return;\n }\n nextRoot.focus();\n e.preventDefault();\n };\n TabGuardCtrl.prototype.focusInnerElement = function (fromBottom) {\n if (fromBottom === void 0) { fromBottom = false; }\n var focusable = this.focusService.findFocusableElements(this.eFocusableElement);\n if (this.tabGuardsAreActive()) {\n // remove tab guards from this component from list of focusable elements\n focusable.splice(0, 1);\n focusable.splice(focusable.length - 1, 1);\n }\n if (!focusable.length) {\n return;\n }\n focusable[fromBottom ? focusable.length - 1 : 0].focus({ preventScroll: true });\n };\n TabGuardCtrl.prototype.getNextFocusableElement = function (backwards) {\n return this.focusService.findNextFocusableElement(this.eFocusableElement, false, backwards);\n };\n TabGuardCtrl.prototype.forceFocusOutOfContainer = function (up) {\n var _this = this;\n if (up === void 0) { up = false; }\n // avoid multiple calls to `forceFocusOutOfContainer`\n if (this.forcingFocusOut) {\n return;\n }\n var tabGuardToFocus = up ? this.eTopGuard : this.eBottomGuard;\n this.activateTabGuards();\n this.skipTabGuardFocus = true;\n this.forcingFocusOut = true;\n // this focus will set `this.skipTabGuardFocus` to false;\n tabGuardToFocus.focus();\n window.setTimeout(function () {\n _this.forcingFocusOut = false;\n _this.activateTabGuards();\n });\n };\n TabGuardCtrl.prototype.isTabGuard = function (element) {\n return element === this.eTopGuard || element === this.eBottomGuard;\n };\n __decorate$1n([\n Autowired('focusService')\n ], TabGuardCtrl.prototype, \"focusService\", void 0);\n __decorate$1n([\n PostConstruct\n ], TabGuardCtrl.prototype, \"postConstruct\", null);\n return TabGuardCtrl;\n}(BeanStub));\n\nvar __extends$1r = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __read$j = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$h = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar TabGuardComp = /** @class */ (function (_super) {\n __extends$1r(TabGuardComp, _super);\n function TabGuardComp() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TabGuardComp.prototype.initialiseTabGuard = function (params) {\n this.eTopGuard = this.createTabGuard('top');\n this.eBottomGuard = this.createTabGuard('bottom');\n this.eFocusableElement = this.getFocusableElement();\n var tabGuards = [this.eTopGuard, this.eBottomGuard];\n var compProxy = {\n setTabIndex: function (tabIndex) {\n tabGuards.forEach(function (tabGuard) { return tabIndex != null ? tabGuard.setAttribute('tabindex', tabIndex) : tabGuard.removeAttribute('tabindex'); });\n }\n };\n this.addTabGuards(this.eTopGuard, this.eBottomGuard);\n this.tabGuardCtrl = this.createManagedBean(new TabGuardCtrl({\n comp: compProxy,\n focusTrapActive: !!params.focusTrapActive,\n eTopGuard: this.eTopGuard,\n eBottomGuard: this.eBottomGuard,\n eFocusableElement: this.eFocusableElement,\n onFocusIn: params.onFocusIn,\n onFocusOut: params.onFocusOut,\n focusInnerElement: params.focusInnerElement,\n handleKeyDown: params.handleKeyDown,\n onTabKeyDown: params.onTabKeyDown,\n shouldStopEventPropagation: params.shouldStopEventPropagation,\n forceFocusOutWhenTabGuardsAreEmpty: params.forceFocusOutWhenTabGuardsAreEmpty\n }));\n };\n TabGuardComp.prototype.createTabGuard = function (side) {\n var tabGuard = document.createElement('div');\n var cls = side === 'top' ? TabGuardClassNames.TAB_GUARD_TOP : TabGuardClassNames.TAB_GUARD_BOTTOM;\n tabGuard.classList.add(TabGuardClassNames.TAB_GUARD, cls);\n setAriaRole(tabGuard, 'presentation');\n return tabGuard;\n };\n TabGuardComp.prototype.addTabGuards = function (topTabGuard, bottomTabGuard) {\n this.eFocusableElement.insertAdjacentElement('afterbegin', topTabGuard);\n this.eFocusableElement.insertAdjacentElement('beforeend', bottomTabGuard);\n };\n TabGuardComp.prototype.removeAllChildrenExceptTabGuards = function () {\n var tabGuards = [this.eTopGuard, this.eBottomGuard];\n clearElement(this.getFocusableElement());\n this.addTabGuards.apply(this, __spreadArray$h([], __read$j(tabGuards), false));\n };\n TabGuardComp.prototype.forceFocusOutOfContainer = function (up) {\n if (up === void 0) { up = false; }\n this.tabGuardCtrl.forceFocusOutOfContainer(up);\n };\n TabGuardComp.prototype.appendChild = function (newChild, container) {\n if (!isNodeOrElement(newChild)) {\n newChild = newChild.getGui();\n }\n var bottomTabGuard = this.eBottomGuard;\n if (bottomTabGuard) {\n bottomTabGuard.insertAdjacentElement('beforebegin', newChild);\n }\n else {\n _super.prototype.appendChild.call(this, newChild, container);\n }\n };\n return TabGuardComp;\n}(Component));\n\nvar __extends$1q = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1m = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar TabbedLayout = /** @class */ (function (_super) {\n __extends$1q(TabbedLayout, _super);\n function TabbedLayout(params) {\n var _this = _super.call(this, TabbedLayout.getTemplate(params.cssClass)) || this;\n _this.items = [];\n _this.tabbedItemScrollMap = new Map();\n _this.params = params;\n if (params.items) {\n params.items.forEach(function (item) { return _this.addItem(item); });\n }\n return _this;\n }\n TabbedLayout.prototype.postConstruct = function () {\n var _this = this;\n this.initialiseTabGuard({\n onTabKeyDown: this.onTabKeyDown.bind(this),\n handleKeyDown: this.handleKeyDown.bind(this),\n focusInnerElement: this.focusInnerElement.bind(this),\n focusTrapActive: true\n });\n this.addDestroyFunc(function () { var _a, _b, _c; return (_c = (_b = (_a = _this.activeItem) === null || _a === void 0 ? void 0 : _a.tabbedItem) === null || _b === void 0 ? void 0 : _b.afterDetachedCallback) === null || _c === void 0 ? void 0 : _c.call(_b); });\n };\n TabbedLayout.getTemplate = function (cssClass) {\n return /* html */ \"
\\n
\\n
\\n
\");\n };\n TabbedLayout.prototype.handleKeyDown = function (e) {\n var eDocument = this.gridOptionsService.getDocument();\n switch (e.key) {\n case KeyCode.RIGHT:\n case KeyCode.LEFT:\n if (!this.eHeader.contains(eDocument.activeElement)) {\n return;\n }\n var isRightKey = e.key === KeyCode.RIGHT;\n var isRtl = this.gridOptionsService.get('enableRtl');\n var currentPosition = this.items.indexOf(this.activeItem);\n var nextPosition = isRightKey !== isRtl ? Math.min(currentPosition + 1, this.items.length - 1) : Math.max(currentPosition - 1, 0);\n if (currentPosition === nextPosition) {\n return;\n }\n e.preventDefault();\n var nextItem = this.items[nextPosition];\n this.showItemWrapper(nextItem);\n nextItem.eHeaderButton.focus();\n break;\n case KeyCode.UP:\n case KeyCode.DOWN:\n e.stopPropagation();\n break;\n }\n };\n TabbedLayout.prototype.onTabKeyDown = function (e) {\n if (e.defaultPrevented) {\n return;\n }\n var _a = this, focusService = _a.focusService, eHeader = _a.eHeader, eBody = _a.eBody, activeItem = _a.activeItem;\n var eDocument = this.gridOptionsService.getDocument();\n var activeElement = eDocument.activeElement;\n var target = e.target;\n e.preventDefault();\n if (eHeader.contains(activeElement)) {\n // focus is in header, move into body of popup\n this.focusBody(e.shiftKey);\n return;\n }\n var nextEl = null;\n if (focusService.isTargetUnderManagedComponent(eBody, target)) {\n if (e.shiftKey) {\n nextEl = this.focusService.findFocusableElementBeforeTabGuard(eBody, target);\n }\n if (!nextEl) {\n nextEl = activeItem.eHeaderButton;\n }\n }\n if (!nextEl && eBody.contains(activeElement)) {\n nextEl = focusService.findNextFocusableElement(eBody, false, e.shiftKey);\n if (!nextEl) {\n this.focusHeader();\n }\n }\n if (nextEl) {\n nextEl.focus();\n }\n };\n TabbedLayout.prototype.focusInnerElement = function (fromBottom) {\n if (fromBottom) {\n this.focusHeader();\n }\n else {\n this.focusBody(true);\n }\n };\n TabbedLayout.prototype.focusHeader = function () {\n this.activeItem.eHeaderButton.focus();\n };\n TabbedLayout.prototype.focusBody = function (fromBottom) {\n this.focusService.focusInto(this.eBody, fromBottom);\n };\n TabbedLayout.prototype.setAfterAttachedParams = function (params) {\n this.afterAttachedParams = params;\n };\n TabbedLayout.prototype.showFirstItem = function () {\n if (this.items.length > 0) {\n this.showItemWrapper(this.items[0]);\n }\n };\n TabbedLayout.prototype.addItem = function (item) {\n var eHeaderButton = document.createElement('span');\n setAriaRole(eHeaderButton, 'tab');\n eHeaderButton.setAttribute('tabindex', '-1');\n eHeaderButton.appendChild(item.title);\n eHeaderButton.classList.add('ag-tab');\n this.eHeader.appendChild(eHeaderButton);\n setAriaLabel(eHeaderButton, item.titleLabel);\n var wrapper = {\n tabbedItem: item,\n eHeaderButton: eHeaderButton\n };\n this.items.push(wrapper);\n eHeaderButton.addEventListener('click', this.showItemWrapper.bind(this, wrapper));\n };\n TabbedLayout.prototype.showItem = function (tabbedItem) {\n var itemWrapper = this.items.find(function (wrapper) { return wrapper.tabbedItem === tabbedItem; });\n if (itemWrapper) {\n this.showItemWrapper(itemWrapper);\n }\n };\n TabbedLayout.prototype.showItemWrapper = function (wrapper) {\n var _this = this;\n var _a, _b, _c, _d, _e, _f;\n var tabbedItem = wrapper.tabbedItem, eHeaderButton = wrapper.eHeaderButton;\n (_b = (_a = this.params).onItemClicked) === null || _b === void 0 ? void 0 : _b.call(_a, { item: tabbedItem });\n if (this.activeItem === wrapper) {\n (_d = (_c = this.params).onActiveItemClicked) === null || _d === void 0 ? void 0 : _d.call(_c);\n return;\n }\n if (this.lastScrollListener) {\n this.lastScrollListener = this.lastScrollListener();\n }\n clearElement(this.eBody);\n tabbedItem.bodyPromise.then(function (body) {\n _this.eBody.appendChild(body);\n var onlyUnmanaged = !_this.focusService.isKeyboardMode();\n _this.focusService.focusInto(_this.eBody, false, onlyUnmanaged);\n if (tabbedItem.afterAttachedCallback) {\n tabbedItem.afterAttachedCallback(_this.afterAttachedParams);\n }\n if (_this.params.keepScrollPosition) {\n var scrollableContainer_1 = (tabbedItem.getScrollableContainer && tabbedItem.getScrollableContainer()) || body;\n _this.lastScrollListener = _this.addManagedListener(scrollableContainer_1, 'scroll', function () {\n _this.tabbedItemScrollMap.set(tabbedItem.name, scrollableContainer_1.scrollTop);\n });\n var scrollPosition_1 = _this.tabbedItemScrollMap.get(tabbedItem.name);\n if (scrollPosition_1 !== undefined) {\n // Safari needs a small timeout or it will fire a scroll event to position 0\n setTimeout(function () {\n scrollableContainer_1.scrollTop = scrollPosition_1;\n }, 0);\n }\n }\n });\n if (this.activeItem) {\n this.activeItem.eHeaderButton.classList.remove('ag-tab-selected');\n (_f = (_e = this.activeItem.tabbedItem).afterDetachedCallback) === null || _f === void 0 ? void 0 : _f.call(_e);\n }\n eHeaderButton.classList.add('ag-tab-selected');\n this.activeItem = wrapper;\n };\n __decorate$1m([\n Autowired('focusService')\n ], TabbedLayout.prototype, \"focusService\", void 0);\n __decorate$1m([\n RefSelector('eHeader')\n ], TabbedLayout.prototype, \"eHeader\", void 0);\n __decorate$1m([\n RefSelector('eBody')\n ], TabbedLayout.prototype, \"eBody\", void 0);\n __decorate$1m([\n PostConstruct\n ], TabbedLayout.prototype, \"postConstruct\", null);\n return TabbedLayout;\n}(TabGuardComp));\n\nvar __extends$1p = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1l = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar DEBOUNCE_DELAY = 50;\nvar ResizeObserverService = /** @class */ (function (_super) {\n __extends$1p(ResizeObserverService, _super);\n function ResizeObserverService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.polyfillFunctions = [];\n return _this;\n }\n ResizeObserverService.prototype.observeResize = function (element, callback) {\n var _this = this;\n var win = this.gridOptionsService.getWindow();\n var useBrowserResizeObserver = function () {\n var resizeObserver = new win.ResizeObserver(callback);\n resizeObserver.observe(element);\n return function () { return resizeObserver.disconnect(); };\n };\n var usePolyfill = function () {\n var _a, _b;\n // initialise to the current width and height, so first call will have no changes\n var widthLastTime = (_a = element === null || element === void 0 ? void 0 : element.clientWidth) !== null && _a !== void 0 ? _a : 0;\n var heightLastTime = (_b = element === null || element === void 0 ? void 0 : element.clientHeight) !== null && _b !== void 0 ? _b : 0;\n // when finished, this gets turned to false.\n var running = true;\n var periodicallyCheckWidthAndHeight = function () {\n var _a, _b;\n if (running) {\n var newWidth = (_a = element === null || element === void 0 ? void 0 : element.clientWidth) !== null && _a !== void 0 ? _a : 0;\n var newHeight = (_b = element === null || element === void 0 ? void 0 : element.clientHeight) !== null && _b !== void 0 ? _b : 0;\n var changed = newWidth !== widthLastTime || newHeight !== heightLastTime;\n if (changed) {\n widthLastTime = newWidth;\n heightLastTime = newHeight;\n callback();\n }\n _this.doNextPolyfillTurn(periodicallyCheckWidthAndHeight);\n }\n };\n periodicallyCheckWidthAndHeight();\n // the callback function we return sets running to false\n return function () { return running = false; };\n };\n var suppressResize = this.gridOptionsService.get('suppressBrowserResizeObserver');\n var resizeObserverExists = !!win.ResizeObserver;\n if (resizeObserverExists && !suppressResize) {\n return useBrowserResizeObserver();\n }\n return this.getFrameworkOverrides().wrapIncoming(function () { return usePolyfill(); }, 'resize-observer');\n };\n ResizeObserverService.prototype.doNextPolyfillTurn = function (func) {\n this.polyfillFunctions.push(func);\n this.schedulePolyfill();\n };\n ResizeObserverService.prototype.schedulePolyfill = function () {\n var _this = this;\n if (this.polyfillScheduled) {\n return;\n }\n var executeAllFuncs = function () {\n var funcs = _this.polyfillFunctions;\n // make sure set scheduled to false and clear clear array\n // before executing the funcs, as the funcs could add more funcs\n _this.polyfillScheduled = false;\n _this.polyfillFunctions = [];\n funcs.forEach(function (f) { return f(); });\n };\n this.polyfillScheduled = true;\n window.setTimeout(executeAllFuncs, DEBOUNCE_DELAY);\n };\n ResizeObserverService = __decorate$1l([\n Bean('resizeObserverService')\n ], ResizeObserverService);\n return ResizeObserverService;\n}(BeanStub));\n\nvar __extends$1o = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1k = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AnimationFrameService = /** @class */ (function (_super) {\n __extends$1o(AnimationFrameService, _super);\n function AnimationFrameService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n // p1 and p2 are create tasks are to do with row and cell creation.\n // for them we want to execute according to row order, so we use\n // TaskItem so we know what index the item is for.\n _this.createTasksP1 = { list: [], sorted: false }; // eg drawing back-ground of rows\n _this.createTasksP2 = { list: [], sorted: false }; // eg cell renderers, adding hover functionality\n // destroy tasks are to do with row removal. they are done after row creation as the user will need to see new\n // rows first (as blank is scrolled into view), when we remove the old rows (no longer in view) is not as\n // important.\n _this.destroyTasks = [];\n _this.ticking = false;\n // we need to know direction of scroll, to build up rows in the direction of\n // the scroll. eg if user scrolls down, we extend the rows by building down.\n _this.scrollGoingDown = true;\n _this.lastPage = 0;\n _this.lastScrollTop = 0;\n _this.taskCount = 0;\n _this.cancelledTasks = new Set();\n return _this;\n }\n AnimationFrameService.prototype.setScrollTop = function (scrollTop) {\n var isPaginationActive = this.gridOptionsService.get('pagination');\n this.scrollGoingDown = scrollTop >= this.lastScrollTop;\n if (isPaginationActive && scrollTop === 0) {\n var currentPage = this.paginationProxy.getCurrentPage();\n if (currentPage !== this.lastPage) {\n this.lastPage = currentPage;\n this.scrollGoingDown = true;\n }\n }\n this.lastScrollTop = scrollTop;\n };\n AnimationFrameService.prototype.init = function () {\n this.useAnimationFrame = !this.gridOptionsService.get('suppressAnimationFrame');\n };\n AnimationFrameService.prototype.isOn = function () {\n return this.useAnimationFrame;\n };\n // this method is for our AG Grid sanity only - if animation frames are turned off,\n // then no place in the code should be looking to add any work to be done in animation\n // frames. this stops bugs - where some code is asking for a frame to be executed\n // when it should not.\n AnimationFrameService.prototype.verifyAnimationFrameOn = function (methodName) {\n if (this.useAnimationFrame === false) {\n console.warn(\"AG Grid: AnimationFrameService.\".concat(methodName, \" called but animation frames are off\"));\n }\n };\n AnimationFrameService.prototype.createTask = function (task, index, list) {\n this.verifyAnimationFrameOn(list);\n var taskItem = { task: task, index: index, createOrder: ++this.taskCount };\n this.addTaskToList(this[list], taskItem);\n this.schedule();\n };\n AnimationFrameService.prototype.cancelTask = function (task) {\n this.cancelledTasks.add(task);\n };\n AnimationFrameService.prototype.addTaskToList = function (taskList, task) {\n taskList.list.push(task);\n taskList.sorted = false;\n };\n AnimationFrameService.prototype.sortTaskList = function (taskList) {\n if (taskList.sorted) {\n return;\n }\n var sortDirection = this.scrollGoingDown ? 1 : -1;\n // sort first by row index (taking into account scroll direction), then by\n // order of task creation (always ascending, so cells will render left-to-right)\n taskList.list.sort(function (a, b) { return a.index !== b.index ? sortDirection * (b.index - a.index) : b.createOrder - a.createOrder; });\n taskList.sorted = true;\n };\n AnimationFrameService.prototype.addDestroyTask = function (task) {\n this.verifyAnimationFrameOn('createTasksP3');\n this.destroyTasks.push(task);\n this.schedule();\n };\n AnimationFrameService.prototype.executeFrame = function (millis) {\n this.verifyAnimationFrameOn('executeFrame');\n var p1TaskList = this.createTasksP1;\n var p1Tasks = p1TaskList.list;\n var p2TaskList = this.createTasksP2;\n var p2Tasks = p2TaskList.list;\n var destroyTasks = this.destroyTasks;\n var frameStart = new Date().getTime();\n var duration = (new Date().getTime()) - frameStart;\n // 16ms is 60 fps\n var noMaxMillis = millis <= 0;\n var gridBodyCon = this.ctrlsService.getGridBodyCtrl();\n while (noMaxMillis || duration < millis) {\n var gridBodyDidSomething = gridBodyCon.getScrollFeature().scrollGridIfNeeded();\n if (!gridBodyDidSomething) {\n var task = void 0;\n if (p1Tasks.length) {\n this.sortTaskList(p1TaskList);\n task = p1Tasks.pop().task;\n }\n else if (p2Tasks.length) {\n this.sortTaskList(p2TaskList);\n task = p2Tasks.pop().task;\n }\n else if (destroyTasks.length) {\n task = destroyTasks.pop();\n }\n else {\n this.cancelledTasks.clear();\n break;\n }\n if (!this.cancelledTasks.has(task)) {\n task();\n }\n }\n duration = (new Date().getTime()) - frameStart;\n }\n if (p1Tasks.length || p2Tasks.length || destroyTasks.length) {\n this.requestFrame();\n }\n else {\n this.stopTicking();\n }\n };\n AnimationFrameService.prototype.stopTicking = function () {\n this.ticking = false;\n };\n AnimationFrameService.prototype.flushAllFrames = function () {\n if (!this.useAnimationFrame) {\n return;\n }\n this.executeFrame(-1);\n };\n AnimationFrameService.prototype.schedule = function () {\n if (!this.useAnimationFrame) {\n return;\n }\n if (!this.ticking) {\n this.ticking = true;\n this.requestFrame();\n }\n };\n AnimationFrameService.prototype.requestFrame = function () {\n // check for the existence of requestAnimationFrame, and if\n // it's missing, then we polyfill it with setTimeout()\n var callback = this.executeFrame.bind(this, 60);\n this.requestAnimationFrame(callback);\n };\n AnimationFrameService.prototype.requestAnimationFrame = function (callback) {\n var win = this.gridOptionsService.getWindow();\n if (win.requestAnimationFrame) {\n win.requestAnimationFrame(callback);\n }\n else if (win.webkitRequestAnimationFrame) {\n win.webkitRequestAnimationFrame(callback);\n }\n else {\n win.setTimeout(callback, 0);\n }\n };\n AnimationFrameService.prototype.isQueueEmpty = function () {\n return !this.ticking;\n };\n // a debounce utility used for parts of the app involved with rendering.\n // the advantage over normal debounce is the client can call flushAllFrames()\n // to make sure all rendering is complete. we don't wait any milliseconds,\n // as this is intended to batch calls in one VM turn.\n AnimationFrameService.prototype.debounce = function (func) {\n var _this = this;\n var pending = false;\n return function () {\n if (!_this.isOn()) {\n window.setTimeout(func, 0);\n return;\n }\n if (pending) {\n return;\n }\n pending = true;\n _this.addDestroyTask(function () {\n pending = false;\n func();\n });\n };\n };\n __decorate$1k([\n Autowired('ctrlsService')\n ], AnimationFrameService.prototype, \"ctrlsService\", void 0);\n __decorate$1k([\n Autowired('paginationProxy')\n ], AnimationFrameService.prototype, \"paginationProxy\", void 0);\n __decorate$1k([\n PostConstruct\n ], AnimationFrameService.prototype, \"init\", null);\n AnimationFrameService = __decorate$1k([\n Bean('animationFrameService')\n ], AnimationFrameService);\n return AnimationFrameService;\n}(BeanStub));\n\nvar ClientSideRowModelSteps;\n(function (ClientSideRowModelSteps) {\n ClientSideRowModelSteps[\"EVERYTHING\"] = \"group\";\n ClientSideRowModelSteps[\"FILTER\"] = \"filter\";\n ClientSideRowModelSteps[\"SORT\"] = \"sort\";\n ClientSideRowModelSteps[\"MAP\"] = \"map\";\n ClientSideRowModelSteps[\"AGGREGATE\"] = \"aggregate\";\n ClientSideRowModelSteps[\"FILTER_AGGREGATES\"] = \"filter_aggregates\";\n ClientSideRowModelSteps[\"PIVOT\"] = \"pivot\";\n ClientSideRowModelSteps[\"NOTHING\"] = \"nothing\";\n})(ClientSideRowModelSteps || (ClientSideRowModelSteps = {}));\n\nvar __extends$1n = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1j = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ExpansionService = /** @class */ (function (_super) {\n __extends$1n(ExpansionService, _super);\n function ExpansionService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ExpansionService.prototype.postConstruct = function () {\n this.isClientSideRowModel = this.rowModel.getType() === 'clientSide';\n };\n ExpansionService.prototype.expandRows = function (rowIds) {\n if (!this.isClientSideRowModel) {\n return;\n }\n var rowIdSet = new Set(rowIds);\n this.rowModel.forEachNode(function (node) {\n if (node.id && rowIdSet.has(node.id)) {\n node.expanded = true;\n }\n });\n this.onGroupExpandedOrCollapsed();\n };\n ExpansionService.prototype.getExpandedRows = function () {\n var expandedRows = [];\n this.rowModel.forEachNode(function (_a) {\n var expanded = _a.expanded, id = _a.id;\n if (expanded && id) {\n expandedRows.push(id);\n }\n });\n return expandedRows;\n };\n ExpansionService.prototype.expandAll = function (value) {\n if (!this.isClientSideRowModel) {\n return;\n }\n this.rowModel.expandOrCollapseAll(value);\n };\n ExpansionService.prototype.setRowNodeExpanded = function (rowNode, expanded, expandParents) {\n if (rowNode) {\n // expand all parents recursively, except root node.\n if (expandParents && rowNode.parent && rowNode.parent.level !== -1) {\n this.setRowNodeExpanded(rowNode.parent, expanded, expandParents);\n }\n rowNode.setExpanded(expanded);\n }\n };\n ExpansionService.prototype.onGroupExpandedOrCollapsed = function () {\n if (!this.isClientSideRowModel) {\n return;\n }\n // we don't really want the user calling this if only one rowNode was expanded, instead they should be\n // calling rowNode.setExpanded(boolean) - this way we do a 'keepRenderedRows=false' so that the whole\n // grid gets refreshed again - otherwise the row with the rowNodes that were changed won't get updated,\n // and thus the expand icon in the group cell won't get 'opened' or 'closed'.\n this.rowModel.refreshModel({ step: ClientSideRowModelSteps.MAP });\n };\n __decorate$1j([\n Autowired('rowModel')\n ], ExpansionService.prototype, \"rowModel\", void 0);\n __decorate$1j([\n PostConstruct\n ], ExpansionService.prototype, \"postConstruct\", null);\n ExpansionService = __decorate$1j([\n Bean('expansionService')\n ], ExpansionService);\n return ExpansionService;\n}(BeanStub));\n\nvar __extends$1m = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1i = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar MenuService = /** @class */ (function (_super) {\n __extends$1m(MenuService, _super);\n function MenuService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MenuService.prototype.postConstruct = function () {\n var _a;\n this.activeMenuFactory = (_a = this.enterpriseMenuFactory) !== null && _a !== void 0 ? _a : this.filterMenuFactory;\n };\n MenuService.prototype.showColumnMenu = function (params) {\n this.showColumnMenuCommon(this.activeMenuFactory, params, 'columnMenu');\n };\n MenuService.prototype.showFilterMenu = function (params) {\n var menuFactory = this.enterpriseMenuFactory && this.isLegacyMenuEnabled()\n ? this.enterpriseMenuFactory\n : this.filterMenuFactory;\n this.showColumnMenuCommon(menuFactory, params, params.containerType, true);\n };\n MenuService.prototype.showHeaderContextMenu = function (column, mouseEvent, touchEvent) {\n this.activeMenuFactory.showMenuAfterContextMenuEvent(column, mouseEvent, touchEvent);\n };\n MenuService.prototype.showContextMenu = function (params) {\n var _a, _b, _c;\n var column = params.column, anchorToElement = params.anchorToElement, rowNode = params.rowNode, value = params.value;\n (_a = this.contextMenuFactory) === null || _a === void 0 ? void 0 : _a.onContextMenu((_b = params.mouseEvent) !== null && _b !== void 0 ? _b : null, (_c = params.touchEvent) !== null && _c !== void 0 ? _c : null, rowNode !== null && rowNode !== void 0 ? rowNode : null, column !== null && column !== void 0 ? column : null, value, anchorToElement);\n };\n MenuService.prototype.showColumnChooser = function (params) {\n var _a;\n (_a = this.columnChooserFactory) === null || _a === void 0 ? void 0 : _a.showColumnChooser(params);\n };\n MenuService.prototype.hidePopupMenu = function () {\n var _a;\n // hide the context menu if in enterprise\n (_a = this.contextMenuFactory) === null || _a === void 0 ? void 0 : _a.hideActiveMenu();\n // and hide the column menu always\n this.activeMenuFactory.hideActiveMenu();\n };\n MenuService.prototype.hideColumnChooser = function () {\n var _a;\n (_a = this.columnChooserFactory) === null || _a === void 0 ? void 0 : _a.hideActiveColumnChooser();\n };\n MenuService.prototype.isColumnMenuInHeaderEnabled = function (column) {\n var _a = column.getColDef(), suppressMenu = _a.suppressMenu, suppressHeaderMenuButton = _a.suppressHeaderMenuButton;\n var isSuppressMenuButton = suppressHeaderMenuButton !== null && suppressHeaderMenuButton !== void 0 ? suppressHeaderMenuButton : suppressMenu;\n return !isSuppressMenuButton && this.activeMenuFactory.isMenuEnabled(column) && (this.isLegacyMenuEnabled() || !!this.enterpriseMenuFactory);\n };\n MenuService.prototype.isFilterMenuInHeaderEnabled = function (column) {\n return !column.getColDef().suppressHeaderFilterButton && this.filterManager.isFilterAllowed(column);\n };\n MenuService.prototype.isHeaderContextMenuEnabled = function (column) {\n return !(column === null || column === void 0 ? void 0 : column.getColDef().suppressHeaderContextMenu) && this.getColumnMenuType() === 'new';\n };\n MenuService.prototype.isHeaderMenuButtonAlwaysShowEnabled = function () {\n return this.isSuppressMenuHide();\n };\n MenuService.prototype.isHeaderMenuButtonEnabled = function () {\n // we don't show the menu if on an iPad/iPhone, as the user cannot have a pointer device/\n // However if suppressMenuHide is set to true the menu will be displayed alwasys, so it's ok\n // to show it on iPad in this case (as hover isn't needed). If suppressMenuHide\n // is false (default) user will need to use longpress to display the menu.\n var menuHides = !this.isSuppressMenuHide();\n var onIpadAndMenuHides = isIOSUserAgent() && menuHides;\n return !onIpadAndMenuHides;\n };\n MenuService.prototype.isHeaderFilterButtonEnabled = function (column) {\n return this.isFilterMenuInHeaderEnabled(column) && !this.isLegacyMenuEnabled() && !this.isFloatingFilterButtonDisplayed(column);\n };\n MenuService.prototype.isFilterMenuItemEnabled = function (column) {\n return this.filterManager.isFilterAllowed(column) && !this.isLegacyMenuEnabled() &&\n !this.isFilterMenuInHeaderEnabled(column) && !this.isFloatingFilterButtonDisplayed(column);\n };\n MenuService.prototype.isColumnMenuAnchoringEnabled = function () {\n return !this.isLegacyMenuEnabled();\n };\n MenuService.prototype.areAdditionalColumnMenuItemsEnabled = function () {\n return this.getColumnMenuType() === 'new';\n };\n MenuService.prototype.isLegacyMenuEnabled = function () {\n return this.getColumnMenuType() === 'legacy';\n };\n MenuService.prototype.isFloatingFilterButtonEnabled = function (column) {\n var _a;\n var colDef = column.getColDef();\n var legacySuppressFilterButton = (_a = colDef.floatingFilterComponentParams) === null || _a === void 0 ? void 0 : _a.suppressFilterButton;\n if (legacySuppressFilterButton != null) {\n warnOnce(\"As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead.\");\n }\n return colDef.suppressFloatingFilterButton == null ? !legacySuppressFilterButton : !colDef.suppressFloatingFilterButton;\n };\n MenuService.prototype.getColumnMenuType = function () {\n var _a;\n return (_a = this.gridOptionsService.get('columnMenu')) !== null && _a !== void 0 ? _a : 'legacy';\n };\n MenuService.prototype.isFloatingFilterButtonDisplayed = function (column) {\n return !!column.getColDef().floatingFilter && this.isFloatingFilterButtonEnabled(column);\n };\n MenuService.prototype.isSuppressMenuHide = function () {\n var suppressMenuHide = this.gridOptionsService.get('suppressMenuHide');\n if (this.isLegacyMenuEnabled()) {\n return suppressMenuHide;\n }\n else {\n // default to true for new\n return this.gridOptionsService.exists('suppressMenuHide') ? suppressMenuHide : true;\n }\n };\n MenuService.prototype.showColumnMenuCommon = function (menuFactory, params, containerType, filtersOnly) {\n var _this = this;\n var column = params.column, positionBy = params.positionBy;\n if (positionBy === 'button') {\n var buttonElement = params.buttonElement;\n menuFactory.showMenuAfterButtonClick(column, buttonElement, containerType, filtersOnly);\n }\n else if (positionBy === 'mouse') {\n var mouseEvent = params.mouseEvent;\n menuFactory.showMenuAfterMouseEvent(column, mouseEvent, containerType, filtersOnly);\n }\n else if (column) {\n // auto\n this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(column, 'auto');\n // make sure we've finished scrolling into view before displaying the menu\n this.animationFrameService.requestAnimationFrame(function () {\n var headerCellCtrl = _this.ctrlsService.getHeaderRowContainerCtrl(column.getPinned()).getHeaderCtrlForColumn(column);\n menuFactory.showMenuAfterButtonClick(column, headerCellCtrl.getAnchorElementForMenu(filtersOnly), containerType, true);\n });\n }\n };\n __decorate$1i([\n Optional('enterpriseMenuFactory')\n ], MenuService.prototype, \"enterpriseMenuFactory\", void 0);\n __decorate$1i([\n Autowired('filterMenuFactory')\n ], MenuService.prototype, \"filterMenuFactory\", void 0);\n __decorate$1i([\n Optional('contextMenuFactory')\n ], MenuService.prototype, \"contextMenuFactory\", void 0);\n __decorate$1i([\n Autowired('ctrlsService')\n ], MenuService.prototype, \"ctrlsService\", void 0);\n __decorate$1i([\n Autowired('animationFrameService')\n ], MenuService.prototype, \"animationFrameService\", void 0);\n __decorate$1i([\n Optional('columnChooserFactory')\n ], MenuService.prototype, \"columnChooserFactory\", void 0);\n __decorate$1i([\n Autowired('filterManager')\n ], MenuService.prototype, \"filterManager\", void 0);\n __decorate$1i([\n PostConstruct\n ], MenuService.prototype, \"postConstruct\", null);\n MenuService = __decorate$1i([\n Bean('menuService')\n ], MenuService);\n return MenuService;\n}(BeanStub));\n\nvar __extends$1l = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1h = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AutoWidthCalculator = /** @class */ (function (_super) {\n __extends$1l(AutoWidthCalculator, _super);\n function AutoWidthCalculator() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AutoWidthCalculator.prototype.postConstruct = function () {\n var _this = this;\n this.ctrlsService.whenReady(function (p) {\n _this.centerRowContainerCtrl = p.centerRowContainerCtrl;\n });\n };\n // this is the trick: we create a dummy container and clone all the cells\n // into the dummy, then check the dummy's width. then destroy the dummy\n // as we don't need it any more.\n // drawback: only the cells visible on the screen are considered\n AutoWidthCalculator.prototype.getPreferredWidthForColumn = function (column, skipHeader) {\n var eHeaderCell = this.getHeaderCellForColumn(column);\n // cell isn't visible\n if (!eHeaderCell) {\n return -1;\n }\n var elements = this.rowRenderer.getAllCellsForColumn(column);\n if (!skipHeader) {\n // we only consider the lowest level cell, not the group cell. in 99% of the time, this\n // will be enough. if we consider groups, then it gets too complicated for what it's worth,\n // as the groups can span columns and this class only considers one column at a time.\n elements.push(eHeaderCell);\n }\n return this.addElementsToContainerAndGetWidth(elements);\n };\n AutoWidthCalculator.prototype.getPreferredWidthForColumnGroup = function (columnGroup) {\n var eHeaderCell = this.getHeaderCellForColumn(columnGroup);\n if (!eHeaderCell) {\n return -1;\n }\n return this.addElementsToContainerAndGetWidth([eHeaderCell]);\n };\n AutoWidthCalculator.prototype.addElementsToContainerAndGetWidth = function (elements) {\n var _this = this;\n // this element has to be a form, otherwise form elements within a cell\n // will be validated while being cloned. This can cause issues such as \n // radio buttons being reset and losing their values.\n var eDummyContainer = document.createElement('form');\n // position fixed, so it isn't restricted to the boundaries of the parent\n eDummyContainer.style.position = 'fixed';\n // we put the dummy into the body container, so it will inherit all the\n // css styles that the real cells are inheriting\n var eBodyContainer = this.centerRowContainerCtrl.getContainerElement();\n elements.forEach(function (el) { return _this.cloneItemIntoDummy(el, eDummyContainer); });\n // only append the dummyContainer to the DOM after it contains all the necessary items\n eBodyContainer.appendChild(eDummyContainer);\n // at this point, all the clones are lined up vertically with natural widths. the dummy\n // container will have a width wide enough just to fit the largest.\n var dummyContainerWidth = eDummyContainer.offsetWidth;\n // we are finished with the dummy container, so get rid of it\n eBodyContainer.removeChild(eDummyContainer);\n // we add padding as I found sometimes the gui still put '...' after some of the texts. so the\n // user can configure the grid to add a few more pixels after the calculated width\n var autoSizePadding = this.getAutoSizePadding();\n return dummyContainerWidth + autoSizePadding;\n };\n AutoWidthCalculator.prototype.getAutoSizePadding = function () {\n return this.gridOptionsService.get('autoSizePadding');\n };\n AutoWidthCalculator.prototype.getHeaderCellForColumn = function (column) {\n /* tslint:enable */\n var element = null;\n this.ctrlsService.getHeaderRowContainerCtrls().forEach(function (container) {\n var res = container.getHtmlElementForColumnHeader(column);\n if (res != null) {\n element = res;\n }\n });\n return element;\n };\n AutoWidthCalculator.prototype.cloneItemIntoDummy = function (eCell, eDummyContainer) {\n // make a deep clone of the cell\n var eCellClone = eCell.cloneNode(true);\n // the original has a fixed width, we remove this to allow the natural width based on content\n eCellClone.style.width = '';\n // the original has position = absolute, we need to remove this so it's positioned normally\n eCellClone.style.position = 'static';\n eCellClone.style.left = '';\n // we put the cell into a containing div, as otherwise the cells would just line up\n // on the same line, standard flow layout, by putting them into divs, they are laid\n // out one per line\n var eCloneParent = document.createElement('div');\n var eCloneParentClassList = eCloneParent.classList;\n var isHeader = ['ag-header-cell', 'ag-header-group-cell'].some(function (cls) { return eCellClone.classList.contains(cls); });\n if (isHeader) {\n eCloneParentClassList.add('ag-header', 'ag-header-row');\n eCloneParent.style.position = 'static';\n }\n else {\n eCloneParentClassList.add('ag-row');\n }\n // find parent using classes (headers have ag-header-cell, rows have ag-row), and copy classes from it.\n // if we didn't do this, things like ag-row-level-2 would be missing if present, which sets indents\n // onto group items.\n var pointer = eCell.parentElement;\n while (pointer) {\n var isRow = ['ag-header-row', 'ag-row'].some(function (cls) { return pointer.classList.contains(cls); });\n if (isRow) {\n for (var i = 0; i < pointer.classList.length; i++) {\n var item = pointer.classList[i];\n // we skip ag-row-position-absolute, as this has structural CSS applied that stops the\n // element from fitting into it's parent, and we need the element to stretch the parent\n // as we are measuring the parents width\n if (item != 'ag-row-position-absolute') {\n eCloneParentClassList.add(item);\n }\n }\n break;\n }\n pointer = pointer.parentElement;\n }\n // the twig on the branch, the branch on the tree, the tree in the hole,\n // the hole in the bog, the bog in the clone, the clone in the parent,\n // the parent in the dummy, and the dummy down in the vall-e-ooo, OOOOOOOOO! Oh row the rattling bog....\n eCloneParent.appendChild(eCellClone);\n eDummyContainer.appendChild(eCloneParent);\n };\n __decorate$1h([\n Autowired('rowRenderer')\n ], AutoWidthCalculator.prototype, \"rowRenderer\", void 0);\n __decorate$1h([\n Autowired('ctrlsService')\n ], AutoWidthCalculator.prototype, \"ctrlsService\", void 0);\n __decorate$1h([\n Autowired('rowCssClassCalculator')\n ], AutoWidthCalculator.prototype, \"rowCssClassCalculator\", void 0);\n __decorate$1h([\n PostConstruct\n ], AutoWidthCalculator.prototype, \"postConstruct\", null);\n AutoWidthCalculator = __decorate$1h([\n Bean('autoWidthCalculator')\n ], AutoWidthCalculator);\n return AutoWidthCalculator;\n}(BeanStub));\n\nvar __extends$1k = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1g = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __values$4 = ( false) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$i = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$g = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar StickyRowFeature = /** @class */ (function (_super) {\n __extends$1k(StickyRowFeature, _super);\n function StickyRowFeature(createRowCon, destroyRowCtrls) {\n var _this = _super.call(this) || this;\n _this.createRowCon = createRowCon;\n _this.destroyRowCtrls = destroyRowCtrls;\n _this.stickyRowCtrls = [];\n _this.containerHeight = 0;\n return _this;\n }\n StickyRowFeature.prototype.postConstruct = function () {\n var _this = this;\n this.isClientSide = this.rowModel.getType() === 'clientSide';\n this.ctrlsService.whenReady(function (params) {\n _this.gridBodyCtrl = params.gridBodyCtrl;\n });\n };\n StickyRowFeature.prototype.getStickyRowCtrls = function () {\n return this.stickyRowCtrls;\n };\n StickyRowFeature.prototype.checkStickyRows = function () {\n var _this = this;\n var height = 0;\n if (!this.gridOptionsService.isGroupRowsSticky()) {\n return this.refreshNodesAndContainerHeight([], height);\n }\n var stickyRows = [];\n var firstPixel = this.rowRenderer.getFirstVisibleVerticalPixel();\n var addStickyRow = function (stickyRow) {\n var _a, _b, _c;\n stickyRows.push(stickyRow);\n var lastChildBottom;\n if (_this.isClientSide) {\n var lastAncestor = stickyRow;\n while (lastAncestor.isExpandable() && lastAncestor.expanded) {\n if (lastAncestor.master) {\n lastAncestor = lastAncestor.detailNode;\n }\n else if (lastAncestor.childrenAfterSort) {\n // Tree Data will have `childrenAfterSort` without any nodes, but\n // the current node will still be marked as expansible.\n if (lastAncestor.childrenAfterSort.length === 0) {\n break;\n }\n lastAncestor = last(lastAncestor.childrenAfterSort);\n }\n }\n lastChildBottom = lastAncestor.rowTop + lastAncestor.rowHeight;\n }\n // if the rowModel is `serverSide` as only `clientSide` and `serverSide` create this feature.\n else {\n if (stickyRow.master) {\n lastChildBottom = stickyRow.detailNode.rowTop + stickyRow.detailNode.rowHeight;\n }\n else {\n var storeBounds = (_a = stickyRow.childStore) === null || _a === void 0 ? void 0 : _a.getStoreBounds();\n lastChildBottom = ((_b = storeBounds === null || storeBounds === void 0 ? void 0 : storeBounds.heightPx) !== null && _b !== void 0 ? _b : 0) + ((_c = storeBounds === null || storeBounds === void 0 ? void 0 : storeBounds.topPx) !== null && _c !== void 0 ? _c : 0);\n }\n }\n var stickRowBottom = firstPixel + height + stickyRow.rowHeight;\n if (lastChildBottom < stickRowBottom) {\n stickyRow.stickyRowTop = height + (lastChildBottom - stickRowBottom);\n }\n else {\n stickyRow.stickyRowTop = height;\n }\n height = 0;\n stickyRows.forEach(function (rowNode) {\n var thisRowLastPx = rowNode.stickyRowTop + rowNode.rowHeight;\n if (height < thisRowLastPx) {\n height = thisRowLastPx;\n }\n });\n };\n var counter = 0;\n while (true) {\n var firstPixelAfterStickyRows = firstPixel + height;\n var firstIndex = this.rowModel.getRowIndexAtPixel(firstPixelAfterStickyRows);\n var firstRow = this.rowModel.getRow(firstIndex);\n if (firstRow == null) {\n break;\n }\n // only happens when pivoting, and we are showing root node\n if (firstRow.level < 0) {\n break;\n }\n // added logic to break out of the loop when the row calculation\n // changes while rows are becoming sticky (happens with auto height)\n if (counter++ === 100) {\n break;\n }\n var parents = [];\n var p = firstRow.parent;\n while (p.level >= 0) {\n parents.push(p);\n p = p.parent;\n }\n var firstMissingParent = parents.reverse().find(function (parent) { return stickyRows.indexOf(parent) < 0 && parent.displayed; });\n if (firstMissingParent) {\n addStickyRow(firstMissingParent);\n continue;\n }\n // if first row is an open group, and practically shown, it needs\n // to be stuck\n if (firstRow.isExpandable() && firstRow.expanded && firstRow.rowTop < firstPixelAfterStickyRows) {\n addStickyRow(firstRow);\n continue;\n }\n break;\n }\n return this.refreshNodesAndContainerHeight(stickyRows, height);\n };\n StickyRowFeature.prototype.refreshStickyNode = function (stickRowNode) {\n var allStickyNodes = [];\n for (var i = 0; i < this.stickyRowCtrls.length; i++) {\n var currentNode = this.stickyRowCtrls[i].getRowNode();\n if (currentNode !== stickRowNode) {\n allStickyNodes.push(currentNode);\n }\n }\n if (this.refreshNodesAndContainerHeight(allStickyNodes, this.containerHeight)) {\n this.checkStickyRows();\n }\n };\n StickyRowFeature.prototype.refreshNodesAndContainerHeight = function (allStickyNodes, height) {\n var e_1, _a, _b;\n var _this = this;\n var stickyRowsChanged = false;\n var removedCtrls = this.stickyRowCtrls.filter(function (ctrl) { return allStickyNodes.indexOf(ctrl.getRowNode()) === -1; });\n var addedNodes = allStickyNodes.filter(function (rowNode) { return _this.stickyRowCtrls.findIndex(function (ctrl) { return ctrl.getRowNode() === rowNode; }) === -1; });\n if (removedCtrls.length || addedNodes.length) {\n stickyRowsChanged = true;\n }\n var ctrlsToDestroy = {};\n removedCtrls.forEach(function (removedCtrl) {\n ctrlsToDestroy[removedCtrl.getRowNode().id] = removedCtrl;\n _this.stickyRowCtrls = _this.stickyRowCtrls.filter(function (ctrl) { return ctrl !== removedCtrl; });\n });\n try {\n for (var _c = __values$4(Object.values(ctrlsToDestroy)), _d = _c.next(); !_d.done; _d = _c.next()) {\n var ctrl = _d.value;\n ctrl.getRowNode().sticky = false;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n }\n finally { if (e_1) throw e_1.error; }\n }\n this.destroyRowCtrls(ctrlsToDestroy, false);\n var newCtrls = addedNodes.map(function (rowNode) {\n rowNode.sticky = true;\n return _this.createRowCon(rowNode, false, false);\n });\n (_b = this.stickyRowCtrls).push.apply(_b, __spreadArray$g([], __read$i(newCtrls), false));\n this.stickyRowCtrls.forEach(function (ctrl) { return ctrl.setRowTop(ctrl.getRowNode().stickyRowTop); });\n this.stickyRowCtrls.sort(function (a, b) { return b.getRowNode().rowIndex - a.getRowNode().rowIndex; });\n if (this.containerHeight !== height) {\n this.containerHeight = height;\n this.gridBodyCtrl.setStickyTopHeight(height);\n stickyRowsChanged = true;\n }\n return stickyRowsChanged;\n };\n __decorate$1g([\n Autowired(\"rowModel\")\n ], StickyRowFeature.prototype, \"rowModel\", void 0);\n __decorate$1g([\n Autowired(\"rowRenderer\")\n ], StickyRowFeature.prototype, \"rowRenderer\", void 0);\n __decorate$1g([\n Autowired(\"ctrlsService\")\n ], StickyRowFeature.prototype, \"ctrlsService\", void 0);\n __decorate$1g([\n PostConstruct\n ], StickyRowFeature.prototype, \"postConstruct\", null);\n return StickyRowFeature;\n}(BeanStub));\n\nvar __extends$1j = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1f = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$h = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$f = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar __values$3 = ( false) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar RowRenderer = /** @class */ (function (_super) {\n __extends$1j(RowRenderer, _super);\n function RowRenderer() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.destroyFuncsForColumnListeners = [];\n // map of row ids to row objects. keeps track of which elements\n // are rendered for which rows in the dom.\n _this.rowCtrlsByRowIndex = {};\n _this.zombieRowCtrls = {};\n _this.allRowCtrls = [];\n _this.topRowCtrls = [];\n _this.bottomRowCtrls = [];\n // we only allow one refresh at a time, otherwise the internal memory structure here\n // will get messed up. this can happen if the user has a cellRenderer, and inside the\n // renderer they call an API method that results in another pass of the refresh,\n // then it will be trying to draw rows in the middle of a refresh.\n _this.refreshInProgress = false;\n _this.dataFirstRenderedFired = false;\n _this.setupRangeSelectionListeners = function () {\n var onRangeSelectionChanged = function () {\n _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.onRangeSelectionChanged(); });\n };\n var onColumnMovedPinnedVisible = function () {\n _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.updateRangeBordersIfRangeCount(); });\n };\n var addRangeSelectionListeners = function () {\n _this.eventService.addEventListener(Events.EVENT_RANGE_SELECTION_CHANGED, onRangeSelectionChanged);\n _this.eventService.addEventListener(Events.EVENT_COLUMN_MOVED, onColumnMovedPinnedVisible);\n _this.eventService.addEventListener(Events.EVENT_COLUMN_PINNED, onColumnMovedPinnedVisible);\n _this.eventService.addEventListener(Events.EVENT_COLUMN_VISIBLE, onColumnMovedPinnedVisible);\n };\n var removeRangeSelectionListeners = function () {\n _this.eventService.removeEventListener(Events.EVENT_RANGE_SELECTION_CHANGED, onRangeSelectionChanged);\n _this.eventService.removeEventListener(Events.EVENT_COLUMN_MOVED, onColumnMovedPinnedVisible);\n _this.eventService.removeEventListener(Events.EVENT_COLUMN_PINNED, onColumnMovedPinnedVisible);\n _this.eventService.removeEventListener(Events.EVENT_COLUMN_VISIBLE, onColumnMovedPinnedVisible);\n };\n _this.addDestroyFunc(function () { return removeRangeSelectionListeners(); });\n _this.addManagedPropertyListener('enableRangeSelection', function (params) {\n var isEnabled = params.currentValue;\n if (isEnabled) {\n addRangeSelectionListeners();\n }\n else {\n removeRangeSelectionListeners();\n }\n });\n var rangeSelectionEnabled = _this.gridOptionsService.get('enableRangeSelection');\n if (rangeSelectionEnabled) {\n addRangeSelectionListeners();\n }\n };\n return _this;\n }\n RowRenderer.prototype.postConstruct = function () {\n var _this = this;\n this.ctrlsService.whenReady(function () {\n _this.gridBodyCtrl = _this.ctrlsService.getGridBodyCtrl();\n _this.initialise();\n });\n };\n RowRenderer.prototype.initialise = function () {\n var _this = this;\n this.addManagedListener(this.eventService, Events.EVENT_PAGINATION_CHANGED, this.onPageLoaded.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_PINNED_ROW_DATA_CHANGED, this.onPinnedRowDataChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_BODY_SCROLL, this.onBodyScroll.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_BODY_HEIGHT_CHANGED, this.redraw.bind(this));\n this.addManagedPropertyListeners(['domLayout', 'embedFullWidthRows'], function () { return _this.onDomLayoutChanged(); });\n this.addManagedPropertyListeners(['suppressMaxRenderedRowRestriction', 'rowBuffer'], function () { return _this.redraw(); });\n this.addManagedPropertyListeners([\n 'suppressCellFocus', 'getBusinessKeyForNode',\n 'fullWidthCellRenderer', 'fullWidthCellRendererParams',\n 'rowStyle', 'getRowStyle',\n 'rowClass', 'getRowClass', 'rowClassRules',\n 'groupRowRenderer', 'groupRowRendererParams',\n 'loadingCellRenderer', 'loadingCellRendererParams',\n 'detailCellRenderer', 'detailCellRendererParams',\n 'enableRangeSelection', 'enableCellTextSelection',\n ], function () { return _this.redrawRows(); });\n if (this.gridOptionsService.isGroupRowsSticky()) {\n var rowModelType = this.rowModel.getType();\n if (rowModelType === 'clientSide' || rowModelType === 'serverSide') {\n this.stickyRowFeature = this.createManagedBean(new StickyRowFeature(this.createRowCon.bind(this), this.destroyRowCtrls.bind(this)));\n }\n }\n this.registerCellEventListeners();\n this.initialiseCache();\n this.printLayout = this.gridOptionsService.isDomLayout('print');\n this.embedFullWidthRows = this.printLayout || this.gridOptionsService.get('embedFullWidthRows');\n this.redrawAfterModelUpdate();\n };\n RowRenderer.prototype.initialiseCache = function () {\n if (this.gridOptionsService.get('keepDetailRows')) {\n var countProp = this.getKeepDetailRowsCount();\n var count = countProp != null ? countProp : 3;\n this.cachedRowCtrls = new RowCtrlCache(count);\n }\n };\n RowRenderer.prototype.getKeepDetailRowsCount = function () {\n return this.gridOptionsService.get('keepDetailRowsCount');\n };\n RowRenderer.prototype.getStickyTopRowCtrls = function () {\n if (!this.stickyRowFeature) {\n return [];\n }\n return this.stickyRowFeature.getStickyRowCtrls();\n };\n RowRenderer.prototype.updateAllRowCtrls = function () {\n var liveList = getAllValuesInObject(this.rowCtrlsByRowIndex);\n var zombieList = getAllValuesInObject(this.zombieRowCtrls);\n var cachedList = this.cachedRowCtrls ? this.cachedRowCtrls.getEntries() : [];\n if (zombieList.length > 0 || cachedList.length > 0) {\n // Only spread if we need to.\n this.allRowCtrls = __spreadArray$f(__spreadArray$f(__spreadArray$f([], __read$h(liveList), false), __read$h(zombieList), false), __read$h(cachedList), false);\n }\n else {\n this.allRowCtrls = liveList;\n }\n };\n RowRenderer.prototype.onCellFocusChanged = function (event) {\n this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.onCellFocused(event); });\n this.getFullWidthRowCtrls().forEach(function (rowCtrl) { return rowCtrl.onFullWidthRowFocused(event); });\n };\n // in a clean design, each cell would register for each of these events. however when scrolling, all the cells\n // registering and de-registering for events is a performance bottleneck. so we register here once and inform\n // all active cells.\n RowRenderer.prototype.registerCellEventListeners = function () {\n var _this = this;\n this.addManagedListener(this.eventService, Events.EVENT_CELL_FOCUSED, function (event) {\n _this.onCellFocusChanged(event);\n });\n this.addManagedListener(this.eventService, Events.EVENT_CELL_FOCUS_CLEARED, function () {\n _this.onCellFocusChanged();\n });\n this.addManagedListener(this.eventService, Events.EVENT_FLASH_CELLS, function (event) {\n _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.onFlashCells(event); });\n });\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_HOVER_CHANGED, function () {\n _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.onColumnHover(); });\n });\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, function () {\n _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.onDisplayedColumnsChanged(); });\n });\n // only for printLayout - because we are rendering all the cells in the same row, regardless of pinned state,\n // then changing the width of the containers will impact left position. eg the center cols all have their\n // left position adjusted by the width of the left pinned column, so if the pinned left column width changes,\n // all the center cols need to be shifted to accommodate this. when in normal layout, the pinned cols are\n // in different containers so doesn't impact.\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, function () {\n if (_this.printLayout) {\n _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.onLeftChanged(); });\n }\n });\n this.setupRangeSelectionListeners();\n // add listeners to the grid columns\n this.refreshListenersToColumnsForCellComps();\n // if the grid columns change, then refresh the listeners again\n this.addManagedListener(this.eventService, Events.EVENT_GRID_COLUMNS_CHANGED, this.refreshListenersToColumnsForCellComps.bind(this));\n this.addDestroyFunc(this.removeGridColumnListeners.bind(this));\n };\n // executes all functions in destroyFuncsForColumnListeners and then clears the list\n RowRenderer.prototype.removeGridColumnListeners = function () {\n this.destroyFuncsForColumnListeners.forEach(function (func) { return func(); });\n this.destroyFuncsForColumnListeners.length = 0;\n };\n // this function adds listeners onto all the grid columns, which are the column that we could have cellComps for.\n // when the grid columns change, we add listeners again. in an ideal design, each CellComp would just register to\n // the column it belongs to on creation, however this was a bottleneck with the number of cells, so do it here\n // once instead.\n RowRenderer.prototype.refreshListenersToColumnsForCellComps = function () {\n var _this = this;\n this.removeGridColumnListeners();\n var cols = this.columnModel.getAllGridColumns();\n cols.forEach(function (col) {\n var forEachCellWithThisCol = function (callback) {\n _this.getAllCellCtrls().forEach(function (cellCtrl) {\n if (cellCtrl.getColumn() === col) {\n callback(cellCtrl);\n }\n });\n };\n var leftChangedListener = function () {\n forEachCellWithThisCol(function (cellCtrl) { return cellCtrl.onLeftChanged(); });\n };\n var widthChangedListener = function () {\n forEachCellWithThisCol(function (cellCtrl) { return cellCtrl.onWidthChanged(); });\n };\n var firstRightPinnedChangedListener = function () {\n forEachCellWithThisCol(function (cellCtrl) { return cellCtrl.onFirstRightPinnedChanged(); });\n };\n var lastLeftPinnedChangedListener = function () {\n forEachCellWithThisCol(function (cellCtrl) { return cellCtrl.onLastLeftPinnedChanged(); });\n };\n var colDefChangedListener = function () {\n forEachCellWithThisCol(function (cellCtrl) { return cellCtrl.onColDefChanged(); });\n };\n col.addEventListener('leftChanged', leftChangedListener);\n col.addEventListener('widthChanged', widthChangedListener);\n col.addEventListener('firstRightPinnedChanged', firstRightPinnedChangedListener);\n col.addEventListener('lastLeftPinnedChanged', lastLeftPinnedChangedListener);\n col.addEventListener('colDefChanged', colDefChangedListener);\n _this.destroyFuncsForColumnListeners.push(function () {\n col.removeEventListener('leftChanged', leftChangedListener);\n col.removeEventListener('widthChanged', widthChangedListener);\n col.removeEventListener('firstRightPinnedChanged', firstRightPinnedChangedListener);\n col.removeEventListener('lastLeftPinnedChanged', lastLeftPinnedChangedListener);\n col.removeEventListener('colDefChanged', colDefChangedListener);\n });\n });\n };\n RowRenderer.prototype.onDomLayoutChanged = function () {\n var printLayout = this.gridOptionsService.isDomLayout('print');\n var embedFullWidthRows = printLayout || this.gridOptionsService.get('embedFullWidthRows');\n // if moving towards or away from print layout, means we need to destroy all rows, as rows are not laid\n // out using absolute positioning when doing print layout\n var destroyRows = embedFullWidthRows !== this.embedFullWidthRows || this.printLayout !== printLayout;\n this.printLayout = printLayout;\n this.embedFullWidthRows = embedFullWidthRows;\n if (destroyRows) {\n this.redrawAfterModelUpdate({ domLayoutChanged: true });\n }\n };\n // for row models that have datasources, when we update the datasource, we need to force the rowRenderer\n // to redraw all rows. otherwise the old rows from the old datasource will stay displayed.\n RowRenderer.prototype.datasourceChanged = function () {\n this.firstRenderedRow = 0;\n this.lastRenderedRow = -1;\n var rowIndexesToRemove = Object.keys(this.rowCtrlsByRowIndex);\n this.removeRowCtrls(rowIndexesToRemove);\n };\n RowRenderer.prototype.onPageLoaded = function (event) {\n var params = {\n recycleRows: event.keepRenderedRows,\n animate: event.animate,\n newData: event.newData,\n newPage: event.newPage,\n // because this is a model updated event (not pinned rows), we\n // can skip updating the pinned rows. this is needed so that if user\n // is doing transaction updates, the pinned rows are not getting constantly\n // trashed - or editing cells in pinned rows are not refreshed and put into read mode\n onlyBody: true\n };\n this.redrawAfterModelUpdate(params);\n };\n RowRenderer.prototype.getAllCellsForColumn = function (column) {\n var res = [];\n this.getAllRowCtrls().forEach(function (rowCtrl) {\n var eCell = rowCtrl.getCellElement(column);\n if (eCell) {\n res.push(eCell);\n }\n });\n return res;\n };\n RowRenderer.prototype.refreshFloatingRowComps = function () {\n this.refreshFloatingRows(this.topRowCtrls, this.pinnedRowModel.getPinnedTopRowData());\n this.refreshFloatingRows(this.bottomRowCtrls, this.pinnedRowModel.getPinnedBottomRowData());\n };\n RowRenderer.prototype.getTopRowCtrls = function () {\n return this.topRowCtrls;\n };\n RowRenderer.prototype.getCentreRowCtrls = function () {\n return this.allRowCtrls;\n };\n RowRenderer.prototype.getBottomRowCtrls = function () {\n return this.bottomRowCtrls;\n };\n RowRenderer.prototype.refreshFloatingRows = function (rowComps, rowNodes) {\n var _this = this;\n rowComps.forEach(function (row) {\n row.destroyFirstPass();\n row.destroySecondPass();\n });\n rowComps.length = 0;\n if (!rowNodes) {\n return;\n }\n rowNodes.forEach(function (rowNode) {\n var rowCtrl = new RowCtrl(rowNode, _this.beans, false, false, _this.printLayout);\n rowComps.push(rowCtrl);\n });\n };\n RowRenderer.prototype.onPinnedRowDataChanged = function () {\n // recycling rows in order to ensure cell editing is not cancelled\n var params = {\n recycleRows: true\n };\n this.redrawAfterModelUpdate(params);\n };\n RowRenderer.prototype.redrawRow = function (rowNode, suppressEvent) {\n var _this = this;\n var _a;\n if (suppressEvent === void 0) { suppressEvent = false; }\n if (rowNode.sticky) {\n this.stickyRowFeature.refreshStickyNode(rowNode);\n }\n else if ((_a = this.cachedRowCtrls) === null || _a === void 0 ? void 0 : _a.has(rowNode)) {\n // delete row from cache if it needs redrawn\n // if it's in the cache no updates need fired, as nothing\n // has been rendered\n this.cachedRowCtrls.removeRow(rowNode);\n return;\n }\n else {\n var destroyAndRecreateCtrl = function (dataStruct) {\n var ctrl = dataStruct[rowNode.rowIndex];\n if (!ctrl) {\n return;\n }\n if (ctrl.getRowNode() !== rowNode) {\n // if the node is in the wrong place, then the row model is responsible for triggering a full refresh.\n return;\n }\n ctrl.destroyFirstPass();\n ctrl.destroySecondPass();\n dataStruct[rowNode.rowIndex] = _this.createRowCon(rowNode, false, false);\n };\n switch (rowNode.rowPinned) {\n case 'top':\n destroyAndRecreateCtrl(this.topRowCtrls);\n break;\n case 'bottom':\n destroyAndRecreateCtrl(this.bottomRowCtrls);\n break;\n default:\n destroyAndRecreateCtrl(this.rowCtrlsByRowIndex);\n this.updateAllRowCtrls();\n }\n }\n if (!suppressEvent) {\n this.dispatchDisplayedRowsChanged(false);\n }\n };\n RowRenderer.prototype.redrawRows = function (rowNodes) {\n var _this = this;\n // if no row nodes provided, then refresh everything\n var partialRefresh = rowNodes != null;\n if (partialRefresh) {\n rowNodes === null || rowNodes === void 0 ? void 0 : rowNodes.forEach(function (node) { return _this.redrawRow(node, true); });\n this.dispatchDisplayedRowsChanged(false);\n return;\n }\n this.redrawAfterModelUpdate();\n };\n RowRenderer.prototype.getCellToRestoreFocusToAfterRefresh = function (params) {\n var focusedCell = (params === null || params === void 0 ? void 0 : params.suppressKeepFocus) ? null : this.focusService.getFocusCellToUseAfterRefresh();\n if (focusedCell == null) {\n return null;\n }\n // if the dom is not actually focused on a cell, then we don't try to refocus. the problem this\n // solves is with editing - if the user is editing, eg focus is on a text field, and not on the\n // cell itself, then the cell can be registered as having focus, however it's the text field that\n // has the focus and not the cell div. therefore, when the refresh is finished, the grid will focus\n // the cell, and not the textfield. that means if the user is in a text field, and the grid refreshes,\n // the focus is lost from the text field. we do not want this.\n var eDocument = this.gridOptionsService.getDocument();\n var activeElement = eDocument.activeElement;\n var cellDomData = this.gridOptionsService.getDomData(activeElement, CellCtrl.DOM_DATA_KEY_CELL_CTRL);\n var rowDomData = this.gridOptionsService.getDomData(activeElement, RowCtrl.DOM_DATA_KEY_ROW_CTRL);\n var gridElementFocused = cellDomData || rowDomData;\n return gridElementFocused ? focusedCell : null;\n };\n // gets called from:\n // +) initialisation (in registerGridComp) params = null\n // +) onDomLayoutChanged, params = null\n // +) onPageLoaded, recycleRows, animate, newData, newPage from event, onlyBody=true\n // +) onPinnedRowDataChanged, recycleRows = true\n // +) redrawRows (from Grid API), recycleRows = true/false\n RowRenderer.prototype.redrawAfterModelUpdate = function (params) {\n if (params === void 0) { params = {}; }\n this.getLockOnRefresh();\n var focusedCell = this.getCellToRestoreFocusToAfterRefresh(params);\n this.updateContainerHeights();\n this.scrollToTopIfNewData(params);\n // never recycle rows on layout change as rows could change from normal DOM layout\n // back to the grid's row positioning.\n var recycleRows = !params.domLayoutChanged && !!params.recycleRows;\n var animate = params.animate && this.gridOptionsService.isAnimateRows();\n // after modelUpdate, row indexes can change, so we clear out the rowsByIndex map,\n // however we can reuse the rows, so we keep them but index by rowNode.id\n var rowsToRecycle = recycleRows ? this.getRowsToRecycle() : null;\n if (!recycleRows) {\n this.removeAllRowComps();\n }\n this.workOutFirstAndLastRowsToRender();\n if (this.stickyRowFeature) {\n this.stickyRowFeature.checkStickyRows();\n }\n this.recycleRows(rowsToRecycle, animate);\n this.gridBodyCtrl.updateRowCount();\n if (!params.onlyBody) {\n this.refreshFloatingRowComps();\n }\n this.dispatchDisplayedRowsChanged();\n // if a cell was focused before, ensure focus now.\n if (focusedCell != null) {\n this.restoreFocusedCell(focusedCell);\n }\n this.releaseLockOnRefresh();\n };\n RowRenderer.prototype.scrollToTopIfNewData = function (params) {\n var scrollToTop = params.newData || params.newPage;\n var suppressScrollToTop = this.gridOptionsService.get('suppressScrollOnNewData');\n if (scrollToTop && !suppressScrollToTop) {\n this.gridBodyCtrl.getScrollFeature().scrollToTop();\n }\n };\n RowRenderer.prototype.updateContainerHeights = function () {\n // when doing print layout, we don't explicitly set height on the containers\n if (this.printLayout) {\n this.rowContainerHeightService.setModelHeight(null);\n return;\n }\n var containerHeight = this.paginationProxy.getCurrentPageHeight();\n // we need at least 1 pixel for the horizontal scroll to work. so if there are now rows,\n // we still want the scroll to be present, otherwise there would be no way to scroll the header\n // which might be needed us user wants to access columns\n // on the RHS - and if that was where the filter was that cause no rows to be presented, there\n // is no way to remove the filter.\n if (containerHeight === 0) {\n containerHeight = 1;\n }\n this.rowContainerHeightService.setModelHeight(containerHeight);\n };\n RowRenderer.prototype.getLockOnRefresh = function () {\n if (this.refreshInProgress) {\n throw new Error(\"AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. \" +\n \"Your code probably called a grid API method while the grid was in the render stage. To overcome \" +\n \"this, put the API call into a timeout, e.g. instead of api.redrawRows(), \" +\n \"call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code \" +\n \"that caused the refresh check this stacktrace.\");\n }\n this.refreshInProgress = true;\n };\n RowRenderer.prototype.releaseLockOnRefresh = function () {\n this.refreshInProgress = false;\n };\n RowRenderer.prototype.isRefreshInProgress = function () {\n return this.refreshInProgress;\n };\n // sets the focus to the provided cell, if the cell is provided. this way, the user can call refresh without\n // worry about the focus been lost. this is important when the user is using keyboard navigation to do edits\n // and the cellEditor is calling 'refresh' to get other cells to update (as other cells might depend on the\n // edited cell).\n RowRenderer.prototype.restoreFocusedCell = function (cellPosition) {\n if (cellPosition) {\n // we don't wish to dispatch an event as the rowRenderer is not capable of changing the selected cell,\n // so we mock a change event for the full width rows and cells to ensure they update to the newly selected\n // state\n this.focusService.setRestoreFocusedCell(cellPosition);\n this.onCellFocusChanged(this.beans.gridOptionsService.addGridCommonParams({\n rowIndex: cellPosition.rowIndex,\n column: cellPosition.column,\n rowPinned: cellPosition.rowPinned,\n forceBrowserFocus: true,\n preventScrollOnBrowserFocus: true,\n type: 'mock',\n }));\n }\n };\n RowRenderer.prototype.stopEditing = function (cancel) {\n if (cancel === void 0) { cancel = false; }\n this.getAllRowCtrls().forEach(function (rowCtrl) {\n rowCtrl.stopEditing(cancel);\n });\n };\n RowRenderer.prototype.getAllCellCtrls = function () {\n var res = [];\n var rowCtrls = this.getAllRowCtrls();\n var rowCtrlsLength = rowCtrls.length;\n for (var i = 0; i < rowCtrlsLength; i++) {\n var cellCtrls = rowCtrls[i].getAllCellCtrls();\n var cellCtrlsLength = cellCtrls.length;\n for (var j = 0; j < cellCtrlsLength; j++) {\n res.push(cellCtrls[j]);\n }\n }\n return res;\n };\n RowRenderer.prototype.getAllRowCtrls = function () {\n var e_1, _a;\n var stickyRowCtrls = (this.stickyRowFeature && this.stickyRowFeature.getStickyRowCtrls()) || [];\n var res = __spreadArray$f(__spreadArray$f(__spreadArray$f([], __read$h(this.topRowCtrls), false), __read$h(this.bottomRowCtrls), false), __read$h(stickyRowCtrls), false);\n try {\n for (var _b = __values$3(Object.keys(this.rowCtrlsByRowIndex)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n res.push(this.rowCtrlsByRowIndex[key]);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return res;\n };\n RowRenderer.prototype.addRenderedRowListener = function (eventName, rowIndex, callback) {\n var rowComp = this.rowCtrlsByRowIndex[rowIndex];\n if (rowComp) {\n rowComp.addEventListener(eventName, callback);\n }\n };\n RowRenderer.prototype.flashCells = function (params) {\n if (params === void 0) { params = {}; }\n this.getCellCtrls(params.rowNodes, params.columns)\n .forEach(function (cellCtrl) { return cellCtrl.flashCell(params); });\n };\n RowRenderer.prototype.refreshCells = function (params) {\n var _this = this;\n if (params === void 0) { params = {}; }\n var refreshCellParams = {\n forceRefresh: params.force,\n newData: false,\n suppressFlash: params.suppressFlash\n };\n this.getCellCtrls(params.rowNodes, params.columns)\n .forEach(function (cellCtrl) { return cellCtrl.refreshOrDestroyCell(refreshCellParams); });\n if (params.rowNodes) {\n // refresh the full width rows too\n this.getRowCtrls(params.rowNodes).forEach(function (rowCtrl) {\n if (!rowCtrl.isFullWidth()) {\n return;\n }\n var refreshed = rowCtrl.refreshFullWidth();\n if (!refreshed) {\n _this.redrawRow(rowCtrl.getRowNode(), true);\n }\n });\n this.dispatchDisplayedRowsChanged(false);\n }\n };\n RowRenderer.prototype.getCellRendererInstances = function (params) {\n var _this = this;\n var _a;\n var cellRenderers = this.getCellCtrls(params.rowNodes, params.columns)\n .map(function (cellCtrl) { return cellCtrl.getCellRenderer(); })\n .filter(function (renderer) { return renderer != null; });\n if ((_a = params.columns) === null || _a === void 0 ? void 0 : _a.length) {\n return cellRenderers;\n }\n var fullWidthRenderers = [];\n var rowIdMap = this.mapRowNodes(params.rowNodes);\n this.getAllRowCtrls().forEach(function (rowCtrl) {\n if (rowIdMap && !_this.isRowInMap(rowCtrl.getRowNode(), rowIdMap)) {\n return;\n }\n if (!rowCtrl.isFullWidth()) {\n return;\n }\n var renderers = rowCtrl.getFullWidthCellRenderers();\n for (var i = 0; i < renderers.length; i++) {\n var renderer = renderers[i];\n if (renderer != null) {\n fullWidthRenderers.push(renderer);\n }\n }\n });\n return __spreadArray$f(__spreadArray$f([], __read$h(fullWidthRenderers), false), __read$h(cellRenderers), false);\n };\n RowRenderer.prototype.getCellEditorInstances = function (params) {\n var res = [];\n this.getCellCtrls(params.rowNodes, params.columns).forEach(function (cellCtrl) {\n var cellEditor = cellCtrl.getCellEditor();\n if (cellEditor) {\n res.push(cellEditor);\n }\n });\n return res;\n };\n RowRenderer.prototype.getEditingCells = function () {\n var res = [];\n this.getAllCellCtrls().forEach(function (cellCtrl) {\n if (cellCtrl.isEditing()) {\n var cellPosition = cellCtrl.getCellPosition();\n res.push(cellPosition);\n }\n });\n return res;\n };\n RowRenderer.prototype.mapRowNodes = function (rowNodes) {\n if (!rowNodes) {\n return;\n }\n var res = {\n top: {},\n bottom: {},\n normal: {}\n };\n rowNodes.forEach(function (rowNode) {\n var id = rowNode.id;\n if (rowNode.rowPinned === 'top') {\n res.top[id] = rowNode;\n }\n else if (rowNode.rowPinned === 'bottom') {\n res.bottom[id] = rowNode;\n }\n else {\n res.normal[id] = rowNode;\n }\n });\n return res;\n };\n RowRenderer.prototype.isRowInMap = function (rowNode, rowIdsMap) {\n // skip this row if it is missing from the provided list\n var id = rowNode.id;\n var floating = rowNode.rowPinned;\n if (floating === 'bottom') {\n return rowIdsMap.bottom[id] != null;\n }\n if (floating === 'top') {\n return rowIdsMap.top[id] != null;\n }\n return rowIdsMap.normal[id] != null;\n };\n /**\n * @param rowNodes if provided, returns the RowCtrls for the provided rowNodes. otherwise returns all RowCtrls.\n */\n RowRenderer.prototype.getRowCtrls = function (rowNodes) {\n var _this = this;\n var rowIdsMap = this.mapRowNodes(rowNodes);\n var allRowCtrls = this.getAllRowCtrls();\n if (!rowNodes || !rowIdsMap) {\n return allRowCtrls;\n }\n return allRowCtrls.filter(function (rowCtrl) {\n var rowNode = rowCtrl.getRowNode();\n return _this.isRowInMap(rowNode, rowIdsMap);\n });\n };\n // returns CellCtrl's that match the provided rowNodes and columns. eg if one row node\n // and two columns provided, that identifies 4 cells, so 4 CellCtrl's returned.\n RowRenderer.prototype.getCellCtrls = function (rowNodes, columns) {\n var _this = this;\n var colIdsMap;\n if (exists(columns)) {\n colIdsMap = {};\n columns.forEach(function (colKey) {\n var column = _this.columnModel.getGridColumn(colKey);\n if (exists(column)) {\n colIdsMap[column.getId()] = true;\n }\n });\n }\n var res = [];\n this.getRowCtrls(rowNodes).forEach(function (rowCtrl) {\n rowCtrl.getAllCellCtrls().forEach(function (cellCtrl) {\n var colId = cellCtrl.getColumn().getId();\n var excludeColFromRefresh = colIdsMap && !colIdsMap[colId];\n if (excludeColFromRefresh) {\n return;\n }\n res.push(cellCtrl);\n });\n });\n return res;\n };\n RowRenderer.prototype.destroy = function () {\n this.removeAllRowComps();\n _super.prototype.destroy.call(this);\n };\n RowRenderer.prototype.removeAllRowComps = function () {\n var rowIndexesToRemove = Object.keys(this.rowCtrlsByRowIndex);\n this.removeRowCtrls(rowIndexesToRemove);\n };\n RowRenderer.prototype.getRowsToRecycle = function () {\n // remove all stub nodes, they can't be reused, as no rowNode id\n var stubNodeIndexes = [];\n iterateObject(this.rowCtrlsByRowIndex, function (index, rowComp) {\n var stubNode = rowComp.getRowNode().id == null;\n if (stubNode) {\n stubNodeIndexes.push(index);\n }\n });\n this.removeRowCtrls(stubNodeIndexes);\n // then clear out rowCompsByIndex, but before that take a copy, but index by id, not rowIndex\n var ctrlsByIdMap = {};\n iterateObject(this.rowCtrlsByRowIndex, function (index, rowComp) {\n var rowNode = rowComp.getRowNode();\n ctrlsByIdMap[rowNode.id] = rowComp;\n });\n this.rowCtrlsByRowIndex = {};\n return ctrlsByIdMap;\n };\n // takes array of row indexes\n RowRenderer.prototype.removeRowCtrls = function (rowsToRemove, suppressAnimation) {\n // if no fromIndex then set to -1, which will refresh everything\n // let realFromIndex = -1;\n var _this = this;\n if (suppressAnimation === void 0) { suppressAnimation = false; }\n rowsToRemove.forEach(function (indexToRemove) {\n var rowCtrl = _this.rowCtrlsByRowIndex[indexToRemove];\n if (rowCtrl) {\n rowCtrl.destroyFirstPass(suppressAnimation);\n rowCtrl.destroySecondPass();\n }\n delete _this.rowCtrlsByRowIndex[indexToRemove];\n });\n };\n RowRenderer.prototype.onBodyScroll = function (e) {\n if (e.direction !== 'vertical') {\n return;\n }\n this.redraw({ afterScroll: true });\n };\n // gets called when rows don't change, but viewport does, so after:\n // 1) height of grid body changes, ie number of displayed rows has changed\n // 2) grid scrolled to new position\n // 3) ensure index visible (which is a scroll)\n RowRenderer.prototype.redraw = function (params) {\n if (params === void 0) { params = {}; }\n var afterScroll = params.afterScroll;\n var cellFocused;\n // only try to refocus cells shifting in and out of sticky container\n // if the browser supports focus ({ preventScroll })\n if (this.stickyRowFeature && browserSupportsPreventScroll()) {\n cellFocused = this.getCellToRestoreFocusToAfterRefresh() || undefined;\n }\n var oldFirstRow = this.firstRenderedRow;\n var oldLastRow = this.lastRenderedRow;\n this.workOutFirstAndLastRowsToRender();\n var hasStickyRowChanges = false;\n if (this.stickyRowFeature) {\n hasStickyRowChanges = this.stickyRowFeature.checkStickyRows();\n }\n var rangeChanged = this.firstRenderedRow !== oldFirstRow || this.lastRenderedRow !== oldLastRow;\n if (afterScroll && !hasStickyRowChanges && !rangeChanged) {\n return;\n }\n this.getLockOnRefresh();\n this.recycleRows(null, false, afterScroll);\n this.releaseLockOnRefresh();\n // AfterScroll results in flushSync in React but we need to disable flushSync for sticky row group changes to avoid flashing\n this.dispatchDisplayedRowsChanged(afterScroll && !hasStickyRowChanges);\n if (cellFocused != null) {\n var newFocusedCell = this.getCellToRestoreFocusToAfterRefresh();\n if (cellFocused != null && newFocusedCell == null) {\n this.animationFrameService.flushAllFrames();\n this.restoreFocusedCell(cellFocused);\n }\n }\n };\n RowRenderer.prototype.removeRowCompsNotToDraw = function (indexesToDraw, suppressAnimation) {\n // for speedy lookup, dump into map\n var indexesToDrawMap = {};\n indexesToDraw.forEach(function (index) { return (indexesToDrawMap[index] = true); });\n var existingIndexes = Object.keys(this.rowCtrlsByRowIndex);\n var indexesNotToDraw = existingIndexes.filter(function (index) { return !indexesToDrawMap[index]; });\n this.removeRowCtrls(indexesNotToDraw, suppressAnimation);\n };\n RowRenderer.prototype.calculateIndexesToDraw = function (rowsToRecycle) {\n var _this = this;\n // all in all indexes in the viewport\n var indexesToDraw = createArrayOfNumbers(this.firstRenderedRow, this.lastRenderedRow);\n var checkRowToDraw = function (indexStr, rowComp) {\n var index = rowComp.getRowNode().rowIndex;\n if (index == null) {\n return;\n }\n if (index < _this.firstRenderedRow || index > _this.lastRenderedRow) {\n if (_this.doNotUnVirtualiseRow(rowComp)) {\n indexesToDraw.push(index);\n }\n }\n };\n // if we are redrawing due to scrolling change, then old rows are in this.rowCompsByIndex\n iterateObject(this.rowCtrlsByRowIndex, checkRowToDraw);\n // if we are redrawing due to model update, then old rows are in rowsToRecycle\n iterateObject(rowsToRecycle, checkRowToDraw);\n indexesToDraw.sort(function (a, b) { return a - b; });\n var ret = [];\n for (var i = 0; i < indexesToDraw.length; i++) {\n var currRow = indexesToDraw[i];\n var rowNode = this.paginationProxy.getRow(currRow);\n if (rowNode && !rowNode.sticky) {\n ret.push(currRow);\n }\n }\n return ret;\n };\n RowRenderer.prototype.recycleRows = function (rowsToRecycle, animate, afterScroll) {\n // the row can already exist and be in the following:\n // rowsToRecycle -> if model change, then the index may be different, however row may\n // exist here from previous time (mapped by id).\n // this.rowCompsByIndex -> if just a scroll, then this will contain what is currently in the viewport\n var _this = this;\n if (animate === void 0) { animate = false; }\n if (afterScroll === void 0) { afterScroll = false; }\n // this is all the indexes we want, including those that already exist, so this method\n // will end up going through each index and drawing only if the row doesn't already exist\n var indexesToDraw = this.calculateIndexesToDraw(rowsToRecycle);\n // never animate when doing print layout - as we want to get things ready to print as quickly as possible,\n // otherwise we risk the printer printing a row that's half faded (half way through fading in)\n // Don't animate rows that have been added or removed as part of scrolling\n if (this.printLayout || afterScroll) {\n animate = false;\n }\n this.removeRowCompsNotToDraw(indexesToDraw, !animate);\n indexesToDraw.forEach(function (rowIndex) {\n var rowCtrl = _this.createOrUpdateRowCtrl(rowIndex, rowsToRecycle, animate, afterScroll);\n if (exists(rowCtrl)) ;\n });\n if (rowsToRecycle) {\n var useAnimationFrame = afterScroll && !this.gridOptionsService.get('suppressAnimationFrame') && !this.printLayout;\n if (useAnimationFrame) {\n this.beans.animationFrameService.addDestroyTask(function () {\n _this.destroyRowCtrls(rowsToRecycle, animate);\n _this.updateAllRowCtrls();\n _this.dispatchDisplayedRowsChanged();\n });\n }\n else {\n this.destroyRowCtrls(rowsToRecycle, animate);\n }\n }\n this.updateAllRowCtrls();\n };\n RowRenderer.prototype.dispatchDisplayedRowsChanged = function (afterScroll) {\n if (afterScroll === void 0) { afterScroll = false; }\n var event = { type: Events.EVENT_DISPLAYED_ROWS_CHANGED, afterScroll: afterScroll };\n this.eventService.dispatchEvent(event);\n };\n RowRenderer.prototype.onDisplayedColumnsChanged = function () {\n var pinningLeft = this.columnModel.isPinningLeft();\n var pinningRight = this.columnModel.isPinningRight();\n var atLeastOneChanged = this.pinningLeft !== pinningLeft || pinningRight !== this.pinningRight;\n if (atLeastOneChanged) {\n this.pinningLeft = pinningLeft;\n this.pinningRight = pinningRight;\n if (this.embedFullWidthRows) {\n this.redrawFullWidthEmbeddedRows();\n }\n }\n };\n // when embedding, what gets showed in each section depends on what is pinned. eg if embedding group expand / collapse,\n // then it should go into the pinned left area if pinning left, or the center area if not pinning.\n RowRenderer.prototype.redrawFullWidthEmbeddedRows = function () {\n // if either of the pinned panels has shown / hidden, then need to redraw the fullWidth bits when\n // embedded, as what appears in each section depends on whether we are pinned or not\n var rowsToRemove = [];\n this.getFullWidthRowCtrls().forEach(function (fullWidthCtrl) {\n var rowIndex = fullWidthCtrl.getRowNode().rowIndex;\n rowsToRemove.push(rowIndex.toString());\n });\n this.refreshFloatingRowComps();\n this.removeRowCtrls(rowsToRemove);\n this.redraw({ afterScroll: true });\n };\n RowRenderer.prototype.getFullWidthRowCtrls = function (rowNodes) {\n var _this = this;\n var rowNodesMap = this.mapRowNodes(rowNodes);\n return this.getAllRowCtrls().filter(function (rowCtrl) {\n // include just full width\n if (!rowCtrl.isFullWidth()) {\n return false;\n }\n // if Row Nodes provided, we exclude where Row Node is missing\n var rowNode = rowCtrl.getRowNode();\n if (rowNodesMap != null && !_this.isRowInMap(rowNode, rowNodesMap)) {\n return false;\n }\n return true;\n });\n };\n RowRenderer.prototype.createOrUpdateRowCtrl = function (rowIndex, rowsToRecycle, animate, afterScroll) {\n var rowNode;\n var rowCtrl = this.rowCtrlsByRowIndex[rowIndex];\n // if no row comp, see if we can get it from the previous rowComps\n if (!rowCtrl) {\n rowNode = this.paginationProxy.getRow(rowIndex);\n if (exists(rowNode) && exists(rowsToRecycle) && rowsToRecycle[rowNode.id] && rowNode.alreadyRendered) {\n rowCtrl = rowsToRecycle[rowNode.id];\n rowsToRecycle[rowNode.id] = null;\n }\n }\n var creatingNewRowCtrl = !rowCtrl;\n if (creatingNewRowCtrl) {\n // create a new one\n if (!rowNode) {\n rowNode = this.paginationProxy.getRow(rowIndex);\n }\n if (exists(rowNode)) {\n rowCtrl = this.createRowCon(rowNode, animate, afterScroll);\n }\n else {\n // this should never happen - if somehow we are trying to create\n // a row for a rowNode that does not exist.\n return;\n }\n }\n if (rowNode) {\n // set node as 'alreadyRendered' to ensure we only recycle rowComps that have been rendered, this ensures\n // we don't reuse rowComps that have been removed and then re-added in the same batch transaction.\n rowNode.alreadyRendered = true;\n }\n this.rowCtrlsByRowIndex[rowIndex] = rowCtrl;\n return rowCtrl;\n };\n RowRenderer.prototype.destroyRowCtrls = function (rowCtrlsMap, animate) {\n var _this = this;\n var executeInAWhileFuncs = [];\n iterateObject(rowCtrlsMap, function (nodeId, rowCtrl) {\n // if row was used, then it's null\n if (!rowCtrl) {\n return;\n }\n if (_this.cachedRowCtrls && rowCtrl.isCacheable()) {\n _this.cachedRowCtrls.addRow(rowCtrl);\n return;\n }\n rowCtrl.destroyFirstPass(!animate);\n if (animate) {\n _this.zombieRowCtrls[rowCtrl.getInstanceId()] = rowCtrl;\n executeInAWhileFuncs.push(function () {\n rowCtrl.destroySecondPass();\n delete _this.zombieRowCtrls[rowCtrl.getInstanceId()];\n });\n }\n else {\n rowCtrl.destroySecondPass();\n }\n });\n if (animate) {\n // this ensures we fire displayedRowsChanged AFTER all the 'executeInAWhileFuncs' get\n // executed, as we added it to the end of the list.\n executeInAWhileFuncs.push(function () {\n _this.updateAllRowCtrls();\n _this.dispatchDisplayedRowsChanged();\n });\n executeInAWhile(executeInAWhileFuncs);\n }\n };\n RowRenderer.prototype.getRowBuffer = function () {\n return this.gridOptionsService.get('rowBuffer');\n };\n RowRenderer.prototype.getRowBufferInPixels = function () {\n var rowsToBuffer = this.getRowBuffer();\n var defaultRowHeight = this.gridOptionsService.getRowHeightAsNumber();\n return rowsToBuffer * defaultRowHeight;\n };\n RowRenderer.prototype.workOutFirstAndLastRowsToRender = function () {\n this.rowContainerHeightService.updateOffset();\n var newFirst;\n var newLast;\n if (!this.paginationProxy.isRowsToRender()) {\n newFirst = 0;\n newLast = -1; // setting to -1 means nothing in range\n }\n else if (this.printLayout) {\n this.environment.refreshRowHeightVariable();\n newFirst = this.paginationProxy.getPageFirstRow();\n newLast = this.paginationProxy.getPageLastRow();\n }\n else {\n var bufferPixels = this.getRowBufferInPixels();\n var gridBodyCtrl = this.ctrlsService.getGridBodyCtrl();\n var suppressRowVirtualisation = this.gridOptionsService.get('suppressRowVirtualisation');\n var rowHeightsChanged = false;\n var firstPixel = void 0;\n var lastPixel = void 0;\n do {\n var paginationOffset = this.paginationProxy.getPixelOffset();\n var _a = this.paginationProxy.getCurrentPagePixelRange(), pageFirstPixel = _a.pageFirstPixel, pageLastPixel = _a.pageLastPixel;\n var divStretchOffset = this.rowContainerHeightService.getDivStretchOffset();\n var bodyVRange = gridBodyCtrl.getScrollFeature().getVScrollPosition();\n var bodyTopPixel = bodyVRange.top;\n var bodyBottomPixel = bodyVRange.bottom;\n if (suppressRowVirtualisation) {\n firstPixel = pageFirstPixel + divStretchOffset;\n lastPixel = pageLastPixel + divStretchOffset;\n }\n else {\n firstPixel = Math.max(bodyTopPixel + paginationOffset - bufferPixels, pageFirstPixel) + divStretchOffset;\n lastPixel = Math.min(bodyBottomPixel + paginationOffset + bufferPixels, pageLastPixel) + divStretchOffset;\n }\n this.firstVisibleVPixel = Math.max(bodyTopPixel + paginationOffset, pageFirstPixel) + divStretchOffset;\n // if the rows we are about to display get their heights changed, then that upsets the calcs from above.\n rowHeightsChanged = this.ensureAllRowsInRangeHaveHeightsCalculated(firstPixel, lastPixel);\n } while (rowHeightsChanged);\n var firstRowIndex = this.paginationProxy.getRowIndexAtPixel(firstPixel);\n var lastRowIndex = this.paginationProxy.getRowIndexAtPixel(lastPixel);\n var pageFirstRow = this.paginationProxy.getPageFirstRow();\n var pageLastRow = this.paginationProxy.getPageLastRow();\n // adjust, in case buffer extended actual size\n if (firstRowIndex < pageFirstRow) {\n firstRowIndex = pageFirstRow;\n }\n if (lastRowIndex > pageLastRow) {\n lastRowIndex = pageLastRow;\n }\n newFirst = firstRowIndex;\n newLast = lastRowIndex;\n }\n // sometimes user doesn't set CSS right and ends up with grid with no height and grid ends up\n // trying to render all the rows, eg 10,000+ rows. this will kill the browser. so instead of\n // killing the browser, we limit the number of rows. just in case some use case we didn't think\n // of, we also have a property to not do this operation.\n var rowLayoutNormal = this.gridOptionsService.isDomLayout('normal');\n var suppressRowCountRestriction = this.gridOptionsService.get('suppressMaxRenderedRowRestriction');\n var rowBufferMaxSize = Math.max(this.getRowBuffer(), 500);\n if (rowLayoutNormal && !suppressRowCountRestriction) {\n if (newLast - newFirst > rowBufferMaxSize) {\n newLast = newFirst + rowBufferMaxSize;\n }\n }\n var firstDiffers = newFirst !== this.firstRenderedRow;\n var lastDiffers = newLast !== this.lastRenderedRow;\n if (firstDiffers || lastDiffers) {\n this.firstRenderedRow = newFirst;\n this.lastRenderedRow = newLast;\n var event_1 = {\n type: Events.EVENT_VIEWPORT_CHANGED,\n firstRow: newFirst,\n lastRow: newLast\n };\n this.eventService.dispatchEvent(event_1);\n }\n };\n /**\n * This event will only be fired once, and is queued until after the browser next renders.\n * This allows us to fire an event during the start of the render cycle, when we first see data being rendered\n * but not execute the event until all of the data has finished being rendered to the dom.\n */\n RowRenderer.prototype.dispatchFirstDataRenderedEvent = function () {\n var _this = this;\n if (this.dataFirstRenderedFired) {\n return;\n }\n this.dataFirstRenderedFired = true;\n var event = {\n type: Events.EVENT_FIRST_DATA_RENDERED,\n firstRow: this.firstRenderedRow,\n lastRow: this.lastRenderedRow,\n };\n // See AG-7018\n window.requestAnimationFrame(function () {\n _this.beans.eventService.dispatchEvent(event);\n });\n };\n RowRenderer.prototype.ensureAllRowsInRangeHaveHeightsCalculated = function (topPixel, bottomPixel) {\n // ensureRowHeightsVisible only works with CSRM, as it's the only row model that allows lazy row height calcs.\n // all the other row models just hard code so the method just returns back false\n var res = this.paginationProxy.ensureRowHeightsValid(topPixel, bottomPixel, -1, -1);\n if (res) {\n this.updateContainerHeights();\n }\n return res;\n };\n RowRenderer.prototype.getFirstVisibleVerticalPixel = function () {\n return this.firstVisibleVPixel;\n };\n RowRenderer.prototype.getFirstVirtualRenderedRow = function () {\n return this.firstRenderedRow;\n };\n RowRenderer.prototype.getLastVirtualRenderedRow = function () {\n return this.lastRenderedRow;\n };\n // check that none of the rows to remove are editing or focused as:\n // a) if editing, we want to keep them, otherwise the user will loose the context of the edit,\n // eg user starts editing, enters some text, then scrolls down and then up, next time row rendered\n // the edit is reset - so we want to keep it rendered.\n // b) if focused, we want ot keep keyboard focus, so if user ctrl+c, it goes to clipboard,\n // otherwise the user can range select and drag (with focus cell going out of the viewport)\n // and then ctrl+c, nothing will happen if cell is removed from dom.\n // c) if detail record of master detail, as users complained that the context of detail rows\n // was getting lost when detail row out of view. eg user expands to show detail row,\n // then manipulates the detail panel (eg sorts the detail grid), then context is lost\n // after detail panel is scrolled out of / into view.\n RowRenderer.prototype.doNotUnVirtualiseRow = function (rowComp) {\n var REMOVE_ROW = false;\n var KEEP_ROW = true;\n var rowNode = rowComp.getRowNode();\n var rowHasFocus = this.focusService.isRowNodeFocused(rowNode);\n var rowIsEditing = rowComp.isEditing();\n var rowIsDetail = rowNode.detail;\n var mightWantToKeepRow = rowHasFocus || rowIsEditing || rowIsDetail;\n // if we deffo don't want to keep it,\n if (!mightWantToKeepRow) {\n return REMOVE_ROW;\n }\n // editing row, only remove if it is no longer rendered, eg filtered out or new data set.\n // the reason we want to keep is if user is scrolling up and down, we don't want to loose\n // the context of the editing in process.\n var rowNodePresent = this.paginationProxy.isRowPresent(rowNode);\n return rowNodePresent ? KEEP_ROW : REMOVE_ROW;\n };\n RowRenderer.prototype.createRowCon = function (rowNode, animate, afterScroll) {\n var rowCtrlFromCache = this.cachedRowCtrls ? this.cachedRowCtrls.getRow(rowNode) : null;\n if (rowCtrlFromCache) {\n return rowCtrlFromCache;\n }\n // we don't use animations frames for printing, so the user can put the grid into print mode\n // and immediately print - otherwise the user would have to wait for the rows to draw in the background\n // (via the animation frames) which is awkward to do from code.\n // we only do the animation frames after scrolling, as this is where we want the smooth user experience.\n // having animation frames for other times makes the grid look 'jumpy'.\n var suppressAnimationFrame = this.gridOptionsService.get('suppressAnimationFrame');\n var useAnimationFrameForCreate = afterScroll && !suppressAnimationFrame && !this.printLayout;\n var res = new RowCtrl(rowNode, this.beans, animate, useAnimationFrameForCreate, this.printLayout);\n return res;\n };\n RowRenderer.prototype.getRenderedNodes = function () {\n var renderedRows = this.rowCtrlsByRowIndex;\n return Object.keys(renderedRows).map(function (key) { return renderedRows[key].getRowNode(); });\n };\n RowRenderer.prototype.getRowByPosition = function (rowPosition) {\n var rowCtrl;\n var rowIndex = rowPosition.rowIndex;\n switch (rowPosition.rowPinned) {\n case 'top':\n rowCtrl = this.topRowCtrls[rowIndex];\n break;\n case 'bottom':\n rowCtrl = this.bottomRowCtrls[rowIndex];\n break;\n default:\n rowCtrl = this.rowCtrlsByRowIndex[rowIndex];\n if (!rowCtrl) {\n rowCtrl = this.getStickyTopRowCtrls().find(function (ctrl) { return ctrl.getRowNode().rowIndex === rowIndex; }) || null;\n }\n break;\n }\n return rowCtrl;\n };\n RowRenderer.prototype.getRowNode = function (gridRow) {\n switch (gridRow.rowPinned) {\n case 'top':\n return this.pinnedRowModel.getPinnedTopRowData()[gridRow.rowIndex];\n case 'bottom':\n return this.pinnedRowModel.getPinnedBottomRowData()[gridRow.rowIndex];\n default:\n return this.rowModel.getRow(gridRow.rowIndex);\n }\n };\n // returns true if any row between startIndex and endIndex is rendered. used by\n // SSRM or IRM, as they don't want to purge visible blocks from cache.\n RowRenderer.prototype.isRangeInRenderedViewport = function (startIndex, endIndex) {\n // parent closed means the parent node is not expanded, thus these blocks are not visible\n var parentClosed = startIndex == null || endIndex == null;\n if (parentClosed) {\n return false;\n }\n var blockAfterViewport = startIndex > this.lastRenderedRow;\n var blockBeforeViewport = endIndex < this.firstRenderedRow;\n var blockInsideViewport = !blockBeforeViewport && !blockAfterViewport;\n return blockInsideViewport;\n };\n __decorate$1f([\n Autowired(\"animationFrameService\")\n ], RowRenderer.prototype, \"animationFrameService\", void 0);\n __decorate$1f([\n Autowired(\"paginationProxy\")\n ], RowRenderer.prototype, \"paginationProxy\", void 0);\n __decorate$1f([\n Autowired(\"columnModel\")\n ], RowRenderer.prototype, \"columnModel\", void 0);\n __decorate$1f([\n Autowired(\"pinnedRowModel\")\n ], RowRenderer.prototype, \"pinnedRowModel\", void 0);\n __decorate$1f([\n Autowired(\"rowModel\")\n ], RowRenderer.prototype, \"rowModel\", void 0);\n __decorate$1f([\n Autowired(\"focusService\")\n ], RowRenderer.prototype, \"focusService\", void 0);\n __decorate$1f([\n Autowired(\"beans\")\n ], RowRenderer.prototype, \"beans\", void 0);\n __decorate$1f([\n Autowired(\"rowContainerHeightService\")\n ], RowRenderer.prototype, \"rowContainerHeightService\", void 0);\n __decorate$1f([\n Autowired(\"ctrlsService\")\n ], RowRenderer.prototype, \"ctrlsService\", void 0);\n __decorate$1f([\n PostConstruct\n ], RowRenderer.prototype, \"postConstruct\", null);\n RowRenderer = __decorate$1f([\n Bean(\"rowRenderer\")\n ], RowRenderer);\n return RowRenderer;\n}(BeanStub));\nvar RowCtrlCache = /** @class */ (function () {\n function RowCtrlCache(maxCount) {\n // map for fast access\n this.entriesMap = {};\n // list for keeping order\n this.entriesList = [];\n this.maxCount = maxCount;\n }\n RowCtrlCache.prototype.addRow = function (rowCtrl) {\n this.entriesMap[rowCtrl.getRowNode().id] = rowCtrl;\n this.entriesList.push(rowCtrl);\n rowCtrl.setCached(true);\n if (this.entriesList.length > this.maxCount) {\n var rowCtrlToDestroy = this.entriesList[0];\n rowCtrlToDestroy.destroyFirstPass();\n rowCtrlToDestroy.destroySecondPass();\n this.removeFromCache(rowCtrlToDestroy);\n }\n };\n RowCtrlCache.prototype.getRow = function (rowNode) {\n if (rowNode == null || rowNode.id == null) {\n return null;\n }\n var res = this.entriesMap[rowNode.id];\n if (!res) {\n return null;\n }\n this.removeFromCache(res);\n res.setCached(false);\n // this can happen if user reloads data, and a new RowNode is reusing\n // the same ID as the old one\n var rowNodeMismatch = res.getRowNode() != rowNode;\n return rowNodeMismatch ? null : res;\n };\n RowCtrlCache.prototype.has = function (rowNode) {\n return this.entriesMap[rowNode.id] != null;\n };\n RowCtrlCache.prototype.removeRow = function (rowNode) {\n var rowNodeId = rowNode.id;\n var ctrl = this.entriesMap[rowNodeId];\n delete this.entriesMap[rowNodeId];\n removeFromArray(this.entriesList, ctrl);\n };\n RowCtrlCache.prototype.removeFromCache = function (rowCtrl) {\n var rowNodeId = rowCtrl.getRowNode().id;\n delete this.entriesMap[rowNodeId];\n removeFromArray(this.entriesList, rowCtrl);\n };\n RowCtrlCache.prototype.getEntries = function () {\n return this.entriesList;\n };\n return RowCtrlCache;\n}());\n\nvar __extends$1i = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1e = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ValueFormatterService = /** @class */ (function (_super) {\n __extends$1i(ValueFormatterService, _super);\n function ValueFormatterService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ValueFormatterService.prototype.formatValue = function (column, node, value, suppliedFormatter, useFormatterFromColumn) {\n if (useFormatterFromColumn === void 0) { useFormatterFromColumn = true; }\n var result = null;\n var formatter;\n var colDef = column.getColDef();\n if (suppliedFormatter) {\n // use supplied formatter if provided, e.g. set filter items can have their own value formatters\n formatter = suppliedFormatter;\n }\n else if (useFormatterFromColumn) {\n formatter = colDef.valueFormatter;\n }\n if (formatter) {\n var params = this.gridOptionsService.addGridCommonParams({\n value: value,\n node: node,\n data: node ? node.data : null,\n colDef: colDef,\n column: column\n });\n if (typeof formatter === 'function') {\n result = formatter(params);\n }\n else {\n result = this.expressionService.evaluate(formatter, params);\n }\n }\n else if (colDef.refData) {\n return colDef.refData[value] || '';\n }\n // if we don't do this, then arrays get displayed as 1,2,3, but we want 1, 2, 3 (i.e. with spaces)\n if (result == null && Array.isArray(value)) {\n result = value.join(', ');\n }\n return result;\n };\n __decorate$1e([\n Autowired('expressionService')\n ], ValueFormatterService.prototype, \"expressionService\", void 0);\n ValueFormatterService = __decorate$1e([\n Bean('valueFormatterService')\n ], ValueFormatterService);\n return ValueFormatterService;\n}(BeanStub));\n\nvar __extends$1h = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1d = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar PinnedRowModel = /** @class */ (function (_super) {\n __extends$1h(PinnedRowModel, _super);\n function PinnedRowModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PinnedRowModel.prototype.init = function () {\n var _this = this;\n this.setPinnedTopRowData();\n this.setPinnedBottomRowData();\n this.addManagedPropertyListener('pinnedTopRowData', function () { return _this.setPinnedTopRowData(); });\n this.addManagedPropertyListener('pinnedBottomRowData', function () { return _this.setPinnedBottomRowData(); });\n };\n PinnedRowModel.prototype.isEmpty = function (floating) {\n var rows = floating === 'top' ? this.pinnedTopRows : this.pinnedBottomRows;\n return missingOrEmpty(rows);\n };\n PinnedRowModel.prototype.isRowsToRender = function (floating) {\n return !this.isEmpty(floating);\n };\n PinnedRowModel.prototype.getRowAtPixel = function (pixel, floating) {\n var rows = floating === 'top' ? this.pinnedTopRows : this.pinnedBottomRows;\n if (missingOrEmpty(rows)) {\n return 0; // this should never happen, just in case, 0 is graceful failure\n }\n for (var i = 0; i < rows.length; i++) {\n var rowNode = rows[i];\n var rowTopPixel = rowNode.rowTop + rowNode.rowHeight - 1;\n // only need to range check against the top pixel, as we are going through the list\n // in order, first row to hit the pixel wins\n if (rowTopPixel >= pixel) {\n return i;\n }\n }\n return rows.length - 1;\n };\n PinnedRowModel.prototype.setPinnedTopRowData = function () {\n var rowData = this.gridOptionsService.get('pinnedTopRowData');\n this.pinnedTopRows = this.createNodesFromData(rowData, true);\n var event = {\n type: Events.EVENT_PINNED_ROW_DATA_CHANGED\n };\n this.eventService.dispatchEvent(event);\n };\n PinnedRowModel.prototype.setPinnedBottomRowData = function () {\n var rowData = this.gridOptionsService.get('pinnedBottomRowData');\n this.pinnedBottomRows = this.createNodesFromData(rowData, false);\n var event = {\n type: Events.EVENT_PINNED_ROW_DATA_CHANGED\n };\n this.eventService.dispatchEvent(event);\n };\n PinnedRowModel.prototype.createNodesFromData = function (allData, isTop) {\n var _this = this;\n var rowNodes = [];\n if (allData) {\n var nextRowTop_1 = 0;\n allData.forEach(function (dataItem, index) {\n var rowNode = new RowNode(_this.beans);\n rowNode.data = dataItem;\n var idPrefix = isTop ? RowNode.ID_PREFIX_TOP_PINNED : RowNode.ID_PREFIX_BOTTOM_PINNED;\n rowNode.id = idPrefix + index;\n rowNode.rowPinned = isTop ? 'top' : 'bottom';\n rowNode.setRowTop(nextRowTop_1);\n rowNode.setRowHeight(_this.gridOptionsService.getRowHeightForNode(rowNode).height);\n rowNode.setRowIndex(index);\n nextRowTop_1 += rowNode.rowHeight;\n rowNodes.push(rowNode);\n });\n }\n return rowNodes;\n };\n PinnedRowModel.prototype.getPinnedTopRowData = function () {\n return this.pinnedTopRows;\n };\n PinnedRowModel.prototype.getPinnedBottomRowData = function () {\n return this.pinnedBottomRows;\n };\n PinnedRowModel.prototype.getPinnedTopTotalHeight = function () {\n return this.getTotalHeight(this.pinnedTopRows);\n };\n PinnedRowModel.prototype.getPinnedTopRowCount = function () {\n return this.pinnedTopRows ? this.pinnedTopRows.length : 0;\n };\n PinnedRowModel.prototype.getPinnedBottomRowCount = function () {\n return this.pinnedBottomRows ? this.pinnedBottomRows.length : 0;\n };\n PinnedRowModel.prototype.getPinnedTopRow = function (index) {\n return this.pinnedTopRows[index];\n };\n PinnedRowModel.prototype.getPinnedBottomRow = function (index) {\n return this.pinnedBottomRows[index];\n };\n PinnedRowModel.prototype.forEachPinnedTopRow = function (callback) {\n if (missingOrEmpty(this.pinnedTopRows)) {\n return;\n }\n this.pinnedTopRows.forEach(callback);\n };\n PinnedRowModel.prototype.forEachPinnedBottomRow = function (callback) {\n if (missingOrEmpty(this.pinnedBottomRows)) {\n return;\n }\n this.pinnedBottomRows.forEach(callback);\n };\n PinnedRowModel.prototype.getPinnedBottomTotalHeight = function () {\n return this.getTotalHeight(this.pinnedBottomRows);\n };\n PinnedRowModel.prototype.getTotalHeight = function (rowNodes) {\n if (!rowNodes || rowNodes.length === 0) {\n return 0;\n }\n var lastNode = last(rowNodes);\n return lastNode.rowTop + lastNode.rowHeight;\n };\n __decorate$1d([\n Autowired('beans')\n ], PinnedRowModel.prototype, \"beans\", void 0);\n __decorate$1d([\n PostConstruct\n ], PinnedRowModel.prototype, \"init\", null);\n PinnedRowModel = __decorate$1d([\n Bean('pinnedRowModel')\n ], PinnedRowModel);\n return PinnedRowModel;\n}(BeanStub));\n\nvar ServerSideTransactionResultStatus;\n(function (ServerSideTransactionResultStatus) {\n /** Transaction was successfully applied */\n ServerSideTransactionResultStatus[\"Applied\"] = \"Applied\";\n /**\n * Store was not found, transaction not applied.\n * Either invalid route, or the parent row has not yet been expanded.\n */\n ServerSideTransactionResultStatus[\"StoreNotFound\"] = \"StoreNotFound\";\n /**\n * Store is loading, transaction not applied.\n */\n ServerSideTransactionResultStatus[\"StoreLoading\"] = \"StoreLoading\";\n /**\n * Store is loading (as max loads exceeded), transaction not applied.\n */\n ServerSideTransactionResultStatus[\"StoreWaitingToLoad\"] = \"StoreWaitingToLoad\";\n /**\n * Store load attempt failed, transaction not applied.\n */\n ServerSideTransactionResultStatus[\"StoreLoadingFailed\"] = \"StoreLoadingFailed\";\n /**\n * Store is type Partial, which doesn't accept transactions\n */\n ServerSideTransactionResultStatus[\"StoreWrongType\"] = \"StoreWrongType\";\n /**\n * Transaction was cancelled, due to grid.\n * Callback isApplyServerSideTransaction() returning false\n */\n ServerSideTransactionResultStatus[\"Cancelled\"] = \"Cancelled\";\n /**\n * Store has not started yet, transaction not applied\n */\n ServerSideTransactionResultStatus[\"StoreNotStarted\"] = \"StoreNotStarted\";\n})(ServerSideTransactionResultStatus || (ServerSideTransactionResultStatus = {}));\n\n// when doing transactions, or change detection, and grouping is present\n// in the data, there is no need for the ClientSideRowModel to update each\n// group after an update, ony parts that were impacted by the change.\n// this class keeps track of all groups that were impacted by a transaction.\n// the the different CSRM operations (filter, sort etc) use the forEach method\n// to visit each group that was changed.\nvar ChangedPath = /** @class */ (function () {\n function ChangedPath(keepingColumns, rootNode) {\n // whether changed path is active of not. it is active when a) doing\n // a transaction update or b) doing change detection. if we are doing\n // a CSRM refresh for other reasons (after sort or filter, or user calling\n // setRowData() without delta mode) then we are not active. we are also\n // marked as not active if secondary columns change in pivot (as this impacts\n // aggregations)\n this.active = true;\n // for each node in the change path, we also store which columns need\n // to be re-aggregated.\n this.nodeIdsToColumns = {};\n // for quick lookup, all items in the change path are mapped by nodeId\n this.mapToItems = {};\n this.keepingColumns = keepingColumns;\n this.pathRoot = {\n rowNode: rootNode,\n children: null\n };\n this.mapToItems[rootNode.id] = this.pathRoot;\n }\n // can be set inactive by:\n // a) ClientSideRowModel, if no transactions or\n // b) PivotService, if secondary columns changed\n ChangedPath.prototype.setInactive = function () {\n this.active = false;\n };\n ChangedPath.prototype.isActive = function () {\n return this.active;\n };\n ChangedPath.prototype.depthFirstSearchChangedPath = function (pathItem, callback) {\n if (pathItem.children) {\n for (var i = 0; i < pathItem.children.length; i++) {\n this.depthFirstSearchChangedPath(pathItem.children[i], callback);\n }\n }\n callback(pathItem.rowNode);\n };\n ChangedPath.prototype.depthFirstSearchEverything = function (rowNode, callback, traverseEverything) {\n if (rowNode.childrenAfterGroup) {\n for (var i = 0; i < rowNode.childrenAfterGroup.length; i++) {\n var childNode = rowNode.childrenAfterGroup[i];\n if (childNode.childrenAfterGroup) {\n this.depthFirstSearchEverything(rowNode.childrenAfterGroup[i], callback, traverseEverything);\n }\n else if (traverseEverything) {\n callback(childNode);\n }\n }\n }\n callback(rowNode);\n };\n // traverseLeafNodes -> used when NOT doing changed path, ie traversing everything. the callback\n // will be called for child nodes in addition to parent nodes.\n ChangedPath.prototype.forEachChangedNodeDepthFirst = function (callback, traverseLeafNodes, includeUnchangedNodes) {\n if (traverseLeafNodes === void 0) { traverseLeafNodes = false; }\n if (includeUnchangedNodes === void 0) { includeUnchangedNodes = false; }\n if (this.active && !includeUnchangedNodes) {\n // if we are active, then use the change path to callback\n // only for updated groups\n this.depthFirstSearchChangedPath(this.pathRoot, callback);\n }\n else {\n // we are not active, so callback for everything, walk the entire path\n this.depthFirstSearchEverything(this.pathRoot.rowNode, callback, traverseLeafNodes);\n }\n };\n ChangedPath.prototype.executeFromRootNode = function (callback) {\n callback(this.pathRoot.rowNode);\n };\n ChangedPath.prototype.createPathItems = function (rowNode) {\n var pointer = rowNode;\n var newEntryCount = 0;\n while (!this.mapToItems[pointer.id]) {\n var newEntry = {\n rowNode: pointer,\n children: null\n };\n this.mapToItems[pointer.id] = newEntry;\n newEntryCount++;\n pointer = pointer.parent;\n }\n return newEntryCount;\n };\n ChangedPath.prototype.populateColumnsMap = function (rowNode, columns) {\n var _this = this;\n if (!this.keepingColumns || !columns) {\n return;\n }\n var pointer = rowNode;\n while (pointer) {\n // if columns, add the columns in all the way to parent, merging\n // in any other columns that might be there already\n if (!this.nodeIdsToColumns[pointer.id]) {\n this.nodeIdsToColumns[pointer.id] = {};\n }\n columns.forEach(function (col) { return _this.nodeIdsToColumns[pointer.id][col.getId()] = true; });\n pointer = pointer.parent;\n }\n };\n ChangedPath.prototype.linkPathItems = function (rowNode, newEntryCount) {\n var pointer = rowNode;\n for (var i = 0; i < newEntryCount; i++) {\n var thisItem = this.mapToItems[pointer.id];\n var parentItem = this.mapToItems[pointer.parent.id];\n if (!parentItem.children) {\n parentItem.children = [];\n }\n parentItem.children.push(thisItem);\n pointer = pointer.parent;\n }\n };\n // called by\n // 1) change detection (provides cols) and\n // 2) groupStage if doing transaction update (doesn't provide cols)\n ChangedPath.prototype.addParentNode = function (rowNode, columns) {\n if (!rowNode || rowNode.isRowPinned()) {\n return;\n }\n // we cannot do both steps below in the same loop as\n // the second loop has a dependency on the first loop.\n // ie the hierarchy cannot be stitched up yet because\n // we don't have it built yet\n // create the new PathItem objects.\n var newEntryCount = this.createPathItems(rowNode);\n // link in the node items\n this.linkPathItems(rowNode, newEntryCount);\n // update columns\n this.populateColumnsMap(rowNode, columns);\n };\n ChangedPath.prototype.canSkip = function (rowNode) {\n return this.active && !this.mapToItems[rowNode.id];\n };\n ChangedPath.prototype.getValueColumnsForNode = function (rowNode, valueColumns) {\n if (!this.keepingColumns) {\n return valueColumns;\n }\n var colsForThisNode = this.nodeIdsToColumns[rowNode.id];\n var result = valueColumns.filter(function (col) { return colsForThisNode[col.getId()]; });\n return result;\n };\n ChangedPath.prototype.getNotValueColumnsForNode = function (rowNode, valueColumns) {\n if (!this.keepingColumns) {\n return null;\n }\n var colsForThisNode = this.nodeIdsToColumns[rowNode.id];\n var result = valueColumns.filter(function (col) { return !colsForThisNode[col.getId()]; });\n return result;\n };\n return ChangedPath;\n}());\n\nvar __extends$1g = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar RowNodeBlock = /** @class */ (function (_super) {\n __extends$1g(RowNodeBlock, _super);\n function RowNodeBlock(id) {\n var _this = _super.call(this) || this;\n _this.state = RowNodeBlock.STATE_WAITING_TO_LOAD;\n _this.version = 0;\n _this.id = id;\n return _this;\n }\n RowNodeBlock.prototype.getId = function () {\n return this.id;\n };\n RowNodeBlock.prototype.load = function () {\n this.state = RowNodeBlock.STATE_LOADING;\n this.loadFromDatasource();\n };\n RowNodeBlock.prototype.getVersion = function () {\n return this.version;\n };\n RowNodeBlock.prototype.setStateWaitingToLoad = function () {\n // in case any current loads in progress, this will have their results ignored\n this.version++;\n this.state = RowNodeBlock.STATE_WAITING_TO_LOAD;\n };\n RowNodeBlock.prototype.getState = function () {\n return this.state;\n };\n RowNodeBlock.prototype.pageLoadFailed = function (version) {\n var requestMostRecentAndLive = this.isRequestMostRecentAndLive(version);\n if (requestMostRecentAndLive) {\n this.state = RowNodeBlock.STATE_FAILED;\n this.processServerFail();\n }\n this.dispatchLoadCompleted(false);\n };\n RowNodeBlock.prototype.success = function (version, params) {\n this.successCommon(version, params);\n };\n RowNodeBlock.prototype.pageLoaded = function (version, rows, lastRow) {\n this.successCommon(version, { rowData: rows, rowCount: lastRow });\n };\n RowNodeBlock.prototype.isRequestMostRecentAndLive = function (version) {\n // thisIsMostRecentRequest - if block was refreshed, then another request\n // could of been sent after this one.\n var thisIsMostRecentRequest = version === this.version;\n // weAreNotDestroyed - if InfiniteStore is purged, then blocks are destroyed\n // and new blocks created. so data loads of old blocks are discarded.\n var weAreNotDestroyed = this.isAlive();\n return thisIsMostRecentRequest && weAreNotDestroyed;\n };\n RowNodeBlock.prototype.successCommon = function (version, params) {\n // need to dispatch load complete before processing the data, as PaginationComp checks\n // RowNodeBlockLoader to see if it is still loading, so the RowNodeBlockLoader needs to\n // be updated first (via LoadComplete event) before PaginationComp updates (via processServerResult method)\n this.dispatchLoadCompleted();\n var requestMostRecentAndLive = this.isRequestMostRecentAndLive(version);\n if (requestMostRecentAndLive) {\n this.state = RowNodeBlock.STATE_LOADED;\n this.processServerResult(params);\n }\n };\n RowNodeBlock.prototype.dispatchLoadCompleted = function (success) {\n if (success === void 0) { success = true; }\n // we fire event regardless of processing data or now, as we want\n // the concurrentLoadRequests count to be reduced in BlockLoader\n var event = {\n type: RowNodeBlock.EVENT_LOAD_COMPLETE,\n success: success,\n block: this\n };\n this.dispatchEvent(event);\n };\n RowNodeBlock.EVENT_LOAD_COMPLETE = 'loadComplete';\n RowNodeBlock.STATE_WAITING_TO_LOAD = 'needsLoading';\n RowNodeBlock.STATE_LOADING = 'loading';\n RowNodeBlock.STATE_LOADED = 'loaded';\n RowNodeBlock.STATE_FAILED = 'failed';\n return RowNodeBlock;\n}(BeanStub));\n\nvar __extends$1f = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1c = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param$5 = ( false) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar RowNodeBlockLoader = /** @class */ (function (_super) {\n __extends$1f(RowNodeBlockLoader, _super);\n function RowNodeBlockLoader() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.activeBlockLoadsCount = 0;\n _this.blocks = [];\n _this.active = true;\n return _this;\n }\n RowNodeBlockLoader_1 = RowNodeBlockLoader;\n RowNodeBlockLoader.prototype.postConstruct = function () {\n this.maxConcurrentRequests = this.getMaxConcurrentDatasourceRequests();\n var blockLoadDebounceMillis = this.gridOptionsService.get('blockLoadDebounceMillis');\n if (blockLoadDebounceMillis && blockLoadDebounceMillis > 0) {\n this.checkBlockToLoadDebounce = _.debounce(this.performCheckBlocksToLoad.bind(this), blockLoadDebounceMillis);\n }\n };\n RowNodeBlockLoader.prototype.setBeans = function (loggerFactory) {\n this.logger = loggerFactory.create('RowNodeBlockLoader');\n };\n RowNodeBlockLoader.prototype.getMaxConcurrentDatasourceRequests = function () {\n var res = this.gridOptionsService.get('maxConcurrentDatasourceRequests');\n if (res == null) {\n return 2;\n } // 2 is the default\n if (res <= 0) {\n return;\n } // negative number, eg -1, means no max restriction\n return res;\n };\n RowNodeBlockLoader.prototype.addBlock = function (block) {\n this.blocks.push(block);\n // note that we do not remove this listener when removing the block. this is because the\n // cache can get destroyed (and containing blocks) when a block is loading. however the loading block\n // is still counted as an active loading block and we must decrement activeBlockLoadsCount when it finishes.\n block.addEventListener(RowNodeBlock.EVENT_LOAD_COMPLETE, this.loadComplete.bind(this));\n this.checkBlockToLoad();\n };\n RowNodeBlockLoader.prototype.removeBlock = function (block) {\n _.removeFromArray(this.blocks, block);\n };\n RowNodeBlockLoader.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.active = false;\n };\n RowNodeBlockLoader.prototype.loadComplete = function () {\n this.activeBlockLoadsCount--;\n this.checkBlockToLoad();\n this.dispatchEvent({ type: RowNodeBlockLoader_1.BLOCK_LOADED_EVENT });\n if (this.activeBlockLoadsCount == 0) {\n this.dispatchEvent({ type: RowNodeBlockLoader_1.BLOCK_LOADER_FINISHED_EVENT });\n }\n };\n RowNodeBlockLoader.prototype.checkBlockToLoad = function () {\n if (this.checkBlockToLoadDebounce) {\n this.checkBlockToLoadDebounce();\n }\n else {\n this.performCheckBlocksToLoad();\n }\n };\n RowNodeBlockLoader.prototype.performCheckBlocksToLoad = function () {\n if (!this.active) {\n return;\n }\n this.printCacheStatus();\n if (this.maxConcurrentRequests != null && this.activeBlockLoadsCount >= this.maxConcurrentRequests) {\n this.logger.log(\"checkBlockToLoad: max loads exceeded\");\n return;\n }\n var loadAvailability = this.getAvailableLoadingCount();\n var blocksToLoad = this.blocks.filter(function (block) { return (block.getState() === RowNodeBlock.STATE_WAITING_TO_LOAD); }).slice(0, loadAvailability);\n this.registerLoads(blocksToLoad.length);\n blocksToLoad.forEach(function (block) { return block.load(); });\n this.printCacheStatus();\n };\n RowNodeBlockLoader.prototype.getBlockState = function () {\n if (this.gridOptionsService.isRowModelType('serverSide')) {\n var ssrm = this.rowModel;\n return ssrm.getBlockStates();\n }\n var result = {};\n this.blocks.forEach(function (block) {\n var _a = block.getBlockStateJson(), id = _a.id, state = _a.state;\n result[id] = state;\n });\n return result;\n };\n RowNodeBlockLoader.prototype.printCacheStatus = function () {\n if (this.logger.isLogging()) {\n this.logger.log(\"printCacheStatus: activePageLoadsCount = \".concat(this.activeBlockLoadsCount, \",\")\n + \" blocks = \".concat(JSON.stringify(this.getBlockState())));\n }\n };\n RowNodeBlockLoader.prototype.isLoading = function () {\n return this.activeBlockLoadsCount > 0;\n };\n RowNodeBlockLoader.prototype.registerLoads = function (count) {\n this.activeBlockLoadsCount += count;\n };\n RowNodeBlockLoader.prototype.getAvailableLoadingCount = function () {\n return this.maxConcurrentRequests !== undefined ? this.maxConcurrentRequests - this.activeBlockLoadsCount : undefined;\n };\n var RowNodeBlockLoader_1;\n RowNodeBlockLoader.BLOCK_LOADED_EVENT = 'blockLoaded';\n RowNodeBlockLoader.BLOCK_LOADER_FINISHED_EVENT = 'blockLoaderFinished';\n __decorate$1c([\n Autowired('rowModel')\n ], RowNodeBlockLoader.prototype, \"rowModel\", void 0);\n __decorate$1c([\n PostConstruct\n ], RowNodeBlockLoader.prototype, \"postConstruct\", null);\n __decorate$1c([\n __param$5(0, Qualifier('loggerFactory'))\n ], RowNodeBlockLoader.prototype, \"setBeans\", null);\n RowNodeBlockLoader = RowNodeBlockLoader_1 = __decorate$1c([\n Bean('rowNodeBlockLoader')\n ], RowNodeBlockLoader);\n return RowNodeBlockLoader;\n}(BeanStub));\n\nvar __extends$1e = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1b = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar PaginationProxy = /** @class */ (function (_super) {\n __extends$1e(PaginationProxy, _super);\n function PaginationProxy() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.currentPage = 0;\n _this.topDisplayedRowIndex = 0;\n _this.bottomDisplayedRowIndex = 0;\n _this.pixelOffset = 0;\n _this.masterRowCount = 0;\n return _this;\n }\n PaginationProxy.prototype.postConstruct = function () {\n this.active = this.gridOptionsService.get('pagination');\n this.pageSizeFromGridOptions = this.gridOptionsService.get('paginationPageSize');\n this.paginateChildRows = this.isPaginateChildRows();\n this.addManagedListener(this.eventService, Events.EVENT_MODEL_UPDATED, this.onModelUpdated.bind(this));\n this.addManagedPropertyListener('pagination', this.onPaginationGridOptionChanged.bind(this));\n this.addManagedPropertyListener('paginationPageSize', this.onPageSizeGridOptionChanged.bind(this));\n this.onModelUpdated();\n };\n PaginationProxy.prototype.ensureRowHeightsValid = function (startPixel, endPixel, startLimitIndex, endLimitIndex) {\n var res = this.rowModel.ensureRowHeightsValid(startPixel, endPixel, this.getPageFirstRow(), this.getPageLastRow());\n if (res) {\n this.calculatePages();\n }\n return res;\n };\n PaginationProxy.prototype.isPaginateChildRows = function () {\n var shouldPaginate = this.gridOptionsService.get('groupRemoveSingleChildren') || this.gridOptionsService.get('groupRemoveLowestSingleChildren');\n if (shouldPaginate) {\n return true;\n }\n return this.gridOptionsService.get('paginateChildRows');\n };\n PaginationProxy.prototype.onModelUpdated = function (modelUpdatedEvent) {\n this.calculatePages();\n var paginationChangedEvent = {\n type: Events.EVENT_PAGINATION_CHANGED,\n animate: modelUpdatedEvent ? modelUpdatedEvent.animate : false,\n newData: modelUpdatedEvent ? modelUpdatedEvent.newData : false,\n newPage: modelUpdatedEvent ? modelUpdatedEvent.newPage : false,\n newPageSize: modelUpdatedEvent ? modelUpdatedEvent.newPageSize : false,\n keepRenderedRows: modelUpdatedEvent ? modelUpdatedEvent.keepRenderedRows : false\n };\n this.eventService.dispatchEvent(paginationChangedEvent);\n };\n PaginationProxy.prototype.onPaginationGridOptionChanged = function () {\n this.active = this.gridOptionsService.get('pagination');\n this.calculatePages();\n var paginationChangedEvent = {\n type: Events.EVENT_PAGINATION_CHANGED,\n animate: false,\n newData: false,\n newPage: false,\n newPageSize: false,\n // important to keep rendered rows, otherwise every time grid is resized,\n // we would destroy all the rows.\n keepRenderedRows: true\n };\n this.eventService.dispatchEvent(paginationChangedEvent);\n };\n PaginationProxy.prototype.onPageSizeGridOptionChanged = function () {\n this.setPageSize(this.gridOptionsService.get('paginationPageSize'), 'gridOptions');\n };\n PaginationProxy.prototype.goToPage = function (page) {\n if (!this.active || this.currentPage === page || typeof this.currentPage !== 'number') {\n return;\n }\n this.currentPage = page;\n var event = {\n type: Events.EVENT_MODEL_UPDATED,\n animate: false,\n keepRenderedRows: false,\n newData: false,\n newPage: true,\n newPageSize: false\n };\n this.onModelUpdated(event);\n };\n PaginationProxy.prototype.getPixelOffset = function () {\n return this.pixelOffset;\n };\n PaginationProxy.prototype.getRow = function (index) {\n return this.rowModel.getRow(index);\n };\n PaginationProxy.prototype.getRowNode = function (id) {\n return this.rowModel.getRowNode(id);\n };\n PaginationProxy.prototype.getRowIndexAtPixel = function (pixel) {\n return this.rowModel.getRowIndexAtPixel(pixel);\n };\n PaginationProxy.prototype.getCurrentPageHeight = function () {\n if (missing(this.topRowBounds) || missing(this.bottomRowBounds)) {\n return 0;\n }\n return Math.max(this.bottomRowBounds.rowTop + this.bottomRowBounds.rowHeight - this.topRowBounds.rowTop, 0);\n };\n PaginationProxy.prototype.getCurrentPagePixelRange = function () {\n var pageFirstPixel = this.topRowBounds ? this.topRowBounds.rowTop : 0;\n var pageLastPixel = this.bottomRowBounds ? this.bottomRowBounds.rowTop + this.bottomRowBounds.rowHeight : 0;\n return { pageFirstPixel: pageFirstPixel, pageLastPixel: pageLastPixel };\n };\n PaginationProxy.prototype.isRowPresent = function (rowNode) {\n if (!this.rowModel.isRowPresent(rowNode)) {\n return false;\n }\n var nodeIsInPage = rowNode.rowIndex >= this.topDisplayedRowIndex && rowNode.rowIndex <= this.bottomDisplayedRowIndex;\n return nodeIsInPage;\n };\n PaginationProxy.prototype.isEmpty = function () {\n return this.rowModel.isEmpty();\n };\n PaginationProxy.prototype.isRowsToRender = function () {\n return this.rowModel.isRowsToRender();\n };\n PaginationProxy.prototype.forEachNode = function (callback) {\n return this.rowModel.forEachNode(callback);\n };\n PaginationProxy.prototype.forEachNodeOnPage = function (callback) {\n var firstRow = this.getPageFirstRow();\n var lastRow = this.getPageLastRow();\n for (var i = firstRow; i <= lastRow; i++) {\n var node = this.getRow(i);\n if (node) {\n callback(node);\n }\n }\n };\n PaginationProxy.prototype.getType = function () {\n return this.rowModel.getType();\n };\n PaginationProxy.prototype.getRowBounds = function (index) {\n var res = this.rowModel.getRowBounds(index);\n res.rowIndex = index;\n return res;\n };\n PaginationProxy.prototype.getPageFirstRow = function () {\n return this.topRowBounds ? this.topRowBounds.rowIndex : -1;\n };\n PaginationProxy.prototype.getPageLastRow = function () {\n return this.bottomRowBounds ? this.bottomRowBounds.rowIndex : -1;\n };\n PaginationProxy.prototype.getRowCount = function () {\n return this.rowModel.getRowCount();\n };\n PaginationProxy.prototype.getPageForIndex = function (index) {\n return Math.floor(index / this.pageSize);\n };\n PaginationProxy.prototype.goToPageWithIndex = function (index) {\n if (!this.active) {\n return;\n }\n var pageNumber = this.getPageForIndex(index);\n this.goToPage(pageNumber);\n };\n PaginationProxy.prototype.isRowInPage = function (row) {\n if (!this.active) {\n return true;\n }\n var rowPage = this.getPageForIndex(row.rowIndex);\n return rowPage === this.currentPage;\n };\n PaginationProxy.prototype.isLastPageFound = function () {\n return this.rowModel.isLastRowIndexKnown();\n };\n PaginationProxy.prototype.getCurrentPage = function () {\n return this.currentPage;\n };\n PaginationProxy.prototype.goToNextPage = function () {\n this.goToPage(this.currentPage + 1);\n };\n PaginationProxy.prototype.goToPreviousPage = function () {\n this.goToPage(this.currentPage - 1);\n };\n PaginationProxy.prototype.goToFirstPage = function () {\n this.goToPage(0);\n };\n PaginationProxy.prototype.goToLastPage = function () {\n var rowCount = this.rowModel.getRowCount();\n var lastPage = Math.floor(rowCount / this.pageSize);\n this.goToPage(lastPage);\n };\n PaginationProxy.prototype.getPageSize = function () {\n return this.pageSize;\n };\n PaginationProxy.prototype.getTotalPages = function () {\n return this.totalPages;\n };\n /** This is only for state setting before data has been loaded */\n PaginationProxy.prototype.setPage = function (page) {\n this.currentPage = page;\n };\n Object.defineProperty(PaginationProxy.prototype, \"pageSize\", {\n get: function () {\n if (exists(this.pageSizeAutoCalculated)) {\n return this.pageSizeAutoCalculated;\n }\n if (exists(this.pageSizeFromPageSizeSelector)) {\n return this.pageSizeFromPageSizeSelector;\n }\n if (exists(this.pageSizeFromInitialState)) {\n return this.pageSizeFromInitialState;\n }\n if (exists(this.pageSizeFromGridOptions)) {\n return this.pageSizeFromGridOptions;\n }\n return this.defaultPageSize;\n },\n enumerable: false,\n configurable: true\n });\n PaginationProxy.prototype.unsetAutoCalculatedPageSize = function () {\n if (this.pageSizeAutoCalculated === undefined) {\n return;\n }\n var oldPageSize = this.pageSizeAutoCalculated;\n this.pageSizeAutoCalculated = undefined;\n if (this.pageSize === oldPageSize) {\n return;\n }\n this.onModelUpdated({\n type: Events.EVENT_MODEL_UPDATED,\n animate: false,\n keepRenderedRows: false,\n newData: false,\n newPage: false,\n newPageSize: true,\n });\n };\n PaginationProxy.prototype.setPageSize = function (size, source) {\n var currentSize = this.pageSize;\n switch (source) {\n case 'autoCalculated':\n this.pageSizeAutoCalculated = size;\n break;\n case 'pageSizeSelector':\n this.pageSizeFromPageSizeSelector = size;\n if (this.currentPage !== 0) {\n this.goToFirstPage();\n }\n break;\n case 'initialState':\n this.pageSizeFromInitialState = size;\n break;\n case 'gridOptions':\n this.pageSizeFromGridOptions = size;\n this.pageSizeFromInitialState = undefined;\n this.pageSizeFromPageSizeSelector = undefined;\n if (this.currentPage !== 0) {\n this.goToFirstPage();\n }\n break;\n }\n if (currentSize !== this.pageSize) {\n var event_1 = {\n type: Events.EVENT_MODEL_UPDATED,\n animate: false,\n keepRenderedRows: false,\n newData: false,\n newPage: false,\n newPageSize: true,\n };\n this.onModelUpdated(event_1);\n }\n };\n PaginationProxy.prototype.calculatePages = function () {\n if (this.active) {\n if (this.paginateChildRows) {\n this.calculatePagesAllRows();\n }\n else {\n this.calculatePagesMasterRowsOnly();\n }\n }\n else {\n this.calculatedPagesNotActive();\n }\n this.topRowBounds = this.rowModel.getRowBounds(this.topDisplayedRowIndex);\n if (this.topRowBounds) {\n this.topRowBounds.rowIndex = this.topDisplayedRowIndex;\n }\n this.bottomRowBounds = this.rowModel.getRowBounds(this.bottomDisplayedRowIndex);\n if (this.bottomRowBounds) {\n this.bottomRowBounds.rowIndex = this.bottomDisplayedRowIndex;\n }\n this.setPixelOffset(exists(this.topRowBounds) ? this.topRowBounds.rowTop : 0);\n };\n PaginationProxy.prototype.setPixelOffset = function (value) {\n if (this.pixelOffset === value) {\n return;\n }\n this.pixelOffset = value;\n this.eventService.dispatchEvent({ type: Events.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED });\n };\n PaginationProxy.prototype.setZeroRows = function () {\n this.masterRowCount = 0;\n this.topDisplayedRowIndex = 0;\n this.bottomDisplayedRowIndex = -1;\n this.currentPage = 0;\n this.totalPages = 0;\n };\n PaginationProxy.prototype.adjustCurrentPageIfInvalid = function () {\n if (this.currentPage >= this.totalPages) {\n this.currentPage = this.totalPages - 1;\n }\n if (!isFinite(this.currentPage) || isNaN(this.currentPage) || this.currentPage < 0) {\n this.currentPage = 0;\n }\n };\n PaginationProxy.prototype.calculatePagesMasterRowsOnly = function () {\n // const csrm = this.rowModel;\n // const rootNode = csrm.getRootNode();\n // const masterRows = rootNode.childrenAfterSort;\n this.masterRowCount = this.rowModel.getTopLevelRowCount();\n // we say <=0 (rather than =0) as viewport returns -1 when no rows\n if (this.masterRowCount <= 0) {\n this.setZeroRows();\n return;\n }\n var masterLastRowIndex = this.masterRowCount - 1;\n this.totalPages = Math.floor((masterLastRowIndex) / this.pageSize) + 1;\n this.adjustCurrentPageIfInvalid();\n var masterPageStartIndex = this.pageSize * this.currentPage;\n var masterPageEndIndex = (this.pageSize * (this.currentPage + 1)) - 1;\n if (masterPageEndIndex > masterLastRowIndex) {\n masterPageEndIndex = masterLastRowIndex;\n }\n this.topDisplayedRowIndex = this.rowModel.getTopLevelRowDisplayedIndex(masterPageStartIndex);\n // masterRows[masterPageStartIndex].rowIndex;\n if (masterPageEndIndex === masterLastRowIndex) {\n // if showing the last master row, then we want to show the very last row of the model\n this.bottomDisplayedRowIndex = this.rowModel.getRowCount() - 1;\n }\n else {\n var firstIndexNotToShow = this.rowModel.getTopLevelRowDisplayedIndex(masterPageEndIndex + 1);\n //masterRows[masterPageEndIndex + 1].rowIndex;\n // this gets the index of the last child - eg current row is open, we want to display all children,\n // the index of the last child is one less than the index of the next parent row.\n this.bottomDisplayedRowIndex = firstIndexNotToShow - 1;\n }\n };\n PaginationProxy.prototype.getMasterRowCount = function () {\n return this.masterRowCount;\n };\n PaginationProxy.prototype.calculatePagesAllRows = function () {\n this.masterRowCount = this.rowModel.getRowCount();\n if (this.masterRowCount === 0) {\n this.setZeroRows();\n return;\n }\n var maxRowIndex = this.masterRowCount - 1;\n this.totalPages = Math.floor((maxRowIndex) / this.pageSize) + 1;\n this.adjustCurrentPageIfInvalid();\n this.topDisplayedRowIndex = this.pageSize * this.currentPage;\n this.bottomDisplayedRowIndex = (this.pageSize * (this.currentPage + 1)) - 1;\n if (this.bottomDisplayedRowIndex > maxRowIndex) {\n this.bottomDisplayedRowIndex = maxRowIndex;\n }\n };\n PaginationProxy.prototype.calculatedPagesNotActive = function () {\n this.setPageSize(this.masterRowCount, 'autoCalculated');\n this.totalPages = 1;\n this.currentPage = 0;\n this.topDisplayedRowIndex = 0;\n this.bottomDisplayedRowIndex = this.rowModel.getRowCount() - 1;\n };\n __decorate$1b([\n Autowired('rowModel')\n ], PaginationProxy.prototype, \"rowModel\", void 0);\n __decorate$1b([\n PostConstruct\n ], PaginationProxy.prototype, \"postConstruct\", null);\n PaginationProxy = __decorate$1b([\n Bean('paginationProxy')\n ], PaginationProxy);\n return PaginationProxy;\n}(BeanStub));\n\nvar __extends$1d = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1a = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar StylingService = /** @class */ (function (_super) {\n __extends$1d(StylingService, _super);\n function StylingService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n StylingService.prototype.processAllCellClasses = function (colDef, params, onApplicableClass, onNotApplicableClass) {\n this.processClassRules(undefined, colDef.cellClassRules, params, onApplicableClass, onNotApplicableClass);\n this.processStaticCellClasses(colDef, params, onApplicableClass);\n };\n StylingService.prototype.processClassRules = function (previousClassRules, classRules, params, onApplicableClass, onNotApplicableClass) {\n if (classRules == null && previousClassRules == null) {\n return;\n }\n var classesToApply = {};\n var classesToRemove = {};\n var forEachSingleClass = function (className, callback) {\n // in case className = 'my-class1 my-class2', we need to split into individual class names\n className.split(' ').forEach(function (singleClass) {\n if (singleClass.trim() == '')\n return;\n callback(singleClass);\n });\n };\n if (classRules) {\n var classNames = Object.keys(classRules);\n var _loop_1 = function (i) {\n var className = classNames[i];\n var rule = classRules[className];\n var resultOfRule;\n if (typeof rule === 'string') {\n resultOfRule = this_1.expressionService.evaluate(rule, params);\n }\n else if (typeof rule === 'function') {\n resultOfRule = rule(params);\n }\n forEachSingleClass(className, function (singleClass) {\n resultOfRule ? classesToApply[singleClass] = true : classesToRemove[singleClass] = true;\n });\n };\n var this_1 = this;\n for (var i = 0; i < classNames.length; i++) {\n _loop_1(i);\n }\n }\n if (previousClassRules && onNotApplicableClass) {\n Object.keys(previousClassRules).forEach(function (className) { return forEachSingleClass(className, function (singleClass) {\n if (!classesToApply[singleClass]) {\n // if we're not applying a previous class now, make sure we remove it\n classesToRemove[singleClass] = true;\n }\n }); });\n }\n // we remove all classes first, then add all classes second,\n // in case a class appears in more than one rule, this means it will be added\n // if appears in at least one truthy rule\n if (onNotApplicableClass) {\n Object.keys(classesToRemove).forEach(onNotApplicableClass);\n }\n Object.keys(classesToApply).forEach(onApplicableClass);\n };\n StylingService.prototype.getStaticCellClasses = function (colDef, params) {\n var cellClass = colDef.cellClass;\n if (!cellClass) {\n return [];\n }\n var classOrClasses;\n if (typeof cellClass === 'function') {\n var cellClassFunc = cellClass;\n classOrClasses = cellClassFunc(params);\n }\n else {\n classOrClasses = cellClass;\n }\n if (typeof classOrClasses === 'string') {\n classOrClasses = [classOrClasses];\n }\n return classOrClasses || [];\n };\n StylingService.prototype.processStaticCellClasses = function (colDef, params, onApplicableClass) {\n var classOrClasses = this.getStaticCellClasses(colDef, params);\n classOrClasses.forEach(function (cssClassItem) {\n onApplicableClass(cssClassItem);\n });\n };\n __decorate$1a([\n Autowired('expressionService')\n ], StylingService.prototype, \"expressionService\", void 0);\n StylingService = __decorate$1a([\n Bean('stylingService')\n ], StylingService);\n return StylingService;\n}(BeanStub));\n\nvar __extends$1c = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar AgToggleButton = /** @class */ (function (_super) {\n __extends$1c(AgToggleButton, _super);\n function AgToggleButton(config) {\n return _super.call(this, config, 'ag-toggle-button') || this;\n }\n AgToggleButton.prototype.setValue = function (value, silent) {\n _super.prototype.setValue.call(this, value, silent);\n this.addOrRemoveCssClass('ag-selected', this.getValue());\n return this;\n };\n return AgToggleButton;\n}(AgCheckbox));\n\nvar __extends$1b = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar AgInputTextArea = /** @class */ (function (_super) {\n __extends$1b(AgInputTextArea, _super);\n function AgInputTextArea(config) {\n return _super.call(this, config, 'ag-text-area', null, 'textarea') || this;\n }\n AgInputTextArea.prototype.setValue = function (value, silent) {\n var ret = _super.prototype.setValue.call(this, value, silent);\n this.eInput.value = value;\n return ret;\n };\n AgInputTextArea.prototype.setCols = function (cols) {\n this.eInput.cols = cols;\n return this;\n };\n AgInputTextArea.prototype.setRows = function (rows) {\n this.eInput.rows = rows;\n return this;\n };\n return AgInputTextArea;\n}(AgAbstractInputField));\n\nvar __extends$1a = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar AgInputDateField = /** @class */ (function (_super) {\n __extends$1a(AgInputDateField, _super);\n function AgInputDateField(config) {\n return _super.call(this, config, 'ag-date-field', 'date') || this;\n }\n AgInputDateField.prototype.postConstruct = function () {\n var _this = this;\n _super.prototype.postConstruct.call(this);\n this.addManagedListener(this.eInput, 'wheel', this.onWheel.bind(this));\n // ensures that the input element is focussed when a clear button is clicked,\n // unless using safari as there is no clear button and focus does not work properly\n var usingSafari = isBrowserSafari();\n this.addManagedListener(this.eInput, 'mousedown', function () {\n if (_this.isDisabled() || usingSafari) {\n return;\n }\n _this.eInput.focus();\n });\n this.eInput.step = 'any';\n };\n AgInputDateField.prototype.onWheel = function (e) {\n // Prevent default scroll events from incrementing / decrementing the input, since its inconsistent between browsers\n if (document.activeElement === this.eInput) {\n e.preventDefault();\n }\n };\n AgInputDateField.prototype.setMin = function (minDate) {\n var _a;\n var min = minDate instanceof Date ? (_a = serialiseDate(minDate !== null && minDate !== void 0 ? minDate : null, false)) !== null && _a !== void 0 ? _a : undefined : minDate;\n if (this.min === min) {\n return this;\n }\n this.min = min;\n addOrRemoveAttribute(this.eInput, 'min', min);\n return this;\n };\n AgInputDateField.prototype.setMax = function (maxDate) {\n var _a;\n var max = maxDate instanceof Date ? (_a = serialiseDate(maxDate !== null && maxDate !== void 0 ? maxDate : null, false)) !== null && _a !== void 0 ? _a : undefined : maxDate;\n if (this.max === max) {\n return this;\n }\n this.max = max;\n addOrRemoveAttribute(this.eInput, 'max', max);\n return this;\n };\n AgInputDateField.prototype.setStep = function (step) {\n if (this.step === step) {\n return this;\n }\n this.step = step;\n addOrRemoveAttribute(this.eInput, 'step', step);\n return this;\n };\n AgInputDateField.prototype.getDate = function () {\n var _a;\n if (!this.eInput.validity.valid) {\n return undefined;\n }\n return (_a = parseDateTimeFromString(this.getValue())) !== null && _a !== void 0 ? _a : undefined;\n };\n AgInputDateField.prototype.setDate = function (date, silent) {\n this.setValue(serialiseDate(date !== null && date !== void 0 ? date : null, false), silent);\n };\n return AgInputDateField;\n}(AgInputTextField));\n\nvar __extends$19 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar AgInputRange = /** @class */ (function (_super) {\n __extends$19(AgInputRange, _super);\n function AgInputRange(config) {\n return _super.call(this, config, 'ag-range-field', 'range') || this;\n }\n AgInputRange.prototype.postConstruct = function () {\n _super.prototype.postConstruct.call(this);\n var _a = this.config, min = _a.min, max = _a.max, step = _a.step;\n if (min != null) {\n this.setMinValue(min);\n }\n if (max != null) {\n this.setMaxValue(max);\n }\n this.setStep(step || 1);\n };\n AgInputRange.prototype.addInputListeners = function () {\n var _this = this;\n this.addManagedListener(this.eInput, 'input', function (e) {\n var value = e.target.value;\n _this.setValue(value);\n });\n };\n AgInputRange.prototype.setMinValue = function (value) {\n this.min = value;\n this.eInput.setAttribute('min', value.toString());\n return this;\n };\n AgInputRange.prototype.setMaxValue = function (value) {\n this.max = value;\n this.eInput.setAttribute('max', value.toString());\n return this;\n };\n AgInputRange.prototype.setStep = function (value) {\n this.eInput.setAttribute('step', value.toString());\n return this;\n };\n AgInputRange.prototype.setValue = function (value, silent) {\n if (this.min != null) {\n value = Math.max(parseFloat(value), this.min).toString();\n }\n if (this.max != null) {\n value = Math.min(parseFloat(value), this.max).toString();\n }\n var ret = _super.prototype.setValue.call(this, value, silent);\n this.eInput.value = value;\n return ret;\n };\n return AgInputRange;\n}(AgAbstractInputField));\n\nvar __extends$18 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$19 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar RichSelectRow = /** @class */ (function (_super) {\n __extends$18(RichSelectRow, _super);\n function RichSelectRow(params, wrapperEl) {\n var _this = _super.call(this, /* html */ \"
\") || this;\n _this.params = params;\n _this.wrapperEl = wrapperEl;\n return _this;\n }\n RichSelectRow.prototype.postConstruct = function () {\n this.addManagedListener(this.getGui(), 'click', this.onClick.bind(this));\n };\n RichSelectRow.prototype.setState = function (value) {\n var formattedValue = '';\n if (this.params.valueFormatter) {\n formattedValue = this.params.valueFormatter(value);\n }\n var rendererSuccessful = this.populateWithRenderer(value, formattedValue);\n if (!rendererSuccessful) {\n this.populateWithoutRenderer(value, formattedValue);\n }\n this.value = value;\n };\n RichSelectRow.prototype.highlightString = function (matchString) {\n var parsedValue = this.parsedValue;\n if (this.params.cellRenderer || !exists(parsedValue)) {\n return;\n }\n var hasMatch = exists(matchString);\n if (hasMatch) {\n var index = parsedValue === null || parsedValue === void 0 ? void 0 : parsedValue.toLocaleLowerCase().indexOf(matchString.toLocaleLowerCase());\n if (index >= 0) {\n var highlightEndIndex = index + matchString.length;\n var startPart = escapeString(parsedValue.slice(0, index), true);\n var highlightedPart = escapeString(parsedValue.slice(index, highlightEndIndex), true);\n var endPart = escapeString(parsedValue.slice(highlightEndIndex));\n this.renderValueWithoutRenderer(\"\".concat(startPart, \"\").concat(highlightedPart, \"\").concat(endPart));\n }\n else {\n hasMatch = false;\n }\n }\n if (!hasMatch) {\n this.renderValueWithoutRenderer(parsedValue);\n }\n };\n RichSelectRow.prototype.updateHighlighted = function (highlighted) {\n var _a;\n var eGui = this.getGui();\n var parentId = \"ag-rich-select-row-\".concat(this.getCompId());\n (_a = eGui.parentElement) === null || _a === void 0 ? void 0 : _a.setAttribute('id', parentId);\n if (highlighted) {\n var parentAriaEl = this.getParentComponent().getAriaElement();\n setAriaActiveDescendant(parentAriaEl, parentId);\n this.wrapperEl.setAttribute('data-active-option', parentId);\n }\n setAriaSelected(eGui.parentElement, highlighted);\n this.addOrRemoveCssClass('ag-rich-select-row-selected', highlighted);\n };\n RichSelectRow.prototype.populateWithoutRenderer = function (value, valueFormatted) {\n var eDocument = this.gridOptionsService.getDocument();\n var eGui = this.getGui();\n var span = eDocument.createElement('span');\n span.style.overflow = 'hidden';\n span.style.textOverflow = 'ellipsis';\n var parsedValue = escapeString(exists(valueFormatted) ? valueFormatted : value, true);\n this.parsedValue = exists(parsedValue) ? parsedValue : null;\n eGui.appendChild(span);\n this.renderValueWithoutRenderer(parsedValue);\n };\n RichSelectRow.prototype.renderValueWithoutRenderer = function (value) {\n var span = this.getGui().querySelector('span');\n if (!span) {\n return;\n }\n span.innerHTML = exists(value) ? value : ' ';\n };\n RichSelectRow.prototype.populateWithRenderer = function (value, valueFormatted) {\n var _this = this;\n // bad coder here - we are not populating all values of the cellRendererParams\n var cellRendererPromise;\n var userCompDetails;\n if (this.params.cellRenderer) {\n userCompDetails = this.userComponentFactory.getCellRendererDetails(this.params, {\n value: value,\n valueFormatted: valueFormatted\n });\n }\n if (userCompDetails) {\n cellRendererPromise = userCompDetails.newAgStackInstance();\n }\n if (cellRendererPromise) {\n bindCellRendererToHtmlElement(cellRendererPromise, this.getGui());\n }\n if (cellRendererPromise) {\n cellRendererPromise.then(function (childComponent) {\n _this.addDestroyFunc(function () {\n _this.getContext().destroyBean(childComponent);\n });\n });\n return true;\n }\n return false;\n };\n RichSelectRow.prototype.onClick = function () {\n var parent = this.getParentComponent();\n var event = {\n type: Events.EVENT_FIELD_PICKER_VALUE_SELECTED,\n fromEnterKey: false,\n value: this.value\n };\n parent === null || parent === void 0 ? void 0 : parent.dispatchEvent(event);\n };\n __decorate$19([\n Autowired('userComponentFactory')\n ], RichSelectRow.prototype, \"userComponentFactory\", void 0);\n __decorate$19([\n PostConstruct\n ], RichSelectRow.prototype, \"postConstruct\", null);\n return RichSelectRow;\n}(Component));\n\nvar __extends$17 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$18 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar VirtualList = /** @class */ (function (_super) {\n __extends$17(VirtualList, _super);\n function VirtualList(params) {\n var _this = _super.call(this, VirtualList.getTemplate((params === null || params === void 0 ? void 0 : params.cssIdentifier) || 'default')) || this;\n _this.renderedRows = new Map();\n _this.rowHeight = 20;\n var _a = params || {}, _b = _a.cssIdentifier, cssIdentifier = _b === void 0 ? 'default' : _b, _c = _a.ariaRole, ariaRole = _c === void 0 ? 'listbox' : _c, listName = _a.listName;\n _this.cssIdentifier = cssIdentifier;\n _this.ariaRole = ariaRole;\n _this.listName = listName;\n return _this;\n }\n VirtualList.prototype.postConstruct = function () {\n var _this = this;\n this.addScrollListener();\n this.rowHeight = this.getItemHeight();\n this.addResizeObserver();\n this.initialiseTabGuard({\n onFocusIn: function (e) { return _this.onFocusIn(e); },\n onFocusOut: function (e) { return _this.onFocusOut(e); },\n focusInnerElement: function (fromBottom) { return _this.focusInnerElement(fromBottom); },\n onTabKeyDown: function (e) { return _this.onTabKeyDown(e); },\n handleKeyDown: function (e) { return _this.handleKeyDown(e); }\n });\n this.setAriaProperties();\n this.addManagedListener(this.eventService, Events.EVENT_GRID_STYLES_CHANGED, this.onGridStylesChanged.bind(this));\n };\n VirtualList.prototype.onGridStylesChanged = function () {\n this.rowHeight = this.getItemHeight();\n this.refresh();\n };\n VirtualList.prototype.setAriaProperties = function () {\n var translate = this.localeService.getLocaleTextFunc();\n var listName = translate('ariaDefaultListName', this.listName || 'List');\n var ariaEl = this.eContainer;\n setAriaRole(ariaEl, this.ariaRole);\n setAriaLabel(ariaEl, listName);\n };\n VirtualList.prototype.addResizeObserver = function () {\n var _this = this;\n // do this in an animation frame to prevent loops\n var listener = function () { return _this.animationFrameService.requestAnimationFrame(function () { return _this.drawVirtualRows(); }); };\n var destroyObserver = this.resizeObserverService.observeResize(this.getGui(), listener);\n this.addDestroyFunc(destroyObserver);\n };\n VirtualList.prototype.focusInnerElement = function (fromBottom) {\n this.focusRow(fromBottom ? this.model.getRowCount() - 1 : 0);\n };\n VirtualList.prototype.onFocusIn = function (e) {\n var target = e.target;\n if (target.classList.contains('ag-virtual-list-item')) {\n this.lastFocusedRowIndex = getAriaPosInSet(target) - 1;\n }\n };\n VirtualList.prototype.onFocusOut = function (e) {\n if (!this.getFocusableElement().contains(e.relatedTarget)) {\n this.lastFocusedRowIndex = null;\n }\n };\n VirtualList.prototype.handleKeyDown = function (e) {\n switch (e.key) {\n case KeyCode.UP:\n case KeyCode.DOWN:\n if (this.navigate(e.key === KeyCode.UP)) {\n e.preventDefault();\n }\n break;\n }\n };\n VirtualList.prototype.onTabKeyDown = function (e) {\n if (this.navigate(e.shiftKey)) {\n e.preventDefault();\n }\n else {\n stopPropagationForAgGrid(e);\n this.forceFocusOutOfContainer(e.shiftKey);\n }\n };\n VirtualList.prototype.navigate = function (up) {\n if (this.lastFocusedRowIndex == null) {\n return false;\n }\n var nextRow = this.lastFocusedRowIndex + (up ? -1 : 1);\n if (nextRow < 0 || nextRow >= this.model.getRowCount()) {\n return false;\n }\n this.focusRow(nextRow);\n return true;\n };\n VirtualList.prototype.getLastFocusedRow = function () {\n return this.lastFocusedRowIndex;\n };\n VirtualList.prototype.focusRow = function (rowNumber) {\n var _this = this;\n this.ensureIndexVisible(rowNumber);\n window.setTimeout(function () {\n if (!_this.isAlive()) {\n return;\n }\n var renderedRow = _this.renderedRows.get(rowNumber);\n if (renderedRow) {\n renderedRow.eDiv.focus();\n }\n }, 10);\n };\n VirtualList.prototype.getComponentAt = function (rowIndex) {\n var comp = this.renderedRows.get(rowIndex);\n return comp && comp.rowComponent;\n };\n VirtualList.prototype.forEachRenderedRow = function (func) {\n this.renderedRows.forEach(function (value, key) { return func(value.rowComponent, key); });\n };\n VirtualList.getTemplate = function (cssIdentifier) {\n return ( /* html */\"
\\n
\\n
\"));\n };\n VirtualList.prototype.getItemHeight = function () {\n return this.environment.getListItemHeight();\n };\n /**\n * Returns true if the view had to be scrolled, otherwise, false.\n */\n VirtualList.prototype.ensureIndexVisible = function (index, scrollPartialIntoView) {\n if (scrollPartialIntoView === void 0) { scrollPartialIntoView = true; }\n var lastRow = this.model.getRowCount();\n if (typeof index !== 'number' || index < 0 || index >= lastRow) {\n console.warn('AG Grid: invalid row index for ensureIndexVisible: ' + index);\n return false;\n }\n var rowTopPixel = index * this.rowHeight;\n var rowBottomPixel = rowTopPixel + this.rowHeight;\n var eGui = this.getGui();\n var viewportTopPixel = eGui.scrollTop;\n var viewportHeight = eGui.offsetHeight;\n var viewportBottomPixel = viewportTopPixel + viewportHeight;\n var diff = scrollPartialIntoView ? 0 : this.rowHeight;\n var viewportScrolledPastRow = viewportTopPixel > rowTopPixel + diff;\n var viewportScrolledBeforeRow = viewportBottomPixel < rowBottomPixel - diff;\n if (viewportScrolledPastRow) {\n // if row is before, scroll up with row at top\n eGui.scrollTop = rowTopPixel;\n return true;\n }\n if (viewportScrolledBeforeRow) {\n // if row is below, scroll down with row at bottom\n var newScrollPosition = rowBottomPixel - viewportHeight;\n eGui.scrollTop = newScrollPosition;\n return true;\n }\n return false;\n };\n VirtualList.prototype.setComponentCreator = function (componentCreator) {\n this.componentCreator = componentCreator;\n };\n VirtualList.prototype.setComponentUpdater = function (componentUpdater) {\n this.componentUpdater = componentUpdater;\n };\n VirtualList.prototype.getRowHeight = function () {\n return this.rowHeight;\n };\n VirtualList.prototype.getScrollTop = function () {\n return this.getGui().scrollTop;\n };\n VirtualList.prototype.setRowHeight = function (rowHeight) {\n this.rowHeight = rowHeight;\n this.refresh();\n };\n VirtualList.prototype.refresh = function (softRefresh) {\n var _this = this;\n if (this.model == null || !this.isAlive()) {\n return;\n }\n var rowCount = this.model.getRowCount();\n this.eContainer.style.height = \"\".concat(rowCount * this.rowHeight, \"px\");\n // ensure height is applied before attempting to redraw rows\n waitUntil(function () { return _this.eContainer.clientHeight >= rowCount * _this.rowHeight; }, function () {\n if (!_this.isAlive()) {\n return;\n }\n if (_this.canSoftRefresh(softRefresh)) {\n _this.drawVirtualRows(true);\n }\n else {\n _this.clearVirtualRows();\n _this.drawVirtualRows();\n }\n });\n };\n VirtualList.prototype.canSoftRefresh = function (softRefresh) {\n return !!(softRefresh && this.renderedRows.size && typeof this.model.areRowsEqual === 'function' && this.componentUpdater);\n };\n VirtualList.prototype.clearVirtualRows = function () {\n var _this = this;\n this.renderedRows.forEach(function (_, rowIndex) { return _this.removeRow(rowIndex); });\n };\n VirtualList.prototype.drawVirtualRows = function (softRefresh) {\n if (!this.isAlive() || !this.model) {\n return;\n }\n var gui = this.getGui();\n var topPixel = gui.scrollTop;\n var bottomPixel = topPixel + gui.offsetHeight;\n var firstRow = Math.floor(topPixel / this.rowHeight);\n var lastRow = Math.floor(bottomPixel / this.rowHeight);\n this.ensureRowsRendered(firstRow, lastRow, softRefresh);\n };\n VirtualList.prototype.ensureRowsRendered = function (start, finish, softRefresh) {\n var _this = this;\n // remove any rows that are no longer required\n this.renderedRows.forEach(function (_, rowIndex) {\n if ((rowIndex < start || rowIndex > finish) && rowIndex !== _this.lastFocusedRowIndex) {\n _this.removeRow(rowIndex);\n }\n });\n if (softRefresh) {\n // refresh any existing rows\n this.refreshRows();\n }\n // insert any required new rows\n for (var rowIndex = start; rowIndex <= finish; rowIndex++) {\n if (this.renderedRows.has(rowIndex)) {\n continue;\n }\n // check this row actually exists (in case overflow buffer window exceeds real data)\n if (rowIndex < this.model.getRowCount()) {\n this.insertRow(rowIndex);\n }\n }\n };\n VirtualList.prototype.insertRow = function (rowIndex) {\n var _this = this;\n var value = this.model.getRow(rowIndex);\n var eDiv = document.createElement('div');\n eDiv.classList.add('ag-virtual-list-item', \"ag-\".concat(this.cssIdentifier, \"-virtual-list-item\"));\n setAriaRole(eDiv, this.ariaRole === 'tree' ? 'treeitem' : 'option');\n setAriaSetSize(eDiv, this.model.getRowCount());\n setAriaPosInSet(eDiv, rowIndex + 1);\n eDiv.setAttribute('tabindex', '-1');\n eDiv.style.height = \"\".concat(this.rowHeight, \"px\");\n eDiv.style.top = \"\".concat(this.rowHeight * rowIndex, \"px\");\n var rowComponent = this.componentCreator(value, eDiv);\n rowComponent.addGuiEventListener('focusin', function () { return _this.lastFocusedRowIndex = rowIndex; });\n eDiv.appendChild(rowComponent.getGui());\n // keep the DOM order consistent with the order of the rows\n if (this.renderedRows.has(rowIndex - 1)) {\n this.renderedRows.get(rowIndex - 1).eDiv.insertAdjacentElement('afterend', eDiv);\n }\n else if (this.renderedRows.has(rowIndex + 1)) {\n this.renderedRows.get(rowIndex + 1).eDiv.insertAdjacentElement('beforebegin', eDiv);\n }\n else {\n this.eContainer.appendChild(eDiv);\n }\n this.renderedRows.set(rowIndex, { rowComponent: rowComponent, eDiv: eDiv, value: value });\n };\n VirtualList.prototype.removeRow = function (rowIndex) {\n var component = this.renderedRows.get(rowIndex);\n this.eContainer.removeChild(component.eDiv);\n this.destroyBean(component.rowComponent);\n this.renderedRows.delete(rowIndex);\n };\n VirtualList.prototype.refreshRows = function () {\n var _this = this;\n var rowCount = this.model.getRowCount();\n this.renderedRows.forEach(function (row, rowIndex) {\n var _a, _b;\n if (rowIndex >= rowCount) {\n _this.removeRow(rowIndex);\n }\n else {\n var newValue = _this.model.getRow(rowIndex);\n if ((_b = (_a = _this.model).areRowsEqual) === null || _b === void 0 ? void 0 : _b.call(_a, row.value, newValue)) {\n _this.componentUpdater(newValue, row.rowComponent);\n }\n else {\n // to be replaced later\n _this.removeRow(rowIndex);\n }\n }\n });\n };\n VirtualList.prototype.addScrollListener = function () {\n var _this = this;\n this.addGuiEventListener('scroll', function () { return _this.drawVirtualRows(); }, { passive: true });\n };\n VirtualList.prototype.setModel = function (model) {\n this.model = model;\n };\n VirtualList.prototype.getAriaElement = function () {\n return this.eContainer;\n };\n VirtualList.prototype.destroy = function () {\n if (!this.isAlive()) {\n return;\n }\n this.clearVirtualRows();\n _super.prototype.destroy.call(this);\n };\n __decorate$18([\n Autowired('resizeObserverService')\n ], VirtualList.prototype, \"resizeObserverService\", void 0);\n __decorate$18([\n Autowired('animationFrameService')\n ], VirtualList.prototype, \"animationFrameService\", void 0);\n __decorate$18([\n RefSelector('eContainer')\n ], VirtualList.prototype, \"eContainer\", void 0);\n __decorate$18([\n PostConstruct\n ], VirtualList.prototype, \"postConstruct\", null);\n return VirtualList;\n}(TabGuardComp));\n\nvar __extends$16 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$9 = ( false) || function () {\n __assign$9 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$9.apply(this, arguments);\n};\nvar __decorate$17 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar TEMPLATE = /* html */ \"\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n
\";\nvar AgRichSelect = /** @class */ (function (_super) {\n __extends$16(AgRichSelect, _super);\n function AgRichSelect(config) {\n var _this = this;\n var _a, _b;\n _this = _super.call(this, __assign$9(__assign$9({ pickerAriaLabelKey: 'ariaLabelRichSelectField', pickerAriaLabelValue: 'Rich Select Field', pickerType: 'ag-list', className: 'ag-rich-select', pickerIcon: 'smallDown', ariaRole: 'combobox', template: (_a = config === null || config === void 0 ? void 0 : config.template) !== null && _a !== void 0 ? _a : TEMPLATE, modalPicker: false }, config), { \n // maxPickerHeight needs to be set after expanding `config`\n maxPickerHeight: (_b = config === null || config === void 0 ? void 0 : config.maxPickerHeight) !== null && _b !== void 0 ? _b : 'calc(var(--ag-row-height) * 6.5)' })) || this;\n _this.searchString = '';\n _this.highlightedItem = -1;\n _this.lastRowHovered = -1;\n _this.searchStringCreator = null;\n var _c = config || {}, cellRowHeight = _c.cellRowHeight, value = _c.value, valueList = _c.valueList, searchStringCreator = _c.searchStringCreator;\n if (cellRowHeight != null) {\n _this.cellRowHeight = cellRowHeight;\n }\n if (value !== undefined) {\n _this.value = value;\n }\n if (valueList != null) {\n _this.values = valueList;\n }\n if (searchStringCreator) {\n _this.searchStringCreator = searchStringCreator;\n }\n return _this;\n }\n AgRichSelect.prototype.postConstruct = function () {\n var _this = this;\n _super.prototype.postConstruct.call(this);\n this.createLoadingElement();\n this.createListComponent();\n var _a = this.config, allowTyping = _a.allowTyping, placeholder = _a.placeholder;\n if (allowTyping) {\n this.eInput\n .setAutoComplete(false)\n .setInputPlaceholder(placeholder);\n this.eDisplayField.classList.add('ag-hidden');\n }\n else {\n this.eInput.setDisplayed(false);\n }\n this.eWrapper.tabIndex = this.gridOptionsService.get('tabIndex');\n var _b = this.config.searchDebounceDelay, searchDebounceDelay = _b === void 0 ? 300 : _b;\n this.clearSearchString = debounce(this.clearSearchString, searchDebounceDelay);\n this.renderSelectedValue();\n if (allowTyping) {\n this.eInput.onValueChange(function (value) { return _this.searchTextFromString(value); });\n this.addManagedListener(this.eWrapper, 'focus', this.onWrapperFocus.bind(this));\n }\n this.addManagedListener(this.eWrapper, 'focusout', this.onWrapperFocusOut.bind(this));\n };\n AgRichSelect.prototype.createLoadingElement = function () {\n var eDocument = this.gridOptionsService.getDocument();\n var translate = this.localeService.getLocaleTextFunc();\n var el = eDocument.createElement('div');\n el.classList.add('ag-loading-text');\n el.innerText = translate('loadingOoo', 'Loading...');\n this.eLoading = el;\n };\n AgRichSelect.prototype.createListComponent = function () {\n var _this = this;\n this.listComponent = this.createBean(new VirtualList({ cssIdentifier: 'rich-select' }));\n this.listComponent.setComponentCreator(this.createRowComponent.bind(this));\n var componentUpdater = function (item, component) { };\n this.listComponent.setComponentUpdater(componentUpdater);\n this.listComponent.setParentComponent(this);\n this.addManagedListener(this.listComponent, Events.EVENT_FIELD_PICKER_VALUE_SELECTED, function (e) {\n _this.onListValueSelected(e.value, e.fromEnterKey);\n });\n var cellRowHeight = this.cellRowHeight;\n if (cellRowHeight) {\n this.listComponent.setRowHeight(cellRowHeight);\n }\n var eListGui = this.listComponent.getGui();\n var eListAriaEl = this.listComponent.getAriaElement();\n this.addManagedListener(eListGui, 'mousemove', this.onPickerMouseMove.bind(this));\n this.addManagedListener(eListGui, 'mousedown', function (e) { return e.preventDefault(); });\n eListGui.classList.add('ag-rich-select-list');\n var listId = \"ag-rich-select-list-\".concat(this.listComponent.getCompId());\n eListAriaEl.setAttribute('id', listId);\n var translate = this.localeService.getLocaleTextFunc();\n var ariaLabel = translate(this.config.pickerAriaLabelKey, this.config.pickerAriaLabelValue);\n setAriaLabel(eListAriaEl, ariaLabel);\n setAriaControls(this.eWrapper, eListAriaEl);\n };\n AgRichSelect.prototype.renderSelectedValue = function () {\n var _this = this;\n var _a = this, value = _a.value, eDisplayField = _a.eDisplayField, config = _a.config;\n var _b = this.config, allowTyping = _b.allowTyping, initialInputValue = _b.initialInputValue;\n var valueFormatted = this.config.valueFormatter ? this.config.valueFormatter(value) : value;\n if (allowTyping) {\n this.eInput.setValue(initialInputValue !== null && initialInputValue !== void 0 ? initialInputValue : valueFormatted);\n return;\n }\n var userCompDetails;\n if (config.cellRenderer) {\n userCompDetails = this.userComponentFactory.getCellRendererDetails(this.config, {\n value: value,\n valueFormatted: valueFormatted\n });\n }\n var userCompDetailsPromise;\n if (userCompDetails) {\n userCompDetailsPromise = userCompDetails.newAgStackInstance();\n }\n if (userCompDetailsPromise) {\n clearElement(eDisplayField);\n bindCellRendererToHtmlElement(userCompDetailsPromise, eDisplayField);\n userCompDetailsPromise.then(function (renderer) {\n _this.addDestroyFunc(function () { return _this.getContext().destroyBean(renderer); });\n });\n }\n else {\n if (exists(this.value)) {\n eDisplayField.innerText = valueFormatted;\n eDisplayField.classList.remove('ag-display-as-placeholder');\n }\n else {\n var placeholder = config.placeholder;\n if (exists(placeholder)) {\n eDisplayField.innerHTML = \"\".concat(escapeString(placeholder));\n eDisplayField.classList.add('ag-display-as-placeholder');\n }\n else {\n clearElement(eDisplayField);\n }\n }\n }\n };\n AgRichSelect.prototype.getCurrentValueIndex = function () {\n var _a = this, currentList = _a.currentList, value = _a.value;\n if (value == null || !currentList) {\n return -1;\n }\n for (var i = 0; i < currentList.length; i++) {\n if (currentList[i] === value) {\n return i;\n }\n }\n return -1;\n };\n AgRichSelect.prototype.highlightFilterMatch = function () {\n var _this = this;\n var _a;\n (_a = this.listComponent) === null || _a === void 0 ? void 0 : _a.forEachRenderedRow(function (cmp, idx) {\n cmp.highlightString(_this.searchString);\n });\n };\n AgRichSelect.prototype.highlightSelectedValue = function (index) {\n var _this = this;\n var _a;\n if (index == null) {\n index = this.getCurrentValueIndex();\n }\n this.highlightedItem = index;\n (_a = this.listComponent) === null || _a === void 0 ? void 0 : _a.forEachRenderedRow(function (cmp, idx) {\n var highlighted = index === -1 ? false : _this.highlightedItem === idx;\n cmp.updateHighlighted(highlighted);\n });\n };\n AgRichSelect.prototype.setRowHeight = function (height) {\n if (height !== this.cellRowHeight) {\n this.cellRowHeight = height;\n }\n if (this.listComponent) {\n this.listComponent.setRowHeight(height);\n }\n };\n AgRichSelect.prototype.createPickerComponent = function () {\n var values = this.values;\n if (values) {\n this.setValueList({ valueList: values });\n }\n // do not create the picker every time to save state\n return this.listComponent;\n };\n AgRichSelect.prototype.setSearchStringCreator = function (searchStringFn) {\n this.searchStringCreator = searchStringFn;\n };\n AgRichSelect.prototype.setValueList = function (params) {\n var valueList = params.valueList, refresh = params.refresh;\n if (!this.listComponent) {\n return;\n }\n if (this.currentList === valueList) {\n return;\n }\n this.currentList = valueList;\n this.listComponent.setModel({\n getRowCount: function () { return valueList.length; },\n getRow: function (index) { return valueList[index]; },\n areRowsEqual: function (oldRow, newRow) { return oldRow === newRow; },\n });\n if (refresh) {\n // if `values` is not present, it means the valuesList was set asynchronously\n if (!this.values) {\n this.values = valueList;\n if (this.isPickerDisplayed) {\n this.showCurrentValueInPicker();\n }\n }\n else {\n this.listComponent.refresh(true);\n }\n }\n };\n AgRichSelect.prototype.showPicker = function () {\n _super.prototype.showPicker.call(this);\n this.showCurrentValueInPicker();\n this.displayOrHidePicker();\n };\n AgRichSelect.prototype.showCurrentValueInPicker = function () {\n var _a, _b;\n if (!this.listComponent) {\n return;\n }\n if (!this.currentList) {\n if (this.isPickerDisplayed && this.eLoading) {\n this.listComponent.appendChild(this.eLoading);\n }\n return;\n }\n if ((_a = this.eLoading) === null || _a === void 0 ? void 0 : _a.offsetParent) {\n (_b = this.eLoading.parentElement) === null || _b === void 0 ? void 0 : _b.removeChild(this.eLoading);\n }\n var currentValueIndex = this.getCurrentValueIndex();\n if (currentValueIndex !== -1) {\n // make sure the virtual list has been sized correctly\n this.listComponent.refresh();\n this.listComponent.ensureIndexVisible(currentValueIndex);\n // this second call to refresh is necessary to force scrolled elements\n // to be rendered with the correct index info.\n this.listComponent.refresh(true);\n this.highlightSelectedValue(currentValueIndex);\n }\n else {\n this.listComponent.refresh();\n }\n };\n AgRichSelect.prototype.beforeHidePicker = function () {\n this.highlightedItem = -1;\n _super.prototype.beforeHidePicker.call(this);\n };\n AgRichSelect.prototype.onWrapperFocus = function () {\n if (!this.eInput) {\n return;\n }\n var focusableEl = this.eInput.getFocusableElement();\n focusableEl.focus();\n focusableEl.select();\n };\n AgRichSelect.prototype.onWrapperFocusOut = function (e) {\n if (!this.eWrapper.contains(e.relatedTarget)) {\n this.hidePicker();\n }\n };\n AgRichSelect.prototype.buildSearchStringFromKeyboardEvent = function (searchKey) {\n var key = searchKey.key;\n if (key === KeyCode.BACKSPACE) {\n this.searchString = this.searchString.slice(0, -1);\n key = '';\n }\n else if (!isEventFromPrintableCharacter(searchKey)) {\n return;\n }\n searchKey.preventDefault();\n this.searchTextFromCharacter(key);\n };\n AgRichSelect.prototype.searchTextFromCharacter = function (char) {\n this.searchString += char;\n this.runSearch();\n this.clearSearchString();\n };\n AgRichSelect.prototype.searchTextFromString = function (str) {\n if (str == null) {\n str = '';\n }\n this.searchString = str;\n this.runSearch();\n };\n AgRichSelect.prototype.buildSearchStrings = function (values) {\n var _a = this.config.valueFormatter, valueFormatter = _a === void 0 ? (function (value) { return value; }) : _a;\n var searchStrings;\n if (typeof values[0] === 'number' || typeof values[0] === 'string') {\n searchStrings = values.map(function (v) { return valueFormatter(v); });\n }\n else if (typeof values[0] === 'object' && this.searchStringCreator) {\n searchStrings = this.searchStringCreator(values);\n }\n return searchStrings;\n };\n AgRichSelect.prototype.getSuggestionsAndFilteredValues = function (searchValue, valueList) {\n var _this = this;\n var suggestions = [];\n var filteredValues = [];\n if (!searchValue.length) {\n return { suggestions: suggestions, filteredValues: filteredValues };\n }\n var _a = this.config, _b = _a.searchType, searchType = _b === void 0 ? 'fuzzy' : _b, filterList = _a.filterList;\n if (searchType === 'fuzzy') {\n var fuzzySearchResult = fuzzySuggestions(this.searchString, valueList, true);\n suggestions = fuzzySearchResult.values;\n var indices = fuzzySearchResult.indices;\n if (filterList && indices.length) {\n for (var i = 0; i < indices.length; i++) {\n filteredValues.push(this.values[indices[i]]);\n }\n }\n }\n else {\n suggestions = valueList.filter(function (val, idx) {\n var currentValue = val.toLocaleLowerCase();\n var valueToMatch = _this.searchString.toLocaleLowerCase();\n var isMatch = searchType === 'match' ? currentValue.startsWith(valueToMatch) : currentValue.indexOf(valueToMatch) !== -1;\n if (filterList && isMatch) {\n filteredValues.push(_this.values[idx]);\n }\n return isMatch;\n });\n }\n return { suggestions: suggestions, filteredValues: filteredValues };\n };\n AgRichSelect.prototype.filterListModel = function (filteredValues) {\n var filterList = this.config.filterList;\n if (!filterList) {\n return;\n }\n this.setValueList({ valueList: filteredValues, refresh: true });\n this.alignPickerToComponent();\n };\n AgRichSelect.prototype.runSearch = function () {\n var _a, _b;\n var values = this.values;\n var searchStrings = this.buildSearchStrings(values);\n if (!searchStrings) {\n this.highlightSelectedValue(-1);\n return;\n }\n var _c = this.getSuggestionsAndFilteredValues(this.searchString, searchStrings), suggestions = _c.suggestions, filteredValues = _c.filteredValues;\n var _d = this.config, filterList = _d.filterList, highlightMatch = _d.highlightMatch, _e = _d.searchType, searchType = _e === void 0 ? 'fuzzy' : _e;\n var filterValueLen = filteredValues.length;\n var shouldFilter = !!(filterList && this.searchString !== '');\n this.filterListModel(shouldFilter ? filteredValues : values);\n if (suggestions.length) {\n var topSuggestionIndex = shouldFilter ? 0 : searchStrings.indexOf(suggestions[0]);\n this.selectListItem(topSuggestionIndex);\n }\n else {\n this.highlightSelectedValue(-1);\n if (!shouldFilter || filterValueLen) {\n (_a = this.listComponent) === null || _a === void 0 ? void 0 : _a.ensureIndexVisible(0);\n }\n else if (shouldFilter) {\n this.getAriaElement().removeAttribute('data-active-option');\n var eListAriaEl = (_b = this.listComponent) === null || _b === void 0 ? void 0 : _b.getAriaElement();\n if (eListAriaEl) {\n setAriaActiveDescendant(eListAriaEl, null);\n }\n }\n }\n if (highlightMatch && searchType !== 'fuzzy') {\n this.highlightFilterMatch();\n }\n this.displayOrHidePicker();\n };\n AgRichSelect.prototype.displayOrHidePicker = function () {\n var _a;\n var eListGui = (_a = this.listComponent) === null || _a === void 0 ? void 0 : _a.getGui();\n var toggleValue = this.currentList ? this.currentList.length === 0 : false;\n eListGui === null || eListGui === void 0 ? void 0 : eListGui.classList.toggle('ag-hidden', toggleValue);\n };\n AgRichSelect.prototype.clearSearchString = function () {\n this.searchString = '';\n };\n AgRichSelect.prototype.selectListItem = function (index, preventUnnecessaryScroll) {\n if (!this.isPickerDisplayed || !this.currentList || !this.listComponent || index < 0 || index >= this.currentList.length) {\n return;\n }\n var wasScrolled = this.listComponent.ensureIndexVisible(index, !preventUnnecessaryScroll);\n if (wasScrolled && !preventUnnecessaryScroll) {\n this.listComponent.refresh(true);\n }\n this.highlightSelectedValue(index);\n };\n AgRichSelect.prototype.setValue = function (value, silent, fromPicker) {\n var index = this.currentList ? this.currentList.indexOf(value) : -1;\n if (index === -1) {\n return this;\n }\n this.value = value;\n if (!fromPicker) {\n this.selectListItem(index);\n }\n this.renderSelectedValue();\n return _super.prototype.setValue.call(this, value, silent);\n };\n AgRichSelect.prototype.createRowComponent = function (value) {\n var row = new RichSelectRow(this.config, this.eWrapper);\n row.setParentComponent(this.listComponent);\n this.getContext().createBean(row);\n row.setState(value);\n var _a = this.config, highlightMatch = _a.highlightMatch, _b = _a.searchType, searchType = _b === void 0 ? 'fuzzy' : _b;\n if (highlightMatch && searchType !== 'fuzzy') {\n row.highlightString(this.searchString);\n }\n return row;\n };\n AgRichSelect.prototype.getRowForMouseEvent = function (e) {\n var listComponent = this.listComponent;\n if (!listComponent) {\n return -1;\n }\n var eGui = listComponent === null || listComponent === void 0 ? void 0 : listComponent.getGui();\n var rect = eGui.getBoundingClientRect();\n var scrollTop = listComponent.getScrollTop();\n var mouseY = e.clientY - rect.top + scrollTop;\n return Math.floor(mouseY / listComponent.getRowHeight());\n };\n AgRichSelect.prototype.onPickerMouseMove = function (e) {\n if (!this.listComponent) {\n return;\n }\n var row = this.getRowForMouseEvent(e);\n if (row !== -1 && row != this.lastRowHovered) {\n this.lastRowHovered = row;\n this.selectListItem(row, true);\n }\n };\n AgRichSelect.prototype.onNavigationKeyDown = function (event, key) {\n // if we don't preventDefault the page body and/or grid scroll will move.\n event.preventDefault();\n var isDown = key === KeyCode.DOWN;\n if (!this.isPickerDisplayed && isDown) {\n this.showPicker();\n return;\n }\n var oldIndex = this.highlightedItem;\n var diff = isDown ? 1 : -1;\n var newIndex = oldIndex === -1 ? 0 : oldIndex + diff;\n this.selectListItem(newIndex);\n };\n AgRichSelect.prototype.onEnterKeyDown = function (e) {\n if (!this.isPickerDisplayed) {\n return;\n }\n e.preventDefault();\n if (this.currentList) {\n this.onListValueSelected(this.currentList[this.highlightedItem], true);\n }\n };\n AgRichSelect.prototype.onTabKeyDown = function () {\n if (!this.isPickerDisplayed || !this.currentList) {\n return;\n }\n this.setValue(this.currentList[this.highlightedItem], false, true);\n };\n AgRichSelect.prototype.onListValueSelected = function (value, fromEnterKey) {\n this.setValue(value, false, true);\n this.dispatchPickerEvent(value, fromEnterKey);\n this.hidePicker();\n };\n AgRichSelect.prototype.dispatchPickerEvent = function (value, fromEnterKey) {\n var event = {\n type: Events.EVENT_FIELD_PICKER_VALUE_SELECTED,\n fromEnterKey: fromEnterKey,\n value: value\n };\n this.dispatchEvent(event);\n };\n AgRichSelect.prototype.getFocusableElement = function () {\n var allowTyping = this.config.allowTyping;\n if (allowTyping) {\n return this.eInput.getFocusableElement();\n }\n return _super.prototype.getFocusableElement.call(this);\n };\n AgRichSelect.prototype.onKeyDown = function (event) {\n var key = event.key;\n var allowTyping = this.config.allowTyping;\n switch (key) {\n case KeyCode.LEFT:\n case KeyCode.RIGHT:\n case KeyCode.PAGE_HOME:\n case KeyCode.PAGE_END:\n if (!allowTyping) {\n event.preventDefault();\n }\n break;\n case KeyCode.PAGE_UP:\n case KeyCode.PAGE_DOWN:\n event.preventDefault();\n break;\n case KeyCode.DOWN:\n case KeyCode.UP:\n this.onNavigationKeyDown(event, key);\n break;\n case KeyCode.ESCAPE:\n if (this.isPickerDisplayed) {\n if (isVisible(this.listComponent.getGui())) {\n event.preventDefault();\n stopPropagationForAgGrid(event);\n }\n this.hidePicker();\n }\n break;\n case KeyCode.ENTER:\n this.onEnterKeyDown(event);\n break;\n case KeyCode.TAB:\n this.onTabKeyDown();\n break;\n default:\n if (!allowTyping) {\n this.buildSearchStringFromKeyboardEvent(event);\n }\n }\n };\n AgRichSelect.prototype.destroy = function () {\n if (this.listComponent) {\n this.destroyBean(this.listComponent);\n this.listComponent = undefined;\n }\n this.eLoading = undefined;\n _super.prototype.destroy.call(this);\n };\n __decorate$17([\n Autowired('userComponentFactory')\n ], AgRichSelect.prototype, \"userComponentFactory\", void 0);\n __decorate$17([\n RefSelector('eInput')\n ], AgRichSelect.prototype, \"eInput\", void 0);\n return AgRichSelect;\n}(AgPickerField));\n\nvar __extends$15 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$16 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AgSlider = /** @class */ (function (_super) {\n __extends$15(AgSlider, _super);\n function AgSlider(config) {\n var _this = _super.call(this, config, AgSlider.TEMPLATE) || this;\n _this.labelAlignment = 'top';\n return _this;\n }\n AgSlider.prototype.init = function () {\n this.eSlider.addCssClass('ag-slider-field');\n };\n AgSlider.prototype.onValueChange = function (callbackFn) {\n var _this = this;\n var eventChanged = Events.EVENT_FIELD_VALUE_CHANGED;\n this.addManagedListener(this.eText, eventChanged, function () {\n var textValue = parseFloat(_this.eText.getValue());\n _this.eSlider.setValue(textValue.toString(), true);\n callbackFn(textValue || 0);\n });\n this.addManagedListener(this.eSlider, eventChanged, function () {\n var sliderValue = _this.eSlider.getValue();\n _this.eText.setValue(sliderValue, true);\n callbackFn(parseFloat(sliderValue));\n });\n return this;\n };\n AgSlider.prototype.setSliderWidth = function (width) {\n this.eSlider.setWidth(width);\n return this;\n };\n AgSlider.prototype.setTextFieldWidth = function (width) {\n this.eText.setWidth(width);\n return this;\n };\n AgSlider.prototype.setMinValue = function (minValue) {\n this.eSlider.setMinValue(minValue);\n this.eText.setMin(minValue);\n return this;\n };\n AgSlider.prototype.setMaxValue = function (maxValue) {\n this.eSlider.setMaxValue(maxValue);\n this.eText.setMax(maxValue);\n return this;\n };\n AgSlider.prototype.getValue = function () {\n return this.eText.getValue();\n };\n AgSlider.prototype.setValue = function (value) {\n if (this.getValue() === value) {\n return this;\n }\n this.eText.setValue(value, true);\n this.eSlider.setValue(value, true);\n this.dispatchEvent({ type: Events.EVENT_FIELD_VALUE_CHANGED });\n return this;\n };\n AgSlider.prototype.setStep = function (step) {\n this.eSlider.setStep(step);\n this.eText.setStep(step);\n return this;\n };\n AgSlider.TEMPLATE = \"
\\n \\n
\\n \\n \\n
\\n
\";\n __decorate$16([\n RefSelector('eLabel')\n ], AgSlider.prototype, \"eLabel\", void 0);\n __decorate$16([\n RefSelector('eSlider')\n ], AgSlider.prototype, \"eSlider\", void 0);\n __decorate$16([\n RefSelector('eText')\n ], AgSlider.prototype, \"eText\", void 0);\n __decorate$16([\n PostConstruct\n ], AgSlider.prototype, \"init\", null);\n return AgSlider;\n}(AgAbstractLabel));\n\nvar __extends$14 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$15 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AgGroupComponent = /** @class */ (function (_super) {\n __extends$14(AgGroupComponent, _super);\n function AgGroupComponent(params) {\n if (params === void 0) { params = {}; }\n var _this = _super.call(this, AgGroupComponent.getTemplate(params)) || this;\n _this.suppressEnabledCheckbox = true;\n _this.suppressOpenCloseIcons = false;\n var title = params.title, enabled = params.enabled, items = params.items, suppressEnabledCheckbox = params.suppressEnabledCheckbox, suppressOpenCloseIcons = params.suppressOpenCloseIcons;\n _this.title = title;\n _this.cssIdentifier = params.cssIdentifier || 'default';\n _this.enabled = enabled != null ? enabled : true;\n _this.items = items || [];\n _this.alignItems = params.alignItems || 'center';\n if (suppressEnabledCheckbox != null) {\n _this.suppressEnabledCheckbox = suppressEnabledCheckbox;\n }\n if (suppressOpenCloseIcons != null) {\n _this.suppressOpenCloseIcons = suppressOpenCloseIcons;\n }\n return _this;\n }\n AgGroupComponent.getTemplate = function (params) {\n var cssIdentifier = params.cssIdentifier || 'default';\n var direction = params.direction || 'vertical';\n return /* html */ \"
\\n
\\n \\n \\n \\n
\\n
\\n \\n
\\n
\\n
\");\n };\n AgGroupComponent.prototype.postConstruct = function () {\n if (this.items.length) {\n var initialItems = this.items;\n this.items = [];\n this.addItems(initialItems);\n }\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n this.cbGroupEnabled.setLabel(localeTextFunc('enabled', 'Enabled'));\n if (this.title) {\n this.setTitle(this.title);\n }\n if (this.enabled) {\n this.setEnabled(this.enabled);\n }\n this.setAlignItems(this.alignItems);\n this.hideEnabledCheckbox(this.suppressEnabledCheckbox);\n this.hideOpenCloseIcons(this.suppressOpenCloseIcons);\n this.setupExpandContract();\n this.refreshAriaStatus();\n this.refreshChildDisplay();\n };\n AgGroupComponent.prototype.setupExpandContract = function () {\n var _this = this;\n this.eGroupClosedIcon.appendChild(createIcon('columnSelectClosed', this.gridOptionsService, null));\n this.eGroupOpenedIcon.appendChild(createIcon('columnSelectOpen', this.gridOptionsService, null));\n this.addManagedListener(this.eTitleBar, 'click', function () { return _this.toggleGroupExpand(); });\n this.addManagedListener(this.eTitleBar, 'keydown', function (e) {\n switch (e.key) {\n case KeyCode.ENTER:\n case KeyCode.SPACE:\n e.preventDefault();\n _this.toggleGroupExpand();\n break;\n case KeyCode.RIGHT:\n case KeyCode.LEFT:\n e.preventDefault();\n _this.toggleGroupExpand(e.key === KeyCode.RIGHT);\n break;\n }\n });\n };\n AgGroupComponent.prototype.refreshAriaStatus = function () {\n if (!this.suppressOpenCloseIcons) {\n setAriaExpanded(this.eTitleBar, this.expanded);\n }\n };\n AgGroupComponent.prototype.refreshChildDisplay = function () {\n var showIcon = !this.suppressOpenCloseIcons;\n setDisplayed(this.eToolbar, this.expanded && !this.suppressEnabledCheckbox);\n setDisplayed(this.eGroupOpenedIcon, showIcon && this.expanded);\n setDisplayed(this.eGroupClosedIcon, showIcon && !this.expanded);\n };\n AgGroupComponent.prototype.isExpanded = function () {\n return this.expanded;\n };\n AgGroupComponent.prototype.setAlignItems = function (alignment) {\n if (this.alignItems !== alignment) {\n this.removeCssClass(\"ag-group-item-alignment-\".concat(this.alignItems));\n }\n this.alignItems = alignment;\n var newCls = \"ag-group-item-alignment-\".concat(this.alignItems);\n this.addCssClass(newCls);\n return this;\n };\n AgGroupComponent.prototype.toggleGroupExpand = function (expanded) {\n if (this.suppressOpenCloseIcons) {\n this.expanded = true;\n this.refreshChildDisplay();\n setDisplayed(this.eContainer, true);\n return this;\n }\n expanded = expanded != null ? expanded : !this.expanded;\n if (this.expanded === expanded) {\n return this;\n }\n this.expanded = expanded;\n this.refreshAriaStatus();\n this.refreshChildDisplay();\n setDisplayed(this.eContainer, expanded);\n this.dispatchEvent({ type: this.expanded ? AgGroupComponent.EVENT_EXPANDED : AgGroupComponent.EVENT_COLLAPSED });\n return this;\n };\n AgGroupComponent.prototype.addItems = function (items) {\n var _this = this;\n items.forEach(function (item) { return _this.addItem(item); });\n };\n AgGroupComponent.prototype.prependItem = function (item) {\n this.insertItem(item, this.eContainer.firstChild);\n };\n AgGroupComponent.prototype.addItem = function (item) {\n this.insertItem(item, null);\n };\n AgGroupComponent.prototype.insertItem = function (item, before) {\n var container = this.eContainer;\n var el = item instanceof Component ? item.getGui() : item;\n el.classList.add('ag-group-item', \"ag-\".concat(this.cssIdentifier, \"-group-item\"));\n container.insertBefore(el, before);\n this.items.push(el);\n };\n AgGroupComponent.prototype.hideItem = function (hide, index) {\n var itemToHide = this.items[index];\n setDisplayed(itemToHide, !hide);\n };\n AgGroupComponent.prototype.setTitle = function (title) {\n this.eTitle.innerText = title;\n return this;\n };\n AgGroupComponent.prototype.addCssClassToTitleBar = function (cssClass) {\n this.eTitleBar.classList.add(cssClass);\n };\n AgGroupComponent.prototype.setEnabled = function (enabled, skipToggle) {\n this.enabled = enabled;\n this.refreshDisabledStyles();\n this.toggleGroupExpand(enabled);\n if (!skipToggle) {\n this.cbGroupEnabled.setValue(enabled);\n }\n return this;\n };\n AgGroupComponent.prototype.isEnabled = function () {\n return this.enabled;\n };\n AgGroupComponent.prototype.onEnableChange = function (callbackFn) {\n var _this = this;\n this.cbGroupEnabled.onValueChange(function (newSelection) {\n _this.setEnabled(newSelection, true);\n callbackFn(newSelection);\n });\n return this;\n };\n AgGroupComponent.prototype.hideEnabledCheckbox = function (hide) {\n this.suppressEnabledCheckbox = hide;\n this.refreshChildDisplay();\n this.refreshDisabledStyles();\n return this;\n };\n AgGroupComponent.prototype.hideOpenCloseIcons = function (hide) {\n this.suppressOpenCloseIcons = hide;\n if (hide) {\n this.toggleGroupExpand(true);\n }\n return this;\n };\n AgGroupComponent.prototype.refreshDisabledStyles = function () {\n this.addOrRemoveCssClass('ag-disabled', !this.enabled);\n if (this.suppressEnabledCheckbox && !this.enabled) {\n this.eTitleBar.classList.add('ag-disabled-group-title-bar');\n this.eTitleBar.removeAttribute('tabindex');\n }\n else {\n this.eTitleBar.classList.remove('ag-disabled-group-title-bar');\n this.eTitleBar.setAttribute('tabindex', '0');\n }\n this.eContainer.classList.toggle('ag-disabled-group-container', !this.enabled);\n };\n AgGroupComponent.EVENT_EXPANDED = 'expanded';\n AgGroupComponent.EVENT_COLLAPSED = 'collapsed';\n __decorate$15([\n RefSelector('eTitleBar')\n ], AgGroupComponent.prototype, \"eTitleBar\", void 0);\n __decorate$15([\n RefSelector('eGroupOpenedIcon')\n ], AgGroupComponent.prototype, \"eGroupOpenedIcon\", void 0);\n __decorate$15([\n RefSelector('eGroupClosedIcon')\n ], AgGroupComponent.prototype, \"eGroupClosedIcon\", void 0);\n __decorate$15([\n RefSelector('eToolbar')\n ], AgGroupComponent.prototype, \"eToolbar\", void 0);\n __decorate$15([\n RefSelector('cbGroupEnabled')\n ], AgGroupComponent.prototype, \"cbGroupEnabled\", void 0);\n __decorate$15([\n RefSelector('eTitle')\n ], AgGroupComponent.prototype, \"eTitle\", void 0);\n __decorate$15([\n RefSelector('eContainer')\n ], AgGroupComponent.prototype, \"eContainer\", void 0);\n __decorate$15([\n PostConstruct\n ], AgGroupComponent.prototype, \"postConstruct\", null);\n return AgGroupComponent;\n}(Component));\n\nvar __extends$13 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$14 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AgMenuList = /** @class */ (function (_super) {\n __extends$13(AgMenuList, _super);\n function AgMenuList(level, params) {\n if (level === void 0) { level = 0; }\n var _this = _super.call(this, /* html */ \"
\") || this;\n _this.level = level;\n _this.menuItems = [];\n _this.params = params !== null && params !== void 0 ? params : {\n column: null,\n node: null,\n value: null\n };\n return _this;\n }\n AgMenuList.prototype.postConstruct = function () {\n var _this = this;\n this.initialiseTabGuard({\n onTabKeyDown: function (e) { return _this.onTabKeyDown(e); },\n handleKeyDown: function (e) { return _this.handleKeyDown(e); },\n onFocusIn: function (e) { return _this.handleFocusIn(e); },\n onFocusOut: function (e) { return _this.handleFocusOut(e); },\n });\n };\n AgMenuList.prototype.onTabKeyDown = function (e) {\n var parent = this.getParentComponent();\n var parentGui = parent && parent.getGui();\n var isManaged = parentGui && parentGui.classList.contains('ag-focus-managed');\n if (!isManaged) {\n e.preventDefault();\n }\n if (e.shiftKey) {\n this.closeIfIsChild(e);\n }\n };\n AgMenuList.prototype.handleKeyDown = function (e) {\n switch (e.key) {\n case KeyCode.UP:\n case KeyCode.RIGHT:\n case KeyCode.DOWN:\n case KeyCode.LEFT:\n e.preventDefault();\n this.handleNavKey(e.key);\n break;\n case KeyCode.ESCAPE:\n if (this.closeIfIsChild()) {\n stopPropagationForAgGrid(e);\n }\n break;\n }\n };\n AgMenuList.prototype.handleFocusIn = function (e) {\n var _a, _b;\n // if focus is coming from outside the menu list, then re-activate an item\n var oldFocusedElement = e.relatedTarget;\n if (!this.tabGuardCtrl.isTabGuard(oldFocusedElement) && (this.getGui().contains(oldFocusedElement) || ((_b = (_a = this.activeMenuItem) === null || _a === void 0 ? void 0 : _a.getSubMenuGui()) === null || _b === void 0 ? void 0 : _b.contains(oldFocusedElement)))) {\n return;\n }\n if (this.activeMenuItem) {\n this.activeMenuItem.activate();\n }\n else {\n this.activateFirstItem();\n }\n };\n AgMenuList.prototype.handleFocusOut = function (e) {\n var _a;\n // if focus is going outside the menu list, deactivate the current item\n var newFocusedElement = e.relatedTarget;\n if (!this.activeMenuItem || this.getGui().contains(newFocusedElement) || ((_a = this.activeMenuItem.getSubMenuGui()) === null || _a === void 0 ? void 0 : _a.contains(newFocusedElement))) {\n return;\n }\n if (!this.activeMenuItem.isSubMenuOpening()) {\n this.activeMenuItem.deactivate();\n }\n };\n AgMenuList.prototype.clearActiveItem = function () {\n if (this.activeMenuItem) {\n this.activeMenuItem.deactivate();\n this.activeMenuItem = null;\n }\n };\n AgMenuList.prototype.addMenuItems = function (menuItems) {\n var _this = this;\n if (menuItems == null) {\n return;\n }\n AgPromise.all(menuItems.map(function (menuItemOrString) {\n if (menuItemOrString === 'separator') {\n return AgPromise.resolve({ eGui: _this.createSeparator() });\n }\n else if (typeof menuItemOrString === 'string') {\n console.warn(\"AG Grid: unrecognised menu item \".concat(menuItemOrString));\n return AgPromise.resolve({ eGui: null });\n }\n else {\n return _this.addItem(menuItemOrString);\n }\n })).then(function (elements) {\n elements.forEach(function (element) {\n if (element === null || element === void 0 ? void 0 : element.eGui) {\n _this.appendChild(element.eGui);\n if (element.comp) {\n _this.menuItems.push(element.comp);\n }\n }\n });\n });\n };\n AgMenuList.prototype.addItem = function (menuItemDef) {\n var _this = this;\n var menuItem = this.createManagedBean(new AgMenuItemComponent());\n return menuItem.init({\n menuItemDef: menuItemDef,\n isAnotherSubMenuOpen: function () { return _this.menuItems.some(function (m) { return m.isSubMenuOpen(); }); },\n level: this.level,\n contextParams: this.params\n }).then(function () {\n menuItem.setParentComponent(_this);\n _this.addManagedListener(menuItem, AgMenuItemComponent.EVENT_CLOSE_MENU, function (event) {\n _this.dispatchEvent(event);\n });\n _this.addManagedListener(menuItem, AgMenuItemComponent.EVENT_MENU_ITEM_ACTIVATED, function (event) {\n if (_this.activeMenuItem && _this.activeMenuItem !== event.menuItem) {\n _this.activeMenuItem.deactivate();\n }\n _this.activeMenuItem = event.menuItem;\n });\n return {\n comp: menuItem,\n eGui: menuItem.getGui()\n };\n });\n };\n AgMenuList.prototype.activateFirstItem = function () {\n var item = this.menuItems.filter(function (currentItem) { return !currentItem.isDisabled(); })[0];\n if (!item) {\n return;\n }\n item.activate();\n };\n AgMenuList.prototype.createSeparator = function () {\n var separatorHtml = /* html */ \"\\n
\\n
\\n
\\n
\\n
\\n
\";\n return loadTemplate(separatorHtml);\n };\n AgMenuList.prototype.handleNavKey = function (key) {\n switch (key) {\n case KeyCode.UP:\n case KeyCode.DOWN:\n var nextItem = this.findNextItem(key === KeyCode.UP);\n if (nextItem && nextItem !== this.activeMenuItem) {\n nextItem.activate();\n }\n return;\n }\n var left = this.gridOptionsService.get('enableRtl') ? KeyCode.RIGHT : KeyCode.LEFT;\n if (key === left) {\n this.closeIfIsChild();\n }\n else {\n this.openChild();\n }\n };\n AgMenuList.prototype.closeIfIsChild = function (e) {\n var parentItem = this.getParentComponent();\n if (parentItem && parentItem instanceof AgMenuItemComponent) {\n if (e) {\n e.preventDefault();\n }\n parentItem.closeSubMenu();\n parentItem.getGui().focus();\n return true;\n }\n return false;\n };\n AgMenuList.prototype.openChild = function () {\n if (this.activeMenuItem) {\n this.activeMenuItem.openSubMenu(true);\n }\n };\n AgMenuList.prototype.findNextItem = function (up) {\n var items = this.menuItems.filter(function (item) { return !item.isDisabled(); });\n if (!items.length) {\n return;\n }\n if (!this.activeMenuItem) {\n return up ? last(items) : items[0];\n }\n if (up) {\n items.reverse();\n }\n var nextItem;\n var foundCurrent = false;\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n if (!foundCurrent) {\n if (item === this.activeMenuItem) {\n foundCurrent = true;\n }\n continue;\n }\n nextItem = item;\n break;\n }\n if (foundCurrent && !nextItem) {\n // start again from the beginning (/end)\n return items[0];\n }\n return nextItem || this.activeMenuItem;\n };\n AgMenuList.prototype.destroy = function () {\n this.clearActiveItem();\n _super.prototype.destroy.call(this);\n };\n __decorate$14([\n Autowired('focusService')\n ], AgMenuList.prototype, \"focusService\", void 0);\n __decorate$14([\n PostConstruct\n ], AgMenuList.prototype, \"postConstruct\", null);\n return AgMenuList;\n}(TabGuardComp));\n\nvar __extends$12 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$13 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AgMenuPanel = /** @class */ (function (_super) {\n __extends$12(AgMenuPanel, _super);\n function AgMenuPanel(wrappedComponent) {\n var _this = _super.call(this) || this;\n _this.wrappedComponent = wrappedComponent;\n _this.setTemplateFromElement(wrappedComponent.getGui());\n return _this;\n }\n AgMenuPanel.prototype.postConstruct = function () {\n var _this = this;\n this.initialiseTabGuard({\n onTabKeyDown: function (e) { return _this.onTabKeyDown(e); },\n handleKeyDown: function (e) { return _this.handleKeyDown(e); }\n });\n };\n AgMenuPanel.prototype.handleKeyDown = function (e) {\n if (e.key === KeyCode.ESCAPE) {\n this.closePanel();\n }\n };\n AgMenuPanel.prototype.onTabKeyDown = function (e) {\n if (e.defaultPrevented) {\n return;\n }\n this.closePanel();\n e.preventDefault();\n };\n AgMenuPanel.prototype.closePanel = function () {\n var menuItem = this.parentComponent;\n menuItem.closeSubMenu();\n setTimeout(function () { return menuItem.getGui().focus(); }, 0);\n };\n __decorate$13([\n PostConstruct\n ], AgMenuPanel.prototype, \"postConstruct\", null);\n return AgMenuPanel;\n}(TabGuardComp));\n\nvar __extends$11 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$8 = ( false) || function () {\n __assign$8 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$8.apply(this, arguments);\n};\nvar __decorate$12 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AgMenuItemComponent = /** @class */ (function (_super) {\n __extends$11(AgMenuItemComponent, _super);\n function AgMenuItemComponent() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.isActive = false;\n _this.subMenuIsOpen = false;\n _this.subMenuIsOpening = false;\n _this.suppressRootStyles = true;\n _this.suppressAria = true;\n _this.suppressFocus = true;\n return _this;\n }\n AgMenuItemComponent.prototype.init = function (params) {\n var _this = this;\n var _a, _b;\n var menuItemDef = params.menuItemDef, isAnotherSubMenuOpen = params.isAnotherSubMenuOpen, level = params.level, childComponent = params.childComponent, contextParams = params.contextParams;\n this.params = params.menuItemDef;\n this.level = level;\n this.isAnotherSubMenuOpen = isAnotherSubMenuOpen;\n this.childComponent = childComponent;\n this.contextParams = contextParams;\n this.cssClassPrefix = (_b = (_a = this.params.menuItemParams) === null || _a === void 0 ? void 0 : _a.cssClassPrefix) !== null && _b !== void 0 ? _b : 'ag-menu-option';\n var compDetails = this.userComponentFactory.getMenuItemCompDetails(this.params, __assign$8(__assign$8({}, menuItemDef), { level: level, isAnotherSubMenuOpen: isAnotherSubMenuOpen, openSubMenu: function (activateFirstItem) { return _this.openSubMenu(activateFirstItem); }, closeSubMenu: function () { return _this.closeSubMenu(); }, closeMenu: function (event) { return _this.closeMenu(event); }, updateTooltip: function (tooltip) { return _this.updateTooltip(tooltip); }, onItemActivated: function () { return _this.onItemActivated(); } }));\n return compDetails.newAgStackInstance().then(function (comp) {\n var _a;\n _this.menuItemComp = comp;\n var configureDefaults = (_a = comp.configureDefaults) === null || _a === void 0 ? void 0 : _a.call(comp);\n if (configureDefaults) {\n _this.configureDefaults(configureDefaults === true ? undefined : configureDefaults);\n }\n });\n };\n AgMenuItemComponent.prototype.addListeners = function (eGui, params) {\n var _this = this;\n if (!(params === null || params === void 0 ? void 0 : params.suppressClick)) {\n this.addManagedListener(eGui, 'click', function (e) { return _this.onItemSelected(e); });\n }\n if (!(params === null || params === void 0 ? void 0 : params.suppressKeyboardSelect)) {\n this.addManagedListener(eGui, 'keydown', function (e) {\n if (e.key === KeyCode.ENTER || e.key === KeyCode.SPACE) {\n e.preventDefault();\n _this.onItemSelected(e);\n }\n });\n }\n if (!(params === null || params === void 0 ? void 0 : params.suppressMouseDown)) {\n this.addManagedListener(eGui, 'mousedown', function (e) {\n // Prevent event bubbling to other event handlers such as PopupService triggering\n // premature closing of any open sub-menu popup.\n e.stopPropagation();\n e.preventDefault();\n });\n }\n if (!(params === null || params === void 0 ? void 0 : params.suppressMouseOver)) {\n this.addManagedListener(eGui, 'mouseenter', function () { return _this.onMouseEnter(); });\n this.addManagedListener(eGui, 'mouseleave', function () { return _this.onMouseLeave(); });\n }\n };\n AgMenuItemComponent.prototype.isDisabled = function () {\n return !!this.params.disabled;\n };\n AgMenuItemComponent.prototype.openSubMenu = function (activateFirstItem) {\n var _this = this;\n var _a, _b;\n if (activateFirstItem === void 0) { activateFirstItem = false; }\n this.closeSubMenu();\n if (!this.params.subMenu) {\n return;\n }\n this.subMenuIsOpening = true;\n var ePopup = loadTemplate(/* html */ \"
\");\n this.eSubMenuGui = ePopup;\n var destroySubMenu;\n var afterGuiAttached = function () {\n _this.subMenuIsOpening = false;\n };\n if (this.childComponent) {\n var menuPanel = this.createBean(new AgMenuPanel(this.childComponent));\n menuPanel.setParentComponent(this);\n var subMenuGui_1 = menuPanel.getGui();\n var mouseEvent_1 = 'mouseenter';\n var mouseEnterListener_1 = function () { return _this.cancelDeactivate(); };\n subMenuGui_1.addEventListener(mouseEvent_1, mouseEnterListener_1);\n destroySubMenu = function () { return subMenuGui_1.removeEventListener(mouseEvent_1, mouseEnterListener_1); };\n ePopup.appendChild(subMenuGui_1);\n if (this.childComponent.afterGuiAttached) {\n afterGuiAttached = function () {\n _this.childComponent.afterGuiAttached();\n _this.subMenuIsOpening = false;\n };\n }\n }\n else if (this.params.subMenu) {\n var childMenu_1 = this.createBean(new AgMenuList(this.level + 1, this.contextParams));\n childMenu_1.setParentComponent(this);\n childMenu_1.addMenuItems(this.params.subMenu);\n ePopup.appendChild(childMenu_1.getGui());\n // bubble menu item selected events\n this.addManagedListener(childMenu_1, AgMenuItemComponent.EVENT_CLOSE_MENU, function (e) { return _this.dispatchEvent(e); });\n childMenu_1.addGuiEventListener('mouseenter', function () { return _this.cancelDeactivate(); });\n destroySubMenu = function () { return _this.destroyBean(childMenu_1); };\n if (activateFirstItem) {\n afterGuiAttached = function () {\n childMenu_1.activateFirstItem();\n _this.subMenuIsOpening = false;\n };\n }\n }\n var positionCallback = this.popupService.positionPopupForMenu.bind(this.popupService, { eventSource: this.eGui, ePopup: ePopup });\n var translate = this.localeService.getLocaleTextFunc();\n var addPopupRes = this.popupService.addPopup({\n modal: true,\n eChild: ePopup,\n positionCallback: positionCallback,\n anchorToElement: this.eGui,\n ariaLabel: translate('ariaLabelSubMenu', 'SubMenu'),\n afterGuiAttached: afterGuiAttached\n });\n this.subMenuIsOpen = true;\n this.setAriaExpanded(true);\n this.hideSubMenu = function () {\n var _a, _b;\n if (addPopupRes) {\n addPopupRes.hideFunc();\n }\n _this.subMenuIsOpen = false;\n _this.setAriaExpanded(false);\n destroySubMenu();\n (_b = (_a = _this.menuItemComp).setExpanded) === null || _b === void 0 ? void 0 : _b.call(_a, false);\n _this.eSubMenuGui = undefined;\n };\n (_b = (_a = this.menuItemComp).setExpanded) === null || _b === void 0 ? void 0 : _b.call(_a, true);\n };\n AgMenuItemComponent.prototype.setAriaExpanded = function (expanded) {\n if (!this.suppressAria) {\n setAriaExpanded(this.eGui, expanded);\n }\n };\n AgMenuItemComponent.prototype.closeSubMenu = function () {\n if (!this.hideSubMenu) {\n return;\n }\n this.hideSubMenu();\n this.hideSubMenu = null;\n this.setAriaExpanded(false);\n };\n AgMenuItemComponent.prototype.isSubMenuOpen = function () {\n return this.subMenuIsOpen;\n };\n AgMenuItemComponent.prototype.isSubMenuOpening = function () {\n return this.subMenuIsOpening;\n };\n AgMenuItemComponent.prototype.activate = function (openSubMenu) {\n var _this = this;\n var _a, _b;\n this.cancelActivate();\n if (this.params.disabled) {\n return;\n }\n this.isActive = true;\n if (!this.suppressRootStyles) {\n this.eGui.classList.add(\"\".concat(this.cssClassPrefix, \"-active\"));\n }\n (_b = (_a = this.menuItemComp).setActive) === null || _b === void 0 ? void 0 : _b.call(_a, true);\n if (!this.suppressFocus) {\n this.eGui.focus({ preventScroll: true });\n }\n if (openSubMenu && this.params.subMenu) {\n window.setTimeout(function () {\n if (_this.isAlive() && _this.isActive) {\n _this.openSubMenu();\n }\n }, 300);\n }\n this.onItemActivated();\n };\n AgMenuItemComponent.prototype.deactivate = function () {\n var _a, _b;\n this.cancelDeactivate();\n if (!this.suppressRootStyles) {\n this.eGui.classList.remove(\"\".concat(this.cssClassPrefix, \"-active\"));\n }\n (_b = (_a = this.menuItemComp).setActive) === null || _b === void 0 ? void 0 : _b.call(_a, false);\n this.isActive = false;\n if (this.subMenuIsOpen) {\n this.hideSubMenu();\n }\n };\n AgMenuItemComponent.prototype.getGui = function () {\n return this.menuItemComp.getGui();\n };\n AgMenuItemComponent.prototype.getParentComponent = function () {\n return this.parentComponent;\n };\n AgMenuItemComponent.prototype.setParentComponent = function (component) {\n this.parentComponent = component;\n };\n AgMenuItemComponent.prototype.getSubMenuGui = function () {\n return this.eSubMenuGui;\n };\n AgMenuItemComponent.prototype.onItemSelected = function (event) {\n var _this = this;\n var _a, _b;\n (_b = (_a = this.menuItemComp).select) === null || _b === void 0 ? void 0 : _b.call(_a);\n if (this.params.action) {\n this.getFrameworkOverrides().wrapOutgoing(function () { return _this.params.action(_this.gridOptionsService.addGridCommonParams(__assign$8({}, _this.contextParams))); });\n }\n else {\n this.openSubMenu(event && event.type === 'keydown');\n }\n if ((this.params.subMenu && !this.params.action) || this.params.suppressCloseOnSelect) {\n return;\n }\n this.closeMenu(event);\n };\n AgMenuItemComponent.prototype.closeMenu = function (event) {\n var e = {\n type: AgMenuItemComponent.EVENT_CLOSE_MENU,\n event: event\n };\n this.dispatchEvent(e);\n };\n AgMenuItemComponent.prototype.onItemActivated = function () {\n var event = {\n type: AgMenuItemComponent.EVENT_MENU_ITEM_ACTIVATED,\n menuItem: this,\n };\n this.dispatchEvent(event);\n };\n AgMenuItemComponent.prototype.cancelActivate = function () {\n if (this.activateTimeoutId) {\n window.clearTimeout(this.activateTimeoutId);\n this.activateTimeoutId = 0;\n }\n };\n AgMenuItemComponent.prototype.cancelDeactivate = function () {\n if (this.deactivateTimeoutId) {\n window.clearTimeout(this.deactivateTimeoutId);\n this.deactivateTimeoutId = 0;\n }\n };\n AgMenuItemComponent.prototype.onMouseEnter = function () {\n var _this = this;\n this.cancelDeactivate();\n if (this.isAnotherSubMenuOpen()) {\n // wait to see if the user enters the open sub-menu\n this.activateTimeoutId = window.setTimeout(function () { return _this.activate(true); }, AgMenuItemComponent.ACTIVATION_DELAY);\n }\n else {\n // activate immediately\n this.activate(true);\n }\n };\n AgMenuItemComponent.prototype.onMouseLeave = function () {\n var _this = this;\n this.cancelActivate();\n if (this.isSubMenuOpen()) {\n // wait to see if the user enters the sub-menu\n this.deactivateTimeoutId = window.setTimeout(function () { return _this.deactivate(); }, AgMenuItemComponent.ACTIVATION_DELAY);\n }\n else {\n // de-activate immediately\n this.deactivate();\n }\n };\n AgMenuItemComponent.prototype.configureDefaults = function (params) {\n var _this = this;\n var _a, _b, _c;\n this.tooltip = this.params.tooltip;\n if (!this.menuItemComp) {\n // need to wait for init to complete\n setTimeout(function () { return _this.configureDefaults(params); });\n return;\n }\n var eGui = this.menuItemComp.getGui();\n // in some frameworks, `getGui` might be a framework element\n var rootElement = (_b = (_a = this.menuItemComp).getRootElement) === null || _b === void 0 ? void 0 : _b.call(_a);\n if (rootElement) {\n if (!(params === null || params === void 0 ? void 0 : params.suppressRootStyles)) {\n eGui.classList.add('ag-menu-option-custom');\n }\n eGui = rootElement;\n }\n this.eGui = eGui;\n this.suppressRootStyles = !!(params === null || params === void 0 ? void 0 : params.suppressRootStyles);\n if (!this.suppressRootStyles) {\n eGui.classList.add(this.cssClassPrefix);\n (_c = this.params.cssClasses) === null || _c === void 0 ? void 0 : _c.forEach(function (it) { return eGui.classList.add(it); });\n if (this.params.disabled) {\n eGui.classList.add(\"\".concat(this.cssClassPrefix, \"-disabled\"));\n }\n }\n if (!(params === null || params === void 0 ? void 0 : params.suppressTooltip)) {\n this.setTooltip();\n }\n this.suppressAria = !!(params === null || params === void 0 ? void 0 : params.suppressAria);\n if (!this.suppressAria) {\n setAriaRole(eGui, 'treeitem');\n setAriaLevel(eGui, this.level + 1);\n if (this.params.disabled) {\n setAriaDisabled(eGui, true);\n }\n }\n if (!(params === null || params === void 0 ? void 0 : params.suppressTabIndex)) {\n eGui.setAttribute('tabindex', '-1');\n }\n if (!this.params.disabled) {\n this.addListeners(eGui, params);\n }\n this.suppressFocus = !!(params === null || params === void 0 ? void 0 : params.suppressFocus);\n };\n AgMenuItemComponent.prototype.updateTooltip = function (tooltip) {\n this.tooltip = tooltip;\n if (!this.tooltipFeature && this.menuItemComp) {\n this.setTooltip();\n }\n };\n AgMenuItemComponent.prototype.setTooltip = function () {\n var _this = this;\n if (!this.tooltip) {\n return;\n }\n this.tooltipFeature = this.createManagedBean(new TooltipFeature({\n getGui: function () { return _this.getGui(); },\n getTooltipValue: function () { return _this.tooltip; },\n getLocation: function () { return 'menu'; }\n }, this.beans));\n this.tooltipFeature.setComp(this.getGui());\n };\n AgMenuItemComponent.EVENT_CLOSE_MENU = 'closeMenu';\n AgMenuItemComponent.EVENT_MENU_ITEM_ACTIVATED = 'menuItemActivated';\n AgMenuItemComponent.ACTIVATION_DELAY = 80;\n __decorate$12([\n Autowired('popupService')\n ], AgMenuItemComponent.prototype, \"popupService\", void 0);\n __decorate$12([\n Autowired('userComponentFactory')\n ], AgMenuItemComponent.prototype, \"userComponentFactory\", void 0);\n __decorate$12([\n Autowired('beans')\n ], AgMenuItemComponent.prototype, \"beans\", void 0);\n return AgMenuItemComponent;\n}(BeanStub));\n\nvar __extends$10 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$11 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AgPanel = /** @class */ (function (_super) {\n __extends$10(AgPanel, _super);\n function AgPanel(config) {\n var _this = _super.call(this, AgPanel.getTemplate(config)) || this;\n _this.config = config;\n _this.closable = true;\n return _this;\n }\n AgPanel.getTemplate = function (config) {\n var cssIdentifier = config.cssIdentifier || 'default';\n return /* html */ \"
\\n
\\n \\n
\\n
\\n
\\n
\");\n };\n AgPanel.prototype.postConstruct = function () {\n var _this = this;\n var _a = this.config, component = _a.component, closable = _a.closable, hideTitleBar = _a.hideTitleBar, title = _a.title, _b = _a.minWidth, minWidth = _b === void 0 ? 250 : _b, width = _a.width, _c = _a.minHeight, minHeight = _c === void 0 ? 250 : _c, height = _a.height, centered = _a.centered, popup = _a.popup, x = _a.x, y = _a.y;\n this.positionableFeature = new PositionableFeature(this.getGui(), {\n minWidth: minWidth,\n width: width,\n minHeight: minHeight,\n height: height,\n centered: centered,\n x: x,\n y: y,\n popup: popup,\n calculateTopBuffer: function () { return _this.positionableFeature.getHeight() - _this.getBodyHeight(); }\n });\n this.createManagedBean(this.positionableFeature);\n var eGui = this.getGui();\n if (component) {\n this.setBodyComponent(component);\n }\n if (!hideTitleBar) {\n if (title) {\n this.setTitle(title);\n }\n this.setClosable(closable != null ? closable : this.closable);\n }\n else {\n setDisplayed(this.eTitleBar, false);\n }\n this.addManagedListener(this.eTitleBar, 'mousedown', function (e) {\n var eDocument = _this.gridOptionsService.getDocument();\n if (eGui.contains(e.relatedTarget) ||\n eGui.contains(eDocument.activeElement) ||\n _this.eTitleBarButtons.contains(e.target)) {\n e.preventDefault();\n return;\n }\n var focusEl = _this.eContentWrapper.querySelector('button, [href], input, select, textarea, [tabindex]');\n if (focusEl) {\n focusEl.focus();\n }\n });\n if (popup && this.positionableFeature.isPositioned()) {\n return;\n }\n if (this.renderComponent) {\n this.renderComponent();\n }\n this.positionableFeature.initialisePosition();\n this.eContentWrapper.style.height = '0';\n };\n AgPanel.prototype.renderComponent = function () {\n var _this = this;\n var eGui = this.getGui();\n eGui.focus();\n this.close = function () {\n eGui.parentElement.removeChild(eGui);\n _this.destroy();\n };\n };\n AgPanel.prototype.getHeight = function () {\n return this.positionableFeature.getHeight();\n };\n AgPanel.prototype.setHeight = function (height) {\n this.positionableFeature.setHeight(height);\n };\n AgPanel.prototype.getWidth = function () {\n return this.positionableFeature.getWidth();\n };\n AgPanel.prototype.setWidth = function (width) {\n this.positionableFeature.setWidth(width);\n };\n AgPanel.prototype.setClosable = function (closable) {\n if (closable !== this.closable) {\n this.closable = closable;\n }\n if (closable) {\n var closeButtonComp = this.closeButtonComp = new Component(AgPanel.CLOSE_BTN_TEMPLATE);\n this.getContext().createBean(closeButtonComp);\n var eGui = closeButtonComp.getGui();\n var child = createIconNoSpan('close', this.gridOptionsService);\n child.classList.add('ag-panel-title-bar-button-icon');\n eGui.appendChild(child);\n this.addTitleBarButton(closeButtonComp);\n closeButtonComp.addManagedListener(eGui, 'click', this.onBtClose.bind(this));\n }\n else if (this.closeButtonComp) {\n var eGui = this.closeButtonComp.getGui();\n eGui.parentElement.removeChild(eGui);\n this.closeButtonComp = this.destroyBean(this.closeButtonComp);\n }\n };\n AgPanel.prototype.setBodyComponent = function (bodyComponent) {\n bodyComponent.setParentComponent(this);\n this.eContentWrapper.appendChild(bodyComponent.getGui());\n };\n AgPanel.prototype.addTitleBarButton = function (button, position) {\n var eTitleBarButtons = this.eTitleBarButtons;\n var buttons = eTitleBarButtons.children;\n var len = buttons.length;\n if (position == null) {\n position = len;\n }\n position = Math.max(0, Math.min(position, len));\n button.addCssClass('ag-panel-title-bar-button');\n var eGui = button.getGui();\n if (position === 0) {\n eTitleBarButtons.insertAdjacentElement('afterbegin', eGui);\n }\n else if (position === len) {\n eTitleBarButtons.insertAdjacentElement('beforeend', eGui);\n }\n else {\n buttons[position - 1].insertAdjacentElement('afterend', eGui);\n }\n button.setParentComponent(this);\n };\n AgPanel.prototype.getBodyHeight = function () {\n return getInnerHeight(this.eContentWrapper);\n };\n AgPanel.prototype.getBodyWidth = function () {\n return getInnerWidth(this.eContentWrapper);\n };\n AgPanel.prototype.setTitle = function (title) {\n this.eTitle.innerText = title;\n };\n // called when user hits the 'x' in the top right\n AgPanel.prototype.onBtClose = function () {\n this.close();\n };\n AgPanel.prototype.destroy = function () {\n if (this.closeButtonComp) {\n this.closeButtonComp = this.destroyBean(this.closeButtonComp);\n }\n var eGui = this.getGui();\n if (eGui && isVisible(eGui)) {\n this.close();\n }\n _super.prototype.destroy.call(this);\n };\n AgPanel.CLOSE_BTN_TEMPLATE = \"
\";\n __decorate$11([\n RefSelector('eContentWrapper')\n ], AgPanel.prototype, \"eContentWrapper\", void 0);\n __decorate$11([\n RefSelector('eTitleBar')\n ], AgPanel.prototype, \"eTitleBar\", void 0);\n __decorate$11([\n RefSelector('eTitleBarButtons')\n ], AgPanel.prototype, \"eTitleBarButtons\", void 0);\n __decorate$11([\n RefSelector('eTitle')\n ], AgPanel.prototype, \"eTitle\", void 0);\n __decorate$11([\n PostConstruct\n ], AgPanel.prototype, \"postConstruct\", null);\n return AgPanel;\n}(Component));\n\nvar __extends$$ = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$7 = ( false) || function () {\n __assign$7 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$7.apply(this, arguments);\n};\nvar __decorate$10 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AgDialog = /** @class */ (function (_super) {\n __extends$$(AgDialog, _super);\n function AgDialog(config) {\n var _this = _super.call(this, __assign$7(__assign$7({}, config), { popup: true })) || this;\n _this.isMaximizable = false;\n _this.isMaximized = false;\n _this.maximizeListeners = [];\n _this.resizeListenerDestroy = null;\n _this.lastPosition = {\n x: 0,\n y: 0,\n width: 0,\n height: 0\n };\n return _this;\n }\n AgDialog.prototype.postConstruct = function () {\n var _this = this;\n var eGui = this.getGui();\n var _a = this.config, movable = _a.movable, resizable = _a.resizable, maximizable = _a.maximizable;\n this.addCssClass('ag-dialog');\n _super.prototype.postConstruct.call(this);\n this.addManagedListener(eGui, 'focusin', function (e) {\n if (eGui.contains(e.relatedTarget)) {\n return;\n }\n _this.popupService.bringPopupToFront(eGui);\n });\n if (movable) {\n this.setMovable(movable);\n }\n if (maximizable) {\n this.setMaximizable(maximizable);\n }\n if (resizable) {\n this.setResizable(resizable);\n }\n };\n AgDialog.prototype.renderComponent = function () {\n var eGui = this.getGui();\n var _a = this.config, alwaysOnTop = _a.alwaysOnTop, modal = _a.modal, title = _a.title, afterGuiAttached = _a.afterGuiAttached;\n var translate = this.localeService.getLocaleTextFunc();\n var addPopupRes = this.popupService.addPopup({\n modal: modal,\n eChild: eGui,\n closeOnEsc: true,\n closedCallback: this.onClosed.bind(this),\n alwaysOnTop: alwaysOnTop,\n ariaLabel: title || translate('ariaLabelDialog', 'Dialog'),\n afterGuiAttached: afterGuiAttached\n });\n if (addPopupRes) {\n this.close = addPopupRes.hideFunc;\n }\n };\n AgDialog.prototype.onClosed = function (event) {\n var _a, _b;\n this.destroy();\n (_b = (_a = this.config).closedCallback) === null || _b === void 0 ? void 0 : _b.call(_a, event);\n };\n AgDialog.prototype.toggleMaximize = function () {\n var position = this.positionableFeature.getPosition();\n if (this.isMaximized) {\n var _a = this.lastPosition, x = _a.x, y = _a.y, width = _a.width, height = _a.height;\n this.setWidth(width);\n this.setHeight(height);\n this.positionableFeature.offsetElement(x, y);\n }\n else {\n this.lastPosition.width = this.getWidth();\n this.lastPosition.height = this.getHeight();\n this.lastPosition.x = position.x;\n this.lastPosition.y = position.y;\n this.positionableFeature.offsetElement(0, 0);\n this.setHeight('100%');\n this.setWidth('100%');\n }\n this.isMaximized = !this.isMaximized;\n this.refreshMaximizeIcon();\n };\n AgDialog.prototype.refreshMaximizeIcon = function () {\n setDisplayed(this.maximizeIcon, !this.isMaximized);\n setDisplayed(this.minimizeIcon, this.isMaximized);\n };\n AgDialog.prototype.clearMaximizebleListeners = function () {\n if (this.maximizeListeners.length) {\n this.maximizeListeners.forEach(function (destroyListener) { return destroyListener(); });\n this.maximizeListeners.length = 0;\n }\n if (this.resizeListenerDestroy) {\n this.resizeListenerDestroy();\n this.resizeListenerDestroy = null;\n }\n };\n AgDialog.prototype.destroy = function () {\n this.maximizeButtonComp = this.destroyBean(this.maximizeButtonComp);\n this.clearMaximizebleListeners();\n _super.prototype.destroy.call(this);\n };\n AgDialog.prototype.setResizable = function (resizable) {\n this.positionableFeature.setResizable(resizable);\n };\n AgDialog.prototype.setMovable = function (movable) {\n this.positionableFeature.setMovable(movable, this.eTitleBar);\n };\n AgDialog.prototype.setMaximizable = function (maximizable) {\n var _this = this;\n if (!maximizable) {\n this.clearMaximizebleListeners();\n if (this.maximizeButtonComp) {\n this.destroyBean(this.maximizeButtonComp);\n this.maximizeButtonComp = this.maximizeIcon = this.minimizeIcon = undefined;\n }\n return;\n }\n var eTitleBar = this.eTitleBar;\n if (!eTitleBar || maximizable === this.isMaximizable) {\n return;\n }\n var maximizeButtonComp = this.buildMaximizeAndMinimizeElements();\n this.refreshMaximizeIcon();\n maximizeButtonComp.addManagedListener(maximizeButtonComp.getGui(), 'click', this.toggleMaximize.bind(this));\n this.addTitleBarButton(maximizeButtonComp, 0);\n this.maximizeListeners.push(this.addManagedListener(eTitleBar, 'dblclick', this.toggleMaximize.bind(this)));\n this.resizeListenerDestroy = this.addManagedListener(this, 'resize', function () {\n _this.isMaximized = false;\n _this.refreshMaximizeIcon();\n });\n };\n AgDialog.prototype.buildMaximizeAndMinimizeElements = function () {\n var maximizeButtonComp = this.maximizeButtonComp =\n this.createBean(new Component(/* html */ \"
\"));\n var eGui = maximizeButtonComp.getGui();\n this.maximizeIcon = createIconNoSpan('maximize', this.gridOptionsService);\n eGui.appendChild(this.maximizeIcon);\n this.maximizeIcon.classList.add('ag-panel-title-bar-button-icon');\n this.minimizeIcon = createIconNoSpan('minimize', this.gridOptionsService);\n eGui.appendChild(this.minimizeIcon);\n this.minimizeIcon.classList.add('ag-panel-title-bar-button-icon');\n return maximizeButtonComp;\n };\n __decorate$10([\n Autowired('popupService')\n ], AgDialog.prototype, \"popupService\", void 0);\n return AgDialog;\n}(AgPanel));\n\nvar __extends$_ = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$6 = ( false) || function () {\n __assign$6 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$6.apply(this, arguments);\n};\nvar __decorate$$ = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$g = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$e = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar __values$2 = ( false) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar DIRECTION;\n(function (DIRECTION) {\n DIRECTION[DIRECTION[\"vertical\"] = 0] = \"vertical\";\n DIRECTION[DIRECTION[\"horizontal\"] = 1] = \"horizontal\";\n})(DIRECTION || (DIRECTION = {}));\nvar instanceIdSeq = 0;\nvar PopupService = /** @class */ (function (_super) {\n __extends$_(PopupService, _super);\n function PopupService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.popupList = [];\n return _this;\n }\n PopupService_1 = PopupService;\n PopupService.prototype.postConstruct = function () {\n var _this = this;\n this.ctrlsService.whenReady(function (p) {\n _this.gridCtrl = p.gridCtrl;\n });\n this.addManagedListener(this.eventService, Events.EVENT_GRID_STYLES_CHANGED, this.handleThemeChange.bind(this));\n };\n PopupService.prototype.getPopupParent = function () {\n var ePopupParent = this.gridOptionsService.get('popupParent');\n if (ePopupParent) {\n return ePopupParent;\n }\n return this.gridCtrl.getGui();\n };\n PopupService.prototype.positionPopupForMenu = function (params) {\n var eventSource = params.eventSource, ePopup = params.ePopup;\n var popupIdx = this.getPopupIndex(ePopup);\n if (popupIdx !== -1) {\n var popup = this.popupList[popupIdx];\n popup.alignedToElement = eventSource;\n }\n var sourceRect = eventSource.getBoundingClientRect();\n var parentRect = this.getParentRect();\n var y = this.keepXYWithinBounds(ePopup, sourceRect.top - parentRect.top, DIRECTION.vertical);\n var minWidth = (ePopup.clientWidth > 0) ? ePopup.clientWidth : 200;\n ePopup.style.minWidth = \"\".concat(minWidth, \"px\");\n var widthOfParent = parentRect.right - parentRect.left;\n var maxX = widthOfParent - minWidth;\n // the x position of the popup depends on RTL or LTR. for normal cases, LTR, we put the child popup\n // to the right, unless it doesn't fit and we then put it to the left. for RTL it's the other way around,\n // we try place it first to the left, and then if not to the right.\n var x;\n if (this.gridOptionsService.get('enableRtl')) {\n // for RTL, try left first\n x = xLeftPosition();\n if (x < 0) {\n x = xRightPosition();\n this.setAlignedStyles(ePopup, 'left');\n }\n if (x > maxX) {\n x = 0;\n this.setAlignedStyles(ePopup, 'right');\n }\n }\n else {\n // for LTR, try right first\n x = xRightPosition();\n if (x > maxX) {\n x = xLeftPosition();\n this.setAlignedStyles(ePopup, 'right');\n }\n if (x < 0) {\n x = 0;\n this.setAlignedStyles(ePopup, 'left');\n }\n }\n ePopup.style.left = \"\".concat(x, \"px\");\n ePopup.style.top = \"\".concat(y, \"px\");\n function xRightPosition() {\n return sourceRect.right - parentRect.left - 2;\n }\n function xLeftPosition() {\n return sourceRect.left - parentRect.left - minWidth;\n }\n };\n PopupService.prototype.positionPopupUnderMouseEvent = function (params) {\n var _this = this;\n var ePopup = params.ePopup, nudgeX = params.nudgeX, nudgeY = params.nudgeY, skipObserver = params.skipObserver;\n this.positionPopup({\n ePopup: ePopup,\n nudgeX: nudgeX,\n nudgeY: nudgeY,\n keepWithinBounds: true,\n skipObserver: skipObserver,\n updatePosition: function () { return _this.calculatePointerAlign(params.mouseEvent); },\n postProcessCallback: function () { return _this.callPostProcessPopup(params.type, params.ePopup, null, params.mouseEvent, params.column, params.rowNode); }\n });\n };\n PopupService.prototype.calculatePointerAlign = function (e) {\n var parentRect = this.getParentRect();\n return {\n x: e.clientX - parentRect.left,\n y: e.clientY - parentRect.top\n };\n };\n PopupService.prototype.positionPopupByComponent = function (params) {\n var _this = this;\n var ePopup = params.ePopup, nudgeX = params.nudgeX, nudgeY = params.nudgeY, keepWithinBounds = params.keepWithinBounds, eventSource = params.eventSource, _a = params.alignSide, alignSide = _a === void 0 ? 'left' : _a, _b = params.position, position = _b === void 0 ? 'over' : _b, column = params.column, rowNode = params.rowNode, type = params.type;\n var sourceRect = eventSource.getBoundingClientRect();\n var parentRect = this.getParentRect();\n var popupIdx = this.getPopupIndex(ePopup);\n if (popupIdx !== -1) {\n var popup = this.popupList[popupIdx];\n popup.alignedToElement = eventSource;\n }\n var updatePosition = function () {\n var x = sourceRect.left - parentRect.left;\n if (alignSide === 'right') {\n x -= (ePopup.offsetWidth - sourceRect.width);\n }\n var y;\n if (position === 'over') {\n y = (sourceRect.top - parentRect.top);\n _this.setAlignedStyles(ePopup, 'over');\n }\n else {\n _this.setAlignedStyles(ePopup, 'under');\n var alignSide_1 = _this.shouldRenderUnderOrAbove(ePopup, sourceRect, parentRect, params.nudgeY || 0);\n if (alignSide_1 === 'under') {\n y = (sourceRect.top - parentRect.top + sourceRect.height);\n }\n else {\n y = (sourceRect.top - ePopup.offsetHeight - (nudgeY || 0) * 2) - parentRect.top;\n }\n }\n return { x: x, y: y };\n };\n this.positionPopup({\n ePopup: ePopup,\n nudgeX: nudgeX,\n nudgeY: nudgeY,\n keepWithinBounds: keepWithinBounds,\n updatePosition: updatePosition,\n postProcessCallback: function () { return _this.callPostProcessPopup(type, ePopup, eventSource, null, column, rowNode); }\n });\n };\n PopupService.prototype.shouldRenderUnderOrAbove = function (ePopup, targetCompRect, parentRect, nudgeY) {\n var spaceAvailableUnder = parentRect.bottom - targetCompRect.bottom;\n var spaceAvailableAbove = targetCompRect.top - parentRect.top;\n var spaceRequired = ePopup.offsetHeight + nudgeY;\n if (spaceAvailableUnder > spaceRequired) {\n return 'under';\n }\n if (spaceAvailableAbove > spaceRequired || spaceAvailableAbove > spaceAvailableUnder) {\n return 'above';\n }\n return 'under';\n };\n PopupService.prototype.setAlignedStyles = function (ePopup, positioned) {\n var popupIdx = this.getPopupIndex(ePopup);\n if (popupIdx === -1) {\n return;\n }\n var popup = this.popupList[popupIdx];\n var alignedToElement = popup.alignedToElement;\n if (!alignedToElement) {\n return;\n }\n var positions = ['right', 'left', 'over', 'above', 'under'];\n positions.forEach(function (position) {\n alignedToElement.classList.remove(\"ag-has-popup-positioned-\".concat(position));\n ePopup.classList.remove(\"ag-popup-positioned-\".concat(position));\n });\n if (!positioned) {\n return;\n }\n alignedToElement.classList.add(\"ag-has-popup-positioned-\".concat(positioned));\n ePopup.classList.add(\"ag-popup-positioned-\".concat(positioned));\n };\n PopupService.prototype.callPostProcessPopup = function (type, ePopup, eventSource, mouseEvent, column, rowNode) {\n var callback = this.gridOptionsService.getCallback('postProcessPopup');\n if (callback) {\n var params = {\n column: column,\n rowNode: rowNode,\n ePopup: ePopup,\n type: type,\n eventSource: eventSource,\n mouseEvent: mouseEvent\n };\n callback(params);\n }\n };\n PopupService.prototype.positionPopup = function (params) {\n var _this = this;\n var ePopup = params.ePopup, keepWithinBounds = params.keepWithinBounds, nudgeX = params.nudgeX, nudgeY = params.nudgeY, skipObserver = params.skipObserver, updatePosition = params.updatePosition;\n var lastSize = { width: 0, height: 0 };\n var updatePopupPosition = function (fromResizeObserver) {\n if (fromResizeObserver === void 0) { fromResizeObserver = false; }\n var _a = updatePosition(), x = _a.x, y = _a.y;\n if (fromResizeObserver &&\n ePopup.clientWidth === lastSize.width &&\n ePopup.clientHeight === lastSize.height) {\n return;\n }\n lastSize.width = ePopup.clientWidth;\n lastSize.height = ePopup.clientHeight;\n if (nudgeX) {\n x += nudgeX;\n }\n if (nudgeY) {\n y += nudgeY;\n }\n // if popup is overflowing to the bottom, move it up\n if (keepWithinBounds) {\n x = _this.keepXYWithinBounds(ePopup, x, DIRECTION.horizontal);\n y = _this.keepXYWithinBounds(ePopup, y, DIRECTION.vertical);\n }\n ePopup.style.left = \"\".concat(x, \"px\");\n ePopup.style.top = \"\".concat(y, \"px\");\n if (params.postProcessCallback) {\n params.postProcessCallback();\n }\n };\n updatePopupPosition();\n // Mouse tracking will recalculate positioning when moving, so won't need to recalculate here\n if (!skipObserver) {\n // Since rendering popup contents can be asynchronous, use a resize observer to\n // reposition the popup after initial updates to the size of the contents\n var resizeObserverDestroyFunc_1 = this.resizeObserverService.observeResize(ePopup, function () { return updatePopupPosition(true); });\n // Only need to reposition when first open, so can clean up after a bit of time\n setTimeout(function () { return resizeObserverDestroyFunc_1(); }, PopupService_1.WAIT_FOR_POPUP_CONTENT_RESIZE);\n }\n };\n PopupService.prototype.getActivePopups = function () {\n return this.popupList.map(function (popup) { return popup.element; });\n };\n PopupService.prototype.getPopupList = function () {\n return this.popupList;\n };\n PopupService.prototype.getParentRect = function () {\n // subtract the popup parent borders, because popupParent.getBoundingClientRect\n // returns the rect outside the borders, but the 0,0 coordinate for absolute\n // positioning is inside the border, leading the popup to be off by the width\n // of the border\n var eDocument = this.gridOptionsService.getDocument();\n var popupParent = this.getPopupParent();\n if (popupParent === eDocument.body) {\n popupParent = eDocument.documentElement;\n }\n else if (getComputedStyle(popupParent).position === 'static') {\n popupParent = popupParent.offsetParent;\n }\n return getElementRectWithOffset(popupParent);\n };\n PopupService.prototype.keepXYWithinBounds = function (ePopup, position, direction) {\n var isVertical = direction === DIRECTION.vertical;\n var sizeProperty = isVertical ? 'clientHeight' : 'clientWidth';\n var anchorProperty = isVertical ? 'top' : 'left';\n var offsetProperty = isVertical ? 'offsetHeight' : 'offsetWidth';\n var scrollPositionProperty = isVertical ? 'scrollTop' : 'scrollLeft';\n var eDocument = this.gridOptionsService.getDocument();\n var docElement = eDocument.documentElement;\n var popupParent = this.getPopupParent();\n var parentRect = popupParent.getBoundingClientRect();\n var documentRect = eDocument.documentElement.getBoundingClientRect();\n var isBody = popupParent === eDocument.body;\n var offsetSize = ePopup[offsetProperty];\n var getSize = isVertical ? getAbsoluteHeight : getAbsoluteWidth;\n var sizeOfParent = isBody ? (getSize(docElement) + docElement[scrollPositionProperty]) : popupParent[sizeProperty];\n if (isBody) {\n sizeOfParent -= Math.abs(documentRect[anchorProperty] - parentRect[anchorProperty]);\n }\n var max = sizeOfParent - offsetSize;\n return Math.min(Math.max(position, 0), Math.abs(max));\n };\n PopupService.prototype.addPopup = function (params) {\n var eDocument = this.gridOptionsService.getDocument();\n var eChild = params.eChild, ariaLabel = params.ariaLabel, alwaysOnTop = params.alwaysOnTop, positionCallback = params.positionCallback, anchorToElement = params.anchorToElement;\n if (!eDocument) {\n console.warn('AG Grid: could not find the document, document is empty');\n return { hideFunc: function () { } };\n }\n var pos = this.getPopupIndex(eChild);\n if (pos !== -1) {\n var popup = this.popupList[pos];\n return { hideFunc: popup.hideFunc };\n }\n this.initialisePopupPosition(eChild);\n var wrapperEl = this.createPopupWrapper(eChild, ariaLabel, !!alwaysOnTop);\n var removeListeners = this.addEventListenersToPopup(__assign$6(__assign$6({}, params), { wrapperEl: wrapperEl }));\n if (positionCallback) {\n positionCallback();\n }\n this.addPopupToPopupList(eChild, wrapperEl, removeListeners, anchorToElement);\n return {\n hideFunc: removeListeners\n };\n };\n PopupService.prototype.initialisePopupPosition = function (element) {\n var ePopupParent = this.getPopupParent();\n var ePopupParentRect = ePopupParent.getBoundingClientRect();\n if (!exists(element.style.top)) {\n element.style.top = \"\".concat(ePopupParentRect.top * -1, \"px\");\n }\n if (!exists(element.style.left)) {\n element.style.left = \"\".concat(ePopupParentRect.left * -1, \"px\");\n }\n };\n PopupService.prototype.createPopupWrapper = function (element, ariaLabel, alwaysOnTop) {\n var _a;\n var ePopupParent = this.getPopupParent();\n // add env CSS class to child, in case user provided a popup parent, which means\n // theme class may be missing\n var eWrapper = document.createElement('div');\n var allThemes = this.environment.getTheme().allThemes;\n if (allThemes.length) {\n (_a = eWrapper.classList).add.apply(_a, __spreadArray$e([], __read$g(allThemes), false));\n }\n eWrapper.classList.add('ag-popup');\n element.classList.add(this.gridOptionsService.get('enableRtl') ? 'ag-rtl' : 'ag-ltr', 'ag-popup-child');\n if (!element.hasAttribute('role')) {\n setAriaRole(element, 'dialog');\n }\n setAriaLabel(element, ariaLabel);\n eWrapper.appendChild(element);\n ePopupParent.appendChild(eWrapper);\n if (alwaysOnTop) {\n this.setAlwaysOnTop(element, true);\n }\n else {\n this.bringPopupToFront(element);\n }\n return eWrapper;\n };\n PopupService.prototype.handleThemeChange = function () {\n var e_1, _a, e_2, _b, _c;\n var allThemes = this.environment.getTheme().allThemes;\n try {\n for (var _d = __values$2(this.popupList), _e = _d.next(); !_e.done; _e = _d.next()) {\n var popup = _e.value;\n try {\n for (var _f = (e_2 = void 0, __values$2(Array.from(popup.wrapper.classList))), _g = _f.next(); !_g.done; _g = _f.next()) {\n var className = _g.value;\n if (className.startsWith(\"ag-theme-\")) {\n popup.wrapper.classList.remove(className);\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_g && !_g.done && (_b = _f.return)) _b.call(_f);\n }\n finally { if (e_2) throw e_2.error; }\n }\n if (allThemes.length) {\n (_c = popup.wrapper.classList).add.apply(_c, __spreadArray$e([], __read$g(allThemes), false));\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_e && !_e.done && (_a = _d.return)) _a.call(_d);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n PopupService.prototype.addEventListenersToPopup = function (params) {\n var _this = this;\n var eDocument = this.gridOptionsService.getDocument();\n var ePopupParent = this.getPopupParent();\n var wrapperEl = params.wrapperEl, popupEl = params.eChild; params.click; var closedCallback = params.closedCallback, afterGuiAttached = params.afterGuiAttached, closeOnEsc = params.closeOnEsc, modal = params.modal;\n var popupHidden = false;\n var hidePopupOnKeyboardEvent = function (event) {\n if (!wrapperEl.contains(eDocument.activeElement)) {\n return;\n }\n var key = event.key;\n if (key === KeyCode.ESCAPE && !isStopPropagationForAgGrid(event)) {\n removeListeners({ keyboardEvent: event });\n }\n };\n var hidePopupOnMouseEvent = function (event) { return removeListeners({ mouseEvent: event }); };\n var hidePopupOnTouchEvent = function (event) { return removeListeners({ touchEvent: event }); };\n var removeListeners = function (popupParams) {\n if (popupParams === void 0) { popupParams = {}; }\n var mouseEvent = popupParams.mouseEvent, touchEvent = popupParams.touchEvent, keyboardEvent = popupParams.keyboardEvent;\n if (\n // we don't hide popup if the event was on the child, or any\n // children of this child\n _this.isEventFromCurrentPopup({ mouseEvent: mouseEvent, touchEvent: touchEvent }, popupEl) ||\n // this method should only be called once. the client can have different\n // paths, each one wanting to close, so this method may be called multiple times.\n popupHidden) {\n return;\n }\n popupHidden = true;\n ePopupParent.removeChild(wrapperEl);\n eDocument.removeEventListener('keydown', hidePopupOnKeyboardEvent);\n eDocument.removeEventListener('mousedown', hidePopupOnMouseEvent);\n eDocument.removeEventListener('touchstart', hidePopupOnTouchEvent);\n eDocument.removeEventListener('contextmenu', hidePopupOnMouseEvent);\n _this.eventService.removeEventListener(Events.EVENT_DRAG_STARTED, hidePopupOnMouseEvent);\n if (closedCallback) {\n closedCallback(mouseEvent || touchEvent || keyboardEvent);\n }\n _this.removePopupFromPopupList(popupEl);\n };\n if (afterGuiAttached) {\n afterGuiAttached({ hidePopup: removeListeners });\n }\n // if we add these listeners now, then the current mouse\n // click will be included, which we don't want\n window.setTimeout(function () {\n if (closeOnEsc) {\n eDocument.addEventListener('keydown', hidePopupOnKeyboardEvent);\n }\n if (modal) {\n eDocument.addEventListener('mousedown', hidePopupOnMouseEvent);\n _this.eventService.addEventListener(Events.EVENT_DRAG_STARTED, hidePopupOnMouseEvent);\n eDocument.addEventListener('touchstart', hidePopupOnTouchEvent);\n eDocument.addEventListener('contextmenu', hidePopupOnMouseEvent);\n }\n }, 0);\n return removeListeners;\n };\n PopupService.prototype.addPopupToPopupList = function (element, wrapperEl, removeListeners, anchorToElement) {\n this.popupList.push({\n element: element,\n wrapper: wrapperEl,\n hideFunc: removeListeners,\n instanceId: instanceIdSeq++,\n isAnchored: !!anchorToElement\n });\n if (anchorToElement) {\n this.setPopupPositionRelatedToElement(element, anchorToElement);\n }\n };\n PopupService.prototype.getPopupIndex = function (el) {\n return this.popupList.findIndex(function (p) { return p.element === el; });\n };\n PopupService.prototype.setPopupPositionRelatedToElement = function (popupEl, relativeElement) {\n var popupIndex = this.getPopupIndex(popupEl);\n if (popupIndex === -1) {\n return;\n }\n var popup = this.popupList[popupIndex];\n if (popup.stopAnchoringPromise) {\n popup.stopAnchoringPromise.then(function (destroyFunc) { return destroyFunc && destroyFunc(); });\n }\n popup.stopAnchoringPromise = undefined;\n popup.isAnchored = false;\n if (!relativeElement) {\n return;\n }\n // keeps popup positioned under created, eg if context menu, if user scrolls\n // using touchpad and the cell moves, it moves the popup to keep it with the cell.\n var destroyPositionTracker = this.keepPopupPositionedRelativeTo({\n element: relativeElement,\n ePopup: popupEl,\n hidePopup: popup.hideFunc\n });\n popup.stopAnchoringPromise = destroyPositionTracker;\n popup.isAnchored = true;\n return destroyPositionTracker;\n };\n PopupService.prototype.removePopupFromPopupList = function (element) {\n this.setAlignedStyles(element, null);\n this.setPopupPositionRelatedToElement(element, null);\n this.popupList = this.popupList.filter(function (p) { return p.element !== element; });\n };\n PopupService.prototype.keepPopupPositionedRelativeTo = function (params) {\n var _this = this;\n var eParent = this.getPopupParent();\n var parentRect = eParent.getBoundingClientRect();\n var element = params.element, ePopup = params.ePopup;\n var sourceRect = element.getBoundingClientRect();\n var initialDiffTop = parentRect.top - sourceRect.top;\n var initialDiffLeft = parentRect.left - sourceRect.left;\n var lastDiffTop = initialDiffTop;\n var lastDiffLeft = initialDiffLeft;\n var topPx = ePopup.style.top;\n var top = parseInt(topPx.substring(0, topPx.length - 1), 10);\n var leftPx = ePopup.style.left;\n var left = parseInt(leftPx.substring(0, leftPx.length - 1), 10);\n return new AgPromise(function (resolve) {\n _this.getFrameworkOverrides().setInterval(function () {\n var pRect = eParent.getBoundingClientRect();\n var sRect = element.getBoundingClientRect();\n var elementNotInDom = sRect.top == 0 && sRect.left == 0 && sRect.height == 0 && sRect.width == 0;\n if (elementNotInDom) {\n params.hidePopup();\n return;\n }\n var currentDiffTop = pRect.top - sRect.top;\n if (currentDiffTop != lastDiffTop) {\n var newTop = _this.keepXYWithinBounds(ePopup, top + initialDiffTop - currentDiffTop, DIRECTION.vertical);\n ePopup.style.top = \"\".concat(newTop, \"px\");\n }\n lastDiffTop = currentDiffTop;\n var currentDiffLeft = pRect.left - sRect.left;\n if (currentDiffLeft != lastDiffLeft) {\n var newLeft = _this.keepXYWithinBounds(ePopup, left + initialDiffLeft - currentDiffLeft, DIRECTION.horizontal);\n ePopup.style.left = \"\".concat(newLeft, \"px\");\n }\n lastDiffLeft = currentDiffLeft;\n }, 200).then(function (intervalId) {\n var result = function () {\n if (intervalId != null) {\n window.clearInterval(intervalId);\n }\n };\n resolve(result);\n });\n });\n };\n PopupService.prototype.hasAnchoredPopup = function () {\n return this.popupList.some(function (popup) { return popup.isAnchored; });\n };\n PopupService.prototype.isEventFromCurrentPopup = function (params, target) {\n var mouseEvent = params.mouseEvent, touchEvent = params.touchEvent;\n var event = mouseEvent ? mouseEvent : touchEvent;\n if (!event) {\n return false;\n }\n var indexOfThisChild = this.getPopupIndex(target);\n if (indexOfThisChild === -1) {\n return false;\n }\n for (var i = indexOfThisChild; i < this.popupList.length; i++) {\n var popup = this.popupList[i];\n if (isElementInEventPath(popup.element, event)) {\n return true;\n }\n }\n // if the user did not write their own Custom Element to be rendered as popup\n // and this component has an additional popup element, they should have the\n // `ag-custom-component-popup` class to be detected as part of the Custom Component\n return this.isElementWithinCustomPopup(event.target);\n };\n PopupService.prototype.isElementWithinCustomPopup = function (el) {\n var eDocument = this.gridOptionsService.getDocument();\n while (el && el !== eDocument.body) {\n if (el.classList.contains('ag-custom-component-popup') || el.parentElement === null) {\n return true;\n }\n el = el.parentElement;\n }\n return false;\n };\n PopupService.prototype.getWrapper = function (ePopup) {\n while (!ePopup.classList.contains('ag-popup') && ePopup.parentElement) {\n ePopup = ePopup.parentElement;\n }\n return ePopup.classList.contains('ag-popup') ? ePopup : null;\n };\n PopupService.prototype.setAlwaysOnTop = function (ePopup, alwaysOnTop) {\n var eWrapper = this.getWrapper(ePopup);\n if (!eWrapper) {\n return;\n }\n eWrapper.classList.toggle('ag-always-on-top', !!alwaysOnTop);\n if (alwaysOnTop) {\n this.bringPopupToFront(eWrapper);\n }\n };\n PopupService.prototype.bringPopupToFront = function (ePopup) {\n var parent = this.getPopupParent();\n var popupList = Array.prototype.slice.call(parent.querySelectorAll('.ag-popup'));\n var popupLen = popupList.length;\n var alwaysOnTopList = Array.prototype.slice.call(parent.querySelectorAll('.ag-popup.ag-always-on-top'));\n var onTopLength = alwaysOnTopList.length;\n var eWrapper = this.getWrapper(ePopup);\n if (!eWrapper || popupLen <= 1 || !parent.contains(ePopup)) {\n return;\n }\n var pos = popupList.indexOf(eWrapper);\n var innerEls = eWrapper.querySelectorAll('div');\n var innerElsScrollMap = [];\n innerEls.forEach(function (el) {\n if (el.scrollTop !== 0) {\n innerElsScrollMap.push([el, el.scrollTop]);\n }\n });\n if (onTopLength) {\n var isPopupAlwaysOnTop = eWrapper.classList.contains('ag-always-on-top');\n if (isPopupAlwaysOnTop) {\n if (pos !== popupLen - 1) {\n last(alwaysOnTopList).insertAdjacentElement('afterend', eWrapper);\n }\n }\n else if (pos !== popupLen - onTopLength - 1) {\n alwaysOnTopList[0].insertAdjacentElement('beforebegin', eWrapper);\n }\n }\n else if (pos !== popupLen - 1) {\n last(popupList).insertAdjacentElement('afterend', eWrapper);\n }\n while (innerElsScrollMap.length) {\n var currentEl = innerElsScrollMap.pop();\n currentEl[0].scrollTop = currentEl[1];\n }\n var params = {\n type: 'popupToFront',\n eWrapper: eWrapper\n };\n this.eventService.dispatchEvent(params);\n };\n var PopupService_1;\n PopupService.WAIT_FOR_POPUP_CONTENT_RESIZE = 200;\n __decorate$$([\n Autowired('focusService')\n ], PopupService.prototype, \"focusService\", void 0);\n __decorate$$([\n Autowired('ctrlsService')\n ], PopupService.prototype, \"ctrlsService\", void 0);\n __decorate$$([\n Autowired('resizeObserverService')\n ], PopupService.prototype, \"resizeObserverService\", void 0);\n __decorate$$([\n PostConstruct\n ], PopupService.prototype, \"postConstruct\", null);\n PopupService = PopupService_1 = __decorate$$([\n Bean('popupService')\n ], PopupService);\n return PopupService;\n}(BeanStub));\n\nvar __extends$Z = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar AgAutocompleteRow = /** @class */ (function (_super) {\n __extends$Z(AgAutocompleteRow, _super);\n function AgAutocompleteRow() {\n var _this = _super.call(this, /* html */ \"\\n
\\n
\\n
\") || this;\n _this.hasHighlighting = false;\n return _this;\n }\n AgAutocompleteRow.prototype.setState = function (value, selected) {\n this.value = value;\n this.render();\n this.updateSelected(selected);\n };\n AgAutocompleteRow.prototype.updateSelected = function (selected) {\n this.addOrRemoveCssClass('ag-autocomplete-row-selected', selected);\n };\n AgAutocompleteRow.prototype.setSearchString = function (searchString) {\n var _a;\n var keepHighlighting = false;\n if (exists(searchString)) {\n var index = (_a = this.value) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase().indexOf(searchString.toLocaleLowerCase());\n if (index >= 0) {\n keepHighlighting = true;\n this.hasHighlighting = true;\n var highlightEndIndex = index + searchString.length;\n var startPart = escapeString(this.value.slice(0, index));\n var highlightedPart = escapeString(this.value.slice(index, highlightEndIndex));\n var endPart = escapeString(this.value.slice(highlightEndIndex));\n this.getGui().lastElementChild.innerHTML = \"\".concat(startPart, \"\").concat(highlightedPart, \"\").concat(endPart);\n }\n }\n if (!keepHighlighting && this.hasHighlighting) {\n this.hasHighlighting = false;\n this.render();\n }\n };\n AgAutocompleteRow.prototype.render = function () {\n var _a;\n // putting in blank if missing, so at least the user can click on it\n this.getGui().lastElementChild.innerHTML = (_a = escapeString(this.value)) !== null && _a !== void 0 ? _a : ' ';\n };\n return AgAutocompleteRow;\n}(Component));\n\nvar __extends$Y = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$_ = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AgAutocompleteList = /** @class */ (function (_super) {\n __extends$Y(AgAutocompleteList, _super);\n function AgAutocompleteList(params) {\n var _this = _super.call(this, AgAutocompleteList.TEMPLATE) || this;\n _this.params = params;\n _this.searchString = '';\n return _this;\n }\n AgAutocompleteList.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n AgAutocompleteList.prototype.init = function () {\n var _this = this;\n this.autocompleteEntries = this.params.autocompleteEntries;\n this.virtualList = this.createManagedBean(new VirtualList({ cssIdentifier: 'autocomplete' }));\n this.virtualList.setComponentCreator(this.createRowComponent.bind(this));\n this.eList.appendChild(this.virtualList.getGui());\n this.virtualList.setModel({\n getRowCount: function () { return _this.autocompleteEntries.length; },\n getRow: function (index) { return _this.autocompleteEntries[index]; }\n });\n var virtualListGui = this.virtualList.getGui();\n this.addManagedListener(virtualListGui, 'click', function () { return _this.params.onConfirmed(); });\n this.addManagedListener(virtualListGui, 'mousemove', this.onMouseMove.bind(this));\n this.addManagedListener(virtualListGui, 'mousedown', function (e) { return e.preventDefault(); });\n this.setSelectedValue(0);\n };\n AgAutocompleteList.prototype.onNavigationKeyDown = function (event, key) {\n // if we don't preventDefault the page body and/or grid scroll will move.\n event.preventDefault();\n var oldIndex = this.autocompleteEntries.indexOf(this.selectedValue);\n var newIndex = key === KeyCode.UP ? oldIndex - 1 : oldIndex + 1;\n this.checkSetSelectedValue(newIndex);\n };\n AgAutocompleteList.prototype.setSearch = function (searchString) {\n this.searchString = searchString;\n if (exists(searchString)) {\n this.runSearch();\n }\n else {\n // reset\n this.autocompleteEntries = this.params.autocompleteEntries;\n this.virtualList.refresh();\n this.checkSetSelectedValue(0);\n }\n this.updateSearchInList();\n };\n AgAutocompleteList.prototype.runContainsSearch = function (searchString, searchStrings) {\n var topMatch;\n var topMatchStartsWithSearchString = false;\n var lowerCaseSearchString = searchString.toLocaleLowerCase();\n var allMatches = searchStrings.filter(function (string) {\n var lowerCaseString = string.toLocaleLowerCase();\n var index = lowerCaseString.indexOf(lowerCaseSearchString);\n var startsWithSearchString = index === 0;\n var isMatch = index >= 0;\n // top match is shortest value that starts with the search string, otherwise shortest value that includes the search string\n if (isMatch && (!topMatch ||\n (!topMatchStartsWithSearchString && startsWithSearchString) ||\n (topMatchStartsWithSearchString === startsWithSearchString && string.length < topMatch.length))) {\n topMatch = string;\n topMatchStartsWithSearchString = startsWithSearchString;\n }\n return isMatch;\n });\n if (!topMatch && allMatches.length) {\n topMatch = allMatches[0];\n }\n return { topMatch: topMatch, allMatches: allMatches };\n };\n AgAutocompleteList.prototype.runSearch = function () {\n var _a, _b;\n var autocompleteEntries = this.params.autocompleteEntries;\n var searchStrings = autocompleteEntries.map(function (v) { var _a; return (_a = v.displayValue) !== null && _a !== void 0 ? _a : v.key; });\n var matchingStrings;\n var topSuggestion;\n if (this.params.useFuzzySearch) {\n matchingStrings = fuzzySuggestions(this.searchString, searchStrings, true).values;\n topSuggestion = matchingStrings.length ? matchingStrings[0] : undefined;\n }\n else {\n var containsMatches = this.runContainsSearch(this.searchString, searchStrings);\n matchingStrings = containsMatches.allMatches;\n topSuggestion = containsMatches.topMatch;\n }\n var filteredEntries = autocompleteEntries.filter(function (_a) {\n var key = _a.key, displayValue = _a.displayValue;\n return matchingStrings.includes(displayValue !== null && displayValue !== void 0 ? displayValue : key);\n });\n if (!filteredEntries.length && this.selectedValue && ((_b = (_a = this.params) === null || _a === void 0 ? void 0 : _a.forceLastSelection) === null || _b === void 0 ? void 0 : _b.call(_a, this.selectedValue, this.searchString))) {\n filteredEntries = [this.selectedValue];\n }\n this.autocompleteEntries = filteredEntries;\n this.virtualList.refresh();\n if (!topSuggestion) {\n return;\n }\n var topSuggestionIndex = matchingStrings.indexOf(topSuggestion);\n this.checkSetSelectedValue(topSuggestionIndex);\n };\n AgAutocompleteList.prototype.updateSearchInList = function () {\n var _this = this;\n this.virtualList.forEachRenderedRow(function (row) { return row.setSearchString(_this.searchString); });\n };\n AgAutocompleteList.prototype.checkSetSelectedValue = function (index) {\n if (index >= 0 && index < this.autocompleteEntries.length) {\n this.setSelectedValue(index);\n }\n };\n AgAutocompleteList.prototype.setSelectedValue = function (index) {\n var value = this.autocompleteEntries[index];\n if (this.selectedValue === value) {\n return;\n }\n this.selectedValue = value;\n this.virtualList.ensureIndexVisible(index);\n this.virtualList.forEachRenderedRow(function (cmp, idx) {\n cmp.updateSelected(index === idx);\n });\n };\n AgAutocompleteList.prototype.createRowComponent = function (value) {\n var _a;\n var row = new AgAutocompleteRow();\n this.getContext().createBean(row);\n row.setState((_a = value.displayValue) !== null && _a !== void 0 ? _a : value.key, value === this.selectedValue);\n return row;\n };\n AgAutocompleteList.prototype.onMouseMove = function (mouseEvent) {\n var rect = this.virtualList.getGui().getBoundingClientRect();\n var scrollTop = this.virtualList.getScrollTop();\n var mouseY = mouseEvent.clientY - rect.top + scrollTop;\n var row = Math.floor(mouseY / this.virtualList.getRowHeight());\n this.checkSetSelectedValue(row);\n };\n AgAutocompleteList.prototype.afterGuiAttached = function () {\n this.virtualList.refresh();\n };\n AgAutocompleteList.prototype.getSelectedValue = function () {\n var _a;\n if (!this.autocompleteEntries.length) {\n return null;\n }\n return (_a = this.selectedValue) !== null && _a !== void 0 ? _a : null;\n };\n AgAutocompleteList.TEMPLATE = \"
\\n
\\n
\";\n __decorate$_([\n RefSelector('eList')\n ], AgAutocompleteList.prototype, \"eList\", void 0);\n __decorate$_([\n PostConstruct\n ], AgAutocompleteList.prototype, \"init\", null);\n return AgAutocompleteList;\n}(PopupComponent));\n\nvar __extends$X = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$Z = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AgAutocomplete = /** @class */ (function (_super) {\n __extends$X(AgAutocomplete, _super);\n function AgAutocomplete() {\n var _this = _super.call(this, /* html */ \"\\n
\\n \\n
\") || this;\n _this.isListOpen = false;\n _this.lastPosition = 0;\n _this.valid = true;\n return _this;\n }\n AgAutocomplete.prototype.postConstruct = function () {\n var _this = this;\n this.eAutocompleteInput.onValueChange(function (value) { return _this.onValueChanged(value); });\n this.eAutocompleteInput.getInputElement().setAttribute('autocomplete', 'off');\n this.addGuiEventListener('keydown', this.onKeyDown.bind(this));\n this.addGuiEventListener('click', this.updatePositionAndList.bind(this));\n this.addDestroyFunc(function () {\n _this.destroyBean(_this.autocompleteList);\n });\n this.addGuiEventListener('focusout', function () { return _this.onFocusOut(); });\n };\n AgAutocomplete.prototype.onValueChanged = function (value) {\n var parsedValue = makeNull(value);\n this.updateValue(parsedValue);\n this.updateAutocompleteList(parsedValue);\n };\n AgAutocomplete.prototype.updateValue = function (value) {\n this.updateLastPosition();\n this.dispatchEvent({\n type: AgAutocomplete.EVENT_VALUE_CHANGED,\n value: value\n });\n this.validate(value);\n };\n AgAutocomplete.prototype.updateAutocompleteList = function (value) {\n var _a, _b, _c, _d;\n var autocompleteListParams = (_b = (_a = this.listGenerator) === null || _a === void 0 ? void 0 : _a.call(this, value, this.lastPosition)) !== null && _b !== void 0 ? _b : { enabled: false };\n if (!autocompleteListParams.type || autocompleteListParams.type !== ((_c = this.autocompleteListParams) === null || _c === void 0 ? void 0 : _c.type)) {\n if (this.isListOpen) {\n this.closeList();\n }\n }\n this.autocompleteListParams = autocompleteListParams;\n if ((_d = this.autocompleteListParams) === null || _d === void 0 ? void 0 : _d.enabled) {\n if (!this.isListOpen) {\n this.openList();\n }\n var searchString = this.autocompleteListParams.searchString;\n this.autocompleteList.setSearch(searchString !== null && searchString !== void 0 ? searchString : '');\n }\n else {\n if (this.isListOpen) {\n this.closeList();\n }\n }\n };\n AgAutocomplete.prototype.onKeyDown = function (event) {\n var _this = this;\n var key = event.key;\n this.updateLastPosition();\n switch (key) {\n case KeyCode.ENTER:\n this.onEnterKeyDown(event);\n break;\n case KeyCode.TAB:\n this.onTabKeyDown(event);\n break;\n case KeyCode.DOWN:\n case KeyCode.UP:\n this.onUpDownKeyDown(event, key);\n break;\n case KeyCode.LEFT:\n case KeyCode.RIGHT:\n case KeyCode.PAGE_HOME:\n case KeyCode.PAGE_END:\n // input position is updated after this is called, so do async\n setTimeout(function () {\n _this.updatePositionAndList();\n });\n break;\n case KeyCode.ESCAPE:\n this.onEscapeKeyDown(event);\n break;\n case KeyCode.SPACE:\n if (event.ctrlKey && !this.isListOpen) {\n event.preventDefault();\n this.forceOpenList();\n }\n break;\n }\n };\n AgAutocomplete.prototype.confirmSelection = function () {\n var _a;\n var selectedValue = (_a = this.autocompleteList) === null || _a === void 0 ? void 0 : _a.getSelectedValue();\n if (selectedValue) {\n this.closeList();\n this.dispatchEvent({\n type: AgAutocomplete.EVENT_OPTION_SELECTED,\n value: this.getValue(),\n position: this.lastPosition,\n updateEntry: selectedValue,\n autocompleteType: this.autocompleteListParams.type\n });\n }\n };\n AgAutocomplete.prototype.onTabKeyDown = function (event) {\n if (this.isListOpen) {\n event.preventDefault();\n event.stopPropagation();\n this.confirmSelection();\n }\n };\n AgAutocomplete.prototype.onEnterKeyDown = function (event) {\n event.preventDefault();\n if (this.isListOpen) {\n this.confirmSelection();\n }\n else {\n this.onCompleted();\n }\n };\n AgAutocomplete.prototype.onUpDownKeyDown = function (event, key) {\n var _a;\n event.preventDefault();\n if (!this.isListOpen) {\n this.forceOpenList();\n }\n else {\n (_a = this.autocompleteList) === null || _a === void 0 ? void 0 : _a.onNavigationKeyDown(event, key);\n }\n };\n AgAutocomplete.prototype.onEscapeKeyDown = function (event) {\n if (this.isListOpen) {\n event.preventDefault();\n event.stopPropagation();\n this.closeList();\n this.setCaret(this.lastPosition, true);\n }\n };\n AgAutocomplete.prototype.onFocusOut = function () {\n if (this.isListOpen) {\n this.closeList();\n }\n };\n AgAutocomplete.prototype.updatePositionAndList = function () {\n var _a;\n this.updateLastPosition();\n this.updateAutocompleteList((_a = this.eAutocompleteInput.getValue()) !== null && _a !== void 0 ? _a : null);\n };\n AgAutocomplete.prototype.setCaret = function (position, setFocus) {\n var eDocument = this.gridOptionsService.getDocument();\n if (setFocus && eDocument.activeElement === eDocument.body) {\n // clicking on the list loses focus, so restore\n this.eAutocompleteInput.getFocusableElement().focus();\n }\n var eInput = this.eAutocompleteInput.getInputElement();\n eInput.setSelectionRange(position, position);\n if (position === eInput.value.length) {\n // ensure the caret is visible\n eInput.scrollLeft = eInput.scrollWidth;\n }\n };\n AgAutocomplete.prototype.forceOpenList = function () {\n this.onValueChanged(this.eAutocompleteInput.getValue());\n };\n AgAutocomplete.prototype.updateLastPosition = function () {\n var _a;\n this.lastPosition = (_a = this.eAutocompleteInput.getInputElement().selectionStart) !== null && _a !== void 0 ? _a : 0;\n };\n AgAutocomplete.prototype.validate = function (value) {\n var _a;\n if (!this.validator) {\n return;\n }\n this.validationMessage = this.validator(value);\n this.eAutocompleteInput.getInputElement().setCustomValidity((_a = this.validationMessage) !== null && _a !== void 0 ? _a : '');\n this.valid = !this.validationMessage;\n this.dispatchEvent({\n type: AgAutocomplete.EVENT_VALID_CHANGED,\n isValid: this.valid,\n validationMessage: this.validationMessage\n });\n };\n AgAutocomplete.prototype.openList = function () {\n var _this = this;\n this.isListOpen = true;\n // this is unmanaged as it gets destroyed/created each time it is opened\n this.autocompleteList = this.createBean(new AgAutocompleteList({\n autocompleteEntries: this.autocompleteListParams.entries,\n onConfirmed: function () { return _this.confirmSelection(); },\n forceLastSelection: this.forceLastSelection\n }));\n var ePopupGui = this.autocompleteList.getGui();\n var positionParams = {\n ePopup: ePopupGui,\n type: 'autocomplete',\n eventSource: this.getGui(),\n position: 'under',\n alignSide: this.gridOptionsService.get('enableRtl') ? 'right' : 'left',\n keepWithinBounds: true\n };\n var addPopupRes = this.popupService.addPopup({\n eChild: ePopupGui,\n anchorToElement: this.getGui(),\n positionCallback: function () { return _this.popupService.positionPopupByComponent(positionParams); },\n ariaLabel: this.listAriaLabel\n });\n this.hidePopup = addPopupRes.hideFunc;\n this.autocompleteList.afterGuiAttached();\n };\n AgAutocomplete.prototype.closeList = function () {\n this.isListOpen = false;\n this.hidePopup();\n this.destroyBean(this.autocompleteList);\n this.autocompleteList = null;\n };\n AgAutocomplete.prototype.onCompleted = function () {\n if (this.isListOpen) {\n this.closeList();\n }\n this.dispatchEvent({\n type: AgAutocomplete.EVENT_VALUE_CONFIRMED,\n value: this.getValue(),\n isValid: this.isValid()\n });\n };\n AgAutocomplete.prototype.getValue = function () {\n return makeNull(this.eAutocompleteInput.getValue());\n };\n AgAutocomplete.prototype.setInputPlaceholder = function (placeholder) {\n this.eAutocompleteInput.setInputPlaceholder(placeholder);\n return this;\n };\n AgAutocomplete.prototype.setInputAriaLabel = function (label) {\n this.eAutocompleteInput.setInputAriaLabel(label);\n return this;\n };\n AgAutocomplete.prototype.setListAriaLabel = function (label) {\n this.listAriaLabel = label;\n return this;\n };\n AgAutocomplete.prototype.setListGenerator = function (listGenerator) {\n this.listGenerator = listGenerator;\n return this;\n };\n AgAutocomplete.prototype.setValidator = function (validator) {\n this.validator = validator;\n return this;\n };\n AgAutocomplete.prototype.isValid = function () {\n return this.valid;\n };\n AgAutocomplete.prototype.setValue = function (params) {\n var value = params.value, position = params.position, silent = params.silent, updateListOnlyIfOpen = params.updateListOnlyIfOpen, restoreFocus = params.restoreFocus;\n this.eAutocompleteInput.setValue(value, true);\n this.setCaret(position !== null && position !== void 0 ? position : this.lastPosition, restoreFocus);\n if (!silent) {\n this.updateValue(value);\n }\n if (!updateListOnlyIfOpen || this.isListOpen) {\n this.updateAutocompleteList(value);\n }\n };\n AgAutocomplete.prototype.setForceLastSelection = function (forceLastSelection) {\n this.forceLastSelection = forceLastSelection;\n return this;\n };\n AgAutocomplete.prototype.setInputDisabled = function (disabled) {\n this.eAutocompleteInput.setDisabled(disabled);\n return this;\n };\n AgAutocomplete.EVENT_VALUE_CHANGED = 'eventValueChanged';\n AgAutocomplete.EVENT_VALUE_CONFIRMED = 'eventValueConfirmed';\n AgAutocomplete.EVENT_OPTION_SELECTED = 'eventOptionSelected';\n AgAutocomplete.EVENT_VALID_CHANGED = 'eventValidChanged';\n __decorate$Z([\n Autowired('popupService')\n ], AgAutocomplete.prototype, \"popupService\", void 0);\n __decorate$Z([\n RefSelector('eAutocompleteInput')\n ], AgAutocomplete.prototype, \"eAutocompleteInput\", void 0);\n __decorate$Z([\n PostConstruct\n ], AgAutocomplete.prototype, \"postConstruct\", null);\n return AgAutocomplete;\n}(Component));\n\nvar PASSIVE_EVENTS = ['touchstart', 'touchend', 'touchmove', 'touchcancel'];\n/** The base frameworks, eg React & Angular, override this bean with implementations specific to their requirement. */\nvar VanillaFrameworkOverrides = /** @class */ (function () {\n function VanillaFrameworkOverrides(frameworkName) {\n if (frameworkName === void 0) { frameworkName = 'javascript'; }\n this.frameworkName = frameworkName;\n this.renderingEngine = \"vanilla\";\n this.wrapIncoming = function (callback) { return callback(); };\n this.wrapOutgoing = function (callback) { return callback(); };\n }\n VanillaFrameworkOverrides.prototype.setInterval = function (action, timeout) {\n return new AgPromise(function (resolve) {\n resolve(window.setInterval(action, timeout));\n });\n };\n // for Vanilla JS, we just add the event to the element\n VanillaFrameworkOverrides.prototype.addEventListener = function (element, type, listener, useCapture) {\n var isPassive = includes(PASSIVE_EVENTS, type);\n element.addEventListener(type, listener, { capture: !!useCapture, passive: isPassive });\n };\n Object.defineProperty(VanillaFrameworkOverrides.prototype, \"shouldWrapOutgoing\", {\n get: function () { return false; },\n enumerable: false,\n configurable: true\n });\n VanillaFrameworkOverrides.prototype.frameworkComponent = function (name) {\n return null;\n };\n VanillaFrameworkOverrides.prototype.isFrameworkComponent = function (comp) {\n return false;\n };\n VanillaFrameworkOverrides.prototype.getDocLink = function (path) {\n var framework = this.frameworkName === 'solid' ? 'react' : this.frameworkName;\n return \"https://www.ag-grid.com/\".concat(framework, \"-data-grid\").concat(path ? \"/\".concat(path) : '');\n };\n return VanillaFrameworkOverrides;\n}());\n\nvar __extends$W = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$Y = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$f = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$d = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar CellNavigationService = /** @class */ (function (_super) {\n __extends$W(CellNavigationService, _super);\n function CellNavigationService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n // returns null if no cell to focus on, ie at the end of the grid\n CellNavigationService.prototype.getNextCellToFocus = function (key, focusedCell, ctrlPressed) {\n if (ctrlPressed === void 0) { ctrlPressed = false; }\n if (ctrlPressed) {\n return this.getNextCellToFocusWithCtrlPressed(key, focusedCell);\n }\n return this.getNextCellToFocusWithoutCtrlPressed(key, focusedCell);\n };\n CellNavigationService.prototype.getNextCellToFocusWithCtrlPressed = function (key, focusedCell) {\n var upKey = key === KeyCode.UP;\n var downKey = key === KeyCode.DOWN;\n var leftKey = key === KeyCode.LEFT;\n var column;\n var rowIndex;\n if (upKey || downKey) {\n rowIndex = upKey ? this.paginationProxy.getPageFirstRow() : this.paginationProxy.getPageLastRow();\n column = focusedCell.column;\n }\n else {\n var allColumns = this.columnModel.getAllDisplayedColumns();\n var isRtl = this.gridOptionsService.get('enableRtl');\n rowIndex = focusedCell.rowIndex;\n column = leftKey !== isRtl ? allColumns[0] : last(allColumns);\n }\n return {\n rowIndex: rowIndex,\n rowPinned: null,\n column: column\n };\n };\n CellNavigationService.prototype.getNextCellToFocusWithoutCtrlPressed = function (key, focusedCell) {\n // starting with the provided cell, we keep moving until we find a cell we can\n // focus on.\n var pointer = focusedCell;\n var finished = false;\n // finished will be true when either:\n // a) cell found that we can focus on\n // b) run out of cells (ie the method returns null)\n while (!finished) {\n switch (key) {\n case KeyCode.UP:\n pointer = this.getCellAbove(pointer);\n break;\n case KeyCode.DOWN:\n pointer = this.getCellBelow(pointer);\n break;\n case KeyCode.RIGHT:\n if (this.gridOptionsService.get('enableRtl')) {\n pointer = this.getCellToLeft(pointer);\n }\n else {\n pointer = this.getCellToRight(pointer);\n }\n break;\n case KeyCode.LEFT:\n if (this.gridOptionsService.get('enableRtl')) {\n pointer = this.getCellToRight(pointer);\n }\n else {\n pointer = this.getCellToLeft(pointer);\n }\n break;\n default:\n pointer = null;\n console.warn('AG Grid: unknown key for navigation ' + key);\n break;\n }\n if (pointer) {\n finished = this.isCellGoodToFocusOn(pointer);\n }\n else {\n finished = true;\n }\n }\n return pointer;\n };\n CellNavigationService.prototype.isCellGoodToFocusOn = function (gridCell) {\n var column = gridCell.column;\n var rowNode;\n switch (gridCell.rowPinned) {\n case 'top':\n rowNode = this.pinnedRowModel.getPinnedTopRow(gridCell.rowIndex);\n break;\n case 'bottom':\n rowNode = this.pinnedRowModel.getPinnedBottomRow(gridCell.rowIndex);\n break;\n default:\n rowNode = this.rowModel.getRow(gridCell.rowIndex);\n break;\n }\n if (!rowNode) {\n return false;\n }\n var suppressNavigable = column.isSuppressNavigable(rowNode);\n return !suppressNavigable;\n };\n CellNavigationService.prototype.getCellToLeft = function (lastCell) {\n if (!lastCell) {\n return null;\n }\n var colToLeft = this.columnModel.getDisplayedColBefore(lastCell.column);\n if (!colToLeft) {\n return null;\n }\n return {\n rowIndex: lastCell.rowIndex,\n column: colToLeft,\n rowPinned: lastCell.rowPinned\n };\n };\n CellNavigationService.prototype.getCellToRight = function (lastCell) {\n if (!lastCell) {\n return null;\n }\n var colToRight = this.columnModel.getDisplayedColAfter(lastCell.column);\n // if already on right, do nothing\n if (!colToRight) {\n return null;\n }\n return {\n rowIndex: lastCell.rowIndex,\n column: colToRight,\n rowPinned: lastCell.rowPinned\n };\n };\n CellNavigationService.prototype.getRowBelow = function (rowPosition) {\n // if already on top row, do nothing\n var index = rowPosition.rowIndex;\n var pinned = rowPosition.rowPinned;\n if (this.isLastRowInContainer(rowPosition)) {\n switch (pinned) {\n case 'bottom':\n // never any rows after pinned bottom\n return null;\n case 'top':\n // if on last row of pinned top, then next row is main body (if rows exist),\n // otherwise it's the pinned bottom\n if (this.rowModel.isRowsToRender()) {\n return { rowIndex: this.paginationProxy.getPageFirstRow(), rowPinned: null };\n }\n if (this.pinnedRowModel.isRowsToRender('bottom')) {\n return { rowIndex: 0, rowPinned: 'bottom' };\n }\n return null;\n default:\n // if in the main body, then try pinned bottom, otherwise return nothing\n if (this.pinnedRowModel.isRowsToRender('bottom')) {\n return { rowIndex: 0, rowPinned: 'bottom' };\n }\n return null;\n }\n }\n var rowNode = this.rowModel.getRow(rowPosition.rowIndex);\n var nextStickyPosition = this.getNextStickyPosition(rowNode);\n if (nextStickyPosition) {\n return nextStickyPosition;\n }\n return { rowIndex: index + 1, rowPinned: pinned };\n };\n CellNavigationService.prototype.getNextStickyPosition = function (rowNode, up) {\n if (!this.gridOptionsService.isGroupRowsSticky() || !rowNode || !rowNode.sticky) {\n return;\n }\n var stickyRowCtrls = __spreadArray$d([], __read$f(this.rowRenderer.getStickyTopRowCtrls()), false).sort(function (a, b) { return a.getRowNode().rowIndex - b.getRowNode().rowIndex; });\n var diff = up ? -1 : 1;\n var idx = stickyRowCtrls.findIndex(function (ctrl) { return ctrl.getRowNode().rowIndex === rowNode.rowIndex; });\n var nextCtrl = stickyRowCtrls[idx + diff];\n if (nextCtrl) {\n return { rowIndex: nextCtrl.getRowNode().rowIndex, rowPinned: null };\n }\n };\n CellNavigationService.prototype.getCellBelow = function (lastCell) {\n if (!lastCell) {\n return null;\n }\n var rowBelow = this.getRowBelow(lastCell);\n if (rowBelow) {\n return {\n rowIndex: rowBelow.rowIndex,\n column: lastCell.column,\n rowPinned: rowBelow.rowPinned\n };\n }\n return null;\n };\n CellNavigationService.prototype.isLastRowInContainer = function (rowPosition) {\n var pinned = rowPosition.rowPinned;\n var index = rowPosition.rowIndex;\n if (pinned === 'top') {\n var lastTopIndex = this.pinnedRowModel.getPinnedTopRowData().length - 1;\n return lastTopIndex <= index;\n }\n if (pinned === 'bottom') {\n var lastBottomIndex = this.pinnedRowModel.getPinnedBottomRowData().length - 1;\n return lastBottomIndex <= index;\n }\n var lastBodyIndex = this.paginationProxy.getPageLastRow();\n return lastBodyIndex <= index;\n };\n CellNavigationService.prototype.getRowAbove = function (rowPosition) {\n // if already on top row, do nothing\n var index = rowPosition.rowIndex;\n var pinned = rowPosition.rowPinned;\n var isFirstRow = pinned ? index === 0 : index === this.paginationProxy.getPageFirstRow();\n // if already on top row, do nothing\n if (isFirstRow) {\n if (pinned === 'top') {\n return null;\n }\n if (!pinned) {\n if (this.pinnedRowModel.isRowsToRender('top')) {\n return this.getLastFloatingTopRow();\n }\n return null;\n }\n // last floating bottom\n if (this.rowModel.isRowsToRender()) {\n return this.getLastBodyCell();\n }\n if (this.pinnedRowModel.isRowsToRender('top')) {\n return this.getLastFloatingTopRow();\n }\n return null;\n }\n var rowNode = this.rowModel.getRow(rowPosition.rowIndex);\n var nextStickyPosition = this.getNextStickyPosition(rowNode, true);\n if (nextStickyPosition) {\n return nextStickyPosition;\n }\n return { rowIndex: index - 1, rowPinned: pinned };\n };\n CellNavigationService.prototype.getCellAbove = function (lastCell) {\n if (!lastCell) {\n return null;\n }\n var rowAbove = this.getRowAbove({ rowIndex: lastCell.rowIndex, rowPinned: lastCell.rowPinned });\n if (rowAbove) {\n return {\n rowIndex: rowAbove.rowIndex,\n column: lastCell.column,\n rowPinned: rowAbove.rowPinned\n };\n }\n return null;\n };\n CellNavigationService.prototype.getLastBodyCell = function () {\n var lastBodyRow = this.paginationProxy.getPageLastRow();\n return { rowIndex: lastBodyRow, rowPinned: null };\n };\n CellNavigationService.prototype.getLastFloatingTopRow = function () {\n var lastFloatingRow = this.pinnedRowModel.getPinnedTopRowData().length - 1;\n return { rowIndex: lastFloatingRow, rowPinned: 'top' };\n };\n CellNavigationService.prototype.getNextTabbedCell = function (gridCell, backwards) {\n if (backwards) {\n return this.getNextTabbedCellBackwards(gridCell);\n }\n return this.getNextTabbedCellForwards(gridCell);\n };\n CellNavigationService.prototype.getNextTabbedCellForwards = function (gridCell) {\n var displayedColumns = this.columnModel.getAllDisplayedColumns();\n var newRowIndex = gridCell.rowIndex;\n var newFloating = gridCell.rowPinned;\n // move along to the next cell\n var newColumn = this.columnModel.getDisplayedColAfter(gridCell.column);\n // check if end of the row, and if so, go forward a row\n if (!newColumn) {\n newColumn = displayedColumns[0];\n var rowBelow = this.getRowBelow(gridCell);\n if (missing(rowBelow)) {\n return null;\n }\n // If we are tabbing and there is a paging panel present, tabbing should go\n // to the paging panel instead of loading the next page.\n if (!rowBelow.rowPinned && !this.paginationProxy.isRowInPage(rowBelow)) {\n return null;\n }\n newRowIndex = rowBelow ? rowBelow.rowIndex : null;\n newFloating = rowBelow ? rowBelow.rowPinned : null;\n }\n return { rowIndex: newRowIndex, column: newColumn, rowPinned: newFloating };\n };\n CellNavigationService.prototype.getNextTabbedCellBackwards = function (gridCell) {\n var displayedColumns = this.columnModel.getAllDisplayedColumns();\n var newRowIndex = gridCell.rowIndex;\n var newFloating = gridCell.rowPinned;\n // move along to the next cell\n var newColumn = this.columnModel.getDisplayedColBefore(gridCell.column);\n // check if end of the row, and if so, go forward a row\n if (!newColumn) {\n newColumn = last(displayedColumns);\n var rowAbove = this.getRowAbove({ rowIndex: gridCell.rowIndex, rowPinned: gridCell.rowPinned });\n if (missing(rowAbove)) {\n return null;\n }\n // If we are tabbing and there is a paging panel present, tabbing should go\n // to the paging panel instead of loading the next page.\n if (!rowAbove.rowPinned && !this.paginationProxy.isRowInPage(rowAbove)) {\n return null;\n }\n newRowIndex = rowAbove ? rowAbove.rowIndex : null;\n newFloating = rowAbove ? rowAbove.rowPinned : null;\n }\n return { rowIndex: newRowIndex, column: newColumn, rowPinned: newFloating };\n };\n __decorate$Y([\n Autowired('columnModel')\n ], CellNavigationService.prototype, \"columnModel\", void 0);\n __decorate$Y([\n Autowired('rowModel')\n ], CellNavigationService.prototype, \"rowModel\", void 0);\n __decorate$Y([\n Autowired('rowRenderer')\n ], CellNavigationService.prototype, \"rowRenderer\", void 0);\n __decorate$Y([\n Autowired('pinnedRowModel')\n ], CellNavigationService.prototype, \"pinnedRowModel\", void 0);\n __decorate$Y([\n Autowired('paginationProxy')\n ], CellNavigationService.prototype, \"paginationProxy\", void 0);\n CellNavigationService = __decorate$Y([\n Bean('cellNavigationService')\n ], CellNavigationService);\n return CellNavigationService;\n}(BeanStub));\n\nvar __extends$V = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$X = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param$4 = ( false) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar AlignedGridsService = /** @class */ (function (_super) {\n __extends$V(AlignedGridsService, _super);\n function AlignedGridsService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n // flag to mark if we are consuming. to avoid cyclic events (ie other grid firing back to master\n // while processing a master event) we mark this if consuming an event, and if we are, then\n // we don't fire back any events.\n _this.consuming = false;\n return _this;\n }\n AlignedGridsService.prototype.setBeans = function (loggerFactory) {\n this.logger = loggerFactory.create('AlignedGridsService');\n };\n AlignedGridsService.prototype.getAlignedGridApis = function () {\n var _this = this;\n var _a;\n var alignedGrids = (_a = this.gridOptionsService.get('alignedGrids')) !== null && _a !== void 0 ? _a : [];\n var isCallbackConfig = typeof alignedGrids === 'function';\n if (typeof alignedGrids === 'function') {\n alignedGrids = alignedGrids();\n }\n var seeUrl = function () { return \"See \".concat(_this.getFrameworkOverrides().getDocLink('aligned-grids')); };\n var apis = alignedGrids.map(function (alignedGrid) {\n var _a;\n if (!alignedGrid) {\n errorOnce(\"alignedGrids contains an undefined option.\");\n if (!isCallbackConfig) {\n errorOnce(\"You may want to configure via a callback to avoid setup race conditions:\\n \\\"alignedGrids: () => [linkedGrid]\\\"\");\n }\n errorOnce(seeUrl());\n return;\n }\n if (alignedGrid instanceof GridApi) {\n return alignedGrid;\n }\n // Extract the GridApi from a ref or component\n var refOrComp = alignedGrid;\n if ('current' in refOrComp) {\n return (_a = refOrComp.current) === null || _a === void 0 ? void 0 : _a.api;\n }\n else {\n if (!refOrComp.api) {\n errorOnce(\"alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. \".concat(seeUrl()));\n }\n return refOrComp.api;\n }\n }).filter(function (api) { return !!api && !api.isDestroyed(); });\n return apis;\n };\n AlignedGridsService.prototype.init = function () {\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_MOVED, this.fireColumnEvent.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VISIBLE, this.fireColumnEvent.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PINNED, this.fireColumnEvent.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_GROUP_OPENED, this.fireColumnEvent.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_RESIZED, this.fireColumnEvent.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_BODY_SCROLL, this.fireScrollEvent.bind(this));\n };\n // common logic across all the fire methods\n AlignedGridsService.prototype.fireEvent = function (callback) {\n // if we are already consuming, then we are acting on an event from a master,\n // so we don't cause a cyclic firing of events\n if (this.consuming) {\n return;\n }\n // iterate through the aligned grids, and pass each aligned grid service to the callback\n this.getAlignedGridApis().forEach(function (api) {\n var alignedGridService = api.__getAlignedGridService();\n callback(alignedGridService);\n });\n };\n // common logic across all consume methods. very little common logic, however extracting\n // guarantees consistency across the methods.\n AlignedGridsService.prototype.onEvent = function (callback) {\n this.consuming = true;\n callback();\n this.consuming = false;\n };\n AlignedGridsService.prototype.fireColumnEvent = function (event) {\n this.fireEvent(function (alignedGridsService) {\n alignedGridsService.onColumnEvent(event);\n });\n };\n AlignedGridsService.prototype.fireScrollEvent = function (event) {\n if (event.direction !== 'horizontal') {\n return;\n }\n this.fireEvent(function (alignedGridsService) {\n alignedGridsService.onScrollEvent(event);\n });\n };\n AlignedGridsService.prototype.onScrollEvent = function (event) {\n var _this = this;\n this.onEvent(function () {\n var gridBodyCon = _this.ctrlsService.getGridBodyCtrl();\n gridBodyCon.getScrollFeature().setHorizontalScrollPosition(event.left, true);\n });\n };\n AlignedGridsService.prototype.getMasterColumns = function (event) {\n var result = [];\n if (event.columns) {\n event.columns.forEach(function (column) {\n result.push(column);\n });\n }\n else if (event.column) {\n result.push(event.column);\n }\n return result;\n };\n AlignedGridsService.prototype.getColumnIds = function (event) {\n var result = [];\n if (event.columns) {\n event.columns.forEach(function (column) {\n result.push(column.getColId());\n });\n }\n else if (event.column) {\n result.push(event.column.getColId());\n }\n return result;\n };\n AlignedGridsService.prototype.onColumnEvent = function (event) {\n var _this = this;\n this.onEvent(function () {\n switch (event.type) {\n case Events.EVENT_COLUMN_MOVED:\n case Events.EVENT_COLUMN_VISIBLE:\n case Events.EVENT_COLUMN_PINNED:\n case Events.EVENT_COLUMN_RESIZED:\n var colEvent = event;\n _this.processColumnEvent(colEvent);\n break;\n case Events.EVENT_COLUMN_GROUP_OPENED:\n var groupOpenedEvent = event;\n _this.processGroupOpenedEvent(groupOpenedEvent);\n break;\n case Events.EVENT_COLUMN_PIVOT_CHANGED:\n // we cannot support pivoting with aligned grids as the columns will be out of sync as the\n // grids will have columns created based on the row data of the grid.\n console.warn('AG Grid: pivoting is not supported with aligned grids. ' +\n 'You can only use one of these features at a time in a grid.');\n break;\n }\n });\n };\n AlignedGridsService.prototype.processGroupOpenedEvent = function (groupOpenedEvent) {\n var _this = this;\n groupOpenedEvent.columnGroups.forEach(function (masterGroup) {\n // likewise for column group\n var otherColumnGroup = null;\n if (masterGroup) {\n var groupId = masterGroup.getGroupId();\n otherColumnGroup = _this.columnModel.getProvidedColumnGroup(groupId);\n }\n if (masterGroup && !otherColumnGroup) {\n return;\n }\n _this.logger.log('onColumnEvent-> processing ' + groupOpenedEvent + ' expanded = ' + masterGroup.isExpanded());\n _this.columnModel.setColumnGroupOpened(otherColumnGroup, masterGroup.isExpanded(), \"alignedGridChanged\");\n });\n };\n AlignedGridsService.prototype.processColumnEvent = function (colEvent) {\n var _this = this;\n var _a;\n // the column in the event is from the master grid. need to\n // look up the equivalent from this (other) grid\n var masterColumn = colEvent.column;\n var otherColumn = null;\n if (masterColumn) {\n otherColumn = this.columnModel.getPrimaryColumn(masterColumn.getColId());\n }\n // if event was with respect to a master column, that is not present in this\n // grid, then we ignore the event\n if (masterColumn && !otherColumn) {\n return;\n }\n // in time, all the methods below should use the column ids, it's a more generic way\n // of handling columns, and also allows for single or multi column events\n var masterColumns = this.getMasterColumns(colEvent);\n switch (colEvent.type) {\n case Events.EVENT_COLUMN_MOVED:\n // when the user moves columns via applyColumnState, we can't depend on moving specific columns\n // to an index, as there maybe be many indexes columns moved to (as wasn't result of a mouse drag).\n // so only way to be sure is match the order of all columns using Column State.\n {\n var movedEvent = colEvent;\n var srcColState = colEvent.api.getColumnState();\n var destColState = srcColState.map(function (s) { return ({ colId: s.colId }); });\n this.columnModel.applyColumnState({ state: destColState, applyOrder: true }, \"alignedGridChanged\");\n this.logger.log(\"onColumnEvent-> processing \".concat(colEvent.type, \" toIndex = \").concat(movedEvent.toIndex));\n }\n break;\n case Events.EVENT_COLUMN_VISIBLE:\n // when the user changes visibility via applyColumnState, we can't depend on visibility flag in event\n // as there maybe be mix of true/false (as wasn't result of a mouse click to set visiblity).\n // so only way to be sure is match the visibility of all columns using Column State.\n {\n var visibleEvent = colEvent;\n var srcColState = colEvent.api.getColumnState();\n var destColState = srcColState.map(function (s) { return ({ colId: s.colId, hide: s.hide }); });\n this.columnModel.applyColumnState({ state: destColState }, \"alignedGridChanged\");\n this.logger.log(\"onColumnEvent-> processing \".concat(colEvent.type, \" visible = \").concat(visibleEvent.visible));\n }\n break;\n case Events.EVENT_COLUMN_PINNED:\n {\n var pinnedEvent = colEvent;\n var srcColState = colEvent.api.getColumnState();\n var destColState = srcColState.map(function (s) { return ({ colId: s.colId, pinned: s.pinned }); });\n this.columnModel.applyColumnState({ state: destColState }, \"alignedGridChanged\");\n this.logger.log(\"onColumnEvent-> processing \".concat(colEvent.type, \" pinned = \").concat(pinnedEvent.pinned));\n }\n break;\n case Events.EVENT_COLUMN_RESIZED:\n var resizedEvent = colEvent;\n var columnWidths_1 = {};\n masterColumns.forEach(function (column) {\n _this.logger.log(\"onColumnEvent-> processing \".concat(colEvent.type, \" actualWidth = \").concat(column.getActualWidth()));\n columnWidths_1[column.getId()] = { key: column.getColId(), newWidth: column.getActualWidth() };\n });\n // don't set flex columns width\n (_a = resizedEvent.flexColumns) === null || _a === void 0 ? void 0 : _a.forEach(function (col) {\n if (columnWidths_1[col.getId()]) {\n delete columnWidths_1[col.getId()];\n }\n });\n this.columnModel.setColumnWidths(Object.values(columnWidths_1), false, resizedEvent.finished, \"alignedGridChanged\");\n break;\n }\n var gridBodyCon = this.ctrlsService.getGridBodyCtrl();\n var isVerticalScrollShowing = gridBodyCon.isVerticalScrollShowing();\n this.getAlignedGridApis().forEach(function (api) {\n api.setGridOption('alwaysShowVerticalScroll', isVerticalScrollShowing);\n });\n };\n __decorate$X([\n Autowired('columnModel')\n ], AlignedGridsService.prototype, \"columnModel\", void 0);\n __decorate$X([\n Autowired('ctrlsService')\n ], AlignedGridsService.prototype, \"ctrlsService\", void 0);\n __decorate$X([\n __param$4(0, Qualifier('loggerFactory'))\n ], AlignedGridsService.prototype, \"setBeans\", null);\n __decorate$X([\n PostConstruct\n ], AlignedGridsService.prototype, \"init\", null);\n AlignedGridsService = __decorate$X([\n Bean('alignedGridsService')\n ], AlignedGridsService);\n return AlignedGridsService;\n}(BeanStub));\n\nvar __extends$U = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$W = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SelectionService = /** @class */ (function (_super) {\n __extends$U(SelectionService, _super);\n function SelectionService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.selectedNodes = new Map();\n _this.lastRowNode = null;\n return _this;\n }\n SelectionService.prototype.init = function () {\n var _this = this;\n this.rowSelection = this.gridOptionsService.get('rowSelection');\n this.groupSelectsChildren = this.gridOptionsService.get('groupSelectsChildren');\n this.addManagedPropertyListeners(['groupSelectsChildren', 'rowSelection'], function () {\n _this.groupSelectsChildren = _this.gridOptionsService.get('groupSelectsChildren');\n _this.rowSelection = _this.gridOptionsService.get('rowSelection');\n _this.deselectAllRowNodes({ source: 'api' });\n });\n this.addManagedListener(this.eventService, Events.EVENT_ROW_SELECTED, this.onRowSelected.bind(this));\n };\n SelectionService.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.resetNodes();\n this.lastRowNode = null;\n };\n SelectionService.prototype.isMultiselect = function () {\n return this.rowSelection === 'multiple';\n };\n SelectionService.prototype.setNodesSelected = function (params) {\n var _a;\n var newValue = params.newValue, clearSelection = params.clearSelection, suppressFinishActions = params.suppressFinishActions, rangeSelect = params.rangeSelect, nodes = params.nodes, event = params.event, _b = params.source, source = _b === void 0 ? 'api' : _b;\n if (nodes.length === 0)\n return 0;\n if (nodes.length > 1 && !this.isMultiselect()) {\n console.warn(\"AG Grid: cannot multi select while rowSelection='single'\");\n return 0;\n }\n // groupSelectsFiltered only makes sense when group selects children\n var groupSelectsFiltered = this.groupSelectsChildren && (params.groupSelectsFiltered === true);\n // if node is a footer, we don't do selection, just pass the info\n // to the sibling (the parent of the group)\n var filteredNodes = nodes.map(function (node) { return node.footer ? node.sibling : node; });\n if (rangeSelect) {\n if (nodes.length > 1) {\n console.warn('AG Grid: cannot range select while selecting multiple rows');\n return 0;\n }\n var toNode = null;\n if (source === 'checkboxSelected' && newValue === false && this.lastRowNode) {\n if (this.lastRowNode.id) {\n toNode = this.lastRowNode;\n }\n else {\n this.lastRowNode = null;\n }\n }\n if (toNode == null) {\n toNode = this.getLastSelectedNode();\n }\n if (toNode) {\n // if node is a footer, we don't do selection, just pass the info\n // to the sibling (the parent of the group)\n var fromNode = filteredNodes[0];\n var newRowClicked = fromNode !== toNode;\n if (newRowClicked && this.isMultiselect()) {\n return this.selectRange(fromNode, toNode, newValue, source);\n }\n }\n }\n // when deselecting nodes, we want to use the last deselected node\n // as starting point for deselection\n this.lastRowNode = newValue ? null : filteredNodes[0];\n var updatedCount = 0;\n for (var i = 0; i < filteredNodes.length; i++) {\n var node = filteredNodes[i];\n // when groupSelectsFiltered, then this node may end up intermediate despite\n // trying to set it to true / false. this group will be calculated further on\n // down when we call calculatedSelectedForAllGroupNodes(). we need to skip it\n // here, otherwise the updatedCount would include it.\n var skipThisNode = groupSelectsFiltered && node.group;\n if (!skipThisNode) {\n var thisNodeWasSelected = node.selectThisNode(newValue, event, source);\n if (thisNodeWasSelected) {\n updatedCount++;\n }\n }\n if (this.groupSelectsChildren && ((_a = node.childrenAfterGroup) === null || _a === void 0 ? void 0 : _a.length)) {\n updatedCount += this.selectChildren(node, newValue, groupSelectsFiltered, source);\n }\n }\n // clear other nodes if not doing multi select\n if (!suppressFinishActions) {\n var clearOtherNodes = newValue && (clearSelection || !this.isMultiselect());\n if (clearOtherNodes) {\n updatedCount += this.clearOtherNodes(filteredNodes[0], source);\n }\n // only if we selected something, then update groups and fire events\n if (updatedCount > 0) {\n this.updateGroupsFromChildrenSelections(source);\n // this is the very end of the 'action node', so we are finished all the updates,\n // include any parent / child changes that this method caused\n var event_1 = {\n type: Events.EVENT_SELECTION_CHANGED,\n source: source\n };\n this.eventService.dispatchEvent(event_1);\n }\n }\n return updatedCount;\n };\n // selects all rows between this node and the last selected node (or the top if this is the first selection).\n // not to be mixed up with 'cell range selection' where you drag the mouse, this is row range selection, by\n // holding down 'shift'.\n SelectionService.prototype.selectRange = function (fromNode, toNode, value, source) {\n var _this = this;\n if (value === void 0) { value = true; }\n var nodesToSelect = this.rowModel.getNodesInRangeForSelection(fromNode, toNode);\n var updatedCount = 0;\n nodesToSelect.forEach(function (rowNode) {\n if (rowNode.group && _this.groupSelectsChildren) {\n return;\n }\n var nodeWasSelected = rowNode.selectThisNode(value, undefined, source);\n if (nodeWasSelected) {\n updatedCount++;\n }\n });\n this.updateGroupsFromChildrenSelections(source);\n var event = {\n type: Events.EVENT_SELECTION_CHANGED,\n source: source\n };\n this.eventService.dispatchEvent(event);\n return updatedCount;\n };\n SelectionService.prototype.selectChildren = function (node, newValue, groupSelectsFiltered, source) {\n var children = groupSelectsFiltered ? node.childrenAfterAggFilter : node.childrenAfterGroup;\n if (missing(children)) {\n return 0;\n }\n return this.setNodesSelected({\n newValue: newValue,\n clearSelection: false,\n suppressFinishActions: true,\n groupSelectsFiltered: groupSelectsFiltered,\n source: source,\n nodes: children,\n });\n };\n SelectionService.prototype.getLastSelectedNode = function () {\n var selectedKeys = Array.from(this.selectedNodes.keys());\n if (selectedKeys.length == 0) {\n return null;\n }\n var node = this.selectedNodes.get(last(selectedKeys));\n if (node) {\n return node;\n }\n return null;\n };\n SelectionService.prototype.getSelectedNodes = function () {\n var selectedNodes = [];\n this.selectedNodes.forEach(function (rowNode) {\n if (rowNode) {\n selectedNodes.push(rowNode);\n }\n });\n return selectedNodes;\n };\n SelectionService.prototype.getSelectedRows = function () {\n var selectedRows = [];\n this.selectedNodes.forEach(function (rowNode) {\n if (rowNode && rowNode.data) {\n selectedRows.push(rowNode.data);\n }\n });\n return selectedRows;\n };\n SelectionService.prototype.getSelectionCount = function () {\n return this.selectedNodes.size;\n };\n /**\n * This method is used by the CSRM to remove groups which are being disposed of,\n * events do not need fired in this case\n */\n SelectionService.prototype.filterFromSelection = function (predicate) {\n var newSelectedNodes = new Map();\n this.selectedNodes.forEach(function (rowNode, key) {\n var passesPredicate = rowNode && predicate(rowNode);\n if (passesPredicate) {\n newSelectedNodes.set(key, rowNode);\n }\n });\n this.selectedNodes = newSelectedNodes;\n };\n // should only be called if groupSelectsChildren=true\n SelectionService.prototype.updateGroupsFromChildrenSelections = function (source, changedPath) {\n // we only do this when group selection state depends on selected children\n if (!this.groupSelectsChildren) {\n return false;\n }\n // also only do it if CSRM (code should never allow this anyway)\n if (this.rowModel.getType() !== 'clientSide') {\n return false;\n }\n var clientSideRowModel = this.rowModel;\n var rootNode = clientSideRowModel.getRootNode();\n if (!changedPath) {\n changedPath = new ChangedPath(true, rootNode);\n changedPath.setInactive();\n }\n var selectionChanged = false;\n changedPath.forEachChangedNodeDepthFirst(function (rowNode) {\n if (rowNode !== rootNode) {\n var selected = rowNode.calculateSelectedFromChildren();\n selectionChanged = rowNode.selectThisNode(selected === null ? false : selected, undefined, source) || selectionChanged;\n }\n });\n return selectionChanged;\n };\n SelectionService.prototype.clearOtherNodes = function (rowNodeToKeepSelected, source) {\n var _this = this;\n var groupsToRefresh = new Map();\n var updatedCount = 0;\n this.selectedNodes.forEach(function (otherRowNode) {\n if (otherRowNode && otherRowNode.id !== rowNodeToKeepSelected.id) {\n var rowNode = _this.selectedNodes.get(otherRowNode.id);\n updatedCount += rowNode.setSelectedParams({\n newValue: false,\n clearSelection: false,\n suppressFinishActions: true,\n source: source,\n });\n if (_this.groupSelectsChildren && otherRowNode.parent) {\n groupsToRefresh.set(otherRowNode.parent.id, otherRowNode.parent);\n }\n }\n });\n groupsToRefresh.forEach(function (group) {\n var selected = group.calculateSelectedFromChildren();\n group.selectThisNode(selected === null ? false : selected, undefined, source);\n });\n return updatedCount;\n };\n SelectionService.prototype.onRowSelected = function (event) {\n var rowNode = event.node;\n // we do not store the group rows when the groups select children\n if (this.groupSelectsChildren && rowNode.group) {\n return;\n }\n if (rowNode.isSelected()) {\n this.selectedNodes.set(rowNode.id, rowNode);\n }\n else {\n this.selectedNodes.delete(rowNode.id);\n }\n };\n SelectionService.prototype.syncInRowNode = function (rowNode, oldNode) {\n this.syncInOldRowNode(rowNode, oldNode);\n this.syncInNewRowNode(rowNode);\n };\n // if the id has changed for the node, then this means the rowNode\n // is getting used for a different data item, which breaks\n // our selectedNodes, as the node now is mapped by the old id\n // which is inconsistent. so to keep the old node as selected,\n // we swap in the clone (with the old id and old data). this means\n // the oldNode is effectively a daemon we keep a reference to,\n // so if client calls api.getSelectedNodes(), it gets the daemon\n // in the result. when the client un-selects, the reference to the\n // daemon is removed. the daemon, because it's an oldNode, is not\n // used by the grid for rendering, it's a copy of what the node used\n // to be like before the id was changed.\n SelectionService.prototype.syncInOldRowNode = function (rowNode, oldNode) {\n var oldNodeHasDifferentId = exists(oldNode) && (rowNode.id !== oldNode.id);\n if (oldNodeHasDifferentId && oldNode) {\n var id = oldNode.id;\n var oldNodeSelected = this.selectedNodes.get(id) == rowNode;\n if (oldNodeSelected) {\n this.selectedNodes.set(oldNode.id, oldNode);\n }\n }\n };\n SelectionService.prototype.syncInNewRowNode = function (rowNode) {\n if (this.selectedNodes.has(rowNode.id)) {\n rowNode.setSelectedInitialValue(true);\n this.selectedNodes.set(rowNode.id, rowNode);\n }\n else {\n rowNode.setSelectedInitialValue(false);\n }\n };\n SelectionService.prototype.reset = function (source) {\n var selectionCount = this.getSelectionCount();\n this.resetNodes();\n if (selectionCount) {\n var event_2 = {\n type: Events.EVENT_SELECTION_CHANGED,\n source: source\n };\n this.eventService.dispatchEvent(event_2);\n }\n };\n SelectionService.prototype.resetNodes = function () {\n var _a;\n (_a = this.selectedNodes) === null || _a === void 0 ? void 0 : _a.clear();\n };\n // returns a list of all nodes at 'best cost' - a feature to be used\n // with groups / trees. if a group has all it's children selected,\n // then the group appears in the result, but not the children.\n // Designed for use with 'children' as the group selection type,\n // where groups don't actually appear in the selection normally.\n SelectionService.prototype.getBestCostNodeSelection = function () {\n if (this.rowModel.getType() !== 'clientSide') {\n // Error logged as part of gridApi as that is only call point for this method.\n return;\n }\n var clientSideRowModel = this.rowModel;\n var topLevelNodes = clientSideRowModel.getTopLevelNodes();\n if (topLevelNodes === null) {\n return;\n }\n var result = [];\n // recursive function, to find the selected nodes\n function traverse(nodes) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n var node = nodes[i];\n if (node.isSelected()) {\n result.push(node);\n }\n else {\n // if not selected, then if it's a group, and the group\n // has children, continue to search for selections\n var maybeGroup = node;\n if (maybeGroup.group && maybeGroup.children) {\n traverse(maybeGroup.children);\n }\n }\n }\n }\n traverse(topLevelNodes);\n return result;\n };\n SelectionService.prototype.isEmpty = function () {\n var count = 0;\n this.selectedNodes.forEach(function (rowNode) {\n if (rowNode) {\n count++;\n }\n });\n return count === 0;\n };\n SelectionService.prototype.deselectAllRowNodes = function (params) {\n var callback = function (rowNode) { return rowNode.selectThisNode(false, undefined, source); };\n var rowModelClientSide = this.rowModel.getType() === 'clientSide';\n var source = params.source, justFiltered = params.justFiltered, justCurrentPage = params.justCurrentPage;\n if (justCurrentPage || justFiltered) {\n if (!rowModelClientSide) {\n console.error(\"AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'\");\n return;\n }\n this.getNodesToSelect(justFiltered, justCurrentPage).forEach(callback);\n }\n else {\n this.selectedNodes.forEach(function (rowNode) {\n // remember the reference can be to null, as we never 'delete' from the map\n if (rowNode) {\n callback(rowNode);\n }\n });\n // this clears down the map (whereas above only sets the items in map to 'undefined')\n this.reset(source);\n }\n // the above does not clean up the parent rows if they are selected\n if (rowModelClientSide && this.groupSelectsChildren) {\n this.updateGroupsFromChildrenSelections(source);\n }\n var event = {\n type: Events.EVENT_SELECTION_CHANGED,\n source: source\n };\n this.eventService.dispatchEvent(event);\n };\n SelectionService.prototype.getSelectedCounts = function (justFiltered, justCurrentPage) {\n var _this = this;\n var selectedCount = 0;\n var notSelectedCount = 0;\n var callback = function (node) {\n if (_this.groupSelectsChildren && node.group) {\n return;\n }\n if (node.isSelected()) {\n selectedCount++;\n }\n else if (!node.selectable) ;\n else {\n notSelectedCount++;\n }\n };\n this.getNodesToSelect(justFiltered, justCurrentPage).forEach(callback);\n return { selectedCount: selectedCount, notSelectedCount: notSelectedCount };\n };\n SelectionService.prototype.getSelectAllState = function (justFiltered, justCurrentPage) {\n var _a = this.getSelectedCounts(justFiltered, justCurrentPage), selectedCount = _a.selectedCount, notSelectedCount = _a.notSelectedCount;\n // if no rows, always have it unselected\n if (selectedCount === 0 && notSelectedCount === 0) {\n return false;\n }\n // if mix of selected and unselected, this is indeterminate\n if (selectedCount > 0 && notSelectedCount > 0) {\n return null;\n }\n // only selected\n return selectedCount > 0;\n };\n SelectionService.prototype.hasNodesToSelect = function (justFiltered, justCurrentPage) {\n if (justFiltered === void 0) { justFiltered = false; }\n if (justCurrentPage === void 0) { justCurrentPage = false; }\n return this.getNodesToSelect(justFiltered, justCurrentPage).filter(function (node) { return node.selectable; }).length > 0;\n };\n /**\n * @param justFiltered whether to just include nodes which have passed the filter\n * @param justCurrentPage whether to just include nodes on the current page\n * @returns all nodes including unselectable nodes which are the target of this selection attempt\n */\n SelectionService.prototype.getNodesToSelect = function (justFiltered, justCurrentPage) {\n var _this = this;\n if (justFiltered === void 0) { justFiltered = false; }\n if (justCurrentPage === void 0) { justCurrentPage = false; }\n if (this.rowModel.getType() !== 'clientSide') {\n throw new Error(\"selectAll only available when rowModelType='clientSide', ie not \".concat(this.rowModel.getType()));\n }\n var nodes = [];\n if (justCurrentPage) {\n this.paginationProxy.forEachNodeOnPage(function (node) {\n if (!node.group) {\n nodes.push(node);\n return;\n }\n if (!node.expanded) {\n // even with groupSelectsChildren, do this recursively as only the filtered children\n // are considered as the current page\n var recursivelyAddChildren_1 = function (child) {\n var _a;\n nodes.push(child);\n if ((_a = child.childrenAfterFilter) === null || _a === void 0 ? void 0 : _a.length) {\n child.childrenAfterFilter.forEach(recursivelyAddChildren_1);\n }\n };\n recursivelyAddChildren_1(node);\n return;\n }\n // if the group node is expanded, the pagination proxy will include the visible nodes to select\n if (!_this.groupSelectsChildren) {\n nodes.push(node);\n }\n });\n return nodes;\n }\n var clientSideRowModel = this.rowModel;\n if (justFiltered) {\n clientSideRowModel.forEachNodeAfterFilter(function (node) {\n nodes.push(node);\n });\n return nodes;\n }\n clientSideRowModel.forEachNode(function (node) {\n nodes.push(node);\n });\n return nodes;\n };\n SelectionService.prototype.selectAllRowNodes = function (params) {\n if (this.rowModel.getType() !== 'clientSide') {\n throw new Error(\"selectAll only available when rowModelType='clientSide', ie not \".concat(this.rowModel.getType()));\n }\n var source = params.source, justFiltered = params.justFiltered, justCurrentPage = params.justCurrentPage;\n var callback = function (rowNode) { return rowNode.selectThisNode(true, undefined, source); };\n this.getNodesToSelect(justFiltered, justCurrentPage).forEach(callback);\n // the above does not clean up the parent rows if they are selected\n if (this.rowModel.getType() === 'clientSide' && this.groupSelectsChildren) {\n this.updateGroupsFromChildrenSelections(source);\n }\n var event = {\n type: Events.EVENT_SELECTION_CHANGED,\n source: source\n };\n this.eventService.dispatchEvent(event);\n };\n SelectionService.prototype.getSelectionState = function () {\n var selectedIds = [];\n this.selectedNodes.forEach(function (node) {\n if (node === null || node === void 0 ? void 0 : node.id) {\n selectedIds.push(node.id);\n }\n });\n return selectedIds.length ? selectedIds : null;\n };\n SelectionService.prototype.setSelectionState = function (state, source) {\n if (!Array.isArray(state)) {\n return;\n }\n var rowIds = new Set(state);\n var nodes = [];\n this.rowModel.forEachNode(function (node) {\n if (rowIds.has(node.id)) {\n nodes.push(node);\n }\n });\n this.setNodesSelected({\n newValue: true,\n nodes: nodes,\n source: source\n });\n };\n __decorate$W([\n Autowired('rowModel')\n ], SelectionService.prototype, \"rowModel\", void 0);\n __decorate$W([\n Autowired('paginationProxy')\n ], SelectionService.prototype, \"paginationProxy\", void 0);\n __decorate$W([\n PostConstruct\n ], SelectionService.prototype, \"init\", null);\n SelectionService = __decorate$W([\n Bean('selectionService')\n ], SelectionService);\n return SelectionService;\n}(BeanStub));\n\nvar __decorate$V = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$e = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$c = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n/** @deprecated Use methods via the grid api instead. */\nvar ColumnApi = /** @class */ (function () {\n function ColumnApi(gridAp) {\n var _this = this;\n this.viaApi = function (funcName) {\n var _a;\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n warnOnce(\"Since v31, 'columnApi.\".concat(funcName, \"' is deprecated and moved to 'api.\").concat(funcName, \"'.\"));\n return (_a = _this.api)[funcName].apply(_a, __spreadArray$c([], __read$e(args), false));\n };\n this.api = gridAp;\n }\n /** @deprecated v31 use `api.sizeColumnsToFit()` instead. */\n ColumnApi.prototype.sizeColumnsToFit = function (gridWidth) { this.viaApi('sizeColumnsToFit', gridWidth); };\n /** @deprecated v31 use `api.setColumnGroupOpened() instead. */\n ColumnApi.prototype.setColumnGroupOpened = function (group, newValue) { this.viaApi('setColumnGroupOpened', group, newValue); };\n /** @deprecated v31 use `api.getColumnGroup() instead. */\n ColumnApi.prototype.getColumnGroup = function (name, instanceId) { return this.viaApi('getColumnGroup', name, instanceId); };\n /** @deprecated v31 use `api.getProvidedColumnGroup() instead. */\n ColumnApi.prototype.getProvidedColumnGroup = function (name) { return this.viaApi('getProvidedColumnGroup', name); };\n /** @deprecated v31 use `api.getDisplayNameForColumn() instead. */\n ColumnApi.prototype.getDisplayNameForColumn = function (column, location) { return this.viaApi('getDisplayNameForColumn', column, location); };\n /** @deprecated v31 use `api.getDisplayNameForColumnGroup() instead. */\n ColumnApi.prototype.getDisplayNameForColumnGroup = function (columnGroup, location) { return this.viaApi('getDisplayNameForColumnGroup', columnGroup, location); };\n /** @deprecated v31 use `api.getColumn() instead. */\n ColumnApi.prototype.getColumn = function (key) { return this.viaApi('getColumn', key); };\n /** @deprecated v31 use `api.getColumns() instead. */\n ColumnApi.prototype.getColumns = function () { return this.viaApi('getColumns'); };\n /** @deprecated v31 use `api.applyColumnState() instead. */\n ColumnApi.prototype.applyColumnState = function (params) { return this.viaApi('applyColumnState', params); };\n /** @deprecated v31 use `api.getColumnState() instead. */\n ColumnApi.prototype.getColumnState = function () { return this.viaApi('getColumnState'); };\n /** @deprecated v31 use `api.resetColumnState() instead. */\n ColumnApi.prototype.resetColumnState = function () { this.viaApi('resetColumnState'); };\n /** @deprecated v31 use `api.getColumnGroupState() instead. */\n ColumnApi.prototype.getColumnGroupState = function () { return this.viaApi('getColumnGroupState'); };\n /** @deprecated v31 use `api.setColumnGroupState() instead. */\n ColumnApi.prototype.setColumnGroupState = function (stateItems) { this.viaApi('setColumnGroupState', stateItems); };\n /** @deprecated v31 use `api.resetColumnGroupState() instead. */\n ColumnApi.prototype.resetColumnGroupState = function () { this.viaApi('resetColumnGroupState'); };\n /** @deprecated v31 use `api.isPinning() instead. */\n ColumnApi.prototype.isPinning = function () { return this.viaApi('isPinning'); };\n /** @deprecated v31 use `api.isPinningLeft() instead. */\n ColumnApi.prototype.isPinningLeft = function () { return this.viaApi('isPinningLeft'); };\n /** @deprecated v31 use `api.isPinningRight() instead. */\n ColumnApi.prototype.isPinningRight = function () { return this.viaApi('isPinningRight'); };\n /** @deprecated v31 use `api.getDisplayedColAfter() instead. */\n ColumnApi.prototype.getDisplayedColAfter = function (col) { return this.viaApi('getDisplayedColAfter', col); };\n /** @deprecated v31 use `api.getDisplayedColBefore() instead. */\n ColumnApi.prototype.getDisplayedColBefore = function (col) { return this.viaApi('getDisplayedColBefore', col); };\n /** @deprecated v31 use `api.setColumnVisible() instead. */\n ColumnApi.prototype.setColumnVisible = function (key, visible) { this.viaApi('setColumnVisible', key, visible); };\n /** @deprecated v31 use `api.setColumnsVisible() instead. */\n ColumnApi.prototype.setColumnsVisible = function (keys, visible) { this.viaApi('setColumnsVisible', keys, visible); };\n /** @deprecated v31 use `api.setColumnPinned() instead. */\n ColumnApi.prototype.setColumnPinned = function (key, pinned) { this.viaApi('setColumnPinned', key, pinned); };\n /** @deprecated v31 use `api.setColumnsPinned() instead. */\n ColumnApi.prototype.setColumnsPinned = function (keys, pinned) { this.viaApi('setColumnsPinned', keys, pinned); };\n /** @deprecated v31 use `api.getAllGridColumns() instead. */\n ColumnApi.prototype.getAllGridColumns = function () { return this.viaApi('getAllGridColumns'); };\n /** @deprecated v31 use `api.getDisplayedLeftColumns() instead. */\n ColumnApi.prototype.getDisplayedLeftColumns = function () { return this.viaApi('getDisplayedLeftColumns'); };\n /** @deprecated v31 use `api.getDisplayedCenterColumns() instead. */\n ColumnApi.prototype.getDisplayedCenterColumns = function () { return this.viaApi('getDisplayedCenterColumns'); };\n /** @deprecated v31 use `api.getDisplayedRightColumns() instead. */\n ColumnApi.prototype.getDisplayedRightColumns = function () { return this.viaApi('getDisplayedRightColumns'); };\n /** @deprecated v31 use `api.getAllDisplayedColumns() instead. */\n ColumnApi.prototype.getAllDisplayedColumns = function () { return this.viaApi('getAllDisplayedColumns'); };\n /** @deprecated v31 use `api.getAllDisplayedVirtualColumns() instead. */\n ColumnApi.prototype.getAllDisplayedVirtualColumns = function () { return this.viaApi('getAllDisplayedVirtualColumns'); };\n /** @deprecated v31 use `api.moveColumn() instead. */\n ColumnApi.prototype.moveColumn = function (key, toIndex) { this.viaApi('moveColumn', key, toIndex); };\n /** @deprecated v31 use `api.moveColumnByIndex() instead. */\n ColumnApi.prototype.moveColumnByIndex = function (fromIndex, toIndex) { this.viaApi('moveColumnByIndex', fromIndex, toIndex); };\n /** @deprecated v31 use `api.moveColumns() instead. */\n ColumnApi.prototype.moveColumns = function (columnsToMoveKeys, toIndex) { this.viaApi('moveColumns', columnsToMoveKeys, toIndex); };\n /** @deprecated v31 use `api.moveRowGroupColumn() instead. */\n ColumnApi.prototype.moveRowGroupColumn = function (fromIndex, toIndex) { this.viaApi('moveRowGroupColumn', fromIndex, toIndex); };\n /** @deprecated v31 use `api.setColumnAggFunc() instead. */\n ColumnApi.prototype.setColumnAggFunc = function (key, aggFunc) { this.viaApi('setColumnAggFunc', key, aggFunc); };\n /** @deprecated v31 use `api.setColumnWidth() instead. */\n ColumnApi.prototype.setColumnWidth = function (key, newWidth, finished, source) {\n if (finished === void 0) { finished = true; }\n this.viaApi('setColumnWidth', key, newWidth, finished, source);\n };\n /** @deprecated v31 use `api.setColumnWidths() instead. */\n ColumnApi.prototype.setColumnWidths = function (columnWidths, finished, source) {\n if (finished === void 0) { finished = true; }\n this.viaApi('setColumnWidths', columnWidths, finished, source);\n };\n /** @deprecated v31 use `api.setPivotMode() instead. */\n ColumnApi.prototype.setPivotMode = function (pivotMode) { this.viaApi('setPivotMode', pivotMode); };\n /** @deprecated v31 use `api.isPivotMode() instead. */\n ColumnApi.prototype.isPivotMode = function () { return this.viaApi('isPivotMode'); };\n /** @deprecated v31 use `api.getPivotResultColumn() instead. */\n ColumnApi.prototype.getPivotResultColumn = function (pivotKeys, valueColKey) { return this.viaApi('getPivotResultColumn', pivotKeys, valueColKey); };\n /** @deprecated v31 use `api.setValueColumns() instead. */\n ColumnApi.prototype.setValueColumns = function (colKeys) { this.viaApi('setValueColumns', colKeys); };\n /** @deprecated v31 use `api.getValueColumns() instead. */\n ColumnApi.prototype.getValueColumns = function () { return this.viaApi('getValueColumns'); };\n /** @deprecated v31 use `api.removeValueColumn() instead. */\n ColumnApi.prototype.removeValueColumn = function (colKey) { this.viaApi('removeValueColumn', colKey); };\n /** @deprecated v31 use `api.removeValueColumns() instead. */\n ColumnApi.prototype.removeValueColumns = function (colKeys) { this.viaApi('removeValueColumns', colKeys); };\n /** @deprecated v31 use `api.addValueColumn() instead. */\n ColumnApi.prototype.addValueColumn = function (colKey) { this.viaApi('addValueColumn', colKey); };\n /** @deprecated v31 use `api.addValueColumns() instead. */\n ColumnApi.prototype.addValueColumns = function (colKeys) { this.viaApi('addValueColumns', colKeys); };\n /** @deprecated v31 use `api.setRowGroupColumns() instead. */\n ColumnApi.prototype.setRowGroupColumns = function (colKeys) { this.viaApi('setRowGroupColumns', colKeys); };\n /** @deprecated v31 use `api.removeRowGroupColumn() instead. */\n ColumnApi.prototype.removeRowGroupColumn = function (colKey) { this.viaApi('removeRowGroupColumn', colKey); };\n /** @deprecated v31 use `api.removeRowGroupColumns() instead. */\n ColumnApi.prototype.removeRowGroupColumns = function (colKeys) { this.viaApi('removeRowGroupColumns', colKeys); };\n /** @deprecated v31 use `api.addRowGroupColumn() instead. */\n ColumnApi.prototype.addRowGroupColumn = function (colKey) { this.viaApi('addRowGroupColumn', colKey); };\n /** @deprecated v31 use `api.addRowGroupColumns() instead. */\n ColumnApi.prototype.addRowGroupColumns = function (colKeys) { this.viaApi('addRowGroupColumns', colKeys); };\n /** @deprecated v31 use `api.getRowGroupColumns() instead. */\n ColumnApi.prototype.getRowGroupColumns = function () { return this.viaApi('getRowGroupColumns'); };\n /** @deprecated v31 use `api.setPivotColumns() instead. */\n ColumnApi.prototype.setPivotColumns = function (colKeys) { this.viaApi('setPivotColumns', colKeys); };\n /** @deprecated v31 use `api.removePivotColumn() instead. */\n ColumnApi.prototype.removePivotColumn = function (colKey) { this.viaApi('removePivotColumn', colKey); };\n /** @deprecated v31 use `api.removePivotColumns() instead. */\n ColumnApi.prototype.removePivotColumns = function (colKeys) { this.viaApi('removePivotColumns', colKeys); };\n /** @deprecated v31 use `api.addPivotColumn() instead. */\n ColumnApi.prototype.addPivotColumn = function (colKey) { this.viaApi('addPivotColumn', colKey); };\n /** @deprecated v31 use `api.addPivotColumns() instead. */\n ColumnApi.prototype.addPivotColumns = function (colKeys) { this.viaApi('addPivotColumns', colKeys); };\n /** @deprecated v31 use `api.getPivotColumns() instead. */\n ColumnApi.prototype.getPivotColumns = function () { return this.viaApi('getPivotColumns'); };\n /** @deprecated v31 use `api.getLeftDisplayedColumnGroups() instead. */\n ColumnApi.prototype.getLeftDisplayedColumnGroups = function () { return this.viaApi('getLeftDisplayedColumnGroups'); };\n /** @deprecated v31 use `api.getCenterDisplayedColumnGroups() instead. */\n ColumnApi.prototype.getCenterDisplayedColumnGroups = function () { return this.viaApi('getCenterDisplayedColumnGroups'); };\n /** @deprecated v31 use `api.getRightDisplayedColumnGroups() instead. */\n ColumnApi.prototype.getRightDisplayedColumnGroups = function () { return this.viaApi('getRightDisplayedColumnGroups'); };\n /** @deprecated v31 use `api.getAllDisplayedColumnGroups() instead. */\n ColumnApi.prototype.getAllDisplayedColumnGroups = function () { return this.viaApi('getAllDisplayedColumnGroups'); };\n /** @deprecated v31 use `api.autoSizeColumn() instead. */\n ColumnApi.prototype.autoSizeColumn = function (key, skipHeader) { return this.viaApi('autoSizeColumn', key, skipHeader); };\n /** @deprecated v31 use `api.autoSizeColumns() instead. */\n ColumnApi.prototype.autoSizeColumns = function (keys, skipHeader) {\n this.viaApi('autoSizeColumns', keys, skipHeader);\n };\n /** @deprecated v31 use `api.autoSizeAllColumns() instead. */\n ColumnApi.prototype.autoSizeAllColumns = function (skipHeader) { this.viaApi('autoSizeAllColumns', skipHeader); };\n /** @deprecated v31 use `api.setPivotResultColumns() instead. */\n ColumnApi.prototype.setPivotResultColumns = function (colDefs) { this.viaApi('setPivotResultColumns', colDefs); };\n /** @deprecated v31 use `api.getPivotResultColumns() instead. */\n ColumnApi.prototype.getPivotResultColumns = function () { return this.viaApi('getPivotResultColumns'); };\n __decorate$V([\n Autowired('gridApi')\n ], ColumnApi.prototype, \"api\", void 0);\n ColumnApi = __decorate$V([\n Bean('columnApi')\n ], ColumnApi);\n return ColumnApi;\n}());\n\nvar __extends$T = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$U = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ValueService = /** @class */ (function (_super) {\n __extends$T(ValueService, _super);\n function ValueService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.initialised = false;\n _this.isSsrm = false;\n return _this;\n }\n ValueService.prototype.init = function () {\n var _this = this;\n this.isSsrm = this.gridOptionsService.isRowModelType('serverSide');\n this.cellExpressions = this.gridOptionsService.get('enableCellExpressions');\n this.isTreeData = this.gridOptionsService.get('treeData');\n this.initialised = true;\n // We listen to our own event and use it to call the columnSpecific callback,\n // this way the handler calls are correctly interleaved with other global events\n var listener = function (event) { return _this.callColumnCellValueChangedHandler(event); };\n var async = this.gridOptionsService.useAsyncEvents();\n this.eventService.addEventListener(Events.EVENT_CELL_VALUE_CHANGED, listener, async);\n this.addDestroyFunc(function () { return _this.eventService.removeEventListener(Events.EVENT_CELL_VALUE_CHANGED, listener, async); });\n this.addManagedPropertyListener('treeData', function (propChange) { return _this.isTreeData = propChange.currentValue; });\n };\n ValueService.prototype.getValue = function (column, rowNode, forFilter, ignoreAggData) {\n if (forFilter === void 0) { forFilter = false; }\n if (ignoreAggData === void 0) { ignoreAggData = false; }\n // hack - the grid is getting refreshed before this bean gets initialised, race condition.\n // really should have a way so they get initialised in the right order???\n if (!this.initialised) {\n this.init();\n }\n if (!rowNode) {\n return;\n }\n // pull these out to make code below easier to read\n var colDef = column.getColDef();\n var field = colDef.field;\n var colId = column.getColId();\n var data = rowNode.data;\n var result;\n // if there is a value getter, this gets precedence over a field\n var groupDataExists = rowNode.groupData && rowNode.groupData[colId] !== undefined;\n var aggDataExists = !ignoreAggData && rowNode.aggData && rowNode.aggData[colId] !== undefined;\n // SSRM agg data comes from the data attribute, so ignore that instead\n var ignoreSsrmAggData = this.isSsrm && ignoreAggData && !!column.getColDef().aggFunc;\n var ssrmFooterGroupCol = this.isSsrm && rowNode.footer && rowNode.field && (column.getColDef().showRowGroup === true || column.getColDef().showRowGroup === rowNode.field);\n if (forFilter && colDef.filterValueGetter) {\n result = this.executeFilterValueGetter(colDef.filterValueGetter, data, column, rowNode);\n }\n else if (this.isTreeData && aggDataExists) {\n result = rowNode.aggData[colId];\n }\n else if (this.isTreeData && colDef.valueGetter) {\n result = this.executeValueGetter(colDef.valueGetter, data, column, rowNode);\n }\n else if (this.isTreeData && (field && data)) {\n result = getValueUsingField(data, field, column.isFieldContainsDots());\n }\n else if (groupDataExists) {\n result = rowNode.groupData[colId];\n }\n else if (aggDataExists) {\n result = rowNode.aggData[colId];\n }\n else if (colDef.valueGetter) {\n result = this.executeValueGetter(colDef.valueGetter, data, column, rowNode);\n }\n else if (ssrmFooterGroupCol) {\n // this is for group footers in SSRM, as the SSRM row won't have groupData, need to extract\n // the group value from the data using the row field\n result = getValueUsingField(data, rowNode.field, column.isFieldContainsDots());\n }\n else if (field && data && !ignoreSsrmAggData) {\n result = getValueUsingField(data, field, column.isFieldContainsDots());\n }\n // the result could be an expression itself, if we are allowing cell values to be expressions\n if (this.cellExpressions && (typeof result === 'string') && result.indexOf('=') === 0) {\n var cellValueGetter = result.substring(1);\n result = this.executeValueGetter(cellValueGetter, data, column, rowNode);\n }\n if (result == null) {\n var openedGroup = this.getOpenedGroup(rowNode, column);\n if (openedGroup != null) {\n return openedGroup;\n }\n }\n return result;\n };\n ValueService.prototype.getOpenedGroup = function (rowNode, column) {\n if (!this.gridOptionsService.get('showOpenedGroup')) {\n return;\n }\n var colDef = column.getColDef();\n if (!colDef.showRowGroup) {\n return;\n }\n var showRowGroup = column.getColDef().showRowGroup;\n var pointer = rowNode.parent;\n while (pointer != null) {\n if (pointer.rowGroupColumn && (showRowGroup === true || showRowGroup === pointer.rowGroupColumn.getColId())) {\n return pointer.key;\n }\n pointer = pointer.parent;\n }\n return undefined;\n };\n /**\n * Sets the value of a GridCell\n * @param rowNode The `RowNode` to be updated\n * @param colKey The `Column` to be updated\n * @param newValue The new value to be set\n * @param eventSource The event source\n * @returns `True` if the value has been updated, otherwise`False`.\n */\n ValueService.prototype.setValue = function (rowNode, colKey, newValue, eventSource) {\n var column = this.columnModel.getPrimaryColumn(colKey);\n if (!rowNode || !column) {\n return false;\n }\n // this will only happen if user is trying to paste into a group row, which doesn't make sense\n // the user should not be trying to paste into group rows\n if (missing(rowNode.data)) {\n rowNode.data = {};\n }\n var _a = column.getColDef(), field = _a.field, valueSetter = _a.valueSetter;\n if (missing(field) && missing(valueSetter)) {\n console.warn(\"AG Grid: you need either field or valueSetter set on colDef for editing to work\");\n return false;\n }\n if (!this.dataTypeService.checkType(column, newValue)) {\n console.warn(\"AG Grid: Data type of the new value does not match the cell data type of the column\");\n return false;\n }\n var params = this.gridOptionsService.addGridCommonParams({\n node: rowNode,\n data: rowNode.data,\n oldValue: this.getValue(column, rowNode),\n newValue: newValue,\n colDef: column.getColDef(),\n column: column\n });\n params.newValue = newValue;\n var valueWasDifferent;\n if (exists(valueSetter)) {\n if (typeof valueSetter === 'function') {\n valueWasDifferent = valueSetter(params);\n }\n else {\n valueWasDifferent = this.expressionService.evaluate(valueSetter, params);\n }\n }\n else {\n valueWasDifferent = this.setValueUsingField(rowNode.data, field, newValue, column.isFieldContainsDots());\n }\n // in case user forgot to return something (possible if they are not using TypeScript\n // and just forgot we default the return value to true, so we always refresh.\n if (valueWasDifferent === undefined) {\n valueWasDifferent = true;\n }\n // if no change to the value, then no need to do the updating, or notifying via events.\n // otherwise the user could be tabbing around the grid, and cellValueChange would get called\n // all the time.\n if (!valueWasDifferent) {\n return false;\n }\n // reset quick filter on this row\n rowNode.resetQuickFilterAggregateText();\n this.valueCache.onDataChanged();\n params.newValue = this.getValue(column, rowNode);\n var event = {\n type: Events.EVENT_CELL_VALUE_CHANGED,\n event: null,\n rowIndex: rowNode.rowIndex,\n rowPinned: rowNode.rowPinned,\n column: params.column,\n api: params.api,\n columnApi: params.columnApi,\n colDef: params.colDef,\n context: params.context,\n data: rowNode.data,\n node: rowNode,\n oldValue: params.oldValue,\n newValue: params.newValue,\n value: params.newValue,\n source: eventSource\n };\n this.eventService.dispatchEvent(event);\n return true;\n };\n ValueService.prototype.callColumnCellValueChangedHandler = function (event) {\n var onCellValueChanged = event.colDef.onCellValueChanged;\n if (typeof onCellValueChanged === 'function') {\n this.getFrameworkOverrides().wrapOutgoing(function () {\n onCellValueChanged({\n node: event.node,\n data: event.data,\n oldValue: event.oldValue,\n newValue: event.newValue,\n colDef: event.colDef,\n column: event.column,\n api: event.api,\n columnApi: event.columnApi,\n context: event.context\n });\n });\n }\n };\n ValueService.prototype.setValueUsingField = function (data, field, newValue, isFieldContainsDots) {\n if (!field) {\n return false;\n }\n // if no '.', then it's not a deep value\n var valuesAreSame = false;\n if (!isFieldContainsDots) {\n valuesAreSame = data[field] === newValue;\n if (!valuesAreSame) {\n data[field] = newValue;\n }\n }\n else {\n // otherwise it is a deep value, so need to dig for it\n var fieldPieces = field.split('.');\n var currentObject = data;\n while (fieldPieces.length > 0 && currentObject) {\n var fieldPiece = fieldPieces.shift();\n if (fieldPieces.length === 0) {\n valuesAreSame = currentObject[fieldPiece] === newValue;\n if (!valuesAreSame) {\n currentObject[fieldPiece] = newValue;\n }\n }\n else {\n currentObject = currentObject[fieldPiece];\n }\n }\n }\n return !valuesAreSame;\n };\n ValueService.prototype.executeFilterValueGetter = function (valueGetter, data, column, rowNode) {\n var params = this.gridOptionsService.addGridCommonParams({\n data: data,\n node: rowNode,\n column: column,\n colDef: column.getColDef(),\n getValue: this.getValueCallback.bind(this, rowNode)\n });\n if (typeof valueGetter === 'function') {\n return valueGetter(params);\n }\n return this.expressionService.evaluate(valueGetter, params);\n };\n ValueService.prototype.executeValueGetter = function (valueGetter, data, column, rowNode) {\n var colId = column.getColId();\n // if inside the same turn, just return back the value we got last time\n var valueFromCache = this.valueCache.getValue(rowNode, colId);\n if (valueFromCache !== undefined) {\n return valueFromCache;\n }\n var params = this.gridOptionsService.addGridCommonParams({\n data: data,\n node: rowNode,\n column: column,\n colDef: column.getColDef(),\n getValue: this.getValueCallback.bind(this, rowNode)\n });\n var result;\n if (typeof valueGetter === 'function') {\n result = valueGetter(params);\n }\n else {\n result = this.expressionService.evaluate(valueGetter, params);\n }\n // if a turn is active, store the value in case the grid asks for it again\n this.valueCache.setValue(rowNode, colId, result);\n return result;\n };\n ValueService.prototype.getValueCallback = function (node, field) {\n var otherColumn = this.columnModel.getPrimaryColumn(field);\n if (otherColumn) {\n return this.getValue(otherColumn, node);\n }\n return null;\n };\n // used by row grouping and pivot, to get key for a row. col can be a pivot col or a row grouping col\n ValueService.prototype.getKeyForNode = function (col, rowNode) {\n var value = this.getValue(col, rowNode);\n var keyCreator = col.getColDef().keyCreator;\n var result = value;\n if (keyCreator) {\n var keyParams = this.gridOptionsService.addGridCommonParams({\n value: value,\n colDef: col.getColDef(),\n column: col,\n node: rowNode,\n data: rowNode.data\n });\n result = keyCreator(keyParams);\n }\n // if already a string, or missing, just return it\n if (typeof result === 'string' || result == null) {\n return result;\n }\n result = String(result);\n if (result === '[object Object]') {\n warnOnce('a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key');\n }\n return result;\n };\n __decorate$U([\n Autowired('expressionService')\n ], ValueService.prototype, \"expressionService\", void 0);\n __decorate$U([\n Autowired('columnModel')\n ], ValueService.prototype, \"columnModel\", void 0);\n __decorate$U([\n Autowired('valueCache')\n ], ValueService.prototype, \"valueCache\", void 0);\n __decorate$U([\n Autowired('dataTypeService')\n ], ValueService.prototype, \"dataTypeService\", void 0);\n __decorate$U([\n PostConstruct\n ], ValueService.prototype, \"init\", null);\n ValueService = __decorate$U([\n Bean('valueService')\n ], ValueService);\n return ValueService;\n}(BeanStub));\n\nvar __extends$S = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$T = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param$3 = ( false) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar ExpressionService = /** @class */ (function (_super) {\n __extends$S(ExpressionService, _super);\n function ExpressionService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.expressionToFunctionCache = {};\n return _this;\n }\n ExpressionService.prototype.setBeans = function (loggerFactory) {\n this.logger = loggerFactory.create('ExpressionService');\n };\n ExpressionService.prototype.evaluate = function (expression, params) {\n if (typeof expression === 'string') {\n // valueGetter is an expression, so execute the expression\n return this.evaluateExpression(expression, params);\n }\n else {\n console.error('AG Grid: value should be either a string or a function', expression);\n }\n };\n ExpressionService.prototype.evaluateExpression = function (expression, params) {\n try {\n var javaScriptFunction = this.createExpressionFunction(expression);\n // the params don't have all these values, rather we add every possible\n // value a params can have, which makes whatever is in the params available.\n var result = javaScriptFunction(params.value, params.context, params.oldValue, params.newValue, params.value, params.node, params.data, params.colDef, params.rowIndex, params.api, params.columnApi, params.getValue, params.column, params.columnGroup);\n return result;\n }\n catch (e) {\n // the expression failed, which can happen, as it's the client that\n // provides the expression. so print a nice message\n // tslint:disable-next-line\n console.log('Processing of the expression failed');\n // tslint:disable-next-line\n console.log('Expression = ' + expression);\n // tslint:disable-next-line\n console.log('Params =', params);\n // tslint:disable-next-line\n console.log('Exception = ' + e);\n return null;\n }\n };\n ExpressionService.prototype.createExpressionFunction = function (expression) {\n // check cache first\n if (this.expressionToFunctionCache[expression]) {\n return this.expressionToFunctionCache[expression];\n }\n // if not found in cache, return the function\n var functionBody = this.createFunctionBody(expression);\n var theFunction = new Function('x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup', functionBody);\n // store in cache\n this.expressionToFunctionCache[expression] = theFunction;\n return theFunction;\n };\n ExpressionService.prototype.createFunctionBody = function (expression) {\n // if the expression has the 'return' word in it, then use as is,\n // if not, then wrap it with return and ';' to make a function\n if (expression.indexOf('return') >= 0) {\n return expression;\n }\n else {\n return 'return ' + expression + ';';\n }\n };\n __decorate$T([\n __param$3(0, Qualifier('loggerFactory'))\n ], ExpressionService.prototype, \"setBeans\", null);\n ExpressionService = __decorate$T([\n Bean('expressionService')\n ], ExpressionService);\n return ExpressionService;\n}(BeanStub));\n\nvar __extends$R = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$S = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar TemplateService = /** @class */ (function (_super) {\n __extends$R(TemplateService, _super);\n function TemplateService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.templateCache = {};\n _this.waitingCallbacks = {};\n return _this;\n }\n // returns the template if it is loaded, or null if it is not loaded\n // but will call the callback when it is loaded\n TemplateService.prototype.getTemplate = function (url, callback) {\n var templateFromCache = this.templateCache[url];\n if (templateFromCache) {\n return templateFromCache;\n }\n var callbackList = this.waitingCallbacks[url];\n var that = this;\n if (!callbackList) {\n // first time this was called, so need a new list for callbacks\n callbackList = [];\n this.waitingCallbacks[url] = callbackList;\n // and also need to do the http request\n var client = new XMLHttpRequest();\n client.onload = function () {\n that.handleHttpResult(this, url);\n };\n client.open(\"GET\", url);\n client.send();\n }\n // add this callback\n if (callback) {\n callbackList.push(callback);\n }\n // caller needs to wait for template to load, so return null\n return null;\n };\n TemplateService.prototype.handleHttpResult = function (httpResult, url) {\n if (httpResult.status !== 200 || httpResult.response === null) {\n console.warn(\"AG Grid: Unable to get template error \".concat(httpResult.status, \" - \").concat(url));\n return;\n }\n // response success, so process it\n // in IE9 the response is in - responseText\n this.templateCache[url] = httpResult.response || httpResult.responseText;\n // inform all listeners that this is now in the cache\n var callbacks = this.waitingCallbacks[url];\n for (var i = 0; i < callbacks.length; i++) {\n var callback = callbacks[i];\n // we could pass the callback the response, however we know the client of this code\n // is the cell renderer, and it passes the 'cellRefresh' method in as the callback\n // which doesn't take any parameters.\n callback();\n }\n };\n TemplateService = __decorate$S([\n Bean('templateService')\n ], TemplateService);\n return TemplateService;\n}(BeanStub));\n\nvar __extends$Q = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$R = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param$2 = ( false) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar LoggerFactory = /** @class */ (function (_super) {\n __extends$Q(LoggerFactory, _super);\n function LoggerFactory() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n LoggerFactory.prototype.setBeans = function (gridOptionsService) {\n this.logging = gridOptionsService.get('debug');\n };\n LoggerFactory.prototype.create = function (name) {\n return new Logger(name, this.isLogging.bind(this));\n };\n LoggerFactory.prototype.isLogging = function () {\n return this.logging;\n };\n __decorate$R([\n __param$2(0, Qualifier('gridOptionsService'))\n ], LoggerFactory.prototype, \"setBeans\", null);\n LoggerFactory = __decorate$R([\n Bean('loggerFactory')\n ], LoggerFactory);\n return LoggerFactory;\n}(BeanStub));\nvar Logger = /** @class */ (function () {\n function Logger(name, isLoggingFunc) {\n this.name = name;\n this.isLoggingFunc = isLoggingFunc;\n }\n Logger.prototype.isLogging = function () {\n return this.isLoggingFunc();\n };\n Logger.prototype.log = function (message) {\n if (this.isLoggingFunc()) {\n // tslint:disable-next-line\n console.log('AG Grid.' + this.name + ': ' + message);\n }\n };\n return Logger;\n}());\n\nvar __extends$P = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$Q = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar GridCtrl = /** @class */ (function (_super) {\n __extends$P(GridCtrl, _super);\n function GridCtrl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n GridCtrl.prototype.setComp = function (view, eGridDiv, eGui) {\n var _this = this;\n this.view = view;\n this.eGridHostDiv = eGridDiv;\n this.eGui = eGui;\n this.eGui.setAttribute('grid-id', this.context.getGridId());\n // this drop target is just used to see if the drop event is inside the grid\n this.dragAndDropService.addDropTarget({\n getContainer: function () { return _this.eGui; },\n isInterestedIn: function (type) { return type === DragSourceType.HeaderCell || type === DragSourceType.ToolPanel; },\n getIconName: function () { return DragAndDropService.ICON_NOT_ALLOWED; },\n });\n this.mouseEventService.stampTopLevelGridCompWithGridInstance(eGridDiv);\n this.createManagedBean(new LayoutFeature(this.view));\n this.addRtlSupport();\n var unsubscribeFromResize = this.resizeObserverService.observeResize(this.eGridHostDiv, this.onGridSizeChanged.bind(this));\n this.addDestroyFunc(function () { return unsubscribeFromResize(); });\n this.ctrlsService.registerGridCtrl(this);\n };\n GridCtrl.prototype.isDetailGrid = function () {\n var _a;\n var el = this.focusService.findTabbableParent(this.getGui());\n return ((_a = el === null || el === void 0 ? void 0 : el.getAttribute('row-id')) === null || _a === void 0 ? void 0 : _a.startsWith('detail')) || false;\n };\n GridCtrl.prototype.showDropZones = function () {\n return ModuleRegistry.__isRegistered(ModuleNames.RowGroupingModule, this.context.getGridId());\n };\n GridCtrl.prototype.showSideBar = function () {\n return ModuleRegistry.__isRegistered(ModuleNames.SideBarModule, this.context.getGridId());\n };\n GridCtrl.prototype.showStatusBar = function () {\n return ModuleRegistry.__isRegistered(ModuleNames.StatusBarModule, this.context.getGridId());\n };\n GridCtrl.prototype.showWatermark = function () {\n return ModuleRegistry.__isRegistered(ModuleNames.EnterpriseCoreModule, this.context.getGridId());\n };\n GridCtrl.prototype.onGridSizeChanged = function () {\n var event = {\n type: Events.EVENT_GRID_SIZE_CHANGED,\n clientWidth: this.eGridHostDiv.clientWidth,\n clientHeight: this.eGridHostDiv.clientHeight\n };\n this.eventService.dispatchEvent(event);\n };\n GridCtrl.prototype.addRtlSupport = function () {\n var cssClass = this.gridOptionsService.get('enableRtl') ? 'ag-rtl' : 'ag-ltr';\n this.view.setRtlClass(cssClass);\n };\n GridCtrl.prototype.destroyGridUi = function () {\n this.view.destroyGridUi();\n };\n GridCtrl.prototype.getGui = function () {\n return this.eGui;\n };\n GridCtrl.prototype.setResizeCursor = function (on) {\n this.view.setCursor(on ? 'ew-resize' : null);\n };\n GridCtrl.prototype.disableUserSelect = function (on) {\n this.view.setUserSelect(on ? 'none' : null);\n };\n GridCtrl.prototype.focusNextInnerContainer = function (backwards) {\n var eDocument = this.gridOptionsService.getDocument();\n var focusableContainers = this.view.getFocusableContainers();\n var idxWithFocus = focusableContainers.findIndex(function (container) { return container.contains(eDocument.activeElement); });\n var nextIdx = idxWithFocus + (backwards ? -1 : 1);\n if (nextIdx <= 0 || nextIdx >= focusableContainers.length) {\n return false;\n }\n return this.focusService.focusInto(focusableContainers[nextIdx]);\n };\n GridCtrl.prototype.focusInnerElement = function (fromBottom) {\n var focusableContainers = this.view.getFocusableContainers();\n var allColumns = this.columnModel.getAllDisplayedColumns();\n if (fromBottom) {\n if (focusableContainers.length > 1) {\n return this.focusService.focusInto(last(focusableContainers), true);\n }\n var lastColumn = last(allColumns);\n if (this.focusService.focusGridView(lastColumn, true)) {\n return true;\n }\n }\n if (this.gridOptionsService.get('headerHeight') === 0 || this.gridOptionsService.get('suppressHeaderFocus')) {\n if (this.focusService.focusGridView(allColumns[0])) {\n return true;\n }\n for (var i = 1; i < focusableContainers.length; i++) {\n if (this.focusService.focusInto(focusableContainers[i])) {\n return true;\n }\n }\n return false;\n }\n return this.focusService.focusFirstHeader();\n };\n GridCtrl.prototype.forceFocusOutOfContainer = function (up) {\n if (up === void 0) { up = false; }\n this.view.forceFocusOutOfContainer(up);\n };\n __decorate$Q([\n Autowired('focusService')\n ], GridCtrl.prototype, \"focusService\", void 0);\n __decorate$Q([\n Autowired('resizeObserverService')\n ], GridCtrl.prototype, \"resizeObserverService\", void 0);\n __decorate$Q([\n Autowired('columnModel')\n ], GridCtrl.prototype, \"columnModel\", void 0);\n __decorate$Q([\n Autowired('ctrlsService')\n ], GridCtrl.prototype, \"ctrlsService\", void 0);\n __decorate$Q([\n Autowired('mouseEventService')\n ], GridCtrl.prototype, \"mouseEventService\", void 0);\n __decorate$Q([\n Autowired('dragAndDropService')\n ], GridCtrl.prototype, \"dragAndDropService\", void 0);\n return GridCtrl;\n}(BeanStub));\n\nvar __extends$O = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$P = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar GridComp = /** @class */ (function (_super) {\n __extends$O(GridComp, _super);\n function GridComp(eGridDiv) {\n var _this = _super.call(this) || this;\n _this.eGridDiv = eGridDiv;\n return _this;\n }\n GridComp.prototype.postConstruct = function () {\n var _this = this;\n this.logger = this.loggerFactory.create('GridComp');\n var compProxy = {\n destroyGridUi: function () { return _this.destroyBean(_this); },\n setRtlClass: function (cssClass) { return _this.addCssClass(cssClass); },\n forceFocusOutOfContainer: this.forceFocusOutOfContainer.bind(this),\n updateLayoutClasses: this.updateLayoutClasses.bind(this),\n getFocusableContainers: this.getFocusableContainers.bind(this),\n setUserSelect: function (value) {\n _this.getGui().style.userSelect = value != null ? value : '';\n _this.getGui().style.webkitUserSelect = value != null ? value : '';\n },\n setCursor: function (value) {\n _this.getGui().style.cursor = value != null ? value : '';\n }\n };\n this.ctrl = this.createManagedBean(new GridCtrl());\n var template = this.createTemplate();\n this.setTemplate(template);\n this.ctrl.setComp(compProxy, this.eGridDiv, this.getGui());\n this.insertGridIntoDom();\n this.initialiseTabGuard({\n // we want to override the default behaviour to do nothing for onTabKeyDown\n onTabKeyDown: function () { return undefined; },\n focusInnerElement: function (fromBottom) { return _this.ctrl.focusInnerElement(fromBottom); },\n forceFocusOutWhenTabGuardsAreEmpty: true\n });\n };\n GridComp.prototype.insertGridIntoDom = function () {\n var _this = this;\n var eGui = this.getGui();\n this.eGridDiv.appendChild(eGui);\n this.addDestroyFunc(function () {\n _this.eGridDiv.removeChild(eGui);\n _this.logger.log('Grid removed from DOM');\n });\n };\n GridComp.prototype.updateLayoutClasses = function (cssClass, params) {\n var eRootWrapperBodyClassList = this.eRootWrapperBody.classList;\n eRootWrapperBodyClassList.toggle(LayoutCssClasses.AUTO_HEIGHT, params.autoHeight);\n eRootWrapperBodyClassList.toggle(LayoutCssClasses.NORMAL, params.normal);\n eRootWrapperBodyClassList.toggle(LayoutCssClasses.PRINT, params.print);\n this.addOrRemoveCssClass(LayoutCssClasses.AUTO_HEIGHT, params.autoHeight);\n this.addOrRemoveCssClass(LayoutCssClasses.NORMAL, params.normal);\n this.addOrRemoveCssClass(LayoutCssClasses.PRINT, params.print);\n };\n GridComp.prototype.createTemplate = function () {\n var dropZones = this.ctrl.showDropZones() ? '' : '';\n var sideBar = this.ctrl.showSideBar() ? '' : '';\n var statusBar = this.ctrl.showStatusBar() ? '' : '';\n var watermark = this.ctrl.showWatermark() ? '' : '';\n var template = /* html */ \"
\\n \".concat(dropZones, \"\\n
\\n \\n \").concat(sideBar, \"\\n
\\n \").concat(statusBar, \"\\n \\n \").concat(watermark, \"\\n
\");\n return template;\n };\n GridComp.prototype.getFocusableElement = function () {\n return this.eRootWrapperBody;\n };\n GridComp.prototype.getFocusableContainers = function () {\n var focusableContainers = [\n this.gridBodyComp.getGui()\n ];\n if (this.sideBarComp) {\n focusableContainers.push(this.sideBarComp.getGui());\n }\n return focusableContainers.filter(function (el) { return isVisible(el); });\n };\n __decorate$P([\n Autowired('loggerFactory')\n ], GridComp.prototype, \"loggerFactory\", void 0);\n __decorate$P([\n RefSelector('gridBody')\n ], GridComp.prototype, \"gridBodyComp\", void 0);\n __decorate$P([\n RefSelector('sideBar')\n ], GridComp.prototype, \"sideBarComp\", void 0);\n __decorate$P([\n RefSelector('rootWrapperBody')\n ], GridComp.prototype, \"eRootWrapperBody\", void 0);\n __decorate$P([\n PostConstruct\n ], GridComp.prototype, \"postConstruct\", null);\n return GridComp;\n}(TabGuardComp));\n\nvar __extends$N = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$O = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$d = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$b = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar SortController = /** @class */ (function (_super) {\n __extends$N(SortController, _super);\n function SortController() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SortController_1 = SortController;\n SortController.prototype.progressSort = function (column, multiSort, source) {\n var nextDirection = this.getNextSortDirection(column);\n this.setSortForColumn(column, nextDirection, multiSort, source);\n };\n SortController.prototype.setSortForColumn = function (column, sort, multiSort, source) {\n // auto correct - if sort not legal value, then set it to 'no sort' (which is null)\n if (sort !== 'asc' && sort !== 'desc') {\n sort = null;\n }\n var isColumnsSortingCoupledToGroup = this.gridOptionsService.isColumnsSortingCoupledToGroup();\n var columnsToUpdate = [column];\n if (isColumnsSortingCoupledToGroup) {\n if (column.getColDef().showRowGroup) {\n var rowGroupColumns = this.columnModel.getSourceColumnsForGroupColumn(column);\n var sortableRowGroupColumns = rowGroupColumns === null || rowGroupColumns === void 0 ? void 0 : rowGroupColumns.filter(function (col) { return col.isSortable(); });\n if (sortableRowGroupColumns) {\n columnsToUpdate = __spreadArray$b([column], __read$d(sortableRowGroupColumns), false);\n }\n }\n }\n columnsToUpdate.forEach(function (col) { return col.setSort(sort, source); });\n var doingMultiSort = (multiSort || this.gridOptionsService.get('alwaysMultiSort')) && !this.gridOptionsService.get('suppressMultiSort');\n // clear sort on all columns except those changed, and update the icons\n var updatedColumns = [];\n if (!doingMultiSort) {\n var clearedColumns = this.clearSortBarTheseColumns(columnsToUpdate, source);\n updatedColumns.push.apply(updatedColumns, __spreadArray$b([], __read$d(clearedColumns), false));\n }\n // sortIndex used for knowing order of cols when multi-col sort\n this.updateSortIndex(column);\n updatedColumns.push.apply(updatedColumns, __spreadArray$b([], __read$d(columnsToUpdate), false));\n this.dispatchSortChangedEvents(source, updatedColumns);\n };\n SortController.prototype.updateSortIndex = function (lastColToChange) {\n var isCoupled = this.gridOptionsService.isColumnsSortingCoupledToGroup();\n var groupParent = this.columnModel.getGroupDisplayColumnForGroup(lastColToChange.getId());\n var lastSortIndexCol = isCoupled ? groupParent || lastColToChange : lastColToChange;\n var allSortedCols = this.getColumnsWithSortingOrdered();\n // reset sort index on everything\n this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(function (col) { return col.setSortIndex(null); });\n var allSortedColsWithoutChangesOrGroups = allSortedCols.filter(function (col) {\n if (isCoupled && col.getColDef().showRowGroup) {\n return false;\n }\n return col !== lastSortIndexCol;\n });\n var sortedColsWithIndices = !!lastSortIndexCol.getSort() ? __spreadArray$b(__spreadArray$b([], __read$d(allSortedColsWithoutChangesOrGroups), false), [lastSortIndexCol], false) : allSortedColsWithoutChangesOrGroups;\n sortedColsWithIndices.forEach(function (col, idx) {\n col.setSortIndex(idx);\n });\n };\n // gets called by API, so if data changes, use can call this, which will end up\n // working out the sort order again of the rows.\n SortController.prototype.onSortChanged = function (source, columns) {\n this.dispatchSortChangedEvents(source, columns);\n };\n SortController.prototype.isSortActive = function () {\n // pull out all the columns that have sorting set\n var allCols = this.columnModel.getPrimaryAndSecondaryAndAutoColumns();\n var sortedCols = allCols.filter(function (column) { return !!column.getSort(); });\n return sortedCols && sortedCols.length > 0;\n };\n SortController.prototype.dispatchSortChangedEvents = function (source, columns) {\n var event = {\n type: Events.EVENT_SORT_CHANGED,\n source: source\n };\n if (columns) {\n event.columns = columns;\n }\n this.eventService.dispatchEvent(event);\n };\n SortController.prototype.clearSortBarTheseColumns = function (columnsToSkip, source) {\n var clearedColumns = [];\n this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(function (columnToClear) {\n // Do not clear if either holding shift, or if column in question was clicked\n if (!columnsToSkip.includes(columnToClear)) {\n // add to list of cleared cols when sort direction is set\n if (!!columnToClear.getSort()) {\n clearedColumns.push(columnToClear);\n }\n // setting to 'undefined' as null means 'none' rather than cleared, otherwise issue will arise\n // if sort order is: ['desc', null , 'asc'], as it will start at null rather than 'desc'.\n columnToClear.setSort(undefined, source);\n }\n });\n return clearedColumns;\n };\n SortController.prototype.getNextSortDirection = function (column) {\n var sortingOrder;\n if (column.getColDef().sortingOrder) {\n sortingOrder = column.getColDef().sortingOrder;\n }\n else if (this.gridOptionsService.get('sortingOrder')) {\n sortingOrder = this.gridOptionsService.get('sortingOrder');\n }\n else {\n sortingOrder = SortController_1.DEFAULT_SORTING_ORDER;\n }\n if (!Array.isArray(sortingOrder) || sortingOrder.length <= 0) {\n console.warn(\"AG Grid: sortingOrder must be an array with at least one element, currently it's \".concat(sortingOrder));\n return null;\n }\n var currentIndex = sortingOrder.indexOf(column.getSort());\n var notInArray = currentIndex < 0;\n var lastItemInArray = currentIndex == sortingOrder.length - 1;\n var result;\n if (notInArray || lastItemInArray) {\n result = sortingOrder[0];\n }\n else {\n result = sortingOrder[currentIndex + 1];\n }\n // verify the sort type exists, as the user could provide the sortingOrder, need to make sure it's valid\n if (SortController_1.DEFAULT_SORTING_ORDER.indexOf(result) < 0) {\n console.warn('AG Grid: invalid sort type ' + result);\n return null;\n }\n return result;\n };\n /**\n * @returns a map of sort indexes for every sorted column, if groups sort primaries then they will have equivalent indices\n */\n SortController.prototype.getIndexedSortMap = function () {\n var _this = this;\n // pull out all the columns that have sorting set\n var allSortedCols = this.columnModel.getPrimaryAndSecondaryAndAutoColumns()\n .filter(function (col) { return !!col.getSort(); });\n if (this.columnModel.isPivotMode()) {\n var isSortingLinked_1 = this.gridOptionsService.isColumnsSortingCoupledToGroup();\n allSortedCols = allSortedCols.filter(function (col) {\n var isAggregated = !!col.getAggFunc();\n var isSecondary = !col.isPrimary();\n var isGroup = isSortingLinked_1 ? _this.columnModel.getGroupDisplayColumnForGroup(col.getId()) : col.getColDef().showRowGroup;\n return isAggregated || isSecondary || isGroup;\n });\n }\n var sortedRowGroupCols = this.columnModel.getRowGroupColumns()\n .filter(function (col) { return !!col.getSort(); });\n var isSortLinked = this.gridOptionsService.isColumnsSortingCoupledToGroup() && !!sortedRowGroupCols.length;\n if (isSortLinked) {\n allSortedCols = __spreadArray$b([], __read$d(new Set(\n // if linked sorting, replace all columns with the display group column for index purposes, and ensure uniqueness\n allSortedCols.map(function (col) { var _a; return (_a = _this.columnModel.getGroupDisplayColumnForGroup(col.getId())) !== null && _a !== void 0 ? _a : col; }))), false);\n }\n // when both cols are missing sortIndex, we use the position of the col in all cols list.\n // this means if colDefs only have sort, but no sortIndex, we deterministically pick which\n // cols is sorted by first.\n var allColsIndexes = {};\n allSortedCols.forEach(function (col, index) { return allColsIndexes[col.getId()] = index; });\n // put the columns in order of which one got sorted first\n allSortedCols.sort(function (a, b) {\n var iA = a.getSortIndex();\n var iB = b.getSortIndex();\n if (iA != null && iB != null) {\n return iA - iB; // both present, normal comparison\n }\n else if (iA == null && iB == null) {\n // both missing, compare using column positions\n var posA = allColsIndexes[a.getId()];\n var posB = allColsIndexes[b.getId()];\n return posA > posB ? 1 : -1;\n }\n else if (iB == null) {\n return -1; // iB missing\n }\n else {\n return 1; // iA missing\n }\n });\n var indexMap = new Map();\n allSortedCols.forEach(function (col, idx) { return indexMap.set(col, idx); });\n // add the row group cols back\n if (isSortLinked) {\n sortedRowGroupCols.forEach(function (col) {\n var groupDisplayCol = _this.columnModel.getGroupDisplayColumnForGroup(col.getId());\n indexMap.set(col, indexMap.get(groupDisplayCol));\n });\n }\n return indexMap;\n };\n SortController.prototype.getColumnsWithSortingOrdered = function () {\n // pull out all the columns that have sorting set\n return __spreadArray$b([], __read$d(this.getIndexedSortMap().entries()), false).sort(function (_a, _b) {\n var _c = __read$d(_a, 2); _c[0]; var idx1 = _c[1];\n var _d = __read$d(_b, 2); _d[0]; var idx2 = _d[1];\n return idx1 - idx2;\n })\n .map(function (_a) {\n var _b = __read$d(_a, 1), col = _b[0];\n return col;\n });\n };\n // used by server side row models, to sent sort to server\n SortController.prototype.getSortModel = function () {\n return this.getColumnsWithSortingOrdered()\n .filter(function (column) { return column.getSort(); })\n .map(function (column) { return ({\n sort: column.getSort(),\n colId: column.getId()\n }); });\n };\n SortController.prototype.getSortOptions = function () {\n return this.getColumnsWithSortingOrdered()\n .filter(function (column) { return column.getSort(); })\n .map(function (column) { return ({\n sort: column.getSort(),\n column: column\n }); });\n };\n SortController.prototype.canColumnDisplayMixedSort = function (column) {\n var isColumnSortCouplingActive = this.gridOptionsService.isColumnsSortingCoupledToGroup();\n var isGroupDisplayColumn = !!column.getColDef().showRowGroup;\n return isColumnSortCouplingActive && isGroupDisplayColumn;\n };\n SortController.prototype.getDisplaySortForColumn = function (column) {\n var linkedColumns = this.columnModel.getSourceColumnsForGroupColumn(column);\n if (!this.canColumnDisplayMixedSort(column) || !(linkedColumns === null || linkedColumns === void 0 ? void 0 : linkedColumns.length)) {\n return column.getSort();\n }\n // if column has unique data, its sorting is independent - but can still be mixed\n var columnHasUniqueData = column.getColDef().field != null || !!column.getColDef().valueGetter;\n var sortableColumns = columnHasUniqueData ? __spreadArray$b([column], __read$d(linkedColumns), false) : linkedColumns;\n var firstSort = sortableColumns[0].getSort();\n // the == is intentional, as null and undefined both represent no sort, which means they are equivalent\n var allMatch = sortableColumns.every(function (col) { return col.getSort() == firstSort; });\n if (!allMatch) {\n return 'mixed';\n }\n return firstSort;\n };\n SortController.prototype.getDisplaySortIndexForColumn = function (column) {\n return this.getIndexedSortMap().get(column);\n };\n var SortController_1;\n SortController.DEFAULT_SORTING_ORDER = ['asc', 'desc', null];\n __decorate$O([\n Autowired('columnModel')\n ], SortController.prototype, \"columnModel\", void 0);\n SortController = SortController_1 = __decorate$O([\n Bean('sortController')\n ], SortController);\n return SortController;\n}(BeanStub));\n\nvar __extends$M = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$5 = ( false) || function () {\n __assign$5 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$5.apply(this, arguments);\n};\nvar __decorate$N = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar FocusService = /** @class */ (function (_super) {\n __extends$M(FocusService, _super);\n function FocusService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FocusService_1 = FocusService;\n FocusService.addKeyboardModeEvents = function (doc) {\n if (this.instanceCount > 0) {\n return;\n }\n doc.addEventListener('keydown', FocusService_1.toggleKeyboardMode);\n doc.addEventListener('mousedown', FocusService_1.toggleKeyboardMode);\n };\n FocusService.removeKeyboardModeEvents = function (doc) {\n if (this.instanceCount > 0)\n return;\n doc.addEventListener('keydown', FocusService_1.toggleKeyboardMode);\n doc.addEventListener('mousedown', FocusService_1.toggleKeyboardMode);\n };\n FocusService.toggleKeyboardMode = function (event) {\n var isKeyboardActive = FocusService_1.keyboardModeActive;\n var isKeyboardEvent = event.type === 'keydown';\n if (isKeyboardEvent) {\n // the following keys should not toggle keyboard mode.\n if (event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n }\n if (isKeyboardActive === isKeyboardEvent) {\n return;\n }\n FocusService_1.keyboardModeActive = isKeyboardEvent;\n };\n FocusService.unregisterGridCompController = function (doc) {\n FocusService_1.removeKeyboardModeEvents(doc);\n };\n FocusService.prototype.init = function () {\n var _this = this;\n var clearFocusedCellListener = this.clearFocusedCell.bind(this);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, clearFocusedCellListener);\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.onColumnEverythingChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_GROUP_OPENED, clearFocusedCellListener);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, clearFocusedCellListener);\n this.registerKeyboardFocusEvents();\n this.ctrlsService.whenReady(function (p) {\n _this.gridCtrl = p.gridCtrl;\n });\n };\n FocusService.prototype.registerKeyboardFocusEvents = function () {\n var eDocument = this.gridOptionsService.getDocument();\n FocusService_1.addKeyboardModeEvents(eDocument);\n FocusService_1.instanceCount++;\n this.addDestroyFunc(function () {\n FocusService_1.instanceCount--;\n FocusService_1.unregisterGridCompController(eDocument);\n });\n };\n FocusService.prototype.onColumnEverythingChanged = function () {\n // if the columns change, check and see if this column still exists. if it does, then\n // we can keep the focused cell. if it doesn't, then we need to drop the focused cell.\n if (!this.focusedCellPosition) {\n return;\n }\n var col = this.focusedCellPosition.column;\n var colFromColumnModel = this.columnModel.getGridColumn(col.getId());\n if (col !== colFromColumnModel) {\n this.clearFocusedCell();\n }\n };\n FocusService.prototype.isKeyboardMode = function () {\n return FocusService_1.keyboardModeActive;\n };\n // we check if the browser is focusing something, and if it is, and\n // it's the cell we think is focused, then return the cell. so this\n // methods returns the cell if a) we think it has focus and b) the\n // browser thinks it has focus. this then returns nothing if we\n // first focus a cell, then second click outside the grid, as then the\n // grid cell will still be focused as far as the grid is concerned,\n // however the browser focus will have moved somewhere else.\n FocusService.prototype.getFocusCellToUseAfterRefresh = function () {\n var eDocument = this.gridOptionsService.getDocument();\n if (this.gridOptionsService.get('suppressFocusAfterRefresh') || !this.focusedCellPosition) {\n return null;\n }\n // we check that the browser is actually focusing on the grid, if it is not, then\n // we have nothing to worry about. we check for ROW data, as this covers both focused Rows (for Full Width Rows)\n // and Cells (covers cells as cells live in rows)\n if (this.isDomDataMissingInHierarchy(eDocument.activeElement, RowCtrl.DOM_DATA_KEY_ROW_CTRL)) {\n return null;\n }\n return this.focusedCellPosition;\n };\n FocusService.prototype.getFocusHeaderToUseAfterRefresh = function () {\n var eDocument = this.gridOptionsService.getDocument();\n if (this.gridOptionsService.get('suppressFocusAfterRefresh') || !this.focusedHeaderPosition) {\n return null;\n }\n // we check that the browser is actually focusing on the grid, if it is not, then\n // we have nothing to worry about\n if (this.isDomDataMissingInHierarchy(eDocument.activeElement, AbstractHeaderCellCtrl.DOM_DATA_KEY_HEADER_CTRL)) {\n return null;\n }\n return this.focusedHeaderPosition;\n };\n FocusService.prototype.isDomDataMissingInHierarchy = function (eBrowserCell, key) {\n var ePointer = eBrowserCell;\n while (ePointer) {\n var data = this.gridOptionsService.getDomData(ePointer, key);\n if (data) {\n return false;\n }\n ePointer = ePointer.parentNode;\n }\n return true;\n };\n FocusService.prototype.getFocusedCell = function () {\n return this.focusedCellPosition;\n };\n FocusService.prototype.shouldRestoreFocus = function (cell) {\n var _this = this;\n if (this.isCellRestoreFocused(cell)) {\n setTimeout(function () {\n // Clear the restore focused cell position after the timeout to avoid\n // the cell being focused again and stealing focus from another part of the app.\n _this.restoredFocusedCellPosition = null;\n }, 0);\n return true;\n }\n return false;\n };\n FocusService.prototype.isCellRestoreFocused = function (cellPosition) {\n if (this.restoredFocusedCellPosition == null) {\n return false;\n }\n return this.cellPositionUtils.equals(cellPosition, this.restoredFocusedCellPosition);\n };\n FocusService.prototype.setRestoreFocusedCell = function (cellPosition) {\n if (this.getFrameworkOverrides().renderingEngine === 'react') {\n // The restoredFocusedCellPosition is used in the React Rendering engine as we have to be able\n // to support restoring focus after an async rendering.\n this.restoredFocusedCellPosition = cellPosition;\n }\n };\n FocusService.prototype.getFocusEventParams = function () {\n var _a = this.focusedCellPosition, rowIndex = _a.rowIndex, rowPinned = _a.rowPinned, column = _a.column;\n var params = {\n rowIndex: rowIndex,\n rowPinned: rowPinned,\n column: column,\n isFullWidthCell: false\n };\n var rowCtrl = this.rowRenderer.getRowByPosition({ rowIndex: rowIndex, rowPinned: rowPinned });\n if (rowCtrl) {\n params.isFullWidthCell = rowCtrl.isFullWidth();\n }\n return params;\n };\n FocusService.prototype.clearFocusedCell = function () {\n this.restoredFocusedCellPosition = null;\n if (this.focusedCellPosition == null) {\n return;\n }\n var event = __assign$5({ type: Events.EVENT_CELL_FOCUS_CLEARED }, this.getFocusEventParams());\n this.focusedCellPosition = null;\n this.eventService.dispatchEvent(event);\n };\n FocusService.prototype.setFocusedCell = function (params) {\n var column = params.column, rowIndex = params.rowIndex, rowPinned = params.rowPinned, _a = params.forceBrowserFocus, forceBrowserFocus = _a === void 0 ? false : _a, _b = params.preventScrollOnBrowserFocus, preventScrollOnBrowserFocus = _b === void 0 ? false : _b;\n var gridColumn = this.columnModel.getGridColumn(column);\n // if column doesn't exist, then blank the focused cell and return. this can happen when user sets new columns,\n // and the focused cell is in a column that no longer exists. after columns change, the grid refreshes and tries\n // to re-focus the focused cell.\n if (!gridColumn) {\n this.focusedCellPosition = null;\n return;\n }\n this.focusedCellPosition = gridColumn ? {\n rowIndex: rowIndex,\n rowPinned: makeNull(rowPinned),\n column: gridColumn\n } : null;\n var event = __assign$5(__assign$5({ type: Events.EVENT_CELL_FOCUSED }, this.getFocusEventParams()), { forceBrowserFocus: forceBrowserFocus, preventScrollOnBrowserFocus: preventScrollOnBrowserFocus, floating: null });\n this.eventService.dispatchEvent(event);\n };\n FocusService.prototype.isCellFocused = function (cellPosition) {\n if (this.focusedCellPosition == null) {\n return false;\n }\n return this.cellPositionUtils.equals(cellPosition, this.focusedCellPosition);\n };\n FocusService.prototype.isRowNodeFocused = function (rowNode) {\n return this.isRowFocused(rowNode.rowIndex, rowNode.rowPinned);\n };\n FocusService.prototype.isHeaderWrapperFocused = function (headerCtrl) {\n if (this.focusedHeaderPosition == null) {\n return false;\n }\n var column = headerCtrl.getColumnGroupChild();\n var headerRowIndex = headerCtrl.getRowIndex();\n var pinned = headerCtrl.getPinned();\n var _a = this.focusedHeaderPosition, focusedColumn = _a.column, focusedHeaderRowIndex = _a.headerRowIndex;\n return column === focusedColumn &&\n headerRowIndex === focusedHeaderRowIndex &&\n pinned == focusedColumn.getPinned();\n };\n FocusService.prototype.clearFocusedHeader = function () {\n this.focusedHeaderPosition = null;\n };\n FocusService.prototype.getFocusedHeader = function () {\n return this.focusedHeaderPosition;\n };\n FocusService.prototype.setFocusedHeader = function (headerRowIndex, column) {\n this.focusedHeaderPosition = { headerRowIndex: headerRowIndex, column: column };\n };\n FocusService.prototype.focusHeaderPosition = function (params) {\n if (this.gridOptionsService.get('suppressHeaderFocus')) {\n return false;\n }\n var direction = params.direction, fromTab = params.fromTab, allowUserOverride = params.allowUserOverride, event = params.event, fromCell = params.fromCell, rowWithoutSpanValue = params.rowWithoutSpanValue;\n var headerPosition = params.headerPosition;\n if (fromCell && this.filterManager.isAdvancedFilterHeaderActive()) {\n return this.focusAdvancedFilter(headerPosition);\n }\n if (allowUserOverride) {\n var currentPosition = this.getFocusedHeader();\n var headerRowCount = this.headerNavigationService.getHeaderRowCount();\n if (fromTab) {\n var userFunc = this.gridOptionsService.getCallback('tabToNextHeader');\n if (userFunc) {\n var params_1 = {\n backwards: direction === 'Before',\n previousHeaderPosition: currentPosition,\n nextHeaderPosition: headerPosition,\n headerRowCount: headerRowCount,\n };\n headerPosition = userFunc(params_1);\n }\n }\n else {\n var userFunc = this.gridOptionsService.getCallback('navigateToNextHeader');\n if (userFunc && event) {\n var params_2 = {\n key: event.key,\n previousHeaderPosition: currentPosition,\n nextHeaderPosition: headerPosition,\n headerRowCount: headerRowCount,\n event: event,\n };\n headerPosition = userFunc(params_2);\n }\n }\n }\n if (!headerPosition) {\n return false;\n }\n if (headerPosition.headerRowIndex === -1) {\n if (this.filterManager.isAdvancedFilterHeaderActive()) {\n return this.focusAdvancedFilter(headerPosition);\n }\n return this.focusGridView(headerPosition.column);\n }\n this.headerNavigationService.scrollToColumn(headerPosition.column, direction);\n var headerRowContainerCtrl = this.ctrlsService.getHeaderRowContainerCtrl(headerPosition.column.getPinned());\n // this will automatically call the setFocusedHeader method above\n var focusSuccess = headerRowContainerCtrl.focusHeader(headerPosition.headerRowIndex, headerPosition.column, event);\n if (focusSuccess && (rowWithoutSpanValue != null || fromCell)) {\n this.headerNavigationService.setCurrentHeaderRowWithoutSpan(rowWithoutSpanValue !== null && rowWithoutSpanValue !== void 0 ? rowWithoutSpanValue : -1);\n }\n return focusSuccess;\n };\n FocusService.prototype.focusFirstHeader = function () {\n var firstColumn = this.columnModel.getAllDisplayedColumns()[0];\n if (!firstColumn) {\n return false;\n }\n if (firstColumn.getParent()) {\n firstColumn = this.columnModel.getColumnGroupAtLevel(firstColumn, 0);\n }\n var headerPosition = this.headerPositionUtils.getHeaderIndexToFocus(firstColumn, 0);\n return this.focusHeaderPosition({\n headerPosition: headerPosition,\n rowWithoutSpanValue: 0\n });\n };\n FocusService.prototype.focusLastHeader = function (event) {\n var headerRowIndex = this.headerNavigationService.getHeaderRowCount() - 1;\n var column = last(this.columnModel.getAllDisplayedColumns());\n return this.focusHeaderPosition({\n headerPosition: { headerRowIndex: headerRowIndex, column: column },\n rowWithoutSpanValue: -1,\n event: event\n });\n };\n FocusService.prototype.focusPreviousFromFirstCell = function (event) {\n if (this.filterManager.isAdvancedFilterHeaderActive()) {\n return this.focusAdvancedFilter(null);\n }\n return this.focusLastHeader(event);\n };\n FocusService.prototype.isAnyCellFocused = function () {\n return !!this.focusedCellPosition;\n };\n FocusService.prototype.isRowFocused = function (rowIndex, floating) {\n if (this.focusedCellPosition == null) {\n return false;\n }\n return this.focusedCellPosition.rowIndex === rowIndex && this.focusedCellPosition.rowPinned === makeNull(floating);\n };\n FocusService.prototype.findFocusableElements = function (rootNode, exclude, onlyUnmanaged) {\n if (onlyUnmanaged === void 0) { onlyUnmanaged = false; }\n var focusableString = FOCUSABLE_SELECTOR;\n var excludeString = FOCUSABLE_EXCLUDE;\n if (exclude) {\n excludeString += ', ' + exclude;\n }\n if (onlyUnmanaged) {\n excludeString += ', [tabindex=\"-1\"]';\n }\n var nodes = Array.prototype.slice.apply(rootNode.querySelectorAll(focusableString)).filter(function (node) {\n return isVisible(node);\n });\n var excludeNodes = Array.prototype.slice.apply(rootNode.querySelectorAll(excludeString));\n if (!excludeNodes.length) {\n return nodes;\n }\n var diff = function (a, b) { return a.filter(function (element) { return b.indexOf(element) === -1; }); };\n return diff(nodes, excludeNodes);\n };\n FocusService.prototype.focusInto = function (rootNode, up, onlyUnmanaged) {\n if (up === void 0) { up = false; }\n if (onlyUnmanaged === void 0) { onlyUnmanaged = false; }\n var focusableElements = this.findFocusableElements(rootNode, null, onlyUnmanaged);\n var toFocus = up ? last(focusableElements) : focusableElements[0];\n if (toFocus) {\n toFocus.focus({ preventScroll: true });\n return true;\n }\n return false;\n };\n FocusService.prototype.findFocusableElementBeforeTabGuard = function (rootNode, referenceElement) {\n if (!referenceElement) {\n return null;\n }\n var focusableElements = this.findFocusableElements(rootNode);\n var referenceIndex = focusableElements.indexOf(referenceElement);\n if (referenceIndex === -1) {\n return null;\n }\n var lastTabGuardIndex = -1;\n for (var i = referenceIndex - 1; i >= 0; i--) {\n if (focusableElements[i].classList.contains(TabGuardClassNames.TAB_GUARD_TOP)) {\n lastTabGuardIndex = i;\n break;\n }\n }\n if (lastTabGuardIndex <= 0) {\n return null;\n }\n return focusableElements[lastTabGuardIndex - 1];\n };\n FocusService.prototype.findNextFocusableElement = function (rootNode, onlyManaged, backwards) {\n if (rootNode === void 0) { rootNode = this.eGridDiv; }\n var focusable = this.findFocusableElements(rootNode, onlyManaged ? ':not([tabindex=\"-1\"])' : null);\n var eDocument = this.gridOptionsService.getDocument();\n var activeEl = eDocument.activeElement;\n var currentIndex;\n if (onlyManaged) {\n currentIndex = focusable.findIndex(function (el) { return el.contains(activeEl); });\n }\n else {\n currentIndex = focusable.indexOf(activeEl);\n }\n var nextIndex = currentIndex + (backwards ? -1 : 1);\n if (nextIndex < 0 || nextIndex >= focusable.length) {\n return null;\n }\n return focusable[nextIndex];\n };\n FocusService.prototype.isTargetUnderManagedComponent = function (rootNode, target) {\n if (!target) {\n return false;\n }\n var managedContainers = rootNode.querySelectorAll(\".\".concat(ManagedFocusFeature.FOCUS_MANAGED_CLASS));\n if (!managedContainers.length) {\n return false;\n }\n for (var i = 0; i < managedContainers.length; i++) {\n if (managedContainers[i].contains(target)) {\n return true;\n }\n }\n return false;\n };\n FocusService.prototype.findTabbableParent = function (node, limit) {\n if (limit === void 0) { limit = 5; }\n var counter = 0;\n while (node && getTabIndex(node) === null && ++counter <= limit) {\n node = node.parentElement;\n }\n if (getTabIndex(node) === null) {\n return null;\n }\n return node;\n };\n FocusService.prototype.focusGridView = function (column, backwards) {\n // if suppressCellFocus is `true`, it means the user does not want to\n // navigate between the cells using tab. Instead, we put focus on either\n // the header or after the grid, depending on whether tab or shift-tab was pressed.\n if (this.gridOptionsService.get('suppressCellFocus')) {\n if (backwards) {\n if (!this.gridOptionsService.get('suppressHeaderFocus')) {\n return this.focusLastHeader();\n }\n return this.focusNextGridCoreContainer(true, true);\n }\n return this.focusNextGridCoreContainer(false);\n }\n var nextRow = backwards\n ? this.rowPositionUtils.getLastRow()\n : this.rowPositionUtils.getFirstRow();\n if (!nextRow) {\n return false;\n }\n var rowIndex = nextRow.rowIndex, rowPinned = nextRow.rowPinned;\n var focusedHeader = this.getFocusedHeader();\n if (!column && focusedHeader) {\n column = focusedHeader.column;\n }\n if (rowIndex == null || !column) {\n return false;\n }\n this.navigationService.ensureCellVisible({ rowIndex: rowIndex, column: column, rowPinned: rowPinned });\n this.setFocusedCell({\n rowIndex: rowIndex,\n column: column,\n rowPinned: makeNull(rowPinned),\n forceBrowserFocus: true\n });\n if (this.rangeService) {\n var cellPosition = { rowIndex: rowIndex, rowPinned: rowPinned, column: column };\n this.rangeService.setRangeToCell(cellPosition);\n }\n return true;\n };\n FocusService.prototype.focusNextGridCoreContainer = function (backwards, forceOut) {\n if (forceOut === void 0) { forceOut = false; }\n if (!forceOut && this.gridCtrl.focusNextInnerContainer(backwards)) {\n return true;\n }\n if (forceOut || (!backwards && !this.gridCtrl.isDetailGrid())) {\n this.gridCtrl.forceFocusOutOfContainer(backwards);\n }\n return false;\n };\n FocusService.prototype.focusAdvancedFilter = function (position) {\n this.advancedFilterFocusColumn = position === null || position === void 0 ? void 0 : position.column;\n return this.advancedFilterService.getCtrl().focusHeaderComp();\n };\n FocusService.prototype.focusNextFromAdvancedFilter = function (backwards, forceFirstColumn) {\n var _a, _b;\n var column = (_a = (forceFirstColumn ? undefined : this.advancedFilterFocusColumn)) !== null && _a !== void 0 ? _a : (_b = this.columnModel.getAllDisplayedColumns()) === null || _b === void 0 ? void 0 : _b[0];\n if (backwards) {\n return this.focusHeaderPosition({\n headerPosition: {\n column: column,\n headerRowIndex: this.headerNavigationService.getHeaderRowCount() - 1\n }\n });\n }\n else {\n return this.focusGridView(column);\n }\n };\n FocusService.prototype.clearAdvancedFilterColumn = function () {\n this.advancedFilterFocusColumn = undefined;\n };\n var FocusService_1;\n FocusService.keyboardModeActive = false;\n FocusService.instanceCount = 0;\n __decorate$N([\n Autowired('eGridDiv')\n ], FocusService.prototype, \"eGridDiv\", void 0);\n __decorate$N([\n Autowired('columnModel')\n ], FocusService.prototype, \"columnModel\", void 0);\n __decorate$N([\n Autowired('headerNavigationService')\n ], FocusService.prototype, \"headerNavigationService\", void 0);\n __decorate$N([\n Autowired('headerPositionUtils')\n ], FocusService.prototype, \"headerPositionUtils\", void 0);\n __decorate$N([\n Autowired('rowRenderer')\n ], FocusService.prototype, \"rowRenderer\", void 0);\n __decorate$N([\n Autowired('rowPositionUtils')\n ], FocusService.prototype, \"rowPositionUtils\", void 0);\n __decorate$N([\n Autowired('cellPositionUtils')\n ], FocusService.prototype, \"cellPositionUtils\", void 0);\n __decorate$N([\n Optional('rangeService')\n ], FocusService.prototype, \"rangeService\", void 0);\n __decorate$N([\n Autowired('navigationService')\n ], FocusService.prototype, \"navigationService\", void 0);\n __decorate$N([\n Autowired('ctrlsService')\n ], FocusService.prototype, \"ctrlsService\", void 0);\n __decorate$N([\n Autowired('filterManager')\n ], FocusService.prototype, \"filterManager\", void 0);\n __decorate$N([\n Optional('advancedFilterService')\n ], FocusService.prototype, \"advancedFilterService\", void 0);\n __decorate$N([\n PostConstruct\n ], FocusService.prototype, \"init\", null);\n FocusService = FocusService_1 = __decorate$N([\n Bean('focusService')\n ], FocusService);\n return FocusService;\n}(BeanStub));\n\nvar __extends$L = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$M = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ColumnHoverService = /** @class */ (function (_super) {\n __extends$L(ColumnHoverService, _super);\n function ColumnHoverService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ColumnHoverService.prototype.setMouseOver = function (columns) {\n this.selectedColumns = columns;\n var event = {\n type: Events.EVENT_COLUMN_HOVER_CHANGED\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnHoverService.prototype.clearMouseOver = function () {\n this.selectedColumns = null;\n var event = {\n type: Events.EVENT_COLUMN_HOVER_CHANGED\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnHoverService.prototype.isHovered = function (column) {\n return !!this.selectedColumns && this.selectedColumns.indexOf(column) >= 0;\n };\n ColumnHoverService = __decorate$M([\n Bean('columnHoverService')\n ], ColumnHoverService);\n return ColumnHoverService;\n}(BeanStub));\n\nvar __extends$K = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$L = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ColumnAnimationService = /** @class */ (function (_super) {\n __extends$K(ColumnAnimationService, _super);\n function ColumnAnimationService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.executeNextFuncs = [];\n _this.executeLaterFuncs = [];\n _this.active = false;\n _this.suppressAnimation = false;\n _this.animationThreadCount = 0;\n return _this;\n }\n ColumnAnimationService.prototype.postConstruct = function () {\n var _this = this;\n this.ctrlsService.whenReady(function (p) { return _this.gridBodyCtrl = p.gridBodyCtrl; });\n };\n ColumnAnimationService.prototype.isActive = function () {\n return this.active && !this.suppressAnimation;\n };\n ColumnAnimationService.prototype.setSuppressAnimation = function (suppress) {\n this.suppressAnimation = suppress;\n };\n ColumnAnimationService.prototype.start = function () {\n if (this.active) {\n return;\n }\n if (this.gridOptionsService.get('suppressColumnMoveAnimation')) {\n return;\n }\n // if doing RTL, we don't animate open / close as due to how the pixels are inverted,\n // the animation moves all the row the the right rather than to the left (ie it's the static\n // columns that actually get their coordinates updated)\n if (this.gridOptionsService.get('enableRtl')) {\n return;\n }\n this.ensureAnimationCssClassPresent();\n this.active = true;\n };\n ColumnAnimationService.prototype.finish = function () {\n var _this = this;\n if (!this.active) {\n return;\n }\n this.flush(function () { _this.active = false; });\n };\n ColumnAnimationService.prototype.executeNextVMTurn = function (func) {\n if (this.active) {\n this.executeNextFuncs.push(func);\n }\n else {\n func();\n }\n };\n ColumnAnimationService.prototype.executeLaterVMTurn = function (func) {\n if (this.active) {\n this.executeLaterFuncs.push(func);\n }\n else {\n func();\n }\n };\n ColumnAnimationService.prototype.ensureAnimationCssClassPresent = function () {\n var _this = this;\n // up the count, so we can tell if someone else has updated the count\n // by the time the 'wait' func executes\n this.animationThreadCount++;\n var animationThreadCountCopy = this.animationThreadCount;\n this.gridBodyCtrl.setColumnMovingCss(true);\n this.executeLaterFuncs.push(function () {\n // only remove the class if this thread was the last one to update it\n if (_this.animationThreadCount === animationThreadCountCopy) {\n _this.gridBodyCtrl.setColumnMovingCss(false);\n }\n });\n };\n ColumnAnimationService.prototype.flush = function (callback) {\n var _this = this;\n if (this.executeNextFuncs.length === 0 && this.executeLaterFuncs.length === 0) {\n callback();\n return;\n }\n var runFuncs = function (queue) {\n while (queue.length) {\n var func = queue.pop();\n if (func) {\n func();\n }\n }\n };\n this.getFrameworkOverrides().wrapIncoming(function () {\n window.setTimeout(function () { return runFuncs(_this.executeNextFuncs); }, 0);\n window.setTimeout(function () {\n runFuncs(_this.executeLaterFuncs);\n callback();\n }, 200);\n });\n };\n __decorate$L([\n Autowired('ctrlsService')\n ], ColumnAnimationService.prototype, \"ctrlsService\", void 0);\n __decorate$L([\n PostConstruct\n ], ColumnAnimationService.prototype, \"postConstruct\", null);\n ColumnAnimationService = __decorate$L([\n Bean('columnAnimationService')\n ], ColumnAnimationService);\n return ColumnAnimationService;\n}(BeanStub));\n\nvar __extends$J = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$K = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar PaginationAutoPageSizeService = /** @class */ (function (_super) {\n __extends$J(PaginationAutoPageSizeService, _super);\n function PaginationAutoPageSizeService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PaginationAutoPageSizeService.prototype.postConstruct = function () {\n var _this = this;\n this.ctrlsService.whenReady(function (p) {\n _this.centerRowContainerCon = p.centerRowContainerCtrl;\n _this.addManagedListener(_this.eventService, Events.EVENT_BODY_HEIGHT_CHANGED, _this.checkPageSize.bind(_this));\n _this.addManagedListener(_this.eventService, Events.EVENT_SCROLL_VISIBILITY_CHANGED, _this.checkPageSize.bind(_this));\n _this.addManagedPropertyListener('paginationAutoPageSize', _this.onPaginationAutoSizeChanged.bind(_this));\n _this.checkPageSize();\n });\n };\n PaginationAutoPageSizeService.prototype.notActive = function () {\n return !this.gridOptionsService.get('paginationAutoPageSize') || this.centerRowContainerCon == null;\n };\n PaginationAutoPageSizeService.prototype.onPaginationAutoSizeChanged = function () {\n if (this.notActive()) {\n this.paginationProxy.unsetAutoCalculatedPageSize();\n }\n else {\n this.checkPageSize();\n }\n };\n PaginationAutoPageSizeService.prototype.checkPageSize = function () {\n var _this = this;\n if (this.notActive()) {\n return;\n }\n var bodyHeight = this.centerRowContainerCon.getViewportSizeFeature().getBodyHeight();\n if (bodyHeight > 0) {\n var update_1 = function () {\n var rowHeight = _this.gridOptionsService.getRowHeightAsNumber();\n var newPageSize = Math.floor(bodyHeight / rowHeight);\n _this.paginationProxy.setPageSize(newPageSize, 'autoCalculated');\n };\n if (!this.isBodyRendered) {\n update_1();\n this.isBodyRendered = true;\n }\n else {\n debounce(function () { return update_1(); }, 50)();\n }\n }\n else {\n this.isBodyRendered = false;\n }\n };\n __decorate$K([\n Autowired('ctrlsService')\n ], PaginationAutoPageSizeService.prototype, \"ctrlsService\", void 0);\n __decorate$K([\n Autowired('paginationProxy')\n ], PaginationAutoPageSizeService.prototype, \"paginationProxy\", void 0);\n __decorate$K([\n PostConstruct\n ], PaginationAutoPageSizeService.prototype, \"postConstruct\", null);\n PaginationAutoPageSizeService = __decorate$K([\n Bean('paginationAutoPageSizeService')\n ], PaginationAutoPageSizeService);\n return PaginationAutoPageSizeService;\n}(BeanStub));\n\nvar __extends$I = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$J = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ValueCache = /** @class */ (function (_super) {\n __extends$I(ValueCache, _super);\n function ValueCache() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.cacheVersion = 0;\n return _this;\n }\n ValueCache.prototype.init = function () {\n this.active = this.gridOptionsService.get('valueCache');\n this.neverExpires = this.gridOptionsService.get('valueCacheNeverExpires');\n };\n ValueCache.prototype.onDataChanged = function () {\n if (this.neverExpires) {\n return;\n }\n this.expire();\n };\n ValueCache.prototype.expire = function () {\n this.cacheVersion++;\n };\n ValueCache.prototype.setValue = function (rowNode, colId, value) {\n if (this.active) {\n if (rowNode.__cacheVersion !== this.cacheVersion) {\n rowNode.__cacheVersion = this.cacheVersion;\n rowNode.__cacheData = {};\n }\n rowNode.__cacheData[colId] = value;\n }\n };\n ValueCache.prototype.getValue = function (rowNode, colId) {\n if (!this.active || rowNode.__cacheVersion !== this.cacheVersion) {\n return undefined;\n }\n return rowNode.__cacheData[colId];\n };\n __decorate$J([\n PostConstruct\n ], ValueCache.prototype, \"init\", null);\n ValueCache = __decorate$J([\n Bean('valueCache')\n ], ValueCache);\n return ValueCache;\n}(BeanStub));\n\nvar __extends$H = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$I = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n// Matches value in clipboard module\nvar SOURCE_PASTE = 'paste';\nvar ChangeDetectionService = /** @class */ (function (_super) {\n __extends$H(ChangeDetectionService, _super);\n function ChangeDetectionService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ChangeDetectionService.prototype.init = function () {\n if (this.rowModel.getType() === 'clientSide') {\n this.clientSideRowModel = this.rowModel;\n }\n this.addManagedListener(this.eventService, Events.EVENT_CELL_VALUE_CHANGED, this.onCellValueChanged.bind(this));\n };\n ChangeDetectionService.prototype.onCellValueChanged = function (event) {\n // Clipboard service manages its own change detection, so no need to do it here.\n // The clipboard manages its own as otherwise this would happen once for every cell\n // that got updated as part of a paste operation, so e.g. if 100 cells in a paste operation,\n // this doChangeDetection would get called 100 times (once for each cell), instead clipboard\n // service executes the logic we have here once (in essence batching up all cell changes\n // into one change detection).\n if (event.source === SOURCE_PASTE) {\n return;\n }\n this.doChangeDetection(event.node, event.column);\n };\n ChangeDetectionService.prototype.doChangeDetection = function (rowNode, column) {\n if (this.gridOptionsService.get('suppressChangeDetection')) {\n return;\n }\n var nodesToRefresh = [rowNode];\n // step 1 of change detection is to update the aggregated values\n if (this.clientSideRowModel && !rowNode.isRowPinned()) {\n var onlyChangedColumns = this.gridOptionsService.get('aggregateOnlyChangedColumns');\n var changedPath = new ChangedPath(onlyChangedColumns, this.clientSideRowModel.getRootNode());\n changedPath.addParentNode(rowNode.parent, [column]);\n this.clientSideRowModel.doAggregate(changedPath);\n // add all nodes impacted by aggregation, as they need refreshed also.\n changedPath.forEachChangedNodeDepthFirst(function (rowNode) {\n nodesToRefresh.push(rowNode);\n });\n }\n // step 2 of change detection is to refresh the cells\n this.rowRenderer.refreshCells({ rowNodes: nodesToRefresh });\n };\n __decorate$I([\n Autowired('rowModel')\n ], ChangeDetectionService.prototype, \"rowModel\", void 0);\n __decorate$I([\n Autowired('rowRenderer')\n ], ChangeDetectionService.prototype, \"rowRenderer\", void 0);\n __decorate$I([\n PostConstruct\n ], ChangeDetectionService.prototype, \"init\", null);\n ChangeDetectionService = __decorate$I([\n Bean('changeDetectionService')\n ], ChangeDetectionService);\n return ChangeDetectionService;\n}(BeanStub));\n\nvar __extends$G = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$H = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AgComponentUtils = /** @class */ (function (_super) {\n __extends$G(AgComponentUtils, _super);\n function AgComponentUtils() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AgComponentUtils.prototype.adaptFunction = function (propertyName, jsCompFunc) {\n var metadata = this.componentMetadataProvider.retrieve(propertyName);\n if (metadata && metadata.functionAdapter) {\n return metadata.functionAdapter(jsCompFunc);\n }\n return null;\n };\n AgComponentUtils.prototype.adaptCellRendererFunction = function (callback) {\n var Adapter = /** @class */ (function () {\n function Adapter() {\n }\n Adapter.prototype.refresh = function (params) {\n return false;\n };\n Adapter.prototype.getGui = function () {\n return this.eGui;\n };\n Adapter.prototype.init = function (params) {\n var callbackResult = callback(params);\n var type = typeof callbackResult;\n if (type === 'string' || type === 'number' || type === 'boolean') {\n this.eGui = loadTemplate('' + callbackResult + '');\n return;\n }\n if (callbackResult == null) {\n this.eGui = loadTemplate('');\n return;\n }\n this.eGui = callbackResult;\n };\n return Adapter;\n }());\n return Adapter;\n };\n AgComponentUtils.prototype.doesImplementIComponent = function (candidate) {\n if (!candidate) {\n return false;\n }\n return candidate.prototype && 'getGui' in candidate.prototype;\n };\n __decorate$H([\n Autowired(\"componentMetadataProvider\")\n ], AgComponentUtils.prototype, \"componentMetadataProvider\", void 0);\n AgComponentUtils = __decorate$H([\n Bean(\"agComponentUtils\")\n ], AgComponentUtils);\n return AgComponentUtils;\n}(BeanStub));\n\nvar __extends$F = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$G = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ComponentMetadataProvider = /** @class */ (function (_super) {\n __extends$F(ComponentMetadataProvider, _super);\n function ComponentMetadataProvider() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ComponentMetadataProvider.prototype.postConstruct = function () {\n this.componentMetaData = {\n dateComponent: {\n mandatoryMethodList: ['getDate', 'setDate'],\n optionalMethodList: ['afterGuiAttached', 'setInputPlaceholder', 'setInputAriaLabel', 'setDisabled', 'onParamsUpdated', 'refresh']\n },\n detailCellRenderer: {\n mandatoryMethodList: [],\n optionalMethodList: ['refresh'],\n functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)\n },\n headerComponent: {\n mandatoryMethodList: [],\n optionalMethodList: ['refresh']\n },\n headerGroupComponent: {\n mandatoryMethodList: [],\n optionalMethodList: []\n },\n loadingCellRenderer: {\n mandatoryMethodList: [],\n optionalMethodList: []\n },\n loadingOverlayComponent: {\n mandatoryMethodList: [],\n optionalMethodList: ['refresh']\n },\n noRowsOverlayComponent: {\n mandatoryMethodList: [],\n optionalMethodList: ['refresh']\n },\n floatingFilterComponent: {\n mandatoryMethodList: ['onParentModelChanged'],\n optionalMethodList: ['afterGuiAttached', 'onParamsUpdated', 'refresh']\n },\n cellRenderer: {\n mandatoryMethodList: [],\n optionalMethodList: ['refresh', 'afterGuiAttached'],\n functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)\n },\n cellEditor: {\n mandatoryMethodList: ['getValue'],\n optionalMethodList: ['isPopup', 'isCancelBeforeStart', 'isCancelAfterEnd', 'getPopupPosition', 'focusIn', 'focusOut', 'afterGuiAttached', 'refresh']\n },\n innerRenderer: {\n mandatoryMethodList: [],\n optionalMethodList: ['afterGuiAttached'],\n functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)\n },\n fullWidthCellRenderer: {\n mandatoryMethodList: [],\n optionalMethodList: ['refresh', 'afterGuiAttached'],\n functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)\n },\n groupRowRenderer: {\n mandatoryMethodList: [],\n optionalMethodList: ['afterGuiAttached'],\n functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)\n },\n filter: {\n mandatoryMethodList: ['isFilterActive', 'doesFilterPass', 'getModel', 'setModel'],\n optionalMethodList: ['afterGuiAttached', 'afterGuiDetached', 'onNewRowsLoaded', 'getModelAsString', 'onFloatingFilterChanged', 'onAnyFilterChanged', 'refresh']\n },\n statusPanel: {\n mandatoryMethodList: [],\n optionalMethodList: ['refresh'],\n },\n toolPanel: {\n mandatoryMethodList: [],\n optionalMethodList: ['refresh', 'getState']\n },\n tooltipComponent: {\n mandatoryMethodList: [],\n optionalMethodList: []\n },\n menuItem: {\n mandatoryMethodList: [],\n optionalMethodList: ['setActive', 'select', 'setExpanded', 'configureDefaults']\n },\n };\n };\n ComponentMetadataProvider.prototype.retrieve = function (name) {\n return this.componentMetaData[name];\n };\n __decorate$G([\n Autowired(\"agComponentUtils\")\n ], ComponentMetadataProvider.prototype, \"agComponentUtils\", void 0);\n __decorate$G([\n PostConstruct\n ], ComponentMetadataProvider.prototype, \"postConstruct\", null);\n ComponentMetadataProvider = __decorate$G([\n Bean(\"componentMetadataProvider\")\n ], ComponentMetadataProvider);\n return ComponentMetadataProvider;\n}(BeanStub));\n\nvar __extends$E = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$F = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$c = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$a = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar DEFAULT_ROW_HEIGHT = 25;\nvar MIN_COL_WIDTH = 10;\nvar MAT_GRID_SIZE = 8;\nvar BASE_GRID_SIZE = 4;\nvar BALHAM_GRID_SIZE = 4;\nvar ALPINE_GRID_SIZE = 6;\nvar QUARTZ_ICON_SIZE = 16;\nvar QUARTZ_FONT_SIZE = 14;\nvar QUARTZ_GRID_SIZE = 8;\nvar HARD_CODED_SIZES = {\n // this item is required for custom themes\n 'ag-theme-custom': {\n headerHeight: 25,\n headerCellMinWidth: 24,\n listItemHeight: BASE_GRID_SIZE * 5,\n rowHeight: 25,\n chartMenuPanelWidth: 220\n },\n 'ag-theme-material': {\n headerHeight: MAT_GRID_SIZE * 7,\n headerCellMinWidth: 48,\n listItemHeight: MAT_GRID_SIZE * 4,\n rowHeight: MAT_GRID_SIZE * 6,\n chartMenuPanelWidth: 240\n },\n 'ag-theme-balham': {\n headerHeight: BALHAM_GRID_SIZE * 8,\n headerCellMinWidth: 24,\n listItemHeight: BALHAM_GRID_SIZE * 6,\n rowHeight: BALHAM_GRID_SIZE * 7,\n chartMenuPanelWidth: 220\n },\n 'ag-theme-alpine': {\n headerHeight: ALPINE_GRID_SIZE * 8,\n headerCellMinWidth: 36,\n listItemHeight: ALPINE_GRID_SIZE * 4,\n rowHeight: ALPINE_GRID_SIZE * 7,\n chartMenuPanelWidth: 240\n },\n 'ag-theme-quartz': {\n headerHeight: QUARTZ_FONT_SIZE + QUARTZ_GRID_SIZE * 4.25,\n headerCellMinWidth: 36,\n listItemHeight: QUARTZ_ICON_SIZE + QUARTZ_GRID_SIZE,\n rowHeight: QUARTZ_FONT_SIZE + QUARTZ_GRID_SIZE * 3.5,\n chartMenuPanelWidth: 260\n }\n};\n/**\n * this object contains a list of Sass variables and an array\n * of CSS styles required to get the correct value.\n * eg. $virtual-item-height requires a structure, so we can get its height.\n *
\n *
\n *
\n *
\n *
\n */\nvar SASS_PROPERTY_BUILDER = {\n headerHeight: ['ag-header-row'],\n headerCellMinWidth: ['ag-header-cell'],\n listItemHeight: ['ag-virtual-list-item'],\n rowHeight: ['ag-row'],\n chartMenuPanelWidth: ['ag-chart-docked-container']\n};\nvar Environment = /** @class */ (function (_super) {\n __extends$E(Environment, _super);\n function Environment() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.calculatedSizes = {};\n return _this;\n }\n Environment.prototype.postConstruct = function () {\n var _this = this;\n var _a;\n var el = (_a = this.getTheme().el) !== null && _a !== void 0 ? _a : this.eGridDiv;\n this.addManagedPropertyListener('rowHeight', function () { return _this.refreshRowHeightVariable(); });\n this.mutationObserver = new MutationObserver(function () {\n _this.calculatedSizes = {};\n _this.fireGridStylesChangedEvent();\n });\n this.mutationObserver.observe(el || this.eGridDiv, {\n attributes: true,\n attributeFilter: ['class']\n });\n };\n Environment.prototype.fireGridStylesChangedEvent = function () {\n var event = {\n type: Events.EVENT_GRID_STYLES_CHANGED\n };\n this.eventService.dispatchEvent(event);\n };\n Environment.prototype.getSassVariable = function (key) {\n var _a = this.getTheme(), themeFamily = _a.themeFamily, el = _a.el;\n if (!themeFamily || themeFamily.indexOf('ag-theme') !== 0) {\n return;\n }\n if (!this.calculatedSizes) {\n this.calculatedSizes = {};\n }\n if (!this.calculatedSizes[themeFamily]) {\n this.calculatedSizes[themeFamily] = {};\n }\n var size = this.calculatedSizes[themeFamily][key];\n if (size != null) {\n return size;\n }\n this.calculatedSizes[themeFamily][key] = this.calculateValueForSassProperty(key, themeFamily, el);\n return this.calculatedSizes[themeFamily][key];\n };\n Environment.prototype.calculateValueForSassProperty = function (property, theme, themeElement) {\n var _a;\n var useTheme = 'ag-theme-' + (theme.match('material') ? 'material' : theme.match('balham') ? 'balham' : theme.match('alpine') ? 'alpine' : 'custom');\n var defaultValue = HARD_CODED_SIZES[useTheme][property];\n var eDocument = this.gridOptionsService.getDocument();\n if (!themeElement) {\n themeElement = this.eGridDiv;\n }\n if (!SASS_PROPERTY_BUILDER[property]) {\n return defaultValue;\n }\n var classList = SASS_PROPERTY_BUILDER[property];\n var div = eDocument.createElement('div');\n // this will apply SASS variables that were manually added to the current theme\n var classesFromThemeElement = Array.from(themeElement.classList);\n (_a = div.classList).add.apply(_a, __spreadArray$a([theme], __read$c(classesFromThemeElement), false));\n div.style.position = 'absolute';\n var el = classList.reduce(function (prevEl, currentClass) {\n var currentDiv = eDocument.createElement('div');\n currentDiv.style.position = 'static';\n currentDiv.classList.add(currentClass);\n prevEl.appendChild(currentDiv);\n return currentDiv;\n }, div);\n var calculatedValue = 0;\n if (eDocument.body) {\n eDocument.body.appendChild(div);\n var sizeName = property.toLowerCase().indexOf('height') !== -1 ? 'height' : 'width';\n calculatedValue = parseInt(window.getComputedStyle(el)[sizeName], 10);\n eDocument.body.removeChild(div);\n }\n return calculatedValue || defaultValue;\n };\n Environment.prototype.isThemeDark = function () {\n var theme = this.getTheme().theme;\n return !!theme && theme.indexOf('dark') >= 0;\n };\n Environment.prototype.chartMenuPanelWidth = function () {\n return this.getSassVariable('chartMenuPanelWidth');\n };\n Environment.prototype.getTheme = function () {\n var reg = /\\bag-(material|(?:theme-([\\w\\-]*)))\\b/g;\n var el = this.eGridDiv;\n var themeMatch = null;\n var allThemes = [];\n while (el) {\n themeMatch = reg.exec(el.className);\n if (!themeMatch) {\n el = el.parentElement || undefined;\n }\n else {\n var matched = el.className.match(reg);\n if (matched) {\n allThemes = matched;\n }\n break;\n }\n }\n if (!themeMatch) {\n return { allThemes: allThemes };\n }\n var theme = themeMatch[0];\n return { theme: theme, el: el, themeFamily: theme.replace(/-dark$/, ''), allThemes: allThemes };\n };\n Environment.prototype.getFromTheme = function (defaultValue, sassVariableName) {\n var _a;\n return (_a = this.getSassVariable(sassVariableName)) !== null && _a !== void 0 ? _a : defaultValue;\n };\n Environment.prototype.getDefaultRowHeight = function () {\n return this.getFromTheme(DEFAULT_ROW_HEIGHT, 'rowHeight');\n };\n Environment.prototype.getListItemHeight = function () {\n return this.getFromTheme(20, 'listItemHeight');\n };\n Environment.prototype.refreshRowHeightVariable = function () {\n var oldRowHeight = this.eGridDiv.style.getPropertyValue('--ag-line-height').trim();\n var height = this.gridOptionsService.get('rowHeight');\n if (height == null || isNaN(height) || !isFinite(height)) {\n if (oldRowHeight !== null) {\n this.eGridDiv.style.setProperty('--ag-line-height', null);\n }\n return -1;\n }\n var newRowHeight = \"\".concat(height, \"px\");\n if (oldRowHeight != newRowHeight) {\n this.eGridDiv.style.setProperty('--ag-line-height', newRowHeight);\n return height;\n }\n return oldRowHeight != '' ? parseFloat(oldRowHeight) : -1;\n };\n Environment.prototype.getMinColWidth = function () {\n var measuredMin = this.getFromTheme(null, 'headerCellMinWidth');\n return exists(measuredMin) ? Math.max(measuredMin, MIN_COL_WIDTH) : MIN_COL_WIDTH;\n };\n Environment.prototype.destroy = function () {\n this.calculatedSizes = null;\n if (this.mutationObserver) {\n this.mutationObserver.disconnect();\n }\n _super.prototype.destroy.call(this);\n };\n __decorate$F([\n Autowired('eGridDiv')\n ], Environment.prototype, \"eGridDiv\", void 0);\n __decorate$F([\n PostConstruct\n ], Environment.prototype, \"postConstruct\", null);\n Environment = __decorate$F([\n Bean('environment')\n ], Environment);\n return Environment;\n}(BeanStub));\n\nvar __extends$D = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$E = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param$1 = ( false) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\n/**\n * This class solves the 'max height' problem, where the user might want to show more data than\n * the max div height actually allows.\n */\nvar RowContainerHeightService = /** @class */ (function (_super) {\n __extends$D(RowContainerHeightService, _super);\n function RowContainerHeightService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n // the scrollY position\n _this.scrollY = 0;\n // how tall the body is\n _this.uiBodyHeight = 0;\n return _this;\n }\n RowContainerHeightService.prototype.agWire = function (loggerFactory) {\n this.logger = loggerFactory.create(\"RowContainerHeightService\");\n };\n RowContainerHeightService.prototype.postConstruct = function () {\n this.addManagedListener(this.eventService, Events.EVENT_BODY_HEIGHT_CHANGED, this.updateOffset.bind(this));\n this.maxDivHeight = getMaxDivHeight();\n this.logger.log('maxDivHeight = ' + this.maxDivHeight);\n };\n RowContainerHeightService.prototype.isStretching = function () {\n return this.stretching;\n };\n RowContainerHeightService.prototype.getDivStretchOffset = function () {\n return this.divStretchOffset;\n };\n RowContainerHeightService.prototype.updateOffset = function () {\n if (!this.stretching) {\n return;\n }\n var gridBodyCon = this.ctrlsService.getGridBodyCtrl();\n var newScrollY = gridBodyCon.getScrollFeature().getVScrollPosition().top;\n var newBodyHeight = this.getUiBodyHeight();\n var atLeastOneChanged = newScrollY !== this.scrollY || newBodyHeight !== this.uiBodyHeight;\n if (atLeastOneChanged) {\n this.scrollY = newScrollY;\n this.uiBodyHeight = newBodyHeight;\n this.calculateOffset();\n }\n };\n RowContainerHeightService.prototype.calculateOffset = function () {\n this.setUiContainerHeight(this.maxDivHeight);\n this.pixelsToShave = this.modelHeight - this.uiContainerHeight;\n this.maxScrollY = this.uiContainerHeight - this.uiBodyHeight;\n var scrollPercent = this.scrollY / this.maxScrollY;\n var divStretchOffset = scrollPercent * this.pixelsToShave;\n this.logger.log(\"Div Stretch Offset = \".concat(divStretchOffset, \" (\").concat(this.pixelsToShave, \" * \").concat(scrollPercent, \")\"));\n this.setDivStretchOffset(divStretchOffset);\n };\n RowContainerHeightService.prototype.setUiContainerHeight = function (height) {\n if (height !== this.uiContainerHeight) {\n this.uiContainerHeight = height;\n this.eventService.dispatchEvent({ type: Events.EVENT_ROW_CONTAINER_HEIGHT_CHANGED });\n }\n };\n RowContainerHeightService.prototype.clearOffset = function () {\n this.setUiContainerHeight(this.modelHeight);\n this.pixelsToShave = 0;\n this.setDivStretchOffset(0);\n };\n RowContainerHeightService.prototype.setDivStretchOffset = function (newOffset) {\n // because we are talking pixels, no point in confusing things with half numbers\n var newOffsetFloor = typeof newOffset === 'number' ? Math.floor(newOffset) : null;\n if (this.divStretchOffset === newOffsetFloor) {\n return;\n }\n this.divStretchOffset = newOffsetFloor;\n this.eventService.dispatchEvent({ type: Events.EVENT_HEIGHT_SCALE_CHANGED });\n };\n RowContainerHeightService.prototype.setModelHeight = function (modelHeight) {\n this.modelHeight = modelHeight;\n this.stretching = modelHeight != null // null happens when in print layout\n && this.maxDivHeight > 0\n && modelHeight > this.maxDivHeight;\n if (this.stretching) {\n this.calculateOffset();\n }\n else {\n this.clearOffset();\n }\n };\n RowContainerHeightService.prototype.getUiContainerHeight = function () {\n return this.uiContainerHeight;\n };\n RowContainerHeightService.prototype.getRealPixelPosition = function (modelPixel) {\n return modelPixel - this.divStretchOffset;\n };\n RowContainerHeightService.prototype.getUiBodyHeight = function () {\n var gridBodyCon = this.ctrlsService.getGridBodyCtrl();\n var pos = gridBodyCon.getScrollFeature().getVScrollPosition();\n return pos.bottom - pos.top;\n };\n RowContainerHeightService.prototype.getScrollPositionForPixel = function (rowTop) {\n if (this.pixelsToShave <= 0) {\n return rowTop;\n }\n var modelMaxScroll = this.modelHeight - this.getUiBodyHeight();\n var scrollPercent = rowTop / modelMaxScroll;\n var scrollPixel = this.maxScrollY * scrollPercent;\n return scrollPixel;\n };\n __decorate$E([\n Autowired('ctrlsService')\n ], RowContainerHeightService.prototype, \"ctrlsService\", void 0);\n __decorate$E([\n __param$1(0, Qualifier(\"loggerFactory\"))\n ], RowContainerHeightService.prototype, \"agWire\", null);\n __decorate$E([\n PostConstruct\n ], RowContainerHeightService.prototype, \"postConstruct\", null);\n RowContainerHeightService = __decorate$E([\n Bean('rowContainerHeightService')\n ], RowContainerHeightService);\n return RowContainerHeightService;\n}(BeanStub));\n\nvar __extends$C = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$D = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SelectableService = /** @class */ (function (_super) {\n __extends$C(SelectableService, _super);\n function SelectableService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SelectableService.prototype.init = function () {\n var _this = this;\n this.addManagedPropertyListener('isRowSelectable', function () { return _this.updateSelectable(); });\n };\n /**\n * Used by CSRM only, to update selectable state after group state changes.\n */\n SelectableService.prototype.updateSelectableAfterGrouping = function () {\n this.updateSelectable(true);\n };\n SelectableService.prototype.updateSelectable = function (skipLeafNodes) {\n if (skipLeafNodes === void 0) { skipLeafNodes = false; }\n var isRowSelecting = !!this.gridOptionsService.get('rowSelection');\n var isRowSelectable = this.gridOptionsService.get('isRowSelectable');\n if (!isRowSelecting || !isRowSelectable) {\n return;\n }\n var isGroupSelectsChildren = this.gridOptionsService.get('groupSelectsChildren');\n var isCsrmGroupSelectsChildren = this.rowModel.getType() === 'clientSide' && isGroupSelectsChildren;\n var nodesToDeselect = [];\n var nodeCallback = function (node) {\n if (skipLeafNodes && !node.group) {\n return;\n }\n // Only in the CSRM, we allow group node selection if a child has a selectable=true when using groupSelectsChildren\n if (isCsrmGroupSelectsChildren && node.group) {\n var hasSelectableChild = node.childrenAfterGroup.some(function (rowNode) { return rowNode.selectable === true; });\n node.setRowSelectable(hasSelectableChild, true);\n return;\n }\n var rowSelectable = isRowSelectable ? isRowSelectable(node) : true;\n node.setRowSelectable(rowSelectable, true);\n if (!rowSelectable && node.isSelected()) {\n nodesToDeselect.push(node);\n }\n };\n // Needs to be depth first in this case, so that parents can be updated based on child.\n if (isCsrmGroupSelectsChildren) {\n var csrm = this.rowModel;\n var changedPath = new ChangedPath(false, csrm.getRootNode());\n changedPath.forEachChangedNodeDepthFirst(nodeCallback, true, true);\n }\n else {\n // Normal case, update all rows\n this.rowModel.forEachNode(nodeCallback);\n }\n if (nodesToDeselect.length) {\n this.selectionService.setNodesSelected({ nodes: nodesToDeselect, newValue: false, source: 'selectableChanged' });\n }\n // if csrm and group selects children, update the groups after deselecting leaf nodes.\n if (isCsrmGroupSelectsChildren && this.selectionService instanceof SelectionService) {\n this.selectionService.updateGroupsFromChildrenSelections('selectableChanged');\n }\n };\n __decorate$D([\n Autowired('rowModel')\n ], SelectableService.prototype, \"rowModel\", void 0);\n __decorate$D([\n Autowired('selectionService')\n ], SelectableService.prototype, \"selectionService\", void 0);\n __decorate$D([\n PostConstruct\n ], SelectableService.prototype, \"init\", null);\n SelectableService = __decorate$D([\n Bean('selectableService')\n ], SelectableService);\n return SelectableService;\n}(BeanStub));\n\nvar __extends$B = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$C = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar PaginationComp = /** @class */ (function (_super) {\n __extends$B(PaginationComp, _super);\n function PaginationComp() {\n var _this = _super.call(this) || this;\n _this.previousAndFirstButtonsDisabled = false;\n _this.nextButtonDisabled = false;\n _this.lastButtonDisabled = false;\n _this.areListenersSetup = false;\n return _this;\n }\n PaginationComp.prototype.postConstruct = function () {\n var _this = this;\n var isRtl = this.gridOptionsService.get('enableRtl');\n this.setTemplate(this.getTemplate());\n var _a = this, btFirst = _a.btFirst, btPrevious = _a.btPrevious, btNext = _a.btNext, btLast = _a.btLast; _a.pageSizeComp;\n this.activateTabIndex([btFirst, btPrevious, btNext, btLast]);\n btFirst.insertAdjacentElement('afterbegin', createIconNoSpan(isRtl ? 'last' : 'first', this.gridOptionsService));\n btPrevious.insertAdjacentElement('afterbegin', createIconNoSpan(isRtl ? 'next' : 'previous', this.gridOptionsService));\n btNext.insertAdjacentElement('afterbegin', createIconNoSpan(isRtl ? 'previous' : 'next', this.gridOptionsService));\n btLast.insertAdjacentElement('afterbegin', createIconNoSpan(isRtl ? 'first' : 'last', this.gridOptionsService));\n this.addManagedPropertyListener('pagination', this.onPaginationChanged.bind(this));\n this.addManagedPropertyListener('suppressPaginationPanel', this.onPaginationChanged.bind(this));\n this.addManagedPropertyListeners(['paginationPageSizeSelector', 'paginationAutoPageSize', 'suppressPaginationPanel'], function () { return _this.onPageSizeRelatedOptionsChange(); });\n this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector());\n this.onPaginationChanged();\n };\n PaginationComp.prototype.onPaginationChanged = function () {\n var isPaging = this.gridOptionsService.get('pagination');\n var paginationPanelEnabled = isPaging && !this.gridOptionsService.get('suppressPaginationPanel');\n this.setDisplayed(paginationPanelEnabled);\n if (!paginationPanelEnabled) {\n return;\n }\n this.setupListeners();\n this.enableOrDisableButtons();\n this.updateRowLabels();\n this.setCurrentPageLabel();\n this.setTotalLabels();\n this.onPageSizeRelatedOptionsChange();\n };\n PaginationComp.prototype.onPageSizeRelatedOptionsChange = function () {\n this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector());\n };\n PaginationComp.prototype.setupListeners = function () {\n var _this = this;\n if (!this.areListenersSetup) {\n this.addManagedListener(this.eventService, Events.EVENT_PAGINATION_CHANGED, this.onPaginationChanged.bind(this));\n [\n { el: this.btFirst, fn: this.onBtFirst.bind(this) },\n { el: this.btPrevious, fn: this.onBtPrevious.bind(this) },\n { el: this.btNext, fn: this.onBtNext.bind(this) },\n { el: this.btLast, fn: this.onBtLast.bind(this) }\n ].forEach(function (item) {\n var el = item.el, fn = item.fn;\n _this.addManagedListener(el, 'click', fn);\n _this.addManagedListener(el, 'keydown', function (e) {\n if (e.key === KeyCode.ENTER || e.key === KeyCode.SPACE) {\n e.preventDefault();\n fn();\n }\n });\n });\n this.areListenersSetup = true;\n }\n };\n PaginationComp.prototype.onBtFirst = function () {\n if (!this.previousAndFirstButtonsDisabled) {\n this.paginationProxy.goToFirstPage();\n }\n };\n PaginationComp.prototype.setCurrentPageLabel = function () {\n var pagesExist = this.paginationProxy.getTotalPages() > 0;\n var currentPage = this.paginationProxy.getCurrentPage();\n var toDisplay = pagesExist ? currentPage + 1 : 0;\n this.lbCurrent.textContent = this.formatNumber(toDisplay);\n };\n PaginationComp.prototype.formatNumber = function (value) {\n var userFunc = this.gridOptionsService.getCallback('paginationNumberFormatter');\n if (userFunc) {\n var params = { value: value };\n return userFunc(params);\n }\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var thousandSeparator = localeTextFunc('thousandSeparator', ',');\n var decimalSeparator = localeTextFunc('decimalSeparator', '.');\n return formatNumberCommas(value, thousandSeparator, decimalSeparator);\n };\n PaginationComp.prototype.getTemplate = function () {\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var strPage = localeTextFunc('page', 'Page');\n var strTo = localeTextFunc('to', 'to');\n var strOf = localeTextFunc('of', 'of');\n var strFirst = localeTextFunc('firstPage', 'First Page');\n var strPrevious = localeTextFunc('previousPage', 'Previous Page');\n var strNext = localeTextFunc('nextPage', 'Next Page');\n var strLast = localeTextFunc('lastPage', 'Last Page');\n var compId = this.getCompId();\n return /* html */ \"
\\n \\n \\n \\n \").concat(strTo, \"\\n \\n \").concat(strOf, \"\\n \\n \\n \\n
\\n
\\n \\n \").concat(strPage, \"\\n \\n \").concat(strOf, \"\\n \\n \\n
\\n
\\n
\\n
\");\n };\n PaginationComp.prototype.onBtNext = function () {\n if (!this.nextButtonDisabled) {\n this.paginationProxy.goToNextPage();\n }\n };\n PaginationComp.prototype.onBtPrevious = function () {\n if (!this.previousAndFirstButtonsDisabled) {\n this.paginationProxy.goToPreviousPage();\n }\n };\n PaginationComp.prototype.onBtLast = function () {\n if (!this.lastButtonDisabled) {\n this.paginationProxy.goToLastPage();\n }\n };\n PaginationComp.prototype.enableOrDisableButtons = function () {\n var currentPage = this.paginationProxy.getCurrentPage();\n var maxRowFound = this.paginationProxy.isLastPageFound();\n var totalPages = this.paginationProxy.getTotalPages();\n this.previousAndFirstButtonsDisabled = currentPage === 0;\n this.toggleButtonDisabled(this.btFirst, this.previousAndFirstButtonsDisabled);\n this.toggleButtonDisabled(this.btPrevious, this.previousAndFirstButtonsDisabled);\n var zeroPagesToDisplay = this.isZeroPagesToDisplay();\n var onLastPage = currentPage === (totalPages - 1);\n this.nextButtonDisabled = onLastPage || zeroPagesToDisplay;\n this.lastButtonDisabled = !maxRowFound || zeroPagesToDisplay || currentPage === (totalPages - 1);\n this.toggleButtonDisabled(this.btNext, this.nextButtonDisabled);\n this.toggleButtonDisabled(this.btLast, this.lastButtonDisabled);\n };\n PaginationComp.prototype.toggleButtonDisabled = function (button, disabled) {\n setAriaDisabled(button, disabled);\n button.classList.toggle('ag-disabled', disabled);\n };\n PaginationComp.prototype.updateRowLabels = function () {\n var currentPage = this.paginationProxy.getCurrentPage();\n var pageSize = this.paginationProxy.getPageSize();\n var maxRowFound = this.paginationProxy.isLastPageFound();\n var rowCount = this.paginationProxy.isLastPageFound() ?\n this.paginationProxy.getMasterRowCount() : null;\n var startRow;\n var endRow;\n if (this.isZeroPagesToDisplay()) {\n startRow = endRow = 0;\n }\n else {\n startRow = (pageSize * currentPage) + 1;\n endRow = startRow + pageSize - 1;\n if (maxRowFound && endRow > rowCount) {\n endRow = rowCount;\n }\n }\n this.lbFirstRowOnPage.textContent = this.formatNumber(startRow);\n if (this.rowNodeBlockLoader.isLoading()) {\n var translate = this.localeService.getLocaleTextFunc();\n this.lbLastRowOnPage.innerHTML = translate('pageLastRowUnknown', '?');\n }\n else {\n this.lbLastRowOnPage.textContent = this.formatNumber(endRow);\n }\n };\n PaginationComp.prototype.isZeroPagesToDisplay = function () {\n var maxRowFound = this.paginationProxy.isLastPageFound();\n var totalPages = this.paginationProxy.getTotalPages();\n return maxRowFound && totalPages === 0;\n };\n PaginationComp.prototype.setTotalLabels = function () {\n var lastPageFound = this.paginationProxy.isLastPageFound();\n var totalPages = this.paginationProxy.getTotalPages();\n var rowCount = lastPageFound ? this.paginationProxy.getMasterRowCount() : null;\n // When `pivotMode=true` and no grouping or value columns exist, a single 'hidden' group row (root node) is in\n // the grid and the pagination totals will correctly display total = 1. However this is confusing to users as\n // they can't see it. To address this UX issue we simply set the totals to zero in the pagination panel.\n if (rowCount === 1) {\n var firstRow = this.paginationProxy.getRow(0);\n // a group node with no group or agg data will not be visible to users\n var hiddenGroupRow = firstRow && firstRow.group && !(firstRow.groupData || firstRow.aggData);\n if (hiddenGroupRow) {\n this.setTotalLabelsToZero();\n return;\n }\n }\n if (lastPageFound) {\n this.lbTotal.textContent = this.formatNumber(totalPages);\n this.lbRecordCount.textContent = this.formatNumber(rowCount);\n }\n else {\n var moreText = this.localeService.getLocaleTextFunc()('more', 'more');\n this.lbTotal.innerHTML = moreText;\n this.lbRecordCount.innerHTML = moreText;\n }\n };\n PaginationComp.prototype.setTotalLabelsToZero = function () {\n this.lbFirstRowOnPage.textContent = this.formatNumber(0);\n this.lbCurrent.textContent = this.formatNumber(0);\n this.lbLastRowOnPage.textContent = this.formatNumber(0);\n this.lbTotal.textContent = this.formatNumber(0);\n this.lbRecordCount.textContent = this.formatNumber(0);\n };\n __decorate$C([\n Autowired('paginationProxy')\n ], PaginationComp.prototype, \"paginationProxy\", void 0);\n __decorate$C([\n Autowired('rowNodeBlockLoader')\n ], PaginationComp.prototype, \"rowNodeBlockLoader\", void 0);\n __decorate$C([\n RefSelector('btFirst')\n ], PaginationComp.prototype, \"btFirst\", void 0);\n __decorate$C([\n RefSelector('btPrevious')\n ], PaginationComp.prototype, \"btPrevious\", void 0);\n __decorate$C([\n RefSelector('btNext')\n ], PaginationComp.prototype, \"btNext\", void 0);\n __decorate$C([\n RefSelector('btLast')\n ], PaginationComp.prototype, \"btLast\", void 0);\n __decorate$C([\n RefSelector('lbRecordCount')\n ], PaginationComp.prototype, \"lbRecordCount\", void 0);\n __decorate$C([\n RefSelector('lbFirstRowOnPage')\n ], PaginationComp.prototype, \"lbFirstRowOnPage\", void 0);\n __decorate$C([\n RefSelector('lbLastRowOnPage')\n ], PaginationComp.prototype, \"lbLastRowOnPage\", void 0);\n __decorate$C([\n RefSelector('lbCurrent')\n ], PaginationComp.prototype, \"lbCurrent\", void 0);\n __decorate$C([\n RefSelector('lbTotal')\n ], PaginationComp.prototype, \"lbTotal\", void 0);\n __decorate$C([\n RefSelector('pageSizeComp')\n ], PaginationComp.prototype, \"pageSizeComp\", void 0);\n __decorate$C([\n PostConstruct\n ], PaginationComp.prototype, \"postConstruct\", null);\n return PaginationComp;\n}(Component));\n\nvar __extends$A = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$B = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar OverlayWrapperComponent = /** @class */ (function (_super) {\n __extends$A(OverlayWrapperComponent, _super);\n function OverlayWrapperComponent() {\n var _this = _super.call(this, OverlayWrapperComponent.TEMPLATE) || this;\n _this.inProgress = false;\n _this.destroyRequested = false;\n return _this;\n }\n OverlayWrapperComponent.prototype.updateLayoutClasses = function (cssClass, params) {\n var overlayWrapperClassList = this.eOverlayWrapper.classList;\n overlayWrapperClassList.toggle(LayoutCssClasses.AUTO_HEIGHT, params.autoHeight);\n overlayWrapperClassList.toggle(LayoutCssClasses.NORMAL, params.normal);\n overlayWrapperClassList.toggle(LayoutCssClasses.PRINT, params.print);\n };\n OverlayWrapperComponent.prototype.postConstruct = function () {\n this.createManagedBean(new LayoutFeature(this));\n this.setDisplayed(false, { skipAriaHidden: true });\n this.overlayService.registerOverlayWrapperComp(this);\n };\n OverlayWrapperComponent.prototype.setWrapperTypeClass = function (overlayWrapperCssClass) {\n var overlayWrapperClassList = this.eOverlayWrapper.classList;\n if (this.activeOverlayWrapperCssClass) {\n overlayWrapperClassList.toggle(this.activeOverlayWrapperCssClass, false);\n }\n this.activeOverlayWrapperCssClass = overlayWrapperCssClass;\n overlayWrapperClassList.toggle(overlayWrapperCssClass, true);\n };\n OverlayWrapperComponent.prototype.showOverlay = function (overlayComp, overlayWrapperCssClass, updateListenerDestroyFunc) {\n var _this = this;\n if (this.inProgress) {\n return;\n }\n this.setWrapperTypeClass(overlayWrapperCssClass);\n this.destroyActiveOverlay();\n this.inProgress = true;\n if (overlayComp) {\n overlayComp.then(function (comp) {\n _this.inProgress = false;\n _this.eOverlayWrapper.appendChild(comp.getGui());\n _this.activeOverlay = comp;\n _this.updateListenerDestroyFunc = updateListenerDestroyFunc;\n if (_this.destroyRequested) {\n _this.destroyRequested = false;\n _this.destroyActiveOverlay();\n }\n });\n }\n this.setDisplayed(true, { skipAriaHidden: true });\n };\n OverlayWrapperComponent.prototype.destroyActiveOverlay = function () {\n var _a;\n if (this.inProgress) {\n this.destroyRequested = true;\n return;\n }\n if (!this.activeOverlay) {\n return;\n }\n this.activeOverlay = this.getContext().destroyBean(this.activeOverlay);\n (_a = this.updateListenerDestroyFunc) === null || _a === void 0 ? void 0 : _a.call(this);\n clearElement(this.eOverlayWrapper);\n };\n OverlayWrapperComponent.prototype.hideOverlay = function () {\n this.destroyActiveOverlay();\n this.setDisplayed(false, { skipAriaHidden: true });\n };\n OverlayWrapperComponent.prototype.destroy = function () {\n this.destroyActiveOverlay();\n _super.prototype.destroy.call(this);\n };\n // wrapping in outer div, and wrapper, is needed to center the loading icon\n OverlayWrapperComponent.TEMPLATE = \"\\n
\\n
\\n
\\n
\\n
\";\n __decorate$B([\n Autowired('overlayService')\n ], OverlayWrapperComponent.prototype, \"overlayService\", void 0);\n __decorate$B([\n RefSelector('eOverlayWrapper')\n ], OverlayWrapperComponent.prototype, \"eOverlayWrapper\", void 0);\n __decorate$B([\n PostConstruct\n ], OverlayWrapperComponent.prototype, \"postConstruct\", null);\n return OverlayWrapperComponent;\n}(Component));\n\nvar __extends$z = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$A = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar RowPositionUtils = /** @class */ (function (_super) {\n __extends$z(RowPositionUtils, _super);\n function RowPositionUtils() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n RowPositionUtils.prototype.getFirstRow = function () {\n var rowIndex = 0;\n var rowPinned;\n if (this.pinnedRowModel.getPinnedTopRowCount()) {\n rowPinned = 'top';\n }\n else if (this.rowModel.getRowCount()) {\n rowPinned = null;\n rowIndex = this.paginationProxy.getPageFirstRow();\n }\n else if (this.pinnedRowModel.getPinnedBottomRowCount()) {\n rowPinned = 'bottom';\n }\n return rowPinned === undefined ? null : { rowIndex: rowIndex, rowPinned: rowPinned };\n };\n RowPositionUtils.prototype.getLastRow = function () {\n var rowIndex;\n var rowPinned = null;\n var pinnedBottomCount = this.pinnedRowModel.getPinnedBottomRowCount();\n var pinnedTopCount = this.pinnedRowModel.getPinnedTopRowCount();\n if (pinnedBottomCount) {\n rowPinned = 'bottom';\n rowIndex = pinnedBottomCount - 1;\n }\n else if (this.rowModel.getRowCount()) {\n rowPinned = null;\n rowIndex = this.paginationProxy.getPageLastRow();\n }\n else if (pinnedTopCount) {\n rowPinned = 'top';\n rowIndex = pinnedTopCount - 1;\n }\n return rowIndex === undefined ? null : { rowIndex: rowIndex, rowPinned: rowPinned };\n };\n RowPositionUtils.prototype.getRowNode = function (gridRow) {\n switch (gridRow.rowPinned) {\n case 'top':\n return this.pinnedRowModel.getPinnedTopRowData()[gridRow.rowIndex];\n case 'bottom':\n return this.pinnedRowModel.getPinnedBottomRowData()[gridRow.rowIndex];\n default:\n return this.rowModel.getRow(gridRow.rowIndex);\n }\n };\n RowPositionUtils.prototype.sameRow = function (rowA, rowB) {\n // if both missing\n if (!rowA && !rowB) {\n return true;\n }\n // if only one missing\n if ((rowA && !rowB) || (!rowA && rowB)) {\n return false;\n }\n // otherwise compare (use == to compare rowPinned because it can be null or undefined)\n return rowA.rowIndex === rowB.rowIndex && rowA.rowPinned == rowB.rowPinned;\n };\n // tests if this row selection is before the other row selection\n RowPositionUtils.prototype.before = function (rowA, rowB) {\n switch (rowA.rowPinned) {\n case 'top':\n // we we are floating top, and other isn't, then we are always before\n if (rowB.rowPinned !== 'top') {\n return true;\n }\n break;\n case 'bottom':\n // if we are floating bottom, and the other isn't, then we are never before\n if (rowB.rowPinned !== 'bottom') {\n return false;\n }\n break;\n default:\n // if we are not floating, but the other one is floating...\n if (exists(rowB.rowPinned)) {\n return rowB.rowPinned !== 'top';\n }\n break;\n }\n return rowA.rowIndex < rowB.rowIndex;\n };\n RowPositionUtils.prototype.rowMax = function (rows) {\n var _this = this;\n var max;\n rows.forEach(function (row) {\n if (max === undefined || _this.before(max, row)) {\n max = row;\n }\n });\n return max;\n };\n RowPositionUtils.prototype.rowMin = function (rows) {\n var _this = this;\n var min;\n rows.forEach(function (row) {\n if (min === undefined || _this.before(row, min)) {\n min = row;\n }\n });\n return min;\n };\n __decorate$A([\n Autowired('rowModel')\n ], RowPositionUtils.prototype, \"rowModel\", void 0);\n __decorate$A([\n Autowired('pinnedRowModel')\n ], RowPositionUtils.prototype, \"pinnedRowModel\", void 0);\n __decorate$A([\n Autowired('paginationProxy')\n ], RowPositionUtils.prototype, \"paginationProxy\", void 0);\n RowPositionUtils = __decorate$A([\n Bean('rowPositionUtils')\n ], RowPositionUtils);\n return RowPositionUtils;\n}(BeanStub));\n\nvar __extends$y = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$z = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar CellPositionUtils = /** @class */ (function (_super) {\n __extends$y(CellPositionUtils, _super);\n function CellPositionUtils() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n CellPositionUtils.prototype.createId = function (cellPosition) {\n var rowIndex = cellPosition.rowIndex, rowPinned = cellPosition.rowPinned, column = cellPosition.column;\n return this.createIdFromValues({ rowIndex: rowIndex, column: column, rowPinned: rowPinned });\n };\n CellPositionUtils.prototype.createIdFromValues = function (cellPosition) {\n var rowIndex = cellPosition.rowIndex, rowPinned = cellPosition.rowPinned, column = cellPosition.column;\n return \"\".concat(rowIndex, \".\").concat(rowPinned == null ? 'null' : rowPinned, \".\").concat(column.getId());\n };\n CellPositionUtils.prototype.equals = function (cellA, cellB) {\n var colsMatch = cellA.column === cellB.column;\n var floatingMatch = cellA.rowPinned === cellB.rowPinned;\n var indexMatch = cellA.rowIndex === cellB.rowIndex;\n return colsMatch && floatingMatch && indexMatch;\n };\n CellPositionUtils = __decorate$z([\n Bean('cellPositionUtils')\n ], CellPositionUtils);\n return CellPositionUtils;\n}(BeanStub));\n\nvar __extends$x = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar UndoRedoAction = /** @class */ (function () {\n function UndoRedoAction(cellValueChanges) {\n this.cellValueChanges = cellValueChanges;\n }\n return UndoRedoAction;\n}());\nvar RangeUndoRedoAction = /** @class */ (function (_super) {\n __extends$x(RangeUndoRedoAction, _super);\n function RangeUndoRedoAction(cellValueChanges, initialRange, finalRange, ranges) {\n var _this = _super.call(this, cellValueChanges) || this;\n _this.initialRange = initialRange;\n _this.finalRange = finalRange;\n _this.ranges = ranges;\n return _this;\n }\n return RangeUndoRedoAction;\n}(UndoRedoAction));\nvar UndoRedoStack = /** @class */ (function () {\n function UndoRedoStack(maxStackSize) {\n this.actionStack = [];\n this.maxStackSize = maxStackSize ? maxStackSize : UndoRedoStack.DEFAULT_STACK_SIZE;\n this.actionStack = new Array(this.maxStackSize);\n }\n UndoRedoStack.prototype.pop = function () {\n return this.actionStack.pop();\n };\n UndoRedoStack.prototype.push = function (item) {\n var shouldAddActions = item.cellValueChanges && item.cellValueChanges.length > 0;\n if (!shouldAddActions) {\n return;\n }\n if (this.actionStack.length === this.maxStackSize) {\n this.actionStack.shift();\n }\n this.actionStack.push(item);\n };\n UndoRedoStack.prototype.clear = function () {\n this.actionStack = [];\n };\n UndoRedoStack.prototype.getCurrentStackSize = function () {\n return this.actionStack.length;\n };\n UndoRedoStack.DEFAULT_STACK_SIZE = 10;\n return UndoRedoStack;\n}());\n\nvar __extends$w = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$4 = ( false) || function () {\n __assign$4 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$4.apply(this, arguments);\n};\nvar __decorate$y = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$b = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$9 = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar UndoRedoService = /** @class */ (function (_super) {\n __extends$w(UndoRedoService, _super);\n function UndoRedoService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.cellValueChanges = [];\n _this.activeCellEdit = null;\n _this.activeRowEdit = null;\n _this.isPasting = false;\n _this.isRangeInAction = false;\n _this.onCellValueChanged = function (event) {\n var eventCell = { column: event.column, rowIndex: event.rowIndex, rowPinned: event.rowPinned };\n var isCellEditing = _this.activeCellEdit !== null && _this.cellPositionUtils.equals(_this.activeCellEdit, eventCell);\n var isRowEditing = _this.activeRowEdit !== null && _this.rowPositionUtils.sameRow(_this.activeRowEdit, eventCell);\n var shouldCaptureAction = isCellEditing || isRowEditing || _this.isPasting || _this.isRangeInAction;\n if (!shouldCaptureAction) {\n return;\n }\n var rowPinned = event.rowPinned, rowIndex = event.rowIndex, column = event.column, oldValue = event.oldValue, value = event.value;\n var cellValueChange = {\n rowPinned: rowPinned,\n rowIndex: rowIndex,\n columnId: column.getColId(),\n newValue: value,\n oldValue: oldValue\n };\n _this.cellValueChanges.push(cellValueChange);\n };\n _this.clearStacks = function () {\n _this.undoStack.clear();\n _this.redoStack.clear();\n };\n return _this;\n }\n UndoRedoService.prototype.init = function () {\n var _this = this;\n if (!this.gridOptionsService.get('undoRedoCellEditing')) {\n return;\n }\n var undoRedoLimit = this.gridOptionsService.get('undoRedoCellEditingLimit');\n if (undoRedoLimit <= 0) {\n return;\n }\n this.undoStack = new UndoRedoStack(undoRedoLimit);\n this.redoStack = new UndoRedoStack(undoRedoLimit);\n this.addRowEditingListeners();\n this.addCellEditingListeners();\n this.addPasteListeners();\n this.addFillListeners();\n this.addCellKeyListeners();\n this.addManagedListener(this.eventService, Events.EVENT_CELL_VALUE_CHANGED, this.onCellValueChanged);\n // undo / redo is restricted to actual editing so we clear the stacks when other operations are\n // performed that change the order of the row / cols.\n this.addManagedListener(this.eventService, Events.EVENT_MODEL_UPDATED, function (e) {\n if (!e.keepUndoRedoStack) {\n _this.clearStacks();\n }\n });\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.clearStacks);\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.clearStacks);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_GROUP_OPENED, this.clearStacks);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.clearStacks);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_MOVED, this.clearStacks);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PINNED, this.clearStacks);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VISIBLE, this.clearStacks);\n this.addManagedListener(this.eventService, Events.EVENT_ROW_DRAG_END, this.clearStacks);\n this.ctrlsService.whenReady(function () {\n _this.gridBodyCtrl = _this.ctrlsService.getGridBodyCtrl();\n });\n };\n UndoRedoService.prototype.getCurrentUndoStackSize = function () {\n return this.undoStack ? this.undoStack.getCurrentStackSize() : 0;\n };\n UndoRedoService.prototype.getCurrentRedoStackSize = function () {\n return this.redoStack ? this.redoStack.getCurrentStackSize() : 0;\n };\n UndoRedoService.prototype.undo = function (source) {\n var startEvent = {\n type: Events.EVENT_UNDO_STARTED,\n source: source\n };\n this.eventService.dispatchEvent(startEvent);\n var operationPerformed = this.undoRedo(this.undoStack, this.redoStack, 'initialRange', 'oldValue', 'undo');\n var endEvent = {\n type: Events.EVENT_UNDO_ENDED,\n source: source,\n operationPerformed: operationPerformed\n };\n this.eventService.dispatchEvent(endEvent);\n };\n UndoRedoService.prototype.redo = function (source) {\n var startEvent = {\n type: Events.EVENT_REDO_STARTED,\n source: source\n };\n this.eventService.dispatchEvent(startEvent);\n var operationPerformed = this.undoRedo(this.redoStack, this.undoStack, 'finalRange', 'newValue', 'redo');\n var endEvent = {\n type: Events.EVENT_REDO_ENDED,\n source: source,\n operationPerformed: operationPerformed\n };\n this.eventService.dispatchEvent(endEvent);\n };\n UndoRedoService.prototype.undoRedo = function (undoRedoStack, opposingUndoRedoStack, rangeProperty, cellValueChangeProperty, source) {\n if (!undoRedoStack) {\n return false;\n }\n var undoRedoAction = undoRedoStack.pop();\n if (!undoRedoAction || !undoRedoAction.cellValueChanges) {\n return false;\n }\n this.processAction(undoRedoAction, function (cellValueChange) { return cellValueChange[cellValueChangeProperty]; }, source);\n if (undoRedoAction instanceof RangeUndoRedoAction) {\n this.processRange(undoRedoAction.ranges || [undoRedoAction[rangeProperty]]);\n }\n else {\n this.processCell(undoRedoAction.cellValueChanges);\n }\n opposingUndoRedoStack.push(undoRedoAction);\n return true;\n };\n UndoRedoService.prototype.processAction = function (action, valueExtractor, source) {\n var _this = this;\n action.cellValueChanges.forEach(function (cellValueChange) {\n var rowIndex = cellValueChange.rowIndex, rowPinned = cellValueChange.rowPinned, columnId = cellValueChange.columnId;\n var rowPosition = { rowIndex: rowIndex, rowPinned: rowPinned };\n var currentRow = _this.getRowNode(rowPosition);\n // checks if the row has been filtered out\n if (!currentRow.displayed) {\n return;\n }\n currentRow.setDataValue(columnId, valueExtractor(cellValueChange), source);\n });\n };\n UndoRedoService.prototype.processRange = function (ranges) {\n var _this = this;\n var lastFocusedCell;\n this.rangeService.removeAllCellRanges(true);\n ranges.forEach(function (range, idx) {\n if (!range) {\n return;\n }\n var startRow = range.startRow;\n var endRow = range.endRow;\n if (idx === ranges.length - 1) {\n lastFocusedCell = {\n rowPinned: startRow.rowPinned,\n rowIndex: startRow.rowIndex,\n columnId: range.startColumn.getColId()\n };\n _this.setLastFocusedCell(lastFocusedCell);\n }\n var cellRangeParams = {\n rowStartIndex: startRow.rowIndex,\n rowStartPinned: startRow.rowPinned,\n rowEndIndex: endRow.rowIndex,\n rowEndPinned: endRow.rowPinned,\n columnStart: range.startColumn,\n columns: range.columns\n };\n _this.rangeService.addCellRange(cellRangeParams);\n });\n };\n UndoRedoService.prototype.processCell = function (cellValueChanges) {\n var cellValueChange = cellValueChanges[0];\n var rowIndex = cellValueChange.rowIndex, rowPinned = cellValueChange.rowPinned;\n var rowPosition = { rowIndex: rowIndex, rowPinned: rowPinned };\n var row = this.getRowNode(rowPosition);\n var lastFocusedCell = {\n rowPinned: cellValueChange.rowPinned,\n rowIndex: row.rowIndex,\n columnId: cellValueChange.columnId\n };\n // when single cells are being processed, they should be considered\n // as ranges when the rangeService is present (singleCellRanges).\n // otherwise focus will be restore but the range will not.\n this.setLastFocusedCell(lastFocusedCell, !!this.rangeService);\n };\n UndoRedoService.prototype.setLastFocusedCell = function (lastFocusedCell, setRangeToCell) {\n var rowIndex = lastFocusedCell.rowIndex, columnId = lastFocusedCell.columnId, rowPinned = lastFocusedCell.rowPinned;\n var scrollFeature = this.gridBodyCtrl.getScrollFeature();\n var column = this.columnModel.getGridColumn(columnId);\n if (!column) {\n return;\n }\n scrollFeature.ensureIndexVisible(rowIndex);\n scrollFeature.ensureColumnVisible(column);\n var cellPosition = { rowIndex: rowIndex, column: column, rowPinned: rowPinned };\n this.focusService.setFocusedCell(__assign$4(__assign$4({}, cellPosition), { forceBrowserFocus: true }));\n if (setRangeToCell) {\n this.rangeService.setRangeToCell(cellPosition);\n }\n };\n UndoRedoService.prototype.addRowEditingListeners = function () {\n var _this = this;\n this.addManagedListener(this.eventService, Events.EVENT_ROW_EDITING_STARTED, function (e) {\n _this.activeRowEdit = { rowIndex: e.rowIndex, rowPinned: e.rowPinned };\n });\n this.addManagedListener(this.eventService, Events.EVENT_ROW_EDITING_STOPPED, function () {\n var action = new UndoRedoAction(_this.cellValueChanges);\n _this.pushActionsToUndoStack(action);\n _this.activeRowEdit = null;\n });\n };\n UndoRedoService.prototype.addCellEditingListeners = function () {\n var _this = this;\n this.addManagedListener(this.eventService, Events.EVENT_CELL_EDITING_STARTED, function (e) {\n _this.activeCellEdit = { column: e.column, rowIndex: e.rowIndex, rowPinned: e.rowPinned };\n });\n this.addManagedListener(this.eventService, Events.EVENT_CELL_EDITING_STOPPED, function (e) {\n _this.activeCellEdit = null;\n var shouldPushAction = e.valueChanged && !_this.activeRowEdit && !_this.isPasting && !_this.isRangeInAction;\n if (shouldPushAction) {\n var action = new UndoRedoAction(_this.cellValueChanges);\n _this.pushActionsToUndoStack(action);\n }\n });\n };\n UndoRedoService.prototype.addPasteListeners = function () {\n var _this = this;\n this.addManagedListener(this.eventService, Events.EVENT_PASTE_START, function () {\n _this.isPasting = true;\n });\n this.addManagedListener(this.eventService, Events.EVENT_PASTE_END, function () {\n var action = new UndoRedoAction(_this.cellValueChanges);\n _this.pushActionsToUndoStack(action);\n _this.isPasting = false;\n });\n };\n UndoRedoService.prototype.addFillListeners = function () {\n var _this = this;\n this.addManagedListener(this.eventService, Events.EVENT_FILL_START, function () {\n _this.isRangeInAction = true;\n });\n this.addManagedListener(this.eventService, Events.EVENT_FILL_END, function (event) {\n var action = new RangeUndoRedoAction(_this.cellValueChanges, event.initialRange, event.finalRange);\n _this.pushActionsToUndoStack(action);\n _this.isRangeInAction = false;\n });\n };\n UndoRedoService.prototype.addCellKeyListeners = function () {\n var _this = this;\n this.addManagedListener(this.eventService, Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START, function () {\n _this.isRangeInAction = true;\n });\n this.addManagedListener(this.eventService, Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END, function () {\n var action;\n if (_this.rangeService && _this.gridOptionsService.get('enableRangeSelection')) {\n action = new RangeUndoRedoAction(_this.cellValueChanges, undefined, undefined, __spreadArray$9([], __read$b(_this.rangeService.getCellRanges()), false));\n }\n else {\n action = new UndoRedoAction(_this.cellValueChanges);\n }\n _this.pushActionsToUndoStack(action);\n _this.isRangeInAction = false;\n });\n };\n UndoRedoService.prototype.pushActionsToUndoStack = function (action) {\n this.undoStack.push(action);\n this.cellValueChanges = [];\n this.redoStack.clear();\n };\n UndoRedoService.prototype.getRowNode = function (gridRow) {\n switch (gridRow.rowPinned) {\n case 'top':\n return this.pinnedRowModel.getPinnedTopRowData()[gridRow.rowIndex];\n case 'bottom':\n return this.pinnedRowModel.getPinnedBottomRowData()[gridRow.rowIndex];\n default:\n return this.rowModel.getRow(gridRow.rowIndex);\n }\n };\n __decorate$y([\n Autowired('focusService')\n ], UndoRedoService.prototype, \"focusService\", void 0);\n __decorate$y([\n Autowired('ctrlsService')\n ], UndoRedoService.prototype, \"ctrlsService\", void 0);\n __decorate$y([\n Autowired('rowModel')\n ], UndoRedoService.prototype, \"rowModel\", void 0);\n __decorate$y([\n Autowired('pinnedRowModel')\n ], UndoRedoService.prototype, \"pinnedRowModel\", void 0);\n __decorate$y([\n Autowired('cellPositionUtils')\n ], UndoRedoService.prototype, \"cellPositionUtils\", void 0);\n __decorate$y([\n Autowired('rowPositionUtils')\n ], UndoRedoService.prototype, \"rowPositionUtils\", void 0);\n __decorate$y([\n Autowired('columnModel')\n ], UndoRedoService.prototype, \"columnModel\", void 0);\n __decorate$y([\n Optional('rangeService')\n ], UndoRedoService.prototype, \"rangeService\", void 0);\n __decorate$y([\n PostConstruct\n ], UndoRedoService.prototype, \"init\", null);\n UndoRedoService = __decorate$y([\n Bean('undoRedoService')\n ], UndoRedoService);\n return UndoRedoService;\n}(BeanStub));\n\nvar __extends$v = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$x = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar HeaderPositionUtils = /** @class */ (function (_super) {\n __extends$v(HeaderPositionUtils, _super);\n function HeaderPositionUtils() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n HeaderPositionUtils.prototype.findHeader = function (focusedHeader, direction) {\n var nextColumn;\n var getGroupMethod;\n var getColMethod;\n if (focusedHeader.column instanceof ColumnGroup) {\n getGroupMethod = \"getDisplayedGroup\".concat(direction);\n nextColumn = this.columnModel[getGroupMethod](focusedHeader.column);\n }\n else {\n getColMethod = \"getDisplayedCol\".concat(direction);\n nextColumn = this.columnModel[getColMethod](focusedHeader.column);\n }\n if (!nextColumn) {\n return;\n }\n var headerRowIndex = focusedHeader.headerRowIndex;\n if (this.getHeaderRowType(headerRowIndex) !== HeaderRowType.FLOATING_FILTER) {\n var columnsInPath = [nextColumn];\n while (nextColumn.getParent()) {\n nextColumn = nextColumn.getParent();\n columnsInPath.push(nextColumn);\n }\n nextColumn = columnsInPath[columnsInPath.length - 1 - headerRowIndex];\n }\n var _a = this.getHeaderIndexToFocus(nextColumn, headerRowIndex), column = _a.column, indexToFocus = _a.headerRowIndex;\n return {\n column: column,\n headerRowIndex: indexToFocus\n };\n };\n HeaderPositionUtils.prototype.getHeaderIndexToFocus = function (column, currentIndex) {\n var nextColumn;\n if (column instanceof ColumnGroup && this.isAnyChildSpanningHeaderHeight(column) && column.isPadding()) {\n var targetColumn = column;\n nextColumn = targetColumn.getLeafColumns()[0];\n var col = nextColumn;\n while (col !== targetColumn) {\n currentIndex++;\n col = col.getParent();\n }\n }\n return {\n column: nextColumn || column,\n headerRowIndex: currentIndex\n };\n };\n HeaderPositionUtils.prototype.isAnyChildSpanningHeaderHeight = function (columnGroup) {\n if (!columnGroup) {\n return false;\n }\n return columnGroup.getLeafColumns().some(function (col) { return col.isSpanHeaderHeight(); });\n };\n HeaderPositionUtils.prototype.getColumnVisibleParent = function (currentColumn, currentIndex) {\n var currentRowType = this.getHeaderRowType(currentIndex);\n var isFloatingFilter = currentRowType === HeaderRowType.FLOATING_FILTER;\n var isColumn = currentRowType === HeaderRowType.COLUMN;\n var nextFocusColumn = isFloatingFilter ? currentColumn : currentColumn.getParent();\n var nextRow = currentIndex - 1;\n var headerRowIndexWithoutSpan = nextRow;\n if (isColumn && this.isAnyChildSpanningHeaderHeight(currentColumn.getParent())) {\n while (nextFocusColumn && nextFocusColumn.isPadding()) {\n nextFocusColumn = nextFocusColumn.getParent();\n nextRow--;\n }\n headerRowIndexWithoutSpan = nextRow;\n if (nextRow < 0) {\n nextFocusColumn = currentColumn;\n nextRow = currentIndex;\n headerRowIndexWithoutSpan = undefined;\n }\n }\n return { column: nextFocusColumn, headerRowIndex: nextRow, headerRowIndexWithoutSpan: headerRowIndexWithoutSpan };\n };\n HeaderPositionUtils.prototype.getColumnVisibleChild = function (column, currentIndex, direction) {\n if (direction === void 0) { direction = 'After'; }\n var currentRowType = this.getHeaderRowType(currentIndex);\n var nextFocusColumn = column;\n var nextRow = currentIndex + 1;\n var headerRowIndexWithoutSpan = nextRow;\n if (currentRowType === HeaderRowType.COLUMN_GROUP) {\n var leafColumns = column.getDisplayedLeafColumns();\n var leafColumn = direction === 'After' ? leafColumns[0] : last(leafColumns);\n var columnsInTheWay = [];\n var currentColumn = leafColumn;\n while (currentColumn.getParent() !== column) {\n currentColumn = currentColumn.getParent();\n columnsInTheWay.push(currentColumn);\n }\n nextFocusColumn = leafColumn;\n if (leafColumn.isSpanHeaderHeight()) {\n for (var i = columnsInTheWay.length - 1; i >= 0; i--) {\n var colToFocus = columnsInTheWay[i];\n if (!colToFocus.isPadding()) {\n nextFocusColumn = colToFocus;\n break;\n }\n nextRow++;\n }\n }\n else {\n nextFocusColumn = last(columnsInTheWay);\n if (!nextFocusColumn) {\n nextFocusColumn = leafColumn;\n }\n }\n }\n return { column: nextFocusColumn, headerRowIndex: nextRow, headerRowIndexWithoutSpan: headerRowIndexWithoutSpan };\n };\n HeaderPositionUtils.prototype.getHeaderRowType = function (rowIndex) {\n var centerHeaderContainer = this.ctrlsService.getHeaderRowContainerCtrl();\n if (centerHeaderContainer) {\n return centerHeaderContainer.getRowType(rowIndex);\n }\n };\n HeaderPositionUtils.prototype.findColAtEdgeForHeaderRow = function (level, position) {\n var displayedColumns = this.columnModel.getAllDisplayedColumns();\n var column = displayedColumns[position === 'start' ? 0 : displayedColumns.length - 1];\n if (!column) {\n return;\n }\n var childContainer = this.ctrlsService.getHeaderRowContainerCtrl(column.getPinned());\n var type = childContainer.getRowType(level);\n if (type == HeaderRowType.COLUMN_GROUP) {\n var columnGroup = this.columnModel.getColumnGroupAtLevel(column, level);\n return {\n headerRowIndex: level,\n column: columnGroup\n };\n }\n return {\n // if type==null, means the header level didn't exist\n headerRowIndex: type == null ? -1 : level,\n column: column\n };\n };\n __decorate$x([\n Autowired('columnModel')\n ], HeaderPositionUtils.prototype, \"columnModel\", void 0);\n __decorate$x([\n Autowired('ctrlsService')\n ], HeaderPositionUtils.prototype, \"ctrlsService\", void 0);\n HeaderPositionUtils = __decorate$x([\n Bean('headerPositionUtils')\n ], HeaderPositionUtils);\n return HeaderPositionUtils;\n}(BeanStub));\n\nvar __decorate$w = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ColumnDefFactory = /** @class */ (function () {\n function ColumnDefFactory() {\n }\n ColumnDefFactory.prototype.buildColumnDefs = function (cols, rowGroupColumns, pivotColumns) {\n var _this = this;\n var res = [];\n var colGroupDefs = {};\n cols.forEach(function (col) {\n var colDef = _this.createDefFromColumn(col, rowGroupColumns, pivotColumns);\n var addToResult = true;\n var childDef = colDef;\n var pointer = col.getOriginalParent();\n var lastPointer = null;\n while (pointer) {\n var parentDef = null;\n // we don't include padding groups, as the column groups provided\n // by application didn't have these. the whole point of padding groups\n // is to balance the column tree that the user provided.\n if (pointer.isPadding()) {\n pointer = pointer.getOriginalParent();\n continue;\n }\n // if colDef for this group already exists, use it\n var existingParentDef = colGroupDefs[pointer.getGroupId()];\n if (existingParentDef) {\n existingParentDef.children.push(childDef);\n // if we added to result, it would be the second time we did it\n addToResult = false;\n // we don't want to continue up the tree, as it has already been\n // done for this group\n break;\n }\n parentDef = _this.createDefFromGroup(pointer);\n if (parentDef) {\n parentDef.children = [childDef];\n colGroupDefs[parentDef.groupId] = parentDef;\n childDef = parentDef;\n pointer = pointer.getOriginalParent();\n }\n if (pointer != null && lastPointer === pointer) {\n addToResult = false;\n break;\n }\n // Ensure we don't get stuck in an infinite loop\n lastPointer = pointer;\n }\n if (addToResult) {\n res.push(childDef);\n }\n });\n return res;\n };\n ColumnDefFactory.prototype.createDefFromGroup = function (group) {\n var defCloned = deepCloneDefinition(group.getColGroupDef(), ['children']);\n if (defCloned) {\n defCloned.groupId = group.getGroupId();\n }\n return defCloned;\n };\n ColumnDefFactory.prototype.createDefFromColumn = function (col, rowGroupColumns, pivotColumns) {\n var colDefCloned = deepCloneDefinition(col.getColDef());\n colDefCloned.colId = col.getColId();\n colDefCloned.width = col.getActualWidth();\n colDefCloned.rowGroup = col.isRowGroupActive();\n colDefCloned.rowGroupIndex = col.isRowGroupActive() ? rowGroupColumns.indexOf(col) : null;\n colDefCloned.pivot = col.isPivotActive();\n colDefCloned.pivotIndex = col.isPivotActive() ? pivotColumns.indexOf(col) : null;\n colDefCloned.aggFunc = col.isValueActive() ? col.getAggFunc() : null;\n colDefCloned.hide = col.isVisible() ? undefined : true;\n colDefCloned.pinned = col.isPinned() ? col.getPinned() : null;\n colDefCloned.sort = col.getSort() ? col.getSort() : null;\n colDefCloned.sortIndex = col.getSortIndex() != null ? col.getSortIndex() : null;\n return colDefCloned;\n };\n ColumnDefFactory = __decorate$w([\n Bean('columnDefFactory')\n ], ColumnDefFactory);\n return ColumnDefFactory;\n}());\n\nvar __decorate$v = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar RowCssClassCalculator = /** @class */ (function () {\n function RowCssClassCalculator() {\n }\n RowCssClassCalculator.prototype.getInitialRowClasses = function (params) {\n var classes = [];\n if (exists(params.extraCssClass)) {\n classes.push(params.extraCssClass);\n }\n classes.push('ag-row');\n classes.push(params.rowFocused ? 'ag-row-focus' : 'ag-row-no-focus');\n if (params.fadeRowIn) {\n classes.push('ag-opacity-zero');\n }\n classes.push(params.rowIsEven ? 'ag-row-even' : 'ag-row-odd');\n if (params.rowNode.isRowPinned()) {\n classes.push('ag-row-pinned');\n }\n if (params.rowNode.isSelected()) {\n classes.push('ag-row-selected');\n }\n if (params.rowNode.footer) {\n classes.push('ag-row-footer');\n }\n classes.push('ag-row-level-' + params.rowLevel);\n if (params.rowNode.stub) {\n classes.push('ag-row-loading');\n }\n if (params.fullWidthRow) {\n classes.push('ag-full-width-row');\n }\n if (params.expandable) {\n classes.push('ag-row-group');\n classes.push(params.rowNode.expanded ? 'ag-row-group-expanded' : 'ag-row-group-contracted');\n }\n if (params.rowNode.dragging) {\n classes.push('ag-row-dragging');\n }\n pushAll(classes, this.processClassesFromGridOptions(params.rowNode));\n pushAll(classes, this.preProcessRowClassRules(params.rowNode));\n // we use absolute position unless we are doing print layout\n classes.push(params.printLayout ? 'ag-row-position-relative' : 'ag-row-position-absolute');\n if (params.firstRowOnPage) {\n classes.push('ag-row-first');\n }\n if (params.lastRowOnPage) {\n classes.push('ag-row-last');\n }\n if (params.fullWidthRow) {\n if (params.pinned === 'left') {\n classes.push('ag-cell-last-left-pinned');\n }\n if (params.pinned === 'right') {\n classes.push('ag-cell-first-right-pinned');\n }\n }\n return classes;\n };\n RowCssClassCalculator.prototype.processClassesFromGridOptions = function (rowNode) {\n var res = [];\n var process = function (rowCls) {\n if (typeof rowCls === 'string') {\n res.push(rowCls);\n }\n else if (Array.isArray(rowCls)) {\n rowCls.forEach(function (e) { return res.push(e); });\n }\n };\n // part 1 - rowClass\n var rowClass = this.gridOptionsService.get('rowClass');\n if (rowClass) {\n if (typeof rowClass === 'function') {\n console.warn('AG Grid: rowClass should not be a function, please use getRowClass instead');\n return [];\n }\n process(rowClass);\n }\n // part 2 - rowClassFunc\n var rowClassFunc = this.gridOptionsService.getCallback('getRowClass');\n if (rowClassFunc) {\n var params = {\n data: rowNode.data,\n node: rowNode,\n rowIndex: rowNode.rowIndex\n };\n var rowClassFuncResult = rowClassFunc(params);\n process(rowClassFuncResult);\n }\n return res;\n };\n RowCssClassCalculator.prototype.preProcessRowClassRules = function (rowNode) {\n var res = [];\n this.processRowClassRules(rowNode, function (className) {\n res.push(className);\n }, function (className) {\n // not catered for, if creating, no need\n // to remove class as it was never there\n });\n return res;\n };\n RowCssClassCalculator.prototype.processRowClassRules = function (rowNode, onApplicableClass, onNotApplicableClass) {\n var rowClassParams = this.gridOptionsService.addGridCommonParams({\n data: rowNode.data,\n node: rowNode,\n rowIndex: rowNode.rowIndex\n });\n this.stylingService.processClassRules(undefined, this.gridOptionsService.get('rowClassRules'), rowClassParams, onApplicableClass, onNotApplicableClass);\n };\n RowCssClassCalculator.prototype.calculateRowLevel = function (rowNode) {\n if (rowNode.group) {\n return rowNode.level;\n }\n // if a leaf, and a parent exists, put a level of the parent, else put level of 0 for top level item\n return rowNode.parent ? (rowNode.parent.level + 1) : 0;\n };\n __decorate$v([\n Autowired('stylingService')\n ], RowCssClassCalculator.prototype, \"stylingService\", void 0);\n __decorate$v([\n Autowired('gridOptionsService')\n ], RowCssClassCalculator.prototype, \"gridOptionsService\", void 0);\n RowCssClassCalculator = __decorate$v([\n Bean('rowCssClassCalculator')\n ], RowCssClassCalculator);\n return RowCssClassCalculator;\n}());\n\nvar __extends$u = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$u = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n// this logic is used by both SSRM and CSRM\nvar RowNodeSorter = /** @class */ (function (_super) {\n __extends$u(RowNodeSorter, _super);\n function RowNodeSorter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n RowNodeSorter.prototype.init = function () {\n var _this = this;\n this.isAccentedSort = this.gridOptionsService.get('accentedSort');\n this.primaryColumnsSortGroups = this.gridOptionsService.isColumnsSortingCoupledToGroup();\n this.addManagedPropertyListener('accentedSort', function (propChange) { return _this.isAccentedSort = propChange.currentValue; });\n this.addManagedPropertyListener('autoGroupColumnDef', function () { return _this.primaryColumnsSortGroups = _this.gridOptionsService.isColumnsSortingCoupledToGroup(); });\n };\n RowNodeSorter.prototype.doFullSort = function (rowNodes, sortOptions) {\n var mapper = function (rowNode, pos) { return ({ currentPos: pos, rowNode: rowNode }); };\n var sortedRowNodes = rowNodes.map(mapper);\n sortedRowNodes.sort(this.compareRowNodes.bind(this, sortOptions));\n return sortedRowNodes.map(function (item) { return item.rowNode; });\n };\n RowNodeSorter.prototype.compareRowNodes = function (sortOptions, sortedNodeA, sortedNodeB) {\n var nodeA = sortedNodeA.rowNode;\n var nodeB = sortedNodeB.rowNode;\n // Iterate columns, return the first that doesn't match\n for (var i = 0, len = sortOptions.length; i < len; i++) {\n var sortOption = sortOptions[i];\n var isDescending = sortOption.sort === 'desc';\n var valueA = this.getValue(nodeA, sortOption.column);\n var valueB = this.getValue(nodeB, sortOption.column);\n var comparatorResult = void 0;\n var providedComparator = this.getComparator(sortOption, nodeA);\n if (providedComparator) {\n //if comparator provided, use it\n comparatorResult = providedComparator(valueA, valueB, nodeA, nodeB, isDescending);\n }\n else {\n //otherwise do our own comparison\n comparatorResult = _.defaultComparator(valueA, valueB, this.isAccentedSort);\n }\n // user provided comparators can return 'NaN' if they don't correctly handle 'undefined' values, this\n // typically occurs when the comparator is used on a group row\n var validResult = !isNaN(comparatorResult);\n if (validResult && comparatorResult !== 0) {\n return sortOption.sort === 'asc' ? comparatorResult : comparatorResult * -1;\n }\n }\n // All matched, we make is so that the original sort order is kept:\n return sortedNodeA.currentPos - sortedNodeB.currentPos;\n };\n RowNodeSorter.prototype.getComparator = function (sortOption, rowNode) {\n var column = sortOption.column;\n // comparator on col get preference over everything else\n var comparatorOnCol = column.getColDef().comparator;\n if (comparatorOnCol != null) {\n return comparatorOnCol;\n }\n if (!column.getColDef().showRowGroup) {\n return;\n }\n // if a 'field' is supplied on the autoGroupColumnDef we need to use the associated column comparator\n var groupLeafField = !rowNode.group && column.getColDef().field;\n if (!groupLeafField) {\n return;\n }\n var primaryColumn = this.columnModel.getPrimaryColumn(groupLeafField);\n if (!primaryColumn) {\n return;\n }\n return primaryColumn.getColDef().comparator;\n };\n RowNodeSorter.prototype.getValue = function (node, column) {\n var _a, _b;\n if (!this.primaryColumnsSortGroups) {\n return this.valueService.getValue(column, node, false, false);\n }\n var isNodeGroupedAtLevel = node.rowGroupColumn === column;\n if (isNodeGroupedAtLevel) {\n var isGroupRows = this.gridOptionsService.isGroupUseEntireRow(this.columnModel.isPivotActive());\n // because they're group rows, no display cols exist, so groupData never populated.\n // instead delegate to getting value from leaf child.\n if (isGroupRows) {\n var leafChild = (_a = node.allLeafChildren) === null || _a === void 0 ? void 0 : _a[0];\n if (leafChild) {\n return this.valueService.getValue(column, leafChild, false, false);\n }\n return undefined;\n }\n var displayCol = this.columnModel.getGroupDisplayColumnForGroup(column.getId());\n if (!displayCol) {\n return undefined;\n }\n return (_b = node.groupData) === null || _b === void 0 ? void 0 : _b[displayCol.getId()];\n }\n if (node.group && column.getColDef().showRowGroup) {\n return undefined;\n }\n return this.valueService.getValue(column, node, false, false);\n };\n __decorate$u([\n Autowired('valueService')\n ], RowNodeSorter.prototype, \"valueService\", void 0);\n __decorate$u([\n Autowired('columnModel')\n ], RowNodeSorter.prototype, \"columnModel\", void 0);\n __decorate$u([\n PostConstruct\n ], RowNodeSorter.prototype, \"init\", null);\n RowNodeSorter = __decorate$u([\n Bean('rowNodeSorter')\n ], RowNodeSorter);\n return RowNodeSorter;\n}(BeanStub));\n\nvar __extends$t = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$t = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar CtrlsService = /** @class */ (function (_super) {\n __extends$t(CtrlsService, _super);\n function CtrlsService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.ready = false;\n _this.readyCallbacks = [];\n return _this;\n }\n CtrlsService_1 = CtrlsService;\n CtrlsService.prototype.checkReady = function () {\n this.ready =\n this.gridCtrl != null\n && this.gridBodyCtrl != null\n && this.centerRowContainerCtrl != null\n && this.leftRowContainerCtrl != null\n && this.rightRowContainerCtrl != null\n && this.bottomCenterRowContainerCtrl != null\n && this.bottomLeftRowContainerCtrl != null\n && this.bottomRightRowContainerCtrl != null\n && this.topCenterRowContainerCtrl != null\n && this.topLeftRowContainerCtrl != null\n && this.topRightRowContainerCtrl != null\n && this.stickyTopCenterRowContainerCtrl != null\n && this.stickyTopLeftRowContainerCtrl != null\n && this.stickyTopRightRowContainerCtrl != null\n && this.centerHeaderRowContainerCtrl != null\n && this.leftHeaderRowContainerCtrl != null\n && this.rightHeaderRowContainerCtrl != null\n && this.fakeHScrollComp != null\n && this.fakeVScrollComp != null\n && this.gridHeaderCtrl != null;\n if (this.ready) {\n var p_1 = this.createReadyParams();\n this.readyCallbacks.forEach(function (c) { return c(p_1); });\n this.readyCallbacks.length = 0;\n }\n };\n CtrlsService.prototype.whenReady = function (callback) {\n if (this.ready) {\n callback(this.createReadyParams());\n }\n else {\n this.readyCallbacks.push(callback);\n }\n };\n CtrlsService.prototype.createReadyParams = function () {\n return {\n centerRowContainerCtrl: this.centerRowContainerCtrl,\n leftRowContainerCtrl: this.leftRowContainerCtrl,\n rightRowContainerCtrl: this.rightRowContainerCtrl,\n bottomCenterRowContainerCtrl: this.bottomCenterRowContainerCtrl,\n bottomLeftRowContainerCtrl: this.bottomLeftRowContainerCtrl,\n bottomRightRowContainerCtrl: this.bottomRightRowContainerCtrl,\n topCenterRowContainerCtrl: this.topCenterRowContainerCtrl,\n topLeftRowContainerCtrl: this.topLeftRowContainerCtrl,\n topRightRowContainerCtrl: this.topRightRowContainerCtrl,\n stickyTopCenterRowContainerCtrl: this.stickyTopCenterRowContainerCtrl,\n stickyTopLeftRowContainerCtrl: this.stickyTopLeftRowContainerCtrl,\n stickyTopRightRowContainerCtrl: this.stickyTopRightRowContainerCtrl,\n centerHeaderRowContainerCtrl: this.centerHeaderRowContainerCtrl,\n leftHeaderRowContainerCtrl: this.leftHeaderRowContainerCtrl,\n rightHeaderRowContainerCtrl: this.rightHeaderRowContainerCtrl,\n fakeHScrollComp: this.fakeHScrollComp,\n fakeVScrollComp: this.fakeVScrollComp,\n gridBodyCtrl: this.gridBodyCtrl,\n gridCtrl: this.gridCtrl,\n gridHeaderCtrl: this.gridHeaderCtrl,\n };\n };\n CtrlsService.prototype.registerFakeHScrollComp = function (comp) {\n this.fakeHScrollComp = comp;\n this.checkReady();\n };\n CtrlsService.prototype.registerFakeVScrollComp = function (comp) {\n this.fakeVScrollComp = comp;\n this.checkReady();\n };\n CtrlsService.prototype.registerGridHeaderCtrl = function (gridHeaderCtrl) {\n this.gridHeaderCtrl = gridHeaderCtrl;\n this.checkReady();\n };\n CtrlsService.prototype.registerCenterRowContainerCtrl = function (ctrl) {\n this.centerRowContainerCtrl = ctrl;\n this.checkReady();\n };\n CtrlsService.prototype.registerLeftRowContainerCtrl = function (ctrl) {\n this.leftRowContainerCtrl = ctrl;\n this.checkReady();\n };\n CtrlsService.prototype.registerRightRowContainerCtrl = function (ctrl) {\n this.rightRowContainerCtrl = ctrl;\n this.checkReady();\n };\n CtrlsService.prototype.registerTopCenterRowContainerCtrl = function (ctrl) {\n this.topCenterRowContainerCtrl = ctrl;\n this.checkReady();\n };\n CtrlsService.prototype.registerTopLeftRowContainerCon = function (ctrl) {\n this.topLeftRowContainerCtrl = ctrl;\n this.checkReady();\n };\n CtrlsService.prototype.registerTopRightRowContainerCtrl = function (ctrl) {\n this.topRightRowContainerCtrl = ctrl;\n this.checkReady();\n };\n CtrlsService.prototype.registerStickyTopCenterRowContainerCtrl = function (ctrl) {\n this.stickyTopCenterRowContainerCtrl = ctrl;\n this.checkReady();\n };\n CtrlsService.prototype.registerStickyTopLeftRowContainerCon = function (ctrl) {\n this.stickyTopLeftRowContainerCtrl = ctrl;\n this.checkReady();\n };\n CtrlsService.prototype.registerStickyTopRightRowContainerCtrl = function (ctrl) {\n this.stickyTopRightRowContainerCtrl = ctrl;\n this.checkReady();\n };\n CtrlsService.prototype.registerBottomCenterRowContainerCtrl = function (ctrl) {\n this.bottomCenterRowContainerCtrl = ctrl;\n this.checkReady();\n };\n CtrlsService.prototype.registerBottomLeftRowContainerCtrl = function (ctrl) {\n this.bottomLeftRowContainerCtrl = ctrl;\n this.checkReady();\n };\n CtrlsService.prototype.registerBottomRightRowContainerCtrl = function (ctrl) {\n this.bottomRightRowContainerCtrl = ctrl;\n this.checkReady();\n };\n CtrlsService.prototype.registerHeaderContainer = function (ctrl, pinned) {\n switch (pinned) {\n case 'left':\n this.leftHeaderRowContainerCtrl = ctrl;\n break;\n case 'right':\n this.rightHeaderRowContainerCtrl = ctrl;\n break;\n default:\n this.centerHeaderRowContainerCtrl = ctrl;\n break;\n }\n this.checkReady();\n };\n CtrlsService.prototype.registerGridBodyCtrl = function (ctrl) {\n this.gridBodyCtrl = ctrl;\n this.checkReady();\n };\n CtrlsService.prototype.registerGridCtrl = function (ctrl) {\n this.gridCtrl = ctrl;\n this.checkReady();\n };\n CtrlsService.prototype.getFakeHScrollComp = function () {\n return this.fakeHScrollComp;\n };\n CtrlsService.prototype.getFakeVScrollComp = function () {\n return this.fakeVScrollComp;\n };\n CtrlsService.prototype.getGridHeaderCtrl = function () {\n return this.gridHeaderCtrl;\n };\n CtrlsService.prototype.getGridCtrl = function () {\n return this.gridCtrl;\n };\n CtrlsService.prototype.getCenterRowContainerCtrl = function () {\n return this.centerRowContainerCtrl;\n };\n CtrlsService.prototype.getTopCenterRowContainerCtrl = function () {\n return this.topCenterRowContainerCtrl;\n };\n CtrlsService.prototype.getBottomCenterRowContainerCtrl = function () {\n return this.bottomCenterRowContainerCtrl;\n };\n CtrlsService.prototype.getStickyTopCenterRowContainerCtrl = function () {\n return this.stickyTopCenterRowContainerCtrl;\n };\n CtrlsService.prototype.getGridBodyCtrl = function () {\n return this.gridBodyCtrl;\n };\n CtrlsService.prototype.getHeaderRowContainerCtrls = function () {\n return [this.leftHeaderRowContainerCtrl, this.rightHeaderRowContainerCtrl, this.centerHeaderRowContainerCtrl];\n };\n CtrlsService.prototype.getHeaderRowContainerCtrl = function (pinned) {\n switch (pinned) {\n case 'left': return this.leftHeaderRowContainerCtrl;\n case 'right': return this.rightHeaderRowContainerCtrl;\n default: return this.centerHeaderRowContainerCtrl;\n }\n };\n var CtrlsService_1;\n CtrlsService.NAME = 'ctrlsService';\n CtrlsService = CtrlsService_1 = __decorate$t([\n Bean(CtrlsService_1.NAME)\n ], CtrlsService);\n return CtrlsService;\n}(BeanStub));\n\nvar __extends$s = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$s = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar CtrlsFactory = /** @class */ (function (_super) {\n __extends$s(CtrlsFactory, _super);\n function CtrlsFactory() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.registry = {};\n return _this;\n }\n CtrlsFactory.prototype.register = function (meta) {\n this.registry[meta.controllerName] = meta.controllerClass;\n };\n CtrlsFactory.prototype.getInstance = function (name) {\n var ControllerClass = this.registry[name];\n if (ControllerClass == null) {\n return undefined;\n }\n return new ControllerClass();\n };\n CtrlsFactory = __decorate$s([\n Bean('ctrlsFactory')\n ], CtrlsFactory);\n return CtrlsFactory;\n}(BeanStub));\n\nvar __extends$r = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$r = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AbstractFakeScrollComp = /** @class */ (function (_super) {\n __extends$r(AbstractFakeScrollComp, _super);\n function AbstractFakeScrollComp(template, direction) {\n var _this = _super.call(this, template) || this;\n _this.direction = direction;\n _this.hideTimeout = null;\n return _this;\n }\n AbstractFakeScrollComp.prototype.postConstruct = function () {\n this.addManagedListener(this.eventService, Events.EVENT_SCROLL_VISIBILITY_CHANGED, this.onScrollVisibilityChanged.bind(this));\n this.onScrollVisibilityChanged();\n this.addOrRemoveCssClass('ag-apple-scrollbar', isMacOsUserAgent() || isIOSUserAgent());\n };\n AbstractFakeScrollComp.prototype.initialiseInvisibleScrollbar = function () {\n if (this.invisibleScrollbar !== undefined) {\n return;\n }\n this.invisibleScrollbar = isInvisibleScrollbar();\n if (this.invisibleScrollbar) {\n this.hideAndShowInvisibleScrollAsNeeded();\n this.addActiveListenerToggles();\n }\n };\n AbstractFakeScrollComp.prototype.addActiveListenerToggles = function () {\n var _this = this;\n var activateEvents = ['mouseenter', 'mousedown', 'touchstart'];\n var deactivateEvents = ['mouseleave', 'touchend'];\n var eGui = this.getGui();\n activateEvents.forEach(function (eventName) { return _this.addManagedListener(eGui, eventName, function () { return _this.addOrRemoveCssClass('ag-scrollbar-active', true); }); });\n deactivateEvents.forEach(function (eventName) { return _this.addManagedListener(eGui, eventName, function () { return _this.addOrRemoveCssClass('ag-scrollbar-active', false); }); });\n };\n AbstractFakeScrollComp.prototype.onScrollVisibilityChanged = function () {\n var _this = this;\n // initialiseInvisibleScrollbar should only be called once, but the reason\n // this can't be inside `setComp` or `PostConstruct` is the DOM might not\n // be ready, so we call it until eventually, it gets calculated.\n if (this.invisibleScrollbar === undefined) {\n this.initialiseInvisibleScrollbar();\n }\n this.animationFrameService.requestAnimationFrame(function () { return _this.setScrollVisible(); });\n };\n AbstractFakeScrollComp.prototype.hideAndShowInvisibleScrollAsNeeded = function () {\n var _this = this;\n this.addManagedListener(this.eventService, Events.EVENT_BODY_SCROLL, function (params) {\n if (params.direction === _this.direction) {\n if (_this.hideTimeout !== null) {\n window.clearTimeout(_this.hideTimeout);\n _this.hideTimeout = null;\n }\n _this.addOrRemoveCssClass('ag-scrollbar-scrolling', true);\n }\n });\n this.addManagedListener(this.eventService, Events.EVENT_BODY_SCROLL_END, function () {\n _this.hideTimeout = window.setTimeout(function () {\n _this.addOrRemoveCssClass('ag-scrollbar-scrolling', false);\n _this.hideTimeout = null;\n }, 400);\n });\n };\n AbstractFakeScrollComp.prototype.attemptSettingScrollPosition = function (value) {\n var _this = this;\n var viewport = this.getViewport();\n waitUntil(function () { return isVisible(viewport); }, function () { return _this.setScrollPosition(value); }, 100);\n };\n AbstractFakeScrollComp.prototype.getViewport = function () {\n return this.eViewport;\n };\n AbstractFakeScrollComp.prototype.getContainer = function () {\n return this.eContainer;\n };\n AbstractFakeScrollComp.prototype.onScrollCallback = function (fn) {\n this.addManagedListener(this.getViewport(), 'scroll', fn);\n };\n __decorate$r([\n RefSelector('eViewport')\n ], AbstractFakeScrollComp.prototype, \"eViewport\", void 0);\n __decorate$r([\n RefSelector('eContainer')\n ], AbstractFakeScrollComp.prototype, \"eContainer\", void 0);\n __decorate$r([\n Autowired('scrollVisibleService')\n ], AbstractFakeScrollComp.prototype, \"scrollVisibleService\", void 0);\n __decorate$r([\n Autowired('ctrlsService')\n ], AbstractFakeScrollComp.prototype, \"ctrlsService\", void 0);\n __decorate$r([\n Autowired('animationFrameService')\n ], AbstractFakeScrollComp.prototype, \"animationFrameService\", void 0);\n return AbstractFakeScrollComp;\n}(Component));\n\nvar __extends$q = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$q = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar FakeHScrollComp = /** @class */ (function (_super) {\n __extends$q(FakeHScrollComp, _super);\n function FakeHScrollComp() {\n return _super.call(this, FakeHScrollComp.TEMPLATE, 'horizontal') || this;\n }\n FakeHScrollComp.prototype.postConstruct = function () {\n var _this = this;\n _super.prototype.postConstruct.call(this);\n // When doing printing, this changes whether cols are pinned or not\n var spacerWidthsListener = this.setFakeHScrollSpacerWidths.bind(this);\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, spacerWidthsListener);\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, spacerWidthsListener);\n this.addManagedListener(this.eventService, Events.EVENT_PINNED_ROW_DATA_CHANGED, this.onPinnedRowDataChanged.bind(this));\n this.addManagedPropertyListener('domLayout', spacerWidthsListener);\n this.ctrlsService.registerFakeHScrollComp(this);\n this.createManagedBean(new CenterWidthFeature(function (width) { return _this.eContainer.style.width = \"\".concat(width, \"px\"); }));\n this.addManagedPropertyListeners(['suppressHorizontalScroll'], this.onScrollVisibilityChanged.bind(this));\n };\n FakeHScrollComp.prototype.initialiseInvisibleScrollbar = function () {\n if (this.invisibleScrollbar !== undefined) {\n return;\n }\n this.enableRtl = this.gridOptionsService.get('enableRtl');\n _super.prototype.initialiseInvisibleScrollbar.call(this);\n if (this.invisibleScrollbar) {\n this.refreshCompBottom();\n }\n };\n FakeHScrollComp.prototype.onPinnedRowDataChanged = function () {\n this.refreshCompBottom();\n };\n FakeHScrollComp.prototype.refreshCompBottom = function () {\n if (!this.invisibleScrollbar) {\n return;\n }\n var bottomPinnedHeight = this.pinnedRowModel.getPinnedBottomTotalHeight();\n this.getGui().style.bottom = \"\".concat(bottomPinnedHeight, \"px\");\n };\n FakeHScrollComp.prototype.onScrollVisibilityChanged = function () {\n _super.prototype.onScrollVisibilityChanged.call(this);\n this.setFakeHScrollSpacerWidths();\n };\n FakeHScrollComp.prototype.setFakeHScrollSpacerWidths = function () {\n var vScrollShowing = this.scrollVisibleService.isVerticalScrollShowing();\n // we pad the right based on a) if cols are pinned to the right and\n // b) if v scroll is showing on the right (normal position of scroll)\n var rightSpacing = this.columnModel.getDisplayedColumnsRightWidth();\n var scrollOnRight = !this.enableRtl && vScrollShowing;\n var scrollbarWidth = this.gridOptionsService.getScrollbarWidth();\n if (scrollOnRight) {\n rightSpacing += scrollbarWidth;\n }\n setFixedWidth(this.eRightSpacer, rightSpacing);\n this.eRightSpacer.classList.toggle('ag-scroller-corner', rightSpacing <= scrollbarWidth);\n // we pad the left based on a) if cols are pinned to the left and\n // b) if v scroll is showing on the left (happens in LTR layout only)\n var leftSpacing = this.columnModel.getDisplayedColumnsLeftWidth();\n var scrollOnLeft = this.enableRtl && vScrollShowing;\n if (scrollOnLeft) {\n leftSpacing += scrollbarWidth;\n }\n setFixedWidth(this.eLeftSpacer, leftSpacing);\n this.eLeftSpacer.classList.toggle('ag-scroller-corner', leftSpacing <= scrollbarWidth);\n };\n FakeHScrollComp.prototype.setScrollVisible = function () {\n var hScrollShowing = this.scrollVisibleService.isHorizontalScrollShowing();\n var invisibleScrollbar = this.invisibleScrollbar;\n var isSuppressHorizontalScroll = this.gridOptionsService.get('suppressHorizontalScroll');\n var scrollbarWidth = hScrollShowing ? (this.gridOptionsService.getScrollbarWidth() || 0) : 0;\n var adjustedScrollbarWidth = (scrollbarWidth === 0 && invisibleScrollbar) ? 16 : scrollbarWidth;\n var scrollContainerSize = !isSuppressHorizontalScroll ? adjustedScrollbarWidth : 0;\n this.addOrRemoveCssClass('ag-scrollbar-invisible', invisibleScrollbar);\n setFixedHeight(this.getGui(), scrollContainerSize);\n setFixedHeight(this.eViewport, scrollContainerSize);\n setFixedHeight(this.eContainer, scrollContainerSize);\n this.setDisplayed(hScrollShowing, { skipAriaHidden: true });\n };\n FakeHScrollComp.prototype.getScrollPosition = function () {\n return getScrollLeft(this.getViewport(), this.enableRtl);\n };\n FakeHScrollComp.prototype.setScrollPosition = function (value) {\n if (!isVisible(this.getViewport())) {\n this.attemptSettingScrollPosition(value);\n }\n setScrollLeft(this.getViewport(), value, this.enableRtl);\n };\n FakeHScrollComp.TEMPLATE = \"
\\n
\\n
\\n
\\n
\\n
\\n
\";\n __decorate$q([\n RefSelector('eLeftSpacer')\n ], FakeHScrollComp.prototype, \"eLeftSpacer\", void 0);\n __decorate$q([\n RefSelector('eRightSpacer')\n ], FakeHScrollComp.prototype, \"eRightSpacer\", void 0);\n __decorate$q([\n Autowired('columnModel')\n ], FakeHScrollComp.prototype, \"columnModel\", void 0);\n __decorate$q([\n Autowired('pinnedRowModel')\n ], FakeHScrollComp.prototype, \"pinnedRowModel\", void 0);\n __decorate$q([\n PostConstruct\n ], FakeHScrollComp.prototype, \"postConstruct\", null);\n return FakeHScrollComp;\n}(AbstractFakeScrollComp));\n\nvar __extends$p = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$p = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar PinnedWidthService = /** @class */ (function (_super) {\n __extends$p(PinnedWidthService, _super);\n function PinnedWidthService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PinnedWidthService.prototype.postConstruct = function () {\n var listener = this.checkContainerWidths.bind(this);\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, listener);\n this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, listener);\n this.addManagedPropertyListener('domLayout', listener);\n };\n PinnedWidthService.prototype.checkContainerWidths = function () {\n var printLayout = this.gridOptionsService.isDomLayout('print');\n var newLeftWidth = printLayout ? 0 : this.columnModel.getDisplayedColumnsLeftWidth();\n var newRightWidth = printLayout ? 0 : this.columnModel.getDisplayedColumnsRightWidth();\n if (newLeftWidth != this.leftWidth) {\n this.leftWidth = newLeftWidth;\n this.eventService.dispatchEvent({ type: Events.EVENT_LEFT_PINNED_WIDTH_CHANGED });\n }\n if (newRightWidth != this.rightWidth) {\n this.rightWidth = newRightWidth;\n this.eventService.dispatchEvent({ type: Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED });\n }\n };\n PinnedWidthService.prototype.getPinnedRightWidth = function () {\n return this.rightWidth;\n };\n PinnedWidthService.prototype.getPinnedLeftWidth = function () {\n return this.leftWidth;\n };\n __decorate$p([\n Autowired('columnModel')\n ], PinnedWidthService.prototype, \"columnModel\", void 0);\n __decorate$p([\n PostConstruct\n ], PinnedWidthService.prototype, \"postConstruct\", null);\n PinnedWidthService = __decorate$p([\n Bean('pinnedWidthService')\n ], PinnedWidthService);\n return PinnedWidthService;\n}(BeanStub));\n\nvar __extends$o = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$o = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar RowNodeEventThrottle = /** @class */ (function (_super) {\n __extends$o(RowNodeEventThrottle, _super);\n function RowNodeEventThrottle() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.events = [];\n return _this;\n }\n RowNodeEventThrottle.prototype.postConstruct = function () {\n if (this.rowModel.getType() == 'clientSide') {\n this.clientSideRowModel = this.rowModel;\n }\n };\n // because the user can call rowNode.setExpanded() many times in one VM turn,\n // we throttle the calls to ClientSideRowModel using animationFrameService. this means for 100\n // row nodes getting expanded, we only update the CSRM once, and then we fire all events after\n // CSRM has updated.\n //\n // if we did not do this, then the user could call setExpanded on 100+ rows, causing the grid\n // to re-render 100+ times, which would be a performance lag.\n //\n // we use animationFrameService\n // rather than _.debounce() so this will get done if anyone flushes the animationFrameService\n // (eg user calls api.ensureRowVisible(), which in turn flushes ).\n RowNodeEventThrottle.prototype.dispatchExpanded = function (event) {\n var _this = this;\n // if not using CSRM, we don't debounce. otherwise this breaks the SSRM.\n if (this.clientSideRowModel == null) {\n this.eventService.dispatchEvent(event);\n return;\n }\n this.events.push(event);\n var func = function () {\n if (_this.clientSideRowModel) {\n _this.clientSideRowModel.onRowGroupOpened();\n }\n _this.events.forEach(function (e) { return _this.eventService.dispatchEvent(e); });\n _this.events = [];\n };\n if (this.dispatchExpandedDebounced == null) {\n this.dispatchExpandedDebounced = this.animationFrameService.debounce(func);\n }\n this.dispatchExpandedDebounced();\n };\n __decorate$o([\n Autowired('animationFrameService')\n ], RowNodeEventThrottle.prototype, \"animationFrameService\", void 0);\n __decorate$o([\n Autowired('rowModel')\n ], RowNodeEventThrottle.prototype, \"rowModel\", void 0);\n __decorate$o([\n PostConstruct\n ], RowNodeEventThrottle.prototype, \"postConstruct\", null);\n RowNodeEventThrottle = __decorate$o([\n Bean('rowNodeEventThrottle')\n ], RowNodeEventThrottle);\n return RowNodeEventThrottle;\n}(BeanStub));\n\nvar COLUMN_DEFINITION_DEPRECATIONS = {\n columnsMenuParams: { version: '31.1', message: 'Use `columnChooserParams` instead.' },\n suppressMenu: { version: '31.1', message: 'Use `suppressHeaderMenuButton` instead.' },\n};\nvar CSRM_REQUIRES_ROW_GROUP_MODULE = function (_options, gridOptions) {\n var _a;\n if (((_a = gridOptions.rowModelType) !== null && _a !== void 0 ? _a : 'clientSide') === 'clientSide') {\n return { module: ModuleNames.RowGroupingModule };\n }\n return null;\n};\nvar COLUMN_DEFINITION_VALIDATIONS = {\n // supported on all row models, but need module for client side.\n enableRowGroup: CSRM_REQUIRES_ROW_GROUP_MODULE,\n rowGroup: CSRM_REQUIRES_ROW_GROUP_MODULE,\n rowGroupIndex: CSRM_REQUIRES_ROW_GROUP_MODULE,\n enablePivot: CSRM_REQUIRES_ROW_GROUP_MODULE,\n enableValue: CSRM_REQUIRES_ROW_GROUP_MODULE,\n pivot: CSRM_REQUIRES_ROW_GROUP_MODULE,\n pivotIndex: CSRM_REQUIRES_ROW_GROUP_MODULE,\n aggFunc: CSRM_REQUIRES_ROW_GROUP_MODULE,\n cellEditor: function (options) {\n if (options.cellEditor === 'agRichSelect' || options.cellEditor === 'agRichSelectCellEditor') {\n return { module: ModuleNames.RichSelectModule };\n }\n return null;\n },\n menuTabs: function (options) {\n var _a;\n var enterpriseMenuTabs = ['columnsMenuTab', 'generalMenuTab'];\n if ((_a = options.menuTabs) === null || _a === void 0 ? void 0 : _a.some(function (tab) { return enterpriseMenuTabs.includes(tab); })) {\n return {\n module: ModuleNames.MenuModule,\n };\n }\n return null;\n },\n columnsMenuParams: {\n module: [ModuleNames.MenuModule, ModuleNames.ColumnsToolPanelModule],\n },\n columnChooserParams: {\n module: [ModuleNames.MenuModule, ModuleNames.ColumnsToolPanelModule],\n },\n headerCheckboxSelection: {\n supportedRowModels: ['clientSide', 'serverSide'],\n dependencies: function (_options, _a) {\n var rowSelection = _a.rowSelection;\n return (rowSelection === 'multiple' ? null : 'headerCheckboxSelection is only supported with rowSelection=multiple');\n }\n },\n headerCheckboxSelectionFilteredOnly: {\n supportedRowModels: ['clientSide'],\n dependencies: function (_options, _a) {\n var rowSelection = _a.rowSelection;\n return (rowSelection === 'multiple' ? null : 'headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple');\n },\n },\n headerCheckboxSelectionCurrentPageOnly: {\n supportedRowModels: ['clientSide'],\n dependencies: function (_options, _a) {\n var rowSelection = _a.rowSelection;\n return (rowSelection === 'multiple' ? null : 'headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple');\n },\n },\n children: function () { return COL_DEF_VALIDATORS; },\n};\nvar COL_DEF_VALIDATORS = {\n objectName: 'colDef',\n allProperties: ColDefUtil.ALL_PROPERTIES,\n docsUrl: 'column-properties/',\n deprecations: COLUMN_DEFINITION_DEPRECATIONS,\n validations: COLUMN_DEFINITION_VALIDATIONS,\n};\n\nvar __read$a = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$8 = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n/**\n * Deprecations have been kept separately for ease of removing them in the future.\n *\n * If the property was simply renamed, use the `renamed` property. The value will be implicitly copied to the new property.\n */\nvar GRID_OPTION_DEPRECATIONS = {\n enableChartToolPanelsButton: { version: '29', message: 'The Chart Tool Panels button is now enabled by default. To hide the Chart Tool Panels button and display the hamburger button instead, set suppressChartToolPanelsButton=true.' },\n functionsPassive: { version: '29.2' },\n onColumnRowGroupChangeRequest: { version: '29.2' },\n onColumnPivotChangeRequest: { version: '29.2' },\n onColumnValueChangeRequest: { version: '29.2' },\n onColumnAggFuncChangeRequest: { version: '29.2' },\n serverSideFilterAllLevels: { version: '30', message: 'All server-side group levels are now filtered by default. This can be toggled using `serverSideOnlyRefreshFilteredGroups`.' },\n suppressAggAtRootLevel: { version: '30', message: 'The root level aggregation is now suppressed by default. This can be toggled using `alwaysAggregateAtRootLevel`.' },\n excludeHiddenColumnsFromQuickFilter: { version: '30', message: 'Hidden columns are now excluded from the Quick Filter by default. This can be toggled using `includeHiddenColumnsInQuickFilter`.' },\n enterMovesDown: { version: '30', renamed: 'enterNavigatesVertically' },\n enterMovesDownAfterEdit: { version: '30', renamed: 'enterNavigatesVerticallyAfterEdit' },\n suppressParentsInRowNodes: { version: '30.2', message: 'Using suppressParentsInRowNodes is no longer recommended. To serialize nodes it is now recommended to instead remove the parent node reference before serialization.' },\n advancedFilterModel: { version: '31', message: 'Use `initialState.filter.advancedFilterModel` instead.' },\n suppressAsyncEvents: { version: '31', message: 'Events should be handled asynchronously.' },\n cellFadeDelay: { version: '31.1', renamed: 'cellFadeDuration' },\n cellFlashDelay: { version: '31.1', renamed: 'cellFlashDuration' },\n suppressServerSideInfiniteScroll: { version: '31.1' },\n serverSideSortOnServer: { version: '31.1' },\n serverSideFilterOnServer: { version: '31.1' },\n};\n// Leave untyped. so it can be inferred.\nvar GRID_OPTION_DEFAULTS = {\n suppressContextMenu: false,\n preventDefaultOnContextMenu: false,\n allowContextMenuWithControlKey: false,\n suppressMenuHide: false,\n enableBrowserTooltips: false,\n tooltipTrigger: 'hover',\n tooltipShowDelay: 2000,\n tooltipHideDelay: 10000,\n tooltipMouseTrack: false,\n tooltipInteraction: false,\n copyHeadersToClipboard: false,\n copyGroupHeadersToClipboard: false,\n clipboardDelimiter: '\\t',\n suppressCopyRowsToClipboard: false,\n suppressCopySingleCellRanges: false,\n suppressLastEmptyLineOnPaste: false,\n suppressClipboardPaste: false,\n suppressClipboardApi: false,\n suppressCutToClipboard: false,\n maintainColumnOrder: false,\n suppressFieldDotNotation: false,\n allowDragFromColumnsToolPanel: false,\n suppressMovableColumns: false,\n suppressColumnMoveAnimation: false,\n suppressDragLeaveHidesColumns: false,\n suppressRowGroupHidesColumns: false,\n suppressAutoSize: false,\n autoSizePadding: 20,\n skipHeaderOnAutoSize: false,\n singleClickEdit: false,\n suppressClickEdit: false,\n readOnlyEdit: false,\n stopEditingWhenCellsLoseFocus: false,\n enterNavigatesVertically: false,\n enterNavigatesVerticallyAfterEdit: false,\n enableCellEditingOnBackspace: false,\n undoRedoCellEditing: false,\n undoRedoCellEditingLimit: 10,\n suppressCsvExport: false,\n suppressExcelExport: false,\n cacheQuickFilter: false,\n includeHiddenColumnsInQuickFilter: false,\n excludeChildrenWhenTreeDataFiltering: false,\n enableAdvancedFilter: false,\n includeHiddenColumnsInAdvancedFilter: false,\n enableCharts: false,\n suppressChartToolPanelsButton: false,\n masterDetail: false,\n keepDetailRows: false,\n keepDetailRowsCount: 10,\n detailRowAutoHeight: false,\n tabIndex: 0,\n rowBuffer: 10,\n valueCache: false,\n valueCacheNeverExpires: false,\n enableCellExpressions: false,\n suppressTouch: false,\n suppressFocusAfterRefresh: false,\n suppressAsyncEvents: false,\n suppressBrowserResizeObserver: false,\n suppressPropertyNamesCheck: false,\n suppressChangeDetection: false,\n debug: false,\n suppressLoadingOverlay: false,\n suppressNoRowsOverlay: false,\n pagination: false,\n paginationPageSize: 100,\n paginationPageSizeSelector: true,\n paginationAutoPageSize: false,\n paginateChildRows: false,\n suppressPaginationPanel: false,\n pivotMode: false,\n pivotPanelShow: 'never',\n pivotDefaultExpanded: 0,\n pivotSuppressAutoColumn: false,\n suppressExpandablePivotGroups: false,\n functionsReadOnly: false,\n suppressAggFuncInHeader: false,\n alwaysAggregateAtRootLevel: false,\n aggregateOnlyChangedColumns: false,\n suppressAggFilteredOnly: false,\n removePivotHeaderRowWhenSingleValueColumn: false,\n animateRows: true,\n enableCellChangeFlash: false,\n cellFlashDelay: 500,\n cellFlashDuration: 500,\n cellFadeDelay: 1000,\n cellFadeDuration: 1000,\n allowShowChangeAfterFilter: false,\n domLayout: 'normal',\n ensureDomOrder: false,\n enableRtl: false,\n suppressColumnVirtualisation: false,\n suppressMaxRenderedRowRestriction: false,\n suppressRowVirtualisation: false,\n rowDragManaged: false,\n suppressRowDrag: false,\n suppressMoveWhenRowDragging: false,\n rowDragEntireRow: false,\n rowDragMultiRow: false,\n embedFullWidthRows: false,\n groupDisplayType: 'singleColumn',\n groupDefaultExpanded: 0,\n groupMaintainOrder: false,\n groupSelectsChildren: false,\n groupIncludeTotalFooter: false,\n groupSuppressBlankHeader: false,\n groupSelectsFiltered: false,\n showOpenedGroup: false,\n groupRemoveSingleChildren: false,\n groupRemoveLowestSingleChildren: false,\n groupHideOpenParents: false,\n groupAllowUnbalanced: false,\n rowGroupPanelShow: 'never',\n suppressMakeColumnVisibleAfterUnGroup: false,\n treeData: false,\n rowGroupPanelSuppressSort: false,\n suppressGroupRowsSticky: false,\n rowModelType: 'clientSide',\n asyncTransactionWaitMillis: 50,\n suppressModelUpdateAfterUpdateTransaction: false,\n cacheOverflowSize: 1,\n infiniteInitialRowCount: 1,\n serverSideInitialRowCount: 1,\n suppressServerSideInfiniteScroll: false,\n cacheBlockSize: 100,\n maxBlocksInCache: -1,\n maxConcurrentDatasourceRequests: 2,\n blockLoadDebounceMillis: 0,\n purgeClosedRowNodes: false,\n serverSideSortAllLevels: false,\n serverSideOnlyRefreshFilteredGroups: false,\n serverSideSortOnServer: false,\n serverSideFilterOnServer: false,\n serverSidePivotResultFieldSeparator: '_',\n viewportRowModelPageSize: 5,\n viewportRowModelBufferSize: 5,\n alwaysShowHorizontalScroll: false,\n alwaysShowVerticalScroll: false,\n debounceVerticalScrollbar: false,\n suppressHorizontalScroll: false,\n suppressScrollOnNewData: false,\n suppressScrollWhenPopupsAreOpen: false,\n suppressAnimationFrame: false,\n suppressMiddleClickScrolls: false,\n suppressPreventDefaultOnMouseWheel: false,\n rowMultiSelectWithClick: false,\n suppressRowDeselection: false,\n suppressRowClickSelection: false,\n suppressCellFocus: false,\n suppressHeaderFocus: false,\n suppressMultiRangeSelection: false,\n enableCellTextSelection: false,\n enableRangeSelection: false,\n enableRangeHandle: false,\n enableFillHandle: false,\n fillHandleDirection: 'xy',\n suppressClearOnFillReduction: false,\n accentedSort: false,\n unSortIcon: false,\n suppressMultiSort: false,\n alwaysMultiSort: false,\n suppressMaintainUnsortedOrder: false,\n suppressRowHoverHighlight: false,\n suppressRowTransform: false,\n columnHoverHighlight: false,\n deltaSort: false,\n enableGroupEdit: false,\n suppressGroupMaintainValueType: false,\n functionsPassive: false,\n groupLockGroupColumns: 0,\n serverSideEnableClientSideSort: false,\n};\n/**\n * Validation rules for gridOptions\n */\nvar GRID_OPTION_VALIDATIONS = {\n sideBar: { module: ModuleNames.SideBarModule },\n statusBar: { module: ModuleNames.StatusBarModule },\n enableCharts: { module: ModuleNames.GridChartsModule },\n getMainMenuItems: { module: ModuleNames.MenuModule },\n getContextMenuItems: { module: ModuleNames.MenuModule },\n allowContextMenuWithControlKey: { module: ModuleNames.MenuModule },\n enableAdvancedFilter: { module: ModuleNames.AdvancedFilterModule },\n treeData: {\n supportedRowModels: ['clientSide', 'serverSide'],\n module: ModuleNames.RowGroupingModule,\n dependencies: function (options) {\n var _a;\n var rowModel = (_a = options.rowModelType) !== null && _a !== void 0 ? _a : 'clientSide';\n switch (rowModel) {\n case 'clientSide':\n var csrmWarning = \"treeData requires 'getDataPath' in the \".concat(rowModel, \" row model.\");\n return options.getDataPath ? null : csrmWarning;\n case 'serverSide':\n var ssrmWarning = \"treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the \".concat(rowModel, \" row model.\");\n return options.isServerSideGroup && options.getServerSideGroupKey ? null : ssrmWarning;\n }\n return null;\n },\n },\n masterDetail: { module: ModuleNames.MasterDetailModule },\n enableRangeSelection: { module: ModuleNames.RangeSelectionModule },\n enableRangeHandle: {\n dependencies: {\n enableRangeSelection: [true],\n }\n },\n enableFillHandle: {\n dependencies: {\n enableRangeSelection: [true],\n }\n },\n groupDefaultExpanded: {\n supportedRowModels: ['clientSide'],\n },\n groupIncludeFooter: {\n supportedRowModels: ['clientSide', 'serverSide'],\n dependencies: function (options) {\n var _a;\n var rowModel = (_a = options.rowModelType) !== null && _a !== void 0 ? _a : 'clientSide';\n switch (rowModel) {\n case 'clientSide':\n return null;\n case 'serverSide':\n var warning = 'groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll';\n return options.suppressServerSideInfiniteScroll ? warning : null;\n }\n return null;\n },\n },\n groupIncludeTotalFooter: {\n supportedRowModels: ['clientSide'],\n },\n groupRemoveSingleChildren: {\n dependencies: {\n groupHideOpenParents: [undefined, false],\n groupRemoveLowestSingleChildren: [undefined, false],\n }\n },\n groupRemoveLowestSingleChildren: {\n dependencies: {\n groupHideOpenParents: [undefined, false],\n groupRemoveSingleChildren: [undefined, false],\n }\n },\n groupSelectsChildren: {\n dependencies: {\n rowSelection: ['multiple'],\n }\n },\n suppressParentsInRowNodes: {\n dependencies: {\n groupSelectsChildren: [undefined, false],\n },\n },\n viewportDatasource: {\n supportedRowModels: ['viewport'],\n module: ModuleNames.ViewportRowModelModule,\n },\n serverSideDatasource: {\n supportedRowModels: ['serverSide'],\n module: ModuleNames.ServerSideRowModelModule,\n },\n cacheBlockSize: {\n supportedRowModels: ['serverSide', 'infinite'],\n },\n datasource: {\n supportedRowModels: ['infinite'],\n module: ModuleNames.InfiniteRowModelModule,\n },\n rowData: {\n supportedRowModels: ['clientSide'],\n module: ModuleNames.ClientSideRowModelModule,\n },\n columnDefs: function () { return COL_DEF_VALIDATORS; },\n defaultColDef: function () { return COL_DEF_VALIDATORS; },\n defaultColGroupDef: function () { return COL_DEF_VALIDATORS; },\n autoGroupColumnDef: function () { return COL_DEF_VALIDATORS; },\n};\nvar GRID_OPTIONS_VALIDATORS = {\n objectName: 'gridOptions',\n allProperties: __spreadArray$8(__spreadArray$8([], __read$a(PropertyKeys.ALL_PROPERTIES), false), __read$a(ComponentUtil.EVENT_CALLBACKS), false),\n propertyExceptions: ['api', 'columnApi'],\n docsUrl: 'grid-options/',\n deprecations: GRID_OPTION_DEPRECATIONS,\n validations: GRID_OPTION_VALIDATIONS,\n};\n\nvar __decorate$n = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$9 = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$7 = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar GridOptionsService = /** @class */ (function () {\n function GridOptionsService() {\n var _this = this;\n this.destroyed = false;\n this.domDataKey = '__AG_' + Math.random().toString();\n this.propertyEventService = new EventService();\n // responsible for calling the onXXX functions on gridOptions\n // It forces events defined in GridOptionsService.alwaysSyncGlobalEvents to be fired synchronously.\n // This is required for events such as GridPreDestroyed.\n // Other events can be fired asynchronously or synchronously depending on config.\n this.globalEventHandlerFactory = function (restrictToSyncOnly) {\n return function (eventName, event) {\n // prevent events from being fired _after_ the grid has been destroyed\n if (_this.destroyed) {\n return;\n }\n var alwaysSync = GridOptionsService_1.alwaysSyncGlobalEvents.has(eventName);\n if ((alwaysSync && !restrictToSyncOnly) || (!alwaysSync && restrictToSyncOnly)) {\n return;\n }\n var eventHandlerName = ComponentUtil.getCallbackForEvent(eventName);\n var eventHandler = _this.gridOptions[eventHandlerName];\n if (typeof eventHandler === 'function') {\n _this.frameworkOverrides.wrapOutgoing(function () {\n eventHandler(event);\n });\n }\n };\n };\n }\n GridOptionsService_1 = GridOptionsService;\n Object.defineProperty(GridOptionsService.prototype, \"context\", {\n // This is quicker then having code call gridOptionsService.get('context')\n get: function () {\n return this.gridOptions['context'];\n },\n enumerable: false,\n configurable: true\n });\n GridOptionsService.prototype.init = function () {\n this.columnApi = new ColumnApi(this.api);\n var async = !this.get('suppressAsyncEvents');\n this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this), async);\n this.eventService.addGlobalListener(this.globalEventHandlerFactory(true).bind(this), false);\n // Ensure the propertyEventService has framework overrides set so that it can fire events outside of angular\n this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides);\n // sets an initial calculation for the scrollbar width\n this.getScrollbarWidth();\n };\n GridOptionsService.prototype.destroy = function () {\n this.destroyed = true;\n this.columnApi = undefined;\n };\n /**\n * Get the raw value of the GridOptions property provided.\n * @param property\n */\n GridOptionsService.prototype.get = function (property) {\n var _a;\n return (_a = this.gridOptions[property]) !== null && _a !== void 0 ? _a : GRID_OPTION_DEFAULTS[property];\n };\n /**\n * Get the GridOption callback but wrapped so that the common params of api,columnApi and context are automatically applied to the params.\n * @param property GridOption callback properties based on the fact that this property has a callback with params extending AgGridCommon\n */\n GridOptionsService.prototype.getCallback = function (property) {\n return this.mergeGridCommonParams(this.gridOptions[property]);\n };\n /**\n * Returns `true` if a value has been specified for this GridOption.\n * @param property GridOption property\n */\n GridOptionsService.prototype.exists = function (property) {\n return exists(this.gridOptions[property]);\n };\n /**\n * Wrap the user callback and attach the api, columnApi and context to the params object on the way through.\n * @param callback User provided callback\n * @returns Wrapped callback where the params object not require api, columnApi and context\n */\n GridOptionsService.prototype.mergeGridCommonParams = function (callback) {\n var _this = this;\n if (callback) {\n var wrapped = function (callbackParams) {\n var mergedParams = callbackParams;\n mergedParams.api = _this.api;\n mergedParams.columnApi = _this.columnApi;\n mergedParams.context = _this.context;\n return callback(mergedParams);\n };\n return wrapped;\n }\n return callback;\n };\n GridOptionsService.toBoolean = function (value) {\n if (typeof value === 'boolean') {\n return value;\n }\n if (typeof value === 'string') {\n // for boolean, compare to empty String to allow attributes appearing with\n // no value to be treated as 'true'\n return value.toUpperCase() === 'TRUE' || value == '';\n }\n return false;\n };\n GridOptionsService.toNumber = function (value) {\n if (typeof value === 'number') {\n return value;\n }\n if (typeof value === 'string') {\n var parsed = parseInt(value);\n if (isNaN(parsed)) {\n return undefined;\n }\n return parsed;\n }\n return undefined;\n };\n GridOptionsService.toConstrainedNum = function (min, max) {\n return function (value) {\n var num = GridOptionsService_1.toNumber(value);\n if (num == null || num < min || num > max) {\n return undefined; // return undefined if outside bounds, this will then be coerced to the default value.\n }\n return num;\n };\n };\n GridOptionsService.getCoercedValue = function (key, value) {\n var coerceFunc = GridOptionsService_1.PROPERTY_COERCIONS.get(key);\n if (!coerceFunc) {\n return value;\n }\n return coerceFunc(value);\n };\n GridOptionsService.getCoercedGridOptions = function (gridOptions) {\n var newGo = {};\n Object.entries(gridOptions).forEach(function (_a) {\n var _b = __read$9(_a, 2), key = _b[0], value = _b[1];\n var coercedValue = GridOptionsService_1.getCoercedValue(key, value);\n newGo[key] = coercedValue;\n });\n return newGo;\n };\n GridOptionsService.prototype.updateGridOptions = function (_a) {\n var _this = this;\n var options = _a.options, _b = _a.source, source = _b === void 0 ? 'api' : _b;\n var changeSet = { id: GridOptionsService_1.changeSetId++, properties: [] };\n // all events are fired after grid options has finished updating.\n var events = [];\n Object.entries(options).forEach(function (_a) {\n var _b = __read$9(_a, 2), key = _b[0], value = _b[1];\n if (source === 'api' && INITIAL_GRID_OPTION_KEYS[key]) {\n warnOnce(\"\".concat(key, \" is an initial property and cannot be updated.\"));\n }\n var coercedValue = GridOptionsService_1.getCoercedValue(key, value);\n var shouldForce = (typeof coercedValue) === 'object' && source === 'api'; // force objects as they could have been mutated.\n var previousValue = _this.gridOptions[key];\n if (shouldForce || previousValue !== coercedValue) {\n _this.gridOptions[key] = coercedValue;\n var event_1 = {\n type: key,\n currentValue: coercedValue,\n previousValue: previousValue,\n changeSet: changeSet,\n source: source\n };\n events.push(event_1);\n }\n });\n this.validationService.processGridOptions(this.gridOptions);\n // changeSet should just include the properties that have changed.\n changeSet.properties = events.map(function (event) { return event.type; });\n events.forEach(function (event) {\n if (_this.gridOptions.debug) {\n console.log(\"AG Grid: Updated property \".concat(event.type, \" from \"), event.previousValue, ' to ', event.currentValue);\n }\n _this.propertyEventService.dispatchEvent(event);\n });\n };\n GridOptionsService.prototype.addEventListener = function (key, listener) {\n this.propertyEventService.addEventListener(key, listener);\n };\n GridOptionsService.prototype.removeEventListener = function (key, listener) {\n this.propertyEventService.removeEventListener(key, listener);\n };\n // *************** Helper methods ************************** //\n // Methods to share common GridOptions related logic that goes above accessing a single property\n // the user might be using some non-standard scrollbar, eg a scrollbar that has zero\n // width and overlays (like the Safari scrollbar, but presented in Chrome). so we\n // allow the user to provide the scroll width before we work it out.\n GridOptionsService.prototype.getScrollbarWidth = function () {\n if (this.scrollbarWidth == null) {\n var useGridOptions = typeof this.gridOptions.scrollbarWidth === 'number' && this.gridOptions.scrollbarWidth >= 0;\n var scrollbarWidth = useGridOptions ? this.gridOptions.scrollbarWidth : getScrollbarWidth();\n if (scrollbarWidth != null) {\n this.scrollbarWidth = scrollbarWidth;\n this.eventService.dispatchEvent({\n type: Events.EVENT_SCROLLBAR_WIDTH_CHANGED\n });\n }\n }\n return this.scrollbarWidth;\n };\n GridOptionsService.prototype.isRowModelType = function (rowModelType) {\n return this.gridOptions.rowModelType === rowModelType ||\n (rowModelType === 'clientSide' && missing(this.gridOptions.rowModelType));\n };\n GridOptionsService.prototype.isDomLayout = function (domLayout) {\n var _a;\n var gridLayout = (_a = this.gridOptions.domLayout) !== null && _a !== void 0 ? _a : 'normal';\n return gridLayout === domLayout;\n };\n GridOptionsService.prototype.isRowSelection = function () {\n return this.gridOptions.rowSelection === 'single' || this.gridOptions.rowSelection === 'multiple';\n };\n GridOptionsService.prototype.useAsyncEvents = function () {\n return !this.get('suppressAsyncEvents');\n };\n GridOptionsService.prototype.isGetRowHeightFunction = function () {\n return typeof this.gridOptions.getRowHeight === 'function';\n };\n GridOptionsService.prototype.getRowHeightForNode = function (rowNode, allowEstimate, defaultRowHeight) {\n if (allowEstimate === void 0) { allowEstimate = false; }\n if (defaultRowHeight == null) {\n defaultRowHeight = this.environment.getDefaultRowHeight();\n }\n // check the function first, in case use set both function and\n // number, when using virtual pagination then function can be\n // used for pinned rows and the number for the body rows.\n if (this.isGetRowHeightFunction()) {\n if (allowEstimate) {\n return { height: defaultRowHeight, estimated: true };\n }\n var params = {\n node: rowNode,\n data: rowNode.data\n };\n var height = this.getCallback('getRowHeight')(params);\n if (this.isNumeric(height)) {\n if (height === 0) {\n warnOnce('The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead.');\n }\n return { height: Math.max(1, height), estimated: false };\n }\n }\n if (rowNode.detail && this.get('masterDetail')) {\n return this.getMasterDetailRowHeight();\n }\n var rowHeight = this.gridOptions.rowHeight && this.isNumeric(this.gridOptions.rowHeight) ? this.gridOptions.rowHeight : defaultRowHeight;\n return { height: rowHeight, estimated: false };\n };\n GridOptionsService.prototype.getMasterDetailRowHeight = function () {\n // if autoHeight, we want the height to grow to the new height starting at 1, as otherwise a flicker would happen,\n // as the detail goes to the default (eg 200px) and then immediately shrink up/down to the new measured height\n // (due to auto height) which looks bad, especially if doing row animation.\n if (this.get('detailRowAutoHeight')) {\n return { height: 1, estimated: false };\n }\n if (this.isNumeric(this.gridOptions.detailRowHeight)) {\n return { height: this.gridOptions.detailRowHeight, estimated: false };\n }\n return { height: 300, estimated: false };\n };\n // we don't allow dynamic row height for virtual paging\n GridOptionsService.prototype.getRowHeightAsNumber = function () {\n if (!this.gridOptions.rowHeight || missing(this.gridOptions.rowHeight)) {\n return this.environment.getDefaultRowHeight();\n }\n var rowHeight = this.environment.refreshRowHeightVariable();\n if (rowHeight !== -1) {\n return rowHeight;\n }\n console.warn('AG Grid row height must be a number if not using standard row model');\n return this.environment.getDefaultRowHeight();\n };\n GridOptionsService.prototype.isNumeric = function (value) {\n return !isNaN(value) && typeof value === 'number' && isFinite(value);\n };\n GridOptionsService.prototype.getDomDataKey = function () {\n return this.domDataKey;\n };\n // returns the dom data, or undefined if not found\n GridOptionsService.prototype.getDomData = function (element, key) {\n var domData = element[this.getDomDataKey()];\n return domData ? domData[key] : undefined;\n };\n GridOptionsService.prototype.setDomData = function (element, key, value) {\n var domDataKey = this.getDomDataKey();\n var domData = element[domDataKey];\n if (missing(domData)) {\n domData = {};\n element[domDataKey] = domData;\n }\n domData[key] = value;\n };\n GridOptionsService.prototype.getDocument = function () {\n // if user is providing document, we use the users one,\n // otherwise we use the document on the global namespace.\n var result = null;\n if (this.gridOptions.getDocument && exists(this.gridOptions.getDocument)) {\n result = this.gridOptions.getDocument();\n }\n else if (this.eGridDiv) {\n result = this.eGridDiv.ownerDocument;\n }\n if (result && exists(result)) {\n return result;\n }\n return document;\n };\n GridOptionsService.prototype.getWindow = function () {\n var eDocument = this.getDocument();\n return eDocument.defaultView || window;\n };\n GridOptionsService.prototype.getRootNode = function () {\n return this.eGridDiv.getRootNode();\n };\n GridOptionsService.prototype.getAsyncTransactionWaitMillis = function () {\n return exists(this.gridOptions.asyncTransactionWaitMillis) ? this.gridOptions.asyncTransactionWaitMillis : 50;\n };\n GridOptionsService.prototype.isAnimateRows = function () {\n // never allow animating if enforcing the row order\n if (this.get('ensureDomOrder')) {\n return false;\n }\n return this.get('animateRows');\n };\n GridOptionsService.prototype.isGroupRowsSticky = function () {\n if (this.get('suppressGroupRowsSticky') ||\n this.get('paginateChildRows') ||\n this.get('groupHideOpenParents') ||\n this.isDomLayout('print')) {\n return false;\n }\n return true;\n };\n GridOptionsService.prototype.isColumnsSortingCoupledToGroup = function () {\n var autoGroupColumnDef = this.gridOptions.autoGroupColumnDef;\n return !(autoGroupColumnDef === null || autoGroupColumnDef === void 0 ? void 0 : autoGroupColumnDef.comparator) && !this.get('treeData');\n };\n GridOptionsService.prototype.getGroupAggFiltering = function () {\n var userValue = this.gridOptions.groupAggFiltering;\n if (typeof userValue === 'function') {\n return this.getCallback('groupAggFiltering');\n }\n if (userValue === true) {\n return function () { return true; };\n }\n return undefined;\n };\n GridOptionsService.prototype.isGroupIncludeFooterTrueOrCallback = function () {\n var userValue = this.gridOptions.groupIncludeFooter;\n return userValue === true || typeof userValue === 'function';\n };\n GridOptionsService.prototype.getGroupIncludeFooter = function () {\n var userValue = this.gridOptions.groupIncludeFooter;\n if (typeof userValue === 'function') {\n return this.getCallback('groupIncludeFooter');\n }\n if (userValue === true) {\n return function () { return true; };\n }\n return function () { return false; };\n };\n GridOptionsService.prototype.isGroupMultiAutoColumn = function () {\n if (this.gridOptions.groupDisplayType) {\n return this.gridOptions.groupDisplayType === 'multipleColumns';\n }\n // if we are doing hideOpenParents we also show multiple columns, otherwise hideOpenParents would not work\n return this.get('groupHideOpenParents');\n };\n GridOptionsService.prototype.isGroupUseEntireRow = function (pivotMode) {\n // we never allow groupDisplayType = 'groupRows' if in pivot mode, otherwise we won't see the pivot values.\n if (pivotMode) {\n return false;\n }\n return this.gridOptions.groupDisplayType === 'groupRows';\n };\n GridOptionsService.prototype.getGridCommonParams = function () {\n return {\n api: this.api,\n columnApi: this.columnApi,\n context: this.context\n };\n };\n GridOptionsService.prototype.addGridCommonParams = function (params) {\n var updatedParams = params;\n updatedParams.api = this.api;\n updatedParams.columnApi = this.columnApi;\n updatedParams.context = this.context;\n return updatedParams;\n };\n var GridOptionsService_1;\n GridOptionsService.alwaysSyncGlobalEvents = new Set([Events.EVENT_GRID_PRE_DESTROYED]);\n /**\n * Handles value coercion including validation of ranges etc. If value is invalid, undefined is set, allowing default to be used.\n */\n GridOptionsService.PROPERTY_COERCIONS = new Map(__spreadArray$7(__spreadArray$7(__spreadArray$7([], __read$9(PropertyKeys.BOOLEAN_PROPERTIES.map(function (key) { return [key, GridOptionsService_1.toBoolean]; })), false), __read$9(PropertyKeys.NUMBER_PROPERTIES.map(function (key) { return [key, GridOptionsService_1.toNumber]; })), false), [\n ['groupAggFiltering', function (val) { return typeof val === 'function' ? val : GridOptionsService_1.toBoolean(val); }],\n ['pageSize', GridOptionsService_1.toConstrainedNum(1, Number.MAX_VALUE)],\n ['autoSizePadding', GridOptionsService_1.toConstrainedNum(0, Number.MAX_VALUE)],\n ['keepDetailRowsCount', GridOptionsService_1.toConstrainedNum(1, Number.MAX_VALUE)],\n ['rowBuffer', GridOptionsService_1.toConstrainedNum(0, Number.MAX_VALUE)],\n ['infiniteInitialRowCount', GridOptionsService_1.toConstrainedNum(1, Number.MAX_VALUE)],\n ['cacheOverflowSize', GridOptionsService_1.toConstrainedNum(1, Number.MAX_VALUE)],\n ['cacheBlockSize', GridOptionsService_1.toConstrainedNum(1, Number.MAX_VALUE)],\n ['serverSideInitialRowCount', GridOptionsService_1.toConstrainedNum(1, Number.MAX_VALUE)],\n ['viewportRowModelPageSize', GridOptionsService_1.toConstrainedNum(1, Number.MAX_VALUE)],\n ['viewportRowModelBufferSize', GridOptionsService_1.toConstrainedNum(0, Number.MAX_VALUE)],\n ], false));\n GridOptionsService.changeSetId = 0;\n __decorate$n([\n Autowired('gridOptions')\n ], GridOptionsService.prototype, \"gridOptions\", void 0);\n __decorate$n([\n Autowired('eventService')\n ], GridOptionsService.prototype, \"eventService\", void 0);\n __decorate$n([\n Autowired('environment')\n ], GridOptionsService.prototype, \"environment\", void 0);\n __decorate$n([\n Autowired('frameworkOverrides')\n ], GridOptionsService.prototype, \"frameworkOverrides\", void 0);\n __decorate$n([\n Autowired('eGridDiv')\n ], GridOptionsService.prototype, \"eGridDiv\", void 0);\n __decorate$n([\n Autowired('validationService')\n ], GridOptionsService.prototype, \"validationService\", void 0);\n __decorate$n([\n Autowired('gridApi')\n ], GridOptionsService.prototype, \"api\", void 0);\n __decorate$n([\n PostConstruct\n ], GridOptionsService.prototype, \"init\", null);\n __decorate$n([\n PreDestroy\n ], GridOptionsService.prototype, \"destroy\", null);\n GridOptionsService = GridOptionsService_1 = __decorate$n([\n Bean('gridOptionsService')\n ], GridOptionsService);\n return GridOptionsService;\n}());\n\nvar __extends$n = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$m = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar LocaleService = /** @class */ (function (_super) {\n __extends$n(LocaleService, _super);\n function LocaleService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n LocaleService.prototype.getLocaleTextFunc = function () {\n var getLocaleText = this.gridOptionsService.getCallback('getLocaleText');\n if (getLocaleText) {\n //key: string, defaultValue: string, variableValues?: string[]\n return function (key, defaultValue, variableValues) {\n var params = {\n key: key,\n defaultValue: defaultValue,\n variableValues: variableValues\n };\n return getLocaleText(params);\n };\n }\n var localeText = this.gridOptionsService.get('localeText');\n return function (key, defaultValue, variableValues) {\n var localisedText = localeText && localeText[key];\n if (localisedText && variableValues && variableValues.length) {\n var found = 0;\n while (true) {\n if (found >= variableValues.length) {\n break;\n }\n var idx = localisedText.indexOf('${variable}');\n if (idx === -1) {\n break;\n }\n localisedText = localisedText.replace('${variable}', variableValues[found++]);\n }\n }\n return localisedText !== null && localisedText !== void 0 ? localisedText : defaultValue;\n };\n };\n LocaleService = __decorate$m([\n Bean('localeService')\n ], LocaleService);\n return LocaleService;\n}(BeanStub));\n\nvar __extends$m = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$l = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar FakeVScrollComp = /** @class */ (function (_super) {\n __extends$m(FakeVScrollComp, _super);\n function FakeVScrollComp() {\n return _super.call(this, FakeVScrollComp.TEMPLATE, 'vertical') || this;\n }\n FakeVScrollComp.prototype.postConstruct = function () {\n _super.prototype.postConstruct.call(this);\n this.createManagedBean(new SetHeightFeature(this.eContainer));\n this.ctrlsService.registerFakeVScrollComp(this);\n this.addManagedListener(this.eventService, Events.EVENT_ROW_CONTAINER_HEIGHT_CHANGED, this.onRowContainerHeightChanged.bind(this));\n };\n FakeVScrollComp.prototype.setScrollVisible = function () {\n var vScrollShowing = this.scrollVisibleService.isVerticalScrollShowing();\n var invisibleScrollbar = this.invisibleScrollbar;\n var scrollbarWidth = vScrollShowing ? (this.gridOptionsService.getScrollbarWidth() || 0) : 0;\n var adjustedScrollbarWidth = (scrollbarWidth === 0 && invisibleScrollbar) ? 16 : scrollbarWidth;\n this.addOrRemoveCssClass('ag-scrollbar-invisible', invisibleScrollbar);\n setFixedWidth(this.getGui(), adjustedScrollbarWidth);\n setFixedWidth(this.eViewport, adjustedScrollbarWidth);\n setFixedWidth(this.eContainer, adjustedScrollbarWidth);\n this.setDisplayed(vScrollShowing, { skipAriaHidden: true });\n };\n FakeVScrollComp.prototype.onRowContainerHeightChanged = function () {\n var ctrlsService = this.ctrlsService;\n var gridBodyCtrl = ctrlsService.getGridBodyCtrl();\n var gridBodyViewportEl = gridBodyCtrl.getBodyViewportElement();\n var eViewportScrollTop = this.getScrollPosition();\n var gridBodyViewportScrollTop = gridBodyViewportEl.scrollTop;\n if (eViewportScrollTop != gridBodyViewportScrollTop) {\n this.setScrollPosition(gridBodyViewportScrollTop, true);\n }\n };\n FakeVScrollComp.prototype.getScrollPosition = function () {\n return this.getViewport().scrollTop;\n };\n FakeVScrollComp.prototype.setScrollPosition = function (value, force) {\n if (!force && !isVisible(this.getViewport())) {\n this.attemptSettingScrollPosition(value);\n }\n this.getViewport().scrollTop = value;\n };\n FakeVScrollComp.TEMPLATE = \"
\\n
\\n
\\n
\\n
\";\n __decorate$l([\n PostConstruct\n ], FakeVScrollComp.prototype, \"postConstruct\", null);\n return FakeVScrollComp;\n}(AbstractFakeScrollComp));\n\nvar __extends$l = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$3 = ( false) || function () {\n __assign$3 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$3.apply(this, arguments);\n};\nvar __decorate$k = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$8 = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$6 = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar MONTH_LOCALE_TEXT = {\n january: 'January',\n february: 'February',\n march: 'March',\n april: 'April',\n may: 'May',\n june: 'June',\n july: 'July',\n august: 'August',\n september: 'September',\n october: 'October',\n november: 'November',\n december: 'December'\n};\nvar MONTH_KEYS = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'];\nvar DataTypeService = /** @class */ (function (_super) {\n __extends$l(DataTypeService, _super);\n function DataTypeService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.dataTypeDefinitions = {};\n _this.isWaitingForRowData = false;\n _this.isColumnTypeOverrideInDataTypeDefinitions = false;\n // keep track of any column state updates whilst waiting for data types to be inferred\n _this.columnStateUpdatesPendingInference = {};\n _this.columnStateUpdateListenerDestroyFuncs = [];\n return _this;\n }\n DataTypeService.prototype.init = function () {\n var _this = this;\n this.groupHideOpenParents = this.gridOptionsService.get('groupHideOpenParents');\n this.addManagedPropertyListener('groupHideOpenParents', function () {\n _this.groupHideOpenParents = _this.gridOptionsService.get('groupHideOpenParents');\n });\n this.processDataTypeDefinitions();\n this.addManagedPropertyListener('dataTypeDefinitions', function (event) {\n _this.processDataTypeDefinitions();\n _this.columnModel.recreateColumnDefs(convertSourceType(event.source));\n });\n };\n DataTypeService.prototype.processDataTypeDefinitions = function () {\n var _this = this;\n var _a;\n var defaultDataTypes = this.getDefaultDataTypes();\n this.dataTypeDefinitions = {};\n Object.entries(defaultDataTypes).forEach(function (_a) {\n var _b = __read$8(_a, 2), cellDataType = _b[0], dataTypeDefinition = _b[1];\n _this.dataTypeDefinitions[cellDataType] = __assign$3(__assign$3({}, dataTypeDefinition), { groupSafeValueFormatter: _this.createGroupSafeValueFormatter(dataTypeDefinition) });\n });\n var dataTypeDefinitions = (_a = this.gridOptionsService.get('dataTypeDefinitions')) !== null && _a !== void 0 ? _a : {};\n this.dataTypeMatchers = {};\n Object.entries(dataTypeDefinitions).forEach(function (_a) {\n var _b = __read$8(_a, 2), cellDataType = _b[0], dataTypeDefinition = _b[1];\n var mergedDataTypeDefinition = _this.processDataTypeDefinition(dataTypeDefinition, dataTypeDefinitions, [cellDataType], defaultDataTypes);\n if (mergedDataTypeDefinition) {\n _this.dataTypeDefinitions[cellDataType] = mergedDataTypeDefinition;\n if (dataTypeDefinition.dataTypeMatcher) {\n _this.dataTypeMatchers[cellDataType] = dataTypeDefinition.dataTypeMatcher;\n }\n }\n });\n this.checkObjectValueHandlers(defaultDataTypes);\n ['dateString', 'text', 'number', 'boolean', 'date'].forEach(function (cellDataType) {\n var overriddenDataTypeMatcher = _this.dataTypeMatchers[cellDataType];\n if (overriddenDataTypeMatcher) {\n // remove to maintain correct ordering\n delete _this.dataTypeMatchers[cellDataType];\n }\n _this.dataTypeMatchers[cellDataType] = overriddenDataTypeMatcher !== null && overriddenDataTypeMatcher !== void 0 ? overriddenDataTypeMatcher : defaultDataTypes[cellDataType].dataTypeMatcher;\n });\n };\n DataTypeService.prototype.mergeDataTypeDefinitions = function (parentDataTypeDefinition, childDataTypeDefinition) {\n var mergedDataTypeDefinition = __assign$3(__assign$3({}, parentDataTypeDefinition), childDataTypeDefinition);\n if (parentDataTypeDefinition.columnTypes &&\n childDataTypeDefinition.columnTypes &&\n childDataTypeDefinition.appendColumnTypes) {\n mergedDataTypeDefinition.columnTypes = __spreadArray$6(__spreadArray$6([], __read$8(this.convertColumnTypes(parentDataTypeDefinition.columnTypes)), false), __read$8(this.convertColumnTypes(childDataTypeDefinition.columnTypes)), false);\n }\n return mergedDataTypeDefinition;\n };\n DataTypeService.prototype.processDataTypeDefinition = function (dataTypeDefinition, dataTypeDefinitions, alreadyProcessedDataTypes, defaultDataTypes) {\n var mergedDataTypeDefinition;\n var extendsCellDataType = dataTypeDefinition.extendsDataType;\n if (dataTypeDefinition.columnTypes) {\n this.isColumnTypeOverrideInDataTypeDefinitions = true;\n }\n if (dataTypeDefinition.extendsDataType === dataTypeDefinition.baseDataType) {\n var baseDataTypeDefinition = defaultDataTypes[extendsCellDataType];\n var overriddenBaseDataTypeDefinition = dataTypeDefinitions[extendsCellDataType];\n if (baseDataTypeDefinition && overriddenBaseDataTypeDefinition) {\n // only if it's valid do we override with a provided one\n baseDataTypeDefinition = overriddenBaseDataTypeDefinition;\n }\n if (!this.validateDataTypeDefinition(dataTypeDefinition, baseDataTypeDefinition, extendsCellDataType)) {\n return undefined;\n }\n mergedDataTypeDefinition = this.mergeDataTypeDefinitions(baseDataTypeDefinition, dataTypeDefinition);\n }\n else {\n if (alreadyProcessedDataTypes.includes(extendsCellDataType)) {\n warnOnce('Data type definition hierarchies (via the \"extendsDataType\" property) cannot contain circular references.');\n return undefined;\n }\n var extendedDataTypeDefinition = dataTypeDefinitions[extendsCellDataType];\n if (!this.validateDataTypeDefinition(dataTypeDefinition, extendedDataTypeDefinition, extendsCellDataType)) {\n return undefined;\n }\n var mergedExtendedDataTypeDefinition = this.processDataTypeDefinition(extendedDataTypeDefinition, dataTypeDefinitions, __spreadArray$6(__spreadArray$6([], __read$8(alreadyProcessedDataTypes), false), [extendsCellDataType], false), defaultDataTypes);\n if (!mergedExtendedDataTypeDefinition) {\n return undefined;\n }\n mergedDataTypeDefinition = this.mergeDataTypeDefinitions(mergedExtendedDataTypeDefinition, dataTypeDefinition);\n }\n return __assign$3(__assign$3({}, mergedDataTypeDefinition), { groupSafeValueFormatter: this.createGroupSafeValueFormatter(mergedDataTypeDefinition) });\n };\n DataTypeService.prototype.validateDataTypeDefinition = function (dataTypeDefinition, parentDataTypeDefinition, parentCellDataType) {\n if (!parentDataTypeDefinition) {\n warnOnce(\"The data type definition \".concat(parentCellDataType, \" does not exist.\"));\n return false;\n }\n if (parentDataTypeDefinition.baseDataType !== dataTypeDefinition.baseDataType) {\n warnOnce('The \"baseDataType\" property of a data type definition must match that of its parent.');\n return false;\n }\n return true;\n };\n DataTypeService.prototype.createGroupSafeValueFormatter = function (dataTypeDefinition) {\n var _this = this;\n if (!dataTypeDefinition.valueFormatter) {\n return undefined;\n }\n return function (params) {\n var _a, _b;\n if ((_a = params.node) === null || _a === void 0 ? void 0 : _a.group) {\n var aggFunc = params.column.getAggFunc();\n if (aggFunc) {\n // the resulting type of these will be the same, so we call valueFormatter anyway\n if (aggFunc === 'first' || aggFunc === 'last') {\n return dataTypeDefinition.valueFormatter(params);\n }\n if (dataTypeDefinition.baseDataType === 'number' && aggFunc !== 'count') {\n if (typeof params.value === 'number') {\n return dataTypeDefinition.valueFormatter(params);\n }\n if (typeof params.value === 'object') {\n if (!params.value) {\n return undefined;\n }\n if ('toNumber' in params.value) {\n return dataTypeDefinition.valueFormatter(__assign$3(__assign$3({}, params), { value: params.value.toNumber() }));\n }\n if ('value' in params.value) {\n return dataTypeDefinition.valueFormatter(__assign$3(__assign$3({}, params), { value: params.value.value }));\n }\n }\n }\n }\n // we don't want to double format the value\n // as this is already formatted by using the valueFormatter as the keyCreator\n if (!_this.gridOptionsService.get('suppressGroupMaintainValueType')) {\n return undefined;\n }\n }\n else if (_this.groupHideOpenParents && params.column.isRowGroupActive()) {\n // `groupHideOpenParents` passes leaf values in the group column, so need to format still.\n // If it's not a string, we know it hasn't been formatted. Otherwise check the data type matcher.\n if (typeof params.value !== 'string' || ((_b = dataTypeDefinition.dataTypeMatcher) === null || _b === void 0 ? void 0 : _b.call(dataTypeDefinition, params.value))) {\n return dataTypeDefinition.valueFormatter(params);\n }\n // we don't want to double format the value\n // as this is already formatted by using the valueFormatter as the keyCreator\n if (!_this.gridOptionsService.get('suppressGroupMaintainValueType')) {\n return undefined;\n }\n }\n return dataTypeDefinition.valueFormatter(params);\n };\n };\n DataTypeService.prototype.updateColDefAndGetDataTypeDefinitionColumnType = function (colDef, userColDef, colId) {\n var cellDataType = userColDef.cellDataType;\n var field = userColDef.field;\n if (cellDataType === undefined) {\n cellDataType = colDef.cellDataType;\n }\n if ((cellDataType == null || cellDataType === true)) {\n cellDataType = this.canInferCellDataType(colDef, userColDef) ? this.inferCellDataType(field, colId) : false;\n }\n if (!cellDataType) {\n colDef.cellDataType = false;\n return undefined;\n }\n var dataTypeDefinition = this.dataTypeDefinitions[cellDataType];\n if (!dataTypeDefinition) {\n warnOnce(\"Missing data type definition - \\\"\".concat(cellDataType, \"\\\"\"));\n return undefined;\n }\n colDef.cellDataType = cellDataType;\n if (dataTypeDefinition.groupSafeValueFormatter) {\n colDef.valueFormatter = dataTypeDefinition.groupSafeValueFormatter;\n }\n if (dataTypeDefinition.valueParser) {\n colDef.valueParser = dataTypeDefinition.valueParser;\n }\n if (!dataTypeDefinition.suppressDefaultProperties) {\n this.setColDefPropertiesForBaseDataType(colDef, dataTypeDefinition, colId);\n }\n return dataTypeDefinition.columnTypes;\n };\n DataTypeService.prototype.updateColDefAndGetColumnType = function (colDef, userColDef, colId) {\n var _a, _b;\n var dataTypeDefinitionColumnType = this.updateColDefAndGetDataTypeDefinitionColumnType(colDef, userColDef, colId);\n var columnTypes = (_b = (_a = userColDef.type) !== null && _a !== void 0 ? _a : dataTypeDefinitionColumnType) !== null && _b !== void 0 ? _b : colDef.type;\n colDef.type = columnTypes;\n return columnTypes ? this.convertColumnTypes(columnTypes) : undefined;\n };\n DataTypeService.prototype.addColumnListeners = function (column) {\n if (!this.isWaitingForRowData) {\n return;\n }\n var columnStateUpdates = this.columnStateUpdatesPendingInference[column.getColId()];\n if (!columnStateUpdates) {\n return;\n }\n var columnListener = function (event) {\n columnStateUpdates.add(event.key);\n };\n column.addEventListener(Column.EVENT_STATE_UPDATED, columnListener);\n this.columnStateUpdateListenerDestroyFuncs.push(function () { return column.removeEventListener(Column.EVENT_STATE_UPDATED, columnListener); });\n };\n DataTypeService.prototype.canInferCellDataType = function (colDef, userColDef) {\n var _this = this;\n var _a;\n if (this.rowModel.getType() !== 'clientSide') {\n return false;\n }\n var propsToCheckForInference = { cellRenderer: true, valueGetter: true, valueParser: true, refData: true };\n if (this.doColDefPropsPreventInference(userColDef, propsToCheckForInference)) {\n return false;\n }\n var columnTypes = userColDef.type === null ? colDef.type : userColDef.type;\n if (columnTypes) {\n var columnTypeDefs_1 = (_a = this.gridOptionsService.get('columnTypes')) !== null && _a !== void 0 ? _a : {};\n var hasPropsPreventingInference = this.convertColumnTypes(columnTypes).some(function (columnType) {\n var columnTypeDef = columnTypeDefs_1[columnType.trim()];\n return columnTypeDef && _this.doColDefPropsPreventInference(columnTypeDef, propsToCheckForInference);\n });\n if (hasPropsPreventingInference) {\n return false;\n }\n }\n return !this.doColDefPropsPreventInference(colDef, propsToCheckForInference);\n };\n DataTypeService.prototype.doColDefPropsPreventInference = function (colDef, propsToCheckForInference) {\n var _this = this;\n return [\n ['cellRenderer', 'agSparklineCellRenderer'], ['valueGetter', undefined], ['valueParser', undefined], ['refData', undefined]\n ].some(function (_a) {\n var _b = __read$8(_a, 2), prop = _b[0], comparisonValue = _b[1];\n return _this.doesColDefPropPreventInference(colDef, propsToCheckForInference, prop, comparisonValue);\n });\n };\n DataTypeService.prototype.doesColDefPropPreventInference = function (colDef, checkProps, prop, comparisonValue) {\n if (!checkProps[prop]) {\n return false;\n }\n var value = colDef[prop];\n if (value === null) {\n checkProps[prop] = false;\n return false;\n }\n else {\n return comparisonValue === undefined ? !!value : value === comparisonValue;\n }\n };\n DataTypeService.prototype.inferCellDataType = function (field, colId) {\n var _a;\n if (!field) {\n return undefined;\n }\n var value;\n var initialData = this.getInitialData();\n if (initialData) {\n var fieldContainsDots = field.indexOf('.') >= 0 && !this.gridOptionsService.get('suppressFieldDotNotation');\n value = getValueUsingField(initialData, field, fieldContainsDots);\n }\n else {\n this.initWaitForRowData(colId);\n }\n if (value == null) {\n return undefined;\n }\n var _b = __read$8((_a = Object.entries(this.dataTypeMatchers).find(function (_a) {\n var _b = __read$8(_a, 2); _b[0]; var dataTypeMatcher = _b[1];\n return dataTypeMatcher(value);\n })) !== null && _a !== void 0 ? _a : ['object'], 1), cellDataType = _b[0];\n return cellDataType;\n };\n DataTypeService.prototype.getInitialData = function () {\n var rowData = this.gridOptionsService.get('rowData');\n if (rowData === null || rowData === void 0 ? void 0 : rowData.length) {\n return rowData[0];\n }\n else if (this.initialData) {\n return this.initialData;\n }\n else {\n var rowNodes = this.rowModel\n .getRootNode()\n .allLeafChildren;\n if (rowNodes === null || rowNodes === void 0 ? void 0 : rowNodes.length) {\n return rowNodes[0].data;\n }\n }\n return null;\n };\n DataTypeService.prototype.initWaitForRowData = function (colId) {\n var _this = this;\n this.columnStateUpdatesPendingInference[colId] = new Set();\n if (this.isWaitingForRowData) {\n return;\n }\n this.isWaitingForRowData = true;\n var columnTypeOverridesExist = this.isColumnTypeOverrideInDataTypeDefinitions;\n if (columnTypeOverridesExist) {\n this.columnModel.queueResizeOperations();\n }\n var destroyFunc = this.addManagedListener(this.eventService, Events.EVENT_ROW_DATA_UPDATE_STARTED, function (event) {\n var firstRowData = event.firstRowData;\n if (!firstRowData) {\n return;\n }\n destroyFunc === null || destroyFunc === void 0 ? void 0 : destroyFunc();\n _this.isWaitingForRowData = false;\n _this.processColumnsPendingInference(firstRowData, columnTypeOverridesExist);\n _this.columnStateUpdatesPendingInference = {};\n if (columnTypeOverridesExist) {\n _this.columnModel.processResizeOperations();\n }\n var dataTypesInferredEvent = {\n type: Events.EVENT_DATA_TYPES_INFERRED\n };\n _this.eventService.dispatchEvent(dataTypesInferredEvent);\n });\n };\n DataTypeService.prototype.isPendingInference = function () {\n return this.isWaitingForRowData;\n };\n DataTypeService.prototype.processColumnsPendingInference = function (firstRowData, columnTypeOverridesExist) {\n var _this = this;\n this.initialData = firstRowData;\n var state = [];\n this.columnStateUpdateListenerDestroyFuncs.forEach(function (destroyFunc) { return destroyFunc(); });\n this.columnStateUpdateListenerDestroyFuncs = [];\n var newRowGroupColumnStateWithoutIndex = {};\n var newPivotColumnStateWithoutIndex = {};\n Object.entries(this.columnStateUpdatesPendingInference).forEach(function (_a) {\n var _b = __read$8(_a, 2), colId = _b[0], columnStateUpdates = _b[1];\n var column = _this.columnModel.getGridColumn(colId);\n if (!column) {\n return;\n }\n var oldColDef = column.getColDef();\n if (!_this.columnModel.resetColumnDefIntoColumn(column, 'cellDataTypeInferred')) {\n return;\n }\n var newColDef = column.getColDef();\n if (columnTypeOverridesExist && newColDef.type && newColDef.type !== oldColDef.type) {\n var updatedColumnState = _this.getUpdatedColumnState(column, columnStateUpdates);\n if (updatedColumnState.rowGroup && updatedColumnState.rowGroupIndex == null) {\n newRowGroupColumnStateWithoutIndex[colId] = updatedColumnState;\n }\n if (updatedColumnState.pivot && updatedColumnState.pivotIndex == null) {\n newPivotColumnStateWithoutIndex[colId] = updatedColumnState;\n }\n state.push(updatedColumnState);\n }\n });\n if (columnTypeOverridesExist) {\n state.push.apply(state, __spreadArray$6([], __read$8(this.columnModel.generateColumnStateForRowGroupAndPivotIndexes(newRowGroupColumnStateWithoutIndex, newPivotColumnStateWithoutIndex)), false));\n }\n if (state.length) {\n this.columnModel.applyColumnState({ state: state }, 'cellDataTypeInferred');\n }\n this.initialData = null;\n };\n DataTypeService.prototype.getUpdatedColumnState = function (column, columnStateUpdates) {\n var columnState = this.columnModel.getColumnStateFromColDef(column);\n columnStateUpdates.forEach(function (key) {\n // if the column state has been updated, don't update again\n delete columnState[key];\n if (key === 'rowGroup') {\n delete columnState.rowGroupIndex;\n }\n else if (key === 'pivot') {\n delete columnState.pivotIndex;\n }\n });\n return columnState;\n };\n DataTypeService.prototype.checkObjectValueHandlers = function (defaultDataTypes) {\n var resolvedObjectDataTypeDefinition = this.dataTypeDefinitions.object;\n var defaultObjectDataTypeDefinition = defaultDataTypes.object;\n this.hasObjectValueParser = resolvedObjectDataTypeDefinition.valueParser !== defaultObjectDataTypeDefinition.valueParser;\n this.hasObjectValueFormatter = resolvedObjectDataTypeDefinition.valueFormatter !== defaultObjectDataTypeDefinition.valueFormatter;\n };\n DataTypeService.prototype.convertColumnTypes = function (type) {\n var typeKeys = [];\n if (type instanceof Array) {\n var invalidArray = type.some(function (a) { return typeof a !== 'string'; });\n if (invalidArray) {\n console.warn(\"if colDef.type is supplied an array it should be of type 'string[]'\");\n }\n else {\n typeKeys = type;\n }\n }\n else if (typeof type === 'string') {\n typeKeys = type.split(',');\n }\n else {\n console.warn(\"colDef.type should be of type 'string' | 'string[]'\");\n }\n return typeKeys;\n };\n DataTypeService.prototype.getDateStringTypeDefinition = function (column) {\n var _a;\n if (!column) {\n return this.dataTypeDefinitions.dateString;\n }\n return ((_a = this.getDataTypeDefinition(column)) !== null && _a !== void 0 ? _a : this.dataTypeDefinitions.dateString);\n };\n DataTypeService.prototype.getDateParserFunction = function (column) {\n return this.getDateStringTypeDefinition(column).dateParser;\n };\n DataTypeService.prototype.getDateFormatterFunction = function (column) {\n return this.getDateStringTypeDefinition(column).dateFormatter;\n };\n DataTypeService.prototype.getDataTypeDefinition = function (column) {\n var colDef = column.getColDef();\n if (!colDef.cellDataType) {\n return undefined;\n }\n return this.dataTypeDefinitions[colDef.cellDataType];\n };\n DataTypeService.prototype.getBaseDataType = function (column) {\n var _a;\n return (_a = this.getDataTypeDefinition(column)) === null || _a === void 0 ? void 0 : _a.baseDataType;\n };\n DataTypeService.prototype.checkType = function (column, value) {\n var _a;\n if (value == null) {\n return true;\n }\n var dataTypeMatcher = (_a = this.getDataTypeDefinition(column)) === null || _a === void 0 ? void 0 : _a.dataTypeMatcher;\n if (!dataTypeMatcher) {\n return true;\n }\n return dataTypeMatcher(value);\n };\n DataTypeService.prototype.validateColDef = function (colDef) {\n if (colDef.cellDataType === 'object') {\n if (colDef.valueFormatter === this.dataTypeDefinitions.object.groupSafeValueFormatter && !this.hasObjectValueFormatter) {\n warnOnce('Cell data type is \"object\" but no value formatter has been provided. Please either provide an object data type definition with a value formatter, or set \"colDef.valueFormatter\"');\n }\n if (colDef.editable && colDef.valueParser === this.dataTypeDefinitions.object.valueParser && !this.hasObjectValueParser) {\n warnOnce('Cell data type is \"object\" but no value parser has been provided. Please either provide an object data type definition with a value parser, or set \"colDef.valueParser\"');\n }\n }\n };\n DataTypeService.prototype.setColDefPropertiesForBaseDataType = function (colDef, dataTypeDefinition, colId) {\n var _this = this;\n var formatValue = function (column, node, value) {\n var valueFormatter = column.getColDef().valueFormatter;\n if (valueFormatter === dataTypeDefinition.groupSafeValueFormatter) {\n valueFormatter = dataTypeDefinition.valueFormatter;\n }\n return _this.valueFormatterService.formatValue(column, node, value, valueFormatter);\n };\n var usingSetFilter = ModuleRegistry.__isRegistered(ModuleNames.SetFilterModule, this.context.getGridId());\n var translate = this.localeService.getLocaleTextFunc();\n var mergeFilterParams = function (params) {\n var filterParams = colDef.filterParams;\n colDef.filterParams = typeof filterParams === 'object' ? __assign$3(__assign$3({}, filterParams), params) : params;\n };\n switch (dataTypeDefinition.baseDataType) {\n case 'number': {\n colDef.cellEditor = 'agNumberCellEditor';\n if (usingSetFilter) {\n mergeFilterParams({\n comparator: function (a, b) {\n var valA = a == null ? 0 : parseInt(a);\n var valB = b == null ? 0 : parseInt(b);\n if (valA === valB)\n return 0;\n return valA > valB ? 1 : -1;\n },\n });\n }\n break;\n }\n case 'boolean': {\n colDef.cellEditor = 'agCheckboxCellEditor';\n colDef.cellRenderer = 'agCheckboxCellRenderer';\n colDef.suppressKeyboardEvent = function (params) { return !!params.colDef.editable && params.event.key === KeyCode.SPACE; };\n if (usingSetFilter) {\n mergeFilterParams({\n valueFormatter: function (params) {\n if (!exists(params.value)) {\n return translate('blanks', '(Blanks)');\n }\n return translate(String(params.value), params.value ? 'True' : 'False');\n }\n });\n }\n else {\n mergeFilterParams({\n maxNumConditions: 1,\n debounceMs: 0,\n filterOptions: [\n 'empty',\n {\n displayKey: 'true',\n displayName: 'True',\n predicate: function (_filterValues, cellValue) { return cellValue; },\n numberOfInputs: 0,\n },\n {\n displayKey: 'false',\n displayName: 'False',\n predicate: function (_filterValues, cellValue) { return cellValue === false; },\n numberOfInputs: 0,\n },\n ]\n });\n }\n break;\n }\n case 'date': {\n colDef.cellEditor = 'agDateCellEditor';\n colDef.keyCreator = function (params) { return formatValue(params.column, params.node, params.value); };\n if (usingSetFilter) {\n mergeFilterParams({\n valueFormatter: function (params) {\n var valueFormatted = formatValue(params.column, params.node, params.value);\n return exists(valueFormatted) ? valueFormatted : translate('blanks', '(Blanks)');\n },\n treeList: true,\n treeListFormatter: function (pathKey, level) {\n if (level === 1 && pathKey != null) {\n var monthKey = MONTH_KEYS[Number(pathKey) - 1];\n return translate(monthKey, MONTH_LOCALE_TEXT[monthKey]);\n }\n return pathKey !== null && pathKey !== void 0 ? pathKey : translate('blanks', '(Blanks)');\n }\n });\n }\n break;\n }\n case 'dateString': {\n colDef.cellEditor = 'agDateStringCellEditor';\n colDef.keyCreator = function (params) { return formatValue(params.column, params.node, params.value); };\n var convertToDate_1 = dataTypeDefinition.dateParser;\n if (usingSetFilter) {\n mergeFilterParams({\n valueFormatter: function (params) {\n var valueFormatted = formatValue(params.column, params.node, params.value);\n return exists(valueFormatted) ? valueFormatted : translate('blanks', '(Blanks)');\n },\n treeList: true,\n treeListPathGetter: function (value) {\n var date = convertToDate_1(value !== null && value !== void 0 ? value : undefined);\n return date ? [String(date.getFullYear()), String(date.getMonth() + 1), String(date.getDate())] : null;\n },\n treeListFormatter: function (pathKey, level) {\n if (level === 1 && pathKey != null) {\n var monthKey = MONTH_KEYS[Number(pathKey) - 1];\n return translate(monthKey, MONTH_LOCALE_TEXT[monthKey]);\n }\n return pathKey !== null && pathKey !== void 0 ? pathKey : translate('blanks', '(Blanks)');\n }\n });\n }\n else {\n mergeFilterParams({\n comparator: function (filterDate, cellValue) {\n var cellAsDate = convertToDate_1(cellValue);\n if (cellValue == null || cellAsDate < filterDate) {\n return -1;\n }\n if (cellAsDate > filterDate) {\n return 1;\n }\n return 0;\n }\n });\n }\n break;\n }\n case 'object': {\n colDef.cellEditorParams = {\n useFormatter: true,\n };\n colDef.comparator = function (a, b) {\n var column = _this.columnModel.getPrimaryColumn(colId);\n var colDef = column === null || column === void 0 ? void 0 : column.getColDef();\n if (!column || !colDef) {\n return 0;\n }\n var valA = a == null ? '' : formatValue(column, null, a);\n var valB = b == null ? '' : formatValue(column, null, b);\n if (valA === valB)\n return 0;\n return valA > valB ? 1 : -1;\n };\n colDef.keyCreator = function (params) { return formatValue(params.column, params.node, params.value); };\n if (usingSetFilter) {\n mergeFilterParams({\n valueFormatter: function (params) {\n var valueFormatted = formatValue(params.column, params.node, params.value);\n return exists(valueFormatted) ? valueFormatted : translate('blanks', '(Blanks)');\n }\n });\n }\n else {\n colDef.filterValueGetter = function (params) { return formatValue(params.column, params.node, _this.valueService.getValue(params.column, params.node)); };\n }\n break;\n }\n }\n };\n DataTypeService.prototype.getDefaultDataTypes = function () {\n var defaultDateFormatMatcher = function (value) { return !!value.match('^\\\\d{4}-\\\\d{2}-\\\\d{2}$'); };\n var translate = this.localeService.getLocaleTextFunc();\n return {\n number: {\n baseDataType: 'number',\n // can be empty space with legacy copy\n valueParser: function (params) {\n var _a, _b;\n return ((_b = (_a = params.newValue) === null || _a === void 0 ? void 0 : _a.trim) === null || _b === void 0 ? void 0 : _b.call(_a)) === ''\n ? null\n : Number(params.newValue);\n },\n valueFormatter: function (params) {\n if (params.value == null) {\n return '';\n }\n if (typeof params.value !== 'number' || isNaN(params.value)) {\n return translate('invalidNumber', 'Invalid Number');\n }\n return String(params.value);\n },\n dataTypeMatcher: function (value) { return typeof value === 'number'; },\n },\n text: {\n baseDataType: 'text',\n valueParser: function (params) { return params.newValue === '' ? null : toStringOrNull(params.newValue); },\n dataTypeMatcher: function (value) { return typeof value === 'string'; },\n },\n boolean: {\n baseDataType: 'boolean',\n valueParser: function (params) {\n var _a, _b;\n if (params.newValue == null) {\n return params.newValue;\n }\n // can be empty space with legacy copy\n return ((_b = (_a = params.newValue) === null || _a === void 0 ? void 0 : _a.trim) === null || _b === void 0 ? void 0 : _b.call(_a)) === ''\n ? null\n : String(params.newValue).toLowerCase() === 'true';\n },\n valueFormatter: function (params) { return params.value == null ? '' : String(params.value); },\n dataTypeMatcher: function (value) { return typeof value === 'boolean'; },\n },\n date: {\n baseDataType: 'date',\n valueParser: function (params) { return parseDateTimeFromString(params.newValue == null ? null : String(params.newValue)); },\n valueFormatter: function (params) {\n var _a;\n if (params.value == null) {\n return '';\n }\n if (!(params.value instanceof Date) || isNaN(params.value.getTime())) {\n return translate('invalidDate', 'Invalid Date');\n }\n return (_a = serialiseDate(params.value, false)) !== null && _a !== void 0 ? _a : '';\n },\n dataTypeMatcher: function (value) { return value instanceof Date; },\n },\n dateString: {\n baseDataType: 'dateString',\n dateParser: function (value) { var _a; return (_a = parseDateTimeFromString(value)) !== null && _a !== void 0 ? _a : undefined; },\n dateFormatter: function (value) { var _a; return (_a = serialiseDate(value !== null && value !== void 0 ? value : null, false)) !== null && _a !== void 0 ? _a : undefined; },\n valueParser: function (params) { return defaultDateFormatMatcher(String(params.newValue)) ? params.newValue : null; },\n valueFormatter: function (params) { return defaultDateFormatMatcher(String(params.value)) ? params.value : ''; },\n dataTypeMatcher: function (value) { return typeof value === 'string' && defaultDateFormatMatcher(value); },\n },\n object: {\n baseDataType: 'object',\n valueParser: function () { return null; },\n valueFormatter: function (params) { var _a; return (_a = toStringOrNull(params.value)) !== null && _a !== void 0 ? _a : ''; },\n }\n };\n };\n __decorate$k([\n Autowired('rowModel')\n ], DataTypeService.prototype, \"rowModel\", void 0);\n __decorate$k([\n Autowired('columnModel')\n ], DataTypeService.prototype, \"columnModel\", void 0);\n __decorate$k([\n Autowired('columnUtils')\n ], DataTypeService.prototype, \"columnUtils\", void 0);\n __decorate$k([\n Autowired('valueService')\n ], DataTypeService.prototype, \"valueService\", void 0);\n __decorate$k([\n Autowired('valueFormatterService')\n ], DataTypeService.prototype, \"valueFormatterService\", void 0);\n __decorate$k([\n PostConstruct\n ], DataTypeService.prototype, \"init\", null);\n DataTypeService = __decorate$k([\n Bean('dataTypeService')\n ], DataTypeService);\n return DataTypeService;\n}(BeanStub));\n\nvar __extends$k = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$j = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ValueParserService = /** @class */ (function (_super) {\n __extends$k(ValueParserService, _super);\n function ValueParserService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ValueParserService.prototype.parseValue = function (column, rowNode, newValue, oldValue) {\n var colDef = column.getColDef();\n var params = this.gridOptionsService.addGridCommonParams({\n node: rowNode,\n data: rowNode === null || rowNode === void 0 ? void 0 : rowNode.data,\n oldValue: oldValue,\n newValue: newValue,\n colDef: colDef,\n column: column\n });\n var valueParser = colDef.valueParser;\n if (exists(valueParser)) {\n if (typeof valueParser === 'function') {\n return valueParser(params);\n }\n return this.expressionService.evaluate(valueParser, params);\n }\n return newValue;\n };\n __decorate$j([\n Autowired('expressionService')\n ], ValueParserService.prototype, \"expressionService\", void 0);\n ValueParserService = __decorate$j([\n Bean('valueParserService')\n ], ValueParserService);\n return ValueParserService;\n}(BeanStub));\n\nvar __extends$j = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$i = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SyncService = /** @class */ (function (_super) {\n __extends$j(SyncService, _super);\n function SyncService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.waitingForColumns = false;\n return _this;\n }\n SyncService.prototype.postConstruct = function () {\n var _this = this;\n this.addManagedPropertyListener('columnDefs', function (event) { return _this.setColumnDefs(event); });\n };\n SyncService.prototype.start = function () {\n var _this = this;\n // we wait until the UI has finished initialising before setting in columns and rows\n this.ctrlsService.whenReady(function () {\n var columnDefs = _this.gridOptionsService.get('columnDefs');\n if (columnDefs) {\n _this.setColumnsAndData(columnDefs);\n }\n else {\n _this.waitingForColumns = true;\n }\n _this.gridReady();\n });\n };\n SyncService.prototype.setColumnsAndData = function (columnDefs) {\n this.columnModel.setColumnDefs(columnDefs !== null && columnDefs !== void 0 ? columnDefs : [], \"gridInitializing\");\n this.rowModel.start();\n };\n SyncService.prototype.gridReady = function () {\n var _this = this;\n this.dispatchGridReadyEvent();\n var isEnterprise = ModuleRegistry.__isRegistered(ModuleNames.EnterpriseCoreModule, this.context.getGridId());\n var logger = new Logger('AG Grid', function () { return _this.gridOptionsService.get('debug'); });\n logger.log(\"initialised successfully, enterprise = \".concat(isEnterprise));\n };\n SyncService.prototype.dispatchGridReadyEvent = function () {\n var readyEvent = {\n type: Events.EVENT_GRID_READY,\n };\n this.eventService.dispatchEvent(readyEvent);\n };\n SyncService.prototype.setColumnDefs = function (event) {\n var columnDefs = this.gridOptionsService.get('columnDefs');\n if (!columnDefs) {\n return;\n }\n if (this.waitingForColumns) {\n this.waitingForColumns = false;\n this.setColumnsAndData(columnDefs);\n return;\n }\n this.columnModel.setColumnDefs(columnDefs, convertSourceType(event.source));\n };\n __decorate$i([\n Autowired('ctrlsService')\n ], SyncService.prototype, \"ctrlsService\", void 0);\n __decorate$i([\n Autowired('columnModel')\n ], SyncService.prototype, \"columnModel\", void 0);\n __decorate$i([\n Autowired('rowModel')\n ], SyncService.prototype, \"rowModel\", void 0);\n __decorate$i([\n PostConstruct\n ], SyncService.prototype, \"postConstruct\", null);\n SyncService = __decorate$i([\n Bean('syncService')\n ], SyncService);\n return SyncService;\n}(BeanStub));\n\nvar __extends$i = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$2 = ( false) || function () {\n __assign$2 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$2.apply(this, arguments);\n};\nvar __decorate$h = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar OverlayService = /** @class */ (function (_super) {\n __extends$i(OverlayService, _super);\n function OverlayService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.manuallyDisplayed = false;\n return _this;\n }\n OverlayService.prototype.postConstruct = function () {\n var _this = this;\n this.addManagedListener(this.eventService, Events.EVENT_ROW_DATA_UPDATED, function () { return _this.onRowDataUpdated(); });\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, function () { return _this.onNewColumnsLoaded(); });\n };\n OverlayService.prototype.registerOverlayWrapperComp = function (overlayWrapperComp) {\n this.overlayWrapperComp = overlayWrapperComp;\n if (!this.gridOptionsService.get('columnDefs') ||\n (this.gridOptionsService.isRowModelType('clientSide') && !this.gridOptionsService.get('rowData'))) {\n this.showLoadingOverlay();\n }\n };\n OverlayService.prototype.showLoadingOverlay = function () {\n if (this.gridOptionsService.get('suppressLoadingOverlay')) {\n return;\n }\n var params = {};\n var compDetails = this.userComponentFactory.getLoadingOverlayCompDetails(params);\n this.showOverlay(compDetails, 'ag-overlay-loading-wrapper', 'loadingOverlayComponentParams');\n };\n OverlayService.prototype.showNoRowsOverlay = function () {\n if (this.gridOptionsService.get('suppressNoRowsOverlay')) {\n return;\n }\n var params = {};\n var compDetails = this.userComponentFactory.getNoRowsOverlayCompDetails(params);\n this.showOverlay(compDetails, 'ag-overlay-no-rows-wrapper', 'noRowsOverlayComponentParams');\n };\n OverlayService.prototype.showOverlay = function (compDetails, wrapperCssClass, gridOption) {\n var _this = this;\n var promise = compDetails.newAgStackInstance();\n var listenerDestroyFunc = this.addManagedPropertyListener(gridOption, function (_a) {\n var currentValue = _a.currentValue;\n promise.then(function (comp) {\n if (comp.refresh) {\n comp.refresh(_this.gridOptionsService.addGridCommonParams(__assign$2({}, (currentValue !== null && currentValue !== void 0 ? currentValue : {}))));\n }\n });\n });\n this.manuallyDisplayed = this.columnModel.isReady() && !this.paginationProxy.isEmpty();\n this.overlayWrapperComp.showOverlay(promise, wrapperCssClass, listenerDestroyFunc);\n };\n OverlayService.prototype.hideOverlay = function () {\n this.manuallyDisplayed = false;\n this.overlayWrapperComp.hideOverlay();\n };\n OverlayService.prototype.showOrHideOverlay = function () {\n var isEmpty = this.paginationProxy.isEmpty();\n var isSuppressNoRowsOverlay = this.gridOptionsService.get('suppressNoRowsOverlay');\n if (isEmpty && !isSuppressNoRowsOverlay) {\n this.showNoRowsOverlay();\n }\n else {\n this.hideOverlay();\n }\n };\n OverlayService.prototype.onRowDataUpdated = function () {\n this.showOrHideOverlay();\n };\n OverlayService.prototype.onNewColumnsLoaded = function () {\n // hide overlay if columns and rows exist, this can happen if columns are loaded after data.\n // this problem exists before of the race condition between the services (column controller in this case)\n // and the view (grid panel). if the model beans were all initialised first, and then the view beans second,\n // this race condition would not happen.\n if (this.columnModel.isReady() && !this.paginationProxy.isEmpty() && !this.manuallyDisplayed) {\n this.hideOverlay();\n }\n };\n __decorate$h([\n Autowired('userComponentFactory')\n ], OverlayService.prototype, \"userComponentFactory\", void 0);\n __decorate$h([\n Autowired('paginationProxy')\n ], OverlayService.prototype, \"paginationProxy\", void 0);\n __decorate$h([\n Autowired('columnModel')\n ], OverlayService.prototype, \"columnModel\", void 0);\n __decorate$h([\n PostConstruct\n ], OverlayService.prototype, \"postConstruct\", null);\n OverlayService = __decorate$h([\n Bean('overlayService')\n ], OverlayService);\n return OverlayService;\n}(BeanStub));\n\nvar __extends$h = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$1 = ( false) || function () {\n __assign$1 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$1.apply(this, arguments);\n};\nvar __decorate$g = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __values$1 = ( false) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$7 = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar StateService = /** @class */ (function (_super) {\n __extends$h(StateService, _super);\n function StateService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.suppressEvents = true;\n _this.queuedUpdateSources = new Set();\n _this.dispatchStateUpdateEventDebounced = debounce(function () { return _this.dispatchQueuedStateUpdateEvents(); }, 0);\n return _this;\n }\n StateService.prototype.postConstruct = function () {\n var _this = this;\n var _a;\n this.isClientSideRowModel = this.rowModel.getType() === 'clientSide';\n this.cachedState = (_a = this.gridOptionsService.get('initialState')) !== null && _a !== void 0 ? _a : {};\n this.ctrlsService.whenReady(function () { return _this.suppressEventsAndDispatchInitEvent(function () { return _this.setupStateOnGridReady(); }); });\n var newColumnsLoadedDestroyFunc = this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, function (_a) {\n var source = _a.source;\n if (source === 'gridInitializing') {\n newColumnsLoadedDestroyFunc === null || newColumnsLoadedDestroyFunc === void 0 ? void 0 : newColumnsLoadedDestroyFunc();\n _this.suppressEventsAndDispatchInitEvent(function () { return _this.setupStateOnColumnsInitialised(); });\n }\n });\n var rowCountReadyDestroyFunc = this.addManagedListener(this.eventService, Events.EVENT_ROW_COUNT_READY, function () {\n rowCountReadyDestroyFunc === null || rowCountReadyDestroyFunc === void 0 ? void 0 : rowCountReadyDestroyFunc();\n _this.suppressEventsAndDispatchInitEvent(function () { return _this.setupStateOnRowCountReady(); });\n });\n var firstDataRenderedDestroyFunc = this.addManagedListener(this.eventService, Events.EVENT_FIRST_DATA_RENDERED, function () {\n firstDataRenderedDestroyFunc === null || firstDataRenderedDestroyFunc === void 0 ? void 0 : firstDataRenderedDestroyFunc();\n _this.suppressEventsAndDispatchInitEvent(function () { return _this.setupStateOnFirstDataRendered(); });\n });\n };\n StateService.prototype.getState = function () {\n return this.cachedState;\n };\n StateService.prototype.setupStateOnGridReady = function () {\n // sidebar reads the initial state itself, so don't need to set\n var _this = this;\n this.updateCachedState('sideBar', this.getSideBarState());\n this.addManagedListener(this.eventService, Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED, function () { return _this.updateCachedState('sideBar', _this.getSideBarState()); });\n this.addManagedListener(this.eventService, Events.EVENT_SIDE_BAR_UPDATED, function () { return _this.updateCachedState('sideBar', _this.getSideBarState()); });\n };\n StateService.prototype.setupStateOnColumnsInitialised = function () {\n var _this = this;\n var _a;\n var initialState = (_a = this.gridOptionsService.get('initialState')) !== null && _a !== void 0 ? _a : {};\n this.setColumnState(initialState);\n this.setColumnGroupState(initialState);\n this.updateColumnState([\n 'aggregation', 'columnOrder', 'columnPinning', 'columnSizing', 'columnVisibility', 'pivot', 'pivot', 'rowGroup', 'sort'\n ]);\n this.updateCachedState('columnGroup', this.getColumnGroupState());\n // aggregation\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VALUE_CHANGED, function () { return _this.updateColumnState(['aggregation']); });\n // columnOrder\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_MOVED, function () { return _this.updateColumnState(['columnOrder']); });\n // columnPinning\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PINNED, function () { return _this.updateColumnState(['columnPinning']); });\n // columnSizing\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_RESIZED, function () { return _this.updateColumnState(['columnSizing']); });\n // columnVisibility\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VISIBLE, function () { return _this.updateColumnState(['columnVisibility']); });\n // pivot\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_CHANGED, function () { return _this.updateColumnState(['pivot']); });\n // pivot\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, function () { return _this.updateColumnState(['pivot']); });\n // rowGroup\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, function () { return _this.updateColumnState(['rowGroup']); });\n // sort\n this.addManagedListener(this.eventService, Events.EVENT_SORT_CHANGED, function () { return _this.updateColumnState(['sort']); });\n // any column\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, function () { return _this.updateColumnState([\n 'aggregation', 'columnOrder', 'columnPinning', 'columnSizing', 'columnVisibility', 'pivot', 'pivot', 'rowGroup', 'sort'\n ]); });\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_GROUP_OPENED, function () { return _this.updateCachedState('columnGroup', _this.getColumnGroupState()); });\n };\n StateService.prototype.setupStateOnRowCountReady = function () {\n var _this = this;\n var _a;\n var _b = (_a = this.gridOptionsService.get('initialState')) !== null && _a !== void 0 ? _a : {}, filterState = _b.filter, rowGroupExpansionState = _b.rowGroupExpansion, rowSelectionState = _b.rowSelection, paginationState = _b.pagination;\n var advancedFilterModel = this.gridOptionsService.get('advancedFilterModel');\n if (filterState || advancedFilterModel) {\n this.setFilterState(filterState, advancedFilterModel);\n }\n if (rowGroupExpansionState) {\n this.setRowGroupExpansionState(rowGroupExpansionState);\n }\n if (rowSelectionState) {\n this.setRowSelectionState(rowSelectionState);\n }\n if (paginationState) {\n this.setPaginationState(paginationState);\n }\n this.updateCachedState('filter', this.getFilterState());\n this.updateCachedState('rowGroupExpansion', this.getRowGroupExpansionState());\n this.updateCachedState('rowSelection', this.getRowSelectionState());\n this.updateCachedState('pagination', this.getPaginationState());\n this.addManagedListener(this.eventService, Events.EVENT_FILTER_CHANGED, function () { return _this.updateCachedState('filter', _this.getFilterState()); });\n this.addManagedListener(this.eventService, Events.EVENT_ROW_GROUP_OPENED, function () { return _this.updateCachedState('rowGroupExpansion', _this.getRowGroupExpansionState()); });\n this.addManagedListener(this.eventService, Events.EVENT_EXPAND_COLLAPSE_ALL, function () { return _this.updateCachedState('rowGroupExpansion', _this.getRowGroupExpansionState()); });\n this.addManagedListener(this.eventService, Events.EVENT_SELECTION_CHANGED, function () { return _this.updateCachedState('rowSelection', _this.getRowSelectionState()); });\n this.addManagedListener(this.eventService, Events.EVENT_PAGINATION_CHANGED, function (event) {\n if (event.newPage || event.newPageSize) {\n _this.updateCachedState('pagination', _this.getPaginationState());\n }\n });\n };\n StateService.prototype.setupStateOnFirstDataRendered = function () {\n var _this = this;\n var _a;\n var _b = (_a = this.gridOptionsService.get('initialState')) !== null && _a !== void 0 ? _a : {}, scrollState = _b.scroll, rangeSelectionState = _b.rangeSelection, focusedCellState = _b.focusedCell, columnOrderState = _b.columnOrder;\n if (focusedCellState) {\n this.setFocusedCellState(focusedCellState);\n }\n if (rangeSelectionState) {\n this.setRangeSelectionState(rangeSelectionState);\n }\n if (scrollState) {\n this.setScrollState(scrollState);\n }\n this.setColumnPivotState(!!(columnOrderState === null || columnOrderState === void 0 ? void 0 : columnOrderState.orderedColIds));\n // reset sidebar as it could have updated when columns changed\n this.updateCachedState('sideBar', this.getSideBarState());\n this.updateCachedState('focusedCell', this.getFocusedCellState());\n this.updateCachedState('rangeSelection', this.getRangeSelectionState());\n this.updateCachedState('scroll', this.getScrollState());\n this.addManagedListener(this.eventService, Events.EVENT_CELL_FOCUSED, function () { return _this.updateCachedState('focusedCell', _this.getFocusedCellState()); });\n this.addManagedListener(this.eventService, Events.EVENT_RANGE_SELECTION_CHANGED, function (event) {\n if (event.finished) {\n _this.updateCachedState('rangeSelection', _this.getRangeSelectionState());\n }\n });\n this.addManagedListener(this.eventService, Events.EVENT_BODY_SCROLL_END, function () { return _this.updateCachedState('scroll', _this.getScrollState()); });\n };\n StateService.prototype.getColumnState = function () {\n var pivotMode = this.columnModel.isPivotMode();\n var sortColumns = [];\n var groupColIds = [];\n var aggregationColumns = [];\n var pivotColIds = [];\n var leftColIds = [];\n var rightColIds = [];\n var hiddenColIds = [];\n var columnSizes = [];\n var columns = [];\n var columnState = this.columnModel.getColumnState();\n for (var i = 0; i < columnState.length; i++) {\n var _a = columnState[i], colId = _a.colId, sort = _a.sort, sortIndex = _a.sortIndex, rowGroup = _a.rowGroup, rowGroupIndex = _a.rowGroupIndex, aggFunc = _a.aggFunc, pivot = _a.pivot, pivotIndex = _a.pivotIndex, pinned = _a.pinned, hide = _a.hide, width = _a.width, flex = _a.flex;\n columns.push(colId);\n if (sort) {\n sortColumns[sortIndex !== null && sortIndex !== void 0 ? sortIndex : 0] = { colId: colId, sort: sort };\n }\n if (rowGroup) {\n groupColIds[rowGroupIndex !== null && rowGroupIndex !== void 0 ? rowGroupIndex : 0] = colId;\n }\n if (typeof aggFunc === 'string') {\n aggregationColumns.push({ colId: colId, aggFunc: aggFunc });\n }\n if (pivot) {\n pivotColIds[pivotIndex !== null && pivotIndex !== void 0 ? pivotIndex : 0] = colId;\n }\n if (pinned) {\n (pinned === 'right' ? rightColIds : leftColIds).push(colId);\n }\n if (hide) {\n hiddenColIds.push(colId);\n }\n if (flex || width) {\n columnSizes.push({ colId: colId, flex: flex !== null && flex !== void 0 ? flex : undefined, width: width });\n }\n }\n return {\n sort: sortColumns.length ? { sortModel: sortColumns } : undefined,\n rowGroup: groupColIds.length ? { groupColIds: groupColIds } : undefined,\n aggregation: aggregationColumns.length ? { aggregationModel: aggregationColumns } : undefined,\n pivot: pivotColIds.length || pivotMode ? { pivotMode: pivotMode, pivotColIds: pivotColIds } : undefined,\n columnPinning: leftColIds.length || rightColIds.length ? { leftColIds: leftColIds, rightColIds: rightColIds } : undefined,\n columnVisibility: hiddenColIds.length ? { hiddenColIds: hiddenColIds } : undefined,\n columnSizing: columnSizes.length ? { columnSizingModel: columnSizes } : undefined,\n columnOrder: columns.length ? { orderedColIds: columns } : undefined\n };\n };\n StateService.prototype.setColumnState = function (initialState) {\n var sortState = initialState.sort, groupState = initialState.rowGroup, aggregationState = initialState.aggregation, pivotState = initialState.pivot, columnPinningState = initialState.columnPinning, columnVisibilityState = initialState.columnVisibility, columnSizingState = initialState.columnSizing, columnOrderState = initialState.columnOrder;\n var columnStateMap = {};\n var getColumnState = function (colId) {\n var columnState = columnStateMap[colId];\n if (columnState) {\n return columnState;\n }\n columnState = { colId: colId };\n columnStateMap[colId] = columnState;\n return columnState;\n };\n if (sortState) {\n sortState.sortModel.forEach(function (_a, sortIndex) {\n var colId = _a.colId, sort = _a.sort;\n var columnState = getColumnState(colId);\n columnState.sort = sort;\n columnState.sortIndex = sortIndex;\n });\n }\n if (groupState) {\n groupState.groupColIds.forEach(function (colId, rowGroupIndex) {\n var columnState = getColumnState(colId);\n columnState.rowGroup = true;\n columnState.rowGroupIndex = rowGroupIndex;\n });\n }\n if (aggregationState) {\n aggregationState.aggregationModel.forEach(function (_a) {\n var colId = _a.colId, aggFunc = _a.aggFunc;\n getColumnState(colId).aggFunc = aggFunc;\n });\n }\n if (pivotState) {\n pivotState.pivotColIds.forEach(function (colId, pivotIndex) {\n var columnState = getColumnState(colId);\n columnState.pivot = true;\n columnState.pivotIndex = pivotIndex;\n });\n this.gridOptionsService.updateGridOptions({ options: { pivotMode: pivotState.pivotMode }, source: 'gridInitializing' });\n }\n if (columnPinningState) {\n columnPinningState.leftColIds.forEach(function (colId) {\n getColumnState(colId).pinned = 'left';\n });\n columnPinningState.rightColIds.forEach(function (colId) {\n getColumnState(colId).pinned = 'right';\n });\n }\n if (columnVisibilityState) {\n columnVisibilityState.hiddenColIds.forEach(function (colId) {\n getColumnState(colId).hide = true;\n });\n }\n if (columnSizingState) {\n columnSizingState.columnSizingModel.forEach(function (_a) {\n var colId = _a.colId, flex = _a.flex, width = _a.width;\n var columnState = getColumnState(colId);\n columnState.flex = flex !== null && flex !== void 0 ? flex : null;\n columnState.width = width;\n });\n }\n var columns = columnOrderState === null || columnOrderState === void 0 ? void 0 : columnOrderState.orderedColIds;\n var applyOrder = !!(columns === null || columns === void 0 ? void 0 : columns.length);\n var columnStates = applyOrder ? columns.map(function (colId) { return getColumnState(colId); }) : Object.values(columnStateMap);\n if (columnStates.length) {\n this.columnStates = columnStates;\n var defaultState = {\n sort: null,\n sortIndex: null,\n rowGroup: null,\n rowGroupIndex: null,\n aggFunc: null,\n pivot: null,\n pivotIndex: null,\n pinned: null,\n hide: null,\n flex: null,\n };\n this.columnModel.applyColumnState({\n state: columnStates,\n applyOrder: applyOrder,\n defaultState: defaultState\n }, 'gridInitializing');\n }\n };\n StateService.prototype.setColumnPivotState = function (applyOrder) {\n var e_1, _a;\n var columnStates = this.columnStates;\n this.columnStates = undefined;\n var columnGroupStates = this.columnGroupStates;\n this.columnGroupStates = undefined;\n if (!this.columnModel.isSecondaryColumnsPresent()) {\n return;\n }\n if (columnStates) {\n var secondaryColumnStates = [];\n try {\n for (var columnStates_1 = __values$1(columnStates), columnStates_1_1 = columnStates_1.next(); !columnStates_1_1.done; columnStates_1_1 = columnStates_1.next()) {\n var columnState = columnStates_1_1.value;\n if (this.columnModel.getSecondaryColumn(columnState.colId)) {\n secondaryColumnStates.push(columnState);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (columnStates_1_1 && !columnStates_1_1.done && (_a = columnStates_1.return)) _a.call(columnStates_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n this.columnModel.applyColumnState({\n state: secondaryColumnStates,\n applyOrder: applyOrder\n }, 'gridInitializing');\n }\n if (columnGroupStates) {\n // no easy/performant way of knowing which column groups are pivot column groups\n this.columnModel.setColumnGroupState(columnGroupStates, 'gridInitializing');\n }\n };\n StateService.prototype.getColumnGroupState = function () {\n var columnGroupState = this.columnModel.getColumnGroupState();\n var openColumnGroups = [];\n columnGroupState.forEach(function (_a) {\n var groupId = _a.groupId, open = _a.open;\n if (open) {\n openColumnGroups.push(groupId);\n }\n });\n return openColumnGroups.length ? { openColumnGroupIds: openColumnGroups } : undefined;\n };\n StateService.prototype.setColumnGroupState = function (initialState) {\n var _a;\n if (!initialState.hasOwnProperty('columnGroup')) {\n return;\n }\n var openColumnGroups = new Set((_a = initialState.columnGroup) === null || _a === void 0 ? void 0 : _a.openColumnGroupIds);\n var existingColumnGroupState = this.columnModel.getColumnGroupState();\n var stateItems = existingColumnGroupState.map(function (_a) {\n var groupId = _a.groupId;\n var open = openColumnGroups.has(groupId);\n if (open) {\n openColumnGroups.delete(groupId);\n }\n return {\n groupId: groupId,\n open: open\n };\n });\n // probably pivot cols\n openColumnGroups.forEach(function (groupId) {\n stateItems.push({\n groupId: groupId,\n open: true\n });\n });\n if (stateItems.length) {\n this.columnGroupStates = stateItems;\n }\n this.columnModel.setColumnGroupState(stateItems, 'gridInitializing');\n };\n StateService.prototype.getFilterState = function () {\n var _a;\n var filterModel = this.filterManager.getFilterModel();\n if (filterModel && Object.keys(filterModel).length === 0) {\n filterModel = undefined;\n }\n var advancedFilterModel = (_a = this.filterManager.getAdvancedFilterModel()) !== null && _a !== void 0 ? _a : undefined;\n return filterModel || advancedFilterModel ? { filterModel: filterModel, advancedFilterModel: advancedFilterModel } : undefined;\n };\n StateService.prototype.setFilterState = function (filterState, gridOptionAdvancedFilterModel) {\n var _a = filterState !== null && filterState !== void 0 ? filterState : { advancedFilterModel: gridOptionAdvancedFilterModel }, filterModel = _a.filterModel, advancedFilterModel = _a.advancedFilterModel;\n if (filterModel) {\n this.filterManager.setFilterModel(filterModel, 'columnFilter');\n }\n if (advancedFilterModel) {\n this.filterManager.setAdvancedFilterModel(advancedFilterModel);\n }\n };\n StateService.prototype.getRangeSelectionState = function () {\n var _a;\n var cellRanges = (_a = this.rangeService) === null || _a === void 0 ? void 0 : _a.getCellRanges().map(function (cellRange) {\n var id = cellRange.id, type = cellRange.type, startRow = cellRange.startRow, endRow = cellRange.endRow, columns = cellRange.columns, startColumn = cellRange.startColumn;\n return {\n id: id,\n type: type,\n startRow: startRow,\n endRow: endRow,\n colIds: columns.map(function (column) { return column.getColId(); }),\n startColId: startColumn.getColId()\n };\n });\n return (cellRanges === null || cellRanges === void 0 ? void 0 : cellRanges.length) ? { cellRanges: cellRanges } : undefined;\n };\n StateService.prototype.setRangeSelectionState = function (rangeSelectionState) {\n var _this = this;\n var _a;\n if (!this.gridOptionsService.get('enableRangeSelection')) {\n return;\n }\n var cellRanges = rangeSelectionState.cellRanges.map(function (cellRange) { return (__assign$1(__assign$1({}, cellRange), { columns: cellRange.colIds.map(function (colId) { return _this.columnModel.getGridColumn(colId); }), startColumn: _this.columnModel.getGridColumn(cellRange.startColId) })); });\n (_a = this.rangeService) === null || _a === void 0 ? void 0 : _a.setCellRanges(cellRanges);\n };\n StateService.prototype.getScrollState = function () {\n var _a, _b, _c;\n if (!this.isClientSideRowModel) {\n // can't restore, so don't provide\n return undefined;\n }\n var scrollFeature = (_a = this.ctrlsService.getGridBodyCtrl()) === null || _a === void 0 ? void 0 : _a.getScrollFeature();\n var left = ((_b = scrollFeature === null || scrollFeature === void 0 ? void 0 : scrollFeature.getHScrollPosition()) !== null && _b !== void 0 ? _b : { left: 0 }).left;\n var top = ((_c = scrollFeature === null || scrollFeature === void 0 ? void 0 : scrollFeature.getVScrollPosition()) !== null && _c !== void 0 ? _c : { top: 0 }).top;\n return top || left ? {\n top: top,\n left: left\n } : undefined;\n };\n StateService.prototype.setScrollState = function (scrollState) {\n var _a;\n if (!this.isClientSideRowModel) {\n return;\n }\n var top = scrollState.top, left = scrollState.left;\n (_a = this.ctrlsService.getGridBodyCtrl()) === null || _a === void 0 ? void 0 : _a.getScrollFeature().setScrollPosition(top, left);\n };\n StateService.prototype.getSideBarState = function () {\n var _a, _b;\n return (_b = (_a = this.sideBarService) === null || _a === void 0 ? void 0 : _a.getSideBarComp()) === null || _b === void 0 ? void 0 : _b.getState();\n };\n StateService.prototype.getFocusedCellState = function () {\n if (!this.isClientSideRowModel) {\n // can't restore, so don't provide\n return undefined;\n }\n var focusedCell = this.focusService.getFocusedCell();\n if (focusedCell) {\n var column = focusedCell.column, rowIndex = focusedCell.rowIndex, rowPinned = focusedCell.rowPinned;\n return {\n colId: column.getColId(),\n rowIndex: rowIndex,\n rowPinned: rowPinned\n };\n }\n return undefined;\n };\n StateService.prototype.setFocusedCellState = function (focusedCellState) {\n if (!this.isClientSideRowModel) {\n return;\n }\n var colId = focusedCellState.colId, rowIndex = focusedCellState.rowIndex, rowPinned = focusedCellState.rowPinned;\n this.focusService.setFocusedCell({\n column: this.columnModel.getGridColumn(colId),\n rowIndex: rowIndex,\n rowPinned: rowPinned,\n forceBrowserFocus: true,\n preventScrollOnBrowserFocus: true\n });\n };\n StateService.prototype.getPaginationState = function () {\n var page = this.paginationProxy.getCurrentPage();\n var pageSize = !this.gridOptionsService.get('paginationAutoPageSize')\n ? this.paginationProxy.getPageSize() : undefined;\n if (!page && !pageSize) {\n return;\n }\n return { page: page, pageSize: pageSize };\n };\n StateService.prototype.setPaginationState = function (paginationState) {\n if (paginationState.pageSize && !this.gridOptionsService.get('paginationAutoPageSize')) {\n this.paginationProxy.setPageSize(paginationState.pageSize, 'initialState');\n }\n if (typeof paginationState.page === 'number') {\n this.paginationProxy.setPage(paginationState.page);\n }\n };\n StateService.prototype.getRowSelectionState = function () {\n var _a;\n var selectionState = this.selectionService.getSelectionState();\n var noSelections = !selectionState || (!Array.isArray(selectionState) &&\n (selectionState.selectAll === false ||\n selectionState.selectAllChildren === false) && !((_a = selectionState === null || selectionState === void 0 ? void 0 : selectionState.toggledNodes) === null || _a === void 0 ? void 0 : _a.length));\n return noSelections ? undefined : selectionState;\n };\n StateService.prototype.setRowSelectionState = function (rowSelectionState) {\n this.selectionService.setSelectionState(rowSelectionState, 'gridInitializing');\n };\n StateService.prototype.getRowGroupExpansionState = function () {\n var expandedRowGroups = this.expansionService.getExpandedRows();\n return expandedRowGroups.length ? {\n expandedRowGroupIds: expandedRowGroups\n } : undefined;\n };\n StateService.prototype.setRowGroupExpansionState = function (rowGroupExpansionState) {\n this.expansionService.expandRows(rowGroupExpansionState.expandedRowGroupIds);\n };\n StateService.prototype.updateColumnState = function (features) {\n var _this = this;\n var newColumnState = this.getColumnState();\n var hasChanged = false;\n Object.entries(newColumnState).forEach(function (_a) {\n var _b = __read$7(_a, 2), key = _b[0], value = _b[1];\n if (!jsonEquals(value, _this.cachedState[key])) {\n hasChanged = true;\n }\n });\n this.cachedState = __assign$1(__assign$1({}, this.cachedState), newColumnState);\n if (hasChanged) {\n this.dispatchStateUpdateEvent(features);\n }\n };\n StateService.prototype.updateCachedState = function (key, value) {\n var _a;\n var existingValue = this.cachedState[key];\n this.cachedState = __assign$1(__assign$1({}, this.cachedState), (_a = {}, _a[key] = value, _a));\n if (!jsonEquals(value, existingValue)) {\n this.dispatchStateUpdateEvent([key]);\n }\n };\n StateService.prototype.dispatchStateUpdateEvent = function (sources) {\n var _this = this;\n if (this.suppressEvents) {\n return;\n }\n sources.forEach(function (source) { return _this.queuedUpdateSources.add(source); });\n this.dispatchStateUpdateEventDebounced();\n };\n StateService.prototype.dispatchQueuedStateUpdateEvents = function () {\n var sources = Array.from(this.queuedUpdateSources);\n this.queuedUpdateSources.clear();\n var event = {\n type: Events.EVENT_STATE_UPDATED,\n sources: sources,\n state: this.cachedState\n };\n this.eventService.dispatchEvent(event);\n };\n StateService.prototype.suppressEventsAndDispatchInitEvent = function (updateFunc) {\n var _this = this;\n this.suppressEvents = true;\n this.columnAnimationService.setSuppressAnimation(true);\n updateFunc();\n // We want to suppress any grid events, but not user events.\n // Using a timeout here captures things like column resizing and emits a single grid initializing event.\n setTimeout(function () {\n _this.suppressEvents = false;\n // We only want the grid initializing source.\n _this.queuedUpdateSources.clear();\n if (!_this.isAlive()) {\n // Ensure the grid is still alive before dispatching the event.\n return;\n }\n _this.columnAnimationService.setSuppressAnimation(false);\n _this.dispatchStateUpdateEvent(['gridInitializing']);\n });\n };\n __decorate$g([\n Autowired('filterManager')\n ], StateService.prototype, \"filterManager\", void 0);\n __decorate$g([\n Optional('rangeService')\n ], StateService.prototype, \"rangeService\", void 0);\n __decorate$g([\n Autowired('ctrlsService')\n ], StateService.prototype, \"ctrlsService\", void 0);\n __decorate$g([\n Optional('sideBarService')\n ], StateService.prototype, \"sideBarService\", void 0);\n __decorate$g([\n Autowired('focusService')\n ], StateService.prototype, \"focusService\", void 0);\n __decorate$g([\n Autowired('columnModel')\n ], StateService.prototype, \"columnModel\", void 0);\n __decorate$g([\n Autowired('paginationProxy')\n ], StateService.prototype, \"paginationProxy\", void 0);\n __decorate$g([\n Autowired('rowModel')\n ], StateService.prototype, \"rowModel\", void 0);\n __decorate$g([\n Autowired('selectionService')\n ], StateService.prototype, \"selectionService\", void 0);\n __decorate$g([\n Autowired('expansionService')\n ], StateService.prototype, \"expansionService\", void 0);\n __decorate$g([\n Autowired('columnAnimationService')\n ], StateService.prototype, \"columnAnimationService\", void 0);\n __decorate$g([\n PostConstruct\n ], StateService.prototype, \"postConstruct\", null);\n StateService = __decorate$g([\n Bean('stateService')\n ], StateService);\n return StateService;\n}(BeanStub));\n\nvar __extends$g = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$f = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$6 = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$5 = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar ValidationService = /** @class */ (function (_super) {\n __extends$g(ValidationService, _super);\n function ValidationService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ValidationService.prototype.init = function () {\n this.processGridOptions(this.gridOptions);\n };\n ValidationService.prototype.processGridOptions = function (options) {\n this.processOptions(options, GRID_OPTIONS_VALIDATORS);\n };\n ValidationService.prototype.processColumnDefs = function (options) {\n this.processOptions(options, COL_DEF_VALIDATORS);\n };\n ValidationService.prototype.processOptions = function (options, validator) {\n var _this = this;\n var validations = validator.validations, deprecations = validator.deprecations, allProperties = validator.allProperties, propertyExceptions = validator.propertyExceptions, objectName = validator.objectName, docsUrl = validator.docsUrl;\n if (allProperties && this.gridOptions.suppressPropertyNamesCheck !== true) {\n this.checkProperties(options, __spreadArray$5(__spreadArray$5([], __read$6(propertyExceptions !== null && propertyExceptions !== void 0 ? propertyExceptions : []), false), __read$6(Object.keys(deprecations)), false), allProperties, objectName, docsUrl);\n }\n var warnings = new Set();\n var optionKeys = Object.keys(options);\n optionKeys.forEach(function (key) {\n var _a;\n var deprecation = deprecations[key];\n if (deprecation) {\n if ('renamed' in deprecation) {\n var renamed = deprecation.renamed, version = deprecation.version;\n warnings.add(\"As of v\".concat(version, \", \").concat(String(key), \" is deprecated. Please use \").concat(String(renamed), \" instead.\"));\n options[renamed] = options[key];\n }\n else {\n var message = deprecation.message, version = deprecation.version;\n warnings.add(\"As of v\".concat(version, \", \").concat(String(key), \" is deprecated. \").concat(message !== null && message !== void 0 ? message : ''));\n }\n }\n var value = options[key];\n if (value == null || value === false) {\n // false implies feature is disabled, don't validate.\n return;\n }\n var rulesOrGetter = validations[key];\n var rules;\n if (!rulesOrGetter) {\n return;\n }\n else if (typeof rulesOrGetter === 'function') {\n var fromGetter_1 = rulesOrGetter(options, _this.gridOptions);\n if (!fromGetter_1) {\n return;\n }\n // this is a sub validator.\n if ('objectName' in fromGetter_1) {\n var value_1 = options[key];\n if (Array.isArray(value_1)) {\n value_1.forEach(function (item) {\n _this.processOptions(item, fromGetter_1);\n });\n return;\n }\n _this.processOptions(options[key], fromGetter_1);\n return;\n }\n rules = fromGetter_1;\n }\n else {\n rules = rulesOrGetter;\n }\n var module = rules.module, dependencies = rules.dependencies, supportedRowModels = rules.supportedRowModels;\n if (supportedRowModels) {\n var rowModel = (_a = _this.gridOptions.rowModelType) !== null && _a !== void 0 ? _a : 'clientSide';\n if (!supportedRowModels.includes(rowModel)) {\n warnings.add(\"\".concat(String(key), \" is not supported with the '\").concat(rowModel, \"' row model.\"));\n return;\n }\n }\n if (module) {\n var modules = Array.isArray(module) ? module : [module];\n var allRegistered_1 = true;\n modules.forEach(function (m) {\n if (!ModuleRegistry.__assertRegistered(m, String(key), _this.context.getGridId())) {\n allRegistered_1 = false;\n warnings.add(\"\".concat(String(key), \" is only available when \").concat(m, \" is loaded.\"));\n }\n });\n if (!allRegistered_1) {\n return;\n }\n }\n if (dependencies) {\n var warning = _this.checkForWarning(key, dependencies, options);\n if (warning) {\n warnings.add(warning);\n return;\n }\n }\n });\n if (warnings.size > 0) {\n warnings.forEach(function (warning) {\n warnOnce(warning);\n });\n }\n };\n ValidationService.prototype.checkForWarning = function (key, validator, options) {\n if (typeof validator === 'function') {\n return validator(options, this.gridOptions);\n }\n var optionEntries = Object.entries(validator);\n var failed = optionEntries.find(function (_a) {\n var _b = __read$6(_a, 2), key = _b[0], value = _b[1];\n var gridOptionValue = options[key];\n return !value.includes(gridOptionValue);\n });\n if (!failed) {\n return null;\n }\n var _a = __read$6(failed, 2), failedKey = _a[0], possibleOptions = _a[1];\n if (possibleOptions.length > 1) {\n return \"'\".concat(String(key), \"' requires '\").concat(failedKey, \"' to be one of [\").concat(possibleOptions.join(', '), \"].\");\n }\n return \"'\".concat(String(key), \"' requires '\").concat(failedKey, \"' to be \").concat(possibleOptions[0], \".\");\n };\n ValidationService.prototype.checkProperties = function (object, exceptions, // deprecated properties generally\n validProperties, // properties to recommend\n containerName, docsUrl) {\n // Vue adds these properties to all objects, so we ignore them when checking for invalid properties\n var VUE_FRAMEWORK_PROPS = ['__ob__', '__v_skip', '__metadata__'];\n var invalidProperties = fuzzyCheckStrings(Object.getOwnPropertyNames(object), __spreadArray$5(__spreadArray$5(__spreadArray$5([], __read$6(VUE_FRAMEWORK_PROPS), false), __read$6(exceptions), false), __read$6(validProperties), false), validProperties);\n iterateObject(invalidProperties, function (key, value) {\n warnOnce(\"invalid \".concat(containerName, \" property '\").concat(key, \"' did you mean any of these: \").concat(value.slice(0, 8).join(', ')));\n });\n if (Object.keys(invalidProperties).length > 0 && docsUrl) {\n var url = this.getFrameworkOverrides().getDocLink(docsUrl);\n warnOnce(\"to see all the valid \".concat(containerName, \" properties please check: \").concat(url));\n }\n };\n __decorate$f([\n Autowired('gridOptions')\n ], ValidationService.prototype, \"gridOptions\", void 0);\n __decorate$f([\n PostConstruct\n ], ValidationService.prototype, \"init\", null);\n ValidationService = __decorate$f([\n Bean('validationService')\n ], ValidationService);\n return ValidationService;\n}(BeanStub));\n\nvar __extends$f = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$e = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ApiEventService = /** @class */ (function (_super) {\n __extends$f(ApiEventService, _super);\n function ApiEventService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.syncEventListeners = new Map();\n _this.asyncEventListeners = new Map();\n _this.syncGlobalEventListeners = new Set();\n _this.asyncGlobalEventListeners = new Set();\n return _this;\n }\n ApiEventService.prototype.postConstruct = function () {\n this.frameworkEventWrappingService = new FrameworkEventListenerService(this.getFrameworkOverrides());\n };\n ApiEventService.prototype.addEventListener = function (eventType, userListener) {\n var listener = this.frameworkEventWrappingService.wrap(userListener);\n var async = this.gridOptionsService.useAsyncEvents();\n var listeners = async ? this.asyncEventListeners : this.syncEventListeners;\n if (!listeners.has(eventType)) {\n listeners.set(eventType, new Set());\n }\n listeners.get(eventType).add(listener);\n this.eventService.addEventListener(eventType, listener, async);\n };\n ApiEventService.prototype.addGlobalListener = function (userListener) {\n var listener = this.frameworkEventWrappingService.wrapGlobal(userListener);\n var async = this.gridOptionsService.useAsyncEvents();\n var listeners = async ? this.asyncGlobalEventListeners : this.syncGlobalEventListeners;\n listeners.add(listener);\n this.eventService.addGlobalListener(listener, async);\n };\n ApiEventService.prototype.removeEventListener = function (eventType, userListener) {\n var _a;\n var listener = this.frameworkEventWrappingService.unwrap(userListener);\n var asyncListeners = this.asyncEventListeners.get(eventType);\n var hasAsync = !!(asyncListeners === null || asyncListeners === void 0 ? void 0 : asyncListeners.delete(listener));\n if (!hasAsync) {\n (_a = this.asyncEventListeners.get(eventType)) === null || _a === void 0 ? void 0 : _a.delete(listener);\n }\n this.eventService.removeEventListener(eventType, listener, hasAsync);\n };\n ApiEventService.prototype.removeGlobalListener = function (userListener) {\n var listener = this.frameworkEventWrappingService.unwrapGlobal(userListener);\n var hasAsync = this.asyncGlobalEventListeners.delete(listener);\n if (!hasAsync) {\n this.syncGlobalEventListeners.delete(listener);\n }\n this.eventService.removeGlobalListener(listener, hasAsync);\n };\n ApiEventService.prototype.destroyEventListeners = function (map, async) {\n var _this = this;\n map.forEach(function (listeners, eventType) {\n listeners.forEach(function (listener) { return _this.eventService.removeEventListener(eventType, listener, async); });\n listeners.clear();\n });\n map.clear();\n };\n ApiEventService.prototype.destroyGlobalListeners = function (set, async) {\n var _this = this;\n set.forEach(function (listener) { return _this.eventService.removeGlobalListener(listener, async); });\n set.clear();\n };\n ApiEventService.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.destroyEventListeners(this.syncEventListeners, false);\n this.destroyEventListeners(this.asyncEventListeners, true);\n this.destroyGlobalListeners(this.syncGlobalEventListeners, false);\n this.destroyGlobalListeners(this.asyncGlobalEventListeners, true);\n };\n __decorate$e([\n PostConstruct\n ], ApiEventService.prototype, \"postConstruct\", null);\n ApiEventService = __decorate$e([\n Bean('apiEventService')\n ], ApiEventService);\n return ApiEventService;\n}(BeanStub));\n\nvar __extends$e = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$d = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$5 = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$4 = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar PageSizeSelectorComp = /** @class */ (function (_super) {\n __extends$e(PageSizeSelectorComp, _super);\n function PageSizeSelectorComp() {\n var _this = _super.call(this, /* html */ \"\") || this;\n _this.hasEmptyOption = false;\n _this.handlePageSizeItemSelected = function () {\n if (!_this.selectPageSizeComp) {\n return;\n }\n var newValue = _this.selectPageSizeComp.getValue();\n if (!newValue) {\n return;\n }\n var paginationPageSize = Number(newValue);\n if (isNaN(paginationPageSize) ||\n paginationPageSize < 1 ||\n paginationPageSize === _this.paginationProxy.getPageSize()) {\n return;\n }\n _this.paginationProxy.setPageSize(paginationPageSize, 'pageSizeSelector');\n if (_this.hasEmptyOption) {\n // Toggle the selector to force a refresh of the options and hide the empty option,\n // as it's no longer needed.\n _this.toggleSelectDisplay(true);\n }\n _this.selectPageSizeComp.getFocusableElement().focus();\n };\n return _this;\n }\n PageSizeSelectorComp.prototype.init = function () {\n var _this = this;\n this.addManagedPropertyListener('paginationPageSizeSelector', function () {\n _this.onPageSizeSelectorValuesChange();\n });\n this.addManagedListener(this.eventService, Events.EVENT_PAGINATION_CHANGED, function (event) { return _this.handlePaginationChanged(event); });\n };\n PageSizeSelectorComp.prototype.handlePaginationChanged = function (paginationChangedEvent) {\n if (!this.selectPageSizeComp || !(paginationChangedEvent === null || paginationChangedEvent === void 0 ? void 0 : paginationChangedEvent.newPageSize)) {\n return;\n }\n var paginationPageSize = this.paginationProxy.getPageSize();\n if (this.getPageSizeSelectorValues().includes(paginationPageSize)) {\n this.selectPageSizeComp.setValue(paginationPageSize.toString());\n }\n else {\n if (this.hasEmptyOption) {\n this.selectPageSizeComp.setValue('');\n }\n else {\n this.toggleSelectDisplay(true);\n }\n }\n };\n PageSizeSelectorComp.prototype.toggleSelectDisplay = function (show) {\n if (this.selectPageSizeComp) {\n this.reset();\n }\n if (!show) {\n return;\n }\n this.reloadPageSizesSelector();\n if (!this.selectPageSizeComp) {\n return;\n }\n this.appendChild(this.selectPageSizeComp);\n };\n PageSizeSelectorComp.prototype.reset = function () {\n clearElement(this.getGui());\n if (!this.selectPageSizeComp) {\n return;\n }\n this.destroyBean(this.selectPageSizeComp);\n this.selectPageSizeComp = undefined;\n };\n PageSizeSelectorComp.prototype.onPageSizeSelectorValuesChange = function () {\n if (!this.selectPageSizeComp) {\n return;\n }\n if (this.shouldShowPageSizeSelector()) {\n this.reloadPageSizesSelector();\n }\n };\n PageSizeSelectorComp.prototype.shouldShowPageSizeSelector = function () {\n return (this.gridOptionsService.get('pagination') &&\n !this.gridOptionsService.get('suppressPaginationPanel') &&\n !this.gridOptionsService.get('paginationAutoPageSize') &&\n this.gridOptionsService.get('paginationPageSizeSelector') !== false);\n };\n PageSizeSelectorComp.prototype.reloadPageSizesSelector = function () {\n var _this = this;\n var pageSizeOptions = this.getPageSizeSelectorValues();\n var paginationPageSizeOption = this.paginationProxy.getPageSize();\n var shouldAddAndSelectEmptyOption = !paginationPageSizeOption || !pageSizeOptions.includes(paginationPageSizeOption);\n if (shouldAddAndSelectEmptyOption) {\n // When the paginationPageSize option is set to a value that is\n // not in the list of page size options.\n pageSizeOptions.unshift('');\n warnOnce(\"The paginationPageSize grid option is set to a value that is not in the list of page size options.\\n Please make sure that the paginationPageSize grid option is set to one of the values in the \\n paginationPageSizeSelector array, or set the paginationPageSizeSelector to false to hide the page size selector.\");\n }\n if (this.selectPageSizeComp) {\n this.destroyBean(this.selectPageSizeComp);\n this.selectPageSizeComp = undefined;\n }\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var localisedLabel = localeTextFunc('pageSizeSelectorLabel', 'Page Size:');\n var options = pageSizeOptions.map(function (value) { return ({\n value: String(value),\n text: String(value)\n }); });\n var localisedAriaLabel = localeTextFunc('ariaPageSizeSelectorLabel', 'Page Size');\n this.selectPageSizeComp = this.createManagedBean(new AgSelect())\n .addOptions(options)\n .setValue(String(shouldAddAndSelectEmptyOption ? '' : paginationPageSizeOption))\n .setAriaLabel(localisedAriaLabel)\n .setLabel(localisedLabel)\n .onValueChange(function () { return _this.handlePageSizeItemSelected(); });\n this.hasEmptyOption = shouldAddAndSelectEmptyOption;\n };\n PageSizeSelectorComp.prototype.getPageSizeSelectorValues = function () {\n var defaultValues = [20, 50, 100];\n var paginationPageSizeSelectorValues = this.gridOptionsService.get('paginationPageSizeSelector');\n if (!Array.isArray(paginationPageSizeSelectorValues) ||\n !this.validateValues(paginationPageSizeSelectorValues)) {\n return defaultValues;\n }\n return __spreadArray$4([], __read$5(paginationPageSizeSelectorValues), false).sort(function (a, b) { return a - b; });\n };\n PageSizeSelectorComp.prototype.validateValues = function (values) {\n if (!values.length) {\n warnOnce(\"The paginationPageSizeSelector grid option is an empty array. This is most likely a mistake.\\n If you want to hide the page size selector, please set the paginationPageSizeSelector to false.\");\n return false;\n }\n for (var i = 0; i < values.length; i++) {\n var value = values[i];\n var isNumber = typeof value === 'number';\n var isPositive = value > 0;\n if (!isNumber) {\n warnOnce(\"The paginationPageSizeSelector grid option contains a non-numeric value.\\n Please make sure that all values in the paginationPageSizeSelector array are numbers.\");\n return false;\n }\n if (!isPositive) {\n warnOnce(\"The paginationPageSizeSelector grid option contains a negative number or zero.\\n Please make sure that all values in the paginationPageSizeSelector array are positive.\");\n return false;\n }\n }\n return true;\n };\n PageSizeSelectorComp.prototype.destroy = function () {\n this.toggleSelectDisplay(false);\n _super.prototype.destroy.call(this);\n };\n __decorate$d([\n Autowired('localeService')\n ], PageSizeSelectorComp.prototype, \"localeService\", void 0);\n __decorate$d([\n Autowired('gridOptionsService')\n ], PageSizeSelectorComp.prototype, \"gridOptionsService\", void 0);\n __decorate$d([\n Autowired('paginationProxy')\n ], PageSizeSelectorComp.prototype, \"paginationProxy\", void 0);\n __decorate$d([\n PostConstruct\n ], PageSizeSelectorComp.prototype, \"init\", null);\n return PageSizeSelectorComp;\n}(Component));\n\nvar __extends$d = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$c = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AriaAnnouncementService = /** @class */ (function (_super) {\n __extends$d(AriaAnnouncementService, _super);\n function AriaAnnouncementService() {\n var _this = _super.call(this) || this;\n _this.descriptionContainer = null;\n _this.announceValue = debounce(_this.announceValue.bind(_this), 200);\n return _this;\n }\n AriaAnnouncementService.prototype.postConstruct = function () {\n var eDocument = this.gridOptionsService.getDocument();\n var div = this.descriptionContainer = eDocument.createElement('div');\n div.classList.add('ag-aria-description-container');\n setAriaLive(div, 'polite');\n setAriaRelevant(div, 'additions text');\n setAriaAtomic(div, true);\n this.eGridDiv.appendChild(div);\n };\n AriaAnnouncementService.prototype.announceValue = function (value) {\n var _this = this;\n if (!this.descriptionContainer) {\n return;\n }\n // screen readers announce a change in content, so we set it to an empty value\n // and then use a setTimeout to force the Screen Reader announcement \n this.descriptionContainer.textContent = '';\n setTimeout(function () {\n _this.descriptionContainer.textContent = value;\n }, 50);\n };\n AriaAnnouncementService.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n var descriptionContainer = this.descriptionContainer;\n if (descriptionContainer) {\n clearElement(descriptionContainer);\n if (descriptionContainer.parentElement) {\n descriptionContainer.parentElement.removeChild(descriptionContainer);\n }\n }\n this.descriptionContainer = null;\n this.eGridDiv = null;\n };\n __decorate$c([\n Autowired('eGridDiv')\n ], AriaAnnouncementService.prototype, \"eGridDiv\", void 0);\n __decorate$c([\n PostConstruct\n ], AriaAnnouncementService.prototype, \"postConstruct\", null);\n AriaAnnouncementService = __decorate$c([\n Bean('ariaAnnouncementService')\n ], AriaAnnouncementService);\n return AriaAnnouncementService;\n}(BeanStub));\n\nvar __read$4 = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$3 = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n/**\n * Creates a grid inside the provided HTML element.\n * @param eGridDiv Parent element to contain the grid.\n * @param gridOptions Configuration for the grid.\n * @param params Individually register AG Grid Modules to this grid.\n * @returns api to be used to interact with the grid.\n */\nfunction createGrid(eGridDiv, gridOptions, params) {\n if (!gridOptions) {\n errorOnce('No gridOptions provided to createGrid');\n return {};\n }\n // Ensure we do not mutate the provided gridOptions\n var shallowCopy = GridOptionsService.getCoercedGridOptions(gridOptions);\n var api = new GridCoreCreator().create(eGridDiv, shallowCopy, function (context) {\n var gridComp = new GridComp(eGridDiv);\n context.createBean(gridComp);\n }, undefined, params);\n // @deprecated v31 api / columnApi no longer mutated onto the provided gridOptions\n // Instead we place a getter that will log an error when accessed and direct users to the docs\n // Only apply for direct usages of createGrid, not for frameworks\n if (!Object.isFrozen(gridOptions) && !(params === null || params === void 0 ? void 0 : params.frameworkOverrides)) {\n var apiUrl_1 = 'https://ag-grid.com/javascript-data-grid/grid-interface/#grid-api';\n Object.defineProperty(gridOptions, 'api', {\n get: function () {\n errorOnce(\"gridOptions.api is no longer supported. See \".concat(apiUrl_1, \".\"));\n return undefined;\n },\n configurable: true,\n });\n Object.defineProperty(gridOptions, 'columnApi', {\n get: function () {\n errorOnce(\"gridOptions.columnApi is no longer supported and all methods moved to the grid api. See \".concat(apiUrl_1, \".\"));\n return undefined;\n },\n configurable: true,\n });\n }\n return api;\n}\n/**\n * @deprecated v31 use createGrid() instead\n */\nvar Grid = /** @class */ (function () {\n function Grid(eGridDiv, gridOptions, params) {\n var _this = this;\n warnOnce('Since v31 new Grid(...) is deprecated. Use createGrid instead: `const gridApi = createGrid(...)`. The grid api is returned from createGrid and will not be available on gridOptions.');\n if (!gridOptions) {\n errorOnce('No gridOptions provided to the grid');\n return;\n }\n this.gridOptions = gridOptions;\n var api = new GridCoreCreator().create(eGridDiv, gridOptions, function (context) {\n var gridComp = new GridComp(eGridDiv);\n var bean = context.createBean(gridComp);\n bean.addDestroyFunc(function () {\n _this.destroy();\n });\n }, undefined, params);\n // Maintain existing behaviour by mutating gridOptions with the apis for deprecated new Grid()\n this.gridOptions.api = api;\n this.gridOptions.columnApi = new ColumnApi(api);\n }\n Grid.prototype.destroy = function () {\n var _a;\n if (this.gridOptions) {\n (_a = this.gridOptions.api) === null || _a === void 0 ? void 0 : _a.destroy();\n // need to remove these, as we don't own the lifecycle of the gridOptions, we need to\n // remove the references in case the user keeps the grid options, we want the rest\n // of the grid to be picked up by the garbage collector\n delete this.gridOptions.api;\n delete this.gridOptions.columnApi;\n }\n };\n return Grid;\n}());\nvar nextGridId = 1;\n// creates services of grid only, no UI, so frameworks can use this if providing\n// their own UI\nvar GridCoreCreator = /** @class */ (function () {\n function GridCoreCreator() {\n }\n GridCoreCreator.prototype.create = function (eGridDiv, gridOptions, createUi, acceptChanges, params) {\n var _a;\n // Shallow copy to prevent user provided gridOptions from being mutated.\n var debug = !!gridOptions.debug;\n var gridId = (_a = gridOptions.gridId) !== null && _a !== void 0 ? _a : String(nextGridId++);\n var registeredModules = this.getRegisteredModules(params, gridId);\n var beanClasses = this.createBeansList(gridOptions.rowModelType, registeredModules, gridId);\n var providedBeanInstances = this.createProvidedBeans(eGridDiv, gridOptions, params);\n if (!beanClasses) {\n // Detailed error message will have been printed by createBeansList\n errorOnce('Failed to create grid.');\n // Break typing so that the normal return type does not have to handle undefined.\n return undefined;\n }\n var contextParams = {\n providedBeanInstances: providedBeanInstances,\n beanClasses: beanClasses,\n debug: debug,\n gridId: gridId,\n };\n var contextLogger = new Logger('Context', function () { return contextParams.debug; });\n var context = new Context(contextParams, contextLogger);\n var beans = context.getBean('beans');\n this.registerModuleUserComponents(beans, registeredModules);\n this.registerStackComponents(beans, registeredModules);\n this.registerControllers(beans, registeredModules);\n createUi(context);\n beans.syncService.start();\n if (acceptChanges) {\n acceptChanges(context);\n }\n return beans.gridApi;\n };\n GridCoreCreator.prototype.registerControllers = function (beans, registeredModules) {\n registeredModules.forEach(function (module) {\n if (module.controllers) {\n module.controllers.forEach(function (meta) { return beans.ctrlsFactory.register(meta); });\n }\n });\n };\n GridCoreCreator.prototype.registerStackComponents = function (beans, registeredModules) {\n var agStackComponents = this.createAgStackComponentsList(registeredModules);\n beans.agStackComponentsRegistry.setupComponents(agStackComponents);\n };\n GridCoreCreator.prototype.getRegisteredModules = function (params, gridId) {\n var passedViaConstructor = params ? params.modules : null;\n var registered = ModuleRegistry.__getRegisteredModules(gridId);\n var allModules = [];\n var mapNames = {};\n // adds to list and removes duplicates\n var addModule = function (moduleBased, mod, gridId) {\n var addIndividualModule = function (currentModule) {\n if (!mapNames[currentModule.moduleName]) {\n mapNames[currentModule.moduleName] = true;\n allModules.push(currentModule);\n ModuleRegistry.__register(currentModule, moduleBased, gridId);\n }\n };\n addIndividualModule(mod);\n if (mod.dependantModules) {\n mod.dependantModules.forEach(function (m) { return addModule(moduleBased, m, gridId); });\n }\n };\n if (passedViaConstructor) {\n passedViaConstructor.forEach(function (m) { return addModule(true, m, gridId); });\n }\n if (registered) {\n registered.forEach(function (m) { return addModule(!ModuleRegistry.__isPackageBased(), m, undefined); });\n }\n return allModules;\n };\n GridCoreCreator.prototype.registerModuleUserComponents = function (beans, registeredModules) {\n var moduleUserComps = this.extractModuleEntity(registeredModules, function (module) { return module.userComponents ? module.userComponents : []; });\n moduleUserComps.forEach(function (compMeta) {\n beans.userComponentRegistry.registerDefaultComponent(compMeta.componentName, compMeta.componentClass);\n });\n };\n GridCoreCreator.prototype.createProvidedBeans = function (eGridDiv, gridOptions, params) {\n var frameworkOverrides = params ? params.frameworkOverrides : null;\n if (missing(frameworkOverrides)) {\n frameworkOverrides = new VanillaFrameworkOverrides();\n }\n var seed = {\n gridOptions: gridOptions,\n eGridDiv: eGridDiv,\n globalEventListener: params ? params.globalEventListener : null,\n globalSyncEventListener: params ? params.globalSyncEventListener : null,\n frameworkOverrides: frameworkOverrides\n };\n if (params && params.providedBeanInstances) {\n Object.assign(seed, params.providedBeanInstances);\n }\n return seed;\n };\n GridCoreCreator.prototype.createAgStackComponentsList = function (registeredModules) {\n var components = [\n { componentName: 'AgCheckbox', componentClass: AgCheckbox },\n { componentName: 'AgRadioButton', componentClass: AgRadioButton },\n { componentName: 'AgToggleButton', componentClass: AgToggleButton },\n { componentName: 'AgInputTextField', componentClass: AgInputTextField },\n { componentName: 'AgInputTextArea', componentClass: AgInputTextArea },\n { componentName: 'AgInputNumberField', componentClass: AgInputNumberField },\n { componentName: 'AgInputDateField', componentClass: AgInputDateField },\n { componentName: 'AgInputRange', componentClass: AgInputRange },\n { componentName: 'AgRichSelect', componentClass: AgRichSelect },\n { componentName: 'AgSelect', componentClass: AgSelect },\n { componentName: 'AgSlider', componentClass: AgSlider },\n { componentName: 'AgGridBody', componentClass: GridBodyComp },\n { componentName: 'AgHeaderRoot', componentClass: GridHeaderComp },\n { componentName: 'AgSortIndicator', componentClass: SortIndicatorComp },\n { componentName: 'AgPagination', componentClass: PaginationComp },\n { componentName: 'AgPageSizeSelector', componentClass: PageSizeSelectorComp },\n { componentName: 'AgOverlayWrapper', componentClass: OverlayWrapperComponent },\n { componentName: 'AgGroupComponent', componentClass: AgGroupComponent },\n { componentName: 'AgRowContainer', componentClass: RowContainerComp },\n { componentName: 'AgFakeHorizontalScroll', componentClass: FakeHScrollComp },\n { componentName: 'AgFakeVerticalScroll', componentClass: FakeVScrollComp },\n { componentName: 'AgAutocomplete', componentClass: AgAutocomplete },\n ];\n var moduleAgStackComps = this.extractModuleEntity(registeredModules, function (module) { return module.agStackComponents ? module.agStackComponents : []; });\n components = components.concat(moduleAgStackComps);\n return components;\n };\n GridCoreCreator.prototype.createBeansList = function (rowModelType, registeredModules, gridId) {\n if (rowModelType === void 0) { rowModelType = 'clientSide'; }\n // only load beans matching the required row model\n var rowModelModules = registeredModules.filter(function (module) { return !module.rowModel || module.rowModel === rowModelType; });\n // assert that the relevant module has been loaded\n var rowModelModuleNames = {\n clientSide: ModuleNames.ClientSideRowModelModule,\n infinite: ModuleNames.InfiniteRowModelModule,\n serverSide: ModuleNames.ServerSideRowModelModule,\n viewport: ModuleNames.ViewportRowModelModule\n };\n if (!rowModelModuleNames[rowModelType]) {\n errorOnce('Could not find row model for rowModelType = ' + rowModelType);\n return;\n }\n if (!ModuleRegistry.__assertRegistered(rowModelModuleNames[rowModelType], \"rowModelType = '\".concat(rowModelType, \"'\"), gridId)) {\n return;\n }\n // beans should only contain SERVICES, it should NEVER contain COMPONENTS\n var beans = [\n Beans, RowPositionUtils, CellPositionUtils, HeaderPositionUtils,\n PaginationAutoPageSizeService, GridApi, UserComponentRegistry, AgComponentUtils,\n ComponentMetadataProvider, ResizeObserverService, UserComponentFactory,\n RowContainerHeightService, HorizontalResizeService, LocaleService, ValidationService,\n PinnedRowModel, DragService, DisplayedGroupCreator, EventService, GridOptionsService,\n PopupService, SelectionService, FilterManager, ColumnModel, HeaderNavigationService,\n PaginationProxy, RowRenderer, ExpressionService, ColumnFactory, TemplateService,\n AlignedGridsService, NavigationService, ValueCache, ValueService, LoggerFactory,\n ColumnUtils, AutoWidthCalculator, StandardMenuFactory, DragAndDropService, ColumnApi,\n FocusService, MouseEventService, Environment, CellNavigationService, ValueFormatterService,\n StylingService, ScrollVisibleService, SortController, ColumnHoverService, ColumnAnimationService,\n SelectableService, AutoGroupColService, ChangeDetectionService, AnimationFrameService,\n UndoRedoService, AgStackComponentsRegistry, ColumnDefFactory,\n RowCssClassCalculator, RowNodeBlockLoader, RowNodeSorter, CtrlsService,\n PinnedWidthService, RowNodeEventThrottle, CtrlsFactory, DataTypeService, ValueParserService,\n QuickFilterService, SyncService, OverlayService, StateService, ExpansionService,\n ApiEventService, AriaAnnouncementService, MenuService\n ];\n var moduleBeans = this.extractModuleEntity(rowModelModules, function (module) { return module.beans ? module.beans : []; });\n beans.push.apply(beans, __spreadArray$3([], __read$4(moduleBeans), false));\n // check for duplicates, as different modules could include the same beans that\n // they depend on, eg ClientSideRowModel in enterprise, and ClientSideRowModel in community\n var beansNoDuplicates = [];\n beans.forEach(function (bean) {\n if (beansNoDuplicates.indexOf(bean) < 0) {\n beansNoDuplicates.push(bean);\n }\n });\n return beansNoDuplicates;\n };\n GridCoreCreator.prototype.extractModuleEntity = function (moduleEntities, extractor) {\n return [].concat.apply([], __spreadArray$3([], __read$4(moduleEntities.map(extractor)), false));\n };\n return GridCoreCreator;\n}());\n\nvar BaseComponentWrapper = /** @class */ (function () {\n function BaseComponentWrapper() {\n }\n BaseComponentWrapper.prototype.wrap = function (OriginalConstructor, mandatoryMethodList, optionalMethodList, componentType) {\n var _this = this;\n if (optionalMethodList === void 0) { optionalMethodList = []; }\n var wrapper = this.createWrapper(OriginalConstructor, componentType);\n mandatoryMethodList.forEach((function (methodName) {\n _this.createMethod(wrapper, methodName, true);\n }));\n optionalMethodList.forEach((function (methodName) {\n _this.createMethod(wrapper, methodName, false);\n }));\n return wrapper;\n };\n BaseComponentWrapper.prototype.unwrap = function (comp) {\n return comp;\n };\n BaseComponentWrapper.prototype.createMethod = function (wrapper, methodName, mandatory) {\n wrapper.addMethod(methodName, this.createMethodProxy(wrapper, methodName, mandatory));\n };\n BaseComponentWrapper.prototype.createMethodProxy = function (wrapper, methodName, mandatory) {\n return function () {\n if (wrapper.hasMethod(methodName)) {\n return wrapper.callMethod(methodName, arguments);\n }\n if (mandatory) {\n console.warn('AG Grid: Framework component is missing the method ' + methodName + '()');\n }\n // multiple features rely on this returning `null` rather than `undefined`,\n // so that they can differentiate whether the underlying component has implemented a void method or not\n return null;\n };\n };\n return BaseComponentWrapper;\n}());\n\nvar DEFAULT_CHART_GROUPS = {\n columnGroup: [\n 'column',\n 'stackedColumn',\n 'normalizedColumn',\n ],\n barGroup: [\n 'bar',\n 'stackedBar',\n 'normalizedBar'\n ],\n pieGroup: [\n 'pie',\n 'donut',\n ],\n lineGroup: [\n 'line',\n ],\n scatterGroup: [\n 'scatter',\n 'bubble',\n ],\n areaGroup: [\n 'area',\n 'stackedArea',\n 'normalizedArea',\n ],\n polarGroup: [\n 'radarLine',\n 'radarArea',\n 'nightingale',\n 'radialColumn',\n 'radialBar',\n ],\n statisticalGroup: [\n 'boxPlot',\n 'histogram',\n 'rangeBar',\n 'rangeArea',\n ],\n hierarchicalGroup: [\n 'treemap',\n 'sunburst',\n ],\n specializedGroup: [\n 'heatmap',\n 'waterfall',\n ],\n combinationGroup: [\n 'columnLineCombo',\n 'areaColumnCombo',\n 'customCombo',\n ]\n};\nvar CHART_TOOL_PANEL_ALLOW_LIST = [\n 'chartSettings',\n 'chartData',\n 'chartFormat'\n];\nvar CHART_TOOLBAR_ALLOW_LIST = [\n 'chartUnlink',\n 'chartLink',\n 'chartDownload'\n];\nvar CHART_TOOL_PANEL_MENU_OPTIONS = {\n settings: \"chartSettings\",\n data: \"chartData\",\n format: \"chartFormat\"\n};\n\n/**\n * Internal Use Only: Used to ensure this file is treated as a module until we can use moduleDetection flag in Ts v4.7\n */\nvar __FORCE_MODULE_DETECTION = 0;\n\nvar BarColumnLabelPlacement;\n(function (BarColumnLabelPlacement) {\n BarColumnLabelPlacement[\"InsideBase\"] = \"insideBase\";\n BarColumnLabelPlacement[\"InsideEnd\"] = \"insideEnd\";\n BarColumnLabelPlacement[\"Center\"] = \"center\";\n BarColumnLabelPlacement[\"OutsideEnd\"] = \"outsideEnd\";\n})(BarColumnLabelPlacement || (BarColumnLabelPlacement = {}));\n\n/**\n * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue\n * @version v31.1.1\n * @link https://www.ag-grid.com/\n * @license MIT\n */\nvar globalObj = typeof __webpack_require__.g === 'undefined' ? {} : __webpack_require__.g;\nglobalObj.HTMLElement = typeof HTMLElement === 'undefined' ? {} : HTMLElement;\nglobalObj.HTMLButtonElement = typeof HTMLButtonElement === 'undefined' ? {} : HTMLButtonElement;\nglobalObj.HTMLSelectElement = typeof HTMLSelectElement === 'undefined' ? {} : HTMLSelectElement;\nglobalObj.HTMLInputElement = typeof HTMLInputElement === 'undefined' ? {} : HTMLInputElement;\nglobalObj.Node = typeof Node === 'undefined' ? {} : Node;\nglobalObj.MouseEvent = typeof MouseEvent === 'undefined' ? {} : MouseEvent;\n\nvar __read$3 = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$2 = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar ClientSideNodeManager = /** @class */ (function () {\n function ClientSideNodeManager(rootNode, gridOptionsService, eventService, columnModel, selectionService, beans) {\n this.nextId = 0;\n // has row data actually been set\n this.rowCountReady = false;\n // when user is provide the id's, we also keep a map of ids to row nodes for convenience\n this.allNodesMap = {};\n this.rootNode = rootNode;\n this.gridOptionsService = gridOptionsService;\n this.eventService = eventService;\n this.columnModel = columnModel;\n this.beans = beans;\n this.selectionService = selectionService;\n this.rootNode.group = true;\n this.rootNode.level = -1;\n this.rootNode.id = ClientSideNodeManager.ROOT_NODE_ID;\n this.rootNode.allLeafChildren = [];\n this.rootNode.childrenAfterGroup = [];\n this.rootNode.childrenAfterSort = [];\n this.rootNode.childrenAfterAggFilter = [];\n this.rootNode.childrenAfterFilter = [];\n }\n ClientSideNodeManager.prototype.getCopyOfNodesMap = function () {\n return _.cloneObject(this.allNodesMap);\n };\n ClientSideNodeManager.prototype.getRowNode = function (id) {\n return this.allNodesMap[id];\n };\n ClientSideNodeManager.prototype.setRowData = function (rowData) {\n var _this = this;\n if (typeof rowData === 'string') {\n console.warn('AG Grid: rowData must be an array, however you passed in a string. If you are loading JSON, make sure you convert the JSON string to JavaScript objects first');\n return;\n }\n this.rowCountReady = true;\n this.dispatchRowDataUpdateStartedEvent(rowData);\n var rootNode = this.rootNode;\n var sibling = this.rootNode.sibling;\n rootNode.childrenAfterFilter = null;\n rootNode.childrenAfterGroup = null;\n rootNode.childrenAfterAggFilter = null;\n rootNode.childrenAfterSort = null;\n rootNode.childrenMapped = null;\n rootNode.updateHasChildren();\n this.nextId = 0;\n this.allNodesMap = {};\n if (rowData) {\n // we use rootNode as the parent, however if using ag-grid-enterprise, the grouping stage\n // sets the parent node on each row (even if we are not grouping). so setting parent node\n // here is for benefit of ag-grid-community users\n rootNode.allLeafChildren = rowData.map(function (dataItem) { return _this.createNode(dataItem, _this.rootNode, ClientSideNodeManager.TOP_LEVEL); });\n }\n else {\n rootNode.allLeafChildren = [];\n rootNode.childrenAfterGroup = [];\n }\n if (sibling) {\n sibling.childrenAfterFilter = rootNode.childrenAfterFilter;\n sibling.childrenAfterGroup = rootNode.childrenAfterGroup;\n sibling.childrenAfterAggFilter = rootNode.childrenAfterAggFilter;\n sibling.childrenAfterSort = rootNode.childrenAfterSort;\n sibling.childrenMapped = rootNode.childrenMapped;\n sibling.allLeafChildren = rootNode.allLeafChildren;\n }\n };\n ClientSideNodeManager.prototype.updateRowData = function (rowDataTran, rowNodeOrder) {\n this.rowCountReady = true;\n this.dispatchRowDataUpdateStartedEvent(rowDataTran.add);\n var rowNodeTransaction = {\n remove: [],\n update: [],\n add: []\n };\n var nodesToUnselect = [];\n this.executeRemove(rowDataTran, rowNodeTransaction, nodesToUnselect);\n this.executeUpdate(rowDataTran, rowNodeTransaction, nodesToUnselect);\n this.executeAdd(rowDataTran, rowNodeTransaction);\n this.updateSelection(nodesToUnselect, 'rowDataChanged');\n if (rowNodeOrder) {\n _.sortRowNodesByOrder(this.rootNode.allLeafChildren, rowNodeOrder);\n }\n return rowNodeTransaction;\n };\n ClientSideNodeManager.prototype.isRowCountReady = function () {\n return this.rowCountReady;\n };\n ClientSideNodeManager.prototype.dispatchRowDataUpdateStartedEvent = function (rowData) {\n var event = {\n type: Events.EVENT_ROW_DATA_UPDATE_STARTED,\n firstRowData: (rowData === null || rowData === void 0 ? void 0 : rowData.length) ? rowData[0] : null\n };\n this.eventService.dispatchEvent(event);\n };\n ClientSideNodeManager.prototype.updateSelection = function (nodesToUnselect, source) {\n var selectionChanged = nodesToUnselect.length > 0;\n if (selectionChanged) {\n this.selectionService.setNodesSelected({\n newValue: false,\n nodes: nodesToUnselect,\n suppressFinishActions: true,\n source: source,\n });\n }\n // we do this regardless of nodes to unselect or not, as it's possible\n // a new node was inserted, so a parent that was previously selected (as all\n // children were selected) should not be tri-state (as new one unselected against\n // all other selected children).\n this.selectionService.updateGroupsFromChildrenSelections(source);\n if (selectionChanged) {\n var event_1 = {\n type: Events.EVENT_SELECTION_CHANGED,\n source: source\n };\n this.eventService.dispatchEvent(event_1);\n }\n };\n ClientSideNodeManager.prototype.executeAdd = function (rowDataTran, rowNodeTransaction) {\n var _this = this;\n var _a;\n var add = rowDataTran.add, addIndex = rowDataTran.addIndex;\n if (_.missingOrEmpty(add)) {\n return;\n }\n // create new row nodes for each data item\n var newNodes = add.map(function (item) { return _this.createNode(item, _this.rootNode, ClientSideNodeManager.TOP_LEVEL); });\n if (typeof addIndex === 'number' && addIndex >= 0) {\n // new rows are inserted in one go by concatenating them in between the existing rows at the desired index.\n // this is much faster than splicing them individually into 'allLeafChildren' when there are large inserts.\n var allLeafChildren = this.rootNode.allLeafChildren;\n var len = allLeafChildren.length;\n var normalisedAddIndex = addIndex;\n var isTreeData = this.gridOptionsService.get('treeData');\n if (isTreeData && addIndex > 0 && len > 0) {\n for (var i = 0; i < len; i++) {\n if (((_a = allLeafChildren[i]) === null || _a === void 0 ? void 0 : _a.rowIndex) == addIndex - 1) {\n normalisedAddIndex = i + 1;\n break;\n }\n }\n }\n var nodesBeforeIndex = allLeafChildren.slice(0, normalisedAddIndex);\n var nodesAfterIndex = allLeafChildren.slice(normalisedAddIndex, allLeafChildren.length);\n this.rootNode.allLeafChildren = __spreadArray$2(__spreadArray$2(__spreadArray$2([], __read$3(nodesBeforeIndex), false), __read$3(newNodes), false), __read$3(nodesAfterIndex), false);\n }\n else {\n this.rootNode.allLeafChildren = __spreadArray$2(__spreadArray$2([], __read$3(this.rootNode.allLeafChildren), false), __read$3(newNodes), false);\n }\n if (this.rootNode.sibling) {\n this.rootNode.sibling.allLeafChildren = this.rootNode.allLeafChildren;\n }\n // add new row nodes to the transaction add items\n rowNodeTransaction.add = newNodes;\n };\n ClientSideNodeManager.prototype.executeRemove = function (rowDataTran, rowNodeTransaction, nodesToUnselect) {\n var _this = this;\n var remove = rowDataTran.remove;\n if (_.missingOrEmpty(remove)) {\n return;\n }\n var rowIdsRemoved = {};\n remove.forEach(function (item) {\n var rowNode = _this.lookupRowNode(item);\n if (!rowNode) {\n return;\n }\n // do delete - setting 'suppressFinishActions = true' to ensure EVENT_SELECTION_CHANGED is not raised for\n // each row node updated, instead it is raised once by the calling code if any selected nodes exist.\n if (rowNode.isSelected()) {\n nodesToUnselect.push(rowNode);\n }\n // so row renderer knows to fade row out (and not reposition it)\n rowNode.clearRowTopAndRowIndex();\n // NOTE: were we could remove from allLeaveChildren, however _.removeFromArray() is expensive, especially\n // if called multiple times (eg deleting lots of rows) and if allLeafChildren is a large list\n rowIdsRemoved[rowNode.id] = true;\n // _.removeFromArray(this.rootNode.allLeafChildren, rowNode);\n delete _this.allNodesMap[rowNode.id];\n rowNodeTransaction.remove.push(rowNode);\n });\n this.rootNode.allLeafChildren = this.rootNode.allLeafChildren.filter(function (rowNode) { return !rowIdsRemoved[rowNode.id]; });\n if (this.rootNode.sibling) {\n this.rootNode.sibling.allLeafChildren = this.rootNode.allLeafChildren;\n }\n };\n ClientSideNodeManager.prototype.executeUpdate = function (rowDataTran, rowNodeTransaction, nodesToUnselect) {\n var _this = this;\n var update = rowDataTran.update;\n if (_.missingOrEmpty(update)) {\n return;\n }\n update.forEach(function (item) {\n var rowNode = _this.lookupRowNode(item);\n if (!rowNode) {\n return;\n }\n rowNode.updateData(item);\n if (!rowNode.selectable && rowNode.isSelected()) {\n nodesToUnselect.push(rowNode);\n }\n _this.setMasterForRow(rowNode, item, ClientSideNodeManager.TOP_LEVEL, false);\n rowNodeTransaction.update.push(rowNode);\n });\n };\n ClientSideNodeManager.prototype.lookupRowNode = function (data) {\n var getRowIdFunc = this.gridOptionsService.getCallback('getRowId');\n var rowNode;\n if (getRowIdFunc) {\n // find rowNode using id\n var id = getRowIdFunc({ data: data, level: 0 });\n rowNode = this.allNodesMap[id];\n if (!rowNode) {\n console.error(\"AG Grid: could not find row id=\".concat(id, \", data item was not found for this id\"));\n return null;\n }\n }\n else {\n // find rowNode using object references\n rowNode = this.rootNode.allLeafChildren.find(function (node) { return node.data === data; });\n if (!rowNode) {\n console.error(\"AG Grid: could not find data item as object was not found\", data);\n console.error(\"Consider using getRowId to help the Grid find matching row data\");\n return null;\n }\n }\n return rowNode || null;\n };\n ClientSideNodeManager.prototype.createNode = function (dataItem, parent, level) {\n var node = new RowNode(this.beans);\n node.group = false;\n this.setMasterForRow(node, dataItem, level, true);\n var suppressParentsInRowNodes = this.gridOptionsService.get('suppressParentsInRowNodes');\n if (parent && !suppressParentsInRowNodes) {\n node.parent = parent;\n }\n node.level = level;\n node.setDataAndId(dataItem, this.nextId.toString());\n if (this.allNodesMap[node.id]) {\n console.warn(\"AG Grid: duplicate node id '\".concat(node.id, \"' detected from getRowId callback, this could cause issues in your grid.\"));\n }\n this.allNodesMap[node.id] = node;\n this.nextId++;\n return node;\n };\n ClientSideNodeManager.prototype.setMasterForRow = function (rowNode, data, level, setExpanded) {\n var isTreeData = this.gridOptionsService.get('treeData');\n if (isTreeData) {\n rowNode.setMaster(false);\n if (setExpanded) {\n rowNode.expanded = false;\n }\n }\n else {\n var masterDetail = this.gridOptionsService.get('masterDetail');\n // this is the default, for when doing grid data\n if (masterDetail) {\n // if we are doing master detail, then the\n // default is that everything can be a Master Row.\n var isRowMasterFunc = this.gridOptionsService.get('isRowMaster');\n if (isRowMasterFunc) {\n rowNode.setMaster(isRowMasterFunc(data));\n }\n else {\n rowNode.setMaster(true);\n }\n }\n else {\n rowNode.setMaster(false);\n }\n if (setExpanded) {\n var rowGroupColumns = this.columnModel.getRowGroupColumns();\n var numRowGroupColumns = rowGroupColumns ? rowGroupColumns.length : 0;\n // need to take row group into account when determining level\n var masterRowLevel = level + numRowGroupColumns;\n rowNode.expanded = rowNode.master ? this.isExpanded(masterRowLevel) : false;\n }\n }\n };\n ClientSideNodeManager.prototype.isExpanded = function (level) {\n var expandByDefault = this.gridOptionsService.get('groupDefaultExpanded');\n if (expandByDefault === -1) {\n return true;\n }\n return level < expandByDefault;\n };\n ClientSideNodeManager.TOP_LEVEL = 0;\n ClientSideNodeManager.ROOT_NODE_ID = 'ROOT_NODE_ID';\n return ClientSideNodeManager;\n}());\n\nvar __extends$c = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$b = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$2 = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$1 = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar RecursionType;\n(function (RecursionType) {\n RecursionType[RecursionType[\"Normal\"] = 0] = \"Normal\";\n RecursionType[RecursionType[\"AfterFilter\"] = 1] = \"AfterFilter\";\n RecursionType[RecursionType[\"AfterFilterAndSort\"] = 2] = \"AfterFilterAndSort\";\n RecursionType[RecursionType[\"PivotNodes\"] = 3] = \"PivotNodes\";\n})(RecursionType || (RecursionType = {}));\nvar ClientSideRowModel = /** @class */ (function (_super) {\n __extends$c(ClientSideRowModel, _super);\n function ClientSideRowModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.onRowHeightChanged_debounced = _.debounce(_this.onRowHeightChanged.bind(_this), 100);\n _this.rowsToDisplay = []; // the rows mapped to rows to display\n /** Has the start method been called */\n _this.hasStarted = false;\n /** E.g. data has been set into the node manager already */\n _this.shouldSkipSettingDataOnStart = false;\n /**\n * This is to prevent refresh model being called when it's already being called.\n * E.g. the group stage can trigger initial state filter model to be applied. This fires onFilterChanged,\n * which then triggers the listener here that calls refresh model again but at the filter stage\n * (which is about to be run by the original call).\n */\n _this.isRefreshingModel = false;\n _this.rowCountReady = false;\n return _this;\n }\n ClientSideRowModel.prototype.init = function () {\n var _this = this;\n var refreshEverythingFunc = this.refreshModel.bind(this, { step: ClientSideRowModelSteps.EVERYTHING });\n var animate = !this.gridOptionsService.get('suppressAnimationFrame');\n var refreshEverythingAfterColsChangedFunc = this.refreshModel.bind(this, {\n step: ClientSideRowModelSteps.EVERYTHING,\n afterColumnsChanged: true,\n keepRenderedRows: true,\n animate: animate\n });\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, refreshEverythingAfterColsChangedFunc);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, refreshEverythingFunc);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VALUE_CHANGED, this.onValueChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_CHANGED, this.refreshModel.bind(this, { step: ClientSideRowModelSteps.PIVOT }));\n this.addManagedListener(this.eventService, Events.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_SORT_CHANGED, this.onSortChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, refreshEverythingFunc);\n this.addManagedListener(this.eventService, Events.EVENT_GRID_STYLES_CHANGED, this.onGridStylesChanges.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_GRID_READY, function () { return _this.onGridReady(); });\n // doesn't need done if doing full reset\n // Property listeners which call `refreshModel` at different stages\n this.addPropertyListeners();\n this.rootNode = new RowNode(this.beans);\n this.nodeManager = new ClientSideNodeManager(this.rootNode, this.gridOptionsService, this.eventService, this.columnModel, this.selectionService, this.beans);\n };\n ClientSideRowModel.prototype.addPropertyListeners = function () {\n // Omitted Properties\n //\n // We do not act reactively on all functional properties, as it's possible the application is React and\n // has not memoised the property and it's getting set every render.\n //\n // ** LIST OF NON REACTIVE, NO ARGUMENT\n //\n // getDataPath, getRowId, isRowMaster -- these are called once for each Node when the Node is created.\n // -- these are immutable Node properties (ie a Node ID cannot be changed)\n // \n // getRowHeight - this is called once when Node is created, if a new getRowHeight function is provided,\n // - we do not revisit the heights of each node.\n //\n // pivotDefaultExpanded - relevant for initial pivot column creation, no impact on existing pivot columns. \n //\n // deltaSort - this changes the type of algorithm used only, it doesn't change the sort order. so no point\n // - in doing the sort again as the same result will be got. the new Prop will be used next time we sort.\n // \n // ** LIST OF NON REACTIVE, SOME ARGUMENT\n // ** For these, they could be reactive, but not convinced the business argument is strong enough,\n // ** so leaving as non-reactive for now, and see if anyone complains.\n //\n // processPivotResultColDef, processPivotResultColGroupDef\n // - there is an argument for having these reactive, that if the application changes\n // - these props, we should re-create the Pivot Columns, however it's highly unlikely\n // - the application would change these functions, far more likely the functions were\n // - non memoised correctly.\n var _this = this;\n var resetProps = new Set([\n 'treeData', 'masterDetail',\n ]);\n var groupStageRefreshProps = new Set([\n 'suppressParentsInRowNodes', 'groupDefaultExpanded',\n 'groupAllowUnbalanced', 'initialGroupOrderComparator',\n 'groupHideOpenParents', 'groupDisplayType',\n ]);\n var filterStageRefreshProps = new Set([\n 'excludeChildrenWhenTreeDataFiltering',\n ]);\n var pivotStageRefreshProps = new Set([\n 'removePivotHeaderRowWhenSingleValueColumn', 'pivotRowTotals', 'pivotColumnGroupTotals', 'suppressExpandablePivotGroups',\n ]);\n var aggregateStageRefreshProps = new Set([\n 'getGroupRowAgg', 'alwaysAggregateAtRootLevel', 'groupIncludeTotalFooter', 'suppressAggFilteredOnly',\n ]);\n var sortStageRefreshProps = new Set([\n 'postSortRows', 'groupDisplayType', 'accentedSort',\n ]);\n var filterAggStageRefreshProps = new Set([]);\n var flattenStageRefreshProps = new Set([\n 'groupRemoveSingleChildren', 'groupRemoveLowestSingleChildren', 'groupIncludeFooter',\n ]);\n var allProps = __spreadArray$1(__spreadArray$1(__spreadArray$1(__spreadArray$1(__spreadArray$1(__spreadArray$1(__spreadArray$1(__spreadArray$1(__spreadArray$1([], __read$2(resetProps), false), __read$2(groupStageRefreshProps), false), __read$2(filterStageRefreshProps), false), __read$2(pivotStageRefreshProps), false), __read$2(pivotStageRefreshProps), false), __read$2(aggregateStageRefreshProps), false), __read$2(sortStageRefreshProps), false), __read$2(filterAggStageRefreshProps), false), __read$2(flattenStageRefreshProps), false);\n this.addManagedPropertyListeners(allProps, function (params) {\n var _a;\n var properties = (_a = params.changeSet) === null || _a === void 0 ? void 0 : _a.properties;\n if (!properties) {\n return;\n }\n var arePropertiesImpacted = function (propSet) { return (properties.some(function (prop) { return propSet.has(prop); })); };\n if (arePropertiesImpacted(resetProps)) {\n _this.setRowData(_this.rootNode.allLeafChildren.map(function (child) { return child.data; }));\n return;\n }\n if (arePropertiesImpacted(groupStageRefreshProps)) {\n _this.refreshModel({ step: ClientSideRowModelSteps.EVERYTHING });\n return;\n }\n if (arePropertiesImpacted(filterStageRefreshProps)) {\n _this.refreshModel({ step: ClientSideRowModelSteps.FILTER });\n return;\n }\n if (arePropertiesImpacted(pivotStageRefreshProps)) {\n _this.refreshModel({ step: ClientSideRowModelSteps.PIVOT });\n return;\n }\n if (arePropertiesImpacted(aggregateStageRefreshProps)) {\n _this.refreshModel({ step: ClientSideRowModelSteps.AGGREGATE });\n return;\n }\n if (arePropertiesImpacted(sortStageRefreshProps)) {\n _this.refreshModel({ step: ClientSideRowModelSteps.SORT });\n return;\n }\n if (arePropertiesImpacted(filterAggStageRefreshProps)) {\n _this.refreshModel({ step: ClientSideRowModelSteps.FILTER_AGGREGATES });\n return;\n }\n if (arePropertiesImpacted(flattenStageRefreshProps)) {\n _this.refreshModel({ step: ClientSideRowModelSteps.MAP });\n }\n });\n this.addManagedPropertyListener('rowHeight', function () { return _this.resetRowHeights(); });\n };\n ClientSideRowModel.prototype.start = function () {\n this.hasStarted = true;\n if (this.shouldSkipSettingDataOnStart) {\n this.dispatchUpdateEventsAndRefresh();\n }\n else {\n this.setInitialData();\n }\n };\n ClientSideRowModel.prototype.setInitialData = function () {\n var rowData = this.gridOptionsService.get('rowData');\n if (rowData) {\n this.shouldSkipSettingDataOnStart = true;\n this.setRowData(rowData);\n }\n };\n ClientSideRowModel.prototype.ensureRowHeightsValid = function (startPixel, endPixel, startLimitIndex, endLimitIndex) {\n var atLeastOneChange;\n var res = false;\n // we do this multiple times as changing the row heights can also change the first and last rows,\n // so the first pass can make lots of rows smaller, which means the second pass we end up changing\n // more rows.\n do {\n atLeastOneChange = false;\n var rowAtStartPixel = this.getRowIndexAtPixel(startPixel);\n var rowAtEndPixel = this.getRowIndexAtPixel(endPixel);\n // keep check to current page if doing pagination\n var firstRow = Math.max(rowAtStartPixel, startLimitIndex);\n var lastRow = Math.min(rowAtEndPixel, endLimitIndex);\n for (var rowIndex = firstRow; rowIndex <= lastRow; rowIndex++) {\n var rowNode = this.getRow(rowIndex);\n if (rowNode.rowHeightEstimated) {\n var rowHeight = this.gridOptionsService.getRowHeightForNode(rowNode);\n rowNode.setRowHeight(rowHeight.height);\n atLeastOneChange = true;\n res = true;\n }\n }\n if (atLeastOneChange) {\n this.setRowTopAndRowIndex();\n }\n } while (atLeastOneChange);\n return res;\n };\n ClientSideRowModel.prototype.setRowTopAndRowIndex = function () {\n var defaultRowHeight = this.environment.getDefaultRowHeight();\n var nextRowTop = 0;\n // mapping displayed rows is not needed for this method, however it's used in\n // clearRowTopAndRowIndex(), and given we are looping through this.rowsToDisplay here,\n // we create the map here for performance reasons, so we don't loop a second time\n // in clearRowTopAndRowIndex()\n var displayedRowsMapped = new Set();\n // we don't estimate if doing fullHeight or autoHeight, as all rows get rendered all the time\n // with these two layouts.\n var allowEstimate = this.gridOptionsService.isDomLayout('normal');\n for (var i = 0; i < this.rowsToDisplay.length; i++) {\n var rowNode = this.rowsToDisplay[i];\n if (rowNode.id != null) {\n displayedRowsMapped.add(rowNode.id);\n }\n if (rowNode.rowHeight == null) {\n var rowHeight = this.gridOptionsService.getRowHeightForNode(rowNode, allowEstimate, defaultRowHeight);\n rowNode.setRowHeight(rowHeight.height, rowHeight.estimated);\n }\n rowNode.setRowTop(nextRowTop);\n rowNode.setRowIndex(i);\n nextRowTop += rowNode.rowHeight;\n }\n return displayedRowsMapped;\n };\n ClientSideRowModel.prototype.clearRowTopAndRowIndex = function (changedPath, displayedRowsMapped) {\n var changedPathActive = changedPath.isActive();\n var clearIfNotDisplayed = function (rowNode) {\n if (rowNode && rowNode.id != null && !displayedRowsMapped.has(rowNode.id)) {\n rowNode.clearRowTopAndRowIndex();\n }\n };\n var recurse = function (rowNode) {\n clearIfNotDisplayed(rowNode);\n clearIfNotDisplayed(rowNode.detailNode);\n clearIfNotDisplayed(rowNode.sibling);\n if (rowNode.hasChildren()) {\n if (rowNode.childrenAfterGroup) {\n // if a changedPath is active, it means we are here because of a transaction update or\n // a change detection. neither of these impacts the open/closed state of groups. so if\n // a group is not open this time, it was not open last time. so we know all closed groups\n // already have their top positions cleared. so there is no need to traverse all the way\n // when changedPath is active and the rowNode is not expanded.\n var isRootNode = rowNode.level == -1; // we need to give special consideration for root node,\n // as expanded=undefined for root node\n var skipChildren = changedPathActive && !isRootNode && !rowNode.expanded;\n if (!skipChildren) {\n rowNode.childrenAfterGroup.forEach(recurse);\n }\n }\n }\n };\n recurse(this.rootNode);\n };\n // returns false if row was moved, otherwise true\n ClientSideRowModel.prototype.ensureRowsAtPixel = function (rowNodes, pixel, increment) {\n var _this = this;\n if (increment === void 0) { increment = 0; }\n var indexAtPixelNow = this.getRowIndexAtPixel(pixel);\n var rowNodeAtPixelNow = this.getRow(indexAtPixelNow);\n var animate = !this.gridOptionsService.get('suppressAnimationFrame');\n if (rowNodeAtPixelNow === rowNodes[0]) {\n return false;\n }\n rowNodes.forEach(function (rowNode) {\n _.removeFromArray(_this.rootNode.allLeafChildren, rowNode);\n });\n rowNodes.forEach(function (rowNode, idx) {\n _.insertIntoArray(_this.rootNode.allLeafChildren, rowNode, Math.max(indexAtPixelNow + increment, 0) + idx);\n });\n this.refreshModel({\n step: ClientSideRowModelSteps.EVERYTHING,\n keepRenderedRows: true,\n keepEditingRows: true,\n animate: animate\n });\n return true;\n };\n ClientSideRowModel.prototype.highlightRowAtPixel = function (rowNode, pixel) {\n var indexAtPixelNow = pixel != null ? this.getRowIndexAtPixel(pixel) : null;\n var rowNodeAtPixelNow = indexAtPixelNow != null ? this.getRow(indexAtPixelNow) : null;\n if (!rowNodeAtPixelNow || !rowNode || rowNodeAtPixelNow === rowNode || pixel == null) {\n if (this.lastHighlightedRow) {\n this.lastHighlightedRow.setHighlighted(null);\n this.lastHighlightedRow = null;\n }\n return;\n }\n var highlight = this.getHighlightPosition(pixel, rowNodeAtPixelNow);\n if (this.lastHighlightedRow && this.lastHighlightedRow !== rowNodeAtPixelNow) {\n this.lastHighlightedRow.setHighlighted(null);\n this.lastHighlightedRow = null;\n }\n rowNodeAtPixelNow.setHighlighted(highlight);\n this.lastHighlightedRow = rowNodeAtPixelNow;\n };\n ClientSideRowModel.prototype.getHighlightPosition = function (pixel, rowNode) {\n if (!rowNode) {\n var index = this.getRowIndexAtPixel(pixel);\n rowNode = this.getRow(index || 0);\n if (!rowNode) {\n return RowHighlightPosition.Below;\n }\n }\n var rowTop = rowNode.rowTop, rowHeight = rowNode.rowHeight;\n return pixel - rowTop < rowHeight / 2 ? RowHighlightPosition.Above : RowHighlightPosition.Below;\n };\n ClientSideRowModel.prototype.getLastHighlightedRowNode = function () {\n return this.lastHighlightedRow;\n };\n ClientSideRowModel.prototype.isLastRowIndexKnown = function () {\n return true;\n };\n ClientSideRowModel.prototype.getRowCount = function () {\n if (this.rowsToDisplay) {\n return this.rowsToDisplay.length;\n }\n return 0;\n };\n ClientSideRowModel.prototype.getTopLevelRowCount = function () {\n var showingRootNode = this.rowsToDisplay && this.rowsToDisplay[0] === this.rootNode;\n if (showingRootNode) {\n return 1;\n }\n var filteredChildren = this.rootNode.childrenAfterAggFilter;\n return filteredChildren ? filteredChildren.length : 0;\n };\n ClientSideRowModel.prototype.getTopLevelRowDisplayedIndex = function (topLevelIndex) {\n var showingRootNode = this.rowsToDisplay && this.rowsToDisplay[0] === this.rootNode;\n if (showingRootNode) {\n return topLevelIndex;\n }\n var rowNode = this.rootNode.childrenAfterSort[topLevelIndex];\n if (this.gridOptionsService.get('groupHideOpenParents')) {\n // if hideOpenParents, and this row open, then this row is now displayed at this index, first child is\n while (rowNode.expanded && rowNode.childrenAfterSort && rowNode.childrenAfterSort.length > 0) {\n rowNode = rowNode.childrenAfterSort[0];\n }\n }\n return rowNode.rowIndex;\n };\n ClientSideRowModel.prototype.getRowBounds = function (index) {\n if (_.missing(this.rowsToDisplay)) {\n return null;\n }\n var rowNode = this.rowsToDisplay[index];\n if (rowNode) {\n return {\n rowTop: rowNode.rowTop,\n rowHeight: rowNode.rowHeight\n };\n }\n return null;\n };\n ClientSideRowModel.prototype.onRowGroupOpened = function () {\n var animate = this.gridOptionsService.isAnimateRows();\n this.refreshModel({ step: ClientSideRowModelSteps.MAP, keepRenderedRows: true, animate: animate });\n };\n ClientSideRowModel.prototype.onFilterChanged = function (event) {\n if (event.afterDataChange) {\n return;\n }\n var animate = this.gridOptionsService.isAnimateRows();\n var primaryOrQuickFilterChanged = event.columns.length === 0 || event.columns.some(function (col) { return col.isPrimary(); });\n var step = primaryOrQuickFilterChanged ? ClientSideRowModelSteps.FILTER : ClientSideRowModelSteps.FILTER_AGGREGATES;\n this.refreshModel({ step: step, keepRenderedRows: true, animate: animate });\n };\n ClientSideRowModel.prototype.onSortChanged = function () {\n var animate = this.gridOptionsService.isAnimateRows();\n this.refreshModel({ step: ClientSideRowModelSteps.SORT, keepRenderedRows: true, animate: animate, keepEditingRows: true });\n };\n ClientSideRowModel.prototype.getType = function () {\n return 'clientSide';\n };\n ClientSideRowModel.prototype.onValueChanged = function () {\n if (this.columnModel.isPivotActive()) {\n this.refreshModel({ step: ClientSideRowModelSteps.PIVOT });\n }\n else {\n this.refreshModel({ step: ClientSideRowModelSteps.AGGREGATE });\n }\n };\n ClientSideRowModel.prototype.createChangePath = function (rowNodeTransactions) {\n // for updates, if the row is updated at all, then we re-calc all the values\n // in that row. we could compare each value to each old value, however if we\n // did this, we would be calling the valueService twice, once on the old value\n // and once on the new value. so it's less valueGetter calls if we just assume\n // each column is different. that way the changedPath is used so that only\n // the impacted parent rows are recalculated, parents who's children have\n // not changed are not impacted.\n var noTransactions = _.missingOrEmpty(rowNodeTransactions);\n var changedPath = new ChangedPath(false, this.rootNode);\n if (noTransactions || this.gridOptionsService.get('treeData')) {\n changedPath.setInactive();\n }\n return changedPath;\n };\n ClientSideRowModel.prototype.isSuppressModelUpdateAfterUpdateTransaction = function (params) {\n if (!this.gridOptionsService.get('suppressModelUpdateAfterUpdateTransaction')) {\n return false;\n }\n // return true if we are only doing update transactions\n if (params.rowNodeTransactions == null) {\n return false;\n }\n var transWithAddsOrDeletes = params.rowNodeTransactions.filter(function (tx) {\n return (tx.add != null && tx.add.length > 0) || (tx.remove != null && tx.remove.length > 0);\n });\n var transactionsContainUpdatesOnly = transWithAddsOrDeletes == null || transWithAddsOrDeletes.length == 0;\n return transactionsContainUpdatesOnly;\n };\n ClientSideRowModel.prototype.buildRefreshModelParams = function (step) {\n var paramsStep = ClientSideRowModelSteps.EVERYTHING;\n var stepsMapped = {\n everything: ClientSideRowModelSteps.EVERYTHING,\n group: ClientSideRowModelSteps.EVERYTHING,\n filter: ClientSideRowModelSteps.FILTER,\n map: ClientSideRowModelSteps.MAP,\n aggregate: ClientSideRowModelSteps.AGGREGATE,\n sort: ClientSideRowModelSteps.SORT,\n pivot: ClientSideRowModelSteps.PIVOT\n };\n if (_.exists(step)) {\n paramsStep = stepsMapped[step];\n }\n if (_.missing(paramsStep)) {\n console.error(\"AG Grid: invalid step \".concat(step, \", available steps are \").concat(Object.keys(stepsMapped).join(', ')));\n return undefined;\n }\n var animate = !this.gridOptionsService.get('suppressAnimationFrame');\n var modelParams = {\n step: paramsStep,\n keepRenderedRows: true,\n keepEditingRows: true,\n animate: animate\n };\n return modelParams;\n };\n ClientSideRowModel.prototype.refreshModel = function (paramsOrStep) {\n if (!this.hasStarted || this.isRefreshingModel || this.columnModel.shouldRowModelIgnoreRefresh()) {\n return;\n }\n var params = typeof paramsOrStep === 'object' && \"step\" in paramsOrStep ? paramsOrStep : this.buildRefreshModelParams(paramsOrStep);\n if (!params) {\n return;\n }\n if (this.isSuppressModelUpdateAfterUpdateTransaction(params)) {\n return;\n }\n // this goes through the pipeline of stages. what's in my head is similar\n // to the diagram on this page:\n // http://commons.apache.org/sandbox/commons-pipeline/pipeline_basics.html\n // however we want to keep the results of each stage, hence we manually call\n // each step rather than have them chain each other.\n // fallthrough in below switch is on purpose,\n // eg if STEP_FILTER, then all steps below this\n // step get done\n // let start: number;\n // console.log('======= start =======');\n var changedPath = this.createChangePath(params.rowNodeTransactions);\n this.isRefreshingModel = true;\n switch (params.step) {\n case ClientSideRowModelSteps.EVERYTHING:\n this.doRowGrouping(params.rowNodeTransactions, params.rowNodeOrder, changedPath, !!params.afterColumnsChanged);\n case ClientSideRowModelSteps.FILTER:\n this.doFilter(changedPath);\n case ClientSideRowModelSteps.PIVOT:\n this.doPivot(changedPath);\n case ClientSideRowModelSteps.AGGREGATE: // depends on agg fields\n this.doAggregate(changedPath);\n case ClientSideRowModelSteps.FILTER_AGGREGATES:\n this.doFilterAggregates(changedPath);\n case ClientSideRowModelSteps.SORT:\n this.doSort(params.rowNodeTransactions, changedPath);\n case ClientSideRowModelSteps.MAP:\n this.doRowsToDisplay();\n }\n // set all row tops to null, then set row tops on all visible rows. if we don't\n // do this, then the algorithm below only sets row tops, old row tops from old rows\n // will still lie around\n var displayedNodesMapped = this.setRowTopAndRowIndex();\n this.clearRowTopAndRowIndex(changedPath, displayedNodesMapped);\n this.isRefreshingModel = false;\n var event = {\n type: Events.EVENT_MODEL_UPDATED,\n animate: params.animate,\n keepRenderedRows: params.keepRenderedRows,\n newData: params.newData,\n newPage: false,\n keepUndoRedoStack: params.keepUndoRedoStack\n };\n this.eventService.dispatchEvent(event);\n };\n ClientSideRowModel.prototype.isEmpty = function () {\n var rowsMissing = _.missing(this.rootNode.allLeafChildren) || this.rootNode.allLeafChildren.length === 0;\n return _.missing(this.rootNode) || rowsMissing || !this.columnModel.isReady();\n };\n ClientSideRowModel.prototype.isRowsToRender = function () {\n return _.exists(this.rowsToDisplay) && this.rowsToDisplay.length > 0;\n };\n ClientSideRowModel.prototype.getNodesInRangeForSelection = function (firstInRange, lastInRange) {\n // if lastSelectedNode is missing, we start at the first row\n var started = !lastInRange;\n var finished = false;\n var result = [];\n var groupsSelectChildren = this.gridOptionsService.get('groupSelectsChildren');\n this.forEachNodeAfterFilterAndSort(function (rowNode) {\n // range has been closed, skip till end\n if (finished) {\n return;\n }\n if (started) {\n if (rowNode === lastInRange || rowNode === firstInRange) {\n // check if this is the last node we're going to be adding\n finished = true;\n // if the final node was a group node, and we're doing groupSelectsChildren\n // make the exception to select all of it's descendants too\n if (rowNode.group && groupsSelectChildren) {\n result.push.apply(result, __spreadArray$1([], __read$2(rowNode.allLeafChildren), false));\n return;\n }\n }\n }\n if (!started) {\n if (rowNode !== lastInRange && rowNode !== firstInRange) {\n // still haven't hit a boundary node, keep searching\n return;\n }\n started = true;\n }\n // only select leaf nodes if groupsSelectChildren\n var includeThisNode = !rowNode.group || !groupsSelectChildren;\n if (includeThisNode) {\n result.push(rowNode);\n return;\n }\n });\n return result;\n };\n ClientSideRowModel.prototype.setDatasource = function (datasource) {\n console.error('AG Grid: should never call setDatasource on clientSideRowController');\n };\n ClientSideRowModel.prototype.getTopLevelNodes = function () {\n return this.rootNode ? this.rootNode.childrenAfterGroup : null;\n };\n ClientSideRowModel.prototype.getRootNode = function () {\n return this.rootNode;\n };\n ClientSideRowModel.prototype.getRow = function (index) {\n return this.rowsToDisplay[index];\n };\n ClientSideRowModel.prototype.isRowPresent = function (rowNode) {\n return this.rowsToDisplay.indexOf(rowNode) >= 0;\n };\n ClientSideRowModel.prototype.getRowIndexAtPixel = function (pixelToMatch) {\n if (this.isEmpty() || this.rowsToDisplay.length === 0) {\n return -1;\n }\n // do binary search of tree\n // http://oli.me.uk/2013/06/08/searching-javascript-arrays-with-a-binary-search/\n var bottomPointer = 0;\n var topPointer = this.rowsToDisplay.length - 1;\n // quick check, if the pixel is out of bounds, then return last row\n if (pixelToMatch <= 0) {\n // if pixel is less than or equal zero, it's always the first row\n return 0;\n }\n var lastNode = _.last(this.rowsToDisplay);\n if (lastNode.rowTop <= pixelToMatch) {\n return this.rowsToDisplay.length - 1;\n }\n var oldBottomPointer = -1;\n var oldTopPointer = -1;\n while (true) {\n var midPointer = Math.floor((bottomPointer + topPointer) / 2);\n var currentRowNode = this.rowsToDisplay[midPointer];\n if (this.isRowInPixel(currentRowNode, pixelToMatch)) {\n return midPointer;\n }\n if (currentRowNode.rowTop < pixelToMatch) {\n bottomPointer = midPointer + 1;\n }\n else if (currentRowNode.rowTop > pixelToMatch) {\n topPointer = midPointer - 1;\n }\n // infinite loops happen when there is space between rows. this can happen\n // when Auto Height is active, cos we re-calculate row tops asyncronously\n // when row heights change, which can temporarly result in gaps between rows.\n var caughtInInfiniteLoop = oldBottomPointer === bottomPointer\n && oldTopPointer === topPointer;\n if (caughtInInfiniteLoop) {\n return midPointer;\n }\n oldBottomPointer = bottomPointer;\n oldTopPointer = topPointer;\n }\n };\n ClientSideRowModel.prototype.isRowInPixel = function (rowNode, pixelToMatch) {\n var topPixel = rowNode.rowTop;\n var bottomPixel = rowNode.rowTop + rowNode.rowHeight;\n var pixelInRow = topPixel <= pixelToMatch && bottomPixel > pixelToMatch;\n return pixelInRow;\n };\n ClientSideRowModel.prototype.forEachLeafNode = function (callback) {\n if (this.rootNode.allLeafChildren) {\n this.rootNode.allLeafChildren.forEach(function (rowNode, index) { return callback(rowNode, index); });\n }\n };\n ClientSideRowModel.prototype.forEachNode = function (callback, includeFooterNodes) {\n if (includeFooterNodes === void 0) { includeFooterNodes = false; }\n this.recursivelyWalkNodesAndCallback({\n nodes: __spreadArray$1([], __read$2((this.rootNode.childrenAfterGroup || [])), false),\n callback: callback,\n recursionType: RecursionType.Normal,\n index: 0,\n includeFooterNodes: includeFooterNodes\n });\n };\n ClientSideRowModel.prototype.forEachNodeAfterFilter = function (callback, includeFooterNodes) {\n if (includeFooterNodes === void 0) { includeFooterNodes = false; }\n this.recursivelyWalkNodesAndCallback({\n nodes: __spreadArray$1([], __read$2((this.rootNode.childrenAfterAggFilter || [])), false),\n callback: callback,\n recursionType: RecursionType.AfterFilter,\n index: 0,\n includeFooterNodes: includeFooterNodes\n });\n };\n ClientSideRowModel.prototype.forEachNodeAfterFilterAndSort = function (callback, includeFooterNodes) {\n if (includeFooterNodes === void 0) { includeFooterNodes = false; }\n this.recursivelyWalkNodesAndCallback({\n nodes: __spreadArray$1([], __read$2((this.rootNode.childrenAfterSort || [])), false),\n callback: callback,\n recursionType: RecursionType.AfterFilterAndSort,\n index: 0,\n includeFooterNodes: includeFooterNodes\n });\n };\n ClientSideRowModel.prototype.forEachPivotNode = function (callback, includeFooterNodes) {\n if (includeFooterNodes === void 0) { includeFooterNodes = false; }\n this.recursivelyWalkNodesAndCallback({\n nodes: [this.rootNode],\n callback: callback,\n recursionType: RecursionType.PivotNodes,\n index: 0,\n includeFooterNodes: includeFooterNodes\n });\n };\n // iterates through each item in memory, and calls the callback function\n // nodes - the rowNodes to traverse\n // callback - the user provided callback\n // recursion type - need this to know what child nodes to recurse, eg if looking at all nodes, or filtered notes etc\n // index - works similar to the index in forEach in javascript's array function\n ClientSideRowModel.prototype.recursivelyWalkNodesAndCallback = function (params) {\n var _a;\n var nodes = params.nodes, callback = params.callback, recursionType = params.recursionType, includeFooterNodes = params.includeFooterNodes;\n var index = params.index;\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n callback(node, index++);\n // go to the next level if it is a group\n if (node.hasChildren() && !node.footer) {\n // depending on the recursion type, we pick a difference set of children\n var nodeChildren = null;\n switch (recursionType) {\n case RecursionType.Normal:\n nodeChildren = node.childrenAfterGroup;\n break;\n case RecursionType.AfterFilter:\n nodeChildren = node.childrenAfterAggFilter;\n break;\n case RecursionType.AfterFilterAndSort:\n nodeChildren = node.childrenAfterSort;\n break;\n case RecursionType.PivotNodes:\n // for pivot, we don't go below leafGroup levels\n nodeChildren = !node.leafGroup ? node.childrenAfterSort : null;\n break;\n }\n if (nodeChildren) {\n index = this.recursivelyWalkNodesAndCallback({\n nodes: __spreadArray$1([], __read$2(nodeChildren), false),\n callback: callback,\n recursionType: recursionType,\n index: index,\n includeFooterNodes: includeFooterNodes\n });\n }\n }\n }\n var parentNode = (_a = nodes[0]) === null || _a === void 0 ? void 0 : _a.parent;\n if (!includeFooterNodes || !parentNode)\n return index;\n var isRootNode = parentNode === this.rootNode;\n if (isRootNode) {\n var totalFooters = this.gridOptionsService.get('groupIncludeTotalFooter');\n if (!totalFooters)\n return index;\n }\n else {\n var isGroupIncludeFooter = this.gridOptionsService.getGroupIncludeFooter();\n if (!isGroupIncludeFooter({ node: parentNode }))\n return index;\n }\n parentNode.createFooter();\n callback(parentNode.sibling, index++);\n return index;\n };\n // it's possible to recompute the aggregate without doing the other parts\n // + api.refreshClientSideRowModel('aggregate')\n ClientSideRowModel.prototype.doAggregate = function (changedPath) {\n if (this.aggregationStage) {\n this.aggregationStage.execute({ rowNode: this.rootNode, changedPath: changedPath });\n }\n };\n ClientSideRowModel.prototype.doFilterAggregates = function (changedPath) {\n if (this.filterAggregatesStage) {\n this.filterAggregatesStage.execute({ rowNode: this.rootNode, changedPath: changedPath });\n }\n else {\n // If filterAggregatesStage is undefined, then so is the grouping stage, so all children should be on the rootNode.\n this.rootNode.childrenAfterAggFilter = this.rootNode.childrenAfterFilter;\n }\n };\n // + gridApi.expandAll()\n // + gridApi.collapseAll()\n ClientSideRowModel.prototype.expandOrCollapseAll = function (expand) {\n var usingTreeData = this.gridOptionsService.get('treeData');\n var usingPivotMode = this.columnModel.isPivotActive();\n var recursiveExpandOrCollapse = function (rowNodes) {\n if (!rowNodes) {\n return;\n }\n rowNodes.forEach(function (rowNode) {\n var actionRow = function () {\n rowNode.expanded = expand;\n recursiveExpandOrCollapse(rowNode.childrenAfterGroup);\n };\n if (usingTreeData) {\n var hasChildren = _.exists(rowNode.childrenAfterGroup);\n if (hasChildren) {\n actionRow();\n }\n return;\n }\n if (usingPivotMode) {\n var notLeafGroup = !rowNode.leafGroup;\n if (notLeafGroup) {\n actionRow();\n }\n return;\n }\n var isRowGroup = rowNode.group;\n if (isRowGroup) {\n actionRow();\n }\n });\n };\n if (this.rootNode) {\n recursiveExpandOrCollapse(this.rootNode.childrenAfterGroup);\n }\n this.refreshModel({ step: ClientSideRowModelSteps.MAP });\n var eventSource = expand ? 'expandAll' : 'collapseAll';\n var event = {\n type: Events.EVENT_EXPAND_COLLAPSE_ALL,\n source: eventSource\n };\n this.eventService.dispatchEvent(event);\n };\n ClientSideRowModel.prototype.doSort = function (rowNodeTransactions, changedPath) {\n this.sortStage.execute({\n rowNode: this.rootNode,\n rowNodeTransactions: rowNodeTransactions,\n changedPath: changedPath\n });\n };\n ClientSideRowModel.prototype.doRowGrouping = function (rowNodeTransactions, rowNodeOrder, changedPath, afterColumnsChanged) {\n if (this.groupStage) {\n if (rowNodeTransactions) {\n this.groupStage.execute({\n rowNode: this.rootNode,\n rowNodeTransactions: rowNodeTransactions,\n rowNodeOrder: rowNodeOrder,\n changedPath: changedPath\n });\n }\n else {\n this.groupStage.execute({\n rowNode: this.rootNode,\n changedPath: changedPath,\n afterColumnsChanged: afterColumnsChanged\n });\n }\n if (this.gridOptionsService.get('groupSelectsChildren')) {\n var selectionChanged = this.selectionService.updateGroupsFromChildrenSelections('rowGroupChanged', changedPath);\n if (selectionChanged) {\n var event_1 = {\n type: Events.EVENT_SELECTION_CHANGED,\n source: 'rowGroupChanged'\n };\n this.eventService.dispatchEvent(event_1);\n }\n }\n }\n else {\n this.rootNode.childrenAfterGroup = this.rootNode.allLeafChildren;\n if (this.rootNode.sibling) {\n this.rootNode.sibling.childrenAfterGroup = this.rootNode.childrenAfterGroup;\n }\n this.rootNode.updateHasChildren();\n }\n if (this.nodeManager.isRowCountReady()) {\n // only if row data has been set\n this.rowCountReady = true;\n this.eventService.dispatchEventOnce({\n type: Events.EVENT_ROW_COUNT_READY\n });\n }\n };\n ClientSideRowModel.prototype.doFilter = function (changedPath) {\n this.filterStage.execute({ rowNode: this.rootNode, changedPath: changedPath });\n };\n ClientSideRowModel.prototype.doPivot = function (changedPath) {\n if (this.pivotStage) {\n this.pivotStage.execute({ rowNode: this.rootNode, changedPath: changedPath });\n }\n };\n ClientSideRowModel.prototype.getCopyOfNodesMap = function () {\n return this.nodeManager.getCopyOfNodesMap();\n };\n ClientSideRowModel.prototype.getRowNode = function (id) {\n // although id is typed a string, this could be called by the user, and they could have passed a number\n var idIsGroup = typeof id == 'string' && id.indexOf(RowNode.ID_PREFIX_ROW_GROUP) == 0;\n if (idIsGroup) {\n // only one users complained about getRowNode not working for groups, after years of\n // this working for normal rows. so have done quick implementation. if users complain\n // about performance, then GroupStage should store / manage created groups in a map,\n // which is a chunk of work.\n var res_1 = undefined;\n this.forEachNode(function (node) {\n if (node.id === id) {\n res_1 = node;\n }\n });\n return res_1;\n }\n return this.nodeManager.getRowNode(id);\n };\n // rows: the rows to put into the model\n ClientSideRowModel.prototype.setRowData = function (rowData) {\n // no need to invalidate cache, as the cache is stored on the rowNode,\n // so new rowNodes means the cache is wiped anyway.\n // - clears selection, done before we set row data to ensure it isn't readded via `selectionService.syncInOldRowNode`\n this.selectionService.reset('rowDataChanged');\n this.nodeManager.setRowData(rowData);\n if (this.hasStarted) {\n this.dispatchUpdateEventsAndRefresh();\n }\n };\n ClientSideRowModel.prototype.dispatchUpdateEventsAndRefresh = function () {\n // this event kicks off:\n // - shows 'no rows' overlay if needed\n var rowDataUpdatedEvent = {\n type: Events.EVENT_ROW_DATA_UPDATED\n };\n this.eventService.dispatchEvent(rowDataUpdatedEvent);\n this.refreshModel({\n step: ClientSideRowModelSteps.EVERYTHING,\n newData: true,\n });\n };\n ClientSideRowModel.prototype.batchUpdateRowData = function (rowDataTransaction, callback) {\n var _this = this;\n if (this.applyAsyncTransactionsTimeout == null) {\n this.rowDataTransactionBatch = [];\n var waitMillis = this.gridOptionsService.getAsyncTransactionWaitMillis();\n this.applyAsyncTransactionsTimeout = window.setTimeout(function () {\n _this.executeBatchUpdateRowData();\n }, waitMillis);\n }\n this.rowDataTransactionBatch.push({ rowDataTransaction: rowDataTransaction, callback: callback });\n };\n ClientSideRowModel.prototype.flushAsyncTransactions = function () {\n if (this.applyAsyncTransactionsTimeout != null) {\n clearTimeout(this.applyAsyncTransactionsTimeout);\n this.executeBatchUpdateRowData();\n }\n };\n ClientSideRowModel.prototype.executeBatchUpdateRowData = function () {\n var _this = this;\n this.valueCache.onDataChanged();\n var callbackFuncsBound = [];\n var rowNodeTrans = [];\n // The rowGroup stage uses rowNodeOrder if order was provided. if we didn't pass 'true' to\n // commonUpdateRowData, using addIndex would have no effect when grouping.\n var forceRowNodeOrder = false;\n if (this.rowDataTransactionBatch) {\n this.rowDataTransactionBatch.forEach(function (tranItem) {\n var rowNodeTran = _this.nodeManager.updateRowData(tranItem.rowDataTransaction, undefined);\n rowNodeTrans.push(rowNodeTran);\n if (tranItem.callback) {\n callbackFuncsBound.push(tranItem.callback.bind(null, rowNodeTran));\n }\n if (typeof tranItem.rowDataTransaction.addIndex === 'number') {\n forceRowNodeOrder = true;\n }\n });\n }\n this.commonUpdateRowData(rowNodeTrans, undefined, forceRowNodeOrder);\n // do callbacks in next VM turn so it's async\n if (callbackFuncsBound.length > 0) {\n window.setTimeout(function () {\n callbackFuncsBound.forEach(function (func) { return func(); });\n }, 0);\n }\n if (rowNodeTrans.length > 0) {\n var event_2 = {\n type: Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED,\n results: rowNodeTrans\n };\n this.eventService.dispatchEvent(event_2);\n }\n this.rowDataTransactionBatch = null;\n this.applyAsyncTransactionsTimeout = undefined;\n };\n ClientSideRowModel.prototype.updateRowData = function (rowDataTran, rowNodeOrder) {\n this.valueCache.onDataChanged();\n var rowNodeTran = this.nodeManager.updateRowData(rowDataTran, rowNodeOrder);\n // if doing immutableData, addIndex is never present. however if doing standard transaction, and user\n // provided addIndex, then this is used in updateRowData. However if doing Enterprise, then the rowGroup\n // stage also uses the\n var forceRowNodeOrder = typeof rowDataTran.addIndex === 'number';\n this.commonUpdateRowData([rowNodeTran], rowNodeOrder, forceRowNodeOrder);\n return rowNodeTran;\n };\n ClientSideRowModel.prototype.createRowNodeOrder = function () {\n var suppressSortOrder = this.gridOptionsService.get('suppressMaintainUnsortedOrder');\n if (suppressSortOrder) {\n return;\n }\n var orderMap = {};\n if (this.rootNode && this.rootNode.allLeafChildren) {\n for (var index = 0; index < this.rootNode.allLeafChildren.length; index++) {\n var node = this.rootNode.allLeafChildren[index];\n orderMap[node.id] = index;\n }\n }\n return orderMap;\n };\n // common to updateRowData and batchUpdateRowData\n ClientSideRowModel.prototype.commonUpdateRowData = function (rowNodeTrans, rowNodeOrder, forceRowNodeOrder) {\n if (!this.hasStarted) {\n return;\n }\n var animate = !this.gridOptionsService.get('suppressAnimationFrame');\n if (forceRowNodeOrder) {\n rowNodeOrder = this.createRowNodeOrder();\n }\n var event = {\n type: Events.EVENT_ROW_DATA_UPDATED\n };\n this.eventService.dispatchEvent(event);\n this.refreshModel({\n step: ClientSideRowModelSteps.EVERYTHING,\n rowNodeTransactions: rowNodeTrans,\n rowNodeOrder: rowNodeOrder,\n keepRenderedRows: true,\n keepEditingRows: true,\n animate: animate\n });\n };\n ClientSideRowModel.prototype.doRowsToDisplay = function () {\n this.rowsToDisplay = this.flattenStage.execute({ rowNode: this.rootNode });\n };\n ClientSideRowModel.prototype.onRowHeightChanged = function () {\n this.refreshModel({ step: ClientSideRowModelSteps.MAP, keepRenderedRows: true, keepEditingRows: true, keepUndoRedoStack: true });\n };\n /** This method is debounced. It is used for row auto-height. If we don't debounce,\n * then the Row Models will end up recalculating each row position\n * for each row height change and result in the Row Renderer laying out rows.\n * This is particularly bad if using print layout, and showing eg 1,000 rows,\n * each row will change it's height, causing Row Model to update 1,000 times.\n */\n ClientSideRowModel.prototype.onRowHeightChangedDebounced = function () {\n this.onRowHeightChanged_debounced();\n };\n ClientSideRowModel.prototype.resetRowHeights = function () {\n var atLeastOne = this.resetRowHeightsForAllRowNodes();\n this.rootNode.setRowHeight(this.rootNode.rowHeight, true);\n if (this.rootNode.sibling) {\n this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight, true);\n }\n // when pivotMode but pivot not active, root node is displayed on its own\n // because it's only ever displayed alone, refreshing the model (onRowHeightChanged) is not required\n if (atLeastOne) {\n this.onRowHeightChanged();\n }\n };\n ClientSideRowModel.prototype.resetRowHeightsForAllRowNodes = function () {\n var atLeastOne = false;\n this.forEachNode(function (rowNode) {\n rowNode.setRowHeight(rowNode.rowHeight, true);\n // we keep the height each row is at, however we set estimated=true rather than clear the height.\n // this means the grid will not reset the row heights back to defaults, rather it will re-calc\n // the height for each row as the row is displayed. otherwise the scroll will jump when heights are reset.\n var detailNode = rowNode.detailNode;\n if (detailNode) {\n detailNode.setRowHeight(detailNode.rowHeight, true);\n }\n if (rowNode.sibling) {\n rowNode.sibling.setRowHeight(rowNode.sibling.rowHeight, true);\n }\n atLeastOne = true;\n });\n return atLeastOne;\n };\n ClientSideRowModel.prototype.onGridStylesChanges = function () {\n if (this.columnModel.isAutoRowHeightActive()) {\n return;\n }\n this.resetRowHeights();\n };\n ClientSideRowModel.prototype.onGridReady = function () {\n if (this.hasStarted) {\n return;\n }\n // App can start using API to add transactions, so need to add data into the node manager if not started\n this.setInitialData();\n };\n ClientSideRowModel.prototype.isRowDataLoaded = function () {\n return this.rowCountReady;\n };\n __decorate$b([\n Autowired('columnModel')\n ], ClientSideRowModel.prototype, \"columnModel\", void 0);\n __decorate$b([\n Autowired('selectionService')\n ], ClientSideRowModel.prototype, \"selectionService\", void 0);\n __decorate$b([\n Autowired('filterManager')\n ], ClientSideRowModel.prototype, \"filterManager\", void 0);\n __decorate$b([\n Autowired('valueCache')\n ], ClientSideRowModel.prototype, \"valueCache\", void 0);\n __decorate$b([\n Autowired('beans')\n ], ClientSideRowModel.prototype, \"beans\", void 0);\n __decorate$b([\n Autowired('filterStage')\n ], ClientSideRowModel.prototype, \"filterStage\", void 0);\n __decorate$b([\n Autowired('sortStage')\n ], ClientSideRowModel.prototype, \"sortStage\", void 0);\n __decorate$b([\n Autowired('flattenStage')\n ], ClientSideRowModel.prototype, \"flattenStage\", void 0);\n __decorate$b([\n Optional('groupStage')\n ], ClientSideRowModel.prototype, \"groupStage\", void 0);\n __decorate$b([\n Optional('aggregationStage')\n ], ClientSideRowModel.prototype, \"aggregationStage\", void 0);\n __decorate$b([\n Optional('pivotStage')\n ], ClientSideRowModel.prototype, \"pivotStage\", void 0);\n __decorate$b([\n Optional('filterAggregatesStage')\n ], ClientSideRowModel.prototype, \"filterAggregatesStage\", void 0);\n __decorate$b([\n PostConstruct\n ], ClientSideRowModel.prototype, \"init\", null);\n ClientSideRowModel = __decorate$b([\n Bean('rowModel')\n ], ClientSideRowModel);\n return ClientSideRowModel;\n}(BeanStub));\n\nvar __extends$b = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$a = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar FilterStage = /** @class */ (function (_super) {\n __extends$b(FilterStage, _super);\n function FilterStage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FilterStage.prototype.execute = function (params) {\n var changedPath = params.changedPath;\n this.filterService.filter(changedPath);\n };\n __decorate$a([\n Autowired('filterService')\n ], FilterStage.prototype, \"filterService\", void 0);\n FilterStage = __decorate$a([\n Bean('filterStage')\n ], FilterStage);\n return FilterStage;\n}(BeanStub));\n\nvar __extends$a = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$9 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SortStage = /** @class */ (function (_super) {\n __extends$a(SortStage, _super);\n function SortStage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SortStage.prototype.execute = function (params) {\n var _this = this;\n var sortOptions = this.sortController.getSortOptions();\n var sortActive = _.exists(sortOptions) && sortOptions.length > 0;\n var deltaSort = sortActive\n && _.exists(params.rowNodeTransactions)\n // in time we can remove this check, so that delta sort is always\n // on if transactions are present. it's off for now so that we can\n // selectively turn it on and test it with some select users before\n // rolling out to everyone.\n && this.gridOptionsService.get('deltaSort');\n var sortContainsGroupColumns = sortOptions.some(function (opt) {\n var isSortingCoupled = _this.gridOptionsService.isColumnsSortingCoupledToGroup();\n if (isSortingCoupled) {\n return opt.column.isPrimary() && opt.column.isRowGroupActive();\n }\n return !!opt.column.getColDef().showRowGroup;\n });\n this.sortService.sort(sortOptions, sortActive, deltaSort, params.rowNodeTransactions, params.changedPath, sortContainsGroupColumns);\n };\n __decorate$9([\n Autowired('sortService')\n ], SortStage.prototype, \"sortService\", void 0);\n __decorate$9([\n Autowired('sortController')\n ], SortStage.prototype, \"sortController\", void 0);\n SortStage = __decorate$9([\n Bean('sortStage')\n ], SortStage);\n return SortStage;\n}(BeanStub));\n\nvar __extends$9 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$8 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar FlattenStage = /** @class */ (function (_super) {\n __extends$9(FlattenStage, _super);\n function FlattenStage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FlattenStage.prototype.execute = function (params) {\n var rootNode = params.rowNode;\n // even if not doing grouping, we do the mapping, as the client might\n // of passed in data that already has a grouping in it somewhere\n var result = [];\n var skipLeafNodes = this.columnModel.isPivotMode();\n // if we are reducing, and not grouping, then we want to show the root node, as that\n // is where the pivot values are\n var showRootNode = skipLeafNodes && rootNode.leafGroup;\n var topList = showRootNode ? [rootNode] : rootNode.childrenAfterSort;\n var details = this.getFlattenDetails();\n this.recursivelyAddToRowsToDisplay(details, topList, result, skipLeafNodes, 0);\n // we do not want the footer total if the gris is empty\n var atLeastOneRowPresent = result.length > 0;\n var includeGroupTotalFooter = !showRootNode\n // don't show total footer when showRootNode is true (i.e. in pivot mode and no groups)\n && atLeastOneRowPresent\n && details.groupIncludeTotalFooter;\n if (includeGroupTotalFooter) {\n rootNode.createFooter();\n this.addRowNodeToRowsToDisplay(details, rootNode.sibling, result, 0);\n }\n return result;\n };\n FlattenStage.prototype.getFlattenDetails = function () {\n // these two are mutually exclusive, so if first set, we don't set the second\n var groupRemoveSingleChildren = this.gridOptionsService.get('groupRemoveSingleChildren');\n var groupRemoveLowestSingleChildren = !groupRemoveSingleChildren && this.gridOptionsService.get('groupRemoveLowestSingleChildren');\n return {\n groupRemoveLowestSingleChildren: groupRemoveLowestSingleChildren,\n groupRemoveSingleChildren: groupRemoveSingleChildren,\n isGroupMultiAutoColumn: this.gridOptionsService.isGroupMultiAutoColumn(),\n hideOpenParents: this.gridOptionsService.get('groupHideOpenParents'),\n groupIncludeTotalFooter: this.gridOptionsService.get('groupIncludeTotalFooter'),\n getGroupIncludeFooter: this.gridOptionsService.getGroupIncludeFooter(),\n };\n };\n FlattenStage.prototype.recursivelyAddToRowsToDisplay = function (details, rowsToFlatten, result, skipLeafNodes, uiLevel) {\n if (_.missingOrEmpty(rowsToFlatten)) {\n return;\n }\n for (var i = 0; i < rowsToFlatten.length; i++) {\n var rowNode = rowsToFlatten[i];\n // check all these cases, for working out if this row should be included in the final mapped list\n var isParent = rowNode.hasChildren();\n var isSkippedLeafNode = skipLeafNodes && !isParent;\n var isRemovedSingleChildrenGroup = details.groupRemoveSingleChildren && isParent && rowNode.childrenAfterGroup.length === 1;\n var isRemovedLowestSingleChildrenGroup = details.groupRemoveLowestSingleChildren &&\n isParent &&\n rowNode.leafGroup &&\n rowNode.childrenAfterGroup.length === 1;\n // hide open parents means when group is open, we don't show it. we also need to make sure the\n // group is expandable in the first place (as leaf groups are not expandable if pivot mode is on).\n // the UI will never allow expanding leaf groups, however the user might via the API (or menu option 'expand all row groups')\n var neverAllowToExpand = skipLeafNodes && rowNode.leafGroup;\n var isHiddenOpenParent = details.hideOpenParents && rowNode.expanded && !rowNode.master && !neverAllowToExpand;\n var thisRowShouldBeRendered = !isSkippedLeafNode && !isHiddenOpenParent &&\n !isRemovedSingleChildrenGroup && !isRemovedLowestSingleChildrenGroup;\n if (thisRowShouldBeRendered) {\n this.addRowNodeToRowsToDisplay(details, rowNode, result, uiLevel);\n }\n // if we are pivoting, we never map below the leaf group\n if (skipLeafNodes && rowNode.leafGroup) {\n continue;\n }\n if (isParent) {\n var excludedParent = isRemovedSingleChildrenGroup || isRemovedLowestSingleChildrenGroup;\n // we traverse the group if it is expended, however we always traverse if the parent node\n // was removed (as the group will never be opened if it is not displayed, we show the children instead)\n if (rowNode.expanded || excludedParent) {\n // if the parent was excluded, then ui level is that of the parent\n var uiLevelForChildren = excludedParent ? uiLevel : uiLevel + 1;\n this.recursivelyAddToRowsToDisplay(details, rowNode.childrenAfterSort, result, skipLeafNodes, uiLevelForChildren);\n // put a footer in if user is looking for it\n var doesRowShowFooter = details.getGroupIncludeFooter({ node: rowNode });\n if (doesRowShowFooter) {\n // ensure node is available.\n rowNode.createFooter();\n this.addRowNodeToRowsToDisplay(details, rowNode.sibling, result, uiLevelForChildren);\n }\n else {\n // remove node if it's unnecessary.\n rowNode.destroyFooter();\n }\n }\n }\n else if (rowNode.master && rowNode.expanded) {\n var detailNode = this.createDetailNode(rowNode);\n this.addRowNodeToRowsToDisplay(details, detailNode, result, uiLevel);\n }\n }\n };\n // duplicated method, it's also in floatingRowModel\n FlattenStage.prototype.addRowNodeToRowsToDisplay = function (details, rowNode, result, uiLevel) {\n result.push(rowNode);\n rowNode.setUiLevel(details.isGroupMultiAutoColumn ? 0 : uiLevel);\n };\n FlattenStage.prototype.createDetailNode = function (masterNode) {\n if (_.exists(masterNode.detailNode)) {\n return masterNode.detailNode;\n }\n var detailNode = new RowNode(this.beans);\n detailNode.detail = true;\n detailNode.selectable = false;\n detailNode.parent = masterNode;\n if (_.exists(masterNode.id)) {\n detailNode.id = 'detail_' + masterNode.id;\n }\n detailNode.data = masterNode.data;\n detailNode.level = masterNode.level + 1;\n masterNode.detailNode = detailNode;\n return detailNode;\n };\n __decorate$8([\n Autowired('columnModel')\n ], FlattenStage.prototype, \"columnModel\", void 0);\n __decorate$8([\n Autowired('beans')\n ], FlattenStage.prototype, \"beans\", void 0);\n FlattenStage = __decorate$8([\n Bean('flattenStage')\n ], FlattenStage);\n return FlattenStage;\n}(BeanStub));\n\nvar __extends$8 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$7 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SortService = /** @class */ (function (_super) {\n __extends$8(SortService, _super);\n function SortService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SortService.prototype.sort = function (sortOptions, sortActive, useDeltaSort, rowNodeTransactions, changedPath, sortContainsGroupColumns) {\n var _this = this;\n var groupMaintainOrder = this.gridOptionsService.get('groupMaintainOrder');\n var groupColumnsPresent = this.columnModel.getAllGridColumns().some(function (c) { return c.isRowGroupActive(); });\n var allDirtyNodes = {};\n if (useDeltaSort && rowNodeTransactions) {\n allDirtyNodes = this.calculateDirtyNodes(rowNodeTransactions);\n }\n var isPivotMode = this.columnModel.isPivotMode();\n var postSortFunc = this.gridOptionsService.getCallback('postSortRows');\n var callback = function (rowNode) {\n var _a;\n // we clear out the 'pull down open parents' first, as the values mix up the sorting\n _this.pullDownGroupDataForHideOpenParents(rowNode.childrenAfterAggFilter, true);\n // It's pointless to sort rows which aren't being displayed. in pivot mode we don't need to sort the leaf group children.\n var skipSortingPivotLeafs = isPivotMode && rowNode.leafGroup;\n // Javascript sort is non deterministic when all the array items are equals, ie Comparator always returns 0,\n // so to ensure the array keeps its order, add an additional sorting condition manually, in this case we\n // are going to inspect the original array position. This is what sortedRowNodes is for.\n var skipSortingGroups = groupMaintainOrder && groupColumnsPresent && !rowNode.leafGroup && !sortContainsGroupColumns;\n if (skipSortingGroups) {\n var nextGroup = (_a = _this.columnModel.getRowGroupColumns()) === null || _a === void 0 ? void 0 : _a[rowNode.level + 1];\n // if the sort is null, then sort was explicitly removed, so remove sort from this group.\n var wasSortExplicitlyRemoved = (nextGroup === null || nextGroup === void 0 ? void 0 : nextGroup.getSort()) === null;\n var childrenToBeSorted = rowNode.childrenAfterAggFilter.slice(0);\n if (rowNode.childrenAfterSort && !wasSortExplicitlyRemoved) {\n var indexedOrders_1 = {};\n rowNode.childrenAfterSort.forEach(function (node, idx) {\n indexedOrders_1[node.id] = idx;\n });\n childrenToBeSorted.sort(function (row1, row2) { var _a, _b; return ((_a = indexedOrders_1[row1.id]) !== null && _a !== void 0 ? _a : 0) - ((_b = indexedOrders_1[row2.id]) !== null && _b !== void 0 ? _b : 0); });\n }\n rowNode.childrenAfterSort = childrenToBeSorted;\n }\n else if (!sortActive || skipSortingPivotLeafs) {\n // if there's no sort to make, skip this step\n rowNode.childrenAfterSort = rowNode.childrenAfterAggFilter.slice(0);\n }\n else if (useDeltaSort) {\n rowNode.childrenAfterSort = _this.doDeltaSort(rowNode, allDirtyNodes, changedPath, sortOptions);\n }\n else {\n rowNode.childrenAfterSort = _this.rowNodeSorter.doFullSort(rowNode.childrenAfterAggFilter, sortOptions);\n }\n if (rowNode.sibling) {\n rowNode.sibling.childrenAfterSort = rowNode.childrenAfterSort;\n }\n _this.updateChildIndexes(rowNode);\n if (postSortFunc) {\n var params = { nodes: rowNode.childrenAfterSort };\n postSortFunc(params);\n }\n };\n if (changedPath) {\n changedPath.forEachChangedNodeDepthFirst(callback);\n }\n this.updateGroupDataForHideOpenParents(changedPath);\n };\n SortService.prototype.calculateDirtyNodes = function (rowNodeTransactions) {\n var dirtyNodes = {};\n var addNodesFunc = function (rowNodes) {\n if (rowNodes) {\n rowNodes.forEach(function (rowNode) { return dirtyNodes[rowNode.id] = true; });\n }\n };\n // all leaf level nodes in the transaction were impacted\n if (rowNodeTransactions) {\n rowNodeTransactions.forEach(function (tran) {\n addNodesFunc(tran.add);\n addNodesFunc(tran.update);\n addNodesFunc(tran.remove);\n });\n }\n return dirtyNodes;\n };\n SortService.prototype.doDeltaSort = function (rowNode, allTouchedNodes, changedPath, sortOptions) {\n var _this = this;\n var unsortedRows = rowNode.childrenAfterAggFilter;\n var oldSortedRows = rowNode.childrenAfterSort;\n if (!oldSortedRows) {\n return this.rowNodeSorter.doFullSort(unsortedRows, sortOptions);\n }\n var untouchedRowsMap = {};\n var touchedRows = [];\n unsortedRows.forEach(function (row) {\n if (allTouchedNodes[row.id] || !changedPath.canSkip(row)) {\n touchedRows.push(row);\n }\n else {\n untouchedRowsMap[row.id] = true;\n }\n });\n var sortedUntouchedRows = oldSortedRows.filter(function (child) { return untouchedRowsMap[child.id]; });\n var mapNodeToSortedNode = function (rowNode, pos) { return ({ currentPos: pos, rowNode: rowNode }); };\n var sortedChangedRows = touchedRows\n .map(mapNodeToSortedNode)\n .sort(function (a, b) { return _this.rowNodeSorter.compareRowNodes(sortOptions, a, b); });\n return this.mergeSortedArrays(sortOptions, sortedChangedRows, sortedUntouchedRows.map(mapNodeToSortedNode)).map(function (_a) {\n var rowNode = _a.rowNode;\n return rowNode;\n });\n };\n // Merge two sorted arrays into each other\n SortService.prototype.mergeSortedArrays = function (sortOptions, arr1, arr2) {\n var res = [];\n var i = 0;\n var j = 0;\n // Traverse both array, adding them in order\n while (i < arr1.length && j < arr2.length) {\n // Check if current element of first\n // array is smaller than current element\n // of second array. If yes, store first\n // array element and increment first array\n // index. Otherwise do same with second array\n var compareResult = this.rowNodeSorter.compareRowNodes(sortOptions, arr1[i], arr2[j]);\n if (compareResult < 0) {\n res.push(arr1[i++]);\n }\n else {\n res.push(arr2[j++]);\n }\n }\n // add remaining from arr1\n while (i < arr1.length) {\n res.push(arr1[i++]);\n }\n // add remaining from arr2\n while (j < arr2.length) {\n res.push(arr2[j++]);\n }\n return res;\n };\n SortService.prototype.updateChildIndexes = function (rowNode) {\n if (_.missing(rowNode.childrenAfterSort)) {\n return;\n }\n var listToSort = rowNode.childrenAfterSort;\n for (var i = 0; i < listToSort.length; i++) {\n var child = listToSort[i];\n var firstChild = i === 0;\n var lastChild = i === rowNode.childrenAfterSort.length - 1;\n child.setFirstChild(firstChild);\n child.setLastChild(lastChild);\n child.setChildIndex(i);\n }\n };\n SortService.prototype.updateGroupDataForHideOpenParents = function (changedPath) {\n var _this = this;\n if (!this.gridOptionsService.get('groupHideOpenParents')) {\n return;\n }\n if (this.gridOptionsService.get('treeData')) {\n _.warnOnce(\"The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them.\");\n return false;\n }\n // recurse breadth first over group nodes after sort to 'pull down' group data to child groups\n var callback = function (rowNode) {\n _this.pullDownGroupDataForHideOpenParents(rowNode.childrenAfterSort, false);\n rowNode.childrenAfterSort.forEach(function (child) {\n if (child.hasChildren()) {\n callback(child);\n }\n });\n };\n if (changedPath) {\n changedPath.executeFromRootNode(function (rowNode) { return callback(rowNode); });\n }\n };\n SortService.prototype.pullDownGroupDataForHideOpenParents = function (rowNodes, clearOperation) {\n var _this = this;\n if (!this.gridOptionsService.get('groupHideOpenParents') || _.missing(rowNodes)) {\n return;\n }\n rowNodes.forEach(function (childRowNode) {\n var groupDisplayCols = _this.columnModel.getGroupDisplayColumns();\n groupDisplayCols.forEach(function (groupDisplayCol) {\n var showRowGroup = groupDisplayCol.getColDef().showRowGroup;\n if (typeof showRowGroup !== 'string') {\n console.error('AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup');\n return;\n }\n var displayingGroupKey = showRowGroup;\n var rowGroupColumn = _this.columnModel.getPrimaryColumn(displayingGroupKey);\n var thisRowNodeMatches = rowGroupColumn === childRowNode.rowGroupColumn;\n if (thisRowNodeMatches) {\n return;\n }\n if (clearOperation) {\n // if doing a clear operation, we clear down the value for every possible group column\n childRowNode.setGroupValue(groupDisplayCol.getId(), undefined);\n }\n else {\n // if doing a set operation, we set only where the pull down is to occur\n var parentToStealFrom = childRowNode.getFirstChildOfFirstChild(rowGroupColumn);\n if (parentToStealFrom) {\n childRowNode.setGroupValue(groupDisplayCol.getId(), parentToStealFrom.key);\n }\n }\n });\n });\n };\n __decorate$7([\n Autowired('columnModel')\n ], SortService.prototype, \"columnModel\", void 0);\n __decorate$7([\n Autowired('rowNodeSorter')\n ], SortService.prototype, \"rowNodeSorter\", void 0);\n SortService = __decorate$7([\n Bean('sortService')\n ], SortService);\n return SortService;\n}(BeanStub));\n\nvar __extends$7 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$6 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar FilterService = /** @class */ (function (_super) {\n __extends$7(FilterService, _super);\n function FilterService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FilterService.prototype.filter = function (changedPath) {\n var filterActive = this.filterManager.isChildFilterPresent();\n this.filterNodes(filterActive, changedPath);\n };\n FilterService.prototype.filterNodes = function (filterActive, changedPath) {\n var _this = this;\n var filterCallback = function (rowNode, includeChildNodes) {\n // recursively get all children that are groups to also filter\n if (rowNode.hasChildren()) {\n // result of filter for this node. when filtering tree data, includeChildNodes = true when parent passes\n if (filterActive && !includeChildNodes) {\n rowNode.childrenAfterFilter = rowNode.childrenAfterGroup.filter(function (childNode) {\n // a group is included in the result if it has any children of it's own.\n // by this stage, the child groups are already filtered\n var passBecauseChildren = childNode.childrenAfterFilter && childNode.childrenAfterFilter.length > 0;\n // both leaf level nodes and tree data nodes have data. these get added if\n // the data passes the filter\n var passBecauseDataPasses = childNode.data\n && _this.filterManager.doesRowPassFilter({ rowNode: childNode });\n // note - tree data nodes pass either if a) they pass themselves or b) any children of that node pass\n return passBecauseChildren || passBecauseDataPasses;\n });\n }\n else {\n // if not filtering, the result is the original list\n rowNode.childrenAfterFilter = rowNode.childrenAfterGroup;\n }\n }\n else {\n rowNode.childrenAfterFilter = rowNode.childrenAfterGroup;\n }\n if (rowNode.sibling) {\n rowNode.sibling.childrenAfterFilter = rowNode.childrenAfterFilter;\n }\n };\n if (this.doingTreeDataFiltering()) {\n var treeDataDepthFirstFilter_1 = function (rowNode, alreadyFoundInParent) {\n // tree data filter traverses the hierarchy depth first and includes child nodes if parent passes\n // filter, and parent nodes will be include if any children exist.\n if (rowNode.childrenAfterGroup) {\n for (var i = 0; i < rowNode.childrenAfterGroup.length; i++) {\n var childNode = rowNode.childrenAfterGroup[i];\n // first check if current node passes filter before invoking child nodes\n var foundInParent = alreadyFoundInParent\n || _this.filterManager.doesRowPassFilter({ rowNode: childNode });\n if (childNode.childrenAfterGroup) {\n treeDataDepthFirstFilter_1(rowNode.childrenAfterGroup[i], foundInParent);\n }\n else {\n filterCallback(childNode, foundInParent);\n }\n }\n }\n filterCallback(rowNode, alreadyFoundInParent);\n };\n var treeDataFilterCallback = function (rowNode) { return treeDataDepthFirstFilter_1(rowNode, false); };\n changedPath.executeFromRootNode(treeDataFilterCallback);\n }\n else {\n var defaultFilterCallback = function (rowNode) { return filterCallback(rowNode, false); };\n changedPath.forEachChangedNodeDepthFirst(defaultFilterCallback, true);\n }\n };\n FilterService.prototype.doingTreeDataFiltering = function () {\n return this.gridOptionsService.get('treeData') && !this.gridOptionsService.get('excludeChildrenWhenTreeDataFiltering');\n };\n __decorate$6([\n Autowired('filterManager')\n ], FilterService.prototype, \"filterManager\", void 0);\n FilterService = __decorate$6([\n Bean(\"filterService\")\n ], FilterService);\n return FilterService;\n}(BeanStub));\n\nvar __extends$6 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$5 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$1 = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar ImmutableService = /** @class */ (function (_super) {\n __extends$6(ImmutableService, _super);\n function ImmutableService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ImmutableService.prototype.postConstruct = function () {\n var _this = this;\n if (this.rowModel.getType() === 'clientSide') {\n this.clientSideRowModel = this.rowModel;\n this.addManagedPropertyListener('rowData', function () { return _this.onRowDataUpdated(); });\n }\n };\n ImmutableService.prototype.isActive = function () {\n var getRowIdProvided = this.gridOptionsService.exists('getRowId');\n // this property is a backwards compatibility property, for those who want\n // the old behaviour of Row ID's but NOT Immutable Data.\n var resetRowDataOnUpdate = this.gridOptionsService.get('resetRowDataOnUpdate');\n if (resetRowDataOnUpdate) {\n return false;\n }\n return getRowIdProvided;\n };\n ImmutableService.prototype.setRowData = function (rowData) {\n var transactionAndMap = this.createTransactionForRowData(rowData);\n if (!transactionAndMap) {\n return;\n }\n var _a = __read$1(transactionAndMap, 2), transaction = _a[0], orderIdMap = _a[1];\n this.clientSideRowModel.updateRowData(transaction, orderIdMap);\n };\n // converts the setRowData() command to a transaction\n ImmutableService.prototype.createTransactionForRowData = function (rowData) {\n if (_.missing(this.clientSideRowModel)) {\n console.error('AG Grid: ImmutableService only works with ClientSideRowModel');\n return;\n }\n var getRowIdFunc = this.gridOptionsService.getCallback('getRowId');\n if (getRowIdFunc == null) {\n console.error('AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!');\n return;\n }\n // convert the data into a transaction object by working out adds, removes and updates\n var transaction = {\n remove: [],\n update: [],\n add: []\n };\n var existingNodesMap = this.clientSideRowModel.getCopyOfNodesMap();\n var suppressSortOrder = this.gridOptionsService.get('suppressMaintainUnsortedOrder');\n var orderMap = suppressSortOrder ? undefined : {};\n if (_.exists(rowData)) {\n // split all the new data in the following:\n // if new, push to 'add'\n // if update, push to 'update'\n // if not changed, do not include in the transaction\n rowData.forEach(function (data, index) {\n var id = getRowIdFunc({ data: data, level: 0 });\n var existingNode = existingNodesMap[id];\n if (orderMap) {\n orderMap[id] = index;\n }\n if (existingNode) {\n var dataHasChanged = existingNode.data !== data;\n if (dataHasChanged) {\n transaction.update.push(data);\n }\n // otherwise, if data not changed, we just don't include it anywhere, as it's not a delta\n // remove from list, so we know the item is not to be removed\n existingNodesMap[id] = undefined;\n }\n else {\n transaction.add.push(data);\n }\n });\n }\n // at this point, all rows that are left, should be removed\n _.iterateObject(existingNodesMap, function (id, rowNode) {\n if (rowNode) {\n transaction.remove.push(rowNode.data);\n }\n });\n return [transaction, orderMap];\n };\n ImmutableService.prototype.onRowDataUpdated = function () {\n var rowData = this.gridOptionsService.get('rowData');\n if (!rowData) {\n return;\n }\n if (this.isActive()) {\n this.setRowData(rowData);\n }\n else {\n this.selectionService.reset('rowDataChanged');\n this.clientSideRowModel.setRowData(rowData);\n }\n };\n __decorate$5([\n Autowired('rowModel')\n ], ImmutableService.prototype, \"rowModel\", void 0);\n __decorate$5([\n Autowired('rowRenderer')\n ], ImmutableService.prototype, \"rowRenderer\", void 0);\n __decorate$5([\n Autowired('selectionService')\n ], ImmutableService.prototype, \"selectionService\", void 0);\n __decorate$5([\n PostConstruct\n ], ImmutableService.prototype, \"postConstruct\", null);\n ImmutableService = __decorate$5([\n Bean('immutableService')\n ], ImmutableService);\n return ImmutableService;\n}(BeanStub));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$2 = '31.1.1';\n\nvar ClientSideRowModelModule = {\n version: VERSION$2,\n moduleName: ModuleNames.ClientSideRowModelModule,\n rowModel: 'clientSide',\n beans: [ClientSideRowModel, FilterStage, SortStage, FlattenStage, SortService, FilterService, ImmutableService],\n};\n\nvar __extends$5 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$4 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar InfiniteBlock = /** @class */ (function (_super) {\n __extends$5(InfiniteBlock, _super);\n function InfiniteBlock(id, parentCache, params) {\n var _this = _super.call(this, id) || this;\n _this.parentCache = parentCache;\n _this.params = params;\n // we don't need to calculate these now, as the inputs don't change,\n // however it makes the code easier to read if we work them out up front\n _this.startRow = id * params.blockSize;\n _this.endRow = _this.startRow + params.blockSize;\n return _this;\n }\n InfiniteBlock.prototype.postConstruct = function () {\n this.createRowNodes();\n };\n InfiniteBlock.prototype.getBlockStateJson = function () {\n return {\n id: '' + this.getId(),\n state: {\n blockNumber: this.getId(),\n startRow: this.getStartRow(),\n endRow: this.getEndRow(),\n pageStatus: this.getState()\n }\n };\n };\n InfiniteBlock.prototype.setDataAndId = function (rowNode, data, index) {\n if (_.exists(data)) {\n // this means if the user is not providing id's we just use the\n // index for the row. this will allow selection to work (that is based\n // on index) as long user is not inserting or deleting rows,\n // or wanting to keep selection between server side sorting or filtering\n rowNode.setDataAndId(data, index.toString());\n }\n else {\n rowNode.setDataAndId(undefined, undefined);\n }\n };\n InfiniteBlock.prototype.loadFromDatasource = function () {\n var _this = this;\n var params = this.createLoadParams();\n if (_.missing(this.params.datasource.getRows)) {\n console.warn(\"AG Grid: datasource is missing getRows method\");\n return;\n }\n // put in timeout, to force result to be async\n window.setTimeout(function () {\n _this.params.datasource.getRows(params);\n }, 0);\n };\n InfiniteBlock.prototype.processServerFail = function () {\n // todo - this method has better handling in SSRM\n };\n InfiniteBlock.prototype.createLoadParams = function () {\n // PROBLEM . . . . when the user sets sort via colDef.sort, then this code\n // is executing before the sort is set up, so server is not getting the sort\n // model. need to change with regards order - so the server side request is\n // AFTER thus it gets the right sort model.\n var params = {\n startRow: this.getStartRow(),\n endRow: this.getEndRow(),\n successCallback: this.pageLoaded.bind(this, this.getVersion()),\n failCallback: this.pageLoadFailed.bind(this, this.getVersion()),\n sortModel: this.params.sortModel,\n filterModel: this.params.filterModel,\n context: this.gridOptionsService.getGridCommonParams().context\n };\n return params;\n };\n InfiniteBlock.prototype.forEachNode = function (callback, sequence, rowCount) {\n var _this = this;\n this.rowNodes.forEach(function (rowNode, index) {\n var rowIndex = _this.startRow + index;\n if (rowIndex < rowCount) {\n callback(rowNode, sequence.next());\n }\n });\n };\n InfiniteBlock.prototype.getLastAccessed = function () {\n return this.lastAccessed;\n };\n InfiniteBlock.prototype.getRow = function (rowIndex, dontTouchLastAccessed) {\n if (dontTouchLastAccessed === void 0) { dontTouchLastAccessed = false; }\n if (!dontTouchLastAccessed) {\n this.lastAccessed = this.params.lastAccessedSequence.next();\n }\n var localIndex = rowIndex - this.startRow;\n return this.rowNodes[localIndex];\n };\n InfiniteBlock.prototype.getStartRow = function () {\n return this.startRow;\n };\n InfiniteBlock.prototype.getEndRow = function () {\n return this.endRow;\n };\n // creates empty row nodes, data is missing as not loaded yet\n InfiniteBlock.prototype.createRowNodes = function () {\n this.rowNodes = [];\n for (var i = 0; i < this.params.blockSize; i++) {\n var rowIndex = this.startRow + i;\n var rowNode = new RowNode(this.beans);\n rowNode.setRowHeight(this.params.rowHeight);\n rowNode.uiLevel = 0;\n rowNode.setRowIndex(rowIndex);\n rowNode.setRowTop(this.params.rowHeight * rowIndex);\n this.rowNodes.push(rowNode);\n }\n };\n InfiniteBlock.prototype.processServerResult = function (params) {\n var _this = this;\n this.rowNodes.forEach(function (rowNode, index) {\n var data = params.rowData ? params.rowData[index] : undefined;\n if (!rowNode.id && rowNode.alreadyRendered && data) {\n // if the node had no id and was rendered, but we have data for it now, then\n // destroy the old row and copy its position into new row. This prevents an additional\n // set of events being fired as the row renderer tries to understand the changing id\n _this.rowNodes[index] = new RowNode(_this.beans);\n _this.rowNodes[index].setRowIndex(rowNode.rowIndex);\n _this.rowNodes[index].setRowTop(rowNode.rowTop);\n _this.rowNodes[index].setRowHeight(rowNode.rowHeight);\n // clean up the old row\n rowNode.clearRowTopAndRowIndex();\n }\n _this.setDataAndId(_this.rowNodes[index], data, _this.startRow + index);\n });\n var finalRowCount = params.rowCount != null && params.rowCount >= 0 ? params.rowCount : undefined;\n this.parentCache.pageLoaded(this, finalRowCount);\n };\n InfiniteBlock.prototype.destroyRowNodes = function () {\n this.rowNodes.forEach(function (rowNode) {\n // this is needed, so row render knows to fade out the row, otherwise it\n // sees row top is present, and thinks the row should be shown.\n rowNode.clearRowTopAndRowIndex();\n });\n };\n __decorate$4([\n Autowired('beans')\n ], InfiniteBlock.prototype, \"beans\", void 0);\n __decorate$4([\n PostConstruct\n ], InfiniteBlock.prototype, \"postConstruct\", null);\n __decorate$4([\n PreDestroy\n ], InfiniteBlock.prototype, \"destroyRowNodes\", null);\n return InfiniteBlock;\n}(RowNodeBlock));\n\nvar __extends$4 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$3 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = ( false) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar InfiniteCache = /** @class */ (function (_super) {\n __extends$4(InfiniteCache, _super);\n function InfiniteCache(params) {\n var _this = _super.call(this) || this;\n _this.lastRowIndexKnown = false;\n _this.blocks = {};\n _this.blockCount = 0;\n _this.rowCount = params.initialRowCount;\n _this.params = params;\n return _this;\n }\n InfiniteCache.prototype.setBeans = function (loggerFactory) {\n this.logger = loggerFactory.create('InfiniteCache');\n };\n // the rowRenderer will not pass dontCreatePage, meaning when rendering the grid,\n // it will want new pages in the cache as it asks for rows. only when we are inserting /\n // removing rows via the api is dontCreatePage set, where we move rows between the pages.\n InfiniteCache.prototype.getRow = function (rowIndex, dontCreatePage) {\n if (dontCreatePage === void 0) { dontCreatePage = false; }\n var blockId = Math.floor(rowIndex / this.params.blockSize);\n var block = this.blocks[blockId];\n if (!block) {\n if (dontCreatePage) {\n return undefined;\n }\n block = this.createBlock(blockId);\n }\n return block.getRow(rowIndex);\n };\n InfiniteCache.prototype.createBlock = function (blockNumber) {\n var newBlock = this.createBean(new InfiniteBlock(blockNumber, this, this.params));\n this.blocks[newBlock.getId()] = newBlock;\n this.blockCount++;\n this.purgeBlocksIfNeeded(newBlock);\n this.params.rowNodeBlockLoader.addBlock(newBlock);\n return newBlock;\n };\n // we have this on infinite row model only, not server side row model,\n // because for server side, it would leave the children in inconsistent\n // state - eg if a node had children, but after the refresh it had data\n // for a different row, then the children would be with the wrong row node.\n InfiniteCache.prototype.refreshCache = function () {\n var nothingToRefresh = this.blockCount == 0;\n if (nothingToRefresh) {\n this.purgeCache();\n return;\n }\n this.getBlocksInOrder().forEach(function (block) { return block.setStateWaitingToLoad(); });\n this.params.rowNodeBlockLoader.checkBlockToLoad();\n };\n InfiniteCache.prototype.destroyAllBlocks = function () {\n var _this = this;\n this.getBlocksInOrder().forEach(function (block) { return _this.destroyBlock(block); });\n };\n InfiniteCache.prototype.getRowCount = function () {\n return this.rowCount;\n };\n InfiniteCache.prototype.isLastRowIndexKnown = function () {\n return this.lastRowIndexKnown;\n };\n // block calls this, when page loaded\n InfiniteCache.prototype.pageLoaded = function (block, lastRow) {\n // if we are not active, then we ignore all events, otherwise we could end up getting the\n // grid to refresh even though we are no longer the active cache\n if (!this.isAlive()) {\n return;\n }\n this.logger.log(\"onPageLoaded: page = \".concat(block.getId(), \", lastRow = \").concat(lastRow));\n this.checkRowCount(block, lastRow);\n // we fire cacheUpdated even if the row count has not changed, as some items need updating even\n // if no new rows to render. for example the pagination panel has '?' as the total rows when loading\n // is underway, which would need to get updated when loading finishes.\n this.onCacheUpdated();\n };\n InfiniteCache.prototype.purgeBlocksIfNeeded = function (blockToExclude) {\n var _this = this;\n // we exclude checking for the page just created, as this has yet to be accessed and hence\n // the lastAccessed stamp will not be updated for the first time yet\n var blocksForPurging = this.getBlocksInOrder().filter(function (b) { return b != blockToExclude; });\n var lastAccessedComparator = function (a, b) { return b.getLastAccessed() - a.getLastAccessed(); };\n blocksForPurging.sort(lastAccessedComparator);\n // we remove (maxBlocksInCache - 1) as we already excluded the 'just created' page.\n // in other words, after the splice operation below, we have taken out the blocks\n // we want to keep, which means we are left with blocks that we can potentially purge\n var maxBlocksProvided = this.params.maxBlocksInCache > 0;\n var blocksToKeep = maxBlocksProvided ? this.params.maxBlocksInCache - 1 : null;\n var emptyBlocksToKeep = InfiniteCache.MAX_EMPTY_BLOCKS_TO_KEEP - 1;\n blocksForPurging.forEach(function (block, index) {\n var purgeBecauseBlockEmpty = block.getState() === InfiniteBlock.STATE_WAITING_TO_LOAD && index >= emptyBlocksToKeep;\n var purgeBecauseCacheFull = maxBlocksProvided ? index >= blocksToKeep : false;\n if (purgeBecauseBlockEmpty || purgeBecauseCacheFull) {\n // if the block currently has rows been displayed, then don't remove it either.\n // this can happen if user has maxBlocks=2, and blockSize=5 (thus 10 max rows in cache)\n // but the screen is showing 20 rows, so at least 4 blocks are needed.\n if (_this.isBlockCurrentlyDisplayed(block)) {\n return;\n }\n // don't want to loose keyboard focus, so keyboard navigation can continue. so keep focused blocks.\n if (_this.isBlockFocused(block)) {\n return;\n }\n // at this point, block is not needed, so burn baby burn\n _this.removeBlockFromCache(block);\n }\n });\n };\n InfiniteCache.prototype.isBlockFocused = function (block) {\n var focusedCell = this.focusService.getFocusCellToUseAfterRefresh();\n if (!focusedCell) {\n return false;\n }\n if (focusedCell.rowPinned != null) {\n return false;\n }\n var blockIndexStart = block.getStartRow();\n var blockIndexEnd = block.getEndRow();\n var hasFocus = focusedCell.rowIndex >= blockIndexStart && focusedCell.rowIndex < blockIndexEnd;\n return hasFocus;\n };\n InfiniteCache.prototype.isBlockCurrentlyDisplayed = function (block) {\n var startIndex = block.getStartRow();\n var endIndex = block.getEndRow() - 1;\n return this.rowRenderer.isRangeInRenderedViewport(startIndex, endIndex);\n };\n InfiniteCache.prototype.removeBlockFromCache = function (blockToRemove) {\n if (!blockToRemove) {\n return;\n }\n this.destroyBlock(blockToRemove);\n // we do not want to remove the 'loaded' event listener, as the\n // concurrent loads count needs to be updated when the load is complete\n // if the purged page is in loading state\n };\n InfiniteCache.prototype.checkRowCount = function (block, lastRow) {\n // if client provided a last row, we always use it, as it could change between server calls\n // if user deleted data and then called refresh on the grid.\n if (typeof lastRow === 'number' && lastRow >= 0) {\n this.rowCount = lastRow;\n this.lastRowIndexKnown = true;\n }\n else if (!this.lastRowIndexKnown) {\n // otherwise, see if we need to add some virtual rows\n var lastRowIndex = (block.getId() + 1) * this.params.blockSize;\n var lastRowIndexPlusOverflow = lastRowIndex + this.params.overflowSize;\n if (this.rowCount < lastRowIndexPlusOverflow) {\n this.rowCount = lastRowIndexPlusOverflow;\n }\n }\n };\n InfiniteCache.prototype.setRowCount = function (rowCount, lastRowIndexKnown) {\n this.rowCount = rowCount;\n // if undefined is passed, we do not set this value, if one of {true,false}\n // is passed, we do set the value.\n if (_.exists(lastRowIndexKnown)) {\n this.lastRowIndexKnown = lastRowIndexKnown;\n }\n // if we are still searching, then the row count must not end at the end\n // of a particular page, otherwise the searching will not pop into the\n // next page\n if (!this.lastRowIndexKnown) {\n if (this.rowCount % this.params.blockSize === 0) {\n this.rowCount++;\n }\n }\n this.onCacheUpdated();\n };\n InfiniteCache.prototype.forEachNodeDeep = function (callback) {\n var _this = this;\n var sequence = new NumberSequence();\n this.getBlocksInOrder().forEach(function (block) { return block.forEachNode(callback, sequence, _this.rowCount); });\n };\n InfiniteCache.prototype.getBlocksInOrder = function () {\n // get all page id's as NUMBERS (not strings, as we need to sort as numbers) and in descending order\n var blockComparator = function (a, b) { return a.getId() - b.getId(); };\n var blocks = _.getAllValuesInObject(this.blocks).sort(blockComparator);\n return blocks;\n };\n InfiniteCache.prototype.destroyBlock = function (block) {\n delete this.blocks[block.getId()];\n this.destroyBean(block);\n this.blockCount--;\n this.params.rowNodeBlockLoader.removeBlock(block);\n };\n // gets called 1) row count changed 2) cache purged 3) items inserted\n InfiniteCache.prototype.onCacheUpdated = function () {\n if (this.isAlive()) {\n // if the virtualRowCount is shortened, then it's possible blocks exist that are no longer\n // in the valid range. so we must remove these. this can happen if user explicitly sets\n // the virtual row count, or the datasource returns a result and sets lastRow to something\n // less than virtualRowCount (can happen if user scrolls down, server reduces dataset size).\n this.destroyAllBlocksPastVirtualRowCount();\n // this results in both row models (infinite and server side) firing ModelUpdated,\n // however server side row model also updates the row indexes first\n var event_1 = {\n type: Events.EVENT_STORE_UPDATED\n };\n this.eventService.dispatchEvent(event_1);\n }\n };\n InfiniteCache.prototype.destroyAllBlocksPastVirtualRowCount = function () {\n var _this = this;\n var blocksToDestroy = [];\n this.getBlocksInOrder().forEach(function (block) {\n var startRow = block.getId() * _this.params.blockSize;\n if (startRow >= _this.rowCount) {\n blocksToDestroy.push(block);\n }\n });\n if (blocksToDestroy.length > 0) {\n blocksToDestroy.forEach(function (block) { return _this.destroyBlock(block); });\n }\n };\n InfiniteCache.prototype.purgeCache = function () {\n var _this = this;\n this.getBlocksInOrder().forEach(function (block) { return _this.removeBlockFromCache(block); });\n this.lastRowIndexKnown = false;\n // if zero rows in the cache, we need to get the SSRM to start asking for rows again.\n // otherwise if set to zero rows last time, and we don't update the row count, then after\n // the purge there will still be zero rows, meaning the SSRM won't request any rows.\n // to kick things off, at least one row needs to be asked for.\n if (this.rowCount === 0) {\n this.rowCount = this.params.initialRowCount;\n }\n this.onCacheUpdated();\n };\n InfiniteCache.prototype.getRowNodesInRange = function (firstInRange, lastInRange) {\n var _this = this;\n var result = [];\n var lastBlockId = -1;\n var inActiveRange = false;\n var numberSequence = new NumberSequence();\n // if only one node passed, we start the selection at the top\n if (_.missing(firstInRange)) {\n inActiveRange = true;\n }\n var foundGapInSelection = false;\n this.getBlocksInOrder().forEach(function (block) {\n if (foundGapInSelection) {\n return;\n }\n if (inActiveRange && (lastBlockId + 1 !== block.getId())) {\n foundGapInSelection = true;\n return;\n }\n lastBlockId = block.getId();\n block.forEachNode(function (rowNode) {\n var hitFirstOrLast = rowNode === firstInRange || rowNode === lastInRange;\n if (inActiveRange || hitFirstOrLast) {\n result.push(rowNode);\n }\n if (hitFirstOrLast) {\n inActiveRange = !inActiveRange;\n }\n }, numberSequence, _this.rowCount);\n });\n // inActiveRange will be still true if we never hit the second rowNode\n var invalidRange = foundGapInSelection || inActiveRange;\n return invalidRange ? [] : result;\n };\n // this property says how many empty blocks should be in a cache, eg if scrolls down fast and creates 10\n // blocks all for loading, the grid will only load the last 2 - it will assume the blocks the user quickly\n // scrolled over are not needed to be loaded.\n InfiniteCache.MAX_EMPTY_BLOCKS_TO_KEEP = 2;\n __decorate$3([\n Autowired('rowRenderer')\n ], InfiniteCache.prototype, \"rowRenderer\", void 0);\n __decorate$3([\n Autowired(\"focusService\")\n ], InfiniteCache.prototype, \"focusService\", void 0);\n __decorate$3([\n __param(0, Qualifier('loggerFactory'))\n ], InfiniteCache.prototype, \"setBeans\", null);\n __decorate$3([\n PreDestroy\n ], InfiniteCache.prototype, \"destroyAllBlocks\", null);\n return InfiniteCache;\n}(BeanStub));\n\nvar __extends$3 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar InfiniteRowModel = /** @class */ (function (_super) {\n __extends$3(InfiniteRowModel, _super);\n function InfiniteRowModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n InfiniteRowModel.prototype.getRowBounds = function (index) {\n return {\n rowHeight: this.rowHeight,\n rowTop: this.rowHeight * index\n };\n };\n // we don't implement as lazy row heights is not supported in this row model\n InfiniteRowModel.prototype.ensureRowHeightsValid = function (startPixel, endPixel, startLimitIndex, endLimitIndex) {\n return false;\n };\n InfiniteRowModel.prototype.init = function () {\n var _this = this;\n if (!this.gridOptionsService.isRowModelType('infinite')) {\n return;\n }\n this.rowHeight = this.gridOptionsService.getRowHeightAsNumber();\n this.addEventListeners();\n this.addDestroyFunc(function () { return _this.destroyCache(); });\n this.verifyProps();\n };\n InfiniteRowModel.prototype.verifyProps = function () {\n if (this.gridOptionsService.exists('initialGroupOrderComparator')) {\n _.warnOnce('initialGroupOrderComparator cannot be used with Infinite Row Model as sorting is done on the server side');\n }\n };\n InfiniteRowModel.prototype.start = function () {\n this.setDatasource(this.gridOptionsService.get('datasource'));\n };\n InfiniteRowModel.prototype.destroyDatasource = function () {\n if (this.datasource) {\n this.getContext().destroyBean(this.datasource);\n this.rowRenderer.datasourceChanged();\n this.datasource = null;\n }\n };\n InfiniteRowModel.prototype.addEventListeners = function () {\n var _this = this;\n this.addManagedListener(this.eventService, Events.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_SORT_CHANGED, this.onSortChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.onColumnEverything.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_STORE_UPDATED, this.onCacheUpdated.bind(this));\n this.addManagedPropertyListener('datasource', function () { return _this.setDatasource(_this.gridOptionsService.get('datasource')); });\n this.addManagedPropertyListener('cacheBlockSize', function () { return _this.resetCache(); });\n this.addManagedPropertyListener('rowHeight', function () {\n _this.rowHeight = _this.gridOptionsService.getRowHeightAsNumber();\n _this.cacheParams.rowHeight = _this.rowHeight;\n _this.updateRowHeights();\n });\n };\n InfiniteRowModel.prototype.onFilterChanged = function () {\n this.reset();\n };\n InfiniteRowModel.prototype.onSortChanged = function () {\n this.reset();\n };\n InfiniteRowModel.prototype.onColumnEverything = function () {\n var resetRequired;\n // if cache params, we require reset only if sort model has changed. we don't need to check\n // for filter model, as the filter manager will fire an event when columns change that result\n // in the filter changing.\n if (this.cacheParams) {\n resetRequired = this.isSortModelDifferent();\n }\n else {\n // if no cacheParams, means first time creating the cache, so always create one\n resetRequired = true;\n }\n if (resetRequired) {\n this.reset();\n }\n };\n InfiniteRowModel.prototype.isSortModelDifferent = function () {\n return !_.jsonEquals(this.cacheParams.sortModel, this.sortController.getSortModel());\n };\n InfiniteRowModel.prototype.getType = function () {\n return 'infinite';\n };\n InfiniteRowModel.prototype.setDatasource = function (datasource) {\n this.destroyDatasource();\n this.datasource = datasource;\n // only reset if we have a valid datasource to working with\n if (datasource) {\n this.reset();\n }\n };\n InfiniteRowModel.prototype.isEmpty = function () {\n return !this.infiniteCache;\n };\n InfiniteRowModel.prototype.isRowsToRender = function () {\n return !!this.infiniteCache;\n };\n InfiniteRowModel.prototype.getNodesInRangeForSelection = function (firstInRange, lastInRange) {\n return this.infiniteCache ? this.infiniteCache.getRowNodesInRange(firstInRange, lastInRange) : [];\n };\n InfiniteRowModel.prototype.reset = function () {\n // important to return here, as the user could be setting filter or sort before\n // data-source is set\n if (!this.datasource) {\n return;\n }\n // if user is providing id's, then this means we can keep the selection between datasource hits,\n // as the rows will keep their unique id's even if, for example, server side sorting or filtering\n // is done.\n var getRowIdFunc = this.gridOptionsService.getCallback('getRowId');\n var userGeneratingIds = getRowIdFunc != null;\n if (!userGeneratingIds) {\n this.selectionService.reset('rowDataChanged');\n }\n this.resetCache();\n };\n InfiniteRowModel.prototype.createModelUpdatedEvent = function () {\n return {\n type: Events.EVENT_MODEL_UPDATED,\n // not sure if these should all be false - noticed if after implementing,\n // maybe they should be true?\n newPage: false,\n newPageSize: false,\n newData: false,\n keepRenderedRows: true,\n animate: false\n };\n };\n InfiniteRowModel.prototype.resetCache = function () {\n // if not first time creating a cache, need to destroy the old one\n this.destroyCache();\n this.cacheParams = {\n // the user provided datasource\n datasource: this.datasource,\n // sort and filter model\n filterModel: this.filterManager.getFilterModel(),\n sortModel: this.sortController.getSortModel(),\n rowNodeBlockLoader: this.rowNodeBlockLoader,\n // properties - this way we take a snapshot of them, so if user changes any, they will be\n // used next time we create a new cache, which is generally after a filter or sort change,\n // or a new datasource is set\n initialRowCount: this.gridOptionsService.get('infiniteInitialRowCount'),\n maxBlocksInCache: this.gridOptionsService.get('maxBlocksInCache'),\n rowHeight: this.gridOptionsService.getRowHeightAsNumber(),\n // if user doesn't provide overflow, we use default overflow of 1, so user can scroll past\n // the current page and request first row of next page\n overflowSize: this.gridOptionsService.get('cacheOverflowSize'),\n // page size needs to be 1 or greater. having it at 1 would be silly, as you would be hitting the\n // server for one page at a time. so the default if not specified is 100.\n blockSize: this.gridOptionsService.get('cacheBlockSize'),\n // the cache could create this, however it is also used by the pages, so handy to create it\n // here as the settings are also passed to the pages\n lastAccessedSequence: new NumberSequence()\n };\n this.infiniteCache = this.createBean(new InfiniteCache(this.cacheParams));\n this.eventService.dispatchEventOnce({\n type: Events.EVENT_ROW_COUNT_READY\n });\n var event = this.createModelUpdatedEvent();\n this.eventService.dispatchEvent(event);\n };\n InfiniteRowModel.prototype.updateRowHeights = function () {\n var _this = this;\n this.forEachNode(function (node) {\n node.setRowHeight(_this.rowHeight);\n node.setRowTop(_this.rowHeight * node.rowIndex);\n });\n var event = this.createModelUpdatedEvent();\n this.eventService.dispatchEvent(event);\n };\n InfiniteRowModel.prototype.destroyCache = function () {\n if (this.infiniteCache) {\n this.infiniteCache = this.destroyBean(this.infiniteCache);\n }\n };\n InfiniteRowModel.prototype.onCacheUpdated = function () {\n var event = this.createModelUpdatedEvent();\n this.eventService.dispatchEvent(event);\n };\n InfiniteRowModel.prototype.getRow = function (rowIndex) {\n if (!this.infiniteCache) {\n return undefined;\n }\n if (rowIndex >= this.infiniteCache.getRowCount()) {\n return undefined;\n }\n return this.infiniteCache.getRow(rowIndex);\n };\n InfiniteRowModel.prototype.getRowNode = function (id) {\n var result;\n this.forEachNode(function (rowNode) {\n if (rowNode.id === id) {\n result = rowNode;\n }\n });\n return result;\n };\n InfiniteRowModel.prototype.forEachNode = function (callback) {\n if (this.infiniteCache) {\n this.infiniteCache.forEachNodeDeep(callback);\n }\n };\n InfiniteRowModel.prototype.getTopLevelRowCount = function () {\n return this.getRowCount();\n };\n InfiniteRowModel.prototype.getTopLevelRowDisplayedIndex = function (topLevelIndex) {\n return topLevelIndex;\n };\n InfiniteRowModel.prototype.getRowIndexAtPixel = function (pixel) {\n if (this.rowHeight !== 0) { // avoid divide by zero error\n var rowIndexForPixel = Math.floor(pixel / this.rowHeight);\n var lastRowIndex = this.getRowCount() - 1;\n if (rowIndexForPixel > lastRowIndex) {\n return lastRowIndex;\n }\n return rowIndexForPixel;\n }\n return 0;\n };\n InfiniteRowModel.prototype.getRowCount = function () {\n return this.infiniteCache ? this.infiniteCache.getRowCount() : 0;\n };\n InfiniteRowModel.prototype.isRowPresent = function (rowNode) {\n var foundRowNode = this.getRowNode(rowNode.id);\n return !!foundRowNode;\n };\n InfiniteRowModel.prototype.refreshCache = function () {\n if (this.infiniteCache) {\n this.infiniteCache.refreshCache();\n }\n };\n InfiniteRowModel.prototype.purgeCache = function () {\n if (this.infiniteCache) {\n this.infiniteCache.purgeCache();\n }\n };\n // for iRowModel\n InfiniteRowModel.prototype.isLastRowIndexKnown = function () {\n if (this.infiniteCache) {\n return this.infiniteCache.isLastRowIndexKnown();\n }\n return false;\n };\n InfiniteRowModel.prototype.setRowCount = function (rowCount, lastRowIndexKnown) {\n if (this.infiniteCache) {\n this.infiniteCache.setRowCount(rowCount, lastRowIndexKnown);\n }\n };\n __decorate$2([\n Autowired('filterManager')\n ], InfiniteRowModel.prototype, \"filterManager\", void 0);\n __decorate$2([\n Autowired('sortController')\n ], InfiniteRowModel.prototype, \"sortController\", void 0);\n __decorate$2([\n Autowired('selectionService')\n ], InfiniteRowModel.prototype, \"selectionService\", void 0);\n __decorate$2([\n Autowired('rowRenderer')\n ], InfiniteRowModel.prototype, \"rowRenderer\", void 0);\n __decorate$2([\n Autowired('rowNodeBlockLoader')\n ], InfiniteRowModel.prototype, \"rowNodeBlockLoader\", void 0);\n __decorate$2([\n PostConstruct\n ], InfiniteRowModel.prototype, \"init\", null);\n __decorate$2([\n PreDestroy\n ], InfiniteRowModel.prototype, \"destroyDatasource\", null);\n InfiniteRowModel = __decorate$2([\n Bean('rowModel')\n ], InfiniteRowModel);\n return InfiniteRowModel;\n}(BeanStub));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$1 = '31.1.1';\n\nvar InfiniteRowModelModule = {\n version: VERSION$1,\n moduleName: ModuleNames.InfiniteRowModelModule,\n rowModel: 'infinite',\n beans: [InfiniteRowModel],\n};\n\nvar BaseCreator = /** @class */ (function () {\n function BaseCreator() {\n }\n BaseCreator.prototype.setBeans = function (beans) {\n this.beans = beans;\n };\n BaseCreator.prototype.getFileName = function (fileName) {\n var extension = this.getDefaultFileExtension();\n if (fileName == null || !fileName.length) {\n fileName = this.getDefaultFileName();\n }\n return fileName.indexOf('.') === -1 ? \"\".concat(fileName, \".\").concat(extension) : fileName;\n };\n BaseCreator.prototype.getData = function (params) {\n var serializingSession = this.createSerializingSession(params);\n return this.beans.gridSerializer.serialize(serializingSession, params);\n };\n BaseCreator.prototype.getDefaultFileName = function () {\n return \"export.\".concat(this.getDefaultFileExtension());\n };\n return BaseCreator;\n}());\n\nvar BaseGridSerializingSession = /** @class */ (function () {\n function BaseGridSerializingSession(config) {\n this.groupColumns = [];\n var columnModel = config.columnModel, valueService = config.valueService, gridOptionsService = config.gridOptionsService, valueFormatterService = config.valueFormatterService, valueParserService = config.valueParserService, processCellCallback = config.processCellCallback, processHeaderCallback = config.processHeaderCallback, processGroupHeaderCallback = config.processGroupHeaderCallback, processRowGroupCallback = config.processRowGroupCallback;\n this.columnModel = columnModel;\n this.valueService = valueService;\n this.gridOptionsService = gridOptionsService;\n this.valueFormatterService = valueFormatterService;\n this.valueParserService = valueParserService;\n this.processCellCallback = processCellCallback;\n this.processHeaderCallback = processHeaderCallback;\n this.processGroupHeaderCallback = processGroupHeaderCallback;\n this.processRowGroupCallback = processRowGroupCallback;\n }\n BaseGridSerializingSession.prototype.prepare = function (columnsToExport) {\n this.groupColumns = columnsToExport.filter(function (col) { return !!col.getColDef().showRowGroup; });\n };\n BaseGridSerializingSession.prototype.extractHeaderValue = function (column) {\n var value = this.getHeaderName(this.processHeaderCallback, column);\n return value != null ? value : '';\n };\n BaseGridSerializingSession.prototype.extractRowCellValue = function (column, index, accumulatedRowIndex, type, node) {\n // we render the group summary text e.g. \"-> Parent -> Child\"...\n var hideOpenParents = this.gridOptionsService.get('groupHideOpenParents');\n var value = ((!hideOpenParents || node.footer) && this.shouldRenderGroupSummaryCell(node, column, index))\n ? this.createValueForGroupNode(column, node)\n : this.valueService.getValue(column, node);\n var processedValue = this.processCell({\n accumulatedRowIndex: accumulatedRowIndex,\n rowNode: node,\n column: column,\n value: value,\n processCellCallback: this.processCellCallback,\n type: type\n });\n return processedValue;\n };\n BaseGridSerializingSession.prototype.shouldRenderGroupSummaryCell = function (node, column, currentColumnIndex) {\n var _a;\n var isGroupNode = node && node.group;\n // only on group rows\n if (!isGroupNode) {\n return false;\n }\n var currentColumnGroupIndex = this.groupColumns.indexOf(column);\n if (currentColumnGroupIndex !== -1) {\n if (((_a = node.groupData) === null || _a === void 0 ? void 0 : _a[column.getId()]) != null) {\n return true;\n }\n if (this.gridOptionsService.isRowModelType('serverSide') && node.group) {\n return true;\n }\n // if this is a top level footer, always render`Total` in the left-most cell\n if (node.footer && node.level === -1) {\n var colDef = column.getColDef();\n var isFullWidth = colDef == null || colDef.showRowGroup === true;\n return isFullWidth || colDef.showRowGroup === this.columnModel.getRowGroupColumns()[0].getId();\n }\n }\n var isGroupUseEntireRow = this.gridOptionsService.isGroupUseEntireRow(this.columnModel.isPivotMode());\n return currentColumnIndex === 0 && isGroupUseEntireRow;\n };\n BaseGridSerializingSession.prototype.getHeaderName = function (callback, column) {\n if (callback) {\n return callback(this.gridOptionsService.addGridCommonParams({ column: column }));\n }\n return this.columnModel.getDisplayNameForColumn(column, 'csv', true);\n };\n BaseGridSerializingSession.prototype.createValueForGroupNode = function (column, node) {\n var _this = this;\n if (this.processRowGroupCallback) {\n return this.processRowGroupCallback(this.gridOptionsService.addGridCommonParams({ column: column, node: node }));\n }\n var isTreeData = this.gridOptionsService.get('treeData');\n var isSuppressGroupMaintainValueType = this.gridOptionsService.get('suppressGroupMaintainValueType');\n // if not tree data and not suppressGroupMaintainValueType then we get the value from the group data\n var getValueFromNode = function (node) {\n var _a, _b;\n if (isTreeData || isSuppressGroupMaintainValueType) {\n return node.key;\n }\n var value = (_a = node.groupData) === null || _a === void 0 ? void 0 : _a[column.getId()];\n if (!value || !node.rowGroupColumn || node.rowGroupColumn.getColDef().useValueFormatterForExport === false) {\n return value;\n }\n return (_b = _this.valueFormatterService.formatValue(node.rowGroupColumn, node, value)) !== null && _b !== void 0 ? _b : value;\n };\n var isFooter = node.footer;\n var keys = [getValueFromNode(node)];\n if (!this.gridOptionsService.isGroupMultiAutoColumn()) {\n while (node.parent) {\n node = node.parent;\n keys.push(getValueFromNode(node));\n }\n }\n var groupValue = keys.reverse().join(' -> ');\n return isFooter ? \"Total \".concat(groupValue) : groupValue;\n };\n BaseGridSerializingSession.prototype.processCell = function (params) {\n var _this = this;\n var _a;\n var accumulatedRowIndex = params.accumulatedRowIndex, rowNode = params.rowNode, column = params.column, value = params.value, processCellCallback = params.processCellCallback, type = params.type;\n if (processCellCallback) {\n return {\n value: (_a = processCellCallback(this.gridOptionsService.addGridCommonParams({\n accumulatedRowIndex: accumulatedRowIndex,\n column: column,\n node: rowNode,\n value: value,\n type: type,\n parseValue: function (valueToParse) { return _this.valueParserService.parseValue(column, rowNode, valueToParse, _this.valueService.getValue(column, rowNode)); },\n formatValue: function (valueToFormat) { var _a; return (_a = _this.valueFormatterService.formatValue(column, rowNode, valueToFormat)) !== null && _a !== void 0 ? _a : valueToFormat; }\n }))) !== null && _a !== void 0 ? _a : ''\n };\n }\n if (column.getColDef().useValueFormatterForExport !== false) {\n return {\n value: value !== null && value !== void 0 ? value : '',\n valueFormatted: this.valueFormatterService.formatValue(column, rowNode, value),\n };\n }\n return { value: value !== null && value !== void 0 ? value : '' };\n };\n return BaseGridSerializingSession;\n}());\n\nvar Downloader = /** @class */ (function () {\n function Downloader() {\n }\n Downloader.download = function (fileName, content) {\n var win = document.defaultView || window;\n if (!win) {\n console.warn('AG Grid: There is no `window` associated with the current `document`');\n return;\n }\n var element = document.createElement('a');\n // @ts-ignore\n var url = win.URL.createObjectURL(content);\n element.setAttribute('href', url);\n element.setAttribute('download', fileName);\n element.style.display = 'none';\n document.body.appendChild(element);\n element.dispatchEvent(new MouseEvent('click', {\n bubbles: false,\n cancelable: true,\n view: win\n }));\n document.body.removeChild(element);\n win.setTimeout(function () {\n // @ts-ignore\n win.URL.revokeObjectURL(url);\n }, 0);\n };\n return Downloader;\n}());\n\nvar __extends$2 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar LINE_SEPARATOR$1 = '\\r\\n';\nvar CsvSerializingSession = /** @class */ (function (_super) {\n __extends$2(CsvSerializingSession, _super);\n function CsvSerializingSession(config) {\n var _this = _super.call(this, config) || this;\n _this.isFirstLine = true;\n _this.result = '';\n var suppressQuotes = config.suppressQuotes, columnSeparator = config.columnSeparator;\n _this.suppressQuotes = suppressQuotes;\n _this.columnSeparator = columnSeparator;\n return _this;\n }\n CsvSerializingSession.prototype.addCustomContent = function (content) {\n var _this = this;\n if (!content) {\n return;\n }\n if (typeof content === 'string') {\n if (!/^\\s*\\n/.test(content)) {\n this.beginNewLine();\n }\n // replace whatever newlines are supplied with the style we're using\n content = content.replace(/\\r?\\n/g, LINE_SEPARATOR$1);\n this.result += content;\n }\n else {\n content.forEach(function (row) {\n _this.beginNewLine();\n row.forEach(function (cell, index) {\n if (index !== 0) {\n _this.result += _this.columnSeparator;\n }\n _this.result += _this.putInQuotes(cell.data.value || '');\n if (cell.mergeAcross) {\n _this.appendEmptyCells(cell.mergeAcross);\n }\n });\n });\n }\n };\n CsvSerializingSession.prototype.onNewHeaderGroupingRow = function () {\n this.beginNewLine();\n return {\n onColumn: this.onNewHeaderGroupingRowColumn.bind(this)\n };\n };\n CsvSerializingSession.prototype.onNewHeaderGroupingRowColumn = function (columnGroup, header, index, span) {\n if (index != 0) {\n this.result += this.columnSeparator;\n }\n this.result += this.putInQuotes(header);\n this.appendEmptyCells(span);\n };\n CsvSerializingSession.prototype.appendEmptyCells = function (count) {\n for (var i = 1; i <= count; i++) {\n this.result += this.columnSeparator + this.putInQuotes(\"\");\n }\n };\n CsvSerializingSession.prototype.onNewHeaderRow = function () {\n this.beginNewLine();\n return {\n onColumn: this.onNewHeaderRowColumn.bind(this)\n };\n };\n CsvSerializingSession.prototype.onNewHeaderRowColumn = function (column, index) {\n if (index != 0) {\n this.result += this.columnSeparator;\n }\n this.result += this.putInQuotes(this.extractHeaderValue(column));\n };\n CsvSerializingSession.prototype.onNewBodyRow = function () {\n this.beginNewLine();\n return {\n onColumn: this.onNewBodyRowColumn.bind(this)\n };\n };\n CsvSerializingSession.prototype.onNewBodyRowColumn = function (column, index, node) {\n var _a;\n if (index != 0) {\n this.result += this.columnSeparator;\n }\n var rowCellValue = this.extractRowCellValue(column, index, index, 'csv', node);\n this.result += this.putInQuotes((_a = rowCellValue.valueFormatted) !== null && _a !== void 0 ? _a : rowCellValue.value);\n };\n CsvSerializingSession.prototype.putInQuotes = function (value) {\n if (this.suppressQuotes) {\n return value;\n }\n if (value === null || value === undefined) {\n return '\"\"';\n }\n var stringValue;\n if (typeof value === 'string') {\n stringValue = value;\n }\n else if (typeof value.toString === 'function') {\n stringValue = value.toString();\n }\n else {\n console.warn('AG Grid: unknown value type during csv conversion');\n stringValue = '';\n }\n // replace each \" with \"\" (ie two sets of double quotes is how to do double quotes in csv)\n var valueEscaped = stringValue.replace(/\"/g, \"\\\"\\\"\");\n return '\"' + valueEscaped + '\"';\n };\n CsvSerializingSession.prototype.parse = function () {\n return this.result;\n };\n CsvSerializingSession.prototype.beginNewLine = function () {\n if (!this.isFirstLine) {\n this.result += LINE_SEPARATOR$1;\n }\n this.isFirstLine = false;\n };\n return CsvSerializingSession;\n}(BaseGridSerializingSession));\n\nvar __extends$1 = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1 = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar CsvCreator = /** @class */ (function (_super) {\n __extends$1(CsvCreator, _super);\n function CsvCreator() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n CsvCreator.prototype.postConstruct = function () {\n this.setBeans({\n gridSerializer: this.gridSerializer,\n gridOptionsService: this.gridOptionsService\n });\n };\n CsvCreator.prototype.getMergedParams = function (params) {\n var baseParams = this.gridOptionsService.get('defaultCsvExportParams');\n return Object.assign({}, baseParams, params);\n };\n CsvCreator.prototype.export = function (userParams) {\n if (this.isExportSuppressed()) {\n console.warn(\"AG Grid: Export cancelled. Export is not allowed as per your configuration.\");\n return;\n }\n var mergedParams = this.getMergedParams(userParams);\n var data = this.getData(mergedParams);\n var packagedFile = new Blob([\"\\ufeff\", data], { type: 'text/plain' });\n var fileName = typeof mergedParams.fileName === 'function'\n ? mergedParams.fileName(this.gridOptionsService.getGridCommonParams())\n : mergedParams.fileName;\n Downloader.download(this.getFileName(fileName), packagedFile);\n };\n CsvCreator.prototype.exportDataAsCsv = function (params) {\n this.export(params);\n };\n CsvCreator.prototype.getDataAsCsv = function (params, skipDefaultParams) {\n if (skipDefaultParams === void 0) { skipDefaultParams = false; }\n var mergedParams = skipDefaultParams\n ? Object.assign({}, params)\n : this.getMergedParams(params);\n return this.getData(mergedParams);\n };\n CsvCreator.prototype.getDefaultFileExtension = function () {\n return 'csv';\n };\n CsvCreator.prototype.createSerializingSession = function (params) {\n var _a = this, columnModel = _a.columnModel, valueService = _a.valueService, gridOptionsService = _a.gridOptionsService, valueFormatterService = _a.valueFormatterService, valueParserService = _a.valueParserService;\n var _b = params, processCellCallback = _b.processCellCallback, processHeaderCallback = _b.processHeaderCallback, processGroupHeaderCallback = _b.processGroupHeaderCallback, processRowGroupCallback = _b.processRowGroupCallback, suppressQuotes = _b.suppressQuotes, columnSeparator = _b.columnSeparator;\n return new CsvSerializingSession({\n columnModel: columnModel,\n valueService: valueService,\n gridOptionsService: gridOptionsService,\n valueFormatterService: valueFormatterService,\n valueParserService: valueParserService,\n processCellCallback: processCellCallback || undefined,\n processHeaderCallback: processHeaderCallback || undefined,\n processGroupHeaderCallback: processGroupHeaderCallback || undefined,\n processRowGroupCallback: processRowGroupCallback || undefined,\n suppressQuotes: suppressQuotes || false,\n columnSeparator: columnSeparator || ','\n });\n };\n CsvCreator.prototype.isExportSuppressed = function () {\n return this.gridOptionsService.get('suppressCsvExport');\n };\n __decorate$1([\n Autowired('columnModel')\n ], CsvCreator.prototype, \"columnModel\", void 0);\n __decorate$1([\n Autowired('valueService')\n ], CsvCreator.prototype, \"valueService\", void 0);\n __decorate$1([\n Autowired('gridSerializer')\n ], CsvCreator.prototype, \"gridSerializer\", void 0);\n __decorate$1([\n Autowired('gridOptionsService')\n ], CsvCreator.prototype, \"gridOptionsService\", void 0);\n __decorate$1([\n Autowired('valueFormatterService')\n ], CsvCreator.prototype, \"valueFormatterService\", void 0);\n __decorate$1([\n Autowired('valueParserService')\n ], CsvCreator.prototype, \"valueParserService\", void 0);\n __decorate$1([\n PostConstruct\n ], CsvCreator.prototype, \"postConstruct\", null);\n CsvCreator = __decorate$1([\n Bean('csvCreator')\n ], CsvCreator);\n return CsvCreator;\n}(BaseCreator));\n\nvar __extends = ( false) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = ( false) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar RowType;\n(function (RowType) {\n RowType[RowType[\"HEADER_GROUPING\"] = 0] = \"HEADER_GROUPING\";\n RowType[RowType[\"HEADER\"] = 1] = \"HEADER\";\n RowType[RowType[\"BODY\"] = 2] = \"BODY\";\n})(RowType || (RowType = {}));\nvar GridSerializer = /** @class */ (function (_super) {\n __extends(GridSerializer, _super);\n function GridSerializer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n GridSerializer.prototype.serialize = function (gridSerializingSession, params) {\n if (params === void 0) { params = {}; }\n var allColumns = params.allColumns, columnKeys = params.columnKeys, skipRowGroups = params.skipRowGroups;\n var columnsToExport = this.getColumnsToExport(allColumns, skipRowGroups, columnKeys);\n var serializeChain = _.compose(\n // first pass, put in the header names of the cols\n this.prepareSession(columnsToExport), this.prependContent(params), this.exportColumnGroups(params, columnsToExport), this.exportHeaders(params, columnsToExport), this.processPinnedTopRows(params, columnsToExport), this.processRows(params, columnsToExport), this.processPinnedBottomRows(params, columnsToExport), this.appendContent(params));\n return serializeChain(gridSerializingSession).parse();\n };\n GridSerializer.prototype.processRow = function (gridSerializingSession, params, columnsToExport, node) {\n var rowSkipper = params.shouldRowBeSkipped || (function () { return false; });\n var skipSingleChildrenGroup = this.gridOptionsService.get('groupRemoveSingleChildren');\n var skipLowestSingleChildrenGroup = this.gridOptionsService.get('groupRemoveLowestSingleChildren');\n // if onlySelected, we ignore groupHideOpenParents as the user has explicitly selected the rows they wish to export.\n // similarly, if specific rowNodes are provided we do the same. (the clipboard service uses rowNodes to define which rows to export)\n var isClipboardExport = params.rowPositions != null;\n var isExplicitExportSelection = isClipboardExport || !!params.onlySelected;\n var hideOpenParents = this.gridOptionsService.get('groupHideOpenParents') && !isExplicitExportSelection;\n var isLeafNode = this.columnModel.isPivotMode() ? node.leafGroup : !node.group;\n var isFooter = !!node.footer;\n params.skipRowGroups;\n var shouldSkipLowestGroup = skipLowestSingleChildrenGroup && node.leafGroup;\n var shouldSkipCurrentGroup = node.allChildrenCount === 1 && (skipSingleChildrenGroup || shouldSkipLowestGroup);\n if ((!isLeafNode && !isFooter && (params.skipRowGroups || shouldSkipCurrentGroup || hideOpenParents)) ||\n (params.onlySelected && !node.isSelected()) ||\n (params.skipPinnedTop && node.rowPinned === 'top') ||\n (params.skipPinnedBottom && node.rowPinned === 'bottom')) {\n return;\n }\n // if we are in pivotMode, then the grid will show the root node only\n // if it's not a leaf group\n var nodeIsRootNode = node.level === -1;\n if (nodeIsRootNode && !isLeafNode && !isFooter) {\n return;\n }\n var shouldRowBeSkipped = rowSkipper(this.gridOptionsService.addGridCommonParams({ node: node }));\n if (shouldRowBeSkipped) {\n return;\n }\n var rowAccumulator = gridSerializingSession.onNewBodyRow(node);\n columnsToExport.forEach(function (column, index) {\n rowAccumulator.onColumn(column, index, node);\n });\n if (params.getCustomContentBelowRow) {\n var content = params.getCustomContentBelowRow(this.gridOptionsService.addGridCommonParams({ node: node }));\n if (content) {\n gridSerializingSession.addCustomContent(content);\n }\n }\n };\n GridSerializer.prototype.appendContent = function (params) {\n return function (gridSerializingSession) {\n var appendContent = params.appendContent;\n if (appendContent) {\n gridSerializingSession.addCustomContent(appendContent);\n }\n return gridSerializingSession;\n };\n };\n GridSerializer.prototype.prependContent = function (params) {\n return function (gridSerializingSession) {\n var prependContent = params.prependContent;\n if (prependContent) {\n gridSerializingSession.addCustomContent(prependContent);\n }\n return gridSerializingSession;\n };\n };\n GridSerializer.prototype.prepareSession = function (columnsToExport) {\n return function (gridSerializingSession) {\n gridSerializingSession.prepare(columnsToExport);\n return gridSerializingSession;\n };\n };\n GridSerializer.prototype.exportColumnGroups = function (params, columnsToExport) {\n var _this = this;\n return function (gridSerializingSession) {\n if (!params.skipColumnGroupHeaders) {\n var groupInstanceIdCreator = new GroupInstanceIdCreator();\n var displayedGroups = _this.displayedGroupCreator.createDisplayedGroups(columnsToExport, groupInstanceIdCreator, null);\n _this.recursivelyAddHeaderGroups(displayedGroups, gridSerializingSession, params.processGroupHeaderCallback);\n }\n return gridSerializingSession;\n };\n };\n GridSerializer.prototype.exportHeaders = function (params, columnsToExport) {\n return function (gridSerializingSession) {\n if (!params.skipColumnHeaders) {\n var gridRowIterator_1 = gridSerializingSession.onNewHeaderRow();\n columnsToExport.forEach(function (column, index) {\n gridRowIterator_1.onColumn(column, index, undefined);\n });\n }\n return gridSerializingSession;\n };\n };\n GridSerializer.prototype.processPinnedTopRows = function (params, columnsToExport) {\n var _this = this;\n return function (gridSerializingSession) {\n var processRow = _this.processRow.bind(_this, gridSerializingSession, params, columnsToExport);\n if (params.rowPositions) {\n params.rowPositions\n // only pinnedTop rows, other models are processed by `processRows` and `processPinnedBottomsRows`\n .filter(function (position) { return position.rowPinned === 'top'; })\n .sort(function (a, b) { return a.rowIndex - b.rowIndex; })\n .map(function (position) { return _this.pinnedRowModel.getPinnedTopRow(position.rowIndex); })\n .forEach(processRow);\n }\n else {\n _this.pinnedRowModel.forEachPinnedTopRow(processRow);\n }\n return gridSerializingSession;\n };\n };\n GridSerializer.prototype.processRows = function (params, columnsToExport) {\n var _this = this;\n return function (gridSerializingSession) {\n // when in pivot mode, we always render cols on screen, never 'all columns'\n var rowModel = _this.rowModel;\n var rowModelType = rowModel.getType();\n var usingCsrm = rowModelType === 'clientSide';\n var usingSsrm = rowModelType === 'serverSide';\n var onlySelectedNonStandardModel = !usingCsrm && params.onlySelected;\n var processRow = _this.processRow.bind(_this, gridSerializingSession, params, columnsToExport);\n var _a = params.exportedRows, exportedRows = _a === void 0 ? 'filteredAndSorted' : _a;\n if (params.rowPositions) {\n params.rowPositions\n // pinnedRows are processed by `processPinnedTopRows` and `processPinnedBottomsRows`\n .filter(function (position) { return position.rowPinned == null; })\n .sort(function (a, b) { return a.rowIndex - b.rowIndex; })\n .map(function (position) { return rowModel.getRow(position.rowIndex); })\n .forEach(processRow);\n }\n else if (_this.columnModel.isPivotMode()) {\n if (usingCsrm) {\n rowModel.forEachPivotNode(processRow, true);\n }\n else if (usingSsrm) {\n rowModel.forEachNodeAfterFilterAndSort(processRow, true);\n }\n else {\n // must be enterprise, so we can just loop through all the nodes\n rowModel.forEachNode(processRow);\n }\n }\n else {\n // onlySelectedAllPages: user doing pagination and wants selected items from\n // other pages, so cannot use the standard row model as it won't have rows from\n // other pages.\n // onlySelectedNonStandardModel: if user wants selected in non standard row model\n // (eg viewport) then again RowModel cannot be used, so need to use selected instead.\n if (params.onlySelectedAllPages || onlySelectedNonStandardModel) {\n var selectedNodes = _this.selectionService.getSelectedNodes();\n _this.replicateSortedOrder(selectedNodes);\n // serialize each node\n selectedNodes.forEach(processRow);\n }\n else {\n // here is everything else - including standard row model and selected. we don't use\n // the selection model even when just using selected, so that the result is the order\n // of the rows appearing on the screen.\n if (exportedRows === 'all') {\n rowModel.forEachNode(processRow);\n }\n else if (usingCsrm) {\n rowModel.forEachNodeAfterFilterAndSort(processRow, true);\n }\n else if (usingSsrm) {\n rowModel.forEachNodeAfterFilterAndSort(processRow, true);\n }\n else {\n rowModel.forEachNode(processRow);\n }\n }\n }\n return gridSerializingSession;\n };\n };\n GridSerializer.prototype.replicateSortedOrder = function (rows) {\n var _this = this;\n var sortOptions = this.sortController.getSortOptions();\n var compareNodes = function (rowA, rowB) {\n var _a, _b, _c, _d;\n if (rowA.rowIndex != null && rowB.rowIndex != null) {\n // if the rows have rowIndexes, this is the easiest way to compare,\n // as they're already ordered\n return rowA.rowIndex - rowB.rowIndex;\n }\n // if the level is the same, compare these nodes, or their parents\n if (rowA.level === rowB.level) {\n if (((_a = rowA.parent) === null || _a === void 0 ? void 0 : _a.id) === ((_b = rowB.parent) === null || _b === void 0 ? void 0 : _b.id)) {\n return _this.rowNodeSorter.compareRowNodes(sortOptions, {\n rowNode: rowA,\n currentPos: (_c = rowA.rowIndex) !== null && _c !== void 0 ? _c : -1,\n }, {\n rowNode: rowB,\n currentPos: (_d = rowB.rowIndex) !== null && _d !== void 0 ? _d : -1,\n });\n }\n // level is same, but parent isn't, compare parents\n return compareNodes(rowA.parent, rowB.parent);\n }\n // if level is different, match levels\n if (rowA.level > rowB.level) {\n return compareNodes(rowA.parent, rowB);\n }\n return compareNodes(rowA, rowB.parent);\n };\n // sort the nodes either by existing row index or compare them\n rows.sort(compareNodes);\n };\n GridSerializer.prototype.processPinnedBottomRows = function (params, columnsToExport) {\n var _this = this;\n return function (gridSerializingSession) {\n var processRow = _this.processRow.bind(_this, gridSerializingSession, params, columnsToExport);\n if (params.rowPositions) {\n params.rowPositions\n // only pinnedBottom rows, other models are processed by `processRows` and `processPinnedTopRows`\n .filter(function (position) { return position.rowPinned === 'bottom'; })\n .sort(function (a, b) { return a.rowIndex - b.rowIndex; })\n .map(function (position) { return _this.pinnedRowModel.getPinnedBottomRow(position.rowIndex); })\n .forEach(processRow);\n }\n else {\n _this.pinnedRowModel.forEachPinnedBottomRow(processRow);\n }\n return gridSerializingSession;\n };\n };\n GridSerializer.prototype.getColumnsToExport = function (allColumns, skipRowGroups, columnKeys) {\n if (allColumns === void 0) { allColumns = false; }\n if (skipRowGroups === void 0) { skipRowGroups = false; }\n var isPivotMode = this.columnModel.isPivotMode();\n if (columnKeys && columnKeys.length) {\n return this.columnModel.getGridColumns(columnKeys);\n }\n var isTreeData = this.gridOptionsService.get('treeData');\n var columnsToExport = [];\n if (allColumns && !isPivotMode) {\n columnsToExport = this.columnModel.getAllGridColumns();\n }\n else {\n columnsToExport = this.columnModel.getAllDisplayedColumns();\n }\n if (skipRowGroups && !isTreeData) {\n columnsToExport = columnsToExport.filter(function (column) { return column.getColId() !== GROUP_AUTO_COLUMN_ID; });\n }\n return columnsToExport;\n };\n GridSerializer.prototype.recursivelyAddHeaderGroups = function (displayedGroups, gridSerializingSession, processGroupHeaderCallback) {\n var directChildrenHeaderGroups = [];\n displayedGroups.forEach(function (columnGroupChild) {\n var columnGroup = columnGroupChild;\n if (!columnGroup.getChildren) {\n return;\n }\n columnGroup.getChildren().forEach(function (it) { return directChildrenHeaderGroups.push(it); });\n });\n if (displayedGroups.length > 0 && displayedGroups[0] instanceof ColumnGroup) {\n this.doAddHeaderHeader(gridSerializingSession, displayedGroups, processGroupHeaderCallback);\n }\n if (directChildrenHeaderGroups && directChildrenHeaderGroups.length > 0) {\n this.recursivelyAddHeaderGroups(directChildrenHeaderGroups, gridSerializingSession, processGroupHeaderCallback);\n }\n };\n GridSerializer.prototype.doAddHeaderHeader = function (gridSerializingSession, displayedGroups, processGroupHeaderCallback) {\n var _this = this;\n var gridRowIterator = gridSerializingSession.onNewHeaderGroupingRow();\n var columnIndex = 0;\n displayedGroups.forEach(function (columnGroupChild) {\n var columnGroup = columnGroupChild;\n var name;\n if (processGroupHeaderCallback) {\n name = processGroupHeaderCallback(_this.gridOptionsService.addGridCommonParams({\n columnGroup: columnGroup\n }));\n }\n else {\n name = _this.columnModel.getDisplayNameForColumnGroup(columnGroup, 'header');\n }\n var collapsibleGroupRanges = columnGroup.getLeafColumns().reduce(function (collapsibleGroups, currentColumn, currentIdx, arr) {\n var lastGroup = _.last(collapsibleGroups);\n var groupShow = currentColumn.getColumnGroupShow() === 'open';\n if (!groupShow) {\n if (lastGroup && lastGroup[1] == null) {\n lastGroup[1] = currentIdx - 1;\n }\n }\n else if (!lastGroup || lastGroup[1] != null) {\n lastGroup = [currentIdx];\n collapsibleGroups.push(lastGroup);\n }\n if (currentIdx === arr.length - 1 && lastGroup && lastGroup[1] == null) {\n lastGroup[1] = currentIdx;\n }\n return collapsibleGroups;\n }, []);\n gridRowIterator.onColumn(columnGroup, name || '', columnIndex++, columnGroup.getLeafColumns().length - 1, collapsibleGroupRanges);\n });\n };\n __decorate([\n Autowired('displayedGroupCreator')\n ], GridSerializer.prototype, \"displayedGroupCreator\", void 0);\n __decorate([\n Autowired('columnModel')\n ], GridSerializer.prototype, \"columnModel\", void 0);\n __decorate([\n Autowired('rowModel')\n ], GridSerializer.prototype, \"rowModel\", void 0);\n __decorate([\n Autowired('pinnedRowModel')\n ], GridSerializer.prototype, \"pinnedRowModel\", void 0);\n __decorate([\n Autowired('selectionService')\n ], GridSerializer.prototype, \"selectionService\", void 0);\n __decorate([\n Autowired('rowNodeSorter')\n ], GridSerializer.prototype, \"rowNodeSorter\", void 0);\n __decorate([\n Autowired('sortController')\n ], GridSerializer.prototype, \"sortController\", void 0);\n GridSerializer = __decorate([\n Bean(\"gridSerializer\")\n ], GridSerializer);\n return GridSerializer;\n}(BeanStub));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION = '31.1.1';\n\nvar CsvExportModule = {\n version: VERSION,\n moduleName: ModuleNames.CsvExportModule,\n beans: [CsvCreator, GridSerializer]\n};\n\nvar LINE_SEPARATOR = '\\r\\n';\nvar XmlFactory = /** @class */ (function () {\n function XmlFactory() {\n }\n XmlFactory.createHeader = function (headerElement) {\n if (headerElement === void 0) { headerElement = {}; }\n var headerStart = '';\n var keys = ['version'];\n if (!headerElement.version) {\n headerElement.version = \"1.0\";\n }\n if (headerElement.encoding) {\n keys.push('encoding');\n }\n if (headerElement.standalone) {\n keys.push('standalone');\n }\n var att = keys.map(function (key) { return \"\".concat(key, \"=\\\"\").concat(headerElement[key], \"\\\"\"); }).join(' ');\n return \"\".concat(headerStart, \"xml \").concat(att, \" \").concat(headerEnd);\n };\n XmlFactory.createXml = function (xmlElement, booleanTransformer) {\n var _this = this;\n var props = '';\n if (xmlElement.properties) {\n if (xmlElement.properties.prefixedAttributes) {\n xmlElement.properties.prefixedAttributes.forEach(function (prefixedSet) {\n Object.keys(prefixedSet.map).forEach(function (key) {\n props += _this.returnAttributeIfPopulated(prefixedSet.prefix + key, prefixedSet.map[key], booleanTransformer);\n });\n });\n }\n if (xmlElement.properties.rawMap) {\n Object.keys(xmlElement.properties.rawMap).forEach(function (key) {\n props += _this.returnAttributeIfPopulated(key, xmlElement.properties.rawMap[key], booleanTransformer);\n });\n }\n }\n var result = '<' + xmlElement.name + props;\n if (!xmlElement.children && xmlElement.textNode == null) {\n return result + '/>' + LINE_SEPARATOR;\n }\n if (xmlElement.textNode != null) {\n return result + '>' + xmlElement.textNode + '' + LINE_SEPARATOR;\n }\n result += '>' + LINE_SEPARATOR;\n if (xmlElement.children) {\n xmlElement.children.forEach(function (it) {\n result += _this.createXml(it, booleanTransformer);\n });\n }\n return result + '' + LINE_SEPARATOR;\n };\n XmlFactory.returnAttributeIfPopulated = function (key, value, booleanTransformer) {\n if (!value && value !== '' && value !== 0) {\n return '';\n }\n var xmlValue = value;\n if ((typeof (value) === 'boolean')) {\n if (booleanTransformer) {\n xmlValue = booleanTransformer(value);\n }\n }\n return \" \".concat(key, \"=\\\"\").concat(xmlValue, \"\\\"\");\n };\n return XmlFactory;\n}());\n\nvar convertTime = function (date) {\n var time = date.getHours();\n time <<= 6;\n time = time | date.getMinutes();\n time <<= 5;\n time = time | date.getSeconds() / 2;\n return time;\n};\nvar convertDate = function (date) {\n var dt = date.getFullYear() - 1980;\n dt <<= 4;\n dt = dt | (date.getMonth() + 1);\n dt <<= 5;\n dt = dt | date.getDate();\n return dt;\n};\nfunction convertDecToHex(number, bytes) {\n var hex = '';\n for (var i = 0; i < bytes; i++) {\n hex += String.fromCharCode(number & 0xff);\n number >>>= 8;\n }\n return hex;\n}\n\nvar getCrcFromCrc32TableAndByteArray = function (content) {\n if (!content.length) {\n return 0;\n }\n var crc = 0 ^ (-1);\n var j = 0;\n var k = 0;\n var l = 0;\n for (var i = 0; i < content.length; i++) {\n j = content[i];\n k = (crc ^ j) & 0xFF;\n l = crcTable[k];\n crc = (crc >>> 8) ^ l;\n }\n return crc ^ (-1);\n};\nvar getCrcFromCrc32Table = function (content) {\n if (!content.length) {\n return 0;\n }\n if (typeof content === 'string') {\n return getCrcFromCrc32TableAndByteArray(new TextEncoder().encode(content));\n }\n return getCrcFromCrc32TableAndByteArray(content);\n};\n// Table for crc calculation from:\n// https://referencesource.microsoft.com/#System/sys/System/IO/compression/Crc32Helper.cs,3b31978c7d7f7246,references\nvar crcTable = new Uint32Array([\n 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,\n 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,\n 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,\n 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,\n 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,\n 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,\n 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c,\n 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,\n 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,\n 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,\n 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106,\n 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,\n 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,\n 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,\n 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,\n 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,\n 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,\n 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,\n 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,\n 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,\n 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,\n 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,\n 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,\n 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,\n 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,\n 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,\n 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,\n 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,\n 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,\n 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,\n 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,\n 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,\n 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,\n 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,\n 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,\n 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,\n 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,\n 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,\n 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,\n 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,\n 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,\n 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,\n 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d\n]);\n\nvar __awaiter$2 = ( false) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$2 = ( false) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar compressBlob = function (data) { return __awaiter$2(void 0, void 0, void 0, function () {\n var chunksSize, chunks, writeCompressedData, readable, compressStream;\n return __generator$2(this, function (_a) {\n switch (_a.label) {\n case 0:\n chunksSize = 0;\n chunks = [];\n writeCompressedData = new WritableStream({\n write: function (chunk) {\n chunks.push(chunk);\n chunksSize += chunk.length;\n }\n });\n readable = new ReadableStream({\n start: function (controller) {\n var reader = new FileReader();\n reader.onload = function (e) {\n var _a;\n if ((_a = e.target) === null || _a === void 0 ? void 0 : _a.result) {\n controller.enqueue(e.target.result);\n }\n controller.close();\n };\n reader.readAsArrayBuffer(data);\n }\n });\n compressStream = new window.CompressionStream('deflate-raw');\n return [4 /*yield*/, readable.pipeThrough(compressStream).pipeTo(writeCompressedData)];\n case 1:\n _a.sent();\n // Return the compressed data\n return [2 /*return*/, {\n size: chunksSize,\n content: new Blob(chunks),\n }];\n }\n });\n}); };\nvar deflateLocalFile = function (rawContent) { return __awaiter$2(void 0, void 0, void 0, function () {\n var contentAsBlob, _a, compressedSize, compressedContent, compressedContentAsUint8Array, _b;\n return __generator$2(this, function (_c) {\n switch (_c.label) {\n case 0:\n contentAsBlob = new Blob([rawContent]);\n return [4 /*yield*/, compressBlob(contentAsBlob)];\n case 1:\n _a = _c.sent(), compressedSize = _a.size, compressedContent = _a.content;\n _b = Uint8Array.bind;\n return [4 /*yield*/, compressedContent.arrayBuffer()];\n case 2:\n compressedContentAsUint8Array = new (_b.apply(Uint8Array, [void 0, _c.sent()]))();\n return [2 /*return*/, {\n size: compressedSize,\n content: compressedContentAsUint8Array,\n }];\n }\n });\n}); };\n\nvar __assign = ( false) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter$1 = ( false) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$1 = ( false) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar utf8_encode = _.utf8_encode;\nvar getDeflatedHeaderAndContent = function (currentFile, offset) { return __awaiter$1(void 0, void 0, void 0, function () {\n var content, _a, size, rawContent, deflatedContent, deflatedSize, deflationPerformed, shouldDeflate, result, headers;\n return __generator$1(this, function (_b) {\n switch (_b.label) {\n case 0:\n content = currentFile.content;\n _a = !content\n ? ({ size: 0, content: Uint8Array.from([]) })\n : getDecodedContent(content), size = _a.size, rawContent = _a.content;\n deflatedContent = undefined;\n deflatedSize = undefined;\n deflationPerformed = false;\n shouldDeflate = currentFile.type === 'file' && rawContent && size > 0;\n if (!shouldDeflate) return [3 /*break*/, 2];\n return [4 /*yield*/, deflateLocalFile(rawContent)];\n case 1:\n result = _b.sent();\n deflatedContent = result.content;\n deflatedSize = result.size;\n deflationPerformed = true;\n _b.label = 2;\n case 2:\n headers = getHeaders(currentFile, deflationPerformed, offset, size, rawContent, deflatedSize);\n return [2 /*return*/, __assign(__assign({}, headers), { content: deflatedContent || rawContent, isCompressed: deflationPerformed })];\n }\n });\n}); };\nvar getHeaderAndContent = function (currentFile, offset) {\n var content = currentFile.content;\n var rawContent = (!content\n ? ({ content: Uint8Array.from([]) })\n : getDecodedContent(content)).content;\n var headers = getHeaders(currentFile, false, offset, rawContent.length, rawContent, undefined);\n return __assign(__assign({}, headers), { content: rawContent, isCompressed: false });\n};\nvar getHeaders = function (currentFile, isCompressed, offset, rawSize, rawContent, deflatedSize) {\n var content = currentFile.content, path = currentFile.path, creationDate = currentFile.created;\n var time = convertTime(creationDate);\n var dt = convertDate(creationDate);\n var crcFlag = getCrcFromCrc32Table(rawContent);\n var zipSize = deflatedSize !== undefined ? deflatedSize : rawSize;\n var utfPath = utf8_encode(path);\n var isUTF8 = utfPath !== path;\n var extraFields = '';\n if (isUTF8) {\n var uExtraFieldPath = convertDecToHex(1, 1) + convertDecToHex(getCrcFromCrc32Table(utfPath), 4) + utfPath;\n extraFields = \"\\x75\\x70\" + convertDecToHex(uExtraFieldPath.length, 2) + uExtraFieldPath;\n }\n var commonHeader = '\\x14\\x00' + // version needed to extract\n (isUTF8 ? '\\x00\\x08' : '\\x00\\x00') + // Language encoding flag (EFS) (12th bit turned on)\n convertDecToHex(isCompressed ? 8 : 0, 2) + // As per ECMA-376 Part 2 specs\n convertDecToHex(time, 2) + // last modified time\n convertDecToHex(dt, 2) + // last modified date\n convertDecToHex(zipSize ? crcFlag : 0, 4) +\n convertDecToHex(deflatedSize !== null && deflatedSize !== void 0 ? deflatedSize : rawSize, 4) + // compressed size\n convertDecToHex(rawSize, 4) + // uncompressed size\n convertDecToHex(utfPath.length, 2) + // file name length\n convertDecToHex(extraFields.length, 2); // extra field length\n var localFileHeader = 'PK\\x03\\x04' + commonHeader + utfPath + extraFields;\n var centralDirectoryHeader = 'PK\\x01\\x02' + // central header\n '\\x14\\x00' +\n commonHeader + // file header\n '\\x00\\x00' +\n '\\x00\\x00' +\n '\\x00\\x00' +\n (content ? '\\x00\\x00\\x00\\x00' : '\\x10\\x00\\x00\\x00') + // external file attributes\n convertDecToHex(offset, 4) + // relative offset of local header\n utfPath + // file name\n extraFields; // extra field\n return {\n localFileHeader: Uint8Array.from(localFileHeader, function (c) { return c.charCodeAt(0); }),\n centralDirectoryHeader: Uint8Array.from(centralDirectoryHeader, function (c) { return c.charCodeAt(0); }),\n };\n};\nvar buildCentralDirectoryEnd = function (tLen, cLen, lLen) {\n var str = 'PK\\x05\\x06' + // central folder end\n '\\x00\\x00' +\n '\\x00\\x00' +\n convertDecToHex(tLen, 2) + // total number of entries in the central folder\n convertDecToHex(tLen, 2) + // total number of entries in the central folder\n convertDecToHex(cLen, 4) + // size of the central folder\n convertDecToHex(lLen, 4) + // central folder start offset\n '\\x00\\x00';\n return Uint8Array.from(str, function (c) { return c.charCodeAt(0); });\n};\nvar convertStringToByteArray = function (str) {\n var bytes = new Uint8Array(str.length);\n for (var i = 0; i < str.length; i++) {\n bytes[i] = str.charCodeAt(i);\n }\n return bytes;\n};\nvar getDecodedContent = function (content) {\n var contentToUse;\n // base64 content is passed as string\n if (typeof content === 'string') {\n var base64String = atob(content.split(';base64,')[1]);\n contentToUse = convertStringToByteArray(base64String);\n }\n else {\n contentToUse = content;\n }\n return {\n size: contentToUse.length,\n content: contentToUse,\n };\n};\n\nvar __awaiter = ( false) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = ( false) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values = ( false) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = ( false) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = ( false) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar ZipContainer = /** @class */ (function () {\n function ZipContainer() {\n }\n ZipContainer.addFolders = function (paths) {\n paths.forEach(this.addFolder.bind(this));\n };\n ZipContainer.addFolder = function (path) {\n this.folders.push({\n path: path,\n created: new Date(),\n isBase64: false,\n type: 'folder'\n });\n };\n ZipContainer.addFile = function (path, content, isBase64) {\n if (isBase64 === void 0) { isBase64 = false; }\n this.files.push({\n path: path,\n created: new Date(),\n content: isBase64 ? content : new TextEncoder().encode(content),\n isBase64: isBase64,\n type: 'file'\n });\n };\n ZipContainer.getZipFile = function (mimeType) {\n if (mimeType === void 0) { mimeType = 'application/zip'; }\n return __awaiter(this, void 0, void 0, function () {\n var textOutput;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.buildCompressedFileStream()];\n case 1:\n textOutput = _a.sent();\n this.clearStream();\n return [2 /*return*/, new Blob([textOutput], { type: mimeType })];\n }\n });\n });\n };\n ZipContainer.getUncompressedZipFile = function (mimeType) {\n if (mimeType === void 0) { mimeType = 'application/zip'; }\n var textOutput = this.buildFileStream();\n this.clearStream();\n return new Blob([textOutput], { type: mimeType });\n };\n ZipContainer.clearStream = function () {\n this.folders = [];\n this.files = [];\n };\n ZipContainer.packageFiles = function (files) {\n var e_1, _a;\n var fileData = new Uint8Array(0);\n var folderData = new Uint8Array(0);\n var filesContentAndHeaderLength = 0;\n var folderHeadersLength = 0;\n try {\n for (var files_1 = __values(files), files_1_1 = files_1.next(); !files_1_1.done; files_1_1 = files_1.next()) {\n var currentFile = files_1_1.value;\n var localFileHeader = currentFile.localFileHeader, centralDirectoryHeader = currentFile.centralDirectoryHeader, content = currentFile.content;\n // Append fileHeader to fData\n var dataWithHeader = new Uint8Array(fileData.length + localFileHeader.length);\n dataWithHeader.set(fileData);\n dataWithHeader.set(localFileHeader, fileData.length);\n fileData = dataWithHeader;\n // Append content to fData\n var dataWithContent = new Uint8Array(fileData.length + content.length);\n dataWithContent.set(fileData);\n dataWithContent.set(content, fileData.length);\n fileData = dataWithContent;\n // Append folder header to foData\n var folderDataWithFolderHeader = new Uint8Array(folderData.length + centralDirectoryHeader.length);\n folderDataWithFolderHeader.set(folderData);\n folderDataWithFolderHeader.set(centralDirectoryHeader, folderData.length);\n folderData = folderDataWithFolderHeader;\n filesContentAndHeaderLength += localFileHeader.length + content.length;\n folderHeadersLength += centralDirectoryHeader.length;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (files_1_1 && !files_1_1.done && (_a = files_1.return)) _a.call(files_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n var folderEnd = buildCentralDirectoryEnd(files.length, folderHeadersLength, filesContentAndHeaderLength);\n // Append folder data and file data\n var result = new Uint8Array(fileData.length + folderData.length + folderEnd.length);\n result.set(fileData);\n result.set(folderData, fileData.length);\n result.set(folderEnd, fileData.length + folderData.length);\n return result;\n };\n ZipContainer.buildCompressedFileStream = function () {\n return __awaiter(this, void 0, void 0, function () {\n var totalFiles, readyFiles, lL, totalFiles_1, totalFiles_1_1, currentFile, output, localFileHeader, content, e_2_1;\n var e_2, _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n totalFiles = __spreadArray(__spreadArray([], __read(this.folders), false), __read(this.files), false);\n readyFiles = [];\n lL = 0;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 6, 7, 8]);\n totalFiles_1 = __values(totalFiles), totalFiles_1_1 = totalFiles_1.next();\n _b.label = 2;\n case 2:\n if (!!totalFiles_1_1.done) return [3 /*break*/, 5];\n currentFile = totalFiles_1_1.value;\n return [4 /*yield*/, getDeflatedHeaderAndContent(currentFile, lL)];\n case 3:\n output = _b.sent();\n localFileHeader = output.localFileHeader, content = output.content;\n readyFiles.push(output);\n lL += localFileHeader.length + content.length;\n _b.label = 4;\n case 4:\n totalFiles_1_1 = totalFiles_1.next();\n return [3 /*break*/, 2];\n case 5: return [3 /*break*/, 8];\n case 6:\n e_2_1 = _b.sent();\n e_2 = { error: e_2_1 };\n return [3 /*break*/, 8];\n case 7:\n try {\n if (totalFiles_1_1 && !totalFiles_1_1.done && (_a = totalFiles_1.return)) _a.call(totalFiles_1);\n }\n finally { if (e_2) throw e_2.error; }\n return [7 /*endfinally*/];\n case 8: return [2 /*return*/, this.packageFiles(readyFiles)];\n }\n });\n });\n };\n ZipContainer.buildFileStream = function () {\n var e_3, _a;\n var totalFiles = __spreadArray(__spreadArray([], __read(this.folders), false), __read(this.files), false);\n var readyFiles = [];\n var lL = 0;\n try {\n for (var totalFiles_2 = __values(totalFiles), totalFiles_2_1 = totalFiles_2.next(); !totalFiles_2_1.done; totalFiles_2_1 = totalFiles_2.next()) {\n var currentFile = totalFiles_2_1.value;\n var readyFile = getHeaderAndContent(currentFile, lL);\n var localFileHeader = readyFile.localFileHeader, content = readyFile.content;\n readyFiles.push(readyFile);\n lL += localFileHeader.length + content.length;\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (totalFiles_2_1 && !totalFiles_2_1.done && (_a = totalFiles_2.return)) _a.call(totalFiles_2);\n }\n finally { if (e_3) throw e_3.error; }\n }\n return this.packageFiles(readyFiles);\n };\n ZipContainer.folders = [];\n ZipContainer.files = [];\n return ZipContainer;\n}());\n\nvar AllCommunityModules = [ClientSideRowModelModule, InfiniteRowModelModule, CsvExportModule];\n\nModuleRegistry.registerModules(AllCommunityModules);\n\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/ag-grid-community/dist/ag-grid-community.auto.esm.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BASIC_EVENT_ALIASES: () => (/* binding */ BASIC_EVENT_ALIASES),\n/* harmony export */ EVENT_RECOGNIZER_MAP: () => (/* binding */ EVENT_RECOGNIZER_MAP),\n/* harmony export */ GESTURE_EVENT_ALIASES: () => (/* binding */ GESTURE_EVENT_ALIASES),\n/* harmony export */ INPUT_EVENT_TYPES: () => (/* binding */ INPUT_EVENT_TYPES),\n/* harmony export */ RECOGNIZERS: () => (/* binding */ RECOGNIZERS),\n/* harmony export */ RECOGNIZER_COMPATIBLE_MAP: () => (/* binding */ RECOGNIZER_COMPATIBLE_MAP),\n/* harmony export */ RECOGNIZER_FALLBACK_MAP: () => (/* binding */ RECOGNIZER_FALLBACK_MAP)\n/* harmony export */ });\n/* harmony import */ var _utils_hammer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/hammer */ \"./node_modules/mjolnir.js/dist/esm/utils/hammer.browser.js\");\n\n// This module contains constants that must be conditionally required\n// due to `window`/`document` references downstream.\nconst RECOGNIZERS = _utils_hammer__WEBPACK_IMPORTED_MODULE_0__[\"default\"]\n ? [\n [_utils_hammer__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Pan, { event: 'tripan', pointers: 3, threshold: 0, enable: false }],\n [_utils_hammer__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Rotate, { enable: false }],\n [_utils_hammer__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Pinch, { enable: false }],\n [_utils_hammer__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Swipe, { enable: false }],\n [_utils_hammer__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Pan, { threshold: 0, enable: false }],\n [_utils_hammer__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Press, { enable: false }],\n [_utils_hammer__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Tap, { event: 'doubletap', taps: 2, enable: false }],\n // TODO - rename to 'tap' and 'singletap' in the next major release\n [_utils_hammer__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Tap, { event: 'anytap', enable: false }],\n [_utils_hammer__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Tap, { enable: false }]\n ]\n : null;\n// Recognize the following gestures even if a given recognizer succeeds\nconst RECOGNIZER_COMPATIBLE_MAP = {\n tripan: ['rotate', 'pinch', 'pan'],\n rotate: ['pinch'],\n pinch: ['pan'],\n pan: ['press', 'doubletap', 'anytap', 'tap'],\n doubletap: ['anytap'],\n anytap: ['tap']\n};\n// Recognize the folling gestures only if a given recognizer fails\nconst RECOGNIZER_FALLBACK_MAP = {\n doubletap: ['tap']\n};\n/**\n * Only one set of basic input events will be fired by Hammer.js:\n * either pointer, touch, or mouse, depending on system support.\n * In order to enable an application to be agnostic of system support,\n * alias basic input events into \"classes\" of events: down, move, and up.\n * See `_onBasicInput()` for usage of these aliases.\n */\nconst BASIC_EVENT_ALIASES = {\n pointerdown: 'pointerdown',\n pointermove: 'pointermove',\n pointerup: 'pointerup',\n touchstart: 'pointerdown',\n touchmove: 'pointermove',\n touchend: 'pointerup',\n mousedown: 'pointerdown',\n mousemove: 'pointermove',\n mouseup: 'pointerup'\n};\nconst INPUT_EVENT_TYPES = {\n KEY_EVENTS: ['keydown', 'keyup'],\n MOUSE_EVENTS: ['mousedown', 'mousemove', 'mouseup', 'mouseover', 'mouseout', 'mouseleave'],\n WHEEL_EVENTS: [\n // Chrome, Safari\n 'wheel',\n // IE\n 'mousewheel'\n ]\n};\n/**\n * \"Gestural\" events are those that have semantic meaning beyond the basic input event,\n * e.g. a click or tap is a sequence of `down` and `up` events with no `move` event in between.\n * Hammer.js handles these with its Recognizer system;\n * this block maps event names to the Recognizers required to detect the events.\n */\nconst EVENT_RECOGNIZER_MAP = {\n tap: 'tap',\n anytap: 'anytap',\n doubletap: 'doubletap',\n press: 'press',\n pinch: 'pinch',\n pinchin: 'pinch',\n pinchout: 'pinch',\n pinchstart: 'pinch',\n pinchmove: 'pinch',\n pinchend: 'pinch',\n pinchcancel: 'pinch',\n rotate: 'rotate',\n rotatestart: 'rotate',\n rotatemove: 'rotate',\n rotateend: 'rotate',\n rotatecancel: 'rotate',\n tripan: 'tripan',\n tripanstart: 'tripan',\n tripanmove: 'tripan',\n tripanup: 'tripan',\n tripandown: 'tripan',\n tripanleft: 'tripan',\n tripanright: 'tripan',\n tripanend: 'tripan',\n tripancancel: 'tripan',\n pan: 'pan',\n panstart: 'pan',\n panmove: 'pan',\n panup: 'pan',\n pandown: 'pan',\n panleft: 'pan',\n panright: 'pan',\n panend: 'pan',\n pancancel: 'pan',\n swipe: 'swipe',\n swipeleft: 'swipe',\n swiperight: 'swipe',\n swipeup: 'swipe',\n swipedown: 'swipe'\n};\n/**\n * Map gestural events typically provided by browsers\n * that are not reported in 'hammer.input' events\n * to corresponding Hammer.js gestures.\n */\nconst GESTURE_EVENT_ALIASES = {\n click: 'tap',\n anyclick: 'anytap',\n dblclick: 'doubletap',\n mousedown: 'pointerdown',\n mousemove: 'pointermove',\n mouseup: 'pointerup',\n mouseover: 'pointerover',\n mouseout: 'pointerout',\n mouseleave: 'pointerleave'\n};\n//# sourceMappingURL=constants.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mjolnir.js/dist/esm/constants.js?"); /***/ }), -/***/ "./node_modules/ag-grid-community/styles/ag-grid.css": +/***/ "./node_modules/mjolnir.js/dist/esm/event-manager.js": /*!***********************************************************!*\ - !*** ./node_modules/ag-grid-community/styles/ag-grid.css ***! + !*** ./node_modules/mjolnir.js/dist/esm/event-manager.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/ag-grid-community/styles/ag-grid.css?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ EventManager)\n/* harmony export */ });\n/* harmony import */ var _utils_hammer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/hammer */ \"./node_modules/mjolnir.js/dist/esm/utils/hammer.browser.js\");\n/* harmony import */ var _inputs_wheel_input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inputs/wheel-input */ \"./node_modules/mjolnir.js/dist/esm/inputs/wheel-input.js\");\n/* harmony import */ var _inputs_move_input__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./inputs/move-input */ \"./node_modules/mjolnir.js/dist/esm/inputs/move-input.js\");\n/* harmony import */ var _inputs_key_input__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./inputs/key-input */ \"./node_modules/mjolnir.js/dist/esm/inputs/key-input.js\");\n/* harmony import */ var _inputs_contextmenu_input__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./inputs/contextmenu-input */ \"./node_modules/mjolnir.js/dist/esm/inputs/contextmenu-input.js\");\n/* harmony import */ var _utils_event_registrar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/event-registrar */ \"./node_modules/mjolnir.js/dist/esm/utils/event-registrar.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./constants */ \"./node_modules/mjolnir.js/dist/esm/constants.js\");\n\n\n\n\n\n\n\nconst DEFAULT_OPTIONS = {\n // event handlers\n events: null,\n // custom recognizers\n recognizers: null,\n recognizerOptions: {},\n // Manager class\n Manager: _utils_hammer__WEBPACK_IMPORTED_MODULE_0__.Manager,\n // allow browser default touch action\n // https://github.com/uber/react-map-gl/issues/506\n touchAction: 'none',\n tabIndex: 0\n};\n// Unified API for subscribing to events about both\n// basic input events (e.g. 'mousemove', 'touchstart', 'wheel')\n// and gestural input (e.g. 'click', 'tap', 'panstart').\n// Delegates gesture related event registration and handling to Hammer.js.\nclass EventManager {\n constructor(element = null, options) {\n /**\n * Handle basic events using the 'hammer.input' Hammer.js API:\n * Before running Recognizers, Hammer emits a 'hammer.input' event\n * with the basic event info. This function emits all basic events\n * aliased to the \"class\" of event received.\n * See constants.BASIC_EVENT_CLASSES basic event class definitions.\n */\n this._onBasicInput = (event) => {\n const { srcEvent } = event;\n const alias = _constants__WEBPACK_IMPORTED_MODULE_6__.BASIC_EVENT_ALIASES[srcEvent.type];\n if (alias) {\n // fire all events aliased to srcEvent.type\n this.manager.emit(alias, event);\n }\n };\n /**\n * Handle events not supported by Hammer.js,\n * and pipe back out through same (Hammer) channel used by other events.\n */\n this._onOtherEvent = (event) => {\n // console.log('onotherevent', event.type, event)\n this.manager.emit(event.type, event);\n };\n this.options = { ...DEFAULT_OPTIONS, ...options };\n this.events = new Map();\n this.setElement(element);\n // Register all passed events.\n const { events } = this.options;\n if (events) {\n this.on(events);\n }\n }\n getElement() {\n return this.element;\n }\n setElement(element) {\n if (this.element) {\n // unregister all events\n this.destroy();\n }\n this.element = element;\n if (!element) {\n return;\n }\n const { options } = this;\n const ManagerClass = options.Manager;\n this.manager = new ManagerClass(element, {\n touchAction: options.touchAction,\n recognizers: options.recognizers || _constants__WEBPACK_IMPORTED_MODULE_6__.RECOGNIZERS\n }).on('hammer.input', this._onBasicInput);\n if (!options.recognizers) {\n // Set default recognize withs\n // http://hammerjs.github.io/recognize-with/\n Object.keys(_constants__WEBPACK_IMPORTED_MODULE_6__.RECOGNIZER_COMPATIBLE_MAP).forEach(name => {\n const recognizer = this.manager.get(name);\n if (recognizer) {\n _constants__WEBPACK_IMPORTED_MODULE_6__.RECOGNIZER_COMPATIBLE_MAP[name].forEach(otherName => {\n recognizer.recognizeWith(otherName);\n });\n }\n });\n }\n // Set recognizer options\n for (const recognizerName in options.recognizerOptions) {\n const recognizer = this.manager.get(recognizerName);\n if (recognizer) {\n const recognizerOption = options.recognizerOptions[recognizerName];\n // `enable` is managed by the event registrations\n delete recognizerOption.enable;\n recognizer.set(recognizerOption);\n }\n }\n // Handle events not handled by Hammer.js:\n // - mouse wheel\n // - pointer/touch/mouse move\n this.wheelInput = new _inputs_wheel_input__WEBPACK_IMPORTED_MODULE_1__[\"default\"](element, this._onOtherEvent, {\n enable: false\n });\n this.moveInput = new _inputs_move_input__WEBPACK_IMPORTED_MODULE_2__[\"default\"](element, this._onOtherEvent, {\n enable: false\n });\n this.keyInput = new _inputs_key_input__WEBPACK_IMPORTED_MODULE_3__[\"default\"](element, this._onOtherEvent, {\n enable: false,\n tabIndex: options.tabIndex\n });\n this.contextmenuInput = new _inputs_contextmenu_input__WEBPACK_IMPORTED_MODULE_4__[\"default\"](element, this._onOtherEvent, {\n enable: false\n });\n // Register all existing events\n for (const [eventAlias, eventRegistrar] of this.events) {\n if (!eventRegistrar.isEmpty()) {\n // Enable recognizer for this event.\n this._toggleRecognizer(eventRegistrar.recognizerName, true);\n this.manager.on(eventAlias, eventRegistrar.handleEvent);\n }\n }\n }\n // Tear down internal event management implementations.\n destroy() {\n if (this.element) {\n // wheelInput etc. are created in setElement() and therefore\n // cannot exist if there is no element\n this.wheelInput.destroy();\n this.moveInput.destroy();\n this.keyInput.destroy();\n this.contextmenuInput.destroy();\n this.manager.destroy();\n this.wheelInput = null;\n this.moveInput = null;\n this.keyInput = null;\n this.contextmenuInput = null;\n this.manager = null;\n this.element = null;\n }\n }\n /** Register an event handler function to be called on `event` */\n on(event, handler, opts) {\n this._addEventHandler(event, handler, opts, false);\n }\n once(event, handler, opts) {\n this._addEventHandler(event, handler, opts, true);\n }\n watch(event, handler, opts) {\n this._addEventHandler(event, handler, opts, false, true);\n }\n off(event, handler) {\n this._removeEventHandler(event, handler);\n }\n /*\n * Enable/disable recognizer for the given event\n */\n _toggleRecognizer(name, enabled) {\n const { manager } = this;\n if (!manager) {\n return;\n }\n const recognizer = manager.get(name);\n // @ts-ignore\n if (recognizer && recognizer.options.enable !== enabled) {\n recognizer.set({ enable: enabled });\n const fallbackRecognizers = _constants__WEBPACK_IMPORTED_MODULE_6__.RECOGNIZER_FALLBACK_MAP[name];\n if (fallbackRecognizers && !this.options.recognizers) {\n // Set default require failures\n // http://hammerjs.github.io/require-failure/\n fallbackRecognizers.forEach(otherName => {\n const otherRecognizer = manager.get(otherName);\n if (enabled) {\n // Wait for this recognizer to fail\n otherRecognizer.requireFailure(name);\n /**\n * This seems to be a bug in hammerjs:\n * requireFailure() adds both ways\n * dropRequireFailure() only drops one way\n * https://github.com/hammerjs/hammer.js/blob/master/src/recognizerjs/\n recognizer-constructor.js#L136\n */\n recognizer.dropRequireFailure(otherName);\n }\n else {\n // Do not wait for this recognizer to fail\n otherRecognizer.dropRequireFailure(name);\n }\n });\n }\n }\n this.wheelInput.enableEventType(name, enabled);\n this.moveInput.enableEventType(name, enabled);\n this.keyInput.enableEventType(name, enabled);\n this.contextmenuInput.enableEventType(name, enabled);\n }\n /**\n * Process the event registration for a single event + handler.\n */\n _addEventHandler(event, handler, opts, once, passive) {\n if (typeof event !== 'string') {\n // @ts-ignore\n opts = handler;\n // If `event` is a map, call `on()` for each entry.\n for (const eventName in event) {\n this._addEventHandler(eventName, event[eventName], opts, once, passive);\n }\n return;\n }\n const { manager, events } = this;\n // Alias to a recognized gesture as necessary.\n const eventAlias = _constants__WEBPACK_IMPORTED_MODULE_6__.GESTURE_EVENT_ALIASES[event] || event;\n let eventRegistrar = events.get(eventAlias);\n if (!eventRegistrar) {\n eventRegistrar = new _utils_event_registrar__WEBPACK_IMPORTED_MODULE_5__[\"default\"](this);\n events.set(eventAlias, eventRegistrar);\n // Enable recognizer for this event.\n eventRegistrar.recognizerName = _constants__WEBPACK_IMPORTED_MODULE_6__.EVENT_RECOGNIZER_MAP[eventAlias] || eventAlias;\n // Listen to the event\n if (manager) {\n manager.on(eventAlias, eventRegistrar.handleEvent);\n }\n }\n eventRegistrar.add(event, handler, opts, once, passive);\n if (!eventRegistrar.isEmpty()) {\n this._toggleRecognizer(eventRegistrar.recognizerName, true);\n }\n }\n /**\n * Process the event deregistration for a single event + handler.\n */\n _removeEventHandler(event, handler) {\n if (typeof event !== 'string') {\n // If `event` is a map, call `off()` for each entry.\n for (const eventName in event) {\n this._removeEventHandler(eventName, event[eventName]);\n }\n return;\n }\n const { events } = this;\n // Alias to a recognized gesture as necessary.\n const eventAlias = _constants__WEBPACK_IMPORTED_MODULE_6__.GESTURE_EVENT_ALIASES[event] || event;\n const eventRegistrar = events.get(eventAlias);\n if (!eventRegistrar) {\n return;\n }\n eventRegistrar.remove(event, handler);\n if (eventRegistrar.isEmpty()) {\n const { recognizerName } = eventRegistrar;\n // Disable recognizer if no more handlers are attached to its events\n let isRecognizerUsed = false;\n for (const eh of events.values()) {\n if (eh.recognizerName === recognizerName && !eh.isEmpty()) {\n isRecognizerUsed = true;\n break;\n }\n }\n if (!isRecognizerUsed) {\n this._toggleRecognizer(recognizerName, false);\n }\n }\n }\n}\n//# sourceMappingURL=event-manager.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mjolnir.js/dist/esm/event-manager.js?"); /***/ }), -/***/ "./node_modules/ag-grid-community/styles/ag-theme-quartz.css": +/***/ "./node_modules/mjolnir.js/dist/esm/index.js": +/*!***************************************************!*\ + !*** ./node_modules/mjolnir.js/dist/esm/index.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EventManager: () => (/* reexport safe */ _event_manager__WEBPACK_IMPORTED_MODULE_0__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _event_manager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event-manager */ \"./node_modules/mjolnir.js/dist/esm/event-manager.js\");\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mjolnir.js/dist/esm/index.js?"); + +/***/ }), + +/***/ "./node_modules/mjolnir.js/dist/esm/inputs/contextmenu-input.js": +/*!**********************************************************************!*\ + !*** ./node_modules/mjolnir.js/dist/esm/inputs/contextmenu-input.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ContextmenuInput)\n/* harmony export */ });\n/* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./input */ \"./node_modules/mjolnir.js/dist/esm/inputs/input.js\");\n\nconst EVENT_TYPE = 'contextmenu';\nclass ContextmenuInput extends _input__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(element, callback, options) {\n super(element, callback, options);\n this.handleEvent = (event) => {\n if (!this.options.enable) {\n return;\n }\n this.callback({\n type: EVENT_TYPE,\n center: {\n x: event.clientX,\n y: event.clientY\n },\n srcEvent: event,\n pointerType: 'mouse',\n target: event.target\n });\n };\n element.addEventListener('contextmenu', this.handleEvent);\n }\n destroy() {\n this.element.removeEventListener('contextmenu', this.handleEvent);\n }\n /**\n * Enable this input (begin processing events)\n * if the specified event type is among those handled by this input.\n */\n enableEventType(eventType, enabled) {\n if (eventType === EVENT_TYPE) {\n this.options.enable = enabled;\n }\n }\n}\n//# sourceMappingURL=contextmenu-input.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mjolnir.js/dist/esm/inputs/contextmenu-input.js?"); + +/***/ }), + +/***/ "./node_modules/mjolnir.js/dist/esm/inputs/input.js": +/*!**********************************************************!*\ + !*** ./node_modules/mjolnir.js/dist/esm/inputs/input.js ***! + \**********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Input)\n/* harmony export */ });\nclass Input {\n constructor(element, callback, options) {\n this.element = element;\n this.callback = callback;\n this.options = { enable: true, ...options };\n }\n}\n//# sourceMappingURL=input.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mjolnir.js/dist/esm/inputs/input.js?"); + +/***/ }), + +/***/ "./node_modules/mjolnir.js/dist/esm/inputs/key-input.js": +/*!**************************************************************!*\ + !*** ./node_modules/mjolnir.js/dist/esm/inputs/key-input.js ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ KeyInput)\n/* harmony export */ });\n/* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./input */ \"./node_modules/mjolnir.js/dist/esm/inputs/input.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ \"./node_modules/mjolnir.js/dist/esm/constants.js\");\n\n\nconst { KEY_EVENTS } = _constants__WEBPACK_IMPORTED_MODULE_1__.INPUT_EVENT_TYPES;\nconst DOWN_EVENT_TYPE = 'keydown';\nconst UP_EVENT_TYPE = 'keyup';\nclass KeyInput extends _input__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(element, callback, options) {\n super(element, callback, options);\n this.handleEvent = (event) => {\n // Ignore if focused on text input\n const targetElement = (event.target || event.srcElement);\n if ((targetElement.tagName === 'INPUT' && targetElement.type === 'text') ||\n targetElement.tagName === 'TEXTAREA') {\n return;\n }\n if (this.enableDownEvent && event.type === 'keydown') {\n this.callback({\n type: DOWN_EVENT_TYPE,\n srcEvent: event,\n key: event.key,\n target: event.target\n });\n }\n if (this.enableUpEvent && event.type === 'keyup') {\n this.callback({\n type: UP_EVENT_TYPE,\n srcEvent: event,\n key: event.key,\n target: event.target\n });\n }\n };\n this.enableDownEvent = this.options.enable;\n this.enableUpEvent = this.options.enable;\n this.events = (this.options.events || []).concat(KEY_EVENTS);\n element.tabIndex = this.options.tabIndex || 0;\n element.style.outline = 'none';\n this.events.forEach(event => element.addEventListener(event, this.handleEvent));\n }\n destroy() {\n this.events.forEach(event => this.element.removeEventListener(event, this.handleEvent));\n }\n /**\n * Enable this input (begin processing events)\n * if the specified event type is among those handled by this input.\n */\n enableEventType(eventType, enabled) {\n if (eventType === DOWN_EVENT_TYPE) {\n this.enableDownEvent = enabled;\n }\n if (eventType === UP_EVENT_TYPE) {\n this.enableUpEvent = enabled;\n }\n }\n}\n//# sourceMappingURL=key-input.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mjolnir.js/dist/esm/inputs/key-input.js?"); + +/***/ }), + +/***/ "./node_modules/mjolnir.js/dist/esm/inputs/move-input.js": +/*!***************************************************************!*\ + !*** ./node_modules/mjolnir.js/dist/esm/inputs/move-input.js ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ MoveInput)\n/* harmony export */ });\n/* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./input */ \"./node_modules/mjolnir.js/dist/esm/inputs/input.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ \"./node_modules/mjolnir.js/dist/esm/constants.js\");\n\n\nconst { MOUSE_EVENTS } = _constants__WEBPACK_IMPORTED_MODULE_1__.INPUT_EVENT_TYPES;\nconst MOVE_EVENT_TYPE = 'pointermove';\nconst OVER_EVENT_TYPE = 'pointerover';\nconst OUT_EVENT_TYPE = 'pointerout';\nconst ENTER_EVENT_TYPE = 'pointerenter';\nconst LEAVE_EVENT_TYPE = 'pointerleave';\n/**\n * Hammer.js swallows 'move' events (for pointer/touch/mouse)\n * when the pointer is not down. This class sets up a handler\n * specifically for these events to work around this limitation.\n * Note that this could be extended to more intelligently handle\n * move events across input types, e.g. storing multiple simultaneous\n * pointer/touch events, calculating speed/direction, etc.\n */\nclass MoveInput extends _input__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(element, callback, options) {\n super(element, callback, options);\n this.handleEvent = (event) => {\n this.handleOverEvent(event);\n this.handleOutEvent(event);\n this.handleEnterEvent(event);\n this.handleLeaveEvent(event);\n this.handleMoveEvent(event);\n };\n this.pressed = false;\n const { enable } = this.options;\n this.enableMoveEvent = enable;\n this.enableLeaveEvent = enable;\n this.enableEnterEvent = enable;\n this.enableOutEvent = enable;\n this.enableOverEvent = enable;\n this.events = (this.options.events || []).concat(MOUSE_EVENTS);\n this.events.forEach(event => element.addEventListener(event, this.handleEvent));\n }\n destroy() {\n this.events.forEach(event => this.element.removeEventListener(event, this.handleEvent));\n }\n /**\n * Enable this input (begin processing events)\n * if the specified event type is among those handled by this input.\n */\n enableEventType(eventType, enabled) {\n if (eventType === MOVE_EVENT_TYPE) {\n this.enableMoveEvent = enabled;\n }\n if (eventType === OVER_EVENT_TYPE) {\n this.enableOverEvent = enabled;\n }\n if (eventType === OUT_EVENT_TYPE) {\n this.enableOutEvent = enabled;\n }\n if (eventType === ENTER_EVENT_TYPE) {\n this.enableEnterEvent = enabled;\n }\n if (eventType === LEAVE_EVENT_TYPE) {\n this.enableLeaveEvent = enabled;\n }\n }\n handleOverEvent(event) {\n if (this.enableOverEvent) {\n if (event.type === 'mouseover') {\n this._emit(OVER_EVENT_TYPE, event);\n }\n }\n }\n handleOutEvent(event) {\n if (this.enableOutEvent) {\n if (event.type === 'mouseout') {\n this._emit(OUT_EVENT_TYPE, event);\n }\n }\n }\n handleEnterEvent(event) {\n if (this.enableEnterEvent) {\n if (event.type === 'mouseenter') {\n this._emit(ENTER_EVENT_TYPE, event);\n }\n }\n }\n handleLeaveEvent(event) {\n if (this.enableLeaveEvent) {\n if (event.type === 'mouseleave') {\n this._emit(LEAVE_EVENT_TYPE, event);\n }\n }\n }\n handleMoveEvent(event) {\n if (this.enableMoveEvent) {\n switch (event.type) {\n case 'mousedown':\n if (event.button >= 0) {\n // Button is down\n this.pressed = true;\n }\n break;\n case 'mousemove':\n // Move events use `which` to track the button being pressed\n if (event.which === 0) {\n // Button is not down\n this.pressed = false;\n }\n if (!this.pressed) {\n // Drag events are emitted by hammer already\n // we just need to emit the move event on hover\n this._emit(MOVE_EVENT_TYPE, event);\n }\n break;\n case 'mouseup':\n this.pressed = false;\n break;\n default:\n }\n }\n }\n _emit(type, event) {\n this.callback({\n type,\n center: {\n x: event.clientX,\n y: event.clientY\n },\n srcEvent: event,\n pointerType: 'mouse',\n target: event.target\n });\n }\n}\n//# sourceMappingURL=move-input.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mjolnir.js/dist/esm/inputs/move-input.js?"); + +/***/ }), + +/***/ "./node_modules/mjolnir.js/dist/esm/inputs/wheel-input.js": +/*!****************************************************************!*\ + !*** ./node_modules/mjolnir.js/dist/esm/inputs/wheel-input.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WheelInput)\n/* harmony export */ });\n/* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./input */ \"./node_modules/mjolnir.js/dist/esm/inputs/input.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ \"./node_modules/mjolnir.js/dist/esm/constants.js\");\n/* harmony import */ var _utils_globals__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/globals */ \"./node_modules/mjolnir.js/dist/esm/utils/globals.js\");\n\n\n\nconst firefox = _utils_globals__WEBPACK_IMPORTED_MODULE_2__.userAgent.indexOf('firefox') !== -1;\nconst { WHEEL_EVENTS } = _constants__WEBPACK_IMPORTED_MODULE_1__.INPUT_EVENT_TYPES;\nconst EVENT_TYPE = 'wheel';\n// Constants for normalizing input delta\nconst WHEEL_DELTA_MAGIC_SCALER = 4.000244140625;\nconst WHEEL_DELTA_PER_LINE = 40;\n// Slow down zoom if shift key is held for more precise zooming\nconst SHIFT_MULTIPLIER = 0.25;\nclass WheelInput extends _input__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(element, callback, options) {\n super(element, callback, options);\n /* eslint-disable complexity, max-statements */\n this.handleEvent = (event) => {\n if (!this.options.enable) {\n return;\n }\n let value = event.deltaY;\n if (_utils_globals__WEBPACK_IMPORTED_MODULE_2__.window.WheelEvent) {\n // Firefox doubles the values on retina screens...\n if (firefox && event.deltaMode === _utils_globals__WEBPACK_IMPORTED_MODULE_2__.window.WheelEvent.DOM_DELTA_PIXEL) {\n value /= _utils_globals__WEBPACK_IMPORTED_MODULE_2__.window.devicePixelRatio;\n }\n if (event.deltaMode === _utils_globals__WEBPACK_IMPORTED_MODULE_2__.window.WheelEvent.DOM_DELTA_LINE) {\n value *= WHEEL_DELTA_PER_LINE;\n }\n }\n if (value !== 0 && value % WHEEL_DELTA_MAGIC_SCALER === 0) {\n // This one is definitely a mouse wheel event.\n // Normalize this value to match trackpad.\n value = Math.floor(value / WHEEL_DELTA_MAGIC_SCALER);\n }\n if (event.shiftKey && value) {\n value = value * SHIFT_MULTIPLIER;\n }\n this.callback({\n type: EVENT_TYPE,\n center: {\n x: event.clientX,\n y: event.clientY\n },\n delta: -value,\n srcEvent: event,\n pointerType: 'mouse',\n target: event.target\n });\n };\n this.events = (this.options.events || []).concat(WHEEL_EVENTS);\n this.events.forEach(event => element.addEventListener(event, this.handleEvent, _utils_globals__WEBPACK_IMPORTED_MODULE_2__.passiveSupported ? { passive: false } : false));\n }\n destroy() {\n this.events.forEach(event => this.element.removeEventListener(event, this.handleEvent));\n }\n /**\n * Enable this input (begin processing events)\n * if the specified event type is among those handled by this input.\n */\n enableEventType(eventType, enabled) {\n if (eventType === EVENT_TYPE) {\n this.options.enable = enabled;\n }\n }\n}\n//# sourceMappingURL=wheel-input.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mjolnir.js/dist/esm/inputs/wheel-input.js?"); + +/***/ }), + +/***/ "./node_modules/mjolnir.js/dist/esm/utils/event-registrar.js": /*!*******************************************************************!*\ - !*** ./node_modules/ag-grid-community/styles/ag-theme-quartz.css ***! + !*** ./node_modules/mjolnir.js/dist/esm/utils/event-registrar.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/ag-grid-community/styles/ag-theme-quartz.css?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ EventRegistrar)\n/* harmony export */ });\n/* harmony import */ var _event_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event-utils */ \"./node_modules/mjolnir.js/dist/esm/utils/event-utils.js\");\n\nconst DEFAULT_OPTIONS = {\n srcElement: 'root',\n priority: 0\n};\nclass EventRegistrar {\n constructor(eventManager) {\n /**\n * Handles hammerjs event\n */\n this.handleEvent = (event) => {\n if (this.isEmpty()) {\n return;\n }\n const mjolnirEvent = this._normalizeEvent(event);\n let target = event.srcEvent.target;\n while (target && target !== mjolnirEvent.rootElement) {\n this._emit(mjolnirEvent, target);\n if (mjolnirEvent.handled) {\n return;\n }\n target = target.parentNode;\n }\n this._emit(mjolnirEvent, 'root');\n };\n this.eventManager = eventManager;\n this.handlers = [];\n // Element -> handler map\n this.handlersByElement = new Map();\n this._active = false;\n }\n // Returns true if there are no non-passive handlers\n isEmpty() {\n return !this._active;\n }\n add(type, handler, options, once = false, passive = false) {\n const { handlers, handlersByElement } = this;\n let opts = DEFAULT_OPTIONS;\n if (typeof options === 'string' || (options && options.addEventListener)) {\n // is DOM element, backward compatibility\n // @ts-ignore\n opts = { ...DEFAULT_OPTIONS, srcElement: options };\n }\n else if (options) {\n opts = { ...DEFAULT_OPTIONS, ...options };\n }\n let entries = handlersByElement.get(opts.srcElement);\n if (!entries) {\n entries = [];\n handlersByElement.set(opts.srcElement, entries);\n }\n const entry = {\n type,\n handler,\n srcElement: opts.srcElement,\n priority: opts.priority\n };\n if (once) {\n entry.once = true;\n }\n if (passive) {\n entry.passive = true;\n }\n handlers.push(entry);\n this._active = this._active || !entry.passive;\n // Sort handlers by descending priority\n // Handlers with the same priority are excuted in the order of registration\n let insertPosition = entries.length - 1;\n while (insertPosition >= 0) {\n if (entries[insertPosition].priority >= entry.priority) {\n break;\n }\n insertPosition--;\n }\n entries.splice(insertPosition + 1, 0, entry);\n }\n remove(type, handler) {\n const { handlers, handlersByElement } = this;\n for (let i = handlers.length - 1; i >= 0; i--) {\n const entry = handlers[i];\n if (entry.type === type && entry.handler === handler) {\n handlers.splice(i, 1);\n const entries = handlersByElement.get(entry.srcElement);\n entries.splice(entries.indexOf(entry), 1);\n if (entries.length === 0) {\n handlersByElement.delete(entry.srcElement);\n }\n }\n }\n this._active = handlers.some(entry => !entry.passive);\n }\n /**\n * Invoke handlers on a particular element\n */\n _emit(event, srcElement) {\n const entries = this.handlersByElement.get(srcElement);\n if (entries) {\n let immediatePropagationStopped = false;\n // Prevents the current event from bubbling up\n const stopPropagation = () => {\n event.handled = true;\n };\n // Prevent any remaining listeners from being called\n const stopImmediatePropagation = () => {\n event.handled = true;\n immediatePropagationStopped = true;\n };\n const entriesToRemove = [];\n for (let i = 0; i < entries.length; i++) {\n const { type, handler, once } = entries[i];\n handler({\n ...event,\n // @ts-ignore\n type,\n stopPropagation,\n stopImmediatePropagation\n });\n if (once) {\n entriesToRemove.push(entries[i]);\n }\n if (immediatePropagationStopped) {\n break;\n }\n }\n for (let i = 0; i < entriesToRemove.length; i++) {\n const { type, handler } = entriesToRemove[i];\n this.remove(type, handler);\n }\n }\n }\n /**\n * Normalizes hammerjs and custom events to have predictable fields.\n */\n _normalizeEvent(event) {\n const rootElement = this.eventManager.getElement();\n return {\n ...event,\n ...(0,_event_utils__WEBPACK_IMPORTED_MODULE_0__.whichButtons)(event),\n ...(0,_event_utils__WEBPACK_IMPORTED_MODULE_0__.getOffsetPosition)(event, rootElement),\n preventDefault: () => {\n event.srcEvent.preventDefault();\n },\n stopImmediatePropagation: null,\n stopPropagation: null,\n handled: false,\n rootElement\n };\n }\n}\n//# sourceMappingURL=event-registrar.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mjolnir.js/dist/esm/utils/event-registrar.js?"); + +/***/ }), + +/***/ "./node_modules/mjolnir.js/dist/esm/utils/event-utils.js": +/*!***************************************************************!*\ + !*** ./node_modules/mjolnir.js/dist/esm/utils/event-utils.js ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getOffsetPosition: () => (/* binding */ getOffsetPosition),\n/* harmony export */ whichButtons: () => (/* binding */ whichButtons)\n/* harmony export */ });\n/* Constants */\nconst DOWN_EVENT = 1;\nconst MOVE_EVENT = 2;\nconst UP_EVENT = 4;\nconst MOUSE_EVENTS = {\n pointerdown: DOWN_EVENT,\n pointermove: MOVE_EVENT,\n pointerup: UP_EVENT,\n mousedown: DOWN_EVENT,\n mousemove: MOVE_EVENT,\n mouseup: UP_EVENT\n};\n// MouseEvent.which https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/which\nconst MOUSE_EVENT_WHICH_LEFT = 1;\nconst MOUSE_EVENT_WHICH_MIDDLE = 2;\nconst MOUSE_EVENT_WHICH_RIGHT = 3;\n// MouseEvent.button https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\nconst MOUSE_EVENT_BUTTON_LEFT = 0;\nconst MOUSE_EVENT_BUTTON_MIDDLE = 1;\nconst MOUSE_EVENT_BUTTON_RIGHT = 2;\n// MouseEvent.buttons https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons\nconst MOUSE_EVENT_BUTTONS_LEFT_MASK = 1;\nconst MOUSE_EVENT_BUTTONS_RIGHT_MASK = 2;\nconst MOUSE_EVENT_BUTTONS_MIDDLE_MASK = 4;\n/**\n * Extract the involved mouse button\n */\nfunction whichButtons(event) {\n const eventType = MOUSE_EVENTS[event.srcEvent.type];\n if (!eventType) {\n // Not a mouse evet\n return null;\n }\n const { buttons, button, which } = event.srcEvent;\n let leftButton = false;\n let middleButton = false;\n let rightButton = false;\n if (\n // button is up, need to find out which one was pressed before\n eventType === UP_EVENT ||\n // moving but does not support `buttons` API\n (eventType === MOVE_EVENT && !Number.isFinite(buttons))) {\n leftButton = which === MOUSE_EVENT_WHICH_LEFT;\n middleButton = which === MOUSE_EVENT_WHICH_MIDDLE;\n rightButton = which === MOUSE_EVENT_WHICH_RIGHT;\n }\n else if (eventType === MOVE_EVENT) {\n leftButton = Boolean(buttons & MOUSE_EVENT_BUTTONS_LEFT_MASK);\n middleButton = Boolean(buttons & MOUSE_EVENT_BUTTONS_MIDDLE_MASK);\n rightButton = Boolean(buttons & MOUSE_EVENT_BUTTONS_RIGHT_MASK);\n }\n else if (eventType === DOWN_EVENT) {\n leftButton = button === MOUSE_EVENT_BUTTON_LEFT;\n middleButton = button === MOUSE_EVENT_BUTTON_MIDDLE;\n rightButton = button === MOUSE_EVENT_BUTTON_RIGHT;\n }\n return { leftButton, middleButton, rightButton };\n}\n/**\n * Calculate event position relative to the root element\n */\nfunction getOffsetPosition(event, rootElement) {\n const center = event.center;\n // `center` is a hammer.js event property\n if (!center) {\n // Not a gestural event\n return null;\n }\n const rect = rootElement.getBoundingClientRect();\n // Fix scale for map affected by a CSS transform.\n // See https://stackoverflow.com/a/26893663/3528533\n const scaleX = rect.width / rootElement.offsetWidth || 1;\n const scaleY = rect.height / rootElement.offsetHeight || 1;\n // Calculate center relative to the root element\n const offsetCenter = {\n x: (center.x - rect.left - rootElement.clientLeft) / scaleX,\n y: (center.y - rect.top - rootElement.clientTop) / scaleY\n };\n return { center, offsetCenter };\n}\n//# sourceMappingURL=event-utils.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mjolnir.js/dist/esm/utils/event-utils.js?"); + +/***/ }), + +/***/ "./node_modules/mjolnir.js/dist/esm/utils/globals.js": +/*!***********************************************************!*\ + !*** ./node_modules/mjolnir.js/dist/esm/utils/globals.js ***! + \***********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ document: () => (/* binding */ document_),\n/* harmony export */ global: () => (/* binding */ global_),\n/* harmony export */ passiveSupported: () => (/* binding */ passiveSupported),\n/* harmony export */ userAgent: () => (/* binding */ userAgent),\n/* harmony export */ window: () => (/* binding */ window_)\n/* harmony export */ });\n// Purpose: include this in your module to avoids adding dependencies on\n// micro modules like 'global'\n/* global window, global, document, navigator */\nconst userAgent = typeof navigator !== 'undefined' && navigator.userAgent ? navigator.userAgent.toLowerCase() : '';\nconst window_ = typeof window !== 'undefined' ? window : __webpack_require__.g;\nconst global_ = typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : window;\nconst document_ = typeof document !== 'undefined' ? document : {};\n\n/*\n * Detect whether passive option is supported by the current browser.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n #Safely_detecting_option_support\n */\nlet passiveSupported = false;\n/* eslint-disable accessor-pairs, no-empty */\ntry {\n const options = {\n // This function will be called when the browser\n // attempts to access the passive property.\n get passive() {\n passiveSupported = true;\n return true;\n }\n };\n window_.addEventListener('test', null, options);\n window_.removeEventListener('test', null);\n}\ncatch (err) {\n passiveSupported = false;\n}\n\n//# sourceMappingURL=globals.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mjolnir.js/dist/esm/utils/globals.js?"); + +/***/ }), + +/***/ "./node_modules/mjolnir.js/dist/esm/utils/hammer-overrides.js": +/*!********************************************************************!*\ + !*** ./node_modules/mjolnir.js/dist/esm/utils/hammer-overrides.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ enhanceMouseInput: () => (/* binding */ enhanceMouseInput),\n/* harmony export */ enhancePointerEventInput: () => (/* binding */ enhancePointerEventInput)\n/* harmony export */ });\n/**\n * This file contains overrides the default\n * hammer.js functions to add our own utility\n */\n/* eslint-disable */\n/* Hammer.js constants */\nconst INPUT_START = 1;\nconst INPUT_MOVE = 2;\nconst INPUT_END = 4;\nconst MOUSE_INPUT_MAP = {\n mousedown: INPUT_START,\n mousemove: INPUT_MOVE,\n mouseup: INPUT_END\n};\n/**\n * Helper function that returns true if any element in an array meets given criteria.\n * Because older browsers do not support `Array.prototype.some`\n * @params array {Array}\n * @params predict {Function}\n */\nfunction some(array, predict) {\n for (let i = 0; i < array.length; i++) {\n if (predict(array[i])) {\n return true;\n }\n }\n return false;\n}\n/* eslint-disable no-invalid-this */\nfunction enhancePointerEventInput(PointerEventInput) {\n const oldHandler = PointerEventInput.prototype.handler;\n // overrides PointerEventInput.handler to accept right mouse button\n PointerEventInput.prototype.handler = function handler(ev) {\n const store = this.store;\n // Allow non-left mouse buttons through\n if (ev.button > 0 && ev.type === 'pointerdown') {\n if (!some(store, e => e.pointerId === ev.pointerId)) {\n store.push(ev);\n }\n }\n oldHandler.call(this, ev);\n };\n}\n// overrides MouseInput.handler to accept right mouse button\nfunction enhanceMouseInput(MouseInput) {\n MouseInput.prototype.handler = function handler(ev) {\n let eventType = MOUSE_INPUT_MAP[ev.type];\n // on start we want to have the mouse button down\n if (eventType & INPUT_START && ev.button >= 0) {\n this.pressed = true;\n }\n if (eventType & INPUT_MOVE && ev.which === 0) {\n eventType = INPUT_END;\n }\n // mouse must be down\n if (!this.pressed) {\n return;\n }\n if (eventType & INPUT_END) {\n this.pressed = false;\n }\n this.callback(this.manager, eventType, {\n pointers: [ev],\n changedPointers: [ev],\n pointerType: 'mouse',\n srcEvent: ev\n });\n };\n}\n//# sourceMappingURL=hammer-overrides.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mjolnir.js/dist/esm/utils/hammer-overrides.js?"); + +/***/ }), + +/***/ "./node_modules/mjolnir.js/dist/esm/utils/hammer.browser.js": +/*!******************************************************************!*\ + !*** ./node_modules/mjolnir.js/dist/esm/utils/hammer.browser.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Manager: () => (/* binding */ Manager),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var hammerjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! hammerjs */ \"./node_modules/hammerjs/hammer.js\");\n/* harmony import */ var hammerjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(hammerjs__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _hammer_overrides__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hammer-overrides */ \"./node_modules/mjolnir.js/dist/esm/utils/hammer-overrides.js\");\n\n\n(0,_hammer_overrides__WEBPACK_IMPORTED_MODULE_1__.enhancePointerEventInput)(hammerjs__WEBPACK_IMPORTED_MODULE_0__.PointerEventInput);\n(0,_hammer_overrides__WEBPACK_IMPORTED_MODULE_1__.enhanceMouseInput)(hammerjs__WEBPACK_IMPORTED_MODULE_0__.MouseInput);\nconst Manager = hammerjs__WEBPACK_IMPORTED_MODULE_0__.Manager;\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hammerjs__WEBPACK_IMPORTED_MODULE_0__);\n//# sourceMappingURL=hammer.browser.js.map\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mjolnir.js/dist/esm/utils/hammer.browser.js?"); + +/***/ }), + +/***/ "./node_modules/mout/array/equals.js": +/*!*******************************************!*\ + !*** ./node_modules/mout/array/equals.js ***! + \*******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var is = __webpack_require__(/*! ../lang/is */ \"./node_modules/mout/lang/is.js\");\nvar isArray = __webpack_require__(/*! ../lang/isArray */ \"./node_modules/mout/lang/isArray.js\");\nvar every = __webpack_require__(/*! ./every */ \"./node_modules/mout/array/every.js\");\n\n /**\n * Compares if both arrays have the same elements\n */\n function equals(a, b, callback){\n callback = callback || is;\n\n if (!isArray(a) || !isArray(b)) {\n return callback(a, b);\n }\n\n if (a.length !== b.length) {\n return false;\n }\n\n return every(a, makeCompare(callback), b);\n }\n\n function makeCompare(callback) {\n return function(value, i) {\n return i in this && callback(value, this[i]);\n };\n }\n\n module.exports = equals;\n\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/array/equals.js?"); + +/***/ }), + +/***/ "./node_modules/mout/array/every.js": +/*!******************************************!*\ + !*** ./node_modules/mout/array/every.js ***! + \******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var makeIterator = __webpack_require__(/*! ../function/makeIterator_ */ \"./node_modules/mout/function/makeIterator_.js\");\n\n /**\n * Array every\n */\n function every(arr, callback, thisObj) {\n callback = makeIterator(callback, thisObj);\n var result = true;\n if (arr == null) {\n return result;\n }\n\n var i = -1, len = arr.length;\n while (++i < len) {\n // we iterate over sparse items since there is no way to make it\n // work properly on IE 7-8. see #64\n if (!callback(arr[i], i, arr) ) {\n result = false;\n break;\n }\n }\n\n return result;\n }\n\n module.exports = every;\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/array/every.js?"); + +/***/ }), + +/***/ "./node_modules/mout/function/identity.js": +/*!************************************************!*\ + !*** ./node_modules/mout/function/identity.js ***! + \************************************************/ +/***/ ((module) => { + +eval("\n\n /**\n * Returns the first argument provided to it.\n */\n function identity(val){\n return val;\n }\n\n module.exports = identity;\n\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/function/identity.js?"); + +/***/ }), + +/***/ "./node_modules/mout/function/makeIterator_.js": +/*!*****************************************************!*\ + !*** ./node_modules/mout/function/makeIterator_.js ***! + \*****************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var identity = __webpack_require__(/*! ./identity */ \"./node_modules/mout/function/identity.js\");\nvar prop = __webpack_require__(/*! ./prop */ \"./node_modules/mout/function/prop.js\");\nvar deepMatches = __webpack_require__(/*! ../object/deepMatches */ \"./node_modules/mout/object/deepMatches.js\");\n\n /**\n * Converts argument into a valid iterator.\n * Used internally on most array/object/collection methods that receives a\n * callback/iterator providing a shortcut syntax.\n */\n function makeIterator(src, thisObj){\n if (src == null) {\n return identity;\n }\n switch(typeof src) {\n case 'function':\n // function is the first to improve perf (most common case)\n // also avoid using `Function#call` if not needed, which boosts\n // perf a lot in some cases\n return (typeof thisObj !== 'undefined')? function(val, i, arr){\n return src.call(thisObj, val, i, arr);\n } : src;\n case 'object':\n return function(val){\n return deepMatches(val, src);\n };\n case 'string':\n case 'number':\n return prop(src);\n }\n }\n\n module.exports = makeIterator;\n\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/function/makeIterator_.js?"); + +/***/ }), + +/***/ "./node_modules/mout/function/prop.js": +/*!********************************************!*\ + !*** ./node_modules/mout/function/prop.js ***! + \********************************************/ +/***/ ((module) => { + +eval("\n\n /**\n * Returns a function that gets a property of the passed object\n */\n function prop(name){\n return function(obj){\n return obj[name];\n };\n }\n\n module.exports = prop;\n\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/function/prop.js?"); + +/***/ }), + +/***/ "./node_modules/mout/lang/clone.js": +/*!*****************************************!*\ + !*** ./node_modules/mout/lang/clone.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var kindOf = __webpack_require__(/*! ./kindOf */ \"./node_modules/mout/lang/kindOf.js\");\nvar isPlainObject = __webpack_require__(/*! ./isPlainObject */ \"./node_modules/mout/lang/isPlainObject.js\");\nvar mixIn = __webpack_require__(/*! ../object/mixIn */ \"./node_modules/mout/object/mixIn.js\");\n\n /**\n * Clone native types.\n */\n function clone(val){\n switch (kindOf(val)) {\n case 'Object':\n return cloneObject(val);\n case 'Array':\n return cloneArray(val);\n case 'RegExp':\n return cloneRegExp(val);\n case 'Date':\n return cloneDate(val);\n default:\n return val;\n }\n }\n\n function cloneObject(source) {\n if (isPlainObject(source)) {\n return mixIn({}, source);\n } else {\n return source;\n }\n }\n\n function cloneRegExp(r) {\n var flags = '';\n flags += r.multiline ? 'm' : '';\n flags += r.global ? 'g' : '';\n flags += r.ignoreCase ? 'i' : '';\n return new RegExp(r.source, flags);\n }\n\n function cloneDate(date) {\n return new Date(+date);\n }\n\n function cloneArray(arr) {\n return arr.slice();\n }\n\n module.exports = clone;\n\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/lang/clone.js?"); + +/***/ }), + +/***/ "./node_modules/mout/lang/deepClone.js": +/*!*********************************************!*\ + !*** ./node_modules/mout/lang/deepClone.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var clone = __webpack_require__(/*! ./clone */ \"./node_modules/mout/lang/clone.js\");\nvar forOwn = __webpack_require__(/*! ../object/forOwn */ \"./node_modules/mout/object/forOwn.js\");\nvar kindOf = __webpack_require__(/*! ./kindOf */ \"./node_modules/mout/lang/kindOf.js\");\nvar isPlainObject = __webpack_require__(/*! ./isPlainObject */ \"./node_modules/mout/lang/isPlainObject.js\");\n\n /**\n * Recursively clone native types.\n */\n function deepClone(val, instanceClone) {\n switch ( kindOf(val) ) {\n case 'Object':\n return cloneObject(val, instanceClone);\n case 'Array':\n return cloneArray(val, instanceClone);\n default:\n return clone(val);\n }\n }\n\n function cloneObject(source, instanceClone) {\n if (isPlainObject(source)) {\n var out = {};\n forOwn(source, function(val, key) {\n this[key] = deepClone(val, instanceClone);\n }, out);\n return out;\n } else if (instanceClone) {\n return instanceClone(source);\n } else {\n return source;\n }\n }\n\n function cloneArray(arr, instanceClone) {\n var out = [],\n i = -1,\n n = arr.length,\n val;\n while (++i < n) {\n out[i] = deepClone(arr[i], instanceClone);\n }\n return out;\n }\n\n module.exports = deepClone;\n\n\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/lang/deepClone.js?"); + +/***/ }), + +/***/ "./node_modules/mout/lang/deepEquals.js": +/*!**********************************************!*\ + !*** ./node_modules/mout/lang/deepEquals.js ***! + \**********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var is = __webpack_require__(/*! ./is */ \"./node_modules/mout/lang/is.js\");\nvar isObject = __webpack_require__(/*! ./isObject */ \"./node_modules/mout/lang/isObject.js\");\nvar isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/mout/lang/isArray.js\");\nvar objEquals = __webpack_require__(/*! ../object/equals */ \"./node_modules/mout/object/equals.js\");\nvar arrEquals = __webpack_require__(/*! ../array/equals */ \"./node_modules/mout/array/equals.js\");\n\n /**\n * Recursively checks for same properties and values.\n */\n function deepEquals(a, b, callback){\n callback = callback || is;\n\n var bothObjects = isObject(a) && isObject(b);\n var bothArrays = !bothObjects && isArray(a) && isArray(b);\n\n if (!bothObjects && !bothArrays) {\n return callback(a, b);\n }\n\n function compare(a, b){\n return deepEquals(a, b, callback);\n }\n\n var method = bothObjects ? objEquals : arrEquals;\n return method(a, b, compare);\n }\n\n module.exports = deepEquals;\n\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/lang/deepEquals.js?"); + +/***/ }), + +/***/ "./node_modules/mout/lang/is.js": +/*!**************************************!*\ + !*** ./node_modules/mout/lang/is.js ***! + \**************************************/ +/***/ ((module) => { + +eval("\n\n /**\n * Check if both arguments are egal.\n */\n function is(x, y){\n // implementation borrowed from harmony:egal spec\n if (x === y) {\n // 0 === -0, but they are not identical\n return x !== 0 || 1 / x === 1 / y;\n }\n\n // NaN !== NaN, but they are identical.\n // NaNs are the only non-reflexive value, i.e., if x !== x,\n // then x is a NaN.\n // isNaN is broken: it converts its argument to number, so\n // isNaN(\"foo\") => true\n return x !== x && y !== y;\n }\n\n module.exports = is;\n\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/lang/is.js?"); + +/***/ }), + +/***/ "./node_modules/mout/lang/isArray.js": +/*!*******************************************!*\ + !*** ./node_modules/mout/lang/isArray.js ***! + \*******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var isKind = __webpack_require__(/*! ./isKind */ \"./node_modules/mout/lang/isKind.js\");\n /**\n */\n var isArray = Array.isArray || function (val) {\n return isKind(val, 'Array');\n };\n module.exports = isArray;\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/lang/isArray.js?"); + +/***/ }), + +/***/ "./node_modules/mout/lang/isKind.js": +/*!******************************************!*\ + !*** ./node_modules/mout/lang/isKind.js ***! + \******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var kindOf = __webpack_require__(/*! ./kindOf */ \"./node_modules/mout/lang/kindOf.js\");\n /**\n * Check if value is from a specific \"kind\".\n */\n function isKind(val, kind){\n return kindOf(val) === kind;\n }\n module.exports = isKind;\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/lang/isKind.js?"); + +/***/ }), + +/***/ "./node_modules/mout/lang/isObject.js": +/*!********************************************!*\ + !*** ./node_modules/mout/lang/isObject.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var isKind = __webpack_require__(/*! ./isKind */ \"./node_modules/mout/lang/isKind.js\");\n /**\n */\n function isObject(val) {\n return isKind(val, 'Object');\n }\n module.exports = isObject;\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/lang/isObject.js?"); + +/***/ }), + +/***/ "./node_modules/mout/lang/isPlainObject.js": +/*!*************************************************!*\ + !*** ./node_modules/mout/lang/isPlainObject.js ***! + \*************************************************/ +/***/ ((module) => { + +eval("\n\n /**\n * Checks if the value is created by the `Object` constructor.\n */\n function isPlainObject(value) {\n return (!!value && typeof value === 'object' &&\n value.constructor === Object);\n }\n\n module.exports = isPlainObject;\n\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/lang/isPlainObject.js?"); + +/***/ }), + +/***/ "./node_modules/mout/lang/kindOf.js": +/*!******************************************!*\ + !*** ./node_modules/mout/lang/kindOf.js ***! + \******************************************/ +/***/ ((module) => { + +eval("\n /**\n * Gets the \"kind\" of value. (e.g. \"String\", \"Number\", etc)\n */\n function kindOf(val) {\n return Object.prototype.toString.call(val).slice(8, -1);\n }\n module.exports = kindOf;\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/lang/kindOf.js?"); + +/***/ }), + +/***/ "./node_modules/mout/object/deepMatches.js": +/*!*************************************************!*\ + !*** ./node_modules/mout/object/deepMatches.js ***! + \*************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var forOwn = __webpack_require__(/*! ./forOwn */ \"./node_modules/mout/object/forOwn.js\");\nvar isArray = __webpack_require__(/*! ../lang/isArray */ \"./node_modules/mout/lang/isArray.js\");\n\n function containsMatch(array, pattern) {\n var i = -1, length = array.length;\n while (++i < length) {\n if (deepMatches(array[i], pattern)) {\n return true;\n }\n }\n\n return false;\n }\n\n function matchArray(target, pattern) {\n var i = -1, patternLength = pattern.length;\n while (++i < patternLength) {\n if (!containsMatch(target, pattern[i])) {\n return false;\n }\n }\n\n return true;\n }\n\n function matchObject(target, pattern) {\n var result = true;\n forOwn(pattern, function(val, key) {\n if (!deepMatches(target[key], val)) {\n // Return false to break out of forOwn early\n return (result = false);\n }\n });\n\n return result;\n }\n\n /**\n * Recursively check if the objects match.\n */\n function deepMatches(target, pattern){\n if (target && typeof target === 'object' &&\n pattern && typeof pattern === 'object') {\n if (isArray(target) && isArray(pattern)) {\n return matchArray(target, pattern);\n } else {\n return matchObject(target, pattern);\n }\n } else {\n return target === pattern;\n }\n }\n\n module.exports = deepMatches;\n\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/object/deepMatches.js?"); + +/***/ }), + +/***/ "./node_modules/mout/object/equals.js": +/*!********************************************!*\ + !*** ./node_modules/mout/object/equals.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var hasOwn = __webpack_require__(/*! ./hasOwn */ \"./node_modules/mout/object/hasOwn.js\");\nvar every = __webpack_require__(/*! ./every */ \"./node_modules/mout/object/every.js\");\nvar isObject = __webpack_require__(/*! ../lang/isObject */ \"./node_modules/mout/lang/isObject.js\");\nvar is = __webpack_require__(/*! ../lang/is */ \"./node_modules/mout/lang/is.js\");\n\n // Makes a function to compare the object values from the specified compare\n // operation callback.\n function makeCompare(callback) {\n return function(value, key) {\n return hasOwn(this, key) && callback(value, this[key]);\n };\n }\n\n function checkProperties(value, key) {\n return hasOwn(this, key);\n }\n\n /**\n * Checks if two objects have the same keys and values.\n */\n function equals(a, b, callback) {\n callback = callback || is;\n\n if (!isObject(a) || !isObject(b)) {\n return callback(a, b);\n }\n\n return (every(a, makeCompare(callback), b) &&\n every(b, checkProperties, a));\n }\n\n module.exports = equals;\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/object/equals.js?"); + +/***/ }), + +/***/ "./node_modules/mout/object/every.js": +/*!*******************************************!*\ + !*** ./node_modules/mout/object/every.js ***! + \*******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var forOwn = __webpack_require__(/*! ./forOwn */ \"./node_modules/mout/object/forOwn.js\");\nvar makeIterator = __webpack_require__(/*! ../function/makeIterator_ */ \"./node_modules/mout/function/makeIterator_.js\");\n\n /**\n * Object every\n */\n function every(obj, callback, thisObj) {\n callback = makeIterator(callback, thisObj);\n var result = true;\n forOwn(obj, function(val, key) {\n // we consider any falsy values as \"false\" on purpose so shorthand\n // syntax can be used to check property existence\n if (!callback(val, key, obj)) {\n result = false;\n return false; // break\n }\n });\n return result;\n }\n\n module.exports = every;\n\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/object/every.js?"); + +/***/ }), + +/***/ "./node_modules/mout/object/forIn.js": +/*!*******************************************!*\ + !*** ./node_modules/mout/object/forIn.js ***! + \*******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var hasOwn = __webpack_require__(/*! ./hasOwn */ \"./node_modules/mout/object/hasOwn.js\");\n\n var _hasDontEnumBug,\n _dontEnums;\n\n function checkDontEnum(){\n _dontEnums = [\n 'toString',\n 'toLocaleString',\n 'valueOf',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'constructor'\n ];\n\n _hasDontEnumBug = true;\n\n for (var key in {'toString': null}) {\n _hasDontEnumBug = false;\n }\n }\n\n /**\n * Similar to Array/forEach but works over object properties and fixes Don't\n * Enum bug on IE.\n * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation\n */\n function forIn(obj, fn, thisObj){\n var key, i = 0;\n // no need to check if argument is a real object that way we can use\n // it for arrays, functions, date, etc.\n\n //post-pone check till needed\n if (_hasDontEnumBug == null) checkDontEnum();\n\n for (key in obj) {\n if (exec(fn, obj, key, thisObj) === false) {\n break;\n }\n }\n\n\n if (_hasDontEnumBug) {\n var ctor = obj.constructor,\n isProto = !!ctor && obj === ctor.prototype;\n\n while (key = _dontEnums[i++]) {\n // For constructor, if it is a prototype object the constructor\n // is always non-enumerable unless defined otherwise (and\n // enumerated above). For non-prototype objects, it will have\n // to be defined on this object, since it cannot be defined on\n // any prototype objects.\n //\n // For other [[DontEnum]] properties, check if the value is\n // different than Object prototype value.\n if (\n (key !== 'constructor' ||\n (!isProto && hasOwn(obj, key))) &&\n obj[key] !== Object.prototype[key]\n ) {\n if (exec(fn, obj, key, thisObj) === false) {\n break;\n }\n }\n }\n }\n }\n\n function exec(fn, obj, key, thisObj){\n return fn.call(thisObj, obj[key], key, obj);\n }\n\n module.exports = forIn;\n\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/object/forIn.js?"); + +/***/ }), + +/***/ "./node_modules/mout/object/forOwn.js": +/*!********************************************!*\ + !*** ./node_modules/mout/object/forOwn.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var hasOwn = __webpack_require__(/*! ./hasOwn */ \"./node_modules/mout/object/hasOwn.js\");\nvar forIn = __webpack_require__(/*! ./forIn */ \"./node_modules/mout/object/forIn.js\");\n\n /**\n * Similar to Array/forEach but works over object properties and fixes Don't\n * Enum bug on IE.\n * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation\n */\n function forOwn(obj, fn, thisObj){\n forIn(obj, function(val, key){\n if (hasOwn(obj, key)) {\n return fn.call(thisObj, obj[key], key, obj);\n }\n });\n }\n\n module.exports = forOwn;\n\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/object/forOwn.js?"); + +/***/ }), + +/***/ "./node_modules/mout/object/hasOwn.js": +/*!********************************************!*\ + !*** ./node_modules/mout/object/hasOwn.js ***! + \********************************************/ +/***/ ((module) => { + +eval("\n\n /**\n * Safer Object.hasOwnProperty\n */\n function hasOwn(obj, prop){\n return Object.prototype.hasOwnProperty.call(obj, prop);\n }\n\n module.exports = hasOwn;\n\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/object/hasOwn.js?"); + +/***/ }), + +/***/ "./node_modules/mout/object/mixIn.js": +/*!*******************************************!*\ + !*** ./node_modules/mout/object/mixIn.js ***! + \*******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var forOwn = __webpack_require__(/*! ./forOwn */ \"./node_modules/mout/object/forOwn.js\");\n\n /**\n * Combine properties from all the objects into first one.\n * - This method affects target object in place, if you want to create a new Object pass an empty object as first param.\n * @param {object} target Target Object\n * @param {...object} objects Objects to be combined (0...n objects).\n * @return {object} Target Object.\n */\n function mixIn(target, objects){\n var i = 0,\n n = arguments.length,\n obj;\n while(++i < n){\n obj = arguments[i];\n if (obj != null) {\n forOwn(obj, copyProp, target);\n }\n }\n return target;\n }\n\n function copyProp(val, key){\n this[key] = val;\n }\n\n module.exports = mixIn;\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/mout/object/mixIn.js?"); /***/ }), @@ -173,6 +3440,17 @@ eval("/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. Al /***/ }), +/***/ "./src/js/index.js": +/*!*************************!*\ + !*** ./src/js/index.js ***! + \*************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadScatterplot: () => (/* binding */ loadScatterplot),\n/* harmony export */ removeScatterplot: () => (/* binding */ removeScatterplot)\n/* harmony export */ });\n/* harmony import */ var _xenova_transformers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @xenova/transformers */ \"./node_modules/@xenova/transformers/src/transformers.js\");\n/* harmony import */ var ag_grid_community__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ag-grid-community */ \"./node_modules/ag-grid-community/dist/package/main.esm.mjs\");\n/* harmony import */ var xlsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! xlsx */ \"./node_modules/xlsx/xlsx.mjs\");\n/* harmony import */ var ag_grid_community_styles_ag_grid_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ag-grid-community/styles/ag-grid.css */ \"./node_modules/ag-grid-community/styles/ag-grid.css\");\n/* harmony import */ var ag_grid_community_styles_ag_theme_quartz_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ag-grid-community/styles/ag-theme-quartz.css */ \"./node_modules/ag-grid-community/styles/ag-theme-quartz.css\");\n/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @deck.gl/core */ \"./node_modules/@deck.gl/core/dist/esm/lib/deck.js\");\n/* harmony import */ var _deck_gl_layers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @deck.gl/layers */ \"./node_modules/@deck.gl/layers/dist/esm/scatterplot-layer/scatterplot-layer.js\");\n/* harmony import */ var distinct_colors__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! distinct-colors */ \"./node_modules/distinct-colors/lib/index.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nconst worker = new Worker(new URL(/* worker import */ __webpack_require__.p + __webpack_require__.u(\"src_js_worker_js\"), __webpack_require__.b), {\r\n type: undefined\r\n});\r\n\r\nwindow.semanticWorker = worker;\r\n\r\nconst loadingElement = document.getElementById(\"loading\");\r\nconst submitButton = document.getElementById(\"submit_button\");\r\nconst submit_button_text = document.getElementById(\"submit_button_text\")\r\nconst filterTextBox = document.getElementById('filter-text-box');\r\nconst eGridDiv = document.querySelector('#myGrid');\r\n\r\nlet searchResults;\r\nlet embedder;\r\nlet loadedModelName = null;\r\nlet quantizedFlag = true;\r\nlet thisCollection;\r\nlet lastCollection = \"\";\r\nlet queryEmbedding;\r\n\r\nconst special_vector = [] // A special vector can be hardcoded here, so that instead of calculating it with the model, this vector is used. Will be displayed bold. \r\n\r\n// Function to update URL with form parameters\r\nfunction updateURL() {\r\n const qdrantURL = document.getElementById('QdrantURL').value;\r\n const qdrantLimit = document.getElementById('QdrantLimit').value;\r\n const hfModel = document.getElementById('HFModel').value;\r\n const quantizedToggle = document.getElementById('quantizedToggle').checked;\r\n\r\n // Select all query containers\r\n const queryContainers = document.querySelectorAll('.queryContainer');\r\n let queries = [];\r\n\r\n queryContainers.forEach((container, index) => {\r\n // Adjusted selectors to match the updated HTML\r\n const inputText = container.querySelector('.inputText').value;\r\n const queryWeight = container.querySelector('.queryWeight').value;\r\n const activeState = container.querySelector(`.activeToggle`).checked;\r\n\r\n // Create an object for each query with its parameters and index\r\n const query = {\r\n index, // Add the index of the query row\r\n inputText,\r\n queryWeight,\r\n activeState\r\n };\r\n\r\n // Add the query object to the queries array\r\n queries.push(query);\r\n });\r\n\r\n // Convert the queries array to a string for the URL parameters\r\n const queriesString = JSON.stringify(queries);\r\n\r\n const params = new URLSearchParams({\r\n qdrantURL,\r\n queries: queriesString, // This now includes the index of each query row\r\n qdrantLimit,\r\n hfModel,\r\n quantizedToggle\r\n });\r\n\r\n window.history.replaceState({}, '', `?${params}`);\r\n}\r\n\r\nfunction setFormInputsFromURL() {\r\n // Parse the current URL\r\n const url = new URL(window.location.href);\r\n const urlParams = url.searchParams;\r\n\r\n // Check if there are any parameters in the URL\r\n if (urlParams.toString() === \"\") {\r\n return; // If no parameters, do nothing\r\n }\r\n\r\n // Update form inputs with URL parameters\r\n const qdrantURLParam = urlParams.get('qdrantURL');\r\n document.getElementById('QdrantURL').value = qdrantURLParam || '';\r\n\r\n const qdrantLimitParam = urlParams.get('qdrantLimit');\r\n document.getElementById('QdrantLimit').value = qdrantLimitParam || '';\r\n\r\n const hfModelParam = urlParams.get('hfModel');\r\n document.getElementById('HFModel').value = hfModelParam || '';\r\n\r\n const quantizedToggleParam = urlParams.get('quantizedToggle');\r\n document.getElementById('quantizedToggle').checked = quantizedToggleParam === 'true';\r\n\r\n // Handle query parameters\r\n const queriesParam = urlParams.get('queries');\r\n if (queriesParam) {\r\n const queries = JSON.parse(queriesParam);\r\n let rowCount = 1; // Reset row count for dynamic rows\r\n\r\n // Directly update the first row if it's part of the queries\r\n if (queries.length > 0 && queries[0].hasOwnProperty('inputText')) {\r\n const firstQuery = queries.shift(); // Remove the first query from the array\r\n\r\n const inputText0 = document.getElementById('inputText0')\r\n inputText0.value = firstQuery.inputText || '';\r\n\r\n if (inputText0.value === \"special_vector\") {\r\n // If the condition is met, apply italic text and grey background\r\n inputText0.style.fontStyle = 'italic';\r\n //event.target.style.backgroundColor = 'grey';\r\n } else {\r\n // If the condition is not met, remove italic text and grey background\r\n inputText0.style.fontStyle = 'normal';\r\n //event.target.style.backgroundColor = '';\r\n }\r\n\r\n document.getElementById('weight0').value = firstQuery.queryWeight || '';\r\n document.getElementById('activeToggle0').checked = firstQuery.activeState;\r\n }\r\n\r\n // Remove existing query rows\r\n //const queryRowsContainer = document.getElementById('queryRowsContainer');\r\n // Assuming you want to clear all existing dynamic rows before adding new ones\r\n //queryRowsContainer.innerHTML = '';\r\n\r\n // Dynamically create query rows based on URL parameters\r\n queries.forEach((query, index) => {\r\n addRow(query, index + 1); // Pass query data and the new row number\r\n });\r\n }\r\n}\r\n\r\n// Function to remove a row\r\nfunction removeRow(rowToRemove) {\r\n rowToRemove.remove();\r\n // Adjust IDs of all remaining rows\r\n let remainingRows = document.querySelectorAll('.queryContainer');\r\n for (let i = 0; i < remainingRows.length; i++) {\r\n remainingRows[i].querySelectorAll('input, button').forEach(function (element) {\r\n const currentId = element.id;\r\n const newId = currentId.replace(/\\d+$/, i + 1); // Adjust the ID to reflect the new row count\r\n element.id = newId;\r\n });\r\n }\r\n}\r\n\r\nfunction addRow(queryData, rowNumber) {\r\n const originalRow = document.getElementById('initialQueryContainer');\r\n const clone = originalRow.cloneNode(true);\r\n clone.id = 'queryContainer' + rowNumber; // Adjust the ID of the cloned row\r\n\r\n // Adjust IDs of all elements within the cloned row\r\n clone.querySelectorAll('input, button').forEach(function (element) {\r\n const currentId = element.id;\r\n const newId = currentId.replace(/\\d+$/, rowNumber); // Replace the last digit(s) with the current rowNumber\r\n element.id = newId;\r\n });\r\n\r\n // Set values from queryData\r\n clone.querySelector('.inputText').value = queryData.inputText || '';\r\n\r\n // Set values from queryData\r\n const inputTextX = clone.querySelector('.inputText')\r\n inputTextX.value = queryData.inputText || '';\r\n\r\n if (inputTextX.value === \"special_vector\") {\r\n // If the condition is met, apply italic text and grey background\r\n inputTextX.style.fontStyle = 'italic';\r\n } else {\r\n // If the condition is not met, remove italic text and grey background\r\n inputTextX.style.fontStyle = 'normal';\r\n }\r\n\r\n clone.querySelector('.queryWeight').value = queryData.queryWeight || '';\r\n clone.querySelector('.activeToggle').checked = queryData.activeState;\r\n\r\n const minusButton = clone.querySelector('.queryButton');\r\n // must use SVG here as emoji create problems with npm\r\n minusButton.innerHTML = `\r\n \r\n `\r\n minusButton.title = 'Remove query';\r\n minusButton.addEventListener('click', function () { removeRow(clone); }); // Attach event listener to the minus button\r\n\r\n document.getElementById('queryRowsContainer').appendChild(clone);\r\n}\r\n\r\nasync function loadModel(model, quantized = true) {\r\n if (model !== loadedModelName || quantized !== quantizedFlag) { // Check if model or quantized flag changed\r\n submitButton.setAttribute(\"disabled\", \"\");\r\n loadingElement.style.display = \"\";\r\n submit_button_text.textContent = \"Loading model...\";\r\n\r\n embedder = await (0,_xenova_transformers__WEBPACK_IMPORTED_MODULE_0__.pipeline)(\"feature-extraction\", model, { quantized: quantized });\r\n loadedModelName = model;\r\n quantizedFlag = quantized; // Update quantized flag\r\n console.log(\"Model loaded:\", loadedModelName, \" quantized: \", quantized);\r\n } else {\r\n console.log(\"Model already loaded:\", loadedModelName, \" quantized: \", quantized);\r\n }\r\n}\r\n\r\nsubmitButton.onclick = () => {\r\n const modelName = document.getElementById(\"HFModel\").value;\r\n const quantized = document.getElementById(\"quantizedToggle\").checked;\r\n loadModel(modelName, quantized).then(() => {\r\n sendRequest();\r\n });\r\n};\r\n\r\ndownload_csv.onclick = () => {\r\n exportData(searchResults, \"csv\");\r\n};\r\n\r\ndownload_xlsx.onclick = () => {\r\n exportData(searchResults, \"excel\");\r\n};\r\n\r\ndownload_json.onclick = () => {\r\n exportData(searchResults, \"json\");\r\n};\r\n\r\n////////////////////////////////////////////////////////////////////\r\n\r\nasync function searchPoints(collectionName, vectorData, filter, limit, offset, withPayload, withVector, scoreThreshold) {\r\n var reqBody = JSON.stringify({\r\n vector: vectorData,\r\n filter: filter,\r\n limit: limit,\r\n offset: offset,\r\n with_payload: withPayload,\r\n with_vector: withVector,\r\n score_threshold: scoreThreshold,\r\n });\r\n\r\n const requestOptions = {\r\n method: \"POST\",\r\n headers: { \"Content-Type\": \"application/json\" },\r\n body: reqBody,\r\n };\r\n\r\n thisCollection = document.getElementById(\"QdrantURL\").value\r\n const response = await fetch(`${thisCollection}/points/search`, requestOptions);\r\n const data = await response.json();\r\n return data;\r\n}\r\n\r\nfunction getQueryTextsAndWeigths() {\r\n const queryContainers = document.querySelectorAll('.queryContainer');\r\n\r\n const activeQueries = Array.from(queryContainers).filter(container => {\r\n const activeToggle = container.querySelector('.activeToggle');\r\n return activeToggle.checked;\r\n }).map(container => {\r\n const inputText = container.querySelector('.inputText').value.trim();\r\n const weight = container.querySelector('.queryWeight').value;\r\n return { inputText, weight };\r\n });\r\n\r\n const jsonObject = JSON.stringify(activeQueries);\r\n\r\n return jsonObject\r\n}\r\n\r\nasync function processInputText(inputText) {\r\n\r\n if (inputText == \"special_vector\") {\r\n return special_vector\r\n }\r\n else {\r\n const output = await embedder(inputText, { pooling: 'mean', normalize: true });\r\n const vectorArray = Array.from(output[\"data\"]);\r\n queryEmbedding = vectorArray;\r\n return vectorArray;\r\n }\r\n}\r\n\r\nasync function processQueries() {\r\n const jsonObject = getQueryTextsAndWeigths();\r\n const queries = JSON.parse(jsonObject);\r\n\r\n // Step 1: Calculate the vector for each text\r\n const vectors = await Promise.all(queries.map(async query => {\r\n const { inputText } = query\r\n return await processInputText(inputText)\r\n }));\r\n\r\n // Step 2: Calculate the weighted average vector\r\n const weightedAverageVector = vectors.reduce((acc, vector, index) => {\r\n const weight = queries[index].weight;\r\n return acc.map((val, i) => val + vector[i] * weight);\r\n }, new Array(vectors[0].length).fill(0));\r\n\r\n // Normalize the weighted average vector\r\n const magnitude = Math.sqrt(weightedAverageVector.reduce((sum, val) => sum + val * val, 0));\r\n const normalizedWeightedAverageVector = weightedAverageVector.map(val => val / magnitude);\r\n\r\n return normalizedWeightedAverageVector\r\n}\r\n\r\n// Define global variables for the grid API and options\r\nlet gridApi;\r\nlet gridOptions;\r\n\r\nasync function sendRequest() {\r\n try {\r\n gridApi.showLoadingOverlay();\r\n }\r\n catch (error) {\r\n }\r\n loadingElement.style.display = \"\";\r\n submit_button_text.textContent = \"Loading results...\";\r\n submitButton.setAttribute(\"disabled\", \"\");\r\n\r\n let inputText = document.getElementsByClassName(\"inputText\")[0].value.trim();\r\n\r\n if (inputText !== \"\") {\r\n //let output = await embedder(inputText, { pooling: 'mean', normalize: true });\r\n const collectionName = \"test_collection\";\r\n const vectorData = await processQueries();\r\n const filter = {};\r\n const limit = parseInt(document.getElementById(\"QdrantLimit\").value);\r\n const offset = 0;\r\n const withPayload = true;\r\n const withVector = true;\r\n const scoreThreshold = null;\r\n\r\n try {\r\n\r\n searchResults = await searchPoints(collectionName, vectorData, filter, limit, offset, withPayload, withVector, scoreThreshold);\r\n\r\n // Extract payload keys\r\n const payloadKeys = Object.keys(searchResults.result[0].payload);\r\n\r\n function isHyperlink(value) {\r\n return /^https?:\\/\\//.test(value);\r\n }\r\n\r\n // Custom cell renderer\r\n function customRenderer(params) {\r\n const nestedKey = Object.keys(params.data.payload).find(key => typeof params.data.payload[key] === 'object');\r\n const value = params.data.payload[params.colDef.field.split('.')[1]];\r\n\r\n if (params.colDef.field.endsWith(`.${nestedKey}`)) {\r\n return typeof value === 'object' ? JSON.stringify(value) : value; // Render nested element as string\r\n } else if (isHyperlink(value)) {\r\n return `${value}`;\r\n } else {\r\n return value;\r\n }\r\n }\r\n\r\n // Update your column definition\r\n const columnDefs = [\r\n { headerName: 'id', field: 'id' },\r\n { headerName: 'score', field: 'score' },\r\n ...payloadKeys.map(key => ({\r\n headerName: key,\r\n field: `payload.${key}`,\r\n maxWidth: 300,\r\n editable: true,\r\n valueGetter: params => params.data.payload[key],\r\n tooltipValueGetter: (params) => params.value,\r\n filter: true,\r\n autoHeight: true,\r\n cellRenderer: customRenderer // Use the custom cell renderer\r\n })),\r\n ];\r\n\r\n // Check if the grid has already been initialized\r\n if (gridApi && thisCollection === lastCollection) {\r\n // If the grid is already initialized, update the row data\r\n gridApi.setRowData(searchResults.result);\r\n } else {\r\n\r\n try {\r\n if (thisCollection !== lastCollection) {\r\n // update column headers if needed\r\n gridApi.updateGridOptions({ columnDefs: columnDefs })\r\n }\r\n gridApi.setRowData(searchResults.result);\r\n loadingElement.style.display = \"none\";\r\n submit_button_text.textContent = \"Submit\";\r\n submitButton.removeAttribute(\"disabled\");\r\n\r\n lastCollection = thisCollection\r\n return\r\n }\r\n catch { }\r\n\r\n // If the grid is not initialized, create the grid\r\n gridOptions = {\r\n autoSizeStrategy: {\r\n type: 'fitCellContents'\r\n },\r\n domLayout: 'autoHeight', // Add this line to enable auto height\r\n columnDefs: columnDefs,\r\n rowData: searchResults.result,\r\n tooltipShowDelay: 0,\r\n overlayLoadingTemplate:\r\n '
',\r\n overlayNoRowsTemplate:\r\n 'This is a custom \\'no rows\\' overlay',\r\n\r\n };\r\n\r\n gridApi = (0,ag_grid_community__WEBPACK_IMPORTED_MODULE_1__.createGrid)(eGridDiv, gridOptions);\r\n document.getElementById(\"exportDropdown\").removeAttribute(\"disabled\")\r\n document.getElementById(\"quickFilter\").style.display = \"\";\r\n\r\n }\r\n\r\n loadingElement.style.display = \"none\";\r\n submit_button_text.textContent = \"Submit\";\r\n submitButton.removeAttribute(\"disabled\");\r\n\r\n // on first click add the quick filter listener\r\n if (lastCollection == \"\" && !filterTextBox._listenerInitialized) {\r\n function onFilterTextBoxChanged() {\r\n gridApi.setGridOption(\r\n 'quickFilterText',\r\n document.getElementById('filter-text-box').value\r\n );\r\n }\r\n\r\n filterTextBox.addEventListener('input', () => {\r\n onFilterTextBoxChanged();\r\n });\r\n\r\n // Mark listener as initialized\r\n filterTextBox._listenerInitialized = true;\r\n\r\n }\r\n lastCollection = thisCollection\r\n\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n }\r\n}\r\n\r\nasync function exportData(data, format) {\r\n // Function to flatten the payload object within each object\r\n function flattenPayload(jsonData) {\r\n // Check if jsonData is an array\r\n if (!Array.isArray(jsonData)) {\r\n console.error('jsonData is not an array');\r\n return jsonData;\r\n }\r\n\r\n // Check if every element in the array is an object\r\n if (!jsonData.every(item => typeof item === 'object')) {\r\n console.error('One or more elements in jsonData are not objects');\r\n return jsonData;\r\n }\r\n\r\n // Map over the array and flatten the payload object\r\n return jsonData.map(item => {\r\n const { payload, ...rest } = item;\r\n return { ...rest, ...payload };\r\n });\r\n }\r\n\r\n // Flatten the payload object within each object\r\n let jsonData = flattenPayload(data.result);\r\n\r\n // Based on the format parameter, generate the output accordingly\r\n if (format === 'excel') {\r\n // Create a new workbook\r\n const workbook = xlsx__WEBPACK_IMPORTED_MODULE_5__.utils.book_new();\r\n\r\n // Convert JSON to worksheet\r\n const worksheet = xlsx__WEBPACK_IMPORTED_MODULE_5__.utils.json_to_sheet(jsonData);\r\n\r\n // Add the worksheet to the workbook\r\n xlsx__WEBPACK_IMPORTED_MODULE_5__.utils.book_append_sheet(workbook, worksheet, 'Sheet1');\r\n\r\n // Generate a blob from the workbook\r\n const excelBlob = new Blob([xlsx__WEBPACK_IMPORTED_MODULE_5__.write(workbook, { type: 'array', bookType: 'xlsx' })], {\r\n type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\r\n });\r\n\r\n // Create a temporary URL for the blob\r\n const excelUrl = URL.createObjectURL(excelBlob);\r\n\r\n // Create a link element\r\n const link = document.createElement('a');\r\n link.href = excelUrl;\r\n link.download = `${document.getElementById(\"inputText\").value.trim()}.xlsx`;\r\n\r\n // Append the link to the document body and trigger the download\r\n document.body.appendChild(link);\r\n link.click();\r\n\r\n // Clean up\r\n URL.revokeObjectURL(excelUrl);\r\n document.body.removeChild(link);\r\n } else if (format === 'csv') {\r\n // Convert JSON to CSV\r\n const csvContent = jsonData.map(row => {\r\n return Object.values(row).map(value => {\r\n if (typeof value === 'string') {\r\n // Escape double quotes within the value and enclose it in double quotes\r\n return '\"' + value.replace(/\"/g, '\"\"') + '\"';\r\n }\r\n return value;\r\n }).join(',');\r\n }).join('\\n');\r\n\r\n // Create a blob from the CSV content\r\n const csvBlob = new Blob([csvContent], { type: 'text/csv' });\r\n const csvUrl = URL.createObjectURL(csvBlob);\r\n\r\n // Create a link element\r\n const link = document.createElement('a');\r\n link.href = csvUrl;\r\n link.download = `${document.getElementById(\"inputText\").value.trim()}.csv`;\r\n\r\n // Append the link to the document body and trigger the download\r\n document.body.appendChild(link);\r\n link.click();\r\n\r\n // Clean up\r\n URL.revokeObjectURL(csvUrl);\r\n document.body.removeChild(link);\r\n\r\n } else if (format === 'json') {\r\n // Convert JSON to string\r\n const jsonString = JSON.stringify(jsonData, null, 2);\r\n\r\n // Create a blob from the JSON string\r\n const jsonBlob = new Blob([jsonString], { type: 'application/json' });\r\n\r\n // Create a temporary URL for the blob\r\n const jsonUrl = URL.createObjectURL(jsonBlob);\r\n\r\n // Create a link element\r\n const link = document.createElement('a');\r\n link.href = jsonUrl;\r\n link.download = `${document.getElementById(\"inputText\").value.trim()}.json`;\r\n\r\n // Append the link to the document body and trigger the download\r\n document.body.appendChild(link);\r\n link.click();\r\n\r\n // Clean up\r\n URL.revokeObjectURL(jsonUrl);\r\n document.body.removeChild(link);\r\n } else {\r\n console.error('Unsupported format');\r\n }\r\n}\r\n\r\nasync function tsne() {\r\n semanticWorker.postMessage({\r\n type: \"tsne\",\r\n data: {\r\n \"queryEmbedding\": queryEmbedding,\r\n \"searchResults\": searchResults,\r\n \"iterations\": document.getElementById(\"dimReductionIterations\").value,\r\n \"dimensionalityReductionSimilarityThreshold\": document.getElementById(\"dimensionalityReductionSimilarityThreshold\").value,\r\n \"colorBy\": document.getElementById(\"colorBy\").value\r\n }\r\n\r\n });\r\n}\r\n\r\ndocument.getElementById('copyURLButton').addEventListener('click', function () {\r\n var urlToCopy = window.location.href;\r\n navigator.clipboard.writeText(urlToCopy)\r\n .then(function () {\r\n })\r\n .catch(function (err) {\r\n console.error('Failed to copy URL to clipboard: ', err);\r\n });\r\n});\r\n\r\ndocument.addEventListener('DOMContentLoaded', function () {\r\n // Initialize a counter for the current row count\r\n let rowCount = 1; // Assuming the initial row is already present\r\n\r\n // Function to clone the row and replace the plus button with a minus button\r\n function TaddRow() {\r\n const originalRow = document.getElementById('initialQueryContainer');\r\n const clone = originalRow.cloneNode(true);\r\n clone.id = 'queryContainer' + rowCount; // Adjust the ID of the cloned row\r\n\r\n // Adjust IDs of all elements within the cloned row\r\n clone.querySelectorAll('input, button').forEach(function (element) {\r\n const currentId = element.id;\r\n const newId = currentId.replace(/\\d+$/, rowCount); // Replace the last digit(s) with the current rowCount\r\n element.id = newId;\r\n });\r\n\r\n const minusButton = clone.querySelector('.queryButton');\r\n minusButton.innerHTML = `\r\n \r\n `\r\n minusButton.title = 'Remove query';\r\n minusButton.addEventListener('click', function () { removeRow(clone); }); // Attach event listener to the minus button\r\n\r\n document.getElementById('queryRowsContainer').appendChild(clone);\r\n rowCount++; // Increment the row count\r\n }\r\n\r\n // Add event listener to the plus button\r\n const plusButton = document.querySelector('.btn-light');\r\n plusButton.addEventListener('click', TaddRow);\r\n});\r\n\r\nvar URLModeHidden = document.getElementById(\"copyURLButton\").hidden;\r\n\r\nif (URLModeHidden) {\r\n\r\n} else {\r\n // Call the function initially to set form inputs from URL parameters\r\n document.addEventListener('DOMContentLoaded', function () {\r\n // Your code here\r\n setFormInputsFromURL();\r\n\r\n // Use event delegation to handle inputs dynamically added\r\n document.body.addEventListener('input', function (event) {\r\n if (event.target.matches('.form-control, .form-check-input')) {\r\n updateURL(event);\r\n }\r\n\r\n if (event.target.matches('.inputText')) {\r\n // Check if the trimmed value of the input is \"special_vector\"\r\n if (event.target.value.trim() === \"special_vector\") {\r\n // If the condition is met, apply italic text and grey background\r\n event.target.style.fontStyle = 'italic';\r\n //event.target.style.backgroundColor = 'grey';\r\n } else {\r\n // If the condition is not met, remove italic text and grey background\r\n event.target.style.fontStyle = 'normal';\r\n //event.target.style.backgroundColor = '';\r\n }\r\n }\r\n });\r\n\r\n document.body.addEventListener('click', function (event) {\r\n if (event.target.matches('.queryButton')) {\r\n updateURL(event);\r\n }\r\n });\r\n });\r\n}\r\n\r\ndocument.getElementById('dimensionalityReduction').addEventListener('click', function (event) {\r\n tsne();\r\n});\r\n\r\nconst plotContainer = document.getElementById(\"plot-container\");\r\nlet deckgl;\r\nasync function loadScatterplot(data, similarityOpacity) {\r\n\r\n removeScatterplot();\r\n // Find the minimum and maximum similarity values, x values, and y values in the data array\r\n const minSimilarity = Math.min(...data.map(item => item.similarity));\r\n const maxSimilarity = Math.max(...data.map(item => item.similarity));\r\n\r\n const minX = Math.min(...data.map(item => item.x));\r\n const maxX = Math.max(...data.map(item => item.x));\r\n\r\n const minY = Math.min(...data.map(item => item.y));\r\n const maxY = Math.max(...data.map(item => item.y));\r\n\r\n // If needed, color by a unique colorClass value \r\n // Count distinct colorClasses and generate unique colors\r\n const colorClassSet = new Set(data.map(item => item.colorClass));\r\n const distinctColorClasses = Array.from(colorClassSet);\r\n\r\n const distinctColorClassesLength = distinctColorClasses.length\r\n\r\n if (distinctColorClassesLength == 1) {\r\n data.forEach(item => {\r\n item.distinctColor = [13,10,253,1]\r\n });\r\n }\r\n\r\n else {\r\n const palette = (0,distinct_colors__WEBPACK_IMPORTED_MODULE_4__[\"default\"])({ \"count\": distinctColorClassesLength })\r\n\r\n // Add distinctColor node to each object in data\r\n data.forEach(item => {\r\n const colorClassIndex = distinctColorClasses.indexOf(item.colorClass);\r\n item.distinctColor = palette[colorClassIndex]._rgb\r\n });\r\n }\r\n\r\n data = data.map(item => {\r\n // Normalize similarity values to the range [0, 1]\r\n let alpha;\r\n // Normalize x and y coordinates to the range [0, 1]\r\n const normalizedX = (item.x - minX) / (maxX - minX);\r\n const normalizedY = (item.y - minY) / (maxY - minY);\r\n if (similarityOpacity) {\r\n const normalizedSimilarity = (item.similarity - minSimilarity) / (maxSimilarity - minSimilarity);\r\n\r\n alpha = Math.floor(Math.min(1, Math.max(0, normalizedSimilarity)) * 255);\r\n }\r\n else {\r\n alpha = 255\r\n }\r\n // Map the alpha value to the entire opacity spectrum\r\n const color = [...item.distinctColor.slice(0, -1), alpha];\r\n //console.log(\"COLOR:\", color)\r\n return {\r\n coordinates: [normalizedX, normalizedY],\r\n color: color,\r\n similarity: item.similarity,\r\n label: item.label,\r\n };\r\n });\r\n\r\n // Calculate the bounding box of the data\r\n const bounds = data.reduce(\r\n (acc, point) => ({\r\n minX: Math.min(acc.minX, point.coordinates[0]),\r\n minY: Math.min(acc.minY, point.coordinates[1]),\r\n maxX: Math.max(acc.maxX, point.coordinates[0]),\r\n maxY: Math.max(acc.maxY, point.coordinates[1]),\r\n }),\r\n { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity }\r\n );\r\n\r\n deckgl = new _deck_gl_core__WEBPACK_IMPORTED_MODULE_6__[\"default\"]({\r\n canvas: 'deckgl',\r\n container: 'plot-container',\r\n initialViewState: {\r\n latitude: (bounds.minY + bounds.maxY) / 2,\r\n longitude: (bounds.minX + bounds.maxX) / 2,\r\n zoom: 9\r\n },\r\n controller: true,\r\n pickingRadius: 25,\r\n layers: [\r\n // Add a new LineLayer for the coordinate system\r\n /*new LineLayer({\r\n id: 'coordinate-system',\r\n data: generateGridData(20),\r\n getSourcePosition: d => d.sourcePosition,\r\n getTargetPosition: d => d.targetPosition,\r\n getColor: d => d.color,\r\n getWidth: 1,\r\n pickable: false\r\n }),\r\n */\r\n // ScatterplotLayer with all points added right away\r\n new _deck_gl_layers__WEBPACK_IMPORTED_MODULE_7__[\"default\"]({\r\n id: 'scatterplot',\r\n data: data,\r\n getPosition: d => d.coordinates,\r\n getRadius: parseInt(document.getElementById(\"scatterplotRadius\").value), // Adjust the radius to fit the new range\r\n getFillColor: d => d.color,\r\n pickable: true, // Enable picking for on-hover interaction\r\n onHover: info => {\r\n const tooltip = document.getElementById('tooltip');\r\n\r\n if (info.object) {\r\n const canvas = document.getElementById('deckgl');\r\n const rect = canvas.getBoundingClientRect();\r\n\r\n // Calculate the correct position by subtracting the canvas offset and adding the scroll position\r\n const left = window.scrollX + info.x + rect.left + 30;\r\n const top = window.scrollY + info.y + rect.top + -50;\r\n\r\n tooltip.innerHTML = `${info.object.label}
Similarity: ${info.object.similarity.toFixed(2)}`;\r\n tooltip.style.left = `${left}px`;\r\n tooltip.style.top = `${top}px`;\r\n tooltip.style.display = 'block';\r\n } else {\r\n tooltip.style.display = 'none';\r\n }\r\n },\r\n onClick: info => {\r\n const tooltip = document.getElementById('tooltip');\r\n\r\n if (info.object) {\r\n const canvas = document.getElementById('deckgl');\r\n const rect = canvas.getBoundingClientRect();\r\n\r\n // Calculate the correct position by subtracting the canvas offset and adding the scroll position\r\n const left = window.scrollX + info.x + rect.left + 30;\r\n const top = window.scrollY + info.y + rect.top + -50;\r\n\r\n tooltip.innerHTML = `${info.object.label}
Similarity: ${info.object.similarity.toFixed(2)}`;\r\n tooltip.style.left = `${left}px`;\r\n tooltip.style.top = `${top}px`;\r\n tooltip.style.display = 'block';\r\n } else {\r\n tooltip.style.display = 'none';\r\n }\r\n }\r\n\r\n })\r\n ]\r\n });\r\n\r\n plotContainer.style.height = \"700px\";\r\n}\r\n\r\nfunction removeScatterplot() {\r\n if (deckgl) {\r\n deckgl.finalize();\r\n deckgl = null;\r\n }\r\n}\r\n\r\nworker.onmessage = function (event) {\r\n const message = event.data;\r\n let resolve;\r\n\r\n switch (message.type) {\r\n case 'tsne':\r\n loadScatterplot(message.plotDataArray, document.getElementById(\"toggleOpacity\").checked);\r\n\r\n break\r\n default:\r\n console.error('Unknown message type: ' + message.type);\r\n }\r\n};\n\n//# sourceURL=webpack://qdrant-frontend/./src/js/index.js?"); + +/***/ }), + /***/ "?2ca1": /*!**********************************!*\ !*** onnxruntime-node (ignored) ***! @@ -253,6 +3531,60 @@ eval("/* (ignored) */\n\n//# sourceURL=webpack://qdrant-frontend/url_(ignored)?" /***/ }), +/***/ "./node_modules/chroma-js/chroma.js": +/*!******************************************!*\ + !*** ./node_modules/chroma-js/chroma.js ***! + \******************************************/ +/***/ (function(module) { + +eval("/**\n * chroma.js - JavaScript library for color conversions\n *\n * Copyright (c) 2011-2019, Gregor Aisch\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. The name Gregor Aisch may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * -------------------------------------------------------\n *\n * chroma.js includes colors from colorbrewer2.org, which are released under\n * the following license:\n *\n * Copyright (c) 2002 Cynthia Brewer, Mark Harrower,\n * and The Pennsylvania State University.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\n * either express or implied. See the License for the specific\n * language governing permissions and limitations under the License.\n *\n * ------------------------------------------------------\n *\n * Named colors are taken from X11 Color Names.\n * http://www.w3.org/TR/css3-color/#svg-color\n *\n * @preserve\n */\n\n(function (global, factory) {\n true ? module.exports = factory() :\n 0;\n})(this, (function () { 'use strict';\n\n var limit$2 = function (x, min, max) {\n if ( min === void 0 ) min=0;\n if ( max === void 0 ) max=1;\n\n return x < min ? min : x > max ? max : x;\n };\n\n var limit$1 = limit$2;\n\n var clip_rgb$3 = function (rgb) {\n rgb._clipped = false;\n rgb._unclipped = rgb.slice(0);\n for (var i=0; i<=3; i++) {\n if (i < 3) {\n if (rgb[i] < 0 || rgb[i] > 255) { rgb._clipped = true; }\n rgb[i] = limit$1(rgb[i], 0, 255);\n } else if (i === 3) {\n rgb[i] = limit$1(rgb[i], 0, 1);\n }\n }\n return rgb;\n };\n\n // ported from jQuery's $.type\n var classToType = {};\n for (var i$1 = 0, list$1 = ['Boolean', 'Number', 'String', 'Function', 'Array', 'Date', 'RegExp', 'Undefined', 'Null']; i$1 < list$1.length; i$1 += 1) {\n var name = list$1[i$1];\n\n classToType[(\"[object \" + name + \"]\")] = name.toLowerCase();\n }\n var type$p = function(obj) {\n return classToType[Object.prototype.toString.call(obj)] || \"object\";\n };\n\n var type$o = type$p;\n\n var unpack$B = function (args, keyOrder) {\n if ( keyOrder === void 0 ) keyOrder=null;\n\n \t// if called with more than 3 arguments, we return the arguments\n if (args.length >= 3) { return Array.prototype.slice.call(args); }\n // with less than 3 args we check if first arg is object\n // and use the keyOrder string to extract and sort properties\n \tif (type$o(args[0]) == 'object' && keyOrder) {\n \t\treturn keyOrder.split('')\n \t\t\t.filter(function (k) { return args[0][k] !== undefined; })\n \t\t\t.map(function (k) { return args[0][k]; });\n \t}\n \t// otherwise we just return the first argument\n \t// (which we suppose is an array of args)\n return args[0];\n };\n\n var type$n = type$p;\n\n var last$4 = function (args) {\n if (args.length < 2) { return null; }\n var l = args.length-1;\n if (type$n(args[l]) == 'string') { return args[l].toLowerCase(); }\n return null;\n };\n\n var PI$2 = Math.PI;\n\n var utils = {\n \tclip_rgb: clip_rgb$3,\n \tlimit: limit$2,\n \ttype: type$p,\n \tunpack: unpack$B,\n \tlast: last$4,\n \tPI: PI$2,\n \tTWOPI: PI$2*2,\n \tPITHIRD: PI$2/3,\n \tDEG2RAD: PI$2 / 180,\n \tRAD2DEG: 180 / PI$2\n };\n\n var input$h = {\n \tformat: {},\n \tautodetect: []\n };\n\n var last$3 = utils.last;\n var clip_rgb$2 = utils.clip_rgb;\n var type$m = utils.type;\n var _input = input$h;\n\n var Color$D = function Color() {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var me = this;\n if (type$m(args[0]) === 'object' &&\n args[0].constructor &&\n args[0].constructor === this.constructor) {\n // the argument is already a Color instance\n return args[0];\n }\n\n // last argument could be the mode\n var mode = last$3(args);\n var autodetect = false;\n\n if (!mode) {\n autodetect = true;\n if (!_input.sorted) {\n _input.autodetect = _input.autodetect.sort(function (a,b) { return b.p - a.p; });\n _input.sorted = true;\n }\n // auto-detect format\n for (var i = 0, list = _input.autodetect; i < list.length; i += 1) {\n var chk = list[i];\n\n mode = chk.test.apply(chk, args);\n if (mode) { break; }\n }\n }\n\n if (_input.format[mode]) {\n var rgb = _input.format[mode].apply(null, autodetect ? args : args.slice(0,-1));\n me._rgb = clip_rgb$2(rgb);\n } else {\n throw new Error('unknown format: '+args);\n }\n\n // add alpha channel\n if (me._rgb.length === 3) { me._rgb.push(1); }\n };\n\n Color$D.prototype.toString = function toString () {\n if (type$m(this.hex) == 'function') { return this.hex(); }\n return (\"[\" + (this._rgb.join(',')) + \"]\");\n };\n\n var Color_1 = Color$D;\n\n var chroma$k = function () {\n \tvar args = [], len = arguments.length;\n \twhile ( len-- ) args[ len ] = arguments[ len ];\n\n \treturn new (Function.prototype.bind.apply( chroma$k.Color, [ null ].concat( args) ));\n };\n\n chroma$k.Color = Color_1;\n chroma$k.version = '2.4.2';\n\n var chroma_1 = chroma$k;\n\n var unpack$A = utils.unpack;\n var max$2 = Math.max;\n\n var rgb2cmyk$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$A(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n r = r / 255;\n g = g / 255;\n b = b / 255;\n var k = 1 - max$2(r,max$2(g,b));\n var f = k < 1 ? 1 / (1-k) : 0;\n var c = (1-r-k) * f;\n var m = (1-g-k) * f;\n var y = (1-b-k) * f;\n return [c,m,y,k];\n };\n\n var rgb2cmyk_1 = rgb2cmyk$1;\n\n var unpack$z = utils.unpack;\n\n var cmyk2rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$z(args, 'cmyk');\n var c = args[0];\n var m = args[1];\n var y = args[2];\n var k = args[3];\n var alpha = args.length > 4 ? args[4] : 1;\n if (k === 1) { return [0,0,0,alpha]; }\n return [\n c >= 1 ? 0 : 255 * (1-c) * (1-k), // r\n m >= 1 ? 0 : 255 * (1-m) * (1-k), // g\n y >= 1 ? 0 : 255 * (1-y) * (1-k), // b\n alpha\n ];\n };\n\n var cmyk2rgb_1 = cmyk2rgb;\n\n var chroma$j = chroma_1;\n var Color$C = Color_1;\n var input$g = input$h;\n var unpack$y = utils.unpack;\n var type$l = utils.type;\n\n var rgb2cmyk = rgb2cmyk_1;\n\n Color$C.prototype.cmyk = function() {\n return rgb2cmyk(this._rgb);\n };\n\n chroma$j.cmyk = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$C, [ null ].concat( args, ['cmyk']) ));\n };\n\n input$g.format.cmyk = cmyk2rgb_1;\n\n input$g.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$y(args, 'cmyk');\n if (type$l(args) === 'array' && args.length === 4) {\n return 'cmyk';\n }\n }\n });\n\n var unpack$x = utils.unpack;\n var last$2 = utils.last;\n var rnd = function (a) { return Math.round(a*100)/100; };\n\n /*\n * supported arguments:\n * - hsl2css(h,s,l)\n * - hsl2css(h,s,l,a)\n * - hsl2css([h,s,l], mode)\n * - hsl2css([h,s,l,a], mode)\n * - hsl2css({h,s,l,a}, mode)\n */\n var hsl2css$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var hsla = unpack$x(args, 'hsla');\n var mode = last$2(args) || 'lsa';\n hsla[0] = rnd(hsla[0] || 0);\n hsla[1] = rnd(hsla[1]*100) + '%';\n hsla[2] = rnd(hsla[2]*100) + '%';\n if (mode === 'hsla' || (hsla.length > 3 && hsla[3]<1)) {\n hsla[3] = hsla.length > 3 ? hsla[3] : 1;\n mode = 'hsla';\n } else {\n hsla.length = 3;\n }\n return (mode + \"(\" + (hsla.join(',')) + \")\");\n };\n\n var hsl2css_1 = hsl2css$1;\n\n var unpack$w = utils.unpack;\n\n /*\n * supported arguments:\n * - rgb2hsl(r,g,b)\n * - rgb2hsl(r,g,b,a)\n * - rgb2hsl([r,g,b])\n * - rgb2hsl([r,g,b,a])\n * - rgb2hsl({r,g,b,a})\n */\n var rgb2hsl$3 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$w(args, 'rgba');\n var r = args[0];\n var g = args[1];\n var b = args[2];\n\n r /= 255;\n g /= 255;\n b /= 255;\n\n var min = Math.min(r, g, b);\n var max = Math.max(r, g, b);\n\n var l = (max + min) / 2;\n var s, h;\n\n if (max === min){\n s = 0;\n h = Number.NaN;\n } else {\n s = l < 0.5 ? (max - min) / (max + min) : (max - min) / (2 - max - min);\n }\n\n if (r == max) { h = (g - b) / (max - min); }\n else if (g == max) { h = 2 + (b - r) / (max - min); }\n else if (b == max) { h = 4 + (r - g) / (max - min); }\n\n h *= 60;\n if (h < 0) { h += 360; }\n if (args.length>3 && args[3]!==undefined) { return [h,s,l,args[3]]; }\n return [h,s,l];\n };\n\n var rgb2hsl_1 = rgb2hsl$3;\n\n var unpack$v = utils.unpack;\n var last$1 = utils.last;\n var hsl2css = hsl2css_1;\n var rgb2hsl$2 = rgb2hsl_1;\n var round$6 = Math.round;\n\n /*\n * supported arguments:\n * - rgb2css(r,g,b)\n * - rgb2css(r,g,b,a)\n * - rgb2css([r,g,b], mode)\n * - rgb2css([r,g,b,a], mode)\n * - rgb2css({r,g,b,a}, mode)\n */\n var rgb2css$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var rgba = unpack$v(args, 'rgba');\n var mode = last$1(args) || 'rgb';\n if (mode.substr(0,3) == 'hsl') {\n return hsl2css(rgb2hsl$2(rgba), mode);\n }\n rgba[0] = round$6(rgba[0]);\n rgba[1] = round$6(rgba[1]);\n rgba[2] = round$6(rgba[2]);\n if (mode === 'rgba' || (rgba.length > 3 && rgba[3]<1)) {\n rgba[3] = rgba.length > 3 ? rgba[3] : 1;\n mode = 'rgba';\n }\n return (mode + \"(\" + (rgba.slice(0,mode==='rgb'?3:4).join(',')) + \")\");\n };\n\n var rgb2css_1 = rgb2css$1;\n\n var unpack$u = utils.unpack;\n var round$5 = Math.round;\n\n var hsl2rgb$1 = function () {\n var assign;\n\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n args = unpack$u(args, 'hsl');\n var h = args[0];\n var s = args[1];\n var l = args[2];\n var r,g,b;\n if (s === 0) {\n r = g = b = l*255;\n } else {\n var t3 = [0,0,0];\n var c = [0,0,0];\n var t2 = l < 0.5 ? l * (1+s) : l+s-l*s;\n var t1 = 2 * l - t2;\n var h_ = h / 360;\n t3[0] = h_ + 1/3;\n t3[1] = h_;\n t3[2] = h_ - 1/3;\n for (var i=0; i<3; i++) {\n if (t3[i] < 0) { t3[i] += 1; }\n if (t3[i] > 1) { t3[i] -= 1; }\n if (6 * t3[i] < 1)\n { c[i] = t1 + (t2 - t1) * 6 * t3[i]; }\n else if (2 * t3[i] < 1)\n { c[i] = t2; }\n else if (3 * t3[i] < 2)\n { c[i] = t1 + (t2 - t1) * ((2 / 3) - t3[i]) * 6; }\n else\n { c[i] = t1; }\n }\n (assign = [round$5(c[0]*255),round$5(c[1]*255),round$5(c[2]*255)], r = assign[0], g = assign[1], b = assign[2]);\n }\n if (args.length > 3) {\n // keep alpha channel\n return [r,g,b,args[3]];\n }\n return [r,g,b,1];\n };\n\n var hsl2rgb_1 = hsl2rgb$1;\n\n var hsl2rgb = hsl2rgb_1;\n var input$f = input$h;\n\n var RE_RGB = /^rgb\\(\\s*(-?\\d+),\\s*(-?\\d+)\\s*,\\s*(-?\\d+)\\s*\\)$/;\n var RE_RGBA = /^rgba\\(\\s*(-?\\d+),\\s*(-?\\d+)\\s*,\\s*(-?\\d+)\\s*,\\s*([01]|[01]?\\.\\d+)\\)$/;\n var RE_RGB_PCT = /^rgb\\(\\s*(-?\\d+(?:\\.\\d+)?)%,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*\\)$/;\n var RE_RGBA_PCT = /^rgba\\(\\s*(-?\\d+(?:\\.\\d+)?)%,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*([01]|[01]?\\.\\d+)\\)$/;\n var RE_HSL = /^hsl\\(\\s*(-?\\d+(?:\\.\\d+)?),\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*\\)$/;\n var RE_HSLA = /^hsla\\(\\s*(-?\\d+(?:\\.\\d+)?),\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*([01]|[01]?\\.\\d+)\\)$/;\n\n var round$4 = Math.round;\n\n var css2rgb$1 = function (css) {\n css = css.toLowerCase().trim();\n var m;\n\n if (input$f.format.named) {\n try {\n return input$f.format.named(css);\n } catch (e) {\n // eslint-disable-next-line\n }\n }\n\n // rgb(250,20,0)\n if ((m = css.match(RE_RGB))) {\n var rgb = m.slice(1,4);\n for (var i=0; i<3; i++) {\n rgb[i] = +rgb[i];\n }\n rgb[3] = 1; // default alpha\n return rgb;\n }\n\n // rgba(250,20,0,0.4)\n if ((m = css.match(RE_RGBA))) {\n var rgb$1 = m.slice(1,5);\n for (var i$1=0; i$1<4; i$1++) {\n rgb$1[i$1] = +rgb$1[i$1];\n }\n return rgb$1;\n }\n\n // rgb(100%,0%,0%)\n if ((m = css.match(RE_RGB_PCT))) {\n var rgb$2 = m.slice(1,4);\n for (var i$2=0; i$2<3; i$2++) {\n rgb$2[i$2] = round$4(rgb$2[i$2] * 2.55);\n }\n rgb$2[3] = 1; // default alpha\n return rgb$2;\n }\n\n // rgba(100%,0%,0%,0.4)\n if ((m = css.match(RE_RGBA_PCT))) {\n var rgb$3 = m.slice(1,5);\n for (var i$3=0; i$3<3; i$3++) {\n rgb$3[i$3] = round$4(rgb$3[i$3] * 2.55);\n }\n rgb$3[3] = +rgb$3[3];\n return rgb$3;\n }\n\n // hsl(0,100%,50%)\n if ((m = css.match(RE_HSL))) {\n var hsl = m.slice(1,4);\n hsl[1] *= 0.01;\n hsl[2] *= 0.01;\n var rgb$4 = hsl2rgb(hsl);\n rgb$4[3] = 1;\n return rgb$4;\n }\n\n // hsla(0,100%,50%,0.5)\n if ((m = css.match(RE_HSLA))) {\n var hsl$1 = m.slice(1,4);\n hsl$1[1] *= 0.01;\n hsl$1[2] *= 0.01;\n var rgb$5 = hsl2rgb(hsl$1);\n rgb$5[3] = +m[4]; // default alpha = 1\n return rgb$5;\n }\n };\n\n css2rgb$1.test = function (s) {\n return RE_RGB.test(s) ||\n RE_RGBA.test(s) ||\n RE_RGB_PCT.test(s) ||\n RE_RGBA_PCT.test(s) ||\n RE_HSL.test(s) ||\n RE_HSLA.test(s);\n };\n\n var css2rgb_1 = css2rgb$1;\n\n var chroma$i = chroma_1;\n var Color$B = Color_1;\n var input$e = input$h;\n var type$k = utils.type;\n\n var rgb2css = rgb2css_1;\n var css2rgb = css2rgb_1;\n\n Color$B.prototype.css = function(mode) {\n return rgb2css(this._rgb, mode);\n };\n\n chroma$i.css = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$B, [ null ].concat( args, ['css']) ));\n };\n\n input$e.format.css = css2rgb;\n\n input$e.autodetect.push({\n p: 5,\n test: function (h) {\n var rest = [], len = arguments.length - 1;\n while ( len-- > 0 ) rest[ len ] = arguments[ len + 1 ];\n\n if (!rest.length && type$k(h) === 'string' && css2rgb.test(h)) {\n return 'css';\n }\n }\n });\n\n var Color$A = Color_1;\n var chroma$h = chroma_1;\n var input$d = input$h;\n var unpack$t = utils.unpack;\n\n input$d.format.gl = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var rgb = unpack$t(args, 'rgba');\n rgb[0] *= 255;\n rgb[1] *= 255;\n rgb[2] *= 255;\n return rgb;\n };\n\n chroma$h.gl = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$A, [ null ].concat( args, ['gl']) ));\n };\n\n Color$A.prototype.gl = function() {\n var rgb = this._rgb;\n return [rgb[0]/255, rgb[1]/255, rgb[2]/255, rgb[3]];\n };\n\n var unpack$s = utils.unpack;\n\n var rgb2hcg$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$s(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var min = Math.min(r, g, b);\n var max = Math.max(r, g, b);\n var delta = max - min;\n var c = delta * 100 / 255;\n var _g = min / (255 - delta) * 100;\n var h;\n if (delta === 0) {\n h = Number.NaN;\n } else {\n if (r === max) { h = (g - b) / delta; }\n if (g === max) { h = 2+(b - r) / delta; }\n if (b === max) { h = 4+(r - g) / delta; }\n h *= 60;\n if (h < 0) { h += 360; }\n }\n return [h, c, _g];\n };\n\n var rgb2hcg_1 = rgb2hcg$1;\n\n var unpack$r = utils.unpack;\n var floor$3 = Math.floor;\n\n /*\n * this is basically just HSV with some minor tweaks\n *\n * hue.. [0..360]\n * chroma .. [0..1]\n * grayness .. [0..1]\n */\n\n var hcg2rgb = function () {\n var assign, assign$1, assign$2, assign$3, assign$4, assign$5;\n\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n args = unpack$r(args, 'hcg');\n var h = args[0];\n var c = args[1];\n var _g = args[2];\n var r,g,b;\n _g = _g * 255;\n var _c = c * 255;\n if (c === 0) {\n r = g = b = _g;\n } else {\n if (h === 360) { h = 0; }\n if (h > 360) { h -= 360; }\n if (h < 0) { h += 360; }\n h /= 60;\n var i = floor$3(h);\n var f = h - i;\n var p = _g * (1 - c);\n var q = p + _c * (1 - f);\n var t = p + _c * f;\n var v = p + _c;\n switch (i) {\n case 0: (assign = [v, t, p], r = assign[0], g = assign[1], b = assign[2]); break\n case 1: (assign$1 = [q, v, p], r = assign$1[0], g = assign$1[1], b = assign$1[2]); break\n case 2: (assign$2 = [p, v, t], r = assign$2[0], g = assign$2[1], b = assign$2[2]); break\n case 3: (assign$3 = [p, q, v], r = assign$3[0], g = assign$3[1], b = assign$3[2]); break\n case 4: (assign$4 = [t, p, v], r = assign$4[0], g = assign$4[1], b = assign$4[2]); break\n case 5: (assign$5 = [v, p, q], r = assign$5[0], g = assign$5[1], b = assign$5[2]); break\n }\n }\n return [r, g, b, args.length > 3 ? args[3] : 1];\n };\n\n var hcg2rgb_1 = hcg2rgb;\n\n var unpack$q = utils.unpack;\n var type$j = utils.type;\n var chroma$g = chroma_1;\n var Color$z = Color_1;\n var input$c = input$h;\n\n var rgb2hcg = rgb2hcg_1;\n\n Color$z.prototype.hcg = function() {\n return rgb2hcg(this._rgb);\n };\n\n chroma$g.hcg = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$z, [ null ].concat( args, ['hcg']) ));\n };\n\n input$c.format.hcg = hcg2rgb_1;\n\n input$c.autodetect.push({\n p: 1,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$q(args, 'hcg');\n if (type$j(args) === 'array' && args.length === 3) {\n return 'hcg';\n }\n }\n });\n\n var unpack$p = utils.unpack;\n var last = utils.last;\n var round$3 = Math.round;\n\n var rgb2hex$2 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$p(args, 'rgba');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var a = ref[3];\n var mode = last(args) || 'auto';\n if (a === undefined) { a = 1; }\n if (mode === 'auto') {\n mode = a < 1 ? 'rgba' : 'rgb';\n }\n r = round$3(r);\n g = round$3(g);\n b = round$3(b);\n var u = r << 16 | g << 8 | b;\n var str = \"000000\" + u.toString(16); //#.toUpperCase();\n str = str.substr(str.length - 6);\n var hxa = '0' + round$3(a * 255).toString(16);\n hxa = hxa.substr(hxa.length - 2);\n switch (mode.toLowerCase()) {\n case 'rgba': return (\"#\" + str + hxa);\n case 'argb': return (\"#\" + hxa + str);\n default: return (\"#\" + str);\n }\n };\n\n var rgb2hex_1 = rgb2hex$2;\n\n var RE_HEX = /^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;\n var RE_HEXA = /^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/;\n\n var hex2rgb$1 = function (hex) {\n if (hex.match(RE_HEX)) {\n // remove optional leading #\n if (hex.length === 4 || hex.length === 7) {\n hex = hex.substr(1);\n }\n // expand short-notation to full six-digit\n if (hex.length === 3) {\n hex = hex.split('');\n hex = hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2];\n }\n var u = parseInt(hex, 16);\n var r = u >> 16;\n var g = u >> 8 & 0xFF;\n var b = u & 0xFF;\n return [r,g,b,1];\n }\n\n // match rgba hex format, eg #FF000077\n if (hex.match(RE_HEXA)) {\n if (hex.length === 5 || hex.length === 9) {\n // remove optional leading #\n hex = hex.substr(1);\n }\n // expand short-notation to full eight-digit\n if (hex.length === 4) {\n hex = hex.split('');\n hex = hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2]+hex[3]+hex[3];\n }\n var u$1 = parseInt(hex, 16);\n var r$1 = u$1 >> 24 & 0xFF;\n var g$1 = u$1 >> 16 & 0xFF;\n var b$1 = u$1 >> 8 & 0xFF;\n var a = Math.round((u$1 & 0xFF) / 0xFF * 100) / 100;\n return [r$1,g$1,b$1,a];\n }\n\n // we used to check for css colors here\n // if _input.css? and rgb = _input.css hex\n // return rgb\n\n throw new Error((\"unknown hex color: \" + hex));\n };\n\n var hex2rgb_1 = hex2rgb$1;\n\n var chroma$f = chroma_1;\n var Color$y = Color_1;\n var type$i = utils.type;\n var input$b = input$h;\n\n var rgb2hex$1 = rgb2hex_1;\n\n Color$y.prototype.hex = function(mode) {\n return rgb2hex$1(this._rgb, mode);\n };\n\n chroma$f.hex = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$y, [ null ].concat( args, ['hex']) ));\n };\n\n input$b.format.hex = hex2rgb_1;\n input$b.autodetect.push({\n p: 4,\n test: function (h) {\n var rest = [], len = arguments.length - 1;\n while ( len-- > 0 ) rest[ len ] = arguments[ len + 1 ];\n\n if (!rest.length && type$i(h) === 'string' && [3,4,5,6,7,8,9].indexOf(h.length) >= 0) {\n return 'hex';\n }\n }\n });\n\n var unpack$o = utils.unpack;\n var TWOPI$2 = utils.TWOPI;\n var min$2 = Math.min;\n var sqrt$4 = Math.sqrt;\n var acos = Math.acos;\n\n var rgb2hsi$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n /*\n borrowed from here:\n http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/rgb2hsi.cpp\n */\n var ref = unpack$o(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n r /= 255;\n g /= 255;\n b /= 255;\n var h;\n var min_ = min$2(r,g,b);\n var i = (r+g+b) / 3;\n var s = i > 0 ? 1 - min_/i : 0;\n if (s === 0) {\n h = NaN;\n } else {\n h = ((r-g)+(r-b)) / 2;\n h /= sqrt$4((r-g)*(r-g) + (r-b)*(g-b));\n h = acos(h);\n if (b > g) {\n h = TWOPI$2 - h;\n }\n h /= TWOPI$2;\n }\n return [h*360,s,i];\n };\n\n var rgb2hsi_1 = rgb2hsi$1;\n\n var unpack$n = utils.unpack;\n var limit = utils.limit;\n var TWOPI$1 = utils.TWOPI;\n var PITHIRD = utils.PITHIRD;\n var cos$4 = Math.cos;\n\n /*\n * hue [0..360]\n * saturation [0..1]\n * intensity [0..1]\n */\n var hsi2rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n /*\n borrowed from here:\n http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/hsi2rgb.cpp\n */\n args = unpack$n(args, 'hsi');\n var h = args[0];\n var s = args[1];\n var i = args[2];\n var r,g,b;\n\n if (isNaN(h)) { h = 0; }\n if (isNaN(s)) { s = 0; }\n // normalize hue\n if (h > 360) { h -= 360; }\n if (h < 0) { h += 360; }\n h /= 360;\n if (h < 1/3) {\n b = (1-s)/3;\n r = (1+s*cos$4(TWOPI$1*h)/cos$4(PITHIRD-TWOPI$1*h))/3;\n g = 1 - (b+r);\n } else if (h < 2/3) {\n h -= 1/3;\n r = (1-s)/3;\n g = (1+s*cos$4(TWOPI$1*h)/cos$4(PITHIRD-TWOPI$1*h))/3;\n b = 1 - (r+g);\n } else {\n h -= 2/3;\n g = (1-s)/3;\n b = (1+s*cos$4(TWOPI$1*h)/cos$4(PITHIRD-TWOPI$1*h))/3;\n r = 1 - (g+b);\n }\n r = limit(i*r*3);\n g = limit(i*g*3);\n b = limit(i*b*3);\n return [r*255, g*255, b*255, args.length > 3 ? args[3] : 1];\n };\n\n var hsi2rgb_1 = hsi2rgb;\n\n var unpack$m = utils.unpack;\n var type$h = utils.type;\n var chroma$e = chroma_1;\n var Color$x = Color_1;\n var input$a = input$h;\n\n var rgb2hsi = rgb2hsi_1;\n\n Color$x.prototype.hsi = function() {\n return rgb2hsi(this._rgb);\n };\n\n chroma$e.hsi = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$x, [ null ].concat( args, ['hsi']) ));\n };\n\n input$a.format.hsi = hsi2rgb_1;\n\n input$a.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$m(args, 'hsi');\n if (type$h(args) === 'array' && args.length === 3) {\n return 'hsi';\n }\n }\n });\n\n var unpack$l = utils.unpack;\n var type$g = utils.type;\n var chroma$d = chroma_1;\n var Color$w = Color_1;\n var input$9 = input$h;\n\n var rgb2hsl$1 = rgb2hsl_1;\n\n Color$w.prototype.hsl = function() {\n return rgb2hsl$1(this._rgb);\n };\n\n chroma$d.hsl = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$w, [ null ].concat( args, ['hsl']) ));\n };\n\n input$9.format.hsl = hsl2rgb_1;\n\n input$9.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$l(args, 'hsl');\n if (type$g(args) === 'array' && args.length === 3) {\n return 'hsl';\n }\n }\n });\n\n var unpack$k = utils.unpack;\n var min$1 = Math.min;\n var max$1 = Math.max;\n\n /*\n * supported arguments:\n * - rgb2hsv(r,g,b)\n * - rgb2hsv([r,g,b])\n * - rgb2hsv({r,g,b})\n */\n var rgb2hsl = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$k(args, 'rgb');\n var r = args[0];\n var g = args[1];\n var b = args[2];\n var min_ = min$1(r, g, b);\n var max_ = max$1(r, g, b);\n var delta = max_ - min_;\n var h,s,v;\n v = max_ / 255.0;\n if (max_ === 0) {\n h = Number.NaN;\n s = 0;\n } else {\n s = delta / max_;\n if (r === max_) { h = (g - b) / delta; }\n if (g === max_) { h = 2+(b - r) / delta; }\n if (b === max_) { h = 4+(r - g) / delta; }\n h *= 60;\n if (h < 0) { h += 360; }\n }\n return [h, s, v]\n };\n\n var rgb2hsv$1 = rgb2hsl;\n\n var unpack$j = utils.unpack;\n var floor$2 = Math.floor;\n\n var hsv2rgb = function () {\n var assign, assign$1, assign$2, assign$3, assign$4, assign$5;\n\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n args = unpack$j(args, 'hsv');\n var h = args[0];\n var s = args[1];\n var v = args[2];\n var r,g,b;\n v *= 255;\n if (s === 0) {\n r = g = b = v;\n } else {\n if (h === 360) { h = 0; }\n if (h > 360) { h -= 360; }\n if (h < 0) { h += 360; }\n h /= 60;\n\n var i = floor$2(h);\n var f = h - i;\n var p = v * (1 - s);\n var q = v * (1 - s * f);\n var t = v * (1 - s * (1 - f));\n\n switch (i) {\n case 0: (assign = [v, t, p], r = assign[0], g = assign[1], b = assign[2]); break\n case 1: (assign$1 = [q, v, p], r = assign$1[0], g = assign$1[1], b = assign$1[2]); break\n case 2: (assign$2 = [p, v, t], r = assign$2[0], g = assign$2[1], b = assign$2[2]); break\n case 3: (assign$3 = [p, q, v], r = assign$3[0], g = assign$3[1], b = assign$3[2]); break\n case 4: (assign$4 = [t, p, v], r = assign$4[0], g = assign$4[1], b = assign$4[2]); break\n case 5: (assign$5 = [v, p, q], r = assign$5[0], g = assign$5[1], b = assign$5[2]); break\n }\n }\n return [r,g,b,args.length > 3?args[3]:1];\n };\n\n var hsv2rgb_1 = hsv2rgb;\n\n var unpack$i = utils.unpack;\n var type$f = utils.type;\n var chroma$c = chroma_1;\n var Color$v = Color_1;\n var input$8 = input$h;\n\n var rgb2hsv = rgb2hsv$1;\n\n Color$v.prototype.hsv = function() {\n return rgb2hsv(this._rgb);\n };\n\n chroma$c.hsv = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$v, [ null ].concat( args, ['hsv']) ));\n };\n\n input$8.format.hsv = hsv2rgb_1;\n\n input$8.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$i(args, 'hsv');\n if (type$f(args) === 'array' && args.length === 3) {\n return 'hsv';\n }\n }\n });\n\n var labConstants = {\n // Corresponds roughly to RGB brighter/darker\n Kn: 18,\n\n // D65 standard referent\n Xn: 0.950470,\n Yn: 1,\n Zn: 1.088830,\n\n t0: 0.137931034, // 4 / 29\n t1: 0.206896552, // 6 / 29\n t2: 0.12841855, // 3 * t1 * t1\n t3: 0.008856452, // t1 * t1 * t1\n };\n\n var LAB_CONSTANTS$3 = labConstants;\n var unpack$h = utils.unpack;\n var pow$a = Math.pow;\n\n var rgb2lab$2 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$h(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var ref$1 = rgb2xyz(r,g,b);\n var x = ref$1[0];\n var y = ref$1[1];\n var z = ref$1[2];\n var l = 116 * y - 16;\n return [l < 0 ? 0 : l, 500 * (x - y), 200 * (y - z)];\n };\n\n var rgb_xyz = function (r) {\n if ((r /= 255) <= 0.04045) { return r / 12.92; }\n return pow$a((r + 0.055) / 1.055, 2.4);\n };\n\n var xyz_lab = function (t) {\n if (t > LAB_CONSTANTS$3.t3) { return pow$a(t, 1 / 3); }\n return t / LAB_CONSTANTS$3.t2 + LAB_CONSTANTS$3.t0;\n };\n\n var rgb2xyz = function (r,g,b) {\n r = rgb_xyz(r);\n g = rgb_xyz(g);\n b = rgb_xyz(b);\n var x = xyz_lab((0.4124564 * r + 0.3575761 * g + 0.1804375 * b) / LAB_CONSTANTS$3.Xn);\n var y = xyz_lab((0.2126729 * r + 0.7151522 * g + 0.0721750 * b) / LAB_CONSTANTS$3.Yn);\n var z = xyz_lab((0.0193339 * r + 0.1191920 * g + 0.9503041 * b) / LAB_CONSTANTS$3.Zn);\n return [x,y,z];\n };\n\n var rgb2lab_1 = rgb2lab$2;\n\n var LAB_CONSTANTS$2 = labConstants;\n var unpack$g = utils.unpack;\n var pow$9 = Math.pow;\n\n /*\n * L* [0..100]\n * a [-100..100]\n * b [-100..100]\n */\n var lab2rgb$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$g(args, 'lab');\n var l = args[0];\n var a = args[1];\n var b = args[2];\n var x,y,z, r,g,b_;\n\n y = (l + 16) / 116;\n x = isNaN(a) ? y : y + a / 500;\n z = isNaN(b) ? y : y - b / 200;\n\n y = LAB_CONSTANTS$2.Yn * lab_xyz(y);\n x = LAB_CONSTANTS$2.Xn * lab_xyz(x);\n z = LAB_CONSTANTS$2.Zn * lab_xyz(z);\n\n r = xyz_rgb(3.2404542 * x - 1.5371385 * y - 0.4985314 * z); // D65 -> sRGB\n g = xyz_rgb(-0.9692660 * x + 1.8760108 * y + 0.0415560 * z);\n b_ = xyz_rgb(0.0556434 * x - 0.2040259 * y + 1.0572252 * z);\n\n return [r,g,b_,args.length > 3 ? args[3] : 1];\n };\n\n var xyz_rgb = function (r) {\n return 255 * (r <= 0.00304 ? 12.92 * r : 1.055 * pow$9(r, 1 / 2.4) - 0.055)\n };\n\n var lab_xyz = function (t) {\n return t > LAB_CONSTANTS$2.t1 ? t * t * t : LAB_CONSTANTS$2.t2 * (t - LAB_CONSTANTS$2.t0)\n };\n\n var lab2rgb_1 = lab2rgb$1;\n\n var unpack$f = utils.unpack;\n var type$e = utils.type;\n var chroma$b = chroma_1;\n var Color$u = Color_1;\n var input$7 = input$h;\n\n var rgb2lab$1 = rgb2lab_1;\n\n Color$u.prototype.lab = function() {\n return rgb2lab$1(this._rgb);\n };\n\n chroma$b.lab = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$u, [ null ].concat( args, ['lab']) ));\n };\n\n input$7.format.lab = lab2rgb_1;\n\n input$7.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$f(args, 'lab');\n if (type$e(args) === 'array' && args.length === 3) {\n return 'lab';\n }\n }\n });\n\n var unpack$e = utils.unpack;\n var RAD2DEG = utils.RAD2DEG;\n var sqrt$3 = Math.sqrt;\n var atan2$2 = Math.atan2;\n var round$2 = Math.round;\n\n var lab2lch$2 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$e(args, 'lab');\n var l = ref[0];\n var a = ref[1];\n var b = ref[2];\n var c = sqrt$3(a * a + b * b);\n var h = (atan2$2(b, a) * RAD2DEG + 360) % 360;\n if (round$2(c*10000) === 0) { h = Number.NaN; }\n return [l, c, h];\n };\n\n var lab2lch_1 = lab2lch$2;\n\n var unpack$d = utils.unpack;\n var rgb2lab = rgb2lab_1;\n var lab2lch$1 = lab2lch_1;\n\n var rgb2lch$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$d(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var ref$1 = rgb2lab(r,g,b);\n var l = ref$1[0];\n var a = ref$1[1];\n var b_ = ref$1[2];\n return lab2lch$1(l,a,b_);\n };\n\n var rgb2lch_1 = rgb2lch$1;\n\n var unpack$c = utils.unpack;\n var DEG2RAD = utils.DEG2RAD;\n var sin$3 = Math.sin;\n var cos$3 = Math.cos;\n\n var lch2lab$2 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n /*\n Convert from a qualitative parameter h and a quantitative parameter l to a 24-bit pixel.\n These formulas were invented by David Dalrymple to obtain maximum contrast without going\n out of gamut if the parameters are in the range 0-1.\n\n A saturation multiplier was added by Gregor Aisch\n */\n var ref = unpack$c(args, 'lch');\n var l = ref[0];\n var c = ref[1];\n var h = ref[2];\n if (isNaN(h)) { h = 0; }\n h = h * DEG2RAD;\n return [l, cos$3(h) * c, sin$3(h) * c]\n };\n\n var lch2lab_1 = lch2lab$2;\n\n var unpack$b = utils.unpack;\n var lch2lab$1 = lch2lab_1;\n var lab2rgb = lab2rgb_1;\n\n var lch2rgb$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$b(args, 'lch');\n var l = args[0];\n var c = args[1];\n var h = args[2];\n var ref = lch2lab$1 (l,c,h);\n var L = ref[0];\n var a = ref[1];\n var b_ = ref[2];\n var ref$1 = lab2rgb (L,a,b_);\n var r = ref$1[0];\n var g = ref$1[1];\n var b = ref$1[2];\n return [r, g, b, args.length > 3 ? args[3] : 1];\n };\n\n var lch2rgb_1 = lch2rgb$1;\n\n var unpack$a = utils.unpack;\n var lch2rgb = lch2rgb_1;\n\n var hcl2rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var hcl = unpack$a(args, 'hcl').reverse();\n return lch2rgb.apply(void 0, hcl);\n };\n\n var hcl2rgb_1 = hcl2rgb;\n\n var unpack$9 = utils.unpack;\n var type$d = utils.type;\n var chroma$a = chroma_1;\n var Color$t = Color_1;\n var input$6 = input$h;\n\n var rgb2lch = rgb2lch_1;\n\n Color$t.prototype.lch = function() { return rgb2lch(this._rgb); };\n Color$t.prototype.hcl = function() { return rgb2lch(this._rgb).reverse(); };\n\n chroma$a.lch = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$t, [ null ].concat( args, ['lch']) ));\n };\n chroma$a.hcl = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$t, [ null ].concat( args, ['hcl']) ));\n };\n\n input$6.format.lch = lch2rgb_1;\n input$6.format.hcl = hcl2rgb_1;\n\n ['lch','hcl'].forEach(function (m) { return input$6.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$9(args, m);\n if (type$d(args) === 'array' && args.length === 3) {\n return m;\n }\n }\n }); });\n\n /**\n \tX11 color names\n\n \thttp://www.w3.org/TR/css3-color/#svg-color\n */\n\n var w3cx11$1 = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflower: '#6495ed',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkgrey: '#a9a9a9',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkslategrey: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dimgrey: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n gold: '#ffd700',\n goldenrod: '#daa520',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n grey: '#808080',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n laserlemon: '#ffff54',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrod: '#fafad2',\n lightgoldenrodyellow: '#fafad2',\n lightgray: '#d3d3d3',\n lightgreen: '#90ee90',\n lightgrey: '#d3d3d3',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightslategrey: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n maroon2: '#7f0000',\n maroon3: '#b03060',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370db',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#db7093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n purple2: '#7f007f',\n purple3: '#a020f0',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n slategrey: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32'\n };\n\n var w3cx11_1 = w3cx11$1;\n\n var Color$s = Color_1;\n var input$5 = input$h;\n var type$c = utils.type;\n\n var w3cx11 = w3cx11_1;\n var hex2rgb = hex2rgb_1;\n var rgb2hex = rgb2hex_1;\n\n Color$s.prototype.name = function() {\n var hex = rgb2hex(this._rgb, 'rgb');\n for (var i = 0, list = Object.keys(w3cx11); i < list.length; i += 1) {\n var n = list[i];\n\n if (w3cx11[n] === hex) { return n.toLowerCase(); }\n }\n return hex;\n };\n\n input$5.format.named = function (name) {\n name = name.toLowerCase();\n if (w3cx11[name]) { return hex2rgb(w3cx11[name]); }\n throw new Error('unknown color name: '+name);\n };\n\n input$5.autodetect.push({\n p: 5,\n test: function (h) {\n var rest = [], len = arguments.length - 1;\n while ( len-- > 0 ) rest[ len ] = arguments[ len + 1 ];\n\n if (!rest.length && type$c(h) === 'string' && w3cx11[h.toLowerCase()]) {\n return 'named';\n }\n }\n });\n\n var unpack$8 = utils.unpack;\n\n var rgb2num$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$8(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n return (r << 16) + (g << 8) + b;\n };\n\n var rgb2num_1 = rgb2num$1;\n\n var type$b = utils.type;\n\n var num2rgb = function (num) {\n if (type$b(num) == \"number\" && num >= 0 && num <= 0xFFFFFF) {\n var r = num >> 16;\n var g = (num >> 8) & 0xFF;\n var b = num & 0xFF;\n return [r,g,b,1];\n }\n throw new Error(\"unknown num color: \"+num);\n };\n\n var num2rgb_1 = num2rgb;\n\n var chroma$9 = chroma_1;\n var Color$r = Color_1;\n var input$4 = input$h;\n var type$a = utils.type;\n\n var rgb2num = rgb2num_1;\n\n Color$r.prototype.num = function() {\n return rgb2num(this._rgb);\n };\n\n chroma$9.num = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$r, [ null ].concat( args, ['num']) ));\n };\n\n input$4.format.num = num2rgb_1;\n\n input$4.autodetect.push({\n p: 5,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n if (args.length === 1 && type$a(args[0]) === 'number' && args[0] >= 0 && args[0] <= 0xFFFFFF) {\n return 'num';\n }\n }\n });\n\n var chroma$8 = chroma_1;\n var Color$q = Color_1;\n var input$3 = input$h;\n var unpack$7 = utils.unpack;\n var type$9 = utils.type;\n var round$1 = Math.round;\n\n Color$q.prototype.rgb = function(rnd) {\n if ( rnd === void 0 ) rnd=true;\n\n if (rnd === false) { return this._rgb.slice(0,3); }\n return this._rgb.slice(0,3).map(round$1);\n };\n\n Color$q.prototype.rgba = function(rnd) {\n if ( rnd === void 0 ) rnd=true;\n\n return this._rgb.slice(0,4).map(function (v,i) {\n return i<3 ? (rnd === false ? v : round$1(v)) : v;\n });\n };\n\n chroma$8.rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$q, [ null ].concat( args, ['rgb']) ));\n };\n\n input$3.format.rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var rgba = unpack$7(args, 'rgba');\n if (rgba[3] === undefined) { rgba[3] = 1; }\n return rgba;\n };\n\n input$3.autodetect.push({\n p: 3,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$7(args, 'rgba');\n if (type$9(args) === 'array' && (args.length === 3 ||\n args.length === 4 && type$9(args[3]) == 'number' && args[3] >= 0 && args[3] <= 1)) {\n return 'rgb';\n }\n }\n });\n\n /*\n * Based on implementation by Neil Bartlett\n * https://github.com/neilbartlett/color-temperature\n */\n\n var log$1 = Math.log;\n\n var temperature2rgb$1 = function (kelvin) {\n var temp = kelvin / 100;\n var r,g,b;\n if (temp < 66) {\n r = 255;\n g = temp < 6 ? 0 : -155.25485562709179 - 0.44596950469579133 * (g = temp-2) + 104.49216199393888 * log$1(g);\n b = temp < 20 ? 0 : -254.76935184120902 + 0.8274096064007395 * (b = temp-10) + 115.67994401066147 * log$1(b);\n } else {\n r = 351.97690566805693 + 0.114206453784165 * (r = temp-55) - 40.25366309332127 * log$1(r);\n g = 325.4494125711974 + 0.07943456536662342 * (g = temp-50) - 28.0852963507957 * log$1(g);\n b = 255;\n }\n return [r,g,b,1];\n };\n\n var temperature2rgb_1 = temperature2rgb$1;\n\n /*\n * Based on implementation by Neil Bartlett\n * https://github.com/neilbartlett/color-temperature\n **/\n\n var temperature2rgb = temperature2rgb_1;\n var unpack$6 = utils.unpack;\n var round = Math.round;\n\n var rgb2temperature$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var rgb = unpack$6(args, 'rgb');\n var r = rgb[0], b = rgb[2];\n var minTemp = 1000;\n var maxTemp = 40000;\n var eps = 0.4;\n var temp;\n while (maxTemp - minTemp > eps) {\n temp = (maxTemp + minTemp) * 0.5;\n var rgb$1 = temperature2rgb(temp);\n if ((rgb$1[2] / rgb$1[0]) >= (b / r)) {\n maxTemp = temp;\n } else {\n minTemp = temp;\n }\n }\n return round(temp);\n };\n\n var rgb2temperature_1 = rgb2temperature$1;\n\n var chroma$7 = chroma_1;\n var Color$p = Color_1;\n var input$2 = input$h;\n\n var rgb2temperature = rgb2temperature_1;\n\n Color$p.prototype.temp =\n Color$p.prototype.kelvin =\n Color$p.prototype.temperature = function() {\n return rgb2temperature(this._rgb);\n };\n\n chroma$7.temp =\n chroma$7.kelvin =\n chroma$7.temperature = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$p, [ null ].concat( args, ['temp']) ));\n };\n\n input$2.format.temp =\n input$2.format.kelvin =\n input$2.format.temperature = temperature2rgb_1;\n\n var unpack$5 = utils.unpack;\n var cbrt = Math.cbrt;\n var pow$8 = Math.pow;\n var sign$1 = Math.sign;\n\n var rgb2oklab$2 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n // OKLab color space implementation taken from\n // https://bottosson.github.io/posts/oklab/\n var ref = unpack$5(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var ref$1 = [rgb2lrgb(r / 255), rgb2lrgb(g / 255), rgb2lrgb(b / 255)];\n var lr = ref$1[0];\n var lg = ref$1[1];\n var lb = ref$1[2];\n var l = cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);\n var m = cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);\n var s = cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);\n\n return [\n 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,\n 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,\n 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s\n ];\n };\n\n var rgb2oklab_1 = rgb2oklab$2;\n\n function rgb2lrgb(c) {\n var abs = Math.abs(c);\n if (abs < 0.04045) {\n return c / 12.92;\n }\n return (sign$1(c) || 1) * pow$8((abs + 0.055) / 1.055, 2.4);\n }\n\n var unpack$4 = utils.unpack;\n var pow$7 = Math.pow;\n var sign = Math.sign;\n\n /*\n * L* [0..100]\n * a [-100..100]\n * b [-100..100]\n */\n var oklab2rgb$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$4(args, 'lab');\n var L = args[0];\n var a = args[1];\n var b = args[2];\n\n var l = pow$7(L + 0.3963377774 * a + 0.2158037573 * b, 3);\n var m = pow$7(L - 0.1055613458 * a - 0.0638541728 * b, 3);\n var s = pow$7(L - 0.0894841775 * a - 1.291485548 * b, 3);\n\n return [\n 255 * lrgb2rgb(+4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s),\n 255 * lrgb2rgb(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s),\n 255 * lrgb2rgb(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s),\n args.length > 3 ? args[3] : 1\n ];\n };\n\n var oklab2rgb_1 = oklab2rgb$1;\n\n function lrgb2rgb(c) {\n var abs = Math.abs(c);\n if (abs > 0.0031308) {\n return (sign(c) || 1) * (1.055 * pow$7(abs, 1 / 2.4) - 0.055);\n }\n return c * 12.92;\n }\n\n var unpack$3 = utils.unpack;\n var type$8 = utils.type;\n var chroma$6 = chroma_1;\n var Color$o = Color_1;\n var input$1 = input$h;\n\n var rgb2oklab$1 = rgb2oklab_1;\n\n Color$o.prototype.oklab = function () {\n return rgb2oklab$1(this._rgb);\n };\n\n chroma$6.oklab = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$o, [ null ].concat( args, ['oklab']) ));\n };\n\n input$1.format.oklab = oklab2rgb_1;\n\n input$1.autodetect.push({\n p: 3,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$3(args, 'oklab');\n if (type$8(args) === 'array' && args.length === 3) {\n return 'oklab';\n }\n }\n });\n\n var unpack$2 = utils.unpack;\n var rgb2oklab = rgb2oklab_1;\n var lab2lch = lab2lch_1;\n\n var rgb2oklch$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$2(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var ref$1 = rgb2oklab(r, g, b);\n var l = ref$1[0];\n var a = ref$1[1];\n var b_ = ref$1[2];\n return lab2lch(l, a, b_);\n };\n\n var rgb2oklch_1 = rgb2oklch$1;\n\n var unpack$1 = utils.unpack;\n var lch2lab = lch2lab_1;\n var oklab2rgb = oklab2rgb_1;\n\n var oklch2rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$1(args, 'lch');\n var l = args[0];\n var c = args[1];\n var h = args[2];\n var ref = lch2lab(l, c, h);\n var L = ref[0];\n var a = ref[1];\n var b_ = ref[2];\n var ref$1 = oklab2rgb(L, a, b_);\n var r = ref$1[0];\n var g = ref$1[1];\n var b = ref$1[2];\n return [r, g, b, args.length > 3 ? args[3] : 1];\n };\n\n var oklch2rgb_1 = oklch2rgb;\n\n var unpack = utils.unpack;\n var type$7 = utils.type;\n var chroma$5 = chroma_1;\n var Color$n = Color_1;\n var input = input$h;\n\n var rgb2oklch = rgb2oklch_1;\n\n Color$n.prototype.oklch = function () {\n return rgb2oklch(this._rgb);\n };\n\n chroma$5.oklch = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$n, [ null ].concat( args, ['oklch']) ));\n };\n\n input.format.oklch = oklch2rgb_1;\n\n input.autodetect.push({\n p: 3,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack(args, 'oklch');\n if (type$7(args) === 'array' && args.length === 3) {\n return 'oklch';\n }\n }\n });\n\n var Color$m = Color_1;\n var type$6 = utils.type;\n\n Color$m.prototype.alpha = function(a, mutate) {\n if ( mutate === void 0 ) mutate=false;\n\n if (a !== undefined && type$6(a) === 'number') {\n if (mutate) {\n this._rgb[3] = a;\n return this;\n }\n return new Color$m([this._rgb[0], this._rgb[1], this._rgb[2], a], 'rgb');\n }\n return this._rgb[3];\n };\n\n var Color$l = Color_1;\n\n Color$l.prototype.clipped = function() {\n return this._rgb._clipped || false;\n };\n\n var Color$k = Color_1;\n var LAB_CONSTANTS$1 = labConstants;\n\n Color$k.prototype.darken = function(amount) {\n \tif ( amount === void 0 ) amount=1;\n\n \tvar me = this;\n \tvar lab = me.lab();\n \tlab[0] -= LAB_CONSTANTS$1.Kn * amount;\n \treturn new Color$k(lab, 'lab').alpha(me.alpha(), true);\n };\n\n Color$k.prototype.brighten = function(amount) {\n \tif ( amount === void 0 ) amount=1;\n\n \treturn this.darken(-amount);\n };\n\n Color$k.prototype.darker = Color$k.prototype.darken;\n Color$k.prototype.brighter = Color$k.prototype.brighten;\n\n var Color$j = Color_1;\n\n Color$j.prototype.get = function (mc) {\n var ref = mc.split('.');\n var mode = ref[0];\n var channel = ref[1];\n var src = this[mode]();\n if (channel) {\n var i = mode.indexOf(channel) - (mode.substr(0, 2) === 'ok' ? 2 : 0);\n if (i > -1) { return src[i]; }\n throw new Error((\"unknown channel \" + channel + \" in mode \" + mode));\n } else {\n return src;\n }\n };\n\n var Color$i = Color_1;\n var type$5 = utils.type;\n var pow$6 = Math.pow;\n\n var EPS = 1e-7;\n var MAX_ITER = 20;\n\n Color$i.prototype.luminance = function(lum) {\n if (lum !== undefined && type$5(lum) === 'number') {\n if (lum === 0) {\n // return pure black\n return new Color$i([0,0,0,this._rgb[3]], 'rgb');\n }\n if (lum === 1) {\n // return pure white\n return new Color$i([255,255,255,this._rgb[3]], 'rgb');\n }\n // compute new color using...\n var cur_lum = this.luminance();\n var mode = 'rgb';\n var max_iter = MAX_ITER;\n\n var test = function (low, high) {\n var mid = low.interpolate(high, 0.5, mode);\n var lm = mid.luminance();\n if (Math.abs(lum - lm) < EPS || !max_iter--) {\n // close enough\n return mid;\n }\n return lm > lum ? test(low, mid) : test(mid, high);\n };\n\n var rgb = (cur_lum > lum ? test(new Color$i([0,0,0]), this) : test(this, new Color$i([255,255,255]))).rgb();\n return new Color$i(rgb.concat( [this._rgb[3]]));\n }\n return rgb2luminance.apply(void 0, (this._rgb).slice(0,3));\n };\n\n\n var rgb2luminance = function (r,g,b) {\n // relative luminance\n // see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n r = luminance_x(r);\n g = luminance_x(g);\n b = luminance_x(b);\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n };\n\n var luminance_x = function (x) {\n x /= 255;\n return x <= 0.03928 ? x/12.92 : pow$6((x+0.055)/1.055, 2.4);\n };\n\n var interpolator$1 = {};\n\n var Color$h = Color_1;\n var type$4 = utils.type;\n var interpolator = interpolator$1;\n\n var mix$1 = function (col1, col2, f) {\n if ( f === void 0 ) f=0.5;\n var rest = [], len = arguments.length - 3;\n while ( len-- > 0 ) rest[ len ] = arguments[ len + 3 ];\n\n var mode = rest[0] || 'lrgb';\n if (!interpolator[mode] && !rest.length) {\n // fall back to the first supported mode\n mode = Object.keys(interpolator)[0];\n }\n if (!interpolator[mode]) {\n throw new Error((\"interpolation mode \" + mode + \" is not defined\"));\n }\n if (type$4(col1) !== 'object') { col1 = new Color$h(col1); }\n if (type$4(col2) !== 'object') { col2 = new Color$h(col2); }\n return interpolator[mode](col1, col2, f)\n .alpha(col1.alpha() + f * (col2.alpha() - col1.alpha()));\n };\n\n var Color$g = Color_1;\n var mix = mix$1;\n\n Color$g.prototype.mix =\n Color$g.prototype.interpolate = function(col2, f) {\n \tif ( f === void 0 ) f=0.5;\n \tvar rest = [], len = arguments.length - 2;\n \twhile ( len-- > 0 ) rest[ len ] = arguments[ len + 2 ];\n\n \treturn mix.apply(void 0, [ this, col2, f ].concat( rest ));\n };\n\n var Color$f = Color_1;\n\n Color$f.prototype.premultiply = function(mutate) {\n \tif ( mutate === void 0 ) mutate=false;\n\n \tvar rgb = this._rgb;\n \tvar a = rgb[3];\n \tif (mutate) {\n \t\tthis._rgb = [rgb[0]*a, rgb[1]*a, rgb[2]*a, a];\n \t\treturn this;\n \t} else {\n \t\treturn new Color$f([rgb[0]*a, rgb[1]*a, rgb[2]*a, a], 'rgb');\n \t}\n };\n\n var Color$e = Color_1;\n var LAB_CONSTANTS = labConstants;\n\n Color$e.prototype.saturate = function(amount) {\n \tif ( amount === void 0 ) amount=1;\n\n \tvar me = this;\n \tvar lch = me.lch();\n \tlch[1] += LAB_CONSTANTS.Kn * amount;\n \tif (lch[1] < 0) { lch[1] = 0; }\n \treturn new Color$e(lch, 'lch').alpha(me.alpha(), true);\n };\n\n Color$e.prototype.desaturate = function(amount) {\n \tif ( amount === void 0 ) amount=1;\n\n \treturn this.saturate(-amount);\n };\n\n var Color$d = Color_1;\n var type$3 = utils.type;\n\n Color$d.prototype.set = function (mc, value, mutate) {\n if ( mutate === void 0 ) mutate = false;\n\n var ref = mc.split('.');\n var mode = ref[0];\n var channel = ref[1];\n var src = this[mode]();\n if (channel) {\n var i = mode.indexOf(channel) - (mode.substr(0, 2) === 'ok' ? 2 : 0);\n if (i > -1) {\n if (type$3(value) == 'string') {\n switch (value.charAt(0)) {\n case '+':\n src[i] += +value;\n break;\n case '-':\n src[i] += +value;\n break;\n case '*':\n src[i] *= +value.substr(1);\n break;\n case '/':\n src[i] /= +value.substr(1);\n break;\n default:\n src[i] = +value;\n }\n } else if (type$3(value) === 'number') {\n src[i] = value;\n } else {\n throw new Error(\"unsupported value for Color.set\");\n }\n var out = new Color$d(src, mode);\n if (mutate) {\n this._rgb = out._rgb;\n return this;\n }\n return out;\n }\n throw new Error((\"unknown channel \" + channel + \" in mode \" + mode));\n } else {\n return src;\n }\n };\n\n var Color$c = Color_1;\n\n var rgb = function (col1, col2, f) {\n var xyz0 = col1._rgb;\n var xyz1 = col2._rgb;\n return new Color$c(\n xyz0[0] + f * (xyz1[0]-xyz0[0]),\n xyz0[1] + f * (xyz1[1]-xyz0[1]),\n xyz0[2] + f * (xyz1[2]-xyz0[2]),\n 'rgb'\n )\n };\n\n // register interpolator\n interpolator$1.rgb = rgb;\n\n var Color$b = Color_1;\n var sqrt$2 = Math.sqrt;\n var pow$5 = Math.pow;\n\n var lrgb = function (col1, col2, f) {\n var ref = col1._rgb;\n var x1 = ref[0];\n var y1 = ref[1];\n var z1 = ref[2];\n var ref$1 = col2._rgb;\n var x2 = ref$1[0];\n var y2 = ref$1[1];\n var z2 = ref$1[2];\n return new Color$b(\n sqrt$2(pow$5(x1,2) * (1-f) + pow$5(x2,2) * f),\n sqrt$2(pow$5(y1,2) * (1-f) + pow$5(y2,2) * f),\n sqrt$2(pow$5(z1,2) * (1-f) + pow$5(z2,2) * f),\n 'rgb'\n )\n };\n\n // register interpolator\n interpolator$1.lrgb = lrgb;\n\n var Color$a = Color_1;\n\n var lab = function (col1, col2, f) {\n var xyz0 = col1.lab();\n var xyz1 = col2.lab();\n return new Color$a(\n xyz0[0] + f * (xyz1[0]-xyz0[0]),\n xyz0[1] + f * (xyz1[1]-xyz0[1]),\n xyz0[2] + f * (xyz1[2]-xyz0[2]),\n 'lab'\n )\n };\n\n // register interpolator\n interpolator$1.lab = lab;\n\n var Color$9 = Color_1;\n\n var _hsx = function (col1, col2, f, m) {\n var assign, assign$1;\n\n var xyz0, xyz1;\n if (m === 'hsl') {\n xyz0 = col1.hsl();\n xyz1 = col2.hsl();\n } else if (m === 'hsv') {\n xyz0 = col1.hsv();\n xyz1 = col2.hsv();\n } else if (m === 'hcg') {\n xyz0 = col1.hcg();\n xyz1 = col2.hcg();\n } else if (m === 'hsi') {\n xyz0 = col1.hsi();\n xyz1 = col2.hsi();\n } else if (m === 'lch' || m === 'hcl') {\n m = 'hcl';\n xyz0 = col1.hcl();\n xyz1 = col2.hcl();\n } else if (m === 'oklch') {\n xyz0 = col1.oklch().reverse();\n xyz1 = col2.oklch().reverse();\n }\n\n var hue0, hue1, sat0, sat1, lbv0, lbv1;\n if (m.substr(0, 1) === 'h' || m === 'oklch') {\n (assign = xyz0, hue0 = assign[0], sat0 = assign[1], lbv0 = assign[2]);\n (assign$1 = xyz1, hue1 = assign$1[0], sat1 = assign$1[1], lbv1 = assign$1[2]);\n }\n\n var sat, hue, lbv, dh;\n\n if (!isNaN(hue0) && !isNaN(hue1)) {\n // both colors have hue\n if (hue1 > hue0 && hue1 - hue0 > 180) {\n dh = hue1 - (hue0 + 360);\n } else if (hue1 < hue0 && hue0 - hue1 > 180) {\n dh = hue1 + 360 - hue0;\n } else {\n dh = hue1 - hue0;\n }\n hue = hue0 + f * dh;\n } else if (!isNaN(hue0)) {\n hue = hue0;\n if ((lbv1 == 1 || lbv1 == 0) && m != 'hsv') { sat = sat0; }\n } else if (!isNaN(hue1)) {\n hue = hue1;\n if ((lbv0 == 1 || lbv0 == 0) && m != 'hsv') { sat = sat1; }\n } else {\n hue = Number.NaN;\n }\n\n if (sat === undefined) { sat = sat0 + f * (sat1 - sat0); }\n lbv = lbv0 + f * (lbv1 - lbv0);\n return m === 'oklch' ? new Color$9([lbv, sat, hue], m) : new Color$9([hue, sat, lbv], m);\n };\n\n var interpolate_hsx$5 = _hsx;\n\n var lch = function (col1, col2, f) {\n \treturn interpolate_hsx$5(col1, col2, f, 'lch');\n };\n\n // register interpolator\n interpolator$1.lch = lch;\n interpolator$1.hcl = lch;\n\n var Color$8 = Color_1;\n\n var num = function (col1, col2, f) {\n var c1 = col1.num();\n var c2 = col2.num();\n return new Color$8(c1 + f * (c2-c1), 'num')\n };\n\n // register interpolator\n interpolator$1.num = num;\n\n var interpolate_hsx$4 = _hsx;\n\n var hcg = function (col1, col2, f) {\n \treturn interpolate_hsx$4(col1, col2, f, 'hcg');\n };\n\n // register interpolator\n interpolator$1.hcg = hcg;\n\n var interpolate_hsx$3 = _hsx;\n\n var hsi = function (col1, col2, f) {\n \treturn interpolate_hsx$3(col1, col2, f, 'hsi');\n };\n\n // register interpolator\n interpolator$1.hsi = hsi;\n\n var interpolate_hsx$2 = _hsx;\n\n var hsl = function (col1, col2, f) {\n \treturn interpolate_hsx$2(col1, col2, f, 'hsl');\n };\n\n // register interpolator\n interpolator$1.hsl = hsl;\n\n var interpolate_hsx$1 = _hsx;\n\n var hsv = function (col1, col2, f) {\n \treturn interpolate_hsx$1(col1, col2, f, 'hsv');\n };\n\n // register interpolator\n interpolator$1.hsv = hsv;\n\n var Color$7 = Color_1;\n\n var oklab = function (col1, col2, f) {\n var xyz0 = col1.oklab();\n var xyz1 = col2.oklab();\n return new Color$7(\n xyz0[0] + f * (xyz1[0] - xyz0[0]),\n xyz0[1] + f * (xyz1[1] - xyz0[1]),\n xyz0[2] + f * (xyz1[2] - xyz0[2]),\n 'oklab'\n );\n };\n\n // register interpolator\n interpolator$1.oklab = oklab;\n\n var interpolate_hsx = _hsx;\n\n var oklch = function (col1, col2, f) {\n return interpolate_hsx(col1, col2, f, 'oklch');\n };\n\n // register interpolator\n interpolator$1.oklch = oklch;\n\n var Color$6 = Color_1;\n var clip_rgb$1 = utils.clip_rgb;\n var pow$4 = Math.pow;\n var sqrt$1 = Math.sqrt;\n var PI$1 = Math.PI;\n var cos$2 = Math.cos;\n var sin$2 = Math.sin;\n var atan2$1 = Math.atan2;\n\n var average = function (colors, mode, weights) {\n if ( mode === void 0 ) mode='lrgb';\n if ( weights === void 0 ) weights=null;\n\n var l = colors.length;\n if (!weights) { weights = Array.from(new Array(l)).map(function () { return 1; }); }\n // normalize weights\n var k = l / weights.reduce(function(a, b) { return a + b; });\n weights.forEach(function (w,i) { weights[i] *= k; });\n // convert colors to Color objects\n colors = colors.map(function (c) { return new Color$6(c); });\n if (mode === 'lrgb') {\n return _average_lrgb(colors, weights)\n }\n var first = colors.shift();\n var xyz = first.get(mode);\n var cnt = [];\n var dx = 0;\n var dy = 0;\n // initial color\n for (var i=0; i= 360) { A$1 -= 360; }\n xyz[i$1] = A$1;\n } else {\n xyz[i$1] = xyz[i$1]/cnt[i$1];\n }\n }\n alpha /= l;\n return (new Color$6(xyz, mode)).alpha(alpha > 0.99999 ? 1 : alpha, true);\n };\n\n\n var _average_lrgb = function (colors, weights) {\n var l = colors.length;\n var xyz = [0,0,0,0];\n for (var i=0; i < colors.length; i++) {\n var col = colors[i];\n var f = weights[i] / l;\n var rgb = col._rgb;\n xyz[0] += pow$4(rgb[0],2) * f;\n xyz[1] += pow$4(rgb[1],2) * f;\n xyz[2] += pow$4(rgb[2],2) * f;\n xyz[3] += rgb[3] * f;\n }\n xyz[0] = sqrt$1(xyz[0]);\n xyz[1] = sqrt$1(xyz[1]);\n xyz[2] = sqrt$1(xyz[2]);\n if (xyz[3] > 0.9999999) { xyz[3] = 1; }\n return new Color$6(clip_rgb$1(xyz));\n };\n\n // minimal multi-purpose interface\n\n // @requires utils color analyze\n\n var chroma$4 = chroma_1;\n var type$2 = utils.type;\n\n var pow$3 = Math.pow;\n\n var scale$2 = function(colors) {\n\n // constructor\n var _mode = 'rgb';\n var _nacol = chroma$4('#ccc');\n var _spread = 0;\n // const _fixed = false;\n var _domain = [0, 1];\n var _pos = [];\n var _padding = [0,0];\n var _classes = false;\n var _colors = [];\n var _out = false;\n var _min = 0;\n var _max = 1;\n var _correctLightness = false;\n var _colorCache = {};\n var _useCache = true;\n var _gamma = 1;\n\n // private methods\n\n var setColors = function(colors) {\n colors = colors || ['#fff', '#000'];\n if (colors && type$2(colors) === 'string' && chroma$4.brewer &&\n chroma$4.brewer[colors.toLowerCase()]) {\n colors = chroma$4.brewer[colors.toLowerCase()];\n }\n if (type$2(colors) === 'array') {\n // handle single color\n if (colors.length === 1) {\n colors = [colors[0], colors[0]];\n }\n // make a copy of the colors\n colors = colors.slice(0);\n // convert to chroma classes\n for (var c=0; c= _classes[i]) {\n i++;\n }\n return i-1;\n }\n return 0;\n };\n\n var tMapLightness = function (t) { return t; };\n var tMapDomain = function (t) { return t; };\n\n // const classifyValue = function(value) {\n // let val = value;\n // if (_classes.length > 2) {\n // const n = _classes.length-1;\n // const i = getClass(value);\n // const minc = _classes[0] + ((_classes[1]-_classes[0]) * (0 + (_spread * 0.5))); // center of 1st class\n // const maxc = _classes[n-1] + ((_classes[n]-_classes[n-1]) * (1 - (_spread * 0.5))); // center of last class\n // val = _min + ((((_classes[i] + ((_classes[i+1] - _classes[i]) * 0.5)) - minc) / (maxc-minc)) * (_max - _min));\n // }\n // return val;\n // };\n\n var getColor = function(val, bypassMap) {\n var col, t;\n if (bypassMap == null) { bypassMap = false; }\n if (isNaN(val) || (val === null)) { return _nacol; }\n if (!bypassMap) {\n if (_classes && (_classes.length > 2)) {\n // find the class\n var c = getClass(val);\n t = c / (_classes.length-2);\n } else if (_max !== _min) {\n // just interpolate between min/max\n t = (val - _min) / (_max - _min);\n } else {\n t = 1;\n }\n } else {\n t = val;\n }\n\n // domain map\n t = tMapDomain(t);\n\n if (!bypassMap) {\n t = tMapLightness(t); // lightness correction\n }\n\n if (_gamma !== 1) { t = pow$3(t, _gamma); }\n\n t = _padding[0] + (t * (1 - _padding[0] - _padding[1]));\n\n t = Math.min(1, Math.max(0, t));\n\n var k = Math.floor(t * 10000);\n\n if (_useCache && _colorCache[k]) {\n col = _colorCache[k];\n } else {\n if (type$2(_colors) === 'array') {\n //for i in [0.._pos.length-1]\n for (var i=0; i<_pos.length; i++) {\n var p = _pos[i];\n if (t <= p) {\n col = _colors[i];\n break;\n }\n if ((t >= p) && (i === (_pos.length-1))) {\n col = _colors[i];\n break;\n }\n if (t > p && t < _pos[i+1]) {\n t = (t-p)/(_pos[i+1]-p);\n col = chroma$4.interpolate(_colors[i], _colors[i+1], t, _mode);\n break;\n }\n }\n } else if (type$2(_colors) === 'function') {\n col = _colors(t);\n }\n if (_useCache) { _colorCache[k] = col; }\n }\n return col;\n };\n\n var resetCache = function () { return _colorCache = {}; };\n\n setColors(colors);\n\n // public interface\n\n var f = function(v) {\n var c = chroma$4(getColor(v));\n if (_out && c[_out]) { return c[_out](); } else { return c; }\n };\n\n f.classes = function(classes) {\n if (classes != null) {\n if (type$2(classes) === 'array') {\n _classes = classes;\n _domain = [classes[0], classes[classes.length-1]];\n } else {\n var d = chroma$4.analyze(_domain);\n if (classes === 0) {\n _classes = [d.min, d.max];\n } else {\n _classes = chroma$4.limits(d, 'e', classes);\n }\n }\n return f;\n }\n return _classes;\n };\n\n\n f.domain = function(domain) {\n if (!arguments.length) {\n return _domain;\n }\n _min = domain[0];\n _max = domain[domain.length-1];\n _pos = [];\n var k = _colors.length;\n if ((domain.length === k) && (_min !== _max)) {\n // update positions\n for (var i = 0, list = Array.from(domain); i < list.length; i += 1) {\n var d = list[i];\n\n _pos.push((d-_min) / (_max-_min));\n }\n } else {\n for (var c=0; c 2) {\n // set domain map\n var tOut = domain.map(function (d,i) { return i/(domain.length-1); });\n var tBreaks = domain.map(function (d) { return (d - _min) / (_max - _min); });\n if (!tBreaks.every(function (val, i) { return tOut[i] === val; })) {\n tMapDomain = function (t) {\n if (t <= 0 || t >= 1) { return t; }\n var i = 0;\n while (t >= tBreaks[i+1]) { i++; }\n var f = (t - tBreaks[i]) / (tBreaks[i+1] - tBreaks[i]);\n var out = tOut[i] + f * (tOut[i+1] - tOut[i]);\n return out;\n };\n }\n\n }\n }\n _domain = [_min, _max];\n return f;\n };\n\n f.mode = function(_m) {\n if (!arguments.length) {\n return _mode;\n }\n _mode = _m;\n resetCache();\n return f;\n };\n\n f.range = function(colors, _pos) {\n setColors(colors);\n return f;\n };\n\n f.out = function(_o) {\n _out = _o;\n return f;\n };\n\n f.spread = function(val) {\n if (!arguments.length) {\n return _spread;\n }\n _spread = val;\n return f;\n };\n\n f.correctLightness = function(v) {\n if (v == null) { v = true; }\n _correctLightness = v;\n resetCache();\n if (_correctLightness) {\n tMapLightness = function(t) {\n var L0 = getColor(0, true).lab()[0];\n var L1 = getColor(1, true).lab()[0];\n var pol = L0 > L1;\n var L_actual = getColor(t, true).lab()[0];\n var L_ideal = L0 + ((L1 - L0) * t);\n var L_diff = L_actual - L_ideal;\n var t0 = 0;\n var t1 = 1;\n var max_iter = 20;\n while ((Math.abs(L_diff) > 1e-2) && (max_iter-- > 0)) {\n (function() {\n if (pol) { L_diff *= -1; }\n if (L_diff < 0) {\n t0 = t;\n t += (t1 - t) * 0.5;\n } else {\n t1 = t;\n t += (t0 - t) * 0.5;\n }\n L_actual = getColor(t, true).lab()[0];\n return L_diff = L_actual - L_ideal;\n })();\n }\n return t;\n };\n } else {\n tMapLightness = function (t) { return t; };\n }\n return f;\n };\n\n f.padding = function(p) {\n if (p != null) {\n if (type$2(p) === 'number') {\n p = [p,p];\n }\n _padding = p;\n return f;\n } else {\n return _padding;\n }\n };\n\n f.colors = function(numColors, out) {\n // If no arguments are given, return the original colors that were provided\n if (arguments.length < 2) { out = 'hex'; }\n var result = [];\n\n if (arguments.length === 0) {\n result = _colors.slice(0);\n\n } else if (numColors === 1) {\n result = [f(0.5)];\n\n } else if (numColors > 1) {\n var dm = _domain[0];\n var dd = _domain[1] - dm;\n result = __range__(0, numColors, false).map(function (i) { return f( dm + ((i/(numColors-1)) * dd) ); });\n\n } else { // returns all colors based on the defined classes\n colors = [];\n var samples = [];\n if (_classes && (_classes.length > 2)) {\n for (var i = 1, end = _classes.length, asc = 1 <= end; asc ? i < end : i > end; asc ? i++ : i--) {\n samples.push((_classes[i-1]+_classes[i])*0.5);\n }\n } else {\n samples = _domain;\n }\n result = samples.map(function (v) { return f(v); });\n }\n\n if (chroma$4[out]) {\n result = result.map(function (c) { return c[out](); });\n }\n return result;\n };\n\n f.cache = function(c) {\n if (c != null) {\n _useCache = c;\n return f;\n } else {\n return _useCache;\n }\n };\n\n f.gamma = function(g) {\n if (g != null) {\n _gamma = g;\n return f;\n } else {\n return _gamma;\n }\n };\n\n f.nodata = function(d) {\n if (d != null) {\n _nacol = chroma$4(d);\n return f;\n } else {\n return _nacol;\n }\n };\n\n return f;\n };\n\n function __range__(left, right, inclusive) {\n var range = [];\n var ascending = left < right;\n var end = !inclusive ? right : ascending ? right + 1 : right - 1;\n for (var i = left; ascending ? i < end : i > end; ascending ? i++ : i--) {\n range.push(i);\n }\n return range;\n }\n\n //\n // interpolates between a set of colors uzing a bezier spline\n //\n\n // @requires utils lab\n var Color$5 = Color_1;\n\n var scale$1 = scale$2;\n\n // nth row of the pascal triangle\n var binom_row = function(n) {\n var row = [1, 1];\n for (var i = 1; i < n; i++) {\n var newrow = [1];\n for (var j = 1; j <= row.length; j++) {\n newrow[j] = (row[j] || 0) + row[j - 1];\n }\n row = newrow;\n }\n return row;\n };\n\n var bezier = function(colors) {\n var assign, assign$1, assign$2;\n\n var I, lab0, lab1, lab2;\n colors = colors.map(function (c) { return new Color$5(c); });\n if (colors.length === 2) {\n // linear interpolation\n (assign = colors.map(function (c) { return c.lab(); }), lab0 = assign[0], lab1 = assign[1]);\n I = function(t) {\n var lab = ([0, 1, 2].map(function (i) { return lab0[i] + (t * (lab1[i] - lab0[i])); }));\n return new Color$5(lab, 'lab');\n };\n } else if (colors.length === 3) {\n // quadratic bezier interpolation\n (assign$1 = colors.map(function (c) { return c.lab(); }), lab0 = assign$1[0], lab1 = assign$1[1], lab2 = assign$1[2]);\n I = function(t) {\n var lab = ([0, 1, 2].map(function (i) { return ((1-t)*(1-t) * lab0[i]) + (2 * (1-t) * t * lab1[i]) + (t * t * lab2[i]); }));\n return new Color$5(lab, 'lab');\n };\n } else if (colors.length === 4) {\n // cubic bezier interpolation\n var lab3;\n (assign$2 = colors.map(function (c) { return c.lab(); }), lab0 = assign$2[0], lab1 = assign$2[1], lab2 = assign$2[2], lab3 = assign$2[3]);\n I = function(t) {\n var lab = ([0, 1, 2].map(function (i) { return ((1-t)*(1-t)*(1-t) * lab0[i]) + (3 * (1-t) * (1-t) * t * lab1[i]) + (3 * (1-t) * t * t * lab2[i]) + (t*t*t * lab3[i]); }));\n return new Color$5(lab, 'lab');\n };\n } else if (colors.length >= 5) {\n // general case (degree n bezier)\n var labs, row, n;\n labs = colors.map(function (c) { return c.lab(); });\n n = colors.length - 1;\n row = binom_row(n);\n I = function (t) {\n var u = 1 - t;\n var lab = ([0, 1, 2].map(function (i) { return labs.reduce(function (sum, el, j) { return (sum + row[j] * Math.pow( u, (n - j) ) * Math.pow( t, j ) * el[i]); }, 0); }));\n return new Color$5(lab, 'lab');\n };\n } else {\n throw new RangeError(\"No point in running bezier with only one color.\")\n }\n return I;\n };\n\n var bezier_1 = function (colors) {\n var f = bezier(colors);\n f.scale = function () { return scale$1(f); };\n return f;\n };\n\n /*\n * interpolates between a set of colors uzing a bezier spline\n * blend mode formulas taken from http://www.venture-ware.com/kevin/coding/lets-learn-math-photoshop-blend-modes/\n */\n\n var chroma$3 = chroma_1;\n\n var blend = function (bottom, top, mode) {\n if (!blend[mode]) {\n throw new Error('unknown blend mode ' + mode);\n }\n return blend[mode](bottom, top);\n };\n\n var blend_f = function (f) { return function (bottom,top) {\n var c0 = chroma$3(top).rgb();\n var c1 = chroma$3(bottom).rgb();\n return chroma$3.rgb(f(c0, c1));\n }; };\n\n var each = function (f) { return function (c0, c1) {\n var out = [];\n out[0] = f(c0[0], c1[0]);\n out[1] = f(c0[1], c1[1]);\n out[2] = f(c0[2], c1[2]);\n return out;\n }; };\n\n var normal = function (a) { return a; };\n var multiply = function (a,b) { return a * b / 255; };\n var darken = function (a,b) { return a > b ? b : a; };\n var lighten = function (a,b) { return a > b ? a : b; };\n var screen = function (a,b) { return 255 * (1 - (1-a/255) * (1-b/255)); };\n var overlay = function (a,b) { return b < 128 ? 2 * a * b / 255 : 255 * (1 - 2 * (1 - a / 255 ) * ( 1 - b / 255 )); };\n var burn = function (a,b) { return 255 * (1 - (1 - b / 255) / (a/255)); };\n var dodge = function (a,b) {\n if (a === 255) { return 255; }\n a = 255 * (b / 255) / (1 - a / 255);\n return a > 255 ? 255 : a\n };\n\n // # add = (a,b) ->\n // # if (a + b > 255) then 255 else a + b\n\n blend.normal = blend_f(each(normal));\n blend.multiply = blend_f(each(multiply));\n blend.screen = blend_f(each(screen));\n blend.overlay = blend_f(each(overlay));\n blend.darken = blend_f(each(darken));\n blend.lighten = blend_f(each(lighten));\n blend.dodge = blend_f(each(dodge));\n blend.burn = blend_f(each(burn));\n // blend.add = blend_f(each(add));\n\n var blend_1 = blend;\n\n // cubehelix interpolation\n // based on D.A. Green \"A colour scheme for the display of astronomical intensity images\"\n // http://astron-soc.in/bulletin/11June/289392011.pdf\n\n var type$1 = utils.type;\n var clip_rgb = utils.clip_rgb;\n var TWOPI = utils.TWOPI;\n var pow$2 = Math.pow;\n var sin$1 = Math.sin;\n var cos$1 = Math.cos;\n var chroma$2 = chroma_1;\n\n var cubehelix = function(start, rotations, hue, gamma, lightness) {\n if ( start === void 0 ) start=300;\n if ( rotations === void 0 ) rotations=-1.5;\n if ( hue === void 0 ) hue=1;\n if ( gamma === void 0 ) gamma=1;\n if ( lightness === void 0 ) lightness=[0,1];\n\n var dh = 0, dl;\n if (type$1(lightness) === 'array') {\n dl = lightness[1] - lightness[0];\n } else {\n dl = 0;\n lightness = [lightness, lightness];\n }\n\n var f = function(fract) {\n var a = TWOPI * (((start+120)/360) + (rotations * fract));\n var l = pow$2(lightness[0] + (dl * fract), gamma);\n var h = dh !== 0 ? hue[0] + (fract * dh) : hue;\n var amp = (h * l * (1-l)) / 2;\n var cos_a = cos$1(a);\n var sin_a = sin$1(a);\n var r = l + (amp * ((-0.14861 * cos_a) + (1.78277* sin_a)));\n var g = l + (amp * ((-0.29227 * cos_a) - (0.90649* sin_a)));\n var b = l + (amp * (+1.97294 * cos_a));\n return chroma$2(clip_rgb([r*255,g*255,b*255,1]));\n };\n\n f.start = function(s) {\n if ((s == null)) { return start; }\n start = s;\n return f;\n };\n\n f.rotations = function(r) {\n if ((r == null)) { return rotations; }\n rotations = r;\n return f;\n };\n\n f.gamma = function(g) {\n if ((g == null)) { return gamma; }\n gamma = g;\n return f;\n };\n\n f.hue = function(h) {\n if ((h == null)) { return hue; }\n hue = h;\n if (type$1(hue) === 'array') {\n dh = hue[1] - hue[0];\n if (dh === 0) { hue = hue[1]; }\n } else {\n dh = 0;\n }\n return f;\n };\n\n f.lightness = function(h) {\n if ((h == null)) { return lightness; }\n if (type$1(h) === 'array') {\n lightness = h;\n dl = h[1] - h[0];\n } else {\n lightness = [h,h];\n dl = 0;\n }\n return f;\n };\n\n f.scale = function () { return chroma$2.scale(f); };\n\n f.hue(hue);\n\n return f;\n };\n\n var Color$4 = Color_1;\n var digits = '0123456789abcdef';\n\n var floor$1 = Math.floor;\n var random = Math.random;\n\n var random_1 = function () {\n var code = '#';\n for (var i=0; i<6; i++) {\n code += digits.charAt(floor$1(random() * 16));\n }\n return new Color$4(code, 'hex');\n };\n\n var type = type$p;\n var log = Math.log;\n var pow$1 = Math.pow;\n var floor = Math.floor;\n var abs$1 = Math.abs;\n\n\n var analyze = function (data, key) {\n if ( key === void 0 ) key=null;\n\n var r = {\n min: Number.MAX_VALUE,\n max: Number.MAX_VALUE*-1,\n sum: 0,\n values: [],\n count: 0\n };\n if (type(data) === 'object') {\n data = Object.values(data);\n }\n data.forEach(function (val) {\n if (key && type(val) === 'object') { val = val[key]; }\n if (val !== undefined && val !== null && !isNaN(val)) {\n r.values.push(val);\n r.sum += val;\n if (val < r.min) { r.min = val; }\n if (val > r.max) { r.max = val; }\n r.count += 1;\n }\n });\n\n r.domain = [r.min, r.max];\n\n r.limits = function (mode, num) { return limits(r, mode, num); };\n\n return r;\n };\n\n\n var limits = function (data, mode, num) {\n if ( mode === void 0 ) mode='equal';\n if ( num === void 0 ) num=7;\n\n if (type(data) == 'array') {\n data = analyze(data);\n }\n var min = data.min;\n var max = data.max;\n var values = data.values.sort(function (a,b) { return a-b; });\n\n if (num === 1) { return [min,max]; }\n\n var limits = [];\n\n if (mode.substr(0,1) === 'c') { // continuous\n limits.push(min);\n limits.push(max);\n }\n\n if (mode.substr(0,1) === 'e') { // equal interval\n limits.push(min);\n for (var i=1; i 0');\n }\n var min_log = Math.LOG10E * log(min);\n var max_log = Math.LOG10E * log(max);\n limits.push(min);\n for (var i$1=1; i$1 pb\n var pr = p - pb;\n limits.push((values[pb]*(1-pr)) + (values[pb+1]*pr));\n }\n }\n limits.push(max);\n\n }\n\n else if (mode.substr(0,1) === 'k') { // k-means clustering\n /*\n implementation based on\n http://code.google.com/p/figue/source/browse/trunk/figue.js#336\n simplified for 1-d input values\n */\n var cluster;\n var n = values.length;\n var assignments = new Array(n);\n var clusterSizes = new Array(num);\n var repeat = true;\n var nb_iters = 0;\n var centroids = null;\n\n // get seed values\n centroids = [];\n centroids.push(min);\n for (var i$3=1; i$3 200) {\n repeat = false;\n }\n }\n\n // finished k-means clustering\n // the next part is borrowed from gabrielflor.it\n var kClusters = {};\n for (var j$5=0; j$5 l2 ? (l1 + 0.05) / (l2 + 0.05) : (l2 + 0.05) / (l1 + 0.05);\n };\n\n var Color$2 = Color_1;\n var sqrt = Math.sqrt;\n var pow = Math.pow;\n var min = Math.min;\n var max = Math.max;\n var atan2 = Math.atan2;\n var abs = Math.abs;\n var cos = Math.cos;\n var sin = Math.sin;\n var exp = Math.exp;\n var PI = Math.PI;\n\n var deltaE = function(a, b, Kl, Kc, Kh) {\n if ( Kl === void 0 ) Kl=1;\n if ( Kc === void 0 ) Kc=1;\n if ( Kh === void 0 ) Kh=1;\n\n // Delta E (CIE 2000)\n // see http://www.brucelindbloom.com/index.html?Eqn_DeltaE_CIE2000.html\n var rad2deg = function(rad) {\n return 360 * rad / (2 * PI);\n };\n var deg2rad = function(deg) {\n return (2 * PI * deg) / 360;\n };\n a = new Color$2(a);\n b = new Color$2(b);\n var ref = Array.from(a.lab());\n var L1 = ref[0];\n var a1 = ref[1];\n var b1 = ref[2];\n var ref$1 = Array.from(b.lab());\n var L2 = ref$1[0];\n var a2 = ref$1[1];\n var b2 = ref$1[2];\n var avgL = (L1 + L2)/2;\n var C1 = sqrt(pow(a1, 2) + pow(b1, 2));\n var C2 = sqrt(pow(a2, 2) + pow(b2, 2));\n var avgC = (C1 + C2)/2;\n var G = 0.5*(1-sqrt(pow(avgC, 7)/(pow(avgC, 7) + pow(25, 7))));\n var a1p = a1*(1+G);\n var a2p = a2*(1+G);\n var C1p = sqrt(pow(a1p, 2) + pow(b1, 2));\n var C2p = sqrt(pow(a2p, 2) + pow(b2, 2));\n var avgCp = (C1p + C2p)/2;\n var arctan1 = rad2deg(atan2(b1, a1p));\n var arctan2 = rad2deg(atan2(b2, a2p));\n var h1p = arctan1 >= 0 ? arctan1 : arctan1 + 360;\n var h2p = arctan2 >= 0 ? arctan2 : arctan2 + 360;\n var avgHp = abs(h1p - h2p) > 180 ? (h1p + h2p + 360)/2 : (h1p + h2p)/2;\n var T = 1 - 0.17*cos(deg2rad(avgHp - 30)) + 0.24*cos(deg2rad(2*avgHp)) + 0.32*cos(deg2rad(3*avgHp + 6)) - 0.2*cos(deg2rad(4*avgHp - 63));\n var deltaHp = h2p - h1p;\n deltaHp = abs(deltaHp) <= 180 ? deltaHp : h2p <= h1p ? deltaHp + 360 : deltaHp - 360;\n deltaHp = 2*sqrt(C1p*C2p)*sin(deg2rad(deltaHp)/2);\n var deltaL = L2 - L1;\n var deltaCp = C2p - C1p; \n var sl = 1 + (0.015*pow(avgL - 50, 2))/sqrt(20 + pow(avgL - 50, 2));\n var sc = 1 + 0.045*avgCp;\n var sh = 1 + 0.015*avgCp*T;\n var deltaTheta = 30*exp(-pow((avgHp - 275)/25, 2));\n var Rc = 2*sqrt(pow(avgCp, 7)/(pow(avgCp, 7) + pow(25, 7)));\n var Rt = -Rc*sin(2*deg2rad(deltaTheta));\n var result = sqrt(pow(deltaL/(Kl*sl), 2) + pow(deltaCp/(Kc*sc), 2) + pow(deltaHp/(Kh*sh), 2) + Rt*(deltaCp/(Kc*sc))*(deltaHp/(Kh*sh)));\n return max(0, min(100, result));\n };\n\n var Color$1 = Color_1;\n\n // simple Euclidean distance\n var distance = function(a, b, mode) {\n if ( mode === void 0 ) mode='lab';\n\n // Delta E (CIE 1976)\n // see http://www.brucelindbloom.com/index.html?Equations.html\n a = new Color$1(a);\n b = new Color$1(b);\n var l1 = a.get(mode);\n var l2 = b.get(mode);\n var sum_sq = 0;\n for (var i in l1) {\n var d = (l1[i] || 0) - (l2[i] || 0);\n sum_sq += d*d;\n }\n return Math.sqrt(sum_sq);\n };\n\n var Color = Color_1;\n\n var valid = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n try {\n new (Function.prototype.bind.apply( Color, [ null ].concat( args) ));\n return true;\n } catch (e) {\n return false;\n }\n };\n\n // some pre-defined color scales:\n var chroma$1 = chroma_1;\n\n var scale = scale$2;\n\n var scales = {\n \tcool: function cool() { return scale([chroma$1.hsl(180,1,.9), chroma$1.hsl(250,.7,.4)]) },\n \thot: function hot() { return scale(['#000','#f00','#ff0','#fff']).mode('rgb') }\n };\n\n /**\n ColorBrewer colors for chroma.js\n\n Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The\n Pennsylvania State University.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software distributed\n under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n CONDITIONS OF ANY KIND, either express or implied. See the License for the\n specific language governing permissions and limitations under the License.\n */\n\n var colorbrewer = {\n // sequential\n OrRd: ['#fff7ec', '#fee8c8', '#fdd49e', '#fdbb84', '#fc8d59', '#ef6548', '#d7301f', '#b30000', '#7f0000'],\n PuBu: ['#fff7fb', '#ece7f2', '#d0d1e6', '#a6bddb', '#74a9cf', '#3690c0', '#0570b0', '#045a8d', '#023858'],\n BuPu: ['#f7fcfd', '#e0ecf4', '#bfd3e6', '#9ebcda', '#8c96c6', '#8c6bb1', '#88419d', '#810f7c', '#4d004b'],\n Oranges: ['#fff5eb', '#fee6ce', '#fdd0a2', '#fdae6b', '#fd8d3c', '#f16913', '#d94801', '#a63603', '#7f2704'],\n BuGn: ['#f7fcfd', '#e5f5f9', '#ccece6', '#99d8c9', '#66c2a4', '#41ae76', '#238b45', '#006d2c', '#00441b'],\n YlOrBr: ['#ffffe5', '#fff7bc', '#fee391', '#fec44f', '#fe9929', '#ec7014', '#cc4c02', '#993404', '#662506'],\n YlGn: ['#ffffe5', '#f7fcb9', '#d9f0a3', '#addd8e', '#78c679', '#41ab5d', '#238443', '#006837', '#004529'],\n Reds: ['#fff5f0', '#fee0d2', '#fcbba1', '#fc9272', '#fb6a4a', '#ef3b2c', '#cb181d', '#a50f15', '#67000d'],\n RdPu: ['#fff7f3', '#fde0dd', '#fcc5c0', '#fa9fb5', '#f768a1', '#dd3497', '#ae017e', '#7a0177', '#49006a'],\n Greens: ['#f7fcf5', '#e5f5e0', '#c7e9c0', '#a1d99b', '#74c476', '#41ab5d', '#238b45', '#006d2c', '#00441b'],\n YlGnBu: ['#ffffd9', '#edf8b1', '#c7e9b4', '#7fcdbb', '#41b6c4', '#1d91c0', '#225ea8', '#253494', '#081d58'],\n Purples: ['#fcfbfd', '#efedf5', '#dadaeb', '#bcbddc', '#9e9ac8', '#807dba', '#6a51a3', '#54278f', '#3f007d'],\n GnBu: ['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081'],\n Greys: ['#ffffff', '#f0f0f0', '#d9d9d9', '#bdbdbd', '#969696', '#737373', '#525252', '#252525', '#000000'],\n YlOrRd: ['#ffffcc', '#ffeda0', '#fed976', '#feb24c', '#fd8d3c', '#fc4e2a', '#e31a1c', '#bd0026', '#800026'],\n PuRd: ['#f7f4f9', '#e7e1ef', '#d4b9da', '#c994c7', '#df65b0', '#e7298a', '#ce1256', '#980043', '#67001f'],\n Blues: ['#f7fbff', '#deebf7', '#c6dbef', '#9ecae1', '#6baed6', '#4292c6', '#2171b5', '#08519c', '#08306b'],\n PuBuGn: ['#fff7fb', '#ece2f0', '#d0d1e6', '#a6bddb', '#67a9cf', '#3690c0', '#02818a', '#016c59', '#014636'],\n Viridis: ['#440154', '#482777', '#3f4a8a', '#31678e', '#26838f', '#1f9d8a', '#6cce5a', '#b6de2b', '#fee825'],\n\n // diverging\n\n Spectral: ['#9e0142', '#d53e4f', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#e6f598', '#abdda4', '#66c2a5', '#3288bd', '#5e4fa2'],\n RdYlGn: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#d9ef8b', '#a6d96a', '#66bd63', '#1a9850', '#006837'],\n RdBu: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#f7f7f7', '#d1e5f0', '#92c5de', '#4393c3', '#2166ac', '#053061'],\n PiYG: ['#8e0152', '#c51b7d', '#de77ae', '#f1b6da', '#fde0ef', '#f7f7f7', '#e6f5d0', '#b8e186', '#7fbc41', '#4d9221', '#276419'],\n PRGn: ['#40004b', '#762a83', '#9970ab', '#c2a5cf', '#e7d4e8', '#f7f7f7', '#d9f0d3', '#a6dba0', '#5aae61', '#1b7837', '#00441b'],\n RdYlBu: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee090', '#ffffbf', '#e0f3f8', '#abd9e9', '#74add1', '#4575b4', '#313695'],\n BrBG: ['#543005', '#8c510a', '#bf812d', '#dfc27d', '#f6e8c3', '#f5f5f5', '#c7eae5', '#80cdc1', '#35978f', '#01665e', '#003c30'],\n RdGy: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#ffffff', '#e0e0e0', '#bababa', '#878787', '#4d4d4d', '#1a1a1a'],\n PuOr: ['#7f3b08', '#b35806', '#e08214', '#fdb863', '#fee0b6', '#f7f7f7', '#d8daeb', '#b2abd2', '#8073ac', '#542788', '#2d004b'],\n\n // qualitative\n\n Set2: ['#66c2a5', '#fc8d62', '#8da0cb', '#e78ac3', '#a6d854', '#ffd92f', '#e5c494', '#b3b3b3'],\n Accent: ['#7fc97f', '#beaed4', '#fdc086', '#ffff99', '#386cb0', '#f0027f', '#bf5b17', '#666666'],\n Set1: ['#e41a1c', '#377eb8', '#4daf4a', '#984ea3', '#ff7f00', '#ffff33', '#a65628', '#f781bf', '#999999'],\n Set3: ['#8dd3c7', '#ffffb3', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', '#fccde5', '#d9d9d9', '#bc80bd', '#ccebc5', '#ffed6f'],\n Dark2: ['#1b9e77', '#d95f02', '#7570b3', '#e7298a', '#66a61e', '#e6ab02', '#a6761d', '#666666'],\n Paired: ['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f', '#ff7f00', '#cab2d6', '#6a3d9a', '#ffff99', '#b15928'],\n Pastel2: ['#b3e2cd', '#fdcdac', '#cbd5e8', '#f4cae4', '#e6f5c9', '#fff2ae', '#f1e2cc', '#cccccc'],\n Pastel1: ['#fbb4ae', '#b3cde3', '#ccebc5', '#decbe4', '#fed9a6', '#ffffcc', '#e5d8bd', '#fddaec', '#f2f2f2'],\n };\n\n // add lowercase aliases for case-insensitive matches\n for (var i = 0, list = Object.keys(colorbrewer); i < list.length; i += 1) {\n var key = list[i];\n\n colorbrewer[key.toLowerCase()] = colorbrewer[key];\n }\n\n var colorbrewer_1 = colorbrewer;\n\n var chroma = chroma_1;\n\n // feel free to comment out anything to rollup\n // a smaller chroma.js built\n\n // io --> convert colors\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n // operators --> modify existing Colors\n\n\n\n\n\n\n\n\n\n\n // interpolators\n\n\n\n\n\n\n\n\n\n\n\n\n // generators -- > create new colors\n chroma.average = average;\n chroma.bezier = bezier_1;\n chroma.blend = blend_1;\n chroma.cubehelix = cubehelix;\n chroma.mix = chroma.interpolate = mix$1;\n chroma.random = random_1;\n chroma.scale = scale$2;\n\n // other utility methods\n chroma.analyze = analyze_1.analyze;\n chroma.contrast = contrast;\n chroma.deltaE = deltaE;\n chroma.distance = distance;\n chroma.limits = analyze_1.limits;\n chroma.valid = valid;\n\n // scale\n chroma.scales = scales;\n\n // colors\n chroma.colors = w3cx11_1;\n chroma.brewer = colorbrewer_1;\n\n var chroma_js = chroma;\n\n return chroma_js;\n\n}));\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/chroma-js/chroma.js?"); + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/defineProperty.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _defineProperty)\n/* harmony export */ });\n/* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ \"./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js\");\n\nfunction _defineProperty(obj, key, value) {\n key = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(key);\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 return obj;\n}\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@babel/runtime/helpers/esm/defineProperty.js?"); + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/toPrimitive.js": +/*!****************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***! + \****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ toPrimitive)\n/* harmony export */ });\n/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ \"./node_modules/@babel/runtime/helpers/esm/typeof.js\");\n\nfunction toPrimitive(t, r) {\n if (\"object\" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@babel/runtime/helpers/esm/toPrimitive.js?"); + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js": +/*!******************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***! + \******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ toPropertyKey)\n/* harmony export */ });\n/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ \"./node_modules/@babel/runtime/helpers/esm/typeof.js\");\n/* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ \"./node_modules/@babel/runtime/helpers/esm/toPrimitive.js\");\n\n\nfunction toPropertyKey(t) {\n var i = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(t, \"string\");\n return \"symbol\" == (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(i) ? i : i + \"\";\n}\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js?"); + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/typeof.js": +/*!***********************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/typeof.js ***! + \***********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _typeof)\n/* harmony export */ });\nfunction _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@babel/runtime/helpers/esm/typeof.js?"); + +/***/ }), + /***/ "./node_modules/@huggingface/jinja/dist/index.js": /*!*******************************************************!*\ !*** ./node_modules/@huggingface/jinja/dist/index.js ***! @@ -260,7 +3592,7 @@ eval("/* (ignored) */\n\n//# sourceURL=webpack://qdrant-frontend/url_(ignored)?" /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Environment: () => (/* binding */ Environment),\n/* harmony export */ Interpreter: () => (/* binding */ Interpreter),\n/* harmony export */ Template: () => (/* binding */ Template),\n/* harmony export */ parse: () => (/* binding */ parse),\n/* harmony export */ tokenize: () => (/* binding */ tokenize)\n/* harmony export */ });\n// src/lexer.ts\nvar TOKEN_TYPES = Object.freeze({\n Text: \"Text\",\n // The text between Jinja statements or expressions\n NumericLiteral: \"NumericLiteral\",\n // e.g., 123\n BooleanLiteral: \"BooleanLiteral\",\n // true or false\n StringLiteral: \"StringLiteral\",\n // 'string'\n Identifier: \"Identifier\",\n // Variables, functions, etc.\n Equals: \"Equals\",\n // =\n OpenParen: \"OpenParen\",\n // (\n CloseParen: \"CloseParen\",\n // )\n OpenStatement: \"OpenStatement\",\n // {%\n CloseStatement: \"CloseStatement\",\n // %}\n OpenExpression: \"OpenExpression\",\n // {{\n CloseExpression: \"CloseExpression\",\n // }}\n OpenSquareBracket: \"OpenSquareBracket\",\n // [\n CloseSquareBracket: \"CloseSquareBracket\",\n // ]\n Comma: \"Comma\",\n // ,\n Dot: \"Dot\",\n // .\n Colon: \"Colon\",\n // :\n Pipe: \"Pipe\",\n // |\n CallOperator: \"CallOperator\",\n // ()\n AdditiveBinaryOperator: \"AdditiveBinaryOperator\",\n // + -\n MultiplicativeBinaryOperator: \"MultiplicativeBinaryOperator\",\n // * / %\n ComparisonBinaryOperator: \"ComparisonBinaryOperator\",\n // < > <= >= == !=\n UnaryOperator: \"UnaryOperator\",\n // ! - +\n // Keywords\n Set: \"Set\",\n If: \"If\",\n For: \"For\",\n In: \"In\",\n NotIn: \"NotIn\",\n Else: \"Else\",\n EndIf: \"EndIf\",\n ElseIf: \"ElseIf\",\n EndFor: \"EndFor\",\n And: \"And\",\n Or: \"Or\",\n Not: \"UnaryOperator\"\n});\nvar KEYWORDS = Object.freeze({\n set: TOKEN_TYPES.Set,\n for: TOKEN_TYPES.For,\n in: TOKEN_TYPES.In,\n if: TOKEN_TYPES.If,\n else: TOKEN_TYPES.Else,\n endif: TOKEN_TYPES.EndIf,\n elif: TOKEN_TYPES.ElseIf,\n endfor: TOKEN_TYPES.EndFor,\n and: TOKEN_TYPES.And,\n or: TOKEN_TYPES.Or,\n not: TOKEN_TYPES.Not,\n \"not in\": TOKEN_TYPES.NotIn,\n // Literals\n true: TOKEN_TYPES.BooleanLiteral,\n false: TOKEN_TYPES.BooleanLiteral\n});\nvar Token = class {\n /**\n * Constructs a new Token.\n * @param {string} value The raw value as seen inside the source code.\n * @param {TokenType} type The type of token.\n */\n constructor(value, type) {\n this.value = value;\n this.type = type;\n }\n};\nfunction isWord(char) {\n return /\\w/.test(char);\n}\nfunction isInteger(char) {\n return /[0-9]/.test(char);\n}\nvar ORDERED_MAPPING_TABLE = [\n // Control sequences\n [\"{%\", TOKEN_TYPES.OpenStatement],\n [\"%}\", TOKEN_TYPES.CloseStatement],\n [\"{{\", TOKEN_TYPES.OpenExpression],\n [\"}}\", TOKEN_TYPES.CloseExpression],\n // Single character tokens\n [\"(\", TOKEN_TYPES.OpenParen],\n [\")\", TOKEN_TYPES.CloseParen],\n [\"[\", TOKEN_TYPES.OpenSquareBracket],\n [\"]\", TOKEN_TYPES.CloseSquareBracket],\n [\",\", TOKEN_TYPES.Comma],\n [\".\", TOKEN_TYPES.Dot],\n [\":\", TOKEN_TYPES.Colon],\n [\"|\", TOKEN_TYPES.Pipe],\n // Comparison operators\n [\"<=\", TOKEN_TYPES.ComparisonBinaryOperator],\n [\">=\", TOKEN_TYPES.ComparisonBinaryOperator],\n [\"==\", TOKEN_TYPES.ComparisonBinaryOperator],\n [\"!=\", TOKEN_TYPES.ComparisonBinaryOperator],\n [\"<\", TOKEN_TYPES.ComparisonBinaryOperator],\n [\">\", TOKEN_TYPES.ComparisonBinaryOperator],\n // Arithmetic operators\n [\"+\", TOKEN_TYPES.AdditiveBinaryOperator],\n [\"-\", TOKEN_TYPES.AdditiveBinaryOperator],\n [\"*\", TOKEN_TYPES.MultiplicativeBinaryOperator],\n [\"/\", TOKEN_TYPES.MultiplicativeBinaryOperator],\n [\"%\", TOKEN_TYPES.MultiplicativeBinaryOperator],\n // Assignment operator\n [\"=\", TOKEN_TYPES.Equals]\n];\nvar ESCAPE_CHARACTERS = /* @__PURE__ */ new Map([\n [\"n\", \"\\n\"],\n // New line\n [\"t\", \"\t\"],\n // Horizontal tab\n [\"r\", \"\\r\"],\n // Carriage return\n [\"b\", \"\\b\"],\n // Backspace\n [\"f\", \"\\f\"],\n // Form feed\n [\"v\", \"\\v\"],\n // Vertical tab\n [\"'\", \"'\"],\n // Single quote\n ['\"', '\"'],\n // Double quote\n [\"\\\\\", \"\\\\\"]\n // Backslash\n]);\nfunction tokenize(source) {\n const tokens = [];\n const src = source;\n let cursorPosition = 0;\n const consumeWhile = (predicate) => {\n let str = \"\";\n while (predicate(src[cursorPosition])) {\n if (src[cursorPosition] === \"\\\\\") {\n ++cursorPosition;\n if (cursorPosition >= src.length)\n throw new SyntaxError(\"Unexpected end of input\");\n const escaped = src[cursorPosition++];\n const unescaped = ESCAPE_CHARACTERS.get(escaped);\n if (unescaped === void 0) {\n throw new SyntaxError(`Unexpected escaped character: ${escaped}`);\n }\n str += unescaped;\n continue;\n }\n str += src[cursorPosition++];\n if (cursorPosition >= src.length)\n throw new SyntaxError(\"Unexpected end of input\");\n }\n return str;\n };\n main:\n while (cursorPosition < src.length) {\n const lastTokenType = tokens.at(-1)?.type;\n if (lastTokenType === void 0 || lastTokenType === TOKEN_TYPES.CloseStatement || lastTokenType === TOKEN_TYPES.CloseExpression) {\n let text = \"\";\n while (cursorPosition < src.length && // Keep going until we hit the next Jinja statement or expression\n !(src[cursorPosition] === \"{\" && (src[cursorPosition + 1] === \"%\" || src[cursorPosition + 1] === \"{\"))) {\n text += src[cursorPosition++];\n }\n if (text.length > 0) {\n tokens.push(new Token(text, TOKEN_TYPES.Text));\n continue;\n }\n }\n consumeWhile((char2) => /\\s/.test(char2));\n const char = src[cursorPosition];\n if (char === \"-\" || char === \"+\") {\n const lastTokenType2 = tokens.at(-1)?.type;\n if (lastTokenType2 === TOKEN_TYPES.Text || lastTokenType2 === void 0) {\n throw new SyntaxError(`Unexpected character: ${char}`);\n }\n switch (lastTokenType2) {\n case TOKEN_TYPES.Identifier:\n case TOKEN_TYPES.NumericLiteral:\n case TOKEN_TYPES.BooleanLiteral:\n case TOKEN_TYPES.StringLiteral:\n case TOKEN_TYPES.CloseParen:\n case TOKEN_TYPES.CloseSquareBracket:\n break;\n default: {\n ++cursorPosition;\n const num = consumeWhile(isInteger);\n tokens.push(\n new Token(`${char}${num}`, num.length > 0 ? TOKEN_TYPES.NumericLiteral : TOKEN_TYPES.UnaryOperator)\n );\n continue;\n }\n }\n }\n for (const [char2, token] of ORDERED_MAPPING_TABLE) {\n const slice2 = src.slice(cursorPosition, cursorPosition + char2.length);\n if (slice2 === char2) {\n tokens.push(new Token(char2, token));\n cursorPosition += char2.length;\n continue main;\n }\n }\n if (char === \"'\") {\n ++cursorPosition;\n const str = consumeWhile((char2) => char2 !== \"'\");\n tokens.push(new Token(str, TOKEN_TYPES.StringLiteral));\n ++cursorPosition;\n continue;\n }\n if (isInteger(char)) {\n const num = consumeWhile(isInteger);\n tokens.push(new Token(num, TOKEN_TYPES.NumericLiteral));\n continue;\n }\n if (isWord(char)) {\n const word = consumeWhile(isWord);\n const type = Object.hasOwn(KEYWORDS, word) ? KEYWORDS[word] : TOKEN_TYPES.Identifier;\n if (type === TOKEN_TYPES.In && tokens.at(-1)?.type === TOKEN_TYPES.Not) {\n tokens.pop();\n tokens.push(new Token(\"not in\", TOKEN_TYPES.NotIn));\n } else {\n tokens.push(new Token(word, type));\n }\n continue;\n }\n throw new SyntaxError(`Unexpected character: ${char}`);\n }\n return tokens;\n}\n\n// src/ast.ts\nvar Statement = class {\n type = \"Statement\";\n};\nvar Program = class extends Statement {\n constructor(body) {\n super();\n this.body = body;\n }\n type = \"Program\";\n};\nvar If = class extends Statement {\n constructor(test, body, alternate) {\n super();\n this.test = test;\n this.body = body;\n this.alternate = alternate;\n }\n type = \"If\";\n};\nvar For = class extends Statement {\n constructor(loopvar, iterable, body) {\n super();\n this.loopvar = loopvar;\n this.iterable = iterable;\n this.body = body;\n }\n type = \"For\";\n};\nvar SetStatement = class extends Statement {\n constructor(assignee, value) {\n super();\n this.assignee = assignee;\n this.value = value;\n }\n type = \"Set\";\n};\nvar Expression = class extends Statement {\n type = \"Expression\";\n};\nvar MemberExpression = class extends Expression {\n constructor(object, property, computed) {\n super();\n this.object = object;\n this.property = property;\n this.computed = computed;\n }\n type = \"MemberExpression\";\n};\nvar CallExpression = class extends Expression {\n constructor(callee, args) {\n super();\n this.callee = callee;\n this.args = args;\n }\n type = \"CallExpression\";\n};\nvar Identifier = class extends Expression {\n /**\n * @param {string} value The name of the identifier\n */\n constructor(value) {\n super();\n this.value = value;\n }\n type = \"Identifier\";\n};\nvar Literal = class extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n type = \"Literal\";\n};\nvar NumericLiteral = class extends Literal {\n type = \"NumericLiteral\";\n};\nvar StringLiteral = class extends Literal {\n type = \"StringLiteral\";\n constructor(value) {\n super(value);\n }\n};\nvar BooleanLiteral = class extends Literal {\n type = \"BooleanLiteral\";\n};\nvar BinaryExpression = class extends Expression {\n constructor(operator, left, right) {\n super();\n this.operator = operator;\n this.left = left;\n this.right = right;\n }\n type = \"BinaryExpression\";\n};\nvar FilterExpression = class extends Expression {\n constructor(operand, filter) {\n super();\n this.operand = operand;\n this.filter = filter;\n }\n type = \"FilterExpression\";\n};\nvar UnaryExpression = class extends Expression {\n constructor(operator, argument) {\n super();\n this.operator = operator;\n this.argument = argument;\n }\n type = \"UnaryExpression\";\n};\nvar SliceExpression = class extends Expression {\n constructor(start = void 0, stop = void 0, step = void 0) {\n super();\n this.start = start;\n this.stop = stop;\n this.step = step;\n }\n type = \"SliceExpression\";\n};\n\n// src/parser.ts\nfunction parse(tokens) {\n const program = new Program([]);\n let current = 0;\n function expect(type, error) {\n const prev = tokens[current++];\n if (!prev || prev.type !== type) {\n throw new Error(`Parser Error: ${error}. ${prev.type} !== ${type}.`);\n }\n return prev;\n }\n function parseAny() {\n switch (tokens[current].type) {\n case TOKEN_TYPES.Text:\n return parseText();\n case TOKEN_TYPES.OpenStatement:\n return parseJinjaStatement();\n case TOKEN_TYPES.OpenExpression:\n return parseJinjaExpression();\n default:\n throw new SyntaxError(`Unexpected token type: ${tokens[current].type}`);\n }\n }\n function not(...types) {\n return current + types.length <= tokens.length && types.some((type, i) => type !== tokens[current + i].type);\n }\n function is(...types) {\n return current + types.length <= tokens.length && types.every((type, i) => type === tokens[current + i].type);\n }\n function parseText() {\n return new StringLiteral(expect(TOKEN_TYPES.Text, \"Expected text token\").value);\n }\n function parseJinjaStatement() {\n expect(TOKEN_TYPES.OpenStatement, \"Expected opening statement token\");\n let result;\n switch (tokens[current].type) {\n case TOKEN_TYPES.Set:\n ++current;\n result = parseSetStatement();\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n break;\n case TOKEN_TYPES.If:\n ++current;\n result = parseIfStatement();\n expect(TOKEN_TYPES.OpenStatement, \"Expected {% token\");\n expect(TOKEN_TYPES.EndIf, \"Expected endif token\");\n expect(TOKEN_TYPES.CloseStatement, \"Expected %} token\");\n break;\n case TOKEN_TYPES.For:\n ++current;\n result = parseForStatement();\n expect(TOKEN_TYPES.OpenStatement, \"Expected {% token\");\n expect(TOKEN_TYPES.EndFor, \"Expected endfor token\");\n expect(TOKEN_TYPES.CloseStatement, \"Expected %} token\");\n break;\n default:\n throw new SyntaxError(`Unknown statement type: ${tokens[current].type}`);\n }\n return result;\n }\n function parseJinjaExpression() {\n expect(TOKEN_TYPES.OpenExpression, \"Expected opening expression token\");\n const result = parseExpression();\n expect(TOKEN_TYPES.CloseExpression, \"Expected closing expression token\");\n return result;\n }\n function parseSetStatement() {\n const left = parseExpression();\n if (is(TOKEN_TYPES.Equals)) {\n ++current;\n const value = parseSetStatement();\n return new SetStatement(left, value);\n }\n return left;\n }\n function parseIfStatement() {\n const test = parseExpression();\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n const body = [];\n const alternate = [];\n while (!(tokens[current]?.type === TOKEN_TYPES.OpenStatement && (tokens[current + 1]?.type === TOKEN_TYPES.ElseIf || tokens[current + 1]?.type === TOKEN_TYPES.Else || tokens[current + 1]?.type === TOKEN_TYPES.EndIf))) {\n body.push(parseAny());\n }\n if (tokens[current]?.type === TOKEN_TYPES.OpenStatement && tokens[current + 1]?.type !== TOKEN_TYPES.EndIf) {\n ++current;\n if (is(TOKEN_TYPES.ElseIf)) {\n expect(TOKEN_TYPES.ElseIf, \"Expected elseif token\");\n alternate.push(parseIfStatement());\n } else {\n expect(TOKEN_TYPES.Else, \"Expected else token\");\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n while (!(tokens[current]?.type === TOKEN_TYPES.OpenStatement && tokens[current + 1]?.type === TOKEN_TYPES.EndIf)) {\n alternate.push(parseAny());\n }\n }\n }\n return new If(test, body, alternate);\n }\n function parseForStatement() {\n const loopVariable = parsePrimaryExpression();\n if (!(loopVariable instanceof Identifier)) {\n throw new SyntaxError(`Expected identifier for the loop variable`);\n }\n expect(TOKEN_TYPES.In, \"Expected `in` keyword following loop variable\");\n const iterable = parseExpression();\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n const body = [];\n while (not(TOKEN_TYPES.OpenStatement, TOKEN_TYPES.EndFor)) {\n body.push(parseAny());\n }\n return new For(loopVariable, iterable, body);\n }\n function parseExpression() {\n return parseLogicalOrExpression();\n }\n function parseLogicalOrExpression() {\n let left = parseLogicalAndExpression();\n while (is(TOKEN_TYPES.Or)) {\n const operator = tokens[current];\n ++current;\n const right = parseLogicalAndExpression();\n left = new BinaryExpression(operator, left, right);\n }\n return left;\n }\n function parseLogicalAndExpression() {\n let left = parseLogicalNegationExpression();\n while (is(TOKEN_TYPES.And)) {\n const operator = tokens[current];\n ++current;\n const right = parseLogicalNegationExpression();\n left = new BinaryExpression(operator, left, right);\n }\n return left;\n }\n function parseLogicalNegationExpression() {\n let right;\n while (is(TOKEN_TYPES.Not)) {\n const operator = tokens[current];\n ++current;\n const arg = parseLogicalNegationExpression();\n right = new UnaryExpression(operator, arg);\n }\n return right ?? parseComparisonExpression();\n }\n function parseComparisonExpression() {\n let left = parseAdditiveExpression();\n while (is(TOKEN_TYPES.ComparisonBinaryOperator) || is(TOKEN_TYPES.In) || is(TOKEN_TYPES.NotIn)) {\n const operator = tokens[current];\n ++current;\n const right = parseAdditiveExpression();\n left = new BinaryExpression(operator, left, right);\n }\n return left;\n }\n function parseAdditiveExpression() {\n let left = parseMultiplicativeExpression();\n while (is(TOKEN_TYPES.AdditiveBinaryOperator)) {\n const operator = tokens[current];\n ++current;\n const right = parseMultiplicativeExpression();\n left = new BinaryExpression(operator, left, right);\n }\n return left;\n }\n function parseCallMemberExpression() {\n const member = parseMemberExpression();\n if (is(TOKEN_TYPES.OpenParen)) {\n return parseCallExpression(member);\n }\n return member;\n }\n function parseCallExpression(callee) {\n let callExpression = new CallExpression(callee, parseArgs());\n if (is(TOKEN_TYPES.OpenParen)) {\n callExpression = parseCallExpression(callExpression);\n }\n return callExpression;\n }\n function parseArgs() {\n expect(TOKEN_TYPES.OpenParen, \"Expected opening parenthesis for arguments list\");\n const args = is(TOKEN_TYPES.CloseParen) ? [] : parseArgumentsList();\n expect(TOKEN_TYPES.CloseParen, \"Expected closing parenthesis for arguments list\");\n return args;\n }\n function parseArgumentsList() {\n const args = [parseExpression()];\n while (is(TOKEN_TYPES.Comma)) {\n ++current;\n args.push(parseExpression());\n }\n return args;\n }\n function parseMemberExpressionArgumentsList() {\n const slices = [];\n let isSlice = false;\n while (!is(TOKEN_TYPES.CloseSquareBracket)) {\n if (is(TOKEN_TYPES.Colon)) {\n slices.push(void 0);\n ++current;\n isSlice = true;\n } else {\n slices.push(parseExpression());\n if (is(TOKEN_TYPES.Colon)) {\n ++current;\n isSlice = true;\n }\n }\n }\n if (slices.length === 0) {\n throw new SyntaxError(`Expected at least one argument for member/slice expression`);\n }\n if (isSlice) {\n if (slices.length > 3) {\n throw new SyntaxError(`Expected 0-3 arguments for slice expression`);\n }\n return new SliceExpression(...slices);\n }\n return slices[0];\n }\n function parseMemberExpression() {\n let object = parsePrimaryExpression();\n while (is(TOKEN_TYPES.Dot) || is(TOKEN_TYPES.OpenSquareBracket)) {\n const operator = tokens[current];\n ++current;\n let property;\n const computed = operator.type !== TOKEN_TYPES.Dot;\n if (computed) {\n property = parseMemberExpressionArgumentsList();\n expect(TOKEN_TYPES.CloseSquareBracket, \"Expected closing square bracket\");\n } else {\n property = parsePrimaryExpression();\n if (property.type !== \"Identifier\") {\n throw new SyntaxError(`Expected identifier following dot operator`);\n }\n }\n object = new MemberExpression(object, property, computed);\n }\n return object;\n }\n function parseMultiplicativeExpression() {\n let left = parseFilterExpression();\n while (is(TOKEN_TYPES.MultiplicativeBinaryOperator)) {\n const operator = tokens[current];\n ++current;\n const right = parseFilterExpression();\n left = new BinaryExpression(operator, left, right);\n }\n return left;\n }\n function parseFilterExpression() {\n let operand = parseCallMemberExpression();\n while (is(TOKEN_TYPES.Pipe)) {\n ++current;\n const filter = parsePrimaryExpression();\n if (!(filter instanceof Identifier)) {\n throw new SyntaxError(`Expected identifier for the filter`);\n }\n operand = new FilterExpression(operand, filter);\n }\n return operand;\n }\n function parsePrimaryExpression() {\n const token = tokens[current];\n switch (token.type) {\n case TOKEN_TYPES.NumericLiteral:\n ++current;\n return new NumericLiteral(Number(token.value));\n case TOKEN_TYPES.StringLiteral:\n ++current;\n return new StringLiteral(token.value);\n case TOKEN_TYPES.BooleanLiteral:\n ++current;\n return new BooleanLiteral(token.value === \"true\");\n case TOKEN_TYPES.Identifier:\n ++current;\n return new Identifier(token.value);\n case TOKEN_TYPES.OpenParen: {\n ++current;\n const expression = parseExpression();\n if (tokens[current].type !== TOKEN_TYPES.CloseParen) {\n throw new SyntaxError(\"Expected closing parenthesis\");\n }\n ++current;\n return expression;\n }\n default:\n throw new SyntaxError(`Unexpected token: ${token.type}`);\n }\n }\n while (current < tokens.length) {\n program.body.push(parseAny());\n }\n return program;\n}\n\n// src/utils.ts\nfunction slice(array, start, stop, step = 1) {\n const direction = Math.sign(step);\n if (direction >= 0) {\n start = (start ??= 0) < 0 ? Math.max(array.length + start, 0) : Math.min(start, array.length);\n stop = (stop ??= array.length) < 0 ? Math.max(array.length + stop, 0) : Math.min(stop, array.length);\n } else {\n start = (start ??= array.length - 1) < 0 ? Math.max(array.length + start, -1) : Math.min(start, array.length - 1);\n stop = (stop ??= -1) < -1 ? Math.max(array.length + stop, -1) : Math.min(stop, array.length - 1);\n }\n const result = [];\n for (let i = start; direction * i < direction * stop; i += step) {\n result.push(array[i]);\n }\n return result;\n}\n\n// src/runtime.ts\nvar RuntimeValue = class {\n type = \"RuntimeValue\";\n value;\n /**\n * A collection of built-in functions for this type.\n */\n builtins = /* @__PURE__ */ new Map();\n /**\n * Creates a new RuntimeValue.\n */\n constructor(value = void 0) {\n this.value = value;\n }\n /**\n * Determines truthiness or falsiness of the runtime value.\n * This function should be overridden by subclasses if it has custom truthiness criteria.\n * @returns {BooleanValue} BooleanValue(true) if the value is truthy, BooleanValue(false) otherwise.\n */\n __bool__() {\n return new BooleanValue(!!this.value);\n }\n};\nvar NumericValue = class extends RuntimeValue {\n type = \"NumericValue\";\n};\nvar StringValue = class extends RuntimeValue {\n type = \"StringValue\";\n builtins = /* @__PURE__ */ new Map([\n [\n \"upper\",\n new FunctionValue(() => {\n return new StringValue(this.value.toUpperCase());\n })\n ],\n [\n \"lower\",\n new FunctionValue(() => {\n return new StringValue(this.value.toLowerCase());\n })\n ],\n [\n \"strip\",\n new FunctionValue(() => {\n return new StringValue(this.value.trim());\n })\n ],\n [\"length\", new NumericValue(this.value.length)]\n ]);\n};\nvar BooleanValue = class extends RuntimeValue {\n type = \"BooleanValue\";\n};\nvar ObjectValue = class extends RuntimeValue {\n type = \"ObjectValue\";\n /**\n * NOTE: necessary to override since all JavaScript arrays are considered truthy,\n * while only non-empty Python arrays are consider truthy.\n *\n * e.g.,\n * - JavaScript: {} && 5 -> 5\n * - Python: {} and 5 -> {}\n */\n __bool__() {\n return new BooleanValue(this.value.size > 0);\n }\n};\nvar ArrayValue = class extends RuntimeValue {\n type = \"ArrayValue\";\n builtins = /* @__PURE__ */ new Map([[\"length\", new NumericValue(this.value.length)]]);\n /**\n * NOTE: necessary to override since all JavaScript arrays are considered truthy,\n * while only non-empty Python arrays are consider truthy.\n *\n * e.g.,\n * - JavaScript: [] && 5 -> 5\n * - Python: [] and 5 -> []\n */\n __bool__() {\n return new BooleanValue(this.value.length > 0);\n }\n};\nvar FunctionValue = class extends RuntimeValue {\n type = \"FunctionValue\";\n};\nvar NullValue = class extends RuntimeValue {\n type = \"NullValue\";\n};\nvar UndefinedValue = class extends RuntimeValue {\n type = \"UndefinedValue\";\n};\nvar Environment = class {\n constructor(parent) {\n this.parent = parent;\n }\n /**\n * The variables declared in this environment.\n */\n variables = /* @__PURE__ */ new Map();\n /**\n * Set the value of a variable in the current environment.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n set(name, value) {\n return this.declareVariable(name, convertToRuntimeValues(value));\n }\n declareVariable(name, value) {\n if (this.variables.has(name)) {\n throw new SyntaxError(`Variable already declared: ${name}`);\n }\n this.variables.set(name, value);\n return value;\n }\n // private assignVariable(name: string, value: AnyRuntimeValue): AnyRuntimeValue {\n // \tconst env = this.resolve(name);\n // \tenv.variables.set(name, value);\n // \treturn value;\n // }\n /**\n * Declare if doesn't exist, assign otherwise.\n */\n setVariable(name, value) {\n let env;\n try {\n env = this.resolve(name);\n } catch {\n }\n (env ?? this).variables.set(name, value);\n return value;\n }\n /**\n * Resolve the environment in which the variable is declared.\n * @param {string} name The name of the variable.\n * @returns {Environment} The environment in which the variable is declared.\n */\n resolve(name) {\n if (this.variables.has(name)) {\n return this;\n }\n if (this.parent) {\n return this.parent.resolve(name);\n }\n throw new Error(`Unknown variable: ${name}`);\n }\n lookupVariable(name) {\n return this.resolve(name).variables.get(name) ?? new NullValue();\n }\n};\nvar Interpreter = class {\n global;\n constructor(env) {\n this.global = env ?? new Environment();\n }\n /**\n * Run the program.\n */\n run(program) {\n return this.evaluate(program, this.global);\n }\n /**\n * Evaulates expressions following the binary operation type.\n */\n evaluateBinaryExpression(node, environment) {\n const left = this.evaluate(node.left, environment);\n const right = this.evaluate(node.right, environment);\n switch (node.operator.value) {\n case \"==\":\n return new BooleanValue(left.value == right.value);\n case \"!=\":\n return new BooleanValue(left.value != right.value);\n case \"and\":\n return left.__bool__().value ? right : left;\n case \"or\":\n return left.__bool__().value ? left : right;\n }\n if (left instanceof UndefinedValue || right instanceof UndefinedValue) {\n throw new Error(\"Cannot perform operation on undefined values\");\n } else if (left instanceof NullValue || right instanceof NullValue) {\n throw new Error(\"Cannot perform operation on null values\");\n } else if (left instanceof NumericValue && right instanceof NumericValue) {\n switch (node.operator.value) {\n case \"+\":\n return new NumericValue(left.value + right.value);\n case \"-\":\n return new NumericValue(left.value - right.value);\n case \"*\":\n return new NumericValue(left.value * right.value);\n case \"/\":\n return new NumericValue(left.value / right.value);\n case \"%\":\n return new NumericValue(left.value % right.value);\n case \"<\":\n return new BooleanValue(left.value < right.value);\n case \">\":\n return new BooleanValue(left.value > right.value);\n case \">=\":\n return new BooleanValue(left.value >= right.value);\n case \"<=\":\n return new BooleanValue(left.value <= right.value);\n }\n } else if (right instanceof ArrayValue) {\n const member = right.value.find((x) => x.value === left.value) !== void 0;\n switch (node.operator.value) {\n case \"in\":\n return new BooleanValue(member);\n case \"not in\":\n return new BooleanValue(!member);\n }\n }\n if (left instanceof StringValue || right instanceof StringValue) {\n switch (node.operator.value) {\n case \"+\":\n return new StringValue(left.value.toString() + right.value.toString());\n }\n }\n if (left instanceof StringValue && right instanceof StringValue) {\n switch (node.operator.value) {\n case \"in\":\n return new BooleanValue(right.value.includes(left.value));\n case \"not in\":\n return new BooleanValue(!right.value.includes(left.value));\n }\n }\n throw new SyntaxError(`Unknown operator \"${node.operator.value}\" between ${left.type} and ${right.type}`);\n }\n /**\n * Evaulates expressions following the filter operation type.\n */\n evaluateFilterExpression(node, environment) {\n const operand = this.evaluate(node.operand, environment);\n if (operand instanceof ArrayValue) {\n switch (node.filter.value) {\n case \"first\":\n return operand.value[0];\n case \"last\":\n return operand.value[operand.value.length - 1];\n case \"length\":\n return new NumericValue(operand.value.length);\n case \"reverse\":\n return new ArrayValue(operand.value.reverse());\n case \"sort\":\n return new ArrayValue(\n operand.value.sort((a, b) => {\n if (a.type !== b.type) {\n throw new Error(`Cannot compare different types: ${a.type} and ${b.type}`);\n }\n switch (a.type) {\n case \"NumericValue\":\n return a.value - b.value;\n case \"StringValue\":\n return a.value.localeCompare(b.value);\n default:\n throw new Error(`Cannot compare type: ${a.type}`);\n }\n })\n );\n default:\n throw new Error(`Unknown ArrayValue filter: ${node.filter.value}`);\n }\n } else if (operand instanceof StringValue) {\n switch (node.filter.value) {\n case \"length\":\n return new NumericValue(operand.value.length);\n case \"upper\":\n return new StringValue(operand.value.toUpperCase());\n case \"lower\":\n return new StringValue(operand.value.toLowerCase());\n case \"title\":\n return new StringValue(operand.value.replace(/\\b\\w/g, (c) => c.toUpperCase()));\n case \"capitalize\":\n return new StringValue(operand.value.charAt(0).toUpperCase() + operand.value.slice(1));\n case \"trim\":\n return new StringValue(operand.value.trim());\n default:\n throw new Error(`Unknown StringValue filter: ${node.filter.value}`);\n }\n } else if (operand instanceof NumericValue) {\n switch (node.filter.value) {\n case \"abs\":\n return new NumericValue(Math.abs(operand.value));\n default:\n throw new Error(`Unknown NumericValue filter: ${node.filter.value}`);\n }\n }\n throw new Error(`Cannot apply filter \"${node.filter.value}\" to type: ${operand.type}`);\n }\n /**\n * Evaulates expressions following the unary operation type.\n */\n evaluateUnaryExpression(node, environment) {\n const argument = this.evaluate(node.argument, environment);\n switch (node.operator.value) {\n case \"not\":\n return new BooleanValue(!argument.value);\n default:\n throw new SyntaxError(`Unknown operator: ${node.operator.value}`);\n }\n }\n evalProgram(program, environment) {\n return this.evaluateBlock(program.body, environment);\n }\n evaluateBlock(statements, environment) {\n let result = \"\";\n for (const statement of statements) {\n const lastEvaluated = this.evaluate(statement, environment);\n if (lastEvaluated.type !== \"NullValue\") {\n result += lastEvaluated.value;\n }\n }\n result = result.replace(/^\\n/, \"\");\n return new StringValue(result);\n }\n evaluateIdentifier(node, environment) {\n return environment.lookupVariable(node.value);\n }\n evaluateCallExpression(expr, environment) {\n const args = expr.args.map((arg) => this.evaluate(arg, environment));\n const fn = this.evaluate(expr.callee, environment);\n if (fn.type !== \"FunctionValue\") {\n throw new Error(`Cannot call something that is not a function: got ${fn.type}`);\n }\n return fn.value(args, environment);\n }\n evaluateSliceExpression(object, expr, environment) {\n if (!(object instanceof ArrayValue || object instanceof StringValue)) {\n throw new Error(\"Slice object must be an array or string\");\n }\n const start = this.evaluate(expr.start, environment);\n const stop = this.evaluate(expr.stop, environment);\n const step = this.evaluate(expr.step, environment);\n if (!(start instanceof NumericValue || start instanceof UndefinedValue)) {\n throw new Error(\"Slice start must be numeric or undefined\");\n }\n if (!(stop instanceof NumericValue || stop instanceof UndefinedValue)) {\n throw new Error(\"Slice stop must be numeric or undefined\");\n }\n if (!(step instanceof NumericValue || step instanceof UndefinedValue)) {\n throw new Error(\"Slice step must be numeric or undefined\");\n }\n if (object instanceof ArrayValue) {\n return new ArrayValue(slice(object.value, start.value, stop.value, step.value));\n } else {\n return new StringValue(slice(Array.from(object.value), start.value, stop.value, step.value).join(\"\"));\n }\n }\n evaluateMemberExpression(expr, environment) {\n const object = this.evaluate(expr.object, environment);\n let property;\n if (expr.computed) {\n if (expr.property.type === \"SliceExpression\") {\n return this.evaluateSliceExpression(object, expr.property, environment);\n } else {\n property = this.evaluate(expr.property, environment);\n }\n } else {\n property = new StringValue(expr.property.value);\n }\n let value;\n if (object instanceof ObjectValue) {\n if (!(property instanceof StringValue)) {\n throw new Error(`Cannot access property with non-string: got ${property.type}`);\n }\n value = object.value.get(property.value) ?? object.builtins.get(property.value);\n } else if (object instanceof ArrayValue || object instanceof StringValue) {\n if (property instanceof NumericValue) {\n value = object.value.at(property.value);\n if (object instanceof StringValue) {\n value = new StringValue(object.value.at(property.value));\n }\n } else if (property instanceof StringValue) {\n value = object.builtins.get(property.value);\n } else {\n throw new Error(`Cannot access property with non-string/non-number: got ${property.type}`);\n }\n } else {\n if (!(property instanceof StringValue)) {\n throw new Error(`Cannot access property with non-string: got ${property.type}`);\n }\n value = object.builtins.get(property.value);\n }\n if (!(value instanceof RuntimeValue)) {\n throw new Error(`${object.type} has no property '${property.value}'`);\n }\n return value;\n }\n evaluateSet(node, environment) {\n if (node.assignee.type !== \"Identifier\") {\n throw new Error(`Invalid LHS inside assignment expression: ${JSON.stringify(node.assignee)}`);\n }\n const variableName = node.assignee.value;\n environment.setVariable(variableName, this.evaluate(node.value, environment));\n return new NullValue();\n }\n evaluateIf(node, environment) {\n const test = this.evaluate(node.test, environment);\n return this.evaluateBlock(test.__bool__().value ? node.body : node.alternate, environment);\n }\n evaluateFor(node, environment) {\n const scope = new Environment(environment);\n const iterable = this.evaluate(node.iterable, scope);\n if (!(iterable instanceof ArrayValue)) {\n throw new Error(`Expected iterable type in for loop: got ${iterable.type}`);\n }\n let result = \"\";\n for (let i = 0; i < iterable.value.length; ++i) {\n scope.setVariable(\n \"loop\",\n new ObjectValue(\n new Map(\n [\n [\"index\", new NumericValue(i + 1)],\n [\"index0\", new NumericValue(i)],\n [\"first\", new BooleanValue(i === 0)],\n [\"last\", new BooleanValue(i === iterable.value.length - 1)],\n [\"length\", new NumericValue(iterable.value.length)]\n ].map(([key, value]) => [key, value])\n )\n )\n );\n scope.setVariable(node.loopvar.value, iterable.value[i]);\n const evaluated = this.evaluateBlock(node.body, scope);\n result += evaluated.value;\n }\n return new StringValue(result);\n }\n evaluate(statement, environment) {\n if (statement === void 0)\n return new UndefinedValue();\n switch (statement.type) {\n case \"Program\":\n return this.evalProgram(statement, environment);\n case \"Set\":\n return this.evaluateSet(statement, environment);\n case \"If\":\n return this.evaluateIf(statement, environment);\n case \"For\":\n return this.evaluateFor(statement, environment);\n case \"NumericLiteral\":\n return new NumericValue(Number(statement.value));\n case \"StringLiteral\":\n return new StringValue(statement.value);\n case \"BooleanLiteral\":\n return new BooleanValue(statement.value);\n case \"Identifier\":\n return this.evaluateIdentifier(statement, environment);\n case \"CallExpression\":\n return this.evaluateCallExpression(statement, environment);\n case \"MemberExpression\":\n return this.evaluateMemberExpression(statement, environment);\n case \"UnaryExpression\":\n return this.evaluateUnaryExpression(statement, environment);\n case \"BinaryExpression\":\n return this.evaluateBinaryExpression(statement, environment);\n case \"FilterExpression\":\n return this.evaluateFilterExpression(statement, environment);\n default:\n throw new SyntaxError(`Unknown node type: ${statement.type}`);\n }\n }\n};\nfunction convertToRuntimeValues(input) {\n switch (typeof input) {\n case \"number\":\n return new NumericValue(input);\n case \"string\":\n return new StringValue(input);\n case \"boolean\":\n return new BooleanValue(input);\n case \"object\":\n if (input === null) {\n return new NullValue();\n } else if (Array.isArray(input)) {\n return new ArrayValue(input.map(convertToRuntimeValues));\n } else {\n return new ObjectValue(\n new Map(Object.entries(input).map(([key, value]) => [key, convertToRuntimeValues(value)]))\n );\n }\n case \"function\":\n return new FunctionValue((args, _scope) => {\n const result = input(...args.map((x) => x.value)) ?? null;\n return convertToRuntimeValues(result);\n });\n default:\n throw new Error(`Cannot convert to runtime value: ${input}`);\n }\n}\n\n// src/index.ts\nvar Template = class {\n parsed;\n /**\n * @param {string} template The template string\n */\n constructor(template) {\n template = template.replace(/%}\\s+{%/g, \"%}{%\");\n const tokens = tokenize(template);\n this.parsed = parse(tokens);\n }\n render(items) {\n const env = new Environment();\n env.set(\"false\", false);\n env.set(\"true\", true);\n env.set(\"raise_exception\", (args) => {\n throw new Error(args);\n });\n for (const [key, value] of Object.entries(items)) {\n env.set(key, value);\n }\n const interpreter = new Interpreter(env);\n const result = interpreter.run(this.parsed);\n return result.value;\n }\n};\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@huggingface/jinja/dist/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Environment: () => (/* binding */ Environment),\n/* harmony export */ Interpreter: () => (/* binding */ Interpreter),\n/* harmony export */ Template: () => (/* binding */ Template),\n/* harmony export */ parse: () => (/* binding */ parse),\n/* harmony export */ tokenize: () => (/* binding */ tokenize)\n/* harmony export */ });\n// src/lexer.ts\nvar TOKEN_TYPES = Object.freeze({\n Text: \"Text\",\n // The text between Jinja statements or expressions\n NumericLiteral: \"NumericLiteral\",\n // e.g., 123\n BooleanLiteral: \"BooleanLiteral\",\n // true or false\n StringLiteral: \"StringLiteral\",\n // 'string'\n Identifier: \"Identifier\",\n // Variables, functions, etc.\n Equals: \"Equals\",\n // =\n OpenParen: \"OpenParen\",\n // (\n CloseParen: \"CloseParen\",\n // )\n OpenStatement: \"OpenStatement\",\n // {%\n CloseStatement: \"CloseStatement\",\n // %}\n OpenExpression: \"OpenExpression\",\n // {{\n CloseExpression: \"CloseExpression\",\n // }}\n OpenSquareBracket: \"OpenSquareBracket\",\n // [\n CloseSquareBracket: \"CloseSquareBracket\",\n // ]\n OpenCurlyBracket: \"OpenCurlyBracket\",\n // {\n CloseCurlyBracket: \"CloseCurlyBracket\",\n // }\n Comma: \"Comma\",\n // ,\n Dot: \"Dot\",\n // .\n Colon: \"Colon\",\n // :\n Pipe: \"Pipe\",\n // |\n CallOperator: \"CallOperator\",\n // ()\n AdditiveBinaryOperator: \"AdditiveBinaryOperator\",\n // + -\n MultiplicativeBinaryOperator: \"MultiplicativeBinaryOperator\",\n // * / %\n ComparisonBinaryOperator: \"ComparisonBinaryOperator\",\n // < > <= >= == !=\n UnaryOperator: \"UnaryOperator\",\n // ! - +\n // Keywords\n Set: \"Set\",\n If: \"If\",\n For: \"For\",\n In: \"In\",\n Is: \"Is\",\n NotIn: \"NotIn\",\n Else: \"Else\",\n EndIf: \"EndIf\",\n ElseIf: \"ElseIf\",\n EndFor: \"EndFor\",\n And: \"And\",\n Or: \"Or\",\n Not: \"UnaryOperator\"\n});\nvar KEYWORDS = Object.freeze({\n set: TOKEN_TYPES.Set,\n for: TOKEN_TYPES.For,\n in: TOKEN_TYPES.In,\n is: TOKEN_TYPES.Is,\n if: TOKEN_TYPES.If,\n else: TOKEN_TYPES.Else,\n endif: TOKEN_TYPES.EndIf,\n elif: TOKEN_TYPES.ElseIf,\n endfor: TOKEN_TYPES.EndFor,\n and: TOKEN_TYPES.And,\n or: TOKEN_TYPES.Or,\n not: TOKEN_TYPES.Not,\n \"not in\": TOKEN_TYPES.NotIn,\n // Literals\n true: TOKEN_TYPES.BooleanLiteral,\n false: TOKEN_TYPES.BooleanLiteral\n});\nvar Token = class {\n /**\n * Constructs a new Token.\n * @param {string} value The raw value as seen inside the source code.\n * @param {TokenType} type The type of token.\n */\n constructor(value, type) {\n this.value = value;\n this.type = type;\n }\n};\nfunction isWord(char) {\n return /\\w/.test(char);\n}\nfunction isInteger(char) {\n return /[0-9]/.test(char);\n}\nvar ORDERED_MAPPING_TABLE = [\n // Control sequences\n [\"{%\", TOKEN_TYPES.OpenStatement],\n [\"%}\", TOKEN_TYPES.CloseStatement],\n [\"{{\", TOKEN_TYPES.OpenExpression],\n [\"}}\", TOKEN_TYPES.CloseExpression],\n // Single character tokens\n [\"(\", TOKEN_TYPES.OpenParen],\n [\")\", TOKEN_TYPES.CloseParen],\n [\"{\", TOKEN_TYPES.OpenCurlyBracket],\n [\"}\", TOKEN_TYPES.CloseCurlyBracket],\n [\"[\", TOKEN_TYPES.OpenSquareBracket],\n [\"]\", TOKEN_TYPES.CloseSquareBracket],\n [\",\", TOKEN_TYPES.Comma],\n [\".\", TOKEN_TYPES.Dot],\n [\":\", TOKEN_TYPES.Colon],\n [\"|\", TOKEN_TYPES.Pipe],\n // Comparison operators\n [\"<=\", TOKEN_TYPES.ComparisonBinaryOperator],\n [\">=\", TOKEN_TYPES.ComparisonBinaryOperator],\n [\"==\", TOKEN_TYPES.ComparisonBinaryOperator],\n [\"!=\", TOKEN_TYPES.ComparisonBinaryOperator],\n [\"<\", TOKEN_TYPES.ComparisonBinaryOperator],\n [\">\", TOKEN_TYPES.ComparisonBinaryOperator],\n // Arithmetic operators\n [\"+\", TOKEN_TYPES.AdditiveBinaryOperator],\n [\"-\", TOKEN_TYPES.AdditiveBinaryOperator],\n [\"*\", TOKEN_TYPES.MultiplicativeBinaryOperator],\n [\"/\", TOKEN_TYPES.MultiplicativeBinaryOperator],\n [\"%\", TOKEN_TYPES.MultiplicativeBinaryOperator],\n // Assignment operator\n [\"=\", TOKEN_TYPES.Equals]\n];\nvar ESCAPE_CHARACTERS = /* @__PURE__ */ new Map([\n [\"n\", \"\\n\"],\n // New line\n [\"t\", \"\t\"],\n // Horizontal tab\n [\"r\", \"\\r\"],\n // Carriage return\n [\"b\", \"\\b\"],\n // Backspace\n [\"f\", \"\\f\"],\n // Form feed\n [\"v\", \"\\v\"],\n // Vertical tab\n [\"'\", \"'\"],\n // Single quote\n ['\"', '\"'],\n // Double quote\n [\"\\\\\", \"\\\\\"]\n // Backslash\n]);\nfunction preprocess(template, options = {}) {\n if (template.endsWith(\"\\n\")) {\n template = template.slice(0, -1);\n }\n template = template.replace(/{#.*?#}/gs, \"{##}\");\n if (options.lstrip_blocks) {\n template = template.replace(/^[ \\t]*({[#%])/gm, \"$1\");\n }\n if (options.trim_blocks) {\n template = template.replace(/([#%]})\\n/g, \"$1\");\n }\n return template.replace(/{##}/g, \"\").replace(/-%}\\s*/g, \"%}\").replace(/\\s*{%-/g, \"{%\").replace(/-}}\\s*/g, \"}}\").replace(/\\s*{{-/g, \"{{\");\n}\nfunction tokenize(source, options = {}) {\n const tokens = [];\n const src = preprocess(source, options);\n let cursorPosition = 0;\n const consumeWhile = (predicate) => {\n let str = \"\";\n while (predicate(src[cursorPosition])) {\n if (src[cursorPosition] === \"\\\\\") {\n ++cursorPosition;\n if (cursorPosition >= src.length)\n throw new SyntaxError(\"Unexpected end of input\");\n const escaped = src[cursorPosition++];\n const unescaped = ESCAPE_CHARACTERS.get(escaped);\n if (unescaped === void 0) {\n throw new SyntaxError(`Unexpected escaped character: ${escaped}`);\n }\n str += unescaped;\n continue;\n }\n str += src[cursorPosition++];\n if (cursorPosition >= src.length)\n throw new SyntaxError(\"Unexpected end of input\");\n }\n return str;\n };\n main:\n while (cursorPosition < src.length) {\n const lastTokenType = tokens.at(-1)?.type;\n if (lastTokenType === void 0 || lastTokenType === TOKEN_TYPES.CloseStatement || lastTokenType === TOKEN_TYPES.CloseExpression) {\n let text = \"\";\n while (cursorPosition < src.length && // Keep going until we hit the next Jinja statement or expression\n !(src[cursorPosition] === \"{\" && (src[cursorPosition + 1] === \"%\" || src[cursorPosition + 1] === \"{\"))) {\n text += src[cursorPosition++];\n }\n if (text.length > 0) {\n tokens.push(new Token(text, TOKEN_TYPES.Text));\n continue;\n }\n }\n consumeWhile((char2) => /\\s/.test(char2));\n const char = src[cursorPosition];\n if (char === \"-\" || char === \"+\") {\n const lastTokenType2 = tokens.at(-1)?.type;\n if (lastTokenType2 === TOKEN_TYPES.Text || lastTokenType2 === void 0) {\n throw new SyntaxError(`Unexpected character: ${char}`);\n }\n switch (lastTokenType2) {\n case TOKEN_TYPES.Identifier:\n case TOKEN_TYPES.NumericLiteral:\n case TOKEN_TYPES.BooleanLiteral:\n case TOKEN_TYPES.StringLiteral:\n case TOKEN_TYPES.CloseParen:\n case TOKEN_TYPES.CloseSquareBracket:\n break;\n default: {\n ++cursorPosition;\n const num = consumeWhile(isInteger);\n tokens.push(\n new Token(`${char}${num}`, num.length > 0 ? TOKEN_TYPES.NumericLiteral : TOKEN_TYPES.UnaryOperator)\n );\n continue;\n }\n }\n }\n for (const [char2, token] of ORDERED_MAPPING_TABLE) {\n const slice2 = src.slice(cursorPosition, cursorPosition + char2.length);\n if (slice2 === char2) {\n tokens.push(new Token(char2, token));\n cursorPosition += char2.length;\n continue main;\n }\n }\n if (char === \"'\" || char === '\"') {\n ++cursorPosition;\n const str = consumeWhile((c) => c !== char);\n tokens.push(new Token(str, TOKEN_TYPES.StringLiteral));\n ++cursorPosition;\n continue;\n }\n if (isInteger(char)) {\n const num = consumeWhile(isInteger);\n tokens.push(new Token(num, TOKEN_TYPES.NumericLiteral));\n continue;\n }\n if (isWord(char)) {\n const word = consumeWhile(isWord);\n const type = Object.hasOwn(KEYWORDS, word) ? KEYWORDS[word] : TOKEN_TYPES.Identifier;\n if (type === TOKEN_TYPES.In && tokens.at(-1)?.type === TOKEN_TYPES.Not) {\n tokens.pop();\n tokens.push(new Token(\"not in\", TOKEN_TYPES.NotIn));\n } else {\n tokens.push(new Token(word, type));\n }\n continue;\n }\n throw new SyntaxError(`Unexpected character: ${char}`);\n }\n return tokens;\n}\n\n// src/ast.ts\nvar Statement = class {\n type = \"Statement\";\n};\nvar Program = class extends Statement {\n constructor(body) {\n super();\n this.body = body;\n }\n type = \"Program\";\n};\nvar If = class extends Statement {\n constructor(test, body, alternate) {\n super();\n this.test = test;\n this.body = body;\n this.alternate = alternate;\n }\n type = \"If\";\n};\nvar For = class extends Statement {\n constructor(loopvar, iterable, body) {\n super();\n this.loopvar = loopvar;\n this.iterable = iterable;\n this.body = body;\n }\n type = \"For\";\n};\nvar SetStatement = class extends Statement {\n constructor(assignee, value) {\n super();\n this.assignee = assignee;\n this.value = value;\n }\n type = \"Set\";\n};\nvar Expression = class extends Statement {\n type = \"Expression\";\n};\nvar MemberExpression = class extends Expression {\n constructor(object, property, computed) {\n super();\n this.object = object;\n this.property = property;\n this.computed = computed;\n }\n type = \"MemberExpression\";\n};\nvar CallExpression = class extends Expression {\n constructor(callee, args) {\n super();\n this.callee = callee;\n this.args = args;\n }\n type = \"CallExpression\";\n};\nvar Identifier = class extends Expression {\n /**\n * @param {string} value The name of the identifier\n */\n constructor(value) {\n super();\n this.value = value;\n }\n type = \"Identifier\";\n};\nvar Literal = class extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n type = \"Literal\";\n};\nvar NumericLiteral = class extends Literal {\n type = \"NumericLiteral\";\n};\nvar StringLiteral = class extends Literal {\n type = \"StringLiteral\";\n};\nvar BooleanLiteral = class extends Literal {\n type = \"BooleanLiteral\";\n};\nvar ArrayLiteral = class extends Literal {\n type = \"ArrayLiteral\";\n};\nvar TupleLiteral = class extends Literal {\n type = \"TupleLiteral\";\n};\nvar ObjectLiteral = class extends Literal {\n type = \"ObjectLiteral\";\n};\nvar BinaryExpression = class extends Expression {\n constructor(operator, left, right) {\n super();\n this.operator = operator;\n this.left = left;\n this.right = right;\n }\n type = \"BinaryExpression\";\n};\nvar FilterExpression = class extends Expression {\n constructor(operand, filter) {\n super();\n this.operand = operand;\n this.filter = filter;\n }\n type = \"FilterExpression\";\n};\nvar TestExpression = class extends Expression {\n constructor(operand, negate, test) {\n super();\n this.operand = operand;\n this.negate = negate;\n this.test = test;\n }\n type = \"TestExpression\";\n};\nvar UnaryExpression = class extends Expression {\n constructor(operator, argument) {\n super();\n this.operator = operator;\n this.argument = argument;\n }\n type = \"UnaryExpression\";\n};\nvar SliceExpression = class extends Expression {\n constructor(start = void 0, stop = void 0, step = void 0) {\n super();\n this.start = start;\n this.stop = stop;\n this.step = step;\n }\n type = \"SliceExpression\";\n};\nvar KeywordArgumentExpression = class extends Expression {\n constructor(key, value) {\n super();\n this.key = key;\n this.value = value;\n }\n type = \"KeywordArgumentExpression\";\n};\n\n// src/parser.ts\nfunction parse(tokens) {\n const program = new Program([]);\n let current = 0;\n function expect(type, error) {\n const prev = tokens[current++];\n if (!prev || prev.type !== type) {\n throw new Error(`Parser Error: ${error}. ${prev.type} !== ${type}.`);\n }\n return prev;\n }\n function parseAny() {\n switch (tokens[current].type) {\n case TOKEN_TYPES.Text:\n return parseText();\n case TOKEN_TYPES.OpenStatement:\n return parseJinjaStatement();\n case TOKEN_TYPES.OpenExpression:\n return parseJinjaExpression();\n default:\n throw new SyntaxError(`Unexpected token type: ${tokens[current].type}`);\n }\n }\n function not(...types) {\n return current + types.length <= tokens.length && types.some((type, i) => type !== tokens[current + i].type);\n }\n function is(...types) {\n return current + types.length <= tokens.length && types.every((type, i) => type === tokens[current + i].type);\n }\n function parseText() {\n return new StringLiteral(expect(TOKEN_TYPES.Text, \"Expected text token\").value);\n }\n function parseJinjaStatement() {\n expect(TOKEN_TYPES.OpenStatement, \"Expected opening statement token\");\n let result;\n switch (tokens[current].type) {\n case TOKEN_TYPES.Set:\n ++current;\n result = parseSetStatement();\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n break;\n case TOKEN_TYPES.If:\n ++current;\n result = parseIfStatement();\n expect(TOKEN_TYPES.OpenStatement, \"Expected {% token\");\n expect(TOKEN_TYPES.EndIf, \"Expected endif token\");\n expect(TOKEN_TYPES.CloseStatement, \"Expected %} token\");\n break;\n case TOKEN_TYPES.For:\n ++current;\n result = parseForStatement();\n expect(TOKEN_TYPES.OpenStatement, \"Expected {% token\");\n expect(TOKEN_TYPES.EndFor, \"Expected endfor token\");\n expect(TOKEN_TYPES.CloseStatement, \"Expected %} token\");\n break;\n default:\n throw new SyntaxError(`Unknown statement type: ${tokens[current].type}`);\n }\n return result;\n }\n function parseJinjaExpression() {\n expect(TOKEN_TYPES.OpenExpression, \"Expected opening expression token\");\n const result = parseExpression();\n expect(TOKEN_TYPES.CloseExpression, \"Expected closing expression token\");\n return result;\n }\n function parseSetStatement() {\n const left = parseExpression();\n if (is(TOKEN_TYPES.Equals)) {\n ++current;\n const value = parseSetStatement();\n return new SetStatement(left, value);\n }\n return left;\n }\n function parseIfStatement() {\n const test = parseExpression();\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n const body = [];\n const alternate = [];\n while (!(tokens[current]?.type === TOKEN_TYPES.OpenStatement && (tokens[current + 1]?.type === TOKEN_TYPES.ElseIf || tokens[current + 1]?.type === TOKEN_TYPES.Else || tokens[current + 1]?.type === TOKEN_TYPES.EndIf))) {\n body.push(parseAny());\n }\n if (tokens[current]?.type === TOKEN_TYPES.OpenStatement && tokens[current + 1]?.type !== TOKEN_TYPES.EndIf) {\n ++current;\n if (is(TOKEN_TYPES.ElseIf)) {\n expect(TOKEN_TYPES.ElseIf, \"Expected elseif token\");\n alternate.push(parseIfStatement());\n } else {\n expect(TOKEN_TYPES.Else, \"Expected else token\");\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n while (!(tokens[current]?.type === TOKEN_TYPES.OpenStatement && tokens[current + 1]?.type === TOKEN_TYPES.EndIf)) {\n alternate.push(parseAny());\n }\n }\n }\n return new If(test, body, alternate);\n }\n function parseExpressionSequence(primary = false) {\n const fn = primary ? parsePrimaryExpression : parseExpression;\n const expressions = [fn()];\n const isTuple = is(TOKEN_TYPES.Comma);\n while (isTuple) {\n ++current;\n expressions.push(fn());\n if (!is(TOKEN_TYPES.Comma)) {\n break;\n }\n }\n return isTuple ? new TupleLiteral(expressions) : expressions[0];\n }\n function parseForStatement() {\n const loopVariable = parseExpressionSequence(true);\n if (!(loopVariable instanceof Identifier || loopVariable instanceof TupleLiteral)) {\n throw new SyntaxError(`Expected identifier/tuple for the loop variable, got ${loopVariable.type} instead`);\n }\n expect(TOKEN_TYPES.In, \"Expected `in` keyword following loop variable\");\n const iterable = parseExpression();\n expect(TOKEN_TYPES.CloseStatement, \"Expected closing statement token\");\n const body = [];\n while (not(TOKEN_TYPES.OpenStatement, TOKEN_TYPES.EndFor)) {\n body.push(parseAny());\n }\n return new For(loopVariable, iterable, body);\n }\n function parseExpression() {\n return parseTernaryExpression();\n }\n function parseTernaryExpression() {\n const a = parseLogicalOrExpression();\n if (is(TOKEN_TYPES.If)) {\n ++current;\n const predicate = parseLogicalOrExpression();\n expect(TOKEN_TYPES.Else, \"Expected else token\");\n const b = parseLogicalOrExpression();\n return new If(predicate, [a], [b]);\n }\n return a;\n }\n function parseLogicalOrExpression() {\n let left = parseLogicalAndExpression();\n while (is(TOKEN_TYPES.Or)) {\n const operator = tokens[current];\n ++current;\n const right = parseLogicalAndExpression();\n left = new BinaryExpression(operator, left, right);\n }\n return left;\n }\n function parseLogicalAndExpression() {\n let left = parseLogicalNegationExpression();\n while (is(TOKEN_TYPES.And)) {\n const operator = tokens[current];\n ++current;\n const right = parseLogicalNegationExpression();\n left = new BinaryExpression(operator, left, right);\n }\n return left;\n }\n function parseLogicalNegationExpression() {\n let right;\n while (is(TOKEN_TYPES.Not)) {\n const operator = tokens[current];\n ++current;\n const arg = parseLogicalNegationExpression();\n right = new UnaryExpression(operator, arg);\n }\n return right ?? parseComparisonExpression();\n }\n function parseComparisonExpression() {\n let left = parseAdditiveExpression();\n while (is(TOKEN_TYPES.ComparisonBinaryOperator) || is(TOKEN_TYPES.In) || is(TOKEN_TYPES.NotIn)) {\n const operator = tokens[current];\n ++current;\n const right = parseAdditiveExpression();\n left = new BinaryExpression(operator, left, right);\n }\n return left;\n }\n function parseAdditiveExpression() {\n let left = parseMultiplicativeExpression();\n while (is(TOKEN_TYPES.AdditiveBinaryOperator)) {\n const operator = tokens[current];\n ++current;\n const right = parseMultiplicativeExpression();\n left = new BinaryExpression(operator, left, right);\n }\n return left;\n }\n function parseCallMemberExpression() {\n const member = parseMemberExpression();\n if (is(TOKEN_TYPES.OpenParen)) {\n return parseCallExpression(member);\n }\n return member;\n }\n function parseCallExpression(callee) {\n let callExpression = new CallExpression(callee, parseArgs());\n if (is(TOKEN_TYPES.OpenParen)) {\n callExpression = parseCallExpression(callExpression);\n }\n return callExpression;\n }\n function parseArgs() {\n expect(TOKEN_TYPES.OpenParen, \"Expected opening parenthesis for arguments list\");\n const args = parseArgumentsList();\n expect(TOKEN_TYPES.CloseParen, \"Expected closing parenthesis for arguments list\");\n return args;\n }\n function parseArgumentsList() {\n const args = [];\n while (!is(TOKEN_TYPES.CloseParen)) {\n let argument = parseExpression();\n if (is(TOKEN_TYPES.Equals)) {\n ++current;\n if (!(argument instanceof Identifier)) {\n throw new SyntaxError(`Expected identifier for keyword argument`);\n }\n const value = parseExpression();\n argument = new KeywordArgumentExpression(argument, value);\n }\n args.push(argument);\n if (is(TOKEN_TYPES.Comma)) {\n ++current;\n }\n }\n return args;\n }\n function parseMemberExpressionArgumentsList() {\n const slices = [];\n let isSlice = false;\n while (!is(TOKEN_TYPES.CloseSquareBracket)) {\n if (is(TOKEN_TYPES.Colon)) {\n slices.push(void 0);\n ++current;\n isSlice = true;\n } else {\n slices.push(parseExpression());\n if (is(TOKEN_TYPES.Colon)) {\n ++current;\n isSlice = true;\n }\n }\n }\n if (slices.length === 0) {\n throw new SyntaxError(`Expected at least one argument for member/slice expression`);\n }\n if (isSlice) {\n if (slices.length > 3) {\n throw new SyntaxError(`Expected 0-3 arguments for slice expression`);\n }\n return new SliceExpression(...slices);\n }\n return slices[0];\n }\n function parseMemberExpression() {\n let object = parsePrimaryExpression();\n while (is(TOKEN_TYPES.Dot) || is(TOKEN_TYPES.OpenSquareBracket)) {\n const operator = tokens[current];\n ++current;\n let property;\n const computed = operator.type !== TOKEN_TYPES.Dot;\n if (computed) {\n property = parseMemberExpressionArgumentsList();\n expect(TOKEN_TYPES.CloseSquareBracket, \"Expected closing square bracket\");\n } else {\n property = parsePrimaryExpression();\n if (property.type !== \"Identifier\") {\n throw new SyntaxError(`Expected identifier following dot operator`);\n }\n }\n object = new MemberExpression(object, property, computed);\n }\n return object;\n }\n function parseMultiplicativeExpression() {\n let left = parseTestExpression();\n while (is(TOKEN_TYPES.MultiplicativeBinaryOperator)) {\n const operator = tokens[current];\n ++current;\n const right = parseTestExpression();\n left = new BinaryExpression(operator, left, right);\n }\n return left;\n }\n function parseTestExpression() {\n let operand = parseFilterExpression();\n while (is(TOKEN_TYPES.Is)) {\n ++current;\n const negate = is(TOKEN_TYPES.Not);\n if (negate) {\n ++current;\n }\n let filter = parsePrimaryExpression();\n if (filter instanceof BooleanLiteral) {\n filter = new Identifier(filter.value.toString());\n }\n if (!(filter instanceof Identifier)) {\n throw new SyntaxError(`Expected identifier for the test`);\n }\n operand = new TestExpression(operand, negate, filter);\n }\n return operand;\n }\n function parseFilterExpression() {\n let operand = parseCallMemberExpression();\n while (is(TOKEN_TYPES.Pipe)) {\n ++current;\n let filter = parsePrimaryExpression();\n if (!(filter instanceof Identifier)) {\n throw new SyntaxError(`Expected identifier for the filter`);\n }\n if (is(TOKEN_TYPES.OpenParen)) {\n filter = parseCallExpression(filter);\n }\n operand = new FilterExpression(operand, filter);\n }\n return operand;\n }\n function parsePrimaryExpression() {\n const token = tokens[current];\n switch (token.type) {\n case TOKEN_TYPES.NumericLiteral:\n ++current;\n return new NumericLiteral(Number(token.value));\n case TOKEN_TYPES.StringLiteral:\n ++current;\n return new StringLiteral(token.value);\n case TOKEN_TYPES.BooleanLiteral:\n ++current;\n return new BooleanLiteral(token.value === \"true\");\n case TOKEN_TYPES.Identifier:\n ++current;\n return new Identifier(token.value);\n case TOKEN_TYPES.OpenParen: {\n ++current;\n const expression = parseExpressionSequence();\n if (tokens[current].type !== TOKEN_TYPES.CloseParen) {\n throw new SyntaxError(`Expected closing parenthesis, got ${tokens[current].type} instead`);\n }\n ++current;\n return expression;\n }\n case TOKEN_TYPES.OpenSquareBracket: {\n ++current;\n const values = [];\n while (!is(TOKEN_TYPES.CloseSquareBracket)) {\n values.push(parseExpression());\n if (is(TOKEN_TYPES.Comma)) {\n ++current;\n }\n }\n ++current;\n return new ArrayLiteral(values);\n }\n case TOKEN_TYPES.OpenCurlyBracket: {\n ++current;\n const values = /* @__PURE__ */ new Map();\n while (!is(TOKEN_TYPES.CloseCurlyBracket)) {\n const key = parseExpression();\n expect(TOKEN_TYPES.Colon, \"Expected colon between key and value in object literal\");\n const value = parseExpression();\n values.set(key, value);\n if (is(TOKEN_TYPES.Comma)) {\n ++current;\n }\n }\n ++current;\n return new ObjectLiteral(values);\n }\n default:\n throw new SyntaxError(`Unexpected token: ${token.type}`);\n }\n }\n while (current < tokens.length) {\n program.body.push(parseAny());\n }\n return program;\n}\n\n// src/utils.ts\nfunction range(start, stop, step = 1) {\n if (stop === void 0) {\n stop = start;\n start = 0;\n }\n const result = [];\n for (let i = start; i < stop; i += step) {\n result.push(i);\n }\n return result;\n}\nfunction slice(array, start, stop, step = 1) {\n const direction = Math.sign(step);\n if (direction >= 0) {\n start = (start ??= 0) < 0 ? Math.max(array.length + start, 0) : Math.min(start, array.length);\n stop = (stop ??= array.length) < 0 ? Math.max(array.length + stop, 0) : Math.min(stop, array.length);\n } else {\n start = (start ??= array.length - 1) < 0 ? Math.max(array.length + start, -1) : Math.min(start, array.length - 1);\n stop = (stop ??= -1) < -1 ? Math.max(array.length + stop, -1) : Math.min(stop, array.length - 1);\n }\n const result = [];\n for (let i = start; direction * i < direction * stop; i += step) {\n result.push(array[i]);\n }\n return result;\n}\nfunction titleCase(value) {\n return value.replace(/\\b\\w/g, (c) => c.toUpperCase());\n}\n\n// src/runtime.ts\nvar RuntimeValue = class {\n type = \"RuntimeValue\";\n value;\n /**\n * A collection of built-in functions for this type.\n */\n builtins = /* @__PURE__ */ new Map();\n /**\n * Creates a new RuntimeValue.\n */\n constructor(value = void 0) {\n this.value = value;\n }\n /**\n * Determines truthiness or falsiness of the runtime value.\n * This function should be overridden by subclasses if it has custom truthiness criteria.\n * @returns {BooleanValue} BooleanValue(true) if the value is truthy, BooleanValue(false) otherwise.\n */\n __bool__() {\n return new BooleanValue(!!this.value);\n }\n};\nvar NumericValue = class extends RuntimeValue {\n type = \"NumericValue\";\n};\nvar StringValue = class extends RuntimeValue {\n type = \"StringValue\";\n builtins = /* @__PURE__ */ new Map([\n [\n \"upper\",\n new FunctionValue(() => {\n return new StringValue(this.value.toUpperCase());\n })\n ],\n [\n \"lower\",\n new FunctionValue(() => {\n return new StringValue(this.value.toLowerCase());\n })\n ],\n [\n \"strip\",\n new FunctionValue(() => {\n return new StringValue(this.value.trim());\n })\n ],\n [\n \"title\",\n new FunctionValue(() => {\n return new StringValue(titleCase(this.value));\n })\n ],\n [\"length\", new NumericValue(this.value.length)]\n ]);\n};\nvar BooleanValue = class extends RuntimeValue {\n type = \"BooleanValue\";\n};\nvar ObjectValue = class extends RuntimeValue {\n type = \"ObjectValue\";\n /**\n * NOTE: necessary to override since all JavaScript arrays are considered truthy,\n * while only non-empty Python arrays are consider truthy.\n *\n * e.g.,\n * - JavaScript: {} && 5 -> 5\n * - Python: {} and 5 -> {}\n */\n __bool__() {\n return new BooleanValue(this.value.size > 0);\n }\n builtins = /* @__PURE__ */ new Map([\n [\n \"get\",\n new FunctionValue(([key, defaultValue]) => {\n if (!(key instanceof StringValue)) {\n throw new Error(`Object key must be a string: got ${key.type}`);\n }\n return this.value.get(key.value) ?? defaultValue ?? new NullValue();\n })\n ],\n [\n \"items\",\n new FunctionValue(() => {\n return new ArrayValue(\n Array.from(this.value.entries()).map(([key, value]) => new ArrayValue([new StringValue(key), value]))\n );\n })\n ]\n ]);\n};\nvar ArrayValue = class extends RuntimeValue {\n type = \"ArrayValue\";\n builtins = /* @__PURE__ */ new Map([[\"length\", new NumericValue(this.value.length)]]);\n /**\n * NOTE: necessary to override since all JavaScript arrays are considered truthy,\n * while only non-empty Python arrays are consider truthy.\n *\n * e.g.,\n * - JavaScript: [] && 5 -> 5\n * - Python: [] and 5 -> []\n */\n __bool__() {\n return new BooleanValue(this.value.length > 0);\n }\n};\nvar TupleValue = class extends ArrayValue {\n type = \"TupleValue\";\n};\nvar FunctionValue = class extends RuntimeValue {\n type = \"FunctionValue\";\n};\nvar NullValue = class extends RuntimeValue {\n type = \"NullValue\";\n};\nvar UndefinedValue = class extends RuntimeValue {\n type = \"UndefinedValue\";\n};\nvar Environment = class {\n constructor(parent) {\n this.parent = parent;\n }\n /**\n * The variables declared in this environment.\n */\n variables = /* @__PURE__ */ new Map([\n [\n \"namespace\",\n new FunctionValue((args) => {\n if (args.length === 0) {\n return new ObjectValue(/* @__PURE__ */ new Map());\n }\n if (args.length !== 1 || !(args[0] instanceof ObjectValue)) {\n throw new Error(\"`namespace` expects either zero arguments or a single object argument\");\n }\n return args[0];\n })\n ]\n ]);\n /**\n * The tests available in this environment.\n */\n tests = /* @__PURE__ */ new Map([\n [\"boolean\", (operand) => operand.type === \"BooleanValue\"],\n [\"callable\", (operand) => operand instanceof FunctionValue],\n [\n \"odd\",\n (operand) => {\n if (operand.type !== \"NumericValue\") {\n throw new Error(`Cannot apply test \"odd\" to type: ${operand.type}`);\n }\n return operand.value % 2 !== 0;\n }\n ],\n [\n \"even\",\n (operand) => {\n if (operand.type !== \"NumericValue\") {\n throw new Error(`Cannot apply test \"even\" to type: ${operand.type}`);\n }\n return operand.value % 2 === 0;\n }\n ],\n [\"false\", (operand) => operand.type === \"BooleanValue\" && !operand.value],\n [\"true\", (operand) => operand.type === \"BooleanValue\" && operand.value],\n [\"number\", (operand) => operand.type === \"NumericValue\"],\n [\"integer\", (operand) => operand.type === \"NumericValue\" && Number.isInteger(operand.value)],\n [\"iterable\", (operand) => operand instanceof ArrayValue || operand instanceof StringValue],\n [\n \"lower\",\n (operand) => {\n const str = operand.value;\n return operand.type === \"StringValue\" && str === str.toLowerCase();\n }\n ],\n [\n \"upper\",\n (operand) => {\n const str = operand.value;\n return operand.type === \"StringValue\" && str === str.toUpperCase();\n }\n ],\n [\"none\", (operand) => operand.type === \"NullValue\"],\n [\"defined\", (operand) => operand.type !== \"UndefinedValue\"],\n [\"undefined\", (operand) => operand.type === \"UndefinedValue\"],\n [\"equalto\", (a, b) => a.value === b.value]\n ]);\n /**\n * Set the value of a variable in the current environment.\n */\n set(name, value) {\n return this.declareVariable(name, convertToRuntimeValues(value));\n }\n declareVariable(name, value) {\n if (this.variables.has(name)) {\n throw new SyntaxError(`Variable already declared: ${name}`);\n }\n this.variables.set(name, value);\n return value;\n }\n // private assignVariable(name: string, value: AnyRuntimeValue): AnyRuntimeValue {\n // \tconst env = this.resolve(name);\n // \tenv.variables.set(name, value);\n // \treturn value;\n // }\n /**\n * Set variable in the current scope.\n * See https://jinja.palletsprojects.com/en/3.0.x/templates/#assignments for more information.\n */\n setVariable(name, value) {\n this.variables.set(name, value);\n return value;\n }\n /**\n * Resolve the environment in which the variable is declared.\n * @param {string} name The name of the variable.\n * @returns {Environment} The environment in which the variable is declared.\n */\n resolve(name) {\n if (this.variables.has(name)) {\n return this;\n }\n if (this.parent) {\n return this.parent.resolve(name);\n }\n throw new Error(`Unknown variable: ${name}`);\n }\n lookupVariable(name) {\n try {\n return this.resolve(name).variables.get(name) ?? new UndefinedValue();\n } catch {\n return new UndefinedValue();\n }\n }\n};\nvar Interpreter = class {\n global;\n constructor(env) {\n this.global = env ?? new Environment();\n }\n /**\n * Run the program.\n */\n run(program) {\n return this.evaluate(program, this.global);\n }\n /**\n * Evaluates expressions following the binary operation type.\n */\n evaluateBinaryExpression(node, environment) {\n const left = this.evaluate(node.left, environment);\n switch (node.operator.value) {\n case \"and\":\n return left.__bool__().value ? this.evaluate(node.right, environment) : left;\n case \"or\":\n return left.__bool__().value ? left : this.evaluate(node.right, environment);\n }\n const right = this.evaluate(node.right, environment);\n switch (node.operator.value) {\n case \"==\":\n return new BooleanValue(left.value == right.value);\n case \"!=\":\n return new BooleanValue(left.value != right.value);\n }\n if (left instanceof UndefinedValue || right instanceof UndefinedValue) {\n throw new Error(\"Cannot perform operation on undefined values\");\n } else if (left instanceof NullValue || right instanceof NullValue) {\n throw new Error(\"Cannot perform operation on null values\");\n } else if (left instanceof NumericValue && right instanceof NumericValue) {\n switch (node.operator.value) {\n case \"+\":\n return new NumericValue(left.value + right.value);\n case \"-\":\n return new NumericValue(left.value - right.value);\n case \"*\":\n return new NumericValue(left.value * right.value);\n case \"/\":\n return new NumericValue(left.value / right.value);\n case \"%\":\n return new NumericValue(left.value % right.value);\n case \"<\":\n return new BooleanValue(left.value < right.value);\n case \">\":\n return new BooleanValue(left.value > right.value);\n case \">=\":\n return new BooleanValue(left.value >= right.value);\n case \"<=\":\n return new BooleanValue(left.value <= right.value);\n }\n } else if (left instanceof ArrayValue && right instanceof ArrayValue) {\n switch (node.operator.value) {\n case \"+\":\n return new ArrayValue(left.value.concat(right.value));\n }\n } else if (right instanceof ArrayValue) {\n const member = right.value.find((x) => x.value === left.value) !== void 0;\n switch (node.operator.value) {\n case \"in\":\n return new BooleanValue(member);\n case \"not in\":\n return new BooleanValue(!member);\n }\n }\n if (left instanceof StringValue || right instanceof StringValue) {\n switch (node.operator.value) {\n case \"+\":\n return new StringValue(left.value.toString() + right.value.toString());\n }\n }\n if (left instanceof StringValue && right instanceof StringValue) {\n switch (node.operator.value) {\n case \"in\":\n return new BooleanValue(right.value.includes(left.value));\n case \"not in\":\n return new BooleanValue(!right.value.includes(left.value));\n }\n }\n if (left instanceof StringValue && right instanceof ObjectValue) {\n switch (node.operator.value) {\n case \"in\":\n return new BooleanValue(right.value.has(left.value));\n case \"not in\":\n return new BooleanValue(!right.value.has(left.value));\n }\n }\n throw new SyntaxError(`Unknown operator \"${node.operator.value}\" between ${left.type} and ${right.type}`);\n }\n /**\n * Evaluates expressions following the filter operation type.\n */\n evaluateFilterExpression(node, environment) {\n const operand = this.evaluate(node.operand, environment);\n if (node.filter.type === \"Identifier\") {\n const filter = node.filter;\n if (operand instanceof ArrayValue) {\n switch (filter.value) {\n case \"list\":\n return operand;\n case \"first\":\n return operand.value[0];\n case \"last\":\n return operand.value[operand.value.length - 1];\n case \"length\":\n return new NumericValue(operand.value.length);\n case \"reverse\":\n return new ArrayValue(operand.value.reverse());\n case \"sort\":\n return new ArrayValue(\n operand.value.sort((a, b) => {\n if (a.type !== b.type) {\n throw new Error(`Cannot compare different types: ${a.type} and ${b.type}`);\n }\n switch (a.type) {\n case \"NumericValue\":\n return a.value - b.value;\n case \"StringValue\":\n return a.value.localeCompare(b.value);\n default:\n throw new Error(`Cannot compare type: ${a.type}`);\n }\n })\n );\n default:\n throw new Error(`Unknown ArrayValue filter: ${filter.value}`);\n }\n } else if (operand instanceof StringValue) {\n switch (filter.value) {\n case \"length\":\n return new NumericValue(operand.value.length);\n case \"upper\":\n return new StringValue(operand.value.toUpperCase());\n case \"lower\":\n return new StringValue(operand.value.toLowerCase());\n case \"title\":\n return new StringValue(titleCase(operand.value));\n case \"capitalize\":\n return new StringValue(operand.value.charAt(0).toUpperCase() + operand.value.slice(1));\n case \"trim\":\n return new StringValue(operand.value.trim());\n default:\n throw new Error(`Unknown StringValue filter: ${filter.value}`);\n }\n } else if (operand instanceof NumericValue) {\n switch (filter.value) {\n case \"abs\":\n return new NumericValue(Math.abs(operand.value));\n default:\n throw new Error(`Unknown NumericValue filter: ${filter.value}`);\n }\n } else if (operand instanceof ObjectValue) {\n switch (filter.value) {\n case \"items\":\n return new ArrayValue(\n Array.from(operand.value.entries()).map(([key, value]) => new ArrayValue([new StringValue(key), value]))\n );\n case \"length\":\n return new NumericValue(operand.value.size);\n default:\n throw new Error(`Unknown ObjectValue filter: ${filter.value}`);\n }\n }\n throw new Error(`Cannot apply filter \"${filter.value}\" to type: ${operand.type}`);\n } else if (node.filter.type === \"CallExpression\") {\n const filter = node.filter;\n if (filter.callee.type !== \"Identifier\") {\n throw new Error(`Unknown filter: ${filter.callee.type}`);\n }\n const filterName = filter.callee.value;\n if (operand instanceof ArrayValue) {\n switch (filterName) {\n case \"selectattr\": {\n if (operand.value.some((x) => !(x instanceof ObjectValue))) {\n throw new Error(\"`selectattr` can only be applied to array of objects\");\n }\n if (filter.args.some((x) => x.type !== \"StringLiteral\")) {\n throw new Error(\"arguments of `selectattr` must be strings\");\n }\n const [attr, testName, value] = filter.args.map((x) => this.evaluate(x, environment));\n let testFunction;\n if (testName) {\n const test = environment.tests.get(testName.value);\n if (!test) {\n throw new Error(`Unknown test: ${testName.value}`);\n }\n testFunction = test;\n } else {\n testFunction = (...x) => x[0].__bool__().value;\n }\n const filtered = operand.value.filter((item) => {\n const a = item.value.get(attr.value);\n if (a) {\n return testFunction(a, value);\n }\n return false;\n });\n return new ArrayValue(filtered);\n }\n }\n throw new Error(`Unknown ArrayValue filter: ${filterName}`);\n } else {\n throw new Error(`Cannot apply filter \"${filterName}\" to type: ${operand.type}`);\n }\n }\n throw new Error(`Unknown filter: ${node.filter.type}`);\n }\n /**\n * Evaluates expressions following the test operation type.\n */\n evaluateTestExpression(node, environment) {\n const operand = this.evaluate(node.operand, environment);\n const test = environment.tests.get(node.test.value);\n if (!test) {\n throw new Error(`Unknown test: ${node.test.value}`);\n }\n const result = test(operand);\n return new BooleanValue(node.negate ? !result : result);\n }\n /**\n * Evaluates expressions following the unary operation type.\n */\n evaluateUnaryExpression(node, environment) {\n const argument = this.evaluate(node.argument, environment);\n switch (node.operator.value) {\n case \"not\":\n return new BooleanValue(!argument.value);\n default:\n throw new SyntaxError(`Unknown operator: ${node.operator.value}`);\n }\n }\n evalProgram(program, environment) {\n return this.evaluateBlock(program.body, environment);\n }\n evaluateBlock(statements, environment) {\n let result = \"\";\n for (const statement of statements) {\n const lastEvaluated = this.evaluate(statement, environment);\n if (lastEvaluated.type !== \"NullValue\" && lastEvaluated.type !== \"UndefinedValue\") {\n result += lastEvaluated.value;\n }\n }\n return new StringValue(result);\n }\n evaluateIdentifier(node, environment) {\n return environment.lookupVariable(node.value);\n }\n evaluateCallExpression(expr, environment) {\n const args = [];\n const kwargs = /* @__PURE__ */ new Map();\n for (const argument of expr.args) {\n if (argument.type === \"KeywordArgumentExpression\") {\n const kwarg = argument;\n kwargs.set(kwarg.key.value, this.evaluate(kwarg.value, environment));\n } else {\n args.push(this.evaluate(argument, environment));\n }\n }\n if (kwargs.size > 0) {\n args.push(new ObjectValue(kwargs));\n }\n const fn = this.evaluate(expr.callee, environment);\n if (fn.type !== \"FunctionValue\") {\n throw new Error(`Cannot call something that is not a function: got ${fn.type}`);\n }\n return fn.value(args, environment);\n }\n evaluateSliceExpression(object, expr, environment) {\n if (!(object instanceof ArrayValue || object instanceof StringValue)) {\n throw new Error(\"Slice object must be an array or string\");\n }\n const start = this.evaluate(expr.start, environment);\n const stop = this.evaluate(expr.stop, environment);\n const step = this.evaluate(expr.step, environment);\n if (!(start instanceof NumericValue || start instanceof UndefinedValue)) {\n throw new Error(\"Slice start must be numeric or undefined\");\n }\n if (!(stop instanceof NumericValue || stop instanceof UndefinedValue)) {\n throw new Error(\"Slice stop must be numeric or undefined\");\n }\n if (!(step instanceof NumericValue || step instanceof UndefinedValue)) {\n throw new Error(\"Slice step must be numeric or undefined\");\n }\n if (object instanceof ArrayValue) {\n return new ArrayValue(slice(object.value, start.value, stop.value, step.value));\n } else {\n return new StringValue(slice(Array.from(object.value), start.value, stop.value, step.value).join(\"\"));\n }\n }\n evaluateMemberExpression(expr, environment) {\n const object = this.evaluate(expr.object, environment);\n let property;\n if (expr.computed) {\n if (expr.property.type === \"SliceExpression\") {\n return this.evaluateSliceExpression(object, expr.property, environment);\n } else {\n property = this.evaluate(expr.property, environment);\n }\n } else {\n property = new StringValue(expr.property.value);\n }\n let value;\n if (object instanceof ObjectValue) {\n if (!(property instanceof StringValue)) {\n throw new Error(`Cannot access property with non-string: got ${property.type}`);\n }\n value = object.value.get(property.value) ?? object.builtins.get(property.value);\n } else if (object instanceof ArrayValue || object instanceof StringValue) {\n if (property instanceof NumericValue) {\n value = object.value.at(property.value);\n if (object instanceof StringValue) {\n value = new StringValue(object.value.at(property.value));\n }\n } else if (property instanceof StringValue) {\n value = object.builtins.get(property.value);\n } else {\n throw new Error(`Cannot access property with non-string/non-number: got ${property.type}`);\n }\n } else {\n if (!(property instanceof StringValue)) {\n throw new Error(`Cannot access property with non-string: got ${property.type}`);\n }\n value = object.builtins.get(property.value);\n }\n return value instanceof RuntimeValue ? value : new UndefinedValue();\n }\n evaluateSet(node, environment) {\n const rhs = this.evaluate(node.value, environment);\n if (node.assignee.type === \"Identifier\") {\n const variableName = node.assignee.value;\n environment.setVariable(variableName, rhs);\n } else if (node.assignee.type === \"MemberExpression\") {\n const member = node.assignee;\n const object = this.evaluate(member.object, environment);\n if (!(object instanceof ObjectValue)) {\n throw new Error(\"Cannot assign to member of non-object\");\n }\n if (member.property.type !== \"Identifier\") {\n throw new Error(\"Cannot assign to member with non-identifier property\");\n }\n object.value.set(member.property.value, rhs);\n } else {\n throw new Error(`Invalid LHS inside assignment expression: ${JSON.stringify(node.assignee)}`);\n }\n return new NullValue();\n }\n evaluateIf(node, environment) {\n const test = this.evaluate(node.test, environment);\n return this.evaluateBlock(test.__bool__().value ? node.body : node.alternate, environment);\n }\n evaluateFor(node, environment) {\n const scope = new Environment(environment);\n const iterable = this.evaluate(node.iterable, scope);\n if (!(iterable instanceof ArrayValue)) {\n throw new Error(`Expected iterable type in for loop: got ${iterable.type}`);\n }\n let result = \"\";\n for (let i = 0; i < iterable.value.length; ++i) {\n const loop = /* @__PURE__ */ new Map([\n [\"index\", new NumericValue(i + 1)],\n [\"index0\", new NumericValue(i)],\n [\"revindex\", new NumericValue(iterable.value.length - i)],\n [\"revindex0\", new NumericValue(iterable.value.length - i - 1)],\n [\"first\", new BooleanValue(i === 0)],\n [\"last\", new BooleanValue(i === iterable.value.length - 1)],\n [\"length\", new NumericValue(iterable.value.length)],\n [\"previtem\", i > 0 ? iterable.value[i - 1] : new UndefinedValue()],\n [\"nextitem\", i < iterable.value.length - 1 ? iterable.value[i + 1] : new UndefinedValue()]\n ]);\n scope.setVariable(\"loop\", new ObjectValue(loop));\n const current = iterable.value[i];\n if (node.loopvar.type === \"Identifier\") {\n scope.setVariable(node.loopvar.value, current);\n } else if (node.loopvar.type === \"TupleLiteral\") {\n const loopvar = node.loopvar;\n if (current.type !== \"ArrayValue\") {\n throw new Error(`Cannot unpack non-iterable type: ${current.type}`);\n }\n const c = current;\n if (loopvar.value.length !== c.value.length) {\n throw new Error(`Too ${loopvar.value.length > c.value.length ? \"few\" : \"many\"} items to unpack`);\n }\n for (let j = 0; j < loopvar.value.length; ++j) {\n if (loopvar.value[j].type !== \"Identifier\") {\n throw new Error(`Cannot unpack non-identifier type: ${loopvar.value[j].type}`);\n }\n scope.setVariable(loopvar.value[j].value, c.value[j]);\n }\n }\n const evaluated = this.evaluateBlock(node.body, scope);\n result += evaluated.value;\n }\n return new StringValue(result);\n }\n evaluate(statement, environment) {\n if (statement === void 0)\n return new UndefinedValue();\n switch (statement.type) {\n case \"Program\":\n return this.evalProgram(statement, environment);\n case \"Set\":\n return this.evaluateSet(statement, environment);\n case \"If\":\n return this.evaluateIf(statement, environment);\n case \"For\":\n return this.evaluateFor(statement, environment);\n case \"NumericLiteral\":\n return new NumericValue(Number(statement.value));\n case \"StringLiteral\":\n return new StringValue(statement.value);\n case \"BooleanLiteral\":\n return new BooleanValue(statement.value);\n case \"ArrayLiteral\":\n return new ArrayValue(statement.value.map((x) => this.evaluate(x, environment)));\n case \"TupleLiteral\":\n return new TupleValue(statement.value.map((x) => this.evaluate(x, environment)));\n case \"ObjectLiteral\": {\n const mapping = /* @__PURE__ */ new Map();\n for (const [key, value] of statement.value) {\n const evaluatedKey = this.evaluate(key, environment);\n if (!(evaluatedKey instanceof StringValue)) {\n throw new Error(`Object keys must be strings: got ${evaluatedKey.type}`);\n }\n mapping.set(evaluatedKey.value, this.evaluate(value, environment));\n }\n return new ObjectValue(mapping);\n }\n case \"Identifier\":\n return this.evaluateIdentifier(statement, environment);\n case \"CallExpression\":\n return this.evaluateCallExpression(statement, environment);\n case \"MemberExpression\":\n return this.evaluateMemberExpression(statement, environment);\n case \"UnaryExpression\":\n return this.evaluateUnaryExpression(statement, environment);\n case \"BinaryExpression\":\n return this.evaluateBinaryExpression(statement, environment);\n case \"FilterExpression\":\n return this.evaluateFilterExpression(statement, environment);\n case \"TestExpression\":\n return this.evaluateTestExpression(statement, environment);\n default:\n throw new SyntaxError(`Unknown node type: ${statement.type}`);\n }\n }\n};\nfunction convertToRuntimeValues(input) {\n switch (typeof input) {\n case \"number\":\n return new NumericValue(input);\n case \"string\":\n return new StringValue(input);\n case \"boolean\":\n return new BooleanValue(input);\n case \"object\":\n if (input === null) {\n return new NullValue();\n } else if (Array.isArray(input)) {\n return new ArrayValue(input.map(convertToRuntimeValues));\n } else {\n return new ObjectValue(\n new Map(Object.entries(input).map(([key, value]) => [key, convertToRuntimeValues(value)]))\n );\n }\n case \"function\":\n return new FunctionValue((args, _scope) => {\n const result = input(...args.map((x) => x.value)) ?? null;\n return convertToRuntimeValues(result);\n });\n default:\n throw new Error(`Cannot convert to runtime value: ${input}`);\n }\n}\n\n// src/index.ts\nvar Template = class {\n parsed;\n /**\n * @param {string} template The template string\n */\n constructor(template) {\n const tokens = tokenize(template, {\n lstrip_blocks: true,\n trim_blocks: true\n });\n this.parsed = parse(tokens);\n }\n render(items) {\n const env = new Environment();\n env.set(\"false\", false);\n env.set(\"true\", true);\n env.set(\"raise_exception\", (args) => {\n throw new Error(args);\n });\n env.set(\"range\", range);\n for (const [key, value] of Object.entries(items)) {\n env.set(key, value);\n }\n const interpreter = new Interpreter(env);\n const result = interpreter.run(this.parsed);\n return result.value;\n }\n};\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@huggingface/jinja/dist/index.js?"); /***/ }), @@ -293,7 +3625,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ env: () => (/* binding */ env)\n/* harmony export */ });\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fs */ \"?0a9a\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ \"?73ea\");\n/* harmony import */ var url__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! url */ \"?845f\");\n/* harmony import */ var _backends_onnx_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./backends/onnx.js */ \"./node_modules/@xenova/transformers/src/backends/onnx.js\");\n/**\n * @file Module used to configure Transformers.js.\n * \n * **Example:** Disable remote models.\n * ```javascript\n * import { env } from '@xenova/transformers';\n * env.allowRemoteModels = false;\n * ```\n * \n * **Example:** Set local model path.\n * ```javascript\n * import { env } from '@xenova/transformers';\n * env.localModelPath = '/path/to/local/models/';\n * ```\n * \n * **Example:** Set cache directory.\n * ```javascript\n * import { env } from '@xenova/transformers';\n * env.cacheDir = '/path/to/cache/directory/';\n * ```\n * \n * @module env\n */\n\n\n\n\n\n\nconst { env: onnx_env } = _backends_onnx_js__WEBPACK_IMPORTED_MODULE_3__.ONNX;\n\nconst VERSION = '2.15.1';\n\n// Check if various APIs are available (depends on environment)\nconst WEB_CACHE_AVAILABLE = typeof self !== 'undefined' && 'caches' in self;\nconst FS_AVAILABLE = !isEmpty(fs__WEBPACK_IMPORTED_MODULE_0__); // check if file system is available\nconst PATH_AVAILABLE = !isEmpty(path__WEBPACK_IMPORTED_MODULE_1__); // check if path is available\n\nconst RUNNING_LOCALLY = FS_AVAILABLE && PATH_AVAILABLE;\n\nconst __dirname = RUNNING_LOCALLY\n ? path__WEBPACK_IMPORTED_MODULE_1__.dirname(path__WEBPACK_IMPORTED_MODULE_1__.dirname(url__WEBPACK_IMPORTED_MODULE_2__.fileURLToPath(\"file:///home/runner/work/qdrant-frontend/qdrant-frontend/node_modules/@xenova/transformers/src/env.js\")))\n : './';\n\n// Only used for environments with access to file system\nconst DEFAULT_CACHE_DIR = RUNNING_LOCALLY\n ? path__WEBPACK_IMPORTED_MODULE_1__.join(__dirname, '/.cache/')\n : null;\n\n// Set local model path, based on available APIs\nconst DEFAULT_LOCAL_MODEL_PATH = '/models/';\nconst localModelPath = RUNNING_LOCALLY\n ? path__WEBPACK_IMPORTED_MODULE_1__.join(__dirname, DEFAULT_LOCAL_MODEL_PATH)\n : DEFAULT_LOCAL_MODEL_PATH;\n\n// Set path to wasm files. This is needed when running in a web worker.\n// https://onnxruntime.ai/docs/api/js/interfaces/Env.WebAssemblyFlags.html#wasmPaths\n// We use remote wasm files by default to make it easier for newer users.\n// In practice, users should probably self-host the necessary .wasm files.\nonnx_env.wasm.wasmPaths = RUNNING_LOCALLY\n ? path__WEBPACK_IMPORTED_MODULE_1__.join(__dirname, '/dist/')\n : `https://cdn.jsdelivr.net/npm/@xenova/transformers@${VERSION}/dist/`;\n\n\n/**\n * Global variable used to control execution. This provides users a simple way to configure Transformers.js.\n * @property {Object} backends Expose environment variables of different backends,\n * allowing users to set these variables if they want to.\n * @property {string} __dirname Directory name of module. Useful for resolving local paths.\n * @property {string} version This version of Transformers.js.\n * @property {boolean} allowRemoteModels Whether to allow loading of remote files, defaults to `true`.\n * If set to `false`, it will have the same effect as setting `local_files_only=true` when loading pipelines, models, tokenizers, processors, etc.\n * @property {string} remoteHost Host URL to load models from. Defaults to the Hugging Face Hub.\n * @property {string} remotePathTemplate Path template to fill in and append to `remoteHost` when loading models.\n * @property {boolean} allowLocalModels Whether to allow loading of local files, defaults to `true`.\n * If set to `false`, it will skip the local file check and try to load the model from the remote host.\n * @property {string} localModelPath Path to load local models from. Defaults to `/models/`.\n * @property {boolean} useFS Whether to use the file system to load files. By default, it is `true` if available.\n * @property {boolean} useBrowserCache Whether to use Cache API to cache models. By default, it is `true` if available.\n * @property {boolean} useFSCache Whether to use the file system to cache files. By default, it is `true` if available.\n * @property {string} cacheDir The directory to use for caching files with the file system. By default, it is `./.cache`.\n * @property {boolean} useCustomCache Whether to use a custom cache system (defined by `customCache`), defaults to `false`.\n * @property {Object} customCache The custom cache to use. Defaults to `null`. Note: this must be an object which\n * implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache\n */\nconst env = {\n /////////////////// Backends settings ///////////////////\n backends: {\n // onnxruntime-web/onnxruntime-node\n onnx: onnx_env,\n\n // TensorFlow.js\n tfjs: {},\n },\n\n __dirname,\n version: VERSION,\n\n /////////////////// Model settings ///////////////////\n allowRemoteModels: true,\n remoteHost: 'https://huggingface.co/',\n remotePathTemplate: '{model}/resolve/{revision}/',\n\n allowLocalModels: true,\n localModelPath: localModelPath,\n useFS: FS_AVAILABLE,\n\n /////////////////// Cache settings ///////////////////\n useBrowserCache: WEB_CACHE_AVAILABLE,\n\n useFSCache: FS_AVAILABLE,\n cacheDir: DEFAULT_CACHE_DIR,\n\n useCustomCache: false,\n customCache: null,\n //////////////////////////////////////////////////////\n}\n\n\n/**\n * @param {Object} obj\n * @private\n */\nfunction isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/env.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ env: () => (/* binding */ env)\n/* harmony export */ });\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fs */ \"?0a9a\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ \"?73ea\");\n/* harmony import */ var url__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! url */ \"?845f\");\n/* harmony import */ var _backends_onnx_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./backends/onnx.js */ \"./node_modules/@xenova/transformers/src/backends/onnx.js\");\n/**\n * @file Module used to configure Transformers.js.\n * \n * **Example:** Disable remote models.\n * ```javascript\n * import { env } from '@xenova/transformers';\n * env.allowRemoteModels = false;\n * ```\n * \n * **Example:** Set local model path.\n * ```javascript\n * import { env } from '@xenova/transformers';\n * env.localModelPath = '/path/to/local/models/';\n * ```\n * \n * **Example:** Set cache directory.\n * ```javascript\n * import { env } from '@xenova/transformers';\n * env.cacheDir = '/path/to/cache/directory/';\n * ```\n * \n * @module env\n */\n\n\n\n\n\n\nconst { env: onnx_env } = _backends_onnx_js__WEBPACK_IMPORTED_MODULE_3__.ONNX;\n\nconst VERSION = '2.16.1';\n\n// Check if various APIs are available (depends on environment)\nconst WEB_CACHE_AVAILABLE = typeof self !== 'undefined' && 'caches' in self;\nconst FS_AVAILABLE = !isEmpty(fs__WEBPACK_IMPORTED_MODULE_0__); // check if file system is available\nconst PATH_AVAILABLE = !isEmpty(path__WEBPACK_IMPORTED_MODULE_1__); // check if path is available\n\nconst RUNNING_LOCALLY = FS_AVAILABLE && PATH_AVAILABLE;\n\nconst __dirname = RUNNING_LOCALLY\n ? path__WEBPACK_IMPORTED_MODULE_1__.dirname(path__WEBPACK_IMPORTED_MODULE_1__.dirname(url__WEBPACK_IMPORTED_MODULE_2__.fileURLToPath(\"file:///home/runner/work/qdrant-frontend/qdrant-frontend/node_modules/@xenova/transformers/src/env.js\")))\n : './';\n\n// Only used for environments with access to file system\nconst DEFAULT_CACHE_DIR = RUNNING_LOCALLY\n ? path__WEBPACK_IMPORTED_MODULE_1__.join(__dirname, '/.cache/')\n : null;\n\n// Set local model path, based on available APIs\nconst DEFAULT_LOCAL_MODEL_PATH = '/models/';\nconst localModelPath = RUNNING_LOCALLY\n ? path__WEBPACK_IMPORTED_MODULE_1__.join(__dirname, DEFAULT_LOCAL_MODEL_PATH)\n : DEFAULT_LOCAL_MODEL_PATH;\n\nif (onnx_env?.wasm) {\n // Set path to wasm files. This is needed when running in a web worker.\n // https://onnxruntime.ai/docs/api/js/interfaces/Env.WebAssemblyFlags.html#wasmPaths\n // We use remote wasm files by default to make it easier for newer users.\n // In practice, users should probably self-host the necessary .wasm files.\n onnx_env.wasm.wasmPaths = RUNNING_LOCALLY\n ? path__WEBPACK_IMPORTED_MODULE_1__.join(__dirname, '/dist/')\n : `https://cdn.jsdelivr.net/npm/@xenova/transformers@${VERSION}/dist/`;\n}\n\n/**\n * Global variable used to control execution. This provides users a simple way to configure Transformers.js.\n * @property {Object} backends Expose environment variables of different backends,\n * allowing users to set these variables if they want to.\n * @property {string} __dirname Directory name of module. Useful for resolving local paths.\n * @property {string} version This version of Transformers.js.\n * @property {boolean} allowRemoteModels Whether to allow loading of remote files, defaults to `true`.\n * If set to `false`, it will have the same effect as setting `local_files_only=true` when loading pipelines, models, tokenizers, processors, etc.\n * @property {string} remoteHost Host URL to load models from. Defaults to the Hugging Face Hub.\n * @property {string} remotePathTemplate Path template to fill in and append to `remoteHost` when loading models.\n * @property {boolean} allowLocalModels Whether to allow loading of local files, defaults to `true`.\n * If set to `false`, it will skip the local file check and try to load the model from the remote host.\n * @property {string} localModelPath Path to load local models from. Defaults to `/models/`.\n * @property {boolean} useFS Whether to use the file system to load files. By default, it is `true` if available.\n * @property {boolean} useBrowserCache Whether to use Cache API to cache models. By default, it is `true` if available.\n * @property {boolean} useFSCache Whether to use the file system to cache files. By default, it is `true` if available.\n * @property {string} cacheDir The directory to use for caching files with the file system. By default, it is `./.cache`.\n * @property {boolean} useCustomCache Whether to use a custom cache system (defined by `customCache`), defaults to `false`.\n * @property {Object} customCache The custom cache to use. Defaults to `null`. Note: this must be an object which\n * implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache\n */\nconst env = {\n /////////////////// Backends settings ///////////////////\n backends: {\n // onnxruntime-web/onnxruntime-node\n onnx: onnx_env,\n\n // TensorFlow.js\n tfjs: {},\n },\n\n __dirname,\n version: VERSION,\n\n /////////////////// Model settings ///////////////////\n allowRemoteModels: true,\n remoteHost: 'https://huggingface.co/',\n remotePathTemplate: '{model}/resolve/{revision}/',\n\n allowLocalModels: true,\n localModelPath: localModelPath,\n useFS: FS_AVAILABLE,\n\n /////////////////// Cache settings ///////////////////\n useBrowserCache: WEB_CACHE_AVAILABLE,\n\n useFSCache: FS_AVAILABLE,\n cacheDir: DEFAULT_CACHE_DIR,\n\n useCustomCache: false,\n customCache: null,\n //////////////////////////////////////////////////////\n}\n\n\n/**\n * @param {Object} obj\n * @private\n */\nfunction isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/env.js?"); /***/ }), @@ -304,7 +3636,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ASTForAudioClassification: () => (/* binding */ ASTForAudioClassification),\n/* harmony export */ ASTModel: () => (/* binding */ ASTModel),\n/* harmony export */ ASTPreTrainedModel: () => (/* binding */ ASTPreTrainedModel),\n/* harmony export */ AlbertForMaskedLM: () => (/* binding */ AlbertForMaskedLM),\n/* harmony export */ AlbertForQuestionAnswering: () => (/* binding */ AlbertForQuestionAnswering),\n/* harmony export */ AlbertForSequenceClassification: () => (/* binding */ AlbertForSequenceClassification),\n/* harmony export */ AlbertModel: () => (/* binding */ AlbertModel),\n/* harmony export */ AlbertPreTrainedModel: () => (/* binding */ AlbertPreTrainedModel),\n/* harmony export */ AutoModel: () => (/* binding */ AutoModel),\n/* harmony export */ AutoModelForAudioClassification: () => (/* binding */ AutoModelForAudioClassification),\n/* harmony export */ AutoModelForCTC: () => (/* binding */ AutoModelForCTC),\n/* harmony export */ AutoModelForCausalLM: () => (/* binding */ AutoModelForCausalLM),\n/* harmony export */ AutoModelForDepthEstimation: () => (/* binding */ AutoModelForDepthEstimation),\n/* harmony export */ AutoModelForDocumentQuestionAnswering: () => (/* binding */ AutoModelForDocumentQuestionAnswering),\n/* harmony export */ AutoModelForImageClassification: () => (/* binding */ AutoModelForImageClassification),\n/* harmony export */ AutoModelForImageMatting: () => (/* binding */ AutoModelForImageMatting),\n/* harmony export */ AutoModelForImageSegmentation: () => (/* binding */ AutoModelForImageSegmentation),\n/* harmony export */ AutoModelForImageToImage: () => (/* binding */ AutoModelForImageToImage),\n/* harmony export */ AutoModelForMaskGeneration: () => (/* binding */ AutoModelForMaskGeneration),\n/* harmony export */ AutoModelForMaskedLM: () => (/* binding */ AutoModelForMaskedLM),\n/* harmony export */ AutoModelForObjectDetection: () => (/* binding */ AutoModelForObjectDetection),\n/* harmony export */ AutoModelForQuestionAnswering: () => (/* binding */ AutoModelForQuestionAnswering),\n/* harmony export */ AutoModelForSemanticSegmentation: () => (/* binding */ AutoModelForSemanticSegmentation),\n/* harmony export */ AutoModelForSeq2SeqLM: () => (/* binding */ AutoModelForSeq2SeqLM),\n/* harmony export */ AutoModelForSequenceClassification: () => (/* binding */ AutoModelForSequenceClassification),\n/* harmony export */ AutoModelForSpeechSeq2Seq: () => (/* binding */ AutoModelForSpeechSeq2Seq),\n/* harmony export */ AutoModelForTextToSpectrogram: () => (/* binding */ AutoModelForTextToSpectrogram),\n/* harmony export */ AutoModelForTextToWaveform: () => (/* binding */ AutoModelForTextToWaveform),\n/* harmony export */ AutoModelForTokenClassification: () => (/* binding */ AutoModelForTokenClassification),\n/* harmony export */ AutoModelForVision2Seq: () => (/* binding */ AutoModelForVision2Seq),\n/* harmony export */ AutoModelForZeroShotObjectDetection: () => (/* binding */ AutoModelForZeroShotObjectDetection),\n/* harmony export */ BartForConditionalGeneration: () => (/* binding */ BartForConditionalGeneration),\n/* harmony export */ BartForSequenceClassification: () => (/* binding */ BartForSequenceClassification),\n/* harmony export */ BartModel: () => (/* binding */ BartModel),\n/* harmony export */ BartPretrainedModel: () => (/* binding */ BartPretrainedModel),\n/* harmony export */ BaseModelOutput: () => (/* binding */ BaseModelOutput),\n/* harmony export */ BeitForImageClassification: () => (/* binding */ BeitForImageClassification),\n/* harmony export */ BeitModel: () => (/* binding */ BeitModel),\n/* harmony export */ BeitPreTrainedModel: () => (/* binding */ BeitPreTrainedModel),\n/* harmony export */ BertForMaskedLM: () => (/* binding */ BertForMaskedLM),\n/* harmony export */ BertForQuestionAnswering: () => (/* binding */ BertForQuestionAnswering),\n/* harmony export */ BertForSequenceClassification: () => (/* binding */ BertForSequenceClassification),\n/* harmony export */ BertForTokenClassification: () => (/* binding */ BertForTokenClassification),\n/* harmony export */ BertModel: () => (/* binding */ BertModel),\n/* harmony export */ BertPreTrainedModel: () => (/* binding */ BertPreTrainedModel),\n/* harmony export */ BlenderbotForConditionalGeneration: () => (/* binding */ BlenderbotForConditionalGeneration),\n/* harmony export */ BlenderbotModel: () => (/* binding */ BlenderbotModel),\n/* harmony export */ BlenderbotPreTrainedModel: () => (/* binding */ BlenderbotPreTrainedModel),\n/* harmony export */ BlenderbotSmallForConditionalGeneration: () => (/* binding */ BlenderbotSmallForConditionalGeneration),\n/* harmony export */ BlenderbotSmallModel: () => (/* binding */ BlenderbotSmallModel),\n/* harmony export */ BlenderbotSmallPreTrainedModel: () => (/* binding */ BlenderbotSmallPreTrainedModel),\n/* harmony export */ BloomForCausalLM: () => (/* binding */ BloomForCausalLM),\n/* harmony export */ BloomModel: () => (/* binding */ BloomModel),\n/* harmony export */ BloomPreTrainedModel: () => (/* binding */ BloomPreTrainedModel),\n/* harmony export */ CLIPModel: () => (/* binding */ CLIPModel),\n/* harmony export */ CLIPPreTrainedModel: () => (/* binding */ CLIPPreTrainedModel),\n/* harmony export */ CLIPSegForImageSegmentation: () => (/* binding */ CLIPSegForImageSegmentation),\n/* harmony export */ CLIPSegModel: () => (/* binding */ CLIPSegModel),\n/* harmony export */ CLIPSegPreTrainedModel: () => (/* binding */ CLIPSegPreTrainedModel),\n/* harmony export */ CLIPTextModelWithProjection: () => (/* binding */ CLIPTextModelWithProjection),\n/* harmony export */ CLIPVisionModelWithProjection: () => (/* binding */ CLIPVisionModelWithProjection),\n/* harmony export */ CamembertForMaskedLM: () => (/* binding */ CamembertForMaskedLM),\n/* harmony export */ CamembertForQuestionAnswering: () => (/* binding */ CamembertForQuestionAnswering),\n/* harmony export */ CamembertForSequenceClassification: () => (/* binding */ CamembertForSequenceClassification),\n/* harmony export */ CamembertForTokenClassification: () => (/* binding */ CamembertForTokenClassification),\n/* harmony export */ CamembertModel: () => (/* binding */ CamembertModel),\n/* harmony export */ CamembertPreTrainedModel: () => (/* binding */ CamembertPreTrainedModel),\n/* harmony export */ CausalLMOutput: () => (/* binding */ CausalLMOutput),\n/* harmony export */ CausalLMOutputWithPast: () => (/* binding */ CausalLMOutputWithPast),\n/* harmony export */ ChineseCLIPModel: () => (/* binding */ ChineseCLIPModel),\n/* harmony export */ ChineseCLIPPreTrainedModel: () => (/* binding */ ChineseCLIPPreTrainedModel),\n/* harmony export */ ClapAudioModelWithProjection: () => (/* binding */ ClapAudioModelWithProjection),\n/* harmony export */ ClapModel: () => (/* binding */ ClapModel),\n/* harmony export */ ClapPreTrainedModel: () => (/* binding */ ClapPreTrainedModel),\n/* harmony export */ ClapTextModelWithProjection: () => (/* binding */ ClapTextModelWithProjection),\n/* harmony export */ CodeGenForCausalLM: () => (/* binding */ CodeGenForCausalLM),\n/* harmony export */ CodeGenModel: () => (/* binding */ CodeGenModel),\n/* harmony export */ CodeGenPreTrainedModel: () => (/* binding */ CodeGenPreTrainedModel),\n/* harmony export */ ConvBertForMaskedLM: () => (/* binding */ ConvBertForMaskedLM),\n/* harmony export */ ConvBertForQuestionAnswering: () => (/* binding */ ConvBertForQuestionAnswering),\n/* harmony export */ ConvBertForSequenceClassification: () => (/* binding */ ConvBertForSequenceClassification),\n/* harmony export */ ConvBertForTokenClassification: () => (/* binding */ ConvBertForTokenClassification),\n/* harmony export */ ConvBertModel: () => (/* binding */ ConvBertModel),\n/* harmony export */ ConvBertPreTrainedModel: () => (/* binding */ ConvBertPreTrainedModel),\n/* harmony export */ ConvNextForImageClassification: () => (/* binding */ ConvNextForImageClassification),\n/* harmony export */ ConvNextModel: () => (/* binding */ ConvNextModel),\n/* harmony export */ ConvNextPreTrainedModel: () => (/* binding */ ConvNextPreTrainedModel),\n/* harmony export */ ConvNextV2ForImageClassification: () => (/* binding */ ConvNextV2ForImageClassification),\n/* harmony export */ ConvNextV2Model: () => (/* binding */ ConvNextV2Model),\n/* harmony export */ ConvNextV2PreTrainedModel: () => (/* binding */ ConvNextV2PreTrainedModel),\n/* harmony export */ DPTForDepthEstimation: () => (/* binding */ DPTForDepthEstimation),\n/* harmony export */ DPTModel: () => (/* binding */ DPTModel),\n/* harmony export */ DPTPreTrainedModel: () => (/* binding */ DPTPreTrainedModel),\n/* harmony export */ DebertaForMaskedLM: () => (/* binding */ DebertaForMaskedLM),\n/* harmony export */ DebertaForQuestionAnswering: () => (/* binding */ DebertaForQuestionAnswering),\n/* harmony export */ DebertaForSequenceClassification: () => (/* binding */ DebertaForSequenceClassification),\n/* harmony export */ DebertaForTokenClassification: () => (/* binding */ DebertaForTokenClassification),\n/* harmony export */ DebertaModel: () => (/* binding */ DebertaModel),\n/* harmony export */ DebertaPreTrainedModel: () => (/* binding */ DebertaPreTrainedModel),\n/* harmony export */ DebertaV2ForMaskedLM: () => (/* binding */ DebertaV2ForMaskedLM),\n/* harmony export */ DebertaV2ForQuestionAnswering: () => (/* binding */ DebertaV2ForQuestionAnswering),\n/* harmony export */ DebertaV2ForSequenceClassification: () => (/* binding */ DebertaV2ForSequenceClassification),\n/* harmony export */ DebertaV2ForTokenClassification: () => (/* binding */ DebertaV2ForTokenClassification),\n/* harmony export */ DebertaV2Model: () => (/* binding */ DebertaV2Model),\n/* harmony export */ DebertaV2PreTrainedModel: () => (/* binding */ DebertaV2PreTrainedModel),\n/* harmony export */ DeiTForImageClassification: () => (/* binding */ DeiTForImageClassification),\n/* harmony export */ DeiTModel: () => (/* binding */ DeiTModel),\n/* harmony export */ DeiTPreTrainedModel: () => (/* binding */ DeiTPreTrainedModel),\n/* harmony export */ DepthAnythingForDepthEstimation: () => (/* binding */ DepthAnythingForDepthEstimation),\n/* harmony export */ DepthAnythingPreTrainedModel: () => (/* binding */ DepthAnythingPreTrainedModel),\n/* harmony export */ DetrForObjectDetection: () => (/* binding */ DetrForObjectDetection),\n/* harmony export */ DetrForSegmentation: () => (/* binding */ DetrForSegmentation),\n/* harmony export */ DetrModel: () => (/* binding */ DetrModel),\n/* harmony export */ DetrObjectDetectionOutput: () => (/* binding */ DetrObjectDetectionOutput),\n/* harmony export */ DetrPreTrainedModel: () => (/* binding */ DetrPreTrainedModel),\n/* harmony export */ DetrSegmentationOutput: () => (/* binding */ DetrSegmentationOutput),\n/* harmony export */ Dinov2ForImageClassification: () => (/* binding */ Dinov2ForImageClassification),\n/* harmony export */ Dinov2Model: () => (/* binding */ Dinov2Model),\n/* harmony export */ Dinov2PreTrainedModel: () => (/* binding */ Dinov2PreTrainedModel),\n/* harmony export */ DistilBertForMaskedLM: () => (/* binding */ DistilBertForMaskedLM),\n/* harmony export */ DistilBertForQuestionAnswering: () => (/* binding */ DistilBertForQuestionAnswering),\n/* harmony export */ DistilBertForSequenceClassification: () => (/* binding */ DistilBertForSequenceClassification),\n/* harmony export */ DistilBertForTokenClassification: () => (/* binding */ DistilBertForTokenClassification),\n/* harmony export */ DistilBertModel: () => (/* binding */ DistilBertModel),\n/* harmony export */ DistilBertPreTrainedModel: () => (/* binding */ DistilBertPreTrainedModel),\n/* harmony export */ DonutSwinModel: () => (/* binding */ DonutSwinModel),\n/* harmony export */ DonutSwinPreTrainedModel: () => (/* binding */ DonutSwinPreTrainedModel),\n/* harmony export */ ElectraForMaskedLM: () => (/* binding */ ElectraForMaskedLM),\n/* harmony export */ ElectraForQuestionAnswering: () => (/* binding */ ElectraForQuestionAnswering),\n/* harmony export */ ElectraForSequenceClassification: () => (/* binding */ ElectraForSequenceClassification),\n/* harmony export */ ElectraForTokenClassification: () => (/* binding */ ElectraForTokenClassification),\n/* harmony export */ ElectraModel: () => (/* binding */ ElectraModel),\n/* harmony export */ ElectraPreTrainedModel: () => (/* binding */ ElectraPreTrainedModel),\n/* harmony export */ EsmForMaskedLM: () => (/* binding */ EsmForMaskedLM),\n/* harmony export */ EsmForSequenceClassification: () => (/* binding */ EsmForSequenceClassification),\n/* harmony export */ EsmForTokenClassification: () => (/* binding */ EsmForTokenClassification),\n/* harmony export */ EsmModel: () => (/* binding */ EsmModel),\n/* harmony export */ EsmPreTrainedModel: () => (/* binding */ EsmPreTrainedModel),\n/* harmony export */ FalconForCausalLM: () => (/* binding */ FalconForCausalLM),\n/* harmony export */ FalconModel: () => (/* binding */ FalconModel),\n/* harmony export */ FalconPreTrainedModel: () => (/* binding */ FalconPreTrainedModel),\n/* harmony export */ GLPNForDepthEstimation: () => (/* binding */ GLPNForDepthEstimation),\n/* harmony export */ GLPNModel: () => (/* binding */ GLPNModel),\n/* harmony export */ GLPNPreTrainedModel: () => (/* binding */ GLPNPreTrainedModel),\n/* harmony export */ GPT2LMHeadModel: () => (/* binding */ GPT2LMHeadModel),\n/* harmony export */ GPT2Model: () => (/* binding */ GPT2Model),\n/* harmony export */ GPT2PreTrainedModel: () => (/* binding */ GPT2PreTrainedModel),\n/* harmony export */ GPTBigCodeForCausalLM: () => (/* binding */ GPTBigCodeForCausalLM),\n/* harmony export */ GPTBigCodeModel: () => (/* binding */ GPTBigCodeModel),\n/* harmony export */ GPTBigCodePreTrainedModel: () => (/* binding */ GPTBigCodePreTrainedModel),\n/* harmony export */ GPTJForCausalLM: () => (/* binding */ GPTJForCausalLM),\n/* harmony export */ GPTJModel: () => (/* binding */ GPTJModel),\n/* harmony export */ GPTJPreTrainedModel: () => (/* binding */ GPTJPreTrainedModel),\n/* harmony export */ GPTNeoForCausalLM: () => (/* binding */ GPTNeoForCausalLM),\n/* harmony export */ GPTNeoModel: () => (/* binding */ GPTNeoModel),\n/* harmony export */ GPTNeoPreTrainedModel: () => (/* binding */ GPTNeoPreTrainedModel),\n/* harmony export */ GPTNeoXForCausalLM: () => (/* binding */ GPTNeoXForCausalLM),\n/* harmony export */ GPTNeoXModel: () => (/* binding */ GPTNeoXModel),\n/* harmony export */ GPTNeoXPreTrainedModel: () => (/* binding */ GPTNeoXPreTrainedModel),\n/* harmony export */ HubertForCTC: () => (/* binding */ HubertForCTC),\n/* harmony export */ HubertForSequenceClassification: () => (/* binding */ HubertForSequenceClassification),\n/* harmony export */ HubertModel: () => (/* binding */ HubertModel),\n/* harmony export */ HubertPreTrainedModel: () => (/* binding */ HubertPreTrainedModel),\n/* harmony export */ ImageMattingOutput: () => (/* binding */ ImageMattingOutput),\n/* harmony export */ LlamaForCausalLM: () => (/* binding */ LlamaForCausalLM),\n/* harmony export */ LlamaModel: () => (/* binding */ LlamaModel),\n/* harmony export */ LlamaPreTrainedModel: () => (/* binding */ LlamaPreTrainedModel),\n/* harmony export */ LongT5ForConditionalGeneration: () => (/* binding */ LongT5ForConditionalGeneration),\n/* harmony export */ LongT5Model: () => (/* binding */ LongT5Model),\n/* harmony export */ LongT5PreTrainedModel: () => (/* binding */ LongT5PreTrainedModel),\n/* harmony export */ M2M100ForConditionalGeneration: () => (/* binding */ M2M100ForConditionalGeneration),\n/* harmony export */ M2M100Model: () => (/* binding */ M2M100Model),\n/* harmony export */ M2M100PreTrainedModel: () => (/* binding */ M2M100PreTrainedModel),\n/* harmony export */ MBartForCausalLM: () => (/* binding */ MBartForCausalLM),\n/* harmony export */ MBartForConditionalGeneration: () => (/* binding */ MBartForConditionalGeneration),\n/* harmony export */ MBartForSequenceClassification: () => (/* binding */ MBartForSequenceClassification),\n/* harmony export */ MBartModel: () => (/* binding */ MBartModel),\n/* harmony export */ MBartPreTrainedModel: () => (/* binding */ MBartPreTrainedModel),\n/* harmony export */ MPNetForMaskedLM: () => (/* binding */ MPNetForMaskedLM),\n/* harmony export */ MPNetForQuestionAnswering: () => (/* binding */ MPNetForQuestionAnswering),\n/* harmony export */ MPNetForSequenceClassification: () => (/* binding */ MPNetForSequenceClassification),\n/* harmony export */ MPNetForTokenClassification: () => (/* binding */ MPNetForTokenClassification),\n/* harmony export */ MPNetModel: () => (/* binding */ MPNetModel),\n/* harmony export */ MPNetPreTrainedModel: () => (/* binding */ MPNetPreTrainedModel),\n/* harmony export */ MT5ForConditionalGeneration: () => (/* binding */ MT5ForConditionalGeneration),\n/* harmony export */ MT5Model: () => (/* binding */ MT5Model),\n/* harmony export */ MT5PreTrainedModel: () => (/* binding */ MT5PreTrainedModel),\n/* harmony export */ MarianMTModel: () => (/* binding */ MarianMTModel),\n/* harmony export */ MarianModel: () => (/* binding */ MarianModel),\n/* harmony export */ MarianPreTrainedModel: () => (/* binding */ MarianPreTrainedModel),\n/* harmony export */ MaskedLMOutput: () => (/* binding */ MaskedLMOutput),\n/* harmony export */ MistralForCausalLM: () => (/* binding */ MistralForCausalLM),\n/* harmony export */ MistralModel: () => (/* binding */ MistralModel),\n/* harmony export */ MistralPreTrainedModel: () => (/* binding */ MistralPreTrainedModel),\n/* harmony export */ MobileBertForMaskedLM: () => (/* binding */ MobileBertForMaskedLM),\n/* harmony export */ MobileBertForQuestionAnswering: () => (/* binding */ MobileBertForQuestionAnswering),\n/* harmony export */ MobileBertForSequenceClassification: () => (/* binding */ MobileBertForSequenceClassification),\n/* harmony export */ MobileBertModel: () => (/* binding */ MobileBertModel),\n/* harmony export */ MobileBertPreTrainedModel: () => (/* binding */ MobileBertPreTrainedModel),\n/* harmony export */ MobileViTForImageClassification: () => (/* binding */ MobileViTForImageClassification),\n/* harmony export */ MobileViTModel: () => (/* binding */ MobileViTModel),\n/* harmony export */ MobileViTPreTrainedModel: () => (/* binding */ MobileViTPreTrainedModel),\n/* harmony export */ ModelOutput: () => (/* binding */ ModelOutput),\n/* harmony export */ MptForCausalLM: () => (/* binding */ MptForCausalLM),\n/* harmony export */ MptModel: () => (/* binding */ MptModel),\n/* harmony export */ MptPreTrainedModel: () => (/* binding */ MptPreTrainedModel),\n/* harmony export */ NomicBertModel: () => (/* binding */ NomicBertModel),\n/* harmony export */ NomicBertPreTrainedModel: () => (/* binding */ NomicBertPreTrainedModel),\n/* harmony export */ OPTForCausalLM: () => (/* binding */ OPTForCausalLM),\n/* harmony export */ OPTModel: () => (/* binding */ OPTModel),\n/* harmony export */ OPTPreTrainedModel: () => (/* binding */ OPTPreTrainedModel),\n/* harmony export */ OwlViTForObjectDetection: () => (/* binding */ OwlViTForObjectDetection),\n/* harmony export */ OwlViTModel: () => (/* binding */ OwlViTModel),\n/* harmony export */ OwlViTPreTrainedModel: () => (/* binding */ OwlViTPreTrainedModel),\n/* harmony export */ Owlv2ForObjectDetection: () => (/* binding */ Owlv2ForObjectDetection),\n/* harmony export */ Owlv2Model: () => (/* binding */ Owlv2Model),\n/* harmony export */ Owlv2PreTrainedModel: () => (/* binding */ Owlv2PreTrainedModel),\n/* harmony export */ PhiForCausalLM: () => (/* binding */ PhiForCausalLM),\n/* harmony export */ PhiModel: () => (/* binding */ PhiModel),\n/* harmony export */ PhiPreTrainedModel: () => (/* binding */ PhiPreTrainedModel),\n/* harmony export */ PreTrainedModel: () => (/* binding */ PreTrainedModel),\n/* harmony export */ PretrainedMixin: () => (/* binding */ PretrainedMixin),\n/* harmony export */ QuestionAnsweringModelOutput: () => (/* binding */ QuestionAnsweringModelOutput),\n/* harmony export */ Qwen2ForCausalLM: () => (/* binding */ Qwen2ForCausalLM),\n/* harmony export */ Qwen2Model: () => (/* binding */ Qwen2Model),\n/* harmony export */ Qwen2PreTrainedModel: () => (/* binding */ Qwen2PreTrainedModel),\n/* harmony export */ ResNetForImageClassification: () => (/* binding */ ResNetForImageClassification),\n/* harmony export */ ResNetModel: () => (/* binding */ ResNetModel),\n/* harmony export */ ResNetPreTrainedModel: () => (/* binding */ ResNetPreTrainedModel),\n/* harmony export */ RoFormerForMaskedLM: () => (/* binding */ RoFormerForMaskedLM),\n/* harmony export */ RoFormerForQuestionAnswering: () => (/* binding */ RoFormerForQuestionAnswering),\n/* harmony export */ RoFormerForSequenceClassification: () => (/* binding */ RoFormerForSequenceClassification),\n/* harmony export */ RoFormerForTokenClassification: () => (/* binding */ RoFormerForTokenClassification),\n/* harmony export */ RoFormerModel: () => (/* binding */ RoFormerModel),\n/* harmony export */ RoFormerPreTrainedModel: () => (/* binding */ RoFormerPreTrainedModel),\n/* harmony export */ RobertaForMaskedLM: () => (/* binding */ RobertaForMaskedLM),\n/* harmony export */ RobertaForQuestionAnswering: () => (/* binding */ RobertaForQuestionAnswering),\n/* harmony export */ RobertaForSequenceClassification: () => (/* binding */ RobertaForSequenceClassification),\n/* harmony export */ RobertaForTokenClassification: () => (/* binding */ RobertaForTokenClassification),\n/* harmony export */ RobertaModel: () => (/* binding */ RobertaModel),\n/* harmony export */ RobertaPreTrainedModel: () => (/* binding */ RobertaPreTrainedModel),\n/* harmony export */ SamImageSegmentationOutput: () => (/* binding */ SamImageSegmentationOutput),\n/* harmony export */ SamModel: () => (/* binding */ SamModel),\n/* harmony export */ SamPreTrainedModel: () => (/* binding */ SamPreTrainedModel),\n/* harmony export */ SegformerForImageClassification: () => (/* binding */ SegformerForImageClassification),\n/* harmony export */ SegformerForSemanticSegmentation: () => (/* binding */ SegformerForSemanticSegmentation),\n/* harmony export */ SegformerModel: () => (/* binding */ SegformerModel),\n/* harmony export */ SegformerPreTrainedModel: () => (/* binding */ SegformerPreTrainedModel),\n/* harmony export */ Seq2SeqLMOutput: () => (/* binding */ Seq2SeqLMOutput),\n/* harmony export */ SequenceClassifierOutput: () => (/* binding */ SequenceClassifierOutput),\n/* harmony export */ SiglipModel: () => (/* binding */ SiglipModel),\n/* harmony export */ SiglipPreTrainedModel: () => (/* binding */ SiglipPreTrainedModel),\n/* harmony export */ SiglipTextModel: () => (/* binding */ SiglipTextModel),\n/* harmony export */ SiglipVisionModel: () => (/* binding */ SiglipVisionModel),\n/* harmony export */ SpeechT5ForSpeechToText: () => (/* binding */ SpeechT5ForSpeechToText),\n/* harmony export */ SpeechT5ForTextToSpeech: () => (/* binding */ SpeechT5ForTextToSpeech),\n/* harmony export */ SpeechT5HifiGan: () => (/* binding */ SpeechT5HifiGan),\n/* harmony export */ SpeechT5Model: () => (/* binding */ SpeechT5Model),\n/* harmony export */ SpeechT5PreTrainedModel: () => (/* binding */ SpeechT5PreTrainedModel),\n/* harmony export */ SqueezeBertForMaskedLM: () => (/* binding */ SqueezeBertForMaskedLM),\n/* harmony export */ SqueezeBertForQuestionAnswering: () => (/* binding */ SqueezeBertForQuestionAnswering),\n/* harmony export */ SqueezeBertForSequenceClassification: () => (/* binding */ SqueezeBertForSequenceClassification),\n/* harmony export */ SqueezeBertModel: () => (/* binding */ SqueezeBertModel),\n/* harmony export */ SqueezeBertPreTrainedModel: () => (/* binding */ SqueezeBertPreTrainedModel),\n/* harmony export */ Swin2SRForImageSuperResolution: () => (/* binding */ Swin2SRForImageSuperResolution),\n/* harmony export */ Swin2SRModel: () => (/* binding */ Swin2SRModel),\n/* harmony export */ Swin2SRPreTrainedModel: () => (/* binding */ Swin2SRPreTrainedModel),\n/* harmony export */ SwinForImageClassification: () => (/* binding */ SwinForImageClassification),\n/* harmony export */ SwinModel: () => (/* binding */ SwinModel),\n/* harmony export */ SwinPreTrainedModel: () => (/* binding */ SwinPreTrainedModel),\n/* harmony export */ T5ForConditionalGeneration: () => (/* binding */ T5ForConditionalGeneration),\n/* harmony export */ T5Model: () => (/* binding */ T5Model),\n/* harmony export */ T5PreTrainedModel: () => (/* binding */ T5PreTrainedModel),\n/* harmony export */ TableTransformerForObjectDetection: () => (/* binding */ TableTransformerForObjectDetection),\n/* harmony export */ TableTransformerModel: () => (/* binding */ TableTransformerModel),\n/* harmony export */ TableTransformerObjectDetectionOutput: () => (/* binding */ TableTransformerObjectDetectionOutput),\n/* harmony export */ TableTransformerPreTrainedModel: () => (/* binding */ TableTransformerPreTrainedModel),\n/* harmony export */ TokenClassifierOutput: () => (/* binding */ TokenClassifierOutput),\n/* harmony export */ TrOCRForCausalLM: () => (/* binding */ TrOCRForCausalLM),\n/* harmony export */ TrOCRPreTrainedModel: () => (/* binding */ TrOCRPreTrainedModel),\n/* harmony export */ ViTForImageClassification: () => (/* binding */ ViTForImageClassification),\n/* harmony export */ ViTModel: () => (/* binding */ ViTModel),\n/* harmony export */ ViTPreTrainedModel: () => (/* binding */ ViTPreTrainedModel),\n/* harmony export */ VisionEncoderDecoderModel: () => (/* binding */ VisionEncoderDecoderModel),\n/* harmony export */ VitMatteForImageMatting: () => (/* binding */ VitMatteForImageMatting),\n/* harmony export */ VitMattePreTrainedModel: () => (/* binding */ VitMattePreTrainedModel),\n/* harmony export */ VitsModel: () => (/* binding */ VitsModel),\n/* harmony export */ VitsModelOutput: () => (/* binding */ VitsModelOutput),\n/* harmony export */ VitsPreTrainedModel: () => (/* binding */ VitsPreTrainedModel),\n/* harmony export */ Wav2Vec2BertForCTC: () => (/* binding */ Wav2Vec2BertForCTC),\n/* harmony export */ Wav2Vec2BertForSequenceClassification: () => (/* binding */ Wav2Vec2BertForSequenceClassification),\n/* harmony export */ Wav2Vec2BertModel: () => (/* binding */ Wav2Vec2BertModel),\n/* harmony export */ Wav2Vec2BertPreTrainedModel: () => (/* binding */ Wav2Vec2BertPreTrainedModel),\n/* harmony export */ Wav2Vec2ForCTC: () => (/* binding */ Wav2Vec2ForCTC),\n/* harmony export */ Wav2Vec2ForSequenceClassification: () => (/* binding */ Wav2Vec2ForSequenceClassification),\n/* harmony export */ Wav2Vec2Model: () => (/* binding */ Wav2Vec2Model),\n/* harmony export */ Wav2Vec2PreTrainedModel: () => (/* binding */ Wav2Vec2PreTrainedModel),\n/* harmony export */ WavLMForCTC: () => (/* binding */ WavLMForCTC),\n/* harmony export */ WavLMForSequenceClassification: () => (/* binding */ WavLMForSequenceClassification),\n/* harmony export */ WavLMModel: () => (/* binding */ WavLMModel),\n/* harmony export */ WavLMPreTrainedModel: () => (/* binding */ WavLMPreTrainedModel),\n/* harmony export */ WhisperForConditionalGeneration: () => (/* binding */ WhisperForConditionalGeneration),\n/* harmony export */ WhisperModel: () => (/* binding */ WhisperModel),\n/* harmony export */ WhisperPreTrainedModel: () => (/* binding */ WhisperPreTrainedModel),\n/* harmony export */ XLMForQuestionAnswering: () => (/* binding */ XLMForQuestionAnswering),\n/* harmony export */ XLMForSequenceClassification: () => (/* binding */ XLMForSequenceClassification),\n/* harmony export */ XLMForTokenClassification: () => (/* binding */ XLMForTokenClassification),\n/* harmony export */ XLMModel: () => (/* binding */ XLMModel),\n/* harmony export */ XLMPreTrainedModel: () => (/* binding */ XLMPreTrainedModel),\n/* harmony export */ XLMRobertaForMaskedLM: () => (/* binding */ XLMRobertaForMaskedLM),\n/* harmony export */ XLMRobertaForQuestionAnswering: () => (/* binding */ XLMRobertaForQuestionAnswering),\n/* harmony export */ XLMRobertaForSequenceClassification: () => (/* binding */ XLMRobertaForSequenceClassification),\n/* harmony export */ XLMRobertaForTokenClassification: () => (/* binding */ XLMRobertaForTokenClassification),\n/* harmony export */ XLMRobertaModel: () => (/* binding */ XLMRobertaModel),\n/* harmony export */ XLMRobertaPreTrainedModel: () => (/* binding */ XLMRobertaPreTrainedModel),\n/* harmony export */ XLMWithLMHeadModel: () => (/* binding */ XLMWithLMHeadModel),\n/* harmony export */ YolosForObjectDetection: () => (/* binding */ YolosForObjectDetection),\n/* harmony export */ YolosModel: () => (/* binding */ YolosModel),\n/* harmony export */ YolosObjectDetectionOutput: () => (/* binding */ YolosObjectDetectionOutput),\n/* harmony export */ YolosPreTrainedModel: () => (/* binding */ YolosPreTrainedModel)\n/* harmony export */ });\n/* harmony import */ var _configs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./configs.js */ \"./node_modules/@xenova/transformers/src/configs.js\");\n/* harmony import */ var _utils_core_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/core.js */ \"./node_modules/@xenova/transformers/src/utils/core.js\");\n/* harmony import */ var _utils_hub_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/hub.js */ \"./node_modules/@xenova/transformers/src/utils/hub.js\");\n/* harmony import */ var _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/generation.js */ \"./node_modules/@xenova/transformers/src/utils/generation.js\");\n/* harmony import */ var _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/tensor.js */ \"./node_modules/@xenova/transformers/src/utils/tensor.js\");\n/* harmony import */ var _backends_onnx_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./backends/onnx.js */ \"./node_modules/@xenova/transformers/src/backends/onnx.js\");\n/* harmony import */ var _transformers_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./transformers.js */ \"./node_modules/@xenova/transformers/src/transformers.js\");\n\n/**\n * @file Definitions of all models available in Transformers.js.\n * \n * **Example:** Load and run an `AutoModel`.\n * \n * ```javascript\n * import { AutoModel, AutoTokenizer } from '@xenova/transformers';\n *\n * let tokenizer = await AutoTokenizer.from_pretrained('Xenova/bert-base-uncased');\n * let model = await AutoModel.from_pretrained('Xenova/bert-base-uncased');\n *\n * let inputs = await tokenizer('I love transformers!');\n * let { logits } = await model(inputs);\n * // Tensor {\n * // data: Float32Array(183132) [-7.117443084716797, -7.107812881469727, -7.092104911804199, ...]\n * // dims: (3) [1, 6, 30522],\n * // type: \"float32\",\n * // size: 183132,\n * // }\n * ```\n * \n * We also provide other `AutoModel`s (listed below), which you can use in the same way as the Python library. For example:\n * \n * **Example:** Load and run an `AutoModelForSeq2SeqLM`.\n * ```javascript\n * import { AutoModelForSeq2SeqLM, AutoTokenizer } from '@xenova/transformers';\n * \n * let tokenizer = await AutoTokenizer.from_pretrained('Xenova/t5-small');\n * let model = await AutoModelForSeq2SeqLM.from_pretrained('Xenova/t5-small');\n *\n * let { input_ids } = await tokenizer('translate English to German: I love transformers!');\n * let outputs = await model.generate(input_ids);\n * let decoded = tokenizer.decode(outputs[0], { skip_special_tokens: true });\n * // 'Ich liebe Transformatoren!'\n * ```\n * \n * @module models\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst { InferenceSession, Tensor: ONNXTensor, env } = _backends_onnx_js__WEBPACK_IMPORTED_MODULE_5__.ONNX;\n\n/** @typedef {import('onnxruntime-web').InferenceSession} InferenceSession */\n\n//////////////////////////////////////////////////\n// Model types: used internally\nconst MODEL_TYPES = {\n EncoderOnly: 0,\n EncoderDecoder: 1,\n Seq2Seq: 2,\n Vision2Seq: 3,\n DecoderOnly: 4,\n MaskGeneration: 5,\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Helper functions\n\n// NOTE: These will be populated fully later\nconst MODEL_TYPE_MAPPING = new Map();\nconst MODEL_NAME_TO_CLASS_MAPPING = new Map();\nconst MODEL_CLASS_TO_NAME_MAPPING = new Map();\n\n\n/**\n * Constructs an InferenceSession using a model file located at the specified path.\n * @param {string} pretrained_model_name_or_path The path to the directory containing the model file.\n * @param {string} fileName The name of the model file.\n * @param {import('./utils/hub.js').PretrainedOptions} options Additional options for loading the model.\n * @returns {Promise} A Promise that resolves to an InferenceSession object.\n * @private\n */\nasync function constructSession(pretrained_model_name_or_path, fileName, options) {\n // TODO add option for user to force specify their desired execution provider\n let modelFileName = `onnx/${fileName}${options.quantized ? '_quantized' : ''}.onnx`;\n let buffer = await (0,_utils_hub_js__WEBPACK_IMPORTED_MODULE_2__.getModelFile)(pretrained_model_name_or_path, modelFileName, true, options);\n\n try {\n return await InferenceSession.create(buffer, {\n executionProviders: _backends_onnx_js__WEBPACK_IMPORTED_MODULE_5__.executionProviders,\n });\n } catch (err) {\n // If the execution provided was only wasm, throw the error\n if (_backends_onnx_js__WEBPACK_IMPORTED_MODULE_5__.executionProviders.length === 1 && _backends_onnx_js__WEBPACK_IMPORTED_MODULE_5__.executionProviders[0] === 'wasm') {\n throw err;\n }\n\n console.warn(err);\n console.warn(\n 'Something went wrong during model construction (most likely a missing operation). ' +\n 'Using `wasm` as a fallback. '\n )\n return await InferenceSession.create(buffer, {\n executionProviders: ['wasm']\n });\n }\n}\n\n/**\n * Validate model inputs\n * @param {InferenceSession} session The InferenceSession object that will be run.\n * @param {Record} inputs The inputs to check.\n * @returns {Record} The checked inputs.\n * @throws {Error} If any inputs are missing.\n * @private\n */\nfunction validateInputs(session, inputs) {\n /**\n * NOTE: Create either a shallow or deep copy based on `onnx.wasm.proxy`\n * @type {Record}\n */\n const checkedInputs = Object.create(null);\n const missingInputs = [];\n for (const inputName of session.inputNames) {\n const tensor = inputs[inputName];\n // Rare case where one of the model's input names corresponds to a built-in\n // object name (e.g., toString), which would cause a simple (!tensor) check to fail,\n // because it's not undefined but a function.\n if (!(tensor instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor)) {\n missingInputs.push(inputName);\n continue;\n }\n // NOTE: When `env.wasm.proxy is true` the tensor is moved across the Worker\n // boundary, transferring ownership to the worker and invalidating the tensor.\n // So, in this case, we simply sacrifice a clone for it.\n checkedInputs[inputName] = env.wasm.proxy ? tensor.clone() : tensor;\n }\n if (missingInputs.length > 0) {\n throw new Error(\n `An error occurred during model execution: \"Missing the following inputs: ${missingInputs.join(', ')}.`);\n }\n\n const numInputsProvided = Object.keys(inputs).length;\n const numInputsNeeded = session.inputNames.length;\n if (numInputsProvided > numInputsNeeded) {\n // No missing inputs, but too many inputs were provided.\n // Warn the user and ignore the extra inputs.\n let ignored = Object.keys(inputs).filter(inputName => !session.inputNames.includes(inputName));\n console.warn(`WARNING: Too many inputs were provided (${numInputsProvided} > ${numInputsNeeded}). The following inputs will be ignored: \"${ignored.join(', ')}\".`);\n }\n\n return checkedInputs;\n}\n\n/**\n * Executes an InferenceSession using the specified inputs.\n * NOTE: `inputs` must contain at least the input names of the model.\n * - If additional inputs are passed, they will be ignored.\n * - If inputs are missing, an error will be thrown.\n * \n * @param {InferenceSession} session The InferenceSession object to run.\n * @param {Object} inputs An object that maps input names to input tensors.\n * @returns {Promise} A Promise that resolves to an object that maps output names to output tensors.\n * @private\n */\nasync function sessionRun(session, inputs) {\n const checkedInputs = validateInputs(session, inputs);\n try {\n // @ts-ignore\n let output = await session.run(checkedInputs);\n output = replaceTensors(output);\n return output;\n } catch (e) {\n // This usually occurs when the inputs are of the wrong type.\n console.error(`An error occurred during model execution: \"${e}\".`);\n console.error('Inputs given to model:', checkedInputs);\n throw e;\n }\n}\n\n/**\n * Replaces ONNX Tensor objects with custom Tensor objects to support additional functions.\n * @param {Object} obj The object to replace tensor objects in.\n * @returns {Object} The object with tensor objects replaced by custom Tensor objects.\n * @private\n */\nfunction replaceTensors(obj) {\n for (let prop in obj) {\n if (obj[prop] instanceof ONNXTensor) {\n obj[prop] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor(obj[prop]);\n } else if (typeof obj[prop] === 'object') {\n replaceTensors(obj[prop]);\n }\n }\n return obj;\n}\n\n\n/**\n * Converts an array or Tensor of integers to an int64 Tensor.\n * @param {Array|Tensor} items The input integers to be converted.\n * @returns {Tensor} The int64 Tensor with the converted values.\n * @throws {Error} If the input array is empty or the input is a batched Tensor and not all sequences have the same length.\n * @private\n */\nfunction toI64Tensor(items) {\n if (items instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor) {\n return items;\n }\n // items is an array\n if (items.length === 0) {\n throw Error(\"items must be non-empty\");\n }\n\n if (Array.isArray(items[0])) {\n // batched\n if (items.some(x => x.length !== items[0].length)) {\n throw Error(\"Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.\")\n }\n\n return new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('int64',\n BigInt64Array.from(items.flat().map(x => BigInt(x))),\n [items.length, items[0].length]\n );\n } else {\n //flat\n return new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('int64',\n BigInt64Array.from(items.map(x => BigInt(x))),\n [1, items.length]\n );\n }\n}\n\n/**\n * Prepares an attention mask for a sequence of tokens based on configuration options.\n * @param {Object} self The calling object instance.\n * @param {Tensor} tokens The input tokens.\n * @returns {Tensor} The attention mask tensor.\n * @private\n */\nfunction prepareAttentionMask(self, tokens) {\n\n // Prepare attention mask\n let pad_token_id = self.config.pad_token_id ?? null;\n let eos_token_id = self.config.eos_token_id ?? null;\n if ((0,_utils_core_js__WEBPACK_IMPORTED_MODULE_1__.isIntegralNumber)(eos_token_id)) {\n eos_token_id = [eos_token_id];\n }\n\n let is_pad_token_in_inputs = tokens.indexOf(pad_token_id) !== -1;\n let is_pad_token_not_equal_to_eos_token_id = (eos_token_id === null) || !eos_token_id.includes(pad_token_id)\n\n if (is_pad_token_in_inputs && is_pad_token_not_equal_to_eos_token_id) {\n let data = BigInt64Array.from(\n // Note: != so that int matches bigint\n // @ts-ignore\n tokens.data.map(x => x != pad_token_id)\n )\n return new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('int64', data, tokens.dims)\n } else {\n return (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.ones_like)(tokens);\n }\n}\n\n/**\n * Add position IDs to the feeds object.\n * @param {Object} session The inference session.\n * @param {Object} feeds The input to the model.\n * @param {boolean} use_cache_branch Whether to use the cache branch of the model.\n * @returns {void}\n * @private\n */\nfunction preparePositionIds(session, feeds, use_cache_branch) {\n if (!session.inputNames.includes('position_ids')) return;\n\n const data = new BigInt64Array(feeds.attention_mask.data.length);\n\n // Compute cumulative sum of the attention mask along the sequence length dimension\n for (let i = 0; i < feeds.attention_mask.dims[0]; ++i) {\n let start = i * feeds.attention_mask.dims[1];\n let sum = BigInt(0);\n for (let j = 0; j < feeds.attention_mask.dims[1]; ++j) {\n const index = start + j;\n if (feeds.attention_mask.data[index] === 0n) {\n data[index] = BigInt(1);\n } else { // === 1n\n data[index] = sum;\n sum += feeds.attention_mask.data[index];\n }\n }\n }\n\n feeds.position_ids = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('int64', data, feeds.attention_mask.dims);\n\n if (use_cache_branch) {\n feeds.position_ids = feeds.position_ids.slice(null, -1).unsqueeze_(-1);\n }\n}\n\n/**\n * Creates a boolean tensor with a single value.\n * @param {boolean} value The value of the tensor.\n * @returns {Tensor} The boolean tensor.\n * @private\n */\nfunction boolTensor(value) {\n return new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('bool', [value], [1]);\n}\n\n// JS doesn't support mixins, so we define some reused functions here, and allow \"this\" to be passed in\n/**\n * Perform forward pass on the seq2seq model (both encoder and decoder).\n * @param {Object} self The seq2seq model object.\n * @param {Object} model_inputs The input object for the model containing encoder and decoder inputs.\n * @returns {Promise} Promise that resolves with the output of the seq2seq model.\n * @private\n */\nasync function seq2seqForward(self, model_inputs) {\n\n let { encoder_outputs, past_key_values } = model_inputs;\n\n if (!encoder_outputs) {\n // Encoder outputs are not given, so we must compute them.\n encoder_outputs = (await encoderForward(self, model_inputs)).last_hidden_state;\n }\n let decoderFeeds = {\n input_ids: model_inputs.decoder_input_ids,\n encoder_hidden_states: encoder_outputs,\n };\n const use_cache_branch = !!past_key_values;\n\n if (self.decoder_merged_session.inputNames.includes('use_cache_branch')) {\n decoderFeeds.use_cache_branch = boolTensor(use_cache_branch);\n }\n\n if (self.decoder_merged_session.inputNames.includes('encoder_attention_mask')) {\n decoderFeeds.encoder_attention_mask = model_inputs.attention_mask\n }\n\n preparePositionIds(self.decoder_merged_session, decoderFeeds, use_cache_branch);\n self.addPastKeyValues(decoderFeeds, past_key_values);\n\n const decoderResults = await sessionRun(self.decoder_merged_session, decoderFeeds);\n let logits = decoderResults.logits;\n past_key_values = self.getPastKeyValues(decoderResults, past_key_values);\n\n // Get cross attention and/or decoder attentions if they are present\n const attns = self.getAttentions(decoderResults);\n\n return new Seq2SeqLMOutput({ logits, past_key_values, encoder_outputs, ...attns });\n}\n\n/**\n * Start the beam search process for the seq2seq model.\n * @param {PreTrainedModel} self The seq2seq model object.\n * @param {Tensor} inputTokenIds Array of input token ids for each input sequence.\n * @param {Object} generation_config The generation config.\n * @param {number} numOutputTokens The maximum number of output tokens for the model.\n * @returns {Object[]} Array of beam search objects.\n * @private\n */\nfunction seq2seqStartBeams(self, inputTokenIds, generation_config, numOutputTokens) {\n let beams = [];\n let beamId = 0;\n\n // @ts-ignore\n const requires_attention_mask = self.requires_attention_mask ?? true;\n\n // decoder_input_ids == output_token_ids\n let decoder_input_ids =\n generation_config.decoder_input_ids\n ?? generation_config.decoder_start_token_id\n ?? generation_config.bos_token_id\n ?? generation_config.eos_token_id;\n\n // Support input as tensor or list\n // TODO support batched decoder_input_ids\n if (decoder_input_ids instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor) {\n decoder_input_ids = decoder_input_ids.tolist().flat();\n } else if (!Array.isArray(decoder_input_ids)) {\n decoder_input_ids = [decoder_input_ids];\n }\n\n for (let tokens of inputTokenIds) {\n // TODO: Improve\n // Currently, just add back batch dimension.\n // In future, allow for true parallel execution\n tokens.dims = [1, ...tokens.dims]\n\n // Create beam\n let start = {\n inputs: tokens,\n encoder_outputs: null,\n prev_model_outputs: null,\n\n output_token_ids: decoder_input_ids,\n done: false,\n score: 0,\n id: beamId++ // assign unique id to beams\n }\n\n if (requires_attention_mask) {\n start.attention_mask = prepareAttentionMask(self, tokens);\n }\n\n beams.push(start);\n }\n\n return beams;\n}\n\n/**\n * Run beam search on the seq2seq model for a single beam.\n * @param {PreTrainedModel} self The seq2seq model object.\n * @param {Object} beam The beam search object for which to run the model.\n * @param {Object} options options\n * @param {string} [options.input_name='input_ids'] The name of the input tensor for the encoder.\n * @returns {Promise} Promise that resolves with the output of the seq2seq model for the given beam.\n * @private\n */\nasync function seq2seqRunBeam(self, beam) {\n const input_name = self.main_input_name;\n\n let decoder_input_ids = beam.output_token_ids;\n if (beam.prev_model_outputs) {\n // After the first step, `prev_model_outputs` won't be null.\n // So, we cut decoder_input_ids if past is used\n decoder_input_ids = decoder_input_ids.slice(-1);\n }\n\n // 1. Prepare\n let model_inputs = {\n [input_name]: beam.inputs,\n decoder_input_ids: toI64Tensor(decoder_input_ids),\n encoder_outputs: beam.encoder_outputs,\n past_key_values: beam.prev_model_outputs?.past_key_values,\n }\n if (beam.attention_mask) {\n model_inputs.attention_mask = beam.attention_mask\n }\n\n // 2. Run\n let output = await self.forward(model_inputs);\n\n // 3. Update\n beam.prev_model_outputs = output;\n beam.encoder_outputs = output.encoder_outputs;\n\n return output;\n}\n\n/**\n * Update a beam with a new token ID.\n * @param {Object} beam The beam to update.\n * @param {number} newTokenId The new token ID to add to the beam's output.\n * @private\n */\nfunction seq2seqUpdatebeam(beam, newTokenId) {\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\n}\n\n/**\n * Forward pass of an encoder model.\n * @param {Object} self The encoder model.\n * @param {Object} model_inputs The input data to be used for the forward pass.\n * @returns {Promise} Promise that resolves with an object containing the model's outputs.\n * @private\n */\nasync function encoderForward(self, model_inputs) {\n const encoderFeeds = Object.create(null);\n for (const key of self.session.inputNames) {\n encoderFeeds[key] = model_inputs[key];\n }\n if (self.session.inputNames.includes('token_type_ids') && !encoderFeeds.token_type_ids) {\n // Assign default `token_type_ids` (all zeroes) to the `encoderFeeds` if the model expects it,\n // but they weren't created by the tokenizer.\n encoderFeeds.token_type_ids = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor(\n 'int64',\n new BigInt64Array(encoderFeeds.input_ids.data.length),\n encoderFeeds.input_ids.dims\n )\n }\n return await sessionRun(self.session, encoderFeeds);\n}\n\n\n/**\n * Forward pass of a decoder model.\n * @param {Object} self The decoder model.\n * @param {Object} model_inputs The input data to be used for the forward pass.\n * @returns {Promise} Promise that resolves with an object containing the logits and past key values.\n * @private\n */\nasync function decoderForward(self, model_inputs) {\n let { input_ids, past_key_values, attention_mask } = model_inputs;\n let decoderFeeds = {\n input_ids: input_ids,\n attention_mask: attention_mask ?? prepareAttentionMask(self, input_ids),\n }\n const use_cache_branch = !!past_key_values;\n\n if (self.session.inputNames.includes('use_cache_branch')) {\n decoderFeeds.use_cache_branch = boolTensor(use_cache_branch);\n }\n\n preparePositionIds(self.session, decoderFeeds, use_cache_branch);\n\n self.addPastKeyValues(decoderFeeds, past_key_values);\n\n let decoderResults = await sessionRun(self.session, decoderFeeds);\n\n let logits = decoderResults.logits;\n\n past_key_values = self.getPastKeyValues(decoderResults, past_key_values);\n return { logits, past_key_values };\n}\n\n/**\n * Starts the generation of text by initializing the beams for the given input token IDs.\n * @param {Object} self The text generation model object.\n * @param {Tensor} inputTokenIds An tensor of input token IDs to generate text from.\n * @param {Object} generation_config The generation config.\n * @param {number} numOutputTokens The maximum number of tokens to generate for each beam.\n * @param {Tensor} [inputs_attention_mask] The attention mask tensor for the input token IDs.\n * @returns {Object[]} An array of beams initialized with the given inputs and parameters.\n * @private\n */\nfunction decoderStartBeams(self, inputTokenIds, generation_config, numOutputTokens, inputs_attention_mask) {\n let beams = [];\n\n let beamId = 0;\n for (let tokens of inputTokenIds) {\n let output_token_ids = tokens.tolist().map(Number);\n\n // TODO: Improve\n // Currently, just add back batch dimension.\n // In future, allow for true parallel execution\n tokens.dims = [1, ...tokens.dims]\n\n let attn_mask;\n if (inputs_attention_mask) {\n attn_mask = inputs_attention_mask[beamId];\n attn_mask.dims = [1, ...attn_mask.dims]\n\n } else {\n attn_mask = prepareAttentionMask(self, tokens)\n }\n\n let start = {\n input: tokens,\n model_input_ids: tokens,\n attention_mask: attn_mask,\n prev_model_outputs: null,\n\n output_token_ids: output_token_ids,\n num_output_tokens: numOutputTokens,\n\n done: false,\n score: 0,\n id: beamId++ // assign unique id to beams\n }\n\n beams.push(start);\n }\n return beams;\n}\n\n/**\n * Runs a single step of the text generation process for a given beam.\n *\n * @param {Object} self The decoder object.\n * @param {Object} beam The beam to run.\n * @param {Tensor} beam.input The input tensor.\n * @param {Tensor} beam.model_input_ids The input ids to the model.\n * @param {Tensor} beam.attention_mask The attention mask.\n * @param {Object} beam.prev_model_outputs The past key values.\n * @param {number[]} beam.output_token_ids The output token ids.\n * @returns {Promise} The output of the generation step.\n * @private\n */\nasync function decoderRunBeam(self, beam) {\n let attnMaskData = new BigInt64Array(beam.output_token_ids.length).fill(1n)\n\n // 1. Prepare\n let model_inputs = {\n input_ids: beam.model_input_ids,\n attention_mask: new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor(\n 'int64',\n attnMaskData,\n [1, attnMaskData.length]\n ),\n past_key_values: beam.prev_model_outputs?.past_key_values,\n }\n\n // 2. Run\n let output = await self.forward(model_inputs);\n\n // 3. Update\n beam.prev_model_outputs = output;\n\n return output;\n}\n\n/**\n * Update a beam with a new token ID.\n * @param {Object} beam The beam to update.\n * @param {number} newTokenId The new token ID to add to the beam's output.\n * @private\n */\nfunction decoderUpdatebeam(beam, newTokenId) {\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\n beam.model_input_ids = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('int64', [BigInt(newTokenId)], [1, 1]);\n}\n\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n/**\n * A base class for pre-trained models that provides the model configuration and an ONNX session.\n */\nclass PreTrainedModel extends _utils_core_js__WEBPACK_IMPORTED_MODULE_1__.Callable {\n main_input_name = 'input_ids';\n\n /**\n * Creates a new instance of the `PreTrainedModel` class.\n * @param {Object} config The model configuration.\n * @param {any} session session for the model.\n */\n constructor(config, session) {\n super();\n\n this.config = config;\n this.session = session;\n\n const modelName = MODEL_CLASS_TO_NAME_MAPPING.get(this.constructor);\n const modelType = MODEL_TYPE_MAPPING.get(modelName);\n\n this.can_generate = false;\n this._runBeam = null;\n this._getStartBeams = null;\n this._updateBeam = null;\n this._forward = null;\n if (modelType === MODEL_TYPES.DecoderOnly) {\n this.can_generate = true;\n\n this._runBeam = decoderRunBeam;\n this._getStartBeams = decoderStartBeams;\n this._updateBeam = decoderUpdatebeam;\n this._forward = decoderForward;\n\n } else if (modelType === MODEL_TYPES.Seq2Seq || modelType === MODEL_TYPES.Vision2Seq) {\n this.can_generate = true;\n\n this._runBeam = seq2seqRunBeam;\n this._getStartBeams = seq2seqStartBeams;\n this._updateBeam = seq2seqUpdatebeam;\n this._forward = seq2seqForward;\n\n } else if (modelType === MODEL_TYPES.EncoderDecoder) {\n this._forward = encoderForward;\n\n } else { // should be MODEL_TYPES.EncoderOnly\n this._forward = encoderForward;\n }\n }\n\n /**\n * Disposes of all the ONNX sessions that were created during inference.\n * @returns {Promise} An array of promises, one for each ONNX session that is being disposed.\n * @todo Use https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n */\n async dispose() {\n const promises = [];\n for (let key of Object.keys(this)) {\n const item = this[key];\n // @ts-ignore\n if (item instanceof InferenceSession) {\n promises.push(item.handler.dispose())\n }\n }\n return await Promise.all(promises);\n }\n\n /**\n * Instantiate one of the model classes of the library from a pretrained model.\n * \n * The model class to instantiate is selected based on the `model_type` property of the config object\n * (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible)\n * \n * @param {string} pretrained_model_name_or_path The name or path of the pretrained model. Can be either:\n * - A string, the *model id* of a pretrained model hosted inside a model repo on huggingface.co.\n * Valid model ids can be located at the root-level, like `bert-base-uncased`, or namespaced under a\n * user or organization name, like `dbmdz/bert-base-german-cased`.\n * - A path to a *directory* containing model weights, e.g., `./my_model_directory/`.\n * @param {import('./utils/hub.js').PretrainedOptions} options Additional options for loading the model.\n * \n * @returns {Promise} A new instance of the `PreTrainedModel` class.\n */\n static async from_pretrained(pretrained_model_name_or_path, {\n quantized = true,\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n model_file_name = null,\n } = {}) {\n\n let options = {\n quantized,\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n model_file_name,\n }\n\n const modelName = MODEL_CLASS_TO_NAME_MAPPING.get(this);\n const modelType = MODEL_TYPE_MAPPING.get(modelName);\n\n let info;\n if (modelType === MODEL_TYPES.DecoderOnly) {\n info = await Promise.all([\n _configs_js__WEBPACK_IMPORTED_MODULE_0__.AutoConfig.from_pretrained(pretrained_model_name_or_path, options),\n constructSession(pretrained_model_name_or_path, options.model_file_name ?? 'decoder_model_merged', options),\n (0,_utils_hub_js__WEBPACK_IMPORTED_MODULE_2__.getModelJSON)(pretrained_model_name_or_path, 'generation_config.json', false, options),\n ]);\n\n } else if (modelType === MODEL_TYPES.Seq2Seq || modelType === MODEL_TYPES.Vision2Seq) {\n info = await Promise.all([\n _configs_js__WEBPACK_IMPORTED_MODULE_0__.AutoConfig.from_pretrained(pretrained_model_name_or_path, options),\n constructSession(pretrained_model_name_or_path, 'encoder_model', options),\n constructSession(pretrained_model_name_or_path, 'decoder_model_merged', options),\n (0,_utils_hub_js__WEBPACK_IMPORTED_MODULE_2__.getModelJSON)(pretrained_model_name_or_path, 'generation_config.json', false, options),\n ]);\n\n } else if (modelType === MODEL_TYPES.MaskGeneration) {\n info = await Promise.all([\n _configs_js__WEBPACK_IMPORTED_MODULE_0__.AutoConfig.from_pretrained(pretrained_model_name_or_path, options),\n constructSession(pretrained_model_name_or_path, 'vision_encoder', options),\n constructSession(pretrained_model_name_or_path, 'prompt_encoder_mask_decoder', options),\n ]);\n\n } else if (modelType === MODEL_TYPES.EncoderDecoder) {\n info = await Promise.all([\n _configs_js__WEBPACK_IMPORTED_MODULE_0__.AutoConfig.from_pretrained(pretrained_model_name_or_path, options),\n constructSession(pretrained_model_name_or_path, 'encoder_model', options),\n constructSession(pretrained_model_name_or_path, 'decoder_model_merged', options),\n ]);\n\n } else { // should be MODEL_TYPES.EncoderOnly\n if (modelType !== MODEL_TYPES.EncoderOnly) {\n console.warn(`Model type for '${modelName ?? config?.model_type}' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.`)\n }\n info = await Promise.all([\n _configs_js__WEBPACK_IMPORTED_MODULE_0__.AutoConfig.from_pretrained(pretrained_model_name_or_path, options),\n constructSession(pretrained_model_name_or_path, options.model_file_name ?? 'model', options)\n ]);\n }\n\n // @ts-ignore\n return new this(...info);\n }\n\n /**\n * Runs the model with the provided inputs\n * @param {Object} model_inputs Object containing input tensors\n * @returns {Promise} Object containing output tensors\n */\n async _call(model_inputs) {\n return await this.forward(model_inputs);\n }\n\n /**\n * Forward method for a pretrained model. If not overridden by a subclass, the correct forward method\n * will be chosen based on the model type.\n * @param {Object} model_inputs The input data to the model in the format specified in the ONNX model.\n * @returns {Promise} The output data from the model in the format specified in the ONNX model.\n * @throws {Error} This method must be implemented in subclasses.\n */\n async forward(model_inputs) {\n return await this._forward(this, model_inputs);\n }\n\n /**\n * @param {import('./utils/generation.js').GenerationConfigType} generation_config \n * @param {number} input_ids_seq_length The starting sequence length for the input ids.\n * @returns {LogitsProcessorList}\n * @private\n */\n _get_logits_processor(\n generation_config,\n input_ids_seq_length,\n // encoder_input_ids, TODO\n // prefix_allowed_tokens_fn, TODO\n logits_processor = null\n ) {\n const processors = new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.LogitsProcessorList();\n\n // if (generation_config.diversity_penalty !== null && generation_config.diversity_penalty > 0.0) {\n // processors.push(new HammingDiversityLogitsProcessor(\n // generation_config.diversity_penalty,\n // generation_config.num_beams,\n // generation_config.num_beam_groups\n // ));\n // }\n\n // if (generation_config.encoder_repetition_penalty !== null && generation_config.encoder_repetition_penalty !== 1.0) {\n // processors.push(new EncoderRepetitionPenaltyLogitsProcessor(\n // generation_config.encoder_repetition_penalty,\n // encoder_input_ids\n // ));\n // }\n\n if (generation_config.repetition_penalty !== null && generation_config.repetition_penalty !== 1.0) {\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.RepetitionPenaltyLogitsProcessor(generation_config.repetition_penalty));\n }\n\n if (generation_config.no_repeat_ngram_size !== null && generation_config.no_repeat_ngram_size > 0) {\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.NoRepeatNGramLogitsProcessor(generation_config.no_repeat_ngram_size));\n }\n\n // if (generation_config.encoder_no_repeat_ngram_size !== null && generation_config.encoder_no_repeat_ngram_size > 0) {\n // if (this.config.is_encoder_decoder) {\n // processors.push(new EncoderNoRepeatNGramLogitsProcessor(\n // generation_config.encoder_no_repeat_ngram_size,\n // encoder_input_ids\n // ));\n // } else {\n // throw new Error(\"It's impossible to use `encoder_no_repeat_ngram_size` with decoder-only architecture\");\n // }\n // }\n\n if (generation_config.bad_words_ids !== null) {\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.NoBadWordsLogitsProcessor(generation_config.bad_words_ids, generation_config.eos_token_id));\n }\n\n if (generation_config.min_length !== null && generation_config.eos_token_id !== null && generation_config.min_length > 0) {\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.MinLengthLogitsProcessor(generation_config.min_length, generation_config.eos_token_id));\n }\n\n if (generation_config.min_new_tokens !== null && generation_config.eos_token_id !== null && generation_config.min_new_tokens > 0) {\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.MinNewTokensLengthLogitsProcessor(\n input_ids_seq_length,\n generation_config.min_new_tokens,\n generation_config.eos_token_id\n ));\n }\n\n // if (prefix_allowed_tokens_fn !== null) {\n // processors.push(new PrefixConstrainedLogitsProcessor(\n // prefix_allowed_tokens_fn,\n // generation_config.num_beams / generation_config.num_beam_groups\n // ));\n // }\n\n\n if (generation_config.forced_bos_token_id !== null) {\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.ForcedBOSTokenLogitsProcessor(generation_config.forced_bos_token_id));\n }\n\n if (generation_config.forced_eos_token_id !== null) {\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.ForcedEOSTokenLogitsProcessor(\n generation_config.max_length,\n generation_config.forced_eos_token_id\n ));\n }\n\n // if (generation_config.remove_invalid_values === true) {\n // processors.push(new InfNanRemoveLogitsProcessor());\n // }\n\n // if (generation_config.exponential_decay_length_penalty !== null) {\n // processors.push(new ExponentialDecayLengthPenalty(\n // generation_config.exponential_decay_length_penalty,\n // generation_config.eos_token_id,\n // input_ids_seq_length\n // ));\n // }\n\n // if (generation_config.suppress_tokens !== null) {\n // processors.push(new SuppressTokensLogitsProcessor(generation_config.suppress_tokens));\n // }\n\n if (generation_config.begin_suppress_tokens !== null) {\n let begin_index = (input_ids_seq_length > 1 || generation_config.forced_bos_token_id === null)\n ? input_ids_seq_length\n : input_ids_seq_length + 1;\n\n if (generation_config.forced_decoder_ids !== null) {\n // generation starts after the last token that is forced\n begin_index += generation_config.forced_decoder_ids[generation_config.forced_decoder_ids.length - 1][0];\n }\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.SuppressTokensAtBeginLogitsProcessor(generation_config.begin_suppress_tokens, begin_index));\n }\n\n if (generation_config.forced_decoder_ids !== null) {\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.ForceTokensLogitsProcessor(generation_config.forced_decoder_ids));\n }\n\n if (logits_processor !== null) {\n processors.extend(logits_processor)\n }\n\n // `LogitNormalization` should always be the last logit processor, when present\n // if (generation_config.renormalize_logits === true) {\n // processors.push(new LogitNormalization());\n // }\n\n return processors;\n }\n\n /**\n * This function merges multiple generation configs together to form a final generation config to be used by the model for text generation.\n * It first creates an empty `GenerationConfig` object, then it applies the model's own `generation_config` property to it. Finally, if a `generation_config` object was passed in the arguments, it overwrites the corresponding properties in the final config with those of the passed config object.\n * @param {import('./utils/generation.js').GenerationConfigType} generation_config A `GenerationConfig` object containing generation parameters.\n * @returns {import('./utils/generation.js').GenerationConfigType} The final generation config object to be used by the model for text generation.\n */\n _get_generation_config(generation_config) {\n // Create empty generation config (contains defaults)\n // We pass `this.config` so that if `eos_token_id` or `bos_token_id` exist in the model's config, we will use them\n let gen_config = new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.GenerationConfig(this.config);\n\n // Apply model's generation config, if it exists\n if ('generation_config' in this) {\n Object.assign(gen_config, this.generation_config);\n }\n\n // Finally, use any generation config specified by the user\n // when calling `generate`\n if (generation_config !== null) {\n Object.assign(gen_config, generation_config);\n }\n return gen_config;\n }\n\n /**\n * @typedef {import('./utils/maths.js').TypedArray} TypedArray\n */\n\n /**\n * @typedef {{ sequences: Tensor, decoder_attentions: Tensor, cross_attentions: Tensor }} EncoderDecoderOutput\n * @typedef {Object} DecoderOutput\n * \n * Generates text based on the given inputs and generation configuration using the model.\n * @param {Tensor|Array|TypedArray} inputs An array of input token IDs.\n * @param {Object|GenerationConfig|null} generation_config The generation configuration to use. If null, default configuration will be used.\n * @param {Object|null} logits_processor An optional logits processor to use. If null, a new LogitsProcessorList instance will be created.\n * @param {Object} options options\n * @param {Object} [options.inputs_attention_mask=null] An optional attention mask for the inputs.\n * @returns {Promise} An array of generated output sequences, where each sequence is an array of token IDs.\n * @throws {Error} Throws an error if the inputs array is empty.\n */\n async generate(\n inputs,\n generation_config = null,\n logits_processor = null,\n {\n inputs_attention_mask = null\n } = {},\n ) {\n if (!this.can_generate) {\n const modelName = MODEL_CLASS_TO_NAME_MAPPING.get(this.constructor);\n let errorMessage = `The current model class (${modelName}) is not compatible with \\`.generate()\\`, as it doesn't have a language model head.`\n\n const modelType = this.config.model_type;\n const possibleInfo =\n MODEL_WITH_LM_HEAD_MAPPING_NAMES.get(modelType)\n ?? MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES.get(modelType)\n ?? MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES.get(modelType)\n // ?? MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES.get(modelType) // TODO\n ?? MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES.get(modelType);\n\n if (possibleInfo) {\n // TODO: support multiple possible classes\n errorMessage += ` Please use the following class instead: '${possibleInfo[0]}'`;\n }\n throw Error(errorMessage);\n }\n\n if (!(inputs instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor) && !(0,_utils_core_js__WEBPACK_IMPORTED_MODULE_1__.isTypedArray)(inputs) && !Array.isArray(inputs)) {\n throw Error(`\\`inputs\\` must be a Tensor, TypedArray, or Array, but is \"${inputs.constructor.name}\".`);\n }\n\n let input_ids_seq_length;\n\n // Prepare `input_ids` which will be used for auto-regressive generation\n // TODO: Update to align with HF transformers' implementation\n if (this.config.is_encoder_decoder) {\n // Generating from the encoder outputs\n input_ids_seq_length = 0;\n\n } else {\n input_ids_seq_length = inputs instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor ? inputs.dims.at(-1) : inputs.length;\n\n // decoder-only\n if (input_ids_seq_length === 0) {\n throw Error(\"Must supply a non-empty array of input token ids.\")\n }\n }\n\n // Update generation config with defaults\n generation_config = this._get_generation_config(generation_config);\n\n logits_processor = logits_processor ?? new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.LogitsProcessorList()\n\n // Update logits processor\n logits_processor = this._get_logits_processor(\n generation_config,\n input_ids_seq_length,\n logits_processor\n )\n\n /** @type {number[]} */\n let eos_token_ids = generation_config.eos_token_id;\n if (eos_token_ids !== null && !Array.isArray(eos_token_ids)) {\n eos_token_ids = [eos_token_ids];\n }\n\n // TODO implement early_stopping\n // https://huggingface.co/blog/how-to-generate\n\n let numOutputTokens = 1;\n const maxOutputTokens = numOutputTokens + (generation_config.max_new_tokens ?? Infinity);\n\n // Only use max length if max_new_tokens is not provided\n const useMaxLength = Number.isInteger(generation_config.max_length) && (generation_config.max_new_tokens ?? null) === null;\n let sampler = _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.Sampler.getSampler(generation_config);\n\n // @ts-ignore\n let beams = this.getStartBeams(inputs, generation_config, numOutputTokens, inputs_attention_mask);\n\n while (beams.some(x => !x.done) && numOutputTokens < maxOutputTokens) {\n let newest_beams = [];\n for (let beam of beams) {\n if (beam.done) {\n // Add this beam back into the pool\n newest_beams.push(beam);\n continue\n }\n if (useMaxLength && beam.output_token_ids.length >= generation_config.max_length) {\n // Set this beam to done and add it back into the pool\n beam.done = true;\n newest_beams.push(beam);\n continue\n }\n\n // @ts-ignore\n let output = await this.runBeam(beam);\n\n // add attentions/scores to beam only if user requested\n if (generation_config.output_attentions) {\n this.addAttentionsToBeam(beam, output);\n }\n if (generation_config.output_scores) {\n // TODO add\n }\n\n // Logits are of the form [batch_size, out_seq_length, vocab_size]\n // In most cases, this will be [batch_size, 1, vocab_size]\n // So, we select the last token's logits:\n // (equivalent to `logits = outputs.logits[:, -1, :]`)\n let logits = output.logits.slice(null, -1, null);\n\n // Apply logits processor\n logits_processor(beam.output_token_ids, logits);\n\n let sampledTokens = sampler(logits);\n for (let [newTokenId, logProb] of sampledTokens) {\n // use previous beam as a starting point\n let newBeam = { ...beam };\n\n // update new beam\n // @ts-ignore\n this.updateBeam(newBeam, newTokenId);\n\n newBeam.score += logProb;\n\n if (eos_token_ids && eos_token_ids.includes(newTokenId)) {\n newBeam.done = true;\n }\n\n newest_beams.push(newBeam);\n }\n }\n ++numOutputTokens;\n\n // Next, we get the best beams, per ID\n newest_beams = this.groupBeams(newest_beams).map(\n group => group\n .sort((a, b) => b.score - a.score) // sort by score\n .slice(0, generation_config.num_beams) // remove outside beam width\n );\n\n // Flatten beams\n beams = newest_beams.flat();\n\n // Run callback\n if (generation_config.callback_function) {\n generation_config.callback_function(beams);\n }\n }\n\n // TODO: Ensure that we can return non-batched outputs\n\n const groupedBeams = this.groupBeams(beams);\n\n const getFlattened = (key) => groupedBeams.map(\n batch => {\n if (generation_config.num_return_sequences > 1) {\n return batch.slice(0, generation_config.num_return_sequences).map(x => x[key]);\n } else {\n return [batch[0][key]];\n }\n }\n ).flat(); // Flatten across batches (depth=1)\n\n const sequences = getFlattened('output_token_ids'); // [1, seqLength]\n\n if (generation_config.return_dict_in_generate) {\n // NOTE: `decoder_attentions` and `cross_attentions` should be:\n // list (one element for each generated token)\n // of list (one element for each layer of the decoder)\n // of torch.FloatTensor of shape (batch_size, num_heads, generated_length, sequence_length)\n // However, since we are only generating one batch at a time, they are of the form:\n // list (batches)\n // of list (one element for each generated token)\n // of list (one element for each layer of the decoder)\n // of torch.FloatTensor of shape (1, num_heads, generated_length, sequence_length)\n // \n // TODO: In future (when true parallelism, we should be able to return the correct shape)\n\n const decoder_attentions = getFlattened('decoder_attentions');\n const cross_attentions = getFlattened('cross_attentions');\n\n return {\n sequences,\n\n decoder_attentions,\n cross_attentions,\n }\n } else {\n return sequences;\n }\n }\n\n /**\n * Helper function to add attentions to beam\n * @param {Object} beam \n * @param {Object} output\n * @private \n */\n addAttentionsToBeam(beam, output) {\n if (this.config.is_encoder_decoder) {\n if (!output.cross_attentions || output.cross_attentions.length === 0) {\n throw Error(\n \"`output_attentions` is true, but the model did not produce cross-attentions. \" +\n \"This is most likely because the model was not exported with `output_attentions=True`.\"\n )\n }\n if (!beam.cross_attentions) {\n beam.cross_attentions = [];\n }\n beam.cross_attentions.push(output.cross_attentions);\n }\n\n if (!output.decoder_attentions || output.decoder_attentions.length === 0) {\n throw Error(\n \"`output_attentions` is true, but the model did not produce decoder-attentions. \" +\n \"This is most likely because the model was not exported with `output_attentions=True`.\"\n )\n }\n if (!beam.decoder_attentions) {\n beam.decoder_attentions = [];\n }\n beam.decoder_attentions.push(output.decoder_attentions);\n }\n\n /**\n * Groups an array of beam objects by their ids.\n *\n * @param {Array} beams The array of beam objects to group.\n * @returns {Array} An array of arrays, where each inner array contains beam objects with the same id.\n */\n groupBeams(beams) {\n // Group beams by their ids\n const groups = Object.create(null);\n for (const obj of beams) {\n if (groups[obj.id] === undefined) {\n groups[obj.id] = [obj];\n } else {\n groups[obj.id].push(obj);\n }\n }\n\n return Object.values(groups);\n }\n\n /**\n * Returns an object containing past key values from the given decoder results object.\n *\n * @param {Object} decoderResults The decoder results object.\n * @param {Object} pastKeyValues The previous past key values.\n * @returns {Object} An object containing past key values.\n */\n getPastKeyValues(decoderResults, pastKeyValues) {\n\n const pkvs = Object.create(null);\n\n for (const name in decoderResults) {\n if (name.startsWith('present')) {\n let newName = name.replace('present', 'past_key_values');\n\n if (pastKeyValues && name.includes('encoder')) {\n // Optimization introduced by optimum to reuse past key values. So, we just replace the constant\n // outputs with the previous past key values.\n // https://github.com/huggingface/optimum/blob/0bf2c05fb7e1182b52d21b703cfc95fd9e4ea3dc/optimum/onnxruntime/base.py#L677-L704\n pkvs[newName] = pastKeyValues[newName];\n } else {\n pkvs[newName] = decoderResults[name];\n }\n }\n }\n return pkvs;\n }\n\n /**\n * Returns an object containing attentions from the given decoder results object.\n *\n * @param {Object} decoderResults The decoder results object.\n * @returns {Object} An object containing attentions.\n */\n getAttentions(decoderResults) {\n const attns = Object.create(null);\n\n for (const attnName of ['cross_attentions', 'decoder_attentions']) {\n const result = [];\n for (const name in decoderResults) {\n if (name.startsWith(attnName)) {\n const index = name.split('.').pop()\n result[index] = decoderResults[name];\n }\n }\n attns[attnName] = result;\n }\n return attns;\n }\n\n /**\n * Adds past key values to the decoder feeds object. If pastKeyValues is null, creates new tensors for past key values.\n *\n * @param {Object} decoderFeeds The decoder feeds object to add past key values to.\n * @param {Object} pastKeyValues An object containing past key values.\n */\n addPastKeyValues(decoderFeeds, pastKeyValues) {\n if (pastKeyValues) {\n Object.assign(decoderFeeds, pastKeyValues)\n } else {\n // TODO support batches (i.e., batch_size > 1)\n const batch_size = 1;\n\n // @ts-ignore\n if (this.config.is_encoder_decoder && (this.add_encoder_pkv ?? true)) {\n // @ts-ignore\n let encoder_dims = [batch_size, this.num_encoder_heads, 0, this.encoder_dim_kv];\n // @ts-ignore\n let decoder_dims = [batch_size, this.num_decoder_heads, 0, this.decoder_dim_kv];\n // @ts-ignore\n for (let i = 0; i < this.num_decoder_layers; ++i) {\n decoderFeeds[`past_key_values.${i}.encoder.key`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], encoder_dims)\n decoderFeeds[`past_key_values.${i}.encoder.value`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], encoder_dims)\n decoderFeeds[`past_key_values.${i}.decoder.key`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], decoder_dims)\n decoderFeeds[`past_key_values.${i}.decoder.value`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], decoder_dims)\n }\n } else if (this.config.model_type === 'falcon') {\n // NOTE: Custom implementation for Falcon\n // @ts-ignore\n let dims = [batch_size * this.num_heads, 0, this.dim_kv]\n // @ts-ignore\n for (let i = 0; i < this.num_layers; ++i) {\n decoderFeeds[`past_key_values.${i}.key`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], dims)\n decoderFeeds[`past_key_values.${i}.value`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], dims)\n }\n } else if (this.config.multi_query) { // e.g., for `gpt_bigcode`\n // @ts-ignore\n let dims = [batch_size * this.num_heads, 0, 2 * this.dim_kv]\n // @ts-ignore\n for (let i = 0; i < this.num_layers; ++i) {\n decoderFeeds[`past_key_values.${i}.key_value`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], dims)\n }\n } else if (this.config.model_type === 'bloom') {\n // NOTE: Custom implementation for Bloom\n\n // @ts-ignore\n let keyDims = [batch_size * this.num_heads, this.dim_kv, 0] // [batch_size x num_heads,64,past_sequence_length]\n // @ts-ignore\n let valueDims = [batch_size * this.num_heads, 0, this.dim_kv] // [batch_size x num_heads,past_sequence_length,64]\n // @ts-ignore\n for (let i = 0; i < this.num_layers; ++i) {\n decoderFeeds[`past_key_values.${i}.key`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], keyDims)\n decoderFeeds[`past_key_values.${i}.value`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], valueDims)\n }\n } else { // Decoder-only\n // @ts-ignore\n let dims = [batch_size, this.num_heads, 0, this.dim_kv]\n // @ts-ignore\n for (let i = 0; i < this.num_layers; ++i) {\n decoderFeeds[`past_key_values.${i}.key`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], dims)\n decoderFeeds[`past_key_values.${i}.value`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], dims)\n }\n }\n }\n }\n\n /**\n * Initializes and returns the beam for text generation task\n * @param {Tensor} inputTokenIds The input token ids.\n * @param {Object} generation_config The generation config.\n * @param {number} numOutputTokens The number of tokens to be generated.\n * @param {Tensor} inputs_attention_mask Optional input attention mask.\n * @returns {any} A Beam object representing the initialized beam.\n * @private\n */\n getStartBeams(inputTokenIds, generation_config, numOutputTokens, inputs_attention_mask) {\n return this._getStartBeams(this, inputTokenIds, generation_config, numOutputTokens, inputs_attention_mask)\n }\n\n /**\n * Runs a single step of the beam search generation algorithm.\n * @param {any} beam The current beam being generated.\n * @returns {Promise} The updated beam after a single generation step.\n * @private\n */\n async runBeam(beam) {\n return await this._runBeam(this, beam);\n }\n\n /**\n * Update a beam with a new token ID.\n * @param {Object} beam The beam to update.\n * @param {number} newTokenId The new token ID to add to the beam's output.\n * @private\n */\n updateBeam(beam, newTokenId) {\n return this._updateBeam(beam, newTokenId);\n }\n}\n\n//////////////////////////////////////////////////\n// Base model output class\nclass ModelOutput { }\n\n/**\n * Base class for model's outputs, with potential hidden states and attentions.\n */\nclass BaseModelOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.last_hidden_state Sequence of hidden-states at the output of the last layer of the model.\n * @param {Tensor} [output.hidden_states] Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.\n * @param {Tensor} [output.attentions] Attentions weights after the attention softmax, used to compute the weighted average in the self-attention heads.\n */\n constructor({ last_hidden_state, hidden_states = null, attentions = null }) {\n super();\n this.last_hidden_state = last_hidden_state;\n this.hidden_states = hidden_states;\n this.attentions = attentions;\n }\n}\n//////////////////////////////////////////////////\n// Bert models\nclass BertPreTrainedModel extends PreTrainedModel { }\nclass BertModel extends BertPreTrainedModel { }\n\n/**\n * BertForMaskedLM is a class representing a BERT model for masked language modeling.\n */\nclass BertForMaskedLM extends BertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * BertForSequenceClassification is a class representing a BERT model for sequence classification.\n */\nclass BertForSequenceClassification extends BertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * BertForTokenClassification is a class representing a BERT model for token classification.\n */\nclass BertForTokenClassification extends BertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * BertForQuestionAnswering is a class representing a BERT model for question answering.\n */\nclass BertForQuestionAnswering extends BertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// NomicBert models\nclass NomicBertPreTrainedModel extends PreTrainedModel { }\nclass NomicBertModel extends NomicBertPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// RoFormer models\nclass RoFormerPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare RoFormer Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass RoFormerModel extends RoFormerPreTrainedModel { }\n\n/**\n * RoFormer Model with a `language modeling` head on top.\n */\nclass RoFormerForMaskedLM extends RoFormerPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RoFormer Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nclass RoFormerForSequenceClassification extends RoFormerPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RoFormer Model with a token classification head on top (a linear layer on top of the hidden-states output)\n * e.g. for Named-Entity-Recognition (NER) tasks.\n */\nclass RoFormerForTokenClassification extends RoFormerPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RoFormer Model with a span classification head on top for extractive question-answering tasks like SQuAD\n * (a linear layers on top of the hidden-states output to compute `span start logits` and `span end logits`).\n */\nclass RoFormerForQuestionAnswering extends RoFormerPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n// TODO: Add RoFormerForCausalLM and RoFormerForMultipleChoice\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// ConvBert models\nclass ConvBertPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare ConvBERT Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass ConvBertModel extends ConvBertPreTrainedModel { }\n\n/**\n * ConvBERT Model with a language modeling head on top.\n */\nclass ConvBertForMaskedLM extends ConvBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ConvBERT Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nclass ConvBertForSequenceClassification extends ConvBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ConvBERT Model with a token classification head on top (a linear layer on top of the hidden-states output)\n * e.g. for Named-Entity-Recognition (NER) tasks.\n */\nclass ConvBertForTokenClassification extends ConvBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ConvBERT Model with a span classification head on top for extractive question-answering tasks like SQuAD\n * (a linear layers on top of the hidden-states output to compute `span start logits` and `span end logits`)\n */\nclass ConvBertForQuestionAnswering extends ConvBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Electra models\nclass ElectraPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Electra Model transformer outputting raw hidden-states without any specific head on top.\n * Identical to the BERT model except that it uses an additional linear layer between the embedding\n * layer and the encoder if the hidden size and embedding size are different.\n */\nclass ElectraModel extends ElectraPreTrainedModel { }\n// TODO add ElectraForPreTraining\n/**\n * Electra model with a language modeling head on top.\n */\nclass ElectraForMaskedLM extends ElectraPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ELECTRA Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nclass ElectraForSequenceClassification extends ElectraPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * Electra model with a token classification head on top.\n */\nclass ElectraForTokenClassification extends ElectraPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * LECTRA Model with a span classification head on top for extractive question-answering tasks like SQuAD\n * (a linear layers on top of the hidden-states output to compute `span start logits` and `span end logits`).\n */\nclass ElectraForQuestionAnswering extends ElectraPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// CamemBERT models\nclass CamembertPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare CamemBERT Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass CamembertModel extends CamembertPreTrainedModel { }\n\n/**\n * CamemBERT Model with a `language modeling` head on top.\n */\nclass CamembertForMaskedLM extends CamembertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * CamemBERT Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g. for GLUE tasks.\n */\nclass CamembertForSequenceClassification extends CamembertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * CamemBERT Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks.\n */\nclass CamembertForTokenClassification extends CamembertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * CamemBERT Model with a span classification head on top for extractive question-answering tasks\n */\nclass CamembertForQuestionAnswering extends CamembertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// DeBERTa models\nclass DebertaPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare DeBERTa Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass DebertaModel extends DebertaPreTrainedModel { }\n\n/**\n * DeBERTa Model with a `language modeling` head on top.\n */\nclass DebertaForMaskedLM extends DebertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nclass DebertaForSequenceClassification extends DebertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks.\n */\nclass DebertaForTokenClassification extends DebertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear\n * layers on top of the hidden-states output to compute `span start logits` and `span end logits`).\n */\nclass DebertaForQuestionAnswering extends DebertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// DeBERTa-v2 models\nclass DebertaV2PreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare DeBERTa-V2 Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass DebertaV2Model extends DebertaV2PreTrainedModel { }\n\n/**\n * DeBERTa-V2 Model with a `language modeling` head on top.\n */\nclass DebertaV2ForMaskedLM extends DebertaV2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa-V2 Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nclass DebertaV2ForSequenceClassification extends DebertaV2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa-V2 Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks.\n */\nclass DebertaV2ForTokenClassification extends DebertaV2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa-V2 Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear\n * layers on top of the hidden-states output to compute `span start logits` and `span end logits`).\n */\nclass DebertaV2ForQuestionAnswering extends DebertaV2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// DistilBert models\nclass DistilBertPreTrainedModel extends PreTrainedModel { }\nclass DistilBertModel extends DistilBertPreTrainedModel { }\n\n/**\n * DistilBertForSequenceClassification is a class representing a DistilBERT model for sequence classification.\n */\nclass DistilBertForSequenceClassification extends DistilBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DistilBertForTokenClassification is a class representing a DistilBERT model for token classification.\n */\nclass DistilBertForTokenClassification extends DistilBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n\n/**\n * DistilBertForQuestionAnswering is a class representing a DistilBERT model for question answering.\n */\nclass DistilBertForQuestionAnswering extends DistilBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DistilBertForMaskedLM is a class representing a DistilBERT model for masking task.\n */\nclass DistilBertForMaskedLM extends DistilBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// ESM models\nclass EsmPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare ESM Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass EsmModel extends EsmPreTrainedModel { }\n\n/**\n * ESM Model with a `language modeling` head on top.\n */\nclass EsmForMaskedLM extends EsmPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ESM Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nclass EsmForSequenceClassification extends EsmPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ESM Model with a token classification head on top (a linear layer on top of the hidden-states output)\n * e.g. for Named-Entity-Recognition (NER) tasks.\n */\nclass EsmForTokenClassification extends EsmPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// MobileBert models\nclass MobileBertPreTrainedModel extends PreTrainedModel { }\nclass MobileBertModel extends MobileBertPreTrainedModel { }\n\n/**\n * MobileBertForMaskedLM is a class representing a MobileBERT model for masking task.\n */\nclass MobileBertForMaskedLM extends MobileBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * MobileBert Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nclass MobileBertForSequenceClassification extends MobileBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * MobileBert Model with a span classification head on top for extractive question-answering tasks\n */\nclass MobileBertForQuestionAnswering extends MobileBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// MPNet models\nclass MPNetPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare MPNet Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass MPNetModel extends MPNetPreTrainedModel { }\n\n/**\n * MPNetForMaskedLM is a class representing a MPNet model for masked language modeling.\n */\nclass MPNetForMaskedLM extends MPNetPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * MPNetForSequenceClassification is a class representing a MPNet model for sequence classification.\n */\nclass MPNetForSequenceClassification extends MPNetPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * MPNetForTokenClassification is a class representing a MPNet model for token classification.\n */\nclass MPNetForTokenClassification extends MPNetPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * MPNetForQuestionAnswering is a class representing a MPNet model for question answering.\n */\nclass MPNetForQuestionAnswering extends MPNetPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// SqueezeBert models\nclass SqueezeBertPreTrainedModel extends PreTrainedModel { }\nclass SqueezeBertModel extends SqueezeBertPreTrainedModel { }\nclass SqueezeBertForMaskedLM extends SqueezeBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\nclass SqueezeBertForSequenceClassification extends SqueezeBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\nclass SqueezeBertForQuestionAnswering extends SqueezeBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Albert models\nclass AlbertPreTrainedModel extends PreTrainedModel { }\nclass AlbertModel extends AlbertPreTrainedModel { }\nclass AlbertForSequenceClassification extends AlbertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\nclass AlbertForQuestionAnswering extends AlbertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\nclass AlbertForMaskedLM extends AlbertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// T5 models\nclass T5PreTrainedModel extends PreTrainedModel { };\n\nclass T5Model extends T5PreTrainedModel { }\n\n/**\n * T5Model is a class representing a T5 model for conditional generation.\n */\nclass T5ForConditionalGeneration extends T5PreTrainedModel {\n\n /**\n * Creates a new instance of the `T5ForConditionalGeneration` class.\n * @param {Object} config The model configuration.\n * @param {any} session session for the model.\n * @param {any} decoder_merged_session session for the decoder.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.num_decoder_layers;\n this.num_decoder_heads = this.config.num_heads;\n this.decoder_dim_kv = this.config.d_kv;\n\n this.num_encoder_layers = this.config.num_layers;\n this.num_encoder_heads = this.config.num_heads;\n this.encoder_dim_kv = this.config.d_kv;\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// LONGT5 models\n/**\n * An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.\n */\nclass LongT5PreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare LONGT5 Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass LongT5Model extends LongT5PreTrainedModel { }\n\n/**\n * LONGT5 Model with a `language modeling` head on top.\n */\nclass LongT5ForConditionalGeneration extends LongT5PreTrainedModel {\n /**\n * Creates a new instance of the `LongT5ForConditionalGeneration` class.\n * @param {Object} config The model configuration.\n * @param {any} session session for the model.\n * @param {any} decoder_merged_session session for the decoder.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.num_decoder_layers;\n this.num_decoder_heads = this.config.num_heads;\n this.decoder_dim_kv = this.config.d_kv;\n\n this.num_encoder_layers = this.config.num_layers;\n this.num_encoder_heads = this.config.num_heads;\n this.encoder_dim_kv = this.config.d_kv;\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// MT5 models\nclass MT5PreTrainedModel extends PreTrainedModel { };\n\nclass MT5Model extends MT5PreTrainedModel { }\n\n/**\n * A class representing a conditional sequence-to-sequence model based on the MT5 architecture.\n */\nclass MT5ForConditionalGeneration extends MT5PreTrainedModel {\n\n /**\n * Creates a new instance of the `MT5ForConditionalGeneration` class.\n * @param {any} config The model configuration.\n * @param {any} session The ONNX session containing the encoder weights.\n * @param {any} decoder_merged_session The ONNX session containing the merged decoder weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.num_decoder_layers;\n this.num_decoder_heads = this.config.num_heads;\n this.decoder_dim_kv = this.config.d_kv;\n\n this.num_encoder_layers = this.config.num_layers;\n this.num_encoder_heads = this.config.num_heads;\n this.encoder_dim_kv = this.config.d_kv;\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Bart models\nclass BartPretrainedModel extends PreTrainedModel { };\n\n/**\n * The bare BART Model outputting raw hidden-states without any specific head on top.\n */\nclass BartModel extends BartPretrainedModel { }\n\n/**\n * The BART Model with a language modeling head. Can be used for summarization.\n */\nclass BartForConditionalGeneration extends BartPretrainedModel {\n\n /**\n * Creates a new instance of the `BartForConditionalGeneration` class.\n * @param {Object} config The configuration object for the Bart model.\n * @param {Object} session The ONNX session used to execute the model.\n * @param {Object} decoder_merged_session The ONNX session used to execute the decoder.\n * @param {Object} generation_config The generation configuration object.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n\n}\n\n/**\n * Bart model with a sequence classification/head on top (a linear layer on top of the pooled output)\n */\nclass BartForSequenceClassification extends BartPretrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// MBart models\nclass MBartPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare MBART Model outputting raw hidden-states without any specific head on top.\n */\nclass MBartModel extends MBartPreTrainedModel { }\n\n/**\n * The MBART Model with a language modeling head. Can be used for summarization, after fine-tuning the pretrained models.\n */\nclass MBartForConditionalGeneration extends MBartPreTrainedModel {\n\n /**\n * Creates a new instance of the `MBartForConditionalGeneration` class.\n * @param {Object} config The configuration object for the Bart model.\n * @param {Object} session The ONNX session used to execute the model.\n * @param {Object} decoder_merged_session The ONNX session used to execute the decoder.\n * @param {Object} generation_config The generation configuration object.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n\n}\n\n/**\n * MBart model with a sequence classification/head on top (a linear layer on top of the pooled output).\n */\nclass MBartForSequenceClassification extends MBartPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n\nclass MBartForCausalLM extends MBartPreTrainedModel {\n /**\n * Creates a new instance of the `MBartForCausalLM` class.\n * @param {Object} config Configuration object for the model.\n * @param {Object} decoder_merged_session ONNX Session object for the decoder.\n * @param {Object} generation_config Configuration object for the generation process.\n */\n constructor(config, decoder_merged_session, generation_config) {\n super(config, decoder_merged_session);\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Blenderbot models\nclass BlenderbotPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare Blenderbot Model outputting raw hidden-states without any specific head on top.\n */\nclass BlenderbotModel extends BlenderbotPreTrainedModel { }\n\n/**\n * The Blenderbot Model with a language modeling head. Can be used for summarization.\n */\nclass BlenderbotForConditionalGeneration extends BlenderbotPreTrainedModel {\n\n /**\n * Creates a new instance of the `BlenderbotForConditionalGeneration` class.\n * @param {any} config The model configuration.\n * @param {any} session The ONNX session containing the encoder weights.\n * @param {any} decoder_merged_session The ONNX session containing the merged decoder weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Blenderbot models\nclass BlenderbotSmallPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare BlenderbotSmall Model outputting raw hidden-states without any specific head on top.\n */\nclass BlenderbotSmallModel extends BlenderbotSmallPreTrainedModel { }\n\n/**\n * The BlenderbotSmall Model with a language modeling head. Can be used for summarization.\n */\nclass BlenderbotSmallForConditionalGeneration extends BlenderbotSmallPreTrainedModel {\n\n /**\n * Creates a new instance of the `BlenderbotForConditionalGeneration` class.\n * @param {any} config The model configuration.\n * @param {any} session The ONNX session containing the encoder weights.\n * @param {any} decoder_merged_session The ONNX session containing the merged decoder weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Roberta models\nclass RobertaPreTrainedModel extends PreTrainedModel { }\nclass RobertaModel extends RobertaPreTrainedModel { }\n\n/**\n * RobertaForMaskedLM class for performing masked language modeling on Roberta models.\n */\nclass RobertaForMaskedLM extends RobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RobertaForSequenceClassification class for performing sequence classification on Roberta models.\n */\nclass RobertaForSequenceClassification extends RobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RobertaForTokenClassification class for performing token classification on Roberta models.\n */\nclass RobertaForTokenClassification extends RobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RobertaForQuestionAnswering class for performing question answering on Roberta models.\n */\nclass RobertaForQuestionAnswering extends RobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// XLM models\n/**\n * An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.\n */\nclass XLMPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare XLM Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass XLMModel extends XLMPreTrainedModel { }\n\n/**\n * The XLM Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).\n */\nclass XLMWithLMHeadModel extends XLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLM Model with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nclass XLMForSequenceClassification extends XLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLM Model with a token classification head on top (a linear layer on top of the hidden-states output)\n */\nclass XLMForTokenClassification extends XLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLM Model with a span classification head on top for extractive question-answering tasks\n */\nclass XLMForQuestionAnswering extends XLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// XLMRoberta models\nclass XLMRobertaPreTrainedModel extends PreTrainedModel { }\nclass XLMRobertaModel extends XLMRobertaPreTrainedModel { }\n\n/**\n * XLMRobertaForMaskedLM class for performing masked language modeling on XLMRoberta models.\n */\nclass XLMRobertaForMaskedLM extends XLMRobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLMRobertaForSequenceClassification class for performing sequence classification on XLMRoberta models.\n */\nclass XLMRobertaForSequenceClassification extends XLMRobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLMRobertaForTokenClassification class for performing token classification on XLMRoberta models.\n */\nclass XLMRobertaForTokenClassification extends XLMRobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLMRobertaForQuestionAnswering class for performing question answering on XLMRoberta models.\n */\nclass XLMRobertaForQuestionAnswering extends XLMRobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Audio Spectrogram Transformer (AST) models\nclass ASTPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare AST Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass ASTModel extends ASTPreTrainedModel { }\n\n/**\n * Audio Spectrogram Transformer model with an audio classification head on top\n * (a linear layer on top of the pooled output) e.g. for datasets like AudioSet, Speech Commands v2.\n */\nclass ASTForAudioClassification extends ASTPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Whisper models\nclass WhisperPreTrainedModel extends PreTrainedModel { };\n\n/**\n * WhisperModel class for training Whisper models without a language model head.\n */\nclass WhisperModel extends WhisperPreTrainedModel { }\n\n/**\n * WhisperForConditionalGeneration class for generating conditional outputs from Whisper models.\n */\nclass WhisperForConditionalGeneration extends WhisperPreTrainedModel {\n\n requires_attention_mask = false;\n main_input_name = 'input_features';\n\n /**\n * Creates a new instance of the `WhisperForConditionalGeneration` class.\n * @param {Object} config Configuration object for the model.\n * @param {Object} session ONNX Session object for the model.\n * @param {Object} decoder_merged_session ONNX Session object for the decoder.\n * @param {Object} generation_config Configuration object for the generation process.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n\n /**\n * @typedef {Object} WhisperGenerationConfig\n * @extends GenerationConfig\n * @property {boolean} [return_timestamps=null] Whether to return the timestamps with the text. This enables the `WhisperTimestampsLogitsProcessor`.\n * @property {boolean} [return_token_timestamps=null] Whether to return token-level timestamps\n * with the text. This can be used with or without the `return_timestamps` option. To get word-level\n * timestamps, use the tokenizer to group the tokens into words.\n * @property {number} [num_frames=null] The number of audio frames available in this chunk. This is only used generating word-level timestamps.\n */\n\n /**\n * Generates outputs based on input and generation configuration.\n * @param {Object} inputs Input data for the model.\n * @param {WhisperGenerationConfig} generation_config Configuration object for the generation process.\n * @param {Object} logits_processor Optional logits processor object.\n * @returns {Promise} Promise object represents the generated outputs.\n */\n async generate(\n inputs,\n generation_config = null,\n logits_processor = null,\n // {\n // return_timestamps = null,\n // return_token_timestamps = null,\n // language = null,\n // task = null,\n // } = {},\n ) {\n // Create generation config object\n generation_config = this._get_generation_config(generation_config);\n\n\n // Whisper has additional options for returning timestamps\n generation_config.return_timestamps ??= false;\n\n // TODO add language and task\n\n if (generation_config.return_timestamps) {\n logits_processor = [new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.WhisperTimeStampLogitsProcessor(generation_config)]\n }\n\n if (generation_config.return_token_timestamps) {\n generation_config.output_attentions = true;\n generation_config.return_dict_in_generate = true;\n\n if (generation_config.task === 'translate') {\n console.warn(\"Token-level timestamps may not be reliable for task 'translate'.\")\n }\n\n if (!generation_config.alignment_heads) {\n throw new Error(\n \"Model generation config has no `alignment_heads`, token-level timestamps not available. \" +\n \"See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.\"\n )\n }\n }\n\n const outputs = await super.generate(inputs, generation_config, logits_processor);\n\n if (generation_config.return_token_timestamps && generation_config.alignment_heads) {\n outputs[\"token_timestamps\"] = this._extract_token_timestamps(\n outputs,\n generation_config.alignment_heads,\n generation_config.num_frames,\n )\n }\n\n return outputs\n }\n\n /**\n * Calculates token-level timestamps using the encoder-decoder cross-attentions and\n * dynamic time-warping (DTW) to map each output token to a position in the input audio.\n * @param {Object} generate_outputs Outputs generated by the model\n * @param {Tensor[][][]} generate_outputs.cross_attentions The cross attentions output by the model\n * @param {Tensor[][][]} generate_outputs.decoder_attentions The decoder attentions output by the model\n * @param {number[][]} generate_outputs.sequences The sequences output by the model\n * @param {number[][]} alignment_heads Alignment heads of the model\n * @param {number} [num_frames=null] Number of frames in the input audio.\n * @param {number} [time_precision=0.02] Precision of the timestamps in seconds\n * @returns {Tensor} tensor containing the timestamps in seconds for each predicted token\n */\n _extract_token_timestamps(generate_outputs, alignment_heads, num_frames = null, time_precision = 0.02) {\n if (!generate_outputs.cross_attentions) {\n throw new Error(\n \"Model outputs must contain cross attentions to extract timestamps. \" +\n \"This is most likely because the model was not exported with `output_attentions=True`.\"\n )\n }\n\n let median_filter_width = this.config.median_filter_width;\n if (median_filter_width === undefined) {\n console.warn(\"Model config has no `median_filter_width`, using default value of 7.\")\n median_filter_width = 7;\n }\n\n const batchedMatrices = generate_outputs.cross_attentions.map(batch => {\n // Create a list with `decoder_layers` elements, each a tensor of shape\n // (batch size, attention_heads, output length, input length).\n let cross_attentions = Array.from({ length: this.config.decoder_layers },\n (_, i) => (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.cat)(batch.map(x => x[i]), 2)\n );\n\n let weights = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.stack)(alignment_heads.map(([l, h]) => {\n return num_frames\n ? cross_attentions[l].slice(null, h, null, [0, num_frames])\n : cross_attentions[l].slice(null, h);\n }));\n weights = weights.transpose(1, 0, 2, 3)\n\n let [std, calculatedMean] = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.std_mean)(weights, -2, 0, true);\n\n // Normalize and smoothen the weights.\n let smoothedWeights = weights.clone(); // [1, 8, seqLength, 1500]\n\n for (let a = 0; a < smoothedWeights.dims[0]; ++a) {\n let aTensor = smoothedWeights[a]; // [8, seqLength, 1500]\n\n for (let b = 0; b < aTensor.dims[0]; ++b) {\n let bTensor = aTensor[b]; // [seqLength, 1500]\n\n const stdTensor = std[a][b][0]; // [1500]\n const meanTensor = calculatedMean[a][b][0]; // [1500]\n\n for (let c = 0; c < bTensor.dims[0]; ++c) {\n\n let cTensor = bTensor[c]; // [1500]\n for (let d = 0; d < cTensor.data.length; ++d) {\n cTensor.data[d] = (cTensor.data[d] - meanTensor.data[d]) / stdTensor.data[d]\n }\n\n // Apply median filter.\n cTensor.data.set((0,_transformers_js__WEBPACK_IMPORTED_MODULE_6__.medianFilter)(cTensor.data, median_filter_width))\n }\n }\n }\n\n // Average the different cross-attention heads.\n const matrix = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.mean)(smoothedWeights, 1);\n return matrix;\n });\n\n const timestampsShape = [generate_outputs.sequences.length, generate_outputs.sequences[0].length];\n\n const timestamps = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor(\n 'float32',\n new Float32Array(timestampsShape[0] * timestampsShape[1]),\n timestampsShape\n );\n\n // Perform dynamic time warping on each element of the batch.\n for (let batch_idx = 0; batch_idx < timestampsShape[0]; ++batch_idx) {\n // NOTE: Since we run only one batch at a time, we can squeeze to get the same dimensions\n // as the python implementation\n const matrix = batchedMatrices[batch_idx].neg().squeeze_(0);\n let [text_indices, time_indices] = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.dynamicTimeWarping)(matrix);\n\n let diffs = Array.from({ length: text_indices.length - 1 }, (v, i) => text_indices[i + 1] - text_indices[i]);\n let jumps = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_1__.mergeArrays)([1], diffs).map(x => !!x); // convert to boolean\n\n let jump_times = [];\n for (let i = 0; i < jumps.length; ++i) {\n if (jumps[i]) {\n jump_times.push(time_indices[i] * time_precision);\n // NOTE: No point in rounding here, since we set to Float32Array later\n }\n }\n timestamps[batch_idx].data.set(jump_times, 1)\n }\n\n return timestamps;\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n/**\n * Vision Encoder-Decoder model based on OpenAI's GPT architecture for image captioning and other vision tasks\n */\nclass VisionEncoderDecoderModel extends PreTrainedModel {\n main_input_name = 'pixel_values';\n\n /**\n * Creates a new instance of the `VisionEncoderDecoderModel` class.\n * @param {Object} config The configuration object specifying the hyperparameters and other model settings.\n * @param {Object} session The ONNX session containing the encoder model.\n * @param {any} decoder_merged_session The ONNX session containing the merged decoder model.\n * @param {Object} generation_config Configuration object for the generation process.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n // Extract configs\n const encoderConfig = this.config.encoder;\n const decoderConfig = this.config.decoder;\n\n // Validate encoder\n const encoderModelType = encoderConfig.model_type;\n const encoderModel =\n MODEL_MAPPING_NAMES_ENCODER_ONLY.get(encoderModelType)\n ?? MODEL_MAPPING_NAMES_ENCODER_DECODER.get(encoderModelType);\n if (!encoderModel) {\n console.warn(`Model type for encoder '${encoderModelType}' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.`);\n }\n\n // Validate decoder\n const decoderModel = MODEL_WITH_LM_HEAD_MAPPING_NAMES.get(decoderConfig.model_type);\n if (!decoderModel) {\n throw new Error(`Unable to construct \\`VisionEncoderDecoder\\` due to unsupported decoder: \"${this.config.decoder.model_type}\"`);\n }\n\n // @ts-ignore\n const decoderModelClass = decoderModel[1];\n // @ts-ignore\n const decoder = new decoderModelClass(decoderConfig, decoder_merged_session, generation_config);\n\n this.add_encoder_pkv = 'num_decoder_layers' in decoder;\n if (this.add_encoder_pkv) {\n // Decoder is part of an encoder-decoder model\n this.num_decoder_layers = decoder.num_decoder_layers;\n this.num_decoder_heads = decoder.num_decoder_heads;\n this.decoder_dim_kv = decoder.decoder_dim_kv;\n\n this.num_encoder_layers = decoder.num_encoder_layers;\n this.num_encoder_heads = decoder.num_encoder_heads;\n this.encoder_dim_kv = decoder.encoder_dim_kv;\n\n } else {\n // Decoder is a decoder-only model\n this.num_layers = decoder.num_layers;\n this.num_heads = decoder.num_heads;\n this.dim_kv = decoder.dim_kv;\n }\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// CLIP models\nclass CLIPPreTrainedModel extends PreTrainedModel { }\n\n/**\n * CLIP Text and Vision Model with a projection layers on top\n * \n * **Example:** Perform zero-shot image classification with a `CLIPModel`.\n * \n * ```javascript\n * import { AutoTokenizer, AutoProcessor, CLIPModel, RawImage } from '@xenova/transformers';\n * \n * // Load tokenizer, processor, and model\n * let tokenizer = await AutoTokenizer.from_pretrained('Xenova/clip-vit-base-patch16');\n * let processor = await AutoProcessor.from_pretrained('Xenova/clip-vit-base-patch16');\n * let model = await CLIPModel.from_pretrained('Xenova/clip-vit-base-patch16');\n * \n * // Run tokenization\n * let texts = ['a photo of a car', 'a photo of a football match']\n * let text_inputs = tokenizer(texts, { padding: true, truncation: true });\n * \n * // Read image and run processor\n * let image = await RawImage.read('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');\n * let image_inputs = await processor(image);\n * \n * // Run model with both text and pixel inputs\n * let output = await model({ ...text_inputs, ...image_inputs });\n * // {\n * // logits_per_image: Tensor {\n * // dims: [ 1, 2 ],\n * // data: Float32Array(2) [ 18.579734802246094, 24.31830596923828 ],\n * // },\n * // logits_per_text: Tensor {\n * // dims: [ 2, 1 ],\n * // data: Float32Array(2) [ 18.579734802246094, 24.31830596923828 ],\n * // },\n * // text_embeds: Tensor {\n * // dims: [ 2, 512 ],\n * // data: Float32Array(1024) [ ... ],\n * // },\n * // image_embeds: Tensor {\n * // dims: [ 1, 512 ],\n * // data: Float32Array(512) [ ... ],\n * // }\n * // }\n * ```\n */\nclass CLIPModel extends CLIPPreTrainedModel { }\n\n/**\n * CLIP Text Model with a projection layer on top (a linear layer on top of the pooled output)\n * \n * **Example:** Compute text embeddings with `CLIPTextModelWithProjection`.\n * \n * ```javascript\n * import { AutoTokenizer, CLIPTextModelWithProjection } from '@xenova/transformers';\n * \n * // Load tokenizer and text model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/clip-vit-base-patch16');\n * const text_model = await CLIPTextModelWithProjection.from_pretrained('Xenova/clip-vit-base-patch16');\n * \n * // Run tokenization\n * let texts = ['a photo of a car', 'a photo of a football match'];\n * let text_inputs = tokenizer(texts, { padding: true, truncation: true });\n * \n * // Compute embeddings\n * const { text_embeds } = await text_model(text_inputs);\n * // Tensor {\n * // dims: [ 2, 512 ],\n * // type: 'float32',\n * // data: Float32Array(1024) [ ... ],\n * // size: 1024\n * // }\n * ```\n */\nclass CLIPTextModelWithProjection extends CLIPPreTrainedModel {\n\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'text_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n\n/**\n * CLIP Vision Model with a projection layer on top (a linear layer on top of the pooled output)\n * \n * **Example:** Compute vision embeddings with `CLIPVisionModelWithProjection`.\n * \n * ```javascript\n * import { AutoProcessor, CLIPVisionModelWithProjection, RawImage} from '@xenova/transformers';\n * \n * // Load processor and vision model\n * const processor = await AutoProcessor.from_pretrained('Xenova/clip-vit-base-patch16');\n * const vision_model = await CLIPVisionModelWithProjection.from_pretrained('Xenova/clip-vit-base-patch16');\n * \n * // Read image and run processor\n * let image = await RawImage.read('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');\n * let image_inputs = await processor(image);\n * \n * // Compute embeddings\n * const { image_embeds } = await vision_model(image_inputs);\n * // Tensor {\n * // dims: [ 1, 512 ],\n * // type: 'float32',\n * // data: Float32Array(512) [ ... ],\n * // size: 512\n * // }\n * ```\n */\nclass CLIPVisionModelWithProjection extends CLIPPreTrainedModel {\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'vision_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// SigLIP models\nclass SiglipPreTrainedModel extends PreTrainedModel { }\n\n/**\n * SigLIP Text and Vision Model with a projection layers on top\n * \n * **Example:** Perform zero-shot image classification with a `SiglipModel`.\n * \n * ```javascript\n * import { AutoTokenizer, AutoProcessor, SiglipModel, RawImage } from '@xenova/transformers';\n * \n * // Load tokenizer, processor, and model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/siglip-base-patch16-224');\n * const processor = await AutoProcessor.from_pretrained('Xenova/siglip-base-patch16-224');\n * const model = await SiglipModel.from_pretrained('Xenova/siglip-base-patch16-224');\n * \n * // Run tokenization\n * const texts = ['a photo of 2 cats', 'a photo of 2 dogs'];\n * const text_inputs = tokenizer(texts, { padding: 'max_length', truncation: true });\n * \n * // Read image and run processor\n * const image = await RawImage.read('http://images.cocodataset.org/val2017/000000039769.jpg');\n * const image_inputs = await processor(image);\n * \n * // Run model with both text and pixel inputs\n * const output = await model({ ...text_inputs, ...image_inputs });\n * // {\n * // logits_per_image: Tensor {\n * // dims: [ 1, 2 ],\n * // data: Float32Array(2) [ -1.6019744873046875, -10.720091819763184 ],\n * // },\n * // logits_per_text: Tensor {\n * // dims: [ 2, 1 ],\n * // data: Float32Array(2) [ -1.6019744873046875, -10.720091819763184 ],\n * // },\n * // text_embeds: Tensor {\n * // dims: [ 2, 768 ],\n * // data: Float32Array(1536) [ ... ],\n * // },\n * // image_embeds: Tensor {\n * // dims: [ 1, 768 ],\n * // data: Float32Array(768) [ ... ],\n * // }\n * // }\n * ```\n */\nclass SiglipModel extends SiglipPreTrainedModel { }\n\n/**\n * The text model from SigLIP without any head or projection on top.\n * \n * **Example:** Compute text embeddings with `SiglipTextModel`.\n * \n * ```javascript\n * import { AutoTokenizer, SiglipTextModel } from '@xenova/transformers';\n * \n * // Load tokenizer and text model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/siglip-base-patch16-224');\n * const text_model = await SiglipTextModel.from_pretrained('Xenova/siglip-base-patch16-224');\n * \n * // Run tokenization\n * const texts = ['a photo of 2 cats', 'a photo of 2 dogs'];\n * const text_inputs = tokenizer(texts, { padding: 'max_length', truncation: true });\n * \n * // Compute embeddings\n * const { pooler_output } = await text_model(text_inputs);\n * // Tensor {\n * // dims: [ 2, 768 ],\n * // type: 'float32',\n * // data: Float32Array(1536) [ ... ],\n * // size: 1536\n * // }\n * ```\n */\nclass SiglipTextModel extends SiglipPreTrainedModel {\n\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'text_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n\n/**\n * The vision model from SigLIP without any head or projection on top.\n * \n * **Example:** Compute vision embeddings with `SiglipVisionModel`.\n * \n * ```javascript\n * import { AutoProcessor, SiglipVisionModel, RawImage} from '@xenova/transformers';\n * \n * // Load processor and vision model\n * const processor = await AutoProcessor.from_pretrained('Xenova/siglip-base-patch16-224');\n * const vision_model = await SiglipVisionModel.from_pretrained('Xenova/siglip-base-patch16-224');\n * \n * // Read image and run processor\n * const image = await RawImage.read('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');\n * const image_inputs = await processor(image);\n * \n * // Compute embeddings\n * const { pooler_output } = await vision_model(image_inputs);\n * // Tensor {\n * // dims: [ 1, 768 ],\n * // type: 'float32',\n * // data: Float32Array(768) [ ... ],\n * // size: 768\n * // }\n * ```\n */\nclass SiglipVisionModel extends CLIPPreTrainedModel {\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'vision_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n//////////////////////////////////////////////////\n// ChineseCLIP models\nclass ChineseCLIPPreTrainedModel extends PreTrainedModel { }\n\nclass ChineseCLIPModel extends ChineseCLIPPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// CLIPSeg models\nclass CLIPSegPreTrainedModel extends PreTrainedModel { }\n\nclass CLIPSegModel extends CLIPSegPreTrainedModel { }\n\n/**\n * CLIPSeg model with a Transformer-based decoder on top for zero-shot and one-shot image segmentation.\n * \n * **Example:** Perform zero-shot image segmentation with a `CLIPSegForImageSegmentation` model.\n * \n * ```javascript\n * import { AutoTokenizer, AutoProcessor, CLIPSegForImageSegmentation, RawImage } from '@xenova/transformers';\n * \n * // Load tokenizer, processor, and model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/clipseg-rd64-refined');\n * const processor = await AutoProcessor.from_pretrained('Xenova/clipseg-rd64-refined');\n * const model = await CLIPSegForImageSegmentation.from_pretrained('Xenova/clipseg-rd64-refined');\n * \n * // Run tokenization\n * const texts = ['a glass', 'something to fill', 'wood', 'a jar'];\n * const text_inputs = tokenizer(texts, { padding: true, truncation: true });\n * \n * // Read image and run processor\n * const image = await RawImage.read('https://github.com/timojl/clipseg/blob/master/example_image.jpg?raw=true');\n * const image_inputs = await processor(image);\n * \n * // Run model with both text and pixel inputs\n * const { logits } = await model({ ...text_inputs, ...image_inputs });\n * // logits: Tensor {\n * // dims: [4, 352, 352],\n * // type: 'float32',\n * // data: Float32Array(495616) [ ... ],\n * // size: 495616\n * // }\n * ```\n * \n * You can visualize the predictions as follows:\n * ```javascript\n * const preds = logits\n * .unsqueeze_(1)\n * .sigmoid_()\n * .mul_(255)\n * .round_()\n * .to('uint8');\n * \n * for (let i = 0; i < preds.dims[0]; ++i) {\n * const img = RawImage.fromTensor(preds[i]);\n * img.save(`prediction_${i}.png`);\n * }\n * ```\n */\nclass CLIPSegForImageSegmentation extends CLIPSegPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// GPT2 models\nclass GPT2PreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `GPT2PreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_head\n this.num_layers = this.config.n_layer\n this.dim_kv = this.config.n_embd / this.num_heads;\n }\n}\n\nclass GPT2Model extends GPT2PreTrainedModel { }\n\n/**\n * GPT-2 language model head on top of the GPT-2 base model. This model is suitable for text generation tasks.\n */\nclass GPT2LMHeadModel extends GPT2PreTrainedModel { }\n// export class GPT2ForSequenceClassification extends GPT2PreTrainedModel {\n// TODO\n// }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// GPTNeo models\nclass GPTNeoPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `GPTNeoPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_heads;\n this.num_layers = this.config.num_layers;\n this.dim_kv = this.config.hidden_size / this.num_heads;\n }\n}\nclass GPTNeoModel extends GPTNeoPreTrainedModel { }\n\nclass GPTNeoForCausalLM extends GPTNeoPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// GPTNeoX models\nclass GPTNeoXPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `GPTNeoXPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_attention_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.num_heads;\n }\n}\nclass GPTNeoXModel extends GPTNeoXPreTrainedModel { }\n\nclass GPTNeoXForCausalLM extends GPTNeoXPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// GPT-J models\nclass GPTJPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `GPTJPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_head\n this.num_layers = this.config.n_layer\n this.dim_kv = this.config.n_embd / this.num_heads;\n }\n}\n\nclass GPTJModel extends GPTJPreTrainedModel { }\n\nclass GPTJForCausalLM extends GPTJPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// GPTBigCode models\nclass GPTBigCodePreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `GPTBigCodePreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_head\n this.num_layers = this.config.n_layer\n this.dim_kv = this.config.n_embd / this.num_heads;\n }\n}\n\nclass GPTBigCodeModel extends GPTBigCodePreTrainedModel { }\n\nclass GPTBigCodeForCausalLM extends GPTBigCodePreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// CodeGen models\nclass CodeGenPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `CodeGenPreTrainedModel` class.\n * @param {Object} config The model configuration object.\n * @param {Object} session The ONNX session object.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_head\n this.num_layers = this.config.n_layer\n this.dim_kv = this.config.n_embd / this.num_heads;\n }\n}\n/**\n * CodeGenModel is a class representing a code generation model without a language model head.\n */\nclass CodeGenModel extends CodeGenPreTrainedModel { }\n\n/**\n * CodeGenForCausalLM is a class that represents a code generation model based on the GPT-2 architecture. It extends the `CodeGenPreTrainedModel` class.\n */\nclass CodeGenForCausalLM extends CodeGenPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// LLama models\n\n/**\n * The bare LLama Model outputting raw hidden-states without any specific head on top.\n */\nclass LlamaPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `LlamaPreTrainedModel` class.\n * @param {Object} config The model configuration object.\n * @param {Object} session The ONNX session object.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_key_value_heads ?? this.config.num_attention_heads\n this.num_layers = this.config.num_hidden_layers\n this.dim_kv = this.config.hidden_size / this.config.num_attention_heads\n }\n}\n/**\n * The bare LLaMA Model outputting raw hidden-states without any specific head on top.\n */\nclass LlamaModel extends LlamaPreTrainedModel { }\n\nclass LlamaForCausalLM extends LlamaPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Qwen2 models\n\n/**\n * The bare Qwen2 Model outputting raw hidden-states without any specific head on top.\n */\nclass Qwen2PreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `Qwen2PreTrainedModel` class.\n * @param {Object} config The model configuration object.\n * @param {Object} session The ONNX session object.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_key_value_heads ?? this.config.num_attention_heads\n this.num_layers = this.config.num_hidden_layers\n this.dim_kv = this.config.hidden_size / this.config.num_attention_heads\n }\n}\n/**\n * The bare Qwen2 Model outputting raw hidden-states without any specific head on top.\n */\nclass Qwen2Model extends Qwen2PreTrainedModel { }\n\nclass Qwen2ForCausalLM extends Qwen2PreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Phi models\n\nclass PhiPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `PhiPreTrainedModel` class.\n * @param {Object} config The model configuration object.\n * @param {Object} session The ONNX session object.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id;\n\n this.num_heads = this.config.num_attention_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.num_heads;\n }\n}\n/**\n * The bare Phi Model outputting raw hidden-states without any specific head on top.\n */\nclass PhiModel extends PhiPreTrainedModel { }\n\nclass PhiForCausalLM extends PhiPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Bloom models\n/**\n * The Bloom Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).\n */\nclass BloomPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `BloomPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_head\n this.num_layers = this.config.n_layer\n this.dim_kv = this.config.hidden_size / this.num_heads;\n }\n}\n\n/**\n * The bare Bloom Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass BloomModel extends BloomPreTrainedModel { }\n\n/**\n * The Bloom Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).\n */\nclass BloomForCausalLM extends BloomPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// MPT models\nclass MptPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `MptPreTrainedModel` class.\n * @param {Object} config The model configuration object.\n * @param {Object} session The ONNX session object.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_heads\n this.num_layers = this.config.n_layers\n this.dim_kv = this.config.d_model / this.num_heads;\n }\n}\n\n/**\n * The bare Mpt Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass MptModel extends MptPreTrainedModel { }\n\n/**\n * The MPT Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).\n */\nclass MptForCausalLM extends MptPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// OPT models\nclass OPTPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `OPTPreTrainedModel` class.\n * @param {Object} config The model configuration object.\n * @param {Object} session The ONNX session object.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_attention_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.num_heads;\n }\n}\n\n/**\n * The bare OPT Model outputting raw hidden-states without any specific head on top.\n */\nclass OPTModel extends OPTPreTrainedModel { }\n\n/**\n * The OPT Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).\n */\nclass OPTForCausalLM extends OPTPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass ViTPreTrainedModel extends PreTrainedModel { }\nclass ViTModel extends ViTPreTrainedModel { }\nclass ViTForImageClassification extends ViTPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass VitMattePreTrainedModel extends PreTrainedModel { }\n\n/**\n * ViTMatte framework leveraging any vision backbone e.g. for ADE20k, CityScapes.\n * \n * **Example:** Perform image matting with a `VitMatteForImageMatting` model.\n * ```javascript\n * import { AutoProcessor, VitMatteForImageMatting, RawImage } from '@xenova/transformers';\n * \n * // Load processor and model\n * const processor = await AutoProcessor.from_pretrained('Xenova/vitmatte-small-distinctions-646');\n * const model = await VitMatteForImageMatting.from_pretrained('Xenova/vitmatte-small-distinctions-646');\n * \n * // Load image and trimap\n * const image = await RawImage.fromURL('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/vitmatte_image.png');\n * const trimap = await RawImage.fromURL('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/vitmatte_trimap.png');\n * \n * // Prepare image + trimap for the model\n * const inputs = await processor(image, trimap);\n * \n * // Predict alpha matte\n * const { alphas } = await model(inputs);\n * // Tensor {\n * // dims: [ 1, 1, 640, 960 ],\n * // type: 'float32',\n * // size: 614400,\n * // data: Float32Array(614400) [ 0.9894027709960938, 0.9970508813858032, ... ]\n * // }\n * ```\n * \n * You can visualize the alpha matte as follows:\n * ```javascript\n * import { Tensor, cat } from '@xenova/transformers';\n * \n * // Visualize predicted alpha matte\n * const imageTensor = new Tensor(\n * 'uint8',\n * new Uint8Array(image.data),\n * [image.height, image.width, image.channels]\n * ).transpose(2, 0, 1);\n * \n * // Convert float (0-1) alpha matte to uint8 (0-255)\n * const alphaChannel = alphas\n * .squeeze(0)\n * .mul_(255)\n * .clamp_(0, 255)\n * .round_()\n * .to('uint8');\n * \n * // Concatenate original image with predicted alpha\n * const imageData = cat([imageTensor, alphaChannel], 0);\n * \n * // Save output image\n * const outputImage = RawImage.fromTensor(imageData);\n * outputImage.save('output.png');\n * ```\n */\nclass VitMatteForImageMatting extends VitMattePreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new ImageMattingOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass MobileViTPreTrainedModel extends PreTrainedModel { }\nclass MobileViTModel extends MobileViTPreTrainedModel { }\nclass MobileViTForImageClassification extends MobileViTPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n// TODO: MobileViTForSemanticSegmentation\n\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass OwlViTPreTrainedModel extends PreTrainedModel { }\nclass OwlViTModel extends OwlViTPreTrainedModel { }\nclass OwlViTForObjectDetection extends OwlViTPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass Owlv2PreTrainedModel extends PreTrainedModel { }\nclass Owlv2Model extends Owlv2PreTrainedModel { }\nclass Owlv2ForObjectDetection extends Owlv2PreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Beit Models\nclass BeitPreTrainedModel extends PreTrainedModel { }\nclass BeitModel extends BeitPreTrainedModel { }\nclass BeitForImageClassification extends BeitPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nclass DetrPreTrainedModel extends PreTrainedModel { }\nclass DetrModel extends DetrPreTrainedModel { }\nclass DetrForObjectDetection extends DetrPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new DetrObjectDetectionOutput(await super._call(model_inputs));\n }\n}\n\nclass DetrForSegmentation extends DetrPreTrainedModel {\n /**\n * Runs the model with the provided inputs\n * @param {Object} model_inputs Model inputs\n * @returns {Promise} Object containing segmentation outputs\n */\n async _call(model_inputs) {\n return new DetrSegmentationOutput(await super._call(model_inputs));\n }\n}\n\nclass DetrObjectDetectionOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Classification logits (including no-object) for all queries.\n * @param {Tensor} output.pred_boxes Normalized boxes coordinates for all queries, represented as (center_x, center_y, width, height).\n * These values are normalized in [0, 1], relative to the size of each individual image in the batch (disregarding possible padding).\n */\n constructor({ logits, pred_boxes }) {\n super();\n this.logits = logits;\n this.pred_boxes = pred_boxes;\n }\n}\n\nclass DetrSegmentationOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits The output logits of the model.\n * @param {Tensor} output.pred_boxes Predicted boxes.\n * @param {Tensor} output.pred_masks Predicted masks.\n */\n constructor({ logits, pred_boxes, pred_masks }) {\n super();\n this.logits = logits;\n this.pred_boxes = pred_boxes;\n this.pred_masks = pred_masks;\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass TableTransformerPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Table Transformer Model (consisting of a backbone and encoder-decoder Transformer)\n * outputting raw hidden-states without any specific head on top.\n */\nclass TableTransformerModel extends TableTransformerPreTrainedModel { }\n\n/**\n * Table Transformer Model (consisting of a backbone and encoder-decoder Transformer)\n * with object detection heads on top, for tasks such as COCO detection.\n */\nclass TableTransformerForObjectDetection extends TableTransformerPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new TableTransformerObjectDetectionOutput(await super._call(model_inputs));\n }\n}\nclass TableTransformerObjectDetectionOutput extends DetrObjectDetectionOutput { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nclass DeiTPreTrainedModel extends PreTrainedModel { }\nclass DeiTModel extends DeiTPreTrainedModel { }\nclass DeiTForImageClassification extends DeiTPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n/**\n * An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.\n */\nclass ResNetPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare ResNet model outputting raw features without any specific head on top.\n */\nclass ResNetModel extends ResNetPreTrainedModel { }\n\n/**\n * ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for ImageNet.\n */\nclass ResNetForImageClassification extends ResNetPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nclass SwinPreTrainedModel extends PreTrainedModel { }\nclass SwinModel extends SwinPreTrainedModel { }\nclass SwinForImageClassification extends SwinPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass Swin2SRPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Swin2SR Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass Swin2SRModel extends Swin2SRPreTrainedModel { }\n\n/**\n * Swin2SR Model transformer with an upsampler head on top for image super resolution and restoration.\n * \n * **Example:** Super-resolution w/ `Xenova/swin2SR-classical-sr-x2-64`.\n * \n * ```javascript\n * import { AutoProcessor, Swin2SRForImageSuperResolution, RawImage } from '@xenova/transformers';\n * \n * // Load processor and model\n * const model_id = 'Xenova/swin2SR-classical-sr-x2-64';\n * const processor = await AutoProcessor.from_pretrained(model_id);\n * const model = await Swin2SRForImageSuperResolution.from_pretrained(model_id);\n * \n * // Prepare model inputs\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/butterfly.jpg';\n * const image = await RawImage.fromURL(url);\n * const inputs = await processor(image);\n * \n * // Run model\n * const outputs = await model(inputs);\n * \n * // Convert Tensor to RawImage\n * const output = outputs.reconstruction.squeeze().clamp_(0, 1).mul_(255).round_().to('uint8');\n * const outputImage = RawImage.fromTensor(output);\n * // RawImage {\n * // data: Uint8Array(786432) [ 41, 31, 24, ... ],\n * // width: 512,\n * // height: 512,\n * // channels: 3\n * // }\n * ```\n */\nclass Swin2SRForImageSuperResolution extends Swin2SRPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass DPTPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare DPT Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass DPTModel extends DPTPreTrainedModel { }\n\n/**\n * DPT Model with a depth estimation head on top (consisting of 3 convolutional layers) e.g. for KITTI, NYUv2.\n * \n * **Example:** Depth estimation w/ `Xenova/dpt-hybrid-midas`.\n * ```javascript\n * import { DPTForDepthEstimation, AutoProcessor, RawImage, interpolate, max } from '@xenova/transformers';\n * \n * // Load model and processor\n * const model_id = 'Xenova/dpt-hybrid-midas';\n * const model = await DPTForDepthEstimation.from_pretrained(model_id);\n * const processor = await AutoProcessor.from_pretrained(model_id);\n * \n * // Load image from URL\n * const url = 'http://images.cocodataset.org/val2017/000000039769.jpg';\n * const image = await RawImage.fromURL(url);\n * \n * // Prepare image for the model\n * const inputs = await processor(image);\n * \n * // Run model\n * const { predicted_depth } = await model(inputs);\n * \n * // Interpolate to original size\n * const prediction = interpolate(predicted_depth, image.size.reverse(), 'bilinear', false);\n * \n * // Visualize the prediction\n * const formatted = prediction.mul_(255 / max(prediction.data)[0]).to('uint8');\n * const depth = RawImage.fromTensor(formatted);\n * // RawImage {\n * // data: Uint8Array(307200) [ 85, 85, 84, ... ],\n * // width: 640,\n * // height: 480,\n * // channels: 1\n * // }\n * ```\n */\nclass DPTForDepthEstimation extends DPTPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass DepthAnythingPreTrainedModel extends PreTrainedModel { }\n\n/**\n * Depth Anything Model with a depth estimation head on top (consisting of 3 convolutional layers) e.g. for KITTI, NYUv2.\n */\nclass DepthAnythingForDepthEstimation extends DepthAnythingPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nclass GLPNPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare GLPN encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.\n */\nclass GLPNModel extends GLPNPreTrainedModel { }\n\n/**\n * GLPN Model transformer with a lightweight depth estimation head on top e.g. for KITTI, NYUv2.\n * \n * **Example:** Depth estimation w/ `Xenova/glpn-kitti`.\n * ```javascript\n * import { GLPNForDepthEstimation, AutoProcessor, RawImage, interpolate, max } from '@xenova/transformers';\n * \n * // Load model and processor\n * const model_id = 'Xenova/glpn-kitti';\n * const model = await GLPNForDepthEstimation.from_pretrained(model_id);\n * const processor = await AutoProcessor.from_pretrained(model_id);\n * \n * // Load image from URL\n * const url = 'http://images.cocodataset.org/val2017/000000039769.jpg';\n * const image = await RawImage.fromURL(url);\n * \n * // Prepare image for the model\n * const inputs = await processor(image);\n * \n * // Run model\n * const { predicted_depth } = await model(inputs);\n * \n * // Interpolate to original size\n * const prediction = interpolate(predicted_depth, image.size.reverse(), 'bilinear', false);\n * \n * // Visualize the prediction\n * const formatted = prediction.mul_(255 / max(prediction.data)[0]).to('uint8');\n * const depth = RawImage.fromTensor(formatted);\n * // RawImage {\n * // data: Uint8Array(307200) [ 207, 169, 154, ... ],\n * // width: 640,\n * // height: 480,\n * // channels: 1\n * // }\n * ```\n */\nclass GLPNForDepthEstimation extends GLPNPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass DonutSwinPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Donut Swin Model transformer outputting raw hidden-states without any specific head on top.\n * \n * **Example:** Step-by-step Document Parsing.\n * \n * ```javascript\n * import { AutoProcessor, AutoTokenizer, AutoModelForVision2Seq, RawImage } from '@xenova/transformers';\n * \n * // Choose model to use\n * const model_id = 'Xenova/donut-base-finetuned-cord-v2';\n * \n * // Prepare image inputs\n * const processor = await AutoProcessor.from_pretrained(model_id);\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/receipt.png';\n * const image = await RawImage.read(url);\n * const image_inputs = await processor(image);\n * \n * // Prepare decoder inputs\n * const tokenizer = await AutoTokenizer.from_pretrained(model_id);\n * const task_prompt = '';\n * const decoder_input_ids = tokenizer(task_prompt, {\n * add_special_tokens: false,\n * }).input_ids;\n * \n * // Create the model\n * const model = await AutoModelForVision2Seq.from_pretrained(model_id);\n * \n * // Run inference\n * const output = await model.generate(image_inputs.pixel_values, {\n * decoder_input_ids,\n * max_length: model.config.decoder.max_position_embeddings,\n * });\n * \n * // Decode output\n * const decoded = tokenizer.batch_decode(output)[0];\n * // CINNAMON SUGAR 17,000 1 x 17,000 17,000 17,000 20,000 3,000\n * ```\n * \n * **Example:** Step-by-step Document Visual Question Answering (DocVQA)\n * \n * ```javascript\n * import { AutoProcessor, AutoTokenizer, AutoModelForVision2Seq, RawImage } from '@xenova/transformers';\n * \n * // Choose model to use\n * const model_id = 'Xenova/donut-base-finetuned-docvqa';\n * \n * // Prepare image inputs\n * const processor = await AutoProcessor.from_pretrained(model_id);\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/invoice.png';\n * const image = await RawImage.read(url);\n * const image_inputs = await processor(image);\n * \n * // Prepare decoder inputs\n * const tokenizer = await AutoTokenizer.from_pretrained(model_id);\n * const question = 'What is the invoice number?';\n * const task_prompt = `${question}`;\n * const decoder_input_ids = tokenizer(task_prompt, {\n * add_special_tokens: false,\n * }).input_ids;\n * \n * // Create the model\n * const model = await AutoModelForVision2Seq.from_pretrained(model_id);\n * \n * // Run inference\n * const output = await model.generate(image_inputs.pixel_values, {\n * decoder_input_ids,\n * max_length: model.config.decoder.max_position_embeddings,\n * });\n * \n * // Decode output\n * const decoded = tokenizer.batch_decode(output)[0];\n * // What is the invoice number? us-001\n * ```\n */\nclass DonutSwinModel extends DonutSwinPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nclass ConvNextPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare ConvNext model outputting raw features without any specific head on top.\n */\nclass ConvNextModel extends ConvNextPreTrainedModel { }\n\n/**\n * ConvNext Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for ImageNet.\n */\nclass ConvNextForImageClassification extends ConvNextPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nclass ConvNextV2PreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare ConvNextV2 model outputting raw features without any specific head on top.\n */\nclass ConvNextV2Model extends ConvNextV2PreTrainedModel { }\n\n/**\n * ConvNextV2 Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for ImageNet.\n */\nclass ConvNextV2ForImageClassification extends ConvNextV2PreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass Dinov2PreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare DINOv2 Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass Dinov2Model extends Dinov2PreTrainedModel { }\n\n/**\n * Dinov2 Model transformer with an image classification head on top (a linear layer on top of the final hidden state of the [CLS] token) e.g. for ImageNet.\n */\nclass Dinov2ForImageClassification extends Dinov2PreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nclass YolosPreTrainedModel extends PreTrainedModel { }\nclass YolosModel extends YolosPreTrainedModel { }\nclass YolosForObjectDetection extends YolosPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new YolosObjectDetectionOutput(await super._call(model_inputs));\n }\n}\n\nclass YolosObjectDetectionOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Classification logits (including no-object) for all queries.\n * @param {Tensor} output.pred_boxes Normalized boxes coordinates for all queries, represented as (center_x, center_y, width, height).\n * These values are normalized in [0, 1], relative to the size of each individual image in the batch (disregarding possible padding).\n */\n constructor({ logits, pred_boxes }) {\n super();\n this.logits = logits;\n this.pred_boxes = pred_boxes;\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nclass SamPreTrainedModel extends PreTrainedModel { }\n\n/**\n * Segment Anything Model (SAM) for generating segmentation masks, given an input image\n * and optional 2D location and bounding boxes.\n * \n * **Example:** Perform mask generation w/ `Xenova/sam-vit-base`.\n * ```javascript\n * import { SamModel, AutoProcessor, RawImage } from '@xenova/transformers';\n * \n * const model = await SamModel.from_pretrained('Xenova/sam-vit-base');\n * const processor = await AutoProcessor.from_pretrained('Xenova/sam-vit-base');\n * \n * const img_url = 'https://huggingface.co/ybelkada/segment-anything/resolve/main/assets/car.png';\n * const raw_image = await RawImage.read(img_url);\n * const input_points = [[[450, 600]]] // 2D localization of a window\n * \n * const inputs = await processor(raw_image, input_points);\n * const outputs = await model(inputs);\n * \n * const masks = await processor.post_process_masks(outputs.pred_masks, inputs.original_sizes, inputs.reshaped_input_sizes);\n * // [\n * // Tensor {\n * // dims: [ 1, 3, 1764, 2646 ],\n * // type: 'bool',\n * // data: Uint8Array(14002632) [ ... ],\n * // size: 14002632\n * // }\n * // ]\n * const scores = outputs.iou_scores;\n * // Tensor {\n * // dims: [ 1, 1, 3 ],\n * // type: 'float32',\n * // data: Float32Array(3) [\n * // 0.8892380595207214,\n * // 0.9311248064041138,\n * // 0.983696699142456\n * // ],\n * // size: 3\n * // }\n * ```\n */\nclass SamModel extends SamPreTrainedModel {\n /**\n * Creates a new instance of the `SamModel` class.\n * @param {Object} config The configuration object specifying the hyperparameters and other model settings.\n * @param {Object} vision_encoder The ONNX session containing the vision encoder model.\n * @param {any} prompt_encoder_mask_decoder The ONNX session containing the prompt encoder and mask decoder model.\n */\n constructor(config, vision_encoder, prompt_encoder_mask_decoder) {\n super(config, vision_encoder);\n this.prompt_encoder_mask_decoder = prompt_encoder_mask_decoder;\n }\n\n /**\n * Compute image embeddings and positional image embeddings, given the pixel values of an image.\n * @param {Object} model_inputs Object containing the model inputs.\n * @param {Tensor} model_inputs.pixel_values Pixel values obtained using a `SamProcessor`.\n * @returns {Promise<{ image_embeddings: Tensor, image_positional_embeddings: Tensor }>} The image embeddings and positional image embeddings.\n */\n async get_image_embeddings({ pixel_values }) {\n // in:\n // - pixel_values: tensor.float32[batch_size,3,1024,1024]\n // \n // out:\n // - image_embeddings: tensor.float32[batch_size,256,64,64]\n // - image_positional_embeddings: tensor.float32[batch_size,256,64,64]\n return await encoderForward(this, { pixel_values })\n }\n\n /**\n * @typedef {Object} SamModelInputs Object containing the model inputs.\n * @property {Tensor} pixel_values Pixel values as a Tensor with shape `(batch_size, num_channels, height, width)`.\n * These can be obtained using a `SamProcessor`.\n * @property {Tensor} input_points Input 2D spatial points with shape `(batch_size, num_points, 2)`.\n * This is used by the prompt encoder to encode the prompt.\n * @property {Tensor} [input_labels] Input labels for the points, as a Tensor of shape `(batch_size, point_batch_size, num_points)`.\n * This is used by the prompt encoder to encode the prompt. There are 4 types of labels:\n * - `1`: the point is a point that contains the object of interest\n * - `0`: the point is a point that does not contain the object of interest\n * - `-1`: the point corresponds to the background\n * - `-10`: the point is a padding point, thus should be ignored by the prompt encoder\n * @property {Tensor} [image_embeddings] Image embeddings used by the mask decoder.\n * @property {Tensor} [image_positional_embeddings] Image positional embeddings used by the mask decoder.\n */\n\n /**\n * @param {SamModelInputs} model_inputs Object containing the model inputs.\n * @returns {Promise} The output of the model.\n */\n async forward(model_inputs) {\n if (!model_inputs.image_embeddings || !model_inputs.image_positional_embeddings) {\n // Compute the image embeddings if they are missing\n model_inputs = {\n ...model_inputs,\n ...(await this.get_image_embeddings(model_inputs))\n }\n }\n\n if (!model_inputs.input_labels) {\n // Set default input labels if they are missing\n const shape = model_inputs.input_points.dims.slice(0, -1);\n const numElements = shape.reduce((a, b) => a * b, 1);\n model_inputs.input_labels = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor(\n 'int64',\n new BigInt64Array(numElements).fill(1n),\n shape\n );\n }\n\n // Returns:\n // - iou_scores: tensor.float32[batch_size,point_batch_size,3]\n // - pred_masks: tensor.float32[batch_size,point_batch_size,3,256,256]\n return await sessionRun(this.prompt_encoder_mask_decoder, {\n input_points: model_inputs.input_points,\n input_labels: model_inputs.input_labels,\n image_embeddings: model_inputs.image_embeddings,\n image_positional_embeddings: model_inputs.image_positional_embeddings,\n });\n }\n\n /**\n * Runs the model with the provided inputs\n * @param {Object} model_inputs Model inputs\n * @returns {Promise} Object containing segmentation outputs\n */\n async _call(model_inputs) {\n return new SamImageSegmentationOutput(await super._call(model_inputs));\n }\n}\n\n\n/**\n * Base class for Segment-Anything model's output.\n */\nclass SamImageSegmentationOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.iou_scores The output logits of the model.\n * @param {Tensor} output.pred_masks Predicted boxes.\n */\n constructor({ iou_scores, pred_masks }) {\n super();\n this.iou_scores = iou_scores;\n this.pred_masks = pred_masks;\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// MarianMT models\nclass MarianPreTrainedModel extends PreTrainedModel { };\n\nclass MarianModel extends MarianPreTrainedModel { }\n\nclass MarianMTModel extends MarianPreTrainedModel {\n\n /**\n * Creates a new instance of the `MarianMTModel` class.\n * @param {Object} config The model configuration object.\n * @param {Object} session The ONNX session object.\n * @param {any} decoder_merged_session \n * @param {any} generation_config \n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// M2M100 models\nclass M2M100PreTrainedModel extends PreTrainedModel { };\n\nclass M2M100Model extends M2M100PreTrainedModel { }\n\nclass M2M100ForConditionalGeneration extends M2M100PreTrainedModel {\n\n /**\n * Creates a new instance of the `M2M100ForConditionalGeneration` class.\n * @param {Object} config The model configuration object.\n * @param {Object} session The ONNX session object.\n * @param {any} decoder_merged_session \n * @param {any} generation_config \n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Wav2Vec2 models\nclass Wav2Vec2PreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare Wav2Vec2 Model transformer outputting raw hidden-states without any specific head on top.\n * \n * **Example:** Load and run a `Wav2Vec2Model` for feature extraction.\n * \n * ```javascript\n * import { AutoProcessor, AutoModel, read_audio } from '@xenova/transformers';\n * \n * // Read and preprocess audio\n * const processor = await AutoProcessor.from_pretrained('Xenova/mms-300m');\n * const audio = await read_audio('https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac', 16000);\n * const inputs = await processor(audio);\n * \n * // Run model with inputs\n * const model = await AutoModel.from_pretrained('Xenova/mms-300m');\n * const output = await model(inputs);\n * // {\n * // last_hidden_state: Tensor {\n * // dims: [ 1, 1144, 1024 ],\n * // type: 'float32',\n * // data: Float32Array(1171456) [ ... ],\n * // size: 1171456\n * // }\n * // }\n * ```\n */\nclass Wav2Vec2Model extends Wav2Vec2PreTrainedModel { }\n\nclass Wav2Vec2ForCTC extends Wav2Vec2PreTrainedModel {\n /**\n * @param {Object} model_inputs\n * @param {Tensor} model_inputs.input_values Float values of input raw speech waveform.\n * @param {Tensor} model_inputs.attention_mask Mask to avoid performing convolution and attention on padding token indices. Mask values selected in [0, 1]\n */\n async _call(model_inputs) {\n return new CausalLMOutput(await super._call(model_inputs));\n }\n}\n\nclass Wav2Vec2ForSequenceClassification extends Wav2Vec2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Wav2Vec2 models\nclass Wav2Vec2BertPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare Wav2Vec2Bert Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass Wav2Vec2BertModel extends Wav2Vec2BertPreTrainedModel { }\n\n/**\n * Wav2Vec2Bert Model with a `language modeling` head on top for Connectionist Temporal Classification (CTC).\n */\nclass Wav2Vec2BertForCTC extends Wav2Vec2BertPreTrainedModel {\n /**\n * @param {Object} model_inputs\n * @param {Tensor} model_inputs.input_features Float values of input mel-spectrogram.\n * @param {Tensor} model_inputs.attention_mask Mask to avoid performing convolution and attention on padding token indices. Mask values selected in [0, 1]\n */\n async _call(model_inputs) {\n return new CausalLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * Wav2Vec2Bert Model with a sequence classification head on top (a linear layer over the pooled output).\n */\nclass Wav2Vec2BertForSequenceClassification extends Wav2Vec2BertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Hubert models\nclass HubertPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Hubert Model transformer outputting raw hidden-states without any specific head on top.\n * \n * **Example:** Load and run a `HubertModel` for feature extraction.\n * \n * ```javascript\n * import { AutoProcessor, AutoModel, read_audio } from '@xenova/transformers';\n * \n * // Read and preprocess audio\n * const processor = await AutoProcessor.from_pretrained('Xenova/hubert-base-ls960');\n * const audio = await read_audio('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav', 16000);\n * const inputs = await processor(audio);\n * \n * // Load and run model with inputs\n * const model = await AutoModel.from_pretrained('Xenova/hubert-base-ls960');\n * const output = await model(inputs);\n * // {\n * // last_hidden_state: Tensor {\n * // dims: [ 1, 549, 768 ],\n * // type: 'float32',\n * // data: Float32Array(421632) [0.0682469978928566, 0.08104046434164047, -0.4975186586380005, ...],\n * // size: 421632\n * // }\n * // }\n * ```\n */\nclass HubertModel extends Wav2Vec2PreTrainedModel { }\n\n/**\n * Hubert Model with a `language modeling` head on top for Connectionist Temporal Classification (CTC).\n */\nclass HubertForCTC extends Wav2Vec2PreTrainedModel {\n /**\n * @param {Object} model_inputs\n * @param {Tensor} model_inputs.input_values Float values of input raw speech waveform.\n * @param {Tensor} model_inputs.attention_mask Mask to avoid performing convolution and attention on padding token indices. Mask values selected in [0, 1]\n */\n async _call(model_inputs) {\n return new CausalLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * Hubert Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like SUPERB Keyword Spotting.\n */\nclass HubertForSequenceClassification extends Wav2Vec2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// WavLM models\n/**\n * An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.\n */\nclass WavLMPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare WavLM Model transformer outputting raw hidden-states without any specific head on top.\n * \n * **Example:** Load and run a `WavLMModel` for feature extraction.\n * \n * ```javascript\n * import { AutoProcessor, AutoModel, read_audio } from '@xenova/transformers';\n * \n * // Read and preprocess audio\n * const processor = await AutoProcessor.from_pretrained('Xenova/wavlm-base');\n * const audio = await read_audio('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav', 16000);\n * const inputs = await processor(audio);\n * \n * // Run model with inputs\n * const model = await AutoModel.from_pretrained('Xenova/wavlm-base');\n * const output = await model(inputs);\n * // {\n * // last_hidden_state: Tensor {\n * // dims: [ 1, 549, 768 ],\n * // type: 'float32',\n * // data: Float32Array(421632) [-0.349443256855011, -0.39341306686401367, 0.022836603224277496, ...],\n * // size: 421632\n * // }\n * // }\n * ```\n */\nclass WavLMModel extends WavLMPreTrainedModel { }\n\n/**\n * WavLM Model with a `language modeling` head on top for Connectionist Temporal Classification (CTC).\n */\nclass WavLMForCTC extends WavLMPreTrainedModel {\n /**\n * @param {Object} model_inputs\n * @param {Tensor} model_inputs.input_values Float values of input raw speech waveform.\n * @param {Tensor} model_inputs.attention_mask Mask to avoid performing convolution and attention on padding token indices. Mask values selected in [0, 1]\n */\n async _call(model_inputs) {\n return new CausalLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * WavLM Model with a sequence classification head on top (a linear layer over the pooled output).\n */\nclass WavLMForSequenceClassification extends WavLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n//////////////////////////////////////////////////\n// SpeechT5 models\n/**\n * An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.\n */\nclass SpeechT5PreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare SpeechT5 Encoder-Decoder Model outputting raw hidden-states without any specific pre- or post-nets.\n */\nclass SpeechT5Model extends SpeechT5PreTrainedModel { };\n\n/**\n * SpeechT5 Model with a speech encoder and a text decoder.\n * \n * **Example:** Generate speech from text with `SpeechT5ForSpeechToText`.\n * ```javascript\n * import { AutoTokenizer, AutoProcessor, SpeechT5ForTextToSpeech, SpeechT5HifiGan, Tensor } from '@xenova/transformers';\n * \n * // Load the tokenizer and processor\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/speecht5_tts');\n * const processor = await AutoProcessor.from_pretrained('Xenova/speecht5_tts');\n * \n * // Load the models\n * // NOTE: We use the unquantized versions as they are more accurate\n * const model = await SpeechT5ForTextToSpeech.from_pretrained('Xenova/speecht5_tts', { quantized: false });\n * const vocoder = await SpeechT5HifiGan.from_pretrained('Xenova/speecht5_hifigan', { quantized: false });\n * \n * // Load speaker embeddings from URL\n * const speaker_embeddings_data = new Float32Array(\n * await (await fetch('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/speaker_embeddings.bin')).arrayBuffer()\n * );\n * const speaker_embeddings = new Tensor(\n * 'float32',\n * speaker_embeddings_data,\n * [1, speaker_embeddings_data.length]\n * )\n * \n * // Run tokenization\n * const { input_ids } = tokenizer('Hello, my dog is cute');\n * \n * // Generate waveform\n * const { waveform } = await model.generate_speech(input_ids, speaker_embeddings, { vocoder });\n * console.log(waveform)\n * // Tensor {\n * // dims: [ 26112 ],\n * // type: 'float32',\n * // size: 26112,\n * // data: Float32Array(26112) [ -0.00043630177970044315, -0.00018082228780258447, ... ],\n * // }\n * ```\n */\nclass SpeechT5ForSpeechToText extends SpeechT5PreTrainedModel { }\n\n/**\n * SpeechT5 Model with a text encoder and a speech decoder.\n */\nclass SpeechT5ForTextToSpeech extends SpeechT5PreTrainedModel {\n\n /**\n * Creates a new instance of the `SpeechT5ForTextToSpeech` class.\n * @param {Object} config The model configuration.\n * @param {any} session session for the model.\n * @param {any} decoder_merged_session session for the decoder.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.hidden_size / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.hidden_size / this.num_encoder_heads;\n }\n\n /**\n * @typedef {Object} SpeechOutput\n * @property {Tensor} [spectrogram] The predicted log-mel spectrogram of shape\n * `(output_sequence_length, config.num_mel_bins)`. Returned when no `vocoder` is provided\n * @property {Tensor} [waveform] The predicted waveform of shape `(num_frames,)`. Returned when a `vocoder` is provided.\n * @property {Tensor} [cross_attentions] The outputs of the decoder's cross-attention layers of shape\n * `(config.decoder_layers, config.decoder_attention_heads, output_sequence_length, input_sequence_length)`. returned when `output_cross_attentions` is `true`.\n */\n\n /**\n * Converts a sequence of input tokens into a sequence of mel spectrograms, which are subsequently turned into a speech waveform using a vocoder.\n * @param {Tensor} input_values Indices of input sequence tokens in the vocabulary.\n * @param {Tensor} speaker_embeddings Tensor containing the speaker embeddings.\n * @param {Object} options Optional parameters for generating speech.\n * @param {number} [options.threshold=0.5] The generated sequence ends when the predicted stop token probability exceeds this value.\n * @param {number} [options.minlenratio=0.0] Used to calculate the minimum required length for the output sequence.\n * @param {number} [options.maxlenratio=20.0] Used to calculate the maximum allowed length for the output sequence.\n * @param {Object} [options.vocoder=null] The vocoder that converts the mel spectrogram into a speech waveform. If `null`, the output is the mel spectrogram.\n * @param {boolean} [options.output_cross_attentions=false] Whether or not to return the attentions tensors of the decoder's cross-attention layers.\n * @returns {Promise} A promise which resolves to an object containing the spectrogram, waveform, and cross-attention tensors.\n */\n async generate_speech(input_values, speaker_embeddings, {\n threshold = 0.5,\n minlenratio = 0.0,\n maxlenratio = 20.0,\n vocoder = null,\n // output_cross_attentions = false, // TODO add\n } = {}) {\n\n const model_inputs = {\n input_ids: input_values\n }\n\n const { encoder_outputs, encoder_attention_mask } = await encoderForward(this, model_inputs);\n\n const r = encoder_outputs.dims[1] / this.config.reduction_factor;\n const maxlen = Math.floor(r * maxlenratio);\n const minlen = Math.floor(r * minlenratio);\n\n const num_mel_bins = this.config.num_mel_bins;\n\n let spectrogramParts = [];\n let past_key_values = null;\n let decoder_outputs = null;\n let idx = 0;\n\n while (true) {\n ++idx;\n\n const use_cache_branch = boolTensor(!!decoder_outputs);\n let output_sequence;\n if (decoder_outputs) {\n output_sequence = decoder_outputs.output_sequence_out;\n } else {\n output_sequence = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor(\n 'float32',\n new Float32Array(num_mel_bins),\n [1, 1, num_mel_bins],\n )\n }\n let decoderFeeds = {\n use_cache_branch,\n output_sequence,\n encoder_attention_mask: encoder_attention_mask,\n speaker_embeddings: speaker_embeddings,\n encoder_hidden_states: encoder_outputs,\n };\n\n this.addPastKeyValues(decoderFeeds, past_key_values);\n decoder_outputs = await sessionRun(this.decoder_merged_session, decoderFeeds);\n past_key_values = this.getPastKeyValues(decoder_outputs, past_key_values);\n\n const { prob, spectrum } = decoder_outputs;\n spectrogramParts.push(spectrum);\n\n if (idx >= minlen && (\n // Finished when stop token or maximum length is reached.\n Array.from(prob.data).filter(p => p >= threshold).length > 0 || idx >= maxlen\n )) {\n break;\n }\n }\n\n const spectrogram = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.cat)(spectrogramParts);\n const { waveform } = await sessionRun(vocoder.session, { spectrogram });\n\n return {\n spectrogram,\n waveform,\n // cross_attentions: null, // TODO add\n }\n }\n}\n\n/**\n * HiFi-GAN vocoder.\n * \n * See [SpeechT5ForSpeechToText](./models#module_models.SpeechT5ForSpeechToText) for example usage.\n */\nclass SpeechT5HifiGan extends PreTrainedModel {\n main_input_name = 'spectrogram';\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// TrOCR models\nclass TrOCRPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `TrOCRPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id;\n\n this.num_encoder_layers = this.num_decoder_layers = this.config.decoder_layers;\n this.num_encoder_heads = this.num_decoder_heads = this.config.decoder_attention_heads;\n this.encoder_dim_kv = this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n }\n}\n\n/**\n * The TrOCR Decoder with a language modeling head.\n */\nclass TrOCRForCausalLM extends TrOCRPreTrainedModel { }\n\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Mistral models\n/**\n * The bare Mistral Model outputting raw hidden-states without any specific head on top.\n */\nclass MistralPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `MistralPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_key_value_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.config.num_attention_heads;\n }\n}\n\nclass MistralModel extends MistralPreTrainedModel { }\n\nclass MistralForCausalLM extends MistralPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Falcon models\n/**\n * The bare Falcon Model outputting raw hidden-states without any specific head on top.\n */\nclass FalconPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `FalconPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_attention_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.config.num_attention_heads;\n }\n}\n\nclass FalconModel extends FalconPreTrainedModel { }\n\nclass FalconForCausalLM extends FalconPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// CLAP models\nclass ClapPreTrainedModel extends PreTrainedModel { }\n\nclass ClapModel extends ClapPreTrainedModel { }\n\n/**\n * CLAP Text Model with a projection layer on top (a linear layer on top of the pooled output).\n * \n * **Example:** Compute text embeddings with `ClapTextModelWithProjection`.\n * \n * ```javascript\n * import { AutoTokenizer, ClapTextModelWithProjection } from '@xenova/transformers';\n * \n * // Load tokenizer and text model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/clap-htsat-unfused');\n * const text_model = await ClapTextModelWithProjection.from_pretrained('Xenova/clap-htsat-unfused');\n * \n * // Run tokenization\n * const texts = ['a sound of a cat', 'a sound of a dog'];\n * const text_inputs = tokenizer(texts, { padding: true, truncation: true });\n * \n * // Compute embeddings\n * const { text_embeds } = await text_model(text_inputs);\n * // Tensor {\n * // dims: [ 2, 512 ],\n * // type: 'float32',\n * // data: Float32Array(1024) [ ... ],\n * // size: 1024\n * // }\n * ```\n */\nclass ClapTextModelWithProjection extends ClapPreTrainedModel {\n\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'text_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n\n/**\n * CLAP Audio Model with a projection layer on top (a linear layer on top of the pooled output).\n * \n * **Example:** Compute audio embeddings with `ClapAudioModelWithProjection`.\n * \n * ```javascript\n * import { AutoProcessor, ClapAudioModelWithProjection, read_audio } from '@xenova/transformers';\n * \n * // Load processor and audio model\n * const processor = await AutoProcessor.from_pretrained('Xenova/clap-htsat-unfused');\n * const audio_model = await ClapAudioModelWithProjection.from_pretrained('Xenova/clap-htsat-unfused');\n * \n * // Read audio and run processor\n * const audio = await read_audio('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cat_meow.wav');\n * const audio_inputs = await processor(audio);\n * \n * // Compute embeddings\n * const { audio_embeds } = await audio_model(audio_inputs);\n * // Tensor {\n * // dims: [ 1, 512 ],\n * // type: 'float32',\n * // data: Float32Array(512) [ ... ],\n * // size: 512\n * // }\n * ```\n */\nclass ClapAudioModelWithProjection extends ClapPreTrainedModel {\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'audio_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// VITS models\nclass VitsPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The complete VITS model, for text-to-speech synthesis.\n * \n * **Example:** Generate speech from text with `VitsModel`.\n * ```javascript\n * import { AutoTokenizer, VitsModel } from '@xenova/transformers';\n * \n * // Load the tokenizer and model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/mms-tts-eng');\n * const model = await VitsModel.from_pretrained('Xenova/mms-tts-eng');\n * \n * // Run tokenization\n * const inputs = tokenizer('I love transformers');\n * \n * // Generate waveform\n * const { waveform } = await model(inputs);\n * // Tensor {\n * // dims: [ 1, 35328 ],\n * // type: 'float32',\n * // data: Float32Array(35328) [ ... ],\n * // size: 35328,\n * // }\n * ```\n */\nclass VitsModel extends VitsPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} The outputs for the VITS model.\n */\n async _call(model_inputs) {\n return new VitsModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Segformer models\nclass SegformerPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare SegFormer encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.\n */\nclass SegformerModel extends SegformerPreTrainedModel { }\n\n/**\n * SegFormer Model transformer with an image classification head on top (a linear layer on top of the final hidden states) e.g. for ImageNet.\n */\nclass SegformerForImageClassification extends SegformerPreTrainedModel { }\n\n/**\n * SegFormer Model transformer with an all-MLP decode head on top e.g. for ADE20k, CityScapes.\n */\nclass SegformerForSemanticSegmentation extends SegformerPreTrainedModel { }\n\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// AutoModels, used to simplify construction of PreTrainedModels\n// (uses config to instantiate correct class)\n\n/**\n * Base class of all AutoModels. Contains the `from_pretrained` function\n * which is used to instantiate pretrained models.\n */\nclass PretrainedMixin {\n /**\n * Mapping from model type to model class.\n * @type {Map[]}\n */\n static MODEL_CLASS_MAPPINGS = null;\n\n /**\n * Whether to attempt to instantiate the base class (`PretrainedModel`) if \n * the model type is not found in the mapping.\n */\n static BASE_IF_FAIL = false;\n\n\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, {\n quantized = true,\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n model_file_name = null,\n } = {}) {\n\n let options = {\n quantized,\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n model_file_name,\n }\n config = await _configs_js__WEBPACK_IMPORTED_MODULE_0__.AutoConfig.from_pretrained(pretrained_model_name_or_path, options);\n if (!options.config) {\n // If no config was passed, reuse this config for future processing\n options.config = config;\n }\n\n if (!this.MODEL_CLASS_MAPPINGS) {\n throw new Error(\"`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: \" + this.name);\n }\n\n for (let MODEL_CLASS_MAPPING of this.MODEL_CLASS_MAPPINGS) {\n const modelInfo = MODEL_CLASS_MAPPING.get(config.model_type);\n if (!modelInfo) {\n continue; // Item not found in this mapping\n }\n return await modelInfo[1].from_pretrained(pretrained_model_name_or_path, options);\n }\n\n if (this.BASE_IF_FAIL) {\n console.warn(`Unknown model class \"${config.model_type}\", attempting to construct from base class.`);\n return await PreTrainedModel.from_pretrained(pretrained_model_name_or_path, options);\n } else {\n throw Error(`Unsupported model type: ${config.model_type}`)\n }\n }\n}\n\nconst MODEL_MAPPING_NAMES_ENCODER_ONLY = new Map([\n ['bert', ['BertModel', BertModel]],\n ['nomic_bert', ['NomicBertModel', NomicBertModel]],\n ['roformer', ['RoFormerModel', RoFormerModel]],\n ['electra', ['ElectraModel', ElectraModel]],\n ['esm', ['EsmModel', EsmModel]],\n ['convbert', ['ConvBertModel', ConvBertModel]],\n ['camembert', ['CamembertModel', CamembertModel]],\n ['deberta', ['DebertaModel', DebertaModel]],\n ['deberta-v2', ['DebertaV2Model', DebertaV2Model]],\n ['mpnet', ['MPNetModel', MPNetModel]],\n ['albert', ['AlbertModel', AlbertModel]],\n ['distilbert', ['DistilBertModel', DistilBertModel]],\n ['roberta', ['RobertaModel', RobertaModel]],\n ['xlm', ['XLMModel', XLMModel]],\n ['xlm-roberta', ['XLMRobertaModel', XLMRobertaModel]],\n ['clap', ['ClapModel', ClapModel]],\n ['clip', ['CLIPModel', CLIPModel]],\n ['clipseg', ['CLIPSegModel', CLIPSegModel]],\n ['chinese_clip', ['ChineseCLIPModel', ChineseCLIPModel]],\n ['siglip', ['SiglipModel', SiglipModel]],\n ['mobilebert', ['MobileBertModel', MobileBertModel]],\n ['squeezebert', ['SqueezeBertModel', SqueezeBertModel]],\n ['wav2vec2', ['Wav2Vec2Model', Wav2Vec2Model]],\n ['wav2vec2-bert', ['Wav2Vec2BertModel', Wav2Vec2BertModel]],\n ['hubert', ['HubertModel', HubertModel]],\n ['wavlm', ['WavLMModel', WavLMModel]],\n ['audio-spectrogram-transformer', ['ASTModel', ASTModel]],\n ['vits', ['VitsModel', VitsModel]],\n\n ['detr', ['DetrModel', DetrModel]],\n ['table-transformer', ['TableTransformerModel', TableTransformerModel]],\n ['vit', ['ViTModel', ViTModel]],\n ['mobilevit', ['MobileViTModel', MobileViTModel]],\n ['owlvit', ['OwlViTModel', OwlViTModel]],\n ['owlv2', ['Owlv2Model', Owlv2Model]],\n ['beit', ['BeitModel', BeitModel]],\n ['deit', ['DeiTModel', DeiTModel]],\n ['convnext', ['ConvNextModel', ConvNextModel]],\n ['convnextv2', ['ConvNextV2Model', ConvNextV2Model]],\n ['dinov2', ['Dinov2Model', Dinov2Model]],\n ['resnet', ['ResNetModel', ResNetModel]],\n ['swin', ['SwinModel', SwinModel]],\n ['swin2sr', ['Swin2SRModel', Swin2SRModel]],\n ['donut-swin', ['DonutSwinModel', DonutSwinModel]],\n ['yolos', ['YolosModel', YolosModel]],\n ['dpt', ['DPTModel', DPTModel]],\n ['glpn', ['GLPNModel', GLPNModel]],\n\n ['hifigan', ['SpeechT5HifiGan', SpeechT5HifiGan]],\n\n]);\n\nconst MODEL_MAPPING_NAMES_ENCODER_DECODER = new Map([\n ['t5', ['T5Model', T5Model]],\n ['longt5', ['LongT5Model', LongT5Model]],\n ['mt5', ['MT5Model', MT5Model]],\n ['bart', ['BartModel', BartModel]],\n ['mbart', ['MBartModel', MBartModel]],\n ['marian', ['MarianModel', MarianModel]],\n ['whisper', ['WhisperModel', WhisperModel]],\n ['m2m_100', ['M2M100Model', M2M100Model]],\n ['blenderbot', ['BlenderbotModel', BlenderbotModel]],\n ['blenderbot-small', ['BlenderbotSmallModel', BlenderbotSmallModel]],\n]);\n\n\nconst MODEL_MAPPING_NAMES_DECODER_ONLY = new Map([\n ['bloom', ['BloomModel', BloomModel]],\n ['gpt2', ['GPT2Model', GPT2Model]],\n ['gptj', ['GPTJModel', GPTJModel]],\n ['gpt_bigcode', ['GPTBigCodeModel', GPTBigCodeModel]],\n ['gpt_neo', ['GPTNeoModel', GPTNeoModel]],\n ['gpt_neox', ['GPTNeoXModel', GPTNeoXModel]],\n ['codegen', ['CodeGenModel', CodeGenModel]],\n ['llama', ['LlamaModel', LlamaModel]],\n ['qwen2', ['Qwen2Model', Qwen2Model]],\n ['phi', ['PhiModel', PhiModel]],\n ['mpt', ['MptModel', MptModel]],\n ['opt', ['OPTModel', OPTModel]],\n ['mistral', ['MistralModel', MistralModel]],\n ['falcon', ['FalconModel', FalconModel]],\n]);\n\nconst MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES = new Map([\n ['speecht5', ['SpeechT5ForSpeechToText', SpeechT5ForSpeechToText]],\n ['whisper', ['WhisperForConditionalGeneration', WhisperForConditionalGeneration]],\n]);\n\nconst MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES = new Map([\n ['speecht5', ['SpeechT5ForTextToSpeech', SpeechT5ForTextToSpeech]],\n]);\n\nconst MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES = new Map([\n ['vits', ['VitsModel', VitsModel]],\n]);\n\nconst MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES = new Map([\n ['bert', ['BertForSequenceClassification', BertForSequenceClassification]],\n ['roformer', ['RoFormerForSequenceClassification', RoFormerForSequenceClassification]],\n ['electra', ['ElectraForSequenceClassification', ElectraForSequenceClassification]],\n ['esm', ['EsmForSequenceClassification', EsmForSequenceClassification]],\n ['convbert', ['ConvBertForSequenceClassification', ConvBertForSequenceClassification]],\n ['camembert', ['CamembertForSequenceClassification', CamembertForSequenceClassification]],\n ['deberta', ['DebertaForSequenceClassification', DebertaForSequenceClassification]],\n ['deberta-v2', ['DebertaV2ForSequenceClassification', DebertaV2ForSequenceClassification]],\n ['mpnet', ['MPNetForSequenceClassification', MPNetForSequenceClassification]],\n ['albert', ['AlbertForSequenceClassification', AlbertForSequenceClassification]],\n ['distilbert', ['DistilBertForSequenceClassification', DistilBertForSequenceClassification]],\n ['roberta', ['RobertaForSequenceClassification', RobertaForSequenceClassification]],\n ['xlm', ['XLMForSequenceClassification', XLMForSequenceClassification]],\n ['xlm-roberta', ['XLMRobertaForSequenceClassification', XLMRobertaForSequenceClassification]],\n ['bart', ['BartForSequenceClassification', BartForSequenceClassification]],\n ['mbart', ['MBartForSequenceClassification', MBartForSequenceClassification]],\n ['mobilebert', ['MobileBertForSequenceClassification', MobileBertForSequenceClassification]],\n ['squeezebert', ['SqueezeBertForSequenceClassification', SqueezeBertForSequenceClassification]],\n]);\n\nconst MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES = new Map([\n ['bert', ['BertForTokenClassification', BertForTokenClassification]],\n ['roformer', ['RoFormerForTokenClassification', RoFormerForTokenClassification]],\n ['electra', ['ElectraForTokenClassification', ElectraForTokenClassification]],\n ['esm', ['EsmForTokenClassification', EsmForTokenClassification]],\n ['convbert', ['ConvBertForTokenClassification', ConvBertForTokenClassification]],\n ['camembert', ['CamembertForTokenClassification', CamembertForTokenClassification]],\n ['deberta', ['DebertaForTokenClassification', DebertaForTokenClassification]],\n ['deberta-v2', ['DebertaV2ForTokenClassification', DebertaV2ForTokenClassification]],\n ['mpnet', ['MPNetForTokenClassification', MPNetForTokenClassification]],\n ['distilbert', ['DistilBertForTokenClassification', DistilBertForTokenClassification]],\n ['roberta', ['RobertaForTokenClassification', RobertaForTokenClassification]],\n ['xlm', ['XLMForTokenClassification', XLMForTokenClassification]],\n ['xlm-roberta', ['XLMRobertaForTokenClassification', XLMRobertaForTokenClassification]],\n]);\n\nconst MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES = new Map([\n ['t5', ['T5ForConditionalGeneration', T5ForConditionalGeneration]],\n ['longt5', ['LongT5ForConditionalGeneration', LongT5ForConditionalGeneration]],\n ['mt5', ['MT5ForConditionalGeneration', MT5ForConditionalGeneration]],\n ['bart', ['BartForConditionalGeneration', BartForConditionalGeneration]],\n ['mbart', ['MBartForConditionalGeneration', MBartForConditionalGeneration]],\n ['marian', ['MarianMTModel', MarianMTModel]],\n ['m2m_100', ['M2M100ForConditionalGeneration', M2M100ForConditionalGeneration]],\n ['blenderbot', ['BlenderbotForConditionalGeneration', BlenderbotForConditionalGeneration]],\n ['blenderbot-small', ['BlenderbotSmallForConditionalGeneration', BlenderbotSmallForConditionalGeneration]],\n]);\n\nconst MODEL_WITH_LM_HEAD_MAPPING_NAMES = new Map([\n ['bloom', ['BloomForCausalLM', BloomForCausalLM]],\n ['gpt2', ['GPT2LMHeadModel', GPT2LMHeadModel]],\n ['gptj', ['GPTJForCausalLM', GPTJForCausalLM]],\n ['gpt_bigcode', ['GPTBigCodeForCausalLM', GPTBigCodeForCausalLM]],\n ['gpt_neo', ['GPTNeoForCausalLM', GPTNeoForCausalLM]],\n ['gpt_neox', ['GPTNeoXForCausalLM', GPTNeoXForCausalLM]],\n ['codegen', ['CodeGenForCausalLM', CodeGenForCausalLM]],\n ['llama', ['LlamaForCausalLM', LlamaForCausalLM]],\n ['qwen2', ['Qwen2ForCausalLM', Qwen2ForCausalLM]],\n ['phi', ['PhiForCausalLM', PhiForCausalLM]],\n ['mpt', ['MptForCausalLM', MptForCausalLM]],\n ['opt', ['OPTForCausalLM', OPTForCausalLM]],\n ['mbart', ['MBartForCausalLM', MBartForCausalLM]],\n ['mistral', ['MistralForCausalLM', MistralForCausalLM]],\n ['falcon', ['FalconForCausalLM', FalconForCausalLM]],\n ['trocr', ['TrOCRForCausalLM', TrOCRForCausalLM]],\n]);\n\nconst MODEL_FOR_MASKED_LM_MAPPING_NAMES = new Map([\n ['bert', ['BertForMaskedLM', BertForMaskedLM]],\n ['roformer', ['RoFormerForMaskedLM', RoFormerForMaskedLM]],\n ['electra', ['ElectraForMaskedLM', ElectraForMaskedLM]],\n ['esm', ['EsmForMaskedLM', EsmForMaskedLM]],\n ['convbert', ['ConvBertForMaskedLM', ConvBertForMaskedLM]],\n ['camembert', ['CamembertForMaskedLM', CamembertForMaskedLM]],\n ['deberta', ['DebertaForMaskedLM', DebertaForMaskedLM]],\n ['deberta-v2', ['DebertaV2ForMaskedLM', DebertaV2ForMaskedLM]],\n ['mpnet', ['MPNetForMaskedLM', MPNetForMaskedLM]],\n ['albert', ['AlbertForMaskedLM', AlbertForMaskedLM]],\n ['distilbert', ['DistilBertForMaskedLM', DistilBertForMaskedLM]],\n ['roberta', ['RobertaForMaskedLM', RobertaForMaskedLM]],\n ['xlm', ['XLMWithLMHeadModel', XLMWithLMHeadModel]],\n ['xlm-roberta', ['XLMRobertaForMaskedLM', XLMRobertaForMaskedLM]],\n ['mobilebert', ['MobileBertForMaskedLM', MobileBertForMaskedLM]],\n ['squeezebert', ['SqueezeBertForMaskedLM', SqueezeBertForMaskedLM]],\n]);\n\nconst MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES = new Map([\n ['bert', ['BertForQuestionAnswering', BertForQuestionAnswering]],\n ['roformer', ['RoFormerForQuestionAnswering', RoFormerForQuestionAnswering]],\n ['electra', ['ElectraForQuestionAnswering', ElectraForQuestionAnswering]],\n ['convbert', ['ConvBertForQuestionAnswering', ConvBertForQuestionAnswering]],\n ['camembert', ['CamembertForQuestionAnswering', CamembertForQuestionAnswering]],\n ['deberta', ['DebertaForQuestionAnswering', DebertaForQuestionAnswering]],\n ['deberta-v2', ['DebertaV2ForQuestionAnswering', DebertaV2ForQuestionAnswering]],\n ['mpnet', ['MPNetForQuestionAnswering', MPNetForQuestionAnswering]],\n ['albert', ['AlbertForQuestionAnswering', AlbertForQuestionAnswering]],\n ['distilbert', ['DistilBertForQuestionAnswering', DistilBertForQuestionAnswering]],\n ['roberta', ['RobertaForQuestionAnswering', RobertaForQuestionAnswering]],\n ['xlm', ['XLMForQuestionAnswering', XLMForQuestionAnswering]],\n ['xlm-roberta', ['XLMRobertaForQuestionAnswering', XLMRobertaForQuestionAnswering]],\n ['mobilebert', ['MobileBertForQuestionAnswering', MobileBertForQuestionAnswering]],\n ['squeezebert', ['SqueezeBertForQuestionAnswering', SqueezeBertForQuestionAnswering]],\n]);\n\nconst MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES = new Map([\n ['vision-encoder-decoder', ['VisionEncoderDecoderModel', VisionEncoderDecoderModel]],\n]);\n\nconst MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES = new Map([\n ['vision-encoder-decoder', ['VisionEncoderDecoderModel', VisionEncoderDecoderModel]],\n]);\n\nconst MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES = new Map([\n ['vit', ['ViTForImageClassification', ViTForImageClassification]],\n ['mobilevit', ['MobileViTForImageClassification', MobileViTForImageClassification]],\n ['beit', ['BeitForImageClassification', BeitForImageClassification]],\n ['deit', ['DeiTForImageClassification', DeiTForImageClassification]],\n ['convnext', ['ConvNextForImageClassification', ConvNextForImageClassification]],\n ['convnextv2', ['ConvNextV2ForImageClassification', ConvNextV2ForImageClassification]],\n ['dinov2', ['Dinov2ForImageClassification', Dinov2ForImageClassification]],\n ['resnet', ['ResNetForImageClassification', ResNetForImageClassification]],\n ['swin', ['SwinForImageClassification', SwinForImageClassification]],\n ['segformer', ['SegformerForImageClassification', SegformerForImageClassification]],\n]);\n\nconst MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES = new Map([\n ['detr', ['DetrForObjectDetection', DetrForObjectDetection]],\n ['table-transformer', ['TableTransformerForObjectDetection', TableTransformerForObjectDetection]],\n ['yolos', ['YolosForObjectDetection', YolosForObjectDetection]],\n]);\n\nconst MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES = new Map([\n ['owlvit', ['OwlViTForObjectDetection', OwlViTForObjectDetection]],\n ['owlv2', ['Owlv2ForObjectDetection', Owlv2ForObjectDetection]],\n]);\n\nconst MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES = new Map([\n ['detr', ['DetrForSegmentation', DetrForSegmentation]],\n ['clipseg', ['CLIPSegForImageSegmentation', CLIPSegForImageSegmentation]],\n]);\n\nconst MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES = new Map([\n ['segformer', ['SegformerForSemanticSegmentation', SegformerForSemanticSegmentation]],\n]);\n\nconst MODEL_FOR_MASK_GENERATION_MAPPING_NAMES = new Map([\n ['sam', ['SamModel', SamModel]],\n]);\n\nconst MODEL_FOR_CTC_MAPPING_NAMES = new Map([\n ['wav2vec2', ['Wav2Vec2ForCTC', Wav2Vec2ForCTC]],\n ['wav2vec2-bert', ['Wav2Vec2BertForCTC', Wav2Vec2BertForCTC]],\n ['wavlm', ['WavLMForCTC', WavLMForCTC]],\n ['hubert', ['HubertForCTC', HubertForCTC]],\n]);\n\nconst MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES = new Map([\n ['wav2vec2', ['Wav2Vec2ForSequenceClassification', Wav2Vec2ForSequenceClassification]],\n ['wav2vec2-bert', ['Wav2Vec2BertForSequenceClassification', Wav2Vec2BertForSequenceClassification]],\n ['wavlm', ['WavLMForSequenceClassification', WavLMForSequenceClassification]],\n ['hubert', ['HubertForSequenceClassification', HubertForSequenceClassification]],\n ['audio-spectrogram-transformer', ['ASTForAudioClassification', ASTForAudioClassification]],\n]);\n\nconst MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES = new Map([\n ['vitmatte', ['VitMatteForImageMatting', VitMatteForImageMatting]],\n]);\n\nconst MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES = new Map([\n ['swin2sr', ['Swin2SRForImageSuperResolution', Swin2SRForImageSuperResolution]],\n])\n\nconst MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES = new Map([\n ['dpt', ['DPTForDepthEstimation', DPTForDepthEstimation]],\n ['depth_anything', ['DepthAnythingForDepthEstimation', DepthAnythingForDepthEstimation]],\n ['glpn', ['GLPNForDepthEstimation', GLPNForDepthEstimation]],\n])\n\n\nconst MODEL_CLASS_TYPE_MAPPING = [\n [MODEL_MAPPING_NAMES_ENCODER_ONLY, MODEL_TYPES.EncoderOnly],\n [MODEL_MAPPING_NAMES_ENCODER_DECODER, MODEL_TYPES.EncoderDecoder],\n [MODEL_MAPPING_NAMES_DECODER_ONLY, MODEL_TYPES.DecoderOnly],\n [MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES, MODEL_TYPES.Seq2Seq],\n [MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES, MODEL_TYPES.Seq2Seq],\n [MODEL_WITH_LM_HEAD_MAPPING_NAMES, MODEL_TYPES.DecoderOnly],\n [MODEL_FOR_MASKED_LM_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES, MODEL_TYPES.Vision2Seq],\n [MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_MASK_GENERATION_MAPPING_NAMES, MODEL_TYPES.MaskGeneration],\n [MODEL_FOR_CTC_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES, MODEL_TYPES.Seq2Seq],\n [MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n];\n\nfor (const [mappings, type] of MODEL_CLASS_TYPE_MAPPING) {\n // @ts-ignore\n for (const [name, model] of mappings.values()) {\n MODEL_TYPE_MAPPING.set(name, type);\n MODEL_CLASS_TO_NAME_MAPPING.set(model, name);\n MODEL_NAME_TO_CLASS_MAPPING.set(name, model);\n }\n}\n\nconst CUSTOM_MAPPING = [\n ['CLIPTextModelWithProjection', CLIPTextModelWithProjection, MODEL_TYPES.EncoderOnly],\n ['CLIPVisionModelWithProjection', CLIPVisionModelWithProjection, MODEL_TYPES.EncoderOnly],\n ['SiglipTextModel', SiglipTextModel, MODEL_TYPES.EncoderOnly],\n ['SiglipVisionModel', SiglipVisionModel, MODEL_TYPES.EncoderOnly],\n ['ClapTextModelWithProjection', ClapTextModelWithProjection, MODEL_TYPES.EncoderOnly],\n ['ClapAudioModelWithProjection', ClapAudioModelWithProjection, MODEL_TYPES.EncoderOnly],\n]\nfor (const [name, model, type] of CUSTOM_MAPPING) {\n MODEL_TYPE_MAPPING.set(name, type);\n MODEL_CLASS_TO_NAME_MAPPING.set(model, name);\n MODEL_NAME_TO_CLASS_MAPPING.set(name, model);\n}\n\n\n/**\n * Helper class which is used to instantiate pretrained models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModel.from_pretrained('bert-base-uncased');\n */\nclass AutoModel extends PretrainedMixin {\n /** @type {Map[]} */\n // @ts-ignore\n static MODEL_CLASS_MAPPINGS = MODEL_CLASS_TYPE_MAPPING.map(x => x[0]);\n static BASE_IF_FAIL = true;\n}\n\n/**\n * Helper class which is used to instantiate pretrained sequence classification models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForSequenceClassification.from_pretrained('distilbert-base-uncased-finetuned-sst-2-english');\n */\nclass AutoModelForSequenceClassification extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained token classification models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForTokenClassification.from_pretrained('Davlan/distilbert-base-multilingual-cased-ner-hrl');\n */\nclass AutoModelForTokenClassification extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained sequence-to-sequence models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForSeq2SeqLM.from_pretrained('t5-small');\n */\nclass AutoModelForSeq2SeqLM extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained sequence-to-sequence speech-to-text models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForSpeechSeq2Seq.from_pretrained('openai/whisper-tiny.en');\n */\nclass AutoModelForSpeechSeq2Seq extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained sequence-to-sequence text-to-spectrogram models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForTextToSpectrogram.from_pretrained('microsoft/speecht5_tts');\n */\nclass AutoModelForTextToSpectrogram extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained text-to-waveform models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForTextToSpectrogram.from_pretrained('facebook/mms-tts-eng');\n */\nclass AutoModelForTextToWaveform extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained causal language models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForCausalLM.from_pretrained('gpt2');\n */\nclass AutoModelForCausalLM extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_WITH_LM_HEAD_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained masked language models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForMaskedLM.from_pretrained('bert-base-uncased');\n */\nclass AutoModelForMaskedLM extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_MASKED_LM_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained question answering models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForQuestionAnswering.from_pretrained('distilbert-base-cased-distilled-squad');\n */\nclass AutoModelForQuestionAnswering extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained vision-to-sequence models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForVision2Seq.from_pretrained('nlpconnect/vit-gpt2-image-captioning');\n */\nclass AutoModelForVision2Seq extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained image classification models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForImageClassification.from_pretrained('google/vit-base-patch16-224');\n */\nclass AutoModelForImageClassification extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained image segmentation models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForImageSegmentation.from_pretrained('facebook/detr-resnet-50-panoptic');\n */\nclass AutoModelForImageSegmentation extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained image segmentation models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForSemanticSegmentation.from_pretrained('nvidia/segformer-b3-finetuned-cityscapes-1024-1024');\n */\nclass AutoModelForSemanticSegmentation extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained object detection models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForObjectDetection.from_pretrained('facebook/detr-resnet-50');\n */\nclass AutoModelForObjectDetection extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES];\n}\n\nclass AutoModelForZeroShotObjectDetection extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES];\n}\n\n\n/**\n * Helper class which is used to instantiate pretrained mask generation models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForMaskGeneration.from_pretrained('Xenova/sam-vit-base');\n */\nclass AutoModelForMaskGeneration extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_MASK_GENERATION_MAPPING_NAMES];\n}\n\nclass AutoModelForCTC extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_CTC_MAPPING_NAMES];\n}\n\nclass AutoModelForAudioClassification extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES];\n}\n\nclass AutoModelForDocumentQuestionAnswering extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES];\n}\n\nclass AutoModelForImageMatting extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES];\n}\n\nclass AutoModelForImageToImage extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES];\n}\n\nclass AutoModelForDepthEstimation extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES];\n}\n\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass Seq2SeqLMOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits The output logits of the model.\n * @param {Tensor} output.past_key_values An tensor of key/value pairs that represent the previous state of the model.\n * @param {Tensor} output.encoder_outputs The output of the encoder in a sequence-to-sequence model.\n * @param {Tensor} [output.decoder_attentions] Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the self-attention heads.\n * @param {Tensor} [output.cross_attentions] Attentions weights of the decoder's cross-attention layer, after the attention softmax, used to compute the weighted average in the cross-attention heads.\n */\n constructor({ logits, past_key_values, encoder_outputs, decoder_attentions = null, cross_attentions = null }) {\n super();\n this.logits = logits;\n this.past_key_values = past_key_values;\n this.encoder_outputs = encoder_outputs;\n this.decoder_attentions = decoder_attentions;\n this.cross_attentions = cross_attentions;\n }\n}\n\n/**\n * Base class for outputs of sentence classification models.\n */\nclass SequenceClassifierOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits classification (or regression if config.num_labels==1) scores (before SoftMax).\n */\n constructor({ logits }) {\n super();\n this.logits = logits;\n }\n}\n\n/**\n * Base class for outputs of token classification models.\n */\nclass TokenClassifierOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Classification scores (before SoftMax).\n */\n constructor({ logits }) {\n super();\n this.logits = logits;\n }\n}\n\n/**\n * Base class for masked language models outputs.\n */\nclass MaskedLMOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).\n */\n constructor({ logits }) {\n super();\n this.logits = logits;\n }\n}\n\n/**\n * Base class for outputs of question answering models.\n */\nclass QuestionAnsweringModelOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.start_logits Span-start scores (before SoftMax).\n * @param {Tensor} output.end_logits Span-end scores (before SoftMax).\n */\n constructor({ start_logits, end_logits }) {\n super();\n this.start_logits = start_logits;\n this.end_logits = end_logits;\n }\n}\n\n\n/**\n * Base class for causal language model (or autoregressive) outputs.\n */\nclass CausalLMOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Prediction scores of the language modeling head (scores for each vocabulary token before softmax).\n */\n constructor({ logits }) {\n super();\n this.logits = logits;\n }\n}\n\n/**\n * Base class for causal language model (or autoregressive) outputs.\n */\nclass CausalLMOutputWithPast extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Prediction scores of the language modeling head (scores for each vocabulary token before softmax).\n * @param {Tensor} output.past_key_values Contains pre-computed hidden-states (key and values in the self-attention blocks)\n * that can be used (see `past_key_values` input) to speed up sequential decoding.\n */\n constructor({ logits, past_key_values }) {\n super();\n this.logits = logits;\n this.past_key_values = past_key_values;\n }\n}\n\nclass ImageMattingOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.alphas Estimated alpha values, of shape `(batch_size, num_channels, height, width)`.\n */\n constructor({ alphas }) {\n super();\n this.alphas = alphas;\n }\n}\n\n/**\n * Describes the outputs for the VITS model.\n */\nclass VitsModelOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.waveform The final audio waveform predicted by the model, of shape `(batch_size, sequence_length)`.\n * @param {Tensor} output.spectrogram The log-mel spectrogram predicted at the output of the flow model.\n * This spectrogram is passed to the Hi-Fi GAN decoder model to obtain the final audio waveform.\n */\n constructor({ waveform, spectrogram }) {\n super();\n this.waveform = waveform;\n this.spectrogram = spectrogram;\n }\n}\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/models.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ASTForAudioClassification: () => (/* binding */ ASTForAudioClassification),\n/* harmony export */ ASTModel: () => (/* binding */ ASTModel),\n/* harmony export */ ASTPreTrainedModel: () => (/* binding */ ASTPreTrainedModel),\n/* harmony export */ AlbertForMaskedLM: () => (/* binding */ AlbertForMaskedLM),\n/* harmony export */ AlbertForQuestionAnswering: () => (/* binding */ AlbertForQuestionAnswering),\n/* harmony export */ AlbertForSequenceClassification: () => (/* binding */ AlbertForSequenceClassification),\n/* harmony export */ AlbertModel: () => (/* binding */ AlbertModel),\n/* harmony export */ AlbertPreTrainedModel: () => (/* binding */ AlbertPreTrainedModel),\n/* harmony export */ AutoModel: () => (/* binding */ AutoModel),\n/* harmony export */ AutoModelForAudioClassification: () => (/* binding */ AutoModelForAudioClassification),\n/* harmony export */ AutoModelForAudioFrameClassification: () => (/* binding */ AutoModelForAudioFrameClassification),\n/* harmony export */ AutoModelForCTC: () => (/* binding */ AutoModelForCTC),\n/* harmony export */ AutoModelForCausalLM: () => (/* binding */ AutoModelForCausalLM),\n/* harmony export */ AutoModelForDepthEstimation: () => (/* binding */ AutoModelForDepthEstimation),\n/* harmony export */ AutoModelForDocumentQuestionAnswering: () => (/* binding */ AutoModelForDocumentQuestionAnswering),\n/* harmony export */ AutoModelForImageClassification: () => (/* binding */ AutoModelForImageClassification),\n/* harmony export */ AutoModelForImageFeatureExtraction: () => (/* binding */ AutoModelForImageFeatureExtraction),\n/* harmony export */ AutoModelForImageMatting: () => (/* binding */ AutoModelForImageMatting),\n/* harmony export */ AutoModelForImageSegmentation: () => (/* binding */ AutoModelForImageSegmentation),\n/* harmony export */ AutoModelForImageToImage: () => (/* binding */ AutoModelForImageToImage),\n/* harmony export */ AutoModelForMaskGeneration: () => (/* binding */ AutoModelForMaskGeneration),\n/* harmony export */ AutoModelForMaskedLM: () => (/* binding */ AutoModelForMaskedLM),\n/* harmony export */ AutoModelForObjectDetection: () => (/* binding */ AutoModelForObjectDetection),\n/* harmony export */ AutoModelForQuestionAnswering: () => (/* binding */ AutoModelForQuestionAnswering),\n/* harmony export */ AutoModelForSemanticSegmentation: () => (/* binding */ AutoModelForSemanticSegmentation),\n/* harmony export */ AutoModelForSeq2SeqLM: () => (/* binding */ AutoModelForSeq2SeqLM),\n/* harmony export */ AutoModelForSequenceClassification: () => (/* binding */ AutoModelForSequenceClassification),\n/* harmony export */ AutoModelForSpeechSeq2Seq: () => (/* binding */ AutoModelForSpeechSeq2Seq),\n/* harmony export */ AutoModelForTextToSpectrogram: () => (/* binding */ AutoModelForTextToSpectrogram),\n/* harmony export */ AutoModelForTextToWaveform: () => (/* binding */ AutoModelForTextToWaveform),\n/* harmony export */ AutoModelForTokenClassification: () => (/* binding */ AutoModelForTokenClassification),\n/* harmony export */ AutoModelForVision2Seq: () => (/* binding */ AutoModelForVision2Seq),\n/* harmony export */ AutoModelForXVector: () => (/* binding */ AutoModelForXVector),\n/* harmony export */ AutoModelForZeroShotObjectDetection: () => (/* binding */ AutoModelForZeroShotObjectDetection),\n/* harmony export */ BartForConditionalGeneration: () => (/* binding */ BartForConditionalGeneration),\n/* harmony export */ BartForSequenceClassification: () => (/* binding */ BartForSequenceClassification),\n/* harmony export */ BartModel: () => (/* binding */ BartModel),\n/* harmony export */ BartPretrainedModel: () => (/* binding */ BartPretrainedModel),\n/* harmony export */ BaseModelOutput: () => (/* binding */ BaseModelOutput),\n/* harmony export */ BeitForImageClassification: () => (/* binding */ BeitForImageClassification),\n/* harmony export */ BeitModel: () => (/* binding */ BeitModel),\n/* harmony export */ BeitPreTrainedModel: () => (/* binding */ BeitPreTrainedModel),\n/* harmony export */ BertForMaskedLM: () => (/* binding */ BertForMaskedLM),\n/* harmony export */ BertForQuestionAnswering: () => (/* binding */ BertForQuestionAnswering),\n/* harmony export */ BertForSequenceClassification: () => (/* binding */ BertForSequenceClassification),\n/* harmony export */ BertForTokenClassification: () => (/* binding */ BertForTokenClassification),\n/* harmony export */ BertModel: () => (/* binding */ BertModel),\n/* harmony export */ BertPreTrainedModel: () => (/* binding */ BertPreTrainedModel),\n/* harmony export */ BlenderbotForConditionalGeneration: () => (/* binding */ BlenderbotForConditionalGeneration),\n/* harmony export */ BlenderbotModel: () => (/* binding */ BlenderbotModel),\n/* harmony export */ BlenderbotPreTrainedModel: () => (/* binding */ BlenderbotPreTrainedModel),\n/* harmony export */ BlenderbotSmallForConditionalGeneration: () => (/* binding */ BlenderbotSmallForConditionalGeneration),\n/* harmony export */ BlenderbotSmallModel: () => (/* binding */ BlenderbotSmallModel),\n/* harmony export */ BlenderbotSmallPreTrainedModel: () => (/* binding */ BlenderbotSmallPreTrainedModel),\n/* harmony export */ BloomForCausalLM: () => (/* binding */ BloomForCausalLM),\n/* harmony export */ BloomModel: () => (/* binding */ BloomModel),\n/* harmony export */ BloomPreTrainedModel: () => (/* binding */ BloomPreTrainedModel),\n/* harmony export */ CLIPModel: () => (/* binding */ CLIPModel),\n/* harmony export */ CLIPPreTrainedModel: () => (/* binding */ CLIPPreTrainedModel),\n/* harmony export */ CLIPSegForImageSegmentation: () => (/* binding */ CLIPSegForImageSegmentation),\n/* harmony export */ CLIPSegModel: () => (/* binding */ CLIPSegModel),\n/* harmony export */ CLIPSegPreTrainedModel: () => (/* binding */ CLIPSegPreTrainedModel),\n/* harmony export */ CLIPTextModelWithProjection: () => (/* binding */ CLIPTextModelWithProjection),\n/* harmony export */ CLIPVisionModelWithProjection: () => (/* binding */ CLIPVisionModelWithProjection),\n/* harmony export */ CamembertForMaskedLM: () => (/* binding */ CamembertForMaskedLM),\n/* harmony export */ CamembertForQuestionAnswering: () => (/* binding */ CamembertForQuestionAnswering),\n/* harmony export */ CamembertForSequenceClassification: () => (/* binding */ CamembertForSequenceClassification),\n/* harmony export */ CamembertForTokenClassification: () => (/* binding */ CamembertForTokenClassification),\n/* harmony export */ CamembertModel: () => (/* binding */ CamembertModel),\n/* harmony export */ CamembertPreTrainedModel: () => (/* binding */ CamembertPreTrainedModel),\n/* harmony export */ CausalLMOutput: () => (/* binding */ CausalLMOutput),\n/* harmony export */ CausalLMOutputWithPast: () => (/* binding */ CausalLMOutputWithPast),\n/* harmony export */ ChineseCLIPModel: () => (/* binding */ ChineseCLIPModel),\n/* harmony export */ ChineseCLIPPreTrainedModel: () => (/* binding */ ChineseCLIPPreTrainedModel),\n/* harmony export */ ClapAudioModelWithProjection: () => (/* binding */ ClapAudioModelWithProjection),\n/* harmony export */ ClapModel: () => (/* binding */ ClapModel),\n/* harmony export */ ClapPreTrainedModel: () => (/* binding */ ClapPreTrainedModel),\n/* harmony export */ ClapTextModelWithProjection: () => (/* binding */ ClapTextModelWithProjection),\n/* harmony export */ CodeGenForCausalLM: () => (/* binding */ CodeGenForCausalLM),\n/* harmony export */ CodeGenModel: () => (/* binding */ CodeGenModel),\n/* harmony export */ CodeGenPreTrainedModel: () => (/* binding */ CodeGenPreTrainedModel),\n/* harmony export */ ConvBertForMaskedLM: () => (/* binding */ ConvBertForMaskedLM),\n/* harmony export */ ConvBertForQuestionAnswering: () => (/* binding */ ConvBertForQuestionAnswering),\n/* harmony export */ ConvBertForSequenceClassification: () => (/* binding */ ConvBertForSequenceClassification),\n/* harmony export */ ConvBertForTokenClassification: () => (/* binding */ ConvBertForTokenClassification),\n/* harmony export */ ConvBertModel: () => (/* binding */ ConvBertModel),\n/* harmony export */ ConvBertPreTrainedModel: () => (/* binding */ ConvBertPreTrainedModel),\n/* harmony export */ ConvNextForImageClassification: () => (/* binding */ ConvNextForImageClassification),\n/* harmony export */ ConvNextModel: () => (/* binding */ ConvNextModel),\n/* harmony export */ ConvNextPreTrainedModel: () => (/* binding */ ConvNextPreTrainedModel),\n/* harmony export */ ConvNextV2ForImageClassification: () => (/* binding */ ConvNextV2ForImageClassification),\n/* harmony export */ ConvNextV2Model: () => (/* binding */ ConvNextV2Model),\n/* harmony export */ ConvNextV2PreTrainedModel: () => (/* binding */ ConvNextV2PreTrainedModel),\n/* harmony export */ DPTForDepthEstimation: () => (/* binding */ DPTForDepthEstimation),\n/* harmony export */ DPTModel: () => (/* binding */ DPTModel),\n/* harmony export */ DPTPreTrainedModel: () => (/* binding */ DPTPreTrainedModel),\n/* harmony export */ DebertaForMaskedLM: () => (/* binding */ DebertaForMaskedLM),\n/* harmony export */ DebertaForQuestionAnswering: () => (/* binding */ DebertaForQuestionAnswering),\n/* harmony export */ DebertaForSequenceClassification: () => (/* binding */ DebertaForSequenceClassification),\n/* harmony export */ DebertaForTokenClassification: () => (/* binding */ DebertaForTokenClassification),\n/* harmony export */ DebertaModel: () => (/* binding */ DebertaModel),\n/* harmony export */ DebertaPreTrainedModel: () => (/* binding */ DebertaPreTrainedModel),\n/* harmony export */ DebertaV2ForMaskedLM: () => (/* binding */ DebertaV2ForMaskedLM),\n/* harmony export */ DebertaV2ForQuestionAnswering: () => (/* binding */ DebertaV2ForQuestionAnswering),\n/* harmony export */ DebertaV2ForSequenceClassification: () => (/* binding */ DebertaV2ForSequenceClassification),\n/* harmony export */ DebertaV2ForTokenClassification: () => (/* binding */ DebertaV2ForTokenClassification),\n/* harmony export */ DebertaV2Model: () => (/* binding */ DebertaV2Model),\n/* harmony export */ DebertaV2PreTrainedModel: () => (/* binding */ DebertaV2PreTrainedModel),\n/* harmony export */ DeiTForImageClassification: () => (/* binding */ DeiTForImageClassification),\n/* harmony export */ DeiTModel: () => (/* binding */ DeiTModel),\n/* harmony export */ DeiTPreTrainedModel: () => (/* binding */ DeiTPreTrainedModel),\n/* harmony export */ DepthAnythingForDepthEstimation: () => (/* binding */ DepthAnythingForDepthEstimation),\n/* harmony export */ DepthAnythingPreTrainedModel: () => (/* binding */ DepthAnythingPreTrainedModel),\n/* harmony export */ DetrForObjectDetection: () => (/* binding */ DetrForObjectDetection),\n/* harmony export */ DetrForSegmentation: () => (/* binding */ DetrForSegmentation),\n/* harmony export */ DetrModel: () => (/* binding */ DetrModel),\n/* harmony export */ DetrObjectDetectionOutput: () => (/* binding */ DetrObjectDetectionOutput),\n/* harmony export */ DetrPreTrainedModel: () => (/* binding */ DetrPreTrainedModel),\n/* harmony export */ DetrSegmentationOutput: () => (/* binding */ DetrSegmentationOutput),\n/* harmony export */ Dinov2ForImageClassification: () => (/* binding */ Dinov2ForImageClassification),\n/* harmony export */ Dinov2Model: () => (/* binding */ Dinov2Model),\n/* harmony export */ Dinov2PreTrainedModel: () => (/* binding */ Dinov2PreTrainedModel),\n/* harmony export */ DistilBertForMaskedLM: () => (/* binding */ DistilBertForMaskedLM),\n/* harmony export */ DistilBertForQuestionAnswering: () => (/* binding */ DistilBertForQuestionAnswering),\n/* harmony export */ DistilBertForSequenceClassification: () => (/* binding */ DistilBertForSequenceClassification),\n/* harmony export */ DistilBertForTokenClassification: () => (/* binding */ DistilBertForTokenClassification),\n/* harmony export */ DistilBertModel: () => (/* binding */ DistilBertModel),\n/* harmony export */ DistilBertPreTrainedModel: () => (/* binding */ DistilBertPreTrainedModel),\n/* harmony export */ DonutSwinModel: () => (/* binding */ DonutSwinModel),\n/* harmony export */ DonutSwinPreTrainedModel: () => (/* binding */ DonutSwinPreTrainedModel),\n/* harmony export */ EfficientNetForImageClassification: () => (/* binding */ EfficientNetForImageClassification),\n/* harmony export */ EfficientNetModel: () => (/* binding */ EfficientNetModel),\n/* harmony export */ EfficientNetPreTrainedModel: () => (/* binding */ EfficientNetPreTrainedModel),\n/* harmony export */ ElectraForMaskedLM: () => (/* binding */ ElectraForMaskedLM),\n/* harmony export */ ElectraForQuestionAnswering: () => (/* binding */ ElectraForQuestionAnswering),\n/* harmony export */ ElectraForSequenceClassification: () => (/* binding */ ElectraForSequenceClassification),\n/* harmony export */ ElectraForTokenClassification: () => (/* binding */ ElectraForTokenClassification),\n/* harmony export */ ElectraModel: () => (/* binding */ ElectraModel),\n/* harmony export */ ElectraPreTrainedModel: () => (/* binding */ ElectraPreTrainedModel),\n/* harmony export */ EsmForMaskedLM: () => (/* binding */ EsmForMaskedLM),\n/* harmony export */ EsmForSequenceClassification: () => (/* binding */ EsmForSequenceClassification),\n/* harmony export */ EsmForTokenClassification: () => (/* binding */ EsmForTokenClassification),\n/* harmony export */ EsmModel: () => (/* binding */ EsmModel),\n/* harmony export */ EsmPreTrainedModel: () => (/* binding */ EsmPreTrainedModel),\n/* harmony export */ FalconForCausalLM: () => (/* binding */ FalconForCausalLM),\n/* harmony export */ FalconModel: () => (/* binding */ FalconModel),\n/* harmony export */ FalconPreTrainedModel: () => (/* binding */ FalconPreTrainedModel),\n/* harmony export */ GLPNForDepthEstimation: () => (/* binding */ GLPNForDepthEstimation),\n/* harmony export */ GLPNModel: () => (/* binding */ GLPNModel),\n/* harmony export */ GLPNPreTrainedModel: () => (/* binding */ GLPNPreTrainedModel),\n/* harmony export */ GPT2LMHeadModel: () => (/* binding */ GPT2LMHeadModel),\n/* harmony export */ GPT2Model: () => (/* binding */ GPT2Model),\n/* harmony export */ GPT2PreTrainedModel: () => (/* binding */ GPT2PreTrainedModel),\n/* harmony export */ GPTBigCodeForCausalLM: () => (/* binding */ GPTBigCodeForCausalLM),\n/* harmony export */ GPTBigCodeModel: () => (/* binding */ GPTBigCodeModel),\n/* harmony export */ GPTBigCodePreTrainedModel: () => (/* binding */ GPTBigCodePreTrainedModel),\n/* harmony export */ GPTJForCausalLM: () => (/* binding */ GPTJForCausalLM),\n/* harmony export */ GPTJModel: () => (/* binding */ GPTJModel),\n/* harmony export */ GPTJPreTrainedModel: () => (/* binding */ GPTJPreTrainedModel),\n/* harmony export */ GPTNeoForCausalLM: () => (/* binding */ GPTNeoForCausalLM),\n/* harmony export */ GPTNeoModel: () => (/* binding */ GPTNeoModel),\n/* harmony export */ GPTNeoPreTrainedModel: () => (/* binding */ GPTNeoPreTrainedModel),\n/* harmony export */ GPTNeoXForCausalLM: () => (/* binding */ GPTNeoXForCausalLM),\n/* harmony export */ GPTNeoXModel: () => (/* binding */ GPTNeoXModel),\n/* harmony export */ GPTNeoXPreTrainedModel: () => (/* binding */ GPTNeoXPreTrainedModel),\n/* harmony export */ HubertForCTC: () => (/* binding */ HubertForCTC),\n/* harmony export */ HubertForSequenceClassification: () => (/* binding */ HubertForSequenceClassification),\n/* harmony export */ HubertModel: () => (/* binding */ HubertModel),\n/* harmony export */ HubertPreTrainedModel: () => (/* binding */ HubertPreTrainedModel),\n/* harmony export */ ImageMattingOutput: () => (/* binding */ ImageMattingOutput),\n/* harmony export */ LlamaForCausalLM: () => (/* binding */ LlamaForCausalLM),\n/* harmony export */ LlamaModel: () => (/* binding */ LlamaModel),\n/* harmony export */ LlamaPreTrainedModel: () => (/* binding */ LlamaPreTrainedModel),\n/* harmony export */ LongT5ForConditionalGeneration: () => (/* binding */ LongT5ForConditionalGeneration),\n/* harmony export */ LongT5Model: () => (/* binding */ LongT5Model),\n/* harmony export */ LongT5PreTrainedModel: () => (/* binding */ LongT5PreTrainedModel),\n/* harmony export */ M2M100ForConditionalGeneration: () => (/* binding */ M2M100ForConditionalGeneration),\n/* harmony export */ M2M100Model: () => (/* binding */ M2M100Model),\n/* harmony export */ M2M100PreTrainedModel: () => (/* binding */ M2M100PreTrainedModel),\n/* harmony export */ MBartForCausalLM: () => (/* binding */ MBartForCausalLM),\n/* harmony export */ MBartForConditionalGeneration: () => (/* binding */ MBartForConditionalGeneration),\n/* harmony export */ MBartForSequenceClassification: () => (/* binding */ MBartForSequenceClassification),\n/* harmony export */ MBartModel: () => (/* binding */ MBartModel),\n/* harmony export */ MBartPreTrainedModel: () => (/* binding */ MBartPreTrainedModel),\n/* harmony export */ MPNetForMaskedLM: () => (/* binding */ MPNetForMaskedLM),\n/* harmony export */ MPNetForQuestionAnswering: () => (/* binding */ MPNetForQuestionAnswering),\n/* harmony export */ MPNetForSequenceClassification: () => (/* binding */ MPNetForSequenceClassification),\n/* harmony export */ MPNetForTokenClassification: () => (/* binding */ MPNetForTokenClassification),\n/* harmony export */ MPNetModel: () => (/* binding */ MPNetModel),\n/* harmony export */ MPNetPreTrainedModel: () => (/* binding */ MPNetPreTrainedModel),\n/* harmony export */ MT5ForConditionalGeneration: () => (/* binding */ MT5ForConditionalGeneration),\n/* harmony export */ MT5Model: () => (/* binding */ MT5Model),\n/* harmony export */ MT5PreTrainedModel: () => (/* binding */ MT5PreTrainedModel),\n/* harmony export */ MarianMTModel: () => (/* binding */ MarianMTModel),\n/* harmony export */ MarianModel: () => (/* binding */ MarianModel),\n/* harmony export */ MarianPreTrainedModel: () => (/* binding */ MarianPreTrainedModel),\n/* harmony export */ MaskedLMOutput: () => (/* binding */ MaskedLMOutput),\n/* harmony export */ MistralForCausalLM: () => (/* binding */ MistralForCausalLM),\n/* harmony export */ MistralModel: () => (/* binding */ MistralModel),\n/* harmony export */ MistralPreTrainedModel: () => (/* binding */ MistralPreTrainedModel),\n/* harmony export */ MobileBertForMaskedLM: () => (/* binding */ MobileBertForMaskedLM),\n/* harmony export */ MobileBertForQuestionAnswering: () => (/* binding */ MobileBertForQuestionAnswering),\n/* harmony export */ MobileBertForSequenceClassification: () => (/* binding */ MobileBertForSequenceClassification),\n/* harmony export */ MobileBertModel: () => (/* binding */ MobileBertModel),\n/* harmony export */ MobileBertPreTrainedModel: () => (/* binding */ MobileBertPreTrainedModel),\n/* harmony export */ MobileViTForImageClassification: () => (/* binding */ MobileViTForImageClassification),\n/* harmony export */ MobileViTModel: () => (/* binding */ MobileViTModel),\n/* harmony export */ MobileViTPreTrainedModel: () => (/* binding */ MobileViTPreTrainedModel),\n/* harmony export */ ModelOutput: () => (/* binding */ ModelOutput),\n/* harmony export */ MptForCausalLM: () => (/* binding */ MptForCausalLM),\n/* harmony export */ MptModel: () => (/* binding */ MptModel),\n/* harmony export */ MptPreTrainedModel: () => (/* binding */ MptPreTrainedModel),\n/* harmony export */ NomicBertModel: () => (/* binding */ NomicBertModel),\n/* harmony export */ NomicBertPreTrainedModel: () => (/* binding */ NomicBertPreTrainedModel),\n/* harmony export */ OPTForCausalLM: () => (/* binding */ OPTForCausalLM),\n/* harmony export */ OPTModel: () => (/* binding */ OPTModel),\n/* harmony export */ OPTPreTrainedModel: () => (/* binding */ OPTPreTrainedModel),\n/* harmony export */ OwlViTForObjectDetection: () => (/* binding */ OwlViTForObjectDetection),\n/* harmony export */ OwlViTModel: () => (/* binding */ OwlViTModel),\n/* harmony export */ OwlViTPreTrainedModel: () => (/* binding */ OwlViTPreTrainedModel),\n/* harmony export */ Owlv2ForObjectDetection: () => (/* binding */ Owlv2ForObjectDetection),\n/* harmony export */ Owlv2Model: () => (/* binding */ Owlv2Model),\n/* harmony export */ Owlv2PreTrainedModel: () => (/* binding */ Owlv2PreTrainedModel),\n/* harmony export */ PhiForCausalLM: () => (/* binding */ PhiForCausalLM),\n/* harmony export */ PhiModel: () => (/* binding */ PhiModel),\n/* harmony export */ PhiPreTrainedModel: () => (/* binding */ PhiPreTrainedModel),\n/* harmony export */ PreTrainedModel: () => (/* binding */ PreTrainedModel),\n/* harmony export */ PretrainedMixin: () => (/* binding */ PretrainedMixin),\n/* harmony export */ QuestionAnsweringModelOutput: () => (/* binding */ QuestionAnsweringModelOutput),\n/* harmony export */ Qwen2ForCausalLM: () => (/* binding */ Qwen2ForCausalLM),\n/* harmony export */ Qwen2Model: () => (/* binding */ Qwen2Model),\n/* harmony export */ Qwen2PreTrainedModel: () => (/* binding */ Qwen2PreTrainedModel),\n/* harmony export */ ResNetForImageClassification: () => (/* binding */ ResNetForImageClassification),\n/* harmony export */ ResNetModel: () => (/* binding */ ResNetModel),\n/* harmony export */ ResNetPreTrainedModel: () => (/* binding */ ResNetPreTrainedModel),\n/* harmony export */ RoFormerForMaskedLM: () => (/* binding */ RoFormerForMaskedLM),\n/* harmony export */ RoFormerForQuestionAnswering: () => (/* binding */ RoFormerForQuestionAnswering),\n/* harmony export */ RoFormerForSequenceClassification: () => (/* binding */ RoFormerForSequenceClassification),\n/* harmony export */ RoFormerForTokenClassification: () => (/* binding */ RoFormerForTokenClassification),\n/* harmony export */ RoFormerModel: () => (/* binding */ RoFormerModel),\n/* harmony export */ RoFormerPreTrainedModel: () => (/* binding */ RoFormerPreTrainedModel),\n/* harmony export */ RobertaForMaskedLM: () => (/* binding */ RobertaForMaskedLM),\n/* harmony export */ RobertaForQuestionAnswering: () => (/* binding */ RobertaForQuestionAnswering),\n/* harmony export */ RobertaForSequenceClassification: () => (/* binding */ RobertaForSequenceClassification),\n/* harmony export */ RobertaForTokenClassification: () => (/* binding */ RobertaForTokenClassification),\n/* harmony export */ RobertaModel: () => (/* binding */ RobertaModel),\n/* harmony export */ RobertaPreTrainedModel: () => (/* binding */ RobertaPreTrainedModel),\n/* harmony export */ SamImageSegmentationOutput: () => (/* binding */ SamImageSegmentationOutput),\n/* harmony export */ SamModel: () => (/* binding */ SamModel),\n/* harmony export */ SamPreTrainedModel: () => (/* binding */ SamPreTrainedModel),\n/* harmony export */ SegformerForImageClassification: () => (/* binding */ SegformerForImageClassification),\n/* harmony export */ SegformerForSemanticSegmentation: () => (/* binding */ SegformerForSemanticSegmentation),\n/* harmony export */ SegformerModel: () => (/* binding */ SegformerModel),\n/* harmony export */ SegformerPreTrainedModel: () => (/* binding */ SegformerPreTrainedModel),\n/* harmony export */ Seq2SeqLMOutput: () => (/* binding */ Seq2SeqLMOutput),\n/* harmony export */ SequenceClassifierOutput: () => (/* binding */ SequenceClassifierOutput),\n/* harmony export */ SiglipModel: () => (/* binding */ SiglipModel),\n/* harmony export */ SiglipPreTrainedModel: () => (/* binding */ SiglipPreTrainedModel),\n/* harmony export */ SiglipTextModel: () => (/* binding */ SiglipTextModel),\n/* harmony export */ SiglipVisionModel: () => (/* binding */ SiglipVisionModel),\n/* harmony export */ SpeechT5ForSpeechToText: () => (/* binding */ SpeechT5ForSpeechToText),\n/* harmony export */ SpeechT5ForTextToSpeech: () => (/* binding */ SpeechT5ForTextToSpeech),\n/* harmony export */ SpeechT5HifiGan: () => (/* binding */ SpeechT5HifiGan),\n/* harmony export */ SpeechT5Model: () => (/* binding */ SpeechT5Model),\n/* harmony export */ SpeechT5PreTrainedModel: () => (/* binding */ SpeechT5PreTrainedModel),\n/* harmony export */ SqueezeBertForMaskedLM: () => (/* binding */ SqueezeBertForMaskedLM),\n/* harmony export */ SqueezeBertForQuestionAnswering: () => (/* binding */ SqueezeBertForQuestionAnswering),\n/* harmony export */ SqueezeBertForSequenceClassification: () => (/* binding */ SqueezeBertForSequenceClassification),\n/* harmony export */ SqueezeBertModel: () => (/* binding */ SqueezeBertModel),\n/* harmony export */ SqueezeBertPreTrainedModel: () => (/* binding */ SqueezeBertPreTrainedModel),\n/* harmony export */ StableLmForCausalLM: () => (/* binding */ StableLmForCausalLM),\n/* harmony export */ StableLmModel: () => (/* binding */ StableLmModel),\n/* harmony export */ StableLmPreTrainedModel: () => (/* binding */ StableLmPreTrainedModel),\n/* harmony export */ Starcoder2ForCausalLM: () => (/* binding */ Starcoder2ForCausalLM),\n/* harmony export */ Starcoder2Model: () => (/* binding */ Starcoder2Model),\n/* harmony export */ Starcoder2PreTrainedModel: () => (/* binding */ Starcoder2PreTrainedModel),\n/* harmony export */ Swin2SRForImageSuperResolution: () => (/* binding */ Swin2SRForImageSuperResolution),\n/* harmony export */ Swin2SRModel: () => (/* binding */ Swin2SRModel),\n/* harmony export */ Swin2SRPreTrainedModel: () => (/* binding */ Swin2SRPreTrainedModel),\n/* harmony export */ SwinForImageClassification: () => (/* binding */ SwinForImageClassification),\n/* harmony export */ SwinModel: () => (/* binding */ SwinModel),\n/* harmony export */ SwinPreTrainedModel: () => (/* binding */ SwinPreTrainedModel),\n/* harmony export */ T5ForConditionalGeneration: () => (/* binding */ T5ForConditionalGeneration),\n/* harmony export */ T5Model: () => (/* binding */ T5Model),\n/* harmony export */ T5PreTrainedModel: () => (/* binding */ T5PreTrainedModel),\n/* harmony export */ TableTransformerForObjectDetection: () => (/* binding */ TableTransformerForObjectDetection),\n/* harmony export */ TableTransformerModel: () => (/* binding */ TableTransformerModel),\n/* harmony export */ TableTransformerObjectDetectionOutput: () => (/* binding */ TableTransformerObjectDetectionOutput),\n/* harmony export */ TableTransformerPreTrainedModel: () => (/* binding */ TableTransformerPreTrainedModel),\n/* harmony export */ TokenClassifierOutput: () => (/* binding */ TokenClassifierOutput),\n/* harmony export */ TrOCRForCausalLM: () => (/* binding */ TrOCRForCausalLM),\n/* harmony export */ TrOCRPreTrainedModel: () => (/* binding */ TrOCRPreTrainedModel),\n/* harmony export */ UniSpeechForCTC: () => (/* binding */ UniSpeechForCTC),\n/* harmony export */ UniSpeechForSequenceClassification: () => (/* binding */ UniSpeechForSequenceClassification),\n/* harmony export */ UniSpeechModel: () => (/* binding */ UniSpeechModel),\n/* harmony export */ UniSpeechPreTrainedModel: () => (/* binding */ UniSpeechPreTrainedModel),\n/* harmony export */ UniSpeechSatForAudioFrameClassification: () => (/* binding */ UniSpeechSatForAudioFrameClassification),\n/* harmony export */ UniSpeechSatForCTC: () => (/* binding */ UniSpeechSatForCTC),\n/* harmony export */ UniSpeechSatForSequenceClassification: () => (/* binding */ UniSpeechSatForSequenceClassification),\n/* harmony export */ UniSpeechSatModel: () => (/* binding */ UniSpeechSatModel),\n/* harmony export */ UniSpeechSatPreTrainedModel: () => (/* binding */ UniSpeechSatPreTrainedModel),\n/* harmony export */ ViTForImageClassification: () => (/* binding */ ViTForImageClassification),\n/* harmony export */ ViTModel: () => (/* binding */ ViTModel),\n/* harmony export */ ViTPreTrainedModel: () => (/* binding */ ViTPreTrainedModel),\n/* harmony export */ VisionEncoderDecoderModel: () => (/* binding */ VisionEncoderDecoderModel),\n/* harmony export */ VitMatteForImageMatting: () => (/* binding */ VitMatteForImageMatting),\n/* harmony export */ VitMattePreTrainedModel: () => (/* binding */ VitMattePreTrainedModel),\n/* harmony export */ VitsModel: () => (/* binding */ VitsModel),\n/* harmony export */ VitsModelOutput: () => (/* binding */ VitsModelOutput),\n/* harmony export */ VitsPreTrainedModel: () => (/* binding */ VitsPreTrainedModel),\n/* harmony export */ Wav2Vec2BertForCTC: () => (/* binding */ Wav2Vec2BertForCTC),\n/* harmony export */ Wav2Vec2BertForSequenceClassification: () => (/* binding */ Wav2Vec2BertForSequenceClassification),\n/* harmony export */ Wav2Vec2BertModel: () => (/* binding */ Wav2Vec2BertModel),\n/* harmony export */ Wav2Vec2BertPreTrainedModel: () => (/* binding */ Wav2Vec2BertPreTrainedModel),\n/* harmony export */ Wav2Vec2ForAudioFrameClassification: () => (/* binding */ Wav2Vec2ForAudioFrameClassification),\n/* harmony export */ Wav2Vec2ForCTC: () => (/* binding */ Wav2Vec2ForCTC),\n/* harmony export */ Wav2Vec2ForSequenceClassification: () => (/* binding */ Wav2Vec2ForSequenceClassification),\n/* harmony export */ Wav2Vec2Model: () => (/* binding */ Wav2Vec2Model),\n/* harmony export */ Wav2Vec2PreTrainedModel: () => (/* binding */ Wav2Vec2PreTrainedModel),\n/* harmony export */ WavLMForAudioFrameClassification: () => (/* binding */ WavLMForAudioFrameClassification),\n/* harmony export */ WavLMForCTC: () => (/* binding */ WavLMForCTC),\n/* harmony export */ WavLMForSequenceClassification: () => (/* binding */ WavLMForSequenceClassification),\n/* harmony export */ WavLMForXVector: () => (/* binding */ WavLMForXVector),\n/* harmony export */ WavLMModel: () => (/* binding */ WavLMModel),\n/* harmony export */ WavLMPreTrainedModel: () => (/* binding */ WavLMPreTrainedModel),\n/* harmony export */ WhisperForConditionalGeneration: () => (/* binding */ WhisperForConditionalGeneration),\n/* harmony export */ WhisperModel: () => (/* binding */ WhisperModel),\n/* harmony export */ WhisperPreTrainedModel: () => (/* binding */ WhisperPreTrainedModel),\n/* harmony export */ XLMForQuestionAnswering: () => (/* binding */ XLMForQuestionAnswering),\n/* harmony export */ XLMForSequenceClassification: () => (/* binding */ XLMForSequenceClassification),\n/* harmony export */ XLMForTokenClassification: () => (/* binding */ XLMForTokenClassification),\n/* harmony export */ XLMModel: () => (/* binding */ XLMModel),\n/* harmony export */ XLMPreTrainedModel: () => (/* binding */ XLMPreTrainedModel),\n/* harmony export */ XLMRobertaForMaskedLM: () => (/* binding */ XLMRobertaForMaskedLM),\n/* harmony export */ XLMRobertaForQuestionAnswering: () => (/* binding */ XLMRobertaForQuestionAnswering),\n/* harmony export */ XLMRobertaForSequenceClassification: () => (/* binding */ XLMRobertaForSequenceClassification),\n/* harmony export */ XLMRobertaForTokenClassification: () => (/* binding */ XLMRobertaForTokenClassification),\n/* harmony export */ XLMRobertaModel: () => (/* binding */ XLMRobertaModel),\n/* harmony export */ XLMRobertaPreTrainedModel: () => (/* binding */ XLMRobertaPreTrainedModel),\n/* harmony export */ XLMWithLMHeadModel: () => (/* binding */ XLMWithLMHeadModel),\n/* harmony export */ XVectorOutput: () => (/* binding */ XVectorOutput),\n/* harmony export */ YolosForObjectDetection: () => (/* binding */ YolosForObjectDetection),\n/* harmony export */ YolosModel: () => (/* binding */ YolosModel),\n/* harmony export */ YolosObjectDetectionOutput: () => (/* binding */ YolosObjectDetectionOutput),\n/* harmony export */ YolosPreTrainedModel: () => (/* binding */ YolosPreTrainedModel)\n/* harmony export */ });\n/* harmony import */ var _configs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./configs.js */ \"./node_modules/@xenova/transformers/src/configs.js\");\n/* harmony import */ var _utils_core_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/core.js */ \"./node_modules/@xenova/transformers/src/utils/core.js\");\n/* harmony import */ var _utils_hub_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/hub.js */ \"./node_modules/@xenova/transformers/src/utils/hub.js\");\n/* harmony import */ var _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/generation.js */ \"./node_modules/@xenova/transformers/src/utils/generation.js\");\n/* harmony import */ var _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/tensor.js */ \"./node_modules/@xenova/transformers/src/utils/tensor.js\");\n/* harmony import */ var _backends_onnx_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./backends/onnx.js */ \"./node_modules/@xenova/transformers/src/backends/onnx.js\");\n/* harmony import */ var _transformers_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./transformers.js */ \"./node_modules/@xenova/transformers/src/transformers.js\");\n\n/**\n * @file Definitions of all models available in Transformers.js.\n * \n * **Example:** Load and run an `AutoModel`.\n * \n * ```javascript\n * import { AutoModel, AutoTokenizer } from '@xenova/transformers';\n *\n * let tokenizer = await AutoTokenizer.from_pretrained('Xenova/bert-base-uncased');\n * let model = await AutoModel.from_pretrained('Xenova/bert-base-uncased');\n *\n * let inputs = await tokenizer('I love transformers!');\n * let { logits } = await model(inputs);\n * // Tensor {\n * // data: Float32Array(183132) [-7.117443084716797, -7.107812881469727, -7.092104911804199, ...]\n * // dims: (3) [1, 6, 30522],\n * // type: \"float32\",\n * // size: 183132,\n * // }\n * ```\n * \n * We also provide other `AutoModel`s (listed below), which you can use in the same way as the Python library. For example:\n * \n * **Example:** Load and run an `AutoModelForSeq2SeqLM`.\n * ```javascript\n * import { AutoModelForSeq2SeqLM, AutoTokenizer } from '@xenova/transformers';\n * \n * let tokenizer = await AutoTokenizer.from_pretrained('Xenova/t5-small');\n * let model = await AutoModelForSeq2SeqLM.from_pretrained('Xenova/t5-small');\n *\n * let { input_ids } = await tokenizer('translate English to German: I love transformers!');\n * let outputs = await model.generate(input_ids);\n * let decoded = tokenizer.decode(outputs[0], { skip_special_tokens: true });\n * // 'Ich liebe Transformatoren!'\n * ```\n * \n * @module models\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst { InferenceSession, Tensor: ONNXTensor, env } = _backends_onnx_js__WEBPACK_IMPORTED_MODULE_5__.ONNX;\n\n/** @typedef {import('onnxruntime-web').InferenceSession} InferenceSession */\n\n//////////////////////////////////////////////////\n// Model types: used internally\nconst MODEL_TYPES = {\n EncoderOnly: 0,\n EncoderDecoder: 1,\n Seq2Seq: 2,\n Vision2Seq: 3,\n DecoderOnly: 4,\n MaskGeneration: 5,\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Helper functions\n\n// NOTE: These will be populated fully later\nconst MODEL_TYPE_MAPPING = new Map();\nconst MODEL_NAME_TO_CLASS_MAPPING = new Map();\nconst MODEL_CLASS_TO_NAME_MAPPING = new Map();\n\n\n/**\n * Constructs an InferenceSession using a model file located at the specified path.\n * @param {string} pretrained_model_name_or_path The path to the directory containing the model file.\n * @param {string} fileName The name of the model file.\n * @param {import('./utils/hub.js').PretrainedOptions} options Additional options for loading the model.\n * @returns {Promise} A Promise that resolves to an InferenceSession object.\n * @private\n */\nasync function constructSession(pretrained_model_name_or_path, fileName, options) {\n // TODO add option for user to force specify their desired execution provider\n let modelFileName = `onnx/${fileName}${options.quantized ? '_quantized' : ''}.onnx`;\n let buffer = await (0,_utils_hub_js__WEBPACK_IMPORTED_MODULE_2__.getModelFile)(pretrained_model_name_or_path, modelFileName, true, options);\n\n try {\n return await InferenceSession.create(buffer, {\n executionProviders: _backends_onnx_js__WEBPACK_IMPORTED_MODULE_5__.executionProviders,\n });\n } catch (err) {\n // If the execution provided was only wasm, throw the error\n if (_backends_onnx_js__WEBPACK_IMPORTED_MODULE_5__.executionProviders.length === 1 && _backends_onnx_js__WEBPACK_IMPORTED_MODULE_5__.executionProviders[0] === 'wasm') {\n throw err;\n }\n\n console.warn(err);\n console.warn(\n 'Something went wrong during model construction (most likely a missing operation). ' +\n 'Using `wasm` as a fallback. '\n )\n return await InferenceSession.create(buffer, {\n executionProviders: ['wasm']\n });\n }\n}\n\n/**\n * Validate model inputs\n * @param {InferenceSession} session The InferenceSession object that will be run.\n * @param {Record} inputs The inputs to check.\n * @returns {Record} The checked inputs.\n * @throws {Error} If any inputs are missing.\n * @private\n */\nfunction validateInputs(session, inputs) {\n /**\n * NOTE: Create either a shallow or deep copy based on `onnx.wasm.proxy`\n * @type {Record}\n */\n const checkedInputs = Object.create(null);\n const missingInputs = [];\n for (const inputName of session.inputNames) {\n const tensor = inputs[inputName];\n // Rare case where one of the model's input names corresponds to a built-in\n // object name (e.g., toString), which would cause a simple (!tensor) check to fail,\n // because it's not undefined but a function.\n if (!(tensor instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor)) {\n missingInputs.push(inputName);\n continue;\n }\n // NOTE: When `env.wasm.proxy is true` the tensor is moved across the Worker\n // boundary, transferring ownership to the worker and invalidating the tensor.\n // So, in this case, we simply sacrifice a clone for it.\n checkedInputs[inputName] = env.wasm.proxy ? tensor.clone() : tensor;\n }\n if (missingInputs.length > 0) {\n throw new Error(\n `An error occurred during model execution: \"Missing the following inputs: ${missingInputs.join(', ')}.`);\n }\n\n const numInputsProvided = Object.keys(inputs).length;\n const numInputsNeeded = session.inputNames.length;\n if (numInputsProvided > numInputsNeeded) {\n // No missing inputs, but too many inputs were provided.\n // Warn the user and ignore the extra inputs.\n let ignored = Object.keys(inputs).filter(inputName => !session.inputNames.includes(inputName));\n console.warn(`WARNING: Too many inputs were provided (${numInputsProvided} > ${numInputsNeeded}). The following inputs will be ignored: \"${ignored.join(', ')}\".`);\n }\n\n return checkedInputs;\n}\n\n/**\n * Executes an InferenceSession using the specified inputs.\n * NOTE: `inputs` must contain at least the input names of the model.\n * - If additional inputs are passed, they will be ignored.\n * - If inputs are missing, an error will be thrown.\n * \n * @param {InferenceSession} session The InferenceSession object to run.\n * @param {Object} inputs An object that maps input names to input tensors.\n * @returns {Promise} A Promise that resolves to an object that maps output names to output tensors.\n * @private\n */\nasync function sessionRun(session, inputs) {\n const checkedInputs = validateInputs(session, inputs);\n try {\n // @ts-ignore\n let output = await session.run(checkedInputs);\n output = replaceTensors(output);\n return output;\n } catch (e) {\n // This usually occurs when the inputs are of the wrong type.\n console.error(`An error occurred during model execution: \"${e}\".`);\n console.error('Inputs given to model:', checkedInputs);\n throw e;\n }\n}\n\n/**\n * Replaces ONNX Tensor objects with custom Tensor objects to support additional functions.\n * @param {Object} obj The object to replace tensor objects in.\n * @returns {Object} The object with tensor objects replaced by custom Tensor objects.\n * @private\n */\nfunction replaceTensors(obj) {\n for (let prop in obj) {\n if (obj[prop] instanceof ONNXTensor) {\n obj[prop] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor(obj[prop]);\n } else if (typeof obj[prop] === 'object') {\n replaceTensors(obj[prop]);\n }\n }\n return obj;\n}\n\n\n/**\n * Converts an array or Tensor of integers to an int64 Tensor.\n * @param {Array|Tensor} items The input integers to be converted.\n * @returns {Tensor} The int64 Tensor with the converted values.\n * @throws {Error} If the input array is empty or the input is a batched Tensor and not all sequences have the same length.\n * @private\n */\nfunction toI64Tensor(items) {\n if (items instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor) {\n return items;\n }\n // items is an array\n if (items.length === 0) {\n throw Error(\"items must be non-empty\");\n }\n\n if (Array.isArray(items[0])) {\n // batched\n if (items.some(x => x.length !== items[0].length)) {\n throw Error(\"Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.\")\n }\n\n return new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('int64',\n BigInt64Array.from(items.flat().map(x => BigInt(x))),\n [items.length, items[0].length]\n );\n } else {\n //flat\n return new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('int64',\n BigInt64Array.from(items.map(x => BigInt(x))),\n [1, items.length]\n );\n }\n}\n\n/**\n * Prepares an attention mask for a sequence of tokens based on configuration options.\n * @param {Object} self The calling object instance.\n * @param {Tensor} tokens The input tokens.\n * @returns {Tensor} The attention mask tensor.\n * @private\n */\nfunction prepareAttentionMask(self, tokens) {\n\n // Prepare attention mask\n let pad_token_id = self.config.pad_token_id ?? null;\n let eos_token_id = self.config.eos_token_id ?? null;\n if ((0,_utils_core_js__WEBPACK_IMPORTED_MODULE_1__.isIntegralNumber)(eos_token_id)) {\n eos_token_id = [eos_token_id];\n }\n\n let is_pad_token_in_inputs = tokens.indexOf(pad_token_id) !== -1;\n let is_pad_token_not_equal_to_eos_token_id = (eos_token_id === null) || !eos_token_id.includes(pad_token_id)\n\n if (is_pad_token_in_inputs && is_pad_token_not_equal_to_eos_token_id) {\n let data = BigInt64Array.from(\n // Note: != so that int matches bigint\n // @ts-ignore\n tokens.data.map(x => x != pad_token_id)\n )\n return new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('int64', data, tokens.dims)\n } else {\n return (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.ones_like)(tokens);\n }\n}\n\n/**\n * Add position IDs to the feeds object.\n * @param {Object} session The inference session.\n * @param {Object} feeds The input to the model.\n * @param {boolean} use_cache_branch Whether to use the cache branch of the model.\n * @returns {void}\n * @private\n */\nfunction preparePositionIds(session, feeds, use_cache_branch) {\n if (!session.inputNames.includes('position_ids')) return;\n\n const data = new BigInt64Array(feeds.attention_mask.data.length);\n\n // Compute cumulative sum of the attention mask along the sequence length dimension\n for (let i = 0; i < feeds.attention_mask.dims[0]; ++i) {\n let start = i * feeds.attention_mask.dims[1];\n let sum = BigInt(0);\n for (let j = 0; j < feeds.attention_mask.dims[1]; ++j) {\n const index = start + j;\n if (feeds.attention_mask.data[index] === 0n) {\n data[index] = BigInt(1);\n } else { // === 1n\n data[index] = sum;\n sum += feeds.attention_mask.data[index];\n }\n }\n }\n\n feeds.position_ids = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('int64', data, feeds.attention_mask.dims);\n\n if (use_cache_branch) {\n feeds.position_ids = feeds.position_ids.slice(null, -1).unsqueeze_(-1);\n }\n}\n\n/**\n * Creates a boolean tensor with a single value.\n * @param {boolean} value The value of the tensor.\n * @returns {Tensor} The boolean tensor.\n * @private\n */\nfunction boolTensor(value) {\n return new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('bool', [value], [1]);\n}\n\n// JS doesn't support mixins, so we define some reused functions here, and allow \"this\" to be passed in\n/**\n * Perform forward pass on the seq2seq model (both encoder and decoder).\n * @param {Object} self The seq2seq model object.\n * @param {Object} model_inputs The input object for the model containing encoder and decoder inputs.\n * @returns {Promise} Promise that resolves with the output of the seq2seq model.\n * @private\n */\nasync function seq2seqForward(self, model_inputs) {\n\n let { encoder_outputs, past_key_values } = model_inputs;\n\n if (!encoder_outputs) {\n // Encoder outputs are not given, so we must compute them.\n encoder_outputs = (await encoderForward(self, model_inputs)).last_hidden_state;\n }\n let decoderFeeds = {\n input_ids: model_inputs.decoder_input_ids,\n encoder_hidden_states: encoder_outputs,\n };\n const use_cache_branch = !!past_key_values;\n\n if (self.decoder_merged_session.inputNames.includes('use_cache_branch')) {\n decoderFeeds.use_cache_branch = boolTensor(use_cache_branch);\n }\n\n if (self.decoder_merged_session.inputNames.includes('encoder_attention_mask')) {\n decoderFeeds.encoder_attention_mask = model_inputs.attention_mask\n }\n\n preparePositionIds(self.decoder_merged_session, decoderFeeds, use_cache_branch);\n self.addPastKeyValues(decoderFeeds, past_key_values);\n\n const decoderResults = await sessionRun(self.decoder_merged_session, decoderFeeds);\n let logits = decoderResults.logits;\n past_key_values = self.getPastKeyValues(decoderResults, past_key_values);\n\n // Get cross attention and/or decoder attentions if they are present\n const attns = self.getAttentions(decoderResults);\n\n return new Seq2SeqLMOutput({ logits, past_key_values, encoder_outputs, ...attns });\n}\n\n/**\n * Start the beam search process for the seq2seq model.\n * @param {PreTrainedModel} self The seq2seq model object.\n * @param {Tensor} inputTokenIds Array of input token ids for each input sequence.\n * @param {Object} generation_config The generation config.\n * @param {number} numOutputTokens The maximum number of output tokens for the model.\n * @returns {Object[]} Array of beam search objects.\n * @private\n */\nfunction seq2seqStartBeams(self, inputTokenIds, generation_config, numOutputTokens) {\n let beams = [];\n let beamId = 0;\n\n // @ts-ignore\n const requires_attention_mask = self.requires_attention_mask ?? true;\n\n // decoder_input_ids == output_token_ids\n let decoder_input_ids =\n generation_config.decoder_input_ids\n ?? generation_config.decoder_start_token_id\n ?? generation_config.bos_token_id\n ?? generation_config.eos_token_id;\n\n // Support input as tensor or list\n // TODO support batched decoder_input_ids\n if (decoder_input_ids instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor) {\n decoder_input_ids = decoder_input_ids.tolist().flat();\n } else if (!Array.isArray(decoder_input_ids)) {\n decoder_input_ids = [decoder_input_ids];\n }\n\n for (let tokens of inputTokenIds) {\n // TODO: Improve\n // Currently, just add back batch dimension.\n // In future, allow for true parallel execution\n tokens.dims = [1, ...tokens.dims]\n\n // Create beam\n let start = {\n inputs: tokens,\n encoder_outputs: null,\n prev_model_outputs: null,\n\n output_token_ids: decoder_input_ids,\n done: false,\n score: 0,\n id: beamId++ // assign unique id to beams\n }\n\n if (requires_attention_mask) {\n start.attention_mask = prepareAttentionMask(self, tokens);\n }\n\n beams.push(start);\n }\n\n return beams;\n}\n\n/**\n * Run beam search on the seq2seq model for a single beam.\n * @param {PreTrainedModel} self The seq2seq model object.\n * @param {Object} beam The beam search object for which to run the model.\n * @param {Object} options options\n * @param {string} [options.input_name='input_ids'] The name of the input tensor for the encoder.\n * @returns {Promise} Promise that resolves with the output of the seq2seq model for the given beam.\n * @private\n */\nasync function seq2seqRunBeam(self, beam) {\n const input_name = self.main_input_name;\n\n let decoder_input_ids = beam.output_token_ids;\n if (beam.prev_model_outputs) {\n // After the first step, `prev_model_outputs` won't be null.\n // So, we cut decoder_input_ids if past is used\n decoder_input_ids = decoder_input_ids.slice(-1);\n }\n\n // 1. Prepare\n let model_inputs = {\n [input_name]: beam.inputs,\n decoder_input_ids: toI64Tensor(decoder_input_ids),\n encoder_outputs: beam.encoder_outputs,\n past_key_values: beam.prev_model_outputs?.past_key_values,\n }\n if (beam.attention_mask) {\n model_inputs.attention_mask = beam.attention_mask\n }\n\n // 2. Run\n let output = await self.forward(model_inputs);\n\n // 3. Update\n beam.prev_model_outputs = output;\n beam.encoder_outputs = output.encoder_outputs;\n\n return output;\n}\n\n/**\n * Update a beam with a new token ID.\n * @param {Object} beam The beam to update.\n * @param {number} newTokenId The new token ID to add to the beam's output.\n * @private\n */\nfunction seq2seqUpdatebeam(beam, newTokenId) {\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\n}\n\n/**\n * Forward pass of an encoder model.\n * @param {Object} self The encoder model.\n * @param {Object} model_inputs The input data to be used for the forward pass.\n * @returns {Promise} Promise that resolves with an object containing the model's outputs.\n * @private\n */\nasync function encoderForward(self, model_inputs) {\n const encoderFeeds = Object.create(null);\n for (const key of self.session.inputNames) {\n encoderFeeds[key] = model_inputs[key];\n }\n if (self.session.inputNames.includes('token_type_ids') && !encoderFeeds.token_type_ids) {\n // Assign default `token_type_ids` (all zeroes) to the `encoderFeeds` if the model expects it,\n // but they weren't created by the tokenizer.\n encoderFeeds.token_type_ids = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor(\n 'int64',\n new BigInt64Array(encoderFeeds.input_ids.data.length),\n encoderFeeds.input_ids.dims\n )\n }\n return await sessionRun(self.session, encoderFeeds);\n}\n\n\n/**\n * Forward pass of a decoder model.\n * @param {Object} self The decoder model.\n * @param {Object} model_inputs The input data to be used for the forward pass.\n * @returns {Promise} Promise that resolves with an object containing the logits and past key values.\n * @private\n */\nasync function decoderForward(self, model_inputs) {\n let { input_ids, past_key_values, attention_mask } = model_inputs;\n let decoderFeeds = {\n input_ids: input_ids,\n attention_mask: attention_mask ?? prepareAttentionMask(self, input_ids),\n }\n const use_cache_branch = !!past_key_values;\n\n if (self.session.inputNames.includes('use_cache_branch')) {\n decoderFeeds.use_cache_branch = boolTensor(use_cache_branch);\n }\n\n preparePositionIds(self.session, decoderFeeds, use_cache_branch);\n\n self.addPastKeyValues(decoderFeeds, past_key_values);\n\n let decoderResults = await sessionRun(self.session, decoderFeeds);\n\n let logits = decoderResults.logits;\n\n past_key_values = self.getPastKeyValues(decoderResults, past_key_values);\n return { logits, past_key_values };\n}\n\n/**\n * Starts the generation of text by initializing the beams for the given input token IDs.\n * @param {Object} self The text generation model object.\n * @param {Tensor} inputTokenIds An tensor of input token IDs to generate text from.\n * @param {Object} generation_config The generation config.\n * @param {number} numOutputTokens The maximum number of tokens to generate for each beam.\n * @param {Tensor} [inputs_attention_mask] The attention mask tensor for the input token IDs.\n * @returns {Object[]} An array of beams initialized with the given inputs and parameters.\n * @private\n */\nfunction decoderStartBeams(self, inputTokenIds, generation_config, numOutputTokens, inputs_attention_mask) {\n let beams = [];\n\n let beamId = 0;\n for (let tokens of inputTokenIds) {\n let output_token_ids = tokens.tolist().map(Number);\n\n // TODO: Improve\n // Currently, just add back batch dimension.\n // In future, allow for true parallel execution\n tokens.dims = [1, ...tokens.dims]\n\n let attn_mask;\n if (inputs_attention_mask) {\n attn_mask = inputs_attention_mask[beamId];\n attn_mask.dims = [1, ...attn_mask.dims]\n\n } else {\n attn_mask = prepareAttentionMask(self, tokens)\n }\n\n let start = {\n input: tokens,\n model_input_ids: tokens,\n attention_mask: attn_mask,\n prev_model_outputs: null,\n\n output_token_ids: output_token_ids,\n num_output_tokens: numOutputTokens,\n\n done: false,\n score: 0,\n id: beamId++ // assign unique id to beams\n }\n\n beams.push(start);\n }\n return beams;\n}\n\n/**\n * Runs a single step of the text generation process for a given beam.\n *\n * @param {Object} self The decoder object.\n * @param {Object} beam The beam to run.\n * @param {Tensor} beam.input The input tensor.\n * @param {Tensor} beam.model_input_ids The input ids to the model.\n * @param {Tensor} beam.attention_mask The attention mask.\n * @param {Object} beam.prev_model_outputs The past key values.\n * @param {number[]} beam.output_token_ids The output token ids.\n * @returns {Promise} The output of the generation step.\n * @private\n */\nasync function decoderRunBeam(self, beam) {\n let attnMaskData = new BigInt64Array(beam.output_token_ids.length).fill(1n)\n\n // 1. Prepare\n let model_inputs = {\n input_ids: beam.model_input_ids,\n attention_mask: new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor(\n 'int64',\n attnMaskData,\n [1, attnMaskData.length]\n ),\n past_key_values: beam.prev_model_outputs?.past_key_values,\n }\n\n // 2. Run\n let output = await self.forward(model_inputs);\n\n // 3. Update\n beam.prev_model_outputs = output;\n\n return output;\n}\n\n/**\n * Update a beam with a new token ID.\n * @param {Object} beam The beam to update.\n * @param {number} newTokenId The new token ID to add to the beam's output.\n * @private\n */\nfunction decoderUpdatebeam(beam, newTokenId) {\n beam.output_token_ids = [...beam.output_token_ids, newTokenId];\n beam.model_input_ids = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('int64', [BigInt(newTokenId)], [1, 1]);\n}\n\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n/**\n * A base class for pre-trained models that provides the model configuration and an ONNX session.\n */\nclass PreTrainedModel extends _utils_core_js__WEBPACK_IMPORTED_MODULE_1__.Callable {\n main_input_name = 'input_ids';\n\n /**\n * Creates a new instance of the `PreTrainedModel` class.\n * @param {Object} config The model configuration.\n * @param {any} session session for the model.\n */\n constructor(config, session) {\n super();\n\n this.config = config;\n this.session = session;\n\n const modelName = MODEL_CLASS_TO_NAME_MAPPING.get(this.constructor);\n const modelType = MODEL_TYPE_MAPPING.get(modelName);\n\n this.can_generate = false;\n this._runBeam = null;\n this._getStartBeams = null;\n this._updateBeam = null;\n this._forward = null;\n if (modelType === MODEL_TYPES.DecoderOnly) {\n this.can_generate = true;\n\n this._runBeam = decoderRunBeam;\n this._getStartBeams = decoderStartBeams;\n this._updateBeam = decoderUpdatebeam;\n this._forward = decoderForward;\n\n } else if (modelType === MODEL_TYPES.Seq2Seq || modelType === MODEL_TYPES.Vision2Seq) {\n this.can_generate = true;\n\n this._runBeam = seq2seqRunBeam;\n this._getStartBeams = seq2seqStartBeams;\n this._updateBeam = seq2seqUpdatebeam;\n this._forward = seq2seqForward;\n\n } else if (modelType === MODEL_TYPES.EncoderDecoder) {\n this._forward = encoderForward;\n\n } else { // should be MODEL_TYPES.EncoderOnly\n this._forward = encoderForward;\n }\n }\n\n /**\n * Disposes of all the ONNX sessions that were created during inference.\n * @returns {Promise} An array of promises, one for each ONNX session that is being disposed.\n * @todo Use https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n */\n async dispose() {\n const promises = [];\n for (let key of Object.keys(this)) {\n const item = this[key];\n // @ts-ignore\n if (item instanceof InferenceSession) {\n promises.push(item.handler.dispose())\n }\n }\n return await Promise.all(promises);\n }\n\n /**\n * Instantiate one of the model classes of the library from a pretrained model.\n * \n * The model class to instantiate is selected based on the `model_type` property of the config object\n * (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible)\n * \n * @param {string} pretrained_model_name_or_path The name or path of the pretrained model. Can be either:\n * - A string, the *model id* of a pretrained model hosted inside a model repo on huggingface.co.\n * Valid model ids can be located at the root-level, like `bert-base-uncased`, or namespaced under a\n * user or organization name, like `dbmdz/bert-base-german-cased`.\n * - A path to a *directory* containing model weights, e.g., `./my_model_directory/`.\n * @param {import('./utils/hub.js').PretrainedOptions} options Additional options for loading the model.\n * \n * @returns {Promise} A new instance of the `PreTrainedModel` class.\n */\n static async from_pretrained(pretrained_model_name_or_path, {\n quantized = true,\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n model_file_name = null,\n } = {}) {\n\n let options = {\n quantized,\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n model_file_name,\n }\n\n const modelName = MODEL_CLASS_TO_NAME_MAPPING.get(this);\n const modelType = MODEL_TYPE_MAPPING.get(modelName);\n\n let info;\n if (modelType === MODEL_TYPES.DecoderOnly) {\n info = await Promise.all([\n _configs_js__WEBPACK_IMPORTED_MODULE_0__.AutoConfig.from_pretrained(pretrained_model_name_or_path, options),\n constructSession(pretrained_model_name_or_path, options.model_file_name ?? 'decoder_model_merged', options),\n (0,_utils_hub_js__WEBPACK_IMPORTED_MODULE_2__.getModelJSON)(pretrained_model_name_or_path, 'generation_config.json', false, options),\n ]);\n\n } else if (modelType === MODEL_TYPES.Seq2Seq || modelType === MODEL_TYPES.Vision2Seq) {\n info = await Promise.all([\n _configs_js__WEBPACK_IMPORTED_MODULE_0__.AutoConfig.from_pretrained(pretrained_model_name_or_path, options),\n constructSession(pretrained_model_name_or_path, 'encoder_model', options),\n constructSession(pretrained_model_name_or_path, 'decoder_model_merged', options),\n (0,_utils_hub_js__WEBPACK_IMPORTED_MODULE_2__.getModelJSON)(pretrained_model_name_or_path, 'generation_config.json', false, options),\n ]);\n\n } else if (modelType === MODEL_TYPES.MaskGeneration) {\n info = await Promise.all([\n _configs_js__WEBPACK_IMPORTED_MODULE_0__.AutoConfig.from_pretrained(pretrained_model_name_or_path, options),\n constructSession(pretrained_model_name_or_path, 'vision_encoder', options),\n constructSession(pretrained_model_name_or_path, 'prompt_encoder_mask_decoder', options),\n ]);\n\n } else if (modelType === MODEL_TYPES.EncoderDecoder) {\n info = await Promise.all([\n _configs_js__WEBPACK_IMPORTED_MODULE_0__.AutoConfig.from_pretrained(pretrained_model_name_or_path, options),\n constructSession(pretrained_model_name_or_path, 'encoder_model', options),\n constructSession(pretrained_model_name_or_path, 'decoder_model_merged', options),\n ]);\n\n } else { // should be MODEL_TYPES.EncoderOnly\n if (modelType !== MODEL_TYPES.EncoderOnly) {\n console.warn(`Model type for '${modelName ?? config?.model_type}' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.`)\n }\n info = await Promise.all([\n _configs_js__WEBPACK_IMPORTED_MODULE_0__.AutoConfig.from_pretrained(pretrained_model_name_or_path, options),\n constructSession(pretrained_model_name_or_path, options.model_file_name ?? 'model', options)\n ]);\n }\n\n // @ts-ignore\n return new this(...info);\n }\n\n /**\n * Runs the model with the provided inputs\n * @param {Object} model_inputs Object containing input tensors\n * @returns {Promise} Object containing output tensors\n */\n async _call(model_inputs) {\n return await this.forward(model_inputs);\n }\n\n /**\n * Forward method for a pretrained model. If not overridden by a subclass, the correct forward method\n * will be chosen based on the model type.\n * @param {Object} model_inputs The input data to the model in the format specified in the ONNX model.\n * @returns {Promise} The output data from the model in the format specified in the ONNX model.\n * @throws {Error} This method must be implemented in subclasses.\n */\n async forward(model_inputs) {\n return await this._forward(this, model_inputs);\n }\n\n /**\n * @param {import('./utils/generation.js').GenerationConfigType} generation_config \n * @param {number} input_ids_seq_length The starting sequence length for the input ids.\n * @returns {LogitsProcessorList}\n * @private\n */\n _get_logits_processor(\n generation_config,\n input_ids_seq_length,\n // encoder_input_ids, TODO\n // prefix_allowed_tokens_fn, TODO\n logits_processor = null\n ) {\n const processors = new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.LogitsProcessorList();\n\n // if (generation_config.diversity_penalty !== null && generation_config.diversity_penalty > 0.0) {\n // processors.push(new HammingDiversityLogitsProcessor(\n // generation_config.diversity_penalty,\n // generation_config.num_beams,\n // generation_config.num_beam_groups\n // ));\n // }\n\n // if (generation_config.encoder_repetition_penalty !== null && generation_config.encoder_repetition_penalty !== 1.0) {\n // processors.push(new EncoderRepetitionPenaltyLogitsProcessor(\n // generation_config.encoder_repetition_penalty,\n // encoder_input_ids\n // ));\n // }\n\n if (generation_config.repetition_penalty !== null && generation_config.repetition_penalty !== 1.0) {\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.RepetitionPenaltyLogitsProcessor(generation_config.repetition_penalty));\n }\n\n if (generation_config.no_repeat_ngram_size !== null && generation_config.no_repeat_ngram_size > 0) {\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.NoRepeatNGramLogitsProcessor(generation_config.no_repeat_ngram_size));\n }\n\n // if (generation_config.encoder_no_repeat_ngram_size !== null && generation_config.encoder_no_repeat_ngram_size > 0) {\n // if (this.config.is_encoder_decoder) {\n // processors.push(new EncoderNoRepeatNGramLogitsProcessor(\n // generation_config.encoder_no_repeat_ngram_size,\n // encoder_input_ids\n // ));\n // } else {\n // throw new Error(\"It's impossible to use `encoder_no_repeat_ngram_size` with decoder-only architecture\");\n // }\n // }\n\n if (generation_config.bad_words_ids !== null) {\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.NoBadWordsLogitsProcessor(generation_config.bad_words_ids, generation_config.eos_token_id));\n }\n\n if (generation_config.min_length !== null && generation_config.eos_token_id !== null && generation_config.min_length > 0) {\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.MinLengthLogitsProcessor(generation_config.min_length, generation_config.eos_token_id));\n }\n\n if (generation_config.min_new_tokens !== null && generation_config.eos_token_id !== null && generation_config.min_new_tokens > 0) {\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.MinNewTokensLengthLogitsProcessor(\n input_ids_seq_length,\n generation_config.min_new_tokens,\n generation_config.eos_token_id\n ));\n }\n\n // if (prefix_allowed_tokens_fn !== null) {\n // processors.push(new PrefixConstrainedLogitsProcessor(\n // prefix_allowed_tokens_fn,\n // generation_config.num_beams / generation_config.num_beam_groups\n // ));\n // }\n\n\n if (generation_config.forced_bos_token_id !== null) {\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.ForcedBOSTokenLogitsProcessor(generation_config.forced_bos_token_id));\n }\n\n if (generation_config.forced_eos_token_id !== null) {\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.ForcedEOSTokenLogitsProcessor(\n generation_config.max_length,\n generation_config.forced_eos_token_id\n ));\n }\n\n // if (generation_config.remove_invalid_values === true) {\n // processors.push(new InfNanRemoveLogitsProcessor());\n // }\n\n // if (generation_config.exponential_decay_length_penalty !== null) {\n // processors.push(new ExponentialDecayLengthPenalty(\n // generation_config.exponential_decay_length_penalty,\n // generation_config.eos_token_id,\n // input_ids_seq_length\n // ));\n // }\n\n // if (generation_config.suppress_tokens !== null) {\n // processors.push(new SuppressTokensLogitsProcessor(generation_config.suppress_tokens));\n // }\n\n if (generation_config.begin_suppress_tokens !== null) {\n let begin_index = (input_ids_seq_length > 1 || generation_config.forced_bos_token_id === null)\n ? input_ids_seq_length\n : input_ids_seq_length + 1;\n\n if (generation_config.forced_decoder_ids !== null) {\n // generation starts after the last token that is forced\n begin_index += generation_config.forced_decoder_ids[generation_config.forced_decoder_ids.length - 1][0];\n }\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.SuppressTokensAtBeginLogitsProcessor(generation_config.begin_suppress_tokens, begin_index));\n }\n\n if (generation_config.forced_decoder_ids !== null) {\n processors.push(new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.ForceTokensLogitsProcessor(generation_config.forced_decoder_ids));\n }\n\n if (logits_processor !== null) {\n processors.extend(logits_processor)\n }\n\n // `LogitNormalization` should always be the last logit processor, when present\n // if (generation_config.renormalize_logits === true) {\n // processors.push(new LogitNormalization());\n // }\n\n return processors;\n }\n\n /**\n * This function merges multiple generation configs together to form a final generation config to be used by the model for text generation.\n * It first creates an empty `GenerationConfig` object, then it applies the model's own `generation_config` property to it. Finally, if a `generation_config` object was passed in the arguments, it overwrites the corresponding properties in the final config with those of the passed config object.\n * @param {import('./utils/generation.js').GenerationConfigType} generation_config A `GenerationConfig` object containing generation parameters.\n * @returns {import('./utils/generation.js').GenerationConfigType} The final generation config object to be used by the model for text generation.\n */\n _get_generation_config(generation_config) {\n // Create empty generation config (contains defaults)\n // We pass `this.config` so that if `eos_token_id` or `bos_token_id` exist in the model's config, we will use them\n let gen_config = new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.GenerationConfig(this.config);\n\n // Apply model's generation config, if it exists\n if ('generation_config' in this) {\n Object.assign(gen_config, this.generation_config);\n }\n\n // Finally, use any generation config specified by the user\n // when calling `generate`\n if (generation_config !== null) {\n Object.assign(gen_config, generation_config);\n }\n return gen_config;\n }\n\n /**\n * @typedef {import('./utils/maths.js').TypedArray} TypedArray\n */\n\n /**\n * @typedef {{ sequences: Tensor, decoder_attentions: Tensor, cross_attentions: Tensor }} EncoderDecoderOutput\n * @typedef {Object} DecoderOutput\n * \n * Generates text based on the given inputs and generation configuration using the model.\n * @param {Tensor|Array|TypedArray} inputs An array of input token IDs.\n * @param {Object|GenerationConfig|null} generation_config The generation configuration to use. If null, default configuration will be used.\n * @param {Object|null} logits_processor An optional logits processor to use. If null, a new LogitsProcessorList instance will be created.\n * @param {Object} options options\n * @param {Object} [options.inputs_attention_mask=null] An optional attention mask for the inputs.\n * @returns {Promise} An array of generated output sequences, where each sequence is an array of token IDs.\n * @throws {Error} Throws an error if the inputs array is empty.\n */\n async generate(\n inputs,\n generation_config = null,\n logits_processor = null,\n {\n inputs_attention_mask = null\n } = {},\n ) {\n if (!this.can_generate) {\n const modelName = MODEL_CLASS_TO_NAME_MAPPING.get(this.constructor);\n let errorMessage = `The current model class (${modelName}) is not compatible with \\`.generate()\\`, as it doesn't have a language model head.`\n\n const modelType = this.config.model_type;\n const possibleInfo =\n MODEL_WITH_LM_HEAD_MAPPING_NAMES.get(modelType)\n ?? MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES.get(modelType)\n ?? MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES.get(modelType)\n // ?? MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES.get(modelType) // TODO\n ?? MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES.get(modelType);\n\n if (possibleInfo) {\n // TODO: support multiple possible classes\n errorMessage += ` Please use the following class instead: '${possibleInfo[0]}'`;\n }\n throw Error(errorMessage);\n }\n\n if (!(inputs instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor) && !(0,_utils_core_js__WEBPACK_IMPORTED_MODULE_1__.isTypedArray)(inputs) && !Array.isArray(inputs)) {\n throw Error(`\\`inputs\\` must be a Tensor, TypedArray, or Array, but is \"${inputs.constructor.name}\".`);\n }\n\n let input_ids_seq_length;\n\n // Prepare `input_ids` which will be used for auto-regressive generation\n // TODO: Update to align with HF transformers' implementation\n if (this.config.is_encoder_decoder) {\n // Generating from the encoder outputs\n input_ids_seq_length = 0;\n\n } else {\n input_ids_seq_length = inputs instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor ? inputs.dims.at(-1) : inputs.length;\n\n // decoder-only\n if (input_ids_seq_length === 0) {\n throw Error(\"Must supply a non-empty array of input token ids.\")\n }\n }\n\n // Update generation config with defaults\n generation_config = this._get_generation_config(generation_config);\n\n logits_processor = logits_processor ?? new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.LogitsProcessorList()\n\n // Update logits processor\n logits_processor = this._get_logits_processor(\n generation_config,\n input_ids_seq_length,\n logits_processor\n )\n\n /** @type {number[]} */\n let eos_token_ids = generation_config.eos_token_id;\n if (eos_token_ids !== null && !Array.isArray(eos_token_ids)) {\n eos_token_ids = [eos_token_ids];\n }\n\n // TODO implement early_stopping\n // https://huggingface.co/blog/how-to-generate\n\n let numOutputTokens = 1;\n const maxOutputTokens = numOutputTokens + (generation_config.max_new_tokens ?? Infinity);\n\n // Only use max length if max_new_tokens is not provided\n const useMaxLength = Number.isInteger(generation_config.max_length) && (generation_config.max_new_tokens ?? null) === null;\n let sampler = _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.Sampler.getSampler(generation_config);\n\n // @ts-ignore\n let beams = this.getStartBeams(inputs, generation_config, numOutputTokens, inputs_attention_mask);\n\n while (beams.some(x => !x.done) && numOutputTokens < maxOutputTokens) {\n let newest_beams = [];\n for (let beam of beams) {\n if (beam.done) {\n // Add this beam back into the pool\n newest_beams.push(beam);\n continue\n }\n if (useMaxLength && beam.output_token_ids.length >= generation_config.max_length) {\n // Set this beam to done and add it back into the pool\n beam.done = true;\n newest_beams.push(beam);\n continue\n }\n\n // @ts-ignore\n let output = await this.runBeam(beam);\n\n // add attentions/scores to beam only if user requested\n if (generation_config.output_attentions) {\n this.addAttentionsToBeam(beam, output);\n }\n if (generation_config.output_scores) {\n // TODO add\n }\n\n // Logits are of the form [batch_size, out_seq_length, vocab_size]\n // In most cases, this will be [batch_size, 1, vocab_size]\n // So, we select the last token's logits:\n // (equivalent to `logits = outputs.logits[:, -1, :]`)\n let logits = output.logits.slice(null, -1, null);\n\n // Apply logits processor\n logits_processor(beam.output_token_ids, logits);\n\n let sampledTokens = sampler(logits);\n for (let [newTokenId, logProb] of sampledTokens) {\n // use previous beam as a starting point\n let newBeam = { ...beam };\n\n // update new beam\n // @ts-ignore\n this.updateBeam(newBeam, newTokenId);\n\n newBeam.score += logProb;\n\n if (eos_token_ids && eos_token_ids.includes(newTokenId)) {\n newBeam.done = true;\n }\n\n newest_beams.push(newBeam);\n }\n }\n ++numOutputTokens;\n\n // Next, we get the best beams, per ID\n newest_beams = this.groupBeams(newest_beams).map(\n group => group\n .sort((a, b) => b.score - a.score) // sort by score\n .slice(0, generation_config.num_beams) // remove outside beam width\n );\n\n // Flatten beams\n beams = newest_beams.flat();\n\n // Run callback\n if (generation_config.callback_function) {\n generation_config.callback_function(beams);\n }\n }\n\n // TODO: Ensure that we can return non-batched outputs\n\n const groupedBeams = this.groupBeams(beams);\n\n const getFlattened = (key) => groupedBeams.map(\n batch => {\n if (generation_config.num_return_sequences > 1) {\n return batch.slice(0, generation_config.num_return_sequences).map(x => x[key]);\n } else {\n return [batch[0][key]];\n }\n }\n ).flat(); // Flatten across batches (depth=1)\n\n const sequences = getFlattened('output_token_ids'); // [1, seqLength]\n\n if (generation_config.return_dict_in_generate) {\n // NOTE: `decoder_attentions` and `cross_attentions` should be:\n // list (one element for each generated token)\n // of list (one element for each layer of the decoder)\n // of torch.FloatTensor of shape (batch_size, num_heads, generated_length, sequence_length)\n // However, since we are only generating one batch at a time, they are of the form:\n // list (batches)\n // of list (one element for each generated token)\n // of list (one element for each layer of the decoder)\n // of torch.FloatTensor of shape (1, num_heads, generated_length, sequence_length)\n // \n // TODO: In future (when true parallelism, we should be able to return the correct shape)\n\n const decoder_attentions = getFlattened('decoder_attentions');\n const cross_attentions = getFlattened('cross_attentions');\n\n return {\n sequences,\n\n decoder_attentions,\n cross_attentions,\n }\n } else {\n return sequences;\n }\n }\n\n /**\n * Helper function to add attentions to beam\n * @param {Object} beam \n * @param {Object} output\n * @private \n */\n addAttentionsToBeam(beam, output) {\n if (this.config.is_encoder_decoder) {\n if (!output.cross_attentions || output.cross_attentions.length === 0) {\n throw Error(\n \"`output_attentions` is true, but the model did not produce cross-attentions. \" +\n \"This is most likely because the model was not exported with `output_attentions=True`.\"\n )\n }\n if (!beam.cross_attentions) {\n beam.cross_attentions = [];\n }\n beam.cross_attentions.push(output.cross_attentions);\n }\n\n if (!output.decoder_attentions || output.decoder_attentions.length === 0) {\n throw Error(\n \"`output_attentions` is true, but the model did not produce decoder-attentions. \" +\n \"This is most likely because the model was not exported with `output_attentions=True`.\"\n )\n }\n if (!beam.decoder_attentions) {\n beam.decoder_attentions = [];\n }\n beam.decoder_attentions.push(output.decoder_attentions);\n }\n\n /**\n * Groups an array of beam objects by their ids.\n *\n * @param {Array} beams The array of beam objects to group.\n * @returns {Array} An array of arrays, where each inner array contains beam objects with the same id.\n */\n groupBeams(beams) {\n // Group beams by their ids\n const groups = Object.create(null);\n for (const obj of beams) {\n if (groups[obj.id] === undefined) {\n groups[obj.id] = [obj];\n } else {\n groups[obj.id].push(obj);\n }\n }\n\n return Object.values(groups);\n }\n\n /**\n * Returns an object containing past key values from the given decoder results object.\n *\n * @param {Object} decoderResults The decoder results object.\n * @param {Object} pastKeyValues The previous past key values.\n * @returns {Object} An object containing past key values.\n */\n getPastKeyValues(decoderResults, pastKeyValues) {\n\n const pkvs = Object.create(null);\n\n for (const name in decoderResults) {\n if (name.startsWith('present')) {\n let newName = name.replace('present', 'past_key_values');\n\n if (pastKeyValues && name.includes('encoder')) {\n // Optimization introduced by optimum to reuse past key values. So, we just replace the constant\n // outputs with the previous past key values.\n // https://github.com/huggingface/optimum/blob/0bf2c05fb7e1182b52d21b703cfc95fd9e4ea3dc/optimum/onnxruntime/base.py#L677-L704\n pkvs[newName] = pastKeyValues[newName];\n } else {\n pkvs[newName] = decoderResults[name];\n }\n }\n }\n return pkvs;\n }\n\n /**\n * Returns an object containing attentions from the given decoder results object.\n *\n * @param {Object} decoderResults The decoder results object.\n * @returns {Object} An object containing attentions.\n */\n getAttentions(decoderResults) {\n const attns = Object.create(null);\n\n for (const attnName of ['cross_attentions', 'decoder_attentions']) {\n const result = [];\n for (const name in decoderResults) {\n if (name.startsWith(attnName)) {\n const index = name.split('.').pop()\n result[index] = decoderResults[name];\n }\n }\n attns[attnName] = result;\n }\n return attns;\n }\n\n /**\n * Adds past key values to the decoder feeds object. If pastKeyValues is null, creates new tensors for past key values.\n *\n * @param {Object} decoderFeeds The decoder feeds object to add past key values to.\n * @param {Object} pastKeyValues An object containing past key values.\n */\n addPastKeyValues(decoderFeeds, pastKeyValues) {\n if (pastKeyValues) {\n Object.assign(decoderFeeds, pastKeyValues)\n } else {\n // TODO support batches (i.e., batch_size > 1)\n const batch_size = 1;\n\n // @ts-ignore\n if (this.config.is_encoder_decoder && (this.add_encoder_pkv ?? true)) {\n // @ts-ignore\n let encoder_dims = [batch_size, this.num_encoder_heads, 0, this.encoder_dim_kv];\n // @ts-ignore\n let decoder_dims = [batch_size, this.num_decoder_heads, 0, this.decoder_dim_kv];\n // @ts-ignore\n for (let i = 0; i < this.num_decoder_layers; ++i) {\n decoderFeeds[`past_key_values.${i}.encoder.key`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], encoder_dims)\n decoderFeeds[`past_key_values.${i}.encoder.value`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], encoder_dims)\n decoderFeeds[`past_key_values.${i}.decoder.key`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], decoder_dims)\n decoderFeeds[`past_key_values.${i}.decoder.value`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], decoder_dims)\n }\n } else if (this.config.model_type === 'falcon') {\n // NOTE: Custom implementation for Falcon\n // @ts-ignore\n let dims = [batch_size * this.num_heads, 0, this.dim_kv]\n // @ts-ignore\n for (let i = 0; i < this.num_layers; ++i) {\n decoderFeeds[`past_key_values.${i}.key`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], dims)\n decoderFeeds[`past_key_values.${i}.value`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], dims)\n }\n } else if (this.config.multi_query) { // e.g., for `gpt_bigcode`\n // @ts-ignore\n let dims = [batch_size * this.num_heads, 0, 2 * this.dim_kv]\n // @ts-ignore\n for (let i = 0; i < this.num_layers; ++i) {\n decoderFeeds[`past_key_values.${i}.key_value`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], dims)\n }\n } else if (this.config.model_type === 'bloom') {\n // NOTE: Custom implementation for Bloom\n\n // @ts-ignore\n let keyDims = [batch_size * this.num_heads, this.dim_kv, 0] // [batch_size x num_heads,64,past_sequence_length]\n // @ts-ignore\n let valueDims = [batch_size * this.num_heads, 0, this.dim_kv] // [batch_size x num_heads,past_sequence_length,64]\n // @ts-ignore\n for (let i = 0; i < this.num_layers; ++i) {\n decoderFeeds[`past_key_values.${i}.key`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], keyDims)\n decoderFeeds[`past_key_values.${i}.value`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], valueDims)\n }\n } else { // Decoder-only\n // @ts-ignore\n let dims = [batch_size, this.num_heads, 0, this.dim_kv]\n // @ts-ignore\n for (let i = 0; i < this.num_layers; ++i) {\n decoderFeeds[`past_key_values.${i}.key`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], dims)\n decoderFeeds[`past_key_values.${i}.value`] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor('float32', [], dims)\n }\n }\n }\n }\n\n /**\n * Initializes and returns the beam for text generation task\n * @param {Tensor} inputTokenIds The input token ids.\n * @param {Object} generation_config The generation config.\n * @param {number} numOutputTokens The number of tokens to be generated.\n * @param {Tensor} inputs_attention_mask Optional input attention mask.\n * @returns {any} A Beam object representing the initialized beam.\n * @private\n */\n getStartBeams(inputTokenIds, generation_config, numOutputTokens, inputs_attention_mask) {\n return this._getStartBeams(this, inputTokenIds, generation_config, numOutputTokens, inputs_attention_mask)\n }\n\n /**\n * Runs a single step of the beam search generation algorithm.\n * @param {any} beam The current beam being generated.\n * @returns {Promise} The updated beam after a single generation step.\n * @private\n */\n async runBeam(beam) {\n return await this._runBeam(this, beam);\n }\n\n /**\n * Update a beam with a new token ID.\n * @param {Object} beam The beam to update.\n * @param {number} newTokenId The new token ID to add to the beam's output.\n * @private\n */\n updateBeam(beam, newTokenId) {\n return this._updateBeam(beam, newTokenId);\n }\n}\n\n//////////////////////////////////////////////////\n// Base model output class\nclass ModelOutput { }\n\n/**\n * Base class for model's outputs, with potential hidden states and attentions.\n */\nclass BaseModelOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.last_hidden_state Sequence of hidden-states at the output of the last layer of the model.\n * @param {Tensor} [output.hidden_states] Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.\n * @param {Tensor} [output.attentions] Attentions weights after the attention softmax, used to compute the weighted average in the self-attention heads.\n */\n constructor({ last_hidden_state, hidden_states = null, attentions = null }) {\n super();\n this.last_hidden_state = last_hidden_state;\n this.hidden_states = hidden_states;\n this.attentions = attentions;\n }\n}\n//////////////////////////////////////////////////\n// Bert models\nclass BertPreTrainedModel extends PreTrainedModel { }\nclass BertModel extends BertPreTrainedModel { }\n\n/**\n * BertForMaskedLM is a class representing a BERT model for masked language modeling.\n */\nclass BertForMaskedLM extends BertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * BertForSequenceClassification is a class representing a BERT model for sequence classification.\n */\nclass BertForSequenceClassification extends BertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * BertForTokenClassification is a class representing a BERT model for token classification.\n */\nclass BertForTokenClassification extends BertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * BertForQuestionAnswering is a class representing a BERT model for question answering.\n */\nclass BertForQuestionAnswering extends BertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// NomicBert models\nclass NomicBertPreTrainedModel extends PreTrainedModel { }\nclass NomicBertModel extends NomicBertPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// RoFormer models\nclass RoFormerPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare RoFormer Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass RoFormerModel extends RoFormerPreTrainedModel { }\n\n/**\n * RoFormer Model with a `language modeling` head on top.\n */\nclass RoFormerForMaskedLM extends RoFormerPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RoFormer Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nclass RoFormerForSequenceClassification extends RoFormerPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RoFormer Model with a token classification head on top (a linear layer on top of the hidden-states output)\n * e.g. for Named-Entity-Recognition (NER) tasks.\n */\nclass RoFormerForTokenClassification extends RoFormerPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RoFormer Model with a span classification head on top for extractive question-answering tasks like SQuAD\n * (a linear layers on top of the hidden-states output to compute `span start logits` and `span end logits`).\n */\nclass RoFormerForQuestionAnswering extends RoFormerPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n// TODO: Add RoFormerForCausalLM and RoFormerForMultipleChoice\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// ConvBert models\nclass ConvBertPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare ConvBERT Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass ConvBertModel extends ConvBertPreTrainedModel { }\n\n/**\n * ConvBERT Model with a language modeling head on top.\n */\nclass ConvBertForMaskedLM extends ConvBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ConvBERT Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nclass ConvBertForSequenceClassification extends ConvBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ConvBERT Model with a token classification head on top (a linear layer on top of the hidden-states output)\n * e.g. for Named-Entity-Recognition (NER) tasks.\n */\nclass ConvBertForTokenClassification extends ConvBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ConvBERT Model with a span classification head on top for extractive question-answering tasks like SQuAD\n * (a linear layers on top of the hidden-states output to compute `span start logits` and `span end logits`)\n */\nclass ConvBertForQuestionAnswering extends ConvBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Electra models\nclass ElectraPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Electra Model transformer outputting raw hidden-states without any specific head on top.\n * Identical to the BERT model except that it uses an additional linear layer between the embedding\n * layer and the encoder if the hidden size and embedding size are different.\n */\nclass ElectraModel extends ElectraPreTrainedModel { }\n// TODO add ElectraForPreTraining\n/**\n * Electra model with a language modeling head on top.\n */\nclass ElectraForMaskedLM extends ElectraPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ELECTRA Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nclass ElectraForSequenceClassification extends ElectraPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * Electra model with a token classification head on top.\n */\nclass ElectraForTokenClassification extends ElectraPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * LECTRA Model with a span classification head on top for extractive question-answering tasks like SQuAD\n * (a linear layers on top of the hidden-states output to compute `span start logits` and `span end logits`).\n */\nclass ElectraForQuestionAnswering extends ElectraPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// CamemBERT models\nclass CamembertPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare CamemBERT Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass CamembertModel extends CamembertPreTrainedModel { }\n\n/**\n * CamemBERT Model with a `language modeling` head on top.\n */\nclass CamembertForMaskedLM extends CamembertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * CamemBERT Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g. for GLUE tasks.\n */\nclass CamembertForSequenceClassification extends CamembertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * CamemBERT Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks.\n */\nclass CamembertForTokenClassification extends CamembertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * CamemBERT Model with a span classification head on top for extractive question-answering tasks\n */\nclass CamembertForQuestionAnswering extends CamembertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// DeBERTa models\nclass DebertaPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare DeBERTa Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass DebertaModel extends DebertaPreTrainedModel { }\n\n/**\n * DeBERTa Model with a `language modeling` head on top.\n */\nclass DebertaForMaskedLM extends DebertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nclass DebertaForSequenceClassification extends DebertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks.\n */\nclass DebertaForTokenClassification extends DebertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear\n * layers on top of the hidden-states output to compute `span start logits` and `span end logits`).\n */\nclass DebertaForQuestionAnswering extends DebertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// DeBERTa-v2 models\nclass DebertaV2PreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare DeBERTa-V2 Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass DebertaV2Model extends DebertaV2PreTrainedModel { }\n\n/**\n * DeBERTa-V2 Model with a `language modeling` head on top.\n */\nclass DebertaV2ForMaskedLM extends DebertaV2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa-V2 Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nclass DebertaV2ForSequenceClassification extends DebertaV2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa-V2 Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks.\n */\nclass DebertaV2ForTokenClassification extends DebertaV2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DeBERTa-V2 Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear\n * layers on top of the hidden-states output to compute `span start logits` and `span end logits`).\n */\nclass DebertaV2ForQuestionAnswering extends DebertaV2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// DistilBert models\nclass DistilBertPreTrainedModel extends PreTrainedModel { }\nclass DistilBertModel extends DistilBertPreTrainedModel { }\n\n/**\n * DistilBertForSequenceClassification is a class representing a DistilBERT model for sequence classification.\n */\nclass DistilBertForSequenceClassification extends DistilBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DistilBertForTokenClassification is a class representing a DistilBERT model for token classification.\n */\nclass DistilBertForTokenClassification extends DistilBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n\n/**\n * DistilBertForQuestionAnswering is a class representing a DistilBERT model for question answering.\n */\nclass DistilBertForQuestionAnswering extends DistilBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * DistilBertForMaskedLM is a class representing a DistilBERT model for masking task.\n */\nclass DistilBertForMaskedLM extends DistilBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// ESM models\nclass EsmPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare ESM Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass EsmModel extends EsmPreTrainedModel { }\n\n/**\n * ESM Model with a `language modeling` head on top.\n */\nclass EsmForMaskedLM extends EsmPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ESM Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nclass EsmForSequenceClassification extends EsmPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * ESM Model with a token classification head on top (a linear layer on top of the hidden-states output)\n * e.g. for Named-Entity-Recognition (NER) tasks.\n */\nclass EsmForTokenClassification extends EsmPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// MobileBert models\nclass MobileBertPreTrainedModel extends PreTrainedModel { }\nclass MobileBertModel extends MobileBertPreTrainedModel { }\n\n/**\n * MobileBertForMaskedLM is a class representing a MobileBERT model for masking task.\n */\nclass MobileBertForMaskedLM extends MobileBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * MobileBert Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nclass MobileBertForSequenceClassification extends MobileBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * MobileBert Model with a span classification head on top for extractive question-answering tasks\n */\nclass MobileBertForQuestionAnswering extends MobileBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// MPNet models\nclass MPNetPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare MPNet Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass MPNetModel extends MPNetPreTrainedModel { }\n\n/**\n * MPNetForMaskedLM is a class representing a MPNet model for masked language modeling.\n */\nclass MPNetForMaskedLM extends MPNetPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for masked language modeling.\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * MPNetForSequenceClassification is a class representing a MPNet model for sequence classification.\n */\nclass MPNetForSequenceClassification extends MPNetPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * MPNetForTokenClassification is a class representing a MPNet model for token classification.\n */\nclass MPNetForTokenClassification extends MPNetPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * MPNetForQuestionAnswering is a class representing a MPNet model for question answering.\n */\nclass MPNetForQuestionAnswering extends MPNetPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for question answering.\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// SqueezeBert models\nclass SqueezeBertPreTrainedModel extends PreTrainedModel { }\nclass SqueezeBertModel extends SqueezeBertPreTrainedModel { }\nclass SqueezeBertForMaskedLM extends SqueezeBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\nclass SqueezeBertForSequenceClassification extends SqueezeBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\nclass SqueezeBertForQuestionAnswering extends SqueezeBertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Albert models\nclass AlbertPreTrainedModel extends PreTrainedModel { }\nclass AlbertModel extends AlbertPreTrainedModel { }\nclass AlbertForSequenceClassification extends AlbertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\nclass AlbertForQuestionAnswering extends AlbertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\nclass AlbertForMaskedLM extends AlbertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// T5 models\nclass T5PreTrainedModel extends PreTrainedModel { };\n\nclass T5Model extends T5PreTrainedModel { }\n\n/**\n * T5Model is a class representing a T5 model for conditional generation.\n */\nclass T5ForConditionalGeneration extends T5PreTrainedModel {\n\n /**\n * Creates a new instance of the `T5ForConditionalGeneration` class.\n * @param {Object} config The model configuration.\n * @param {any} session session for the model.\n * @param {any} decoder_merged_session session for the decoder.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.num_decoder_layers;\n this.num_decoder_heads = this.config.num_heads;\n this.decoder_dim_kv = this.config.d_kv;\n\n this.num_encoder_layers = this.config.num_layers;\n this.num_encoder_heads = this.config.num_heads;\n this.encoder_dim_kv = this.config.d_kv;\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// LONGT5 models\n/**\n * An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.\n */\nclass LongT5PreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare LONGT5 Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass LongT5Model extends LongT5PreTrainedModel { }\n\n/**\n * LONGT5 Model with a `language modeling` head on top.\n */\nclass LongT5ForConditionalGeneration extends LongT5PreTrainedModel {\n /**\n * Creates a new instance of the `LongT5ForConditionalGeneration` class.\n * @param {Object} config The model configuration.\n * @param {any} session session for the model.\n * @param {any} decoder_merged_session session for the decoder.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.num_decoder_layers;\n this.num_decoder_heads = this.config.num_heads;\n this.decoder_dim_kv = this.config.d_kv;\n\n this.num_encoder_layers = this.config.num_layers;\n this.num_encoder_heads = this.config.num_heads;\n this.encoder_dim_kv = this.config.d_kv;\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// MT5 models\nclass MT5PreTrainedModel extends PreTrainedModel { };\n\nclass MT5Model extends MT5PreTrainedModel { }\n\n/**\n * A class representing a conditional sequence-to-sequence model based on the MT5 architecture.\n */\nclass MT5ForConditionalGeneration extends MT5PreTrainedModel {\n\n /**\n * Creates a new instance of the `MT5ForConditionalGeneration` class.\n * @param {any} config The model configuration.\n * @param {any} session The ONNX session containing the encoder weights.\n * @param {any} decoder_merged_session The ONNX session containing the merged decoder weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.num_decoder_layers;\n this.num_decoder_heads = this.config.num_heads;\n this.decoder_dim_kv = this.config.d_kv;\n\n this.num_encoder_layers = this.config.num_layers;\n this.num_encoder_heads = this.config.num_heads;\n this.encoder_dim_kv = this.config.d_kv;\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Bart models\nclass BartPretrainedModel extends PreTrainedModel { };\n\n/**\n * The bare BART Model outputting raw hidden-states without any specific head on top.\n */\nclass BartModel extends BartPretrainedModel { }\n\n/**\n * The BART Model with a language modeling head. Can be used for summarization.\n */\nclass BartForConditionalGeneration extends BartPretrainedModel {\n\n /**\n * Creates a new instance of the `BartForConditionalGeneration` class.\n * @param {Object} config The configuration object for the Bart model.\n * @param {Object} session The ONNX session used to execute the model.\n * @param {Object} decoder_merged_session The ONNX session used to execute the decoder.\n * @param {Object} generation_config The generation configuration object.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n\n}\n\n/**\n * Bart model with a sequence classification/head on top (a linear layer on top of the pooled output)\n */\nclass BartForSequenceClassification extends BartPretrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// MBart models\nclass MBartPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare MBART Model outputting raw hidden-states without any specific head on top.\n */\nclass MBartModel extends MBartPreTrainedModel { }\n\n/**\n * The MBART Model with a language modeling head. Can be used for summarization, after fine-tuning the pretrained models.\n */\nclass MBartForConditionalGeneration extends MBartPreTrainedModel {\n\n /**\n * Creates a new instance of the `MBartForConditionalGeneration` class.\n * @param {Object} config The configuration object for the Bart model.\n * @param {Object} session The ONNX session used to execute the model.\n * @param {Object} decoder_merged_session The ONNX session used to execute the decoder.\n * @param {Object} generation_config The generation configuration object.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n\n}\n\n/**\n * MBart model with a sequence classification/head on top (a linear layer on top of the pooled output).\n */\nclass MBartForSequenceClassification extends MBartPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n\nclass MBartForCausalLM extends MBartPreTrainedModel {\n /**\n * Creates a new instance of the `MBartForCausalLM` class.\n * @param {Object} config Configuration object for the model.\n * @param {Object} decoder_merged_session ONNX Session object for the decoder.\n * @param {Object} generation_config Configuration object for the generation process.\n */\n constructor(config, decoder_merged_session, generation_config) {\n super(config, decoder_merged_session);\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Blenderbot models\nclass BlenderbotPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare Blenderbot Model outputting raw hidden-states without any specific head on top.\n */\nclass BlenderbotModel extends BlenderbotPreTrainedModel { }\n\n/**\n * The Blenderbot Model with a language modeling head. Can be used for summarization.\n */\nclass BlenderbotForConditionalGeneration extends BlenderbotPreTrainedModel {\n\n /**\n * Creates a new instance of the `BlenderbotForConditionalGeneration` class.\n * @param {any} config The model configuration.\n * @param {any} session The ONNX session containing the encoder weights.\n * @param {any} decoder_merged_session The ONNX session containing the merged decoder weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Blenderbot models\nclass BlenderbotSmallPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare BlenderbotSmall Model outputting raw hidden-states without any specific head on top.\n */\nclass BlenderbotSmallModel extends BlenderbotSmallPreTrainedModel { }\n\n/**\n * The BlenderbotSmall Model with a language modeling head. Can be used for summarization.\n */\nclass BlenderbotSmallForConditionalGeneration extends BlenderbotSmallPreTrainedModel {\n\n /**\n * Creates a new instance of the `BlenderbotForConditionalGeneration` class.\n * @param {any} config The model configuration.\n * @param {any} session The ONNX session containing the encoder weights.\n * @param {any} decoder_merged_session The ONNX session containing the merged decoder weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Roberta models\nclass RobertaPreTrainedModel extends PreTrainedModel { }\nclass RobertaModel extends RobertaPreTrainedModel { }\n\n/**\n * RobertaForMaskedLM class for performing masked language modeling on Roberta models.\n */\nclass RobertaForMaskedLM extends RobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RobertaForSequenceClassification class for performing sequence classification on Roberta models.\n */\nclass RobertaForSequenceClassification extends RobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RobertaForTokenClassification class for performing token classification on Roberta models.\n */\nclass RobertaForTokenClassification extends RobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * RobertaForQuestionAnswering class for performing question answering on Roberta models.\n */\nclass RobertaForQuestionAnswering extends RobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// XLM models\n/**\n * An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.\n */\nclass XLMPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare XLM Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass XLMModel extends XLMPreTrainedModel { }\n\n/**\n * The XLM Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).\n */\nclass XLMWithLMHeadModel extends XLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLM Model with a sequence classification/regression head on top (a linear layer on top of the pooled output)\n */\nclass XLMForSequenceClassification extends XLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLM Model with a token classification head on top (a linear layer on top of the hidden-states output)\n */\nclass XLMForTokenClassification extends XLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLM Model with a span classification head on top for extractive question-answering tasks\n */\nclass XLMForQuestionAnswering extends XLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// XLMRoberta models\nclass XLMRobertaPreTrainedModel extends PreTrainedModel { }\nclass XLMRobertaModel extends XLMRobertaPreTrainedModel { }\n\n/**\n * XLMRobertaForMaskedLM class for performing masked language modeling on XLMRoberta models.\n */\nclass XLMRobertaForMaskedLM extends XLMRobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new MaskedLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLMRobertaForSequenceClassification class for performing sequence classification on XLMRoberta models.\n */\nclass XLMRobertaForSequenceClassification extends XLMRobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLMRobertaForTokenClassification class for performing token classification on XLMRoberta models.\n */\nclass XLMRobertaForTokenClassification extends XLMRobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for token classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * XLMRobertaForQuestionAnswering class for performing question answering on XLMRoberta models.\n */\nclass XLMRobertaForQuestionAnswering extends XLMRobertaPreTrainedModel {\n /**\n * Calls the model on new inputs.\n *\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} returned object\n */\n async _call(model_inputs) {\n return new QuestionAnsweringModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Audio Spectrogram Transformer (AST) models\nclass ASTPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare AST Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass ASTModel extends ASTPreTrainedModel { }\n\n/**\n * Audio Spectrogram Transformer model with an audio classification head on top\n * (a linear layer on top of the pooled output) e.g. for datasets like AudioSet, Speech Commands v2.\n */\nclass ASTForAudioClassification extends ASTPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Whisper models\nclass WhisperPreTrainedModel extends PreTrainedModel { };\n\n/**\n * WhisperModel class for training Whisper models without a language model head.\n */\nclass WhisperModel extends WhisperPreTrainedModel { }\n\n/**\n * WhisperForConditionalGeneration class for generating conditional outputs from Whisper models.\n */\nclass WhisperForConditionalGeneration extends WhisperPreTrainedModel {\n\n requires_attention_mask = false;\n main_input_name = 'input_features';\n\n /**\n * Creates a new instance of the `WhisperForConditionalGeneration` class.\n * @param {Object} config Configuration object for the model.\n * @param {Object} session ONNX Session object for the model.\n * @param {Object} decoder_merged_session ONNX Session object for the decoder.\n * @param {Object} generation_config Configuration object for the generation process.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n\n /**\n * @typedef {Object} WhisperGenerationConfig\n * @extends GenerationConfig\n * @property {boolean} [return_timestamps=null] Whether to return the timestamps with the text. This enables the `WhisperTimestampsLogitsProcessor`.\n * @property {boolean} [return_token_timestamps=null] Whether to return token-level timestamps\n * with the text. This can be used with or without the `return_timestamps` option. To get word-level\n * timestamps, use the tokenizer to group the tokens into words.\n * @property {number} [num_frames=null] The number of audio frames available in this chunk. This is only used generating word-level timestamps.\n */\n\n /**\n * Generates outputs based on input and generation configuration.\n * @param {Object} inputs Input data for the model.\n * @param {WhisperGenerationConfig} generation_config Configuration object for the generation process.\n * @param {Object} logits_processor Optional logits processor object.\n * @returns {Promise} Promise object represents the generated outputs.\n */\n async generate(\n inputs,\n generation_config = null,\n logits_processor = null,\n // {\n // return_timestamps = null,\n // return_token_timestamps = null,\n // language = null,\n // task = null,\n // } = {},\n ) {\n // Create generation config object\n generation_config = this._get_generation_config(generation_config);\n\n\n // Whisper has additional options for returning timestamps\n generation_config.return_timestamps ??= false;\n\n // TODO add language and task\n\n if (generation_config.return_timestamps) {\n logits_processor = [new _utils_generation_js__WEBPACK_IMPORTED_MODULE_3__.WhisperTimeStampLogitsProcessor(generation_config)]\n }\n\n if (generation_config.return_token_timestamps) {\n generation_config.output_attentions = true;\n generation_config.return_dict_in_generate = true;\n\n if (generation_config.task === 'translate') {\n console.warn(\"Token-level timestamps may not be reliable for task 'translate'.\")\n }\n\n if (!generation_config.alignment_heads) {\n throw new Error(\n \"Model generation config has no `alignment_heads`, token-level timestamps not available. \" +\n \"See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.\"\n )\n }\n }\n\n const outputs = await super.generate(inputs, generation_config, logits_processor);\n\n if (generation_config.return_token_timestamps && generation_config.alignment_heads) {\n outputs[\"token_timestamps\"] = this._extract_token_timestamps(\n outputs,\n generation_config.alignment_heads,\n generation_config.num_frames,\n )\n }\n\n return outputs\n }\n\n /**\n * Calculates token-level timestamps using the encoder-decoder cross-attentions and\n * dynamic time-warping (DTW) to map each output token to a position in the input audio.\n * @param {Object} generate_outputs Outputs generated by the model\n * @param {Tensor[][][]} generate_outputs.cross_attentions The cross attentions output by the model\n * @param {Tensor[][][]} generate_outputs.decoder_attentions The decoder attentions output by the model\n * @param {number[][]} generate_outputs.sequences The sequences output by the model\n * @param {number[][]} alignment_heads Alignment heads of the model\n * @param {number} [num_frames=null] Number of frames in the input audio.\n * @param {number} [time_precision=0.02] Precision of the timestamps in seconds\n * @returns {Tensor} tensor containing the timestamps in seconds for each predicted token\n */\n _extract_token_timestamps(generate_outputs, alignment_heads, num_frames = null, time_precision = 0.02) {\n if (!generate_outputs.cross_attentions) {\n throw new Error(\n \"Model outputs must contain cross attentions to extract timestamps. \" +\n \"This is most likely because the model was not exported with `output_attentions=True`.\"\n )\n }\n\n let median_filter_width = this.config.median_filter_width;\n if (median_filter_width === undefined) {\n console.warn(\"Model config has no `median_filter_width`, using default value of 7.\")\n median_filter_width = 7;\n }\n\n const batchedMatrices = generate_outputs.cross_attentions.map(batch => {\n // Create a list with `decoder_layers` elements, each a tensor of shape\n // (batch size, attention_heads, output length, input length).\n let cross_attentions = Array.from({ length: this.config.decoder_layers },\n (_, i) => (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.cat)(batch.map(x => x[i]), 2)\n );\n\n let weights = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.stack)(alignment_heads.map(([l, h]) => {\n return num_frames\n ? cross_attentions[l].slice(null, h, null, [0, num_frames])\n : cross_attentions[l].slice(null, h);\n }));\n weights = weights.transpose(1, 0, 2, 3)\n\n let [std, calculatedMean] = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.std_mean)(weights, -2, 0, true);\n\n // Normalize and smoothen the weights.\n let smoothedWeights = weights.clone(); // [1, 8, seqLength, 1500]\n\n for (let a = 0; a < smoothedWeights.dims[0]; ++a) {\n let aTensor = smoothedWeights[a]; // [8, seqLength, 1500]\n\n for (let b = 0; b < aTensor.dims[0]; ++b) {\n let bTensor = aTensor[b]; // [seqLength, 1500]\n\n const stdTensor = std[a][b][0]; // [1500]\n const meanTensor = calculatedMean[a][b][0]; // [1500]\n\n for (let c = 0; c < bTensor.dims[0]; ++c) {\n\n let cTensor = bTensor[c]; // [1500]\n for (let d = 0; d < cTensor.data.length; ++d) {\n cTensor.data[d] = (cTensor.data[d] - meanTensor.data[d]) / stdTensor.data[d]\n }\n\n // Apply median filter.\n cTensor.data.set((0,_transformers_js__WEBPACK_IMPORTED_MODULE_6__.medianFilter)(cTensor.data, median_filter_width))\n }\n }\n }\n\n // Average the different cross-attention heads.\n const matrix = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.mean)(smoothedWeights, 1);\n return matrix;\n });\n\n const timestampsShape = [generate_outputs.sequences.length, generate_outputs.sequences[0].length];\n\n const timestamps = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor(\n 'float32',\n new Float32Array(timestampsShape[0] * timestampsShape[1]),\n timestampsShape\n );\n\n // Perform dynamic time warping on each element of the batch.\n for (let batch_idx = 0; batch_idx < timestampsShape[0]; ++batch_idx) {\n // NOTE: Since we run only one batch at a time, we can squeeze to get the same dimensions\n // as the python implementation\n const matrix = batchedMatrices[batch_idx].neg().squeeze_(0);\n let [text_indices, time_indices] = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.dynamicTimeWarping)(matrix);\n\n let diffs = Array.from({ length: text_indices.length - 1 }, (v, i) => text_indices[i + 1] - text_indices[i]);\n let jumps = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_1__.mergeArrays)([1], diffs).map(x => !!x); // convert to boolean\n\n let jump_times = [];\n for (let i = 0; i < jumps.length; ++i) {\n if (jumps[i]) {\n jump_times.push(time_indices[i] * time_precision);\n // NOTE: No point in rounding here, since we set to Float32Array later\n }\n }\n timestamps[batch_idx].data.set(jump_times, 1)\n }\n\n return timestamps;\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n/**\n * Vision Encoder-Decoder model based on OpenAI's GPT architecture for image captioning and other vision tasks\n */\nclass VisionEncoderDecoderModel extends PreTrainedModel {\n main_input_name = 'pixel_values';\n\n /**\n * Creates a new instance of the `VisionEncoderDecoderModel` class.\n * @param {Object} config The configuration object specifying the hyperparameters and other model settings.\n * @param {Object} session The ONNX session containing the encoder model.\n * @param {any} decoder_merged_session The ONNX session containing the merged decoder model.\n * @param {Object} generation_config Configuration object for the generation process.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n // Extract configs\n const encoderConfig = this.config.encoder;\n const decoderConfig = this.config.decoder;\n\n // Validate encoder\n const encoderModelType = encoderConfig.model_type;\n const encoderModel =\n MODEL_MAPPING_NAMES_ENCODER_ONLY.get(encoderModelType)\n ?? MODEL_MAPPING_NAMES_ENCODER_DECODER.get(encoderModelType);\n if (!encoderModel) {\n console.warn(`Model type for encoder '${encoderModelType}' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.`);\n }\n\n // Validate decoder\n const decoderModel = MODEL_WITH_LM_HEAD_MAPPING_NAMES.get(decoderConfig.model_type);\n if (!decoderModel) {\n throw new Error(`Unable to construct \\`VisionEncoderDecoder\\` due to unsupported decoder: \"${this.config.decoder.model_type}\"`);\n }\n\n // @ts-ignore\n const decoderModelClass = decoderModel[1];\n // @ts-ignore\n const decoder = new decoderModelClass(decoderConfig, decoder_merged_session, generation_config);\n\n this.add_encoder_pkv = 'num_decoder_layers' in decoder;\n if (this.add_encoder_pkv) {\n // Decoder is part of an encoder-decoder model\n this.num_decoder_layers = decoder.num_decoder_layers;\n this.num_decoder_heads = decoder.num_decoder_heads;\n this.decoder_dim_kv = decoder.decoder_dim_kv;\n\n this.num_encoder_layers = decoder.num_encoder_layers;\n this.num_encoder_heads = decoder.num_encoder_heads;\n this.encoder_dim_kv = decoder.encoder_dim_kv;\n\n } else {\n // Decoder is a decoder-only model\n this.num_layers = decoder.num_layers;\n this.num_heads = decoder.num_heads;\n this.dim_kv = decoder.dim_kv;\n }\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// CLIP models\nclass CLIPPreTrainedModel extends PreTrainedModel { }\n\n/**\n * CLIP Text and Vision Model with a projection layers on top\n * \n * **Example:** Perform zero-shot image classification with a `CLIPModel`.\n * \n * ```javascript\n * import { AutoTokenizer, AutoProcessor, CLIPModel, RawImage } from '@xenova/transformers';\n * \n * // Load tokenizer, processor, and model\n * let tokenizer = await AutoTokenizer.from_pretrained('Xenova/clip-vit-base-patch16');\n * let processor = await AutoProcessor.from_pretrained('Xenova/clip-vit-base-patch16');\n * let model = await CLIPModel.from_pretrained('Xenova/clip-vit-base-patch16');\n * \n * // Run tokenization\n * let texts = ['a photo of a car', 'a photo of a football match']\n * let text_inputs = tokenizer(texts, { padding: true, truncation: true });\n * \n * // Read image and run processor\n * let image = await RawImage.read('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');\n * let image_inputs = await processor(image);\n * \n * // Run model with both text and pixel inputs\n * let output = await model({ ...text_inputs, ...image_inputs });\n * // {\n * // logits_per_image: Tensor {\n * // dims: [ 1, 2 ],\n * // data: Float32Array(2) [ 18.579734802246094, 24.31830596923828 ],\n * // },\n * // logits_per_text: Tensor {\n * // dims: [ 2, 1 ],\n * // data: Float32Array(2) [ 18.579734802246094, 24.31830596923828 ],\n * // },\n * // text_embeds: Tensor {\n * // dims: [ 2, 512 ],\n * // data: Float32Array(1024) [ ... ],\n * // },\n * // image_embeds: Tensor {\n * // dims: [ 1, 512 ],\n * // data: Float32Array(512) [ ... ],\n * // }\n * // }\n * ```\n */\nclass CLIPModel extends CLIPPreTrainedModel { }\n\n/**\n * CLIP Text Model with a projection layer on top (a linear layer on top of the pooled output)\n * \n * **Example:** Compute text embeddings with `CLIPTextModelWithProjection`.\n * \n * ```javascript\n * import { AutoTokenizer, CLIPTextModelWithProjection } from '@xenova/transformers';\n * \n * // Load tokenizer and text model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/clip-vit-base-patch16');\n * const text_model = await CLIPTextModelWithProjection.from_pretrained('Xenova/clip-vit-base-patch16');\n * \n * // Run tokenization\n * let texts = ['a photo of a car', 'a photo of a football match'];\n * let text_inputs = tokenizer(texts, { padding: true, truncation: true });\n * \n * // Compute embeddings\n * const { text_embeds } = await text_model(text_inputs);\n * // Tensor {\n * // dims: [ 2, 512 ],\n * // type: 'float32',\n * // data: Float32Array(1024) [ ... ],\n * // size: 1024\n * // }\n * ```\n */\nclass CLIPTextModelWithProjection extends CLIPPreTrainedModel {\n\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'text_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n\n/**\n * CLIP Vision Model with a projection layer on top (a linear layer on top of the pooled output)\n * \n * **Example:** Compute vision embeddings with `CLIPVisionModelWithProjection`.\n * \n * ```javascript\n * import { AutoProcessor, CLIPVisionModelWithProjection, RawImage} from '@xenova/transformers';\n * \n * // Load processor and vision model\n * const processor = await AutoProcessor.from_pretrained('Xenova/clip-vit-base-patch16');\n * const vision_model = await CLIPVisionModelWithProjection.from_pretrained('Xenova/clip-vit-base-patch16');\n * \n * // Read image and run processor\n * let image = await RawImage.read('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');\n * let image_inputs = await processor(image);\n * \n * // Compute embeddings\n * const { image_embeds } = await vision_model(image_inputs);\n * // Tensor {\n * // dims: [ 1, 512 ],\n * // type: 'float32',\n * // data: Float32Array(512) [ ... ],\n * // size: 512\n * // }\n * ```\n */\nclass CLIPVisionModelWithProjection extends CLIPPreTrainedModel {\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'vision_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// SigLIP models\nclass SiglipPreTrainedModel extends PreTrainedModel { }\n\n/**\n * SigLIP Text and Vision Model with a projection layers on top\n * \n * **Example:** Perform zero-shot image classification with a `SiglipModel`.\n * \n * ```javascript\n * import { AutoTokenizer, AutoProcessor, SiglipModel, RawImage } from '@xenova/transformers';\n * \n * // Load tokenizer, processor, and model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/siglip-base-patch16-224');\n * const processor = await AutoProcessor.from_pretrained('Xenova/siglip-base-patch16-224');\n * const model = await SiglipModel.from_pretrained('Xenova/siglip-base-patch16-224');\n * \n * // Run tokenization\n * const texts = ['a photo of 2 cats', 'a photo of 2 dogs'];\n * const text_inputs = tokenizer(texts, { padding: 'max_length', truncation: true });\n * \n * // Read image and run processor\n * const image = await RawImage.read('http://images.cocodataset.org/val2017/000000039769.jpg');\n * const image_inputs = await processor(image);\n * \n * // Run model with both text and pixel inputs\n * const output = await model({ ...text_inputs, ...image_inputs });\n * // {\n * // logits_per_image: Tensor {\n * // dims: [ 1, 2 ],\n * // data: Float32Array(2) [ -1.6019744873046875, -10.720091819763184 ],\n * // },\n * // logits_per_text: Tensor {\n * // dims: [ 2, 1 ],\n * // data: Float32Array(2) [ -1.6019744873046875, -10.720091819763184 ],\n * // },\n * // text_embeds: Tensor {\n * // dims: [ 2, 768 ],\n * // data: Float32Array(1536) [ ... ],\n * // },\n * // image_embeds: Tensor {\n * // dims: [ 1, 768 ],\n * // data: Float32Array(768) [ ... ],\n * // }\n * // }\n * ```\n */\nclass SiglipModel extends SiglipPreTrainedModel { }\n\n/**\n * The text model from SigLIP without any head or projection on top.\n * \n * **Example:** Compute text embeddings with `SiglipTextModel`.\n * \n * ```javascript\n * import { AutoTokenizer, SiglipTextModel } from '@xenova/transformers';\n * \n * // Load tokenizer and text model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/siglip-base-patch16-224');\n * const text_model = await SiglipTextModel.from_pretrained('Xenova/siglip-base-patch16-224');\n * \n * // Run tokenization\n * const texts = ['a photo of 2 cats', 'a photo of 2 dogs'];\n * const text_inputs = tokenizer(texts, { padding: 'max_length', truncation: true });\n * \n * // Compute embeddings\n * const { pooler_output } = await text_model(text_inputs);\n * // Tensor {\n * // dims: [ 2, 768 ],\n * // type: 'float32',\n * // data: Float32Array(1536) [ ... ],\n * // size: 1536\n * // }\n * ```\n */\nclass SiglipTextModel extends SiglipPreTrainedModel {\n\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'text_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n\n/**\n * The vision model from SigLIP without any head or projection on top.\n * \n * **Example:** Compute vision embeddings with `SiglipVisionModel`.\n * \n * ```javascript\n * import { AutoProcessor, SiglipVisionModel, RawImage} from '@xenova/transformers';\n * \n * // Load processor and vision model\n * const processor = await AutoProcessor.from_pretrained('Xenova/siglip-base-patch16-224');\n * const vision_model = await SiglipVisionModel.from_pretrained('Xenova/siglip-base-patch16-224');\n * \n * // Read image and run processor\n * const image = await RawImage.read('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');\n * const image_inputs = await processor(image);\n * \n * // Compute embeddings\n * const { pooler_output } = await vision_model(image_inputs);\n * // Tensor {\n * // dims: [ 1, 768 ],\n * // type: 'float32',\n * // data: Float32Array(768) [ ... ],\n * // size: 768\n * // }\n * ```\n */\nclass SiglipVisionModel extends CLIPPreTrainedModel {\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'vision_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n//////////////////////////////////////////////////\n// ChineseCLIP models\nclass ChineseCLIPPreTrainedModel extends PreTrainedModel { }\n\nclass ChineseCLIPModel extends ChineseCLIPPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// CLIPSeg models\nclass CLIPSegPreTrainedModel extends PreTrainedModel { }\n\nclass CLIPSegModel extends CLIPSegPreTrainedModel { }\n\n/**\n * CLIPSeg model with a Transformer-based decoder on top for zero-shot and one-shot image segmentation.\n * \n * **Example:** Perform zero-shot image segmentation with a `CLIPSegForImageSegmentation` model.\n * \n * ```javascript\n * import { AutoTokenizer, AutoProcessor, CLIPSegForImageSegmentation, RawImage } from '@xenova/transformers';\n * \n * // Load tokenizer, processor, and model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/clipseg-rd64-refined');\n * const processor = await AutoProcessor.from_pretrained('Xenova/clipseg-rd64-refined');\n * const model = await CLIPSegForImageSegmentation.from_pretrained('Xenova/clipseg-rd64-refined');\n * \n * // Run tokenization\n * const texts = ['a glass', 'something to fill', 'wood', 'a jar'];\n * const text_inputs = tokenizer(texts, { padding: true, truncation: true });\n * \n * // Read image and run processor\n * const image = await RawImage.read('https://github.com/timojl/clipseg/blob/master/example_image.jpg?raw=true');\n * const image_inputs = await processor(image);\n * \n * // Run model with both text and pixel inputs\n * const { logits } = await model({ ...text_inputs, ...image_inputs });\n * // logits: Tensor {\n * // dims: [4, 352, 352],\n * // type: 'float32',\n * // data: Float32Array(495616) [ ... ],\n * // size: 495616\n * // }\n * ```\n * \n * You can visualize the predictions as follows:\n * ```javascript\n * const preds = logits\n * .unsqueeze_(1)\n * .sigmoid_()\n * .mul_(255)\n * .round_()\n * .to('uint8');\n * \n * for (let i = 0; i < preds.dims[0]; ++i) {\n * const img = RawImage.fromTensor(preds[i]);\n * img.save(`prediction_${i}.png`);\n * }\n * ```\n */\nclass CLIPSegForImageSegmentation extends CLIPSegPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// GPT2 models\nclass GPT2PreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `GPT2PreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_head\n this.num_layers = this.config.n_layer\n this.dim_kv = this.config.n_embd / this.num_heads;\n }\n}\n\nclass GPT2Model extends GPT2PreTrainedModel { }\n\n/**\n * GPT-2 language model head on top of the GPT-2 base model. This model is suitable for text generation tasks.\n */\nclass GPT2LMHeadModel extends GPT2PreTrainedModel { }\n// export class GPT2ForSequenceClassification extends GPT2PreTrainedModel {\n// TODO\n// }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// GPTNeo models\nclass GPTNeoPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `GPTNeoPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_heads;\n this.num_layers = this.config.num_layers;\n this.dim_kv = this.config.hidden_size / this.num_heads;\n }\n}\nclass GPTNeoModel extends GPTNeoPreTrainedModel { }\n\nclass GPTNeoForCausalLM extends GPTNeoPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// GPTNeoX models\nclass GPTNeoXPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `GPTNeoXPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_attention_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.num_heads;\n }\n}\nclass GPTNeoXModel extends GPTNeoXPreTrainedModel { }\n\nclass GPTNeoXForCausalLM extends GPTNeoXPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// GPT-J models\nclass GPTJPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `GPTJPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_head\n this.num_layers = this.config.n_layer\n this.dim_kv = this.config.n_embd / this.num_heads;\n }\n}\n\nclass GPTJModel extends GPTJPreTrainedModel { }\n\nclass GPTJForCausalLM extends GPTJPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// GPTBigCode models\nclass GPTBigCodePreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `GPTBigCodePreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_head\n this.num_layers = this.config.n_layer\n this.dim_kv = this.config.n_embd / this.num_heads;\n }\n}\n\nclass GPTBigCodeModel extends GPTBigCodePreTrainedModel { }\n\nclass GPTBigCodeForCausalLM extends GPTBigCodePreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// CodeGen models\nclass CodeGenPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `CodeGenPreTrainedModel` class.\n * @param {Object} config The model configuration object.\n * @param {Object} session The ONNX session object.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_head\n this.num_layers = this.config.n_layer\n this.dim_kv = this.config.n_embd / this.num_heads;\n }\n}\n/**\n * CodeGenModel is a class representing a code generation model without a language model head.\n */\nclass CodeGenModel extends CodeGenPreTrainedModel { }\n\n/**\n * CodeGenForCausalLM is a class that represents a code generation model based on the GPT-2 architecture. It extends the `CodeGenPreTrainedModel` class.\n */\nclass CodeGenForCausalLM extends CodeGenPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// LLama models\n\n/**\n * The bare LLama Model outputting raw hidden-states without any specific head on top.\n */\nclass LlamaPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `LlamaPreTrainedModel` class.\n * @param {Object} config The model configuration object.\n * @param {Object} session The ONNX session object.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_key_value_heads ?? this.config.num_attention_heads\n this.num_layers = this.config.num_hidden_layers\n this.dim_kv = this.config.hidden_size / this.config.num_attention_heads\n }\n}\n/**\n * The bare LLaMA Model outputting raw hidden-states without any specific head on top.\n */\nclass LlamaModel extends LlamaPreTrainedModel { }\n\nclass LlamaForCausalLM extends LlamaPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Qwen2 models\n\n/**\n * The bare Qwen2 Model outputting raw hidden-states without any specific head on top.\n */\nclass Qwen2PreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `Qwen2PreTrainedModel` class.\n * @param {Object} config The model configuration object.\n * @param {Object} session The ONNX session object.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_key_value_heads ?? this.config.num_attention_heads\n this.num_layers = this.config.num_hidden_layers\n this.dim_kv = this.config.hidden_size / this.config.num_attention_heads\n }\n}\n/**\n * The bare Qwen2 Model outputting raw hidden-states without any specific head on top.\n */\nclass Qwen2Model extends Qwen2PreTrainedModel { }\n\nclass Qwen2ForCausalLM extends Qwen2PreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Phi models\n\nclass PhiPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `PhiPreTrainedModel` class.\n * @param {Object} config The model configuration object.\n * @param {Object} session The ONNX session object.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id;\n\n this.num_heads = this.config.num_attention_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.num_heads;\n }\n}\n/**\n * The bare Phi Model outputting raw hidden-states without any specific head on top.\n */\nclass PhiModel extends PhiPreTrainedModel { }\n\nclass PhiForCausalLM extends PhiPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Bloom models\n/**\n * The Bloom Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).\n */\nclass BloomPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `BloomPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_head\n this.num_layers = this.config.n_layer\n this.dim_kv = this.config.hidden_size / this.num_heads;\n }\n}\n\n/**\n * The bare Bloom Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass BloomModel extends BloomPreTrainedModel { }\n\n/**\n * The Bloom Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).\n */\nclass BloomForCausalLM extends BloomPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// MPT models\nclass MptPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `MptPreTrainedModel` class.\n * @param {Object} config The model configuration object.\n * @param {Object} session The ONNX session object.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.n_heads\n this.num_layers = this.config.n_layers\n this.dim_kv = this.config.d_model / this.num_heads;\n }\n}\n\n/**\n * The bare Mpt Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass MptModel extends MptPreTrainedModel { }\n\n/**\n * The MPT Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).\n */\nclass MptForCausalLM extends MptPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// OPT models\nclass OPTPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `OPTPreTrainedModel` class.\n * @param {Object} config The model configuration object.\n * @param {Object} session The ONNX session object.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_attention_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.num_heads;\n }\n}\n\n/**\n * The bare OPT Model outputting raw hidden-states without any specific head on top.\n */\nclass OPTModel extends OPTPreTrainedModel { }\n\n/**\n * The OPT Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).\n */\nclass OPTForCausalLM extends OPTPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass ViTPreTrainedModel extends PreTrainedModel { }\nclass ViTModel extends ViTPreTrainedModel { }\nclass ViTForImageClassification extends ViTPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass VitMattePreTrainedModel extends PreTrainedModel { }\n\n/**\n * ViTMatte framework leveraging any vision backbone e.g. for ADE20k, CityScapes.\n * \n * **Example:** Perform image matting with a `VitMatteForImageMatting` model.\n * ```javascript\n * import { AutoProcessor, VitMatteForImageMatting, RawImage } from '@xenova/transformers';\n * \n * // Load processor and model\n * const processor = await AutoProcessor.from_pretrained('Xenova/vitmatte-small-distinctions-646');\n * const model = await VitMatteForImageMatting.from_pretrained('Xenova/vitmatte-small-distinctions-646');\n * \n * // Load image and trimap\n * const image = await RawImage.fromURL('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/vitmatte_image.png');\n * const trimap = await RawImage.fromURL('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/vitmatte_trimap.png');\n * \n * // Prepare image + trimap for the model\n * const inputs = await processor(image, trimap);\n * \n * // Predict alpha matte\n * const { alphas } = await model(inputs);\n * // Tensor {\n * // dims: [ 1, 1, 640, 960 ],\n * // type: 'float32',\n * // size: 614400,\n * // data: Float32Array(614400) [ 0.9894027709960938, 0.9970508813858032, ... ]\n * // }\n * ```\n * \n * You can visualize the alpha matte as follows:\n * ```javascript\n * import { Tensor, cat } from '@xenova/transformers';\n * \n * // Visualize predicted alpha matte\n * const imageTensor = image.toTensor();\n * \n * // Convert float (0-1) alpha matte to uint8 (0-255)\n * const alphaChannel = alphas\n * .squeeze(0)\n * .mul_(255)\n * .clamp_(0, 255)\n * .round_()\n * .to('uint8');\n * \n * // Concatenate original image with predicted alpha\n * const imageData = cat([imageTensor, alphaChannel], 0);\n * \n * // Save output image\n * const outputImage = RawImage.fromTensor(imageData);\n * outputImage.save('output.png');\n * ```\n */\nclass VitMatteForImageMatting extends VitMattePreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new ImageMattingOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass MobileViTPreTrainedModel extends PreTrainedModel { }\nclass MobileViTModel extends MobileViTPreTrainedModel { }\nclass MobileViTForImageClassification extends MobileViTPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n// TODO: MobileViTForSemanticSegmentation\n\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass OwlViTPreTrainedModel extends PreTrainedModel { }\nclass OwlViTModel extends OwlViTPreTrainedModel { }\nclass OwlViTForObjectDetection extends OwlViTPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass Owlv2PreTrainedModel extends PreTrainedModel { }\nclass Owlv2Model extends Owlv2PreTrainedModel { }\nclass Owlv2ForObjectDetection extends Owlv2PreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Beit Models\nclass BeitPreTrainedModel extends PreTrainedModel { }\nclass BeitModel extends BeitPreTrainedModel { }\nclass BeitForImageClassification extends BeitPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nclass DetrPreTrainedModel extends PreTrainedModel { }\nclass DetrModel extends DetrPreTrainedModel { }\nclass DetrForObjectDetection extends DetrPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new DetrObjectDetectionOutput(await super._call(model_inputs));\n }\n}\n\nclass DetrForSegmentation extends DetrPreTrainedModel {\n /**\n * Runs the model with the provided inputs\n * @param {Object} model_inputs Model inputs\n * @returns {Promise} Object containing segmentation outputs\n */\n async _call(model_inputs) {\n return new DetrSegmentationOutput(await super._call(model_inputs));\n }\n}\n\nclass DetrObjectDetectionOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Classification logits (including no-object) for all queries.\n * @param {Tensor} output.pred_boxes Normalized boxes coordinates for all queries, represented as (center_x, center_y, width, height).\n * These values are normalized in [0, 1], relative to the size of each individual image in the batch (disregarding possible padding).\n */\n constructor({ logits, pred_boxes }) {\n super();\n this.logits = logits;\n this.pred_boxes = pred_boxes;\n }\n}\n\nclass DetrSegmentationOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits The output logits of the model.\n * @param {Tensor} output.pred_boxes Predicted boxes.\n * @param {Tensor} output.pred_masks Predicted masks.\n */\n constructor({ logits, pred_boxes, pred_masks }) {\n super();\n this.logits = logits;\n this.pred_boxes = pred_boxes;\n this.pred_masks = pred_masks;\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass TableTransformerPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Table Transformer Model (consisting of a backbone and encoder-decoder Transformer)\n * outputting raw hidden-states without any specific head on top.\n */\nclass TableTransformerModel extends TableTransformerPreTrainedModel { }\n\n/**\n * Table Transformer Model (consisting of a backbone and encoder-decoder Transformer)\n * with object detection heads on top, for tasks such as COCO detection.\n */\nclass TableTransformerForObjectDetection extends TableTransformerPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new TableTransformerObjectDetectionOutput(await super._call(model_inputs));\n }\n}\nclass TableTransformerObjectDetectionOutput extends DetrObjectDetectionOutput { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nclass DeiTPreTrainedModel extends PreTrainedModel { }\nclass DeiTModel extends DeiTPreTrainedModel { }\nclass DeiTForImageClassification extends DeiTPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n/**\n * An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.\n */\nclass ResNetPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare ResNet model outputting raw features without any specific head on top.\n */\nclass ResNetModel extends ResNetPreTrainedModel { }\n\n/**\n * ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for ImageNet.\n */\nclass ResNetForImageClassification extends ResNetPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nclass SwinPreTrainedModel extends PreTrainedModel { }\nclass SwinModel extends SwinPreTrainedModel { }\nclass SwinForImageClassification extends SwinPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass Swin2SRPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Swin2SR Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass Swin2SRModel extends Swin2SRPreTrainedModel { }\n\n/**\n * Swin2SR Model transformer with an upsampler head on top for image super resolution and restoration.\n * \n * **Example:** Super-resolution w/ `Xenova/swin2SR-classical-sr-x2-64`.\n * \n * ```javascript\n * import { AutoProcessor, Swin2SRForImageSuperResolution, RawImage } from '@xenova/transformers';\n * \n * // Load processor and model\n * const model_id = 'Xenova/swin2SR-classical-sr-x2-64';\n * const processor = await AutoProcessor.from_pretrained(model_id);\n * const model = await Swin2SRForImageSuperResolution.from_pretrained(model_id);\n * \n * // Prepare model inputs\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/butterfly.jpg';\n * const image = await RawImage.fromURL(url);\n * const inputs = await processor(image);\n * \n * // Run model\n * const outputs = await model(inputs);\n * \n * // Convert Tensor to RawImage\n * const output = outputs.reconstruction.squeeze().clamp_(0, 1).mul_(255).round_().to('uint8');\n * const outputImage = RawImage.fromTensor(output);\n * // RawImage {\n * // data: Uint8Array(786432) [ 41, 31, 24, ... ],\n * // width: 512,\n * // height: 512,\n * // channels: 3\n * // }\n * ```\n */\nclass Swin2SRForImageSuperResolution extends Swin2SRPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass DPTPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare DPT Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass DPTModel extends DPTPreTrainedModel { }\n\n/**\n * DPT Model with a depth estimation head on top (consisting of 3 convolutional layers) e.g. for KITTI, NYUv2.\n * \n * **Example:** Depth estimation w/ `Xenova/dpt-hybrid-midas`.\n * ```javascript\n * import { DPTForDepthEstimation, AutoProcessor, RawImage, interpolate, max } from '@xenova/transformers';\n * \n * // Load model and processor\n * const model_id = 'Xenova/dpt-hybrid-midas';\n * const model = await DPTForDepthEstimation.from_pretrained(model_id);\n * const processor = await AutoProcessor.from_pretrained(model_id);\n * \n * // Load image from URL\n * const url = 'http://images.cocodataset.org/val2017/000000039769.jpg';\n * const image = await RawImage.fromURL(url);\n * \n * // Prepare image for the model\n * const inputs = await processor(image);\n * \n * // Run model\n * const { predicted_depth } = await model(inputs);\n * \n * // Interpolate to original size\n * const prediction = interpolate(predicted_depth, image.size.reverse(), 'bilinear', false);\n * \n * // Visualize the prediction\n * const formatted = prediction.mul_(255 / max(prediction.data)[0]).to('uint8');\n * const depth = RawImage.fromTensor(formatted);\n * // RawImage {\n * // data: Uint8Array(307200) [ 85, 85, 84, ... ],\n * // width: 640,\n * // height: 480,\n * // channels: 1\n * // }\n * ```\n */\nclass DPTForDepthEstimation extends DPTPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass DepthAnythingPreTrainedModel extends PreTrainedModel { }\n\n/**\n * Depth Anything Model with a depth estimation head on top (consisting of 3 convolutional layers) e.g. for KITTI, NYUv2.\n */\nclass DepthAnythingForDepthEstimation extends DepthAnythingPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nclass GLPNPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare GLPN encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.\n */\nclass GLPNModel extends GLPNPreTrainedModel { }\n\n/**\n * GLPN Model transformer with a lightweight depth estimation head on top e.g. for KITTI, NYUv2.\n * \n * **Example:** Depth estimation w/ `Xenova/glpn-kitti`.\n * ```javascript\n * import { GLPNForDepthEstimation, AutoProcessor, RawImage, interpolate, max } from '@xenova/transformers';\n * \n * // Load model and processor\n * const model_id = 'Xenova/glpn-kitti';\n * const model = await GLPNForDepthEstimation.from_pretrained(model_id);\n * const processor = await AutoProcessor.from_pretrained(model_id);\n * \n * // Load image from URL\n * const url = 'http://images.cocodataset.org/val2017/000000039769.jpg';\n * const image = await RawImage.fromURL(url);\n * \n * // Prepare image for the model\n * const inputs = await processor(image);\n * \n * // Run model\n * const { predicted_depth } = await model(inputs);\n * \n * // Interpolate to original size\n * const prediction = interpolate(predicted_depth, image.size.reverse(), 'bilinear', false);\n * \n * // Visualize the prediction\n * const formatted = prediction.mul_(255 / max(prediction.data)[0]).to('uint8');\n * const depth = RawImage.fromTensor(formatted);\n * // RawImage {\n * // data: Uint8Array(307200) [ 207, 169, 154, ... ],\n * // width: 640,\n * // height: 480,\n * // channels: 1\n * // }\n * ```\n */\nclass GLPNForDepthEstimation extends GLPNPreTrainedModel { }\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass DonutSwinPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Donut Swin Model transformer outputting raw hidden-states without any specific head on top.\n * \n * **Example:** Step-by-step Document Parsing.\n * \n * ```javascript\n * import { AutoProcessor, AutoTokenizer, AutoModelForVision2Seq, RawImage } from '@xenova/transformers';\n * \n * // Choose model to use\n * const model_id = 'Xenova/donut-base-finetuned-cord-v2';\n * \n * // Prepare image inputs\n * const processor = await AutoProcessor.from_pretrained(model_id);\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/receipt.png';\n * const image = await RawImage.read(url);\n * const image_inputs = await processor(image);\n * \n * // Prepare decoder inputs\n * const tokenizer = await AutoTokenizer.from_pretrained(model_id);\n * const task_prompt = '';\n * const decoder_input_ids = tokenizer(task_prompt, {\n * add_special_tokens: false,\n * }).input_ids;\n * \n * // Create the model\n * const model = await AutoModelForVision2Seq.from_pretrained(model_id);\n * \n * // Run inference\n * const output = await model.generate(image_inputs.pixel_values, {\n * decoder_input_ids,\n * max_length: model.config.decoder.max_position_embeddings,\n * });\n * \n * // Decode output\n * const decoded = tokenizer.batch_decode(output)[0];\n * // CINNAMON SUGAR 17,000 1 x 17,000 17,000 17,000 20,000 3,000\n * ```\n * \n * **Example:** Step-by-step Document Visual Question Answering (DocVQA)\n * \n * ```javascript\n * import { AutoProcessor, AutoTokenizer, AutoModelForVision2Seq, RawImage } from '@xenova/transformers';\n * \n * // Choose model to use\n * const model_id = 'Xenova/donut-base-finetuned-docvqa';\n * \n * // Prepare image inputs\n * const processor = await AutoProcessor.from_pretrained(model_id);\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/invoice.png';\n * const image = await RawImage.read(url);\n * const image_inputs = await processor(image);\n * \n * // Prepare decoder inputs\n * const tokenizer = await AutoTokenizer.from_pretrained(model_id);\n * const question = 'What is the invoice number?';\n * const task_prompt = `${question}`;\n * const decoder_input_ids = tokenizer(task_prompt, {\n * add_special_tokens: false,\n * }).input_ids;\n * \n * // Create the model\n * const model = await AutoModelForVision2Seq.from_pretrained(model_id);\n * \n * // Run inference\n * const output = await model.generate(image_inputs.pixel_values, {\n * decoder_input_ids,\n * max_length: model.config.decoder.max_position_embeddings,\n * });\n * \n * // Decode output\n * const decoded = tokenizer.batch_decode(output)[0];\n * // What is the invoice number? us-001\n * ```\n */\nclass DonutSwinModel extends DonutSwinPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nclass ConvNextPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare ConvNext model outputting raw features without any specific head on top.\n */\nclass ConvNextModel extends ConvNextPreTrainedModel { }\n\n/**\n * ConvNext Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for ImageNet.\n */\nclass ConvNextForImageClassification extends ConvNextPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nclass ConvNextV2PreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare ConvNextV2 model outputting raw features without any specific head on top.\n */\nclass ConvNextV2Model extends ConvNextV2PreTrainedModel { }\n\n/**\n * ConvNextV2 Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for ImageNet.\n */\nclass ConvNextV2ForImageClassification extends ConvNextV2PreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass Dinov2PreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare DINOv2 Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass Dinov2Model extends Dinov2PreTrainedModel { }\n\n/**\n * Dinov2 Model transformer with an image classification head on top (a linear layer on top of the final hidden state of the [CLS] token) e.g. for ImageNet.\n */\nclass Dinov2ForImageClassification extends Dinov2PreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nclass YolosPreTrainedModel extends PreTrainedModel { }\nclass YolosModel extends YolosPreTrainedModel { }\nclass YolosForObjectDetection extends YolosPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new YolosObjectDetectionOutput(await super._call(model_inputs));\n }\n}\n\nclass YolosObjectDetectionOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Classification logits (including no-object) for all queries.\n * @param {Tensor} output.pred_boxes Normalized boxes coordinates for all queries, represented as (center_x, center_y, width, height).\n * These values are normalized in [0, 1], relative to the size of each individual image in the batch (disregarding possible padding).\n */\n constructor({ logits, pred_boxes }) {\n super();\n this.logits = logits;\n this.pred_boxes = pred_boxes;\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nclass SamPreTrainedModel extends PreTrainedModel { }\n\n/**\n * Segment Anything Model (SAM) for generating segmentation masks, given an input image\n * and optional 2D location and bounding boxes.\n * \n * **Example:** Perform mask generation w/ `Xenova/sam-vit-base`.\n * ```javascript\n * import { SamModel, AutoProcessor, RawImage } from '@xenova/transformers';\n * \n * const model = await SamModel.from_pretrained('Xenova/sam-vit-base');\n * const processor = await AutoProcessor.from_pretrained('Xenova/sam-vit-base');\n * \n * const img_url = 'https://huggingface.co/ybelkada/segment-anything/resolve/main/assets/car.png';\n * const raw_image = await RawImage.read(img_url);\n * const input_points = [[[450, 600]]] // 2D localization of a window\n * \n * const inputs = await processor(raw_image, input_points);\n * const outputs = await model(inputs);\n * \n * const masks = await processor.post_process_masks(outputs.pred_masks, inputs.original_sizes, inputs.reshaped_input_sizes);\n * // [\n * // Tensor {\n * // dims: [ 1, 3, 1764, 2646 ],\n * // type: 'bool',\n * // data: Uint8Array(14002632) [ ... ],\n * // size: 14002632\n * // }\n * // ]\n * const scores = outputs.iou_scores;\n * // Tensor {\n * // dims: [ 1, 1, 3 ],\n * // type: 'float32',\n * // data: Float32Array(3) [\n * // 0.8892380595207214,\n * // 0.9311248064041138,\n * // 0.983696699142456\n * // ],\n * // size: 3\n * // }\n * ```\n */\nclass SamModel extends SamPreTrainedModel {\n /**\n * Creates a new instance of the `SamModel` class.\n * @param {Object} config The configuration object specifying the hyperparameters and other model settings.\n * @param {Object} vision_encoder The ONNX session containing the vision encoder model.\n * @param {any} prompt_encoder_mask_decoder The ONNX session containing the prompt encoder and mask decoder model.\n */\n constructor(config, vision_encoder, prompt_encoder_mask_decoder) {\n super(config, vision_encoder);\n this.prompt_encoder_mask_decoder = prompt_encoder_mask_decoder;\n }\n\n /**\n * Compute image embeddings and positional image embeddings, given the pixel values of an image.\n * @param {Object} model_inputs Object containing the model inputs.\n * @param {Tensor} model_inputs.pixel_values Pixel values obtained using a `SamProcessor`.\n * @returns {Promise<{ image_embeddings: Tensor, image_positional_embeddings: Tensor }>} The image embeddings and positional image embeddings.\n */\n async get_image_embeddings({ pixel_values }) {\n // in:\n // - pixel_values: tensor.float32[batch_size,3,1024,1024]\n // \n // out:\n // - image_embeddings: tensor.float32[batch_size,256,64,64]\n // - image_positional_embeddings: tensor.float32[batch_size,256,64,64]\n return await encoderForward(this, { pixel_values })\n }\n\n /**\n * @typedef {Object} SamModelInputs Object containing the model inputs.\n * @property {Tensor} pixel_values Pixel values as a Tensor with shape `(batch_size, num_channels, height, width)`.\n * These can be obtained using a `SamProcessor`.\n * @property {Tensor} input_points Input 2D spatial points with shape `(batch_size, num_points, 2)`.\n * This is used by the prompt encoder to encode the prompt.\n * @property {Tensor} [input_labels] Input labels for the points, as a Tensor of shape `(batch_size, point_batch_size, num_points)`.\n * This is used by the prompt encoder to encode the prompt. There are 4 types of labels:\n * - `1`: the point is a point that contains the object of interest\n * - `0`: the point is a point that does not contain the object of interest\n * - `-1`: the point corresponds to the background\n * - `-10`: the point is a padding point, thus should be ignored by the prompt encoder\n * @property {Tensor} [image_embeddings] Image embeddings used by the mask decoder.\n * @property {Tensor} [image_positional_embeddings] Image positional embeddings used by the mask decoder.\n */\n\n /**\n * @param {SamModelInputs} model_inputs Object containing the model inputs.\n * @returns {Promise} The output of the model.\n */\n async forward(model_inputs) {\n if (!model_inputs.image_embeddings || !model_inputs.image_positional_embeddings) {\n // Compute the image embeddings if they are missing\n model_inputs = {\n ...model_inputs,\n ...(await this.get_image_embeddings(model_inputs))\n }\n }\n\n if (!model_inputs.input_labels) {\n // Set default input labels if they are missing\n const shape = model_inputs.input_points.dims.slice(0, -1);\n const numElements = shape.reduce((a, b) => a * b, 1);\n model_inputs.input_labels = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor(\n 'int64',\n new BigInt64Array(numElements).fill(1n),\n shape\n );\n }\n\n // Returns:\n // - iou_scores: tensor.float32[batch_size,point_batch_size,3]\n // - pred_masks: tensor.float32[batch_size,point_batch_size,3,256,256]\n return await sessionRun(this.prompt_encoder_mask_decoder, {\n input_points: model_inputs.input_points,\n input_labels: model_inputs.input_labels,\n image_embeddings: model_inputs.image_embeddings,\n image_positional_embeddings: model_inputs.image_positional_embeddings,\n });\n }\n\n /**\n * Runs the model with the provided inputs\n * @param {Object} model_inputs Model inputs\n * @returns {Promise} Object containing segmentation outputs\n */\n async _call(model_inputs) {\n return new SamImageSegmentationOutput(await super._call(model_inputs));\n }\n}\n\n\n/**\n * Base class for Segment-Anything model's output.\n */\nclass SamImageSegmentationOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.iou_scores The output logits of the model.\n * @param {Tensor} output.pred_masks Predicted boxes.\n */\n constructor({ iou_scores, pred_masks }) {\n super();\n this.iou_scores = iou_scores;\n this.pred_masks = pred_masks;\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// MarianMT models\nclass MarianPreTrainedModel extends PreTrainedModel { };\n\nclass MarianModel extends MarianPreTrainedModel { }\n\nclass MarianMTModel extends MarianPreTrainedModel {\n\n /**\n * Creates a new instance of the `MarianMTModel` class.\n * @param {Object} config The model configuration object.\n * @param {Object} session The ONNX session object.\n * @param {any} decoder_merged_session \n * @param {any} generation_config \n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// M2M100 models\nclass M2M100PreTrainedModel extends PreTrainedModel { };\n\nclass M2M100Model extends M2M100PreTrainedModel { }\n\nclass M2M100ForConditionalGeneration extends M2M100PreTrainedModel {\n\n /**\n * Creates a new instance of the `M2M100ForConditionalGeneration` class.\n * @param {Object} config The model configuration object.\n * @param {Object} session The ONNX session object.\n * @param {any} decoder_merged_session \n * @param {any} generation_config \n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.d_model / this.num_encoder_heads;\n }\n\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Wav2Vec2 models\nclass Wav2Vec2PreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare Wav2Vec2 Model transformer outputting raw hidden-states without any specific head on top.\n * \n * **Example:** Load and run a `Wav2Vec2Model` for feature extraction.\n * \n * ```javascript\n * import { AutoProcessor, AutoModel, read_audio } from '@xenova/transformers';\n * \n * // Read and preprocess audio\n * const processor = await AutoProcessor.from_pretrained('Xenova/mms-300m');\n * const audio = await read_audio('https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac', 16000);\n * const inputs = await processor(audio);\n * \n * // Run model with inputs\n * const model = await AutoModel.from_pretrained('Xenova/mms-300m');\n * const output = await model(inputs);\n * // {\n * // last_hidden_state: Tensor {\n * // dims: [ 1, 1144, 1024 ],\n * // type: 'float32',\n * // data: Float32Array(1171456) [ ... ],\n * // size: 1171456\n * // }\n * // }\n * ```\n */\nclass Wav2Vec2Model extends Wav2Vec2PreTrainedModel { }\n\nclass Wav2Vec2ForCTC extends Wav2Vec2PreTrainedModel {\n /**\n * @param {Object} model_inputs\n * @param {Tensor} model_inputs.input_values Float values of input raw speech waveform.\n * @param {Tensor} model_inputs.attention_mask Mask to avoid performing convolution and attention on padding token indices. Mask values selected in [0, 1]\n */\n async _call(model_inputs) {\n return new CausalLMOutput(await super._call(model_inputs));\n }\n}\n\nclass Wav2Vec2ForSequenceClassification extends Wav2Vec2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * Wav2Vec2 Model with a frame classification head on top for tasks like Speaker Diarization.\n */\nclass Wav2Vec2ForAudioFrameClassification extends Wav2Vec2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// UniSpeech models\nclass UniSpeechPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare UniSpeech Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass UniSpeechModel extends UniSpeechPreTrainedModel { }\n\n/**\n * UniSpeech Model with a `language modeling` head on top for Connectionist Temporal Classification (CTC).\n */\nclass UniSpeechForCTC extends UniSpeechPreTrainedModel {\n /**\n * @param {Object} model_inputs\n * @param {Tensor} model_inputs.input_values Float values of input raw speech waveform.\n * @param {Tensor} model_inputs.attention_mask Mask to avoid performing convolution and attention on padding token indices. Mask values selected in [0, 1]\n */\n async _call(model_inputs) {\n return new CausalLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * UniSpeech Model with a sequence classification head on top (a linear layer over the pooled output).\n */\nclass UniSpeechForSequenceClassification extends UniSpeechPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// UniSpeechSat models\nclass UniSpeechSatPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare UniSpeechSat Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass UniSpeechSatModel extends UniSpeechSatPreTrainedModel { }\n\n/**\n * UniSpeechSat Model with a `language modeling` head on top for Connectionist Temporal Classification (CTC).\n */\nclass UniSpeechSatForCTC extends UniSpeechSatPreTrainedModel {\n /**\n * @param {Object} model_inputs\n * @param {Tensor} model_inputs.input_values Float values of input raw speech waveform.\n * @param {Tensor} model_inputs.attention_mask Mask to avoid performing convolution and attention on padding token indices. Mask values selected in [0, 1]\n */\n async _call(model_inputs) {\n return new CausalLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * UniSpeechSat Model with a sequence classification head on top (a linear layer over the pooled output).\n */\nclass UniSpeechSatForSequenceClassification extends UniSpeechSatPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * UniSpeechSat Model with a frame classification head on top for tasks like Speaker Diarization.\n */\nclass UniSpeechSatForAudioFrameClassification extends UniSpeechSatPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Wav2Vec2Bert models\nclass Wav2Vec2BertPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare Wav2Vec2Bert Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass Wav2Vec2BertModel extends Wav2Vec2BertPreTrainedModel { }\n\n/**\n * Wav2Vec2Bert Model with a `language modeling` head on top for Connectionist Temporal Classification (CTC).\n */\nclass Wav2Vec2BertForCTC extends Wav2Vec2BertPreTrainedModel {\n /**\n * @param {Object} model_inputs\n * @param {Tensor} model_inputs.input_features Float values of input mel-spectrogram.\n * @param {Tensor} model_inputs.attention_mask Mask to avoid performing convolution and attention on padding token indices. Mask values selected in [0, 1]\n */\n async _call(model_inputs) {\n return new CausalLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * Wav2Vec2Bert Model with a sequence classification head on top (a linear layer over the pooled output).\n */\nclass Wav2Vec2BertForSequenceClassification extends Wav2Vec2BertPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Hubert models\nclass HubertPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare Hubert Model transformer outputting raw hidden-states without any specific head on top.\n * \n * **Example:** Load and run a `HubertModel` for feature extraction.\n * \n * ```javascript\n * import { AutoProcessor, AutoModel, read_audio } from '@xenova/transformers';\n * \n * // Read and preprocess audio\n * const processor = await AutoProcessor.from_pretrained('Xenova/hubert-base-ls960');\n * const audio = await read_audio('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav', 16000);\n * const inputs = await processor(audio);\n * \n * // Load and run model with inputs\n * const model = await AutoModel.from_pretrained('Xenova/hubert-base-ls960');\n * const output = await model(inputs);\n * // {\n * // last_hidden_state: Tensor {\n * // dims: [ 1, 549, 768 ],\n * // type: 'float32',\n * // data: Float32Array(421632) [0.0682469978928566, 0.08104046434164047, -0.4975186586380005, ...],\n * // size: 421632\n * // }\n * // }\n * ```\n */\nclass HubertModel extends Wav2Vec2PreTrainedModel { }\n\n/**\n * Hubert Model with a `language modeling` head on top for Connectionist Temporal Classification (CTC).\n */\nclass HubertForCTC extends Wav2Vec2PreTrainedModel {\n /**\n * @param {Object} model_inputs\n * @param {Tensor} model_inputs.input_values Float values of input raw speech waveform.\n * @param {Tensor} model_inputs.attention_mask Mask to avoid performing convolution and attention on padding token indices. Mask values selected in [0, 1]\n */\n async _call(model_inputs) {\n return new CausalLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * Hubert Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like SUPERB Keyword Spotting.\n */\nclass HubertForSequenceClassification extends Wav2Vec2PreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// WavLM models\n/**\n * An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.\n */\nclass WavLMPreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare WavLM Model transformer outputting raw hidden-states without any specific head on top.\n * \n * **Example:** Load and run a `WavLMModel` for feature extraction.\n * \n * ```javascript\n * import { AutoProcessor, AutoModel, read_audio } from '@xenova/transformers';\n * \n * // Read and preprocess audio\n * const processor = await AutoProcessor.from_pretrained('Xenova/wavlm-base');\n * const audio = await read_audio('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav', 16000);\n * const inputs = await processor(audio);\n * \n * // Run model with inputs\n * const model = await AutoModel.from_pretrained('Xenova/wavlm-base');\n * const output = await model(inputs);\n * // {\n * // last_hidden_state: Tensor {\n * // dims: [ 1, 549, 768 ],\n * // type: 'float32',\n * // data: Float32Array(421632) [-0.349443256855011, -0.39341306686401367, 0.022836603224277496, ...],\n * // size: 421632\n * // }\n * // }\n * ```\n */\nclass WavLMModel extends WavLMPreTrainedModel { }\n\n/**\n * WavLM Model with a `language modeling` head on top for Connectionist Temporal Classification (CTC).\n */\nclass WavLMForCTC extends WavLMPreTrainedModel {\n /**\n * @param {Object} model_inputs\n * @param {Tensor} model_inputs.input_values Float values of input raw speech waveform.\n * @param {Tensor} model_inputs.attention_mask Mask to avoid performing convolution and attention on padding token indices. Mask values selected in [0, 1]\n */\n async _call(model_inputs) {\n return new CausalLMOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * WavLM Model with a sequence classification head on top (a linear layer over the pooled output).\n */\nclass WavLMForSequenceClassification extends WavLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * WavLM Model with an XVector feature extraction head on top for tasks like Speaker Verification.\n * \n * **Example:** Extract speaker embeddings with `WavLMForXVector`.\n * ```javascript\n * import { AutoProcessor, AutoModel, read_audio } from '@xenova/transformers';\n * \n * // Read and preprocess audio\n * const processor = await AutoProcessor.from_pretrained('Xenova/wavlm-base-plus-sv');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';\n * const audio = await read_audio(url, 16000);\n * const inputs = await processor(audio);\n * \n * // Run model with inputs\n * const model = await AutoModel.from_pretrained('Xenova/wavlm-base-plus-sv');\n * const outputs = await model(inputs);\n * // {\n * // logits: Tensor {\n * // dims: [ 1, 512 ],\n * // type: 'float32',\n * // data: Float32Array(512) [0.5847219228744507, ...],\n * // size: 512\n * // },\n * // embeddings: Tensor {\n * // dims: [ 1, 512 ],\n * // type: 'float32',\n * // data: Float32Array(512) [-0.09079201519489288, ...],\n * // size: 512\n * // }\n * // }\n * ```\n */\nclass WavLMForXVector extends WavLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits and speaker embeddings.\n */\n async _call(model_inputs) {\n return new XVectorOutput(await super._call(model_inputs));\n }\n}\n\n/**\n * WavLM Model with a frame classification head on top for tasks like Speaker Diarization.\n * \n * **Example:** Perform speaker diarization with `WavLMForAudioFrameClassification`.\n * ```javascript\n * import { AutoProcessor, AutoModelForAudioFrameClassification, read_audio } from '@xenova/transformers';\n * \n * // Read and preprocess audio\n * const processor = await AutoProcessor.from_pretrained('Xenova/wavlm-base-plus-sd');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';\n * const audio = await read_audio(url, 16000);\n * const inputs = await processor(audio);\n * \n * // Run model with inputs\n * const model = await AutoModelForAudioFrameClassification.from_pretrained('Xenova/wavlm-base-plus-sd');\n * const { logits } = await model(inputs);\n * // {\n * // logits: Tensor {\n * // dims: [ 1, 549, 2 ], // [batch_size, num_frames, num_speakers]\n * // type: 'float32',\n * // data: Float32Array(1098) [-3.5301010608673096, ...],\n * // size: 1098\n * // }\n * // }\n * \n * const labels = logits[0].sigmoid().tolist().map(\n * frames => frames.map(speaker => speaker > 0.5 ? 1 : 0)\n * );\n * console.log(labels); // labels is a one-hot array of shape (num_frames, num_speakers)\n * // [\n * // [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],\n * // [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],\n * // [0, 0], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1],\n * // ...\n * // ]\n * ```\n */\nclass WavLMForAudioFrameClassification extends WavLMPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} An object containing the model's output logits for sequence classification.\n */\n async _call(model_inputs) {\n return new TokenClassifierOutput(await super._call(model_inputs));\n }\n}\n\n//////////////////////////////////////////////////\n// SpeechT5 models\n/**\n * An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.\n */\nclass SpeechT5PreTrainedModel extends PreTrainedModel { };\n\n/**\n * The bare SpeechT5 Encoder-Decoder Model outputting raw hidden-states without any specific pre- or post-nets.\n */\nclass SpeechT5Model extends SpeechT5PreTrainedModel { };\n\n/**\n * SpeechT5 Model with a speech encoder and a text decoder.\n * \n * **Example:** Generate speech from text with `SpeechT5ForSpeechToText`.\n * ```javascript\n * import { AutoTokenizer, AutoProcessor, SpeechT5ForTextToSpeech, SpeechT5HifiGan, Tensor } from '@xenova/transformers';\n * \n * // Load the tokenizer and processor\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/speecht5_tts');\n * const processor = await AutoProcessor.from_pretrained('Xenova/speecht5_tts');\n * \n * // Load the models\n * // NOTE: We use the unquantized versions as they are more accurate\n * const model = await SpeechT5ForTextToSpeech.from_pretrained('Xenova/speecht5_tts', { quantized: false });\n * const vocoder = await SpeechT5HifiGan.from_pretrained('Xenova/speecht5_hifigan', { quantized: false });\n * \n * // Load speaker embeddings from URL\n * const speaker_embeddings_data = new Float32Array(\n * await (await fetch('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/speaker_embeddings.bin')).arrayBuffer()\n * );\n * const speaker_embeddings = new Tensor(\n * 'float32',\n * speaker_embeddings_data,\n * [1, speaker_embeddings_data.length]\n * )\n * \n * // Run tokenization\n * const { input_ids } = tokenizer('Hello, my dog is cute');\n * \n * // Generate waveform\n * const { waveform } = await model.generate_speech(input_ids, speaker_embeddings, { vocoder });\n * console.log(waveform)\n * // Tensor {\n * // dims: [ 26112 ],\n * // type: 'float32',\n * // size: 26112,\n * // data: Float32Array(26112) [ -0.00043630177970044315, -0.00018082228780258447, ... ],\n * // }\n * ```\n */\nclass SpeechT5ForSpeechToText extends SpeechT5PreTrainedModel { }\n\n/**\n * SpeechT5 Model with a text encoder and a speech decoder.\n */\nclass SpeechT5ForTextToSpeech extends SpeechT5PreTrainedModel {\n\n /**\n * Creates a new instance of the `SpeechT5ForTextToSpeech` class.\n * @param {Object} config The model configuration.\n * @param {any} session session for the model.\n * @param {any} decoder_merged_session session for the decoder.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, decoder_merged_session, generation_config) {\n super(config, session);\n this.decoder_merged_session = decoder_merged_session;\n this.generation_config = generation_config;\n\n this.num_decoder_layers = this.config.decoder_layers;\n this.num_decoder_heads = this.config.decoder_attention_heads;\n this.decoder_dim_kv = this.config.hidden_size / this.num_decoder_heads;\n\n this.num_encoder_layers = this.config.encoder_layers;\n this.num_encoder_heads = this.config.encoder_attention_heads;\n this.encoder_dim_kv = this.config.hidden_size / this.num_encoder_heads;\n }\n\n /**\n * @typedef {Object} SpeechOutput\n * @property {Tensor} [spectrogram] The predicted log-mel spectrogram of shape\n * `(output_sequence_length, config.num_mel_bins)`. Returned when no `vocoder` is provided\n * @property {Tensor} [waveform] The predicted waveform of shape `(num_frames,)`. Returned when a `vocoder` is provided.\n * @property {Tensor} [cross_attentions] The outputs of the decoder's cross-attention layers of shape\n * `(config.decoder_layers, config.decoder_attention_heads, output_sequence_length, input_sequence_length)`. returned when `output_cross_attentions` is `true`.\n */\n\n /**\n * Converts a sequence of input tokens into a sequence of mel spectrograms, which are subsequently turned into a speech waveform using a vocoder.\n * @param {Tensor} input_values Indices of input sequence tokens in the vocabulary.\n * @param {Tensor} speaker_embeddings Tensor containing the speaker embeddings.\n * @param {Object} options Optional parameters for generating speech.\n * @param {number} [options.threshold=0.5] The generated sequence ends when the predicted stop token probability exceeds this value.\n * @param {number} [options.minlenratio=0.0] Used to calculate the minimum required length for the output sequence.\n * @param {number} [options.maxlenratio=20.0] Used to calculate the maximum allowed length for the output sequence.\n * @param {Object} [options.vocoder=null] The vocoder that converts the mel spectrogram into a speech waveform. If `null`, the output is the mel spectrogram.\n * @param {boolean} [options.output_cross_attentions=false] Whether or not to return the attentions tensors of the decoder's cross-attention layers.\n * @returns {Promise} A promise which resolves to an object containing the spectrogram, waveform, and cross-attention tensors.\n */\n async generate_speech(input_values, speaker_embeddings, {\n threshold = 0.5,\n minlenratio = 0.0,\n maxlenratio = 20.0,\n vocoder = null,\n // output_cross_attentions = false, // TODO add\n } = {}) {\n\n const model_inputs = {\n input_ids: input_values\n }\n\n const { encoder_outputs, encoder_attention_mask } = await encoderForward(this, model_inputs);\n\n const r = encoder_outputs.dims[1] / this.config.reduction_factor;\n const maxlen = Math.floor(r * maxlenratio);\n const minlen = Math.floor(r * minlenratio);\n\n const num_mel_bins = this.config.num_mel_bins;\n\n let spectrogramParts = [];\n let past_key_values = null;\n let decoder_outputs = null;\n let idx = 0;\n\n while (true) {\n ++idx;\n\n const use_cache_branch = boolTensor(!!decoder_outputs);\n let output_sequence;\n if (decoder_outputs) {\n output_sequence = decoder_outputs.output_sequence_out;\n } else {\n output_sequence = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.Tensor(\n 'float32',\n new Float32Array(num_mel_bins),\n [1, 1, num_mel_bins],\n )\n }\n let decoderFeeds = {\n use_cache_branch,\n output_sequence,\n encoder_attention_mask: encoder_attention_mask,\n speaker_embeddings: speaker_embeddings,\n encoder_hidden_states: encoder_outputs,\n };\n\n this.addPastKeyValues(decoderFeeds, past_key_values);\n decoder_outputs = await sessionRun(this.decoder_merged_session, decoderFeeds);\n past_key_values = this.getPastKeyValues(decoder_outputs, past_key_values);\n\n const { prob, spectrum } = decoder_outputs;\n spectrogramParts.push(spectrum);\n\n if (idx >= minlen && (\n // Finished when stop token or maximum length is reached.\n Array.from(prob.data).filter(p => p >= threshold).length > 0 || idx >= maxlen\n )) {\n break;\n }\n }\n\n const spectrogram = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_4__.cat)(spectrogramParts);\n const { waveform } = await sessionRun(vocoder.session, { spectrogram });\n\n return {\n spectrogram,\n waveform,\n // cross_attentions: null, // TODO add\n }\n }\n}\n\n/**\n * HiFi-GAN vocoder.\n * \n * See [SpeechT5ForSpeechToText](./models#module_models.SpeechT5ForSpeechToText) for example usage.\n */\nclass SpeechT5HifiGan extends PreTrainedModel {\n main_input_name = 'spectrogram';\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// TrOCR models\nclass TrOCRPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `TrOCRPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id;\n\n this.num_encoder_layers = this.num_decoder_layers = this.config.decoder_layers;\n this.num_encoder_heads = this.num_decoder_heads = this.config.decoder_attention_heads;\n this.encoder_dim_kv = this.decoder_dim_kv = this.config.d_model / this.num_decoder_heads;\n }\n}\n\n/**\n * The TrOCR Decoder with a language modeling head.\n */\nclass TrOCRForCausalLM extends TrOCRPreTrainedModel { }\n\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Mistral models\n/**\n * The bare Mistral Model outputting raw hidden-states without any specific head on top.\n */\nclass MistralPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `MistralPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_key_value_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.config.num_attention_heads;\n }\n}\n\nclass MistralModel extends MistralPreTrainedModel { }\n\nclass MistralForCausalLM extends MistralPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Starcoder2 models\n/**\n * The bare Starcoder2 Model outputting raw hidden-states without any specific head on top.\n */\nclass Starcoder2PreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `Starcoder2PreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_key_value_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.config.num_attention_heads;\n }\n}\n\nclass Starcoder2Model extends Starcoder2PreTrainedModel { }\n\nclass Starcoder2ForCausalLM extends Starcoder2PreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// Falcon models\n/**\n * The bare Falcon Model outputting raw hidden-states without any specific head on top.\n */\nclass FalconPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `FalconPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_attention_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.config.num_attention_heads;\n }\n}\n\nclass FalconModel extends FalconPreTrainedModel { }\n\nclass FalconForCausalLM extends FalconPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// CLAP models\nclass ClapPreTrainedModel extends PreTrainedModel { }\n\nclass ClapModel extends ClapPreTrainedModel { }\n\n/**\n * CLAP Text Model with a projection layer on top (a linear layer on top of the pooled output).\n * \n * **Example:** Compute text embeddings with `ClapTextModelWithProjection`.\n * \n * ```javascript\n * import { AutoTokenizer, ClapTextModelWithProjection } from '@xenova/transformers';\n * \n * // Load tokenizer and text model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/clap-htsat-unfused');\n * const text_model = await ClapTextModelWithProjection.from_pretrained('Xenova/clap-htsat-unfused');\n * \n * // Run tokenization\n * const texts = ['a sound of a cat', 'a sound of a dog'];\n * const text_inputs = tokenizer(texts, { padding: true, truncation: true });\n * \n * // Compute embeddings\n * const { text_embeds } = await text_model(text_inputs);\n * // Tensor {\n * // dims: [ 2, 512 ],\n * // type: 'float32',\n * // data: Float32Array(1024) [ ... ],\n * // size: 1024\n * // }\n * ```\n */\nclass ClapTextModelWithProjection extends ClapPreTrainedModel {\n\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'text_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n\n/**\n * CLAP Audio Model with a projection layer on top (a linear layer on top of the pooled output).\n * \n * **Example:** Compute audio embeddings with `ClapAudioModelWithProjection`.\n * \n * ```javascript\n * import { AutoProcessor, ClapAudioModelWithProjection, read_audio } from '@xenova/transformers';\n * \n * // Load processor and audio model\n * const processor = await AutoProcessor.from_pretrained('Xenova/clap-htsat-unfused');\n * const audio_model = await ClapAudioModelWithProjection.from_pretrained('Xenova/clap-htsat-unfused');\n * \n * // Read audio and run processor\n * const audio = await read_audio('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cat_meow.wav');\n * const audio_inputs = await processor(audio);\n * \n * // Compute embeddings\n * const { audio_embeds } = await audio_model(audio_inputs);\n * // Tensor {\n * // dims: [ 1, 512 ],\n * // type: 'float32',\n * // data: Float32Array(512) [ ... ],\n * // size: 512\n * // }\n * ```\n */\nclass ClapAudioModelWithProjection extends ClapPreTrainedModel {\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, options = {}) {\n // Update default model file name if not provided\n options.model_file_name ??= 'audio_model';\n return super.from_pretrained(pretrained_model_name_or_path, options);\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// VITS models\nclass VitsPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The complete VITS model, for text-to-speech synthesis.\n * \n * **Example:** Generate speech from text with `VitsModel`.\n * ```javascript\n * import { AutoTokenizer, VitsModel } from '@xenova/transformers';\n * \n * // Load the tokenizer and model\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/mms-tts-eng');\n * const model = await VitsModel.from_pretrained('Xenova/mms-tts-eng');\n * \n * // Run tokenization\n * const inputs = tokenizer('I love transformers');\n * \n * // Generate waveform\n * const { waveform } = await model(inputs);\n * // Tensor {\n * // dims: [ 1, 35328 ],\n * // type: 'float32',\n * // data: Float32Array(35328) [ ... ],\n * // size: 35328,\n * // }\n * ```\n */\nclass VitsModel extends VitsPreTrainedModel {\n /**\n * Calls the model on new inputs.\n * @param {Object} model_inputs The inputs to the model.\n * @returns {Promise} The outputs for the VITS model.\n */\n async _call(model_inputs) {\n return new VitsModelOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// Segformer models\nclass SegformerPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare SegFormer encoder (Mix-Transformer) outputting raw hidden-states without any specific head on top.\n */\nclass SegformerModel extends SegformerPreTrainedModel { }\n\n/**\n * SegFormer Model transformer with an image classification head on top (a linear layer on top of the final hidden states) e.g. for ImageNet.\n */\nclass SegformerForImageClassification extends SegformerPreTrainedModel { }\n\n/**\n * SegFormer Model transformer with an all-MLP decode head on top e.g. for ADE20k, CityScapes.\n */\nclass SegformerForSemanticSegmentation extends SegformerPreTrainedModel { }\n\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\n// StableLm models\nclass StableLmPreTrainedModel extends PreTrainedModel {\n /**\n * Creates a new instance of the `StableLmPreTrainedModel` class.\n * @param {Object} config The configuration of the model.\n * @param {any} session The ONNX session containing the model weights.\n * @param {GenerationConfig} generation_config The generation configuration.\n */\n constructor(config, session, generation_config) {\n super(config, session);\n this.generation_config = generation_config;\n\n // config doesn't contain pad_token_id, so we assume it is the eos_token_id\n this.config.pad_token_id = this.config.eos_token_id\n\n this.num_heads = this.config.num_attention_heads;\n this.num_layers = this.config.num_hidden_layers;\n this.dim_kv = this.config.hidden_size / this.num_heads;\n }\n}\n\n/**\n * The bare StableLm Model transformer outputting raw hidden-states without any specific head on top.\n */\nclass StableLmModel extends StableLmPreTrainedModel { }\n\n/**\n * StableLm Model with a `language modeling` head on top for Causal Language Modeling (with past).\n */\nclass StableLmForCausalLM extends StableLmPreTrainedModel { }\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\nclass EfficientNetPreTrainedModel extends PreTrainedModel { }\n\n/**\n * The bare EfficientNet model outputting raw features without any specific head on top.\n */\nclass EfficientNetModel extends EfficientNetPreTrainedModel { }\n\n/**\n * EfficientNet Model with an image classification head on top (a linear layer on top of the pooled features).\n */\nclass EfficientNetForImageClassification extends EfficientNetPreTrainedModel {\n /**\n * @param {any} model_inputs\n */\n async _call(model_inputs) {\n return new SequenceClassifierOutput(await super._call(model_inputs));\n }\n}\n//////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////\n// AutoModels, used to simplify construction of PreTrainedModels\n// (uses config to instantiate correct class)\n\n/**\n * Base class of all AutoModels. Contains the `from_pretrained` function\n * which is used to instantiate pretrained models.\n */\nclass PretrainedMixin {\n /**\n * Mapping from model type to model class.\n * @type {Map[]}\n */\n static MODEL_CLASS_MAPPINGS = null;\n\n /**\n * Whether to attempt to instantiate the base class (`PretrainedModel`) if \n * the model type is not found in the mapping.\n */\n static BASE_IF_FAIL = false;\n\n\n /** @type {PreTrainedModel.from_pretrained} */\n static async from_pretrained(pretrained_model_name_or_path, {\n quantized = true,\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n model_file_name = null,\n } = {}) {\n\n let options = {\n quantized,\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n model_file_name,\n }\n config = await _configs_js__WEBPACK_IMPORTED_MODULE_0__.AutoConfig.from_pretrained(pretrained_model_name_or_path, options);\n if (!options.config) {\n // If no config was passed, reuse this config for future processing\n options.config = config;\n }\n\n if (!this.MODEL_CLASS_MAPPINGS) {\n throw new Error(\"`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: \" + this.name);\n }\n\n for (let MODEL_CLASS_MAPPING of this.MODEL_CLASS_MAPPINGS) {\n const modelInfo = MODEL_CLASS_MAPPING.get(config.model_type);\n if (!modelInfo) {\n continue; // Item not found in this mapping\n }\n return await modelInfo[1].from_pretrained(pretrained_model_name_or_path, options);\n }\n\n if (this.BASE_IF_FAIL) {\n console.warn(`Unknown model class \"${config.model_type}\", attempting to construct from base class.`);\n return await PreTrainedModel.from_pretrained(pretrained_model_name_or_path, options);\n } else {\n throw Error(`Unsupported model type: ${config.model_type}`)\n }\n }\n}\n\nconst MODEL_MAPPING_NAMES_ENCODER_ONLY = new Map([\n ['bert', ['BertModel', BertModel]],\n ['nomic_bert', ['NomicBertModel', NomicBertModel]],\n ['roformer', ['RoFormerModel', RoFormerModel]],\n ['electra', ['ElectraModel', ElectraModel]],\n ['esm', ['EsmModel', EsmModel]],\n ['convbert', ['ConvBertModel', ConvBertModel]],\n ['camembert', ['CamembertModel', CamembertModel]],\n ['deberta', ['DebertaModel', DebertaModel]],\n ['deberta-v2', ['DebertaV2Model', DebertaV2Model]],\n ['mpnet', ['MPNetModel', MPNetModel]],\n ['albert', ['AlbertModel', AlbertModel]],\n ['distilbert', ['DistilBertModel', DistilBertModel]],\n ['roberta', ['RobertaModel', RobertaModel]],\n ['xlm', ['XLMModel', XLMModel]],\n ['xlm-roberta', ['XLMRobertaModel', XLMRobertaModel]],\n ['clap', ['ClapModel', ClapModel]],\n ['clip', ['CLIPModel', CLIPModel]],\n ['clipseg', ['CLIPSegModel', CLIPSegModel]],\n ['chinese_clip', ['ChineseCLIPModel', ChineseCLIPModel]],\n ['siglip', ['SiglipModel', SiglipModel]],\n ['mobilebert', ['MobileBertModel', MobileBertModel]],\n ['squeezebert', ['SqueezeBertModel', SqueezeBertModel]],\n ['wav2vec2', ['Wav2Vec2Model', Wav2Vec2Model]],\n ['wav2vec2-bert', ['Wav2Vec2BertModel', Wav2Vec2BertModel]],\n ['unispeech', ['UniSpeechModel', UniSpeechModel]],\n ['unispeech-sat', ['UniSpeechSatModel', UniSpeechSatModel]],\n ['hubert', ['HubertModel', HubertModel]],\n ['wavlm', ['WavLMModel', WavLMModel]],\n ['audio-spectrogram-transformer', ['ASTModel', ASTModel]],\n ['vits', ['VitsModel', VitsModel]],\n\n ['detr', ['DetrModel', DetrModel]],\n ['table-transformer', ['TableTransformerModel', TableTransformerModel]],\n ['vit', ['ViTModel', ViTModel]],\n ['mobilevit', ['MobileViTModel', MobileViTModel]],\n ['owlvit', ['OwlViTModel', OwlViTModel]],\n ['owlv2', ['Owlv2Model', Owlv2Model]],\n ['beit', ['BeitModel', BeitModel]],\n ['deit', ['DeiTModel', DeiTModel]],\n ['convnext', ['ConvNextModel', ConvNextModel]],\n ['convnextv2', ['ConvNextV2Model', ConvNextV2Model]],\n ['dinov2', ['Dinov2Model', Dinov2Model]],\n ['resnet', ['ResNetModel', ResNetModel]],\n ['swin', ['SwinModel', SwinModel]],\n ['swin2sr', ['Swin2SRModel', Swin2SRModel]],\n ['donut-swin', ['DonutSwinModel', DonutSwinModel]],\n ['yolos', ['YolosModel', YolosModel]],\n ['dpt', ['DPTModel', DPTModel]],\n ['glpn', ['GLPNModel', GLPNModel]],\n\n ['hifigan', ['SpeechT5HifiGan', SpeechT5HifiGan]],\n ['efficientnet', ['EfficientNetModel', EfficientNetModel]],\n\n]);\n\nconst MODEL_MAPPING_NAMES_ENCODER_DECODER = new Map([\n ['t5', ['T5Model', T5Model]],\n ['longt5', ['LongT5Model', LongT5Model]],\n ['mt5', ['MT5Model', MT5Model]],\n ['bart', ['BartModel', BartModel]],\n ['mbart', ['MBartModel', MBartModel]],\n ['marian', ['MarianModel', MarianModel]],\n ['whisper', ['WhisperModel', WhisperModel]],\n ['m2m_100', ['M2M100Model', M2M100Model]],\n ['blenderbot', ['BlenderbotModel', BlenderbotModel]],\n ['blenderbot-small', ['BlenderbotSmallModel', BlenderbotSmallModel]],\n]);\n\n\nconst MODEL_MAPPING_NAMES_DECODER_ONLY = new Map([\n ['bloom', ['BloomModel', BloomModel]],\n ['gpt2', ['GPT2Model', GPT2Model]],\n ['gptj', ['GPTJModel', GPTJModel]],\n ['gpt_bigcode', ['GPTBigCodeModel', GPTBigCodeModel]],\n ['gpt_neo', ['GPTNeoModel', GPTNeoModel]],\n ['gpt_neox', ['GPTNeoXModel', GPTNeoXModel]],\n ['codegen', ['CodeGenModel', CodeGenModel]],\n ['llama', ['LlamaModel', LlamaModel]],\n ['qwen2', ['Qwen2Model', Qwen2Model]],\n ['phi', ['PhiModel', PhiModel]],\n ['mpt', ['MptModel', MptModel]],\n ['opt', ['OPTModel', OPTModel]],\n ['mistral', ['MistralModel', MistralModel]],\n ['starcoder2', ['Starcoder2Model', Starcoder2Model]],\n ['falcon', ['FalconModel', FalconModel]],\n]);\n\nconst MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES = new Map([\n ['speecht5', ['SpeechT5ForSpeechToText', SpeechT5ForSpeechToText]],\n ['whisper', ['WhisperForConditionalGeneration', WhisperForConditionalGeneration]],\n]);\n\nconst MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES = new Map([\n ['speecht5', ['SpeechT5ForTextToSpeech', SpeechT5ForTextToSpeech]],\n]);\n\nconst MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES = new Map([\n ['vits', ['VitsModel', VitsModel]],\n]);\n\nconst MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES = new Map([\n ['bert', ['BertForSequenceClassification', BertForSequenceClassification]],\n ['roformer', ['RoFormerForSequenceClassification', RoFormerForSequenceClassification]],\n ['electra', ['ElectraForSequenceClassification', ElectraForSequenceClassification]],\n ['esm', ['EsmForSequenceClassification', EsmForSequenceClassification]],\n ['convbert', ['ConvBertForSequenceClassification', ConvBertForSequenceClassification]],\n ['camembert', ['CamembertForSequenceClassification', CamembertForSequenceClassification]],\n ['deberta', ['DebertaForSequenceClassification', DebertaForSequenceClassification]],\n ['deberta-v2', ['DebertaV2ForSequenceClassification', DebertaV2ForSequenceClassification]],\n ['mpnet', ['MPNetForSequenceClassification', MPNetForSequenceClassification]],\n ['albert', ['AlbertForSequenceClassification', AlbertForSequenceClassification]],\n ['distilbert', ['DistilBertForSequenceClassification', DistilBertForSequenceClassification]],\n ['roberta', ['RobertaForSequenceClassification', RobertaForSequenceClassification]],\n ['xlm', ['XLMForSequenceClassification', XLMForSequenceClassification]],\n ['xlm-roberta', ['XLMRobertaForSequenceClassification', XLMRobertaForSequenceClassification]],\n ['bart', ['BartForSequenceClassification', BartForSequenceClassification]],\n ['mbart', ['MBartForSequenceClassification', MBartForSequenceClassification]],\n ['mobilebert', ['MobileBertForSequenceClassification', MobileBertForSequenceClassification]],\n ['squeezebert', ['SqueezeBertForSequenceClassification', SqueezeBertForSequenceClassification]],\n]);\n\nconst MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES = new Map([\n ['bert', ['BertForTokenClassification', BertForTokenClassification]],\n ['roformer', ['RoFormerForTokenClassification', RoFormerForTokenClassification]],\n ['electra', ['ElectraForTokenClassification', ElectraForTokenClassification]],\n ['esm', ['EsmForTokenClassification', EsmForTokenClassification]],\n ['convbert', ['ConvBertForTokenClassification', ConvBertForTokenClassification]],\n ['camembert', ['CamembertForTokenClassification', CamembertForTokenClassification]],\n ['deberta', ['DebertaForTokenClassification', DebertaForTokenClassification]],\n ['deberta-v2', ['DebertaV2ForTokenClassification', DebertaV2ForTokenClassification]],\n ['mpnet', ['MPNetForTokenClassification', MPNetForTokenClassification]],\n ['distilbert', ['DistilBertForTokenClassification', DistilBertForTokenClassification]],\n ['roberta', ['RobertaForTokenClassification', RobertaForTokenClassification]],\n ['xlm', ['XLMForTokenClassification', XLMForTokenClassification]],\n ['xlm-roberta', ['XLMRobertaForTokenClassification', XLMRobertaForTokenClassification]],\n]);\n\nconst MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES = new Map([\n ['t5', ['T5ForConditionalGeneration', T5ForConditionalGeneration]],\n ['longt5', ['LongT5ForConditionalGeneration', LongT5ForConditionalGeneration]],\n ['mt5', ['MT5ForConditionalGeneration', MT5ForConditionalGeneration]],\n ['bart', ['BartForConditionalGeneration', BartForConditionalGeneration]],\n ['mbart', ['MBartForConditionalGeneration', MBartForConditionalGeneration]],\n ['marian', ['MarianMTModel', MarianMTModel]],\n ['m2m_100', ['M2M100ForConditionalGeneration', M2M100ForConditionalGeneration]],\n ['blenderbot', ['BlenderbotForConditionalGeneration', BlenderbotForConditionalGeneration]],\n ['blenderbot-small', ['BlenderbotSmallForConditionalGeneration', BlenderbotSmallForConditionalGeneration]],\n]);\n\nconst MODEL_WITH_LM_HEAD_MAPPING_NAMES = new Map([\n ['bloom', ['BloomForCausalLM', BloomForCausalLM]],\n ['gpt2', ['GPT2LMHeadModel', GPT2LMHeadModel]],\n ['gptj', ['GPTJForCausalLM', GPTJForCausalLM]],\n ['gpt_bigcode', ['GPTBigCodeForCausalLM', GPTBigCodeForCausalLM]],\n ['gpt_neo', ['GPTNeoForCausalLM', GPTNeoForCausalLM]],\n ['gpt_neox', ['GPTNeoXForCausalLM', GPTNeoXForCausalLM]],\n ['codegen', ['CodeGenForCausalLM', CodeGenForCausalLM]],\n ['llama', ['LlamaForCausalLM', LlamaForCausalLM]],\n ['qwen2', ['Qwen2ForCausalLM', Qwen2ForCausalLM]],\n ['phi', ['PhiForCausalLM', PhiForCausalLM]],\n ['mpt', ['MptForCausalLM', MptForCausalLM]],\n ['opt', ['OPTForCausalLM', OPTForCausalLM]],\n ['mbart', ['MBartForCausalLM', MBartForCausalLM]],\n ['mistral', ['MistralForCausalLM', MistralForCausalLM]],\n ['starcoder2', ['Starcoder2ForCausalLM', Starcoder2ForCausalLM]],\n ['falcon', ['FalconForCausalLM', FalconForCausalLM]],\n ['trocr', ['TrOCRForCausalLM', TrOCRForCausalLM]],\n ['stablelm', ['StableLmForCausalLM', StableLmForCausalLM]],\n]);\n\nconst MODEL_FOR_MASKED_LM_MAPPING_NAMES = new Map([\n ['bert', ['BertForMaskedLM', BertForMaskedLM]],\n ['roformer', ['RoFormerForMaskedLM', RoFormerForMaskedLM]],\n ['electra', ['ElectraForMaskedLM', ElectraForMaskedLM]],\n ['esm', ['EsmForMaskedLM', EsmForMaskedLM]],\n ['convbert', ['ConvBertForMaskedLM', ConvBertForMaskedLM]],\n ['camembert', ['CamembertForMaskedLM', CamembertForMaskedLM]],\n ['deberta', ['DebertaForMaskedLM', DebertaForMaskedLM]],\n ['deberta-v2', ['DebertaV2ForMaskedLM', DebertaV2ForMaskedLM]],\n ['mpnet', ['MPNetForMaskedLM', MPNetForMaskedLM]],\n ['albert', ['AlbertForMaskedLM', AlbertForMaskedLM]],\n ['distilbert', ['DistilBertForMaskedLM', DistilBertForMaskedLM]],\n ['roberta', ['RobertaForMaskedLM', RobertaForMaskedLM]],\n ['xlm', ['XLMWithLMHeadModel', XLMWithLMHeadModel]],\n ['xlm-roberta', ['XLMRobertaForMaskedLM', XLMRobertaForMaskedLM]],\n ['mobilebert', ['MobileBertForMaskedLM', MobileBertForMaskedLM]],\n ['squeezebert', ['SqueezeBertForMaskedLM', SqueezeBertForMaskedLM]],\n]);\n\nconst MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES = new Map([\n ['bert', ['BertForQuestionAnswering', BertForQuestionAnswering]],\n ['roformer', ['RoFormerForQuestionAnswering', RoFormerForQuestionAnswering]],\n ['electra', ['ElectraForQuestionAnswering', ElectraForQuestionAnswering]],\n ['convbert', ['ConvBertForQuestionAnswering', ConvBertForQuestionAnswering]],\n ['camembert', ['CamembertForQuestionAnswering', CamembertForQuestionAnswering]],\n ['deberta', ['DebertaForQuestionAnswering', DebertaForQuestionAnswering]],\n ['deberta-v2', ['DebertaV2ForQuestionAnswering', DebertaV2ForQuestionAnswering]],\n ['mpnet', ['MPNetForQuestionAnswering', MPNetForQuestionAnswering]],\n ['albert', ['AlbertForQuestionAnswering', AlbertForQuestionAnswering]],\n ['distilbert', ['DistilBertForQuestionAnswering', DistilBertForQuestionAnswering]],\n ['roberta', ['RobertaForQuestionAnswering', RobertaForQuestionAnswering]],\n ['xlm', ['XLMForQuestionAnswering', XLMForQuestionAnswering]],\n ['xlm-roberta', ['XLMRobertaForQuestionAnswering', XLMRobertaForQuestionAnswering]],\n ['mobilebert', ['MobileBertForQuestionAnswering', MobileBertForQuestionAnswering]],\n ['squeezebert', ['SqueezeBertForQuestionAnswering', SqueezeBertForQuestionAnswering]],\n]);\n\nconst MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES = new Map([\n ['vision-encoder-decoder', ['VisionEncoderDecoderModel', VisionEncoderDecoderModel]],\n]);\n\nconst MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES = new Map([\n ['vision-encoder-decoder', ['VisionEncoderDecoderModel', VisionEncoderDecoderModel]],\n]);\n\nconst MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES = new Map([\n ['vit', ['ViTForImageClassification', ViTForImageClassification]],\n ['mobilevit', ['MobileViTForImageClassification', MobileViTForImageClassification]],\n ['beit', ['BeitForImageClassification', BeitForImageClassification]],\n ['deit', ['DeiTForImageClassification', DeiTForImageClassification]],\n ['convnext', ['ConvNextForImageClassification', ConvNextForImageClassification]],\n ['convnextv2', ['ConvNextV2ForImageClassification', ConvNextV2ForImageClassification]],\n ['dinov2', ['Dinov2ForImageClassification', Dinov2ForImageClassification]],\n ['resnet', ['ResNetForImageClassification', ResNetForImageClassification]],\n ['swin', ['SwinForImageClassification', SwinForImageClassification]],\n ['segformer', ['SegformerForImageClassification', SegformerForImageClassification]],\n ['efficientnet', ['EfficientNetForImageClassification', EfficientNetForImageClassification]],\n]);\n\nconst MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES = new Map([\n ['detr', ['DetrForObjectDetection', DetrForObjectDetection]],\n ['table-transformer', ['TableTransformerForObjectDetection', TableTransformerForObjectDetection]],\n ['yolos', ['YolosForObjectDetection', YolosForObjectDetection]],\n]);\n\nconst MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES = new Map([\n ['owlvit', ['OwlViTForObjectDetection', OwlViTForObjectDetection]],\n ['owlv2', ['Owlv2ForObjectDetection', Owlv2ForObjectDetection]],\n]);\n\nconst MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES = new Map([\n ['detr', ['DetrForSegmentation', DetrForSegmentation]],\n ['clipseg', ['CLIPSegForImageSegmentation', CLIPSegForImageSegmentation]],\n]);\n\nconst MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES = new Map([\n ['segformer', ['SegformerForSemanticSegmentation', SegformerForSemanticSegmentation]],\n]);\n\nconst MODEL_FOR_MASK_GENERATION_MAPPING_NAMES = new Map([\n ['sam', ['SamModel', SamModel]],\n]);\n\nconst MODEL_FOR_CTC_MAPPING_NAMES = new Map([\n ['wav2vec2', ['Wav2Vec2ForCTC', Wav2Vec2ForCTC]],\n ['wav2vec2-bert', ['Wav2Vec2BertForCTC', Wav2Vec2BertForCTC]],\n ['unispeech', ['UniSpeechForCTC', UniSpeechForCTC]],\n ['unispeech-sat', ['UniSpeechSatForCTC', UniSpeechSatForCTC]],\n ['wavlm', ['WavLMForCTC', WavLMForCTC]],\n ['hubert', ['HubertForCTC', HubertForCTC]],\n]);\n\nconst MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES = new Map([\n ['wav2vec2', ['Wav2Vec2ForSequenceClassification', Wav2Vec2ForSequenceClassification]],\n ['wav2vec2-bert', ['Wav2Vec2BertForSequenceClassification', Wav2Vec2BertForSequenceClassification]],\n ['unispeech', ['UniSpeechForSequenceClassification', UniSpeechForSequenceClassification]],\n ['unispeech-sat', ['UniSpeechSatForSequenceClassification', UniSpeechSatForSequenceClassification]],\n ['wavlm', ['WavLMForSequenceClassification', WavLMForSequenceClassification]],\n ['hubert', ['HubertForSequenceClassification', HubertForSequenceClassification]],\n ['audio-spectrogram-transformer', ['ASTForAudioClassification', ASTForAudioClassification]],\n]);\n\nconst MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES = new Map([\n ['wavlm', ['WavLMForXVector', WavLMForXVector]],\n]);\n\nconst MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES = new Map([\n ['unispeech-sat', ['UniSpeechSatForAudioFrameClassification', UniSpeechSatForAudioFrameClassification]],\n ['wavlm', ['WavLMForAudioFrameClassification', WavLMForAudioFrameClassification]],\n ['wav2vec2', ['Wav2Vec2ForAudioFrameClassification', Wav2Vec2ForAudioFrameClassification]],\n]);\n\nconst MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES = new Map([\n ['vitmatte', ['VitMatteForImageMatting', VitMatteForImageMatting]],\n]);\n\nconst MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES = new Map([\n ['swin2sr', ['Swin2SRForImageSuperResolution', Swin2SRForImageSuperResolution]],\n])\n\nconst MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES = new Map([\n ['dpt', ['DPTForDepthEstimation', DPTForDepthEstimation]],\n ['depth_anything', ['DepthAnythingForDepthEstimation', DepthAnythingForDepthEstimation]],\n ['glpn', ['GLPNForDepthEstimation', GLPNForDepthEstimation]],\n])\n\n// NOTE: This is custom to Transformers.js, and is necessary because certain models\n// (e.g., CLIP) are split into vision and text components\nconst MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES = new Map([\n ['clip', ['CLIPVisionModelWithProjection', CLIPVisionModelWithProjection]],\n ['siglip', ['SiglipVisionModel', SiglipVisionModel]],\n])\n\nconst MODEL_CLASS_TYPE_MAPPING = [\n [MODEL_MAPPING_NAMES_ENCODER_ONLY, MODEL_TYPES.EncoderOnly],\n [MODEL_MAPPING_NAMES_ENCODER_DECODER, MODEL_TYPES.EncoderDecoder],\n [MODEL_MAPPING_NAMES_DECODER_ONLY, MODEL_TYPES.DecoderOnly],\n [MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES, MODEL_TYPES.Seq2Seq],\n [MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES, MODEL_TYPES.Seq2Seq],\n [MODEL_WITH_LM_HEAD_MAPPING_NAMES, MODEL_TYPES.DecoderOnly],\n [MODEL_FOR_MASKED_LM_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES, MODEL_TYPES.Vision2Seq],\n [MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_MASK_GENERATION_MAPPING_NAMES, MODEL_TYPES.MaskGeneration],\n [MODEL_FOR_CTC_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES, MODEL_TYPES.Seq2Seq],\n [MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n [MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n\n // Custom:\n [MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES, MODEL_TYPES.EncoderOnly],\n];\n\nfor (const [mappings, type] of MODEL_CLASS_TYPE_MAPPING) {\n // @ts-ignore\n for (const [name, model] of mappings.values()) {\n MODEL_TYPE_MAPPING.set(name, type);\n MODEL_CLASS_TO_NAME_MAPPING.set(model, name);\n MODEL_NAME_TO_CLASS_MAPPING.set(name, model);\n }\n}\n\nconst CUSTOM_MAPPING = [\n ['CLIPTextModelWithProjection', CLIPTextModelWithProjection, MODEL_TYPES.EncoderOnly],\n ['SiglipTextModel', SiglipTextModel, MODEL_TYPES.EncoderOnly],\n ['ClapTextModelWithProjection', ClapTextModelWithProjection, MODEL_TYPES.EncoderOnly],\n ['ClapAudioModelWithProjection', ClapAudioModelWithProjection, MODEL_TYPES.EncoderOnly],\n]\nfor (const [name, model, type] of CUSTOM_MAPPING) {\n MODEL_TYPE_MAPPING.set(name, type);\n MODEL_CLASS_TO_NAME_MAPPING.set(model, name);\n MODEL_NAME_TO_CLASS_MAPPING.set(name, model);\n}\n\n\n/**\n * Helper class which is used to instantiate pretrained models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModel.from_pretrained('bert-base-uncased');\n */\nclass AutoModel extends PretrainedMixin {\n /** @type {Map[]} */\n // @ts-ignore\n static MODEL_CLASS_MAPPINGS = MODEL_CLASS_TYPE_MAPPING.map(x => x[0]);\n static BASE_IF_FAIL = true;\n}\n\n/**\n * Helper class which is used to instantiate pretrained sequence classification models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForSequenceClassification.from_pretrained('distilbert-base-uncased-finetuned-sst-2-english');\n */\nclass AutoModelForSequenceClassification extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained token classification models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForTokenClassification.from_pretrained('Davlan/distilbert-base-multilingual-cased-ner-hrl');\n */\nclass AutoModelForTokenClassification extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained sequence-to-sequence models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForSeq2SeqLM.from_pretrained('t5-small');\n */\nclass AutoModelForSeq2SeqLM extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained sequence-to-sequence speech-to-text models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForSpeechSeq2Seq.from_pretrained('openai/whisper-tiny.en');\n */\nclass AutoModelForSpeechSeq2Seq extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained sequence-to-sequence text-to-spectrogram models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForTextToSpectrogram.from_pretrained('microsoft/speecht5_tts');\n */\nclass AutoModelForTextToSpectrogram extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained text-to-waveform models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForTextToSpectrogram.from_pretrained('facebook/mms-tts-eng');\n */\nclass AutoModelForTextToWaveform extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained causal language models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForCausalLM.from_pretrained('gpt2');\n */\nclass AutoModelForCausalLM extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_WITH_LM_HEAD_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained masked language models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForMaskedLM.from_pretrained('bert-base-uncased');\n */\nclass AutoModelForMaskedLM extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_MASKED_LM_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained question answering models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForQuestionAnswering.from_pretrained('distilbert-base-cased-distilled-squad');\n */\nclass AutoModelForQuestionAnswering extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained vision-to-sequence models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForVision2Seq.from_pretrained('nlpconnect/vit-gpt2-image-captioning');\n */\nclass AutoModelForVision2Seq extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained image classification models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForImageClassification.from_pretrained('google/vit-base-patch16-224');\n */\nclass AutoModelForImageClassification extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained image segmentation models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForImageSegmentation.from_pretrained('facebook/detr-resnet-50-panoptic');\n */\nclass AutoModelForImageSegmentation extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained image segmentation models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForSemanticSegmentation.from_pretrained('nvidia/segformer-b3-finetuned-cityscapes-1024-1024');\n */\nclass AutoModelForSemanticSegmentation extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES];\n}\n\n/**\n * Helper class which is used to instantiate pretrained object detection models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForObjectDetection.from_pretrained('facebook/detr-resnet-50');\n */\nclass AutoModelForObjectDetection extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES];\n}\n\nclass AutoModelForZeroShotObjectDetection extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES];\n}\n\n\n/**\n * Helper class which is used to instantiate pretrained mask generation models with the `from_pretrained` function.\n * The chosen model class is determined by the type specified in the model config.\n * \n * @example\n * let model = await AutoModelForMaskGeneration.from_pretrained('Xenova/sam-vit-base');\n */\nclass AutoModelForMaskGeneration extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_MASK_GENERATION_MAPPING_NAMES];\n}\n\nclass AutoModelForCTC extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_CTC_MAPPING_NAMES];\n}\n\nclass AutoModelForAudioClassification extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES];\n}\n\nclass AutoModelForXVector extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES];\n}\n\nclass AutoModelForAudioFrameClassification extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES];\n}\n\nclass AutoModelForDocumentQuestionAnswering extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES];\n}\n\nclass AutoModelForImageMatting extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES];\n}\n\nclass AutoModelForImageToImage extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES];\n}\n\nclass AutoModelForDepthEstimation extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES];\n}\n\nclass AutoModelForImageFeatureExtraction extends PretrainedMixin {\n static MODEL_CLASS_MAPPINGS = [MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES];\n}\n\n//////////////////////////////////////////////////\n\n//////////////////////////////////////////////////\nclass Seq2SeqLMOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits The output logits of the model.\n * @param {Tensor} output.past_key_values An tensor of key/value pairs that represent the previous state of the model.\n * @param {Tensor} output.encoder_outputs The output of the encoder in a sequence-to-sequence model.\n * @param {Tensor} [output.decoder_attentions] Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the self-attention heads.\n * @param {Tensor} [output.cross_attentions] Attentions weights of the decoder's cross-attention layer, after the attention softmax, used to compute the weighted average in the cross-attention heads.\n */\n constructor({ logits, past_key_values, encoder_outputs, decoder_attentions = null, cross_attentions = null }) {\n super();\n this.logits = logits;\n this.past_key_values = past_key_values;\n this.encoder_outputs = encoder_outputs;\n this.decoder_attentions = decoder_attentions;\n this.cross_attentions = cross_attentions;\n }\n}\n\n/**\n * Base class for outputs of sentence classification models.\n */\nclass SequenceClassifierOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits classification (or regression if config.num_labels==1) scores (before SoftMax).\n */\n constructor({ logits }) {\n super();\n this.logits = logits;\n }\n}\n\n/**\n * Base class for outputs of XVector models.\n */\nclass XVectorOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Classification hidden states before AMSoftmax, of shape `(batch_size, config.xvector_output_dim)`.\n * @param {Tensor} output.embeddings Utterance embeddings used for vector similarity-based retrieval, of shape `(batch_size, config.xvector_output_dim)`.\n */\n constructor({ logits, embeddings }) {\n super();\n this.logits = logits;\n this.embeddings = embeddings;\n }\n}\n\n/**\n * Base class for outputs of token classification models.\n */\nclass TokenClassifierOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Classification scores (before SoftMax).\n */\n constructor({ logits }) {\n super();\n this.logits = logits;\n }\n}\n\n/**\n * Base class for masked language models outputs.\n */\nclass MaskedLMOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).\n */\n constructor({ logits }) {\n super();\n this.logits = logits;\n }\n}\n\n/**\n * Base class for outputs of question answering models.\n */\nclass QuestionAnsweringModelOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.start_logits Span-start scores (before SoftMax).\n * @param {Tensor} output.end_logits Span-end scores (before SoftMax).\n */\n constructor({ start_logits, end_logits }) {\n super();\n this.start_logits = start_logits;\n this.end_logits = end_logits;\n }\n}\n\n\n/**\n * Base class for causal language model (or autoregressive) outputs.\n */\nclass CausalLMOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Prediction scores of the language modeling head (scores for each vocabulary token before softmax).\n */\n constructor({ logits }) {\n super();\n this.logits = logits;\n }\n}\n\n/**\n * Base class for causal language model (or autoregressive) outputs.\n */\nclass CausalLMOutputWithPast extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.logits Prediction scores of the language modeling head (scores for each vocabulary token before softmax).\n * @param {Tensor} output.past_key_values Contains pre-computed hidden-states (key and values in the self-attention blocks)\n * that can be used (see `past_key_values` input) to speed up sequential decoding.\n */\n constructor({ logits, past_key_values }) {\n super();\n this.logits = logits;\n this.past_key_values = past_key_values;\n }\n}\n\nclass ImageMattingOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.alphas Estimated alpha values, of shape `(batch_size, num_channels, height, width)`.\n */\n constructor({ alphas }) {\n super();\n this.alphas = alphas;\n }\n}\n\n/**\n * Describes the outputs for the VITS model.\n */\nclass VitsModelOutput extends ModelOutput {\n /**\n * @param {Object} output The output of the model.\n * @param {Tensor} output.waveform The final audio waveform predicted by the model, of shape `(batch_size, sequence_length)`.\n * @param {Tensor} output.spectrogram The log-mel spectrogram predicted at the output of the flow model.\n * This spectrogram is passed to the Hi-Fi GAN decoder model to obtain the final audio waveform.\n */\n constructor({ waveform, spectrogram }) {\n super();\n this.waveform = waveform;\n this.spectrogram = spectrogram;\n }\n}\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/models.js?"); /***/ }), @@ -315,7 +3647,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AudioClassificationPipeline: () => (/* binding */ AudioClassificationPipeline),\n/* harmony export */ AutomaticSpeechRecognitionPipeline: () => (/* binding */ AutomaticSpeechRecognitionPipeline),\n/* harmony export */ DepthEstimationPipeline: () => (/* binding */ DepthEstimationPipeline),\n/* harmony export */ DocumentQuestionAnsweringPipeline: () => (/* binding */ DocumentQuestionAnsweringPipeline),\n/* harmony export */ FeatureExtractionPipeline: () => (/* binding */ FeatureExtractionPipeline),\n/* harmony export */ FillMaskPipeline: () => (/* binding */ FillMaskPipeline),\n/* harmony export */ ImageClassificationPipeline: () => (/* binding */ ImageClassificationPipeline),\n/* harmony export */ ImageSegmentationPipeline: () => (/* binding */ ImageSegmentationPipeline),\n/* harmony export */ ImageToImagePipeline: () => (/* binding */ ImageToImagePipeline),\n/* harmony export */ ImageToTextPipeline: () => (/* binding */ ImageToTextPipeline),\n/* harmony export */ ObjectDetectionPipeline: () => (/* binding */ ObjectDetectionPipeline),\n/* harmony export */ Pipeline: () => (/* binding */ Pipeline),\n/* harmony export */ QuestionAnsweringPipeline: () => (/* binding */ QuestionAnsweringPipeline),\n/* harmony export */ SummarizationPipeline: () => (/* binding */ SummarizationPipeline),\n/* harmony export */ Text2TextGenerationPipeline: () => (/* binding */ Text2TextGenerationPipeline),\n/* harmony export */ TextClassificationPipeline: () => (/* binding */ TextClassificationPipeline),\n/* harmony export */ TextGenerationPipeline: () => (/* binding */ TextGenerationPipeline),\n/* harmony export */ TextToAudioPipeline: () => (/* binding */ TextToAudioPipeline),\n/* harmony export */ TokenClassificationPipeline: () => (/* binding */ TokenClassificationPipeline),\n/* harmony export */ TranslationPipeline: () => (/* binding */ TranslationPipeline),\n/* harmony export */ ZeroShotAudioClassificationPipeline: () => (/* binding */ ZeroShotAudioClassificationPipeline),\n/* harmony export */ ZeroShotClassificationPipeline: () => (/* binding */ ZeroShotClassificationPipeline),\n/* harmony export */ ZeroShotImageClassificationPipeline: () => (/* binding */ ZeroShotImageClassificationPipeline),\n/* harmony export */ ZeroShotObjectDetectionPipeline: () => (/* binding */ ZeroShotObjectDetectionPipeline),\n/* harmony export */ pipeline: () => (/* binding */ pipeline)\n/* harmony export */ });\n/* harmony import */ var _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tokenizers.js */ \"./node_modules/@xenova/transformers/src/tokenizers.js\");\n/* harmony import */ var _models_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./models.js */ \"./node_modules/@xenova/transformers/src/models.js\");\n/* harmony import */ var _processors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./processors.js */ \"./node_modules/@xenova/transformers/src/processors.js\");\n/* harmony import */ var _utils_core_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/core.js */ \"./node_modules/@xenova/transformers/src/utils/core.js\");\n/* harmony import */ var _utils_maths_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/maths.js */ \"./node_modules/@xenova/transformers/src/utils/maths.js\");\n/* harmony import */ var _utils_audio_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/audio.js */ \"./node_modules/@xenova/transformers/src/utils/audio.js\");\n/* harmony import */ var _utils_tensor_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/tensor.js */ \"./node_modules/@xenova/transformers/src/utils/tensor.js\");\n/* harmony import */ var _utils_image_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/image.js */ \"./node_modules/@xenova/transformers/src/utils/image.js\");\n/**\n * @file Pipelines provide a high-level, easy to use, API for running machine learning models.\n * \n * **Example:** Instantiate pipeline using the `pipeline` function.\n * ```javascript\n * import { pipeline } from '@xenova/transformers';\n * \n * const classifier = await pipeline('sentiment-analysis');\n * const output = await classifier('I love transformers!');\n * // [{'label': 'POSITIVE', 'score': 0.999817686}]\n * ```\n * \n * @module pipelines\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @typedef {string | RawImage | URL} ImageInput\n * @typedef {ImageInput|ImageInput[]} ImagePipelineInputs\n */\n\n/**\n * Prepare images for further tasks.\n * @param {ImagePipelineInputs} images images to prepare.\n * @returns {Promise} returns processed images.\n * @private\n */\nasync function prepareImages(images) {\n if (!Array.isArray(images)) {\n images = [images];\n }\n\n // Possibly convert any non-images to images\n return await Promise.all(images.map(x => _utils_image_js__WEBPACK_IMPORTED_MODULE_7__.RawImage.read(x)));\n}\n\n/**\n * @typedef {string | URL | Float32Array | Float64Array} AudioInput\n * @typedef {AudioInput|AudioInput[]} AudioPipelineInputs\n */\n\n/**\n * Prepare audios for further tasks.\n * @param {AudioPipelineInputs} audios audios to prepare.\n * @param {number} sampling_rate sampling rate of the audios.\n * @returns {Promise} The preprocessed audio data.\n * @private\n */\nasync function prepareAudios(audios, sampling_rate) {\n if (!Array.isArray(audios)) {\n audios = [audios];\n }\n\n return await Promise.all(audios.map(x => {\n if (typeof x === 'string' || x instanceof URL) {\n return (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.read_audio)(x, sampling_rate);\n } else if (x instanceof Float64Array) {\n return new Float32Array(x);\n }\n return x;\n }));\n}\n\n/**\n * @typedef {Object} BoundingBox\n * @property {number} xmin The minimum x coordinate of the bounding box.\n * @property {number} ymin The minimum y coordinate of the bounding box.\n * @property {number} xmax The maximum x coordinate of the bounding box.\n * @property {number} ymax The maximum y coordinate of the bounding box.\n */\n\n/**\n * Helper function to convert list [xmin, xmax, ymin, ymax] into object { \"xmin\": xmin, ... }\n * @param {number[]} box The bounding box as a list.\n * @param {boolean} asInteger Whether to cast to integers.\n * @returns {BoundingBox} The bounding box as an object.\n * @private\n */\nfunction get_bounding_box(box, asInteger) {\n if (asInteger) {\n box = box.map(x => x | 0);\n }\n const [xmin, ymin, xmax, ymax] = box;\n\n return { xmin, ymin, xmax, ymax };\n}\n\n\n/**\n * @callback DisposeType Disposes the item.\n * @returns {Promise} A promise that resolves when the item has been disposed.\n * \n * @typedef {Object} Disposable\n * @property {DisposeType} dispose A promise that resolves when the pipeline has been disposed.\n */\n\n/**\n * The Pipeline class is the class from which all pipelines inherit.\n * Refer to this class for methods shared across different pipelines.\n * @extends Callable\n */\nclass Pipeline extends _utils_core_js__WEBPACK_IMPORTED_MODULE_3__.Callable {\n /**\n * Create a new Pipeline.\n * @param {Object} options An object containing the following properties:\n * @param {string} [options.task] The task of the pipeline. Useful for specifying subtasks.\n * @param {PreTrainedModel} [options.model] The model used by the pipeline.\n * @param {PreTrainedTokenizer} [options.tokenizer=null] The tokenizer used by the pipeline (if any).\n * @param {Processor} [options.processor=null] The processor used by the pipeline (if any).\n */\n constructor({ task, model, tokenizer = null, processor = null }) {\n super();\n this.task = task;\n this.model = model;\n this.tokenizer = tokenizer;\n this.processor = processor;\n }\n\n /** @type {DisposeType} */\n async dispose() {\n await this.model.dispose();\n }\n}\n\n/**\n * @typedef {Object} ModelTokenizerConstructorArgs\n * @property {string} task The task of the pipeline. Useful for specifying subtasks.\n * @property {PreTrainedModel} model The model used by the pipeline.\n * @property {PreTrainedTokenizer} tokenizer The tokenizer used by the pipeline.\n * \n * @typedef {ModelTokenizerConstructorArgs} TextPipelineConstructorArgs An object used to instantiate a text-based pipeline.\n */\n\n/**\n * @typedef {Object} ModelProcessorConstructorArgs\n * @property {string} task The task of the pipeline. Useful for specifying subtasks.\n * @property {PreTrainedModel} model The model used by the pipeline.\n * @property {Processor} processor The processor used by the pipeline.\n * \n * @typedef {ModelProcessorConstructorArgs} AudioPipelineConstructorArgs An object used to instantiate an audio-based pipeline.\n * @typedef {ModelProcessorConstructorArgs} ImagePipelineConstructorArgs An object used to instantiate an image-based pipeline.\n */\n\n\n/**\n * @typedef {Object} ModelTokenizerProcessorConstructorArgs\n * @property {string} task The task of the pipeline. Useful for specifying subtasks.\n * @property {PreTrainedModel} model The model used by the pipeline.\n * @property {PreTrainedTokenizer} tokenizer The tokenizer used by the pipeline.\n * @property {Processor} processor The processor used by the pipeline.\n * \n * @typedef {ModelTokenizerProcessorConstructorArgs} TextAudioPipelineConstructorArgs An object used to instantiate a text- and audio-based pipeline.\n * @typedef {ModelTokenizerProcessorConstructorArgs} TextImagePipelineConstructorArgs An object used to instantiate a text- and image-based pipeline.\n */\n\n/**\n * @typedef {Object} TextClassificationSingle\n * @property {string} label The label predicted.\n * @property {number} score The corresponding probability.\n * @typedef {TextClassificationSingle[]} TextClassificationOutput\n * \n * @typedef {Object} TextClassificationPipelineOptions Parameters specific to text classification pipelines.\n * @property {number} [topk=1] The number of top predictions to be returned.\n * \n * @callback TextClassificationPipelineCallback Classify the text(s) given as inputs.\n * @param {string|string[]} texts The input text(s) to be classified.\n * @param {TextClassificationPipelineOptions} [options] The options to use for text classification.\n * @returns {Promise} An array or object containing the predicted labels and scores.\n * \n * @typedef {TextPipelineConstructorArgs & TextClassificationPipelineCallback & Disposable} TextClassificationPipelineType\n */\n\n/**\n * Text classification pipeline using any `ModelForSequenceClassification`.\n *\n * **Example:** Sentiment-analysis w/ `Xenova/distilbert-base-uncased-finetuned-sst-2-english`.\n * ```javascript\n * const classifier = await pipeline('sentiment-analysis', 'Xenova/distilbert-base-uncased-finetuned-sst-2-english');\n * const output = await classifier('I love transformers!');\n * // [{ label: 'POSITIVE', score: 0.999788761138916 }]\n * ```\n * \n * **Example:** Multilingual sentiment-analysis w/ `Xenova/bert-base-multilingual-uncased-sentiment` (and return top 5 classes).\n * ```javascript\n * const classifier = await pipeline('sentiment-analysis', 'Xenova/bert-base-multilingual-uncased-sentiment');\n * const output = await classifier('Le meilleur film de tous les temps.', { topk: 5 });\n * // [\n * // { label: '5 stars', score: 0.9610759615898132 },\n * // { label: '4 stars', score: 0.03323351591825485 },\n * // { label: '3 stars', score: 0.0036155181005597115 },\n * // { label: '1 star', score: 0.0011325967498123646 },\n * // { label: '2 stars', score: 0.0009423971059732139 }\n * // ]\n * ```\n * \n * **Example:** Toxic comment classification w/ `Xenova/toxic-bert` (and return all classes).\n * ```javascript\n * const classifier = await pipeline('text-classification', 'Xenova/toxic-bert');\n * const output = await classifier('I hate you!', { topk: null });\n * // [\n * // { label: 'toxic', score: 0.9593140482902527 },\n * // { label: 'insult', score: 0.16187334060668945 },\n * // { label: 'obscene', score: 0.03452680632472038 },\n * // { label: 'identity_hate', score: 0.0223250575363636 },\n * // { label: 'threat', score: 0.019197041168808937 },\n * // { label: 'severe_toxic', score: 0.005651099607348442 }\n * // ]\n * ```\n */\nclass TextClassificationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => TextClassificationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new TextClassificationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {TextClassificationPipelineCallback} */\n async _call(texts, {\n topk = 1\n } = {}) {\n\n // Run tokenization\n const model_inputs = this.tokenizer(texts, {\n padding: true,\n truncation: true,\n });\n\n // Run model\n const outputs = await this.model(model_inputs)\n\n // TODO: Use softmax tensor function\n const function_to_apply =\n this.model.config.problem_type === 'multi_label_classification'\n ? batch => batch.sigmoid().data\n : batch => (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(batch.data); // single_label_classification (default)\n\n const id2label = this.model.config.id2label;\n\n const toReturn = [];\n for (const batch of outputs.logits) {\n const output = function_to_apply(batch);\n const scores = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.getTopItems)(output, topk);\n\n const vals = scores.map(x => ({\n label: id2label[x[0]],\n score: x[1],\n }));\n if (topk === 1) {\n toReturn.push(...vals);\n } else {\n toReturn.push(vals);\n }\n }\n\n return Array.isArray(texts) || topk === 1 ? /** @type {TextClassificationOutput} */ (toReturn) : /** @type {TextClassificationOutput[]} */ (toReturn)[0];\n }\n}\n\n/**\n * @typedef {Object} TokenClassificationSingle\n * @property {string} word The token/word classified. This is obtained by decoding the selected tokens.\n * @property {number} score The corresponding probability for `entity`.\n * @property {string} entity The entity predicted for that token/word.\n * @property {number} index The index of the corresponding token in the sentence.\n * @property {number} [start] The index of the start of the corresponding entity in the sentence.\n * @property {number} [end] The index of the end of the corresponding entity in the sentence.\n * @typedef {TokenClassificationSingle[]} TokenClassificationOutput\n * \n * @typedef {Object} TokenClassificationPipelineOptions Parameters specific to token classification pipelines.\n * @property {string[]} [ignore_labels] A list of labels to ignore.\n * \n * @callback TokenClassificationPipelineCallback Classify each token of the text(s) given as inputs.\n * @param {string|string[]} texts One or several texts (or one list of texts) for token classification.\n * @param {TokenClassificationPipelineOptions} [options] The options to use for token classification.\n * @returns {Promise} The result.\n * \n * @typedef {TextPipelineConstructorArgs & TokenClassificationPipelineCallback & Disposable} TokenClassificationPipelineType\n */\n\n/**\n * Named Entity Recognition pipeline using any `ModelForTokenClassification`.\n * \n * **Example:** Perform named entity recognition with `Xenova/bert-base-NER`.\n * ```javascript\n * const classifier = await pipeline('token-classification', 'Xenova/bert-base-NER');\n * const output = await classifier('My name is Sarah and I live in London');\n * // [\n * // { entity: 'B-PER', score: 0.9980202913284302, index: 4, word: 'Sarah' },\n * // { entity: 'B-LOC', score: 0.9994474053382874, index: 9, word: 'London' }\n * // ]\n * ```\n * \n * **Example:** Perform named entity recognition with `Xenova/bert-base-NER` (and return all labels).\n * ```javascript\n * const classifier = await pipeline('token-classification', 'Xenova/bert-base-NER');\n * const output = await classifier('Sarah lives in the United States of America', { ignore_labels: [] });\n * // [\n * // { entity: 'B-PER', score: 0.9966587424278259, index: 1, word: 'Sarah' },\n * // { entity: 'O', score: 0.9987385869026184, index: 2, word: 'lives' },\n * // { entity: 'O', score: 0.9990072846412659, index: 3, word: 'in' },\n * // { entity: 'O', score: 0.9988298416137695, index: 4, word: 'the' },\n * // { entity: 'B-LOC', score: 0.9995510578155518, index: 5, word: 'United' },\n * // { entity: 'I-LOC', score: 0.9990395307540894, index: 6, word: 'States' },\n * // { entity: 'I-LOC', score: 0.9986724853515625, index: 7, word: 'of' },\n * // { entity: 'I-LOC', score: 0.9975294470787048, index: 8, word: 'America' }\n * // ]\n * ```\n */\nclass TokenClassificationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => TokenClassificationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new TokenClassificationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {TokenClassificationPipelineCallback} */\n async _call(texts, {\n ignore_labels = ['O'],\n } = {}) {\n\n const isBatched = Array.isArray(texts);\n\n // Run tokenization\n const model_inputs = this.tokenizer(isBatched ? texts : [texts], {\n padding: true,\n truncation: true,\n });\n\n // Run model\n const outputs = await this.model(model_inputs)\n\n const logits = outputs.logits;\n const id2label = this.model.config.id2label;\n\n const toReturn = [];\n for (let i = 0; i < logits.dims[0]; ++i) {\n const ids = model_inputs.input_ids[i];\n const batch = logits[i];\n\n // List of tokens that aren't ignored\n const tokens = [];\n for (let j = 0; j < batch.dims[0]; ++j) {\n const tokenData = batch[j];\n const topScoreIndex = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.max)(tokenData.data)[1];\n\n const entity = id2label ? id2label[topScoreIndex] : `LABEL_${topScoreIndex}`;\n if (ignore_labels.includes(entity)) {\n // We predicted a token that should be ignored. So, we skip it.\n continue;\n }\n\n // TODO add option to keep special tokens?\n const word = this.tokenizer.decode([ids[j].item()], { skip_special_tokens: true });\n if (word === '') {\n // Was a special token. So, we skip it.\n continue;\n }\n\n const scores = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(tokenData.data);\n\n tokens.push({\n entity: entity,\n score: scores[topScoreIndex],\n index: j,\n word: word,\n\n // TODO: null for now, but will add\n start: null,\n end: null,\n });\n }\n toReturn.push(tokens);\n }\n return isBatched ? toReturn : toReturn[0];\n }\n}\n\n/**\n * @typedef {Object} QuestionAnsweringOutput\n * @property {number} score The probability associated to the answer.\n * @property {number} [start] The character start index of the answer (in the tokenized version of the input).\n * @property {number} [end] The character end index of the answer (in the tokenized version of the input).\n * @property {string} answer The answer to the question.\n * \n * @typedef {Object} QuestionAnsweringPipelineOptions Parameters specific to question answering pipelines.\n * @property {number} [topk=1] The number of top answer predictions to be returned.\n * \n * @callback QuestionAnsweringPipelineCallback Answer the question(s) given as inputs by using the context(s).\n * @param {string|string[]} question One or several question(s) (must be used in conjunction with the `context` argument).\n * @param {string|string[]} context One or several context(s) associated with the question(s) (must be used in conjunction with the `question` argument).\n * @param {QuestionAnsweringPipelineOptions} [options] The options to use for question answering.\n * @returns {Promise} An array or object containing the predicted answers and scores.\n * \n * @typedef {TextPipelineConstructorArgs & QuestionAnsweringPipelineCallback & Disposable} QuestionAnsweringPipelineType\n */\n\n/**\n * Question Answering pipeline using any `ModelForQuestionAnswering`.\n * \n * **Example:** Run question answering with `Xenova/distilbert-base-uncased-distilled-squad`.\n * ```javascript\n * const answerer = await pipeline('question-answering', 'Xenova/distilbert-base-uncased-distilled-squad');\n * const question = 'Who was Jim Henson?';\n * const context = 'Jim Henson was a nice puppet.';\n * const output = await answerer(question, context);\n * // {\n * // answer: \"a nice puppet\",\n * // score: 0.5768911502526741\n * // }\n * ```\n */\nclass QuestionAnsweringPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => QuestionAnsweringPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new QuestionAnsweringPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {QuestionAnsweringPipelineCallback} */\n async _call(question, context, {\n topk = 1\n } = {}) {\n\n // Run tokenization\n const inputs = this.tokenizer(question, {\n text_pair: context,\n padding: true,\n truncation: true,\n });\n\n const output = await this.model(inputs);\n\n /** @type {QuestionAnsweringOutput[]} */\n const toReturn = [];\n for (let j = 0; j < output.start_logits.dims[0]; ++j) {\n const ids = inputs.input_ids[j];\n const sepIndex = ids.indexOf(this.tokenizer.sep_token_id);\n\n const s1 = Array.from((0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(output.start_logits[j].data))\n .map((x, i) => [x, i])\n .filter(x => x[1] > sepIndex);\n const e1 = Array.from((0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(output.end_logits[j].data))\n .map((x, i) => [x, i])\n .filter(x => x[1] > sepIndex);\n\n const options = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_3__.product)(s1, e1)\n .filter(x => x[0][1] <= x[1][1])\n .map(x => [x[0][1], x[1][1], x[0][0] * x[1][0]])\n .sort((a, b) => b[2] - a[2]);\n\n for (let k = 0; k < Math.min(options.length, topk); ++k) {\n const [start, end, score] = options[k];\n\n const answer_tokens = [...ids].slice(start, end + 1)\n\n const answer = this.tokenizer.decode(answer_tokens, {\n skip_special_tokens: true,\n });\n\n // TODO add start and end?\n // NOTE: HF returns character index\n toReturn.push({\n answer, score\n });\n }\n }\n\n // Mimic HF's return type based on topk\n return (topk === 1) ? toReturn[0] : toReturn;\n }\n}\n\n\n/**\n * @typedef {Object} FillMaskSingle\n * @property {string} sequence The corresponding input with the mask token prediction.\n * @property {number} score The corresponding probability.\n * @property {number} token The predicted token id (to replace the masked one).\n * @property {string} token_str The predicted token (to replace the masked one).\n * @typedef {FillMaskSingle[]} FillMaskOutput\n * \n * @typedef {Object} FillMaskPipelineOptions Parameters specific to fill mask pipelines.\n * @property {number} [topk=5] When passed, overrides the number of predictions to return.\n * \n * @callback FillMaskPipelineCallback Fill the masked token in the text(s) given as inputs.\n * @param {string|string[]} texts One or several texts (or one list of prompts) with masked tokens.\n * @param {FillMaskPipelineOptions} [options] The options to use for masked language modelling.\n * @returns {Promise} An array of objects containing the score, predicted token, predicted token string,\n * and the sequence with the predicted token filled in, or an array of such arrays (one for each input text).\n * If only one input text is given, the output will be an array of objects.\n * @throws {Error} When the mask token is not found in the input text.\n * \n * @typedef {TextPipelineConstructorArgs & FillMaskPipelineCallback & Disposable} FillMaskPipelineType\n */\n\n/**\n * Masked language modeling prediction pipeline using any `ModelWithLMHead`.\n * \n * **Example:** Perform masked language modelling (a.k.a. \"fill-mask\") with `Xenova/bert-base-uncased`.\n * ```javascript\n * const unmasker = await pipeline('fill-mask', 'Xenova/bert-base-cased');\n * const output = await unmasker('The goal of life is [MASK].');\n * // [\n * // { token_str: 'survival', score: 0.06137419492006302, token: 8115, sequence: 'The goal of life is survival.' },\n * // { token_str: 'love', score: 0.03902450203895569, token: 1567, sequence: 'The goal of life is love.' },\n * // { token_str: 'happiness', score: 0.03253183513879776, token: 9266, sequence: 'The goal of life is happiness.' },\n * // { token_str: 'freedom', score: 0.018736306577920914, token: 4438, sequence: 'The goal of life is freedom.' },\n * // { token_str: 'life', score: 0.01859794743359089, token: 1297, sequence: 'The goal of life is life.' }\n * // ]\n * ```\n * \n * **Example:** Perform masked language modelling (a.k.a. \"fill-mask\") with `Xenova/bert-base-cased` (and return top result).\n * ```javascript\n * const unmasker = await pipeline('fill-mask', 'Xenova/bert-base-cased');\n * const output = await unmasker('The Milky Way is a [MASK] galaxy.', { topk: 1 });\n * // [{ token_str: 'spiral', score: 0.6299987435340881, token: 14061, sequence: 'The Milky Way is a spiral galaxy.' }]\n * ```\n */\nclass FillMaskPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => FillMaskPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new FillMaskPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {FillMaskPipelineCallback} */\n async _call(texts, {\n topk = 5\n } = {}) {\n\n // Run tokenization\n const model_inputs = this.tokenizer(texts, {\n padding: true,\n truncation: true,\n });\n\n // Run model\n const outputs = await this.model(model_inputs)\n\n const toReturn = [];\n\n for (let i = 0; i < model_inputs.input_ids.dims[0]; ++i) {\n const ids = model_inputs.input_ids[i];\n const mask_token_index = ids.indexOf(this.tokenizer.mask_token_id)\n\n if (mask_token_index === -1) {\n throw Error(`Mask token (${this.tokenizer.mask_token}) not found in text.`)\n }\n const logits = outputs.logits[i];\n const itemLogits = logits[mask_token_index];\n\n const scores = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.getTopItems)((0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(itemLogits.data), topk);\n\n toReturn.push(scores.map(x => {\n const sequence = [...ids];\n sequence[mask_token_index] = x[0];\n\n return {\n score: x[1],\n token: x[0],\n token_str: this.tokenizer.model.vocab[x[0]],\n sequence: this.tokenizer.decode(sequence, { skip_special_tokens: true }),\n }\n }));\n }\n return Array.isArray(texts) ? toReturn : toReturn[0];\n }\n}\n\n\n/**\n * @typedef {Object} Text2TextGenerationSingle\n * @property {string} generated_text The generated text.\n * @typedef {Text2TextGenerationSingle[]} Text2TextGenerationOutput\n * \n * @callback Text2TextGenerationPipelineCallback Generate the output text(s) using text(s) given as inputs.\n * @param {string|string[]} texts Input text for the encoder.\n * @param {import('./utils/generation.js').GenerationConfigType} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise}\n * \n * @typedef {TextPipelineConstructorArgs & Text2TextGenerationPipelineCallback & Disposable} Text2TextGenerationPipelineType\n */\n\n/**\n * Text2TextGenerationPipeline class for generating text using a model that performs text-to-text generation tasks.\n * \n * **Example:** Text-to-text generation w/ `Xenova/LaMini-Flan-T5-783M`.\n * ```javascript\n * const generator = await pipeline('text2text-generation', 'Xenova/LaMini-Flan-T5-783M');\n * const output = await generator('how can I become more healthy?', {\n * max_new_tokens: 100,\n * });\n * // [{ generated_text: \"To become more healthy, you can: 1. Eat a balanced diet with plenty of fruits, vegetables, whole grains, lean proteins, and healthy fats. 2. Stay hydrated by drinking plenty of water. 3. Get enough sleep and manage stress levels. 4. Avoid smoking and excessive alcohol consumption. 5. Regularly exercise and maintain a healthy weight. 6. Practice good hygiene and sanitation. 7. Seek medical attention if you experience any health issues.\" }]\n * ```\n */\nclass Text2TextGenerationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => Text2TextGenerationPipelineType} */ (Pipeline)) {\n /** @type {'generated_text'} */\n _key = 'generated_text';\n\n /**\n * Create a new Text2TextGenerationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {Text2TextGenerationPipelineCallback} */\n async _call(texts, generate_kwargs = {}) {\n if (!Array.isArray(texts)) {\n texts = [texts];\n }\n\n\n // Add global prefix, if present\n if (this.model.config.prefix) {\n texts = texts.map(x => this.model.config.prefix + x)\n }\n\n // Handle task specific params:\n const task_specific_params = this.model.config.task_specific_params\n if (task_specific_params && task_specific_params[this.task]) {\n // Add prefixes, if present\n if (task_specific_params[this.task].prefix) {\n texts = texts.map(x => task_specific_params[this.task].prefix + x)\n }\n\n // TODO update generation config\n }\n\n const tokenizer = this.tokenizer;\n const tokenizer_options = {\n padding: true,\n truncation: true,\n }\n let input_ids;\n if (this instanceof TranslationPipeline && '_build_translation_inputs' in tokenizer) {\n // TODO: move to Translation pipeline?\n // Currently put here to avoid code duplication\n // @ts-ignore\n input_ids = tokenizer._build_translation_inputs(texts, tokenizer_options, generate_kwargs).input_ids;\n\n } else {\n input_ids = tokenizer(texts, tokenizer_options).input_ids;\n }\n\n const outputTokenIds = await this.model.generate(input_ids, generate_kwargs);\n\n return tokenizer.batch_decode(outputTokenIds, {\n skip_special_tokens: true,\n }).map(text => ({ [this._key]: text }));\n }\n}\n\n\n/**\n * @typedef {Object} SummarizationSingle\n * @property {string} summary_text The summary text.\n * @typedef {SummarizationSingle[]} SummarizationOutput\n * \n * @callback SummarizationPipelineCallback Summarize the text(s) given as inputs.\n * @param {string|string[]} texts One or several articles (or one list of articles) to summarize.\n * @param {import('./utils/generation.js').GenerationConfigType} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise}\n * \n * @typedef {TextPipelineConstructorArgs & SummarizationPipelineCallback & Disposable} SummarizationPipelineType\n */\n\n/**\n * A pipeline for summarization tasks, inheriting from Text2TextGenerationPipeline.\n * \n * **Example:** Summarization w/ `Xenova/distilbart-cnn-6-6`.\n * ```javascript\n * const generator = await pipeline('summarization', 'Xenova/distilbart-cnn-6-6');\n * const text = 'The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, ' +\n * 'and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. ' +\n * 'During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest ' +\n * 'man-made structure in the world, a title it held for 41 years until the Chrysler Building in New ' +\n * 'York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to ' +\n * 'the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the ' +\n * 'Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second ' +\n * 'tallest free-standing structure in France after the Millau Viaduct.';\n * const output = await generator(text, {\n * max_new_tokens: 100,\n * });\n * // [{ summary_text: ' The Eiffel Tower is about the same height as an 81-storey building and the tallest structure in Paris. It is the second tallest free-standing structure in France after the Millau Viaduct.' }]\n * ```\n */\nclass SummarizationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => SummarizationPipelineType} */ (/** @type {any} */ (Text2TextGenerationPipeline))) {\n /** @type {'summary_text'} */\n _key = 'summary_text';\n\n /**\n * Create a new SummarizationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n}\n\n\n/**\n * @typedef {Object} TranslationSingle\n * @property {string} translation_text The translated text.\n * @typedef {TranslationSingle[]} TranslationOutput\n * \n * @callback TranslationPipelineCallback Translate the text(s) given as inputs.\n * @param {string|string[]} texts Texts to be translated.\n * @param {import('./utils/generation.js').GenerationConfigType} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise}\n * \n * @typedef {TextPipelineConstructorArgs & TranslationPipelineCallback & Disposable} TranslationPipelineType\n */\n\n/**\n * Translates text from one language to another.\n * \n * **Example:** Multilingual translation w/ `Xenova/nllb-200-distilled-600M`.\n * \n * See [here](https://github.com/facebookresearch/flores/blob/main/flores200/README.md#languages-in-flores-200)\n * for the full list of languages and their corresponding codes.\n * \n * ```javascript\n * const translator = await pipeline('translation', 'Xenova/nllb-200-distilled-600M');\n * const output = await translator('जीवन एक चॉकलेट बॉक्स की तरह है।', {\n * src_lang: 'hin_Deva', // Hindi\n * tgt_lang: 'fra_Latn', // French\n * });\n * // [{ translation_text: 'La vie est comme une boîte à chocolat.' }]\n * ```\n * \n * **Example:** Multilingual translation w/ `Xenova/m2m100_418M`.\n * \n * See [here](https://huggingface.co/facebook/m2m100_418M#languages-covered)\n * for the full list of languages and their corresponding codes.\n * \n * ```javascript\n * const translator = await pipeline('translation', 'Xenova/m2m100_418M');\n * const output = await translator('生活就像一盒巧克力。', {\n * src_lang: 'zh', // Chinese\n * tgt_lang: 'en', // English\n * });\n * // [{ translation_text: 'Life is like a box of chocolate.' }]\n * ```\n * \n * **Example:** Multilingual translation w/ `Xenova/mbart-large-50-many-to-many-mmt`.\n * \n * See [here](https://huggingface.co/facebook/mbart-large-50-many-to-many-mmt#languages-covered)\n * for the full list of languages and their corresponding codes.\n * \n * ```javascript\n * const translator = await pipeline('translation', 'Xenova/mbart-large-50-many-to-many-mmt');\n * const output = await translator('संयुक्त राष्ट्र के प्रमुख का कहना है कि सीरिया में कोई सैन्य समाधान नहीं है', {\n * src_lang: 'hi_IN', // Hindi\n * tgt_lang: 'fr_XX', // French\n * });\n * // [{ translation_text: 'Le chef des Nations affirme qu 'il n 'y a military solution in Syria.' }]\n * ```\n */\nclass TranslationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => TranslationPipelineType} */ (/** @type {any} */ (Text2TextGenerationPipeline))) {\n /** @type {'translation_text'} */\n _key = 'translation_text';\n\n /**\n * Create a new TranslationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n}\n\n\n/**\n * @typedef {Object} TextGenerationSingle\n * @property {string} generated_text The generated text.\n * @typedef {TextGenerationSingle[]} TextGenerationOutput\n * \n * @typedef {Object} TextGenerationSpecificParams Parameters specific to text-generation pipelines.\n * @property {boolean} [add_special_tokens] Whether or not to add special tokens when tokenizing the sequences.\n * @typedef {import('./utils/generation.js').GenerationConfigType & TextGenerationSpecificParams} TextGenerationConfig\n * \n * @callback TextGenerationPipelineCallback Complete the prompt(s) given as inputs.\n * @param {string|string[]} texts One or several prompts (or one list of prompts) to complete.\n * @param {TextGenerationConfig} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise} An array or object containing the generated texts.\n * \n * @typedef {TextPipelineConstructorArgs & TextGenerationPipelineCallback & Disposable} TextGenerationPipelineType\n */\n\n/**\n * Language generation pipeline using any `ModelWithLMHead` or `ModelForCausalLM`.\n * This pipeline predicts the words that will follow a specified text prompt.\n * NOTE: For the full list of generation parameters, see [`GenerationConfig`](./utils/generation#module_utils/generation.GenerationConfig).\n * \n * **Example:** Text generation with `Xenova/distilgpt2` (default settings).\n * ```javascript\n * const generator = await pipeline('text-generation', 'Xenova/distilgpt2');\n * const text = 'I enjoy walking with my cute dog,';\n * const output = await generator(text);\n * // [{ generated_text: \"I enjoy walking with my cute dog, and I love to play with the other dogs.\" }]\n * ```\n * \n * **Example:** Text generation with `Xenova/distilgpt2` (custom settings).\n * ```javascript\n * const generator = await pipeline('text-generation', 'Xenova/distilgpt2');\n * const text = 'Once upon a time, there was';\n * const output = await generator(text, {\n * temperature: 2,\n * max_new_tokens: 10,\n * repetition_penalty: 1.5,\n * no_repeat_ngram_size: 2,\n * num_beams: 2,\n * num_return_sequences: 2,\n * });\n * // [{\n * // \"generated_text\": \"Once upon a time, there was an abundance of information about the history and activities that\"\n * // }, {\n * // \"generated_text\": \"Once upon a time, there was an abundance of information about the most important and influential\"\n * // }]\n * ```\n * \n * **Example:** Run code generation with `Xenova/codegen-350M-mono`.\n * ```javascript\n * const generator = await pipeline('text-generation', 'Xenova/codegen-350M-mono');\n * const text = 'def fib(n):';\n * const output = await generator(text, {\n * max_new_tokens: 44,\n * });\n * // [{\n * // generated_text: 'def fib(n):\\n' +\n * // ' if n == 0:\\n' +\n * // ' return 0\\n' +\n * // ' elif n == 1:\\n' +\n * // ' return 1\\n' +\n * // ' else:\\n' +\n * // ' return fib(n-1) + fib(n-2)\\n'\n * // }]\n * ```\n */\nclass TextGenerationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => TextGenerationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new TextGenerationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {TextGenerationPipelineCallback} */\n async _call(texts, generate_kwargs = {}) {\n\n const isBatched = Array.isArray(texts);\n if (!isBatched) {\n texts = [/** @type {string}*/ (texts)];\n }\n\n // By default, do not add special tokens\n const add_special_tokens = generate_kwargs.add_special_tokens ?? false;\n\n this.tokenizer.padding_side = 'left';\n const { input_ids, attention_mask } = this.tokenizer(texts, {\n add_special_tokens,\n padding: true,\n truncation: true,\n });\n\n const outputTokenIds = await this.model.generate(input_ids, generate_kwargs, null, {\n inputs_attention_mask: attention_mask\n });\n\n const decoded = this.tokenizer.batch_decode(outputTokenIds, {\n skip_special_tokens: true,\n });\n\n /** @type {TextGenerationOutput[]} */\n const toReturn = Array.from({ length: texts.length }, _ => []);\n for (let i = 0; i < decoded.length; ++i) {\n const textIndex = Math.floor(i / outputTokenIds.length * texts.length);\n\n toReturn[textIndex].push({\n generated_text: decoded[i]\n });\n }\n return (!isBatched && toReturn.length === 1) ? toReturn[0] : toReturn;\n }\n}\n\n/**\n * @typedef {Object} ZeroShotClassificationOutput\n * @property {string} sequence The sequence for which this is the output.\n * @property {string[]} labels The labels sorted by order of likelihood.\n * @property {number[]} scores The probabilities for each of the labels.\n * \n * @typedef {Object} ZeroShotClassificationPipelineOptions Parameters specific to zero-shot classification pipelines.\n * @property {string} [hypothesis_template=\"This example is {}.\"] The template used to turn each\n * candidate label into an NLI-style hypothesis. The candidate label will replace the {} placeholder.\n * @property {boolean} [multi_label=false] Whether or not multiple candidate labels can be true.\n * If `false`, the scores are normalized such that the sum of the label likelihoods for each sequence\n * is 1. If `true`, the labels are considered independent and probabilities are normalized for each\n * candidate by doing a softmax of the entailment score vs. the contradiction score.\n * \n * @callback ZeroShotClassificationPipelineCallback Classify the sequence(s) given as inputs.\n * @param {string|string[]} texts The sequence(s) to classify, will be truncated if the model input is too large.\n * @param {string|string[]} candidate_labels The set of possible class labels to classify each sequence into.\n * Can be a single label, a string of comma-separated labels, or a list of labels.\n * @param {ZeroShotClassificationPipelineOptions} [options] The options to use for zero-shot classification.\n * @returns {Promise} An array or object containing the predicted labels and scores.\n * \n * @typedef {TextPipelineConstructorArgs & ZeroShotClassificationPipelineCallback & Disposable} ZeroShotClassificationPipelineType\n */\n\n/**\n * NLI-based zero-shot classification pipeline using a `ModelForSequenceClassification`\n * trained on NLI (natural language inference) tasks. Equivalent of `text-classification`\n * pipelines, but these models don't require a hardcoded number of potential classes, they\n * can be chosen at runtime. It usually means it's slower but it is **much** more flexible.\n * \n * **Example:** Zero shot classification with `Xenova/mobilebert-uncased-mnli`.\n * ```javascript\n * const classifier = await pipeline('zero-shot-classification', 'Xenova/mobilebert-uncased-mnli');\n * const text = 'Last week I upgraded my iOS version and ever since then my phone has been overheating whenever I use your app.';\n * const labels = [ 'mobile', 'billing', 'website', 'account access' ];\n * const output = await classifier(text, labels);\n * // {\n * // sequence: 'Last week I upgraded my iOS version and ever since then my phone has been overheating whenever I use your app.',\n * // labels: [ 'mobile', 'website', 'billing', 'account access' ],\n * // scores: [ 0.5562091040482018, 0.1843621307860853, 0.13942646639336376, 0.12000229877234923 ]\n * // }\n * ```\n * \n * **Example:** Zero shot classification with `Xenova/nli-deberta-v3-xsmall` (multi-label).\n * ```javascript\n * const classifier = await pipeline('zero-shot-classification', 'Xenova/nli-deberta-v3-xsmall');\n * const text = 'I have a problem with my iphone that needs to be resolved asap!';\n * const labels = [ 'urgent', 'not urgent', 'phone', 'tablet', 'computer' ];\n * const output = await classifier(text, labels, { multi_label: true });\n * // {\n * // sequence: 'I have a problem with my iphone that needs to be resolved asap!',\n * // labels: [ 'urgent', 'phone', 'computer', 'tablet', 'not urgent' ],\n * // scores: [ 0.9958870956360275, 0.9923963400697035, 0.002333537946160235, 0.0015134138567598765, 0.0010699384208377163 ]\n * // }\n * ```\n */\nclass ZeroShotClassificationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => ZeroShotClassificationPipelineType} */ (Pipeline)) {\n /**\n * Create a new ZeroShotClassificationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n\n // Use model config to get label2id mapping\n this.label2id = Object.fromEntries(\n Object.entries((/** @type {any} */(this).model).config.label2id).map(\n ([k, v]) => [k.toLowerCase(), v]\n )\n );\n\n this.entailment_id = this.label2id['entailment'];\n if (this.entailment_id === undefined) {\n console.warn(\"Could not find 'entailment' in label2id mapping. Using 2 as entailment_id.\");\n this.entailment_id = 2;\n }\n\n this.contradiction_id = this.label2id['contradiction'] ?? this.label2id['not_entailment'];\n if (this.contradiction_id === undefined) {\n console.warn(\"Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id.\");\n this.contradiction_id = 0;\n }\n }\n\n /** @type {ZeroShotClassificationPipelineCallback} */\n async _call(texts, candidate_labels, {\n hypothesis_template = \"This example is {}.\",\n multi_label = false,\n } = {}) {\n\n const isBatched = Array.isArray(texts);\n if (!isBatched) {\n texts = [/** @type {string} */ (texts)];\n }\n if (!Array.isArray(candidate_labels)) {\n candidate_labels = [candidate_labels];\n }\n\n // Insert labels into hypothesis template\n const hypotheses = candidate_labels.map(\n x => hypothesis_template.replace('{}', x)\n );\n\n // How to perform the softmax over the logits:\n // - true: softmax over the entailment vs. contradiction dim for each label independently\n // - false: softmax the \"entailment\" logits over all candidate labels\n const softmaxEach = multi_label || candidate_labels.length === 1;\n\n /** @type {ZeroShotClassificationOutput[]} */\n const toReturn = [];\n for (const premise of texts) {\n const entails_logits = [];\n\n for (const hypothesis of hypotheses) {\n const inputs = this.tokenizer(premise, {\n text_pair: hypothesis,\n padding: true,\n truncation: true,\n })\n const outputs = await this.model(inputs)\n\n if (softmaxEach) {\n entails_logits.push([\n outputs.logits.data[this.contradiction_id],\n outputs.logits.data[this.entailment_id]\n ])\n } else {\n entails_logits.push(outputs.logits.data[this.entailment_id])\n }\n }\n\n /** @type {number[]} */\n const scores = softmaxEach\n ? entails_logits.map(x => (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(x)[1])\n : (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(entails_logits);\n\n // Sort by scores (desc) and return scores with indices\n const scores_sorted = scores\n .map((x, i) => [x, i])\n .sort((a, b) => (b[0] - a[0]));\n\n toReturn.push({\n sequence: premise,\n labels: scores_sorted.map(x => candidate_labels[x[1]]),\n scores: scores_sorted.map(x => x[0]),\n });\n }\n return isBatched ? toReturn : toReturn[0];\n }\n}\n\n/**\n * @typedef {Object} FeatureExtractionPipelineOptions Parameters specific to feature extraction pipelines.\n * @property {'none'|'mean'|'cls'} [pooling=\"none\"] The pooling method to use.\n * @property {boolean} [normalize=false] Whether or not to normalize the embeddings in the last dimension.\n * \n * @callback FeatureExtractionPipelineCallback Extract the features of the input(s).\n * @param {string|string[]} texts One or several texts (or one list of texts) to get the features of.\n * @param {FeatureExtractionPipelineOptions} [options] The options to use for feature extraction.\n * @returns {Promise} The features computed by the model.\n * \n * @typedef {TextPipelineConstructorArgs & FeatureExtractionPipelineCallback & Disposable} FeatureExtractionPipelineType\n */\n\n/**\n * Feature extraction pipeline using no model head. This pipeline extracts the hidden\n * states from the base transformer, which can be used as features in downstream tasks.\n * \n * **Example:** Run feature extraction with `bert-base-uncased` (without pooling/normalization).\n * ```javascript\n * const extractor = await pipeline('feature-extraction', 'Xenova/bert-base-uncased', { revision: 'default' });\n * const output = await extractor('This is a simple test.');\n * // Tensor {\n * // type: 'float32',\n * // data: Float32Array [0.05939924716949463, 0.021655935794115067, ...],\n * // dims: [1, 8, 768]\n * // }\n * ```\n * \n * **Example:** Run feature extraction with `bert-base-uncased` (with pooling/normalization).\n * ```javascript\n * const extractor = await pipeline('feature-extraction', 'Xenova/bert-base-uncased', { revision: 'default' });\n * const output = await extractor('This is a simple test.', { pooling: 'mean', normalize: true });\n * // Tensor {\n * // type: 'float32',\n * // data: Float32Array [0.03373778983950615, -0.010106077417731285, ...],\n * // dims: [1, 768]\n * // }\n * ```\n * \n * **Example:** Calculating embeddings with `sentence-transformers` models.\n * ```javascript\n * const extractor = await pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2');\n * const output = await extractor('This is a simple test.', { pooling: 'mean', normalize: true });\n * // Tensor {\n * // type: 'float32',\n * // data: Float32Array [0.09094982594251633, -0.014774246141314507, ...],\n * // dims: [1, 384]\n * // }\n * ```\n */\nclass FeatureExtractionPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => FeatureExtractionPipelineType} */ (Pipeline)) {\n /**\n * Create a new FeatureExtractionPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {FeatureExtractionPipelineCallback} */\n async _call(texts, {\n pooling = /** @type {'none'} */('none'),\n normalize = false,\n } = {}) {\n\n // Run tokenization\n const model_inputs = this.tokenizer(texts, {\n padding: true,\n truncation: true,\n });\n\n // Run model\n const outputs = await this.model(model_inputs)\n\n // TODO: Provide warning to the user that they might be using model which was not exported\n // specifically for feature extraction\n // console.log(this.model.config)\n // console.log(outputs)\n\n /** @type {Tensor} */\n let result = outputs.last_hidden_state ?? outputs.logits;\n if (pooling === 'none') {\n // Skip pooling\n } else if (pooling === 'mean') {\n result = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_6__.mean_pooling)(result, model_inputs.attention_mask);\n } else if (pooling === 'cls') {\n result = result.slice(null, 0);\n } else {\n throw Error(`Pooling method '${pooling}' not supported.`);\n }\n\n if (normalize) {\n result = result.normalize(2, -1);\n }\n\n return result;\n }\n}\n\n// TODO\n// export class SentenceSimilarityPipeline extends Pipeline {\n// }\n\n/**\n * @typedef {Object} AudioClassificationSingle\n * @property {string} label The label predicted.\n * @property {number} score The corresponding probability.\n * @typedef {AudioClassificationSingle[]} AudioClassificationOutput\n * \n * @typedef {Object} AudioClassificationPipelineOptions Parameters specific to audio classification pipelines.\n * @property {number} [topk=null] The number of top labels that will be returned by the pipeline.\n * If the provided number is `null` or higher than the number of labels available in the model configuration,\n * it will default to the number of labels.\n * \n * @callback AudioClassificationPipelineCallback Classify the sequence(s) given as inputs.\n * @param {AudioPipelineInputs} audio The input audio file(s) to be classified. The input is either:\n * - `string` or `URL` that is the filename/URL of the audio file, the file will be read at the processor's sampling rate\n * to get the waveform using the [`AudioContext`](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext) API.\n * If `AudioContext` is not available, you should pass the raw waveform in as a Float32Array of shape `(n, )`.\n * - `Float32Array` or `Float64Array` of shape `(n, )`, representing the raw audio at the correct sampling rate (no further check will be done).\n * @param {AudioClassificationPipelineOptions} [options] The options to use for audio classification.\n * @returns {Promise} An array or object containing the predicted labels and scores.\n * \n * @typedef {AudioPipelineConstructorArgs & AudioClassificationPipelineCallback & Disposable} AudioClassificationPipelineType\n */\n\n/**\n * Audio classification pipeline using any `AutoModelForAudioClassification`.\n * This pipeline predicts the class of a raw waveform or an audio file.\n * \n * **Example:** Perform audio classification with `Xenova/wav2vec2-large-xlsr-53-gender-recognition-librispeech`.\n * ```javascript\n * const classifier = await pipeline('audio-classification', 'Xenova/wav2vec2-large-xlsr-53-gender-recognition-librispeech');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';\n * const output = await classifier(url);\n * // [\n * // { label: 'male', score: 0.9981542229652405 },\n * // { label: 'female', score: 0.001845747814513743 }\n * // ]\n * ```\n * \n * **Example:** Perform audio classification with `Xenova/ast-finetuned-audioset-10-10-0.4593` and return top 4 results.\n * ```javascript\n * const classifier = await pipeline('audio-classification', 'Xenova/ast-finetuned-audioset-10-10-0.4593');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cat_meow.wav';\n * const output = await classifier(url, { topk: 4 });\n * // [\n * // { label: 'Meow', score: 0.5617874264717102 },\n * // { label: 'Cat', score: 0.22365376353263855 },\n * // { label: 'Domestic animals, pets', score: 0.1141069084405899 },\n * // { label: 'Animal', score: 0.08985692262649536 },\n * // ]\n * ```\n */\nclass AudioClassificationPipeline extends (/** @type {new (options: AudioPipelineConstructorArgs) => AudioClassificationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new AudioClassificationPipeline.\n * @param {AudioPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {AudioClassificationPipelineCallback} */\n async _call(audio, {\n topk = null\n } = {}) {\n\n const single = !Array.isArray(audio);\n\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\n const preparedAudios = await prepareAudios(audio, sampling_rate);\n\n const id2label = this.model.config.id2label;\n\n const toReturn = [];\n for (const aud of preparedAudios) {\n const inputs = await this.processor(aud);\n const output = await this.model(inputs);\n const logits = output.logits[0];\n\n const scores = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.getTopItems)((0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(logits.data), topk);\n\n const vals = scores.map(x => ({\n label: /** @type {string} */ (id2label[x[0]]),\n score: /** @type {number} */ (x[1]),\n }));\n\n if (topk === 1) {\n toReturn.push(...vals);\n } else {\n toReturn.push(vals);\n }\n }\n return !single || topk === 1 ? /** @type {AudioClassificationOutput} */ (toReturn) : /** @type {AudioClassificationOutput[]} */ (toReturn)[0];\n }\n}\n\n/**\n * @typedef {Object} ZeroShotAudioClassificationOutput\n * @property {string} label The label identified by the model. It is one of the suggested `candidate_label`.\n * @property {number} score The score attributed by the model for that label (between 0 and 1).\n * \n * @typedef {Object} ZeroShotAudioClassificationPipelineOptions Parameters specific to zero-shot audio classification pipelines.\n * @property {string} [hypothesis_template=\"This is a sound of {}.\"] The sentence used in conjunction with `candidate_labels`\n * to attempt the audio classification by replacing the placeholder with the candidate_labels.\n * Then likelihood is estimated by using `logits_per_audio`.\n * \n * @callback ZeroShotAudioClassificationPipelineCallback Classify the sequence(s) given as inputs.\n * @param {AudioPipelineInputs} audio The input audio file(s) to be classified. The input is either:\n * - `string` or `URL` that is the filename/URL of the audio file, the file will be read at the processor's sampling rate\n * to get the waveform using the [`AudioContext`](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext) API.\n * If `AudioContext` is not available, you should pass the raw waveform in as a Float32Array of shape `(n, )`.\n * - `Float32Array` or `Float64Array` of shape `(n, )`, representing the raw audio at the correct sampling rate (no further check will be done).\n * @param {string[]} candidate_labels The candidate labels for this audio.\n * @param {ZeroShotAudioClassificationPipelineOptions} [options] The options to use for zero-shot audio classification.\n * @returns {Promise} An array of objects containing the predicted labels and scores.\n * \n * @typedef {TextAudioPipelineConstructorArgs & ZeroShotAudioClassificationPipelineCallback & Disposable} ZeroShotAudioClassificationPipelineType\n */\n\n/**\n * Zero shot audio classification pipeline using `ClapModel`. This pipeline predicts the class of an audio when you\n * provide an audio and a set of `candidate_labels`.\n * \n * **Example**: Perform zero-shot audio classification with `Xenova/clap-htsat-unfused`.\n * ```javascript\n * const classifier = await pipeline('zero-shot-audio-classification', 'Xenova/clap-htsat-unfused');\n * const audio = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/dog_barking.wav';\n * const candidate_labels = ['dog', 'vaccum cleaner'];\n * const scores = await classifier(audio, candidate_labels);\n * // [\n * // { score: 0.9993992447853088, label: 'dog' },\n * // { score: 0.0006007603369653225, label: 'vaccum cleaner' }\n * // ]\n * ```\n */\nclass ZeroShotAudioClassificationPipeline extends (/** @type {new (options: TextAudioPipelineConstructorArgs) => ZeroShotAudioClassificationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new ZeroShotAudioClassificationPipeline.\n * @param {TextAudioPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ZeroShotAudioClassificationPipelineCallback} */\n async _call(audio, candidate_labels, {\n hypothesis_template = \"This is a sound of {}.\"\n } = {}) {\n\n const single = !Array.isArray(audio);\n if (single) {\n audio = [/** @type {AudioInput} */ (audio)];\n }\n\n // Insert label into hypothesis template \n const texts = candidate_labels.map(\n x => hypothesis_template.replace('{}', x)\n );\n\n // Run tokenization\n const text_inputs = this.tokenizer(texts, {\n padding: true,\n truncation: true,\n });\n\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\n const preparedAudios = await prepareAudios(audio, sampling_rate);\n\n const toReturn = [];\n for (const aud of preparedAudios) {\n const audio_inputs = await this.processor(aud);\n\n // Run model with both text and audio inputs\n const output = await this.model({ ...text_inputs, ...audio_inputs });\n\n // Compute softmax per audio\n const probs = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(output.logits_per_audio.data);\n\n toReturn.push([...probs].map((x, i) => ({\n score: x,\n label: candidate_labels[i]\n })));\n }\n return single ? toReturn[0] : toReturn;\n }\n}\n\n/**\n * @typedef {{stride: number[], input_features: Tensor, is_last: boolean, tokens?: number[], token_timestamps?: number[]}} ChunkCallbackItem\n * @callback ChunkCallback\n * @param {ChunkCallbackItem} chunk The chunk to process.\n */\n\n/**\n * @typedef {Object} Chunk\n * @property {[number, number]} timestamp The start and end timestamp of the chunk in seconds.\n * @property {string} text The recognized text.\n */\n\n/**\n * @typedef {Object} AutomaticSpeechRecognitionOutput\n * @property {string} text The recognized text.\n * @property {Chunk[]} [chunks] When using `return_timestamps`, the `chunks` will become a list\n * containing all the various text chunks identified by the model.\n * \n * @typedef {Object} AutomaticSpeechRecognitionSpecificParams Parameters specific to automatic-speech-recognition pipelines.\n * @property {boolean|'word'} [kwargs.return_timestamps] Whether to return timestamps or not. Default is `false`.\n * @property {number} [kwargs.chunk_length_s] The length of audio chunks to process in seconds. Default is 0 (no chunking).\n * @property {number} [kwargs.stride_length_s] The length of overlap between consecutive audio chunks in seconds. If not provided, defaults to `chunk_length_s / 6`.\n * @property {ChunkCallback} [kwargs.chunk_callback] Callback function to be called with each chunk processed.\n * @property {boolean} [kwargs.force_full_sequences] Whether to force outputting full sequences or not. Default is `false`.\n * @property {string} [kwargs.language] The source language. Default is `null`, meaning it should be auto-detected. Use this to potentially improve performance if the source language is known.\n * @property {string} [kwargs.task] The task to perform. Default is `null`, meaning it should be auto-detected.\n * @property {number[][]} [kwargs.forced_decoder_ids] A list of pairs of integers which indicates a mapping from generation indices to token indices\n * that will be forced before sampling. For example, [[1, 123]] means the second generated token will always be a token of index 123.\n * @property {number} [num_frames] The number of frames in the input audio.\n * @typedef {import('./utils/generation.js').GenerationConfigType & AutomaticSpeechRecognitionSpecificParams} AutomaticSpeechRecognitionConfig\n * \n * @callback AutomaticSpeechRecognitionPipelineCallback Transcribe the audio sequence(s) given as inputs to text.\n * @param {AudioPipelineInputs} audio The input audio file(s) to be transcribed. The input is either:\n * - `string` or `URL` that is the filename/URL of the audio file, the file will be read at the processor's sampling rate\n * to get the waveform using the [`AudioContext`](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext) API.\n * If `AudioContext` is not available, you should pass the raw waveform in as a Float32Array of shape `(n, )`.\n * - `Float32Array` or `Float64Array` of shape `(n, )`, representing the raw audio at the correct sampling rate (no further check will be done).\n * @param {AutomaticSpeechRecognitionConfig} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise} An object containing the transcription text and optionally timestamps if `return_timestamps` is `true`.\n * \n * @typedef {TextAudioPipelineConstructorArgs & AutomaticSpeechRecognitionPipelineCallback & Disposable} AutomaticSpeechRecognitionPipelineType\n */\n\n/**\n * Pipeline that aims at extracting spoken text contained within some audio.\n *\n * **Example:** Transcribe English.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';\n * const output = await transcriber(url);\n * // { text: \" And so my fellow Americans ask not what your country can do for you, ask what you can do for your country.\" }\n * ```\n * \n * **Example:** Transcribe English w/ timestamps.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';\n * const output = await transcriber(url, { return_timestamps: true });\n * // {\n * // text: \" And so my fellow Americans ask not what your country can do for you, ask what you can do for your country.\"\n * // chunks: [\n * // { timestamp: [0, 8], text: \" And so my fellow Americans ask not what your country can do for you\" }\n * // { timestamp: [8, 11], text: \" ask what you can do for your country.\" }\n * // ]\n * // }\n * ```\n * \n * **Example:** Transcribe English w/ word-level timestamps.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';\n * const output = await transcriber(url, { return_timestamps: 'word' });\n * // {\n * // \"text\": \" And so my fellow Americans ask not what your country can do for you ask what you can do for your country.\",\n * // \"chunks\": [\n * // { \"text\": \" And\", \"timestamp\": [0, 0.78] },\n * // { \"text\": \" so\", \"timestamp\": [0.78, 1.06] },\n * // { \"text\": \" my\", \"timestamp\": [1.06, 1.46] },\n * // ...\n * // { \"text\": \" for\", \"timestamp\": [9.72, 9.92] },\n * // { \"text\": \" your\", \"timestamp\": [9.92, 10.22] },\n * // { \"text\": \" country.\", \"timestamp\": [10.22, 13.5] }\n * // ]\n * // }\n * ```\n * \n * **Example:** Transcribe French.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-small');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/french-audio.mp3';\n * const output = await transcriber(url, { language: 'french', task: 'transcribe' });\n * // { text: \" J'adore, j'aime, je n'aime pas, je déteste.\" }\n * ```\n * \n * **Example:** Translate French to English.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-small');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/french-audio.mp3';\n * const output = await transcriber(url, { language: 'french', task: 'translate' });\n * // { text: \" I love, I like, I don't like, I hate.\" }\n * ```\n * \n * **Example:** Transcribe/translate audio longer than 30 seconds.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/ted_60.wav';\n * const output = await transcriber(url, { chunk_length_s: 30, stride_length_s: 5 });\n * // { text: \" So in college, I was a government major, which means [...] So I'd start off light and I'd bump it up\" }\n * ```\n */\nclass AutomaticSpeechRecognitionPipeline extends (/** @type {new (options: TextAudioPipelineConstructorArgs) => AutomaticSpeechRecognitionPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new AutomaticSpeechRecognitionPipeline.\n * @param {TextAudioPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {AutomaticSpeechRecognitionPipelineCallback} */\n async _call(audio, kwargs = {}) {\n switch (this.model.config.model_type) {\n case 'whisper':\n return this._call_whisper(audio, kwargs)\n case 'wav2vec2':\n case 'wav2vec2-bert':\n case 'hubert':\n return this._call_wav2vec2(audio, kwargs)\n default:\n throw new Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)\n }\n }\n\n /**\n * @type {AutomaticSpeechRecognitionPipelineCallback}\n * @private\n */\n async _call_wav2vec2(audio, kwargs = {}) {\n // TODO use kwargs\n\n if (kwargs.language) {\n console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to \"English\".');\n }\n if (kwargs.task) {\n console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to \"transcribe\".');\n }\n\n const single = !Array.isArray(audio);\n if (single) {\n audio = [/** @type {AudioInput} */ (audio)];\n }\n\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\n const preparedAudios = await prepareAudios(audio, sampling_rate);\n\n const toReturn = [];\n for (const aud of preparedAudios) {\n const inputs = await this.processor(aud);\n const output = await this.model(inputs);\n const logits = output.logits[0];\n\n const predicted_ids = [];\n for (const item of logits) {\n predicted_ids.push((0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.max)(item.data)[1])\n }\n const predicted_sentences = this.tokenizer.decode(predicted_ids)\n toReturn.push({ text: predicted_sentences })\n }\n return single ? toReturn[0] : toReturn;\n }\n\n /**\n * @type {AutomaticSpeechRecognitionPipelineCallback}\n * @private\n */\n async _call_whisper(audio, kwargs = {}) {\n\n const return_timestamps = kwargs.return_timestamps ?? false;\n const chunk_length_s = kwargs.chunk_length_s ?? 0;\n const chunk_callback = kwargs.chunk_callback ?? null;\n const force_full_sequences = kwargs.force_full_sequences ?? false;\n let stride_length_s = kwargs.stride_length_s ?? null;\n\n if (return_timestamps === 'word') {\n kwargs['return_token_timestamps'] = true;\n }\n\n const language = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_3__.pop)(kwargs, 'language', null);\n const task = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_3__.pop)(kwargs, 'task', null);\n\n if (language || task || return_timestamps) {\n if (kwargs.forced_decoder_ids) {\n throw new Error(\"Cannot specify `language`/`task`/`return_timestamps` and `forced_decoder_ids` at the same time.\")\n }\n // @ts-ignore\n const decoder_prompt_ids = this.tokenizer.get_decoder_prompt_ids({ language, task, no_timestamps: !return_timestamps })\n if (decoder_prompt_ids.length > 0) {\n kwargs.forced_decoder_ids = decoder_prompt_ids;\n }\n }\n\n const single = !Array.isArray(audio);\n if (single) {\n audio = [/** @type {AudioInput} */ (audio)];\n }\n\n const time_precision = this.processor.feature_extractor.config.chunk_length / this.model.config.max_source_positions;\n const hop_length = this.processor.feature_extractor.config.hop_length;\n\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\n const preparedAudios = await prepareAudios(audio, sampling_rate);\n\n const toReturn = [];\n for (const aud of preparedAudios) {\n /** @type {ChunkCallbackItem[]} */\n let chunks = [];\n if (chunk_length_s > 0) {\n if (stride_length_s === null) {\n stride_length_s = chunk_length_s / 6;\n } else if (chunk_length_s <= stride_length_s) {\n throw Error(\"`chunk_length_s` must be larger than `stride_length_s`.\")\n }\n\n // TODO support different stride_length_s (for left and right)\n\n const window = sampling_rate * chunk_length_s;\n const stride = sampling_rate * stride_length_s;\n const jump = window - 2 * stride;\n let offset = 0;\n\n // Create subarrays of audio with overlaps\n\n while (offset < aud.length) {\n const subarr = aud.subarray(offset, offset + window);\n const feature = await this.processor(subarr);\n\n const isFirst = offset === 0;\n const isLast = offset + jump >= aud.length;\n chunks.push({\n stride: [\n subarr.length,\n isFirst ? 0 : stride,\n isLast ? 0 : stride\n ],\n input_features: feature.input_features,\n is_last: isLast\n })\n offset += jump;\n }\n\n } else {\n chunks = [{\n stride: [aud.length, 0, 0],\n input_features: (await this.processor(aud)).input_features,\n is_last: true\n }]\n }\n\n // Generate for each set of input features\n for (const chunk of chunks) {\n kwargs.num_frames = Math.floor(chunk.stride[0] / hop_length);\n\n // NOTE: doing sequentially for now\n const data = await this.model.generate(chunk.input_features, kwargs);\n\n // TODO: Right now we only get top beam\n if (return_timestamps === 'word') {\n chunk.tokens = data.sequences[0];\n chunk.token_timestamps = data.token_timestamps.tolist()[0].map(\n (/** @type {number} */ x) => (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.round)(x, 2)\n );\n\n } else {\n chunk.tokens = data[0];\n }\n\n // convert stride to seconds\n chunk.stride = chunk.stride.map(x => x / sampling_rate);\n\n if (chunk_callback !== null) {\n chunk_callback(chunk)\n }\n }\n\n // Merge text chunks\n // @ts-ignore\n const [full_text, optional] = this.tokenizer._decode_asr(chunks, {\n time_precision, return_timestamps, force_full_sequences\n });\n\n toReturn.push({ text: full_text, ...optional })\n }\n return single ? toReturn[0] : toReturn;\n }\n}\n\n/**\n * @typedef {Object} ImageToTextSingle\n * @property {string} generated_text The generated text.\n * @typedef {ImageToTextSingle[]} ImageToTextOutput\n * \n * @callback ImageToTextPipelineCallback Assign labels to the image(s) passed as inputs.\n * @param {ImagePipelineInputs} texts The images to be captioned.\n * @param {import('./utils/generation.js').GenerationConfigType} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise} An object (or array of objects) containing the generated text(s).\n * \n * @typedef {TextImagePipelineConstructorArgs & ImageToTextPipelineCallback & Disposable} ImageToTextPipelineType\n */\n\n/**\n * Image To Text pipeline using a `AutoModelForVision2Seq`. This pipeline predicts a caption for a given image.\n * \n * **Example:** Generate a caption for an image w/ `Xenova/vit-gpt2-image-captioning`.\n * ```javascript\n * const captioner = await pipeline('image-to-text', 'Xenova/vit-gpt2-image-captioning');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';\n * const output = await captioner(url);\n * // [{ generated_text: 'a cat laying on a couch with another cat' }]\n * ```\n * \n * **Example:** Optical Character Recognition (OCR) w/ `Xenova/trocr-small-handwritten`.\n * ```javascript\n * const captioner = await pipeline('image-to-text', 'Xenova/trocr-small-handwritten');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/handwriting.jpg';\n * const output = await captioner(url);\n * // [{ generated_text: 'Mr. Brown commented icily.' }]\n * ```\n */\nclass ImageToTextPipeline extends (/** @type {new (options: TextImagePipelineConstructorArgs) => ImageToTextPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new ImageToTextPipeline.\n * @param {TextImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ImageToTextPipelineCallback} */\n async _call(images, generate_kwargs = {}) {\n\n const isBatched = Array.isArray(images);\n const preparedImages = await prepareImages(images);\n\n const { pixel_values } = await this.processor(preparedImages);\n\n const toReturn = [];\n for (const batch of pixel_values) {\n batch.dims = [1, ...batch.dims]\n const output = await this.model.generate(batch, generate_kwargs);\n const decoded = this.tokenizer.batch_decode(output, {\n skip_special_tokens: true,\n }).map(x => ({ generated_text: x.trim() }))\n toReturn.push(decoded);\n }\n\n return isBatched ? toReturn : toReturn[0];\n }\n}\n\n/**\n * @typedef {Object} ImageClassificationSingle\n * @property {string} label The label identified by the model.\n * @property {number} score The score attributed by the model for that label.\n * @typedef {ImageClassificationSingle[]} ImageClassificationOutput\n * \n * @typedef {Object} ImageClassificationPipelineOptions Parameters specific to image classification pipelines.\n * @property {number} [topk=1] The number of top labels that will be returned by the pipeline. \n * \n * @callback ImageClassificationPipelineCallback Assign labels to the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The input images(s) to be classified.\n * @param {ImageClassificationPipelineOptions} [options] The options to use for image classification.\n * @returns {Promise} An array or object containing the predicted labels and scores.\n * \n * @typedef {ImagePipelineConstructorArgs & ImageClassificationPipelineCallback & Disposable} ImageClassificationPipelineType\n */\n\n/**\n * Image classification pipeline using any `AutoModelForImageClassification`.\n * This pipeline predicts the class of an image.\n * \n * **Example:** Classify an image.\n * ```javascript\n * const classifier = await pipeline('image-classification', 'Xenova/vit-base-patch16-224');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';\n * const output = await classifier(url);\n * // [\n * // { label: 'tiger, Panthera tigris', score: 0.632695734500885 },\n * // ]\n * ```\n * \n * **Example:** Classify an image and return top `n` classes.\n * ```javascript\n * const classifier = await pipeline('image-classification', 'Xenova/vit-base-patch16-224');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';\n * const output = await classifier(url, { topk: 3 });\n * // [\n * // { label: 'tiger, Panthera tigris', score: 0.632695734500885 },\n * // { label: 'tiger cat', score: 0.3634825646877289 },\n * // { label: 'lion, king of beasts, Panthera leo', score: 0.00045060308184474707 },\n * // ]\n * ```\n * \n * **Example:** Classify an image and return all classes.\n * ```javascript\n * const classifier = await pipeline('image-classification', 'Xenova/vit-base-patch16-224');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';\n * const output = await classifier(url, { topk: 0 });\n * // [\n * // { label: 'tiger, Panthera tigris', score: 0.632695734500885 },\n * // { label: 'tiger cat', score: 0.3634825646877289 },\n * // { label: 'lion, king of beasts, Panthera leo', score: 0.00045060308184474707 },\n * // { label: 'jaguar, panther, Panthera onca, Felis onca', score: 0.00035465499968267977 },\n * // ...\n * // ]\n * ```\n */\nclass ImageClassificationPipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => ImageClassificationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new ImageClassificationPipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ImageClassificationPipelineCallback} */\n async _call(images, {\n topk = 1\n } = {}) {\n\n const isBatched = Array.isArray(images);\n const preparedImages = await prepareImages(images);\n\n const { pixel_values } = await this.processor(preparedImages);\n const output = await this.model({ pixel_values });\n\n const id2label = this.model.config.id2label;\n const toReturn = [];\n for (const batch of output.logits) {\n const scores = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.getTopItems)((0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(batch.data), topk);\n\n const vals = scores.map(x => ({\n label: id2label[x[0]],\n score: x[1],\n }));\n if (topk === 1) {\n toReturn.push(...vals);\n } else {\n toReturn.push(vals);\n }\n }\n\n return isBatched || topk === 1 ? /** @type {ImageClassificationOutput} */ (toReturn) : /** @type {ImageClassificationOutput[]} */ (toReturn)[0];\n }\n\n}\n\n/**\n * @typedef {Object} ImageSegmentationPipelineOutput\n * @property {string} label The label of the segment.\n * @property {number|null} score The score of the segment.\n * @property {RawImage} mask The mask of the segment.\n * \n * @typedef {Object} ImageSegmentationPipelineOptions Parameters specific to image segmentation pipelines.\n * @property {number} [threshold=0.5] Probability threshold to filter out predicted masks.\n * @property {number} [mask_threshold=0.5] Threshold to use when turning the predicted masks into binary values.\n * @property {number} [overlap_mask_area_threshold=0.8] Mask overlap threshold to eliminate small, disconnected segments.\n * @property {null|string} [subtask=null] Segmentation task to be performed. One of [`panoptic`, `instance`, and `semantic`],\n * depending on model capabilities. If not set, the pipeline will attempt to resolve (in that order).\n * @property {number[]} [label_ids_to_fuse=null] List of label ids to fuse. If not set, do not fuse any labels.\n * @property {number[][]} [target_sizes=null] List of target sizes for the input images. If not set, use the original image sizes.\n * \n * @callback ImageSegmentationPipelineCallback Segment the input images.\n * @param {ImagePipelineInputs} images The input images.\n * @param {ImageSegmentationPipelineOptions} [options] The options to use for image segmentation.\n * @returns {Promise} The annotated segments.\n * \n * @typedef {ImagePipelineConstructorArgs & ImageSegmentationPipelineCallback & Disposable} ImageSegmentationPipelineType\n */\n\n/**\n * Image segmentation pipeline using any `AutoModelForXXXSegmentation`.\n * This pipeline predicts masks of objects and their classes.\n * \n * **Example:** Perform image segmentation with `Xenova/detr-resnet-50-panoptic`.\n * ```javascript\n * const segmenter = await pipeline('image-segmentation', 'Xenova/detr-resnet-50-panoptic');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';\n * const output = await segmenter(url);\n * // [\n * // { label: 'remote', score: 0.9984649419784546, mask: RawImage { ... } },\n * // { label: 'cat', score: 0.9994316101074219, mask: RawImage { ... } }\n * // ]\n * ```\n */\nclass ImageSegmentationPipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => ImageSegmentationPipelineType} */ (Pipeline)) {\n /**\n * Create a new ImageSegmentationPipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n\n this.subtasks_mapping = {\n // Mapping of subtasks to their corresponding post-processing function names.\n panoptic: 'post_process_panoptic_segmentation',\n instance: 'post_process_instance_segmentation',\n semantic: 'post_process_semantic_segmentation'\n }\n }\n\n /** @type {ImageSegmentationPipelineCallback} */\n async _call(images, {\n threshold = 0.5,\n mask_threshold = 0.5,\n overlap_mask_area_threshold = 0.8,\n label_ids_to_fuse = null,\n target_sizes = null,\n subtask = null,\n } = {}) {\n const isBatched = Array.isArray(images);\n\n if (isBatched && images.length !== 1) {\n throw Error(\"Image segmentation pipeline currently only supports a batch size of 1.\");\n }\n\n const preparedImages = await prepareImages(images);\n const imageSizes = preparedImages.map(x => [x.height, x.width]);\n\n const { pixel_values, pixel_mask } = await this.processor(preparedImages);\n const output = await this.model({ pixel_values, pixel_mask });\n\n let fn = null;\n if (subtask !== null) {\n fn = this.subtasks_mapping[subtask];\n } else {\n for (let [task, func] of Object.entries(this.subtasks_mapping)) {\n if (func in this.processor.feature_extractor) {\n fn = this.processor.feature_extractor[func].bind(this.processor.feature_extractor);\n subtask = task;\n break;\n }\n }\n }\n\n const id2label = this.model.config.id2label;\n\n /** @type {ImageSegmentationPipelineOutput[]} */\n const annotation = [];\n if (subtask === 'panoptic' || subtask === 'instance') {\n const processed = fn(\n output,\n threshold,\n mask_threshold,\n overlap_mask_area_threshold,\n label_ids_to_fuse,\n target_sizes ?? imageSizes, // TODO FIX?\n )[0];\n\n const segmentation = processed.segmentation;\n\n for (const segment of processed.segments_info) {\n const maskData = new Uint8ClampedArray(segmentation.data.length);\n for (let i = 0; i < segmentation.data.length; ++i) {\n if (segmentation.data[i] === segment.id) {\n maskData[i] = 255;\n }\n }\n\n const mask = new _utils_image_js__WEBPACK_IMPORTED_MODULE_7__.RawImage(maskData, segmentation.dims[1], segmentation.dims[0], 1)\n\n annotation.push({\n score: segment.score,\n label: id2label[segment.label_id],\n mask: mask\n })\n }\n\n } else if (subtask === 'semantic') {\n const { segmentation, labels } = fn(output, target_sizes ?? imageSizes)[0];\n\n for (const label of labels) {\n const maskData = new Uint8ClampedArray(segmentation.data.length);\n for (let i = 0; i < segmentation.data.length; ++i) {\n if (segmentation.data[i] === label) {\n maskData[i] = 255;\n }\n }\n\n const mask = new _utils_image_js__WEBPACK_IMPORTED_MODULE_7__.RawImage(maskData, segmentation.dims[1], segmentation.dims[0], 1);\n\n annotation.push({\n score: null,\n label: id2label[label],\n mask: mask\n });\n }\n } else {\n throw Error(`Subtask ${subtask} not supported.`);\n }\n\n return annotation;\n }\n}\n\n/**\n * @typedef {Object} ZeroShotImageClassificationOutput\n * @property {string} label The label identified by the model. It is one of the suggested `candidate_label`.\n * @property {number} score The score attributed by the model for that label (between 0 and 1).\n * \n * @typedef {Object} ZeroShotImageClassificationPipelineOptions Parameters specific to zero-shot image classification pipelines.\n * @property {string} [hypothesis_template=\"This is a photo of {}\"] The sentence used in conjunction with `candidate_labels`\n * to attempt the image classification by replacing the placeholder with the candidate_labels.\n * Then likelihood is estimated by using `logits_per_image`.\n * \n * @callback ZeroShotImageClassificationPipelineCallback Assign labels to the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The input images.\n * @param {string[]} candidate_labels The candidate labels for this image.\n * @param {ZeroShotImageClassificationPipelineOptions} [options] The options to use for zero-shot image classification.\n * @returns {Promise} An array of objects containing the predicted labels and scores.\n * \n * @typedef {TextImagePipelineConstructorArgs & ZeroShotImageClassificationPipelineCallback & Disposable} ZeroShotImageClassificationPipelineType\n */\n\n/**\n * Zero shot image classification pipeline. This pipeline predicts the class of\n * an image when you provide an image and a set of `candidate_labels`.\n * \n * **Example:** Zero shot image classification w/ `Xenova/clip-vit-base-patch32`.\n * ```javascript\n * const classifier = await pipeline('zero-shot-image-classification', 'Xenova/clip-vit-base-patch32');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';\n * const output = await classifier(url, ['tiger', 'horse', 'dog']);\n * // [\n * // { score: 0.9993917942047119, label: 'tiger' },\n * // { score: 0.0003519294841680676, label: 'horse' },\n * // { score: 0.0002562698791734874, label: 'dog' }\n * // ]\n * ```\n */\nclass ZeroShotImageClassificationPipeline extends (/** @type {new (options: TextImagePipelineConstructorArgs) => ZeroShotImageClassificationPipelineType} */ (Pipeline)) {\n /**\n * Create a new ZeroShotImageClassificationPipeline.\n * @param {TextImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ZeroShotImageClassificationPipelineCallback} */\n async _call(images, candidate_labels, {\n hypothesis_template = \"This is a photo of {}\"\n } = {}) {\n\n const isBatched = Array.isArray(images);\n const preparedImages = await prepareImages(images);\n\n // Insert label into hypothesis template \n const texts = candidate_labels.map(\n x => hypothesis_template.replace('{}', x)\n );\n\n // Run tokenization\n const text_inputs = this.tokenizer(texts, {\n padding: this.model.config.model_type === 'siglip' ? 'max_length' : true,\n truncation: true,\n });\n\n // Run processor\n const { pixel_values } = await this.processor(preparedImages);\n\n // Run model with both text and pixel inputs\n const output = await this.model({ ...text_inputs, pixel_values });\n\n const function_to_apply =\n this.model.config.model_type === 'siglip'\n ? batch => batch.sigmoid().data\n : batch => (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(batch.data);\n\n // Compare each image with each candidate label\n const toReturn = [];\n for (const batch of output.logits_per_image) {\n // Compute softmax per image\n const probs = function_to_apply(batch);\n\n const result = [...probs].map((x, i) => ({\n score: x,\n label: candidate_labels[i]\n }));\n result.sort((a, b) => b.score - a.score); // sort by score in descending order\n toReturn.push(result);\n }\n\n return isBatched ? toReturn : toReturn[0];\n }\n}\n\n\n/**\n * @typedef {Object} ObjectDetectionPipelineSingle\n * @property {string} label The class label identified by the model.\n * @property {number} score The score attributed by the model for that label.\n * @property {BoundingBox} box The bounding box of detected object in image's original size, or as a percentage if `percentage` is set to true.\n * @typedef {ObjectDetectionPipelineSingle[]} ObjectDetectionPipelineOutput\n * \n * @typedef {Object} ObjectDetectionPipelineOptions Parameters specific to object detection pipelines.\n * @property {number} [threshold=0.9] The threshold used to filter boxes by score.\n * @property {boolean} [percentage=false] Whether to return the boxes coordinates in percentage (true) or in pixels (false).\n * \n * @callback ObjectDetectionPipelineCallback Detect objects (bounding boxes & classes) in the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The input images.\n * @param {ObjectDetectionPipelineOptions} [options] The options to use for object detection.\n * @returns {Promise} A list of objects or a list of list of objects. \n * \n * @typedef {ImagePipelineConstructorArgs & ObjectDetectionPipelineCallback & Disposable} ObjectDetectionPipelineType\n */\n\n/**\n * Object detection pipeline using any `AutoModelForObjectDetection`.\n * This pipeline predicts bounding boxes of objects and their classes.\n * \n * **Example:** Run object-detection with `Xenova/detr-resnet-50`.\n * ```javascript\n * const detector = await pipeline('object-detection', 'Xenova/detr-resnet-50');\n * const img = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';\n * const output = await detector(img, { threshold: 0.9 });\n * // [{\n * // score: 0.9976370930671692,\n * // label: \"remote\",\n * // box: { xmin: 31, ymin: 68, xmax: 190, ymax: 118 }\n * // },\n * // ...\n * // {\n * // score: 0.9984092116355896,\n * // label: \"cat\",\n * // box: { xmin: 331, ymin: 19, xmax: 649, ymax: 371 }\n * // }]\n * ```\n */\nclass ObjectDetectionPipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => ObjectDetectionPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new ObjectDetectionPipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ObjectDetectionPipelineCallback} */\n async _call(images, {\n threshold = 0.9,\n percentage = false,\n } = {}) {\n\n const isBatched = Array.isArray(images);\n\n if (isBatched && images.length !== 1) {\n throw Error(\"Object detection pipeline currently only supports a batch size of 1.\");\n }\n const preparedImages = await prepareImages(images);\n\n const imageSizes = percentage ? null : preparedImages.map(x => [x.height, x.width]);\n\n const { pixel_values, pixel_mask } = await this.processor(preparedImages);\n const output = await this.model({ pixel_values, pixel_mask });\n\n // @ts-ignore\n const processed = this.processor.feature_extractor.post_process_object_detection(output, threshold, imageSizes);\n\n // Add labels\n const id2label = this.model.config.id2label;\n\n // Format output\n /** @type {ObjectDetectionPipelineOutput[]} */\n const result = processed.map(batch => (\n batch.boxes.map((box, i) => ({\n score: batch.scores[i],\n label: id2label[batch.classes[i]],\n box: get_bounding_box(box, !percentage),\n }))\n ))\n\n return isBatched ? result : result[0];\n }\n}\n\n\n/**\n * @typedef {Object} ZeroShotObjectDetectionOutput\n * @property {string} label Text query corresponding to the found object.\n * @property {number} score Score corresponding to the object (between 0 and 1).\n * @property {BoundingBox} box Bounding box of the detected object in image's original size, or as a percentage if `percentage` is set to true.\n * \n * @typedef {Object} ZeroShotObjectDetectionPipelineOptions Parameters specific to zero-shot object detection pipelines.\n * @property {number} [threshold=0.1] The probability necessary to make a prediction.\n * @property {number} [topk=null] The number of top predictions that will be returned by the pipeline.\n * If the provided number is `null` or higher than the number of predictions available, it will default\n * to the number of predictions.\n * @property {boolean} [percentage=false] Whether to return the boxes coordinates in percentage (true) or in pixels (false).\n * \n * @callback ZeroShotObjectDetectionPipelineCallback Detect objects (bounding boxes & classes) in the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The input images.\n * @param {string[]} candidate_labels What the model should recognize in the image.\n * @param {ZeroShotObjectDetectionPipelineOptions} [options] The options to use for zero-shot object detection.\n * @returns {Promise} An array of objects containing the predicted labels, scores, and bounding boxes.\n * \n * @typedef {TextImagePipelineConstructorArgs & ZeroShotObjectDetectionPipelineCallback & Disposable} ZeroShotObjectDetectionPipelineType\n */\n\n/**\n * Zero-shot object detection pipeline. This pipeline predicts bounding boxes of\n * objects when you provide an image and a set of `candidate_labels`.\n * \n * **Example:** Zero-shot object detection w/ `Xenova/owlvit-base-patch32`.\n * ```javascript\n * const detector = await pipeline('zero-shot-object-detection', 'Xenova/owlvit-base-patch32');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/astronaut.png';\n * const candidate_labels = ['human face', 'rocket', 'helmet', 'american flag'];\n * const output = await detector(url, candidate_labels);\n * // [\n * // {\n * // score: 0.24392342567443848,\n * // label: 'human face',\n * // box: { xmin: 180, ymin: 67, xmax: 274, ymax: 175 }\n * // },\n * // {\n * // score: 0.15129457414150238,\n * // label: 'american flag',\n * // box: { xmin: 0, ymin: 4, xmax: 106, ymax: 513 }\n * // },\n * // {\n * // score: 0.13649864494800568,\n * // label: 'helmet',\n * // box: { xmin: 277, ymin: 337, xmax: 511, ymax: 511 }\n * // },\n * // {\n * // score: 0.10262022167444229,\n * // label: 'rocket',\n * // box: { xmin: 352, ymin: -1, xmax: 463, ymax: 287 }\n * // }\n * // ]\n * ```\n * \n * **Example:** Zero-shot object detection w/ `Xenova/owlvit-base-patch32` (returning top 4 matches and setting a threshold).\n * ```javascript\n * const detector = await pipeline('zero-shot-object-detection', 'Xenova/owlvit-base-patch32');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/beach.png';\n * const candidate_labels = ['hat', 'book', 'sunglasses', 'camera'];\n * const output = await detector(url, candidate_labels, { topk: 4, threshold: 0.05 });\n * // [\n * // {\n * // score: 0.1606510728597641,\n * // label: 'sunglasses',\n * // box: { xmin: 347, ymin: 229, xmax: 429, ymax: 264 }\n * // },\n * // {\n * // score: 0.08935828506946564,\n * // label: 'hat',\n * // box: { xmin: 38, ymin: 174, xmax: 258, ymax: 364 }\n * // },\n * // {\n * // score: 0.08530698716640472,\n * // label: 'camera',\n * // box: { xmin: 187, ymin: 350, xmax: 260, ymax: 411 }\n * // },\n * // {\n * // score: 0.08349756896495819,\n * // label: 'book',\n * // box: { xmin: 261, ymin: 280, xmax: 494, ymax: 425 }\n * // }\n * // ]\n * ```\n */\nclass ZeroShotObjectDetectionPipeline extends (/** @type {new (options: TextImagePipelineConstructorArgs) => ZeroShotObjectDetectionPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new ZeroShotObjectDetectionPipeline.\n * @param {TextImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ZeroShotObjectDetectionPipelineCallback} */\n async _call(images, candidate_labels, {\n threshold = 0.1,\n topk = null,\n percentage = false,\n } = {}) {\n\n const isBatched = Array.isArray(images);\n const preparedImages = await prepareImages(images);\n\n // Run tokenization\n const text_inputs = this.tokenizer(candidate_labels, {\n padding: true,\n truncation: true,\n });\n\n // Run processor\n const model_inputs = await this.processor(preparedImages);\n\n // Since non-maximum suppression is performed for exporting, we need to\n // process each image separately. For more information, see:\n // https://github.com/huggingface/optimum/blob/e3b7efb1257c011db907ef40ab340e795cc5684c/optimum/exporters/onnx/model_configs.py#L1028-L1032\n const toReturn = [];\n for (let i = 0; i < preparedImages.length; ++i) {\n const image = preparedImages[i];\n const imageSize = percentage ? null : [[image.height, image.width]];\n const pixel_values = model_inputs.pixel_values[i].unsqueeze_(0);\n\n // Run model with both text and pixel inputs\n const output = await this.model({ ...text_inputs, pixel_values });\n\n // @ts-ignore\n const processed = this.processor.feature_extractor.post_process_object_detection(output, threshold, imageSize, true)[0];\n let result = processed.boxes.map((box, i) => ({\n score: processed.scores[i],\n label: candidate_labels[processed.classes[i]],\n box: get_bounding_box(box, !percentage),\n })).sort((a, b) => b.score - a.score);\n if (topk !== null) {\n result = result.slice(0, topk);\n }\n toReturn.push(result)\n }\n\n return isBatched ? toReturn : toReturn[0];\n }\n}\n\n/**\n * @typedef {Object} DocumentQuestionAnsweringSingle\n * @property {string} answer The generated text.\n * @typedef {DocumentQuestionAnsweringSingle[]} DocumentQuestionAnsweringOutput\n * \n * @callback DocumentQuestionAnsweringPipelineCallback Answer the question given as input by using the document.\n * @param {ImageInput} image The image of the document to use.\n * @param {string} question A question to ask of the document.\n * @param {import('./utils/generation.js').GenerationConfigType} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise} An object (or array of objects) containing the answer(s).\n * \n * @typedef {TextImagePipelineConstructorArgs & DocumentQuestionAnsweringPipelineCallback & Disposable} DocumentQuestionAnsweringPipelineType\n */\n\n/**\n * Document Question Answering pipeline using any `AutoModelForDocumentQuestionAnswering`.\n * The inputs/outputs are similar to the (extractive) question answering pipeline; however,\n * the pipeline takes an image (and optional OCR'd words/boxes) as input instead of text context.\n * \n * **Example:** Answer questions about a document with `Xenova/donut-base-finetuned-docvqa`.\n * ```javascript\n * const qa_pipeline = await pipeline('document-question-answering', 'Xenova/donut-base-finetuned-docvqa');\n * const image = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/invoice.png';\n * const question = 'What is the invoice number?';\n * const output = await qa_pipeline(image, question);\n * // [{ answer: 'us-001' }]\n * ```\n */\nclass DocumentQuestionAnsweringPipeline extends (/** @type {new (options: TextImagePipelineConstructorArgs) => DocumentQuestionAnsweringPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new DocumentQuestionAnsweringPipeline.\n * @param {TextImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {DocumentQuestionAnsweringPipelineCallback} */\n async _call(image, question, generate_kwargs = {}) {\n\n // NOTE: For now, we only support a batch size of 1\n\n // Preprocess image\n const preparedImage = (await prepareImages(image))[0];\n const { pixel_values } = await this.processor(preparedImage);\n\n // Run tokenization\n const task_prompt = `${question}`;\n const decoder_input_ids = this.tokenizer(task_prompt, {\n add_special_tokens: false,\n padding: true,\n truncation: true,\n }).input_ids;\n\n // Run model\n const output = await this.model.generate(\n pixel_values,\n {\n ...generate_kwargs,\n decoder_input_ids,\n max_length: this.model.config.decoder.max_position_embeddings,\n }\n );\n\n // Decode output\n const decoded = this.tokenizer.batch_decode(output)[0];\n\n // Parse answer\n const match = decoded.match(/(.*?)<\\/s_answer>/);\n let answer = null;\n if (match && match.length >= 2) {\n answer = match[1].trim();\n }\n return [{ answer }];\n }\n}\n\n\n/**\n * @typedef {Object} VocoderOptions\n * @property {PreTrainedModel} [vocoder] The vocoder used by the pipeline (if the model uses one). If not provided, use the default HifiGan vocoder.\n * @typedef {TextAudioPipelineConstructorArgs & VocoderOptions} TextToAudioPipelineConstructorArgs\n */\n\n/**\n * @typedef {Object} TextToAudioOutput\n * @property {Float32Array} audio The generated audio waveform.\n * @property {number} sampling_rate The sampling rate of the generated audio waveform.\n * \n * @typedef {Object} TextToAudioPipelineOptions Parameters specific to text-to-audio pipelines.\n * @property {Tensor|Float32Array|string|URL} [speaker_embeddings=null] The speaker embeddings (if the model requires it).\n * \n * @callback TextToAudioPipelineCallback Generates speech/audio from the inputs.\n * @param {string|string[]} texts The text(s) to generate.\n * @param {TextToAudioPipelineOptions} options Parameters passed to the model generation/forward method.\n * @returns {Promise} An object containing the generated audio and sampling rate.\n * \n * @typedef {TextToAudioPipelineConstructorArgs & TextToAudioPipelineCallback & Disposable} TextToAudioPipelineType\n */\n\n/**\n * Text-to-audio generation pipeline using any `AutoModelForTextToWaveform` or `AutoModelForTextToSpectrogram`.\n * This pipeline generates an audio file from an input text and optional other conditional inputs.\n * \n * **Example:** Generate audio from text with `Xenova/speecht5_tts`.\n * ```javascript\n * const synthesizer = await pipeline('text-to-speech', 'Xenova/speecht5_tts', { quantized: false });\n * const speaker_embeddings = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/speaker_embeddings.bin';\n * const out = await synthesizer('Hello, my dog is cute', { speaker_embeddings });\n * // {\n * // audio: Float32Array(26112) [-0.00005657337896991521, 0.00020583874720614403, ...],\n * // sampling_rate: 16000\n * // }\n * ```\n * \n * You can then save the audio to a .wav file with the `wavefile` package:\n * ```javascript\n * import wavefile from 'wavefile';\n * import fs from 'fs';\n * \n * const wav = new wavefile.WaveFile();\n * wav.fromScratch(1, out.sampling_rate, '32f', out.audio);\n * fs.writeFileSync('out.wav', wav.toBuffer());\n * ```\n * \n * **Example:** Multilingual speech generation with `Xenova/mms-tts-fra`. See [here](https://huggingface.co/models?pipeline_tag=text-to-speech&other=vits&sort=trending) for the full list of available languages (1107).\n * ```javascript\n * const synthesizer = await pipeline('text-to-speech', 'Xenova/mms-tts-fra');\n * const out = await synthesizer('Bonjour');\n * // {\n * // audio: Float32Array(23808) [-0.00037693005288019776, 0.0003325853613205254, ...],\n * // sampling_rate: 16000\n * // }\n * ```\n */\nclass TextToAudioPipeline extends (/** @type {new (options: TextToAudioPipelineConstructorArgs) => TextToAudioPipelineType} */ (Pipeline)) {\n DEFAULT_VOCODER_ID = \"Xenova/speecht5_hifigan\"\n\n /**\n * Create a new TextToAudioPipeline.\n * @param {TextToAudioPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n\n // TODO: Find a better way for `pipeline` to set the default vocoder\n this.vocoder = options.vocoder ?? null;\n }\n\n\n /** @type {TextToAudioPipelineCallback} */\n async _call(text_inputs, {\n speaker_embeddings = null,\n } = {}) {\n\n // If this.processor is not set, we are using a `AutoModelForTextToWaveform` model\n if (this.processor) {\n return this._call_text_to_spectrogram(text_inputs, { speaker_embeddings });\n } else {\n return this._call_text_to_waveform(text_inputs);\n }\n }\n\n async _call_text_to_waveform(text_inputs) {\n\n // Run tokenization\n const inputs = this.tokenizer(text_inputs, {\n padding: true,\n truncation: true,\n });\n\n // Generate waveform\n const { waveform } = await this.model(inputs);\n\n const sampling_rate = this.model.config.sampling_rate;\n return {\n audio: waveform.data,\n sampling_rate,\n }\n }\n\n async _call_text_to_spectrogram(text_inputs, { speaker_embeddings }) {\n\n // Load vocoder, if not provided\n if (!this.vocoder) {\n console.log('No vocoder specified, using default HifiGan vocoder.');\n this.vocoder = await _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModel.from_pretrained(this.DEFAULT_VOCODER_ID, { quantized: false });\n }\n\n // Load speaker embeddings as Float32Array from path/URL\n if (typeof speaker_embeddings === 'string' || speaker_embeddings instanceof URL) {\n // Load from URL with fetch\n speaker_embeddings = new Float32Array(\n await (await fetch(speaker_embeddings)).arrayBuffer()\n );\n }\n\n if (speaker_embeddings instanceof Float32Array) {\n speaker_embeddings = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_6__.Tensor(\n 'float32',\n speaker_embeddings,\n [1, speaker_embeddings.length]\n )\n } else if (!(speaker_embeddings instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_6__.Tensor)) {\n throw new Error(\"Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.\")\n }\n\n // Run tokenization\n const { input_ids } = this.tokenizer(text_inputs, {\n padding: true,\n truncation: true,\n });\n\n // NOTE: At this point, we are guaranteed that `speaker_embeddings` is a `Tensor`\n // @ts-ignore\n const { waveform } = await this.model.generate_speech(input_ids, speaker_embeddings, { vocoder: this.vocoder });\n\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\n return {\n audio: waveform.data,\n sampling_rate,\n }\n }\n}\n\n/**\n * @callback ImageToImagePipelineCallback Transform the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The images to transform.\n * @returns {Promise} The transformed image or list of images.\n * \n * @typedef {ImagePipelineConstructorArgs & ImageToImagePipelineCallback & Disposable} ImageToImagePipelineType\n */\n\n/**\n * Image to Image pipeline using any `AutoModelForImageToImage`. This pipeline generates an image based on a previous image input.\n * \n * **Example:** Super-resolution w/ `Xenova/swin2SR-classical-sr-x2-64`\n * ```javascript\n * const upscaler = await pipeline('image-to-image', 'Xenova/swin2SR-classical-sr-x2-64');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/butterfly.jpg';\n * const output = await upscaler(url);\n * // RawImage {\n * // data: Uint8Array(786432) [ 41, 31, 24, 43, ... ],\n * // width: 512,\n * // height: 512,\n * // channels: 3\n * // }\n * ```\n */\nclass ImageToImagePipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => ImageToImagePipelineType} */ (Pipeline)) {\n /**\n * Create a new ImageToImagePipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ImageToImagePipelineCallback} */\n async _call(images) {\n\n const preparedImages = await prepareImages(images);\n const inputs = await this.processor(preparedImages);\n const outputs = await this.model(inputs);\n\n /** @type {RawImage[]} */\n const toReturn = [];\n for (const batch of outputs.reconstruction) {\n const output = batch.squeeze().clamp_(0, 1).mul_(255).round_().to('uint8');\n toReturn.push(_utils_image_js__WEBPACK_IMPORTED_MODULE_7__.RawImage.fromTensor(output));\n }\n\n return toReturn.length > 1 ? toReturn : toReturn[0];\n }\n}\n\n/**\n * @typedef {Object} DepthEstimationPipelineOutput\n * @property {Tensor} predicted_depth The raw depth map predicted by the model.\n * @property {RawImage} depth The processed depth map as an image (with the same size as the input image).\n * \n * @callback DepthEstimationPipelineCallback Predicts the depth for the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The images to compute depth for.\n * @returns {Promise} An image or a list of images containing result(s).\n * \n * @typedef {ImagePipelineConstructorArgs & DepthEstimationPipelineCallback & Disposable} DepthEstimationPipelineType\n */\n\n/**\n * Depth estimation pipeline using any `AutoModelForDepthEstimation`. This pipeline predicts the depth of an image.\n * \n * **Example:** Depth estimation w/ `Xenova/dpt-hybrid-midas`\n * ```javascript\n * const depth_estimator = await pipeline('depth-estimation', 'Xenova/dpt-hybrid-midas');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';\n * const out = await depth_estimator(url);\n * // {\n * // predicted_depth: Tensor {\n * // dims: [ 384, 384 ],\n * // type: 'float32',\n * // data: Float32Array(147456) [ 542.859130859375, 545.2833862304688, 546.1649169921875, ... ],\n * // size: 147456\n * // },\n * // depth: RawImage {\n * // data: Uint8Array(307200) [ 86, 86, 86, ... ],\n * // width: 640,\n * // height: 480,\n * // channels: 1\n * // }\n * // }\n * ```\n */\nclass DepthEstimationPipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => DepthEstimationPipelineType} */ (Pipeline)) {\n /**\n * Create a new DepthEstimationPipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {DepthEstimationPipelineCallback} */\n async _call(images) {\n\n const preparedImages = await prepareImages(images);\n\n const inputs = await this.processor(preparedImages);\n const { predicted_depth } = await this.model(inputs);\n\n const toReturn = [];\n for (let i = 0; i < preparedImages.length; ++i) {\n const prediction = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_6__.interpolate)(predicted_depth[i], preparedImages[i].size.reverse(), 'bilinear', false);\n const formatted = prediction.mul_(255 / (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.max)(prediction.data)[0]).to('uint8');\n toReturn.push({\n predicted_depth: predicted_depth[i],\n depth: _utils_image_js__WEBPACK_IMPORTED_MODULE_7__.RawImage.fromTensor(formatted),\n });\n }\n\n return toReturn.length > 1 ? toReturn : toReturn[0];\n }\n}\n\nconst SUPPORTED_TASKS = Object.freeze({\n \"text-classification\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": TextClassificationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForSequenceClassification,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"distilbert-base-uncased-finetuned-sst-2-english\",\n \"model\": \"Xenova/distilbert-base-uncased-finetuned-sst-2-english\",\n },\n \"type\": \"text\",\n },\n \"token-classification\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": TokenClassificationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForTokenClassification,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"Davlan/bert-base-multilingual-cased-ner-hrl\",\n \"model\": \"Xenova/bert-base-multilingual-cased-ner-hrl\",\n },\n \"type\": \"text\",\n },\n \"question-answering\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": QuestionAnsweringPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForQuestionAnswering,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"distilbert-base-cased-distilled-squad\",\n \"model\": \"Xenova/distilbert-base-cased-distilled-squad\",\n },\n \"type\": \"text\",\n },\n\n \"fill-mask\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": FillMaskPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForMaskedLM,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"bert-base-uncased\",\n \"model\": \"Xenova/bert-base-uncased\",\n },\n \"type\": \"text\",\n },\n \"summarization\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": SummarizationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForSeq2SeqLM,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"sshleifer/distilbart-cnn-6-6\",\n \"model\": \"Xenova/distilbart-cnn-6-6\",\n },\n \"type\": \"text\",\n },\n \"translation\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": TranslationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForSeq2SeqLM,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"t5-small\",\n \"model\": \"Xenova/t5-small\",\n },\n \"type\": \"text\",\n },\n \"text2text-generation\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": Text2TextGenerationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForSeq2SeqLM,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"google/flan-t5-small\",\n \"model\": \"Xenova/flan-t5-small\",\n },\n \"type\": \"text\",\n },\n \"text-generation\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": TextGenerationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForCausalLM,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"gpt2\",\n \"model\": \"Xenova/gpt2\",\n },\n \"type\": \"text\",\n },\n \"zero-shot-classification\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": ZeroShotClassificationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForSequenceClassification,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"typeform/distilbert-base-uncased-mnli\",\n \"model\": \"Xenova/distilbert-base-uncased-mnli\",\n },\n \"type\": \"text\",\n },\n \"audio-classification\": {\n \"pipeline\": AudioClassificationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForAudioClassification,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"superb/wav2vec2-base-superb-ks\",\n \"model\": \"Xenova/wav2vec2-base-superb-ks\",\n },\n \"type\": \"audio\",\n },\n \"zero-shot-audio-classification\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": ZeroShotAudioClassificationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModel,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"laion/clap-htsat-fused\",\n \"model\": \"Xenova/clap-htsat-unfused\",\n },\n \"type\": \"multimodal\",\n },\n \"automatic-speech-recognition\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": AutomaticSpeechRecognitionPipeline,\n \"model\": [_models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForSpeechSeq2Seq, _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForCTC],\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"openai/whisper-tiny.en\",\n \"model\": \"Xenova/whisper-tiny.en\",\n },\n \"type\": \"multimodal\",\n },\n \"text-to-audio\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": TextToAudioPipeline,\n \"model\": [_models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForTextToWaveform, _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForTextToSpectrogram],\n \"processor\": [_processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor, /* Some don't use a processor */ null],\n \"default\": {\n // TODO: replace with original\n // \"model\": \"microsoft/speecht5_tts\",\n \"model\": \"Xenova/speecht5_tts\",\n },\n \"type\": \"text\",\n },\n \"image-to-text\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": ImageToTextPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForVision2Seq,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"nlpconnect/vit-gpt2-image-captioning\",\n \"model\": \"Xenova/vit-gpt2-image-captioning\",\n },\n \"type\": \"multimodal\",\n },\n\n \"image-classification\": {\n // no tokenizer\n \"pipeline\": ImageClassificationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForImageClassification,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"google/vit-base-patch16-224\",\n \"model\": \"Xenova/vit-base-patch16-224\",\n },\n \"type\": \"multimodal\",\n },\n\n \"image-segmentation\": {\n // no tokenizer\n \"pipeline\": ImageSegmentationPipeline,\n \"model\": [_models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForImageSegmentation, _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForSemanticSegmentation],\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"facebook/detr-resnet-50-panoptic\",\n \"model\": \"Xenova/detr-resnet-50-panoptic\",\n },\n \"type\": \"multimodal\",\n },\n\n \"zero-shot-image-classification\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": ZeroShotImageClassificationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModel,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"openai/clip-vit-base-patch32\",\n \"model\": \"Xenova/clip-vit-base-patch32\",\n },\n \"type\": \"multimodal\",\n },\n\n \"object-detection\": {\n // no tokenizer\n \"pipeline\": ObjectDetectionPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForObjectDetection,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"facebook/detr-resnet-50\",\n \"model\": \"Xenova/detr-resnet-50\",\n },\n \"type\": \"multimodal\",\n },\n \"zero-shot-object-detection\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": ZeroShotObjectDetectionPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForZeroShotObjectDetection,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"google/owlvit-base-patch32\",\n \"model\": \"Xenova/owlvit-base-patch32\",\n },\n \"type\": \"multimodal\",\n },\n \"document-question-answering\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": DocumentQuestionAnsweringPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForDocumentQuestionAnswering,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"naver-clova-ix/donut-base-finetuned-docvqa\",\n \"model\": \"Xenova/donut-base-finetuned-docvqa\",\n },\n \"type\": \"multimodal\",\n },\n \"image-to-image\": {\n // no tokenizer\n \"pipeline\": ImageToImagePipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForImageToImage,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"caidas/swin2SR-classical-sr-x2-64\",\n \"model\": \"Xenova/swin2SR-classical-sr-x2-64\",\n },\n \"type\": \"image\",\n },\n \"depth-estimation\": {\n // no tokenizer\n \"pipeline\": DepthEstimationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForDepthEstimation,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"Intel/dpt-large\",\n \"model\": \"Xenova/dpt-large\",\n },\n \"type\": \"image\",\n },\n\n // This task serves as a useful interface for dealing with sentence-transformers (https://huggingface.co/sentence-transformers).\n \"feature-extraction\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": FeatureExtractionPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModel,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"sentence-transformers/all-MiniLM-L6-v2\",\n \"model\": \"Xenova/all-MiniLM-L6-v2\",\n },\n \"type\": \"text\",\n },\n})\n\n\n// TODO: Add types for TASK_ALIASES\nconst TASK_ALIASES = Object.freeze({\n \"sentiment-analysis\": \"text-classification\",\n \"ner\": \"token-classification\",\n // \"vqa\": \"visual-question-answering\", // TODO: Add\n \"asr\": \"automatic-speech-recognition\",\n \"text-to-speech\": \"text-to-audio\",\n\n // Add for backwards compatibility\n \"embeddings\": \"feature-extraction\",\n});\n\n/**\n * @typedef {keyof typeof SUPPORTED_TASKS} TaskType\n * @typedef {keyof typeof TASK_ALIASES} AliasType\n * @typedef {TaskType | AliasType} PipelineType All possible pipeline types.\n * @typedef {{[K in TaskType]: InstanceType}} SupportedTasks A mapping of pipeline names to their corresponding pipeline classes.\n * @typedef {{[K in AliasType]: InstanceType}} AliasTasks A mapping from pipeline aliases to their corresponding pipeline classes.\n * @typedef {SupportedTasks & AliasTasks} AllTasks A mapping from all pipeline names and aliases to their corresponding pipeline classes.\n */\n\n/**\n * Utility factory method to build a `Pipeline` object.\n * \n * @template {PipelineType} T The type of pipeline to return.\n * @param {T} task The task defining which pipeline will be returned. Currently accepted tasks are:\n * - `\"audio-classification\"`: will return a `AudioClassificationPipeline`.\n * - `\"automatic-speech-recognition\"`: will return a `AutomaticSpeechRecognitionPipeline`.\n * - `\"depth-estimation\"`: will return a `DepthEstimationPipeline`.\n * - `\"document-question-answering\"`: will return a `DocumentQuestionAnsweringPipeline`.\n * - `\"feature-extraction\"`: will return a `FeatureExtractionPipeline`.\n * - `\"fill-mask\"`: will return a `FillMaskPipeline`.\n * - `\"image-classification\"`: will return a `ImageClassificationPipeline`.\n * - `\"image-segmentation\"`: will return a `ImageSegmentationPipeline`.\n * - `\"image-to-text\"`: will return a `ImageToTextPipeline`.\n * - `\"object-detection\"`: will return a `ObjectDetectionPipeline`.\n * - `\"question-answering\"`: will return a `QuestionAnsweringPipeline`.\n * - `\"summarization\"`: will return a `SummarizationPipeline`.\n * - `\"text2text-generation\"`: will return a `Text2TextGenerationPipeline`.\n * - `\"text-classification\"` (alias \"sentiment-analysis\" available): will return a `TextClassificationPipeline`.\n * - `\"text-generation\"`: will return a `TextGenerationPipeline`.\n * - `\"token-classification\"` (alias \"ner\" available): will return a `TokenClassificationPipeline`.\n * - `\"translation\"`: will return a `TranslationPipeline`.\n * - `\"translation_xx_to_yy\"`: will return a `TranslationPipeline`.\n * - `\"zero-shot-classification\"`: will return a `ZeroShotClassificationPipeline`.\n * - `\"zero-shot-audio-classification\"`: will return a `ZeroShotAudioClassificationPipeline`.\n * - `\"zero-shot-image-classification\"`: will return a `ZeroShotImageClassificationPipeline`.\n * - `\"zero-shot-object-detection\"`: will return a `ZeroShotObjectDetectionPipeline`.\n * @param {string} [model=null] The name of the pre-trained model to use. If not specified, the default model for the task will be used.\n * @param {import('./utils/hub.js').PretrainedOptions} [options] Optional parameters for the pipeline.\n * @returns {Promise} A Pipeline object for the specified task.\n * @throws {Error} If an unsupported pipeline is requested.\n */\nasync function pipeline(\n task,\n model = null,\n {\n quantized = true,\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n } = {}\n) {\n // Helper method to construct pipeline\n\n // Apply aliases\n // @ts-ignore\n task = TASK_ALIASES[task] ?? task;\n\n // Get pipeline info\n const pipelineInfo = SUPPORTED_TASKS[task.split('_', 1)[0]];\n if (!pipelineInfo) {\n throw Error(`Unsupported pipeline: ${task}. Must be one of [${Object.keys(SUPPORTED_TASKS)}]`)\n }\n\n // Use model if specified, otherwise, use default\n if (!model) {\n model = pipelineInfo.default.model\n console.log(`No model specified. Using default model: \"${model}\".`);\n }\n\n const pretrainedOptions = {\n quantized,\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n }\n\n const classes = new Map([\n ['tokenizer', pipelineInfo.tokenizer],\n ['model', pipelineInfo.model],\n ['processor', pipelineInfo.processor],\n ]);\n\n // Load model, tokenizer, and processor (if they exist)\n const results = await loadItems(classes, model, pretrainedOptions);\n results.task = task;\n\n (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_3__.dispatchCallback)(progress_callback, {\n 'status': 'ready',\n 'task': task,\n 'model': model,\n });\n\n const pipelineClass = pipelineInfo.pipeline;\n return new pipelineClass(results);\n}\n\n\n/**\n * Helper function to get applicable model, tokenizer, or processor classes for a given model.\n * @param {Map} mapping The mapping of names to classes, arrays of classes, or null.\n * @param {string} model The name of the model to load.\n * @param {import('./utils/hub.js').PretrainedOptions} pretrainedOptions The options to pass to the `from_pretrained` method.\n * @private\n */\nasync function loadItems(mapping, model, pretrainedOptions) {\n\n const result = Object.create(null);\n\n /**@type {Promise[]} */\n const promises = [];\n for (let [name, cls] of mapping.entries()) {\n if (!cls) continue;\n\n /**@type {Promise} */\n let promise;\n if (Array.isArray(cls)) {\n promise = new Promise(async (resolve, reject) => {\n let e;\n for (let c of cls) {\n if (c === null) {\n // If null, we resolve it immediately, meaning the relevant\n // class was not found, but it is optional.\n resolve(null);\n return;\n }\n try {\n resolve(await c.from_pretrained(model, pretrainedOptions));\n return;\n } catch (err) {\n e = err;\n }\n }\n reject(e);\n })\n } else {\n promise = cls.from_pretrained(model, pretrainedOptions);\n }\n\n result[name] = promise;\n promises.push(promise);\n }\n\n // Wait for all promises to resolve (in parallel)\n await Promise.all(promises);\n\n // Then assign to result\n for (let [name, promise] of Object.entries(result)) {\n result[name] = await promise;\n }\n\n return result;\n}\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/pipelines.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AudioClassificationPipeline: () => (/* binding */ AudioClassificationPipeline),\n/* harmony export */ AutomaticSpeechRecognitionPipeline: () => (/* binding */ AutomaticSpeechRecognitionPipeline),\n/* harmony export */ DepthEstimationPipeline: () => (/* binding */ DepthEstimationPipeline),\n/* harmony export */ DocumentQuestionAnsweringPipeline: () => (/* binding */ DocumentQuestionAnsweringPipeline),\n/* harmony export */ FeatureExtractionPipeline: () => (/* binding */ FeatureExtractionPipeline),\n/* harmony export */ FillMaskPipeline: () => (/* binding */ FillMaskPipeline),\n/* harmony export */ ImageClassificationPipeline: () => (/* binding */ ImageClassificationPipeline),\n/* harmony export */ ImageFeatureExtractionPipeline: () => (/* binding */ ImageFeatureExtractionPipeline),\n/* harmony export */ ImageSegmentationPipeline: () => (/* binding */ ImageSegmentationPipeline),\n/* harmony export */ ImageToImagePipeline: () => (/* binding */ ImageToImagePipeline),\n/* harmony export */ ImageToTextPipeline: () => (/* binding */ ImageToTextPipeline),\n/* harmony export */ ObjectDetectionPipeline: () => (/* binding */ ObjectDetectionPipeline),\n/* harmony export */ Pipeline: () => (/* binding */ Pipeline),\n/* harmony export */ QuestionAnsweringPipeline: () => (/* binding */ QuestionAnsweringPipeline),\n/* harmony export */ SummarizationPipeline: () => (/* binding */ SummarizationPipeline),\n/* harmony export */ Text2TextGenerationPipeline: () => (/* binding */ Text2TextGenerationPipeline),\n/* harmony export */ TextClassificationPipeline: () => (/* binding */ TextClassificationPipeline),\n/* harmony export */ TextGenerationPipeline: () => (/* binding */ TextGenerationPipeline),\n/* harmony export */ TextToAudioPipeline: () => (/* binding */ TextToAudioPipeline),\n/* harmony export */ TokenClassificationPipeline: () => (/* binding */ TokenClassificationPipeline),\n/* harmony export */ TranslationPipeline: () => (/* binding */ TranslationPipeline),\n/* harmony export */ ZeroShotAudioClassificationPipeline: () => (/* binding */ ZeroShotAudioClassificationPipeline),\n/* harmony export */ ZeroShotClassificationPipeline: () => (/* binding */ ZeroShotClassificationPipeline),\n/* harmony export */ ZeroShotImageClassificationPipeline: () => (/* binding */ ZeroShotImageClassificationPipeline),\n/* harmony export */ ZeroShotObjectDetectionPipeline: () => (/* binding */ ZeroShotObjectDetectionPipeline),\n/* harmony export */ pipeline: () => (/* binding */ pipeline)\n/* harmony export */ });\n/* harmony import */ var _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tokenizers.js */ \"./node_modules/@xenova/transformers/src/tokenizers.js\");\n/* harmony import */ var _models_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./models.js */ \"./node_modules/@xenova/transformers/src/models.js\");\n/* harmony import */ var _processors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./processors.js */ \"./node_modules/@xenova/transformers/src/processors.js\");\n/* harmony import */ var _utils_core_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/core.js */ \"./node_modules/@xenova/transformers/src/utils/core.js\");\n/* harmony import */ var _utils_maths_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/maths.js */ \"./node_modules/@xenova/transformers/src/utils/maths.js\");\n/* harmony import */ var _utils_audio_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/audio.js */ \"./node_modules/@xenova/transformers/src/utils/audio.js\");\n/* harmony import */ var _utils_tensor_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/tensor.js */ \"./node_modules/@xenova/transformers/src/utils/tensor.js\");\n/* harmony import */ var _utils_image_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/image.js */ \"./node_modules/@xenova/transformers/src/utils/image.js\");\n/**\n * @file Pipelines provide a high-level, easy to use, API for running machine learning models.\n * \n * **Example:** Instantiate pipeline using the `pipeline` function.\n * ```javascript\n * import { pipeline } from '@xenova/transformers';\n * \n * const classifier = await pipeline('sentiment-analysis');\n * const output = await classifier('I love transformers!');\n * // [{'label': 'POSITIVE', 'score': 0.999817686}]\n * ```\n * \n * @module pipelines\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @typedef {string | RawImage | URL} ImageInput\n * @typedef {ImageInput|ImageInput[]} ImagePipelineInputs\n */\n\n/**\n * Prepare images for further tasks.\n * @param {ImagePipelineInputs} images images to prepare.\n * @returns {Promise} returns processed images.\n * @private\n */\nasync function prepareImages(images) {\n if (!Array.isArray(images)) {\n images = [images];\n }\n\n // Possibly convert any non-images to images\n return await Promise.all(images.map(x => _utils_image_js__WEBPACK_IMPORTED_MODULE_7__.RawImage.read(x)));\n}\n\n/**\n * @typedef {string | URL | Float32Array | Float64Array} AudioInput\n * @typedef {AudioInput|AudioInput[]} AudioPipelineInputs\n */\n\n/**\n * Prepare audios for further tasks.\n * @param {AudioPipelineInputs} audios audios to prepare.\n * @param {number} sampling_rate sampling rate of the audios.\n * @returns {Promise} The preprocessed audio data.\n * @private\n */\nasync function prepareAudios(audios, sampling_rate) {\n if (!Array.isArray(audios)) {\n audios = [audios];\n }\n\n return await Promise.all(audios.map(x => {\n if (typeof x === 'string' || x instanceof URL) {\n return (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.read_audio)(x, sampling_rate);\n } else if (x instanceof Float64Array) {\n return new Float32Array(x);\n }\n return x;\n }));\n}\n\n/**\n * @typedef {Object} BoundingBox\n * @property {number} xmin The minimum x coordinate of the bounding box.\n * @property {number} ymin The minimum y coordinate of the bounding box.\n * @property {number} xmax The maximum x coordinate of the bounding box.\n * @property {number} ymax The maximum y coordinate of the bounding box.\n */\n\n/**\n * Helper function to convert list [xmin, xmax, ymin, ymax] into object { \"xmin\": xmin, ... }\n * @param {number[]} box The bounding box as a list.\n * @param {boolean} asInteger Whether to cast to integers.\n * @returns {BoundingBox} The bounding box as an object.\n * @private\n */\nfunction get_bounding_box(box, asInteger) {\n if (asInteger) {\n box = box.map(x => x | 0);\n }\n const [xmin, ymin, xmax, ymax] = box;\n\n return { xmin, ymin, xmax, ymax };\n}\n\n\n/**\n * @callback DisposeType Disposes the item.\n * @returns {Promise} A promise that resolves when the item has been disposed.\n * \n * @typedef {Object} Disposable\n * @property {DisposeType} dispose A promise that resolves when the pipeline has been disposed.\n */\n\n/**\n * The Pipeline class is the class from which all pipelines inherit.\n * Refer to this class for methods shared across different pipelines.\n * @extends Callable\n */\nclass Pipeline extends _utils_core_js__WEBPACK_IMPORTED_MODULE_3__.Callable {\n /**\n * Create a new Pipeline.\n * @param {Object} options An object containing the following properties:\n * @param {string} [options.task] The task of the pipeline. Useful for specifying subtasks.\n * @param {PreTrainedModel} [options.model] The model used by the pipeline.\n * @param {PreTrainedTokenizer} [options.tokenizer=null] The tokenizer used by the pipeline (if any).\n * @param {Processor} [options.processor=null] The processor used by the pipeline (if any).\n */\n constructor({ task, model, tokenizer = null, processor = null }) {\n super();\n this.task = task;\n this.model = model;\n this.tokenizer = tokenizer;\n this.processor = processor;\n }\n\n /** @type {DisposeType} */\n async dispose() {\n await this.model.dispose();\n }\n}\n\n/**\n * @typedef {Object} ModelTokenizerConstructorArgs\n * @property {string} task The task of the pipeline. Useful for specifying subtasks.\n * @property {PreTrainedModel} model The model used by the pipeline.\n * @property {PreTrainedTokenizer} tokenizer The tokenizer used by the pipeline.\n * \n * @typedef {ModelTokenizerConstructorArgs} TextPipelineConstructorArgs An object used to instantiate a text-based pipeline.\n */\n\n/**\n * @typedef {Object} ModelProcessorConstructorArgs\n * @property {string} task The task of the pipeline. Useful for specifying subtasks.\n * @property {PreTrainedModel} model The model used by the pipeline.\n * @property {Processor} processor The processor used by the pipeline.\n * \n * @typedef {ModelProcessorConstructorArgs} AudioPipelineConstructorArgs An object used to instantiate an audio-based pipeline.\n * @typedef {ModelProcessorConstructorArgs} ImagePipelineConstructorArgs An object used to instantiate an image-based pipeline.\n */\n\n\n/**\n * @typedef {Object} ModelTokenizerProcessorConstructorArgs\n * @property {string} task The task of the pipeline. Useful for specifying subtasks.\n * @property {PreTrainedModel} model The model used by the pipeline.\n * @property {PreTrainedTokenizer} tokenizer The tokenizer used by the pipeline.\n * @property {Processor} processor The processor used by the pipeline.\n * \n * @typedef {ModelTokenizerProcessorConstructorArgs} TextAudioPipelineConstructorArgs An object used to instantiate a text- and audio-based pipeline.\n * @typedef {ModelTokenizerProcessorConstructorArgs} TextImagePipelineConstructorArgs An object used to instantiate a text- and image-based pipeline.\n */\n\n/**\n * @typedef {Object} TextClassificationSingle\n * @property {string} label The label predicted.\n * @property {number} score The corresponding probability.\n * @typedef {TextClassificationSingle[]} TextClassificationOutput\n * \n * @typedef {Object} TextClassificationPipelineOptions Parameters specific to text classification pipelines.\n * @property {number} [topk=1] The number of top predictions to be returned.\n * \n * @callback TextClassificationPipelineCallback Classify the text(s) given as inputs.\n * @param {string|string[]} texts The input text(s) to be classified.\n * @param {TextClassificationPipelineOptions} [options] The options to use for text classification.\n * @returns {Promise} An array or object containing the predicted labels and scores.\n * \n * @typedef {TextPipelineConstructorArgs & TextClassificationPipelineCallback & Disposable} TextClassificationPipelineType\n */\n\n/**\n * Text classification pipeline using any `ModelForSequenceClassification`.\n *\n * **Example:** Sentiment-analysis w/ `Xenova/distilbert-base-uncased-finetuned-sst-2-english`.\n * ```javascript\n * const classifier = await pipeline('sentiment-analysis', 'Xenova/distilbert-base-uncased-finetuned-sst-2-english');\n * const output = await classifier('I love transformers!');\n * // [{ label: 'POSITIVE', score: 0.999788761138916 }]\n * ```\n * \n * **Example:** Multilingual sentiment-analysis w/ `Xenova/bert-base-multilingual-uncased-sentiment` (and return top 5 classes).\n * ```javascript\n * const classifier = await pipeline('sentiment-analysis', 'Xenova/bert-base-multilingual-uncased-sentiment');\n * const output = await classifier('Le meilleur film de tous les temps.', { topk: 5 });\n * // [\n * // { label: '5 stars', score: 0.9610759615898132 },\n * // { label: '4 stars', score: 0.03323351591825485 },\n * // { label: '3 stars', score: 0.0036155181005597115 },\n * // { label: '1 star', score: 0.0011325967498123646 },\n * // { label: '2 stars', score: 0.0009423971059732139 }\n * // ]\n * ```\n * \n * **Example:** Toxic comment classification w/ `Xenova/toxic-bert` (and return all classes).\n * ```javascript\n * const classifier = await pipeline('text-classification', 'Xenova/toxic-bert');\n * const output = await classifier('I hate you!', { topk: null });\n * // [\n * // { label: 'toxic', score: 0.9593140482902527 },\n * // { label: 'insult', score: 0.16187334060668945 },\n * // { label: 'obscene', score: 0.03452680632472038 },\n * // { label: 'identity_hate', score: 0.0223250575363636 },\n * // { label: 'threat', score: 0.019197041168808937 },\n * // { label: 'severe_toxic', score: 0.005651099607348442 }\n * // ]\n * ```\n */\nclass TextClassificationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => TextClassificationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new TextClassificationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {TextClassificationPipelineCallback} */\n async _call(texts, {\n topk = 1\n } = {}) {\n\n // Run tokenization\n const model_inputs = this.tokenizer(texts, {\n padding: true,\n truncation: true,\n });\n\n // Run model\n const outputs = await this.model(model_inputs)\n\n // TODO: Use softmax tensor function\n const function_to_apply =\n this.model.config.problem_type === 'multi_label_classification'\n ? batch => batch.sigmoid().data\n : batch => (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(batch.data); // single_label_classification (default)\n\n const id2label = this.model.config.id2label;\n\n const toReturn = [];\n for (const batch of outputs.logits) {\n const output = function_to_apply(batch);\n const scores = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.getTopItems)(output, topk);\n\n const vals = scores.map(x => ({\n label: id2label[x[0]],\n score: x[1],\n }));\n if (topk === 1) {\n toReturn.push(...vals);\n } else {\n toReturn.push(vals);\n }\n }\n\n return Array.isArray(texts) || topk === 1 ? /** @type {TextClassificationOutput} */ (toReturn) : /** @type {TextClassificationOutput[]} */ (toReturn)[0];\n }\n}\n\n/**\n * @typedef {Object} TokenClassificationSingle\n * @property {string} word The token/word classified. This is obtained by decoding the selected tokens.\n * @property {number} score The corresponding probability for `entity`.\n * @property {string} entity The entity predicted for that token/word.\n * @property {number} index The index of the corresponding token in the sentence.\n * @property {number} [start] The index of the start of the corresponding entity in the sentence.\n * @property {number} [end] The index of the end of the corresponding entity in the sentence.\n * @typedef {TokenClassificationSingle[]} TokenClassificationOutput\n * \n * @typedef {Object} TokenClassificationPipelineOptions Parameters specific to token classification pipelines.\n * @property {string[]} [ignore_labels] A list of labels to ignore.\n * \n * @callback TokenClassificationPipelineCallback Classify each token of the text(s) given as inputs.\n * @param {string|string[]} texts One or several texts (or one list of texts) for token classification.\n * @param {TokenClassificationPipelineOptions} [options] The options to use for token classification.\n * @returns {Promise} The result.\n * \n * @typedef {TextPipelineConstructorArgs & TokenClassificationPipelineCallback & Disposable} TokenClassificationPipelineType\n */\n\n/**\n * Named Entity Recognition pipeline using any `ModelForTokenClassification`.\n * \n * **Example:** Perform named entity recognition with `Xenova/bert-base-NER`.\n * ```javascript\n * const classifier = await pipeline('token-classification', 'Xenova/bert-base-NER');\n * const output = await classifier('My name is Sarah and I live in London');\n * // [\n * // { entity: 'B-PER', score: 0.9980202913284302, index: 4, word: 'Sarah' },\n * // { entity: 'B-LOC', score: 0.9994474053382874, index: 9, word: 'London' }\n * // ]\n * ```\n * \n * **Example:** Perform named entity recognition with `Xenova/bert-base-NER` (and return all labels).\n * ```javascript\n * const classifier = await pipeline('token-classification', 'Xenova/bert-base-NER');\n * const output = await classifier('Sarah lives in the United States of America', { ignore_labels: [] });\n * // [\n * // { entity: 'B-PER', score: 0.9966587424278259, index: 1, word: 'Sarah' },\n * // { entity: 'O', score: 0.9987385869026184, index: 2, word: 'lives' },\n * // { entity: 'O', score: 0.9990072846412659, index: 3, word: 'in' },\n * // { entity: 'O', score: 0.9988298416137695, index: 4, word: 'the' },\n * // { entity: 'B-LOC', score: 0.9995510578155518, index: 5, word: 'United' },\n * // { entity: 'I-LOC', score: 0.9990395307540894, index: 6, word: 'States' },\n * // { entity: 'I-LOC', score: 0.9986724853515625, index: 7, word: 'of' },\n * // { entity: 'I-LOC', score: 0.9975294470787048, index: 8, word: 'America' }\n * // ]\n * ```\n */\nclass TokenClassificationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => TokenClassificationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new TokenClassificationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {TokenClassificationPipelineCallback} */\n async _call(texts, {\n ignore_labels = ['O'],\n } = {}) {\n\n const isBatched = Array.isArray(texts);\n\n // Run tokenization\n const model_inputs = this.tokenizer(isBatched ? texts : [texts], {\n padding: true,\n truncation: true,\n });\n\n // Run model\n const outputs = await this.model(model_inputs)\n\n const logits = outputs.logits;\n const id2label = this.model.config.id2label;\n\n const toReturn = [];\n for (let i = 0; i < logits.dims[0]; ++i) {\n const ids = model_inputs.input_ids[i];\n const batch = logits[i];\n\n // List of tokens that aren't ignored\n const tokens = [];\n for (let j = 0; j < batch.dims[0]; ++j) {\n const tokenData = batch[j];\n const topScoreIndex = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.max)(tokenData.data)[1];\n\n const entity = id2label ? id2label[topScoreIndex] : `LABEL_${topScoreIndex}`;\n if (ignore_labels.includes(entity)) {\n // We predicted a token that should be ignored. So, we skip it.\n continue;\n }\n\n // TODO add option to keep special tokens?\n const word = this.tokenizer.decode([ids[j].item()], { skip_special_tokens: true });\n if (word === '') {\n // Was a special token. So, we skip it.\n continue;\n }\n\n const scores = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(tokenData.data);\n\n tokens.push({\n entity: entity,\n score: scores[topScoreIndex],\n index: j,\n word: word,\n\n // TODO: null for now, but will add\n start: null,\n end: null,\n });\n }\n toReturn.push(tokens);\n }\n return isBatched ? toReturn : toReturn[0];\n }\n}\n\n/**\n * @typedef {Object} QuestionAnsweringOutput\n * @property {number} score The probability associated to the answer.\n * @property {number} [start] The character start index of the answer (in the tokenized version of the input).\n * @property {number} [end] The character end index of the answer (in the tokenized version of the input).\n * @property {string} answer The answer to the question.\n * \n * @typedef {Object} QuestionAnsweringPipelineOptions Parameters specific to question answering pipelines.\n * @property {number} [topk=1] The number of top answer predictions to be returned.\n * \n * @callback QuestionAnsweringPipelineCallback Answer the question(s) given as inputs by using the context(s).\n * @param {string|string[]} question One or several question(s) (must be used in conjunction with the `context` argument).\n * @param {string|string[]} context One or several context(s) associated with the question(s) (must be used in conjunction with the `question` argument).\n * @param {QuestionAnsweringPipelineOptions} [options] The options to use for question answering.\n * @returns {Promise} An array or object containing the predicted answers and scores.\n * \n * @typedef {TextPipelineConstructorArgs & QuestionAnsweringPipelineCallback & Disposable} QuestionAnsweringPipelineType\n */\n\n/**\n * Question Answering pipeline using any `ModelForQuestionAnswering`.\n * \n * **Example:** Run question answering with `Xenova/distilbert-base-uncased-distilled-squad`.\n * ```javascript\n * const answerer = await pipeline('question-answering', 'Xenova/distilbert-base-uncased-distilled-squad');\n * const question = 'Who was Jim Henson?';\n * const context = 'Jim Henson was a nice puppet.';\n * const output = await answerer(question, context);\n * // {\n * // answer: \"a nice puppet\",\n * // score: 0.5768911502526741\n * // }\n * ```\n */\nclass QuestionAnsweringPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => QuestionAnsweringPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new QuestionAnsweringPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {QuestionAnsweringPipelineCallback} */\n async _call(question, context, {\n topk = 1\n } = {}) {\n\n // Run tokenization\n const inputs = this.tokenizer(question, {\n text_pair: context,\n padding: true,\n truncation: true,\n });\n\n const output = await this.model(inputs);\n\n /** @type {QuestionAnsweringOutput[]} */\n const toReturn = [];\n for (let j = 0; j < output.start_logits.dims[0]; ++j) {\n const ids = inputs.input_ids[j];\n const sepIndex = ids.indexOf(this.tokenizer.sep_token_id);\n\n const s1 = Array.from((0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(output.start_logits[j].data))\n .map((x, i) => [x, i])\n .filter(x => x[1] > sepIndex);\n const e1 = Array.from((0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(output.end_logits[j].data))\n .map((x, i) => [x, i])\n .filter(x => x[1] > sepIndex);\n\n const options = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_3__.product)(s1, e1)\n .filter(x => x[0][1] <= x[1][1])\n .map(x => [x[0][1], x[1][1], x[0][0] * x[1][0]])\n .sort((a, b) => b[2] - a[2]);\n\n for (let k = 0; k < Math.min(options.length, topk); ++k) {\n const [start, end, score] = options[k];\n\n const answer_tokens = [...ids].slice(start, end + 1)\n\n const answer = this.tokenizer.decode(answer_tokens, {\n skip_special_tokens: true,\n });\n\n // TODO add start and end?\n // NOTE: HF returns character index\n toReturn.push({\n answer, score\n });\n }\n }\n\n // Mimic HF's return type based on topk\n return (topk === 1) ? toReturn[0] : toReturn;\n }\n}\n\n\n/**\n * @typedef {Object} FillMaskSingle\n * @property {string} sequence The corresponding input with the mask token prediction.\n * @property {number} score The corresponding probability.\n * @property {number} token The predicted token id (to replace the masked one).\n * @property {string} token_str The predicted token (to replace the masked one).\n * @typedef {FillMaskSingle[]} FillMaskOutput\n * \n * @typedef {Object} FillMaskPipelineOptions Parameters specific to fill mask pipelines.\n * @property {number} [topk=5] When passed, overrides the number of predictions to return.\n * \n * @callback FillMaskPipelineCallback Fill the masked token in the text(s) given as inputs.\n * @param {string|string[]} texts One or several texts (or one list of prompts) with masked tokens.\n * @param {FillMaskPipelineOptions} [options] The options to use for masked language modelling.\n * @returns {Promise} An array of objects containing the score, predicted token, predicted token string,\n * and the sequence with the predicted token filled in, or an array of such arrays (one for each input text).\n * If only one input text is given, the output will be an array of objects.\n * @throws {Error} When the mask token is not found in the input text.\n * \n * @typedef {TextPipelineConstructorArgs & FillMaskPipelineCallback & Disposable} FillMaskPipelineType\n */\n\n/**\n * Masked language modeling prediction pipeline using any `ModelWithLMHead`.\n * \n * **Example:** Perform masked language modelling (a.k.a. \"fill-mask\") with `Xenova/bert-base-uncased`.\n * ```javascript\n * const unmasker = await pipeline('fill-mask', 'Xenova/bert-base-cased');\n * const output = await unmasker('The goal of life is [MASK].');\n * // [\n * // { token_str: 'survival', score: 0.06137419492006302, token: 8115, sequence: 'The goal of life is survival.' },\n * // { token_str: 'love', score: 0.03902450203895569, token: 1567, sequence: 'The goal of life is love.' },\n * // { token_str: 'happiness', score: 0.03253183513879776, token: 9266, sequence: 'The goal of life is happiness.' },\n * // { token_str: 'freedom', score: 0.018736306577920914, token: 4438, sequence: 'The goal of life is freedom.' },\n * // { token_str: 'life', score: 0.01859794743359089, token: 1297, sequence: 'The goal of life is life.' }\n * // ]\n * ```\n * \n * **Example:** Perform masked language modelling (a.k.a. \"fill-mask\") with `Xenova/bert-base-cased` (and return top result).\n * ```javascript\n * const unmasker = await pipeline('fill-mask', 'Xenova/bert-base-cased');\n * const output = await unmasker('The Milky Way is a [MASK] galaxy.', { topk: 1 });\n * // [{ token_str: 'spiral', score: 0.6299987435340881, token: 14061, sequence: 'The Milky Way is a spiral galaxy.' }]\n * ```\n */\nclass FillMaskPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => FillMaskPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new FillMaskPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {FillMaskPipelineCallback} */\n async _call(texts, {\n topk = 5\n } = {}) {\n\n // Run tokenization\n const model_inputs = this.tokenizer(texts, {\n padding: true,\n truncation: true,\n });\n\n // Run model\n const outputs = await this.model(model_inputs)\n\n const toReturn = [];\n\n for (let i = 0; i < model_inputs.input_ids.dims[0]; ++i) {\n const ids = model_inputs.input_ids[i];\n const mask_token_index = ids.indexOf(this.tokenizer.mask_token_id)\n\n if (mask_token_index === -1) {\n throw Error(`Mask token (${this.tokenizer.mask_token}) not found in text.`)\n }\n const logits = outputs.logits[i];\n const itemLogits = logits[mask_token_index];\n\n const scores = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.getTopItems)((0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(itemLogits.data), topk);\n\n toReturn.push(scores.map(x => {\n const sequence = [...ids];\n sequence[mask_token_index] = x[0];\n\n return {\n score: x[1],\n token: x[0],\n token_str: this.tokenizer.model.vocab[x[0]],\n sequence: this.tokenizer.decode(sequence, { skip_special_tokens: true }),\n }\n }));\n }\n return Array.isArray(texts) ? toReturn : toReturn[0];\n }\n}\n\n\n/**\n * @typedef {Object} Text2TextGenerationSingle\n * @property {string} generated_text The generated text.\n * @typedef {Text2TextGenerationSingle[]} Text2TextGenerationOutput\n * \n * @callback Text2TextGenerationPipelineCallback Generate the output text(s) using text(s) given as inputs.\n * @param {string|string[]} texts Input text for the encoder.\n * @param {import('./utils/generation.js').GenerationConfigType} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise}\n * \n * @typedef {TextPipelineConstructorArgs & Text2TextGenerationPipelineCallback & Disposable} Text2TextGenerationPipelineType\n */\n\n/**\n * Text2TextGenerationPipeline class for generating text using a model that performs text-to-text generation tasks.\n * \n * **Example:** Text-to-text generation w/ `Xenova/LaMini-Flan-T5-783M`.\n * ```javascript\n * const generator = await pipeline('text2text-generation', 'Xenova/LaMini-Flan-T5-783M');\n * const output = await generator('how can I become more healthy?', {\n * max_new_tokens: 100,\n * });\n * // [{ generated_text: \"To become more healthy, you can: 1. Eat a balanced diet with plenty of fruits, vegetables, whole grains, lean proteins, and healthy fats. 2. Stay hydrated by drinking plenty of water. 3. Get enough sleep and manage stress levels. 4. Avoid smoking and excessive alcohol consumption. 5. Regularly exercise and maintain a healthy weight. 6. Practice good hygiene and sanitation. 7. Seek medical attention if you experience any health issues.\" }]\n * ```\n */\nclass Text2TextGenerationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => Text2TextGenerationPipelineType} */ (Pipeline)) {\n /** @type {'generated_text'} */\n _key = 'generated_text';\n\n /**\n * Create a new Text2TextGenerationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {Text2TextGenerationPipelineCallback} */\n async _call(texts, generate_kwargs = {}) {\n if (!Array.isArray(texts)) {\n texts = [texts];\n }\n\n\n // Add global prefix, if present\n if (this.model.config.prefix) {\n texts = texts.map(x => this.model.config.prefix + x)\n }\n\n // Handle task specific params:\n const task_specific_params = this.model.config.task_specific_params\n if (task_specific_params && task_specific_params[this.task]) {\n // Add prefixes, if present\n if (task_specific_params[this.task].prefix) {\n texts = texts.map(x => task_specific_params[this.task].prefix + x)\n }\n\n // TODO update generation config\n }\n\n const tokenizer = this.tokenizer;\n const tokenizer_options = {\n padding: true,\n truncation: true,\n }\n let input_ids;\n if (this instanceof TranslationPipeline && '_build_translation_inputs' in tokenizer) {\n // TODO: move to Translation pipeline?\n // Currently put here to avoid code duplication\n // @ts-ignore\n input_ids = tokenizer._build_translation_inputs(texts, tokenizer_options, generate_kwargs).input_ids;\n\n } else {\n input_ids = tokenizer(texts, tokenizer_options).input_ids;\n }\n\n const outputTokenIds = await this.model.generate(input_ids, generate_kwargs);\n\n return tokenizer.batch_decode(outputTokenIds, {\n skip_special_tokens: true,\n }).map(text => ({ [this._key]: text }));\n }\n}\n\n\n/**\n * @typedef {Object} SummarizationSingle\n * @property {string} summary_text The summary text.\n * @typedef {SummarizationSingle[]} SummarizationOutput\n * \n * @callback SummarizationPipelineCallback Summarize the text(s) given as inputs.\n * @param {string|string[]} texts One or several articles (or one list of articles) to summarize.\n * @param {import('./utils/generation.js').GenerationConfigType} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise}\n * \n * @typedef {TextPipelineConstructorArgs & SummarizationPipelineCallback & Disposable} SummarizationPipelineType\n */\n\n/**\n * A pipeline for summarization tasks, inheriting from Text2TextGenerationPipeline.\n * \n * **Example:** Summarization w/ `Xenova/distilbart-cnn-6-6`.\n * ```javascript\n * const generator = await pipeline('summarization', 'Xenova/distilbart-cnn-6-6');\n * const text = 'The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, ' +\n * 'and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. ' +\n * 'During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest ' +\n * 'man-made structure in the world, a title it held for 41 years until the Chrysler Building in New ' +\n * 'York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to ' +\n * 'the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the ' +\n * 'Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second ' +\n * 'tallest free-standing structure in France after the Millau Viaduct.';\n * const output = await generator(text, {\n * max_new_tokens: 100,\n * });\n * // [{ summary_text: ' The Eiffel Tower is about the same height as an 81-storey building and the tallest structure in Paris. It is the second tallest free-standing structure in France after the Millau Viaduct.' }]\n * ```\n */\nclass SummarizationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => SummarizationPipelineType} */ (/** @type {any} */ (Text2TextGenerationPipeline))) {\n /** @type {'summary_text'} */\n _key = 'summary_text';\n\n /**\n * Create a new SummarizationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n}\n\n\n/**\n * @typedef {Object} TranslationSingle\n * @property {string} translation_text The translated text.\n * @typedef {TranslationSingle[]} TranslationOutput\n * \n * @callback TranslationPipelineCallback Translate the text(s) given as inputs.\n * @param {string|string[]} texts Texts to be translated.\n * @param {import('./utils/generation.js').GenerationConfigType} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise}\n * \n * @typedef {TextPipelineConstructorArgs & TranslationPipelineCallback & Disposable} TranslationPipelineType\n */\n\n/**\n * Translates text from one language to another.\n * \n * **Example:** Multilingual translation w/ `Xenova/nllb-200-distilled-600M`.\n * \n * See [here](https://github.com/facebookresearch/flores/blob/main/flores200/README.md#languages-in-flores-200)\n * for the full list of languages and their corresponding codes.\n * \n * ```javascript\n * const translator = await pipeline('translation', 'Xenova/nllb-200-distilled-600M');\n * const output = await translator('जीवन एक चॉकलेट बॉक्स की तरह है।', {\n * src_lang: 'hin_Deva', // Hindi\n * tgt_lang: 'fra_Latn', // French\n * });\n * // [{ translation_text: 'La vie est comme une boîte à chocolat.' }]\n * ```\n * \n * **Example:** Multilingual translation w/ `Xenova/m2m100_418M`.\n * \n * See [here](https://huggingface.co/facebook/m2m100_418M#languages-covered)\n * for the full list of languages and their corresponding codes.\n * \n * ```javascript\n * const translator = await pipeline('translation', 'Xenova/m2m100_418M');\n * const output = await translator('生活就像一盒巧克力。', {\n * src_lang: 'zh', // Chinese\n * tgt_lang: 'en', // English\n * });\n * // [{ translation_text: 'Life is like a box of chocolate.' }]\n * ```\n * \n * **Example:** Multilingual translation w/ `Xenova/mbart-large-50-many-to-many-mmt`.\n * \n * See [here](https://huggingface.co/facebook/mbart-large-50-many-to-many-mmt#languages-covered)\n * for the full list of languages and their corresponding codes.\n * \n * ```javascript\n * const translator = await pipeline('translation', 'Xenova/mbart-large-50-many-to-many-mmt');\n * const output = await translator('संयुक्त राष्ट्र के प्रमुख का कहना है कि सीरिया में कोई सैन्य समाधान नहीं है', {\n * src_lang: 'hi_IN', // Hindi\n * tgt_lang: 'fr_XX', // French\n * });\n * // [{ translation_text: 'Le chef des Nations affirme qu 'il n 'y a military solution in Syria.' }]\n * ```\n */\nclass TranslationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => TranslationPipelineType} */ (/** @type {any} */ (Text2TextGenerationPipeline))) {\n /** @type {'translation_text'} */\n _key = 'translation_text';\n\n /**\n * Create a new TranslationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n}\n\n\n/**\n * @typedef {Object} TextGenerationSingle\n * @property {string} generated_text The generated text.\n * @typedef {TextGenerationSingle[]} TextGenerationOutput\n * \n * @typedef {Object} TextGenerationSpecificParams Parameters specific to text-generation pipelines.\n * @property {boolean} [add_special_tokens] Whether or not to add special tokens when tokenizing the sequences.\n * @typedef {import('./utils/generation.js').GenerationConfigType & TextGenerationSpecificParams} TextGenerationConfig\n * \n * @callback TextGenerationPipelineCallback Complete the prompt(s) given as inputs.\n * @param {string|string[]} texts One or several prompts (or one list of prompts) to complete.\n * @param {TextGenerationConfig} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise} An array or object containing the generated texts.\n * \n * @typedef {TextPipelineConstructorArgs & TextGenerationPipelineCallback & Disposable} TextGenerationPipelineType\n */\n\n/**\n * Language generation pipeline using any `ModelWithLMHead` or `ModelForCausalLM`.\n * This pipeline predicts the words that will follow a specified text prompt.\n * NOTE: For the full list of generation parameters, see [`GenerationConfig`](./utils/generation#module_utils/generation.GenerationConfig).\n * \n * **Example:** Text generation with `Xenova/distilgpt2` (default settings).\n * ```javascript\n * const generator = await pipeline('text-generation', 'Xenova/distilgpt2');\n * const text = 'I enjoy walking with my cute dog,';\n * const output = await generator(text);\n * // [{ generated_text: \"I enjoy walking with my cute dog, and I love to play with the other dogs.\" }]\n * ```\n * \n * **Example:** Text generation with `Xenova/distilgpt2` (custom settings).\n * ```javascript\n * const generator = await pipeline('text-generation', 'Xenova/distilgpt2');\n * const text = 'Once upon a time, there was';\n * const output = await generator(text, {\n * temperature: 2,\n * max_new_tokens: 10,\n * repetition_penalty: 1.5,\n * no_repeat_ngram_size: 2,\n * num_beams: 2,\n * num_return_sequences: 2,\n * });\n * // [{\n * // \"generated_text\": \"Once upon a time, there was an abundance of information about the history and activities that\"\n * // }, {\n * // \"generated_text\": \"Once upon a time, there was an abundance of information about the most important and influential\"\n * // }]\n * ```\n * \n * **Example:** Run code generation with `Xenova/codegen-350M-mono`.\n * ```javascript\n * const generator = await pipeline('text-generation', 'Xenova/codegen-350M-mono');\n * const text = 'def fib(n):';\n * const output = await generator(text, {\n * max_new_tokens: 44,\n * });\n * // [{\n * // generated_text: 'def fib(n):\\n' +\n * // ' if n == 0:\\n' +\n * // ' return 0\\n' +\n * // ' elif n == 1:\\n' +\n * // ' return 1\\n' +\n * // ' else:\\n' +\n * // ' return fib(n-1) + fib(n-2)\\n'\n * // }]\n * ```\n */\nclass TextGenerationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => TextGenerationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new TextGenerationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {TextGenerationPipelineCallback} */\n async _call(texts, generate_kwargs = {}) {\n\n const isBatched = Array.isArray(texts);\n if (!isBatched) {\n texts = [/** @type {string}*/ (texts)];\n }\n\n // By default, do not add special tokens\n const add_special_tokens = generate_kwargs.add_special_tokens ?? false;\n\n this.tokenizer.padding_side = 'left';\n const { input_ids, attention_mask } = this.tokenizer(texts, {\n add_special_tokens,\n padding: true,\n truncation: true,\n });\n\n const outputTokenIds = await this.model.generate(input_ids, generate_kwargs, null, {\n inputs_attention_mask: attention_mask\n });\n\n const decoded = this.tokenizer.batch_decode(outputTokenIds, {\n skip_special_tokens: true,\n });\n\n /** @type {TextGenerationOutput[]} */\n const toReturn = Array.from({ length: texts.length }, _ => []);\n for (let i = 0; i < decoded.length; ++i) {\n const textIndex = Math.floor(i / outputTokenIds.length * texts.length);\n\n toReturn[textIndex].push({\n generated_text: decoded[i]\n });\n }\n return (!isBatched && toReturn.length === 1) ? toReturn[0] : toReturn;\n }\n}\n\n/**\n * @typedef {Object} ZeroShotClassificationOutput\n * @property {string} sequence The sequence for which this is the output.\n * @property {string[]} labels The labels sorted by order of likelihood.\n * @property {number[]} scores The probabilities for each of the labels.\n * \n * @typedef {Object} ZeroShotClassificationPipelineOptions Parameters specific to zero-shot classification pipelines.\n * @property {string} [hypothesis_template=\"This example is {}.\"] The template used to turn each\n * candidate label into an NLI-style hypothesis. The candidate label will replace the {} placeholder.\n * @property {boolean} [multi_label=false] Whether or not multiple candidate labels can be true.\n * If `false`, the scores are normalized such that the sum of the label likelihoods for each sequence\n * is 1. If `true`, the labels are considered independent and probabilities are normalized for each\n * candidate by doing a softmax of the entailment score vs. the contradiction score.\n * \n * @callback ZeroShotClassificationPipelineCallback Classify the sequence(s) given as inputs.\n * @param {string|string[]} texts The sequence(s) to classify, will be truncated if the model input is too large.\n * @param {string|string[]} candidate_labels The set of possible class labels to classify each sequence into.\n * Can be a single label, a string of comma-separated labels, or a list of labels.\n * @param {ZeroShotClassificationPipelineOptions} [options] The options to use for zero-shot classification.\n * @returns {Promise} An array or object containing the predicted labels and scores.\n * \n * @typedef {TextPipelineConstructorArgs & ZeroShotClassificationPipelineCallback & Disposable} ZeroShotClassificationPipelineType\n */\n\n/**\n * NLI-based zero-shot classification pipeline using a `ModelForSequenceClassification`\n * trained on NLI (natural language inference) tasks. Equivalent of `text-classification`\n * pipelines, but these models don't require a hardcoded number of potential classes, they\n * can be chosen at runtime. It usually means it's slower but it is **much** more flexible.\n * \n * **Example:** Zero shot classification with `Xenova/mobilebert-uncased-mnli`.\n * ```javascript\n * const classifier = await pipeline('zero-shot-classification', 'Xenova/mobilebert-uncased-mnli');\n * const text = 'Last week I upgraded my iOS version and ever since then my phone has been overheating whenever I use your app.';\n * const labels = [ 'mobile', 'billing', 'website', 'account access' ];\n * const output = await classifier(text, labels);\n * // {\n * // sequence: 'Last week I upgraded my iOS version and ever since then my phone has been overheating whenever I use your app.',\n * // labels: [ 'mobile', 'website', 'billing', 'account access' ],\n * // scores: [ 0.5562091040482018, 0.1843621307860853, 0.13942646639336376, 0.12000229877234923 ]\n * // }\n * ```\n * \n * **Example:** Zero shot classification with `Xenova/nli-deberta-v3-xsmall` (multi-label).\n * ```javascript\n * const classifier = await pipeline('zero-shot-classification', 'Xenova/nli-deberta-v3-xsmall');\n * const text = 'I have a problem with my iphone that needs to be resolved asap!';\n * const labels = [ 'urgent', 'not urgent', 'phone', 'tablet', 'computer' ];\n * const output = await classifier(text, labels, { multi_label: true });\n * // {\n * // sequence: 'I have a problem with my iphone that needs to be resolved asap!',\n * // labels: [ 'urgent', 'phone', 'computer', 'tablet', 'not urgent' ],\n * // scores: [ 0.9958870956360275, 0.9923963400697035, 0.002333537946160235, 0.0015134138567598765, 0.0010699384208377163 ]\n * // }\n * ```\n */\nclass ZeroShotClassificationPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => ZeroShotClassificationPipelineType} */ (Pipeline)) {\n /**\n * Create a new ZeroShotClassificationPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n\n // Use model config to get label2id mapping\n this.label2id = Object.fromEntries(\n Object.entries((/** @type {any} */(this).model).config.label2id).map(\n ([k, v]) => [k.toLowerCase(), v]\n )\n );\n\n this.entailment_id = this.label2id['entailment'];\n if (this.entailment_id === undefined) {\n console.warn(\"Could not find 'entailment' in label2id mapping. Using 2 as entailment_id.\");\n this.entailment_id = 2;\n }\n\n this.contradiction_id = this.label2id['contradiction'] ?? this.label2id['not_entailment'];\n if (this.contradiction_id === undefined) {\n console.warn(\"Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id.\");\n this.contradiction_id = 0;\n }\n }\n\n /** @type {ZeroShotClassificationPipelineCallback} */\n async _call(texts, candidate_labels, {\n hypothesis_template = \"This example is {}.\",\n multi_label = false,\n } = {}) {\n\n const isBatched = Array.isArray(texts);\n if (!isBatched) {\n texts = [/** @type {string} */ (texts)];\n }\n if (!Array.isArray(candidate_labels)) {\n candidate_labels = [candidate_labels];\n }\n\n // Insert labels into hypothesis template\n const hypotheses = candidate_labels.map(\n x => hypothesis_template.replace('{}', x)\n );\n\n // How to perform the softmax over the logits:\n // - true: softmax over the entailment vs. contradiction dim for each label independently\n // - false: softmax the \"entailment\" logits over all candidate labels\n const softmaxEach = multi_label || candidate_labels.length === 1;\n\n /** @type {ZeroShotClassificationOutput[]} */\n const toReturn = [];\n for (const premise of texts) {\n const entails_logits = [];\n\n for (const hypothesis of hypotheses) {\n const inputs = this.tokenizer(premise, {\n text_pair: hypothesis,\n padding: true,\n truncation: true,\n })\n const outputs = await this.model(inputs)\n\n if (softmaxEach) {\n entails_logits.push([\n outputs.logits.data[this.contradiction_id],\n outputs.logits.data[this.entailment_id]\n ])\n } else {\n entails_logits.push(outputs.logits.data[this.entailment_id])\n }\n }\n\n /** @type {number[]} */\n const scores = softmaxEach\n ? entails_logits.map(x => (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(x)[1])\n : (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(entails_logits);\n\n // Sort by scores (desc) and return scores with indices\n const scores_sorted = scores\n .map((x, i) => [x, i])\n .sort((a, b) => (b[0] - a[0]));\n\n toReturn.push({\n sequence: premise,\n labels: scores_sorted.map(x => candidate_labels[x[1]]),\n scores: scores_sorted.map(x => x[0]),\n });\n }\n return isBatched ? toReturn : toReturn[0];\n }\n}\n\n/**\n * @typedef {Object} FeatureExtractionPipelineOptions Parameters specific to feature extraction pipelines.\n * @property {'none'|'mean'|'cls'} [pooling=\"none\"] The pooling method to use.\n * @property {boolean} [normalize=false] Whether or not to normalize the embeddings in the last dimension.\n * \n * @callback FeatureExtractionPipelineCallback Extract the features of the input(s).\n * @param {string|string[]} texts One or several texts (or one list of texts) to get the features of.\n * @param {FeatureExtractionPipelineOptions} [options] The options to use for feature extraction.\n * @returns {Promise} The features computed by the model.\n * \n * @typedef {TextPipelineConstructorArgs & FeatureExtractionPipelineCallback & Disposable} FeatureExtractionPipelineType\n */\n\n/**\n * Feature extraction pipeline using no model head. This pipeline extracts the hidden\n * states from the base transformer, which can be used as features in downstream tasks.\n * \n * **Example:** Run feature extraction with `bert-base-uncased` (without pooling/normalization).\n * ```javascript\n * const extractor = await pipeline('feature-extraction', 'Xenova/bert-base-uncased', { revision: 'default' });\n * const output = await extractor('This is a simple test.');\n * // Tensor {\n * // type: 'float32',\n * // data: Float32Array [0.05939924716949463, 0.021655935794115067, ...],\n * // dims: [1, 8, 768]\n * // }\n * ```\n * \n * **Example:** Run feature extraction with `bert-base-uncased` (with pooling/normalization).\n * ```javascript\n * const extractor = await pipeline('feature-extraction', 'Xenova/bert-base-uncased', { revision: 'default' });\n * const output = await extractor('This is a simple test.', { pooling: 'mean', normalize: true });\n * // Tensor {\n * // type: 'float32',\n * // data: Float32Array [0.03373778983950615, -0.010106077417731285, ...],\n * // dims: [1, 768]\n * // }\n * ```\n * \n * **Example:** Calculating embeddings with `sentence-transformers` models.\n * ```javascript\n * const extractor = await pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2');\n * const output = await extractor('This is a simple test.', { pooling: 'mean', normalize: true });\n * // Tensor {\n * // type: 'float32',\n * // data: Float32Array [0.09094982594251633, -0.014774246141314507, ...],\n * // dims: [1, 384]\n * // }\n * ```\n */\nclass FeatureExtractionPipeline extends (/** @type {new (options: TextPipelineConstructorArgs) => FeatureExtractionPipelineType} */ (Pipeline)) {\n /**\n * Create a new FeatureExtractionPipeline.\n * @param {TextPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {FeatureExtractionPipelineCallback} */\n async _call(texts, {\n pooling = /** @type {'none'} */('none'),\n normalize = false,\n } = {}) {\n\n // Run tokenization\n const model_inputs = this.tokenizer(texts, {\n padding: true,\n truncation: true,\n });\n\n // Run model\n const outputs = await this.model(model_inputs)\n\n // TODO: Provide warning to the user that they might be using model which was not exported\n // specifically for feature extraction\n // console.log(this.model.config)\n // console.log(outputs)\n\n /** @type {Tensor} */\n let result = outputs.last_hidden_state ?? outputs.logits;\n if (pooling === 'none') {\n // Skip pooling\n } else if (pooling === 'mean') {\n result = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_6__.mean_pooling)(result, model_inputs.attention_mask);\n } else if (pooling === 'cls') {\n result = result.slice(null, 0);\n } else {\n throw Error(`Pooling method '${pooling}' not supported.`);\n }\n\n if (normalize) {\n result = result.normalize(2, -1);\n }\n\n return result;\n }\n}\n\n\n/**\n * @typedef {Object} ImageFeatureExtractionPipelineOptions Parameters specific to image feature extraction pipelines.\n * @property {boolean} [pool=null] Whether or not to return the pooled output. If set to `false`, the model will return the raw hidden states.\n * \n * @callback ImageFeatureExtractionPipelineCallback Extract the features of the input(s).\n * @param {ImagePipelineInputs} images One or several images (or one list of images) to get the features of.\n * @param {ImageFeatureExtractionPipelineOptions} [options] The options to use for image feature extraction.\n * @returns {Promise} The image features computed by the model.\n * \n * @typedef {ImagePipelineConstructorArgs & ImageFeatureExtractionPipelineCallback & Disposable} ImageFeatureExtractionPipelineType\n */\n\n/**\n * Image feature extraction pipeline using no model head. This pipeline extracts the hidden\n * states from the base transformer, which can be used as features in downstream tasks.\n * \n * **Example:** Perform image feature extraction with `Xenova/vit-base-patch16-224-in21k`.\n * ```javascript\n * const image_feature_extractor = await pipeline('image-feature-extraction', 'Xenova/vit-base-patch16-224-in21k');\n * const url = 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/cats.png';\n * const features = await image_feature_extractor(url);\n * // Tensor {\n * // dims: [ 1, 197, 768 ],\n * // type: 'float32',\n * // data: Float32Array(151296) [ ... ],\n * // size: 151296\n * // }\n * ```\n * \n * **Example:** Compute image embeddings with `Xenova/clip-vit-base-patch32`.\n * ```javascript\n * const image_feature_extractor = await pipeline('image-feature-extraction', 'Xenova/clip-vit-base-patch32');\n * const url = 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/cats.png';\n * const features = await image_feature_extractor(url);\n * // Tensor {\n * // dims: [ 1, 512 ],\n * // type: 'float32',\n * // data: Float32Array(512) [ ... ],\n * // size: 512\n * // }\n * ```\n */\nclass ImageFeatureExtractionPipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => ImageFeatureExtractionPipelineType} */ (Pipeline)) {\n /**\n * Create a new ImageFeatureExtractionPipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ImageFeatureExtractionPipelineCallback} */\n async _call(images, {\n pool = null,\n } = {}) {\n\n const preparedImages = await prepareImages(images);\n const { pixel_values } = await this.processor(preparedImages);\n const outputs = await this.model({ pixel_values });\n\n /** @type {Tensor} */\n let result;\n if (pool) {\n if (!('pooler_output' in outputs)) {\n throw Error(`No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.`);\n }\n result = outputs.pooler_output;\n\n } else {\n result = outputs.last_hidden_state ?? outputs.logits ?? outputs.image_embeds;\n }\n return result;\n }\n}\n\n// TODO\n// export class SentenceSimilarityPipeline extends Pipeline {\n// }\n\n/**\n * @typedef {Object} AudioClassificationSingle\n * @property {string} label The label predicted.\n * @property {number} score The corresponding probability.\n * @typedef {AudioClassificationSingle[]} AudioClassificationOutput\n * \n * @typedef {Object} AudioClassificationPipelineOptions Parameters specific to audio classification pipelines.\n * @property {number} [topk=null] The number of top labels that will be returned by the pipeline.\n * If the provided number is `null` or higher than the number of labels available in the model configuration,\n * it will default to the number of labels.\n * \n * @callback AudioClassificationPipelineCallback Classify the sequence(s) given as inputs.\n * @param {AudioPipelineInputs} audio The input audio file(s) to be classified. The input is either:\n * - `string` or `URL` that is the filename/URL of the audio file, the file will be read at the processor's sampling rate\n * to get the waveform using the [`AudioContext`](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext) API.\n * If `AudioContext` is not available, you should pass the raw waveform in as a Float32Array of shape `(n, )`.\n * - `Float32Array` or `Float64Array` of shape `(n, )`, representing the raw audio at the correct sampling rate (no further check will be done).\n * @param {AudioClassificationPipelineOptions} [options] The options to use for audio classification.\n * @returns {Promise} An array or object containing the predicted labels and scores.\n * \n * @typedef {AudioPipelineConstructorArgs & AudioClassificationPipelineCallback & Disposable} AudioClassificationPipelineType\n */\n\n/**\n * Audio classification pipeline using any `AutoModelForAudioClassification`.\n * This pipeline predicts the class of a raw waveform or an audio file.\n * \n * **Example:** Perform audio classification with `Xenova/wav2vec2-large-xlsr-53-gender-recognition-librispeech`.\n * ```javascript\n * const classifier = await pipeline('audio-classification', 'Xenova/wav2vec2-large-xlsr-53-gender-recognition-librispeech');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';\n * const output = await classifier(url);\n * // [\n * // { label: 'male', score: 0.9981542229652405 },\n * // { label: 'female', score: 0.001845747814513743 }\n * // ]\n * ```\n * \n * **Example:** Perform audio classification with `Xenova/ast-finetuned-audioset-10-10-0.4593` and return top 4 results.\n * ```javascript\n * const classifier = await pipeline('audio-classification', 'Xenova/ast-finetuned-audioset-10-10-0.4593');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cat_meow.wav';\n * const output = await classifier(url, { topk: 4 });\n * // [\n * // { label: 'Meow', score: 0.5617874264717102 },\n * // { label: 'Cat', score: 0.22365376353263855 },\n * // { label: 'Domestic animals, pets', score: 0.1141069084405899 },\n * // { label: 'Animal', score: 0.08985692262649536 },\n * // ]\n * ```\n */\nclass AudioClassificationPipeline extends (/** @type {new (options: AudioPipelineConstructorArgs) => AudioClassificationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new AudioClassificationPipeline.\n * @param {AudioPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {AudioClassificationPipelineCallback} */\n async _call(audio, {\n topk = null\n } = {}) {\n\n const single = !Array.isArray(audio);\n\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\n const preparedAudios = await prepareAudios(audio, sampling_rate);\n\n const id2label = this.model.config.id2label;\n\n const toReturn = [];\n for (const aud of preparedAudios) {\n const inputs = await this.processor(aud);\n const output = await this.model(inputs);\n const logits = output.logits[0];\n\n const scores = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.getTopItems)((0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(logits.data), topk);\n\n const vals = scores.map(x => ({\n label: /** @type {string} */ (id2label[x[0]]),\n score: /** @type {number} */ (x[1]),\n }));\n\n if (topk === 1) {\n toReturn.push(...vals);\n } else {\n toReturn.push(vals);\n }\n }\n return !single || topk === 1 ? /** @type {AudioClassificationOutput} */ (toReturn) : /** @type {AudioClassificationOutput[]} */ (toReturn)[0];\n }\n}\n\n/**\n * @typedef {Object} ZeroShotAudioClassificationOutput\n * @property {string} label The label identified by the model. It is one of the suggested `candidate_label`.\n * @property {number} score The score attributed by the model for that label (between 0 and 1).\n * \n * @typedef {Object} ZeroShotAudioClassificationPipelineOptions Parameters specific to zero-shot audio classification pipelines.\n * @property {string} [hypothesis_template=\"This is a sound of {}.\"] The sentence used in conjunction with `candidate_labels`\n * to attempt the audio classification by replacing the placeholder with the candidate_labels.\n * Then likelihood is estimated by using `logits_per_audio`.\n * \n * @callback ZeroShotAudioClassificationPipelineCallback Classify the sequence(s) given as inputs.\n * @param {AudioPipelineInputs} audio The input audio file(s) to be classified. The input is either:\n * - `string` or `URL` that is the filename/URL of the audio file, the file will be read at the processor's sampling rate\n * to get the waveform using the [`AudioContext`](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext) API.\n * If `AudioContext` is not available, you should pass the raw waveform in as a Float32Array of shape `(n, )`.\n * - `Float32Array` or `Float64Array` of shape `(n, )`, representing the raw audio at the correct sampling rate (no further check will be done).\n * @param {string[]} candidate_labels The candidate labels for this audio.\n * @param {ZeroShotAudioClassificationPipelineOptions} [options] The options to use for zero-shot audio classification.\n * @returns {Promise} An array of objects containing the predicted labels and scores.\n * \n * @typedef {TextAudioPipelineConstructorArgs & ZeroShotAudioClassificationPipelineCallback & Disposable} ZeroShotAudioClassificationPipelineType\n */\n\n/**\n * Zero shot audio classification pipeline using `ClapModel`. This pipeline predicts the class of an audio when you\n * provide an audio and a set of `candidate_labels`.\n * \n * **Example**: Perform zero-shot audio classification with `Xenova/clap-htsat-unfused`.\n * ```javascript\n * const classifier = await pipeline('zero-shot-audio-classification', 'Xenova/clap-htsat-unfused');\n * const audio = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/dog_barking.wav';\n * const candidate_labels = ['dog', 'vaccum cleaner'];\n * const scores = await classifier(audio, candidate_labels);\n * // [\n * // { score: 0.9993992447853088, label: 'dog' },\n * // { score: 0.0006007603369653225, label: 'vaccum cleaner' }\n * // ]\n * ```\n */\nclass ZeroShotAudioClassificationPipeline extends (/** @type {new (options: TextAudioPipelineConstructorArgs) => ZeroShotAudioClassificationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new ZeroShotAudioClassificationPipeline.\n * @param {TextAudioPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ZeroShotAudioClassificationPipelineCallback} */\n async _call(audio, candidate_labels, {\n hypothesis_template = \"This is a sound of {}.\"\n } = {}) {\n\n const single = !Array.isArray(audio);\n if (single) {\n audio = [/** @type {AudioInput} */ (audio)];\n }\n\n // Insert label into hypothesis template \n const texts = candidate_labels.map(\n x => hypothesis_template.replace('{}', x)\n );\n\n // Run tokenization\n const text_inputs = this.tokenizer(texts, {\n padding: true,\n truncation: true,\n });\n\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\n const preparedAudios = await prepareAudios(audio, sampling_rate);\n\n const toReturn = [];\n for (const aud of preparedAudios) {\n const audio_inputs = await this.processor(aud);\n\n // Run model with both text and audio inputs\n const output = await this.model({ ...text_inputs, ...audio_inputs });\n\n // Compute softmax per audio\n const probs = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(output.logits_per_audio.data);\n\n toReturn.push([...probs].map((x, i) => ({\n score: x,\n label: candidate_labels[i]\n })));\n }\n return single ? toReturn[0] : toReturn;\n }\n}\n\n/**\n * @typedef {{stride: number[], input_features: Tensor, is_last: boolean, tokens?: number[], token_timestamps?: number[]}} ChunkCallbackItem\n * @callback ChunkCallback\n * @param {ChunkCallbackItem} chunk The chunk to process.\n */\n\n/**\n * @typedef {Object} Chunk\n * @property {[number, number]} timestamp The start and end timestamp of the chunk in seconds.\n * @property {string} text The recognized text.\n */\n\n/**\n * @typedef {Object} AutomaticSpeechRecognitionOutput\n * @property {string} text The recognized text.\n * @property {Chunk[]} [chunks] When using `return_timestamps`, the `chunks` will become a list\n * containing all the various text chunks identified by the model.\n * \n * @typedef {Object} AutomaticSpeechRecognitionSpecificParams Parameters specific to automatic-speech-recognition pipelines.\n * @property {boolean|'word'} [kwargs.return_timestamps] Whether to return timestamps or not. Default is `false`.\n * @property {number} [kwargs.chunk_length_s] The length of audio chunks to process in seconds. Default is 0 (no chunking).\n * @property {number} [kwargs.stride_length_s] The length of overlap between consecutive audio chunks in seconds. If not provided, defaults to `chunk_length_s / 6`.\n * @property {ChunkCallback} [kwargs.chunk_callback] Callback function to be called with each chunk processed.\n * @property {boolean} [kwargs.force_full_sequences] Whether to force outputting full sequences or not. Default is `false`.\n * @property {string} [kwargs.language] The source language. Default is `null`, meaning it should be auto-detected. Use this to potentially improve performance if the source language is known.\n * @property {string} [kwargs.task] The task to perform. Default is `null`, meaning it should be auto-detected.\n * @property {number[][]} [kwargs.forced_decoder_ids] A list of pairs of integers which indicates a mapping from generation indices to token indices\n * that will be forced before sampling. For example, [[1, 123]] means the second generated token will always be a token of index 123.\n * @property {number} [num_frames] The number of frames in the input audio.\n * @typedef {import('./utils/generation.js').GenerationConfigType & AutomaticSpeechRecognitionSpecificParams} AutomaticSpeechRecognitionConfig\n * \n * @callback AutomaticSpeechRecognitionPipelineCallback Transcribe the audio sequence(s) given as inputs to text.\n * @param {AudioPipelineInputs} audio The input audio file(s) to be transcribed. The input is either:\n * - `string` or `URL` that is the filename/URL of the audio file, the file will be read at the processor's sampling rate\n * to get the waveform using the [`AudioContext`](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext) API.\n * If `AudioContext` is not available, you should pass the raw waveform in as a Float32Array of shape `(n, )`.\n * - `Float32Array` or `Float64Array` of shape `(n, )`, representing the raw audio at the correct sampling rate (no further check will be done).\n * @param {AutomaticSpeechRecognitionConfig} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise} An object containing the transcription text and optionally timestamps if `return_timestamps` is `true`.\n * \n * @typedef {TextAudioPipelineConstructorArgs & AutomaticSpeechRecognitionPipelineCallback & Disposable} AutomaticSpeechRecognitionPipelineType\n */\n\n/**\n * Pipeline that aims at extracting spoken text contained within some audio.\n *\n * **Example:** Transcribe English.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';\n * const output = await transcriber(url);\n * // { text: \" And so my fellow Americans ask not what your country can do for you, ask what you can do for your country.\" }\n * ```\n * \n * **Example:** Transcribe English w/ timestamps.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';\n * const output = await transcriber(url, { return_timestamps: true });\n * // {\n * // text: \" And so my fellow Americans ask not what your country can do for you, ask what you can do for your country.\"\n * // chunks: [\n * // { timestamp: [0, 8], text: \" And so my fellow Americans ask not what your country can do for you\" }\n * // { timestamp: [8, 11], text: \" ask what you can do for your country.\" }\n * // ]\n * // }\n * ```\n * \n * **Example:** Transcribe English w/ word-level timestamps.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';\n * const output = await transcriber(url, { return_timestamps: 'word' });\n * // {\n * // \"text\": \" And so my fellow Americans ask not what your country can do for you ask what you can do for your country.\",\n * // \"chunks\": [\n * // { \"text\": \" And\", \"timestamp\": [0, 0.78] },\n * // { \"text\": \" so\", \"timestamp\": [0.78, 1.06] },\n * // { \"text\": \" my\", \"timestamp\": [1.06, 1.46] },\n * // ...\n * // { \"text\": \" for\", \"timestamp\": [9.72, 9.92] },\n * // { \"text\": \" your\", \"timestamp\": [9.92, 10.22] },\n * // { \"text\": \" country.\", \"timestamp\": [10.22, 13.5] }\n * // ]\n * // }\n * ```\n * \n * **Example:** Transcribe French.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-small');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/french-audio.mp3';\n * const output = await transcriber(url, { language: 'french', task: 'transcribe' });\n * // { text: \" J'adore, j'aime, je n'aime pas, je déteste.\" }\n * ```\n * \n * **Example:** Translate French to English.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-small');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/french-audio.mp3';\n * const output = await transcriber(url, { language: 'french', task: 'translate' });\n * // { text: \" I love, I like, I don't like, I hate.\" }\n * ```\n * \n * **Example:** Transcribe/translate audio longer than 30 seconds.\n * ```javascript\n * const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/ted_60.wav';\n * const output = await transcriber(url, { chunk_length_s: 30, stride_length_s: 5 });\n * // { text: \" So in college, I was a government major, which means [...] So I'd start off light and I'd bump it up\" }\n * ```\n */\nclass AutomaticSpeechRecognitionPipeline extends (/** @type {new (options: TextAudioPipelineConstructorArgs) => AutomaticSpeechRecognitionPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new AutomaticSpeechRecognitionPipeline.\n * @param {TextAudioPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {AutomaticSpeechRecognitionPipelineCallback} */\n async _call(audio, kwargs = {}) {\n switch (this.model.config.model_type) {\n case 'whisper':\n return this._call_whisper(audio, kwargs)\n case 'wav2vec2':\n case 'wav2vec2-bert':\n case 'unispeech':\n case 'unispeech-sat':\n case 'hubert':\n return this._call_wav2vec2(audio, kwargs)\n default:\n throw new Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)\n }\n }\n\n /**\n * @type {AutomaticSpeechRecognitionPipelineCallback}\n * @private\n */\n async _call_wav2vec2(audio, kwargs = {}) {\n // TODO use kwargs\n\n if (kwargs.language) {\n console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to \"English\".');\n }\n if (kwargs.task) {\n console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to \"transcribe\".');\n }\n\n const single = !Array.isArray(audio);\n if (single) {\n audio = [/** @type {AudioInput} */ (audio)];\n }\n\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\n const preparedAudios = await prepareAudios(audio, sampling_rate);\n\n const toReturn = [];\n for (const aud of preparedAudios) {\n const inputs = await this.processor(aud);\n const output = await this.model(inputs);\n const logits = output.logits[0];\n\n const predicted_ids = [];\n for (const item of logits) {\n predicted_ids.push((0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.max)(item.data)[1])\n }\n const predicted_sentences = this.tokenizer.decode(predicted_ids)\n toReturn.push({ text: predicted_sentences })\n }\n return single ? toReturn[0] : toReturn;\n }\n\n /**\n * @type {AutomaticSpeechRecognitionPipelineCallback}\n * @private\n */\n async _call_whisper(audio, kwargs = {}) {\n\n const return_timestamps = kwargs.return_timestamps ?? false;\n const chunk_length_s = kwargs.chunk_length_s ?? 0;\n const chunk_callback = kwargs.chunk_callback ?? null;\n const force_full_sequences = kwargs.force_full_sequences ?? false;\n let stride_length_s = kwargs.stride_length_s ?? null;\n\n if (return_timestamps === 'word') {\n kwargs['return_token_timestamps'] = true;\n }\n\n const language = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_3__.pop)(kwargs, 'language', null);\n const task = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_3__.pop)(kwargs, 'task', null);\n\n if (language || task || return_timestamps) {\n if (kwargs.forced_decoder_ids) {\n throw new Error(\"Cannot specify `language`/`task`/`return_timestamps` and `forced_decoder_ids` at the same time.\")\n }\n // @ts-ignore\n const decoder_prompt_ids = this.tokenizer.get_decoder_prompt_ids({ language, task, no_timestamps: !return_timestamps })\n if (decoder_prompt_ids.length > 0) {\n kwargs.forced_decoder_ids = decoder_prompt_ids;\n }\n }\n\n const single = !Array.isArray(audio);\n if (single) {\n audio = [/** @type {AudioInput} */ (audio)];\n }\n\n const time_precision = this.processor.feature_extractor.config.chunk_length / this.model.config.max_source_positions;\n const hop_length = this.processor.feature_extractor.config.hop_length;\n\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\n const preparedAudios = await prepareAudios(audio, sampling_rate);\n\n const toReturn = [];\n for (const aud of preparedAudios) {\n /** @type {ChunkCallbackItem[]} */\n let chunks = [];\n if (chunk_length_s > 0) {\n if (stride_length_s === null) {\n stride_length_s = chunk_length_s / 6;\n } else if (chunk_length_s <= stride_length_s) {\n throw Error(\"`chunk_length_s` must be larger than `stride_length_s`.\")\n }\n\n // TODO support different stride_length_s (for left and right)\n\n const window = sampling_rate * chunk_length_s;\n const stride = sampling_rate * stride_length_s;\n const jump = window - 2 * stride;\n let offset = 0;\n\n // Create subarrays of audio with overlaps\n\n while (offset < aud.length) {\n const subarr = aud.subarray(offset, offset + window);\n const feature = await this.processor(subarr);\n\n const isFirst = offset === 0;\n const isLast = offset + jump >= aud.length;\n chunks.push({\n stride: [\n subarr.length,\n isFirst ? 0 : stride,\n isLast ? 0 : stride\n ],\n input_features: feature.input_features,\n is_last: isLast\n })\n offset += jump;\n }\n\n } else {\n chunks = [{\n stride: [aud.length, 0, 0],\n input_features: (await this.processor(aud)).input_features,\n is_last: true\n }]\n }\n\n // Generate for each set of input features\n for (const chunk of chunks) {\n kwargs.num_frames = Math.floor(chunk.stride[0] / hop_length);\n\n // NOTE: doing sequentially for now\n const data = await this.model.generate(chunk.input_features, kwargs);\n\n // TODO: Right now we only get top beam\n if (return_timestamps === 'word') {\n chunk.tokens = data.sequences[0];\n chunk.token_timestamps = data.token_timestamps.tolist()[0].map(\n (/** @type {number} */ x) => (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.round)(x, 2)\n );\n\n } else {\n chunk.tokens = data[0];\n }\n\n // convert stride to seconds\n chunk.stride = chunk.stride.map(x => x / sampling_rate);\n\n if (chunk_callback !== null) {\n chunk_callback(chunk)\n }\n }\n\n // Merge text chunks\n // @ts-ignore\n const [full_text, optional] = this.tokenizer._decode_asr(chunks, {\n time_precision, return_timestamps, force_full_sequences\n });\n\n toReturn.push({ text: full_text, ...optional })\n }\n return single ? toReturn[0] : toReturn;\n }\n}\n\n/**\n * @typedef {Object} ImageToTextSingle\n * @property {string} generated_text The generated text.\n * @typedef {ImageToTextSingle[]} ImageToTextOutput\n * \n * @callback ImageToTextPipelineCallback Assign labels to the image(s) passed as inputs.\n * @param {ImagePipelineInputs} texts The images to be captioned.\n * @param {import('./utils/generation.js').GenerationConfigType} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise} An object (or array of objects) containing the generated text(s).\n * \n * @typedef {TextImagePipelineConstructorArgs & ImageToTextPipelineCallback & Disposable} ImageToTextPipelineType\n */\n\n/**\n * Image To Text pipeline using a `AutoModelForVision2Seq`. This pipeline predicts a caption for a given image.\n * \n * **Example:** Generate a caption for an image w/ `Xenova/vit-gpt2-image-captioning`.\n * ```javascript\n * const captioner = await pipeline('image-to-text', 'Xenova/vit-gpt2-image-captioning');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';\n * const output = await captioner(url);\n * // [{ generated_text: 'a cat laying on a couch with another cat' }]\n * ```\n * \n * **Example:** Optical Character Recognition (OCR) w/ `Xenova/trocr-small-handwritten`.\n * ```javascript\n * const captioner = await pipeline('image-to-text', 'Xenova/trocr-small-handwritten');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/handwriting.jpg';\n * const output = await captioner(url);\n * // [{ generated_text: 'Mr. Brown commented icily.' }]\n * ```\n */\nclass ImageToTextPipeline extends (/** @type {new (options: TextImagePipelineConstructorArgs) => ImageToTextPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new ImageToTextPipeline.\n * @param {TextImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ImageToTextPipelineCallback} */\n async _call(images, generate_kwargs = {}) {\n\n const isBatched = Array.isArray(images);\n const preparedImages = await prepareImages(images);\n\n const { pixel_values } = await this.processor(preparedImages);\n\n const toReturn = [];\n for (const batch of pixel_values) {\n batch.dims = [1, ...batch.dims]\n const output = await this.model.generate(batch, generate_kwargs);\n const decoded = this.tokenizer.batch_decode(output, {\n skip_special_tokens: true,\n }).map(x => ({ generated_text: x.trim() }))\n toReturn.push(decoded);\n }\n\n return isBatched ? toReturn : toReturn[0];\n }\n}\n\n/**\n * @typedef {Object} ImageClassificationSingle\n * @property {string} label The label identified by the model.\n * @property {number} score The score attributed by the model for that label.\n * @typedef {ImageClassificationSingle[]} ImageClassificationOutput\n * \n * @typedef {Object} ImageClassificationPipelineOptions Parameters specific to image classification pipelines.\n * @property {number} [topk=1] The number of top labels that will be returned by the pipeline. \n * \n * @callback ImageClassificationPipelineCallback Assign labels to the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The input images(s) to be classified.\n * @param {ImageClassificationPipelineOptions} [options] The options to use for image classification.\n * @returns {Promise} An array or object containing the predicted labels and scores.\n * \n * @typedef {ImagePipelineConstructorArgs & ImageClassificationPipelineCallback & Disposable} ImageClassificationPipelineType\n */\n\n/**\n * Image classification pipeline using any `AutoModelForImageClassification`.\n * This pipeline predicts the class of an image.\n * \n * **Example:** Classify an image.\n * ```javascript\n * const classifier = await pipeline('image-classification', 'Xenova/vit-base-patch16-224');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';\n * const output = await classifier(url);\n * // [\n * // { label: 'tiger, Panthera tigris', score: 0.632695734500885 },\n * // ]\n * ```\n * \n * **Example:** Classify an image and return top `n` classes.\n * ```javascript\n * const classifier = await pipeline('image-classification', 'Xenova/vit-base-patch16-224');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';\n * const output = await classifier(url, { topk: 3 });\n * // [\n * // { label: 'tiger, Panthera tigris', score: 0.632695734500885 },\n * // { label: 'tiger cat', score: 0.3634825646877289 },\n * // { label: 'lion, king of beasts, Panthera leo', score: 0.00045060308184474707 },\n * // ]\n * ```\n * \n * **Example:** Classify an image and return all classes.\n * ```javascript\n * const classifier = await pipeline('image-classification', 'Xenova/vit-base-patch16-224');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';\n * const output = await classifier(url, { topk: 0 });\n * // [\n * // { label: 'tiger, Panthera tigris', score: 0.632695734500885 },\n * // { label: 'tiger cat', score: 0.3634825646877289 },\n * // { label: 'lion, king of beasts, Panthera leo', score: 0.00045060308184474707 },\n * // { label: 'jaguar, panther, Panthera onca, Felis onca', score: 0.00035465499968267977 },\n * // ...\n * // ]\n * ```\n */\nclass ImageClassificationPipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => ImageClassificationPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new ImageClassificationPipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ImageClassificationPipelineCallback} */\n async _call(images, {\n topk = 1\n } = {}) {\n\n const isBatched = Array.isArray(images);\n const preparedImages = await prepareImages(images);\n\n const { pixel_values } = await this.processor(preparedImages);\n const output = await this.model({ pixel_values });\n\n const id2label = this.model.config.id2label;\n const toReturn = [];\n for (const batch of output.logits) {\n const scores = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.getTopItems)((0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(batch.data), topk);\n\n const vals = scores.map(x => ({\n label: id2label[x[0]],\n score: x[1],\n }));\n if (topk === 1) {\n toReturn.push(...vals);\n } else {\n toReturn.push(vals);\n }\n }\n\n return isBatched || topk === 1 ? /** @type {ImageClassificationOutput} */ (toReturn) : /** @type {ImageClassificationOutput[]} */ (toReturn)[0];\n }\n\n}\n\n/**\n * @typedef {Object} ImageSegmentationPipelineOutput\n * @property {string} label The label of the segment.\n * @property {number|null} score The score of the segment.\n * @property {RawImage} mask The mask of the segment.\n * \n * @typedef {Object} ImageSegmentationPipelineOptions Parameters specific to image segmentation pipelines.\n * @property {number} [threshold=0.5] Probability threshold to filter out predicted masks.\n * @property {number} [mask_threshold=0.5] Threshold to use when turning the predicted masks into binary values.\n * @property {number} [overlap_mask_area_threshold=0.8] Mask overlap threshold to eliminate small, disconnected segments.\n * @property {null|string} [subtask=null] Segmentation task to be performed. One of [`panoptic`, `instance`, and `semantic`],\n * depending on model capabilities. If not set, the pipeline will attempt to resolve (in that order).\n * @property {number[]} [label_ids_to_fuse=null] List of label ids to fuse. If not set, do not fuse any labels.\n * @property {number[][]} [target_sizes=null] List of target sizes for the input images. If not set, use the original image sizes.\n * \n * @callback ImageSegmentationPipelineCallback Segment the input images.\n * @param {ImagePipelineInputs} images The input images.\n * @param {ImageSegmentationPipelineOptions} [options] The options to use for image segmentation.\n * @returns {Promise} The annotated segments.\n * \n * @typedef {ImagePipelineConstructorArgs & ImageSegmentationPipelineCallback & Disposable} ImageSegmentationPipelineType\n */\n\n/**\n * Image segmentation pipeline using any `AutoModelForXXXSegmentation`.\n * This pipeline predicts masks of objects and their classes.\n * \n * **Example:** Perform image segmentation with `Xenova/detr-resnet-50-panoptic`.\n * ```javascript\n * const segmenter = await pipeline('image-segmentation', 'Xenova/detr-resnet-50-panoptic');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';\n * const output = await segmenter(url);\n * // [\n * // { label: 'remote', score: 0.9984649419784546, mask: RawImage { ... } },\n * // { label: 'cat', score: 0.9994316101074219, mask: RawImage { ... } }\n * // ]\n * ```\n */\nclass ImageSegmentationPipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => ImageSegmentationPipelineType} */ (Pipeline)) {\n /**\n * Create a new ImageSegmentationPipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n\n this.subtasks_mapping = {\n // Mapping of subtasks to their corresponding post-processing function names.\n panoptic: 'post_process_panoptic_segmentation',\n instance: 'post_process_instance_segmentation',\n semantic: 'post_process_semantic_segmentation'\n }\n }\n\n /** @type {ImageSegmentationPipelineCallback} */\n async _call(images, {\n threshold = 0.5,\n mask_threshold = 0.5,\n overlap_mask_area_threshold = 0.8,\n label_ids_to_fuse = null,\n target_sizes = null,\n subtask = null,\n } = {}) {\n const isBatched = Array.isArray(images);\n\n if (isBatched && images.length !== 1) {\n throw Error(\"Image segmentation pipeline currently only supports a batch size of 1.\");\n }\n\n const preparedImages = await prepareImages(images);\n const imageSizes = preparedImages.map(x => [x.height, x.width]);\n\n const { pixel_values, pixel_mask } = await this.processor(preparedImages);\n const output = await this.model({ pixel_values, pixel_mask });\n\n let fn = null;\n if (subtask !== null) {\n fn = this.subtasks_mapping[subtask];\n } else {\n for (let [task, func] of Object.entries(this.subtasks_mapping)) {\n if (func in this.processor.feature_extractor) {\n fn = this.processor.feature_extractor[func].bind(this.processor.feature_extractor);\n subtask = task;\n break;\n }\n }\n }\n\n const id2label = this.model.config.id2label;\n\n /** @type {ImageSegmentationPipelineOutput[]} */\n const annotation = [];\n if (subtask === 'panoptic' || subtask === 'instance') {\n const processed = fn(\n output,\n threshold,\n mask_threshold,\n overlap_mask_area_threshold,\n label_ids_to_fuse,\n target_sizes ?? imageSizes, // TODO FIX?\n )[0];\n\n const segmentation = processed.segmentation;\n\n for (const segment of processed.segments_info) {\n const maskData = new Uint8ClampedArray(segmentation.data.length);\n for (let i = 0; i < segmentation.data.length; ++i) {\n if (segmentation.data[i] === segment.id) {\n maskData[i] = 255;\n }\n }\n\n const mask = new _utils_image_js__WEBPACK_IMPORTED_MODULE_7__.RawImage(maskData, segmentation.dims[1], segmentation.dims[0], 1)\n\n annotation.push({\n score: segment.score,\n label: id2label[segment.label_id],\n mask: mask\n })\n }\n\n } else if (subtask === 'semantic') {\n const { segmentation, labels } = fn(output, target_sizes ?? imageSizes)[0];\n\n for (const label of labels) {\n const maskData = new Uint8ClampedArray(segmentation.data.length);\n for (let i = 0; i < segmentation.data.length; ++i) {\n if (segmentation.data[i] === label) {\n maskData[i] = 255;\n }\n }\n\n const mask = new _utils_image_js__WEBPACK_IMPORTED_MODULE_7__.RawImage(maskData, segmentation.dims[1], segmentation.dims[0], 1);\n\n annotation.push({\n score: null,\n label: id2label[label],\n mask: mask\n });\n }\n } else {\n throw Error(`Subtask ${subtask} not supported.`);\n }\n\n return annotation;\n }\n}\n\n/**\n * @typedef {Object} ZeroShotImageClassificationOutput\n * @property {string} label The label identified by the model. It is one of the suggested `candidate_label`.\n * @property {number} score The score attributed by the model for that label (between 0 and 1).\n * \n * @typedef {Object} ZeroShotImageClassificationPipelineOptions Parameters specific to zero-shot image classification pipelines.\n * @property {string} [hypothesis_template=\"This is a photo of {}\"] The sentence used in conjunction with `candidate_labels`\n * to attempt the image classification by replacing the placeholder with the candidate_labels.\n * Then likelihood is estimated by using `logits_per_image`.\n * \n * @callback ZeroShotImageClassificationPipelineCallback Assign labels to the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The input images.\n * @param {string[]} candidate_labels The candidate labels for this image.\n * @param {ZeroShotImageClassificationPipelineOptions} [options] The options to use for zero-shot image classification.\n * @returns {Promise} An array of objects containing the predicted labels and scores.\n * \n * @typedef {TextImagePipelineConstructorArgs & ZeroShotImageClassificationPipelineCallback & Disposable} ZeroShotImageClassificationPipelineType\n */\n\n/**\n * Zero shot image classification pipeline. This pipeline predicts the class of\n * an image when you provide an image and a set of `candidate_labels`.\n * \n * **Example:** Zero shot image classification w/ `Xenova/clip-vit-base-patch32`.\n * ```javascript\n * const classifier = await pipeline('zero-shot-image-classification', 'Xenova/clip-vit-base-patch32');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';\n * const output = await classifier(url, ['tiger', 'horse', 'dog']);\n * // [\n * // { score: 0.9993917942047119, label: 'tiger' },\n * // { score: 0.0003519294841680676, label: 'horse' },\n * // { score: 0.0002562698791734874, label: 'dog' }\n * // ]\n * ```\n */\nclass ZeroShotImageClassificationPipeline extends (/** @type {new (options: TextImagePipelineConstructorArgs) => ZeroShotImageClassificationPipelineType} */ (Pipeline)) {\n /**\n * Create a new ZeroShotImageClassificationPipeline.\n * @param {TextImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ZeroShotImageClassificationPipelineCallback} */\n async _call(images, candidate_labels, {\n hypothesis_template = \"This is a photo of {}\"\n } = {}) {\n\n const isBatched = Array.isArray(images);\n const preparedImages = await prepareImages(images);\n\n // Insert label into hypothesis template \n const texts = candidate_labels.map(\n x => hypothesis_template.replace('{}', x)\n );\n\n // Run tokenization\n const text_inputs = this.tokenizer(texts, {\n padding: this.model.config.model_type === 'siglip' ? 'max_length' : true,\n truncation: true,\n });\n\n // Run processor\n const { pixel_values } = await this.processor(preparedImages);\n\n // Run model with both text and pixel inputs\n const output = await this.model({ ...text_inputs, pixel_values });\n\n const function_to_apply =\n this.model.config.model_type === 'siglip'\n ? batch => batch.sigmoid().data\n : batch => (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.softmax)(batch.data);\n\n // Compare each image with each candidate label\n const toReturn = [];\n for (const batch of output.logits_per_image) {\n // Compute softmax per image\n const probs = function_to_apply(batch);\n\n const result = [...probs].map((x, i) => ({\n score: x,\n label: candidate_labels[i]\n }));\n result.sort((a, b) => b.score - a.score); // sort by score in descending order\n toReturn.push(result);\n }\n\n return isBatched ? toReturn : toReturn[0];\n }\n}\n\n\n/**\n * @typedef {Object} ObjectDetectionPipelineSingle\n * @property {string} label The class label identified by the model.\n * @property {number} score The score attributed by the model for that label.\n * @property {BoundingBox} box The bounding box of detected object in image's original size, or as a percentage if `percentage` is set to true.\n * @typedef {ObjectDetectionPipelineSingle[]} ObjectDetectionPipelineOutput\n * \n * @typedef {Object} ObjectDetectionPipelineOptions Parameters specific to object detection pipelines.\n * @property {number} [threshold=0.9] The threshold used to filter boxes by score.\n * @property {boolean} [percentage=false] Whether to return the boxes coordinates in percentage (true) or in pixels (false).\n * \n * @callback ObjectDetectionPipelineCallback Detect objects (bounding boxes & classes) in the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The input images.\n * @param {ObjectDetectionPipelineOptions} [options] The options to use for object detection.\n * @returns {Promise} A list of objects or a list of list of objects. \n * \n * @typedef {ImagePipelineConstructorArgs & ObjectDetectionPipelineCallback & Disposable} ObjectDetectionPipelineType\n */\n\n/**\n * Object detection pipeline using any `AutoModelForObjectDetection`.\n * This pipeline predicts bounding boxes of objects and their classes.\n * \n * **Example:** Run object-detection with `Xenova/detr-resnet-50`.\n * ```javascript\n * const detector = await pipeline('object-detection', 'Xenova/detr-resnet-50');\n * const img = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';\n * const output = await detector(img, { threshold: 0.9 });\n * // [{\n * // score: 0.9976370930671692,\n * // label: \"remote\",\n * // box: { xmin: 31, ymin: 68, xmax: 190, ymax: 118 }\n * // },\n * // ...\n * // {\n * // score: 0.9984092116355896,\n * // label: \"cat\",\n * // box: { xmin: 331, ymin: 19, xmax: 649, ymax: 371 }\n * // }]\n * ```\n */\nclass ObjectDetectionPipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => ObjectDetectionPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new ObjectDetectionPipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ObjectDetectionPipelineCallback} */\n async _call(images, {\n threshold = 0.9,\n percentage = false,\n } = {}) {\n\n const isBatched = Array.isArray(images);\n\n if (isBatched && images.length !== 1) {\n throw Error(\"Object detection pipeline currently only supports a batch size of 1.\");\n }\n const preparedImages = await prepareImages(images);\n\n const imageSizes = percentage ? null : preparedImages.map(x => [x.height, x.width]);\n\n const { pixel_values, pixel_mask } = await this.processor(preparedImages);\n const output = await this.model({ pixel_values, pixel_mask });\n\n // @ts-ignore\n const processed = this.processor.feature_extractor.post_process_object_detection(output, threshold, imageSizes);\n\n // Add labels\n const id2label = this.model.config.id2label;\n\n // Format output\n /** @type {ObjectDetectionPipelineOutput[]} */\n const result = processed.map(batch => (\n batch.boxes.map((box, i) => ({\n score: batch.scores[i],\n label: id2label[batch.classes[i]],\n box: get_bounding_box(box, !percentage),\n }))\n ))\n\n return isBatched ? result : result[0];\n }\n}\n\n\n/**\n * @typedef {Object} ZeroShotObjectDetectionOutput\n * @property {string} label Text query corresponding to the found object.\n * @property {number} score Score corresponding to the object (between 0 and 1).\n * @property {BoundingBox} box Bounding box of the detected object in image's original size, or as a percentage if `percentage` is set to true.\n * \n * @typedef {Object} ZeroShotObjectDetectionPipelineOptions Parameters specific to zero-shot object detection pipelines.\n * @property {number} [threshold=0.1] The probability necessary to make a prediction.\n * @property {number} [topk=null] The number of top predictions that will be returned by the pipeline.\n * If the provided number is `null` or higher than the number of predictions available, it will default\n * to the number of predictions.\n * @property {boolean} [percentage=false] Whether to return the boxes coordinates in percentage (true) or in pixels (false).\n * \n * @callback ZeroShotObjectDetectionPipelineCallback Detect objects (bounding boxes & classes) in the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The input images.\n * @param {string[]} candidate_labels What the model should recognize in the image.\n * @param {ZeroShotObjectDetectionPipelineOptions} [options] The options to use for zero-shot object detection.\n * @returns {Promise} An array of objects containing the predicted labels, scores, and bounding boxes.\n * \n * @typedef {TextImagePipelineConstructorArgs & ZeroShotObjectDetectionPipelineCallback & Disposable} ZeroShotObjectDetectionPipelineType\n */\n\n/**\n * Zero-shot object detection pipeline. This pipeline predicts bounding boxes of\n * objects when you provide an image and a set of `candidate_labels`.\n * \n * **Example:** Zero-shot object detection w/ `Xenova/owlvit-base-patch32`.\n * ```javascript\n * const detector = await pipeline('zero-shot-object-detection', 'Xenova/owlvit-base-patch32');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/astronaut.png';\n * const candidate_labels = ['human face', 'rocket', 'helmet', 'american flag'];\n * const output = await detector(url, candidate_labels);\n * // [\n * // {\n * // score: 0.24392342567443848,\n * // label: 'human face',\n * // box: { xmin: 180, ymin: 67, xmax: 274, ymax: 175 }\n * // },\n * // {\n * // score: 0.15129457414150238,\n * // label: 'american flag',\n * // box: { xmin: 0, ymin: 4, xmax: 106, ymax: 513 }\n * // },\n * // {\n * // score: 0.13649864494800568,\n * // label: 'helmet',\n * // box: { xmin: 277, ymin: 337, xmax: 511, ymax: 511 }\n * // },\n * // {\n * // score: 0.10262022167444229,\n * // label: 'rocket',\n * // box: { xmin: 352, ymin: -1, xmax: 463, ymax: 287 }\n * // }\n * // ]\n * ```\n * \n * **Example:** Zero-shot object detection w/ `Xenova/owlvit-base-patch32` (returning top 4 matches and setting a threshold).\n * ```javascript\n * const detector = await pipeline('zero-shot-object-detection', 'Xenova/owlvit-base-patch32');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/beach.png';\n * const candidate_labels = ['hat', 'book', 'sunglasses', 'camera'];\n * const output = await detector(url, candidate_labels, { topk: 4, threshold: 0.05 });\n * // [\n * // {\n * // score: 0.1606510728597641,\n * // label: 'sunglasses',\n * // box: { xmin: 347, ymin: 229, xmax: 429, ymax: 264 }\n * // },\n * // {\n * // score: 0.08935828506946564,\n * // label: 'hat',\n * // box: { xmin: 38, ymin: 174, xmax: 258, ymax: 364 }\n * // },\n * // {\n * // score: 0.08530698716640472,\n * // label: 'camera',\n * // box: { xmin: 187, ymin: 350, xmax: 260, ymax: 411 }\n * // },\n * // {\n * // score: 0.08349756896495819,\n * // label: 'book',\n * // box: { xmin: 261, ymin: 280, xmax: 494, ymax: 425 }\n * // }\n * // ]\n * ```\n */\nclass ZeroShotObjectDetectionPipeline extends (/** @type {new (options: TextImagePipelineConstructorArgs) => ZeroShotObjectDetectionPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new ZeroShotObjectDetectionPipeline.\n * @param {TextImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ZeroShotObjectDetectionPipelineCallback} */\n async _call(images, candidate_labels, {\n threshold = 0.1,\n topk = null,\n percentage = false,\n } = {}) {\n\n const isBatched = Array.isArray(images);\n const preparedImages = await prepareImages(images);\n\n // Run tokenization\n const text_inputs = this.tokenizer(candidate_labels, {\n padding: true,\n truncation: true,\n });\n\n // Run processor\n const model_inputs = await this.processor(preparedImages);\n\n // Since non-maximum suppression is performed for exporting, we need to\n // process each image separately. For more information, see:\n // https://github.com/huggingface/optimum/blob/e3b7efb1257c011db907ef40ab340e795cc5684c/optimum/exporters/onnx/model_configs.py#L1028-L1032\n const toReturn = [];\n for (let i = 0; i < preparedImages.length; ++i) {\n const image = preparedImages[i];\n const imageSize = percentage ? null : [[image.height, image.width]];\n const pixel_values = model_inputs.pixel_values[i].unsqueeze_(0);\n\n // Run model with both text and pixel inputs\n const output = await this.model({ ...text_inputs, pixel_values });\n\n // @ts-ignore\n const processed = this.processor.feature_extractor.post_process_object_detection(output, threshold, imageSize, true)[0];\n let result = processed.boxes.map((box, i) => ({\n score: processed.scores[i],\n label: candidate_labels[processed.classes[i]],\n box: get_bounding_box(box, !percentage),\n })).sort((a, b) => b.score - a.score);\n if (topk !== null) {\n result = result.slice(0, topk);\n }\n toReturn.push(result)\n }\n\n return isBatched ? toReturn : toReturn[0];\n }\n}\n\n/**\n * @typedef {Object} DocumentQuestionAnsweringSingle\n * @property {string} answer The generated text.\n * @typedef {DocumentQuestionAnsweringSingle[]} DocumentQuestionAnsweringOutput\n * \n * @callback DocumentQuestionAnsweringPipelineCallback Answer the question given as input by using the document.\n * @param {ImageInput} image The image of the document to use.\n * @param {string} question A question to ask of the document.\n * @param {import('./utils/generation.js').GenerationConfigType} [options] Additional keyword arguments to pass along to the generate method of the model.\n * @returns {Promise} An object (or array of objects) containing the answer(s).\n * \n * @typedef {TextImagePipelineConstructorArgs & DocumentQuestionAnsweringPipelineCallback & Disposable} DocumentQuestionAnsweringPipelineType\n */\n\n/**\n * Document Question Answering pipeline using any `AutoModelForDocumentQuestionAnswering`.\n * The inputs/outputs are similar to the (extractive) question answering pipeline; however,\n * the pipeline takes an image (and optional OCR'd words/boxes) as input instead of text context.\n * \n * **Example:** Answer questions about a document with `Xenova/donut-base-finetuned-docvqa`.\n * ```javascript\n * const qa_pipeline = await pipeline('document-question-answering', 'Xenova/donut-base-finetuned-docvqa');\n * const image = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/invoice.png';\n * const question = 'What is the invoice number?';\n * const output = await qa_pipeline(image, question);\n * // [{ answer: 'us-001' }]\n * ```\n */\nclass DocumentQuestionAnsweringPipeline extends (/** @type {new (options: TextImagePipelineConstructorArgs) => DocumentQuestionAnsweringPipelineType} */ (Pipeline)) {\n\n /**\n * Create a new DocumentQuestionAnsweringPipeline.\n * @param {TextImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {DocumentQuestionAnsweringPipelineCallback} */\n async _call(image, question, generate_kwargs = {}) {\n\n // NOTE: For now, we only support a batch size of 1\n\n // Preprocess image\n const preparedImage = (await prepareImages(image))[0];\n const { pixel_values } = await this.processor(preparedImage);\n\n // Run tokenization\n const task_prompt = `${question}`;\n const decoder_input_ids = this.tokenizer(task_prompt, {\n add_special_tokens: false,\n padding: true,\n truncation: true,\n }).input_ids;\n\n // Run model\n const output = await this.model.generate(\n pixel_values,\n {\n ...generate_kwargs,\n decoder_input_ids,\n max_length: this.model.config.decoder.max_position_embeddings,\n }\n );\n\n // Decode output\n const decoded = this.tokenizer.batch_decode(output)[0];\n\n // Parse answer\n const match = decoded.match(/(.*?)<\\/s_answer>/);\n let answer = null;\n if (match && match.length >= 2) {\n answer = match[1].trim();\n }\n return [{ answer }];\n }\n}\n\n\n/**\n * @typedef {Object} VocoderOptions\n * @property {PreTrainedModel} [vocoder] The vocoder used by the pipeline (if the model uses one). If not provided, use the default HifiGan vocoder.\n * @typedef {TextAudioPipelineConstructorArgs & VocoderOptions} TextToAudioPipelineConstructorArgs\n */\n\n/**\n * @typedef {Object} TextToAudioOutput\n * @property {Float32Array} audio The generated audio waveform.\n * @property {number} sampling_rate The sampling rate of the generated audio waveform.\n * \n * @typedef {Object} TextToAudioPipelineOptions Parameters specific to text-to-audio pipelines.\n * @property {Tensor|Float32Array|string|URL} [speaker_embeddings=null] The speaker embeddings (if the model requires it).\n * \n * @callback TextToAudioPipelineCallback Generates speech/audio from the inputs.\n * @param {string|string[]} texts The text(s) to generate.\n * @param {TextToAudioPipelineOptions} options Parameters passed to the model generation/forward method.\n * @returns {Promise} An object containing the generated audio and sampling rate.\n * \n * @typedef {TextToAudioPipelineConstructorArgs & TextToAudioPipelineCallback & Disposable} TextToAudioPipelineType\n */\n\n/**\n * Text-to-audio generation pipeline using any `AutoModelForTextToWaveform` or `AutoModelForTextToSpectrogram`.\n * This pipeline generates an audio file from an input text and optional other conditional inputs.\n * \n * **Example:** Generate audio from text with `Xenova/speecht5_tts`.\n * ```javascript\n * const synthesizer = await pipeline('text-to-speech', 'Xenova/speecht5_tts', { quantized: false });\n * const speaker_embeddings = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/speaker_embeddings.bin';\n * const out = await synthesizer('Hello, my dog is cute', { speaker_embeddings });\n * // {\n * // audio: Float32Array(26112) [-0.00005657337896991521, 0.00020583874720614403, ...],\n * // sampling_rate: 16000\n * // }\n * ```\n * \n * You can then save the audio to a .wav file with the `wavefile` package:\n * ```javascript\n * import wavefile from 'wavefile';\n * import fs from 'fs';\n * \n * const wav = new wavefile.WaveFile();\n * wav.fromScratch(1, out.sampling_rate, '32f', out.audio);\n * fs.writeFileSync('out.wav', wav.toBuffer());\n * ```\n * \n * **Example:** Multilingual speech generation with `Xenova/mms-tts-fra`. See [here](https://huggingface.co/models?pipeline_tag=text-to-speech&other=vits&sort=trending) for the full list of available languages (1107).\n * ```javascript\n * const synthesizer = await pipeline('text-to-speech', 'Xenova/mms-tts-fra');\n * const out = await synthesizer('Bonjour');\n * // {\n * // audio: Float32Array(23808) [-0.00037693005288019776, 0.0003325853613205254, ...],\n * // sampling_rate: 16000\n * // }\n * ```\n */\nclass TextToAudioPipeline extends (/** @type {new (options: TextToAudioPipelineConstructorArgs) => TextToAudioPipelineType} */ (Pipeline)) {\n DEFAULT_VOCODER_ID = \"Xenova/speecht5_hifigan\"\n\n /**\n * Create a new TextToAudioPipeline.\n * @param {TextToAudioPipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n\n // TODO: Find a better way for `pipeline` to set the default vocoder\n this.vocoder = options.vocoder ?? null;\n }\n\n\n /** @type {TextToAudioPipelineCallback} */\n async _call(text_inputs, {\n speaker_embeddings = null,\n } = {}) {\n\n // If this.processor is not set, we are using a `AutoModelForTextToWaveform` model\n if (this.processor) {\n return this._call_text_to_spectrogram(text_inputs, { speaker_embeddings });\n } else {\n return this._call_text_to_waveform(text_inputs);\n }\n }\n\n async _call_text_to_waveform(text_inputs) {\n\n // Run tokenization\n const inputs = this.tokenizer(text_inputs, {\n padding: true,\n truncation: true,\n });\n\n // Generate waveform\n const { waveform } = await this.model(inputs);\n\n const sampling_rate = this.model.config.sampling_rate;\n return {\n audio: waveform.data,\n sampling_rate,\n }\n }\n\n async _call_text_to_spectrogram(text_inputs, { speaker_embeddings }) {\n\n // Load vocoder, if not provided\n if (!this.vocoder) {\n console.log('No vocoder specified, using default HifiGan vocoder.');\n this.vocoder = await _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModel.from_pretrained(this.DEFAULT_VOCODER_ID, { quantized: false });\n }\n\n // Load speaker embeddings as Float32Array from path/URL\n if (typeof speaker_embeddings === 'string' || speaker_embeddings instanceof URL) {\n // Load from URL with fetch\n speaker_embeddings = new Float32Array(\n await (await fetch(speaker_embeddings)).arrayBuffer()\n );\n }\n\n if (speaker_embeddings instanceof Float32Array) {\n speaker_embeddings = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_6__.Tensor(\n 'float32',\n speaker_embeddings,\n [1, speaker_embeddings.length]\n )\n } else if (!(speaker_embeddings instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_6__.Tensor)) {\n throw new Error(\"Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.\")\n }\n\n // Run tokenization\n const { input_ids } = this.tokenizer(text_inputs, {\n padding: true,\n truncation: true,\n });\n\n // NOTE: At this point, we are guaranteed that `speaker_embeddings` is a `Tensor`\n // @ts-ignore\n const { waveform } = await this.model.generate_speech(input_ids, speaker_embeddings, { vocoder: this.vocoder });\n\n const sampling_rate = this.processor.feature_extractor.config.sampling_rate;\n return {\n audio: waveform.data,\n sampling_rate,\n }\n }\n}\n\n/**\n * @callback ImageToImagePipelineCallback Transform the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The images to transform.\n * @returns {Promise} The transformed image or list of images.\n * \n * @typedef {ImagePipelineConstructorArgs & ImageToImagePipelineCallback & Disposable} ImageToImagePipelineType\n */\n\n/**\n * Image to Image pipeline using any `AutoModelForImageToImage`. This pipeline generates an image based on a previous image input.\n * \n * **Example:** Super-resolution w/ `Xenova/swin2SR-classical-sr-x2-64`\n * ```javascript\n * const upscaler = await pipeline('image-to-image', 'Xenova/swin2SR-classical-sr-x2-64');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/butterfly.jpg';\n * const output = await upscaler(url);\n * // RawImage {\n * // data: Uint8Array(786432) [ 41, 31, 24, 43, ... ],\n * // width: 512,\n * // height: 512,\n * // channels: 3\n * // }\n * ```\n */\nclass ImageToImagePipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => ImageToImagePipelineType} */ (Pipeline)) {\n /**\n * Create a new ImageToImagePipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {ImageToImagePipelineCallback} */\n async _call(images) {\n\n const preparedImages = await prepareImages(images);\n const inputs = await this.processor(preparedImages);\n const outputs = await this.model(inputs);\n\n /** @type {RawImage[]} */\n const toReturn = [];\n for (const batch of outputs.reconstruction) {\n const output = batch.squeeze().clamp_(0, 1).mul_(255).round_().to('uint8');\n toReturn.push(_utils_image_js__WEBPACK_IMPORTED_MODULE_7__.RawImage.fromTensor(output));\n }\n\n return toReturn.length > 1 ? toReturn : toReturn[0];\n }\n}\n\n/**\n * @typedef {Object} DepthEstimationPipelineOutput\n * @property {Tensor} predicted_depth The raw depth map predicted by the model.\n * @property {RawImage} depth The processed depth map as an image (with the same size as the input image).\n * \n * @callback DepthEstimationPipelineCallback Predicts the depth for the image(s) passed as inputs.\n * @param {ImagePipelineInputs} images The images to compute depth for.\n * @returns {Promise} An image or a list of images containing result(s).\n * \n * @typedef {ImagePipelineConstructorArgs & DepthEstimationPipelineCallback & Disposable} DepthEstimationPipelineType\n */\n\n/**\n * Depth estimation pipeline using any `AutoModelForDepthEstimation`. This pipeline predicts the depth of an image.\n * \n * **Example:** Depth estimation w/ `Xenova/dpt-hybrid-midas`\n * ```javascript\n * const depth_estimator = await pipeline('depth-estimation', 'Xenova/dpt-hybrid-midas');\n * const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';\n * const out = await depth_estimator(url);\n * // {\n * // predicted_depth: Tensor {\n * // dims: [ 384, 384 ],\n * // type: 'float32',\n * // data: Float32Array(147456) [ 542.859130859375, 545.2833862304688, 546.1649169921875, ... ],\n * // size: 147456\n * // },\n * // depth: RawImage {\n * // data: Uint8Array(307200) [ 86, 86, 86, ... ],\n * // width: 640,\n * // height: 480,\n * // channels: 1\n * // }\n * // }\n * ```\n */\nclass DepthEstimationPipeline extends (/** @type {new (options: ImagePipelineConstructorArgs) => DepthEstimationPipelineType} */ (Pipeline)) {\n /**\n * Create a new DepthEstimationPipeline.\n * @param {ImagePipelineConstructorArgs} options An object used to instantiate the pipeline.\n */\n constructor(options) {\n super(options);\n }\n\n /** @type {DepthEstimationPipelineCallback} */\n async _call(images) {\n\n const preparedImages = await prepareImages(images);\n\n const inputs = await this.processor(preparedImages);\n const { predicted_depth } = await this.model(inputs);\n\n const toReturn = [];\n for (let i = 0; i < preparedImages.length; ++i) {\n const prediction = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_6__.interpolate)(predicted_depth[i], preparedImages[i].size.reverse(), 'bilinear', false);\n const formatted = prediction.mul_(255 / (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_4__.max)(prediction.data)[0]).to('uint8');\n toReturn.push({\n predicted_depth: predicted_depth[i],\n depth: _utils_image_js__WEBPACK_IMPORTED_MODULE_7__.RawImage.fromTensor(formatted),\n });\n }\n\n return toReturn.length > 1 ? toReturn : toReturn[0];\n }\n}\n\nconst SUPPORTED_TASKS = Object.freeze({\n \"text-classification\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": TextClassificationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForSequenceClassification,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"distilbert-base-uncased-finetuned-sst-2-english\",\n \"model\": \"Xenova/distilbert-base-uncased-finetuned-sst-2-english\",\n },\n \"type\": \"text\",\n },\n \"token-classification\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": TokenClassificationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForTokenClassification,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"Davlan/bert-base-multilingual-cased-ner-hrl\",\n \"model\": \"Xenova/bert-base-multilingual-cased-ner-hrl\",\n },\n \"type\": \"text\",\n },\n \"question-answering\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": QuestionAnsweringPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForQuestionAnswering,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"distilbert-base-cased-distilled-squad\",\n \"model\": \"Xenova/distilbert-base-cased-distilled-squad\",\n },\n \"type\": \"text\",\n },\n\n \"fill-mask\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": FillMaskPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForMaskedLM,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"bert-base-uncased\",\n \"model\": \"Xenova/bert-base-uncased\",\n },\n \"type\": \"text\",\n },\n \"summarization\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": SummarizationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForSeq2SeqLM,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"sshleifer/distilbart-cnn-6-6\",\n \"model\": \"Xenova/distilbart-cnn-6-6\",\n },\n \"type\": \"text\",\n },\n \"translation\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": TranslationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForSeq2SeqLM,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"t5-small\",\n \"model\": \"Xenova/t5-small\",\n },\n \"type\": \"text\",\n },\n \"text2text-generation\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": Text2TextGenerationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForSeq2SeqLM,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"google/flan-t5-small\",\n \"model\": \"Xenova/flan-t5-small\",\n },\n \"type\": \"text\",\n },\n \"text-generation\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": TextGenerationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForCausalLM,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"gpt2\",\n \"model\": \"Xenova/gpt2\",\n },\n \"type\": \"text\",\n },\n \"zero-shot-classification\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": ZeroShotClassificationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForSequenceClassification,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"typeform/distilbert-base-uncased-mnli\",\n \"model\": \"Xenova/distilbert-base-uncased-mnli\",\n },\n \"type\": \"text\",\n },\n \"audio-classification\": {\n \"pipeline\": AudioClassificationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForAudioClassification,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"superb/wav2vec2-base-superb-ks\",\n \"model\": \"Xenova/wav2vec2-base-superb-ks\",\n },\n \"type\": \"audio\",\n },\n \"zero-shot-audio-classification\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": ZeroShotAudioClassificationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModel,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"laion/clap-htsat-fused\",\n \"model\": \"Xenova/clap-htsat-unfused\",\n },\n \"type\": \"multimodal\",\n },\n \"automatic-speech-recognition\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": AutomaticSpeechRecognitionPipeline,\n \"model\": [_models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForSpeechSeq2Seq, _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForCTC],\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"openai/whisper-tiny.en\",\n \"model\": \"Xenova/whisper-tiny.en\",\n },\n \"type\": \"multimodal\",\n },\n \"text-to-audio\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": TextToAudioPipeline,\n \"model\": [_models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForTextToWaveform, _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForTextToSpectrogram],\n \"processor\": [_processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor, /* Some don't use a processor */ null],\n \"default\": {\n // TODO: replace with original\n // \"model\": \"microsoft/speecht5_tts\",\n \"model\": \"Xenova/speecht5_tts\",\n },\n \"type\": \"text\",\n },\n \"image-to-text\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": ImageToTextPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForVision2Seq,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"nlpconnect/vit-gpt2-image-captioning\",\n \"model\": \"Xenova/vit-gpt2-image-captioning\",\n },\n \"type\": \"multimodal\",\n },\n\n \"image-classification\": {\n // no tokenizer\n \"pipeline\": ImageClassificationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForImageClassification,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"google/vit-base-patch16-224\",\n \"model\": \"Xenova/vit-base-patch16-224\",\n },\n \"type\": \"multimodal\",\n },\n\n \"image-segmentation\": {\n // no tokenizer\n \"pipeline\": ImageSegmentationPipeline,\n \"model\": [_models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForImageSegmentation, _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForSemanticSegmentation],\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"facebook/detr-resnet-50-panoptic\",\n \"model\": \"Xenova/detr-resnet-50-panoptic\",\n },\n \"type\": \"multimodal\",\n },\n\n \"zero-shot-image-classification\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": ZeroShotImageClassificationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModel,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"openai/clip-vit-base-patch32\",\n \"model\": \"Xenova/clip-vit-base-patch32\",\n },\n \"type\": \"multimodal\",\n },\n\n \"object-detection\": {\n // no tokenizer\n \"pipeline\": ObjectDetectionPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForObjectDetection,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"facebook/detr-resnet-50\",\n \"model\": \"Xenova/detr-resnet-50\",\n },\n \"type\": \"multimodal\",\n },\n \"zero-shot-object-detection\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": ZeroShotObjectDetectionPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForZeroShotObjectDetection,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"google/owlvit-base-patch32\",\n \"model\": \"Xenova/owlvit-base-patch32\",\n },\n \"type\": \"multimodal\",\n },\n \"document-question-answering\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": DocumentQuestionAnsweringPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForDocumentQuestionAnswering,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"naver-clova-ix/donut-base-finetuned-docvqa\",\n \"model\": \"Xenova/donut-base-finetuned-docvqa\",\n },\n \"type\": \"multimodal\",\n },\n \"image-to-image\": {\n // no tokenizer\n \"pipeline\": ImageToImagePipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForImageToImage,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"caidas/swin2SR-classical-sr-x2-64\",\n \"model\": \"Xenova/swin2SR-classical-sr-x2-64\",\n },\n \"type\": \"image\",\n },\n \"depth-estimation\": {\n // no tokenizer\n \"pipeline\": DepthEstimationPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForDepthEstimation,\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"Intel/dpt-large\",\n \"model\": \"Xenova/dpt-large\",\n },\n \"type\": \"image\",\n },\n\n // This task serves as a useful interface for dealing with sentence-transformers (https://huggingface.co/sentence-transformers).\n \"feature-extraction\": {\n \"tokenizer\": _tokenizers_js__WEBPACK_IMPORTED_MODULE_0__.AutoTokenizer,\n \"pipeline\": FeatureExtractionPipeline,\n \"model\": _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModel,\n \"default\": {\n // TODO: replace with original\n // \"model\": \"sentence-transformers/all-MiniLM-L6-v2\",\n \"model\": \"Xenova/all-MiniLM-L6-v2\",\n },\n \"type\": \"text\",\n },\n \"image-feature-extraction\": {\n \"processor\": _processors_js__WEBPACK_IMPORTED_MODULE_2__.AutoProcessor,\n \"pipeline\": ImageFeatureExtractionPipeline,\n \"model\": [_models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModelForImageFeatureExtraction, _models_js__WEBPACK_IMPORTED_MODULE_1__.AutoModel],\n \"default\": {\n // TODO: replace with original\n // \"model\": \"google/vit-base-patch16-224\",\n \"model\": \"Xenova/vit-base-patch16-224-in21k\",\n },\n \"type\": \"image\",\n },\n})\n\n\n// TODO: Add types for TASK_ALIASES\nconst TASK_ALIASES = Object.freeze({\n \"sentiment-analysis\": \"text-classification\",\n \"ner\": \"token-classification\",\n // \"vqa\": \"visual-question-answering\", // TODO: Add\n \"asr\": \"automatic-speech-recognition\",\n \"text-to-speech\": \"text-to-audio\",\n\n // Add for backwards compatibility\n \"embeddings\": \"feature-extraction\",\n});\n\n/**\n * @typedef {keyof typeof SUPPORTED_TASKS} TaskType\n * @typedef {keyof typeof TASK_ALIASES} AliasType\n * @typedef {TaskType | AliasType} PipelineType All possible pipeline types.\n * @typedef {{[K in TaskType]: InstanceType}} SupportedTasks A mapping of pipeline names to their corresponding pipeline classes.\n * @typedef {{[K in AliasType]: InstanceType}} AliasTasks A mapping from pipeline aliases to their corresponding pipeline classes.\n * @typedef {SupportedTasks & AliasTasks} AllTasks A mapping from all pipeline names and aliases to their corresponding pipeline classes.\n */\n\n/**\n * Utility factory method to build a `Pipeline` object.\n * \n * @template {PipelineType} T The type of pipeline to return.\n * @param {T} task The task defining which pipeline will be returned. Currently accepted tasks are:\n * - `\"audio-classification\"`: will return a `AudioClassificationPipeline`.\n * - `\"automatic-speech-recognition\"`: will return a `AutomaticSpeechRecognitionPipeline`.\n * - `\"depth-estimation\"`: will return a `DepthEstimationPipeline`.\n * - `\"document-question-answering\"`: will return a `DocumentQuestionAnsweringPipeline`.\n * - `\"feature-extraction\"`: will return a `FeatureExtractionPipeline`.\n * - `\"fill-mask\"`: will return a `FillMaskPipeline`.\n * - `\"image-classification\"`: will return a `ImageClassificationPipeline`.\n * - `\"image-segmentation\"`: will return a `ImageSegmentationPipeline`.\n * - `\"image-to-text\"`: will return a `ImageToTextPipeline`.\n * - `\"object-detection\"`: will return a `ObjectDetectionPipeline`.\n * - `\"question-answering\"`: will return a `QuestionAnsweringPipeline`.\n * - `\"summarization\"`: will return a `SummarizationPipeline`.\n * - `\"text2text-generation\"`: will return a `Text2TextGenerationPipeline`.\n * - `\"text-classification\"` (alias \"sentiment-analysis\" available): will return a `TextClassificationPipeline`.\n * - `\"text-generation\"`: will return a `TextGenerationPipeline`.\n * - `\"token-classification\"` (alias \"ner\" available): will return a `TokenClassificationPipeline`.\n * - `\"translation\"`: will return a `TranslationPipeline`.\n * - `\"translation_xx_to_yy\"`: will return a `TranslationPipeline`.\n * - `\"zero-shot-classification\"`: will return a `ZeroShotClassificationPipeline`.\n * - `\"zero-shot-audio-classification\"`: will return a `ZeroShotAudioClassificationPipeline`.\n * - `\"zero-shot-image-classification\"`: will return a `ZeroShotImageClassificationPipeline`.\n * - `\"zero-shot-object-detection\"`: will return a `ZeroShotObjectDetectionPipeline`.\n * @param {string} [model=null] The name of the pre-trained model to use. If not specified, the default model for the task will be used.\n * @param {import('./utils/hub.js').PretrainedOptions} [options] Optional parameters for the pipeline.\n * @returns {Promise} A Pipeline object for the specified task.\n * @throws {Error} If an unsupported pipeline is requested.\n */\nasync function pipeline(\n task,\n model = null,\n {\n quantized = true,\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n } = {}\n) {\n // Helper method to construct pipeline\n\n // Apply aliases\n // @ts-ignore\n task = TASK_ALIASES[task] ?? task;\n\n // Get pipeline info\n const pipelineInfo = SUPPORTED_TASKS[task.split('_', 1)[0]];\n if (!pipelineInfo) {\n throw Error(`Unsupported pipeline: ${task}. Must be one of [${Object.keys(SUPPORTED_TASKS)}]`)\n }\n\n // Use model if specified, otherwise, use default\n if (!model) {\n model = pipelineInfo.default.model\n console.log(`No model specified. Using default model: \"${model}\".`);\n }\n\n const pretrainedOptions = {\n quantized,\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n }\n\n const classes = new Map([\n ['tokenizer', pipelineInfo.tokenizer],\n ['model', pipelineInfo.model],\n ['processor', pipelineInfo.processor],\n ]);\n\n // Load model, tokenizer, and processor (if they exist)\n const results = await loadItems(classes, model, pretrainedOptions);\n results.task = task;\n\n (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_3__.dispatchCallback)(progress_callback, {\n 'status': 'ready',\n 'task': task,\n 'model': model,\n });\n\n const pipelineClass = pipelineInfo.pipeline;\n return new pipelineClass(results);\n}\n\n\n/**\n * Helper function to get applicable model, tokenizer, or processor classes for a given model.\n * @param {Map} mapping The mapping of names to classes, arrays of classes, or null.\n * @param {string} model The name of the model to load.\n * @param {import('./utils/hub.js').PretrainedOptions} pretrainedOptions The options to pass to the `from_pretrained` method.\n * @private\n */\nasync function loadItems(mapping, model, pretrainedOptions) {\n\n const result = Object.create(null);\n\n /**@type {Promise[]} */\n const promises = [];\n for (let [name, cls] of mapping.entries()) {\n if (!cls) continue;\n\n /**@type {Promise} */\n let promise;\n if (Array.isArray(cls)) {\n promise = new Promise(async (resolve, reject) => {\n let e;\n for (let c of cls) {\n if (c === null) {\n // If null, we resolve it immediately, meaning the relevant\n // class was not found, but it is optional.\n resolve(null);\n return;\n }\n try {\n resolve(await c.from_pretrained(model, pretrainedOptions));\n return;\n } catch (err) {\n e = err;\n }\n }\n reject(e);\n })\n } else {\n promise = cls.from_pretrained(model, pretrainedOptions);\n }\n\n result[name] = promise;\n promises.push(promise);\n }\n\n // Wait for all promises to resolve (in parallel)\n await Promise.all(promises);\n\n // Then assign to result\n for (let [name, promise] of Object.entries(result)) {\n result[name] = await promise;\n }\n\n return result;\n}\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/pipelines.js?"); /***/ }), @@ -326,7 +3658,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ASTFeatureExtractor: () => (/* binding */ ASTFeatureExtractor),\n/* harmony export */ AutoProcessor: () => (/* binding */ AutoProcessor),\n/* harmony export */ BeitFeatureExtractor: () => (/* binding */ BeitFeatureExtractor),\n/* harmony export */ BitImageProcessor: () => (/* binding */ BitImageProcessor),\n/* harmony export */ CLIPFeatureExtractor: () => (/* binding */ CLIPFeatureExtractor),\n/* harmony export */ ChineseCLIPFeatureExtractor: () => (/* binding */ ChineseCLIPFeatureExtractor),\n/* harmony export */ ClapFeatureExtractor: () => (/* binding */ ClapFeatureExtractor),\n/* harmony export */ ConvNextFeatureExtractor: () => (/* binding */ ConvNextFeatureExtractor),\n/* harmony export */ ConvNextImageProcessor: () => (/* binding */ ConvNextImageProcessor),\n/* harmony export */ DPTFeatureExtractor: () => (/* binding */ DPTFeatureExtractor),\n/* harmony export */ DPTImageProcessor: () => (/* binding */ DPTImageProcessor),\n/* harmony export */ DeiTFeatureExtractor: () => (/* binding */ DeiTFeatureExtractor),\n/* harmony export */ DetrFeatureExtractor: () => (/* binding */ DetrFeatureExtractor),\n/* harmony export */ DonutFeatureExtractor: () => (/* binding */ DonutFeatureExtractor),\n/* harmony export */ FeatureExtractor: () => (/* binding */ FeatureExtractor),\n/* harmony export */ GLPNFeatureExtractor: () => (/* binding */ GLPNFeatureExtractor),\n/* harmony export */ ImageFeatureExtractor: () => (/* binding */ ImageFeatureExtractor),\n/* harmony export */ MobileViTFeatureExtractor: () => (/* binding */ MobileViTFeatureExtractor),\n/* harmony export */ NougatImageProcessor: () => (/* binding */ NougatImageProcessor),\n/* harmony export */ OwlViTFeatureExtractor: () => (/* binding */ OwlViTFeatureExtractor),\n/* harmony export */ OwlViTProcessor: () => (/* binding */ OwlViTProcessor),\n/* harmony export */ Owlv2ImageProcessor: () => (/* binding */ Owlv2ImageProcessor),\n/* harmony export */ Processor: () => (/* binding */ Processor),\n/* harmony export */ SamImageProcessor: () => (/* binding */ SamImageProcessor),\n/* harmony export */ SamProcessor: () => (/* binding */ SamProcessor),\n/* harmony export */ SeamlessM4TFeatureExtractor: () => (/* binding */ SeamlessM4TFeatureExtractor),\n/* harmony export */ SegformerFeatureExtractor: () => (/* binding */ SegformerFeatureExtractor),\n/* harmony export */ SiglipImageProcessor: () => (/* binding */ SiglipImageProcessor),\n/* harmony export */ SpeechT5FeatureExtractor: () => (/* binding */ SpeechT5FeatureExtractor),\n/* harmony export */ SpeechT5Processor: () => (/* binding */ SpeechT5Processor),\n/* harmony export */ Swin2SRImageProcessor: () => (/* binding */ Swin2SRImageProcessor),\n/* harmony export */ ViTFeatureExtractor: () => (/* binding */ ViTFeatureExtractor),\n/* harmony export */ ViTImageProcessor: () => (/* binding */ ViTImageProcessor),\n/* harmony export */ VitMatteImageProcessor: () => (/* binding */ VitMatteImageProcessor),\n/* harmony export */ Wav2Vec2FeatureExtractor: () => (/* binding */ Wav2Vec2FeatureExtractor),\n/* harmony export */ Wav2Vec2ProcessorWithLM: () => (/* binding */ Wav2Vec2ProcessorWithLM),\n/* harmony export */ WhisperFeatureExtractor: () => (/* binding */ WhisperFeatureExtractor),\n/* harmony export */ WhisperProcessor: () => (/* binding */ WhisperProcessor),\n/* harmony export */ YolosFeatureExtractor: () => (/* binding */ YolosFeatureExtractor)\n/* harmony export */ });\n/* harmony import */ var _utils_core_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/core.js */ \"./node_modules/@xenova/transformers/src/utils/core.js\");\n/* harmony import */ var _utils_hub_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/hub.js */ \"./node_modules/@xenova/transformers/src/utils/hub.js\");\n/* harmony import */ var _utils_maths_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/maths.js */ \"./node_modules/@xenova/transformers/src/utils/maths.js\");\n/* harmony import */ var _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/tensor.js */ \"./node_modules/@xenova/transformers/src/utils/tensor.js\");\n/* harmony import */ var _utils_image_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/image.js */ \"./node_modules/@xenova/transformers/src/utils/image.js\");\n/* harmony import */ var _utils_audio_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/audio.js */ \"./node_modules/@xenova/transformers/src/utils/audio.js\");\n\n/**\n * @file Processors are used to prepare non-textual inputs (e.g., image or audio) for a model.\n * \n * **Example:** Using a `WhisperProcessor` to prepare an audio input for a model.\n * ```javascript\n * import { AutoProcessor, read_audio } from '@xenova/transformers';\n *\n * let processor = await AutoProcessor.from_pretrained('openai/whisper-tiny.en');\n * let audio = await read_audio('https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac', 16000);\n * let { input_features } = await processor(audio);\n * // Tensor {\n * // data: Float32Array(240000) [0.4752984642982483, 0.5597258806228638, 0.56434166431427, ...],\n * // dims: [1, 80, 3000],\n * // type: 'float32',\n * // size: 240000,\n * // }\n * ```\n * \n * @module processors\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n// Helper functions\n\n/**\n * Converts bounding boxes from center format to corners format.\n * \n * @param {number[]} arr The coordinate for the center of the box and its width, height dimensions (center_x, center_y, width, height)\n * @returns {number[]} The coodinates for the top-left and bottom-right corners of the box (top_left_x, top_left_y, bottom_right_x, bottom_right_y)\n */\nfunction center_to_corners_format([centerX, centerY, width, height]) {\n return [\n centerX - width / 2,\n centerY - height / 2,\n centerX + width / 2,\n centerY + height / 2\n ];\n}\n\n/**\n * Post-processes the outputs of the model (for object detection).\n * @param {Object} outputs The outputs of the model that must be post-processed\n * @param {Tensor} outputs.logits The logits\n * @param {Tensor} outputs.pred_boxes The predicted boxes.\n * @param {number} [threshold=0.5] The threshold to use for the scores.\n * @param {number[][]} [target_sizes=null] The sizes of the original images.\n * @param {boolean} [is_zero_shot=false] Whether zero-shot object detection was performed.\n * @return {Object[]} An array of objects containing the post-processed outputs.\n * @private\n */\nfunction post_process_object_detection(outputs, threshold = 0.5, target_sizes = null, is_zero_shot = false) {\n const out_logits = outputs.logits;\n const out_bbox = outputs.pred_boxes;\n const [batch_size, num_boxes, num_classes] = out_logits.dims;\n\n if (target_sizes !== null && target_sizes.length !== batch_size) {\n throw Error(\"Make sure that you pass in as many target sizes as the batch dimension of the logits\")\n }\n let toReturn = [];\n for (let i = 0; i < batch_size; ++i) {\n let target_size = target_sizes !== null ? target_sizes[i] : null;\n let info = {\n boxes: [],\n classes: [],\n scores: []\n }\n let logits = out_logits[i];\n let bbox = out_bbox[i];\n\n for (let j = 0; j < num_boxes; ++j) {\n let logit = logits[j];\n\n let indices = [];\n let probs;\n if (is_zero_shot) {\n // Get indices of classes with high enough probability\n probs = logit.sigmoid().data;\n for (let k = 0; k < probs.length; ++k) {\n if (probs[k] > threshold) {\n indices.push(k);\n }\n }\n\n } else {\n // Get most probable class\n let maxIndex = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.max)(logit.data)[1];\n\n if (maxIndex === num_classes - 1) {\n // This is the background class, skip it\n continue;\n }\n indices.push(maxIndex);\n\n // Compute softmax over classes\n probs = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.softmax)(logit.data);\n }\n\n for (const index of indices) {\n\n // Some class has a high enough probability\n /** @type {number[]} */\n let box = bbox[j].data;\n\n // convert to [x0, y0, x1, y1] format\n box = center_to_corners_format(box)\n if (target_size !== null) {\n box = box.map((x, i) => x * target_size[(i + 1) % 2])\n }\n\n info.boxes.push(box);\n info.classes.push(index);\n info.scores.push(probs[index]);\n }\n }\n toReturn.push(info);\n }\n return toReturn;\n}\n\n/**\n * Named tuple to indicate the order we are using is (height x width), even though\n * the Graphics’ industry standard is (width x height).\n * @typedef {[height: number, width: number]} HeightWidth\n */\n\n/**\n * Helper function to validate audio inputs.\n * @param {any} audio The audio data.\n * @param {string} feature_extractor The name of the feature extractor.\n * @private\n */\nfunction validate_audio_inputs(audio, feature_extractor) {\n if (!(audio instanceof Float32Array || audio instanceof Float64Array)) {\n throw new Error(\n `${feature_extractor} expects input to be a Float32Array or a Float64Array, but got ${audio?.constructor?.name ?? typeof audio} instead.` +\n `If using the feature extractor directly, remember to use \\`read_audio(url, sampling_rate)\\` to obtain the raw audio data of the file/url.`\n )\n }\n}\n\n/**\n * Helper function to constrain a value to be a multiple of a number.\n * @param {number} val The value to constrain.\n * @param {number} multiple The number to constrain to.\n * @param {number} [minVal=0] The minimum value to constrain to.\n * @param {number} [maxVal=null] The maximum value to constrain to.\n * @returns {number} The constrained value.\n * @private\n */\nfunction constraint_to_multiple_of(val, multiple, minVal = 0, maxVal = null) {\n let x = Math.round(val / multiple) * multiple;\n\n if (maxVal !== null && x > maxVal) {\n x = Math.floor(val / multiple) * multiple;\n }\n\n if (x < minVal) {\n x = Math.ceil(val / multiple) * multiple;\n }\n\n return x;\n}\n\n/**\n * Rounds the height and width down to the closest multiple of size_divisibility\n * @param {[number, number]} size The size of the image\n * @param {number} divisor The divisor to use.\n * @returns {[number, number]} The rounded size.\n */\nfunction enforce_size_divisibility([width, height], divisor) {\n return [\n Math.floor(width / divisor) * divisor,\n Math.floor(height / divisor) * divisor\n ];\n}\n\n\n/**\n * Base class for feature extractors.\n *\n * @extends Callable\n */\nclass FeatureExtractor extends _utils_core_js__WEBPACK_IMPORTED_MODULE_0__.Callable {\n /**\n * Constructs a new FeatureExtractor instance.\n *\n * @param {Object} config The configuration for the feature extractor.\n */\n constructor(config) {\n super();\n this.config = config\n }\n}\n\n/**\n * @typedef {object} ImageFeatureExtractorResult\n * @property {Tensor} pixel_values The pixel values of the batched preprocessed images.\n * @property {HeightWidth[]} original_sizes Array of two-dimensional tuples like [[480, 640]].\n * @property {HeightWidth[]} reshaped_input_sizes Array of two-dimensional tuples like [[1000, 1330]].\n */\n\n/**\n * Feature extractor for image models.\n *\n * @extends FeatureExtractor\n */\nclass ImageFeatureExtractor extends FeatureExtractor {\n\n /**\n * Constructs a new ImageFeatureExtractor instance.\n *\n * @param {Object} config The configuration for the feature extractor.\n * @param {number[]} config.image_mean The mean values for image normalization.\n * @param {number[]} config.image_std The standard deviation values for image normalization.\n * @param {boolean} config.do_rescale Whether to rescale the image pixel values to the [0,1] range.\n * @param {number} config.rescale_factor The factor to use for rescaling the image pixel values.\n * @param {boolean} config.do_normalize Whether to normalize the image pixel values.\n * @param {boolean} config.do_resize Whether to resize the image.\n * @param {number} config.resample What method to use for resampling.\n * @param {number|Object} config.size The size to resize the image to.\n */\n constructor(config) {\n super(config);\n\n this.image_mean = this.config.image_mean ?? this.config.mean;\n this.image_std = this.config.image_std ?? this.config.std;\n\n this.resample = this.config.resample ?? 2; // 2 => bilinear\n this.do_rescale = this.config.do_rescale ?? true;\n this.rescale_factor = this.config.rescale_factor ?? (1 / 255);\n this.do_normalize = this.config.do_normalize;\n\n this.do_resize = this.config.do_resize;\n this.do_thumbnail = this.config.do_thumbnail;\n this.size = this.config.size;\n this.size_divisibility = this.config.size_divisibility ?? this.config.size_divisor;\n\n this.do_center_crop = this.config.do_center_crop;\n this.crop_size = this.config.crop_size;\n this.do_convert_rgb = this.config.do_convert_rgb ?? true;\n this.do_crop_margin = this.config.do_crop_margin;\n\n this.pad_size = this.config.pad_size;\n this.do_pad = this.config.do_pad;\n\n if (this.do_pad && !this.pad_size && this.size && this.size.width !== undefined && this.size.height !== undefined) {\n // Should pad, but no pad size specified\n // We infer the pad size from the resize size\n this.pad_size = this.size\n }\n }\n\n /**\n * Resize the image to make a thumbnail. The image is resized so that no dimension is larger than any\n * corresponding dimension of the specified size.\n * @param {RawImage} image The image to be resized.\n * @param {{height:number, width:number}} size The size `{\"height\": h, \"width\": w}` to resize the image to.\n * @param {string | 0 | 1 | 2 | 3 | 4 | 5} [resample=2] The resampling filter to use.\n * @returns {Promise} The resized image.\n */\n async thumbnail(image, size, resample = 2) {\n const input_height = image.height;\n const input_width = image.width;\n\n const output_height = size.height;\n const output_width = size.width;\n\n // We always resize to the smallest of either the input or output size.\n let height = Math.min(input_height, output_height)\n let width = Math.min(input_width, output_width)\n\n if (height === input_height && width === input_width) {\n return image;\n }\n if (input_height > input_width) {\n width = Math.floor(input_width * height / input_height);\n } else if (input_width > input_height) {\n height = Math.floor(input_height * width / input_width);\n }\n return await image.resize(width, height, { resample });\n }\n\n\n /**\n * Crops the margin of the image. Gray pixels are considered margin (i.e., pixels with a value below the threshold).\n * @param {RawImage} image The image to be cropped.\n * @param {number} gray_threshold Value below which pixels are considered to be gray.\n * @returns {Promise} The cropped image.\n */\n async crop_margin(image, gray_threshold = 200) {\n\n const gray_image = image.clone().grayscale();\n\n const minValue = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.min)(gray_image.data)[0];\n const maxValue = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.max)(gray_image.data)[0];\n const diff = maxValue - minValue;\n\n if (diff === 0) {\n return image;\n }\n\n const threshold = gray_threshold / 255;\n\n let x_min = gray_image.width, y_min = gray_image.height, x_max = 0, y_max = 0;\n for (let j = 0; j < gray_image.height; ++j) {\n const row = j * gray_image.width;\n for (let i = 0; i < gray_image.width; ++i) {\n if ((gray_image.data[row + i] - minValue) / diff < threshold) {\n // We have a non-zero pixel, so we update the min/max values accordingly\n x_min = Math.min(x_min, i);\n y_min = Math.min(y_min, j);\n x_max = Math.max(x_max, i);\n y_max = Math.max(y_max, j);\n }\n }\n }\n\n image = await image.crop([x_min, y_min, x_max, y_max]);\n return image;\n }\n\n /**\n * Pad the image by a certain amount.\n * @param {Float32Array} pixelData The pixel data to pad.\n * @param {number[]} imgDims The dimensions of the image.\n * @param {{width:number; height:number}|number} padSize The dimensions of the padded image.\n * @param {Object} options The options for padding.\n * @param {'constant'|'symmetric'} [options.mode='constant'] The type of padding to add.\n * @param {boolean} [options.center=false] Whether to center the image.\n * @param {number} [options.constant_values=0] The constant value to use for padding.\n * @returns {[Float32Array, number[]]} The padded pixel data and image dimensions.\n */\n pad_image(pixelData, imgDims, padSize, {\n mode = 'constant',\n center = false,\n constant_values = 0,\n } = {}) {\n const [imageWidth, imageHeight, imageChannels] = imgDims;\n\n let paddedImageWidth, paddedImageHeight;\n if (typeof padSize === 'number') {\n paddedImageWidth = padSize;\n paddedImageHeight = padSize;\n } else {\n paddedImageWidth = padSize.width;\n paddedImageHeight = padSize.height;\n }\n\n // Only add padding if there is a difference in size\n if (paddedImageWidth !== imageWidth || paddedImageHeight !== imageHeight) {\n const paddedPixelData = new Float32Array(paddedImageWidth * paddedImageHeight * imageChannels);\n if (Array.isArray(constant_values)) {\n // Fill with constant values, cycling through the array\n for (let i = 0; i < paddedPixelData.length; ++i) {\n paddedPixelData[i] = constant_values[i % imageChannels];\n }\n } else if (constant_values !== 0) {\n paddedPixelData.fill(constant_values);\n }\n\n const [left, top] = center\n ? [Math.floor((paddedImageWidth - imageWidth) / 2), Math.floor((paddedImageHeight - imageHeight) / 2)]\n : [0, 0];\n\n // Copy the original image into the padded image\n for (let i = 0; i < imageHeight; ++i) {\n const a = (i + top) * paddedImageWidth;\n const b = i * imageWidth;\n for (let j = 0; j < imageWidth; ++j) {\n const c = (a + j + left) * imageChannels;\n const d = (b + j) * imageChannels;\n for (let k = 0; k < imageChannels; ++k) {\n paddedPixelData[c + k] = pixelData[d + k];\n }\n }\n }\n\n if (mode === 'symmetric') {\n if (center) {\n throw new Error('`center` padding is not supported when `mode` is set to `symmetric`.');\n // TODO: Implement this\n }\n const h1 = imageHeight - 1;\n const w1 = imageWidth - 1;\n for (let i = 0; i < paddedImageHeight; ++i) {\n const a = i * paddedImageWidth;\n const b = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.calculateReflectOffset)(i, h1) * imageWidth;\n\n for (let j = 0; j < paddedImageWidth; ++j) {\n if (i < imageHeight && j < imageWidth) continue; // Do not overwrite original image\n const c = (a + j) * imageChannels;\n const d = (b + (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.calculateReflectOffset)(j, w1)) * imageChannels;\n\n // Copy channel-wise\n for (let k = 0; k < imageChannels; ++k) {\n paddedPixelData[c + k] = pixelData[d + k];\n }\n }\n }\n }\n\n\n // Update pixel data and image dimensions\n pixelData = paddedPixelData;\n imgDims = [paddedImageHeight, paddedImageWidth, imageChannels]\n }\n return [pixelData, imgDims];\n }\n\n /**\n * Rescale the image' pixel values by `this.rescale_factor`.\n * @param {Float32Array} pixelData The pixel data to rescale.\n * @returns {void}\n */\n rescale(pixelData) {\n for (let i = 0; i < pixelData.length; ++i) {\n pixelData[i] = this.rescale_factor * pixelData[i];\n }\n }\n\n /**\n * Find the target (width, height) dimension of the output image after\n * resizing given the input image and the desired size.\n * @param {RawImage} image The image to resize.\n * @param {any} size The size to use for resizing the image. \n * @returns {[number, number]} The target (width, height) dimension of the output image after resizing.\n */\n get_resize_output_image_size(image, size) {\n // `size` comes in many forms, so we need to handle them all here:\n // 1. `size` is an integer, in which case we resize the image to be a square \n\n const [srcWidth, srcHeight] = image.size;\n\n let shortest_edge;\n let longest_edge;\n\n if (this.do_thumbnail) {\n // NOTE: custom logic for `Donut` models\n const { height, width } = size;\n shortest_edge = Math.min(height, width)\n }\n // Support both formats for backwards compatibility\n else if (Number.isInteger(size)) {\n shortest_edge = size;\n longest_edge = this.config.max_size ?? shortest_edge;\n\n } else if (size !== undefined) {\n // Extract known properties from `size`\n shortest_edge = size.shortest_edge;\n longest_edge = size.longest_edge;\n }\n\n // If `longest_edge` and `shortest_edge` are set, maintain aspect ratio and resize to `shortest_edge`\n // while keeping the largest dimension <= `longest_edge`\n if (shortest_edge !== undefined || longest_edge !== undefined) {\n // http://opensourcehacker.com/2011/12/01/calculate-aspect-ratio-conserving-resize-for-images-in-javascript/\n // Try resize so that shortest edge is `shortest_edge` (target)\n const shortResizeFactor = shortest_edge === undefined\n ? 1 // If `shortest_edge` is not set, don't upscale\n : Math.max(shortest_edge / srcWidth, shortest_edge / srcHeight);\n\n const newWidth = srcWidth * shortResizeFactor;\n const newHeight = srcHeight * shortResizeFactor;\n\n // The new width and height might be greater than `longest_edge`, so\n // we downscale again to ensure the largest dimension is `longest_edge` \n const longResizeFactor = longest_edge === undefined\n ? 1 // If `longest_edge` is not set, don't downscale\n : Math.min(longest_edge / newWidth, longest_edge / newHeight);\n\n // To avoid certain floating point precision issues, we round to 2 decimal places\n let finalWidth = Math.floor(Number((newWidth * longResizeFactor).toFixed(2)));\n let finalHeight = Math.floor(Number((newHeight * longResizeFactor).toFixed(2)));\n\n if (this.size_divisibility !== undefined) {\n [finalWidth, finalHeight] = enforce_size_divisibility([finalWidth, finalHeight], this.size_divisibility)\n }\n return [finalWidth, finalHeight];\n\n } else if (size !== undefined && size.width !== undefined && size.height !== undefined) {\n // If `width` and `height` are set, resize to those dimensions\n\n let newWidth = size.width;\n let newHeight = size.height;\n\n // Custom for DPT models\n if (this.config.keep_aspect_ratio && this.config.ensure_multiple_of) {\n\n // determine new height and width\n let scale_height = size.height / srcHeight;\n let scale_width = size.width / srcWidth;\n\n // scale as little as possible\n if (Math.abs(1 - scale_width) < Math.abs(1 - scale_height)) {\n // fit width\n scale_height = scale_width;\n } else {\n // fit height\n scale_width = scale_height;\n }\n\n newHeight = constraint_to_multiple_of(scale_height * srcHeight, this.config.ensure_multiple_of);\n newWidth = constraint_to_multiple_of(scale_width * srcWidth, this.config.ensure_multiple_of);\n }\n\n return [newWidth, newHeight];\n\n } else if (this.size_divisibility !== undefined) {\n return enforce_size_divisibility([srcWidth, srcHeight], this.size_divisibility);\n } else {\n throw new Error(`Could not resize image due to unsupported \\`this.size\\` option in config: ${JSON.stringify(size)}`);\n }\n }\n\n /**\n * Resizes the image.\n * @param {RawImage} image The image to resize.\n * @returns {Promise} The resized image.\n */\n async resize(image) {\n const [newWidth, newHeight] = this.get_resize_output_image_size(image, this.size);\n return await image.resize(newWidth, newHeight, {\n resample: this.resample,\n });\n }\n\n /**\n * @typedef {object} PreprocessedImage\n * @property {HeightWidth} original_size The original size of the image.\n * @property {HeightWidth} reshaped_input_size The reshaped input size of the image.\n * @property {Tensor} pixel_values The pixel values of the preprocessed image.\n */\n\n /**\n * Preprocesses the given image.\n *\n * @param {RawImage} image The image to preprocess.\n * @param {Object} overrides The overrides for the preprocessing options.\n * @returns {Promise} The preprocessed image.\n */\n async preprocess(image, {\n do_normalize = null,\n do_pad = null,\n do_convert_rgb = null,\n do_convert_grayscale = null,\n } = {}) {\n if (this.do_crop_margin) {\n // NOTE: Specific to nougat processors. This is done before resizing,\n // and can be interpreted as a pre-preprocessing step.\n image = await this.crop_margin(image);\n }\n\n const [srcWidth, srcHeight] = image.size; // original image size\n\n // Convert image to RGB if specified in config.\n if (do_convert_rgb ?? this.do_convert_rgb) {\n image = image.rgb();\n } else if (do_convert_grayscale) {\n image = image.grayscale();\n }\n\n // TODO:\n // For efficiency reasons, it might be best to merge the resize and center crop operations into one.\n\n // Resize all images\n if (this.do_resize) {\n image = await this.resize(image);\n }\n\n // Resize the image using thumbnail method.\n if (this.do_thumbnail) {\n image = await this.thumbnail(image, this.size, this.resample);\n }\n\n if (this.do_center_crop) {\n\n let crop_width;\n let crop_height;\n if (Number.isInteger(this.crop_size)) {\n crop_width = this.crop_size;\n crop_height = this.crop_size;\n } else {\n crop_width = this.crop_size.width;\n crop_height = this.crop_size.height;\n }\n\n image = await image.center_crop(crop_width, crop_height);\n }\n\n /** @type {HeightWidth} */\n const reshaped_input_size = [image.height, image.width];\n\n let pixelData = Float32Array.from(image.data);\n let imgDims = [image.height, image.width, image.channels];\n\n if (this.do_rescale) {\n this.rescale(pixelData);\n }\n\n if (do_normalize ?? this.do_normalize) {\n let image_mean = this.image_mean;\n if (!Array.isArray(this.image_mean)) {\n image_mean = new Array(image.channels).fill(image_mean);\n }\n\n let image_std = this.image_std;\n if (!Array.isArray(this.image_std)) {\n image_std = new Array(image.channels).fill(image_mean);\n }\n\n if (image_mean.length !== image.channels || image_std.length !== image.channels) {\n throw new Error(`When set to arrays, the length of \\`image_mean\\` (${image_mean.length}) and \\`image_std\\` (${image_std.length}) must match the number of channels in the image (${image.channels}).`);\n }\n\n for (let i = 0; i < pixelData.length; i += image.channels) {\n for (let j = 0; j < image.channels; ++j) {\n pixelData[i + j] = (pixelData[i + j] - this.image_mean[j]) / this.image_std[j];\n }\n }\n }\n\n // do padding after rescaling/normalizing\n if (do_pad ?? (this.do_pad && this.pad_size)) {\n const padded = this.pad_image(pixelData, [image.width, image.height, image.channels], this.pad_size);\n [pixelData, imgDims] = padded; // Update pixel data and image dimensions\n }\n\n // Create HWC tensor\n const img = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor('float32', pixelData, imgDims);\n\n // convert to channel dimension format:\n const transposed = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.transpose)(img, [2, 0, 1]); // hwc -> chw\n\n return {\n original_size: [srcHeight, srcWidth],\n reshaped_input_size: reshaped_input_size,\n pixel_values: transposed,\n }\n }\n\n /**\n * Calls the feature extraction process on an array of images,\n * preprocesses each image, and concatenates the resulting\n * features into a single Tensor.\n * @param {RawImage[]} images The image(s) to extract features from.\n * @param {...any} args Additional arguments.\n * @returns {Promise} An object containing the concatenated pixel values (and other metadata) of the preprocessed images.\n */\n async _call(images, ...args) {\n if (!Array.isArray(images)) {\n images = [images];\n }\n /** @type {PreprocessedImage[]} */\n const imageData = await Promise.all(images.map(x => this.preprocess(x)));\n\n // Stack pixel values\n const pixel_values = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.stack)(imageData.map(x => x.pixel_values), 0);\n\n return {\n pixel_values: pixel_values,\n\n // Original sizes of images\n original_sizes: imageData.map(x => x.original_size),\n\n // Reshaped sizes of images, before padding or cropping\n reshaped_input_sizes: imageData.map(x => x.reshaped_input_size),\n }\n }\n\n}\n\nclass SegformerFeatureExtractor extends ImageFeatureExtractor {\n\n /**\n * Converts the output of `SegformerForSemanticSegmentation` into semantic segmentation maps.\n * @param {*} outputs Raw outputs of the model.\n * @param {number[][]} [target_sizes=null] List of tuples corresponding to the requested final size\n * (height, width) of each prediction. If unset, predictions will not be resized.\n * @returns {{segmentation: Tensor; labels: number[]}[]} The semantic segmentation maps.\n */\n post_process_semantic_segmentation(outputs, target_sizes = null) {\n\n const logits = outputs.logits;\n const batch_size = logits.dims[0];\n\n if (target_sizes !== null && target_sizes.length !== batch_size) {\n throw Error(\"Make sure that you pass in as many target sizes as the batch dimension of the logits\")\n }\n\n const toReturn = [];\n for (let i = 0; i < batch_size; ++i) {\n const target_size = target_sizes !== null ? target_sizes[i] : null;\n\n let data = logits[i];\n\n // 1. If target_size is not null, we need to resize the masks to the target size\n if (target_size !== null) {\n // resize the masks to the target size\n data = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.interpolate)(data, target_size, 'bilinear', false);\n }\n const [height, width] = target_size ?? data.dims.slice(-2);\n\n const segmentation = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'int32',\n new Int32Array(height * width),\n [height, width]\n );\n\n // Buffer to store current largest value\n const buffer = data[0].data;\n for (let j = 1; j < data.dims[0]; ++j) {\n const row = data[j].data;\n for (let k = 0; k < row.length; ++k) {\n if (row[k] > buffer[k]) {\n buffer[k] = row[k];\n segmentation.data[k] = j;\n }\n }\n }\n\n // Store which objects have labels\n // This is much more efficient that creating a set of the final values\n const hasLabel = new Array(data.dims[0]);\n const out = segmentation.data;\n for (let j = 0; j < out.length; ++j) {\n const index = out[j];\n hasLabel[index] = index;\n }\n /** @type {number[]} The unique list of labels that were detected */\n const labels = hasLabel.filter(x => x !== undefined);\n\n toReturn.push({ segmentation, labels });\n }\n return toReturn;\n }\n}\nclass DPTImageProcessor extends ImageFeatureExtractor { }\nclass BitImageProcessor extends ImageFeatureExtractor { }\nclass DPTFeatureExtractor extends ImageFeatureExtractor { }\nclass GLPNFeatureExtractor extends ImageFeatureExtractor { }\nclass CLIPFeatureExtractor extends ImageFeatureExtractor { }\nclass ChineseCLIPFeatureExtractor extends ImageFeatureExtractor { }\nclass SiglipImageProcessor extends ImageFeatureExtractor { }\nclass ConvNextFeatureExtractor extends ImageFeatureExtractor {\n constructor(config) {\n super(config);\n\n /**\n * Percentage of the image to crop. Only has an effect if this.size < 384.\n */\n this.crop_pct = this.config.crop_pct ?? (224 / 256);\n }\n\n async resize(image) {\n const shortest_edge = this.size?.shortest_edge;\n if (shortest_edge === undefined) {\n throw new Error(`Size dictionary must contain 'shortest_edge' key.`);\n }\n\n if (shortest_edge < 384) {\n // maintain same ratio, resizing shortest edge to shortest_edge/crop_pct\n const resize_shortest_edge = Math.floor(shortest_edge / this.crop_pct);\n\n const [newWidth, newHeight] = this.get_resize_output_image_size(image, {\n shortest_edge: resize_shortest_edge,\n });\n\n image = await image.resize(newWidth, newHeight, {\n resample: this.resample,\n });\n\n // then crop to (shortest_edge, shortest_edge)\n image = await image.center_crop(shortest_edge, shortest_edge);\n } else {\n // warping (no cropping) when evaluated at 384 or larger\n image = await image.resize(shortest_edge, shortest_edge, {\n resample: this.resample,\n });\n }\n\n return image;\n }\n}\nclass ConvNextImageProcessor extends ConvNextFeatureExtractor { } // NOTE extends ConvNextFeatureExtractor\nclass ViTFeatureExtractor extends ImageFeatureExtractor { }\nclass ViTImageProcessor extends ImageFeatureExtractor { }\n\nclass MobileViTFeatureExtractor extends ImageFeatureExtractor { }\nclass OwlViTFeatureExtractor extends ImageFeatureExtractor {\n /** @type {post_process_object_detection} */\n post_process_object_detection(...args) {\n return post_process_object_detection(...args);\n }\n}\nclass Owlv2ImageProcessor extends OwlViTFeatureExtractor { } // NOTE extends OwlViTFeatureExtractor\n\nclass DeiTFeatureExtractor extends ImageFeatureExtractor { }\nclass BeitFeatureExtractor extends ImageFeatureExtractor { }\nclass DonutFeatureExtractor extends ImageFeatureExtractor {\n pad_image(pixelData, imgDims, padSize, options = {}) {\n const [imageWidth, imageHeight, imageChannels] = imgDims;\n\n let image_mean = this.image_mean;\n if (!Array.isArray(this.image_mean)) {\n image_mean = new Array(imageChannels).fill(image_mean);\n }\n\n let image_std = this.image_std;\n if (!Array.isArray(image_std)) {\n image_std = new Array(imageChannels).fill(image_mean);\n }\n\n const constant_values = image_mean.map((x, i) => - x / this.image_std[i]);\n\n return super.pad_image(pixelData, imgDims, padSize, {\n center: true,\n\n // Since normalization is done after padding, we need to use certain constant values to ensure the same behaviour is observed.\n // For more information, see https://github.com/huggingface/transformers/blob/main/src/transformers/models/donut/image_processing_donut.py#L433-L451\n constant_values: constant_values,\n ...options,\n });\n }\n}\nclass NougatImageProcessor extends DonutFeatureExtractor { } // NOTE extends DonutFeatureExtractor\n\n/**\n * @typedef {object} DetrFeatureExtractorResultProps\n * @property {Tensor} pixel_mask\n * @typedef {ImageFeatureExtractorResult & DetrFeatureExtractorResultProps} DetrFeatureExtractorResult\n */\n\n/**\n * Detr Feature Extractor.\n *\n * @extends ImageFeatureExtractor\n */\nclass DetrFeatureExtractor extends ImageFeatureExtractor {\n /**\n * Calls the feature extraction process on an array of images, preprocesses\n * each image, and concatenates the resulting features into a single Tensor.\n * @param {RawImage[]} images The image(s) to extract features from.\n * @returns {Promise} An object containing the concatenated pixel values of the preprocessed images.\n */\n async _call(images) {\n const result = await super._call(images);\n\n // TODO support differently-sized images, for now assume all images are the same size.\n // TODO support different mask sizes (not just 64x64)\n // Currently, just fill pixel mask with 1s\n const maskSize = [result.pixel_values.dims[0], 64, 64];\n const pixel_mask = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'int64',\n new BigInt64Array(maskSize.reduce((a, b) => a * b)).fill(1n),\n maskSize\n );\n\n return { ...result, pixel_mask };\n }\n\n /**\n * Post-processes the outputs of the model (for object detection).\n * @param {Object} outputs The outputs of the model that must be post-processed\n * @param {Tensor} outputs.logits The logits\n * @param {Tensor} outputs.pred_boxes The predicted boxes.\n * @return {Object[]} An array of objects containing the post-processed outputs.\n */\n\n /** @type {post_process_object_detection} */\n post_process_object_detection(...args) {\n return post_process_object_detection(...args);\n }\n\n /**\n * Binarize the given masks using `object_mask_threshold`, it returns the associated values of `masks`, `scores` and `labels`.\n * @param {Tensor} class_logits The class logits.\n * @param {Tensor} mask_logits The mask logits.\n * @param {number} object_mask_threshold A number between 0 and 1 used to binarize the masks.\n * @param {number} num_labels The number of labels.\n * @returns {[Tensor[], number[], number[]]} The binarized masks, the scores, and the labels.\n */\n remove_low_and_no_objects(class_logits, mask_logits, object_mask_threshold, num_labels) {\n\n let mask_probs_item = [];\n let pred_scores_item = [];\n let pred_labels_item = [];\n\n for (let j = 0; j < class_logits.dims[0]; ++j) {\n let cls = class_logits[j];\n let mask = mask_logits[j];\n\n let pred_label = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.max)(cls.data)[1];\n if (pred_label === num_labels) {\n // Is the background, so we ignore it\n continue;\n }\n\n let scores = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.softmax)(cls.data);\n let pred_score = scores[pred_label];\n if (pred_score > object_mask_threshold) {\n mask_probs_item.push(mask);\n pred_scores_item.push(pred_score);\n pred_labels_item.push(pred_label);\n }\n }\n\n return [mask_probs_item, pred_scores_item, pred_labels_item];\n\n }\n\n /**\n * Checks whether the segment is valid or not.\n * @param {Int32Array} mask_labels Labels for each pixel in the mask.\n * @param {Tensor[]} mask_probs Probabilities for each pixel in the masks.\n * @param {number} k The class id of the segment.\n * @param {number} mask_threshold The mask threshold.\n * @param {number} overlap_mask_area_threshold The overlap mask area threshold.\n * @returns {[boolean, number[]]} Whether the segment is valid or not, and the indices of the valid labels.\n */\n check_segment_validity(\n mask_labels,\n mask_probs,\n k,\n mask_threshold = 0.5,\n overlap_mask_area_threshold = 0.8\n ) {\n // mask_k is a 1D array of indices, indicating where the mask is equal to k\n let mask_k = [];\n let mask_k_area = 0;\n let original_area = 0;\n\n // Compute the area of all the stuff in query k\n for (let i = 0; i < mask_labels.length; ++i) {\n if (mask_labels[i] === k) {\n mask_k.push(i);\n ++mask_k_area;\n }\n\n if (mask_probs[k].data[i] >= mask_threshold) {\n ++original_area;\n }\n }\n let mask_exists = mask_k_area > 0 && original_area > 0;\n\n // Eliminate disconnected tiny segments\n if (mask_exists) {\n // Perform additional check\n let area_ratio = mask_k_area / original_area;\n mask_exists = area_ratio > overlap_mask_area_threshold;\n }\n\n return [mask_exists, mask_k]\n }\n\n /**\n * Computes the segments.\n * @param {Tensor[]} mask_probs The mask probabilities.\n * @param {number[]} pred_scores The predicted scores.\n * @param {number[]} pred_labels The predicted labels.\n * @param {number} mask_threshold The mask threshold.\n * @param {number} overlap_mask_area_threshold The overlap mask area threshold.\n * @param {Set} label_ids_to_fuse The label ids to fuse.\n * @param {number[]} target_size The target size of the image.\n * @returns {[Tensor, Array<{id: number, label_id: number, score: number}>]} The computed segments.\n */\n compute_segments(\n mask_probs,\n pred_scores,\n pred_labels,\n mask_threshold,\n overlap_mask_area_threshold,\n label_ids_to_fuse = null,\n target_size = null,\n ) {\n let [height, width] = target_size ?? mask_probs[0].dims;\n\n let segmentation = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'int32',\n new Int32Array(height * width),\n [height, width]\n );\n let segments = [];\n\n // 1. If target_size is not null, we need to resize the masks to the target size\n if (target_size !== null) {\n // resize the masks to the target size\n for (let i = 0; i < mask_probs.length; ++i) {\n mask_probs[i] = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.interpolate)(mask_probs[i], target_size, 'bilinear', false);\n }\n }\n\n // 2. Weigh each mask by its prediction score\n // NOTE: `mask_probs` is updated in-place\n // \n // Temporary storage for the best label/scores for each pixel ([height, width]):\n let mask_labels = new Int32Array(mask_probs[0].data.length);\n let bestScores = new Float32Array(mask_probs[0].data.length);\n\n for (let i = 0; i < mask_probs.length; ++i) {\n let score = pred_scores[i];\n\n for (let j = 0; j < mask_probs[i].data.length; ++j) {\n mask_probs[i].data[j] *= score\n if (mask_probs[i].data[j] > bestScores[j]) {\n mask_labels[j] = i;\n bestScores[j] = mask_probs[i].data[j];\n }\n }\n }\n\n let current_segment_id = 0;\n\n // let stuff_memory_list = {}\n for (let k = 0; k < pred_labels.length; ++k) {\n let pred_class = pred_labels[k];\n\n // TODO add `should_fuse`\n // let should_fuse = pred_class in label_ids_to_fuse\n\n // Check if mask exists and large enough to be a segment\n let [mask_exists, mask_k] = this.check_segment_validity(\n mask_labels,\n mask_probs,\n k,\n mask_threshold,\n overlap_mask_area_threshold\n )\n\n if (!mask_exists) {\n // Nothing to see here\n continue;\n }\n\n // TODO\n // if (pred_class in stuff_memory_list) {\n // current_segment_id = stuff_memory_list[pred_class]\n // } else {\n // current_segment_id += 1;\n // }\n ++current_segment_id;\n\n\n // Add current object segment to final segmentation map\n for (let index of mask_k) {\n segmentation.data[index] = current_segment_id;\n }\n\n segments.push({\n id: current_segment_id,\n label_id: pred_class,\n // was_fused: should_fuse, TODO\n score: pred_scores[k],\n })\n\n // TODO\n // if(should_fuse){\n // stuff_memory_list[pred_class] = current_segment_id\n // }\n }\n\n return [segmentation, segments];\n }\n\n /**\n * Post-process the model output to generate the final panoptic segmentation.\n * @param {*} outputs The model output to post process\n * @param {number} [threshold=0.5] The probability score threshold to keep predicted instance masks.\n * @param {number} [mask_threshold=0.5] Threshold to use when turning the predicted masks into binary values.\n * @param {number} [overlap_mask_area_threshold=0.8] The overlap mask area threshold to merge or discard small disconnected parts within each binary instance mask.\n * @param {Set} [label_ids_to_fuse=null] The labels in this state will have all their instances be fused together.\n * @param {number[][]} [target_sizes=null] The target sizes to resize the masks to.\n * @returns {Array<{ segmentation: Tensor, segments_info: Array<{id: number, label_id: number, score: number}>}>}\n */\n post_process_panoptic_segmentation(\n outputs,\n threshold = 0.5,\n mask_threshold = 0.5,\n overlap_mask_area_threshold = 0.8,\n label_ids_to_fuse = null,\n target_sizes = null,\n ) {\n if (label_ids_to_fuse === null) {\n console.warn(\"`label_ids_to_fuse` unset. No instance will be fused.\")\n label_ids_to_fuse = new Set();\n }\n\n const class_queries_logits = outputs.logits; // [batch_size, num_queries, num_classes+1]\n const masks_queries_logits = outputs.pred_masks; // [batch_size, num_queries, height, width]\n\n const mask_probs = masks_queries_logits.sigmoid() // [batch_size, num_queries, height, width]\n\n let [batch_size, num_queries, num_labels] = class_queries_logits.dims;\n num_labels -= 1; // Remove last class (background)\n\n if (target_sizes !== null && target_sizes.length !== batch_size) {\n throw Error(\"Make sure that you pass in as many target sizes as the batch dimension of the logits\")\n }\n\n let toReturn = [];\n for (let i = 0; i < batch_size; ++i) {\n let target_size = target_sizes !== null ? target_sizes[i] : null;\n\n let class_logits = class_queries_logits[i];\n let mask_logits = mask_probs[i];\n\n let [mask_probs_item, pred_scores_item, pred_labels_item] = this.remove_low_and_no_objects(class_logits, mask_logits, threshold, num_labels);\n\n if (pred_labels_item.length === 0) {\n // No mask found\n let [height, width] = target_size ?? mask_logits.dims.slice(-2);\n\n let segmentation = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'int32',\n new Int32Array(height * width).fill(-1),\n [height, width]\n )\n toReturn.push({\n segmentation: segmentation,\n segments_info: []\n });\n continue;\n }\n\n\n // Get segmentation map and segment information of batch item\n let [segmentation, segments] = this.compute_segments(\n mask_probs_item,\n pred_scores_item,\n pred_labels_item,\n mask_threshold,\n overlap_mask_area_threshold,\n label_ids_to_fuse,\n target_size,\n )\n\n toReturn.push({\n segmentation: segmentation,\n segments_info: segments\n })\n }\n\n return toReturn;\n }\n\n post_process_instance_segmentation() {\n // TODO\n throw Error(\"Not implemented yet\");\n }\n}\n\nclass YolosFeatureExtractor extends ImageFeatureExtractor {\n /** @type {post_process_object_detection} */\n post_process_object_detection(...args) {\n return post_process_object_detection(...args);\n }\n}\n\n/**\n * @typedef {object} SamImageProcessorResult\n * @property {Tensor} pixel_values\n * @property {HeightWidth[]} original_sizes\n * @property {HeightWidth[]} reshaped_input_sizes\n * @property {Tensor} [input_points]\n * @property {Tensor} [input_labels]\n */\n\nclass SamImageProcessor extends ImageFeatureExtractor {\n\n /**\n * \n * @param {any} input_points \n * @param {HeightWidth[]} original_sizes \n * @param {HeightWidth[]} reshaped_input_sizes \n * @returns {Tensor}\n */\n reshape_input_points(input_points, original_sizes, reshaped_input_sizes) {\n\n // Make deep copy to avoid altering user's input\n input_points = structuredClone(input_points);\n let shape = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.calculateDimensions)(input_points);\n\n // TODO: add support for 2D input_points\n if (shape.length === 3) {\n // Correct user's input\n shape = [1, ...shape];\n input_points = [input_points];\n } else if (shape.length !== 4) {\n throw Error(\"The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.\")\n }\n\n // Reshape input points\n for (let i = 0; i < input_points.length; ++i) { // batch_size\n let originalImageSize = original_sizes[i];\n let reshapedImageSize = reshaped_input_sizes[i];\n\n let resizeFactors = [\n reshapedImageSize[0] / originalImageSize[0],\n reshapedImageSize[1] / originalImageSize[1]\n ]\n\n for (let j = 0; j < input_points[i].length; ++j) { // point_batch_size\n for (let k = 0; k < input_points[i][j].length; ++k) { // nb_points_per_image\n for (let w = 0; w < input_points[i][j][k].length; ++w) { // 2\n input_points[i][j][k][w] *= resizeFactors[w];\n }\n }\n }\n }\n\n return new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'float32',\n Float32Array.from(input_points.flat(Infinity)),\n shape\n )\n\n }\n\n /**\n * \n * @param {any} input_labels \n * @param {Tensor} input_points \n * @returns {Tensor}\n */\n add_input_labels(input_labels, input_points) {\n let shape = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.calculateDimensions)(input_labels);\n if (shape.length === 2) {\n // Correct user's input\n shape = [1, ...shape];\n input_labels = [input_labels];\n } else if (shape.length !== 3) {\n throw Error(\"The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.\")\n }\n\n if (shape.some((x, i) => x !== input_points.dims[i])) {\n throw Error(`The first ${shape.length} dimensions of 'input_points' and 'input_labels' must be the same.`)\n }\n return new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'int64',\n input_labels.flat(Infinity).map(BigInt),\n shape,\n )\n }\n /**\n * @param {any[]} images The URL(s) of the image(s) to extract features from.\n * @param {any} [input_points] A 3D or 4D array, representing the input points provided by the user.\n * - 3D: `[point_batch_size, nb_points_per_image, 2]`. In this case, `batch_size` is assumed to be 1.\n * - 4D: `[batch_size, point_batch_size, nb_points_per_image, 2]`.\n * @param {any} [input_labels] A 2D or 3D array, representing the input labels for the points, used by the prompt encoder to encode the prompt.\n * - 2D: `[point_batch_size, nb_points_per_image]`. In this case, `batch_size` is assumed to be 1.\n * - 3D: `[batch_size, point_batch_size, nb_points_per_image]`.\n * @returns {Promise}\n */\n async _call(images, input_points = null, input_labels = null) {\n // TODO allow user to use preprocessed images\n /** @type {SamImageProcessorResult} */\n const processed = await super._call(images);\n\n if (input_points) {\n processed.input_points = this.reshape_input_points(\n input_points, processed.original_sizes, processed.reshaped_input_sizes\n );\n }\n\n if (input_labels) {\n if (!processed.input_points) {\n throw Error(\"`input_points` must be provided if `input_labels` are provided.\")\n }\n processed.input_labels = this.add_input_labels(input_labels, processed.input_points);\n }\n\n return processed;\n }\n\n /**\n * Remove padding and upscale masks to the original image size.\n * @param {Tensor} masks Batched masks from the mask_decoder in (batch_size, num_channels, height, width) format.\n * @param {number[][]} original_sizes The original sizes of each image before it was resized to the model's expected input shape, in (height, width) format.\n * @param {number[][]} reshaped_input_sizes The size of each image as it is fed to the model, in (height, width) format. Used to remove padding.\n * @param {Object} options Optional parameters for post-processing.\n * @param {number} [options.mask_threshold] The threshold to use for binarizing the masks.\n * @param {boolean} [options.binarize] Whether to binarize the masks.\n * @param {Object} [options.pad_size] The target size the images were padded to before being passed to the model. If `null`, the target size is assumed to be the processor's `pad_size`.\n * @param {number} [options.pad_size.height] The height the images were padded to.\n * @param {number} [options.pad_size.width] The width the images were padded to.\n * @returns {Tensor[]} Batched masks in batch_size, num_channels, height, width) format, where (height, width) is given by original_size.\n */\n post_process_masks(masks, original_sizes, reshaped_input_sizes, {\n mask_threshold = 0.0,\n binarize = true,\n pad_size = null,\n } = {}) {\n // masks: [1, 1, 3, 256, 256]\n\n const output_masks = [];\n\n pad_size = pad_size ?? this.pad_size;\n\n const target_image_size = [pad_size.height, pad_size.width];\n\n for (let i = 0; i < original_sizes.length; ++i) {\n const original_size = original_sizes[i];\n const reshaped_input_size = reshaped_input_sizes[i];\n\n const mask = masks[i]; // [b, c, h, w]\n\n // TODO: improve\n const interpolated_masks = [];\n for (let j = 0; j < mask.dims[0]; ++j) {\n const m = mask[j]; // 3d tensor\n\n // Upscale mask to padded size\n let interpolated_mask = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.interpolate)(m, target_image_size, 'bilinear', false);\n\n // Crop mask\n interpolated_mask = interpolated_mask.slice(null, [0, reshaped_input_size[0]], [0, reshaped_input_size[1]]);\n\n // Downscale mask\n interpolated_mask = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.interpolate)(interpolated_mask, original_size, 'bilinear', false);\n\n if (binarize) {\n const binarizedMaskData = new Uint8Array(interpolated_mask.data.length);\n for (let i = 0; i < interpolated_mask.data.length; ++i) {\n if (interpolated_mask.data[i] > mask_threshold) {\n binarizedMaskData[i] = 1;\n }\n }\n interpolated_mask = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'bool',\n binarizedMaskData,\n interpolated_mask.dims\n )\n }\n\n interpolated_masks.push(interpolated_mask);\n }\n\n output_masks.push((0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.stack)(interpolated_masks));\n }\n\n return output_masks;\n }\n}\n\nclass Swin2SRImageProcessor extends ImageFeatureExtractor {\n pad_image(pixelData, imgDims, padSize, options = {}) {\n // NOTE: In this case, `padSize` represents the size of the sliding window for the local attention.\n // In other words, the image is padded so that its width and height are multiples of `padSize`.\n const [imageWidth, imageHeight, imageChannels] = imgDims;\n\n return super.pad_image(pixelData, imgDims, {\n // NOTE: For Swin2SR models, the original python implementation adds padding even when the image's width/height is already\n // a multiple of `pad_size`. However, this is most likely a bug (PR: https://github.com/mv-lab/swin2sr/pull/19).\n // For this reason, we only add padding when the image's width/height is not a multiple of `pad_size`.\n width: imageWidth + (padSize - imageWidth % padSize) % padSize,\n height: imageHeight + (padSize - imageHeight % padSize) % padSize,\n }, {\n mode: 'symmetric',\n center: false,\n constant_values: -1,\n ...options,\n })\n }\n}\n\nclass VitMatteImageProcessor extends ImageFeatureExtractor {\n /**\n * Calls the feature extraction process on an array of images, preprocesses\n * each image, and concatenates the resulting features into a single Tensor.\n * @param {RawImage[]} images The image(s) to extract features from.\n * @param {RawImage[]} trimaps The trimaps(s) to extract features from.\n * @returns {Promise} An object containing the concatenated pixel values of the preprocessed images.\n */\n async _call(images, trimaps) {\n if (!Array.isArray(images)) {\n images = [images];\n }\n if (!Array.isArray(trimaps)) {\n trimaps = [trimaps];\n }\n\n const imageData = await Promise.all(images.map(x => this.preprocess(x)));\n const trimapData = await Promise.all(trimaps.map(x => this.preprocess(x, {\n do_normalize: false,\n do_convert_rgb: false,\n do_convert_grayscale: true,\n })));\n\n\n // Stack pixel values\n const pixel_values = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.stack)(imageData.map(\n // Concatenate images and trimaps\n (x, i) => (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.cat)([x.pixel_values, trimapData[i].pixel_values], 0)\n ), 0);\n\n return {\n pixel_values: pixel_values,\n\n // Original sizes of images\n original_sizes: imageData.map(x => x.original_size),\n\n // Reshaped sizes of images, before padding or cropping\n reshaped_input_sizes: imageData.map(x => x.reshaped_input_size),\n }\n }\n}\n\nclass WhisperFeatureExtractor extends FeatureExtractor {\n\n constructor(config) {\n super(config);\n\n // Prefer given `mel_filters` from preprocessor_config.json, or calculate them if they don't exist.\n this.config.mel_filters ??= (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.mel_filter_bank)(\n Math.floor(1 + this.config.n_fft / 2), // num_frequency_bins\n this.config.feature_size, // num_mel_filters\n 0.0, // min_frequency\n 8000.0, // max_frequency\n this.config.sampling_rate, // sampling_rate\n \"slaney\", // norm\n \"slaney\", // mel_scale\n );\n\n this.window = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.window_function)(this.config.n_fft, 'hann');\n }\n\n /**\n * Computes the log-Mel spectrogram of the provided audio waveform.\n * @param {Float32Array|Float64Array} waveform The audio waveform to process.\n * @returns {{data: Float32Array, dims: number[]}} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n _extract_fbank_features(waveform) {\n const { data, dims } = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.spectrogram)(\n waveform,\n this.window, // window\n this.config.n_fft, // frame_length\n this.config.hop_length, // hop_length\n {\n power: 2.0,\n mel_filters: this.config.mel_filters,\n log_mel: 'log10',\n\n // Custom\n max_num_frames: this.config.nb_max_frames, // 3000\n }\n )\n\n const maxValue = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.max)(data)[0];\n\n for (let i = 0; i < data.length; ++i) {\n data[i] = (Math.max(data[i], maxValue - 8.0) + 4.0) / 4.0;\n }\n\n return { data, dims };\n }\n\n /**\n * Asynchronously extracts features from a given audio using the provided configuration.\n * @param {Float32Array|Float64Array} audio The audio data as a Float32Array/Float64Array.\n * @returns {Promise<{ input_features: Tensor }>} A Promise resolving to an object containing the extracted input features as a Tensor.\n */\n async _call(audio) {\n validate_audio_inputs(audio, 'WhisperFeatureExtractor');\n\n let waveform;\n if (audio.length > this.config.n_samples) {\n console.warn(\n \"Attempting to extract features for audio longer than 30 seconds. \" +\n \"If using a pipeline to extract transcript from a long audio clip, \" +\n \"remember to specify `chunk_length_s` and/or `stride_length_s`.\"\n );\n waveform = audio.slice(0, this.config.n_samples);\n } else {\n // pad with zeros\n waveform = new Float32Array(this.config.n_samples);\n waveform.set(audio);\n }\n\n const { data, dims } = this._extract_fbank_features(waveform);\n\n return {\n input_features: new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor('float32',\n data,\n [1, ...dims]\n )\n };\n }\n}\n\nclass Wav2Vec2FeatureExtractor extends FeatureExtractor {\n\n /**\n * @param {Float32Array} input_values \n * @returns {Float32Array} \n */\n _zero_mean_unit_var_norm(input_values) {\n // TODO support batch?\n const sum = input_values.reduce((a, b) => a + b, 0);\n const mean = sum / input_values.length;\n const variance = input_values.reduce((a, b) => a + (b - mean) ** 2, 0) / input_values.length;\n return input_values.map(x => (x - mean) / Math.sqrt(variance + 1e-7));\n }\n\n /**\n * Asynchronously extracts features from a given audio using the provided configuration.\n * @param {Float32Array|Float64Array} audio The audio data as a Float32Array/Float64Array.\n * @returns {Promise<{ input_values: Tensor; attention_mask: Tensor }>} A Promise resolving to an object containing the extracted input features and attention mask as Tensors.\n */\n async _call(audio) {\n validate_audio_inputs(audio, 'Wav2Vec2FeatureExtractor');\n\n if (audio instanceof Float64Array) {\n audio = new Float32Array(audio);\n }\n\n let input_values = audio;\n\n // zero-mean and unit-variance normalization\n if (this.config.do_normalize) {\n input_values = this._zero_mean_unit_var_norm(input_values);\n }\n\n // TODO: allow user to pass in attention mask\n const shape = [1, input_values.length];\n return {\n input_values: new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor('float32', input_values, shape),\n attention_mask: new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor('int64', new BigInt64Array(input_values.length).fill(1n), shape)\n };\n }\n}\n\nclass SeamlessM4TFeatureExtractor extends FeatureExtractor {\n\n constructor(config) {\n super(config);\n\n const sampling_rate = this.config.sampling_rate;\n const mel_filters = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.mel_filter_bank)(\n 256, // num_frequency_bins\n this.config.num_mel_bins, // num_mel_filters\n 20, // min_frequency\n Math.floor(sampling_rate / 2), // max_frequency\n sampling_rate, // sampling_rate\n null, // norm\n \"kaldi\", // mel_scale\n true, // triangularize_in_mel_space\n );\n\n // Do padding:\n for (let i = 0; i < mel_filters.length; ++i) {\n mel_filters[i].push(0);\n }\n this.mel_filters = mel_filters;\n\n this.window = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.window_function)(400, 'povey', {\n periodic: false,\n })\n }\n\n /**\n * Computes the log-Mel spectrogram of the provided audio waveform.\n * @param {Float32Array|Float64Array} waveform The audio waveform to process.\n * @param {number} max_length The maximum number of frames to return.\n * @returns {{data: Float32Array, dims: number[]}} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n _extract_fbank_features(waveform, max_length) {\n // NOTE: We don't pad/truncate since that is passed in as `max_num_frames`\n\n // Kaldi compliance: 16-bit signed integers\n // 32768 == 2 ** 15\n waveform = waveform.map((/** @type {number} */ x) => x * 32768)\n\n return (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.spectrogram)(\n waveform,\n this.window, // window\n 400, // frame_length\n 160, // hop_length\n {\n fft_length: 512,\n power: 2.0,\n center: false,\n preemphasis: 0.97,\n mel_filters: this.mel_filters,\n log_mel: 'log',\n mel_floor: 1.192092955078125e-07,\n remove_dc_offset: true,\n\n // Custom\n max_num_frames: max_length,\n transpose: true,\n }\n )\n }\n\n /**\n * Asynchronously extracts features from a given audio using the provided configuration.\n * @param {Float32Array|Float64Array} audio The audio data as a Float32Array/Float64Array.\n * @param {Object} options Optional parameters for feature extraction.\n * @param {boolean} [options.padding=true] Whether to pad the sequence to a multiple of `pad_to_multiple_of`.\n * @param {number} [options.pad_to_multiple_of=2] The number to pad the sequence to a multiple of.\n * @param {boolean} [options.do_normalize_per_mel_bins=true] Whether or not to zero-mean unit-variance normalize the input per mel-channel.\n * @param {boolean} [options.return_attention_mask=true] Whether to return the attention mask.\n * @returns {Promise<{ input_features: Tensor, attention_mask?: Tensor }>} A Promise resolving to an object containing the extracted input features and attention masks as Tensors.\n */\n async _call(audio, {\n padding = true,\n pad_to_multiple_of = 2,\n do_normalize_per_mel_bins = true,\n return_attention_mask = true,\n } = {}) {\n validate_audio_inputs(audio, 'SeamlessM4TFeatureExtractor');\n\n let features = this._extract_fbank_features(audio, this.config.max_length);\n\n if (do_normalize_per_mel_bins) {\n const [num_features, feature_size] = features.dims;\n for (let i = 0; i < feature_size; ++i) {\n let sum = 0;\n for (let j = 0; j < num_features; ++j) {\n sum += features.data[j * feature_size + i];\n }\n\n const mean = sum / num_features;\n\n let variance = 0;\n for (let j = 0; j < num_features; ++j) {\n variance += (features.data[j * feature_size + i] - mean) ** 2;\n }\n variance /= num_features - 1; // NOTE: We use ddof=1\n\n const std = Math.sqrt(variance + 1e-7);\n for (let j = 0; j < num_features; ++j) {\n const index = j * feature_size + i;\n features.data[index] = (features.data[index] - mean) / std;\n }\n }\n }\n\n let padded_attention_mask;\n if (padding) {\n const [num_frames, num_channels] = features.dims;\n\n const pad_size = num_frames % pad_to_multiple_of;\n if (pad_size > 0) {\n const padded_data = new Float32Array(num_channels * (num_frames + pad_size));\n padded_data.set(features.data)\n padded_data.fill(this.config.padding_value, features.data.length)\n\n const numPaddedFrames = num_frames + pad_size;\n features = {\n data: padded_data,\n dims: [numPaddedFrames, num_channels],\n }\n\n if (return_attention_mask) {\n padded_attention_mask = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'int64',\n new BigInt64Array(numPaddedFrames),\n [1, numPaddedFrames],\n )\n padded_attention_mask.data.fill(1n, 0, num_frames);\n }\n }\n }\n\n const [num_frames, num_channels] = features.dims;\n\n const stride = this.config.stride;\n const remainder = num_frames % stride;\n if (remainder !== 0) {\n throw new Error(`The number of frames (${num_frames}) must be a multiple of the stride (${stride}).`)\n }\n\n const input_features = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor('float32',\n features.data,\n features.dims,\n ).view(\n 1,\n Math.floor(num_frames / stride),\n num_channels * stride,\n );\n\n const result = { input_features }\n\n if (return_attention_mask) {\n const reshapedNumFrames = input_features.dims[1];\n\n const attention_mask = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'int64',\n new BigInt64Array(reshapedNumFrames),\n [1, reshapedNumFrames],\n );\n if (padded_attention_mask) {\n for (let i = 1, j = 0; i < num_frames; i += stride, ++j) {\n attention_mask.data[j] = padded_attention_mask.data[i];\n }\n } else {\n attention_mask.data.fill(1n);\n }\n\n result.attention_mask = attention_mask;\n }\n\n return result;\n }\n}\n\nclass ASTFeatureExtractor extends FeatureExtractor {\n\n\n constructor(config) {\n super(config);\n\n const sampling_rate = this.config.sampling_rate;\n const mel_filters = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.mel_filter_bank)(\n 256, // num_frequency_bins\n this.config.num_mel_bins, // num_mel_filters\n 20, // min_frequency\n Math.floor(sampling_rate / 2), // max_frequency\n sampling_rate, // sampling_rate\n null, // norm\n \"kaldi\", // mel_scale\n true, // triangularize_in_mel_space\n );\n\n // Do padding:\n for (let i = 0; i < mel_filters.length; ++i) {\n mel_filters[i].push(0);\n }\n this.mel_filters = mel_filters;\n\n this.window = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.window_function)(400, 'hann', {\n periodic: false,\n })\n\n this.mean = this.config.mean;\n this.std = this.config.std;\n }\n\n /**\n * Computes the log-Mel spectrogram of the provided audio waveform.\n * @param {Float32Array|Float64Array} waveform The audio waveform to process.\n * @param {number} max_length The maximum number of frames to return.\n * @returns {{data: Float32Array, dims: number[]}} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n _extract_fbank_features(waveform, max_length) {\n // NOTE: We don't pad/truncate since that is passed in as `max_num_frames`\n return (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.spectrogram)(\n waveform,\n this.window, // window\n 400, // frame_length\n 160, // hop_length\n {\n fft_length: 512,\n power: 2.0,\n center: false,\n preemphasis: 0.97,\n mel_filters: this.mel_filters,\n log_mel: 'log',\n mel_floor: 1.192092955078125e-07,\n remove_dc_offset: true,\n\n // Custom\n max_num_frames: max_length,\n transpose: true,\n }\n )\n }\n\n\n /**\n * Asynchronously extracts features from a given audio using the provided configuration.\n * @param {Float32Array|Float64Array} audio The audio data as a Float32Array/Float64Array.\n * @returns {Promise<{ input_values: Tensor }>} A Promise resolving to an object containing the extracted input features as a Tensor.\n */\n async _call(audio) {\n validate_audio_inputs(audio, 'ASTFeatureExtractor');\n\n const features = this._extract_fbank_features(audio, this.config.max_length);\n if (this.config.do_normalize) {\n // Normalize the input audio spectrogram to have mean=0, std=0.5\n const denom = this.std * 2;\n for (let i = 0; i < features.data.length; ++i) {\n features.data[i] = (features.data[i] - this.mean) / denom;\n }\n }\n\n return {\n input_values: new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor('float32',\n features.data,\n [1, ...features.dims]\n )\n };\n }\n}\n\nclass ClapFeatureExtractor extends FeatureExtractor {\n\n constructor(config) {\n super(config);\n\n this.mel_filters = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.mel_filter_bank)(\n this.config.nb_frequency_bins, // num_frequency_bins\n this.config.feature_size, // num_mel_filters\n this.config.frequency_min, // min_frequency\n this.config.frequency_max, // max_frequency\n this.config.sampling_rate, // sampling_rate\n null, // norm\n \"htk\", // mel_scale\n );\n\n this.mel_filters_slaney = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.mel_filter_bank)(\n this.config.nb_frequency_bins, // num_frequency_bins\n this.config.feature_size, // num_mel_filters\n this.config.frequency_min, // min_frequency\n this.config.frequency_max, // max_frequency\n this.config.sampling_rate, // sampling_rate\n \"slaney\", // norm\n \"slaney\", // mel_scale\n );\n\n this.window = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.window_function)(this.config.fft_window_size, 'hann')\n\n }\n\n\n /**\n * Extracts the mel spectrogram and prepares it for the mode based on the `truncation` and `padding` arguments.\n * \n * Four different path are possible:\n * - `truncation=\"fusion\"` and the length of the waveform is greater than the max length: the mel spectrogram\n * will be computed on the entire audio. 3 random crops and a dowsampled version of the full mel spectrogram\n * are then stacked together. They will later be used for `feature_fusion`.\n * - `truncation=\"rand_trunc\"` and the length of the waveform is smaller than the max length: the audio is\n * padded based on `padding`.\n * - `truncation=\"fusion\"` and the length of the waveform is smaller than the max length: the audio is padded\n * based on `padding`, and is repeated `4` times.\n * - `truncation=\"rand_trunc\"` and the length of the waveform is greater than the max length: the mel\n * spectrogram will be computed on a random crop of the waveform.\n * \n * @param {Float32Array|Float64Array} waveform The input waveform.\n * @param {number} max_length The maximum length of the waveform.\n * @param {string} truncation The truncation strategy to use.\n * @param {string} padding The padding strategy to use.\n * @returns {{ data: Float32Array; dims: number[]; longer: boolean; }} An object containing the mel spectrogram data as a Float32Array, its dimensions as an array of numbers, and a boolean indicating whether the waveform was longer than the max length.\n */\n _get_input_mel(waveform, max_length, truncation, padding) {\n\n /** @type {{ data: Float32Array; dims: number[]}} */\n let input_mel;\n let longer = false;\n const diff = waveform.length - max_length;\n if (diff > 0) {\n if (truncation === 'rand_trunc') {\n longer = true;\n const idx = Math.floor(Math.random() * (diff + 1));\n waveform = waveform.subarray(idx, idx + max_length);\n\n input_mel = this._extract_fbank_features(waveform, this.mel_filters_slaney, this.config.nb_max_samples);\n input_mel.dims = [1, ...input_mel.dims]; // \"unsqueeze\"\n } else {\n // TODO implement fusion strategy\n throw new Error(`Truncation strategy \"${truncation}\" not implemented`)\n }\n } else {\n if (diff < 0) {\n let padded = new Float64Array(max_length); // already padded with zeros\n padded.set(waveform);\n\n if (padding === 'repeat') {\n for (let i = waveform.length; i < max_length; i += waveform.length) {\n padded.set(waveform.subarray(0, Math.min(waveform.length, max_length - i)), i);\n }\n } else if (padding === 'repeatpad') {\n for (let i = waveform.length; i < -diff; i += waveform.length) {\n padded.set(waveform, i);\n }\n }\n waveform = padded;\n }\n\n if (truncation === 'fusion') {\n throw new Error(`Truncation strategy \"${truncation}\" not implemented`)\n }\n\n input_mel = this._extract_fbank_features(waveform, this.mel_filters_slaney, this.config.nb_max_samples);\n input_mel.dims = [1, ...input_mel.dims]; // \"unsqueeze\"\n }\n\n return {\n ...input_mel,\n longer,\n }\n }\n\n /**\n * Compute the log-mel spectrogram of the provided `waveform` using the Hann window.\n * In CLAP, two different filter banks are used depending on the truncation pattern:\n * - `self.mel_filters`: they correspond to the default parameters of `torchaudio` which can be obtained from\n * calling `torchaudio.transforms.MelSpectrogram().mel_scale.fb`. These filters are used when `truncation`\n * is set to `\"fusion\"`.\n * - `self.mel_filteres_slaney` : they correspond to the default parameters of `librosa` which used\n * `librosa.filters.mel` when computing the mel spectrogram. These filters were only used in the original\n * implementation when the truncation mode is not `\"fusion\"`.\n * \n * @param {Float32Array|Float64Array} waveform The audio waveform to process.\n * @param {number[][]} mel_filters The mel filters to use.\n * @param {number} [max_length=null] The maximum number of frames to return.\n * @returns {{data: Float32Array, dims: number[]}} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n _extract_fbank_features(waveform, mel_filters, max_length = null) {\n // NOTE: We don't pad/truncate since that is passed in as `max_num_frames`\n return (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.spectrogram)(\n waveform,\n this.window, // window\n this.config.fft_window_size, // frame_length\n this.config.hop_length, // hop_length\n {\n power: 2.0,\n mel_filters,\n log_mel: 'dB',\n\n // Custom\n max_num_frames: max_length,\n do_pad: false,\n transpose: true,\n }\n )\n }\n\n\n /**\n * Asynchronously extracts features from a given audio using the provided configuration.\n * @param {Float32Array|Float64Array} audio The audio data as a Float32Array/Float64Array.\n * @returns {Promise<{ input_features: Tensor }>} A Promise resolving to an object containing the extracted input features as a Tensor.\n */\n async _call(audio, {\n max_length = null,\n } = {}) {\n validate_audio_inputs(audio, 'ClapFeatureExtractor');\n\n // convert to mel spectrogram, truncate and pad if needed.\n const padded_inputs = this._get_input_mel(\n audio,\n max_length ?? this.config.nb_max_samples,\n this.config.truncation,\n this.config.padding,\n );\n\n\n return {\n input_features: new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor('float32',\n padded_inputs.data,\n [1, ...padded_inputs.dims]\n )\n };\n }\n}\n\n\n\nclass SpeechT5FeatureExtractor extends FeatureExtractor { }\n\n/**\n * Represents a Processor that extracts features from an input.\n * @extends Callable\n */\nclass Processor extends _utils_core_js__WEBPACK_IMPORTED_MODULE_0__.Callable {\n /**\n * Creates a new Processor with the given feature extractor.\n * @param {FeatureExtractor} feature_extractor The function used to extract features from the input.\n */\n constructor(feature_extractor) {\n super();\n this.feature_extractor = feature_extractor;\n // TODO use tokenizer here?\n }\n\n /**\n * Calls the feature_extractor function with the given input.\n * @param {any} input The input to extract features from.\n * @param {...any} args Additional arguments.\n * @returns {Promise} A Promise that resolves with the extracted features.\n */\n async _call(input, ...args) {\n return await this.feature_extractor(input, ...args);\n }\n}\n\nclass SamProcessor extends Processor {\n /**\n * @borrows SamImageProcessor#_call as _call\n */\n async _call(...args) {\n return await this.feature_extractor(...args);\n }\n\n /**\n * @borrows SamImageProcessor#post_process_masks as post_process_masks\n */\n post_process_masks(...args) {\n // @ts-ignore\n return this.feature_extractor.post_process_masks(...args);\n }\n /**\n * @borrows SamImageProcessor#reshape_input_points as reshape_input_points\n */\n reshape_input_points(...args) {\n // @ts-ignore\n return this.feature_extractor.reshape_input_points(...args);\n }\n}\n\n/**\n * Represents a WhisperProcessor that extracts features from an audio input.\n * @extends Processor\n */\nclass WhisperProcessor extends Processor {\n /**\n * Calls the feature_extractor function with the given audio input.\n * @param {any} audio The audio input to extract features from.\n * @returns {Promise} A Promise that resolves with the extracted features.\n */\n async _call(audio) {\n return await this.feature_extractor(audio)\n }\n}\n\n\nclass Wav2Vec2ProcessorWithLM extends Processor {\n /**\n * Calls the feature_extractor function with the given audio input.\n * @param {any} audio The audio input to extract features from.\n * @returns {Promise} A Promise that resolves with the extracted features.\n */\n async _call(audio) {\n return await this.feature_extractor(audio)\n }\n}\n\nclass SpeechT5Processor extends Processor {\n /**\n * Calls the feature_extractor function with the given input.\n * @param {any} input The input to extract features from.\n * @returns {Promise} A Promise that resolves with the extracted features.\n */\n async _call(input) {\n return await this.feature_extractor(input)\n }\n}\n\nclass OwlViTProcessor extends Processor { }\n\n\n//////////////////////////////////////////////////\n/**\n * Helper class which is used to instantiate pretrained processors with the `from_pretrained` function.\n * The chosen processor class is determined by the type specified in the processor config.\n * \n * **Example:** Load a processor using `from_pretrained`.\n * ```javascript\n * let processor = await AutoProcessor.from_pretrained('openai/whisper-tiny.en');\n * ```\n * \n * **Example:** Run an image through a processor.\n * ```javascript\n * let processor = await AutoProcessor.from_pretrained('Xenova/clip-vit-base-patch16');\n * let image = await RawImage.read('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');\n * let image_inputs = await processor(image);\n * // {\n * // \"pixel_values\": {\n * // \"dims\": [ 1, 3, 224, 224 ],\n * // \"type\": \"float32\",\n * // \"data\": Float32Array [ -1.558687686920166, -1.558687686920166, -1.5440893173217773, ... ],\n * // \"size\": 150528\n * // },\n * // \"original_sizes\": [\n * // [ 533, 800 ]\n * // ],\n * // \"reshaped_input_sizes\": [\n * // [ 224, 224 ]\n * // ]\n * // }\n * ```\n */\nclass AutoProcessor {\n static FEATURE_EXTRACTOR_CLASS_MAPPING = {\n ImageFeatureExtractor,\n WhisperFeatureExtractor,\n ViTFeatureExtractor,\n MobileViTFeatureExtractor,\n OwlViTFeatureExtractor,\n Owlv2ImageProcessor,\n CLIPFeatureExtractor,\n ChineseCLIPFeatureExtractor,\n SiglipImageProcessor,\n ConvNextFeatureExtractor,\n ConvNextImageProcessor,\n SegformerFeatureExtractor,\n BitImageProcessor,\n DPTImageProcessor,\n DPTFeatureExtractor,\n GLPNFeatureExtractor,\n BeitFeatureExtractor,\n DeiTFeatureExtractor,\n DetrFeatureExtractor,\n YolosFeatureExtractor,\n DonutFeatureExtractor,\n NougatImageProcessor,\n\n ViTImageProcessor,\n VitMatteImageProcessor,\n SamImageProcessor,\n Swin2SRImageProcessor,\n Wav2Vec2FeatureExtractor,\n SeamlessM4TFeatureExtractor,\n SpeechT5FeatureExtractor,\n ASTFeatureExtractor,\n ClapFeatureExtractor,\n }\n\n static PROCESSOR_CLASS_MAPPING = {\n WhisperProcessor,\n Wav2Vec2ProcessorWithLM,\n SamProcessor,\n SpeechT5Processor,\n OwlViTProcessor,\n }\n\n /**\n * Instantiate one of the processor classes of the library from a pretrained model.\n * \n * The processor class to instantiate is selected based on the `feature_extractor_type` property of the config object\n * (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible)\n * \n * @param {string} pretrained_model_name_or_path The name or path of the pretrained model. Can be either:\n * - A string, the *model id* of a pretrained processor hosted inside a model repo on huggingface.co.\n * Valid model ids can be located at the root-level, like `bert-base-uncased`, or namespaced under a\n * user or organization name, like `dbmdz/bert-base-german-cased`.\n * - A path to a *directory* containing processor files, e.g., `./my_model_directory/`.\n * @param {import('./utils/hub.js').PretrainedOptions} options Additional options for loading the processor.\n * \n * @returns {Promise} A new instance of the Processor class.\n */\n static async from_pretrained(pretrained_model_name_or_path, {\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n } = {}) {\n\n let preprocessorConfig = config ?? await (0,_utils_hub_js__WEBPACK_IMPORTED_MODULE_1__.getModelJSON)(pretrained_model_name_or_path, 'preprocessor_config.json', true, {\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n })\n\n // Determine feature extractor class\n // TODO: Ensure backwards compatibility with old configs\n let key = preprocessorConfig.feature_extractor_type ?? preprocessorConfig.image_processor_type;\n let feature_extractor_class = this.FEATURE_EXTRACTOR_CLASS_MAPPING[key];\n\n if (!feature_extractor_class) {\n if (preprocessorConfig.size !== undefined) {\n // Assume ImageFeatureExtractor\n console.warn(`Feature extractor type \"${key}\" not found, assuming ImageFeatureExtractor due to size parameter in config.`);\n feature_extractor_class = ImageFeatureExtractor;\n } else {\n throw new Error(`Unknown Feature Extractor type: ${key}`);\n }\n }\n\n // If no associated processor class, use default\n let processor_class = this.PROCESSOR_CLASS_MAPPING[preprocessorConfig.processor_class] ?? Processor;\n\n // Instantiate processor and feature extractor\n let feature_extractor = new feature_extractor_class(preprocessorConfig);\n return new processor_class(feature_extractor);\n }\n}\n//////////////////////////////////////////////////\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/processors.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ASTFeatureExtractor: () => (/* binding */ ASTFeatureExtractor),\n/* harmony export */ AutoProcessor: () => (/* binding */ AutoProcessor),\n/* harmony export */ BeitFeatureExtractor: () => (/* binding */ BeitFeatureExtractor),\n/* harmony export */ BitImageProcessor: () => (/* binding */ BitImageProcessor),\n/* harmony export */ CLIPFeatureExtractor: () => (/* binding */ CLIPFeatureExtractor),\n/* harmony export */ ChineseCLIPFeatureExtractor: () => (/* binding */ ChineseCLIPFeatureExtractor),\n/* harmony export */ ClapFeatureExtractor: () => (/* binding */ ClapFeatureExtractor),\n/* harmony export */ ConvNextFeatureExtractor: () => (/* binding */ ConvNextFeatureExtractor),\n/* harmony export */ ConvNextImageProcessor: () => (/* binding */ ConvNextImageProcessor),\n/* harmony export */ DPTFeatureExtractor: () => (/* binding */ DPTFeatureExtractor),\n/* harmony export */ DPTImageProcessor: () => (/* binding */ DPTImageProcessor),\n/* harmony export */ DeiTFeatureExtractor: () => (/* binding */ DeiTFeatureExtractor),\n/* harmony export */ DetrFeatureExtractor: () => (/* binding */ DetrFeatureExtractor),\n/* harmony export */ DonutFeatureExtractor: () => (/* binding */ DonutFeatureExtractor),\n/* harmony export */ EfficientNetImageProcessor: () => (/* binding */ EfficientNetImageProcessor),\n/* harmony export */ FeatureExtractor: () => (/* binding */ FeatureExtractor),\n/* harmony export */ GLPNFeatureExtractor: () => (/* binding */ GLPNFeatureExtractor),\n/* harmony export */ ImageFeatureExtractor: () => (/* binding */ ImageFeatureExtractor),\n/* harmony export */ MobileViTFeatureExtractor: () => (/* binding */ MobileViTFeatureExtractor),\n/* harmony export */ NougatImageProcessor: () => (/* binding */ NougatImageProcessor),\n/* harmony export */ OwlViTFeatureExtractor: () => (/* binding */ OwlViTFeatureExtractor),\n/* harmony export */ OwlViTProcessor: () => (/* binding */ OwlViTProcessor),\n/* harmony export */ Owlv2ImageProcessor: () => (/* binding */ Owlv2ImageProcessor),\n/* harmony export */ Processor: () => (/* binding */ Processor),\n/* harmony export */ SamImageProcessor: () => (/* binding */ SamImageProcessor),\n/* harmony export */ SamProcessor: () => (/* binding */ SamProcessor),\n/* harmony export */ SeamlessM4TFeatureExtractor: () => (/* binding */ SeamlessM4TFeatureExtractor),\n/* harmony export */ SegformerFeatureExtractor: () => (/* binding */ SegformerFeatureExtractor),\n/* harmony export */ SiglipImageProcessor: () => (/* binding */ SiglipImageProcessor),\n/* harmony export */ SpeechT5FeatureExtractor: () => (/* binding */ SpeechT5FeatureExtractor),\n/* harmony export */ SpeechT5Processor: () => (/* binding */ SpeechT5Processor),\n/* harmony export */ Swin2SRImageProcessor: () => (/* binding */ Swin2SRImageProcessor),\n/* harmony export */ ViTFeatureExtractor: () => (/* binding */ ViTFeatureExtractor),\n/* harmony export */ ViTImageProcessor: () => (/* binding */ ViTImageProcessor),\n/* harmony export */ VitMatteImageProcessor: () => (/* binding */ VitMatteImageProcessor),\n/* harmony export */ Wav2Vec2FeatureExtractor: () => (/* binding */ Wav2Vec2FeatureExtractor),\n/* harmony export */ Wav2Vec2ProcessorWithLM: () => (/* binding */ Wav2Vec2ProcessorWithLM),\n/* harmony export */ WhisperFeatureExtractor: () => (/* binding */ WhisperFeatureExtractor),\n/* harmony export */ WhisperProcessor: () => (/* binding */ WhisperProcessor),\n/* harmony export */ YolosFeatureExtractor: () => (/* binding */ YolosFeatureExtractor)\n/* harmony export */ });\n/* harmony import */ var _utils_core_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/core.js */ \"./node_modules/@xenova/transformers/src/utils/core.js\");\n/* harmony import */ var _utils_hub_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/hub.js */ \"./node_modules/@xenova/transformers/src/utils/hub.js\");\n/* harmony import */ var _utils_maths_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/maths.js */ \"./node_modules/@xenova/transformers/src/utils/maths.js\");\n/* harmony import */ var _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/tensor.js */ \"./node_modules/@xenova/transformers/src/utils/tensor.js\");\n/* harmony import */ var _utils_image_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/image.js */ \"./node_modules/@xenova/transformers/src/utils/image.js\");\n/* harmony import */ var _utils_audio_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/audio.js */ \"./node_modules/@xenova/transformers/src/utils/audio.js\");\n\n/**\n * @file Processors are used to prepare non-textual inputs (e.g., image or audio) for a model.\n * \n * **Example:** Using a `WhisperProcessor` to prepare an audio input for a model.\n * ```javascript\n * import { AutoProcessor, read_audio } from '@xenova/transformers';\n *\n * let processor = await AutoProcessor.from_pretrained('openai/whisper-tiny.en');\n * let audio = await read_audio('https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac', 16000);\n * let { input_features } = await processor(audio);\n * // Tensor {\n * // data: Float32Array(240000) [0.4752984642982483, 0.5597258806228638, 0.56434166431427, ...],\n * // dims: [1, 80, 3000],\n * // type: 'float32',\n * // size: 240000,\n * // }\n * ```\n * \n * @module processors\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n// Helper functions\n\n/**\n * Converts bounding boxes from center format to corners format.\n * \n * @param {number[]} arr The coordinate for the center of the box and its width, height dimensions (center_x, center_y, width, height)\n * @returns {number[]} The coodinates for the top-left and bottom-right corners of the box (top_left_x, top_left_y, bottom_right_x, bottom_right_y)\n */\nfunction center_to_corners_format([centerX, centerY, width, height]) {\n return [\n centerX - width / 2,\n centerY - height / 2,\n centerX + width / 2,\n centerY + height / 2\n ];\n}\n\n/**\n * Post-processes the outputs of the model (for object detection).\n * @param {Object} outputs The outputs of the model that must be post-processed\n * @param {Tensor} outputs.logits The logits\n * @param {Tensor} outputs.pred_boxes The predicted boxes.\n * @param {number} [threshold=0.5] The threshold to use for the scores.\n * @param {number[][]} [target_sizes=null] The sizes of the original images.\n * @param {boolean} [is_zero_shot=false] Whether zero-shot object detection was performed.\n * @return {Object[]} An array of objects containing the post-processed outputs.\n * @private\n */\nfunction post_process_object_detection(outputs, threshold = 0.5, target_sizes = null, is_zero_shot = false) {\n const out_logits = outputs.logits;\n const out_bbox = outputs.pred_boxes;\n const [batch_size, num_boxes, num_classes] = out_logits.dims;\n\n if (target_sizes !== null && target_sizes.length !== batch_size) {\n throw Error(\"Make sure that you pass in as many target sizes as the batch dimension of the logits\")\n }\n let toReturn = [];\n for (let i = 0; i < batch_size; ++i) {\n let target_size = target_sizes !== null ? target_sizes[i] : null;\n let info = {\n boxes: [],\n classes: [],\n scores: []\n }\n let logits = out_logits[i];\n let bbox = out_bbox[i];\n\n for (let j = 0; j < num_boxes; ++j) {\n let logit = logits[j];\n\n let indices = [];\n let probs;\n if (is_zero_shot) {\n // Get indices of classes with high enough probability\n probs = logit.sigmoid().data;\n for (let k = 0; k < probs.length; ++k) {\n if (probs[k] > threshold) {\n indices.push(k);\n }\n }\n\n } else {\n // Get most probable class\n let maxIndex = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.max)(logit.data)[1];\n\n if (maxIndex === num_classes - 1) {\n // This is the background class, skip it\n continue;\n }\n indices.push(maxIndex);\n\n // Compute softmax over classes\n probs = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.softmax)(logit.data);\n }\n\n for (const index of indices) {\n\n // Some class has a high enough probability\n /** @type {number[]} */\n let box = bbox[j].data;\n\n // convert to [x0, y0, x1, y1] format\n box = center_to_corners_format(box)\n if (target_size !== null) {\n box = box.map((x, i) => x * target_size[(i + 1) % 2])\n }\n\n info.boxes.push(box);\n info.classes.push(index);\n info.scores.push(probs[index]);\n }\n }\n toReturn.push(info);\n }\n return toReturn;\n}\n\n/**\n * Named tuple to indicate the order we are using is (height x width), even though\n * the Graphics’ industry standard is (width x height).\n * @typedef {[height: number, width: number]} HeightWidth\n */\n\n/**\n * Helper function to validate audio inputs.\n * @param {any} audio The audio data.\n * @param {string} feature_extractor The name of the feature extractor.\n * @private\n */\nfunction validate_audio_inputs(audio, feature_extractor) {\n if (!(audio instanceof Float32Array || audio instanceof Float64Array)) {\n throw new Error(\n `${feature_extractor} expects input to be a Float32Array or a Float64Array, but got ${audio?.constructor?.name ?? typeof audio} instead. ` +\n `If using the feature extractor directly, remember to use \\`read_audio(url, sampling_rate)\\` to obtain the raw audio data of the file/url.`\n )\n }\n}\n\n/**\n * Helper function to constrain a value to be a multiple of a number.\n * @param {number} val The value to constrain.\n * @param {number} multiple The number to constrain to.\n * @param {number} [minVal=0] The minimum value to constrain to.\n * @param {number} [maxVal=null] The maximum value to constrain to.\n * @returns {number} The constrained value.\n * @private\n */\nfunction constraint_to_multiple_of(val, multiple, minVal = 0, maxVal = null) {\n const a = val / multiple;\n let x = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.bankers_round)(a) * multiple;\n\n if (maxVal !== null && x > maxVal) {\n x = Math.floor(a) * multiple;\n }\n\n if (x < minVal) {\n x = Math.ceil(a) * multiple;\n }\n\n return x;\n}\n\n/**\n * Rounds the height and width down to the closest multiple of size_divisibility\n * @param {[number, number]} size The size of the image\n * @param {number} divisor The divisor to use.\n * @returns {[number, number]} The rounded size.\n */\nfunction enforce_size_divisibility([width, height], divisor) {\n return [\n Math.max(Math.floor(width / divisor), 1) * divisor,\n Math.max(Math.floor(height / divisor), 1) * divisor\n ];\n}\n\n\n/**\n * Base class for feature extractors.\n *\n * @extends Callable\n */\nclass FeatureExtractor extends _utils_core_js__WEBPACK_IMPORTED_MODULE_0__.Callable {\n /**\n * Constructs a new FeatureExtractor instance.\n *\n * @param {Object} config The configuration for the feature extractor.\n */\n constructor(config) {\n super();\n this.config = config\n }\n}\n\n/**\n * @typedef {object} ImageFeatureExtractorResult\n * @property {Tensor} pixel_values The pixel values of the batched preprocessed images.\n * @property {HeightWidth[]} original_sizes Array of two-dimensional tuples like [[480, 640]].\n * @property {HeightWidth[]} reshaped_input_sizes Array of two-dimensional tuples like [[1000, 1330]].\n */\n\n/**\n * Feature extractor for image models.\n *\n * @extends FeatureExtractor\n */\nclass ImageFeatureExtractor extends FeatureExtractor {\n\n /**\n * Constructs a new ImageFeatureExtractor instance.\n *\n * @param {Object} config The configuration for the feature extractor.\n * @param {number[]} config.image_mean The mean values for image normalization.\n * @param {number[]} config.image_std The standard deviation values for image normalization.\n * @param {boolean} config.do_rescale Whether to rescale the image pixel values to the [0,1] range.\n * @param {number} config.rescale_factor The factor to use for rescaling the image pixel values.\n * @param {boolean} config.do_normalize Whether to normalize the image pixel values.\n * @param {boolean} config.do_resize Whether to resize the image.\n * @param {number} config.resample What method to use for resampling.\n * @param {number|Object} config.size The size to resize the image to.\n */\n constructor(config) {\n super(config);\n\n this.image_mean = this.config.image_mean ?? this.config.mean;\n this.image_std = this.config.image_std ?? this.config.std;\n\n this.resample = this.config.resample ?? 2; // 2 => bilinear\n this.do_rescale = this.config.do_rescale ?? true;\n this.rescale_factor = this.config.rescale_factor ?? (1 / 255);\n this.do_normalize = this.config.do_normalize;\n\n this.do_resize = this.config.do_resize;\n this.do_thumbnail = this.config.do_thumbnail;\n this.size = this.config.size;\n this.size_divisibility = this.config.size_divisibility ?? this.config.size_divisor;\n\n this.do_center_crop = this.config.do_center_crop;\n this.crop_size = this.config.crop_size;\n this.do_convert_rgb = this.config.do_convert_rgb ?? true;\n this.do_crop_margin = this.config.do_crop_margin;\n\n this.pad_size = this.config.pad_size;\n this.do_pad = this.config.do_pad;\n\n if (this.do_pad && !this.pad_size && this.size && this.size.width !== undefined && this.size.height !== undefined) {\n // Should pad, but no pad size specified\n // We infer the pad size from the resize size\n this.pad_size = this.size\n }\n }\n\n /**\n * Resize the image to make a thumbnail. The image is resized so that no dimension is larger than any\n * corresponding dimension of the specified size.\n * @param {RawImage} image The image to be resized.\n * @param {{height:number, width:number}} size The size `{\"height\": h, \"width\": w}` to resize the image to.\n * @param {string | 0 | 1 | 2 | 3 | 4 | 5} [resample=2] The resampling filter to use.\n * @returns {Promise} The resized image.\n */\n async thumbnail(image, size, resample = 2) {\n const input_height = image.height;\n const input_width = image.width;\n\n const output_height = size.height;\n const output_width = size.width;\n\n // We always resize to the smallest of either the input or output size.\n let height = Math.min(input_height, output_height)\n let width = Math.min(input_width, output_width)\n\n if (height === input_height && width === input_width) {\n return image;\n }\n if (input_height > input_width) {\n width = Math.floor(input_width * height / input_height);\n } else if (input_width > input_height) {\n height = Math.floor(input_height * width / input_width);\n }\n return await image.resize(width, height, { resample });\n }\n\n\n /**\n * Crops the margin of the image. Gray pixels are considered margin (i.e., pixels with a value below the threshold).\n * @param {RawImage} image The image to be cropped.\n * @param {number} gray_threshold Value below which pixels are considered to be gray.\n * @returns {Promise} The cropped image.\n */\n async crop_margin(image, gray_threshold = 200) {\n\n const gray_image = image.clone().grayscale();\n\n const minValue = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.min)(gray_image.data)[0];\n const maxValue = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.max)(gray_image.data)[0];\n const diff = maxValue - minValue;\n\n if (diff === 0) {\n return image;\n }\n\n const threshold = gray_threshold / 255;\n\n let x_min = gray_image.width, y_min = gray_image.height, x_max = 0, y_max = 0;\n for (let j = 0; j < gray_image.height; ++j) {\n const row = j * gray_image.width;\n for (let i = 0; i < gray_image.width; ++i) {\n if ((gray_image.data[row + i] - minValue) / diff < threshold) {\n // We have a non-zero pixel, so we update the min/max values accordingly\n x_min = Math.min(x_min, i);\n y_min = Math.min(y_min, j);\n x_max = Math.max(x_max, i);\n y_max = Math.max(y_max, j);\n }\n }\n }\n\n image = await image.crop([x_min, y_min, x_max, y_max]);\n return image;\n }\n\n /**\n * Pad the image by a certain amount.\n * @param {Float32Array} pixelData The pixel data to pad.\n * @param {number[]} imgDims The dimensions of the image (height, width, channels).\n * @param {{width:number; height:number}|number} padSize The dimensions of the padded image.\n * @param {Object} options The options for padding.\n * @param {'constant'|'symmetric'} [options.mode='constant'] The type of padding to add.\n * @param {boolean} [options.center=false] Whether to center the image.\n * @param {number} [options.constant_values=0] The constant value to use for padding.\n * @returns {[Float32Array, number[]]} The padded pixel data and image dimensions.\n */\n pad_image(pixelData, imgDims, padSize, {\n mode = 'constant',\n center = false,\n constant_values = 0,\n } = {}) {\n const [imageHeight, imageWidth, imageChannels] = imgDims;\n\n let paddedImageWidth, paddedImageHeight;\n if (typeof padSize === 'number') {\n paddedImageWidth = padSize;\n paddedImageHeight = padSize;\n } else {\n paddedImageWidth = padSize.width;\n paddedImageHeight = padSize.height;\n }\n\n // Only add padding if there is a difference in size\n if (paddedImageWidth !== imageWidth || paddedImageHeight !== imageHeight) {\n const paddedPixelData = new Float32Array(paddedImageWidth * paddedImageHeight * imageChannels);\n if (Array.isArray(constant_values)) {\n // Fill with constant values, cycling through the array\n for (let i = 0; i < paddedPixelData.length; ++i) {\n paddedPixelData[i] = constant_values[i % imageChannels];\n }\n } else if (constant_values !== 0) {\n paddedPixelData.fill(constant_values);\n }\n\n const [left, top] = center\n ? [Math.floor((paddedImageWidth - imageWidth) / 2), Math.floor((paddedImageHeight - imageHeight) / 2)]\n : [0, 0];\n\n // Copy the original image into the padded image\n for (let i = 0; i < imageHeight; ++i) {\n const a = (i + top) * paddedImageWidth;\n const b = i * imageWidth;\n for (let j = 0; j < imageWidth; ++j) {\n const c = (a + j + left) * imageChannels;\n const d = (b + j) * imageChannels;\n for (let k = 0; k < imageChannels; ++k) {\n paddedPixelData[c + k] = pixelData[d + k];\n }\n }\n }\n\n if (mode === 'symmetric') {\n if (center) {\n throw new Error('`center` padding is not supported when `mode` is set to `symmetric`.');\n // TODO: Implement this\n }\n const h1 = imageHeight - 1;\n const w1 = imageWidth - 1;\n for (let i = 0; i < paddedImageHeight; ++i) {\n const a = i * paddedImageWidth;\n const b = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.calculateReflectOffset)(i, h1) * imageWidth;\n\n for (let j = 0; j < paddedImageWidth; ++j) {\n if (i < imageHeight && j < imageWidth) continue; // Do not overwrite original image\n const c = (a + j) * imageChannels;\n const d = (b + (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.calculateReflectOffset)(j, w1)) * imageChannels;\n\n // Copy channel-wise\n for (let k = 0; k < imageChannels; ++k) {\n paddedPixelData[c + k] = pixelData[d + k];\n }\n }\n }\n }\n\n\n // Update pixel data and image dimensions\n pixelData = paddedPixelData;\n imgDims = [paddedImageHeight, paddedImageWidth, imageChannels]\n }\n return [pixelData, imgDims];\n }\n\n /**\n * Rescale the image' pixel values by `this.rescale_factor`.\n * @param {Float32Array} pixelData The pixel data to rescale.\n * @returns {void}\n */\n rescale(pixelData) {\n for (let i = 0; i < pixelData.length; ++i) {\n pixelData[i] = this.rescale_factor * pixelData[i];\n }\n }\n\n /**\n * Find the target (width, height) dimension of the output image after\n * resizing given the input image and the desired size.\n * @param {RawImage} image The image to resize.\n * @param {any} size The size to use for resizing the image. \n * @returns {[number, number]} The target (width, height) dimension of the output image after resizing.\n */\n get_resize_output_image_size(image, size) {\n // `size` comes in many forms, so we need to handle them all here:\n // 1. `size` is an integer, in which case we resize the image to be a square \n\n const [srcWidth, srcHeight] = image.size;\n\n let shortest_edge;\n let longest_edge;\n\n if (this.do_thumbnail) {\n // NOTE: custom logic for `Donut` models\n const { height, width } = size;\n shortest_edge = Math.min(height, width)\n }\n // Support both formats for backwards compatibility\n else if (Number.isInteger(size)) {\n shortest_edge = size;\n longest_edge = this.config.max_size ?? shortest_edge;\n\n } else if (size !== undefined) {\n // Extract known properties from `size`\n shortest_edge = size.shortest_edge;\n longest_edge = size.longest_edge;\n }\n\n // If `longest_edge` and `shortest_edge` are set, maintain aspect ratio and resize to `shortest_edge`\n // while keeping the largest dimension <= `longest_edge`\n if (shortest_edge !== undefined || longest_edge !== undefined) {\n // http://opensourcehacker.com/2011/12/01/calculate-aspect-ratio-conserving-resize-for-images-in-javascript/\n // Try resize so that shortest edge is `shortest_edge` (target)\n const shortResizeFactor = shortest_edge === undefined\n ? 1 // If `shortest_edge` is not set, don't upscale\n : Math.max(shortest_edge / srcWidth, shortest_edge / srcHeight);\n\n const newWidth = srcWidth * shortResizeFactor;\n const newHeight = srcHeight * shortResizeFactor;\n\n // The new width and height might be greater than `longest_edge`, so\n // we downscale again to ensure the largest dimension is `longest_edge` \n const longResizeFactor = longest_edge === undefined\n ? 1 // If `longest_edge` is not set, don't downscale\n : Math.min(longest_edge / newWidth, longest_edge / newHeight);\n\n // To avoid certain floating point precision issues, we round to 2 decimal places\n let finalWidth = Math.floor(Number((newWidth * longResizeFactor).toFixed(2)));\n let finalHeight = Math.floor(Number((newHeight * longResizeFactor).toFixed(2)));\n\n if (this.size_divisibility !== undefined) {\n [finalWidth, finalHeight] = enforce_size_divisibility([finalWidth, finalHeight], this.size_divisibility)\n }\n return [finalWidth, finalHeight];\n\n } else if (size !== undefined && size.width !== undefined && size.height !== undefined) {\n // If `width` and `height` are set, resize to those dimensions\n\n let newWidth = size.width;\n let newHeight = size.height;\n\n // Custom for DPT models\n if (this.config.keep_aspect_ratio && this.config.ensure_multiple_of) {\n\n // determine new height and width\n let scale_height = newHeight / srcHeight;\n let scale_width = newWidth / srcWidth;\n\n // scale as little as possible\n if (Math.abs(1 - scale_width) < Math.abs(1 - scale_height)) {\n // fit width\n scale_height = scale_width;\n } else {\n // fit height\n scale_width = scale_height;\n }\n\n newHeight = constraint_to_multiple_of(scale_height * srcHeight, this.config.ensure_multiple_of);\n newWidth = constraint_to_multiple_of(scale_width * srcWidth, this.config.ensure_multiple_of);\n }\n\n return [newWidth, newHeight];\n\n } else if (this.size_divisibility !== undefined) {\n return enforce_size_divisibility([srcWidth, srcHeight], this.size_divisibility);\n } else {\n throw new Error(`Could not resize image due to unsupported \\`this.size\\` option in config: ${JSON.stringify(size)}`);\n }\n }\n\n /**\n * Resizes the image.\n * @param {RawImage} image The image to resize.\n * @returns {Promise} The resized image.\n */\n async resize(image) {\n const [newWidth, newHeight] = this.get_resize_output_image_size(image, this.size);\n return await image.resize(newWidth, newHeight, {\n resample: this.resample,\n });\n }\n\n /**\n * @typedef {object} PreprocessedImage\n * @property {HeightWidth} original_size The original size of the image.\n * @property {HeightWidth} reshaped_input_size The reshaped input size of the image.\n * @property {Tensor} pixel_values The pixel values of the preprocessed image.\n */\n\n /**\n * Preprocesses the given image.\n *\n * @param {RawImage} image The image to preprocess.\n * @param {Object} overrides The overrides for the preprocessing options.\n * @returns {Promise} The preprocessed image.\n */\n async preprocess(image, {\n do_normalize = null,\n do_pad = null,\n do_convert_rgb = null,\n do_convert_grayscale = null,\n } = {}) {\n if (this.do_crop_margin) {\n // NOTE: Specific to nougat processors. This is done before resizing,\n // and can be interpreted as a pre-preprocessing step.\n image = await this.crop_margin(image);\n }\n\n const [srcWidth, srcHeight] = image.size; // original image size\n\n // Convert image to RGB if specified in config.\n if (do_convert_rgb ?? this.do_convert_rgb) {\n image = image.rgb();\n } else if (do_convert_grayscale) {\n image = image.grayscale();\n }\n\n // TODO:\n // For efficiency reasons, it might be best to merge the resize and center crop operations into one.\n\n // Resize all images\n if (this.do_resize) {\n image = await this.resize(image);\n }\n\n // Resize the image using thumbnail method.\n if (this.do_thumbnail) {\n image = await this.thumbnail(image, this.size, this.resample);\n }\n\n if (this.do_center_crop) {\n\n let crop_width;\n let crop_height;\n if (Number.isInteger(this.crop_size)) {\n crop_width = this.crop_size;\n crop_height = this.crop_size;\n } else {\n crop_width = this.crop_size.width;\n crop_height = this.crop_size.height;\n }\n\n image = await image.center_crop(crop_width, crop_height);\n }\n\n /** @type {HeightWidth} */\n const reshaped_input_size = [image.height, image.width];\n\n // NOTE: All pixel-level manipulation (i.e., modifying `pixelData`)\n // occurs with data in the hwc format (height, width, channels), \n // to emulate the behavior of the original Python code (w/ numpy).\n let pixelData = Float32Array.from(image.data);\n let imgDims = [image.height, image.width, image.channels];\n\n if (this.do_rescale) {\n this.rescale(pixelData);\n }\n\n if (do_normalize ?? this.do_normalize) {\n let image_mean = this.image_mean;\n if (!Array.isArray(this.image_mean)) {\n image_mean = new Array(image.channels).fill(image_mean);\n }\n\n let image_std = this.image_std;\n if (!Array.isArray(this.image_std)) {\n image_std = new Array(image.channels).fill(image_mean);\n }\n\n if (image_mean.length !== image.channels || image_std.length !== image.channels) {\n throw new Error(`When set to arrays, the length of \\`image_mean\\` (${image_mean.length}) and \\`image_std\\` (${image_std.length}) must match the number of channels in the image (${image.channels}).`);\n }\n\n for (let i = 0; i < pixelData.length; i += image.channels) {\n for (let j = 0; j < image.channels; ++j) {\n pixelData[i + j] = (pixelData[i + j] - image_mean[j]) / image_std[j];\n }\n }\n }\n\n // do padding after rescaling/normalizing\n if (do_pad ?? this.do_pad) {\n if (this.pad_size) {\n const padded = this.pad_image(pixelData, [image.height, image.width, image.channels], this.pad_size);\n [pixelData, imgDims] = padded; // Update pixel data and image dimensions\n } else if (this.size_divisibility) {\n const [paddedWidth, paddedHeight] = enforce_size_divisibility([imgDims[1], imgDims[0]], this.size_divisibility);\n [pixelData, imgDims] = this.pad_image(pixelData, imgDims, { width: paddedWidth, height: paddedHeight });\n }\n }\n\n const pixel_values = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor('float32', pixelData, imgDims)\n .permute(2, 0, 1); // convert to channel dimension format (hwc -> chw)\n\n return {\n original_size: [srcHeight, srcWidth],\n reshaped_input_size: reshaped_input_size,\n pixel_values: pixel_values,\n }\n }\n\n /**\n * Calls the feature extraction process on an array of images,\n * preprocesses each image, and concatenates the resulting\n * features into a single Tensor.\n * @param {RawImage[]} images The image(s) to extract features from.\n * @param {...any} args Additional arguments.\n * @returns {Promise} An object containing the concatenated pixel values (and other metadata) of the preprocessed images.\n */\n async _call(images, ...args) {\n if (!Array.isArray(images)) {\n images = [images];\n }\n /** @type {PreprocessedImage[]} */\n const imageData = await Promise.all(images.map(x => this.preprocess(x)));\n\n // Stack pixel values\n const pixel_values = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.stack)(imageData.map(x => x.pixel_values), 0);\n\n return {\n pixel_values: pixel_values,\n\n // Original sizes of images\n original_sizes: imageData.map(x => x.original_size),\n\n // Reshaped sizes of images, before padding or cropping\n reshaped_input_sizes: imageData.map(x => x.reshaped_input_size),\n }\n }\n\n}\n\nclass SegformerFeatureExtractor extends ImageFeatureExtractor {\n\n /**\n * Converts the output of `SegformerForSemanticSegmentation` into semantic segmentation maps.\n * @param {*} outputs Raw outputs of the model.\n * @param {number[][]} [target_sizes=null] List of tuples corresponding to the requested final size\n * (height, width) of each prediction. If unset, predictions will not be resized.\n * @returns {{segmentation: Tensor; labels: number[]}[]} The semantic segmentation maps.\n */\n post_process_semantic_segmentation(outputs, target_sizes = null) {\n\n const logits = outputs.logits;\n const batch_size = logits.dims[0];\n\n if (target_sizes !== null && target_sizes.length !== batch_size) {\n throw Error(\"Make sure that you pass in as many target sizes as the batch dimension of the logits\")\n }\n\n const toReturn = [];\n for (let i = 0; i < batch_size; ++i) {\n const target_size = target_sizes !== null ? target_sizes[i] : null;\n\n let data = logits[i];\n\n // 1. If target_size is not null, we need to resize the masks to the target size\n if (target_size !== null) {\n // resize the masks to the target size\n data = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.interpolate)(data, target_size, 'bilinear', false);\n }\n const [height, width] = target_size ?? data.dims.slice(-2);\n\n const segmentation = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'int32',\n new Int32Array(height * width),\n [height, width]\n );\n\n // Buffer to store current largest value\n const buffer = data[0].data;\n for (let j = 1; j < data.dims[0]; ++j) {\n const row = data[j].data;\n for (let k = 0; k < row.length; ++k) {\n if (row[k] > buffer[k]) {\n buffer[k] = row[k];\n segmentation.data[k] = j;\n }\n }\n }\n\n // Store which objects have labels\n // This is much more efficient that creating a set of the final values\n const hasLabel = new Array(data.dims[0]);\n const out = segmentation.data;\n for (let j = 0; j < out.length; ++j) {\n const index = out[j];\n hasLabel[index] = index;\n }\n /** @type {number[]} The unique list of labels that were detected */\n const labels = hasLabel.filter(x => x !== undefined);\n\n toReturn.push({ segmentation, labels });\n }\n return toReturn;\n }\n}\nclass DPTFeatureExtractor extends ImageFeatureExtractor { }\nclass DPTImageProcessor extends DPTFeatureExtractor { } // NOTE: extends DPTFeatureExtractor\nclass BitImageProcessor extends ImageFeatureExtractor { }\nclass GLPNFeatureExtractor extends ImageFeatureExtractor { }\nclass CLIPFeatureExtractor extends ImageFeatureExtractor { }\nclass ChineseCLIPFeatureExtractor extends ImageFeatureExtractor { }\nclass SiglipImageProcessor extends ImageFeatureExtractor { }\nclass ConvNextFeatureExtractor extends ImageFeatureExtractor {\n constructor(config) {\n super(config);\n\n /**\n * Percentage of the image to crop. Only has an effect if this.size < 384.\n */\n this.crop_pct = this.config.crop_pct ?? (224 / 256);\n }\n\n async resize(image) {\n const shortest_edge = this.size?.shortest_edge;\n if (shortest_edge === undefined) {\n throw new Error(`Size dictionary must contain 'shortest_edge' key.`);\n }\n\n if (shortest_edge < 384) {\n // maintain same ratio, resizing shortest edge to shortest_edge/crop_pct\n const resize_shortest_edge = Math.floor(shortest_edge / this.crop_pct);\n\n const [newWidth, newHeight] = this.get_resize_output_image_size(image, {\n shortest_edge: resize_shortest_edge,\n });\n\n image = await image.resize(newWidth, newHeight, {\n resample: this.resample,\n });\n\n // then crop to (shortest_edge, shortest_edge)\n image = await image.center_crop(shortest_edge, shortest_edge);\n } else {\n // warping (no cropping) when evaluated at 384 or larger\n image = await image.resize(shortest_edge, shortest_edge, {\n resample: this.resample,\n });\n }\n\n return image;\n }\n}\nclass ConvNextImageProcessor extends ConvNextFeatureExtractor { } // NOTE extends ConvNextFeatureExtractor\nclass ViTFeatureExtractor extends ImageFeatureExtractor { }\nclass ViTImageProcessor extends ImageFeatureExtractor { }\n\nclass EfficientNetImageProcessor extends ImageFeatureExtractor {\n constructor(config) {\n super(config);\n this.include_top = this.config.include_top ?? true;\n if (this.include_top) {\n this.image_std = this.image_std.map(x => x * x);\n }\n }\n}\n\n\nclass MobileViTFeatureExtractor extends ImageFeatureExtractor { }\nclass OwlViTFeatureExtractor extends ImageFeatureExtractor {\n /** @type {post_process_object_detection} */\n post_process_object_detection(...args) {\n return post_process_object_detection(...args);\n }\n}\nclass Owlv2ImageProcessor extends OwlViTFeatureExtractor { } // NOTE extends OwlViTFeatureExtractor\n\nclass DeiTFeatureExtractor extends ImageFeatureExtractor { }\nclass BeitFeatureExtractor extends ImageFeatureExtractor { }\nclass DonutFeatureExtractor extends ImageFeatureExtractor {\n pad_image(pixelData, imgDims, padSize, options = {}) {\n const [imageHeight, imageWidth, imageChannels] = imgDims;\n\n let image_mean = this.image_mean;\n if (!Array.isArray(this.image_mean)) {\n image_mean = new Array(imageChannels).fill(image_mean);\n }\n\n let image_std = this.image_std;\n if (!Array.isArray(image_std)) {\n image_std = new Array(imageChannels).fill(image_mean);\n }\n\n const constant_values = image_mean.map((x, i) => - x / image_std[i]);\n\n return super.pad_image(pixelData, imgDims, padSize, {\n center: true,\n\n // Since normalization is done after padding, we need to use certain constant values to ensure the same behaviour is observed.\n // For more information, see https://github.com/huggingface/transformers/blob/main/src/transformers/models/donut/image_processing_donut.py#L433-L451\n constant_values: constant_values,\n ...options,\n });\n }\n}\nclass NougatImageProcessor extends DonutFeatureExtractor { } // NOTE extends DonutFeatureExtractor\n\n/**\n * @typedef {object} DetrFeatureExtractorResultProps\n * @property {Tensor} pixel_mask\n * @typedef {ImageFeatureExtractorResult & DetrFeatureExtractorResultProps} DetrFeatureExtractorResult\n */\n\n/**\n * Detr Feature Extractor.\n *\n * @extends ImageFeatureExtractor\n */\nclass DetrFeatureExtractor extends ImageFeatureExtractor {\n /**\n * Calls the feature extraction process on an array of images, preprocesses\n * each image, and concatenates the resulting features into a single Tensor.\n * @param {RawImage[]} images The image(s) to extract features from.\n * @returns {Promise} An object containing the concatenated pixel values of the preprocessed images.\n */\n async _call(images) {\n const result = await super._call(images);\n\n // TODO support differently-sized images, for now assume all images are the same size.\n // TODO support different mask sizes (not just 64x64)\n // Currently, just fill pixel mask with 1s\n const maskSize = [result.pixel_values.dims[0], 64, 64];\n const pixel_mask = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'int64',\n new BigInt64Array(maskSize.reduce((a, b) => a * b)).fill(1n),\n maskSize\n );\n\n return { ...result, pixel_mask };\n }\n\n /**\n * Post-processes the outputs of the model (for object detection).\n * @param {Object} outputs The outputs of the model that must be post-processed\n * @param {Tensor} outputs.logits The logits\n * @param {Tensor} outputs.pred_boxes The predicted boxes.\n * @return {Object[]} An array of objects containing the post-processed outputs.\n */\n\n /** @type {post_process_object_detection} */\n post_process_object_detection(...args) {\n return post_process_object_detection(...args);\n }\n\n /**\n * Binarize the given masks using `object_mask_threshold`, it returns the associated values of `masks`, `scores` and `labels`.\n * @param {Tensor} class_logits The class logits.\n * @param {Tensor} mask_logits The mask logits.\n * @param {number} object_mask_threshold A number between 0 and 1 used to binarize the masks.\n * @param {number} num_labels The number of labels.\n * @returns {[Tensor[], number[], number[]]} The binarized masks, the scores, and the labels.\n */\n remove_low_and_no_objects(class_logits, mask_logits, object_mask_threshold, num_labels) {\n\n let mask_probs_item = [];\n let pred_scores_item = [];\n let pred_labels_item = [];\n\n for (let j = 0; j < class_logits.dims[0]; ++j) {\n let cls = class_logits[j];\n let mask = mask_logits[j];\n\n let pred_label = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.max)(cls.data)[1];\n if (pred_label === num_labels) {\n // Is the background, so we ignore it\n continue;\n }\n\n let scores = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.softmax)(cls.data);\n let pred_score = scores[pred_label];\n if (pred_score > object_mask_threshold) {\n mask_probs_item.push(mask);\n pred_scores_item.push(pred_score);\n pred_labels_item.push(pred_label);\n }\n }\n\n return [mask_probs_item, pred_scores_item, pred_labels_item];\n\n }\n\n /**\n * Checks whether the segment is valid or not.\n * @param {Int32Array} mask_labels Labels for each pixel in the mask.\n * @param {Tensor[]} mask_probs Probabilities for each pixel in the masks.\n * @param {number} k The class id of the segment.\n * @param {number} mask_threshold The mask threshold.\n * @param {number} overlap_mask_area_threshold The overlap mask area threshold.\n * @returns {[boolean, number[]]} Whether the segment is valid or not, and the indices of the valid labels.\n */\n check_segment_validity(\n mask_labels,\n mask_probs,\n k,\n mask_threshold = 0.5,\n overlap_mask_area_threshold = 0.8\n ) {\n // mask_k is a 1D array of indices, indicating where the mask is equal to k\n let mask_k = [];\n let mask_k_area = 0;\n let original_area = 0;\n\n // Compute the area of all the stuff in query k\n for (let i = 0; i < mask_labels.length; ++i) {\n if (mask_labels[i] === k) {\n mask_k.push(i);\n ++mask_k_area;\n }\n\n if (mask_probs[k].data[i] >= mask_threshold) {\n ++original_area;\n }\n }\n let mask_exists = mask_k_area > 0 && original_area > 0;\n\n // Eliminate disconnected tiny segments\n if (mask_exists) {\n // Perform additional check\n let area_ratio = mask_k_area / original_area;\n mask_exists = area_ratio > overlap_mask_area_threshold;\n }\n\n return [mask_exists, mask_k]\n }\n\n /**\n * Computes the segments.\n * @param {Tensor[]} mask_probs The mask probabilities.\n * @param {number[]} pred_scores The predicted scores.\n * @param {number[]} pred_labels The predicted labels.\n * @param {number} mask_threshold The mask threshold.\n * @param {number} overlap_mask_area_threshold The overlap mask area threshold.\n * @param {Set} label_ids_to_fuse The label ids to fuse.\n * @param {number[]} target_size The target size of the image.\n * @returns {[Tensor, Array<{id: number, label_id: number, score: number}>]} The computed segments.\n */\n compute_segments(\n mask_probs,\n pred_scores,\n pred_labels,\n mask_threshold,\n overlap_mask_area_threshold,\n label_ids_to_fuse = null,\n target_size = null,\n ) {\n let [height, width] = target_size ?? mask_probs[0].dims;\n\n let segmentation = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'int32',\n new Int32Array(height * width),\n [height, width]\n );\n let segments = [];\n\n // 1. If target_size is not null, we need to resize the masks to the target size\n if (target_size !== null) {\n // resize the masks to the target size\n for (let i = 0; i < mask_probs.length; ++i) {\n mask_probs[i] = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.interpolate)(mask_probs[i], target_size, 'bilinear', false);\n }\n }\n\n // 2. Weigh each mask by its prediction score\n // NOTE: `mask_probs` is updated in-place\n // \n // Temporary storage for the best label/scores for each pixel ([height, width]):\n let mask_labels = new Int32Array(mask_probs[0].data.length);\n let bestScores = new Float32Array(mask_probs[0].data.length);\n\n for (let i = 0; i < mask_probs.length; ++i) {\n let score = pred_scores[i];\n\n for (let j = 0; j < mask_probs[i].data.length; ++j) {\n mask_probs[i].data[j] *= score\n if (mask_probs[i].data[j] > bestScores[j]) {\n mask_labels[j] = i;\n bestScores[j] = mask_probs[i].data[j];\n }\n }\n }\n\n let current_segment_id = 0;\n\n // let stuff_memory_list = {}\n for (let k = 0; k < pred_labels.length; ++k) {\n let pred_class = pred_labels[k];\n\n // TODO add `should_fuse`\n // let should_fuse = pred_class in label_ids_to_fuse\n\n // Check if mask exists and large enough to be a segment\n let [mask_exists, mask_k] = this.check_segment_validity(\n mask_labels,\n mask_probs,\n k,\n mask_threshold,\n overlap_mask_area_threshold\n )\n\n if (!mask_exists) {\n // Nothing to see here\n continue;\n }\n\n // TODO\n // if (pred_class in stuff_memory_list) {\n // current_segment_id = stuff_memory_list[pred_class]\n // } else {\n // current_segment_id += 1;\n // }\n ++current_segment_id;\n\n\n // Add current object segment to final segmentation map\n for (let index of mask_k) {\n segmentation.data[index] = current_segment_id;\n }\n\n segments.push({\n id: current_segment_id,\n label_id: pred_class,\n // was_fused: should_fuse, TODO\n score: pred_scores[k],\n })\n\n // TODO\n // if(should_fuse){\n // stuff_memory_list[pred_class] = current_segment_id\n // }\n }\n\n return [segmentation, segments];\n }\n\n /**\n * Post-process the model output to generate the final panoptic segmentation.\n * @param {*} outputs The model output to post process\n * @param {number} [threshold=0.5] The probability score threshold to keep predicted instance masks.\n * @param {number} [mask_threshold=0.5] Threshold to use when turning the predicted masks into binary values.\n * @param {number} [overlap_mask_area_threshold=0.8] The overlap mask area threshold to merge or discard small disconnected parts within each binary instance mask.\n * @param {Set} [label_ids_to_fuse=null] The labels in this state will have all their instances be fused together.\n * @param {number[][]} [target_sizes=null] The target sizes to resize the masks to.\n * @returns {Array<{ segmentation: Tensor, segments_info: Array<{id: number, label_id: number, score: number}>}>}\n */\n post_process_panoptic_segmentation(\n outputs,\n threshold = 0.5,\n mask_threshold = 0.5,\n overlap_mask_area_threshold = 0.8,\n label_ids_to_fuse = null,\n target_sizes = null,\n ) {\n if (label_ids_to_fuse === null) {\n console.warn(\"`label_ids_to_fuse` unset. No instance will be fused.\")\n label_ids_to_fuse = new Set();\n }\n\n const class_queries_logits = outputs.logits; // [batch_size, num_queries, num_classes+1]\n const masks_queries_logits = outputs.pred_masks; // [batch_size, num_queries, height, width]\n\n const mask_probs = masks_queries_logits.sigmoid() // [batch_size, num_queries, height, width]\n\n let [batch_size, num_queries, num_labels] = class_queries_logits.dims;\n num_labels -= 1; // Remove last class (background)\n\n if (target_sizes !== null && target_sizes.length !== batch_size) {\n throw Error(\"Make sure that you pass in as many target sizes as the batch dimension of the logits\")\n }\n\n let toReturn = [];\n for (let i = 0; i < batch_size; ++i) {\n let target_size = target_sizes !== null ? target_sizes[i] : null;\n\n let class_logits = class_queries_logits[i];\n let mask_logits = mask_probs[i];\n\n let [mask_probs_item, pred_scores_item, pred_labels_item] = this.remove_low_and_no_objects(class_logits, mask_logits, threshold, num_labels);\n\n if (pred_labels_item.length === 0) {\n // No mask found\n let [height, width] = target_size ?? mask_logits.dims.slice(-2);\n\n let segmentation = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'int32',\n new Int32Array(height * width).fill(-1),\n [height, width]\n )\n toReturn.push({\n segmentation: segmentation,\n segments_info: []\n });\n continue;\n }\n\n\n // Get segmentation map and segment information of batch item\n let [segmentation, segments] = this.compute_segments(\n mask_probs_item,\n pred_scores_item,\n pred_labels_item,\n mask_threshold,\n overlap_mask_area_threshold,\n label_ids_to_fuse,\n target_size,\n )\n\n toReturn.push({\n segmentation: segmentation,\n segments_info: segments\n })\n }\n\n return toReturn;\n }\n\n post_process_instance_segmentation() {\n // TODO\n throw Error(\"Not implemented yet\");\n }\n}\n\nclass YolosFeatureExtractor extends ImageFeatureExtractor {\n /** @type {post_process_object_detection} */\n post_process_object_detection(...args) {\n return post_process_object_detection(...args);\n }\n}\n\n/**\n * @typedef {object} SamImageProcessorResult\n * @property {Tensor} pixel_values\n * @property {HeightWidth[]} original_sizes\n * @property {HeightWidth[]} reshaped_input_sizes\n * @property {Tensor} [input_points]\n * @property {Tensor} [input_labels]\n */\n\nclass SamImageProcessor extends ImageFeatureExtractor {\n\n /**\n * \n * @param {any} input_points \n * @param {HeightWidth[]} original_sizes \n * @param {HeightWidth[]} reshaped_input_sizes \n * @returns {Tensor}\n */\n reshape_input_points(input_points, original_sizes, reshaped_input_sizes) {\n\n // Make deep copy to avoid altering user's input\n input_points = structuredClone(input_points);\n let shape = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.calculateDimensions)(input_points);\n\n // TODO: add support for 2D input_points\n if (shape.length === 3) {\n // Correct user's input\n shape = [1, ...shape];\n input_points = [input_points];\n } else if (shape.length !== 4) {\n throw Error(\"The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.\")\n }\n\n // Reshape input points\n for (let i = 0; i < input_points.length; ++i) { // batch_size\n let originalImageSize = original_sizes[i];\n let reshapedImageSize = reshaped_input_sizes[i];\n\n let resizeFactors = [\n reshapedImageSize[0] / originalImageSize[0],\n reshapedImageSize[1] / originalImageSize[1]\n ]\n\n for (let j = 0; j < input_points[i].length; ++j) { // point_batch_size\n for (let k = 0; k < input_points[i][j].length; ++k) { // nb_points_per_image\n for (let w = 0; w < input_points[i][j][k].length; ++w) { // 2\n input_points[i][j][k][w] *= resizeFactors[w];\n }\n }\n }\n }\n\n return new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'float32',\n Float32Array.from(input_points.flat(Infinity)),\n shape\n )\n\n }\n\n /**\n * \n * @param {any} input_labels \n * @param {Tensor} input_points \n * @returns {Tensor}\n */\n add_input_labels(input_labels, input_points) {\n let shape = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.calculateDimensions)(input_labels);\n if (shape.length === 2) {\n // Correct user's input\n shape = [1, ...shape];\n input_labels = [input_labels];\n } else if (shape.length !== 3) {\n throw Error(\"The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.\")\n }\n\n if (shape.some((x, i) => x !== input_points.dims[i])) {\n throw Error(`The first ${shape.length} dimensions of 'input_points' and 'input_labels' must be the same.`)\n }\n return new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'int64',\n input_labels.flat(Infinity).map(BigInt),\n shape,\n )\n }\n /**\n * @param {any[]} images The URL(s) of the image(s) to extract features from.\n * @param {any} [input_points] A 3D or 4D array, representing the input points provided by the user.\n * - 3D: `[point_batch_size, nb_points_per_image, 2]`. In this case, `batch_size` is assumed to be 1.\n * - 4D: `[batch_size, point_batch_size, nb_points_per_image, 2]`.\n * @param {any} [input_labels] A 2D or 3D array, representing the input labels for the points, used by the prompt encoder to encode the prompt.\n * - 2D: `[point_batch_size, nb_points_per_image]`. In this case, `batch_size` is assumed to be 1.\n * - 3D: `[batch_size, point_batch_size, nb_points_per_image]`.\n * @returns {Promise}\n */\n async _call(images, input_points = null, input_labels = null) {\n // TODO allow user to use preprocessed images\n /** @type {SamImageProcessorResult} */\n const processed = await super._call(images);\n\n if (input_points) {\n processed.input_points = this.reshape_input_points(\n input_points, processed.original_sizes, processed.reshaped_input_sizes\n );\n }\n\n if (input_labels) {\n if (!processed.input_points) {\n throw Error(\"`input_points` must be provided if `input_labels` are provided.\")\n }\n processed.input_labels = this.add_input_labels(input_labels, processed.input_points);\n }\n\n return processed;\n }\n\n /**\n * Remove padding and upscale masks to the original image size.\n * @param {Tensor} masks Batched masks from the mask_decoder in (batch_size, num_channels, height, width) format.\n * @param {number[][]} original_sizes The original sizes of each image before it was resized to the model's expected input shape, in (height, width) format.\n * @param {number[][]} reshaped_input_sizes The size of each image as it is fed to the model, in (height, width) format. Used to remove padding.\n * @param {Object} options Optional parameters for post-processing.\n * @param {number} [options.mask_threshold] The threshold to use for binarizing the masks.\n * @param {boolean} [options.binarize] Whether to binarize the masks.\n * @param {Object} [options.pad_size] The target size the images were padded to before being passed to the model. If `null`, the target size is assumed to be the processor's `pad_size`.\n * @param {number} [options.pad_size.height] The height the images were padded to.\n * @param {number} [options.pad_size.width] The width the images were padded to.\n * @returns {Tensor[]} Batched masks in batch_size, num_channels, height, width) format, where (height, width) is given by original_size.\n */\n post_process_masks(masks, original_sizes, reshaped_input_sizes, {\n mask_threshold = 0.0,\n binarize = true,\n pad_size = null,\n } = {}) {\n // masks: [1, 1, 3, 256, 256]\n\n const output_masks = [];\n\n pad_size = pad_size ?? this.pad_size;\n\n const target_image_size = [pad_size.height, pad_size.width];\n\n for (let i = 0; i < original_sizes.length; ++i) {\n const original_size = original_sizes[i];\n const reshaped_input_size = reshaped_input_sizes[i];\n\n const mask = masks[i]; // [b, c, h, w]\n\n // TODO: improve\n const interpolated_masks = [];\n for (let j = 0; j < mask.dims[0]; ++j) {\n const m = mask[j]; // 3d tensor\n\n // Upscale mask to padded size\n let interpolated_mask = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.interpolate)(m, target_image_size, 'bilinear', false);\n\n // Crop mask\n interpolated_mask = interpolated_mask.slice(null, [0, reshaped_input_size[0]], [0, reshaped_input_size[1]]);\n\n // Downscale mask\n interpolated_mask = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.interpolate)(interpolated_mask, original_size, 'bilinear', false);\n\n if (binarize) {\n const binarizedMaskData = new Uint8Array(interpolated_mask.data.length);\n for (let i = 0; i < interpolated_mask.data.length; ++i) {\n if (interpolated_mask.data[i] > mask_threshold) {\n binarizedMaskData[i] = 1;\n }\n }\n interpolated_mask = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'bool',\n binarizedMaskData,\n interpolated_mask.dims\n )\n }\n\n interpolated_masks.push(interpolated_mask);\n }\n\n output_masks.push((0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.stack)(interpolated_masks));\n }\n\n return output_masks;\n }\n}\n\nclass Swin2SRImageProcessor extends ImageFeatureExtractor {\n pad_image(pixelData, imgDims, padSize, options = {}) {\n // NOTE: In this case, `padSize` represents the size of the sliding window for the local attention.\n // In other words, the image is padded so that its width and height are multiples of `padSize`.\n const [imageHeight, imageWidth, imageChannels] = imgDims;\n\n return super.pad_image(pixelData, imgDims, {\n // NOTE: For Swin2SR models, the original python implementation adds padding even when the image's width/height is already\n // a multiple of `pad_size`. However, this is most likely a bug (PR: https://github.com/mv-lab/swin2sr/pull/19).\n // For this reason, we only add padding when the image's width/height is not a multiple of `pad_size`.\n width: imageWidth + (padSize - imageWidth % padSize) % padSize,\n height: imageHeight + (padSize - imageHeight % padSize) % padSize,\n }, {\n mode: 'symmetric',\n center: false,\n constant_values: -1,\n ...options,\n })\n }\n}\n\nclass VitMatteImageProcessor extends ImageFeatureExtractor {\n /**\n * Calls the feature extraction process on an array of images, preprocesses\n * each image, and concatenates the resulting features into a single Tensor.\n * @param {RawImage[]} images The image(s) to extract features from.\n * @param {RawImage[]} trimaps The trimaps(s) to extract features from.\n * @returns {Promise} An object containing the concatenated pixel values of the preprocessed images.\n */\n async _call(images, trimaps) {\n if (!Array.isArray(images)) {\n images = [images];\n }\n if (!Array.isArray(trimaps)) {\n trimaps = [trimaps];\n }\n\n const imageData = await Promise.all(images.map(x => this.preprocess(x)));\n const trimapData = await Promise.all(trimaps.map(x => this.preprocess(x, {\n do_normalize: false,\n do_convert_rgb: false,\n do_convert_grayscale: true,\n })));\n\n\n // Stack pixel values\n const pixel_values = (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.stack)(imageData.map(\n // Concatenate images and trimaps\n (x, i) => (0,_utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.cat)([x.pixel_values, trimapData[i].pixel_values], 0)\n ), 0);\n\n return {\n pixel_values: pixel_values,\n\n // Original sizes of images\n original_sizes: imageData.map(x => x.original_size),\n\n // Reshaped sizes of images, before padding or cropping\n reshaped_input_sizes: imageData.map(x => x.reshaped_input_size),\n }\n }\n}\n\nclass WhisperFeatureExtractor extends FeatureExtractor {\n\n constructor(config) {\n super(config);\n\n // Prefer given `mel_filters` from preprocessor_config.json, or calculate them if they don't exist.\n this.config.mel_filters ??= (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.mel_filter_bank)(\n Math.floor(1 + this.config.n_fft / 2), // num_frequency_bins\n this.config.feature_size, // num_mel_filters\n 0.0, // min_frequency\n 8000.0, // max_frequency\n this.config.sampling_rate, // sampling_rate\n \"slaney\", // norm\n \"slaney\", // mel_scale\n );\n\n this.window = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.window_function)(this.config.n_fft, 'hann');\n }\n\n /**\n * Computes the log-Mel spectrogram of the provided audio waveform.\n * @param {Float32Array|Float64Array} waveform The audio waveform to process.\n * @returns {{data: Float32Array, dims: number[]}} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n _extract_fbank_features(waveform) {\n const { data, dims } = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.spectrogram)(\n waveform,\n this.window, // window\n this.config.n_fft, // frame_length\n this.config.hop_length, // hop_length\n {\n power: 2.0,\n mel_filters: this.config.mel_filters,\n log_mel: 'log10',\n\n // Custom\n max_num_frames: this.config.nb_max_frames, // 3000\n }\n )\n\n const maxValue = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.max)(data)[0];\n\n for (let i = 0; i < data.length; ++i) {\n data[i] = (Math.max(data[i], maxValue - 8.0) + 4.0) / 4.0;\n }\n\n return { data, dims };\n }\n\n /**\n * Asynchronously extracts features from a given audio using the provided configuration.\n * @param {Float32Array|Float64Array} audio The audio data as a Float32Array/Float64Array.\n * @returns {Promise<{ input_features: Tensor }>} A Promise resolving to an object containing the extracted input features as a Tensor.\n */\n async _call(audio) {\n validate_audio_inputs(audio, 'WhisperFeatureExtractor');\n\n let waveform;\n if (audio.length > this.config.n_samples) {\n console.warn(\n \"Attempting to extract features for audio longer than 30 seconds. \" +\n \"If using a pipeline to extract transcript from a long audio clip, \" +\n \"remember to specify `chunk_length_s` and/or `stride_length_s`.\"\n );\n waveform = audio.slice(0, this.config.n_samples);\n } else {\n // pad with zeros\n waveform = new Float32Array(this.config.n_samples);\n waveform.set(audio);\n }\n\n const { data, dims } = this._extract_fbank_features(waveform);\n\n return {\n input_features: new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor('float32',\n data,\n [1, ...dims]\n )\n };\n }\n}\n\nclass Wav2Vec2FeatureExtractor extends FeatureExtractor {\n\n /**\n * @param {Float32Array} input_values \n * @returns {Float32Array} \n */\n _zero_mean_unit_var_norm(input_values) {\n // TODO support batch?\n const sum = input_values.reduce((a, b) => a + b, 0);\n const mean = sum / input_values.length;\n const variance = input_values.reduce((a, b) => a + (b - mean) ** 2, 0) / input_values.length;\n return input_values.map(x => (x - mean) / Math.sqrt(variance + 1e-7));\n }\n\n /**\n * Asynchronously extracts features from a given audio using the provided configuration.\n * @param {Float32Array|Float64Array} audio The audio data as a Float32Array/Float64Array.\n * @returns {Promise<{ input_values: Tensor; attention_mask: Tensor }>} A Promise resolving to an object containing the extracted input features and attention mask as Tensors.\n */\n async _call(audio) {\n validate_audio_inputs(audio, 'Wav2Vec2FeatureExtractor');\n\n if (audio instanceof Float64Array) {\n audio = new Float32Array(audio);\n }\n\n let input_values = audio;\n\n // zero-mean and unit-variance normalization\n if (this.config.do_normalize) {\n input_values = this._zero_mean_unit_var_norm(input_values);\n }\n\n // TODO: allow user to pass in attention mask\n const shape = [1, input_values.length];\n return {\n input_values: new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor('float32', input_values, shape),\n attention_mask: new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor('int64', new BigInt64Array(input_values.length).fill(1n), shape)\n };\n }\n}\n\nclass SeamlessM4TFeatureExtractor extends FeatureExtractor {\n\n constructor(config) {\n super(config);\n\n const sampling_rate = this.config.sampling_rate;\n const mel_filters = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.mel_filter_bank)(\n 256, // num_frequency_bins\n this.config.num_mel_bins, // num_mel_filters\n 20, // min_frequency\n Math.floor(sampling_rate / 2), // max_frequency\n sampling_rate, // sampling_rate\n null, // norm\n \"kaldi\", // mel_scale\n true, // triangularize_in_mel_space\n );\n\n // Do padding:\n for (let i = 0; i < mel_filters.length; ++i) {\n mel_filters[i].push(0);\n }\n this.mel_filters = mel_filters;\n\n this.window = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.window_function)(400, 'povey', {\n periodic: false,\n })\n }\n\n /**\n * Computes the log-Mel spectrogram of the provided audio waveform.\n * @param {Float32Array|Float64Array} waveform The audio waveform to process.\n * @param {number} max_length The maximum number of frames to return.\n * @returns {{data: Float32Array, dims: number[]}} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n _extract_fbank_features(waveform, max_length) {\n // NOTE: We don't pad/truncate since that is passed in as `max_num_frames`\n\n // Kaldi compliance: 16-bit signed integers\n // 32768 == 2 ** 15\n waveform = waveform.map((/** @type {number} */ x) => x * 32768)\n\n return (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.spectrogram)(\n waveform,\n this.window, // window\n 400, // frame_length\n 160, // hop_length\n {\n fft_length: 512,\n power: 2.0,\n center: false,\n preemphasis: 0.97,\n mel_filters: this.mel_filters,\n log_mel: 'log',\n mel_floor: 1.192092955078125e-07,\n remove_dc_offset: true,\n\n // Custom\n max_num_frames: max_length,\n transpose: true,\n }\n )\n }\n\n /**\n * Asynchronously extracts features from a given audio using the provided configuration.\n * @param {Float32Array|Float64Array} audio The audio data as a Float32Array/Float64Array.\n * @param {Object} options Optional parameters for feature extraction.\n * @param {boolean} [options.padding=true] Whether to pad the sequence to a multiple of `pad_to_multiple_of`.\n * @param {number} [options.pad_to_multiple_of=2] The number to pad the sequence to a multiple of.\n * @param {boolean} [options.do_normalize_per_mel_bins=true] Whether or not to zero-mean unit-variance normalize the input per mel-channel.\n * @param {boolean} [options.return_attention_mask=true] Whether to return the attention mask.\n * @returns {Promise<{ input_features: Tensor, attention_mask?: Tensor }>} A Promise resolving to an object containing the extracted input features and attention masks as Tensors.\n */\n async _call(audio, {\n padding = true,\n pad_to_multiple_of = 2,\n do_normalize_per_mel_bins = true,\n return_attention_mask = true,\n } = {}) {\n validate_audio_inputs(audio, 'SeamlessM4TFeatureExtractor');\n\n let features = this._extract_fbank_features(audio, this.config.max_length);\n\n if (do_normalize_per_mel_bins) {\n const [num_features, feature_size] = features.dims;\n for (let i = 0; i < feature_size; ++i) {\n let sum = 0;\n for (let j = 0; j < num_features; ++j) {\n sum += features.data[j * feature_size + i];\n }\n\n const mean = sum / num_features;\n\n let variance = 0;\n for (let j = 0; j < num_features; ++j) {\n variance += (features.data[j * feature_size + i] - mean) ** 2;\n }\n variance /= num_features - 1; // NOTE: We use ddof=1\n\n const std = Math.sqrt(variance + 1e-7);\n for (let j = 0; j < num_features; ++j) {\n const index = j * feature_size + i;\n features.data[index] = (features.data[index] - mean) / std;\n }\n }\n }\n\n let padded_attention_mask;\n if (padding) {\n const [num_frames, num_channels] = features.dims;\n\n const pad_size = num_frames % pad_to_multiple_of;\n if (pad_size > 0) {\n const padded_data = new Float32Array(num_channels * (num_frames + pad_size));\n padded_data.set(features.data)\n padded_data.fill(this.config.padding_value, features.data.length)\n\n const numPaddedFrames = num_frames + pad_size;\n features = {\n data: padded_data,\n dims: [numPaddedFrames, num_channels],\n }\n\n if (return_attention_mask) {\n padded_attention_mask = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'int64',\n new BigInt64Array(numPaddedFrames),\n [1, numPaddedFrames],\n )\n padded_attention_mask.data.fill(1n, 0, num_frames);\n }\n }\n }\n\n const [num_frames, num_channels] = features.dims;\n\n const stride = this.config.stride;\n const remainder = num_frames % stride;\n if (remainder !== 0) {\n throw new Error(`The number of frames (${num_frames}) must be a multiple of the stride (${stride}).`)\n }\n\n const input_features = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor('float32',\n features.data,\n features.dims,\n ).view(\n 1,\n Math.floor(num_frames / stride),\n num_channels * stride,\n );\n\n const result = { input_features }\n\n if (return_attention_mask) {\n const reshapedNumFrames = input_features.dims[1];\n\n const attention_mask = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor(\n 'int64',\n new BigInt64Array(reshapedNumFrames),\n [1, reshapedNumFrames],\n );\n if (padded_attention_mask) {\n for (let i = 1, j = 0; i < num_frames; i += stride, ++j) {\n attention_mask.data[j] = padded_attention_mask.data[i];\n }\n } else {\n attention_mask.data.fill(1n);\n }\n\n result.attention_mask = attention_mask;\n }\n\n return result;\n }\n}\n\nclass ASTFeatureExtractor extends FeatureExtractor {\n\n\n constructor(config) {\n super(config);\n\n const sampling_rate = this.config.sampling_rate;\n const mel_filters = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.mel_filter_bank)(\n 256, // num_frequency_bins\n this.config.num_mel_bins, // num_mel_filters\n 20, // min_frequency\n Math.floor(sampling_rate / 2), // max_frequency\n sampling_rate, // sampling_rate\n null, // norm\n \"kaldi\", // mel_scale\n true, // triangularize_in_mel_space\n );\n\n // Do padding:\n for (let i = 0; i < mel_filters.length; ++i) {\n mel_filters[i].push(0);\n }\n this.mel_filters = mel_filters;\n\n this.window = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.window_function)(400, 'hann', {\n periodic: false,\n })\n\n this.mean = this.config.mean;\n this.std = this.config.std;\n }\n\n /**\n * Computes the log-Mel spectrogram of the provided audio waveform.\n * @param {Float32Array|Float64Array} waveform The audio waveform to process.\n * @param {number} max_length The maximum number of frames to return.\n * @returns {{data: Float32Array, dims: number[]}} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n _extract_fbank_features(waveform, max_length) {\n // NOTE: We don't pad/truncate since that is passed in as `max_num_frames`\n return (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.spectrogram)(\n waveform,\n this.window, // window\n 400, // frame_length\n 160, // hop_length\n {\n fft_length: 512,\n power: 2.0,\n center: false,\n preemphasis: 0.97,\n mel_filters: this.mel_filters,\n log_mel: 'log',\n mel_floor: 1.192092955078125e-07,\n remove_dc_offset: true,\n\n // Custom\n max_num_frames: max_length,\n transpose: true,\n }\n )\n }\n\n\n /**\n * Asynchronously extracts features from a given audio using the provided configuration.\n * @param {Float32Array|Float64Array} audio The audio data as a Float32Array/Float64Array.\n * @returns {Promise<{ input_values: Tensor }>} A Promise resolving to an object containing the extracted input features as a Tensor.\n */\n async _call(audio) {\n validate_audio_inputs(audio, 'ASTFeatureExtractor');\n\n const features = this._extract_fbank_features(audio, this.config.max_length);\n if (this.config.do_normalize) {\n // Normalize the input audio spectrogram to have mean=0, std=0.5\n const denom = this.std * 2;\n for (let i = 0; i < features.data.length; ++i) {\n features.data[i] = (features.data[i] - this.mean) / denom;\n }\n }\n\n return {\n input_values: new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor('float32',\n features.data,\n [1, ...features.dims]\n )\n };\n }\n}\n\nclass ClapFeatureExtractor extends FeatureExtractor {\n\n constructor(config) {\n super(config);\n\n this.mel_filters = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.mel_filter_bank)(\n this.config.nb_frequency_bins, // num_frequency_bins\n this.config.feature_size, // num_mel_filters\n this.config.frequency_min, // min_frequency\n this.config.frequency_max, // max_frequency\n this.config.sampling_rate, // sampling_rate\n null, // norm\n \"htk\", // mel_scale\n );\n\n this.mel_filters_slaney = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.mel_filter_bank)(\n this.config.nb_frequency_bins, // num_frequency_bins\n this.config.feature_size, // num_mel_filters\n this.config.frequency_min, // min_frequency\n this.config.frequency_max, // max_frequency\n this.config.sampling_rate, // sampling_rate\n \"slaney\", // norm\n \"slaney\", // mel_scale\n );\n\n this.window = (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.window_function)(this.config.fft_window_size, 'hann')\n\n }\n\n\n /**\n * Extracts the mel spectrogram and prepares it for the mode based on the `truncation` and `padding` arguments.\n * \n * Four different path are possible:\n * - `truncation=\"fusion\"` and the length of the waveform is greater than the max length: the mel spectrogram\n * will be computed on the entire audio. 3 random crops and a dowsampled version of the full mel spectrogram\n * are then stacked together. They will later be used for `feature_fusion`.\n * - `truncation=\"rand_trunc\"` and the length of the waveform is smaller than the max length: the audio is\n * padded based on `padding`.\n * - `truncation=\"fusion\"` and the length of the waveform is smaller than the max length: the audio is padded\n * based on `padding`, and is repeated `4` times.\n * - `truncation=\"rand_trunc\"` and the length of the waveform is greater than the max length: the mel\n * spectrogram will be computed on a random crop of the waveform.\n * \n * @param {Float32Array|Float64Array} waveform The input waveform.\n * @param {number} max_length The maximum length of the waveform.\n * @param {string} truncation The truncation strategy to use.\n * @param {string} padding The padding strategy to use.\n * @returns {{ data: Float32Array; dims: number[]; longer: boolean; }} An object containing the mel spectrogram data as a Float32Array, its dimensions as an array of numbers, and a boolean indicating whether the waveform was longer than the max length.\n */\n _get_input_mel(waveform, max_length, truncation, padding) {\n\n /** @type {{ data: Float32Array; dims: number[]}} */\n let input_mel;\n let longer = false;\n const diff = waveform.length - max_length;\n if (diff > 0) {\n if (truncation === 'rand_trunc') {\n longer = true;\n const idx = Math.floor(Math.random() * (diff + 1));\n waveform = waveform.subarray(idx, idx + max_length);\n\n input_mel = this._extract_fbank_features(waveform, this.mel_filters_slaney, this.config.nb_max_samples);\n input_mel.dims = [1, ...input_mel.dims]; // \"unsqueeze\"\n } else {\n // TODO implement fusion strategy\n throw new Error(`Truncation strategy \"${truncation}\" not implemented`)\n }\n } else {\n if (diff < 0) {\n let padded = new Float64Array(max_length); // already padded with zeros\n padded.set(waveform);\n\n if (padding === 'repeat') {\n for (let i = waveform.length; i < max_length; i += waveform.length) {\n padded.set(waveform.subarray(0, Math.min(waveform.length, max_length - i)), i);\n }\n } else if (padding === 'repeatpad') {\n for (let i = waveform.length; i < -diff; i += waveform.length) {\n padded.set(waveform, i);\n }\n }\n waveform = padded;\n }\n\n if (truncation === 'fusion') {\n throw new Error(`Truncation strategy \"${truncation}\" not implemented`)\n }\n\n input_mel = this._extract_fbank_features(waveform, this.mel_filters_slaney, this.config.nb_max_samples);\n input_mel.dims = [1, ...input_mel.dims]; // \"unsqueeze\"\n }\n\n return {\n ...input_mel,\n longer,\n }\n }\n\n /**\n * Compute the log-mel spectrogram of the provided `waveform` using the Hann window.\n * In CLAP, two different filter banks are used depending on the truncation pattern:\n * - `self.mel_filters`: they correspond to the default parameters of `torchaudio` which can be obtained from\n * calling `torchaudio.transforms.MelSpectrogram().mel_scale.fb`. These filters are used when `truncation`\n * is set to `\"fusion\"`.\n * - `self.mel_filteres_slaney` : they correspond to the default parameters of `librosa` which used\n * `librosa.filters.mel` when computing the mel spectrogram. These filters were only used in the original\n * implementation when the truncation mode is not `\"fusion\"`.\n * \n * @param {Float32Array|Float64Array} waveform The audio waveform to process.\n * @param {number[][]} mel_filters The mel filters to use.\n * @param {number} [max_length=null] The maximum number of frames to return.\n * @returns {{data: Float32Array, dims: number[]}} An object containing the log-Mel spectrogram data as a Float32Array and its dimensions as an array of numbers.\n */\n _extract_fbank_features(waveform, mel_filters, max_length = null) {\n // NOTE: We don't pad/truncate since that is passed in as `max_num_frames`\n return (0,_utils_audio_js__WEBPACK_IMPORTED_MODULE_5__.spectrogram)(\n waveform,\n this.window, // window\n this.config.fft_window_size, // frame_length\n this.config.hop_length, // hop_length\n {\n power: 2.0,\n mel_filters,\n log_mel: 'dB',\n\n // Custom\n max_num_frames: max_length,\n do_pad: false,\n transpose: true,\n }\n )\n }\n\n\n /**\n * Asynchronously extracts features from a given audio using the provided configuration.\n * @param {Float32Array|Float64Array} audio The audio data as a Float32Array/Float64Array.\n * @returns {Promise<{ input_features: Tensor }>} A Promise resolving to an object containing the extracted input features as a Tensor.\n */\n async _call(audio, {\n max_length = null,\n } = {}) {\n validate_audio_inputs(audio, 'ClapFeatureExtractor');\n\n // convert to mel spectrogram, truncate and pad if needed.\n const padded_inputs = this._get_input_mel(\n audio,\n max_length ?? this.config.nb_max_samples,\n this.config.truncation,\n this.config.padding,\n );\n\n\n return {\n input_features: new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor('float32',\n padded_inputs.data,\n [1, ...padded_inputs.dims]\n )\n };\n }\n}\n\n\n\nclass SpeechT5FeatureExtractor extends FeatureExtractor { }\n\n/**\n * Represents a Processor that extracts features from an input.\n * @extends Callable\n */\nclass Processor extends _utils_core_js__WEBPACK_IMPORTED_MODULE_0__.Callable {\n /**\n * Creates a new Processor with the given feature extractor.\n * @param {FeatureExtractor} feature_extractor The function used to extract features from the input.\n */\n constructor(feature_extractor) {\n super();\n this.feature_extractor = feature_extractor;\n // TODO use tokenizer here?\n }\n\n /**\n * Calls the feature_extractor function with the given input.\n * @param {any} input The input to extract features from.\n * @param {...any} args Additional arguments.\n * @returns {Promise} A Promise that resolves with the extracted features.\n */\n async _call(input, ...args) {\n return await this.feature_extractor(input, ...args);\n }\n}\n\nclass SamProcessor extends Processor {\n /**\n * @borrows SamImageProcessor#_call as _call\n */\n async _call(...args) {\n return await this.feature_extractor(...args);\n }\n\n /**\n * @borrows SamImageProcessor#post_process_masks as post_process_masks\n */\n post_process_masks(...args) {\n // @ts-ignore\n return this.feature_extractor.post_process_masks(...args);\n }\n /**\n * @borrows SamImageProcessor#reshape_input_points as reshape_input_points\n */\n reshape_input_points(...args) {\n // @ts-ignore\n return this.feature_extractor.reshape_input_points(...args);\n }\n}\n\n/**\n * Represents a WhisperProcessor that extracts features from an audio input.\n * @extends Processor\n */\nclass WhisperProcessor extends Processor {\n /**\n * Calls the feature_extractor function with the given audio input.\n * @param {any} audio The audio input to extract features from.\n * @returns {Promise} A Promise that resolves with the extracted features.\n */\n async _call(audio) {\n return await this.feature_extractor(audio)\n }\n}\n\n\nclass Wav2Vec2ProcessorWithLM extends Processor {\n /**\n * Calls the feature_extractor function with the given audio input.\n * @param {any} audio The audio input to extract features from.\n * @returns {Promise} A Promise that resolves with the extracted features.\n */\n async _call(audio) {\n return await this.feature_extractor(audio)\n }\n}\n\nclass SpeechT5Processor extends Processor {\n /**\n * Calls the feature_extractor function with the given input.\n * @param {any} input The input to extract features from.\n * @returns {Promise} A Promise that resolves with the extracted features.\n */\n async _call(input) {\n return await this.feature_extractor(input)\n }\n}\n\nclass OwlViTProcessor extends Processor { }\n\n\n//////////////////////////////////////////////////\n/**\n * Helper class which is used to instantiate pretrained processors with the `from_pretrained` function.\n * The chosen processor class is determined by the type specified in the processor config.\n * \n * **Example:** Load a processor using `from_pretrained`.\n * ```javascript\n * let processor = await AutoProcessor.from_pretrained('openai/whisper-tiny.en');\n * ```\n * \n * **Example:** Run an image through a processor.\n * ```javascript\n * let processor = await AutoProcessor.from_pretrained('Xenova/clip-vit-base-patch16');\n * let image = await RawImage.read('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');\n * let image_inputs = await processor(image);\n * // {\n * // \"pixel_values\": {\n * // \"dims\": [ 1, 3, 224, 224 ],\n * // \"type\": \"float32\",\n * // \"data\": Float32Array [ -1.558687686920166, -1.558687686920166, -1.5440893173217773, ... ],\n * // \"size\": 150528\n * // },\n * // \"original_sizes\": [\n * // [ 533, 800 ]\n * // ],\n * // \"reshaped_input_sizes\": [\n * // [ 224, 224 ]\n * // ]\n * // }\n * ```\n */\nclass AutoProcessor {\n static FEATURE_EXTRACTOR_CLASS_MAPPING = {\n ImageFeatureExtractor,\n WhisperFeatureExtractor,\n ViTFeatureExtractor,\n MobileViTFeatureExtractor,\n OwlViTFeatureExtractor,\n Owlv2ImageProcessor,\n CLIPFeatureExtractor,\n ChineseCLIPFeatureExtractor,\n SiglipImageProcessor,\n ConvNextFeatureExtractor,\n ConvNextImageProcessor,\n SegformerFeatureExtractor,\n BitImageProcessor,\n DPTImageProcessor,\n DPTFeatureExtractor,\n GLPNFeatureExtractor,\n BeitFeatureExtractor,\n DeiTFeatureExtractor,\n DetrFeatureExtractor,\n YolosFeatureExtractor,\n DonutFeatureExtractor,\n NougatImageProcessor,\n EfficientNetImageProcessor,\n\n ViTImageProcessor,\n VitMatteImageProcessor,\n SamImageProcessor,\n Swin2SRImageProcessor,\n Wav2Vec2FeatureExtractor,\n SeamlessM4TFeatureExtractor,\n SpeechT5FeatureExtractor,\n ASTFeatureExtractor,\n ClapFeatureExtractor,\n }\n\n static PROCESSOR_CLASS_MAPPING = {\n WhisperProcessor,\n Wav2Vec2ProcessorWithLM,\n SamProcessor,\n SpeechT5Processor,\n OwlViTProcessor,\n }\n\n /**\n * Instantiate one of the processor classes of the library from a pretrained model.\n * \n * The processor class to instantiate is selected based on the `feature_extractor_type` property of the config object\n * (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible)\n * \n * @param {string} pretrained_model_name_or_path The name or path of the pretrained model. Can be either:\n * - A string, the *model id* of a pretrained processor hosted inside a model repo on huggingface.co.\n * Valid model ids can be located at the root-level, like `bert-base-uncased`, or namespaced under a\n * user or organization name, like `dbmdz/bert-base-german-cased`.\n * - A path to a *directory* containing processor files, e.g., `./my_model_directory/`.\n * @param {import('./utils/hub.js').PretrainedOptions} options Additional options for loading the processor.\n * \n * @returns {Promise} A new instance of the Processor class.\n */\n static async from_pretrained(pretrained_model_name_or_path, {\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n } = {}) {\n\n let preprocessorConfig = config ?? await (0,_utils_hub_js__WEBPACK_IMPORTED_MODULE_1__.getModelJSON)(pretrained_model_name_or_path, 'preprocessor_config.json', true, {\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n })\n\n // Determine feature extractor class\n // TODO: Ensure backwards compatibility with old configs\n let key = preprocessorConfig.feature_extractor_type ?? preprocessorConfig.image_processor_type;\n let feature_extractor_class = this.FEATURE_EXTRACTOR_CLASS_MAPPING[key];\n\n if (!feature_extractor_class) {\n if (preprocessorConfig.size !== undefined) {\n // Assume ImageFeatureExtractor\n console.warn(`Feature extractor type \"${key}\" not found, assuming ImageFeatureExtractor due to size parameter in config.`);\n feature_extractor_class = ImageFeatureExtractor;\n } else {\n throw new Error(`Unknown Feature Extractor type: ${key}`);\n }\n }\n\n // If no associated processor class, use default\n let processor_class = this.PROCESSOR_CLASS_MAPPING[preprocessorConfig.processor_class] ?? Processor;\n\n // Instantiate processor and feature extractor\n let feature_extractor = new feature_extractor_class(preprocessorConfig);\n return new processor_class(feature_extractor);\n }\n}\n//////////////////////////////////////////////////\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/processors.js?"); /***/ }), @@ -337,7 +3669,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AlbertTokenizer: () => (/* binding */ AlbertTokenizer),\n/* harmony export */ AutoTokenizer: () => (/* binding */ AutoTokenizer),\n/* harmony export */ BartTokenizer: () => (/* binding */ BartTokenizer),\n/* harmony export */ BertTokenizer: () => (/* binding */ BertTokenizer),\n/* harmony export */ BlenderbotSmallTokenizer: () => (/* binding */ BlenderbotSmallTokenizer),\n/* harmony export */ BlenderbotTokenizer: () => (/* binding */ BlenderbotTokenizer),\n/* harmony export */ BloomTokenizer: () => (/* binding */ BloomTokenizer),\n/* harmony export */ CLIPTokenizer: () => (/* binding */ CLIPTokenizer),\n/* harmony export */ CamembertTokenizer: () => (/* binding */ CamembertTokenizer),\n/* harmony export */ CodeGenTokenizer: () => (/* binding */ CodeGenTokenizer),\n/* harmony export */ CodeLlamaTokenizer: () => (/* binding */ CodeLlamaTokenizer),\n/* harmony export */ ConvBertTokenizer: () => (/* binding */ ConvBertTokenizer),\n/* harmony export */ DebertaTokenizer: () => (/* binding */ DebertaTokenizer),\n/* harmony export */ DebertaV2Tokenizer: () => (/* binding */ DebertaV2Tokenizer),\n/* harmony export */ DistilBertTokenizer: () => (/* binding */ DistilBertTokenizer),\n/* harmony export */ ElectraTokenizer: () => (/* binding */ ElectraTokenizer),\n/* harmony export */ EsmTokenizer: () => (/* binding */ EsmTokenizer),\n/* harmony export */ FalconTokenizer: () => (/* binding */ FalconTokenizer),\n/* harmony export */ GPT2Tokenizer: () => (/* binding */ GPT2Tokenizer),\n/* harmony export */ GPTNeoXTokenizer: () => (/* binding */ GPTNeoXTokenizer),\n/* harmony export */ GemmaTokenizer: () => (/* binding */ GemmaTokenizer),\n/* harmony export */ HerbertTokenizer: () => (/* binding */ HerbertTokenizer),\n/* harmony export */ LlamaTokenizer: () => (/* binding */ LlamaTokenizer),\n/* harmony export */ M2M100Tokenizer: () => (/* binding */ M2M100Tokenizer),\n/* harmony export */ MBart50Tokenizer: () => (/* binding */ MBart50Tokenizer),\n/* harmony export */ MBartTokenizer: () => (/* binding */ MBartTokenizer),\n/* harmony export */ MPNetTokenizer: () => (/* binding */ MPNetTokenizer),\n/* harmony export */ MarianTokenizer: () => (/* binding */ MarianTokenizer),\n/* harmony export */ MobileBertTokenizer: () => (/* binding */ MobileBertTokenizer),\n/* harmony export */ NllbTokenizer: () => (/* binding */ NllbTokenizer),\n/* harmony export */ NougatTokenizer: () => (/* binding */ NougatTokenizer),\n/* harmony export */ PreTrainedTokenizer: () => (/* binding */ PreTrainedTokenizer),\n/* harmony export */ Qwen2Tokenizer: () => (/* binding */ Qwen2Tokenizer),\n/* harmony export */ RoFormerTokenizer: () => (/* binding */ RoFormerTokenizer),\n/* harmony export */ RobertaTokenizer: () => (/* binding */ RobertaTokenizer),\n/* harmony export */ SiglipTokenizer: () => (/* binding */ SiglipTokenizer),\n/* harmony export */ SpeechT5Tokenizer: () => (/* binding */ SpeechT5Tokenizer),\n/* harmony export */ SqueezeBertTokenizer: () => (/* binding */ SqueezeBertTokenizer),\n/* harmony export */ T5Tokenizer: () => (/* binding */ T5Tokenizer),\n/* harmony export */ TokenizerModel: () => (/* binding */ TokenizerModel),\n/* harmony export */ VitsTokenizer: () => (/* binding */ VitsTokenizer),\n/* harmony export */ Wav2Vec2CTCTokenizer: () => (/* binding */ Wav2Vec2CTCTokenizer),\n/* harmony export */ WhisperTokenizer: () => (/* binding */ WhisperTokenizer),\n/* harmony export */ XLMRobertaTokenizer: () => (/* binding */ XLMRobertaTokenizer),\n/* harmony export */ XLMTokenizer: () => (/* binding */ XLMTokenizer)\n/* harmony export */ });\n/* harmony import */ var _utils_core_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/core.js */ \"./node_modules/@xenova/transformers/src/utils/core.js\");\n/* harmony import */ var _utils_hub_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/hub.js */ \"./node_modules/@xenova/transformers/src/utils/hub.js\");\n/* harmony import */ var _utils_maths_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/maths.js */ \"./node_modules/@xenova/transformers/src/utils/maths.js\");\n/* harmony import */ var _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/tensor.js */ \"./node_modules/@xenova/transformers/src/utils/tensor.js\");\n/* harmony import */ var _utils_data_structures_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/data-structures.js */ \"./node_modules/@xenova/transformers/src/utils/data-structures.js\");\n/* harmony import */ var _huggingface_jinja__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @huggingface/jinja */ \"./node_modules/@huggingface/jinja/dist/index.js\");\n\n/**\n * @file Tokenizers are used to prepare textual inputs for a model.\n * \n * **Example:** Create an `AutoTokenizer` and use it to tokenize a sentence.\n * This will automatically detect the tokenizer type based on the tokenizer class defined in `tokenizer.json`.\n * ```javascript\n * import { AutoTokenizer } from '@xenova/transformers';\n * \n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/bert-base-uncased');\n * const { input_ids } = await tokenizer('I love transformers!');\n * // Tensor {\n * // data: BigInt64Array(6) [101n, 1045n, 2293n, 19081n, 999n, 102n],\n * // dims: [1, 6],\n * // type: 'int64',\n * // size: 6,\n * // }\n * ```\n * \n * @module tokenizers\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @typedef {Object} TokenizerProperties Additional tokenizer-specific properties.\n * @property {boolean} [legacy=false] Whether or not the `legacy` behavior of the tokenizer should be used.\n * @typedef {import('./utils/hub.js').PretrainedOptions & TokenizerProperties} PretrainedTokenizerOptions\n */\n\n/**\n * Loads a tokenizer from the specified path.\n * @param {string} pretrained_model_name_or_path The path to the tokenizer directory.\n * @param {PretrainedTokenizerOptions} options Additional options for loading the tokenizer.\n * @returns {Promise} A promise that resolves with information about the loaded tokenizer.\n */\nasync function loadTokenizer(pretrained_model_name_or_path, options) {\n\n const info = await Promise.all([\n (0,_utils_hub_js__WEBPACK_IMPORTED_MODULE_1__.getModelJSON)(pretrained_model_name_or_path, 'tokenizer.json', true, options),\n (0,_utils_hub_js__WEBPACK_IMPORTED_MODULE_1__.getModelJSON)(pretrained_model_name_or_path, 'tokenizer_config.json', true, options),\n ])\n\n // Override legacy option if `options.legacy` is not null\n if (options.legacy !== null) {\n info[1].legacy = options.legacy;\n }\n return info;\n}\n\n\n/**\n * Helper function to split a string on a regex, but keep the delimiters.\n * This is required, because the JavaScript `.split()` method does not keep the delimiters,\n * and wrapping in a capturing group causes issues with existing capturing groups (due to nesting).\n * @param {string} text The text to split.\n * @param {RegExp} regex The regex to split on.\n * @returns {string[]} The split string.\n */\nfunction regexSplit(text, regex) {\n const result = [];\n let prev = 0;\n for (const match of text.matchAll(regex)) {\n const fullMatch = match[0];\n if (prev < match.index) {\n result.push(text.slice(prev, match.index));\n }\n if (fullMatch.length > 0) {\n result.push(fullMatch);\n }\n prev = match.index + fullMatch.length;\n }\n if (prev < text.length) {\n result.push(text.slice(prev));\n }\n return result;\n}\n\n\n/**\n * Helper method to construct a pattern from a config object.\n * @param {Object} pattern The pattern object.\n * @param {boolean} invert Whether to invert the pattern.\n * @returns {RegExp|null} The compiled pattern.\n */\nfunction createPattern(pattern, invert = true) {\n\n if (pattern.Regex !== undefined) {\n // In certain cases, the pattern may contain unnecessary escape sequences (e.g., \\# or \\& or \\~).\n // i.e., valid in Python (where the patterns are exported from) but invalid in JavaScript (where the patterns are parsed).\n // This isn't an issue when creating the regex w/o the 'u' flag, but it is when the 'u' flag is used.\n // For this reason, it is necessary to remove these backslashes before creating the regex.\n // See https://stackoverflow.com/a/63007777/13989043 for more information\n let regex = pattern.Regex.replace(/\\\\([#&~])/g, '$1'); // TODO: add more characters to this list if necessary\n\n // We also handle special cases where the regex contains invalid (non-JS compatible) syntax.\n for (const [key, value] of PROBLEMATIC_REGEX_MAP) {\n regex = regex.replaceAll(key, value);\n }\n\n return new RegExp(regex, 'gu');\n\n } else if (pattern.String !== undefined) {\n const escaped = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.escapeRegExp)(pattern.String);\n // NOTE: if invert is true, we wrap the pattern in a group so that it is kept when performing .split()\n return new RegExp(invert ? escaped : `(${escaped})`, 'gu');\n\n } else {\n console.warn('Unknown pattern type:', pattern)\n return null;\n }\n}\n\n/**\n * Helper function to convert an Object to a Map\n * @param {Object} obj The object to convert.\n * @returns {Map} The map.\n */\nfunction objectToMap(obj) {\n return new Map(Object.entries(obj));\n}\n\n/**\n * Helper function to convert a tensor to a list before decoding.\n * @param {Tensor} tensor The tensor to convert.\n * @returns {number[]} The tensor as a list.\n */\nfunction prepareTensorForDecode(tensor) {\n const dims = tensor.dims;\n switch (dims.length) {\n case 1:\n return tensor.tolist();\n case 2:\n if (dims[0] !== 1) {\n throw new Error('Unable to decode tensor with `batch size !== 1`. Use `tokenizer.batch_decode(...)` for batched inputs.');\n }\n return tensor.tolist()[0];\n default:\n throw new Error(`Expected tensor to have 1-2 dimensions, got ${dims.length}.`)\n }\n}\n\n/**\n * Clean up a list of simple English tokenization artifacts like spaces before punctuations and abbreviated forms\n * @param {string} text The text to clean up.\n * @returns {string} The cleaned up text.\n */\nfunction clean_up_tokenization(text) {\n // Clean up a list of simple English tokenization artifacts\n // like spaces before punctuations and abbreviated forms\n return text.replace(/ \\./g, '.')\n .replace(/ \\?/g, '?')\n .replace(/ \\!/g, '!')\n .replace(/ ,/g, ',')\n .replace(/ \\' /g, \"'\")\n .replace(/ n\\'t/g, \"n't\")\n .replace(/ \\'m/g, \"'m\")\n .replace(/ \\'s/g, \"'s\")\n .replace(/ \\'ve/g, \"'ve\")\n .replace(/ \\'re/g, \"'re\");\n}\n\n/**\n * Helper function to remove accents from a string.\n * @param {string} text The text to remove accents from.\n * @returns {string} The text with accents removed.\n */\nfunction remove_accents(text) {\n return text.replace(/[\\u0300-\\u036f]/g, '');\n}\n\n/**\n * Helper function to lowercase a string and remove accents.\n * @param {string} text The text to lowercase and remove accents from.\n * @returns {string} The lowercased text with accents removed.\n */\nfunction lowercase_and_remove_accent(text) {\n return remove_accents(text.toLowerCase());\n}\n\n/**\n * Helper function to fuse consecutive values in an array equal to the specified value.\n * @param {string[]} arr The input array\n * @param {any} value The value to fuse on.\n * @param {Map} mapping The mapping from input domain to value.\n */\nfunction fuse(arr, value, mapping) {\n const fused = [];\n let i = 0;\n while (i < arr.length) {\n fused.push(arr[i])\n if ((mapping.get(arr[i]) ?? value) !== value) {\n ++i;\n continue;\n }\n\n while (i < arr.length && (mapping.get(arr[i]) ?? value) === value) {\n ++i;\n }\n }\n\n return fused;\n}\n\n/**\n * Split a string on whitespace.\n * @param {string} text The text to split.\n * @returns {string[]} The split string.\n */\nfunction whitespace_split(text) {\n return text.match(/\\S+/g) || [];\n}\n\nconst PUNCTUATION_REGEX = '\\\\p{P}\\\\u0021-\\\\u002F\\\\u003A-\\\\u0040\\\\u005B-\\\\u0060\\\\u007B-\\\\u007E';\n\n// A mapping of regex patterns to their equivalent (but longer) JS-compatible versions.\nconst PROBLEMATIC_REGEX_MAP = new Map([\n // This uses the case insensitive group modifier, which is not supported in JavaScript.\n // When parsing the regex, an \"Invalid group\" error is thrown.\n [\"(?i:'s|'t|'re|'ve|'m|'ll|'d)\", \"(?:'([sS]|[tT]|[rR][eE]|[vV][eE]|[mM]|[lL][lL]|[dD]))\"],\n])\n\n\n/**\n * Represent a token added by the user on top of the existing Model vocabulary.\n * AddedToken can be configured to specify the behavior they should have in various situations like:\n * - Whether they should only match single words\n * - Whether to include any whitespace on its left or right\n */\nclass AddedToken {\n /**\n * Creates a new instance of AddedToken.\n * @param {Object} config Added token configuration object.\n * @param {string} config.content The content of the added token.\n * @param {number} config.id The id of the added token.\n * @param {boolean} [config.single_word=false] Whether this token must be a single word or can break words.\n * @param {boolean} [config.lstrip=false] Whether this token should strip whitespaces on its left.\n * @param {boolean} [config.rstrip=false] Whether this token should strip whitespaces on its right.\n * @param {boolean} [config.normalized=false] Whether this token should be normalized.\n * @param {boolean} [config.special=false] Whether this token is special.\n */\n constructor(config) {\n this.content = config.content;\n this.id = config.id;\n this.single_word = config.single_word ?? false;\n this.lstrip = config.lstrip ?? false;\n this.rstrip = config.rstrip ?? false;\n this.special = config.special ?? false;\n this.normalized = config.normalized ?? null;\n }\n}\n\n/**\n * Abstract base class for tokenizer models.\n *\n * @extends Callable\n */\nclass TokenizerModel extends _utils_core_js__WEBPACK_IMPORTED_MODULE_0__.Callable {\n /**\n * Creates a new instance of TokenizerModel.\n * @param {Object} config The configuration object for the TokenizerModel.\n */\n constructor(config) {\n super();\n this.config = config;\n\n /** @type {string[]} */\n this.vocab = [];\n\n /**\n * A mapping of tokens to ids.\n * @type {Map}\n */\n this.tokens_to_ids = new Map();\n\n this.unk_token_id = undefined;\n this.unk_token = undefined;\n this.end_of_word_suffix = undefined;\n\n /** @type {boolean} Whether to fuse unknown tokens when encoding. Defaults to false. */\n this.fuse_unk = this.config.fuse_unk ?? false;\n }\n\n /**\n * Instantiates a new TokenizerModel instance based on the configuration object provided.\n * @param {Object} config The configuration object for the TokenizerModel.\n * @param {...*} args Optional arguments to pass to the specific TokenizerModel constructor.\n * @returns {TokenizerModel} A new instance of a TokenizerModel.\n * @throws Will throw an error if the TokenizerModel type in the config is not recognized.\n */\n static fromConfig(config, ...args) {\n switch (config.type) {\n case 'WordPiece':\n return new WordPieceTokenizer(config);\n case 'Unigram':\n // @ts-ignore\n return new Unigram(config, ...args);\n\n case 'BPE':\n return new BPE(config);\n\n default:\n if (config.vocab) {\n // @ts-ignore\n return new LegacyTokenizerModel(config, ...args);\n }\n throw new Error(`Unknown TokenizerModel type: ${config.type}`);\n }\n }\n\n /**\n * Internal function to call the TokenizerModel instance.\n * @param {string[]} tokens The tokens to encode.\n * @returns {string[]} The encoded token IDs.\n */\n _call(tokens) {\n let ids = this.encode(tokens);\n if (this.fuse_unk) {\n // Fuse unknown tokens\n ids = fuse(ids, this.unk_token_id, this.tokens_to_ids);\n }\n return ids;\n }\n\n /**\n * Encodes a list of tokens into a list of token IDs.\n * @param {string[]} tokens The tokens to encode.\n * @returns {string[]} The encoded tokens.\n * @throws Will throw an error if not implemented in a subclass.\n */\n encode(tokens) {\n throw Error(\"encode should be implemented in subclass.\")\n }\n\n /**\n * Converts a list of tokens into a list of token IDs.\n * @param {string[]} tokens The tokens to convert.\n * @returns {number[]} The converted token IDs.\n */\n convert_tokens_to_ids(tokens) {\n return tokens.map(t => this.tokens_to_ids.get(t) ?? this.unk_token_id);\n }\n\n /**\n * Converts a list of token IDs into a list of tokens.\n * @param {number[]} ids The token IDs to convert.\n * @returns {string[]} The converted tokens.\n */\n convert_ids_to_tokens(ids) {\n return ids.map(i => this.vocab[i] ?? this.unk_token);\n }\n}\n\n/**\n * A subclass of TokenizerModel that uses WordPiece encoding to encode tokens.\n * @extends TokenizerModel\n */\nclass WordPieceTokenizer extends TokenizerModel {\n /**\n * @param {Object} config The configuration object.\n * @param {Object} config.vocab A mapping of tokens to ids.\n * @param {string} config.unk_token The unknown token string.\n * @param {string} config.continuing_subword_prefix The prefix to use for continuing subwords.\n * @param {number} [config.max_input_chars_per_word=100] The maximum number of characters per word.\n */\n constructor(config) {\n super(config);\n /**\n * A mapping of tokens to ids.\n * @type {Map}\n */\n this.tokens_to_ids = objectToMap(config.vocab);\n\n /**\n * The id of the unknown token.\n * @type {number}\n */\n this.unk_token_id = this.tokens_to_ids.get(config.unk_token);\n\n /**\n * The unknown token string.\n * @type {string}\n */\n this.unk_token = config.unk_token;\n\n /**\n * The maximum number of characters allowed per word.\n * @type {number}\n */\n this.max_input_chars_per_word = config.max_input_chars_per_word ?? 100;\n\n /**\n * An array of tokens.\n * @type {string[]}\n */\n this.vocab = new Array(this.tokens_to_ids.size);\n for (const [key, value] of this.tokens_to_ids) {\n this.vocab[value] = key;\n }\n }\n\n /**\n * Encodes an array of tokens using WordPiece encoding.\n * @param {string[]} tokens The tokens to encode.\n * @returns {string[]} An array of encoded tokens.\n */\n encode(tokens) {\n const outputTokens = [];\n for (const token of tokens) {\n const chars = [...token];\n if (chars.length > this.max_input_chars_per_word) {\n outputTokens.push(this.unk_token);\n continue;\n }\n\n let isUnknown = false;\n let start = 0;\n const subTokens = [];\n\n while (start < chars.length) {\n let end = chars.length;\n let currentSubstring = null;\n while (start < end) {\n let substr = chars.slice(start, end).join('');\n\n if (start > 0) {\n substr = this.config.continuing_subword_prefix + substr;\n }\n if (this.tokens_to_ids.has(substr)) {\n currentSubstring = substr;\n break;\n }\n\n --end;\n }\n if (currentSubstring === null) {\n isUnknown = true;\n break;\n }\n subTokens.push(currentSubstring);\n start = end;\n }\n if (isUnknown) {\n outputTokens.push(this.unk_token);\n } else {\n outputTokens.push(...subTokens);\n }\n }\n\n return outputTokens;\n }\n\n}\n\n/**\n * Class representing a Unigram tokenizer model.\n * @extends TokenizerModel\n */\nclass Unigram extends TokenizerModel {\n /**\n * Create a new Unigram tokenizer model.\n * @param {Object} config The configuration object for the Unigram model.\n * @param {number} config.unk_id The ID of the unknown token\n * @param {any[][]} config.vocab A 2D array representing a mapping of tokens to scores.\n * @param {Object} moreConfig Additional configuration object for the Unigram model.\n */\n constructor(config, moreConfig) {\n super(config);\n\n const vocabSize = config.vocab.length;\n this.vocab = new Array(vocabSize);\n this.scores = new Array(vocabSize);\n for (let i = 0; i < vocabSize; ++i) {\n const piece = config.vocab[i];\n this.vocab[i] = piece[0];\n this.scores[i] = piece[1];\n }\n\n this.unk_token_id = config.unk_id;\n this.unk_token = this.vocab[config.unk_id];\n\n this.tokens_to_ids = new Map(this.vocab.map((x, i) => [x, i]));\n this.bosToken = ' '; // beginning of a sentence token\n\n this.bosTokenId = this.tokens_to_ids.get(this.bosToken); // NOTE: may be undefined\n this.eosToken = moreConfig.eos_token;\n\n this.eosTokenId = this.tokens_to_ids.get(this.eosToken);\n this.unkToken = this.vocab[this.unk_token_id];\n\n this.minScore = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.min)(this.scores)[0];\n\n this.unkScore = this.minScore - 10.0;\n this.scores[this.unk_token_id] = this.unkScore;\n\n this.trie = new _utils_data_structures_js__WEBPACK_IMPORTED_MODULE_4__.CharTrie();\n this.trie.extend(this.vocab);\n\n // NOTE: `fuse_unk` is hardcoded to true for Unigram models\n // See: https://github.com/huggingface/tokenizers/blob/b58227c7f1ccf8b73ee2268354336da56d91e492/tokenizers/src/models/unigram/model.rs#L119\n this.fuse_unk = true;\n }\n\n /**\n * Populates lattice nodes.\n * @param {TokenLattice} lattice The token lattice to populate with nodes.\n */\n populateNodes(lattice) {\n const sentence = lattice.sentence;\n const len = sentence.length;\n let beginPos = 0;\n while (beginPos < len) {\n const mblen = 1;\n let hasSingleNode = false;\n const tokens = [];\n\n for (let token of this.trie.commonPrefixSearch(sentence.slice(beginPos))) {\n tokens.push(token);\n const tokenId = this.tokens_to_ids.get(token);\n const tokenScore = this.scores[tokenId];\n const n = token.length;\n lattice.insert(beginPos, n, tokenScore, tokenId);\n if (!hasSingleNode && n === mblen) {\n hasSingleNode = true;\n }\n }\n if (!hasSingleNode) {\n lattice.insert(beginPos, mblen, this.unkScore, this.unk_token_id);\n }\n beginPos += mblen;\n }\n }\n\n /**\n * Encodes an array of tokens into an array of subtokens using the unigram model.\n *\n * @param {string} normalized The normalized string.\n * @returns {string[]} An array of subtokens obtained by encoding the input tokens using the unigram model.\n */\n tokenize(normalized) {\n const lattice = new _utils_data_structures_js__WEBPACK_IMPORTED_MODULE_4__.TokenLattice(normalized, this.bosTokenId, this.eosTokenId);\n this.populateNodes(lattice);\n return lattice.tokens();\n }\n\n /**\n * Encodes an array of tokens using Unigram encoding.\n * @param {string[]} tokens The tokens to encode.\n * @returns {string[]} An array of encoded tokens.\n */\n encode(tokens) {\n const toReturn = [];\n for (const token of tokens) {\n const tokenized = this.tokenize(token);\n toReturn.push(...tokenized);\n }\n return toReturn;\n }\n\n}\n\n/**\n * Returns list of utf-8 byte and a mapping to unicode strings.\n * Specifically avoids mapping to whitespace/control characters the BPE code barfs on.\n * @returns {Object} Object with utf-8 byte keys and unicode string values.\n */\nconst BYTES_TO_UNICODE = (() => {\n // Returns list of utf-8 byte and a mapping to unicode strings.\n // We specifically avoids mapping to whitespace/control characters\n // the bpe code barfs on.\n\n const bs = [\n ...Array.from({ length: \"~\".charCodeAt(0) - \"!\".charCodeAt(0) + 1 }, (_, i) => i + \"!\".charCodeAt(0)),\n ...Array.from({ length: \"¬\".charCodeAt(0) - \"¡\".charCodeAt(0) + 1 }, (_, i) => i + \"¡\".charCodeAt(0)),\n ...Array.from({ length: \"ÿ\".charCodeAt(0) - \"®\".charCodeAt(0) + 1 }, (_, i) => i + \"®\".charCodeAt(0)),\n ];\n const cs = bs.slice();\n let n = 0;\n for (let b = 0; b < 256; ++b) {\n if (!bs.includes(b)) {\n bs.push(b);\n cs.push(256 + n);\n n += 1;\n }\n }\n const ccs = cs.map(n => String.fromCharCode(n));\n return Object.fromEntries(bs.map((b, i) => [b, ccs[i]]));\n})();\n\nconst UNICODE_TO_BYTES = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.reverseDictionary)(BYTES_TO_UNICODE);\n\n\n/**\n * @typedef {Object} BPENode\n * @property {string} token The token associated with the node\n * @property {number} bias A positional bias for the node.\n * @property {number} [score] The score of the node.\n * @property {BPENode} [prev] The previous node in the linked list.\n * @property {BPENode} [next] The next node in the linked list.\n */\n\n/**\n * BPE class for encoding text into Byte-Pair-Encoding (BPE) tokens.\n * @extends TokenizerModel\n */\nclass BPE extends TokenizerModel {\n /**\n * Create a BPE instance.\n * @param {Object} config The configuration object for BPE.\n * @param {Object} config.vocab A mapping of tokens to ids.\n * @param {string} config.unk_token The unknown token used for out of vocabulary words.\n * @param {string} config.end_of_word_suffix The suffix to place at the end of each word.\n * @param {string} [config.continuing_subword_suffix] The suffix to insert between words.\n * @param {Array} config.merges An array of BPE merges as strings.\n */\n constructor(config) {\n super(config);\n\n this.BPE_SPLIT_TOKEN = ' ';\n\n /** @type {Map} */\n this.tokens_to_ids = objectToMap(config.vocab);\n\n this.unk_token_id = this.tokens_to_ids.get(config.unk_token);\n this.unk_token = config.unk_token;\n\n this.vocab = new Array(this.tokens_to_ids.size);\n for (const [key, value] of this.tokens_to_ids) {\n this.vocab[value] = key;\n }\n\n this.bpe_ranks = new Map(config.merges.map((x, i) => [x, i]));\n this.merges = config.merges.map(x => x.split(this.BPE_SPLIT_TOKEN));\n\n this.end_of_word_suffix = config.end_of_word_suffix;\n\n // NOTE: `continuing_subword_suffix` is custom (to support `BlenderbotSmallTokenizer`)\n this.continuing_subword_suffix = config.continuing_subword_suffix ?? null;\n\n this.byte_fallback = this.config.byte_fallback ?? false;\n\n if (this.byte_fallback) {\n this.text_encoder = new TextEncoder();\n }\n\n /** @type {Map} */\n this.cache = new Map();\n }\n\n /**\n * Apply Byte-Pair-Encoding (BPE) to a given token. Efficient heap-based priority\n * queue implementation adapted from https://github.com/belladoreai/llama-tokenizer-js.\n * @param {string} token The token to encode.\n * @returns {string[]} The BPE encoded tokens.\n */\n bpe(token) {\n if (token.length === 0) {\n return [];\n }\n\n const cached = this.cache.get(token);\n if (cached !== undefined) {\n return cached;\n }\n\n const word = Array.from(token);\n if (this.end_of_word_suffix) {\n word[word.length - 1] += this.end_of_word_suffix;\n }\n\n let result = [];\n if (word.length > 1) {\n // Create a priority queue to store the nodes that will be merged.\n // The comparator function compares the scores of the nodes.\n const queue = new _utils_data_structures_js__WEBPACK_IMPORTED_MODULE_4__.PriorityQueue((a, b) => a.score < b.score);\n\n // Construct a doubly-linked list of nodes that will be inserted into the priority queue,\n // starting with the individual characters. We also populate each node with a positional\n // bias to break ties in the priority queue.\n let startingNode = {\n token: word[0],\n bias: 0,\n prev: null,\n next: null,\n }\n\n let previousNode = startingNode\n for (let i = 1; i < word.length; ++i) {\n const currentNode = {\n bias: i / word.length, // Add fractional component to break ties\n token: word[i],\n prev: previousNode,\n next: null,\n }\n previousNode.next = currentNode\n this._add_node(queue, previousNode)\n previousNode = currentNode\n }\n\n while (!queue.isEmpty()) {\n // Get the next node with the highest priority\n const node = queue.pop();\n\n // Check that this merge is still possible\n if (node.deleted || !node.next || node.next.deleted) continue;\n\n // Here, we mark the current node (left side of the merge) and the next node (right side of the merge) as deleted.\n // This is because they will both be replaced by a new node representing the merge result.\n node.deleted = true;\n node.next.deleted = true;\n\n // Next, we fix the node that comes before the current node (i.e., left side of the merge).\n if (node.prev) {\n\n // Make a shallow copy of the previous node\n const newPreviousNode = { ...node.prev };\n\n // Mark the old previous node as deleted. This avoids erroneous merges later,\n // because there may still be references to this node in the priority queue.\n node.prev.deleted = true;\n node.prev = newPreviousNode;\n\n // Update the reference of the previous node, by pointing its previous node to this new previous node.\n if (newPreviousNode.prev) {\n newPreviousNode.prev.next = newPreviousNode;\n } else {\n // If the previous of the previous node does not exist, it means that\n // `newPreviousNode` must be the new `startingNode`.\n startingNode = newPreviousNode;\n }\n }\n\n // Create a new node which represents the result of the merge.\n const merged = {\n token: node.token + node.next.token,\n bias: node.bias,\n prev: node.prev,\n next: node.next.next,\n }\n\n // We now consider where we can add the new merged node to the priority queue:\n // 1. prev <-> merged\n if (merged.prev) {\n merged.prev.next = merged;\n this._add_node(queue, merged.prev);\n } else {\n // If `merged.prev` does not exist, then `merged` must be the new `startingNode`.\n startingNode = merged;\n }\n\n // 2. merged <-> next\n if (merged.next) {\n merged.next.prev = merged;\n this._add_node(queue, merged);\n }\n }\n\n // Traverse the linked list, starting from the `startingNode`, and collect the tokens.\n for (let currentNode = startingNode; currentNode !== null; currentNode = currentNode.next) {\n result.push(currentNode.token);\n }\n } else {\n result = word;\n }\n\n // Possibly append suffix\n if (this.continuing_subword_suffix) {\n // Do not append suffix to the last token\n for (let i = 0; i < result.length - 1; ++i) {\n result[i] += this.continuing_subword_suffix;\n }\n }\n\n // Save the result to the cache\n this.cache.set(token, result);\n\n return result;\n }\n\n\n /**\n * Helper function to add a node to the priority queue.\n * @param {PriorityQueue} queue \n * @param {BPENode} node\n * @private\n */\n _add_node(queue, node) {\n // `score` is a measure of the merge priority: lower means higher priority\n // We use the BPE rank as a measure of priority (i.e., the local of the merge in the merges list)\n // We also add a fractional component to the score to break ties (with the earlier character having higher priority)\n const rank = this.bpe_ranks.get(node.token + this.BPE_SPLIT_TOKEN + node.next.token);\n if (rank !== undefined) {\n node.score = rank + node.bias;\n queue.push(node);\n }\n }\n\n /**\n * Encodes the input sequence of tokens using the BPE algorithm and returns the resulting subword tokens.\n * @param {string[]} tokens The input sequence of tokens to encode.\n * @returns {string[]} The resulting subword tokens after applying the BPE algorithm to the input sequence of tokens.\n */\n encode(tokens) {\n const outputTokens = [];\n\n for (const token of tokens) {\n const bpe_token_list = this.bpe(token);\n\n for (const t of bpe_token_list) {\n if (this.tokens_to_ids.has(t)) {\n outputTokens.push(t);\n } else {\n if (this.byte_fallback) {\n outputTokens.push(\n ...Array.from(this.text_encoder.encode(t))\n .map(x => `<0x${x.toString(16).toUpperCase().padStart(2, '0')}>`)\n );\n } else {\n outputTokens.push(this.unk_token);\n }\n }\n }\n }\n\n return outputTokens;\n }\n\n}\n\n/**\n * Legacy tokenizer class for tokenizers with only a vocabulary.\n */\nclass LegacyTokenizerModel extends TokenizerModel {\n /**\n * Create a LegacyTokenizerModel instance.\n * @param {Object} config The configuration object for LegacyTokenizerModel.\n * @param {Object} config.vocab A (possibly nested) mapping of tokens to ids.\n * @param {Object} moreConfig Additional configuration object for the LegacyTokenizerModel model.\n */\n constructor(config, moreConfig) {\n super(config);\n\n /**@type {Map} */\n this.tokens_to_ids = objectToMap(\n moreConfig.target_lang\n ? config.vocab[moreConfig.target_lang]\n : config.vocab\n );\n\n this.bos_token = moreConfig.bos_token;\n this.bos_token_id = this.tokens_to_ids.get(this.bos_token);\n\n this.eos_token = moreConfig.eos_token;\n this.eos_token_id = this.tokens_to_ids.get(this.eos_token);\n\n this.pad_token = moreConfig.pad_token;\n this.pad_token_id = this.tokens_to_ids.get(this.pad_token);\n\n this.unk_token = moreConfig.unk_token;\n this.unk_token_id = this.tokens_to_ids.get(this.unk_token);\n\n this.vocab = new Array(this.tokens_to_ids.size);\n for (const [key, value] of this.tokens_to_ids) {\n this.vocab[value] = key;\n }\n }\n\n encode(tokens) {\n return tokens;\n }\n}\n\n\n/**\n * A base class for text normalization.\n * @abstract\n */\nclass Normalizer extends _utils_core_js__WEBPACK_IMPORTED_MODULE_0__.Callable {\n /**\n * @param {Object} config The configuration object for the normalizer.\n */\n constructor(config) {\n super();\n this.config = config;\n }\n\n /**\n * Factory method for creating normalizers from config objects.\n * @static\n * @param {Object} config The configuration object for the normalizer.\n * @returns {Normalizer} A Normalizer object.\n * @throws {Error} If an unknown Normalizer type is specified in the config.\n */\n static fromConfig(config) {\n if (config === null) return null;\n switch (config.type) {\n case 'BertNormalizer':\n return new BertNormalizer(config);\n case 'Precompiled':\n return new Precompiled(config);\n case 'Sequence':\n return new NormalizerSequence(config);\n case 'Replace':\n return new Replace(config);\n case 'NFC':\n return new NFC(config);\n case 'NFKC':\n return new NFKC(config);\n case 'NFKD':\n return new NFKD(config);\n case 'Strip':\n return new StripNormalizer(config);\n case 'StripAccents':\n return new StripAccents(config);\n case 'Lowercase':\n return new Lowercase(config);\n case 'Prepend':\n return new Prepend(config);\n default:\n throw new Error(`Unknown Normalizer type: ${config.type}`);\n }\n }\n\n /**\n * Normalize the input text.\n * @abstract\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n * @throws {Error} If this method is not implemented in a subclass.\n */\n normalize(text) {\n throw Error(\"normalize should be implemented in subclass.\")\n }\n\n /**\n * Alias for {@link Normalizer#normalize}.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n _call(text) {\n return this.normalize(text);\n }\n\n}\n\n/**\n * Replace normalizer that replaces occurrences of a pattern with a given string or regular expression.\n * @extends Normalizer\n */\nclass Replace extends Normalizer {\n /**\n * Normalize the input text by replacing the pattern with the content.\n * @param {string} text The input text to be normalized.\n * @returns {string} The normalized text after replacing the pattern with the content.\n */\n normalize(text) {\n const pattern = createPattern(this.config.pattern);\n return pattern === null\n ? text\n : text.replaceAll(pattern, this.config.content);\n }\n}\n\n/**\n * A normalizer that applies Unicode normalization form C (NFC) to the input text.\n * @extends Normalizer\n */\nclass NFC extends Normalizer {\n /**\n * Normalize the input text by applying Unicode normalization form C (NFC).\n * @param {string} text The input text to be normalized.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n text = text.normalize('NFC')\n return text;\n }\n}\n\n/**\n * NFKC Normalizer.\n * @extends Normalizer\n */\nclass NFKC extends Normalizer {\n /**\n * Normalize text using NFKC normalization.\n * @param {string} text The text to be normalized.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n text = text.normalize('NFKC')\n return text;\n }\n}\n/**\n * NFKD Normalizer.\n * @extends Normalizer\n */\nclass NFKD extends Normalizer {\n /**\n * Normalize text using NFKD normalization.\n * @param {string} text The text to be normalized.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n text = text.normalize('NFKD')\n return text;\n }\n}\n\n/**\n * A normalizer that strips leading and/or trailing whitespace from the input text.\n */\nclass StripNormalizer extends Normalizer {\n /**\n * Strip leading and/or trailing whitespace from the input text.\n * @param {string} text The input text.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n if (this.config.strip_left && this.config.strip_right) {\n // Fast path to avoid an extra trim call\n text = text.trim();\n } else {\n if (this.config.strip_left) {\n text = text.trimStart();\n }\n if (this.config.strip_right) {\n text = text.trimEnd();\n }\n }\n return text;\n }\n}\n\n/**\n * StripAccents normalizer removes all accents from the text.\n * @extends Normalizer\n */\nclass StripAccents extends Normalizer {\n /**\n * Remove all accents from the text.\n * @param {string} text The input text.\n * @returns {string} The normalized text without accents.\n */\n normalize(text) {\n text = remove_accents(text);\n return text;\n }\n}\n\n/**\n * A Normalizer that lowercases the input string.\n * @extends Normalizer\n */\nclass Lowercase extends Normalizer {\n /**\n * Lowercases the input string.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n text = text.toLowerCase();\n return text;\n }\n}\n\n/**\n * A Normalizer that prepends a string to the input string.\n * @extends Normalizer\n */\nclass Prepend extends Normalizer {\n /**\n * Prepends the input string.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n text = this.config.prepend + text;\n return text;\n }\n}\n\n/**\n * A Normalizer that applies a sequence of Normalizers.\n * @extends Normalizer\n */\nclass NormalizerSequence extends Normalizer {\n /**\n * Create a new instance of NormalizerSequence.\n * @param {Object} config The configuration object.\n * @param {Object[]} config.normalizers An array of Normalizer configuration objects.\n */\n constructor(config) {\n super(config);\n this.normalizers = config.normalizers.map(x => Normalizer.fromConfig(x));\n }\n /**\n * Apply a sequence of Normalizers to the input text.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n return this.normalizers.reduce((t, normalizer) => {\n return normalizer.normalize(t);\n }, text);\n }\n}\n\n/**\n * A class representing a normalizer used in BERT tokenization.\n * @extends Normalizer\n */\nclass BertNormalizer extends Normalizer {\n /**\n * Adds whitespace around any CJK (Chinese, Japanese, or Korean) character in the input text.\n *\n * @param {string} text The input text to tokenize.\n * @returns {string} The tokenized text with whitespace added around CJK characters.\n */\n _tokenize_chinese_chars(text) {\n /* Adds whitespace around any CJK character. */\n const output = [];\n for (let i = 0; i < text.length; ++i) {\n const char = text[i];\n const cp = char.charCodeAt(0);\n if (this._is_chinese_char(cp)) {\n output.push(\" \");\n output.push(char);\n output.push(\" \");\n } else {\n output.push(char);\n }\n }\n return output.join(\"\");\n }\n\n /**\n * Checks whether the given Unicode codepoint represents a CJK (Chinese, Japanese, or Korean) character.\n *\n * A \"chinese character\" is defined as anything in the CJK Unicode block:\n * https://en.wikipedia.org/wiki/CJK_Unified_Ideographs_(Unicode_block)\n *\n * Note that the CJK Unicode block is NOT all Japanese and Korean characters, despite its name.\n * The modern Korean Hangul alphabet is a different block, as is Japanese Hiragana and Katakana.\n * Those alphabets are used to write space-separated words, so they are not treated specially\n * and are handled like all other languages.\n *\n * @param {number} cp The Unicode codepoint to check.\n * @returns {boolean} True if the codepoint represents a CJK character, false otherwise.\n */\n _is_chinese_char(cp) {\n return (\n (cp >= 0x4E00 && cp <= 0x9FFF)\n || (cp >= 0x3400 && cp <= 0x4DBF)\n || (cp >= 0x20000 && cp <= 0x2A6DF)\n || (cp >= 0x2A700 && cp <= 0x2B73F)\n || (cp >= 0x2B740 && cp <= 0x2B81F)\n || (cp >= 0x2B820 && cp <= 0x2CEAF)\n || (cp >= 0xF900 && cp <= 0xFAFF)\n || (cp >= 0x2F800 && cp <= 0x2FA1F)\n )\n }\n /**\n * Strips accents from the given text.\n * @param {string} text The text to strip accents from.\n * @returns {string} The text with accents removed.\n */\n stripAccents(text) {\n return text.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\n }\n\n\n /**\n * Checks whether `char` is a control character.\n * @param {string} char The character to check.\n * @returns {boolean} Whether `char` is a control character.\n * @private\n */\n _is_control(char) {\n switch (char) {\n case '\\t':\n case '\\n':\n case '\\r':\n // These are technically control characters but we count them as whitespace characters.\n return false;\n\n default:\n // Check if unicode category starts with C:\n // Cc - Control\n // Cf - Format\n // Co - Private Use\n // Cs - Surrogate\n return /^\\p{Cc}|\\p{Cf}|\\p{Co}|\\p{Cs}$/u.test(char);\n }\n }\n\n /**\n * Performs invalid character removal and whitespace cleanup on text.\n * @param {string} text The text to clean.\n * @returns {string} The cleaned text.\n * @private\n */\n _clean_text(text) {\n const output = [];\n for (const char of text) {\n const cp = char.charCodeAt(0);\n if (cp === 0 || cp === 0xFFFD || this._is_control(char)) {\n continue;\n }\n if (/^\\s$/.test(char)) { // is whitespace\n output.push(\" \");\n } else {\n output.push(char);\n }\n }\n return output.join(\"\");\n }\n /**\n * Normalizes the given text based on the configuration.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n if (this.config.clean_text) {\n text = this._clean_text(text);\n }\n\n if (this.config.handle_chinese_chars) {\n text = this._tokenize_chinese_chars(text);\n }\n\n if (this.config.lowercase) {\n text = text.toLowerCase();\n\n if (this.config.strip_accents !== false) {\n text = this.stripAccents(text);\n }\n } else if (this.config.strip_accents) {\n text = this.stripAccents(text);\n }\n\n return text;\n }\n}\n\n/**\n * A callable class representing a pre-tokenizer used in tokenization. Subclasses\n * should implement the `pre_tokenize_text` method to define the specific pre-tokenization logic.\n * @extends Callable\n */\nclass PreTokenizer extends _utils_core_js__WEBPACK_IMPORTED_MODULE_0__.Callable {\n /**\n * Factory method that returns an instance of a subclass of `PreTokenizer` based on the provided configuration.\n *\n * @static\n * @param {Object} config A configuration object for the pre-tokenizer.\n * @returns {PreTokenizer} An instance of a subclass of `PreTokenizer`.\n * @throws {Error} If the provided configuration object does not correspond to any known pre-tokenizer.\n */\n static fromConfig(config) {\n if (config === null) return null;\n\n switch (config.type) {\n case 'BertPreTokenizer':\n return new BertPreTokenizer(config);\n case 'Sequence':\n return new PreTokenizerSequence(config);\n case 'Whitespace':\n return new WhitespacePreTokenizer(config);\n case 'WhitespaceSplit':\n return new WhitespaceSplit(config);\n case 'Metaspace':\n return new MetaspacePreTokenizer(config);\n\n case 'ByteLevel':\n return new ByteLevelPreTokenizer(config);\n case 'Split':\n return new SplitPreTokenizer(config);\n case 'Punctuation':\n return new PunctuationPreTokenizer(config);\n case 'Digits':\n return new DigitsPreTokenizer(config);\n case 'Replace':\n return new ReplacePreTokenizer(config);\n default:\n throw new Error(`Unknown PreTokenizer type: ${config.type}`);\n }\n }\n\n /**\n * Method that should be implemented by subclasses to define the specific pre-tokenization logic.\n *\n * @abstract\n * @param {string} text The text to pre-tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} The pre-tokenized text.\n * @throws {Error} If the method is not implemented in the subclass.\n */\n pre_tokenize_text(text, options) {\n throw Error(\"pre_tokenize_text should be implemented in subclass.\")\n }\n\n /**\n * Tokenizes the given text into pre-tokens.\n * @param {string|string[]} text The text or array of texts to pre-tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of pre-tokens.\n */\n pre_tokenize(text, options) {\n return (Array.isArray(text)\n ? text.map(x => this.pre_tokenize_text(x, options))\n : this.pre_tokenize_text(text, options)\n ).flat();\n }\n\n /**\n * Alias for {@link PreTokenizer#pre_tokenize}.\n * @param {string|string[]} text The text or array of texts to pre-tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of pre-tokens.\n */\n _call(text, options) {\n return this.pre_tokenize(text, options);\n }\n}\n\n/**\n * @extends PreTokenizer\n */\nclass BertPreTokenizer extends PreTokenizer {\n /**\n * A PreTokenizer that splits text into wordpieces using a basic tokenization scheme\n * similar to that used in the original implementation of BERT.\n * \n * @param {Object} config The configuration object.\n */\n constructor(config) {\n super();\n // Construct a pattern which matches the rust implementation:\n // https://github.com/huggingface/tokenizers/blob/b4fcc9ce6e4ad5806e82826f816acfdfdc4fcc67/tokenizers/src/pre_tokenizers/bert.rs#L11\n // Equivalent to removing whitespace and splitting on punctuation (both \\p{P} and other ascii characters)\n this.pattern = new RegExp(`[^\\\\s${PUNCTUATION_REGEX}]+|[${PUNCTUATION_REGEX}]`, 'gu');\n }\n /**\n * Tokenizes a single text using the BERT pre-tokenization scheme.\n * \n * @param {string} text The text to tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens.\n */\n pre_tokenize_text(text, options) {\n return text.trim().match(this.pattern) || [];\n }\n}\n\n/**\n * A pre-tokenizer that splits text into Byte-Pair-Encoding (BPE) subwords.\n * @extends PreTokenizer\n */\nclass ByteLevelPreTokenizer extends PreTokenizer {\n /**\n * Creates a new instance of the `ByteLevelPreTokenizer` class.\n * @param {Object} config The configuration object.\n */\n constructor(config) {\n super();\n this.config = config;\n\n /**\n * @type {boolean} Whether to add a leading space to the first word.\n * This allows to treat the leading word just as any other word.\n */\n this.add_prefix_space = this.config.add_prefix_space;\n\n /**\n * @type {boolean} Whether the post processing step should trim offsets\n * to avoid including whitespaces.\n * @todo Use this in the pretokenization step.\n */\n this.trim_offsets = this.config.trim_offsets;\n\n /**\n * @type {boolean} Whether to use the standard GPT2 regex for whitespace splitting.\n * Set it to False if you want to use your own splitting. Defaults to true.\n */\n this.use_regex = this.config.use_regex ?? true;\n this.pattern = /'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+/gu;\n\n this.byte_encoder = BYTES_TO_UNICODE;\n this.text_encoder = new TextEncoder();\n }\n\n /**\n * Tokenizes a single piece of text using byte-level tokenization.\n * @param {string} text The text to tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens.\n */\n pre_tokenize_text(text, options) {\n // Add a leading space if the option is enabled\n if (this.add_prefix_space && !text.startsWith(' ')) {\n text = ' ' + text;\n }\n\n // Split on whitespace and punctuation\n const tokens = this.use_regex ? (text.match(this.pattern) || []) : [text];\n\n // Maps all our bytes to unicode strings, avoiding control tokens of the BPE (spaces in our case)\n return tokens.map(\n token => Array.from(this.text_encoder.encode(token), byte => this.byte_encoder[byte]).join('')\n );\n }\n}\n\n/**\n * @typedef {'removed'|'isolated'|'mergedWithPrevious'|'mergedWithNext'|'contiguous'} SplitDelimiterBehavior\n */\n\n/**\n * Splits text using a given pattern.\n * @extends PreTokenizer\n */\nclass SplitPreTokenizer extends PreTokenizer {\n /**\n * @param {Object} config The configuration options for the pre-tokenizer.\n * @param {Object} config.pattern The pattern used to split the text. Can be a string or a regex object.\n * @param {string|undefined} config.pattern.String The string to use for splitting. Only defined if the pattern is a string.\n * @param {string|undefined} config.pattern.Regex The regex to use for splitting. Only defined if the pattern is a regex.\n * @param {SplitDelimiterBehavior} config.behavior The behavior to use when splitting.\n * @param {boolean} config.invert Whether to split (invert=false) or match (invert=true) the pattern.\n */\n constructor(config) {\n super();\n this.config = config;\n // TODO support all behaviours (config.behavior)\n\n this.pattern = createPattern(this.config.pattern, this.config.invert);\n }\n\n /**\n * Tokenizes text by splitting it using the given pattern.\n * @param {string} text The text to tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens.\n */\n pre_tokenize_text(text, options) {\n if (this.pattern === null) {\n return [];\n }\n\n if (this.config.invert) {\n return text.match(this.pattern) || [];\n } else {\n return regexSplit(text, this.pattern);\n }\n }\n}\n\n/**\n * Splits text based on punctuation.\n * @extends PreTokenizer\n */\nclass PunctuationPreTokenizer extends PreTokenizer {\n /**\n * @param {Object} config The configuration options for the pre-tokenizer.\n * @param {SplitDelimiterBehavior} config.behavior The behavior to use when splitting.\n */\n constructor(config) {\n super();\n this.config = config;\n this.pattern = new RegExp(`[^${PUNCTUATION_REGEX}]+|[${PUNCTUATION_REGEX}]+`, 'gu');\n }\n\n /**\n * Tokenizes text by splitting it using the given pattern.\n * @param {string} text The text to tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens.\n */\n pre_tokenize_text(text, options) {\n return text.match(this.pattern) || [];\n }\n}\n\n\n/**\n * Splits text based on digits.\n * @extends PreTokenizer\n */\nclass DigitsPreTokenizer extends PreTokenizer {\n /**\n * @param {Object} config The configuration options for the pre-tokenizer.\n * @param {boolean} config.individual_digits Whether to split on individual digits.\n */\n constructor(config) {\n super();\n this.config = config;\n\n // Construct a pattern which matches the rust implementation:\n const digit_pattern = `[^\\\\d]+|\\\\d${this.config.individual_digits ? '' : '+'}`;\n this.pattern = new RegExp(digit_pattern, 'gu');\n }\n\n /**\n * Tokenizes text by splitting it using the given pattern.\n * @param {string} text The text to tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens.\n */\n pre_tokenize_text(text, options) {\n return text.match(this.pattern) || [];\n }\n}\n\n/**\n * @typedef {Object} PostProcessedOutput\n * @property {string[]} tokens List of token produced by the post-processor.\n * @property {number[]} [token_type_ids] List of token type ids produced by the post-processor.\n */\n\n\n/**\n * @typedef {Object} EncodingSingle\n * @property {number[]} input_ids List of token ids to be fed to a model.\n * @property {number[]} attention_mask List of token type ids to be fed to a model\n * @property {number[]} [token_type_ids] List of indices specifying which tokens should be attended to by the model\n */\n\n\n/**\n * @extends Callable\n */\nclass PostProcessor extends _utils_core_js__WEBPACK_IMPORTED_MODULE_0__.Callable {\n\n /**\n * @param {Object} config The configuration for the post-processor.\n */\n constructor(config) {\n super();\n this.config = config;\n }\n\n /**\n * Factory method to create a PostProcessor object from a configuration object.\n *\n * @param {Object} config Configuration object representing a PostProcessor.\n * @returns {PostProcessor} A PostProcessor object created from the given configuration.\n * @throws {Error} If an unknown PostProcessor type is encountered.\n */\n static fromConfig(config) {\n if (config === null) return null;\n switch (config.type) {\n case 'TemplateProcessing':\n return new TemplateProcessing(config);\n\n case 'ByteLevel':\n return new ByteLevelPostProcessor(config);\n\n case 'RobertaProcessing':\n return new RobertaProcessing(config);\n case 'BertProcessing':\n return new BertProcessing(config);\n\n default:\n throw new Error(`Unknown PostProcessor type: ${config.type}`);\n }\n }\n\n /**\n * Method to be implemented in subclass to apply post-processing on the given tokens.\n *\n * @param {Array} tokens The input tokens to be post-processed.\n * @param {...*} args Additional arguments required by the post-processing logic.\n * @returns {PostProcessedOutput} The post-processed tokens.\n * @throws {Error} If the method is not implemented in subclass.\n */\n post_process(tokens, ...args) {\n throw Error(\"post_process should be implemented in subclass.\")\n }\n\n /**\n * Alias for {@link PostProcessor#post_process}.\n * @param {Array} tokens The text or array of texts to post-process.\n * @param {...*} args Additional arguments required by the post-processing logic.\n * @returns {PostProcessedOutput} The post-processed tokens.\n */\n _call(tokens, ...args) {\n return this.post_process(tokens, ...args);\n }\n}\n\n/**\n * A post-processor that adds special tokens to the beginning and end of the input.\n */\nclass BertProcessing extends PostProcessor {\n /**\n * @param {Object} config The configuration for the post-processor.\n * @param {string[]} config.cls The special tokens to add to the beginning of the input.\n * @param {string[]} config.sep The special tokens to add to the end of the input.\n */\n constructor(config) {\n super(config);\n // TODO use all of config: add_prefix_space, trim_offsets\n\n this.cls = config.cls[0];\n this.sep = config.sep[0];\n }\n\n /**\n * Adds the special tokens to the beginning and end of the input.\n * @param {string[]} tokens The input tokens.\n * @param {string[]} [tokens_pair=null] An optional second set of input tokens.\n * @returns {PostProcessedOutput} The post-processed tokens with the special tokens added to the beginning and end.\n */\n post_process(tokens, tokens_pair = null, {\n add_special_tokens = true,\n } = {}) {\n if (add_special_tokens) {\n tokens = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)([this.cls], tokens, [this.sep]);\n }\n\n let token_type_ids = new Array(tokens.length).fill(0);\n if (tokens_pair !== null) {\n // NOTE: It is intended to add 2 EOS tokens after the first set of tokens\n // https://github.com/huggingface/tokenizers/issues/983\n const middle = (add_special_tokens && this instanceof RobertaProcessing)\n ? [this.sep]\n : [];\n const after = add_special_tokens ? [this.sep] : [];\n\n tokens = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(tokens, middle, tokens_pair, after);\n token_type_ids = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(token_type_ids, new Array(tokens_pair.length + middle.length + after.length).fill(1));\n }\n return { tokens, token_type_ids };\n }\n}\nclass RobertaProcessing extends BertProcessing { } // NOTE: extends BertProcessing\n\n/**\n * Post processor that replaces special tokens in a template with actual tokens.\n * @extends PostProcessor\n */\nclass TemplateProcessing extends PostProcessor {\n /**\n * Creates a new instance of `TemplateProcessing`.\n * @param {Object} config The configuration options for the post processor.\n * @param {Array} config.single The template for a single sequence of tokens.\n * @param {Array} config.pair The template for a pair of sequences of tokens.\n */\n constructor(config) {\n super(config);\n\n this.single = config.single;\n this.pair = config.pair;\n }\n\n /**\n * Replaces special tokens in the template with actual tokens.\n * @param {string[]} tokens The list of tokens for the first sequence.\n * @param {string[]} [tokens_pair=null] The list of tokens for the second sequence (optional).\n * @returns {PostProcessedOutput} An object containing the list of tokens with the special tokens replaced with actual tokens.\n */\n post_process(tokens, tokens_pair = null, {\n add_special_tokens = true,\n } = {}) {\n const type = tokens_pair === null ? this.single : this.pair\n\n let processedTokens = [];\n let types = [];\n for (const item of type) {\n if ('SpecialToken' in item) {\n if (add_special_tokens) {\n processedTokens.push(item.SpecialToken.id);\n types.push(item.SpecialToken.type_id);\n }\n } else if ('Sequence' in item) {\n if (item.Sequence.id === 'A') {\n processedTokens = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(processedTokens, tokens);\n types = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(types, new Array(tokens.length).fill(item.Sequence.type_id));\n\n } else if (item.Sequence.id === 'B') {\n processedTokens = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(processedTokens, tokens_pair);\n types = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(types, new Array(tokens_pair.length).fill(item.Sequence.type_id));\n }\n }\n }\n return { tokens: processedTokens, token_type_ids: types };\n }\n}\n\n/**\n * A PostProcessor that returns the given tokens as is.\n * @extends PostProcessor\n */\nclass ByteLevelPostProcessor extends PostProcessor {\n /**\n * Post process the given tokens.\n * @param {string[]} tokens The list of tokens for the first sequence.\n * @param {string[]} [tokens_pair=null] The list of tokens for the second sequence (optional).\n * @returns {PostProcessedOutput} An object containing the post-processed tokens.\n */\n post_process(tokens, tokens_pair = null) {\n if (tokens_pair) {\n tokens = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(tokens, tokens_pair);\n }\n return { tokens };\n }\n}\n\n/**\n * The base class for token decoders.\n * @extends Callable\n */\nclass Decoder extends _utils_core_js__WEBPACK_IMPORTED_MODULE_0__.Callable {\n\n /**\n * Creates an instance of `Decoder`.\n *\n * @param {Object} config The configuration object.\n */\n constructor(config) {\n super();\n this.config = config;\n\n /** @type {AddedToken[]} */\n this.added_tokens = [];\n this.end_of_word_suffix = null;\n this.trim_offsets = config.trim_offsets;\n }\n\n /**\n * Creates a decoder instance based on the provided configuration.\n *\n * @param {Object} config The configuration object.\n * @returns {Decoder} A decoder instance.\n * @throws {Error} If an unknown decoder type is provided.\n */\n static fromConfig(config) {\n if (config === null) return null;\n switch (config.type) {\n case 'WordPiece':\n return new WordPieceDecoder(config);\n case 'Metaspace':\n return new MetaspaceDecoder(config);\n case 'ByteLevel':\n return new ByteLevelDecoder(config);\n\n case 'Replace':\n return new ReplaceDecoder(config);\n case 'ByteFallback':\n return new ByteFallback(config);\n case 'Fuse':\n return new FuseDecoder(config);\n case 'Strip':\n return new StripDecoder(config);\n\n case 'Sequence':\n return new DecoderSequence(config);\n\n case 'CTC':\n return new CTCDecoder(config);\n case 'BPEDecoder':\n return new BPEDecoder(config);\n default:\n throw new Error(`Unknown Decoder type: ${config.type}`);\n }\n }\n\n /**\n * Calls the `decode` method.\n *\n * @param {string[]} tokens The list of tokens.\n * @returns {string} The decoded string.\n */\n _call(tokens) {\n return this.decode(tokens);\n }\n\n /**\n * Decodes a list of tokens.\n * @param {string[]} tokens The list of tokens.\n * @returns {string} The decoded string.\n */\n decode(tokens) {\n return this.decode_chain(tokens).join('');\n }\n\n /**\n * Apply the decoder to a list of tokens.\n * \n * @param {string[]} tokens The list of tokens.\n * @returns {string[]} The decoded list of tokens.\n * @throws {Error} If the `decode_chain` method is not implemented in the subclass.\n */\n decode_chain(tokens) {\n throw Error(\"`decode_chain` should be implemented in subclass.\")\n }\n\n}\n\nclass ReplaceDecoder extends Decoder {\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n const pattern = createPattern(this.config.pattern);\n return pattern === null\n ? tokens\n : tokens.map(token => token.replaceAll(pattern, this.config.content))\n }\n}\n\n\nclass ByteFallback extends Decoder {\n constructor(config) {\n super(config);\n\n this.text_decoder = new TextDecoder();\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n\n const new_tokens = [];\n let previous_byte_tokens = [];\n\n for (const token of tokens) {\n let bytes = null;\n if (token.length === 6 && token.startsWith('<0x') && token.endsWith('>')) {\n const byte = parseInt(token.slice(3, 5), 16);\n if (!isNaN(byte)) {\n bytes = byte;\n }\n }\n if (bytes !== null) {\n previous_byte_tokens.push(bytes);\n } else {\n if (previous_byte_tokens.length > 0) {\n const string = this.text_decoder.decode(Uint8Array.from(previous_byte_tokens));\n new_tokens.push(string);\n previous_byte_tokens = [];\n }\n new_tokens.push(token);\n }\n }\n if (previous_byte_tokens.length > 0) {\n const string = this.text_decoder.decode(Uint8Array.from(previous_byte_tokens));\n new_tokens.push(string);\n previous_byte_tokens = [];\n }\n\n return new_tokens;\n }\n}\n\n/**\n * Fuse simply fuses all tokens into one big string.\n * It's usually the last decoding step anyway, but this decoder\n * exists incase some decoders need to happen after that step\n */\nclass FuseDecoder extends Decoder {\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n return [tokens.join('')];\n }\n}\n\n\nclass StripDecoder extends Decoder {\n constructor(config) {\n super(config);\n\n this.content = this.config.content;\n this.start = this.config.start;\n this.stop = this.config.stop;\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n return tokens.map(token => {\n let start_cut = 0;\n for (let i = 0; i < this.start; ++i) {\n if (token[i] === this.content) {\n start_cut = i + 1;\n continue;\n } else {\n break;\n }\n }\n\n let stop_cut = token.length;\n for (let i = 0; i < this.stop; ++i) {\n const index = token.length - i - 1;\n if (token[index] === this.content) {\n stop_cut = index;\n continue;\n } else {\n break;\n }\n }\n\n return token.slice(start_cut, stop_cut)\n });\n }\n}\n\n/**\n * A decoder that decodes a list of WordPiece tokens into a single string.\n * @extends Decoder\n */\nclass WordPieceDecoder extends Decoder {\n\n /**\n * Creates a new instance of WordPieceDecoder.\n * @param {Object} config The configuration object.\n * @param {string} config.prefix The prefix used for WordPiece encoding.\n * @param {boolean} config.cleanup Whether to cleanup the decoded string.\n */\n constructor(config) {\n super(config);\n this.cleanup = config.cleanup;\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n return tokens.map((token, i) => {\n if (i !== 0) {\n if (token.startsWith(this.config.prefix)) {\n // NOTE: .replace() is intended; only replace first occurrence\n token = token.replace(this.config.prefix, '');\n } else {\n token = ' ' + token;\n }\n }\n if (this.cleanup) {\n token = clean_up_tokenization(token)\n }\n\n return token;\n });\n }\n}\n\n/**\n * Byte-level decoder for tokenization output. Inherits from the `Decoder` class.\n * @extends Decoder\n */\nclass ByteLevelDecoder extends Decoder {\n\n /**\n * Create a `ByteLevelDecoder` object.\n * @param {Object} config Configuration object.\n */\n constructor(config) {\n super(config);\n\n this.byte_decoder = UNICODE_TO_BYTES;\n this.text_decoder = new TextDecoder(\"utf-8\", {\n fatal: false,\n ignoreBOM: true,\n });\n\n this.end_of_word_suffix = null;\n }\n\n /**\n * Convert an array of tokens to string by decoding each byte.\n * @param {string[]} tokens Array of tokens to be decoded.\n * @returns {string} The decoded string.\n */\n convert_tokens_to_string(tokens) {\n const text = tokens.join('');\n const byteArray = new Uint8Array([...text].map(c => this.byte_decoder[c]));\n const decoded_text = this.text_decoder.decode(byteArray);\n return decoded_text;\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n // TODO move to base class (like HF)\n // tokens === filtered_tokens\n\n // To avoid mixing byte-level and unicode for byte-level BPT\n // we need to build string separately for added tokens and byte-level tokens\n // cf. https://github.com/huggingface/transformers/issues/1133\n const sub_texts = [];\n let current_sub_text = [];\n for (const token of tokens) {\n // tokens sent here are already filtered, so we don't need to do this\n // if (skip_special_tokens && this.all_special_ids.includes(token)) {\n // continue;\n // }\n\n if (this.added_tokens.find(x => x.content === token) !== undefined) {\n if (current_sub_text.length > 0) {\n sub_texts.push(this.convert_tokens_to_string(current_sub_text));\n current_sub_text = [];\n }\n sub_texts.push(token);\n } else {\n current_sub_text.push(token);\n }\n }\n if (current_sub_text.length > 0) {\n sub_texts.push(this.convert_tokens_to_string(current_sub_text));\n }\n\n // TODO add spaces_between_special_tokens and clean_up_tokenization_spaces options\n\n return sub_texts;\n }\n}\n\n/**\n * The CTC (Connectionist Temporal Classification) decoder.\n * See https://github.com/huggingface/tokenizers/blob/bb38f390a61883fc2f29d659af696f428d1cda6b/tokenizers/src/decoders/ctc.rs\n */\nclass CTCDecoder extends Decoder {\n\n constructor(config) {\n super(config);\n\n this.pad_token = this.config.pad_token;\n this.word_delimiter_token = this.config.word_delimiter_token;\n this.cleanup = this.config.cleanup;\n }\n /**\n * Converts a connectionist-temporal-classification (CTC) output tokens into a single string.\n * @param {string[]} tokens Array of tokens to be decoded.\n * @returns {string} The decoded string.\n */\n convert_tokens_to_string(tokens) {\n if (tokens.length === 0) return '';\n\n // group same tokens into non-repeating tokens in CTC style decoding\n const grouped_tokens = [tokens[0]];\n for (let i = 1; i < tokens.length; ++i) {\n if (tokens[i] !== grouped_tokens.at(-1)) {\n grouped_tokens.push(tokens[i]);\n }\n }\n\n // filter self.pad_token which is used as CTC-blank token\n const filtered_tokens = grouped_tokens.filter(token => token !== this.pad_token);\n\n let text = filtered_tokens.join('');\n if (this.cleanup) {\n // cleanup and replace delimiter token\n text = clean_up_tokenization(text)\n .replaceAll(this.word_delimiter_token, ' ')\n .trim();\n }\n return text;\n }\n\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n return [this.convert_tokens_to_string(tokens)];\n }\n}\n\n/**\n * Apply a sequence of decoders.\n * @extends Decoder\n */\nclass DecoderSequence extends Decoder {\n\n /**\n * Creates a new instance of DecoderSequence.\n * @param {Object} config The configuration object.\n * @param {Decoder[]} config.decoders The list of decoders to apply.\n */\n constructor(config) {\n super(config);\n this.decoders = config.decoders.map(x => Decoder.fromConfig(x));\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n // Use reduce to apply each decoder to the tokens\n return this.decoders.reduce((toks, decoder) => {\n return decoder.decode_chain(toks);\n }, tokens);\n }\n\n}\n\nclass BPEDecoder extends Decoder {\n constructor(config) {\n super(config);\n\n this.suffix = this.config.suffix;\n }\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n return tokens.map((token, i) => {\n return token.replaceAll(this.suffix, (i === tokens.length - 1) ? '' : ' ')\n });\n }\n}\n\n// Custom decoder for VITS\nclass VitsDecoder extends Decoder {\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n let decoded = '';\n for (let i = 1; i < tokens.length; i += 2) {\n decoded += tokens[i];\n }\n return [decoded];\n }\n}\n\n\n/**\n * This PreTokenizer replaces spaces with the given replacement character, adds a prefix space if requested,\n * and returns a list of tokens.\n * @extends PreTokenizer\n */\nclass MetaspacePreTokenizer extends PreTokenizer {\n /**\n * @param {Object} config The configuration object for the MetaspacePreTokenizer.\n * @param {boolean} config.add_prefix_space Whether to add a prefix space to the first token.\n * @param {string} config.replacement The character to replace spaces with.\n * @param {string} [config.str_rep=config.replacement] An optional string representation of the replacement character.\n * @param {'first'|'never'|'always'} [config.prepend_scheme='always'] The metaspace prepending scheme.\n */\n constructor(config) {\n super();\n\n this.addPrefixSpace = config.add_prefix_space;\n this.replacement = config.replacement;\n this.strRep = config.str_rep || this.replacement;\n this.prepend_scheme = config.prepend_scheme ?? 'always';\n }\n\n /**\n * This method takes a string, replaces spaces with the replacement character,\n * adds a prefix space if requested, and returns a new list of tokens.\n * @param {string} text The text to pre-tokenize.\n * @param {Object} [options] The options for the pre-tokenization.\n * @param {number} [options.section_index] The index of the section to pre-tokenize.\n * @returns {string[]} A new list of pre-tokenized tokens.\n */\n pre_tokenize_text(text, {\n section_index = undefined,\n } = {}) {\n\n let normalized = text.replaceAll(' ', this.strRep);\n\n if (\n // We add a prefix space if:\n // (1) The addPrefixSpace option is enabled and the normalized\n // token does not already start with the replacement character.\n (this.addPrefixSpace && !normalized.startsWith(this.replacement))\n\n // and (2) either:\n // (a) prepend_scheme is 'always'\n // (b) prepend_scheme is 'first' and this is the first section\n && (\n this.prepend_scheme === 'always' ||\n (this.prepend_scheme === 'first' && section_index === 0)\n )\n ) {\n normalized = this.strRep + normalized;\n }\n return [normalized];\n }\n}\n\n/**\n * MetaspaceDecoder class extends the Decoder class and decodes Metaspace tokenization.\n * @extends Decoder\n */\nclass MetaspaceDecoder extends Decoder {\n /**\n * Constructs a new MetaspaceDecoder object.\n * @param {Object} config The configuration object for the MetaspaceDecoder.\n * @param {boolean} config.add_prefix_space Whether to add a prefix space to the decoded string.\n * @param {string} config.replacement The string to replace spaces with.\n */\n constructor(config) {\n super(config);\n\n this.addPrefixSpace = config.add_prefix_space;\n this.replacement = config.replacement;\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n const result = [];\n for (let i = 0; i < tokens.length; ++i) {\n let normalized = tokens[i].replaceAll(this.replacement, ' ');\n if (this.addPrefixSpace && i == 0 && normalized.startsWith(' ')) {\n normalized = normalized.substring(1);\n }\n result.push(normalized);\n }\n return result;\n }\n}\n\n/**\n * A normalizer that applies a precompiled charsmap.\n * This is useful for applying complex normalizations in C++ and exposing them to JavaScript.\n * @extends Normalizer\n * @param {Object} config The configuration object for the Precompiled normalizer.\n * @param {Object} config.precompiled_charsmap The precompiled charsmap object.\n */\nclass Precompiled extends Normalizer {\n /**\n * Create a new instance of Precompiled normalizer.\n * @param {Object} config The configuration object.\n * @param {any} config.precompiled_charsmap Precompiled chars mapping.\n */\n constructor(config) {\n super(config);\n this.charsmap = config.precompiled_charsmap;\n }\n\n /**\n * Normalizes the given text by applying the precompiled charsmap.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n // As stated in the sentencepiece normalization docs (https://github.com/google/sentencepiece/blob/master/doc/normalization.md#use-pre-defined-normalization-rule),\n // there are 5 pre-defined normalization rules:\n // 1. nmt_nfkc: NFKC normalization with some additional normalization around spaces. (default)\n // 2. nfkc: original NFKC normalization.\n // 3. nmt_nfkc_cf: nmt_nfkc + Unicode case folding (mostly lower casing)\n // 4. nfkc_cf: nfkc + Unicode case folding.\n // 5. identity: no normalization\n // \n // For now, we only implement the default (nmt_nfkc).\n // See https://raw.githubusercontent.com/google/sentencepiece/master/data/nmt_nfkc.tsv for the full list of rules.\n // TODO: detect when a different `this.charsmap` is used.\n\n text = text.replace(/[\\u0001-\\u0008\\u000B\\u000E-\\u001F\\u007F\\u008F\\u009F]/gm, ''); // Remove control characters\n text = text.replace(/[\\u0009\\u000A\\u000C\\u000D\\u1680\\u200B\\u200C\\u200E\\u200F\\u2028\\u2029\\u2581\\uFEFF\\uFFFD]/gm, '\\u0020'); // Replace certain characters with a space\n\n if (text.includes('\\uFF5E')) {\n // To match the sentencepiece implementation 100%, we must handle a very strange edge-case.\n // For some reason, the \"Fullwidth Tilde\" character (\\uFF5E) should not be converted to the standard Tilde character (\\u007E).\n // However, NFKC normalization does do this conversion. As a result, we split the string on the Fullwidth Tilde character,\n // perform NFKC normalization on each substring, and then join them back together with the Fullwidth Tilde character.\n const parts = text.split('\\uFF5E');\n text = parts.map(part => part.normalize('NFKC')).join('\\uFF5E');\n } else {\n text = text.normalize('NFKC');\n }\n\n return text;\n }\n}\n\n/**\n * A pre-tokenizer that applies a sequence of pre-tokenizers to the input text.\n * @extends PreTokenizer\n */\nclass PreTokenizerSequence extends PreTokenizer {\n /**\n * Creates an instance of PreTokenizerSequence.\n * @param {Object} config The configuration object for the pre-tokenizer sequence.\n * @param {Object[]} config.pretokenizers An array of pre-tokenizer configurations.\n */\n constructor(config) {\n super();\n this.tokenizers = config.pretokenizers.map(x => PreTokenizer.fromConfig(x));\n }\n\n /**\n * Applies each pre-tokenizer in the sequence to the input text in turn.\n * @param {string} text The text to pre-tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} The pre-tokenized text.\n */\n pre_tokenize_text(text, options) {\n // Use reduce to apply each tokenizer to the text\n return this.tokenizers.reduce((preTokenizedText, tokenizer) => {\n return tokenizer.pre_tokenize(preTokenizedText, options);\n }, [text]);\n }\n}\n\n/**\n * Splits on word boundaries (using the following regular expression: `\\w+|[^\\w\\s]+`).\n */\nclass WhitespacePreTokenizer extends PreTokenizer {\n /**\n * Creates an instance of WhitespacePreTokenizer.\n * @param {Object} config The configuration object for the pre-tokenizer.\n */\n constructor(config) {\n super();\n }\n /**\n * Pre-tokenizes the input text by splitting it on word boundaries.\n * @param {string} text The text to be pre-tokenized.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens produced by splitting the input text on whitespace.\n */\n pre_tokenize_text(text, options) {\n return text.match(/\\w+|[^\\w\\s]+/g) || [];\n }\n}\n\n/**\n * Splits a string of text by whitespace characters into individual tokens.\n * @extends PreTokenizer\n */\nclass WhitespaceSplit extends PreTokenizer {\n /**\n * Creates an instance of WhitespaceSplit.\n * @param {Object} config The configuration object for the pre-tokenizer.\n */\n constructor(config) {\n super();\n }\n /**\n * Pre-tokenizes the input text by splitting it on whitespace characters.\n * @param {string} text The text to be pre-tokenized.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens produced by splitting the input text on whitespace.\n */\n pre_tokenize_text(text, options) {\n return whitespace_split(text);\n }\n}\n\n// NOTE: `ReplacePreTokenizer` is custom (to support `BlenderbotSmallTokenizer`)\nclass ReplacePreTokenizer extends PreTokenizer {\n /**\n * @param {Object} config The configuration options for the pre-tokenizer.\n * @param {Object} config.pattern The pattern used to split the text. Can be a string or a regex object.\n * @param {string} config.content What to replace the pattern with.\n */\n constructor(config) {\n super();\n this.config = config;\n this.pattern = createPattern(this.config.pattern);\n this.content = this.config.content;\n }\n\n /**\n * Pre-tokenizes the input text by replacing certain characters.\n * @param {string} text The text to be pre-tokenized.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens produced by replacing certain characters.\n */\n pre_tokenize_text(text, options) {\n if (this.pattern === null) {\n return [text];\n }\n return [text.replaceAll(this.pattern, this.config.content)];\n }\n}\n\nconst SPECIAL_TOKEN_ATTRIBUTES = [\n 'bos_token',\n 'eos_token',\n 'unk_token',\n 'sep_token',\n 'pad_token',\n 'cls_token',\n 'mask_token',\n // additional_special_tokens (TODO)\n]\n\n/**\n * \n * Helper function for padding values of an object, which are each arrays.\n * NOTE: No additional checks are made here for validity of arguments.\n * @param {Record} item The input object.\n * @param {number} length The length to pad to.\n * @param {(key: string) => any} value_fn Determine the value to fill the array, based on its key.\n * @param {'right'|'left'} side Which side to pad the array.\n * @private\n */\nfunction padHelper(item, length, value_fn, side) {\n for (const key of Object.keys(item)) {\n const diff = length - item[key].length;\n const value = value_fn(key);\n\n const padData = new Array(diff).fill(value);\n item[key] = side === 'right'\n ? (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(item[key], padData)\n : (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(padData, item[key]);\n }\n}\n\n/**\n * Helper function for truncating values of an object, which are each arrays.\n * NOTE: No additional checks are made here for validity of arguments.\n * @param {Record} item The input object.\n * @param {number} length The length to truncate to.\n * @private\n */\nfunction truncateHelper(item, length) {\n // Setting .length to a lower value truncates the array in-place:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length\n for (const key of Object.keys(item)) {\n item[key].length = length;\n }\n}\n\n\nclass PreTrainedTokenizer extends _utils_core_js__WEBPACK_IMPORTED_MODULE_0__.Callable {\n return_token_type_ids = false;\n\n _default_chat_template = `{% for message in messages %}{{'<|im_start|>' + message['role'] + '\\n' + message['content'] + '<|im_end|>' + '\\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\\n' }}{% endif %}`;\n\n /**\n * Create a new PreTrainedTokenizer instance.\n * @param {Object} tokenizerJSON The JSON of the tokenizer.\n * @param {Object} tokenizerConfig The config of the tokenizer.\n */\n constructor(tokenizerJSON, tokenizerConfig) {\n super();\n\n this._tokenizer_config = tokenizerConfig;\n\n // Construct parts of the tokenizer from the JSON\n this.normalizer = Normalizer.fromConfig(tokenizerJSON.normalizer);\n this.pre_tokenizer = PreTokenizer.fromConfig(tokenizerJSON.pre_tokenizer);\n this.model = TokenizerModel.fromConfig(tokenizerJSON.model, tokenizerConfig);\n this.post_processor = PostProcessor.fromConfig(tokenizerJSON.post_processor);\n this.decoder = Decoder.fromConfig(tokenizerJSON.decoder);\n\n // Add added_tokens to model\n this.special_tokens = [];\n this.all_special_ids = [];\n\n /** @type {AddedToken[]} */\n this.added_tokens = [];\n for (const addedToken of tokenizerJSON.added_tokens) {\n const token = new AddedToken(addedToken);\n this.added_tokens.push(token);\n\n this.model.tokens_to_ids.set(token.content, token.id);\n this.model.vocab[token.id] = token.content;\n\n if (token.special) {\n this.special_tokens.push(token.content);\n this.all_special_ids.push(token.id);\n }\n }\n\n // Update additional_special_tokens\n this.additional_special_tokens = tokenizerConfig.additional_special_tokens ?? [];\n this.special_tokens.push(...this.additional_special_tokens);\n this.special_tokens = [...new Set(this.special_tokens)]; // Remove duplicates\n\n if (this.decoder) {\n // Slight hack, but it prevents code duplication:\n this.decoder.added_tokens = this.added_tokens;\n\n // Another slight hack to add `end_of_word_suffix` (if present) to the decoder\n // This is needed for cases where BPE model and ByteLevel decoder are used\n // For more information, see https://github.com/xenova/transformers.js/issues/74\n // TODO: save this to the decoder when exporting?\n this.decoder.end_of_word_suffix = this.model.end_of_word_suffix;\n }\n\n\n this.added_tokens_regex = this.added_tokens.length > 0 ? new RegExp(\n this.added_tokens.map(x => `${x.lstrip ? '\\\\s*' : ''}(${(0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.escapeRegExp)(x.content)})${x.rstrip ? '\\\\s*' : ''}`).join('|')\n ) : null;\n\n // Set mask token if present (otherwise will be undefined, which is fine)\n this.mask_token = this.getToken('mask_token');\n this.mask_token_id = this.model.tokens_to_ids.get(this.mask_token);\n\n this.pad_token = this.getToken('pad_token', 'eos_token');\n this.pad_token_id = this.model.tokens_to_ids.get(this.pad_token);\n\n this.sep_token = this.getToken('sep_token');\n this.sep_token_id = this.model.tokens_to_ids.get(this.sep_token);\n\n this.unk_token = this.getToken('unk_token');\n this.unk_token_id = this.model.tokens_to_ids.get(this.unk_token);\n\n this.model_max_length = tokenizerConfig.model_max_length;\n\n /** @type {boolean} Whether or not to strip the text when tokenizing (removing excess spaces before and after the string). */\n this.remove_space = tokenizerConfig.remove_space;\n\n this.clean_up_tokenization_spaces = tokenizerConfig.clean_up_tokenization_spaces ?? true;\n this.do_lowercase_and_remove_accent = tokenizerConfig.do_lowercase_and_remove_accent ?? false;\n\n // TODO allow user to change this\n /** @type {'right'|'left'} */\n this.padding_side = 'right';\n\n this.legacy = false;\n\n this.chat_template = tokenizerConfig.chat_template ?? null;\n this._compiled_template_cache = new Map();\n }\n\n /**\n * Returns the value of the first matching key in the tokenizer config object.\n * @param {...string} keys One or more keys to search for in the tokenizer config object.\n * @returns {string|null} The value associated with the first matching key, or null if no match is found.\n * @throws {Error} If an object is found for a matching key and its __type property is not \"AddedToken\".\n */\n getToken(...keys) {\n for (const key of keys) {\n const item = this._tokenizer_config[key];\n\n if (!item) continue;\n\n if (typeof item === 'object') {\n if (item.__type === 'AddedToken') {\n return item.content;\n } else {\n throw Error(`Unknown token: ${item}`);\n }\n } else {\n return item;\n }\n }\n return null;\n }\n\n /**\n * Loads a pre-trained tokenizer from the given `pretrained_model_name_or_path`. \n * \n * @param {string} pretrained_model_name_or_path The path to the pre-trained tokenizer.\n * @param {PretrainedTokenizerOptions} options Additional options for loading the tokenizer.\n * \n * @throws {Error} Throws an error if the tokenizer.json or tokenizer_config.json files are not found in the `pretrained_model_name_or_path`.\n * @returns {Promise} A new instance of the `PreTrainedTokenizer` class.\n */\n static async from_pretrained(pretrained_model_name_or_path, {\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n legacy = null,\n } = {}) {\n\n const info = await loadTokenizer(pretrained_model_name_or_path, {\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n legacy,\n })\n\n // @ts-ignore\n return new this(...info);\n }\n\n /**\n * @typedef {number[]|number[][]|Tensor} BatchEncodingItem\n * \n * @typedef {Object} BatchEncoding Holds the output of the tokenizer's call function.\n * @property {BatchEncodingItem} input_ids List of token ids to be fed to a model.\n * @property {BatchEncodingItem} attention_mask List of indices specifying which tokens should be attended to by the model.\n * @property {BatchEncodingItem} [token_type_ids] List of token type ids to be fed to a model.\n */\n\n /**\n * Encode/tokenize the given text(s).\n * @param {string|string[]} text The text to tokenize.\n * @param {Object} options An optional object containing the following properties:\n * @param {string|string[]} [options.text_pair=null] Optional second sequence to be encoded. If set, must be the same type as text.\n * @param {boolean|'max_length'} [options.padding=false] Whether to pad the input sequences.\n * @param {boolean} [options.add_special_tokens=true] Whether or not to add the special tokens associated with the corresponding model.\n * @param {boolean} [options.truncation=null] Whether to truncate the input sequences.\n * @param {number} [options.max_length=null] Maximum length of the returned list and optionally padding length.\n * @param {boolean} [options.return_tensor=true] Whether to return the results as Tensors or arrays.\n * @returns {BatchEncoding} Object to be passed to the model.\n */\n _call(\n // Required positional arguments\n text,\n\n // Optional keyword arguments\n {\n text_pair = null,\n add_special_tokens = true,\n padding = false,\n truncation = null,\n max_length = null,\n return_tensor = true, // Different to HF\n } = {},\n ) {\n\n const isBatched = Array.isArray(text);\n\n /** @type {EncodingSingle[]} */\n let encodedTokens;\n\n if (isBatched) {\n if (text.length === 0) {\n throw Error('text array must be non-empty')\n }\n\n if (text_pair !== null) {\n if (!Array.isArray(text_pair)) {\n throw Error('text_pair must also be an array')\n\n } else if (text.length !== text_pair.length) {\n throw Error('text and text_pair must have the same length')\n }\n\n encodedTokens = text.map(\n (t, i) => this._encode_plus(t, text_pair[i], { add_special_tokens })\n )\n\n } else {\n encodedTokens = text.map(x => this._encode_plus(x, null, { add_special_tokens }));\n }\n\n } else {\n if (text === null) {\n throw Error('text may not be null')\n }\n\n if (Array.isArray(text_pair)) {\n throw Error('When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).')\n }\n\n // For single input, we just wrap in an array, and then unwrap later.\n encodedTokens = [this._encode_plus(text, text_pair, { add_special_tokens })];\n }\n // At this point, tokens is batched: [batch_size, tokens]\n // However, array may be jagged. So, we pad to max_length\n\n if (max_length === null) {\n if (padding === 'max_length') {\n max_length = this.model_max_length;\n } else {\n // Calculate max length from sequences\n max_length = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.max)(encodedTokens.map(x => x.input_ids.length))[0];\n }\n } else {\n if (!truncation) {\n console.warn(`Truncation was not explicitly activated but \\`max_length\\` is provided a specific value, please use \\`truncation=true\\` to explicitly truncate examples to max length.`)\n }\n }\n\n // Ensure it is less than model max length\n max_length = Math.min(max_length, this.model_max_length)\n\n if (padding || truncation) {\n\n // Perform padding and/or truncation\n for (let i = 0; i < encodedTokens.length; ++i) {\n if (encodedTokens[i].input_ids.length === max_length) {\n continue;\n\n } else if (encodedTokens[i].input_ids.length > max_length) {\n // possibly truncate\n if (truncation) {\n truncateHelper(encodedTokens[i], max_length);\n }\n\n } else { // t.length < max_length\n // possibly pad\n if (padding) {\n padHelper(\n encodedTokens[i],\n max_length,\n key => key === 'input_ids' ? this.pad_token_id : 0,\n this.padding_side\n );\n }\n }\n }\n }\n\n const result = {};\n\n if (return_tensor) {\n if (!(padding && truncation)) {\n // Not, guaranteed that all items have same length, so\n // we perform additional check\n\n if (\n encodedTokens.some(x => {\n for (const key of Object.keys(x)) {\n if (x[key].length !== encodedTokens[0][key]?.length) {\n return true;\n }\n }\n return false;\n })\n ) {\n throw Error(\n \"Unable to create tensor, you should probably activate truncation and/or padding \" +\n \"with 'padding=true' and 'truncation=true' to have batched tensors with the same length.\"\n )\n }\n }\n\n // Now we actually convert to tensor\n // NOTE: In the same way as the python library, we return a batched tensor, regardless of\n // whether we have a single input or multiple inputs.\n const dims = [encodedTokens.length, encodedTokens[0].input_ids.length];\n\n for (const key of Object.keys(encodedTokens[0])) {\n result[key] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor('int64',\n BigInt64Array.from(encodedTokens.flatMap(x => x[key]).map(BigInt)),\n dims\n );\n }\n\n } else {\n for (const key of Object.keys(encodedTokens[0])) {\n result[key] = encodedTokens.map(x => x[key]);\n }\n\n // If not returning a tensor, we match the input type\n if (!isBatched) {\n // Input was not batched, so we unwrap\n for (const key of Object.keys(result)) {\n result[key] = result[key][0];\n }\n }\n }\n\n return /** @type {BatchEncoding} */(result);\n }\n\n /**\n * Encodes a single text using the preprocessor pipeline of the tokenizer.\n *\n * @param {string|null} text The text to encode.\n * @returns {string[]|null} The encoded tokens.\n */\n _encode_text(text) {\n if (text === null) return null;\n\n // Actual function which does encoding, for a single text\n // First, we take care of special tokens. Needed to avoid issues arising from\n // normalization and/or pretokenization (which may not preserve special tokens)\n const sections = this.added_tokens_regex ? text.split(this.added_tokens_regex).filter(x => x) : [text];\n\n const tokens = sections.map((x, section_index) => {\n const addedToken = this.added_tokens.find(t => t.content === x);\n if (addedToken !== undefined) {\n // Ignore added tokens\n return x\n } else {\n if (this.remove_space === true) {\n x = x.trim().split(/\\s+/).join(' ');\n }\n if (this.do_lowercase_and_remove_accent) {\n x = lowercase_and_remove_accent(x);\n }\n\n if (this.normalizer !== null) {\n x = this.normalizer(x);\n }\n\n // If, after normalization, this section is empty (e.g., trimming whitespace),\n // we return an empty array\n if (x.length === 0) {\n return [];\n }\n\n const sectionTokens = (this.pre_tokenizer !== null) ? this.pre_tokenizer(x, {\n section_index,\n }) : [x];\n\n const tokens = this.model(sectionTokens);\n\n return tokens;\n }\n }).flat();\n\n return tokens;\n }\n\n /**\n * Encodes a single text or a pair of texts using the model's tokenizer.\n *\n * @param {string} text The text to encode.\n * @param {string|null} text_pair The optional second text to encode.\n * @param {Object} options An optional object containing the following properties:\n * @param {boolean} [options.add_special_tokens=true] Whether or not to add the special tokens associated with the corresponding model.\n * @returns {EncodingSingle} An object containing the encoded text.\n * @private\n */\n _encode_plus(text, text_pair = null, {\n add_special_tokens = true,\n } = {}) {\n // Function called by users to encode possibly multiple texts\n const tokens = this._encode_text(text);\n const tokens2 = this._encode_text(text_pair);\n\n const combinedTokens = this.post_processor\n ? this.post_processor(tokens, tokens2, { add_special_tokens })\n : { tokens: (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(tokens ?? [], tokens2 ?? []) };\n\n const input_ids = this.model.convert_tokens_to_ids(combinedTokens.tokens);\n\n const result = {\n input_ids,\n attention_mask: new Array(input_ids.length).fill(1),\n }\n if (this.return_token_type_ids && combinedTokens.token_type_ids) {\n result.token_type_ids = combinedTokens.token_type_ids;\n }\n return result;\n }\n\n /**\n * Encodes a single text or a pair of texts using the model's tokenizer.\n *\n * @param {string} text The text to encode.\n * @param {string|null} text_pair The optional second text to encode.\n * @param {Object} options An optional object containing the following properties:\n * @param {boolean} [options.add_special_tokens=true] Whether or not to add the special tokens associated with the corresponding model.\n * @returns {number[]} An array of token IDs representing the encoded text(s).\n */\n encode(text, text_pair = null, {\n add_special_tokens = true,\n } = {}) {\n const { input_ids } = this._encode_plus(text, text_pair, {\n add_special_tokens,\n });\n return input_ids;\n }\n\n /**\n * Decode a batch of tokenized sequences.\n * @param {number[][]|Tensor} batch List/Tensor of tokenized input sequences.\n * @param {Object} decode_args (Optional) Object with decoding arguments.\n * @returns {string[]} List of decoded sequences.\n */\n batch_decode(batch, decode_args = {}) {\n if (batch instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor) {\n batch = batch.tolist();\n }\n return batch.map(x => this.decode(x, decode_args));\n }\n\n /**\n * Decodes a sequence of token IDs back to a string.\n *\n * @param {number[]|Tensor} token_ids List/Tensor of token IDs to decode.\n * @param {Object} [decode_args={}]\n * @param {boolean} [decode_args.skip_special_tokens=false] If true, special tokens are removed from the output string.\n * @param {boolean} [decode_args.clean_up_tokenization_spaces=true] If true, spaces before punctuations and abbreviated forms are removed.\n *\n * @returns {string} The decoded string.\n * @throws {Error} If `token_ids` is not a non-empty array of integers.\n */\n decode(\n token_ids,\n decode_args = {},\n ) {\n if (token_ids instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor) {\n token_ids = prepareTensorForDecode(token_ids);\n }\n\n if (!Array.isArray(token_ids) || token_ids.length === 0 || !(0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.isIntegralNumber)(token_ids[0])) {\n throw Error(\"token_ids must be a non-empty array of integers.\");\n }\n\n return this.decode_single(token_ids, decode_args)\n }\n\n /**\n * Decode a single list of token ids to a string.\n * @param {number[]} token_ids List of token ids to decode\n * @param {Object} decode_args Optional arguments for decoding\n * @param {boolean} [decode_args.skip_special_tokens=false] Whether to skip special tokens during decoding\n * @param {boolean} [decode_args.clean_up_tokenization_spaces=null] Whether to clean up tokenization spaces during decoding.\n * If null, the value is set to `this.decoder.cleanup` if it exists, falling back to `this.clean_up_tokenization_spaces` if it exists, falling back to `true`.\n * @returns {string} The decoded string\n */\n decode_single(\n token_ids,\n {\n skip_special_tokens = false,\n clean_up_tokenization_spaces = null,\n }\n ) {\n let tokens = this.model.convert_ids_to_tokens(token_ids);\n if (skip_special_tokens) {\n tokens = tokens.filter(x => !this.special_tokens.includes(x));\n }\n\n // If `this.decoder` is null, we just join tokens with a space:\n // https://github.com/huggingface/tokenizers/blob/8edec536a737cb04494b454805be16c020abb14f/tokenizers/src/tokenizer/mod.rs#L835\n /** @type {string} */\n let decoded = this.decoder ? this.decoder(tokens) : tokens.join(' ');\n\n // Slight hack, but prevents having to pass `skip_special_tokens` to\n // each call to `decode`, which would lead to code duplication.\n if (this.decoder && this.decoder.end_of_word_suffix) {\n decoded = decoded.replaceAll(this.decoder.end_of_word_suffix, ' ');\n if (skip_special_tokens) {\n decoded = decoded.trim();\n }\n }\n\n if (clean_up_tokenization_spaces ?? this.clean_up_tokenization_spaces) {\n decoded = clean_up_tokenization(decoded);\n }\n\n return decoded;\n }\n\n get default_chat_template() {\n if (!this._warned_about_chat_template) {\n console.warn(\n \"No chat template is defined for this tokenizer - using a default chat template \" +\n \"that implements the ChatML format. If the default is not appropriate for \" +\n \"your model, please set `tokenizer.chat_template` to an appropriate template. \" +\n \"See https://huggingface.co/docs/transformers/main/chat_templating for more information.\"\n )\n this._warned_about_chat_template = true; // TODO move to logger.warning_once()\n }\n\n return this._default_chat_template;\n }\n\n /**\n * @typedef {Object} Message\n * @property {string} role The role of the message (e.g., \"user\" or \"assistant\" or \"system\").\n * @property {string} content The content of the message.\n */\n\n /**\n * Converts a list of message objects with `\"role\"` and `\"content\"` keys to a list of token\n * ids. This method is intended for use with chat models, and will read the tokenizer's chat_template attribute to\n * determine the format and control tokens to use when converting. When chat_template is None, it will fall back\n * to the default_chat_template specified at the class level.\n * \n * See [here](https://huggingface.co/docs/transformers/chat_templating) for more information.\n * \n * **Example:** Applying a chat template to a conversation.\n * \n * ```javascript\n * import { AutoTokenizer } from \"@xenova/transformers\";\n * \n * const tokenizer = await AutoTokenizer.from_pretrained(\"mistralai/Mistral-7B-Instruct-v0.1\");\n * \n * const chat = [\n * { \"role\": \"user\", \"content\": \"Hello, how are you?\" },\n * { \"role\": \"assistant\", \"content\": \"I'm doing great. How can I help you today?\" },\n * { \"role\": \"user\", \"content\": \"I'd like to show off how chat templating works!\" },\n * ]\n * \n * const text = tokenizer.apply_chat_template(chat, { tokenize: false });\n * // \"[INST] Hello, how are you? [/INST]I'm doing great. How can I help you today? [INST] I'd like to show off how chat templating works! [/INST]\"\n * \n * const input_ids = tokenizer.apply_chat_template(chat, { tokenize: true, return_tensor: false });\n * // [1, 733, 16289, 28793, 22557, 28725, 910, 460, 368, 28804, 733, 28748, 16289, 28793, 28737, 28742, 28719, 2548, 1598, 28723, 1602, 541, 315, 1316, 368, 3154, 28804, 2, 28705, 733, 16289, 28793, 315, 28742, 28715, 737, 298, 1347, 805, 910, 10706, 5752, 1077, 3791, 28808, 733, 28748, 16289, 28793]\n * ```\n * \n * @param {Message[]} conversation A list of message objects with `\"role\"` and `\"content\"` keys.\n * @param {Object} options An optional object containing the following properties:\n * @param {string} [options.chat_template=null] A Jinja template to use for this conversion. If\n * this is not passed, the model's default chat template will be used instead.\n * @param {boolean} [options.add_generation_prompt=false] Whether to end the prompt with the token(s) that indicate\n * the start of an assistant message. This is useful when you want to generate a response from the model.\n * Note that this argument will be passed to the chat template, and so it must be supported in the\n * template for this argument to have any effect.\n * @param {boolean} [options.tokenize=true] Whether to tokenize the output. If false, the output will be a string.\n * @param {boolean} [options.padding=false] Whether to pad sequences to the maximum length. Has no effect if tokenize is false.\n * @param {boolean} [options.truncation=false] Whether to truncate sequences to the maximum length. Has no effect if tokenize is false.\n * @param {number} [options.max_length=null] Maximum length (in tokens) to use for padding or truncation. Has no effect if tokenize is false.\n * If not specified, the tokenizer's `max_length` attribute will be used as a default.\n * @param {boolean} [options.return_tensor=true] Whether to return the output as a Tensor or an Array. Has no effect if tokenize is false.\n * @returns {string | Tensor | number[]| number[][]} The tokenized output.\n */\n apply_chat_template(conversation, {\n chat_template = null,\n add_generation_prompt = false,\n tokenize = true,\n padding = false,\n truncation = false,\n max_length = null,\n return_tensor = true,\n } = {}) {\n\n chat_template ??= this.chat_template ?? this.default_chat_template;\n\n // Compilation function uses a cache to avoid recompiling the same template\n let compiledTemplate = this._compiled_template_cache.get(chat_template);\n if (compiledTemplate === undefined) {\n compiledTemplate = new _huggingface_jinja__WEBPACK_IMPORTED_MODULE_5__.Template(chat_template);\n this._compiled_template_cache.set(chat_template, compiledTemplate);\n }\n\n const special_tokens_map = Object.create(null);\n for (const key of SPECIAL_TOKEN_ATTRIBUTES) {\n const value = this.getToken(key);\n if (value) {\n special_tokens_map[key] = value;\n }\n }\n\n const rendered = compiledTemplate.render({\n messages: conversation,\n add_generation_prompt: add_generation_prompt,\n\n ...special_tokens_map,\n });\n\n if (tokenize) {\n return this._call(rendered, {\n add_special_tokens: false,\n padding,\n truncation,\n max_length,\n return_tensor,\n }).input_ids;\n }\n\n return rendered;\n }\n}\n\n/**\n * BertTokenizer is a class used to tokenize text for BERT models.\n * @extends PreTrainedTokenizer\n */\nclass BertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\n/**\n * Albert tokenizer\n * @extends PreTrainedTokenizer\n */\nclass AlbertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nclass MobileBertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nclass SqueezeBertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nclass DebertaTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nclass DebertaV2Tokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nclass HerbertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nclass ConvBertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nclass RoFormerTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nclass DistilBertTokenizer extends PreTrainedTokenizer { }\nclass CamembertTokenizer extends PreTrainedTokenizer { }\nclass XLMTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\\'s \"fast\" tokenizers library. Therefore, you may experience slightly inaccurate results.')\n }\n}\nclass ElectraTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\n\nclass T5Tokenizer extends PreTrainedTokenizer { }\nclass GPT2Tokenizer extends PreTrainedTokenizer {\n _default_chat_template = `{% for message in messages %}\" \"{{ message.content }}{{ eos_token }}\" \"{% endfor %}`\n}\nclass BartTokenizer extends PreTrainedTokenizer { }\nclass MBartTokenizer extends PreTrainedTokenizer {\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n\n this.languageRegex = /^[a-z]{2}_[A-Z]{2}$/;\n this.language_codes = this.special_tokens.filter(x => this.languageRegex.test(x));\n this.lang_to_token = x => x; // Identity function\n }\n\n /**\n * Helper function to build translation inputs for an `MBartTokenizer`.\n * @param {string|string[]} raw_inputs The text to tokenize.\n * @param {Object} tokenizer_options Options to be sent to the tokenizer\n * @param {Object} generate_kwargs Generation options.\n * @returns {Object} Object to be passed to the model.\n */\n _build_translation_inputs(raw_inputs, tokenizer_options, generate_kwargs) {\n return _build_translation_inputs(this, raw_inputs, tokenizer_options, generate_kwargs);\n }\n}\nclass MBart50Tokenizer extends MBartTokenizer { } // NOTE: extends MBartTokenizer\n\nclass RobertaTokenizer extends PreTrainedTokenizer { }\n\nclass BloomTokenizer extends GPT2Tokenizer { // NOTE: `GPT2Tokenizer` to get the correct chat template\n\n constructor(tokenizerJSON, tokenizerConfig) {\n // Override the default (invalid) regex of the pretokenizer.\n // For more information, see https://github.com/xenova/transformers.js/issues/94\n const splitChars = '.,!?\\u2026\\u3002\\uff0c\\u3001\\u0964\\u06d4\\u060c';\n const patternObject = tokenizerJSON.pre_tokenizer?.pretokenizers[0]?.pattern;\n if (patternObject && patternObject.Regex === ` ?[^(\\\\s|[${splitChars}])]+`) {\n patternObject.Regex = ` ?[^\\\\s${splitChars}]+`;\n }\n super(tokenizerJSON, tokenizerConfig);\n }\n}\n\nconst SPIECE_UNDERLINE = \"▁\";\n\nclass LlamaTokenizer extends PreTrainedTokenizer {\n _default_chat_template = `{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% elif USE_DEFAULT_PROMPT == true and not '<>' in messages[0]['content'] %}{% set loop_messages = messages %}{% set system_message = 'DEFAULT_SYSTEM_MESSAGE' %}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = '<>\\n' + system_message + '\\n<>\\n\\n' + message['content'] %}{% else %}{% set content = message['content'] %}{% endif %}{% if message['role'] == 'user' %}{{ bos_token + '[INST] ' + content.strip() + ' [/INST]' }}{% elif message['role'] == 'system' %}{{ '<>\\n' + content.strip() + '\\n<>\\n\\n' }}{% elif message['role'] == 'assistant' %}{{ ' ' + content.strip() + ' ' + eos_token }}{% endif %}{% endfor %}`\n\n DEFAULT_SYSTEM_PROMPT =\n \"You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your \" +\n \"answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure \" +\n \"that your responses are socially unbiased and positive in nature.\\n\\n\" +\n \"If a question does not make any sense, or is not factually coherent, explain why instead of answering something not \" +\n \"correct. If you don't know the answer to a question, please don't share false information.\"\n\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n this.use_default_system_prompt = tokenizerConfig.use_default_system_prompt ?? false;\n\n this.legacy = tokenizerConfig.legacy ?? true;\n if (!this.legacy) {\n // See https://github.com/huggingface/transformers/pull/24565 for more information\n this.normalizer = null;\n this.pre_tokenizer = new MetaspacePreTokenizer({\n replacement: SPIECE_UNDERLINE,\n add_prefix_space: true,\n prepend_scheme: \"first\",\n });\n }\n }\n\n /**\n * Helper function to handle legacy encoding of SPM tokenizers.\n * Adapted from https://github.com/huggingface/transformers/blob/e6dcf8abd6f65bb4b6dfc1831b20d9ba49ce00e2/src/transformers/models/t5/tokenization_t5.py#L374-L387\n * @param {string} text The text to encode.\n * @returns {string[]} The encoded tokens.\n */\n _encode_text(text) {\n if (text === null) return null;\n\n if (this.legacy || text.length === 0) {\n return super._encode_text(text);\n }\n\n let tokens = super._encode_text(SPIECE_UNDERLINE + text.replaceAll(SPIECE_UNDERLINE, \" \"));\n if (tokens.length > 1 && tokens[0] === SPIECE_UNDERLINE && this.special_tokens.includes(tokens[1])) {\n tokens = tokens.slice(1);\n }\n return tokens;\n }\n\n get default_chat_template() {\n return super.default_chat_template\n .replaceAll('USE_DEFAULT_PROMPT', this.use_default_system_prompt ? 'true' : 'false')\n .replaceAll('DEFAULT_SYSTEM_MESSAGE', this.DEFAULT_SYSTEM_PROMPT.replaceAll(\"\\n\", \"\\\\n\").replaceAll(\"'\", \"\\\\'\"));\n }\n}\nclass CodeLlamaTokenizer extends LlamaTokenizer { } // NOTE: `LlamaTokenizer` to get the correct chat template\n\nclass XLMRobertaTokenizer extends PreTrainedTokenizer { }\nclass MPNetTokenizer extends PreTrainedTokenizer { }\n\nclass FalconTokenizer extends PreTrainedTokenizer { }\n\nclass GPTNeoXTokenizer extends PreTrainedTokenizer { }\n\nclass EsmTokenizer extends PreTrainedTokenizer { }\n\nclass Qwen2Tokenizer extends PreTrainedTokenizer { }\n\nclass GemmaTokenizer extends PreTrainedTokenizer {\n _default_chat_template = \"{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '' + role + '\\n' + message['content'] | trim + '\\n' }}{% endfor %}{% if add_generation_prompt %}{{'model\\n'}}{% endif %}\"\n}\n\n/**\n * Helper function to build translation inputs for an `NllbTokenizer` or `M2M100Tokenizer`.\n * @param {PreTrainedTokenizer} self The tokenizer instance.\n * @param {string|string[]} raw_inputs The text to tokenize.\n * @param {Object} tokenizer_options Options to be sent to the tokenizer\n * @param {Object} generate_kwargs Generation options.\n * @returns {Object} Object to be passed to the model.\n * @private\n */\nfunction _build_translation_inputs(self, raw_inputs, tokenizer_options, generate_kwargs) {\n if (!('language_codes' in self) || !Array.isArray(self.language_codes)) {\n throw new Error('Tokenizer must have `language_codes` attribute set and it should be an array of language ids.')\n }\n if (!('languageRegex' in self) || !(self.languageRegex instanceof RegExp)) {\n throw new Error('Tokenizer must have `languageRegex` attribute set and it should be a regular expression.')\n }\n if (!('lang_to_token' in self) || typeof self.lang_to_token !== 'function') {\n throw new Error('Tokenizer must have `lang_to_token` attribute set and it should be a function.')\n }\n const src_lang_token = generate_kwargs.src_lang;\n const tgt_lang_token = generate_kwargs.tgt_lang;\n\n // Check that the target language is valid:\n if (!self.language_codes.includes(tgt_lang_token)) {\n throw new Error(`Target language code \"${tgt_lang_token}\" is not valid. Must be one of: {${self.language_codes.join(', ')}}`);\n }\n\n // Allow `src_lang` to be optional. If not set, we'll use the tokenizer's default.\n if (src_lang_token !== undefined) {\n // Check that the source language is valid:\n if (!self.language_codes.includes(src_lang_token)) {\n throw new Error(`Source language code \"${src_lang_token}\" is not valid. Must be one of: {${self.language_codes.join(', ')}}`);\n }\n\n // In the same way as the Python library, we override the post-processor\n // to force the source language to be first:\n for (const item of self.post_processor.config.single) {\n if ('SpecialToken' in item && self.languageRegex.test(item.SpecialToken.id)) {\n item.SpecialToken.id = self.lang_to_token(src_lang_token);\n break;\n }\n }\n // TODO: Do the same for pair?\n }\n\n // Override the `forced_bos_token_id` to force the correct language\n generate_kwargs.forced_bos_token_id = self.model.convert_tokens_to_ids([self.lang_to_token(tgt_lang_token)])[0];\n\n return self._call(raw_inputs, tokenizer_options);\n}\n\n/**\n * The NllbTokenizer class is used to tokenize text for NLLB (\"No Language Left Behind\") models.\n * \n * No Language Left Behind (NLLB) is a first-of-its-kind, AI breakthrough project\n * that open-sources models capable of delivering high-quality translations directly\n * between any pair of 200+ languages — including low-resource languages like Asturian,\n * Luganda, Urdu and more. It aims to help people communicate with anyone, anywhere,\n * regardless of their language preferences. For more information, check out their\n * [paper](https://arxiv.org/abs/2207.04672).\n * \n * For a list of supported languages (along with their language codes),\n * @see {@link https://github.com/facebookresearch/flores/blob/main/flores200/README.md#languages-in-flores-200}\n */\nclass NllbTokenizer extends PreTrainedTokenizer {\n\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n\n this.languageRegex = /^[a-z]{3}_[A-Z][a-z]{3}$/;\n this.language_codes = this.special_tokens.filter(x => this.languageRegex.test(x));\n this.lang_to_token = x => x; // Identity function\n }\n\n /**\n * Helper function to build translation inputs for an `NllbTokenizer`.\n * @param {string|string[]} raw_inputs The text to tokenize.\n * @param {Object} tokenizer_options Options to be sent to the tokenizer\n * @param {Object} generate_kwargs Generation options.\n * @returns {Object} Object to be passed to the model.\n */\n _build_translation_inputs(raw_inputs, tokenizer_options, generate_kwargs) {\n return _build_translation_inputs(this, raw_inputs, tokenizer_options, generate_kwargs);\n }\n}\n\n/**\n * The M2M100Tokenizer class is used to tokenize text for M2M100 (\"Many-to-Many\") models.\n * \n * M2M100 is a multilingual encoder-decoder (seq-to-seq) model trained for Many-to-Many\n * multilingual translation. It was introduced in this [paper](https://arxiv.org/abs/2010.11125)\n * and first released in [this](https://github.com/pytorch/fairseq/tree/master/examples/m2m_100) repository.\n * \n * For a list of supported languages (along with their language codes),\n * @see {@link https://huggingface.co/facebook/m2m100_418M#languages-covered}\n */\nclass M2M100Tokenizer extends PreTrainedTokenizer {\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n\n this.languageRegex = /^__[a-z]{2,3}__$/;\n this.language_codes = this.special_tokens\n .filter(x => this.languageRegex.test(x))\n .map(x => x.slice(2, -2));\n this.lang_to_token = x => `__${x}__`;\n }\n\n /**\n * Helper function to build translation inputs for an `M2M100Tokenizer`.\n * @param {string|string[]} raw_inputs The text to tokenize.\n * @param {Object} tokenizer_options Options to be sent to the tokenizer\n * @param {Object} generate_kwargs Generation options.\n * @returns {Object} Object to be passed to the model.\n */\n _build_translation_inputs(raw_inputs, tokenizer_options, generate_kwargs) {\n return _build_translation_inputs(this, raw_inputs, tokenizer_options, generate_kwargs);\n }\n}\n\n\nconst WHISPER_LANGUAGES = [\n [\"en\", \"english\"],\n [\"zh\", \"chinese\"],\n [\"de\", \"german\"],\n [\"es\", \"spanish\"],\n [\"ru\", \"russian\"],\n [\"ko\", \"korean\"],\n [\"fr\", \"french\"],\n [\"ja\", \"japanese\"],\n [\"pt\", \"portuguese\"],\n [\"tr\", \"turkish\"],\n [\"pl\", \"polish\"],\n [\"ca\", \"catalan\"],\n [\"nl\", \"dutch\"],\n [\"ar\", \"arabic\"],\n [\"sv\", \"swedish\"],\n [\"it\", \"italian\"],\n [\"id\", \"indonesian\"],\n [\"hi\", \"hindi\"],\n [\"fi\", \"finnish\"],\n [\"vi\", \"vietnamese\"],\n [\"he\", \"hebrew\"],\n [\"uk\", \"ukrainian\"],\n [\"el\", \"greek\"],\n [\"ms\", \"malay\"],\n [\"cs\", \"czech\"],\n [\"ro\", \"romanian\"],\n [\"da\", \"danish\"],\n [\"hu\", \"hungarian\"],\n [\"ta\", \"tamil\"],\n [\"no\", \"norwegian\"],\n [\"th\", \"thai\"],\n [\"ur\", \"urdu\"],\n [\"hr\", \"croatian\"],\n [\"bg\", \"bulgarian\"],\n [\"lt\", \"lithuanian\"],\n [\"la\", \"latin\"],\n [\"mi\", \"maori\"],\n [\"ml\", \"malayalam\"],\n [\"cy\", \"welsh\"],\n [\"sk\", \"slovak\"],\n [\"te\", \"telugu\"],\n [\"fa\", \"persian\"],\n [\"lv\", \"latvian\"],\n [\"bn\", \"bengali\"],\n [\"sr\", \"serbian\"],\n [\"az\", \"azerbaijani\"],\n [\"sl\", \"slovenian\"],\n [\"kn\", \"kannada\"],\n [\"et\", \"estonian\"],\n [\"mk\", \"macedonian\"],\n [\"br\", \"breton\"],\n [\"eu\", \"basque\"],\n [\"is\", \"icelandic\"],\n [\"hy\", \"armenian\"],\n [\"ne\", \"nepali\"],\n [\"mn\", \"mongolian\"],\n [\"bs\", \"bosnian\"],\n [\"kk\", \"kazakh\"],\n [\"sq\", \"albanian\"],\n [\"sw\", \"swahili\"],\n [\"gl\", \"galician\"],\n [\"mr\", \"marathi\"],\n [\"pa\", \"punjabi\"],\n [\"si\", \"sinhala\"],\n [\"km\", \"khmer\"],\n [\"sn\", \"shona\"],\n [\"yo\", \"yoruba\"],\n [\"so\", \"somali\"],\n [\"af\", \"afrikaans\"],\n [\"oc\", \"occitan\"],\n [\"ka\", \"georgian\"],\n [\"be\", \"belarusian\"],\n [\"tg\", \"tajik\"],\n [\"sd\", \"sindhi\"],\n [\"gu\", \"gujarati\"],\n [\"am\", \"amharic\"],\n [\"yi\", \"yiddish\"],\n [\"lo\", \"lao\"],\n [\"uz\", \"uzbek\"],\n [\"fo\", \"faroese\"],\n [\"ht\", \"haitian creole\"],\n [\"ps\", \"pashto\"],\n [\"tk\", \"turkmen\"],\n [\"nn\", \"nynorsk\"],\n [\"mt\", \"maltese\"],\n [\"sa\", \"sanskrit\"],\n [\"lb\", \"luxembourgish\"],\n [\"my\", \"myanmar\"],\n [\"bo\", \"tibetan\"],\n [\"tl\", \"tagalog\"],\n [\"mg\", \"malagasy\"],\n [\"as\", \"assamese\"],\n [\"tt\", \"tatar\"],\n [\"haw\", \"hawaiian\"],\n [\"ln\", \"lingala\"],\n [\"ha\", \"hausa\"],\n [\"ba\", \"bashkir\"],\n [\"jw\", \"javanese\"],\n [\"su\", \"sundanese\"],\n]\n\n// @ts-ignore\nconst WHISPER_LANGUAGE_MAPPING = new Map(WHISPER_LANGUAGES);\n// @ts-ignore\nconst WHISPER_TO_LANGUAGE_CODE_MAPPING = new Map([\n ...WHISPER_LANGUAGES.map(([k, v]) => [v, k]),\n ...[\n [\"burmese\", \"my\"],\n [\"valencian\", \"ca\"],\n [\"flemish\", \"nl\"],\n [\"haitian\", \"ht\"],\n [\"letzeburgesch\", \"lb\"],\n [\"pushto\", \"ps\"],\n [\"panjabi\", \"pa\"],\n [\"moldavian\", \"ro\"],\n [\"moldovan\", \"ro\"],\n [\"sinhalese\", \"si\"],\n [\"castilian\", \"es\"],\n ]\n]);\n\n/**\n * WhisperTokenizer tokenizer\n * @extends PreTrainedTokenizer\n */\nclass WhisperTokenizer extends PreTrainedTokenizer {\n _default_chat_template = `{% for message in messages %}\" \"{{ message.content }}{{ eos_token }}\" \"{% endfor %}`;\n\n /**\n * Decodes automatic speech recognition (ASR) sequences.\n * @param {Array<{tokens: number[], token_timestamps?: number[], stride: number[]}>} sequences The sequences to decode.\n * @param {Object} options The options to use for decoding.\n * @returns {Array, text: string}>}>} The decoded sequences.\n */\n _decode_asr(sequences, {\n return_timestamps = false,\n return_language = false,\n time_precision = null,\n force_full_sequences = true\n } = {}) {\n // Set force_full_sequences=false if you want streaming\n // TODO add support for `return_language`\n\n // Internal method meant to only be used by asr pipeline.\n // Handles all the little quirks specific to whisper to handle\n // the various options not allowed in other seq2seq models\n\n // =========== Overview ============\n // - iterate over all outputs\n // - all tokens within output\n // - Each token can be\n // - language token\n // - special token\n // - timestamp token\n // - text token\n // - We accumulate the text tokens.\n // - We split on end timestamps\n // - Lots of complexity comes from stride and timestamps\n\n if (time_precision === null) {\n throw Error(\"Must specify time_precision\")\n }\n let last_language = null;\n\n const returnWordTimestamps = return_timestamps === \"word\";\n\n function new_chunk() {\n return { \"language\": last_language, \"timestamp\": [null, null], \"text\": \"\" };\n }\n\n // Welcome to the state machine!\n const chunks = [];\n let chunk = new_chunk();\n let time_offset = 0.0;\n const timestamp_begin = this.model.convert_tokens_to_ids([\"<|notimestamps|>\"])[0] + 1;\n\n let previous_tokens = [];\n let previous_token_timestamps = [];\n\n let skip = false;\n let right_stride_start = null;\n\n\n const all_special_ids = new Set(this.all_special_ids);\n\n for (const output of sequences) {\n // NOTE: python version has batches, so it uses [0]\n const token_ids = output.tokens;\n const token_timestamps = returnWordTimestamps ? output.token_timestamps : null;\n\n // These keep track of timestamps within strides, which need\n // to be skipped and resolve all tokens in a single chunk.\n let last_timestamp = null;\n let first_timestamp = timestamp_begin;\n\n if (\"stride\" in output) {\n const [chunk_len, stride_left, stride_right] = output.stride;\n\n // Offset the timings to account for the other `model_outputs`.\n time_offset -= stride_left;\n right_stride_start = chunk_len - stride_right;\n\n // Keeping track of timestamps within strides\n // We're going to NOT split on those, and delay until we're\n // out of BOTH stride. Otherwise lots of issues occur and\n // corner cases\n if (stride_left) {\n first_timestamp = stride_left / time_precision + timestamp_begin;\n }\n\n if (stride_right) {\n for (let i = token_ids.length - 1; i >= 0; --i) {\n const token = token_ids[i];\n if (token >= timestamp_begin) {\n // There can be several token in the right stride\n // But the last one is ALWAYS going to be skipped\n if (last_timestamp !== null && (token - timestamp_begin) * time_precision < right_stride_start) {\n break;\n }\n last_timestamp = token;\n }\n }\n }\n }\n\n let current_tokens = [];\n let current_token_timestamps = [];\n\n // - all tokens within output\n for (let i = 0; i < token_ids.length; ++i) {\n const token = token_ids[i];\n // 4 possible states for each token\n // - 1/ Language code\n // - 2/ all other special tokens (which we ignore)\n // - 3/ Timestamp\n // - 4/ Regular text\n\n if (all_special_ids.has(token)) {\n const text = this.decode([token]);\n const language = WHISPER_LANGUAGE_MAPPING.get(text.slice(2, -2));\n\n if (language !== undefined) {\n // 1/ Indeed some language\n // TODO Handle when language is different from the previous\n // one, and we cannot use timestamped tokens to create chunks\n if (last_language !== null && language !== last_language && !return_timestamps) {\n previous_tokens.push(current_tokens);\n const resolved_tokens = this.findLongestCommonSequence(previous_tokens)[0];\n const resolved_text = this.decode(resolved_tokens);\n chunk.text = resolved_text;\n chunks.push(chunk);\n\n // Flush all our temporary context\n previous_tokens = [];\n current_tokens = [];\n chunk = new_chunk();\n }\n\n last_language = chunk.language = language;\n } else {\n // 2/ This is a regular special token, ignoring it\n }\n } else if (token >= timestamp_begin) {\n // 3/ Timestamp token\n const time = (token - timestamp_begin) * time_precision + time_offset;\n const rounded_time = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.round)(time, 2);\n\n if (last_timestamp !== null && token >= last_timestamp) {\n // Whisper outputted a timestamp token, but it falls within\n // our stride, so we're going to skip it for the time being\n // and resolve this later\n // Skip is necessary because timestamp tokens always come\n // by pair, so we need to skip the next one too (which would mark the start of another chunk).\n skip = true;\n } else if (skip || (previous_tokens.length > 0 && token < first_timestamp)) {\n skip = false;\n } else if (chunk.timestamp[0] === null) {\n chunk.timestamp[0] = rounded_time;\n } else {\n // This is the end of the timestamp chunk\n if (rounded_time === chunk.timestamp[0]) {\n // This is a bug in timestamp token output\n // where we're taking the duplicate token\n // as a stop where it should be a start.\n // This is an issue in the underlying model output\n // Let's just skip it so it becomes de-factor a start agin\n } else {\n chunk.timestamp[1] = rounded_time;\n\n // Handling merges\n previous_tokens.push(current_tokens)\n\n if (returnWordTimestamps) {\n previous_token_timestamps.push(current_token_timestamps);\n }\n const [resolved_tokens, resolved_token_timestamps] = this.findLongestCommonSequence(\n previous_tokens, previous_token_timestamps\n )\n\n const resolved_text = this.decode(resolved_tokens)\n chunk.text = resolved_text\n\n if (returnWordTimestamps) {\n chunk.words = this.collateWordTimestamps(\n resolved_tokens, resolved_token_timestamps, last_language,\n )\n }\n\n chunks.push(chunk)\n\n // Flush all our temporary context\n previous_tokens = []\n current_tokens = []\n previous_token_timestamps = []\n current_token_timestamps = []\n chunk = new_chunk()\n }\n }\n\n } else {\n // 4/ Regular token\n // We just append to the list of all tokens so we can handle\n // merges later and decode into text.\n current_tokens.push(token)\n\n if (returnWordTimestamps) {\n let start_time = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.round)(token_timestamps[i] + time_offset, 2);\n\n let end_time;\n if (i + 1 < token_timestamps.length) {\n end_time = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.round)(token_timestamps[i + 1] + time_offset, 2);\n } else {\n // should never happen\n end_time = null;\n }\n current_token_timestamps.push([start_time, end_time]);\n }\n\n }\n }\n\n if ('stride' in output) {\n const [chunk_len, stride_left, stride_right] = output.stride;\n time_offset += chunk_len - stride_right\n }\n\n // Leftover tokens\n if (current_tokens.length > 0) {\n previous_tokens.push(current_tokens)\n if (returnWordTimestamps) {\n previous_token_timestamps.push(current_token_timestamps);\n }\n } else if (previous_tokens.every(p => p.length === 0)) {\n // Flushing previous tokens (END)\"\n chunk = new_chunk()\n previous_tokens = []\n current_tokens = []\n previous_token_timestamps = [];\n current_token_timestamps = [];\n }\n\n }\n\n if (previous_tokens.length > 0) {\n if (force_full_sequences && return_timestamps) {\n // Last token should always be timestamps, so there shouldn't be\n // leftover\n throw new Error(\n \"Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. \" +\n \"Also make sure WhisperTimeStampLogitsProcessor was used during generation.\"\n );\n }\n\n // Happens when we don't use timestamps\n const [resolved_tokens, resolved_token_timestamps] = this.findLongestCommonSequence(previous_tokens, previous_token_timestamps);\n\n // Flushing previous tokens (FINAL)\n const resolved_text = this.decode(resolved_tokens);\n chunk.text = resolved_text;\n if (returnWordTimestamps) {\n chunk.words = this.collateWordTimestamps(\n resolved_tokens, resolved_token_timestamps, last_language,\n )\n }\n chunks.push(chunk);\n }\n\n let optional = Object.create(null);\n\n // Preparing and cleaning up the pipeline output\n const full_text = chunks.map(chunk => chunk.text).join('');\n if (return_timestamps || return_language) {\n for (let i = 0; i < chunks.length; ++i) {\n const chunk = chunks[i];\n if (!return_timestamps) {\n delete chunk[\"timestamp\"];\n }\n\n if (!return_language) {\n delete chunk[\"language\"];\n }\n }\n if (returnWordTimestamps) {\n const new_chunks = [];\n for (const chunk of chunks) {\n for (const word of chunk.words) {\n new_chunks.push(word);\n }\n }\n optional = { \"chunks\": new_chunks };\n } else {\n optional = { \"chunks\": chunks };\n }\n }\n return [full_text, optional];\n\n }\n\n /**\n * Finds the longest common sequence among the provided sequences.\n * @param {number[][]} sequences An array of sequences of token ids to compare.\n * @returns {number[][]} The longest common sequence found.\n * @throws {Error} If there is a bug within the function.\n * @private\n */\n findLongestCommonSequence(sequences, token_timestamp_sequences = null) {\n // It would be much harder to do O(n) because of fault tolerance.\n // We actually have a really good property which is that the total sequence\n // MUST be those subsequences in order.\n // If token_timestamp_sequences is provided, will split those sequences in\n // exactly the same way.\n let leftSequence = sequences[0];\n let leftLength = leftSequence.length;\n let totalSequence = [];\n\n const use_token_timestamp_sequences = Array.isArray(token_timestamp_sequences) && token_timestamp_sequences.length > 0;\n let total_token_timestamp_sequence = use_token_timestamp_sequences ? [] : null;\n let left_token_timestamp_sequence = use_token_timestamp_sequences ? token_timestamp_sequences[0] : null;\n for (let i = 1; i < sequences.length; ++i) {\n const rightSequence = sequences[i];\n let max = 0.0;\n let maxIndices = [leftLength, leftLength, 0, 0];\n // Here we're sliding matches\n // [a, b, c, d]\n // [c, d, f]\n // = [c] == [d]\n\n // [a, b, c, d]\n // [c, d, f]\n // = [c, d] == [c, d]\n\n\n // [a, b, c, d]\n // [c, d, f]\n\n // = [b, c, d] == [c, d, f]\n\n // [a, b, c, d]\n // [c, d, f]\n\n // [a, b, c] == [c, d, f]\n\n // [a, b, c, d]\n // [d, f]\n\n // [a, b] == [d, f]\n\n // [a, b, c, d]\n // [f]\n\n // [a] == [f]\n\n const rightLength = rightSequence.length;\n for (let j = 1; j < leftLength + rightLength; ++j) {\n const eps = j / 10000.0;\n const leftStart = Math.max(0, leftLength - j);\n const leftStop = Math.min(leftLength, leftLength + rightLength - j);\n const left = leftSequence.slice(leftStart, leftStop);\n const rightStart = Math.max(0, j - leftLength);\n const rightStop = Math.min(rightLength, j);\n const right = rightSequence.slice(rightStart, rightStop);\n if (left.length !== right.length) {\n throw new Error(\"There is a bug within whisper `decode_asr` function, please report it. Dropping to prevent bad inference.\");\n }\n const matches = left.filter((elem, idx) => elem === right[idx]).length;\n const matching = matches / j + eps;\n if (matches > 1 && matching > max) {\n max = matching;\n maxIndices = [leftStart, leftStop, rightStart, rightStop];\n }\n }\n const [leftStart, leftStop, rightStart, rightStop] = maxIndices;\n const leftMid = Math.floor((leftStop + leftStart) / 2);\n const rightMid = Math.floor((rightStop + rightStart) / 2);\n totalSequence.push(...leftSequence.slice(0, leftMid));\n leftSequence = rightSequence.slice(rightMid);\n leftLength = leftSequence.length;\n\n if (use_token_timestamp_sequences) {\n total_token_timestamp_sequence.push(...left_token_timestamp_sequence.slice(0, leftMid));\n left_token_timestamp_sequence = token_timestamp_sequences[i].slice(rightMid);\n }\n }\n totalSequence.push(...leftSequence);\n\n if (use_token_timestamp_sequences) {\n total_token_timestamp_sequence.push(...left_token_timestamp_sequence);\n return [totalSequence, total_token_timestamp_sequence];\n } else {\n return [totalSequence, []];\n }\n }\n\n /** @private */\n collateWordTimestamps(tokens, token_timestamps, language) {\n\n const [words, _, token_indices] = this.combineTokensIntoWords(tokens, language);\n\n const timings = [];\n for (let i = 0; i < words.length; ++i) {\n const indices = token_indices[i];\n timings.push({\n text: words[i],\n timestamp: [\n token_timestamps[indices.at(0)][0],\n token_timestamps[indices.at(-1)][1],\n ],\n });\n }\n return timings;\n }\n\n /**\n * Groups tokens by word. Returns a tuple containing a list of strings with the words,\n * and a list of `token_id` sequences with the tokens making up each word.\n * @param {number[]} tokens \n * @param {string} [language] \n * @param {string} prepend_punctionations \n * @param {string} append_punctuations \n * \n * @private\n */\n combineTokensIntoWords(tokens, language, prepend_punctionations = \"\\\"'“¡¿([{-\", append_punctuations = \"\\\"'.。,,!!??::”)]}、\") {\n language = language ?? 'english';\n\n let words, word_tokens, token_indices;\n\n if ([\"chinese\", \"japanese\", \"thai\", \"lao\", \"myanmar\"].includes(language)) {\n // These languages don't typically use spaces.\n [words, word_tokens, token_indices] = this.splitTokensOnUnicode(tokens)\n } else {\n [words, word_tokens, token_indices] = this.splitTokensOnSpaces(tokens)\n }\n\n return this.mergePunctuations(words, word_tokens, token_indices, prepend_punctionations, append_punctuations);\n }\n\n /** @type {PreTrainedTokenizer['decode']} */\n decode(\n token_ids,\n decode_args,\n ) {\n let text;\n // @ts-ignore\n if (decode_args && decode_args.decode_with_timestamps) {\n if (token_ids instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor) {\n token_ids = prepareTensorForDecode(token_ids);\n }\n text = this.decodeWithTimestamps(token_ids, decode_args);\n } else {\n text = super.decode(token_ids, decode_args);\n }\n // TODO: implement offsets\n // if (decode_args.output_offsets) {\n // let offsets = this.computeOffsets\n // }\n return text;\n }\n\n /**\n * @param {number[]} token_ids List of token IDs to decode.\n * @param {Object} decode_args Optional arguments for decoding\n * @private\n */\n decodeWithTimestamps(token_ids, decode_args) {\n const time_precision = decode_args?.time_precision ?? 0.02;\n\n const timestamp_begin = Array.from(this.all_special_ids).at(-1) + 1;\n /**@type {Array} */\n let outputs = [[]];\n for (const token of token_ids) {\n if (token >= timestamp_begin) {\n const timestamp = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.round)((token - timestamp_begin) * time_precision, 2);\n outputs.push(`<|${timestamp}|>`);\n outputs.push([]);\n } else {\n outputs[outputs.length - 1].push(token);\n }\n }\n outputs = outputs.map(\n s => {\n if (typeof s === 'string') {\n return s;\n } else {\n return super.decode(s, decode_args);\n }\n }\n )\n\n return outputs.join('');\n }\n\n /**\n * Combine tokens into words by splitting at any position where the tokens are decoded as valid unicode points.\n * @param {number[]} tokens \n * @returns {*}\n * @private\n */\n splitTokensOnUnicode(tokens) {\n const decoded_full = this.decode(tokens, {\n // @ts-ignore\n decode_with_timestamps: true,\n });\n const replacement_char = '\\uFFFD';\n\n const words = []\n const word_tokens = []\n const token_indices = []\n let current_tokens = []\n let current_indices = []\n let unicode_offset = 0\n\n for (let token_idx = 0; token_idx < tokens.length; ++token_idx) {\n const token = tokens[token_idx];\n\n current_tokens.push(token);\n current_indices.push(token_idx);\n\n const decoded = this.decode(current_tokens, {\n // @ts-ignore\n decode_with_timestamps: true,\n });\n\n if (!decoded.includes(replacement_char) || decoded_full[unicode_offset + decoded.indexOf(replacement_char)] === replacement_char) {\n words.push(decoded)\n word_tokens.push(current_tokens)\n token_indices.push(current_indices)\n current_tokens = []\n current_indices = []\n unicode_offset += decoded.length;\n }\n\n }\n\n return [words, word_tokens, token_indices]\n }\n\n /**\n * Combine tokens into words by splitting at whitespace and punctuation tokens.\n * @param {number[]} tokens \n * @private\n */\n splitTokensOnSpaces(tokens) {\n\n const [subwords, subword_tokens_list, subword_indices_list] = this.splitTokensOnUnicode(tokens);\n\n const words = []\n const word_tokens = []\n const token_indices = []\n\n const punctuationRegex = new RegExp(`^[${PUNCTUATION_REGEX}]$`, 'gu');\n\n for (let i = 0; i < subwords.length; ++i) {\n\n const subword = subwords[i];\n const subword_tokens = subword_tokens_list[i];\n const subword_indices = subword_indices_list[i];\n\n // @ts-ignore\n const special = subword_tokens[0] >= this.model.tokens_to_ids.get('<|endoftext|>');\n const with_space = subword.startsWith(' ');\n const trimmed = subword.trim();\n const punctuation = punctuationRegex.test(trimmed);\n\n if (special || with_space || punctuation || words.length === 0) {\n words.push(subword);\n word_tokens.push(subword_tokens);\n token_indices.push(subword_indices);\n } else {\n const ix = words.length - 1;\n words[ix] += subword;\n word_tokens[ix].push(...subword_tokens);\n token_indices[ix].push(...subword_indices);\n }\n }\n\n return [words, word_tokens, token_indices];\n\n }\n\n /**\n * Merges punctuation tokens with neighboring words.\n * @param {string[]} words \n * @param {number[][]} tokens \n * @param {number[][]} indices \n * @param {string} prepended \n * @param {string} appended \n * @private\n */\n mergePunctuations(words, tokens, indices, prepended, appended) {\n\n const newWords = structuredClone(words);\n const newTokens = structuredClone(tokens);\n const newIndices = structuredClone(indices);\n\n\n // prepend punctuations\n let i = newWords.length - 2;\n let j = newWords.length - 1;\n\n while (i >= 0) {\n if (newWords[i].startsWith(' ') && prepended.includes(newWords[i].trim())) {\n newWords[j] = newWords[i] + newWords[j];\n newTokens[j] = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(newTokens[i], newTokens[j]);\n newIndices[j] = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(newIndices[i], newIndices[j]);\n newWords[i] = '';\n newTokens[i] = [];\n newIndices[i] = [];\n } else {\n j = i;\n }\n --i;\n }\n\n // append punctuations\n i = 0;\n j = 1;\n while (j < newWords.length) {\n if (!newWords[i].endsWith(' ') && appended.includes(newWords[j])) {\n newWords[i] += newWords[j];\n newTokens[i] = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(newTokens[i], newTokens[j]);\n newIndices[i] = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(newIndices[i], newIndices[j]);\n newWords[j] = '';\n newTokens[j] = [];\n newIndices[j] = [];\n } else {\n i = j;\n }\n ++j;\n }\n\n return [\n newWords.filter(x => x),\n newTokens.filter(x => x.length > 0),\n newIndices.filter(x => x.length > 0),\n ]\n }\n\n /**\n * Helper function to build translation inputs for a `WhisperTokenizer`,\n * depending on the language, task, and whether to predict timestamp tokens.\n * \n * Used to override the prefix tokens appended to the start of the label sequence.\n * \n * **Example: Get ids for a language**\n * ```javascript\n * // instantiate the tokenizer and set the prefix token to Spanish\n * const tokenizer = await WhisperTokenizer.from_pretrained('Xenova/whisper-tiny');\n * const forced_decoder_ids = tokenizer.get_decoder_prompt_ids({ language: 'spanish' });\n * // [(1, 50262), (2, 50363)]\n * ```\n * \n * @param {Object} options Options to generate the decoder prompt.\n * @param {string} [options.language] The language of the transcription text.\n * The corresponding language id token is appended to the start of the sequence for multilingual\n * speech recognition and speech translation tasks, e.g. for \"Spanish\" the token \"<|es|>\" is appended\n * to the start of sequence.\n * @param {string} [options.task] Task identifier to append at the start of sequence (if any).\n * This should be used for mulitlingual fine-tuning, with \"transcribe\" for speech recognition and\n * \"translate\" for speech translation.\n * @param {boolean} [options.no_timestamps] Whether to add the <|notimestamps|> token at the start of the sequence.\n * @returns {number[][]} The decoder prompt ids.\n */\n get_decoder_prompt_ids({\n language = null,\n task = null,\n no_timestamps = true,\n } = {}) {\n\n // <|lang_id|> <|task|> <|notimestamps|>\n\n const forced_decoder_ids = [];\n\n if (language) {\n // User wishes to specify the language\n language = language.toLowerCase();\n\n // Map to code from user-friendly name (e.g., \"english\" -> \"en\")\n let language_code = WHISPER_TO_LANGUAGE_CODE_MAPPING.get(language);\n\n if (language_code === undefined) {\n // User provided something that is not a language name\n\n if (WHISPER_LANGUAGE_MAPPING.has(language)) {\n // User provided the language code directly (e.g., \"en\")\n language_code = language;\n\n } else {\n // User provided something that is not a language code or name\n const is_language_code = language.length === 2;\n const langs = is_language_code ? WHISPER_LANGUAGE_MAPPING.keys() : WHISPER_LANGUAGE_MAPPING.values();\n\n throw new Error(`Language \"${language}\" is not supported. Must be one of: ${JSON.stringify(langs)}`);\n }\n }\n\n const language_token_id = this.model.tokens_to_ids.get(`<|${language_code}|>`);\n if (language_token_id === undefined) {\n throw new Error(`Unable to find language \"${language_code}\" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.`)\n }\n\n forced_decoder_ids.push(language_token_id);\n } else {\n // No token will be forced, which leaves the model to predict the language\n forced_decoder_ids.push(null);\n }\n\n if (task) {\n task = task.toLowerCase();\n if (task !== 'transcribe' && task !== 'translate') {\n throw new Error(`Task \"${task}\" is not supported. Must be one of: [\"transcribe\", \"translate\"]`);\n }\n\n const task_token_id = this.model.tokens_to_ids.get(`<|${task}|>`);\n if (task_token_id === undefined) {\n throw new Error(`Unable to find task \"${task}\" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.`)\n }\n\n forced_decoder_ids.push(task_token_id);\n } else {\n // No token will be forced, which leaves the model to predict the task\n forced_decoder_ids.push(null);\n }\n\n if (no_timestamps) {\n const no_timestamps_id = this.model.tokens_to_ids.get(`<|notimestamps|>`);\n if (no_timestamps_id === undefined) {\n throw new Error('Unable to find \"<|notimestamps|>\" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.')\n }\n\n forced_decoder_ids.push(no_timestamps_id);\n }\n\n return forced_decoder_ids.map((x, i) => [i + 1, x]).filter(x => x[1] !== null);\n\n }\n}\nclass CodeGenTokenizer extends PreTrainedTokenizer { }\nclass CLIPTokenizer extends PreTrainedTokenizer { }\nclass SiglipTokenizer extends PreTrainedTokenizer { }\n\n/**\n * @todo This model is not yet supported by Hugging Face's \"fast\" tokenizers library (https://github.com/huggingface/tokenizers).\n * Therefore, this implementation (which is based on fast tokenizers) may produce slightly inaccurate results.\n */\nclass MarianTokenizer extends PreTrainedTokenizer {\n /**\n * Create a new MarianTokenizer instance.\n * @param {Object} tokenizerJSON The JSON of the tokenizer.\n * @param {Object} tokenizerConfig The config of the tokenizer.\n */\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n\n this.languageRegex = /^(>>\\w+<<)\\s*/g;\n\n this.supported_language_codes = this.model.vocab.filter(\n x => this.languageRegex.test(x)\n );\n\n console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\\'s \"fast\" tokenizers library. Therefore, you may experience slightly inaccurate results.')\n }\n\n /**\n * Encodes a single text. Overriding this method is necessary since the language codes\n * must be removed before encoding with sentencepiece model.\n * @see https://github.com/huggingface/transformers/blob/12d51db243a00726a548a43cc333390ebae731e3/src/transformers/models/marian/tokenization_marian.py#L204-L213\n *\n * @param {string|null} text The text to encode.\n * @returns {Array} The encoded tokens.\n */\n _encode_text(text) {\n if (text === null) return null;\n\n // Check if text starts with language code:\n const [matchInfo, ...remainder] = text.trim().split(this.languageRegex);\n\n if (remainder.length === 0) {\n // No language code, encode normally\n return super._encode_text(matchInfo);\n\n } else if (remainder.length === 2) {\n // Text starts with language code, so we do not encode it with sentencepiece.\n const [language, text] = remainder;\n\n if (!this.supported_language_codes.includes(language)) {\n console.warn(`Unsupported language code \"${language}\" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`)\n }\n return (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)([language], super._encode_text(text));\n }\n }\n\n}\n\nclass Wav2Vec2CTCTokenizer extends PreTrainedTokenizer { }\n\nclass BlenderbotTokenizer extends PreTrainedTokenizer {\n _default_chat_template = `{% for message in messages %}{% if message['role'] == 'user' %}{{ ' ' }}{% endif %}{{ message['content'] }}{% if not loop.last %}{{ ' ' }}{% endif %}{% endfor %}{{ eos_token }}`;\n}\nclass BlenderbotSmallTokenizer extends BlenderbotTokenizer { } // NOTE `BlenderbotTokenizer` to get the correct chat template\n\nclass SpeechT5Tokenizer extends PreTrainedTokenizer { }\n\nclass NougatTokenizer extends PreTrainedTokenizer { }\n\nclass VitsTokenizer extends PreTrainedTokenizer {\n\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n\n // Custom decoder function\n this.decoder = new VitsDecoder({});\n }\n}\n/**\n * Helper class which is used to instantiate pretrained tokenizers with the `from_pretrained` function.\n * The chosen tokenizer class is determined by the type specified in the tokenizer config.\n * \n * @example\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/bert-base-uncased');\n */\nclass AutoTokenizer {\n static TOKENIZER_CLASS_MAPPING = {\n T5Tokenizer,\n DistilBertTokenizer,\n CamembertTokenizer,\n DebertaTokenizer,\n DebertaV2Tokenizer,\n BertTokenizer,\n HerbertTokenizer,\n ConvBertTokenizer,\n RoFormerTokenizer,\n XLMTokenizer,\n ElectraTokenizer,\n MobileBertTokenizer,\n SqueezeBertTokenizer,\n AlbertTokenizer,\n GPT2Tokenizer,\n BartTokenizer,\n MBartTokenizer,\n MBart50Tokenizer,\n RobertaTokenizer,\n WhisperTokenizer,\n CodeGenTokenizer,\n CLIPTokenizer,\n SiglipTokenizer,\n MarianTokenizer,\n BloomTokenizer,\n NllbTokenizer,\n M2M100Tokenizer,\n LlamaTokenizer,\n CodeLlamaTokenizer,\n XLMRobertaTokenizer,\n MPNetTokenizer,\n FalconTokenizer,\n GPTNeoXTokenizer,\n EsmTokenizer,\n Wav2Vec2CTCTokenizer,\n BlenderbotTokenizer,\n BlenderbotSmallTokenizer,\n SpeechT5Tokenizer,\n NougatTokenizer,\n VitsTokenizer,\n Qwen2Tokenizer,\n GemmaTokenizer,\n\n // Base case:\n PreTrainedTokenizer,\n }\n\n\n /**\n * Instantiate one of the tokenizer classes of the library from a pretrained model.\n * \n * The tokenizer class to instantiate is selected based on the `tokenizer_class` property of the config object\n * (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible)\n * \n * @param {string} pretrained_model_name_or_path The name or path of the pretrained model. Can be either:\n * - A string, the *model id* of a pretrained tokenizer hosted inside a model repo on huggingface.co.\n * Valid model ids can be located at the root-level, like `bert-base-uncased`, or namespaced under a\n * user or organization name, like `dbmdz/bert-base-german-cased`.\n * - A path to a *directory* containing tokenizer files, e.g., `./my_model_directory/`.\n * @param {PretrainedTokenizerOptions} options Additional options for loading the tokenizer.\n * \n * @returns {Promise} A new instance of the PreTrainedTokenizer class.\n */\n static async from_pretrained(pretrained_model_name_or_path, {\n quantized = true,\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n legacy = null,\n } = {}) {\n\n const [tokenizerJSON, tokenizerConfig] = await loadTokenizer(pretrained_model_name_or_path, {\n quantized,\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n legacy,\n })\n\n // Some tokenizers are saved with the \"Fast\" suffix, so we remove that if present.\n const tokenizerName = tokenizerConfig.tokenizer_class?.replace(/Fast$/, '') ?? 'PreTrainedTokenizer';\n\n let cls = this.TOKENIZER_CLASS_MAPPING[tokenizerName];\n if (!cls) {\n console.warn(`Unknown tokenizer class \"${tokenizerName}\", attempting to construct from base class.`);\n cls = PreTrainedTokenizer;\n }\n return new cls(tokenizerJSON, tokenizerConfig);\n }\n}\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/tokenizers.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AlbertTokenizer: () => (/* binding */ AlbertTokenizer),\n/* harmony export */ AutoTokenizer: () => (/* binding */ AutoTokenizer),\n/* harmony export */ BartTokenizer: () => (/* binding */ BartTokenizer),\n/* harmony export */ BertTokenizer: () => (/* binding */ BertTokenizer),\n/* harmony export */ BlenderbotSmallTokenizer: () => (/* binding */ BlenderbotSmallTokenizer),\n/* harmony export */ BlenderbotTokenizer: () => (/* binding */ BlenderbotTokenizer),\n/* harmony export */ BloomTokenizer: () => (/* binding */ BloomTokenizer),\n/* harmony export */ CLIPTokenizer: () => (/* binding */ CLIPTokenizer),\n/* harmony export */ CamembertTokenizer: () => (/* binding */ CamembertTokenizer),\n/* harmony export */ CodeGenTokenizer: () => (/* binding */ CodeGenTokenizer),\n/* harmony export */ CodeLlamaTokenizer: () => (/* binding */ CodeLlamaTokenizer),\n/* harmony export */ CohereTokenizer: () => (/* binding */ CohereTokenizer),\n/* harmony export */ ConvBertTokenizer: () => (/* binding */ ConvBertTokenizer),\n/* harmony export */ DebertaTokenizer: () => (/* binding */ DebertaTokenizer),\n/* harmony export */ DebertaV2Tokenizer: () => (/* binding */ DebertaV2Tokenizer),\n/* harmony export */ DistilBertTokenizer: () => (/* binding */ DistilBertTokenizer),\n/* harmony export */ ElectraTokenizer: () => (/* binding */ ElectraTokenizer),\n/* harmony export */ EsmTokenizer: () => (/* binding */ EsmTokenizer),\n/* harmony export */ FalconTokenizer: () => (/* binding */ FalconTokenizer),\n/* harmony export */ GPT2Tokenizer: () => (/* binding */ GPT2Tokenizer),\n/* harmony export */ GPTNeoXTokenizer: () => (/* binding */ GPTNeoXTokenizer),\n/* harmony export */ GemmaTokenizer: () => (/* binding */ GemmaTokenizer),\n/* harmony export */ Grok1Tokenizer: () => (/* binding */ Grok1Tokenizer),\n/* harmony export */ HerbertTokenizer: () => (/* binding */ HerbertTokenizer),\n/* harmony export */ LlamaTokenizer: () => (/* binding */ LlamaTokenizer),\n/* harmony export */ M2M100Tokenizer: () => (/* binding */ M2M100Tokenizer),\n/* harmony export */ MBart50Tokenizer: () => (/* binding */ MBart50Tokenizer),\n/* harmony export */ MBartTokenizer: () => (/* binding */ MBartTokenizer),\n/* harmony export */ MPNetTokenizer: () => (/* binding */ MPNetTokenizer),\n/* harmony export */ MarianTokenizer: () => (/* binding */ MarianTokenizer),\n/* harmony export */ MobileBertTokenizer: () => (/* binding */ MobileBertTokenizer),\n/* harmony export */ NllbTokenizer: () => (/* binding */ NllbTokenizer),\n/* harmony export */ NougatTokenizer: () => (/* binding */ NougatTokenizer),\n/* harmony export */ PreTrainedTokenizer: () => (/* binding */ PreTrainedTokenizer),\n/* harmony export */ Qwen2Tokenizer: () => (/* binding */ Qwen2Tokenizer),\n/* harmony export */ RoFormerTokenizer: () => (/* binding */ RoFormerTokenizer),\n/* harmony export */ RobertaTokenizer: () => (/* binding */ RobertaTokenizer),\n/* harmony export */ SiglipTokenizer: () => (/* binding */ SiglipTokenizer),\n/* harmony export */ SpeechT5Tokenizer: () => (/* binding */ SpeechT5Tokenizer),\n/* harmony export */ SqueezeBertTokenizer: () => (/* binding */ SqueezeBertTokenizer),\n/* harmony export */ T5Tokenizer: () => (/* binding */ T5Tokenizer),\n/* harmony export */ TokenizerModel: () => (/* binding */ TokenizerModel),\n/* harmony export */ VitsTokenizer: () => (/* binding */ VitsTokenizer),\n/* harmony export */ Wav2Vec2CTCTokenizer: () => (/* binding */ Wav2Vec2CTCTokenizer),\n/* harmony export */ WhisperTokenizer: () => (/* binding */ WhisperTokenizer),\n/* harmony export */ XLMRobertaTokenizer: () => (/* binding */ XLMRobertaTokenizer),\n/* harmony export */ XLMTokenizer: () => (/* binding */ XLMTokenizer)\n/* harmony export */ });\n/* harmony import */ var _utils_core_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/core.js */ \"./node_modules/@xenova/transformers/src/utils/core.js\");\n/* harmony import */ var _utils_hub_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/hub.js */ \"./node_modules/@xenova/transformers/src/utils/hub.js\");\n/* harmony import */ var _utils_maths_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/maths.js */ \"./node_modules/@xenova/transformers/src/utils/maths.js\");\n/* harmony import */ var _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/tensor.js */ \"./node_modules/@xenova/transformers/src/utils/tensor.js\");\n/* harmony import */ var _utils_data_structures_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/data-structures.js */ \"./node_modules/@xenova/transformers/src/utils/data-structures.js\");\n/* harmony import */ var _huggingface_jinja__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @huggingface/jinja */ \"./node_modules/@huggingface/jinja/dist/index.js\");\n\n/**\n * @file Tokenizers are used to prepare textual inputs for a model.\n * \n * **Example:** Create an `AutoTokenizer` and use it to tokenize a sentence.\n * This will automatically detect the tokenizer type based on the tokenizer class defined in `tokenizer.json`.\n * ```javascript\n * import { AutoTokenizer } from '@xenova/transformers';\n * \n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/bert-base-uncased');\n * const { input_ids } = await tokenizer('I love transformers!');\n * // Tensor {\n * // data: BigInt64Array(6) [101n, 1045n, 2293n, 19081n, 999n, 102n],\n * // dims: [1, 6],\n * // type: 'int64',\n * // size: 6,\n * // }\n * ```\n * \n * @module tokenizers\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @typedef {Object} TokenizerProperties Additional tokenizer-specific properties.\n * @property {boolean} [legacy=false] Whether or not the `legacy` behavior of the tokenizer should be used.\n * @typedef {import('./utils/hub.js').PretrainedOptions & TokenizerProperties} PretrainedTokenizerOptions\n */\n\n/**\n * Loads a tokenizer from the specified path.\n * @param {string} pretrained_model_name_or_path The path to the tokenizer directory.\n * @param {PretrainedTokenizerOptions} options Additional options for loading the tokenizer.\n * @returns {Promise} A promise that resolves with information about the loaded tokenizer.\n */\nasync function loadTokenizer(pretrained_model_name_or_path, options) {\n\n const info = await Promise.all([\n (0,_utils_hub_js__WEBPACK_IMPORTED_MODULE_1__.getModelJSON)(pretrained_model_name_or_path, 'tokenizer.json', true, options),\n (0,_utils_hub_js__WEBPACK_IMPORTED_MODULE_1__.getModelJSON)(pretrained_model_name_or_path, 'tokenizer_config.json', true, options),\n ])\n\n // Override legacy option if `options.legacy` is not null\n if (options.legacy !== null) {\n info[1].legacy = options.legacy;\n }\n return info;\n}\n\n\n/**\n * Helper function to split a string on a regex, but keep the delimiters.\n * This is required, because the JavaScript `.split()` method does not keep the delimiters,\n * and wrapping in a capturing group causes issues with existing capturing groups (due to nesting).\n * @param {string} text The text to split.\n * @param {RegExp} regex The regex to split on.\n * @returns {string[]} The split string.\n */\nfunction regexSplit(text, regex) {\n const result = [];\n let prev = 0;\n for (const match of text.matchAll(regex)) {\n const fullMatch = match[0];\n if (prev < match.index) {\n result.push(text.slice(prev, match.index));\n }\n if (fullMatch.length > 0) {\n result.push(fullMatch);\n }\n prev = match.index + fullMatch.length;\n }\n if (prev < text.length) {\n result.push(text.slice(prev));\n }\n return result;\n}\n\n\n/**\n * Helper method to construct a pattern from a config object.\n * @param {Object} pattern The pattern object.\n * @param {boolean} invert Whether to invert the pattern.\n * @returns {RegExp|null} The compiled pattern.\n */\nfunction createPattern(pattern, invert = true) {\n\n if (pattern.Regex !== undefined) {\n // In certain cases, the pattern may contain unnecessary escape sequences (e.g., \\# or \\& or \\~).\n // i.e., valid in Python (where the patterns are exported from) but invalid in JavaScript (where the patterns are parsed).\n // This isn't an issue when creating the regex w/o the 'u' flag, but it is when the 'u' flag is used.\n // For this reason, it is necessary to remove these backslashes before creating the regex.\n // See https://stackoverflow.com/a/63007777/13989043 for more information\n let regex = pattern.Regex.replace(/\\\\([#&~])/g, '$1'); // TODO: add more characters to this list if necessary\n\n // We also handle special cases where the regex contains invalid (non-JS compatible) syntax.\n for (const [key, value] of PROBLEMATIC_REGEX_MAP) {\n regex = regex.replaceAll(key, value);\n }\n\n return new RegExp(regex, 'gu');\n\n } else if (pattern.String !== undefined) {\n const escaped = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.escapeRegExp)(pattern.String);\n // NOTE: if invert is true, we wrap the pattern in a group so that it is kept when performing .split()\n return new RegExp(invert ? escaped : `(${escaped})`, 'gu');\n\n } else {\n console.warn('Unknown pattern type:', pattern)\n return null;\n }\n}\n\n/**\n * Helper function to convert an Object to a Map\n * @param {Object} obj The object to convert.\n * @returns {Map} The map.\n */\nfunction objectToMap(obj) {\n return new Map(Object.entries(obj));\n}\n\n/**\n * Helper function to convert a tensor to a list before decoding.\n * @param {Tensor} tensor The tensor to convert.\n * @returns {number[]} The tensor as a list.\n */\nfunction prepareTensorForDecode(tensor) {\n const dims = tensor.dims;\n switch (dims.length) {\n case 1:\n return tensor.tolist();\n case 2:\n if (dims[0] !== 1) {\n throw new Error('Unable to decode tensor with `batch size !== 1`. Use `tokenizer.batch_decode(...)` for batched inputs.');\n }\n return tensor.tolist()[0];\n default:\n throw new Error(`Expected tensor to have 1-2 dimensions, got ${dims.length}.`)\n }\n}\n\n/**\n * Clean up a list of simple English tokenization artifacts like spaces before punctuations and abbreviated forms\n * @param {string} text The text to clean up.\n * @returns {string} The cleaned up text.\n */\nfunction clean_up_tokenization(text) {\n // Clean up a list of simple English tokenization artifacts\n // like spaces before punctuations and abbreviated forms\n return text.replace(/ \\./g, '.')\n .replace(/ \\?/g, '?')\n .replace(/ \\!/g, '!')\n .replace(/ ,/g, ',')\n .replace(/ \\' /g, \"'\")\n .replace(/ n\\'t/g, \"n't\")\n .replace(/ \\'m/g, \"'m\")\n .replace(/ \\'s/g, \"'s\")\n .replace(/ \\'ve/g, \"'ve\")\n .replace(/ \\'re/g, \"'re\");\n}\n\n/**\n * Helper function to remove accents from a string.\n * @param {string} text The text to remove accents from.\n * @returns {string} The text with accents removed.\n */\nfunction remove_accents(text) {\n return text.replace(/[\\u0300-\\u036f]/g, '');\n}\n\n/**\n * Helper function to lowercase a string and remove accents.\n * @param {string} text The text to lowercase and remove accents from.\n * @returns {string} The lowercased text with accents removed.\n */\nfunction lowercase_and_remove_accent(text) {\n return remove_accents(text.toLowerCase());\n}\n\n/**\n * Helper function to fuse consecutive values in an array equal to the specified value.\n * @param {string[]} arr The input array\n * @param {any} value The value to fuse on.\n * @param {Map} mapping The mapping from input domain to value.\n */\nfunction fuse(arr, value, mapping) {\n const fused = [];\n let i = 0;\n while (i < arr.length) {\n fused.push(arr[i])\n if ((mapping.get(arr[i]) ?? value) !== value) {\n ++i;\n continue;\n }\n\n while (i < arr.length && (mapping.get(arr[i]) ?? value) === value) {\n ++i;\n }\n }\n\n return fused;\n}\n\n/**\n * Split a string on whitespace.\n * @param {string} text The text to split.\n * @returns {string[]} The split string.\n */\nfunction whitespace_split(text) {\n return text.match(/\\S+/g) || [];\n}\n\nconst PUNCTUATION_REGEX = '\\\\p{P}\\\\u0021-\\\\u002F\\\\u003A-\\\\u0040\\\\u005B-\\\\u0060\\\\u007B-\\\\u007E';\n\n// A mapping of regex patterns to their equivalent (but longer) JS-compatible versions.\nconst PROBLEMATIC_REGEX_MAP = new Map([\n // This uses the case insensitive group modifier, which is not supported in JavaScript.\n // When parsing the regex, an \"Invalid group\" error is thrown.\n [\"(?i:'s|'t|'re|'ve|'m|'ll|'d)\", \"(?:'([sS]|[tT]|[rR][eE]|[vV][eE]|[mM]|[lL][lL]|[dD]))\"],\n])\n\n\n/**\n * Represent a token added by the user on top of the existing Model vocabulary.\n * AddedToken can be configured to specify the behavior they should have in various situations like:\n * - Whether they should only match single words\n * - Whether to include any whitespace on its left or right\n */\nclass AddedToken {\n /**\n * Creates a new instance of AddedToken.\n * @param {Object} config Added token configuration object.\n * @param {string} config.content The content of the added token.\n * @param {number} config.id The id of the added token.\n * @param {boolean} [config.single_word=false] Whether this token must be a single word or can break words.\n * @param {boolean} [config.lstrip=false] Whether this token should strip whitespaces on its left.\n * @param {boolean} [config.rstrip=false] Whether this token should strip whitespaces on its right.\n * @param {boolean} [config.normalized=false] Whether this token should be normalized.\n * @param {boolean} [config.special=false] Whether this token is special.\n */\n constructor(config) {\n this.content = config.content;\n this.id = config.id;\n this.single_word = config.single_word ?? false;\n this.lstrip = config.lstrip ?? false;\n this.rstrip = config.rstrip ?? false;\n this.special = config.special ?? false;\n this.normalized = config.normalized ?? null;\n }\n}\n\n/**\n * Abstract base class for tokenizer models.\n *\n * @extends Callable\n */\nclass TokenizerModel extends _utils_core_js__WEBPACK_IMPORTED_MODULE_0__.Callable {\n /**\n * Creates a new instance of TokenizerModel.\n * @param {Object} config The configuration object for the TokenizerModel.\n */\n constructor(config) {\n super();\n this.config = config;\n\n /** @type {string[]} */\n this.vocab = [];\n\n /**\n * A mapping of tokens to ids.\n * @type {Map}\n */\n this.tokens_to_ids = new Map();\n\n this.unk_token_id = undefined;\n this.unk_token = undefined;\n this.end_of_word_suffix = undefined;\n\n /** @type {boolean} Whether to fuse unknown tokens when encoding. Defaults to false. */\n this.fuse_unk = this.config.fuse_unk ?? false;\n }\n\n /**\n * Instantiates a new TokenizerModel instance based on the configuration object provided.\n * @param {Object} config The configuration object for the TokenizerModel.\n * @param {...*} args Optional arguments to pass to the specific TokenizerModel constructor.\n * @returns {TokenizerModel} A new instance of a TokenizerModel.\n * @throws Will throw an error if the TokenizerModel type in the config is not recognized.\n */\n static fromConfig(config, ...args) {\n switch (config.type) {\n case 'WordPiece':\n return new WordPieceTokenizer(config);\n case 'Unigram':\n // @ts-ignore\n return new Unigram(config, ...args);\n\n case 'BPE':\n return new BPE(config);\n\n default:\n if (config.vocab) {\n // @ts-ignore\n return new LegacyTokenizerModel(config, ...args);\n }\n throw new Error(`Unknown TokenizerModel type: ${config.type}`);\n }\n }\n\n /**\n * Internal function to call the TokenizerModel instance.\n * @param {string[]} tokens The tokens to encode.\n * @returns {string[]} The encoded token IDs.\n */\n _call(tokens) {\n let ids = this.encode(tokens);\n if (this.fuse_unk) {\n // Fuse unknown tokens\n ids = fuse(ids, this.unk_token_id, this.tokens_to_ids);\n }\n return ids;\n }\n\n /**\n * Encodes a list of tokens into a list of token IDs.\n * @param {string[]} tokens The tokens to encode.\n * @returns {string[]} The encoded tokens.\n * @throws Will throw an error if not implemented in a subclass.\n */\n encode(tokens) {\n throw Error(\"encode should be implemented in subclass.\")\n }\n\n /**\n * Converts a list of tokens into a list of token IDs.\n * @param {string[]} tokens The tokens to convert.\n * @returns {number[]} The converted token IDs.\n */\n convert_tokens_to_ids(tokens) {\n return tokens.map(t => this.tokens_to_ids.get(t) ?? this.unk_token_id);\n }\n\n /**\n * Converts a list of token IDs into a list of tokens.\n * @param {number[]} ids The token IDs to convert.\n * @returns {string[]} The converted tokens.\n */\n convert_ids_to_tokens(ids) {\n return ids.map(i => this.vocab[i] ?? this.unk_token);\n }\n}\n\n/**\n * A subclass of TokenizerModel that uses WordPiece encoding to encode tokens.\n * @extends TokenizerModel\n */\nclass WordPieceTokenizer extends TokenizerModel {\n /**\n * @param {Object} config The configuration object.\n * @param {Object} config.vocab A mapping of tokens to ids.\n * @param {string} config.unk_token The unknown token string.\n * @param {string} config.continuing_subword_prefix The prefix to use for continuing subwords.\n * @param {number} [config.max_input_chars_per_word=100] The maximum number of characters per word.\n */\n constructor(config) {\n super(config);\n /**\n * A mapping of tokens to ids.\n * @type {Map}\n */\n this.tokens_to_ids = objectToMap(config.vocab);\n\n /**\n * The id of the unknown token.\n * @type {number}\n */\n this.unk_token_id = this.tokens_to_ids.get(config.unk_token);\n\n /**\n * The unknown token string.\n * @type {string}\n */\n this.unk_token = config.unk_token;\n\n /**\n * The maximum number of characters allowed per word.\n * @type {number}\n */\n this.max_input_chars_per_word = config.max_input_chars_per_word ?? 100;\n\n /**\n * An array of tokens.\n * @type {string[]}\n */\n this.vocab = new Array(this.tokens_to_ids.size);\n for (const [key, value] of this.tokens_to_ids) {\n this.vocab[value] = key;\n }\n }\n\n /**\n * Encodes an array of tokens using WordPiece encoding.\n * @param {string[]} tokens The tokens to encode.\n * @returns {string[]} An array of encoded tokens.\n */\n encode(tokens) {\n const outputTokens = [];\n for (const token of tokens) {\n const chars = [...token];\n if (chars.length > this.max_input_chars_per_word) {\n outputTokens.push(this.unk_token);\n continue;\n }\n\n let isUnknown = false;\n let start = 0;\n const subTokens = [];\n\n while (start < chars.length) {\n let end = chars.length;\n let currentSubstring = null;\n while (start < end) {\n let substr = chars.slice(start, end).join('');\n\n if (start > 0) {\n substr = this.config.continuing_subword_prefix + substr;\n }\n if (this.tokens_to_ids.has(substr)) {\n currentSubstring = substr;\n break;\n }\n\n --end;\n }\n if (currentSubstring === null) {\n isUnknown = true;\n break;\n }\n subTokens.push(currentSubstring);\n start = end;\n }\n if (isUnknown) {\n outputTokens.push(this.unk_token);\n } else {\n outputTokens.push(...subTokens);\n }\n }\n\n return outputTokens;\n }\n\n}\n\n/**\n * Class representing a Unigram tokenizer model.\n * @extends TokenizerModel\n */\nclass Unigram extends TokenizerModel {\n /**\n * Create a new Unigram tokenizer model.\n * @param {Object} config The configuration object for the Unigram model.\n * @param {number} config.unk_id The ID of the unknown token\n * @param {any[][]} config.vocab A 2D array representing a mapping of tokens to scores.\n * @param {Object} moreConfig Additional configuration object for the Unigram model.\n */\n constructor(config, moreConfig) {\n super(config);\n\n const vocabSize = config.vocab.length;\n this.vocab = new Array(vocabSize);\n this.scores = new Array(vocabSize);\n for (let i = 0; i < vocabSize; ++i) {\n const piece = config.vocab[i];\n this.vocab[i] = piece[0];\n this.scores[i] = piece[1];\n }\n\n this.unk_token_id = config.unk_id;\n this.unk_token = this.vocab[config.unk_id];\n\n this.tokens_to_ids = new Map(this.vocab.map((x, i) => [x, i]));\n this.bosToken = ' '; // beginning of a sentence token\n\n this.bosTokenId = this.tokens_to_ids.get(this.bosToken); // NOTE: may be undefined\n this.eosToken = moreConfig.eos_token;\n\n this.eosTokenId = this.tokens_to_ids.get(this.eosToken);\n this.unkToken = this.vocab[this.unk_token_id];\n\n this.minScore = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.min)(this.scores)[0];\n\n this.unkScore = this.minScore - 10.0;\n this.scores[this.unk_token_id] = this.unkScore;\n\n this.trie = new _utils_data_structures_js__WEBPACK_IMPORTED_MODULE_4__.CharTrie();\n this.trie.extend(this.vocab);\n\n // NOTE: `fuse_unk` is hardcoded to true for Unigram models\n // See: https://github.com/huggingface/tokenizers/blob/b58227c7f1ccf8b73ee2268354336da56d91e492/tokenizers/src/models/unigram/model.rs#L119\n this.fuse_unk = true;\n }\n\n /**\n * Populates lattice nodes.\n * @param {TokenLattice} lattice The token lattice to populate with nodes.\n */\n populateNodes(lattice) {\n const sentence = lattice.sentence;\n const len = sentence.length;\n let beginPos = 0;\n while (beginPos < len) {\n const mblen = 1;\n let hasSingleNode = false;\n const tokens = [];\n\n for (let token of this.trie.commonPrefixSearch(sentence.slice(beginPos))) {\n tokens.push(token);\n const tokenId = this.tokens_to_ids.get(token);\n const tokenScore = this.scores[tokenId];\n const n = token.length;\n lattice.insert(beginPos, n, tokenScore, tokenId);\n if (!hasSingleNode && n === mblen) {\n hasSingleNode = true;\n }\n }\n if (!hasSingleNode) {\n lattice.insert(beginPos, mblen, this.unkScore, this.unk_token_id);\n }\n beginPos += mblen;\n }\n }\n\n /**\n * Encodes an array of tokens into an array of subtokens using the unigram model.\n *\n * @param {string} normalized The normalized string.\n * @returns {string[]} An array of subtokens obtained by encoding the input tokens using the unigram model.\n */\n tokenize(normalized) {\n const lattice = new _utils_data_structures_js__WEBPACK_IMPORTED_MODULE_4__.TokenLattice(normalized, this.bosTokenId, this.eosTokenId);\n this.populateNodes(lattice);\n return lattice.tokens();\n }\n\n /**\n * Encodes an array of tokens using Unigram encoding.\n * @param {string[]} tokens The tokens to encode.\n * @returns {string[]} An array of encoded tokens.\n */\n encode(tokens) {\n const toReturn = [];\n for (const token of tokens) {\n const tokenized = this.tokenize(token);\n toReturn.push(...tokenized);\n }\n return toReturn;\n }\n\n}\n\n/**\n * Returns list of utf-8 byte and a mapping to unicode strings.\n * Specifically avoids mapping to whitespace/control characters the BPE code barfs on.\n * @returns {Object} Object with utf-8 byte keys and unicode string values.\n */\nconst BYTES_TO_UNICODE = (() => {\n // Returns list of utf-8 byte and a mapping to unicode strings.\n // We specifically avoids mapping to whitespace/control characters\n // the bpe code barfs on.\n\n const bs = [\n ...Array.from({ length: \"~\".charCodeAt(0) - \"!\".charCodeAt(0) + 1 }, (_, i) => i + \"!\".charCodeAt(0)),\n ...Array.from({ length: \"¬\".charCodeAt(0) - \"¡\".charCodeAt(0) + 1 }, (_, i) => i + \"¡\".charCodeAt(0)),\n ...Array.from({ length: \"ÿ\".charCodeAt(0) - \"®\".charCodeAt(0) + 1 }, (_, i) => i + \"®\".charCodeAt(0)),\n ];\n const cs = bs.slice();\n let n = 0;\n for (let b = 0; b < 256; ++b) {\n if (!bs.includes(b)) {\n bs.push(b);\n cs.push(256 + n);\n n += 1;\n }\n }\n const ccs = cs.map(n => String.fromCharCode(n));\n return Object.fromEntries(bs.map((b, i) => [b, ccs[i]]));\n})();\n\nconst UNICODE_TO_BYTES = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.reverseDictionary)(BYTES_TO_UNICODE);\n\n\n/**\n * @typedef {Object} BPENode\n * @property {string} token The token associated with the node\n * @property {number} bias A positional bias for the node.\n * @property {number} [score] The score of the node.\n * @property {BPENode} [prev] The previous node in the linked list.\n * @property {BPENode} [next] The next node in the linked list.\n */\n\n/**\n * BPE class for encoding text into Byte-Pair-Encoding (BPE) tokens.\n * @extends TokenizerModel\n */\nclass BPE extends TokenizerModel {\n /**\n * Create a BPE instance.\n * @param {Object} config The configuration object for BPE.\n * @param {Object} config.vocab A mapping of tokens to ids.\n * @param {string} config.unk_token The unknown token used for out of vocabulary words.\n * @param {string} config.end_of_word_suffix The suffix to place at the end of each word.\n * @param {string} [config.continuing_subword_suffix] The suffix to insert between words.\n * @param {Array} config.merges An array of BPE merges as strings.\n */\n constructor(config) {\n super(config);\n\n this.BPE_SPLIT_TOKEN = ' ';\n\n /** @type {Map} */\n this.tokens_to_ids = objectToMap(config.vocab);\n\n this.unk_token_id = this.tokens_to_ids.get(config.unk_token);\n this.unk_token = config.unk_token;\n\n this.vocab = new Array(this.tokens_to_ids.size);\n for (const [key, value] of this.tokens_to_ids) {\n this.vocab[value] = key;\n }\n\n this.bpe_ranks = new Map(config.merges.map((x, i) => [x, i]));\n this.merges = config.merges.map(x => x.split(this.BPE_SPLIT_TOKEN));\n\n this.end_of_word_suffix = config.end_of_word_suffix;\n\n // NOTE: `continuing_subword_suffix` is custom (to support `BlenderbotSmallTokenizer`)\n this.continuing_subword_suffix = config.continuing_subword_suffix ?? null;\n\n this.byte_fallback = this.config.byte_fallback ?? false;\n\n if (this.byte_fallback) {\n this.text_encoder = new TextEncoder();\n }\n\n /** @type {Map} */\n this.cache = new Map();\n }\n\n /**\n * Apply Byte-Pair-Encoding (BPE) to a given token. Efficient heap-based priority\n * queue implementation adapted from https://github.com/belladoreai/llama-tokenizer-js.\n * @param {string} token The token to encode.\n * @returns {string[]} The BPE encoded tokens.\n */\n bpe(token) {\n if (token.length === 0) {\n return [];\n }\n\n const cached = this.cache.get(token);\n if (cached !== undefined) {\n return cached;\n }\n\n const word = Array.from(token);\n if (this.end_of_word_suffix) {\n word[word.length - 1] += this.end_of_word_suffix;\n }\n\n let result = [];\n if (word.length > 1) {\n // Create a priority queue to store the nodes that will be merged.\n // The comparator function compares the scores of the nodes.\n const queue = new _utils_data_structures_js__WEBPACK_IMPORTED_MODULE_4__.PriorityQueue((a, b) => a.score < b.score);\n\n // Construct a doubly-linked list of nodes that will be inserted into the priority queue,\n // starting with the individual characters. We also populate each node with a positional\n // bias to break ties in the priority queue.\n let startingNode = {\n token: word[0],\n bias: 0,\n prev: null,\n next: null,\n }\n\n let previousNode = startingNode\n for (let i = 1; i < word.length; ++i) {\n const currentNode = {\n bias: i / word.length, // Add fractional component to break ties\n token: word[i],\n prev: previousNode,\n next: null,\n }\n previousNode.next = currentNode\n this._add_node(queue, previousNode)\n previousNode = currentNode\n }\n\n while (!queue.isEmpty()) {\n // Get the next node with the highest priority\n const node = queue.pop();\n\n // Check that this merge is still possible\n if (node.deleted || !node.next || node.next.deleted) continue;\n\n // Here, we mark the current node (left side of the merge) and the next node (right side of the merge) as deleted.\n // This is because they will both be replaced by a new node representing the merge result.\n node.deleted = true;\n node.next.deleted = true;\n\n // Next, we fix the node that comes before the current node (i.e., left side of the merge).\n if (node.prev) {\n\n // Make a shallow copy of the previous node\n const newPreviousNode = { ...node.prev };\n\n // Mark the old previous node as deleted. This avoids erroneous merges later,\n // because there may still be references to this node in the priority queue.\n node.prev.deleted = true;\n node.prev = newPreviousNode;\n\n // Update the reference of the previous node, by pointing its previous node to this new previous node.\n if (newPreviousNode.prev) {\n newPreviousNode.prev.next = newPreviousNode;\n } else {\n // If the previous of the previous node does not exist, it means that\n // `newPreviousNode` must be the new `startingNode`.\n startingNode = newPreviousNode;\n }\n }\n\n // Create a new node which represents the result of the merge.\n const merged = {\n token: node.token + node.next.token,\n bias: node.bias,\n prev: node.prev,\n next: node.next.next,\n }\n\n // We now consider where we can add the new merged node to the priority queue:\n // 1. prev <-> merged\n if (merged.prev) {\n merged.prev.next = merged;\n this._add_node(queue, merged.prev);\n } else {\n // If `merged.prev` does not exist, then `merged` must be the new `startingNode`.\n startingNode = merged;\n }\n\n // 2. merged <-> next\n if (merged.next) {\n merged.next.prev = merged;\n this._add_node(queue, merged);\n }\n }\n\n // Traverse the linked list, starting from the `startingNode`, and collect the tokens.\n for (let currentNode = startingNode; currentNode !== null; currentNode = currentNode.next) {\n result.push(currentNode.token);\n }\n } else {\n result = word;\n }\n\n // Possibly append suffix\n if (this.continuing_subword_suffix) {\n // Do not append suffix to the last token\n for (let i = 0; i < result.length - 1; ++i) {\n result[i] += this.continuing_subword_suffix;\n }\n }\n\n // Save the result to the cache\n this.cache.set(token, result);\n\n return result;\n }\n\n\n /**\n * Helper function to add a node to the priority queue.\n * @param {PriorityQueue} queue \n * @param {BPENode} node\n * @private\n */\n _add_node(queue, node) {\n // `score` is a measure of the merge priority: lower means higher priority\n // We use the BPE rank as a measure of priority (i.e., the local of the merge in the merges list)\n // We also add a fractional component to the score to break ties (with the earlier character having higher priority)\n const rank = this.bpe_ranks.get(node.token + this.BPE_SPLIT_TOKEN + node.next.token);\n if (rank !== undefined) {\n node.score = rank + node.bias;\n queue.push(node);\n }\n }\n\n /**\n * Encodes the input sequence of tokens using the BPE algorithm and returns the resulting subword tokens.\n * @param {string[]} tokens The input sequence of tokens to encode.\n * @returns {string[]} The resulting subword tokens after applying the BPE algorithm to the input sequence of tokens.\n */\n encode(tokens) {\n const outputTokens = [];\n\n for (const token of tokens) {\n const bpe_token_list = this.bpe(token);\n\n for (const t of bpe_token_list) {\n if (this.tokens_to_ids.has(t)) {\n outputTokens.push(t);\n } else {\n if (this.byte_fallback) {\n outputTokens.push(\n ...Array.from(this.text_encoder.encode(t))\n .map(x => `<0x${x.toString(16).toUpperCase().padStart(2, '0')}>`)\n );\n } else {\n outputTokens.push(this.unk_token);\n }\n }\n }\n }\n\n return outputTokens;\n }\n\n}\n\n/**\n * Legacy tokenizer class for tokenizers with only a vocabulary.\n */\nclass LegacyTokenizerModel extends TokenizerModel {\n /**\n * Create a LegacyTokenizerModel instance.\n * @param {Object} config The configuration object for LegacyTokenizerModel.\n * @param {Object} config.vocab A (possibly nested) mapping of tokens to ids.\n * @param {Object} moreConfig Additional configuration object for the LegacyTokenizerModel model.\n */\n constructor(config, moreConfig) {\n super(config);\n\n /**@type {Map} */\n this.tokens_to_ids = objectToMap(\n moreConfig.target_lang\n ? config.vocab[moreConfig.target_lang]\n : config.vocab\n );\n\n this.bos_token = moreConfig.bos_token;\n this.bos_token_id = this.tokens_to_ids.get(this.bos_token);\n\n this.eos_token = moreConfig.eos_token;\n this.eos_token_id = this.tokens_to_ids.get(this.eos_token);\n\n this.pad_token = moreConfig.pad_token;\n this.pad_token_id = this.tokens_to_ids.get(this.pad_token);\n\n this.unk_token = moreConfig.unk_token;\n this.unk_token_id = this.tokens_to_ids.get(this.unk_token);\n\n this.vocab = new Array(this.tokens_to_ids.size);\n for (const [key, value] of this.tokens_to_ids) {\n this.vocab[value] = key;\n }\n }\n\n encode(tokens) {\n return tokens;\n }\n}\n\n\n/**\n * A base class for text normalization.\n * @abstract\n */\nclass Normalizer extends _utils_core_js__WEBPACK_IMPORTED_MODULE_0__.Callable {\n /**\n * @param {Object} config The configuration object for the normalizer.\n */\n constructor(config) {\n super();\n this.config = config;\n }\n\n /**\n * Factory method for creating normalizers from config objects.\n * @static\n * @param {Object} config The configuration object for the normalizer.\n * @returns {Normalizer} A Normalizer object.\n * @throws {Error} If an unknown Normalizer type is specified in the config.\n */\n static fromConfig(config) {\n if (config === null) return null;\n switch (config.type) {\n case 'BertNormalizer':\n return new BertNormalizer(config);\n case 'Precompiled':\n return new Precompiled(config);\n case 'Sequence':\n return new NormalizerSequence(config);\n case 'Replace':\n return new Replace(config);\n case 'NFC':\n return new NFC(config);\n case 'NFKC':\n return new NFKC(config);\n case 'NFKD':\n return new NFKD(config);\n case 'Strip':\n return new StripNormalizer(config);\n case 'StripAccents':\n return new StripAccents(config);\n case 'Lowercase':\n return new Lowercase(config);\n case 'Prepend':\n return new Prepend(config);\n default:\n throw new Error(`Unknown Normalizer type: ${config.type}`);\n }\n }\n\n /**\n * Normalize the input text.\n * @abstract\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n * @throws {Error} If this method is not implemented in a subclass.\n */\n normalize(text) {\n throw Error(\"normalize should be implemented in subclass.\")\n }\n\n /**\n * Alias for {@link Normalizer#normalize}.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n _call(text) {\n return this.normalize(text);\n }\n\n}\n\n/**\n * Replace normalizer that replaces occurrences of a pattern with a given string or regular expression.\n * @extends Normalizer\n */\nclass Replace extends Normalizer {\n /**\n * Normalize the input text by replacing the pattern with the content.\n * @param {string} text The input text to be normalized.\n * @returns {string} The normalized text after replacing the pattern with the content.\n */\n normalize(text) {\n const pattern = createPattern(this.config.pattern);\n return pattern === null\n ? text\n : text.replaceAll(pattern, this.config.content);\n }\n}\n\n/**\n * A normalizer that applies Unicode normalization form C (NFC) to the input text.\n * @extends Normalizer\n */\nclass NFC extends Normalizer {\n /**\n * Normalize the input text by applying Unicode normalization form C (NFC).\n * @param {string} text The input text to be normalized.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n text = text.normalize('NFC')\n return text;\n }\n}\n\n/**\n * NFKC Normalizer.\n * @extends Normalizer\n */\nclass NFKC extends Normalizer {\n /**\n * Normalize text using NFKC normalization.\n * @param {string} text The text to be normalized.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n text = text.normalize('NFKC')\n return text;\n }\n}\n/**\n * NFKD Normalizer.\n * @extends Normalizer\n */\nclass NFKD extends Normalizer {\n /**\n * Normalize text using NFKD normalization.\n * @param {string} text The text to be normalized.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n text = text.normalize('NFKD')\n return text;\n }\n}\n\n/**\n * A normalizer that strips leading and/or trailing whitespace from the input text.\n */\nclass StripNormalizer extends Normalizer {\n /**\n * Strip leading and/or trailing whitespace from the input text.\n * @param {string} text The input text.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n if (this.config.strip_left && this.config.strip_right) {\n // Fast path to avoid an extra trim call\n text = text.trim();\n } else {\n if (this.config.strip_left) {\n text = text.trimStart();\n }\n if (this.config.strip_right) {\n text = text.trimEnd();\n }\n }\n return text;\n }\n}\n\n/**\n * StripAccents normalizer removes all accents from the text.\n * @extends Normalizer\n */\nclass StripAccents extends Normalizer {\n /**\n * Remove all accents from the text.\n * @param {string} text The input text.\n * @returns {string} The normalized text without accents.\n */\n normalize(text) {\n text = remove_accents(text);\n return text;\n }\n}\n\n/**\n * A Normalizer that lowercases the input string.\n * @extends Normalizer\n */\nclass Lowercase extends Normalizer {\n /**\n * Lowercases the input string.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n text = text.toLowerCase();\n return text;\n }\n}\n\n/**\n * A Normalizer that prepends a string to the input string.\n * @extends Normalizer\n */\nclass Prepend extends Normalizer {\n /**\n * Prepends the input string.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n text = this.config.prepend + text;\n return text;\n }\n}\n\n/**\n * A Normalizer that applies a sequence of Normalizers.\n * @extends Normalizer\n */\nclass NormalizerSequence extends Normalizer {\n /**\n * Create a new instance of NormalizerSequence.\n * @param {Object} config The configuration object.\n * @param {Object[]} config.normalizers An array of Normalizer configuration objects.\n */\n constructor(config) {\n super(config);\n this.normalizers = config.normalizers.map(x => Normalizer.fromConfig(x));\n }\n /**\n * Apply a sequence of Normalizers to the input text.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n return this.normalizers.reduce((t, normalizer) => {\n return normalizer.normalize(t);\n }, text);\n }\n}\n\n/**\n * A class representing a normalizer used in BERT tokenization.\n * @extends Normalizer\n */\nclass BertNormalizer extends Normalizer {\n /**\n * Adds whitespace around any CJK (Chinese, Japanese, or Korean) character in the input text.\n *\n * @param {string} text The input text to tokenize.\n * @returns {string} The tokenized text with whitespace added around CJK characters.\n */\n _tokenize_chinese_chars(text) {\n /* Adds whitespace around any CJK character. */\n const output = [];\n for (let i = 0; i < text.length; ++i) {\n const char = text[i];\n const cp = char.charCodeAt(0);\n if (this._is_chinese_char(cp)) {\n output.push(\" \");\n output.push(char);\n output.push(\" \");\n } else {\n output.push(char);\n }\n }\n return output.join(\"\");\n }\n\n /**\n * Checks whether the given Unicode codepoint represents a CJK (Chinese, Japanese, or Korean) character.\n *\n * A \"chinese character\" is defined as anything in the CJK Unicode block:\n * https://en.wikipedia.org/wiki/CJK_Unified_Ideographs_(Unicode_block)\n *\n * Note that the CJK Unicode block is NOT all Japanese and Korean characters, despite its name.\n * The modern Korean Hangul alphabet is a different block, as is Japanese Hiragana and Katakana.\n * Those alphabets are used to write space-separated words, so they are not treated specially\n * and are handled like all other languages.\n *\n * @param {number} cp The Unicode codepoint to check.\n * @returns {boolean} True if the codepoint represents a CJK character, false otherwise.\n */\n _is_chinese_char(cp) {\n return (\n (cp >= 0x4E00 && cp <= 0x9FFF)\n || (cp >= 0x3400 && cp <= 0x4DBF)\n || (cp >= 0x20000 && cp <= 0x2A6DF)\n || (cp >= 0x2A700 && cp <= 0x2B73F)\n || (cp >= 0x2B740 && cp <= 0x2B81F)\n || (cp >= 0x2B820 && cp <= 0x2CEAF)\n || (cp >= 0xF900 && cp <= 0xFAFF)\n || (cp >= 0x2F800 && cp <= 0x2FA1F)\n )\n }\n /**\n * Strips accents from the given text.\n * @param {string} text The text to strip accents from.\n * @returns {string} The text with accents removed.\n */\n stripAccents(text) {\n return text.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\n }\n\n\n /**\n * Checks whether `char` is a control character.\n * @param {string} char The character to check.\n * @returns {boolean} Whether `char` is a control character.\n * @private\n */\n _is_control(char) {\n switch (char) {\n case '\\t':\n case '\\n':\n case '\\r':\n // These are technically control characters but we count them as whitespace characters.\n return false;\n\n default:\n // Check if unicode category starts with C:\n // Cc - Control\n // Cf - Format\n // Co - Private Use\n // Cs - Surrogate\n return /^\\p{Cc}|\\p{Cf}|\\p{Co}|\\p{Cs}$/u.test(char);\n }\n }\n\n /**\n * Performs invalid character removal and whitespace cleanup on text.\n * @param {string} text The text to clean.\n * @returns {string} The cleaned text.\n * @private\n */\n _clean_text(text) {\n const output = [];\n for (const char of text) {\n const cp = char.charCodeAt(0);\n if (cp === 0 || cp === 0xFFFD || this._is_control(char)) {\n continue;\n }\n if (/^\\s$/.test(char)) { // is whitespace\n output.push(\" \");\n } else {\n output.push(char);\n }\n }\n return output.join(\"\");\n }\n /**\n * Normalizes the given text based on the configuration.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n if (this.config.clean_text) {\n text = this._clean_text(text);\n }\n\n if (this.config.handle_chinese_chars) {\n text = this._tokenize_chinese_chars(text);\n }\n\n if (this.config.lowercase) {\n text = text.toLowerCase();\n\n if (this.config.strip_accents !== false) {\n text = this.stripAccents(text);\n }\n } else if (this.config.strip_accents) {\n text = this.stripAccents(text);\n }\n\n return text;\n }\n}\n\n/**\n * A callable class representing a pre-tokenizer used in tokenization. Subclasses\n * should implement the `pre_tokenize_text` method to define the specific pre-tokenization logic.\n * @extends Callable\n */\nclass PreTokenizer extends _utils_core_js__WEBPACK_IMPORTED_MODULE_0__.Callable {\n /**\n * Factory method that returns an instance of a subclass of `PreTokenizer` based on the provided configuration.\n *\n * @static\n * @param {Object} config A configuration object for the pre-tokenizer.\n * @returns {PreTokenizer} An instance of a subclass of `PreTokenizer`.\n * @throws {Error} If the provided configuration object does not correspond to any known pre-tokenizer.\n */\n static fromConfig(config) {\n if (config === null) return null;\n\n switch (config.type) {\n case 'BertPreTokenizer':\n return new BertPreTokenizer(config);\n case 'Sequence':\n return new PreTokenizerSequence(config);\n case 'Whitespace':\n return new WhitespacePreTokenizer(config);\n case 'WhitespaceSplit':\n return new WhitespaceSplit(config);\n case 'Metaspace':\n return new MetaspacePreTokenizer(config);\n\n case 'ByteLevel':\n return new ByteLevelPreTokenizer(config);\n case 'Split':\n return new SplitPreTokenizer(config);\n case 'Punctuation':\n return new PunctuationPreTokenizer(config);\n case 'Digits':\n return new DigitsPreTokenizer(config);\n case 'Replace':\n return new ReplacePreTokenizer(config);\n default:\n throw new Error(`Unknown PreTokenizer type: ${config.type}`);\n }\n }\n\n /**\n * Method that should be implemented by subclasses to define the specific pre-tokenization logic.\n *\n * @abstract\n * @param {string} text The text to pre-tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} The pre-tokenized text.\n * @throws {Error} If the method is not implemented in the subclass.\n */\n pre_tokenize_text(text, options) {\n throw Error(\"pre_tokenize_text should be implemented in subclass.\")\n }\n\n /**\n * Tokenizes the given text into pre-tokens.\n * @param {string|string[]} text The text or array of texts to pre-tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of pre-tokens.\n */\n pre_tokenize(text, options) {\n return (Array.isArray(text)\n ? text.map(x => this.pre_tokenize_text(x, options))\n : this.pre_tokenize_text(text, options)\n ).flat();\n }\n\n /**\n * Alias for {@link PreTokenizer#pre_tokenize}.\n * @param {string|string[]} text The text or array of texts to pre-tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of pre-tokens.\n */\n _call(text, options) {\n return this.pre_tokenize(text, options);\n }\n}\n\n/**\n * @extends PreTokenizer\n */\nclass BertPreTokenizer extends PreTokenizer {\n /**\n * A PreTokenizer that splits text into wordpieces using a basic tokenization scheme\n * similar to that used in the original implementation of BERT.\n * \n * @param {Object} config The configuration object.\n */\n constructor(config) {\n super();\n // Construct a pattern which matches the rust implementation:\n // https://github.com/huggingface/tokenizers/blob/b4fcc9ce6e4ad5806e82826f816acfdfdc4fcc67/tokenizers/src/pre_tokenizers/bert.rs#L11\n // Equivalent to removing whitespace and splitting on punctuation (both \\p{P} and other ascii characters)\n this.pattern = new RegExp(`[^\\\\s${PUNCTUATION_REGEX}]+|[${PUNCTUATION_REGEX}]`, 'gu');\n }\n /**\n * Tokenizes a single text using the BERT pre-tokenization scheme.\n * \n * @param {string} text The text to tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens.\n */\n pre_tokenize_text(text, options) {\n return text.trim().match(this.pattern) || [];\n }\n}\n\n/**\n * A pre-tokenizer that splits text into Byte-Pair-Encoding (BPE) subwords.\n * @extends PreTokenizer\n */\nclass ByteLevelPreTokenizer extends PreTokenizer {\n /**\n * Creates a new instance of the `ByteLevelPreTokenizer` class.\n * @param {Object} config The configuration object.\n */\n constructor(config) {\n super();\n this.config = config;\n\n /**\n * @type {boolean} Whether to add a leading space to the first word.\n * This allows to treat the leading word just as any other word.\n */\n this.add_prefix_space = this.config.add_prefix_space;\n\n /**\n * @type {boolean} Whether the post processing step should trim offsets\n * to avoid including whitespaces.\n * @todo Use this in the pretokenization step.\n */\n this.trim_offsets = this.config.trim_offsets;\n\n /**\n * @type {boolean} Whether to use the standard GPT2 regex for whitespace splitting.\n * Set it to False if you want to use your own splitting. Defaults to true.\n */\n this.use_regex = this.config.use_regex ?? true;\n this.pattern = /'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+/gu;\n\n this.byte_encoder = BYTES_TO_UNICODE;\n this.text_encoder = new TextEncoder();\n }\n\n /**\n * Tokenizes a single piece of text using byte-level tokenization.\n * @param {string} text The text to tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens.\n */\n pre_tokenize_text(text, options) {\n // Add a leading space if the option is enabled\n if (this.add_prefix_space && !text.startsWith(' ')) {\n text = ' ' + text;\n }\n\n // Split on whitespace and punctuation\n const tokens = this.use_regex ? (text.match(this.pattern) || []) : [text];\n\n // Maps all our bytes to unicode strings, avoiding control tokens of the BPE (spaces in our case)\n return tokens.map(\n token => Array.from(this.text_encoder.encode(token), byte => this.byte_encoder[byte]).join('')\n );\n }\n}\n\n/**\n * @typedef {'removed'|'isolated'|'mergedWithPrevious'|'mergedWithNext'|'contiguous'} SplitDelimiterBehavior\n */\n\n/**\n * Splits text using a given pattern.\n * @extends PreTokenizer\n */\nclass SplitPreTokenizer extends PreTokenizer {\n /**\n * @param {Object} config The configuration options for the pre-tokenizer.\n * @param {Object} config.pattern The pattern used to split the text. Can be a string or a regex object.\n * @param {string|undefined} config.pattern.String The string to use for splitting. Only defined if the pattern is a string.\n * @param {string|undefined} config.pattern.Regex The regex to use for splitting. Only defined if the pattern is a regex.\n * @param {SplitDelimiterBehavior} config.behavior The behavior to use when splitting.\n * @param {boolean} config.invert Whether to split (invert=false) or match (invert=true) the pattern.\n */\n constructor(config) {\n super();\n this.config = config;\n // TODO support all behaviours (config.behavior)\n\n this.pattern = createPattern(this.config.pattern, this.config.invert);\n }\n\n /**\n * Tokenizes text by splitting it using the given pattern.\n * @param {string} text The text to tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens.\n */\n pre_tokenize_text(text, options) {\n if (this.pattern === null) {\n return [];\n }\n\n if (this.config.invert) {\n return text.match(this.pattern) || [];\n } else {\n return regexSplit(text, this.pattern);\n }\n }\n}\n\n/**\n * Splits text based on punctuation.\n * @extends PreTokenizer\n */\nclass PunctuationPreTokenizer extends PreTokenizer {\n /**\n * @param {Object} config The configuration options for the pre-tokenizer.\n * @param {SplitDelimiterBehavior} config.behavior The behavior to use when splitting.\n */\n constructor(config) {\n super();\n this.config = config;\n this.pattern = new RegExp(`[^${PUNCTUATION_REGEX}]+|[${PUNCTUATION_REGEX}]+`, 'gu');\n }\n\n /**\n * Tokenizes text by splitting it using the given pattern.\n * @param {string} text The text to tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens.\n */\n pre_tokenize_text(text, options) {\n return text.match(this.pattern) || [];\n }\n}\n\n\n/**\n * Splits text based on digits.\n * @extends PreTokenizer\n */\nclass DigitsPreTokenizer extends PreTokenizer {\n /**\n * @param {Object} config The configuration options for the pre-tokenizer.\n * @param {boolean} config.individual_digits Whether to split on individual digits.\n */\n constructor(config) {\n super();\n this.config = config;\n\n // Construct a pattern which matches the rust implementation:\n const digit_pattern = `[^\\\\d]+|\\\\d${this.config.individual_digits ? '' : '+'}`;\n this.pattern = new RegExp(digit_pattern, 'gu');\n }\n\n /**\n * Tokenizes text by splitting it using the given pattern.\n * @param {string} text The text to tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens.\n */\n pre_tokenize_text(text, options) {\n return text.match(this.pattern) || [];\n }\n}\n\n/**\n * @typedef {Object} PostProcessedOutput\n * @property {string[]} tokens List of token produced by the post-processor.\n * @property {number[]} [token_type_ids] List of token type ids produced by the post-processor.\n */\n\n\n/**\n * @typedef {Object} EncodingSingle\n * @property {number[]} input_ids List of token ids to be fed to a model.\n * @property {number[]} attention_mask List of token type ids to be fed to a model\n * @property {number[]} [token_type_ids] List of indices specifying which tokens should be attended to by the model\n */\n\n\n/**\n * @extends Callable\n */\nclass PostProcessor extends _utils_core_js__WEBPACK_IMPORTED_MODULE_0__.Callable {\n\n /**\n * @param {Object} config The configuration for the post-processor.\n */\n constructor(config) {\n super();\n this.config = config;\n }\n\n /**\n * Factory method to create a PostProcessor object from a configuration object.\n *\n * @param {Object} config Configuration object representing a PostProcessor.\n * @returns {PostProcessor} A PostProcessor object created from the given configuration.\n * @throws {Error} If an unknown PostProcessor type is encountered.\n */\n static fromConfig(config) {\n if (config === null) return null;\n switch (config.type) {\n case 'TemplateProcessing':\n return new TemplateProcessing(config);\n\n case 'ByteLevel':\n return new ByteLevelPostProcessor(config);\n\n case 'RobertaProcessing':\n return new RobertaProcessing(config);\n case 'BertProcessing':\n return new BertProcessing(config);\n\n default:\n throw new Error(`Unknown PostProcessor type: ${config.type}`);\n }\n }\n\n /**\n * Method to be implemented in subclass to apply post-processing on the given tokens.\n *\n * @param {Array} tokens The input tokens to be post-processed.\n * @param {...*} args Additional arguments required by the post-processing logic.\n * @returns {PostProcessedOutput} The post-processed tokens.\n * @throws {Error} If the method is not implemented in subclass.\n */\n post_process(tokens, ...args) {\n throw Error(\"post_process should be implemented in subclass.\")\n }\n\n /**\n * Alias for {@link PostProcessor#post_process}.\n * @param {Array} tokens The text or array of texts to post-process.\n * @param {...*} args Additional arguments required by the post-processing logic.\n * @returns {PostProcessedOutput} The post-processed tokens.\n */\n _call(tokens, ...args) {\n return this.post_process(tokens, ...args);\n }\n}\n\n/**\n * A post-processor that adds special tokens to the beginning and end of the input.\n */\nclass BertProcessing extends PostProcessor {\n /**\n * @param {Object} config The configuration for the post-processor.\n * @param {string[]} config.cls The special tokens to add to the beginning of the input.\n * @param {string[]} config.sep The special tokens to add to the end of the input.\n */\n constructor(config) {\n super(config);\n // TODO use all of config: add_prefix_space, trim_offsets\n\n this.cls = config.cls[0];\n this.sep = config.sep[0];\n }\n\n /**\n * Adds the special tokens to the beginning and end of the input.\n * @param {string[]} tokens The input tokens.\n * @param {string[]} [tokens_pair=null] An optional second set of input tokens.\n * @returns {PostProcessedOutput} The post-processed tokens with the special tokens added to the beginning and end.\n */\n post_process(tokens, tokens_pair = null, {\n add_special_tokens = true,\n } = {}) {\n if (add_special_tokens) {\n tokens = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)([this.cls], tokens, [this.sep]);\n }\n\n let token_type_ids = new Array(tokens.length).fill(0);\n if (tokens_pair !== null) {\n // NOTE: It is intended to add 2 EOS tokens after the first set of tokens\n // https://github.com/huggingface/tokenizers/issues/983\n const middle = (add_special_tokens && this instanceof RobertaProcessing)\n ? [this.sep]\n : [];\n const after = add_special_tokens ? [this.sep] : [];\n\n tokens = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(tokens, middle, tokens_pair, after);\n token_type_ids = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(token_type_ids, new Array(tokens_pair.length + middle.length + after.length).fill(1));\n }\n return { tokens, token_type_ids };\n }\n}\nclass RobertaProcessing extends BertProcessing { } // NOTE: extends BertProcessing\n\n/**\n * Post processor that replaces special tokens in a template with actual tokens.\n * @extends PostProcessor\n */\nclass TemplateProcessing extends PostProcessor {\n /**\n * Creates a new instance of `TemplateProcessing`.\n * @param {Object} config The configuration options for the post processor.\n * @param {Array} config.single The template for a single sequence of tokens.\n * @param {Array} config.pair The template for a pair of sequences of tokens.\n */\n constructor(config) {\n super(config);\n\n this.single = config.single;\n this.pair = config.pair;\n }\n\n /**\n * Replaces special tokens in the template with actual tokens.\n * @param {string[]} tokens The list of tokens for the first sequence.\n * @param {string[]} [tokens_pair=null] The list of tokens for the second sequence (optional).\n * @returns {PostProcessedOutput} An object containing the list of tokens with the special tokens replaced with actual tokens.\n */\n post_process(tokens, tokens_pair = null, {\n add_special_tokens = true,\n } = {}) {\n const type = tokens_pair === null ? this.single : this.pair\n\n let processedTokens = [];\n let types = [];\n for (const item of type) {\n if ('SpecialToken' in item) {\n if (add_special_tokens) {\n processedTokens.push(item.SpecialToken.id);\n types.push(item.SpecialToken.type_id);\n }\n } else if ('Sequence' in item) {\n if (item.Sequence.id === 'A') {\n processedTokens = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(processedTokens, tokens);\n types = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(types, new Array(tokens.length).fill(item.Sequence.type_id));\n\n } else if (item.Sequence.id === 'B') {\n processedTokens = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(processedTokens, tokens_pair);\n types = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(types, new Array(tokens_pair.length).fill(item.Sequence.type_id));\n }\n }\n }\n return { tokens: processedTokens, token_type_ids: types };\n }\n}\n\n/**\n * A PostProcessor that returns the given tokens as is.\n * @extends PostProcessor\n */\nclass ByteLevelPostProcessor extends PostProcessor {\n /**\n * Post process the given tokens.\n * @param {string[]} tokens The list of tokens for the first sequence.\n * @param {string[]} [tokens_pair=null] The list of tokens for the second sequence (optional).\n * @returns {PostProcessedOutput} An object containing the post-processed tokens.\n */\n post_process(tokens, tokens_pair = null) {\n if (tokens_pair) {\n tokens = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(tokens, tokens_pair);\n }\n return { tokens };\n }\n}\n\n/**\n * The base class for token decoders.\n * @extends Callable\n */\nclass Decoder extends _utils_core_js__WEBPACK_IMPORTED_MODULE_0__.Callable {\n\n /**\n * Creates an instance of `Decoder`.\n *\n * @param {Object} config The configuration object.\n */\n constructor(config) {\n super();\n this.config = config;\n\n /** @type {AddedToken[]} */\n this.added_tokens = [];\n this.end_of_word_suffix = null;\n this.trim_offsets = config.trim_offsets;\n }\n\n /**\n * Creates a decoder instance based on the provided configuration.\n *\n * @param {Object} config The configuration object.\n * @returns {Decoder} A decoder instance.\n * @throws {Error} If an unknown decoder type is provided.\n */\n static fromConfig(config) {\n if (config === null) return null;\n switch (config.type) {\n case 'WordPiece':\n return new WordPieceDecoder(config);\n case 'Metaspace':\n return new MetaspaceDecoder(config);\n case 'ByteLevel':\n return new ByteLevelDecoder(config);\n\n case 'Replace':\n return new ReplaceDecoder(config);\n case 'ByteFallback':\n return new ByteFallback(config);\n case 'Fuse':\n return new FuseDecoder(config);\n case 'Strip':\n return new StripDecoder(config);\n\n case 'Sequence':\n return new DecoderSequence(config);\n\n case 'CTC':\n return new CTCDecoder(config);\n case 'BPEDecoder':\n return new BPEDecoder(config);\n default:\n throw new Error(`Unknown Decoder type: ${config.type}`);\n }\n }\n\n /**\n * Calls the `decode` method.\n *\n * @param {string[]} tokens The list of tokens.\n * @returns {string} The decoded string.\n */\n _call(tokens) {\n return this.decode(tokens);\n }\n\n /**\n * Decodes a list of tokens.\n * @param {string[]} tokens The list of tokens.\n * @returns {string} The decoded string.\n */\n decode(tokens) {\n return this.decode_chain(tokens).join('');\n }\n\n /**\n * Apply the decoder to a list of tokens.\n * \n * @param {string[]} tokens The list of tokens.\n * @returns {string[]} The decoded list of tokens.\n * @throws {Error} If the `decode_chain` method is not implemented in the subclass.\n */\n decode_chain(tokens) {\n throw Error(\"`decode_chain` should be implemented in subclass.\")\n }\n\n}\n\nclass ReplaceDecoder extends Decoder {\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n const pattern = createPattern(this.config.pattern);\n return pattern === null\n ? tokens\n : tokens.map(token => token.replaceAll(pattern, this.config.content))\n }\n}\n\n\nclass ByteFallback extends Decoder {\n constructor(config) {\n super(config);\n\n this.text_decoder = new TextDecoder();\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n\n const new_tokens = [];\n let previous_byte_tokens = [];\n\n for (const token of tokens) {\n let bytes = null;\n if (token.length === 6 && token.startsWith('<0x') && token.endsWith('>')) {\n const byte = parseInt(token.slice(3, 5), 16);\n if (!isNaN(byte)) {\n bytes = byte;\n }\n }\n if (bytes !== null) {\n previous_byte_tokens.push(bytes);\n } else {\n if (previous_byte_tokens.length > 0) {\n const string = this.text_decoder.decode(Uint8Array.from(previous_byte_tokens));\n new_tokens.push(string);\n previous_byte_tokens = [];\n }\n new_tokens.push(token);\n }\n }\n if (previous_byte_tokens.length > 0) {\n const string = this.text_decoder.decode(Uint8Array.from(previous_byte_tokens));\n new_tokens.push(string);\n previous_byte_tokens = [];\n }\n\n return new_tokens;\n }\n}\n\n/**\n * Fuse simply fuses all tokens into one big string.\n * It's usually the last decoding step anyway, but this decoder\n * exists incase some decoders need to happen after that step\n */\nclass FuseDecoder extends Decoder {\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n return [tokens.join('')];\n }\n}\n\n\nclass StripDecoder extends Decoder {\n constructor(config) {\n super(config);\n\n this.content = this.config.content;\n this.start = this.config.start;\n this.stop = this.config.stop;\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n return tokens.map(token => {\n let start_cut = 0;\n for (let i = 0; i < this.start; ++i) {\n if (token[i] === this.content) {\n start_cut = i + 1;\n continue;\n } else {\n break;\n }\n }\n\n let stop_cut = token.length;\n for (let i = 0; i < this.stop; ++i) {\n const index = token.length - i - 1;\n if (token[index] === this.content) {\n stop_cut = index;\n continue;\n } else {\n break;\n }\n }\n\n return token.slice(start_cut, stop_cut)\n });\n }\n}\n\n/**\n * A decoder that decodes a list of WordPiece tokens into a single string.\n * @extends Decoder\n */\nclass WordPieceDecoder extends Decoder {\n\n /**\n * Creates a new instance of WordPieceDecoder.\n * @param {Object} config The configuration object.\n * @param {string} config.prefix The prefix used for WordPiece encoding.\n * @param {boolean} config.cleanup Whether to cleanup the decoded string.\n */\n constructor(config) {\n super(config);\n this.cleanup = config.cleanup;\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n return tokens.map((token, i) => {\n if (i !== 0) {\n if (token.startsWith(this.config.prefix)) {\n // NOTE: .replace() is intended; only replace first occurrence\n token = token.replace(this.config.prefix, '');\n } else {\n token = ' ' + token;\n }\n }\n if (this.cleanup) {\n token = clean_up_tokenization(token)\n }\n\n return token;\n });\n }\n}\n\n/**\n * Byte-level decoder for tokenization output. Inherits from the `Decoder` class.\n * @extends Decoder\n */\nclass ByteLevelDecoder extends Decoder {\n\n /**\n * Create a `ByteLevelDecoder` object.\n * @param {Object} config Configuration object.\n */\n constructor(config) {\n super(config);\n\n this.byte_decoder = UNICODE_TO_BYTES;\n this.text_decoder = new TextDecoder(\"utf-8\", {\n fatal: false,\n ignoreBOM: true,\n });\n\n this.end_of_word_suffix = null;\n }\n\n /**\n * Convert an array of tokens to string by decoding each byte.\n * @param {string[]} tokens Array of tokens to be decoded.\n * @returns {string} The decoded string.\n */\n convert_tokens_to_string(tokens) {\n const text = tokens.join('');\n const byteArray = new Uint8Array([...text].map(c => this.byte_decoder[c]));\n const decoded_text = this.text_decoder.decode(byteArray);\n return decoded_text;\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n // TODO move to base class (like HF)\n // tokens === filtered_tokens\n\n // To avoid mixing byte-level and unicode for byte-level BPT\n // we need to build string separately for added tokens and byte-level tokens\n // cf. https://github.com/huggingface/transformers/issues/1133\n const sub_texts = [];\n let current_sub_text = [];\n for (const token of tokens) {\n // tokens sent here are already filtered, so we don't need to do this\n // if (skip_special_tokens && this.all_special_ids.includes(token)) {\n // continue;\n // }\n\n if (this.added_tokens.find(x => x.content === token) !== undefined) {\n if (current_sub_text.length > 0) {\n sub_texts.push(this.convert_tokens_to_string(current_sub_text));\n current_sub_text = [];\n }\n sub_texts.push(token);\n } else {\n current_sub_text.push(token);\n }\n }\n if (current_sub_text.length > 0) {\n sub_texts.push(this.convert_tokens_to_string(current_sub_text));\n }\n\n // TODO add spaces_between_special_tokens and clean_up_tokenization_spaces options\n\n return sub_texts;\n }\n}\n\n/**\n * The CTC (Connectionist Temporal Classification) decoder.\n * See https://github.com/huggingface/tokenizers/blob/bb38f390a61883fc2f29d659af696f428d1cda6b/tokenizers/src/decoders/ctc.rs\n */\nclass CTCDecoder extends Decoder {\n\n constructor(config) {\n super(config);\n\n this.pad_token = this.config.pad_token;\n this.word_delimiter_token = this.config.word_delimiter_token;\n this.cleanup = this.config.cleanup;\n }\n /**\n * Converts a connectionist-temporal-classification (CTC) output tokens into a single string.\n * @param {string[]} tokens Array of tokens to be decoded.\n * @returns {string} The decoded string.\n */\n convert_tokens_to_string(tokens) {\n if (tokens.length === 0) return '';\n\n // group same tokens into non-repeating tokens in CTC style decoding\n const grouped_tokens = [tokens[0]];\n for (let i = 1; i < tokens.length; ++i) {\n if (tokens[i] !== grouped_tokens.at(-1)) {\n grouped_tokens.push(tokens[i]);\n }\n }\n\n // filter self.pad_token which is used as CTC-blank token\n const filtered_tokens = grouped_tokens.filter(token => token !== this.pad_token);\n\n let text = filtered_tokens.join('');\n if (this.cleanup) {\n // cleanup and replace delimiter token\n text = clean_up_tokenization(text)\n .replaceAll(this.word_delimiter_token, ' ')\n .trim();\n }\n return text;\n }\n\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n return [this.convert_tokens_to_string(tokens)];\n }\n}\n\n/**\n * Apply a sequence of decoders.\n * @extends Decoder\n */\nclass DecoderSequence extends Decoder {\n\n /**\n * Creates a new instance of DecoderSequence.\n * @param {Object} config The configuration object.\n * @param {Decoder[]} config.decoders The list of decoders to apply.\n */\n constructor(config) {\n super(config);\n this.decoders = config.decoders.map(x => Decoder.fromConfig(x));\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n // Use reduce to apply each decoder to the tokens\n return this.decoders.reduce((toks, decoder) => {\n return decoder.decode_chain(toks);\n }, tokens);\n }\n\n}\n\nclass BPEDecoder extends Decoder {\n constructor(config) {\n super(config);\n\n this.suffix = this.config.suffix;\n }\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n return tokens.map((token, i) => {\n return token.replaceAll(this.suffix, (i === tokens.length - 1) ? '' : ' ')\n });\n }\n}\n\n// Custom decoder for VITS\nclass VitsDecoder extends Decoder {\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n let decoded = '';\n for (let i = 1; i < tokens.length; i += 2) {\n decoded += tokens[i];\n }\n return [decoded];\n }\n}\n\n\n/**\n * This PreTokenizer replaces spaces with the given replacement character, adds a prefix space if requested,\n * and returns a list of tokens.\n * @extends PreTokenizer\n */\nclass MetaspacePreTokenizer extends PreTokenizer {\n /**\n * @param {Object} config The configuration object for the MetaspacePreTokenizer.\n * @param {boolean} config.add_prefix_space Whether to add a prefix space to the first token.\n * @param {string} config.replacement The character to replace spaces with.\n * @param {string} [config.str_rep=config.replacement] An optional string representation of the replacement character.\n * @param {'first'|'never'|'always'} [config.prepend_scheme='always'] The metaspace prepending scheme.\n */\n constructor(config) {\n super();\n\n this.addPrefixSpace = config.add_prefix_space;\n this.replacement = config.replacement;\n this.strRep = config.str_rep || this.replacement;\n this.prepend_scheme = config.prepend_scheme ?? 'always';\n }\n\n /**\n * This method takes a string, replaces spaces with the replacement character,\n * adds a prefix space if requested, and returns a new list of tokens.\n * @param {string} text The text to pre-tokenize.\n * @param {Object} [options] The options for the pre-tokenization.\n * @param {number} [options.section_index] The index of the section to pre-tokenize.\n * @returns {string[]} A new list of pre-tokenized tokens.\n */\n pre_tokenize_text(text, {\n section_index = undefined,\n } = {}) {\n\n let normalized = text.replaceAll(' ', this.strRep);\n\n if (\n // We add a prefix space if:\n // (1) The addPrefixSpace option is enabled and the normalized\n // token does not already start with the replacement character.\n (this.addPrefixSpace && !normalized.startsWith(this.replacement))\n\n // and (2) either:\n // (a) prepend_scheme is 'always'\n // (b) prepend_scheme is 'first' and this is the first section\n && (\n this.prepend_scheme === 'always' ||\n (this.prepend_scheme === 'first' && section_index === 0)\n )\n ) {\n normalized = this.strRep + normalized;\n }\n return [normalized];\n }\n}\n\n/**\n * MetaspaceDecoder class extends the Decoder class and decodes Metaspace tokenization.\n * @extends Decoder\n */\nclass MetaspaceDecoder extends Decoder {\n /**\n * Constructs a new MetaspaceDecoder object.\n * @param {Object} config The configuration object for the MetaspaceDecoder.\n * @param {boolean} config.add_prefix_space Whether to add a prefix space to the decoded string.\n * @param {string} config.replacement The string to replace spaces with.\n */\n constructor(config) {\n super(config);\n\n this.addPrefixSpace = config.add_prefix_space;\n this.replacement = config.replacement;\n }\n\n /** @type {Decoder['decode_chain']} */\n decode_chain(tokens) {\n const result = [];\n for (let i = 0; i < tokens.length; ++i) {\n let normalized = tokens[i].replaceAll(this.replacement, ' ');\n if (this.addPrefixSpace && i == 0 && normalized.startsWith(' ')) {\n normalized = normalized.substring(1);\n }\n result.push(normalized);\n }\n return result;\n }\n}\n\n/**\n * A normalizer that applies a precompiled charsmap.\n * This is useful for applying complex normalizations in C++ and exposing them to JavaScript.\n * @extends Normalizer\n * @param {Object} config The configuration object for the Precompiled normalizer.\n * @param {Object} config.precompiled_charsmap The precompiled charsmap object.\n */\nclass Precompiled extends Normalizer {\n /**\n * Create a new instance of Precompiled normalizer.\n * @param {Object} config The configuration object.\n * @param {any} config.precompiled_charsmap Precompiled chars mapping.\n */\n constructor(config) {\n super(config);\n this.charsmap = config.precompiled_charsmap;\n }\n\n /**\n * Normalizes the given text by applying the precompiled charsmap.\n * @param {string} text The text to normalize.\n * @returns {string} The normalized text.\n */\n normalize(text) {\n // As stated in the sentencepiece normalization docs (https://github.com/google/sentencepiece/blob/master/doc/normalization.md#use-pre-defined-normalization-rule),\n // there are 5 pre-defined normalization rules:\n // 1. nmt_nfkc: NFKC normalization with some additional normalization around spaces. (default)\n // 2. nfkc: original NFKC normalization.\n // 3. nmt_nfkc_cf: nmt_nfkc + Unicode case folding (mostly lower casing)\n // 4. nfkc_cf: nfkc + Unicode case folding.\n // 5. identity: no normalization\n // \n // For now, we only implement the default (nmt_nfkc).\n // See https://raw.githubusercontent.com/google/sentencepiece/master/data/nmt_nfkc.tsv for the full list of rules.\n // TODO: detect when a different `this.charsmap` is used.\n\n text = text.replace(/[\\u0001-\\u0008\\u000B\\u000E-\\u001F\\u007F\\u008F\\u009F]/gm, ''); // Remove control characters\n text = text.replace(/[\\u0009\\u000A\\u000C\\u000D\\u1680\\u200B\\u200C\\u200E\\u200F\\u2028\\u2029\\u2581\\uFEFF\\uFFFD]/gm, '\\u0020'); // Replace certain characters with a space\n\n if (text.includes('\\uFF5E')) {\n // To match the sentencepiece implementation 100%, we must handle a very strange edge-case.\n // For some reason, the \"Fullwidth Tilde\" character (\\uFF5E) should not be converted to the standard Tilde character (\\u007E).\n // However, NFKC normalization does do this conversion. As a result, we split the string on the Fullwidth Tilde character,\n // perform NFKC normalization on each substring, and then join them back together with the Fullwidth Tilde character.\n const parts = text.split('\\uFF5E');\n text = parts.map(part => part.normalize('NFKC')).join('\\uFF5E');\n } else {\n text = text.normalize('NFKC');\n }\n\n return text;\n }\n}\n\n/**\n * A pre-tokenizer that applies a sequence of pre-tokenizers to the input text.\n * @extends PreTokenizer\n */\nclass PreTokenizerSequence extends PreTokenizer {\n /**\n * Creates an instance of PreTokenizerSequence.\n * @param {Object} config The configuration object for the pre-tokenizer sequence.\n * @param {Object[]} config.pretokenizers An array of pre-tokenizer configurations.\n */\n constructor(config) {\n super();\n this.tokenizers = config.pretokenizers.map(x => PreTokenizer.fromConfig(x));\n }\n\n /**\n * Applies each pre-tokenizer in the sequence to the input text in turn.\n * @param {string} text The text to pre-tokenize.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} The pre-tokenized text.\n */\n pre_tokenize_text(text, options) {\n // Use reduce to apply each tokenizer to the text\n return this.tokenizers.reduce((preTokenizedText, tokenizer) => {\n return tokenizer.pre_tokenize(preTokenizedText, options);\n }, [text]);\n }\n}\n\n/**\n * Splits on word boundaries (using the following regular expression: `\\w+|[^\\w\\s]+`).\n */\nclass WhitespacePreTokenizer extends PreTokenizer {\n /**\n * Creates an instance of WhitespacePreTokenizer.\n * @param {Object} config The configuration object for the pre-tokenizer.\n */\n constructor(config) {\n super();\n }\n /**\n * Pre-tokenizes the input text by splitting it on word boundaries.\n * @param {string} text The text to be pre-tokenized.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens produced by splitting the input text on whitespace.\n */\n pre_tokenize_text(text, options) {\n return text.match(/\\w+|[^\\w\\s]+/g) || [];\n }\n}\n\n/**\n * Splits a string of text by whitespace characters into individual tokens.\n * @extends PreTokenizer\n */\nclass WhitespaceSplit extends PreTokenizer {\n /**\n * Creates an instance of WhitespaceSplit.\n * @param {Object} config The configuration object for the pre-tokenizer.\n */\n constructor(config) {\n super();\n }\n /**\n * Pre-tokenizes the input text by splitting it on whitespace characters.\n * @param {string} text The text to be pre-tokenized.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens produced by splitting the input text on whitespace.\n */\n pre_tokenize_text(text, options) {\n return whitespace_split(text);\n }\n}\n\n// NOTE: `ReplacePreTokenizer` is custom (to support `BlenderbotSmallTokenizer`)\nclass ReplacePreTokenizer extends PreTokenizer {\n /**\n * @param {Object} config The configuration options for the pre-tokenizer.\n * @param {Object} config.pattern The pattern used to split the text. Can be a string or a regex object.\n * @param {string} config.content What to replace the pattern with.\n */\n constructor(config) {\n super();\n this.config = config;\n this.pattern = createPattern(this.config.pattern);\n this.content = this.config.content;\n }\n\n /**\n * Pre-tokenizes the input text by replacing certain characters.\n * @param {string} text The text to be pre-tokenized.\n * @param {Object} [options] Additional options for the pre-tokenization logic.\n * @returns {string[]} An array of tokens produced by replacing certain characters.\n */\n pre_tokenize_text(text, options) {\n if (this.pattern === null) {\n return [text];\n }\n return [text.replaceAll(this.pattern, this.config.content)];\n }\n}\n\nconst SPECIAL_TOKEN_ATTRIBUTES = [\n 'bos_token',\n 'eos_token',\n 'unk_token',\n 'sep_token',\n 'pad_token',\n 'cls_token',\n 'mask_token',\n // additional_special_tokens (TODO)\n]\n\n/**\n * \n * Helper function for padding values of an object, which are each arrays.\n * NOTE: No additional checks are made here for validity of arguments.\n * @param {Record} item The input object.\n * @param {number} length The length to pad to.\n * @param {(key: string) => any} value_fn Determine the value to fill the array, based on its key.\n * @param {'right'|'left'} side Which side to pad the array.\n * @private\n */\nfunction padHelper(item, length, value_fn, side) {\n for (const key of Object.keys(item)) {\n const diff = length - item[key].length;\n const value = value_fn(key);\n\n const padData = new Array(diff).fill(value);\n item[key] = side === 'right'\n ? (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(item[key], padData)\n : (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(padData, item[key]);\n }\n}\n\n/**\n * Helper function for truncating values of an object, which are each arrays.\n * NOTE: No additional checks are made here for validity of arguments.\n * @param {Record} item The input object.\n * @param {number} length The length to truncate to.\n * @private\n */\nfunction truncateHelper(item, length) {\n // Setting .length to a lower value truncates the array in-place:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length\n for (const key of Object.keys(item)) {\n item[key].length = length;\n }\n}\n\n\nclass PreTrainedTokenizer extends _utils_core_js__WEBPACK_IMPORTED_MODULE_0__.Callable {\n return_token_type_ids = false;\n\n _default_chat_template = `{% for message in messages %}{{'<|im_start|>' + message['role'] + '\\n' + message['content'] + '<|im_end|>' + '\\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\\n' }}{% endif %}`;\n\n /**\n * Create a new PreTrainedTokenizer instance.\n * @param {Object} tokenizerJSON The JSON of the tokenizer.\n * @param {Object} tokenizerConfig The config of the tokenizer.\n */\n constructor(tokenizerJSON, tokenizerConfig) {\n super();\n\n this._tokenizer_config = tokenizerConfig;\n\n // Construct parts of the tokenizer from the JSON\n this.normalizer = Normalizer.fromConfig(tokenizerJSON.normalizer);\n this.pre_tokenizer = PreTokenizer.fromConfig(tokenizerJSON.pre_tokenizer);\n this.model = TokenizerModel.fromConfig(tokenizerJSON.model, tokenizerConfig);\n this.post_processor = PostProcessor.fromConfig(tokenizerJSON.post_processor);\n this.decoder = Decoder.fromConfig(tokenizerJSON.decoder);\n\n // Add added_tokens to model\n this.special_tokens = [];\n this.all_special_ids = [];\n\n /** @type {AddedToken[]} */\n this.added_tokens = [];\n for (const addedToken of tokenizerJSON.added_tokens) {\n const token = new AddedToken(addedToken);\n this.added_tokens.push(token);\n\n this.model.tokens_to_ids.set(token.content, token.id);\n this.model.vocab[token.id] = token.content;\n\n if (token.special) {\n this.special_tokens.push(token.content);\n this.all_special_ids.push(token.id);\n }\n }\n\n // Update additional_special_tokens\n this.additional_special_tokens = tokenizerConfig.additional_special_tokens ?? [];\n this.special_tokens.push(...this.additional_special_tokens);\n this.special_tokens = [...new Set(this.special_tokens)]; // Remove duplicates\n\n if (this.decoder) {\n // Slight hack, but it prevents code duplication:\n this.decoder.added_tokens = this.added_tokens;\n\n // Another slight hack to add `end_of_word_suffix` (if present) to the decoder\n // This is needed for cases where BPE model and ByteLevel decoder are used\n // For more information, see https://github.com/xenova/transformers.js/issues/74\n // TODO: save this to the decoder when exporting?\n this.decoder.end_of_word_suffix = this.model.end_of_word_suffix;\n }\n\n\n this.added_tokens_regex = this.added_tokens.length > 0 ? new RegExp(\n this.added_tokens.map(x => `${x.lstrip ? '\\\\s*' : ''}(${(0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.escapeRegExp)(x.content)})${x.rstrip ? '\\\\s*' : ''}`).join('|')\n ) : null;\n\n // Set mask token if present (otherwise will be undefined, which is fine)\n this.mask_token = this.getToken('mask_token');\n this.mask_token_id = this.model.tokens_to_ids.get(this.mask_token);\n\n this.pad_token = this.getToken('pad_token', 'eos_token');\n this.pad_token_id = this.model.tokens_to_ids.get(this.pad_token);\n\n this.sep_token = this.getToken('sep_token');\n this.sep_token_id = this.model.tokens_to_ids.get(this.sep_token);\n\n this.unk_token = this.getToken('unk_token');\n this.unk_token_id = this.model.tokens_to_ids.get(this.unk_token);\n\n this.model_max_length = tokenizerConfig.model_max_length;\n\n /** @type {boolean} Whether or not to strip the text when tokenizing (removing excess spaces before and after the string). */\n this.remove_space = tokenizerConfig.remove_space;\n\n this.clean_up_tokenization_spaces = tokenizerConfig.clean_up_tokenization_spaces ?? true;\n this.do_lowercase_and_remove_accent = tokenizerConfig.do_lowercase_and_remove_accent ?? false;\n\n // TODO allow user to change this\n /** @type {'right'|'left'} */\n this.padding_side = 'right';\n\n this.legacy = false;\n\n this.chat_template = tokenizerConfig.chat_template ?? null;\n if (Array.isArray(this.chat_template)) {\n // Chat templates are stored as lists of dicts with fixed key names,\n // we reconstruct that into a single dict while loading them.\n const chat_template = Object.create(null);\n for (const { name, template } of this.chat_template) {\n if (typeof name !== 'string' || typeof template !== 'string') {\n throw new Error('Chat template must be a list of objects with \"name\" and \"template\" properties');\n }\n chat_template[name] = template;\n }\n this.chat_template = chat_template;\n }\n this._compiled_template_cache = new Map();\n }\n\n /**\n * Returns the value of the first matching key in the tokenizer config object.\n * @param {...string} keys One or more keys to search for in the tokenizer config object.\n * @returns {string|null} The value associated with the first matching key, or null if no match is found.\n * @throws {Error} If an object is found for a matching key and its __type property is not \"AddedToken\".\n */\n getToken(...keys) {\n for (const key of keys) {\n const item = this._tokenizer_config[key];\n\n if (!item) continue;\n\n if (typeof item === 'object') {\n if (item.__type === 'AddedToken') {\n return item.content;\n } else {\n throw Error(`Unknown token: ${item}`);\n }\n } else {\n return item;\n }\n }\n return null;\n }\n\n /**\n * Loads a pre-trained tokenizer from the given `pretrained_model_name_or_path`. \n * \n * @param {string} pretrained_model_name_or_path The path to the pre-trained tokenizer.\n * @param {PretrainedTokenizerOptions} options Additional options for loading the tokenizer.\n * \n * @throws {Error} Throws an error if the tokenizer.json or tokenizer_config.json files are not found in the `pretrained_model_name_or_path`.\n * @returns {Promise} A new instance of the `PreTrainedTokenizer` class.\n */\n static async from_pretrained(pretrained_model_name_or_path, {\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n legacy = null,\n } = {}) {\n\n const info = await loadTokenizer(pretrained_model_name_or_path, {\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n legacy,\n })\n\n // @ts-ignore\n return new this(...info);\n }\n\n /**\n * @typedef {number[]|number[][]|Tensor} BatchEncodingItem\n * \n * @typedef {Object} BatchEncoding Holds the output of the tokenizer's call function.\n * @property {BatchEncodingItem} input_ids List of token ids to be fed to a model.\n * @property {BatchEncodingItem} attention_mask List of indices specifying which tokens should be attended to by the model.\n * @property {BatchEncodingItem} [token_type_ids] List of token type ids to be fed to a model.\n */\n\n /**\n * Encode/tokenize the given text(s).\n * @param {string|string[]} text The text to tokenize.\n * @param {Object} options An optional object containing the following properties:\n * @param {string|string[]} [options.text_pair=null] Optional second sequence to be encoded. If set, must be the same type as text.\n * @param {boolean|'max_length'} [options.padding=false] Whether to pad the input sequences.\n * @param {boolean} [options.add_special_tokens=true] Whether or not to add the special tokens associated with the corresponding model.\n * @param {boolean} [options.truncation=null] Whether to truncate the input sequences.\n * @param {number} [options.max_length=null] Maximum length of the returned list and optionally padding length.\n * @param {boolean} [options.return_tensor=true] Whether to return the results as Tensors or arrays.\n * @returns {BatchEncoding} Object to be passed to the model.\n */\n _call(\n // Required positional arguments\n text,\n\n // Optional keyword arguments\n {\n text_pair = null,\n add_special_tokens = true,\n padding = false,\n truncation = null,\n max_length = null,\n return_tensor = true, // Different to HF\n } = {},\n ) {\n\n const isBatched = Array.isArray(text);\n\n /** @type {EncodingSingle[]} */\n let encodedTokens;\n\n if (isBatched) {\n if (text.length === 0) {\n throw Error('text array must be non-empty')\n }\n\n if (text_pair !== null) {\n if (!Array.isArray(text_pair)) {\n throw Error('text_pair must also be an array')\n\n } else if (text.length !== text_pair.length) {\n throw Error('text and text_pair must have the same length')\n }\n\n encodedTokens = text.map(\n (t, i) => this._encode_plus(t, text_pair[i], { add_special_tokens })\n )\n\n } else {\n encodedTokens = text.map(x => this._encode_plus(x, null, { add_special_tokens }));\n }\n\n } else {\n if (text === null) {\n throw Error('text may not be null')\n }\n\n if (Array.isArray(text_pair)) {\n throw Error('When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).')\n }\n\n // For single input, we just wrap in an array, and then unwrap later.\n encodedTokens = [this._encode_plus(text, text_pair, { add_special_tokens })];\n }\n // At this point, tokens is batched: [batch_size, tokens]\n // However, array may be jagged. So, we pad to max_length\n\n if (max_length === null) {\n if (padding === 'max_length') {\n max_length = this.model_max_length;\n } else {\n // Calculate max length from sequences\n max_length = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.max)(encodedTokens.map(x => x.input_ids.length))[0];\n }\n } else {\n if (!truncation) {\n console.warn(`Truncation was not explicitly activated but \\`max_length\\` is provided a specific value, please use \\`truncation=true\\` to explicitly truncate examples to max length.`)\n }\n }\n\n // Ensure it is less than model max length\n max_length = Math.min(max_length, this.model_max_length)\n\n if (padding || truncation) {\n\n // Perform padding and/or truncation\n for (let i = 0; i < encodedTokens.length; ++i) {\n if (encodedTokens[i].input_ids.length === max_length) {\n continue;\n\n } else if (encodedTokens[i].input_ids.length > max_length) {\n // possibly truncate\n if (truncation) {\n truncateHelper(encodedTokens[i], max_length);\n }\n\n } else { // t.length < max_length\n // possibly pad\n if (padding) {\n padHelper(\n encodedTokens[i],\n max_length,\n key => key === 'input_ids' ? this.pad_token_id : 0,\n this.padding_side\n );\n }\n }\n }\n }\n\n const result = {};\n\n if (return_tensor) {\n if (!(padding && truncation)) {\n // Not, guaranteed that all items have same length, so\n // we perform additional check\n\n if (\n encodedTokens.some(x => {\n for (const key of Object.keys(x)) {\n if (x[key].length !== encodedTokens[0][key]?.length) {\n return true;\n }\n }\n return false;\n })\n ) {\n throw Error(\n \"Unable to create tensor, you should probably activate truncation and/or padding \" +\n \"with 'padding=true' and 'truncation=true' to have batched tensors with the same length.\"\n )\n }\n }\n\n // Now we actually convert to tensor\n // NOTE: In the same way as the python library, we return a batched tensor, regardless of\n // whether we have a single input or multiple inputs.\n const dims = [encodedTokens.length, encodedTokens[0].input_ids.length];\n\n for (const key of Object.keys(encodedTokens[0])) {\n result[key] = new _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor('int64',\n BigInt64Array.from(encodedTokens.flatMap(x => x[key]).map(BigInt)),\n dims\n );\n }\n\n } else {\n for (const key of Object.keys(encodedTokens[0])) {\n result[key] = encodedTokens.map(x => x[key]);\n }\n\n // If not returning a tensor, we match the input type\n if (!isBatched) {\n // Input was not batched, so we unwrap\n for (const key of Object.keys(result)) {\n result[key] = result[key][0];\n }\n }\n }\n\n return /** @type {BatchEncoding} */(result);\n }\n\n /**\n * Encodes a single text using the preprocessor pipeline of the tokenizer.\n *\n * @param {string|null} text The text to encode.\n * @returns {string[]|null} The encoded tokens.\n */\n _encode_text(text) {\n if (text === null) return null;\n\n // Actual function which does encoding, for a single text\n // First, we take care of special tokens. Needed to avoid issues arising from\n // normalization and/or pretokenization (which may not preserve special tokens)\n const sections = this.added_tokens_regex ? text.split(this.added_tokens_regex).filter(x => x) : [text];\n\n const tokens = sections.map((x, section_index) => {\n const addedToken = this.added_tokens.find(t => t.content === x);\n if (addedToken !== undefined) {\n // Ignore added tokens\n return x\n } else {\n if (this.remove_space === true) {\n x = x.trim().split(/\\s+/).join(' ');\n }\n if (this.do_lowercase_and_remove_accent) {\n x = lowercase_and_remove_accent(x);\n }\n\n if (this.normalizer !== null) {\n x = this.normalizer(x);\n }\n\n // If, after normalization, this section is empty (e.g., trimming whitespace),\n // we return an empty array\n if (x.length === 0) {\n return [];\n }\n\n const sectionTokens = (this.pre_tokenizer !== null) ? this.pre_tokenizer(x, {\n section_index,\n }) : [x];\n\n const tokens = this.model(sectionTokens);\n\n return tokens;\n }\n }).flat();\n\n return tokens;\n }\n\n /**\n * Encodes a single text or a pair of texts using the model's tokenizer.\n *\n * @param {string} text The text to encode.\n * @param {string|null} text_pair The optional second text to encode.\n * @param {Object} options An optional object containing the following properties:\n * @param {boolean} [options.add_special_tokens=true] Whether or not to add the special tokens associated with the corresponding model.\n * @returns {EncodingSingle} An object containing the encoded text.\n * @private\n */\n _encode_plus(text, text_pair = null, {\n add_special_tokens = true,\n } = {}) {\n // Function called by users to encode possibly multiple texts\n const tokens = this._encode_text(text);\n const tokens2 = this._encode_text(text_pair);\n\n const combinedTokens = this.post_processor\n ? this.post_processor(tokens, tokens2, { add_special_tokens })\n : { tokens: (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(tokens ?? [], tokens2 ?? []) };\n\n const input_ids = this.model.convert_tokens_to_ids(combinedTokens.tokens);\n\n const result = {\n input_ids,\n attention_mask: new Array(input_ids.length).fill(1),\n }\n if (this.return_token_type_ids && combinedTokens.token_type_ids) {\n result.token_type_ids = combinedTokens.token_type_ids;\n }\n return result;\n }\n\n /**\n * Encodes a single text or a pair of texts using the model's tokenizer.\n *\n * @param {string} text The text to encode.\n * @param {string|null} text_pair The optional second text to encode.\n * @param {Object} options An optional object containing the following properties:\n * @param {boolean} [options.add_special_tokens=true] Whether or not to add the special tokens associated with the corresponding model.\n * @returns {number[]} An array of token IDs representing the encoded text(s).\n */\n encode(text, text_pair = null, {\n add_special_tokens = true,\n } = {}) {\n const { input_ids } = this._encode_plus(text, text_pair, {\n add_special_tokens,\n });\n return input_ids;\n }\n\n /**\n * Decode a batch of tokenized sequences.\n * @param {number[][]|Tensor} batch List/Tensor of tokenized input sequences.\n * @param {Object} decode_args (Optional) Object with decoding arguments.\n * @returns {string[]} List of decoded sequences.\n */\n batch_decode(batch, decode_args = {}) {\n if (batch instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor) {\n batch = batch.tolist();\n }\n return batch.map(x => this.decode(x, decode_args));\n }\n\n /**\n * Decodes a sequence of token IDs back to a string.\n *\n * @param {number[]|Tensor} token_ids List/Tensor of token IDs to decode.\n * @param {Object} [decode_args={}]\n * @param {boolean} [decode_args.skip_special_tokens=false] If true, special tokens are removed from the output string.\n * @param {boolean} [decode_args.clean_up_tokenization_spaces=true] If true, spaces before punctuations and abbreviated forms are removed.\n *\n * @returns {string} The decoded string.\n * @throws {Error} If `token_ids` is not a non-empty array of integers.\n */\n decode(\n token_ids,\n decode_args = {},\n ) {\n if (token_ids instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor) {\n token_ids = prepareTensorForDecode(token_ids);\n }\n\n if (!Array.isArray(token_ids) || token_ids.length === 0 || !(0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.isIntegralNumber)(token_ids[0])) {\n throw Error(\"token_ids must be a non-empty array of integers.\");\n }\n\n return this.decode_single(token_ids, decode_args)\n }\n\n /**\n * Decode a single list of token ids to a string.\n * @param {number[]} token_ids List of token ids to decode\n * @param {Object} decode_args Optional arguments for decoding\n * @param {boolean} [decode_args.skip_special_tokens=false] Whether to skip special tokens during decoding\n * @param {boolean} [decode_args.clean_up_tokenization_spaces=null] Whether to clean up tokenization spaces during decoding.\n * If null, the value is set to `this.decoder.cleanup` if it exists, falling back to `this.clean_up_tokenization_spaces` if it exists, falling back to `true`.\n * @returns {string} The decoded string\n */\n decode_single(\n token_ids,\n {\n skip_special_tokens = false,\n clean_up_tokenization_spaces = null,\n }\n ) {\n let tokens = this.model.convert_ids_to_tokens(token_ids);\n if (skip_special_tokens) {\n tokens = tokens.filter(x => !this.special_tokens.includes(x));\n }\n\n // If `this.decoder` is null, we just join tokens with a space:\n // https://github.com/huggingface/tokenizers/blob/8edec536a737cb04494b454805be16c020abb14f/tokenizers/src/tokenizer/mod.rs#L835\n /** @type {string} */\n let decoded = this.decoder ? this.decoder(tokens) : tokens.join(' ');\n\n // Slight hack, but prevents having to pass `skip_special_tokens` to\n // each call to `decode`, which would lead to code duplication.\n if (this.decoder && this.decoder.end_of_word_suffix) {\n decoded = decoded.replaceAll(this.decoder.end_of_word_suffix, ' ');\n if (skip_special_tokens) {\n decoded = decoded.trim();\n }\n }\n\n if (clean_up_tokenization_spaces ?? this.clean_up_tokenization_spaces) {\n decoded = clean_up_tokenization(decoded);\n }\n\n return decoded;\n }\n\n get default_chat_template() {\n if (!this._warned_about_chat_template) {\n console.warn(\n \"No chat template is defined for this tokenizer - using a default chat template \" +\n \"that implements the ChatML format. If the default is not appropriate for \" +\n \"your model, please set `tokenizer.chat_template` to an appropriate template. \" +\n \"See https://huggingface.co/docs/transformers/main/chat_templating for more information.\"\n )\n this._warned_about_chat_template = true; // TODO move to logger.warning_once()\n }\n\n return this._default_chat_template;\n }\n\n /**\n * @typedef {Object} Message\n * @property {string} role The role of the message (e.g., \"user\" or \"assistant\" or \"system\").\n * @property {string} content The content of the message.\n */\n\n /**\n * Converts a list of message objects with `\"role\"` and `\"content\"` keys to a list of token\n * ids. This method is intended for use with chat models, and will read the tokenizer's chat_template attribute to\n * determine the format and control tokens to use when converting. When chat_template is None, it will fall back\n * to the default_chat_template specified at the class level.\n * \n * See [here](https://huggingface.co/docs/transformers/chat_templating) for more information.\n * \n * **Example:** Applying a chat template to a conversation.\n * \n * ```javascript\n * import { AutoTokenizer } from \"@xenova/transformers\";\n * \n * const tokenizer = await AutoTokenizer.from_pretrained(\"mistralai/Mistral-7B-Instruct-v0.1\");\n * \n * const chat = [\n * { \"role\": \"user\", \"content\": \"Hello, how are you?\" },\n * { \"role\": \"assistant\", \"content\": \"I'm doing great. How can I help you today?\" },\n * { \"role\": \"user\", \"content\": \"I'd like to show off how chat templating works!\" },\n * ]\n * \n * const text = tokenizer.apply_chat_template(chat, { tokenize: false });\n * // \"[INST] Hello, how are you? [/INST]I'm doing great. How can I help you today? [INST] I'd like to show off how chat templating works! [/INST]\"\n * \n * const input_ids = tokenizer.apply_chat_template(chat, { tokenize: true, return_tensor: false });\n * // [1, 733, 16289, 28793, 22557, 28725, 910, 460, 368, 28804, 733, 28748, 16289, 28793, 28737, 28742, 28719, 2548, 1598, 28723, 1602, 541, 315, 1316, 368, 3154, 28804, 2, 28705, 733, 16289, 28793, 315, 28742, 28715, 737, 298, 1347, 805, 910, 10706, 5752, 1077, 3791, 28808, 733, 28748, 16289, 28793]\n * ```\n * \n * @param {Message[]} conversation A list of message objects with `\"role\"` and `\"content\"` keys.\n * @param {Object} options An optional object containing the following properties:\n * @param {string} [options.chat_template=null] A Jinja template to use for this conversion. If\n * this is not passed, the model's default chat template will be used instead.\n * @param {boolean} [options.add_generation_prompt=false] Whether to end the prompt with the token(s) that indicate\n * the start of an assistant message. This is useful when you want to generate a response from the model.\n * Note that this argument will be passed to the chat template, and so it must be supported in the\n * template for this argument to have any effect.\n * @param {boolean} [options.tokenize=true] Whether to tokenize the output. If false, the output will be a string.\n * @param {boolean} [options.padding=false] Whether to pad sequences to the maximum length. Has no effect if tokenize is false.\n * @param {boolean} [options.truncation=false] Whether to truncate sequences to the maximum length. Has no effect if tokenize is false.\n * @param {number} [options.max_length=null] Maximum length (in tokens) to use for padding or truncation. Has no effect if tokenize is false.\n * If not specified, the tokenizer's `max_length` attribute will be used as a default.\n * @param {boolean} [options.return_tensor=true] Whether to return the output as a Tensor or an Array. Has no effect if tokenize is false.\n * @param {Object} [options.tokenizer_kwargs={}] Additional options to pass to the tokenizer.\n * @returns {string | Tensor | number[]| number[][]} The tokenized output.\n */\n apply_chat_template(conversation, {\n chat_template = null,\n add_generation_prompt = false,\n tokenize = true,\n padding = false,\n truncation = false,\n max_length = null,\n return_tensor = true,\n tokenizer_kwargs = {},\n ...kwargs\n } = {}) {\n\n // First, handle the cases when the model has a dict of multiple templates\n if (\n (this.chat_template && typeof this.chat_template === 'object') ||\n (this.chat_template === null && this.default_chat_template && typeof this.default_chat_template === 'object')\n ) {\n const template_dict = this.chat_template ?? this.default_chat_template; // Guaranteed to be a non-null object\n\n if (chat_template !== null && Object.hasOwn(template_dict, chat_template)) {\n // The user can pass the name of a template to the chat template argument instead of an entire template\n chat_template = template_dict[chat_template];\n } else if (chat_template === null && 'default' in template_dict) {\n chat_template = template_dict['default'];\n } else if (chat_template === null) {\n throw Error(\n `This model has multiple chat templates with no default specified! Please either pass a chat ` +\n `template or the name of the template you wish to use to the 'chat_template' argument. Available ` +\n `template names are ${Object.keys(template_dict).sort()}.`\n )\n }\n } else {\n // These are the cases when the model has a single template\n // priority: `chat_template` argument > `tokenizer.chat_template` > `tokenizer.default_chat_template\n chat_template ??= this.chat_template ?? this.default_chat_template;\n }\n if (typeof chat_template !== 'string') {\n throw Error(`chat_template must be a string, but got ${typeof chat_template}`);\n }\n\n // Compilation function uses a cache to avoid recompiling the same template\n let compiledTemplate = this._compiled_template_cache.get(chat_template);\n if (compiledTemplate === undefined) {\n compiledTemplate = new _huggingface_jinja__WEBPACK_IMPORTED_MODULE_5__.Template(chat_template);\n this._compiled_template_cache.set(chat_template, compiledTemplate);\n }\n\n const special_tokens_map = Object.create(null);\n for (const key of SPECIAL_TOKEN_ATTRIBUTES) {\n const value = this.getToken(key);\n if (value) {\n special_tokens_map[key] = value;\n }\n }\n\n const rendered = compiledTemplate.render({\n messages: conversation,\n add_generation_prompt: add_generation_prompt,\n\n ...special_tokens_map,\n ...kwargs,\n });\n\n if (tokenize) {\n return this._call(rendered, {\n add_special_tokens: false,\n padding,\n truncation,\n max_length,\n return_tensor,\n ...tokenizer_kwargs,\n }).input_ids;\n }\n\n return rendered;\n }\n}\n\n/**\n * BertTokenizer is a class used to tokenize text for BERT models.\n * @extends PreTrainedTokenizer\n */\nclass BertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\n/**\n * Albert tokenizer\n * @extends PreTrainedTokenizer\n */\nclass AlbertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nclass MobileBertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nclass SqueezeBertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nclass DebertaTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nclass DebertaV2Tokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nclass HerbertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nclass ConvBertTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nclass RoFormerTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\nclass DistilBertTokenizer extends PreTrainedTokenizer { }\nclass CamembertTokenizer extends PreTrainedTokenizer { }\nclass XLMTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\\'s \"fast\" tokenizers library. Therefore, you may experience slightly inaccurate results.')\n }\n}\nclass ElectraTokenizer extends PreTrainedTokenizer {\n return_token_type_ids = true;\n}\n\nclass T5Tokenizer extends PreTrainedTokenizer { }\nclass GPT2Tokenizer extends PreTrainedTokenizer {\n _default_chat_template = `{% for message in messages %}\" \"{{ message.content }}{{ eos_token }}\" \"{% endfor %}`\n}\nclass BartTokenizer extends PreTrainedTokenizer { }\nclass MBartTokenizer extends PreTrainedTokenizer {\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n\n this.languageRegex = /^[a-z]{2}_[A-Z]{2}$/;\n this.language_codes = this.special_tokens.filter(x => this.languageRegex.test(x));\n this.lang_to_token = x => x; // Identity function\n }\n\n /**\n * Helper function to build translation inputs for an `MBartTokenizer`.\n * @param {string|string[]} raw_inputs The text to tokenize.\n * @param {Object} tokenizer_options Options to be sent to the tokenizer\n * @param {Object} generate_kwargs Generation options.\n * @returns {Object} Object to be passed to the model.\n */\n _build_translation_inputs(raw_inputs, tokenizer_options, generate_kwargs) {\n return _build_translation_inputs(this, raw_inputs, tokenizer_options, generate_kwargs);\n }\n}\nclass MBart50Tokenizer extends MBartTokenizer { } // NOTE: extends MBartTokenizer\n\nclass RobertaTokenizer extends PreTrainedTokenizer { }\n\nclass BloomTokenizer extends GPT2Tokenizer { // NOTE: `GPT2Tokenizer` to get the correct chat template\n\n constructor(tokenizerJSON, tokenizerConfig) {\n // Override the default (invalid) regex of the pretokenizer.\n // For more information, see https://github.com/xenova/transformers.js/issues/94\n const splitChars = '.,!?\\u2026\\u3002\\uff0c\\u3001\\u0964\\u06d4\\u060c';\n const patternObject = tokenizerJSON.pre_tokenizer?.pretokenizers[0]?.pattern;\n if (patternObject && patternObject.Regex === ` ?[^(\\\\s|[${splitChars}])]+`) {\n patternObject.Regex = ` ?[^\\\\s${splitChars}]+`;\n }\n super(tokenizerJSON, tokenizerConfig);\n }\n}\n\nconst SPIECE_UNDERLINE = \"▁\";\n\nclass LlamaTokenizer extends PreTrainedTokenizer {\n _default_chat_template = `{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% elif USE_DEFAULT_PROMPT == true and not '<>' in messages[0]['content'] %}{% set loop_messages = messages %}{% set system_message = 'DEFAULT_SYSTEM_MESSAGE' %}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = '<>\\n' + system_message + '\\n<>\\n\\n' + message['content'] %}{% else %}{% set content = message['content'] %}{% endif %}{% if message['role'] == 'user' %}{{ bos_token + '[INST] ' + content.strip() + ' [/INST]' }}{% elif message['role'] == 'system' %}{{ '<>\\n' + content.strip() + '\\n<>\\n\\n' }}{% elif message['role'] == 'assistant' %}{{ ' ' + content.strip() + ' ' + eos_token }}{% endif %}{% endfor %}`\n\n DEFAULT_SYSTEM_PROMPT =\n \"You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your \" +\n \"answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure \" +\n \"that your responses are socially unbiased and positive in nature.\\n\\n\" +\n \"If a question does not make any sense, or is not factually coherent, explain why instead of answering something not \" +\n \"correct. If you don't know the answer to a question, please don't share false information.\"\n\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n this.use_default_system_prompt = tokenizerConfig.use_default_system_prompt ?? false;\n\n this.legacy = tokenizerConfig.legacy ?? true;\n if (!this.legacy) {\n // See https://github.com/huggingface/transformers/pull/24565 for more information\n this.normalizer = null;\n this.pre_tokenizer = new MetaspacePreTokenizer({\n replacement: SPIECE_UNDERLINE,\n add_prefix_space: true,\n prepend_scheme: \"first\",\n });\n }\n }\n\n /**\n * Helper function to handle legacy encoding of SPM tokenizers.\n * Adapted from https://github.com/huggingface/transformers/blob/e6dcf8abd6f65bb4b6dfc1831b20d9ba49ce00e2/src/transformers/models/t5/tokenization_t5.py#L374-L387\n * @param {string} text The text to encode.\n * @returns {string[]} The encoded tokens.\n */\n _encode_text(text) {\n if (text === null) return null;\n\n if (this.legacy || text.length === 0) {\n return super._encode_text(text);\n }\n\n let tokens = super._encode_text(SPIECE_UNDERLINE + text.replaceAll(SPIECE_UNDERLINE, \" \"));\n if (tokens.length > 1 && tokens[0] === SPIECE_UNDERLINE && this.special_tokens.includes(tokens[1])) {\n tokens = tokens.slice(1);\n }\n return tokens;\n }\n\n get default_chat_template() {\n return super.default_chat_template\n .replaceAll('USE_DEFAULT_PROMPT', this.use_default_system_prompt ? 'true' : 'false')\n .replaceAll('DEFAULT_SYSTEM_MESSAGE', this.DEFAULT_SYSTEM_PROMPT.replaceAll(\"\\n\", \"\\\\n\").replaceAll(\"'\", \"\\\\'\"));\n }\n}\nclass CodeLlamaTokenizer extends LlamaTokenizer { } // NOTE: `LlamaTokenizer` to get the correct chat template\n\nclass XLMRobertaTokenizer extends PreTrainedTokenizer { }\nclass MPNetTokenizer extends PreTrainedTokenizer { }\n\nclass FalconTokenizer extends PreTrainedTokenizer { }\n\nclass GPTNeoXTokenizer extends PreTrainedTokenizer { }\n\nclass EsmTokenizer extends PreTrainedTokenizer { }\n\nclass Qwen2Tokenizer extends PreTrainedTokenizer { }\n\nclass GemmaTokenizer extends PreTrainedTokenizer {\n _default_chat_template = \"{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '' + role + '\\n' + message['content'] | trim + '\\n' }}{% endfor %}{% if add_generation_prompt %}{{'model\\n'}}{% endif %}\"\n}\n\nclass Grok1Tokenizer extends PreTrainedTokenizer { }\n\n/**\n * Helper function to build translation inputs for an `NllbTokenizer` or `M2M100Tokenizer`.\n * @param {PreTrainedTokenizer} self The tokenizer instance.\n * @param {string|string[]} raw_inputs The text to tokenize.\n * @param {Object} tokenizer_options Options to be sent to the tokenizer\n * @param {Object} generate_kwargs Generation options.\n * @returns {Object} Object to be passed to the model.\n * @private\n */\nfunction _build_translation_inputs(self, raw_inputs, tokenizer_options, generate_kwargs) {\n if (!('language_codes' in self) || !Array.isArray(self.language_codes)) {\n throw new Error('Tokenizer must have `language_codes` attribute set and it should be an array of language ids.')\n }\n if (!('languageRegex' in self) || !(self.languageRegex instanceof RegExp)) {\n throw new Error('Tokenizer must have `languageRegex` attribute set and it should be a regular expression.')\n }\n if (!('lang_to_token' in self) || typeof self.lang_to_token !== 'function') {\n throw new Error('Tokenizer must have `lang_to_token` attribute set and it should be a function.')\n }\n const src_lang_token = generate_kwargs.src_lang;\n const tgt_lang_token = generate_kwargs.tgt_lang;\n\n // Check that the target language is valid:\n if (!self.language_codes.includes(tgt_lang_token)) {\n throw new Error(`Target language code \"${tgt_lang_token}\" is not valid. Must be one of: {${self.language_codes.join(', ')}}`);\n }\n\n // Allow `src_lang` to be optional. If not set, we'll use the tokenizer's default.\n if (src_lang_token !== undefined) {\n // Check that the source language is valid:\n if (!self.language_codes.includes(src_lang_token)) {\n throw new Error(`Source language code \"${src_lang_token}\" is not valid. Must be one of: {${self.language_codes.join(', ')}}`);\n }\n\n // In the same way as the Python library, we override the post-processor\n // to force the source language to be first:\n for (const item of self.post_processor.config.single) {\n if ('SpecialToken' in item && self.languageRegex.test(item.SpecialToken.id)) {\n item.SpecialToken.id = self.lang_to_token(src_lang_token);\n break;\n }\n }\n // TODO: Do the same for pair?\n }\n\n // Override the `forced_bos_token_id` to force the correct language\n generate_kwargs.forced_bos_token_id = self.model.convert_tokens_to_ids([self.lang_to_token(tgt_lang_token)])[0];\n\n return self._call(raw_inputs, tokenizer_options);\n}\n\n/**\n * The NllbTokenizer class is used to tokenize text for NLLB (\"No Language Left Behind\") models.\n * \n * No Language Left Behind (NLLB) is a first-of-its-kind, AI breakthrough project\n * that open-sources models capable of delivering high-quality translations directly\n * between any pair of 200+ languages — including low-resource languages like Asturian,\n * Luganda, Urdu and more. It aims to help people communicate with anyone, anywhere,\n * regardless of their language preferences. For more information, check out their\n * [paper](https://arxiv.org/abs/2207.04672).\n * \n * For a list of supported languages (along with their language codes),\n * @see {@link https://github.com/facebookresearch/flores/blob/main/flores200/README.md#languages-in-flores-200}\n */\nclass NllbTokenizer extends PreTrainedTokenizer {\n\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n\n this.languageRegex = /^[a-z]{3}_[A-Z][a-z]{3}$/;\n this.language_codes = this.special_tokens.filter(x => this.languageRegex.test(x));\n this.lang_to_token = x => x; // Identity function\n }\n\n /**\n * Helper function to build translation inputs for an `NllbTokenizer`.\n * @param {string|string[]} raw_inputs The text to tokenize.\n * @param {Object} tokenizer_options Options to be sent to the tokenizer\n * @param {Object} generate_kwargs Generation options.\n * @returns {Object} Object to be passed to the model.\n */\n _build_translation_inputs(raw_inputs, tokenizer_options, generate_kwargs) {\n return _build_translation_inputs(this, raw_inputs, tokenizer_options, generate_kwargs);\n }\n}\n\n/**\n * The M2M100Tokenizer class is used to tokenize text for M2M100 (\"Many-to-Many\") models.\n * \n * M2M100 is a multilingual encoder-decoder (seq-to-seq) model trained for Many-to-Many\n * multilingual translation. It was introduced in this [paper](https://arxiv.org/abs/2010.11125)\n * and first released in [this](https://github.com/pytorch/fairseq/tree/master/examples/m2m_100) repository.\n * \n * For a list of supported languages (along with their language codes),\n * @see {@link https://huggingface.co/facebook/m2m100_418M#languages-covered}\n */\nclass M2M100Tokenizer extends PreTrainedTokenizer {\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n\n this.languageRegex = /^__[a-z]{2,3}__$/;\n this.language_codes = this.special_tokens\n .filter(x => this.languageRegex.test(x))\n .map(x => x.slice(2, -2));\n this.lang_to_token = x => `__${x}__`;\n }\n\n /**\n * Helper function to build translation inputs for an `M2M100Tokenizer`.\n * @param {string|string[]} raw_inputs The text to tokenize.\n * @param {Object} tokenizer_options Options to be sent to the tokenizer\n * @param {Object} generate_kwargs Generation options.\n * @returns {Object} Object to be passed to the model.\n */\n _build_translation_inputs(raw_inputs, tokenizer_options, generate_kwargs) {\n return _build_translation_inputs(this, raw_inputs, tokenizer_options, generate_kwargs);\n }\n}\n\n\nconst WHISPER_LANGUAGES = [\n [\"en\", \"english\"],\n [\"zh\", \"chinese\"],\n [\"de\", \"german\"],\n [\"es\", \"spanish\"],\n [\"ru\", \"russian\"],\n [\"ko\", \"korean\"],\n [\"fr\", \"french\"],\n [\"ja\", \"japanese\"],\n [\"pt\", \"portuguese\"],\n [\"tr\", \"turkish\"],\n [\"pl\", \"polish\"],\n [\"ca\", \"catalan\"],\n [\"nl\", \"dutch\"],\n [\"ar\", \"arabic\"],\n [\"sv\", \"swedish\"],\n [\"it\", \"italian\"],\n [\"id\", \"indonesian\"],\n [\"hi\", \"hindi\"],\n [\"fi\", \"finnish\"],\n [\"vi\", \"vietnamese\"],\n [\"he\", \"hebrew\"],\n [\"uk\", \"ukrainian\"],\n [\"el\", \"greek\"],\n [\"ms\", \"malay\"],\n [\"cs\", \"czech\"],\n [\"ro\", \"romanian\"],\n [\"da\", \"danish\"],\n [\"hu\", \"hungarian\"],\n [\"ta\", \"tamil\"],\n [\"no\", \"norwegian\"],\n [\"th\", \"thai\"],\n [\"ur\", \"urdu\"],\n [\"hr\", \"croatian\"],\n [\"bg\", \"bulgarian\"],\n [\"lt\", \"lithuanian\"],\n [\"la\", \"latin\"],\n [\"mi\", \"maori\"],\n [\"ml\", \"malayalam\"],\n [\"cy\", \"welsh\"],\n [\"sk\", \"slovak\"],\n [\"te\", \"telugu\"],\n [\"fa\", \"persian\"],\n [\"lv\", \"latvian\"],\n [\"bn\", \"bengali\"],\n [\"sr\", \"serbian\"],\n [\"az\", \"azerbaijani\"],\n [\"sl\", \"slovenian\"],\n [\"kn\", \"kannada\"],\n [\"et\", \"estonian\"],\n [\"mk\", \"macedonian\"],\n [\"br\", \"breton\"],\n [\"eu\", \"basque\"],\n [\"is\", \"icelandic\"],\n [\"hy\", \"armenian\"],\n [\"ne\", \"nepali\"],\n [\"mn\", \"mongolian\"],\n [\"bs\", \"bosnian\"],\n [\"kk\", \"kazakh\"],\n [\"sq\", \"albanian\"],\n [\"sw\", \"swahili\"],\n [\"gl\", \"galician\"],\n [\"mr\", \"marathi\"],\n [\"pa\", \"punjabi\"],\n [\"si\", \"sinhala\"],\n [\"km\", \"khmer\"],\n [\"sn\", \"shona\"],\n [\"yo\", \"yoruba\"],\n [\"so\", \"somali\"],\n [\"af\", \"afrikaans\"],\n [\"oc\", \"occitan\"],\n [\"ka\", \"georgian\"],\n [\"be\", \"belarusian\"],\n [\"tg\", \"tajik\"],\n [\"sd\", \"sindhi\"],\n [\"gu\", \"gujarati\"],\n [\"am\", \"amharic\"],\n [\"yi\", \"yiddish\"],\n [\"lo\", \"lao\"],\n [\"uz\", \"uzbek\"],\n [\"fo\", \"faroese\"],\n [\"ht\", \"haitian creole\"],\n [\"ps\", \"pashto\"],\n [\"tk\", \"turkmen\"],\n [\"nn\", \"nynorsk\"],\n [\"mt\", \"maltese\"],\n [\"sa\", \"sanskrit\"],\n [\"lb\", \"luxembourgish\"],\n [\"my\", \"myanmar\"],\n [\"bo\", \"tibetan\"],\n [\"tl\", \"tagalog\"],\n [\"mg\", \"malagasy\"],\n [\"as\", \"assamese\"],\n [\"tt\", \"tatar\"],\n [\"haw\", \"hawaiian\"],\n [\"ln\", \"lingala\"],\n [\"ha\", \"hausa\"],\n [\"ba\", \"bashkir\"],\n [\"jw\", \"javanese\"],\n [\"su\", \"sundanese\"],\n]\n\n// @ts-ignore\nconst WHISPER_LANGUAGE_MAPPING = new Map(WHISPER_LANGUAGES);\n// @ts-ignore\nconst WHISPER_TO_LANGUAGE_CODE_MAPPING = new Map([\n ...WHISPER_LANGUAGES.map(([k, v]) => [v, k]),\n ...[\n [\"burmese\", \"my\"],\n [\"valencian\", \"ca\"],\n [\"flemish\", \"nl\"],\n [\"haitian\", \"ht\"],\n [\"letzeburgesch\", \"lb\"],\n [\"pushto\", \"ps\"],\n [\"panjabi\", \"pa\"],\n [\"moldavian\", \"ro\"],\n [\"moldovan\", \"ro\"],\n [\"sinhalese\", \"si\"],\n [\"castilian\", \"es\"],\n ]\n]);\n\n/**\n * WhisperTokenizer tokenizer\n * @extends PreTrainedTokenizer\n */\nclass WhisperTokenizer extends PreTrainedTokenizer {\n _default_chat_template = `{% for message in messages %}\" \"{{ message.content }}{{ eos_token }}\" \"{% endfor %}`;\n\n /**\n * Decodes automatic speech recognition (ASR) sequences.\n * @param {Array<{tokens: number[], token_timestamps?: number[], stride: number[]}>} sequences The sequences to decode.\n * @param {Object} options The options to use for decoding.\n * @returns {Array, text: string}>}>} The decoded sequences.\n */\n _decode_asr(sequences, {\n return_timestamps = false,\n return_language = false,\n time_precision = null,\n force_full_sequences = true\n } = {}) {\n // Set force_full_sequences=false if you want streaming\n // TODO add support for `return_language`\n\n // Internal method meant to only be used by asr pipeline.\n // Handles all the little quirks specific to whisper to handle\n // the various options not allowed in other seq2seq models\n\n // =========== Overview ============\n // - iterate over all outputs\n // - all tokens within output\n // - Each token can be\n // - language token\n // - special token\n // - timestamp token\n // - text token\n // - We accumulate the text tokens.\n // - We split on end timestamps\n // - Lots of complexity comes from stride and timestamps\n\n if (time_precision === null) {\n throw Error(\"Must specify time_precision\")\n }\n let last_language = null;\n\n const returnWordTimestamps = return_timestamps === \"word\";\n\n function new_chunk() {\n return { \"language\": last_language, \"timestamp\": [null, null], \"text\": \"\" };\n }\n\n // Welcome to the state machine!\n const chunks = [];\n let chunk = new_chunk();\n let time_offset = 0.0;\n const timestamp_begin = this.model.convert_tokens_to_ids([\"<|notimestamps|>\"])[0] + 1;\n\n let previous_tokens = [];\n let previous_token_timestamps = [];\n\n let skip = false;\n let right_stride_start = null;\n\n\n const all_special_ids = new Set(this.all_special_ids);\n\n for (const output of sequences) {\n // NOTE: python version has batches, so it uses [0]\n const token_ids = output.tokens;\n const token_timestamps = returnWordTimestamps ? output.token_timestamps : null;\n\n // These keep track of timestamps within strides, which need\n // to be skipped and resolve all tokens in a single chunk.\n let last_timestamp = null;\n let first_timestamp = timestamp_begin;\n\n if (\"stride\" in output) {\n const [chunk_len, stride_left, stride_right] = output.stride;\n\n // Offset the timings to account for the other `model_outputs`.\n time_offset -= stride_left;\n right_stride_start = chunk_len - stride_right;\n\n // Keeping track of timestamps within strides\n // We're going to NOT split on those, and delay until we're\n // out of BOTH stride. Otherwise lots of issues occur and\n // corner cases\n if (stride_left) {\n first_timestamp = stride_left / time_precision + timestamp_begin;\n }\n\n if (stride_right) {\n for (let i = token_ids.length - 1; i >= 0; --i) {\n const token = token_ids[i];\n if (token >= timestamp_begin) {\n // There can be several token in the right stride\n // But the last one is ALWAYS going to be skipped\n if (last_timestamp !== null && (token - timestamp_begin) * time_precision < right_stride_start) {\n break;\n }\n last_timestamp = token;\n }\n }\n }\n }\n\n let current_tokens = [];\n let current_token_timestamps = [];\n\n // - all tokens within output\n for (let i = 0; i < token_ids.length; ++i) {\n const token = token_ids[i];\n // 4 possible states for each token\n // - 1/ Language code\n // - 2/ all other special tokens (which we ignore)\n // - 3/ Timestamp\n // - 4/ Regular text\n\n if (all_special_ids.has(token)) {\n const text = this.decode([token]);\n const language = WHISPER_LANGUAGE_MAPPING.get(text.slice(2, -2));\n\n if (language !== undefined) {\n // 1/ Indeed some language\n // TODO Handle when language is different from the previous\n // one, and we cannot use timestamped tokens to create chunks\n if (last_language !== null && language !== last_language && !return_timestamps) {\n previous_tokens.push(current_tokens);\n const resolved_tokens = this.findLongestCommonSequence(previous_tokens)[0];\n const resolved_text = this.decode(resolved_tokens);\n chunk.text = resolved_text;\n chunks.push(chunk);\n\n // Flush all our temporary context\n previous_tokens = [];\n current_tokens = [];\n chunk = new_chunk();\n }\n\n last_language = chunk.language = language;\n } else {\n // 2/ This is a regular special token, ignoring it\n }\n } else if (token >= timestamp_begin) {\n // 3/ Timestamp token\n const time = (token - timestamp_begin) * time_precision + time_offset;\n const rounded_time = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.round)(time, 2);\n\n if (last_timestamp !== null && token >= last_timestamp) {\n // Whisper outputted a timestamp token, but it falls within\n // our stride, so we're going to skip it for the time being\n // and resolve this later\n // Skip is necessary because timestamp tokens always come\n // by pair, so we need to skip the next one too (which would mark the start of another chunk).\n skip = true;\n } else if (skip || (previous_tokens.length > 0 && token < first_timestamp)) {\n skip = false;\n } else if (chunk.timestamp[0] === null) {\n chunk.timestamp[0] = rounded_time;\n } else {\n // This is the end of the timestamp chunk\n if (rounded_time === chunk.timestamp[0]) {\n // This is a bug in timestamp token output\n // where we're taking the duplicate token\n // as a stop where it should be a start.\n // This is an issue in the underlying model output\n // Let's just skip it so it becomes de-factor a start agin\n } else {\n chunk.timestamp[1] = rounded_time;\n\n // Handling merges\n previous_tokens.push(current_tokens)\n\n if (returnWordTimestamps) {\n previous_token_timestamps.push(current_token_timestamps);\n }\n const [resolved_tokens, resolved_token_timestamps] = this.findLongestCommonSequence(\n previous_tokens, previous_token_timestamps\n )\n\n const resolved_text = this.decode(resolved_tokens)\n chunk.text = resolved_text\n\n if (returnWordTimestamps) {\n chunk.words = this.collateWordTimestamps(\n resolved_tokens, resolved_token_timestamps, last_language,\n )\n }\n\n chunks.push(chunk)\n\n // Flush all our temporary context\n previous_tokens = []\n current_tokens = []\n previous_token_timestamps = []\n current_token_timestamps = []\n chunk = new_chunk()\n }\n }\n\n } else {\n // 4/ Regular token\n // We just append to the list of all tokens so we can handle\n // merges later and decode into text.\n current_tokens.push(token)\n\n if (returnWordTimestamps) {\n let start_time = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.round)(token_timestamps[i] + time_offset, 2);\n\n let end_time;\n if (i + 1 < token_timestamps.length) {\n end_time = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.round)(token_timestamps[i + 1] + time_offset, 2);\n } else {\n // should never happen\n end_time = null;\n }\n current_token_timestamps.push([start_time, end_time]);\n }\n\n }\n }\n\n if ('stride' in output) {\n const [chunk_len, stride_left, stride_right] = output.stride;\n time_offset += chunk_len - stride_right\n }\n\n // Leftover tokens\n if (current_tokens.length > 0) {\n previous_tokens.push(current_tokens)\n if (returnWordTimestamps) {\n previous_token_timestamps.push(current_token_timestamps);\n }\n } else if (previous_tokens.every(p => p.length === 0)) {\n // Flushing previous tokens (END)\"\n chunk = new_chunk()\n previous_tokens = []\n current_tokens = []\n previous_token_timestamps = [];\n current_token_timestamps = [];\n }\n\n }\n\n if (previous_tokens.length > 0) {\n if (force_full_sequences && return_timestamps) {\n // Last token should always be timestamps, so there shouldn't be\n // leftover\n throw new Error(\n \"Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. \" +\n \"Also make sure WhisperTimeStampLogitsProcessor was used during generation.\"\n );\n }\n\n // Happens when we don't use timestamps\n const [resolved_tokens, resolved_token_timestamps] = this.findLongestCommonSequence(previous_tokens, previous_token_timestamps);\n\n // Flushing previous tokens (FINAL)\n const resolved_text = this.decode(resolved_tokens);\n chunk.text = resolved_text;\n if (returnWordTimestamps) {\n chunk.words = this.collateWordTimestamps(\n resolved_tokens, resolved_token_timestamps, last_language,\n )\n }\n chunks.push(chunk);\n }\n\n let optional = Object.create(null);\n\n // Preparing and cleaning up the pipeline output\n const full_text = chunks.map(chunk => chunk.text).join('');\n if (return_timestamps || return_language) {\n for (let i = 0; i < chunks.length; ++i) {\n const chunk = chunks[i];\n if (!return_timestamps) {\n delete chunk[\"timestamp\"];\n }\n\n if (!return_language) {\n delete chunk[\"language\"];\n }\n }\n if (returnWordTimestamps) {\n const new_chunks = [];\n for (const chunk of chunks) {\n for (const word of chunk.words) {\n new_chunks.push(word);\n }\n }\n optional = { \"chunks\": new_chunks };\n } else {\n optional = { \"chunks\": chunks };\n }\n }\n return [full_text, optional];\n\n }\n\n /**\n * Finds the longest common sequence among the provided sequences.\n * @param {number[][]} sequences An array of sequences of token ids to compare.\n * @returns {number[][]} The longest common sequence found.\n * @throws {Error} If there is a bug within the function.\n * @private\n */\n findLongestCommonSequence(sequences, token_timestamp_sequences = null) {\n // It would be much harder to do O(n) because of fault tolerance.\n // We actually have a really good property which is that the total sequence\n // MUST be those subsequences in order.\n // If token_timestamp_sequences is provided, will split those sequences in\n // exactly the same way.\n let leftSequence = sequences[0];\n let leftLength = leftSequence.length;\n let totalSequence = [];\n\n const use_token_timestamp_sequences = Array.isArray(token_timestamp_sequences) && token_timestamp_sequences.length > 0;\n let total_token_timestamp_sequence = use_token_timestamp_sequences ? [] : null;\n let left_token_timestamp_sequence = use_token_timestamp_sequences ? token_timestamp_sequences[0] : null;\n for (let i = 1; i < sequences.length; ++i) {\n const rightSequence = sequences[i];\n let max = 0.0;\n let maxIndices = [leftLength, leftLength, 0, 0];\n // Here we're sliding matches\n // [a, b, c, d]\n // [c, d, f]\n // = [c] == [d]\n\n // [a, b, c, d]\n // [c, d, f]\n // = [c, d] == [c, d]\n\n\n // [a, b, c, d]\n // [c, d, f]\n\n // = [b, c, d] == [c, d, f]\n\n // [a, b, c, d]\n // [c, d, f]\n\n // [a, b, c] == [c, d, f]\n\n // [a, b, c, d]\n // [d, f]\n\n // [a, b] == [d, f]\n\n // [a, b, c, d]\n // [f]\n\n // [a] == [f]\n\n const rightLength = rightSequence.length;\n for (let j = 1; j < leftLength + rightLength; ++j) {\n const eps = j / 10000.0;\n const leftStart = Math.max(0, leftLength - j);\n const leftStop = Math.min(leftLength, leftLength + rightLength - j);\n const left = leftSequence.slice(leftStart, leftStop);\n const rightStart = Math.max(0, j - leftLength);\n const rightStop = Math.min(rightLength, j);\n const right = rightSequence.slice(rightStart, rightStop);\n if (left.length !== right.length) {\n throw new Error(\"There is a bug within whisper `decode_asr` function, please report it. Dropping to prevent bad inference.\");\n }\n const matches = left.filter((elem, idx) => elem === right[idx]).length;\n const matching = matches / j + eps;\n if (matches > 1 && matching > max) {\n max = matching;\n maxIndices = [leftStart, leftStop, rightStart, rightStop];\n }\n }\n const [leftStart, leftStop, rightStart, rightStop] = maxIndices;\n const leftMid = Math.floor((leftStop + leftStart) / 2);\n const rightMid = Math.floor((rightStop + rightStart) / 2);\n totalSequence.push(...leftSequence.slice(0, leftMid));\n leftSequence = rightSequence.slice(rightMid);\n leftLength = leftSequence.length;\n\n if (use_token_timestamp_sequences) {\n total_token_timestamp_sequence.push(...left_token_timestamp_sequence.slice(0, leftMid));\n left_token_timestamp_sequence = token_timestamp_sequences[i].slice(rightMid);\n }\n }\n totalSequence.push(...leftSequence);\n\n if (use_token_timestamp_sequences) {\n total_token_timestamp_sequence.push(...left_token_timestamp_sequence);\n return [totalSequence, total_token_timestamp_sequence];\n } else {\n return [totalSequence, []];\n }\n }\n\n /** @private */\n collateWordTimestamps(tokens, token_timestamps, language) {\n\n const [words, _, token_indices] = this.combineTokensIntoWords(tokens, language);\n\n const timings = [];\n for (let i = 0; i < words.length; ++i) {\n const indices = token_indices[i];\n timings.push({\n text: words[i],\n timestamp: [\n token_timestamps[indices.at(0)][0],\n token_timestamps[indices.at(-1)][1],\n ],\n });\n }\n return timings;\n }\n\n /**\n * Groups tokens by word. Returns a tuple containing a list of strings with the words,\n * and a list of `token_id` sequences with the tokens making up each word.\n * @param {number[]} tokens \n * @param {string} [language] \n * @param {string} prepend_punctionations \n * @param {string} append_punctuations \n * \n * @private\n */\n combineTokensIntoWords(tokens, language, prepend_punctionations = \"\\\"'“¡¿([{-\", append_punctuations = \"\\\"'.。,,!!??::”)]}、\") {\n language = language ?? 'english';\n\n let words, word_tokens, token_indices;\n\n if ([\"chinese\", \"japanese\", \"thai\", \"lao\", \"myanmar\"].includes(language)) {\n // These languages don't typically use spaces.\n [words, word_tokens, token_indices] = this.splitTokensOnUnicode(tokens)\n } else {\n [words, word_tokens, token_indices] = this.splitTokensOnSpaces(tokens)\n }\n\n return this.mergePunctuations(words, word_tokens, token_indices, prepend_punctionations, append_punctuations);\n }\n\n /** @type {PreTrainedTokenizer['decode']} */\n decode(\n token_ids,\n decode_args,\n ) {\n let text;\n // @ts-ignore\n if (decode_args && decode_args.decode_with_timestamps) {\n if (token_ids instanceof _utils_tensor_js__WEBPACK_IMPORTED_MODULE_3__.Tensor) {\n token_ids = prepareTensorForDecode(token_ids);\n }\n text = this.decodeWithTimestamps(token_ids, decode_args);\n } else {\n text = super.decode(token_ids, decode_args);\n }\n // TODO: implement offsets\n // if (decode_args.output_offsets) {\n // let offsets = this.computeOffsets\n // }\n return text;\n }\n\n /**\n * @param {number[]} token_ids List of token IDs to decode.\n * @param {Object} decode_args Optional arguments for decoding\n * @private\n */\n decodeWithTimestamps(token_ids, decode_args) {\n const time_precision = decode_args?.time_precision ?? 0.02;\n\n const timestamp_begin = Array.from(this.all_special_ids).at(-1) + 1;\n /**@type {Array} */\n let outputs = [[]];\n for (const token of token_ids) {\n if (token >= timestamp_begin) {\n const timestamp = (0,_utils_maths_js__WEBPACK_IMPORTED_MODULE_2__.round)((token - timestamp_begin) * time_precision, 2);\n outputs.push(`<|${timestamp}|>`);\n outputs.push([]);\n } else {\n outputs[outputs.length - 1].push(token);\n }\n }\n outputs = outputs.map(\n s => {\n if (typeof s === 'string') {\n return s;\n } else {\n return super.decode(s, decode_args);\n }\n }\n )\n\n return outputs.join('');\n }\n\n /**\n * Combine tokens into words by splitting at any position where the tokens are decoded as valid unicode points.\n * @param {number[]} tokens \n * @returns {*}\n * @private\n */\n splitTokensOnUnicode(tokens) {\n const decoded_full = this.decode(tokens, {\n // @ts-ignore\n decode_with_timestamps: true,\n });\n const replacement_char = '\\uFFFD';\n\n const words = []\n const word_tokens = []\n const token_indices = []\n let current_tokens = []\n let current_indices = []\n let unicode_offset = 0\n\n for (let token_idx = 0; token_idx < tokens.length; ++token_idx) {\n const token = tokens[token_idx];\n\n current_tokens.push(token);\n current_indices.push(token_idx);\n\n const decoded = this.decode(current_tokens, {\n // @ts-ignore\n decode_with_timestamps: true,\n });\n\n if (!decoded.includes(replacement_char) || decoded_full[unicode_offset + decoded.indexOf(replacement_char)] === replacement_char) {\n words.push(decoded)\n word_tokens.push(current_tokens)\n token_indices.push(current_indices)\n current_tokens = []\n current_indices = []\n unicode_offset += decoded.length;\n }\n\n }\n\n return [words, word_tokens, token_indices]\n }\n\n /**\n * Combine tokens into words by splitting at whitespace and punctuation tokens.\n * @param {number[]} tokens \n * @private\n */\n splitTokensOnSpaces(tokens) {\n\n const [subwords, subword_tokens_list, subword_indices_list] = this.splitTokensOnUnicode(tokens);\n\n const words = []\n const word_tokens = []\n const token_indices = []\n\n const punctuationRegex = new RegExp(`^[${PUNCTUATION_REGEX}]$`, 'gu');\n\n for (let i = 0; i < subwords.length; ++i) {\n\n const subword = subwords[i];\n const subword_tokens = subword_tokens_list[i];\n const subword_indices = subword_indices_list[i];\n\n // @ts-ignore\n const special = subword_tokens[0] >= this.model.tokens_to_ids.get('<|endoftext|>');\n const with_space = subword.startsWith(' ');\n const trimmed = subword.trim();\n const punctuation = punctuationRegex.test(trimmed);\n\n if (special || with_space || punctuation || words.length === 0) {\n words.push(subword);\n word_tokens.push(subword_tokens);\n token_indices.push(subword_indices);\n } else {\n const ix = words.length - 1;\n words[ix] += subword;\n word_tokens[ix].push(...subword_tokens);\n token_indices[ix].push(...subword_indices);\n }\n }\n\n return [words, word_tokens, token_indices];\n\n }\n\n /**\n * Merges punctuation tokens with neighboring words.\n * @param {string[]} words \n * @param {number[][]} tokens \n * @param {number[][]} indices \n * @param {string} prepended \n * @param {string} appended \n * @private\n */\n mergePunctuations(words, tokens, indices, prepended, appended) {\n\n const newWords = structuredClone(words);\n const newTokens = structuredClone(tokens);\n const newIndices = structuredClone(indices);\n\n\n // prepend punctuations\n let i = newWords.length - 2;\n let j = newWords.length - 1;\n\n while (i >= 0) {\n if (newWords[i].startsWith(' ') && prepended.includes(newWords[i].trim())) {\n newWords[j] = newWords[i] + newWords[j];\n newTokens[j] = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(newTokens[i], newTokens[j]);\n newIndices[j] = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(newIndices[i], newIndices[j]);\n newWords[i] = '';\n newTokens[i] = [];\n newIndices[i] = [];\n } else {\n j = i;\n }\n --i;\n }\n\n // append punctuations\n i = 0;\n j = 1;\n while (j < newWords.length) {\n if (!newWords[i].endsWith(' ') && appended.includes(newWords[j])) {\n newWords[i] += newWords[j];\n newTokens[i] = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(newTokens[i], newTokens[j]);\n newIndices[i] = (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)(newIndices[i], newIndices[j]);\n newWords[j] = '';\n newTokens[j] = [];\n newIndices[j] = [];\n } else {\n i = j;\n }\n ++j;\n }\n\n return [\n newWords.filter(x => x),\n newTokens.filter(x => x.length > 0),\n newIndices.filter(x => x.length > 0),\n ]\n }\n\n /**\n * Helper function to build translation inputs for a `WhisperTokenizer`,\n * depending on the language, task, and whether to predict timestamp tokens.\n * \n * Used to override the prefix tokens appended to the start of the label sequence.\n * \n * **Example: Get ids for a language**\n * ```javascript\n * // instantiate the tokenizer and set the prefix token to Spanish\n * const tokenizer = await WhisperTokenizer.from_pretrained('Xenova/whisper-tiny');\n * const forced_decoder_ids = tokenizer.get_decoder_prompt_ids({ language: 'spanish' });\n * // [(1, 50262), (2, 50363)]\n * ```\n * \n * @param {Object} options Options to generate the decoder prompt.\n * @param {string} [options.language] The language of the transcription text.\n * The corresponding language id token is appended to the start of the sequence for multilingual\n * speech recognition and speech translation tasks, e.g. for \"Spanish\" the token \"<|es|>\" is appended\n * to the start of sequence.\n * @param {string} [options.task] Task identifier to append at the start of sequence (if any).\n * This should be used for mulitlingual fine-tuning, with \"transcribe\" for speech recognition and\n * \"translate\" for speech translation.\n * @param {boolean} [options.no_timestamps] Whether to add the <|notimestamps|> token at the start of the sequence.\n * @returns {number[][]} The decoder prompt ids.\n */\n get_decoder_prompt_ids({\n language = null,\n task = null,\n no_timestamps = true,\n } = {}) {\n\n // <|lang_id|> <|task|> <|notimestamps|>\n\n const forced_decoder_ids = [];\n\n if (language) {\n // User wishes to specify the language\n language = language.toLowerCase();\n\n // Map to code from user-friendly name (e.g., \"english\" -> \"en\")\n let language_code = WHISPER_TO_LANGUAGE_CODE_MAPPING.get(language);\n\n if (language_code === undefined) {\n // User provided something that is not a language name\n\n if (WHISPER_LANGUAGE_MAPPING.has(language)) {\n // User provided the language code directly (e.g., \"en\")\n language_code = language;\n\n } else {\n // User provided something that is not a language code or name\n const is_language_code = language.length === 2;\n const langs = is_language_code ? WHISPER_LANGUAGE_MAPPING.keys() : WHISPER_LANGUAGE_MAPPING.values();\n\n throw new Error(`Language \"${language}\" is not supported. Must be one of: ${JSON.stringify(langs)}`);\n }\n }\n\n const language_token_id = this.model.tokens_to_ids.get(`<|${language_code}|>`);\n if (language_token_id === undefined) {\n throw new Error(`Unable to find language \"${language_code}\" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.`)\n }\n\n forced_decoder_ids.push(language_token_id);\n } else {\n // No token will be forced, which leaves the model to predict the language\n forced_decoder_ids.push(null);\n }\n\n if (task) {\n task = task.toLowerCase();\n if (task !== 'transcribe' && task !== 'translate') {\n throw new Error(`Task \"${task}\" is not supported. Must be one of: [\"transcribe\", \"translate\"]`);\n }\n\n const task_token_id = this.model.tokens_to_ids.get(`<|${task}|>`);\n if (task_token_id === undefined) {\n throw new Error(`Unable to find task \"${task}\" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.`)\n }\n\n forced_decoder_ids.push(task_token_id);\n } else {\n // No token will be forced, which leaves the model to predict the task\n forced_decoder_ids.push(null);\n }\n\n if (no_timestamps) {\n const no_timestamps_id = this.model.tokens_to_ids.get(`<|notimestamps|>`);\n if (no_timestamps_id === undefined) {\n throw new Error('Unable to find \"<|notimestamps|>\" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.')\n }\n\n forced_decoder_ids.push(no_timestamps_id);\n }\n\n return forced_decoder_ids.map((x, i) => [i + 1, x]).filter(x => x[1] !== null);\n\n }\n}\nclass CodeGenTokenizer extends PreTrainedTokenizer { }\nclass CLIPTokenizer extends PreTrainedTokenizer { }\nclass SiglipTokenizer extends PreTrainedTokenizer { }\n\n/**\n * @todo This model is not yet supported by Hugging Face's \"fast\" tokenizers library (https://github.com/huggingface/tokenizers).\n * Therefore, this implementation (which is based on fast tokenizers) may produce slightly inaccurate results.\n */\nclass MarianTokenizer extends PreTrainedTokenizer {\n /**\n * Create a new MarianTokenizer instance.\n * @param {Object} tokenizerJSON The JSON of the tokenizer.\n * @param {Object} tokenizerConfig The config of the tokenizer.\n */\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n\n this.languageRegex = /^(>>\\w+<<)\\s*/g;\n\n this.supported_language_codes = this.model.vocab.filter(\n x => this.languageRegex.test(x)\n );\n\n console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\\'s \"fast\" tokenizers library. Therefore, you may experience slightly inaccurate results.')\n }\n\n /**\n * Encodes a single text. Overriding this method is necessary since the language codes\n * must be removed before encoding with sentencepiece model.\n * @see https://github.com/huggingface/transformers/blob/12d51db243a00726a548a43cc333390ebae731e3/src/transformers/models/marian/tokenization_marian.py#L204-L213\n *\n * @param {string|null} text The text to encode.\n * @returns {Array} The encoded tokens.\n */\n _encode_text(text) {\n if (text === null) return null;\n\n // Check if text starts with language code:\n const [matchInfo, ...remainder] = text.trim().split(this.languageRegex);\n\n if (remainder.length === 0) {\n // No language code, encode normally\n return super._encode_text(matchInfo);\n\n } else if (remainder.length === 2) {\n // Text starts with language code, so we do not encode it with sentencepiece.\n const [language, text] = remainder;\n\n if (!this.supported_language_codes.includes(language)) {\n console.warn(`Unsupported language code \"${language}\" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`)\n }\n return (0,_utils_core_js__WEBPACK_IMPORTED_MODULE_0__.mergeArrays)([language], super._encode_text(text));\n }\n }\n\n}\n\nclass Wav2Vec2CTCTokenizer extends PreTrainedTokenizer { }\n\nclass BlenderbotTokenizer extends PreTrainedTokenizer {\n _default_chat_template = `{% for message in messages %}{% if message['role'] == 'user' %}{{ ' ' }}{% endif %}{{ message['content'] }}{% if not loop.last %}{{ ' ' }}{% endif %}{% endfor %}{{ eos_token }}`;\n}\nclass BlenderbotSmallTokenizer extends BlenderbotTokenizer { } // NOTE `BlenderbotTokenizer` to get the correct chat template\n\nclass SpeechT5Tokenizer extends PreTrainedTokenizer { }\n\nclass NougatTokenizer extends PreTrainedTokenizer { }\n\nclass VitsTokenizer extends PreTrainedTokenizer {\n\n constructor(tokenizerJSON, tokenizerConfig) {\n super(tokenizerJSON, tokenizerConfig);\n\n // Custom decoder function\n this.decoder = new VitsDecoder({});\n }\n}\n\nclass CohereTokenizer extends PreTrainedTokenizer { }\n\n/**\n * Helper class which is used to instantiate pretrained tokenizers with the `from_pretrained` function.\n * The chosen tokenizer class is determined by the type specified in the tokenizer config.\n * \n * @example\n * const tokenizer = await AutoTokenizer.from_pretrained('Xenova/bert-base-uncased');\n */\nclass AutoTokenizer {\n static TOKENIZER_CLASS_MAPPING = {\n T5Tokenizer,\n DistilBertTokenizer,\n CamembertTokenizer,\n DebertaTokenizer,\n DebertaV2Tokenizer,\n BertTokenizer,\n HerbertTokenizer,\n ConvBertTokenizer,\n RoFormerTokenizer,\n XLMTokenizer,\n ElectraTokenizer,\n MobileBertTokenizer,\n SqueezeBertTokenizer,\n AlbertTokenizer,\n GPT2Tokenizer,\n BartTokenizer,\n MBartTokenizer,\n MBart50Tokenizer,\n RobertaTokenizer,\n WhisperTokenizer,\n CodeGenTokenizer,\n CLIPTokenizer,\n SiglipTokenizer,\n MarianTokenizer,\n BloomTokenizer,\n NllbTokenizer,\n M2M100Tokenizer,\n LlamaTokenizer,\n CodeLlamaTokenizer,\n XLMRobertaTokenizer,\n MPNetTokenizer,\n FalconTokenizer,\n GPTNeoXTokenizer,\n EsmTokenizer,\n Wav2Vec2CTCTokenizer,\n BlenderbotTokenizer,\n BlenderbotSmallTokenizer,\n SpeechT5Tokenizer,\n NougatTokenizer,\n VitsTokenizer,\n Qwen2Tokenizer,\n GemmaTokenizer,\n Grok1Tokenizer,\n CohereTokenizer,\n\n // Base case:\n PreTrainedTokenizer,\n }\n\n\n /**\n * Instantiate one of the tokenizer classes of the library from a pretrained model.\n * \n * The tokenizer class to instantiate is selected based on the `tokenizer_class` property of the config object\n * (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible)\n * \n * @param {string} pretrained_model_name_or_path The name or path of the pretrained model. Can be either:\n * - A string, the *model id* of a pretrained tokenizer hosted inside a model repo on huggingface.co.\n * Valid model ids can be located at the root-level, like `bert-base-uncased`, or namespaced under a\n * user or organization name, like `dbmdz/bert-base-german-cased`.\n * - A path to a *directory* containing tokenizer files, e.g., `./my_model_directory/`.\n * @param {PretrainedTokenizerOptions} options Additional options for loading the tokenizer.\n * \n * @returns {Promise} A new instance of the PreTrainedTokenizer class.\n */\n static async from_pretrained(pretrained_model_name_or_path, {\n quantized = true,\n progress_callback = null,\n config = null,\n cache_dir = null,\n local_files_only = false,\n revision = 'main',\n legacy = null,\n } = {}) {\n\n const [tokenizerJSON, tokenizerConfig] = await loadTokenizer(pretrained_model_name_or_path, {\n quantized,\n progress_callback,\n config,\n cache_dir,\n local_files_only,\n revision,\n legacy,\n })\n\n // Some tokenizers are saved with the \"Fast\" suffix, so we remove that if present.\n const tokenizerName = tokenizerConfig.tokenizer_class?.replace(/Fast$/, '') ?? 'PreTrainedTokenizer';\n\n let cls = this.TOKENIZER_CLASS_MAPPING[tokenizerName];\n if (!cls) {\n console.warn(`Unknown tokenizer class \"${tokenizerName}\", attempting to construct from base class.`);\n cls = PreTrainedTokenizer;\n }\n return new cls(tokenizerJSON, tokenizerConfig);\n }\n}\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/tokenizers.js?"); /***/ }), @@ -348,7 +3680,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ASTFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.ASTFeatureExtractor),\n/* harmony export */ ASTForAudioClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ASTForAudioClassification),\n/* harmony export */ ASTModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ASTModel),\n/* harmony export */ ASTPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ASTPreTrainedModel),\n/* harmony export */ AlbertForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AlbertForMaskedLM),\n/* harmony export */ AlbertForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AlbertForQuestionAnswering),\n/* harmony export */ AlbertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AlbertForSequenceClassification),\n/* harmony export */ AlbertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AlbertModel),\n/* harmony export */ AlbertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AlbertPreTrainedModel),\n/* harmony export */ AlbertTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.AlbertTokenizer),\n/* harmony export */ AudioClassificationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.AudioClassificationPipeline),\n/* harmony export */ AutoConfig: () => (/* reexport safe */ _configs_js__WEBPACK_IMPORTED_MODULE_5__.AutoConfig),\n/* harmony export */ AutoModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModel),\n/* harmony export */ AutoModelForAudioClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForAudioClassification),\n/* harmony export */ AutoModelForCTC: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForCTC),\n/* harmony export */ AutoModelForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForCausalLM),\n/* harmony export */ AutoModelForDepthEstimation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForDepthEstimation),\n/* harmony export */ AutoModelForDocumentQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForDocumentQuestionAnswering),\n/* harmony export */ AutoModelForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForImageClassification),\n/* harmony export */ AutoModelForImageMatting: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForImageMatting),\n/* harmony export */ AutoModelForImageSegmentation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForImageSegmentation),\n/* harmony export */ AutoModelForImageToImage: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForImageToImage),\n/* harmony export */ AutoModelForMaskGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForMaskGeneration),\n/* harmony export */ AutoModelForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForMaskedLM),\n/* harmony export */ AutoModelForObjectDetection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForObjectDetection),\n/* harmony export */ AutoModelForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForQuestionAnswering),\n/* harmony export */ AutoModelForSemanticSegmentation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForSemanticSegmentation),\n/* harmony export */ AutoModelForSeq2SeqLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForSeq2SeqLM),\n/* harmony export */ AutoModelForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForSequenceClassification),\n/* harmony export */ AutoModelForSpeechSeq2Seq: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForSpeechSeq2Seq),\n/* harmony export */ AutoModelForTextToSpectrogram: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForTextToSpectrogram),\n/* harmony export */ AutoModelForTextToWaveform: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForTextToWaveform),\n/* harmony export */ AutoModelForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForTokenClassification),\n/* harmony export */ AutoModelForVision2Seq: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForVision2Seq),\n/* harmony export */ AutoModelForZeroShotObjectDetection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForZeroShotObjectDetection),\n/* harmony export */ AutoProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.AutoProcessor),\n/* harmony export */ AutoTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.AutoTokenizer),\n/* harmony export */ AutomaticSpeechRecognitionPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.AutomaticSpeechRecognitionPipeline),\n/* harmony export */ BartForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BartForConditionalGeneration),\n/* harmony export */ BartForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BartForSequenceClassification),\n/* harmony export */ BartModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BartModel),\n/* harmony export */ BartPretrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BartPretrainedModel),\n/* harmony export */ BartTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.BartTokenizer),\n/* harmony export */ BaseModelOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BaseModelOutput),\n/* harmony export */ BeitFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.BeitFeatureExtractor),\n/* harmony export */ BeitForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BeitForImageClassification),\n/* harmony export */ BeitModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BeitModel),\n/* harmony export */ BeitPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BeitPreTrainedModel),\n/* harmony export */ BertForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BertForMaskedLM),\n/* harmony export */ BertForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BertForQuestionAnswering),\n/* harmony export */ BertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BertForSequenceClassification),\n/* harmony export */ BertForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BertForTokenClassification),\n/* harmony export */ BertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BertModel),\n/* harmony export */ BertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BertPreTrainedModel),\n/* harmony export */ BertTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.BertTokenizer),\n/* harmony export */ BitImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.BitImageProcessor),\n/* harmony export */ BlenderbotForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BlenderbotForConditionalGeneration),\n/* harmony export */ BlenderbotModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BlenderbotModel),\n/* harmony export */ BlenderbotPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BlenderbotPreTrainedModel),\n/* harmony export */ BlenderbotSmallForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BlenderbotSmallForConditionalGeneration),\n/* harmony export */ BlenderbotSmallModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BlenderbotSmallModel),\n/* harmony export */ BlenderbotSmallPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BlenderbotSmallPreTrainedModel),\n/* harmony export */ BlenderbotSmallTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.BlenderbotSmallTokenizer),\n/* harmony export */ BlenderbotTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.BlenderbotTokenizer),\n/* harmony export */ BloomForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BloomForCausalLM),\n/* harmony export */ BloomModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BloomModel),\n/* harmony export */ BloomPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BloomPreTrainedModel),\n/* harmony export */ BloomTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.BloomTokenizer),\n/* harmony export */ CLIPFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.CLIPFeatureExtractor),\n/* harmony export */ CLIPModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CLIPModel),\n/* harmony export */ CLIPPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CLIPPreTrainedModel),\n/* harmony export */ CLIPSegForImageSegmentation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CLIPSegForImageSegmentation),\n/* harmony export */ CLIPSegModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CLIPSegModel),\n/* harmony export */ CLIPSegPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CLIPSegPreTrainedModel),\n/* harmony export */ CLIPTextModelWithProjection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CLIPTextModelWithProjection),\n/* harmony export */ CLIPTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.CLIPTokenizer),\n/* harmony export */ CLIPVisionModelWithProjection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CLIPVisionModelWithProjection),\n/* harmony export */ CamembertForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CamembertForMaskedLM),\n/* harmony export */ CamembertForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CamembertForQuestionAnswering),\n/* harmony export */ CamembertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CamembertForSequenceClassification),\n/* harmony export */ CamembertForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CamembertForTokenClassification),\n/* harmony export */ CamembertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CamembertModel),\n/* harmony export */ CamembertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CamembertPreTrainedModel),\n/* harmony export */ CamembertTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.CamembertTokenizer),\n/* harmony export */ CausalLMOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CausalLMOutput),\n/* harmony export */ CausalLMOutputWithPast: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CausalLMOutputWithPast),\n/* harmony export */ ChineseCLIPFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.ChineseCLIPFeatureExtractor),\n/* harmony export */ ChineseCLIPModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ChineseCLIPModel),\n/* harmony export */ ChineseCLIPPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ChineseCLIPPreTrainedModel),\n/* harmony export */ ClapAudioModelWithProjection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ClapAudioModelWithProjection),\n/* harmony export */ ClapFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.ClapFeatureExtractor),\n/* harmony export */ ClapModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ClapModel),\n/* harmony export */ ClapPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ClapPreTrainedModel),\n/* harmony export */ ClapTextModelWithProjection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ClapTextModelWithProjection),\n/* harmony export */ CodeGenForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CodeGenForCausalLM),\n/* harmony export */ CodeGenModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CodeGenModel),\n/* harmony export */ CodeGenPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CodeGenPreTrainedModel),\n/* harmony export */ CodeGenTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.CodeGenTokenizer),\n/* harmony export */ CodeLlamaTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.CodeLlamaTokenizer),\n/* harmony export */ ConvBertForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvBertForMaskedLM),\n/* harmony export */ ConvBertForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvBertForQuestionAnswering),\n/* harmony export */ ConvBertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvBertForSequenceClassification),\n/* harmony export */ ConvBertForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvBertForTokenClassification),\n/* harmony export */ ConvBertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvBertModel),\n/* harmony export */ ConvBertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvBertPreTrainedModel),\n/* harmony export */ ConvBertTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.ConvBertTokenizer),\n/* harmony export */ ConvNextFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.ConvNextFeatureExtractor),\n/* harmony export */ ConvNextForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvNextForImageClassification),\n/* harmony export */ ConvNextImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.ConvNextImageProcessor),\n/* harmony export */ ConvNextModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvNextModel),\n/* harmony export */ ConvNextPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvNextPreTrainedModel),\n/* harmony export */ ConvNextV2ForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvNextV2ForImageClassification),\n/* harmony export */ ConvNextV2Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvNextV2Model),\n/* harmony export */ ConvNextV2PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvNextV2PreTrainedModel),\n/* harmony export */ DPTFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.DPTFeatureExtractor),\n/* harmony export */ DPTForDepthEstimation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DPTForDepthEstimation),\n/* harmony export */ DPTImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.DPTImageProcessor),\n/* harmony export */ DPTModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DPTModel),\n/* harmony export */ DPTPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DPTPreTrainedModel),\n/* harmony export */ DebertaForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaForMaskedLM),\n/* harmony export */ DebertaForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaForQuestionAnswering),\n/* harmony export */ DebertaForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaForSequenceClassification),\n/* harmony export */ DebertaForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaForTokenClassification),\n/* harmony export */ DebertaModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaModel),\n/* harmony export */ DebertaPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaPreTrainedModel),\n/* harmony export */ DebertaTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.DebertaTokenizer),\n/* harmony export */ DebertaV2ForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaV2ForMaskedLM),\n/* harmony export */ DebertaV2ForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaV2ForQuestionAnswering),\n/* harmony export */ DebertaV2ForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaV2ForSequenceClassification),\n/* harmony export */ DebertaV2ForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaV2ForTokenClassification),\n/* harmony export */ DebertaV2Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaV2Model),\n/* harmony export */ DebertaV2PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaV2PreTrainedModel),\n/* harmony export */ DebertaV2Tokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.DebertaV2Tokenizer),\n/* harmony export */ DeiTFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.DeiTFeatureExtractor),\n/* harmony export */ DeiTForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DeiTForImageClassification),\n/* harmony export */ DeiTModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DeiTModel),\n/* harmony export */ DeiTPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DeiTPreTrainedModel),\n/* harmony export */ DepthAnythingForDepthEstimation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DepthAnythingForDepthEstimation),\n/* harmony export */ DepthAnythingPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DepthAnythingPreTrainedModel),\n/* harmony export */ DepthEstimationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.DepthEstimationPipeline),\n/* harmony export */ DetrFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.DetrFeatureExtractor),\n/* harmony export */ DetrForObjectDetection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DetrForObjectDetection),\n/* harmony export */ DetrForSegmentation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DetrForSegmentation),\n/* harmony export */ DetrModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DetrModel),\n/* harmony export */ DetrObjectDetectionOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DetrObjectDetectionOutput),\n/* harmony export */ DetrPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DetrPreTrainedModel),\n/* harmony export */ DetrSegmentationOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DetrSegmentationOutput),\n/* harmony export */ Dinov2ForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Dinov2ForImageClassification),\n/* harmony export */ Dinov2Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Dinov2Model),\n/* harmony export */ Dinov2PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Dinov2PreTrainedModel),\n/* harmony export */ DistilBertForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DistilBertForMaskedLM),\n/* harmony export */ DistilBertForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DistilBertForQuestionAnswering),\n/* harmony export */ DistilBertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DistilBertForSequenceClassification),\n/* harmony export */ DistilBertForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DistilBertForTokenClassification),\n/* harmony export */ DistilBertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DistilBertModel),\n/* harmony export */ DistilBertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DistilBertPreTrainedModel),\n/* harmony export */ DistilBertTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.DistilBertTokenizer),\n/* harmony export */ DocumentQuestionAnsweringPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.DocumentQuestionAnsweringPipeline),\n/* harmony export */ DonutFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.DonutFeatureExtractor),\n/* harmony export */ DonutSwinModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DonutSwinModel),\n/* harmony export */ DonutSwinPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DonutSwinPreTrainedModel),\n/* harmony export */ ElectraForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ElectraForMaskedLM),\n/* harmony export */ ElectraForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ElectraForQuestionAnswering),\n/* harmony export */ ElectraForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ElectraForSequenceClassification),\n/* harmony export */ ElectraForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ElectraForTokenClassification),\n/* harmony export */ ElectraModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ElectraModel),\n/* harmony export */ ElectraPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ElectraPreTrainedModel),\n/* harmony export */ ElectraTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.ElectraTokenizer),\n/* harmony export */ EsmForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.EsmForMaskedLM),\n/* harmony export */ EsmForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.EsmForSequenceClassification),\n/* harmony export */ EsmForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.EsmForTokenClassification),\n/* harmony export */ EsmModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.EsmModel),\n/* harmony export */ EsmPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.EsmPreTrainedModel),\n/* harmony export */ EsmTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.EsmTokenizer),\n/* harmony export */ FFT: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.FFT),\n/* harmony export */ FalconForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.FalconForCausalLM),\n/* harmony export */ FalconModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.FalconModel),\n/* harmony export */ FalconPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.FalconPreTrainedModel),\n/* harmony export */ FalconTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.FalconTokenizer),\n/* harmony export */ FeatureExtractionPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.FeatureExtractionPipeline),\n/* harmony export */ FeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.FeatureExtractor),\n/* harmony export */ FillMaskPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.FillMaskPipeline),\n/* harmony export */ GLPNFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.GLPNFeatureExtractor),\n/* harmony export */ GLPNForDepthEstimation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GLPNForDepthEstimation),\n/* harmony export */ GLPNModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GLPNModel),\n/* harmony export */ GLPNPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GLPNPreTrainedModel),\n/* harmony export */ GPT2LMHeadModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPT2LMHeadModel),\n/* harmony export */ GPT2Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPT2Model),\n/* harmony export */ GPT2PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPT2PreTrainedModel),\n/* harmony export */ GPT2Tokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.GPT2Tokenizer),\n/* harmony export */ GPTBigCodeForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTBigCodeForCausalLM),\n/* harmony export */ GPTBigCodeModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTBigCodeModel),\n/* harmony export */ GPTBigCodePreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTBigCodePreTrainedModel),\n/* harmony export */ GPTJForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTJForCausalLM),\n/* harmony export */ GPTJModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTJModel),\n/* harmony export */ GPTJPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTJPreTrainedModel),\n/* harmony export */ GPTNeoForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTNeoForCausalLM),\n/* harmony export */ GPTNeoModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTNeoModel),\n/* harmony export */ GPTNeoPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTNeoPreTrainedModel),\n/* harmony export */ GPTNeoXForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTNeoXForCausalLM),\n/* harmony export */ GPTNeoXModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTNeoXModel),\n/* harmony export */ GPTNeoXPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTNeoXPreTrainedModel),\n/* harmony export */ GPTNeoXTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.GPTNeoXTokenizer),\n/* harmony export */ GemmaTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.GemmaTokenizer),\n/* harmony export */ HerbertTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.HerbertTokenizer),\n/* harmony export */ HubertForCTC: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.HubertForCTC),\n/* harmony export */ HubertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.HubertForSequenceClassification),\n/* harmony export */ HubertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.HubertModel),\n/* harmony export */ HubertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.HubertPreTrainedModel),\n/* harmony export */ ImageClassificationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ImageClassificationPipeline),\n/* harmony export */ ImageFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.ImageFeatureExtractor),\n/* harmony export */ ImageMattingOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ImageMattingOutput),\n/* harmony export */ ImageSegmentationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ImageSegmentationPipeline),\n/* harmony export */ ImageToImagePipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ImageToImagePipeline),\n/* harmony export */ ImageToTextPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ImageToTextPipeline),\n/* harmony export */ LlamaForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.LlamaForCausalLM),\n/* harmony export */ LlamaModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.LlamaModel),\n/* harmony export */ LlamaPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.LlamaPreTrainedModel),\n/* harmony export */ LlamaTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.LlamaTokenizer),\n/* harmony export */ LongT5ForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.LongT5ForConditionalGeneration),\n/* harmony export */ LongT5Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.LongT5Model),\n/* harmony export */ LongT5PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.LongT5PreTrainedModel),\n/* harmony export */ M2M100ForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.M2M100ForConditionalGeneration),\n/* harmony export */ M2M100Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.M2M100Model),\n/* harmony export */ M2M100PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.M2M100PreTrainedModel),\n/* harmony export */ M2M100Tokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.M2M100Tokenizer),\n/* harmony export */ MBart50Tokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.MBart50Tokenizer),\n/* harmony export */ MBartForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MBartForCausalLM),\n/* harmony export */ MBartForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MBartForConditionalGeneration),\n/* harmony export */ MBartForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MBartForSequenceClassification),\n/* harmony export */ MBartModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MBartModel),\n/* harmony export */ MBartPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MBartPreTrainedModel),\n/* harmony export */ MBartTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.MBartTokenizer),\n/* harmony export */ MPNetForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MPNetForMaskedLM),\n/* harmony export */ MPNetForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MPNetForQuestionAnswering),\n/* harmony export */ MPNetForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MPNetForSequenceClassification),\n/* harmony export */ MPNetForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MPNetForTokenClassification),\n/* harmony export */ MPNetModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MPNetModel),\n/* harmony export */ MPNetPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MPNetPreTrainedModel),\n/* harmony export */ MPNetTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.MPNetTokenizer),\n/* harmony export */ MT5ForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MT5ForConditionalGeneration),\n/* harmony export */ MT5Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MT5Model),\n/* harmony export */ MT5PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MT5PreTrainedModel),\n/* harmony export */ MarianMTModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MarianMTModel),\n/* harmony export */ MarianModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MarianModel),\n/* harmony export */ MarianPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MarianPreTrainedModel),\n/* harmony export */ MarianTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.MarianTokenizer),\n/* harmony export */ MaskedLMOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MaskedLMOutput),\n/* harmony export */ MistralForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MistralForCausalLM),\n/* harmony export */ MistralModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MistralModel),\n/* harmony export */ MistralPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MistralPreTrainedModel),\n/* harmony export */ MobileBertForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MobileBertForMaskedLM),\n/* harmony export */ MobileBertForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MobileBertForQuestionAnswering),\n/* harmony export */ MobileBertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MobileBertForSequenceClassification),\n/* harmony export */ MobileBertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MobileBertModel),\n/* harmony export */ MobileBertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MobileBertPreTrainedModel),\n/* harmony export */ MobileBertTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.MobileBertTokenizer),\n/* harmony export */ MobileViTFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.MobileViTFeatureExtractor),\n/* harmony export */ MobileViTForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MobileViTForImageClassification),\n/* harmony export */ MobileViTModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MobileViTModel),\n/* harmony export */ MobileViTPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MobileViTPreTrainedModel),\n/* harmony export */ ModelOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ModelOutput),\n/* harmony export */ MptForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MptForCausalLM),\n/* harmony export */ MptModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MptModel),\n/* harmony export */ MptPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MptPreTrainedModel),\n/* harmony export */ NllbTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.NllbTokenizer),\n/* harmony export */ NomicBertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.NomicBertModel),\n/* harmony export */ NomicBertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.NomicBertPreTrainedModel),\n/* harmony export */ NougatImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.NougatImageProcessor),\n/* harmony export */ NougatTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.NougatTokenizer),\n/* harmony export */ OPTForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.OPTForCausalLM),\n/* harmony export */ OPTModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.OPTModel),\n/* harmony export */ OPTPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.OPTPreTrainedModel),\n/* harmony export */ ObjectDetectionPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ObjectDetectionPipeline),\n/* harmony export */ OwlViTFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.OwlViTFeatureExtractor),\n/* harmony export */ OwlViTForObjectDetection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.OwlViTForObjectDetection),\n/* harmony export */ OwlViTModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.OwlViTModel),\n/* harmony export */ OwlViTPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.OwlViTPreTrainedModel),\n/* harmony export */ OwlViTProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.OwlViTProcessor),\n/* harmony export */ Owlv2ForObjectDetection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Owlv2ForObjectDetection),\n/* harmony export */ Owlv2ImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.Owlv2ImageProcessor),\n/* harmony export */ Owlv2Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Owlv2Model),\n/* harmony export */ Owlv2PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Owlv2PreTrainedModel),\n/* harmony export */ PhiForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.PhiForCausalLM),\n/* harmony export */ PhiModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.PhiModel),\n/* harmony export */ PhiPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.PhiPreTrainedModel),\n/* harmony export */ Pipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.Pipeline),\n/* harmony export */ PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.PreTrainedModel),\n/* harmony export */ PreTrainedTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.PreTrainedTokenizer),\n/* harmony export */ PretrainedConfig: () => (/* reexport safe */ _configs_js__WEBPACK_IMPORTED_MODULE_5__.PretrainedConfig),\n/* harmony export */ PretrainedMixin: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.PretrainedMixin),\n/* harmony export */ Processor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.Processor),\n/* harmony export */ QuestionAnsweringModelOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.QuestionAnsweringModelOutput),\n/* harmony export */ QuestionAnsweringPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.QuestionAnsweringPipeline),\n/* harmony export */ Qwen2ForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Qwen2ForCausalLM),\n/* harmony export */ Qwen2Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Qwen2Model),\n/* harmony export */ Qwen2PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Qwen2PreTrainedModel),\n/* harmony export */ Qwen2Tokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.Qwen2Tokenizer),\n/* harmony export */ RawImage: () => (/* reexport safe */ _utils_image_js__WEBPACK_IMPORTED_MODULE_7__.RawImage),\n/* harmony export */ ResNetForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ResNetForImageClassification),\n/* harmony export */ ResNetModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ResNetModel),\n/* harmony export */ ResNetPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ResNetPreTrainedModel),\n/* harmony export */ RoFormerForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RoFormerForMaskedLM),\n/* harmony export */ RoFormerForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RoFormerForQuestionAnswering),\n/* harmony export */ RoFormerForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RoFormerForSequenceClassification),\n/* harmony export */ RoFormerForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RoFormerForTokenClassification),\n/* harmony export */ RoFormerModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RoFormerModel),\n/* harmony export */ RoFormerPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RoFormerPreTrainedModel),\n/* harmony export */ RoFormerTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.RoFormerTokenizer),\n/* harmony export */ RobertaForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RobertaForMaskedLM),\n/* harmony export */ RobertaForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RobertaForQuestionAnswering),\n/* harmony export */ RobertaForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RobertaForSequenceClassification),\n/* harmony export */ RobertaForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RobertaForTokenClassification),\n/* harmony export */ RobertaModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RobertaModel),\n/* harmony export */ RobertaPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RobertaPreTrainedModel),\n/* harmony export */ RobertaTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.RobertaTokenizer),\n/* harmony export */ SamImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.SamImageProcessor),\n/* harmony export */ SamImageSegmentationOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SamImageSegmentationOutput),\n/* harmony export */ SamModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SamModel),\n/* harmony export */ SamPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SamPreTrainedModel),\n/* harmony export */ SamProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.SamProcessor),\n/* harmony export */ SeamlessM4TFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.SeamlessM4TFeatureExtractor),\n/* harmony export */ SegformerFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.SegformerFeatureExtractor),\n/* harmony export */ SegformerForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SegformerForImageClassification),\n/* harmony export */ SegformerForSemanticSegmentation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SegformerForSemanticSegmentation),\n/* harmony export */ SegformerModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SegformerModel),\n/* harmony export */ SegformerPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SegformerPreTrainedModel),\n/* harmony export */ Seq2SeqLMOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Seq2SeqLMOutput),\n/* harmony export */ SequenceClassifierOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SequenceClassifierOutput),\n/* harmony export */ SiglipImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.SiglipImageProcessor),\n/* harmony export */ SiglipModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SiglipModel),\n/* harmony export */ SiglipPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SiglipPreTrainedModel),\n/* harmony export */ SiglipTextModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SiglipTextModel),\n/* harmony export */ SiglipTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.SiglipTokenizer),\n/* harmony export */ SiglipVisionModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SiglipVisionModel),\n/* harmony export */ SpeechT5FeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.SpeechT5FeatureExtractor),\n/* harmony export */ SpeechT5ForSpeechToText: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SpeechT5ForSpeechToText),\n/* harmony export */ SpeechT5ForTextToSpeech: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SpeechT5ForTextToSpeech),\n/* harmony export */ SpeechT5HifiGan: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SpeechT5HifiGan),\n/* harmony export */ SpeechT5Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SpeechT5Model),\n/* harmony export */ SpeechT5PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SpeechT5PreTrainedModel),\n/* harmony export */ SpeechT5Processor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.SpeechT5Processor),\n/* harmony export */ SpeechT5Tokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.SpeechT5Tokenizer),\n/* harmony export */ SqueezeBertForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SqueezeBertForMaskedLM),\n/* harmony export */ SqueezeBertForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SqueezeBertForQuestionAnswering),\n/* harmony export */ SqueezeBertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SqueezeBertForSequenceClassification),\n/* harmony export */ SqueezeBertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SqueezeBertModel),\n/* harmony export */ SqueezeBertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SqueezeBertPreTrainedModel),\n/* harmony export */ SqueezeBertTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.SqueezeBertTokenizer),\n/* harmony export */ SummarizationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.SummarizationPipeline),\n/* harmony export */ Swin2SRForImageSuperResolution: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Swin2SRForImageSuperResolution),\n/* harmony export */ Swin2SRImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.Swin2SRImageProcessor),\n/* harmony export */ Swin2SRModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Swin2SRModel),\n/* harmony export */ Swin2SRPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Swin2SRPreTrainedModel),\n/* harmony export */ SwinForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SwinForImageClassification),\n/* harmony export */ SwinModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SwinModel),\n/* harmony export */ SwinPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SwinPreTrainedModel),\n/* harmony export */ T5ForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.T5ForConditionalGeneration),\n/* harmony export */ T5Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.T5Model),\n/* harmony export */ T5PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.T5PreTrainedModel),\n/* harmony export */ T5Tokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.T5Tokenizer),\n/* harmony export */ TableTransformerForObjectDetection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.TableTransformerForObjectDetection),\n/* harmony export */ TableTransformerModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.TableTransformerModel),\n/* harmony export */ TableTransformerObjectDetectionOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.TableTransformerObjectDetectionOutput),\n/* harmony export */ TableTransformerPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.TableTransformerPreTrainedModel),\n/* harmony export */ Tensor: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.Tensor),\n/* harmony export */ Text2TextGenerationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.Text2TextGenerationPipeline),\n/* harmony export */ TextClassificationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.TextClassificationPipeline),\n/* harmony export */ TextGenerationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.TextGenerationPipeline),\n/* harmony export */ TextToAudioPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.TextToAudioPipeline),\n/* harmony export */ TokenClassificationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.TokenClassificationPipeline),\n/* harmony export */ TokenClassifierOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.TokenClassifierOutput),\n/* harmony export */ TokenizerModel: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.TokenizerModel),\n/* harmony export */ TrOCRForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.TrOCRForCausalLM),\n/* harmony export */ TrOCRPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.TrOCRPreTrainedModel),\n/* harmony export */ TranslationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.TranslationPipeline),\n/* harmony export */ ViTFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.ViTFeatureExtractor),\n/* harmony export */ ViTForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ViTForImageClassification),\n/* harmony export */ ViTImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.ViTImageProcessor),\n/* harmony export */ ViTModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ViTModel),\n/* harmony export */ ViTPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ViTPreTrainedModel),\n/* harmony export */ VisionEncoderDecoderModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.VisionEncoderDecoderModel),\n/* harmony export */ VitMatteForImageMatting: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.VitMatteForImageMatting),\n/* harmony export */ VitMatteImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.VitMatteImageProcessor),\n/* harmony export */ VitMattePreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.VitMattePreTrainedModel),\n/* harmony export */ VitsModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.VitsModel),\n/* harmony export */ VitsModelOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.VitsModelOutput),\n/* harmony export */ VitsPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.VitsPreTrainedModel),\n/* harmony export */ VitsTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.VitsTokenizer),\n/* harmony export */ Wav2Vec2BertForCTC: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Wav2Vec2BertForCTC),\n/* harmony export */ Wav2Vec2BertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Wav2Vec2BertForSequenceClassification),\n/* harmony export */ Wav2Vec2BertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Wav2Vec2BertModel),\n/* harmony export */ Wav2Vec2BertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Wav2Vec2BertPreTrainedModel),\n/* harmony export */ Wav2Vec2CTCTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.Wav2Vec2CTCTokenizer),\n/* harmony export */ Wav2Vec2FeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.Wav2Vec2FeatureExtractor),\n/* harmony export */ Wav2Vec2ForCTC: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Wav2Vec2ForCTC),\n/* harmony export */ Wav2Vec2ForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Wav2Vec2ForSequenceClassification),\n/* harmony export */ Wav2Vec2Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Wav2Vec2Model),\n/* harmony export */ Wav2Vec2PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Wav2Vec2PreTrainedModel),\n/* harmony export */ Wav2Vec2ProcessorWithLM: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.Wav2Vec2ProcessorWithLM),\n/* harmony export */ WavLMForCTC: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.WavLMForCTC),\n/* harmony export */ WavLMForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.WavLMForSequenceClassification),\n/* harmony export */ WavLMModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.WavLMModel),\n/* harmony export */ WavLMPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.WavLMPreTrainedModel),\n/* harmony export */ WhisperFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.WhisperFeatureExtractor),\n/* harmony export */ WhisperForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.WhisperForConditionalGeneration),\n/* harmony export */ WhisperModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.WhisperModel),\n/* harmony export */ WhisperPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.WhisperPreTrainedModel),\n/* harmony export */ WhisperProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.WhisperProcessor),\n/* harmony export */ WhisperTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.WhisperTokenizer),\n/* harmony export */ XLMForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMForQuestionAnswering),\n/* harmony export */ XLMForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMForSequenceClassification),\n/* harmony export */ XLMForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMForTokenClassification),\n/* harmony export */ XLMModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMModel),\n/* harmony export */ XLMPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMPreTrainedModel),\n/* harmony export */ XLMRobertaForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMRobertaForMaskedLM),\n/* harmony export */ XLMRobertaForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMRobertaForQuestionAnswering),\n/* harmony export */ XLMRobertaForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMRobertaForSequenceClassification),\n/* harmony export */ XLMRobertaForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMRobertaForTokenClassification),\n/* harmony export */ XLMRobertaModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMRobertaModel),\n/* harmony export */ XLMRobertaPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMRobertaPreTrainedModel),\n/* harmony export */ XLMRobertaTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.XLMRobertaTokenizer),\n/* harmony export */ XLMTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.XLMTokenizer),\n/* harmony export */ XLMWithLMHeadModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMWithLMHeadModel),\n/* harmony export */ YolosFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.YolosFeatureExtractor),\n/* harmony export */ YolosForObjectDetection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.YolosForObjectDetection),\n/* harmony export */ YolosModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.YolosModel),\n/* harmony export */ YolosObjectDetectionOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.YolosObjectDetectionOutput),\n/* harmony export */ YolosPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.YolosPreTrainedModel),\n/* harmony export */ ZeroShotAudioClassificationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ZeroShotAudioClassificationPipeline),\n/* harmony export */ ZeroShotClassificationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ZeroShotClassificationPipeline),\n/* harmony export */ ZeroShotImageClassificationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ZeroShotImageClassificationPipeline),\n/* harmony export */ ZeroShotObjectDetectionPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ZeroShotObjectDetectionPipeline),\n/* harmony export */ cat: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.cat),\n/* harmony export */ cos_sim: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.cos_sim),\n/* harmony export */ dot: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.dot),\n/* harmony export */ dynamicTimeWarping: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.dynamicTimeWarping),\n/* harmony export */ env: () => (/* reexport safe */ _env_js__WEBPACK_IMPORTED_MODULE_1__.env),\n/* harmony export */ getTopItems: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.getTopItems),\n/* harmony export */ hanning: () => (/* reexport safe */ _utils_audio_js__WEBPACK_IMPORTED_MODULE_6__.hanning),\n/* harmony export */ interpolate: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.interpolate),\n/* harmony export */ interpolate_data: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.interpolate_data),\n/* harmony export */ layer_norm: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.layer_norm),\n/* harmony export */ log_softmax: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.log_softmax),\n/* harmony export */ magnitude: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.magnitude),\n/* harmony export */ max: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.max),\n/* harmony export */ mean: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.mean),\n/* harmony export */ mean_pooling: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.mean_pooling),\n/* harmony export */ medianFilter: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.medianFilter),\n/* harmony export */ mel_filter_bank: () => (/* reexport safe */ _utils_audio_js__WEBPACK_IMPORTED_MODULE_6__.mel_filter_bank),\n/* harmony export */ min: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.min),\n/* harmony export */ ones: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.ones),\n/* harmony export */ ones_like: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.ones_like),\n/* harmony export */ pipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.pipeline),\n/* harmony export */ read_audio: () => (/* reexport safe */ _utils_audio_js__WEBPACK_IMPORTED_MODULE_6__.read_audio),\n/* harmony export */ round: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.round),\n/* harmony export */ softmax: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.softmax),\n/* harmony export */ spectrogram: () => (/* reexport safe */ _utils_audio_js__WEBPACK_IMPORTED_MODULE_6__.spectrogram),\n/* harmony export */ stack: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.stack),\n/* harmony export */ std_mean: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.std_mean),\n/* harmony export */ transpose: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.transpose),\n/* harmony export */ transpose_data: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.transpose_data),\n/* harmony export */ window_function: () => (/* reexport safe */ _utils_audio_js__WEBPACK_IMPORTED_MODULE_6__.window_function)\n/* harmony export */ });\n/* harmony import */ var _pipelines_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pipelines.js */ \"./node_modules/@xenova/transformers/src/pipelines.js\");\n/* harmony import */ var _env_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./env.js */ \"./node_modules/@xenova/transformers/src/env.js\");\n/* harmony import */ var _models_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./models.js */ \"./node_modules/@xenova/transformers/src/models.js\");\n/* harmony import */ var _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tokenizers.js */ \"./node_modules/@xenova/transformers/src/tokenizers.js\");\n/* harmony import */ var _processors_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./processors.js */ \"./node_modules/@xenova/transformers/src/processors.js\");\n/* harmony import */ var _configs_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./configs.js */ \"./node_modules/@xenova/transformers/src/configs.js\");\n/* harmony import */ var _utils_audio_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/audio.js */ \"./node_modules/@xenova/transformers/src/utils/audio.js\");\n/* harmony import */ var _utils_image_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/image.js */ \"./node_modules/@xenova/transformers/src/utils/image.js\");\n/* harmony import */ var _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/tensor.js */ \"./node_modules/@xenova/transformers/src/utils/tensor.js\");\n/* harmony import */ var _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/maths.js */ \"./node_modules/@xenova/transformers/src/utils/maths.js\");\n/**\n * @file Entry point for the Transformers.js library. Only the exports from this file\n * are available to the end user, and are grouped as follows:\n * \n * 1. [Pipelines](./pipelines)\n * 2. [Environment variables](./env)\n * 3. [Models](./models)\n * 4. [Tokenizers](./tokenizers)\n * 5. [Processors](./processors)\n * \n * @module transformers\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/transformers.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ASTFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.ASTFeatureExtractor),\n/* harmony export */ ASTForAudioClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ASTForAudioClassification),\n/* harmony export */ ASTModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ASTModel),\n/* harmony export */ ASTPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ASTPreTrainedModel),\n/* harmony export */ AlbertForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AlbertForMaskedLM),\n/* harmony export */ AlbertForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AlbertForQuestionAnswering),\n/* harmony export */ AlbertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AlbertForSequenceClassification),\n/* harmony export */ AlbertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AlbertModel),\n/* harmony export */ AlbertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AlbertPreTrainedModel),\n/* harmony export */ AlbertTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.AlbertTokenizer),\n/* harmony export */ AudioClassificationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.AudioClassificationPipeline),\n/* harmony export */ AutoConfig: () => (/* reexport safe */ _configs_js__WEBPACK_IMPORTED_MODULE_5__.AutoConfig),\n/* harmony export */ AutoModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModel),\n/* harmony export */ AutoModelForAudioClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForAudioClassification),\n/* harmony export */ AutoModelForAudioFrameClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForAudioFrameClassification),\n/* harmony export */ AutoModelForCTC: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForCTC),\n/* harmony export */ AutoModelForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForCausalLM),\n/* harmony export */ AutoModelForDepthEstimation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForDepthEstimation),\n/* harmony export */ AutoModelForDocumentQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForDocumentQuestionAnswering),\n/* harmony export */ AutoModelForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForImageClassification),\n/* harmony export */ AutoModelForImageFeatureExtraction: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForImageFeatureExtraction),\n/* harmony export */ AutoModelForImageMatting: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForImageMatting),\n/* harmony export */ AutoModelForImageSegmentation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForImageSegmentation),\n/* harmony export */ AutoModelForImageToImage: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForImageToImage),\n/* harmony export */ AutoModelForMaskGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForMaskGeneration),\n/* harmony export */ AutoModelForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForMaskedLM),\n/* harmony export */ AutoModelForObjectDetection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForObjectDetection),\n/* harmony export */ AutoModelForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForQuestionAnswering),\n/* harmony export */ AutoModelForSemanticSegmentation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForSemanticSegmentation),\n/* harmony export */ AutoModelForSeq2SeqLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForSeq2SeqLM),\n/* harmony export */ AutoModelForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForSequenceClassification),\n/* harmony export */ AutoModelForSpeechSeq2Seq: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForSpeechSeq2Seq),\n/* harmony export */ AutoModelForTextToSpectrogram: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForTextToSpectrogram),\n/* harmony export */ AutoModelForTextToWaveform: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForTextToWaveform),\n/* harmony export */ AutoModelForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForTokenClassification),\n/* harmony export */ AutoModelForVision2Seq: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForVision2Seq),\n/* harmony export */ AutoModelForXVector: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForXVector),\n/* harmony export */ AutoModelForZeroShotObjectDetection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.AutoModelForZeroShotObjectDetection),\n/* harmony export */ AutoProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.AutoProcessor),\n/* harmony export */ AutoTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.AutoTokenizer),\n/* harmony export */ AutomaticSpeechRecognitionPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.AutomaticSpeechRecognitionPipeline),\n/* harmony export */ BartForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BartForConditionalGeneration),\n/* harmony export */ BartForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BartForSequenceClassification),\n/* harmony export */ BartModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BartModel),\n/* harmony export */ BartPretrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BartPretrainedModel),\n/* harmony export */ BartTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.BartTokenizer),\n/* harmony export */ BaseModelOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BaseModelOutput),\n/* harmony export */ BeitFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.BeitFeatureExtractor),\n/* harmony export */ BeitForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BeitForImageClassification),\n/* harmony export */ BeitModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BeitModel),\n/* harmony export */ BeitPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BeitPreTrainedModel),\n/* harmony export */ BertForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BertForMaskedLM),\n/* harmony export */ BertForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BertForQuestionAnswering),\n/* harmony export */ BertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BertForSequenceClassification),\n/* harmony export */ BertForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BertForTokenClassification),\n/* harmony export */ BertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BertModel),\n/* harmony export */ BertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BertPreTrainedModel),\n/* harmony export */ BertTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.BertTokenizer),\n/* harmony export */ BitImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.BitImageProcessor),\n/* harmony export */ BlenderbotForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BlenderbotForConditionalGeneration),\n/* harmony export */ BlenderbotModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BlenderbotModel),\n/* harmony export */ BlenderbotPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BlenderbotPreTrainedModel),\n/* harmony export */ BlenderbotSmallForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BlenderbotSmallForConditionalGeneration),\n/* harmony export */ BlenderbotSmallModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BlenderbotSmallModel),\n/* harmony export */ BlenderbotSmallPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BlenderbotSmallPreTrainedModel),\n/* harmony export */ BlenderbotSmallTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.BlenderbotSmallTokenizer),\n/* harmony export */ BlenderbotTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.BlenderbotTokenizer),\n/* harmony export */ BloomForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BloomForCausalLM),\n/* harmony export */ BloomModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BloomModel),\n/* harmony export */ BloomPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.BloomPreTrainedModel),\n/* harmony export */ BloomTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.BloomTokenizer),\n/* harmony export */ CLIPFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.CLIPFeatureExtractor),\n/* harmony export */ CLIPModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CLIPModel),\n/* harmony export */ CLIPPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CLIPPreTrainedModel),\n/* harmony export */ CLIPSegForImageSegmentation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CLIPSegForImageSegmentation),\n/* harmony export */ CLIPSegModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CLIPSegModel),\n/* harmony export */ CLIPSegPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CLIPSegPreTrainedModel),\n/* harmony export */ CLIPTextModelWithProjection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CLIPTextModelWithProjection),\n/* harmony export */ CLIPTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.CLIPTokenizer),\n/* harmony export */ CLIPVisionModelWithProjection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CLIPVisionModelWithProjection),\n/* harmony export */ CamembertForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CamembertForMaskedLM),\n/* harmony export */ CamembertForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CamembertForQuestionAnswering),\n/* harmony export */ CamembertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CamembertForSequenceClassification),\n/* harmony export */ CamembertForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CamembertForTokenClassification),\n/* harmony export */ CamembertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CamembertModel),\n/* harmony export */ CamembertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CamembertPreTrainedModel),\n/* harmony export */ CamembertTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.CamembertTokenizer),\n/* harmony export */ CausalLMOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CausalLMOutput),\n/* harmony export */ CausalLMOutputWithPast: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CausalLMOutputWithPast),\n/* harmony export */ ChineseCLIPFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.ChineseCLIPFeatureExtractor),\n/* harmony export */ ChineseCLIPModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ChineseCLIPModel),\n/* harmony export */ ChineseCLIPPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ChineseCLIPPreTrainedModel),\n/* harmony export */ ClapAudioModelWithProjection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ClapAudioModelWithProjection),\n/* harmony export */ ClapFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.ClapFeatureExtractor),\n/* harmony export */ ClapModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ClapModel),\n/* harmony export */ ClapPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ClapPreTrainedModel),\n/* harmony export */ ClapTextModelWithProjection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ClapTextModelWithProjection),\n/* harmony export */ CodeGenForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CodeGenForCausalLM),\n/* harmony export */ CodeGenModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CodeGenModel),\n/* harmony export */ CodeGenPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.CodeGenPreTrainedModel),\n/* harmony export */ CodeGenTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.CodeGenTokenizer),\n/* harmony export */ CodeLlamaTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.CodeLlamaTokenizer),\n/* harmony export */ CohereTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.CohereTokenizer),\n/* harmony export */ ConvBertForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvBertForMaskedLM),\n/* harmony export */ ConvBertForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvBertForQuestionAnswering),\n/* harmony export */ ConvBertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvBertForSequenceClassification),\n/* harmony export */ ConvBertForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvBertForTokenClassification),\n/* harmony export */ ConvBertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvBertModel),\n/* harmony export */ ConvBertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvBertPreTrainedModel),\n/* harmony export */ ConvBertTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.ConvBertTokenizer),\n/* harmony export */ ConvNextFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.ConvNextFeatureExtractor),\n/* harmony export */ ConvNextForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvNextForImageClassification),\n/* harmony export */ ConvNextImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.ConvNextImageProcessor),\n/* harmony export */ ConvNextModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvNextModel),\n/* harmony export */ ConvNextPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvNextPreTrainedModel),\n/* harmony export */ ConvNextV2ForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvNextV2ForImageClassification),\n/* harmony export */ ConvNextV2Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvNextV2Model),\n/* harmony export */ ConvNextV2PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ConvNextV2PreTrainedModel),\n/* harmony export */ DPTFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.DPTFeatureExtractor),\n/* harmony export */ DPTForDepthEstimation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DPTForDepthEstimation),\n/* harmony export */ DPTImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.DPTImageProcessor),\n/* harmony export */ DPTModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DPTModel),\n/* harmony export */ DPTPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DPTPreTrainedModel),\n/* harmony export */ DebertaForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaForMaskedLM),\n/* harmony export */ DebertaForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaForQuestionAnswering),\n/* harmony export */ DebertaForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaForSequenceClassification),\n/* harmony export */ DebertaForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaForTokenClassification),\n/* harmony export */ DebertaModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaModel),\n/* harmony export */ DebertaPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaPreTrainedModel),\n/* harmony export */ DebertaTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.DebertaTokenizer),\n/* harmony export */ DebertaV2ForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaV2ForMaskedLM),\n/* harmony export */ DebertaV2ForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaV2ForQuestionAnswering),\n/* harmony export */ DebertaV2ForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaV2ForSequenceClassification),\n/* harmony export */ DebertaV2ForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaV2ForTokenClassification),\n/* harmony export */ DebertaV2Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaV2Model),\n/* harmony export */ DebertaV2PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DebertaV2PreTrainedModel),\n/* harmony export */ DebertaV2Tokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.DebertaV2Tokenizer),\n/* harmony export */ DeiTFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.DeiTFeatureExtractor),\n/* harmony export */ DeiTForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DeiTForImageClassification),\n/* harmony export */ DeiTModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DeiTModel),\n/* harmony export */ DeiTPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DeiTPreTrainedModel),\n/* harmony export */ DepthAnythingForDepthEstimation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DepthAnythingForDepthEstimation),\n/* harmony export */ DepthAnythingPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DepthAnythingPreTrainedModel),\n/* harmony export */ DepthEstimationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.DepthEstimationPipeline),\n/* harmony export */ DetrFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.DetrFeatureExtractor),\n/* harmony export */ DetrForObjectDetection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DetrForObjectDetection),\n/* harmony export */ DetrForSegmentation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DetrForSegmentation),\n/* harmony export */ DetrModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DetrModel),\n/* harmony export */ DetrObjectDetectionOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DetrObjectDetectionOutput),\n/* harmony export */ DetrPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DetrPreTrainedModel),\n/* harmony export */ DetrSegmentationOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DetrSegmentationOutput),\n/* harmony export */ Dinov2ForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Dinov2ForImageClassification),\n/* harmony export */ Dinov2Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Dinov2Model),\n/* harmony export */ Dinov2PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Dinov2PreTrainedModel),\n/* harmony export */ DistilBertForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DistilBertForMaskedLM),\n/* harmony export */ DistilBertForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DistilBertForQuestionAnswering),\n/* harmony export */ DistilBertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DistilBertForSequenceClassification),\n/* harmony export */ DistilBertForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DistilBertForTokenClassification),\n/* harmony export */ DistilBertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DistilBertModel),\n/* harmony export */ DistilBertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DistilBertPreTrainedModel),\n/* harmony export */ DistilBertTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.DistilBertTokenizer),\n/* harmony export */ DocumentQuestionAnsweringPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.DocumentQuestionAnsweringPipeline),\n/* harmony export */ DonutFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.DonutFeatureExtractor),\n/* harmony export */ DonutSwinModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DonutSwinModel),\n/* harmony export */ DonutSwinPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.DonutSwinPreTrainedModel),\n/* harmony export */ EfficientNetForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.EfficientNetForImageClassification),\n/* harmony export */ EfficientNetImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.EfficientNetImageProcessor),\n/* harmony export */ EfficientNetModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.EfficientNetModel),\n/* harmony export */ EfficientNetPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.EfficientNetPreTrainedModel),\n/* harmony export */ ElectraForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ElectraForMaskedLM),\n/* harmony export */ ElectraForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ElectraForQuestionAnswering),\n/* harmony export */ ElectraForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ElectraForSequenceClassification),\n/* harmony export */ ElectraForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ElectraForTokenClassification),\n/* harmony export */ ElectraModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ElectraModel),\n/* harmony export */ ElectraPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ElectraPreTrainedModel),\n/* harmony export */ ElectraTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.ElectraTokenizer),\n/* harmony export */ EsmForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.EsmForMaskedLM),\n/* harmony export */ EsmForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.EsmForSequenceClassification),\n/* harmony export */ EsmForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.EsmForTokenClassification),\n/* harmony export */ EsmModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.EsmModel),\n/* harmony export */ EsmPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.EsmPreTrainedModel),\n/* harmony export */ EsmTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.EsmTokenizer),\n/* harmony export */ FFT: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.FFT),\n/* harmony export */ FalconForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.FalconForCausalLM),\n/* harmony export */ FalconModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.FalconModel),\n/* harmony export */ FalconPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.FalconPreTrainedModel),\n/* harmony export */ FalconTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.FalconTokenizer),\n/* harmony export */ FeatureExtractionPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.FeatureExtractionPipeline),\n/* harmony export */ FeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.FeatureExtractor),\n/* harmony export */ FillMaskPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.FillMaskPipeline),\n/* harmony export */ GLPNFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.GLPNFeatureExtractor),\n/* harmony export */ GLPNForDepthEstimation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GLPNForDepthEstimation),\n/* harmony export */ GLPNModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GLPNModel),\n/* harmony export */ GLPNPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GLPNPreTrainedModel),\n/* harmony export */ GPT2LMHeadModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPT2LMHeadModel),\n/* harmony export */ GPT2Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPT2Model),\n/* harmony export */ GPT2PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPT2PreTrainedModel),\n/* harmony export */ GPT2Tokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.GPT2Tokenizer),\n/* harmony export */ GPTBigCodeForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTBigCodeForCausalLM),\n/* harmony export */ GPTBigCodeModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTBigCodeModel),\n/* harmony export */ GPTBigCodePreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTBigCodePreTrainedModel),\n/* harmony export */ GPTJForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTJForCausalLM),\n/* harmony export */ GPTJModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTJModel),\n/* harmony export */ GPTJPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTJPreTrainedModel),\n/* harmony export */ GPTNeoForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTNeoForCausalLM),\n/* harmony export */ GPTNeoModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTNeoModel),\n/* harmony export */ GPTNeoPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTNeoPreTrainedModel),\n/* harmony export */ GPTNeoXForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTNeoXForCausalLM),\n/* harmony export */ GPTNeoXModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTNeoXModel),\n/* harmony export */ GPTNeoXPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.GPTNeoXPreTrainedModel),\n/* harmony export */ GPTNeoXTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.GPTNeoXTokenizer),\n/* harmony export */ GemmaTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.GemmaTokenizer),\n/* harmony export */ Grok1Tokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.Grok1Tokenizer),\n/* harmony export */ HerbertTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.HerbertTokenizer),\n/* harmony export */ HubertForCTC: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.HubertForCTC),\n/* harmony export */ HubertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.HubertForSequenceClassification),\n/* harmony export */ HubertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.HubertModel),\n/* harmony export */ HubertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.HubertPreTrainedModel),\n/* harmony export */ ImageClassificationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ImageClassificationPipeline),\n/* harmony export */ ImageFeatureExtractionPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ImageFeatureExtractionPipeline),\n/* harmony export */ ImageFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.ImageFeatureExtractor),\n/* harmony export */ ImageMattingOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ImageMattingOutput),\n/* harmony export */ ImageSegmentationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ImageSegmentationPipeline),\n/* harmony export */ ImageToImagePipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ImageToImagePipeline),\n/* harmony export */ ImageToTextPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ImageToTextPipeline),\n/* harmony export */ LlamaForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.LlamaForCausalLM),\n/* harmony export */ LlamaModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.LlamaModel),\n/* harmony export */ LlamaPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.LlamaPreTrainedModel),\n/* harmony export */ LlamaTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.LlamaTokenizer),\n/* harmony export */ LongT5ForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.LongT5ForConditionalGeneration),\n/* harmony export */ LongT5Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.LongT5Model),\n/* harmony export */ LongT5PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.LongT5PreTrainedModel),\n/* harmony export */ M2M100ForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.M2M100ForConditionalGeneration),\n/* harmony export */ M2M100Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.M2M100Model),\n/* harmony export */ M2M100PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.M2M100PreTrainedModel),\n/* harmony export */ M2M100Tokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.M2M100Tokenizer),\n/* harmony export */ MBart50Tokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.MBart50Tokenizer),\n/* harmony export */ MBartForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MBartForCausalLM),\n/* harmony export */ MBartForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MBartForConditionalGeneration),\n/* harmony export */ MBartForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MBartForSequenceClassification),\n/* harmony export */ MBartModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MBartModel),\n/* harmony export */ MBartPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MBartPreTrainedModel),\n/* harmony export */ MBartTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.MBartTokenizer),\n/* harmony export */ MPNetForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MPNetForMaskedLM),\n/* harmony export */ MPNetForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MPNetForQuestionAnswering),\n/* harmony export */ MPNetForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MPNetForSequenceClassification),\n/* harmony export */ MPNetForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MPNetForTokenClassification),\n/* harmony export */ MPNetModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MPNetModel),\n/* harmony export */ MPNetPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MPNetPreTrainedModel),\n/* harmony export */ MPNetTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.MPNetTokenizer),\n/* harmony export */ MT5ForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MT5ForConditionalGeneration),\n/* harmony export */ MT5Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MT5Model),\n/* harmony export */ MT5PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MT5PreTrainedModel),\n/* harmony export */ MarianMTModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MarianMTModel),\n/* harmony export */ MarianModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MarianModel),\n/* harmony export */ MarianPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MarianPreTrainedModel),\n/* harmony export */ MarianTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.MarianTokenizer),\n/* harmony export */ MaskedLMOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MaskedLMOutput),\n/* harmony export */ MistralForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MistralForCausalLM),\n/* harmony export */ MistralModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MistralModel),\n/* harmony export */ MistralPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MistralPreTrainedModel),\n/* harmony export */ MobileBertForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MobileBertForMaskedLM),\n/* harmony export */ MobileBertForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MobileBertForQuestionAnswering),\n/* harmony export */ MobileBertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MobileBertForSequenceClassification),\n/* harmony export */ MobileBertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MobileBertModel),\n/* harmony export */ MobileBertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MobileBertPreTrainedModel),\n/* harmony export */ MobileBertTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.MobileBertTokenizer),\n/* harmony export */ MobileViTFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.MobileViTFeatureExtractor),\n/* harmony export */ MobileViTForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MobileViTForImageClassification),\n/* harmony export */ MobileViTModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MobileViTModel),\n/* harmony export */ MobileViTPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MobileViTPreTrainedModel),\n/* harmony export */ ModelOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ModelOutput),\n/* harmony export */ MptForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MptForCausalLM),\n/* harmony export */ MptModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MptModel),\n/* harmony export */ MptPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.MptPreTrainedModel),\n/* harmony export */ NllbTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.NllbTokenizer),\n/* harmony export */ NomicBertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.NomicBertModel),\n/* harmony export */ NomicBertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.NomicBertPreTrainedModel),\n/* harmony export */ NougatImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.NougatImageProcessor),\n/* harmony export */ NougatTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.NougatTokenizer),\n/* harmony export */ OPTForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.OPTForCausalLM),\n/* harmony export */ OPTModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.OPTModel),\n/* harmony export */ OPTPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.OPTPreTrainedModel),\n/* harmony export */ ObjectDetectionPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ObjectDetectionPipeline),\n/* harmony export */ OwlViTFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.OwlViTFeatureExtractor),\n/* harmony export */ OwlViTForObjectDetection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.OwlViTForObjectDetection),\n/* harmony export */ OwlViTModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.OwlViTModel),\n/* harmony export */ OwlViTPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.OwlViTPreTrainedModel),\n/* harmony export */ OwlViTProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.OwlViTProcessor),\n/* harmony export */ Owlv2ForObjectDetection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Owlv2ForObjectDetection),\n/* harmony export */ Owlv2ImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.Owlv2ImageProcessor),\n/* harmony export */ Owlv2Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Owlv2Model),\n/* harmony export */ Owlv2PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Owlv2PreTrainedModel),\n/* harmony export */ PhiForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.PhiForCausalLM),\n/* harmony export */ PhiModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.PhiModel),\n/* harmony export */ PhiPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.PhiPreTrainedModel),\n/* harmony export */ Pipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.Pipeline),\n/* harmony export */ PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.PreTrainedModel),\n/* harmony export */ PreTrainedTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.PreTrainedTokenizer),\n/* harmony export */ PretrainedConfig: () => (/* reexport safe */ _configs_js__WEBPACK_IMPORTED_MODULE_5__.PretrainedConfig),\n/* harmony export */ PretrainedMixin: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.PretrainedMixin),\n/* harmony export */ Processor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.Processor),\n/* harmony export */ QuestionAnsweringModelOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.QuestionAnsweringModelOutput),\n/* harmony export */ QuestionAnsweringPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.QuestionAnsweringPipeline),\n/* harmony export */ Qwen2ForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Qwen2ForCausalLM),\n/* harmony export */ Qwen2Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Qwen2Model),\n/* harmony export */ Qwen2PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Qwen2PreTrainedModel),\n/* harmony export */ Qwen2Tokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.Qwen2Tokenizer),\n/* harmony export */ RawImage: () => (/* reexport safe */ _utils_image_js__WEBPACK_IMPORTED_MODULE_7__.RawImage),\n/* harmony export */ ResNetForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ResNetForImageClassification),\n/* harmony export */ ResNetModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ResNetModel),\n/* harmony export */ ResNetPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ResNetPreTrainedModel),\n/* harmony export */ RoFormerForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RoFormerForMaskedLM),\n/* harmony export */ RoFormerForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RoFormerForQuestionAnswering),\n/* harmony export */ RoFormerForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RoFormerForSequenceClassification),\n/* harmony export */ RoFormerForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RoFormerForTokenClassification),\n/* harmony export */ RoFormerModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RoFormerModel),\n/* harmony export */ RoFormerPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RoFormerPreTrainedModel),\n/* harmony export */ RoFormerTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.RoFormerTokenizer),\n/* harmony export */ RobertaForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RobertaForMaskedLM),\n/* harmony export */ RobertaForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RobertaForQuestionAnswering),\n/* harmony export */ RobertaForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RobertaForSequenceClassification),\n/* harmony export */ RobertaForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RobertaForTokenClassification),\n/* harmony export */ RobertaModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RobertaModel),\n/* harmony export */ RobertaPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.RobertaPreTrainedModel),\n/* harmony export */ RobertaTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.RobertaTokenizer),\n/* harmony export */ SamImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.SamImageProcessor),\n/* harmony export */ SamImageSegmentationOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SamImageSegmentationOutput),\n/* harmony export */ SamModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SamModel),\n/* harmony export */ SamPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SamPreTrainedModel),\n/* harmony export */ SamProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.SamProcessor),\n/* harmony export */ SeamlessM4TFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.SeamlessM4TFeatureExtractor),\n/* harmony export */ SegformerFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.SegformerFeatureExtractor),\n/* harmony export */ SegformerForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SegformerForImageClassification),\n/* harmony export */ SegformerForSemanticSegmentation: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SegformerForSemanticSegmentation),\n/* harmony export */ SegformerModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SegformerModel),\n/* harmony export */ SegformerPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SegformerPreTrainedModel),\n/* harmony export */ Seq2SeqLMOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Seq2SeqLMOutput),\n/* harmony export */ SequenceClassifierOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SequenceClassifierOutput),\n/* harmony export */ SiglipImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.SiglipImageProcessor),\n/* harmony export */ SiglipModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SiglipModel),\n/* harmony export */ SiglipPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SiglipPreTrainedModel),\n/* harmony export */ SiglipTextModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SiglipTextModel),\n/* harmony export */ SiglipTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.SiglipTokenizer),\n/* harmony export */ SiglipVisionModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SiglipVisionModel),\n/* harmony export */ SpeechT5FeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.SpeechT5FeatureExtractor),\n/* harmony export */ SpeechT5ForSpeechToText: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SpeechT5ForSpeechToText),\n/* harmony export */ SpeechT5ForTextToSpeech: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SpeechT5ForTextToSpeech),\n/* harmony export */ SpeechT5HifiGan: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SpeechT5HifiGan),\n/* harmony export */ SpeechT5Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SpeechT5Model),\n/* harmony export */ SpeechT5PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SpeechT5PreTrainedModel),\n/* harmony export */ SpeechT5Processor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.SpeechT5Processor),\n/* harmony export */ SpeechT5Tokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.SpeechT5Tokenizer),\n/* harmony export */ SqueezeBertForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SqueezeBertForMaskedLM),\n/* harmony export */ SqueezeBertForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SqueezeBertForQuestionAnswering),\n/* harmony export */ SqueezeBertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SqueezeBertForSequenceClassification),\n/* harmony export */ SqueezeBertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SqueezeBertModel),\n/* harmony export */ SqueezeBertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SqueezeBertPreTrainedModel),\n/* harmony export */ SqueezeBertTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.SqueezeBertTokenizer),\n/* harmony export */ StableLmForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.StableLmForCausalLM),\n/* harmony export */ StableLmModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.StableLmModel),\n/* harmony export */ StableLmPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.StableLmPreTrainedModel),\n/* harmony export */ Starcoder2ForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Starcoder2ForCausalLM),\n/* harmony export */ Starcoder2Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Starcoder2Model),\n/* harmony export */ Starcoder2PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Starcoder2PreTrainedModel),\n/* harmony export */ SummarizationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.SummarizationPipeline),\n/* harmony export */ Swin2SRForImageSuperResolution: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Swin2SRForImageSuperResolution),\n/* harmony export */ Swin2SRImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.Swin2SRImageProcessor),\n/* harmony export */ Swin2SRModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Swin2SRModel),\n/* harmony export */ Swin2SRPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Swin2SRPreTrainedModel),\n/* harmony export */ SwinForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SwinForImageClassification),\n/* harmony export */ SwinModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SwinModel),\n/* harmony export */ SwinPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.SwinPreTrainedModel),\n/* harmony export */ T5ForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.T5ForConditionalGeneration),\n/* harmony export */ T5Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.T5Model),\n/* harmony export */ T5PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.T5PreTrainedModel),\n/* harmony export */ T5Tokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.T5Tokenizer),\n/* harmony export */ TableTransformerForObjectDetection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.TableTransformerForObjectDetection),\n/* harmony export */ TableTransformerModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.TableTransformerModel),\n/* harmony export */ TableTransformerObjectDetectionOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.TableTransformerObjectDetectionOutput),\n/* harmony export */ TableTransformerPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.TableTransformerPreTrainedModel),\n/* harmony export */ Tensor: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.Tensor),\n/* harmony export */ Text2TextGenerationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.Text2TextGenerationPipeline),\n/* harmony export */ TextClassificationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.TextClassificationPipeline),\n/* harmony export */ TextGenerationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.TextGenerationPipeline),\n/* harmony export */ TextToAudioPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.TextToAudioPipeline),\n/* harmony export */ TokenClassificationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.TokenClassificationPipeline),\n/* harmony export */ TokenClassifierOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.TokenClassifierOutput),\n/* harmony export */ TokenizerModel: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.TokenizerModel),\n/* harmony export */ TrOCRForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.TrOCRForCausalLM),\n/* harmony export */ TrOCRPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.TrOCRPreTrainedModel),\n/* harmony export */ TranslationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.TranslationPipeline),\n/* harmony export */ UniSpeechForCTC: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.UniSpeechForCTC),\n/* harmony export */ UniSpeechForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.UniSpeechForSequenceClassification),\n/* harmony export */ UniSpeechModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.UniSpeechModel),\n/* harmony export */ UniSpeechPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.UniSpeechPreTrainedModel),\n/* harmony export */ UniSpeechSatForAudioFrameClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.UniSpeechSatForAudioFrameClassification),\n/* harmony export */ UniSpeechSatForCTC: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.UniSpeechSatForCTC),\n/* harmony export */ UniSpeechSatForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.UniSpeechSatForSequenceClassification),\n/* harmony export */ UniSpeechSatModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.UniSpeechSatModel),\n/* harmony export */ UniSpeechSatPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.UniSpeechSatPreTrainedModel),\n/* harmony export */ ViTFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.ViTFeatureExtractor),\n/* harmony export */ ViTForImageClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ViTForImageClassification),\n/* harmony export */ ViTImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.ViTImageProcessor),\n/* harmony export */ ViTModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ViTModel),\n/* harmony export */ ViTPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.ViTPreTrainedModel),\n/* harmony export */ VisionEncoderDecoderModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.VisionEncoderDecoderModel),\n/* harmony export */ VitMatteForImageMatting: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.VitMatteForImageMatting),\n/* harmony export */ VitMatteImageProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.VitMatteImageProcessor),\n/* harmony export */ VitMattePreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.VitMattePreTrainedModel),\n/* harmony export */ VitsModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.VitsModel),\n/* harmony export */ VitsModelOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.VitsModelOutput),\n/* harmony export */ VitsPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.VitsPreTrainedModel),\n/* harmony export */ VitsTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.VitsTokenizer),\n/* harmony export */ Wav2Vec2BertForCTC: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Wav2Vec2BertForCTC),\n/* harmony export */ Wav2Vec2BertForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Wav2Vec2BertForSequenceClassification),\n/* harmony export */ Wav2Vec2BertModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Wav2Vec2BertModel),\n/* harmony export */ Wav2Vec2BertPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Wav2Vec2BertPreTrainedModel),\n/* harmony export */ Wav2Vec2CTCTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.Wav2Vec2CTCTokenizer),\n/* harmony export */ Wav2Vec2FeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.Wav2Vec2FeatureExtractor),\n/* harmony export */ Wav2Vec2ForAudioFrameClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Wav2Vec2ForAudioFrameClassification),\n/* harmony export */ Wav2Vec2ForCTC: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Wav2Vec2ForCTC),\n/* harmony export */ Wav2Vec2ForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Wav2Vec2ForSequenceClassification),\n/* harmony export */ Wav2Vec2Model: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Wav2Vec2Model),\n/* harmony export */ Wav2Vec2PreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.Wav2Vec2PreTrainedModel),\n/* harmony export */ Wav2Vec2ProcessorWithLM: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.Wav2Vec2ProcessorWithLM),\n/* harmony export */ WavLMForAudioFrameClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.WavLMForAudioFrameClassification),\n/* harmony export */ WavLMForCTC: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.WavLMForCTC),\n/* harmony export */ WavLMForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.WavLMForSequenceClassification),\n/* harmony export */ WavLMForXVector: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.WavLMForXVector),\n/* harmony export */ WavLMModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.WavLMModel),\n/* harmony export */ WavLMPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.WavLMPreTrainedModel),\n/* harmony export */ WhisperFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.WhisperFeatureExtractor),\n/* harmony export */ WhisperForConditionalGeneration: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.WhisperForConditionalGeneration),\n/* harmony export */ WhisperModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.WhisperModel),\n/* harmony export */ WhisperPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.WhisperPreTrainedModel),\n/* harmony export */ WhisperProcessor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.WhisperProcessor),\n/* harmony export */ WhisperTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.WhisperTokenizer),\n/* harmony export */ XLMForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMForQuestionAnswering),\n/* harmony export */ XLMForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMForSequenceClassification),\n/* harmony export */ XLMForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMForTokenClassification),\n/* harmony export */ XLMModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMModel),\n/* harmony export */ XLMPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMPreTrainedModel),\n/* harmony export */ XLMRobertaForMaskedLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMRobertaForMaskedLM),\n/* harmony export */ XLMRobertaForQuestionAnswering: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMRobertaForQuestionAnswering),\n/* harmony export */ XLMRobertaForSequenceClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMRobertaForSequenceClassification),\n/* harmony export */ XLMRobertaForTokenClassification: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMRobertaForTokenClassification),\n/* harmony export */ XLMRobertaModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMRobertaModel),\n/* harmony export */ XLMRobertaPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMRobertaPreTrainedModel),\n/* harmony export */ XLMRobertaTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.XLMRobertaTokenizer),\n/* harmony export */ XLMTokenizer: () => (/* reexport safe */ _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__.XLMTokenizer),\n/* harmony export */ XLMWithLMHeadModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XLMWithLMHeadModel),\n/* harmony export */ XVectorOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.XVectorOutput),\n/* harmony export */ YolosFeatureExtractor: () => (/* reexport safe */ _processors_js__WEBPACK_IMPORTED_MODULE_4__.YolosFeatureExtractor),\n/* harmony export */ YolosForObjectDetection: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.YolosForObjectDetection),\n/* harmony export */ YolosModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.YolosModel),\n/* harmony export */ YolosObjectDetectionOutput: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.YolosObjectDetectionOutput),\n/* harmony export */ YolosPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.YolosPreTrainedModel),\n/* harmony export */ ZeroShotAudioClassificationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ZeroShotAudioClassificationPipeline),\n/* harmony export */ ZeroShotClassificationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ZeroShotClassificationPipeline),\n/* harmony export */ ZeroShotImageClassificationPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ZeroShotImageClassificationPipeline),\n/* harmony export */ ZeroShotObjectDetectionPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.ZeroShotObjectDetectionPipeline),\n/* harmony export */ bankers_round: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.bankers_round),\n/* harmony export */ cat: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.cat),\n/* harmony export */ cos_sim: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.cos_sim),\n/* harmony export */ dot: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.dot),\n/* harmony export */ dynamicTimeWarping: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.dynamicTimeWarping),\n/* harmony export */ env: () => (/* reexport safe */ _env_js__WEBPACK_IMPORTED_MODULE_1__.env),\n/* harmony export */ getTopItems: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.getTopItems),\n/* harmony export */ hanning: () => (/* reexport safe */ _utils_audio_js__WEBPACK_IMPORTED_MODULE_6__.hanning),\n/* harmony export */ interpolate: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.interpolate),\n/* harmony export */ interpolate_data: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.interpolate_data),\n/* harmony export */ layer_norm: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.layer_norm),\n/* harmony export */ log_softmax: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.log_softmax),\n/* harmony export */ magnitude: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.magnitude),\n/* harmony export */ max: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.max),\n/* harmony export */ mean: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.mean),\n/* harmony export */ mean_pooling: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.mean_pooling),\n/* harmony export */ medianFilter: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.medianFilter),\n/* harmony export */ mel_filter_bank: () => (/* reexport safe */ _utils_audio_js__WEBPACK_IMPORTED_MODULE_6__.mel_filter_bank),\n/* harmony export */ min: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.min),\n/* harmony export */ ones: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.ones),\n/* harmony export */ ones_like: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.ones_like),\n/* harmony export */ permute: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.permute),\n/* harmony export */ permute_data: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.permute_data),\n/* harmony export */ pipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_0__.pipeline),\n/* harmony export */ read_audio: () => (/* reexport safe */ _utils_audio_js__WEBPACK_IMPORTED_MODULE_6__.read_audio),\n/* harmony export */ round: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.round),\n/* harmony export */ softmax: () => (/* reexport safe */ _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__.softmax),\n/* harmony export */ spectrogram: () => (/* reexport safe */ _utils_audio_js__WEBPACK_IMPORTED_MODULE_6__.spectrogram),\n/* harmony export */ stack: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.stack),\n/* harmony export */ std_mean: () => (/* reexport safe */ _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__.std_mean),\n/* harmony export */ window_function: () => (/* reexport safe */ _utils_audio_js__WEBPACK_IMPORTED_MODULE_6__.window_function)\n/* harmony export */ });\n/* harmony import */ var _pipelines_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pipelines.js */ \"./node_modules/@xenova/transformers/src/pipelines.js\");\n/* harmony import */ var _env_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./env.js */ \"./node_modules/@xenova/transformers/src/env.js\");\n/* harmony import */ var _models_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./models.js */ \"./node_modules/@xenova/transformers/src/models.js\");\n/* harmony import */ var _tokenizers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tokenizers.js */ \"./node_modules/@xenova/transformers/src/tokenizers.js\");\n/* harmony import */ var _processors_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./processors.js */ \"./node_modules/@xenova/transformers/src/processors.js\");\n/* harmony import */ var _configs_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./configs.js */ \"./node_modules/@xenova/transformers/src/configs.js\");\n/* harmony import */ var _utils_audio_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/audio.js */ \"./node_modules/@xenova/transformers/src/utils/audio.js\");\n/* harmony import */ var _utils_image_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/image.js */ \"./node_modules/@xenova/transformers/src/utils/image.js\");\n/* harmony import */ var _utils_tensor_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/tensor.js */ \"./node_modules/@xenova/transformers/src/utils/tensor.js\");\n/* harmony import */ var _utils_maths_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/maths.js */ \"./node_modules/@xenova/transformers/src/utils/maths.js\");\n/**\n * @file Entry point for the Transformers.js library. Only the exports from this file\n * are available to the end user, and are grouped as follows:\n * \n * 1. [Pipelines](./pipelines)\n * 2. [Environment variables](./env)\n * 3. [Models](./models)\n * 4. [Tokenizers](./tokenizers)\n * 5. [Processors](./processors)\n * \n * @module transformers\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/transformers.js?"); /***/ }), @@ -414,7 +3746,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ RawImage: () => (/* binding */ RawImage)\n/* harmony export */ });\n/* harmony import */ var _hub_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hub.js */ \"./node_modules/@xenova/transformers/src/utils/hub.js\");\n/* harmony import */ var _env_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../env.js */ \"./node_modules/@xenova/transformers/src/env.js\");\n/* harmony import */ var sharp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! sharp */ \"?0740\");\n\n/**\n * @file Helper module for image processing. \n * \n * These functions and classes are only used internally, \n * meaning an end-user shouldn't need to access anything here.\n * \n * @module utils/image\n */\n\n\n\n\n// Will be empty (or not used) if running in browser or web-worker\n\n\nconst BROWSER_ENV = typeof self !== 'undefined';\nconst WEBWORKER_ENV = BROWSER_ENV && self.constructor.name === 'DedicatedWorkerGlobalScope';\n\nlet createCanvasFunction;\nlet ImageDataClass;\nlet loadImageFunction;\nif (BROWSER_ENV) {\n // Running in browser or web-worker\n createCanvasFunction = (/** @type {number} */ width, /** @type {number} */ height) => {\n if (!self.OffscreenCanvas) {\n throw new Error('OffscreenCanvas not supported by this browser.');\n }\n return new self.OffscreenCanvas(width, height)\n };\n loadImageFunction = self.createImageBitmap;\n ImageDataClass = self.ImageData;\n\n} else if (sharp__WEBPACK_IMPORTED_MODULE_2__) {\n // Running in Node.js, electron, or other non-browser environment\n\n loadImageFunction = async (/**@type {sharp.Sharp}*/img) => {\n const metadata = await img.metadata();\n const rawChannels = metadata.channels;\n\n let { data, info } = await img.raw().toBuffer({ resolveWithObject: true });\n\n const newImage = new RawImage(new Uint8ClampedArray(data), info.width, info.height, info.channels);\n if (rawChannels !== undefined && rawChannels !== info.channels) {\n // Make sure the new image has the same number of channels as the input image.\n // This is necessary for grayscale images.\n newImage.convert(rawChannels);\n }\n return newImage;\n }\n\n} else {\n throw new Error('Unable to load image processing library.');\n}\n\n\n// Defined here: https://github.com/python-pillow/Pillow/blob/a405e8406b83f8bfb8916e93971edc7407b8b1ff/src/libImaging/Imaging.h#L262-L268\nconst RESAMPLING_MAPPING = {\n 0: 'nearest',\n 1: 'lanczos',\n 2: 'bilinear',\n 3: 'bicubic',\n 4: 'box',\n 5: 'hamming',\n}\n\n/**\n * Mapping from file extensions to MIME types.\n */\nconst CONTENT_TYPE_MAP = new Map([\n ['png', 'image/png'],\n ['jpg', 'image/jpeg'],\n ['jpeg', 'image/jpeg'],\n ['gif', 'image/gif'],\n]);\n\nclass RawImage {\n\n /**\n * Create a new `RawImage` object.\n * @param {Uint8ClampedArray|Uint8Array} data The pixel data.\n * @param {number} width The width of the image.\n * @param {number} height The height of the image.\n * @param {1|2|3|4} channels The number of channels.\n */\n constructor(data, width, height, channels) {\n this.data = data;\n this.width = width;\n this.height = height;\n this.channels = channels;\n }\n\n /** \n * Returns the size of the image (width, height).\n * @returns {[number, number]} The size of the image (width, height).\n */\n get size() {\n return [this.width, this.height];\n }\n\n /**\n * Helper method for reading an image from a variety of input types.\n * @param {RawImage|string|URL} input \n * @returns The image object.\n * \n * **Example:** Read image from a URL.\n * ```javascript\n * let image = await RawImage.read('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');\n * // RawImage {\n * // \"data\": Uint8ClampedArray [ 25, 25, 25, 19, 19, 19, ... ],\n * // \"width\": 800,\n * // \"height\": 533,\n * // \"channels\": 3\n * // }\n * ```\n */\n static async read(input) {\n if (input instanceof RawImage) {\n return input;\n } else if (typeof input === 'string' || input instanceof URL) {\n return await this.fromURL(input);\n } else {\n throw new Error(`Unsupported input type: ${typeof input}`);\n }\n }\n\n\n /**\n * Read an image from a URL or file path.\n * @param {string|URL} url The URL or file path to read the image from.\n * @returns {Promise} The image object.\n */\n static async fromURL(url) {\n let response = await (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getFile)(url);\n if (response.status !== 200) {\n throw new Error(`Unable to read image from \"${url}\" (${response.status} ${response.statusText})`);\n }\n let blob = await response.blob();\n return this.fromBlob(blob);\n }\n\n /**\n * Helper method to create a new Image from a blob.\n * @param {Blob} blob The blob to read the image from.\n * @returns {Promise} The image object.\n */\n static async fromBlob(blob) {\n if (BROWSER_ENV) {\n // Running in environment with canvas\n let img = await loadImageFunction(blob);\n\n const ctx = createCanvasFunction(img.width, img.height).getContext('2d');\n\n // Draw image to context\n ctx.drawImage(img, 0, 0);\n\n return new this(ctx.getImageData(0, 0, img.width, img.height).data, img.width, img.height, 4);\n\n } else {\n // Use sharp.js to read (and possible resize) the image.\n let img = sharp__WEBPACK_IMPORTED_MODULE_2__(await blob.arrayBuffer());\n\n return await loadImageFunction(img);\n }\n }\n\n /**\n * Helper method to create a new Image from a tensor\n * @param {import('./tensor.js').Tensor} tensor \n */\n static fromTensor(tensor, channel_format = 'CHW') {\n if (tensor.dims.length !== 3) {\n throw new Error(`Tensor should have 3 dimensions, but has ${tensor.dims.length} dimensions.`);\n }\n\n if (channel_format === 'CHW') {\n tensor = tensor.transpose(1, 2, 0);\n } else if (channel_format === 'HWC') {\n // Do nothing\n } else {\n throw new Error(`Unsupported channel format: ${channel_format}`);\n }\n if (!(tensor.data instanceof Uint8ClampedArray || tensor.data instanceof Uint8Array)) {\n throw new Error(`Unsupported tensor type: ${tensor.type}`);\n }\n switch (tensor.dims[2]) {\n case 1:\n case 2:\n case 3:\n case 4:\n return new RawImage(tensor.data, tensor.dims[1], tensor.dims[0], tensor.dims[2]);\n default:\n throw new Error(`Unsupported number of channels: ${tensor.dims[2]}`);\n }\n }\n\n /**\n * Convert the image to grayscale format.\n * @returns {RawImage} `this` to support chaining.\n */\n grayscale() {\n if (this.channels === 1) {\n return this;\n }\n\n let newData = new Uint8ClampedArray(this.width * this.height * 1);\n switch (this.channels) {\n case 3: // rgb to grayscale\n case 4: // rgba to grayscale\n for (let i = 0, offset = 0; i < this.data.length; i += this.channels) {\n const red = this.data[i];\n const green = this.data[i + 1];\n const blue = this.data[i + 2];\n\n newData[offset++] = Math.round(0.2989 * red + 0.5870 * green + 0.1140 * blue);\n }\n break;\n default:\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\n }\n return this._update(newData, this.width, this.height, 1);\n }\n\n /**\n * Convert the image to RGB format.\n * @returns {RawImage} `this` to support chaining.\n */\n rgb() {\n if (this.channels === 3) {\n return this;\n }\n\n let newData = new Uint8ClampedArray(this.width * this.height * 3);\n\n switch (this.channels) {\n case 1: // grayscale to rgb\n for (let i = 0, offset = 0; i < this.data.length; ++i) {\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i];\n }\n break;\n case 4: // rgba to rgb\n for (let i = 0, offset = 0; i < this.data.length; i += 4) {\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i + 1];\n newData[offset++] = this.data[i + 2];\n }\n break;\n default:\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\n }\n return this._update(newData, this.width, this.height, 3);\n\n }\n\n /**\n * Convert the image to RGBA format.\n * @returns {RawImage} `this` to support chaining.\n */\n rgba() {\n if (this.channels === 4) {\n return this;\n }\n\n let newData = new Uint8ClampedArray(this.width * this.height * 4);\n\n switch (this.channels) {\n case 1: // grayscale to rgba\n for (let i = 0, offset = 0; i < this.data.length; ++i) {\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i];\n newData[offset++] = 255;\n }\n break;\n case 3: // rgb to rgba\n for (let i = 0, offset = 0; i < this.data.length; i += 3) {\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i + 1];\n newData[offset++] = this.data[i + 2];\n newData[offset++] = 255;\n }\n break;\n default:\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\n }\n\n return this._update(newData, this.width, this.height, 4);\n }\n\n /**\n * Resize the image to the given dimensions. This method uses the canvas API to perform the resizing.\n * @param {number} width The width of the new image.\n * @param {number} height The height of the new image.\n * @param {Object} options Additional options for resizing.\n * @param {0|1|2|3|4|5|string} [options.resample] The resampling method to use.\n * @returns {Promise} `this` to support chaining.\n */\n async resize(width, height, {\n resample = 2,\n } = {}) {\n\n // Ensure resample method is a string\n let resampleMethod = RESAMPLING_MAPPING[resample] ?? resample;\n\n if (BROWSER_ENV) {\n // TODO use `resample` in browser environment\n\n // Store number of channels before resizing\n let numChannels = this.channels;\n\n // Create canvas object for this image\n let canvas = this.toCanvas();\n\n // Actually perform resizing using the canvas API\n const ctx = createCanvasFunction(width, height).getContext('2d');\n\n // Draw image to context, resizing in the process\n ctx.drawImage(canvas, 0, 0, width, height);\n\n // Create image from the resized data\n let resizedImage = new RawImage(ctx.getImageData(0, 0, width, height).data, width, height, 4);\n\n // Convert back so that image has the same number of channels as before\n return resizedImage.convert(numChannels);\n\n } else {\n // Create sharp image from raw data, and resize\n let img = this.toSharp();\n\n switch (resampleMethod) {\n case 'box':\n case 'hamming':\n if (resampleMethod === 'box' || resampleMethod === 'hamming') {\n console.warn(`Resampling method ${resampleMethod} is not yet supported. Using bilinear instead.`);\n resampleMethod = 'bilinear';\n }\n\n case 'nearest':\n case 'bilinear':\n case 'bicubic':\n // Perform resizing using affine transform. \n // This matches how the python Pillow library does it.\n img = img.affine([width / this.width, 0, 0, height / this.height], {\n interpolator: resampleMethod\n });\n break;\n\n case 'lanczos':\n // https://github.com/python-pillow/Pillow/discussions/5519\n // https://github.com/lovell/sharp/blob/main/docs/api-resize.md\n img = img.resize({\n width, height,\n fit: 'fill',\n kernel: 'lanczos3', // PIL Lanczos uses a kernel size of 3 \n });\n break;\n\n default:\n throw new Error(`Resampling method ${resampleMethod} is not supported.`);\n }\n\n return await loadImageFunction(img);\n }\n\n }\n\n async pad([left, right, top, bottom]) {\n left = Math.max(left, 0);\n right = Math.max(right, 0);\n top = Math.max(top, 0);\n bottom = Math.max(bottom, 0);\n\n if (left === 0 && right === 0 && top === 0 && bottom === 0) {\n // No padding needed\n return this;\n }\n\n if (BROWSER_ENV) {\n // Store number of channels before padding\n let numChannels = this.channels;\n\n // Create canvas object for this image\n let canvas = this.toCanvas();\n\n let newWidth = this.width + left + right;\n let newHeight = this.height + top + bottom;\n\n // Create a new canvas of the desired size.\n const ctx = createCanvasFunction(newWidth, newHeight).getContext('2d');\n\n // Draw image to context, padding in the process\n ctx.drawImage(canvas,\n 0, 0, this.width, this.height,\n left, top, newWidth, newHeight\n );\n\n // Create image from the padded data\n let paddedImage = new RawImage(\n ctx.getImageData(0, 0, newWidth, newHeight).data,\n newWidth, newHeight, 4);\n\n // Convert back so that image has the same number of channels as before\n return paddedImage.convert(numChannels);\n\n } else {\n let img = this.toSharp().extend({ left, right, top, bottom });\n return await loadImageFunction(img);\n }\n }\n\n async crop([x_min, y_min, x_max, y_max]) {\n // Ensure crop bounds are within the image\n x_min = Math.max(x_min, 0);\n y_min = Math.max(y_min, 0);\n x_max = Math.min(x_max, this.width - 1);\n y_max = Math.min(y_max, this.height - 1);\n\n // Do nothing if the crop is the entire image\n if (x_min === 0 && y_min === 0 && x_max === this.width - 1 && y_max === this.height - 1) {\n return this;\n }\n\n const crop_width = x_max - x_min + 1;\n const crop_height = y_max - y_min + 1;\n\n if (BROWSER_ENV) {\n // Store number of channels before resizing\n const numChannels = this.channels;\n\n // Create canvas object for this image\n const canvas = this.toCanvas();\n\n // Create a new canvas of the desired size. This is needed since if the \n // image is too small, we need to pad it with black pixels.\n const ctx = createCanvasFunction(crop_width, crop_height).getContext('2d');\n\n // Draw image to context, cropping in the process\n ctx.drawImage(canvas,\n x_min, y_min, crop_width, crop_height,\n 0, 0, crop_width, crop_height\n );\n\n // Create image from the resized data\n const resizedImage = new RawImage(ctx.getImageData(0, 0, crop_width, crop_height).data, crop_width, crop_height, 4);\n\n // Convert back so that image has the same number of channels as before\n return resizedImage.convert(numChannels);\n\n } else {\n // Create sharp image from raw data\n const img = this.toSharp().extract({\n left: x_min,\n top: y_min,\n width: crop_width,\n height: crop_height,\n });\n\n return await loadImageFunction(img);\n }\n\n }\n\n async center_crop(crop_width, crop_height) {\n // If the image is already the desired size, return it\n if (this.width === crop_width && this.height === crop_height) {\n return this;\n }\n\n // Determine bounds of the image in the new canvas\n let width_offset = (this.width - crop_width) / 2;\n let height_offset = (this.height - crop_height) / 2;\n\n\n if (BROWSER_ENV) {\n // Store number of channels before resizing\n let numChannels = this.channels;\n\n // Create canvas object for this image\n let canvas = this.toCanvas();\n\n // Create a new canvas of the desired size. This is needed since if the \n // image is too small, we need to pad it with black pixels.\n const ctx = createCanvasFunction(crop_width, crop_height).getContext('2d');\n\n let sourceX = 0;\n let sourceY = 0;\n let destX = 0;\n let destY = 0;\n\n if (width_offset >= 0) {\n sourceX = width_offset;\n } else {\n destX = -width_offset;\n }\n\n if (height_offset >= 0) {\n sourceY = height_offset;\n } else {\n destY = -height_offset;\n }\n\n // Draw image to context, cropping in the process\n ctx.drawImage(canvas,\n sourceX, sourceY, crop_width, crop_height,\n destX, destY, crop_width, crop_height\n );\n\n // Create image from the resized data\n let resizedImage = new RawImage(ctx.getImageData(0, 0, crop_width, crop_height).data, crop_width, crop_height, 4);\n\n // Convert back so that image has the same number of channels as before\n return resizedImage.convert(numChannels);\n\n } else {\n // Create sharp image from raw data\n let img = this.toSharp();\n\n if (width_offset >= 0 && height_offset >= 0) {\n // Cropped image lies entirely within the original image\n img = img.extract({\n left: Math.floor(width_offset),\n top: Math.floor(height_offset),\n width: crop_width,\n height: crop_height,\n })\n } else if (width_offset <= 0 && height_offset <= 0) {\n // Cropped image lies entirely outside the original image,\n // so we add padding\n let top = Math.floor(-height_offset);\n let left = Math.floor(-width_offset);\n img = img.extend({\n top: top,\n left: left,\n\n // Ensures the resulting image has the desired dimensions\n right: crop_width - this.width - left,\n bottom: crop_height - this.height - top,\n });\n } else {\n // Cropped image lies partially outside the original image.\n // We first pad, then crop.\n\n let y_padding = [0, 0];\n let y_extract = 0;\n if (height_offset < 0) {\n y_padding[0] = Math.floor(-height_offset);\n y_padding[1] = crop_height - this.height - y_padding[0];\n } else {\n y_extract = Math.floor(height_offset);\n }\n\n let x_padding = [0, 0];\n let x_extract = 0;\n if (width_offset < 0) {\n x_padding[0] = Math.floor(-width_offset);\n x_padding[1] = crop_width - this.width - x_padding[0];\n } else {\n x_extract = Math.floor(width_offset);\n }\n\n img = img.extend({\n top: y_padding[0],\n bottom: y_padding[1],\n left: x_padding[0],\n right: x_padding[1],\n }).extract({\n left: x_extract,\n top: y_extract,\n width: crop_width,\n height: crop_height,\n })\n }\n\n return await loadImageFunction(img);\n }\n }\n\n async toBlob(type = 'image/png', quality = 1) {\n if (!BROWSER_ENV) {\n throw new Error('toBlob() is only supported in browser environments.')\n }\n\n const canvas = this.toCanvas();\n return await canvas.convertToBlob({ type, quality });\n }\n\n toCanvas() {\n if (!BROWSER_ENV) {\n throw new Error('toCanvas() is only supported in browser environments.')\n }\n\n // Clone, and convert data to RGBA before drawing to canvas.\n // This is because the canvas API only supports RGBA\n let cloned = this.clone().rgba();\n\n // Create canvas object for the cloned image\n let clonedCanvas = createCanvasFunction(cloned.width, cloned.height);\n\n // Draw image to context\n let data = new ImageDataClass(cloned.data, cloned.width, cloned.height);\n clonedCanvas.getContext('2d').putImageData(data, 0, 0);\n\n return clonedCanvas;\n }\n\n /**\n * Helper method to update the image data.\n * @param {Uint8ClampedArray} data The new image data.\n * @param {number} width The new width of the image.\n * @param {number} height The new height of the image.\n * @param {1|2|3|4|null} [channels] The new number of channels of the image.\n * @private\n */\n _update(data, width, height, channels = null) {\n this.data = data;\n this.width = width;\n this.height = height;\n if (channels !== null) {\n this.channels = channels;\n }\n return this;\n }\n\n /**\n * Clone the image\n * @returns {RawImage} The cloned image\n */\n clone() {\n return new RawImage(this.data.slice(), this.width, this.height, this.channels);\n }\n\n /**\n * Helper method for converting image to have a certain number of channels\n * @param {number} numChannels The number of channels. Must be 1, 3, or 4.\n * @returns {RawImage} `this` to support chaining.\n */\n convert(numChannels) {\n if (this.channels === numChannels) return this; // Already correct number of channels\n\n switch (numChannels) {\n case 1:\n this.grayscale();\n break;\n case 3:\n this.rgb();\n break;\n case 4:\n this.rgba();\n break;\n default:\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\n }\n return this;\n }\n\n /**\n * Save the image to the given path.\n * @param {string} path The path to save the image to.\n */\n async save(path) {\n\n if (BROWSER_ENV) {\n if (WEBWORKER_ENV) {\n throw new Error('Unable to save an image from a Web Worker.')\n }\n\n const extension = path.split('.').pop().toLowerCase();\n const mime = CONTENT_TYPE_MAP.get(extension) ?? 'image/png';\n\n // Convert image to Blob\n const blob = await this.toBlob(mime);\n\n // Convert the canvas content to a data URL\n const dataURL = URL.createObjectURL(blob);\n\n // Create an anchor element with the data URL as the href attribute\n const downloadLink = document.createElement('a');\n downloadLink.href = dataURL;\n\n // Set the download attribute to specify the desired filename for the downloaded image\n downloadLink.download = path;\n\n // Trigger the download\n downloadLink.click();\n\n // Clean up: remove the anchor element from the DOM\n downloadLink.remove();\n\n } else if (!_env_js__WEBPACK_IMPORTED_MODULE_1__.env.useFS) {\n throw new Error('Unable to save the image because filesystem is disabled in this environment.')\n\n } else {\n const img = this.toSharp();\n return await img.toFile(path);\n }\n }\n\n toSharp() {\n if (BROWSER_ENV) {\n throw new Error('toSharp() is only supported in server-side environments.')\n }\n\n return sharp__WEBPACK_IMPORTED_MODULE_2__(this.data, {\n raw: {\n width: this.width,\n height: this.height,\n channels: this.channels\n }\n });\n }\n}\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/utils/image.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ RawImage: () => (/* binding */ RawImage)\n/* harmony export */ });\n/* harmony import */ var _hub_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hub.js */ \"./node_modules/@xenova/transformers/src/utils/hub.js\");\n/* harmony import */ var _env_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../env.js */ \"./node_modules/@xenova/transformers/src/env.js\");\n/* harmony import */ var _tensor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tensor.js */ \"./node_modules/@xenova/transformers/src/utils/tensor.js\");\n/* harmony import */ var sharp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! sharp */ \"?0740\");\n\n/**\n * @file Helper module for image processing. \n * \n * These functions and classes are only used internally, \n * meaning an end-user shouldn't need to access anything here.\n * \n * @module utils/image\n */\n\n\n\n\n\n// Will be empty (or not used) if running in browser or web-worker\n\n\nconst BROWSER_ENV = typeof self !== 'undefined';\nconst WEBWORKER_ENV = BROWSER_ENV && self.constructor.name === 'DedicatedWorkerGlobalScope';\n\nlet createCanvasFunction;\nlet ImageDataClass;\nlet loadImageFunction;\nif (BROWSER_ENV) {\n // Running in browser or web-worker\n createCanvasFunction = (/** @type {number} */ width, /** @type {number} */ height) => {\n if (!self.OffscreenCanvas) {\n throw new Error('OffscreenCanvas not supported by this browser.');\n }\n return new self.OffscreenCanvas(width, height)\n };\n loadImageFunction = self.createImageBitmap;\n ImageDataClass = self.ImageData;\n\n} else if (sharp__WEBPACK_IMPORTED_MODULE_3__) {\n // Running in Node.js, electron, or other non-browser environment\n\n loadImageFunction = async (/**@type {sharp.Sharp}*/img) => {\n const metadata = await img.metadata();\n const rawChannels = metadata.channels;\n\n let { data, info } = await img.raw().toBuffer({ resolveWithObject: true });\n\n const newImage = new RawImage(new Uint8ClampedArray(data), info.width, info.height, info.channels);\n if (rawChannels !== undefined && rawChannels !== info.channels) {\n // Make sure the new image has the same number of channels as the input image.\n // This is necessary for grayscale images.\n newImage.convert(rawChannels);\n }\n return newImage;\n }\n\n} else {\n throw new Error('Unable to load image processing library.');\n}\n\n\n// Defined here: https://github.com/python-pillow/Pillow/blob/a405e8406b83f8bfb8916e93971edc7407b8b1ff/src/libImaging/Imaging.h#L262-L268\nconst RESAMPLING_MAPPING = {\n 0: 'nearest',\n 1: 'lanczos',\n 2: 'bilinear',\n 3: 'bicubic',\n 4: 'box',\n 5: 'hamming',\n}\n\n/**\n * Mapping from file extensions to MIME types.\n */\nconst CONTENT_TYPE_MAP = new Map([\n ['png', 'image/png'],\n ['jpg', 'image/jpeg'],\n ['jpeg', 'image/jpeg'],\n ['gif', 'image/gif'],\n]);\n\nclass RawImage {\n\n /**\n * Create a new `RawImage` object.\n * @param {Uint8ClampedArray|Uint8Array} data The pixel data.\n * @param {number} width The width of the image.\n * @param {number} height The height of the image.\n * @param {1|2|3|4} channels The number of channels.\n */\n constructor(data, width, height, channels) {\n this.data = data;\n this.width = width;\n this.height = height;\n this.channels = channels;\n }\n\n /** \n * Returns the size of the image (width, height).\n * @returns {[number, number]} The size of the image (width, height).\n */\n get size() {\n return [this.width, this.height];\n }\n\n /**\n * Helper method for reading an image from a variety of input types.\n * @param {RawImage|string|URL} input \n * @returns The image object.\n * \n * **Example:** Read image from a URL.\n * ```javascript\n * let image = await RawImage.read('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');\n * // RawImage {\n * // \"data\": Uint8ClampedArray [ 25, 25, 25, 19, 19, 19, ... ],\n * // \"width\": 800,\n * // \"height\": 533,\n * // \"channels\": 3\n * // }\n * ```\n */\n static async read(input) {\n if (input instanceof RawImage) {\n return input;\n } else if (typeof input === 'string' || input instanceof URL) {\n return await this.fromURL(input);\n } else {\n throw new Error(`Unsupported input type: ${typeof input}`);\n }\n }\n\n\n /**\n * Read an image from a URL or file path.\n * @param {string|URL} url The URL or file path to read the image from.\n * @returns {Promise} The image object.\n */\n static async fromURL(url) {\n let response = await (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getFile)(url);\n if (response.status !== 200) {\n throw new Error(`Unable to read image from \"${url}\" (${response.status} ${response.statusText})`);\n }\n let blob = await response.blob();\n return this.fromBlob(blob);\n }\n\n /**\n * Helper method to create a new Image from a blob.\n * @param {Blob} blob The blob to read the image from.\n * @returns {Promise} The image object.\n */\n static async fromBlob(blob) {\n if (BROWSER_ENV) {\n // Running in environment with canvas\n let img = await loadImageFunction(blob);\n\n const ctx = createCanvasFunction(img.width, img.height).getContext('2d');\n\n // Draw image to context\n ctx.drawImage(img, 0, 0);\n\n return new this(ctx.getImageData(0, 0, img.width, img.height).data, img.width, img.height, 4);\n\n } else {\n // Use sharp.js to read (and possible resize) the image.\n let img = sharp__WEBPACK_IMPORTED_MODULE_3__(await blob.arrayBuffer());\n\n return await loadImageFunction(img);\n }\n }\n\n /**\n * Helper method to create a new Image from a tensor\n * @param {Tensor} tensor \n */\n static fromTensor(tensor, channel_format = 'CHW') {\n if (tensor.dims.length !== 3) {\n throw new Error(`Tensor should have 3 dimensions, but has ${tensor.dims.length} dimensions.`);\n }\n\n if (channel_format === 'CHW') {\n tensor = tensor.transpose(1, 2, 0);\n } else if (channel_format === 'HWC') {\n // Do nothing\n } else {\n throw new Error(`Unsupported channel format: ${channel_format}`);\n }\n if (!(tensor.data instanceof Uint8ClampedArray || tensor.data instanceof Uint8Array)) {\n throw new Error(`Unsupported tensor type: ${tensor.type}`);\n }\n switch (tensor.dims[2]) {\n case 1:\n case 2:\n case 3:\n case 4:\n return new RawImage(tensor.data, tensor.dims[1], tensor.dims[0], tensor.dims[2]);\n default:\n throw new Error(`Unsupported number of channels: ${tensor.dims[2]}`);\n }\n }\n\n /**\n * Convert the image to grayscale format.\n * @returns {RawImage} `this` to support chaining.\n */\n grayscale() {\n if (this.channels === 1) {\n return this;\n }\n\n let newData = new Uint8ClampedArray(this.width * this.height * 1);\n switch (this.channels) {\n case 3: // rgb to grayscale\n case 4: // rgba to grayscale\n for (let i = 0, offset = 0; i < this.data.length; i += this.channels) {\n const red = this.data[i];\n const green = this.data[i + 1];\n const blue = this.data[i + 2];\n\n newData[offset++] = Math.round(0.2989 * red + 0.5870 * green + 0.1140 * blue);\n }\n break;\n default:\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\n }\n return this._update(newData, this.width, this.height, 1);\n }\n\n /**\n * Convert the image to RGB format.\n * @returns {RawImage} `this` to support chaining.\n */\n rgb() {\n if (this.channels === 3) {\n return this;\n }\n\n let newData = new Uint8ClampedArray(this.width * this.height * 3);\n\n switch (this.channels) {\n case 1: // grayscale to rgb\n for (let i = 0, offset = 0; i < this.data.length; ++i) {\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i];\n }\n break;\n case 4: // rgba to rgb\n for (let i = 0, offset = 0; i < this.data.length; i += 4) {\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i + 1];\n newData[offset++] = this.data[i + 2];\n }\n break;\n default:\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\n }\n return this._update(newData, this.width, this.height, 3);\n\n }\n\n /**\n * Convert the image to RGBA format.\n * @returns {RawImage} `this` to support chaining.\n */\n rgba() {\n if (this.channels === 4) {\n return this;\n }\n\n let newData = new Uint8ClampedArray(this.width * this.height * 4);\n\n switch (this.channels) {\n case 1: // grayscale to rgba\n for (let i = 0, offset = 0; i < this.data.length; ++i) {\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i];\n newData[offset++] = 255;\n }\n break;\n case 3: // rgb to rgba\n for (let i = 0, offset = 0; i < this.data.length; i += 3) {\n newData[offset++] = this.data[i];\n newData[offset++] = this.data[i + 1];\n newData[offset++] = this.data[i + 2];\n newData[offset++] = 255;\n }\n break;\n default:\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\n }\n\n return this._update(newData, this.width, this.height, 4);\n }\n\n /**\n * Resize the image to the given dimensions. This method uses the canvas API to perform the resizing.\n * @param {number} width The width of the new image.\n * @param {number} height The height of the new image.\n * @param {Object} options Additional options for resizing.\n * @param {0|1|2|3|4|5|string} [options.resample] The resampling method to use.\n * @returns {Promise} `this` to support chaining.\n */\n async resize(width, height, {\n resample = 2,\n } = {}) {\n\n // Ensure resample method is a string\n let resampleMethod = RESAMPLING_MAPPING[resample] ?? resample;\n\n if (BROWSER_ENV) {\n // TODO use `resample` in browser environment\n\n // Store number of channels before resizing\n let numChannels = this.channels;\n\n // Create canvas object for this image\n let canvas = this.toCanvas();\n\n // Actually perform resizing using the canvas API\n const ctx = createCanvasFunction(width, height).getContext('2d');\n\n // Draw image to context, resizing in the process\n ctx.drawImage(canvas, 0, 0, width, height);\n\n // Create image from the resized data\n let resizedImage = new RawImage(ctx.getImageData(0, 0, width, height).data, width, height, 4);\n\n // Convert back so that image has the same number of channels as before\n return resizedImage.convert(numChannels);\n\n } else {\n // Create sharp image from raw data, and resize\n let img = this.toSharp();\n\n switch (resampleMethod) {\n case 'box':\n case 'hamming':\n if (resampleMethod === 'box' || resampleMethod === 'hamming') {\n console.warn(`Resampling method ${resampleMethod} is not yet supported. Using bilinear instead.`);\n resampleMethod = 'bilinear';\n }\n\n case 'nearest':\n case 'bilinear':\n case 'bicubic':\n // Perform resizing using affine transform. \n // This matches how the python Pillow library does it.\n img = img.affine([width / this.width, 0, 0, height / this.height], {\n interpolator: resampleMethod\n });\n break;\n\n case 'lanczos':\n // https://github.com/python-pillow/Pillow/discussions/5519\n // https://github.com/lovell/sharp/blob/main/docs/api-resize.md\n img = img.resize({\n width, height,\n fit: 'fill',\n kernel: 'lanczos3', // PIL Lanczos uses a kernel size of 3 \n });\n break;\n\n default:\n throw new Error(`Resampling method ${resampleMethod} is not supported.`);\n }\n\n return await loadImageFunction(img);\n }\n\n }\n\n async pad([left, right, top, bottom]) {\n left = Math.max(left, 0);\n right = Math.max(right, 0);\n top = Math.max(top, 0);\n bottom = Math.max(bottom, 0);\n\n if (left === 0 && right === 0 && top === 0 && bottom === 0) {\n // No padding needed\n return this;\n }\n\n if (BROWSER_ENV) {\n // Store number of channels before padding\n let numChannels = this.channels;\n\n // Create canvas object for this image\n let canvas = this.toCanvas();\n\n let newWidth = this.width + left + right;\n let newHeight = this.height + top + bottom;\n\n // Create a new canvas of the desired size.\n const ctx = createCanvasFunction(newWidth, newHeight).getContext('2d');\n\n // Draw image to context, padding in the process\n ctx.drawImage(canvas,\n 0, 0, this.width, this.height,\n left, top, newWidth, newHeight\n );\n\n // Create image from the padded data\n let paddedImage = new RawImage(\n ctx.getImageData(0, 0, newWidth, newHeight).data,\n newWidth, newHeight, 4);\n\n // Convert back so that image has the same number of channels as before\n return paddedImage.convert(numChannels);\n\n } else {\n let img = this.toSharp().extend({ left, right, top, bottom });\n return await loadImageFunction(img);\n }\n }\n\n async crop([x_min, y_min, x_max, y_max]) {\n // Ensure crop bounds are within the image\n x_min = Math.max(x_min, 0);\n y_min = Math.max(y_min, 0);\n x_max = Math.min(x_max, this.width - 1);\n y_max = Math.min(y_max, this.height - 1);\n\n // Do nothing if the crop is the entire image\n if (x_min === 0 && y_min === 0 && x_max === this.width - 1 && y_max === this.height - 1) {\n return this;\n }\n\n const crop_width = x_max - x_min + 1;\n const crop_height = y_max - y_min + 1;\n\n if (BROWSER_ENV) {\n // Store number of channels before resizing\n const numChannels = this.channels;\n\n // Create canvas object for this image\n const canvas = this.toCanvas();\n\n // Create a new canvas of the desired size. This is needed since if the \n // image is too small, we need to pad it with black pixels.\n const ctx = createCanvasFunction(crop_width, crop_height).getContext('2d');\n\n // Draw image to context, cropping in the process\n ctx.drawImage(canvas,\n x_min, y_min, crop_width, crop_height,\n 0, 0, crop_width, crop_height\n );\n\n // Create image from the resized data\n const resizedImage = new RawImage(ctx.getImageData(0, 0, crop_width, crop_height).data, crop_width, crop_height, 4);\n\n // Convert back so that image has the same number of channels as before\n return resizedImage.convert(numChannels);\n\n } else {\n // Create sharp image from raw data\n const img = this.toSharp().extract({\n left: x_min,\n top: y_min,\n width: crop_width,\n height: crop_height,\n });\n\n return await loadImageFunction(img);\n }\n\n }\n\n async center_crop(crop_width, crop_height) {\n // If the image is already the desired size, return it\n if (this.width === crop_width && this.height === crop_height) {\n return this;\n }\n\n // Determine bounds of the image in the new canvas\n let width_offset = (this.width - crop_width) / 2;\n let height_offset = (this.height - crop_height) / 2;\n\n\n if (BROWSER_ENV) {\n // Store number of channels before resizing\n let numChannels = this.channels;\n\n // Create canvas object for this image\n let canvas = this.toCanvas();\n\n // Create a new canvas of the desired size. This is needed since if the \n // image is too small, we need to pad it with black pixels.\n const ctx = createCanvasFunction(crop_width, crop_height).getContext('2d');\n\n let sourceX = 0;\n let sourceY = 0;\n let destX = 0;\n let destY = 0;\n\n if (width_offset >= 0) {\n sourceX = width_offset;\n } else {\n destX = -width_offset;\n }\n\n if (height_offset >= 0) {\n sourceY = height_offset;\n } else {\n destY = -height_offset;\n }\n\n // Draw image to context, cropping in the process\n ctx.drawImage(canvas,\n sourceX, sourceY, crop_width, crop_height,\n destX, destY, crop_width, crop_height\n );\n\n // Create image from the resized data\n let resizedImage = new RawImage(ctx.getImageData(0, 0, crop_width, crop_height).data, crop_width, crop_height, 4);\n\n // Convert back so that image has the same number of channels as before\n return resizedImage.convert(numChannels);\n\n } else {\n // Create sharp image from raw data\n let img = this.toSharp();\n\n if (width_offset >= 0 && height_offset >= 0) {\n // Cropped image lies entirely within the original image\n img = img.extract({\n left: Math.floor(width_offset),\n top: Math.floor(height_offset),\n width: crop_width,\n height: crop_height,\n })\n } else if (width_offset <= 0 && height_offset <= 0) {\n // Cropped image lies entirely outside the original image,\n // so we add padding\n let top = Math.floor(-height_offset);\n let left = Math.floor(-width_offset);\n img = img.extend({\n top: top,\n left: left,\n\n // Ensures the resulting image has the desired dimensions\n right: crop_width - this.width - left,\n bottom: crop_height - this.height - top,\n });\n } else {\n // Cropped image lies partially outside the original image.\n // We first pad, then crop.\n\n let y_padding = [0, 0];\n let y_extract = 0;\n if (height_offset < 0) {\n y_padding[0] = Math.floor(-height_offset);\n y_padding[1] = crop_height - this.height - y_padding[0];\n } else {\n y_extract = Math.floor(height_offset);\n }\n\n let x_padding = [0, 0];\n let x_extract = 0;\n if (width_offset < 0) {\n x_padding[0] = Math.floor(-width_offset);\n x_padding[1] = crop_width - this.width - x_padding[0];\n } else {\n x_extract = Math.floor(width_offset);\n }\n\n img = img.extend({\n top: y_padding[0],\n bottom: y_padding[1],\n left: x_padding[0],\n right: x_padding[1],\n }).extract({\n left: x_extract,\n top: y_extract,\n width: crop_width,\n height: crop_height,\n })\n }\n\n return await loadImageFunction(img);\n }\n }\n\n async toBlob(type = 'image/png', quality = 1) {\n if (!BROWSER_ENV) {\n throw new Error('toBlob() is only supported in browser environments.')\n }\n\n const canvas = this.toCanvas();\n return await canvas.convertToBlob({ type, quality });\n }\n\n toTensor(channel_format = 'CHW') {\n let tensor = new _tensor_js__WEBPACK_IMPORTED_MODULE_2__.Tensor(\n 'uint8',\n new Uint8Array(this.data),\n [this.height, this.width, this.channels]\n );\n\n if (channel_format === 'HWC') {\n // Do nothing\n } else if (channel_format === 'CHW') { // hwc -> chw\n tensor = tensor.permute(2, 0, 1);\n } else {\n throw new Error(`Unsupported channel format: ${channel_format}`);\n }\n return tensor;\n }\n\n toCanvas() {\n if (!BROWSER_ENV) {\n throw new Error('toCanvas() is only supported in browser environments.')\n }\n\n // Clone, and convert data to RGBA before drawing to canvas.\n // This is because the canvas API only supports RGBA\n let cloned = this.clone().rgba();\n\n // Create canvas object for the cloned image\n let clonedCanvas = createCanvasFunction(cloned.width, cloned.height);\n\n // Draw image to context\n let data = new ImageDataClass(cloned.data, cloned.width, cloned.height);\n clonedCanvas.getContext('2d').putImageData(data, 0, 0);\n\n return clonedCanvas;\n }\n\n /**\n * Helper method to update the image data.\n * @param {Uint8ClampedArray} data The new image data.\n * @param {number} width The new width of the image.\n * @param {number} height The new height of the image.\n * @param {1|2|3|4|null} [channels] The new number of channels of the image.\n * @private\n */\n _update(data, width, height, channels = null) {\n this.data = data;\n this.width = width;\n this.height = height;\n if (channels !== null) {\n this.channels = channels;\n }\n return this;\n }\n\n /**\n * Clone the image\n * @returns {RawImage} The cloned image\n */\n clone() {\n return new RawImage(this.data.slice(), this.width, this.height, this.channels);\n }\n\n /**\n * Helper method for converting image to have a certain number of channels\n * @param {number} numChannels The number of channels. Must be 1, 3, or 4.\n * @returns {RawImage} `this` to support chaining.\n */\n convert(numChannels) {\n if (this.channels === numChannels) return this; // Already correct number of channels\n\n switch (numChannels) {\n case 1:\n this.grayscale();\n break;\n case 3:\n this.rgb();\n break;\n case 4:\n this.rgba();\n break;\n default:\n throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`);\n }\n return this;\n }\n\n /**\n * Save the image to the given path.\n * @param {string} path The path to save the image to.\n */\n async save(path) {\n\n if (BROWSER_ENV) {\n if (WEBWORKER_ENV) {\n throw new Error('Unable to save an image from a Web Worker.')\n }\n\n const extension = path.split('.').pop().toLowerCase();\n const mime = CONTENT_TYPE_MAP.get(extension) ?? 'image/png';\n\n // Convert image to Blob\n const blob = await this.toBlob(mime);\n\n // Convert the canvas content to a data URL\n const dataURL = URL.createObjectURL(blob);\n\n // Create an anchor element with the data URL as the href attribute\n const downloadLink = document.createElement('a');\n downloadLink.href = dataURL;\n\n // Set the download attribute to specify the desired filename for the downloaded image\n downloadLink.download = path;\n\n // Trigger the download\n downloadLink.click();\n\n // Clean up: remove the anchor element from the DOM\n downloadLink.remove();\n\n } else if (!_env_js__WEBPACK_IMPORTED_MODULE_1__.env.useFS) {\n throw new Error('Unable to save the image because filesystem is disabled in this environment.')\n\n } else {\n const img = this.toSharp();\n return await img.toFile(path);\n }\n }\n\n toSharp() {\n if (BROWSER_ENV) {\n throw new Error('toSharp() is only supported in server-side environments.')\n }\n\n return sharp__WEBPACK_IMPORTED_MODULE_3__(this.data, {\n raw: {\n width: this.width,\n height: this.height,\n channels: this.channels\n }\n });\n }\n}\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/utils/image.js?"); /***/ }), @@ -425,7 +3757,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FFT: () => (/* binding */ FFT),\n/* harmony export */ cos_sim: () => (/* binding */ cos_sim),\n/* harmony export */ dot: () => (/* binding */ dot),\n/* harmony export */ getTopItems: () => (/* binding */ getTopItems),\n/* harmony export */ interpolate_data: () => (/* binding */ interpolate_data),\n/* harmony export */ log_softmax: () => (/* binding */ log_softmax),\n/* harmony export */ magnitude: () => (/* binding */ magnitude),\n/* harmony export */ max: () => (/* binding */ max),\n/* harmony export */ medianFilter: () => (/* binding */ medianFilter),\n/* harmony export */ min: () => (/* binding */ min),\n/* harmony export */ round: () => (/* binding */ round),\n/* harmony export */ softmax: () => (/* binding */ softmax),\n/* harmony export */ transpose_data: () => (/* binding */ transpose_data)\n/* harmony export */ });\n\n/**\n * @file Helper module for mathematical processing. \n * \n * These functions and classes are only used internally, \n * meaning an end-user shouldn't need to access anything here.\n * \n * @module utils/maths\n */\n\n/**\n * @typedef {Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array} TypedArray\n * @typedef {BigInt64Array | BigUint64Array} BigTypedArray\n * @typedef {TypedArray | BigTypedArray} AnyTypedArray\n */\n\n/**\n * @param {TypedArray} input\n */\nfunction interpolate_data(input, [in_channels, in_height, in_width], [out_height, out_width], mode = 'bilinear', align_corners = false) {\n // TODO use mode and align_corners\n\n // Output image dimensions\n const x_scale = out_width / in_width;\n const y_scale = out_height / in_height;\n\n // Output image\n // @ts-ignore\n const out_img = new input.constructor(out_height * out_width * in_channels);\n\n // Pre-calculate strides\n const inStride = in_height * in_width;\n const outStride = out_height * out_width;\n\n for (let i = 0; i < out_height; ++i) {\n for (let j = 0; j < out_width; ++j) {\n // Calculate output offset\n const outOffset = i * out_width + j;\n\n // Calculate input pixel coordinates\n const x = (j + 0.5) / x_scale - 0.5;\n const y = (i + 0.5) / y_scale - 0.5;\n\n // Calculate the four nearest input pixels\n // We also check if the input pixel coordinates are within the image bounds\n let x1 = Math.floor(x);\n let y1 = Math.floor(y);\n const x2 = Math.min(x1 + 1, in_width - 1);\n const y2 = Math.min(y1 + 1, in_height - 1);\n\n x1 = Math.max(x1, 0);\n y1 = Math.max(y1, 0);\n\n\n // Calculate the fractional distances between the input pixel and the four nearest pixels\n const s = x - x1;\n const t = y - y1;\n\n // Perform bilinear interpolation\n const w1 = (1 - s) * (1 - t);\n const w2 = s * (1 - t);\n const w3 = (1 - s) * t;\n const w4 = s * t;\n\n // Calculate the four nearest input pixel indices\n const yStride = y1 * in_width;\n const xStride = y2 * in_width;\n const idx1 = yStride + x1;\n const idx2 = yStride + x2;\n const idx3 = xStride + x1;\n const idx4 = xStride + x2;\n\n for (let k = 0; k < in_channels; ++k) {\n // Calculate channel offset\n const cOffset = k * inStride;\n\n out_img[k * outStride + outOffset] =\n w1 * input[cOffset + idx1] +\n w2 * input[cOffset + idx2] +\n w3 * input[cOffset + idx3] +\n w4 * input[cOffset + idx4];\n }\n }\n }\n\n return out_img;\n}\n\n\n/**\n * Helper method to transpose a `AnyTypedArray` directly\n * @template {AnyTypedArray} T \n * @param {T} array \n * @param {number[]} dims \n * @param {number[]} axes \n * @returns {[T, number[]]} The transposed array and the new shape.\n */\nfunction transpose_data(array, dims, axes) {\n // Calculate the new shape of the transposed array\n // and the stride of the original array\n const shape = new Array(axes.length);\n const stride = new Array(axes.length);\n\n for (let i = axes.length - 1, s = 1; i >= 0; --i) {\n stride[i] = s;\n shape[i] = dims[axes[i]];\n s *= shape[i];\n }\n\n // Precompute inverse mapping of stride\n const invStride = axes.map((_, i) => stride[axes.indexOf(i)]);\n\n // Create the transposed array with the new shape\n // @ts-ignore\n const transposedData = new array.constructor(array.length);\n\n // Transpose the original array to the new array\n for (let i = 0; i < array.length; ++i) {\n let newIndex = 0;\n for (let j = dims.length - 1, k = i; j >= 0; --j) {\n newIndex += (k % dims[j]) * invStride[j];\n k = Math.floor(k / dims[j]);\n }\n transposedData[newIndex] = array[i];\n }\n\n return [transposedData, shape];\n}\n\n\n/**\n * Compute the softmax of an array of numbers.\n * @template {TypedArray|number[]} T\n * @param {T} arr The array of numbers to compute the softmax of.\n * @returns {T} The softmax array.\n */\nfunction softmax(arr) {\n // Compute the maximum value in the array\n const maxVal = max(arr)[0];\n\n // Compute the exponentials of the array values\n const exps = arr.map(x => Math.exp(x - maxVal));\n\n // Compute the sum of the exponentials\n // @ts-ignore\n const sumExps = exps.reduce((acc, val) => acc + val, 0);\n\n // Compute the softmax values\n const softmaxArr = exps.map(x => x / sumExps);\n\n return /** @type {T} */(softmaxArr);\n}\n\n/**\n * Calculates the logarithm of the softmax function for the input array.\n * @template {TypedArray|number[]} T\n * @param {T} arr The input array to calculate the log_softmax function for.\n * @returns {T} The resulting log_softmax array.\n */\nfunction log_softmax(arr) {\n // Compute the softmax values\n const softmaxArr = softmax(arr);\n\n // Apply log formula to each element\n const logSoftmaxArr = softmaxArr.map(x => Math.log(x));\n\n return /** @type {T} */(logSoftmaxArr);\n}\n\n/**\n * Calculates the dot product of two arrays.\n * @param {number[]} arr1 The first array.\n * @param {number[]} arr2 The second array.\n * @returns {number} The dot product of arr1 and arr2.\n */\nfunction dot(arr1, arr2) {\n return arr1.reduce((acc, val, i) => acc + val * arr2[i], 0);\n}\n\n\n/**\n * Get the top k items from an iterable, sorted by descending order\n * @param {any[]|TypedArray} items The items to be sorted\n * @param {number|null} [top_k=0] The number of top items to return (default: 0 = return all)\n * @returns {[number, any][]} The top k items, sorted by descending order\n */\nfunction getTopItems(items, top_k = 0) {\n // if top == 0, return all\n\n items = Array.from(items)\n .map((x, i) => [i, x]) // Get indices ([index, score])\n .sort((a, b) => b[1] - a[1]) // Sort by log probabilities\n\n if (top_k !== null && top_k > 0) {\n items = items.slice(0, top_k); // Get top k items\n }\n\n return items\n}\n\n/**\n * Computes the cosine similarity between two arrays.\n *\n * @param {number[]} arr1 The first array.\n * @param {number[]} arr2 The second array.\n * @returns {number} The cosine similarity between the two arrays.\n */\nfunction cos_sim(arr1, arr2) {\n // Calculate dot product of the two arrays\n const dotProduct = dot(arr1, arr2);\n\n // Calculate the magnitude of the first array\n const magnitudeA = magnitude(arr1);\n\n // Calculate the magnitude of the second array\n const magnitudeB = magnitude(arr2);\n\n // Calculate the cosine similarity\n const cosineSimilarity = dotProduct / (magnitudeA * magnitudeB);\n\n return cosineSimilarity;\n}\n\n/**\n * Calculates the magnitude of a given array.\n * @param {number[]} arr The array to calculate the magnitude of.\n * @returns {number} The magnitude of the array.\n */\nfunction magnitude(arr) {\n return Math.sqrt(arr.reduce((acc, val) => acc + val * val, 0));\n}\n\n\n/**\n * Returns the value and index of the minimum element in an array.\n * @param {number[]|TypedArray} arr array of numbers.\n * @returns {number[]} the value and index of the minimum element, of the form: [valueOfMin, indexOfMin]\n * @throws {Error} If array is empty.\n */\nfunction min(arr) {\n if (arr.length === 0) throw Error('Array must not be empty');\n let min = arr[0];\n let indexOfMin = 0;\n for (let i = 1; i < arr.length; ++i) {\n if (arr[i] < min) {\n min = arr[i];\n indexOfMin = i;\n }\n }\n return [min, indexOfMin];\n}\n\n\n/**\n * Returns the value and index of the maximum element in an array.\n * @param {number[]|AnyTypedArray} arr array of numbers.\n * @returns {[number, number]} the value and index of the maximum element, of the form: [valueOfMax, indexOfMax]\n * @throws {Error} If array is empty.\n */\nfunction max(arr) {\n if (arr.length === 0) throw Error('Array must not be empty');\n let max = arr[0];\n let indexOfMax = 0;\n for (let i = 1; i < arr.length; ++i) {\n if (arr[i] > max) {\n max = arr[i];\n indexOfMax = i;\n }\n }\n return [Number(max), indexOfMax];\n}\n\nfunction isPowerOfTwo(number) {\n // Check if the number is greater than 0 and has only one bit set to 1\n return (number > 0) && ((number & (number - 1)) === 0);\n}\n\n/**\n * Implementation of Radix-4 FFT.\n * \n * P2FFT class provides functionality for performing Fast Fourier Transform on arrays\n * which are a power of two in length.\n * Code adapted from https://www.npmjs.com/package/fft.js\n */\nclass P2FFT {\n /**\n * @param {number} size The size of the input array. Must be a power of two larger than 1.\n * @throws {Error} FFT size must be a power of two larger than 1.\n */\n constructor(size) {\n this.size = size | 0; // convert to a 32-bit signed integer\n if (this.size <= 1 || !isPowerOfTwo(this.size))\n throw new Error('FFT size must be a power of two larger than 1');\n\n this._csize = size << 1;\n\n this.table = new Float64Array(this.size * 2);\n for (let i = 0; i < this.table.length; i += 2) {\n const angle = Math.PI * i / this.size;\n this.table[i] = Math.cos(angle);\n this.table[i + 1] = -Math.sin(angle);\n }\n\n // Find size's power of two\n let power = 0;\n for (let t = 1; this.size > t; t <<= 1)\n ++power;\n\n // Calculate initial step's width:\n // * If we are full radix-4, it is 2x smaller to give inital len=8\n // * Otherwise it is the same as `power` to give len=4\n this._width = power % 2 === 0 ? power - 1 : power;\n\n // Pre-compute bit-reversal patterns\n this._bitrev = new Int32Array(1 << this._width);\n for (let j = 0; j < this._bitrev.length; ++j) {\n this._bitrev[j] = 0;\n for (let shift = 0; shift < this._width; shift += 2) {\n const revShift = this._width - shift - 2;\n this._bitrev[j] |= ((j >>> shift) & 3) << revShift;\n }\n }\n }\n\n /**\n * Create a complex number array with size `2 * size`\n *\n * @returns {Float64Array} A complex number array with size `2 * size`\n */\n createComplexArray() {\n return new Float64Array(this._csize);\n }\n\n /**\n * Converts a complex number representation stored in a Float64Array to an array of real numbers.\n * \n * @param {Float64Array} complex The complex number representation to be converted.\n * @param {number[]} [storage] An optional array to store the result in.\n * @returns {number[]} An array of real numbers representing the input complex number representation.\n */\n fromComplexArray(complex, storage) {\n const res = storage || new Array(complex.length >>> 1);\n for (let i = 0; i < complex.length; i += 2)\n res[i >>> 1] = complex[i];\n return res;\n }\n\n /**\n * Convert a real-valued input array to a complex-valued output array.\n * @param {Float64Array} input The real-valued input array.\n * @param {Float64Array} [storage] Optional buffer to store the output array.\n * @returns {Float64Array} The complex-valued output array.\n */\n toComplexArray(input, storage) {\n const res = storage || this.createComplexArray();\n for (let i = 0; i < res.length; i += 2) {\n res[i] = input[i >>> 1];\n res[i + 1] = 0;\n }\n return res;\n }\n\n /**\n * Completes the spectrum by adding its mirrored negative frequency components.\n * @param {Float64Array} spectrum The input spectrum.\n * @returns {void}\n */\n completeSpectrum(spectrum) {\n const size = this._csize;\n const half = size >>> 1;\n for (let i = 2; i < half; i += 2) {\n spectrum[size - i] = spectrum[i];\n spectrum[size - i + 1] = -spectrum[i + 1];\n }\n }\n\n /**\n * Performs a Fast Fourier Transform (FFT) on the given input data and stores the result in the output buffer.\n * \n * @param {Float64Array} out The output buffer to store the result.\n * @param {Float64Array} data The input data to transform.\n * \n * @throws {Error} Input and output buffers must be different.\n * \n * @returns {void}\n */\n transform(out, data) {\n if (out === data)\n throw new Error('Input and output buffers must be different');\n\n this._transform4(out, data, 1 /* DONE */);\n }\n\n /**\n * Performs a real-valued forward FFT on the given input buffer and stores the result in the given output buffer.\n * The input buffer must contain real values only, while the output buffer will contain complex values. The input and\n * output buffers must be different.\n *\n * @param {Float64Array} out The output buffer.\n * @param {Float64Array} data The input buffer containing real values.\n *\n * @throws {Error} If the input and output buffers are the same.\n */\n realTransform(out, data) {\n if (out === data)\n throw new Error('Input and output buffers must be different');\n\n this._realTransform4(out, data, 1 /* DONE */);\n }\n\n /**\n * Performs an inverse FFT transformation on the given `data` array, and stores the result in `out`.\n * The `out` array must be a different buffer than the `data` array. The `out` array will contain the\n * result of the transformation. The `data` array will not be modified.\n * \n * @param {Float64Array} out The output buffer for the transformed data.\n * @param {Float64Array} data The input data to transform.\n * @throws {Error} If `out` and `data` refer to the same buffer.\n * @returns {void}\n */\n inverseTransform(out, data) {\n if (out === data)\n throw new Error('Input and output buffers must be different');\n\n this._transform4(out, data, -1 /* DONE */);\n for (let i = 0; i < out.length; ++i)\n out[i] /= this.size;\n }\n\n /**\n * Performs a radix-4 implementation of a discrete Fourier transform on a given set of data.\n *\n * @param {Float64Array} out The output buffer for the transformed data.\n * @param {Float64Array} data The input buffer of data to be transformed.\n * @param {number} inv A scaling factor to apply to the transform.\n * @returns {void}\n */\n _transform4(out, data, inv) {\n // radix-4 implementation\n\n const size = this._csize;\n\n // Initial step (permute and transform)\n const width = this._width;\n let step = 1 << width;\n let len = (size / step) << 1;\n\n let outOff;\n let t;\n const bitrev = this._bitrev;\n if (len === 4) {\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\n const off = bitrev[t];\n this._singleTransform2(data, out, outOff, off, step);\n }\n } else {\n // len === 8\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\n const off = bitrev[t];\n this._singleTransform4(data, out, outOff, off, step, inv);\n }\n }\n\n // Loop through steps in decreasing order\n for (step >>= 2; step >= 2; step >>= 2) {\n len = (size / step) << 1;\n const quarterLen = len >>> 2;\n\n // Loop through offsets in the data\n for (outOff = 0; outOff < size; outOff += len) {\n // Full case\n const limit = outOff + quarterLen - 1;\n for (let i = outOff, k = 0; i < limit; i += 2, k += step) {\n const A = i;\n const B = A + quarterLen;\n const C = B + quarterLen;\n const D = C + quarterLen;\n\n // Original values\n const Ar = out[A];\n const Ai = out[A + 1];\n const Br = out[B];\n const Bi = out[B + 1];\n const Cr = out[C];\n const Ci = out[C + 1];\n const Dr = out[D];\n const Di = out[D + 1];\n\n const tableBr = this.table[k];\n const tableBi = inv * this.table[k + 1];\n const MBr = Br * tableBr - Bi * tableBi;\n const MBi = Br * tableBi + Bi * tableBr;\n\n const tableCr = this.table[2 * k];\n const tableCi = inv * this.table[2 * k + 1];\n const MCr = Cr * tableCr - Ci * tableCi;\n const MCi = Cr * tableCi + Ci * tableCr;\n\n const tableDr = this.table[3 * k];\n const tableDi = inv * this.table[3 * k + 1];\n const MDr = Dr * tableDr - Di * tableDi;\n const MDi = Dr * tableDi + Di * tableDr;\n\n // Pre-Final values\n const T0r = Ar + MCr;\n const T0i = Ai + MCi;\n const T1r = Ar - MCr;\n const T1i = Ai - MCi;\n const T2r = MBr + MDr;\n const T2i = MBi + MDi;\n const T3r = inv * (MBr - MDr);\n const T3i = inv * (MBi - MDi);\n\n // Final values\n out[A] = T0r + T2r;\n out[A + 1] = T0i + T2i;\n out[B] = T1r + T3i;\n out[B + 1] = T1i - T3r;\n out[C] = T0r - T2r;\n out[C + 1] = T0i - T2i;\n out[D] = T1r - T3i;\n out[D + 1] = T1i + T3r;\n }\n }\n }\n }\n\n /**\n * Performs a radix-2 implementation of a discrete Fourier transform on a given set of data.\n *\n * @param {Float64Array} data The input buffer of data to be transformed.\n * @param {Float64Array} out The output buffer for the transformed data.\n * @param {number} outOff The offset at which to write the output data.\n * @param {number} off The offset at which to begin reading the input data.\n * @param {number} step The step size for indexing the input data.\n * @returns {void}\n */\n _singleTransform2(data, out, outOff, off, step) {\n // radix-2 implementation\n // NOTE: Only called for len=4\n\n const evenR = data[off];\n const evenI = data[off + 1];\n const oddR = data[off + step];\n const oddI = data[off + step + 1];\n\n out[outOff] = evenR + oddR;\n out[outOff + 1] = evenI + oddI;\n out[outOff + 2] = evenR - oddR;\n out[outOff + 3] = evenI - oddI;\n }\n\n /**\n * Performs radix-4 transformation on input data of length 8\n *\n * @param {Float64Array} data Input data array of length 8\n * @param {Float64Array} out Output data array of length 8\n * @param {number} outOff Index of output array to start writing from\n * @param {number} off Index of input array to start reading from\n * @param {number} step Step size between elements in input array\n * @param {number} inv Scaling factor for inverse transform\n * \n * @returns {void}\n */\n _singleTransform4(data, out, outOff, off, step, inv) {\n // radix-4\n // NOTE: Only called for len=8\n const step2 = step * 2;\n const step3 = step * 3;\n\n // Original values\n const Ar = data[off];\n const Ai = data[off + 1];\n const Br = data[off + step];\n const Bi = data[off + step + 1];\n const Cr = data[off + step2];\n const Ci = data[off + step2 + 1];\n const Dr = data[off + step3];\n const Di = data[off + step3 + 1];\n\n // Pre-Final values\n const T0r = Ar + Cr;\n const T0i = Ai + Ci;\n const T1r = Ar - Cr;\n const T1i = Ai - Ci;\n const T2r = Br + Dr;\n const T2i = Bi + Di;\n const T3r = inv * (Br - Dr);\n const T3i = inv * (Bi - Di);\n\n // Final values\n out[outOff] = T0r + T2r;\n out[outOff + 1] = T0i + T2i;\n out[outOff + 2] = T1r + T3i;\n out[outOff + 3] = T1i - T3r;\n out[outOff + 4] = T0r - T2r;\n out[outOff + 5] = T0i - T2i;\n out[outOff + 6] = T1r - T3i;\n out[outOff + 7] = T1i + T3r;\n }\n\n /**\n * Real input radix-4 implementation\n * @param {Float64Array} out Output array for the transformed data\n * @param {Float64Array} data Input array of real data to be transformed\n * @param {number} inv The scale factor used to normalize the inverse transform\n */\n _realTransform4(out, data, inv) {\n // Real input radix-4 implementation\n const size = this._csize;\n\n // Initial step (permute and transform)\n const width = this._width;\n let step = 1 << width;\n let len = (size / step) << 1;\n\n let outOff;\n let t;\n const bitrev = this._bitrev;\n if (len === 4) {\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\n const off = bitrev[t];\n this._singleRealTransform2(data, out, outOff, off >>> 1, step >>> 1);\n }\n } else {\n // len === 8\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\n const off = bitrev[t];\n this._singleRealTransform4(data, out, outOff, off >>> 1, step >>> 1, inv);\n }\n }\n\n // TODO: Optimize once https://github.com/indutny/fft.js/issues/25 is fixed\n // Loop through steps in decreasing order\n for (step >>= 2; step >= 2; step >>= 2) {\n len = (size / step) << 1;\n const quarterLen = len >>> 2;\n\n // Loop through offsets in the data\n for (outOff = 0; outOff < size; outOff += len) {\n // Full case\n const limit = outOff + quarterLen - 1;\n for (let i = outOff, k = 0; i < limit; i += 2, k += step) {\n const A = i;\n const B = A + quarterLen;\n const C = B + quarterLen;\n const D = C + quarterLen;\n\n // Original values\n const Ar = out[A];\n const Ai = out[A + 1];\n const Br = out[B];\n const Bi = out[B + 1];\n const Cr = out[C];\n const Ci = out[C + 1];\n const Dr = out[D];\n const Di = out[D + 1];\n\n const tableBr = this.table[k];\n const tableBi = inv * this.table[k + 1];\n const MBr = Br * tableBr - Bi * tableBi;\n const MBi = Br * tableBi + Bi * tableBr;\n\n const tableCr = this.table[2 * k];\n const tableCi = inv * this.table[2 * k + 1];\n const MCr = Cr * tableCr - Ci * tableCi;\n const MCi = Cr * tableCi + Ci * tableCr;\n\n const tableDr = this.table[3 * k];\n const tableDi = inv * this.table[3 * k + 1];\n const MDr = Dr * tableDr - Di * tableDi;\n const MDi = Dr * tableDi + Di * tableDr;\n\n // Pre-Final values\n const T0r = Ar + MCr;\n const T0i = Ai + MCi;\n const T1r = Ar - MCr;\n const T1i = Ai - MCi;\n const T2r = MBr + MDr;\n const T2i = MBi + MDi;\n const T3r = inv * (MBr - MDr);\n const T3i = inv * (MBi - MDi);\n\n // Final values\n out[A] = T0r + T2r;\n out[A + 1] = T0i + T2i;\n out[B] = T1r + T3i;\n out[B + 1] = T1i - T3r;\n out[C] = T0r - T2r;\n out[C + 1] = T0i - T2i;\n out[D] = T1r - T3i;\n out[D + 1] = T1i + T3r;\n }\n }\n }\n }\n\n /**\n * Performs a single real input radix-2 transformation on the provided data\n * \n * @param {Float64Array} data The input data array\n * @param {Float64Array} out The output data array\n * @param {number} outOff The output offset\n * @param {number} off The input offset\n * @param {number} step The step\n * \n * @returns {void}\n */\n _singleRealTransform2(data, out, outOff, off, step) {\n // radix-2 implementation\n // NOTE: Only called for len=4\n\n const evenR = data[off];\n const oddR = data[off + step];\n\n out[outOff] = evenR + oddR;\n out[outOff + 1] = 0;\n out[outOff + 2] = evenR - oddR;\n out[outOff + 3] = 0;\n }\n\n /**\n * Computes a single real-valued transform using radix-4 algorithm.\n * This method is only called for len=8.\n *\n * @param {Float64Array} data The input data array.\n * @param {Float64Array} out The output data array.\n * @param {number} outOff The offset into the output array.\n * @param {number} off The offset into the input array.\n * @param {number} step The step size for the input array.\n * @param {number} inv The value of inverse.\n */\n _singleRealTransform4(data, out, outOff, off, step, inv) {\n // radix-4\n // NOTE: Only called for len=8\n const step2 = step * 2;\n const step3 = step * 3;\n\n // Original values\n const Ar = data[off];\n const Br = data[off + step];\n const Cr = data[off + step2];\n const Dr = data[off + step3];\n\n // Pre-Final values\n const T0r = Ar + Cr;\n const T1r = Ar - Cr;\n const T2r = Br + Dr;\n const T3r = inv * (Br - Dr);\n\n // Final values\n out[outOff] = T0r + T2r;\n out[outOff + 1] = 0;\n out[outOff + 2] = T1r;\n out[outOff + 3] = -T3r;\n out[outOff + 4] = T0r - T2r;\n out[outOff + 5] = 0;\n out[outOff + 6] = T1r;\n out[outOff + 7] = T3r;\n }\n}\n\n/**\n * NP2FFT class provides functionality for performing Fast Fourier Transform on arrays\n * which are not a power of two in length. In such cases, the chirp-z transform is used.\n * \n * For more information, see: https://math.stackexchange.com/questions/77118/non-power-of-2-ffts/77156#77156\n */\nclass NP2FFT {\n\n /**\n * Constructs a new NP2FFT object.\n * @param {number} fft_length The length of the FFT\n */\n constructor(fft_length) {\n // Helper variables\n const a = 2 * (fft_length - 1);\n const b = 2 * (2 * fft_length - 1);\n const nextP2 = 2 ** (Math.ceil(Math.log2(b)))\n this.bufferSize = nextP2;\n this._a = a;\n\n // Define buffers\n // Compute chirp for transform\n const chirp = new Float64Array(b);\n const ichirp = new Float64Array(nextP2);\n this._chirpBuffer = new Float64Array(nextP2);\n this._buffer1 = new Float64Array(nextP2);\n this._buffer2 = new Float64Array(nextP2);\n this._outBuffer1 = new Float64Array(nextP2);\n this._outBuffer2 = new Float64Array(nextP2);\n\n // Compute complex exponentiation\n const theta = -2 * Math.PI / fft_length;\n const baseR = Math.cos(theta);\n const baseI = Math.sin(theta);\n\n // Precompute helper for chirp-z transform\n for (let i = 0; i < b >> 1; ++i) {\n // Compute complex power:\n const e = (i + 1 - fft_length) ** 2 / 2.0;\n\n // Compute the modulus and argument of the result\n const result_mod = Math.sqrt(baseR ** 2 + baseI ** 2) ** e;\n const result_arg = e * Math.atan2(baseI, baseR);\n\n // Convert the result back to rectangular form\n // and assign to chirp and ichirp\n const i2 = 2 * i;\n chirp[i2] = result_mod * Math.cos(result_arg);\n chirp[i2 + 1] = result_mod * Math.sin(result_arg);\n\n // conjugate\n ichirp[i2] = chirp[i2];\n ichirp[i2 + 1] = - chirp[i2 + 1];\n }\n this._slicedChirpBuffer = chirp.subarray(a, b);\n\n // create object to perform Fast Fourier Transforms\n // with `nextP2` complex numbers\n this._f = new P2FFT(nextP2 >> 1);\n this._f.transform(this._chirpBuffer, ichirp);\n }\n\n _transform(output, input, real) {\n const ib1 = this._buffer1;\n const ib2 = this._buffer2;\n const ob2 = this._outBuffer1;\n const ob3 = this._outBuffer2;\n const cb = this._chirpBuffer;\n const sb = this._slicedChirpBuffer;\n const a = this._a;\n\n if (real) {\n // Real multiplication\n for (let j = 0; j < sb.length; j += 2) {\n const j2 = j + 1\n const j3 = j >> 1;\n\n const a_real = input[j3];\n ib1[j] = a_real * sb[j];\n ib1[j2] = a_real * sb[j2];\n }\n } else {\n // Complex multiplication\n for (let j = 0; j < sb.length; j += 2) {\n const j2 = j + 1\n ib1[j] = input[j] * sb[j] - input[j2] * sb[j2];\n ib1[j2] = input[j] * sb[j2] + input[j2] * sb[j];\n }\n }\n this._f.transform(ob2, ib1);\n\n for (let j = 0; j < cb.length; j += 2) {\n const j2 = j + 1;\n\n ib2[j] = ob2[j] * cb[j] - ob2[j2] * cb[j2];\n ib2[j2] = ob2[j] * cb[j2] + ob2[j2] * cb[j];\n }\n this._f.inverseTransform(ob3, ib2);\n\n for (let j = 0; j < ob3.length; j += 2) {\n const a_real = ob3[j + a];\n const a_imag = ob3[j + a + 1];\n const b_real = sb[j];\n const b_imag = sb[j + 1];\n\n output[j] = a_real * b_real - a_imag * b_imag;\n output[j + 1] = a_real * b_imag + a_imag * b_real;\n }\n }\n\n transform(output, input) {\n this._transform(output, input, false);\n }\n\n realTransform(output, input) {\n this._transform(output, input, true);\n }\n}\n\nclass FFT {\n constructor(fft_length) {\n this.fft_length = fft_length;\n this.isPowerOfTwo = isPowerOfTwo(fft_length);\n if (this.isPowerOfTwo) {\n this.fft = new P2FFT(fft_length);\n this.outputBufferSize = 2 * fft_length;\n } else {\n this.fft = new NP2FFT(fft_length);\n this.outputBufferSize = this.fft.bufferSize;\n }\n }\n\n realTransform(out, input) {\n this.fft.realTransform(out, input);\n }\n\n transform(out, input) {\n this.fft.transform(out, input);\n }\n}\n\n\n/**\n * Performs median filter on the provided data. Padding is done by mirroring the data.\n * @param {AnyTypedArray} data The input array\n * @param {number} windowSize The window size\n */\nfunction medianFilter(data, windowSize) {\n\n if (windowSize % 2 === 0 || windowSize <= 0) {\n throw new Error('Window size must be a positive odd number');\n }\n\n // @ts-ignore\n const outputArray = new data.constructor(data.length);\n\n // @ts-ignore\n const buffer = new data.constructor(windowSize); // Reusable array for storing values\n\n const halfWindowSize = Math.floor(windowSize / 2);\n\n for (let i = 0; i < data.length; ++i) {\n let valuesIndex = 0;\n\n for (let j = -halfWindowSize; j <= halfWindowSize; ++j) {\n let index = i + j;\n if (index < 0) {\n index = Math.abs(index);\n } else if (index >= data.length) {\n index = 2 * (data.length - 1) - index;\n }\n\n buffer[valuesIndex++] = data[index];\n }\n\n buffer.sort();\n outputArray[i] = buffer[halfWindowSize];\n }\n\n return outputArray;\n}\n\n/**\n * Helper function to round a number to a given number of decimals\n * @param {number} num The number to round\n * @param {number} decimals The number of decimals\n * @returns {number} The rounded number\n */\nfunction round(num, decimals) {\n const pow = Math.pow(10, decimals);\n return Math.round(num * pow) / pow;\n}\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/utils/maths.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FFT: () => (/* binding */ FFT),\n/* harmony export */ bankers_round: () => (/* binding */ bankers_round),\n/* harmony export */ cos_sim: () => (/* binding */ cos_sim),\n/* harmony export */ dot: () => (/* binding */ dot),\n/* harmony export */ getTopItems: () => (/* binding */ getTopItems),\n/* harmony export */ interpolate_data: () => (/* binding */ interpolate_data),\n/* harmony export */ log_softmax: () => (/* binding */ log_softmax),\n/* harmony export */ magnitude: () => (/* binding */ magnitude),\n/* harmony export */ max: () => (/* binding */ max),\n/* harmony export */ medianFilter: () => (/* binding */ medianFilter),\n/* harmony export */ min: () => (/* binding */ min),\n/* harmony export */ permute_data: () => (/* binding */ permute_data),\n/* harmony export */ round: () => (/* binding */ round),\n/* harmony export */ softmax: () => (/* binding */ softmax)\n/* harmony export */ });\n\n/**\n * @file Helper module for mathematical processing. \n * \n * These functions and classes are only used internally, \n * meaning an end-user shouldn't need to access anything here.\n * \n * @module utils/maths\n */\n\n/**\n * @typedef {Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array} TypedArray\n * @typedef {BigInt64Array | BigUint64Array} BigTypedArray\n * @typedef {TypedArray | BigTypedArray} AnyTypedArray\n */\n\n/**\n * @param {TypedArray} input\n */\nfunction interpolate_data(input, [in_channels, in_height, in_width], [out_height, out_width], mode = 'bilinear', align_corners = false) {\n // TODO use mode and align_corners\n\n // Output image dimensions\n const x_scale = out_width / in_width;\n const y_scale = out_height / in_height;\n\n // Output image\n // @ts-ignore\n const out_img = new input.constructor(out_height * out_width * in_channels);\n\n // Pre-calculate strides\n const inStride = in_height * in_width;\n const outStride = out_height * out_width;\n\n for (let i = 0; i < out_height; ++i) {\n for (let j = 0; j < out_width; ++j) {\n // Calculate output offset\n const outOffset = i * out_width + j;\n\n // Calculate input pixel coordinates\n const x = (j + 0.5) / x_scale - 0.5;\n const y = (i + 0.5) / y_scale - 0.5;\n\n // Calculate the four nearest input pixels\n // We also check if the input pixel coordinates are within the image bounds\n let x1 = Math.floor(x);\n let y1 = Math.floor(y);\n const x2 = Math.min(x1 + 1, in_width - 1);\n const y2 = Math.min(y1 + 1, in_height - 1);\n\n x1 = Math.max(x1, 0);\n y1 = Math.max(y1, 0);\n\n\n // Calculate the fractional distances between the input pixel and the four nearest pixels\n const s = x - x1;\n const t = y - y1;\n\n // Perform bilinear interpolation\n const w1 = (1 - s) * (1 - t);\n const w2 = s * (1 - t);\n const w3 = (1 - s) * t;\n const w4 = s * t;\n\n // Calculate the four nearest input pixel indices\n const yStride = y1 * in_width;\n const xStride = y2 * in_width;\n const idx1 = yStride + x1;\n const idx2 = yStride + x2;\n const idx3 = xStride + x1;\n const idx4 = xStride + x2;\n\n for (let k = 0; k < in_channels; ++k) {\n // Calculate channel offset\n const cOffset = k * inStride;\n\n out_img[k * outStride + outOffset] =\n w1 * input[cOffset + idx1] +\n w2 * input[cOffset + idx2] +\n w3 * input[cOffset + idx3] +\n w4 * input[cOffset + idx4];\n }\n }\n }\n\n return out_img;\n}\n\n\n/**\n * Helper method to permute a `AnyTypedArray` directly\n * @template {AnyTypedArray} T \n * @param {T} array \n * @param {number[]} dims \n * @param {number[]} axes \n * @returns {[T, number[]]} The permuted array and the new shape.\n */\nfunction permute_data(array, dims, axes) {\n // Calculate the new shape of the permuted array\n // and the stride of the original array\n const shape = new Array(axes.length);\n const stride = new Array(axes.length);\n\n for (let i = axes.length - 1, s = 1; i >= 0; --i) {\n stride[i] = s;\n shape[i] = dims[axes[i]];\n s *= shape[i];\n }\n\n // Precompute inverse mapping of stride\n const invStride = axes.map((_, i) => stride[axes.indexOf(i)]);\n\n // Create the permuted array with the new shape\n // @ts-ignore\n const permutedData = new array.constructor(array.length);\n\n // Permute the original array to the new array\n for (let i = 0; i < array.length; ++i) {\n let newIndex = 0;\n for (let j = dims.length - 1, k = i; j >= 0; --j) {\n newIndex += (k % dims[j]) * invStride[j];\n k = Math.floor(k / dims[j]);\n }\n permutedData[newIndex] = array[i];\n }\n\n return [permutedData, shape];\n}\n\n\n/**\n * Compute the softmax of an array of numbers.\n * @template {TypedArray|number[]} T\n * @param {T} arr The array of numbers to compute the softmax of.\n * @returns {T} The softmax array.\n */\nfunction softmax(arr) {\n // Compute the maximum value in the array\n const maxVal = max(arr)[0];\n\n // Compute the exponentials of the array values\n const exps = arr.map(x => Math.exp(x - maxVal));\n\n // Compute the sum of the exponentials\n // @ts-ignore\n const sumExps = exps.reduce((acc, val) => acc + val, 0);\n\n // Compute the softmax values\n const softmaxArr = exps.map(x => x / sumExps);\n\n return /** @type {T} */(softmaxArr);\n}\n\n/**\n * Calculates the logarithm of the softmax function for the input array.\n * @template {TypedArray|number[]} T\n * @param {T} arr The input array to calculate the log_softmax function for.\n * @returns {T} The resulting log_softmax array.\n */\nfunction log_softmax(arr) {\n // Compute the softmax values\n const softmaxArr = softmax(arr);\n\n // Apply log formula to each element\n const logSoftmaxArr = softmaxArr.map(x => Math.log(x));\n\n return /** @type {T} */(logSoftmaxArr);\n}\n\n/**\n * Calculates the dot product of two arrays.\n * @param {number[]} arr1 The first array.\n * @param {number[]} arr2 The second array.\n * @returns {number} The dot product of arr1 and arr2.\n */\nfunction dot(arr1, arr2) {\n return arr1.reduce((acc, val, i) => acc + val * arr2[i], 0);\n}\n\n\n/**\n * Get the top k items from an iterable, sorted by descending order\n * @param {any[]|TypedArray} items The items to be sorted\n * @param {number|null} [top_k=0] The number of top items to return (default: 0 = return all)\n * @returns {[number, any][]} The top k items, sorted by descending order\n */\nfunction getTopItems(items, top_k = 0) {\n // if top == 0, return all\n\n items = Array.from(items)\n .map((x, i) => [i, x]) // Get indices ([index, score])\n .sort((a, b) => b[1] - a[1]) // Sort by log probabilities\n\n if (top_k !== null && top_k > 0) {\n items = items.slice(0, top_k); // Get top k items\n }\n\n return items\n}\n\n/**\n * Computes the cosine similarity between two arrays.\n *\n * @param {number[]} arr1 The first array.\n * @param {number[]} arr2 The second array.\n * @returns {number} The cosine similarity between the two arrays.\n */\nfunction cos_sim(arr1, arr2) {\n // Calculate dot product of the two arrays\n const dotProduct = dot(arr1, arr2);\n\n // Calculate the magnitude of the first array\n const magnitudeA = magnitude(arr1);\n\n // Calculate the magnitude of the second array\n const magnitudeB = magnitude(arr2);\n\n // Calculate the cosine similarity\n const cosineSimilarity = dotProduct / (magnitudeA * magnitudeB);\n\n return cosineSimilarity;\n}\n\n/**\n * Calculates the magnitude of a given array.\n * @param {number[]} arr The array to calculate the magnitude of.\n * @returns {number} The magnitude of the array.\n */\nfunction magnitude(arr) {\n return Math.sqrt(arr.reduce((acc, val) => acc + val * val, 0));\n}\n\n\n/**\n * Returns the value and index of the minimum element in an array.\n * @param {number[]|TypedArray} arr array of numbers.\n * @returns {number[]} the value and index of the minimum element, of the form: [valueOfMin, indexOfMin]\n * @throws {Error} If array is empty.\n */\nfunction min(arr) {\n if (arr.length === 0) throw Error('Array must not be empty');\n let min = arr[0];\n let indexOfMin = 0;\n for (let i = 1; i < arr.length; ++i) {\n if (arr[i] < min) {\n min = arr[i];\n indexOfMin = i;\n }\n }\n return [min, indexOfMin];\n}\n\n\n/**\n * Returns the value and index of the maximum element in an array.\n * @param {number[]|AnyTypedArray} arr array of numbers.\n * @returns {[number, number]} the value and index of the maximum element, of the form: [valueOfMax, indexOfMax]\n * @throws {Error} If array is empty.\n */\nfunction max(arr) {\n if (arr.length === 0) throw Error('Array must not be empty');\n let max = arr[0];\n let indexOfMax = 0;\n for (let i = 1; i < arr.length; ++i) {\n if (arr[i] > max) {\n max = arr[i];\n indexOfMax = i;\n }\n }\n return [Number(max), indexOfMax];\n}\n\nfunction isPowerOfTwo(number) {\n // Check if the number is greater than 0 and has only one bit set to 1\n return (number > 0) && ((number & (number - 1)) === 0);\n}\n\n/**\n * Implementation of Radix-4 FFT.\n * \n * P2FFT class provides functionality for performing Fast Fourier Transform on arrays\n * which are a power of two in length.\n * Code adapted from https://www.npmjs.com/package/fft.js\n */\nclass P2FFT {\n /**\n * @param {number} size The size of the input array. Must be a power of two larger than 1.\n * @throws {Error} FFT size must be a power of two larger than 1.\n */\n constructor(size) {\n this.size = size | 0; // convert to a 32-bit signed integer\n if (this.size <= 1 || !isPowerOfTwo(this.size))\n throw new Error('FFT size must be a power of two larger than 1');\n\n this._csize = size << 1;\n\n this.table = new Float64Array(this.size * 2);\n for (let i = 0; i < this.table.length; i += 2) {\n const angle = Math.PI * i / this.size;\n this.table[i] = Math.cos(angle);\n this.table[i + 1] = -Math.sin(angle);\n }\n\n // Find size's power of two\n let power = 0;\n for (let t = 1; this.size > t; t <<= 1)\n ++power;\n\n // Calculate initial step's width:\n // * If we are full radix-4, it is 2x smaller to give inital len=8\n // * Otherwise it is the same as `power` to give len=4\n this._width = power % 2 === 0 ? power - 1 : power;\n\n // Pre-compute bit-reversal patterns\n this._bitrev = new Int32Array(1 << this._width);\n for (let j = 0; j < this._bitrev.length; ++j) {\n this._bitrev[j] = 0;\n for (let shift = 0; shift < this._width; shift += 2) {\n const revShift = this._width - shift - 2;\n this._bitrev[j] |= ((j >>> shift) & 3) << revShift;\n }\n }\n }\n\n /**\n * Create a complex number array with size `2 * size`\n *\n * @returns {Float64Array} A complex number array with size `2 * size`\n */\n createComplexArray() {\n return new Float64Array(this._csize);\n }\n\n /**\n * Converts a complex number representation stored in a Float64Array to an array of real numbers.\n * \n * @param {Float64Array} complex The complex number representation to be converted.\n * @param {number[]} [storage] An optional array to store the result in.\n * @returns {number[]} An array of real numbers representing the input complex number representation.\n */\n fromComplexArray(complex, storage) {\n const res = storage || new Array(complex.length >>> 1);\n for (let i = 0; i < complex.length; i += 2)\n res[i >>> 1] = complex[i];\n return res;\n }\n\n /**\n * Convert a real-valued input array to a complex-valued output array.\n * @param {Float64Array} input The real-valued input array.\n * @param {Float64Array} [storage] Optional buffer to store the output array.\n * @returns {Float64Array} The complex-valued output array.\n */\n toComplexArray(input, storage) {\n const res = storage || this.createComplexArray();\n for (let i = 0; i < res.length; i += 2) {\n res[i] = input[i >>> 1];\n res[i + 1] = 0;\n }\n return res;\n }\n\n /**\n * Completes the spectrum by adding its mirrored negative frequency components.\n * @param {Float64Array} spectrum The input spectrum.\n * @returns {void}\n */\n completeSpectrum(spectrum) {\n const size = this._csize;\n const half = size >>> 1;\n for (let i = 2; i < half; i += 2) {\n spectrum[size - i] = spectrum[i];\n spectrum[size - i + 1] = -spectrum[i + 1];\n }\n }\n\n /**\n * Performs a Fast Fourier Transform (FFT) on the given input data and stores the result in the output buffer.\n * \n * @param {Float64Array} out The output buffer to store the result.\n * @param {Float64Array} data The input data to transform.\n * \n * @throws {Error} Input and output buffers must be different.\n * \n * @returns {void}\n */\n transform(out, data) {\n if (out === data)\n throw new Error('Input and output buffers must be different');\n\n this._transform4(out, data, 1 /* DONE */);\n }\n\n /**\n * Performs a real-valued forward FFT on the given input buffer and stores the result in the given output buffer.\n * The input buffer must contain real values only, while the output buffer will contain complex values. The input and\n * output buffers must be different.\n *\n * @param {Float64Array} out The output buffer.\n * @param {Float64Array} data The input buffer containing real values.\n *\n * @throws {Error} If the input and output buffers are the same.\n */\n realTransform(out, data) {\n if (out === data)\n throw new Error('Input and output buffers must be different');\n\n this._realTransform4(out, data, 1 /* DONE */);\n }\n\n /**\n * Performs an inverse FFT transformation on the given `data` array, and stores the result in `out`.\n * The `out` array must be a different buffer than the `data` array. The `out` array will contain the\n * result of the transformation. The `data` array will not be modified.\n * \n * @param {Float64Array} out The output buffer for the transformed data.\n * @param {Float64Array} data The input data to transform.\n * @throws {Error} If `out` and `data` refer to the same buffer.\n * @returns {void}\n */\n inverseTransform(out, data) {\n if (out === data)\n throw new Error('Input and output buffers must be different');\n\n this._transform4(out, data, -1 /* DONE */);\n for (let i = 0; i < out.length; ++i)\n out[i] /= this.size;\n }\n\n /**\n * Performs a radix-4 implementation of a discrete Fourier transform on a given set of data.\n *\n * @param {Float64Array} out The output buffer for the transformed data.\n * @param {Float64Array} data The input buffer of data to be transformed.\n * @param {number} inv A scaling factor to apply to the transform.\n * @returns {void}\n */\n _transform4(out, data, inv) {\n // radix-4 implementation\n\n const size = this._csize;\n\n // Initial step (permute and transform)\n const width = this._width;\n let step = 1 << width;\n let len = (size / step) << 1;\n\n let outOff;\n let t;\n const bitrev = this._bitrev;\n if (len === 4) {\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\n const off = bitrev[t];\n this._singleTransform2(data, out, outOff, off, step);\n }\n } else {\n // len === 8\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\n const off = bitrev[t];\n this._singleTransform4(data, out, outOff, off, step, inv);\n }\n }\n\n // Loop through steps in decreasing order\n for (step >>= 2; step >= 2; step >>= 2) {\n len = (size / step) << 1;\n const quarterLen = len >>> 2;\n\n // Loop through offsets in the data\n for (outOff = 0; outOff < size; outOff += len) {\n // Full case\n const limit = outOff + quarterLen - 1;\n for (let i = outOff, k = 0; i < limit; i += 2, k += step) {\n const A = i;\n const B = A + quarterLen;\n const C = B + quarterLen;\n const D = C + quarterLen;\n\n // Original values\n const Ar = out[A];\n const Ai = out[A + 1];\n const Br = out[B];\n const Bi = out[B + 1];\n const Cr = out[C];\n const Ci = out[C + 1];\n const Dr = out[D];\n const Di = out[D + 1];\n\n const tableBr = this.table[k];\n const tableBi = inv * this.table[k + 1];\n const MBr = Br * tableBr - Bi * tableBi;\n const MBi = Br * tableBi + Bi * tableBr;\n\n const tableCr = this.table[2 * k];\n const tableCi = inv * this.table[2 * k + 1];\n const MCr = Cr * tableCr - Ci * tableCi;\n const MCi = Cr * tableCi + Ci * tableCr;\n\n const tableDr = this.table[3 * k];\n const tableDi = inv * this.table[3 * k + 1];\n const MDr = Dr * tableDr - Di * tableDi;\n const MDi = Dr * tableDi + Di * tableDr;\n\n // Pre-Final values\n const T0r = Ar + MCr;\n const T0i = Ai + MCi;\n const T1r = Ar - MCr;\n const T1i = Ai - MCi;\n const T2r = MBr + MDr;\n const T2i = MBi + MDi;\n const T3r = inv * (MBr - MDr);\n const T3i = inv * (MBi - MDi);\n\n // Final values\n out[A] = T0r + T2r;\n out[A + 1] = T0i + T2i;\n out[B] = T1r + T3i;\n out[B + 1] = T1i - T3r;\n out[C] = T0r - T2r;\n out[C + 1] = T0i - T2i;\n out[D] = T1r - T3i;\n out[D + 1] = T1i + T3r;\n }\n }\n }\n }\n\n /**\n * Performs a radix-2 implementation of a discrete Fourier transform on a given set of data.\n *\n * @param {Float64Array} data The input buffer of data to be transformed.\n * @param {Float64Array} out The output buffer for the transformed data.\n * @param {number} outOff The offset at which to write the output data.\n * @param {number} off The offset at which to begin reading the input data.\n * @param {number} step The step size for indexing the input data.\n * @returns {void}\n */\n _singleTransform2(data, out, outOff, off, step) {\n // radix-2 implementation\n // NOTE: Only called for len=4\n\n const evenR = data[off];\n const evenI = data[off + 1];\n const oddR = data[off + step];\n const oddI = data[off + step + 1];\n\n out[outOff] = evenR + oddR;\n out[outOff + 1] = evenI + oddI;\n out[outOff + 2] = evenR - oddR;\n out[outOff + 3] = evenI - oddI;\n }\n\n /**\n * Performs radix-4 transformation on input data of length 8\n *\n * @param {Float64Array} data Input data array of length 8\n * @param {Float64Array} out Output data array of length 8\n * @param {number} outOff Index of output array to start writing from\n * @param {number} off Index of input array to start reading from\n * @param {number} step Step size between elements in input array\n * @param {number} inv Scaling factor for inverse transform\n * \n * @returns {void}\n */\n _singleTransform4(data, out, outOff, off, step, inv) {\n // radix-4\n // NOTE: Only called for len=8\n const step2 = step * 2;\n const step3 = step * 3;\n\n // Original values\n const Ar = data[off];\n const Ai = data[off + 1];\n const Br = data[off + step];\n const Bi = data[off + step + 1];\n const Cr = data[off + step2];\n const Ci = data[off + step2 + 1];\n const Dr = data[off + step3];\n const Di = data[off + step3 + 1];\n\n // Pre-Final values\n const T0r = Ar + Cr;\n const T0i = Ai + Ci;\n const T1r = Ar - Cr;\n const T1i = Ai - Ci;\n const T2r = Br + Dr;\n const T2i = Bi + Di;\n const T3r = inv * (Br - Dr);\n const T3i = inv * (Bi - Di);\n\n // Final values\n out[outOff] = T0r + T2r;\n out[outOff + 1] = T0i + T2i;\n out[outOff + 2] = T1r + T3i;\n out[outOff + 3] = T1i - T3r;\n out[outOff + 4] = T0r - T2r;\n out[outOff + 5] = T0i - T2i;\n out[outOff + 6] = T1r - T3i;\n out[outOff + 7] = T1i + T3r;\n }\n\n /**\n * Real input radix-4 implementation\n * @param {Float64Array} out Output array for the transformed data\n * @param {Float64Array} data Input array of real data to be transformed\n * @param {number} inv The scale factor used to normalize the inverse transform\n */\n _realTransform4(out, data, inv) {\n // Real input radix-4 implementation\n const size = this._csize;\n\n // Initial step (permute and transform)\n const width = this._width;\n let step = 1 << width;\n let len = (size / step) << 1;\n\n let outOff;\n let t;\n const bitrev = this._bitrev;\n if (len === 4) {\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\n const off = bitrev[t];\n this._singleRealTransform2(data, out, outOff, off >>> 1, step >>> 1);\n }\n } else {\n // len === 8\n for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) {\n const off = bitrev[t];\n this._singleRealTransform4(data, out, outOff, off >>> 1, step >>> 1, inv);\n }\n }\n\n // TODO: Optimize once https://github.com/indutny/fft.js/issues/25 is fixed\n // Loop through steps in decreasing order\n for (step >>= 2; step >= 2; step >>= 2) {\n len = (size / step) << 1;\n const quarterLen = len >>> 2;\n\n // Loop through offsets in the data\n for (outOff = 0; outOff < size; outOff += len) {\n // Full case\n const limit = outOff + quarterLen - 1;\n for (let i = outOff, k = 0; i < limit; i += 2, k += step) {\n const A = i;\n const B = A + quarterLen;\n const C = B + quarterLen;\n const D = C + quarterLen;\n\n // Original values\n const Ar = out[A];\n const Ai = out[A + 1];\n const Br = out[B];\n const Bi = out[B + 1];\n const Cr = out[C];\n const Ci = out[C + 1];\n const Dr = out[D];\n const Di = out[D + 1];\n\n const tableBr = this.table[k];\n const tableBi = inv * this.table[k + 1];\n const MBr = Br * tableBr - Bi * tableBi;\n const MBi = Br * tableBi + Bi * tableBr;\n\n const tableCr = this.table[2 * k];\n const tableCi = inv * this.table[2 * k + 1];\n const MCr = Cr * tableCr - Ci * tableCi;\n const MCi = Cr * tableCi + Ci * tableCr;\n\n const tableDr = this.table[3 * k];\n const tableDi = inv * this.table[3 * k + 1];\n const MDr = Dr * tableDr - Di * tableDi;\n const MDi = Dr * tableDi + Di * tableDr;\n\n // Pre-Final values\n const T0r = Ar + MCr;\n const T0i = Ai + MCi;\n const T1r = Ar - MCr;\n const T1i = Ai - MCi;\n const T2r = MBr + MDr;\n const T2i = MBi + MDi;\n const T3r = inv * (MBr - MDr);\n const T3i = inv * (MBi - MDi);\n\n // Final values\n out[A] = T0r + T2r;\n out[A + 1] = T0i + T2i;\n out[B] = T1r + T3i;\n out[B + 1] = T1i - T3r;\n out[C] = T0r - T2r;\n out[C + 1] = T0i - T2i;\n out[D] = T1r - T3i;\n out[D + 1] = T1i + T3r;\n }\n }\n }\n }\n\n /**\n * Performs a single real input radix-2 transformation on the provided data\n * \n * @param {Float64Array} data The input data array\n * @param {Float64Array} out The output data array\n * @param {number} outOff The output offset\n * @param {number} off The input offset\n * @param {number} step The step\n * \n * @returns {void}\n */\n _singleRealTransform2(data, out, outOff, off, step) {\n // radix-2 implementation\n // NOTE: Only called for len=4\n\n const evenR = data[off];\n const oddR = data[off + step];\n\n out[outOff] = evenR + oddR;\n out[outOff + 1] = 0;\n out[outOff + 2] = evenR - oddR;\n out[outOff + 3] = 0;\n }\n\n /**\n * Computes a single real-valued transform using radix-4 algorithm.\n * This method is only called for len=8.\n *\n * @param {Float64Array} data The input data array.\n * @param {Float64Array} out The output data array.\n * @param {number} outOff The offset into the output array.\n * @param {number} off The offset into the input array.\n * @param {number} step The step size for the input array.\n * @param {number} inv The value of inverse.\n */\n _singleRealTransform4(data, out, outOff, off, step, inv) {\n // radix-4\n // NOTE: Only called for len=8\n const step2 = step * 2;\n const step3 = step * 3;\n\n // Original values\n const Ar = data[off];\n const Br = data[off + step];\n const Cr = data[off + step2];\n const Dr = data[off + step3];\n\n // Pre-Final values\n const T0r = Ar + Cr;\n const T1r = Ar - Cr;\n const T2r = Br + Dr;\n const T3r = inv * (Br - Dr);\n\n // Final values\n out[outOff] = T0r + T2r;\n out[outOff + 1] = 0;\n out[outOff + 2] = T1r;\n out[outOff + 3] = -T3r;\n out[outOff + 4] = T0r - T2r;\n out[outOff + 5] = 0;\n out[outOff + 6] = T1r;\n out[outOff + 7] = T3r;\n }\n}\n\n/**\n * NP2FFT class provides functionality for performing Fast Fourier Transform on arrays\n * which are not a power of two in length. In such cases, the chirp-z transform is used.\n * \n * For more information, see: https://math.stackexchange.com/questions/77118/non-power-of-2-ffts/77156#77156\n */\nclass NP2FFT {\n\n /**\n * Constructs a new NP2FFT object.\n * @param {number} fft_length The length of the FFT\n */\n constructor(fft_length) {\n // Helper variables\n const a = 2 * (fft_length - 1);\n const b = 2 * (2 * fft_length - 1);\n const nextP2 = 2 ** (Math.ceil(Math.log2(b)))\n this.bufferSize = nextP2;\n this._a = a;\n\n // Define buffers\n // Compute chirp for transform\n const chirp = new Float64Array(b);\n const ichirp = new Float64Array(nextP2);\n this._chirpBuffer = new Float64Array(nextP2);\n this._buffer1 = new Float64Array(nextP2);\n this._buffer2 = new Float64Array(nextP2);\n this._outBuffer1 = new Float64Array(nextP2);\n this._outBuffer2 = new Float64Array(nextP2);\n\n // Compute complex exponentiation\n const theta = -2 * Math.PI / fft_length;\n const baseR = Math.cos(theta);\n const baseI = Math.sin(theta);\n\n // Precompute helper for chirp-z transform\n for (let i = 0; i < b >> 1; ++i) {\n // Compute complex power:\n const e = (i + 1 - fft_length) ** 2 / 2.0;\n\n // Compute the modulus and argument of the result\n const result_mod = Math.sqrt(baseR ** 2 + baseI ** 2) ** e;\n const result_arg = e * Math.atan2(baseI, baseR);\n\n // Convert the result back to rectangular form\n // and assign to chirp and ichirp\n const i2 = 2 * i;\n chirp[i2] = result_mod * Math.cos(result_arg);\n chirp[i2 + 1] = result_mod * Math.sin(result_arg);\n\n // conjugate\n ichirp[i2] = chirp[i2];\n ichirp[i2 + 1] = - chirp[i2 + 1];\n }\n this._slicedChirpBuffer = chirp.subarray(a, b);\n\n // create object to perform Fast Fourier Transforms\n // with `nextP2` complex numbers\n this._f = new P2FFT(nextP2 >> 1);\n this._f.transform(this._chirpBuffer, ichirp);\n }\n\n _transform(output, input, real) {\n const ib1 = this._buffer1;\n const ib2 = this._buffer2;\n const ob2 = this._outBuffer1;\n const ob3 = this._outBuffer2;\n const cb = this._chirpBuffer;\n const sb = this._slicedChirpBuffer;\n const a = this._a;\n\n if (real) {\n // Real multiplication\n for (let j = 0; j < sb.length; j += 2) {\n const j2 = j + 1\n const j3 = j >> 1;\n\n const a_real = input[j3];\n ib1[j] = a_real * sb[j];\n ib1[j2] = a_real * sb[j2];\n }\n } else {\n // Complex multiplication\n for (let j = 0; j < sb.length; j += 2) {\n const j2 = j + 1\n ib1[j] = input[j] * sb[j] - input[j2] * sb[j2];\n ib1[j2] = input[j] * sb[j2] + input[j2] * sb[j];\n }\n }\n this._f.transform(ob2, ib1);\n\n for (let j = 0; j < cb.length; j += 2) {\n const j2 = j + 1;\n\n ib2[j] = ob2[j] * cb[j] - ob2[j2] * cb[j2];\n ib2[j2] = ob2[j] * cb[j2] + ob2[j2] * cb[j];\n }\n this._f.inverseTransform(ob3, ib2);\n\n for (let j = 0; j < ob3.length; j += 2) {\n const a_real = ob3[j + a];\n const a_imag = ob3[j + a + 1];\n const b_real = sb[j];\n const b_imag = sb[j + 1];\n\n output[j] = a_real * b_real - a_imag * b_imag;\n output[j + 1] = a_real * b_imag + a_imag * b_real;\n }\n }\n\n transform(output, input) {\n this._transform(output, input, false);\n }\n\n realTransform(output, input) {\n this._transform(output, input, true);\n }\n}\n\nclass FFT {\n constructor(fft_length) {\n this.fft_length = fft_length;\n this.isPowerOfTwo = isPowerOfTwo(fft_length);\n if (this.isPowerOfTwo) {\n this.fft = new P2FFT(fft_length);\n this.outputBufferSize = 2 * fft_length;\n } else {\n this.fft = new NP2FFT(fft_length);\n this.outputBufferSize = this.fft.bufferSize;\n }\n }\n\n realTransform(out, input) {\n this.fft.realTransform(out, input);\n }\n\n transform(out, input) {\n this.fft.transform(out, input);\n }\n}\n\n\n/**\n * Performs median filter on the provided data. Padding is done by mirroring the data.\n * @param {AnyTypedArray} data The input array\n * @param {number} windowSize The window size\n */\nfunction medianFilter(data, windowSize) {\n\n if (windowSize % 2 === 0 || windowSize <= 0) {\n throw new Error('Window size must be a positive odd number');\n }\n\n // @ts-ignore\n const outputArray = new data.constructor(data.length);\n\n // @ts-ignore\n const buffer = new data.constructor(windowSize); // Reusable array for storing values\n\n const halfWindowSize = Math.floor(windowSize / 2);\n\n for (let i = 0; i < data.length; ++i) {\n let valuesIndex = 0;\n\n for (let j = -halfWindowSize; j <= halfWindowSize; ++j) {\n let index = i + j;\n if (index < 0) {\n index = Math.abs(index);\n } else if (index >= data.length) {\n index = 2 * (data.length - 1) - index;\n }\n\n buffer[valuesIndex++] = data[index];\n }\n\n buffer.sort();\n outputArray[i] = buffer[halfWindowSize];\n }\n\n return outputArray;\n}\n\n/**\n * Helper function to round a number to a given number of decimals\n * @param {number} num The number to round\n * @param {number} decimals The number of decimals\n * @returns {number} The rounded number\n */\nfunction round(num, decimals) {\n const pow = Math.pow(10, decimals);\n return Math.round(num * pow) / pow;\n}\n\n/**\n * Helper function to round a number to the nearest integer, with ties rounded to the nearest even number.\n * Also known as \"bankers' rounding\". This is the default rounding mode in python. For example:\n * 1.5 rounds to 2 and 2.5 rounds to 2.\n * \n * @param {number} x The number to round\n * @returns {number} The rounded number\n */\nfunction bankers_round(x) {\n const r = Math.round(x);\n const br = Math.abs(x) % 1 === 0.5 ? (r % 2 === 0 ? r : r - 1) : r;\n return br;\n}\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/utils/maths.js?"); /***/ }), @@ -436,7 +3768,18 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Tensor: () => (/* binding */ Tensor),\n/* harmony export */ cat: () => (/* binding */ cat),\n/* harmony export */ dynamicTimeWarping: () => (/* binding */ dynamicTimeWarping),\n/* harmony export */ interpolate: () => (/* binding */ interpolate),\n/* harmony export */ layer_norm: () => (/* binding */ layer_norm),\n/* harmony export */ mean: () => (/* binding */ mean),\n/* harmony export */ mean_pooling: () => (/* binding */ mean_pooling),\n/* harmony export */ ones: () => (/* binding */ ones),\n/* harmony export */ ones_like: () => (/* binding */ ones_like),\n/* harmony export */ stack: () => (/* binding */ stack),\n/* harmony export */ std_mean: () => (/* binding */ std_mean),\n/* harmony export */ transpose: () => (/* binding */ transpose)\n/* harmony export */ });\n/* harmony import */ var _backends_onnx_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../backends/onnx.js */ \"./node_modules/@xenova/transformers/src/backends/onnx.js\");\n/* harmony import */ var _maths_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./maths.js */ \"./node_modules/@xenova/transformers/src/utils/maths.js\");\n/**\n * @file Helper module for `Tensor` processing.\n * \n * These functions and classes are only used internally, \n * meaning an end-user shouldn't need to access anything here.\n * \n * @module utils/tensor\n */\n\n\n\n\n\n\nconst DataTypeMap = Object.freeze({\n float32: Float32Array,\n float64: Float64Array,\n string: Array, // string[]\n int8: Int8Array,\n uint8: Uint8Array,\n int16: Int16Array,\n uint16: Uint16Array,\n int32: Int32Array,\n uint32: Uint32Array,\n int64: BigInt64Array,\n uint64: BigUint64Array,\n bool: Uint8Array,\n});\n\n/**\n * @typedef {keyof typeof DataTypeMap} DataType\n * @typedef {import('./maths.js').AnyTypedArray | any[]} DataArray\n */\n\nconst ONNXTensor = _backends_onnx_js__WEBPACK_IMPORTED_MODULE_0__.ONNX.Tensor;\n\nclass Tensor {\n /** @type {number[]} Dimensions of the tensor. */\n dims;\n\n /** @type {DataType} Type of the tensor. */\n type;\n\n /** @type {DataArray} The data stored in the tensor. */\n data;\n\n /** @type {number} The number of elements in the tensor. */\n size;\n\n /**\n * Create a new Tensor or copy an existing Tensor.\n * @param {[DataType, DataArray, number[]]|[import('onnxruntime-common').Tensor]} args\n */\n constructor(...args) {\n if (args[0] instanceof ONNXTensor) {\n // Create shallow copy\n Object.assign(this, args[0]);\n\n } else {\n // Create new tensor\n Object.assign(this, new ONNXTensor(\n /** @type {DataType} */(args[0]),\n /** @type {Exclude} */(args[1]),\n args[2]\n ));\n }\n\n return new Proxy(this, {\n get: (obj, key) => {\n if (typeof key === 'string') {\n let index = Number(key);\n if (Number.isInteger(index)) {\n // key is an integer (i.e., index)\n return obj._getitem(index);\n }\n }\n // @ts-ignore\n return obj[key];\n },\n set: (obj, key, value) => {\n // TODO allow setting of data\n\n // @ts-ignore\n return obj[key] = value;\n }\n });\n }\n\n /**\n * Returns an iterator object for iterating over the tensor data in row-major order.\n * If the tensor has more than one dimension, the iterator will yield subarrays.\n * @returns {Iterator} An iterator object for iterating over the tensor data in row-major order.\n */\n *[Symbol.iterator]() {\n const [iterLength, ...iterDims] = this.dims;\n\n if (iterDims.length > 0) {\n const iterSize = iterDims.reduce((a, b) => a * b);\n for (let i = 0; i < iterLength; ++i) {\n yield this._subarray(i, iterSize, iterDims);\n }\n } else {\n yield* this.data\n }\n\n }\n\n /**\n * Index into a Tensor object.\n * @param {number} index The index to access.\n * @returns {Tensor} The data at the specified index.\n */\n _getitem(index) {\n const [iterLength, ...iterDims] = this.dims;\n\n index = safeIndex(index, iterLength);\n\n if (iterDims.length > 0) {\n const iterSize = iterDims.reduce((a, b) => a * b);\n return this._subarray(index, iterSize, iterDims);\n } else {\n return new Tensor(this.type, [this.data[index]], iterDims);\n }\n }\n\n /**\n * @param {number|bigint} item The item to search for in the tensor\n * @returns {number} The index of the first occurrence of item in the tensor data.\n */\n indexOf(item) {\n for (let index = 0; index < this.data.length; ++index) {\n // Note: == instead of === so we can match Ints with BigInts\n if (this.data[index] == item) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * @param {number} index \n * @param {number} iterSize \n * @param {any} iterDims \n * @returns {Tensor}\n */\n _subarray(index, iterSize, iterDims) {\n const o1 = index * iterSize;\n const o2 = (index + 1) * iterSize;\n\n // We use subarray if available (typed array), otherwise we use slice (normal array)\n const data =\n ('subarray' in this.data)\n ? this.data.subarray(o1, o2)\n : this.data.slice(o1, o2);\n return new Tensor(this.type, data, iterDims);\n }\n\n /**\n * Returns the value of this tensor as a standard JavaScript Number. This only works\n * for tensors with one element. For other cases, see `Tensor.tolist()`.\n * @returns {number|bigint} The value of this tensor as a standard JavaScript Number.\n * @throws {Error} If the tensor has more than one element.\n */\n item() {\n if (this.data.length !== 1) {\n throw new Error(`a Tensor with ${this.data.length} elements cannot be converted to Scalar`);\n }\n return this.data[0];\n }\n\n /**\n * Convert tensor data to a n-dimensional JS list\n * @returns {Array}\n */\n tolist() {\n return reshape(this.data, this.dims)\n }\n\n /**\n * Return a new Tensor with the sigmoid function applied to each element.\n * @returns {Tensor} The tensor with the sigmoid function applied.\n */\n sigmoid() {\n return this.clone().sigmoid_();\n }\n\n /**\n * Applies the sigmoid function to the tensor in place.\n * @returns {Tensor} Returns `this`.\n */\n sigmoid_() {\n for (let i = 0; i < this.data.length; ++i) {\n this.data[i] = 1 / (1 + Math.exp(-this.data[i]));\n }\n return this;\n }\n\n /**\n * Return a new Tensor with every element multiplied by a constant.\n * @param {number} val The value to multiply by.\n * @returns {Tensor} The new tensor.\n */\n mul(val) {\n return this.clone().mul_(val);\n }\n\n /**\n * Multiply the tensor by a constant in place.\n * @param {number} val The value to multiply by.\n * @returns {Tensor} Returns `this`.\n */\n mul_(val) {\n for (let i = 0; i < this.data.length; ++i) {\n this.data[i] *= val;\n }\n return this;\n }\n\n\n /**\n * Return a new Tensor with every element added by a constant.\n * @param {number} val The value to add by.\n * @returns {Tensor} The new tensor.\n */\n add(val) {\n return this.clone().add_(val);\n }\n\n /**\n * Add the tensor by a constant in place.\n * @param {number} val The value to add by.\n * @returns {Tensor} Returns `this`.\n */\n add_(val) {\n for (let i = 0; i < this.data.length; ++i) {\n this.data[i] += val;\n }\n return this;\n }\n clone() {\n return new Tensor(this.type, this.data.slice(), this.dims.slice());\n }\n\n slice(...slices) {\n // This allows for slicing with ranges and numbers\n let newTensorDims = [];\n let newOffsets = [];\n\n // slices is an array of numbers or arrays of numbers\n // e.g., slices = [0, [1, 3], null, [0, 3]]\n for (let sliceIndex = 0; sliceIndex < this.dims.length; ++sliceIndex) {\n let slice = slices[sliceIndex];\n\n if (slice === null || slice === undefined) {\n // null or undefined means take the whole dimension\n newOffsets.push([0, this.dims[sliceIndex]]);\n newTensorDims.push(this.dims[sliceIndex]);\n\n } else if (typeof slice === 'number') {\n slice = safeIndex(slice, this.dims[sliceIndex], sliceIndex);\n\n // A number means take a single element\n newOffsets.push([slice, slice + 1]);\n\n } else if (Array.isArray(slice) && slice.length === 2) {\n // An array of length 2 means take a range of elements\n\n if (slice[0] > slice[1]) {\n throw new Error(`Invalid slice: ${slice}`);\n }\n\n let offsets = [\n Math.max(slice[0], 0),\n Math.min(slice[1], this.dims[sliceIndex])\n ];\n\n newOffsets.push(offsets);\n newTensorDims.push(offsets[1] - offsets[0]);\n\n } else {\n throw new Error(`Invalid slice: ${slice}`);\n }\n }\n\n let newDims = newOffsets.map(([start, end]) => end - start);\n let newBufferSize = newDims.reduce((a, b) => a * b);\n\n // Allocate memory\n // @ts-ignore\n let data = new this.data.constructor(newBufferSize);\n\n // Precompute strides\n const stride = this.stride();\n\n for (let i = 0; i < newBufferSize; ++i) {\n let originalIndex = 0;\n for (let j = newDims.length - 1, num = i; j >= 0; --j) {\n const size = newDims[j];\n originalIndex += ((num % size) + newOffsets[j][0]) * stride[j];\n num = Math.floor(num / size);\n }\n data[i] = this.data[originalIndex];\n }\n return new Tensor(this.type, data, newTensorDims);\n\n }\n\n /**\n * Return a transposed version of this Tensor, according to the provided dimensions.\n * @param {...number} dims Dimensions to transpose.\n * @returns {Tensor} The transposed tensor.\n */\n transpose(...dims) {\n return transpose(this, dims);\n }\n\n // TODO: rename transpose to permute\n // TODO: implement transpose\n\n // TODO add .max() and .min() methods\n\n /**\n * Returns the sum of each row of the input tensor in the given dimension dim.\n * \n * @param {number} [dim=null] The dimension or dimensions to reduce. If `null`, all dimensions are reduced.\n * @param {boolean} keepdim Whether the output tensor has `dim` retained or not.\n * @returns The summed tensor\n */\n sum(dim = null, keepdim = false) {\n return this.norm(1, dim, keepdim);\n }\n\n /**\n * Returns the matrix norm or vector norm of a given tensor.\n * @param {number|string} [p='fro'] The order of norm\n * @param {number} [dim=null] Specifies which dimension of the tensor to calculate the norm across.\n * If dim is None, the norm will be calculated across all dimensions of input.\n * @param {boolean} [keepdim=false] Whether the output tensors have dim retained or not.\n * @returns {Tensor} The norm of the tensor.\n */\n norm(p = 'fro', dim = null, keepdim = false) {\n if (p === 'fro') {\n // NOTE: Since we only support integer dims, Frobenius norm produces the same result as p=2.\n p = 2;\n } else if (typeof p === 'string') {\n throw Error(`Unsupported norm: ${p}`);\n }\n\n if (dim === null) {\n // @ts-ignore\n let val = this.data.reduce((a, b) => a + (b ** p), 0) ** (1 / p);\n return new Tensor(this.type, [val], []);\n }\n\n // Negative indexing\n dim = safeIndex(dim, this.dims.length);\n\n // Calculate the shape of the resulting array after summation\n const resultDims = this.dims.slice(); // Copy the original dimensions\n resultDims[dim] = 1; // Remove the specified axis\n\n // Create a new array to store the accumulated values\n // @ts-ignore\n const result = new this.data.constructor(this.data.length / this.dims[dim]);\n\n // Iterate over the data array\n for (let i = 0; i < this.data.length; ++i) {\n\n // Calculate the index in the resulting array\n let resultIndex = 0;\n\n for (let j = this.dims.length - 1, num = i, resultMultiplier = 1; j >= 0; --j) {\n const size = this.dims[j];\n if (j !== dim) {\n const index = num % size;\n resultIndex += index * resultMultiplier;\n resultMultiplier *= resultDims[j];\n }\n num = Math.floor(num / size);\n }\n\n // Accumulate the value at the current index\n result[resultIndex] += (this.data[i]) ** p;\n }\n\n if (p !== 1) {\n for (let i = 0; i < result.length; ++i) {\n result[i] = result[i] ** (1 / p);\n }\n }\n\n if (!keepdim) {\n resultDims.splice(dim, 1);\n }\n\n return new Tensor(this.type, result, resultDims);\n }\n\n /**\n * Performs `L_p` normalization of inputs over specified dimension. Operates in place.\n * @param {number} [p=2] The exponent value in the norm formulation\n * @param {number} [dim=1] The dimension to reduce\n * @returns {Tensor} `this` for operation chaining.\n */\n normalize_(p = 2.0, dim = 1) {\n dim = safeIndex(dim, this.dims.length);\n\n const norm = this.norm(p, dim, true);\n\n for (let i = 0; i < this.data.length; ++i) {\n\n // Calculate the index in the resulting array\n let resultIndex = 0;\n\n for (let j = this.dims.length - 1, num = i, resultMultiplier = 1; j >= 0; --j) {\n const size = this.dims[j];\n if (j !== dim) {\n const index = num % size;\n resultIndex += index * resultMultiplier;\n resultMultiplier *= this.dims[j];\n }\n num = Math.floor(num / size);\n }\n\n // Divide by normalized value\n this.data[i] /= norm.data[resultIndex];\n }\n\n return this;\n }\n\n /**\n * Performs `L_p` normalization of inputs over specified dimension.\n * @param {number} [p=2] The exponent value in the norm formulation\n * @param {number} [dim=1] The dimension to reduce\n * @returns {Tensor} The normalized tensor.\n */\n normalize(p = 2.0, dim = 1) {\n return this.clone().normalize_(p, dim);\n }\n\n /**\n * Compute and return the stride of this tensor.\n * Stride is the jump necessary to go from one element to the next one in the specified dimension dim.\n * @returns {number[]} The stride of this tensor.\n */\n stride() {\n return dimsToStride(this.dims);\n }\n\n /**\n * Returns a tensor with all specified dimensions of input of size 1 removed.\n * \n * NOTE: The returned tensor shares the storage with the input tensor, so changing the contents of one will change the contents of the other.\n * If you would like a copy, use `tensor.clone()` before squeezing.\n * \n * @param {number} [dim=null] If given, the input will be squeezed only in the specified dimensions.\n * @returns The squeezed tensor\n */\n squeeze(dim = null) {\n return new Tensor(\n this.type,\n this.data,\n calc_squeeze_dims(this.dims, dim)\n )\n }\n\n /**\n * In-place version of @see {@link Tensor.squeeze}\n */\n squeeze_(dim = null) {\n this.dims = calc_squeeze_dims(this.dims, dim);\n return this;\n }\n\n /**\n * Returns a new tensor with a dimension of size one inserted at the specified position.\n * \n * NOTE: The returned tensor shares the same underlying data with this tensor.\n * \n * @param {number} dim The index at which to insert the singleton dimension\n * @returns The unsqueezed tensor\n */\n unsqueeze(dim = null) {\n return new Tensor(\n this.type,\n this.data,\n calc_unsqueeze_dims(this.dims, dim)\n );\n }\n\n /**\n * In-place version of @see {@link Tensor.unsqueeze}\n */\n unsqueeze_(dim = null) {\n this.dims = calc_unsqueeze_dims(this.dims, dim);\n return this;\n }\n\n /**\n * In-place version of @see {@link Tensor.flatten}\n */\n flatten_(start_dim = 0, end_dim = -1) {\n // TODO validate inputs\n end_dim = (end_dim + this.dims.length) % this.dims.length;\n\n let dimsToKeepBefore = this.dims.slice(0, start_dim);\n let dimsToFlatten = this.dims.slice(start_dim, end_dim + 1);\n let dimsToKeepAfter = this.dims.slice(end_dim + 1);\n\n this.dims = [...dimsToKeepBefore, dimsToFlatten.reduce((a, b) => a * b, 1), ...dimsToKeepAfter]\n return this;\n }\n\n /**\n * Flattens input by reshaping it into a one-dimensional tensor.\n * If `start_dim` or `end_dim` are passed, only dimensions starting with `start_dim`\n * and ending with `end_dim` are flattened. The order of elements in input is unchanged.\n * @param {number} start_dim the first dim to flatten\n * @param {number} end_dim the last dim to flatten\n * @returns The flattened tensor.\n */\n flatten(start_dim = 0, end_dim = -1) {\n return this.clone().flatten_(start_dim, end_dim);\n }\n\n /**\n * Returns a new tensor with the same data as the `self` tensor but of a different `shape`.\n * @param {...number} dims the desired size\n * @returns {Tensor} The tensor with the same data but different shape\n */\n view(...dims) {\n // TODO: validate dims\n let inferredIndex = -1;\n for (let i = 0; i < dims.length; ++i) {\n if (dims[i] === -1) {\n if (inferredIndex !== -1) {\n throw new Error(\"Only one dimension can be inferred\");\n }\n inferredIndex = i;\n }\n }\n\n if (inferredIndex !== -1) {\n // Some dimension must be inferred\n const productOther = dims.reduce((product, curr, index) => {\n return index !== inferredIndex ? product * curr : product\n }, 1);\n\n dims[inferredIndex] = this.data.length / productOther;\n }\n return new Tensor(this.type, this.data, dims); // NOTE: uses same underlying storage\n }\n\n neg_() {\n for (let i = 0; i < this.data.length; ++i) {\n this.data[i] = -this.data[i];\n }\n return this;\n }\n neg() {\n return this.clone().neg_();\n }\n\n /**\n * In-place version of @see {@link Tensor.clamp}\n */\n clamp_(min, max) {\n for (let i = 0; i < this.data.length; ++i) {\n this.data[i] = Math.min(Math.max(this.data[i], min), max);\n }\n return this;\n }\n\n /**\n * Clamps all elements in input into the range [ min, max ]\n * @param {number} min lower-bound of the range to be clamped to\n * @param {number} max upper-bound of the range to be clamped to\n * @returns the output tensor.\n */\n clamp(min, max) {\n return this.clone().clamp_(min, max);\n }\n\n /**\n * In-place version of @see {@link Tensor.round}\n */\n round_() {\n for (let i = 0; i < this.data.length; ++i) {\n this.data[i] = Math.round(this.data[i]);\n }\n return this;\n }\n\n /**\n * Rounds elements of input to the nearest integer.\n * @returns the output tensor.\n */\n round() {\n return this.clone().round_();\n }\n\n /**\n * Performs Tensor dtype conversion.\n * @param {DataType} type The desired data type.\n * @returns {Tensor} The converted tensor.\n */\n to(type) {\n // If the self Tensor already has the correct dtype, then self is returned.\n if (this.type === type) return this;\n\n // Otherwise, the returned tensor is a copy of self with the desired dtype.\n if (!DataTypeMap.hasOwnProperty(type)) {\n throw new Error(`Unsupported type: ${type}`);\n }\n // @ts-ignore\n return new Tensor(type, DataTypeMap[type].from(this.data), this.dims);\n }\n}\n\n/**\n * This creates a nested array of a given type and depth (see examples).\n * \n * @example\n * NestArray; // string[]\n * @example\n * NestArray; // number[][]\n * @example\n * NestArray; // string[][][] etc.\n * @template T\n * @template {number} Depth\n * @template {never[]} [Acc=[]]\n * @typedef {Acc['length'] extends Depth ? T : NestArray} NestArray\n */\n\n/**\n * Reshapes a 1-dimensional array into an n-dimensional array, according to the provided dimensions.\n *\n * @example\n * reshape([10 ], [1 ]); // Type: number[] Value: [10]\n * reshape([1, 2, 3, 4 ], [2, 2 ]); // Type: number[][] Value: [[1, 2], [3, 4]]\n * reshape([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); // Type: number[][][] Value: [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]\n * reshape([1, 2, 3, 4, 5, 6, 7, 8], [4, 2 ]); // Type: number[][] Value: [[1, 2], [3, 4], [5, 6], [7, 8]]\n * @param {T[]|DataArray} data The input array to reshape.\n * @param {DIM} dimensions The target shape/dimensions.\n * @template T\n * @template {[number]|number[]} DIM\n * @returns {NestArray} The reshaped array.\n */\nfunction reshape(data, dimensions) {\n\n const totalElements = data.length;\n const dimensionSize = dimensions.reduce((a, b) => a * b);\n\n if (totalElements !== dimensionSize) {\n throw Error(`cannot reshape array of size ${totalElements} into shape (${dimensions})`);\n }\n\n /** @type {any} */\n let reshapedArray = data;\n\n for (let i = dimensions.length - 1; i >= 0; i--) {\n reshapedArray = reshapedArray.reduce((acc, val) => {\n let lastArray = acc[acc.length - 1];\n\n if (lastArray.length < dimensions[i]) {\n lastArray.push(val);\n } else {\n acc.push([val]);\n }\n\n return acc;\n }, [[]]);\n }\n\n return reshapedArray[0];\n}\n\n/**\n * Transposes a tensor according to the provided axes.\n * @param {any} tensor The input tensor to transpose.\n * @param {Array} axes The axes to transpose the tensor along.\n * @returns {Tensor} The transposed tensor.\n */\nfunction transpose(tensor, axes) {\n const [transposedData, shape] = (0,_maths_js__WEBPACK_IMPORTED_MODULE_1__.transpose_data)(tensor.data, tensor.dims, axes);\n return new Tensor(tensor.type, transposedData, shape);\n}\n\n\n/**\n * Interpolates an Tensor to the given size.\n * @param {Tensor} input The input tensor to interpolate. Data must be channel-first (i.e., [c, h, w])\n * @param {number[]} size The output size of the image\n * @param {string} mode The interpolation mode\n * @param {boolean} align_corners Whether to align corners.\n * @returns {Tensor} The interpolated tensor.\n */\nfunction interpolate(input, [out_height, out_width], mode = 'bilinear', align_corners = false) {\n\n // Input image dimensions\n const in_channels = input.dims.at(-3) ?? 1;\n const in_height = input.dims.at(-2);\n const in_width = input.dims.at(-1);\n\n let output = (0,_maths_js__WEBPACK_IMPORTED_MODULE_1__.interpolate_data)(\n /** @type {import('./maths.js').TypedArray}*/(input.data),\n [in_channels, in_height, in_width],\n [out_height, out_width],\n mode,\n align_corners\n );\n return new Tensor(input.type, output, [in_channels, out_height, out_width]);\n}\n\n/**\n * Perform mean pooling of the last hidden state followed by a normalization step.\n * @param {Tensor} last_hidden_state Tensor of shape [batchSize, seqLength, embedDim]\n * @param {Tensor} attention_mask Tensor of shape [batchSize, seqLength]\n * @returns {Tensor} Returns a new Tensor of shape [batchSize, embedDim].\n */\nfunction mean_pooling(last_hidden_state, attention_mask) {\n // last_hidden_state: [batchSize, seqLength, embedDim]\n // attention_mask: [batchSize, seqLength]\n\n let shape = [last_hidden_state.dims[0], last_hidden_state.dims[2]];\n // @ts-ignore\n let returnedData = new last_hidden_state.data.constructor(shape[0] * shape[1]);\n let [batchSize, seqLength, embedDim] = last_hidden_state.dims;\n\n let outIndex = 0;\n for (let i = 0; i < batchSize; ++i) {\n let offset = i * embedDim * seqLength;\n\n for (let k = 0; k < embedDim; ++k) {\n let sum = 0;\n let count = 0;\n\n let attnMaskOffset = i * seqLength;\n let offset2 = offset + k;\n // Pool over all words in sequence\n for (let j = 0; j < seqLength; ++j) {\n // index into attention mask\n let attn = Number(attention_mask.data[attnMaskOffset + j]);\n\n count += attn;\n sum += last_hidden_state.data[offset2 + j * embedDim] * attn;\n }\n\n let avg = sum / count;\n returnedData[outIndex++] = avg;\n }\n }\n\n return new Tensor(\n last_hidden_state.type,\n returnedData,\n shape\n )\n}\n\n/**\n * Apply Layer Normalization for last certain number of dimensions.\n * @param {Tensor} input The input tensor\n * @param {number[]} normalized_shape input shape from an expected input of size\n * @param {Object} options The options for the layer normalization\n * @param {number} [options.eps=1e-5] A value added to the denominator for numerical stability.\n * @returns {Tensor} The normalized tensor.\n */\nfunction layer_norm(input, normalized_shape, {\n eps = 1e-5,\n} = {}) {\n if (input.dims.length !== 2) {\n throw new Error('`layer_norm` currently only supports 2D input.');\n }\n\n const [batchSize, featureDim] = input.dims;\n\n if (normalized_shape.length !== 1 && normalized_shape[0] !== featureDim) {\n throw new Error('`normalized_shape` must be a 1D array with shape `[input.dims[1]]`.');\n }\n\n const [std, mean] = std_mean(input, 1, 0, true);\n\n // @ts-ignore\n const returnedData = new input.data.constructor(input.data.length);\n\n for (let i = 0; i < batchSize; ++i) {\n const offset = i * featureDim;\n for (let j = 0; j < featureDim; ++j) {\n const offset2 = offset + j;\n returnedData[offset2] = (input.data[offset2] - mean.data[i]) / (std.data[i] + eps);\n }\n }\n return new Tensor(input.type, returnedData, input.dims);\n}\n\n/**\n * Helper function to calculate new dimensions when performing a squeeze operation.\n * @param {number[]} dims The dimensions of the tensor.\n * @param {number|number[]|null} dim The dimension(s) to squeeze.\n * @returns The new dimensions.\n * @private\n */\nfunction calc_squeeze_dims(dims, dim) {\n dims = dims.slice();\n if (dim === null) {\n dims = dims.filter((d) => d !== 1);\n } else if (typeof dim === 'number') {\n if (dims[dim] === 1) {\n dims.splice(dim, 1);\n }\n } else if (Array.isArray(dim)) {\n dims = dims.filter((x, i) => {\n return x !== 1 || !dim.includes(i);\n });\n }\n return dims;\n}\n\n/**\n * Helper function to calculate new dimensions when performing an unsqueeze operation.\n * @param {number[]} dims The dimensions of the tensor.\n * @param {number} dim The dimension to unsqueeze.\n * @returns The new dimensions.\n * @private\n */\nfunction calc_unsqueeze_dims(dims, dim) {\n // Dimension out of range (e.g., \"expected to be in range of [-4, 3], but got 4\")\n // + 1 since we allow inserting at the end (i.e. dim = -1)\n dim = safeIndex(dim, dims.length + 1);\n dims = dims.slice();\n // Insert 1 into specified dimension\n dims.splice(dim, 0, 1);\n return dims;\n}\n\n/**\n * Safely calculate the index for an array of a given size, allowing negative indexing.\n * @param {number} index The index that will be used.\n * @param {number} size The size of the array.\n * @param {number} [dimension=null] The dimension that the index is for (optional).\n * @returns {number} The index, guaranteed to be non-negative and less than `arrayLength`.\n * \n * @throws {Error} If the index is out of range.\n * @private\n */\nfunction safeIndex(index, size, dimension = null) {\n if (index < -size || index >= size) {\n throw new Error(`IndexError: index ${index} is out of bounds for dimension${dimension === null ? '' : ' ' + dimension} with size ${size}`);\n }\n\n if (index < 0) {\n // Negative indexing, ensuring positive index\n index = ((index % size) + size) % size;\n }\n return index;\n}\n\n/**\n * Concatenates an array of tensors along a specified dimension.\n * @param {Tensor[]} tensors The array of tensors to concatenate.\n * @param {number} dim The dimension to concatenate along.\n * @returns {Tensor} The concatenated tensor.\n */\nfunction cat(tensors, dim = 0) {\n dim = safeIndex(dim, tensors[0].dims.length);\n\n // TODO do validation of shapes\n\n const resultDims = tensors[0].dims.slice();\n resultDims[dim] = tensors.reduce((a, b) => a + b.dims[dim], 0);\n\n // Create a new array to store the accumulated values\n const resultSize = resultDims.reduce((a, b) => a * b, 1);\n // @ts-ignore\n const result = new tensors[0].data.constructor(resultSize);\n\n // Create output tensor of same type as first\n const resultType = tensors[0].type;\n\n if (dim === 0) {\n // Handle special case for performance reasons\n\n let offset = 0;\n for (let t of tensors) {\n result.set(t.data, offset);\n offset += t.data.length;\n }\n\n } else {\n\n let currentDim = 0;\n\n for (let t = 0; t < tensors.length; ++t) {\n let tensor = tensors[t];\n\n // Iterate over the data array\n for (let i = 0; i < tensor.data.length; ++i) {\n // Calculate the index in the resulting array\n let resultIndex = 0;\n\n for (let j = tensor.dims.length - 1, num = i, resultMultiplier = 1; j >= 0; --j) {\n const size = tensor.dims[j];\n let index = num % size;\n if (j === dim) {\n index += currentDim;\n }\n resultIndex += index * resultMultiplier;\n resultMultiplier *= resultDims[j];\n num = Math.floor(num / size);\n }\n // Accumulate the value at the current index\n result[resultIndex] = tensor.data[i];\n }\n\n currentDim += tensor.dims[dim];\n }\n }\n return new Tensor(resultType, result, resultDims);\n}\n\n/**\n * Stack an array of tensors along a specified dimension.\n * @param {Tensor[]} tensors The array of tensors to stack.\n * @param {number} dim The dimension to stack along.\n * @returns {Tensor} The stacked tensor.\n */\nfunction stack(tensors, dim = 0) {\n // TODO do validation of shapes\n // NOTE: stack expects each tensor to be equal size\n return cat(tensors.map(t => t.unsqueeze(dim)), dim);\n}\n\n\n/**\n * Calculates the standard deviation and mean over the dimensions specified by dim. dim can be a single dimension or `null` to reduce over all dimensions.\n * @param {Tensor} input the input tenso\n * @param {number|null} dim the dimension to reduce. If None, all dimensions are reduced.\n * @param {number} correction difference between the sample size and sample degrees of freedom. Defaults to Bessel's correction, correction=1.\n * @param {boolean} keepdim whether the output tensor has dim retained or not.\n * @returns {Tensor[]} A tuple of (std, mean) tensors.\n */\nfunction std_mean(input, dim = null, correction = 1, keepdim = false) {\n\n if (dim === null) {\n // None to reduce over all dimensions.\n // @ts-ignore\n const sum = input.data.reduce((a, b) => a + b, 0);\n const mean = sum / input.data.length;\n // @ts-ignore\n const std = Math.sqrt(input.data.reduce((a, b) => a + (b - mean) ** 2, 0) / (input.data.length - correction));\n\n const meanTensor = new Tensor(input.type, [mean], [/* scalar */]);\n const stdTensor = new Tensor(input.type, [std], [/* scalar */]);\n\n return [stdTensor, meanTensor];\n }\n\n // Negative indexing\n dim = safeIndex(dim, input.dims.length);\n\n const meanTensor = mean(input, dim, keepdim);\n\n // Calculate the shape of the resulting array after summation\n const resultDims = input.dims.slice(); // Copy the original dimensions\n resultDims[dim] = 1; // Remove the specified axis\n\n // Create a new array to store the accumulated values\n // @ts-ignore\n const result = new input.data.constructor(input.data.length / input.dims[dim]);\n\n // Iterate over the data array\n for (let i = 0; i < input.data.length; ++i) {\n\n // Calculate the index in the resulting array\n let resultIndex = 0;\n\n for (let j = input.dims.length - 1, num = i, resultMultiplier = 1; j >= 0; --j) {\n const size = input.dims[j];\n if (j !== dim) {\n const index = num % size;\n resultIndex += index * resultMultiplier;\n resultMultiplier *= resultDims[j];\n }\n num = Math.floor(num / size);\n }\n\n // Accumulate the value at the current index\n result[resultIndex] += (input.data[i] - meanTensor.data[resultIndex]) ** 2;\n }\n\n for (let i = 0; i < result.length; ++i) {\n result[i] = Math.sqrt(result[i] / (input.dims[dim] - correction));\n }\n\n if (!keepdim) {\n resultDims.splice(dim, 1);\n }\n\n const stdTensor = new Tensor(input.type, result, resultDims);\n\n return [stdTensor, meanTensor];\n}\n\n\n/**\n * Returns the mean value of each row of the input tensor in the given dimension dim.\n * @param {Tensor} input the input tensor.\n * @param {number|null} dim the dimension to reduce.\n * @param {boolean} keepdim whether the output tensor has dim retained or not.\n * @returns A new tensor with means taken along the specified dimension.\n */\nfunction mean(input, dim = null, keepdim = false) {\n\n if (dim === null) {\n // None to reduce over all dimensions.\n // @ts-ignore\n let val = input.data.reduce((a, b) => a + b, 0);\n return new Tensor(input.type, [val / input.data.length], [/* scalar */]);\n }\n\n // Negative indexing\n dim = safeIndex(dim, input.dims.length);\n\n // Calculate the shape of the resulting array after summation\n const resultDims = input.dims.slice(); // Copy the original dimensions\n resultDims[dim] = 1; // Remove the specified axis\n\n // Create a new array to store the accumulated values\n // @ts-ignore\n const result = new input.data.constructor(input.data.length / input.dims[dim]);\n\n // Iterate over the data array\n for (let i = 0; i < input.data.length; ++i) {\n\n // Calculate the index in the resulting array\n let resultIndex = 0;\n\n for (let j = input.dims.length - 1, num = i, resultMultiplier = 1; j >= 0; --j) {\n const size = input.dims[j];\n if (j !== dim) {\n const index = num % size;\n resultIndex += index * resultMultiplier;\n resultMultiplier *= resultDims[j];\n }\n num = Math.floor(num / size);\n }\n\n // Accumulate the value at the current index\n result[resultIndex] += input.data[i];\n }\n\n if (input.dims[dim] !== 1) {\n for (let i = 0; i < result.length; ++i) {\n result[i] = result[i] / input.dims[dim];\n }\n }\n\n if (!keepdim) {\n resultDims.splice(dim, 1);\n }\n\n return new Tensor(input.type, result, resultDims);\n}\n\n\n/**\n *\n * Measures similarity between two temporal sequences (e.g., input audio and output tokens\n * to generate token-level timestamps).\n * @param {Tensor} matrix \n * @returns {number[][]}\n */\nfunction dynamicTimeWarping(matrix) {\n const [output_length, input_length] = matrix.dims;\n\n const outputShape = [output_length + 1, input_length + 1];\n\n const cost = new Tensor(\n 'float32',\n new Float32Array(outputShape[0] * outputShape[1]).fill(Infinity),\n outputShape\n );\n\n const trace = new Tensor(\n 'float32',\n new Float32Array(outputShape[0] * outputShape[1]).fill(-1),\n outputShape\n )\n\n // same as `cost[0][0] = 0`;\n cost[0].data[0] = 0;\n\n for (let j = 1; j < input_length + 1; ++j) {\n for (let i = 1; i < output_length + 1; ++i) {\n\n const c0 = cost[i - 1][j - 1].item();\n const c1 = cost[i - 1][j].item();\n const c2 = cost[i][j - 1].item();\n\n let c, t;\n if (c0 < c1 && c0 < c2) {\n c = c0;\n t = 0;\n } else if (c1 < c0 && c1 < c2) {\n c = c1;\n t = 1;\n } else {\n c = c2;\n t = 2;\n }\n\n cost[i].data[j] = matrix[i - 1][j - 1].item() + c;\n trace[i].data[j] = t;\n }\n }\n\n // backtrace\n let i = output_length;\n let j = input_length;\n\n // @ts-ignore\n trace.data.fill(2, 0, outputShape[1]) // trace[0, :] = 2\n for (let i = 0; i < outputShape[0]; ++i) { // trace[:, 0] = 1\n trace[i].data[0] = 1;\n }\n\n let text_indices = [];\n let time_indices = [];\n\n while (i > 0 || j > 0) {\n text_indices.push(i - 1);\n time_indices.push(j - 1);\n\n const t = trace[i][j].item();\n switch (t) {\n case 0:\n --i; --j;\n break;\n case 1:\n --i;\n break;\n case 2:\n --j;\n break;\n default:\n throw new Error(\n `Internal error in dynamic time warping. Unexpected trace[${i}, ${j}]. Please file a bug report.`\n )\n }\n }\n\n text_indices.reverse();\n time_indices.reverse();\n\n return [text_indices, time_indices];\n\n}\n\nfunction dimsToStride(dims) {\n const stride = new Array(dims.length);\n for (let i = dims.length - 1, s2 = 1; i >= 0; --i) {\n stride[i] = s2;\n s2 *= dims[i];\n }\n return stride;\n}\n\n/**\n * Returns a tensor filled with the scalar value 1, with the shape defined by the variable argument size.\n * @param {number[]} size A sequence of integers defining the shape of the output tensor.\n */\nfunction ones(size) {\n const numElements = size.reduce((a, b) => a * b, 1);\n return new Tensor(\n 'int64',\n new BigInt64Array(numElements).fill(1n),\n size\n )\n}\n\n/**\n * Returns a tensor filled with the scalar value 1, with the same size as input.\n * @param {Tensor} tensor The size of input will determine size of the output tensor.\n * @returns The ones tensor.\n */\nfunction ones_like(tensor) {\n return ones(tensor.dims);\n}\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/utils/tensor.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Tensor: () => (/* binding */ Tensor),\n/* harmony export */ cat: () => (/* binding */ cat),\n/* harmony export */ dynamicTimeWarping: () => (/* binding */ dynamicTimeWarping),\n/* harmony export */ interpolate: () => (/* binding */ interpolate),\n/* harmony export */ layer_norm: () => (/* binding */ layer_norm),\n/* harmony export */ mean: () => (/* binding */ mean),\n/* harmony export */ mean_pooling: () => (/* binding */ mean_pooling),\n/* harmony export */ ones: () => (/* binding */ ones),\n/* harmony export */ ones_like: () => (/* binding */ ones_like),\n/* harmony export */ permute: () => (/* binding */ permute),\n/* harmony export */ stack: () => (/* binding */ stack),\n/* harmony export */ std_mean: () => (/* binding */ std_mean)\n/* harmony export */ });\n/* harmony import */ var _backends_onnx_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../backends/onnx.js */ \"./node_modules/@xenova/transformers/src/backends/onnx.js\");\n/* harmony import */ var _maths_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./maths.js */ \"./node_modules/@xenova/transformers/src/utils/maths.js\");\n/**\n * @file Helper module for `Tensor` processing.\n * \n * These functions and classes are only used internally, \n * meaning an end-user shouldn't need to access anything here.\n * \n * @module utils/tensor\n */\n\n\n\n\n\n\nconst DataTypeMap = Object.freeze({\n float32: Float32Array,\n float64: Float64Array,\n string: Array, // string[]\n int8: Int8Array,\n uint8: Uint8Array,\n int16: Int16Array,\n uint16: Uint16Array,\n int32: Int32Array,\n uint32: Uint32Array,\n int64: BigInt64Array,\n uint64: BigUint64Array,\n bool: Uint8Array,\n});\n\n/**\n * @typedef {keyof typeof DataTypeMap} DataType\n * @typedef {import('./maths.js').AnyTypedArray | any[]} DataArray\n */\n\nconst ONNXTensor = _backends_onnx_js__WEBPACK_IMPORTED_MODULE_0__.ONNX.Tensor;\n\nclass Tensor {\n /** @type {number[]} Dimensions of the tensor. */\n dims;\n\n /** @type {DataType} Type of the tensor. */\n type;\n\n /** @type {DataArray} The data stored in the tensor. */\n data;\n\n /** @type {number} The number of elements in the tensor. */\n size;\n\n /**\n * Create a new Tensor or copy an existing Tensor.\n * @param {[DataType, DataArray, number[]]|[import('onnxruntime-common').Tensor]} args\n */\n constructor(...args) {\n if (args[0] instanceof ONNXTensor) {\n // Create shallow copy\n Object.assign(this, args[0]);\n\n } else {\n // Create new tensor\n Object.assign(this, new ONNXTensor(\n /** @type {DataType} */(args[0]),\n /** @type {Exclude} */(args[1]),\n args[2]\n ));\n }\n\n return new Proxy(this, {\n get: (obj, key) => {\n if (typeof key === 'string') {\n let index = Number(key);\n if (Number.isInteger(index)) {\n // key is an integer (i.e., index)\n return obj._getitem(index);\n }\n }\n // @ts-ignore\n return obj[key];\n },\n set: (obj, key, value) => {\n // TODO allow setting of data\n\n // @ts-ignore\n return obj[key] = value;\n }\n });\n }\n\n /**\n * Returns an iterator object for iterating over the tensor data in row-major order.\n * If the tensor has more than one dimension, the iterator will yield subarrays.\n * @returns {Iterator} An iterator object for iterating over the tensor data in row-major order.\n */\n *[Symbol.iterator]() {\n const [iterLength, ...iterDims] = this.dims;\n\n if (iterDims.length > 0) {\n const iterSize = iterDims.reduce((a, b) => a * b);\n for (let i = 0; i < iterLength; ++i) {\n yield this._subarray(i, iterSize, iterDims);\n }\n } else {\n yield* this.data\n }\n\n }\n\n /**\n * Index into a Tensor object.\n * @param {number} index The index to access.\n * @returns {Tensor} The data at the specified index.\n */\n _getitem(index) {\n const [iterLength, ...iterDims] = this.dims;\n\n index = safeIndex(index, iterLength);\n\n if (iterDims.length > 0) {\n const iterSize = iterDims.reduce((a, b) => a * b);\n return this._subarray(index, iterSize, iterDims);\n } else {\n return new Tensor(this.type, [this.data[index]], iterDims);\n }\n }\n\n /**\n * @param {number|bigint} item The item to search for in the tensor\n * @returns {number} The index of the first occurrence of item in the tensor data.\n */\n indexOf(item) {\n for (let index = 0; index < this.data.length; ++index) {\n // Note: == instead of === so we can match Ints with BigInts\n if (this.data[index] == item) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * @param {number} index \n * @param {number} iterSize \n * @param {any} iterDims \n * @returns {Tensor}\n */\n _subarray(index, iterSize, iterDims) {\n const o1 = index * iterSize;\n const o2 = (index + 1) * iterSize;\n\n // We use subarray if available (typed array), otherwise we use slice (normal array)\n const data =\n ('subarray' in this.data)\n ? this.data.subarray(o1, o2)\n : this.data.slice(o1, o2);\n return new Tensor(this.type, data, iterDims);\n }\n\n /**\n * Returns the value of this tensor as a standard JavaScript Number. This only works\n * for tensors with one element. For other cases, see `Tensor.tolist()`.\n * @returns {number|bigint} The value of this tensor as a standard JavaScript Number.\n * @throws {Error} If the tensor has more than one element.\n */\n item() {\n if (this.data.length !== 1) {\n throw new Error(`a Tensor with ${this.data.length} elements cannot be converted to Scalar`);\n }\n return this.data[0];\n }\n\n /**\n * Convert tensor data to a n-dimensional JS list\n * @returns {Array}\n */\n tolist() {\n return reshape(this.data, this.dims)\n }\n\n /**\n * Return a new Tensor with the sigmoid function applied to each element.\n * @returns {Tensor} The tensor with the sigmoid function applied.\n */\n sigmoid() {\n return this.clone().sigmoid_();\n }\n\n /**\n * Applies the sigmoid function to the tensor in place.\n * @returns {Tensor} Returns `this`.\n */\n sigmoid_() {\n for (let i = 0; i < this.data.length; ++i) {\n this.data[i] = 1 / (1 + Math.exp(-this.data[i]));\n }\n return this;\n }\n\n /**\n * Return a new Tensor with every element multiplied by a constant.\n * @param {number} val The value to multiply by.\n * @returns {Tensor} The new tensor.\n */\n mul(val) {\n return this.clone().mul_(val);\n }\n\n /**\n * Multiply the tensor by a constant in place.\n * @param {number} val The value to multiply by.\n * @returns {Tensor} Returns `this`.\n */\n mul_(val) {\n for (let i = 0; i < this.data.length; ++i) {\n this.data[i] *= val;\n }\n return this;\n }\n\n\n /**\n * Return a new Tensor with every element added by a constant.\n * @param {number} val The value to add by.\n * @returns {Tensor} The new tensor.\n */\n add(val) {\n return this.clone().add_(val);\n }\n\n /**\n * Add the tensor by a constant in place.\n * @param {number} val The value to add by.\n * @returns {Tensor} Returns `this`.\n */\n add_(val) {\n for (let i = 0; i < this.data.length; ++i) {\n this.data[i] += val;\n }\n return this;\n }\n clone() {\n return new Tensor(this.type, this.data.slice(), this.dims.slice());\n }\n\n slice(...slices) {\n // This allows for slicing with ranges and numbers\n let newTensorDims = [];\n let newOffsets = [];\n\n // slices is an array of numbers or arrays of numbers\n // e.g., slices = [0, [1, 3], null, [0, 3]]\n for (let sliceIndex = 0; sliceIndex < this.dims.length; ++sliceIndex) {\n let slice = slices[sliceIndex];\n\n if (slice === null || slice === undefined) {\n // null or undefined means take the whole dimension\n newOffsets.push([0, this.dims[sliceIndex]]);\n newTensorDims.push(this.dims[sliceIndex]);\n\n } else if (typeof slice === 'number') {\n slice = safeIndex(slice, this.dims[sliceIndex], sliceIndex);\n\n // A number means take a single element\n newOffsets.push([slice, slice + 1]);\n\n } else if (Array.isArray(slice) && slice.length === 2) {\n // An array of length 2 means take a range of elements\n\n if (slice[0] > slice[1]) {\n throw new Error(`Invalid slice: ${slice}`);\n }\n\n let offsets = [\n Math.max(slice[0], 0),\n Math.min(slice[1], this.dims[sliceIndex])\n ];\n\n newOffsets.push(offsets);\n newTensorDims.push(offsets[1] - offsets[0]);\n\n } else {\n throw new Error(`Invalid slice: ${slice}`);\n }\n }\n\n let newDims = newOffsets.map(([start, end]) => end - start);\n let newBufferSize = newDims.reduce((a, b) => a * b);\n\n // Allocate memory\n // @ts-ignore\n let data = new this.data.constructor(newBufferSize);\n\n // Precompute strides\n const stride = this.stride();\n\n for (let i = 0; i < newBufferSize; ++i) {\n let originalIndex = 0;\n for (let j = newDims.length - 1, num = i; j >= 0; --j) {\n const size = newDims[j];\n originalIndex += ((num % size) + newOffsets[j][0]) * stride[j];\n num = Math.floor(num / size);\n }\n data[i] = this.data[originalIndex];\n }\n return new Tensor(this.type, data, newTensorDims);\n\n }\n\n /**\n * Return a permuted version of this Tensor, according to the provided dimensions.\n * @param {...number} dims Dimensions to permute.\n * @returns {Tensor} The permuted tensor.\n */\n permute(...dims) {\n return permute(this, dims);\n }\n\n // TODO: implement transpose. For now (backwards compatibility), it's just an alias for permute()\n transpose(...dims) {\n return this.permute(...dims);\n }\n\n // TODO add .max() and .min() methods\n\n /**\n * Returns the sum of each row of the input tensor in the given dimension dim.\n * \n * @param {number} [dim=null] The dimension or dimensions to reduce. If `null`, all dimensions are reduced.\n * @param {boolean} keepdim Whether the output tensor has `dim` retained or not.\n * @returns The summed tensor\n */\n sum(dim = null, keepdim = false) {\n return this.norm(1, dim, keepdim);\n }\n\n /**\n * Returns the matrix norm or vector norm of a given tensor.\n * @param {number|string} [p='fro'] The order of norm\n * @param {number} [dim=null] Specifies which dimension of the tensor to calculate the norm across.\n * If dim is None, the norm will be calculated across all dimensions of input.\n * @param {boolean} [keepdim=false] Whether the output tensors have dim retained or not.\n * @returns {Tensor} The norm of the tensor.\n */\n norm(p = 'fro', dim = null, keepdim = false) {\n if (p === 'fro') {\n // NOTE: Since we only support integer dims, Frobenius norm produces the same result as p=2.\n p = 2;\n } else if (typeof p === 'string') {\n throw Error(`Unsupported norm: ${p}`);\n }\n\n if (dim === null) {\n // @ts-ignore\n let val = this.data.reduce((a, b) => a + (b ** p), 0) ** (1 / p);\n return new Tensor(this.type, [val], []);\n }\n\n // Negative indexing\n dim = safeIndex(dim, this.dims.length);\n\n // Calculate the shape of the resulting array after summation\n const resultDims = this.dims.slice(); // Copy the original dimensions\n resultDims[dim] = 1; // Remove the specified axis\n\n // Create a new array to store the accumulated values\n // @ts-ignore\n const result = new this.data.constructor(this.data.length / this.dims[dim]);\n\n // Iterate over the data array\n for (let i = 0; i < this.data.length; ++i) {\n\n // Calculate the index in the resulting array\n let resultIndex = 0;\n\n for (let j = this.dims.length - 1, num = i, resultMultiplier = 1; j >= 0; --j) {\n const size = this.dims[j];\n if (j !== dim) {\n const index = num % size;\n resultIndex += index * resultMultiplier;\n resultMultiplier *= resultDims[j];\n }\n num = Math.floor(num / size);\n }\n\n // Accumulate the value at the current index\n result[resultIndex] += (this.data[i]) ** p;\n }\n\n if (p !== 1) {\n for (let i = 0; i < result.length; ++i) {\n result[i] = result[i] ** (1 / p);\n }\n }\n\n if (!keepdim) {\n resultDims.splice(dim, 1);\n }\n\n return new Tensor(this.type, result, resultDims);\n }\n\n /**\n * Performs `L_p` normalization of inputs over specified dimension. Operates in place.\n * @param {number} [p=2] The exponent value in the norm formulation\n * @param {number} [dim=1] The dimension to reduce\n * @returns {Tensor} `this` for operation chaining.\n */\n normalize_(p = 2.0, dim = 1) {\n dim = safeIndex(dim, this.dims.length);\n\n const norm = this.norm(p, dim, true);\n\n for (let i = 0; i < this.data.length; ++i) {\n\n // Calculate the index in the resulting array\n let resultIndex = 0;\n\n for (let j = this.dims.length - 1, num = i, resultMultiplier = 1; j >= 0; --j) {\n const size = this.dims[j];\n if (j !== dim) {\n const index = num % size;\n resultIndex += index * resultMultiplier;\n resultMultiplier *= this.dims[j];\n }\n num = Math.floor(num / size);\n }\n\n // Divide by normalized value\n this.data[i] /= norm.data[resultIndex];\n }\n\n return this;\n }\n\n /**\n * Performs `L_p` normalization of inputs over specified dimension.\n * @param {number} [p=2] The exponent value in the norm formulation\n * @param {number} [dim=1] The dimension to reduce\n * @returns {Tensor} The normalized tensor.\n */\n normalize(p = 2.0, dim = 1) {\n return this.clone().normalize_(p, dim);\n }\n\n /**\n * Compute and return the stride of this tensor.\n * Stride is the jump necessary to go from one element to the next one in the specified dimension dim.\n * @returns {number[]} The stride of this tensor.\n */\n stride() {\n return dimsToStride(this.dims);\n }\n\n /**\n * Returns a tensor with all specified dimensions of input of size 1 removed.\n * \n * NOTE: The returned tensor shares the storage with the input tensor, so changing the contents of one will change the contents of the other.\n * If you would like a copy, use `tensor.clone()` before squeezing.\n * \n * @param {number} [dim=null] If given, the input will be squeezed only in the specified dimensions.\n * @returns The squeezed tensor\n */\n squeeze(dim = null) {\n return new Tensor(\n this.type,\n this.data,\n calc_squeeze_dims(this.dims, dim)\n )\n }\n\n /**\n * In-place version of @see {@link Tensor.squeeze}\n */\n squeeze_(dim = null) {\n this.dims = calc_squeeze_dims(this.dims, dim);\n return this;\n }\n\n /**\n * Returns a new tensor with a dimension of size one inserted at the specified position.\n * \n * NOTE: The returned tensor shares the same underlying data with this tensor.\n * \n * @param {number} dim The index at which to insert the singleton dimension\n * @returns The unsqueezed tensor\n */\n unsqueeze(dim = null) {\n return new Tensor(\n this.type,\n this.data,\n calc_unsqueeze_dims(this.dims, dim)\n );\n }\n\n /**\n * In-place version of @see {@link Tensor.unsqueeze}\n */\n unsqueeze_(dim = null) {\n this.dims = calc_unsqueeze_dims(this.dims, dim);\n return this;\n }\n\n /**\n * In-place version of @see {@link Tensor.flatten}\n */\n flatten_(start_dim = 0, end_dim = -1) {\n // TODO validate inputs\n end_dim = (end_dim + this.dims.length) % this.dims.length;\n\n let dimsToKeepBefore = this.dims.slice(0, start_dim);\n let dimsToFlatten = this.dims.slice(start_dim, end_dim + 1);\n let dimsToKeepAfter = this.dims.slice(end_dim + 1);\n\n this.dims = [...dimsToKeepBefore, dimsToFlatten.reduce((a, b) => a * b, 1), ...dimsToKeepAfter]\n return this;\n }\n\n /**\n * Flattens input by reshaping it into a one-dimensional tensor.\n * If `start_dim` or `end_dim` are passed, only dimensions starting with `start_dim`\n * and ending with `end_dim` are flattened. The order of elements in input is unchanged.\n * @param {number} start_dim the first dim to flatten\n * @param {number} end_dim the last dim to flatten\n * @returns The flattened tensor.\n */\n flatten(start_dim = 0, end_dim = -1) {\n return this.clone().flatten_(start_dim, end_dim);\n }\n\n /**\n * Returns a new tensor with the same data as the `self` tensor but of a different `shape`.\n * @param {...number} dims the desired size\n * @returns {Tensor} The tensor with the same data but different shape\n */\n view(...dims) {\n // TODO: validate dims\n let inferredIndex = -1;\n for (let i = 0; i < dims.length; ++i) {\n if (dims[i] === -1) {\n if (inferredIndex !== -1) {\n throw new Error(\"Only one dimension can be inferred\");\n }\n inferredIndex = i;\n }\n }\n\n if (inferredIndex !== -1) {\n // Some dimension must be inferred\n const productOther = dims.reduce((product, curr, index) => {\n return index !== inferredIndex ? product * curr : product\n }, 1);\n\n dims[inferredIndex] = this.data.length / productOther;\n }\n return new Tensor(this.type, this.data, dims); // NOTE: uses same underlying storage\n }\n\n neg_() {\n for (let i = 0; i < this.data.length; ++i) {\n this.data[i] = -this.data[i];\n }\n return this;\n }\n neg() {\n return this.clone().neg_();\n }\n\n /**\n * In-place version of @see {@link Tensor.clamp}\n */\n clamp_(min, max) {\n for (let i = 0; i < this.data.length; ++i) {\n this.data[i] = Math.min(Math.max(this.data[i], min), max);\n }\n return this;\n }\n\n /**\n * Clamps all elements in input into the range [ min, max ]\n * @param {number} min lower-bound of the range to be clamped to\n * @param {number} max upper-bound of the range to be clamped to\n * @returns the output tensor.\n */\n clamp(min, max) {\n return this.clone().clamp_(min, max);\n }\n\n /**\n * In-place version of @see {@link Tensor.round}\n */\n round_() {\n for (let i = 0; i < this.data.length; ++i) {\n this.data[i] = Math.round(this.data[i]);\n }\n return this;\n }\n\n /**\n * Rounds elements of input to the nearest integer.\n * @returns the output tensor.\n */\n round() {\n return this.clone().round_();\n }\n\n /**\n * Performs Tensor dtype conversion.\n * @param {DataType} type The desired data type.\n * @returns {Tensor} The converted tensor.\n */\n to(type) {\n // If the self Tensor already has the correct dtype, then self is returned.\n if (this.type === type) return this;\n\n // Otherwise, the returned tensor is a copy of self with the desired dtype.\n if (!DataTypeMap.hasOwnProperty(type)) {\n throw new Error(`Unsupported type: ${type}`);\n }\n // @ts-ignore\n return new Tensor(type, DataTypeMap[type].from(this.data), this.dims);\n }\n}\n\n/**\n * This creates a nested array of a given type and depth (see examples).\n * \n * @example\n * NestArray; // string[]\n * @example\n * NestArray; // number[][]\n * @example\n * NestArray; // string[][][] etc.\n * @template T\n * @template {number} Depth\n * @template {never[]} [Acc=[]]\n * @typedef {Acc['length'] extends Depth ? T : NestArray} NestArray\n */\n\n/**\n * Reshapes a 1-dimensional array into an n-dimensional array, according to the provided dimensions.\n *\n * @example\n * reshape([10 ], [1 ]); // Type: number[] Value: [10]\n * reshape([1, 2, 3, 4 ], [2, 2 ]); // Type: number[][] Value: [[1, 2], [3, 4]]\n * reshape([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); // Type: number[][][] Value: [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]\n * reshape([1, 2, 3, 4, 5, 6, 7, 8], [4, 2 ]); // Type: number[][] Value: [[1, 2], [3, 4], [5, 6], [7, 8]]\n * @param {T[]|DataArray} data The input array to reshape.\n * @param {DIM} dimensions The target shape/dimensions.\n * @template T\n * @template {[number]|number[]} DIM\n * @returns {NestArray} The reshaped array.\n */\nfunction reshape(data, dimensions) {\n\n const totalElements = data.length;\n const dimensionSize = dimensions.reduce((a, b) => a * b);\n\n if (totalElements !== dimensionSize) {\n throw Error(`cannot reshape array of size ${totalElements} into shape (${dimensions})`);\n }\n\n /** @type {any} */\n let reshapedArray = data;\n\n for (let i = dimensions.length - 1; i >= 0; i--) {\n reshapedArray = reshapedArray.reduce((acc, val) => {\n let lastArray = acc[acc.length - 1];\n\n if (lastArray.length < dimensions[i]) {\n lastArray.push(val);\n } else {\n acc.push([val]);\n }\n\n return acc;\n }, [[]]);\n }\n\n return reshapedArray[0];\n}\n\n/**\n * Permutes a tensor according to the provided axes.\n * @param {any} tensor The input tensor to permute.\n * @param {Array} axes The axes to permute the tensor along.\n * @returns {Tensor} The permuted tensor.\n */\nfunction permute(tensor, axes) {\n const [permutedData, shape] = (0,_maths_js__WEBPACK_IMPORTED_MODULE_1__.permute_data)(tensor.data, tensor.dims, axes);\n return new Tensor(tensor.type, permutedData, shape);\n}\n\n\n/**\n * Interpolates an Tensor to the given size.\n * @param {Tensor} input The input tensor to interpolate. Data must be channel-first (i.e., [c, h, w])\n * @param {number[]} size The output size of the image\n * @param {string} mode The interpolation mode\n * @param {boolean} align_corners Whether to align corners.\n * @returns {Tensor} The interpolated tensor.\n */\nfunction interpolate(input, [out_height, out_width], mode = 'bilinear', align_corners = false) {\n\n // Input image dimensions\n const in_channels = input.dims.at(-3) ?? 1;\n const in_height = input.dims.at(-2);\n const in_width = input.dims.at(-1);\n\n let output = (0,_maths_js__WEBPACK_IMPORTED_MODULE_1__.interpolate_data)(\n /** @type {import('./maths.js').TypedArray}*/(input.data),\n [in_channels, in_height, in_width],\n [out_height, out_width],\n mode,\n align_corners\n );\n return new Tensor(input.type, output, [in_channels, out_height, out_width]);\n}\n\n/**\n * Perform mean pooling of the last hidden state followed by a normalization step.\n * @param {Tensor} last_hidden_state Tensor of shape [batchSize, seqLength, embedDim]\n * @param {Tensor} attention_mask Tensor of shape [batchSize, seqLength]\n * @returns {Tensor} Returns a new Tensor of shape [batchSize, embedDim].\n */\nfunction mean_pooling(last_hidden_state, attention_mask) {\n // last_hidden_state: [batchSize, seqLength, embedDim]\n // attention_mask: [batchSize, seqLength]\n\n let shape = [last_hidden_state.dims[0], last_hidden_state.dims[2]];\n // @ts-ignore\n let returnedData = new last_hidden_state.data.constructor(shape[0] * shape[1]);\n let [batchSize, seqLength, embedDim] = last_hidden_state.dims;\n\n let outIndex = 0;\n for (let i = 0; i < batchSize; ++i) {\n let offset = i * embedDim * seqLength;\n\n for (let k = 0; k < embedDim; ++k) {\n let sum = 0;\n let count = 0;\n\n let attnMaskOffset = i * seqLength;\n let offset2 = offset + k;\n // Pool over all words in sequence\n for (let j = 0; j < seqLength; ++j) {\n // index into attention mask\n let attn = Number(attention_mask.data[attnMaskOffset + j]);\n\n count += attn;\n sum += last_hidden_state.data[offset2 + j * embedDim] * attn;\n }\n\n let avg = sum / count;\n returnedData[outIndex++] = avg;\n }\n }\n\n return new Tensor(\n last_hidden_state.type,\n returnedData,\n shape\n )\n}\n\n/**\n * Apply Layer Normalization for last certain number of dimensions.\n * @param {Tensor} input The input tensor\n * @param {number[]} normalized_shape input shape from an expected input of size\n * @param {Object} options The options for the layer normalization\n * @param {number} [options.eps=1e-5] A value added to the denominator for numerical stability.\n * @returns {Tensor} The normalized tensor.\n */\nfunction layer_norm(input, normalized_shape, {\n eps = 1e-5,\n} = {}) {\n if (input.dims.length !== 2) {\n throw new Error('`layer_norm` currently only supports 2D input.');\n }\n\n const [batchSize, featureDim] = input.dims;\n\n if (normalized_shape.length !== 1 && normalized_shape[0] !== featureDim) {\n throw new Error('`normalized_shape` must be a 1D array with shape `[input.dims[1]]`.');\n }\n\n const [std, mean] = std_mean(input, 1, 0, true);\n\n // @ts-ignore\n const returnedData = new input.data.constructor(input.data.length);\n\n for (let i = 0; i < batchSize; ++i) {\n const offset = i * featureDim;\n for (let j = 0; j < featureDim; ++j) {\n const offset2 = offset + j;\n returnedData[offset2] = (input.data[offset2] - mean.data[i]) / (std.data[i] + eps);\n }\n }\n return new Tensor(input.type, returnedData, input.dims);\n}\n\n/**\n * Helper function to calculate new dimensions when performing a squeeze operation.\n * @param {number[]} dims The dimensions of the tensor.\n * @param {number|number[]|null} dim The dimension(s) to squeeze.\n * @returns The new dimensions.\n * @private\n */\nfunction calc_squeeze_dims(dims, dim) {\n dims = dims.slice();\n if (dim === null) {\n dims = dims.filter((d) => d !== 1);\n } else if (typeof dim === 'number') {\n if (dims[dim] === 1) {\n dims.splice(dim, 1);\n }\n } else if (Array.isArray(dim)) {\n dims = dims.filter((x, i) => {\n return x !== 1 || !dim.includes(i);\n });\n }\n return dims;\n}\n\n/**\n * Helper function to calculate new dimensions when performing an unsqueeze operation.\n * @param {number[]} dims The dimensions of the tensor.\n * @param {number} dim The dimension to unsqueeze.\n * @returns The new dimensions.\n * @private\n */\nfunction calc_unsqueeze_dims(dims, dim) {\n // Dimension out of range (e.g., \"expected to be in range of [-4, 3], but got 4\")\n // + 1 since we allow inserting at the end (i.e. dim = -1)\n dim = safeIndex(dim, dims.length + 1);\n dims = dims.slice();\n // Insert 1 into specified dimension\n dims.splice(dim, 0, 1);\n return dims;\n}\n\n/**\n * Safely calculate the index for an array of a given size, allowing negative indexing.\n * @param {number} index The index that will be used.\n * @param {number} size The size of the array.\n * @param {number} [dimension=null] The dimension that the index is for (optional).\n * @returns {number} The index, guaranteed to be non-negative and less than `arrayLength`.\n * \n * @throws {Error} If the index is out of range.\n * @private\n */\nfunction safeIndex(index, size, dimension = null) {\n if (index < -size || index >= size) {\n throw new Error(`IndexError: index ${index} is out of bounds for dimension${dimension === null ? '' : ' ' + dimension} with size ${size}`);\n }\n\n if (index < 0) {\n // Negative indexing, ensuring positive index\n index = ((index % size) + size) % size;\n }\n return index;\n}\n\n/**\n * Concatenates an array of tensors along a specified dimension.\n * @param {Tensor[]} tensors The array of tensors to concatenate.\n * @param {number} dim The dimension to concatenate along.\n * @returns {Tensor} The concatenated tensor.\n */\nfunction cat(tensors, dim = 0) {\n dim = safeIndex(dim, tensors[0].dims.length);\n\n // TODO do validation of shapes\n\n const resultDims = tensors[0].dims.slice();\n resultDims[dim] = tensors.reduce((a, b) => a + b.dims[dim], 0);\n\n // Create a new array to store the accumulated values\n const resultSize = resultDims.reduce((a, b) => a * b, 1);\n // @ts-ignore\n const result = new tensors[0].data.constructor(resultSize);\n\n // Create output tensor of same type as first\n const resultType = tensors[0].type;\n\n if (dim === 0) {\n // Handle special case for performance reasons\n\n let offset = 0;\n for (let t of tensors) {\n result.set(t.data, offset);\n offset += t.data.length;\n }\n\n } else {\n\n let currentDim = 0;\n\n for (let t = 0; t < tensors.length; ++t) {\n let tensor = tensors[t];\n\n // Iterate over the data array\n for (let i = 0; i < tensor.data.length; ++i) {\n // Calculate the index in the resulting array\n let resultIndex = 0;\n\n for (let j = tensor.dims.length - 1, num = i, resultMultiplier = 1; j >= 0; --j) {\n const size = tensor.dims[j];\n let index = num % size;\n if (j === dim) {\n index += currentDim;\n }\n resultIndex += index * resultMultiplier;\n resultMultiplier *= resultDims[j];\n num = Math.floor(num / size);\n }\n // Accumulate the value at the current index\n result[resultIndex] = tensor.data[i];\n }\n\n currentDim += tensor.dims[dim];\n }\n }\n return new Tensor(resultType, result, resultDims);\n}\n\n/**\n * Stack an array of tensors along a specified dimension.\n * @param {Tensor[]} tensors The array of tensors to stack.\n * @param {number} dim The dimension to stack along.\n * @returns {Tensor} The stacked tensor.\n */\nfunction stack(tensors, dim = 0) {\n // TODO do validation of shapes\n // NOTE: stack expects each tensor to be equal size\n return cat(tensors.map(t => t.unsqueeze(dim)), dim);\n}\n\n\n/**\n * Calculates the standard deviation and mean over the dimensions specified by dim. dim can be a single dimension or `null` to reduce over all dimensions.\n * @param {Tensor} input the input tenso\n * @param {number|null} dim the dimension to reduce. If None, all dimensions are reduced.\n * @param {number} correction difference between the sample size and sample degrees of freedom. Defaults to Bessel's correction, correction=1.\n * @param {boolean} keepdim whether the output tensor has dim retained or not.\n * @returns {Tensor[]} A tuple of (std, mean) tensors.\n */\nfunction std_mean(input, dim = null, correction = 1, keepdim = false) {\n\n if (dim === null) {\n // None to reduce over all dimensions.\n // @ts-ignore\n const sum = input.data.reduce((a, b) => a + b, 0);\n const mean = sum / input.data.length;\n // @ts-ignore\n const std = Math.sqrt(input.data.reduce((a, b) => a + (b - mean) ** 2, 0) / (input.data.length - correction));\n\n const meanTensor = new Tensor(input.type, [mean], [/* scalar */]);\n const stdTensor = new Tensor(input.type, [std], [/* scalar */]);\n\n return [stdTensor, meanTensor];\n }\n\n // Negative indexing\n dim = safeIndex(dim, input.dims.length);\n\n const meanTensor = mean(input, dim, keepdim);\n\n // Calculate the shape of the resulting array after summation\n const resultDims = input.dims.slice(); // Copy the original dimensions\n resultDims[dim] = 1; // Remove the specified axis\n\n // Create a new array to store the accumulated values\n // @ts-ignore\n const result = new input.data.constructor(input.data.length / input.dims[dim]);\n\n // Iterate over the data array\n for (let i = 0; i < input.data.length; ++i) {\n\n // Calculate the index in the resulting array\n let resultIndex = 0;\n\n for (let j = input.dims.length - 1, num = i, resultMultiplier = 1; j >= 0; --j) {\n const size = input.dims[j];\n if (j !== dim) {\n const index = num % size;\n resultIndex += index * resultMultiplier;\n resultMultiplier *= resultDims[j];\n }\n num = Math.floor(num / size);\n }\n\n // Accumulate the value at the current index\n result[resultIndex] += (input.data[i] - meanTensor.data[resultIndex]) ** 2;\n }\n\n for (let i = 0; i < result.length; ++i) {\n result[i] = Math.sqrt(result[i] / (input.dims[dim] - correction));\n }\n\n if (!keepdim) {\n resultDims.splice(dim, 1);\n }\n\n const stdTensor = new Tensor(input.type, result, resultDims);\n\n return [stdTensor, meanTensor];\n}\n\n\n/**\n * Returns the mean value of each row of the input tensor in the given dimension dim.\n * @param {Tensor} input the input tensor.\n * @param {number|null} dim the dimension to reduce.\n * @param {boolean} keepdim whether the output tensor has dim retained or not.\n * @returns A new tensor with means taken along the specified dimension.\n */\nfunction mean(input, dim = null, keepdim = false) {\n\n if (dim === null) {\n // None to reduce over all dimensions.\n // @ts-ignore\n let val = input.data.reduce((a, b) => a + b, 0);\n return new Tensor(input.type, [val / input.data.length], [/* scalar */]);\n }\n\n // Negative indexing\n dim = safeIndex(dim, input.dims.length);\n\n // Calculate the shape of the resulting array after summation\n const resultDims = input.dims.slice(); // Copy the original dimensions\n resultDims[dim] = 1; // Remove the specified axis\n\n // Create a new array to store the accumulated values\n // @ts-ignore\n const result = new input.data.constructor(input.data.length / input.dims[dim]);\n\n // Iterate over the data array\n for (let i = 0; i < input.data.length; ++i) {\n\n // Calculate the index in the resulting array\n let resultIndex = 0;\n\n for (let j = input.dims.length - 1, num = i, resultMultiplier = 1; j >= 0; --j) {\n const size = input.dims[j];\n if (j !== dim) {\n const index = num % size;\n resultIndex += index * resultMultiplier;\n resultMultiplier *= resultDims[j];\n }\n num = Math.floor(num / size);\n }\n\n // Accumulate the value at the current index\n result[resultIndex] += input.data[i];\n }\n\n if (input.dims[dim] !== 1) {\n for (let i = 0; i < result.length; ++i) {\n result[i] = result[i] / input.dims[dim];\n }\n }\n\n if (!keepdim) {\n resultDims.splice(dim, 1);\n }\n\n return new Tensor(input.type, result, resultDims);\n}\n\n\n/**\n *\n * Measures similarity between two temporal sequences (e.g., input audio and output tokens\n * to generate token-level timestamps).\n * @param {Tensor} matrix \n * @returns {number[][]}\n */\nfunction dynamicTimeWarping(matrix) {\n const [output_length, input_length] = matrix.dims;\n\n const outputShape = [output_length + 1, input_length + 1];\n\n const cost = new Tensor(\n 'float32',\n new Float32Array(outputShape[0] * outputShape[1]).fill(Infinity),\n outputShape\n );\n\n const trace = new Tensor(\n 'float32',\n new Float32Array(outputShape[0] * outputShape[1]).fill(-1),\n outputShape\n )\n\n // same as `cost[0][0] = 0`;\n cost[0].data[0] = 0;\n\n for (let j = 1; j < input_length + 1; ++j) {\n for (let i = 1; i < output_length + 1; ++i) {\n\n const c0 = cost[i - 1][j - 1].item();\n const c1 = cost[i - 1][j].item();\n const c2 = cost[i][j - 1].item();\n\n let c, t;\n if (c0 < c1 && c0 < c2) {\n c = c0;\n t = 0;\n } else if (c1 < c0 && c1 < c2) {\n c = c1;\n t = 1;\n } else {\n c = c2;\n t = 2;\n }\n\n cost[i].data[j] = matrix[i - 1][j - 1].item() + c;\n trace[i].data[j] = t;\n }\n }\n\n // backtrace\n let i = output_length;\n let j = input_length;\n\n // @ts-ignore\n trace.data.fill(2, 0, outputShape[1]) // trace[0, :] = 2\n for (let i = 0; i < outputShape[0]; ++i) { // trace[:, 0] = 1\n trace[i].data[0] = 1;\n }\n\n let text_indices = [];\n let time_indices = [];\n\n while (i > 0 || j > 0) {\n text_indices.push(i - 1);\n time_indices.push(j - 1);\n\n const t = trace[i][j].item();\n switch (t) {\n case 0:\n --i; --j;\n break;\n case 1:\n --i;\n break;\n case 2:\n --j;\n break;\n default:\n throw new Error(\n `Internal error in dynamic time warping. Unexpected trace[${i}, ${j}]. Please file a bug report.`\n )\n }\n }\n\n text_indices.reverse();\n time_indices.reverse();\n\n return [text_indices, time_indices];\n\n}\n\nfunction dimsToStride(dims) {\n const stride = new Array(dims.length);\n for (let i = dims.length - 1, s2 = 1; i >= 0; --i) {\n stride[i] = s2;\n s2 *= dims[i];\n }\n return stride;\n}\n\n/**\n * Returns a tensor filled with the scalar value 1, with the shape defined by the variable argument size.\n * @param {number[]} size A sequence of integers defining the shape of the output tensor.\n */\nfunction ones(size) {\n const numElements = size.reduce((a, b) => a * b, 1);\n return new Tensor(\n 'int64',\n new BigInt64Array(numElements).fill(1n),\n size\n )\n}\n\n/**\n * Returns a tensor filled with the scalar value 1, with the same size as input.\n * @param {Tensor} tensor The size of input will determine size of the output tensor.\n * @returns The ones tensor.\n */\nfunction ones_like(tensor) {\n return ones(tensor.dims);\n}\n\n\n//# sourceURL=webpack://qdrant-frontend/./node_modules/@xenova/transformers/src/utils/tensor.js?"); + +/***/ }), + +/***/ "./node_modules/ag-grid-community/dist/package/main.esm.mjs": +/*!******************************************************************!*\ + !*** ./node_modules/ag-grid-community/dist/package/main.esm.mjs ***! + \******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ALWAYS_SYNC_GLOBAL_EVENTS: () => (/* binding */ ALWAYS_SYNC_GLOBAL_EVENTS),\n/* harmony export */ AbstractHeaderCellCtrl: () => (/* binding */ AbstractHeaderCellCtrl),\n/* harmony export */ AgAbstractField: () => (/* binding */ AgAbstractField),\n/* harmony export */ AgAbstractLabel: () => (/* binding */ AgAbstractLabel),\n/* harmony export */ AgAutocomplete: () => (/* binding */ AgAutocomplete),\n/* harmony export */ AgCheckbox: () => (/* binding */ AgCheckbox),\n/* harmony export */ AgDialog: () => (/* binding */ AgDialog),\n/* harmony export */ AgGroupComponent: () => (/* binding */ AgGroupComponent),\n/* harmony export */ AgInputDateField: () => (/* binding */ AgInputDateField),\n/* harmony export */ AgInputNumberField: () => (/* binding */ AgInputNumberField),\n/* harmony export */ AgInputRange: () => (/* binding */ AgInputRange),\n/* harmony export */ AgInputTextArea: () => (/* binding */ AgInputTextArea),\n/* harmony export */ AgInputTextField: () => (/* binding */ AgInputTextField),\n/* harmony export */ AgMenuItemComponent: () => (/* binding */ AgMenuItemComponent),\n/* harmony export */ AgMenuItemRenderer: () => (/* binding */ AgMenuItemRenderer),\n/* harmony export */ AgMenuList: () => (/* binding */ AgMenuList),\n/* harmony export */ AgMenuPanel: () => (/* binding */ AgMenuPanel),\n/* harmony export */ AgPanel: () => (/* binding */ AgPanel),\n/* harmony export */ AgPickerField: () => (/* binding */ AgPickerField),\n/* harmony export */ AgPromise: () => (/* binding */ AgPromise),\n/* harmony export */ AgPromiseStatus: () => (/* binding */ AgPromiseStatus),\n/* harmony export */ AgRadioButton: () => (/* binding */ AgRadioButton),\n/* harmony export */ AgRichSelect: () => (/* binding */ AgRichSelect),\n/* harmony export */ AgSelect: () => (/* binding */ AgSelect),\n/* harmony export */ AgSlider: () => (/* binding */ AgSlider),\n/* harmony export */ AgStackComponentsRegistry: () => (/* binding */ AgStackComponentsRegistry),\n/* harmony export */ AgToggleButton: () => (/* binding */ AgToggleButton),\n/* harmony export */ AlignedGridsService: () => (/* binding */ AlignedGridsService),\n/* harmony export */ AnimateShowChangeCellRenderer: () => (/* binding */ AnimateShowChangeCellRenderer),\n/* harmony export */ AnimateSlideCellRenderer: () => (/* binding */ AnimateSlideCellRenderer),\n/* harmony export */ AnimationFrameService: () => (/* binding */ AnimationFrameService),\n/* harmony export */ AutoScrollService: () => (/* binding */ AutoScrollService),\n/* harmony export */ AutoWidthCalculator: () => (/* binding */ AutoWidthCalculator),\n/* harmony export */ Autowired: () => (/* binding */ Autowired),\n/* harmony export */ BarColumnLabelPlacement: () => (/* binding */ BarColumnLabelPlacement),\n/* harmony export */ BaseComponentWrapper: () => (/* binding */ BaseComponentWrapper),\n/* harmony export */ BaseCreator: () => (/* binding */ BaseCreator),\n/* harmony export */ BaseGridSerializingSession: () => (/* binding */ BaseGridSerializingSession),\n/* harmony export */ Bean: () => (/* binding */ Bean),\n/* harmony export */ BeanStub: () => (/* binding */ BeanStub),\n/* harmony export */ Beans: () => (/* binding */ Beans),\n/* harmony export */ BodyDropPivotTarget: () => (/* binding */ BodyDropPivotTarget),\n/* harmony export */ BodyDropTarget: () => (/* binding */ BodyDropTarget),\n/* harmony export */ CellComp: () => (/* binding */ CellComp),\n/* harmony export */ CellCtrl: () => (/* binding */ CellCtrl),\n/* harmony export */ CellNavigationService: () => (/* binding */ CellNavigationService),\n/* harmony export */ CellPositionUtils: () => (/* binding */ CellPositionUtils),\n/* harmony export */ CellRangeType: () => (/* binding */ CellRangeType),\n/* harmony export */ ChangedPath: () => (/* binding */ ChangedPath),\n/* harmony export */ CheckboxCellEditor: () => (/* binding */ CheckboxCellEditor),\n/* harmony export */ CheckboxCellRenderer: () => (/* binding */ CheckboxCellRenderer),\n/* harmony export */ CheckboxSelectionComponent: () => (/* binding */ CheckboxSelectionComponent),\n/* harmony export */ ClientSideRowModelModule: () => (/* binding */ ClientSideRowModelModule),\n/* harmony export */ ClientSideRowModelSteps: () => (/* binding */ ClientSideRowModelSteps),\n/* harmony export */ ColDefUtil: () => (/* binding */ ColDefUtil),\n/* harmony export */ Column: () => (/* binding */ Column),\n/* harmony export */ ColumnApi: () => (/* binding */ ColumnApi),\n/* harmony export */ ColumnFactory: () => (/* binding */ ColumnFactory),\n/* harmony export */ ColumnGroup: () => (/* binding */ ColumnGroup),\n/* harmony export */ ColumnKeyCreator: () => (/* binding */ ColumnKeyCreator),\n/* harmony export */ ColumnModel: () => (/* binding */ ColumnModel),\n/* harmony export */ ColumnUtils: () => (/* binding */ ColumnUtils),\n/* harmony export */ Component: () => (/* binding */ Component),\n/* harmony export */ ComponentUtil: () => (/* binding */ ComponentUtil),\n/* harmony export */ Context: () => (/* binding */ Context),\n/* harmony export */ CssClassApplier: () => (/* binding */ CssClassApplier),\n/* harmony export */ CssClassManager: () => (/* binding */ CssClassManager),\n/* harmony export */ CsvCreator: () => (/* binding */ CsvCreator),\n/* harmony export */ CsvExportModule: () => (/* binding */ CsvExportModule),\n/* harmony export */ CtrlsService: () => (/* binding */ CtrlsService),\n/* harmony export */ DataTypeService: () => (/* binding */ DataTypeService),\n/* harmony export */ DateCellEditor: () => (/* binding */ DateCellEditor),\n/* harmony export */ DateFilter: () => (/* binding */ DateFilter),\n/* harmony export */ DateStringCellEditor: () => (/* binding */ DateStringCellEditor),\n/* harmony export */ DisplayedGroupCreator: () => (/* binding */ DisplayedGroupCreator),\n/* harmony export */ Downloader: () => (/* binding */ Downloader),\n/* harmony export */ DragAndDropService: () => (/* binding */ DragAndDropService),\n/* harmony export */ DragService: () => (/* binding */ DragService),\n/* harmony export */ DragSourceType: () => (/* binding */ DragSourceType),\n/* harmony export */ Environment: () => (/* binding */ Environment),\n/* harmony export */ EventService: () => (/* binding */ EventService),\n/* harmony export */ Events: () => (/* binding */ Events),\n/* harmony export */ ExcelFactoryMode: () => (/* binding */ ExcelFactoryMode),\n/* harmony export */ ExpansionService: () => (/* binding */ ExpansionService),\n/* harmony export */ ExpressionService: () => (/* binding */ ExpressionService),\n/* harmony export */ FilterManager: () => (/* binding */ FilterManager),\n/* harmony export */ FloatingFilterMapper: () => (/* binding */ FloatingFilterMapper),\n/* harmony export */ FocusService: () => (/* binding */ FocusService),\n/* harmony export */ GROUP_AUTO_COLUMN_ID: () => (/* binding */ GROUP_AUTO_COLUMN_ID),\n/* harmony export */ Grid: () => (/* binding */ Grid),\n/* harmony export */ GridApi: () => (/* binding */ GridApi),\n/* harmony export */ GridBodyComp: () => (/* binding */ GridBodyComp),\n/* harmony export */ GridBodyCtrl: () => (/* binding */ GridBodyCtrl),\n/* harmony export */ GridComp: () => (/* binding */ GridComp),\n/* harmony export */ GridCoreCreator: () => (/* binding */ GridCoreCreator),\n/* harmony export */ GridCtrl: () => (/* binding */ GridCtrl),\n/* harmony export */ GridHeaderComp: () => (/* binding */ GridHeaderComp),\n/* harmony export */ GridHeaderCtrl: () => (/* binding */ GridHeaderCtrl),\n/* harmony export */ GridOptionsService: () => (/* binding */ GridOptionsService),\n/* harmony export */ GridSerializer: () => (/* binding */ GridSerializer),\n/* harmony export */ GroupCellRenderer: () => (/* binding */ GroupCellRenderer),\n/* harmony export */ GroupCellRendererCtrl: () => (/* binding */ GroupCellRendererCtrl),\n/* harmony export */ GroupInstanceIdCreator: () => (/* binding */ GroupInstanceIdCreator),\n/* harmony export */ HeaderCellCtrl: () => (/* binding */ HeaderCellCtrl),\n/* harmony export */ HeaderFilterCellComp: () => (/* binding */ HeaderFilterCellComp),\n/* harmony export */ HeaderFilterCellCtrl: () => (/* binding */ HeaderFilterCellCtrl),\n/* harmony export */ HeaderGroupCellCtrl: () => (/* binding */ HeaderGroupCellCtrl),\n/* harmony export */ HeaderNavigationDirection: () => (/* binding */ HeaderNavigationDirection),\n/* harmony export */ HeaderNavigationService: () => (/* binding */ HeaderNavigationService),\n/* harmony export */ HeaderPositionUtils: () => (/* binding */ HeaderPositionUtils),\n/* harmony export */ HeaderRowComp: () => (/* binding */ HeaderRowComp),\n/* harmony export */ HeaderRowContainerComp: () => (/* binding */ HeaderRowContainerComp),\n/* harmony export */ HeaderRowContainerCtrl: () => (/* binding */ HeaderRowContainerCtrl),\n/* harmony export */ HeaderRowCtrl: () => (/* binding */ HeaderRowCtrl),\n/* harmony export */ HeaderRowType: () => (/* binding */ HeaderRowType),\n/* harmony export */ HorizontalDirection: () => (/* binding */ HorizontalDirection),\n/* harmony export */ HorizontalResizeService: () => (/* binding */ HorizontalResizeService),\n/* harmony export */ InfiniteRowModelModule: () => (/* binding */ InfiniteRowModelModule),\n/* harmony export */ KeyCode: () => (/* binding */ KeyCode),\n/* harmony export */ LargeTextCellEditor: () => (/* binding */ LargeTextCellEditor),\n/* harmony export */ LayoutCssClasses: () => (/* binding */ LayoutCssClasses),\n/* harmony export */ LocaleService: () => (/* binding */ LocaleService),\n/* harmony export */ Logger: () => (/* binding */ Logger),\n/* harmony export */ LoggerFactory: () => (/* binding */ LoggerFactory),\n/* harmony export */ ManagedFocusFeature: () => (/* binding */ ManagedFocusFeature),\n/* harmony export */ MenuService: () => (/* binding */ MenuService),\n/* harmony export */ ModuleNames: () => (/* binding */ ModuleNames),\n/* harmony export */ ModuleRegistry: () => (/* binding */ ModuleRegistry),\n/* harmony export */ MouseEventService: () => (/* binding */ MouseEventService),\n/* harmony export */ MoveColumnFeature: () => (/* binding */ MoveColumnFeature),\n/* harmony export */ NavigationService: () => (/* binding */ NavigationService),\n/* harmony export */ NumberCellEditor: () => (/* binding */ NumberCellEditor),\n/* harmony export */ NumberFilter: () => (/* binding */ NumberFilter),\n/* harmony export */ NumberSequence: () => (/* binding */ NumberSequence),\n/* harmony export */ Optional: () => (/* binding */ Optional),\n/* harmony export */ PaginationProxy: () => (/* binding */ PaginationProxy),\n/* harmony export */ PillDragComp: () => (/* binding */ PillDragComp),\n/* harmony export */ PillDropZonePanel: () => (/* binding */ PillDropZonePanel),\n/* harmony export */ PinnedRowModel: () => (/* binding */ PinnedRowModel),\n/* harmony export */ PopupComponent: () => (/* binding */ PopupComponent),\n/* harmony export */ PopupEditorWrapper: () => (/* binding */ PopupEditorWrapper),\n/* harmony export */ PopupService: () => (/* binding */ PopupService),\n/* harmony export */ PositionableFeature: () => (/* binding */ PositionableFeature),\n/* harmony export */ PostConstruct: () => (/* binding */ PostConstruct),\n/* harmony export */ PreConstruct: () => (/* binding */ PreConstruct),\n/* harmony export */ PreDestroy: () => (/* binding */ PreDestroy),\n/* harmony export */ PropertyKeys: () => (/* binding */ PropertyKeys),\n/* harmony export */ ProvidedColumnGroup: () => (/* binding */ ProvidedColumnGroup),\n/* harmony export */ ProvidedFilter: () => (/* binding */ ProvidedFilter),\n/* harmony export */ Qualifier: () => (/* binding */ Qualifier),\n/* harmony export */ QuerySelector: () => (/* binding */ QuerySelector),\n/* harmony export */ RefSelector: () => (/* binding */ RefSelector),\n/* harmony export */ ResizeObserverService: () => (/* binding */ ResizeObserverService),\n/* harmony export */ RowAnimationCssClasses: () => (/* binding */ RowAnimationCssClasses),\n/* harmony export */ RowContainerComp: () => (/* binding */ RowContainerComp),\n/* harmony export */ RowContainerCtrl: () => (/* binding */ RowContainerCtrl),\n/* harmony export */ RowContainerName: () => (/* binding */ RowContainerName),\n/* harmony export */ RowContainerType: () => (/* binding */ RowContainerType),\n/* harmony export */ RowCtrl: () => (/* binding */ RowCtrl),\n/* harmony export */ RowHighlightPosition: () => (/* binding */ RowHighlightPosition),\n/* harmony export */ RowNode: () => (/* binding */ RowNode),\n/* harmony export */ RowNodeBlock: () => (/* binding */ RowNodeBlock),\n/* harmony export */ RowNodeBlockLoader: () => (/* binding */ RowNodeBlockLoader),\n/* harmony export */ RowNodeSorter: () => (/* binding */ RowNodeSorter),\n/* harmony export */ RowPositionUtils: () => (/* binding */ RowPositionUtils),\n/* harmony export */ RowRenderer: () => (/* binding */ RowRenderer),\n/* harmony export */ RowType: () => (/* binding */ RowType),\n/* harmony export */ ScalarFilter: () => (/* binding */ ScalarFilter),\n/* harmony export */ ScrollVisibleService: () => (/* binding */ ScrollVisibleService),\n/* harmony export */ SelectCellEditor: () => (/* binding */ SelectCellEditor),\n/* harmony export */ SelectableService: () => (/* binding */ SelectableService),\n/* harmony export */ SelectionHandleType: () => (/* binding */ SelectionHandleType),\n/* harmony export */ ServerSideTransactionResultStatus: () => (/* binding */ ServerSideTransactionResultStatus),\n/* harmony export */ SetLeftFeature: () => (/* binding */ SetLeftFeature),\n/* harmony export */ SimpleFilter: () => (/* binding */ SimpleFilter),\n/* harmony export */ SortController: () => (/* binding */ SortController),\n/* harmony export */ SortIndicatorComp: () => (/* binding */ SortIndicatorComp),\n/* harmony export */ StandardMenuFactory: () => (/* binding */ StandardMenuFactory),\n/* harmony export */ StylingService: () => (/* binding */ StylingService),\n/* harmony export */ TabGuardClassNames: () => (/* binding */ TabGuardClassNames),\n/* harmony export */ TabGuardComp: () => (/* binding */ TabGuardComp),\n/* harmony export */ TabGuardCtrl: () => (/* binding */ TabGuardCtrl),\n/* harmony export */ TabbedLayout: () => (/* binding */ TabbedLayout),\n/* harmony export */ TemplateService: () => (/* binding */ TemplateService),\n/* harmony export */ TextCellEditor: () => (/* binding */ TextCellEditor),\n/* harmony export */ TextFilter: () => (/* binding */ TextFilter),\n/* harmony export */ TextFloatingFilter: () => (/* binding */ TextFloatingFilter),\n/* harmony export */ Timer: () => (/* binding */ Timer),\n/* harmony export */ TooltipFeature: () => (/* binding */ TooltipFeature),\n/* harmony export */ TooltipStateManager: () => (/* binding */ TooltipStateManager),\n/* harmony export */ TouchListener: () => (/* binding */ TouchListener),\n/* harmony export */ UserComponentFactory: () => (/* binding */ UserComponentFactory),\n/* harmony export */ UserComponentRegistry: () => (/* binding */ UserComponentRegistry),\n/* harmony export */ ValueCache: () => (/* binding */ ValueCache),\n/* harmony export */ ValueFormatterService: () => (/* binding */ ValueFormatterService),\n/* harmony export */ ValueParserService: () => (/* binding */ ValueParserService),\n/* harmony export */ ValueService: () => (/* binding */ ValueService),\n/* harmony export */ VanillaFrameworkOverrides: () => (/* binding */ VanillaFrameworkOverrides),\n/* harmony export */ VerticalDirection: () => (/* binding */ VerticalDirection),\n/* harmony export */ VirtualList: () => (/* binding */ VirtualList),\n/* harmony export */ VirtualListDragFeature: () => (/* binding */ VirtualListDragFeature),\n/* harmony export */ XmlFactory: () => (/* binding */ XmlFactory),\n/* harmony export */ ZipContainer: () => (/* binding */ ZipContainer),\n/* harmony export */ _: () => (/* binding */ _),\n/* harmony export */ createGrid: () => (/* binding */ createGrid),\n/* harmony export */ getRowContainerTypeForName: () => (/* binding */ getRowContainerTypeForName)\n/* harmony export */ });\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __decorateClass = (decorators, target, key, kind) => {\n var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;\n for (var i = decorators.length - 1, decorator; i >= 0; i--)\n if (decorator = decorators[i])\n result = (kind ? decorator(target, key, result) : decorator(result)) || result;\n if (kind && result)\n __defProp(target, key, result);\n return result;\n};\nvar __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);\n\n// community-modules/core/src/utils/generic.ts\nvar generic_exports = {};\n__export(generic_exports, {\n attrToBoolean: () => attrToBoolean,\n attrToNumber: () => attrToNumber,\n attrToString: () => attrToString,\n defaultComparator: () => defaultComparator,\n exists: () => exists,\n jsonEquals: () => jsonEquals,\n makeNull: () => makeNull,\n missing: () => missing,\n missingOrEmpty: () => missingOrEmpty,\n toStringOrNull: () => toStringOrNull,\n values: () => values\n});\nfunction makeNull(value) {\n if (value == null || value === \"\") {\n return null;\n }\n return value;\n}\nfunction exists(value, allowEmptyString = false) {\n return value != null && (value !== \"\" || allowEmptyString);\n}\nfunction missing(value) {\n return !exists(value);\n}\nfunction missingOrEmpty(value) {\n return value == null || value.length === 0;\n}\nfunction toStringOrNull(value) {\n return value != null && typeof value.toString === \"function\" ? value.toString() : null;\n}\nfunction attrToNumber(value) {\n if (value === void 0) {\n return;\n }\n if (value === null || value === \"\") {\n return null;\n }\n if (typeof value === \"number\") {\n return isNaN(value) ? void 0 : value;\n }\n const valueParsed = parseInt(value, 10);\n return isNaN(valueParsed) ? void 0 : valueParsed;\n}\nfunction attrToBoolean(value) {\n if (value === void 0) {\n return;\n }\n if (value === null || value === \"\") {\n return false;\n }\n if (typeof value === \"boolean\") {\n return value;\n }\n return /true/i.test(value);\n}\nfunction attrToString(value) {\n if (value == null || value === \"\") {\n return;\n }\n return value;\n}\nfunction jsonEquals(val1, val2) {\n const val1Json = val1 ? JSON.stringify(val1) : null;\n const val2Json = val2 ? JSON.stringify(val2) : null;\n return val1Json === val2Json;\n}\nfunction defaultComparator(valueA, valueB, accentedCompare = false) {\n const valueAMissing = valueA == null;\n const valueBMissing = valueB == null;\n if (valueA && valueA.toNumber) {\n valueA = valueA.toNumber();\n }\n if (valueB && valueB.toNumber) {\n valueB = valueB.toNumber();\n }\n if (valueAMissing && valueBMissing) {\n return 0;\n }\n if (valueAMissing) {\n return -1;\n }\n if (valueBMissing) {\n return 1;\n }\n function doQuickCompare(a, b) {\n return a > b ? 1 : a < b ? -1 : 0;\n }\n if (typeof valueA !== \"string\") {\n return doQuickCompare(valueA, valueB);\n }\n if (!accentedCompare) {\n return doQuickCompare(valueA, valueB);\n }\n try {\n return valueA.localeCompare(valueB);\n } catch (e) {\n return doQuickCompare(valueA, valueB);\n }\n}\nfunction values(object) {\n if (object instanceof Set || object instanceof Map) {\n const arr = [];\n object.forEach((value) => arr.push(value));\n return arr;\n }\n return Object.values(object);\n}\n\n// community-modules/core/src/columns/columnKeyCreator.ts\nvar ColumnKeyCreator = class {\n constructor() {\n this.existingKeys = {};\n }\n addExistingKeys(keys2) {\n for (let i = 0; i < keys2.length; i++) {\n this.existingKeys[keys2[i]] = true;\n }\n }\n getUniqueKey(colId, colField) {\n colId = toStringOrNull(colId);\n let count = 0;\n while (true) {\n let idToTry;\n if (colId) {\n idToTry = colId;\n if (count !== 0) {\n idToTry += \"_\" + count;\n }\n } else if (colField) {\n idToTry = colField;\n if (count !== 0) {\n idToTry += \"_\" + count;\n }\n } else {\n idToTry = count;\n }\n if (!this.existingKeys[idToTry]) {\n this.existingKeys[idToTry] = true;\n return String(idToTry);\n }\n count++;\n }\n }\n};\n\n// community-modules/core/src/utils/object.ts\nvar object_exports = {};\n__export(object_exports, {\n cloneObject: () => cloneObject,\n deepCloneDefinition: () => deepCloneDefinition,\n getAllValuesInObject: () => getAllValuesInObject,\n getValueUsingField: () => getValueUsingField,\n isNonNullObject: () => isNonNullObject,\n iterateObject: () => iterateObject,\n mergeDeep: () => mergeDeep,\n removeAllReferences: () => removeAllReferences\n});\nfunction iterateObject(object, callback) {\n if (object == null) {\n return;\n }\n if (Array.isArray(object)) {\n for (let i = 0; i < object.length; i++) {\n callback(i.toString(), object[i]);\n }\n return;\n }\n for (const [key, value] of Object.entries(object)) {\n callback(key, value);\n }\n}\nfunction cloneObject(object) {\n const copy = {};\n const keys2 = Object.keys(object);\n for (let i = 0; i < keys2.length; i++) {\n const key = keys2[i];\n const value = object[key];\n copy[key] = value;\n }\n return copy;\n}\nfunction deepCloneDefinition(object, keysToSkip) {\n if (!object) {\n return;\n }\n const obj = object;\n const res = {};\n Object.keys(obj).forEach((key) => {\n if (keysToSkip && keysToSkip.indexOf(key) >= 0) {\n return;\n }\n const value = obj[key];\n const sourceIsSimpleObject = isNonNullObject(value) && value.constructor === Object;\n if (sourceIsSimpleObject) {\n res[key] = deepCloneDefinition(value);\n } else {\n res[key] = value;\n }\n });\n return res;\n}\nfunction getAllValuesInObject(obj) {\n if (!obj) {\n return [];\n }\n const anyObject = Object;\n if (typeof anyObject.values === \"function\") {\n return anyObject.values(obj);\n }\n const ret = [];\n for (const key in obj) {\n if (obj.hasOwnProperty(key) && obj.propertyIsEnumerable(key)) {\n ret.push(obj[key]);\n }\n }\n return ret;\n}\nfunction mergeDeep(dest, source, copyUndefined = true, makeCopyOfSimpleObjects = false) {\n if (!exists(source)) {\n return;\n }\n iterateObject(source, (key, sourceValue) => {\n let destValue = dest[key];\n if (destValue === sourceValue) {\n return;\n }\n if (makeCopyOfSimpleObjects) {\n const objectIsDueToBeCopied = destValue == null && sourceValue != null;\n if (objectIsDueToBeCopied) {\n const sourceIsSimpleObject = typeof sourceValue === \"object\" && sourceValue.constructor === Object;\n const dontCopy = sourceIsSimpleObject;\n if (dontCopy) {\n destValue = {};\n dest[key] = destValue;\n }\n }\n }\n if (isNonNullObject(sourceValue) && isNonNullObject(destValue) && !Array.isArray(destValue)) {\n mergeDeep(destValue, sourceValue, copyUndefined, makeCopyOfSimpleObjects);\n } else if (copyUndefined || sourceValue !== void 0) {\n dest[key] = sourceValue;\n }\n });\n}\nfunction getValueUsingField(data, field, fieldContainsDots) {\n if (!field || !data) {\n return;\n }\n if (!fieldContainsDots) {\n return data[field];\n }\n const fields = field.split(\".\");\n let currentObject = data;\n for (let i = 0; i < fields.length; i++) {\n if (currentObject == null) {\n return void 0;\n }\n currentObject = currentObject[fields[i]];\n }\n return currentObject;\n}\nfunction removeAllReferences(obj, preserveKeys = [], preDestroyLink) {\n Object.keys(obj).forEach((key) => {\n const value = obj[key];\n if (typeof value === \"object\" && !preserveKeys.includes(key)) {\n obj[key] = void 0;\n }\n });\n const proto = Object.getPrototypeOf(obj);\n const properties = {};\n const msgFunc = (key) => `AG Grid: Grid API function ${key}() cannot be called as the grid has been destroyed.\n It is recommended to remove local references to the grid api. Alternatively, check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.\n To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${preDestroyLink}`;\n Object.getOwnPropertyNames(proto).forEach((key) => {\n const value = proto[key];\n if (typeof value === \"function\" && !preserveKeys.includes(key)) {\n const func = () => {\n console.warn(msgFunc(key));\n };\n properties[key] = { value: func, writable: true };\n }\n });\n Object.defineProperties(obj, properties);\n}\nfunction isNonNullObject(value) {\n return typeof value === \"object\" && value !== null;\n}\n\n// community-modules/core/src/utils/function.ts\nvar function_exports = {};\n__export(function_exports, {\n compose: () => compose,\n debounce: () => debounce,\n doOnce: () => doOnce,\n errorOnce: () => errorOnce,\n executeAfter: () => executeAfter,\n executeInAWhile: () => executeInAWhile,\n executeNextVMTurn: () => executeNextVMTurn,\n getFunctionName: () => getFunctionName,\n isFunction: () => isFunction,\n noop: () => noop,\n throttle: () => throttle,\n waitUntil: () => waitUntil,\n warnOnce: () => warnOnce\n});\nvar doOnceFlags = {};\nfunction doOnce(func, key) {\n if (doOnceFlags[key]) {\n return;\n }\n func();\n doOnceFlags[key] = true;\n}\nfunction warnOnce(msg) {\n doOnce(() => console.warn(\"AG Grid: \" + msg), msg);\n}\nfunction errorOnce(msg) {\n doOnce(() => console.error(\"AG Grid: \" + msg), msg);\n}\nfunction getFunctionName(funcConstructor) {\n if (funcConstructor.name) {\n return funcConstructor.name;\n }\n const matches = /function\\s+([^\\(]+)/.exec(funcConstructor.toString());\n return matches && matches.length === 2 ? matches[1].trim() : null;\n}\nfunction isFunction(val) {\n return !!(val && val.constructor && val.call && val.apply);\n}\nfunction executeInAWhile(funcs) {\n executeAfter(funcs, 400);\n}\nvar executeNextVMTurnFuncs = [];\nvar executeNextVMTurnPending = false;\nfunction executeNextVMTurn(func) {\n executeNextVMTurnFuncs.push(func);\n if (executeNextVMTurnPending) {\n return;\n }\n executeNextVMTurnPending = true;\n window.setTimeout(() => {\n const funcsCopy = executeNextVMTurnFuncs.slice();\n executeNextVMTurnFuncs.length = 0;\n executeNextVMTurnPending = false;\n funcsCopy.forEach((func2) => func2());\n }, 0);\n}\nfunction executeAfter(funcs, milliseconds = 0) {\n if (funcs.length > 0) {\n window.setTimeout(() => funcs.forEach((func) => func()), milliseconds);\n }\n}\nfunction debounce(func, delay) {\n let timeout;\n return function(...args) {\n const context = this;\n window.clearTimeout(timeout);\n timeout = window.setTimeout(function() {\n func.apply(context, args);\n }, delay);\n };\n}\nfunction throttle(func, wait) {\n let previousCall = 0;\n return function(...args) {\n const context = this;\n const currentCall = (/* @__PURE__ */ new Date()).getTime();\n if (currentCall - previousCall < wait) {\n return;\n }\n previousCall = currentCall;\n func.apply(context, args);\n };\n}\nfunction waitUntil(condition, callback, timeout = 100, timeoutMessage) {\n const timeStamp = (/* @__PURE__ */ new Date()).getTime();\n let interval = null;\n let executed = false;\n const internalCallback = () => {\n const reachedTimeout = (/* @__PURE__ */ new Date()).getTime() - timeStamp > timeout;\n if (condition() || reachedTimeout) {\n callback();\n executed = true;\n if (interval != null) {\n window.clearInterval(interval);\n interval = null;\n }\n if (reachedTimeout && timeoutMessage) {\n console.warn(timeoutMessage);\n }\n }\n };\n internalCallback();\n if (!executed) {\n interval = window.setInterval(internalCallback, 10);\n }\n}\nfunction compose(...fns) {\n return (arg) => fns.reduce((composed, f) => f(composed), arg);\n}\nvar noop = () => {\n return;\n};\n\n// community-modules/core/src/modules/moduleNames.ts\nvar ModuleNames = /* @__PURE__ */ ((ModuleNames2) => {\n ModuleNames2[\"CommunityCoreModule\"] = \"@ag-grid-community/core\";\n ModuleNames2[\"InfiniteRowModelModule\"] = \"@ag-grid-community/infinite-row-model\";\n ModuleNames2[\"ClientSideRowModelModule\"] = \"@ag-grid-community/client-side-row-model\";\n ModuleNames2[\"CsvExportModule\"] = \"@ag-grid-community/csv-export\";\n ModuleNames2[\"EnterpriseCoreModule\"] = \"@ag-grid-enterprise/core\";\n ModuleNames2[\"RowGroupingModule\"] = \"@ag-grid-enterprise/row-grouping\";\n ModuleNames2[\"ColumnsToolPanelModule\"] = \"@ag-grid-enterprise/column-tool-panel\";\n ModuleNames2[\"FiltersToolPanelModule\"] = \"@ag-grid-enterprise/filter-tool-panel\";\n ModuleNames2[\"MenuModule\"] = \"@ag-grid-enterprise/menu\";\n ModuleNames2[\"SetFilterModule\"] = \"@ag-grid-enterprise/set-filter\";\n ModuleNames2[\"MultiFilterModule\"] = \"@ag-grid-enterprise/multi-filter\";\n ModuleNames2[\"StatusBarModule\"] = \"@ag-grid-enterprise/status-bar\";\n ModuleNames2[\"SideBarModule\"] = \"@ag-grid-enterprise/side-bar\";\n ModuleNames2[\"RangeSelectionModule\"] = \"@ag-grid-enterprise/range-selection\";\n ModuleNames2[\"MasterDetailModule\"] = \"@ag-grid-enterprise/master-detail\";\n ModuleNames2[\"RichSelectModule\"] = \"@ag-grid-enterprise/rich-select\";\n ModuleNames2[\"GridChartsModule\"] = \"@ag-grid-enterprise/charts\";\n ModuleNames2[\"ViewportRowModelModule\"] = \"@ag-grid-enterprise/viewport-row-model\";\n ModuleNames2[\"ServerSideRowModelModule\"] = \"@ag-grid-enterprise/server-side-row-model\";\n ModuleNames2[\"ExcelExportModule\"] = \"@ag-grid-enterprise/excel-export\";\n ModuleNames2[\"ClipboardModule\"] = \"@ag-grid-enterprise/clipboard\";\n ModuleNames2[\"SparklinesModule\"] = \"@ag-grid-enterprise/sparklines\";\n ModuleNames2[\"AdvancedFilterModule\"] = \"@ag-grid-enterprise/advanced-filter\";\n ModuleNames2[\"AngularModule\"] = \"@ag-grid-community/angular\";\n ModuleNames2[\"ReactModule\"] = \"@ag-grid-community/react\";\n ModuleNames2[\"VueModule\"] = \"@ag-grid-community/vue\";\n return ModuleNames2;\n})(ModuleNames || {});\n\n// community-modules/core/src/modules/moduleRegistry.ts\nvar _ModuleRegistry = class _ModuleRegistry {\n /**\n * Globally register the given module for all grids.\n * @param module - module to register\n */\n static register(module) {\n _ModuleRegistry.__register(module, true, void 0);\n }\n /**\n * Globally register the given modules for all grids.\n * @param modules - modules to register\n */\n static registerModules(modules) {\n _ModuleRegistry.__registerModules(modules, true, void 0);\n }\n /** AG GRID INTERNAL - Module registration helper. */\n static __register(module, moduleBased, gridId) {\n _ModuleRegistry.runVersionChecks(module);\n if (gridId !== void 0) {\n _ModuleRegistry.areGridScopedModules = true;\n if (_ModuleRegistry.gridModulesMap[gridId] === void 0) {\n _ModuleRegistry.gridModulesMap[gridId] = {};\n }\n _ModuleRegistry.gridModulesMap[gridId][module.moduleName] = module;\n } else {\n _ModuleRegistry.globalModulesMap[module.moduleName] = module;\n }\n _ModuleRegistry.setModuleBased(moduleBased);\n }\n /** AG GRID INTERNAL - Unregister grid scoped module. */\n static __unRegisterGridModules(gridId) {\n delete _ModuleRegistry.gridModulesMap[gridId];\n }\n /** AG GRID INTERNAL - Module registration helper. */\n static __registerModules(modules, moduleBased, gridId) {\n _ModuleRegistry.setModuleBased(moduleBased);\n if (!modules) {\n return;\n }\n modules.forEach((module) => _ModuleRegistry.__register(module, moduleBased, gridId));\n }\n static isValidModuleVersion(module) {\n const [moduleMajor, moduleMinor] = module.version.split(\".\") || [];\n const [currentModuleMajor, currentModuleMinor] = _ModuleRegistry.currentModuleVersion.split(\".\") || [];\n return moduleMajor === currentModuleMajor && moduleMinor === currentModuleMinor;\n }\n static runVersionChecks(module) {\n if (!_ModuleRegistry.currentModuleVersion) {\n _ModuleRegistry.currentModuleVersion = module.version;\n }\n if (!module.version) {\n console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${module.moduleName}' is incompatible. Please update all modules to the same version.`);\n } else if (!_ModuleRegistry.isValidModuleVersion(module)) {\n console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${module.moduleName}' is version ${module.version} but the other modules are version ${this.currentModuleVersion}. Please update all modules to the same version.`);\n }\n if (module.validate) {\n const result = module.validate();\n if (!result.isValid) {\n const errorResult = result;\n console.error(`AG Grid: ${errorResult.message}`);\n }\n }\n }\n static setModuleBased(moduleBased) {\n if (_ModuleRegistry.moduleBased === void 0) {\n _ModuleRegistry.moduleBased = moduleBased;\n } else {\n if (_ModuleRegistry.moduleBased !== moduleBased) {\n doOnce(\n () => {\n console.warn(`AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms.`);\n console.warn(\"Please see https://www.ag-grid.com/javascript-grid/packages-modules/ for more information.\");\n },\n \"ModulePackageCheck\"\n );\n }\n }\n }\n /**\n * AG GRID INTERNAL - Set if files are being served from a single UMD bundle to provide accurate enterprise upgrade steps.\n */\n static __setIsBundled() {\n _ModuleRegistry.isBundled = true;\n }\n /** AG GRID INTERNAL - Assert a given module has been register, globally or individually with this grid. */\n static __assertRegistered(moduleName, reason, gridId) {\n var _a;\n if (this.__isRegistered(moduleName, gridId)) {\n return true;\n }\n const warningKey = reason + moduleName;\n let warningMessage;\n if (_ModuleRegistry.isBundled) {\n {\n warningMessage = `AG Grid: unable to use ${reason} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:\n \n