From 7dd73148c51c9d2ebbf8ca254a1eec84f94d3a4a Mon Sep 17 00:00:00 2001 From: Cristine Guadelupe Date: Thu, 2 May 2024 19:31:13 +0800 Subject: [PATCH] Fix custom header title --- assets/data_table/src/App.js | 2 -- lib/assets/data_table/build/main.js | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/assets/data_table/src/App.js b/assets/data_table/src/App.js index 34345e05..6df76fac 100644 --- a/assets/data_table/src/App.js +++ b/assets/data_table/src/App.js @@ -284,8 +284,6 @@ export function App({ ctx, data }) { ctx.translate(arrowX, arrowY); ctx.fill(p); } - - drawContent(); }, [content] ); diff --git a/lib/assets/data_table/build/main.js b/lib/assets/data_table/build/main.js index 51e1db3d..fcf5391c 100644 --- a/lib/assets/data_table/build/main.js +++ b/lib/assets/data_table/build/main.js @@ -163,21 +163,21 @@ Please report this to https://github.com/markedjs/marked.`,t.silent)return"

An -`},fi={headerRowID:Ic,headerNumber:_c,headerCode:Oc,headerString:Wc,headerBoolean:qc,headerAudioUri:Uc,headerVideoUri:Gc,headerEmoji:Kc,headerImage:Xc,headerUri:xi,headerPhone:jc,headerMarkdown:Yc,headerDate:Qc,headerTime:Jc,headerEmail:em,headerReference:tm,headerIfThenElse:im,headerSingleValue:lm,headerLookup:rm,headerTextTemplate:sm,headerMath:am,headerRollup:om,headerJoinStrings:nm,headerSplitString:Cm,headerGeoDistance:cm,headerArray:mm,rowOwnerOverlay:hm,protectedColumnOverlay:wm,renameIcon:$c};function gm(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}var X7=class{constructor(t,i){c2(this,"onSettled");c2(this,"spriteMap",new Map);c2(this,"headerIcons");c2(this,"inFlight",0);this.onSettled=i,this.headerIcons=t!=null?t:{}}drawSprite(t,i,l,r,s,a,o,n=1){let[C,c]=gm(i,o),h=a*Math.ceil(window.devicePixelRatio),g=`${C}_${c}_${h}_${t}`,m=this.spriteMap.get(g);if(m===void 0){let w=this.headerIcons[t];if(w===void 0)return;m=document.createElement("canvas");let L=m.getContext("2d");if(L===null)return;let v=new Image;v.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(w({fgColor:c,bgColor:C}))}`,this.spriteMap.set(g,m);let V=v.decode();if(V===void 0)return;this.inFlight++,V.then(()=>{L.drawImage(v,0,0,h,h)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else n<1&&(l.globalAlpha=n),l.drawImage(m,0,0,h,h,r,s,a,a),n<1&&(l.globalAlpha=1)}};var q8=F1(A9(),1),us=F1(h8(),1);function j7(e){if(e.length===0)return;let t;for(let i of e)t=Math.min(t!=null?t:i.y,i.y)}function U4(e,t,i,l,r,s,a,o,n){o=o!=null?o:t;let C=t,c=e,h=l-s,g=!1;for(;Co&&n(C,c,m,!1,a&&c===l-1)===!0){g=!0;break}C+=m,c++}if(!g){C=i;for(let m=0;m!w.sticky))==null?void 0:g.sourceIndex)!=null?m:0;if(n>h){let w=Math.max(o,h),L=t,v=l;for(let V=s.sourceIndex-1;V>=w;V--)L-=a[V].width,v+=a[V].width;for(let V=s.sourceIndex+1;V<=n;V++)v+=a[V].width;c={x:L,y:i,width:v,height:r}}if(h>o){let w=Math.min(n,h-1),L=t,v=l;for(let V=s.sourceIndex-1;V>=o;V--)L-=a[V].width,v+=a[V].width;for(let V=s.sourceIndex+1;V<=w;V++)v+=a[V].width;C={x:L,y:i,width:v,height:r}}return[C,c]}function Zi(e,t,i,l){if(l==="any")return w8(e,{x:t,y:i,width:1,height:1});if(l==="vertical"&&(t=e.x),l==="horizontal"&&(i=e.y),_7([t,i],e))return;let r=t-e.x,s=e.x+e.width-t,a=i-e.y+1,o=e.y+e.height-i,n=Math.min(l==="vertical"?Number.MAX_SAFE_INTEGER:r,l==="vertical"?Number.MAX_SAFE_INTEGER:s,l==="horizontal"?Number.MAX_SAFE_INTEGER:a,l==="horizontal"?Number.MAX_SAFE_INTEGER:o);return n===o?{x:e.x,y:e.y+e.height,width:e.width,height:i-e.y-e.height+1}:n===a?{x:e.x,y:i,width:e.width,height:e.y-i}:n===s?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function H5(e,t,i,l,r,s,a,o){return e<=r+a&&r<=e+i&&t<=s+o&&s<=t+l}function G4(e,t,i){return t>=e.x&&t<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function w8(e,t){let i=Math.min(e.x,t.x),l=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width)-i,s=Math.max(e.y+e.height,t.y+t.height)-l;return{x:i,y:l,width:r,height:s}}function Ei(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function Ni(e,t,i,l){if(e.x>t||e.y>i||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>i)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=i)return e;let r=-4,s=-4,a=t+4,o=i+4,n=r-e.x,C=e.x+e.width-a,c=s-e.y,h=e.y+e.height-o,g=n>0?e.x+Math.floor(n/l)*l:e.x,m=C>0?e.x+e.width-Math.floor(C/l)*l:e.x+e.width,w=c>0?e.y+Math.floor(c/l)*l:e.y,L=h>0?e.y+e.height-Math.floor(h/l)*l:e.y+e.height;return{x:g,y:w,width:m-g,height:L-w}}function Ri(e,t,i,l,r){let[s,a,o,n]=t,[C,c,h,g]=r,{x:m,y:w,width:L,height:v}=e,V=[];if(L<=0||v<=0)return V;let u=m+L,d=w+v,p=mo,x=w+v>n,N=m>=s&&ms&&u<=o||mo,E=w>=a&&wa&&d<=n||wn;if(N&&E){let k=Math.max(m,s),b=Math.max(w,a),D=Math.min(u,o),B=Math.min(d,n);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:C,y:c,width:h-C+1,height:g-c+1}})}if(p&&Z){let k=m,b=w,D=Math.min(u,s),B=Math.min(d,a);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:0,y:0,width:C+1,height:c+1}})}if(Z&&N){let k=Math.max(m,s),b=w,D=Math.min(u,o),B=Math.min(d,a);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:C,y:0,width:h-C+1,height:c+1}})}if(Z&&R){let k=Math.max(m,o),b=w,D=u,B=Math.min(d,a);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:h,y:0,width:i-h+1,height:c+1}})}if(p&&E){let k=m,b=Math.max(w,a),D=Math.min(u,s),B=Math.min(d,n);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:0,y:c,width:C+1,height:g-c+1}})}if(R&&E){let k=Math.max(m,o),b=Math.max(w,a),D=u,B=Math.min(d,n);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:h,y:c,width:i-h+1,height:g-c+1}})}if(p&&x){let k=m,b=Math.max(w,n),D=Math.min(u,s),B=d;V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:0,y:g,width:C+1,height:l-g+1}})}if(x&&N){let k=Math.max(m,s),b=Math.max(w,n),D=Math.min(u,o),B=d;V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:C,y:g,width:h-C+1,height:l-g+1}})}if(R&&x){let k=Math.max(m,o),b=Math.max(w,n),D=u,B=d;V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:h,y:g,width:i-h+1,height:l-g+1}})}return V}var Hm={kind:c1.Loading,allowOverlay:!1};function L8(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V,u,d,p,Z,R,x,N,E,S,k,b,D,B,_,K,Q,m1){var e2;let g1=(e2=d==null?void 0:d.size)!=null?e2:Number.MAX_SAFE_INTEGER,w1=performance.now(),G=D.baseFontFull;e.font=G;let s1={ctx:e},o1=[0,0],R1=v>0?a4(n,v,C):0,J,I1,p1=j7(u);return _0(t,o,s,a,r,(H1,W1,E2,Z2,u2)=>{var H2;let y1=Math.max(0,Z2-W1),t2=W1+y1,w2=r+1,i2=H1.width-y1,a1=l-r-1;if(u.length>0){let t1=!1;for(let V1=0;V1{e.save(),e.beginPath(),e.rect(t2,w2,i2,a1),e.clip()},l2=p.columns.hasIndex(H1.sourceIndex),q1=h((H2=H1.group)!=null?H2:"").overrideTheme,S1=H1.themeOverride===void 0&&q1===void 0?D:r4(D,q1,H1.themeOverride),$1=S1.baseFontFull;$1!==G&&(G=$1,e.font=$1),T1();let U1;return U4(u2,E2,l,n,C,v,V,p1,(t1,V1,f1,b1,z2)=>{var Z0,o4,T0,m0;if(V1<0||(o1[0]=H1.sourceIndex,o1[1]=V1,d!==void 0&&!d.has(o1)))return;if(u.length>0){let B1=!1;for(let S2=0;S2l1.span!==void 0&&B1>=l1.span[0]&&B1<=l1.span[1]);Y2&&!w&&L?J2=0:Y2&&L&&(J2=Math.max(J2,1)),k0&&J2++,Y2||(n1&&J2++,l2&&!z2&&J2++);let C2=l1.kind===c1.Protected?c0.bgCellMedium:c0.bgCell,m2;if((b1||C2!==D.bgCell)&&(m2=y0(C2,m2)),J2>0||L1){L1&&(m2=y0(c0.bgHeader,m2));for(let B1=0;B1m1&&!Q2){let B1=c0.baseFontFull;B1!==G&&(e.font=B1,G=B1),U1=V8(e,l1,H1.sourceIndex,V1,A2,y2,M1,t1,Z1,f1,J2>0,c0,m2!=null?m2:c0.bgCell,x,N,(T0=F2==null?void 0:F2.hoverAmount)!=null?T0:0,S,b,w1,k,U1,B,_,K,Q)}return L2&&e.restore(),l1.style==="faded"&&(e.globalAlpha=1),g1--,R2&&(e.restore(),(m0=U1==null?void 0:U1.deprep)==null||m0.call(U1,s1),U1=void 0,T1(),G=$1,e.font=$1),g1<=0}),e.restore(),g1<=0}),J}var I9=[0,0],O9={x:0,y:0,width:0,height:0},g8=[void 0,()=>{}],H8=!1;function Lm(){H8=!0}function V8(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V,u,d,p,Z,R,x,N){var _,K;let E,S;v!==void 0&&v[0][0]===i&&v[0][1]===l&&(E=v[1][0],S=v[1][1]);let k;I9[0]=i,I9[1]=l,O9.x=a,O9.y=o,O9.width=n,O9.height=C,g8[0]=R.getValue(I9),g8[1]=Q=>R.setValue(I9,Q),H8=!1;let b={ctx:e,theme:h,col:i,row:l,cell:t,rect:O9,highlighted:c,cellFillColor:g,hoverAmount:L,frameTime:u,hoverX:E,drawState:g8,hoverY:S,imageLoader:m,spriteManager:w,hyperWrapping:V,overrideCursor:E!==void 0?N:void 0,requestAnimationFrame:Lm},D=vt(b,t.lastUpdated,u,p,r,s),B=x(t);if(B!==void 0){(p==null?void 0:p.renderer)!==B&&((_=p==null?void 0:p.deprep)==null||_.call(p,b),p=void 0);let Q=(K=B.drawPrep)==null?void 0:K.call(B,b,p);d!==void 0&&!F4(b.cell)?d(b,()=>B.draw(b,t)):B.draw(b,t),k=Q===void 0?void 0:{deprep:Q==null?void 0:Q.deprep,fillStyle:Q==null?void 0:Q.fillStyle,font:Q==null?void 0:Q.font,renderer:B}}return(D||H8)&&(Z==null||Z(I9)),k}function j5(e,t,i,l,r,s,a,o,n=-20,C=-20,c=32,h="center",g="square"){var p;let m=Math.floor(r+a/2),w=g==="circle"?1e4:(p=t.roundingRadius)!=null?p:4,L=F7(c,a,t.cellVerticalPadding),v=L/2,V=b7(h,l,s,t.cellHorizontalPadding,L),u=y7(V,m,L),d=S7(l+n,r+C,u);switch(i){case!0:{e.beginPath(),f0(e,V-L/2,m-L/2,L,L,w),g==="circle"&&(v*=.8,L*=.8),e.fillStyle=o?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(V-v+L/4.23,m-v+L/1.97),e.lineTo(V-v+L/2.42,m-v+L/1.44),e.lineTo(V-v+L/1.29,m-v+L/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case O5:case!1:{e.beginPath(),f0(e,V-L/2+.5,m-L/2+.5,L-1,L-1,w),e.lineWidth=1,e.strokeStyle=d?t.textDark:t.textMedium,e.stroke();break}case _5:{e.beginPath(),f0(e,V-L/2,m-L/2,L,L,w),e.fillStyle=d?t.textMedium:t.textLight,e.fill(),g==="circle"&&(v*=.8,L*=.8),e.beginPath(),e.moveTo(V-L/3,m),e.lineTo(V+L/3,m),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:l5(i)}}function zi(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V,u){var x;let d=a+o;if(d<=0)return;e.fillStyle=h.bgHeader,e.fillRect(0,0,r,d);let[p,Z]=(x=l==null?void 0:l[0])!=null?x:[],R=h.headerFontFull;e.font=R,_0(t,0,s,0,d,(N,E,S,k)=>{var o1,R1,J;if(v!==void 0&&!v.has([N.sourceIndex,-1]))return;let b=Math.max(0,k-E);e.save(),e.beginPath(),e.rect(E+b,o,N.width-b,a),e.clip();let D=L((o1=N.group)!=null?o1:"").overrideTheme,B=N.themeOverride===void 0&&D===void 0?h:r4(h,D,N.themeOverride);B.bgHeader!==h.bgHeader&&(e.fillStyle=B.bgHeader,e.fill()),B!==h&&(e.font=B.baseFontFull);let _=c.columns.hasIndex(N.sourceIndex),K=n!==void 0||C,Q=!K&&Z===-1&&p===N.sourceIndex,m1=K?0:(J=(R1=m.find(I1=>I1.item[0]===N.sourceIndex&&I1.item[1]===-1))==null?void 0:R1.hoverAmount)!=null?J:0,g1=(c==null?void 0:c.current)!==void 0&&c.current.cell[0]===N.sourceIndex,w1=_?B.accentColor:g1?B.bgHeaderHasFocus:B.bgHeader,G=i?o:0,s1=N.sourceIndex===0?0:1;_?(e.fillStyle=w1,e.fillRect(E+s1,G,N.width-s1,a)):(g1||m1>0)&&(e.beginPath(),e.rect(E+s1,G,N.width-s1,a),g1&&(e.fillStyle=B.bgHeaderHasFocus,e.fill()),m1>0&&(e.globalAlpha=m1,e.fillStyle=B.bgHeaderHovered,e.fill(),e.globalAlpha=1)),v8(e,E,G,N.width,a,N,_,B,Q,g1,m1,g,V,u),e.restore()}),i&&Vm(e,t,r,s,o,l,h,g,m,w,L,v)}function Vm(e,t,i,l,r,s,a,o,n,C,c,h){var v;let[m,w]=(v=s==null?void 0:s[0])!=null?v:[],L=0;Y7(t,i,l,r,(V,u,d,p,Z,R)=>{var k,b;if(h!==void 0&&!h.hasItemInRectangle({x:V[0],y:-2,width:V[1]-V[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(d,p,Z,R),e.clip();let x=c(u),N=(x==null?void 0:x.overrideTheme)===void 0?a:r4(a,x.overrideTheme),E=w===-2&&m!==void 0&&m>=V[0]&&m<=V[1],S=E?N.bgHeaderHovered:N.bgHeader;if(S!==a.bgHeader&&(e.fillStyle=S,e.fill()),e.fillStyle=(k=N.textGroupHeader)!=null?k:N.textHeader,x!==void 0){let D=d;if(x.icon!==void 0&&(o.drawSprite(x.icon,"normal",e,D+8,(r-20)/2,20,N),D+=26),e.fillText(x.name,D+8,r/2+x0(e,a.headerFontFull)),x.actions!==void 0&&E){let B=u8({x:d,y:p,width:Z,height:R},x.actions);e.beginPath();let _=B[0].x-10,K=d+Z-_;e.rect(_,0,K,r);let Q=e.createLinearGradient(_,0,_+K,0),m1=z0(S,0);Q.addColorStop(0,m1),Q.addColorStop(10/K,S),Q.addColorStop(1,S),e.fillStyle=Q,e.fill(),e.globalAlpha=.6;let[g1,w1]=(b=s==null?void 0:s[1])!=null?b:[-1,-1];for(let G=0;G35){let p=g?35:l-35,Z=g?35*.7:l-35*.7,R=p/l,x=Z/l,N=e.createLinearGradient(t,0,t+l,0),E=z0(L,0);N.addColorStop(g?1:0,L),N.addColorStop(R,L),N.addColorStop(x,E),N.addColorStop(g?0:1,E),e.fillStyle=N}else e.fillStyle=L;if(g&&(e.textAlign="right"),e.fillText(s.title,u,i+r/2+x0(e,o.headerFontFull)),g&&(e.textAlign="left"),v&&s.hasMenu===!0)if(s.menuIcon===void 0||s.menuIcon===k3.Triangle){e.beginPath();let d=m.x+m.width/2-5.5,p=m.y+m.height/2-3;t8(e,[{x:d,y:p},{x:d+11,y:p},{x:d+5.5,y:p+6}],1),e.fillStyle=L,e.fill()}else if(s.menuIcon===k3.Dots){e.beginPath();let d=m.x+m.width/2,p=m.y+m.height/2;Mt(e,d,p),e.fillStyle=L,e.fill()}else{let d=m.x+(m.width-o.headerIconSize)/2,p=m.y+(m.height-o.headerIconSize)/2;c.drawSprite(s.menuIcon,"normal",e,d,p,o.headerIconSize,o)}}function v8(e,t,i,l,r,s,a,o,n,C,c,h,g,m){let w=$5(s.title)==="rtl",L=d8(t,i,l,r,w);g!==void 0?g({ctx:e,theme:o,rect:{x:t,y:i,width:l,height:r},column:s,columnIndex:s.sourceIndex,isSelected:a,hoverAmount:c,isHovered:n,hasSelectedCell:C,spriteManager:h,menuBounds:L},()=>Bi(e,t,i,l,r,s,a,o,n,c,h,m,w,L)):Bi(e,t,i,l,r,s,a,o,n,c,h,m,w,L)}var ns=F1(os(),1);function Cs(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V,u){if(V!==void 0||t[t.length-1]!==i[t.length-1])return;let d=j7(v);_0(t,n,a,o,s,(p,Z,R,x,N)=>{if(p!==t[t.length-1])return;Z+=p.width;let E=Math.max(Z,x);E>l||(e.save(),e.beginPath(),e.rect(E,s+1,1e4,r-s-1),e.clip(),U4(N,R,r,C,c,w,L,d,(S,k,b,D)=>{if(!D&&v.length>0&&!v.some(m1=>H5(Z,S,1e4,b,m1.x,m1.y,m1.width,m1.height)))return;let B=g.hasIndex(k),_=m.hasIndex(k);e.beginPath();let K=h==null?void 0:h(k),Q=K===void 0?u:r4(u,K);Q.bgCell!==u.bgCell&&(e.fillStyle=Q.bgCell,e.fillRect(Z,S,1e4,b)),_&&(e.fillStyle=Q.bgHeader,e.fillRect(Z,S,1e4,b)),B&&(e.fillStyle=Q.accentLight,e.fillRect(Z,S,1e4,b))}),e.restore())})}function cs(e,t,i,l,r,s,a,o,n){var w;let C=!1;for(let L of t)if(!L.sticky){C=a(L.sourceIndex);break}let c=(w=n.horizontalBorderColor)!=null?w:n.borderColor,h=n.borderColor,g=C?Z4(t):0,m;if(g!==0&&(m=P3(h,n.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,l),e.strokeStyle=m,e.stroke()),r>0){let L=h===c&&m!==void 0?m:P3(c,n.bgCell),v=a4(s,r,o);e.beginPath(),e.moveTo(0,l-v+.5),e.lineTo(i,l-v+.5),e.strokeStyle=L,e.stroke()}}var ms=(e,t,i)=>{let l=0,r=t,s=0,a=i;if(e!==void 0&&e.length>0){l=Number.MAX_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;for(let o of e)l=Math.min(l,o.x-1),r=Math.max(r,o.x+o.width+1),s=Math.min(s,o.y-1),a=Math.max(a,o.y+o.height+1)}return{minX:l,maxX:r,minY:s,maxY:a}};function hs(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w){var b;let L=w.bgCell,{minX:v,maxX:V,minY:u,maxY:d}=ms(o,s,a),p=[],Z=a-a4(m,g,C),R=n,x=i,N=0;for(;R+r=u&&D<=d-1){let _=c==null?void 0:c(x),K=_==null?void 0:_.bgCell;K!==void 0&&K!==L&&x>=m-g&&p.push({x:v,y:D,w:V-v,h:B,color:K})}R+=B,x0)for(let D=0;D=v&&_<=V&&h(D+1)&&p.push({x:_,y:N,w:B.width,h:S,color:K}),E+=B.width}if(p.length===0)return;let k;e.beginPath();for(let D=p.length-1;D>=0;D--){let B=p[D];k===void 0?k=B.color:B.color!==k&&(e.fillStyle=k,e.fill(),e.beginPath(),k=B.color),e.rect(B.x,B.y,B.w,B.h)}k!==void 0&&(e.fillStyle=k,e.fill()),e.beginPath()}function P8(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V=!1){var b,D,B;if(n!==void 0){e.beginPath(),e.save(),e.rect(0,0,s,a);for(let _ of n)e.rect(_.x+1,_.y+1,_.width-1,_.height-1);e.clip("evenodd")}let u=(b=v.horizontalBorderColor)!=null?b:v.borderColor,d=v.borderColor,{minX:p,maxX:Z,minY:R,maxY:x}=ms(o,s,a),N=[];e.beginPath();let E=.5;for(let _=0;_=p&&Q<=Z&&m(_+1)&&N.push({x1:Q,y1:Math.max(C,R),x2:Q,y2:Math.min(a,x),color:d})}let S=a+.5;for(let _=L-w;_=R&&m1<=x-1){let g1=g==null?void 0:g(K);N.push({x1:p,y1:m1,x2:Z,y2:m1,color:(B=(D=g1==null?void 0:g1.horizontalBorderColor)!=null?D:g1==null?void 0:g1.borderColor)!=null?B:u})}_+=h(K),K++}}let k=(0,ns.default)(N,_=>_.color);for(let _ of Object.keys(k)){e.strokeStyle=_;for(let K of k[_])e.moveTo(K.x1,K.y1),e.lineTo(K.x2,K.y2);e.stroke(),e.beginPath()}n!==void 0&&e.restore()}function ws(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V,u){let d=[];e.imageSmoothingEnabled=!1;let p=Math.min(r.cellYOffset,a),Z=Math.max(r.cellYOffset,a),R=0;if(typeof V=="number")R+=(Z-p)*V;else for(let B=p;Br.cellYOffset&&(R=-R),R+=n-r.translateY;let x=Math.min(r.cellXOffset,s),N=Math.max(r.cellXOffset,s),E=0;for(let B=x;Br.cellXOffset&&(E=-E),E+=o-r.translateX;let S=Z4(v);if(E!==0&&R!==0)return{regions:[]};let k=C>0?a4(g,C,V):0,b=c-S-Math.abs(E),D=h-m-k-Math.abs(R)-1;if(b>150&&D>150){let B={sx:0,sy:0,sw:c*w,sh:h*w,dx:0,dy:0,dw:c*w,dh:h*w};if(R>0?(B.sy=(m+1)*w,B.sh=D*w,B.dy=(R+m+1)*w,B.dh=D*w,d.push({x:0,y:m,width:c,height:R+1})):R<0&&(B.sy=(-R+m+1)*w,B.sh=D*w,B.dy=(m+1)*w,B.dh=D*w,d.push({x:0,y:h+R-k,width:c,height:-R+k})),E>0?(B.sx=S*w,B.sw=b*w,B.dx=(E+S)*w,B.dw=b*w,d.push({x:S-1,y:0,width:E+2,height:h})):E<0&&(B.sx=(S-E)*w,B.sw=b*w,B.dx=S*w,B.dw=b*w,d.push({x:c+E,y:0,width:-E,height:h})),e.setTransform(1,0,0,1,0,0),u){if(S>0&&E!==0&&R===0&&(l===void 0||(i==null?void 0:i[1])!==!1)){let _=S*w,K=h*w;e.drawImage(t,0,0,_,K,0,0,_,K)}if(k>0&&E===0&&R!==0&&(l===void 0||(i==null?void 0:i[0])!==!1)){let _=(h-k)*w,K=c*w,Q=k*w;e.drawImage(t,0,_,K,Q,0,_,K,Q)}}e.drawImage(t,B.sx,B.sy,B.sw,B.sh,B.dx,B.dy,B.dw,B.dh),e.scale(w,w)}return e.imageSmoothingEnabled=!0,{regions:d}}function gs(e,t,i,l,r,s,a,o,n,C){let c=[];return t!==e.cellXOffset||i!==e.cellYOffset||l!==e.translateX||r!==e.translateY||_0(n,i,l,r,o,(h,g,m,w)=>{if(h.sourceIndex===C){let L=Math.max(g,w)+1;return c.push({x:L,y:0,width:s-L,height:a}),!0}}),c}function Hs(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let r;for(let s=0;sx.style!=="no-outline");if(v===void 0||v.length===0)return;let V=Z4(o),u=a4(m,g,h),d=[n,0,o.length,m-g],p=[V,0,t,i-u],Z=v.map(x=>{var S;let N=x.range,E=(S=x.style)!=null?S:"dashed";return Ri(N,d,t,i,p).map(k=>{let b=k.rect,D=P9(b.x,b.y,t,i,c,C+c,l,r,s,a,m,n,g,o,h),B=b.width===1&&b.height===1?D:P9(b.x+b.width-1,b.y+b.height-1,t,i,c,C+c,l,r,s,a,m,n,g,o,h);return b.x+b.width>=o.length&&(B.width-=1),b.y+b.height>=m&&(B.height-=1),{color:x.color,style:E,clip:k.clip,rect:Ni({x:D.x,y:D.y,width:B.x+B.width-D.x,height:B.y+B.height-D.y},t,i,8)}})}),R=()=>{e.lineWidth=1;let x=!1;for(let N of Z)for(let E of N)if((E==null?void 0:E.rect)!==void 0&&H5(0,0,t,i,E.rect.x,E.rect.y,E.rect.width,E.rect.height)){let S=x,k=!Ei(E.clip,E.rect);k&&(e.save(),e.rect(E.clip.x,E.clip.y,E.clip.width,E.clip.height),e.clip()),E.style==="dashed"&&!x?(e.setLineDash([5,3]),x=!0):(E.style==="solid"||E.style==="solid-outline")&&x&&(e.setLineDash([]),x=!1),e.strokeStyle=E.style==="solid-outline"?y0(y0(E.color,L.borderColor),L.bgCell):z0(E.color,1),e.strokeRect(E.rect.x+.5,E.rect.y+.5,E.rect.width-1,E.rect.height-1),k&&(e.restore(),x=S)}x&&e.setLineDash([])};return R(),R}function A8(e,t,i,l,r){e.beginPath(),e.moveTo(t,i),e.lineTo(t,l),e.lineWidth=2,e.strokeStyle=r,e.stroke(),e.globalAlpha=1}function t3(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v){var B;if(c.current===void 0)return;let V=c.current.range,u=c.current.cell,d=[V.x+V.width-1,V.y+V.height-1];if(u[1]>=v&&d[1]>=v||!a.some(_=>_.sourceIndex===u[0]||_.sourceIndex===d[0]))return;let[Z,R]=c.current.cell,x=g(c.current.cell),N=(B=x.span)!=null?B:[Z,Z],E=R>=v-m,S=m>0&&!E?a4(v,m,h)-1:0,k=d[1],b;if(_0(a,l,r,s,C,(_,K,Q,m1,g1)=>{if(_.sticky&&Z>_.sourceIndex)return;let w1=_.sourceIndexN[1],s1=_.sourceIndex===d[0];if(!(!s1&&(w1||G)))return U4(g1,Q,i,v,h,m,w,void 0,(o1,R1,J)=>{if(R1!==R&&R1!==k)return;let I1=K,p1=_.width;if(x.span!==void 0){let H1=Q7(x.span,K,o1,_.width,J,_,o),W1=_.sticky?H1[0]:H1[1];W1!==void 0&&(I1=W1.x,p1=W1.width)}return R1===k&&s1&&L&&(b=()=>{var H1,W1;m1>I1&&!_.sticky&&(e.beginPath(),e.rect(m1,0,t-m1,i),e.clip()),e.beginPath(),e.rect(I1+p1-4,o1+J-4,4,4),e.fillStyle=(W1=(H1=_.themeOverride)==null?void 0:H1.accentColor)!=null?W1:n.accentColor,e.fill()}),b!==void 0}),b!==void 0}),b===void 0)return;let D=()=>{e.save(),e.beginPath(),e.rect(0,C,t,i-C-S),e.clip(),b==null||b(),e.restore()};return D(),D}function RH(e,t,i,l,r,s,a,o,n){n===void 0||n.size===0||(e.beginPath(),Y7(t,i,s,l,(C,c,h,g,m,w)=>{n.hasItemInRectangle({x:C[0],y:-2,width:C[1]-C[0]+1,height:1})&&e.rect(h,g,m,w)}),_0(t,o,s,a,r,(C,c,h,g)=>{let m=Math.max(0,g-c),w=c+m+1,L=C.width-m-1;n.has([C.sourceIndex,-1])&&e.rect(w,l,L,r-l)}),e.clip())}function BH(e,t,i,l,r,s,a,o,n,C){let c=0;return _0(e,s,l,r,i,(h,g,m,w,L)=>(U4(L,m,t,a,o,n,C,void 0,(v,V,u,d)=>{d||(c=Math.max(V,c))}),!0)),c}function I8(e,t){var C2,m2;let{canvasCtx:i,headerCanvasCtx:l,width:r,height:s,cellXOffset:a,cellYOffset:o,translateX:n,translateY:C,mappedColumns:c,enableGroups:h,freezeColumns:g,dragAndDropState:m,theme:w,drawFocus:L,headerHeight:v,groupHeaderHeight:V,disabledRows:u,rowHeight:d,verticalBorder:p,overrideCursor:Z,isResizing:R,selection:x,fillHandle:N,freezeTrailingRows:E,rows:S,getCellContent:k,getGroupDetails:b,getRowThemeOverride:D,isFocused:B,drawHeaderCallback:_,prelightCells:K,drawCellCallback:Q,highlightRegions:m1,resizeCol:g1,imageLoader:w1,lastBlitData:G,hoverValues:s1,hyperWrapping:o1,hoverInfo:R1,spriteManager:J,maxScaleFactor:I1,hasAppendRow:p1,touchMode:e2,enqueue:H1,renderStateProvider:W1,getCellRenderer:E2,renderStrategy:Z2,bufferACtx:u2,bufferBCtx:y1,damage:t2,minimumCellWidth:w2}=e;if(r===0||s===0)return;let i2=Z2==="double-buffer",a1=Math.min(I1,Math.ceil((C2=window.devicePixelRatio)!=null?C2:1)),T1=Z2!=="direct"&&Hs(e,t),l2=i.canvas;(l2.width!==r*a1||l2.height!==s*a1)&&(l2.width=r*a1,l2.height=s*a1,l2.style.width=r+"px",l2.style.height=s+"px");let q1=l.canvas,S1=h?V+v:v,$1=S1+1;(q1.width!==r*a1||q1.height!==$1*a1)&&(q1.width=r*a1,q1.height=$1*a1,q1.style.width=r+"px",q1.style.height=$1+"px");let U1=u2.canvas,H2=y1.canvas;i2&&(U1.width!==r*a1||U1.height!==s*a1)&&(U1.width=r*a1,U1.height=s*a1,G.current!==void 0&&(G.current.aBufferScroll=void 0)),i2&&(H2.width!==r*a1||H2.height!==s*a1)&&(H2.width=r*a1,H2.height=s*a1,G.current!==void 0&&(G.current.bBufferScroll=void 0));let t1=G.current;if(T1===!0&&a===(t1==null?void 0:t1.cellXOffset)&&o===(t1==null?void 0:t1.cellYOffset)&&n===(t1==null?void 0:t1.translateX)&&C===(t1==null?void 0:t1.translateY))return;let V1=null;i2&&(V1=i);let f1=l,b1;i2?t2!==void 0?b1=(t1==null?void 0:t1.lastBuffer)==="b"?y1:u2:b1=(t1==null?void 0:t1.lastBuffer)==="b"?u2:y1:b1=i;let z2=b1.canvas,n1=i2?z2===U1?H2:U1:l2,L1=typeof d=="number"?()=>d:d;f1.save(),b1.save(),f1.beginPath(),b1.beginPath(),f1.textBaseline="middle",b1.textBaseline="middle",a1!==1&&(f1.scale(a1,a1),b1.scale(a1,a1));let l1=T9(c,a,r,m,n),M1=[],Z1=L&&((m2=x.current)==null?void 0:m2.cell[1])===o&&C===0,R2=!1;if(m1!==void 0){for(let L2 of m1)if(L2.style!=="no-outline"&&L2.range.y===o&&C===0){R2=!0;break}}let Q2=()=>{var L2,A2;zi(f1,l1,h,R1,r,n,v,V,m,R,x,w,J,s1,p,b,t2,_,e2),P8(f1,l1,o,n,C,r,s,void 0,void 0,V,S1,L1,D,p,E,S,w,!0),f1.beginPath(),f1.moveTo(0,$1-.5),f1.lineTo(r,$1-.5),f1.strokeStyle=y0((A2=(L2=w.headerBottomBorderColor)!=null?L2:w.horizontalBorderColor)!=null?A2:w.borderColor,w.bgHeader),f1.stroke(),R2&&D8(f1,r,s,a,o,n,C,c,g,v,V,d,E,S,m1,w),Z1&&t3(f1,r,s,o,n,C,l1,c,w,S1,x,L1,k,E,p1,N,S)};if(t2!==void 0){let L2=l1[l1.length-1].sourceIndex+1,A2=t2.hasItemInRegion([{x:a,y:-2,width:L2,height:2},{x:a,y:o,width:L2,height:300},{x:0,y:o,width:g,height:300},{x:0,y:-2,width:g,height:2},{x:a,y:S-E,width:L2,height:E,when:E>0}]),y2=F2=>{L8(F2,l1,c,s,S1,n,C,o,S,L1,k,b,D,u,B,L,E,p1,M1,t2,x,K,m1,w1,J,s1,R1,Q,o1,w,H1,W1,E2,Z,w2);let Z0=x.current;N&&L&&Z0!==void 0&&t2.has(W7(Z0.range))&&t3(F2,r,s,o,n,C,l1,c,w,S1,x,L1,k,E,p1,N,S)};A2&&(y2(b1),V1!==null&&(V1.save(),V1.scale(a1,a1),V1.textBaseline="middle",y2(V1),V1.restore()),t2.hasHeader()&&(RH(f1,l1,r,V,S1,n,C,o,t2),Q2())),b1.restore(),f1.restore();return}if((T1!==!0||a!==(t1==null?void 0:t1.cellXOffset)||n!==(t1==null?void 0:t1.translateX)||Z1!==(t1==null?void 0:t1.mustDrawFocusOnHeader)||R2!==(t1==null?void 0:t1.mustDrawHighlightRingsOnHeader))&&Q2(),T1===!0){d0(n1!==void 0&&t1!==void 0);let{regions:L2}=ws(b1,n1,n1===U1?t1.aBufferScroll:t1.bBufferScroll,n1===U1?t1.bBufferScroll:t1.aBufferScroll,t1,a,o,n,C,E,r,s,S,S1,a1,c,l1,d,i2);M1=L2}else T1!==!1&&(d0(t1!==void 0),M1=gs(t1,a,o,n,C,r,s,S1,l1,T1));cs(b1,l1,r,s,E,S,p,L1,w);let e0=D8(b1,r,s,a,o,n,C,c,g,v,V,d,E,S,m1,w),t0=L?t3(b1,r,s,o,n,C,l1,c,w,S1,x,L1,k,E,p1,N,S):void 0;if(b1.fillStyle=w.bgCell,M1.length>0){b1.beginPath();for(let L2 of M1)b1.rect(L2.x,L2.y,L2.width,L2.height);b1.clip(),b1.fill(),b1.beginPath()}else b1.fillRect(0,0,r,s);let c0=L8(b1,l1,c,s,S1,n,C,o,S,L1,k,b,D,u,B,L,E,p1,M1,t2,x,K,m1,w1,J,s1,R1,Q,o1,w,H1,W1,E2,Z,w2);Cs(b1,l1,c,r,s,S1,n,C,o,S,L1,D,x.rows,u,E,p1,M1,t2,w),hs(b1,l1,o,n,C,r,s,M1,S1,L1,D,p,E,S,w),P8(b1,l1,o,n,C,r,s,M1,c0,V,S1,L1,D,p,E,S,w),e0==null||e0(),t0==null||t0(),R&&_0(l1,0,n,0,S1,(L2,A2)=>{var y2,F2;return L2.sourceIndex===g1?(A8(f1,A2+L2.width,0,S1+1,y0((y2=w.resizeIndicatorColor)!=null?y2:w.accentLight,w.bgHeader)),A8(b1,A2+L2.width,S1,s,y0((F2=w.resizeIndicatorColor)!=null?F2:w.accentLight,w.bgCell)),!0):!1}),V1!==null&&(V1.fillStyle=w.bgCell,V1.fillRect(0,0,r,s),V1.drawImage(b1.canvas,0,0));let Y2=BH(l1,s,S1,n,C,o,S,L1,E,p1);w1==null||w1.setWindow({x:a,y:o,width:l1.length,height:Y2-o},g,Array.from({length:E},(L2,A2)=>S-1-A2));let J2=t1!==void 0&&(a!==t1.cellXOffset||n!==t1.translateX),k0=t1!==void 0&&(o!==t1.cellYOffset||C!==t1.translateY);G.current={cellXOffset:a,cellYOffset:o,translateX:n,translateY:C,mustDrawFocusOnHeader:Z1,mustDrawHighlightRingsOnHeader:R2,lastBuffer:i2?z2===U1?"a":"b":void 0,aBufferScroll:z2===U1?[J2,k0]:t1==null?void 0:t1.aBufferScroll,bBufferScroll:z2===H2?[J2,k0]:t1==null?void 0:t1.bBufferScroll},b1.restore(),f1.restore()}var O8=F1(A9(),1);var zH=80;function yH(e){let t=e-1;return t*t*t+1}var i3=class{constructor(t){c2(this,"callback");c2(this,"currentHoveredItem");c2(this,"leavingItems",[]);c2(this,"lastAnimationTime");c2(this,"addToLeavingItems",t=>{this.leavingItems.some(l=>g5(l.item,t.item))||this.leavingItems.push(t)});c2(this,"removeFromLeavingItems",t=>{var l;let i=this.leavingItems.find(r=>g5(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==i),(l=i==null?void 0:i.hoverAmount)!=null?l:0});c2(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});c2(this,"shouldStep",()=>{let t=this.leavingItems.length>0,i=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||i});c2(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>P(y({},t),{hoverAmount:yH(t.hoverAmount)})));c2(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{let l=(t-this.lastAnimationTime)/zH;for(let s of this.leavingItems)s.hoverAmount=(0,O8.default)(s.hoverAmount-l,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=(0,O8.default)(this.currentHoveredItem.hoverAmount+l,0,1));let r=this.getAnimatingItems();this.callback(r),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0});c2(this,"setHovered",t=>{var i;if(!g5((i=this.currentHoveredItem)==null?void 0:i.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){let l=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:l}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}});this.callback=t}};var _8=class{constructor(t){c2(this,"fn");c2(this,"val");this.fn=t}get value(){var t;return(t=this.val)!=null?t:this.val=this.fn()}};function W8(e){return new _8(e)}var Ls=W8(()=>window.navigator.userAgent.includes("Firefox")),i9=W8(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),V5=W8(()=>window.navigator.platform.toLowerCase().startsWith("mac"));var d5=F1(Y1(),1);function Vs(e){let t=d5.useRef([]),i=d5.useRef(0),l=d5.useRef(e);l.current=e;let r=d5.useCallback(()=>{let s=()=>window.requestAnimationFrame(a),a=()=>{let o=t.current.map(X5);t.current=[],l.current(new R4(o)),t.current.length>0?i.current++:i.current=0};window.requestAnimationFrame(i.current>600?s:a)},[]);return d5.useCallback(s=>{t.current.length===0&&r();let a=F0(s[0],s[1]);t.current.includes(a)||t.current.push(a)},[r])}var B4="header",S0="group-header",l9="out-of-bounds",u5;(function(e){e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End"})(u5||(u5={}));function l3(e,t){return e===t?!0:(e==null?void 0:e.kind)==="out-of-bounds"?(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])&&(e==null?void 0:e.region[0])===(t==null?void 0:t.region[0])&&(e==null?void 0:e.region[1])===(t==null?void 0:t.region[1]):(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])}var ds=6,bH=(e,t)=>{var l;if(e.kind===c1.Custom)return e.copyData;let i=t==null?void 0:t(e);return(l=i==null?void 0:i.getAccessibilityString(e))!=null?l:""},FH=(e,t)=>{var m4,g0,H0,i0,h0,S5,i7,g9,L0,N0;let{width:i,height:l,accessibilityHeight:r,columns:s,cellXOffset:a,cellYOffset:o,headerHeight:n,fillHandle:C=!1,groupHeaderHeight:c,rowHeight:h,rows:g,getCellContent:m,getRowThemeOverride:w,onHeaderMenuClick:L,enableGroups:v,isFilling:V,onCanvasFocused:u,onCanvasBlur:d,isFocused:p,selection:Z,freezeColumns:R,onContextMenu:x,freezeTrailingRows:N,fixedShadowX:E=!0,fixedShadowY:S=!0,drawFocusRing:k,onMouseDown:b,onMouseUp:D,onMouseMoveRaw:B,onMouseMove:_,onItemHovered:K,dragAndDropState:Q,firstColAccessible:m1,onKeyDown:g1,onKeyUp:w1,highlightRegions:G,canvasRef:s1,onDragStart:o1,onDragEnd:R1,eventTargetRef:J,isResizing:I1,resizeColumn:p1,isDragging:e2,isDraggable:H1=!1,allowResize:W1,disabledRows:E2,hasAppendRow:Z2,getGroupDetails:u2,theme:y1,prelightCells:t2,headerIcons:w2,verticalBorder:i2,drawCell:a1,drawHeader:T1,onCellFocused:l2,onDragOverCell:q1,onDrop:S1,onDragLeave:$1,imageWindowLoader:U1,smoothScrollX:H2=!1,smoothScrollY:t1=!1,experimental:V1,getCellRenderer:f1}=e,b1=(m4=e.translateX)!=null?m4:0,z2=(g0=e.translateY)!=null?g0:0,n1=Math.max(R,Math.min(s.length-1,a)),L1=e1.useRef(null),l1=U1,M1=e1.useRef(),[Z1,R2]=e1.useState(!1),Q2=e1.useRef([]),e0=e1.useRef(),[t0,c0]=e1.useState(),[Y2,J2]=e1.useState(),k0=e1.useRef(null),[C2,m2]=e1.useState(),[L2,A2]=e1.useState(!1),y2=e1.useRef(L2);y2.current=L2;let F2=e1.useMemo(()=>new X7(w2,()=>{p4.current=void 0,j4.current()}),[w2]),Z0=v?c+n:n,o4=e1.useRef(-1),T0=((H0=V1==null?void 0:V1.enableFirefoxRescaling)!=null?H0:!1)&&Ls.value,m0=((i0=V1==null?void 0:V1.enableSafariRescaling)!=null?i0:!1)&&i9.value;e1.useLayoutEffect(()=>{window.devicePixelRatio===1||!T0&&!m0||(o4.current!==-1&&R2(!0),window.clearTimeout(o4.current),o4.current=window.setTimeout(()=>{R2(!1),o4.current=-1},200))},[o,n1,b1,z2,T0,m0]);let B1=mt(s,R),S2=E?Z4(B1,Q):0,X1=e1.useCallback((z,j,x1)=>{let v1=z.getBoundingClientRect();if(j>=B1.length||x1>=g)return;let C1=v1.width/i,Y=P9(j,x1,i,l,c,Z0,n1,o,b1,z2,g,R,N,B1,h);return C1!==1&&(Y.x*=C1,Y.y*=C1,Y.width*=C1,Y.height*=C1),Y.x+=v1.x,Y.y+=v1.y,Y},[i,l,c,Z0,n1,o,b1,z2,g,R,N,B1,h]),N2=e1.useCallback((z,j,x1,v1)=>{var O2,V0;let C1=z.getBoundingClientRect(),Y=C1.width/i,_1=(j-C1.left)/Y,K1=(x1-C1.top)/Y,h1=5,q2=T9(B1,n1,i,void 0,b1),r2=0,G1=0;v1 instanceof MouseEvent&&(r2=v1.button,G1=v1.buttons);let d2=Lt(_1,q2,b1),Q1=Vt(K1,l,v,n,c,g,h,o,z2,N),k2=(v1==null?void 0:v1.shiftKey)===!0,l0=(v1==null?void 0:v1.ctrlKey)===!0,K0=(v1==null?void 0:v1.metaKey)===!0,$2=v1!==void 0&&!(v1 instanceof MouseEvent)||(v1==null?void 0:v1.pointerType)==="touch",U2=[_1<0?-1:i<_1?1:0,K1i||K1>l){let v2=_1>i?1:_1<0?-1:0,J0=K1>l?1:K1<0?-1:0,M0=v2*2,e4=J0*2;v2===0&&(M0=d2===-1?u5.EndPadding:u5.Center),J0===0&&(e4=Q1===void 0?u5.EndPadding:u5.Center);let X0=!1;if(d2===-1&&Q1===-1){let Q4=X1(z,B1.length-1,-1);d0(Q4!==void 0),X0=ji&&_1l&&K1=0?(J0=!0,v2=X1(z,M0,Q1),d0(v2!==void 0),I2={kind:v&&Q1===-2?S0:B4,location:[M0,Q1],bounds:v2,group:(O2=B1[M0].group)!=null?O2:"",isEdge:J0,shiftKey:k2,ctrlKey:l0,metaKey:K0,isTouch:$2,localEventX:j-v2.x,localEventY:x1-v2.y,button:r2,buttons:G1,scrollEdge:U2}):I2={kind:v&&Q1===-2?S0:B4,group:(V0=B1[d2].group)!=null?V0:"",location:[d2,Q1],bounds:v2,isEdge:J0,shiftKey:k2,ctrlKey:l0,metaKey:K0,isTouch:$2,localEventX:j-v2.x,localEventY:x1-v2.y,button:r2,buttons:G1,scrollEdge:U2}}else{let v2=X1(z,d2,Q1);d0(v2!==void 0);let J0=v2!==void 0&&v2.x+v2.width-j{}),v4=e1.useRef(t0);v4.current=t0;let[P0,q0]=e1.useMemo(()=>{let z=document.createElement("canvas"),j=document.createElement("canvas");return z.style.display="none",z.style.opacity="0",z.style.position="fixed",j.style.display="none",j.style.opacity="0",j.style.position="fixed",[z.getContext("2d",{alpha:!1}),j.getContext("2d",{alpha:!1})]},[]);e1.useLayoutEffect(()=>{if(!(P0===null||q0===null))return document.documentElement.append(P0.canvas),document.documentElement.append(q0.canvas),()=>{P0.canvas.remove(),q0.canvas.remove()}},[P0,q0]);let z4=e1.useMemo(()=>new q7,[]),K9=T0&&Z1?1:m0&&Z1?2:5,X9=(V1==null?void 0:V1.disableMinimumCellWidth)===!0?1:10,p4=e1.useRef(),f5=e1.useRef(null),Z5=e1.useRef(null),E5=e1.useCallback(()=>{var _1,K1,h1;let z=L1.current,j=k0.current;if(z===null||j===null||(f5.current===null&&(f5.current=z.getContext("2d",{alpha:!1}),z.width=0,z.height=0),Z5.current===null&&(Z5.current=j.getContext("2d",{alpha:!1}),j.width=0,j.height=0),f5.current===null||Z5.current===null||P0===null||q0===null))return;let x1=!1,v1=q2=>{x1=!0,m2(q2)},C1=p4.current,Y={headerCanvasCtx:Z5.current,canvasCtx:f5.current,bufferACtx:P0,bufferBCtx:q0,width:i,height:l,cellXOffset:n1,cellYOffset:o,translateX:Math.round(b1),translateY:Math.round(z2),mappedColumns:B1,enableGroups:v,freezeColumns:R,dragAndDropState:Q,theme:y1,headerHeight:n,groupHeaderHeight:c,disabledRows:E2!=null?E2:x2.empty(),rowHeight:h,verticalBorder:i2,isResizing:I1,resizeCol:p1,isFocused:p,selection:Z,fillHandle:C,drawCellCallback:a1,hasAppendRow:Z2,overrideCursor:v1,maxScaleFactor:K9,freezeTrailingRows:N,rows:g,drawFocus:k,getCellContent:m,getGroupDetails:u2!=null?u2:q2=>({name:q2}),getRowThemeOverride:w,drawHeaderCallback:T1,prelightCells:t2,highlightRegions:G,imageLoader:l1,lastBlitData:e0,damage:M1.current,hoverValues:Q2.current,hoverInfo:v4.current,spriteManager:F2,scrolling:Z1,hyperWrapping:(_1=V1==null?void 0:V1.hyperWrapping)!=null?_1:!1,touchMode:L2,enqueue:Q0.current,renderStateProvider:z4,renderStrategy:(K1=V1==null?void 0:V1.renderStrategy)!=null?K1:i9.value?"double-buffer":"single-buffer",getCellRenderer:f1,minimumCellWidth:X9};Y.damage===void 0?(p4.current=Y,I8(Y,C1)):I8(Y,void 0),!x1&&(Y.damage===void 0||Y.damage.has((h1=v4==null?void 0:v4.current)==null?void 0:h1[0]))&&m2(void 0)},[P0,q0,i,l,n1,o,b1,z2,B1,v,R,Q,y1,n,c,E2,h,i2,I1,Z2,p1,p,Z,C,N,g,k,K9,m,u2,w,a1,T1,t2,G,l1,F2,Z1,V1==null?void 0:V1.hyperWrapping,V1==null?void 0:V1.renderStrategy,L2,z4,f1,X9]),j4=e1.useRef(E5);e1.useLayoutEffect(()=>{E5(),j4.current=E5},[E5]),e1.useLayoutEffect(()=>{(async()=>{var j;((j=document==null?void 0:document.fonts)==null?void 0:j.ready)!==void 0&&(await document.fonts.ready,p4.current=void 0,j4.current())})()},[]);let T4=e1.useCallback(z=>{M1.current=z,j4.current(),M1.current=void 0},[]),j9=Vs(T4);Q0.current=j9;let Y9=e1.useCallback(z=>{T4(new R4(z.map(j=>j.cell)))},[T4]);l1.setCallback(T4);let[w3,g3]=e1.useState(!1),[N5,y4]=j1!=null?j1:[],H3=N5!==void 0&&y4===-1,L3=N5!==void 0&&y4===-2,Q9=!1,R5=!1,s0=C2;if(s0===void 0&&N5!==void 0&&y4!==void 0&&y4>-1&&y4({contain:"strict",display:"block",cursor:B5}),[B5]),o9=e1.useRef("default"),P4=J==null?void 0:J.current;P4!=null&&o9.current!==z5.cursor&&(P4.style.cursor=o9.current=z5.cursor);let U0=e1.useCallback((z,j,x1,v1)=>{if(u2===void 0)return;let C1=u2(z);if(C1.actions!==void 0){let Y=u8(j,C1.actions);for(let[_1,K1]of Y.entries())if(G4(K1,x1+j.x,v1+K1.y))return C1.actions[_1]}},[u2]),n4=e1.useCallback((z,j,x1,v1)=>{let C1=s[j];if(!e2&&!I1&&C1.hasMenu===!0&&!(Y2!=null&&Y2)){let Y=X1(z,j,-1);d0(Y!==void 0);let _1=d8(Y.x,Y.y,Y.width,Y.height,$5(C1.title)==="rtl");if(x1>_1.x&&x1<_1.x+_1.width&&v1>_1.y&&v1<_1.y+_1.height)return Y}},[s,X1,Y2,e2,I1]),n9=e1.useRef(0),D4=e1.useRef(),C9=e1.useRef(!1),B0=e1.useCallback(z=>{let j=L1.current,x1=J==null?void 0:J.current;if(j===null||z.target!==j&&z.target!==x1)return;C9.current=!0;let v1,C1;if(z instanceof MouseEvent?(v1=z.clientX,C1=z.clientY):(v1=z.touches[0].clientX,C1=z.touches[0].clientY),z.target===x1&&x1!==null){let _1=x1.getBoundingClientRect();if(v1>_1.right||C1>_1.bottom)return}let Y=N2(j,v1,C1,z);D4.current=Y.location,Y.isTouch&&(n9.current=Date.now()),y2.current!==Y.isTouch&&A2(Y.isTouch),!(Y.kind===B4&&n4(j,Y.location[0],v1,C1)!==void 0)&&(Y.kind===S0&&U0(Y.group,Y.bounds,Y.localEventX,Y.localEventY)!==void 0||(b==null||b(Y),!Y.isTouch&&H1!==!0&&H1!==Y.kind&&Y.button<3&&Y.button!==1&&z.preventDefault()))},[J,H1,N2,U0,n4,b]);n0("touchstart",B0,window,!1),n0("mousedown",B0,window,!1);let y5=e1.useRef(0),c9=e1.useCallback(z=>{var G1,d2;let j=y5.current;y5.current=Date.now();let x1=L1.current;if(C9.current=!1,D===void 0||x1===null)return;let v1=J==null?void 0:J.current,C1=z.target!==x1&&z.target!==v1,Y,_1,K1=!0;if(z instanceof MouseEvent){if(Y=z.clientX,_1=z.clientY,K1=z.button<3,z.pointerType==="touch")return}else Y=z.changedTouches[0].clientX,_1=z.changedTouches[0].clientY;let h1=N2(x1,Y,_1,z);h1.isTouch&&n9.current!==0&&Date.now()-n9.current>500&&(h1=P(y({},h1),{isLongTouch:!0})),j!==0&&Date.now()-j<(h1.isTouch?1e3:500)&&(h1=P(y({},h1),{isDoubleClick:!0})),y2.current!==h1.isTouch&&A2(h1.isTouch),!C1&&z.cancelable&&K1&&z.preventDefault();let[q2]=h1.location,r2=n4(x1,q2,Y,_1);if(h1.kind===B4&&r2!==void 0){(h1.button!==0||((G1=D4.current)==null?void 0:G1[0])!==q2||((d2=D4.current)==null?void 0:d2[1])!==-1)&&D(h1,!0);return}else if(h1.kind===S0){let Q1=U0(h1.group,h1.bounds,h1.localEventX,h1.localEventY);if(Q1!==void 0){h1.button===0&&Q1.onClick(h1);return}}D(h1,C1)},[D,J,N2,n4,U0]);n0("mouseup",c9,window,!1),n0("touchend",c9,window,!1);let J9=e1.useCallback(z=>{var r2,G1;let j=L1.current;if(j===null)return;let x1=J==null?void 0:J.current,v1=z.target!==j&&z.target!==x1,C1,Y,_1=!0;z instanceof MouseEvent?(C1=z.clientX,Y=z.clientY,_1=z.button<3):(C1=z.changedTouches[0].clientX,Y=z.changedTouches[0].clientY);let K1=N2(j,C1,Y,z);y2.current!==K1.isTouch&&A2(K1.isTouch),!v1&&z.cancelable&&_1&&z.preventDefault();let[h1]=K1.location,q2=n4(j,h1,C1,Y);if(K1.kind===B4&&q2!==void 0)K1.button===0&&((r2=D4.current)==null?void 0:r2[0])===h1&&((G1=D4.current)==null?void 0:G1[1])===-1&&(L==null||L(h1,q2));else if(K1.kind===S0){let d2=U0(K1.group,K1.bounds,K1.localEventX,K1.localEventY);d2!==void 0&&K1.button===0&&d2.onClick(K1)}},[J,N2,n4,L,U0]);n0("click",J9,window,!1);let V3=e1.useCallback(z=>{let j=L1.current,x1=J==null?void 0:J.current;if(j===null||z.target!==j&&z.target!==x1||x===void 0)return;let v1=N2(j,z.clientX,z.clientY,z);x(v1,()=>{z.cancelable&&z.preventDefault()})},[J,N2,x]);n0("contextmenu",V3,(h0=J==null?void 0:J.current)!=null?h0:null,!1);let e7=e1.useCallback(z=>{M1.current=new R4(z.map(j=>j.item)),Q2.current=z,j4.current(),M1.current=void 0},[]),C4=e1.useMemo(()=>new i3(e7),[e7]),b4=e1.useRef(C4);b4.current=C4,e1.useLayoutEffect(()=>{let z=b4.current;if(j1===void 0||j1[1]<0){z.setHovered(j1);return}let j=m(j1,!0),x1=f1(j),v1=x1===void 0&&j.kind===c1.Custom||(x1==null?void 0:x1.needsHover)!==void 0&&(typeof x1.needsHover=="boolean"?x1.needsHover:x1.needsHover(j));z.setHovered(v1?j1:void 0)},[m,f1,j1]);let G0=e1.useRef(),A=e1.useCallback(z=>{var K1;let j=L1.current;if(j===null)return;let x1=J==null?void 0:J.current,v1=z.target!==j&&z.target!==x1,C1=N2(j,z.clientX,z.clientY,z);if(C1.kind!=="out-of-bounds"&&v1&&!C9.current&&!C1.isTouch)return;let Y=(h1,q2)=>{c0(r2=>r2===h1||(r2==null?void 0:r2[0][0])===(h1==null?void 0:h1[0][0])&&(r2==null?void 0:r2[0][1])===(h1==null?void 0:h1[0][1])&&((r2==null?void 0:r2[1][0])===(h1==null?void 0:h1[1][0])&&(r2==null?void 0:r2[1][1])===(h1==null?void 0:h1[1][1])||!q2)?r2:h1)};if(!l3(C1,G0.current))m2(void 0),K==null||K(C1),Y(C1.kind===l9?void 0:[C1.location,[C1.localEventX,C1.localEventY]],!0),G0.current=C1;else if(C1.kind==="cell"||C1.kind===B4||C1.kind===S0){let h1=!1,q2=!0;if(C1.kind==="cell"){let G1=m(C1.location),d2=(K1=f1(G1))==null?void 0:K1.needsHoverPosition;q2=d2!=null?d2:G1.kind===c1.Custom,h1=q2}else C1.kind===S0&&(h1=!0);let r2=[C1.location,[C1.localEventX,C1.localEventY]];Y(r2,q2),v4.current=r2,h1&&T4(new R4([C1.location]))}let _1=C1.location[0]>=(m1?0:1);J2(C1.kind===B4&&C1.isEdge&&_1&&W1===!0),g3(C1.kind==="cell"&&C1.isFillHandle),B==null||B(z),_(C1)},[J,N2,m1,W1,B,_,K,m,f1,T4]);n0("mousemove",A,window,!0);let W2=e1.useCallback(z=>{let j=L1.current;if(j===null)return;let x1,v1;Z.current!==void 0&&(x1=X1(j,Z.current.cell[0],Z.current.cell[1]),v1=Z.current.cell),g1==null||g1({bounds:x1,stopPropagation:()=>z.stopPropagation(),preventDefault:()=>z.preventDefault(),cancel:()=>{},ctrlKey:z.ctrlKey,metaKey:z.metaKey,shiftKey:z.shiftKey,altKey:z.altKey,key:z.key,keyCode:z.keyCode,rawEvent:z,location:v1})},[g1,Z,X1]),Y4=e1.useCallback(z=>{let j=L1.current;if(j===null)return;let x1,v1;Z.current!==void 0&&(x1=X1(j,Z.current.cell[0],Z.current.cell[1]),v1=Z.current.cell),w1==null||w1({bounds:x1,stopPropagation:()=>z.stopPropagation(),preventDefault:()=>z.preventDefault(),cancel:()=>{},ctrlKey:z.ctrlKey,metaKey:z.metaKey,shiftKey:z.shiftKey,altKey:z.altKey,key:z.key,keyCode:z.keyCode,rawEvent:z,location:v1})},[w1,Z,X1]),d3=e1.useCallback(z=>{L1.current=z,s1!==void 0&&(s1.current=z)},[s1]),t7=e1.useCallback(z=>{var G1;let j=L1.current;if(j===null||H1===!1||I1){z.preventDefault();return}let x1,v1,C1=N2(j,z.clientX,z.clientY);if(H1!==!0&&C1.kind!==H1){z.preventDefault();return}let Y=(d2,Q1)=>{x1=d2,v1=Q1},_1,K1,h1,q2=(d2,Q1,k2)=>{_1=d2,K1=Q1,h1=k2},r2=!1;if(o1==null||o1(P(y({},C1),{setData:Y,setDragImage:q2,preventDefault:()=>r2=!0,defaultPrevented:()=>r2})),!r2&&x1!==void 0&&v1!==void 0&&z.dataTransfer!==null)if(z.dataTransfer.setData(x1,v1),z.dataTransfer.effectAllowed="copyLink",_1!==void 0&&K1!==void 0&&h1!==void 0)z.dataTransfer.setDragImage(_1,K1,h1);else{let[d2,Q1]=C1.location;if(Q1!==void 0){let k2=document.createElement("canvas"),l0=X1(j,d2,Q1);d0(l0!==void 0);let K0=Math.ceil((G1=window.devicePixelRatio)!=null?G1:1);k2.width=l0.width*K0,k2.height=l0.height*K0;let $2=k2.getContext("2d");$2!==null&&($2.scale(K0,K0),$2.textBaseline="middle",Q1===-1?($2.font=y1.headerFontFull,$2.fillStyle=y1.bgHeader,$2.fillRect(0,0,k2.width,k2.height),v8($2,0,0,l0.width,l0.height,B1[d2],!1,y1,!1,!1,0,F2,T1,!1)):($2.font=y1.baseFontFull,$2.fillStyle=y1.bgCell,$2.fillRect(0,0,k2.width,k2.height),V8($2,m([d2,Q1]),0,Q1,!1,!1,0,0,l0.width,l0.height,!1,y1,y1.bgCell,l1,F2,1,void 0,!1,0,void 0,void 0,void 0,z4,f1,()=>{}))),k2.style.left="-100%",k2.style.position="absolute",k2.style.width=`${l0.width}px`,k2.style.height=`${l0.height}px`,document.body.append(k2),z.dataTransfer.setDragImage(k2,l0.width/2,l0.height/2),window.setTimeout(()=>{k2.remove()},0)}}else z.preventDefault()},[H1,I1,N2,o1,X1,y1,B1,F2,T1,m,l1,z4,f1]);n0("dragstart",t7,(S5=J==null?void 0:J.current)!=null?S5:null,!1,!1);let m9=e1.useRef(),u3=e1.useCallback(z=>{var h1;let j=L1.current;if(S1!==void 0&&z.preventDefault(),j===null||q1===void 0)return;let x1=N2(j,z.clientX,z.clientY),[v1,C1]=x1.location,Y=v1-(m1?0:1),[_1,K1]=(h1=m9.current)!=null?h1:[];(_1!==Y||K1!==C1)&&(m9.current=[Y,C1],q1([Y,C1],z.dataTransfer))},[m1,N2,q1,S1]);n0("dragover",u3,(i7=J==null?void 0:J.current)!=null?i7:null,!1,!1);let h9=e1.useCallback(()=>{m9.current=void 0,R1==null||R1()},[R1]);n0("dragend",h9,(g9=J==null?void 0:J.current)!=null?g9:null,!1,!1);let W=e1.useCallback(z=>{let j=L1.current;if(j===null||S1===void 0)return;z.preventDefault();let x1=N2(j,z.clientX,z.clientY),[v1,C1]=x1.location,Y=v1-(m1?0:1);S1([Y,C1],z.dataTransfer)},[m1,N2,S1]);n0("drop",W,(L0=J==null?void 0:J.current)!=null?L0:null,!1,!1);let E0=e1.useCallback(()=>{$1==null||$1()},[$1]);n0("dragleave",E0,(N0=J==null?void 0:J.current)!=null?N0:null,!1,!1);let a0=e1.useRef(Z);a0.current=Z;let b5=e1.useRef(null),w9=e1.useCallback(z=>{var j;L1.current===null||!L1.current.contains(document.activeElement)||(z===null&&a0.current.current!==void 0?(j=s1==null?void 0:s1.current)==null||j.focus({preventScroll:!0}):z!==null&&z.focus({preventScroll:!0}),b5.current=z)},[s1]);e1.useImperativeHandle(t,()=>({focus:()=>{var j;let z=b5.current;z===null||!document.contains(z)?(j=s1==null?void 0:s1.current)==null||j.focus({preventScroll:!0}):z.focus({preventScroll:!0})},getBounds:(z,j)=>{if(!(s1===void 0||s1.current===null))return X1(s1.current,z!=null?z:0,j!=null?j:-1)},damage:Y9}),[s1,Y9,X1]);let A4=e1.useRef(),D0=Ie(()=>{var K1,h1,q2,r2;if(i<50||(V1==null?void 0:V1.disableAccessibilityTree)===!0)return null;let z=T9(B1,n1,i,Q,b1),j=m1?0:-1;!m1&&((K1=z[0])==null?void 0:K1.sourceIndex)===0&&(z=z.slice(1));let[x1,v1]=(q2=(h1=Z.current)==null?void 0:h1.cell)!=null?q2:[],C1=(r2=Z.current)==null?void 0:r2.range,Y=z.map(G1=>G1.sourceIndex),_1=(0,us.default)(o,Math.min(g,o+r));return x1!==void 0&&v1!==void 0&&!(Y.includes(x1)&&_1.includes(v1))&&w9(null),e1.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":B1.length+j},e1.createElement("thead",{role:"rowgroup"},e1.createElement("tr",{role:"row","aria-rowindex":1},z.map(G1=>e1.createElement("th",{role:"columnheader","aria-selected":Z.columns.hasIndex(G1.sourceIndex),"aria-colindex":G1.sourceIndex+1+j,tabIndex:-1,onFocus:d2=>{if(d2.target!==b5.current)return l2==null?void 0:l2([G1.sourceIndex,-1])},key:G1.sourceIndex},G1.title)))),e1.createElement("tbody",{role:"rowgroup"},_1.map(G1=>e1.createElement("tr",{role:"row","aria-selected":Z.rows.hasIndex(G1),key:G1,"aria-rowindex":G1+2},z.map(d2=>{let Q1=d2.sourceIndex,k2=F0(Q1,G1),l0=x1===Q1&&v1===G1,K0=C1!==void 0&&Q1>=C1.x&&Q1=C1.y&&G1{let O2=s1==null?void 0:s1.current;if(O2!=null)return g1==null?void 0:g1({bounds:X1(O2,Q1,G1),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:U2})},onFocusCapture:O2=>{var V0,v2;if(!(O2.target===b5.current||((V0=A4.current)==null?void 0:V0[0])===Q1&&((v2=A4.current)==null?void 0:v2[1])===G1))return A4.current=U2,l2==null?void 0:l2(U2)},ref:l0?w9:void 0,tabIndex:-1},bH(I2,f1))})))))},[i,B1,n1,Q,b1,g,o,r,Z,w9,m,s1,g1,X1,l2],200),c4=R===0||!E?0:n1>R?1:(0,q8.default)(-b1/100,0,1),v3=-o*32+z2,F5=S?(0,q8.default)(-v3/100,0,1):0,p3=e1.useMemo(()=>{if(!c4&&!F5)return null;let z={position:"absolute",top:0,left:S2,width:i-S2,height:l,opacity:c4,pointerEvents:"none",transition:H2?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},j={position:"absolute",top:Z0,left:0,width:i,height:l,opacity:F5,pointerEvents:"none",transition:t1?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return e1.createElement(e1.Fragment,null,c4>0&&e1.createElement("div",{id:"shadow-x",style:z}),F5>0&&e1.createElement("div",{id:"shadow-y",style:j}))},[c4,F5,S2,i,H2,Z0,l,t1]),M3=e1.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return e1.createElement(e1.Fragment,null,e1.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:W2,onKeyUp:Y4,onFocus:u,onBlur:d,ref:d3,style:z5},D0),e1.createElement("canvas",{ref:k0,style:M3}),p3)},vs=e1.memo(e1.forwardRef(FH));function $9(e,t,i,l){var r;return(0,ps.default)(Math.round(t-((r=e.growOffset)!=null?r:0)),Math.ceil(i),Math.floor(l))}var SH=e=>{var i2;let[t,i]=D2.useState(),[l,r]=D2.useState(),[s,a]=D2.useState(),[o,n]=D2.useState(),[C,c]=D2.useState(!1),[h,g]=D2.useState(),[m,w]=D2.useState(),[L,v]=D2.useState(),[V,u]=D2.useState(!1),[d,p]=D2.useState(),{onHeaderMenuClick:Z,getCellContent:R,onColumnMoved:x,onColumnResize:N,onColumnResizeStart:E,onColumnResizeEnd:S,gridRef:k,maxColumnWidth:b,minColumnWidth:D,onRowMoved:B,lockColumns:_,onColumnProposeMove:K,onMouseDown:Q,onMouseUp:m1,onItemHovered:g1,onDragStart:w1,canvasRef:G}=e,s1=((i2=N!=null?N:S)!=null?i2:E)!==void 0,{columns:o1,selection:R1}=e,J=R1.columns,I1=D2.useCallback(a1=>{let[T1,l2]=a1.location;s!==void 0&&o!==T1&&T1>=_?(c(!0),n(T1)):m!==void 0&&l2!==void 0?(u(!0),v(Math.max(0,l2))):l===void 0&&!C&&!V&&(g1==null||g1(a1))},[s,m,o,g1,_,l,C,V]),p1=x!==void 0,e2=D2.useCallback(a1=>{var T1,l2;if(a1.button===0){let[q1,S1]=a1.location;if(a1.kind==="out-of-bounds"&&a1.isEdge&&s1){let $1=(T1=k==null?void 0:k.current)==null?void 0:T1.getBounds(o1.length-1,-1);$1!==void 0&&(i($1.x),r(o1.length-1))}else if(a1.kind==="header"&&q1>=_){let $1=G==null?void 0:G.current;if(a1.isEdge&&s1&&$1){i(a1.bounds.x),r(q1);let H2=$1.getBoundingClientRect().width/$1.offsetWidth,t1=a1.bounds.width/H2;E==null||E(o1[q1],t1,q1,t1+((l2=o1[q1].growOffset)!=null?l2:0))}else a1.kind==="header"&&p1&&(g(a1.bounds.x),a(q1))}else a1.kind==="cell"&&_>0&&q1===0&&S1!==void 0&&B!==void 0&&(p(a1.bounds.y),w(S1))}Q==null||Q(a1)},[Q,s1,_,B,k,o1,p1,E,G]),H1=D2.useCallback((a1,T1)=>{C||V||Z==null||Z(a1,T1)},[C,V,Z]),W1=D2.useRef(-1),E2=D2.useCallback(()=>{W1.current=-1,w(void 0),v(void 0),p(void 0),u(!1),a(void 0),n(void 0),g(void 0),c(!1),r(void 0),i(void 0)},[]),Z2=D2.useCallback((a1,T1)=>{var l2,q1,S1;if(a1.button===0){if(l!==void 0){if((J==null?void 0:J.hasIndex(l))===!0)for(let U1 of J){if(U1===l)continue;let H2=o1[U1],t1=$9(H2,W1.current,D,b);N==null||N(H2,t1,U1,t1+((l2=H2.growOffset)!=null?l2:0))}let $1=$9(o1[l],W1.current,D,b);if(S==null||S(o1[l],$1,l,$1+((q1=o1[l].growOffset)!=null?q1:0)),J.hasIndex(l))for(let U1 of J){if(U1===l)continue;let H2=o1[U1],t1=$9(H2,W1.current,D,b);S==null||S(H2,t1,U1,t1+((S1=H2.growOffset)!=null?S1:0))}}E2(),s!==void 0&&o!==void 0&&(x==null||x(s,o)),m!==void 0&&L!==void 0&&(B==null||B(m,L))}m1==null||m1(a1,T1)},[m1,l,s,o,m,L,J,S,o1,D,b,N,x,B,E2]),u2=D2.useMemo(()=>{if(!(s===void 0||o===void 0)&&s!==o&&(K==null?void 0:K(s,o))!==!1)return{src:s,dest:o}},[s,o,K]),y1=D2.useCallback(a1=>{var l2,q1;let T1=G==null?void 0:G.current;if(s!==void 0&&h!==void 0)Math.abs(a1.clientX-h)>20&&c(!0);else if(m!==void 0&&d!==void 0)Math.abs(a1.clientY-d)>20&&u(!0);else if(l!==void 0&&t!==void 0&&T1){let $1=T1.getBoundingClientRect().width/T1.offsetWidth,U1=(a1.clientX-t)/$1,H2=o1[l],t1=$9(H2,U1,D,b);if(N==null||N(H2,t1,l,t1+((l2=H2.growOffset)!=null?l2:0)),W1.current=U1,(J==null?void 0:J.first())===l)for(let V1 of J){if(V1===l)continue;let f1=o1[V1],b1=$9(f1,W1.current,D,b);N==null||N(f1,b1,V1,b1+((q1=f1.growOffset)!=null?q1:0))}}},[s,h,m,d,l,t,o1,D,b,N,J,G]),t2=D2.useCallback((a1,T1)=>{if(m===void 0||L===void 0)return R(a1,T1);let[l2,q1]=a1;return q1===L?q1=m:(q1>L&&(q1-=1),q1>=m&&(q1+=1)),R([l2,q1],T1)},[m,L,R]),w2=D2.useCallback(a1=>{w1==null||w1(a1),a1.defaultPrevented()||E2()},[E2,w1]);return D2.createElement(vs,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:l,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,width:e.width,getCellContent:t2,isResizing:l!==void 0,onHeaderMenuClick:H1,isDragging:C,onItemHovered:I1,onDragStart:w2,onMouseDown:e2,allowResize:s1,onMouseUp:Z2,dragAndDropState:u2,onMouseMoveRaw:y1,ref:k})},Ms=SH;var V2=F1(Y1(),1);var r9=F1(Y1(),1);function xs(e){let t=(0,r9.useRef)(null),[i,l]=(0,r9.useState)({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return(0,r9.useLayoutEffect)(()=>{let r=a=>{for(let o of a){let{width:n,height:C}=o&&o.contentRect||{};l(c=>c.width===n&&c.height===C?c:{width:n,height:C})}},s=new window.ResizeObserver(r);return t.current&&s.observe(t.current,void 0),()=>{s.disconnect()}},[t.current]),y({ref:t},i)}var K4=F1(Y1(),1),kH=(e,t,i)=>{let l=(0,K4.useRef)(null),r=(0,K4.useRef)(null),s=(0,K4.useRef)(null),a=(0,K4.useRef)(0),o=(0,K4.useRef)(t);o.current=t;let n=i.current;(0,K4.useEffect)(()=>{let C=()=>{var g,m;if(r.current===!1&&n!==null){let w=[n.scrollLeft,n.scrollTop];if(((g=s.current)==null?void 0:g[0])===w[0]&&((m=s.current)==null?void 0:m[1])===w[1])if(a.current>10){s.current=null,r.current=null;return}else a.current++;else a.current=0,o.current(w[0],w[1]),s.current=w;l.current=window.setTimeout(C,8.333333333333334)}},c=()=>{r.current=!0,s.current=null,l.current!==null&&(window.clearTimeout(l.current),l.current=null)},h=g=>{g.touches.length===0&&(r.current=!1,a.current=0,l.current=window.setTimeout(C,8.333333333333334))};if(e&&n!==null){let g=n;return g.addEventListener("touchstart",c),g.addEventListener("touchend",h),()=>{g.removeEventListener("touchstart",c),g.removeEventListener("touchend",h),l.current!==null&&window.clearTimeout(l.current)}}},[e,n])},fs=kH;var TH=()=>e=>e.isSafari?"scroll":"auto",PH=X2("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[TH()]}});function DH(e){let[t,i]=V2.useState(!1),l=typeof window=="undefined"?null:window,r=V2.useRef(0);return n0("touchstart",V2.useCallback(()=>{window.clearTimeout(r.current),i(!0)},[]),l,!0,!1),n0("touchend",V2.useCallback(s=>{s.touches.length===0&&(r.current=window.setTimeout(()=>i(!1),e))},[e]),l,!0,!1),t}var Zs=e=>{var o1,R1,J,I1;let{children:t,clientHeight:i,scrollHeight:l,scrollWidth:r,update:s,draggable:a,className:o,preventDiagonalScrolling:n=!1,paddingBottom:C=0,paddingRight:c=0,rightElement:h,rightElementProps:g,kineticScrollPerfHack:m=!1,scrollRef:w,initialSize:L}=e,v=[],V=(o1=g==null?void 0:g.sticky)!=null?o1:!1,u=(R1=g==null?void 0:g.fill)!=null?R1:!1,d=V2.useRef(0),p=V2.useRef(0),Z=V2.useRef(null),R=typeof window=="undefined"?1:window.devicePixelRatio,x=V2.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),N=V2.useRef(null),E=DH(200),[S,k]=V2.useState(!0),b=V2.useRef(0);V2.useLayoutEffect(()=>{if(!S||E||x.current.lockDirection===void 0)return;let p1=Z.current;if(p1===null)return;let[e2,H1]=x.current.lockDirection;e2!==void 0?p1.scrollLeft=e2:H1!==void 0&&(p1.scrollTop=H1),x.current.lockDirection=void 0},[E,S]);let D=V2.useCallback((p1,e2)=>{var l2,q1,S1,$1;let H1=Z.current;if(H1===null)return;e2=e2!=null?e2:H1.scrollTop,p1=p1!=null?p1:H1.scrollLeft;let W1=x.current.scrollTop,E2=x.current.scrollLeft,Z2=p1-E2,u2=e2-W1;E&&Z2!==0&&u2!==0&&(Math.abs(Z2)>3||Math.abs(u2)>3)&&n&&x.current.lockDirection===void 0&&(x.current.lockDirection=Math.abs(Z2)0&&(Math.abs(a1)>2e3||i2===0||i2===T1)&&l>H1.scrollHeight+5){let U1=i2/T1,H2=(l-w2)*U1;d.current=H2-i2}y1!==void 0&&(window.clearTimeout(b.current),k(!1),b.current=window.setTimeout(()=>k(!0),200)),s({x:p1,y:i2+d.current,width:t2-c,height:w2-C,paddingRight:($1=(S1=N.current)==null?void 0:S1.clientWidth)!=null?$1:0})},[C,c,l,s,n,E]);fs(m&&i9.value,D,Z);let B=V2.useRef(D);B.current=D;let _=V2.useRef(),K=V2.useRef(!1);V2.useLayoutEffect(()=>{K.current?D():K.current=!0},[D,C,c]);let Q=V2.useCallback(p1=>{Z.current=p1,w!==void 0&&(w.current=p1)},[w]),m1=0,g1=0;for(v.push(V2.createElement("div",{key:m1++,style:{width:r,height:0}}));g1B.current(),0),_.current={width:G,height:s1}),(G!=null?G:0)===0||(s1!=null?s1:0)===0?V2.createElement("div",{ref:w1}):V2.createElement("div",{ref:w1},V2.createElement(PH,{isSafari:i9.value},V2.createElement("div",{className:"dvn-underlay"},t),V2.createElement("div",{ref:Q,style:_.current,draggable:a,onDragStart:p1=>{a||(p1.stopPropagation(),p1.preventDefault())},className:"dvn-scroller "+(o!=null?o:""),onScroll:()=>D()},V2.createElement("div",{className:"dvn-scroll-inner"+(h===void 0?" dvn-hidden":"")},V2.createElement("div",{className:"dvn-stack"},v),h!==void 0&&V2.createElement(V2.Fragment,null,!u&&V2.createElement("div",{className:"dvn-spacer"}),V2.createElement("div",{ref:N,style:{height:s1,maxHeight:i-Math.ceil(R%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:u?1:void 0,right:V?c!=null?c:0:void 0,pointerEvents:"auto"}},h))))))};var AH=e=>{let{columns:t,rows:i,rowHeight:l,headerHeight:r,groupHeaderHeight:s,enableGroups:a,freezeColumns:o,experimental:n,nonGrowWidth:C,clientSize:c,className:h,onVisibleRegionChanged:g,scrollRef:m,preventDiagonalScrolling:w,rightElement:L,rightElementProps:v,overscrollX:V,overscrollY:u,initialSize:d,smoothScrollX:p=!1,smoothScrollY:Z=!1,isDraggable:R}=e,{paddingRight:x,paddingBottom:N}=n!=null?n:{},[E,S]=c,k=W0.useRef(),b=W0.useRef(),D=W0.useRef(),B=W0.useRef(),_=C+Math.max(0,V!=null?V:0),K=a?r+s:r;if(typeof l=="number")K+=i*l;else for(let w1=0;w1{var E2,Z2,u2;if(Q.current===void 0)return;let w1=y({},Q.current),G=0,s1=w1.x<0?-w1.x:0,o1=0,R1=0;w1.x=w1.x<0?0:w1.x;let J=0;for(let y1=0;y1=t2+y1.width)G+=y1.width,R1++,o1++;else if(w1.x>t2)G+=y1.width,p?s1+=t2-w1.x:R1++,o1++;else if(w1.x+w1.width>t2)G+=y1.width,o1++;else break}let I1=0,p1=0,e2=0;if(typeof l=="number")Z?(p1=Math.floor(w1.y/l),I1=p1*l-w1.y):p1=Math.ceil(w1.y/l),e2=Math.ceil(w1.height/l)+p1,I1<0&&e2++;else{let y1=0;for(let t2=0;t2=y1+w2)y1+=w2,p1++,e2++;else if(w1.y>i2)y1+=w2,Z?I1+=i2-w1.y:p1++,e2++;else if(w1.y+w1.height>w2/2+y1)y1+=w2,e2++;else break}}let H1={x:R1,y:p1,width:o1-R1,height:e2-p1},W1=k.current;(W1===void 0||W1.y!==H1.y||W1.x!==H1.x||W1.height!==H1.height||W1.width!==H1.width||b.current!==s1||D.current!==I1||w1.width!==((E2=B.current)==null?void 0:E2[0])||w1.height!==((Z2=B.current)==null?void 0:Z2[1]))&&(g==null||g({x:R1,y:p1,width:o1-R1,height:e2-p1},w1.width,w1.height,(u2=w1.paddingRight)!=null?u2:0,s1,I1),k.current=H1,b.current=s1,D.current=I1,B.current=[w1.width,w1.height])},[t,l,i,g,o,p,Z]),g1=W0.useCallback(w1=>{Q.current=w1,m1()},[m1]);return W0.useEffect(()=>{m1()},[m1]),W0.createElement(Zs,{scrollRef:m,className:h,kineticScrollPerfHack:n==null?void 0:n.kineticScrollPerfHack,preventDiagonalScrolling:w,draggable:R===!0||typeof R=="string",scrollWidth:_+(x!=null?x:0),scrollHeight:K+(N!=null?N:0),clientHeight:S,rightElement:L,paddingBottom:N,paddingRight:x,rightElementProps:v,update:g1,initialSize:d},W0.createElement(Ms,{eventTargetRef:m,width:E,height:S,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY}))},Es=AH;var Ns=X2("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1});var IH=A1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},A1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),OH=A1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},A1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),_H=A1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},A1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),WH=10,qH=e=>{let{canvasRef:t,cellYOffset:i,rows:l,columns:r,searchInputRef:s,searchValue:a,searchResults:o,onSearchValueChange:n,getCellsForSelection:C,onSearchResultsChanged:c,showSearch:h=!1,onSearchClose:g}=e,[m]=A1.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[w,L]=A1.useState(""),v=a!=null?a:w,V=A1.useCallback(G=>{L(G),n==null||n(G)},[n]),[u,d]=A1.useState(),p=A1.useRef(u);p.current=u,A1.useEffect(()=>{o!==void 0&&(o.length>0?d(G=>{var s1;return{rowsSearched:l,results:o.length,selectedIndex:(s1=G==null?void 0:G.selectedIndex)!=null?s1:-1}}):d(void 0))},[l,o]);let Z=A1.useRef();Z.current===void 0&&(Z.current=new AbortController);let R=A1.useRef(),[x,N]=A1.useState([]),E=o!=null?o:x,S=A1.useCallback(()=>{R.current!==void 0&&(window.cancelAnimationFrame(R.current),R.current=void 0,Z.current.abort())},[]),k=A1.useRef(i);k.current=i;let b=A1.useCallback(G=>{let s1=new RegExp(G.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i"),o1=k.current,R1=Math.min(10,l),J=0;d(void 0),N([]);let I1=[],p1=async()=>{var i2,a1;if(C===void 0)return;let e2=performance.now(),H1=l-J,W1=C({x:0,y:o1,width:r.length,height:Math.min(R1,H1,l-o1)},Z.current.signal);typeof W1=="function"&&(W1=await W1());let E2=!1;for(let[T1,l2]of W1.entries())for(let[q1,S1]of l2.entries()){let $1;switch(S1.kind){case c1.Text:case c1.Number:$1=S1.displayData;break;case c1.Uri:case c1.Markdown:$1=S1.data;break;case c1.Boolean:$1=typeof S1.data=="boolean"?S1.data.toString():void 0;break;case c1.Image:case c1.Bubble:$1=S1.data.join("\u{1F433}");break;case c1.Custom:$1=S1.copyData;break}$1!==void 0&&s1.test($1)&&(I1.push([q1,T1+o1]),E2=!0)}let Z2=performance.now();E2&&N([...I1]),J+=W1.length,d0(J<=l);let u2=(a1=(i2=p.current)==null?void 0:i2.selectedIndex)!=null?a1:-1;d({results:I1.length,rowsSearched:J,selectedIndex:u2}),c==null||c(I1,u2),o1+R1>=l?o1=0:o1+=R1;let y1=Z2-e2,t2=Math.max(y1,1),w2=WH/t2;R1=Math.ceil(R1*w2),J{var G;g==null||g(),d(void 0),N([]),c==null||c([],-1),S(),(G=t==null?void 0:t.current)==null||G.focus()},[S,t,g,c]),B=A1.useCallback(G=>{V(G.target.value),o===void 0&&(G.target.value===""?(d(void 0),N([]),S()):b(G.target.value))},[b,S,V,o]);A1.useEffect(()=>{h&&s.current!==null&&(V(""),s.current.focus({preventScroll:!0}))},[h,s,V]);let _=A1.useCallback(G=>{var o1;if((o1=G==null?void 0:G.stopPropagation)==null||o1.call(G),u===void 0)return;let s1=(u.selectedIndex+1)%u.results;d(P(y({},u),{selectedIndex:s1})),c==null||c(E,s1)},[u,c,E]),K=A1.useCallback(G=>{var o1;if((o1=G==null?void 0:G.stopPropagation)==null||o1.call(G),u===void 0)return;let s1=(u.selectedIndex-1)%u.results;s1<0&&(s1+=u.results),d(P(y({},u),{selectedIndex:s1})),c==null||c(E,s1)},[c,E,u]),Q=A1.useCallback(G=>{(G.ctrlKey||G.metaKey)&&G.nativeEvent.code==="KeyF"||G.key==="Escape"?(D(),G.stopPropagation(),G.preventDefault()):G.key==="Enter"&&(G.shiftKey?K():_())},[D,_,K]);A1.useEffect(()=>()=>{S()},[S]);let[m1,g1]=A1.useState(!1);A1.useEffect(()=>{if(h)g1(!0);else{let G=setTimeout(()=>g1(!1),150);return()=>clearTimeout(G)}},[h]);let w1=A1.useMemo(()=>{var J,I1,p1;if(!h&&!m1)return null;let G;u!==void 0&&(G=u.results>=1e3?"over 1000":`${u.results} result${u.results!==1?"s":""}`,u.selectedIndex>=0&&(G=`${u.selectedIndex+1} of ${G}`));let s1=e2=>{e2.stopPropagation()},R1={width:`${Math.floor(((J=u==null?void 0:u.rowsSearched)!=null?J:0)/l*100)}%`};return A1.createElement(Ns,{className:h?"":"out",onMouseDown:s1,onMouseMove:s1,onMouseUp:s1,onClick:s1},A1.createElement("div",{className:"gdg-search-bar-inner"},A1.createElement("input",{id:m,"aria-hidden":!h,"data-testid":"search-input",ref:s,onChange:B,value:v,tabIndex:h?void 0:-1,onKeyDownCapture:Q}),A1.createElement("button",{"aria-label":"Previous Result","aria-hidden":!h,tabIndex:h?void 0:-1,onClick:K,disabled:((I1=u==null?void 0:u.results)!=null?I1:0)===0},IH),A1.createElement("button",{"aria-label":"Next Result","aria-hidden":!h,tabIndex:h?void 0:-1,onClick:_,disabled:((p1=u==null?void 0:u.results)!=null?p1:0)===0},OH),g!==void 0&&A1.createElement("button",{"aria-label":"Close Search","aria-hidden":!h,"data-testid":"search-close-button",tabIndex:h?void 0:-1,onClick:D},_H)),u!==void 0?A1.createElement(A1.Fragment,null,A1.createElement("div",{className:"gdg-search-status"},A1.createElement("div",{"data-testid":"search-result-area"},G)),A1.createElement("div",{className:"gdg-search-progress",style:R1})):A1.createElement("div",{className:"gdg-search-status"},A1.createElement("label",{htmlFor:m},"Type to search")))},[h,m1,u,l,m,s,B,v,Q,K,_,g,D]);return A1.createElement(A1.Fragment,null,A1.createElement(Es,{prelightCells:E,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY}),w1)},Rs=qH;var r3=F1(Y1(),1);var $H=()=>e=>Math.max(16,e.targetHeight-10),UH=X2("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[$H(),"px"]}}),Bs=e=>{let{bounds:t,group:i,onClose:l,canvasBounds:r,onFinish:s}=e,[a,o]=r3.default.useState(i);return r3.default.createElement(Q6,{style:{position:"absolute",left:t.x-r.left+1,top:t.y-r.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:l},r3.default.createElement(UH,{targetHeight:t.height,"data-testid":"group-rename-input",value:a,onBlur:l,onFocus:n=>n.target.setSelectionRange(0,a.length),onChange:n=>o(n.target.value),onKeyDown:n=>{n.key==="Enter"?s(a):n.key==="Escape"&&l()},autoFocus:!0}))};function GH(e,t){return e===void 0?!1:e.length>1&&e.startsWith("_")?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function o2(e,t,i){let l=zs(e,t);return l&&(i.didMatch=!0),l}function zs(e,t){if(e.length===0)return!1;if(e.includes("|")){let n=e.split("|");for(let C of n)if(zs(C,t))return!0;return!1}let i=!1,l=!1,r=!1,s=!1,a=e.split("+"),o=a.pop();if(!GH(o,t))return!1;if(a[0]==="any")return!0;for(let n of a)switch(n){case"ctrl":i=!0;break;case"shift":l=!0;break;case"alt":r=!0;break;case"meta":s=!0;break;case"primary":V5.value?s=!0:i=!0;break}return t.altKey===r&&t.ctrlKey===i&&t.shiftKey===l&&t.metaKey===s}var s3=F1(Y1(),1);function ys(e,t,i,l,r,s){let a=s3.default.useCallback((C,c,h,g)=>{var u,d;(s==="cell"||s==="multi-cell")&&C!==void 0&&(C=P(y({},C),{range:{x:C.cell[0],y:C.cell[1],width:1,height:1}}));let m=i==="mixed"&&(h||g==="drag"),w=l==="mixed"&&m,L=r==="mixed"&&m,v={current:C===void 0?void 0:P(y({},C),{rangeStack:g==="drag"?(d=(u=e.current)==null?void 0:u.rangeStack)!=null?d:[]:[]}),columns:w?e.columns:x2.empty(),rows:L?e.rows:x2.empty()};h&&(s==="multi-rect"||s==="multi-cell")&&v.current!==void 0&&e.current!==void 0&&(v=P(y({},v),{current:P(y({},v.current),{rangeStack:[...e.current.rangeStack,e.current.range]})})),t(v,c)},[l,e,i,s,r,t]),o=s3.default.useCallback((C,c,h)=>{C=C!=null?C:e.rows,c!==void 0&&(C=C.add(c));let g;if(r==="exclusive"&&C.length>0)g={current:void 0,columns:x2.empty(),rows:C};else{let m=h&&i==="mixed",w=h&&l==="mixed";g={current:m?e.current:void 0,columns:w?e.columns:x2.empty(),rows:C}}t(g,!1)},[l,e,i,r,t]),n=s3.default.useCallback((C,c,h)=>{C=C!=null?C:e.columns,c!==void 0&&(C=C.add(c));let g;if(l==="exclusive"&&C.length>0)g={current:void 0,rows:x2.empty(),columns:C};else{let m=h&&i==="mixed",w=h&&r==="mixed";g={current:m?e.current:void 0,rows:w?e.rows:x2.empty(),columns:C}}t(g,!1)},[l,e,i,r,t]);return[a,o,n]}var $8=F1(Y1(),1);function bs(e,t,i,l,r){let s=$8.useCallback(C=>{var c;if(e===!0){let h=[];for(let g=C.y;g=r?m.push({kind:c1.Loading,allowOverlay:!1}):m.push(t([w,g]));h.push(m)}return h}return(c=e==null?void 0:e(C,l.signal))!=null?c:[]},[l.signal,t,e,r]),a=e!==void 0?s:void 0,o=$8.useCallback(C=>{if(a===void 0)return[];let c=P(y({},C),{x:C.x-i});if(c.x<0){c.x=0,c.width--;let h=a(c,l.signal);return typeof h=="function"?async()=>(await h()).map(g=>[{kind:c1.Loading,allowOverlay:!1},...g]):h.map(g=>[{kind:c1.Loading,allowOverlay:!1},...g])}return a(c,l.signal)},[l.signal,a,i]);return[e!==void 0?o:void 0,a]}function KH(e){var t,i;if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string"};switch(e.kind){case c1.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===_5?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case c1.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case c1.Image:case c1.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case c1.Drilldown:return{formatted:e.data.map(l=>l.text),rawValue:e.data.map(l=>l.text),format:"string-array"};case c1.Text:return{formatted:(t=e.displayData)!=null?t:e.data,rawValue:e.data,format:"string"};case c1.Uri:return{formatted:(i=e.displayData)!=null?i:e.data,rawValue:e.data,format:"url"};case c1.Markdown:case c1.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case c1.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case c1.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case c1.Protected:return{formatted:"************",rawValue:"",format:"string"};default:l5(e)}}function XH(e,t){return e.map((l,r)=>{let s=t[r];return l.map(a=>a.span!==void 0&&a.span[0]!==s?{formatted:"",rawValue:"",format:"string"}:KH(a))})}function Fs(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function jH(e){var i,l;let t=[];for(let r of e){let s=[];for(let a of r)a.format==="url"?s.push((l=(i=a.rawValue)==null?void 0:i.toString())!=null?l:""):a.format==="string-array"?s.push(a.formatted.map(o=>Fs(o,!0)).join(",")):s.push(Fs(a.formatted,!1));t.push(s.join(" "))}return t.join(` +`},fi={headerRowID:Ic,headerNumber:_c,headerCode:Oc,headerString:Wc,headerBoolean:qc,headerAudioUri:Uc,headerVideoUri:Gc,headerEmoji:Kc,headerImage:Xc,headerUri:xi,headerPhone:jc,headerMarkdown:Yc,headerDate:Qc,headerTime:Jc,headerEmail:em,headerReference:tm,headerIfThenElse:im,headerSingleValue:lm,headerLookup:rm,headerTextTemplate:sm,headerMath:am,headerRollup:om,headerJoinStrings:nm,headerSplitString:Cm,headerGeoDistance:cm,headerArray:mm,rowOwnerOverlay:hm,protectedColumnOverlay:wm,renameIcon:$c};function gm(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}var X7=class{constructor(t,i){c2(this,"onSettled");c2(this,"spriteMap",new Map);c2(this,"headerIcons");c2(this,"inFlight",0);this.onSettled=i,this.headerIcons=t!=null?t:{}}drawSprite(t,i,l,r,s,a,o,n=1){let[C,c]=gm(i,o),h=a*Math.ceil(window.devicePixelRatio),g=`${C}_${c}_${h}_${t}`,m=this.spriteMap.get(g);if(m===void 0){let w=this.headerIcons[t];if(w===void 0)return;m=document.createElement("canvas");let L=m.getContext("2d");if(L===null)return;let v=new Image;v.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(w({fgColor:c,bgColor:C}))}`,this.spriteMap.set(g,m);let V=v.decode();if(V===void 0)return;this.inFlight++,V.then(()=>{L.drawImage(v,0,0,h,h)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else n<1&&(l.globalAlpha=n),l.drawImage(m,0,0,h,h,r,s,a,a),n<1&&(l.globalAlpha=1)}};var q8=F1(A9(),1),us=F1(h8(),1);function j7(e){if(e.length===0)return;let t;for(let i of e)t=Math.min(t!=null?t:i.y,i.y)}function U4(e,t,i,l,r,s,a,o,n){o=o!=null?o:t;let C=t,c=e,h=l-s,g=!1;for(;Co&&n(C,c,m,!1,a&&c===l-1)===!0){g=!0;break}C+=m,c++}if(!g){C=i;for(let m=0;m!w.sticky))==null?void 0:g.sourceIndex)!=null?m:0;if(n>h){let w=Math.max(o,h),L=t,v=l;for(let V=s.sourceIndex-1;V>=w;V--)L-=a[V].width,v+=a[V].width;for(let V=s.sourceIndex+1;V<=n;V++)v+=a[V].width;c={x:L,y:i,width:v,height:r}}if(h>o){let w=Math.min(n,h-1),L=t,v=l;for(let V=s.sourceIndex-1;V>=o;V--)L-=a[V].width,v+=a[V].width;for(let V=s.sourceIndex+1;V<=w;V++)v+=a[V].width;C={x:L,y:i,width:v,height:r}}return[C,c]}function Zi(e,t,i,l){if(l==="any")return w8(e,{x:t,y:i,width:1,height:1});if(l==="vertical"&&(t=e.x),l==="horizontal"&&(i=e.y),_7([t,i],e))return;let r=t-e.x,s=e.x+e.width-t,a=i-e.y+1,o=e.y+e.height-i,n=Math.min(l==="vertical"?Number.MAX_SAFE_INTEGER:r,l==="vertical"?Number.MAX_SAFE_INTEGER:s,l==="horizontal"?Number.MAX_SAFE_INTEGER:a,l==="horizontal"?Number.MAX_SAFE_INTEGER:o);return n===o?{x:e.x,y:e.y+e.height,width:e.width,height:i-e.y-e.height+1}:n===a?{x:e.x,y:i,width:e.width,height:e.y-i}:n===s?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function H5(e,t,i,l,r,s,a,o){return e<=r+a&&r<=e+i&&t<=s+o&&s<=t+l}function G4(e,t,i){return t>=e.x&&t<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function w8(e,t){let i=Math.min(e.x,t.x),l=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width)-i,s=Math.max(e.y+e.height,t.y+t.height)-l;return{x:i,y:l,width:r,height:s}}function Ei(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function Ni(e,t,i,l){if(e.x>t||e.y>i||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>i)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=i)return e;let r=-4,s=-4,a=t+4,o=i+4,n=r-e.x,C=e.x+e.width-a,c=s-e.y,h=e.y+e.height-o,g=n>0?e.x+Math.floor(n/l)*l:e.x,m=C>0?e.x+e.width-Math.floor(C/l)*l:e.x+e.width,w=c>0?e.y+Math.floor(c/l)*l:e.y,L=h>0?e.y+e.height-Math.floor(h/l)*l:e.y+e.height;return{x:g,y:w,width:m-g,height:L-w}}function Ri(e,t,i,l,r){let[s,a,o,n]=t,[C,c,h,g]=r,{x:m,y:w,width:L,height:v}=e,V=[];if(L<=0||v<=0)return V;let u=m+L,d=w+v,p=mo,x=w+v>n,N=m>=s&&ms&&u<=o||mo,E=w>=a&&wa&&d<=n||wn;if(N&&E){let k=Math.max(m,s),b=Math.max(w,a),D=Math.min(u,o),B=Math.min(d,n);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:C,y:c,width:h-C+1,height:g-c+1}})}if(p&&Z){let k=m,b=w,D=Math.min(u,s),B=Math.min(d,a);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:0,y:0,width:C+1,height:c+1}})}if(Z&&N){let k=Math.max(m,s),b=w,D=Math.min(u,o),B=Math.min(d,a);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:C,y:0,width:h-C+1,height:c+1}})}if(Z&&R){let k=Math.max(m,o),b=w,D=u,B=Math.min(d,a);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:h,y:0,width:i-h+1,height:c+1}})}if(p&&E){let k=m,b=Math.max(w,a),D=Math.min(u,s),B=Math.min(d,n);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:0,y:c,width:C+1,height:g-c+1}})}if(R&&E){let k=Math.max(m,o),b=Math.max(w,a),D=u,B=Math.min(d,n);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:h,y:c,width:i-h+1,height:g-c+1}})}if(p&&x){let k=m,b=Math.max(w,n),D=Math.min(u,s),B=d;V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:0,y:g,width:C+1,height:l-g+1}})}if(x&&N){let k=Math.max(m,s),b=Math.max(w,n),D=Math.min(u,o),B=d;V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:C,y:g,width:h-C+1,height:l-g+1}})}if(R&&x){let k=Math.max(m,o),b=Math.max(w,n),D=u,B=d;V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:h,y:g,width:i-h+1,height:l-g+1}})}return V}var Hm={kind:c1.Loading,allowOverlay:!1};function L8(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V,u,d,p,Z,R,x,N,E,S,k,b,D,B,_,K,Q,m1){var e2;let g1=(e2=d==null?void 0:d.size)!=null?e2:Number.MAX_SAFE_INTEGER,w1=performance.now(),G=D.baseFontFull;e.font=G;let s1={ctx:e},o1=[0,0],R1=v>0?a4(n,v,C):0,J,I1,p1=j7(u);return _0(t,o,s,a,r,(H1,W1,E2,Z2,u2)=>{var H2;let y1=Math.max(0,Z2-W1),t2=W1+y1,w2=r+1,i2=H1.width-y1,a1=l-r-1;if(u.length>0){let t1=!1;for(let L1=0;L1{e.save(),e.beginPath(),e.rect(t2,w2,i2,a1),e.clip()},l2=p.columns.hasIndex(H1.sourceIndex),q1=h((H2=H1.group)!=null?H2:"").overrideTheme,S1=H1.themeOverride===void 0&&q1===void 0?D:r4(D,q1,H1.themeOverride),$1=S1.baseFontFull;$1!==G&&(G=$1,e.font=$1),T1();let U1;return U4(u2,E2,l,n,C,v,V,p1,(t1,L1,f1,b1,z2)=>{var Z0,o4,T0,m0;if(L1<0||(o1[0]=H1.sourceIndex,o1[1]=L1,d!==void 0&&!d.has(o1)))return;if(u.length>0){let B1=!1;for(let S2=0;S2l1.span!==void 0&&B1>=l1.span[0]&&B1<=l1.span[1]);Y2&&!w&&L?J2=0:Y2&&L&&(J2=Math.max(J2,1)),k0&&J2++,Y2||(n1&&J2++,l2&&!z2&&J2++);let C2=l1.kind===c1.Protected?c0.bgCellMedium:c0.bgCell,m2;if((b1||C2!==D.bgCell)&&(m2=y0(C2,m2)),J2>0||V1){V1&&(m2=y0(c0.bgHeader,m2));for(let B1=0;B1m1&&!Q2){let B1=c0.baseFontFull;B1!==G&&(e.font=B1,G=B1),U1=V8(e,l1,H1.sourceIndex,L1,A2,y2,M1,t1,Z1,f1,J2>0,c0,m2!=null?m2:c0.bgCell,x,N,(T0=F2==null?void 0:F2.hoverAmount)!=null?T0:0,S,b,w1,k,U1,B,_,K,Q)}return L2&&e.restore(),l1.style==="faded"&&(e.globalAlpha=1),g1--,R2&&(e.restore(),(m0=U1==null?void 0:U1.deprep)==null||m0.call(U1,s1),U1=void 0,T1(),G=$1,e.font=$1),g1<=0}),e.restore(),g1<=0}),J}var I9=[0,0],O9={x:0,y:0,width:0,height:0},g8=[void 0,()=>{}],H8=!1;function Lm(){H8=!0}function V8(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V,u,d,p,Z,R,x,N){var _,K;let E,S;v!==void 0&&v[0][0]===i&&v[0][1]===l&&(E=v[1][0],S=v[1][1]);let k;I9[0]=i,I9[1]=l,O9.x=a,O9.y=o,O9.width=n,O9.height=C,g8[0]=R.getValue(I9),g8[1]=Q=>R.setValue(I9,Q),H8=!1;let b={ctx:e,theme:h,col:i,row:l,cell:t,rect:O9,highlighted:c,cellFillColor:g,hoverAmount:L,frameTime:u,hoverX:E,drawState:g8,hoverY:S,imageLoader:m,spriteManager:w,hyperWrapping:V,overrideCursor:E!==void 0?N:void 0,requestAnimationFrame:Lm},D=vt(b,t.lastUpdated,u,p,r,s),B=x(t);if(B!==void 0){(p==null?void 0:p.renderer)!==B&&((_=p==null?void 0:p.deprep)==null||_.call(p,b),p=void 0);let Q=(K=B.drawPrep)==null?void 0:K.call(B,b,p);d!==void 0&&!F4(b.cell)?d(b,()=>B.draw(b,t)):B.draw(b,t),k=Q===void 0?void 0:{deprep:Q==null?void 0:Q.deprep,fillStyle:Q==null?void 0:Q.fillStyle,font:Q==null?void 0:Q.font,renderer:B}}return(D||H8)&&(Z==null||Z(I9)),k}function j5(e,t,i,l,r,s,a,o,n=-20,C=-20,c=32,h="center",g="square"){var p;let m=Math.floor(r+a/2),w=g==="circle"?1e4:(p=t.roundingRadius)!=null?p:4,L=F7(c,a,t.cellVerticalPadding),v=L/2,V=b7(h,l,s,t.cellHorizontalPadding,L),u=y7(V,m,L),d=S7(l+n,r+C,u);switch(i){case!0:{e.beginPath(),f0(e,V-L/2,m-L/2,L,L,w),g==="circle"&&(v*=.8,L*=.8),e.fillStyle=o?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(V-v+L/4.23,m-v+L/1.97),e.lineTo(V-v+L/2.42,m-v+L/1.44),e.lineTo(V-v+L/1.29,m-v+L/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case O5:case!1:{e.beginPath(),f0(e,V-L/2+.5,m-L/2+.5,L-1,L-1,w),e.lineWidth=1,e.strokeStyle=d?t.textDark:t.textMedium,e.stroke();break}case _5:{e.beginPath(),f0(e,V-L/2,m-L/2,L,L,w),e.fillStyle=d?t.textMedium:t.textLight,e.fill(),g==="circle"&&(v*=.8,L*=.8),e.beginPath(),e.moveTo(V-L/3,m),e.lineTo(V+L/3,m),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:l5(i)}}function zi(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V,u){var x;let d=a+o;if(d<=0)return;e.fillStyle=h.bgHeader,e.fillRect(0,0,r,d);let[p,Z]=(x=l==null?void 0:l[0])!=null?x:[],R=h.headerFontFull;e.font=R,_0(t,0,s,0,d,(N,E,S,k)=>{var o1,R1,J;if(v!==void 0&&!v.has([N.sourceIndex,-1]))return;let b=Math.max(0,k-E);e.save(),e.beginPath(),e.rect(E+b,o,N.width-b,a),e.clip();let D=L((o1=N.group)!=null?o1:"").overrideTheme,B=N.themeOverride===void 0&&D===void 0?h:r4(h,D,N.themeOverride);B.bgHeader!==h.bgHeader&&(e.fillStyle=B.bgHeader,e.fill()),B!==h&&(e.font=B.baseFontFull);let _=c.columns.hasIndex(N.sourceIndex),K=n!==void 0||C,Q=!K&&Z===-1&&p===N.sourceIndex,m1=K?0:(J=(R1=m.find(I1=>I1.item[0]===N.sourceIndex&&I1.item[1]===-1))==null?void 0:R1.hoverAmount)!=null?J:0,g1=(c==null?void 0:c.current)!==void 0&&c.current.cell[0]===N.sourceIndex,w1=_?B.accentColor:g1?B.bgHeaderHasFocus:B.bgHeader,G=i?o:0,s1=N.sourceIndex===0?0:1;_?(e.fillStyle=w1,e.fillRect(E+s1,G,N.width-s1,a)):(g1||m1>0)&&(e.beginPath(),e.rect(E+s1,G,N.width-s1,a),g1&&(e.fillStyle=B.bgHeaderHasFocus,e.fill()),m1>0&&(e.globalAlpha=m1,e.fillStyle=B.bgHeaderHovered,e.fill(),e.globalAlpha=1)),v8(e,E,G,N.width,a,N,_,B,Q,g1,m1,g,V,u),e.restore()}),i&&Vm(e,t,r,s,o,l,h,g,m,w,L,v)}function Vm(e,t,i,l,r,s,a,o,n,C,c,h){var v;let[m,w]=(v=s==null?void 0:s[0])!=null?v:[],L=0;Y7(t,i,l,r,(V,u,d,p,Z,R)=>{var k,b;if(h!==void 0&&!h.hasItemInRectangle({x:V[0],y:-2,width:V[1]-V[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(d,p,Z,R),e.clip();let x=c(u),N=(x==null?void 0:x.overrideTheme)===void 0?a:r4(a,x.overrideTheme),E=w===-2&&m!==void 0&&m>=V[0]&&m<=V[1],S=E?N.bgHeaderHovered:N.bgHeader;if(S!==a.bgHeader&&(e.fillStyle=S,e.fill()),e.fillStyle=(k=N.textGroupHeader)!=null?k:N.textHeader,x!==void 0){let D=d;if(x.icon!==void 0&&(o.drawSprite(x.icon,"normal",e,D+8,(r-20)/2,20,N),D+=26),e.fillText(x.name,D+8,r/2+x0(e,a.headerFontFull)),x.actions!==void 0&&E){let B=u8({x:d,y:p,width:Z,height:R},x.actions);e.beginPath();let _=B[0].x-10,K=d+Z-_;e.rect(_,0,K,r);let Q=e.createLinearGradient(_,0,_+K,0),m1=z0(S,0);Q.addColorStop(0,m1),Q.addColorStop(10/K,S),Q.addColorStop(1,S),e.fillStyle=Q,e.fill(),e.globalAlpha=.6;let[g1,w1]=(b=s==null?void 0:s[1])!=null?b:[-1,-1];for(let G=0;G35){let p=g?35:l-35,Z=g?35*.7:l-35*.7,R=p/l,x=Z/l,N=e.createLinearGradient(t,0,t+l,0),E=z0(L,0);N.addColorStop(g?1:0,L),N.addColorStop(R,L),N.addColorStop(x,E),N.addColorStop(g?0:1,E),e.fillStyle=N}else e.fillStyle=L;if(g&&(e.textAlign="right"),e.fillText(s.title,u,i+r/2+x0(e,o.headerFontFull)),g&&(e.textAlign="left"),v&&s.hasMenu===!0)if(s.menuIcon===void 0||s.menuIcon===k3.Triangle){e.beginPath();let d=m.x+m.width/2-5.5,p=m.y+m.height/2-3;t8(e,[{x:d,y:p},{x:d+11,y:p},{x:d+5.5,y:p+6}],1),e.fillStyle=L,e.fill()}else if(s.menuIcon===k3.Dots){e.beginPath();let d=m.x+m.width/2,p=m.y+m.height/2;Mt(e,d,p),e.fillStyle=L,e.fill()}else{let d=m.x+(m.width-o.headerIconSize)/2,p=m.y+(m.height-o.headerIconSize)/2;c.drawSprite(s.menuIcon,"normal",e,d,p,o.headerIconSize,o)}}function v8(e,t,i,l,r,s,a,o,n,C,c,h,g,m){let w=$5(s.title)==="rtl",L=d8(t,i,l,r,w);g!==void 0?g({ctx:e,theme:o,rect:{x:t,y:i,width:l,height:r},column:s,columnIndex:s.sourceIndex,isSelected:a,hoverAmount:c,isHovered:n,hasSelectedCell:C,spriteManager:h,menuBounds:L},()=>Bi(e,t,i,l,r,s,a,o,n,c,h,m,w,L)):Bi(e,t,i,l,r,s,a,o,n,c,h,m,w,L)}var ns=F1(os(),1);function Cs(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V,u){if(V!==void 0||t[t.length-1]!==i[t.length-1])return;let d=j7(v);_0(t,n,a,o,s,(p,Z,R,x,N)=>{if(p!==t[t.length-1])return;Z+=p.width;let E=Math.max(Z,x);E>l||(e.save(),e.beginPath(),e.rect(E,s+1,1e4,r-s-1),e.clip(),U4(N,R,r,C,c,w,L,d,(S,k,b,D)=>{if(!D&&v.length>0&&!v.some(m1=>H5(Z,S,1e4,b,m1.x,m1.y,m1.width,m1.height)))return;let B=g.hasIndex(k),_=m.hasIndex(k);e.beginPath();let K=h==null?void 0:h(k),Q=K===void 0?u:r4(u,K);Q.bgCell!==u.bgCell&&(e.fillStyle=Q.bgCell,e.fillRect(Z,S,1e4,b)),_&&(e.fillStyle=Q.bgHeader,e.fillRect(Z,S,1e4,b)),B&&(e.fillStyle=Q.accentLight,e.fillRect(Z,S,1e4,b))}),e.restore())})}function cs(e,t,i,l,r,s,a,o,n){var w;let C=!1;for(let L of t)if(!L.sticky){C=a(L.sourceIndex);break}let c=(w=n.horizontalBorderColor)!=null?w:n.borderColor,h=n.borderColor,g=C?Z4(t):0,m;if(g!==0&&(m=P3(h,n.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,l),e.strokeStyle=m,e.stroke()),r>0){let L=h===c&&m!==void 0?m:P3(c,n.bgCell),v=a4(s,r,o);e.beginPath(),e.moveTo(0,l-v+.5),e.lineTo(i,l-v+.5),e.strokeStyle=L,e.stroke()}}var ms=(e,t,i)=>{let l=0,r=t,s=0,a=i;if(e!==void 0&&e.length>0){l=Number.MAX_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;for(let o of e)l=Math.min(l,o.x-1),r=Math.max(r,o.x+o.width+1),s=Math.min(s,o.y-1),a=Math.max(a,o.y+o.height+1)}return{minX:l,maxX:r,minY:s,maxY:a}};function hs(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w){var b;let L=w.bgCell,{minX:v,maxX:V,minY:u,maxY:d}=ms(o,s,a),p=[],Z=a-a4(m,g,C),R=n,x=i,N=0;for(;R+r=u&&D<=d-1){let _=c==null?void 0:c(x),K=_==null?void 0:_.bgCell;K!==void 0&&K!==L&&x>=m-g&&p.push({x:v,y:D,w:V-v,h:B,color:K})}R+=B,x0)for(let D=0;D=v&&_<=V&&h(D+1)&&p.push({x:_,y:N,w:B.width,h:S,color:K}),E+=B.width}if(p.length===0)return;let k;e.beginPath();for(let D=p.length-1;D>=0;D--){let B=p[D];k===void 0?k=B.color:B.color!==k&&(e.fillStyle=k,e.fill(),e.beginPath(),k=B.color),e.rect(B.x,B.y,B.w,B.h)}k!==void 0&&(e.fillStyle=k,e.fill()),e.beginPath()}function P8(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V=!1){var b,D,B;if(n!==void 0){e.beginPath(),e.save(),e.rect(0,0,s,a);for(let _ of n)e.rect(_.x+1,_.y+1,_.width-1,_.height-1);e.clip("evenodd")}let u=(b=v.horizontalBorderColor)!=null?b:v.borderColor,d=v.borderColor,{minX:p,maxX:Z,minY:R,maxY:x}=ms(o,s,a),N=[];e.beginPath();let E=.5;for(let _=0;_=p&&Q<=Z&&m(_+1)&&N.push({x1:Q,y1:Math.max(C,R),x2:Q,y2:Math.min(a,x),color:d})}let S=a+.5;for(let _=L-w;_=R&&m1<=x-1){let g1=g==null?void 0:g(K);N.push({x1:p,y1:m1,x2:Z,y2:m1,color:(B=(D=g1==null?void 0:g1.horizontalBorderColor)!=null?D:g1==null?void 0:g1.borderColor)!=null?B:u})}_+=h(K),K++}}let k=(0,ns.default)(N,_=>_.color);for(let _ of Object.keys(k)){e.strokeStyle=_;for(let K of k[_])e.moveTo(K.x1,K.y1),e.lineTo(K.x2,K.y2);e.stroke(),e.beginPath()}n!==void 0&&e.restore()}function ws(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V,u){let d=[];e.imageSmoothingEnabled=!1;let p=Math.min(r.cellYOffset,a),Z=Math.max(r.cellYOffset,a),R=0;if(typeof V=="number")R+=(Z-p)*V;else for(let B=p;Br.cellYOffset&&(R=-R),R+=n-r.translateY;let x=Math.min(r.cellXOffset,s),N=Math.max(r.cellXOffset,s),E=0;for(let B=x;Br.cellXOffset&&(E=-E),E+=o-r.translateX;let S=Z4(v);if(E!==0&&R!==0)return{regions:[]};let k=C>0?a4(g,C,V):0,b=c-S-Math.abs(E),D=h-m-k-Math.abs(R)-1;if(b>150&&D>150){let B={sx:0,sy:0,sw:c*w,sh:h*w,dx:0,dy:0,dw:c*w,dh:h*w};if(R>0?(B.sy=(m+1)*w,B.sh=D*w,B.dy=(R+m+1)*w,B.dh=D*w,d.push({x:0,y:m,width:c,height:R+1})):R<0&&(B.sy=(-R+m+1)*w,B.sh=D*w,B.dy=(m+1)*w,B.dh=D*w,d.push({x:0,y:h+R-k,width:c,height:-R+k})),E>0?(B.sx=S*w,B.sw=b*w,B.dx=(E+S)*w,B.dw=b*w,d.push({x:S-1,y:0,width:E+2,height:h})):E<0&&(B.sx=(S-E)*w,B.sw=b*w,B.dx=S*w,B.dw=b*w,d.push({x:c+E,y:0,width:-E,height:h})),e.setTransform(1,0,0,1,0,0),u){if(S>0&&E!==0&&R===0&&(l===void 0||(i==null?void 0:i[1])!==!1)){let _=S*w,K=h*w;e.drawImage(t,0,0,_,K,0,0,_,K)}if(k>0&&E===0&&R!==0&&(l===void 0||(i==null?void 0:i[0])!==!1)){let _=(h-k)*w,K=c*w,Q=k*w;e.drawImage(t,0,_,K,Q,0,_,K,Q)}}e.drawImage(t,B.sx,B.sy,B.sw,B.sh,B.dx,B.dy,B.dw,B.dh),e.scale(w,w)}return e.imageSmoothingEnabled=!0,{regions:d}}function gs(e,t,i,l,r,s,a,o,n,C){let c=[];return t!==e.cellXOffset||i!==e.cellYOffset||l!==e.translateX||r!==e.translateY||_0(n,i,l,r,o,(h,g,m,w)=>{if(h.sourceIndex===C){let L=Math.max(g,w)+1;return c.push({x:L,y:0,width:s-L,height:a}),!0}}),c}function Hs(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let r;for(let s=0;sx.style!=="no-outline");if(v===void 0||v.length===0)return;let V=Z4(o),u=a4(m,g,h),d=[n,0,o.length,m-g],p=[V,0,t,i-u],Z=v.map(x=>{var S;let N=x.range,E=(S=x.style)!=null?S:"dashed";return Ri(N,d,t,i,p).map(k=>{let b=k.rect,D=P9(b.x,b.y,t,i,c,C+c,l,r,s,a,m,n,g,o,h),B=b.width===1&&b.height===1?D:P9(b.x+b.width-1,b.y+b.height-1,t,i,c,C+c,l,r,s,a,m,n,g,o,h);return b.x+b.width>=o.length&&(B.width-=1),b.y+b.height>=m&&(B.height-=1),{color:x.color,style:E,clip:k.clip,rect:Ni({x:D.x,y:D.y,width:B.x+B.width-D.x,height:B.y+B.height-D.y},t,i,8)}})}),R=()=>{e.lineWidth=1;let x=!1;for(let N of Z)for(let E of N)if((E==null?void 0:E.rect)!==void 0&&H5(0,0,t,i,E.rect.x,E.rect.y,E.rect.width,E.rect.height)){let S=x,k=!Ei(E.clip,E.rect);k&&(e.save(),e.rect(E.clip.x,E.clip.y,E.clip.width,E.clip.height),e.clip()),E.style==="dashed"&&!x?(e.setLineDash([5,3]),x=!0):(E.style==="solid"||E.style==="solid-outline")&&x&&(e.setLineDash([]),x=!1),e.strokeStyle=E.style==="solid-outline"?y0(y0(E.color,L.borderColor),L.bgCell):z0(E.color,1),e.strokeRect(E.rect.x+.5,E.rect.y+.5,E.rect.width-1,E.rect.height-1),k&&(e.restore(),x=S)}x&&e.setLineDash([])};return R(),R}function A8(e,t,i,l,r){e.beginPath(),e.moveTo(t,i),e.lineTo(t,l),e.lineWidth=2,e.strokeStyle=r,e.stroke(),e.globalAlpha=1}function t3(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v){var B;if(c.current===void 0)return;let V=c.current.range,u=c.current.cell,d=[V.x+V.width-1,V.y+V.height-1];if(u[1]>=v&&d[1]>=v||!a.some(_=>_.sourceIndex===u[0]||_.sourceIndex===d[0]))return;let[Z,R]=c.current.cell,x=g(c.current.cell),N=(B=x.span)!=null?B:[Z,Z],E=R>=v-m,S=m>0&&!E?a4(v,m,h)-1:0,k=d[1],b;if(_0(a,l,r,s,C,(_,K,Q,m1,g1)=>{if(_.sticky&&Z>_.sourceIndex)return;let w1=_.sourceIndexN[1],s1=_.sourceIndex===d[0];if(!(!s1&&(w1||G)))return U4(g1,Q,i,v,h,m,w,void 0,(o1,R1,J)=>{if(R1!==R&&R1!==k)return;let I1=K,p1=_.width;if(x.span!==void 0){let H1=Q7(x.span,K,o1,_.width,J,_,o),W1=_.sticky?H1[0]:H1[1];W1!==void 0&&(I1=W1.x,p1=W1.width)}return R1===k&&s1&&L&&(b=()=>{var H1,W1;m1>I1&&!_.sticky&&(e.beginPath(),e.rect(m1,0,t-m1,i),e.clip()),e.beginPath(),e.rect(I1+p1-4,o1+J-4,4,4),e.fillStyle=(W1=(H1=_.themeOverride)==null?void 0:H1.accentColor)!=null?W1:n.accentColor,e.fill()}),b!==void 0}),b!==void 0}),b===void 0)return;let D=()=>{e.save(),e.beginPath(),e.rect(0,C,t,i-C-S),e.clip(),b==null||b(),e.restore()};return D(),D}function RH(e,t,i,l,r,s,a,o,n){n===void 0||n.size===0||(e.beginPath(),Y7(t,i,s,l,(C,c,h,g,m,w)=>{n.hasItemInRectangle({x:C[0],y:-2,width:C[1]-C[0]+1,height:1})&&e.rect(h,g,m,w)}),_0(t,o,s,a,r,(C,c,h,g)=>{let m=Math.max(0,g-c),w=c+m+1,L=C.width-m-1;n.has([C.sourceIndex,-1])&&e.rect(w,l,L,r-l)}),e.clip())}function BH(e,t,i,l,r,s,a,o,n,C){let c=0;return _0(e,s,l,r,i,(h,g,m,w,L)=>(U4(L,m,t,a,o,n,C,void 0,(v,V,u,d)=>{d||(c=Math.max(V,c))}),!0)),c}function I8(e,t){var C2,m2;let{canvasCtx:i,headerCanvasCtx:l,width:r,height:s,cellXOffset:a,cellYOffset:o,translateX:n,translateY:C,mappedColumns:c,enableGroups:h,freezeColumns:g,dragAndDropState:m,theme:w,drawFocus:L,headerHeight:v,groupHeaderHeight:V,disabledRows:u,rowHeight:d,verticalBorder:p,overrideCursor:Z,isResizing:R,selection:x,fillHandle:N,freezeTrailingRows:E,rows:S,getCellContent:k,getGroupDetails:b,getRowThemeOverride:D,isFocused:B,drawHeaderCallback:_,prelightCells:K,drawCellCallback:Q,highlightRegions:m1,resizeCol:g1,imageLoader:w1,lastBlitData:G,hoverValues:s1,hyperWrapping:o1,hoverInfo:R1,spriteManager:J,maxScaleFactor:I1,hasAppendRow:p1,touchMode:e2,enqueue:H1,renderStateProvider:W1,getCellRenderer:E2,renderStrategy:Z2,bufferACtx:u2,bufferBCtx:y1,damage:t2,minimumCellWidth:w2}=e;if(r===0||s===0)return;let i2=Z2==="double-buffer",a1=Math.min(I1,Math.ceil((C2=window.devicePixelRatio)!=null?C2:1)),T1=Z2!=="direct"&&Hs(e,t),l2=i.canvas;(l2.width!==r*a1||l2.height!==s*a1)&&(l2.width=r*a1,l2.height=s*a1,l2.style.width=r+"px",l2.style.height=s+"px");let q1=l.canvas,S1=h?V+v:v,$1=S1+1;(q1.width!==r*a1||q1.height!==$1*a1)&&(q1.width=r*a1,q1.height=$1*a1,q1.style.width=r+"px",q1.style.height=$1+"px");let U1=u2.canvas,H2=y1.canvas;i2&&(U1.width!==r*a1||U1.height!==s*a1)&&(U1.width=r*a1,U1.height=s*a1,G.current!==void 0&&(G.current.aBufferScroll=void 0)),i2&&(H2.width!==r*a1||H2.height!==s*a1)&&(H2.width=r*a1,H2.height=s*a1,G.current!==void 0&&(G.current.bBufferScroll=void 0));let t1=G.current;if(T1===!0&&a===(t1==null?void 0:t1.cellXOffset)&&o===(t1==null?void 0:t1.cellYOffset)&&n===(t1==null?void 0:t1.translateX)&&C===(t1==null?void 0:t1.translateY))return;let L1=null;i2&&(L1=i);let f1=l,b1;i2?t2!==void 0?b1=(t1==null?void 0:t1.lastBuffer)==="b"?y1:u2:b1=(t1==null?void 0:t1.lastBuffer)==="b"?u2:y1:b1=i;let z2=b1.canvas,n1=i2?z2===U1?H2:U1:l2,V1=typeof d=="number"?()=>d:d;f1.save(),b1.save(),f1.beginPath(),b1.beginPath(),f1.textBaseline="middle",b1.textBaseline="middle",a1!==1&&(f1.scale(a1,a1),b1.scale(a1,a1));let l1=T9(c,a,r,m,n),M1=[],Z1=L&&((m2=x.current)==null?void 0:m2.cell[1])===o&&C===0,R2=!1;if(m1!==void 0){for(let L2 of m1)if(L2.style!=="no-outline"&&L2.range.y===o&&C===0){R2=!0;break}}let Q2=()=>{var L2,A2;zi(f1,l1,h,R1,r,n,v,V,m,R,x,w,J,s1,p,b,t2,_,e2),P8(f1,l1,o,n,C,r,s,void 0,void 0,V,S1,V1,D,p,E,S,w,!0),f1.beginPath(),f1.moveTo(0,$1-.5),f1.lineTo(r,$1-.5),f1.strokeStyle=y0((A2=(L2=w.headerBottomBorderColor)!=null?L2:w.horizontalBorderColor)!=null?A2:w.borderColor,w.bgHeader),f1.stroke(),R2&&D8(f1,r,s,a,o,n,C,c,g,v,V,d,E,S,m1,w),Z1&&t3(f1,r,s,o,n,C,l1,c,w,S1,x,V1,k,E,p1,N,S)};if(t2!==void 0){let L2=l1[l1.length-1].sourceIndex+1,A2=t2.hasItemInRegion([{x:a,y:-2,width:L2,height:2},{x:a,y:o,width:L2,height:300},{x:0,y:o,width:g,height:300},{x:0,y:-2,width:g,height:2},{x:a,y:S-E,width:L2,height:E,when:E>0}]),y2=F2=>{L8(F2,l1,c,s,S1,n,C,o,S,V1,k,b,D,u,B,L,E,p1,M1,t2,x,K,m1,w1,J,s1,R1,Q,o1,w,H1,W1,E2,Z,w2);let Z0=x.current;N&&L&&Z0!==void 0&&t2.has(W7(Z0.range))&&t3(F2,r,s,o,n,C,l1,c,w,S1,x,V1,k,E,p1,N,S)};A2&&(y2(b1),L1!==null&&(L1.save(),L1.scale(a1,a1),L1.textBaseline="middle",y2(L1),L1.restore()),t2.hasHeader()&&(RH(f1,l1,r,V,S1,n,C,o,t2),Q2())),b1.restore(),f1.restore();return}if((T1!==!0||a!==(t1==null?void 0:t1.cellXOffset)||n!==(t1==null?void 0:t1.translateX)||Z1!==(t1==null?void 0:t1.mustDrawFocusOnHeader)||R2!==(t1==null?void 0:t1.mustDrawHighlightRingsOnHeader))&&Q2(),T1===!0){d0(n1!==void 0&&t1!==void 0);let{regions:L2}=ws(b1,n1,n1===U1?t1.aBufferScroll:t1.bBufferScroll,n1===U1?t1.bBufferScroll:t1.aBufferScroll,t1,a,o,n,C,E,r,s,S,S1,a1,c,l1,d,i2);M1=L2}else T1!==!1&&(d0(t1!==void 0),M1=gs(t1,a,o,n,C,r,s,S1,l1,T1));cs(b1,l1,r,s,E,S,p,V1,w);let e0=D8(b1,r,s,a,o,n,C,c,g,v,V,d,E,S,m1,w),t0=L?t3(b1,r,s,o,n,C,l1,c,w,S1,x,V1,k,E,p1,N,S):void 0;if(b1.fillStyle=w.bgCell,M1.length>0){b1.beginPath();for(let L2 of M1)b1.rect(L2.x,L2.y,L2.width,L2.height);b1.clip(),b1.fill(),b1.beginPath()}else b1.fillRect(0,0,r,s);let c0=L8(b1,l1,c,s,S1,n,C,o,S,V1,k,b,D,u,B,L,E,p1,M1,t2,x,K,m1,w1,J,s1,R1,Q,o1,w,H1,W1,E2,Z,w2);Cs(b1,l1,c,r,s,S1,n,C,o,S,V1,D,x.rows,u,E,p1,M1,t2,w),hs(b1,l1,o,n,C,r,s,M1,S1,V1,D,p,E,S,w),P8(b1,l1,o,n,C,r,s,M1,c0,V,S1,V1,D,p,E,S,w),e0==null||e0(),t0==null||t0(),R&&_0(l1,0,n,0,S1,(L2,A2)=>{var y2,F2;return L2.sourceIndex===g1?(A8(f1,A2+L2.width,0,S1+1,y0((y2=w.resizeIndicatorColor)!=null?y2:w.accentLight,w.bgHeader)),A8(b1,A2+L2.width,S1,s,y0((F2=w.resizeIndicatorColor)!=null?F2:w.accentLight,w.bgCell)),!0):!1}),L1!==null&&(L1.fillStyle=w.bgCell,L1.fillRect(0,0,r,s),L1.drawImage(b1.canvas,0,0));let Y2=BH(l1,s,S1,n,C,o,S,V1,E,p1);w1==null||w1.setWindow({x:a,y:o,width:l1.length,height:Y2-o},g,Array.from({length:E},(L2,A2)=>S-1-A2));let J2=t1!==void 0&&(a!==t1.cellXOffset||n!==t1.translateX),k0=t1!==void 0&&(o!==t1.cellYOffset||C!==t1.translateY);G.current={cellXOffset:a,cellYOffset:o,translateX:n,translateY:C,mustDrawFocusOnHeader:Z1,mustDrawHighlightRingsOnHeader:R2,lastBuffer:i2?z2===U1?"a":"b":void 0,aBufferScroll:z2===U1?[J2,k0]:t1==null?void 0:t1.aBufferScroll,bBufferScroll:z2===H2?[J2,k0]:t1==null?void 0:t1.bBufferScroll},b1.restore(),f1.restore()}var O8=F1(A9(),1);var zH=80;function yH(e){let t=e-1;return t*t*t+1}var i3=class{constructor(t){c2(this,"callback");c2(this,"currentHoveredItem");c2(this,"leavingItems",[]);c2(this,"lastAnimationTime");c2(this,"addToLeavingItems",t=>{this.leavingItems.some(l=>g5(l.item,t.item))||this.leavingItems.push(t)});c2(this,"removeFromLeavingItems",t=>{var l;let i=this.leavingItems.find(r=>g5(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==i),(l=i==null?void 0:i.hoverAmount)!=null?l:0});c2(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});c2(this,"shouldStep",()=>{let t=this.leavingItems.length>0,i=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||i});c2(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>P(y({},t),{hoverAmount:yH(t.hoverAmount)})));c2(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{let l=(t-this.lastAnimationTime)/zH;for(let s of this.leavingItems)s.hoverAmount=(0,O8.default)(s.hoverAmount-l,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=(0,O8.default)(this.currentHoveredItem.hoverAmount+l,0,1));let r=this.getAnimatingItems();this.callback(r),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0});c2(this,"setHovered",t=>{var i;if(!g5((i=this.currentHoveredItem)==null?void 0:i.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){let l=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:l}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}});this.callback=t}};var _8=class{constructor(t){c2(this,"fn");c2(this,"val");this.fn=t}get value(){var t;return(t=this.val)!=null?t:this.val=this.fn()}};function W8(e){return new _8(e)}var Ls=W8(()=>window.navigator.userAgent.includes("Firefox")),i9=W8(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),V5=W8(()=>window.navigator.platform.toLowerCase().startsWith("mac"));var d5=F1(Y1(),1);function Vs(e){let t=d5.useRef([]),i=d5.useRef(0),l=d5.useRef(e);l.current=e;let r=d5.useCallback(()=>{let s=()=>window.requestAnimationFrame(a),a=()=>{let o=t.current.map(X5);t.current=[],l.current(new R4(o)),t.current.length>0?i.current++:i.current=0};window.requestAnimationFrame(i.current>600?s:a)},[]);return d5.useCallback(s=>{t.current.length===0&&r();let a=F0(s[0],s[1]);t.current.includes(a)||t.current.push(a)},[r])}var B4="header",S0="group-header",l9="out-of-bounds",u5;(function(e){e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End"})(u5||(u5={}));function l3(e,t){return e===t?!0:(e==null?void 0:e.kind)==="out-of-bounds"?(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])&&(e==null?void 0:e.region[0])===(t==null?void 0:t.region[0])&&(e==null?void 0:e.region[1])===(t==null?void 0:t.region[1]):(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])}var ds=6,bH=(e,t)=>{var l;if(e.kind===c1.Custom)return e.copyData;let i=t==null?void 0:t(e);return(l=i==null?void 0:i.getAccessibilityString(e))!=null?l:""},FH=(e,t)=>{var m4,g0,H0,i0,h0,S5,i7,g9,L0,N0;let{width:i,height:l,accessibilityHeight:r,columns:s,cellXOffset:a,cellYOffset:o,headerHeight:n,fillHandle:C=!1,groupHeaderHeight:c,rowHeight:h,rows:g,getCellContent:m,getRowThemeOverride:w,onHeaderMenuClick:L,enableGroups:v,isFilling:V,onCanvasFocused:u,onCanvasBlur:d,isFocused:p,selection:Z,freezeColumns:R,onContextMenu:x,freezeTrailingRows:N,fixedShadowX:E=!0,fixedShadowY:S=!0,drawFocusRing:k,onMouseDown:b,onMouseUp:D,onMouseMoveRaw:B,onMouseMove:_,onItemHovered:K,dragAndDropState:Q,firstColAccessible:m1,onKeyDown:g1,onKeyUp:w1,highlightRegions:G,canvasRef:s1,onDragStart:o1,onDragEnd:R1,eventTargetRef:J,isResizing:I1,resizeColumn:p1,isDragging:e2,isDraggable:H1=!1,allowResize:W1,disabledRows:E2,hasAppendRow:Z2,getGroupDetails:u2,theme:y1,prelightCells:t2,headerIcons:w2,verticalBorder:i2,drawCell:a1,drawHeader:T1,onCellFocused:l2,onDragOverCell:q1,onDrop:S1,onDragLeave:$1,imageWindowLoader:U1,smoothScrollX:H2=!1,smoothScrollY:t1=!1,experimental:L1,getCellRenderer:f1}=e,b1=(m4=e.translateX)!=null?m4:0,z2=(g0=e.translateY)!=null?g0:0,n1=Math.max(R,Math.min(s.length-1,a)),V1=e1.useRef(null),l1=U1,M1=e1.useRef(),[Z1,R2]=e1.useState(!1),Q2=e1.useRef([]),e0=e1.useRef(),[t0,c0]=e1.useState(),[Y2,J2]=e1.useState(),k0=e1.useRef(null),[C2,m2]=e1.useState(),[L2,A2]=e1.useState(!1),y2=e1.useRef(L2);y2.current=L2;let F2=e1.useMemo(()=>new X7(w2,()=>{p4.current=void 0,j4.current()}),[w2]),Z0=v?c+n:n,o4=e1.useRef(-1),T0=((H0=L1==null?void 0:L1.enableFirefoxRescaling)!=null?H0:!1)&&Ls.value,m0=((i0=L1==null?void 0:L1.enableSafariRescaling)!=null?i0:!1)&&i9.value;e1.useLayoutEffect(()=>{window.devicePixelRatio===1||!T0&&!m0||(o4.current!==-1&&R2(!0),window.clearTimeout(o4.current),o4.current=window.setTimeout(()=>{R2(!1),o4.current=-1},200))},[o,n1,b1,z2,T0,m0]);let B1=mt(s,R),S2=E?Z4(B1,Q):0,X1=e1.useCallback((z,j,x1)=>{let v1=z.getBoundingClientRect();if(j>=B1.length||x1>=g)return;let C1=v1.width/i,Y=P9(j,x1,i,l,c,Z0,n1,o,b1,z2,g,R,N,B1,h);return C1!==1&&(Y.x*=C1,Y.y*=C1,Y.width*=C1,Y.height*=C1),Y.x+=v1.x,Y.y+=v1.y,Y},[i,l,c,Z0,n1,o,b1,z2,g,R,N,B1,h]),N2=e1.useCallback((z,j,x1,v1)=>{var O2,V0;let C1=z.getBoundingClientRect(),Y=C1.width/i,_1=(j-C1.left)/Y,K1=(x1-C1.top)/Y,h1=5,q2=T9(B1,n1,i,void 0,b1),r2=0,G1=0;v1 instanceof MouseEvent&&(r2=v1.button,G1=v1.buttons);let d2=Lt(_1,q2,b1),Q1=Vt(K1,l,v,n,c,g,h,o,z2,N),k2=(v1==null?void 0:v1.shiftKey)===!0,l0=(v1==null?void 0:v1.ctrlKey)===!0,K0=(v1==null?void 0:v1.metaKey)===!0,$2=v1!==void 0&&!(v1 instanceof MouseEvent)||(v1==null?void 0:v1.pointerType)==="touch",U2=[_1<0?-1:i<_1?1:0,K1i||K1>l){let v2=_1>i?1:_1<0?-1:0,J0=K1>l?1:K1<0?-1:0,M0=v2*2,e4=J0*2;v2===0&&(M0=d2===-1?u5.EndPadding:u5.Center),J0===0&&(e4=Q1===void 0?u5.EndPadding:u5.Center);let X0=!1;if(d2===-1&&Q1===-1){let Q4=X1(z,B1.length-1,-1);d0(Q4!==void 0),X0=ji&&_1l&&K1=0?(J0=!0,v2=X1(z,M0,Q1),d0(v2!==void 0),I2={kind:v&&Q1===-2?S0:B4,location:[M0,Q1],bounds:v2,group:(O2=B1[M0].group)!=null?O2:"",isEdge:J0,shiftKey:k2,ctrlKey:l0,metaKey:K0,isTouch:$2,localEventX:j-v2.x,localEventY:x1-v2.y,button:r2,buttons:G1,scrollEdge:U2}):I2={kind:v&&Q1===-2?S0:B4,group:(V0=B1[d2].group)!=null?V0:"",location:[d2,Q1],bounds:v2,isEdge:J0,shiftKey:k2,ctrlKey:l0,metaKey:K0,isTouch:$2,localEventX:j-v2.x,localEventY:x1-v2.y,button:r2,buttons:G1,scrollEdge:U2}}else{let v2=X1(z,d2,Q1);d0(v2!==void 0);let J0=v2!==void 0&&v2.x+v2.width-j{}),v4=e1.useRef(t0);v4.current=t0;let[P0,q0]=e1.useMemo(()=>{let z=document.createElement("canvas"),j=document.createElement("canvas");return z.style.display="none",z.style.opacity="0",z.style.position="fixed",j.style.display="none",j.style.opacity="0",j.style.position="fixed",[z.getContext("2d",{alpha:!1}),j.getContext("2d",{alpha:!1})]},[]);e1.useLayoutEffect(()=>{if(!(P0===null||q0===null))return document.documentElement.append(P0.canvas),document.documentElement.append(q0.canvas),()=>{P0.canvas.remove(),q0.canvas.remove()}},[P0,q0]);let z4=e1.useMemo(()=>new q7,[]),K9=T0&&Z1?1:m0&&Z1?2:5,X9=(L1==null?void 0:L1.disableMinimumCellWidth)===!0?1:10,p4=e1.useRef(),f5=e1.useRef(null),Z5=e1.useRef(null),E5=e1.useCallback(()=>{var _1,K1,h1;let z=V1.current,j=k0.current;if(z===null||j===null||(f5.current===null&&(f5.current=z.getContext("2d",{alpha:!1}),z.width=0,z.height=0),Z5.current===null&&(Z5.current=j.getContext("2d",{alpha:!1}),j.width=0,j.height=0),f5.current===null||Z5.current===null||P0===null||q0===null))return;let x1=!1,v1=q2=>{x1=!0,m2(q2)},C1=p4.current,Y={headerCanvasCtx:Z5.current,canvasCtx:f5.current,bufferACtx:P0,bufferBCtx:q0,width:i,height:l,cellXOffset:n1,cellYOffset:o,translateX:Math.round(b1),translateY:Math.round(z2),mappedColumns:B1,enableGroups:v,freezeColumns:R,dragAndDropState:Q,theme:y1,headerHeight:n,groupHeaderHeight:c,disabledRows:E2!=null?E2:x2.empty(),rowHeight:h,verticalBorder:i2,isResizing:I1,resizeCol:p1,isFocused:p,selection:Z,fillHandle:C,drawCellCallback:a1,hasAppendRow:Z2,overrideCursor:v1,maxScaleFactor:K9,freezeTrailingRows:N,rows:g,drawFocus:k,getCellContent:m,getGroupDetails:u2!=null?u2:q2=>({name:q2}),getRowThemeOverride:w,drawHeaderCallback:T1,prelightCells:t2,highlightRegions:G,imageLoader:l1,lastBlitData:e0,damage:M1.current,hoverValues:Q2.current,hoverInfo:v4.current,spriteManager:F2,scrolling:Z1,hyperWrapping:(_1=L1==null?void 0:L1.hyperWrapping)!=null?_1:!1,touchMode:L2,enqueue:Q0.current,renderStateProvider:z4,renderStrategy:(K1=L1==null?void 0:L1.renderStrategy)!=null?K1:i9.value?"double-buffer":"single-buffer",getCellRenderer:f1,minimumCellWidth:X9};Y.damage===void 0?(p4.current=Y,I8(Y,C1)):I8(Y,void 0),!x1&&(Y.damage===void 0||Y.damage.has((h1=v4==null?void 0:v4.current)==null?void 0:h1[0]))&&m2(void 0)},[P0,q0,i,l,n1,o,b1,z2,B1,v,R,Q,y1,n,c,E2,h,i2,I1,Z2,p1,p,Z,C,N,g,k,K9,m,u2,w,a1,T1,t2,G,l1,F2,Z1,L1==null?void 0:L1.hyperWrapping,L1==null?void 0:L1.renderStrategy,L2,z4,f1,X9]),j4=e1.useRef(E5);e1.useLayoutEffect(()=>{E5(),j4.current=E5},[E5]),e1.useLayoutEffect(()=>{(async()=>{var j;((j=document==null?void 0:document.fonts)==null?void 0:j.ready)!==void 0&&(await document.fonts.ready,p4.current=void 0,j4.current())})()},[]);let T4=e1.useCallback(z=>{M1.current=z,j4.current(),M1.current=void 0},[]),j9=Vs(T4);Q0.current=j9;let Y9=e1.useCallback(z=>{T4(new R4(z.map(j=>j.cell)))},[T4]);l1.setCallback(T4);let[w3,g3]=e1.useState(!1),[N5,y4]=j1!=null?j1:[],H3=N5!==void 0&&y4===-1,L3=N5!==void 0&&y4===-2,Q9=!1,R5=!1,s0=C2;if(s0===void 0&&N5!==void 0&&y4!==void 0&&y4>-1&&y4({contain:"strict",display:"block",cursor:B5}),[B5]),o9=e1.useRef("default"),P4=J==null?void 0:J.current;P4!=null&&o9.current!==z5.cursor&&(P4.style.cursor=o9.current=z5.cursor);let U0=e1.useCallback((z,j,x1,v1)=>{if(u2===void 0)return;let C1=u2(z);if(C1.actions!==void 0){let Y=u8(j,C1.actions);for(let[_1,K1]of Y.entries())if(G4(K1,x1+j.x,v1+K1.y))return C1.actions[_1]}},[u2]),n4=e1.useCallback((z,j,x1,v1)=>{let C1=s[j];if(!e2&&!I1&&C1.hasMenu===!0&&!(Y2!=null&&Y2)){let Y=X1(z,j,-1);d0(Y!==void 0);let _1=d8(Y.x,Y.y,Y.width,Y.height,$5(C1.title)==="rtl");if(x1>_1.x&&x1<_1.x+_1.width&&v1>_1.y&&v1<_1.y+_1.height)return Y}},[s,X1,Y2,e2,I1]),n9=e1.useRef(0),D4=e1.useRef(),C9=e1.useRef(!1),B0=e1.useCallback(z=>{let j=V1.current,x1=J==null?void 0:J.current;if(j===null||z.target!==j&&z.target!==x1)return;C9.current=!0;let v1,C1;if(z instanceof MouseEvent?(v1=z.clientX,C1=z.clientY):(v1=z.touches[0].clientX,C1=z.touches[0].clientY),z.target===x1&&x1!==null){let _1=x1.getBoundingClientRect();if(v1>_1.right||C1>_1.bottom)return}let Y=N2(j,v1,C1,z);D4.current=Y.location,Y.isTouch&&(n9.current=Date.now()),y2.current!==Y.isTouch&&A2(Y.isTouch),!(Y.kind===B4&&n4(j,Y.location[0],v1,C1)!==void 0)&&(Y.kind===S0&&U0(Y.group,Y.bounds,Y.localEventX,Y.localEventY)!==void 0||(b==null||b(Y),!Y.isTouch&&H1!==!0&&H1!==Y.kind&&Y.button<3&&Y.button!==1&&z.preventDefault()))},[J,H1,N2,U0,n4,b]);n0("touchstart",B0,window,!1),n0("mousedown",B0,window,!1);let y5=e1.useRef(0),c9=e1.useCallback(z=>{var G1,d2;let j=y5.current;y5.current=Date.now();let x1=V1.current;if(C9.current=!1,D===void 0||x1===null)return;let v1=J==null?void 0:J.current,C1=z.target!==x1&&z.target!==v1,Y,_1,K1=!0;if(z instanceof MouseEvent){if(Y=z.clientX,_1=z.clientY,K1=z.button<3,z.pointerType==="touch")return}else Y=z.changedTouches[0].clientX,_1=z.changedTouches[0].clientY;let h1=N2(x1,Y,_1,z);h1.isTouch&&n9.current!==0&&Date.now()-n9.current>500&&(h1=P(y({},h1),{isLongTouch:!0})),j!==0&&Date.now()-j<(h1.isTouch?1e3:500)&&(h1=P(y({},h1),{isDoubleClick:!0})),y2.current!==h1.isTouch&&A2(h1.isTouch),!C1&&z.cancelable&&K1&&z.preventDefault();let[q2]=h1.location,r2=n4(x1,q2,Y,_1);if(h1.kind===B4&&r2!==void 0){(h1.button!==0||((G1=D4.current)==null?void 0:G1[0])!==q2||((d2=D4.current)==null?void 0:d2[1])!==-1)&&D(h1,!0);return}else if(h1.kind===S0){let Q1=U0(h1.group,h1.bounds,h1.localEventX,h1.localEventY);if(Q1!==void 0){h1.button===0&&Q1.onClick(h1);return}}D(h1,C1)},[D,J,N2,n4,U0]);n0("mouseup",c9,window,!1),n0("touchend",c9,window,!1);let J9=e1.useCallback(z=>{var r2,G1;let j=V1.current;if(j===null)return;let x1=J==null?void 0:J.current,v1=z.target!==j&&z.target!==x1,C1,Y,_1=!0;z instanceof MouseEvent?(C1=z.clientX,Y=z.clientY,_1=z.button<3):(C1=z.changedTouches[0].clientX,Y=z.changedTouches[0].clientY);let K1=N2(j,C1,Y,z);y2.current!==K1.isTouch&&A2(K1.isTouch),!v1&&z.cancelable&&_1&&z.preventDefault();let[h1]=K1.location,q2=n4(j,h1,C1,Y);if(K1.kind===B4&&q2!==void 0)K1.button===0&&((r2=D4.current)==null?void 0:r2[0])===h1&&((G1=D4.current)==null?void 0:G1[1])===-1&&(L==null||L(h1,q2));else if(K1.kind===S0){let d2=U0(K1.group,K1.bounds,K1.localEventX,K1.localEventY);d2!==void 0&&K1.button===0&&d2.onClick(K1)}},[J,N2,n4,L,U0]);n0("click",J9,window,!1);let V3=e1.useCallback(z=>{let j=V1.current,x1=J==null?void 0:J.current;if(j===null||z.target!==j&&z.target!==x1||x===void 0)return;let v1=N2(j,z.clientX,z.clientY,z);x(v1,()=>{z.cancelable&&z.preventDefault()})},[J,N2,x]);n0("contextmenu",V3,(h0=J==null?void 0:J.current)!=null?h0:null,!1);let e7=e1.useCallback(z=>{M1.current=new R4(z.map(j=>j.item)),Q2.current=z,j4.current(),M1.current=void 0},[]),C4=e1.useMemo(()=>new i3(e7),[e7]),b4=e1.useRef(C4);b4.current=C4,e1.useLayoutEffect(()=>{let z=b4.current;if(j1===void 0||j1[1]<0){z.setHovered(j1);return}let j=m(j1,!0),x1=f1(j),v1=x1===void 0&&j.kind===c1.Custom||(x1==null?void 0:x1.needsHover)!==void 0&&(typeof x1.needsHover=="boolean"?x1.needsHover:x1.needsHover(j));z.setHovered(v1?j1:void 0)},[m,f1,j1]);let G0=e1.useRef(),A=e1.useCallback(z=>{var K1;let j=V1.current;if(j===null)return;let x1=J==null?void 0:J.current,v1=z.target!==j&&z.target!==x1,C1=N2(j,z.clientX,z.clientY,z);if(C1.kind!=="out-of-bounds"&&v1&&!C9.current&&!C1.isTouch)return;let Y=(h1,q2)=>{c0(r2=>r2===h1||(r2==null?void 0:r2[0][0])===(h1==null?void 0:h1[0][0])&&(r2==null?void 0:r2[0][1])===(h1==null?void 0:h1[0][1])&&((r2==null?void 0:r2[1][0])===(h1==null?void 0:h1[1][0])&&(r2==null?void 0:r2[1][1])===(h1==null?void 0:h1[1][1])||!q2)?r2:h1)};if(!l3(C1,G0.current))m2(void 0),K==null||K(C1),Y(C1.kind===l9?void 0:[C1.location,[C1.localEventX,C1.localEventY]],!0),G0.current=C1;else if(C1.kind==="cell"||C1.kind===B4||C1.kind===S0){let h1=!1,q2=!0;if(C1.kind==="cell"){let G1=m(C1.location),d2=(K1=f1(G1))==null?void 0:K1.needsHoverPosition;q2=d2!=null?d2:G1.kind===c1.Custom,h1=q2}else C1.kind===S0&&(h1=!0);let r2=[C1.location,[C1.localEventX,C1.localEventY]];Y(r2,q2),v4.current=r2,h1&&T4(new R4([C1.location]))}let _1=C1.location[0]>=(m1?0:1);J2(C1.kind===B4&&C1.isEdge&&_1&&W1===!0),g3(C1.kind==="cell"&&C1.isFillHandle),B==null||B(z),_(C1)},[J,N2,m1,W1,B,_,K,m,f1,T4]);n0("mousemove",A,window,!0);let W2=e1.useCallback(z=>{let j=V1.current;if(j===null)return;let x1,v1;Z.current!==void 0&&(x1=X1(j,Z.current.cell[0],Z.current.cell[1]),v1=Z.current.cell),g1==null||g1({bounds:x1,stopPropagation:()=>z.stopPropagation(),preventDefault:()=>z.preventDefault(),cancel:()=>{},ctrlKey:z.ctrlKey,metaKey:z.metaKey,shiftKey:z.shiftKey,altKey:z.altKey,key:z.key,keyCode:z.keyCode,rawEvent:z,location:v1})},[g1,Z,X1]),Y4=e1.useCallback(z=>{let j=V1.current;if(j===null)return;let x1,v1;Z.current!==void 0&&(x1=X1(j,Z.current.cell[0],Z.current.cell[1]),v1=Z.current.cell),w1==null||w1({bounds:x1,stopPropagation:()=>z.stopPropagation(),preventDefault:()=>z.preventDefault(),cancel:()=>{},ctrlKey:z.ctrlKey,metaKey:z.metaKey,shiftKey:z.shiftKey,altKey:z.altKey,key:z.key,keyCode:z.keyCode,rawEvent:z,location:v1})},[w1,Z,X1]),d3=e1.useCallback(z=>{V1.current=z,s1!==void 0&&(s1.current=z)},[s1]),t7=e1.useCallback(z=>{var G1;let j=V1.current;if(j===null||H1===!1||I1){z.preventDefault();return}let x1,v1,C1=N2(j,z.clientX,z.clientY);if(H1!==!0&&C1.kind!==H1){z.preventDefault();return}let Y=(d2,Q1)=>{x1=d2,v1=Q1},_1,K1,h1,q2=(d2,Q1,k2)=>{_1=d2,K1=Q1,h1=k2},r2=!1;if(o1==null||o1(P(y({},C1),{setData:Y,setDragImage:q2,preventDefault:()=>r2=!0,defaultPrevented:()=>r2})),!r2&&x1!==void 0&&v1!==void 0&&z.dataTransfer!==null)if(z.dataTransfer.setData(x1,v1),z.dataTransfer.effectAllowed="copyLink",_1!==void 0&&K1!==void 0&&h1!==void 0)z.dataTransfer.setDragImage(_1,K1,h1);else{let[d2,Q1]=C1.location;if(Q1!==void 0){let k2=document.createElement("canvas"),l0=X1(j,d2,Q1);d0(l0!==void 0);let K0=Math.ceil((G1=window.devicePixelRatio)!=null?G1:1);k2.width=l0.width*K0,k2.height=l0.height*K0;let $2=k2.getContext("2d");$2!==null&&($2.scale(K0,K0),$2.textBaseline="middle",Q1===-1?($2.font=y1.headerFontFull,$2.fillStyle=y1.bgHeader,$2.fillRect(0,0,k2.width,k2.height),v8($2,0,0,l0.width,l0.height,B1[d2],!1,y1,!1,!1,0,F2,T1,!1)):($2.font=y1.baseFontFull,$2.fillStyle=y1.bgCell,$2.fillRect(0,0,k2.width,k2.height),V8($2,m([d2,Q1]),0,Q1,!1,!1,0,0,l0.width,l0.height,!1,y1,y1.bgCell,l1,F2,1,void 0,!1,0,void 0,void 0,void 0,z4,f1,()=>{}))),k2.style.left="-100%",k2.style.position="absolute",k2.style.width=`${l0.width}px`,k2.style.height=`${l0.height}px`,document.body.append(k2),z.dataTransfer.setDragImage(k2,l0.width/2,l0.height/2),window.setTimeout(()=>{k2.remove()},0)}}else z.preventDefault()},[H1,I1,N2,o1,X1,y1,B1,F2,T1,m,l1,z4,f1]);n0("dragstart",t7,(S5=J==null?void 0:J.current)!=null?S5:null,!1,!1);let m9=e1.useRef(),u3=e1.useCallback(z=>{var h1;let j=V1.current;if(S1!==void 0&&z.preventDefault(),j===null||q1===void 0)return;let x1=N2(j,z.clientX,z.clientY),[v1,C1]=x1.location,Y=v1-(m1?0:1),[_1,K1]=(h1=m9.current)!=null?h1:[];(_1!==Y||K1!==C1)&&(m9.current=[Y,C1],q1([Y,C1],z.dataTransfer))},[m1,N2,q1,S1]);n0("dragover",u3,(i7=J==null?void 0:J.current)!=null?i7:null,!1,!1);let h9=e1.useCallback(()=>{m9.current=void 0,R1==null||R1()},[R1]);n0("dragend",h9,(g9=J==null?void 0:J.current)!=null?g9:null,!1,!1);let W=e1.useCallback(z=>{let j=V1.current;if(j===null||S1===void 0)return;z.preventDefault();let x1=N2(j,z.clientX,z.clientY),[v1,C1]=x1.location,Y=v1-(m1?0:1);S1([Y,C1],z.dataTransfer)},[m1,N2,S1]);n0("drop",W,(L0=J==null?void 0:J.current)!=null?L0:null,!1,!1);let E0=e1.useCallback(()=>{$1==null||$1()},[$1]);n0("dragleave",E0,(N0=J==null?void 0:J.current)!=null?N0:null,!1,!1);let a0=e1.useRef(Z);a0.current=Z;let b5=e1.useRef(null),w9=e1.useCallback(z=>{var j;V1.current===null||!V1.current.contains(document.activeElement)||(z===null&&a0.current.current!==void 0?(j=s1==null?void 0:s1.current)==null||j.focus({preventScroll:!0}):z!==null&&z.focus({preventScroll:!0}),b5.current=z)},[s1]);e1.useImperativeHandle(t,()=>({focus:()=>{var j;let z=b5.current;z===null||!document.contains(z)?(j=s1==null?void 0:s1.current)==null||j.focus({preventScroll:!0}):z.focus({preventScroll:!0})},getBounds:(z,j)=>{if(!(s1===void 0||s1.current===null))return X1(s1.current,z!=null?z:0,j!=null?j:-1)},damage:Y9}),[s1,Y9,X1]);let A4=e1.useRef(),D0=Ie(()=>{var K1,h1,q2,r2;if(i<50||(L1==null?void 0:L1.disableAccessibilityTree)===!0)return null;let z=T9(B1,n1,i,Q,b1),j=m1?0:-1;!m1&&((K1=z[0])==null?void 0:K1.sourceIndex)===0&&(z=z.slice(1));let[x1,v1]=(q2=(h1=Z.current)==null?void 0:h1.cell)!=null?q2:[],C1=(r2=Z.current)==null?void 0:r2.range,Y=z.map(G1=>G1.sourceIndex),_1=(0,us.default)(o,Math.min(g,o+r));return x1!==void 0&&v1!==void 0&&!(Y.includes(x1)&&_1.includes(v1))&&w9(null),e1.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":B1.length+j},e1.createElement("thead",{role:"rowgroup"},e1.createElement("tr",{role:"row","aria-rowindex":1},z.map(G1=>e1.createElement("th",{role:"columnheader","aria-selected":Z.columns.hasIndex(G1.sourceIndex),"aria-colindex":G1.sourceIndex+1+j,tabIndex:-1,onFocus:d2=>{if(d2.target!==b5.current)return l2==null?void 0:l2([G1.sourceIndex,-1])},key:G1.sourceIndex},G1.title)))),e1.createElement("tbody",{role:"rowgroup"},_1.map(G1=>e1.createElement("tr",{role:"row","aria-selected":Z.rows.hasIndex(G1),key:G1,"aria-rowindex":G1+2},z.map(d2=>{let Q1=d2.sourceIndex,k2=F0(Q1,G1),l0=x1===Q1&&v1===G1,K0=C1!==void 0&&Q1>=C1.x&&Q1=C1.y&&G1{let O2=s1==null?void 0:s1.current;if(O2!=null)return g1==null?void 0:g1({bounds:X1(O2,Q1,G1),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:U2})},onFocusCapture:O2=>{var V0,v2;if(!(O2.target===b5.current||((V0=A4.current)==null?void 0:V0[0])===Q1&&((v2=A4.current)==null?void 0:v2[1])===G1))return A4.current=U2,l2==null?void 0:l2(U2)},ref:l0?w9:void 0,tabIndex:-1},bH(I2,f1))})))))},[i,B1,n1,Q,b1,g,o,r,Z,w9,m,s1,g1,X1,l2],200),c4=R===0||!E?0:n1>R?1:(0,q8.default)(-b1/100,0,1),v3=-o*32+z2,F5=S?(0,q8.default)(-v3/100,0,1):0,p3=e1.useMemo(()=>{if(!c4&&!F5)return null;let z={position:"absolute",top:0,left:S2,width:i-S2,height:l,opacity:c4,pointerEvents:"none",transition:H2?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},j={position:"absolute",top:Z0,left:0,width:i,height:l,opacity:F5,pointerEvents:"none",transition:t1?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return e1.createElement(e1.Fragment,null,c4>0&&e1.createElement("div",{id:"shadow-x",style:z}),F5>0&&e1.createElement("div",{id:"shadow-y",style:j}))},[c4,F5,S2,i,H2,Z0,l,t1]),M3=e1.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return e1.createElement(e1.Fragment,null,e1.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:W2,onKeyUp:Y4,onFocus:u,onBlur:d,ref:d3,style:z5},D0),e1.createElement("canvas",{ref:k0,style:M3}),p3)},vs=e1.memo(e1.forwardRef(FH));function $9(e,t,i,l){var r;return(0,ps.default)(Math.round(t-((r=e.growOffset)!=null?r:0)),Math.ceil(i),Math.floor(l))}var SH=e=>{var i2;let[t,i]=D2.useState(),[l,r]=D2.useState(),[s,a]=D2.useState(),[o,n]=D2.useState(),[C,c]=D2.useState(!1),[h,g]=D2.useState(),[m,w]=D2.useState(),[L,v]=D2.useState(),[V,u]=D2.useState(!1),[d,p]=D2.useState(),{onHeaderMenuClick:Z,getCellContent:R,onColumnMoved:x,onColumnResize:N,onColumnResizeStart:E,onColumnResizeEnd:S,gridRef:k,maxColumnWidth:b,minColumnWidth:D,onRowMoved:B,lockColumns:_,onColumnProposeMove:K,onMouseDown:Q,onMouseUp:m1,onItemHovered:g1,onDragStart:w1,canvasRef:G}=e,s1=((i2=N!=null?N:S)!=null?i2:E)!==void 0,{columns:o1,selection:R1}=e,J=R1.columns,I1=D2.useCallback(a1=>{let[T1,l2]=a1.location;s!==void 0&&o!==T1&&T1>=_?(c(!0),n(T1)):m!==void 0&&l2!==void 0?(u(!0),v(Math.max(0,l2))):l===void 0&&!C&&!V&&(g1==null||g1(a1))},[s,m,o,g1,_,l,C,V]),p1=x!==void 0,e2=D2.useCallback(a1=>{var T1,l2;if(a1.button===0){let[q1,S1]=a1.location;if(a1.kind==="out-of-bounds"&&a1.isEdge&&s1){let $1=(T1=k==null?void 0:k.current)==null?void 0:T1.getBounds(o1.length-1,-1);$1!==void 0&&(i($1.x),r(o1.length-1))}else if(a1.kind==="header"&&q1>=_){let $1=G==null?void 0:G.current;if(a1.isEdge&&s1&&$1){i(a1.bounds.x),r(q1);let H2=$1.getBoundingClientRect().width/$1.offsetWidth,t1=a1.bounds.width/H2;E==null||E(o1[q1],t1,q1,t1+((l2=o1[q1].growOffset)!=null?l2:0))}else a1.kind==="header"&&p1&&(g(a1.bounds.x),a(q1))}else a1.kind==="cell"&&_>0&&q1===0&&S1!==void 0&&B!==void 0&&(p(a1.bounds.y),w(S1))}Q==null||Q(a1)},[Q,s1,_,B,k,o1,p1,E,G]),H1=D2.useCallback((a1,T1)=>{C||V||Z==null||Z(a1,T1)},[C,V,Z]),W1=D2.useRef(-1),E2=D2.useCallback(()=>{W1.current=-1,w(void 0),v(void 0),p(void 0),u(!1),a(void 0),n(void 0),g(void 0),c(!1),r(void 0),i(void 0)},[]),Z2=D2.useCallback((a1,T1)=>{var l2,q1,S1;if(a1.button===0){if(l!==void 0){if((J==null?void 0:J.hasIndex(l))===!0)for(let U1 of J){if(U1===l)continue;let H2=o1[U1],t1=$9(H2,W1.current,D,b);N==null||N(H2,t1,U1,t1+((l2=H2.growOffset)!=null?l2:0))}let $1=$9(o1[l],W1.current,D,b);if(S==null||S(o1[l],$1,l,$1+((q1=o1[l].growOffset)!=null?q1:0)),J.hasIndex(l))for(let U1 of J){if(U1===l)continue;let H2=o1[U1],t1=$9(H2,W1.current,D,b);S==null||S(H2,t1,U1,t1+((S1=H2.growOffset)!=null?S1:0))}}E2(),s!==void 0&&o!==void 0&&(x==null||x(s,o)),m!==void 0&&L!==void 0&&(B==null||B(m,L))}m1==null||m1(a1,T1)},[m1,l,s,o,m,L,J,S,o1,D,b,N,x,B,E2]),u2=D2.useMemo(()=>{if(!(s===void 0||o===void 0)&&s!==o&&(K==null?void 0:K(s,o))!==!1)return{src:s,dest:o}},[s,o,K]),y1=D2.useCallback(a1=>{var l2,q1;let T1=G==null?void 0:G.current;if(s!==void 0&&h!==void 0)Math.abs(a1.clientX-h)>20&&c(!0);else if(m!==void 0&&d!==void 0)Math.abs(a1.clientY-d)>20&&u(!0);else if(l!==void 0&&t!==void 0&&T1){let $1=T1.getBoundingClientRect().width/T1.offsetWidth,U1=(a1.clientX-t)/$1,H2=o1[l],t1=$9(H2,U1,D,b);if(N==null||N(H2,t1,l,t1+((l2=H2.growOffset)!=null?l2:0)),W1.current=U1,(J==null?void 0:J.first())===l)for(let L1 of J){if(L1===l)continue;let f1=o1[L1],b1=$9(f1,W1.current,D,b);N==null||N(f1,b1,L1,b1+((q1=f1.growOffset)!=null?q1:0))}}},[s,h,m,d,l,t,o1,D,b,N,J,G]),t2=D2.useCallback((a1,T1)=>{if(m===void 0||L===void 0)return R(a1,T1);let[l2,q1]=a1;return q1===L?q1=m:(q1>L&&(q1-=1),q1>=m&&(q1+=1)),R([l2,q1],T1)},[m,L,R]),w2=D2.useCallback(a1=>{w1==null||w1(a1),a1.defaultPrevented()||E2()},[E2,w1]);return D2.createElement(vs,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:l,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,width:e.width,getCellContent:t2,isResizing:l!==void 0,onHeaderMenuClick:H1,isDragging:C,onItemHovered:I1,onDragStart:w2,onMouseDown:e2,allowResize:s1,onMouseUp:Z2,dragAndDropState:u2,onMouseMoveRaw:y1,ref:k})},Ms=SH;var V2=F1(Y1(),1);var r9=F1(Y1(),1);function xs(e){let t=(0,r9.useRef)(null),[i,l]=(0,r9.useState)({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return(0,r9.useLayoutEffect)(()=>{let r=a=>{for(let o of a){let{width:n,height:C}=o&&o.contentRect||{};l(c=>c.width===n&&c.height===C?c:{width:n,height:C})}},s=new window.ResizeObserver(r);return t.current&&s.observe(t.current,void 0),()=>{s.disconnect()}},[t.current]),y({ref:t},i)}var K4=F1(Y1(),1),kH=(e,t,i)=>{let l=(0,K4.useRef)(null),r=(0,K4.useRef)(null),s=(0,K4.useRef)(null),a=(0,K4.useRef)(0),o=(0,K4.useRef)(t);o.current=t;let n=i.current;(0,K4.useEffect)(()=>{let C=()=>{var g,m;if(r.current===!1&&n!==null){let w=[n.scrollLeft,n.scrollTop];if(((g=s.current)==null?void 0:g[0])===w[0]&&((m=s.current)==null?void 0:m[1])===w[1])if(a.current>10){s.current=null,r.current=null;return}else a.current++;else a.current=0,o.current(w[0],w[1]),s.current=w;l.current=window.setTimeout(C,8.333333333333334)}},c=()=>{r.current=!0,s.current=null,l.current!==null&&(window.clearTimeout(l.current),l.current=null)},h=g=>{g.touches.length===0&&(r.current=!1,a.current=0,l.current=window.setTimeout(C,8.333333333333334))};if(e&&n!==null){let g=n;return g.addEventListener("touchstart",c),g.addEventListener("touchend",h),()=>{g.removeEventListener("touchstart",c),g.removeEventListener("touchend",h),l.current!==null&&window.clearTimeout(l.current)}}},[e,n])},fs=kH;var TH=()=>e=>e.isSafari?"scroll":"auto",PH=X2("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[TH()]}});function DH(e){let[t,i]=V2.useState(!1),l=typeof window=="undefined"?null:window,r=V2.useRef(0);return n0("touchstart",V2.useCallback(()=>{window.clearTimeout(r.current),i(!0)},[]),l,!0,!1),n0("touchend",V2.useCallback(s=>{s.touches.length===0&&(r.current=window.setTimeout(()=>i(!1),e))},[e]),l,!0,!1),t}var Zs=e=>{var o1,R1,J,I1;let{children:t,clientHeight:i,scrollHeight:l,scrollWidth:r,update:s,draggable:a,className:o,preventDiagonalScrolling:n=!1,paddingBottom:C=0,paddingRight:c=0,rightElement:h,rightElementProps:g,kineticScrollPerfHack:m=!1,scrollRef:w,initialSize:L}=e,v=[],V=(o1=g==null?void 0:g.sticky)!=null?o1:!1,u=(R1=g==null?void 0:g.fill)!=null?R1:!1,d=V2.useRef(0),p=V2.useRef(0),Z=V2.useRef(null),R=typeof window=="undefined"?1:window.devicePixelRatio,x=V2.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),N=V2.useRef(null),E=DH(200),[S,k]=V2.useState(!0),b=V2.useRef(0);V2.useLayoutEffect(()=>{if(!S||E||x.current.lockDirection===void 0)return;let p1=Z.current;if(p1===null)return;let[e2,H1]=x.current.lockDirection;e2!==void 0?p1.scrollLeft=e2:H1!==void 0&&(p1.scrollTop=H1),x.current.lockDirection=void 0},[E,S]);let D=V2.useCallback((p1,e2)=>{var l2,q1,S1,$1;let H1=Z.current;if(H1===null)return;e2=e2!=null?e2:H1.scrollTop,p1=p1!=null?p1:H1.scrollLeft;let W1=x.current.scrollTop,E2=x.current.scrollLeft,Z2=p1-E2,u2=e2-W1;E&&Z2!==0&&u2!==0&&(Math.abs(Z2)>3||Math.abs(u2)>3)&&n&&x.current.lockDirection===void 0&&(x.current.lockDirection=Math.abs(Z2)0&&(Math.abs(a1)>2e3||i2===0||i2===T1)&&l>H1.scrollHeight+5){let U1=i2/T1,H2=(l-w2)*U1;d.current=H2-i2}y1!==void 0&&(window.clearTimeout(b.current),k(!1),b.current=window.setTimeout(()=>k(!0),200)),s({x:p1,y:i2+d.current,width:t2-c,height:w2-C,paddingRight:($1=(S1=N.current)==null?void 0:S1.clientWidth)!=null?$1:0})},[C,c,l,s,n,E]);fs(m&&i9.value,D,Z);let B=V2.useRef(D);B.current=D;let _=V2.useRef(),K=V2.useRef(!1);V2.useLayoutEffect(()=>{K.current?D():K.current=!0},[D,C,c]);let Q=V2.useCallback(p1=>{Z.current=p1,w!==void 0&&(w.current=p1)},[w]),m1=0,g1=0;for(v.push(V2.createElement("div",{key:m1++,style:{width:r,height:0}}));g1B.current(),0),_.current={width:G,height:s1}),(G!=null?G:0)===0||(s1!=null?s1:0)===0?V2.createElement("div",{ref:w1}):V2.createElement("div",{ref:w1},V2.createElement(PH,{isSafari:i9.value},V2.createElement("div",{className:"dvn-underlay"},t),V2.createElement("div",{ref:Q,style:_.current,draggable:a,onDragStart:p1=>{a||(p1.stopPropagation(),p1.preventDefault())},className:"dvn-scroller "+(o!=null?o:""),onScroll:()=>D()},V2.createElement("div",{className:"dvn-scroll-inner"+(h===void 0?" dvn-hidden":"")},V2.createElement("div",{className:"dvn-stack"},v),h!==void 0&&V2.createElement(V2.Fragment,null,!u&&V2.createElement("div",{className:"dvn-spacer"}),V2.createElement("div",{ref:N,style:{height:s1,maxHeight:i-Math.ceil(R%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:u?1:void 0,right:V?c!=null?c:0:void 0,pointerEvents:"auto"}},h))))))};var AH=e=>{let{columns:t,rows:i,rowHeight:l,headerHeight:r,groupHeaderHeight:s,enableGroups:a,freezeColumns:o,experimental:n,nonGrowWidth:C,clientSize:c,className:h,onVisibleRegionChanged:g,scrollRef:m,preventDiagonalScrolling:w,rightElement:L,rightElementProps:v,overscrollX:V,overscrollY:u,initialSize:d,smoothScrollX:p=!1,smoothScrollY:Z=!1,isDraggable:R}=e,{paddingRight:x,paddingBottom:N}=n!=null?n:{},[E,S]=c,k=W0.useRef(),b=W0.useRef(),D=W0.useRef(),B=W0.useRef(),_=C+Math.max(0,V!=null?V:0),K=a?r+s:r;if(typeof l=="number")K+=i*l;else for(let w1=0;w1{var E2,Z2,u2;if(Q.current===void 0)return;let w1=y({},Q.current),G=0,s1=w1.x<0?-w1.x:0,o1=0,R1=0;w1.x=w1.x<0?0:w1.x;let J=0;for(let y1=0;y1=t2+y1.width)G+=y1.width,R1++,o1++;else if(w1.x>t2)G+=y1.width,p?s1+=t2-w1.x:R1++,o1++;else if(w1.x+w1.width>t2)G+=y1.width,o1++;else break}let I1=0,p1=0,e2=0;if(typeof l=="number")Z?(p1=Math.floor(w1.y/l),I1=p1*l-w1.y):p1=Math.ceil(w1.y/l),e2=Math.ceil(w1.height/l)+p1,I1<0&&e2++;else{let y1=0;for(let t2=0;t2=y1+w2)y1+=w2,p1++,e2++;else if(w1.y>i2)y1+=w2,Z?I1+=i2-w1.y:p1++,e2++;else if(w1.y+w1.height>w2/2+y1)y1+=w2,e2++;else break}}let H1={x:R1,y:p1,width:o1-R1,height:e2-p1},W1=k.current;(W1===void 0||W1.y!==H1.y||W1.x!==H1.x||W1.height!==H1.height||W1.width!==H1.width||b.current!==s1||D.current!==I1||w1.width!==((E2=B.current)==null?void 0:E2[0])||w1.height!==((Z2=B.current)==null?void 0:Z2[1]))&&(g==null||g({x:R1,y:p1,width:o1-R1,height:e2-p1},w1.width,w1.height,(u2=w1.paddingRight)!=null?u2:0,s1,I1),k.current=H1,b.current=s1,D.current=I1,B.current=[w1.width,w1.height])},[t,l,i,g,o,p,Z]),g1=W0.useCallback(w1=>{Q.current=w1,m1()},[m1]);return W0.useEffect(()=>{m1()},[m1]),W0.createElement(Zs,{scrollRef:m,className:h,kineticScrollPerfHack:n==null?void 0:n.kineticScrollPerfHack,preventDiagonalScrolling:w,draggable:R===!0||typeof R=="string",scrollWidth:_+(x!=null?x:0),scrollHeight:K+(N!=null?N:0),clientHeight:S,rightElement:L,paddingBottom:N,paddingRight:x,rightElementProps:v,update:g1,initialSize:d},W0.createElement(Ms,{eventTargetRef:m,width:E,height:S,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY}))},Es=AH;var Ns=X2("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1});var IH=A1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},A1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),OH=A1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},A1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),_H=A1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},A1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),WH=10,qH=e=>{let{canvasRef:t,cellYOffset:i,rows:l,columns:r,searchInputRef:s,searchValue:a,searchResults:o,onSearchValueChange:n,getCellsForSelection:C,onSearchResultsChanged:c,showSearch:h=!1,onSearchClose:g}=e,[m]=A1.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[w,L]=A1.useState(""),v=a!=null?a:w,V=A1.useCallback(G=>{L(G),n==null||n(G)},[n]),[u,d]=A1.useState(),p=A1.useRef(u);p.current=u,A1.useEffect(()=>{o!==void 0&&(o.length>0?d(G=>{var s1;return{rowsSearched:l,results:o.length,selectedIndex:(s1=G==null?void 0:G.selectedIndex)!=null?s1:-1}}):d(void 0))},[l,o]);let Z=A1.useRef();Z.current===void 0&&(Z.current=new AbortController);let R=A1.useRef(),[x,N]=A1.useState([]),E=o!=null?o:x,S=A1.useCallback(()=>{R.current!==void 0&&(window.cancelAnimationFrame(R.current),R.current=void 0,Z.current.abort())},[]),k=A1.useRef(i);k.current=i;let b=A1.useCallback(G=>{let s1=new RegExp(G.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i"),o1=k.current,R1=Math.min(10,l),J=0;d(void 0),N([]);let I1=[],p1=async()=>{var i2,a1;if(C===void 0)return;let e2=performance.now(),H1=l-J,W1=C({x:0,y:o1,width:r.length,height:Math.min(R1,H1,l-o1)},Z.current.signal);typeof W1=="function"&&(W1=await W1());let E2=!1;for(let[T1,l2]of W1.entries())for(let[q1,S1]of l2.entries()){let $1;switch(S1.kind){case c1.Text:case c1.Number:$1=S1.displayData;break;case c1.Uri:case c1.Markdown:$1=S1.data;break;case c1.Boolean:$1=typeof S1.data=="boolean"?S1.data.toString():void 0;break;case c1.Image:case c1.Bubble:$1=S1.data.join("\u{1F433}");break;case c1.Custom:$1=S1.copyData;break}$1!==void 0&&s1.test($1)&&(I1.push([q1,T1+o1]),E2=!0)}let Z2=performance.now();E2&&N([...I1]),J+=W1.length,d0(J<=l);let u2=(a1=(i2=p.current)==null?void 0:i2.selectedIndex)!=null?a1:-1;d({results:I1.length,rowsSearched:J,selectedIndex:u2}),c==null||c(I1,u2),o1+R1>=l?o1=0:o1+=R1;let y1=Z2-e2,t2=Math.max(y1,1),w2=WH/t2;R1=Math.ceil(R1*w2),J{var G;g==null||g(),d(void 0),N([]),c==null||c([],-1),S(),(G=t==null?void 0:t.current)==null||G.focus()},[S,t,g,c]),B=A1.useCallback(G=>{V(G.target.value),o===void 0&&(G.target.value===""?(d(void 0),N([]),S()):b(G.target.value))},[b,S,V,o]);A1.useEffect(()=>{h&&s.current!==null&&(V(""),s.current.focus({preventScroll:!0}))},[h,s,V]);let _=A1.useCallback(G=>{var o1;if((o1=G==null?void 0:G.stopPropagation)==null||o1.call(G),u===void 0)return;let s1=(u.selectedIndex+1)%u.results;d(P(y({},u),{selectedIndex:s1})),c==null||c(E,s1)},[u,c,E]),K=A1.useCallback(G=>{var o1;if((o1=G==null?void 0:G.stopPropagation)==null||o1.call(G),u===void 0)return;let s1=(u.selectedIndex-1)%u.results;s1<0&&(s1+=u.results),d(P(y({},u),{selectedIndex:s1})),c==null||c(E,s1)},[c,E,u]),Q=A1.useCallback(G=>{(G.ctrlKey||G.metaKey)&&G.nativeEvent.code==="KeyF"||G.key==="Escape"?(D(),G.stopPropagation(),G.preventDefault()):G.key==="Enter"&&(G.shiftKey?K():_())},[D,_,K]);A1.useEffect(()=>()=>{S()},[S]);let[m1,g1]=A1.useState(!1);A1.useEffect(()=>{if(h)g1(!0);else{let G=setTimeout(()=>g1(!1),150);return()=>clearTimeout(G)}},[h]);let w1=A1.useMemo(()=>{var J,I1,p1;if(!h&&!m1)return null;let G;u!==void 0&&(G=u.results>=1e3?"over 1000":`${u.results} result${u.results!==1?"s":""}`,u.selectedIndex>=0&&(G=`${u.selectedIndex+1} of ${G}`));let s1=e2=>{e2.stopPropagation()},R1={width:`${Math.floor(((J=u==null?void 0:u.rowsSearched)!=null?J:0)/l*100)}%`};return A1.createElement(Ns,{className:h?"":"out",onMouseDown:s1,onMouseMove:s1,onMouseUp:s1,onClick:s1},A1.createElement("div",{className:"gdg-search-bar-inner"},A1.createElement("input",{id:m,"aria-hidden":!h,"data-testid":"search-input",ref:s,onChange:B,value:v,tabIndex:h?void 0:-1,onKeyDownCapture:Q}),A1.createElement("button",{"aria-label":"Previous Result","aria-hidden":!h,tabIndex:h?void 0:-1,onClick:K,disabled:((I1=u==null?void 0:u.results)!=null?I1:0)===0},IH),A1.createElement("button",{"aria-label":"Next Result","aria-hidden":!h,tabIndex:h?void 0:-1,onClick:_,disabled:((p1=u==null?void 0:u.results)!=null?p1:0)===0},OH),g!==void 0&&A1.createElement("button",{"aria-label":"Close Search","aria-hidden":!h,"data-testid":"search-close-button",tabIndex:h?void 0:-1,onClick:D},_H)),u!==void 0?A1.createElement(A1.Fragment,null,A1.createElement("div",{className:"gdg-search-status"},A1.createElement("div",{"data-testid":"search-result-area"},G)),A1.createElement("div",{className:"gdg-search-progress",style:R1})):A1.createElement("div",{className:"gdg-search-status"},A1.createElement("label",{htmlFor:m},"Type to search")))},[h,m1,u,l,m,s,B,v,Q,K,_,g,D]);return A1.createElement(A1.Fragment,null,A1.createElement(Es,{prelightCells:E,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY}),w1)},Rs=qH;var r3=F1(Y1(),1);var $H=()=>e=>Math.max(16,e.targetHeight-10),UH=X2("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[$H(),"px"]}}),Bs=e=>{let{bounds:t,group:i,onClose:l,canvasBounds:r,onFinish:s}=e,[a,o]=r3.default.useState(i);return r3.default.createElement(Q6,{style:{position:"absolute",left:t.x-r.left+1,top:t.y-r.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:l},r3.default.createElement(UH,{targetHeight:t.height,"data-testid":"group-rename-input",value:a,onBlur:l,onFocus:n=>n.target.setSelectionRange(0,a.length),onChange:n=>o(n.target.value),onKeyDown:n=>{n.key==="Enter"?s(a):n.key==="Escape"&&l()},autoFocus:!0}))};function GH(e,t){return e===void 0?!1:e.length>1&&e.startsWith("_")?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function o2(e,t,i){let l=zs(e,t);return l&&(i.didMatch=!0),l}function zs(e,t){if(e.length===0)return!1;if(e.includes("|")){let n=e.split("|");for(let C of n)if(zs(C,t))return!0;return!1}let i=!1,l=!1,r=!1,s=!1,a=e.split("+"),o=a.pop();if(!GH(o,t))return!1;if(a[0]==="any")return!0;for(let n of a)switch(n){case"ctrl":i=!0;break;case"shift":l=!0;break;case"alt":r=!0;break;case"meta":s=!0;break;case"primary":V5.value?s=!0:i=!0;break}return t.altKey===r&&t.ctrlKey===i&&t.shiftKey===l&&t.metaKey===s}var s3=F1(Y1(),1);function ys(e,t,i,l,r,s){let a=s3.default.useCallback((C,c,h,g)=>{var u,d;(s==="cell"||s==="multi-cell")&&C!==void 0&&(C=P(y({},C),{range:{x:C.cell[0],y:C.cell[1],width:1,height:1}}));let m=i==="mixed"&&(h||g==="drag"),w=l==="mixed"&&m,L=r==="mixed"&&m,v={current:C===void 0?void 0:P(y({},C),{rangeStack:g==="drag"?(d=(u=e.current)==null?void 0:u.rangeStack)!=null?d:[]:[]}),columns:w?e.columns:x2.empty(),rows:L?e.rows:x2.empty()};h&&(s==="multi-rect"||s==="multi-cell")&&v.current!==void 0&&e.current!==void 0&&(v=P(y({},v),{current:P(y({},v.current),{rangeStack:[...e.current.rangeStack,e.current.range]})})),t(v,c)},[l,e,i,s,r,t]),o=s3.default.useCallback((C,c,h)=>{C=C!=null?C:e.rows,c!==void 0&&(C=C.add(c));let g;if(r==="exclusive"&&C.length>0)g={current:void 0,columns:x2.empty(),rows:C};else{let m=h&&i==="mixed",w=h&&l==="mixed";g={current:m?e.current:void 0,columns:w?e.columns:x2.empty(),rows:C}}t(g,!1)},[l,e,i,r,t]),n=s3.default.useCallback((C,c,h)=>{C=C!=null?C:e.columns,c!==void 0&&(C=C.add(c));let g;if(l==="exclusive"&&C.length>0)g={current:void 0,rows:x2.empty(),columns:C};else{let m=h&&i==="mixed",w=h&&r==="mixed";g={current:m?e.current:void 0,rows:w?e.rows:x2.empty(),columns:C}}t(g,!1)},[l,e,i,r,t]);return[a,o,n]}var $8=F1(Y1(),1);function bs(e,t,i,l,r){let s=$8.useCallback(C=>{var c;if(e===!0){let h=[];for(let g=C.y;g=r?m.push({kind:c1.Loading,allowOverlay:!1}):m.push(t([w,g]));h.push(m)}return h}return(c=e==null?void 0:e(C,l.signal))!=null?c:[]},[l.signal,t,e,r]),a=e!==void 0?s:void 0,o=$8.useCallback(C=>{if(a===void 0)return[];let c=P(y({},C),{x:C.x-i});if(c.x<0){c.x=0,c.width--;let h=a(c,l.signal);return typeof h=="function"?async()=>(await h()).map(g=>[{kind:c1.Loading,allowOverlay:!1},...g]):h.map(g=>[{kind:c1.Loading,allowOverlay:!1},...g])}return a(c,l.signal)},[l.signal,a,i]);return[e!==void 0?o:void 0,a]}function KH(e){var t,i;if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string"};switch(e.kind){case c1.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===_5?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case c1.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case c1.Image:case c1.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case c1.Drilldown:return{formatted:e.data.map(l=>l.text),rawValue:e.data.map(l=>l.text),format:"string-array"};case c1.Text:return{formatted:(t=e.displayData)!=null?t:e.data,rawValue:e.data,format:"string"};case c1.Uri:return{formatted:(i=e.displayData)!=null?i:e.data,rawValue:e.data,format:"url"};case c1.Markdown:case c1.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case c1.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case c1.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case c1.Protected:return{formatted:"************",rawValue:"",format:"string"};default:l5(e)}}function XH(e,t){return e.map((l,r)=>{let s=t[r];return l.map(a=>a.span!==void 0&&a.span[0]!==s?{formatted:"",rawValue:"",format:"string"}:KH(a))})}function Fs(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function jH(e){var i,l;let t=[];for(let r of e){let s=[];for(let a of r)a.format==="url"?s.push((l=(i=a.rawValue)==null?void 0:i.toString())!=null?l:""):a.format==="string-array"?s.push(a.formatted.map(o=>Fs(o,!0)).join(",")):s.push(Fs(a.formatted,!1));t.push(s.join(" "))}return t.join(` `)}function U8(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>" ".repeat(t.length))}function Ss(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(//g,">")+'"'}function YH(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function QH(e){var i,l;let t=[];t.push('',"");for(let r of e){t.push("");for(let s of r){let a=`gdg-format="${s.format}"`;s.format==="url"?t.push(``):s.format==="string-array"?t.push(``):t.push(``)}t.push("")}return t.push("
${U8(s.formatted)}
    ${s.formatted.map((o,n)=>`
  1. `+U8(o)+"
  2. ").join("")}
${U8(s.formatted)}
"),t.join("")}function ks(e,t){let i=XH(e,t),l=jH(i),r=QH(i);return{textPlain:l,textHtml:r}}function G8(e){var a,o,n,C,c,h;let t=document.createElement("html");t.innerHTML=e.replace(/ /g," ");let i=t.querySelector("table");if(i===null)return;let l=[i],r=[],s;for(;l.length>0;){let g=l.pop();if(g===void 0)break;if(g instanceof HTMLTableElement||g.nodeName==="TBODY")l.push(...[...g.children].reverse());else if(g instanceof HTMLTableRowElement)s!==void 0&&r.push(s),s=[],l.push(...[...g.children].reverse());else if(g instanceof HTMLTableCellElement){let m=g.cloneNode(!0),L=m.children.length===1&&m.children[0].nodeName==="P"?m.children[0]:null,v=(L==null?void 0:L.children.length)===1&&L.children[0].nodeName==="FONT",V=m.querySelectorAll("br");for(let p of V)p.replaceWith(` `);let u=m.getAttribute("gdg-raw-value"),d=(a=m.getAttribute("gdg-format"))!=null?a:"string";if(m.querySelector("a")!==null)s==null||s.push({rawValue:(n=(o=m.querySelector("a"))==null?void 0:o.getAttribute("href"))!=null?n:"",formatted:(C=m.textContent)!=null?C:"",format:d});else if(m.querySelector("ol")!==null){let p=m.querySelectorAll("li");s==null||s.push({rawValue:[...p].map(Z=>{var R;return(R=Z.getAttribute("gdg-raw-value"))!=null?R:""}),formatted:[...p].map(Z=>{var R;return(R=Z.textContent)!=null?R:""}),format:"string-array"})}else if(u!==null)s==null||s.push({rawValue:YH(u),formatted:(c=m.textContent)!=null?c:"",format:d});else{let p=(h=m.textContent)!=null?h:"";v&&(p=p.replace(/\n(?!\n)/g,"")),s==null||s.push({rawValue:p!=null?p:"",formatted:p!=null?p:"",format:d})}}}return s!==void 0&&r.push(s),r}function Ps(e,t,i,l,r){var o,n;let s=e;if(l==="allowPartial"||e.current===void 0||t===void 0)return e;let a=!1;do{if((e==null?void 0:e.current)===void 0)break;let C=(o=e.current)==null?void 0:o.range,c=[];if(C.width>2){let m=t({x:C.x,y:C.y,width:1,height:C.height},r.signal);if(typeof m=="function")return s;c.push(...m);let w=t({x:C.x+C.width-1,y:C.y,width:1,height:C.height},r.signal);if(typeof w=="function")return s;c.push(...w)}else{let m=t({x:C.x,y:C.y,width:C.width,height:C.height},r.signal);if(typeof m=="function")return s;c.push(...m)}let h=C.x-i,g=C.x+C.width-1-i;for(let m of c)for(let w of m)w.span!==void 0&&(h=Math.min(w.span[0],h),g=Math.max(w.span[1],g));h===C.x-i&&g===C.x+C.width-1-i?a=!0:e={current:{cell:(n=e.current.cell)!=null?n:[0,0],range:{x:h+i,y:C.y,width:g-h+1,height:C.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!a);return e}function Ts(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function Ds(e){let t;(function(o){o[o.None=0]="None",o[o.inString=1]="inString",o[o.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));let i=[],l=[],r=0,s=t.None;e=e.replace(/\r\n/g,` `);let a=0;for(let o of e){switch(s){case t.None:o===" "||o===` `?(l.push(e.slice(r,a)),r=a+1,o===` `&&(i.push(l),l=[])):o==='"'&&(s=t.inString);break;case t.inString:o==='"'&&(s=t.inStringPostQuote);break;case t.inStringPostQuote:o==='"'?s=t.inString:((o===" "||o===` `)&&(l.push(Ts(e.slice(r,a))),r=a+1,o===` -`&&(i.push(l),l=[])),s=t.None);break}a++}return ro.map(n=>({rawValue:n,formatted:n,format:"string"})))}function K8(e,t,i){var o;let l=ks(e,t),r=n=>{var C;(C=window.navigator.clipboard)==null||C.writeText(n)},s=(n,C)=>{var c;return((c=window.navigator.clipboard)==null?void 0:c.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([n],{type:"text/plain"}),"text/html":new Blob([C],{type:"text/html"})})]),!0)},a=(n,C)=>{var c,h;try{if(i===void 0||i.clipboardData===null)throw new Error("No clipboard data");(c=i==null?void 0:i.clipboardData)==null||c.setData("text/plain",n),(h=i==null?void 0:i.clipboardData)==null||h.setData("text/html",C)}catch(g){s(n,C)||r(n)}};((o=window.navigator.clipboard)==null?void 0:o.write)!==void 0||(i==null?void 0:i.clipboardData)!==void 0?a(l.textPlain,l.textHtml):r(l.textPlain),i==null||i.preventDefault()}function a3(e){return e!==!0}var Is=F1(Y1(),1);function As(e){return typeof e=="string"?e:`${e}px`}var JH=()=>e=>e.innerWidth,eL=()=>e=>e.innerHeight,tL=X2("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[JH()],"wmyidgi-1":[eL()]}}),Os=e=>{let s=e,{inWidth:t,inHeight:i,children:l}=s,r=o0(s,["inWidth","inHeight","children"]);return Is.createElement(tL,y({innerHeight:As(i),innerWidth:As(t)},r),l)};var X8=F1(Y1(),1),iL=2,lL=1300;function _s(e,t,i){let l=X8.default.useRef(0),[r,s]=e!=null?e:[0,0];X8.default.useEffect(()=>{if(r===0&&s===0){l.current=0;return}let a=!1,o=0,n=C=>{var c;if(!a){if(o===0)o=C;else{let h=C-o;l.current=Math.min(1,l.current+h/lL);let g=l.current**1.618*h*iL;(c=t.current)==null||c.scrollBy(r*g,s*g),o=C,i==null||i()}window.requestAnimationFrame(n)}};return window.requestAnimationFrame(n),()=>{a=!0}},[t,r,s,i])}var Ws=F1(Y1(),1);function qs({rowHeight:e,headerHeight:t,groupHeaderHeight:i,theme:l,overscrollX:r,overscrollY:s,scaleToRem:a,remSize:o}){let[n,C,c,h,g,m]=Ws.default.useMemo(()=>{var V,u,d;if(!a||o===16)return[e,t,i,l,r,s];let w=o/16,L=e,v=C7();return[typeof L=="number"?L*w:p=>Math.ceil(L(p)*w),Math.ceil(t*w),Math.ceil(i*w),P(y({},l),{headerIconSize:((V=l==null?void 0:l.headerIconSize)!=null?V:v.headerIconSize)*w,cellHorizontalPadding:((u=l==null?void 0:l.cellHorizontalPadding)!=null?u:v.cellHorizontalPadding)*w,cellVerticalPadding:((d=l==null?void 0:l.cellVerticalPadding)!=null?d:v.cellVerticalPadding)*w}),Math.ceil((r!=null?r:0)*w),Math.ceil((s!=null?s:0)*w)]},[i,t,r,s,o,e,a,l]);return{rowHeight:n,headerHeight:C,groupHeaderHeight:c,theme:h,overscrollX:g,overscrollY:m}}var Us=F1(Y1(),1);var X4={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 n2(e,t){return e===!0?t:e===!1?"":e}function $s(e){let t=V5.value;return{activateCell:n2(e.activateCell," |Enter|shift+Enter"),clear:n2(e.clear,"any+Escape"),closeOverlay:n2(e.closeOverlay,"any+Escape"),acceptOverlayDown:n2(e.acceptOverlayDown,"Enter"),acceptOverlayUp:n2(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:n2(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:n2(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:n2(e.delete,t?"Backspace|Delete":"Delete"),downFill:n2(e.downFill,"primary+_68"),scrollToSelectedCell:n2(e.scrollToSelectedCell,"primary+Enter"),goDownCell:n2(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:n2(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:n2(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:n2(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:n2(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:n2(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:n2(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:n2(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:n2(e.goToFirstCell,"primary+Home"),goToFirstColumn:n2(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:n2(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:n2(e.goToLastCell,"primary+End"),goToLastColumn:n2(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:n2(e.goToLastRow,"primary+ArrowDown"),goToNextPage:n2(e.goToNextPage,"PageDown"),goToPreviousPage:n2(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:n2(e.rightFill,"primary+_82"),search:n2(e.search,"primary+f"),selectAll:n2(e.selectAll,"primary+a"),selectColumn:n2(e.selectColumn,"ctrl+ "),selectGrowDown:n2(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:n2(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:n2(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:n2(e.selectGrowUp,"shift+ArrowUp"),selectRow:n2(e.selectRow,"shift+ "),selectToFirstCell:n2(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:n2(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:n2(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:n2(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:n2(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:n2(e.selectToLastRow,"primary+shift+ArrowDown")}}function Gs(e){let t=_e(e);return Us.default.useMemo(()=>{var l,r,s,a,o,n,C,c,h,g,m,w;if(t===void 0)return $s(X4);let i=P(y({},t),{goToNextPage:(r=(l=t==null?void 0:t.goToNextPage)!=null?l:t==null?void 0:t.pageDown)!=null?r:X4.goToNextPage,goToPreviousPage:(a=(s=t==null?void 0:t.goToPreviousPage)!=null?s:t==null?void 0:t.pageUp)!=null?a:X4.goToPreviousPage,goToFirstCell:(n=(o=t==null?void 0:t.goToFirstCell)!=null?o:t==null?void 0:t.first)!=null?n:X4.goToFirstCell,goToLastCell:(c=(C=t==null?void 0:t.goToLastCell)!=null?C:t==null?void 0:t.last)!=null?c:X4.goToLastCell,selectToFirstCell:(g=(h=t==null?void 0:t.selectToFirstCell)!=null?h:t==null?void 0:t.first)!=null?g:X4.selectToFirstCell,selectToLastCell:(w=(m=t==null?void 0:t.selectToLastCell)!=null?m:t==null?void 0:t.last)!=null?w:X4.selectToLastCell});return $s(y(y({},X4),i))},[t])}var rL=O.lazy(async()=>await import("./data-grid-overlay-editor-LA45TJRM.js")),sL=0;function aL(e){return(0,Ks.default)((0,Y8.default)((0,Y8.default)(e).filter(t=>t.span!==void 0).map(t=>{var i,l,r,s;return(0,p5.default)(((l=(i=t.span)==null?void 0:i[0])!=null?l:0)+1,((s=(r=t.span)==null?void 0:r[1])!=null?s:0)+1)})))}function o3(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:P(y({},e.current.range),{x:e.current.range.x+t}),rangeStack:e.current.rangeStack.map(i=>P(y({},i),{x:i.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}var j8={kind:c1.Loading,allowOverlay:!1},n3={columns:x2.empty(),rows:x2.empty(),current:void 0},oL=(e,t)=>{var f6,Z6,E6,N6,R6,B6,z6,y6,b6,F6,S6,k6,T6;let[i,l]=O.useState(n3),[r,s]=O.useState(),a=O.useRef(null),o=O.useRef(null),[n,C]=O.useState(),c=O.useRef(null),h=O.useRef(),g=typeof window=="undefined"?null:window,{imageEditorOverride:m,getRowThemeOverride:w,markdownDivCreateNode:L,width:v,height:V,columns:u,rows:d,getCellContent:p,onCellClicked:Z,onCellActivated:R,onFillPattern:x,onFinishedEditing:N,coercePasteValue:E,drawHeader:S,drawCell:k,editorBloom:b,onHeaderClicked:D,onColumnProposeMove:B,spanRangeBehavior:_="default",onGroupHeaderClicked:K,onCellContextMenu:Q,className:m1,onHeaderContextMenu:g1,getCellsForSelection:w1,onGroupHeaderContextMenu:G,onGroupHeaderRenamed:s1,onCellEdited:o1,onCellsEdited:R1,onSearchResultsChanged:J,searchResults:I1,onSearchValueChange:p1,searchValue:e2,onKeyDown:H1,onKeyUp:W1,keybindings:E2,editOnType:Z2=!0,onRowAppended:u2,onColumnMoved:y1,validateCell:t2,highlightRegions:w2,rangeSelect:i2="rect",columnSelect:a1="multi",rowSelect:T1="multi",rangeSelectionBlending:l2="exclusive",columnSelectionBlending:q1="exclusive",rowSelectionBlending:S1="exclusive",onDelete:$1,onDragStart:U1,onMouseMove:H2,onPaste:t1,copyHeaders:V1=!1,freezeColumns:f1=0,cellActivationBehavior:b1="second-click",rowSelectionMode:z2="auto",onHeaderMenuClick:n1,getGroupDetails:L1,onSearchClose:l1,onItemHovered:M1,onSelectionCleared:Z1,showSearch:R2,onVisibleRegionChanged:Q2,gridSelection:e0,onGridSelectionChange:t0,minColumnWidth:c0=50,maxColumnWidth:Y2=500,maxColumnAutoWidth:J2,provideEditor:k0,trailingRowOptions:C2,freezeTrailingRows:m2=0,allowedFillDirections:L2="orthogonal",scrollOffsetX:A2,scrollOffsetY:y2,verticalBorder:F2,onDragOverCell:Z0,onDrop:o4,onColumnResize:T0,onColumnResizeEnd:m0,onColumnResizeStart:B1,customRenderers:S2,fillHandle:X1,drawFocusRing:N2=!0,experimental:j1,fixedShadowX:Q0,fixedShadowY:v4,headerIcons:P0,imageWindowLoader:q0,initialSize:z4,isDraggable:K9,onDragLeave:X9,onRowMoved:p4,overscrollX:f5,overscrollY:Z5,preventDiagonalScrolling:E5,rightElement:j4,rightElementProps:T4,trapFocus:j9=!1,smoothScrollX:Y9,smoothScrollY:w3,scaleToRem:g3=!1,rowHeight:N5=34,headerHeight:y4=36,groupHeaderHeight:H3=y4,theme:L3,isOutsideClick:Q9,renderers:R5}=e,s0=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,$0=(Z6=(f6=s0==null?void 0:s0.kind)!=null?f6:e.rowMarkers)!=null?Z6:"none",B5=(E6=s0==null?void 0:s0.width)!=null?E6:e.rowMarkerWidth,z5=(R6=(N6=s0==null?void 0:s0.startIndex)!=null?N6:e.rowMarkerStartIndex)!=null?R6:1,o9=(B6=s0==null?void 0:s0.theme)!=null?B6:e.rowMarkerTheme,P4=(z6=s0==null?void 0:s0.checkboxStyle)!=null?z6:"square",U0=Math.max(c0,20),n4=Math.max(Y2,U0),n9=Math.max(J2!=null?J2:n4,U0),D4=O.useMemo(()=>typeof window=="undefined"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),C9=O.useMemo(()=>Number.parseFloat(D4.fontSize),[D4]),{rowHeight:B0,headerHeight:y5,groupHeaderHeight:c9,theme:J9,overscrollX:V3,overscrollY:e7}=qs({groupHeaderHeight:H3,headerHeight:y4,overscrollX:f5,overscrollY:Z5,remSize:C9,rowHeight:N5,scaleToRem:g3,theme:L3}),C4=Gs(E2),b4=B5!=null?B5:d>1e4?48:d>1e3?44:d>100?36:32,G0=$0!=="none",A=G0?1:0,W2=u2!==void 0,Y4=(C2==null?void 0:C2.sticky)===!0,[d3,t7]=O.useState(!1),m9=R2!=null?R2:d3,u3=O.useCallback(()=>{l1!==void 0?l1():t7(!1)},[l1]),h9=O.useMemo(()=>e0===void 0?void 0:o3(e0,A),[e0,A]),W=h9!=null?h9:i,E0=O.useRef();E0.current===void 0&&(E0.current=new AbortController),O.useEffect(()=>()=>E0==null?void 0:E0.current.abort(),[]);let[a0,b5]=bs(w1,p,A,E0.current,d),w9=O.useCallback((H,f,M)=>{if(t2===void 0)return!0;let F=[H[0]-A,H[1]];return t2==null?void 0:t2(F,f,M)},[A,t2]),A4=O.useRef(e0),D0=O.useCallback((H,f)=>{f&&(H=Ps(H,a0,A,_,E0.current)),t0!==void 0?(A4.current=o3(H,-A),t0(A4.current)):l(H)},[t0,a0,A,_]),c4=m5(T0,O.useCallback((H,f,M,F)=>{T0==null||T0(u[M-A],f,M-A,F)},[T0,A,u])),v3=m5(m0,O.useCallback((H,f,M,F)=>{m0==null||m0(u[M-A],f,M-A,F)},[m0,A,u])),F5=m5(B1,O.useCallback((H,f,M,F)=>{B1==null||B1(u[M-A],f,M-A,F)},[B1,A,u])),p3=m5(S,O.useCallback((H,f)=>{var M;return(M=S==null?void 0:S(P(y({},H),{columnIndex:H.columnIndex-A}),f))!=null?M:!1},[S,A])),M3=m5(k,O.useCallback((H,f)=>{var M;return(M=k==null?void 0:k(P(y({},H),{col:H.col-A}),f))!=null?M:!1},[k,A])),m4=O.useCallback(H=>{if($1!==void 0){let f=$1(o3(H,-A));return typeof f=="boolean"?f:o3(f,A)}return!0},[$1,A]),[g0,H0,i0]=ys(W,D0,l2,q1,S1,i2),h0=O.useMemo(()=>r4(C7(),J9),[J9]),[S5,i7]=O.useState([0,0,0]),g9=O.useMemo(()=>{if(R5===void 0)return{};let H={};for(let f of R5)H[f.kind]=f;return H},[R5]),L0=O.useCallback(H=>H.kind!==c1.Custom?g9[H.kind]:S2==null?void 0:S2.find(f=>f.isMatch(H)),[S2,g9]),{sizedColumns:N0,nonGrowWidth:z}=ft(u,d,b5,S5[0]-(A===0?0:b4)-S5[2],U0,n9,h0,L0,E0.current);$0!=="none"&&(z+=b4);let j=O.useMemo(()=>N0.some(H=>H.group!==void 0),[N0]),x1=j?y5+c9:y5,v1=W.rows.length,C1=$0==="none"?void 0:v1===0?!1:v1===d?!0:void 0,Y=O.useMemo(()=>$0==="none"?N0:[{title:"",width:b4,icon:void 0,hasMenu:!1,style:"normal",themeOverride:o9,rowMarker:P4,rowMarkerChecked:C1},...N0],[$0,N0,b4,o9,P4,C1]),[_1,K1]=O.useMemo(()=>[y2!==void 0&&typeof B0=="number"?Math.floor(y2/B0):0,y2!==void 0&&typeof B0=="number"?-(y2%B0):0],[y2,B0]),h1=O.useRef({height:1,width:1,x:0,y:0}),q2=O.useMemo(()=>{var H,f;return{x:h1.current.x,y:_1,width:(H=h1.current.width)!=null?H:1,height:(f=h1.current.height)!=null?f:1,ty:K1}},[K1,_1]),r2=O.useRef(!1),[G1,d2,Q1]=Oe(q2);h1.current=G1;let k2=((y6=G1.height)!=null?y6:1)>1;O.useLayoutEffect(()=>{if(y2!==void 0&&c.current!==null&&k2){if(c.current.scrollTop===y2)return;c.current.scrollTop=y2,c.current.scrollTop!==y2&&Q1(),r2.current=!0}},[y2,k2,Q1]);let l0=((b6=G1.width)!=null?b6:1)>1;O.useLayoutEffect(()=>{if(A2!==void 0&&c.current!==null&&l0){if(c.current.scrollLeft===A2)return;c.current.scrollLeft=A2,c.current.scrollLeft!==A2&&Q1(),r2.current=!0}},[A2,l0,Q1]);let K0=G1.x+A,$2=G1.y,U2=O.useRef(null),I2=O.useCallback(H=>{var f;H===!0?(f=U2.current)==null||f.focus():window.requestAnimationFrame(()=>{var M;(M=U2.current)==null||M.focus()})},[]),O2=W2?d+1:d,V0=O.useCallback(H=>{let f=A===0?H:H.map(F=>P(y({},F),{location:[F.location[0]-A,F.location[1]]})),M=R1==null?void 0:R1(f);if(M!==!0)for(let F of f)o1==null||o1(F.location,F.value);return M},[o1,R1,A]),[v2,J0]=O.useState(),M0=W.current!==void 0&&W.current.range.width*W.current.range.height>1?W.current.range:void 0,e4=N2?(F6=W.current)==null?void 0:F6.cell:void 0,X0=e4==null?void 0:e4[0],I4=e4==null?void 0:e4[1],Q4=O.useMemo(()=>{var f,M;if((w2===void 0||w2.length===0)&&((M=(f=M0!=null?M0:X0)!=null?f:I4)!=null?M:v2)===void 0)return;let H=[];if(w2!==void 0)for(let F of w2){let T=Y.length-F.range.x-A;T>0&&H.push({color:F.color,range:P(y({},F.range),{x:F.range.x+A,width:Math.min(T,F.range.width)}),style:F.style})}return v2!==void 0&&H.push({color:z0(h0.accentColor,0),range:v2,style:"dashed"}),M0!==void 0&&H.push({color:z0(h0.accentColor,.5),range:M0,style:"solid-outline"}),X0!==void 0&&I4!==void 0&&H.push({color:h0.accentColor,range:{x:X0,y:I4,width:1,height:1},style:"solid-outline"}),H.length>0?H:void 0},[v2,M0,X0,I4,w2,Y.length,h0.accentColor,A]),m6=O.useRef(Y);m6.current=Y;let j0=O.useCallback(([H,f],M=!1)=>{var q,I,$,X,r1,d1,z1,P1,E1,k1;let F=W2&&f===O2-1;if(H===0&&G0)return F?j8:{kind:l4.Marker,allowOverlay:!1,checkboxStyle:P4,checked:(W==null?void 0:W.rows.hasIndex(f))===!0,markerKind:$0==="clickable-number"?"number":$0,row:z5+f,drawHandle:p4!==void 0,cursor:$0==="clickable-number"?"pointer":void 0};if(F){let p2=H===A&&(q=C2==null?void 0:C2.hint)!=null?q:"",N1=m6.current[H];if(((I=N1==null?void 0:N1.trailingRowOptions)==null?void 0:I.disabled)===!0)return j8;{let a2=(X=($=N1==null?void 0:N1.trailingRowOptions)==null?void 0:$.hint)!=null?X:p2,M2=(d1=(r1=N1==null?void 0:N1.trailingRowOptions)==null?void 0:r1.addIcon)!=null?d1:C2==null?void 0:C2.addIcon;return{kind:l4.NewRow,hint:a2,allowOverlay:!1,icon:M2}}}else{let s2=H-A;if(M||(j1==null?void 0:j1.strict)===!0){let N1=h1.current,a2=N1.x>s2||s2>N1.x+N1.width||N1.y>f||f>N1.y+N1.height||f>=f3.current,M2=s2===((P1=(z1=N1.extras)==null?void 0:z1.selected)==null?void 0:P1[0])&&f===((E1=N1.extras)==null?void 0:E1.selected[1]),T2=!1;if(((k1=N1.extras)==null?void 0:k1.freezeRegions)!==void 0){for(let G2 of N1.extras.freezeRegions)if(G4(G2,s2,f)){T2=!0;break}}if(a2&&!M2&&!T2)return j8}let p2=p([s2,f]);return A!==0&&p2.span!==void 0&&(p2=P(y({},p2),{span:[p2.span[0]+A,p2.span[1]+A]})),p2}},[W2,O2,G0,P4,W==null?void 0:W.rows,$0,z5,p4,A,C2==null?void 0:C2.hint,C2==null?void 0:C2.addIcon,j1==null?void 0:j1.strict,p]),x3=O.useCallback(H=>{var M,F;let f=(M=L1==null?void 0:L1(H))!=null?M:{name:H};return s1!==void 0&&H!==""&&(f={icon:f.icon,name:f.name,overrideTheme:f.overrideTheme,actions:[...(F=f.actions)!=null?F:[],{title:"Rename",icon:"renameIcon",onClick:T=>E3({group:f.name,bounds:T.bounds})}]}),f},[L1,s1]),l7=O.useCallback(H=>{var $;let[f,M]=H.cell,F=Y[f],T=(F==null?void 0:F.group)!==void 0?($=x3(F.group))==null?void 0:$.overrideTheme:void 0,q=F==null?void 0:F.themeOverride,I=w==null?void 0:w(M);s(P(y({},H),{theme:r4(h0,T,q,I,H.content.themeOverride)}))},[w,Y,x3,h0]),k5=O.useCallback((H,f,M)=>{var I;if(W.current===void 0)return;let[F,T]=W.current.cell,q=j0([F,T]);if(q.kind!==c1.Boolean&&q.allowOverlay){let $=q;if(M!==void 0)switch($.kind){case c1.Number:{let X=D6(()=>M==="-"?-0:Number.parseFloat(M),0);$=P(y({},$),{data:Number.isNaN(X)?0:X});break}case c1.Text:case c1.Markdown:case c1.Uri:$=P(y({},$),{data:M});break}l7({target:H,content:$,initialValue:M,cell:[F,T],highlight:M===void 0,forceEditMode:M!==void 0})}else q.kind===c1.Boolean&&f&&q.readonly!==!0&&(V0([{location:W.current.cell,value:P(y({},q),{data:a3(q.data)})}]),(I=U2.current)==null||I.damage([{cell:W.current.cell}]))},[j0,W,V0,l7]),h6=O.useCallback((H,f)=>{var T;let M=(T=U2.current)==null?void 0:T.getBounds(H,f);if(M===void 0||c.current===null)return;let F=j0([H,f]);F.allowOverlay&&l7({target:M,content:F,initialValue:void 0,highlight:!0,cell:[H,f],forceEditMode:!0})},[j0,l7]),r0=O.useCallback((H,f,M="both",F=0,T=0,q=void 0)=>{var I;if(c.current!==null){let $=U2.current,X=o.current,r1=typeof H!="number"?H.unit==="cell"?H.amount:void 0:H,d1=typeof f!="number"?f.unit==="cell"?f.amount:void 0:f,z1=typeof H!="number"&&H.unit==="px"?H.amount:void 0,P1=typeof f!="number"&&f.unit==="px"?f.amount:void 0;if($!==null&&X!==null){let E1={x:0,y:0,width:0,height:0},k1=0,s2=0;if((r1!==void 0||d1!==void 0)&&(E1=(I=$.getBounds((r1!=null?r1:0)+A,d1!=null?d1:0))!=null?I:E1,E1.width===0||E1.height===0))return;let p2=X.getBoundingClientRect(),N1=p2.width/X.offsetWidth;if(z1!==void 0&&(E1=P(y({},E1),{x:z1-p2.left-c.current.scrollLeft,width:1})),P1!==void 0&&(E1=P(y({},E1),{y:P1+p2.top-c.current.scrollTop,height:1})),E1!==void 0){let a2={x:E1.x-F,y:E1.y-T,width:E1.width+2*F,height:E1.height+2*T},M2=0;for(let b3=0;b30&&(T2=a4(O2,G2,B0));let f2=M2*N1+p2.left+A*b4*N1,K2=p2.right,w4=p2.top+x1*N1,M4=p2.bottom-T2*N1,t5=E1.width+F*2;switch(q==null?void 0:q.hAlign){case"start":K2=f2+t5;break;case"end":f2=K2-t5;break;case"center":f2=Math.floor((f2+K2)/2)-t5/2,K2=f2+t5;break}let i5=E1.height+T*2;switch(q==null?void 0:q.vAlign){case"start":M4=w4+i5;break;case"end":w4=M4-i5;break;case"center":w4=Math.floor((w4+M4)/2)-i5/2,M4=w4+i5;break}f2>a2.x?k1=a2.x-f2:K2a2.y?s2=a2.y-w4:M4=O2-G2)&&(s2=0),(k1!==0||s2!==0)&&(N1!==1&&(k1/=N1,s2/=N1),c.current.scrollTo(k1+c.current.scrollLeft,s2+c.current.scrollTop))}}}},[A,m2,b4,x1,f1,N0,O2,Y4,B0]),w6=O.useRef(h6),g6=O.useRef(p),f3=O.useRef(d);w6.current=h6,g6.current=p,f3.current=d;let T5=O.useCallback(async(H,f=!0)=>{var X;let M=Y[H];if(((X=M==null?void 0:M.trailingRowOptions)==null?void 0:X.disabled)===!0)return;let F=u2==null?void 0:u2(),T,q=!0;F!==void 0&&(T=await F,T==="top"&&(q=!1),typeof T=="number"&&(q=!1));let I=0,$=()=>{if(f3.current<=d){I<500&&window.setTimeout($,I),I=50+I*2;return}let r1=typeof T=="number"?T:q?d:0;n7.current(H-A,r1),g0({cell:[H,r1],range:{x:H,y:r1,width:1,height:1}},!1,!1,"edit");let d1=g6.current([H-A,r1]);d1.allowOverlay&&o5(d1)&&d1.readonly!==!0&&f&&window.setTimeout(()=>{w6.current(H,r1)},0)};$()},[Y,u2,A,d,g0]),r7=O.useCallback(H=>{var M,F,T;let f=(T=(F=(M=N0[H])==null?void 0:M.trailingRowOptions)==null?void 0:F.targetColumn)!=null?T:C2==null?void 0:C2.targetColumn;if(typeof f=="number")return f+(G0?1:0);if(typeof f=="object"){let q=u.indexOf(f);if(q>=0)return q+(G0?1:0)}},[N0,u,G0,C2==null?void 0:C2.targetColumn]),O4=O.useRef(),P5=O.useRef(),H9=O.useCallback((H,f)=>{var T;let[M,F]=f;return r4(h0,(T=Y[M])==null?void 0:T.themeOverride,w==null?void 0:w(F),H.themeOverride)},[w,Y,h0]),L9=O.useCallback(H=>{var d1,z1,P1,E1;let f=V5.value?H.metaKey:H.ctrlKey,M=f&&T1==="multi",F=f&&a1==="multi",[T,q]=H.location,I=W.columns,$=W.rows,[X,r1]=(z1=(d1=W.current)==null?void 0:d1.cell)!=null?z1:[];if(H.kind==="cell"){if(P5.current=void 0,J4.current=[T,q],T===0&&G0){if(W2===!0&&q===d||$0==="number"||T1==="none")return;let k1=j0(H.location);if(k1.kind!==l4.Marker)return;if(p4!==void 0){let N1=L0(k1);d0((N1==null?void 0:N1.kind)===l4.Marker);let a2=(P1=N1==null?void 0:N1.onClick)==null?void 0:P1.call(N1,P(y({},H),{cell:k1,posX:H.localEventX,posY:H.localEventY,bounds:H.bounds,theme:H9(k1,H.location),preventDefault:()=>{}}));if(a2===void 0||a2.checked===k1.checked)return}s(void 0),I2();let s2=$.hasIndex(q),p2=O4.current;if(T1==="multi"&&(H.shiftKey||H.isLongTouch===!0)&&p2!==void 0&&$.hasIndex(p2)){let N1=[Math.min(p2,q),Math.max(p2,q)+1];M||z2==="multi"?H0(void 0,N1,!0):H0(x2.fromSingleSelection(N1),void 0,M)}else M||H.isTouch||z2==="multi"?s2?H0($.remove(q),void 0,!0):(H0(void 0,q,!0),O4.current=q):s2&&$.length===1?H0(x2.empty(),void 0,f):(H0(x2.fromSingleSelection(q),void 0,f),O4.current=q)}else if(T>=A&&W2&&q===d){let k1=r7(T);T5(k1!=null?k1:T)}else if(X!==T||r1!==q){let k1=j0(H.location),s2=L0(k1);if((s2==null?void 0:s2.onSelect)!==void 0){let a2=!1;if(s2.onSelect(P(y({},H),{cell:k1,posX:H.localEventX,posY:H.localEventY,bounds:H.bounds,preventDefault:()=>a2=!0,theme:H9(k1,H.location)})),a2)return}let p2=Y4&&q===d,N1=Y4&&W!==void 0&&((E1=W.current)==null?void 0:E1.cell[1])===d;if((H.shiftKey||H.isLongTouch===!0)&&X!==void 0&&r1!==void 0&&W.current!==void 0&&!N1){if(p2)return;let a2=Math.min(T,X),M2=Math.max(T,X),T2=Math.min(q,r1),G2=Math.max(q,r1);g0(P(y({},W.current),{range:{x:a2,y:T2,width:M2-a2+1,height:G2-T2+1}}),!0,f,"click"),O4.current=void 0,I2()}else g0({cell:[T,q],range:{x:T,y:q,width:1,height:1}},!0,f,"click"),O4.current=void 0,s(void 0),I2()}}else if(H.kind==="header")if(J4.current=[T,q],s(void 0),G0&&T===0)O4.current=void 0,P5.current=void 0,T1==="multi"&&($.length!==d?H0(x2.fromSingleSelection([0,d]),void 0,f):H0(x2.empty(),void 0,f),I2());else{let k1=P5.current;if(a1==="multi"&&(H.shiftKey||H.isLongTouch===!0)&&k1!==void 0&&I.hasIndex(k1)){let s2=[Math.min(k1,T),Math.max(k1,T)+1];F?i0(void 0,s2,f):i0(x2.fromSingleSelection(s2),void 0,f)}else F?(I.hasIndex(T)?i0(I.remove(T),void 0,f):i0(void 0,T,f),P5.current=T):a1!=="none"&&(i0(x2.fromSingleSelection(T),void 0,f),P5.current=T);O4.current=void 0,I2()}else H.kind===S0?J4.current=[T,q]:H.kind===l9&&!H.isMaybeScrollbar&&(D0(n3,!1),s(void 0),I2(),Z1==null||Z1(),O4.current=void 0,P5.current=void 0)},[T5,a1,I2,L0,r7,j0,W,G0,Y4,Z1,p4,A,$0,T1,z2,d,g0,D0,i0,H0,W2,H9]),V9=O.useRef(!1),J4=O.useRef(),H6=O.useRef(G1),t4=O.useRef(),ao=O.useCallback(H=>{if(D5.current=!1,H6.current=h1.current,H.button!==0&&H.button!==1){t4.current=void 0;return}let f=performance.now();t4.current={button:H.button,time:f,location:H.location},(H==null?void 0:H.kind)==="header"&&(V9.current=!0);let M=H.kind==="cell"&&H.isFillHandle;!M&&H.kind!=="cell"&&H.isEdge||(C({previousSelection:W,fillHandle:M}),J4.current=void 0,!H.isTouch&&H.button===0&&!M?L9(H):!H.isTouch&&H.button===1&&(J4.current=H.location))},[W,L9]),[Z3,E3]=O.useState(),L6=O.useCallback(H=>{if(H.kind!==S0||a1!=="multi")return;let f=V5.value?H.metaKey:H.ctrlKey,[M]=H.location,F=W.columns;if(M=A&&w5(T.group,Y[$].group);$--)q--;for(let $=M+1;${if(a0!==void 0&&c4!==void 0){let f=h1.current.y,M=h1.current.height,F=a0({x:H,y:f,width:1,height:Math.min(M,d-f)},E0.current.signal);typeof F!="object"&&(F=await F());let T=N0[H-A],I=document.createElement("canvas").getContext("2d",{alpha:!1});if(I!==null){I.font=h0.baseFontFull;let $=r8(I,h0,T,0,F,U0,n4,!1,L0);c4==null||c4(T,$.width,H,$.width)}}},[N0,a0,n4,h0,U0,c4,A,d,L0]),[oo,N3]=O.useState(),A5=O.useCallback(async(H,f)=>{var $,X;let M=($=H.current)==null?void 0:$.range;if(M===void 0||a0===void 0||f.current===void 0)return;let F=f.current.range;if(x!==void 0){let r1=!1;if(x({fillDestination:P(y({},F),{x:F.x-A}),patternSource:P(y({},M),{x:M.x-A}),preventDefault:()=>r1=!0}),r1)return}let T=a0(M,E0.current.signal);typeof T!="object"&&(T=await T());let q=T,I=[];for(let r1=0;r1({cell:r1.location})))},[a0,V0,x,A]),V6=O.useCallback(()=>{if(W.current===void 0||W.current.range.width<=1)return;let H=P(y({},W),{current:P(y({},W.current),{range:P(y({},W.current.range),{width:1})})});A5(H,W)},[A5,W]),d6=O.useCallback(()=>{if(W.current===void 0||W.current.range.height<=1)return;let H=P(y({},W),{current:P(y({},W.current),{range:P(y({},W.current.range),{height:1})})});A5(H,W)},[A5,W]),no=O.useCallback((H,f)=>{var d1,z1,P1;let M=n;if(C(void 0),J0(void 0),N3(void 0),V9.current=!1,f)return;if((M==null?void 0:M.fillHandle)===!0&&W.current!==void 0&&((d1=M.previousSelection)==null?void 0:d1.current)!==void 0){if(v2===void 0)return;let E1=P(y({},W),{current:P(y({},W.current),{range:w8(M.previousSelection.current.range,v2)})});A5(M.previousSelection,E1),D0(E1,!0);return}let[F,T]=H.location,[q,I]=(z1=J4.current)!=null?z1:[],$=()=>{D5.current=!0},X=E1=>{var s2,p2,N1,a2;let k1=E1.isTouch||q===F&&I===T;if(k1&&(Z==null||Z([F-A,T],P(y({},E1),{preventDefault:$}))),E1.button===1)return!D5.current;if(!D5.current){let M2=j0(H.location),T2=L0(M2);if(T2!==void 0&&T2.onClick!==void 0&&k1){let f2=T2.onClick(P(y({},E1),{cell:M2,posX:E1.localEventX,posY:E1.localEventY,bounds:E1.bounds,theme:H9(M2,H.location),preventDefault:$}));f2!==void 0&&!F4(f2)&&W5(f2)&&(V0([{location:E1.location,value:f2}]),(s2=U2.current)==null||s2.damage([{cell:E1.location}]))}if(D5.current||W.current===void 0)return!1;let G2=!1;switch((p2=M2.activationBehaviorOverride)!=null?p2:b1){case"double-click":case"second-click":{if(((a2=(N1=M==null?void 0:M.previousSelection)==null?void 0:N1.current)==null?void 0:a2.cell)===void 0)break;let[f2,K2]=W.current.cell,[w4,M4]=M.previousSelection.current.cell;G2=F===f2&&F===w4&&T===K2&&T===M4&&(E1.isDoubleClick===!0||b1==="second-click");break}case"single-click":{G2=!0;break}}if(G2)return R==null||R([F-A,T]),k5(E1.bounds,!1),!0}return!1},r1=H.location[0]-A;if(H.isTouch){let E1=h1.current,k1=H6.current;if(E1.x!==k1.x||E1.y!==k1.y)return;if(H.isLongTouch===!0){if(H.kind==="cell"&&g5((P1=W.current)==null?void 0:P1.cell,H.location)){Q==null||Q([r1,H.location[1]],P(y({},H),{preventDefault:$}));return}else if(H.kind==="header"&&W.columns.hasIndex(F)){g1==null||g1(r1,P(y({},H),{preventDefault:$}));return}else if(H.kind===S0){if(r1<0)return;G==null||G(r1,P(y({},H),{preventDefault:$}));return}}H.kind==="cell"?X(H)||L9(H):H.kind===S0?K==null||K(r1,P(y({},H),{preventDefault:$})):(H.kind===B4&&(D==null||D(r1,P(y({},H),{preventDefault:$}))),L9(H));return}if(H.kind==="header"){if(r1<0)return;H.isEdge?H.isDoubleClick===!0&&s7(F):H.button===0&&F===q&&T===I&&(D==null||D(r1,P(y({},H),{preventDefault:$})))}if(H.kind===S0){if(r1<0)return;H.button===0&&F===q&&T===I&&(K==null||K(r1,P(y({},H),{preventDefault:$})),D5.current||L6(H))}H.kind==="cell"&&(H.button===0||H.button===1)&&X(H),J4.current=void 0},[n,W,A,v2,A5,D0,Z,j0,L0,b1,H9,V0,R,k5,Q,g1,G,L9,K,D,s7,L6]),Co=O.useCallback(H=>{let f=P(y({},H),{location:[H.location[0]-A,H.location[1]]});H2==null||H2(f),n!==void 0&&H.buttons===0&&(C(void 0),J0(void 0),N3(void 0),V9.current=!1),N3(M=>{var F,T;return V9.current?[H.scrollEdge[0],0]:H.scrollEdge[0]===(M==null?void 0:M[0])&&H.scrollEdge[1]===M[1]?M:n===void 0||((T=(F=t4.current)==null?void 0:F.location[0])!=null?T:0){n1==null||n1(H-A,f)},[n1,A]),i4=(S6=W==null?void 0:W.current)==null?void 0:S6.cell,mo=O.useCallback((H,f,M,F,T,q)=>{r2.current=!1;let I=i4;I!==void 0&&(I=[I[0]-A,I[1]]);let $=f1===0?void 0:{x:0,y:H.y,width:f1,height:H.height},X=[];$!==void 0&&X.push($),m2>0&&(X.push({x:H.x-A,y:d-m2,width:H.width,height:m2}),f1>0&&X.push({x:0,y:d-m2,width:f1,height:m2}));let r1={x:H.x-A,y:H.y,width:H.width,height:W2&&H.y+H.height>=d?H.height-1:H.height,tx:T,ty:q,extras:{selected:I,freezeRegion:$,freezeRegions:X}};h1.current=r1,d2(r1),i7([f,M,F]),Q2==null||Q2(r1,r1.tx,r1.ty,r1.extras)},[i4,A,W2,d,f1,m2,d2,Q2]),ho=m5(y1,O.useCallback((H,f)=>{y1==null||y1(H-A,f-A),a1!=="none"&&i0(x2.fromSingleSelection(f),void 0,!0)},[a1,y1,A,i0])),R3=O.useRef(!1),wo=O.useCallback(H=>{if(H.location[0]===0&&A>0){H.preventDefault();return}U1==null||U1(P(y({},H),{location:[H.location[0]-A,H.location[1]]})),H.defaultPrevented()||(R3.current=!0),C(void 0)},[U1,A]),go=O.useCallback(()=>{R3.current=!1},[]),B3=O.useRef(),z3=O.useCallback(H=>{var f,M,F;if(!l3(H,B3.current)&&(B3.current=H,!(((f=t4==null?void 0:t4.current)==null?void 0:f.button)!==void 0&&t4.current.button>=1))){if(H.buttons!==0&&n!==void 0&&((M=t4.current)==null?void 0:M.location[0])===0&&H.location[0]===0&&A===1&&T1==="multi"&&n.previousSelection&&!n.previousSelection.rows.hasIndex(t4.current.location[1])&&W.rows.hasIndex(t4.current.location[1])){let T=Math.min(t4.current.location[1],H.location[1]),q=Math.max(t4.current.location[1],H.location[1])+1;H0(x2.fromSingleSelection([T,q]),void 0,!1)}if(H.buttons!==0&&n!==void 0&&W.current!==void 0&&!R3.current&&!V9.current&&(i2==="rect"||i2==="multi-rect")){let[T,q]=W.current.cell,[I,$]=H.location;if($<0&&($=h1.current.y),n.fillHandle===!0&&((F=n.previousSelection)==null?void 0:F.current)!==void 0){let X=n.previousSelection.current.range;$=Math.min($,W2?d-1:d);let r1=Zi(X,I,$,L2);J0(r1)}else{if(W2&&q===d)return;if(W2&&$===d)if(H.kind===l9)$--;else return;I=Math.max(I,A);let d1=I-T,z1=$-q,P1={x:d1>=0?T:I,y:z1>=0?q:$,width:Math.abs(d1)+1,height:Math.abs(z1)+1};g0(P(y({},W.current),{range:P1}),!0,!1,"drag")}}M1==null||M1(P(y({},H),{location:[H.location[0]-A,H.location[1]]}))}},[L2,n,A,T1,W,i2,M1,H0,W2,d,g0]),Ho=O.useCallback(()=>{var I,$,X;let H=B3.current;if(H===void 0)return;let[f,M]=H.scrollEdge,[F,T]=H.location,q=h1.current;f===-1?F=(X=($=(I=q.extras)==null?void 0:I.freezeRegion)==null?void 0:$.x)!=null?X:q.x:f===1&&(F=q.x+q.width),M===-1?T=Math.max(0,q.y):M===1&&(T=Math.min(d-1,q.y+q.height)),F=(0,v5.default)(F,0,Y.length-1),T=(0,v5.default)(T,0,d-1),z3(P(y({},H),{location:[F,T]}))},[Y.length,z3,d]);_s(oo,c,Ho);let h4=O.useCallback(H=>{if(W.current===void 0)return;let[f,M]=H,[F,T]=W.current.cell,q=W.current.range,I=q.x,$=q.x+q.width,X=q.y,r1=q.y+q.height;if(M!==0)switch(M){case 2:{r1=d,X=T,r0(0,r1,"vertical");break}case-2:{X=0,r1=T+1,r0(0,X,"vertical");break}case 1:{XT+1?(r1--,r0(0,r1,"vertical")):(X=Math.max(0,X-1),r0(0,X,"vertical"));break}default:l5(M)}if(f!==0)if(f===2)$=Y.length,I=F,r0($-1-A,0,"horizontal");else if(f===-2)I=A,$=F+1,r0(I-A,0,"horizontal");else{let d1=[];if(a0!==void 0){let z1=a0({x:I,y:X,width:$-I-A,height:r1-X},E0.current.signal);typeof z1=="object"&&(d1=aL(z1))}if(f===1){let z1=!1;if(I0){let P1=(0,p5.default)(I+1,F+1).find(E1=>!d1.includes(E1-A));P1!==void 0&&(I=P1,z1=!0)}else I++,z1=!0;z1&&r0(I,0,"horizontal")}z1||($=Math.min(Y.length,$+1),r0($-1-A,0,"horizontal"))}else if(f===-1){let z1=!1;if($>F+1){if(d1.length>0){let P1=(0,p5.default)($-1,F,-1).find(E1=>!d1.includes(E1-A));P1!==void 0&&($=P1,z1=!0)}else $--,z1=!0;z1&&r0($-A,0,"horizontal")}z1||(I=Math.max(A,I-1),r0(I-A,0,"horizontal"))}else l5(f)}g0({cell:W.current.cell,range:{x:I,y:X,width:$-I,height:r1-X}},!0,!1,"keyboard-select")},[a0,W,Y.length,A,d,r0,g0]),_4=O.useCallback((H,f,M,F)=>{let T=O2-(M?0:1);if(H=(0,v5.default)(H,A,N0.length-1+A),f=(0,v5.default)(f,0,T),H===(i4==null?void 0:i4[0])&&f===(i4==null?void 0:i4[1]))return!1;if(F&&W.current!==void 0){let q=[...W.current.rangeStack];(W.current.range.width>1||W.current.range.height>1)&&q.push(W.current.range),D0(P(y({},W),{current:{cell:[H,f],range:{x:H,y:f,width:1,height:1},rangeStack:q}}),!0)}else g0({cell:[H,f],range:{x:H,y:f,width:1,height:1}},!0,!1,"keyboard-nav");return h.current!==void 0&&h.current[0]===H&&h.current[1]===f&&(h.current=void 0),r0(H-A,f),!0},[O2,A,N0.length,i4,W,r0,D0,g0]),Lo=O.useCallback((H,f)=>{(r==null?void 0:r.cell)!==void 0&&H!==void 0&&W5(H)&&(V0([{location:r.cell,value:H}]),window.requestAnimationFrame(()=>{var T;(T=U2.current)==null||T.damage([{cell:r.cell}])})),I2(!0),s(void 0);let[M,F]=f;if(W.current!==void 0&&(M!==0||F!==0)){let T=W.current.cell[1]===O2-1&&H!==void 0;_4((0,v5.default)(W.current.cell[0]+M,0,Y.length-1),(0,v5.default)(W.current.cell[1]+F,0,O2-1),T,!1)}N==null||N(H,f)},[r==null?void 0:r.cell,I2,W,N,V0,O2,_4,Y.length]),Vo=O.useMemo(()=>`gdg-overlay-${sL++}`,[]),e5=O.useCallback(H=>{var M,F,T,q;I2();let f=[];for(let I=H.x;I({cell:I.location})))},[I2,p,L0,V0,A]),d9=r!==void 0,u6=O.useCallback(H=>{var E1,k1,s2,p2;let f=()=>{H.stopPropagation(),H.preventDefault()},M={didMatch:!1},{bounds:F}=H,T=W.columns,q=W.rows,I=C4;if(!d9&&o2(I.clear,H,M))D0(n3,!1),Z1==null||Z1();else if(!d9&&o2(I.selectAll,H,M))D0({columns:x2.empty(),rows:x2.empty(),current:{cell:(k1=(E1=W.current)==null?void 0:E1.cell)!=null?k1:[A,0],range:{x:A,y:0,width:u.length,height:d},rangeStack:[]}},!1);else if(o2(I.search,H,M))(s2=a==null?void 0:a.current)==null||s2.focus({preventScroll:!0}),t7(!0);else if(o2(I.delete,H,M)){let N1=(p2=m4==null?void 0:m4(W))!=null?p2:!0;if(N1!==!1){let a2=N1===!0?W:N1;if(a2.current!==void 0){e5(a2.current.range);for(let M2 of a2.current.rangeStack)e5(M2)}for(let M2 of a2.rows)e5({x:A,y:M2,width:u.length,height:1});for(let M2 of a2.columns)e5({x:M2,y:0,width:1,height:d})}}if(M.didMatch)return f(),!0;if(W.current===void 0)return!1;let[$,X]=W.current.cell,r1=!1,d1=!1;o2(I.scrollToSelectedCell,H,M)?n7.current($-A,X):a1!=="none"&&o2(I.selectColumn,H,M)?T.hasIndex($)?i0(T.remove($),void 0,!0):a1==="single"?i0(x2.fromSingleSelection($),void 0,!0):i0(void 0,$,!0):T1!=="none"&&o2(I.selectRow,H,M)?q.hasIndex(X)?H0(q.remove(X),void 0,!0):T1==="single"?H0(x2.fromSingleSelection(X),void 0,!0):H0(void 0,X,!0):!d9&&F!==void 0&&o2(I.activateCell,H,M)?X===d&&W2?window.setTimeout(()=>{let N1=r7($);T5(N1!=null?N1:$)},0):(R==null||R([$-A,X]),k5(F,!0)):W.current.range.height>1&&o2(I.downFill,H,M)?d6():W.current.range.width>1&&o2(I.rightFill,H,M)?V6():o2(I.goToNextPage,H,M)?X+=Math.max(1,h1.current.height-4):o2(I.goToPreviousPage,H,M)?X-=Math.max(1,h1.current.height-4):o2(I.goToFirstCell,H,M)?(s(void 0),X=0,$=0):o2(I.goToLastCell,H,M)?(s(void 0),X=Number.MAX_SAFE_INTEGER,$=Number.MAX_SAFE_INTEGER):o2(I.selectToFirstCell,H,M)?(s(void 0),h4([-2,-2])):o2(I.selectToLastCell,H,M)?(s(void 0),h4([2,2])):d9?(o2(I.closeOverlay,H,M)&&s(void 0),o2(I.acceptOverlayDown,H,M)&&(s(void 0),X++),o2(I.acceptOverlayUp,H,M)&&(s(void 0),X--),o2(I.acceptOverlayLeft,H,M)&&(s(void 0),$--),o2(I.acceptOverlayRight,H,M)&&(s(void 0),$++)):(o2(I.goDownCell,H,M)?X+=1:o2(I.goUpCell,H,M)?X-=1:o2(I.goRightCell,H,M)?$+=1:o2(I.goLeftCell,H,M)?$-=1:o2(I.goDownCellRetainSelection,H,M)?(X+=1,r1=!0):o2(I.goUpCellRetainSelection,H,M)?(X-=1,r1=!0):o2(I.goRightCellRetainSelection,H,M)?($+=1,r1=!0):o2(I.goLeftCellRetainSelection,H,M)?($-=1,r1=!0):o2(I.goToLastRow,H,M)?X=d-1:o2(I.goToFirstRow,H,M)?X=Number.MIN_SAFE_INTEGER:o2(I.goToLastColumn,H,M)?$=Number.MAX_SAFE_INTEGER:o2(I.goToFirstColumn,H,M)?$=Number.MIN_SAFE_INTEGER:(i2==="rect"||i2==="multi-rect")&&(o2(I.selectGrowDown,H,M)?h4([0,1]):o2(I.selectGrowUp,H,M)?h4([0,-1]):o2(I.selectGrowRight,H,M)?h4([1,0]):o2(I.selectGrowLeft,H,M)?h4([-1,0]):o2(I.selectToLastRow,H,M)?h4([0,2]):o2(I.selectToFirstRow,H,M)?h4([0,-2]):o2(I.selectToLastColumn,H,M)?h4([2,0]):o2(I.selectToFirstColumn,H,M)&&h4([-2,0])),d1=M.didMatch);let z1=_4($,X,!1,r1),P1=M.didMatch;return P1&&(z1||!d1||j9)&&f(),P1},[d9,W,C4,a1,T1,i2,A,d,_4,D0,Z1,u.length,m4,j9,e5,i0,H0,W2,r7,T5,R,k5,d6,V6,h4]),u9=O.useCallback(H=>{let f=!1;if(H1!==void 0&&H1(P(y({},H),{cancel:()=>{f=!0}})),f||u6(H)||W.current===void 0)return;let[M,F]=W.current.cell,T=h1.current;if(Z2&&!H.metaKey&&!H.ctrlKey&&W.current!==void 0&&H.key.length===1&&/[ -~]/g.test(H.key)&&H.bounds!==void 0&&o5(p([M-A,Math.max(0,Math.min(F,d-1))]))){if((!W2||F!==d)&&(T.y>F||F>T.y+T.height||T.x>M||M>T.x+T.width))return;k5(H.bounds,!0,H.key),H.stopPropagation(),H.preventDefault()}},[Z2,H1,u6,W,p,A,d,W2,k5]),uo=O.useCallback((H,f)=>{let M=H.location[0]-A;if(H.kind==="header"&&(g1==null||g1(M,P(y({},H),{preventDefault:f}))),H.kind===S0){if(M<0)return;G==null||G(M,P(y({},H),{preventDefault:f}))}if(H.kind==="cell"){let[F,T]=H.location;Q==null||Q([M,T],P(y({},H),{preventDefault:f})),ht(W,H.location)||_4(F,T,!1,!1)}},[W,Q,G,g1,A,_4]),y3=O.useCallback(async H=>{var I,$,X,r1,d1,z1;if(!C4.paste)return;function f(P1,E1,k1,s2){var N1,a2,M2,T2;let p2=typeof k1=="object"?(N1=k1==null?void 0:k1.join(` +`&&(i.push(l),l=[])),s=t.None);break}a++}return ro.map(n=>({rawValue:n,formatted:n,format:"string"})))}function K8(e,t,i){var o;let l=ks(e,t),r=n=>{var C;(C=window.navigator.clipboard)==null||C.writeText(n)},s=(n,C)=>{var c;return((c=window.navigator.clipboard)==null?void 0:c.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([n],{type:"text/plain"}),"text/html":new Blob([C],{type:"text/html"})})]),!0)},a=(n,C)=>{var c,h;try{if(i===void 0||i.clipboardData===null)throw new Error("No clipboard data");(c=i==null?void 0:i.clipboardData)==null||c.setData("text/plain",n),(h=i==null?void 0:i.clipboardData)==null||h.setData("text/html",C)}catch(g){s(n,C)||r(n)}};((o=window.navigator.clipboard)==null?void 0:o.write)!==void 0||(i==null?void 0:i.clipboardData)!==void 0?a(l.textPlain,l.textHtml):r(l.textPlain),i==null||i.preventDefault()}function a3(e){return e!==!0}var Is=F1(Y1(),1);function As(e){return typeof e=="string"?e:`${e}px`}var JH=()=>e=>e.innerWidth,eL=()=>e=>e.innerHeight,tL=X2("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[JH()],"wmyidgi-1":[eL()]}}),Os=e=>{let s=e,{inWidth:t,inHeight:i,children:l}=s,r=o0(s,["inWidth","inHeight","children"]);return Is.createElement(tL,y({innerHeight:As(i),innerWidth:As(t)},r),l)};var X8=F1(Y1(),1),iL=2,lL=1300;function _s(e,t,i){let l=X8.default.useRef(0),[r,s]=e!=null?e:[0,0];X8.default.useEffect(()=>{if(r===0&&s===0){l.current=0;return}let a=!1,o=0,n=C=>{var c;if(!a){if(o===0)o=C;else{let h=C-o;l.current=Math.min(1,l.current+h/lL);let g=l.current**1.618*h*iL;(c=t.current)==null||c.scrollBy(r*g,s*g),o=C,i==null||i()}window.requestAnimationFrame(n)}};return window.requestAnimationFrame(n),()=>{a=!0}},[t,r,s,i])}var Ws=F1(Y1(),1);function qs({rowHeight:e,headerHeight:t,groupHeaderHeight:i,theme:l,overscrollX:r,overscrollY:s,scaleToRem:a,remSize:o}){let[n,C,c,h,g,m]=Ws.default.useMemo(()=>{var V,u,d;if(!a||o===16)return[e,t,i,l,r,s];let w=o/16,L=e,v=C7();return[typeof L=="number"?L*w:p=>Math.ceil(L(p)*w),Math.ceil(t*w),Math.ceil(i*w),P(y({},l),{headerIconSize:((V=l==null?void 0:l.headerIconSize)!=null?V:v.headerIconSize)*w,cellHorizontalPadding:((u=l==null?void 0:l.cellHorizontalPadding)!=null?u:v.cellHorizontalPadding)*w,cellVerticalPadding:((d=l==null?void 0:l.cellVerticalPadding)!=null?d:v.cellVerticalPadding)*w}),Math.ceil((r!=null?r:0)*w),Math.ceil((s!=null?s:0)*w)]},[i,t,r,s,o,e,a,l]);return{rowHeight:n,headerHeight:C,groupHeaderHeight:c,theme:h,overscrollX:g,overscrollY:m}}var Us=F1(Y1(),1);var X4={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 n2(e,t){return e===!0?t:e===!1?"":e}function $s(e){let t=V5.value;return{activateCell:n2(e.activateCell," |Enter|shift+Enter"),clear:n2(e.clear,"any+Escape"),closeOverlay:n2(e.closeOverlay,"any+Escape"),acceptOverlayDown:n2(e.acceptOverlayDown,"Enter"),acceptOverlayUp:n2(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:n2(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:n2(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:n2(e.delete,t?"Backspace|Delete":"Delete"),downFill:n2(e.downFill,"primary+_68"),scrollToSelectedCell:n2(e.scrollToSelectedCell,"primary+Enter"),goDownCell:n2(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:n2(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:n2(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:n2(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:n2(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:n2(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:n2(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:n2(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:n2(e.goToFirstCell,"primary+Home"),goToFirstColumn:n2(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:n2(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:n2(e.goToLastCell,"primary+End"),goToLastColumn:n2(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:n2(e.goToLastRow,"primary+ArrowDown"),goToNextPage:n2(e.goToNextPage,"PageDown"),goToPreviousPage:n2(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:n2(e.rightFill,"primary+_82"),search:n2(e.search,"primary+f"),selectAll:n2(e.selectAll,"primary+a"),selectColumn:n2(e.selectColumn,"ctrl+ "),selectGrowDown:n2(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:n2(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:n2(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:n2(e.selectGrowUp,"shift+ArrowUp"),selectRow:n2(e.selectRow,"shift+ "),selectToFirstCell:n2(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:n2(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:n2(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:n2(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:n2(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:n2(e.selectToLastRow,"primary+shift+ArrowDown")}}function Gs(e){let t=_e(e);return Us.default.useMemo(()=>{var l,r,s,a,o,n,C,c,h,g,m,w;if(t===void 0)return $s(X4);let i=P(y({},t),{goToNextPage:(r=(l=t==null?void 0:t.goToNextPage)!=null?l:t==null?void 0:t.pageDown)!=null?r:X4.goToNextPage,goToPreviousPage:(a=(s=t==null?void 0:t.goToPreviousPage)!=null?s:t==null?void 0:t.pageUp)!=null?a:X4.goToPreviousPage,goToFirstCell:(n=(o=t==null?void 0:t.goToFirstCell)!=null?o:t==null?void 0:t.first)!=null?n:X4.goToFirstCell,goToLastCell:(c=(C=t==null?void 0:t.goToLastCell)!=null?C:t==null?void 0:t.last)!=null?c:X4.goToLastCell,selectToFirstCell:(g=(h=t==null?void 0:t.selectToFirstCell)!=null?h:t==null?void 0:t.first)!=null?g:X4.selectToFirstCell,selectToLastCell:(w=(m=t==null?void 0:t.selectToLastCell)!=null?m:t==null?void 0:t.last)!=null?w:X4.selectToLastCell});return $s(y(y({},X4),i))},[t])}var rL=O.lazy(async()=>await import("./data-grid-overlay-editor-LA45TJRM.js")),sL=0;function aL(e){return(0,Ks.default)((0,Y8.default)((0,Y8.default)(e).filter(t=>t.span!==void 0).map(t=>{var i,l,r,s;return(0,p5.default)(((l=(i=t.span)==null?void 0:i[0])!=null?l:0)+1,((s=(r=t.span)==null?void 0:r[1])!=null?s:0)+1)})))}function o3(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:P(y({},e.current.range),{x:e.current.range.x+t}),rangeStack:e.current.rangeStack.map(i=>P(y({},i),{x:i.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}var j8={kind:c1.Loading,allowOverlay:!1},n3={columns:x2.empty(),rows:x2.empty(),current:void 0},oL=(e,t)=>{var f6,Z6,E6,N6,R6,B6,z6,y6,b6,F6,S6,k6,T6;let[i,l]=O.useState(n3),[r,s]=O.useState(),a=O.useRef(null),o=O.useRef(null),[n,C]=O.useState(),c=O.useRef(null),h=O.useRef(),g=typeof window=="undefined"?null:window,{imageEditorOverride:m,getRowThemeOverride:w,markdownDivCreateNode:L,width:v,height:V,columns:u,rows:d,getCellContent:p,onCellClicked:Z,onCellActivated:R,onFillPattern:x,onFinishedEditing:N,coercePasteValue:E,drawHeader:S,drawCell:k,editorBloom:b,onHeaderClicked:D,onColumnProposeMove:B,spanRangeBehavior:_="default",onGroupHeaderClicked:K,onCellContextMenu:Q,className:m1,onHeaderContextMenu:g1,getCellsForSelection:w1,onGroupHeaderContextMenu:G,onGroupHeaderRenamed:s1,onCellEdited:o1,onCellsEdited:R1,onSearchResultsChanged:J,searchResults:I1,onSearchValueChange:p1,searchValue:e2,onKeyDown:H1,onKeyUp:W1,keybindings:E2,editOnType:Z2=!0,onRowAppended:u2,onColumnMoved:y1,validateCell:t2,highlightRegions:w2,rangeSelect:i2="rect",columnSelect:a1="multi",rowSelect:T1="multi",rangeSelectionBlending:l2="exclusive",columnSelectionBlending:q1="exclusive",rowSelectionBlending:S1="exclusive",onDelete:$1,onDragStart:U1,onMouseMove:H2,onPaste:t1,copyHeaders:L1=!1,freezeColumns:f1=0,cellActivationBehavior:b1="second-click",rowSelectionMode:z2="auto",onHeaderMenuClick:n1,getGroupDetails:V1,onSearchClose:l1,onItemHovered:M1,onSelectionCleared:Z1,showSearch:R2,onVisibleRegionChanged:Q2,gridSelection:e0,onGridSelectionChange:t0,minColumnWidth:c0=50,maxColumnWidth:Y2=500,maxColumnAutoWidth:J2,provideEditor:k0,trailingRowOptions:C2,freezeTrailingRows:m2=0,allowedFillDirections:L2="orthogonal",scrollOffsetX:A2,scrollOffsetY:y2,verticalBorder:F2,onDragOverCell:Z0,onDrop:o4,onColumnResize:T0,onColumnResizeEnd:m0,onColumnResizeStart:B1,customRenderers:S2,fillHandle:X1,drawFocusRing:N2=!0,experimental:j1,fixedShadowX:Q0,fixedShadowY:v4,headerIcons:P0,imageWindowLoader:q0,initialSize:z4,isDraggable:K9,onDragLeave:X9,onRowMoved:p4,overscrollX:f5,overscrollY:Z5,preventDiagonalScrolling:E5,rightElement:j4,rightElementProps:T4,trapFocus:j9=!1,smoothScrollX:Y9,smoothScrollY:w3,scaleToRem:g3=!1,rowHeight:N5=34,headerHeight:y4=36,groupHeaderHeight:H3=y4,theme:L3,isOutsideClick:Q9,renderers:R5}=e,s0=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,$0=(Z6=(f6=s0==null?void 0:s0.kind)!=null?f6:e.rowMarkers)!=null?Z6:"none",B5=(E6=s0==null?void 0:s0.width)!=null?E6:e.rowMarkerWidth,z5=(R6=(N6=s0==null?void 0:s0.startIndex)!=null?N6:e.rowMarkerStartIndex)!=null?R6:1,o9=(B6=s0==null?void 0:s0.theme)!=null?B6:e.rowMarkerTheme,P4=(z6=s0==null?void 0:s0.checkboxStyle)!=null?z6:"square",U0=Math.max(c0,20),n4=Math.max(Y2,U0),n9=Math.max(J2!=null?J2:n4,U0),D4=O.useMemo(()=>typeof window=="undefined"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),C9=O.useMemo(()=>Number.parseFloat(D4.fontSize),[D4]),{rowHeight:B0,headerHeight:y5,groupHeaderHeight:c9,theme:J9,overscrollX:V3,overscrollY:e7}=qs({groupHeaderHeight:H3,headerHeight:y4,overscrollX:f5,overscrollY:Z5,remSize:C9,rowHeight:N5,scaleToRem:g3,theme:L3}),C4=Gs(E2),b4=B5!=null?B5:d>1e4?48:d>1e3?44:d>100?36:32,G0=$0!=="none",A=G0?1:0,W2=u2!==void 0,Y4=(C2==null?void 0:C2.sticky)===!0,[d3,t7]=O.useState(!1),m9=R2!=null?R2:d3,u3=O.useCallback(()=>{l1!==void 0?l1():t7(!1)},[l1]),h9=O.useMemo(()=>e0===void 0?void 0:o3(e0,A),[e0,A]),W=h9!=null?h9:i,E0=O.useRef();E0.current===void 0&&(E0.current=new AbortController),O.useEffect(()=>()=>E0==null?void 0:E0.current.abort(),[]);let[a0,b5]=bs(w1,p,A,E0.current,d),w9=O.useCallback((H,f,M)=>{if(t2===void 0)return!0;let F=[H[0]-A,H[1]];return t2==null?void 0:t2(F,f,M)},[A,t2]),A4=O.useRef(e0),D0=O.useCallback((H,f)=>{f&&(H=Ps(H,a0,A,_,E0.current)),t0!==void 0?(A4.current=o3(H,-A),t0(A4.current)):l(H)},[t0,a0,A,_]),c4=m5(T0,O.useCallback((H,f,M,F)=>{T0==null||T0(u[M-A],f,M-A,F)},[T0,A,u])),v3=m5(m0,O.useCallback((H,f,M,F)=>{m0==null||m0(u[M-A],f,M-A,F)},[m0,A,u])),F5=m5(B1,O.useCallback((H,f,M,F)=>{B1==null||B1(u[M-A],f,M-A,F)},[B1,A,u])),p3=m5(S,O.useCallback((H,f)=>{var M;return(M=S==null?void 0:S(P(y({},H),{columnIndex:H.columnIndex-A}),f))!=null?M:!1},[S,A])),M3=m5(k,O.useCallback((H,f)=>{var M;return(M=k==null?void 0:k(P(y({},H),{col:H.col-A}),f))!=null?M:!1},[k,A])),m4=O.useCallback(H=>{if($1!==void 0){let f=$1(o3(H,-A));return typeof f=="boolean"?f:o3(f,A)}return!0},[$1,A]),[g0,H0,i0]=ys(W,D0,l2,q1,S1,i2),h0=O.useMemo(()=>r4(C7(),J9),[J9]),[S5,i7]=O.useState([0,0,0]),g9=O.useMemo(()=>{if(R5===void 0)return{};let H={};for(let f of R5)H[f.kind]=f;return H},[R5]),L0=O.useCallback(H=>H.kind!==c1.Custom?g9[H.kind]:S2==null?void 0:S2.find(f=>f.isMatch(H)),[S2,g9]),{sizedColumns:N0,nonGrowWidth:z}=ft(u,d,b5,S5[0]-(A===0?0:b4)-S5[2],U0,n9,h0,L0,E0.current);$0!=="none"&&(z+=b4);let j=O.useMemo(()=>N0.some(H=>H.group!==void 0),[N0]),x1=j?y5+c9:y5,v1=W.rows.length,C1=$0==="none"?void 0:v1===0?!1:v1===d?!0:void 0,Y=O.useMemo(()=>$0==="none"?N0:[{title:"",width:b4,icon:void 0,hasMenu:!1,style:"normal",themeOverride:o9,rowMarker:P4,rowMarkerChecked:C1},...N0],[$0,N0,b4,o9,P4,C1]),[_1,K1]=O.useMemo(()=>[y2!==void 0&&typeof B0=="number"?Math.floor(y2/B0):0,y2!==void 0&&typeof B0=="number"?-(y2%B0):0],[y2,B0]),h1=O.useRef({height:1,width:1,x:0,y:0}),q2=O.useMemo(()=>{var H,f;return{x:h1.current.x,y:_1,width:(H=h1.current.width)!=null?H:1,height:(f=h1.current.height)!=null?f:1,ty:K1}},[K1,_1]),r2=O.useRef(!1),[G1,d2,Q1]=Oe(q2);h1.current=G1;let k2=((y6=G1.height)!=null?y6:1)>1;O.useLayoutEffect(()=>{if(y2!==void 0&&c.current!==null&&k2){if(c.current.scrollTop===y2)return;c.current.scrollTop=y2,c.current.scrollTop!==y2&&Q1(),r2.current=!0}},[y2,k2,Q1]);let l0=((b6=G1.width)!=null?b6:1)>1;O.useLayoutEffect(()=>{if(A2!==void 0&&c.current!==null&&l0){if(c.current.scrollLeft===A2)return;c.current.scrollLeft=A2,c.current.scrollLeft!==A2&&Q1(),r2.current=!0}},[A2,l0,Q1]);let K0=G1.x+A,$2=G1.y,U2=O.useRef(null),I2=O.useCallback(H=>{var f;H===!0?(f=U2.current)==null||f.focus():window.requestAnimationFrame(()=>{var M;(M=U2.current)==null||M.focus()})},[]),O2=W2?d+1:d,V0=O.useCallback(H=>{let f=A===0?H:H.map(F=>P(y({},F),{location:[F.location[0]-A,F.location[1]]})),M=R1==null?void 0:R1(f);if(M!==!0)for(let F of f)o1==null||o1(F.location,F.value);return M},[o1,R1,A]),[v2,J0]=O.useState(),M0=W.current!==void 0&&W.current.range.width*W.current.range.height>1?W.current.range:void 0,e4=N2?(F6=W.current)==null?void 0:F6.cell:void 0,X0=e4==null?void 0:e4[0],I4=e4==null?void 0:e4[1],Q4=O.useMemo(()=>{var f,M;if((w2===void 0||w2.length===0)&&((M=(f=M0!=null?M0:X0)!=null?f:I4)!=null?M:v2)===void 0)return;let H=[];if(w2!==void 0)for(let F of w2){let T=Y.length-F.range.x-A;T>0&&H.push({color:F.color,range:P(y({},F.range),{x:F.range.x+A,width:Math.min(T,F.range.width)}),style:F.style})}return v2!==void 0&&H.push({color:z0(h0.accentColor,0),range:v2,style:"dashed"}),M0!==void 0&&H.push({color:z0(h0.accentColor,.5),range:M0,style:"solid-outline"}),X0!==void 0&&I4!==void 0&&H.push({color:h0.accentColor,range:{x:X0,y:I4,width:1,height:1},style:"solid-outline"}),H.length>0?H:void 0},[v2,M0,X0,I4,w2,Y.length,h0.accentColor,A]),m6=O.useRef(Y);m6.current=Y;let j0=O.useCallback(([H,f],M=!1)=>{var q,I,$,X,r1,d1,z1,P1,E1,k1;let F=W2&&f===O2-1;if(H===0&&G0)return F?j8:{kind:l4.Marker,allowOverlay:!1,checkboxStyle:P4,checked:(W==null?void 0:W.rows.hasIndex(f))===!0,markerKind:$0==="clickable-number"?"number":$0,row:z5+f,drawHandle:p4!==void 0,cursor:$0==="clickable-number"?"pointer":void 0};if(F){let p2=H===A&&(q=C2==null?void 0:C2.hint)!=null?q:"",N1=m6.current[H];if(((I=N1==null?void 0:N1.trailingRowOptions)==null?void 0:I.disabled)===!0)return j8;{let a2=(X=($=N1==null?void 0:N1.trailingRowOptions)==null?void 0:$.hint)!=null?X:p2,M2=(d1=(r1=N1==null?void 0:N1.trailingRowOptions)==null?void 0:r1.addIcon)!=null?d1:C2==null?void 0:C2.addIcon;return{kind:l4.NewRow,hint:a2,allowOverlay:!1,icon:M2}}}else{let s2=H-A;if(M||(j1==null?void 0:j1.strict)===!0){let N1=h1.current,a2=N1.x>s2||s2>N1.x+N1.width||N1.y>f||f>N1.y+N1.height||f>=f3.current,M2=s2===((P1=(z1=N1.extras)==null?void 0:z1.selected)==null?void 0:P1[0])&&f===((E1=N1.extras)==null?void 0:E1.selected[1]),T2=!1;if(((k1=N1.extras)==null?void 0:k1.freezeRegions)!==void 0){for(let G2 of N1.extras.freezeRegions)if(G4(G2,s2,f)){T2=!0;break}}if(a2&&!M2&&!T2)return j8}let p2=p([s2,f]);return A!==0&&p2.span!==void 0&&(p2=P(y({},p2),{span:[p2.span[0]+A,p2.span[1]+A]})),p2}},[W2,O2,G0,P4,W==null?void 0:W.rows,$0,z5,p4,A,C2==null?void 0:C2.hint,C2==null?void 0:C2.addIcon,j1==null?void 0:j1.strict,p]),x3=O.useCallback(H=>{var M,F;let f=(M=V1==null?void 0:V1(H))!=null?M:{name:H};return s1!==void 0&&H!==""&&(f={icon:f.icon,name:f.name,overrideTheme:f.overrideTheme,actions:[...(F=f.actions)!=null?F:[],{title:"Rename",icon:"renameIcon",onClick:T=>E3({group:f.name,bounds:T.bounds})}]}),f},[V1,s1]),l7=O.useCallback(H=>{var $;let[f,M]=H.cell,F=Y[f],T=(F==null?void 0:F.group)!==void 0?($=x3(F.group))==null?void 0:$.overrideTheme:void 0,q=F==null?void 0:F.themeOverride,I=w==null?void 0:w(M);s(P(y({},H),{theme:r4(h0,T,q,I,H.content.themeOverride)}))},[w,Y,x3,h0]),k5=O.useCallback((H,f,M)=>{var I;if(W.current===void 0)return;let[F,T]=W.current.cell,q=j0([F,T]);if(q.kind!==c1.Boolean&&q.allowOverlay){let $=q;if(M!==void 0)switch($.kind){case c1.Number:{let X=D6(()=>M==="-"?-0:Number.parseFloat(M),0);$=P(y({},$),{data:Number.isNaN(X)?0:X});break}case c1.Text:case c1.Markdown:case c1.Uri:$=P(y({},$),{data:M});break}l7({target:H,content:$,initialValue:M,cell:[F,T],highlight:M===void 0,forceEditMode:M!==void 0})}else q.kind===c1.Boolean&&f&&q.readonly!==!0&&(V0([{location:W.current.cell,value:P(y({},q),{data:a3(q.data)})}]),(I=U2.current)==null||I.damage([{cell:W.current.cell}]))},[j0,W,V0,l7]),h6=O.useCallback((H,f)=>{var T;let M=(T=U2.current)==null?void 0:T.getBounds(H,f);if(M===void 0||c.current===null)return;let F=j0([H,f]);F.allowOverlay&&l7({target:M,content:F,initialValue:void 0,highlight:!0,cell:[H,f],forceEditMode:!0})},[j0,l7]),r0=O.useCallback((H,f,M="both",F=0,T=0,q=void 0)=>{var I;if(c.current!==null){let $=U2.current,X=o.current,r1=typeof H!="number"?H.unit==="cell"?H.amount:void 0:H,d1=typeof f!="number"?f.unit==="cell"?f.amount:void 0:f,z1=typeof H!="number"&&H.unit==="px"?H.amount:void 0,P1=typeof f!="number"&&f.unit==="px"?f.amount:void 0;if($!==null&&X!==null){let E1={x:0,y:0,width:0,height:0},k1=0,s2=0;if((r1!==void 0||d1!==void 0)&&(E1=(I=$.getBounds((r1!=null?r1:0)+A,d1!=null?d1:0))!=null?I:E1,E1.width===0||E1.height===0))return;let p2=X.getBoundingClientRect(),N1=p2.width/X.offsetWidth;if(z1!==void 0&&(E1=P(y({},E1),{x:z1-p2.left-c.current.scrollLeft,width:1})),P1!==void 0&&(E1=P(y({},E1),{y:P1+p2.top-c.current.scrollTop,height:1})),E1!==void 0){let a2={x:E1.x-F,y:E1.y-T,width:E1.width+2*F,height:E1.height+2*T},M2=0;for(let b3=0;b30&&(T2=a4(O2,G2,B0));let f2=M2*N1+p2.left+A*b4*N1,K2=p2.right,w4=p2.top+x1*N1,M4=p2.bottom-T2*N1,t5=E1.width+F*2;switch(q==null?void 0:q.hAlign){case"start":K2=f2+t5;break;case"end":f2=K2-t5;break;case"center":f2=Math.floor((f2+K2)/2)-t5/2,K2=f2+t5;break}let i5=E1.height+T*2;switch(q==null?void 0:q.vAlign){case"start":M4=w4+i5;break;case"end":w4=M4-i5;break;case"center":w4=Math.floor((w4+M4)/2)-i5/2,M4=w4+i5;break}f2>a2.x?k1=a2.x-f2:K2a2.y?s2=a2.y-w4:M4=O2-G2)&&(s2=0),(k1!==0||s2!==0)&&(N1!==1&&(k1/=N1,s2/=N1),c.current.scrollTo(k1+c.current.scrollLeft,s2+c.current.scrollTop))}}}},[A,m2,b4,x1,f1,N0,O2,Y4,B0]),w6=O.useRef(h6),g6=O.useRef(p),f3=O.useRef(d);w6.current=h6,g6.current=p,f3.current=d;let T5=O.useCallback(async(H,f=!0)=>{var X;let M=Y[H];if(((X=M==null?void 0:M.trailingRowOptions)==null?void 0:X.disabled)===!0)return;let F=u2==null?void 0:u2(),T,q=!0;F!==void 0&&(T=await F,T==="top"&&(q=!1),typeof T=="number"&&(q=!1));let I=0,$=()=>{if(f3.current<=d){I<500&&window.setTimeout($,I),I=50+I*2;return}let r1=typeof T=="number"?T:q?d:0;n7.current(H-A,r1),g0({cell:[H,r1],range:{x:H,y:r1,width:1,height:1}},!1,!1,"edit");let d1=g6.current([H-A,r1]);d1.allowOverlay&&o5(d1)&&d1.readonly!==!0&&f&&window.setTimeout(()=>{w6.current(H,r1)},0)};$()},[Y,u2,A,d,g0]),r7=O.useCallback(H=>{var M,F,T;let f=(T=(F=(M=N0[H])==null?void 0:M.trailingRowOptions)==null?void 0:F.targetColumn)!=null?T:C2==null?void 0:C2.targetColumn;if(typeof f=="number")return f+(G0?1:0);if(typeof f=="object"){let q=u.indexOf(f);if(q>=0)return q+(G0?1:0)}},[N0,u,G0,C2==null?void 0:C2.targetColumn]),O4=O.useRef(),P5=O.useRef(),H9=O.useCallback((H,f)=>{var T;let[M,F]=f;return r4(h0,(T=Y[M])==null?void 0:T.themeOverride,w==null?void 0:w(F),H.themeOverride)},[w,Y,h0]),L9=O.useCallback(H=>{var d1,z1,P1,E1;let f=V5.value?H.metaKey:H.ctrlKey,M=f&&T1==="multi",F=f&&a1==="multi",[T,q]=H.location,I=W.columns,$=W.rows,[X,r1]=(z1=(d1=W.current)==null?void 0:d1.cell)!=null?z1:[];if(H.kind==="cell"){if(P5.current=void 0,J4.current=[T,q],T===0&&G0){if(W2===!0&&q===d||$0==="number"||T1==="none")return;let k1=j0(H.location);if(k1.kind!==l4.Marker)return;if(p4!==void 0){let N1=L0(k1);d0((N1==null?void 0:N1.kind)===l4.Marker);let a2=(P1=N1==null?void 0:N1.onClick)==null?void 0:P1.call(N1,P(y({},H),{cell:k1,posX:H.localEventX,posY:H.localEventY,bounds:H.bounds,theme:H9(k1,H.location),preventDefault:()=>{}}));if(a2===void 0||a2.checked===k1.checked)return}s(void 0),I2();let s2=$.hasIndex(q),p2=O4.current;if(T1==="multi"&&(H.shiftKey||H.isLongTouch===!0)&&p2!==void 0&&$.hasIndex(p2)){let N1=[Math.min(p2,q),Math.max(p2,q)+1];M||z2==="multi"?H0(void 0,N1,!0):H0(x2.fromSingleSelection(N1),void 0,M)}else M||H.isTouch||z2==="multi"?s2?H0($.remove(q),void 0,!0):(H0(void 0,q,!0),O4.current=q):s2&&$.length===1?H0(x2.empty(),void 0,f):(H0(x2.fromSingleSelection(q),void 0,f),O4.current=q)}else if(T>=A&&W2&&q===d){let k1=r7(T);T5(k1!=null?k1:T)}else if(X!==T||r1!==q){let k1=j0(H.location),s2=L0(k1);if((s2==null?void 0:s2.onSelect)!==void 0){let a2=!1;if(s2.onSelect(P(y({},H),{cell:k1,posX:H.localEventX,posY:H.localEventY,bounds:H.bounds,preventDefault:()=>a2=!0,theme:H9(k1,H.location)})),a2)return}let p2=Y4&&q===d,N1=Y4&&W!==void 0&&((E1=W.current)==null?void 0:E1.cell[1])===d;if((H.shiftKey||H.isLongTouch===!0)&&X!==void 0&&r1!==void 0&&W.current!==void 0&&!N1){if(p2)return;let a2=Math.min(T,X),M2=Math.max(T,X),T2=Math.min(q,r1),G2=Math.max(q,r1);g0(P(y({},W.current),{range:{x:a2,y:T2,width:M2-a2+1,height:G2-T2+1}}),!0,f,"click"),O4.current=void 0,I2()}else g0({cell:[T,q],range:{x:T,y:q,width:1,height:1}},!0,f,"click"),O4.current=void 0,s(void 0),I2()}}else if(H.kind==="header")if(J4.current=[T,q],s(void 0),G0&&T===0)O4.current=void 0,P5.current=void 0,T1==="multi"&&($.length!==d?H0(x2.fromSingleSelection([0,d]),void 0,f):H0(x2.empty(),void 0,f),I2());else{let k1=P5.current;if(a1==="multi"&&(H.shiftKey||H.isLongTouch===!0)&&k1!==void 0&&I.hasIndex(k1)){let s2=[Math.min(k1,T),Math.max(k1,T)+1];F?i0(void 0,s2,f):i0(x2.fromSingleSelection(s2),void 0,f)}else F?(I.hasIndex(T)?i0(I.remove(T),void 0,f):i0(void 0,T,f),P5.current=T):a1!=="none"&&(i0(x2.fromSingleSelection(T),void 0,f),P5.current=T);O4.current=void 0,I2()}else H.kind===S0?J4.current=[T,q]:H.kind===l9&&!H.isMaybeScrollbar&&(D0(n3,!1),s(void 0),I2(),Z1==null||Z1(),O4.current=void 0,P5.current=void 0)},[T5,a1,I2,L0,r7,j0,W,G0,Y4,Z1,p4,A,$0,T1,z2,d,g0,D0,i0,H0,W2,H9]),V9=O.useRef(!1),J4=O.useRef(),H6=O.useRef(G1),t4=O.useRef(),ao=O.useCallback(H=>{if(D5.current=!1,H6.current=h1.current,H.button!==0&&H.button!==1){t4.current=void 0;return}let f=performance.now();t4.current={button:H.button,time:f,location:H.location},(H==null?void 0:H.kind)==="header"&&(V9.current=!0);let M=H.kind==="cell"&&H.isFillHandle;!M&&H.kind!=="cell"&&H.isEdge||(C({previousSelection:W,fillHandle:M}),J4.current=void 0,!H.isTouch&&H.button===0&&!M?L9(H):!H.isTouch&&H.button===1&&(J4.current=H.location))},[W,L9]),[Z3,E3]=O.useState(),L6=O.useCallback(H=>{if(H.kind!==S0||a1!=="multi")return;let f=V5.value?H.metaKey:H.ctrlKey,[M]=H.location,F=W.columns;if(M=A&&w5(T.group,Y[$].group);$--)q--;for(let $=M+1;${if(a0!==void 0&&c4!==void 0){let f=h1.current.y,M=h1.current.height,F=a0({x:H,y:f,width:1,height:Math.min(M,d-f)},E0.current.signal);typeof F!="object"&&(F=await F());let T=N0[H-A],I=document.createElement("canvas").getContext("2d",{alpha:!1});if(I!==null){I.font=h0.baseFontFull;let $=r8(I,h0,T,0,F,U0,n4,!1,L0);c4==null||c4(T,$.width,H,$.width)}}},[N0,a0,n4,h0,U0,c4,A,d,L0]),[oo,N3]=O.useState(),A5=O.useCallback(async(H,f)=>{var $,X;let M=($=H.current)==null?void 0:$.range;if(M===void 0||a0===void 0||f.current===void 0)return;let F=f.current.range;if(x!==void 0){let r1=!1;if(x({fillDestination:P(y({},F),{x:F.x-A}),patternSource:P(y({},M),{x:M.x-A}),preventDefault:()=>r1=!0}),r1)return}let T=a0(M,E0.current.signal);typeof T!="object"&&(T=await T());let q=T,I=[];for(let r1=0;r1({cell:r1.location})))},[a0,V0,x,A]),V6=O.useCallback(()=>{if(W.current===void 0||W.current.range.width<=1)return;let H=P(y({},W),{current:P(y({},W.current),{range:P(y({},W.current.range),{width:1})})});A5(H,W)},[A5,W]),d6=O.useCallback(()=>{if(W.current===void 0||W.current.range.height<=1)return;let H=P(y({},W),{current:P(y({},W.current),{range:P(y({},W.current.range),{height:1})})});A5(H,W)},[A5,W]),no=O.useCallback((H,f)=>{var d1,z1,P1;let M=n;if(C(void 0),J0(void 0),N3(void 0),V9.current=!1,f)return;if((M==null?void 0:M.fillHandle)===!0&&W.current!==void 0&&((d1=M.previousSelection)==null?void 0:d1.current)!==void 0){if(v2===void 0)return;let E1=P(y({},W),{current:P(y({},W.current),{range:w8(M.previousSelection.current.range,v2)})});A5(M.previousSelection,E1),D0(E1,!0);return}let[F,T]=H.location,[q,I]=(z1=J4.current)!=null?z1:[],$=()=>{D5.current=!0},X=E1=>{var s2,p2,N1,a2;let k1=E1.isTouch||q===F&&I===T;if(k1&&(Z==null||Z([F-A,T],P(y({},E1),{preventDefault:$}))),E1.button===1)return!D5.current;if(!D5.current){let M2=j0(H.location),T2=L0(M2);if(T2!==void 0&&T2.onClick!==void 0&&k1){let f2=T2.onClick(P(y({},E1),{cell:M2,posX:E1.localEventX,posY:E1.localEventY,bounds:E1.bounds,theme:H9(M2,H.location),preventDefault:$}));f2!==void 0&&!F4(f2)&&W5(f2)&&(V0([{location:E1.location,value:f2}]),(s2=U2.current)==null||s2.damage([{cell:E1.location}]))}if(D5.current||W.current===void 0)return!1;let G2=!1;switch((p2=M2.activationBehaviorOverride)!=null?p2:b1){case"double-click":case"second-click":{if(((a2=(N1=M==null?void 0:M.previousSelection)==null?void 0:N1.current)==null?void 0:a2.cell)===void 0)break;let[f2,K2]=W.current.cell,[w4,M4]=M.previousSelection.current.cell;G2=F===f2&&F===w4&&T===K2&&T===M4&&(E1.isDoubleClick===!0||b1==="second-click");break}case"single-click":{G2=!0;break}}if(G2)return R==null||R([F-A,T]),k5(E1.bounds,!1),!0}return!1},r1=H.location[0]-A;if(H.isTouch){let E1=h1.current,k1=H6.current;if(E1.x!==k1.x||E1.y!==k1.y)return;if(H.isLongTouch===!0){if(H.kind==="cell"&&g5((P1=W.current)==null?void 0:P1.cell,H.location)){Q==null||Q([r1,H.location[1]],P(y({},H),{preventDefault:$}));return}else if(H.kind==="header"&&W.columns.hasIndex(F)){g1==null||g1(r1,P(y({},H),{preventDefault:$}));return}else if(H.kind===S0){if(r1<0)return;G==null||G(r1,P(y({},H),{preventDefault:$}));return}}H.kind==="cell"?X(H)||L9(H):H.kind===S0?K==null||K(r1,P(y({},H),{preventDefault:$})):(H.kind===B4&&(D==null||D(r1,P(y({},H),{preventDefault:$}))),L9(H));return}if(H.kind==="header"){if(r1<0)return;H.isEdge?H.isDoubleClick===!0&&s7(F):H.button===0&&F===q&&T===I&&(D==null||D(r1,P(y({},H),{preventDefault:$})))}if(H.kind===S0){if(r1<0)return;H.button===0&&F===q&&T===I&&(K==null||K(r1,P(y({},H),{preventDefault:$})),D5.current||L6(H))}H.kind==="cell"&&(H.button===0||H.button===1)&&X(H),J4.current=void 0},[n,W,A,v2,A5,D0,Z,j0,L0,b1,H9,V0,R,k5,Q,g1,G,L9,K,D,s7,L6]),Co=O.useCallback(H=>{let f=P(y({},H),{location:[H.location[0]-A,H.location[1]]});H2==null||H2(f),n!==void 0&&H.buttons===0&&(C(void 0),J0(void 0),N3(void 0),V9.current=!1),N3(M=>{var F,T;return V9.current?[H.scrollEdge[0],0]:H.scrollEdge[0]===(M==null?void 0:M[0])&&H.scrollEdge[1]===M[1]?M:n===void 0||((T=(F=t4.current)==null?void 0:F.location[0])!=null?T:0){n1==null||n1(H-A,f)},[n1,A]),i4=(S6=W==null?void 0:W.current)==null?void 0:S6.cell,mo=O.useCallback((H,f,M,F,T,q)=>{r2.current=!1;let I=i4;I!==void 0&&(I=[I[0]-A,I[1]]);let $=f1===0?void 0:{x:0,y:H.y,width:f1,height:H.height},X=[];$!==void 0&&X.push($),m2>0&&(X.push({x:H.x-A,y:d-m2,width:H.width,height:m2}),f1>0&&X.push({x:0,y:d-m2,width:f1,height:m2}));let r1={x:H.x-A,y:H.y,width:H.width,height:W2&&H.y+H.height>=d?H.height-1:H.height,tx:T,ty:q,extras:{selected:I,freezeRegion:$,freezeRegions:X}};h1.current=r1,d2(r1),i7([f,M,F]),Q2==null||Q2(r1,r1.tx,r1.ty,r1.extras)},[i4,A,W2,d,f1,m2,d2,Q2]),ho=m5(y1,O.useCallback((H,f)=>{y1==null||y1(H-A,f-A),a1!=="none"&&i0(x2.fromSingleSelection(f),void 0,!0)},[a1,y1,A,i0])),R3=O.useRef(!1),wo=O.useCallback(H=>{if(H.location[0]===0&&A>0){H.preventDefault();return}U1==null||U1(P(y({},H),{location:[H.location[0]-A,H.location[1]]})),H.defaultPrevented()||(R3.current=!0),C(void 0)},[U1,A]),go=O.useCallback(()=>{R3.current=!1},[]),B3=O.useRef(),z3=O.useCallback(H=>{var f,M,F;if(!l3(H,B3.current)&&(B3.current=H,!(((f=t4==null?void 0:t4.current)==null?void 0:f.button)!==void 0&&t4.current.button>=1))){if(H.buttons!==0&&n!==void 0&&((M=t4.current)==null?void 0:M.location[0])===0&&H.location[0]===0&&A===1&&T1==="multi"&&n.previousSelection&&!n.previousSelection.rows.hasIndex(t4.current.location[1])&&W.rows.hasIndex(t4.current.location[1])){let T=Math.min(t4.current.location[1],H.location[1]),q=Math.max(t4.current.location[1],H.location[1])+1;H0(x2.fromSingleSelection([T,q]),void 0,!1)}if(H.buttons!==0&&n!==void 0&&W.current!==void 0&&!R3.current&&!V9.current&&(i2==="rect"||i2==="multi-rect")){let[T,q]=W.current.cell,[I,$]=H.location;if($<0&&($=h1.current.y),n.fillHandle===!0&&((F=n.previousSelection)==null?void 0:F.current)!==void 0){let X=n.previousSelection.current.range;$=Math.min($,W2?d-1:d);let r1=Zi(X,I,$,L2);J0(r1)}else{if(W2&&q===d)return;if(W2&&$===d)if(H.kind===l9)$--;else return;I=Math.max(I,A);let d1=I-T,z1=$-q,P1={x:d1>=0?T:I,y:z1>=0?q:$,width:Math.abs(d1)+1,height:Math.abs(z1)+1};g0(P(y({},W.current),{range:P1}),!0,!1,"drag")}}M1==null||M1(P(y({},H),{location:[H.location[0]-A,H.location[1]]}))}},[L2,n,A,T1,W,i2,M1,H0,W2,d,g0]),Ho=O.useCallback(()=>{var I,$,X;let H=B3.current;if(H===void 0)return;let[f,M]=H.scrollEdge,[F,T]=H.location,q=h1.current;f===-1?F=(X=($=(I=q.extras)==null?void 0:I.freezeRegion)==null?void 0:$.x)!=null?X:q.x:f===1&&(F=q.x+q.width),M===-1?T=Math.max(0,q.y):M===1&&(T=Math.min(d-1,q.y+q.height)),F=(0,v5.default)(F,0,Y.length-1),T=(0,v5.default)(T,0,d-1),z3(P(y({},H),{location:[F,T]}))},[Y.length,z3,d]);_s(oo,c,Ho);let h4=O.useCallback(H=>{if(W.current===void 0)return;let[f,M]=H,[F,T]=W.current.cell,q=W.current.range,I=q.x,$=q.x+q.width,X=q.y,r1=q.y+q.height;if(M!==0)switch(M){case 2:{r1=d,X=T,r0(0,r1,"vertical");break}case-2:{X=0,r1=T+1,r0(0,X,"vertical");break}case 1:{XT+1?(r1--,r0(0,r1,"vertical")):(X=Math.max(0,X-1),r0(0,X,"vertical"));break}default:l5(M)}if(f!==0)if(f===2)$=Y.length,I=F,r0($-1-A,0,"horizontal");else if(f===-2)I=A,$=F+1,r0(I-A,0,"horizontal");else{let d1=[];if(a0!==void 0){let z1=a0({x:I,y:X,width:$-I-A,height:r1-X},E0.current.signal);typeof z1=="object"&&(d1=aL(z1))}if(f===1){let z1=!1;if(I0){let P1=(0,p5.default)(I+1,F+1).find(E1=>!d1.includes(E1-A));P1!==void 0&&(I=P1,z1=!0)}else I++,z1=!0;z1&&r0(I,0,"horizontal")}z1||($=Math.min(Y.length,$+1),r0($-1-A,0,"horizontal"))}else if(f===-1){let z1=!1;if($>F+1){if(d1.length>0){let P1=(0,p5.default)($-1,F,-1).find(E1=>!d1.includes(E1-A));P1!==void 0&&($=P1,z1=!0)}else $--,z1=!0;z1&&r0($-A,0,"horizontal")}z1||(I=Math.max(A,I-1),r0(I-A,0,"horizontal"))}else l5(f)}g0({cell:W.current.cell,range:{x:I,y:X,width:$-I,height:r1-X}},!0,!1,"keyboard-select")},[a0,W,Y.length,A,d,r0,g0]),_4=O.useCallback((H,f,M,F)=>{let T=O2-(M?0:1);if(H=(0,v5.default)(H,A,N0.length-1+A),f=(0,v5.default)(f,0,T),H===(i4==null?void 0:i4[0])&&f===(i4==null?void 0:i4[1]))return!1;if(F&&W.current!==void 0){let q=[...W.current.rangeStack];(W.current.range.width>1||W.current.range.height>1)&&q.push(W.current.range),D0(P(y({},W),{current:{cell:[H,f],range:{x:H,y:f,width:1,height:1},rangeStack:q}}),!0)}else g0({cell:[H,f],range:{x:H,y:f,width:1,height:1}},!0,!1,"keyboard-nav");return h.current!==void 0&&h.current[0]===H&&h.current[1]===f&&(h.current=void 0),r0(H-A,f),!0},[O2,A,N0.length,i4,W,r0,D0,g0]),Lo=O.useCallback((H,f)=>{(r==null?void 0:r.cell)!==void 0&&H!==void 0&&W5(H)&&(V0([{location:r.cell,value:H}]),window.requestAnimationFrame(()=>{var T;(T=U2.current)==null||T.damage([{cell:r.cell}])})),I2(!0),s(void 0);let[M,F]=f;if(W.current!==void 0&&(M!==0||F!==0)){let T=W.current.cell[1]===O2-1&&H!==void 0;_4((0,v5.default)(W.current.cell[0]+M,0,Y.length-1),(0,v5.default)(W.current.cell[1]+F,0,O2-1),T,!1)}N==null||N(H,f)},[r==null?void 0:r.cell,I2,W,N,V0,O2,_4,Y.length]),Vo=O.useMemo(()=>`gdg-overlay-${sL++}`,[]),e5=O.useCallback(H=>{var M,F,T,q;I2();let f=[];for(let I=H.x;I({cell:I.location})))},[I2,p,L0,V0,A]),d9=r!==void 0,u6=O.useCallback(H=>{var E1,k1,s2,p2;let f=()=>{H.stopPropagation(),H.preventDefault()},M={didMatch:!1},{bounds:F}=H,T=W.columns,q=W.rows,I=C4;if(!d9&&o2(I.clear,H,M))D0(n3,!1),Z1==null||Z1();else if(!d9&&o2(I.selectAll,H,M))D0({columns:x2.empty(),rows:x2.empty(),current:{cell:(k1=(E1=W.current)==null?void 0:E1.cell)!=null?k1:[A,0],range:{x:A,y:0,width:u.length,height:d},rangeStack:[]}},!1);else if(o2(I.search,H,M))(s2=a==null?void 0:a.current)==null||s2.focus({preventScroll:!0}),t7(!0);else if(o2(I.delete,H,M)){let N1=(p2=m4==null?void 0:m4(W))!=null?p2:!0;if(N1!==!1){let a2=N1===!0?W:N1;if(a2.current!==void 0){e5(a2.current.range);for(let M2 of a2.current.rangeStack)e5(M2)}for(let M2 of a2.rows)e5({x:A,y:M2,width:u.length,height:1});for(let M2 of a2.columns)e5({x:M2,y:0,width:1,height:d})}}if(M.didMatch)return f(),!0;if(W.current===void 0)return!1;let[$,X]=W.current.cell,r1=!1,d1=!1;o2(I.scrollToSelectedCell,H,M)?n7.current($-A,X):a1!=="none"&&o2(I.selectColumn,H,M)?T.hasIndex($)?i0(T.remove($),void 0,!0):a1==="single"?i0(x2.fromSingleSelection($),void 0,!0):i0(void 0,$,!0):T1!=="none"&&o2(I.selectRow,H,M)?q.hasIndex(X)?H0(q.remove(X),void 0,!0):T1==="single"?H0(x2.fromSingleSelection(X),void 0,!0):H0(void 0,X,!0):!d9&&F!==void 0&&o2(I.activateCell,H,M)?X===d&&W2?window.setTimeout(()=>{let N1=r7($);T5(N1!=null?N1:$)},0):(R==null||R([$-A,X]),k5(F,!0)):W.current.range.height>1&&o2(I.downFill,H,M)?d6():W.current.range.width>1&&o2(I.rightFill,H,M)?V6():o2(I.goToNextPage,H,M)?X+=Math.max(1,h1.current.height-4):o2(I.goToPreviousPage,H,M)?X-=Math.max(1,h1.current.height-4):o2(I.goToFirstCell,H,M)?(s(void 0),X=0,$=0):o2(I.goToLastCell,H,M)?(s(void 0),X=Number.MAX_SAFE_INTEGER,$=Number.MAX_SAFE_INTEGER):o2(I.selectToFirstCell,H,M)?(s(void 0),h4([-2,-2])):o2(I.selectToLastCell,H,M)?(s(void 0),h4([2,2])):d9?(o2(I.closeOverlay,H,M)&&s(void 0),o2(I.acceptOverlayDown,H,M)&&(s(void 0),X++),o2(I.acceptOverlayUp,H,M)&&(s(void 0),X--),o2(I.acceptOverlayLeft,H,M)&&(s(void 0),$--),o2(I.acceptOverlayRight,H,M)&&(s(void 0),$++)):(o2(I.goDownCell,H,M)?X+=1:o2(I.goUpCell,H,M)?X-=1:o2(I.goRightCell,H,M)?$+=1:o2(I.goLeftCell,H,M)?$-=1:o2(I.goDownCellRetainSelection,H,M)?(X+=1,r1=!0):o2(I.goUpCellRetainSelection,H,M)?(X-=1,r1=!0):o2(I.goRightCellRetainSelection,H,M)?($+=1,r1=!0):o2(I.goLeftCellRetainSelection,H,M)?($-=1,r1=!0):o2(I.goToLastRow,H,M)?X=d-1:o2(I.goToFirstRow,H,M)?X=Number.MIN_SAFE_INTEGER:o2(I.goToLastColumn,H,M)?$=Number.MAX_SAFE_INTEGER:o2(I.goToFirstColumn,H,M)?$=Number.MIN_SAFE_INTEGER:(i2==="rect"||i2==="multi-rect")&&(o2(I.selectGrowDown,H,M)?h4([0,1]):o2(I.selectGrowUp,H,M)?h4([0,-1]):o2(I.selectGrowRight,H,M)?h4([1,0]):o2(I.selectGrowLeft,H,M)?h4([-1,0]):o2(I.selectToLastRow,H,M)?h4([0,2]):o2(I.selectToFirstRow,H,M)?h4([0,-2]):o2(I.selectToLastColumn,H,M)?h4([2,0]):o2(I.selectToFirstColumn,H,M)&&h4([-2,0])),d1=M.didMatch);let z1=_4($,X,!1,r1),P1=M.didMatch;return P1&&(z1||!d1||j9)&&f(),P1},[d9,W,C4,a1,T1,i2,A,d,_4,D0,Z1,u.length,m4,j9,e5,i0,H0,W2,r7,T5,R,k5,d6,V6,h4]),u9=O.useCallback(H=>{let f=!1;if(H1!==void 0&&H1(P(y({},H),{cancel:()=>{f=!0}})),f||u6(H)||W.current===void 0)return;let[M,F]=W.current.cell,T=h1.current;if(Z2&&!H.metaKey&&!H.ctrlKey&&W.current!==void 0&&H.key.length===1&&/[ -~]/g.test(H.key)&&H.bounds!==void 0&&o5(p([M-A,Math.max(0,Math.min(F,d-1))]))){if((!W2||F!==d)&&(T.y>F||F>T.y+T.height||T.x>M||M>T.x+T.width))return;k5(H.bounds,!0,H.key),H.stopPropagation(),H.preventDefault()}},[Z2,H1,u6,W,p,A,d,W2,k5]),uo=O.useCallback((H,f)=>{let M=H.location[0]-A;if(H.kind==="header"&&(g1==null||g1(M,P(y({},H),{preventDefault:f}))),H.kind===S0){if(M<0)return;G==null||G(M,P(y({},H),{preventDefault:f}))}if(H.kind==="cell"){let[F,T]=H.location;Q==null||Q([M,T],P(y({},H),{preventDefault:f})),ht(W,H.location)||_4(F,T,!1,!1)}},[W,Q,G,g1,A,_4]),y3=O.useCallback(async H=>{var I,$,X,r1,d1,z1;if(!C4.paste)return;function f(P1,E1,k1,s2){var N1,a2,M2,T2;let p2=typeof k1=="object"?(N1=k1==null?void 0:k1.join(` `))!=null?N1:"":(a2=k1==null?void 0:k1.toString())!=null?a2:"";if(!F4(P1)&&o5(P1)&&P1.readonly!==!0){let G2=E==null?void 0:E(p2,P1);if(G2!==void 0&&W5(G2))return{location:E1,value:G2};let f2=L0(P1);if(f2===void 0)return;if(f2.kind===c1.Custom){d0(P1.kind===c1.Custom);let K2=(M2=f2.onPaste)==null?void 0:M2.call(f2,p2,P1.data);return K2===void 0?void 0:{location:E1,value:P(y({},P1),{data:K2})}}else{let K2=(T2=f2.onPaste)==null?void 0:T2.call(f2,p2,P1,{formatted:s2,formattedString:typeof s2=="string"?s2:s2==null?void 0:s2.join(` -`),rawValue:k1});return K2===void 0?void 0:(d0(K2.kind===P1.kind),{location:E1,value:K2})}}}let M=W.columns,F=W.rows,T=((I=c.current)==null?void 0:I.contains(document.activeElement))===!0||(($=o.current)==null?void 0:$.contains(document.activeElement))===!0,q;if(W.current!==void 0?q=[W.current.range.x,W.current.range.y]:M.length===1?q=[(X=M.first())!=null?X:0,0]:F.length===1&&(q=[A,(r1=F.first())!=null?r1:0]),T&&q!==void 0){let P1,E1,k1="text/plain",s2="text/html";if(navigator.clipboard.read!==void 0){let M2=await navigator.clipboard.read();for(let T2 of M2){if(T2.types.includes(s2)){let f2=await(await T2.getType(s2)).text(),K2=G8(f2);if(K2!==void 0){P1=K2;break}}T2.types.includes(k1)&&(E1=await(await T2.getType(k1)).text())}}else if(navigator.clipboard.readText!==void 0)E1=await navigator.clipboard.readText();else if(H!==void 0&&(H==null?void 0:H.clipboardData)!==null){if(H.clipboardData.types.includes(s2)){let M2=H.clipboardData.getData(s2);P1=G8(M2)}P1===void 0&&H.clipboardData.types.includes(k1)&&(E1=H.clipboardData.getData(k1))}else return;let[p2,N1]=q,a2=[];do{if(t1===void 0){let M2=j0(q),T2=(d1=E1!=null?E1:P1==null?void 0:P1.map(f2=>f2.map(K2=>K2.rawValue).join(" ")).join(" "))!=null?d1:"",G2=f(M2,q,T2,void 0);G2!==void 0&&a2.push(G2);break}if(P1===void 0){if(E1===void 0)return;P1=Ds(E1)}if(t1===!1||typeof t1=="function"&&(t1==null?void 0:t1([q[0]-A,q[1]],P1.map(M2=>M2.map(T2=>{var G2,f2;return(f2=(G2=T2.rawValue)==null?void 0:G2.toString())!=null?f2:""}))))!==!0)return;for(let[M2,T2]of P1.entries()){if(M2+N1>=d)break;for(let[G2,f2]of T2.entries()){let K2=[G2+p2,M2+N1],[w4,M4]=K2;if(w4>=Y.length||M4>=O2)continue;let t5=j0(K2),i5=f(t5,K2,f2.rawValue,f2.formatted);i5!==void 0&&a2.push(i5)}}}while(!1);V0(a2),(z1=U2.current)==null||z1.damage(a2.map(M2=>({cell:M2.location})))}},[E,L0,j0,W,C4.paste,Y.length,V0,O2,t1,A,d]);n0("paste",y3,g,!1,!0);let v9=O.useCallback(async(H,f)=>{var I,$;if(!C4.copy)return;let M=f===!0||((I=c.current)==null?void 0:I.contains(document.activeElement))===!0||(($=o.current)==null?void 0:$.contains(document.activeElement))===!0,F=W.columns,T=W.rows,q=(X,r1)=>{if(!V1)K8(X,r1,H);else{let d1=r1.map(z1=>({kind:c1.Text,data:u[z1].title,displayData:u[z1].title,allowOverlay:!1}));K8([d1,...X],r1,H)}};if(M&&a0!==void 0){if(W.current!==void 0){let X=a0(W.current.range,E0.current.signal);typeof X!="object"&&(X=await X()),q(X,(0,p5.default)(W.current.range.x-A,W.current.range.x+W.current.range.width-A))}else if(T!==void 0&&T.length>0){let r1=[...T].map(d1=>{let z1=a0({x:A,y:d1,width:u.length,height:1},E0.current.signal);return typeof z1=="object"?z1[0]:z1().then(P1=>P1[0])});if(r1.some(d1=>d1 instanceof Promise)){let d1=await Promise.all(r1);q(d1,(0,p5.default)(u.length))}else q(r1,(0,p5.default)(u.length))}else if(F.length>0){let X=[],r1=[];for(let d1 of F){let z1=a0({x:d1,y:0,width:1,height:d},E0.current.signal);typeof z1!="object"&&(z1=await z1()),X.push(z1),r1.push(d1-A)}if(X.length===1)q(X[0],r1);else{let d1=X.reduce((z1,P1)=>z1.map((E1,k1)=>[...E1,...P1[k1]]));q(d1,r1)}}}},[u,a0,W,C4.copy,A,d,V1]);n0("copy",v9,g,!1,!1);let vo=O.useCallback(async H=>{var M,F;if(!(!C4.cut||!(((M=c.current)==null?void 0:M.contains(document.activeElement))===!0||((F=o.current)==null?void 0:F.contains(document.activeElement))===!0))&&(await v9(H),W.current!==void 0)){let T={current:{cell:W.current.cell,range:W.current.range,rangeStack:[]},rows:x2.empty(),columns:x2.empty()},q=m4==null?void 0:m4(T);if(q===!1||(T=q===!0?T:q,T.current===void 0))return;e5(T.current.range)}},[e5,W,C4.cut,v9,m4]);n0("cut",vo,g,!1,!1);let po=O.useCallback((H,f)=>{if(J!==void 0){A!==0&&(H=H.map(T=>[T[0]-A,T[1]])),J(H,f);return}if(H.length===0||f===-1)return;let[M,F]=H[f];h.current!==void 0&&h.current[0]===M&&h.current[1]===F||(h.current=[M,F],_4(M,F,!1,!1))},[J,A,_4]),[a7,o7]=(T6=(k6=e0==null?void 0:e0.current)==null?void 0:k6.cell)!=null?T6:[],n7=O.useRef(r0);n7.current=r0,O.useLayoutEffect(()=>{var H,f,M,F;!r2.current&&a7!==void 0&&o7!==void 0&&(a7!==((f=(H=A4.current)==null?void 0:H.current)==null?void 0:f.cell[0])||o7!==((F=(M=A4.current)==null?void 0:M.current)==null?void 0:F.cell[1]))&&n7.current(a7,o7),r2.current=!1},[a7,o7]);let v6=W.current!==void 0&&(W.current.cell[0]>=Y.length||W.current.cell[1]>=O2);O.useLayoutEffect(()=>{v6&&D0(n3,!1)},[v6,D0]);let Mo=O.useMemo(()=>W2===!0&&(C2==null?void 0:C2.tint)===!0?x2.fromSingleSelection(O2-1):x2.empty(),[O2,W2,C2==null?void 0:C2.tint]),xo=O.useCallback(H=>{var f;return typeof F2=="boolean"?F2:(f=F2==null?void 0:F2(H-A))!=null?f:!0},[A,F2]),fo=O.useMemo(()=>{if(Z3===void 0||o.current===null)return null;let{bounds:H,group:f}=Z3,M=o.current.getBoundingClientRect();return O.createElement(Bs,{bounds:H,group:f,canvasBounds:M,onClose:()=>E3(void 0),onFinish:F=>{E3(void 0),s1==null||s1(f,F)}})},[s1,Z3]),Zo=Math.min(Y.length,f1+(G0?1:0));O.useImperativeHandle(t,()=>({appendRow:(H,f)=>T5(H+A,f),updateCells:H=>{var f;return A!==0&&(H=H.map(M=>({cell:[M.cell[0]+A,M.cell[1]]}))),(f=U2.current)==null?void 0:f.damage(H)},getBounds:(H,f)=>{var M;if(!((o==null?void 0:o.current)===null||(c==null?void 0:c.current)===null)){if(H===void 0&&f===void 0){let F=o.current.getBoundingClientRect(),T=F.width/c.current.clientWidth;return{x:F.x-c.current.scrollLeft*T,y:F.y-c.current.scrollTop*T,width:c.current.scrollWidth*T,height:c.current.scrollHeight*T}}return(M=U2.current)==null?void 0:M.getBounds((H!=null?H:0)+A,f)}},focus:()=>{var H;return(H=U2.current)==null?void 0:H.focus()},emit:async H=>{switch(H){case"delete":u9({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":u9({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":u9({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 v9(void 0,!0);break;case"paste":await y3();break}},scrollTo:r0,remeasureColumns:H=>{for(let f of H)s7(f+A)}}),[T5,s7,v9,u9,y3,A,r0]);let[p6,M6]=i4!=null?i4:[],Eo=O.useCallback(H=>{let[f,M]=H;if(M===-1){a1!=="none"&&(i0(x2.fromSingleSelection(f),void 0,!1),I2());return}p6===f&&M6===M||(g0({cell:H,range:{x:f,y:M,width:1,height:1}},!0,!1,"keyboard-nav"),r0(f,M))},[a1,I2,r0,p6,M6,g0,i0]),[No,Ro]=O.useState(!1),x6=O.useRef((0,Xs.default)(H=>{Ro(H)},5)),Bo=O.useCallback(()=>{x6.current(!0),W.current===void 0&&W.columns.length===0&&W.rows.length===0&&n===void 0&&g0({cell:[A,$2],range:{x:A,y:$2,width:1,height:1}},!0,!1,"keyboard-select")},[$2,W,n,A,g0]),zo=O.useCallback(()=>{x6.current(!1)},[]),[yo,bo]=O.useMemo(()=>{var T;let H,f=(T=j1==null?void 0:j1.scrollbarWidthOverride)!=null?T:z9(),M=d+(W2?1:0);if(typeof B0=="number")H=x1+M*B0;else{let q=0,I=Math.min(M,10);for(let $=0;$I.width+q,0)+f;return[`${Math.min(1e5,F)}px`,`${Math.min(1e5,H)}px`]},[Y,j1==null?void 0:j1.scrollbarWidthOverride,B0,d,W2,x1]),Fo=O.useMemo(()=>j6(h0),[h0]);return O.createElement(Y6.Provider,{value:h0},O.createElement(Os,{style:Fo,className:m1,inWidth:v!=null?v:yo,inHeight:V!=null?V:bo},O.createElement(Rs,{fillHandle:X1,drawFocusRing:N2,experimental:j1,fixedShadowX:Q0,fixedShadowY:v4,getRowThemeOverride:w,headerIcons:P0,imageWindowLoader:q0,initialSize:z4,isDraggable:K9,onDragLeave:X9,onRowMoved:p4,overscrollX:V3,overscrollY:e7,preventDiagonalScrolling:E5,rightElement:j4,rightElementProps:T4,smoothScrollX:Y9,smoothScrollY:w3,className:m1,enableGroups:j,onCanvasFocused:Bo,onCanvasBlur:zo,canvasRef:o,onContextMenu:uo,theme:h0,cellXOffset:K0,cellYOffset:$2,accessibilityHeight:G1.height,onDragEnd:go,columns:Y,nonGrowWidth:z,drawHeader:p3,onColumnProposeMove:B,drawCell:M3,disabledRows:Mo,freezeColumns:Zo,lockColumns:A,firstColAccessible:A===0,getCellContent:j0,minColumnWidth:U0,maxColumnWidth:n4,searchInputRef:a,showSearch:m9,onSearchClose:u3,highlightRegions:Q4,getCellsForSelection:a0,getGroupDetails:x3,headerHeight:y5,isFocused:No,groupHeaderHeight:j?c9:0,freezeTrailingRows:m2+(W2&&(C2==null?void 0:C2.sticky)===!0?1:0),hasAppendRow:W2,onColumnResize:c4,onColumnResizeEnd:v3,onColumnResizeStart:F5,onCellFocused:Eo,onColumnMoved:ho,onDragStart:wo,onHeaderMenuClick:co,onItemHovered:z3,isFilling:(n==null?void 0:n.fillHandle)===!0,onMouseMove:Co,onKeyDown:u9,onKeyUp:W1,onMouseDown:ao,onMouseUp:no,onDragOverCell:Z0,onDrop:o4,onSearchResultsChanged:po,onVisibleRegionChanged:mo,clientSize:S5,rowHeight:B0,searchResults:I1,searchValue:e2,onSearchValueChange:p1,rows:O2,scrollRef:c,selection:W,translateX:G1.tx,translateY:G1.ty,verticalBorder:xo,gridRef:U2,getCellRenderer:L0}),fo,r!==void 0&&O.createElement(O.Suspense,{fallback:null},O.createElement(rL,P(y({},r),{validateCell:w9,bloom:b,id:Vo,getCellRenderer:L0,className:(j1==null?void 0:j1.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:k0,imageEditorOverride:m,onFinishEditing:Lo,markdownDivCreateNode:L,isOutsideClick:Q9})))))},js=O.forwardRef(oL);var Ys=20,Qs={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:"false"},kind:c1.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>{var t;return nL(e,e.cell.data,f9(e.cell),(t=e.cell.maxSize)!=null?t:Ys)},onDelete:e=>P(y({},e),{data:!1}),onClick:e=>{var v,V;let{cell:t,posX:i,posY:l,bounds:r,theme:s}=e,{width:a,height:o,x:n,y:C}=r,c=(v=t.maxSize)!=null?v:Ys,h=Math.floor(r.y+o/2),g=F7(c,o,s.cellVerticalPadding),m=b7((V=t.contentAlign)!=null?V:"center",n,a,s.cellHorizontalPadding,g),w=y7(m,h,g),L=S7(n+i,C+l,w);if(f9(t)&&L)return P(y({},t),{data:a3(t.data)})},onPaste:(e,t)=>{let i=O5;return e.toLowerCase()==="true"?i=!0:e.toLowerCase()==="false"?i=!1:e.toLowerCase()==="indeterminate"&&(i=_5),i===t.data?void 0:P(y({},t),{data:i})}};function nL(e,t,i,l){if(!i&&t===O5)return;let{ctx:r,hoverAmount:s,theme:a,rect:o,highlighted:n,hoverX:C,hoverY:c,cell:{contentAlign:h}}=e,{x:g,y:m,width:w,height:L}=o,v=.35,V=i?1-v+v*s:.4;t===O5&&(V*=s),V!==0&&(r.globalAlpha=V,j5(r,a,t,g,m,w,L,n,C,c,l,h),r.globalAlpha=1)}var ta=F1(Y1(),1);var C3=F1(Y1(),1);var Js=X2("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1});var CL=e=>{let{bubbles:t}=e;return C3.createElement(Js,null,t.map((i,l)=>C3.createElement("div",{key:l,className:"boe-bubble"},i)),C3.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},ea=CL;var ia={getAccessibilityString:e=>k7(e.data),kind:c1.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,i)=>t.data.reduce((l,r)=>e.measureText(r).width+l+20,0)+2*i.cellHorizontalPadding-4,draw:e=>mL(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return ta.createElement(ea,{bubbles:t.data})},onPaste:()=>{}},cL=4;function mL(e,t){var L;let{rect:i,theme:l,ctx:r,highlighted:s}=e,{x:a,y:o,width:n,height:C}=i,c=20,h=8,g=cL,m=a+l.cellHorizontalPadding,w=[];for(let v of t){if(m>a+n)break;let V=E4(v,r,l.baseFontFull).width;w.push({x:m,width:V}),m+=V+h*2+g}r.beginPath();for(let v of w)f0(r,v.x,o+(C-c)/2,v.width+h*2,c,(L=l.roundingRadius)!=null?L:c/2);r.fillStyle=s?l.bgBubbleSelected:l.bgBubble,r.fill();for(let[v,V]of w.entries())r.beginPath(),r.fillStyle=l.textBubble,r.fillText(t[v],V.x+h,o+C/2+x0(r,l))}var ra=F1(Y1(),1);var U9=F1(Y1(),1);var hL=X2("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),wL=e=>{let{drilldowns:t}=e;return U9.createElement(hL,null,t.map((i,l)=>U9.createElement("div",{key:l,className:"doe-bubble"},i.img!==void 0&&U9.createElement("img",{src:i.img}),U9.createElement("div",null,i.text))))},la=wL;var sa={getAccessibilityString:e=>k7(e.data.map(t=>t.text)),kind:c1.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,i)=>t.data.reduce((l,r)=>e.measureText(r.text).width+l+20+(r.img!==void 0?18:0),0)+2*i.cellHorizontalPadding-4,draw:e=>LL(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return ra.createElement(la,{drilldowns:t.data})},onPaste:()=>{}},gL=4,Q8={};function HL(e,t,i,l){let r=Math.ceil(window.devicePixelRatio),s=5,a=i-s*2,o=4,n=i*r,C=l+s,c=l*3,h=(c+s*2)*r,g=`${e},${t},${r},${i}`;if(Q8[g]!==void 0)return{el:Q8[g],height:n,width:h,middleWidth:o*r,sideWidth:C*r,padding:s*r,dpr:r};let m=document.createElement("canvas"),w=m.getContext("2d");return w===null?null:(m.width=h,m.height=n,w.scale(r,r),Q8[g]=m,w.beginPath(),f0(w,s,s,c,a,l),w.shadowColor="rgba(24, 25, 34, 0.4)",w.shadowBlur=1,w.fillStyle=e,w.fill(),w.shadowColor="rgba(24, 25, 34, 0.3)",w.shadowOffsetY=1,w.shadowBlur=5,w.fillStyle=e,w.fill(),w.shadowOffsetY=0,w.shadowBlur=0,w.shadowBlur=0,w.beginPath(),f0(w,s+.5,s+.5,c,a,l),w.strokeStyle=t,w.lineWidth=1,w.stroke(),{el:m,height:n,width:h,sideWidth:C*r,middleWidth:l*r,padding:s*r,dpr:r})}function LL(e,t){var Z,R;let{rect:i,theme:l,ctx:r,imageLoader:s,col:a,row:o}=e,{x:n,width:C}=i,c=l.baseFontFull,h=e8(r,c),g=Math.min(i.height,Math.max(16,Math.ceil(h*l.lineHeight)*2)),m=Math.floor(i.y+(i.height-g)/2),w=g-10,L=8,v=gL,V=n+l.cellHorizontalPadding,u=(Z=l.roundingRadius)!=null?Z:6,d=HL(l.bgCell,l.drilldownBorder,g,u),p=[];for(let x of t){if(V>n+C)break;let E=E4(x.text,r,c).width,S=0;x.img!==void 0&&s.loadOrGetImage(x.img,a,o)!==void 0&&(S=w-8+4);let k=E+S+L*2;p.push({x:V,width:k}),V+=k+v}if(d!==null){let{el:x,height:N,middleWidth:E,sideWidth:S,width:k,dpr:b,padding:D}=d,B=S/b,_=D/b;for(let K of p){let Q=Math.floor(K.x),m1=Math.floor(K.width),g1=m1-(B-_)*2;r.imageSmoothingEnabled=!1,r.drawImage(x,0,0,S,N,Q-_,m,B,g),g1>0&&r.drawImage(x,S,0,E,N,Q+(B-_),m,g1,g),r.drawImage(x,k-S,0,S,N,Q+m1-(B-_),m,B,g),r.imageSmoothingEnabled=!0}}r.beginPath();for(let[x,N]of p.entries()){let E=t[x],S=N.x+L;if(E.img!==void 0){let k=s.loadOrGetImage(E.img,a,o);if(k!==void 0){let b=w-8,D=0,B=0,_=k.width,K=k.height;_>K?(D+=(_-K)/2,_=K):K>_&&(B+=(K-_)/2,K=_),r.beginPath(),f0(r,S,m+g/2-b/2,b,b,(R=l.roundingRadius)!=null?R:3),r.save(),r.clip(),r.drawImage(k,D,B,_,K,S,m+g/2-b/2,b,b),r.restore(),S+=b+4}}r.beginPath(),r.fillStyle=l.textBubble,r.fillText(E.text,S,m+g/2+x0(r,l))}}var aa=F1(Y1(),1);var oa={getAccessibilityString:e=>e.data.join(", "),kind:c1.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>{var t,i,l;return VL(e,(t=e.cell.displayData)!=null?t:e.cell.data,(l=(i=e.cell.rounding)!=null?i:e.theme.roundingRadius)!=null?l:4,e.cell.contentAlign)},measure:(e,t)=>t.data.length*50,onDelete:e=>P(y({},e),{data:[]}),provideEditor:()=>e=>{let{value:t,onFinishedEditing:i,imageEditorOverride:l}=e,r=l!=null?l:qe;return aa.createElement(r,{urls:t.data,canWrite:t.readonly!==!1,onCancel:i,onChange:s=>{i(P(y({},t),{data:[s]}))}})},onPaste:(e,t)=>{e=e.trim();let l=e.split(",").map(r=>{try{return new URL(r),r}catch(s){return}}).filter(r=>r!==void 0);if(!(l.length===t.data.length&&l.every((r,s)=>r===t.data[s])))return P(y({},t),{data:l})}},J8=4;function VL(e,t,i,l){let{rect:r,col:s,row:a,theme:o,ctx:n,imageLoader:C}=e,{x:c,y:h,height:g,width:m}=r,w=g-o.cellVerticalPadding*2,L=[],v=0;for(let u=0;u0&&(n.beginPath(),f0(n,V,h+o.cellVerticalPadding,d,w,i),n.save(),n.clip()),n.drawImage(u,V,h+o.cellVerticalPadding,d,w),i>0&&n.restore(),V+=d+J8}}function dL(e,t){let i=e*49632+t*325176;return i^=i<<13,i^=i>>17,i^=i<<5,i/4294967295*2}var na={getAccessibilityString:()=>"",kind:c1.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{var c,h;let{cell:t,col:i,row:l,ctx:r,rect:s,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let o=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(o+=Math.round(dL(i,l)*t.skeletonWidthVariability));let n=a.cellHorizontalPadding,C=(c=t.skeletonHeight)!=null?c:Math.min(18,s.height-2*a.cellVerticalPadding);f0(r,s.x+n,s.y+(s.height-C)/2,o,C,(h=a.roundingRadius)!=null?h:3),r.fillStyle=z0(a.textDark,.1),r.fill()},onPaste:()=>{}};var ca=F1(Y1(),1);var v0=F1(Y1(),1);var uL=()=>e=>e.targetWidth,e6=X2("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[uL(),"px"]}});var Ca=e=>{let{value:t,onChange:i,forceEditMode:l,createNode:r,targetRect:s,onFinish:a,validatedSelection:o}=e,n=t.data,C=t.readonly===!0,[c,h]=v0.useState(n===""||l),g=v0.useCallback(()=>{h(w=>!w)},[]),m=n?"gdg-ml-6":"";return c?v0.createElement(e6,{targetWidth:s.width-20},v0.createElement($4,{autoFocus:!0,highlight:!1,validatedSelection:o,value:n,onKeyDown:w=>{w.key==="Enter"&&w.stopPropagation()},onChange:i}),v0.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${m}`,onClick:()=>a(t)},v0.createElement(Ae,null))):v0.createElement(e6,{targetWidth:s.width},v0.createElement(F9,{contents:n,createNode:r}),!C&&v0.createElement(v0.Fragment,null,v0.createElement("div",{className:"spacer"}),v0.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${m}`,onClick:g},v0.createElement(q5,null))),v0.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))};var ma={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:""},kind:c1.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:N4,measure:(e,t,i)=>{let l=t.data.split(` +`),rawValue:k1});return K2===void 0?void 0:(d0(K2.kind===P1.kind),{location:E1,value:K2})}}}let M=W.columns,F=W.rows,T=((I=c.current)==null?void 0:I.contains(document.activeElement))===!0||(($=o.current)==null?void 0:$.contains(document.activeElement))===!0,q;if(W.current!==void 0?q=[W.current.range.x,W.current.range.y]:M.length===1?q=[(X=M.first())!=null?X:0,0]:F.length===1&&(q=[A,(r1=F.first())!=null?r1:0]),T&&q!==void 0){let P1,E1,k1="text/plain",s2="text/html";if(navigator.clipboard.read!==void 0){let M2=await navigator.clipboard.read();for(let T2 of M2){if(T2.types.includes(s2)){let f2=await(await T2.getType(s2)).text(),K2=G8(f2);if(K2!==void 0){P1=K2;break}}T2.types.includes(k1)&&(E1=await(await T2.getType(k1)).text())}}else if(navigator.clipboard.readText!==void 0)E1=await navigator.clipboard.readText();else if(H!==void 0&&(H==null?void 0:H.clipboardData)!==null){if(H.clipboardData.types.includes(s2)){let M2=H.clipboardData.getData(s2);P1=G8(M2)}P1===void 0&&H.clipboardData.types.includes(k1)&&(E1=H.clipboardData.getData(k1))}else return;let[p2,N1]=q,a2=[];do{if(t1===void 0){let M2=j0(q),T2=(d1=E1!=null?E1:P1==null?void 0:P1.map(f2=>f2.map(K2=>K2.rawValue).join(" ")).join(" "))!=null?d1:"",G2=f(M2,q,T2,void 0);G2!==void 0&&a2.push(G2);break}if(P1===void 0){if(E1===void 0)return;P1=Ds(E1)}if(t1===!1||typeof t1=="function"&&(t1==null?void 0:t1([q[0]-A,q[1]],P1.map(M2=>M2.map(T2=>{var G2,f2;return(f2=(G2=T2.rawValue)==null?void 0:G2.toString())!=null?f2:""}))))!==!0)return;for(let[M2,T2]of P1.entries()){if(M2+N1>=d)break;for(let[G2,f2]of T2.entries()){let K2=[G2+p2,M2+N1],[w4,M4]=K2;if(w4>=Y.length||M4>=O2)continue;let t5=j0(K2),i5=f(t5,K2,f2.rawValue,f2.formatted);i5!==void 0&&a2.push(i5)}}}while(!1);V0(a2),(z1=U2.current)==null||z1.damage(a2.map(M2=>({cell:M2.location})))}},[E,L0,j0,W,C4.paste,Y.length,V0,O2,t1,A,d]);n0("paste",y3,g,!1,!0);let v9=O.useCallback(async(H,f)=>{var I,$;if(!C4.copy)return;let M=f===!0||((I=c.current)==null?void 0:I.contains(document.activeElement))===!0||(($=o.current)==null?void 0:$.contains(document.activeElement))===!0,F=W.columns,T=W.rows,q=(X,r1)=>{if(!L1)K8(X,r1,H);else{let d1=r1.map(z1=>({kind:c1.Text,data:u[z1].title,displayData:u[z1].title,allowOverlay:!1}));K8([d1,...X],r1,H)}};if(M&&a0!==void 0){if(W.current!==void 0){let X=a0(W.current.range,E0.current.signal);typeof X!="object"&&(X=await X()),q(X,(0,p5.default)(W.current.range.x-A,W.current.range.x+W.current.range.width-A))}else if(T!==void 0&&T.length>0){let r1=[...T].map(d1=>{let z1=a0({x:A,y:d1,width:u.length,height:1},E0.current.signal);return typeof z1=="object"?z1[0]:z1().then(P1=>P1[0])});if(r1.some(d1=>d1 instanceof Promise)){let d1=await Promise.all(r1);q(d1,(0,p5.default)(u.length))}else q(r1,(0,p5.default)(u.length))}else if(F.length>0){let X=[],r1=[];for(let d1 of F){let z1=a0({x:d1,y:0,width:1,height:d},E0.current.signal);typeof z1!="object"&&(z1=await z1()),X.push(z1),r1.push(d1-A)}if(X.length===1)q(X[0],r1);else{let d1=X.reduce((z1,P1)=>z1.map((E1,k1)=>[...E1,...P1[k1]]));q(d1,r1)}}}},[u,a0,W,C4.copy,A,d,L1]);n0("copy",v9,g,!1,!1);let vo=O.useCallback(async H=>{var M,F;if(!(!C4.cut||!(((M=c.current)==null?void 0:M.contains(document.activeElement))===!0||((F=o.current)==null?void 0:F.contains(document.activeElement))===!0))&&(await v9(H),W.current!==void 0)){let T={current:{cell:W.current.cell,range:W.current.range,rangeStack:[]},rows:x2.empty(),columns:x2.empty()},q=m4==null?void 0:m4(T);if(q===!1||(T=q===!0?T:q,T.current===void 0))return;e5(T.current.range)}},[e5,W,C4.cut,v9,m4]);n0("cut",vo,g,!1,!1);let po=O.useCallback((H,f)=>{if(J!==void 0){A!==0&&(H=H.map(T=>[T[0]-A,T[1]])),J(H,f);return}if(H.length===0||f===-1)return;let[M,F]=H[f];h.current!==void 0&&h.current[0]===M&&h.current[1]===F||(h.current=[M,F],_4(M,F,!1,!1))},[J,A,_4]),[a7,o7]=(T6=(k6=e0==null?void 0:e0.current)==null?void 0:k6.cell)!=null?T6:[],n7=O.useRef(r0);n7.current=r0,O.useLayoutEffect(()=>{var H,f,M,F;!r2.current&&a7!==void 0&&o7!==void 0&&(a7!==((f=(H=A4.current)==null?void 0:H.current)==null?void 0:f.cell[0])||o7!==((F=(M=A4.current)==null?void 0:M.current)==null?void 0:F.cell[1]))&&n7.current(a7,o7),r2.current=!1},[a7,o7]);let v6=W.current!==void 0&&(W.current.cell[0]>=Y.length||W.current.cell[1]>=O2);O.useLayoutEffect(()=>{v6&&D0(n3,!1)},[v6,D0]);let Mo=O.useMemo(()=>W2===!0&&(C2==null?void 0:C2.tint)===!0?x2.fromSingleSelection(O2-1):x2.empty(),[O2,W2,C2==null?void 0:C2.tint]),xo=O.useCallback(H=>{var f;return typeof F2=="boolean"?F2:(f=F2==null?void 0:F2(H-A))!=null?f:!0},[A,F2]),fo=O.useMemo(()=>{if(Z3===void 0||o.current===null)return null;let{bounds:H,group:f}=Z3,M=o.current.getBoundingClientRect();return O.createElement(Bs,{bounds:H,group:f,canvasBounds:M,onClose:()=>E3(void 0),onFinish:F=>{E3(void 0),s1==null||s1(f,F)}})},[s1,Z3]),Zo=Math.min(Y.length,f1+(G0?1:0));O.useImperativeHandle(t,()=>({appendRow:(H,f)=>T5(H+A,f),updateCells:H=>{var f;return A!==0&&(H=H.map(M=>({cell:[M.cell[0]+A,M.cell[1]]}))),(f=U2.current)==null?void 0:f.damage(H)},getBounds:(H,f)=>{var M;if(!((o==null?void 0:o.current)===null||(c==null?void 0:c.current)===null)){if(H===void 0&&f===void 0){let F=o.current.getBoundingClientRect(),T=F.width/c.current.clientWidth;return{x:F.x-c.current.scrollLeft*T,y:F.y-c.current.scrollTop*T,width:c.current.scrollWidth*T,height:c.current.scrollHeight*T}}return(M=U2.current)==null?void 0:M.getBounds((H!=null?H:0)+A,f)}},focus:()=>{var H;return(H=U2.current)==null?void 0:H.focus()},emit:async H=>{switch(H){case"delete":u9({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":u9({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":u9({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 v9(void 0,!0);break;case"paste":await y3();break}},scrollTo:r0,remeasureColumns:H=>{for(let f of H)s7(f+A)}}),[T5,s7,v9,u9,y3,A,r0]);let[p6,M6]=i4!=null?i4:[],Eo=O.useCallback(H=>{let[f,M]=H;if(M===-1){a1!=="none"&&(i0(x2.fromSingleSelection(f),void 0,!1),I2());return}p6===f&&M6===M||(g0({cell:H,range:{x:f,y:M,width:1,height:1}},!0,!1,"keyboard-nav"),r0(f,M))},[a1,I2,r0,p6,M6,g0,i0]),[No,Ro]=O.useState(!1),x6=O.useRef((0,Xs.default)(H=>{Ro(H)},5)),Bo=O.useCallback(()=>{x6.current(!0),W.current===void 0&&W.columns.length===0&&W.rows.length===0&&n===void 0&&g0({cell:[A,$2],range:{x:A,y:$2,width:1,height:1}},!0,!1,"keyboard-select")},[$2,W,n,A,g0]),zo=O.useCallback(()=>{x6.current(!1)},[]),[yo,bo]=O.useMemo(()=>{var T;let H,f=(T=j1==null?void 0:j1.scrollbarWidthOverride)!=null?T:z9(),M=d+(W2?1:0);if(typeof B0=="number")H=x1+M*B0;else{let q=0,I=Math.min(M,10);for(let $=0;$I.width+q,0)+f;return[`${Math.min(1e5,F)}px`,`${Math.min(1e5,H)}px`]},[Y,j1==null?void 0:j1.scrollbarWidthOverride,B0,d,W2,x1]),Fo=O.useMemo(()=>j6(h0),[h0]);return O.createElement(Y6.Provider,{value:h0},O.createElement(Os,{style:Fo,className:m1,inWidth:v!=null?v:yo,inHeight:V!=null?V:bo},O.createElement(Rs,{fillHandle:X1,drawFocusRing:N2,experimental:j1,fixedShadowX:Q0,fixedShadowY:v4,getRowThemeOverride:w,headerIcons:P0,imageWindowLoader:q0,initialSize:z4,isDraggable:K9,onDragLeave:X9,onRowMoved:p4,overscrollX:V3,overscrollY:e7,preventDiagonalScrolling:E5,rightElement:j4,rightElementProps:T4,smoothScrollX:Y9,smoothScrollY:w3,className:m1,enableGroups:j,onCanvasFocused:Bo,onCanvasBlur:zo,canvasRef:o,onContextMenu:uo,theme:h0,cellXOffset:K0,cellYOffset:$2,accessibilityHeight:G1.height,onDragEnd:go,columns:Y,nonGrowWidth:z,drawHeader:p3,onColumnProposeMove:B,drawCell:M3,disabledRows:Mo,freezeColumns:Zo,lockColumns:A,firstColAccessible:A===0,getCellContent:j0,minColumnWidth:U0,maxColumnWidth:n4,searchInputRef:a,showSearch:m9,onSearchClose:u3,highlightRegions:Q4,getCellsForSelection:a0,getGroupDetails:x3,headerHeight:y5,isFocused:No,groupHeaderHeight:j?c9:0,freezeTrailingRows:m2+(W2&&(C2==null?void 0:C2.sticky)===!0?1:0),hasAppendRow:W2,onColumnResize:c4,onColumnResizeEnd:v3,onColumnResizeStart:F5,onCellFocused:Eo,onColumnMoved:ho,onDragStart:wo,onHeaderMenuClick:co,onItemHovered:z3,isFilling:(n==null?void 0:n.fillHandle)===!0,onMouseMove:Co,onKeyDown:u9,onKeyUp:W1,onMouseDown:ao,onMouseUp:no,onDragOverCell:Z0,onDrop:o4,onSearchResultsChanged:po,onVisibleRegionChanged:mo,clientSize:S5,rowHeight:B0,searchResults:I1,searchValue:e2,onSearchValueChange:p1,rows:O2,scrollRef:c,selection:W,translateX:G1.tx,translateY:G1.ty,verticalBorder:xo,gridRef:U2,getCellRenderer:L0}),fo,r!==void 0&&O.createElement(O.Suspense,{fallback:null},O.createElement(rL,P(y({},r),{validateCell:w9,bloom:b,id:Vo,getCellRenderer:L0,className:(j1==null?void 0:j1.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:k0,imageEditorOverride:m,onFinishEditing:Lo,markdownDivCreateNode:L,isOutsideClick:Q9})))))},js=O.forwardRef(oL);var Ys=20,Qs={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:"false"},kind:c1.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>{var t;return nL(e,e.cell.data,f9(e.cell),(t=e.cell.maxSize)!=null?t:Ys)},onDelete:e=>P(y({},e),{data:!1}),onClick:e=>{var v,V;let{cell:t,posX:i,posY:l,bounds:r,theme:s}=e,{width:a,height:o,x:n,y:C}=r,c=(v=t.maxSize)!=null?v:Ys,h=Math.floor(r.y+o/2),g=F7(c,o,s.cellVerticalPadding),m=b7((V=t.contentAlign)!=null?V:"center",n,a,s.cellHorizontalPadding,g),w=y7(m,h,g),L=S7(n+i,C+l,w);if(f9(t)&&L)return P(y({},t),{data:a3(t.data)})},onPaste:(e,t)=>{let i=O5;return e.toLowerCase()==="true"?i=!0:e.toLowerCase()==="false"?i=!1:e.toLowerCase()==="indeterminate"&&(i=_5),i===t.data?void 0:P(y({},t),{data:i})}};function nL(e,t,i,l){if(!i&&t===O5)return;let{ctx:r,hoverAmount:s,theme:a,rect:o,highlighted:n,hoverX:C,hoverY:c,cell:{contentAlign:h}}=e,{x:g,y:m,width:w,height:L}=o,v=.35,V=i?1-v+v*s:.4;t===O5&&(V*=s),V!==0&&(r.globalAlpha=V,j5(r,a,t,g,m,w,L,n,C,c,l,h),r.globalAlpha=1)}var ta=F1(Y1(),1);var C3=F1(Y1(),1);var Js=X2("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1});var CL=e=>{let{bubbles:t}=e;return C3.createElement(Js,null,t.map((i,l)=>C3.createElement("div",{key:l,className:"boe-bubble"},i)),C3.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},ea=CL;var ia={getAccessibilityString:e=>k7(e.data),kind:c1.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,i)=>t.data.reduce((l,r)=>e.measureText(r).width+l+20,0)+2*i.cellHorizontalPadding-4,draw:e=>mL(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return ta.createElement(ea,{bubbles:t.data})},onPaste:()=>{}},cL=4;function mL(e,t){var L;let{rect:i,theme:l,ctx:r,highlighted:s}=e,{x:a,y:o,width:n,height:C}=i,c=20,h=8,g=cL,m=a+l.cellHorizontalPadding,w=[];for(let v of t){if(m>a+n)break;let V=E4(v,r,l.baseFontFull).width;w.push({x:m,width:V}),m+=V+h*2+g}r.beginPath();for(let v of w)f0(r,v.x,o+(C-c)/2,v.width+h*2,c,(L=l.roundingRadius)!=null?L:c/2);r.fillStyle=s?l.bgBubbleSelected:l.bgBubble,r.fill();for(let[v,V]of w.entries())r.beginPath(),r.fillStyle=l.textBubble,r.fillText(t[v],V.x+h,o+C/2+x0(r,l))}var ra=F1(Y1(),1);var U9=F1(Y1(),1);var hL=X2("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),wL=e=>{let{drilldowns:t}=e;return U9.createElement(hL,null,t.map((i,l)=>U9.createElement("div",{key:l,className:"doe-bubble"},i.img!==void 0&&U9.createElement("img",{src:i.img}),U9.createElement("div",null,i.text))))},la=wL;var sa={getAccessibilityString:e=>k7(e.data.map(t=>t.text)),kind:c1.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,i)=>t.data.reduce((l,r)=>e.measureText(r.text).width+l+20+(r.img!==void 0?18:0),0)+2*i.cellHorizontalPadding-4,draw:e=>LL(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return ra.createElement(la,{drilldowns:t.data})},onPaste:()=>{}},gL=4,Q8={};function HL(e,t,i,l){let r=Math.ceil(window.devicePixelRatio),s=5,a=i-s*2,o=4,n=i*r,C=l+s,c=l*3,h=(c+s*2)*r,g=`${e},${t},${r},${i}`;if(Q8[g]!==void 0)return{el:Q8[g],height:n,width:h,middleWidth:o*r,sideWidth:C*r,padding:s*r,dpr:r};let m=document.createElement("canvas"),w=m.getContext("2d");return w===null?null:(m.width=h,m.height=n,w.scale(r,r),Q8[g]=m,w.beginPath(),f0(w,s,s,c,a,l),w.shadowColor="rgba(24, 25, 34, 0.4)",w.shadowBlur=1,w.fillStyle=e,w.fill(),w.shadowColor="rgba(24, 25, 34, 0.3)",w.shadowOffsetY=1,w.shadowBlur=5,w.fillStyle=e,w.fill(),w.shadowOffsetY=0,w.shadowBlur=0,w.shadowBlur=0,w.beginPath(),f0(w,s+.5,s+.5,c,a,l),w.strokeStyle=t,w.lineWidth=1,w.stroke(),{el:m,height:n,width:h,sideWidth:C*r,middleWidth:l*r,padding:s*r,dpr:r})}function LL(e,t){var Z,R;let{rect:i,theme:l,ctx:r,imageLoader:s,col:a,row:o}=e,{x:n,width:C}=i,c=l.baseFontFull,h=e8(r,c),g=Math.min(i.height,Math.max(16,Math.ceil(h*l.lineHeight)*2)),m=Math.floor(i.y+(i.height-g)/2),w=g-10,L=8,v=gL,V=n+l.cellHorizontalPadding,u=(Z=l.roundingRadius)!=null?Z:6,d=HL(l.bgCell,l.drilldownBorder,g,u),p=[];for(let x of t){if(V>n+C)break;let E=E4(x.text,r,c).width,S=0;x.img!==void 0&&s.loadOrGetImage(x.img,a,o)!==void 0&&(S=w-8+4);let k=E+S+L*2;p.push({x:V,width:k}),V+=k+v}if(d!==null){let{el:x,height:N,middleWidth:E,sideWidth:S,width:k,dpr:b,padding:D}=d,B=S/b,_=D/b;for(let K of p){let Q=Math.floor(K.x),m1=Math.floor(K.width),g1=m1-(B-_)*2;r.imageSmoothingEnabled=!1,r.drawImage(x,0,0,S,N,Q-_,m,B,g),g1>0&&r.drawImage(x,S,0,E,N,Q+(B-_),m,g1,g),r.drawImage(x,k-S,0,S,N,Q+m1-(B-_),m,B,g),r.imageSmoothingEnabled=!0}}r.beginPath();for(let[x,N]of p.entries()){let E=t[x],S=N.x+L;if(E.img!==void 0){let k=s.loadOrGetImage(E.img,a,o);if(k!==void 0){let b=w-8,D=0,B=0,_=k.width,K=k.height;_>K?(D+=(_-K)/2,_=K):K>_&&(B+=(K-_)/2,K=_),r.beginPath(),f0(r,S,m+g/2-b/2,b,b,(R=l.roundingRadius)!=null?R:3),r.save(),r.clip(),r.drawImage(k,D,B,_,K,S,m+g/2-b/2,b,b),r.restore(),S+=b+4}}r.beginPath(),r.fillStyle=l.textBubble,r.fillText(E.text,S,m+g/2+x0(r,l))}}var aa=F1(Y1(),1);var oa={getAccessibilityString:e=>e.data.join(", "),kind:c1.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>{var t,i,l;return VL(e,(t=e.cell.displayData)!=null?t:e.cell.data,(l=(i=e.cell.rounding)!=null?i:e.theme.roundingRadius)!=null?l:4,e.cell.contentAlign)},measure:(e,t)=>t.data.length*50,onDelete:e=>P(y({},e),{data:[]}),provideEditor:()=>e=>{let{value:t,onFinishedEditing:i,imageEditorOverride:l}=e,r=l!=null?l:qe;return aa.createElement(r,{urls:t.data,canWrite:t.readonly!==!1,onCancel:i,onChange:s=>{i(P(y({},t),{data:[s]}))}})},onPaste:(e,t)=>{e=e.trim();let l=e.split(",").map(r=>{try{return new URL(r),r}catch(s){return}}).filter(r=>r!==void 0);if(!(l.length===t.data.length&&l.every((r,s)=>r===t.data[s])))return P(y({},t),{data:l})}},J8=4;function VL(e,t,i,l){let{rect:r,col:s,row:a,theme:o,ctx:n,imageLoader:C}=e,{x:c,y:h,height:g,width:m}=r,w=g-o.cellVerticalPadding*2,L=[],v=0;for(let u=0;u0&&(n.beginPath(),f0(n,V,h+o.cellVerticalPadding,d,w,i),n.save(),n.clip()),n.drawImage(u,V,h+o.cellVerticalPadding,d,w),i>0&&n.restore(),V+=d+J8}}function dL(e,t){let i=e*49632+t*325176;return i^=i<<13,i^=i>>17,i^=i<<5,i/4294967295*2}var na={getAccessibilityString:()=>"",kind:c1.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{var c,h;let{cell:t,col:i,row:l,ctx:r,rect:s,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let o=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(o+=Math.round(dL(i,l)*t.skeletonWidthVariability));let n=a.cellHorizontalPadding,C=(c=t.skeletonHeight)!=null?c:Math.min(18,s.height-2*a.cellVerticalPadding);f0(r,s.x+n,s.y+(s.height-C)/2,o,C,(h=a.roundingRadius)!=null?h:3),r.fillStyle=z0(a.textDark,.1),r.fill()},onPaste:()=>{}};var ca=F1(Y1(),1);var v0=F1(Y1(),1);var uL=()=>e=>e.targetWidth,e6=X2("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[uL(),"px"]}});var Ca=e=>{let{value:t,onChange:i,forceEditMode:l,createNode:r,targetRect:s,onFinish:a,validatedSelection:o}=e,n=t.data,C=t.readonly===!0,[c,h]=v0.useState(n===""||l),g=v0.useCallback(()=>{h(w=>!w)},[]),m=n?"gdg-ml-6":"";return c?v0.createElement(e6,{targetWidth:s.width-20},v0.createElement($4,{autoFocus:!0,highlight:!1,validatedSelection:o,value:n,onKeyDown:w=>{w.key==="Enter"&&w.stopPropagation()},onChange:i}),v0.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${m}`,onClick:()=>a(t)},v0.createElement(Ae,null))):v0.createElement(e6,{targetWidth:s.width},v0.createElement(F9,{contents:n,createNode:r}),!C&&v0.createElement(v0.Fragment,null,v0.createElement("div",{className:"spacer"}),v0.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${m}`,onClick:g},v0.createElement(q5,null))),v0.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))};var ma={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:""},kind:c1.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:N4,measure:(e,t,i)=>{let l=t.data.split(` `)[0];return e.measureText(l).width+2*i.cellHorizontalPadding},draw:e=>I0(e,e.cell.data,e.cell.contentAlign),onDelete:e=>P(y({},e),{data:""}),provideEditor:()=>e=>{let{onChange:t,value:i,target:l,onFinishedEditing:r,markdownDivCreateNode:s,forceEditMode:a,validatedSelection:o}=e;return ca.createElement(Ca,{onFinish:r,targetRect:l,value:i,validatedSelection:o,onChange:n=>t(P(y({},i),{data:n.target.value})),forceEditMode:a,createNode:s})},onPaste:(e,t)=>e===t.data?void 0:P(y({},t),{data:e})};var ha={getAccessibilityString:e=>e.row.toString(),kind:l4.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:vL,measure:()=>44,draw:e=>ML(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{let{bounds:t,cell:i,posX:l,posY:r}=e,{width:s,height:a}=t,o=i.drawHandle?7+(s-7)/2:s/2,n=a/2;if(Math.abs(l-o)<=10&&Math.abs(r-n)<=10)return P(y({},i),{checked:!i.checked})},onPaste:()=>{}};function vL(e,t){let{ctx:i,theme:l}=e,r=l.markerFontFull,s=t!=null?t:{};return(s==null?void 0:s.font)!==r&&(i.font=r,s.font=r),s.deprep=pL,i.textAlign="center",s}function pL(e){let{ctx:t}=e;t.textAlign="start"}function ML(e,t,i,l,r,s){let{ctx:a,rect:o,hoverAmount:n,theme:C}=e,{x:c,y:h,width:g,height:m}=o,w=i?1:l==="checkbox-visible"?.6+.4*n:n;if(l!=="number"&&w>0){a.globalAlpha=w;let L=7*(i?n:1);if(j5(a,C,i,r?c+L:c,h,r?g-L:g,m,!0,void 0,void 0,18,"center",s),r){a.globalAlpha=n,a.beginPath();for(let v of[3,6])for(let V of[-5,-1,3])a.rect(c+v,h+m/2+V,2,2);a.fillStyle=C.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(l==="number"||l==="both"&&!i){let L=t.toString(),v=C.markerFontFull,V=c+g/2;l==="both"&&n!==0&&(a.globalAlpha=1-n),a.fillStyle=C.textLight,a.font=v,a.fillText(L,V,h+m/2+x0(a,v)),n!==0&&(a.globalAlpha=1)}}var wa={getAccessibilityString:()=>"",kind:l4.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>xL(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function xL(e,t,i){let{ctx:l,rect:r,hoverAmount:s,theme:a,spriteManager:o}=e,{x:n,y:C,width:c,height:h}=r;l.beginPath(),l.globalAlpha=s,l.rect(n+1,C+1,c,h-2),l.fillStyle=a.bgHeaderHovered,l.fill(),l.globalAlpha=1,l.beginPath();let g=t!=="",m=0;if(i!==void 0){let L=h-8,v=n+8/2,V=C+8/2;o.drawSprite(i,"normal",l,v,V,L,a,g?1:s),m=L}else{m=24;let w=12,L=g?w:s*w,v=g?0:(1-s)*w*.5,V=a.cellHorizontalPadding+4;L>0&&(l.moveTo(n+V+v,C+h/2),l.lineTo(n+V+v+L,C+h/2),l.moveTo(n+V+v+L*.5,C+h/2-L*.5),l.lineTo(n+V+v+L*.5,C+h/2+L*.5),l.lineWidth=2,l.strokeStyle=a.bgIconHeader,l.lineCap="round",l.stroke())}l.fillStyle=a.textMedium,l.fillText(t,m+n+a.cellHorizontalPadding+.5,C+h/2+x0(l,a)),l.beginPath()}var M5=F1(Y1(),1);var fL=M5.lazy(async()=>await import("./number-overlay-editor-CU4RMYZF.js")),ga={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:""},kind:c1.Number,needsHover:!1,needsHoverPosition:!1,useLabel:!0,drawPrep:N4,draw:e=>I0(e,e.cell.displayData,e.cell.contentAlign),measure:(e,t,i)=>e.measureText(t.displayData).width+i.cellHorizontalPadding*2,onDelete:e=>P(y({},e),{data:void 0}),provideEditor:()=>e=>{let{isHighlighted:t,onChange:i,value:l,validatedSelection:r}=e;return M5.createElement(M5.Suspense,{fallback:null},M5.createElement(fL,{highlight:t,disabled:l.readonly===!0,value:l.data,fixedDecimals:l.fixedDecimals,allowNegative:l.allowNegative,thousandSeparator:l.thousandSeparator,decimalSeparator:l.decimalSeparator,validatedSelection:r,onChange:s=>{var a;return i(P(y({},l),{data:Number.isNaN((a=s.floatValue)!=null?a:0)?0:s.floatValue}))}}))},onPaste:(e,t,i)=>{var r;let l=typeof i.rawValue=="number"?i.rawValue:Number.parseFloat(typeof i.rawValue=="string"?i.rawValue:e);if(!(Number.isNaN(l)||t.data===l))return P(y({},t),{data:l,displayData:(r=i.formattedString)!=null?r:t.displayData})}};var Ha={getAccessibilityString:()=>"",measure:()=>108,kind:c1.Protected,needsHover:!1,needsHoverPosition:!1,draw:ZL,onPaste:()=>{}};function ZL(e){let{ctx:t,theme:i,rect:l}=e,{x:r,y:s,height:a}=l;t.beginPath();let o=2.5,n=r+i.cellHorizontalPadding+o,C=s+a/2,c=Math.cos(Y3(30))*o,h=Math.sin(Y3(30))*o;for(let g=0;g<12;g++)t.moveTo(n,C-o),t.lineTo(n,C+o),t.moveTo(n+c,C-h),t.lineTo(n-c,C+h),t.moveTo(n-c,C-h),t.lineTo(n+c,C+h),n+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=i.textLight,t.stroke()}var La=F1(Y1(),1);var Va={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:""},kind:c1.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>N4(e,t,e.theme.textLight),draw:e=>I0(e,e.cell.data,e.cell.contentAlign),measure:(e,t,i)=>e.measureText(t.data).width+i.cellHorizontalPadding*2,provideEditor:()=>e=>{let{isHighlighted:t,onChange:i,value:l,validatedSelection:r}=e;return La.default.createElement($4,{highlight:t,autoFocus:l.readonly!==!0,disabled:l.readonly!==!1,value:l.data,validatedSelection:r,onChange:s=>i(P(y({},l),{data:s.target.value}))})},onPaste:()=>{}};var da=F1(Y1(),1);var ua={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:""},kind:c1.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:N4,useLabel:!0,draw:e=>{var g;let{cell:t,hoverAmount:i,hyperWrapping:l,ctx:r,rect:s,theme:a,overrideCursor:o}=e,{displayData:n,contentAlign:C,hoverEffect:c,allowWrapping:h}=t;if(c===!0&&i>0){r.textBaseline="alphabetic";let m=a.cellHorizontalPadding,w=a.cellVerticalPadding,L=E4(n,r,a.baseFontFull,"alphabetic"),v=s.height-w,V=Math.min(v,L.actualBoundingBoxAscent*2.5);r.beginPath(),f0(r,s.x+m/2,s.y+(s.height-V)/2+1,L.width+m*3,V-1,(g=a.roundingRadius)!=null?g:4),r.globalAlpha=i,r.fillStyle=z0(a.textDark,.1),r.fill(),r.globalAlpha=1,r.fillStyle=a.textDark,r.textBaseline="middle",o==null||o("text")}I0(e,n,C,h,l)},measure:(e,t,i)=>{let l=t.displayData.split(` `,t.allowWrapping===!0?void 0:1),r=0;for(let s of l)r=Math.max(r,e.measureText(s).width);return r+2*i.cellHorizontalPadding},onDelete:e=>P(y({},e),{data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{let{isHighlighted:i,onChange:l,value:r,validatedSelection:s}=t;return da.createElement($4,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:i,autoFocus:r.readonly!==!0,disabled:r.readonly===!0,altNewline:!0,value:r.data,validatedSelection:s,onChange:a=>l(P(y({},r),{data:a.target.value}))})}}),onPaste:(e,t,i)=>{var l;return e===t.data?void 0:P(y({},t),{data:e,displayData:(l=i.formattedString)!=null?l:t.displayData})}};var xa=F1(Y1(),1);var V4=F1(Y1(),1);var va=X2("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1});var EL=e=>{let{uri:t,onChange:i,forceEditMode:l,readonly:r,validatedSelection:s,preview:a}=e,[o,n]=V4.useState(!r&&(t===""||l)),C=V4.useCallback(()=>{n(!0)},[]);return o?V4.createElement($4,{validatedSelection:s,highlight:!0,autoFocus:!0,value:t,onChange:i}):V4.createElement(va,null,V4.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!r&&V4.createElement("div",{className:"gdg-edit-icon",onClick:C},V4.createElement(q5,null)),V4.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},pa=EL;function Ma(e,t,i,l){let r=i.cellHorizontalPadding,s=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,o=e.actualBoundingBoxAscent;return l==="right"?r=t.width-a-i.cellHorizontalPadding:l==="center"&&(r=t.width/2-a/2),{x:r,y:s,width:a,height:o}}var fa={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:""},kind:c1.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:N4,draw:e=>{var c;let{cell:t,theme:i,overrideCursor:l,hoverX:r,hoverY:s,rect:a,ctx:o}=e,n=(c=t.displayData)!=null?c:t.data,C=t.hoverEffect===!0;if(l!==void 0&&C&&r!==void 0&&s!==void 0){let h=E4(n,o,i.baseFontFull),g=Ma(h,a,i,t.contentAlign),{x:m,y:w,width:L,height:v}=g;if(r>=m-4&&r<=m-4+L+8&&s>=w-4&&s<=w-4+v+8){let V=x0(o,i.baseFontFull);l("pointer");let u=5,d=w-V;o.beginPath(),o.moveTo(a.x+m,Math.floor(a.y+d+v+u)+.5),o.lineTo(a.x+m+L,Math.floor(a.y+d+v+u)+.5),o.strokeStyle=i.linkColor,o.stroke(),o.save(),o.fillStyle=e.cellFillColor,I0(P(y({},e),{rect:P(y({},a),{x:a.x-1})}),n,t.contentAlign),I0(P(y({},e),{rect:P(y({},a),{x:a.x-2})}),n,t.contentAlign),I0(P(y({},e),{rect:P(y({},a),{x:a.x+1})}),n,t.contentAlign),I0(P(y({},e),{rect:P(y({},a),{x:a.x+2})}),n,t.contentAlign),o.restore()}}o.fillStyle=C?i.linkColor:i.textDark,I0(e,n,t.contentAlign)},onClick:e=>{var c;let{cell:t,bounds:i,posX:l,posY:r,theme:s}=e,a=(c=t.displayData)!=null?c:t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return;let o=ut(a,s.baseFontFull);if(o===void 0)return;let n=Ma(o,i,s,t.contentAlign);G4({x:n.x-4,y:n.y-4,width:n.width+8,height:n.height+8},l,r)&&t.onClickUri(e)},measure:(e,t,i)=>{var l;return e.measureText((l=t.displayData)!=null?l:t.data).width+i.cellHorizontalPadding*2},onDelete:e=>P(y({},e),{data:""}),provideEditor:e=>t=>{var a;let{onChange:i,value:l,forceEditMode:r,validatedSelection:s}=t;return xa.createElement(pa,{forceEditMode:l.readonly!==!0&&(r||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:l.data,preview:(a=l.displayData)!=null?a:l.data,validatedSelection:s,readonly:l.readonly===!0,onChange:o=>i(P(y({},l),{data:o.target.value}))})},onPaste:(e,t,i)=>{var l;return e===t.data?void 0:P(y({},t),{data:e,displayData:(l=i.formattedString)!=null?l:t.displayData})}};var Za=[ha,wa,Qs,ia,sa,oa,na,ma,ga,Ha,Va,ua,fa];var Ra=F1(Na(),1);var t6=[],i6=class extends D9{constructor(){super(...arguments);c2(this,"imageLoaded",()=>{});c2(this,"loadedLocations",[]);c2(this,"cache",{});c2(this,"sendLoaded",(0,Ra.default)(()=>{this.imageLoaded(new R4(this.loadedLocations)),this.loadedLocations=[]},20));c2(this,"clearOutOfWindow",()=>{let i=Object.keys(this.cache);for(let l of i){let r=this.cache[l],s=!1;for(let a=0;a{n||(n=!0,t6.length<12?t6.unshift(o):a||(o.src=""))}},c=new Promise(g=>o.addEventListener("load",()=>g(null)));requestAnimationFrame(async()=>{try{o.src=i,await c,await o.decode();let g=this.cache[s];if(g!==void 0&&!n){g.img=o;for(let m of g.cells)this.loadedLocations.push(X5(m));a=!0,this.sendLoaded()}}catch(g){C.cancel()}}),this.cache[s]=C}loadOrGetImage(i,l,r){let s=i,a=this.cache[s];if(a!==void 0){let o=F0(l,r);return a.cells.includes(o)||a.cells.push(o),a.img}else this.loadImage(i,l,r,s)}},Ba=i6;var yL=(e,t)=>{let i=x5.useMemo(()=>y(y({},fi),e.headerIcons),[e.headerIcons]),l=x5.useMemo(()=>{var r;return(r=e.imageWindowLoader)!=null?r:new Ba},[e.imageWindowLoader]);return x5.createElement(js,P(y({},e),{renderers:Za,headerIcons:i,ref:t,imageWindowLoader:l}))},l6=x5.forwardRef(yL);var w0=F1(Y1(),1);var za=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.default.createElement("path",{d:"M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z"}))};var ya=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.default.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))};var ba=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.default.createElement("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"}))};var Fa=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.default.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"}))};var Sa=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.default.createElement("path",{d:"M13 12H16L12 16L8 12H11V8H13V12ZM15 4H5V20H19V8H15V4ZM3 2.9918C3 2.44405 3.44749 2 3.9985 2H16L20.9997 7L21 20.9925C21 21.5489 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5447 3 21.0082V2.9918Z"}))};var ka=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.default.createElement("path",{d:"M5.46257 4.43262C7.21556 2.91688 9.5007 2 12 2C17.5228 2 22 6.47715 22 12C22 14.1361 21.3302 16.1158 20.1892 17.7406L17 12H20C20 7.58172 16.4183 4 12 4C9.84982 4 7.89777 4.84827 6.46023 6.22842L5.46257 4.43262ZM18.5374 19.5674C16.7844 21.0831 14.4993 22 12 22C6.47715 22 2 17.5228 2 12C2 9.86386 2.66979 7.88416 3.8108 6.25944L7 12H4C4 16.4183 7.58172 20 12 20C14.1502 20 16.1022 19.1517 17.5398 17.7716L18.5374 19.5674Z"}))};var Ta=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.default.createElement("path",{d:"M11 2C15.968 2 20 6.032 20 11C20 15.968 15.968 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2ZM11 18C14.8675 18 18 14.8675 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18ZM19.4853 18.0711L22.3137 20.8995L20.8995 22.3137L18.0711 19.4853L19.4853 18.0711Z"}))};var Pa=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.default.createElement("path",{d:"M19 3L23 8H20V20H18V8H15L19 3ZM14 18V20H3V18H14ZM14 11V13H3V11H14ZM12 4V6H3V4H12Z"}))},Da=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.default.createElement("path",{d:"M20 4V16H23L19 21L15 16H18V4H20ZM12 18V20H3V18H12ZM14 11V13H3V11H14ZM14 4V6H3V4H14Z"}))};var J1=F1(Y1()),Ya=F1(P6());function Aa(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,l=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oa(e){var t=(0,J1.useRef)(null);function i(l){!l||l===t.current||(t.current=l,e(l))}return i}function SL(e){var t=(0,J1.useRef)(e);return(0,J1.useMemo)(function(){function i(r){typeof r=="function"?t.current=r(t.current):t.current=r}function l(){return t.current}return[l,i]},[])}function kL(){var e=(0,J1.useRef)([]);return(0,J1.useMemo)(function(){function t(){return e.current.length>0}function i(){for(var r=a9(e.current),s;!(s=r()).done;){var a=s.value;a()}e.current=[]}function l(r){e.current.push(r)}return{hasEventSubscriptions:t,removeAllEventSubscriptions:i,addEventSubscription:l}},[])}var r6=typeof window!="undefined"?J1.useLayoutEffect:J1.useEffect;function TL(e,t){var i=(0,J1.useRef)(e);return t?(i.current=e,i):(i.current=null,i)}function G9(e){return parseFloat(e.replace("px",""))}function a6(e,t,i){return ei?i:e}function _a(e){return e!=null}function Wa(){for(var e=arguments.length,t=new Array(e),i=0;i=0})}},{key:"negativeSides",get:function(){var i=this;return Object.fromEntries(m3.filter(function(l){return i[l]<0}).map(function(l){return[l,i[l]]}))}}]),e}();function qa(){for(var e=arguments.length,t=new Array(e),i=0;iu?u-R:0;L[Z.prop]=a6(R+l+x,V,u),L[Z.opposite.prop]=L[Z.prop]+s.factor(n[g])}L.width=L.right-L.left,L.height=L.bottom-L.top;var N=u4.create(L);return l===0&&(this._cachedLayerBounds=N),N},t.getLayerCollisionBounds=function(){var l=this.offsets.container;return this.getLayerBounds().mapSides(function(r,s){return s-=r.factor(l)}).merge(function(r){var s=r.width,a=r.height;return{width:s+l*2,height:a+l*2}})},t.getContainerOffsets=function(l){if(this._cachedContainerOffsets&&!l)return this._cachedContainerOffsets;var r=this.subjectsBounds.merge({layer:l||this.getLayerCollisionBounds()}),s=n6.mergeSmallestSides(r.layerOffsetsToScrollContainers);return l||(this._cachedContainerOffsets=s),s},h3(e,[{key:"type",get:function(){return this.primary.prop+"-"+(this.secondary.prop==="center"?"center":["bottom","right"].includes(this.secondary.prop)?"end":"start")}},{key:"triggerIsBigger",get:function(){var l=this.secondary.isHorizontal,r=this.subjectsBounds,s=r.triggerHasBiggerWidth,a=r.triggerHasBiggerHeight;return l&&s||!l&&a}},{key:"fitsContainer",get:function(){return this.getContainerOffsets().allSidesArePositive}},{key:"visibleSurface",get:function(){var l=this.getLayerBounds(),r=this.getContainerOffsets(l),s=r.negativeSides;for(var a in s)s[a]=-s[a];return l.substract(s).surface}},{key:"secondaryOffsetSide",get:function(){var l,r,s=this,a=this.getContainerOffsets(),o=(l=(r=Object.entries(a.negativeSides).map(function(C){var c=C[0],h=C[1];return[p0[c],h]}).filter(function(C){var c=C[0];return s.primary.isOppositeDirection(c)}).sort(function(C,c){var h=C[1],g=c[1];return g-h}))==null?void 0:r[0])!=null?l:[],n=o[0];return n||null}}]),e}(),$a=function(e){bL(t,e);function t(){return e.apply(this,arguments)||this}var i=t.prototype;return i.getLayerBounds=function(){var r=this.subjectsBounds,s=r.trigger,a=r.layer,o=u4.empty();return o.top=s.top+s.height/2-a.height/2,o.bottom=o.top+a.height,o.left=s.left+s.width/2-a.width/2,o.right=o.left+a.width,o.width=o.right-o.left,o.height=o.bottom-o.top,o},t}(eo);function UL(e,t,i){var l=e.layer,r=e.trigger,s=e.arrow,a=t.primary.oppositeSizeProp,o=t.primary.isHorizontal?["top","bottom"]:["left","right"],n=o[0],C=o[1],c=l[n]+l[a]/2-r[n]-s[a]/2-i,h=l[C]-l[a]/2-r[C]+s[a]/2+i;return(c<0?-c:0)+(h>0?-h:0)}var Ua={position:"absolute",willChange:"top, left",left:null,right:null,top:null,bottom:null};function GL(e,t,i){var l;if(t.primary.isCenter)return Ua;var r=e.layer,s=e.trigger,a=e.arrow,o=t.primary.oppositeSizeProp,n=s[o]>r[o],C=i+a[o]/2,c=r[o]-a[o]/2-i,h=UL(e,t,i),g=t.primary.prop,m=t.primary.oppositeCssProp,w=n?r[o]/2+h:s[m]+s[o]/2-r[m];return Y0({},Ua,(l={},l[g]="100%",l[m]=a6(w,C,c),l))}var Ga=function(){function e(i,l,r){this.placements=void 0,this.config=void 0,this.subjectsBounds=void 0,this.placements=i,this.config=l,this.subjectsBounds=r}e.getSidesFromPlacementType=function(l){var r=l.split("-"),s=r[0],a=r[1],o=p0[s],n;return a==="center"?n=C0.center:o.isHorizontal?n=a==="start"?C0.top:C0.bottom:n=a==="start"?C0.left:C0.right,[o,n]},e.create=function(l,r){var s={arrow:r.arrowOffset,container:r.containerOffset,trigger:r.triggerOffset};function a(o){o===void 0&&(o=r.placement);var n=e.getSidesFromPlacementType(o),C=n[0],c=n[1],h=p0[C.isHorizontal?r.preferY:r.preferX],g=!C.isHorizontal&&l.triggerHasBiggerWidth||C.isHorizontal&&l.triggerHasBiggerHeight;function m(L,v){return new eo(L,v,l,r.layerDimensions,s)}var w=[];return w[0]=m(C,c),w[1]=m(C,c.isCenter?h:C0.center),w[2]=m(C,C0[(c.opposite.isCenter?h.opposite:c.opposite).prop]),w[3]=m(h,g?C:C0[C.opposite.prop]),w[4]=m(h,C0.center),w[5]=m(h,g?C0[C.opposite.prop]:C),w[6]=m(p0[h.opposite.prop],g?C:C0[C.opposite.prop]),w[7]=m(p0[h.opposite.prop],C0.center),w[8]=m(p0[h.opposite.prop],g?C0[C.opposite.prop]:C),w[9]=m(p0[C.opposite.prop],c),w[10]=m(p0[C.opposite.prop],c.isCenter?h:C0.center),w[11]=m(p0[C.opposite.prop],C0[(c.opposite.isCenter?h.opposite:c.opposite).prop]),w=w.filter(function(L){return L.type===r.placement||r.possiblePlacements.includes(L.type)}),w}return r.placement==="center"?new e([new $a(C0.center,C0.center,l,r.layerDimensions,s)].concat(a(r.preferY+"-"+r.preferX)),r,l):new e(a(),r,l)};var t=e.prototype;return t.filterPlacementsBySide=function(l){return this.placements.filter(function(r){return r.primary===l})},t.findFirstPlacementThatFits=function(){return this.placements.find(function(l){return l.fitsContainer})},t.placementWithBiggestVisibleSurface=function(){var l=this.placements.map(function(s){return{placement:s,surface:s.visibleSurface}}).sort(function(s,a){return a.surface-s.surface}),r=l[0].placement;return r},t.findSuitablePlacement=function(){return this.config.auto?this.findFirstPlacementThatFits()||this.placementWithBiggestVisibleSurface():this.placements[0]},t.getSecondaryOffset=function(l){var r=this.config,s=r.auto,a=r.snap;if(!s||a||l instanceof $a)return 0;var o=this.filterPlacementsBySide(l.primary),n=o.indexOf(l)===0;if(n&&l.fitsContainer)return 0;var C=o.find(function(L){return!L.fitsContainer});if(!C)return 0;var c=C.secondaryOffsetSide;if(!c)return 0;var h=l.getContainerOffsets(),g=l.secondary,m;l.triggerIsBigger||C===l?m=c.isPush?-1:1:m=g===C0.left||[C0.top,C0.center].includes(g)&&c.isPush?-1:1;var w=h[c.prop];return w*m},t.getStyles=function(l,r,s,a){var o={willChange:"top, left, width, height"},n=GL(this.subjectsBounds.merge({layer:l}),r,this.config.arrowOffset),C=this.config.overflowContainer?Y0({},o,{position:"fixed",top:l.top,left:l.left}):Y0({},o,{position:"absolute",top:l.top-this.subjectsBounds.parent.top+s.top-a.top,left:l.left-this.subjectsBounds.parent.left+s.left-a.left});return{arrow:n,layer:C}},t.getHasDisappeared=function(l){var r=this.config.overflowContainer?this.subjectsBounds.trigger:l,s=n6.mergeSmallestSides(this.subjectsBounds.offsetsToScrollContainers(r,!0)),a=Object.entries(s.negativeSides),o=a.some(function(n){var C=n[0],c=n[1],h=p0[C];return c<=-r[h.sizeProp]});return o?"full":s.allSidesArePositive?null:"partial"},t.result=function(l,r){var s=this.findSuitablePlacement(),a=this.getSecondaryOffset(s),o=s.getLayerBounds(a),n=this.getStyles(o,s,l,r),C=s.primary.prop;return{styles:n,layerSide:C,placement:s,layerBounds:o,hasDisappeared:this.getHasDisappeared(o)}},e}(),KL=function(){function e(i,l){this.overflowContainer=void 0,this.trigger=void 0,this.layer=void 0,this.arrow=void 0,this.parent=void 0,this.window=void 0,this.scrollContainers=void 0,this.overflowContainer=l,Object.assign(this,i)}e.create=function(l,r,s,a,o,n,C,c){var h=u4.fromWindow(l);return new e({layer:u4.fromElement(r,{environment:l,withTransform:!1}),trigger:c?u4.create(o6(c())):u4.fromElement(s),arrow:o?u4.fromElement(o):u4.empty(),parent:a?u4.fromElement(a):h,window:h,scrollContainers:[h].concat(n.map(function(g){return u4.fromElement(g,{withScrollbars:!1})}))},C)};var t=e.prototype;return t.merge=function(l){return new e(Y0({},this,l),this.overflowContainer)},t.offsetsToScrollContainers=function(l,r){r===void 0&&(r=!1);var s=this.overflowContainer&&!r?[this.window]:this.scrollContainers;return s.map(function(a){return a.offsetsTo(l)})},h3(e,[{key:"layerOffsetsToScrollContainers",get:function(){return this.offsetsToScrollContainers(this.layer)}},{key:"triggerHasBiggerWidth",get:function(){return this.trigger.width>this.layer.width}},{key:"triggerHasBiggerHeight",get:function(){return this.trigger.height>this.layer.height}}]),e}(),Ka=null;var d4={auto:!1,arrowOffset:0,containerOffset:10,triggerOffset:0,overflowContainer:!0,placement:"top-center",possiblePlacements:_L,preferX:"right",preferY:"bottom",snap:!1,container:void 0,trigger:void 0};function to(e){var t,i=e.isOpen,l=i===void 0?!1:i,r=e.overflowContainer,s=r===void 0?d4.overflowContainer:r,a=e.environment,o=a===void 0?typeof window!="undefined"?window:void 0:a,n=e.ResizeObserver,C=e.placement,c=C===void 0?d4.placement:C,h=e.possiblePlacements,g=h===void 0?d4.possiblePlacements:h,m=e.preferX,w=m===void 0?d4.preferX:m,L=e.preferY,v=L===void 0?d4.preferY:L,V=e.auto,u=V===void 0?d4.auto:V,d=e.snap,p=d===void 0?d4.snap:d,Z=e.triggerOffset,R=Z===void 0?d4.triggerOffset:Z,x=e.containerOffset,N=x===void 0?d4.containerOffset:x,E=e.arrowOffset,S=E===void 0?d4.arrowOffset:E,k=e.container,b=k===void 0?d4.container:k,D=e.layerDimensions,B=D===void 0?null:D,_=e.onDisappear,K=e.onOutsideClick,Q=e.onParentClose,m1=e.trigger,g1=(0,J1.useState)(function(){return{layerSide:c==="center"?"center":Ga.getSidesFromPlacementType(c)[0].prop,styles:{layer:{position:s?"fixed":"absolute",top:0,left:0},arrow:{position:"absolute",top:0,left:0}}}}),w1=g1[0],G=g1[1],s1=(0,J1.useRef)(null),o1=TL(w1,l),R1=(0,J1.useRef)({cancelled:!1});(0,J1.useEffect)(function(){return function(){R1.current.cancelled=!0}},[]);var J=(0,J1.useCallback)(function(w2,i2,a1){var T1=w2.arrow,l2=w2.layer,q1=w2.scrollContainers,S1=w2.trigger,$1=q1[0],U1=KL.create(o,l2,S1,$1,T1,q1,s,m1==null?void 0:m1.getBounds),H2={placement:c,possiblePlacements:g,auto:u,layerDimensions:B,arrowOffset:S,containerOffset:N,triggerOffset:R,preferX:w,preferY:v,snap:p,overflowContainer:s},t1=Ga.create(U1,H2).result(i2,a1),V1=t1.hasDisappeared,f1=t1.layerSide,b1=t1.styles,z2={layerSide:f1,styles:b1};if(!o1.current||XL(o1.current,z2)){o1.current=z2,R1.current.cancelled=!0;var n1={cancelled:!1};R1.current=n1,Promise.resolve().then(function(){n1.cancelled||G(z2)})}_a(V1)&&_a(_)&&_(V1)},[S,u,N,o,B,_,s,c,g,w,v,p,R,o1,m1]),I1=DL({ResizeObserverPolyfill:n,environment:o,enabled:l,overflowContainer:s,onChange:J,triggerOption:m1}),p1=I1.triggerRef,e2=I1.layerRef,H1=I1.arrowRef,W1=I1.closestScrollContainer,E2=OL({isOpen:l,onOutsideClick:K,onParentClose:Q}),Z2=E2.closeOnOutsideClickRefs,u2=E2.registrations,y1={triggerProps:m1?{}:{ref:Wa(p1,Z2.trigger,s1)},layerProps:{ref:Wa(e2,Z2.layer),style:w1.styles.layer},arrowProps:{ref:H1,style:w1.styles.arrow,layerSide:w1.layerSide},layerSide:w1.layerSide,triggerBounds:l?m1?m1.getBounds():(t=s1.current)==null?void 0:t.getBoundingClientRect():null,renderLayer:function(w2){return typeof document!="undefined"?(0,Ya.createPortal)((0,J1.createElement)(AL,{registrations:u2,children:w2}),s||!W1?jL(b):W1):null}};return y1}function XL(e,t){if(e.layerSide!==t.layerSide)return!0;for(var i=["position","top","left","right","bottom"],l=0,r=i;l=0})}},{key:"negativeSides",get:function(){var i=this;return Object.fromEntries(m3.filter(function(l){return i[l]<0}).map(function(l){return[l,i[l]]}))}}]),e}();function qa(){for(var e=arguments.length,t=new Array(e),i=0;iu?u-R:0;L[Z.prop]=a6(R+l+x,V,u),L[Z.opposite.prop]=L[Z.prop]+s.factor(n[g])}L.width=L.right-L.left,L.height=L.bottom-L.top;var N=u4.create(L);return l===0&&(this._cachedLayerBounds=N),N},t.getLayerCollisionBounds=function(){var l=this.offsets.container;return this.getLayerBounds().mapSides(function(r,s){return s-=r.factor(l)}).merge(function(r){var s=r.width,a=r.height;return{width:s+l*2,height:a+l*2}})},t.getContainerOffsets=function(l){if(this._cachedContainerOffsets&&!l)return this._cachedContainerOffsets;var r=this.subjectsBounds.merge({layer:l||this.getLayerCollisionBounds()}),s=n6.mergeSmallestSides(r.layerOffsetsToScrollContainers);return l||(this._cachedContainerOffsets=s),s},h3(e,[{key:"type",get:function(){return this.primary.prop+"-"+(this.secondary.prop==="center"?"center":["bottom","right"].includes(this.secondary.prop)?"end":"start")}},{key:"triggerIsBigger",get:function(){var l=this.secondary.isHorizontal,r=this.subjectsBounds,s=r.triggerHasBiggerWidth,a=r.triggerHasBiggerHeight;return l&&s||!l&&a}},{key:"fitsContainer",get:function(){return this.getContainerOffsets().allSidesArePositive}},{key:"visibleSurface",get:function(){var l=this.getLayerBounds(),r=this.getContainerOffsets(l),s=r.negativeSides;for(var a in s)s[a]=-s[a];return l.substract(s).surface}},{key:"secondaryOffsetSide",get:function(){var l,r,s=this,a=this.getContainerOffsets(),o=(l=(r=Object.entries(a.negativeSides).map(function(C){var c=C[0],h=C[1];return[p0[c],h]}).filter(function(C){var c=C[0];return s.primary.isOppositeDirection(c)}).sort(function(C,c){var h=C[1],g=c[1];return g-h}))==null?void 0:r[0])!=null?l:[],n=o[0];return n||null}}]),e}(),$a=function(e){bL(t,e);function t(){return e.apply(this,arguments)||this}var i=t.prototype;return i.getLayerBounds=function(){var r=this.subjectsBounds,s=r.trigger,a=r.layer,o=u4.empty();return o.top=s.top+s.height/2-a.height/2,o.bottom=o.top+a.height,o.left=s.left+s.width/2-a.width/2,o.right=o.left+a.width,o.width=o.right-o.left,o.height=o.bottom-o.top,o},t}(eo);function UL(e,t,i){var l=e.layer,r=e.trigger,s=e.arrow,a=t.primary.oppositeSizeProp,o=t.primary.isHorizontal?["top","bottom"]:["left","right"],n=o[0],C=o[1],c=l[n]+l[a]/2-r[n]-s[a]/2-i,h=l[C]-l[a]/2-r[C]+s[a]/2+i;return(c<0?-c:0)+(h>0?-h:0)}var Ua={position:"absolute",willChange:"top, left",left:null,right:null,top:null,bottom:null};function GL(e,t,i){var l;if(t.primary.isCenter)return Ua;var r=e.layer,s=e.trigger,a=e.arrow,o=t.primary.oppositeSizeProp,n=s[o]>r[o],C=i+a[o]/2,c=r[o]-a[o]/2-i,h=UL(e,t,i),g=t.primary.prop,m=t.primary.oppositeCssProp,w=n?r[o]/2+h:s[m]+s[o]/2-r[m];return Y0({},Ua,(l={},l[g]="100%",l[m]=a6(w,C,c),l))}var Ga=function(){function e(i,l,r){this.placements=void 0,this.config=void 0,this.subjectsBounds=void 0,this.placements=i,this.config=l,this.subjectsBounds=r}e.getSidesFromPlacementType=function(l){var r=l.split("-"),s=r[0],a=r[1],o=p0[s],n;return a==="center"?n=C0.center:o.isHorizontal?n=a==="start"?C0.top:C0.bottom:n=a==="start"?C0.left:C0.right,[o,n]},e.create=function(l,r){var s={arrow:r.arrowOffset,container:r.containerOffset,trigger:r.triggerOffset};function a(o){o===void 0&&(o=r.placement);var n=e.getSidesFromPlacementType(o),C=n[0],c=n[1],h=p0[C.isHorizontal?r.preferY:r.preferX],g=!C.isHorizontal&&l.triggerHasBiggerWidth||C.isHorizontal&&l.triggerHasBiggerHeight;function m(L,v){return new eo(L,v,l,r.layerDimensions,s)}var w=[];return w[0]=m(C,c),w[1]=m(C,c.isCenter?h:C0.center),w[2]=m(C,C0[(c.opposite.isCenter?h.opposite:c.opposite).prop]),w[3]=m(h,g?C:C0[C.opposite.prop]),w[4]=m(h,C0.center),w[5]=m(h,g?C0[C.opposite.prop]:C),w[6]=m(p0[h.opposite.prop],g?C:C0[C.opposite.prop]),w[7]=m(p0[h.opposite.prop],C0.center),w[8]=m(p0[h.opposite.prop],g?C0[C.opposite.prop]:C),w[9]=m(p0[C.opposite.prop],c),w[10]=m(p0[C.opposite.prop],c.isCenter?h:C0.center),w[11]=m(p0[C.opposite.prop],C0[(c.opposite.isCenter?h.opposite:c.opposite).prop]),w=w.filter(function(L){return L.type===r.placement||r.possiblePlacements.includes(L.type)}),w}return r.placement==="center"?new e([new $a(C0.center,C0.center,l,r.layerDimensions,s)].concat(a(r.preferY+"-"+r.preferX)),r,l):new e(a(),r,l)};var t=e.prototype;return t.filterPlacementsBySide=function(l){return this.placements.filter(function(r){return r.primary===l})},t.findFirstPlacementThatFits=function(){return this.placements.find(function(l){return l.fitsContainer})},t.placementWithBiggestVisibleSurface=function(){var l=this.placements.map(function(s){return{placement:s,surface:s.visibleSurface}}).sort(function(s,a){return a.surface-s.surface}),r=l[0].placement;return r},t.findSuitablePlacement=function(){return this.config.auto?this.findFirstPlacementThatFits()||this.placementWithBiggestVisibleSurface():this.placements[0]},t.getSecondaryOffset=function(l){var r=this.config,s=r.auto,a=r.snap;if(!s||a||l instanceof $a)return 0;var o=this.filterPlacementsBySide(l.primary),n=o.indexOf(l)===0;if(n&&l.fitsContainer)return 0;var C=o.find(function(L){return!L.fitsContainer});if(!C)return 0;var c=C.secondaryOffsetSide;if(!c)return 0;var h=l.getContainerOffsets(),g=l.secondary,m;l.triggerIsBigger||C===l?m=c.isPush?-1:1:m=g===C0.left||[C0.top,C0.center].includes(g)&&c.isPush?-1:1;var w=h[c.prop];return w*m},t.getStyles=function(l,r,s,a){var o={willChange:"top, left, width, height"},n=GL(this.subjectsBounds.merge({layer:l}),r,this.config.arrowOffset),C=this.config.overflowContainer?Y0({},o,{position:"fixed",top:l.top,left:l.left}):Y0({},o,{position:"absolute",top:l.top-this.subjectsBounds.parent.top+s.top-a.top,left:l.left-this.subjectsBounds.parent.left+s.left-a.left});return{arrow:n,layer:C}},t.getHasDisappeared=function(l){var r=this.config.overflowContainer?this.subjectsBounds.trigger:l,s=n6.mergeSmallestSides(this.subjectsBounds.offsetsToScrollContainers(r,!0)),a=Object.entries(s.negativeSides),o=a.some(function(n){var C=n[0],c=n[1],h=p0[C];return c<=-r[h.sizeProp]});return o?"full":s.allSidesArePositive?null:"partial"},t.result=function(l,r){var s=this.findSuitablePlacement(),a=this.getSecondaryOffset(s),o=s.getLayerBounds(a),n=this.getStyles(o,s,l,r),C=s.primary.prop;return{styles:n,layerSide:C,placement:s,layerBounds:o,hasDisappeared:this.getHasDisappeared(o)}},e}(),KL=function(){function e(i,l){this.overflowContainer=void 0,this.trigger=void 0,this.layer=void 0,this.arrow=void 0,this.parent=void 0,this.window=void 0,this.scrollContainers=void 0,this.overflowContainer=l,Object.assign(this,i)}e.create=function(l,r,s,a,o,n,C,c){var h=u4.fromWindow(l);return new e({layer:u4.fromElement(r,{environment:l,withTransform:!1}),trigger:c?u4.create(o6(c())):u4.fromElement(s),arrow:o?u4.fromElement(o):u4.empty(),parent:a?u4.fromElement(a):h,window:h,scrollContainers:[h].concat(n.map(function(g){return u4.fromElement(g,{withScrollbars:!1})}))},C)};var t=e.prototype;return t.merge=function(l){return new e(Y0({},this,l),this.overflowContainer)},t.offsetsToScrollContainers=function(l,r){r===void 0&&(r=!1);var s=this.overflowContainer&&!r?[this.window]:this.scrollContainers;return s.map(function(a){return a.offsetsTo(l)})},h3(e,[{key:"layerOffsetsToScrollContainers",get:function(){return this.offsetsToScrollContainers(this.layer)}},{key:"triggerHasBiggerWidth",get:function(){return this.trigger.width>this.layer.width}},{key:"triggerHasBiggerHeight",get:function(){return this.trigger.height>this.layer.height}}]),e}(),Ka=null;var d4={auto:!1,arrowOffset:0,containerOffset:10,triggerOffset:0,overflowContainer:!0,placement:"top-center",possiblePlacements:_L,preferX:"right",preferY:"bottom",snap:!1,container:void 0,trigger:void 0};function to(e){var t,i=e.isOpen,l=i===void 0?!1:i,r=e.overflowContainer,s=r===void 0?d4.overflowContainer:r,a=e.environment,o=a===void 0?typeof window!="undefined"?window:void 0:a,n=e.ResizeObserver,C=e.placement,c=C===void 0?d4.placement:C,h=e.possiblePlacements,g=h===void 0?d4.possiblePlacements:h,m=e.preferX,w=m===void 0?d4.preferX:m,L=e.preferY,v=L===void 0?d4.preferY:L,V=e.auto,u=V===void 0?d4.auto:V,d=e.snap,p=d===void 0?d4.snap:d,Z=e.triggerOffset,R=Z===void 0?d4.triggerOffset:Z,x=e.containerOffset,N=x===void 0?d4.containerOffset:x,E=e.arrowOffset,S=E===void 0?d4.arrowOffset:E,k=e.container,b=k===void 0?d4.container:k,D=e.layerDimensions,B=D===void 0?null:D,_=e.onDisappear,K=e.onOutsideClick,Q=e.onParentClose,m1=e.trigger,g1=(0,J1.useState)(function(){return{layerSide:c==="center"?"center":Ga.getSidesFromPlacementType(c)[0].prop,styles:{layer:{position:s?"fixed":"absolute",top:0,left:0},arrow:{position:"absolute",top:0,left:0}}}}),w1=g1[0],G=g1[1],s1=(0,J1.useRef)(null),o1=TL(w1,l),R1=(0,J1.useRef)({cancelled:!1});(0,J1.useEffect)(function(){return function(){R1.current.cancelled=!0}},[]);var J=(0,J1.useCallback)(function(w2,i2,a1){var T1=w2.arrow,l2=w2.layer,q1=w2.scrollContainers,S1=w2.trigger,$1=q1[0],U1=KL.create(o,l2,S1,$1,T1,q1,s,m1==null?void 0:m1.getBounds),H2={placement:c,possiblePlacements:g,auto:u,layerDimensions:B,arrowOffset:S,containerOffset:N,triggerOffset:R,preferX:w,preferY:v,snap:p,overflowContainer:s},t1=Ga.create(U1,H2).result(i2,a1),L1=t1.hasDisappeared,f1=t1.layerSide,b1=t1.styles,z2={layerSide:f1,styles:b1};if(!o1.current||XL(o1.current,z2)){o1.current=z2,R1.current.cancelled=!0;var n1={cancelled:!1};R1.current=n1,Promise.resolve().then(function(){n1.cancelled||G(z2)})}_a(L1)&&_a(_)&&_(L1)},[S,u,N,o,B,_,s,c,g,w,v,p,R,o1,m1]),I1=DL({ResizeObserverPolyfill:n,environment:o,enabled:l,overflowContainer:s,onChange:J,triggerOption:m1}),p1=I1.triggerRef,e2=I1.layerRef,H1=I1.arrowRef,W1=I1.closestScrollContainer,E2=OL({isOpen:l,onOutsideClick:K,onParentClose:Q}),Z2=E2.closeOnOutsideClickRefs,u2=E2.registrations,y1={triggerProps:m1?{}:{ref:Wa(p1,Z2.trigger,s1)},layerProps:{ref:Wa(e2,Z2.layer),style:w1.styles.layer},arrowProps:{ref:H1,style:w1.styles.arrow,layerSide:w1.layerSide},layerSide:w1.layerSide,triggerBounds:l?m1?m1.getBounds():(t=s1.current)==null?void 0:t.getBoundingClientRect():null,renderLayer:function(w2){return typeof document!="undefined"?(0,Ya.createPortal)((0,J1.createElement)(AL,{registrations:u2,children:w2}),s||!W1?jL(b):W1):null}};return y1}function XL(e,t){if(e.layerSide!==t.layerSide)return!0;for(var i=["position","top","left","right","bottom"],l=0,r=i;l`},QL={text:a5.HeaderString,number:a5.HeaderNumber,uri:a5.HeaderUri,date:a5.HeaderDate,list:a5.HeaderArray,struct:"curlyBraces"},JL={text:c1.Text,number:c1.Number,uri:c1.Uri,date:c1.Text,list:c1.Text,struct:c1.Text},io={fontFamily:"JetBrains Mono",bgHeader:"white",textDark:"#61758a",textHeader:"#304254",headerFontStyle:"bold 14px",baseFontStyle:"14px",borderColor:"#E1E8F0",horizontalBorderColor:"#E1E8F0",accentColor:"#3E64FF",accentLight:"#ECF0FF",bgHeaderHovered:"#F0F5F9",bgHeaderHasFocus:"#E1E8F0",bgSearchResult:"#FFF7EC",headerIconSize:22};function lo({ctx:e,data:t}){var f1,b1,z2;let i=[],l=[],r=n1=>n1.map(l1=>{let M1=l1.summary,Z1=l1.label,R2=l1.key;return l.push({[Z1]:250}),M1&&i.push(M1.keys.length),{title:Z1,id:R2,type:l1.type,icon:QL[l1.type]||a5.HeaderString,hasMenu:l1.type!=="list",summary:M1}}),s=r(t.content.columns),a=t.features.includes("refetch"),o=t.features.includes("export"),n=t.content.columns.length!==0,C=i.length>0,c=t.features.includes("sorting"),h=t.features.includes("relocate"),g=o?(f1=t.export)==null?void 0:f1.formats:null,m=o&&g,w={rows:x2.empty(),columns:x2.empty()},[L,v]=(0,i1.useState)(t.content),[V,u]=(0,i1.useState)(!1),[d,p]=(0,i1.useState)(s),[Z,R]=(0,i1.useState)(l),[x,N]=(0,i1.useState)(null),[E,S]=(0,i1.useState)(!1),[k,b]=(0,i1.useState)(w),[D,B]=(0,i1.useState)(0),[_,K]=(0,i1.useState)(null),Q=L.total_rows,m1=n&&Q>0,g1=t.features.includes("pagination")&&(Q===null||Q>0),w1=L.limit===Q,G=44,s1=C&&m1?Math.max(...i):0,o1=G+s1*22,R1=c?140:70,J=440+o1,p1=Q&&Q<(c?3:2)&&x?R1+o1:null,e2=Q>=10&&w1?J:p1,H1=(L.page-1)*L.limit+1,W1=C?150:50,E2=t.content.columns.length===1?800:350,Z2=L.page_length,u2=(0,i1.useCallback)((n1,L1)=>{let{ctx:l1,theme:M1,rect:Z1,column:R2,menuBounds:Q2,isHovered:e0,isSelected:t0,spriteManager:c0}=n1;if(R2.sourceIndex===0)return!0;if(!m1)return!1;l1.rect(Z1.x,Z1.y,Z1.width,Z1.height);let Y2=10,J2=19,k0=t0?M1.textHeaderSelected:M1.textHeader,C2=t0?M1.accentLight:M1.textDark,m2=R2.hasMenu===!0&&e0,L2=L.columns[R2.sourceIndex-1].summary,A2=!!L2,y2=35,F2=Z1.width-y2,Z0=Z1.width-y2*.7,o4=F2/Z1.width,T0=Z0/Z1.width,m0=l1.createLinearGradient(Z1.x,0,Z1.x+Z1.width,0),B1=z0(k0,0),S2=x0(l1,`${M1.headerFontStyle} ${M1.fontFamily}`);if(m0.addColorStop(0,k0),m0.addColorStop(o4,k0),m0.addColorStop(T0,B1),m0.addColorStop(1,B1),l1.fillStyle=m2?m0:k0,R2.icon){let X1=t0?"selected":R2.style==="highlight"?"special":"normal",N2=M1.headerIconSize;c0.drawSprite(R2.icon,X1,l1,Z1.x+Y2,Z1.y+Y2,N2,M1),R2.overlayIcon&&c0.drawSprite(R2.overlayIcon,t0?"selected":"special",l1,Z1.x+Y2+J2/2,Z1.y+Y2+J2/2,J2,M1)}if(l1.fillText(R2.title,Q2.x-Z1.width+M1.headerIconSize*2.5+14,A2?Z1.y+Y2+M1.headerIconSize/2+S2:Q2.y+Q2.height/2+S2),A2){let X1=Object.fromEntries(L2.keys.map((P0,q0)=>[P0,L2.values[q0]])),N2=13,j1=N2+Y2,Q0=`${N2}px ${M1.fontFamily}`,v4=`bold ${Q0}`;l1.fillStyle=C2,Object.entries(X1).forEach(([P0,q0],z4)=>{l1.font=v4,l1.fillText(`${P0}:`,Z1.x+j1/2,Z1.y+j1*(z4+1)+j1),l1.font=Q0,l1.fillText(q0,Z1.x+l1.measureText(P0).width+j1,Z1.y+j1*(z4+1)+j1)})}if(m2){l1.fillStyle=m0;let X1=Q2.x+Q2.width/2-Y2*1.5,N2=M1.headerIconSize/2-2,j1=new Path2D("M12 16l-6-6h12z");l1.translate(X1,N2),l1.fill(j1)}L1()},[L]),y1=(0,i1.useCallback)(([n1,L1])=>{let l1=JL[L.columns[n1].type]||c1.Text,Z1=L.data_orientation==="columns"?L.data[n1][L1]:L.data[L1][n1];return{kind:l1,data:Z1,displayData:Z1,allowOverlay:!0,allowWrapping:!1,readonly:!0}},[L]),t2=()=>{u(!V)},w2=n1=>{let L1=n1!=="none"?x.columnKey:null;e.pushEvent("order_by",{key:L1,direction:n1!=null?n1:"asc"}),N(null)},i2=()=>{e.pushEvent("show_page",{page:L.page-1}),b(P(y({},w),{columns:k.columns}))},a1=()=>{e.pushEvent("show_page",{page:L.page+1}),b(P(y({},w),{columns:k.columns}))},T1=()=>{let n1=P(y({},w),{columns:x2.fromSingleSelection(x.column)});b(n1),N(null)},{layerProps:l2,renderLayer:q1}=to({isOpen:E,auto:!0,placement:"bottom-end",possiblePlacements:["bottom-end","bottom-center","bottom-start"],triggerOffset:0,onOutsideClick:()=>N(null),trigger:{getBounds:()=>{var n1,L1,l1,M1,Z1,R2,Q2,e0;return{left:(n1=x==null?void 0:x.bounds.x)!=null?n1:0,top:(L1=x==null?void 0:x.bounds.y)!=null?L1:0,width:(l1=x==null?void 0:x.bounds.width)!=null?l1:0,height:(M1=x==null?void 0:x.bounds.height)!=null?M1:0,right:((Z1=x==null?void 0:x.bounds.x)!=null?Z1:0)+((R2=x==null?void 0:x.bounds.width)!=null?R2:0),bottom:((Q2=x==null?void 0:x.bounds.y)!=null?Q2:0)+((e0=x==null?void 0:x.bounds.height)!=null?e0:0)}}}}),S1=(0,i1.useCallback)((n1,L1)=>{R(l1=>P(y({},l1),{[n1.title]:L1}))},[]),$1=(0,i1.useCallback)((n1,L1)=>{e.pushEvent("relocate",{from_index:n1,to_index:L1}),N(null),b(w)},[]),U1=(0,i1.useCallback)((n1,L1)=>{let{summary:l1,id:M1,type:Z1}=d[n1];l1||N({column:n1,bounds:L1,columnKey:M1,columnType:Z1})},[d]),H2=(0,i1.useCallback)((n1,{bounds:L1})=>{let{id:l1,type:M1}=d[n1];N({column:n1,bounds:L1,columnKey:l1,columnType:M1})},[d]),t1=(0,i1.useCallback)(n1=>{let[L1,l1]=n1.location;l1===-1&&L1===-1&&n1.kind==="header"?K([...Array.from({length:Z2},(M1,Z1)=>Z1)]):L1===-1&&n1.kind==="cell"?K([l1]):K(null)},[Z2]),V1=(0,i1.useCallback)(n1=>_!=null&&_.includes(n1)?{bgCell:io.bgHeaderHovered}:null,[_]);return(0,i1.useEffect)(()=>{var n1;((n1=k.rows)==null?void 0:n1.items.length)>0?B(1):B(0)},[k]),(0,i1.useEffect)(()=>{e.handleEvent("update_content",n1=>{let L1=r(n1.columns);p(L1),v(n1)}),e.handleEvent("download_content",([n1,L1])=>{let l1=new Blob([L1],{type:n1.type}),M1=document.createElement("a");M1.href=window.URL.createObjectURL(l1),M1.download=`${n1.filename}-${+new Date}${n1.format}`,M1.click()})},[]),(0,i1.useEffect)(()=>{var l1;let n1=((l1=L.order)==null?void 0:l1.direction)==="asc"?"arrowUp":"arrowDown",L1=d.map(M1=>{var Z1;return P(y({},M1),{overlayIcon:M1.id===((Z1=L.order)==null?void 0:Z1.key)?n1:null})});p(L1)},[(b1=L.order)==null?void 0:b1.direction,(z2=L.order)==null?void 0:z2.key]),(0,i1.useEffect)(()=>{let n1=d.map(L1=>P(y({},L1),{width:Z[L1.title]}));p(n1)},[Z]),(0,i1.useEffect)(()=>{let n1=x==null?void 0:x.columnKey,L1={bgHeader:"#F0F5F9"},l1=d.map(M1=>P(y({},M1),{themeOverride:M1.id===n1?L1:null}));p(l1),S(!!x)},[x]),i1.default.createElement("div",{className:"p-3 font-sans"},i1.default.createElement("div",{className:"mb-6 flex items-center gap-3"},i1.default.createElement("div",{className:"flex items-baseline"},i1.default.createElement("h2",{className:"text-md font-semibold leading-none text-gray-800"},t.name),i1.default.createElement("span",{className:"ml-2.5 text-xs leading-none"},Q||"?"," ",Q===1?"entry":"entries"),Qe.pushEvent("download",{format:n1})}),i1.default.createElement("div",{className:"grow"}),a&&i1.default.createElement(tV,{onRefetch:()=>e.pushEvent("refetch")}),i1.default.createElement(iV,{toggleSearch:t2}),i1.default.createElement(lV,{limit:L.limit,totalRows:Q,onChange:n1=>e.pushEvent("limit",{limit:n1})}),g1&&i1.default.createElement(rV,{page:L.page,maxPage:L.max_page,onPrev:i2,onNext:a1,rows:Z2})),n&&i1.default.createElement(l6,{className:"max-w-full rounded-lg shadow-[0_2px_10px_rgb(0,0,0,0.15)]",theme:io,getCellContent:y1,columns:d,rows:Z2,width:"100%",height:e2,rowHeight:44,headerHeight:o1,drawHeader:u2,verticalBorder:!1,rowMarkers:"clickable-number",rowMarkerWidth:32,onHeaderMenuClick:U1,onHeaderClicked:H2,showSearch:V,getCellsForSelection:!0,onSearchClose:t2,headerIcons:YL,overscrollX:100,isDraggable:!1,smoothScrollX:!0,smoothScrollY:!0,onColumnResize:S1,columnSelect:"none",gridSelection:k,onGridSelectionChange:n1=>b(n1),rowMarkerStartIndex:H1,minColumnWidth:W1,maxColumnAutoWidth:E2,fillHandle:!0,onItemHovered:t1,getRowThemeOverride:V1,onColumnMoved:h?$1:void 0}),E&&q1(i1.default.createElement(sV,{layerProps:l2,menu:x,orderBy:w2,selectAllCurrent:T1,hasSorting:c})),!n&&i1.default.createElement("p",{className:"text-sm text-gray-700"},"No data"),i1.default.createElement("div",{id:"portal"}))}function eV({supportedFormats:e,onDownload:t}){let i=(0,i1.useRef)();return i1.default.createElement("span",{className:"tooltip right","data-tooltip":"Export to"},i1.default.createElement(c6,{onClick:l=>i.current.click()},i1.default.createElement("div",{className:"relative"},i1.default.createElement(Sa,{size:18}),i1.default.createElement("select",{className:"absolute inset-0 cursor-pointer opacity-0",ref:i,value:"",onChange:l=>t(l.target.value)},i1.default.createElement("option",{disabled:!0,value:""},"Export to"),e.map(l=>i1.default.createElement("option",{key:l},l))))))}function tV({onRefetch:e}){return i1.default.createElement(c6,{"aria-label":"refresh",onClick:e},i1.default.createElement(ka,null))}function iV({toggleSearch:e}){return i1.default.createElement("span",{className:"tooltip right","data-tooltip":"Current page search"},i1.default.createElement(c6,{"aria-label":"search",onClick:e},i1.default.createElement(Ta,{size:16})))}function c6(i){var l=i,{children:e}=l,t=o0(l,["children"]);return i1.default.createElement("button",P(y({},t),{className:"align-center flex cursor-pointer items-center rounded-full p-1 leading-none text-gray-500 hover:text-gray-900 focus:bg-gray-100 focus:outline-none disabled:cursor-default disabled:text-gray-300"}),e)}function lV({limit:e,totalRows:t,onChange:i}){return i1.default.createElement("div",null,i1.default.createElement("form",null,i1.default.createElement("label",{className:"p-1 text-xs font-medium text-gray-500"},"Show"),i1.default.createElement("div",{class:"relative inline-block"},i1.default.createElement("select",{className:"appearance-none rounded-lg border border-gray-400 bg-white px-2 py-1 pr-7 text-xs font-medium text-gray-500 focus:outline-none",value:e,onChange:l=>i(parseInt(l.target.value))},i1.default.createElement("option",{value:"10"},"10"),i1.default.createElement("option",{value:"20"},"20"),i1.default.createElement("option",{value:"50"},"50"),i1.default.createElement("option",{value:"100"},"100"),t?i1.default.createElement("option",{value:t},"All"):null),i1.default.createElement("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-500"},i1.default.createElement(ya,{size:16})))))}function rV({page:e,maxPage:t,onPrev:i,onNext:l,rows:r}){return i1.default.createElement("div",{className:"flex gap-3"},i1.default.createElement("button",{className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-800 focus:outline-none disabled:pointer-events-none disabled:text-gray-300",onClick:i,disabled:e===1},i1.default.createElement(ba,{size:16}),i1.default.createElement("span",null,"Prev")),i1.default.createElement("div",{className:"rounded-lg border border-gray-400 px-2 py-1 text-xs font-semibold text-gray-500"},i1.default.createElement("span",null,e," of ",t||"?")),i1.default.createElement("button",{className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-800 focus:outline-none disabled:pointer-events-none disabled:text-gray-300",onClick:l,disabled:e===t||r===0},i1.default.createElement("span",null,"Next"),i1.default.createElement(Fa,{size:16})))}function sV({layerProps:e,selectAllCurrent:t,hasSorting:i,orderBy:l}){return i1.default.createElement("div",y({className:"flex w-48 flex-col rounded-b-md border border-gray-200 bg-white p-2 font-sans shadow-lg"},e),i1.default.createElement("button",{className:"mb-1.5 flex w-full justify-center rounded-lg border border-gray-200 bg-gray-100 px-3 py-1.5 text-sm font-medium leading-none text-gray-700 hover:bg-gray-200",onClick:t},"Select this column"),i&&i1.default.createElement(i1.default.Fragment,null,i1.default.createElement(C6,{onClick:()=>l("asc")},i1.default.createElement(Pa,{size:14}),i1.default.createElement("span",null,"Sort: ascending")),i1.default.createElement(C6,{onClick:()=>l("desc")},i1.default.createElement(Da,{size:14}),i1.default.createElement("span",null,"Sort: descending")),i1.default.createElement(C6,{onClick:()=>l("none")},i1.default.createElement(za,{size:14}),i1.default.createElement("span",null,"Sort: none"))))}function C6(i){var l=i,{children:e}=l,t=o0(l,["children"]);return i1.default.createElement("div",P(y({},t),{className:"flex cursor-pointer items-center justify-start gap-1 p-1 text-sm text-gray-700 hover:bg-gray-100"}),e)}function MZ(e,t){e.importCSS("main.css"),e.importCSS("https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap"),e.importCSS("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap"),(0,so.createRoot)(e.root).render(ro.default.createElement(lo,{ctx:e,data:t}))}export{MZ as init}; + 14.3Z">`},QL={text:a5.HeaderString,number:a5.HeaderNumber,uri:a5.HeaderUri,date:a5.HeaderDate,list:a5.HeaderArray,struct:"curlyBraces"},JL={text:c1.Text,number:c1.Number,uri:c1.Uri,date:c1.Text,list:c1.Text,struct:c1.Text},io={fontFamily:"JetBrains Mono",bgHeader:"white",textDark:"#61758a",textHeader:"#304254",headerFontStyle:"bold 14px",baseFontStyle:"14px",borderColor:"#E1E8F0",horizontalBorderColor:"#E1E8F0",accentColor:"#3E64FF",accentLight:"#ECF0FF",bgHeaderHovered:"#F0F5F9",bgHeaderHasFocus:"#E1E8F0",bgSearchResult:"#FFF7EC",headerIconSize:22};function lo({ctx:e,data:t}){var f1,b1,z2;let i=[],l=[],r=n1=>n1.map(l1=>{let M1=l1.summary,Z1=l1.label,R2=l1.key;return l.push({[Z1]:250}),M1&&i.push(M1.keys.length),{title:Z1,id:R2,type:l1.type,icon:QL[l1.type]||a5.HeaderString,hasMenu:l1.type!=="list",summary:M1}}),s=r(t.content.columns),a=t.features.includes("refetch"),o=t.features.includes("export"),n=t.content.columns.length!==0,C=i.length>0,c=t.features.includes("sorting"),h=t.features.includes("relocate"),g=o?(f1=t.export)==null?void 0:f1.formats:null,m=o&&g,w={rows:x2.empty(),columns:x2.empty()},[L,v]=(0,i1.useState)(t.content),[V,u]=(0,i1.useState)(!1),[d,p]=(0,i1.useState)(s),[Z,R]=(0,i1.useState)(l),[x,N]=(0,i1.useState)(null),[E,S]=(0,i1.useState)(!1),[k,b]=(0,i1.useState)(w),[D,B]=(0,i1.useState)(0),[_,K]=(0,i1.useState)(null),Q=L.total_rows,m1=n&&Q>0,g1=t.features.includes("pagination")&&(Q===null||Q>0),w1=L.limit===Q,G=44,s1=C&&m1?Math.max(...i):0,o1=G+s1*22,R1=c?140:70,J=440+o1,p1=Q&&Q<(c?3:2)&&x?R1+o1:null,e2=Q>=10&&w1?J:p1,H1=(L.page-1)*L.limit+1,W1=C?150:50,E2=t.content.columns.length===1?800:350,Z2=L.page_length,u2=(0,i1.useCallback)((n1,V1)=>{let{ctx:l1,theme:M1,rect:Z1,column:R2,menuBounds:Q2,isHovered:e0,isSelected:t0,spriteManager:c0}=n1;if(R2.sourceIndex===0)return!0;if(!m1)return!1;l1.rect(Z1.x,Z1.y,Z1.width,Z1.height);let Y2=10,J2=19,k0=t0?M1.textHeaderSelected:M1.textHeader,C2=t0?M1.accentLight:M1.textDark,m2=R2.hasMenu===!0&&e0,L2=L.columns[R2.sourceIndex-1].summary,A2=!!L2,y2=35,F2=Z1.width-y2,Z0=Z1.width-y2*.7,o4=F2/Z1.width,T0=Z0/Z1.width,m0=l1.createLinearGradient(Z1.x,0,Z1.x+Z1.width,0),B1=z0(k0,0),S2=x0(l1,`${M1.headerFontStyle} ${M1.fontFamily}`);if(m0.addColorStop(0,k0),m0.addColorStop(o4,k0),m0.addColorStop(T0,B1),m0.addColorStop(1,B1),l1.fillStyle=m2?m0:k0,R2.icon){let X1=t0?"selected":R2.style==="highlight"?"special":"normal",N2=M1.headerIconSize;c0.drawSprite(R2.icon,X1,l1,Z1.x+Y2,Z1.y+Y2,N2,M1),R2.overlayIcon&&c0.drawSprite(R2.overlayIcon,t0?"selected":"special",l1,Z1.x+Y2+J2/2,Z1.y+Y2+J2/2,J2,M1)}if(l1.fillText(R2.title,Q2.x-Z1.width+M1.headerIconSize*2.5+14,A2?Z1.y+Y2+M1.headerIconSize/2+S2:Q2.y+Q2.height/2+S2),A2){let X1=Object.fromEntries(L2.keys.map((P0,q0)=>[P0,L2.values[q0]])),N2=13,j1=N2+Y2,Q0=`${N2}px ${M1.fontFamily}`,v4=`bold ${Q0}`;l1.fillStyle=C2,Object.entries(X1).forEach(([P0,q0],z4)=>{l1.font=v4,l1.fillText(`${P0}:`,Z1.x+j1/2,Z1.y+j1*(z4+1)+j1),l1.font=Q0,l1.fillText(q0,Z1.x+l1.measureText(P0).width+j1,Z1.y+j1*(z4+1)+j1)})}if(m2){l1.fillStyle=m0;let X1=Q2.x+Q2.width/2-Y2*1.5,N2=M1.headerIconSize/2-2,j1=new Path2D("M12 16l-6-6h12z");l1.translate(X1,N2),l1.fill(j1)}},[L]),y1=(0,i1.useCallback)(([n1,V1])=>{let l1=JL[L.columns[n1].type]||c1.Text,Z1=L.data_orientation==="columns"?L.data[n1][V1]:L.data[V1][n1];return{kind:l1,data:Z1,displayData:Z1,allowOverlay:!0,allowWrapping:!1,readonly:!0}},[L]),t2=()=>{u(!V)},w2=n1=>{let V1=n1!=="none"?x.columnKey:null;e.pushEvent("order_by",{key:V1,direction:n1!=null?n1:"asc"}),N(null)},i2=()=>{e.pushEvent("show_page",{page:L.page-1}),b(P(y({},w),{columns:k.columns}))},a1=()=>{e.pushEvent("show_page",{page:L.page+1}),b(P(y({},w),{columns:k.columns}))},T1=()=>{let n1=P(y({},w),{columns:x2.fromSingleSelection(x.column)});b(n1),N(null)},{layerProps:l2,renderLayer:q1}=to({isOpen:E,auto:!0,placement:"bottom-end",possiblePlacements:["bottom-end","bottom-center","bottom-start"],triggerOffset:0,onOutsideClick:()=>N(null),trigger:{getBounds:()=>{var n1,V1,l1,M1,Z1,R2,Q2,e0;return{left:(n1=x==null?void 0:x.bounds.x)!=null?n1:0,top:(V1=x==null?void 0:x.bounds.y)!=null?V1:0,width:(l1=x==null?void 0:x.bounds.width)!=null?l1:0,height:(M1=x==null?void 0:x.bounds.height)!=null?M1:0,right:((Z1=x==null?void 0:x.bounds.x)!=null?Z1:0)+((R2=x==null?void 0:x.bounds.width)!=null?R2:0),bottom:((Q2=x==null?void 0:x.bounds.y)!=null?Q2:0)+((e0=x==null?void 0:x.bounds.height)!=null?e0:0)}}}}),S1=(0,i1.useCallback)((n1,V1)=>{R(l1=>P(y({},l1),{[n1.title]:V1}))},[]),$1=(0,i1.useCallback)((n1,V1)=>{e.pushEvent("relocate",{from_index:n1,to_index:V1}),N(null),b(w)},[]),U1=(0,i1.useCallback)((n1,V1)=>{let{summary:l1,id:M1,type:Z1}=d[n1];l1||N({column:n1,bounds:V1,columnKey:M1,columnType:Z1})},[d]),H2=(0,i1.useCallback)((n1,{bounds:V1})=>{let{id:l1,type:M1}=d[n1];N({column:n1,bounds:V1,columnKey:l1,columnType:M1})},[d]),t1=(0,i1.useCallback)(n1=>{let[V1,l1]=n1.location;l1===-1&&V1===-1&&n1.kind==="header"?K([...Array.from({length:Z2},(M1,Z1)=>Z1)]):V1===-1&&n1.kind==="cell"?K([l1]):K(null)},[Z2]),L1=(0,i1.useCallback)(n1=>_!=null&&_.includes(n1)?{bgCell:io.bgHeaderHovered}:null,[_]);return(0,i1.useEffect)(()=>{var n1;((n1=k.rows)==null?void 0:n1.items.length)>0?B(1):B(0)},[k]),(0,i1.useEffect)(()=>{e.handleEvent("update_content",n1=>{let V1=r(n1.columns);p(V1),v(n1)}),e.handleEvent("download_content",([n1,V1])=>{let l1=new Blob([V1],{type:n1.type}),M1=document.createElement("a");M1.href=window.URL.createObjectURL(l1),M1.download=`${n1.filename}-${+new Date}${n1.format}`,M1.click()})},[]),(0,i1.useEffect)(()=>{var l1;let n1=((l1=L.order)==null?void 0:l1.direction)==="asc"?"arrowUp":"arrowDown",V1=d.map(M1=>{var Z1;return P(y({},M1),{overlayIcon:M1.id===((Z1=L.order)==null?void 0:Z1.key)?n1:null})});p(V1)},[(b1=L.order)==null?void 0:b1.direction,(z2=L.order)==null?void 0:z2.key]),(0,i1.useEffect)(()=>{let n1=d.map(V1=>P(y({},V1),{width:Z[V1.title]}));p(n1)},[Z]),(0,i1.useEffect)(()=>{let n1=x==null?void 0:x.columnKey,V1={bgHeader:"#F0F5F9"},l1=d.map(M1=>P(y({},M1),{themeOverride:M1.id===n1?V1:null}));p(l1),S(!!x)},[x]),i1.default.createElement("div",{className:"p-3 font-sans"},i1.default.createElement("div",{className:"mb-6 flex items-center gap-3"},i1.default.createElement("div",{className:"flex items-baseline"},i1.default.createElement("h2",{className:"text-md font-semibold leading-none text-gray-800"},t.name),i1.default.createElement("span",{className:"ml-2.5 text-xs leading-none"},Q||"?"," ",Q===1?"entry":"entries"),Qe.pushEvent("download",{format:n1})}),i1.default.createElement("div",{className:"grow"}),a&&i1.default.createElement(tV,{onRefetch:()=>e.pushEvent("refetch")}),i1.default.createElement(iV,{toggleSearch:t2}),i1.default.createElement(lV,{limit:L.limit,totalRows:Q,onChange:n1=>e.pushEvent("limit",{limit:n1})}),g1&&i1.default.createElement(rV,{page:L.page,maxPage:L.max_page,onPrev:i2,onNext:a1,rows:Z2})),n&&i1.default.createElement(l6,{className:"max-w-full rounded-lg shadow-[0_2px_10px_rgb(0,0,0,0.15)]",theme:io,getCellContent:y1,columns:d,rows:Z2,width:"100%",height:e2,rowHeight:44,headerHeight:o1,drawHeader:u2,verticalBorder:!1,rowMarkers:"clickable-number",rowMarkerWidth:32,onHeaderMenuClick:U1,onHeaderClicked:H2,showSearch:V,getCellsForSelection:!0,onSearchClose:t2,headerIcons:YL,overscrollX:100,isDraggable:!1,smoothScrollX:!0,smoothScrollY:!0,onColumnResize:S1,columnSelect:"none",gridSelection:k,onGridSelectionChange:n1=>b(n1),rowMarkerStartIndex:H1,minColumnWidth:W1,maxColumnAutoWidth:E2,fillHandle:!0,onItemHovered:t1,getRowThemeOverride:L1,onColumnMoved:h?$1:void 0}),E&&q1(i1.default.createElement(sV,{layerProps:l2,menu:x,orderBy:w2,selectAllCurrent:T1,hasSorting:c})),!n&&i1.default.createElement("p",{className:"text-sm text-gray-700"},"No data"),i1.default.createElement("div",{id:"portal"}))}function eV({supportedFormats:e,onDownload:t}){let i=(0,i1.useRef)();return i1.default.createElement("span",{className:"tooltip right","data-tooltip":"Export to"},i1.default.createElement(c6,{onClick:l=>i.current.click()},i1.default.createElement("div",{className:"relative"},i1.default.createElement(Sa,{size:18}),i1.default.createElement("select",{className:"absolute inset-0 cursor-pointer opacity-0",ref:i,value:"",onChange:l=>t(l.target.value)},i1.default.createElement("option",{disabled:!0,value:""},"Export to"),e.map(l=>i1.default.createElement("option",{key:l},l))))))}function tV({onRefetch:e}){return i1.default.createElement(c6,{"aria-label":"refresh",onClick:e},i1.default.createElement(ka,null))}function iV({toggleSearch:e}){return i1.default.createElement("span",{className:"tooltip right","data-tooltip":"Current page search"},i1.default.createElement(c6,{"aria-label":"search",onClick:e},i1.default.createElement(Ta,{size:16})))}function c6(i){var l=i,{children:e}=l,t=o0(l,["children"]);return i1.default.createElement("button",P(y({},t),{className:"align-center flex cursor-pointer items-center rounded-full p-1 leading-none text-gray-500 hover:text-gray-900 focus:bg-gray-100 focus:outline-none disabled:cursor-default disabled:text-gray-300"}),e)}function lV({limit:e,totalRows:t,onChange:i}){return i1.default.createElement("div",null,i1.default.createElement("form",null,i1.default.createElement("label",{className:"p-1 text-xs font-medium text-gray-500"},"Show"),i1.default.createElement("div",{class:"relative inline-block"},i1.default.createElement("select",{className:"appearance-none rounded-lg border border-gray-400 bg-white px-2 py-1 pr-7 text-xs font-medium text-gray-500 focus:outline-none",value:e,onChange:l=>i(parseInt(l.target.value))},i1.default.createElement("option",{value:"10"},"10"),i1.default.createElement("option",{value:"20"},"20"),i1.default.createElement("option",{value:"50"},"50"),i1.default.createElement("option",{value:"100"},"100"),t?i1.default.createElement("option",{value:t},"All"):null),i1.default.createElement("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-500"},i1.default.createElement(ya,{size:16})))))}function rV({page:e,maxPage:t,onPrev:i,onNext:l,rows:r}){return i1.default.createElement("div",{className:"flex gap-3"},i1.default.createElement("button",{className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-800 focus:outline-none disabled:pointer-events-none disabled:text-gray-300",onClick:i,disabled:e===1},i1.default.createElement(ba,{size:16}),i1.default.createElement("span",null,"Prev")),i1.default.createElement("div",{className:"rounded-lg border border-gray-400 px-2 py-1 text-xs font-semibold text-gray-500"},i1.default.createElement("span",null,e," of ",t||"?")),i1.default.createElement("button",{className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-800 focus:outline-none disabled:pointer-events-none disabled:text-gray-300",onClick:l,disabled:e===t||r===0},i1.default.createElement("span",null,"Next"),i1.default.createElement(Fa,{size:16})))}function sV({layerProps:e,selectAllCurrent:t,hasSorting:i,orderBy:l}){return i1.default.createElement("div",y({className:"flex w-48 flex-col rounded-b-md border border-gray-200 bg-white p-2 font-sans shadow-lg"},e),i1.default.createElement("button",{className:"mb-1.5 flex w-full justify-center rounded-lg border border-gray-200 bg-gray-100 px-3 py-1.5 text-sm font-medium leading-none text-gray-700 hover:bg-gray-200",onClick:t},"Select this column"),i&&i1.default.createElement(i1.default.Fragment,null,i1.default.createElement(C6,{onClick:()=>l("asc")},i1.default.createElement(Pa,{size:14}),i1.default.createElement("span",null,"Sort: ascending")),i1.default.createElement(C6,{onClick:()=>l("desc")},i1.default.createElement(Da,{size:14}),i1.default.createElement("span",null,"Sort: descending")),i1.default.createElement(C6,{onClick:()=>l("none")},i1.default.createElement(za,{size:14}),i1.default.createElement("span",null,"Sort: none"))))}function C6(i){var l=i,{children:e}=l,t=o0(l,["children"]);return i1.default.createElement("div",P(y({},t),{className:"flex cursor-pointer items-center justify-start gap-1 p-1 text-sm text-gray-700 hover:bg-gray-100"}),e)}function MZ(e,t){e.importCSS("main.css"),e.importCSS("https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap"),e.importCSS("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap"),(0,so.createRoot)(e.root).render(ro.default.createElement(lo,{ctx:e,data:t}))}export{MZ as init}; /*! Bundled license information: classnames/index.js: