@marimo-team/frontend 0.14.18-dev3 → 0.14.18-dev4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ConnectedDataExplorerComponent-BT0xl502.js → ConnectedDataExplorerComponent-s7RGpPDV.js} +1 -1
- package/dist/assets/{ImageComparisonComponent-CyD_BM3x.js → ImageComparisonComponent-CnrulJpr.js} +1 -1
- package/dist/assets/{VegaLite-hnjov9BB.js → VegaLite-C2fs5zc3.js} +1 -1
- package/dist/assets/{_baseEach-C_3O_UIK.js → _baseEach-c_dyjc-O.js} +1 -1
- package/dist/assets/_baseMap-CRSErap7.js +1 -0
- package/dist/assets/{_baseUniq-G59-tGC4.js → _baseUniq-MHRYxaEh.js} +1 -1
- package/dist/assets/{_createAggregator-CYM_3WAb.js → _createAggregator-BRrHJm-S.js} +1 -1
- package/dist/assets/{any-language-editor-B_KRwSpy.js → any-language-editor-BvO3QFMF.js} +1 -1
- package/dist/assets/{architectureDiagram-SUXI7LT5-Cp-u2npp.js → architectureDiagram-SUXI7LT5-NdrSJuvB.js} +1 -1
- package/dist/assets/{blockDiagram-6J76NXCF-B1eF_YTU.js → blockDiagram-6J76NXCF-ftx5RUcT.js} +1 -1
- package/dist/assets/{c4Diagram-6F6E4RAY-D3Co9dhJ.js → c4Diagram-6F6E4RAY-BulMqa-Y.js} +1 -1
- package/dist/assets/channel-DkujgbuA.js +1 -0
- package/dist/assets/{chunk-353BL4L5-BNPOylnE.js → chunk-353BL4L5-D5H2iwN7.js} +1 -1
- package/dist/assets/{chunk-67H74DCK-6tJ94Bg0.js → chunk-67H74DCK-LK08G4lc.js} +1 -1
- package/dist/assets/{chunk-AACKK3MU-46UGfeGc.js → chunk-AACKK3MU-B9JAiO5u.js} +1 -1
- package/dist/assets/{chunk-BFAMUDN2-CNdKrd4t.js → chunk-BFAMUDN2-CZKcG7Hk.js} +1 -1
- package/dist/assets/{chunk-E2GYISFI-0jprAmfg.js → chunk-E2GYISFI-CIXtdUNn.js} +1 -1
- package/dist/assets/{chunk-OW32GOEJ-Dq-4mco2.js → chunk-OW32GOEJ-C4FCmwnP.js} +1 -1
- package/dist/assets/{chunk-SKB7J2MH-BFb7Z7j2.js → chunk-SKB7J2MH-BaSlr3jl.js} +1 -1
- package/dist/assets/{chunk-SZ463SBG-BEsy1Bnk.js → chunk-SZ463SBG-BwDfdiOo.js} +1 -1
- package/dist/assets/{circle-play-chxJxn_k.js → circle-play-JsgbRX6G.js} +1 -1
- package/dist/assets/classDiagram-M3E45YP4-C27KFaf-.js +1 -0
- package/dist/assets/classDiagram-v2-YAWTLIQI-C27KFaf-.js +1 -0
- package/dist/assets/clone-BcaRetEG.js +1 -0
- package/dist/assets/{compile-CrDOzGvF.js → compile-BGbhA30T.js} +1 -1
- package/dist/assets/{dagre-JOIXM2OF-CgxEy6Ti.js → dagre-JOIXM2OF-B8vUNw1G.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-Bt-ru6j6.js → data-grid-overlay-editor-5lo5J1Vt.js} +1 -1
- package/dist/assets/{diagram-5UYTHUR4-Cv4YqP4A.js → diagram-5UYTHUR4-PLDgwO4x.js} +1 -1
- package/dist/assets/{diagram-VMROVX33-UJqJ2Qh7.js → diagram-VMROVX33-B5-7SLna.js} +1 -1
- package/dist/assets/{diagram-ZTM2IBQH-wfhUdi9M.js → diagram-ZTM2IBQH-BnKr5V6h.js} +1 -1
- package/dist/assets/{edit-page-Bh3hotqJ.js → edit-page-CyEUf7VL.js} +4 -4
- package/dist/assets/{erDiagram-3M52JZNH-Bt4OzYYB.js → erDiagram-3M52JZNH-Dk0Y_2Is.js} +1 -1
- package/dist/assets/{flowDiagram-KYDEHFYC-BE_JMKNj.js → flowDiagram-KYDEHFYC-DM8J3haJ.js} +1 -1
- package/dist/assets/{ganttDiagram-EK5VF46D-DEt-Ih6b.js → ganttDiagram-EK5VF46D-B7MEeaeb.js} +1 -1
- package/dist/assets/{gitGraphDiagram-GW3U2K7C-CGO98bua.js → gitGraphDiagram-GW3U2K7C-ciOWHdK1.js} +1 -1
- package/dist/assets/{glide-data-editor-Btj-XKB9.js → glide-data-editor-CeJNWkGL.js} +4 -4
- package/dist/assets/{graph-DeU2Xth1.js → graph-IzuQV5TV.js} +1 -1
- package/dist/assets/{home-page-IxuRGcj-.js → home-page-P0hOk_Lu.js} +1 -1
- package/dist/assets/{index-DbFWJ4Qa.js → index--eqo3Nr1.js} +1 -1
- package/dist/assets/{index-BU4GASnK.js → index-ABc3l5O5.js} +1 -1
- package/dist/assets/{index-heFumldU.js → index-BqqAIR7p.js} +1 -1
- package/dist/assets/{index-DEVD2idU.js → index-BtVdSmBr.js} +1 -1
- package/dist/assets/{index-B7daay03.js → index-Bw4_53VL.js} +11 -11
- package/dist/assets/{index-BYPCZUa6.js → index-CTxIrFfM.js} +1 -1
- package/dist/assets/{index-vGk4nE_d.js → index-CrnLkrsN.js} +1 -1
- package/dist/assets/{index-_jAr8NM_.js → index-CvNa254z.js} +1 -1
- package/dist/assets/{index-CVNzfFlx.js → index-D86OE7I-.js} +1 -1
- package/dist/assets/{index-Dniw7sSM.js → index-DKlX9VbD.js} +1 -1
- package/dist/assets/{index-D4QA5nNz.js → index-DL31Tmv6.js} +1 -1
- package/dist/assets/{index-DFLmyJLh.js → index-DVgehULr.js} +1 -1
- package/dist/assets/{index-54cg5P1s.js → index-DWbP9NKv.js} +1 -1
- package/dist/assets/{index-B72QAiSc.js → index-DyGhL8pb.js} +1 -1
- package/dist/assets/{index-g62sB8uq.js → index-DzcdkCgc.js} +1 -1
- package/dist/assets/{index-Dql2NySh.js → index-DzmGiDPv.js} +1 -1
- package/dist/assets/{index-DRnyprVw.js → index-VEO6hI2a.js} +1 -1
- package/dist/assets/{index-CRkNsusV.js → index-ZMOxgO0o.js} +1 -1
- package/dist/assets/{index-B464Wlvo.js → index-vOKQtqij.js} +1 -1
- package/dist/assets/infoDiagram-LHK5PUON-DM8xmmD0.js +2 -0
- package/dist/assets/{journeyDiagram-EWQZEKCU-DzQqkIOA.js → journeyDiagram-EWQZEKCU-D-rWvB9c.js} +1 -1
- package/dist/assets/{kanban-definition-ZSS6B67P-Cv0lpMrD.js → kanban-definition-ZSS6B67P-BPrv-lG3.js} +1 -1
- package/dist/assets/{layout-CO5ebI-Y.js → layout-C3NQCD38.js} +1 -1
- package/dist/assets/{linear-CvcTdG5r.js → linear-Dcz3lyvf.js} +1 -1
- package/dist/assets/{links-DAdFQ7bg.js → links-UdVi9TCH.js} +13 -13
- package/dist/assets/{mermaid-CymwcI3a.js → mermaid-BjMqU7B7.js} +4 -4
- package/dist/assets/{min-CTcwszLX.js → min-DsZNGHWk.js} +1 -1
- package/dist/assets/{mindmap-definition-6CBA2TL7-B0mxrKt3.js → mindmap-definition-6CBA2TL7-BZsnMx2y.js} +1 -1
- package/dist/assets/{number-overlay-editor-CJPAXVuf.js → number-overlay-editor-CzX-JKBj.js} +1 -1
- package/dist/assets/{pieDiagram-NIOCPIFQ-C-2hdQUk.js → pieDiagram-NIOCPIFQ-BjbDT3_7.js} +1 -1
- package/dist/assets/{quadrantDiagram-2OG54O6I-CL2YGs4R.js → quadrantDiagram-2OG54O6I-DwvUEn5y.js} +1 -1
- package/dist/assets/{react-plotly-BsLWiFjm.js → react-plotly-DsUGZTQl.js} +1 -1
- package/dist/assets/{requirementDiagram-QOLK2EJ7-DQ4L9v8q.js → requirementDiagram-QOLK2EJ7-DnqQ02xB.js} +1 -1
- package/dist/assets/{run-page-Bx99bWZ3.js → run-page-Dh1_LBex.js} +1 -1
- package/dist/assets/{sankeyDiagram-4UZDY2LN-BCeK9LuM.js → sankeyDiagram-4UZDY2LN-CGiEg-KK.js} +1 -1
- package/dist/assets/{sequenceDiagram-SKLFT4DO-2hUcwiWi.js → sequenceDiagram-SKLFT4DO-Du_9Bhah.js} +1 -1
- package/dist/assets/{slides-component-C4hf0v_2.js → slides-component-DbRb2vqt.js} +1 -1
- package/dist/assets/{sortBy-DSGu1kis.js → sortBy-DRXBnSF7.js} +1 -1
- package/dist/assets/{stateDiagram-MI5ZYTHO-B-C8-fsa.js → stateDiagram-MI5ZYTHO-x_vUiEQz.js} +1 -1
- package/dist/assets/stateDiagram-v2-5AN5P6BG-BmONtexb.js +1 -0
- package/dist/assets/{storage-CssK1tjQ.js → storage-C6lB9RSO.js} +3 -3
- package/dist/assets/{terminal-BHiJua_p.js → terminal-xOuxdYpY.js} +1 -1
- package/dist/assets/{time-Dq0rcdwf.js → time-CjxeuzoW.js} +1 -1
- package/dist/assets/{timeline-definition-MYPXXCX6-BwdXyFVw.js → timeline-definition-MYPXXCX6-8Kv4fcyB.js} +1 -1
- package/dist/assets/{tracing-erwDcbAl.js → tracing-BAj6E74_.js} +2 -2
- package/dist/assets/{trash-DEAtdWrd.js → trash-65Vbt3F6.js} +1 -1
- package/dist/assets/{treemap-75Q7IDZK-BoFrERFR.js → treemap-75Q7IDZK-DtSMjk1Y.js} +1 -1
- package/dist/assets/{vega-component-XnrlJ16r.js → vega-component-C3aywWbx.js} +1 -1
- package/dist/assets/{xychartDiagram-H2YORKM3-BRGXUZ-C.js → xychartDiagram-H2YORKM3-D33F1MLE.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/_baseMap-ejDdVnUU.js +0 -1
- package/dist/assets/channel-PLmZB-8M.js +0 -1
- package/dist/assets/classDiagram-M3E45YP4-Bl6D-lo6.js +0 -1
- package/dist/assets/classDiagram-v2-YAWTLIQI-Bl6D-lo6.js +0 -1
- package/dist/assets/clone-BllYssjv.js +0 -1
- package/dist/assets/infoDiagram-LHK5PUON-sVWflOQg.js +0 -2
- package/dist/assets/stateDiagram-v2-5AN5P6BG-Bv5ynAxn.js +0 -1
@@ -1,5 +1,5 @@
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor-
|
2
|
-
var Lp=Object.defineProperty;var _p=(ur,$n,Rr)=>$n in ur?Lp(ur,$n,{enumerable:!0,configurable:!0,writable:!0,value:Rr}):ur[$n]=Rr;var ft=(ur,$n,Rr)=>_p(ur,typeof $n!="symbol"?$n+"":$n,Rr);import{gD as Ti,z as Sr,U as d,gE as Fa,aF as Go,aG as jp,b as $t,gF as Np,an as L0,fh as _0,L as La,a as j0,j as nt,dl as Bp,gG as Wp,gH as N0,gI as $p,bp as _a,bn as B0,a6 as ja,gJ as W0,gK as $0,gL as X0,gM as Xp,dr as Gp,dn as Yp,dm as Kp,dp as Vp,am as Up,gN as qp,dz as Jp,gO as Hi,aS as Na,aN as Qp,bc as Zp,eY as G0,a_ as Y0,b1 as em,b2 as tm,ad as nm,ab as rm,ac as om,__tla as im}from"./index-B7daay03.js";import{T as am}from"./trash-DEAtdWrd.js";let Ba,Wa,kr,$a,K0,Mr,Xa,Cn,lm=Promise.all([(()=>{try{return im}catch{}})()]).then(async()=>{var ur,$n,Rr,Ga,Ya,Ka,Va,Ua,qa,Ja,Qa,Za,el,tl,nl,rl,ol,il,al,ll,sl,cl,ul,dl,hl,fl,gl,pl,ml,vl,wl,yl,bl,xl,Cl,Sl,kl,Ml,Rl,El,Il,Tl,Hl,Ol,Pl,Dl,zl,Al,Fl,Ll,_l,jl,Nl,Bl,Wl,$l,Xl,Gl,Yl,Kl,Vl,Ul,ql,Jl,Ql,Zl,es,ts,ns,rs,os,is,as,ls,ss,cs,us,ds,hs,fs,gs,ps,ms,vs,ws,ys,bs,xs,Oi,Cs,Ss,ks,Ms,Rs,Pi,Es,Is,Ts,Hs,Os,Ps,Ds,zs,As,Fs,Ls,_s,js,Ns,Bs,Ws,$s,Xs,Gs;function Xn(){if(Ga)return Rr;Ga=1;var e=Array.isArray;return Rr=e}function Ys(){if(Ka)return Ya;Ka=1;var e=typeof Ti=="object"&&Ti&&Ti.Object===Object&&Ti;return Ya=e}function Gn(){if(Ua)return Va;Ua=1;var e=Ys(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Va=n}function oo(){if(Ja)return qa;Ja=1;var e=Gn().Symbol;return qa=e}function io(){if(rl)return nl;rl=1;var e=oo(),t=function(){if(Za)return Qa;Za=1;var o=oo(),i=Object.prototype,l=i.hasOwnProperty,a=i.toString,s=o?o.toStringTag:void 0;return Qa=function(c){var h=l.call(c,s),C=c[s];try{c[s]=void 0;var y=!0}catch{}var b=a.call(c);return y&&(h?c[s]=C:delete c[s]),b}}(),n=function(){if(tl)return el;tl=1;var o=Object.prototype.toString;return el=function(i){return o.call(i)}}(),r=e?e.toStringTag:void 0;return nl=function(o){return o==null?o===void 0?"[object Undefined]":"[object Null]":r&&r in Object(o)?t(o):n(o)}}function ao(){return il?ol:(il=1,ol=function(e){return e!=null&&typeof e=="object"})}function Yo(){if(ll)return al;ll=1;var e=io(),t=ao();return al=function(n){return typeof n=="symbol"||t(n)&&e(n)=="[object Symbol]"}}function Di(){if(cl)return sl;cl=1;var e=Xn(),t=Yo(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return sl=function(o,i){if(e(o))return!1;var l=typeof o;return!(l!="number"&&l!="symbol"&&l!="boolean"&&o!=null&&!t(o))||r.test(o)||!n.test(o)||i!=null&&o in Object(i)}}function Er(){return dl?ul:(dl=1,ul=function(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")})}function Ks(){if(fl)return hl;fl=1;var e=io(),t=Er();return hl=function(n){if(!t(n))return!1;var r=e(n);return r=="[object Function]"||r=="[object GeneratorFunction]"||r=="[object AsyncFunction]"||r=="[object Proxy]"}}function V0(){if(vl)return ml;vl=1;var e,t=function(){if(pl)return gl;pl=1;var r=Gn()["__core-js_shared__"];return gl=r}(),n=(e=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";return ml=function(r){return!!n&&n in r}}function Vs(){if(yl)return wl;yl=1;var e=Function.prototype.toString;return wl=function(t){if(t!=null){try{return e.call(t)}catch{}try{return t+""}catch{}}return""}}function Ir(){if(Ml)return kl;Ml=1;var e=function(){if(xl)return bl;xl=1;var n=Ks(),r=V0(),o=Er(),i=Vs(),l=/^\[object .+?Constructor\]$/,a=Function.prototype,s=Object.prototype,c=a.toString,h=s.hasOwnProperty,C=RegExp("^"+c.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return bl=function(y){return!(!o(y)||r(y))&&(n(y)?C:l).test(i(y))}}(),t=Sl?Cl:(Sl=1,Cl=function(n,r){return n==null?void 0:n[r]});return kl=function(n,r){var o=t(n,r);return e(o)?o:void 0}}function Ko(){if(El)return Rl;El=1;var e=Ir()(Object,"create");return Rl=e}function U0(){if(jl)return _l;jl=1;var e=function(){if(Tl)return Il;Tl=1;var l=Ko();return Il=function(){this.__data__=l?l(null):{},this.size=0}}(),t=Ol?Hl:(Ol=1,Hl=function(l){var a=this.has(l)&&delete this.__data__[l];return this.size-=a?1:0,a}),n=function(){if(Dl)return Pl;Dl=1;var l=Ko(),a=Object.prototype.hasOwnProperty;return Pl=function(s){var c=this.__data__;if(l){var h=c[s];return h==="__lodash_hash_undefined__"?void 0:h}return a.call(c,s)?c[s]:void 0}}(),r=function(){if(Al)return zl;Al=1;var l=Ko(),a=Object.prototype.hasOwnProperty;return zl=function(s){var c=this.__data__;return l?c[s]!==void 0:a.call(c,s)}}(),o=function(){if(Ll)return Fl;Ll=1;var l=Ko();return Fl=function(a,s){var c=this.__data__;return this.size+=this.has(a)?0:1,c[a]=l&&s===void 0?"__lodash_hash_undefined__":s,this}}();function i(l){var a=-1,s=l==null?0:l.length;for(this.clear();++a<s;){var c=l[a];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,_l=i}function zi(){return $l?Wl:($l=1,Wl=function(e,t){return e===t||e!=e&&t!=t})}function Vo(){if(Gl)return Xl;Gl=1;var e=zi();return Xl=function(t,n){for(var r=t.length;r--;)if(e(t[r][0],n))return r;return-1}}function Uo(){if(ts)return es;ts=1;var e=Bl?Nl:(Bl=1,Nl=function(){this.__data__=[],this.size=0}),t=function(){if(Kl)return Yl;Kl=1;var l=Vo(),a=Array.prototype.splice;return Yl=function(s){var c=this.__data__,h=l(c,s);return!(h<0||(h==c.length-1?c.pop():a.call(c,h,1),--this.size,0))}}(),n=function(){if(Ul)return Vl;Ul=1;var l=Vo();return Vl=function(a){var s=this.__data__,c=l(s,a);return c<0?void 0:s[c][1]}}(),r=function(){if(Jl)return ql;Jl=1;var l=Vo();return ql=function(a){return l(this.__data__,a)>-1}}(),o=function(){if(Zl)return Ql;Zl=1;var l=Vo();return Ql=function(a,s){var c=this.__data__,h=l(c,a);return h<0?(++this.size,c.push([a,s])):c[h][1]=s,this}}();function i(l){var a=-1,s=l==null?0:l.length;for(this.clear();++a<s;){var c=l[a];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,es=i}function Ai(){if(rs)return ns;rs=1;var e=Ir()(Gn(),"Map");return ns=e}function qo(){if(cs)return ss;cs=1;var e=ls?as:(ls=1,as=function(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null});return ss=function(t,n){var r=t.__data__;return e(n)?r[typeof n=="string"?"string":"hash"]:r.map}}function Fi(){if(ys)return ws;ys=1;var e=function(){if(is)return os;is=1;var l=U0(),a=Uo(),s=Ai();return os=function(){this.size=0,this.__data__={hash:new l,map:new(s||a),string:new l}}}(),t=function(){if(ds)return us;ds=1;var l=qo();return us=function(a){var s=l(this,a).delete(a);return this.size-=s?1:0,s}}(),n=function(){if(fs)return hs;fs=1;var l=qo();return hs=function(a){return l(this,a).get(a)}}(),r=function(){if(ps)return gs;ps=1;var l=qo();return gs=function(a){return l(this,a).has(a)}}(),o=function(){if(vs)return ms;vs=1;var l=qo();return ms=function(a,s){var c=l(this,a),h=c.size;return c.set(a,s),this.size+=c.size==h?0:1,this}}();function i(l){var a=-1,s=l==null?0:l.length;for(this.clear();++a<s;){var c=l[a];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,ws=i}function q0(){if(Cs)return Oi;Cs=1;var e=function(){if(xs)return bs;xs=1;var t=Fi();function n(r,o){if(typeof r!="function"||o!=null&&typeof o!="function")throw new TypeError("Expected a function");var i=function(){var l=arguments,a=o?o.apply(this,l):l[0],s=i.cache;if(s.has(a))return s.get(a);var c=r.apply(this,l);return i.cache=s.set(a,c)||s,c};return i.cache=new(n.Cache||t),i}return n.Cache=t,bs=n}();return Oi=function(t){var n=e(t,function(o){return r.size===500&&r.clear(),o}),r=n.cache;return n},Oi}function J0(){if(Es)return Pi;Es=1;var e=oo(),t=Rs?Ms:(Rs=1,Ms=function(l,a){for(var s=-1,c=l==null?0:l.length,h=Array(c);++s<c;)h[s]=a(l[s],s,l);return h}),n=Xn(),r=Yo(),o=e?e.prototype:void 0,i=o?o.toString:void 0;return Pi=function l(a){if(typeof a=="string")return a;if(n(a))return t(a,l)+"";if(r(a))return i?i.call(a):"";var s=a+"";return s=="0"&&1/a==-1/0?"-0":s},Pi}function Us(){if(Os)return Hs;Os=1;var e=Xn(),t=Di(),n=function(){if(ks)return Ss;ks=1;var o=q0(),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l=/\\(\\)?/g,a=o(function(s){var c=[];return s.charCodeAt(0)===46&&c.push(""),s.replace(i,function(h,C,y,b){c.push(y?b.replace(l,"$1"):C||h)}),c});return Ss=a}(),r=function(){if(Ts)return Is;Ts=1;var o=J0();return Is=function(i){return i==null?"":o(i)}}();return Hs=function(o,i){return e(o)?o:t(o,i)?[o]:n(r(o))}}function Li(){if(As)return zs;As=1;var e=function(){if(Ds)return Ps;Ds=1;var l=io(),a=ao();return Ps=function(s){return a(s)&&l(s)=="[object Arguments]"}}(),t=ao(),n=Object.prototype,r=n.hasOwnProperty,o=n.propertyIsEnumerable,i=e(function(){return arguments}())?e:function(l){return t(l)&&r.call(l,"callee")&&!o.call(l,"callee")};return zs=i}function _i(){if(Ls)return Fs;Ls=1;var e=/^(?:0|[1-9]\d*)$/;return Fs=function(t,n){var r=typeof t;return!!(n=n??9007199254740991)&&(r=="number"||r!="symbol"&&e.test(t))&&t>-1&&t%1==0&&t<n}}function ji(){return js?_s:(js=1,_s=function(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=9007199254740991})}function Jo(){if(Bs)return Ns;Bs=1;var e=Yo();return Ns=function(t){if(typeof t=="string"||e(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}}function qs(){if($s)return Ws;$s=1;var e=Us(),t=Li(),n=Xn(),r=_i(),o=ji(),i=Jo();return Ws=function(l,a,s){for(var c=-1,h=(a=e(a,l)).length,C=!1;++c<h;){var y=i(a[c]);if(!(C=l!=null&&s(l,y)))break;l=l[y]}return C||++c!=h?C:!!(h=l==null?0:l.length)&&o(h)&&r(y,h)&&(n(l)||t(l))}}const Q0=Sr(function(){if(Gs)return Xs;Gs=1;var e=function(){if($n)return ur;$n=1;var n=Object.prototype.hasOwnProperty;return ur=function(r,o){return r!=null&&n.call(r,o)}}(),t=qs();return Xs=function(n,r){return n!=null&&t(n,r,e)}}());function Js(e="This should not happen"){throw new Error(e)}function Rn(e,t="Assertion failed"){if(!e)return Js(t)}function lo(e,t){return Js(t??"Hell froze over")}const Qs=Object.prototype.hasOwnProperty;function $r(e,t){let n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&$r(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){for(n in r=0,e)if(Qs.call(e,n)&&++r&&!Qs.call(t,n)||!(n in t)||!$r(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!=e&&t!=t}const Qo=null,Ni=void 0;var me,Jn,Zo,Hn;function ei(e){return"width"in e&&typeof e.width=="number"}async function Zs(e){return typeof e=="object"?e:await e()}Mr=function(e){return e.kind!==me.Loading&&e.kind!==me.Bubble&&e.kind!==me.RowID&&e.kind!==me.Protected&&e.kind!==me.Drilldown},kr=function(e){return e.kind===Hn.Marker||e.kind===Hn.NewRow};function so(e){if(!Mr(e)||e.kind===me.Image)return!1;switch(e.kind){case me.Text:case me.Number:case me.Markdown:case me.Uri:case me.Custom:case me.Boolean:return e.readonly!==!0;default:lo(0,"A cell was passed with an invalid kind")}}$a=function(e){return Q0(e,"editor")};function Bi(e){return!e.readonly}let ec;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(me||(me={})),function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"}(Jn||(Jn={})),function(e){e.Triangle="triangle",e.Dots="dots"}(Zo||(Zo={})),function(e){e.NewRow="new-row",e.Marker="marker"}(Hn||(Hn={}));const er=class er{constructor(t){ft(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new er(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=function(o){if(o.length===0)return[];const i=[...o],l=[];i.sort(function(a,s){return a[0]-s[0]}),l.push([...i[0]]);for(const a of i.slice(1)){const s=l[l.length-1];s[1]<a[0]?l.push([...a]):s[1]<a[1]&&(s[1]=a[1])}return l}([...this.items,n]);return new er(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],o=typeof t=="number"?t+1:t[1];for(const[i,l]of n.entries()){const[a,s]=l;if(a<=o&&r<=s){const c=[];a<r&&c.push([a,r]),o<s&&c.push([o,s]),n.splice(i,1,...c)}}return new er(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,o]=this.items[n];if(t>=r&&t<o)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],o=this.items[n];if(r[0]!==o[0]||r[1]!==o[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let o=n;o<r;o++)t.push(o);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}};ft(er,"empty",()=>ec??(ec=new er([]))),ft(er,"fromSingleSelection",t=>er.empty().add(t));let yt=er;var tc=function(){const e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(o=>{(o?o.split(" "):[]).forEach(i=>{if(i.startsWith("atm_")){const[,l]=i.split("_");t[l]=i}else n.push(i)})});const r=[];for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.push(t[o]);return r.push(...n),r.join(" ")},nc=(e,t)=>{const n={};return Object.keys(e).filter((r=>o=>r.indexOf(o)===-1)(t)).forEach(r=>{n[r]=e[r]}),n},Z0=(e,t)=>{};Cn=function(e){let t="";return n=>{const r=(i,l)=>{const{as:a=e,class:s=t}=i;var c;const h=function(y,b,p){const m=nc(b,p);if(!y){const E=typeof Fa=="function"?{default:Fa}:Fa;Object.keys(m).forEach(g=>{E.default(g)||delete m[g]})}return m}(n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&(c=a[0],c.toUpperCase()!==c)):n.propsAsIs,i,["as","class"]);h.ref=l,h.className=n.atomic?tc(n.class,h.className||s):tc(h.className||s,n.class);const{vars:C}=n;if(C){const y={};for(const m in C){const E=C[m],g=E[0],w=E[1]||"",x=typeof g=="function"?g(i):g;Z0(0,n.name),y[`--${m}`]=`${x}${w}`}const b=h.style||{},p=Object.keys(b);p.length>0&&p.forEach(m=>{y[m]=b[m]}),h.style=y}return e.__wyw_meta&&e!==a?(h.as=a,d.createElement(e,h)):d.createElement(a,h)},o=d.forwardRef?d.forwardRef(r):i=>{const l=nc(i,["innerRef"]);return r(l,i.innerRef)};return o.displayName=n.name,o.__wyw_meta={className:n.class||t,extends:e},o}};const e1=Cn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var rc,oc,ic={},co={},ac={},lc={};function t1(){return rc||(rc=1,function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.setHasSupportToCaptureOption=b;var r=i(t),o=i(n);function i(g){return g&&g.__esModule?g:{default:g}}var l=Object.assign||function(g){for(var w=1;w<arguments.length;w++){var x=arguments[w];for(var I in x)Object.prototype.hasOwnProperty.call(x,I)&&(g[I]=x[I])}return g};function a(g,w){var x={};for(var I in g)w.indexOf(I)>=0||Object.prototype.hasOwnProperty.call(g,I)&&(x[I]=g[I]);return x}function s(g,w){if(!(g instanceof w))throw new TypeError("Cannot call a class as a function")}var c=function(){function g(w,x){for(var I=0;I<x.length;I++){var v=x[I];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(w,v.key,v)}}return function(w,x,I){return x&&g(w.prototype,x),I&&g(w,I),w}}();function h(g,w){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!w||typeof w!="object"&&typeof w!="function"?g:w}function C(g,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);g.prototype=Object.create(w&&w.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(g,w):g.__proto__=w)}var y=!1;function b(g){y=g}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){b(!0)}}))}catch{}function p(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return y?g:g.capture}function m(g){if("touches"in g){var w=g.touches[0];return{x:w.pageX,y:w.pageY}}return{x:g.screenX,y:g.screenY}}var E=function(g){function w(){var x;s(this,w);for(var I=arguments.length,v=Array(I),M=0;M<I;M++)v[M]=arguments[M];var S=h(this,(x=w.__proto__||Object.getPrototypeOf(w)).call.apply(x,[this].concat(v)));return S._handleSwipeStart=S._handleSwipeStart.bind(S),S._handleSwipeMove=S._handleSwipeMove.bind(S),S._handleSwipeEnd=S._handleSwipeEnd.bind(S),S._onMouseDown=S._onMouseDown.bind(S),S._onMouseMove=S._onMouseMove.bind(S),S._onMouseUp=S._onMouseUp.bind(S),S._setSwiperRef=S._setSwiperRef.bind(S),S}return C(w,g),c(w,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(x){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(x))}},{key:"_onMouseMove",value:function(x){this.mouseDown&&this._handleSwipeMove(x)}},{key:"_onMouseUp",value:function(x){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(x)}},{key:"_handleSwipeStart",value:function(x){var I=m(x),v=I.x,M=I.y;this.moveStart={x:v,y:M},this.props.onSwipeStart(x)}},{key:"_handleSwipeMove",value:function(x){if(this.moveStart){var I=m(x),v=I.x,M=I.y,S=v-this.moveStart.x,H=M-this.moveStart.y;this.moving=!0,this.props.onSwipeMove({x:S,y:H},x)&&x.cancelable&&x.preventDefault(),this.movePosition={deltaX:S,deltaY:H}}}},{key:"_handleSwipeEnd",value:function(x){this.props.onSwipeEnd(x);var I=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-I?this.props.onSwipeLeft(1,x):this.movePosition.deltaX>I&&this.props.onSwipeRight(1,x),this.movePosition.deltaY<-I?this.props.onSwipeUp(1,x):this.movePosition.deltaY>I&&this.props.onSwipeDown(1,x)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(x){this.swiper=x,this.props.innerRef(x)}},{key:"render",value:function(){var x=this.props;x.tagName;var I=x.className,v=x.style,M=x.children;x.allowMouseEvents,x.onSwipeUp,x.onSwipeDown,x.onSwipeLeft,x.onSwipeRight,x.onSwipeStart,x.onSwipeMove,x.onSwipeEnd,x.innerRef,x.tolerance;var S=a(x,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return r.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:I,style:v},S),M)}}]),w}(t.Component);E.displayName="ReactSwipe",E.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},E.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},e.default=E}(lc,Go(),jp())),lc}function sc(){return oc||(oc=1,function(e,t){Object.defineProperty(e,"__esModule",{value:!0});var n=r(t);function r(o){return o&&o.__esModule?o:{default:o}}e.default=n.default}(ac,t1())),ac}var cc,uc,uo={},dc={exports:{}};function hc(){if(uc)return uo;uc=1,Object.defineProperty(uo,"__esModule",{value:!0}),uo.default=void 0;var e,t,n=(cc||(cc=1,t=dc,function(){var o={}.hasOwnProperty;function i(){for(var s="",c=0;c<arguments.length;c++){var h=arguments[c];h&&(s=a(s,l(h)))}return s}function l(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return i.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var c="";for(var h in s)o.call(s,h)&&s[h]&&(c=a(c,h));return c}function a(s,c){return c?s?s+" "+c:s+c:s}t.exports?(i.default=i,t.exports=i):window.classNames=i}()),(e=dc.exports)&&e.__esModule?e:{default:e}),r={ROOT:function(o){return(0,n.default)(function(i,l,a){return l in i?Object.defineProperty(i,l,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[l]=a,i}({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,n.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,i){return(0,n.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":i==="horizontal","axis-vertical":i!=="horizontal"})},SLIDER:function(o,i){return(0,n.default)({thumbs:!o,slider:o,animated:!i})},ITEM:function(o,i,l){return(0,n.default)({thumb:!o,slide:o,selected:i,previous:l})},ARROW_PREV:function(o){return(0,n.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,n.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,n.default)({dot:!0,selected:o})}};return uo.default=r,uo}var fc,ho={},ti={},gc,fo={};function Wi(){return gc?fo:(gc=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.default=void 0,fo.default=function(e,t,n){var r=e===0?e:e+t;return"translate3d"+("("+(n==="horizontal"?[r,0,0]:[0,r,0]).join(",")+")")},fo)}var pc,mc,go={};function vc(){return pc?go:(pc=1,Object.defineProperty(go,"__esModule",{value:!0}),go.default=void 0,go.default=function(){return window},go)}function wc(){if(mc)return ho;mc=1,Object.defineProperty(ho,"__esModule",{value:!0}),ho.default=void 0;var e=function(g){if(g&&g.__esModule)return g;if(g===null||s(g)!=="object"&&typeof g!="function")return{default:g};var w=a();if(w&&w.has(g))return w.get(g);var x={},I=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in g)if(Object.prototype.hasOwnProperty.call(g,v)){var M=I?Object.getOwnPropertyDescriptor(g,v):null;M&&(M.get||M.set)?Object.defineProperty(x,v,M):x[v]=g[v]}return x.default=g,w&&w.set(g,x),x}(Go()),t=l(hc()),n=(fc||(fc=1,Object.defineProperty(ti,"__esModule",{value:!0}),ti.outerWidth=void 0,ti.outerWidth=function(g){var w=g.offsetWidth,x=getComputedStyle(g);return w+(parseInt(x.marginLeft)+parseInt(x.marginRight))}),ti),r=l(Wi()),o=l(sc()),i=l(vc());function l(g){return g&&g.__esModule?g:{default:g}}function a(){if(typeof WeakMap!="function")return null;var g=new WeakMap;return a=function(){return g},g}function s(g){return s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},s(g)}function c(){return c=Object.assign||function(g){for(var w=1;w<arguments.length;w++){var x=arguments[w];for(var I in x)Object.prototype.hasOwnProperty.call(x,I)&&(g[I]=x[I])}return g},c.apply(this,arguments)}function h(g,w,x){return w&&function(I,v){for(var M=0;M<v.length;M++){var S=v[M];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}(g.prototype,w),g}function C(g,w){return C=Object.setPrototypeOf||function(x,I){return x.__proto__=I,x},C(g,w)}function y(g){var w=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var x,I=p(g);if(w){var v=p(this).constructor;x=Reflect.construct(I,arguments,v)}else x=I.apply(this,arguments);return function(M,S){return S&&(s(S)==="object"||typeof S=="function")?S:b(M)}(this,x)}}function b(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function p(g){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},p(g)}function m(g,w,x){return w in g?Object.defineProperty(g,w,{value:x,enumerable:!0,configurable:!0,writable:!0}):g[w]=x,g}var E=function(g){(function(I,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(v&&v.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),v&&C(I,v)})(x,g);var w=y(x);function x(I){var v;return function(M,S){if(!(M instanceof S))throw new TypeError("Cannot call a class as a function")}(this,x),m(b(v=w.call(this,I)),"itemsWrapperRef",void 0),m(b(v),"itemsListRef",void 0),m(b(v),"thumbsRef",void 0),m(b(v),"setItemsWrapperRef",function(M){v.itemsWrapperRef=M}),m(b(v),"setItemsListRef",function(M){v.itemsListRef=M}),m(b(v),"setThumbsRef",function(M,S){v.thumbsRef||(v.thumbsRef=[]),v.thumbsRef[S]=M}),m(b(v),"updateSizes",function(){if(v.props.children&&v.itemsWrapperRef&&v.thumbsRef){var M=e.Children.count(v.props.children),S=v.itemsWrapperRef.clientWidth,H=v.props.thumbWidth?v.props.thumbWidth:(0,n.outerWidth)(v.thumbsRef[0]),f=Math.floor(S/H),B=f<M,D=B?M-f:0;v.setState(function(O,T){return{itemSize:H,visibleItems:f,firstItem:B?v.getFirstItem(T.selectedItem):0,lastPosition:D,showArrows:B}})}}),m(b(v),"handleClickItem",function(M,S,H){if(!function(B){return B.hasOwnProperty("key")}(H)||H.key==="Enter"){var f=v.props.onSelectItem;typeof f=="function"&&f(M,S)}}),m(b(v),"onSwipeStart",function(){v.setState({swiping:!0})}),m(b(v),"onSwipeEnd",function(){v.setState({swiping:!1})}),m(b(v),"onSwipeMove",function(M){var S=M.x;if(!v.state.itemSize||!v.itemsWrapperRef||!v.state.visibleItems)return!1;var H=e.Children.count(v.props.children),f=-100*v.state.firstItem/v.state.visibleItems;f===0&&S>0&&(S=0),f===100*-Math.max(H-v.state.visibleItems,0)/v.state.visibleItems&&S<0&&(S=0);var B=f+100/(v.itemsWrapperRef.clientWidth/S);return v.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(D){v.itemsListRef.style[D]=(0,r.default)(B,"%",v.props.axis)}),!0}),m(b(v),"slideRight",function(M){v.moveTo(v.state.firstItem-(typeof M=="number"?M:1))}),m(b(v),"slideLeft",function(M){v.moveTo(v.state.firstItem+(typeof M=="number"?M:1))}),m(b(v),"moveTo",function(M){M=(M=M<0?0:M)>=v.state.lastPosition?v.state.lastPosition:M,v.setState({firstItem:M})}),v.state={selectedItem:I.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},v}return h(x,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(I){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==I.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(I){var v=I;return I>=this.state.lastPosition&&(v=this.state.lastPosition),I<this.state.firstItem+this.state.visibleItems&&(v=this.state.firstItem),I<this.state.firstItem&&(v=I),v}},{key:"renderItems",value:function(){var I=this;return this.props.children.map(function(v,M){var S=t.default.ITEM(!1,M===I.state.selectedItem),H={key:M,ref:function(f){return I.setThumbsRef(f,M)},className:S,onClick:I.handleClickItem.bind(I,M,I.props.children[M]),onKeyDown:I.handleClickItem.bind(I,M,I.props.children[M]),"aria-label":"".concat(I.props.labels.item," ").concat(M+1),style:{width:I.props.thumbWidth}};return e.default.createElement("li",c({},H,{role:"button",tabIndex:0}),v)})}},{key:"render",value:function(){var I=this;if(!this.props.children)return null;var v,M=e.Children.count(this.props.children)>1,S=this.state.showArrows&&this.state.firstItem>0,H=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,f=-this.state.firstItem*(this.state.itemSize||0),B=(0,r.default)(f,"px",this.props.axis),D=this.props.transitionTime+"ms";return v={WebkitTransform:B,MozTransform:B,MsTransform:B,OTransform:B,transform:B,msTransform:B,WebkitTransitionDuration:D,MozTransitionDuration:D,MsTransitionDuration:D,OTransitionDuration:D,transitionDuration:D,msTransitionDuration:D},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!S),onClick:function(){return I.slideRight()},"aria-label":this.props.labels.leftArrow}),M?e.default.createElement(o.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:v,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(O){return I.setItemsListRef(O)},style:v},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!H),onClick:function(){return I.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),x}(e.Component);return ho.default=E,m(E,"displayName","Thumbs"),m(E,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),ho}var yc,ni={},bc,En={};function xc(){if(bc)return En;bc=1,Object.defineProperty(En,"__esModule",{value:!0}),En.setPosition=En.getPosition=En.isKeyboardEvent=En.defaultStatusFormatter=En.noop=void 0;var e,t=Go(),n=(e=Wi())&&e.__esModule?e:{default:e};return En.noop=function(){},En.defaultStatusFormatter=function(r,o){return"".concat(r," of ").concat(o)},En.isKeyboardEvent=function(r){return!!r&&r.hasOwnProperty("key")},En.getPosition=function(r,o){if(o.infiniteLoop&&++r,r===0)return 0;var i=t.Children.count(o.children);if(o.centerMode&&o.axis==="horizontal"){var l=-r*o.centerSlidePercentage,a=i-1;return r&&(r!==a||o.infiniteLoop)?l+=(100-o.centerSlidePercentage)/2:r===a&&(l+=100-o.centerSlidePercentage),l}return 100*-r},En.setPosition=function(r,o){var i={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(l){i[l]=(0,n.default)(r,"%",o)}),i},En}var Cc,Sc,Fn={};function n1(){if(Sc)return co;Sc=1,Object.defineProperty(co,"__esModule",{value:!0}),co.default=void 0;var e=function(v){if(v&&v.__esModule)return v;if(v===null||h(v)!=="object"&&typeof v!="function")return{default:v};var M=c();if(M&&M.has(v))return M.get(v);var S={},H=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in v)if(Object.prototype.hasOwnProperty.call(v,f)){var B=H?Object.getOwnPropertyDescriptor(v,f):null;B&&(B.get||B.set)?Object.defineProperty(S,f,B):S[f]=v[f]}return S.default=v,M&&M.set(v,S),S}(Go()),t=s(sc()),n=s(hc()),r=s(wc()),o=s((yc||(yc=1,Object.defineProperty(ni,"__esModule",{value:!0}),ni.default=void 0,ni.default=function(){return document}),ni)),i=s(vc()),l=xc(),a=function(){if(Cc)return Fn;Cc=1,Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.fadeAnimationHandler=Fn.slideStopSwipingHandler=Fn.slideSwipeAnimationHandler=Fn.slideAnimationHandler=void 0;var v,M=Go(),S=(v=Wi())&&v.__esModule?v:{default:v},H=xc();function f(O,T){var j=Object.keys(O);if(Object.getOwnPropertySymbols){var V=Object.getOwnPropertySymbols(O);T&&(V=V.filter(function(Z){return Object.getOwnPropertyDescriptor(O,Z).enumerable})),j.push.apply(j,V)}return j}function B(O){for(var T=1;T<arguments.length;T++){var j=arguments[T]!=null?arguments[T]:{};T%2?f(Object(j),!0).forEach(function(V){D(O,V,j[V])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(j)):f(Object(j)).forEach(function(V){Object.defineProperty(O,V,Object.getOwnPropertyDescriptor(j,V))})}return O}function D(O,T,j){return T in O?Object.defineProperty(O,T,{value:j,enumerable:!0,configurable:!0,writable:!0}):O[T]=j,O}return Fn.slideAnimationHandler=function(O,T){var j={},V=T.selectedItem,Z=V,J=M.Children.count(O.children)-1;if(O.infiniteLoop&&(V<0||V>J))return Z<0?O.centerMode&&O.centerSlidePercentage&&O.axis==="horizontal"?j.itemListStyle=(0,H.setPosition)(-(J+2)*O.centerSlidePercentage-(100-O.centerSlidePercentage)/2,O.axis):j.itemListStyle=(0,H.setPosition)(100*-(J+2),O.axis):Z>J&&(j.itemListStyle=(0,H.setPosition)(0,O.axis)),j;var ce=(0,H.getPosition)(V,O),le=(0,S.default)(ce,"%",O.axis),q=O.transitionTime+"ms";return j.itemListStyle={WebkitTransform:le,msTransform:le,OTransform:le,transform:le},T.swiping||(j.itemListStyle=B(B({},j.itemListStyle),{},{WebkitTransitionDuration:q,MozTransitionDuration:q,OTransitionDuration:q,transitionDuration:q,msTransitionDuration:q})),j},Fn.slideSwipeAnimationHandler=function(O,T,j,V){var Z={},J=T.axis==="horizontal",ce=M.Children.count(T.children),le=(0,H.getPosition)(j.selectedItem,T),q=T.infiniteLoop?(0,H.getPosition)(ce-1,T)-100:(0,H.getPosition)(ce-1,T),Q=J?O.x:O.y,fe=Q;le===0&&Q>0&&(fe=0),le===q&&Q<0&&(fe=0);var ee=le+100/(j.itemSize/fe),se=Math.abs(Q)>T.swipeScrollTolerance;return T.infiniteLoop&&se&&(j.selectedItem===0&&ee>-100?ee-=100*ce:j.selectedItem===ce-1&&ee<100*-ce&&(ee+=100*ce)),(!T.preventMovementUntilSwipeScrollTolerance||se||j.swipeMovementStarted)&&(j.swipeMovementStarted||V({swipeMovementStarted:!0}),Z.itemListStyle=(0,H.setPosition)(ee,T.axis)),se&&!j.cancelClick&&V({cancelClick:!0}),Z},Fn.slideStopSwipingHandler=function(O,T){var j=(0,H.getPosition)(T.selectedItem,O);return{itemListStyle:(0,H.setPosition)(j,O.axis)}},Fn.fadeAnimationHandler=function(O,T){var j=O.transitionTime+"ms",V="ease-in-out",Z={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:V,msTransitionTimingFunction:V,MozTransitionTimingFunction:V,WebkitTransitionTimingFunction:V,OTransitionTimingFunction:V};return T.swiping||(Z=B(B({},Z),{},{WebkitTransitionDuration:j,MozTransitionDuration:j,OTransitionDuration:j,transitionDuration:j,msTransitionDuration:j})),{slideStyle:Z,selectedStyle:B(B({},Z),{},{opacity:1,position:"relative"}),prevStyle:B({},Z)}},Fn}();function s(v){return v&&v.__esModule?v:{default:v}}function c(){if(typeof WeakMap!="function")return null;var v=new WeakMap;return c=function(){return v},v}function h(v){return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},h(v)}function C(){return C=Object.assign||function(v){for(var M=1;M<arguments.length;M++){var S=arguments[M];for(var H in S)Object.prototype.hasOwnProperty.call(S,H)&&(v[H]=S[H])}return v},C.apply(this,arguments)}function y(v,M){var S=Object.keys(v);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(v);M&&(H=H.filter(function(f){return Object.getOwnPropertyDescriptor(v,f).enumerable})),S.push.apply(S,H)}return S}function b(v){for(var M=1;M<arguments.length;M++){var S=arguments[M]!=null?arguments[M]:{};M%2?y(Object(S),!0).forEach(function(H){x(v,H,S[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(S)):y(Object(S)).forEach(function(H){Object.defineProperty(v,H,Object.getOwnPropertyDescriptor(S,H))})}return v}function p(v,M,S){return M&&function(H,f){for(var B=0;B<f.length;B++){var D=f[B];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(H,D.key,D)}}(v.prototype,M),v}function m(v,M){return m=Object.setPrototypeOf||function(S,H){return S.__proto__=H,S},m(v,M)}function E(v){var M=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var S,H=w(v);if(M){var f=w(this).constructor;S=Reflect.construct(H,arguments,f)}else S=H.apply(this,arguments);return function(B,D){return D&&(h(D)==="object"||typeof D=="function")?D:g(B)}(this,S)}}function g(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function w(v){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(M){return M.__proto__||Object.getPrototypeOf(M)},w(v)}function x(v,M,S){return M in v?Object.defineProperty(v,M,{value:S,enumerable:!0,configurable:!0,writable:!0}):v[M]=S,v}var I=function(v){(function(H,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");H.prototype=Object.create(f&&f.prototype,{constructor:{value:H,writable:!0,configurable:!0}}),f&&m(H,f)})(S,v);var M=E(S);function S(H){var f;(function(D,O){if(!(D instanceof O))throw new TypeError("Cannot call a class as a function")})(this,S),x(g(f=M.call(this,H)),"thumbsRef",void 0),x(g(f),"carouselWrapperRef",void 0),x(g(f),"listRef",void 0),x(g(f),"itemsRef",void 0),x(g(f),"timer",void 0),x(g(f),"animationHandler",void 0),x(g(f),"setThumbsRef",function(D){f.thumbsRef=D}),x(g(f),"setCarouselWrapperRef",function(D){f.carouselWrapperRef=D}),x(g(f),"setListRef",function(D){f.listRef=D}),x(g(f),"setItemsRef",function(D,O){f.itemsRef||(f.itemsRef=[]),f.itemsRef[O]=D}),x(g(f),"autoPlay",function(){e.Children.count(f.props.children)<=1||(f.clearAutoPlay(),f.props.autoPlay&&(f.timer=setTimeout(function(){f.increment()},f.props.interval)))}),x(g(f),"clearAutoPlay",function(){f.timer&&clearTimeout(f.timer)}),x(g(f),"resetAutoPlay",function(){f.clearAutoPlay(),f.autoPlay()}),x(g(f),"stopOnHover",function(){f.setState({isMouseEntered:!0},f.clearAutoPlay)}),x(g(f),"startOnLeave",function(){f.setState({isMouseEntered:!1},f.autoPlay)}),x(g(f),"isFocusWithinTheCarousel",function(){return!!f.carouselWrapperRef&&!((0,o.default)().activeElement!==f.carouselWrapperRef&&!f.carouselWrapperRef.contains((0,o.default)().activeElement))}),x(g(f),"navigateWithKeyboard",function(D){if(f.isFocusWithinTheCarousel()){var O=f.props.axis==="horizontal",T=O?37:38;(O?39:40)===D.keyCode?f.increment():T===D.keyCode&&f.decrement()}}),x(g(f),"updateSizes",function(){if(f.state.initialized&&f.itemsRef&&f.itemsRef.length!==0){var D=f.props.axis==="horizontal",O=f.itemsRef[0];if(O){var T=D?O.clientWidth:O.clientHeight;f.setState({itemSize:T}),f.thumbsRef&&f.thumbsRef.updateSizes()}}}),x(g(f),"setMountState",function(){f.setState({hasMount:!0}),f.updateSizes()}),x(g(f),"handleClickItem",function(D,O){e.Children.count(f.props.children)!==0&&(f.state.cancelClick?f.setState({cancelClick:!1}):(f.props.onClickItem(D,O),D!==f.state.selectedItem&&f.setState({selectedItem:D})))}),x(g(f),"handleOnChange",function(D,O){e.Children.count(f.props.children)<=1||f.props.onChange(D,O)}),x(g(f),"handleClickThumb",function(D,O){f.props.onClickThumb(D,O),f.moveTo(D)}),x(g(f),"onSwipeStart",function(D){f.setState({swiping:!0}),f.props.onSwipeStart(D)}),x(g(f),"onSwipeEnd",function(D){f.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),f.props.onSwipeEnd(D),f.clearAutoPlay(),f.state.autoPlay&&f.autoPlay()}),x(g(f),"onSwipeMove",function(D,O){f.props.onSwipeMove(O);var T=f.props.swipeAnimationHandler(D,f.props,f.state,f.setState.bind(g(f)));return f.setState(b({},T)),!!Object.keys(T).length}),x(g(f),"decrement",function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;f.moveTo(f.state.selectedItem-(typeof D=="number"?D:1))}),x(g(f),"increment",function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;f.moveTo(f.state.selectedItem+(typeof D=="number"?D:1))}),x(g(f),"moveTo",function(D){if(typeof D=="number"){var O=e.Children.count(f.props.children)-1;D<0&&(D=f.props.infiniteLoop?O:0),D>O&&(D=f.props.infiniteLoop?0:O),f.selectItem({selectedItem:D}),f.state.autoPlay&&f.state.isMouseEntered===!1&&f.resetAutoPlay()}}),x(g(f),"onClickNext",function(){f.increment(1)}),x(g(f),"onClickPrev",function(){f.decrement(1)}),x(g(f),"onSwipeForward",function(){f.increment(1),f.props.emulateTouch&&f.setState({cancelClick:!0})}),x(g(f),"onSwipeBackwards",function(){f.decrement(1),f.props.emulateTouch&&f.setState({cancelClick:!0})}),x(g(f),"changeItem",function(D){return function(O){(0,l.isKeyboardEvent)(O)&&O.key!=="Enter"||f.moveTo(D)}}),x(g(f),"selectItem",function(D){f.setState(b({previousItem:f.state.selectedItem},D),function(){f.setState(f.animationHandler(f.props,f.state))}),f.handleOnChange(D.selectedItem,e.Children.toArray(f.props.children)[D.selectedItem])}),x(g(f),"getInitialImage",function(){var D=f.props.selectedItem,O=f.itemsRef&&f.itemsRef[D];return(O&&O.getElementsByTagName("img")||[])[0]}),x(g(f),"getVariableItemHeight",function(D){var O=f.itemsRef&&f.itemsRef[D];if(f.state.hasMount&&O&&O.children.length){var T=O.children[0].getElementsByTagName("img")||[];if(T.length>0){var j=T[0];j.complete||j.addEventListener("load",function Z(){f.forceUpdate(),j.removeEventListener("load",Z)})}var V=(T[0]||O.children[0]).clientHeight;return V>0?V:null}return null});var B={initialized:!1,previousItem:H.selectedItem,selectedItem:H.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:H.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return f.animationHandler=typeof H.animationHandler=="function"&&H.animationHandler||H.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,f.state=b(b({},B),f.animationHandler(H,B)),f}return p(S,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(H,f){H.children||!this.props.children||this.state.initialized||this.setupCarousel(),!H.autoFocus&&this.props.autoFocus&&this.forceFocus(),f.swiping&&!this.state.swiping&&this.setState(b({},this.props.stopSwipingHandler(this.props,this.state))),H.selectedItem===this.props.selectedItem&&H.centerMode===this.props.centerMode||(this.updateSizes(),this.moveTo(this.props.selectedItem)),H.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var H=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var f=H.getInitialImage();f&&!f.complete?f.addEventListener("load",H.setMountState):H.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var H=this.carouselWrapperRef;this.props.stopOnHover&&H&&(H.addEventListener("mouseenter",this.stopOnHover),H.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var H=this.carouselWrapperRef;this.props.stopOnHover&&H&&(H.removeEventListener("mouseenter",this.stopOnHover),H.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,o.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var H=this.getInitialImage();H&&H.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,o.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var H;(H=this.carouselWrapperRef)===null||H===void 0||H.focus()}},{key:"renderItems",value:function(H){var f=this;return this.props.children?e.Children.map(this.props.children,function(B,D){var O=D===f.state.selectedItem,T=D===f.state.previousItem,j=O&&f.state.selectedStyle||T&&f.state.prevStyle||f.state.slideStyle||{};f.props.centerMode&&f.props.axis==="horizontal"&&(j=b(b({},j),{},{minWidth:f.props.centerSlidePercentage+"%"})),f.state.swiping&&f.state.swipeMovementStarted&&(j=b(b({},j),{},{pointerEvents:"none"}));var V={ref:function(Z){return f.setItemsRef(Z,D)},key:"itemKey"+D+(H?"clone":""),className:n.default.ITEM(!0,D===f.state.selectedItem,D===f.state.previousItem),onClick:f.handleClickItem.bind(f,D,B),style:j};return e.default.createElement("li",V,f.props.renderItem(B,{isSelected:D===f.state.selectedItem,isPrevious:D===f.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var H=this,f=this.props,B=f.showIndicators,D=f.labels,O=f.renderIndicator,T=f.children;return B?e.default.createElement("ul",{className:"control-dots"},e.Children.map(T,function(j,V){return O&&O(H.changeItem(V),V===H.state.selectedItem,V,D.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return this.props.showThumbs&&this.props.children&&e.Children.count(this.props.children)!==0?e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children)):null}},{key:"render",value:function(){var H=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var f=this.props.swipeable&&e.Children.count(this.props.children)>1,B=this.props.axis==="horizontal",D=this.props.showArrows&&e.Children.count(this.props.children)>1,O=D&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,T=D&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,j=this.renderItems(!0),V=j.shift(),Z=j.pop(),J={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},ce={};if(B){if(J.onSwipeLeft=this.onSwipeForward,J.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var le=this.getVariableItemHeight(this.state.selectedItem);ce.height=le||"auto"}}else J.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,J.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,J.style=b(b({},J.style),{},{height:this.state.itemSize}),ce.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,O,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:ce},f?e.default.createElement(t.default,C({tagName:"ul",innerRef:this.setListRef},J,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&Z,this.renderItems(),this.props.infiniteLoop&&V):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(q){return H.setListRef(q)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&Z,this.renderItems(),this.props.infiniteLoop&&V)),this.props.renderArrowNext(this.onClickNext,T,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),S}(e.default.Component);return co.default=I,x(I,"displayName","Carousel"),x(I,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:l.noop,onClickThumb:l.noop,onChange:l.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(v,M,S){return e.default.createElement("button",{type:"button","aria-label":S,className:n.default.ARROW_PREV(!M),onClick:v})},renderArrowNext:function(v,M,S){return e.default.createElement("button",{type:"button","aria-label":S,className:n.default.ARROW_NEXT(!M),onClick:v})},renderIndicator:function(v,M,S,H){return e.default.createElement("li",{className:n.default.DOT(M),onClick:v,onKeyDown:v,value:S,key:S,role:"button",tabIndex:0,"aria-label":"".concat(H," ").concat(S+1)})},renderItem:function(v){return v},renderThumbs:function(v){var M=e.Children.map(v,function(S){var H=S;if(S.type!=="img"&&(H=e.Children.toArray(S.props.children).find(function(f){return f.type==="img"})),H)return H});return M.filter(function(S){return S}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):M},statusFormatter:l.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),co}var kc,Mc,r1={},Rc,Ec,Ic,Tc,Hc,Oc,Pc,Dc,$i,zc,o1=(Mc||(Mc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=o(n1()),n=(kc||(kc=1),r1),r=o(wc());function o(i){return i&&i.__esModule?i:{default:i}}}(ic)),ic);function i1(){if(Oc)return Hc;Oc=1;var e=function(){if(Tc)return Ic;Tc=1;var n=/\s/;return Ic=function(r){for(var o=r.length;o--&&n.test(r.charAt(o)););return o}}(),t=/^\s+/;return Hc=function(n){return n&&n.slice(0,e(n)+1).replace(t,"")}}function Xi(){if(Dc)return Pc;Dc=1;var e=i1(),t=Er(),n=Yo(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,l=parseInt;return Pc=function(a){if(typeof a=="number")return a;if(n(a))return NaN;if(t(a)){var s=typeof a.valueOf=="function"?a.valueOf():a;a=t(s)?s+"":s}if(typeof a!="string")return a===0?a:+a;a=e(a);var c=o.test(a);return c||i.test(a)?l(a.slice(2),c?2:8):r.test(a)?NaN:+a}}function Ac(){if(zc)return $i;zc=1;var e=Er(),t=function(){if(Ec)return Rc;Ec=1;var i=Gn();return Rc=function(){return i.Date.now()}}(),n=Xi(),r=Math.max,o=Math.min;return $i=function(i,l,a){var s,c,h,C,y,b,p=0,m=!1,E=!1,g=!0;if(typeof i!="function")throw new TypeError("Expected a function");function w(S){var H=s,f=c;return s=c=void 0,p=S,C=i.apply(f,H)}function x(S){var H=S-b;return b===void 0||H>=l||H<0||E&&S-p>=h}function I(){var S=t();if(x(S))return v(S);y=setTimeout(I,function(H){var f=l-(H-b);return E?o(f,h-(H-p)):f}(S))}function v(S){return y=void 0,g&&s?w(S):(s=c=void 0,C)}function M(){var S=t(),H=x(S);if(s=arguments,c=this,b=S,H){if(y===void 0)return function(f){return p=f,y=setTimeout(I,l),m?w(f):C}(b);if(E)return clearTimeout(y),y=setTimeout(I,l),w(b)}return y===void 0&&(y=setTimeout(I,l)),C}return l=n(l)||0,e(a)&&(m=!!a.leading,h=(E="maxWait"in a)?r(n(a.maxWait)||0,l):h,g="trailing"in a?!!a.trailing:g),M.cancel=function(){y!==void 0&&clearTimeout(y),p=0,s=b=c=y=void 0},M.flush=function(){return y===void 0?C:v(t())},M},$i}const Fc=Sr(Ac());function cn(e,t,n,r,o=!1){const i=d.useRef();i.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,a=s=>{var c;(c=i.current)==null||c.call(l,s)};return l.addEventListener(e,a,{passive:r,capture:o}),()=>{l.removeEventListener(e,a,{capture:o})}},[e,n,r,o])}function dr(e,t){return e===void 0?void 0:t}const a1=Math.PI;function Lc(e){return e*a1/180}const _c=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),jc=(e,t,n,r,o)=>{switch(e){case"left":return Math.floor(t)+r+o/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-o/2}},Nc=(e,t,n)=>Math.min(e,t-2*n),Bc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Gi=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),d.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},l1=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))},s1=new RegExp("^[^A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF]*[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]");function Yi(e){return s1.test(e)?"rtl":"not-rtl"}let ri;function Ki(){if(typeof document>"u")return 0;if(ri!==void 0)return ri;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),ri=n-r,ri}const Tr=Symbol();function c1(e){const t=d.useRef([Tr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,o]=d.useState(),i=d.useCallback(a=>{const s=t.current[0];s!==Tr&&(a=typeof a=="function"?a(s):a)===s||(s!==Tr&&o({}),r(c=>typeof a=="function"?a(s===Tr?c:s):a),t.current[0]=Tr)},[]),l=d.useCallback(()=>{t.current[0]=Tr,o({})},[]);return[t.current[0]===Tr?n:t.current[0],i,l]}function Wc(e){if(e.length===0)return"";let t=0,n=0;for(const r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}const u1=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:o}=e,i=t.filter(a=>a!=="");if(i.length===0)return null;const l=i.length>1;return d.createElement(e1,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(o1.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l},i.map(a=>{const s=(o==null?void 0:o(a))??d.createElement("img",{draggable:!1,src:a});return d.createElement("div",{className:"gdg-centering-container",key:a},s)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(Gi,null)))},d1=Cn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class h1 extends $t.PureComponent{constructor(){super(...arguments);ft(this,"targetElement",null);ft(this,"containerRefHook",n=>{this.targetElement=n,this.renderMarkdownIntoDiv()})}renderMarkdownIntoDiv(){const{targetElement:n,props:r}=this;if(n===null)return;const{contents:o,createNode:i}=r,l=Np(o),a=document.createRange();a.selectNodeContents(n),a.deleteContents();let s=i==null?void 0:i(l);if(s===void 0){const h=document.createElement("template");h.innerHTML=l,s=h.content}n.append(s);const c=n.getElementsByTagName("a");for(const h of c)h.target="_blank",h.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),$t.createElement(d1,{ref:this.containerRefHook})}}const f1=Cn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),g1=Cn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),p1=Cn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let $c=0;const oi=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:o,altNewline:i,validatedSelection:l,...a}=e,{onChange:s,className:c}=a,h=d.useRef(null),C=n??"";Rn(s!==void 0,"GrowingEntry must be a controlled input area");const[y]=d.useState(()=>"input-box-"+($c=($c+1)%1e7));d.useEffect(()=>{const p=h.current;if(p===null||p.disabled)return;const m=C.toString().length;p.focus(),p.setSelectionRange(o?0:m,m)},[]),d.useLayoutEffect(()=>{var p;if(l!==void 0){const m=typeof l=="number"?[l,null]:l;(p=h.current)==null||p.setSelectionRange(m[0],m[1])}},[l]);const b=d.useCallback(p=>{p.key==="Enter"&&p.shiftKey&&i===!0||(r==null||r(p))},[i,r]);return d.createElement(p1,{className:"gdg-growing-entry"},d.createElement(g1,{className:c},C+`
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor-5lo5J1Vt.js","./index-Bw4_53VL.js","./index-BlxPam9h.css","./trash-65Vbt3F6.js","./number-overlay-editor-CzX-JKBj.js"])))=>i.map(i=>d[i]);
|
2
|
+
var Lp=Object.defineProperty;var _p=(ur,$n,Rr)=>$n in ur?Lp(ur,$n,{enumerable:!0,configurable:!0,writable:!0,value:Rr}):ur[$n]=Rr;var ft=(ur,$n,Rr)=>_p(ur,typeof $n!="symbol"?$n+"":$n,Rr);import{gD as Ti,z as Sr,U as d,gE as Fa,aF as Go,aG as jp,b as $t,gF as Np,an as L0,fh as _0,L as La,a as j0,j as nt,dl as Bp,gG as Wp,gH as N0,gI as $p,bp as _a,bn as B0,a6 as ja,gJ as W0,gK as $0,gL as X0,gM as Xp,dr as Gp,dn as Yp,dm as Kp,dp as Vp,am as Up,gN as qp,dz as Jp,gO as Hi,aS as Na,aN as Qp,bc as Zp,eY as G0,a_ as Y0,b1 as em,b2 as tm,ad as nm,ab as rm,ac as om,__tla as im}from"./index-Bw4_53VL.js";import{T as am}from"./trash-65Vbt3F6.js";let Ba,Wa,kr,$a,K0,Mr,Xa,Cn,lm=Promise.all([(()=>{try{return im}catch{}})()]).then(async()=>{var ur,$n,Rr,Ga,Ya,Ka,Va,Ua,qa,Ja,Qa,Za,el,tl,nl,rl,ol,il,al,ll,sl,cl,ul,dl,hl,fl,gl,pl,ml,vl,wl,yl,bl,xl,Cl,Sl,kl,Ml,Rl,El,Il,Tl,Hl,Ol,Pl,Dl,zl,Al,Fl,Ll,_l,jl,Nl,Bl,Wl,$l,Xl,Gl,Yl,Kl,Vl,Ul,ql,Jl,Ql,Zl,es,ts,ns,rs,os,is,as,ls,ss,cs,us,ds,hs,fs,gs,ps,ms,vs,ws,ys,bs,xs,Oi,Cs,Ss,ks,Ms,Rs,Pi,Es,Is,Ts,Hs,Os,Ps,Ds,zs,As,Fs,Ls,_s,js,Ns,Bs,Ws,$s,Xs,Gs;function Xn(){if(Ga)return Rr;Ga=1;var e=Array.isArray;return Rr=e}function Ys(){if(Ka)return Ya;Ka=1;var e=typeof Ti=="object"&&Ti&&Ti.Object===Object&&Ti;return Ya=e}function Gn(){if(Ua)return Va;Ua=1;var e=Ys(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Va=n}function oo(){if(Ja)return qa;Ja=1;var e=Gn().Symbol;return qa=e}function io(){if(rl)return nl;rl=1;var e=oo(),t=function(){if(Za)return Qa;Za=1;var o=oo(),i=Object.prototype,l=i.hasOwnProperty,a=i.toString,s=o?o.toStringTag:void 0;return Qa=function(c){var h=l.call(c,s),C=c[s];try{c[s]=void 0;var y=!0}catch{}var b=a.call(c);return y&&(h?c[s]=C:delete c[s]),b}}(),n=function(){if(tl)return el;tl=1;var o=Object.prototype.toString;return el=function(i){return o.call(i)}}(),r=e?e.toStringTag:void 0;return nl=function(o){return o==null?o===void 0?"[object Undefined]":"[object Null]":r&&r in Object(o)?t(o):n(o)}}function ao(){return il?ol:(il=1,ol=function(e){return e!=null&&typeof e=="object"})}function Yo(){if(ll)return al;ll=1;var e=io(),t=ao();return al=function(n){return typeof n=="symbol"||t(n)&&e(n)=="[object Symbol]"}}function Di(){if(cl)return sl;cl=1;var e=Xn(),t=Yo(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return sl=function(o,i){if(e(o))return!1;var l=typeof o;return!(l!="number"&&l!="symbol"&&l!="boolean"&&o!=null&&!t(o))||r.test(o)||!n.test(o)||i!=null&&o in Object(i)}}function Er(){return dl?ul:(dl=1,ul=function(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")})}function Ks(){if(fl)return hl;fl=1;var e=io(),t=Er();return hl=function(n){if(!t(n))return!1;var r=e(n);return r=="[object Function]"||r=="[object GeneratorFunction]"||r=="[object AsyncFunction]"||r=="[object Proxy]"}}function V0(){if(vl)return ml;vl=1;var e,t=function(){if(pl)return gl;pl=1;var r=Gn()["__core-js_shared__"];return gl=r}(),n=(e=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";return ml=function(r){return!!n&&n in r}}function Vs(){if(yl)return wl;yl=1;var e=Function.prototype.toString;return wl=function(t){if(t!=null){try{return e.call(t)}catch{}try{return t+""}catch{}}return""}}function Ir(){if(Ml)return kl;Ml=1;var e=function(){if(xl)return bl;xl=1;var n=Ks(),r=V0(),o=Er(),i=Vs(),l=/^\[object .+?Constructor\]$/,a=Function.prototype,s=Object.prototype,c=a.toString,h=s.hasOwnProperty,C=RegExp("^"+c.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return bl=function(y){return!(!o(y)||r(y))&&(n(y)?C:l).test(i(y))}}(),t=Sl?Cl:(Sl=1,Cl=function(n,r){return n==null?void 0:n[r]});return kl=function(n,r){var o=t(n,r);return e(o)?o:void 0}}function Ko(){if(El)return Rl;El=1;var e=Ir()(Object,"create");return Rl=e}function U0(){if(jl)return _l;jl=1;var e=function(){if(Tl)return Il;Tl=1;var l=Ko();return Il=function(){this.__data__=l?l(null):{},this.size=0}}(),t=Ol?Hl:(Ol=1,Hl=function(l){var a=this.has(l)&&delete this.__data__[l];return this.size-=a?1:0,a}),n=function(){if(Dl)return Pl;Dl=1;var l=Ko(),a=Object.prototype.hasOwnProperty;return Pl=function(s){var c=this.__data__;if(l){var h=c[s];return h==="__lodash_hash_undefined__"?void 0:h}return a.call(c,s)?c[s]:void 0}}(),r=function(){if(Al)return zl;Al=1;var l=Ko(),a=Object.prototype.hasOwnProperty;return zl=function(s){var c=this.__data__;return l?c[s]!==void 0:a.call(c,s)}}(),o=function(){if(Ll)return Fl;Ll=1;var l=Ko();return Fl=function(a,s){var c=this.__data__;return this.size+=this.has(a)?0:1,c[a]=l&&s===void 0?"__lodash_hash_undefined__":s,this}}();function i(l){var a=-1,s=l==null?0:l.length;for(this.clear();++a<s;){var c=l[a];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,_l=i}function zi(){return $l?Wl:($l=1,Wl=function(e,t){return e===t||e!=e&&t!=t})}function Vo(){if(Gl)return Xl;Gl=1;var e=zi();return Xl=function(t,n){for(var r=t.length;r--;)if(e(t[r][0],n))return r;return-1}}function Uo(){if(ts)return es;ts=1;var e=Bl?Nl:(Bl=1,Nl=function(){this.__data__=[],this.size=0}),t=function(){if(Kl)return Yl;Kl=1;var l=Vo(),a=Array.prototype.splice;return Yl=function(s){var c=this.__data__,h=l(c,s);return!(h<0||(h==c.length-1?c.pop():a.call(c,h,1),--this.size,0))}}(),n=function(){if(Ul)return Vl;Ul=1;var l=Vo();return Vl=function(a){var s=this.__data__,c=l(s,a);return c<0?void 0:s[c][1]}}(),r=function(){if(Jl)return ql;Jl=1;var l=Vo();return ql=function(a){return l(this.__data__,a)>-1}}(),o=function(){if(Zl)return Ql;Zl=1;var l=Vo();return Ql=function(a,s){var c=this.__data__,h=l(c,a);return h<0?(++this.size,c.push([a,s])):c[h][1]=s,this}}();function i(l){var a=-1,s=l==null?0:l.length;for(this.clear();++a<s;){var c=l[a];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,es=i}function Ai(){if(rs)return ns;rs=1;var e=Ir()(Gn(),"Map");return ns=e}function qo(){if(cs)return ss;cs=1;var e=ls?as:(ls=1,as=function(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null});return ss=function(t,n){var r=t.__data__;return e(n)?r[typeof n=="string"?"string":"hash"]:r.map}}function Fi(){if(ys)return ws;ys=1;var e=function(){if(is)return os;is=1;var l=U0(),a=Uo(),s=Ai();return os=function(){this.size=0,this.__data__={hash:new l,map:new(s||a),string:new l}}}(),t=function(){if(ds)return us;ds=1;var l=qo();return us=function(a){var s=l(this,a).delete(a);return this.size-=s?1:0,s}}(),n=function(){if(fs)return hs;fs=1;var l=qo();return hs=function(a){return l(this,a).get(a)}}(),r=function(){if(ps)return gs;ps=1;var l=qo();return gs=function(a){return l(this,a).has(a)}}(),o=function(){if(vs)return ms;vs=1;var l=qo();return ms=function(a,s){var c=l(this,a),h=c.size;return c.set(a,s),this.size+=c.size==h?0:1,this}}();function i(l){var a=-1,s=l==null?0:l.length;for(this.clear();++a<s;){var c=l[a];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,ws=i}function q0(){if(Cs)return Oi;Cs=1;var e=function(){if(xs)return bs;xs=1;var t=Fi();function n(r,o){if(typeof r!="function"||o!=null&&typeof o!="function")throw new TypeError("Expected a function");var i=function(){var l=arguments,a=o?o.apply(this,l):l[0],s=i.cache;if(s.has(a))return s.get(a);var c=r.apply(this,l);return i.cache=s.set(a,c)||s,c};return i.cache=new(n.Cache||t),i}return n.Cache=t,bs=n}();return Oi=function(t){var n=e(t,function(o){return r.size===500&&r.clear(),o}),r=n.cache;return n},Oi}function J0(){if(Es)return Pi;Es=1;var e=oo(),t=Rs?Ms:(Rs=1,Ms=function(l,a){for(var s=-1,c=l==null?0:l.length,h=Array(c);++s<c;)h[s]=a(l[s],s,l);return h}),n=Xn(),r=Yo(),o=e?e.prototype:void 0,i=o?o.toString:void 0;return Pi=function l(a){if(typeof a=="string")return a;if(n(a))return t(a,l)+"";if(r(a))return i?i.call(a):"";var s=a+"";return s=="0"&&1/a==-1/0?"-0":s},Pi}function Us(){if(Os)return Hs;Os=1;var e=Xn(),t=Di(),n=function(){if(ks)return Ss;ks=1;var o=q0(),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l=/\\(\\)?/g,a=o(function(s){var c=[];return s.charCodeAt(0)===46&&c.push(""),s.replace(i,function(h,C,y,b){c.push(y?b.replace(l,"$1"):C||h)}),c});return Ss=a}(),r=function(){if(Ts)return Is;Ts=1;var o=J0();return Is=function(i){return i==null?"":o(i)}}();return Hs=function(o,i){return e(o)?o:t(o,i)?[o]:n(r(o))}}function Li(){if(As)return zs;As=1;var e=function(){if(Ds)return Ps;Ds=1;var l=io(),a=ao();return Ps=function(s){return a(s)&&l(s)=="[object Arguments]"}}(),t=ao(),n=Object.prototype,r=n.hasOwnProperty,o=n.propertyIsEnumerable,i=e(function(){return arguments}())?e:function(l){return t(l)&&r.call(l,"callee")&&!o.call(l,"callee")};return zs=i}function _i(){if(Ls)return Fs;Ls=1;var e=/^(?:0|[1-9]\d*)$/;return Fs=function(t,n){var r=typeof t;return!!(n=n??9007199254740991)&&(r=="number"||r!="symbol"&&e.test(t))&&t>-1&&t%1==0&&t<n}}function ji(){return js?_s:(js=1,_s=function(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=9007199254740991})}function Jo(){if(Bs)return Ns;Bs=1;var e=Yo();return Ns=function(t){if(typeof t=="string"||e(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}}function qs(){if($s)return Ws;$s=1;var e=Us(),t=Li(),n=Xn(),r=_i(),o=ji(),i=Jo();return Ws=function(l,a,s){for(var c=-1,h=(a=e(a,l)).length,C=!1;++c<h;){var y=i(a[c]);if(!(C=l!=null&&s(l,y)))break;l=l[y]}return C||++c!=h?C:!!(h=l==null?0:l.length)&&o(h)&&r(y,h)&&(n(l)||t(l))}}const Q0=Sr(function(){if(Gs)return Xs;Gs=1;var e=function(){if($n)return ur;$n=1;var n=Object.prototype.hasOwnProperty;return ur=function(r,o){return r!=null&&n.call(r,o)}}(),t=qs();return Xs=function(n,r){return n!=null&&t(n,r,e)}}());function Js(e="This should not happen"){throw new Error(e)}function Rn(e,t="Assertion failed"){if(!e)return Js(t)}function lo(e,t){return Js(t??"Hell froze over")}const Qs=Object.prototype.hasOwnProperty;function $r(e,t){let n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&$r(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){for(n in r=0,e)if(Qs.call(e,n)&&++r&&!Qs.call(t,n)||!(n in t)||!$r(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!=e&&t!=t}const Qo=null,Ni=void 0;var me,Jn,Zo,Hn;function ei(e){return"width"in e&&typeof e.width=="number"}async function Zs(e){return typeof e=="object"?e:await e()}Mr=function(e){return e.kind!==me.Loading&&e.kind!==me.Bubble&&e.kind!==me.RowID&&e.kind!==me.Protected&&e.kind!==me.Drilldown},kr=function(e){return e.kind===Hn.Marker||e.kind===Hn.NewRow};function so(e){if(!Mr(e)||e.kind===me.Image)return!1;switch(e.kind){case me.Text:case me.Number:case me.Markdown:case me.Uri:case me.Custom:case me.Boolean:return e.readonly!==!0;default:lo(0,"A cell was passed with an invalid kind")}}$a=function(e){return Q0(e,"editor")};function Bi(e){return!e.readonly}let ec;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(me||(me={})),function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"}(Jn||(Jn={})),function(e){e.Triangle="triangle",e.Dots="dots"}(Zo||(Zo={})),function(e){e.NewRow="new-row",e.Marker="marker"}(Hn||(Hn={}));const er=class er{constructor(t){ft(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new er(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=function(o){if(o.length===0)return[];const i=[...o],l=[];i.sort(function(a,s){return a[0]-s[0]}),l.push([...i[0]]);for(const a of i.slice(1)){const s=l[l.length-1];s[1]<a[0]?l.push([...a]):s[1]<a[1]&&(s[1]=a[1])}return l}([...this.items,n]);return new er(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],o=typeof t=="number"?t+1:t[1];for(const[i,l]of n.entries()){const[a,s]=l;if(a<=o&&r<=s){const c=[];a<r&&c.push([a,r]),o<s&&c.push([o,s]),n.splice(i,1,...c)}}return new er(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,o]=this.items[n];if(t>=r&&t<o)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],o=this.items[n];if(r[0]!==o[0]||r[1]!==o[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let o=n;o<r;o++)t.push(o);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}};ft(er,"empty",()=>ec??(ec=new er([]))),ft(er,"fromSingleSelection",t=>er.empty().add(t));let yt=er;var tc=function(){const e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(o=>{(o?o.split(" "):[]).forEach(i=>{if(i.startsWith("atm_")){const[,l]=i.split("_");t[l]=i}else n.push(i)})});const r=[];for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.push(t[o]);return r.push(...n),r.join(" ")},nc=(e,t)=>{const n={};return Object.keys(e).filter((r=>o=>r.indexOf(o)===-1)(t)).forEach(r=>{n[r]=e[r]}),n},Z0=(e,t)=>{};Cn=function(e){let t="";return n=>{const r=(i,l)=>{const{as:a=e,class:s=t}=i;var c;const h=function(y,b,p){const m=nc(b,p);if(!y){const E=typeof Fa=="function"?{default:Fa}:Fa;Object.keys(m).forEach(g=>{E.default(g)||delete m[g]})}return m}(n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&(c=a[0],c.toUpperCase()!==c)):n.propsAsIs,i,["as","class"]);h.ref=l,h.className=n.atomic?tc(n.class,h.className||s):tc(h.className||s,n.class);const{vars:C}=n;if(C){const y={};for(const m in C){const E=C[m],g=E[0],w=E[1]||"",x=typeof g=="function"?g(i):g;Z0(0,n.name),y[`--${m}`]=`${x}${w}`}const b=h.style||{},p=Object.keys(b);p.length>0&&p.forEach(m=>{y[m]=b[m]}),h.style=y}return e.__wyw_meta&&e!==a?(h.as=a,d.createElement(e,h)):d.createElement(a,h)},o=d.forwardRef?d.forwardRef(r):i=>{const l=nc(i,["innerRef"]);return r(l,i.innerRef)};return o.displayName=n.name,o.__wyw_meta={className:n.class||t,extends:e},o}};const e1=Cn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var rc,oc,ic={},co={},ac={},lc={};function t1(){return rc||(rc=1,function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.setHasSupportToCaptureOption=b;var r=i(t),o=i(n);function i(g){return g&&g.__esModule?g:{default:g}}var l=Object.assign||function(g){for(var w=1;w<arguments.length;w++){var x=arguments[w];for(var I in x)Object.prototype.hasOwnProperty.call(x,I)&&(g[I]=x[I])}return g};function a(g,w){var x={};for(var I in g)w.indexOf(I)>=0||Object.prototype.hasOwnProperty.call(g,I)&&(x[I]=g[I]);return x}function s(g,w){if(!(g instanceof w))throw new TypeError("Cannot call a class as a function")}var c=function(){function g(w,x){for(var I=0;I<x.length;I++){var v=x[I];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(w,v.key,v)}}return function(w,x,I){return x&&g(w.prototype,x),I&&g(w,I),w}}();function h(g,w){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!w||typeof w!="object"&&typeof w!="function"?g:w}function C(g,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);g.prototype=Object.create(w&&w.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(g,w):g.__proto__=w)}var y=!1;function b(g){y=g}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){b(!0)}}))}catch{}function p(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return y?g:g.capture}function m(g){if("touches"in g){var w=g.touches[0];return{x:w.pageX,y:w.pageY}}return{x:g.screenX,y:g.screenY}}var E=function(g){function w(){var x;s(this,w);for(var I=arguments.length,v=Array(I),M=0;M<I;M++)v[M]=arguments[M];var S=h(this,(x=w.__proto__||Object.getPrototypeOf(w)).call.apply(x,[this].concat(v)));return S._handleSwipeStart=S._handleSwipeStart.bind(S),S._handleSwipeMove=S._handleSwipeMove.bind(S),S._handleSwipeEnd=S._handleSwipeEnd.bind(S),S._onMouseDown=S._onMouseDown.bind(S),S._onMouseMove=S._onMouseMove.bind(S),S._onMouseUp=S._onMouseUp.bind(S),S._setSwiperRef=S._setSwiperRef.bind(S),S}return C(w,g),c(w,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(x){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(x))}},{key:"_onMouseMove",value:function(x){this.mouseDown&&this._handleSwipeMove(x)}},{key:"_onMouseUp",value:function(x){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(x)}},{key:"_handleSwipeStart",value:function(x){var I=m(x),v=I.x,M=I.y;this.moveStart={x:v,y:M},this.props.onSwipeStart(x)}},{key:"_handleSwipeMove",value:function(x){if(this.moveStart){var I=m(x),v=I.x,M=I.y,S=v-this.moveStart.x,H=M-this.moveStart.y;this.moving=!0,this.props.onSwipeMove({x:S,y:H},x)&&x.cancelable&&x.preventDefault(),this.movePosition={deltaX:S,deltaY:H}}}},{key:"_handleSwipeEnd",value:function(x){this.props.onSwipeEnd(x);var I=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-I?this.props.onSwipeLeft(1,x):this.movePosition.deltaX>I&&this.props.onSwipeRight(1,x),this.movePosition.deltaY<-I?this.props.onSwipeUp(1,x):this.movePosition.deltaY>I&&this.props.onSwipeDown(1,x)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(x){this.swiper=x,this.props.innerRef(x)}},{key:"render",value:function(){var x=this.props;x.tagName;var I=x.className,v=x.style,M=x.children;x.allowMouseEvents,x.onSwipeUp,x.onSwipeDown,x.onSwipeLeft,x.onSwipeRight,x.onSwipeStart,x.onSwipeMove,x.onSwipeEnd,x.innerRef,x.tolerance;var S=a(x,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return r.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:I,style:v},S),M)}}]),w}(t.Component);E.displayName="ReactSwipe",E.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},E.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},e.default=E}(lc,Go(),jp())),lc}function sc(){return oc||(oc=1,function(e,t){Object.defineProperty(e,"__esModule",{value:!0});var n=r(t);function r(o){return o&&o.__esModule?o:{default:o}}e.default=n.default}(ac,t1())),ac}var cc,uc,uo={},dc={exports:{}};function hc(){if(uc)return uo;uc=1,Object.defineProperty(uo,"__esModule",{value:!0}),uo.default=void 0;var e,t,n=(cc||(cc=1,t=dc,function(){var o={}.hasOwnProperty;function i(){for(var s="",c=0;c<arguments.length;c++){var h=arguments[c];h&&(s=a(s,l(h)))}return s}function l(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return i.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var c="";for(var h in s)o.call(s,h)&&s[h]&&(c=a(c,h));return c}function a(s,c){return c?s?s+" "+c:s+c:s}t.exports?(i.default=i,t.exports=i):window.classNames=i}()),(e=dc.exports)&&e.__esModule?e:{default:e}),r={ROOT:function(o){return(0,n.default)(function(i,l,a){return l in i?Object.defineProperty(i,l,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[l]=a,i}({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,n.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,i){return(0,n.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":i==="horizontal","axis-vertical":i!=="horizontal"})},SLIDER:function(o,i){return(0,n.default)({thumbs:!o,slider:o,animated:!i})},ITEM:function(o,i,l){return(0,n.default)({thumb:!o,slide:o,selected:i,previous:l})},ARROW_PREV:function(o){return(0,n.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,n.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,n.default)({dot:!0,selected:o})}};return uo.default=r,uo}var fc,ho={},ti={},gc,fo={};function Wi(){return gc?fo:(gc=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.default=void 0,fo.default=function(e,t,n){var r=e===0?e:e+t;return"translate3d"+("("+(n==="horizontal"?[r,0,0]:[0,r,0]).join(",")+")")},fo)}var pc,mc,go={};function vc(){return pc?go:(pc=1,Object.defineProperty(go,"__esModule",{value:!0}),go.default=void 0,go.default=function(){return window},go)}function wc(){if(mc)return ho;mc=1,Object.defineProperty(ho,"__esModule",{value:!0}),ho.default=void 0;var e=function(g){if(g&&g.__esModule)return g;if(g===null||s(g)!=="object"&&typeof g!="function")return{default:g};var w=a();if(w&&w.has(g))return w.get(g);var x={},I=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in g)if(Object.prototype.hasOwnProperty.call(g,v)){var M=I?Object.getOwnPropertyDescriptor(g,v):null;M&&(M.get||M.set)?Object.defineProperty(x,v,M):x[v]=g[v]}return x.default=g,w&&w.set(g,x),x}(Go()),t=l(hc()),n=(fc||(fc=1,Object.defineProperty(ti,"__esModule",{value:!0}),ti.outerWidth=void 0,ti.outerWidth=function(g){var w=g.offsetWidth,x=getComputedStyle(g);return w+(parseInt(x.marginLeft)+parseInt(x.marginRight))}),ti),r=l(Wi()),o=l(sc()),i=l(vc());function l(g){return g&&g.__esModule?g:{default:g}}function a(){if(typeof WeakMap!="function")return null;var g=new WeakMap;return a=function(){return g},g}function s(g){return s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},s(g)}function c(){return c=Object.assign||function(g){for(var w=1;w<arguments.length;w++){var x=arguments[w];for(var I in x)Object.prototype.hasOwnProperty.call(x,I)&&(g[I]=x[I])}return g},c.apply(this,arguments)}function h(g,w,x){return w&&function(I,v){for(var M=0;M<v.length;M++){var S=v[M];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}(g.prototype,w),g}function C(g,w){return C=Object.setPrototypeOf||function(x,I){return x.__proto__=I,x},C(g,w)}function y(g){var w=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var x,I=p(g);if(w){var v=p(this).constructor;x=Reflect.construct(I,arguments,v)}else x=I.apply(this,arguments);return function(M,S){return S&&(s(S)==="object"||typeof S=="function")?S:b(M)}(this,x)}}function b(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function p(g){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},p(g)}function m(g,w,x){return w in g?Object.defineProperty(g,w,{value:x,enumerable:!0,configurable:!0,writable:!0}):g[w]=x,g}var E=function(g){(function(I,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(v&&v.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),v&&C(I,v)})(x,g);var w=y(x);function x(I){var v;return function(M,S){if(!(M instanceof S))throw new TypeError("Cannot call a class as a function")}(this,x),m(b(v=w.call(this,I)),"itemsWrapperRef",void 0),m(b(v),"itemsListRef",void 0),m(b(v),"thumbsRef",void 0),m(b(v),"setItemsWrapperRef",function(M){v.itemsWrapperRef=M}),m(b(v),"setItemsListRef",function(M){v.itemsListRef=M}),m(b(v),"setThumbsRef",function(M,S){v.thumbsRef||(v.thumbsRef=[]),v.thumbsRef[S]=M}),m(b(v),"updateSizes",function(){if(v.props.children&&v.itemsWrapperRef&&v.thumbsRef){var M=e.Children.count(v.props.children),S=v.itemsWrapperRef.clientWidth,H=v.props.thumbWidth?v.props.thumbWidth:(0,n.outerWidth)(v.thumbsRef[0]),f=Math.floor(S/H),B=f<M,D=B?M-f:0;v.setState(function(O,T){return{itemSize:H,visibleItems:f,firstItem:B?v.getFirstItem(T.selectedItem):0,lastPosition:D,showArrows:B}})}}),m(b(v),"handleClickItem",function(M,S,H){if(!function(B){return B.hasOwnProperty("key")}(H)||H.key==="Enter"){var f=v.props.onSelectItem;typeof f=="function"&&f(M,S)}}),m(b(v),"onSwipeStart",function(){v.setState({swiping:!0})}),m(b(v),"onSwipeEnd",function(){v.setState({swiping:!1})}),m(b(v),"onSwipeMove",function(M){var S=M.x;if(!v.state.itemSize||!v.itemsWrapperRef||!v.state.visibleItems)return!1;var H=e.Children.count(v.props.children),f=-100*v.state.firstItem/v.state.visibleItems;f===0&&S>0&&(S=0),f===100*-Math.max(H-v.state.visibleItems,0)/v.state.visibleItems&&S<0&&(S=0);var B=f+100/(v.itemsWrapperRef.clientWidth/S);return v.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(D){v.itemsListRef.style[D]=(0,r.default)(B,"%",v.props.axis)}),!0}),m(b(v),"slideRight",function(M){v.moveTo(v.state.firstItem-(typeof M=="number"?M:1))}),m(b(v),"slideLeft",function(M){v.moveTo(v.state.firstItem+(typeof M=="number"?M:1))}),m(b(v),"moveTo",function(M){M=(M=M<0?0:M)>=v.state.lastPosition?v.state.lastPosition:M,v.setState({firstItem:M})}),v.state={selectedItem:I.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},v}return h(x,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(I){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==I.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(I){var v=I;return I>=this.state.lastPosition&&(v=this.state.lastPosition),I<this.state.firstItem+this.state.visibleItems&&(v=this.state.firstItem),I<this.state.firstItem&&(v=I),v}},{key:"renderItems",value:function(){var I=this;return this.props.children.map(function(v,M){var S=t.default.ITEM(!1,M===I.state.selectedItem),H={key:M,ref:function(f){return I.setThumbsRef(f,M)},className:S,onClick:I.handleClickItem.bind(I,M,I.props.children[M]),onKeyDown:I.handleClickItem.bind(I,M,I.props.children[M]),"aria-label":"".concat(I.props.labels.item," ").concat(M+1),style:{width:I.props.thumbWidth}};return e.default.createElement("li",c({},H,{role:"button",tabIndex:0}),v)})}},{key:"render",value:function(){var I=this;if(!this.props.children)return null;var v,M=e.Children.count(this.props.children)>1,S=this.state.showArrows&&this.state.firstItem>0,H=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,f=-this.state.firstItem*(this.state.itemSize||0),B=(0,r.default)(f,"px",this.props.axis),D=this.props.transitionTime+"ms";return v={WebkitTransform:B,MozTransform:B,MsTransform:B,OTransform:B,transform:B,msTransform:B,WebkitTransitionDuration:D,MozTransitionDuration:D,MsTransitionDuration:D,OTransitionDuration:D,transitionDuration:D,msTransitionDuration:D},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!S),onClick:function(){return I.slideRight()},"aria-label":this.props.labels.leftArrow}),M?e.default.createElement(o.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:v,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(O){return I.setItemsListRef(O)},style:v},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!H),onClick:function(){return I.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),x}(e.Component);return ho.default=E,m(E,"displayName","Thumbs"),m(E,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),ho}var yc,ni={},bc,En={};function xc(){if(bc)return En;bc=1,Object.defineProperty(En,"__esModule",{value:!0}),En.setPosition=En.getPosition=En.isKeyboardEvent=En.defaultStatusFormatter=En.noop=void 0;var e,t=Go(),n=(e=Wi())&&e.__esModule?e:{default:e};return En.noop=function(){},En.defaultStatusFormatter=function(r,o){return"".concat(r," of ").concat(o)},En.isKeyboardEvent=function(r){return!!r&&r.hasOwnProperty("key")},En.getPosition=function(r,o){if(o.infiniteLoop&&++r,r===0)return 0;var i=t.Children.count(o.children);if(o.centerMode&&o.axis==="horizontal"){var l=-r*o.centerSlidePercentage,a=i-1;return r&&(r!==a||o.infiniteLoop)?l+=(100-o.centerSlidePercentage)/2:r===a&&(l+=100-o.centerSlidePercentage),l}return 100*-r},En.setPosition=function(r,o){var i={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(l){i[l]=(0,n.default)(r,"%",o)}),i},En}var Cc,Sc,Fn={};function n1(){if(Sc)return co;Sc=1,Object.defineProperty(co,"__esModule",{value:!0}),co.default=void 0;var e=function(v){if(v&&v.__esModule)return v;if(v===null||h(v)!=="object"&&typeof v!="function")return{default:v};var M=c();if(M&&M.has(v))return M.get(v);var S={},H=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in v)if(Object.prototype.hasOwnProperty.call(v,f)){var B=H?Object.getOwnPropertyDescriptor(v,f):null;B&&(B.get||B.set)?Object.defineProperty(S,f,B):S[f]=v[f]}return S.default=v,M&&M.set(v,S),S}(Go()),t=s(sc()),n=s(hc()),r=s(wc()),o=s((yc||(yc=1,Object.defineProperty(ni,"__esModule",{value:!0}),ni.default=void 0,ni.default=function(){return document}),ni)),i=s(vc()),l=xc(),a=function(){if(Cc)return Fn;Cc=1,Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.fadeAnimationHandler=Fn.slideStopSwipingHandler=Fn.slideSwipeAnimationHandler=Fn.slideAnimationHandler=void 0;var v,M=Go(),S=(v=Wi())&&v.__esModule?v:{default:v},H=xc();function f(O,T){var j=Object.keys(O);if(Object.getOwnPropertySymbols){var V=Object.getOwnPropertySymbols(O);T&&(V=V.filter(function(Z){return Object.getOwnPropertyDescriptor(O,Z).enumerable})),j.push.apply(j,V)}return j}function B(O){for(var T=1;T<arguments.length;T++){var j=arguments[T]!=null?arguments[T]:{};T%2?f(Object(j),!0).forEach(function(V){D(O,V,j[V])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(j)):f(Object(j)).forEach(function(V){Object.defineProperty(O,V,Object.getOwnPropertyDescriptor(j,V))})}return O}function D(O,T,j){return T in O?Object.defineProperty(O,T,{value:j,enumerable:!0,configurable:!0,writable:!0}):O[T]=j,O}return Fn.slideAnimationHandler=function(O,T){var j={},V=T.selectedItem,Z=V,J=M.Children.count(O.children)-1;if(O.infiniteLoop&&(V<0||V>J))return Z<0?O.centerMode&&O.centerSlidePercentage&&O.axis==="horizontal"?j.itemListStyle=(0,H.setPosition)(-(J+2)*O.centerSlidePercentage-(100-O.centerSlidePercentage)/2,O.axis):j.itemListStyle=(0,H.setPosition)(100*-(J+2),O.axis):Z>J&&(j.itemListStyle=(0,H.setPosition)(0,O.axis)),j;var ce=(0,H.getPosition)(V,O),le=(0,S.default)(ce,"%",O.axis),q=O.transitionTime+"ms";return j.itemListStyle={WebkitTransform:le,msTransform:le,OTransform:le,transform:le},T.swiping||(j.itemListStyle=B(B({},j.itemListStyle),{},{WebkitTransitionDuration:q,MozTransitionDuration:q,OTransitionDuration:q,transitionDuration:q,msTransitionDuration:q})),j},Fn.slideSwipeAnimationHandler=function(O,T,j,V){var Z={},J=T.axis==="horizontal",ce=M.Children.count(T.children),le=(0,H.getPosition)(j.selectedItem,T),q=T.infiniteLoop?(0,H.getPosition)(ce-1,T)-100:(0,H.getPosition)(ce-1,T),Q=J?O.x:O.y,fe=Q;le===0&&Q>0&&(fe=0),le===q&&Q<0&&(fe=0);var ee=le+100/(j.itemSize/fe),se=Math.abs(Q)>T.swipeScrollTolerance;return T.infiniteLoop&&se&&(j.selectedItem===0&&ee>-100?ee-=100*ce:j.selectedItem===ce-1&&ee<100*-ce&&(ee+=100*ce)),(!T.preventMovementUntilSwipeScrollTolerance||se||j.swipeMovementStarted)&&(j.swipeMovementStarted||V({swipeMovementStarted:!0}),Z.itemListStyle=(0,H.setPosition)(ee,T.axis)),se&&!j.cancelClick&&V({cancelClick:!0}),Z},Fn.slideStopSwipingHandler=function(O,T){var j=(0,H.getPosition)(T.selectedItem,O);return{itemListStyle:(0,H.setPosition)(j,O.axis)}},Fn.fadeAnimationHandler=function(O,T){var j=O.transitionTime+"ms",V="ease-in-out",Z={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:V,msTransitionTimingFunction:V,MozTransitionTimingFunction:V,WebkitTransitionTimingFunction:V,OTransitionTimingFunction:V};return T.swiping||(Z=B(B({},Z),{},{WebkitTransitionDuration:j,MozTransitionDuration:j,OTransitionDuration:j,transitionDuration:j,msTransitionDuration:j})),{slideStyle:Z,selectedStyle:B(B({},Z),{},{opacity:1,position:"relative"}),prevStyle:B({},Z)}},Fn}();function s(v){return v&&v.__esModule?v:{default:v}}function c(){if(typeof WeakMap!="function")return null;var v=new WeakMap;return c=function(){return v},v}function h(v){return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},h(v)}function C(){return C=Object.assign||function(v){for(var M=1;M<arguments.length;M++){var S=arguments[M];for(var H in S)Object.prototype.hasOwnProperty.call(S,H)&&(v[H]=S[H])}return v},C.apply(this,arguments)}function y(v,M){var S=Object.keys(v);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(v);M&&(H=H.filter(function(f){return Object.getOwnPropertyDescriptor(v,f).enumerable})),S.push.apply(S,H)}return S}function b(v){for(var M=1;M<arguments.length;M++){var S=arguments[M]!=null?arguments[M]:{};M%2?y(Object(S),!0).forEach(function(H){x(v,H,S[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(S)):y(Object(S)).forEach(function(H){Object.defineProperty(v,H,Object.getOwnPropertyDescriptor(S,H))})}return v}function p(v,M,S){return M&&function(H,f){for(var B=0;B<f.length;B++){var D=f[B];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(H,D.key,D)}}(v.prototype,M),v}function m(v,M){return m=Object.setPrototypeOf||function(S,H){return S.__proto__=H,S},m(v,M)}function E(v){var M=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var S,H=w(v);if(M){var f=w(this).constructor;S=Reflect.construct(H,arguments,f)}else S=H.apply(this,arguments);return function(B,D){return D&&(h(D)==="object"||typeof D=="function")?D:g(B)}(this,S)}}function g(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function w(v){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(M){return M.__proto__||Object.getPrototypeOf(M)},w(v)}function x(v,M,S){return M in v?Object.defineProperty(v,M,{value:S,enumerable:!0,configurable:!0,writable:!0}):v[M]=S,v}var I=function(v){(function(H,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");H.prototype=Object.create(f&&f.prototype,{constructor:{value:H,writable:!0,configurable:!0}}),f&&m(H,f)})(S,v);var M=E(S);function S(H){var f;(function(D,O){if(!(D instanceof O))throw new TypeError("Cannot call a class as a function")})(this,S),x(g(f=M.call(this,H)),"thumbsRef",void 0),x(g(f),"carouselWrapperRef",void 0),x(g(f),"listRef",void 0),x(g(f),"itemsRef",void 0),x(g(f),"timer",void 0),x(g(f),"animationHandler",void 0),x(g(f),"setThumbsRef",function(D){f.thumbsRef=D}),x(g(f),"setCarouselWrapperRef",function(D){f.carouselWrapperRef=D}),x(g(f),"setListRef",function(D){f.listRef=D}),x(g(f),"setItemsRef",function(D,O){f.itemsRef||(f.itemsRef=[]),f.itemsRef[O]=D}),x(g(f),"autoPlay",function(){e.Children.count(f.props.children)<=1||(f.clearAutoPlay(),f.props.autoPlay&&(f.timer=setTimeout(function(){f.increment()},f.props.interval)))}),x(g(f),"clearAutoPlay",function(){f.timer&&clearTimeout(f.timer)}),x(g(f),"resetAutoPlay",function(){f.clearAutoPlay(),f.autoPlay()}),x(g(f),"stopOnHover",function(){f.setState({isMouseEntered:!0},f.clearAutoPlay)}),x(g(f),"startOnLeave",function(){f.setState({isMouseEntered:!1},f.autoPlay)}),x(g(f),"isFocusWithinTheCarousel",function(){return!!f.carouselWrapperRef&&!((0,o.default)().activeElement!==f.carouselWrapperRef&&!f.carouselWrapperRef.contains((0,o.default)().activeElement))}),x(g(f),"navigateWithKeyboard",function(D){if(f.isFocusWithinTheCarousel()){var O=f.props.axis==="horizontal",T=O?37:38;(O?39:40)===D.keyCode?f.increment():T===D.keyCode&&f.decrement()}}),x(g(f),"updateSizes",function(){if(f.state.initialized&&f.itemsRef&&f.itemsRef.length!==0){var D=f.props.axis==="horizontal",O=f.itemsRef[0];if(O){var T=D?O.clientWidth:O.clientHeight;f.setState({itemSize:T}),f.thumbsRef&&f.thumbsRef.updateSizes()}}}),x(g(f),"setMountState",function(){f.setState({hasMount:!0}),f.updateSizes()}),x(g(f),"handleClickItem",function(D,O){e.Children.count(f.props.children)!==0&&(f.state.cancelClick?f.setState({cancelClick:!1}):(f.props.onClickItem(D,O),D!==f.state.selectedItem&&f.setState({selectedItem:D})))}),x(g(f),"handleOnChange",function(D,O){e.Children.count(f.props.children)<=1||f.props.onChange(D,O)}),x(g(f),"handleClickThumb",function(D,O){f.props.onClickThumb(D,O),f.moveTo(D)}),x(g(f),"onSwipeStart",function(D){f.setState({swiping:!0}),f.props.onSwipeStart(D)}),x(g(f),"onSwipeEnd",function(D){f.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),f.props.onSwipeEnd(D),f.clearAutoPlay(),f.state.autoPlay&&f.autoPlay()}),x(g(f),"onSwipeMove",function(D,O){f.props.onSwipeMove(O);var T=f.props.swipeAnimationHandler(D,f.props,f.state,f.setState.bind(g(f)));return f.setState(b({},T)),!!Object.keys(T).length}),x(g(f),"decrement",function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;f.moveTo(f.state.selectedItem-(typeof D=="number"?D:1))}),x(g(f),"increment",function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;f.moveTo(f.state.selectedItem+(typeof D=="number"?D:1))}),x(g(f),"moveTo",function(D){if(typeof D=="number"){var O=e.Children.count(f.props.children)-1;D<0&&(D=f.props.infiniteLoop?O:0),D>O&&(D=f.props.infiniteLoop?0:O),f.selectItem({selectedItem:D}),f.state.autoPlay&&f.state.isMouseEntered===!1&&f.resetAutoPlay()}}),x(g(f),"onClickNext",function(){f.increment(1)}),x(g(f),"onClickPrev",function(){f.decrement(1)}),x(g(f),"onSwipeForward",function(){f.increment(1),f.props.emulateTouch&&f.setState({cancelClick:!0})}),x(g(f),"onSwipeBackwards",function(){f.decrement(1),f.props.emulateTouch&&f.setState({cancelClick:!0})}),x(g(f),"changeItem",function(D){return function(O){(0,l.isKeyboardEvent)(O)&&O.key!=="Enter"||f.moveTo(D)}}),x(g(f),"selectItem",function(D){f.setState(b({previousItem:f.state.selectedItem},D),function(){f.setState(f.animationHandler(f.props,f.state))}),f.handleOnChange(D.selectedItem,e.Children.toArray(f.props.children)[D.selectedItem])}),x(g(f),"getInitialImage",function(){var D=f.props.selectedItem,O=f.itemsRef&&f.itemsRef[D];return(O&&O.getElementsByTagName("img")||[])[0]}),x(g(f),"getVariableItemHeight",function(D){var O=f.itemsRef&&f.itemsRef[D];if(f.state.hasMount&&O&&O.children.length){var T=O.children[0].getElementsByTagName("img")||[];if(T.length>0){var j=T[0];j.complete||j.addEventListener("load",function Z(){f.forceUpdate(),j.removeEventListener("load",Z)})}var V=(T[0]||O.children[0]).clientHeight;return V>0?V:null}return null});var B={initialized:!1,previousItem:H.selectedItem,selectedItem:H.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:H.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return f.animationHandler=typeof H.animationHandler=="function"&&H.animationHandler||H.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,f.state=b(b({},B),f.animationHandler(H,B)),f}return p(S,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(H,f){H.children||!this.props.children||this.state.initialized||this.setupCarousel(),!H.autoFocus&&this.props.autoFocus&&this.forceFocus(),f.swiping&&!this.state.swiping&&this.setState(b({},this.props.stopSwipingHandler(this.props,this.state))),H.selectedItem===this.props.selectedItem&&H.centerMode===this.props.centerMode||(this.updateSizes(),this.moveTo(this.props.selectedItem)),H.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var H=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var f=H.getInitialImage();f&&!f.complete?f.addEventListener("load",H.setMountState):H.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var H=this.carouselWrapperRef;this.props.stopOnHover&&H&&(H.addEventListener("mouseenter",this.stopOnHover),H.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var H=this.carouselWrapperRef;this.props.stopOnHover&&H&&(H.removeEventListener("mouseenter",this.stopOnHover),H.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,o.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var H=this.getInitialImage();H&&H.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,o.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var H;(H=this.carouselWrapperRef)===null||H===void 0||H.focus()}},{key:"renderItems",value:function(H){var f=this;return this.props.children?e.Children.map(this.props.children,function(B,D){var O=D===f.state.selectedItem,T=D===f.state.previousItem,j=O&&f.state.selectedStyle||T&&f.state.prevStyle||f.state.slideStyle||{};f.props.centerMode&&f.props.axis==="horizontal"&&(j=b(b({},j),{},{minWidth:f.props.centerSlidePercentage+"%"})),f.state.swiping&&f.state.swipeMovementStarted&&(j=b(b({},j),{},{pointerEvents:"none"}));var V={ref:function(Z){return f.setItemsRef(Z,D)},key:"itemKey"+D+(H?"clone":""),className:n.default.ITEM(!0,D===f.state.selectedItem,D===f.state.previousItem),onClick:f.handleClickItem.bind(f,D,B),style:j};return e.default.createElement("li",V,f.props.renderItem(B,{isSelected:D===f.state.selectedItem,isPrevious:D===f.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var H=this,f=this.props,B=f.showIndicators,D=f.labels,O=f.renderIndicator,T=f.children;return B?e.default.createElement("ul",{className:"control-dots"},e.Children.map(T,function(j,V){return O&&O(H.changeItem(V),V===H.state.selectedItem,V,D.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return this.props.showThumbs&&this.props.children&&e.Children.count(this.props.children)!==0?e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children)):null}},{key:"render",value:function(){var H=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var f=this.props.swipeable&&e.Children.count(this.props.children)>1,B=this.props.axis==="horizontal",D=this.props.showArrows&&e.Children.count(this.props.children)>1,O=D&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,T=D&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,j=this.renderItems(!0),V=j.shift(),Z=j.pop(),J={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},ce={};if(B){if(J.onSwipeLeft=this.onSwipeForward,J.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var le=this.getVariableItemHeight(this.state.selectedItem);ce.height=le||"auto"}}else J.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,J.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,J.style=b(b({},J.style),{},{height:this.state.itemSize}),ce.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,O,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:ce},f?e.default.createElement(t.default,C({tagName:"ul",innerRef:this.setListRef},J,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&Z,this.renderItems(),this.props.infiniteLoop&&V):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(q){return H.setListRef(q)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&Z,this.renderItems(),this.props.infiniteLoop&&V)),this.props.renderArrowNext(this.onClickNext,T,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),S}(e.default.Component);return co.default=I,x(I,"displayName","Carousel"),x(I,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:l.noop,onClickThumb:l.noop,onChange:l.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(v,M,S){return e.default.createElement("button",{type:"button","aria-label":S,className:n.default.ARROW_PREV(!M),onClick:v})},renderArrowNext:function(v,M,S){return e.default.createElement("button",{type:"button","aria-label":S,className:n.default.ARROW_NEXT(!M),onClick:v})},renderIndicator:function(v,M,S,H){return e.default.createElement("li",{className:n.default.DOT(M),onClick:v,onKeyDown:v,value:S,key:S,role:"button",tabIndex:0,"aria-label":"".concat(H," ").concat(S+1)})},renderItem:function(v){return v},renderThumbs:function(v){var M=e.Children.map(v,function(S){var H=S;if(S.type!=="img"&&(H=e.Children.toArray(S.props.children).find(function(f){return f.type==="img"})),H)return H});return M.filter(function(S){return S}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):M},statusFormatter:l.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),co}var kc,Mc,r1={},Rc,Ec,Ic,Tc,Hc,Oc,Pc,Dc,$i,zc,o1=(Mc||(Mc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=o(n1()),n=(kc||(kc=1),r1),r=o(wc());function o(i){return i&&i.__esModule?i:{default:i}}}(ic)),ic);function i1(){if(Oc)return Hc;Oc=1;var e=function(){if(Tc)return Ic;Tc=1;var n=/\s/;return Ic=function(r){for(var o=r.length;o--&&n.test(r.charAt(o)););return o}}(),t=/^\s+/;return Hc=function(n){return n&&n.slice(0,e(n)+1).replace(t,"")}}function Xi(){if(Dc)return Pc;Dc=1;var e=i1(),t=Er(),n=Yo(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,l=parseInt;return Pc=function(a){if(typeof a=="number")return a;if(n(a))return NaN;if(t(a)){var s=typeof a.valueOf=="function"?a.valueOf():a;a=t(s)?s+"":s}if(typeof a!="string")return a===0?a:+a;a=e(a);var c=o.test(a);return c||i.test(a)?l(a.slice(2),c?2:8):r.test(a)?NaN:+a}}function Ac(){if(zc)return $i;zc=1;var e=Er(),t=function(){if(Ec)return Rc;Ec=1;var i=Gn();return Rc=function(){return i.Date.now()}}(),n=Xi(),r=Math.max,o=Math.min;return $i=function(i,l,a){var s,c,h,C,y,b,p=0,m=!1,E=!1,g=!0;if(typeof i!="function")throw new TypeError("Expected a function");function w(S){var H=s,f=c;return s=c=void 0,p=S,C=i.apply(f,H)}function x(S){var H=S-b;return b===void 0||H>=l||H<0||E&&S-p>=h}function I(){var S=t();if(x(S))return v(S);y=setTimeout(I,function(H){var f=l-(H-b);return E?o(f,h-(H-p)):f}(S))}function v(S){return y=void 0,g&&s?w(S):(s=c=void 0,C)}function M(){var S=t(),H=x(S);if(s=arguments,c=this,b=S,H){if(y===void 0)return function(f){return p=f,y=setTimeout(I,l),m?w(f):C}(b);if(E)return clearTimeout(y),y=setTimeout(I,l),w(b)}return y===void 0&&(y=setTimeout(I,l)),C}return l=n(l)||0,e(a)&&(m=!!a.leading,h=(E="maxWait"in a)?r(n(a.maxWait)||0,l):h,g="trailing"in a?!!a.trailing:g),M.cancel=function(){y!==void 0&&clearTimeout(y),p=0,s=b=c=y=void 0},M.flush=function(){return y===void 0?C:v(t())},M},$i}const Fc=Sr(Ac());function cn(e,t,n,r,o=!1){const i=d.useRef();i.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,a=s=>{var c;(c=i.current)==null||c.call(l,s)};return l.addEventListener(e,a,{passive:r,capture:o}),()=>{l.removeEventListener(e,a,{capture:o})}},[e,n,r,o])}function dr(e,t){return e===void 0?void 0:t}const a1=Math.PI;function Lc(e){return e*a1/180}const _c=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),jc=(e,t,n,r,o)=>{switch(e){case"left":return Math.floor(t)+r+o/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-o/2}},Nc=(e,t,n)=>Math.min(e,t-2*n),Bc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Gi=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),d.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},l1=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))},s1=new RegExp("^[^A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF]*[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]");function Yi(e){return s1.test(e)?"rtl":"not-rtl"}let ri;function Ki(){if(typeof document>"u")return 0;if(ri!==void 0)return ri;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),ri=n-r,ri}const Tr=Symbol();function c1(e){const t=d.useRef([Tr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,o]=d.useState(),i=d.useCallback(a=>{const s=t.current[0];s!==Tr&&(a=typeof a=="function"?a(s):a)===s||(s!==Tr&&o({}),r(c=>typeof a=="function"?a(s===Tr?c:s):a),t.current[0]=Tr)},[]),l=d.useCallback(()=>{t.current[0]=Tr,o({})},[]);return[t.current[0]===Tr?n:t.current[0],i,l]}function Wc(e){if(e.length===0)return"";let t=0,n=0;for(const r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}const u1=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:o}=e,i=t.filter(a=>a!=="");if(i.length===0)return null;const l=i.length>1;return d.createElement(e1,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(o1.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l},i.map(a=>{const s=(o==null?void 0:o(a))??d.createElement("img",{draggable:!1,src:a});return d.createElement("div",{className:"gdg-centering-container",key:a},s)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(Gi,null)))},d1=Cn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class h1 extends $t.PureComponent{constructor(){super(...arguments);ft(this,"targetElement",null);ft(this,"containerRefHook",n=>{this.targetElement=n,this.renderMarkdownIntoDiv()})}renderMarkdownIntoDiv(){const{targetElement:n,props:r}=this;if(n===null)return;const{contents:o,createNode:i}=r,l=Np(o),a=document.createRange();a.selectNodeContents(n),a.deleteContents();let s=i==null?void 0:i(l);if(s===void 0){const h=document.createElement("template");h.innerHTML=l,s=h.content}n.append(s);const c=n.getElementsByTagName("a");for(const h of c)h.target="_blank",h.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),$t.createElement(d1,{ref:this.containerRefHook})}}const f1=Cn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),g1=Cn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),p1=Cn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let $c=0;const oi=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:o,altNewline:i,validatedSelection:l,...a}=e,{onChange:s,className:c}=a,h=d.useRef(null),C=n??"";Rn(s!==void 0,"GrowingEntry must be a controlled input area");const[y]=d.useState(()=>"input-box-"+($c=($c+1)%1e7));d.useEffect(()=>{const p=h.current;if(p===null||p.disabled)return;const m=C.toString().length;p.focus(),p.setSelectionRange(o?0:m,m)},[]),d.useLayoutEffect(()=>{var p;if(l!==void 0){const m=typeof l=="number"?[l,null]:l;(p=h.current)==null||p.setSelectionRange(m[0],m[1])}},[l]);const b=d.useCallback(p=>{p.key==="Enter"&&p.shiftKey&&i===!0||(r==null||r(p))},[i,r]);return d.createElement(p1,{className:"gdg-growing-entry"},d.createElement(g1,{className:c},C+`
|
3
3
|
`),d.createElement(f1,{...a,className:(c??"")+" gdg-input",id:y,ref:h,onKeyDown:b,value:C,placeholder:t,dir:"auto"}))},Vi={};let hr=null;function Ui(e){const t=e.toLowerCase().trim();if(Vi[t]!==void 0)return Vi[t];hr=hr||function(){const i=document.createElement("div");return i.style.opacity="0",i.style.pointerEvents="none",i.style.position="fixed",document.body.append(i),i}(),hr.style.color="#000",hr.style.color=t;const n=getComputedStyle(hr).color;hr.style.color="#fff",hr.style.color=t;const r=getComputedStyle(hr).color;if(r!==n)return[0,0,0,1];let o=r.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return o.length<4&&o.push(1),o=o.map(i=>Number.isNaN(i)?0:i),Vi[t]=o,o}function Hr(e,t){const[n,r,o]=Ui(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const Xc=new Map;function Gc(e,t){const n=`${e}-${t}`,r=Xc.get(n);if(r!==void 0)return r;const o=In(e,t);return Xc.set(n,o),o}function In(e,t){if(t===void 0)return e;const[n,r,o,i]=Ui(e);if(i===1)return e;const[l,a,s,c]=Ui(t),h=i+c*(1-i);return`rgba(${(i*n+c*l*(1-i))/h}, ${(i*r+c*a*(1-i))/h}, ${(i*o+c*s*(1-i))/h}, ${h})`}var Xr=new Map,Gr=new Map,qi=new Map;function po(e,t,n,r){var o,i;let l=Gr.get(n);if(r&&l!==void 0&&l.count>2e4){let c=qi.get(n);if(c===void 0&&(c=function(C,y){var b;let p=new Map,m=0;for(let x of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let I=C.measureText(x).width;p.set(x,I),m+=I}let E=m/p.size,g=(y/E+3)/4,w=p.keys();for(let x of w)p.set(x,((b=p.get(x))!=null?b:E)*g);return p}(e,l.size),qi.set(n,c)),l.count>5e5){let C=0;for(let y of t)C+=(o=c.get(y))!=null?o:l.size;return 1.01*C}let h=e.measureText(t);return function(C,y,b,p,m){var E,g,w;let x=0,I={};for(let M of C)x+=(E=b.get(M))!=null?E:m,I[M]=((g=I[M])!=null?g:0)+1;let v=y-x;for(let M of Object.keys(I)){let S=I[M],H=(w=b.get(M))!=null?w:m,f=H+v*(H*S/x)*p/S;b.set(M,f)}}(t,h.width,c,Math.max(.05,1-l.count/2e5),l.size),Gr.set(n,{count:l.count+t.length,size:l.size}),h.width}let a=e.measureText(t),s=a.width/t.length;if(((i=l==null?void 0:l.count)!=null?i:0)>2e4)return a.width;if(l===void 0)Gr.set(n,{count:t.length,size:s});else{let c=s-l.size,h=t.length/(l.count+t.length),C=l.size+c*h;Gr.set(n,{count:l.count+t.length,size:C})}return a.width}function m1(e,t,n,r,o,i,l,a){if(t.length<=1)return t.length;if(o<n)return-1;let s=Math.floor(n/o*i),c=po(e,t.slice(0,Math.max(0,s)),r,l);if(c!==n)if(c<n){for(;c<n;)s++,c=po(e,t.slice(0,Math.max(0,s)),r,l);s--}else for(;c>n;){let h=t.lastIndexOf(" ",s-1);h>0?s=h:s--,c=po(e,t.slice(0,Math.max(0,s)),r,l)}if(t[s]!==" "){let h=0;h=t.lastIndexOf(" ",s),h>0&&(s=h)}return s}function mo(e,t){return(e??"")===(t??"")}function Yc(e,t){const[n,r]=e;return n>=t.x&&n<t.x+t.width&&r>=t.y&&r<t.y+t.height}function vo(e,t){return(e==null?void 0:e[0])===(t==null?void 0:t[0])&&(e==null?void 0:e[1])===(t==null?void 0:t[1])}function Kc(e){return[e.x+e.width-1,e.y+e.height-1]}function Vc(e,t,n){const r=n.x,o=n.x+n.width-1,i=n.y,l=n.y+n.height-1,[a,s]=e;if(s<i||s>l)return!1;if(t.span===void 0)return a>=r&&a<=o;const[c,h]=t.span;return c>=r&&c<=o||h>=r&&c<=o||c<r&&h>o}function Uc(e,t){let n=e;if(t!==void 0){let r=[...e];const o=n[t.src];t.src>t.dest?(r.splice(t.src,1),r.splice(t.dest,0,o)):(r.splice(t.dest+1,0,o),r.splice(t.src,1)),r=r.map((i,l)=>({...i,sticky:e[l].sticky})),n=r}return n}function Yr(e,t){let n=0;const r=Uc(e,t);for(let o=0;o<r.length;o++){const i=r[o];if(!i.sticky)break;n+=i.width}return n}function Or(e,t,n){if(typeof n=="number")return t*n;{let r=0;for(let o=e-t;o<e;o++)r+=n(o);return r}}function Ji(e,t,n,r,o){const i=Uc(e,r),l=[];for(const c of i){if(!c.sticky)break;l.push(c)}if(l.length>0)for(const c of l)n-=c.width;let a=t,s=o??0;for(;s<=n&&a<i.length;)s+=i[a].width,a++;for(let c=t;c<a;c++){const h=i[c];h.sticky||l.push(h)}return l}let ii=0,wo={};const v1=typeof window>"u";function qc(e,t,n,r){return`${e}_${r??(t==null?void 0:t.font)}_${n}`}function Kr(e,t,n,r="middle"){const o=qc(e,t,r,n);let i=wo[o];return i===void 0&&(i=t.measureText(e),wo[o]=i,ii++),ii>1e4&&(wo={},ii=0),i}function Jc(e,t){const n=qc(e,void 0,"middle",t);return wo[n]}function fr(e,t){return typeof t!="string"&&(t=t.baseFontFull),function(n,r){for(const a of Zc)if(a.key===r)return a.val;const o=Qc(n,"alphabetic"),i=Qc(n,"middle"),l=-(i.actualBoundingBoxDescent-o.actualBoundingBoxDescent)+o.actualBoundingBoxAscent/2;return Zc.push({key:r,val:l}),l}(e,t)}function Qc(e,t){e.save(),e.textBaseline=t;const n=e.measureText("ABCDEFGHIJKLMNOPQRSTUVWXYZ");return e.restore(),n}(async function(){var e;v1||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,ii=0,wo={},Xr.clear(),qi.clear(),Gr.clear())})();const Zc=[];function yo(e,t,n){const{ctx:r,theme:o}=e,i=t??{},l=n??o.textDark;return l!==i.fillStyle&&(r.fillStyle=l,i.fillStyle=l),i}function eu(e,t,n,r,o,i,l,a,s){s==="right"?e.fillText(t,n+o-(a.cellHorizontalPadding+.5),r+i/2+l):s==="center"?e.fillText(t,n+o/2,r+i/2+l):e.fillText(t,n+a.cellHorizontalPadding+.5,r+i/2+l)}function tu(e,t){const n=Kr("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function w1(e,t,n,r,o,i,l,a,s,c){const h=a.baseFontFull,C=function(w,x,I,v,M){let S=`${x}_${I}_${v}px`,H=Xr.get(S);if(H!==void 0)return H;if(v<=0)return[];let f=[],B=x.split(`
|
4
4
|
`),D=Gr.get(I),O=D===void 0?x.length:v/D.size*1.5,T=M&&D!==void 0&&D.count>2e4;for(let j of B){let V=po(w,j.slice(0,Math.max(0,O)),I,T),Z=Math.min(j.length,O);if(V<=v)f.push(j);else{for(;V>v;){let J=m1(w,j,v,I,V,Z,T),ce=j.slice(0,Math.max(0,J));j=j.slice(ce.length),f.push(ce),V=po(w,j.slice(0,Math.max(0,O)),I,T),Z=Math.min(j.length,O)}V>0&&f.push(j)}}return f=f.map((j,V)=>V===0?j.trimEnd():j.trim()),Xr.set(S,f),Xr.size>500&&Xr.delete(Xr.keys().next().value),f}(e,t,h,o-2*a.cellHorizontalPadding,c??!1),y=tu(e,h),b=a.lineHeight*y,p=y+b*(C.length-1),m=p+a.cellVerticalPadding>i;m&&(e.save(),e.rect(n,r,o,i),e.clip());const E=r+i/2-p/2;let g=Math.max(r+a.cellVerticalPadding,E);for(const w of C)if(eu(e,w,n,g,o,y,l,a,s),g+=b,g>r+i)break;m&&e.restore()}function Qn(e,t,n,r,o){const{ctx:i,rect:l,theme:a}=e,{x:s,y:c,width:h,height:C}=l;(r=r??!1)||(t=function(p,m){p.includes(`
|
5
5
|
`)&&(p=p.split(/\r?\n/,1)[0]);const E=m/4;return p.length>E&&(p=p.slice(0,E)),p}(t,h));const y=fr(i,a),b=Yi(t)==="rtl";if(n===void 0&&b&&(n="right"),b&&(i.direction="rtl"),t.length>0){let p=!1;n==="right"?(i.textAlign="right",p=!0):n!==void 0&&n!=="left"&&(i.textAlign=n,p=!0),r?w1(i,t,s,c,h,C,y,a,n,o):eu(i,t,s,c,h,C,y,a,n),p&&(i.textAlign="start"),b&&(i.direction="inherit")}}function Yn(e,t,n,r,o,i){typeof i=="number"&&(i={tl:i,tr:i,br:i,bl:i}),i={tl:Math.max(0,Math.min(i.tl,o/2,r/2)),tr:Math.max(0,Math.min(i.tr,o/2,r/2)),bl:Math.max(0,Math.min(i.bl,o/2,r/2)),br:Math.max(0,Math.min(i.br,o/2,r/2))},e.moveTo(t+i.tl,n),e.arcTo(t+r,n,t+r,n+i.tr,i.tr),e.arcTo(t+r,n+o,t+r-i.br,n+o,i.br),e.arcTo(t,n+o,t,n+o-i.bl,i.bl),e.arcTo(t,n,t+i.tl,n,i.tl)}function Qi(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p){const m={x:0,y:i+c,width:0,height:0};if(e>=b.length||t>=h||t<-2||e<0)return m;const E=i-o;if(e>=C){const g=l>e?-1:1,w=Yr(b);m.x+=w+s;for(let x=l;x!==e;x+=g)m.x+=b[g===1?x:x-1].width*g}else for(let g=0;g<e;g++)m.x+=b[g].width;if(m.width=b[e].width+1,t===-1)m.y=o,m.height=E;else if(t===-2){m.y=0,m.height=o;let g=e;const w=b[e].group,x=b[e].sticky;for(;g>0&&mo(b[g-1].group,w)&&b[g-1].sticky===x;){const v=b[g-1];m.x-=v.width,m.width+=v.width,g--}let I=e;for(;I+1<b.length&&mo(b[I+1].group,w)&&b[I+1].sticky===x;){const v=b[I+1];m.width+=v.width,I++}if(!x){const v=Yr(b),M=m.x-v;M<0&&(m.x-=M,m.width+=M),m.x+m.width>n&&(m.width=n-m.x)}}else if(t>=h-y){let g=h-t;for(m.y=r;g>0;){const w=t+g-1;m.height=typeof p=="number"?p:p(w),m.y-=m.height,g--}m.height+=1}else{const g=a>t?-1:1;if(typeof p=="number"){const w=t-a;m.y+=w*p}else for(let w=a;w!==t;w+=g)m.y+=p(w)*g;m.height=(typeof p=="number"?p:p(t))+1}return m}const Zi=1<<21;function Ln(e,t){return(t+2)*Zi+e}function nu(e){return e%Zi}function ea(e){return Math.floor(e/Zi)-2}function ta(e){return[nu(e),ea(e)]}class ru{constructor(){ft(this,"visibleWindow",{x:0,y:0,width:0,height:0});ft(this,"freezeCols",0);ft(this,"freezeRows",[]);ft(this,"isInWindow",t=>{const n=nu(t),r=ea(t),o=this.visibleWindow,i=n>=o.x&&n<=o.x+o.width||n<this.freezeCols,l=r>=o.y&&r<=o.y+o.height||this.freezeRows.includes(r);return i&&l})}setWindow(t,n,r){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&$r(this.freezeRows,r)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=r,this.clearOutOfWindow())}}class y1 extends ru{constructor(){super(...arguments);ft(this,"cache",new Map);ft(this,"setValue",(n,r)=>{this.cache.set(Ln(n[0],n[1]),r)});ft(this,"getValue",n=>this.cache.get(Ln(n[0],n[1])));ft(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class bo{constructor(t=[]){ft(this,"cells");this.cells=new Set(t.map(n=>Ln(n[0],n[1])))}add(t){this.cells.add(Ln(t[0],t[1]))}has(t){return t!==void 0&&this.cells.has(Ln(t[0],t[1]))}remove(t){this.cells.delete(Ln(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(ea(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n<t.y+t.height;n++)for(let r=t.x;r<t.x+t.width;r++)if(this.cells.has(Ln(r,n)))return!0;return!1}hasItemInRegion(t){for(const n of t)if(this.hasItemInRectangle(n))return!0;return!1}*values(){for(const t of this.cells)yield ta(t)}}Xa=function(e){return{"--gdg-accent-color":e.accentColor,"--gdg-accent-fg":e.accentFg,"--gdg-accent-light":e.accentLight,"--gdg-text-dark":e.textDark,"--gdg-text-medium":e.textMedium,"--gdg-text-light":e.textLight,"--gdg-text-bubble":e.textBubble,"--gdg-bg-icon-header":e.bgIconHeader,"--gdg-fg-icon-header":e.fgIconHeader,"--gdg-text-header":e.textHeader,"--gdg-text-group-header":e.textGroupHeader??e.textHeader,"--gdg-bg-group-header":e.bgGroupHeader??e.bgHeader,"--gdg-bg-group-header-hovered":e.bgGroupHeaderHovered??e.bgHeaderHovered,"--gdg-text-header-selected":e.textHeaderSelected,"--gdg-bg-cell":e.bgCell,"--gdg-bg-cell-medium":e.bgCellMedium,"--gdg-bg-header":e.bgHeader,"--gdg-bg-header-has-focus":e.bgHeaderHasFocus,"--gdg-bg-header-hovered":e.bgHeaderHovered,"--gdg-bg-bubble":e.bgBubble,"--gdg-bg-bubble-selected":e.bgBubbleSelected,"--gdg-bubble-height":`${e.bubbleHeight}px`,"--gdg-bubble-padding":`${e.bubblePadding}px`,"--gdg-bubble-margin":`${e.bubbleMargin}px`,"--gdg-bg-search-result":e.bgSearchResult,"--gdg-border-color":e.borderColor,"--gdg-horizontal-border-color":e.horizontalBorderColor??e.borderColor,"--gdg-drilldown-border":e.drilldownBorder,"--gdg-link-color":e.linkColor,"--gdg-cell-horizontal-padding":`${e.cellHorizontalPadding}px`,"--gdg-cell-vertical-padding":`${e.cellVerticalPadding}px`,"--gdg-header-font-style":e.headerFontStyle,"--gdg-base-font-style":e.baseFontStyle,"--gdg-marker-font-style":e.markerFontStyle,"--gdg-font-family":e.fontFamily,"--gdg-editor-font-size":e.editorFontSize,"--gdg-checkbox-max-size":`${e.checkboxMaxSize}px`,...e.resizeIndicatorColor===void 0?{}:{"--gdg-resize-indicator-color":e.resizeIndicatorColor},...e.headerBottomBorderColor===void 0?{}:{"--gdg-header-bottom-border-color":e.headerBottomBorderColor},...e.roundingRadius===void 0?{}:{"--gdg-rounding-radius":`${e.roundingRadius}px`}}};const ou={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",bubbleHeight:20,bubblePadding:6,bubbleMargin:4,bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#353fb5",cellHorizontalPadding:8,cellVerticalPadding:3,headerIconSize:18,headerFontStyle:"600 13px",baseFontStyle:"13px",markerFontStyle:"9px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",editorFontSize:"13px",lineHeight:1.4,checkboxMaxSize:18};function iu(){return ou}Wa=$t.createContext(ou);function Zn(e,...t){const n={...e};for(const r of t)if(r!==void 0)for(const o in r)r.hasOwnProperty(o)&&(n[o]=o==="bgCell"?In(r[o],n[o]):r[o]);return n.headerFontFull!==void 0&&e.fontFamily===n.fontFamily&&e.headerFontStyle===n.headerFontStyle||(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),n.baseFontFull!==void 0&&e.fontFamily===n.fontFamily&&e.baseFontStyle===n.baseFontStyle||(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),n.markerFontFull!==void 0&&e.fontFamily===n.fontFamily&&e.markerFontStyle===n.markerFontStyle||(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}function au(e,t,n,r,o,i,l,a,s){let c=0;const h=o===void 0?[]:o.map(b=>{const p=function(m,E,g,w){var I;const x=w(E);return((I=x==null?void 0:x.measure)==null?void 0:I.call(x,m,E,g))??150}(e,b[r],t,s);return c=Math.max(c,p),p});if(h.length>5&&a){c=0;let b=0;for(const m of h)b+=m;const p=b/h.length;for(let m=0;m<h.length;m++)h[m]>=2*p?h[m]=0:c=Math.max(c,h[m])}const C=e.font;e.font=t.headerFontFull,c=Math.max(c,e.measureText(n.title).width+2*t.cellHorizontalPadding+(n.icon===void 0?0:28)),e.font=C;const y=Math.max(Math.ceil(i),Math.min(Math.floor(l),Math.ceil(c)));return{...n,width:y}}var lu,su,cu,uu;const On=Sr(function(){if(uu)return cu;uu=1;var e=su?lu:(su=1,lu=function(n,r,o){return n==n&&(o!==void 0&&(n=n<=o?n:o),r!==void 0&&(n=n>=r?n:r)),n}),t=Xi();return cu=function(n,r,o){return o===void 0&&(o=r,r=void 0),o!==void 0&&(o=(o=t(o))==o?o:0),r!==void 0&&(r=(r=t(r))==r?r:0),e(t(n),r,o)}}());var du,hu,fu,gu,pu,mu,vu,wu,yu,bu,xu,Cu,Su,ku,Mu,Ru,Eu,Iu,na,Tu,Hu,Ou,Pu,Du,zu,Au,Fu,Lu,_u,ju,Nu,Bu;function Wu(){if(mu)return pu;mu=1;var e=Fi(),t=hu?du:(hu=1,du=function(o){return this.__data__.set(o,"__lodash_hash_undefined__"),this}),n=gu?fu:(gu=1,fu=function(o){return this.__data__.has(o)});function r(o){var i=-1,l=o==null?0:o.length;for(this.__data__=new e;++i<l;)this.add(o[i])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,pu=r}function b1(){if(ku)return Su;ku=1;var e=wu?vu:(wu=1,vu=function(r,o,i,l){for(var a=r.length,s=i+(l?1:-1);l?s--:++s<a;)if(o(r[s],s,r))return s;return-1}),t=bu?yu:(bu=1,yu=function(r){return r!=r}),n=Cu?xu:(Cu=1,xu=function(r,o,i){for(var l=i-1,a=r.length;++l<a;)if(r[l]===o)return l;return-1});return Su=function(r,o,i){return o==o?n(r,o,i):e(r,t,i)}}function $u(){return Tu||(Tu=1,na=function(e,t){return e.has(t)}),na}function Xu(){if(Ou)return Hu;Ou=1;var e=Ir()(Gn(),"Set");return Hu=e}function ra(){return Au?zu:(Au=1,zu=function(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n})}function x1(){if(Lu)return Fu;Lu=1;var e=Xu(),t=Du?Pu:(Du=1,Pu=function(){}),n=ra(),r=e&&1/n(new e([,-0]))[1]==1/0?function(o){return new e(o)}:t;return Fu=r}function C1(){if(ju)return _u;ju=1;var e=Wu(),t=function(){if(Ru)return Mu;Ru=1;var l=b1();return Mu=function(a,s){return!(a==null||!a.length)&&l(a,s,0)>-1}}(),n=Iu?Eu:(Iu=1,Eu=function(l,a,s){for(var c=-1,h=l==null?0:l.length;++c<h;)if(s(a,l[c]))return!0;return!1}),r=$u(),o=x1(),i=ra();return _u=function(l,a,s){var c=-1,h=t,C=l.length,y=!0,b=[],p=b;if(s)y=!1,h=n;else if(C>=200){var m=a?null:o(l);if(m)return i(m);y=!1,h=r,p=new e}else p=a?[]:b;e:for(;++c<C;){var E=l[c],g=a?a(E):E;if(E=s||E!==0?E:0,y&&g==g){for(var w=p.length;w--;)if(p[w]===g)continue e;a&&p.push(g),b.push(E)}else h(p,g,s)||(p!==b&&p.push(g),b.push(E))}return b}}const S1=Sr(function(){if(Bu)return Nu;Bu=1;var e=C1();return Nu=function(t){return t&&t.length?e(t):[]}}());var Gu,Yu,Ku,Vu,oa,Uu,qu,Ju;function Qu(){return Yu?Gu:(Yu=1,Gu=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e})}function k1(){if(Uu)return oa;Uu=1;var e=Qu(),t=function(){if(Vu)return Ku;Vu=1;var n=oo(),r=Li(),o=Xn(),i=n?n.isConcatSpreadable:void 0;return Ku=function(l){return o(l)||r(l)||!!(i&&l&&l[i])}}();return oa=function n(r,o,i,l,a){var s=-1,c=r.length;for(i||(i=t),a||(a=[]);++s<c;){var h=r[s];o>0&&i(h)?o>1?n(h,o-1,i,l,a):e(a,h):l||(a[a.length]=h)}return a},oa}const Zu=Sr(function(){if(Ju)return qu;Ju=1;var e=k1();return qu=function(t){return t!=null&&t.length?e(t,1):[]}}());var ed,td,nd,rd,od,id,ad,ld,sd,cd,ud,dd;function ia(){if(rd)return nd;rd=1;var e=Ks(),t=ji();return nd=function(n){return n!=null&&t(n.length)&&!e(n)}}function M1(){if(cd)return sd;cd=1;var e=function(){if(td)return ed;td=1;var r=Math.ceil,o=Math.max;return ed=function(i,l,a,s){for(var c=-1,h=o(r((l-i)/(a||1)),0),C=Array(h);h--;)C[s?h:++c]=i,i+=a;return C}}(),t=function(){if(id)return od;id=1;var r=zi(),o=ia(),i=_i(),l=Er();return od=function(a,s,c){if(!l(c))return!1;var h=typeof s;return!!(h=="number"?o(c)&&i(s,c.length):h=="string"&&s in c)&&r(c[s],a)}}(),n=function(){if(ld)return ad;ld=1;var r=Xi(),o=1/0;return ad=function(i){return i?(i=r(i))===o||i===-1/0?17976931348623157e292*(i<0?-1:1):i==i?i:0:i===0?i:0}}();return sd=function(r){return function(o,i,l){return l&&typeof l!="number"&&t(o,i,l)&&(i=l=void 0),o=n(o),i===void 0?(i=o,o=0):i=n(i),l=l===void 0?o<i?1:-1:n(l),e(o,i,l,r)}}}var R1=function(){if(dd)return ud;dd=1;var e=M1()();return ud=e}();const Pr=Sr(R1),Pt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',hd=e=>{const t=e.fgColor,n=e.bgColor;return`${Pt}
|
@@ -124,9 +124,9 @@ var Lp=Object.defineProperty;var _p=(ur,$n,Rr)=>$n in ur?Lp(ur,$n,{enumerable:!0
|
|
124
124
|
`?(r.push(e.slice(o,l)),o=l+1,a===`
|
125
125
|
`&&(n.push(r),r=[])):a==='"'&&(i=t.inString);break;case t.inString:a==='"'&&(i=t.inStringPostQuote);break;case t.inStringPostQuote:a==='"'?i=t.inString:((a===" "||a===`
|
126
126
|
`)&&(r.push(t0(e.slice(o,l))),o=l+1,a===`
|
127
|
-
`&&(n.push(r),r=[])),i=t.None)}l++}return o<e.length&&r.push(t0(e.slice(o,e.length))),n.push(r),n.map(a=>a.map(s=>({rawValue:s,formatted:s,format:"string"})))}function n0(e,t,n){var l;const r=vg(e,t),o=a=>{var s;(s=window.navigator.clipboard)==null||s.writeText(a)},i=(a,s)=>{var c,h;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(c=n==null?void 0:n.clipboardData)==null||c.setData("text/plain",a),(h=n==null?void 0:n.clipboardData)==null||h.setData("text/html",s)}catch{((C,y)=>{var b;return((b=window.navigator.clipboard)==null?void 0:b.write)!==void 0&&(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([C],{type:"text/plain"}),"text/html":new Blob([y],{type:"text/html"})})]),!0)})(a,s)||o(a)}};((l=window.navigator.clipboard)==null?void 0:l.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?i(r.textPlain,r.textHtml):o(r.textPlain),n==null||n.preventDefault()}function r0(e){return e!==!0}function o0(e){return typeof e=="string"?e:`${e}px`}const yg=Cn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[e=>e.innerWidth],"wmyidgi-1":[e=>e.innerHeight]}}),bg=e=>{const{inWidth:t,inHeight:n,children:r,...o}=e;return d.createElement(yg,{innerHeight:o0(n),innerWidth:o0(t),...o},r)},mr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ct(e,t){return e===!0?t:e===!1?"":e}function i0(e){const t=ci.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function xg(e){const t=function(n){const r=d.useRef(n);return $r(n,r.current)||(r.current=n),r.current}(e);return $t.useMemo(()=>{if(t===void 0)return i0(mr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??mr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??mr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??mr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??mr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??mr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??mr.selectToLastCell};return i0({...mr,...n})},[t])}function Cg(e){function t(n,r,o){if(typeof n=="number")return{headerIndex:n,isCollapsed:!1,depth:r,path:o};const i={headerIndex:n.headerIndex,isCollapsed:n.isCollapsed,depth:r,path:o};return n.subGroups!==void 0&&(i.subGroups=n.subGroups.map((l,a)=>t(l,r+1,[...o,a])).sort((l,a)=>l.headerIndex-a.headerIndex)),i}return e.map((n,r)=>t(n,0,[r])).sort((n,r)=>n.headerIndex-r.headerIndex)}function ma(e,t){const n=[];function r(a,s,c=!1){let h=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(h=a.subGroups[0].headerIndex-a.headerIndex),h--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:c,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:h}),a.subGroups)for(let C=0;C<a.subGroups.length;C++){const y=C<a.subGroups.length-1?a.subGroups[C+1].headerIndex:s;r(a.subGroups[C],y,c||a.isCollapsed)}}const o=Cg(e.groups);for(let a=0;a<o.length;a++){const s=a<o.length-1?o[a+1].headerIndex:null;r(o[a],s)}let i=0,l=0;for(const a of n)a.contentIndex=l,l+=a.rows,a.rowIndex=i,i+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...c}=a;return c})}function va(e,t){if(t===void 0||ma.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function a0(e,t,n){const[r,...o]=t;return o[0]===-1?e.map((i,l)=>l===r?{...i,...n}:i):e.map((i,l)=>l===r?{...i,subGroups:a0(i.subGroups??[],o,n)}:i)}function l0(e,t){const[n,...r]=t;return r[0]===-1?e[n]:l0(e[n].subGroups??[],r)}function Sg(e,t,n,r,o){const[i,l]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-t%n:0],[t,n]),a=d.useMemo(()=>({x:r.current.x,y:i,width:r.current.width??1,height:r.current.height??1,ty:l}),[r,l,i]),[s,c,h]=c1(a),C=d.useRef(o);C.current=o;const y=function(m,E){const[g]=d.useState(()=>({value:m,callback:E,facade:{get current(){return g.value},set current(w){const x=g.value;x!==w&&(g.value=w,g.callback(w,x))}}}));return g.callback=E,g.facade}(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),b=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&y.current!==null&&b){if(y.current.scrollTop===t)return;y.current.scrollTop=t,y.current.scrollTop!==t&&h(),C.current()}},[t,b,h,y]);const p=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&y.current!==null&&p){if(y.current.scrollLeft===e)return;y.current.scrollLeft=e,y.current.scrollLeft!==e&&h(),C.current()}},[e,p,h,y]),{visibleRegion:s,setVisibleRegion:c,scrollRef:y}}const kg=d.lazy(async()=>await L0(()=>import("./data-grid-overlay-editor-Bt-ru6j6.js"),__vite__mapDeps([0,1,2,3]),import.meta.url));let Mg=0;function di(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const hi={kind:me.Loading,allowOverlay:!1},fi={columns:yt.empty(),rows:yt.empty(),current:void 0},Rg=d.forwardRef((e,t)=>{var z0,A0,F0;const[n,r]=d.useState(fi),[o,i]=d.useState(),l=d.useRef(null),a=d.useRef(null),[s,c]=d.useState(),h=d.useRef(),C=typeof window>"u"?null:window,{imageEditorOverride:y,getRowThemeOverride:b,markdownDivCreateNode:p,width:m,height:E,columns:g,rows:w,getCellContent:x,onCellClicked:I,onCellActivated:v,onFillPattern:M,onFinishedEditing:S,coercePasteValue:H,drawHeader:f,drawCell:B,editorBloom:D,onHeaderClicked:O,onColumnProposeMove:T,rangeSelectionColumnSpanning:j=!0,spanRangeBehavior:V="default",onGroupHeaderClicked:Z,onCellContextMenu:J,className:ce,onHeaderContextMenu:le,getCellsForSelection:q,onGroupHeaderContextMenu:Q,onGroupHeaderRenamed:fe,onCellEdited:ee,onCellsEdited:se,onSearchResultsChanged:ie,searchResults:W,onSearchValueChange:N,searchValue:U,onKeyDown:ue,onKeyUp:pe,keybindings:ze,editOnType:Ue=!0,onRowAppended:He,onColumnMoved:$e,validateCell:be,highlightRegions:ye,rangeSelect:Fe="rect",columnSelect:Oe="multi",rowSelect:te="multi",rangeSelectionBlending:Ee="exclusive",columnSelectionBlending:ke="exclusive",rowSelectionBlending:Xe="exclusive",onDelete:Re,onDragStart:qe,onMouseMove:Ye,onPaste:ot,copyHeaders:Me=!1,freezeColumns:Pe=0,cellActivationBehavior:ut="second-click",rowSelectionMode:tt="auto",onHeaderMenuClick:pt,onHeaderIndicatorClick:Ft,getGroupDetails:bt,rowGrouping:Ze,onSearchClose:Yt,onItemHovered:nn,onSelectionCleared:Kt,showSearch:qt,onVisibleRegionChanged:un,gridSelection:jt,onGridSelectionChange:Kn,minColumnWidth:vr=50,maxColumnWidth:Dt=500,maxColumnAutoWidth:tr,provideEditor:_n,trailingRowOptions:ne,freezeTrailingRows:xe=0,allowedFillDirections:wt="orthogonal",scrollOffsetX:dt,scrollOffsetY:xt,verticalBorder:ve,onDragOverCell:Ve,onDrop:Ke,onColumnResize:mt,onColumnResizeEnd:it,onColumnResizeStart:at,customRenderers:vt,fillHandle:Je,experimental:lt,fixedShadowX:rt,fixedShadowY:De,headerIcons:Nt,imageWindowLoader:gn,initialSize:Zt,isDraggable:rn,onDragLeave:Bt,onRowMoved:Xt,overscrollX:Sn,overscrollY:Rt,preventDiagonalScrolling:kn,rightElement:pn,rightElementProps:kt,trapFocus:It=!1,smoothScrollX:Vt,smoothScrollY:Et,scaleToRem:Tt=!1,rowHeight:Qe=34,headerHeight:Jt=36,groupHeaderHeight:Mn=Jt,theme:mn,isOutsideClick:wr,renderers:Ro,resizeIndicator:Ca,scrollToActiveCell:Eo=!0,drawFocusRing:Io=!0}=e,zr=Io==="no-editor"?o===void 0:Io,Ot=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,vn=(Ot==null?void 0:Ot.kind)??e.rowMarkers??"none",gi=(Ot==null?void 0:Ot.width)??e.rowMarkerWidth,To=(Ot==null?void 0:Ot.startIndex)??e.rowMarkerStartIndex??1,nr=(Ot==null?void 0:Ot.theme)??e.rowMarkerTheme,rr=Ot==null?void 0:Ot.headerTheme,qr=Ot==null?void 0:Ot.headerAlwaysVisible,or=te!=="multi"||(Ot==null?void 0:Ot.headerDisabled)===!0,yr=(Ot==null?void 0:Ot.checkboxStyle)??"square",ir=Math.max(vr,20),Ar=Math.max(Dt,ir),pi=Math.max(tr??Ar,ir),Ho=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ge,rowNumberMapper:Oo,rowHeight:mi,getRowThemeOverride:jn}=function(u,R,k,P){const A=$t.useMemo(()=>u===void 0?void 0:ma(u,R),[u,R]),G=$t.useMemo(()=>A==null?void 0:A.reduce((F,oe)=>(F[oe.rowIndex]=oe,F),{}),[A]),$=$t.useMemo(()=>A===void 0?R:A.reduce((F,oe)=>F+(oe.isCollapsed?1:oe.rows+1),0),[A,R]),_=$t.useMemo(()=>u===void 0||typeof k=="number"&&u.height===k?k:F=>G!=null&&G[F]?u.height:typeof k=="number"?k:k(F),[G,u,k]),X=$t.useCallback(F=>{if(A===void 0)return F;let oe=F;for(const re of A){if(oe===0)return;if(oe--,!re.isCollapsed){if(oe<re.rows)return re.contentIndex+oe;oe-=re.rows}}return F},[A]),Y=dr(P??(u==null?void 0:u.themeOverride),$t.useCallback(F=>{if(u===void 0)return P==null?void 0:P(F,F,F);if(P===void 0&&(u==null?void 0:u.themeOverride)===void 0)return;const{isGroupHeader:oe,contentIndex:re,groupIndex:ge}=va(F,A);return oe?u.themeOverride:P==null?void 0:P(F,ge,re)},[A,P,u]));return u===void 0?{rowHeight:_,rows:R,rowNumberMapper:X,getRowThemeOverride:Y}:{rowHeight:_,rows:$,rowNumberMapper:X,getRowThemeOverride:Y}}(Ze,w,Qe,b),Sa=d.useMemo(()=>Number.parseFloat(Ho.fontSize),[Ho]),{rowHeight:Vn,headerHeight:Fr,groupHeaderHeight:Po,theme:Lr,overscrollX:Do,overscrollY:zo}=function({rowHeight:u,headerHeight:R,groupHeaderHeight:k,theme:P,overscrollX:A,overscrollY:G,scaleToRem:$,remSize:_}){const[X,Y,F,oe,re,ge]=$t.useMemo(()=>{if(!$||_===16)return[u,R,k,P,A,G];const we=_/16,je=u,Se=iu();return[typeof je=="number"?je*we:Te=>Math.ceil(je(Te)*we),Math.ceil(R*we),Math.ceil(k*we),{...P,headerIconSize:((P==null?void 0:P.headerIconSize)??Se.headerIconSize)*we,cellHorizontalPadding:((P==null?void 0:P.cellHorizontalPadding)??Se.cellHorizontalPadding)*we,cellVerticalPadding:((P==null?void 0:P.cellVerticalPadding)??Se.cellVerticalPadding)*we},Math.ceil((A??0)*we),Math.ceil((G??0)*we)]},[k,R,A,G,_,u,$,P]);return{rowHeight:X,headerHeight:Y,groupHeaderHeight:F,theme:oe,overscrollX:re,overscrollY:ge}}({groupHeaderHeight:Mn,headerHeight:Jt,overscrollX:Sn,overscrollY:Rt,remSize:Sa,rowHeight:mi,scaleToRem:Tt,theme:mn}),Un=xg(ze),Nn=gi??(w>1e4?48:w>1e3?44:w>100?36:32),wn=vn!=="none",K=wn?1:0,Wt=He!==void 0,L=(ne==null?void 0:ne.sticky)===!0,[ae,de]=d.useState(!1),Ce=qt??ae,he=d.useCallback(()=>{Yt!==void 0?Yt():de(!1)},[Yt]),z=d.useMemo(()=>jt===void 0?void 0:di(jt,K),[jt,K])??n,Ie=d.useRef();Ie.current===void 0&&(Ie.current=new AbortController),d.useEffect(()=>()=>Ie==null?void 0:Ie.current.abort(),[]);const[Le,Be]=function(u,R,k,P,A){const G=d.useCallback(X=>{if(u===!0){const Y=[];for(let F=X.y;F<X.y+X.height;F++){const oe=[];for(let re=X.x;re<X.x+X.width;re++)re<0||F>=A?oe.push({kind:me.Loading,allowOverlay:!1}):oe.push(R([re,F]));Y.push(oe)}return Y}return(u==null?void 0:u(X,P.signal))??[]},[P.signal,R,u,A]),$=u!==void 0?G:void 0,_=d.useCallback(X=>{if($===void 0)return[];const Y={...X,x:X.x-k};if(Y.x<0){Y.x=0,Y.width--;const F=$(Y,P.signal);return typeof F=="function"?async()=>(await F()).map(oe=>[{kind:me.Loading,allowOverlay:!1},...oe]):F.map(oe=>[{kind:me.Loading,allowOverlay:!1},...oe])}return $(Y,P.signal)},[P.signal,$,k]);return[u!==void 0?_:void 0,$]}(q,x,K,Ie.current,Ge),Mt=d.useCallback((u,R,k)=>{if(be===void 0)return!0;const P=[u[0]-K,u[1]];return be==null?void 0:be(P,R,k)},[K,be]),Ae=d.useRef(jt),_e=d.useCallback((u,R)=>{R&&(u=function(k,P,A,G,$){var Y;const _=k;if(G==="allowPartial"||k.current===void 0||P===void 0)return k;let X=!1;do{if((k==null?void 0:k.current)===void 0)break;const F=(Y=k.current)==null?void 0:Y.range,oe=[];if(F.width>2){const we=P({x:F.x,y:F.y,width:1,height:F.height},$.signal);if(typeof we=="function")return _;oe.push(...we);const je=P({x:F.x+F.width-1,y:F.y,width:1,height:F.height},$.signal);if(typeof je=="function")return _;oe.push(...je)}else{const we=P({x:F.x,y:F.y,width:F.width,height:F.height},$.signal);if(typeof we=="function")return _;oe.push(...we)}let re=F.x-A,ge=F.x+F.width-1-A;for(const we of oe)for(const je of we)je.span!==void 0&&(re=Math.min(je.span[0],re),ge=Math.max(je.span[1],ge));re===F.x-A&&ge===F.x+F.width-1-A?X=!0:k={current:{cell:k.current.cell??[0,0],range:{x:re+A,y:F.y,width:ge-re+1,height:F.height},rangeStack:k.current.rangeStack},columns:k.columns,rows:k.rows}}while(!X);return k}(u,Le,K,V,Ie.current)),Kn!==void 0?(Ae.current=di(u,-K),Kn(Ae.current)):r(u)},[Kn,Le,K,V]),et=dr(mt,d.useCallback((u,R,k,P)=>{mt==null||mt(g[k-K],R,k-K,P)},[mt,K,g])),dn=dr(it,d.useCallback((u,R,k,P)=>{it==null||it(g[k-K],R,k-K,P)},[it,K,g])),en=dr(at,d.useCallback((u,R,k,P)=>{at==null||at(g[k-K],R,k-K,P)},[at,K,g])),br=dr(f,d.useCallback((u,R)=>(f==null?void 0:f({...u,columnIndex:u.columnIndex-K},R))??!1,[f,K])),ar=dr(B,d.useCallback((u,R)=>(B==null?void 0:B({...u,col:u.col-K},R))??!1,[B,K])),on=d.useCallback(u=>{if(Re!==void 0){const R=Re(di(u,-K));return typeof R=="boolean"?R:di(R,K)}return!0},[Re,K]),[Lt,Ne,ht]=function(u,R,k,P,A,G,$){return[$t.useCallback((_,X,Y,F)=>{var je;G!=="cell"&&G!=="multi-cell"||_===void 0||(_={..._,range:{x:_.cell[0],y:_.cell[1],width:1,height:1}}),!$&&_!==void 0&&_.range.width>1&&(_={..._,range:{..._.range,width:1,x:_.cell[0]}});const oe=k==="mixed"&&(Y||F==="drag"),re=P==="mixed"&&oe,ge=A==="mixed"&&oe;let we={current:_===void 0?void 0:{..._,rangeStack:F==="drag"?((je=u.current)==null?void 0:je.rangeStack)??[]:[]},columns:re?u.columns:yt.empty(),rows:ge?u.rows:yt.empty()};Y&&(G==="multi-rect"||G==="multi-cell")&&we.current!==void 0&&u.current!==void 0&&(we={...we,current:{...we.current,rangeStack:[...u.current.rangeStack,u.current.range]}}),R(we,X)},[P,u,k,G,$,A,R]),$t.useCallback((_,X,Y)=>{let F;if(_=_??u.rows,X!==void 0&&(_=_.add(X)),A==="exclusive"&&_.length>0)F={current:void 0,columns:yt.empty(),rows:_};else{const oe=Y&&P==="mixed";F={current:Y&&k==="mixed"?u.current:void 0,columns:oe?u.columns:yt.empty(),rows:_}}R(F,!1)},[P,u,k,A,R]),$t.useCallback((_,X,Y)=>{let F;if(_=_??u.columns,X!==void 0&&(_=_.add(X)),P==="exclusive"&&_.length>0)F={current:void 0,rows:yt.empty(),columns:_};else{const oe=Y&&A==="mixed";F={current:Y&&k==="mixed"?u.current:void 0,rows:oe?u.rows:yt.empty(),columns:_}}R(F,!1)},[P,u,k,A,R])]}(z,_e,Ee,ke,Xe,Fe,j),gt=d.useMemo(()=>Zn(iu(),Lr),[Lr]),[yn,an]=d.useState([0,0,0]),lr=d.useMemo(()=>{if(Ro===void 0)return{};const u={};for(const R of Ro)u[R.kind]=R;return u},[Ro]),Ht=d.useCallback(u=>u.kind!==me.Custom?lr[u.kind]:vt==null?void 0:vt.find(R=>R.isMatch(u)),[vt,lr]);let{sizedColumns:hn,nonGrowWidth:vi}=function(u,R,k,P,A,G,$,_,X){const Y=d.useRef(R),F=d.useRef(k),oe=d.useRef($);Y.current=R,F.current=k,oe.current=$;const[re,ge]=d.useMemo(()=>{if(typeof window>"u")return[null,null];const We=document.createElement("canvas");return We.style.display="none",We.style.opacity="0",We.style.position="fixed",[We,We.getContext("2d",{alpha:!1})]},[]);d.useLayoutEffect(()=>(re&&document.documentElement.append(re),()=>{re==null||re.remove()}),[re]);const we=d.useRef({}),je=d.useRef(),[Se,Te]=d.useState();return d.useLayoutEffect(()=>{const We=F.current;if(We===void 0||u.every(ei))return;let _t=Math.max(1,10-Math.floor(u.length/1e4)),Ut=0;_t<Y.current&&_t>1&&(_t--,Ut=1);const tn={x:0,y:0,width:u.length,height:Math.min(Y.current,_t)},St={x:0,y:Y.current-1,width:u.length,height:1};(async()=>{const At=We(tn,X.signal),sn=Ut>0?We(St,X.signal):void 0;let xn;xn=typeof At=="object"?At:await Zs(At),sn!==void 0&&(xn=typeof sn=="object"?[...xn,...sn]:[...xn,...await Zs(sn)]),je.current=u,Te(xn)})()},[X.signal,u]),d.useMemo(()=>{let We=u.every(ei)?u:ge===null?u.map(St=>ei(St)?St:{...St,width:150}):(ge.font=oe.current.baseFontFull,u.map((St,At)=>{if(ei(St))return St;if(we.current[St.id]!==void 0)return{...St,width:we.current[St.id]};if(Se===void 0||je.current!==u||St.id===void 0)return{...St,width:150};const sn=au(ge,$,St,At,Se,A,G,!0,_);return we.current[St.id]=sn.width,sn})),_t=0,Ut=0;const tn=[];for(const[St,At]of We.entries())_t+=At.width,At.grow!==void 0&&At.grow>0&&(Ut+=At.grow,tn.push(St));if(_t<P&&tn.length>0){const St=[...We],At=P-_t;let sn=At;for(let xn=0;xn<tn.length;xn++){const cr=tn[xn],Xo=(We[cr].grow??0)/Ut,Aa=xn===tn.length-1?sn:Math.min(sn,Math.floor(At*Xo));St[cr]={...We[cr],growOffset:Aa,width:We[cr].width+Aa},sn-=Aa}We=St}return{sizedColumns:We,nonGrowWidth:_t}},[P,u,ge,Se,$,A,G,_])}(g,Ge,Be,yn[0]-(K===0?0:Nn)-yn[2],ir,pi,gt,Ht,Ie.current);vn!=="none"&&(vi+=Nn);const Jr=d.useMemo(()=>hn.some(u=>u.group!==void 0),[hn]),sr=Jr?Fr+Po:Fr,Ao=z.rows.length,Fo=vn==="none"?void 0:Ao!==0&&(Ao===Ge||void 0),Ct=d.useMemo(()=>vn==="none"?hn:[{title:"",width:Nn,icon:void 0,hasMenu:!1,style:"normal",themeOverride:nr,rowMarker:yr,rowMarkerChecked:Fo,headerRowMarkerTheme:rr,headerRowMarkerAlwaysVisible:qr,headerRowMarkerDisabled:or},...hn],[vn,hn,Nn,nr,yr,Fo,rr,qr,or]),Gt=d.useRef({height:1,width:1,x:0,y:0}),Dn=d.useRef(!1),{setVisibleRegion:Lo,visibleRegion:_r,scrollRef:zt}=Sg(dt,xt,Vn,Gt,()=>Dn.current=!0);Gt.current=_r;const lp=_r.x+K,wi=_r.y,ln=d.useRef(null),bn=d.useCallback(u=>{var R;u===!0?(R=ln.current)==null||R.focus():window.requestAnimationFrame(()=>{var k;(k=ln.current)==null||k.focus()})},[]),fn=Wt?Ge+1:Ge,zn=d.useCallback(u=>{const R=K===0?u:u.map(P=>({...P,location:[P.location[0]-K,P.location[1]]})),k=se==null?void 0:se(R);if(k!==!0)for(const P of R)ee==null||ee(P.location,P.value);return k},[ee,se,K]),[jr,ka]=d.useState(),yi=z.current!==void 0&&z.current.range.width*z.current.range.height>1?z.current.range:void 0,Qr=zr?(z0=z.current)==null?void 0:z0.cell:void 0,bi=Qr==null?void 0:Qr[0],xi=Qr==null?void 0:Qr[1],sp=d.useMemo(()=>{if((ye===void 0||ye.length===0)&&(yi??bi??xi??jr)===void 0)return;const u=[];if(ye!==void 0)for(const R of ye){const k=Ct.length-R.range.x-K;k>0&&u.push({color:R.color,range:{...R.range,x:R.range.x+K,width:Math.min(k,R.range.width)},style:R.style})}return jr!==void 0&&u.push({color:Hr(gt.accentColor,0),range:jr,style:"dashed"}),yi!==void 0&&u.push({color:Hr(gt.accentColor,.5),range:yi,style:"solid-outline"}),bi!==void 0&&xi!==void 0&&u.push({color:gt.accentColor,range:{x:bi,y:xi,width:1,height:1},style:"solid-outline"}),u.length>0?u:void 0},[jr,yi,bi,xi,ye,Ct.length,gt.accentColor,K]),b0=d.useRef(Ct);b0.current=Ct;const Tn=d.useCallback(([u,R],k=!1)=>{var A,G,$,_,X,Y,F;const P=Wt&&R===fn-1;if(u===0&&wn){if(P)return hi;const oe=Oo(R);return oe===void 0?hi:{kind:Hn.Marker,allowOverlay:!1,checkboxStyle:yr,checked:(z==null?void 0:z.rows.hasIndex(R))===!0,markerKind:vn==="clickable-number"?"number":vn,row:To+oe,drawHandle:Xt!==void 0,cursor:vn==="clickable-number"?"pointer":void 0}}if(P){const oe=u===K?(ne==null?void 0:ne.hint)??"":"",re=b0.current[u];if(((A=re==null?void 0:re.trailingRowOptions)==null?void 0:A.disabled)===!0)return hi;{const ge=((G=re==null?void 0:re.trailingRowOptions)==null?void 0:G.hint)??oe,we=(($=re==null?void 0:re.trailingRowOptions)==null?void 0:$.addIcon)??(ne==null?void 0:ne.addIcon);return{kind:Hn.NewRow,hint:ge,allowOverlay:!1,icon:we}}}{const oe=u-K;if(k||(lt==null?void 0:lt.strict)===!0){const ge=Gt.current,we=ge.x>oe||oe>ge.x+ge.width||ge.y>R||R>ge.y+ge.height||R>=Ra.current,je=oe===((X=(_=ge.extras)==null?void 0:_.selected)==null?void 0:X[0])&&R===((Y=ge.extras)==null?void 0:Y.selected[1]);let Se=!1;if(((F=ge.extras)==null?void 0:F.freezeRegions)!==void 0){for(const Te of ge.extras.freezeRegions)if(Dr(Te,oe,R)){Se=!0;break}}if(we&&!je&&!Se)return hi}let re=x([oe,R]);return K!==0&&re.span!==void 0&&(re={...re,span:[re.span[0]+K,re.span[1]+K]}),re}},[Wt,fn,wn,Oo,yr,z==null?void 0:z.rows,vn,To,Xt,K,ne==null?void 0:ne.hint,ne==null?void 0:ne.addIcon,lt==null?void 0:lt.strict,x]),Ma=d.useCallback(u=>{let R=(bt==null?void 0:bt(u))??{name:u};return fe!==void 0&&u!==""&&(R={icon:R.icon,name:R.name,overrideTheme:R.overrideTheme,actions:[...R.actions??[],{title:"Rename",icon:"renameIcon",onClick:k=>Ia({group:R.name,bounds:k.bounds})}]}),R},[bt,fe]),Ci=d.useCallback(u=>{var _;const[R,k]=u.cell,P=Ct[R],A=(P==null?void 0:P.group)!==void 0?(_=Ma(P.group))==null?void 0:_.overrideTheme:void 0,G=P==null?void 0:P.themeOverride,$=jn==null?void 0:jn(k);i({...u,theme:Zn(gt,A,G,$,u.content.themeOverride)})},[jn,Ct,Ma,gt]),Zr=d.useCallback((u,R,k)=>{var $;if(z.current===void 0)return;const[P,A]=z.current.cell,G=Tn([P,A]);if(G.kind!==me.Boolean&&G.allowOverlay){let _=G;if(k!==void 0)switch(_.kind){case me.Number:{const X=function(Y,F){try{return Y()}catch{return F}}(()=>k==="-"?-0:Number.parseFloat(k),0);_={..._,data:Number.isNaN(X)?0:X};break}case me.Text:case me.Markdown:case me.Uri:_={..._,data:k}}Ci({target:u,content:_,initialValue:k,cell:[P,A],highlight:k===void 0,forceEditMode:k!==void 0})}else G.kind===me.Boolean&&R&&G.readonly!==!0&&(zn([{location:z.current.cell,value:{...G,data:r0(G.data)}}]),($=ln.current)==null||$.damage([{cell:z.current.cell}]))},[Tn,z,zn,Ci]),x0=d.useCallback((u,R)=>{var A;const k=(A=ln.current)==null?void 0:A.getBounds(u,R);if(k===void 0||zt.current===null)return;const P=Tn([u,R]);P.allowOverlay&&Ci({target:k,content:P,initialValue:void 0,highlight:!0,cell:[u,R],forceEditMode:!0})},[Tn,zt,Ci]),Qt=d.useCallback((u,R,k="both",P=0,A=0,G=void 0)=>{if(zt.current!==null){const $=ln.current,_=a.current,X=typeof u!="number"?u.unit==="cell"?u.amount:void 0:u,Y=typeof R!="number"?R.unit==="cell"?R.amount:void 0:R,F=typeof u!="number"&&u.unit==="px"?u.amount:void 0,oe=typeof R!="number"&&R.unit==="px"?R.amount:void 0;if($!==null&&_!==null){let re={x:0,y:0,width:0,height:0},ge=0,we=0;if((X!==void 0||Y!==void 0)&&(re=$.getBounds((X??0)+K,Y??0)??re,re.width===0||re.height===0))return;const je=_.getBoundingClientRect(),Se=je.width/_.offsetWidth;if(F!==void 0&&(re={...re,x:F-je.left-zt.current.scrollLeft,width:1}),oe!==void 0&&(re={...re,y:oe+je.top-zt.current.scrollTop,height:1}),re!==void 0){const Te={x:re.x-P,y:re.y-A,width:re.width+2*P,height:re.height+2*A};let We=0;for(let Xo=0;Xo<Pe;Xo++)We+=hn[Xo].width;let _t=0;const Ut=xe+(L?1:0);Ut>0&&(_t=Or(fn,Ut,Vn));let tn=We*Se+je.left+K*Nn*Se,St=je.right,At=je.top+sr*Se,sn=je.bottom-_t*Se;const xn=re.width+2*P;switch(G==null?void 0:G.hAlign){case"start":St=tn+xn;break;case"end":tn=St-xn;break;case"center":tn=Math.floor((tn+St)/2)-xn/2,St=tn+xn}const cr=re.height+2*A;switch(G==null?void 0:G.vAlign){case"start":sn=At+cr;break;case"end":At=sn-cr;break;case"center":At=Math.floor((At+sn)/2)-cr/2,sn=At+cr}tn>Te.x?ge=Te.x-tn:St<Te.x+Te.width&&(ge=Te.x+Te.width-St),At>Te.y?we=Te.y-At:sn<Te.y+Te.height&&(we=Te.y+Te.height-sn),k==="vertical"||typeof u=="number"&&u<Pe?ge=0:(k==="horizontal"||typeof R=="number"&&R>=fn-Ut)&&(we=0),ge===0&&we===0||(Se!==1&&(ge/=Se,we/=Se),zt.current.scrollTo({left:ge+zt.current.scrollLeft,top:we+zt.current.scrollTop,behavior:(G==null?void 0:G.behavior)??"auto"}))}}}},[K,xe,Nn,zt,sr,Pe,hn,fn,L,Vn]),C0=d.useRef(x0),S0=d.useRef(x),Ra=d.useRef(Ge);C0.current=x0,S0.current=x,Ra.current=Ge;const eo=d.useCallback(async(u,R=!0,k)=>{var Y;const P=Ct[u];if(((Y=P==null?void 0:P.trailingRowOptions)==null?void 0:Y.disabled)===!0)return;const A=He==null?void 0:He();let G,$=!0;A!==void 0&&(G=await A,G==="top"&&($=!1),typeof G=="number"&&($=!1));let _=0;const X=()=>{if(Ra.current<=Ge)return _<500&&window.setTimeout(X,_),void(_=50+2*_);const F=typeof G=="number"?G:$?Ge:0;Ii.current(u-K,F,"both",0,0,k?{behavior:k}:void 0),Lt({cell:[u,F],range:{x:u,y:F,width:1,height:1}},!1,!1,"edit");const oe=S0.current([u-K,F]);oe.allowOverlay&&so(oe)&&oe.readonly!==!0&&R&&window.setTimeout(()=>{C0.current(u,F)},0)};X()},[Ct,He,K,Ge,Lt]),Si=d.useCallback(u=>{var k,P;const R=((P=(k=hn[u])==null?void 0:k.trailingRowOptions)==null?void 0:P.targetColumn)??(ne==null?void 0:ne.targetColumn);if(typeof R=="number")return R+(wn?1:0);if(typeof R=="object"){const A=g.indexOf(R);if(A>=0)return A+(wn?1:0)}},[hn,g,wn,ne==null?void 0:ne.targetColumn]),xr=d.useRef(),to=d.useRef(),_o=d.useCallback((u,R)=>{var A;const[k,P]=R;return Zn(gt,(A=Ct[k])==null?void 0:A.themeOverride,jn==null?void 0:jn(P),u.themeOverride)},[jn,Ct,gt]),{mapper:Nr}=function(u,R){const k=$t.useMemo(()=>u===void 0?void 0:ma(u,R),[u,R]);return{getRowGroupingForPath:l0,updateRowGroupingByPath:a0,mapper:$t.useCallback(P=>{if(typeof P=="number")return va(P,k);const A=va(P[1],k);return{...A,originalIndex:[P[0],A.originalIndex]}},[k])}}(Ze,w),Bn=Ze==null?void 0:Ze.navigationBehavior,jo=d.useCallback(u=>{var F,oe,re;const R=ci.value?u.metaKey:u.ctrlKey,k=R&&te==="multi",P=R&&Oe==="multi",[A,G]=u.location,$=z.columns,_=z.rows,[X,Y]=((F=z.current)==null?void 0:F.cell)??[];if(u.kind==="cell"){if(to.current=void 0,Br.current=[A,G],A===0&&wn){if(Wt===!0&&G===Ge||vn==="number"||te==="none")return;const ge=Tn(u.location);if(ge.kind!==Hn.Marker)return;if(Xt!==void 0){const Se=Ht(ge);Rn((Se==null?void 0:Se.kind)===Hn.Marker);const Te=(oe=Se==null?void 0:Se.onClick)==null?void 0:oe.call(Se,{...u,cell:ge,posX:u.localEventX,posY:u.localEventY,bounds:u.bounds,theme:_o(ge,u.location),preventDefault:()=>{}});if(Te===void 0||Te.checked===ge.checked)return}i(void 0),bn();const we=_.hasIndex(G),je=xr.current;if(te==="multi"&&(u.shiftKey||u.isLongTouch===!0)&&je!==void 0&&_.hasIndex(je)){const Se=[Math.min(je,G),Math.max(je,G)+1];k||tt==="multi"?Ne(void 0,Se,!0):Ne(yt.fromSingleSelection(Se),void 0,k)}else te==="multi"&&(k||u.isTouch||tt==="multi")?we?Ne(_.remove(G),void 0,!0):(Ne(void 0,G,!0),xr.current=G):we&&_.length===1?Ne(yt.empty(),void 0,R):(Ne(yt.fromSingleSelection(G),void 0,R),xr.current=G)}else if(A>=K&&Wt&&G===Ge){const ge=Si(A);eo(ge??A)}else if(X!==A||Y!==G){const ge=Tn(u.location),we=Ht(ge);if((we==null?void 0:we.onSelect)!==void 0){let Te=!1;if(we.onSelect({...u,cell:ge,posX:u.localEventX,posY:u.localEventY,bounds:u.bounds,preventDefault:()=>Te=!0,theme:_o(ge,u.location)}),Te)return}if(Bn==="block"&&Nr(G).isGroupHeader)return;const je=L&&G===Ge,Se=L&&z!==void 0&&((re=z.current)==null?void 0:re.cell[1])===Ge;if(!u.shiftKey&&u.isLongTouch!==!0||X===void 0||Y===void 0||z.current===void 0||Se)Lt({cell:[A,G],range:{x:A,y:G,width:1,height:1}},!0,R,"click"),xr.current=void 0,i(void 0),bn();else{if(je)return;const Te=Math.min(A,X),We=Math.max(A,X),_t=Math.min(G,Y),Ut=Math.max(G,Y);Lt({...z.current,range:{x:Te,y:_t,width:We-Te+1,height:Ut-_t+1}},!0,R,"click"),xr.current=void 0,bn()}}}else if(u.kind==="header")if(Br.current=[A,G],i(void 0),wn&&A===0)xr.current=void 0,to.current=void 0,or||te!=="multi"||(_.length!==Ge?Ne(yt.fromSingleSelection([0,Ge]),void 0,R):Ne(yt.empty(),void 0,R),bn());else{const ge=to.current;if(Oe==="multi"&&(u.shiftKey||u.isLongTouch===!0)&&ge!==void 0&&$.hasIndex(ge)){const we=[Math.min(ge,A),Math.max(ge,A)+1];P?ht(void 0,we,R):ht(yt.fromSingleSelection(we),void 0,R)}else P?($.hasIndex(A)?ht($.remove(A),void 0,R):ht(void 0,A,R),to.current=A):Oe!=="none"&&($.hasIndex(A)?ht($.remove(A),void 0,R):ht(yt.fromSingleSelection(A),void 0,R),to.current=A);xr.current=void 0,bn()}else u.kind===Pn?Br.current=[A,G]:u.kind!==ui||u.isMaybeScrollbar||(_e(fi,!1),i(void 0),bn(),Kt==null||Kt(),xr.current=void 0,to.current=void 0)},[te,Oe,z,wn,K,Wt,Ge,vn,Tn,Xt,bn,tt,Ht,_o,Ne,Si,eo,Bn,Nr,L,Lt,ht,_e,Kt]),No=d.useRef(!1),Br=d.useRef(),k0=d.useRef(_r),An=d.useRef(),cp=d.useCallback(u=>{if(no.current=!1,k0.current=Gt.current,u.button!==0&&u.button!==1)return void(An.current=void 0);const R=performance.now();An.current={button:u.button,time:R,location:u.location},(u==null?void 0:u.kind)==="header"&&(No.current=!0);const k=u.kind==="cell"&&u.isFillHandle;!k&&u.kind!=="cell"&&u.isEdge||(c({previousSelection:z,fillHandle:k}),Br.current=void 0,u.isTouch||u.button!==0||k?u.isTouch||u.button!==1||(Br.current=u.location):jo(u))},[z,jo]),[Ea,Ia]=d.useState(),M0=d.useCallback(u=>{if(u.kind!==Pn||Oe!=="multi")return;const R=ci.value?u.metaKey:u.ctrlKey,[k]=u.location,P=z.columns;if(k<K)return;const A=Ct[k];let G=k,$=k;for(let _=k-1;_>=K&&mo(A.group,Ct[_].group);_--)G--;for(let _=k+1;_<Ct.length&&mo(A.group,Ct[_].group);_++)$++;if(bn(),R)if(P.hasAll([G,$+1])){let _=P;for(let X=G;X<=$;X++)_=_.remove(X);ht(_,void 0,R)}else ht(void 0,[G,$+1],R);else ht(yt.fromSingleSelection([G,$+1]),void 0,R)},[Oe,bn,z.columns,Ct,K,ht]),no=d.useRef(!1),ki=d.useCallback(async u=>{if(Le!==void 0&&et!==void 0){const R=Gt.current.y,k=Gt.current.height;let P=Le({x:u,y:R,width:1,height:Math.min(k,Ge-R)},Ie.current.signal);typeof P!="object"&&(P=await P());const A=hn[u-K],G=document.createElement("canvas").getContext("2d",{alpha:!1});if(G!==null){G.font=gt.baseFontFull;const $=au(G,gt,A,0,P,ir,Ar,!1,Ht);et==null||et(A,$.width,u,$.width)}}},[hn,Le,Ar,gt,ir,et,K,Ge,Ht]),[up,Ta]=d.useState(),ro=d.useCallback(async(u,R)=>{var _,X;const k=(_=u.current)==null?void 0:_.range;if(k===void 0||Le===void 0||R.current===void 0)return;const P=R.current.range;if(M!==void 0){let Y=!1;if(M({fillDestination:{...P,x:P.x-K},patternSource:{...k,x:k.x-K},preventDefault:()=>Y=!0}),Y)return}let A=Le(k,Ie.current.signal);typeof A!="object"&&(A=await A());const G=A,$=[];for(let Y=0;Y<P.width;Y++)for(let F=0;F<P.height;F++){const oe=[P.x+Y,P.y+F];if(Yc(oe,k))continue;const re=G[F%k.height][Y%k.width];!kr(re)&&so(re)&&$.push({location:oe,value:{...re}})}zn($),(X=ln.current)==null||X.damage($.map(Y=>({cell:Y.location})))},[Le,zn,M,K]),R0=d.useCallback(()=>{if(z.current===void 0||z.current.range.width<=1)return;const u={...z,current:{...z.current,range:{...z.current.range,width:1}}};ro(u,z)},[ro,z]),E0=d.useCallback(()=>{if(z.current===void 0||z.current.range.height<=1)return;const u={...z,current:{...z.current,range:{...z.current.range,height:1}}};ro(u,z)},[ro,z]),dp=d.useCallback((u,R)=>{var F,oe;const k=s;if(c(void 0),ka(void 0),Ta(void 0),No.current=!1,R)return;if((k==null?void 0:k.fillHandle)===!0&&z.current!==void 0&&((F=k.previousSelection)==null?void 0:F.current)!==void 0){if(jr===void 0)return;const re={...z,current:{...z.current,range:md(k.previousSelection.current.range,jr)}};return ro(k.previousSelection,re),void _e(re,!0)}const[P,A]=u.location,[G,$]=Br.current??[],_=()=>{no.current=!0},X=re=>{var we,je,Se;const ge=re.isTouch||G===P&&$===A;if(ge&&(I==null||I([P-K,A],{...re,preventDefault:_})),re.button===1)return!no.current;if(!no.current){const Te=Tn(u.location),We=Ht(Te);if(We!==void 0&&We.onClick!==void 0&&ge){const Ut=We.onClick({...re,cell:Te,posX:re.localEventX,posY:re.localEventY,bounds:re.bounds,theme:_o(Te,u.location),preventDefault:_});Ut!==void 0&&!kr(Ut)&&Mr(Ut)&&(zn([{location:re.location,value:Ut}]),(we=ln.current)==null||we.damage([{cell:re.location}]))}if(no.current||z.current===void 0)return!1;let _t=!1;switch(Te.activationBehaviorOverride??ut){case"double-click":case"second-click":{if(((Se=(je=k==null?void 0:k.previousSelection)==null?void 0:je.current)==null?void 0:Se.cell)===void 0)break;const[Ut,tn]=z.current.cell,[St,At]=k.previousSelection.current.cell;_t=P===Ut&&P===St&&A===tn&&A===At&&(re.isDoubleClick===!0||ut==="second-click");break}case"single-click":_t=!0}if(_t)return v==null||v([P-K,A]),Zr(re.bounds,!1),!0}return!1},Y=u.location[0]-K;if(u.isTouch){const re=Gt.current,ge=k0.current;if(re.x!==ge.x||re.y!==ge.y)return;if(u.isLongTouch===!0){if(u.kind==="cell"&&vo((oe=z.current)==null?void 0:oe.cell,u.location))return void(J==null?void 0:J([Y,u.location[1]],{...u,preventDefault:_}));if(u.kind==="header"&&z.columns.hasIndex(P))return void(le==null?void 0:le(Y,{...u,preventDefault:_}));if(u.kind===Pn)return Y<0?void 0:void(Q==null?void 0:Q(Y,{...u,preventDefault:_}))}return void(u.kind==="cell"?X(u)||jo(u):u.kind===Pn?Z==null?void 0:Z(Y,{...u,preventDefault:_}):(u.kind===pr&&(O==null||O(Y,{...u,preventDefault:_})),jo(u)))}if(u.kind==="header"){if(Y<0)return;u.isEdge?u.isDoubleClick===!0&&ki(P):u.button===0&&P===G&&A===$&&(O==null||O(Y,{...u,preventDefault:_}))}if(u.kind===Pn){if(Y<0)return;u.button===0&&P===G&&A===$&&(Z==null||Z(Y,{...u,preventDefault:_}),no.current||M0(u))}u.kind!=="cell"||u.button!==0&&u.button!==1||X(u),Br.current=void 0},[s,z,K,jr,ro,_e,I,Tn,Ht,ut,_o,zn,v,Zr,J,le,Q,jo,Z,O,ki,M0]),hp=d.useCallback(u=>{const R={...u,location:[u.location[0]-K,u.location[1]]};Ye==null||Ye(R),s!==void 0&&u.buttons===0&&(c(void 0),ka(void 0),Ta(void 0),No.current=!1),Ta(k=>{var P;return No.current?[u.scrollEdge[0],0]:u.scrollEdge[0]===(k==null?void 0:k[0])&&u.scrollEdge[1]===k[1]?k:s===void 0||(((P=An.current)==null?void 0:P.location[0])??0)<K?void 0:u.scrollEdge})},[s,Ye,K]),fp=d.useCallback((u,R)=>{pt==null||pt(u-K,R)},[pt,K]),gp=d.useCallback((u,R)=>{Ft==null||Ft(u-K,R)},[Ft,K]),qn=(A0=z==null?void 0:z.current)==null?void 0:A0.cell,pp=d.useCallback((u,R,k,P,A,G)=>{Dn.current=!1;let $=qn;$!==void 0&&($=[$[0]-K,$[1]]);const _=Pe===0?void 0:{x:0,y:u.y,width:Pe,height:u.height},X=[];_!==void 0&&X.push(_),xe>0&&(X.push({x:u.x-K,y:Ge-xe,width:u.width,height:xe}),Pe>0&&X.push({x:0,y:Ge-xe,width:Pe,height:xe}));const Y={x:u.x-K,y:u.y,width:u.width,height:Wt&&u.y+u.height>=Ge?u.height-1:u.height,tx:A,ty:G,extras:{selected:$,freezeRegion:_,freezeRegions:X}};Gt.current=Y,Lo(Y),an([R,k,P]),un==null||un(Y,Y.tx,Y.ty,Y.extras)},[qn,K,Wt,Ge,Pe,xe,Lo,un]),mp=dr(T,d.useCallback((u,R)=>(T==null?void 0:T(u-K,R-K))!==!1,[T,K])),vp=dr($e,d.useCallback((u,R)=>{$e==null||$e(u-K,R-K),Oe!=="none"&&ht(yt.fromSingleSelection(R),void 0,!0)},[Oe,$e,K,ht])),Ha=d.useRef(!1),wp=d.useCallback(u=>{u.location[0]===0&&K>0?u.preventDefault():(qe==null||qe({...u,location:[u.location[0]-K,u.location[1]]}),u.defaultPrevented()||(Ha.current=!0),c(void 0))},[qe,K]),yp=d.useCallback(()=>{Ha.current=!1},[]),I0=Ze==null?void 0:Ze.selectionBehavior,Mi=d.useCallback(u=>{if(I0!=="block-spanning")return;const{isGroupHeader:R,path:k,groupRows:P}=Nr(u);if(R)return[u,u];const A=k[k.length-1];return[u-A,u+P-A-1]},[Nr,I0]),Oa=d.useRef(),Pa=d.useCallback(u=>{var R,k,P;if(!(qf(u,Oa.current)||(Oa.current=u,((R=An==null?void 0:An.current)==null?void 0:R.button)!==void 0&&An.current.button>=1))){if(u.buttons!==0&&s!==void 0&&((k=An.current)==null?void 0:k.location[0])===0&&u.location[0]===0&&K===1&&te==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(An.current.location[1])&&z.rows.hasIndex(An.current.location[1])){const A=Math.min(An.current.location[1],u.location[1]),G=Math.max(An.current.location[1],u.location[1])+1;Ne(yt.fromSingleSelection([A,G]),void 0,!1)}if(!(u.buttons===0||s===void 0||z.current===void 0||Ha.current||No.current||Fe!=="rect"&&Fe!=="multi-rect")){const[A,G]=z.current.cell;let[$,_]=u.location;if(_<0&&(_=Gt.current.y),s.fillHandle===!0&&((P=s.previousSelection)==null?void 0:P.current)!==void 0){const X=s.previousSelection.current.range;_=Math.min(_,Wt?Ge-1:Ge);const Y=function(F,oe,re,ge){if(ge==="any")return md(F,{x:oe,y:re,width:1,height:1});if(ge==="vertical"&&(oe=F.x),ge==="horizontal"&&(re=F.y),Yc([oe,re],F))return;const we=oe-F.x,je=F.x+F.width-oe,Se=re-F.y+1,Te=F.y+F.height-re,We=Math.min(ge==="vertical"?Number.MAX_SAFE_INTEGER:we,ge==="vertical"?Number.MAX_SAFE_INTEGER:je,ge==="horizontal"?Number.MAX_SAFE_INTEGER:Se,ge==="horizontal"?Number.MAX_SAFE_INTEGER:Te);return We===Te?{x:F.x,y:F.y+F.height,width:F.width,height:re-F.y-F.height+1}:We===Se?{x:F.x,y:re,width:F.width,height:F.y-re}:We===je?{x:F.x+F.width,y:F.y,width:oe-F.x-F.width+1,height:F.height}:{x:oe,y:F.y,width:F.x-oe,height:F.height}}(X,$,_,wt);ka(Y)}else{if(Wt&&G===Ge)return;if(Wt&&_===Ge){if(u.kind!==ui)return;_--}$=Math.max($,K);const X=Mi(G);_=X===void 0?_:On(_,X[0],X[1]);const Y=$-A,F=_-G,oe={x:Y>=0?A:$,y:F>=0?G:_,width:Math.abs(Y)+1,height:Math.abs(F)+1};Lt({...z.current,range:oe},!0,!1,"drag")}}nn==null||nn({...u,location:[u.location[0]-K,u.location[1]]})}},[s,K,te,z,Fe,nn,Ne,Wt,Ge,wt,Mi,Lt]),bp=d.useCallback(()=>{var $,_;const u=Oa.current;if(u===void 0)return;const[R,k]=u.scrollEdge;let[P,A]=u.location;const G=Gt.current;R===-1?P=((_=($=G.extras)==null?void 0:$.freezeRegion)==null?void 0:_.x)??G.x:R===1&&(P=G.x+G.width),k===-1?A=Math.max(0,G.y):k===1&&(A=Math.min(Ge-1,G.y+G.height)),P=On(P,0,Ct.length-1),A=On(A,0,Ge-1),Pa({...u,location:[P,A]})},[Ct.length,Pa,Ge]);(function(u,R,k){const P=$t.useRef(0),[A,G]=u??[0,0];$t.useEffect(()=>{if(A===0&&G===0)return void(P.current=0);let $=!1,_=0;const X=Y=>{var F;if(!$){if(_===0)_=Y;else{const oe=Y-_;P.current=Math.min(1,P.current+oe/1300);const re=P.current**1.618*oe*2;(F=R.current)==null||F.scrollBy(A*re,G*re),_=Y,k==null||k()}window.requestAnimationFrame(X)}};return window.requestAnimationFrame(X),()=>{$=!0}},[R,A,G,k])})(up,zt,bp);const Wn=d.useCallback(u=>{if(z.current===void 0)return;const[R,k]=u,[P,A]=z.current.cell,G=z.current.range;let $=G.x,_=G.x+G.width,X=G.y,Y=G.y+G.height;const[F,oe]=Mi(A)??[0,Ge-1],re=oe+1;if(k!==0)switch(k){case 2:Y=re,X=A,Qt(0,Y,"vertical");break;case-2:X=F,Y=A+1,Qt(0,X,"vertical");break;case 1:X<A?(X++,Qt(0,X,"vertical")):(Y=Math.min(re,Y+1),Qt(0,Y,"vertical"));break;case-1:Y>A+1?(Y--,Qt(0,Y,"vertical")):(X=Math.max(F,X-1),Qt(0,X,"vertical"));break;default:lo()}if(R!==0)if(R===2)_=Ct.length,$=P,Qt(_-1-K,0,"horizontal");else if(R===-2)$=K,_=P+1,Qt($-K,0,"horizontal");else{let ge=[];if(Le!==void 0){const we=Le({x:$,y:X,width:_-$-K,height:Y-X},Ie.current.signal);typeof we=="object"&&(ge=function(je){return S1(Zu(Zu(je).filter(Se=>Se.span!==void 0).map(Se=>{var Te,We;return Pr((((Te=Se.span)==null?void 0:Te[0])??0)+1,(((We=Se.span)==null?void 0:We[1])??0)+1)})))}(we))}if(R===1){let we=!1;if($<P){if(ge.length>0){const je=Pr($+1,P+1).find(Se=>!ge.includes(Se-K));je!==void 0&&($=je,we=!0)}else $++,we=!0;we&&Qt($,0,"horizontal")}we||(_=Math.min(Ct.length,_+1),Qt(_-1-K,0,"horizontal"))}else if(R===-1){let we=!1;if(_>P+1){if(ge.length>0){const je=Pr(_-1,P,-1).find(Se=>!ge.includes(Se-K));je!==void 0&&(_=je,we=!0)}else _--,we=!0;we&&Qt(_-K,0,"horizontal")}we||($=Math.max(K,$-1),Qt($-K,0,"horizontal"))}else lo()}Lt({cell:z.current.cell,range:{x:$,y:X,width:_-$,height:Y-X}},!0,!1,"keyboard-select")},[Le,Mi,z,Ct.length,K,Ge,Qt,Lt]),Da=d.useRef(Eo);Da.current=Eo;const Cr=d.useCallback((u,R,k,P)=>{const A=fn-(k?0:1);u=On(u,K,hn.length-1+K),R=On(R,0,A);const G=qn==null?void 0:qn[0],$=qn==null?void 0:qn[1];if(u===G&&R===$)return!1;if(P&&z.current!==void 0){const _=[...z.current.rangeStack];(z.current.range.width>1||z.current.range.height>1)&&_.push(z.current.range),_e({...z,current:{cell:[u,R],range:{x:u,y:R,width:1,height:1},rangeStack:_}},!0)}else Lt({cell:[u,R],range:{x:u,y:R,width:1,height:1}},!0,!1,"keyboard-nav");return h.current!==void 0&&h.current[0]===u&&h.current[1]===R&&(h.current=void 0),Da.current&&Qt(u-K,R),!0},[fn,K,hn.length,qn,z,Qt,_e,Lt]),xp=d.useCallback((u,R)=>{(o==null?void 0:o.cell)!==void 0&&u!==void 0&&Mr(u)&&(zn([{location:o.cell,value:u}]),window.requestAnimationFrame(()=>{var A;(A=ln.current)==null||A.damage([{cell:o.cell}])})),bn(!0),i(void 0);const[k,P]=R;if(z.current!==void 0&&(k!==0||P!==0)){const A=z.current.cell[1]===fn-1&&u!==void 0;Cr(On(z.current.cell[0]+k,0,Ct.length-1),On(z.current.cell[1]+P,0,fn-1),A,!1)}S==null||S(u,R)},[o==null?void 0:o.cell,bn,z,S,zn,fn,Cr,Ct.length]),Cp=d.useMemo(()=>"gdg-overlay-"+Mg++,[]),Wr=d.useCallback(u=>{var k,P,A,G;bn();const R=[];for(let $=u.x;$<u.x+u.width;$++)for(let _=u.y;_<u.y+u.height;_++){const X=x([$-K,_]);if(!X.allowOverlay&&X.kind!==me.Boolean)continue;let Y;if(X.kind===me.Custom){const F=Ht(X),oe=(k=F==null?void 0:F.provideEditor)==null?void 0:k.call(F,{...X,location:[$-K,_]});(F==null?void 0:F.onDelete)!==void 0?Y=F.onDelete(X):$a(oe)&&(Y=(P=oe==null?void 0:oe.deletedValue)==null?void 0:P.call(oe,X))}else if(Mr(X)&&X.allowOverlay||X.kind===me.Boolean){const F=Ht(X);Y=(A=F==null?void 0:F.onDelete)==null?void 0:A.call(F,X)}Y!==void 0&&!kr(Y)&&Mr(Y)&&R.push({location:[$,_],value:Y})}zn(R),(G=ln.current)==null||G.damage(R.map($=>({cell:$.location})))},[bn,x,Ht,zn,K]),Bo=o!==void 0,T0=d.useCallback(u=>{var we,je;const R=()=>{u.stopPropagation(),u.preventDefault()},k={didMatch:!1},{bounds:P}=u,A=z.columns,G=z.rows,$=Un;if(!Bo&&st($.clear,u,k))_e(fi,!1),Kt==null||Kt();else if(!Bo&&st($.selectAll,u,k))_e({columns:yt.empty(),rows:yt.empty(),current:{cell:((we=z.current)==null?void 0:we.cell)??[K,0],range:{x:K,y:0,width:g.length,height:Ge},rangeStack:[]}},!1);else if(st($.search,u,k))(je=l==null?void 0:l.current)==null||je.focus({preventScroll:!0}),de(!0);else if(st($.delete,u,k)){const Se=(on==null?void 0:on(z))??!0;if(Se!==!1){const Te=Se===!0?z:Se;if(Te.current!==void 0){Wr(Te.current.range);for(const We of Te.current.rangeStack)Wr(We)}for(const We of Te.rows)Wr({x:K,y:We,width:g.length,height:1});for(const We of Te.columns)Wr({x:We,y:0,width:1,height:Ge})}}if(k.didMatch)return R(),!0;if(z.current===void 0)return!1;let[_,X]=z.current.cell;const[,Y]=z.current.cell;let F=!1,oe=!1;if(st($.scrollToSelectedCell,u,k)?Ii.current(_-K,X):Oe!=="none"&&st($.selectColumn,u,k)?A.hasIndex(_)?ht(A.remove(_),void 0,!0):Oe==="single"?ht(yt.fromSingleSelection(_),void 0,!0):ht(void 0,_,!0):te!=="none"&&st($.selectRow,u,k)?G.hasIndex(X)?Ne(G.remove(X),void 0,!0):te==="single"?Ne(yt.fromSingleSelection(X),void 0,!0):Ne(void 0,X,!0):!Bo&&P!==void 0&&st($.activateCell,u,k)?X===Ge&&Wt?window.setTimeout(()=>{const Se=Si(_);eo(Se??_)},0):(v==null||v([_-K,X]),Zr(P,!0)):z.current.range.height>1&&st($.downFill,u,k)?E0():z.current.range.width>1&&st($.rightFill,u,k)?R0():st($.goToNextPage,u,k)?X+=Math.max(1,Gt.current.height-4):st($.goToPreviousPage,u,k)?X-=Math.max(1,Gt.current.height-4):st($.goToFirstCell,u,k)?(i(void 0),X=0,_=0):st($.goToLastCell,u,k)?(i(void 0),X=Number.MAX_SAFE_INTEGER,_=Number.MAX_SAFE_INTEGER):st($.selectToFirstCell,u,k)?(i(void 0),Wn([-2,-2])):st($.selectToLastCell,u,k)?(i(void 0),Wn([2,2])):Bo?(st($.closeOverlay,u,k)&&i(void 0),st($.acceptOverlayDown,u,k)&&(i(void 0),X++),st($.acceptOverlayUp,u,k)&&(i(void 0),X--),st($.acceptOverlayLeft,u,k)&&(i(void 0),_--),st($.acceptOverlayRight,u,k)&&(i(void 0),_++)):(st($.goDownCell,u,k)?X+=1:st($.goUpCell,u,k)?X-=1:st($.goRightCell,u,k)?_+=1:st($.goLeftCell,u,k)?_-=1:st($.goDownCellRetainSelection,u,k)?(X+=1,F=!0):st($.goUpCellRetainSelection,u,k)?(X-=1,F=!0):st($.goRightCellRetainSelection,u,k)?(_+=1,F=!0):st($.goLeftCellRetainSelection,u,k)?(_-=1,F=!0):st($.goToLastRow,u,k)?X=Ge-1:st($.goToFirstRow,u,k)?X=Number.MIN_SAFE_INTEGER:st($.goToLastColumn,u,k)?_=Number.MAX_SAFE_INTEGER:st($.goToFirstColumn,u,k)?_=Number.MIN_SAFE_INTEGER:Fe!=="rect"&&Fe!=="multi-rect"||(st($.selectGrowDown,u,k)?Wn([0,1]):st($.selectGrowUp,u,k)?Wn([0,-1]):st($.selectGrowRight,u,k)?Wn([1,0]):st($.selectGrowLeft,u,k)?Wn([-1,0]):st($.selectToLastRow,u,k)?Wn([0,2]):st($.selectToFirstRow,u,k)?Wn([0,-2]):st($.selectToLastColumn,u,k)?Wn([2,0]):st($.selectToFirstColumn,u,k)&&Wn([-2,0])),oe=k.didMatch),Bn!==void 0&&Bn!=="normal"&&X!==Y){const Se=Bn==="skip-down"||Bn==="skip"||Bn==="block",Te=X<Y;if(Te&&(Bn==="skip-up"||Bn==="skip"||Bn==="block")){for(;X>=0&&Nr(X).isGroupHeader;)X--;X<0&&(X=Y)}else if(!Te&&Se){for(;X<Ge&&Nr(X).isGroupHeader;)X++;X>=Ge&&(X=Y)}}const re=Cr(_,X,!1,F),ge=k.didMatch;return ge&&(re||!oe||It)&&R(),ge},[Bn,Bo,z,Un,Oe,te,Fe,K,Nr,Ge,Cr,_e,Kt,g.length,on,It,Wr,ht,Ne,Wt,Si,eo,v,Zr,E0,R0,Wn]),Wo=d.useCallback(u=>{let R=!1;if(ue!==void 0&&ue({...u,...u.location&&{location:[u.location[0]-K,u.location[1]]},cancel:()=>{R=!0}}),R||T0(u)||z.current===void 0)return;const[k,P]=z.current.cell,A=Gt.current;if(Ue&&!u.metaKey&&!u.ctrlKey&&z.current!==void 0&&u.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(u.key)&&u.bounds!==void 0&&so(x([k-K,Math.max(0,Math.min(P,Ge-1))]))){if((!Wt||P!==Ge)&&(A.y>P||P>A.y+A.height||A.x>k||k>A.x+A.width))return;v==null||v([k-K,P]),Zr(u.bounds,!0,u.key),u.stopPropagation(),u.preventDefault()}},[Ue,ue,T0,z,x,K,Ge,Wt,v,Zr]),Sp=d.useCallback((u,R)=>{const k=u.location[0]-K;if(u.kind==="header"&&(le==null||le(k,{...u,preventDefault:R})),u.kind===Pn){if(k<0)return;Q==null||Q(k,{...u,preventDefault:R})}if(u.kind==="cell"){const[P,A]=u.location;J==null||J([k,A],{...u,preventDefault:R}),function(G,$){const[_,X]=$;if(G.columns.hasIndex(_)||G.rows.hasIndex(X))return!0;if(G.current!==void 0){if(vo(G.current.cell,$))return!0;const Y=[G.current.range,...G.current.rangeStack];for(const F of Y)if(_>=F.x&&_<F.x+F.width&&X>=F.y&&X<F.y+F.height)return!0}return!1}(z,u.location)||Cr(P,A,!1,!1)}},[z,J,Q,le,K,Cr]),za=d.useCallback(async u=>{var $,_,X;if(!Un.paste)return;function R(Y,F,oe,re){var we,je;const ge=typeof oe=="object"?(oe==null?void 0:oe.join(`
|
127
|
+
`&&(n.push(r),r=[])),i=t.None)}l++}return o<e.length&&r.push(t0(e.slice(o,e.length))),n.push(r),n.map(a=>a.map(s=>({rawValue:s,formatted:s,format:"string"})))}function n0(e,t,n){var l;const r=vg(e,t),o=a=>{var s;(s=window.navigator.clipboard)==null||s.writeText(a)},i=(a,s)=>{var c,h;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(c=n==null?void 0:n.clipboardData)==null||c.setData("text/plain",a),(h=n==null?void 0:n.clipboardData)==null||h.setData("text/html",s)}catch{((C,y)=>{var b;return((b=window.navigator.clipboard)==null?void 0:b.write)!==void 0&&(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([C],{type:"text/plain"}),"text/html":new Blob([y],{type:"text/html"})})]),!0)})(a,s)||o(a)}};((l=window.navigator.clipboard)==null?void 0:l.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?i(r.textPlain,r.textHtml):o(r.textPlain),n==null||n.preventDefault()}function r0(e){return e!==!0}function o0(e){return typeof e=="string"?e:`${e}px`}const yg=Cn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[e=>e.innerWidth],"wmyidgi-1":[e=>e.innerHeight]}}),bg=e=>{const{inWidth:t,inHeight:n,children:r,...o}=e;return d.createElement(yg,{innerHeight:o0(n),innerWidth:o0(t),...o},r)},mr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ct(e,t){return e===!0?t:e===!1?"":e}function i0(e){const t=ci.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function xg(e){const t=function(n){const r=d.useRef(n);return $r(n,r.current)||(r.current=n),r.current}(e);return $t.useMemo(()=>{if(t===void 0)return i0(mr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??mr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??mr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??mr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??mr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??mr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??mr.selectToLastCell};return i0({...mr,...n})},[t])}function Cg(e){function t(n,r,o){if(typeof n=="number")return{headerIndex:n,isCollapsed:!1,depth:r,path:o};const i={headerIndex:n.headerIndex,isCollapsed:n.isCollapsed,depth:r,path:o};return n.subGroups!==void 0&&(i.subGroups=n.subGroups.map((l,a)=>t(l,r+1,[...o,a])).sort((l,a)=>l.headerIndex-a.headerIndex)),i}return e.map((n,r)=>t(n,0,[r])).sort((n,r)=>n.headerIndex-r.headerIndex)}function ma(e,t){const n=[];function r(a,s,c=!1){let h=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(h=a.subGroups[0].headerIndex-a.headerIndex),h--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:c,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:h}),a.subGroups)for(let C=0;C<a.subGroups.length;C++){const y=C<a.subGroups.length-1?a.subGroups[C+1].headerIndex:s;r(a.subGroups[C],y,c||a.isCollapsed)}}const o=Cg(e.groups);for(let a=0;a<o.length;a++){const s=a<o.length-1?o[a+1].headerIndex:null;r(o[a],s)}let i=0,l=0;for(const a of n)a.contentIndex=l,l+=a.rows,a.rowIndex=i,i+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...c}=a;return c})}function va(e,t){if(t===void 0||ma.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function a0(e,t,n){const[r,...o]=t;return o[0]===-1?e.map((i,l)=>l===r?{...i,...n}:i):e.map((i,l)=>l===r?{...i,subGroups:a0(i.subGroups??[],o,n)}:i)}function l0(e,t){const[n,...r]=t;return r[0]===-1?e[n]:l0(e[n].subGroups??[],r)}function Sg(e,t,n,r,o){const[i,l]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-t%n:0],[t,n]),a=d.useMemo(()=>({x:r.current.x,y:i,width:r.current.width??1,height:r.current.height??1,ty:l}),[r,l,i]),[s,c,h]=c1(a),C=d.useRef(o);C.current=o;const y=function(m,E){const[g]=d.useState(()=>({value:m,callback:E,facade:{get current(){return g.value},set current(w){const x=g.value;x!==w&&(g.value=w,g.callback(w,x))}}}));return g.callback=E,g.facade}(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),b=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&y.current!==null&&b){if(y.current.scrollTop===t)return;y.current.scrollTop=t,y.current.scrollTop!==t&&h(),C.current()}},[t,b,h,y]);const p=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&y.current!==null&&p){if(y.current.scrollLeft===e)return;y.current.scrollLeft=e,y.current.scrollLeft!==e&&h(),C.current()}},[e,p,h,y]),{visibleRegion:s,setVisibleRegion:c,scrollRef:y}}const kg=d.lazy(async()=>await L0(()=>import("./data-grid-overlay-editor-5lo5J1Vt.js"),__vite__mapDeps([0,1,2,3]),import.meta.url));let Mg=0;function di(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const hi={kind:me.Loading,allowOverlay:!1},fi={columns:yt.empty(),rows:yt.empty(),current:void 0},Rg=d.forwardRef((e,t)=>{var z0,A0,F0;const[n,r]=d.useState(fi),[o,i]=d.useState(),l=d.useRef(null),a=d.useRef(null),[s,c]=d.useState(),h=d.useRef(),C=typeof window>"u"?null:window,{imageEditorOverride:y,getRowThemeOverride:b,markdownDivCreateNode:p,width:m,height:E,columns:g,rows:w,getCellContent:x,onCellClicked:I,onCellActivated:v,onFillPattern:M,onFinishedEditing:S,coercePasteValue:H,drawHeader:f,drawCell:B,editorBloom:D,onHeaderClicked:O,onColumnProposeMove:T,rangeSelectionColumnSpanning:j=!0,spanRangeBehavior:V="default",onGroupHeaderClicked:Z,onCellContextMenu:J,className:ce,onHeaderContextMenu:le,getCellsForSelection:q,onGroupHeaderContextMenu:Q,onGroupHeaderRenamed:fe,onCellEdited:ee,onCellsEdited:se,onSearchResultsChanged:ie,searchResults:W,onSearchValueChange:N,searchValue:U,onKeyDown:ue,onKeyUp:pe,keybindings:ze,editOnType:Ue=!0,onRowAppended:He,onColumnMoved:$e,validateCell:be,highlightRegions:ye,rangeSelect:Fe="rect",columnSelect:Oe="multi",rowSelect:te="multi",rangeSelectionBlending:Ee="exclusive",columnSelectionBlending:ke="exclusive",rowSelectionBlending:Xe="exclusive",onDelete:Re,onDragStart:qe,onMouseMove:Ye,onPaste:ot,copyHeaders:Me=!1,freezeColumns:Pe=0,cellActivationBehavior:ut="second-click",rowSelectionMode:tt="auto",onHeaderMenuClick:pt,onHeaderIndicatorClick:Ft,getGroupDetails:bt,rowGrouping:Ze,onSearchClose:Yt,onItemHovered:nn,onSelectionCleared:Kt,showSearch:qt,onVisibleRegionChanged:un,gridSelection:jt,onGridSelectionChange:Kn,minColumnWidth:vr=50,maxColumnWidth:Dt=500,maxColumnAutoWidth:tr,provideEditor:_n,trailingRowOptions:ne,freezeTrailingRows:xe=0,allowedFillDirections:wt="orthogonal",scrollOffsetX:dt,scrollOffsetY:xt,verticalBorder:ve,onDragOverCell:Ve,onDrop:Ke,onColumnResize:mt,onColumnResizeEnd:it,onColumnResizeStart:at,customRenderers:vt,fillHandle:Je,experimental:lt,fixedShadowX:rt,fixedShadowY:De,headerIcons:Nt,imageWindowLoader:gn,initialSize:Zt,isDraggable:rn,onDragLeave:Bt,onRowMoved:Xt,overscrollX:Sn,overscrollY:Rt,preventDiagonalScrolling:kn,rightElement:pn,rightElementProps:kt,trapFocus:It=!1,smoothScrollX:Vt,smoothScrollY:Et,scaleToRem:Tt=!1,rowHeight:Qe=34,headerHeight:Jt=36,groupHeaderHeight:Mn=Jt,theme:mn,isOutsideClick:wr,renderers:Ro,resizeIndicator:Ca,scrollToActiveCell:Eo=!0,drawFocusRing:Io=!0}=e,zr=Io==="no-editor"?o===void 0:Io,Ot=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,vn=(Ot==null?void 0:Ot.kind)??e.rowMarkers??"none",gi=(Ot==null?void 0:Ot.width)??e.rowMarkerWidth,To=(Ot==null?void 0:Ot.startIndex)??e.rowMarkerStartIndex??1,nr=(Ot==null?void 0:Ot.theme)??e.rowMarkerTheme,rr=Ot==null?void 0:Ot.headerTheme,qr=Ot==null?void 0:Ot.headerAlwaysVisible,or=te!=="multi"||(Ot==null?void 0:Ot.headerDisabled)===!0,yr=(Ot==null?void 0:Ot.checkboxStyle)??"square",ir=Math.max(vr,20),Ar=Math.max(Dt,ir),pi=Math.max(tr??Ar,ir),Ho=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ge,rowNumberMapper:Oo,rowHeight:mi,getRowThemeOverride:jn}=function(u,R,k,P){const A=$t.useMemo(()=>u===void 0?void 0:ma(u,R),[u,R]),G=$t.useMemo(()=>A==null?void 0:A.reduce((F,oe)=>(F[oe.rowIndex]=oe,F),{}),[A]),$=$t.useMemo(()=>A===void 0?R:A.reduce((F,oe)=>F+(oe.isCollapsed?1:oe.rows+1),0),[A,R]),_=$t.useMemo(()=>u===void 0||typeof k=="number"&&u.height===k?k:F=>G!=null&&G[F]?u.height:typeof k=="number"?k:k(F),[G,u,k]),X=$t.useCallback(F=>{if(A===void 0)return F;let oe=F;for(const re of A){if(oe===0)return;if(oe--,!re.isCollapsed){if(oe<re.rows)return re.contentIndex+oe;oe-=re.rows}}return F},[A]),Y=dr(P??(u==null?void 0:u.themeOverride),$t.useCallback(F=>{if(u===void 0)return P==null?void 0:P(F,F,F);if(P===void 0&&(u==null?void 0:u.themeOverride)===void 0)return;const{isGroupHeader:oe,contentIndex:re,groupIndex:ge}=va(F,A);return oe?u.themeOverride:P==null?void 0:P(F,ge,re)},[A,P,u]));return u===void 0?{rowHeight:_,rows:R,rowNumberMapper:X,getRowThemeOverride:Y}:{rowHeight:_,rows:$,rowNumberMapper:X,getRowThemeOverride:Y}}(Ze,w,Qe,b),Sa=d.useMemo(()=>Number.parseFloat(Ho.fontSize),[Ho]),{rowHeight:Vn,headerHeight:Fr,groupHeaderHeight:Po,theme:Lr,overscrollX:Do,overscrollY:zo}=function({rowHeight:u,headerHeight:R,groupHeaderHeight:k,theme:P,overscrollX:A,overscrollY:G,scaleToRem:$,remSize:_}){const[X,Y,F,oe,re,ge]=$t.useMemo(()=>{if(!$||_===16)return[u,R,k,P,A,G];const we=_/16,je=u,Se=iu();return[typeof je=="number"?je*we:Te=>Math.ceil(je(Te)*we),Math.ceil(R*we),Math.ceil(k*we),{...P,headerIconSize:((P==null?void 0:P.headerIconSize)??Se.headerIconSize)*we,cellHorizontalPadding:((P==null?void 0:P.cellHorizontalPadding)??Se.cellHorizontalPadding)*we,cellVerticalPadding:((P==null?void 0:P.cellVerticalPadding)??Se.cellVerticalPadding)*we},Math.ceil((A??0)*we),Math.ceil((G??0)*we)]},[k,R,A,G,_,u,$,P]);return{rowHeight:X,headerHeight:Y,groupHeaderHeight:F,theme:oe,overscrollX:re,overscrollY:ge}}({groupHeaderHeight:Mn,headerHeight:Jt,overscrollX:Sn,overscrollY:Rt,remSize:Sa,rowHeight:mi,scaleToRem:Tt,theme:mn}),Un=xg(ze),Nn=gi??(w>1e4?48:w>1e3?44:w>100?36:32),wn=vn!=="none",K=wn?1:0,Wt=He!==void 0,L=(ne==null?void 0:ne.sticky)===!0,[ae,de]=d.useState(!1),Ce=qt??ae,he=d.useCallback(()=>{Yt!==void 0?Yt():de(!1)},[Yt]),z=d.useMemo(()=>jt===void 0?void 0:di(jt,K),[jt,K])??n,Ie=d.useRef();Ie.current===void 0&&(Ie.current=new AbortController),d.useEffect(()=>()=>Ie==null?void 0:Ie.current.abort(),[]);const[Le,Be]=function(u,R,k,P,A){const G=d.useCallback(X=>{if(u===!0){const Y=[];for(let F=X.y;F<X.y+X.height;F++){const oe=[];for(let re=X.x;re<X.x+X.width;re++)re<0||F>=A?oe.push({kind:me.Loading,allowOverlay:!1}):oe.push(R([re,F]));Y.push(oe)}return Y}return(u==null?void 0:u(X,P.signal))??[]},[P.signal,R,u,A]),$=u!==void 0?G:void 0,_=d.useCallback(X=>{if($===void 0)return[];const Y={...X,x:X.x-k};if(Y.x<0){Y.x=0,Y.width--;const F=$(Y,P.signal);return typeof F=="function"?async()=>(await F()).map(oe=>[{kind:me.Loading,allowOverlay:!1},...oe]):F.map(oe=>[{kind:me.Loading,allowOverlay:!1},...oe])}return $(Y,P.signal)},[P.signal,$,k]);return[u!==void 0?_:void 0,$]}(q,x,K,Ie.current,Ge),Mt=d.useCallback((u,R,k)=>{if(be===void 0)return!0;const P=[u[0]-K,u[1]];return be==null?void 0:be(P,R,k)},[K,be]),Ae=d.useRef(jt),_e=d.useCallback((u,R)=>{R&&(u=function(k,P,A,G,$){var Y;const _=k;if(G==="allowPartial"||k.current===void 0||P===void 0)return k;let X=!1;do{if((k==null?void 0:k.current)===void 0)break;const F=(Y=k.current)==null?void 0:Y.range,oe=[];if(F.width>2){const we=P({x:F.x,y:F.y,width:1,height:F.height},$.signal);if(typeof we=="function")return _;oe.push(...we);const je=P({x:F.x+F.width-1,y:F.y,width:1,height:F.height},$.signal);if(typeof je=="function")return _;oe.push(...je)}else{const we=P({x:F.x,y:F.y,width:F.width,height:F.height},$.signal);if(typeof we=="function")return _;oe.push(...we)}let re=F.x-A,ge=F.x+F.width-1-A;for(const we of oe)for(const je of we)je.span!==void 0&&(re=Math.min(je.span[0],re),ge=Math.max(je.span[1],ge));re===F.x-A&&ge===F.x+F.width-1-A?X=!0:k={current:{cell:k.current.cell??[0,0],range:{x:re+A,y:F.y,width:ge-re+1,height:F.height},rangeStack:k.current.rangeStack},columns:k.columns,rows:k.rows}}while(!X);return k}(u,Le,K,V,Ie.current)),Kn!==void 0?(Ae.current=di(u,-K),Kn(Ae.current)):r(u)},[Kn,Le,K,V]),et=dr(mt,d.useCallback((u,R,k,P)=>{mt==null||mt(g[k-K],R,k-K,P)},[mt,K,g])),dn=dr(it,d.useCallback((u,R,k,P)=>{it==null||it(g[k-K],R,k-K,P)},[it,K,g])),en=dr(at,d.useCallback((u,R,k,P)=>{at==null||at(g[k-K],R,k-K,P)},[at,K,g])),br=dr(f,d.useCallback((u,R)=>(f==null?void 0:f({...u,columnIndex:u.columnIndex-K},R))??!1,[f,K])),ar=dr(B,d.useCallback((u,R)=>(B==null?void 0:B({...u,col:u.col-K},R))??!1,[B,K])),on=d.useCallback(u=>{if(Re!==void 0){const R=Re(di(u,-K));return typeof R=="boolean"?R:di(R,K)}return!0},[Re,K]),[Lt,Ne,ht]=function(u,R,k,P,A,G,$){return[$t.useCallback((_,X,Y,F)=>{var je;G!=="cell"&&G!=="multi-cell"||_===void 0||(_={..._,range:{x:_.cell[0],y:_.cell[1],width:1,height:1}}),!$&&_!==void 0&&_.range.width>1&&(_={..._,range:{..._.range,width:1,x:_.cell[0]}});const oe=k==="mixed"&&(Y||F==="drag"),re=P==="mixed"&&oe,ge=A==="mixed"&&oe;let we={current:_===void 0?void 0:{..._,rangeStack:F==="drag"?((je=u.current)==null?void 0:je.rangeStack)??[]:[]},columns:re?u.columns:yt.empty(),rows:ge?u.rows:yt.empty()};Y&&(G==="multi-rect"||G==="multi-cell")&&we.current!==void 0&&u.current!==void 0&&(we={...we,current:{...we.current,rangeStack:[...u.current.rangeStack,u.current.range]}}),R(we,X)},[P,u,k,G,$,A,R]),$t.useCallback((_,X,Y)=>{let F;if(_=_??u.rows,X!==void 0&&(_=_.add(X)),A==="exclusive"&&_.length>0)F={current:void 0,columns:yt.empty(),rows:_};else{const oe=Y&&P==="mixed";F={current:Y&&k==="mixed"?u.current:void 0,columns:oe?u.columns:yt.empty(),rows:_}}R(F,!1)},[P,u,k,A,R]),$t.useCallback((_,X,Y)=>{let F;if(_=_??u.columns,X!==void 0&&(_=_.add(X)),P==="exclusive"&&_.length>0)F={current:void 0,rows:yt.empty(),columns:_};else{const oe=Y&&A==="mixed";F={current:Y&&k==="mixed"?u.current:void 0,rows:oe?u.rows:yt.empty(),columns:_}}R(F,!1)},[P,u,k,A,R])]}(z,_e,Ee,ke,Xe,Fe,j),gt=d.useMemo(()=>Zn(iu(),Lr),[Lr]),[yn,an]=d.useState([0,0,0]),lr=d.useMemo(()=>{if(Ro===void 0)return{};const u={};for(const R of Ro)u[R.kind]=R;return u},[Ro]),Ht=d.useCallback(u=>u.kind!==me.Custom?lr[u.kind]:vt==null?void 0:vt.find(R=>R.isMatch(u)),[vt,lr]);let{sizedColumns:hn,nonGrowWidth:vi}=function(u,R,k,P,A,G,$,_,X){const Y=d.useRef(R),F=d.useRef(k),oe=d.useRef($);Y.current=R,F.current=k,oe.current=$;const[re,ge]=d.useMemo(()=>{if(typeof window>"u")return[null,null];const We=document.createElement("canvas");return We.style.display="none",We.style.opacity="0",We.style.position="fixed",[We,We.getContext("2d",{alpha:!1})]},[]);d.useLayoutEffect(()=>(re&&document.documentElement.append(re),()=>{re==null||re.remove()}),[re]);const we=d.useRef({}),je=d.useRef(),[Se,Te]=d.useState();return d.useLayoutEffect(()=>{const We=F.current;if(We===void 0||u.every(ei))return;let _t=Math.max(1,10-Math.floor(u.length/1e4)),Ut=0;_t<Y.current&&_t>1&&(_t--,Ut=1);const tn={x:0,y:0,width:u.length,height:Math.min(Y.current,_t)},St={x:0,y:Y.current-1,width:u.length,height:1};(async()=>{const At=We(tn,X.signal),sn=Ut>0?We(St,X.signal):void 0;let xn;xn=typeof At=="object"?At:await Zs(At),sn!==void 0&&(xn=typeof sn=="object"?[...xn,...sn]:[...xn,...await Zs(sn)]),je.current=u,Te(xn)})()},[X.signal,u]),d.useMemo(()=>{let We=u.every(ei)?u:ge===null?u.map(St=>ei(St)?St:{...St,width:150}):(ge.font=oe.current.baseFontFull,u.map((St,At)=>{if(ei(St))return St;if(we.current[St.id]!==void 0)return{...St,width:we.current[St.id]};if(Se===void 0||je.current!==u||St.id===void 0)return{...St,width:150};const sn=au(ge,$,St,At,Se,A,G,!0,_);return we.current[St.id]=sn.width,sn})),_t=0,Ut=0;const tn=[];for(const[St,At]of We.entries())_t+=At.width,At.grow!==void 0&&At.grow>0&&(Ut+=At.grow,tn.push(St));if(_t<P&&tn.length>0){const St=[...We],At=P-_t;let sn=At;for(let xn=0;xn<tn.length;xn++){const cr=tn[xn],Xo=(We[cr].grow??0)/Ut,Aa=xn===tn.length-1?sn:Math.min(sn,Math.floor(At*Xo));St[cr]={...We[cr],growOffset:Aa,width:We[cr].width+Aa},sn-=Aa}We=St}return{sizedColumns:We,nonGrowWidth:_t}},[P,u,ge,Se,$,A,G,_])}(g,Ge,Be,yn[0]-(K===0?0:Nn)-yn[2],ir,pi,gt,Ht,Ie.current);vn!=="none"&&(vi+=Nn);const Jr=d.useMemo(()=>hn.some(u=>u.group!==void 0),[hn]),sr=Jr?Fr+Po:Fr,Ao=z.rows.length,Fo=vn==="none"?void 0:Ao!==0&&(Ao===Ge||void 0),Ct=d.useMemo(()=>vn==="none"?hn:[{title:"",width:Nn,icon:void 0,hasMenu:!1,style:"normal",themeOverride:nr,rowMarker:yr,rowMarkerChecked:Fo,headerRowMarkerTheme:rr,headerRowMarkerAlwaysVisible:qr,headerRowMarkerDisabled:or},...hn],[vn,hn,Nn,nr,yr,Fo,rr,qr,or]),Gt=d.useRef({height:1,width:1,x:0,y:0}),Dn=d.useRef(!1),{setVisibleRegion:Lo,visibleRegion:_r,scrollRef:zt}=Sg(dt,xt,Vn,Gt,()=>Dn.current=!0);Gt.current=_r;const lp=_r.x+K,wi=_r.y,ln=d.useRef(null),bn=d.useCallback(u=>{var R;u===!0?(R=ln.current)==null||R.focus():window.requestAnimationFrame(()=>{var k;(k=ln.current)==null||k.focus()})},[]),fn=Wt?Ge+1:Ge,zn=d.useCallback(u=>{const R=K===0?u:u.map(P=>({...P,location:[P.location[0]-K,P.location[1]]})),k=se==null?void 0:se(R);if(k!==!0)for(const P of R)ee==null||ee(P.location,P.value);return k},[ee,se,K]),[jr,ka]=d.useState(),yi=z.current!==void 0&&z.current.range.width*z.current.range.height>1?z.current.range:void 0,Qr=zr?(z0=z.current)==null?void 0:z0.cell:void 0,bi=Qr==null?void 0:Qr[0],xi=Qr==null?void 0:Qr[1],sp=d.useMemo(()=>{if((ye===void 0||ye.length===0)&&(yi??bi??xi??jr)===void 0)return;const u=[];if(ye!==void 0)for(const R of ye){const k=Ct.length-R.range.x-K;k>0&&u.push({color:R.color,range:{...R.range,x:R.range.x+K,width:Math.min(k,R.range.width)},style:R.style})}return jr!==void 0&&u.push({color:Hr(gt.accentColor,0),range:jr,style:"dashed"}),yi!==void 0&&u.push({color:Hr(gt.accentColor,.5),range:yi,style:"solid-outline"}),bi!==void 0&&xi!==void 0&&u.push({color:gt.accentColor,range:{x:bi,y:xi,width:1,height:1},style:"solid-outline"}),u.length>0?u:void 0},[jr,yi,bi,xi,ye,Ct.length,gt.accentColor,K]),b0=d.useRef(Ct);b0.current=Ct;const Tn=d.useCallback(([u,R],k=!1)=>{var A,G,$,_,X,Y,F;const P=Wt&&R===fn-1;if(u===0&&wn){if(P)return hi;const oe=Oo(R);return oe===void 0?hi:{kind:Hn.Marker,allowOverlay:!1,checkboxStyle:yr,checked:(z==null?void 0:z.rows.hasIndex(R))===!0,markerKind:vn==="clickable-number"?"number":vn,row:To+oe,drawHandle:Xt!==void 0,cursor:vn==="clickable-number"?"pointer":void 0}}if(P){const oe=u===K?(ne==null?void 0:ne.hint)??"":"",re=b0.current[u];if(((A=re==null?void 0:re.trailingRowOptions)==null?void 0:A.disabled)===!0)return hi;{const ge=((G=re==null?void 0:re.trailingRowOptions)==null?void 0:G.hint)??oe,we=(($=re==null?void 0:re.trailingRowOptions)==null?void 0:$.addIcon)??(ne==null?void 0:ne.addIcon);return{kind:Hn.NewRow,hint:ge,allowOverlay:!1,icon:we}}}{const oe=u-K;if(k||(lt==null?void 0:lt.strict)===!0){const ge=Gt.current,we=ge.x>oe||oe>ge.x+ge.width||ge.y>R||R>ge.y+ge.height||R>=Ra.current,je=oe===((X=(_=ge.extras)==null?void 0:_.selected)==null?void 0:X[0])&&R===((Y=ge.extras)==null?void 0:Y.selected[1]);let Se=!1;if(((F=ge.extras)==null?void 0:F.freezeRegions)!==void 0){for(const Te of ge.extras.freezeRegions)if(Dr(Te,oe,R)){Se=!0;break}}if(we&&!je&&!Se)return hi}let re=x([oe,R]);return K!==0&&re.span!==void 0&&(re={...re,span:[re.span[0]+K,re.span[1]+K]}),re}},[Wt,fn,wn,Oo,yr,z==null?void 0:z.rows,vn,To,Xt,K,ne==null?void 0:ne.hint,ne==null?void 0:ne.addIcon,lt==null?void 0:lt.strict,x]),Ma=d.useCallback(u=>{let R=(bt==null?void 0:bt(u))??{name:u};return fe!==void 0&&u!==""&&(R={icon:R.icon,name:R.name,overrideTheme:R.overrideTheme,actions:[...R.actions??[],{title:"Rename",icon:"renameIcon",onClick:k=>Ia({group:R.name,bounds:k.bounds})}]}),R},[bt,fe]),Ci=d.useCallback(u=>{var _;const[R,k]=u.cell,P=Ct[R],A=(P==null?void 0:P.group)!==void 0?(_=Ma(P.group))==null?void 0:_.overrideTheme:void 0,G=P==null?void 0:P.themeOverride,$=jn==null?void 0:jn(k);i({...u,theme:Zn(gt,A,G,$,u.content.themeOverride)})},[jn,Ct,Ma,gt]),Zr=d.useCallback((u,R,k)=>{var $;if(z.current===void 0)return;const[P,A]=z.current.cell,G=Tn([P,A]);if(G.kind!==me.Boolean&&G.allowOverlay){let _=G;if(k!==void 0)switch(_.kind){case me.Number:{const X=function(Y,F){try{return Y()}catch{return F}}(()=>k==="-"?-0:Number.parseFloat(k),0);_={..._,data:Number.isNaN(X)?0:X};break}case me.Text:case me.Markdown:case me.Uri:_={..._,data:k}}Ci({target:u,content:_,initialValue:k,cell:[P,A],highlight:k===void 0,forceEditMode:k!==void 0})}else G.kind===me.Boolean&&R&&G.readonly!==!0&&(zn([{location:z.current.cell,value:{...G,data:r0(G.data)}}]),($=ln.current)==null||$.damage([{cell:z.current.cell}]))},[Tn,z,zn,Ci]),x0=d.useCallback((u,R)=>{var A;const k=(A=ln.current)==null?void 0:A.getBounds(u,R);if(k===void 0||zt.current===null)return;const P=Tn([u,R]);P.allowOverlay&&Ci({target:k,content:P,initialValue:void 0,highlight:!0,cell:[u,R],forceEditMode:!0})},[Tn,zt,Ci]),Qt=d.useCallback((u,R,k="both",P=0,A=0,G=void 0)=>{if(zt.current!==null){const $=ln.current,_=a.current,X=typeof u!="number"?u.unit==="cell"?u.amount:void 0:u,Y=typeof R!="number"?R.unit==="cell"?R.amount:void 0:R,F=typeof u!="number"&&u.unit==="px"?u.amount:void 0,oe=typeof R!="number"&&R.unit==="px"?R.amount:void 0;if($!==null&&_!==null){let re={x:0,y:0,width:0,height:0},ge=0,we=0;if((X!==void 0||Y!==void 0)&&(re=$.getBounds((X??0)+K,Y??0)??re,re.width===0||re.height===0))return;const je=_.getBoundingClientRect(),Se=je.width/_.offsetWidth;if(F!==void 0&&(re={...re,x:F-je.left-zt.current.scrollLeft,width:1}),oe!==void 0&&(re={...re,y:oe+je.top-zt.current.scrollTop,height:1}),re!==void 0){const Te={x:re.x-P,y:re.y-A,width:re.width+2*P,height:re.height+2*A};let We=0;for(let Xo=0;Xo<Pe;Xo++)We+=hn[Xo].width;let _t=0;const Ut=xe+(L?1:0);Ut>0&&(_t=Or(fn,Ut,Vn));let tn=We*Se+je.left+K*Nn*Se,St=je.right,At=je.top+sr*Se,sn=je.bottom-_t*Se;const xn=re.width+2*P;switch(G==null?void 0:G.hAlign){case"start":St=tn+xn;break;case"end":tn=St-xn;break;case"center":tn=Math.floor((tn+St)/2)-xn/2,St=tn+xn}const cr=re.height+2*A;switch(G==null?void 0:G.vAlign){case"start":sn=At+cr;break;case"end":At=sn-cr;break;case"center":At=Math.floor((At+sn)/2)-cr/2,sn=At+cr}tn>Te.x?ge=Te.x-tn:St<Te.x+Te.width&&(ge=Te.x+Te.width-St),At>Te.y?we=Te.y-At:sn<Te.y+Te.height&&(we=Te.y+Te.height-sn),k==="vertical"||typeof u=="number"&&u<Pe?ge=0:(k==="horizontal"||typeof R=="number"&&R>=fn-Ut)&&(we=0),ge===0&&we===0||(Se!==1&&(ge/=Se,we/=Se),zt.current.scrollTo({left:ge+zt.current.scrollLeft,top:we+zt.current.scrollTop,behavior:(G==null?void 0:G.behavior)??"auto"}))}}}},[K,xe,Nn,zt,sr,Pe,hn,fn,L,Vn]),C0=d.useRef(x0),S0=d.useRef(x),Ra=d.useRef(Ge);C0.current=x0,S0.current=x,Ra.current=Ge;const eo=d.useCallback(async(u,R=!0,k)=>{var Y;const P=Ct[u];if(((Y=P==null?void 0:P.trailingRowOptions)==null?void 0:Y.disabled)===!0)return;const A=He==null?void 0:He();let G,$=!0;A!==void 0&&(G=await A,G==="top"&&($=!1),typeof G=="number"&&($=!1));let _=0;const X=()=>{if(Ra.current<=Ge)return _<500&&window.setTimeout(X,_),void(_=50+2*_);const F=typeof G=="number"?G:$?Ge:0;Ii.current(u-K,F,"both",0,0,k?{behavior:k}:void 0),Lt({cell:[u,F],range:{x:u,y:F,width:1,height:1}},!1,!1,"edit");const oe=S0.current([u-K,F]);oe.allowOverlay&&so(oe)&&oe.readonly!==!0&&R&&window.setTimeout(()=>{C0.current(u,F)},0)};X()},[Ct,He,K,Ge,Lt]),Si=d.useCallback(u=>{var k,P;const R=((P=(k=hn[u])==null?void 0:k.trailingRowOptions)==null?void 0:P.targetColumn)??(ne==null?void 0:ne.targetColumn);if(typeof R=="number")return R+(wn?1:0);if(typeof R=="object"){const A=g.indexOf(R);if(A>=0)return A+(wn?1:0)}},[hn,g,wn,ne==null?void 0:ne.targetColumn]),xr=d.useRef(),to=d.useRef(),_o=d.useCallback((u,R)=>{var A;const[k,P]=R;return Zn(gt,(A=Ct[k])==null?void 0:A.themeOverride,jn==null?void 0:jn(P),u.themeOverride)},[jn,Ct,gt]),{mapper:Nr}=function(u,R){const k=$t.useMemo(()=>u===void 0?void 0:ma(u,R),[u,R]);return{getRowGroupingForPath:l0,updateRowGroupingByPath:a0,mapper:$t.useCallback(P=>{if(typeof P=="number")return va(P,k);const A=va(P[1],k);return{...A,originalIndex:[P[0],A.originalIndex]}},[k])}}(Ze,w),Bn=Ze==null?void 0:Ze.navigationBehavior,jo=d.useCallback(u=>{var F,oe,re;const R=ci.value?u.metaKey:u.ctrlKey,k=R&&te==="multi",P=R&&Oe==="multi",[A,G]=u.location,$=z.columns,_=z.rows,[X,Y]=((F=z.current)==null?void 0:F.cell)??[];if(u.kind==="cell"){if(to.current=void 0,Br.current=[A,G],A===0&&wn){if(Wt===!0&&G===Ge||vn==="number"||te==="none")return;const ge=Tn(u.location);if(ge.kind!==Hn.Marker)return;if(Xt!==void 0){const Se=Ht(ge);Rn((Se==null?void 0:Se.kind)===Hn.Marker);const Te=(oe=Se==null?void 0:Se.onClick)==null?void 0:oe.call(Se,{...u,cell:ge,posX:u.localEventX,posY:u.localEventY,bounds:u.bounds,theme:_o(ge,u.location),preventDefault:()=>{}});if(Te===void 0||Te.checked===ge.checked)return}i(void 0),bn();const we=_.hasIndex(G),je=xr.current;if(te==="multi"&&(u.shiftKey||u.isLongTouch===!0)&&je!==void 0&&_.hasIndex(je)){const Se=[Math.min(je,G),Math.max(je,G)+1];k||tt==="multi"?Ne(void 0,Se,!0):Ne(yt.fromSingleSelection(Se),void 0,k)}else te==="multi"&&(k||u.isTouch||tt==="multi")?we?Ne(_.remove(G),void 0,!0):(Ne(void 0,G,!0),xr.current=G):we&&_.length===1?Ne(yt.empty(),void 0,R):(Ne(yt.fromSingleSelection(G),void 0,R),xr.current=G)}else if(A>=K&&Wt&&G===Ge){const ge=Si(A);eo(ge??A)}else if(X!==A||Y!==G){const ge=Tn(u.location),we=Ht(ge);if((we==null?void 0:we.onSelect)!==void 0){let Te=!1;if(we.onSelect({...u,cell:ge,posX:u.localEventX,posY:u.localEventY,bounds:u.bounds,preventDefault:()=>Te=!0,theme:_o(ge,u.location)}),Te)return}if(Bn==="block"&&Nr(G).isGroupHeader)return;const je=L&&G===Ge,Se=L&&z!==void 0&&((re=z.current)==null?void 0:re.cell[1])===Ge;if(!u.shiftKey&&u.isLongTouch!==!0||X===void 0||Y===void 0||z.current===void 0||Se)Lt({cell:[A,G],range:{x:A,y:G,width:1,height:1}},!0,R,"click"),xr.current=void 0,i(void 0),bn();else{if(je)return;const Te=Math.min(A,X),We=Math.max(A,X),_t=Math.min(G,Y),Ut=Math.max(G,Y);Lt({...z.current,range:{x:Te,y:_t,width:We-Te+1,height:Ut-_t+1}},!0,R,"click"),xr.current=void 0,bn()}}}else if(u.kind==="header")if(Br.current=[A,G],i(void 0),wn&&A===0)xr.current=void 0,to.current=void 0,or||te!=="multi"||(_.length!==Ge?Ne(yt.fromSingleSelection([0,Ge]),void 0,R):Ne(yt.empty(),void 0,R),bn());else{const ge=to.current;if(Oe==="multi"&&(u.shiftKey||u.isLongTouch===!0)&&ge!==void 0&&$.hasIndex(ge)){const we=[Math.min(ge,A),Math.max(ge,A)+1];P?ht(void 0,we,R):ht(yt.fromSingleSelection(we),void 0,R)}else P?($.hasIndex(A)?ht($.remove(A),void 0,R):ht(void 0,A,R),to.current=A):Oe!=="none"&&($.hasIndex(A)?ht($.remove(A),void 0,R):ht(yt.fromSingleSelection(A),void 0,R),to.current=A);xr.current=void 0,bn()}else u.kind===Pn?Br.current=[A,G]:u.kind!==ui||u.isMaybeScrollbar||(_e(fi,!1),i(void 0),bn(),Kt==null||Kt(),xr.current=void 0,to.current=void 0)},[te,Oe,z,wn,K,Wt,Ge,vn,Tn,Xt,bn,tt,Ht,_o,Ne,Si,eo,Bn,Nr,L,Lt,ht,_e,Kt]),No=d.useRef(!1),Br=d.useRef(),k0=d.useRef(_r),An=d.useRef(),cp=d.useCallback(u=>{if(no.current=!1,k0.current=Gt.current,u.button!==0&&u.button!==1)return void(An.current=void 0);const R=performance.now();An.current={button:u.button,time:R,location:u.location},(u==null?void 0:u.kind)==="header"&&(No.current=!0);const k=u.kind==="cell"&&u.isFillHandle;!k&&u.kind!=="cell"&&u.isEdge||(c({previousSelection:z,fillHandle:k}),Br.current=void 0,u.isTouch||u.button!==0||k?u.isTouch||u.button!==1||(Br.current=u.location):jo(u))},[z,jo]),[Ea,Ia]=d.useState(),M0=d.useCallback(u=>{if(u.kind!==Pn||Oe!=="multi")return;const R=ci.value?u.metaKey:u.ctrlKey,[k]=u.location,P=z.columns;if(k<K)return;const A=Ct[k];let G=k,$=k;for(let _=k-1;_>=K&&mo(A.group,Ct[_].group);_--)G--;for(let _=k+1;_<Ct.length&&mo(A.group,Ct[_].group);_++)$++;if(bn(),R)if(P.hasAll([G,$+1])){let _=P;for(let X=G;X<=$;X++)_=_.remove(X);ht(_,void 0,R)}else ht(void 0,[G,$+1],R);else ht(yt.fromSingleSelection([G,$+1]),void 0,R)},[Oe,bn,z.columns,Ct,K,ht]),no=d.useRef(!1),ki=d.useCallback(async u=>{if(Le!==void 0&&et!==void 0){const R=Gt.current.y,k=Gt.current.height;let P=Le({x:u,y:R,width:1,height:Math.min(k,Ge-R)},Ie.current.signal);typeof P!="object"&&(P=await P());const A=hn[u-K],G=document.createElement("canvas").getContext("2d",{alpha:!1});if(G!==null){G.font=gt.baseFontFull;const $=au(G,gt,A,0,P,ir,Ar,!1,Ht);et==null||et(A,$.width,u,$.width)}}},[hn,Le,Ar,gt,ir,et,K,Ge,Ht]),[up,Ta]=d.useState(),ro=d.useCallback(async(u,R)=>{var _,X;const k=(_=u.current)==null?void 0:_.range;if(k===void 0||Le===void 0||R.current===void 0)return;const P=R.current.range;if(M!==void 0){let Y=!1;if(M({fillDestination:{...P,x:P.x-K},patternSource:{...k,x:k.x-K},preventDefault:()=>Y=!0}),Y)return}let A=Le(k,Ie.current.signal);typeof A!="object"&&(A=await A());const G=A,$=[];for(let Y=0;Y<P.width;Y++)for(let F=0;F<P.height;F++){const oe=[P.x+Y,P.y+F];if(Yc(oe,k))continue;const re=G[F%k.height][Y%k.width];!kr(re)&&so(re)&&$.push({location:oe,value:{...re}})}zn($),(X=ln.current)==null||X.damage($.map(Y=>({cell:Y.location})))},[Le,zn,M,K]),R0=d.useCallback(()=>{if(z.current===void 0||z.current.range.width<=1)return;const u={...z,current:{...z.current,range:{...z.current.range,width:1}}};ro(u,z)},[ro,z]),E0=d.useCallback(()=>{if(z.current===void 0||z.current.range.height<=1)return;const u={...z,current:{...z.current,range:{...z.current.range,height:1}}};ro(u,z)},[ro,z]),dp=d.useCallback((u,R)=>{var F,oe;const k=s;if(c(void 0),ka(void 0),Ta(void 0),No.current=!1,R)return;if((k==null?void 0:k.fillHandle)===!0&&z.current!==void 0&&((F=k.previousSelection)==null?void 0:F.current)!==void 0){if(jr===void 0)return;const re={...z,current:{...z.current,range:md(k.previousSelection.current.range,jr)}};return ro(k.previousSelection,re),void _e(re,!0)}const[P,A]=u.location,[G,$]=Br.current??[],_=()=>{no.current=!0},X=re=>{var we,je,Se;const ge=re.isTouch||G===P&&$===A;if(ge&&(I==null||I([P-K,A],{...re,preventDefault:_})),re.button===1)return!no.current;if(!no.current){const Te=Tn(u.location),We=Ht(Te);if(We!==void 0&&We.onClick!==void 0&&ge){const Ut=We.onClick({...re,cell:Te,posX:re.localEventX,posY:re.localEventY,bounds:re.bounds,theme:_o(Te,u.location),preventDefault:_});Ut!==void 0&&!kr(Ut)&&Mr(Ut)&&(zn([{location:re.location,value:Ut}]),(we=ln.current)==null||we.damage([{cell:re.location}]))}if(no.current||z.current===void 0)return!1;let _t=!1;switch(Te.activationBehaviorOverride??ut){case"double-click":case"second-click":{if(((Se=(je=k==null?void 0:k.previousSelection)==null?void 0:je.current)==null?void 0:Se.cell)===void 0)break;const[Ut,tn]=z.current.cell,[St,At]=k.previousSelection.current.cell;_t=P===Ut&&P===St&&A===tn&&A===At&&(re.isDoubleClick===!0||ut==="second-click");break}case"single-click":_t=!0}if(_t)return v==null||v([P-K,A]),Zr(re.bounds,!1),!0}return!1},Y=u.location[0]-K;if(u.isTouch){const re=Gt.current,ge=k0.current;if(re.x!==ge.x||re.y!==ge.y)return;if(u.isLongTouch===!0){if(u.kind==="cell"&&vo((oe=z.current)==null?void 0:oe.cell,u.location))return void(J==null?void 0:J([Y,u.location[1]],{...u,preventDefault:_}));if(u.kind==="header"&&z.columns.hasIndex(P))return void(le==null?void 0:le(Y,{...u,preventDefault:_}));if(u.kind===Pn)return Y<0?void 0:void(Q==null?void 0:Q(Y,{...u,preventDefault:_}))}return void(u.kind==="cell"?X(u)||jo(u):u.kind===Pn?Z==null?void 0:Z(Y,{...u,preventDefault:_}):(u.kind===pr&&(O==null||O(Y,{...u,preventDefault:_})),jo(u)))}if(u.kind==="header"){if(Y<0)return;u.isEdge?u.isDoubleClick===!0&&ki(P):u.button===0&&P===G&&A===$&&(O==null||O(Y,{...u,preventDefault:_}))}if(u.kind===Pn){if(Y<0)return;u.button===0&&P===G&&A===$&&(Z==null||Z(Y,{...u,preventDefault:_}),no.current||M0(u))}u.kind!=="cell"||u.button!==0&&u.button!==1||X(u),Br.current=void 0},[s,z,K,jr,ro,_e,I,Tn,Ht,ut,_o,zn,v,Zr,J,le,Q,jo,Z,O,ki,M0]),hp=d.useCallback(u=>{const R={...u,location:[u.location[0]-K,u.location[1]]};Ye==null||Ye(R),s!==void 0&&u.buttons===0&&(c(void 0),ka(void 0),Ta(void 0),No.current=!1),Ta(k=>{var P;return No.current?[u.scrollEdge[0],0]:u.scrollEdge[0]===(k==null?void 0:k[0])&&u.scrollEdge[1]===k[1]?k:s===void 0||(((P=An.current)==null?void 0:P.location[0])??0)<K?void 0:u.scrollEdge})},[s,Ye,K]),fp=d.useCallback((u,R)=>{pt==null||pt(u-K,R)},[pt,K]),gp=d.useCallback((u,R)=>{Ft==null||Ft(u-K,R)},[Ft,K]),qn=(A0=z==null?void 0:z.current)==null?void 0:A0.cell,pp=d.useCallback((u,R,k,P,A,G)=>{Dn.current=!1;let $=qn;$!==void 0&&($=[$[0]-K,$[1]]);const _=Pe===0?void 0:{x:0,y:u.y,width:Pe,height:u.height},X=[];_!==void 0&&X.push(_),xe>0&&(X.push({x:u.x-K,y:Ge-xe,width:u.width,height:xe}),Pe>0&&X.push({x:0,y:Ge-xe,width:Pe,height:xe}));const Y={x:u.x-K,y:u.y,width:u.width,height:Wt&&u.y+u.height>=Ge?u.height-1:u.height,tx:A,ty:G,extras:{selected:$,freezeRegion:_,freezeRegions:X}};Gt.current=Y,Lo(Y),an([R,k,P]),un==null||un(Y,Y.tx,Y.ty,Y.extras)},[qn,K,Wt,Ge,Pe,xe,Lo,un]),mp=dr(T,d.useCallback((u,R)=>(T==null?void 0:T(u-K,R-K))!==!1,[T,K])),vp=dr($e,d.useCallback((u,R)=>{$e==null||$e(u-K,R-K),Oe!=="none"&&ht(yt.fromSingleSelection(R),void 0,!0)},[Oe,$e,K,ht])),Ha=d.useRef(!1),wp=d.useCallback(u=>{u.location[0]===0&&K>0?u.preventDefault():(qe==null||qe({...u,location:[u.location[0]-K,u.location[1]]}),u.defaultPrevented()||(Ha.current=!0),c(void 0))},[qe,K]),yp=d.useCallback(()=>{Ha.current=!1},[]),I0=Ze==null?void 0:Ze.selectionBehavior,Mi=d.useCallback(u=>{if(I0!=="block-spanning")return;const{isGroupHeader:R,path:k,groupRows:P}=Nr(u);if(R)return[u,u];const A=k[k.length-1];return[u-A,u+P-A-1]},[Nr,I0]),Oa=d.useRef(),Pa=d.useCallback(u=>{var R,k,P;if(!(qf(u,Oa.current)||(Oa.current=u,((R=An==null?void 0:An.current)==null?void 0:R.button)!==void 0&&An.current.button>=1))){if(u.buttons!==0&&s!==void 0&&((k=An.current)==null?void 0:k.location[0])===0&&u.location[0]===0&&K===1&&te==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(An.current.location[1])&&z.rows.hasIndex(An.current.location[1])){const A=Math.min(An.current.location[1],u.location[1]),G=Math.max(An.current.location[1],u.location[1])+1;Ne(yt.fromSingleSelection([A,G]),void 0,!1)}if(!(u.buttons===0||s===void 0||z.current===void 0||Ha.current||No.current||Fe!=="rect"&&Fe!=="multi-rect")){const[A,G]=z.current.cell;let[$,_]=u.location;if(_<0&&(_=Gt.current.y),s.fillHandle===!0&&((P=s.previousSelection)==null?void 0:P.current)!==void 0){const X=s.previousSelection.current.range;_=Math.min(_,Wt?Ge-1:Ge);const Y=function(F,oe,re,ge){if(ge==="any")return md(F,{x:oe,y:re,width:1,height:1});if(ge==="vertical"&&(oe=F.x),ge==="horizontal"&&(re=F.y),Yc([oe,re],F))return;const we=oe-F.x,je=F.x+F.width-oe,Se=re-F.y+1,Te=F.y+F.height-re,We=Math.min(ge==="vertical"?Number.MAX_SAFE_INTEGER:we,ge==="vertical"?Number.MAX_SAFE_INTEGER:je,ge==="horizontal"?Number.MAX_SAFE_INTEGER:Se,ge==="horizontal"?Number.MAX_SAFE_INTEGER:Te);return We===Te?{x:F.x,y:F.y+F.height,width:F.width,height:re-F.y-F.height+1}:We===Se?{x:F.x,y:re,width:F.width,height:F.y-re}:We===je?{x:F.x+F.width,y:F.y,width:oe-F.x-F.width+1,height:F.height}:{x:oe,y:F.y,width:F.x-oe,height:F.height}}(X,$,_,wt);ka(Y)}else{if(Wt&&G===Ge)return;if(Wt&&_===Ge){if(u.kind!==ui)return;_--}$=Math.max($,K);const X=Mi(G);_=X===void 0?_:On(_,X[0],X[1]);const Y=$-A,F=_-G,oe={x:Y>=0?A:$,y:F>=0?G:_,width:Math.abs(Y)+1,height:Math.abs(F)+1};Lt({...z.current,range:oe},!0,!1,"drag")}}nn==null||nn({...u,location:[u.location[0]-K,u.location[1]]})}},[s,K,te,z,Fe,nn,Ne,Wt,Ge,wt,Mi,Lt]),bp=d.useCallback(()=>{var $,_;const u=Oa.current;if(u===void 0)return;const[R,k]=u.scrollEdge;let[P,A]=u.location;const G=Gt.current;R===-1?P=((_=($=G.extras)==null?void 0:$.freezeRegion)==null?void 0:_.x)??G.x:R===1&&(P=G.x+G.width),k===-1?A=Math.max(0,G.y):k===1&&(A=Math.min(Ge-1,G.y+G.height)),P=On(P,0,Ct.length-1),A=On(A,0,Ge-1),Pa({...u,location:[P,A]})},[Ct.length,Pa,Ge]);(function(u,R,k){const P=$t.useRef(0),[A,G]=u??[0,0];$t.useEffect(()=>{if(A===0&&G===0)return void(P.current=0);let $=!1,_=0;const X=Y=>{var F;if(!$){if(_===0)_=Y;else{const oe=Y-_;P.current=Math.min(1,P.current+oe/1300);const re=P.current**1.618*oe*2;(F=R.current)==null||F.scrollBy(A*re,G*re),_=Y,k==null||k()}window.requestAnimationFrame(X)}};return window.requestAnimationFrame(X),()=>{$=!0}},[R,A,G,k])})(up,zt,bp);const Wn=d.useCallback(u=>{if(z.current===void 0)return;const[R,k]=u,[P,A]=z.current.cell,G=z.current.range;let $=G.x,_=G.x+G.width,X=G.y,Y=G.y+G.height;const[F,oe]=Mi(A)??[0,Ge-1],re=oe+1;if(k!==0)switch(k){case 2:Y=re,X=A,Qt(0,Y,"vertical");break;case-2:X=F,Y=A+1,Qt(0,X,"vertical");break;case 1:X<A?(X++,Qt(0,X,"vertical")):(Y=Math.min(re,Y+1),Qt(0,Y,"vertical"));break;case-1:Y>A+1?(Y--,Qt(0,Y,"vertical")):(X=Math.max(F,X-1),Qt(0,X,"vertical"));break;default:lo()}if(R!==0)if(R===2)_=Ct.length,$=P,Qt(_-1-K,0,"horizontal");else if(R===-2)$=K,_=P+1,Qt($-K,0,"horizontal");else{let ge=[];if(Le!==void 0){const we=Le({x:$,y:X,width:_-$-K,height:Y-X},Ie.current.signal);typeof we=="object"&&(ge=function(je){return S1(Zu(Zu(je).filter(Se=>Se.span!==void 0).map(Se=>{var Te,We;return Pr((((Te=Se.span)==null?void 0:Te[0])??0)+1,(((We=Se.span)==null?void 0:We[1])??0)+1)})))}(we))}if(R===1){let we=!1;if($<P){if(ge.length>0){const je=Pr($+1,P+1).find(Se=>!ge.includes(Se-K));je!==void 0&&($=je,we=!0)}else $++,we=!0;we&&Qt($,0,"horizontal")}we||(_=Math.min(Ct.length,_+1),Qt(_-1-K,0,"horizontal"))}else if(R===-1){let we=!1;if(_>P+1){if(ge.length>0){const je=Pr(_-1,P,-1).find(Se=>!ge.includes(Se-K));je!==void 0&&(_=je,we=!0)}else _--,we=!0;we&&Qt(_-K,0,"horizontal")}we||($=Math.max(K,$-1),Qt($-K,0,"horizontal"))}else lo()}Lt({cell:z.current.cell,range:{x:$,y:X,width:_-$,height:Y-X}},!0,!1,"keyboard-select")},[Le,Mi,z,Ct.length,K,Ge,Qt,Lt]),Da=d.useRef(Eo);Da.current=Eo;const Cr=d.useCallback((u,R,k,P)=>{const A=fn-(k?0:1);u=On(u,K,hn.length-1+K),R=On(R,0,A);const G=qn==null?void 0:qn[0],$=qn==null?void 0:qn[1];if(u===G&&R===$)return!1;if(P&&z.current!==void 0){const _=[...z.current.rangeStack];(z.current.range.width>1||z.current.range.height>1)&&_.push(z.current.range),_e({...z,current:{cell:[u,R],range:{x:u,y:R,width:1,height:1},rangeStack:_}},!0)}else Lt({cell:[u,R],range:{x:u,y:R,width:1,height:1}},!0,!1,"keyboard-nav");return h.current!==void 0&&h.current[0]===u&&h.current[1]===R&&(h.current=void 0),Da.current&&Qt(u-K,R),!0},[fn,K,hn.length,qn,z,Qt,_e,Lt]),xp=d.useCallback((u,R)=>{(o==null?void 0:o.cell)!==void 0&&u!==void 0&&Mr(u)&&(zn([{location:o.cell,value:u}]),window.requestAnimationFrame(()=>{var A;(A=ln.current)==null||A.damage([{cell:o.cell}])})),bn(!0),i(void 0);const[k,P]=R;if(z.current!==void 0&&(k!==0||P!==0)){const A=z.current.cell[1]===fn-1&&u!==void 0;Cr(On(z.current.cell[0]+k,0,Ct.length-1),On(z.current.cell[1]+P,0,fn-1),A,!1)}S==null||S(u,R)},[o==null?void 0:o.cell,bn,z,S,zn,fn,Cr,Ct.length]),Cp=d.useMemo(()=>"gdg-overlay-"+Mg++,[]),Wr=d.useCallback(u=>{var k,P,A,G;bn();const R=[];for(let $=u.x;$<u.x+u.width;$++)for(let _=u.y;_<u.y+u.height;_++){const X=x([$-K,_]);if(!X.allowOverlay&&X.kind!==me.Boolean)continue;let Y;if(X.kind===me.Custom){const F=Ht(X),oe=(k=F==null?void 0:F.provideEditor)==null?void 0:k.call(F,{...X,location:[$-K,_]});(F==null?void 0:F.onDelete)!==void 0?Y=F.onDelete(X):$a(oe)&&(Y=(P=oe==null?void 0:oe.deletedValue)==null?void 0:P.call(oe,X))}else if(Mr(X)&&X.allowOverlay||X.kind===me.Boolean){const F=Ht(X);Y=(A=F==null?void 0:F.onDelete)==null?void 0:A.call(F,X)}Y!==void 0&&!kr(Y)&&Mr(Y)&&R.push({location:[$,_],value:Y})}zn(R),(G=ln.current)==null||G.damage(R.map($=>({cell:$.location})))},[bn,x,Ht,zn,K]),Bo=o!==void 0,T0=d.useCallback(u=>{var we,je;const R=()=>{u.stopPropagation(),u.preventDefault()},k={didMatch:!1},{bounds:P}=u,A=z.columns,G=z.rows,$=Un;if(!Bo&&st($.clear,u,k))_e(fi,!1),Kt==null||Kt();else if(!Bo&&st($.selectAll,u,k))_e({columns:yt.empty(),rows:yt.empty(),current:{cell:((we=z.current)==null?void 0:we.cell)??[K,0],range:{x:K,y:0,width:g.length,height:Ge},rangeStack:[]}},!1);else if(st($.search,u,k))(je=l==null?void 0:l.current)==null||je.focus({preventScroll:!0}),de(!0);else if(st($.delete,u,k)){const Se=(on==null?void 0:on(z))??!0;if(Se!==!1){const Te=Se===!0?z:Se;if(Te.current!==void 0){Wr(Te.current.range);for(const We of Te.current.rangeStack)Wr(We)}for(const We of Te.rows)Wr({x:K,y:We,width:g.length,height:1});for(const We of Te.columns)Wr({x:We,y:0,width:1,height:Ge})}}if(k.didMatch)return R(),!0;if(z.current===void 0)return!1;let[_,X]=z.current.cell;const[,Y]=z.current.cell;let F=!1,oe=!1;if(st($.scrollToSelectedCell,u,k)?Ii.current(_-K,X):Oe!=="none"&&st($.selectColumn,u,k)?A.hasIndex(_)?ht(A.remove(_),void 0,!0):Oe==="single"?ht(yt.fromSingleSelection(_),void 0,!0):ht(void 0,_,!0):te!=="none"&&st($.selectRow,u,k)?G.hasIndex(X)?Ne(G.remove(X),void 0,!0):te==="single"?Ne(yt.fromSingleSelection(X),void 0,!0):Ne(void 0,X,!0):!Bo&&P!==void 0&&st($.activateCell,u,k)?X===Ge&&Wt?window.setTimeout(()=>{const Se=Si(_);eo(Se??_)},0):(v==null||v([_-K,X]),Zr(P,!0)):z.current.range.height>1&&st($.downFill,u,k)?E0():z.current.range.width>1&&st($.rightFill,u,k)?R0():st($.goToNextPage,u,k)?X+=Math.max(1,Gt.current.height-4):st($.goToPreviousPage,u,k)?X-=Math.max(1,Gt.current.height-4):st($.goToFirstCell,u,k)?(i(void 0),X=0,_=0):st($.goToLastCell,u,k)?(i(void 0),X=Number.MAX_SAFE_INTEGER,_=Number.MAX_SAFE_INTEGER):st($.selectToFirstCell,u,k)?(i(void 0),Wn([-2,-2])):st($.selectToLastCell,u,k)?(i(void 0),Wn([2,2])):Bo?(st($.closeOverlay,u,k)&&i(void 0),st($.acceptOverlayDown,u,k)&&(i(void 0),X++),st($.acceptOverlayUp,u,k)&&(i(void 0),X--),st($.acceptOverlayLeft,u,k)&&(i(void 0),_--),st($.acceptOverlayRight,u,k)&&(i(void 0),_++)):(st($.goDownCell,u,k)?X+=1:st($.goUpCell,u,k)?X-=1:st($.goRightCell,u,k)?_+=1:st($.goLeftCell,u,k)?_-=1:st($.goDownCellRetainSelection,u,k)?(X+=1,F=!0):st($.goUpCellRetainSelection,u,k)?(X-=1,F=!0):st($.goRightCellRetainSelection,u,k)?(_+=1,F=!0):st($.goLeftCellRetainSelection,u,k)?(_-=1,F=!0):st($.goToLastRow,u,k)?X=Ge-1:st($.goToFirstRow,u,k)?X=Number.MIN_SAFE_INTEGER:st($.goToLastColumn,u,k)?_=Number.MAX_SAFE_INTEGER:st($.goToFirstColumn,u,k)?_=Number.MIN_SAFE_INTEGER:Fe!=="rect"&&Fe!=="multi-rect"||(st($.selectGrowDown,u,k)?Wn([0,1]):st($.selectGrowUp,u,k)?Wn([0,-1]):st($.selectGrowRight,u,k)?Wn([1,0]):st($.selectGrowLeft,u,k)?Wn([-1,0]):st($.selectToLastRow,u,k)?Wn([0,2]):st($.selectToFirstRow,u,k)?Wn([0,-2]):st($.selectToLastColumn,u,k)?Wn([2,0]):st($.selectToFirstColumn,u,k)&&Wn([-2,0])),oe=k.didMatch),Bn!==void 0&&Bn!=="normal"&&X!==Y){const Se=Bn==="skip-down"||Bn==="skip"||Bn==="block",Te=X<Y;if(Te&&(Bn==="skip-up"||Bn==="skip"||Bn==="block")){for(;X>=0&&Nr(X).isGroupHeader;)X--;X<0&&(X=Y)}else if(!Te&&Se){for(;X<Ge&&Nr(X).isGroupHeader;)X++;X>=Ge&&(X=Y)}}const re=Cr(_,X,!1,F),ge=k.didMatch;return ge&&(re||!oe||It)&&R(),ge},[Bn,Bo,z,Un,Oe,te,Fe,K,Nr,Ge,Cr,_e,Kt,g.length,on,It,Wr,ht,Ne,Wt,Si,eo,v,Zr,E0,R0,Wn]),Wo=d.useCallback(u=>{let R=!1;if(ue!==void 0&&ue({...u,...u.location&&{location:[u.location[0]-K,u.location[1]]},cancel:()=>{R=!0}}),R||T0(u)||z.current===void 0)return;const[k,P]=z.current.cell,A=Gt.current;if(Ue&&!u.metaKey&&!u.ctrlKey&&z.current!==void 0&&u.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(u.key)&&u.bounds!==void 0&&so(x([k-K,Math.max(0,Math.min(P,Ge-1))]))){if((!Wt||P!==Ge)&&(A.y>P||P>A.y+A.height||A.x>k||k>A.x+A.width))return;v==null||v([k-K,P]),Zr(u.bounds,!0,u.key),u.stopPropagation(),u.preventDefault()}},[Ue,ue,T0,z,x,K,Ge,Wt,v,Zr]),Sp=d.useCallback((u,R)=>{const k=u.location[0]-K;if(u.kind==="header"&&(le==null||le(k,{...u,preventDefault:R})),u.kind===Pn){if(k<0)return;Q==null||Q(k,{...u,preventDefault:R})}if(u.kind==="cell"){const[P,A]=u.location;J==null||J([k,A],{...u,preventDefault:R}),function(G,$){const[_,X]=$;if(G.columns.hasIndex(_)||G.rows.hasIndex(X))return!0;if(G.current!==void 0){if(vo(G.current.cell,$))return!0;const Y=[G.current.range,...G.current.rangeStack];for(const F of Y)if(_>=F.x&&_<F.x+F.width&&X>=F.y&&X<F.y+F.height)return!0}return!1}(z,u.location)||Cr(P,A,!1,!1)}},[z,J,Q,le,K,Cr]),za=d.useCallback(async u=>{var $,_,X;if(!Un.paste)return;function R(Y,F,oe,re){var we,je;const ge=typeof oe=="object"?(oe==null?void 0:oe.join(`
|
128
128
|
`))??"":(oe==null?void 0:oe.toString())??"";if(!kr(Y)&&so(Y)&&Y.readonly!==!0){const Se=H==null?void 0:H(ge,Y);if(Se!==void 0&&Mr(Se))return{location:F,value:Se};const Te=Ht(Y);if(Te===void 0)return;if(Te.kind===me.Custom){Rn(Y.kind===me.Custom);const We=(we=Te.onPaste)==null?void 0:we.call(Te,ge,Y.data);return We===void 0?void 0:{location:F,value:{...Y,data:We}}}{const We=(je=Te.onPaste)==null?void 0:je.call(Te,ge,Y,{formatted:re,formattedString:typeof re=="string"?re:re==null?void 0:re.join(`
|
129
129
|
`),rawValue:oe});return We===void 0?void 0:(Rn(We.kind===Y.kind),{location:F,value:We})}}}const k=z.columns,P=z.rows,A=(($=zt.current)==null?void 0:$.contains(document.activeElement))===!0||((_=a.current)==null?void 0:_.contains(document.activeElement))===!0;let G;if(z.current!==void 0?G=[z.current.range.x,z.current.range.y]:k.length===1?G=[k.first()??0,0]:P.length===1&&(G=[K,P.first()??0]),A&&G!==void 0){let Y,F;const oe="text/plain",re="text/html";if(navigator.clipboard.read!==void 0){const Se=await navigator.clipboard.read();for(const Te of Se){if(Te.types.includes(re)){const We=await Te.getType(re),_t=e0(await We.text());if(_t!==void 0){Y=_t;break}}Te.types.includes(oe)&&(F=await(await Te.getType(oe)).text())}}else if(navigator.clipboard.readText!==void 0)F=await navigator.clipboard.readText();else{if(u===void 0||(u==null?void 0:u.clipboardData)===null)return;u.clipboardData.types.includes(re)&&(Y=e0(u.clipboardData.getData(re))),Y===void 0&&u.clipboardData.types.includes(oe)&&(F=u.clipboardData.getData(oe))}const[ge,we]=G,je=[];do{if(ot===void 0){const Se=R(Tn(G),G,F??(Y==null?void 0:Y.map(Te=>Te.map(We=>We.rawValue).join(" ")).join(" "))??"",void 0);Se!==void 0&&je.push(Se);break}if(Y===void 0){if(F===void 0)return;Y=wg(F)}if(ot===!1||typeof ot=="function"&&(ot==null?void 0:ot([G[0]-K,G[1]],Y.map(Se=>Se.map(Te=>{var We;return((We=Te.rawValue)==null?void 0:We.toString())??""}))))!==!0)return;for(const[Se,Te]of Y.entries()){if(Se+we>=Ge)break;for(const[We,_t]of Te.entries()){const Ut=[We+ge,Se+we],[tn,St]=Ut;if(tn>=Ct.length||St>=fn)continue;const At=R(Tn(Ut),Ut,_t.rawValue,_t.formatted);At!==void 0&&je.push(At)}}}while(!1);zn(je),(X=ln.current)==null||X.damage(je.map(Se=>({cell:Se.location})))}},[H,Ht,Tn,z,Un.paste,zt,Ct.length,zn,fn,ot,K,Ge]);cn("paste",za,C,!1,!0);const $o=d.useCallback(async(u,R)=>{var $,_;if(!Un.copy)return;const k=R===!0||(($=zt.current)==null?void 0:$.contains(document.activeElement))===!0||((_=a.current)==null?void 0:_.contains(document.activeElement))===!0,P=z.columns,A=z.rows,G=(X,Y)=>{n0(Me?[Y.map(F=>({kind:me.Text,data:g[F].title,displayData:g[F].title,allowOverlay:!1})),...X]:X,Y,u)};if(k&&Le!==void 0){if(z.current!==void 0){let X=Le(z.current.range,Ie.current.signal);typeof X!="object"&&(X=await X()),G(X,Pr(z.current.range.x-K,z.current.range.x+z.current.range.width-K))}else if(A!==void 0&&A.length>0){const X=[...A].map(Y=>{const F=Le({x:K,y:Y,width:g.length,height:1},Ie.current.signal);return typeof F=="object"?F[0]:F().then(oe=>oe[0])});X.some(Y=>Y instanceof Promise)?G(await Promise.all(X),Pr(g.length)):G(X,Pr(g.length))}else if(P.length>0){const X=[],Y=[];for(const F of P){let oe=Le({x:F,y:0,width:1,height:Ge},Ie.current.signal);typeof oe!="object"&&(oe=await oe()),X.push(oe),Y.push(F-K)}X.length===1?G(X[0],Y):G(X.reduce((F,oe)=>F.map((re,ge)=>[...re,...oe[ge]])),Y)}}},[g,Le,z,Un.copy,K,zt,Ge,Me]);cn("copy",$o,C,!1,!1),cn("cut",d.useCallback(async u=>{var R,k;if(Un.cut&&(((R=zt.current)==null?void 0:R.contains(document.activeElement))===!0||((k=a.current)==null?void 0:k.contains(document.activeElement))===!0)&&(await $o(u),z.current!==void 0)){let P={current:{cell:z.current.cell,range:z.current.range,rangeStack:[]},rows:yt.empty(),columns:yt.empty()};const A=on==null?void 0:on(P);if(A===!1||(P=A===!0?P:A,P.current===void 0))return;Wr(P.current.range)}},[Wr,z,Un.cut,$o,zt,on]),C,!1,!1);const kp=d.useCallback((u,R)=>{if(ie!==void 0)return K!==0&&(u=u.map(A=>[A[0]-K,A[1]])),void ie(u,R);if(u.length===0||R===-1)return;const[k,P]=u[R];h.current!==void 0&&h.current[0]===k&&h.current[1]===P||(h.current=[k,P],Cr(k,P,!1,!1))},[ie,K,Cr]),[Ri,Ei]=((F0=jt==null?void 0:jt.current)==null?void 0:F0.cell)??[],Ii=d.useRef(Qt);Ii.current=Qt,d.useLayoutEffect(()=>{var u,R,k,P;!Da.current||Dn.current||Ri===void 0||Ei===void 0||Ri===((R=(u=Ae.current)==null?void 0:u.current)==null?void 0:R.cell[0])&&Ei===((P=(k=Ae.current)==null?void 0:k.current)==null?void 0:P.cell[1])||Ii.current(Ri,Ei),Dn.current=!1},[Ri,Ei]);const H0=z.current!==void 0&&(z.current.cell[0]>=Ct.length||z.current.cell[1]>=fn);d.useLayoutEffect(()=>{H0&&_e(fi,!1)},[H0,_e]);const Mp=d.useMemo(()=>Wt===!0&&(ne==null?void 0:ne.tint)===!0?yt.fromSingleSelection(fn-1):yt.empty(),[fn,Wt,ne==null?void 0:ne.tint]),Rp=d.useCallback(u=>typeof ve=="boolean"?ve:(ve==null?void 0:ve(u-K))??!0,[K,ve]),Ep=d.useMemo(()=>{if(Ea===void 0||a.current===null)return null;const{bounds:u,group:R}=Ea,k=a.current.getBoundingClientRect();return d.createElement(gg,{bounds:u,group:R,canvasBounds:k,onClose:()=>Ia(void 0),onFinish:P=>{Ia(void 0),fe==null||fe(R,P)}})},[fe,Ea]),Ip=Math.min(Ct.length,Pe+(wn?1:0));d.useImperativeHandle(t,()=>({appendRow:(u,R)=>eo(u+K,R),updateCells:u=>{var R;return K!==0&&(u=u.map(k=>({cell:[k.cell[0]+K,k.cell[1]]}))),(R=ln.current)==null?void 0:R.damage(u)},getBounds:(u,R)=>{var k;if((a==null?void 0:a.current)!==null&&(zt==null?void 0:zt.current)!==null){if(u===void 0&&R===void 0){const P=a.current.getBoundingClientRect(),A=P.width/zt.current.clientWidth;return{x:P.x-zt.current.scrollLeft*A,y:P.y-zt.current.scrollTop*A,width:zt.current.scrollWidth*A,height:zt.current.scrollHeight*A}}return(k=ln.current)==null?void 0:k.getBounds((u??0)+K,R)}},focus:()=>{var u;return(u=ln.current)==null?void 0:u.focus()},emit:async u=>{switch(u){case"delete":Wo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!1,key:"Delete",keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-right":Wo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"r",keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-down":Wo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"d",keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"copy":await $o(void 0,!0);break;case"paste":await za()}},scrollTo:Qt,remeasureColumns:u=>{for(const R of u)ki(R+K)},getMouseArgsForPosition:(u,R,k)=>{if((ln==null?void 0:ln.current)===null)return;const P=ln.current.getMouseArgsForPosition(u,R,k);return P!==void 0?{...P,location:[P.location[0]-K,P.location[1]]}:void 0}}),[eo,ki,zt,$o,Wo,za,K,Qt]);const[O0,P0]=qn??[],Tp=d.useCallback(u=>{const[R,k]=u;k!==-1?O0===R&&P0===k||(Lt({cell:u,range:{x:R,y:k,width:1,height:1}},!0,!1,"keyboard-nav"),Qt(R,k)):Oe!=="none"&&(ht(yt.fromSingleSelection(R),void 0,!1),bn())},[Oe,bn,Qt,O0,P0,Lt,ht]),[Hp,Op]=d.useState(!1),D0=d.useRef(Fc(u=>{Op(u)},5)),Pp=d.useCallback(()=>{D0.current(!0),z.current===void 0&&z.columns.length===0&&z.rows.length===0&&s===void 0&&Lt({cell:[K,wi],range:{x:K,y:wi,width:1,height:1}},!0,!1,"keyboard-select")},[wi,z,s,K,Lt]),Dp=d.useCallback(()=>{D0.current(!1)},[]),[zp,Ap]=d.useMemo(()=>{let u;const R=(lt==null?void 0:lt.scrollbarWidthOverride)??Ki(),k=Ge+(Wt?1:0);if(typeof Vn=="number")u=sr+k*Vn;else{let A=0;const G=Math.min(k,10);for(let $=0;$<G;$++)A+=Vn($);A=Math.floor(A/G),u=sr+k*A}u+=R;const P=Ct.reduce((A,G)=>G.width+A,0)+R;return[`${Math.min(1e5,P)}px`,`${Math.min(1e5,u)}px`]},[Ct,lt==null?void 0:lt.scrollbarWidthOverride,Vn,Ge,Wt,sr]),Fp=d.useMemo(()=>Xa(gt),[gt]);return d.createElement(Wa.Provider,{value:gt},d.createElement(bg,{style:Fp,className:ce,inWidth:m??zp,inHeight:E??Ap},d.createElement(hg,{fillHandle:Je,drawFocusRing:zr,experimental:lt,fixedShadowX:rt,fixedShadowY:De,getRowThemeOverride:jn,headerIcons:Nt,imageWindowLoader:gn,initialSize:Zt,isDraggable:rn,onDragLeave:Bt,onRowMoved:Xt,overscrollX:Do,overscrollY:zo,preventDiagonalScrolling:kn,rightElement:pn,rightElementProps:kt,smoothScrollX:Vt,smoothScrollY:Et,className:ce,enableGroups:Jr,onCanvasFocused:Pp,onCanvasBlur:Dp,canvasRef:a,onContextMenu:Sp,theme:gt,cellXOffset:lp,cellYOffset:wi,accessibilityHeight:_r.height,onDragEnd:yp,columns:Ct,nonGrowWidth:vi,drawHeader:br,onColumnProposeMove:mp,drawCell:ar,disabledRows:Mp,freezeColumns:Ip,lockColumns:K,firstColAccessible:K===0,getCellContent:Tn,minColumnWidth:ir,maxColumnWidth:Ar,searchInputRef:l,showSearch:Ce,onSearchClose:he,highlightRegions:sp,getCellsForSelection:Le,getGroupDetails:Ma,headerHeight:Fr,isFocused:Hp,groupHeaderHeight:Jr?Po:0,freezeTrailingRows:xe+(Wt&&(ne==null?void 0:ne.sticky)===!0?1:0),hasAppendRow:Wt,onColumnResize:et,onColumnResizeEnd:dn,onColumnResizeStart:en,onCellFocused:Tp,onColumnMoved:vp,onDragStart:wp,onHeaderMenuClick:fp,onHeaderIndicatorClick:gp,onItemHovered:Pa,isFilling:(s==null?void 0:s.fillHandle)===!0,onMouseMove:hp,onKeyDown:Wo,onKeyUp:pe,onMouseDown:cp,onMouseUp:dp,onDragOverCell:Ve,onDrop:Ke,onSearchResultsChanged:kp,onVisibleRegionChanged:pp,clientSize:yn,rowHeight:Vn,searchResults:W,searchValue:U,onSearchValueChange:N,rows:fn,scrollRef:zt,selection:z,translateX:_r.tx,translateY:_r.ty,verticalBorder:Rp,gridRef:ln,getCellRenderer:Ht,resizeIndicator:Ca}),Ep,o!==void 0&&d.createElement(d.Suspense,{fallback:null},d.createElement(kg,{...o,validateCell:Mt,bloom:D,id:Cp,getCellRenderer:Ht,className:(lt==null?void 0:lt.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:_n,imageEditorOverride:y,onFinishEditing:xp,markdownDivCreateNode:p,isOutsideClick:wr,customEventTarget:lt==null?void 0:lt.eventTarget}))))});function s0(e){const{cell:t,posX:n,posY:r,bounds:o,theme:i}=e,{width:l,height:a,x:s,y:c}=o,h=t.maxSize??i.checkboxMaxSize,C=Math.floor(o.y+a/2),y=Nc(h,a,i.cellVerticalPadding),b=jc(t.contentAlign??"center",s,l,i.cellHorizontalPadding,y),p=_c(b,C,y),m=Bc(s+n,c+r,p);return Bi(t)&&m}const Eg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:me.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>function(t,n,r,o,i){if(!r&&n===Qo)return;const{ctx:l,hoverAmount:a,theme:s,rect:c,highlighted:h,hoverX:C,hoverY:y,cell:{contentAlign:b}}=t,{x:p,y:m,width:E,height:g}=c;let w=!1;if(i>0){let x=r?1-i+i*a:.4;if(n===Qo&&(x*=a),x===0)return;x<1&&(w=!0,l.globalAlpha=x)}sa(l,s,n,p,m,E,g,h,C,y,o,b),w&&(l.globalAlpha=1)}(e,e.cell.data,Bi(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{s0(e)&&e.preventDefault()},onClick:e=>{if(s0(e))return{...e.cell,data:r0(e.cell.data)}},onPaste:(e,t)=>{let n=Qo;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Ni),n===t.data?void 0:{...t,data:n}}},Ig=Cn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),Tg=e=>{const{bubbles:t}=e;return d.createElement(Ig,null,t.map((n,r)=>d.createElement("div",{key:r,className:"boe-bubble"},n)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Hg={getAccessibilityString:e=>Wc(e.data),kind:me.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((o,i)=>e.measureText(i).width+o+2*n.bubblePadding+n.bubbleMargin,0);return t.data.length===0?2*n.cellHorizontalPadding:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>function(t,n){const{rect:r,theme:o,ctx:i,highlighted:l}=t,{x:a,y:s,width:c,height:h}=r;let C=a+o.cellHorizontalPadding;const y=[];for(const b of n){if(C>a+c)break;const p=Kr(b,i,o.baseFontFull).width;y.push({x:C,width:p}),C+=p+2*o.bubblePadding+o.bubbleMargin}i.beginPath();for(const b of y)Yn(i,b.x,s+(h-o.bubbleHeight)/2,b.width+2*o.bubblePadding,o.bubbleHeight,o.roundingRadius??o.bubbleHeight/2);i.fillStyle=l?o.bgBubbleSelected:o.bgBubble,i.fill();for(const[b,p]of y.entries())i.beginPath(),i.fillStyle=o.textBubble,i.fillText(n[b],p.x+o.bubblePadding,s+h/2+fr(i,o))}(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Tg,{bubbles:t.data})},onPaste:()=>{}},Og=Cn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),Pg=e=>{const{drilldowns:t}=e;return d.createElement(Og,null,t.map((n,r)=>d.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&d.createElement("img",{src:n.img}),d.createElement("div",null,n.text))))},Dg={getAccessibilityString:e=>Wc(e.data.map(t=>t.text)),kind:me.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,o)=>e.measureText(o.text).width+r+2*n.bubblePadding+n.bubbleMargin+(o.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>function(t,n){const{rect:r,theme:o,ctx:i,imageLoader:l,col:a,row:s}=t,{x:c,width:h}=r,C=o.baseFontFull,y=tu(i,C),b=Math.min(r.height,Math.max(16,2*Math.ceil(y*o.lineHeight))),p=Math.floor(r.y+(r.height-b)/2),m=b-10,E=o.bubblePadding,g=o.bubbleMargin;let w=c+o.cellHorizontalPadding;const x=o.roundingRadius??6,I=function(M,S,H,f){const B=Math.ceil(window.devicePixelRatio),D=5,O=H-2*D,T=4,j=H*B,V=f+D,Z=3*f,J=(Z+2*D)*B,ce=`${M},${S},${B},${H}`;if(wa[ce]!==void 0)return{el:wa[ce],height:j,width:J,middleWidth:T*B,sideWidth:V*B,padding:D*B,dpr:B};const le=document.createElement("canvas"),q=le.getContext("2d");return q===null?null:(le.width=J,le.height=j,q.scale(B,B),wa[ce]=le,q.beginPath(),Yn(q,D,D,Z,O,f),q.shadowColor="rgba(24, 25, 34, 0.4)",q.shadowBlur=1,q.fillStyle=M,q.fill(),q.shadowColor="rgba(24, 25, 34, 0.3)",q.shadowOffsetY=1,q.shadowBlur=5,q.fillStyle=M,q.fill(),q.shadowOffsetY=0,q.shadowBlur=0,q.shadowBlur=0,q.beginPath(),Yn(q,D+.5,D+.5,Z,O,f),q.strokeStyle=S,q.lineWidth=1,q.stroke(),{el:le,height:j,width:J,sideWidth:V*B,middleWidth:f*B,padding:D*B,dpr:B})}(o.bgCell,o.drilldownBorder,b,x),v=[];for(const M of n){if(w>c+h)break;const S=Kr(M.text,i,C).width;let H=0;M.img!==void 0&&l.loadOrGetImage(M.img,a,s)!==void 0&&(H=m-8+4);const f=S+H+2*E;v.push({x:w,width:f}),w+=f+g}if(I!==null){const{el:M,height:S,middleWidth:H,sideWidth:f,width:B,dpr:D,padding:O}=I,T=f/D,j=O/D;for(const V of v){const Z=Math.floor(V.x),J=Math.floor(V.width),ce=J-2*(T-j);i.imageSmoothingEnabled=!1,i.drawImage(M,0,0,f,S,Z-j,p,T,b),ce>0&&i.drawImage(M,f,0,H,S,Z+(T-j),p,ce,b),i.drawImage(M,B-f,0,f,S,Z+J-(T-j),p,T,b),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[M,S]of v.entries()){const H=n[M];let f=S.x+E;if(H.img!==void 0){const B=l.loadOrGetImage(H.img,a,s);if(B!==void 0){const D=m-8;let O=0,T=0,j=B.width,V=B.height;j>V?(O+=(j-V)/2,j=V):V>j&&(T+=(V-j)/2,V=j),i.beginPath(),Yn(i,f,p+b/2-D/2,D,D,o.roundingRadius??3),i.save(),i.clip(),i.drawImage(B,O,T,j,V,f,p+b/2-D/2,D,D),i.restore(),f+=D+4}}i.beginPath(),i.fillStyle=o.textBubble,i.fillText(H.text,f,p+b/2+fr(i,o))}}(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Pg,{drilldowns:t.data})},onPaste:()=>{}},wa={},zg={getAccessibilityString:e=>e.data.join(", "),kind:me.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>function(t,n,r,o){const{rect:i,col:l,row:a,theme:s,ctx:c,imageLoader:h}=t,{x:C,y,height:b,width:p}=i,m=b-2*s.cellVerticalPadding,E=[];let g=0;for(let x=0;x<n.length;x++){const I=n[x];if(I.length===0)continue;const v=h.loadOrGetImage(I,l,a);v!==void 0&&(E[x]=v,g+=v.width*(m/v.height)+ya)}if(g===0)return;g-=ya;let w=C+s.cellHorizontalPadding;o==="right"?w=Math.floor(C+p-s.cellHorizontalPadding-g):o==="center"&&(w=Math.floor(C+p/2-g/2));for(const x of E){if(x===void 0)continue;const I=x.width*(m/x.height);r>0&&(c.beginPath(),Yn(c,w,y+s.cellVerticalPadding,I,m,r),c.save(),c.clip()),c.drawImage(x,w,y+s.cellVerticalPadding,I,m),r>0&&c.restore(),w+=I+ya}}(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>50*t.data.length,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,o=r??u1;return d.createElement(o,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:i=>{n({...t,data:[i]})}})},onPaste:(e,t)=>{const n=(e=e.trim()).split(",").map(r=>{try{return new URL(r),r}catch{return}}).filter(r=>r!==void 0);if(n.length!==t.data.length||!n.every((r,o)=>r===t.data[o]))return{...t,data:n}}},ya=4,Ag={getAccessibilityString:()=>"",kind:me.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:o,rect:i,theme:l}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(function(h,C){let y=49632*h+325176*C;return y^=y<<13,y^=y>>17,y^=y<<5,y/4294967295*2}(n,r)*t.skeletonWidthVariability));const s=l.cellHorizontalPadding;a+2*s>=i.width&&(a=i.width-2*s-1);const c=t.skeletonHeight??Math.min(18,i.height-2*l.cellVerticalPadding);Yn(o,i.x+s,i.y+(i.height-c)/2,a,c,l.roundingRadius??3),o.fillStyle=Hr(l.textDark,.1),o.fill()},onPaste:()=>{}},c0=Cn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[e=>e.targetWidth,"px"]}}),Fg=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:o,targetRect:i,onFinish:l,validatedSelection:a}=e,s=t.data,c=t.readonly===!0,[h,C]=d.useState(s===""||r),y=d.useCallback(()=>{C(p=>!p)},[]),b=s?"gdg-ml-6":"";return h?d.createElement(c0,{targetWidth:i.width-20},d.createElement(oi,{autoFocus:!0,highlight:!1,validatedSelection:a,value:s,onKeyDown:p=>{p.key==="Enter"&&p.stopPropagation()},onChange:n}),d.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${b}`,onClick:()=>l(t)},d.createElement(l1,null))):d.createElement(c0,{targetWidth:i.width},d.createElement(h1,{contents:s,createNode:o}),!c&&d.createElement(d.Fragment,null,d.createElement("div",{className:"spacer"}),d.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${b}`,onClick:y},d.createElement(Gi,null))),d.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Lg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:me.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:yo,measure:(e,t,n)=>{const r=t.data.split(`
|
130
|
-
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>Qn(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:o,markdownDivCreateNode:i,forceEditMode:l,validatedSelection:a}=e;return d.createElement(Fg,{onFinish:o,targetRect:r,value:n,validatedSelection:a,onChange:s=>t({...n,data:s.target.value}),forceEditMode:l,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},_g={getAccessibilityString:e=>e.row.toString(),kind:Hn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:function(e,t){const{ctx:n,theme:r}=e,o=r.markerFontFull,i=t??{};return(i==null?void 0:i.font)!==o&&(n.font=o,i.font=o),i.deprep=jg,n.textAlign="center",i},measure:()=>44,draw:e=>function(t,n,r,o,i,l){const{ctx:a,rect:s,hoverAmount:c,theme:h}=t,{x:C,y,width:b,height:p}=s,m=r?1:o==="checkbox-visible"?.6+.4*c:c;if(o!=="number"&&m>0){a.globalAlpha=m;const E=7*(r?c:1);if(sa(a,h,r,i?C+E:C,y,i?b-E:b,p,!0,void 0,void 0,h.checkboxMaxSize,"center",l),i){a.globalAlpha=c,a.beginPath();for(const g of[3,6])for(const w of[-5,-1,3])a.rect(C+g,y+p/2+w,2,2);a.fillStyle=h.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(o==="number"||o==="both"&&!r){const E=n.toString(),g=h.markerFontFull,w=C+b/2;o==="both"&&c!==0&&(a.globalAlpha=1-c),a.fillStyle=h.textLight,a.font=g,a.fillText(E,w,y+p/2+fr(a,g)),c!==0&&(a.globalAlpha=1)}}(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:o}=e,{width:i,height:l}=t,a=n.drawHandle?7+(i-7)/2:i/2,s=l/2;if(Math.abs(r-a)<=10&&Math.abs(o-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function jg(e){const{ctx:t}=e;t.textAlign="start"}const Ng={getAccessibilityString:()=>"",kind:Hn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>function(t,n,r){const{ctx:o,rect:i,hoverAmount:l,theme:a,spriteManager:s}=t,{x:c,y:h,width:C,height:y}=i;o.beginPath(),o.globalAlpha=l,o.rect(c+1,h+1,C,y-2),o.fillStyle=a.bgHeaderHovered,o.fill(),o.globalAlpha=1,o.beginPath();const b=n!=="";let p=0;if(r!==void 0){const E=y-8,g=c+8/2,w=h+8/2;s.drawSprite(r,"normal",o,g,w,E,a,b?1:l),p=E}else{p=24;const m=12,E=b?m:l*m,g=b?0:(1-l)*m*.5,w=a.cellHorizontalPadding+4;E>0&&(o.moveTo(c+w+g,h+y/2),o.lineTo(c+w+g+E,h+y/2),o.moveTo(c+w+g+.5*E,h+y/2-.5*E),o.lineTo(c+w+g+.5*E,h+y/2+.5*E),o.lineWidth=2,o.strokeStyle=a.bgIconHeader,o.lineCap="round",o.stroke())}o.fillStyle=a.textMedium,o.fillText(n,p+c+a.cellHorizontalPadding+.5,h+y/2+fr(o,a)),o.beginPath()}(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function u0(e,t,n,r,o,i,l){e.textBaseline="alphabetic";const a=function(s,c,h,C,y){const b=C.cellHorizontalPadding,p=C.cellVerticalPadding;if(y)return{x:c.x+b/2,y:c.y+p/2+1,width:c.width-b,height:c.height-p-1};const m=Kr(h,s,C.baseFontFull,"alphabetic"),E=c.height-p,g=Math.min(E,2.5*m.actualBoundingBoxAscent);return{x:c.x+b/2,y:c.y+(c.height-g)/2+1,width:m.width+3*b,height:g-1}}(e,o,r,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),Yn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=(n==null?void 0:n.bgColor)??Hr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",l==null||l("text")}const Bg=d.lazy(async()=>await L0(()=>import("./number-overlay-editor-
|
130
|
+
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>Qn(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:o,markdownDivCreateNode:i,forceEditMode:l,validatedSelection:a}=e;return d.createElement(Fg,{onFinish:o,targetRect:r,value:n,validatedSelection:a,onChange:s=>t({...n,data:s.target.value}),forceEditMode:l,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},_g={getAccessibilityString:e=>e.row.toString(),kind:Hn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:function(e,t){const{ctx:n,theme:r}=e,o=r.markerFontFull,i=t??{};return(i==null?void 0:i.font)!==o&&(n.font=o,i.font=o),i.deprep=jg,n.textAlign="center",i},measure:()=>44,draw:e=>function(t,n,r,o,i,l){const{ctx:a,rect:s,hoverAmount:c,theme:h}=t,{x:C,y,width:b,height:p}=s,m=r?1:o==="checkbox-visible"?.6+.4*c:c;if(o!=="number"&&m>0){a.globalAlpha=m;const E=7*(r?c:1);if(sa(a,h,r,i?C+E:C,y,i?b-E:b,p,!0,void 0,void 0,h.checkboxMaxSize,"center",l),i){a.globalAlpha=c,a.beginPath();for(const g of[3,6])for(const w of[-5,-1,3])a.rect(C+g,y+p/2+w,2,2);a.fillStyle=h.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(o==="number"||o==="both"&&!r){const E=n.toString(),g=h.markerFontFull,w=C+b/2;o==="both"&&c!==0&&(a.globalAlpha=1-c),a.fillStyle=h.textLight,a.font=g,a.fillText(E,w,y+p/2+fr(a,g)),c!==0&&(a.globalAlpha=1)}}(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:o}=e,{width:i,height:l}=t,a=n.drawHandle?7+(i-7)/2:i/2,s=l/2;if(Math.abs(r-a)<=10&&Math.abs(o-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function jg(e){const{ctx:t}=e;t.textAlign="start"}const Ng={getAccessibilityString:()=>"",kind:Hn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>function(t,n,r){const{ctx:o,rect:i,hoverAmount:l,theme:a,spriteManager:s}=t,{x:c,y:h,width:C,height:y}=i;o.beginPath(),o.globalAlpha=l,o.rect(c+1,h+1,C,y-2),o.fillStyle=a.bgHeaderHovered,o.fill(),o.globalAlpha=1,o.beginPath();const b=n!=="";let p=0;if(r!==void 0){const E=y-8,g=c+8/2,w=h+8/2;s.drawSprite(r,"normal",o,g,w,E,a,b?1:l),p=E}else{p=24;const m=12,E=b?m:l*m,g=b?0:(1-l)*m*.5,w=a.cellHorizontalPadding+4;E>0&&(o.moveTo(c+w+g,h+y/2),o.lineTo(c+w+g+E,h+y/2),o.moveTo(c+w+g+.5*E,h+y/2-.5*E),o.lineTo(c+w+g+.5*E,h+y/2+.5*E),o.lineWidth=2,o.strokeStyle=a.bgIconHeader,o.lineCap="round",o.stroke())}o.fillStyle=a.textMedium,o.fillText(n,p+c+a.cellHorizontalPadding+.5,h+y/2+fr(o,a)),o.beginPath()}(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function u0(e,t,n,r,o,i,l){e.textBaseline="alphabetic";const a=function(s,c,h,C,y){const b=C.cellHorizontalPadding,p=C.cellVerticalPadding;if(y)return{x:c.x+b/2,y:c.y+p/2+1,width:c.width-b,height:c.height-p-1};const m=Kr(h,s,C.baseFontFull,"alphabetic"),E=c.height-p,g=Math.min(E,2.5*m.actualBoundingBoxAscent);return{x:c.x+b/2,y:c.y+(c.height-g)/2+1,width:m.width+3*b,height:g-1}}(e,o,r,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),Yn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=(n==null?void 0:n.bgColor)??Hr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",l==null||l("text")}const Bg=d.lazy(async()=>await L0(()=>import("./number-overlay-editor-CzX-JKBj.js"),__vite__mapDeps([4,1,2,3]),import.meta.url)),Wg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:me.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:yo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:o,rect:i,overrideCursor:l}=e,{hoverEffect:a,displayData:s,hoverEffectTheme:c}=n;a===!0&&t>0&&u0(r,o,c,s,i,t,l),Qn(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+2*n.cellHorizontalPadding,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return d.createElement(d.Suspense,{fallback:null},d.createElement(Bg,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:o,onChange:i=>n({...r,data:Number.isNaN(i.floatValue??0)?0:i.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!Number.isNaN(r)&&t.data!==r)return{...t,data:r,displayData:n.formattedString??t.displayData}}},$g={getAccessibilityString:()=>"",measure:()=>108,kind:me.Protected,needsHover:!1,needsHoverPosition:!1,draw:function(e){const{ctx:t,theme:n,rect:r}=e,{x:o,y:i,height:l}=r;t.beginPath();const a=2.5;let s=o+n.cellHorizontalPadding+a;const c=i+l/2,h=Math.cos(Lc(30))*a,C=Math.sin(Lc(30))*a;for(let y=0;y<12;y++)t.moveTo(s,c-a),t.lineTo(s,c+a),t.moveTo(s+h,c-C),t.lineTo(s-h,c+C),t.moveTo(s-h,c-C),t.lineTo(s+h,c+C),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()},onPaste:()=>{}},Xg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:me.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>yo(e,t,e.theme.textLight),draw:e=>Qn(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+2*n.cellHorizontalPadding,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return $t.createElement(oi,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:o,onChange:i=>n({...r,data:i.target.value})})},onPaste:()=>{}},Gg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:me.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:yo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:o,rect:i,theme:l,overrideCursor:a}=e,{displayData:s,contentAlign:c,hoverEffect:h,allowWrapping:C,hoverEffectTheme:y}=t;h===!0&&n>0&&u0(o,l,y,s,i,n,a),Qn(e,s,c,C,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
|
131
131
|
`,t.allowWrapping===!0?void 0:1);let o=0;for(const i of r)o=Math.max(o,e.measureText(i).width);return o+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:o,validatedSelection:i}=t;return d.createElement(oi,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:o.readonly!==!0,disabled:o.readonly===!0,altNewline:!0,value:o.data,validatedSelection:i,onChange:l=>r({...o,data:l.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Yg=Cn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Kg=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:o,validatedSelection:i,preview:l}=e,[a,s]=d.useState(!o&&(t===""||r)),c=d.useCallback(()=>{s(!0)},[]);return a?d.createElement(oi,{validatedSelection:i,highlight:!0,autoFocus:!0,value:t,onChange:n}):d.createElement(Yg,null,d.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},l),!o&&d.createElement("div",{className:"gdg-edit-icon",onClick:c},d.createElement(Gi,null)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function d0(e,t,n,r){let o=n.cellHorizontalPadding;const i=t.height/2-e.actualBoundingBoxAscent/2,l=e.width,a=e.actualBoundingBoxAscent;return r==="right"?o=t.width-l-n.cellHorizontalPadding:r==="center"&&(o=t.width/2-l/2),{x:o,y:i,width:l,height:a}}function h0(e){const{cell:t,bounds:n,posX:r,posY:o,theme:i}=e,l=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=Jc(l,i.baseFontFull);if(a===void 0)return!1;const s=d0(a,n,i,t.contentAlign);return Dr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,o)}const Vg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:me.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:yo,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:o,hoverY:i,rect:l,ctx:a}=e,s=t.displayData??t.data,c=t.hoverEffect===!0;if(r!==void 0&&c&&o!==void 0&&i!==void 0){const h=d0(Kr(s,a,n.baseFontFull),l,n,t.contentAlign),{x:C,y,width:b,height:p}=h;if(o>=C-4&&o<=C-4+b+8&&i>=y-4&&i<=y-4+p+8){const m=fr(a,n.baseFontFull);r("pointer");const E=5,g=y-m;a.beginPath(),a.moveTo(l.x+C,Math.floor(l.y+g+p+E)+.5),a.lineTo(l.x+C+b,Math.floor(l.y+g+p+E)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,Qn({...e,rect:{...l,x:l.x-1}},s,t.contentAlign),Qn({...e,rect:{...l,x:l.x-2}},s,t.contentAlign),Qn({...e,rect:{...l,x:l.x+1}},s,t.contentAlign),Qn({...e,rect:{...l,x:l.x+2}},s,t.contentAlign),a.restore()}}a.fillStyle=c?n.linkColor:n.textDark,Qn(e,s,t.contentAlign)},onSelect:e=>{h0(e)&&e.preventDefault()},onClick:e=>{var n;const{cell:t}=e;h0(e)&&((n=t.onClickUri)==null||n.call(t,e))},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+2*n.cellHorizontalPadding,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:o,validatedSelection:i}=t;return d.createElement(Kg,{forceEditMode:r.readonly!==!0&&(o||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:i,readonly:r.readonly===!0,onChange:l=>n({...r,data:l.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Ug=[_g,Ng,Eg,Hg,Dg,zg,Ag,Lg,Wg,$g,Xg,Gg,Vg];var f0,g0,qg=function(){if(g0)return f0;g0=1;var e=Ac(),t=Er();return f0=function(n,r,o){var i=!0,l=!0;if(typeof n!="function")throw new TypeError("Expected a function");return t(o)&&(i="leading"in o?!!o.leading:i,l="trailing"in o?!!o.trailing:l),e(n,r,{leading:i,maxWait:r,trailing:l})}}();const Jg=Sr(qg),ba=[];class Qg extends ru{constructor(){super(...arguments);ft(this,"imageLoaded",()=>{});ft(this,"loadedLocations",[]);ft(this,"cache",{});ft(this,"sendLoaded",Jg(()=>{this.imageLoaded(new bo(this.loadedLocations)),this.loadedLocations=[]},20));ft(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const r of n){const o=this.cache[r];let i=!1;for(let l=0;l<o.cells.length;l++){const a=o.cells[l];if(this.isInWindow(a)){i=!0;break}}i?o.cells=o.cells.filter(this.isInWindow):(o.cancel(),delete this.cache[r])}})}setCallback(n){this.imageLoaded=n}loadImage(n,r,o,i){let l=!1;const a=ba.pop()??new Image;let s=!1;const c={img:void 0,cells:[Ln(r,o)],url:n,cancel:()=>{s||(s=!0,ba.length<12?ba.unshift(a):l||(a.src=""))}},h=new Promise(C=>a.addEventListener("load",()=>C(null)));requestAnimationFrame(async()=>{try{a.src=n,await h,await a.decode();const C=this.cache[i];if(C!==void 0&&!s){C.img=a;for(const y of C.cells)this.loadedLocations.push(ta(y));l=!0,this.sendLoaded()}}catch{c.cancel()}}),this.cache[i]=c}loadOrGetImage(n,r,o){const i=n,l=this.cache[i];if(l!==void 0){const a=Ln(r,o);return l.cells.includes(a)||l.cells.push(a),l.img}this.loadImage(n,r,o,i)}}const Zg=d.forwardRef((e,t)=>{const n=d.useMemo(()=>({...E1,...e.headerIcons}),[e.headerIcons]),r=d.useMemo(()=>e.renderers??Ug,[e.renderers]),o=d.useMemo(()=>e.imageWindowLoader??new Qg,[e.imageWindowLoader]);return d.createElement(Rg,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:o})});function ep(e){switch(e){case"string":default:return me.Text;case"number":return me.Number;case"boolean":return me.Boolean}}function tp(e){switch(e){case"string":case"unknown":return Jn.HeaderString;case"number":case"integer":return Jn.HeaderNumber;case"boolean":return Jn.HeaderBoolean;case"date":case"datetime":return Jn.HeaderDate;case"time":return Jn.HeaderTime;default:return _0(e),Jn.HeaderString}}function p0(e){return"rowIdx"in e&&"columnId"in e&&"value"in e}function np(e){return"rowIdx"in e&&"type"in e}function rp(e){return"columnIdx"in e&&"type"in e}function op(e){return e==="light"?{lineHeight:1.25}:{lineHeight:1.25,accentColor:"#7c3aed",accentLight:"rgba(124, 58, 237, 0.15)",textDark:"#f4f4f5",textMedium:"#a1a1aa",textLight:"#71717a",textBubble:"#f4f4f5",bgIconHeader:"#a1a1aa",fgIconHeader:"#18181b",textHeader:"#d4d4d8",textHeaderSelected:"#18181b",bgCell:"#18181b",bgCellMedium:"#27272a",bgHeader:"#27272a",bgHeaderHasFocus:"#3f3f46",bgHeaderHovered:"#3f3f46",bgBubble:"#27272a",bgBubbleSelected:"#7c3aed",bgSearchResult:"#312e81",borderColor:"#27272a",drilldownBorder:"#7c3aed",linkColor:"#818cf8",headerFontStyle:"bold 14px",baseFontStyle:"13px"}}const ip=e=>{const t=j0.c(19),{currentColumnName:n,onRename:r,onCancel:o}=e,[i,l]=d.useState("");let a;t[0]!==n||t[1]!==i||t[2]!==r?(a=()=>{i.trim()&&(r(i.trim()),l(n))},t[0]=n,t[1]=i,t[2]=r,t[3]=a):a=t[3];const s=a;let c;t[4]!==s||t[5]!==o?(c=w=>{w.key==="Enter"?s():w.key==="Escape"&&o()},t[4]=s,t[5]=o,t[6]=c):c=t[6];const h=c;let C,y,b,p;t[7]===Symbol.for("react.memo_cache_sentinel")?(C=nt.jsxs(N0,{children:[nt.jsx($p,{className:"mr-2 h-3.5 w-3.5"}),"Rename column"]}),t[7]=C):C=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(y=nt.jsx(_a,{htmlFor:"rename-input",children:"Column name"}),t[8]=y):y=t[8],t[9]===Symbol.for("react.memo_cache_sentinel")?(b=w=>l(w.target.value),t[9]=b):b=t[9],t[10]!==h||t[11]!==i?(p=nt.jsxs("div",{children:[y,nt.jsx(B0,{value:i,onChange:b,placeholder:"Enter new column name",className:"mt-1",onKeyDown:h})]}),t[10]=h,t[11]=i,t[12]=p):p=t[12];const m=!i.trim();let E,g;return t[13]!==s||t[14]!==m?(E=nt.jsx(ja,{onClick:s,disabled:m,size:"sm",className:"w-full",children:"Rename"}),t[13]=s,t[14]=m,t[15]=E):E=t[15],t[16]!==p||t[17]!==E?(g=nt.jsxs(W0,{children:[C,nt.jsx($0,{children:nt.jsx(X0,{className:"w-64 p-4",children:nt.jsxs("div",{className:"space-y-3",children:[p,E]})})})]}),t[16]=p,t[17]=E,t[18]=g):g=t[18],g},m0=e=>{const t=j0.c(77),{direction:n,onAdd:r,onCancel:o}=e,[i,l]=d.useState(""),[a,s]=d.useState("string");let c,h,C,y,b,p,m,E,g,w,x,I,v,M,S,H,f,B;if(t[0]!==i||t[1]!==a||t[2]!==n||t[3]!==r||t[4]!==o){const J=["string","number","boolean","datetime"];let ce,le;t[20]!==i||t[21]!==a||t[22]!==r?(ce=()=>{i.trim()&&(r(i.trim(),a),l(""),s("string"))},t[20]=i,t[21]=a,t[22]=r,t[23]=ce):ce=t[23],p=ce,t[24]!==p||t[25]!==o?(le=pe=>{pe.key==="Enter"?p():pe.key==="Escape"&&o()},t[24]=p,t[25]=o,t[26]=le):le=t[26];const q=le;let Q;b=W0,t[27]===Symbol.for("react.memo_cache_sentinel")?(Q=nt.jsx(Xp,{className:"mr-2 h-3.5 w-3.5"}),t[27]=Q):Q=t[27],t[28]!==n?(S=nt.jsxs(N0,{children:[Q,"Add column to the ",n]}),t[28]=n,t[29]=S):S=t[29],y=$0,C=X0,M="w-64 p-4",I="space-y-3";const fe=`add-column-input-${n}`;let ee;t[30]!==fe?(ee=nt.jsx(_a,{htmlFor:fe,children:"Column name"}),t[30]=fe,t[31]=ee):ee=t[31];const se=`add-column-input-${n}`;let ie,W;t[32]===Symbol.for("react.memo_cache_sentinel")?(ie=pe=>l(pe.target.value),t[32]=ie):ie=t[32],t[33]!==i||t[34]!==q||t[35]!==se?(W=nt.jsx(B0,{id:se,value:i,onChange:ie,placeholder:"Enter column name",className:"mt-1",onKeyDown:q}),t[33]=i,t[34]=q,t[35]=se,t[36]=W):W=t[36],t[37]!==ee||t[38]!==W?(v=nt.jsxs("div",{children:[ee,W]}),t[37]=ee,t[38]=W,t[39]=v):v=t[39];const N=`add-column-type-${n}`;t[40]!==N?(x=nt.jsx(_a,{htmlFor:N,children:"Data type"}),t[40]=N,t[41]=x):x=t[41],h=Gp,E=a,t[42]===Symbol.for("react.memo_cache_sentinel")?(g=pe=>s(pe),t[42]=g):g=t[42];const U=`add-column-type-${n}`;let ue;t[43]===Symbol.for("react.memo_cache_sentinel")?(ue=nt.jsx(Yp,{}),t[43]=ue):ue=t[43],t[44]!==U?(w=nt.jsx(Kp,{id:U,className:"mt-1",children:ue}),t[44]=U,t[45]=w):w=t[45],c=Vp,m=J.map(ap),t[0]=i,t[1]=a,t[2]=n,t[3]=r,t[4]=o,t[5]=c,t[6]=h,t[7]=C,t[8]=y,t[9]=b,t[10]=p,t[11]=m,t[12]=E,t[13]=g,t[14]=w,t[15]=x,t[16]=I,t[17]=v,t[18]=M,t[19]=S}else c=t[5],h=t[6],C=t[7],y=t[8],b=t[9],p=t[10],m=t[11],E=t[12],g=t[13],w=t[14],x=t[15],I=t[16],v=t[17],M=t[18],S=t[19];t[46]!==c||t[47]!==m?(H=nt.jsx(c,{children:m}),t[46]=c,t[47]=m,t[48]=H):H=t[48],t[49]!==h||t[50]!==H||t[51]!==E||t[52]!==g||t[53]!==w?(f=nt.jsxs(h,{value:E,onValueChange:g,children:[w,H]}),t[49]=h,t[50]=H,t[51]=E,t[52]=g,t[53]=w,t[54]=f):f=t[54],t[55]!==f||t[56]!==x?(B=nt.jsxs("div",{children:[x,f]}),t[55]=f,t[56]=x,t[57]=B):B=t[57];const D=!i.trim();let O,T,j,V,Z;return t[58]!==p||t[59]!==D?(O=nt.jsx(ja,{onClick:p,disabled:D,size:"sm",className:"w-full",children:"Add"}),t[58]=p,t[59]=D,t[60]=O):O=t[60],t[61]!==B||t[62]!==O||t[63]!==I||t[64]!==v?(T=nt.jsxs("div",{className:I,children:[v,B,O]}),t[61]=B,t[62]=O,t[63]=I,t[64]=v,t[65]=T):T=t[65],t[66]!==C||t[67]!==T||t[68]!==M?(j=nt.jsx(C,{className:M,children:T}),t[66]=C,t[67]=T,t[68]=M,t[69]=j):j=t[69],t[70]!==y||t[71]!==j?(V=nt.jsx(y,{children:j}),t[70]=y,t[71]=j,t[72]=V):V=t[72],t[73]!==b||t[74]!==V||t[75]!==S?(Z=nt.jsxs(b,{children:[S,V]}),t[73]=b,t[74]=V,t[75]=S,t[76]=Z):Z=t[76],Z};function ap(e){return nt.jsx(Bp,{value:e,children:Wp(e)},e)}function v0(e,t){return e.map(n=>{const r=n,o=Object.keys(r);if(t<0||t>=o.length)return r;const i=o[t],{[i]:l,...a}=r;return a})}function w0(e,t){return t?e.map(n=>({...n,[t]:""})):e}function y0(e,t,n){return t&&n&&t!==n?e.map(r=>{const o=r,{[t]:i,...l}=o;return{...l,[n]:o[t]}}):e}function Ur(e){var l;const{columnFields:t,columnIdx:n,type:r,dataType:o,newColumnName:i}=e;switch(r){case"insert":{if(!i)return La.error("newName is required for insert"),t;const a=Object.entries(t),s=[...a.slice(0,n),[i,o||"string"],...a.slice(n)];return Object.fromEntries(s)}case"remove":{if(n<0||n>=Object.keys(t).length)return t;const a=Object.entries(t),s=(l=a[n])==null?void 0:l[0];if(s){const{[s]:c,...h}=t;return h}return t}case"rename":{if(!i)return La.error("newName is required for rename"),t;if(n<0||n>=Object.keys(t).length)return t;const a=Object.entries(t),s=[...a.slice(0,n),[i,o||"string"],...a.slice(n+1)];return Object.fromEntries(s)}}}let xa;xa=({data:e,setData:t,columnFields:n,setColumnFields:r,editableColumns:o,edits:i,onAddEdits:l,onAddRows:a,onDeleteRows:s,onRenameColumn:c,onDeleteColumn:h,onAddColumn:C})=>{const{theme:y}=Up(),b=d.useRef(null),[p,m]=d.useState(),[E,g]=d.useState(!1),[w,x]=$t.useState({columns:yt.empty(),rows:yt.empty()}),[I,v]=d.useState({}),M=qp();Jp(()=>{if(i.length===0)return;const ie=new Map;for(const N of i)if(p0(N))if(N.rowIdx>=e.length){ie.has(N.rowIdx)||ie.set(N.rowIdx,{});const U=ie.get(N.rowIdx);U&&(U[N.columnId]=N.value)}else t(U=>{const ue=[...U];return ue[N.rowIdx][N.columnId]=N.value,ue});else if(np(N)&&N.type===Hi.Remove)t(U=>U.filter((ue,pe)=>pe!==N.rowIdx));else if(rp(N))switch(N.type){case Hi.Remove:t(U=>v0(U,N.columnIdx)),r(U=>Ur({columnFields:U,columnIdx:N.columnIdx,type:"remove"}));break;case Hi.Insert:r(U=>Ur({columnFields:U,columnIdx:N.columnIdx,type:"insert",newColumnName:N.newName})),t(U=>w0(U,N.newName));break;case Hi.Rename:{const U=S[N.columnIdx].title,ue=N.newName;if(!U||!ue)return;r(pe=>Ur({columnFields:pe,columnIdx:N.columnIdx,type:"rename",newColumnName:ue})),t(pe=>y0(pe,U,ue));break}}const W=[...ie.entries()].sort(([N],[U])=>N-U).map(([,N])=>N);W.length>0&&t(N=>[...N,...W]),M()});const S=d.useMemo(()=>{const ie=[];for(const[W,N]of Object.entries(n)){const U=o==="all"||o.includes(W);ie.push({id:W,title:W,width:I[W],icon:U?tp(N):Jn.ProtectedColumnOverlay,style:"normal",kind:ep(N),dataType:N,hasMenu:!0,themeOverride:U?void 0:{bgCell:y==="light"?"#F9F9FA":"#1e1e21"}})}return ie},[n,I,o,y]),H=d.useCallback(ie=>{const[W,N]=ie,U=e[N][S[W].title],ue=S[W].kind,pe=o==="all"||o.includes(S[W].title);if(ue===me.Boolean){const ze=!!U;return{kind:me.Boolean,allowOverlay:!1,readonly:!pe,data:ze}}return ue===me.Number&&typeof U=="number"?{kind:me.Number,allowOverlay:pe,readonly:!pe,displayData:String(U),data:U}:{kind:me.Text,allowOverlay:pe,readonly:!pe,displayData:String(U),data:String(U)}},[S,e,o]),f=d.useCallback((ie,W)=>{const[N,U]=ie,ue=S[N],pe=ue.title;let ze=W.data;ue.dataType!=="number"&&ue.dataType!=="integer"||W.data!==void 0&&W.data!==""||(ze=null),t(Ue=>{const He=[...Ue];return He[U][pe]=ze,He}),l([{rowIdx:U,columnId:pe,value:ze}])},[S,l,t]),B=d.useCallback((ie,W)=>{v(N=>({...N,[ie.title]:W}))},[]),D=d.useCallback((ie,W,N)=>{const[U,ue]=ie,pe=S[U].title;switch(n[pe]){case"number":case"integer":if(Number.isNaN(Number(W.data)))return!1;break;case"boolean":if(typeof W.data!="boolean")return!1}return!0},[n,S]),O=d.useCallback(ie=>{if(b.current)if(Na.isMetaOrCtrl(ie)&&ie.key==="c")b.current.emit("copy");else{if(!Na.isMetaOrCtrl(ie)||ie.key!=="v")return Na.isMetaOrCtrl(ie)&&ie.key==="f"?(g(W=>!W),ie.stopPropagation(),void ie.preventDefault()):void(ie.key!=="Escape"||g(!1));(function(W){const{selection:N,data:U,setData:ue,onAddEdits:pe,columns:ze,editableColumns:Ue}=W;if(!N.current)return;const{range:He}=N.current,{x:$e,y:be}=He;navigator.clipboard.readText().then(ye=>{if(!ye.trim())return;const Fe=ye.split(`
|
132
132
|
`).filter(Ee=>Ee.trim()),Oe=[];for(const Ee of Fe){const ke=Ee.split(" ");Oe.push(ke)}if(Oe.length===0)return;const te=[];for(const[Ee,ke]of Oe.entries()){if(!ke)continue;const Xe=be+Ee;if(Xe>=U.length)break;for(const[Re,qe]of ke.entries()){if(qe===void 0)continue;const Ye=$e+Re;if(!ze||Ye>=ze.length)break;const ot=ze[Ye],Me=ot.dataType;if(Ue!=="all"&&!Ue.includes(ot.title))continue;let Pe=qe;switch(Me){case"integer":case"number":{const tt=Number(qe);if(Number.isNaN(tt))continue;Pe=tt;break}case"boolean":{const tt=qe.toLowerCase();Pe=tt==="true"||tt==="1";break}}const ut=ze[Ye].title;te.push({rowIdx:Xe,columnId:ut,value:Pe})}}te.length>0&&(pe(te),ue(Ee=>{const ke=[...Ee];for(const Xe of te)if(p0(Xe)){const Re=Xe.rowIdx,qe=Xe.columnId;if(Re<ke.length){const Ye=ke[Re];qe in Ye&&(Ye[qe]=Xe.value)}}return ke}))}).catch(ye=>{La.error("Failed to read clipboard data",ye)})})({selection:w,data:e,setData:t,columns:S,editableColumns:o,onAddEdits:l})}},[S,e,o,l,w,t]),T=d.useCallback(()=>{const ie=Object.fromEntries(S.map(W=>{const N=W.dataType;switch(N){case"boolean":return[W.title,!1];case"number":case"integer":return[W.title,null];case"date":case"datetime":case"time":return[W.title,new Date];case"string":case"unknown":return[W.title,""];default:return _0(N),[W.title,""]}}));a([ie]),t(W=>[...W,ie])},[S,a,t]),j=Qp((ie,W)=>{m({col:ie,bounds:W})}),V=async()=>{if(p){const ie=S[p.col].title;await rm(ie),m(void 0)}};function Z(ie){om({title:`Column '${ie}' already exists`,description:"Please enter a different column name",variant:"danger"})}const J=ie=>{if(p){const W=S[p.col].title;if(n[ie])return void Z(ie);const N=S[p.col].dataType;c(p.col,ie),r(U=>Ur({columnFields:U,columnIdx:p.col,type:"rename",dataType:N,newColumnName:ie})),t(U=>y0(U,W,ie)),m(void 0)}},ce=()=>{p&&(h(p.col),r(ie=>Ur({columnFields:ie,columnIdx:p.col,type:"remove"})),t(ie=>v0(ie,p.col)),m(void 0))},le=ie=>{const{direction:W,columnName:N,dataType:U}=ie;if(p){const ue=p.col+(W==="left"?0:1),pe=Math.max(0,Math.min(ue,S.length));if(n[N])return void Z(N);C(pe,N),r(ze=>Ur({columnFields:ze,columnIdx:pe,type:"insert",dataType:U,newColumnName:N})),t(ze=>w0(ze,N)),m(void 0)}},q=(p==null?void 0:p.col)===S.length-1,Q=p!==void 0,fe="mr-2 h-3.5 w-3.5",ee=e.length>1e5,se=o==="all";return nt.jsxs("div",{className:"relative",children:[nt.jsx(Zp,{children:nt.jsx(Zg,{ref:b,getCellContent:H,columns:S,gridSelection:w,onGridSelectionChange:x,rows:e.length,overscrollX:50,smoothScrollX:!ee,smoothScrollY:!ee,validateCell:D,getCellsForSelection:!0,onPaste:!0,showSearch:E,fillHandle:!0,allowedFillDirections:"vertical",onKeyDown:O,height:e.length>10?450:void 0,width:"100%",rowMarkers:{kind:"both"},rowSelectionMode:"multi",onCellEdited:f,onColumnResize:B,onHeaderMenuClick:j,theme:op(y),trailingRowOptions:{hint:"New row",sticky:!0,tint:!0},onRowAppended:T,maxColumnAutoWidth:600,maxColumnWidth:600})}),(()=>{if(!Q)return;const ie=nt.jsxs(nt.Fragment,{children:[se&&nt.jsx(ip,{currentColumnName:S[p.col].title,onRename:J,onCancel:()=>m(void 0)}),nt.jsx(G0,{}),nt.jsx(m0,{direction:"left",onAdd:(W,N)=>le({direction:"left",columnName:W,dataType:N}),onCancel:()=>m(void 0)}),nt.jsx(m0,{direction:"right",onAdd:(W,N)=>le({direction:"right",columnName:W,dataType:N}),onCancel:()=>m(void 0)}),nt.jsx(G0,{}),!q&&se&&nt.jsxs(Y0,{onClick:ce,className:"text-destructive focus:text-destructive",children:[nt.jsx(am,{className:fe}),"Delete column"]})]});return nt.jsx(em,{open:Q,onOpenChange:W=>!W&&m(void 0),children:nt.jsxs(tm,{style:{left:(p==null?void 0:p.bounds.x)??0,top:((p==null?void 0:p.bounds.y)??0)+((p==null?void 0:p.bounds.height)??0)},className:"fixed w-52",children:[nt.jsxs(Y0,{onClick:V,children:[nt.jsx(nm,{className:fe}),"Copy column name"]}),!ee&&ie]})})})(),nt.jsx("div",{className:"absolute bottom-1 right-2 w-26",children:nt.jsx(ja,{variant:"destructive",size:"sm",disabled:w.rows.length===0,className:"right-2 h-7",onClick:()=>{const ie=w.rows.toArray();s(ie);let W=0;for(const N of ie){const U=N-W;t(ue=>ue.filter((pe,ze)=>ze!==U)),W++}x({columns:yt.empty(),rows:yt.empty()})},children:w.rows.length<=1?"Delete row":"Delete rows"})})]})},K0=Object.freeze(Object.defineProperty({__proto__:null,GlideDataEditor:xa,default:xa},Symbol.toStringTag,{value:"Module"}))});export{Ba as C,Wa as T,lm as __tla,kr as a,$a as b,K0 as g,Mr as i,Xa as m,Cn as s};
|