streamlit-nightly 1.41.2.dev20250101__py2.py3-none-any.whl → 1.41.2.dev20250102__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. streamlit/static/index.html +1 -1
  2. streamlit/static/static/js/{FileDownload.esm.WslOojMp.js → FileDownload.esm.CNoj4-Mv.js} +1 -1
  3. streamlit/static/static/js/{FormClearHelper.DSgVZ-NK.js → FormClearHelper.CDUcNE9t.js} +1 -1
  4. streamlit/static/static/js/{Hooks.wzeYp0oD.js → Hooks.DMpj-RLb.js} +1 -1
  5. streamlit/static/static/js/{InputInstructions.DpTmOmkP.js → InputInstructions.DaNtjCNr.js} +1 -1
  6. streamlit/static/static/js/{ProgressBar.D1he2Gib.js → ProgressBar.BRPIMM7l.js} +1 -1
  7. streamlit/static/static/js/{RenderInPortalIfExists.CphMKHZ_.js → RenderInPortalIfExists.Cfc5-09w.js} +1 -1
  8. streamlit/static/static/js/{Toolbar.YZjXpW2P.js → Toolbar._8UjRFMn.js} +1 -1
  9. streamlit/static/static/js/{base-input.gDrmzpbY.js → base-input.BKegJgWw.js} +1 -1
  10. streamlit/static/static/js/{createSuper.Cj3WfXha.js → createSuper.jxh1FiCj.js} +1 -1
  11. streamlit/static/static/js/{data-grid-overlay-editor.CXW3Vrt9.js → data-grid-overlay-editor.BB33zQGs.js} +1 -1
  12. streamlit/static/static/js/{downloader.B-SkHjg2.js → downloader.Cm-5-MSJ.js} +1 -1
  13. streamlit/static/static/js/{es6.DoVDVSd_.js → es6.OcNPOAdx.js} +2 -2
  14. streamlit/static/static/js/{getPrototypeOf.BZAK2f3t.js → getPrototypeOf.BY5XPmcO.js} +1 -1
  15. streamlit/static/static/js/{iframeResizer.contentWindow.Exq_q4jU.js → iframeResizer.contentWindow.BFAgAgvG.js} +1 -1
  16. streamlit/static/static/js/{index.CLHVvMN0.js → index.6vjR_n-y.js} +4 -4
  17. streamlit/static/static/js/{index.2XFKVtzu.js → index.7hDSQs9w.js} +1 -1
  18. streamlit/static/static/js/{index.2Rr5kbVL.js → index.ATVdLDmC.js} +1 -1
  19. streamlit/static/static/js/{index.CX7qwffH.js → index.B4QbLNs0.js} +1 -1
  20. streamlit/static/static/js/{index.B9O1l5Yf.js → index.BF39aXr4.js} +1 -1
  21. streamlit/static/static/js/{index.vm3Bds7I.js → index.BNduMvHL.js} +1 -1
  22. streamlit/static/static/js/{index.Bp-uIPRI.js → index.BfhP6PDz.js} +1 -1
  23. streamlit/static/static/js/{index.B_RzfO7U.js → index.BtYb1969.js} +1 -1
  24. streamlit/static/static/js/{index.CmD2DSvp.js → index.Bu-D_kDf.js} +1 -1
  25. streamlit/static/static/js/{index.CP7C0jmi.js → index.BxB51OcG.js} +1 -1
  26. streamlit/static/static/js/{index.BjtDBCFh.js → index.C-rNevaH.js} +1 -1
  27. streamlit/static/static/js/{index.Bcz23DKe.js → index.C77ezkzE.js} +1 -1
  28. streamlit/static/static/js/{index.BrGYP4fV.js → index.CAMMqKeD.js} +1 -1
  29. streamlit/static/static/js/{index.y_EIxzAg.js → index.CBHLGMyy.js} +1 -1
  30. streamlit/static/static/js/{index.CCVCD0op.js → index.CGzczlx9.js} +1 -1
  31. streamlit/static/static/js/{index.Bm2n8u7I.js → index.CUh8Rsc7.js} +1 -1
  32. streamlit/static/static/js/{index.brVZtr01.js → index.CVx5m08a.js} +1 -1
  33. streamlit/static/static/js/{index.T4c5nSGV.js → index.Cpt1ZWEY.js} +1 -1
  34. streamlit/static/static/js/{index.CAkYXoVB.js → index.CxdjcKNq.js} +1 -1
  35. streamlit/static/static/js/{index.DfwGDOWW.js → index.CzlkG9Fr.js} +1 -1
  36. streamlit/static/static/js/{index.BwUmNKlx.js → index.DASuqVzI.js} +1 -1
  37. streamlit/static/static/js/{index.BjQJsYG6.js → index.DJTR-TvF.js} +1 -1
  38. streamlit/static/static/js/{index.MCDV8ab_.js → index.DMDxcX2K.js} +1 -1
  39. streamlit/static/static/js/{index.4lqQPLdu.js → index.DMr0rZjG.js} +1 -1
  40. streamlit/static/static/js/{index.CZ-znj8N.js → index.DUIN-jsB.js} +1 -1
  41. streamlit/static/static/js/{index.fm1fEqFi.js → index.De2k2c-U.js} +1 -1
  42. streamlit/static/static/js/{index.CnX4MRBV.js → index.De_q7lv4.js} +1 -1
  43. streamlit/static/static/js/{index.Ck6XWYeb.js → index.DvnQilxK.js} +1 -1
  44. streamlit/static/static/js/{index.rDDlhQFp.js → index.K-tM-X1m.js} +1 -1
  45. streamlit/static/static/js/{index.DR8k91Kp.js → index.QGeCkb2Q.js} +1 -1
  46. streamlit/static/static/js/{index.Dc0EFNHf.js → index.QhNU1B5h.js} +5 -5
  47. streamlit/static/static/js/{index.CaCnIXu_.js → index.Vds5Jt2I.js} +1 -1
  48. streamlit/static/static/js/{index.CyRDf6c5.js → index.VoGEnWSD.js} +1 -1
  49. streamlit/static/static/js/{index.DaTKmBKa.js → index.qUb9zYOr.js} +1 -1
  50. streamlit/static/static/js/{index.CVNaQiWI.js → index.tzlSUp7h.js} +1 -1
  51. streamlit/static/static/js/{index.1auHKWgw.js → index.uWSBHHII.js} +1 -1
  52. streamlit/static/static/js/{index.M9USxdKN.js → index.wdIHSIcW.js} +1 -1
  53. streamlit/static/static/js/{input.28wXD4uV.js → input.C3o7UqTF.js} +1 -1
  54. streamlit/static/static/js/{memory.jbWyoc5k.js → memory.DAjIQM15.js} +1 -1
  55. streamlit/static/static/js/{number-overlay-editor.D5dgP2YW.js → number-overlay-editor.YLsBH7YM.js} +1 -1
  56. streamlit/static/static/js/{sandbox.CfK9-cKf.js → sandbox.5Z6Ir5FQ.js} +1 -1
  57. streamlit/static/static/js/{slicedToArray.DVgs1NsC.js → slicedToArray.Dr1mYLAX.js} +1 -1
  58. streamlit/static/static/js/{textarea.C5OZk1uL.js → textarea.BjNH-nD-.js} +1 -1
  59. streamlit/static/static/js/{timepicker.DEpQEk7W.js → timepicker.B5grIdSj.js} +1 -1
  60. streamlit/static/static/js/{uniqueId.OJw6SDpp.js → uniqueId.DGVuWfUI.js} +1 -1
  61. streamlit/static/static/js/{useBasicWidgetState.C2DsWpWi.js → useBasicWidgetState.BMoJJAfz.js} +1 -1
  62. streamlit/static/static/js/{useOnInputChange.Bw6YkmJD.js → useOnInputChange.D4-GhwNq.js} +1 -1
  63. streamlit/static/static/js/{withFullScreenWrapper.BjS0eA06.js → withFullScreenWrapper.qbbU-bZp.js} +1 -1
  64. {streamlit_nightly-1.41.2.dev20250101.dist-info → streamlit_nightly-1.41.2.dev20250102.dist-info}/METADATA +1 -1
  65. {streamlit_nightly-1.41.2.dev20250101.dist-info → streamlit_nightly-1.41.2.dev20250102.dist-info}/RECORD +69 -69
  66. {streamlit_nightly-1.41.2.dev20250101.data → streamlit_nightly-1.41.2.dev20250102.data}/scripts/streamlit.cmd +0 -0
  67. {streamlit_nightly-1.41.2.dev20250101.dist-info → streamlit_nightly-1.41.2.dev20250102.dist-info}/WHEEL +0 -0
  68. {streamlit_nightly-1.41.2.dev20250101.dist-info → streamlit_nightly-1.41.2.dev20250102.dist-info}/entry_points.txt +0 -0
  69. {streamlit_nightly-1.41.2.dev20250101.dist-info → streamlit_nightly-1.41.2.dev20250102.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.CXW3Vrt9.js","./index.CLHVvMN0.js","../css/index.ZIJkhegp.css","./FormClearHelper.DSgVZ-NK.js","./withFullScreenWrapper.BjS0eA06.js","./Toolbar.YZjXpW2P.js","./sprintf.C-r3gIuM.js","./createDownloadLinkElement.DZMwyjvU.js","./slicedToArray.DVgs1NsC.js","./getPrototypeOf.BZAK2f3t.js","./createSuper.Cj3WfXha.js","./FileDownload.esm.WslOojMp.js","./number-overlay-editor.D5dgP2YW.js","./es6.DoVDVSd_.js"])))=>i.map(i=>d[i]);
2
- var Pf=Object.defineProperty;var _f=(e,t,n)=>t in e?Pf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var dt=(e,t,n)=>_f(e,typeof t!="symbol"?t+"":t,n);import{r as g,E as ic,_ as et,g as co,c as Lf,R as ae,i as Qa,p as Ff,d as Fs,e as Af,f as Hf,h as oc,t as ac,l as zf,m as sc,o as $f,q as Vf,s as Nf,u as Bf,v as Wf,a as cr,w as As,x as Pl,y as Uf,z as Yf,A as Ze,B as lc,C as uc,D as Ct,G as wr,H as Xf,I as _l,J as ti,j as xn,n as cc,K as Ll,L as Gf,M as Hs,N as Un,O as dc,Q as es,S as Pr,T as fc,U as qi,V as kr,k as jf,W as qf,X as Ne,b as Kf,Y as hc,Z as zs,$ as ts,a0 as Zf,a1 as Jf,a2 as Qf,a3 as eh,a4 as th,a5 as nh,a6 as rh,a7 as Fl,a8 as ih}from"./index.CLHVvMN0.js";import{u as oh}from"./FormClearHelper.DSgVZ-NK.js";import{w as ah,u as sh,E as lh}from"./withFullScreenWrapper.BjS0eA06.js";import{T as uh,a as Wi}from"./Toolbar.YZjXpW2P.js";import{s as ch}from"./sprintf.C-r3gIuM.js";import{c as dh}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as Cr,C as fh}from"./slicedToArray.DVgs1NsC.js";import{_ as hh,a as gh,b as mh}from"./getPrototypeOf.BZAK2f3t.js";import{_ as ph}from"./createSuper.Cj3WfXha.js";import{D as vh,F as bh}from"./FileDownload.esm.WslOojMp.js";var gc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(ic,et({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});gc.displayName="Add";var mc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(ic,et({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});mc.displayName="Search";function pc(e="This should not happen"){throw new Error(e)}function _n(e,t="Assertion failed"){if(!e)return pc(t)}function ao(e,t){return pc(t??"Hell froze over")}function wh(e,t){try{return e()}catch{return t}}const Al=Object.prototype.hasOwnProperty;function ki(e,t){let n,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((i=e.length)===t.length)for(;i--&&ki(e[i],t[i]););return i===-1}if(!n||typeof e=="object"){i=0;for(n in e)if(Al.call(e,n)&&++i&&!Al.call(t,n)||!(n in t)||!ki(e[n],t[n]))return!1;return Object.keys(t).length===i}}return e!==e&&t!==t}var yh=Object.prototype,Ch=yh.hasOwnProperty;function Sh(e,t){return e!=null&&Ch.call(e,t)}var xh=Sh,kh=xh,Mh=Lf;function Rh(e,t){return e!=null&&Mh(e,t,kh)}var Eh=Rh;const Ih=co(Eh),aa=null,$s=void 0;var Z;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(Z||(Z={}));var Hl;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})(Hl||(Hl={}));var sa;(function(e){e.Triangle="triangle",e.Dots="dots"})(sa||(sa={}));function $o(e){return"width"in e&&typeof e.width=="number"}async function zl(e){return typeof e=="object"?e:await e()}function vi(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function wi(e){return e.kind===Xn.Marker||e.kind===Xn.NewRow}function Ki(e){if(!vi(e)||e.kind===Z.Image)return!1;if(e.kind===Z.Text||e.kind===Z.Number||e.kind===Z.Markdown||e.kind===Z.Uri||e.kind===Z.Custom||e.kind===Z.Boolean)return e.readonly!==!0;ao(e,"A cell was passed with an invalid kind")}function Th(e){return Ih(e,"editor")}function Vs(e){return!(e.readonly??!1)}var Xn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Xn||(Xn={}));function Dh(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(i,r){return i[0]-r[0]}),n.push([...t[0]]);for(const i of t.slice(1)){const r=n[n.length-1];r[1]<i[0]?n.push([...i]):r[1]<i[1]&&(r[1]=i[1])}return n}let $l;const br=class br{constructor(t){dt(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(i=>[i[0]+t,i[1]+t]);return new br(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,i=Dh([...this.items,n]);return new br(i)}remove(t){const n=[...this.items],i=typeof t=="number"?t:t[0],r=typeof t=="number"?t+1:t[1];for(const[o,a]of n.entries()){const[s,l]=a;if(s<=r&&i<=l){const u=[];s<i&&u.push([s,i]),r<l&&u.push([r,l]),n.splice(o,1,...u)}}return new br(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[i,r]=this.items[n];if(t>=i&&t<r)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const i=t.items[n],r=this.items[n];if(i[0]!==r[0]||i[1]!==r[1])return!1}return!0}toArray(){const t=[];for(const[n,i]of this.items)for(let r=n;r<i;r++)t.push(r);return t}get length(){let t=0;for(const[n,i]of this.items)t+=i-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let i=t;i<n;i++)yield i}};dt(br,"empty",()=>$l??($l=new br([]))),dt(br,"fromSingleSelection",t=>br.empty().add(t));let yt=br;var Oh=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},i=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(s=>{if(s.startsWith("atm_")){const[,l]=s.split("_");n[l]=s}else i.push(s)})});const r=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&r.push(n[o]);return r.push(...i),r.join(" ")},Vl=Oh,Ph=e=>e.toUpperCase()===e,_h=e=>t=>e.indexOf(t)===-1,vc=(e,t)=>{const n={};return Object.keys(e).filter(_h(t)).forEach(i=>{n[i]=e[i]}),n};function Lh(e,t,n){const i=vc(t,n);if(!e){const r=typeof Qa=="function"?{default:Qa}:Qa;Object.keys(i).forEach(o=>{r.default(o)||delete i[o]})}return i}var Fh=(e,t)=>{};function Ah(e){let t="";return n=>{const i=(o,a)=>{const{as:s=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof s=="string"&&s.indexOf("-")===-1&&!Ph(s[0])):n.propsAsIs,c=Lh(u,o,["as","class"]);c.ref=a,c.className=n.atomic?Vl(n.class,c.className||l):Vl(c.className||l,n.class);const{vars:d}=n;if(d){const f={};for(const p in d){const b=d[p],w=b[0],y=b[1]||"",S=typeof w=="function"?w(o):w;Fh(S,n.name),f[`--${p}`]=`${S}${y}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{f[p]=h[p]}),c.style=f}return e.__linaria&&e!==s?(c.as=s,ae.createElement(e,c)):ae.createElement(s,c)},r=ae.forwardRef?ae.forwardRef(i):o=>{const a=vc(o,["innerRef"]);return i(a,o.innerRef)};return r.displayName=n.name,r.__linaria={className:n.class||t,extends:e},r}}var hn=Ah;const Hh=hn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var bc={},Ra={},Ns={},ns={},Nl;function zh(){return Nl||(Nl=1,function(e){(function(t,n){n(e,g,Ff)})(Fs,function(t,n,i){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var r=a(n),o=a(i);function a(y){return y&&y.__esModule?y:{default:y}}var s=Object.assign||function(y){for(var S=1;S<arguments.length;S++){var M=arguments[S];for(var C in M)Object.prototype.hasOwnProperty.call(M,C)&&(y[C]=M[C])}return y};function l(y,S){var M={};for(var C in y)S.indexOf(C)>=0||Object.prototype.hasOwnProperty.call(y,C)&&(M[C]=y[C]);return M}function u(y,S){if(!(y instanceof S))throw new TypeError("Cannot call a class as a function")}var c=function(){function y(S,M){for(var C=0;C<M.length;C++){var x=M[C];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(S,x.key,x)}}return function(S,M,C){return M&&y(S.prototype,M),C&&y(S,C),S}}();function d(y,S){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:y}function f(y,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);y.prototype=Object.create(S&&S.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(y,S):y.__proto__=S)}var h=!1;function m(y){h=y}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?y:y.capture}function b(y){if("touches"in y){var S=y.touches[0],M=S.pageX,C=S.pageY;return{x:M,y:C}}var x=y.screenX,R=y.screenY;return{x,y:R}}var w=function(y){f(S,y);function S(){var M;u(this,S);for(var C=arguments.length,x=Array(C),R=0;R<C;R++)x[R]=arguments[R];var I=d(this,(M=S.__proto__||Object.getPrototypeOf(S)).call.apply(M,[this].concat(x)));return I._handleSwipeStart=I._handleSwipeStart.bind(I),I._handleSwipeMove=I._handleSwipeMove.bind(I),I._handleSwipeEnd=I._handleSwipeEnd.bind(I),I._onMouseDown=I._onMouseDown.bind(I),I._onMouseMove=I._onMouseMove.bind(I),I._onMouseUp=I._onMouseUp.bind(I),I._setSwiperRef=I._setSwiperRef.bind(I),I}return c(S,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(C){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(C))}},{key:"_onMouseMove",value:function(C){this.mouseDown&&this._handleSwipeMove(C)}},{key:"_onMouseUp",value:function(C){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(C)}},{key:"_handleSwipeStart",value:function(C){var x=b(C),R=x.x,I=x.y;this.moveStart={x:R,y:I},this.props.onSwipeStart(C)}},{key:"_handleSwipeMove",value:function(C){if(this.moveStart){var x=b(C),R=x.x,I=x.y,E=R-this.moveStart.x,H=I-this.moveStart.y;this.moving=!0;var z=this.props.onSwipeMove({x:E,y:H},C);z&&C.cancelable&&C.preventDefault(),this.movePosition={deltaX:E,deltaY:H}}}},{key:"_handleSwipeEnd",value:function(C){this.props.onSwipeEnd(C);var x=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-x?this.props.onSwipeLeft(1,C):this.movePosition.deltaX>x&&this.props.onSwipeRight(1,C),this.movePosition.deltaY<-x?this.props.onSwipeUp(1,C):this.movePosition.deltaY>x&&this.props.onSwipeDown(1,C)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(C){this.swiper=C,this.props.innerRef(C)}},{key:"render",value:function(){var C=this.props;C.tagName;var x=C.className,R=C.style,I=C.children;C.allowMouseEvents,C.onSwipeUp,C.onSwipeDown,C.onSwipeLeft,C.onSwipeRight,C.onSwipeStart,C.onSwipeMove,C.onSwipeEnd,C.innerRef,C.tolerance;var E=l(C,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return r.default.createElement(this.props.tagName,s({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:x,style:R},E),I)}}]),S}(n.Component);w.displayName="ReactSwipe",w.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},w.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=w})}(ns)),ns}(function(e){(function(t,n){n(e,zh())})(Fs,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var i=r(n);function r(o){return o&&o.__esModule?o:{default:o}}t.default=i.default})})(Ns);var fo={};Object.defineProperty(fo,"__esModule",{value:!0});fo.default=void 0;var _r=$h(Af);function $h(e){return e&&e.__esModule?e:{default:e}}function Vh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Nh={ROOT:function(t){return(0,_r.default)(Vh({"carousel-root":!0},t||"",!!t))},CAROUSEL:function(t){return(0,_r.default)({carousel:!0,"carousel-slider":t})},WRAPPER:function(t,n){return(0,_r.default)({"thumbs-wrapper":!t,"slider-wrapper":t,"axis-horizontal":n==="horizontal","axis-vertical":n!=="horizontal"})},SLIDER:function(t,n){return(0,_r.default)({thumbs:!t,slider:t,animated:!n})},ITEM:function(t,n,i){return(0,_r.default)({thumb:!t,slide:t,selected:n,previous:i})},ARROW_PREV:function(t){return(0,_r.default)({"control-arrow control-prev":!0,"control-disabled":t})},ARROW_NEXT:function(t){return(0,_r.default)({"control-arrow control-next":!0,"control-disabled":t})},DOT:function(t){return(0,_r.default)({dot:!0,selected:t})}};fo.default=Nh;var ho={},Ea={};Object.defineProperty(Ea,"__esModule",{value:!0});Ea.outerWidth=void 0;var Bh=function(t){var n=t.offsetWidth,i=getComputedStyle(t);return n+=parseInt(i.marginLeft)+parseInt(i.marginRight),n};Ea.outerWidth=Bh;var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.default=void 0;var Wh=function(t,n,i){var r=t===0?t:t+n,o=i==="horizontal"?[r,0,0]:[0,r,0],a="translate3d",s="("+o.join(",")+")";return a+s};Ri.default=Wh;var go={};Object.defineProperty(go,"__esModule",{value:!0});go.default=void 0;var Uh=function(){return window};go.default=Uh;Object.defineProperty(ho,"__esModule",{value:!0});ho.default=void 0;var tr=Gh(g),jr=Ia(fo),Yh=Ea,Bl=Ia(Ri),Xh=Ia(Ns),Vo=Ia(go);function Ia(e){return e&&e.__esModule?e:{default:e}}function wc(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return wc=function(){return e},e}function Gh(e){if(e&&e.__esModule)return e;if(e===null||Qi(e)!=="object"&&typeof e!="function")return{default:e};var t=wc();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=i?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,t&&t.set(e,n),n}function Qi(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qi=function(n){return typeof n}:Qi=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Qi(e)}function ys(){return ys=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ys.apply(this,arguments)}function jh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qh(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Kh(e,t,n){return t&&qh(e.prototype,t),e}function Zh(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Cs(e,t)}function Cs(e,t){return Cs=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},Cs(e,t)}function Jh(e){var t=eg();return function(){var i=la(e),r;if(t){var o=la(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return Qh(this,r)}}function Qh(e,t){return t&&(Qi(t)==="object"||typeof t=="function")?t:Sn(e)}function Sn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eg(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function la(e){return la=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},la(e)}function pn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tg=function(t){return t.hasOwnProperty("key")},Bs=function(e){Zh(n,e);var t=Jh(n);function n(i){var r;return jh(this,n),r=t.call(this,i),pn(Sn(r),"itemsWrapperRef",void 0),pn(Sn(r),"itemsListRef",void 0),pn(Sn(r),"thumbsRef",void 0),pn(Sn(r),"setItemsWrapperRef",function(o){r.itemsWrapperRef=o}),pn(Sn(r),"setItemsListRef",function(o){r.itemsListRef=o}),pn(Sn(r),"setThumbsRef",function(o,a){r.thumbsRef||(r.thumbsRef=[]),r.thumbsRef[a]=o}),pn(Sn(r),"updateSizes",function(){if(!(!r.props.children||!r.itemsWrapperRef||!r.thumbsRef)){var o=tr.Children.count(r.props.children),a=r.itemsWrapperRef.clientWidth,s=r.props.thumbWidth?r.props.thumbWidth:(0,Yh.outerWidth)(r.thumbsRef[0]),l=Math.floor(a/s),u=l<o,c=u?o-l:0;r.setState(function(d,f){return{itemSize:s,visibleItems:l,firstItem:u?r.getFirstItem(f.selectedItem):0,lastPosition:c,showArrows:u}})}}),pn(Sn(r),"handleClickItem",function(o,a,s){if(!tg(s)||s.key==="Enter"){var l=r.props.onSelectItem;typeof l=="function"&&l(o,a)}}),pn(Sn(r),"onSwipeStart",function(){r.setState({swiping:!0})}),pn(Sn(r),"onSwipeEnd",function(){r.setState({swiping:!1})}),pn(Sn(r),"onSwipeMove",function(o){var a=o.x;if(!r.state.itemSize||!r.itemsWrapperRef||!r.state.visibleItems)return!1;var s=0,l=tr.Children.count(r.props.children),u=-(r.state.firstItem*100)/r.state.visibleItems,c=Math.max(l-r.state.visibleItems,0),d=-c*100/r.state.visibleItems;u===s&&a>0&&(a=0),u===d&&a<0&&(a=0);var f=r.itemsWrapperRef.clientWidth,h=u+100/(f/a);return r.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(m){r.itemsListRef.style[m]=(0,Bl.default)(h,"%",r.props.axis)}),!0}),pn(Sn(r),"slideRight",function(o){r.moveTo(r.state.firstItem-(typeof o=="number"?o:1))}),pn(Sn(r),"slideLeft",function(o){r.moveTo(r.state.firstItem+(typeof o=="number"?o:1))}),pn(Sn(r),"moveTo",function(o){o=o<0?0:o,o=o>=r.state.lastPosition?r.state.lastPosition:o,r.setState({firstItem:o})}),r.state={selectedItem:i.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},r}return Kh(n,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(r){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==r.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,Vo.default)().addEventListener("resize",this.updateSizes),(0,Vo.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,Vo.default)().removeEventListener("resize",this.updateSizes),(0,Vo.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(r){var o=r;return r>=this.state.lastPosition&&(o=this.state.lastPosition),r<this.state.firstItem+this.state.visibleItems&&(o=this.state.firstItem),r<this.state.firstItem&&(o=r),o}},{key:"renderItems",value:function(){var r=this;return this.props.children.map(function(o,a){var s=jr.default.ITEM(!1,a===r.state.selectedItem),l={key:a,ref:function(c){return r.setThumbsRef(c,a)},className:s,onClick:r.handleClickItem.bind(r,a,r.props.children[a]),onKeyDown:r.handleClickItem.bind(r,a,r.props.children[a]),"aria-label":"".concat(r.props.labels.item," ").concat(a+1),style:{width:r.props.thumbWidth}};return tr.default.createElement("li",ys({},l,{role:"button",tabIndex:0}),o)})}},{key:"render",value:function(){var r=this;if(!this.props.children)return null;var o=tr.Children.count(this.props.children)>1,a=this.state.showArrows&&this.state.firstItem>0,s=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,l={},u=-this.state.firstItem*(this.state.itemSize||0),c=(0,Bl.default)(u,"px",this.props.axis),d=this.props.transitionTime+"ms";return l={WebkitTransform:c,MozTransform:c,MsTransform:c,OTransform:c,transform:c,msTransform:c,WebkitTransitionDuration:d,MozTransitionDuration:d,MsTransitionDuration:d,OTransitionDuration:d,transitionDuration:d,msTransitionDuration:d},tr.default.createElement("div",{className:jr.default.CAROUSEL(!1)},tr.default.createElement("div",{className:jr.default.WRAPPER(!1),ref:this.setItemsWrapperRef},tr.default.createElement("button",{type:"button",className:jr.default.ARROW_PREV(!a),onClick:function(){return r.slideRight()},"aria-label":this.props.labels.leftArrow}),o?tr.default.createElement(Xh.default,{tagName:"ul",className:jr.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:l,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):tr.default.createElement("ul",{className:jr.default.SLIDER(!1,this.state.swiping),ref:function(h){return r.setItemsListRef(h)},style:l},this.renderItems()),tr.default.createElement("button",{type:"button",className:jr.default.ARROW_NEXT(!s),onClick:function(){return r.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),n}(tr.Component);ho.default=Bs;pn(Bs,"displayName","Thumbs");pn(Bs,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350});var Ta={};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.default=void 0;var ng=function(){return document};Ta.default=ng;var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.setPosition=Fn.getPosition=Fn.isKeyboardEvent=Fn.defaultStatusFormatter=Fn.noop=void 0;var rg=g,ig=og(Ri);function og(e){return e&&e.__esModule?e:{default:e}}var ag=function(){};Fn.noop=ag;var sg=function(t,n){return"".concat(t," of ").concat(n)};Fn.defaultStatusFormatter=sg;var lg=function(t){return t?t.hasOwnProperty("key"):!1};Fn.isKeyboardEvent=lg;var ug=function(t,n){if(n.infiniteLoop&&++t,t===0)return 0;var i=rg.Children.count(n.children);if(n.centerMode&&n.axis==="horizontal"){var r=-t*n.centerSlidePercentage,o=i-1;return t&&(t!==o||n.infiniteLoop)?r+=(100-n.centerSlidePercentage)/2:t===o&&(r+=100-n.centerSlidePercentage),r}return-t*100};Fn.getPosition=ug;var cg=function(t,n){var i={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(r){i[r]=(0,ig.default)(t,"%",n)}),i};Fn.setPosition=cg;var fr={};Object.defineProperty(fr,"__esModule",{value:!0});fr.fadeAnimationHandler=fr.slideStopSwipingHandler=fr.slideSwipeAnimationHandler=fr.slideAnimationHandler=void 0;var yc=g,dg=fg(Ri),hr=Fn;function fg(e){return e&&e.__esModule?e:{default:e}}function Wl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Jr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wl(Object(n),!0).forEach(function(i){hg(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wl(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function hg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gg=function(t,n){var i={},r=n.selectedItem,o=r,a=yc.Children.count(t.children)-1,s=t.infiniteLoop&&(r<0||r>a);if(s)return o<0?t.centerMode&&t.centerSlidePercentage&&t.axis==="horizontal"?i.itemListStyle=(0,hr.setPosition)(-(a+2)*t.centerSlidePercentage-(100-t.centerSlidePercentage)/2,t.axis):i.itemListStyle=(0,hr.setPosition)(-(a+2)*100,t.axis):o>a&&(i.itemListStyle=(0,hr.setPosition)(0,t.axis)),i;var l=(0,hr.getPosition)(r,t),u=(0,dg.default)(l,"%",t.axis),c=t.transitionTime+"ms";return i.itemListStyle={WebkitTransform:u,msTransform:u,OTransform:u,transform:u},n.swiping||(i.itemListStyle=Jr(Jr({},i.itemListStyle),{},{WebkitTransitionDuration:c,MozTransitionDuration:c,OTransitionDuration:c,transitionDuration:c,msTransitionDuration:c})),i};fr.slideAnimationHandler=gg;var mg=function(t,n,i,r){var o={},a=n.axis==="horizontal",s=yc.Children.count(n.children),l=0,u=(0,hr.getPosition)(i.selectedItem,n),c=n.infiniteLoop?(0,hr.getPosition)(s-1,n)-100:(0,hr.getPosition)(s-1,n),d=a?t.x:t.y,f=d;u===l&&d>0&&(f=0),u===c&&d<0&&(f=0);var h=u+100/(i.itemSize/f),m=Math.abs(d)>n.swipeScrollTolerance;return n.infiniteLoop&&m&&(i.selectedItem===0&&h>-100?h-=s*100:i.selectedItem===s-1&&h<-s*100&&(h+=s*100)),(!n.preventMovementUntilSwipeScrollTolerance||m||i.swipeMovementStarted)&&(i.swipeMovementStarted||r({swipeMovementStarted:!0}),o.itemListStyle=(0,hr.setPosition)(h,n.axis)),m&&!i.cancelClick&&r({cancelClick:!0}),o};fr.slideSwipeAnimationHandler=mg;var pg=function(t,n){var i=(0,hr.getPosition)(n.selectedItem,t),r=(0,hr.setPosition)(i,t.axis);return{itemListStyle:r}};fr.slideStopSwipingHandler=pg;var vg=function(t,n){var i=t.transitionTime+"ms",r="ease-in-out",o={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:r,msTransitionTimingFunction:r,MozTransitionTimingFunction:r,WebkitTransitionTimingFunction:r,OTransitionTimingFunction:r};return n.swiping||(o=Jr(Jr({},o),{},{WebkitTransitionDuration:i,MozTransitionDuration:i,OTransitionDuration:i,transitionDuration:i,msTransitionDuration:i})),{slideStyle:o,selectedStyle:Jr(Jr({},o),{},{opacity:1,position:"relative"}),prevStyle:Jr({},o)}};fr.fadeAnimationHandler=vg;Object.defineProperty(Ra,"__esModule",{value:!0});Ra.default=void 0;var At=yg(g),bg=mo(Ns),yr=mo(fo),wg=mo(ho),No=mo(Ta),Bo=mo(go),Zi=Fn,ua=fr;function mo(e){return e&&e.__esModule?e:{default:e}}function Cc(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Cc=function(){return e},e}function yg(e){if(e&&e.__esModule)return e;if(e===null||eo(e)!=="object"&&typeof e!="function")return{default:e};var t=Cc();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=i?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,t&&t.set(e,n),n}function eo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?eo=function(n){return typeof n}:eo=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},eo(e)}function Ss(){return Ss=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ss.apply(this,arguments)}function Ul(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function nr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ul(Object(n),!0).forEach(function(i){ht(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ul(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Cg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function xg(e,t,n){return t&&Sg(e.prototype,t),e}function kg(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xs(e,t)}function xs(e,t){return xs=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},xs(e,t)}function Mg(e){var t=Eg();return function(){var i=ca(e),r;if(t){var o=ca(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return Rg(this,r)}}function Rg(e,t){return t&&(eo(t)==="object"||typeof t=="function")?t:pt(e)}function pt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Eg(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function ca(e){return ca=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ca(e)}function ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ws=function(e){kg(n,e);var t=Mg(n);function n(i){var r;Cg(this,n),r=t.call(this,i),ht(pt(r),"thumbsRef",void 0),ht(pt(r),"carouselWrapperRef",void 0),ht(pt(r),"listRef",void 0),ht(pt(r),"itemsRef",void 0),ht(pt(r),"timer",void 0),ht(pt(r),"animationHandler",void 0),ht(pt(r),"setThumbsRef",function(a){r.thumbsRef=a}),ht(pt(r),"setCarouselWrapperRef",function(a){r.carouselWrapperRef=a}),ht(pt(r),"setListRef",function(a){r.listRef=a}),ht(pt(r),"setItemsRef",function(a,s){r.itemsRef||(r.itemsRef=[]),r.itemsRef[s]=a}),ht(pt(r),"autoPlay",function(){At.Children.count(r.props.children)<=1||(r.clearAutoPlay(),r.props.autoPlay&&(r.timer=setTimeout(function(){r.increment()},r.props.interval)))}),ht(pt(r),"clearAutoPlay",function(){r.timer&&clearTimeout(r.timer)}),ht(pt(r),"resetAutoPlay",function(){r.clearAutoPlay(),r.autoPlay()}),ht(pt(r),"stopOnHover",function(){r.setState({isMouseEntered:!0},r.clearAutoPlay)}),ht(pt(r),"startOnLeave",function(){r.setState({isMouseEntered:!1},r.autoPlay)}),ht(pt(r),"isFocusWithinTheCarousel",function(){return r.carouselWrapperRef?!!((0,No.default)().activeElement===r.carouselWrapperRef||r.carouselWrapperRef.contains((0,No.default)().activeElement)):!1}),ht(pt(r),"navigateWithKeyboard",function(a){if(r.isFocusWithinTheCarousel()){var s=r.props.axis,l=s==="horizontal",u={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},c=l?u.ArrowRight:u.ArrowDown,d=l?u.ArrowLeft:u.ArrowUp;c===a.keyCode?r.increment():d===a.keyCode&&r.decrement()}}),ht(pt(r),"updateSizes",function(){if(!(!r.state.initialized||!r.itemsRef||r.itemsRef.length===0)){var a=r.props.axis==="horizontal",s=r.itemsRef[0];if(s){var l=a?s.clientWidth:s.clientHeight;r.setState({itemSize:l}),r.thumbsRef&&r.thumbsRef.updateSizes()}}}),ht(pt(r),"setMountState",function(){r.setState({hasMount:!0}),r.updateSizes()}),ht(pt(r),"handleClickItem",function(a,s){if(At.Children.count(r.props.children)!==0){if(r.state.cancelClick){r.setState({cancelClick:!1});return}r.props.onClickItem(a,s),a!==r.state.selectedItem&&r.setState({selectedItem:a})}}),ht(pt(r),"handleOnChange",function(a,s){At.Children.count(r.props.children)<=1||r.props.onChange(a,s)}),ht(pt(r),"handleClickThumb",function(a,s){r.props.onClickThumb(a,s),r.moveTo(a)}),ht(pt(r),"onSwipeStart",function(a){r.setState({swiping:!0}),r.props.onSwipeStart(a)}),ht(pt(r),"onSwipeEnd",function(a){r.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),r.props.onSwipeEnd(a),r.clearAutoPlay(),r.state.autoPlay&&r.autoPlay()}),ht(pt(r),"onSwipeMove",function(a,s){r.props.onSwipeMove(s);var l=r.props.swipeAnimationHandler(a,r.props,r.state,r.setState.bind(pt(r)));return r.setState(nr({},l)),!!Object.keys(l).length}),ht(pt(r),"decrement",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;r.moveTo(r.state.selectedItem-(typeof a=="number"?a:1))}),ht(pt(r),"increment",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;r.moveTo(r.state.selectedItem+(typeof a=="number"?a:1))}),ht(pt(r),"moveTo",function(a){if(typeof a=="number"){var s=At.Children.count(r.props.children)-1;a<0&&(a=r.props.infiniteLoop?s:0),a>s&&(a=r.props.infiniteLoop?0:s),r.selectItem({selectedItem:a}),r.state.autoPlay&&r.state.isMouseEntered===!1&&r.resetAutoPlay()}}),ht(pt(r),"onClickNext",function(){r.increment(1)}),ht(pt(r),"onClickPrev",function(){r.decrement(1)}),ht(pt(r),"onSwipeForward",function(){r.increment(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),ht(pt(r),"onSwipeBackwards",function(){r.decrement(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),ht(pt(r),"changeItem",function(a){return function(s){(!(0,Zi.isKeyboardEvent)(s)||s.key==="Enter")&&r.moveTo(a)}}),ht(pt(r),"selectItem",function(a){r.setState(nr({previousItem:r.state.selectedItem},a),function(){r.setState(r.animationHandler(r.props,r.state))}),r.handleOnChange(a.selectedItem,At.Children.toArray(r.props.children)[a.selectedItem])}),ht(pt(r),"getInitialImage",function(){var a=r.props.selectedItem,s=r.itemsRef&&r.itemsRef[a],l=s&&s.getElementsByTagName("img")||[];return l[0]}),ht(pt(r),"getVariableItemHeight",function(a){var s=r.itemsRef&&r.itemsRef[a];if(r.state.hasMount&&s&&s.children.length){var l=s.children[0].getElementsByTagName("img")||[];if(l.length>0){var u=l[0];if(!u.complete){var c=function h(){r.forceUpdate(),u.removeEventListener("load",h)};u.addEventListener("load",c)}}var d=l[0]||s.children[0],f=d.clientHeight;return f>0?f:null}return null});var o={initialized:!1,previousItem:i.selectedItem,selectedItem:i.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:i.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return r.animationHandler=typeof i.animationHandler=="function"&&i.animationHandler||i.animationHandler==="fade"&&ua.fadeAnimationHandler||ua.slideAnimationHandler,r.state=nr(nr({},o),r.animationHandler(i,o)),r}return xg(n,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(r,o){!r.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!r.autoFocus&&this.props.autoFocus&&this.forceFocus(),o.swiping&&!this.state.swiping&&this.setState(nr({},this.props.stopSwipingHandler(this.props,this.state))),(r.selectedItem!==this.props.selectedItem||r.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),r.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var r=this;this.bindEvents(),this.state.autoPlay&&At.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var o=r.getInitialImage();o&&!o.complete?o.addEventListener("load",r.setMountState):r.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var r=this.carouselWrapperRef;this.props.stopOnHover&&r&&(r.addEventListener("mouseenter",this.stopOnHover),r.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var r=this.carouselWrapperRef;this.props.stopOnHover&&r&&(r.removeEventListener("mouseenter",this.stopOnHover),r.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,Bo.default)().addEventListener("resize",this.updateSizes),(0,Bo.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,No.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,Bo.default)().removeEventListener("resize",this.updateSizes),(0,Bo.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var r=this.getInitialImage();r&&r.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,No.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var r;(r=this.carouselWrapperRef)===null||r===void 0||r.focus()}},{key:"renderItems",value:function(r){var o=this;return this.props.children?At.Children.map(this.props.children,function(a,s){var l=s===o.state.selectedItem,u=s===o.state.previousItem,c=l&&o.state.selectedStyle||u&&o.state.prevStyle||o.state.slideStyle||{};o.props.centerMode&&o.props.axis==="horizontal"&&(c=nr(nr({},c),{},{minWidth:o.props.centerSlidePercentage+"%"})),o.state.swiping&&o.state.swipeMovementStarted&&(c=nr(nr({},c),{},{pointerEvents:"none"}));var d={ref:function(h){return o.setItemsRef(h,s)},key:"itemKey"+s+(r?"clone":""),className:yr.default.ITEM(!0,s===o.state.selectedItem,s===o.state.previousItem),onClick:o.handleClickItem.bind(o,s,a),style:c};return At.default.createElement("li",d,o.props.renderItem(a,{isSelected:s===o.state.selectedItem,isPrevious:s===o.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var r=this,o=this.props,a=o.showIndicators,s=o.labels,l=o.renderIndicator,u=o.children;return a?At.default.createElement("ul",{className:"control-dots"},At.Children.map(u,function(c,d){return l&&l(r.changeItem(d),d===r.state.selectedItem,d,s.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?At.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,At.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||At.Children.count(this.props.children)===0?null:At.default.createElement(wg.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var r=this;if(!this.props.children||At.Children.count(this.props.children)===0)return null;var o=this.props.swipeable&&At.Children.count(this.props.children)>1,a=this.props.axis==="horizontal",s=this.props.showArrows&&At.Children.count(this.props.children)>1,l=s&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,u=s&&(this.state.selectedItem<At.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,c=this.renderItems(!0),d=c.shift(),f=c.pop(),h={className:yr.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},m={};if(a){if(h.onSwipeLeft=this.onSwipeForward,h.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var p=this.getVariableItemHeight(this.state.selectedItem);m.height=p||"auto"}}else h.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,h.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,h.style=nr(nr({},h.style),{},{height:this.state.itemSize}),m.height=this.state.itemSize;return At.default.createElement("div",{"aria-label":this.props.ariaLabel,className:yr.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},At.default.createElement("div",{className:yr.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,l,this.props.labels.leftArrow),At.default.createElement("div",{className:yr.default.WRAPPER(!0,this.props.axis),style:m},o?At.default.createElement(bg.default,Ss({tagName:"ul",innerRef:this.setListRef},h,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&f,this.renderItems(),this.props.infiniteLoop&&d):At.default.createElement("ul",{className:yr.default.SLIDER(!0,this.state.swiping),ref:function(w){return r.setListRef(w)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&f,this.renderItems(),this.props.infiniteLoop&&d)),this.props.renderArrowNext(this.onClickNext,u,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),n}(At.default.Component);Ra.default=Ws;ht(Ws,"displayName","Carousel");ht(Ws,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:Zi.noop,onClickThumb:Zi.noop,onChange:Zi.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(t,n,i){return At.default.createElement("button",{type:"button","aria-label":i,className:yr.default.ARROW_PREV(!n),onClick:t})},renderArrowNext:function(t,n,i){return At.default.createElement("button",{type:"button","aria-label":i,className:yr.default.ARROW_NEXT(!n),onClick:t})},renderIndicator:function(t,n,i,r){return At.default.createElement("li",{className:yr.default.DOT(n),onClick:t,onKeyDown:t,value:i,key:i,role:"button",tabIndex:0,"aria-label":"".concat(r," ").concat(i+1)})},renderItem:function(t){return t},renderThumbs:function(t){var n=At.Children.map(t,function(i){var r=i;if(i.type!=="img"&&(r=At.Children.toArray(i.props.children).find(function(o){return o.type==="img"})),!!r)return r});return n.filter(function(i){return i}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):n},statusFormatter:Zi.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:ua.slideSwipeAnimationHandler,stopSwipingHandler:ua.slideStopSwipingHandler});var Ig={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return i.default}});var t=r(Ra),n=Ig,i=r(ho);function r(o){return o&&o.__esModule?o:{default:o}}})(bc);var Tg=Hf,Dg=function(){return Tg.Date.now()},Og=Dg,Pg=oc,rs=Og,Yl=ac,_g="Expected a function",Lg=Math.max,Fg=Math.min;function Ag(e,t,n){var i,r,o,a,s,l,u=0,c=!1,d=!1,f=!0;if(typeof e!="function")throw new TypeError(_g);t=Yl(t)||0,Pg(n)&&(c=!!n.leading,d="maxWait"in n,o=d?Lg(Yl(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f);function h(x){var R=i,I=r;return i=r=void 0,u=x,a=e.apply(I,R),a}function m(x){return u=x,s=setTimeout(w,t),c?h(x):a}function p(x){var R=x-l,I=x-u,E=t-R;return d?Fg(E,o-I):E}function b(x){var R=x-l,I=x-u;return l===void 0||R>=t||R<0||d&&I>=o}function w(){var x=rs();if(b(x))return y(x);s=setTimeout(w,p(x))}function y(x){return s=void 0,f&&i?h(x):(i=r=void 0,a)}function S(){s!==void 0&&clearTimeout(s),u=0,i=l=r=s=void 0}function M(){return s===void 0?a:y(rs())}function C(){var x=rs(),R=b(x);if(i=arguments,r=this,l=x,R){if(s===void 0)return m(l);if(d)return clearTimeout(s),s=setTimeout(w,t),h(l)}return s===void 0&&(s=setTimeout(w,t)),a}return C.cancel=S,C.flush=M,C}var Sc=Ag;const xc=co(Sc);function fn(e,t,n,i,r=!1){const o=g.useRef();o.current=t,g.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,s=l=>{var u;(u=o.current)==null||u.call(a,l)};return a.addEventListener(e,s,{passive:i,capture:r}),()=>{a.removeEventListener(e,s,{capture:r})}},[e,n,i,r])}function Zr(e,t){return e===void 0?void 0:t}const Hg=Math.PI;function Xl(e){return e*Hg/180}const kc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Mc=(e,t,n,i,r)=>{switch(e){case"left":return Math.floor(t)+i+r/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-i-r/2}},Rc=(e,t,n)=>Math.min(e,t-n*2),Ec=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Us=e=>{const t=e.fgColor??"currentColor";return g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),g.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},zg=e=>{const t=e.fgColor??"currentColor";return g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function $g(e,t,n){const[i,r]=g.useState(e),o=g.useRef(!0);g.useEffect(()=>()=>{o.current=!1},[]);const a=g.useRef(xc(s=>{o.current&&r(s)},n));return g.useLayoutEffect(()=>{o.current&&a.current(()=>e())},t),i}const Vg="֑-߿יִ-﷽ﹰ-ﻼ",Ng="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Bg=new RegExp("^[^"+Ng+"]*["+Vg+"]");function Ys(e){return Bg.test(e)?"rtl":"not-rtl"}let Wo;function ks(){if(typeof document>"u")return 0;if(Wo!==void 0)return Wo;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let i=e.offsetWidth;return n===i&&(i=t.clientWidth),t.remove(),Wo=n-i,Wo}const qr=Symbol();function Wg(e){const t=g.useRef([qr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,i]=g.useState(e),[,r]=g.useState(),o=g.useCallback(s=>{const l=t.current[0];l!==qr&&(s=typeof s=="function"?s(l):s,s===l)||(l!==qr&&r({}),i(u=>typeof s=="function"?s(l===qr?u:l):s),t.current[0]=qr)},[]),a=g.useCallback(()=>{t.current[0]=qr,r({})},[]);return[t.current[0]===qr?n:t.current[0],o,a]}function Ic(e){if(e.length===0)return"";let t=0,n=0;for(const i of e){if(n+=i.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function Ug(e){const t=g.useRef(e);return ki(e,t.current)||(t.current=e),t.current}const Yg=e=>{const{urls:t,canWrite:n,onEditClick:i,renderImage:r}=e,o=t.filter(s=>s!=="");if(o.length===0)return null;const a=o.length>1;return g.createElement(Hh,{"data-testid":"GDG-default-image-overlay-editor"},g.createElement(bc.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},o.map(s=>{const l=(r==null?void 0:r(s))??g.createElement("img",{draggable:!1,src:s});return g.createElement("div",{className:"gdg-centering-container",key:s},l)})),n&&i&&g.createElement("button",{className:"gdg-edit-icon",onClick:i},g.createElement(Us,null)))};function Tc(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let ni=Tc();function Xg(e){ni=e}const Dc=/[&<>"']/,Gg=new RegExp(Dc.source,"g"),Oc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,jg=new RegExp(Oc.source,"g"),qg={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Gl=e=>qg[e];function vn(e,t){if(t){if(Dc.test(e))return e.replace(Gg,Gl)}else if(Oc.test(e))return e.replace(jg,Gl);return e}const Kg=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Pc(e){return e.replace(Kg,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const Zg=/(^|[^\[])\^/g;function Bt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(i,r)=>(r=r.source||r,r=r.replace(Zg,"$1"),e=e.replace(i,r),n),getRegex:()=>new RegExp(e,t)};return n}const Jg=/[^\w:]/g,Qg=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function jl(e,t,n){if(e){let i;try{i=decodeURIComponent(Pc(n)).replace(Jg,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}t&&!Qg.test(n)&&(n=rm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Uo={},em=/^[^:]+:\/*[^/]*$/,tm=/^([^:]+:)[\s\S]*$/,nm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function rm(e,t){Uo[" "+e]||(em.test(e)?Uo[" "+e]=e+"/":Uo[" "+e]=na(e,"/",!0)),e=Uo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(tm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(nm,"$1")+t:e+t}const da={exec:function(){}};function ql(e,t){const n=e.replace(/\|/g,(o,a,s)=>{let l=!1,u=a;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),i=n.split(/ \|/);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(/\\\|/g,"|");return i}function na(e,t,n){const i=e.length;if(i===0)return"";let r=0;for(;r<i;){const o=e.charAt(i-r-1);if(o===t&&!n)r++;else if(o!==t&&n)r++;else break}return e.slice(0,i-r)}function im(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let i=0,r=0;for(;r<n;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])i++;else if(e[r]===t[1]&&(i--,i<0))return r;return-1}function om(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Kl(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Zl(e,t,n,i){const r=t.href,o=t.title?vn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){i.state.inLink=!0;const s={type:"link",raw:n,href:r,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,s}return{type:"image",raw:n,href:r,title:o,text:vn(a)}}function am(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const i=n[1];return t.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.BB33zQGs.js","./index.6vjR_n-y.js","../css/index.ZIJkhegp.css","./FormClearHelper.CDUcNE9t.js","./withFullScreenWrapper.qbbU-bZp.js","./Toolbar._8UjRFMn.js","./sprintf.C-r3gIuM.js","./createDownloadLinkElement.DZMwyjvU.js","./slicedToArray.Dr1mYLAX.js","./getPrototypeOf.BY5XPmcO.js","./createSuper.jxh1FiCj.js","./FileDownload.esm.CNoj4-Mv.js","./number-overlay-editor.YLsBH7YM.js","./es6.OcNPOAdx.js"])))=>i.map(i=>d[i]);
2
+ var Pf=Object.defineProperty;var _f=(e,t,n)=>t in e?Pf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var dt=(e,t,n)=>_f(e,typeof t!="symbol"?t+"":t,n);import{r as g,E as ic,_ as et,g as co,c as Lf,R as ae,i as Qa,p as Ff,d as Fs,e as Af,f as Hf,h as oc,t as ac,l as zf,m as sc,o as $f,q as Vf,s as Nf,u as Bf,v as Wf,a as cr,w as As,x as Pl,y as Uf,z as Yf,A as Ze,B as lc,C as uc,D as Ct,G as wr,H as Xf,I as _l,J as ti,j as xn,n as cc,K as Ll,L as Gf,M as Hs,N as Un,O as dc,Q as es,S as Pr,T as fc,U as qi,V as kr,k as jf,W as qf,X as Ne,b as Kf,Y as hc,Z as zs,$ as ts,a0 as Zf,a1 as Jf,a2 as Qf,a3 as eh,a4 as th,a5 as nh,a6 as rh,a7 as Fl,a8 as ih}from"./index.6vjR_n-y.js";import{u as oh}from"./FormClearHelper.CDUcNE9t.js";import{w as ah,u as sh,E as lh}from"./withFullScreenWrapper.qbbU-bZp.js";import{T as uh,a as Wi}from"./Toolbar._8UjRFMn.js";import{s as ch}from"./sprintf.C-r3gIuM.js";import{c as dh}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as Cr,C as fh}from"./slicedToArray.Dr1mYLAX.js";import{_ as hh,a as gh,b as mh}from"./getPrototypeOf.BY5XPmcO.js";import{_ as ph}from"./createSuper.jxh1FiCj.js";import{D as vh,F as bh}from"./FileDownload.esm.CNoj4-Mv.js";var gc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(ic,et({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});gc.displayName="Add";var mc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(ic,et({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});mc.displayName="Search";function pc(e="This should not happen"){throw new Error(e)}function _n(e,t="Assertion failed"){if(!e)return pc(t)}function ao(e,t){return pc(t??"Hell froze over")}function wh(e,t){try{return e()}catch{return t}}const Al=Object.prototype.hasOwnProperty;function ki(e,t){let n,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((i=e.length)===t.length)for(;i--&&ki(e[i],t[i]););return i===-1}if(!n||typeof e=="object"){i=0;for(n in e)if(Al.call(e,n)&&++i&&!Al.call(t,n)||!(n in t)||!ki(e[n],t[n]))return!1;return Object.keys(t).length===i}}return e!==e&&t!==t}var yh=Object.prototype,Ch=yh.hasOwnProperty;function Sh(e,t){return e!=null&&Ch.call(e,t)}var xh=Sh,kh=xh,Mh=Lf;function Rh(e,t){return e!=null&&Mh(e,t,kh)}var Eh=Rh;const Ih=co(Eh),aa=null,$s=void 0;var Z;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(Z||(Z={}));var Hl;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})(Hl||(Hl={}));var sa;(function(e){e.Triangle="triangle",e.Dots="dots"})(sa||(sa={}));function $o(e){return"width"in e&&typeof e.width=="number"}async function zl(e){return typeof e=="object"?e:await e()}function vi(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function wi(e){return e.kind===Xn.Marker||e.kind===Xn.NewRow}function Ki(e){if(!vi(e)||e.kind===Z.Image)return!1;if(e.kind===Z.Text||e.kind===Z.Number||e.kind===Z.Markdown||e.kind===Z.Uri||e.kind===Z.Custom||e.kind===Z.Boolean)return e.readonly!==!0;ao(e,"A cell was passed with an invalid kind")}function Th(e){return Ih(e,"editor")}function Vs(e){return!(e.readonly??!1)}var Xn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Xn||(Xn={}));function Dh(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(i,r){return i[0]-r[0]}),n.push([...t[0]]);for(const i of t.slice(1)){const r=n[n.length-1];r[1]<i[0]?n.push([...i]):r[1]<i[1]&&(r[1]=i[1])}return n}let $l;const br=class br{constructor(t){dt(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(i=>[i[0]+t,i[1]+t]);return new br(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,i=Dh([...this.items,n]);return new br(i)}remove(t){const n=[...this.items],i=typeof t=="number"?t:t[0],r=typeof t=="number"?t+1:t[1];for(const[o,a]of n.entries()){const[s,l]=a;if(s<=r&&i<=l){const u=[];s<i&&u.push([s,i]),r<l&&u.push([r,l]),n.splice(o,1,...u)}}return new br(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[i,r]=this.items[n];if(t>=i&&t<r)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const i=t.items[n],r=this.items[n];if(i[0]!==r[0]||i[1]!==r[1])return!1}return!0}toArray(){const t=[];for(const[n,i]of this.items)for(let r=n;r<i;r++)t.push(r);return t}get length(){let t=0;for(const[n,i]of this.items)t+=i-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let i=t;i<n;i++)yield i}};dt(br,"empty",()=>$l??($l=new br([]))),dt(br,"fromSingleSelection",t=>br.empty().add(t));let yt=br;var Oh=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},i=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(s=>{if(s.startsWith("atm_")){const[,l]=s.split("_");n[l]=s}else i.push(s)})});const r=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&r.push(n[o]);return r.push(...i),r.join(" ")},Vl=Oh,Ph=e=>e.toUpperCase()===e,_h=e=>t=>e.indexOf(t)===-1,vc=(e,t)=>{const n={};return Object.keys(e).filter(_h(t)).forEach(i=>{n[i]=e[i]}),n};function Lh(e,t,n){const i=vc(t,n);if(!e){const r=typeof Qa=="function"?{default:Qa}:Qa;Object.keys(i).forEach(o=>{r.default(o)||delete i[o]})}return i}var Fh=(e,t)=>{};function Ah(e){let t="";return n=>{const i=(o,a)=>{const{as:s=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof s=="string"&&s.indexOf("-")===-1&&!Ph(s[0])):n.propsAsIs,c=Lh(u,o,["as","class"]);c.ref=a,c.className=n.atomic?Vl(n.class,c.className||l):Vl(c.className||l,n.class);const{vars:d}=n;if(d){const f={};for(const p in d){const b=d[p],w=b[0],y=b[1]||"",S=typeof w=="function"?w(o):w;Fh(S,n.name),f[`--${p}`]=`${S}${y}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{f[p]=h[p]}),c.style=f}return e.__linaria&&e!==s?(c.as=s,ae.createElement(e,c)):ae.createElement(s,c)},r=ae.forwardRef?ae.forwardRef(i):o=>{const a=vc(o,["innerRef"]);return i(a,o.innerRef)};return r.displayName=n.name,r.__linaria={className:n.class||t,extends:e},r}}var hn=Ah;const Hh=hn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var bc={},Ra={},Ns={},ns={},Nl;function zh(){return Nl||(Nl=1,function(e){(function(t,n){n(e,g,Ff)})(Fs,function(t,n,i){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var r=a(n),o=a(i);function a(y){return y&&y.__esModule?y:{default:y}}var s=Object.assign||function(y){for(var S=1;S<arguments.length;S++){var M=arguments[S];for(var C in M)Object.prototype.hasOwnProperty.call(M,C)&&(y[C]=M[C])}return y};function l(y,S){var M={};for(var C in y)S.indexOf(C)>=0||Object.prototype.hasOwnProperty.call(y,C)&&(M[C]=y[C]);return M}function u(y,S){if(!(y instanceof S))throw new TypeError("Cannot call a class as a function")}var c=function(){function y(S,M){for(var C=0;C<M.length;C++){var x=M[C];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(S,x.key,x)}}return function(S,M,C){return M&&y(S.prototype,M),C&&y(S,C),S}}();function d(y,S){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:y}function f(y,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);y.prototype=Object.create(S&&S.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(y,S):y.__proto__=S)}var h=!1;function m(y){h=y}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?y:y.capture}function b(y){if("touches"in y){var S=y.touches[0],M=S.pageX,C=S.pageY;return{x:M,y:C}}var x=y.screenX,R=y.screenY;return{x,y:R}}var w=function(y){f(S,y);function S(){var M;u(this,S);for(var C=arguments.length,x=Array(C),R=0;R<C;R++)x[R]=arguments[R];var I=d(this,(M=S.__proto__||Object.getPrototypeOf(S)).call.apply(M,[this].concat(x)));return I._handleSwipeStart=I._handleSwipeStart.bind(I),I._handleSwipeMove=I._handleSwipeMove.bind(I),I._handleSwipeEnd=I._handleSwipeEnd.bind(I),I._onMouseDown=I._onMouseDown.bind(I),I._onMouseMove=I._onMouseMove.bind(I),I._onMouseUp=I._onMouseUp.bind(I),I._setSwiperRef=I._setSwiperRef.bind(I),I}return c(S,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(C){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(C))}},{key:"_onMouseMove",value:function(C){this.mouseDown&&this._handleSwipeMove(C)}},{key:"_onMouseUp",value:function(C){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(C)}},{key:"_handleSwipeStart",value:function(C){var x=b(C),R=x.x,I=x.y;this.moveStart={x:R,y:I},this.props.onSwipeStart(C)}},{key:"_handleSwipeMove",value:function(C){if(this.moveStart){var x=b(C),R=x.x,I=x.y,E=R-this.moveStart.x,H=I-this.moveStart.y;this.moving=!0;var z=this.props.onSwipeMove({x:E,y:H},C);z&&C.cancelable&&C.preventDefault(),this.movePosition={deltaX:E,deltaY:H}}}},{key:"_handleSwipeEnd",value:function(C){this.props.onSwipeEnd(C);var x=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-x?this.props.onSwipeLeft(1,C):this.movePosition.deltaX>x&&this.props.onSwipeRight(1,C),this.movePosition.deltaY<-x?this.props.onSwipeUp(1,C):this.movePosition.deltaY>x&&this.props.onSwipeDown(1,C)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(C){this.swiper=C,this.props.innerRef(C)}},{key:"render",value:function(){var C=this.props;C.tagName;var x=C.className,R=C.style,I=C.children;C.allowMouseEvents,C.onSwipeUp,C.onSwipeDown,C.onSwipeLeft,C.onSwipeRight,C.onSwipeStart,C.onSwipeMove,C.onSwipeEnd,C.innerRef,C.tolerance;var E=l(C,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return r.default.createElement(this.props.tagName,s({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:x,style:R},E),I)}}]),S}(n.Component);w.displayName="ReactSwipe",w.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},w.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=w})}(ns)),ns}(function(e){(function(t,n){n(e,zh())})(Fs,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var i=r(n);function r(o){return o&&o.__esModule?o:{default:o}}t.default=i.default})})(Ns);var fo={};Object.defineProperty(fo,"__esModule",{value:!0});fo.default=void 0;var _r=$h(Af);function $h(e){return e&&e.__esModule?e:{default:e}}function Vh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Nh={ROOT:function(t){return(0,_r.default)(Vh({"carousel-root":!0},t||"",!!t))},CAROUSEL:function(t){return(0,_r.default)({carousel:!0,"carousel-slider":t})},WRAPPER:function(t,n){return(0,_r.default)({"thumbs-wrapper":!t,"slider-wrapper":t,"axis-horizontal":n==="horizontal","axis-vertical":n!=="horizontal"})},SLIDER:function(t,n){return(0,_r.default)({thumbs:!t,slider:t,animated:!n})},ITEM:function(t,n,i){return(0,_r.default)({thumb:!t,slide:t,selected:n,previous:i})},ARROW_PREV:function(t){return(0,_r.default)({"control-arrow control-prev":!0,"control-disabled":t})},ARROW_NEXT:function(t){return(0,_r.default)({"control-arrow control-next":!0,"control-disabled":t})},DOT:function(t){return(0,_r.default)({dot:!0,selected:t})}};fo.default=Nh;var ho={},Ea={};Object.defineProperty(Ea,"__esModule",{value:!0});Ea.outerWidth=void 0;var Bh=function(t){var n=t.offsetWidth,i=getComputedStyle(t);return n+=parseInt(i.marginLeft)+parseInt(i.marginRight),n};Ea.outerWidth=Bh;var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.default=void 0;var Wh=function(t,n,i){var r=t===0?t:t+n,o=i==="horizontal"?[r,0,0]:[0,r,0],a="translate3d",s="("+o.join(",")+")";return a+s};Ri.default=Wh;var go={};Object.defineProperty(go,"__esModule",{value:!0});go.default=void 0;var Uh=function(){return window};go.default=Uh;Object.defineProperty(ho,"__esModule",{value:!0});ho.default=void 0;var tr=Gh(g),jr=Ia(fo),Yh=Ea,Bl=Ia(Ri),Xh=Ia(Ns),Vo=Ia(go);function Ia(e){return e&&e.__esModule?e:{default:e}}function wc(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return wc=function(){return e},e}function Gh(e){if(e&&e.__esModule)return e;if(e===null||Qi(e)!=="object"&&typeof e!="function")return{default:e};var t=wc();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=i?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,t&&t.set(e,n),n}function Qi(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qi=function(n){return typeof n}:Qi=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Qi(e)}function ys(){return ys=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ys.apply(this,arguments)}function jh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qh(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Kh(e,t,n){return t&&qh(e.prototype,t),e}function Zh(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Cs(e,t)}function Cs(e,t){return Cs=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},Cs(e,t)}function Jh(e){var t=eg();return function(){var i=la(e),r;if(t){var o=la(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return Qh(this,r)}}function Qh(e,t){return t&&(Qi(t)==="object"||typeof t=="function")?t:Sn(e)}function Sn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eg(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function la(e){return la=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},la(e)}function pn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tg=function(t){return t.hasOwnProperty("key")},Bs=function(e){Zh(n,e);var t=Jh(n);function n(i){var r;return jh(this,n),r=t.call(this,i),pn(Sn(r),"itemsWrapperRef",void 0),pn(Sn(r),"itemsListRef",void 0),pn(Sn(r),"thumbsRef",void 0),pn(Sn(r),"setItemsWrapperRef",function(o){r.itemsWrapperRef=o}),pn(Sn(r),"setItemsListRef",function(o){r.itemsListRef=o}),pn(Sn(r),"setThumbsRef",function(o,a){r.thumbsRef||(r.thumbsRef=[]),r.thumbsRef[a]=o}),pn(Sn(r),"updateSizes",function(){if(!(!r.props.children||!r.itemsWrapperRef||!r.thumbsRef)){var o=tr.Children.count(r.props.children),a=r.itemsWrapperRef.clientWidth,s=r.props.thumbWidth?r.props.thumbWidth:(0,Yh.outerWidth)(r.thumbsRef[0]),l=Math.floor(a/s),u=l<o,c=u?o-l:0;r.setState(function(d,f){return{itemSize:s,visibleItems:l,firstItem:u?r.getFirstItem(f.selectedItem):0,lastPosition:c,showArrows:u}})}}),pn(Sn(r),"handleClickItem",function(o,a,s){if(!tg(s)||s.key==="Enter"){var l=r.props.onSelectItem;typeof l=="function"&&l(o,a)}}),pn(Sn(r),"onSwipeStart",function(){r.setState({swiping:!0})}),pn(Sn(r),"onSwipeEnd",function(){r.setState({swiping:!1})}),pn(Sn(r),"onSwipeMove",function(o){var a=o.x;if(!r.state.itemSize||!r.itemsWrapperRef||!r.state.visibleItems)return!1;var s=0,l=tr.Children.count(r.props.children),u=-(r.state.firstItem*100)/r.state.visibleItems,c=Math.max(l-r.state.visibleItems,0),d=-c*100/r.state.visibleItems;u===s&&a>0&&(a=0),u===d&&a<0&&(a=0);var f=r.itemsWrapperRef.clientWidth,h=u+100/(f/a);return r.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(m){r.itemsListRef.style[m]=(0,Bl.default)(h,"%",r.props.axis)}),!0}),pn(Sn(r),"slideRight",function(o){r.moveTo(r.state.firstItem-(typeof o=="number"?o:1))}),pn(Sn(r),"slideLeft",function(o){r.moveTo(r.state.firstItem+(typeof o=="number"?o:1))}),pn(Sn(r),"moveTo",function(o){o=o<0?0:o,o=o>=r.state.lastPosition?r.state.lastPosition:o,r.setState({firstItem:o})}),r.state={selectedItem:i.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},r}return Kh(n,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(r){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==r.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,Vo.default)().addEventListener("resize",this.updateSizes),(0,Vo.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,Vo.default)().removeEventListener("resize",this.updateSizes),(0,Vo.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(r){var o=r;return r>=this.state.lastPosition&&(o=this.state.lastPosition),r<this.state.firstItem+this.state.visibleItems&&(o=this.state.firstItem),r<this.state.firstItem&&(o=r),o}},{key:"renderItems",value:function(){var r=this;return this.props.children.map(function(o,a){var s=jr.default.ITEM(!1,a===r.state.selectedItem),l={key:a,ref:function(c){return r.setThumbsRef(c,a)},className:s,onClick:r.handleClickItem.bind(r,a,r.props.children[a]),onKeyDown:r.handleClickItem.bind(r,a,r.props.children[a]),"aria-label":"".concat(r.props.labels.item," ").concat(a+1),style:{width:r.props.thumbWidth}};return tr.default.createElement("li",ys({},l,{role:"button",tabIndex:0}),o)})}},{key:"render",value:function(){var r=this;if(!this.props.children)return null;var o=tr.Children.count(this.props.children)>1,a=this.state.showArrows&&this.state.firstItem>0,s=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,l={},u=-this.state.firstItem*(this.state.itemSize||0),c=(0,Bl.default)(u,"px",this.props.axis),d=this.props.transitionTime+"ms";return l={WebkitTransform:c,MozTransform:c,MsTransform:c,OTransform:c,transform:c,msTransform:c,WebkitTransitionDuration:d,MozTransitionDuration:d,MsTransitionDuration:d,OTransitionDuration:d,transitionDuration:d,msTransitionDuration:d},tr.default.createElement("div",{className:jr.default.CAROUSEL(!1)},tr.default.createElement("div",{className:jr.default.WRAPPER(!1),ref:this.setItemsWrapperRef},tr.default.createElement("button",{type:"button",className:jr.default.ARROW_PREV(!a),onClick:function(){return r.slideRight()},"aria-label":this.props.labels.leftArrow}),o?tr.default.createElement(Xh.default,{tagName:"ul",className:jr.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:l,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):tr.default.createElement("ul",{className:jr.default.SLIDER(!1,this.state.swiping),ref:function(h){return r.setItemsListRef(h)},style:l},this.renderItems()),tr.default.createElement("button",{type:"button",className:jr.default.ARROW_NEXT(!s),onClick:function(){return r.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),n}(tr.Component);ho.default=Bs;pn(Bs,"displayName","Thumbs");pn(Bs,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350});var Ta={};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.default=void 0;var ng=function(){return document};Ta.default=ng;var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.setPosition=Fn.getPosition=Fn.isKeyboardEvent=Fn.defaultStatusFormatter=Fn.noop=void 0;var rg=g,ig=og(Ri);function og(e){return e&&e.__esModule?e:{default:e}}var ag=function(){};Fn.noop=ag;var sg=function(t,n){return"".concat(t," of ").concat(n)};Fn.defaultStatusFormatter=sg;var lg=function(t){return t?t.hasOwnProperty("key"):!1};Fn.isKeyboardEvent=lg;var ug=function(t,n){if(n.infiniteLoop&&++t,t===0)return 0;var i=rg.Children.count(n.children);if(n.centerMode&&n.axis==="horizontal"){var r=-t*n.centerSlidePercentage,o=i-1;return t&&(t!==o||n.infiniteLoop)?r+=(100-n.centerSlidePercentage)/2:t===o&&(r+=100-n.centerSlidePercentage),r}return-t*100};Fn.getPosition=ug;var cg=function(t,n){var i={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(r){i[r]=(0,ig.default)(t,"%",n)}),i};Fn.setPosition=cg;var fr={};Object.defineProperty(fr,"__esModule",{value:!0});fr.fadeAnimationHandler=fr.slideStopSwipingHandler=fr.slideSwipeAnimationHandler=fr.slideAnimationHandler=void 0;var yc=g,dg=fg(Ri),hr=Fn;function fg(e){return e&&e.__esModule?e:{default:e}}function Wl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Jr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wl(Object(n),!0).forEach(function(i){hg(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wl(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function hg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gg=function(t,n){var i={},r=n.selectedItem,o=r,a=yc.Children.count(t.children)-1,s=t.infiniteLoop&&(r<0||r>a);if(s)return o<0?t.centerMode&&t.centerSlidePercentage&&t.axis==="horizontal"?i.itemListStyle=(0,hr.setPosition)(-(a+2)*t.centerSlidePercentage-(100-t.centerSlidePercentage)/2,t.axis):i.itemListStyle=(0,hr.setPosition)(-(a+2)*100,t.axis):o>a&&(i.itemListStyle=(0,hr.setPosition)(0,t.axis)),i;var l=(0,hr.getPosition)(r,t),u=(0,dg.default)(l,"%",t.axis),c=t.transitionTime+"ms";return i.itemListStyle={WebkitTransform:u,msTransform:u,OTransform:u,transform:u},n.swiping||(i.itemListStyle=Jr(Jr({},i.itemListStyle),{},{WebkitTransitionDuration:c,MozTransitionDuration:c,OTransitionDuration:c,transitionDuration:c,msTransitionDuration:c})),i};fr.slideAnimationHandler=gg;var mg=function(t,n,i,r){var o={},a=n.axis==="horizontal",s=yc.Children.count(n.children),l=0,u=(0,hr.getPosition)(i.selectedItem,n),c=n.infiniteLoop?(0,hr.getPosition)(s-1,n)-100:(0,hr.getPosition)(s-1,n),d=a?t.x:t.y,f=d;u===l&&d>0&&(f=0),u===c&&d<0&&(f=0);var h=u+100/(i.itemSize/f),m=Math.abs(d)>n.swipeScrollTolerance;return n.infiniteLoop&&m&&(i.selectedItem===0&&h>-100?h-=s*100:i.selectedItem===s-1&&h<-s*100&&(h+=s*100)),(!n.preventMovementUntilSwipeScrollTolerance||m||i.swipeMovementStarted)&&(i.swipeMovementStarted||r({swipeMovementStarted:!0}),o.itemListStyle=(0,hr.setPosition)(h,n.axis)),m&&!i.cancelClick&&r({cancelClick:!0}),o};fr.slideSwipeAnimationHandler=mg;var pg=function(t,n){var i=(0,hr.getPosition)(n.selectedItem,t),r=(0,hr.setPosition)(i,t.axis);return{itemListStyle:r}};fr.slideStopSwipingHandler=pg;var vg=function(t,n){var i=t.transitionTime+"ms",r="ease-in-out",o={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:r,msTransitionTimingFunction:r,MozTransitionTimingFunction:r,WebkitTransitionTimingFunction:r,OTransitionTimingFunction:r};return n.swiping||(o=Jr(Jr({},o),{},{WebkitTransitionDuration:i,MozTransitionDuration:i,OTransitionDuration:i,transitionDuration:i,msTransitionDuration:i})),{slideStyle:o,selectedStyle:Jr(Jr({},o),{},{opacity:1,position:"relative"}),prevStyle:Jr({},o)}};fr.fadeAnimationHandler=vg;Object.defineProperty(Ra,"__esModule",{value:!0});Ra.default=void 0;var At=yg(g),bg=mo(Ns),yr=mo(fo),wg=mo(ho),No=mo(Ta),Bo=mo(go),Zi=Fn,ua=fr;function mo(e){return e&&e.__esModule?e:{default:e}}function Cc(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Cc=function(){return e},e}function yg(e){if(e&&e.__esModule)return e;if(e===null||eo(e)!=="object"&&typeof e!="function")return{default:e};var t=Cc();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=i?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,t&&t.set(e,n),n}function eo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?eo=function(n){return typeof n}:eo=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},eo(e)}function Ss(){return Ss=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ss.apply(this,arguments)}function Ul(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function nr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ul(Object(n),!0).forEach(function(i){ht(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ul(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Cg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function xg(e,t,n){return t&&Sg(e.prototype,t),e}function kg(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xs(e,t)}function xs(e,t){return xs=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},xs(e,t)}function Mg(e){var t=Eg();return function(){var i=ca(e),r;if(t){var o=ca(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return Rg(this,r)}}function Rg(e,t){return t&&(eo(t)==="object"||typeof t=="function")?t:pt(e)}function pt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Eg(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function ca(e){return ca=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ca(e)}function ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ws=function(e){kg(n,e);var t=Mg(n);function n(i){var r;Cg(this,n),r=t.call(this,i),ht(pt(r),"thumbsRef",void 0),ht(pt(r),"carouselWrapperRef",void 0),ht(pt(r),"listRef",void 0),ht(pt(r),"itemsRef",void 0),ht(pt(r),"timer",void 0),ht(pt(r),"animationHandler",void 0),ht(pt(r),"setThumbsRef",function(a){r.thumbsRef=a}),ht(pt(r),"setCarouselWrapperRef",function(a){r.carouselWrapperRef=a}),ht(pt(r),"setListRef",function(a){r.listRef=a}),ht(pt(r),"setItemsRef",function(a,s){r.itemsRef||(r.itemsRef=[]),r.itemsRef[s]=a}),ht(pt(r),"autoPlay",function(){At.Children.count(r.props.children)<=1||(r.clearAutoPlay(),r.props.autoPlay&&(r.timer=setTimeout(function(){r.increment()},r.props.interval)))}),ht(pt(r),"clearAutoPlay",function(){r.timer&&clearTimeout(r.timer)}),ht(pt(r),"resetAutoPlay",function(){r.clearAutoPlay(),r.autoPlay()}),ht(pt(r),"stopOnHover",function(){r.setState({isMouseEntered:!0},r.clearAutoPlay)}),ht(pt(r),"startOnLeave",function(){r.setState({isMouseEntered:!1},r.autoPlay)}),ht(pt(r),"isFocusWithinTheCarousel",function(){return r.carouselWrapperRef?!!((0,No.default)().activeElement===r.carouselWrapperRef||r.carouselWrapperRef.contains((0,No.default)().activeElement)):!1}),ht(pt(r),"navigateWithKeyboard",function(a){if(r.isFocusWithinTheCarousel()){var s=r.props.axis,l=s==="horizontal",u={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},c=l?u.ArrowRight:u.ArrowDown,d=l?u.ArrowLeft:u.ArrowUp;c===a.keyCode?r.increment():d===a.keyCode&&r.decrement()}}),ht(pt(r),"updateSizes",function(){if(!(!r.state.initialized||!r.itemsRef||r.itemsRef.length===0)){var a=r.props.axis==="horizontal",s=r.itemsRef[0];if(s){var l=a?s.clientWidth:s.clientHeight;r.setState({itemSize:l}),r.thumbsRef&&r.thumbsRef.updateSizes()}}}),ht(pt(r),"setMountState",function(){r.setState({hasMount:!0}),r.updateSizes()}),ht(pt(r),"handleClickItem",function(a,s){if(At.Children.count(r.props.children)!==0){if(r.state.cancelClick){r.setState({cancelClick:!1});return}r.props.onClickItem(a,s),a!==r.state.selectedItem&&r.setState({selectedItem:a})}}),ht(pt(r),"handleOnChange",function(a,s){At.Children.count(r.props.children)<=1||r.props.onChange(a,s)}),ht(pt(r),"handleClickThumb",function(a,s){r.props.onClickThumb(a,s),r.moveTo(a)}),ht(pt(r),"onSwipeStart",function(a){r.setState({swiping:!0}),r.props.onSwipeStart(a)}),ht(pt(r),"onSwipeEnd",function(a){r.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),r.props.onSwipeEnd(a),r.clearAutoPlay(),r.state.autoPlay&&r.autoPlay()}),ht(pt(r),"onSwipeMove",function(a,s){r.props.onSwipeMove(s);var l=r.props.swipeAnimationHandler(a,r.props,r.state,r.setState.bind(pt(r)));return r.setState(nr({},l)),!!Object.keys(l).length}),ht(pt(r),"decrement",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;r.moveTo(r.state.selectedItem-(typeof a=="number"?a:1))}),ht(pt(r),"increment",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;r.moveTo(r.state.selectedItem+(typeof a=="number"?a:1))}),ht(pt(r),"moveTo",function(a){if(typeof a=="number"){var s=At.Children.count(r.props.children)-1;a<0&&(a=r.props.infiniteLoop?s:0),a>s&&(a=r.props.infiniteLoop?0:s),r.selectItem({selectedItem:a}),r.state.autoPlay&&r.state.isMouseEntered===!1&&r.resetAutoPlay()}}),ht(pt(r),"onClickNext",function(){r.increment(1)}),ht(pt(r),"onClickPrev",function(){r.decrement(1)}),ht(pt(r),"onSwipeForward",function(){r.increment(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),ht(pt(r),"onSwipeBackwards",function(){r.decrement(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),ht(pt(r),"changeItem",function(a){return function(s){(!(0,Zi.isKeyboardEvent)(s)||s.key==="Enter")&&r.moveTo(a)}}),ht(pt(r),"selectItem",function(a){r.setState(nr({previousItem:r.state.selectedItem},a),function(){r.setState(r.animationHandler(r.props,r.state))}),r.handleOnChange(a.selectedItem,At.Children.toArray(r.props.children)[a.selectedItem])}),ht(pt(r),"getInitialImage",function(){var a=r.props.selectedItem,s=r.itemsRef&&r.itemsRef[a],l=s&&s.getElementsByTagName("img")||[];return l[0]}),ht(pt(r),"getVariableItemHeight",function(a){var s=r.itemsRef&&r.itemsRef[a];if(r.state.hasMount&&s&&s.children.length){var l=s.children[0].getElementsByTagName("img")||[];if(l.length>0){var u=l[0];if(!u.complete){var c=function h(){r.forceUpdate(),u.removeEventListener("load",h)};u.addEventListener("load",c)}}var d=l[0]||s.children[0],f=d.clientHeight;return f>0?f:null}return null});var o={initialized:!1,previousItem:i.selectedItem,selectedItem:i.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:i.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return r.animationHandler=typeof i.animationHandler=="function"&&i.animationHandler||i.animationHandler==="fade"&&ua.fadeAnimationHandler||ua.slideAnimationHandler,r.state=nr(nr({},o),r.animationHandler(i,o)),r}return xg(n,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(r,o){!r.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!r.autoFocus&&this.props.autoFocus&&this.forceFocus(),o.swiping&&!this.state.swiping&&this.setState(nr({},this.props.stopSwipingHandler(this.props,this.state))),(r.selectedItem!==this.props.selectedItem||r.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),r.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var r=this;this.bindEvents(),this.state.autoPlay&&At.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var o=r.getInitialImage();o&&!o.complete?o.addEventListener("load",r.setMountState):r.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var r=this.carouselWrapperRef;this.props.stopOnHover&&r&&(r.addEventListener("mouseenter",this.stopOnHover),r.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var r=this.carouselWrapperRef;this.props.stopOnHover&&r&&(r.removeEventListener("mouseenter",this.stopOnHover),r.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,Bo.default)().addEventListener("resize",this.updateSizes),(0,Bo.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,No.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,Bo.default)().removeEventListener("resize",this.updateSizes),(0,Bo.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var r=this.getInitialImage();r&&r.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,No.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var r;(r=this.carouselWrapperRef)===null||r===void 0||r.focus()}},{key:"renderItems",value:function(r){var o=this;return this.props.children?At.Children.map(this.props.children,function(a,s){var l=s===o.state.selectedItem,u=s===o.state.previousItem,c=l&&o.state.selectedStyle||u&&o.state.prevStyle||o.state.slideStyle||{};o.props.centerMode&&o.props.axis==="horizontal"&&(c=nr(nr({},c),{},{minWidth:o.props.centerSlidePercentage+"%"})),o.state.swiping&&o.state.swipeMovementStarted&&(c=nr(nr({},c),{},{pointerEvents:"none"}));var d={ref:function(h){return o.setItemsRef(h,s)},key:"itemKey"+s+(r?"clone":""),className:yr.default.ITEM(!0,s===o.state.selectedItem,s===o.state.previousItem),onClick:o.handleClickItem.bind(o,s,a),style:c};return At.default.createElement("li",d,o.props.renderItem(a,{isSelected:s===o.state.selectedItem,isPrevious:s===o.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var r=this,o=this.props,a=o.showIndicators,s=o.labels,l=o.renderIndicator,u=o.children;return a?At.default.createElement("ul",{className:"control-dots"},At.Children.map(u,function(c,d){return l&&l(r.changeItem(d),d===r.state.selectedItem,d,s.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?At.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,At.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||At.Children.count(this.props.children)===0?null:At.default.createElement(wg.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var r=this;if(!this.props.children||At.Children.count(this.props.children)===0)return null;var o=this.props.swipeable&&At.Children.count(this.props.children)>1,a=this.props.axis==="horizontal",s=this.props.showArrows&&At.Children.count(this.props.children)>1,l=s&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,u=s&&(this.state.selectedItem<At.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,c=this.renderItems(!0),d=c.shift(),f=c.pop(),h={className:yr.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},m={};if(a){if(h.onSwipeLeft=this.onSwipeForward,h.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var p=this.getVariableItemHeight(this.state.selectedItem);m.height=p||"auto"}}else h.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,h.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,h.style=nr(nr({},h.style),{},{height:this.state.itemSize}),m.height=this.state.itemSize;return At.default.createElement("div",{"aria-label":this.props.ariaLabel,className:yr.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},At.default.createElement("div",{className:yr.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,l,this.props.labels.leftArrow),At.default.createElement("div",{className:yr.default.WRAPPER(!0,this.props.axis),style:m},o?At.default.createElement(bg.default,Ss({tagName:"ul",innerRef:this.setListRef},h,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&f,this.renderItems(),this.props.infiniteLoop&&d):At.default.createElement("ul",{className:yr.default.SLIDER(!0,this.state.swiping),ref:function(w){return r.setListRef(w)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&f,this.renderItems(),this.props.infiniteLoop&&d)),this.props.renderArrowNext(this.onClickNext,u,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),n}(At.default.Component);Ra.default=Ws;ht(Ws,"displayName","Carousel");ht(Ws,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:Zi.noop,onClickThumb:Zi.noop,onChange:Zi.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(t,n,i){return At.default.createElement("button",{type:"button","aria-label":i,className:yr.default.ARROW_PREV(!n),onClick:t})},renderArrowNext:function(t,n,i){return At.default.createElement("button",{type:"button","aria-label":i,className:yr.default.ARROW_NEXT(!n),onClick:t})},renderIndicator:function(t,n,i,r){return At.default.createElement("li",{className:yr.default.DOT(n),onClick:t,onKeyDown:t,value:i,key:i,role:"button",tabIndex:0,"aria-label":"".concat(r," ").concat(i+1)})},renderItem:function(t){return t},renderThumbs:function(t){var n=At.Children.map(t,function(i){var r=i;if(i.type!=="img"&&(r=At.Children.toArray(i.props.children).find(function(o){return o.type==="img"})),!!r)return r});return n.filter(function(i){return i}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):n},statusFormatter:Zi.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:ua.slideSwipeAnimationHandler,stopSwipingHandler:ua.slideStopSwipingHandler});var Ig={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return i.default}});var t=r(Ra),n=Ig,i=r(ho);function r(o){return o&&o.__esModule?o:{default:o}}})(bc);var Tg=Hf,Dg=function(){return Tg.Date.now()},Og=Dg,Pg=oc,rs=Og,Yl=ac,_g="Expected a function",Lg=Math.max,Fg=Math.min;function Ag(e,t,n){var i,r,o,a,s,l,u=0,c=!1,d=!1,f=!0;if(typeof e!="function")throw new TypeError(_g);t=Yl(t)||0,Pg(n)&&(c=!!n.leading,d="maxWait"in n,o=d?Lg(Yl(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f);function h(x){var R=i,I=r;return i=r=void 0,u=x,a=e.apply(I,R),a}function m(x){return u=x,s=setTimeout(w,t),c?h(x):a}function p(x){var R=x-l,I=x-u,E=t-R;return d?Fg(E,o-I):E}function b(x){var R=x-l,I=x-u;return l===void 0||R>=t||R<0||d&&I>=o}function w(){var x=rs();if(b(x))return y(x);s=setTimeout(w,p(x))}function y(x){return s=void 0,f&&i?h(x):(i=r=void 0,a)}function S(){s!==void 0&&clearTimeout(s),u=0,i=l=r=s=void 0}function M(){return s===void 0?a:y(rs())}function C(){var x=rs(),R=b(x);if(i=arguments,r=this,l=x,R){if(s===void 0)return m(l);if(d)return clearTimeout(s),s=setTimeout(w,t),h(l)}return s===void 0&&(s=setTimeout(w,t)),a}return C.cancel=S,C.flush=M,C}var Sc=Ag;const xc=co(Sc);function fn(e,t,n,i,r=!1){const o=g.useRef();o.current=t,g.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,s=l=>{var u;(u=o.current)==null||u.call(a,l)};return a.addEventListener(e,s,{passive:i,capture:r}),()=>{a.removeEventListener(e,s,{capture:r})}},[e,n,i,r])}function Zr(e,t){return e===void 0?void 0:t}const Hg=Math.PI;function Xl(e){return e*Hg/180}const kc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Mc=(e,t,n,i,r)=>{switch(e){case"left":return Math.floor(t)+i+r/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-i-r/2}},Rc=(e,t,n)=>Math.min(e,t-n*2),Ec=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Us=e=>{const t=e.fgColor??"currentColor";return g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),g.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},zg=e=>{const t=e.fgColor??"currentColor";return g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function $g(e,t,n){const[i,r]=g.useState(e),o=g.useRef(!0);g.useEffect(()=>()=>{o.current=!1},[]);const a=g.useRef(xc(s=>{o.current&&r(s)},n));return g.useLayoutEffect(()=>{o.current&&a.current(()=>e())},t),i}const Vg="֑-߿יִ-﷽ﹰ-ﻼ",Ng="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Bg=new RegExp("^[^"+Ng+"]*["+Vg+"]");function Ys(e){return Bg.test(e)?"rtl":"not-rtl"}let Wo;function ks(){if(typeof document>"u")return 0;if(Wo!==void 0)return Wo;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let i=e.offsetWidth;return n===i&&(i=t.clientWidth),t.remove(),Wo=n-i,Wo}const qr=Symbol();function Wg(e){const t=g.useRef([qr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,i]=g.useState(e),[,r]=g.useState(),o=g.useCallback(s=>{const l=t.current[0];l!==qr&&(s=typeof s=="function"?s(l):s,s===l)||(l!==qr&&r({}),i(u=>typeof s=="function"?s(l===qr?u:l):s),t.current[0]=qr)},[]),a=g.useCallback(()=>{t.current[0]=qr,r({})},[]);return[t.current[0]===qr?n:t.current[0],o,a]}function Ic(e){if(e.length===0)return"";let t=0,n=0;for(const i of e){if(n+=i.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function Ug(e){const t=g.useRef(e);return ki(e,t.current)||(t.current=e),t.current}const Yg=e=>{const{urls:t,canWrite:n,onEditClick:i,renderImage:r}=e,o=t.filter(s=>s!=="");if(o.length===0)return null;const a=o.length>1;return g.createElement(Hh,{"data-testid":"GDG-default-image-overlay-editor"},g.createElement(bc.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},o.map(s=>{const l=(r==null?void 0:r(s))??g.createElement("img",{draggable:!1,src:s});return g.createElement("div",{className:"gdg-centering-container",key:s},l)})),n&&i&&g.createElement("button",{className:"gdg-edit-icon",onClick:i},g.createElement(Us,null)))};function Tc(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let ni=Tc();function Xg(e){ni=e}const Dc=/[&<>"']/,Gg=new RegExp(Dc.source,"g"),Oc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,jg=new RegExp(Oc.source,"g"),qg={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Gl=e=>qg[e];function vn(e,t){if(t){if(Dc.test(e))return e.replace(Gg,Gl)}else if(Oc.test(e))return e.replace(jg,Gl);return e}const Kg=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Pc(e){return e.replace(Kg,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const Zg=/(^|[^\[])\^/g;function Bt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(i,r)=>(r=r.source||r,r=r.replace(Zg,"$1"),e=e.replace(i,r),n),getRegex:()=>new RegExp(e,t)};return n}const Jg=/[^\w:]/g,Qg=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function jl(e,t,n){if(e){let i;try{i=decodeURIComponent(Pc(n)).replace(Jg,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}t&&!Qg.test(n)&&(n=rm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Uo={},em=/^[^:]+:\/*[^/]*$/,tm=/^([^:]+:)[\s\S]*$/,nm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function rm(e,t){Uo[" "+e]||(em.test(e)?Uo[" "+e]=e+"/":Uo[" "+e]=na(e,"/",!0)),e=Uo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(tm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(nm,"$1")+t:e+t}const da={exec:function(){}};function ql(e,t){const n=e.replace(/\|/g,(o,a,s)=>{let l=!1,u=a;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),i=n.split(/ \|/);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(/\\\|/g,"|");return i}function na(e,t,n){const i=e.length;if(i===0)return"";let r=0;for(;r<i;){const o=e.charAt(i-r-1);if(o===t&&!n)r++;else if(o!==t&&n)r++;else break}return e.slice(0,i-r)}function im(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let i=0,r=0;for(;r<n;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])i++;else if(e[r]===t[1]&&(i--,i<0))return r;return-1}function om(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Kl(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Zl(e,t,n,i){const r=t.href,o=t.title?vn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){i.state.inLink=!0;const s={type:"link",raw:n,href:r,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,s}return{type:"image",raw:n,href:r,title:o,text:vn(a)}}function am(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const i=n[1];return t.split(`
3
3
  `).map(r=>{const o=r.match(/^\s+/);if(o===null)return r;const[a]=o;return a.length>=i.length?r.slice(i.length):r}).join(`
4
4
  `)}class Xs{constructor(t){this.options=t||ni}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const i=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?i:na(i,`
5
5
  `)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const i=n[0],r=am(i,n[3]||"");return{type:"code",raw:i,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:r}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let i=n[2].trim();if(/#$/.test(i)){const r=na(i,"#");(this.options.pedantic||!r||/ $/.test(r))&&(i=r.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const i=n[0].replace(/^ *>[ \t]?/gm,""),r=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(i);return this.lexer.state.top=r,{type:"blockquote",raw:n[0],tokens:o,text:i}}}list(t){let n=this.rules.block.list.exec(t);if(n){let i,r,o,a,s,l,u,c,d,f,h,m,p=n[1].trim();const b=p.length>1,w={type:"list",raw:"",ordered:b,start:b?+p.slice(0,-1):"",loose:!1,items:[]};p=b?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=b?p:"[*+-]");const y=new RegExp(`^( {0,3}${p})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(m=!1,!(!(n=y.exec(t))||this.rules.block.hr.test(t)));){if(i=n[0],t=t.substring(i.length),c=n[2].split(`
@@ -169,10 +169,10 @@ Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An err
169
169
  `?(i.push(e.slice(r,a)),r=a+1,s===`
170
170
  `&&(n.push(i),i=[])):s==='"'&&(o=t.inString);break;case t.inString:s==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:s==='"'?o=t.inString:((s===" "||s===`
171
171
  `)&&(i.push(mu(e.slice(r,a))),r=a+1,s===`
172
- `&&(n.push(i),i=[])),o=t.None);break}a++}return r<e.length&&i.push(mu(e.slice(r,e.length))),n.push(i),n.map(s=>s.map(l=>({rawValue:l,formatted:l,format:"string"})))}function pu(e,t,n){var s;const i=$0(e,t),r=l=>{var u;(u=window.navigator.clipboard)==null||u.writeText(l)},o=(l,u)=>{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([l],{type:"text/plain"}),"text/html":new Blob([u],{type:"text/html"})})]),!0)},a=(l,u)=>{var c,d;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(c=n==null?void 0:n.clipboardData)==null||c.setData("text/plain",l),(d=n==null?void 0:n.clipboardData)==null||d.setData("text/html",u)}catch{o(l,u)||r(l)}};((s=window.navigator.clipboard)==null?void 0:s.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?a(i.textPlain,i.textHtml):r(i.textPlain),n==null||n.preventDefault()}function ld(e){return e!==!0}function vu(e){return typeof e=="string"?e:`${e}px`}const B0=()=>e=>e.innerWidth,W0=()=>e=>e.innerHeight,U0=hn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[B0()],"wmyidgi-1":[W0()]}}),Y0=e=>{const{inWidth:t,inHeight:n,children:i,...r}=e;return g.createElement(U0,{innerHeight:vu(n),innerWidth:vu(t),...r},i)},X0=2,G0=1300;function j0(e,t,n){const i=ae.useRef(0),[r,o]=e??[0,0];ae.useEffect(()=>{if(r===0&&o===0){i.current=0;return}let a=!1,s=0;const l=u=>{var c;if(!a){if(s===0)s=u;else{const d=u-s;i.current=Math.min(1,i.current+d/G0);const f=i.current**1.618*d*X0;(c=t.current)==null||c.scrollBy(r*f,o*f),s=u,n==null||n()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{a=!0}},[t,r,o,n])}function q0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:i,overscrollX:r,overscrollY:o,scaleToRem:a,remSize:s}){const[l,u,c,d,f,h]=ae.useMemo(()=>{if(!a||s===16)return[e,t,n,i,r,o];const m=s/16,p=e,b=Gc();return[typeof p=="number"?p*m:w=>Math.ceil(p(w)*m),Math.ceil(t*m),Math.ceil(n*m),{...i,headerIconSize:((i==null?void 0:i.headerIconSize)??b.headerIconSize)*m,cellHorizontalPadding:((i==null?void 0:i.cellHorizontalPadding)??b.cellHorizontalPadding)*m,cellVerticalPadding:((i==null?void 0:i.cellVerticalPadding)??b.cellVerticalPadding)*m},Math.ceil((r??0)*m),Math.ceil((o??0)*m)]},[n,t,r,o,s,e,a,i]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:f,overscrollY:h}}const Fr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ct(e,t){return e===!0?t:e===!1?"":e}function bu(e){const t=ma.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function K0(e){const t=Ug(e);return ae.useMemo(()=>{if(t===void 0)return bu(Fr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Fr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Fr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Fr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Fr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Fr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Fr.selectToLastCell};return bu({...Fr,...n})},[t])}function Z0(e){function t(i,r,o){if(typeof i=="number")return{headerIndex:i,isCollapsed:!1,depth:r,path:o};const a={headerIndex:i.headerIndex,isCollapsed:i.isCollapsed,depth:r,path:o};return i.subGroups!==void 0&&(a.subGroups=i.subGroups.map((s,l)=>t(s,r+1,[...o,l])).sort((s,l)=>s.headerIndex-l.headerIndex)),a}return e.map((i,r)=>t(i,0,[r])).sort((i,r)=>i.headerIndex-r.headerIndex)}function Qs(e,t){const n=[];function i(a,s,l=!1){let u=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(u=a.subGroups[0].headerIndex-a.headerIndex),u--,n.push({headerIndex:a.headerIndex,contentIndex:-1,skip:l,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:u}),a.subGroups)for(let c=0;c<a.subGroups.length;c++){const d=c<a.subGroups.length-1?a.subGroups[c+1].headerIndex:s;i(a.subGroups[c],d,l||a.isCollapsed)}}const r=Z0(e.groups);for(let a=0;a<r.length;a++){const s=a<r.length-1?r[a+1].headerIndex:null;i(r[a],s)}let o=0;for(const a of n)a.contentIndex=o,o+=a.rows;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...l}=a;return l})}function va(e,t){if(t===void 0||Qs.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const i of t){if(n===0)return{path:[...i.path,-1],originalIndex:i.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:i.rows};if(n--,!i.isCollapsed){if(n<i.rows)return{path:[...i.path,n],originalIndex:i.headerIndex+n,isGroupHeader:!1,groupIndex:n,contentIndex:i.contentIndex+n,groupRows:i.rows};n-=i.rows}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function J0(e,t,n,i){const r=ae.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]),o=ae.useMemo(()=>r===void 0?t:r.reduce((u,c)=>u+(c.isCollapsed?1:c.rows+1),0),[r,t]),a=ae.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>{const{isGroupHeader:c}=va(u,r);return c?e.height:typeof n=="number"?n:n(u)},[r,e,n]),s=ae.useCallback(u=>{if(r===void 0)return u;let c=u;for(const d of r){if(c===0)return;if(c--,!d.isCollapsed){if(c<d.rows)return d.contentIndex+c;c-=d.rows}}return u},[r]),l=Zr(i??(e==null?void 0:e.themeOverride),ae.useCallback(u=>{if(e===void 0)return i==null?void 0:i(u,u,u);if(i===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:c,contentIndex:d,groupIndex:f}=va(u,r);return c?e.themeOverride:i==null?void 0:i(u,f,d)},[r,i,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:s,getRowThemeOverride:l}:{rowHeight:a,rows:o,rowNumberMapper:s,getRowThemeOverride:l}}function Q0(e,t){const n=ae.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]);return{getRowGroupingForPath:cd,updateRowGroupingByPath:ud,mapper:ae.useCallback(i=>{if(typeof i=="number")return va(i,n);const r=va(i[1],n);return{...r,originalIndex:[i[0],r.originalIndex]}},[n])}}function ud(e,t,n){const[i,...r]=t;return r[0]===-1?e.map((o,a)=>a===i?{...o,...n}:o):e.map((o,a)=>a===i?{...o,subGroups:ud(o.subGroups??[],r,n)}:o)}function cd(e,t){const[n,...i]=t;return i[0]===-1?e[n]:cd(e[n].subGroups??[],i)}function ev(e,t){const[n]=g.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(i){const r=n.value;r!==i&&(n.value=i,n.callback(i,r))}}}));return n.callback=t,n.facade}function tv(e,t,n,i,r){const[o,a]=g.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),s=g.useMemo(()=>({x:i.current.x,y:o,width:i.current.width??1,height:i.current.height??1,ty:a}),[i,a,o]),[l,u,c]=Wg(s),d=g.useRef(r);d.current=r;const f=ev(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),h=(l.height??1)>1;g.useLayoutEffect(()=>{if(t!==void 0&&f.current!==null&&h){if(f.current.scrollTop===t)return;f.current.scrollTop=t,f.current.scrollTop!==t&&c(),d.current()}},[t,h,c,f]);const m=(l.width??1)>1;return g.useLayoutEffect(()=>{if(e!==void 0&&f.current!==null&&m){if(f.current.scrollLeft===e)return;f.current.scrollLeft=e,f.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,f]),{visibleRegion:l,setVisibleRegion:u,scrollRef:f}}const nv=g.lazy(async()=>await As(()=>import("./data-grid-overlay-editor.CXW3Vrt9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url));let rv=0;function iv(e){return up(Pl(Pl(e).filter(t=>t.span!==void 0).map(t=>{var n,i;return cr((((n=t.span)==null?void 0:n[0])??0)+1,(((i=t.span)==null?void 0:i[1])??0)+1)})))}function Xo(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const Go={kind:Z.Loading,allowOverlay:!1},jo={columns:yt.empty(),rows:yt.empty(),current:void 0},ov=(e,t)=>{var Tl,Dl,Ol;const[n,i]=g.useState(jo),[r,o]=g.useState(),a=g.useRef(null),s=g.useRef(null),[l,u]=g.useState(),c=g.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:f,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:b,columns:w,rows:y,getCellContent:S,onCellClicked:M,onCellActivated:C,onFillPattern:x,onFinishedEditing:R,coercePasteValue:I,drawHeader:E,drawCell:H,editorBloom:z,onHeaderClicked:L,onColumnProposeMove:_,rangeSelectionColumnSpanning:O=!0,spanRangeBehavior:ne="default",onGroupHeaderClicked:q,onCellContextMenu:oe,className:Se,onHeaderContextMenu:xe,getCellsForSelection:re,onGroupHeaderContextMenu:J,onGroupHeaderRenamed:ee,onCellEdited:ie,onCellsEdited:ge,onSearchResultsChanged:fe,searchResults:G,onSearchValueChange:P,searchValue:k,onKeyDown:$,onKeyUp:le,keybindings:Te,editOnType:Be=!0,onRowAppended:ce,onColumnMoved:nt,validateCell:ke,highlightRegions:bt,rangeSelect:Et="rect",columnSelect:at="multi",rowSelect:te="multi",rangeSelectionBlending:it="exclusive",columnSelectionBlending:me="exclusive",rowSelectionBlending:se="exclusive",onDelete:he,onDragStart:$e,onMouseMove:Le,onPaste:Je,copyHeaders:de=!1,freezeColumns:be=0,cellActivationBehavior:Ge="second-click",rowSelectionMode:Ae="auto",onHeaderMenuClick:tt,onHeaderIndicatorClick:wt,getGroupDetails:gt,rowGrouping:He,onSearchClose:_t,onItemHovered:Xt,onSelectionCleared:Ot,showSearch:Ht,onVisibleRegionChanged:rn,gridSelection:zt,onGridSelectionChange:gn,minColumnWidth:$t=50,maxColumnWidth:It=500,maxColumnAutoWidth:In,provideEditor:bn,trailingRowOptions:Oe,freezeTrailingRows:Vt=0,allowedFillDirections:dn="orthogonal",scrollOffsetX:De,scrollOffsetY:lt,verticalBorder:ze,onDragOverCell:Lt,onDrop:vt,onColumnResize:on,onColumnResizeEnd:Tt,onColumnResizeStart:Ft,customRenderers:Ve,fillHandle:Pt,experimental:Gt,fixedShadowX:jt,fixedShadowY:Kt,headerIcons:An,imageWindowLoader:Vr,initialSize:ir,isDraggable:A,onDragLeave:rt,onRowMoved:Qe,overscrollX:Wt,overscrollY:Tn,preventDiagonalScrolling:wn,rightElement:Gn,rightElementProps:Dn,trapFocus:Qt=!1,smoothScrollX:Hn,smoothScrollY:jn,scaleToRem:La=!1,rowHeight:bo=34,headerHeight:wo=36,groupHeaderHeight:Fa=wo,theme:oi,isOutsideClick:Mr,renderers:Ii,resizeIndicator:Aa,scrollToActiveCell:Ti=!0,drawFocusRing:Di=!0}=e,Nr=Di==="no-editor"?r===void 0:Di,en=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,kn=(en==null?void 0:en.kind)??e.rowMarkers??"none",Oi=(en==null?void 0:en.width)??e.rowMarkerWidth,Pi=(en==null?void 0:en.startIndex)??e.rowMarkerStartIndex??1,ai=(en==null?void 0:en.theme)??e.rowMarkerTheme,pr=en==null?void 0:en.headerTheme,vr=en==null?void 0:en.headerAlwaysVisible,si=te!=="multi",or=(en==null?void 0:en.checkboxStyle)??"square",ar=Math.max($t,20),Br=Math.max(It,ar),yo=Math.max(In??Br,ar),_i=g.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:je,rowNumberMapper:Co,rowHeight:So,getRowThemeOverride:zn}=J0(He,y,bo,h),xo=g.useMemo(()=>Number.parseFloat(_i.fontSize),[_i]),{rowHeight:qn,headerHeight:Li,groupHeaderHeight:ko,theme:Mo,overscrollX:Ha,overscrollY:za}=q0({groupHeaderHeight:Fa,headerHeight:wo,overscrollX:Wt,overscrollY:Tn,remSize:xo,rowHeight:So,scaleToRem:La,theme:oi}),$n=K0(Te),Rr=Oi??(y>1e4?48:y>1e3?44:y>100?36:32),Vn=kn!=="none",B=Vn?1:0,Zt=ce!==void 0,Er=(Oe==null?void 0:Oe.sticky)===!0,[li,ui]=g.useState(!1),Fi=Ht??li,$a=g.useCallback(()=>{_t!==void 0?_t():ui(!1)},[_t]),U=g.useMemo(()=>zt===void 0?void 0:Xo(zt,B),[zt,B])??n,un=g.useRef();un.current===void 0&&(un.current=new AbortController),g.useEffect(()=>()=>un==null?void 0:un.current.abort(),[]);const[cn,Va]=_0(re,S,B,un.current,je),F=g.useCallback((v,D,T)=>{if(ke===void 0)return!0;const N=[v[0]-B,v[1]];return ke==null?void 0:ke(N,D,T)},[B,ke]),Q=g.useRef(zt),we=g.useCallback((v,D)=>{D&&(v=V0(v,cn,B,ne,un.current)),gn!==void 0?(Q.current=Xo(v,-B),gn(Q.current)):i(v)},[gn,cn,B,ne]),ye=Zr(on,g.useCallback((v,D,T,N)=>{on==null||on(w[T-B],D,T-B,N)},[on,B,w])),ue=Zr(Tt,g.useCallback((v,D,T,N)=>{Tt==null||Tt(w[T-B],D,T-B,N)},[Tt,B,w])),Me=Zr(Ft,g.useCallback((v,D,T,N)=>{Ft==null||Ft(w[T-B],D,T-B,N)},[Ft,B,w])),ot=Zr(E,g.useCallback((v,D)=>(E==null?void 0:E({...v,columnIndex:v.columnIndex-B},D))??!1,[E,B])),st=Zr(H,g.useCallback((v,D)=>(H==null?void 0:H({...v,col:v.col-B},D))??!1,[H,B])),Ee=g.useCallback(v=>{if(he!==void 0){const D=he(Xo(v,-B));return typeof D=="boolean"?D:Xo(D,B)}return!0},[he,B]),[kt,Ce,qe]=P0(U,we,it,me,se,Et,O),We=g.useMemo(()=>Sr(Gc(),Mo),[Mo]),[ft,ln]=g.useState([0,0,0]),Mn=g.useMemo(()=>{if(Ii===void 0)return{};const v={};for(const D of Ii)v[D.kind]=D;return v},[Ii]),St=g.useCallback(v=>v.kind!==Z.Custom?Mn[v.kind]:Ve==null?void 0:Ve.find(D=>D.isMatch(v)),[Ve,Mn]);let{sizedColumns:Jt,nonGrowWidth:Kn}=zm(w,je,Va,ft[0]-(B===0?0:Rr)-ft[2],ar,yo,We,St,un.current);kn!=="none"&&(Kn+=Rr);const yn=g.useMemo(()=>Jt.some(v=>v.group!==void 0),[Jt]),Dt=yn?Li+ko:Li,Rn=U.rows.length,On=kn==="none"?void 0:Rn===0?!1:Rn===je?!0:void 0,xt=g.useMemo(()=>kn==="none"?Jt:[{title:"",width:Rr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:ai,rowMarker:or,rowMarkerChecked:On,headerRowMarkerTheme:pr,headerRowMarkerAlwaysVisible:vr,headerRowMarkerDisabled:si},...Jt],[kn,Jt,Rr,ai,or,On,pr,vr,si]),tn=g.useRef({height:1,width:1,x:0,y:0}),Ir=g.useRef(!1),{setVisibleRegion:Tr,visibleRegion:Wr,scrollRef:Ut}=tv(De,lt,qn,tn,()=>Ir.current=!0);tn.current=Wr;const tf=Wr.x+B,Ro=Wr.y,En=g.useRef(null),Cn=g.useCallback(v=>{var D;v===!0?(D=En.current)==null||D.focus():window.requestAnimationFrame(()=>{var T;(T=En.current)==null||T.focus()})},[]),mn=Zt?je+1:je,Nn=g.useCallback(v=>{const D=B===0?v:v.map(N=>({...N,location:[N.location[0]-B,N.location[1]]})),T=ge==null?void 0:ge(D);if(T!==!0)for(const N of D)ie==null||ie(N.location,N.value);return T},[ie,ge,B]),[Ur,Na]=g.useState(),Eo=U.current!==void 0&&U.current.range.width*U.current.range.height>1?U.current.range:void 0,ci=Nr?(Tl=U.current)==null?void 0:Tl.cell:void 0,Io=ci==null?void 0:ci[0],To=ci==null?void 0:ci[1],nf=g.useMemo(()=>{if((bt===void 0||bt.length===0)&&(Eo??Io??To??Ur)===void 0)return;const v=[];if(bt!==void 0)for(const D of bt){const T=xt.length-D.range.x-B;T>0&&v.push({color:D.color,range:{...D.range,x:D.range.x+B,width:Math.min(T,D.range.width)},style:D.style})}return Ur!==void 0&&v.push({color:ei(We.accentColor,0),range:Ur,style:"dashed"}),Eo!==void 0&&v.push({color:ei(We.accentColor,.5),range:Eo,style:"solid-outline"}),Io!==void 0&&To!==void 0&&v.push({color:We.accentColor,range:{x:Io,y:To,width:1,height:1},style:"solid-outline"}),v.length>0?v:void 0},[Ur,Eo,Io,To,bt,xt.length,We.accentColor,B]),ml=g.useRef(xt);ml.current=xt;const Pn=g.useCallback(([v,D],T=!1)=>{var X,W,Y,j,K,pe,Pe;const N=Zt&&D===mn-1;if(v===0&&Vn){if(N)return Go;const ve=Co(D);return ve===void 0?Go:{kind:Xn.Marker,allowOverlay:!1,checkboxStyle:or,checked:(U==null?void 0:U.rows.hasIndex(D))===!0,markerKind:kn==="clickable-number"?"number":kn,row:Pi+ve,drawHandle:Qe!==void 0,cursor:kn==="clickable-number"?"pointer":void 0}}else if(N){const Fe=v===B?(Oe==null?void 0:Oe.hint)??"":"",Ie=ml.current[v];if(((X=Ie==null?void 0:Ie.trailingRowOptions)==null?void 0:X.disabled)===!0)return Go;{const mt=((W=Ie==null?void 0:Ie.trailingRowOptions)==null?void 0:W.hint)??Fe,Ue=((Y=Ie==null?void 0:Ie.trailingRowOptions)==null?void 0:Y.addIcon)??(Oe==null?void 0:Oe.addIcon);return{kind:Xn.NewRow,hint:mt,allowOverlay:!1,icon:Ue}}}else{const ve=v-B;if(T||(Gt==null?void 0:Gt.strict)===!0){const Ie=tn.current,mt=Ie.x>ve||ve>Ie.x+Ie.width||Ie.y>D||D>Ie.y+Ie.height||D>=Wa.current,Ue=ve===((K=(j=Ie.extras)==null?void 0:j.selected)==null?void 0:K[0])&&D===((pe=Ie.extras)==null?void 0:pe.selected[1]);let _e=!1;if(((Pe=Ie.extras)==null?void 0:Pe.freezeRegions)!==void 0){for(const Mt of Ie.extras.freezeRegions)if(Qr(Mt,ve,D)){_e=!0;break}}if(mt&&!Ue&&!_e)return Go}let Fe=S([ve,D]);return B!==0&&Fe.span!==void 0&&(Fe={...Fe,span:[Fe.span[0]+B,Fe.span[1]+B]}),Fe}},[Zt,mn,Vn,Co,or,U==null?void 0:U.rows,kn,Pi,Qe,B,Oe==null?void 0:Oe.hint,Oe==null?void 0:Oe.addIcon,Gt==null?void 0:Gt.strict,S]),Ba=g.useCallback(v=>{let D=(gt==null?void 0:gt(v))??{name:v};return ee!==void 0&&v!==""&&(D={icon:D.icon,name:D.name,overrideTheme:D.overrideTheme,actions:[...D.actions??[],{title:"Rename",icon:"renameIcon",onClick:T=>Ya({group:D.name,bounds:T.bounds})}]}),D},[gt,ee]),Do=g.useCallback(v=>{var Y;const[D,T]=v.cell,N=xt[D],V=(N==null?void 0:N.group)!==void 0?(Y=Ba(N.group))==null?void 0:Y.overrideTheme:void 0,X=N==null?void 0:N.themeOverride,W=zn==null?void 0:zn(T);o({...v,theme:Sr(We,V,X,W,v.content.themeOverride)})},[zn,xt,Ba,We]),di=g.useCallback((v,D,T)=>{var W;if(U.current===void 0)return;const[N,V]=U.current.cell,X=Pn([N,V]);if(X.kind!==Z.Boolean&&X.allowOverlay){let Y=X;if(T!==void 0)switch(Y.kind){case Z.Number:{const j=wh(()=>T==="-"?-0:Number.parseFloat(T),0);Y={...Y,data:Number.isNaN(j)?0:j};break}case Z.Text:case Z.Markdown:case Z.Uri:Y={...Y,data:T};break}Do({target:v,content:Y,initialValue:T,cell:[N,V],highlight:T===void 0,forceEditMode:T!==void 0})}else X.kind===Z.Boolean&&D&&X.readonly!==!0&&(Nn([{location:U.current.cell,value:{...X,data:ld(X.data)}}]),(W=En.current)==null||W.damage([{cell:U.current.cell}]))},[Pn,U,Nn,Do]),pl=g.useCallback((v,D)=>{var V;const T=(V=En.current)==null?void 0:V.getBounds(v,D);if(T===void 0||Ut.current===null)return;const N=Pn([v,D]);N.allowOverlay&&Do({target:T,content:N,initialValue:void 0,highlight:!0,cell:[v,D],forceEditMode:!0})},[Pn,Ut,Do]),an=g.useCallback((v,D,T="both",N=0,V=0,X=void 0)=>{if(Ut.current!==null){const W=En.current,Y=s.current,j=typeof v!="number"?v.unit==="cell"?v.amount:void 0:v,K=typeof D!="number"?D.unit==="cell"?D.amount:void 0:D,pe=typeof v!="number"&&v.unit==="px"?v.amount:void 0,Pe=typeof D!="number"&&D.unit==="px"?D.amount:void 0;if(W!==null&&Y!==null){let ve={x:0,y:0,width:0,height:0},Fe=0,Ie=0;if((j!==void 0||K!==void 0)&&(ve=W.getBounds((j??0)+B,K??0)??ve,ve.width===0||ve.height===0))return;const mt=Y.getBoundingClientRect(),Ue=mt.width/Y.offsetWidth;if(pe!==void 0&&(ve={...ve,x:pe-mt.left-Ut.current.scrollLeft,width:1}),Pe!==void 0&&(ve={...ve,y:Pe+mt.top-Ut.current.scrollTop,height:1}),ve!==void 0){const _e={x:ve.x-N,y:ve.y-V,width:ve.width+2*N,height:ve.height+2*V};let Mt=0;for(let Ja=0;Ja<be;Ja++)Mt+=Jt[Ja].width;let qt=0;const sn=Vt+(Er?1:0);sn>0&&(qt=ri(mn,sn,qn));let Qn=Mt*Ue+mt.left+B*Rr*Ue,lr=mt.right,er=mt.top+Dt*Ue,ur=mt.bottom-qt*Ue;const Ho=ve.width+N*2;switch(X==null?void 0:X.hAlign){case"start":lr=Qn+Ho;break;case"end":Qn=lr-Ho;break;case"center":Qn=Math.floor((Qn+lr)/2)-Ho/2,lr=Qn+Ho;break}const zo=ve.height+V*2;switch(X==null?void 0:X.vAlign){case"start":ur=er+zo;break;case"end":er=ur-zo;break;case"center":er=Math.floor((er+ur)/2)-zo/2,ur=er+zo;break}Qn>_e.x?Fe=_e.x-Qn:lr<_e.x+_e.width&&(Fe=_e.x+_e.width-lr),er>_e.y?Ie=_e.y-er:ur<_e.y+_e.height&&(Ie=_e.y+_e.height-ur),T==="vertical"||typeof v=="number"&&v<be?Fe=0:(T==="horizontal"||typeof D=="number"&&D>=mn-sn)&&(Ie=0),(Fe!==0||Ie!==0)&&(Ue!==1&&(Fe/=Ue,Ie/=Ue),Ut.current.scrollTo(Fe+Ut.current.scrollLeft,Ie+Ut.current.scrollTop))}}}},[B,Vt,Rr,Ut,Dt,be,Jt,mn,Er,qn]),vl=g.useRef(pl),bl=g.useRef(S),Wa=g.useRef(je);vl.current=pl,bl.current=S,Wa.current=je;const fi=g.useCallback(async(v,D=!0)=>{var j;const T=xt[v];if(((j=T==null?void 0:T.trailingRowOptions)==null?void 0:j.disabled)===!0)return;const N=ce==null?void 0:ce();let V,X=!0;N!==void 0&&(V=await N,V==="top"&&(X=!1),typeof V=="number"&&(X=!1));let W=0;const Y=()=>{if(Wa.current<=je){W<500&&window.setTimeout(Y,W),W=50+W*2;return}const K=typeof V=="number"?V:X?je:0;Ao.current(v-B,K),kt({cell:[v,K],range:{x:v,y:K,width:1,height:1}},!1,!1,"edit");const pe=bl.current([v-B,K]);pe.allowOverlay&&Ki(pe)&&pe.readonly!==!0&&D&&window.setTimeout(()=>{vl.current(v,K)},0)};Y()},[xt,ce,B,je,kt]),Oo=g.useCallback(v=>{var T,N;const D=((N=(T=Jt[v])==null?void 0:T.trailingRowOptions)==null?void 0:N.targetColumn)??(Oe==null?void 0:Oe.targetColumn);if(typeof D=="number")return D+(Vn?1:0);if(typeof D=="object"){const V=w.indexOf(D);if(V>=0)return V+(Vn?1:0)}},[Jt,w,Vn,Oe==null?void 0:Oe.targetColumn]),Dr=g.useRef(),hi=g.useRef(),Hi=g.useCallback((v,D)=>{var V;const[T,N]=D;return Sr(We,(V=xt[T])==null?void 0:V.themeOverride,zn==null?void 0:zn(N),v.themeOverride)},[zn,xt,We]),{mapper:Yr}=Q0(He,y),Zn=He==null?void 0:He.navigationBehavior,zi=g.useCallback(v=>{var pe,Pe,ve;const D=ma.value?v.metaKey:v.ctrlKey,T=D&&te==="multi",N=D&&at==="multi",[V,X]=v.location,W=U.columns,Y=U.rows,[j,K]=((pe=U.current)==null?void 0:pe.cell)??[];if(v.kind==="cell"){if(hi.current=void 0,Xr.current=[V,X],V===0&&Vn){if(Zt===!0&&X===je||kn==="number"||te==="none")return;const Fe=Pn(v.location);if(Fe.kind!==Xn.Marker)return;if(Qe!==void 0){const Ue=St(Fe);_n((Ue==null?void 0:Ue.kind)===Xn.Marker);const _e=(Pe=Ue==null?void 0:Ue.onClick)==null?void 0:Pe.call(Ue,{...v,cell:Fe,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,theme:Hi(Fe,v.location),preventDefault:()=>{}});if(_e===void 0||_e.checked===Fe.checked)return}o(void 0),Cn();const Ie=Y.hasIndex(X),mt=Dr.current;if(te==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&mt!==void 0&&Y.hasIndex(mt)){const Ue=[Math.min(mt,X),Math.max(mt,X)+1];T||Ae==="multi"?Ce(void 0,Ue,!0):Ce(yt.fromSingleSelection(Ue),void 0,T)}else te==="multi"&&(T||v.isTouch||Ae==="multi")?Ie?Ce(Y.remove(X),void 0,!0):(Ce(void 0,X,!0),Dr.current=X):Ie&&Y.length===1?Ce(yt.empty(),void 0,D):(Ce(yt.fromSingleSelection(X),void 0,D),Dr.current=X)}else if(V>=B&&Zt&&X===je){const Fe=Oo(V);fi(Fe??V)}else if(j!==V||K!==X){const Fe=Pn(v.location),Ie=St(Fe);if((Ie==null?void 0:Ie.onSelect)!==void 0){let _e=!1;if(Ie.onSelect({...v,cell:Fe,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,preventDefault:()=>_e=!0,theme:Hi(Fe,v.location)}),_e)return}if(Zn==="block"&&Yr(X).isGroupHeader)return;const mt=Er&&X===je,Ue=Er&&U!==void 0&&((ve=U.current)==null?void 0:ve.cell[1])===je;if((v.shiftKey||v.isLongTouch===!0)&&j!==void 0&&K!==void 0&&U.current!==void 0&&!Ue){if(mt)return;const _e=Math.min(V,j),Mt=Math.max(V,j),qt=Math.min(X,K),sn=Math.max(X,K);kt({...U.current,range:{x:_e,y:qt,width:Mt-_e+1,height:sn-qt+1}},!0,D,"click"),Dr.current=void 0,Cn()}else kt({cell:[V,X],range:{x:V,y:X,width:1,height:1}},!0,D,"click"),Dr.current=void 0,o(void 0),Cn()}}else if(v.kind==="header")if(Xr.current=[V,X],o(void 0),Vn&&V===0)Dr.current=void 0,hi.current=void 0,te==="multi"&&(Y.length!==je?Ce(yt.fromSingleSelection([0,je]),void 0,D):Ce(yt.empty(),void 0,D),Cn());else{const Fe=hi.current;if(at==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&Fe!==void 0&&W.hasIndex(Fe)){const Ie=[Math.min(Fe,V),Math.max(Fe,V)+1];N?qe(void 0,Ie,D):qe(yt.fromSingleSelection(Ie),void 0,D)}else N?(W.hasIndex(V)?qe(W.remove(V),void 0,D):qe(void 0,V,D),hi.current=V):at!=="none"&&(qe(yt.fromSingleSelection(V),void 0,D),hi.current=V);Dr.current=void 0,Cn()}else v.kind===Yn?Xr.current=[V,X]:v.kind===pa&&!v.isMaybeScrollbar&&(we(jo,!1),o(void 0),Cn(),Ot==null||Ot(),Dr.current=void 0,hi.current=void 0)},[te,at,U,Vn,B,Zt,je,kn,Pn,Qe,Cn,Ae,St,Hi,Ce,Oo,fi,Zn,Yr,Er,kt,qe,we,Ot]),$i=g.useRef(!1),Xr=g.useRef(),wl=g.useRef(Wr),Bn=g.useRef(),rf=g.useCallback(v=>{if(gi.current=!1,wl.current=tn.current,v.button!==0&&v.button!==1){Bn.current=void 0;return}const D=performance.now();Bn.current={button:v.button,time:D,location:v.location},(v==null?void 0:v.kind)==="header"&&($i.current=!0);const T=v.kind==="cell"&&v.isFillHandle;!T&&v.kind!=="cell"&&v.isEdge||(u({previousSelection:U,fillHandle:T}),Xr.current=void 0,!v.isTouch&&v.button===0&&!T?zi(v):!v.isTouch&&v.button===1&&(Xr.current=v.location))},[U,zi]),[Ua,Ya]=g.useState(),yl=g.useCallback(v=>{if(v.kind!==Yn||at!=="multi")return;const D=ma.value?v.metaKey:v.ctrlKey,[T]=v.location,N=U.columns;if(T<B)return;const V=xt[T];let X=T,W=T;for(let Y=T-1;Y>=B&&so(V.group,xt[Y].group);Y--)X--;for(let Y=T+1;Y<xt.length&&so(V.group,xt[Y].group);Y++)W++;if(Cn(),D)if(N.hasAll([X,W+1])){let Y=N;for(let j=X;j<=W;j++)Y=Y.remove(j);qe(Y,void 0,D)}else qe(void 0,[X,W+1],D);else qe(yt.fromSingleSelection([X,W+1]),void 0,D)},[at,Cn,U.columns,xt,B,qe]),gi=g.useRef(!1),Po=g.useCallback(async v=>{if(cn!==void 0&&ye!==void 0){const D=tn.current.y,T=tn.current.height;let N=cn({x:v,y:D,width:1,height:Math.min(T,je-D)},un.current.signal);typeof N!="object"&&(N=await N());const V=Jt[v-B],W=document.createElement("canvas").getContext("2d",{alpha:!1});if(W!==null){W.font=We.baseFontFull;const Y=qc(W,We,V,0,N,ar,Br,!1,St);ye==null||ye(V,Y.width,v,Y.width)}}},[Jt,cn,Br,We,ar,ye,B,je,St]),[of,Xa]=g.useState(),mi=g.useCallback(async(v,D)=>{var Y,j;const T=(Y=v.current)==null?void 0:Y.range;if(T===void 0||cn===void 0||D.current===void 0)return;const N=D.current.range;if(x!==void 0){let K=!1;if(x({fillDestination:{...N,x:N.x-B},patternSource:{...T,x:T.x-B},preventDefault:()=>K=!0}),K)return}let V=cn(T,un.current.signal);typeof V!="object"&&(V=await V());const X=V,W=[];for(let K=0;K<N.width;K++)for(let pe=0;pe<N.height;pe++){const Pe=[N.x+K,N.y+pe];if(Ac(Pe,T))continue;const ve=X[pe%T.height][K%T.width];wi(ve)||!Ki(ve)||W.push({location:Pe,value:{...ve}})}Nn(W),(j=En.current)==null||j.damage(W.map(K=>({cell:K.location})))},[cn,Nn,x,B]),Cl=g.useCallback(()=>{if(U.current===void 0||U.current.range.width<=1)return;const v={...U,current:{...U.current,range:{...U.current.range,width:1}}};mi(v,U)},[mi,U]),Sl=g.useCallback(()=>{if(U.current===void 0||U.current.range.height<=1)return;const v={...U,current:{...U.current,range:{...U.current.range,height:1}}};mi(v,U)},[mi,U]),af=g.useCallback((v,D)=>{var pe,Pe;const T=l;if(u(void 0),Na(void 0),Xa(void 0),$i.current=!1,D)return;if((T==null?void 0:T.fillHandle)===!0&&U.current!==void 0&&((pe=T.previousSelection)==null?void 0:pe.current)!==void 0){if(Ur===void 0)return;const ve={...U,current:{...U.current,range:ed(T.previousSelection.current.range,Ur)}};mi(T.previousSelection,ve),we(ve,!0);return}const[N,V]=v.location,[X,W]=Xr.current??[],Y=()=>{gi.current=!0},j=ve=>{var Ie,mt,Ue;const Fe=ve.isTouch||X===N&&W===V;if(Fe&&(M==null||M([N-B,V],{...ve,preventDefault:Y})),ve.button===1)return!gi.current;if(!gi.current){const _e=Pn(v.location),Mt=St(_e);if(Mt!==void 0&&Mt.onClick!==void 0&&Fe){const sn=Mt.onClick({...ve,cell:_e,posX:ve.localEventX,posY:ve.localEventY,bounds:ve.bounds,theme:Hi(_e,v.location),preventDefault:Y});sn!==void 0&&!wi(sn)&&vi(sn)&&(Nn([{location:ve.location,value:sn}]),(Ie=En.current)==null||Ie.damage([{cell:ve.location}]))}if(gi.current||U.current===void 0)return!1;let qt=!1;switch(_e.activationBehaviorOverride??Ge){case"double-click":case"second-click":{if(((Ue=(mt=T==null?void 0:T.previousSelection)==null?void 0:mt.current)==null?void 0:Ue.cell)===void 0)break;const[sn,Qn]=U.current.cell,[lr,er]=T.previousSelection.current.cell;qt=N===sn&&N===lr&&V===Qn&&V===er&&(ve.isDoubleClick===!0||Ge==="second-click");break}case"single-click":{qt=!0;break}}if(qt)return C==null||C([N-B,V]),di(ve.bounds,!1),!0}return!1},K=v.location[0]-B;if(v.isTouch){const ve=tn.current,Fe=wl.current;if(ve.x!==Fe.x||ve.y!==Fe.y)return;if(v.isLongTouch===!0){if(v.kind==="cell"&&no((Pe=U.current)==null?void 0:Pe.cell,v.location)){oe==null||oe([K,v.location[1]],{...v,preventDefault:Y});return}else if(v.kind==="header"&&U.columns.hasIndex(N)){xe==null||xe(K,{...v,preventDefault:Y});return}else if(v.kind===Yn){if(K<0)return;J==null||J(K,{...v,preventDefault:Y});return}}v.kind==="cell"?j(v)||zi(v):v.kind===Yn?q==null||q(K,{...v,preventDefault:Y}):(v.kind===Ar&&(L==null||L(K,{...v,preventDefault:Y})),zi(v));return}if(v.kind==="header"){if(K<0)return;v.isEdge?v.isDoubleClick===!0&&Po(N):v.button===0&&N===X&&V===W&&(L==null||L(K,{...v,preventDefault:Y}))}if(v.kind===Yn){if(K<0)return;v.button===0&&N===X&&V===W&&(q==null||q(K,{...v,preventDefault:Y}),gi.current||yl(v))}v.kind==="cell"&&(v.button===0||v.button===1)&&j(v),Xr.current=void 0},[l,U,B,Ur,mi,we,M,Pn,St,Ge,Hi,Nn,C,di,oe,xe,J,zi,q,L,Po,yl]),sf=g.useCallback(v=>{const D={...v,location:[v.location[0]-B,v.location[1]]};Le==null||Le(D),l!==void 0&&v.buttons===0&&(u(void 0),Na(void 0),Xa(void 0),$i.current=!1),Xa(T=>{var N;return $i.current?[v.scrollEdge[0],0]:v.scrollEdge[0]===(T==null?void 0:T[0])&&v.scrollEdge[1]===T[1]?T:l===void 0||(((N=Bn.current)==null?void 0:N.location[0])??0)<B?void 0:v.scrollEdge})},[l,Le,B]),lf=g.useCallback((v,D)=>{tt==null||tt(v-B,D)},[tt,B]),uf=g.useCallback((v,D)=>{wt==null||wt(v-B,D)},[wt,B]),sr=(Dl=U==null?void 0:U.current)==null?void 0:Dl.cell,cf=g.useCallback((v,D,T,N,V,X)=>{Ir.current=!1;let W=sr;W!==void 0&&(W=[W[0]-B,W[1]]);const Y=be===0?void 0:{x:0,y:v.y,width:be,height:v.height},j=[];Y!==void 0&&j.push(Y),Vt>0&&(j.push({x:v.x-B,y:je-Vt,width:v.width,height:Vt}),be>0&&j.push({x:0,y:je-Vt,width:be,height:Vt}));const K={x:v.x-B,y:v.y,width:v.width,height:Zt&&v.y+v.height>=je?v.height-1:v.height,tx:V,ty:X,extras:{selected:W,freezeRegion:Y,freezeRegions:j}};tn.current=K,Tr(K),ln([D,T,N]),rn==null||rn(K,K.tx,K.ty,K.extras)},[sr,B,Zt,je,be,Vt,Tr,rn]),df=Zr(nt,g.useCallback((v,D)=>{nt==null||nt(v-B,D-B),at!=="none"&&qe(yt.fromSingleSelection(D),void 0,!0)},[at,nt,B,qe])),Ga=g.useRef(!1),ff=g.useCallback(v=>{if(v.location[0]===0&&B>0){v.preventDefault();return}$e==null||$e({...v,location:[v.location[0]-B,v.location[1]]}),v.defaultPrevented()||(Ga.current=!0),u(void 0)},[$e,B]),hf=g.useCallback(()=>{Ga.current=!1},[]),xl=He==null?void 0:He.selectionBehavior,_o=g.useCallback(v=>{if(xl!=="block-spanning")return;const{isGroupHeader:D,path:T,groupRows:N}=Yr(v);if(D)return[v,v];const V=T[T.length-1],X=v-V,W=v+N-V-1;return[X,W]},[Yr,xl]),ja=g.useRef(),qa=g.useCallback(v=>{var D,T,N;if(!ad(v,ja.current)&&(ja.current=v,!(((D=Bn==null?void 0:Bn.current)==null?void 0:D.button)!==void 0&&Bn.current.button>=1))){if(v.buttons!==0&&l!==void 0&&((T=Bn.current)==null?void 0:T.location[0])===0&&v.location[0]===0&&B===1&&te==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(Bn.current.location[1])&&U.rows.hasIndex(Bn.current.location[1])){const V=Math.min(Bn.current.location[1],v.location[1]),X=Math.max(Bn.current.location[1],v.location[1])+1;Ce(yt.fromSingleSelection([V,X]),void 0,!1)}if(v.buttons!==0&&l!==void 0&&U.current!==void 0&&!Ga.current&&!$i.current&&(Et==="rect"||Et==="multi-rect")){const[V,X]=U.current.cell;let[W,Y]=v.location;if(Y<0&&(Y=tn.current.y),l.fillHandle===!0&&((N=l.previousSelection)==null?void 0:N.current)!==void 0){const j=l.previousSelection.current.range;Y=Math.min(Y,Zt?je-1:je);const K=Np(j,W,Y,dn);Na(K)}else{if(Zt&&X===je)return;if(Zt&&Y===je)if(v.kind===pa)Y--;else return;W=Math.max(W,B);const pe=_o(X);Y=pe===void 0?Y:Wn(Y,pe[0],pe[1]);const Pe=W-V,ve=Y-X,Fe={x:Pe>=0?V:W,y:ve>=0?X:Y,width:Math.abs(Pe)+1,height:Math.abs(ve)+1};kt({...U.current,range:Fe},!0,!1,"drag")}}Xt==null||Xt({...v,location:[v.location[0]-B,v.location[1]]})}},[l,B,te,U,Et,Xt,Ce,Zt,je,dn,_o,kt]),gf=g.useCallback(()=>{var W,Y;const v=ja.current;if(v===void 0)return;const[D,T]=v.scrollEdge;let[N,V]=v.location;const X=tn.current;D===-1?N=((Y=(W=X.extras)==null?void 0:W.freezeRegion)==null?void 0:Y.x)??X.x:D===1&&(N=X.x+X.width),T===-1?V=Math.max(0,X.y):T===1&&(V=Math.min(je-1,X.y+X.height)),N=Wn(N,0,xt.length-1),V=Wn(V,0,je-1),qa({...v,location:[N,V]})},[xt.length,qa,je]);j0(of,Ut,gf);const Jn=g.useCallback(v=>{if(U.current===void 0)return;const[D,T]=v,[N,V]=U.current.cell,X=U.current.range;let W=X.x,Y=X.x+X.width,j=X.y,K=X.y+X.height;const[pe,Pe]=_o(V)??[0,je-1],ve=Pe+1;if(T!==0)switch(T){case 2:{K=ve,j=V,an(0,K,"vertical");break}case-2:{j=pe,K=V+1,an(0,j,"vertical");break}case 1:{j<V?(j++,an(0,j,"vertical")):(K=Math.min(ve,K+1),an(0,K,"vertical"));break}case-1:{K>V+1?(K--,an(0,K,"vertical")):(j=Math.max(pe,j-1),an(0,j,"vertical"));break}default:ao()}if(D!==0)if(D===2)Y=xt.length,W=N,an(Y-1-B,0,"horizontal");else if(D===-2)W=B,Y=N+1,an(W-B,0,"horizontal");else{let Fe=[];if(cn!==void 0){const Ie=cn({x:W,y:j,width:Y-W-B,height:K-j},un.current.signal);typeof Ie=="object"&&(Fe=iv(Ie))}if(D===1){let Ie=!1;if(W<N){if(Fe.length>0){const mt=cr(W+1,N+1).find(Ue=>!Fe.includes(Ue-B));mt!==void 0&&(W=mt,Ie=!0)}else W++,Ie=!0;Ie&&an(W,0,"horizontal")}Ie||(Y=Math.min(xt.length,Y+1),an(Y-1-B,0,"horizontal"))}else if(D===-1){let Ie=!1;if(Y>N+1){if(Fe.length>0){const mt=cr(Y-1,N,-1).find(Ue=>!Fe.includes(Ue-B));mt!==void 0&&(Y=mt,Ie=!0)}else Y--,Ie=!0;Ie&&an(Y-B,0,"horizontal")}Ie||(W=Math.max(B,W-1),an(W-B,0,"horizontal"))}else ao()}kt({cell:U.current.cell,range:{x:W,y:j,width:Y-W,height:K-j}},!0,!1,"keyboard-select")},[cn,_o,U,xt.length,B,je,an,kt]),Ka=g.useRef(Ti);Ka.current=Ti;const Or=g.useCallback((v,D,T,N)=>{const V=mn-(T?0:1);v=Wn(v,B,Jt.length-1+B),D=Wn(D,0,V);const X=sr==null?void 0:sr[0],W=sr==null?void 0:sr[1];if(v===X&&D===W)return!1;if(N&&U.current!==void 0){const Y=[...U.current.rangeStack];(U.current.range.width>1||U.current.range.height>1)&&Y.push(U.current.range),we({...U,current:{cell:[v,D],range:{x:v,y:D,width:1,height:1},rangeStack:Y}},!0)}else kt({cell:[v,D],range:{x:v,y:D,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===v&&c.current[1]===D&&(c.current=void 0),Ka.current&&an(v-B,D),!0},[mn,B,Jt.length,sr,U,an,we,kt]),mf=g.useCallback((v,D)=>{(r==null?void 0:r.cell)!==void 0&&v!==void 0&&vi(v)&&(Nn([{location:r.cell,value:v}]),window.requestAnimationFrame(()=>{var V;(V=En.current)==null||V.damage([{cell:r.cell}])})),Cn(!0),o(void 0);const[T,N]=D;if(U.current!==void 0&&(T!==0||N!==0)){const V=U.current.cell[1]===mn-1&&v!==void 0;Or(Wn(U.current.cell[0]+T,0,xt.length-1),Wn(U.current.cell[1]+N,0,mn-1),V,!1)}R==null||R(v,D)},[r==null?void 0:r.cell,Cn,U,R,Nn,mn,Or,xt.length]),pf=g.useMemo(()=>`gdg-overlay-${rv++}`,[]),Gr=g.useCallback(v=>{var T,N,V,X;Cn();const D=[];for(let W=v.x;W<v.x+v.width;W++)for(let Y=v.y;Y<v.y+v.height;Y++){const j=S([W-B,Y]);if(!j.allowOverlay&&j.kind!==Z.Boolean)continue;let K;if(j.kind===Z.Custom){const pe=St(j),Pe=(T=pe==null?void 0:pe.provideEditor)==null?void 0:T.call(pe,j);(pe==null?void 0:pe.onDelete)!==void 0?K=pe.onDelete(j):Th(Pe)&&(K=(N=Pe==null?void 0:Pe.deletedValue)==null?void 0:N.call(Pe,j))}else if(vi(j)&&j.allowOverlay||j.kind===Z.Boolean){const pe=St(j);K=(V=pe==null?void 0:pe.onDelete)==null?void 0:V.call(pe,j)}K!==void 0&&!wi(K)&&vi(K)&&D.push({location:[W,Y],value:K})}Nn(D),(X=En.current)==null||X.damage(D.map(W=>({cell:W.location})))},[Cn,S,St,Nn,B]),Vi=r!==void 0,kl=g.useCallback(v=>{var mt,Ue;const D=()=>{v.stopPropagation(),v.preventDefault()},T={didMatch:!1},{bounds:N}=v,V=U.columns,X=U.rows,W=$n;if(!Vi&&ut(W.clear,v,T))we(jo,!1),Ot==null||Ot();else if(!Vi&&ut(W.selectAll,v,T))we({columns:yt.empty(),rows:yt.empty(),current:{cell:((mt=U.current)==null?void 0:mt.cell)??[B,0],range:{x:B,y:0,width:w.length,height:je},rangeStack:[]}},!1);else if(ut(W.search,v,T))(Ue=a==null?void 0:a.current)==null||Ue.focus({preventScroll:!0}),ui(!0);else if(ut(W.delete,v,T)){const _e=(Ee==null?void 0:Ee(U))??!0;if(_e!==!1){const Mt=_e===!0?U:_e;if(Mt.current!==void 0){Gr(Mt.current.range);for(const qt of Mt.current.rangeStack)Gr(qt)}for(const qt of Mt.rows)Gr({x:B,y:qt,width:w.length,height:1});for(const qt of Mt.columns)Gr({x:qt,y:0,width:1,height:je})}}if(T.didMatch)return D(),!0;if(U.current===void 0)return!1;let[Y,j]=U.current.cell;const[,K]=U.current.cell;let pe=!1,Pe=!1;if(ut(W.scrollToSelectedCell,v,T)?Ao.current(Y-B,j):at!=="none"&&ut(W.selectColumn,v,T)?V.hasIndex(Y)?qe(V.remove(Y),void 0,!0):at==="single"?qe(yt.fromSingleSelection(Y),void 0,!0):qe(void 0,Y,!0):te!=="none"&&ut(W.selectRow,v,T)?X.hasIndex(j)?Ce(X.remove(j),void 0,!0):te==="single"?Ce(yt.fromSingleSelection(j),void 0,!0):Ce(void 0,j,!0):!Vi&&N!==void 0&&ut(W.activateCell,v,T)?j===je&&Zt?window.setTimeout(()=>{const _e=Oo(Y);fi(_e??Y)},0):(C==null||C([Y-B,j]),di(N,!0)):U.current.range.height>1&&ut(W.downFill,v,T)?Sl():U.current.range.width>1&&ut(W.rightFill,v,T)?Cl():ut(W.goToNextPage,v,T)?j+=Math.max(1,tn.current.height-4):ut(W.goToPreviousPage,v,T)?j-=Math.max(1,tn.current.height-4):ut(W.goToFirstCell,v,T)?(o(void 0),j=0,Y=0):ut(W.goToLastCell,v,T)?(o(void 0),j=Number.MAX_SAFE_INTEGER,Y=Number.MAX_SAFE_INTEGER):ut(W.selectToFirstCell,v,T)?(o(void 0),Jn([-2,-2])):ut(W.selectToLastCell,v,T)?(o(void 0),Jn([2,2])):Vi?(ut(W.closeOverlay,v,T)&&o(void 0),ut(W.acceptOverlayDown,v,T)&&(o(void 0),j++),ut(W.acceptOverlayUp,v,T)&&(o(void 0),j--),ut(W.acceptOverlayLeft,v,T)&&(o(void 0),Y--),ut(W.acceptOverlayRight,v,T)&&(o(void 0),Y++)):(ut(W.goDownCell,v,T)?j+=1:ut(W.goUpCell,v,T)?j-=1:ut(W.goRightCell,v,T)?Y+=1:ut(W.goLeftCell,v,T)?Y-=1:ut(W.goDownCellRetainSelection,v,T)?(j+=1,pe=!0):ut(W.goUpCellRetainSelection,v,T)?(j-=1,pe=!0):ut(W.goRightCellRetainSelection,v,T)?(Y+=1,pe=!0):ut(W.goLeftCellRetainSelection,v,T)?(Y-=1,pe=!0):ut(W.goToLastRow,v,T)?j=je-1:ut(W.goToFirstRow,v,T)?j=Number.MIN_SAFE_INTEGER:ut(W.goToLastColumn,v,T)?Y=Number.MAX_SAFE_INTEGER:ut(W.goToFirstColumn,v,T)?Y=Number.MIN_SAFE_INTEGER:(Et==="rect"||Et==="multi-rect")&&(ut(W.selectGrowDown,v,T)?Jn([0,1]):ut(W.selectGrowUp,v,T)?Jn([0,-1]):ut(W.selectGrowRight,v,T)?Jn([1,0]):ut(W.selectGrowLeft,v,T)?Jn([-1,0]):ut(W.selectToLastRow,v,T)?Jn([0,2]):ut(W.selectToFirstRow,v,T)?Jn([0,-2]):ut(W.selectToLastColumn,v,T)?Jn([2,0]):ut(W.selectToFirstColumn,v,T)&&Jn([-2,0])),Pe=T.didMatch),Zn!==void 0&&Zn!=="normal"&&j!==K){const _e=Zn==="skip-up"||Zn==="skip"||Zn==="block",Mt=Zn==="skip-down"||Zn==="skip"||Zn==="block",qt=j<K;if(qt&&_e){for(;j>=0&&Yr(j).isGroupHeader;)j--;j<0&&(j=K)}else if(!qt&&Mt){for(;j<je&&Yr(j).isGroupHeader;)j++;j>=je&&(j=K)}}const Fe=Or(Y,j,!1,pe),Ie=T.didMatch;return Ie&&(Fe||!Pe||Qt)&&D(),Ie},[Zn,Vi,U,$n,at,te,Et,B,Yr,je,Or,we,Ot,w.length,Ee,Qt,Gr,qe,Ce,Zt,Oo,fi,C,di,Sl,Cl,Jn]),Ni=g.useCallback(v=>{let D=!1;if($!==void 0&&$({...v,cancel:()=>{D=!0}}),D||kl(v)||U.current===void 0)return;const[T,N]=U.current.cell,V=tn.current;if(Be&&!v.metaKey&&!v.ctrlKey&&U.current!==void 0&&v.key.length===1&&/[ -~]/g.test(v.key)&&v.bounds!==void 0&&Ki(S([T-B,Math.max(0,Math.min(N,je-1))]))){if((!Zt||N!==je)&&(V.y>N||N>V.y+V.height||V.x>T||T>V.x+V.width))return;di(v.bounds,!0,v.key),v.stopPropagation(),v.preventDefault()}},[Be,$,kl,U,S,B,je,Zt,di]),vf=g.useCallback((v,D)=>{const T=v.location[0]-B;if(v.kind==="header"&&(xe==null||xe(T,{...v,preventDefault:D})),v.kind===Yn){if(T<0)return;J==null||J(T,{...v,preventDefault:D})}if(v.kind==="cell"){const[N,V]=v.location;oe==null||oe([T,V],{...v,preventDefault:D}),Cm(U,v.location)||Or(N,V,!1,!1)}},[U,oe,J,xe,B,Or]),Za=g.useCallback(async v=>{var W,Y,j;if(!$n.paste)return;function D(K,pe,Pe,ve){var Ie,mt;const Fe=typeof Pe=="object"?(Pe==null?void 0:Pe.join(`
172
+ `&&(n.push(i),i=[])),o=t.None);break}a++}return r<e.length&&i.push(mu(e.slice(r,e.length))),n.push(i),n.map(s=>s.map(l=>({rawValue:l,formatted:l,format:"string"})))}function pu(e,t,n){var s;const i=$0(e,t),r=l=>{var u;(u=window.navigator.clipboard)==null||u.writeText(l)},o=(l,u)=>{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([l],{type:"text/plain"}),"text/html":new Blob([u],{type:"text/html"})})]),!0)},a=(l,u)=>{var c,d;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(c=n==null?void 0:n.clipboardData)==null||c.setData("text/plain",l),(d=n==null?void 0:n.clipboardData)==null||d.setData("text/html",u)}catch{o(l,u)||r(l)}};((s=window.navigator.clipboard)==null?void 0:s.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?a(i.textPlain,i.textHtml):r(i.textPlain),n==null||n.preventDefault()}function ld(e){return e!==!0}function vu(e){return typeof e=="string"?e:`${e}px`}const B0=()=>e=>e.innerWidth,W0=()=>e=>e.innerHeight,U0=hn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[B0()],"wmyidgi-1":[W0()]}}),Y0=e=>{const{inWidth:t,inHeight:n,children:i,...r}=e;return g.createElement(U0,{innerHeight:vu(n),innerWidth:vu(t),...r},i)},X0=2,G0=1300;function j0(e,t,n){const i=ae.useRef(0),[r,o]=e??[0,0];ae.useEffect(()=>{if(r===0&&o===0){i.current=0;return}let a=!1,s=0;const l=u=>{var c;if(!a){if(s===0)s=u;else{const d=u-s;i.current=Math.min(1,i.current+d/G0);const f=i.current**1.618*d*X0;(c=t.current)==null||c.scrollBy(r*f,o*f),s=u,n==null||n()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{a=!0}},[t,r,o,n])}function q0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:i,overscrollX:r,overscrollY:o,scaleToRem:a,remSize:s}){const[l,u,c,d,f,h]=ae.useMemo(()=>{if(!a||s===16)return[e,t,n,i,r,o];const m=s/16,p=e,b=Gc();return[typeof p=="number"?p*m:w=>Math.ceil(p(w)*m),Math.ceil(t*m),Math.ceil(n*m),{...i,headerIconSize:((i==null?void 0:i.headerIconSize)??b.headerIconSize)*m,cellHorizontalPadding:((i==null?void 0:i.cellHorizontalPadding)??b.cellHorizontalPadding)*m,cellVerticalPadding:((i==null?void 0:i.cellVerticalPadding)??b.cellVerticalPadding)*m},Math.ceil((r??0)*m),Math.ceil((o??0)*m)]},[n,t,r,o,s,e,a,i]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:f,overscrollY:h}}const Fr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ct(e,t){return e===!0?t:e===!1?"":e}function bu(e){const t=ma.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function K0(e){const t=Ug(e);return ae.useMemo(()=>{if(t===void 0)return bu(Fr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Fr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Fr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Fr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Fr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Fr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Fr.selectToLastCell};return bu({...Fr,...n})},[t])}function Z0(e){function t(i,r,o){if(typeof i=="number")return{headerIndex:i,isCollapsed:!1,depth:r,path:o};const a={headerIndex:i.headerIndex,isCollapsed:i.isCollapsed,depth:r,path:o};return i.subGroups!==void 0&&(a.subGroups=i.subGroups.map((s,l)=>t(s,r+1,[...o,l])).sort((s,l)=>s.headerIndex-l.headerIndex)),a}return e.map((i,r)=>t(i,0,[r])).sort((i,r)=>i.headerIndex-r.headerIndex)}function Qs(e,t){const n=[];function i(a,s,l=!1){let u=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(u=a.subGroups[0].headerIndex-a.headerIndex),u--,n.push({headerIndex:a.headerIndex,contentIndex:-1,skip:l,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:u}),a.subGroups)for(let c=0;c<a.subGroups.length;c++){const d=c<a.subGroups.length-1?a.subGroups[c+1].headerIndex:s;i(a.subGroups[c],d,l||a.isCollapsed)}}const r=Z0(e.groups);for(let a=0;a<r.length;a++){const s=a<r.length-1?r[a+1].headerIndex:null;i(r[a],s)}let o=0;for(const a of n)a.contentIndex=o,o+=a.rows;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...l}=a;return l})}function va(e,t){if(t===void 0||Qs.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const i of t){if(n===0)return{path:[...i.path,-1],originalIndex:i.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:i.rows};if(n--,!i.isCollapsed){if(n<i.rows)return{path:[...i.path,n],originalIndex:i.headerIndex+n,isGroupHeader:!1,groupIndex:n,contentIndex:i.contentIndex+n,groupRows:i.rows};n-=i.rows}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function J0(e,t,n,i){const r=ae.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]),o=ae.useMemo(()=>r===void 0?t:r.reduce((u,c)=>u+(c.isCollapsed?1:c.rows+1),0),[r,t]),a=ae.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>{const{isGroupHeader:c}=va(u,r);return c?e.height:typeof n=="number"?n:n(u)},[r,e,n]),s=ae.useCallback(u=>{if(r===void 0)return u;let c=u;for(const d of r){if(c===0)return;if(c--,!d.isCollapsed){if(c<d.rows)return d.contentIndex+c;c-=d.rows}}return u},[r]),l=Zr(i??(e==null?void 0:e.themeOverride),ae.useCallback(u=>{if(e===void 0)return i==null?void 0:i(u,u,u);if(i===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:c,contentIndex:d,groupIndex:f}=va(u,r);return c?e.themeOverride:i==null?void 0:i(u,f,d)},[r,i,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:s,getRowThemeOverride:l}:{rowHeight:a,rows:o,rowNumberMapper:s,getRowThemeOverride:l}}function Q0(e,t){const n=ae.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]);return{getRowGroupingForPath:cd,updateRowGroupingByPath:ud,mapper:ae.useCallback(i=>{if(typeof i=="number")return va(i,n);const r=va(i[1],n);return{...r,originalIndex:[i[0],r.originalIndex]}},[n])}}function ud(e,t,n){const[i,...r]=t;return r[0]===-1?e.map((o,a)=>a===i?{...o,...n}:o):e.map((o,a)=>a===i?{...o,subGroups:ud(o.subGroups??[],r,n)}:o)}function cd(e,t){const[n,...i]=t;return i[0]===-1?e[n]:cd(e[n].subGroups??[],i)}function ev(e,t){const[n]=g.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(i){const r=n.value;r!==i&&(n.value=i,n.callback(i,r))}}}));return n.callback=t,n.facade}function tv(e,t,n,i,r){const[o,a]=g.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),s=g.useMemo(()=>({x:i.current.x,y:o,width:i.current.width??1,height:i.current.height??1,ty:a}),[i,a,o]),[l,u,c]=Wg(s),d=g.useRef(r);d.current=r;const f=ev(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),h=(l.height??1)>1;g.useLayoutEffect(()=>{if(t!==void 0&&f.current!==null&&h){if(f.current.scrollTop===t)return;f.current.scrollTop=t,f.current.scrollTop!==t&&c(),d.current()}},[t,h,c,f]);const m=(l.width??1)>1;return g.useLayoutEffect(()=>{if(e!==void 0&&f.current!==null&&m){if(f.current.scrollLeft===e)return;f.current.scrollLeft=e,f.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,f]),{visibleRegion:l,setVisibleRegion:u,scrollRef:f}}const nv=g.lazy(async()=>await As(()=>import("./data-grid-overlay-editor.BB33zQGs.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url));let rv=0;function iv(e){return up(Pl(Pl(e).filter(t=>t.span!==void 0).map(t=>{var n,i;return cr((((n=t.span)==null?void 0:n[0])??0)+1,(((i=t.span)==null?void 0:i[1])??0)+1)})))}function Xo(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const Go={kind:Z.Loading,allowOverlay:!1},jo={columns:yt.empty(),rows:yt.empty(),current:void 0},ov=(e,t)=>{var Tl,Dl,Ol;const[n,i]=g.useState(jo),[r,o]=g.useState(),a=g.useRef(null),s=g.useRef(null),[l,u]=g.useState(),c=g.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:f,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:b,columns:w,rows:y,getCellContent:S,onCellClicked:M,onCellActivated:C,onFillPattern:x,onFinishedEditing:R,coercePasteValue:I,drawHeader:E,drawCell:H,editorBloom:z,onHeaderClicked:L,onColumnProposeMove:_,rangeSelectionColumnSpanning:O=!0,spanRangeBehavior:ne="default",onGroupHeaderClicked:q,onCellContextMenu:oe,className:Se,onHeaderContextMenu:xe,getCellsForSelection:re,onGroupHeaderContextMenu:J,onGroupHeaderRenamed:ee,onCellEdited:ie,onCellsEdited:ge,onSearchResultsChanged:fe,searchResults:G,onSearchValueChange:P,searchValue:k,onKeyDown:$,onKeyUp:le,keybindings:Te,editOnType:Be=!0,onRowAppended:ce,onColumnMoved:nt,validateCell:ke,highlightRegions:bt,rangeSelect:Et="rect",columnSelect:at="multi",rowSelect:te="multi",rangeSelectionBlending:it="exclusive",columnSelectionBlending:me="exclusive",rowSelectionBlending:se="exclusive",onDelete:he,onDragStart:$e,onMouseMove:Le,onPaste:Je,copyHeaders:de=!1,freezeColumns:be=0,cellActivationBehavior:Ge="second-click",rowSelectionMode:Ae="auto",onHeaderMenuClick:tt,onHeaderIndicatorClick:wt,getGroupDetails:gt,rowGrouping:He,onSearchClose:_t,onItemHovered:Xt,onSelectionCleared:Ot,showSearch:Ht,onVisibleRegionChanged:rn,gridSelection:zt,onGridSelectionChange:gn,minColumnWidth:$t=50,maxColumnWidth:It=500,maxColumnAutoWidth:In,provideEditor:bn,trailingRowOptions:Oe,freezeTrailingRows:Vt=0,allowedFillDirections:dn="orthogonal",scrollOffsetX:De,scrollOffsetY:lt,verticalBorder:ze,onDragOverCell:Lt,onDrop:vt,onColumnResize:on,onColumnResizeEnd:Tt,onColumnResizeStart:Ft,customRenderers:Ve,fillHandle:Pt,experimental:Gt,fixedShadowX:jt,fixedShadowY:Kt,headerIcons:An,imageWindowLoader:Vr,initialSize:ir,isDraggable:A,onDragLeave:rt,onRowMoved:Qe,overscrollX:Wt,overscrollY:Tn,preventDiagonalScrolling:wn,rightElement:Gn,rightElementProps:Dn,trapFocus:Qt=!1,smoothScrollX:Hn,smoothScrollY:jn,scaleToRem:La=!1,rowHeight:bo=34,headerHeight:wo=36,groupHeaderHeight:Fa=wo,theme:oi,isOutsideClick:Mr,renderers:Ii,resizeIndicator:Aa,scrollToActiveCell:Ti=!0,drawFocusRing:Di=!0}=e,Nr=Di==="no-editor"?r===void 0:Di,en=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,kn=(en==null?void 0:en.kind)??e.rowMarkers??"none",Oi=(en==null?void 0:en.width)??e.rowMarkerWidth,Pi=(en==null?void 0:en.startIndex)??e.rowMarkerStartIndex??1,ai=(en==null?void 0:en.theme)??e.rowMarkerTheme,pr=en==null?void 0:en.headerTheme,vr=en==null?void 0:en.headerAlwaysVisible,si=te!=="multi",or=(en==null?void 0:en.checkboxStyle)??"square",ar=Math.max($t,20),Br=Math.max(It,ar),yo=Math.max(In??Br,ar),_i=g.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:je,rowNumberMapper:Co,rowHeight:So,getRowThemeOverride:zn}=J0(He,y,bo,h),xo=g.useMemo(()=>Number.parseFloat(_i.fontSize),[_i]),{rowHeight:qn,headerHeight:Li,groupHeaderHeight:ko,theme:Mo,overscrollX:Ha,overscrollY:za}=q0({groupHeaderHeight:Fa,headerHeight:wo,overscrollX:Wt,overscrollY:Tn,remSize:xo,rowHeight:So,scaleToRem:La,theme:oi}),$n=K0(Te),Rr=Oi??(y>1e4?48:y>1e3?44:y>100?36:32),Vn=kn!=="none",B=Vn?1:0,Zt=ce!==void 0,Er=(Oe==null?void 0:Oe.sticky)===!0,[li,ui]=g.useState(!1),Fi=Ht??li,$a=g.useCallback(()=>{_t!==void 0?_t():ui(!1)},[_t]),U=g.useMemo(()=>zt===void 0?void 0:Xo(zt,B),[zt,B])??n,un=g.useRef();un.current===void 0&&(un.current=new AbortController),g.useEffect(()=>()=>un==null?void 0:un.current.abort(),[]);const[cn,Va]=_0(re,S,B,un.current,je),F=g.useCallback((v,D,T)=>{if(ke===void 0)return!0;const N=[v[0]-B,v[1]];return ke==null?void 0:ke(N,D,T)},[B,ke]),Q=g.useRef(zt),we=g.useCallback((v,D)=>{D&&(v=V0(v,cn,B,ne,un.current)),gn!==void 0?(Q.current=Xo(v,-B),gn(Q.current)):i(v)},[gn,cn,B,ne]),ye=Zr(on,g.useCallback((v,D,T,N)=>{on==null||on(w[T-B],D,T-B,N)},[on,B,w])),ue=Zr(Tt,g.useCallback((v,D,T,N)=>{Tt==null||Tt(w[T-B],D,T-B,N)},[Tt,B,w])),Me=Zr(Ft,g.useCallback((v,D,T,N)=>{Ft==null||Ft(w[T-B],D,T-B,N)},[Ft,B,w])),ot=Zr(E,g.useCallback((v,D)=>(E==null?void 0:E({...v,columnIndex:v.columnIndex-B},D))??!1,[E,B])),st=Zr(H,g.useCallback((v,D)=>(H==null?void 0:H({...v,col:v.col-B},D))??!1,[H,B])),Ee=g.useCallback(v=>{if(he!==void 0){const D=he(Xo(v,-B));return typeof D=="boolean"?D:Xo(D,B)}return!0},[he,B]),[kt,Ce,qe]=P0(U,we,it,me,se,Et,O),We=g.useMemo(()=>Sr(Gc(),Mo),[Mo]),[ft,ln]=g.useState([0,0,0]),Mn=g.useMemo(()=>{if(Ii===void 0)return{};const v={};for(const D of Ii)v[D.kind]=D;return v},[Ii]),St=g.useCallback(v=>v.kind!==Z.Custom?Mn[v.kind]:Ve==null?void 0:Ve.find(D=>D.isMatch(v)),[Ve,Mn]);let{sizedColumns:Jt,nonGrowWidth:Kn}=zm(w,je,Va,ft[0]-(B===0?0:Rr)-ft[2],ar,yo,We,St,un.current);kn!=="none"&&(Kn+=Rr);const yn=g.useMemo(()=>Jt.some(v=>v.group!==void 0),[Jt]),Dt=yn?Li+ko:Li,Rn=U.rows.length,On=kn==="none"?void 0:Rn===0?!1:Rn===je?!0:void 0,xt=g.useMemo(()=>kn==="none"?Jt:[{title:"",width:Rr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:ai,rowMarker:or,rowMarkerChecked:On,headerRowMarkerTheme:pr,headerRowMarkerAlwaysVisible:vr,headerRowMarkerDisabled:si},...Jt],[kn,Jt,Rr,ai,or,On,pr,vr,si]),tn=g.useRef({height:1,width:1,x:0,y:0}),Ir=g.useRef(!1),{setVisibleRegion:Tr,visibleRegion:Wr,scrollRef:Ut}=tv(De,lt,qn,tn,()=>Ir.current=!0);tn.current=Wr;const tf=Wr.x+B,Ro=Wr.y,En=g.useRef(null),Cn=g.useCallback(v=>{var D;v===!0?(D=En.current)==null||D.focus():window.requestAnimationFrame(()=>{var T;(T=En.current)==null||T.focus()})},[]),mn=Zt?je+1:je,Nn=g.useCallback(v=>{const D=B===0?v:v.map(N=>({...N,location:[N.location[0]-B,N.location[1]]})),T=ge==null?void 0:ge(D);if(T!==!0)for(const N of D)ie==null||ie(N.location,N.value);return T},[ie,ge,B]),[Ur,Na]=g.useState(),Eo=U.current!==void 0&&U.current.range.width*U.current.range.height>1?U.current.range:void 0,ci=Nr?(Tl=U.current)==null?void 0:Tl.cell:void 0,Io=ci==null?void 0:ci[0],To=ci==null?void 0:ci[1],nf=g.useMemo(()=>{if((bt===void 0||bt.length===0)&&(Eo??Io??To??Ur)===void 0)return;const v=[];if(bt!==void 0)for(const D of bt){const T=xt.length-D.range.x-B;T>0&&v.push({color:D.color,range:{...D.range,x:D.range.x+B,width:Math.min(T,D.range.width)},style:D.style})}return Ur!==void 0&&v.push({color:ei(We.accentColor,0),range:Ur,style:"dashed"}),Eo!==void 0&&v.push({color:ei(We.accentColor,.5),range:Eo,style:"solid-outline"}),Io!==void 0&&To!==void 0&&v.push({color:We.accentColor,range:{x:Io,y:To,width:1,height:1},style:"solid-outline"}),v.length>0?v:void 0},[Ur,Eo,Io,To,bt,xt.length,We.accentColor,B]),ml=g.useRef(xt);ml.current=xt;const Pn=g.useCallback(([v,D],T=!1)=>{var X,W,Y,j,K,pe,Pe;const N=Zt&&D===mn-1;if(v===0&&Vn){if(N)return Go;const ve=Co(D);return ve===void 0?Go:{kind:Xn.Marker,allowOverlay:!1,checkboxStyle:or,checked:(U==null?void 0:U.rows.hasIndex(D))===!0,markerKind:kn==="clickable-number"?"number":kn,row:Pi+ve,drawHandle:Qe!==void 0,cursor:kn==="clickable-number"?"pointer":void 0}}else if(N){const Fe=v===B?(Oe==null?void 0:Oe.hint)??"":"",Ie=ml.current[v];if(((X=Ie==null?void 0:Ie.trailingRowOptions)==null?void 0:X.disabled)===!0)return Go;{const mt=((W=Ie==null?void 0:Ie.trailingRowOptions)==null?void 0:W.hint)??Fe,Ue=((Y=Ie==null?void 0:Ie.trailingRowOptions)==null?void 0:Y.addIcon)??(Oe==null?void 0:Oe.addIcon);return{kind:Xn.NewRow,hint:mt,allowOverlay:!1,icon:Ue}}}else{const ve=v-B;if(T||(Gt==null?void 0:Gt.strict)===!0){const Ie=tn.current,mt=Ie.x>ve||ve>Ie.x+Ie.width||Ie.y>D||D>Ie.y+Ie.height||D>=Wa.current,Ue=ve===((K=(j=Ie.extras)==null?void 0:j.selected)==null?void 0:K[0])&&D===((pe=Ie.extras)==null?void 0:pe.selected[1]);let _e=!1;if(((Pe=Ie.extras)==null?void 0:Pe.freezeRegions)!==void 0){for(const Mt of Ie.extras.freezeRegions)if(Qr(Mt,ve,D)){_e=!0;break}}if(mt&&!Ue&&!_e)return Go}let Fe=S([ve,D]);return B!==0&&Fe.span!==void 0&&(Fe={...Fe,span:[Fe.span[0]+B,Fe.span[1]+B]}),Fe}},[Zt,mn,Vn,Co,or,U==null?void 0:U.rows,kn,Pi,Qe,B,Oe==null?void 0:Oe.hint,Oe==null?void 0:Oe.addIcon,Gt==null?void 0:Gt.strict,S]),Ba=g.useCallback(v=>{let D=(gt==null?void 0:gt(v))??{name:v};return ee!==void 0&&v!==""&&(D={icon:D.icon,name:D.name,overrideTheme:D.overrideTheme,actions:[...D.actions??[],{title:"Rename",icon:"renameIcon",onClick:T=>Ya({group:D.name,bounds:T.bounds})}]}),D},[gt,ee]),Do=g.useCallback(v=>{var Y;const[D,T]=v.cell,N=xt[D],V=(N==null?void 0:N.group)!==void 0?(Y=Ba(N.group))==null?void 0:Y.overrideTheme:void 0,X=N==null?void 0:N.themeOverride,W=zn==null?void 0:zn(T);o({...v,theme:Sr(We,V,X,W,v.content.themeOverride)})},[zn,xt,Ba,We]),di=g.useCallback((v,D,T)=>{var W;if(U.current===void 0)return;const[N,V]=U.current.cell,X=Pn([N,V]);if(X.kind!==Z.Boolean&&X.allowOverlay){let Y=X;if(T!==void 0)switch(Y.kind){case Z.Number:{const j=wh(()=>T==="-"?-0:Number.parseFloat(T),0);Y={...Y,data:Number.isNaN(j)?0:j};break}case Z.Text:case Z.Markdown:case Z.Uri:Y={...Y,data:T};break}Do({target:v,content:Y,initialValue:T,cell:[N,V],highlight:T===void 0,forceEditMode:T!==void 0})}else X.kind===Z.Boolean&&D&&X.readonly!==!0&&(Nn([{location:U.current.cell,value:{...X,data:ld(X.data)}}]),(W=En.current)==null||W.damage([{cell:U.current.cell}]))},[Pn,U,Nn,Do]),pl=g.useCallback((v,D)=>{var V;const T=(V=En.current)==null?void 0:V.getBounds(v,D);if(T===void 0||Ut.current===null)return;const N=Pn([v,D]);N.allowOverlay&&Do({target:T,content:N,initialValue:void 0,highlight:!0,cell:[v,D],forceEditMode:!0})},[Pn,Ut,Do]),an=g.useCallback((v,D,T="both",N=0,V=0,X=void 0)=>{if(Ut.current!==null){const W=En.current,Y=s.current,j=typeof v!="number"?v.unit==="cell"?v.amount:void 0:v,K=typeof D!="number"?D.unit==="cell"?D.amount:void 0:D,pe=typeof v!="number"&&v.unit==="px"?v.amount:void 0,Pe=typeof D!="number"&&D.unit==="px"?D.amount:void 0;if(W!==null&&Y!==null){let ve={x:0,y:0,width:0,height:0},Fe=0,Ie=0;if((j!==void 0||K!==void 0)&&(ve=W.getBounds((j??0)+B,K??0)??ve,ve.width===0||ve.height===0))return;const mt=Y.getBoundingClientRect(),Ue=mt.width/Y.offsetWidth;if(pe!==void 0&&(ve={...ve,x:pe-mt.left-Ut.current.scrollLeft,width:1}),Pe!==void 0&&(ve={...ve,y:Pe+mt.top-Ut.current.scrollTop,height:1}),ve!==void 0){const _e={x:ve.x-N,y:ve.y-V,width:ve.width+2*N,height:ve.height+2*V};let Mt=0;for(let Ja=0;Ja<be;Ja++)Mt+=Jt[Ja].width;let qt=0;const sn=Vt+(Er?1:0);sn>0&&(qt=ri(mn,sn,qn));let Qn=Mt*Ue+mt.left+B*Rr*Ue,lr=mt.right,er=mt.top+Dt*Ue,ur=mt.bottom-qt*Ue;const Ho=ve.width+N*2;switch(X==null?void 0:X.hAlign){case"start":lr=Qn+Ho;break;case"end":Qn=lr-Ho;break;case"center":Qn=Math.floor((Qn+lr)/2)-Ho/2,lr=Qn+Ho;break}const zo=ve.height+V*2;switch(X==null?void 0:X.vAlign){case"start":ur=er+zo;break;case"end":er=ur-zo;break;case"center":er=Math.floor((er+ur)/2)-zo/2,ur=er+zo;break}Qn>_e.x?Fe=_e.x-Qn:lr<_e.x+_e.width&&(Fe=_e.x+_e.width-lr),er>_e.y?Ie=_e.y-er:ur<_e.y+_e.height&&(Ie=_e.y+_e.height-ur),T==="vertical"||typeof v=="number"&&v<be?Fe=0:(T==="horizontal"||typeof D=="number"&&D>=mn-sn)&&(Ie=0),(Fe!==0||Ie!==0)&&(Ue!==1&&(Fe/=Ue,Ie/=Ue),Ut.current.scrollTo(Fe+Ut.current.scrollLeft,Ie+Ut.current.scrollTop))}}}},[B,Vt,Rr,Ut,Dt,be,Jt,mn,Er,qn]),vl=g.useRef(pl),bl=g.useRef(S),Wa=g.useRef(je);vl.current=pl,bl.current=S,Wa.current=je;const fi=g.useCallback(async(v,D=!0)=>{var j;const T=xt[v];if(((j=T==null?void 0:T.trailingRowOptions)==null?void 0:j.disabled)===!0)return;const N=ce==null?void 0:ce();let V,X=!0;N!==void 0&&(V=await N,V==="top"&&(X=!1),typeof V=="number"&&(X=!1));let W=0;const Y=()=>{if(Wa.current<=je){W<500&&window.setTimeout(Y,W),W=50+W*2;return}const K=typeof V=="number"?V:X?je:0;Ao.current(v-B,K),kt({cell:[v,K],range:{x:v,y:K,width:1,height:1}},!1,!1,"edit");const pe=bl.current([v-B,K]);pe.allowOverlay&&Ki(pe)&&pe.readonly!==!0&&D&&window.setTimeout(()=>{vl.current(v,K)},0)};Y()},[xt,ce,B,je,kt]),Oo=g.useCallback(v=>{var T,N;const D=((N=(T=Jt[v])==null?void 0:T.trailingRowOptions)==null?void 0:N.targetColumn)??(Oe==null?void 0:Oe.targetColumn);if(typeof D=="number")return D+(Vn?1:0);if(typeof D=="object"){const V=w.indexOf(D);if(V>=0)return V+(Vn?1:0)}},[Jt,w,Vn,Oe==null?void 0:Oe.targetColumn]),Dr=g.useRef(),hi=g.useRef(),Hi=g.useCallback((v,D)=>{var V;const[T,N]=D;return Sr(We,(V=xt[T])==null?void 0:V.themeOverride,zn==null?void 0:zn(N),v.themeOverride)},[zn,xt,We]),{mapper:Yr}=Q0(He,y),Zn=He==null?void 0:He.navigationBehavior,zi=g.useCallback(v=>{var pe,Pe,ve;const D=ma.value?v.metaKey:v.ctrlKey,T=D&&te==="multi",N=D&&at==="multi",[V,X]=v.location,W=U.columns,Y=U.rows,[j,K]=((pe=U.current)==null?void 0:pe.cell)??[];if(v.kind==="cell"){if(hi.current=void 0,Xr.current=[V,X],V===0&&Vn){if(Zt===!0&&X===je||kn==="number"||te==="none")return;const Fe=Pn(v.location);if(Fe.kind!==Xn.Marker)return;if(Qe!==void 0){const Ue=St(Fe);_n((Ue==null?void 0:Ue.kind)===Xn.Marker);const _e=(Pe=Ue==null?void 0:Ue.onClick)==null?void 0:Pe.call(Ue,{...v,cell:Fe,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,theme:Hi(Fe,v.location),preventDefault:()=>{}});if(_e===void 0||_e.checked===Fe.checked)return}o(void 0),Cn();const Ie=Y.hasIndex(X),mt=Dr.current;if(te==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&mt!==void 0&&Y.hasIndex(mt)){const Ue=[Math.min(mt,X),Math.max(mt,X)+1];T||Ae==="multi"?Ce(void 0,Ue,!0):Ce(yt.fromSingleSelection(Ue),void 0,T)}else te==="multi"&&(T||v.isTouch||Ae==="multi")?Ie?Ce(Y.remove(X),void 0,!0):(Ce(void 0,X,!0),Dr.current=X):Ie&&Y.length===1?Ce(yt.empty(),void 0,D):(Ce(yt.fromSingleSelection(X),void 0,D),Dr.current=X)}else if(V>=B&&Zt&&X===je){const Fe=Oo(V);fi(Fe??V)}else if(j!==V||K!==X){const Fe=Pn(v.location),Ie=St(Fe);if((Ie==null?void 0:Ie.onSelect)!==void 0){let _e=!1;if(Ie.onSelect({...v,cell:Fe,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,preventDefault:()=>_e=!0,theme:Hi(Fe,v.location)}),_e)return}if(Zn==="block"&&Yr(X).isGroupHeader)return;const mt=Er&&X===je,Ue=Er&&U!==void 0&&((ve=U.current)==null?void 0:ve.cell[1])===je;if((v.shiftKey||v.isLongTouch===!0)&&j!==void 0&&K!==void 0&&U.current!==void 0&&!Ue){if(mt)return;const _e=Math.min(V,j),Mt=Math.max(V,j),qt=Math.min(X,K),sn=Math.max(X,K);kt({...U.current,range:{x:_e,y:qt,width:Mt-_e+1,height:sn-qt+1}},!0,D,"click"),Dr.current=void 0,Cn()}else kt({cell:[V,X],range:{x:V,y:X,width:1,height:1}},!0,D,"click"),Dr.current=void 0,o(void 0),Cn()}}else if(v.kind==="header")if(Xr.current=[V,X],o(void 0),Vn&&V===0)Dr.current=void 0,hi.current=void 0,te==="multi"&&(Y.length!==je?Ce(yt.fromSingleSelection([0,je]),void 0,D):Ce(yt.empty(),void 0,D),Cn());else{const Fe=hi.current;if(at==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&Fe!==void 0&&W.hasIndex(Fe)){const Ie=[Math.min(Fe,V),Math.max(Fe,V)+1];N?qe(void 0,Ie,D):qe(yt.fromSingleSelection(Ie),void 0,D)}else N?(W.hasIndex(V)?qe(W.remove(V),void 0,D):qe(void 0,V,D),hi.current=V):at!=="none"&&(qe(yt.fromSingleSelection(V),void 0,D),hi.current=V);Dr.current=void 0,Cn()}else v.kind===Yn?Xr.current=[V,X]:v.kind===pa&&!v.isMaybeScrollbar&&(we(jo,!1),o(void 0),Cn(),Ot==null||Ot(),Dr.current=void 0,hi.current=void 0)},[te,at,U,Vn,B,Zt,je,kn,Pn,Qe,Cn,Ae,St,Hi,Ce,Oo,fi,Zn,Yr,Er,kt,qe,we,Ot]),$i=g.useRef(!1),Xr=g.useRef(),wl=g.useRef(Wr),Bn=g.useRef(),rf=g.useCallback(v=>{if(gi.current=!1,wl.current=tn.current,v.button!==0&&v.button!==1){Bn.current=void 0;return}const D=performance.now();Bn.current={button:v.button,time:D,location:v.location},(v==null?void 0:v.kind)==="header"&&($i.current=!0);const T=v.kind==="cell"&&v.isFillHandle;!T&&v.kind!=="cell"&&v.isEdge||(u({previousSelection:U,fillHandle:T}),Xr.current=void 0,!v.isTouch&&v.button===0&&!T?zi(v):!v.isTouch&&v.button===1&&(Xr.current=v.location))},[U,zi]),[Ua,Ya]=g.useState(),yl=g.useCallback(v=>{if(v.kind!==Yn||at!=="multi")return;const D=ma.value?v.metaKey:v.ctrlKey,[T]=v.location,N=U.columns;if(T<B)return;const V=xt[T];let X=T,W=T;for(let Y=T-1;Y>=B&&so(V.group,xt[Y].group);Y--)X--;for(let Y=T+1;Y<xt.length&&so(V.group,xt[Y].group);Y++)W++;if(Cn(),D)if(N.hasAll([X,W+1])){let Y=N;for(let j=X;j<=W;j++)Y=Y.remove(j);qe(Y,void 0,D)}else qe(void 0,[X,W+1],D);else qe(yt.fromSingleSelection([X,W+1]),void 0,D)},[at,Cn,U.columns,xt,B,qe]),gi=g.useRef(!1),Po=g.useCallback(async v=>{if(cn!==void 0&&ye!==void 0){const D=tn.current.y,T=tn.current.height;let N=cn({x:v,y:D,width:1,height:Math.min(T,je-D)},un.current.signal);typeof N!="object"&&(N=await N());const V=Jt[v-B],W=document.createElement("canvas").getContext("2d",{alpha:!1});if(W!==null){W.font=We.baseFontFull;const Y=qc(W,We,V,0,N,ar,Br,!1,St);ye==null||ye(V,Y.width,v,Y.width)}}},[Jt,cn,Br,We,ar,ye,B,je,St]),[of,Xa]=g.useState(),mi=g.useCallback(async(v,D)=>{var Y,j;const T=(Y=v.current)==null?void 0:Y.range;if(T===void 0||cn===void 0||D.current===void 0)return;const N=D.current.range;if(x!==void 0){let K=!1;if(x({fillDestination:{...N,x:N.x-B},patternSource:{...T,x:T.x-B},preventDefault:()=>K=!0}),K)return}let V=cn(T,un.current.signal);typeof V!="object"&&(V=await V());const X=V,W=[];for(let K=0;K<N.width;K++)for(let pe=0;pe<N.height;pe++){const Pe=[N.x+K,N.y+pe];if(Ac(Pe,T))continue;const ve=X[pe%T.height][K%T.width];wi(ve)||!Ki(ve)||W.push({location:Pe,value:{...ve}})}Nn(W),(j=En.current)==null||j.damage(W.map(K=>({cell:K.location})))},[cn,Nn,x,B]),Cl=g.useCallback(()=>{if(U.current===void 0||U.current.range.width<=1)return;const v={...U,current:{...U.current,range:{...U.current.range,width:1}}};mi(v,U)},[mi,U]),Sl=g.useCallback(()=>{if(U.current===void 0||U.current.range.height<=1)return;const v={...U,current:{...U.current,range:{...U.current.range,height:1}}};mi(v,U)},[mi,U]),af=g.useCallback((v,D)=>{var pe,Pe;const T=l;if(u(void 0),Na(void 0),Xa(void 0),$i.current=!1,D)return;if((T==null?void 0:T.fillHandle)===!0&&U.current!==void 0&&((pe=T.previousSelection)==null?void 0:pe.current)!==void 0){if(Ur===void 0)return;const ve={...U,current:{...U.current,range:ed(T.previousSelection.current.range,Ur)}};mi(T.previousSelection,ve),we(ve,!0);return}const[N,V]=v.location,[X,W]=Xr.current??[],Y=()=>{gi.current=!0},j=ve=>{var Ie,mt,Ue;const Fe=ve.isTouch||X===N&&W===V;if(Fe&&(M==null||M([N-B,V],{...ve,preventDefault:Y})),ve.button===1)return!gi.current;if(!gi.current){const _e=Pn(v.location),Mt=St(_e);if(Mt!==void 0&&Mt.onClick!==void 0&&Fe){const sn=Mt.onClick({...ve,cell:_e,posX:ve.localEventX,posY:ve.localEventY,bounds:ve.bounds,theme:Hi(_e,v.location),preventDefault:Y});sn!==void 0&&!wi(sn)&&vi(sn)&&(Nn([{location:ve.location,value:sn}]),(Ie=En.current)==null||Ie.damage([{cell:ve.location}]))}if(gi.current||U.current===void 0)return!1;let qt=!1;switch(_e.activationBehaviorOverride??Ge){case"double-click":case"second-click":{if(((Ue=(mt=T==null?void 0:T.previousSelection)==null?void 0:mt.current)==null?void 0:Ue.cell)===void 0)break;const[sn,Qn]=U.current.cell,[lr,er]=T.previousSelection.current.cell;qt=N===sn&&N===lr&&V===Qn&&V===er&&(ve.isDoubleClick===!0||Ge==="second-click");break}case"single-click":{qt=!0;break}}if(qt)return C==null||C([N-B,V]),di(ve.bounds,!1),!0}return!1},K=v.location[0]-B;if(v.isTouch){const ve=tn.current,Fe=wl.current;if(ve.x!==Fe.x||ve.y!==Fe.y)return;if(v.isLongTouch===!0){if(v.kind==="cell"&&no((Pe=U.current)==null?void 0:Pe.cell,v.location)){oe==null||oe([K,v.location[1]],{...v,preventDefault:Y});return}else if(v.kind==="header"&&U.columns.hasIndex(N)){xe==null||xe(K,{...v,preventDefault:Y});return}else if(v.kind===Yn){if(K<0)return;J==null||J(K,{...v,preventDefault:Y});return}}v.kind==="cell"?j(v)||zi(v):v.kind===Yn?q==null||q(K,{...v,preventDefault:Y}):(v.kind===Ar&&(L==null||L(K,{...v,preventDefault:Y})),zi(v));return}if(v.kind==="header"){if(K<0)return;v.isEdge?v.isDoubleClick===!0&&Po(N):v.button===0&&N===X&&V===W&&(L==null||L(K,{...v,preventDefault:Y}))}if(v.kind===Yn){if(K<0)return;v.button===0&&N===X&&V===W&&(q==null||q(K,{...v,preventDefault:Y}),gi.current||yl(v))}v.kind==="cell"&&(v.button===0||v.button===1)&&j(v),Xr.current=void 0},[l,U,B,Ur,mi,we,M,Pn,St,Ge,Hi,Nn,C,di,oe,xe,J,zi,q,L,Po,yl]),sf=g.useCallback(v=>{const D={...v,location:[v.location[0]-B,v.location[1]]};Le==null||Le(D),l!==void 0&&v.buttons===0&&(u(void 0),Na(void 0),Xa(void 0),$i.current=!1),Xa(T=>{var N;return $i.current?[v.scrollEdge[0],0]:v.scrollEdge[0]===(T==null?void 0:T[0])&&v.scrollEdge[1]===T[1]?T:l===void 0||(((N=Bn.current)==null?void 0:N.location[0])??0)<B?void 0:v.scrollEdge})},[l,Le,B]),lf=g.useCallback((v,D)=>{tt==null||tt(v-B,D)},[tt,B]),uf=g.useCallback((v,D)=>{wt==null||wt(v-B,D)},[wt,B]),sr=(Dl=U==null?void 0:U.current)==null?void 0:Dl.cell,cf=g.useCallback((v,D,T,N,V,X)=>{Ir.current=!1;let W=sr;W!==void 0&&(W=[W[0]-B,W[1]]);const Y=be===0?void 0:{x:0,y:v.y,width:be,height:v.height},j=[];Y!==void 0&&j.push(Y),Vt>0&&(j.push({x:v.x-B,y:je-Vt,width:v.width,height:Vt}),be>0&&j.push({x:0,y:je-Vt,width:be,height:Vt}));const K={x:v.x-B,y:v.y,width:v.width,height:Zt&&v.y+v.height>=je?v.height-1:v.height,tx:V,ty:X,extras:{selected:W,freezeRegion:Y,freezeRegions:j}};tn.current=K,Tr(K),ln([D,T,N]),rn==null||rn(K,K.tx,K.ty,K.extras)},[sr,B,Zt,je,be,Vt,Tr,rn]),df=Zr(nt,g.useCallback((v,D)=>{nt==null||nt(v-B,D-B),at!=="none"&&qe(yt.fromSingleSelection(D),void 0,!0)},[at,nt,B,qe])),Ga=g.useRef(!1),ff=g.useCallback(v=>{if(v.location[0]===0&&B>0){v.preventDefault();return}$e==null||$e({...v,location:[v.location[0]-B,v.location[1]]}),v.defaultPrevented()||(Ga.current=!0),u(void 0)},[$e,B]),hf=g.useCallback(()=>{Ga.current=!1},[]),xl=He==null?void 0:He.selectionBehavior,_o=g.useCallback(v=>{if(xl!=="block-spanning")return;const{isGroupHeader:D,path:T,groupRows:N}=Yr(v);if(D)return[v,v];const V=T[T.length-1],X=v-V,W=v+N-V-1;return[X,W]},[Yr,xl]),ja=g.useRef(),qa=g.useCallback(v=>{var D,T,N;if(!ad(v,ja.current)&&(ja.current=v,!(((D=Bn==null?void 0:Bn.current)==null?void 0:D.button)!==void 0&&Bn.current.button>=1))){if(v.buttons!==0&&l!==void 0&&((T=Bn.current)==null?void 0:T.location[0])===0&&v.location[0]===0&&B===1&&te==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(Bn.current.location[1])&&U.rows.hasIndex(Bn.current.location[1])){const V=Math.min(Bn.current.location[1],v.location[1]),X=Math.max(Bn.current.location[1],v.location[1])+1;Ce(yt.fromSingleSelection([V,X]),void 0,!1)}if(v.buttons!==0&&l!==void 0&&U.current!==void 0&&!Ga.current&&!$i.current&&(Et==="rect"||Et==="multi-rect")){const[V,X]=U.current.cell;let[W,Y]=v.location;if(Y<0&&(Y=tn.current.y),l.fillHandle===!0&&((N=l.previousSelection)==null?void 0:N.current)!==void 0){const j=l.previousSelection.current.range;Y=Math.min(Y,Zt?je-1:je);const K=Np(j,W,Y,dn);Na(K)}else{if(Zt&&X===je)return;if(Zt&&Y===je)if(v.kind===pa)Y--;else return;W=Math.max(W,B);const pe=_o(X);Y=pe===void 0?Y:Wn(Y,pe[0],pe[1]);const Pe=W-V,ve=Y-X,Fe={x:Pe>=0?V:W,y:ve>=0?X:Y,width:Math.abs(Pe)+1,height:Math.abs(ve)+1};kt({...U.current,range:Fe},!0,!1,"drag")}}Xt==null||Xt({...v,location:[v.location[0]-B,v.location[1]]})}},[l,B,te,U,Et,Xt,Ce,Zt,je,dn,_o,kt]),gf=g.useCallback(()=>{var W,Y;const v=ja.current;if(v===void 0)return;const[D,T]=v.scrollEdge;let[N,V]=v.location;const X=tn.current;D===-1?N=((Y=(W=X.extras)==null?void 0:W.freezeRegion)==null?void 0:Y.x)??X.x:D===1&&(N=X.x+X.width),T===-1?V=Math.max(0,X.y):T===1&&(V=Math.min(je-1,X.y+X.height)),N=Wn(N,0,xt.length-1),V=Wn(V,0,je-1),qa({...v,location:[N,V]})},[xt.length,qa,je]);j0(of,Ut,gf);const Jn=g.useCallback(v=>{if(U.current===void 0)return;const[D,T]=v,[N,V]=U.current.cell,X=U.current.range;let W=X.x,Y=X.x+X.width,j=X.y,K=X.y+X.height;const[pe,Pe]=_o(V)??[0,je-1],ve=Pe+1;if(T!==0)switch(T){case 2:{K=ve,j=V,an(0,K,"vertical");break}case-2:{j=pe,K=V+1,an(0,j,"vertical");break}case 1:{j<V?(j++,an(0,j,"vertical")):(K=Math.min(ve,K+1),an(0,K,"vertical"));break}case-1:{K>V+1?(K--,an(0,K,"vertical")):(j=Math.max(pe,j-1),an(0,j,"vertical"));break}default:ao()}if(D!==0)if(D===2)Y=xt.length,W=N,an(Y-1-B,0,"horizontal");else if(D===-2)W=B,Y=N+1,an(W-B,0,"horizontal");else{let Fe=[];if(cn!==void 0){const Ie=cn({x:W,y:j,width:Y-W-B,height:K-j},un.current.signal);typeof Ie=="object"&&(Fe=iv(Ie))}if(D===1){let Ie=!1;if(W<N){if(Fe.length>0){const mt=cr(W+1,N+1).find(Ue=>!Fe.includes(Ue-B));mt!==void 0&&(W=mt,Ie=!0)}else W++,Ie=!0;Ie&&an(W,0,"horizontal")}Ie||(Y=Math.min(xt.length,Y+1),an(Y-1-B,0,"horizontal"))}else if(D===-1){let Ie=!1;if(Y>N+1){if(Fe.length>0){const mt=cr(Y-1,N,-1).find(Ue=>!Fe.includes(Ue-B));mt!==void 0&&(Y=mt,Ie=!0)}else Y--,Ie=!0;Ie&&an(Y-B,0,"horizontal")}Ie||(W=Math.max(B,W-1),an(W-B,0,"horizontal"))}else ao()}kt({cell:U.current.cell,range:{x:W,y:j,width:Y-W,height:K-j}},!0,!1,"keyboard-select")},[cn,_o,U,xt.length,B,je,an,kt]),Ka=g.useRef(Ti);Ka.current=Ti;const Or=g.useCallback((v,D,T,N)=>{const V=mn-(T?0:1);v=Wn(v,B,Jt.length-1+B),D=Wn(D,0,V);const X=sr==null?void 0:sr[0],W=sr==null?void 0:sr[1];if(v===X&&D===W)return!1;if(N&&U.current!==void 0){const Y=[...U.current.rangeStack];(U.current.range.width>1||U.current.range.height>1)&&Y.push(U.current.range),we({...U,current:{cell:[v,D],range:{x:v,y:D,width:1,height:1},rangeStack:Y}},!0)}else kt({cell:[v,D],range:{x:v,y:D,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===v&&c.current[1]===D&&(c.current=void 0),Ka.current&&an(v-B,D),!0},[mn,B,Jt.length,sr,U,an,we,kt]),mf=g.useCallback((v,D)=>{(r==null?void 0:r.cell)!==void 0&&v!==void 0&&vi(v)&&(Nn([{location:r.cell,value:v}]),window.requestAnimationFrame(()=>{var V;(V=En.current)==null||V.damage([{cell:r.cell}])})),Cn(!0),o(void 0);const[T,N]=D;if(U.current!==void 0&&(T!==0||N!==0)){const V=U.current.cell[1]===mn-1&&v!==void 0;Or(Wn(U.current.cell[0]+T,0,xt.length-1),Wn(U.current.cell[1]+N,0,mn-1),V,!1)}R==null||R(v,D)},[r==null?void 0:r.cell,Cn,U,R,Nn,mn,Or,xt.length]),pf=g.useMemo(()=>`gdg-overlay-${rv++}`,[]),Gr=g.useCallback(v=>{var T,N,V,X;Cn();const D=[];for(let W=v.x;W<v.x+v.width;W++)for(let Y=v.y;Y<v.y+v.height;Y++){const j=S([W-B,Y]);if(!j.allowOverlay&&j.kind!==Z.Boolean)continue;let K;if(j.kind===Z.Custom){const pe=St(j),Pe=(T=pe==null?void 0:pe.provideEditor)==null?void 0:T.call(pe,j);(pe==null?void 0:pe.onDelete)!==void 0?K=pe.onDelete(j):Th(Pe)&&(K=(N=Pe==null?void 0:Pe.deletedValue)==null?void 0:N.call(Pe,j))}else if(vi(j)&&j.allowOverlay||j.kind===Z.Boolean){const pe=St(j);K=(V=pe==null?void 0:pe.onDelete)==null?void 0:V.call(pe,j)}K!==void 0&&!wi(K)&&vi(K)&&D.push({location:[W,Y],value:K})}Nn(D),(X=En.current)==null||X.damage(D.map(W=>({cell:W.location})))},[Cn,S,St,Nn,B]),Vi=r!==void 0,kl=g.useCallback(v=>{var mt,Ue;const D=()=>{v.stopPropagation(),v.preventDefault()},T={didMatch:!1},{bounds:N}=v,V=U.columns,X=U.rows,W=$n;if(!Vi&&ut(W.clear,v,T))we(jo,!1),Ot==null||Ot();else if(!Vi&&ut(W.selectAll,v,T))we({columns:yt.empty(),rows:yt.empty(),current:{cell:((mt=U.current)==null?void 0:mt.cell)??[B,0],range:{x:B,y:0,width:w.length,height:je},rangeStack:[]}},!1);else if(ut(W.search,v,T))(Ue=a==null?void 0:a.current)==null||Ue.focus({preventScroll:!0}),ui(!0);else if(ut(W.delete,v,T)){const _e=(Ee==null?void 0:Ee(U))??!0;if(_e!==!1){const Mt=_e===!0?U:_e;if(Mt.current!==void 0){Gr(Mt.current.range);for(const qt of Mt.current.rangeStack)Gr(qt)}for(const qt of Mt.rows)Gr({x:B,y:qt,width:w.length,height:1});for(const qt of Mt.columns)Gr({x:qt,y:0,width:1,height:je})}}if(T.didMatch)return D(),!0;if(U.current===void 0)return!1;let[Y,j]=U.current.cell;const[,K]=U.current.cell;let pe=!1,Pe=!1;if(ut(W.scrollToSelectedCell,v,T)?Ao.current(Y-B,j):at!=="none"&&ut(W.selectColumn,v,T)?V.hasIndex(Y)?qe(V.remove(Y),void 0,!0):at==="single"?qe(yt.fromSingleSelection(Y),void 0,!0):qe(void 0,Y,!0):te!=="none"&&ut(W.selectRow,v,T)?X.hasIndex(j)?Ce(X.remove(j),void 0,!0):te==="single"?Ce(yt.fromSingleSelection(j),void 0,!0):Ce(void 0,j,!0):!Vi&&N!==void 0&&ut(W.activateCell,v,T)?j===je&&Zt?window.setTimeout(()=>{const _e=Oo(Y);fi(_e??Y)},0):(C==null||C([Y-B,j]),di(N,!0)):U.current.range.height>1&&ut(W.downFill,v,T)?Sl():U.current.range.width>1&&ut(W.rightFill,v,T)?Cl():ut(W.goToNextPage,v,T)?j+=Math.max(1,tn.current.height-4):ut(W.goToPreviousPage,v,T)?j-=Math.max(1,tn.current.height-4):ut(W.goToFirstCell,v,T)?(o(void 0),j=0,Y=0):ut(W.goToLastCell,v,T)?(o(void 0),j=Number.MAX_SAFE_INTEGER,Y=Number.MAX_SAFE_INTEGER):ut(W.selectToFirstCell,v,T)?(o(void 0),Jn([-2,-2])):ut(W.selectToLastCell,v,T)?(o(void 0),Jn([2,2])):Vi?(ut(W.closeOverlay,v,T)&&o(void 0),ut(W.acceptOverlayDown,v,T)&&(o(void 0),j++),ut(W.acceptOverlayUp,v,T)&&(o(void 0),j--),ut(W.acceptOverlayLeft,v,T)&&(o(void 0),Y--),ut(W.acceptOverlayRight,v,T)&&(o(void 0),Y++)):(ut(W.goDownCell,v,T)?j+=1:ut(W.goUpCell,v,T)?j-=1:ut(W.goRightCell,v,T)?Y+=1:ut(W.goLeftCell,v,T)?Y-=1:ut(W.goDownCellRetainSelection,v,T)?(j+=1,pe=!0):ut(W.goUpCellRetainSelection,v,T)?(j-=1,pe=!0):ut(W.goRightCellRetainSelection,v,T)?(Y+=1,pe=!0):ut(W.goLeftCellRetainSelection,v,T)?(Y-=1,pe=!0):ut(W.goToLastRow,v,T)?j=je-1:ut(W.goToFirstRow,v,T)?j=Number.MIN_SAFE_INTEGER:ut(W.goToLastColumn,v,T)?Y=Number.MAX_SAFE_INTEGER:ut(W.goToFirstColumn,v,T)?Y=Number.MIN_SAFE_INTEGER:(Et==="rect"||Et==="multi-rect")&&(ut(W.selectGrowDown,v,T)?Jn([0,1]):ut(W.selectGrowUp,v,T)?Jn([0,-1]):ut(W.selectGrowRight,v,T)?Jn([1,0]):ut(W.selectGrowLeft,v,T)?Jn([-1,0]):ut(W.selectToLastRow,v,T)?Jn([0,2]):ut(W.selectToFirstRow,v,T)?Jn([0,-2]):ut(W.selectToLastColumn,v,T)?Jn([2,0]):ut(W.selectToFirstColumn,v,T)&&Jn([-2,0])),Pe=T.didMatch),Zn!==void 0&&Zn!=="normal"&&j!==K){const _e=Zn==="skip-up"||Zn==="skip"||Zn==="block",Mt=Zn==="skip-down"||Zn==="skip"||Zn==="block",qt=j<K;if(qt&&_e){for(;j>=0&&Yr(j).isGroupHeader;)j--;j<0&&(j=K)}else if(!qt&&Mt){for(;j<je&&Yr(j).isGroupHeader;)j++;j>=je&&(j=K)}}const Fe=Or(Y,j,!1,pe),Ie=T.didMatch;return Ie&&(Fe||!Pe||Qt)&&D(),Ie},[Zn,Vi,U,$n,at,te,Et,B,Yr,je,Or,we,Ot,w.length,Ee,Qt,Gr,qe,Ce,Zt,Oo,fi,C,di,Sl,Cl,Jn]),Ni=g.useCallback(v=>{let D=!1;if($!==void 0&&$({...v,cancel:()=>{D=!0}}),D||kl(v)||U.current===void 0)return;const[T,N]=U.current.cell,V=tn.current;if(Be&&!v.metaKey&&!v.ctrlKey&&U.current!==void 0&&v.key.length===1&&/[ -~]/g.test(v.key)&&v.bounds!==void 0&&Ki(S([T-B,Math.max(0,Math.min(N,je-1))]))){if((!Zt||N!==je)&&(V.y>N||N>V.y+V.height||V.x>T||T>V.x+V.width))return;di(v.bounds,!0,v.key),v.stopPropagation(),v.preventDefault()}},[Be,$,kl,U,S,B,je,Zt,di]),vf=g.useCallback((v,D)=>{const T=v.location[0]-B;if(v.kind==="header"&&(xe==null||xe(T,{...v,preventDefault:D})),v.kind===Yn){if(T<0)return;J==null||J(T,{...v,preventDefault:D})}if(v.kind==="cell"){const[N,V]=v.location;oe==null||oe([T,V],{...v,preventDefault:D}),Cm(U,v.location)||Or(N,V,!1,!1)}},[U,oe,J,xe,B,Or]),Za=g.useCallback(async v=>{var W,Y,j;if(!$n.paste)return;function D(K,pe,Pe,ve){var Ie,mt;const Fe=typeof Pe=="object"?(Pe==null?void 0:Pe.join(`
173
173
  `))??"":(Pe==null?void 0:Pe.toString())??"";if(!wi(K)&&Ki(K)&&K.readonly!==!0){const Ue=I==null?void 0:I(Fe,K);if(Ue!==void 0&&vi(Ue))return{location:pe,value:Ue};const _e=St(K);if(_e===void 0)return;if(_e.kind===Z.Custom){_n(K.kind===Z.Custom);const Mt=(Ie=_e.onPaste)==null?void 0:Ie.call(_e,Fe,K.data);return Mt===void 0?void 0:{location:pe,value:{...K,data:Mt}}}else{const Mt=(mt=_e.onPaste)==null?void 0:mt.call(_e,Fe,K,{formatted:ve,formattedString:typeof ve=="string"?ve:ve==null?void 0:ve.join(`
174
174
  `),rawValue:Pe});return Mt===void 0?void 0:(_n(Mt.kind===K.kind),{location:pe,value:Mt})}}}const T=U.columns,N=U.rows,V=((W=Ut.current)==null?void 0:W.contains(document.activeElement))===!0||((Y=s.current)==null?void 0:Y.contains(document.activeElement))===!0;let X;if(U.current!==void 0?X=[U.current.range.x,U.current.range.y]:T.length===1?X=[T.first()??0,0]:N.length===1&&(X=[B,N.first()??0]),V&&X!==void 0){let K,pe;const Pe="text/plain",ve="text/html";if(navigator.clipboard.read!==void 0){const Ue=await navigator.clipboard.read();for(const _e of Ue){if(_e.types.includes(ve)){const qt=await(await _e.getType(ve)).text(),sn=gu(qt);if(sn!==void 0){K=sn;break}}_e.types.includes(Pe)&&(pe=await(await _e.getType(Pe)).text())}}else if(navigator.clipboard.readText!==void 0)pe=await navigator.clipboard.readText();else if(v!==void 0&&(v==null?void 0:v.clipboardData)!==null){if(v.clipboardData.types.includes(ve)){const Ue=v.clipboardData.getData(ve);K=gu(Ue)}K===void 0&&v.clipboardData.types.includes(Pe)&&(pe=v.clipboardData.getData(Pe))}else return;const[Fe,Ie]=X,mt=[];do{if(Je===void 0){const Ue=Pn(X),_e=pe??(K==null?void 0:K.map(qt=>qt.map(sn=>sn.rawValue).join(" ")).join(" "))??"",Mt=D(Ue,X,_e,void 0);Mt!==void 0&&mt.push(Mt);break}if(K===void 0){if(pe===void 0)return;K=N0(pe)}if(Je===!1||typeof Je=="function"&&(Je==null?void 0:Je([X[0]-B,X[1]],K.map(Ue=>Ue.map(_e=>{var Mt;return((Mt=_e.rawValue)==null?void 0:Mt.toString())??""}))))!==!0)return;for(const[Ue,_e]of K.entries()){if(Ue+Ie>=je)break;for(const[Mt,qt]of _e.entries()){const sn=[Mt+Fe,Ue+Ie],[Qn,lr]=sn;if(Qn>=xt.length||lr>=mn)continue;const er=Pn(sn),ur=D(er,sn,qt.rawValue,qt.formatted);ur!==void 0&&mt.push(ur)}}}while(!1);Nn(mt),(j=En.current)==null||j.damage(mt.map(Ue=>({cell:Ue.location})))}},[I,St,Pn,U,$n.paste,Ut,xt.length,Nn,mn,Je,B,je]);fn("paste",Za,d,!1,!0);const Bi=g.useCallback(async(v,D)=>{var W,Y;if(!$n.copy)return;const T=D===!0||((W=Ut.current)==null?void 0:W.contains(document.activeElement))===!0||((Y=s.current)==null?void 0:Y.contains(document.activeElement))===!0,N=U.columns,V=U.rows,X=(j,K)=>{if(!de)pu(j,K,v);else{const pe=K.map(Pe=>({kind:Z.Text,data:w[Pe].title,displayData:w[Pe].title,allowOverlay:!1}));pu([pe,...j],K,v)}};if(T&&cn!==void 0){if(U.current!==void 0){let j=cn(U.current.range,un.current.signal);typeof j!="object"&&(j=await j()),X(j,cr(U.current.range.x-B,U.current.range.x+U.current.range.width-B))}else if(V!==void 0&&V.length>0){const K=[...V].map(pe=>{const Pe=cn({x:B,y:pe,width:w.length,height:1},un.current.signal);return typeof Pe=="object"?Pe[0]:Pe().then(ve=>ve[0])});if(K.some(pe=>pe instanceof Promise)){const pe=await Promise.all(K);X(pe,cr(w.length))}else X(K,cr(w.length))}else if(N.length>0){const j=[],K=[];for(const pe of N){let Pe=cn({x:pe,y:0,width:1,height:je},un.current.signal);typeof Pe!="object"&&(Pe=await Pe()),j.push(Pe),K.push(pe-B)}if(j.length===1)X(j[0],K);else{const pe=j.reduce((Pe,ve)=>Pe.map((Fe,Ie)=>[...Fe,...ve[Ie]]));X(pe,K)}}}},[w,cn,U,$n.copy,B,Ut,je,de]);fn("copy",Bi,d,!1,!1);const bf=g.useCallback(async v=>{var T,N;if(!(!$n.cut||!(((T=Ut.current)==null?void 0:T.contains(document.activeElement))===!0||((N=s.current)==null?void 0:N.contains(document.activeElement))===!0))&&(await Bi(v),U.current!==void 0)){let V={current:{cell:U.current.cell,range:U.current.range,rangeStack:[]},rows:yt.empty(),columns:yt.empty()};const X=Ee==null?void 0:Ee(V);if(X===!1||(V=X===!0?V:X,V.current===void 0))return;Gr(V.current.range)}},[Gr,U,$n.cut,Bi,Ut,Ee]);fn("cut",bf,d,!1,!1);const wf=g.useCallback((v,D)=>{if(fe!==void 0){B!==0&&(v=v.map(V=>[V[0]-B,V[1]])),fe(v,D);return}if(v.length===0||D===-1)return;const[T,N]=v[D];c.current!==void 0&&c.current[0]===T&&c.current[1]===N||(c.current=[T,N],Or(T,N,!1,!1))},[fe,B,Or]),[Lo,Fo]=((Ol=zt==null?void 0:zt.current)==null?void 0:Ol.cell)??[],Ao=g.useRef(an);Ao.current=an,g.useLayoutEffect(()=>{var v,D,T,N;Ka.current&&!Ir.current&&Lo!==void 0&&Fo!==void 0&&(Lo!==((D=(v=Q.current)==null?void 0:v.current)==null?void 0:D.cell[0])||Fo!==((N=(T=Q.current)==null?void 0:T.current)==null?void 0:N.cell[1]))&&Ao.current(Lo,Fo),Ir.current=!1},[Lo,Fo]);const Ml=U.current!==void 0&&(U.current.cell[0]>=xt.length||U.current.cell[1]>=mn);g.useLayoutEffect(()=>{Ml&&we(jo,!1)},[Ml,we]);const yf=g.useMemo(()=>Zt===!0&&(Oe==null?void 0:Oe.tint)===!0?yt.fromSingleSelection(mn-1):yt.empty(),[mn,Zt,Oe==null?void 0:Oe.tint]),Cf=g.useCallback(v=>typeof ze=="boolean"?ze:(ze==null?void 0:ze(v-B))??!0,[B,ze]),Sf=g.useMemo(()=>{if(Ua===void 0||s.current===null)return null;const{bounds:v,group:D}=Ua,T=s.current.getBoundingClientRect();return g.createElement(D0,{bounds:v,group:D,canvasBounds:T,onClose:()=>Ya(void 0),onFinish:N=>{Ya(void 0),ee==null||ee(D,N)}})},[ee,Ua]),xf=Math.min(xt.length,be+(Vn?1:0));g.useImperativeHandle(t,()=>({appendRow:(v,D)=>fi(v+B,D),updateCells:v=>{var D;return B!==0&&(v=v.map(T=>({cell:[T.cell[0]+B,T.cell[1]]}))),(D=En.current)==null?void 0:D.damage(v)},getBounds:(v,D)=>{var T;if(!((s==null?void 0:s.current)===null||(Ut==null?void 0:Ut.current)===null)){if(v===void 0&&D===void 0){const N=s.current.getBoundingClientRect(),V=N.width/Ut.current.clientWidth;return{x:N.x-Ut.current.scrollLeft*V,y:N.y-Ut.current.scrollTop*V,width:Ut.current.scrollWidth*V,height:Ut.current.scrollHeight*V}}return(T=En.current)==null?void 0:T.getBounds((v??0)+B,D)}},focus:()=>{var v;return(v=En.current)==null?void 0:v.focus()},emit:async v=>{switch(v){case"delete":Ni({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":Ni({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":Ni({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 Bi(void 0,!0);break;case"paste":await Za();break}},scrollTo:an,remeasureColumns:v=>{for(const D of v)Po(D+B)}}),[fi,Po,Ut,Bi,Ni,Za,B,an]);const[Rl,El]=sr??[],kf=g.useCallback(v=>{const[D,T]=v;if(T===-1){at!=="none"&&(qe(yt.fromSingleSelection(D),void 0,!1),Cn());return}Rl===D&&El===T||(kt({cell:v,range:{x:D,y:T,width:1,height:1}},!0,!1,"keyboard-nav"),an(D,T))},[at,Cn,an,Rl,El,kt,qe]),[Mf,Rf]=g.useState(!1),Il=g.useRef(xc(v=>{Rf(v)},5)),Ef=g.useCallback(()=>{Il.current(!0),U.current===void 0&&U.columns.length===0&&U.rows.length===0&&l===void 0&&kt({cell:[B,Ro],range:{x:B,y:Ro,width:1,height:1}},!0,!1,"keyboard-select")},[Ro,U,l,B,kt]),If=g.useCallback(()=>{Il.current(!1)},[]),[Tf,Df]=g.useMemo(()=>{let v;const D=(Gt==null?void 0:Gt.scrollbarWidthOverride)??ks(),T=je+(Zt?1:0);if(typeof qn=="number")v=Dt+T*qn;else{let V=0;const X=Math.min(T,10);for(let W=0;W<X;W++)V+=qn(W);V=Math.floor(V/X),v=Dt+T*V}v+=D;const N=xt.reduce((V,X)=>X.width+V,0)+D;return[`${Math.min(1e5,N)}px`,`${Math.min(1e5,v)}px`]},[xt,Gt==null?void 0:Gt.scrollbarWidthOverride,qn,je,Zt,Dt]),Of=g.useMemo(()=>Fm(We),[We]);return g.createElement(jc.Provider,{value:We},g.createElement(Y0,{style:Of,className:Se,inWidth:p??Tf,inHeight:b??Df},g.createElement(R0,{fillHandle:Pt,drawFocusRing:Nr,experimental:Gt,fixedShadowX:jt,fixedShadowY:Kt,getRowThemeOverride:zn,headerIcons:An,imageWindowLoader:Vr,initialSize:ir,isDraggable:A,onDragLeave:rt,onRowMoved:Qe,overscrollX:Ha,overscrollY:za,preventDiagonalScrolling:wn,rightElement:Gn,rightElementProps:Dn,smoothScrollX:Hn,smoothScrollY:jn,className:Se,enableGroups:yn,onCanvasFocused:Ef,onCanvasBlur:If,canvasRef:s,onContextMenu:vf,theme:We,cellXOffset:tf,cellYOffset:Ro,accessibilityHeight:Wr.height,onDragEnd:hf,columns:xt,nonGrowWidth:Kn,drawHeader:ot,onColumnProposeMove:_,drawCell:st,disabledRows:yf,freezeColumns:xf,lockColumns:B,firstColAccessible:B===0,getCellContent:Pn,minColumnWidth:ar,maxColumnWidth:Br,searchInputRef:a,showSearch:Fi,onSearchClose:$a,highlightRegions:nf,getCellsForSelection:cn,getGroupDetails:Ba,headerHeight:Li,isFocused:Mf,groupHeaderHeight:yn?ko:0,freezeTrailingRows:Vt+(Zt&&(Oe==null?void 0:Oe.sticky)===!0?1:0),hasAppendRow:Zt,onColumnResize:ye,onColumnResizeEnd:ue,onColumnResizeStart:Me,onCellFocused:kf,onColumnMoved:df,onDragStart:ff,onHeaderMenuClick:lf,onHeaderIndicatorClick:uf,onItemHovered:qa,isFilling:(l==null?void 0:l.fillHandle)===!0,onMouseMove:sf,onKeyDown:Ni,onKeyUp:le,onMouseDown:rf,onMouseUp:af,onDragOverCell:Lt,onDrop:vt,onSearchResultsChanged:wf,onVisibleRegionChanged:cf,clientSize:ft,rowHeight:qn,searchResults:G,searchValue:k,onSearchValueChange:P,rows:mn,scrollRef:Ut,selection:U,translateX:Wr.tx,translateY:Wr.ty,verticalBorder:Cf,gridRef:En,getCellRenderer:St,resizeIndicator:Aa}),Sf,r!==void 0&&g.createElement(g.Suspense,{fallback:null},g.createElement(nv,{...r,validateCell:F,bloom:z,id:pf,getCellRenderer:St,className:(Gt==null?void 0:Gt.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:bn,imageEditorOverride:f,onFinishEditing:mf,markdownDivCreateNode:m,isOutsideClick:Mr}))))},av=g.forwardRef(ov),dd=20;function wu(e){const{cell:t,posX:n,posY:i,bounds:r,theme:o}=e,{width:a,height:s,x:l,y:u}=r,c=t.maxSize??dd,d=Math.floor(r.y+s/2),f=Rc(c,s,o.cellVerticalPadding),h=Mc(t.contentAlign??"center",l,a,o.cellHorizontalPadding,f),m=kc(h,d,f),p=Ec(l+n,u+i,m);return Vs(t)&&p}const sv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>lv(e,e.cell.data,Vs(e.cell),e.cell.maxSize??dd,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{wu(e)&&e.preventDefault()},onClick:e=>{if(wu(e))return{...e.cell,data:ld(e.cell.data)}},onPaste:(e,t)=>{let n=aa;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=$s),n===t.data?void 0:{...t,data:n}}};function lv(e,t,n,i,r){if(!n&&t===aa)return;const{ctx:o,hoverAmount:a,theme:s,rect:l,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:f}}=e,{x:h,y:m,width:p,height:b}=l;let w=!1;if(r>0){let y=n?1-r+r*a:.4;if(t===aa&&(y*=a),y===0)return;y<1&&(w=!0,o.globalAlpha=y)}Zs(o,s,t,h,m,p,b,u,c,d,i,f),w&&(o.globalAlpha=1)}const uv=hn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),cv=e=>{const{bubbles:t}=e;return g.createElement(uv,null,t.map((n,i)=>g.createElement("div",{key:i,className:"boe-bubble"},n)),g.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},dv={getAccessibilityString:e=>Ic(e.data),kind:Z.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((i,r)=>e.measureText(r).width+i+20,0)+2*n.cellHorizontalPadding-4,draw:e=>hv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return g.createElement(cv,{bubbles:t.data})},onPaste:()=>{}},fv=4;function hv(e,t){const{rect:n,theme:i,ctx:r,highlighted:o}=e,{x:a,y:s,width:l,height:u}=n,c=20,d=8,f=fv;let h=a+i.cellHorizontalPadding;const m=[];for(const p of t){if(h>a+l)break;const b=ii(p,r,i.baseFontFull).width;m.push({x:h,width:b}),h+=b+d*2+f}r.beginPath();for(const p of m)gr(r,p.x,s+(u-c)/2,p.width+d*2,c,i.roundingRadius??c/2);r.fillStyle=o?i.bgBubbleSelected:i.bgBubble,r.fill();for(const[p,b]of m.entries())r.beginPath(),r.fillStyle=i.textBubble,r.fillText(t[p],b.x+d,s+u/2+mr(r,i))}const gv=hn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),mv=e=>{const{drilldowns:t}=e;return g.createElement(gv,null,t.map((n,i)=>g.createElement("div",{key:i,className:"doe-bubble"},n.img!==void 0&&g.createElement("img",{src:n.img}),g.createElement("div",null,n.text))))},pv={getAccessibilityString:e=>Ic(e.data.map(t=>t.text)),kind:Z.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((i,r)=>e.measureText(r.text).width+i+20+(r.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>wv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return g.createElement(mv,{drilldowns:t.data})},onPaste:()=>{}},vv=4,cs={};function bv(e,t,n,i){const r=Math.ceil(window.devicePixelRatio),o=5,a=n-o*2,s=4,l=n*r,u=i+o,c=i*3,d=(c+o*2)*r,f=`${e},${t},${r},${n}`;if(cs[f]!==void 0)return{el:cs[f],height:l,width:d,middleWidth:s*r,sideWidth:u*r,padding:o*r,dpr:r};const h=document.createElement("canvas"),m=h.getContext("2d");return m===null?null:(h.width=d,h.height=l,m.scale(r,r),cs[f]=h,m.beginPath(),gr(m,o,o,c,a,i),m.shadowColor="rgba(24, 25, 34, 0.4)",m.shadowBlur=1,m.fillStyle=e,m.fill(),m.shadowColor="rgba(24, 25, 34, 0.3)",m.shadowOffsetY=1,m.shadowBlur=5,m.fillStyle=e,m.fill(),m.shadowOffsetY=0,m.shadowBlur=0,m.shadowBlur=0,m.beginPath(),gr(m,o+.5,o+.5,c,a,i),m.strokeStyle=t,m.lineWidth=1,m.stroke(),{el:h,height:l,width:d,sideWidth:u*r,middleWidth:i*r,padding:o*r,dpr:r})}function wv(e,t){const{rect:n,theme:i,ctx:r,imageLoader:o,col:a,row:s}=e,{x:l,width:u}=n,c=i.baseFontFull,d=Wc(r,c),f=Math.min(n.height,Math.max(16,Math.ceil(d*i.lineHeight)*2)),h=Math.floor(n.y+(n.height-f)/2),m=f-10,p=8,b=vv;let w=l+i.cellHorizontalPadding;const y=i.roundingRadius??6,S=bv(i.bgCell,i.drilldownBorder,f,y),M=[];for(const C of t){if(w>l+u)break;const R=ii(C.text,r,c).width;let I=0;C.img!==void 0&&o.loadOrGetImage(C.img,a,s)!==void 0&&(I=m-8+4);const E=R+I+p*2;M.push({x:w,width:E}),w+=E+b}if(S!==null){const{el:C,height:x,middleWidth:R,sideWidth:I,width:E,dpr:H,padding:z}=S,L=I/H,_=z/H;for(const O of M){const ne=Math.floor(O.x),q=Math.floor(O.width),oe=q-(L-_)*2;r.imageSmoothingEnabled=!1,r.drawImage(C,0,0,I,x,ne-_,h,L,f),oe>0&&r.drawImage(C,I,0,R,x,ne+(L-_),h,oe,f),r.drawImage(C,E-I,0,I,x,ne+q-(L-_),h,L,f),r.imageSmoothingEnabled=!0}}r.beginPath();for(const[C,x]of M.entries()){const R=t[C];let I=x.x+p;if(R.img!==void 0){const E=o.loadOrGetImage(R.img,a,s);if(E!==void 0){const H=m-8;let z=0,L=0,_=E.width,O=E.height;_>O?(z+=(_-O)/2,_=O):O>_&&(L+=(O-_)/2,O=_),r.beginPath(),gr(r,I,h+f/2-H/2,H,H,i.roundingRadius??3),r.save(),r.clip(),r.drawImage(E,z,L,_,O,I,h+f/2-H/2,H,H),r.restore(),I+=H+4}}r.beginPath(),r.fillStyle=i.textBubble,r.fillText(R.text,I,h+f/2+mr(r,i))}}const yv={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Cv(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:i}=e,r=i??Yg;return g.createElement(r,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:o=>{n({...t,data:[o]})}})},onPaste:(e,t)=>{e=e.trim();const i=e.split(",").map(r=>{try{return new URL(r),r}catch{return}}).filter(r=>r!==void 0);if(!(i.length===t.data.length&&i.every((r,o)=>r===t.data[o])))return{...t,data:i}}},ds=4;function Cv(e,t,n,i){const{rect:r,col:o,row:a,theme:s,ctx:l,imageLoader:u}=e,{x:c,y:d,height:f,width:h}=r,m=f-s.cellVerticalPadding*2,p=[];let b=0;for(let y=0;y<t.length;y++){const S=t[y];if(S.length===0)continue;const M=u.loadOrGetImage(S,o,a);if(M!==void 0){p[y]=M;const C=M.width*(m/M.height);b+=C+ds}}if(b===0)return;b-=ds;let w=c+s.cellHorizontalPadding;i==="right"?w=Math.floor(c+h-s.cellHorizontalPadding-b):i==="center"&&(w=Math.floor(c+h/2-b/2));for(const y of p){if(y===void 0)continue;const S=y.width*(m/y.height);n>0&&(l.beginPath(),gr(l,w,d+s.cellVerticalPadding,S,m,n),l.save(),l.clip()),l.drawImage(y,w,d+s.cellVerticalPadding,S,m),n>0&&l.restore(),w+=S+ds}}function Sv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const xv={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:i,ctx:r,rect:o,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let s=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(s+=Math.round(Sv(n,i)*t.skeletonWidthVariability));const l=a.cellHorizontalPadding;s+l*2>=o.width&&(s=o.width-l*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*a.cellVerticalPadding);gr(r,o.x+l,o.y+(o.height-u)/2,s,u,a.roundingRadius??3),r.fillStyle=ei(a.textDark,.1),r.fill()},onPaste:()=>{}},kv=()=>e=>e.targetWidth,yu=hn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[kv(),"px"]}}),Mv=e=>{const{value:t,onChange:n,forceEditMode:i,createNode:r,targetRect:o,onFinish:a,validatedSelection:s}=e,l=t.data,u=t.readonly===!0,[c,d]=g.useState(l===""||i),f=g.useCallback(()=>{d(m=>!m)},[]),h=l?"gdg-ml-6":"";return c?g.createElement(yu,{targetWidth:o.width-20},g.createElement(Ei,{autoFocus:!0,highlight:!1,validatedSelection:s,value:l,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},onChange:n}),g.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>a(t)},g.createElement(zg,null))):g.createElement(yu,{targetWidth:o.width},g.createElement(cm,{contents:l,createNode:r}),!u&&g.createElement(g.Fragment,null,g.createElement("div",{className:"spacer"}),g.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:f},g.createElement(Us,null))),g.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Rv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:po,measure:(e,t,n)=>{const i=t.data.split(`
175
- `)[0];return e.measureText(i).width+2*n.cellHorizontalPadding},draw:e=>dr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:i,onFinishedEditing:r,markdownDivCreateNode:o,forceEditMode:a,validatedSelection:s}=e;return g.createElement(Mv,{onFinish:r,targetRect:i,value:n,validatedSelection:s,onChange:l=>t({...n,data:l.target.value}),forceEditMode:a,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Ev={getAccessibilityString:e=>e.row.toString(),kind:Xn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Iv,measure:()=>44,draw:e=>Dv(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:i,posY:r}=e,{width:o,height:a}=t,s=n.drawHandle?7+(o-7)/2:o/2,l=a/2;if(Math.abs(i-s)<=10&&Math.abs(r-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Iv(e,t){const{ctx:n,theme:i}=e,r=i.markerFontFull,o=t??{};return(o==null?void 0:o.font)!==r&&(n.font=r,o.font=r),o.deprep=Tv,n.textAlign="center",o}function Tv(e){const{ctx:t}=e;t.textAlign="start"}function Dv(e,t,n,i,r,o){const{ctx:a,rect:s,hoverAmount:l,theme:u}=e,{x:c,y:d,width:f,height:h}=s,m=n?1:i==="checkbox-visible"?.6+.4*l:l;if(i!=="number"&&m>0){a.globalAlpha=m;const p=7*(n?l:1);if(Zs(a,u,n,r?c+p:c,d,r?f-p:f,h,!0,void 0,void 0,18,"center",o),r){a.globalAlpha=l,a.beginPath();for(const b of[3,6])for(const w of[-5,-1,3])a.rect(c+b,d+h/2+w,2,2);a.fillStyle=u.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(i==="number"||i==="both"&&!n){const p=t.toString(),b=u.markerFontFull,w=c+f/2;i==="both"&&l!==0&&(a.globalAlpha=1-l),a.fillStyle=u.textLight,a.font=b,a.fillText(p,w,d+h/2+mr(a,b)),l!==0&&(a.globalAlpha=1)}}const Ov={getAccessibilityString:()=>"",kind:Xn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Pv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Pv(e,t,n){const{ctx:i,rect:r,hoverAmount:o,theme:a,spriteManager:s}=e,{x:l,y:u,width:c,height:d}=r;i.beginPath(),i.globalAlpha=o,i.rect(l+1,u+1,c,d-2),i.fillStyle=a.bgHeaderHovered,i.fill(),i.globalAlpha=1,i.beginPath();const f=t!=="";let h=0;if(n!==void 0){const p=d-8,b=l+8/2,w=u+8/2;s.drawSprite(n,"normal",i,b,w,p,a,f?1:o),h=p}else{h=24;const m=12,p=f?m:o*m,b=f?0:(1-o)*m*.5,w=a.cellHorizontalPadding+4;p>0&&(i.moveTo(l+w+b,u+d/2),i.lineTo(l+w+b+p,u+d/2),i.moveTo(l+w+b+p*.5,u+d/2-p*.5),i.lineTo(l+w+b+p*.5,u+d/2+p*.5),i.lineWidth=2,i.strokeStyle=a.bgIconHeader,i.lineCap="round",i.stroke())}i.fillStyle=a.textMedium,i.fillText(t,h+l+a.cellHorizontalPadding+.5,u+d/2+mr(i,a)),i.beginPath()}function fd(e,t,n,i,r,o,a){e.textBaseline="alphabetic";const s=_v(e,r,i,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),gr(e,s.x,s.y,s.width,s.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=(n==null?void 0:n.bgColor)??ei(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a==null||a("text")}function _v(e,t,n,i,r){const o=i.cellHorizontalPadding,a=i.cellVerticalPadding;if(r)return{x:t.x+o/2,y:t.y+a/2+1,width:t.width-o,height:t.height-a-1};const s=ii(n,e,i.baseFontFull,"alphabetic"),l=t.height-a,u=Math.min(l,s.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:s.width+o*3,height:u-1}}const Lv=g.lazy(async()=>await As(()=>import("./number-overlay-editor.D5dgP2YW.js"),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url)),Fv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:po,draw:e=>{const{hoverAmount:t,cell:n,ctx:i,theme:r,rect:o,overrideCursor:a}=e,{hoverEffect:s,displayData:l,hoverEffectTheme:u}=n;s===!0&&t>0&&fd(i,r,u,l,o,t,a),dr(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:i,validatedSelection:r}=e;return g.createElement(g.Suspense,{fallback:null},g.createElement(Lv,{highlight:t,disabled:i.readonly===!0,value:i.data,fixedDecimals:i.fixedDecimals,allowNegative:i.allowNegative,thousandSeparator:i.thousandSeparator,decimalSeparator:i.decimalSeparator,validatedSelection:r,onChange:o=>n({...i,data:Number.isNaN(o.floatValue??0)?0:o.floatValue})}))},onPaste:(e,t,n)=>{const i=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(i)||t.data===i))return{...t,data:i,displayData:n.formattedString??t.displayData}}},Av={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:Hv,onPaste:()=>{}};function Hv(e){const{ctx:t,theme:n,rect:i}=e,{x:r,y:o,height:a}=i;t.beginPath();const s=2.5;let l=r+n.cellHorizontalPadding+s;const u=o+a/2,c=Math.cos(Xl(30))*s,d=Math.sin(Xl(30))*s;for(let f=0;f<12;f++)t.moveTo(l,u-s),t.lineTo(l,u+s),t.moveTo(l+c,u-d),t.lineTo(l-c,u+d),t.moveTo(l-c,u-d),t.lineTo(l+c,u+d),l+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const zv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>po(e,t,e.theme.textLight),draw:e=>dr(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:i,validatedSelection:r}=e;return ae.createElement(Ei,{highlight:t,autoFocus:i.readonly!==!0,disabled:i.readonly!==!1,value:i.data,validatedSelection:r,onChange:o=>n({...i,data:o.target.value})})},onPaste:()=>{}},$v={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:po,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:i,ctx:r,rect:o,theme:a,overrideCursor:s}=e,{displayData:l,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:f}=t;c===!0&&n>0&&fd(r,a,f,l,o,n,s),dr(e,l,u,d,i)},measure:(e,t,n)=>{const i=t.displayData.split(`
175
+ `)[0];return e.measureText(i).width+2*n.cellHorizontalPadding},draw:e=>dr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:i,onFinishedEditing:r,markdownDivCreateNode:o,forceEditMode:a,validatedSelection:s}=e;return g.createElement(Mv,{onFinish:r,targetRect:i,value:n,validatedSelection:s,onChange:l=>t({...n,data:l.target.value}),forceEditMode:a,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Ev={getAccessibilityString:e=>e.row.toString(),kind:Xn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Iv,measure:()=>44,draw:e=>Dv(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:i,posY:r}=e,{width:o,height:a}=t,s=n.drawHandle?7+(o-7)/2:o/2,l=a/2;if(Math.abs(i-s)<=10&&Math.abs(r-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Iv(e,t){const{ctx:n,theme:i}=e,r=i.markerFontFull,o=t??{};return(o==null?void 0:o.font)!==r&&(n.font=r,o.font=r),o.deprep=Tv,n.textAlign="center",o}function Tv(e){const{ctx:t}=e;t.textAlign="start"}function Dv(e,t,n,i,r,o){const{ctx:a,rect:s,hoverAmount:l,theme:u}=e,{x:c,y:d,width:f,height:h}=s,m=n?1:i==="checkbox-visible"?.6+.4*l:l;if(i!=="number"&&m>0){a.globalAlpha=m;const p=7*(n?l:1);if(Zs(a,u,n,r?c+p:c,d,r?f-p:f,h,!0,void 0,void 0,18,"center",o),r){a.globalAlpha=l,a.beginPath();for(const b of[3,6])for(const w of[-5,-1,3])a.rect(c+b,d+h/2+w,2,2);a.fillStyle=u.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(i==="number"||i==="both"&&!n){const p=t.toString(),b=u.markerFontFull,w=c+f/2;i==="both"&&l!==0&&(a.globalAlpha=1-l),a.fillStyle=u.textLight,a.font=b,a.fillText(p,w,d+h/2+mr(a,b)),l!==0&&(a.globalAlpha=1)}}const Ov={getAccessibilityString:()=>"",kind:Xn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Pv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Pv(e,t,n){const{ctx:i,rect:r,hoverAmount:o,theme:a,spriteManager:s}=e,{x:l,y:u,width:c,height:d}=r;i.beginPath(),i.globalAlpha=o,i.rect(l+1,u+1,c,d-2),i.fillStyle=a.bgHeaderHovered,i.fill(),i.globalAlpha=1,i.beginPath();const f=t!=="";let h=0;if(n!==void 0){const p=d-8,b=l+8/2,w=u+8/2;s.drawSprite(n,"normal",i,b,w,p,a,f?1:o),h=p}else{h=24;const m=12,p=f?m:o*m,b=f?0:(1-o)*m*.5,w=a.cellHorizontalPadding+4;p>0&&(i.moveTo(l+w+b,u+d/2),i.lineTo(l+w+b+p,u+d/2),i.moveTo(l+w+b+p*.5,u+d/2-p*.5),i.lineTo(l+w+b+p*.5,u+d/2+p*.5),i.lineWidth=2,i.strokeStyle=a.bgIconHeader,i.lineCap="round",i.stroke())}i.fillStyle=a.textMedium,i.fillText(t,h+l+a.cellHorizontalPadding+.5,u+d/2+mr(i,a)),i.beginPath()}function fd(e,t,n,i,r,o,a){e.textBaseline="alphabetic";const s=_v(e,r,i,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),gr(e,s.x,s.y,s.width,s.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=(n==null?void 0:n.bgColor)??ei(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a==null||a("text")}function _v(e,t,n,i,r){const o=i.cellHorizontalPadding,a=i.cellVerticalPadding;if(r)return{x:t.x+o/2,y:t.y+a/2+1,width:t.width-o,height:t.height-a-1};const s=ii(n,e,i.baseFontFull,"alphabetic"),l=t.height-a,u=Math.min(l,s.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:s.width+o*3,height:u-1}}const Lv=g.lazy(async()=>await As(()=>import("./number-overlay-editor.YLsBH7YM.js"),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url)),Fv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:po,draw:e=>{const{hoverAmount:t,cell:n,ctx:i,theme:r,rect:o,overrideCursor:a}=e,{hoverEffect:s,displayData:l,hoverEffectTheme:u}=n;s===!0&&t>0&&fd(i,r,u,l,o,t,a),dr(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:i,validatedSelection:r}=e;return g.createElement(g.Suspense,{fallback:null},g.createElement(Lv,{highlight:t,disabled:i.readonly===!0,value:i.data,fixedDecimals:i.fixedDecimals,allowNegative:i.allowNegative,thousandSeparator:i.thousandSeparator,decimalSeparator:i.decimalSeparator,validatedSelection:r,onChange:o=>n({...i,data:Number.isNaN(o.floatValue??0)?0:o.floatValue})}))},onPaste:(e,t,n)=>{const i=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(i)||t.data===i))return{...t,data:i,displayData:n.formattedString??t.displayData}}},Av={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:Hv,onPaste:()=>{}};function Hv(e){const{ctx:t,theme:n,rect:i}=e,{x:r,y:o,height:a}=i;t.beginPath();const s=2.5;let l=r+n.cellHorizontalPadding+s;const u=o+a/2,c=Math.cos(Xl(30))*s,d=Math.sin(Xl(30))*s;for(let f=0;f<12;f++)t.moveTo(l,u-s),t.lineTo(l,u+s),t.moveTo(l+c,u-d),t.lineTo(l-c,u+d),t.moveTo(l-c,u-d),t.lineTo(l+c,u+d),l+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const zv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>po(e,t,e.theme.textLight),draw:e=>dr(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:i,validatedSelection:r}=e;return ae.createElement(Ei,{highlight:t,autoFocus:i.readonly!==!0,disabled:i.readonly!==!1,value:i.data,validatedSelection:r,onChange:o=>n({...i,data:o.target.value})})},onPaste:()=>{}},$v={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:po,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:i,ctx:r,rect:o,theme:a,overrideCursor:s}=e,{displayData:l,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:f}=t;c===!0&&n>0&&fd(r,a,f,l,o,n,s),dr(e,l,u,d,i)},measure:(e,t,n)=>{const i=t.displayData.split(`
176
176
  `,t.allowWrapping===!0?void 0:1);let r=0;for(const o of i)r=Math.max(r,e.measureText(o).width);return r+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:i,value:r,validatedSelection:o}=t;return g.createElement(Ei,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:r.readonly!==!0,disabled:r.readonly===!0,altNewline:!0,value:r.data,validatedSelection:o,onChange:a=>i({...r,data:a.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Vv=hn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Nv=e=>{const{uri:t,onChange:n,forceEditMode:i,readonly:r,validatedSelection:o,preview:a}=e,[s,l]=g.useState(!r&&(t===""||i)),u=g.useCallback(()=>{l(!0)},[]);return s?g.createElement(Ei,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):g.createElement(Vv,null,g.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!r&&g.createElement("div",{className:"gdg-edit-icon",onClick:u},g.createElement(Us,null)),g.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function hd(e,t,n,i){let r=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,s=e.actualBoundingBoxAscent;return i==="right"?r=t.width-a-n.cellHorizontalPadding:i==="center"&&(r=t.width/2-a/2),{x:r,y:o,width:a,height:s}}function Cu(e){const{cell:t,bounds:n,posX:i,posY:r,theme:o}=e,a=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const s=Vc(a,o.baseFontFull);if(s===void 0)return!1;const l=hd(s,n,o,t.contentAlign);return Qr({x:l.x-4,y:l.y-4,width:l.width+8,height:l.height+8},i,r)}const Bv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:po,draw:e=>{const{cell:t,theme:n,overrideCursor:i,hoverX:r,hoverY:o,rect:a,ctx:s}=e,l=t.displayData??t.data,u=t.hoverEffect===!0;if(i!==void 0&&u&&r!==void 0&&o!==void 0){const c=ii(l,s,n.baseFontFull),d=hd(c,a,n,t.contentAlign),{x:f,y:h,width:m,height:p}=d;if(r>=f-4&&r<=f-4+m+8&&o>=h-4&&o<=h-4+p+8){const b=mr(s,n.baseFontFull);i("pointer");const w=5,y=h-b;s.beginPath(),s.moveTo(a.x+f,Math.floor(a.y+y+p+w)+.5),s.lineTo(a.x+f+m,Math.floor(a.y+y+p+w)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,dr({...e,rect:{...a,x:a.x-1}},l,t.contentAlign),dr({...e,rect:{...a,x:a.x-2}},l,t.contentAlign),dr({...e,rect:{...a,x:a.x+1}},l,t.contentAlign),dr({...e,rect:{...a,x:a.x+2}},l,t.contentAlign),s.restore()}}s.fillStyle=u?n.linkColor:n.textDark,dr(e,l,t.contentAlign)},onSelect:e=>{Cu(e)&&e.preventDefault()},onClick:e=>{var i;const{cell:t}=e;Cu(e)&&((i=t.onClickUri)==null||i.call(t,e))},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:i,forceEditMode:r,validatedSelection:o}=t;return g.createElement(Nv,{forceEditMode:i.readonly!==!0&&(r||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:i.data,preview:i.displayData??i.data,validatedSelection:o,readonly:i.readonly===!0,onChange:a=>n({...i,data:a.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Wv=[Ev,Ov,sv,dv,pv,yv,xv,Rv,Fv,Av,zv,$v,Bv];var Uv=Sc,Yv=oc,Xv="Expected a function";function Gv(e,t,n){var i=!0,r=!0;if(typeof e!="function")throw new TypeError(Xv);return Yv(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Uv(e,t,{leading:i,maxWait:t,trailing:r})}var jv=Gv;const qv=co(jv),fs=[];class Kv extends Yc{constructor(){super(...arguments);dt(this,"imageLoaded",()=>{});dt(this,"loadedLocations",[]);dt(this,"cache",{});dt(this,"sendLoaded",qv(()=>{this.imageLoaded(new io(this.loadedLocations)),this.loadedLocations=[]},20));dt(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const i of n){const r=this.cache[i];let o=!1;for(let a=0;a<r.cells.length;a++){const s=r.cells[a];if(this.isInWindow(s)){o=!0;break}}o?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[i])}})}setCallback(n){this.imageLoaded=n}loadImage(n,i,r,o){let a=!1;const s=fs.pop()??new Image;let l=!1;const u={img:void 0,cells:[rr(i,r)],url:n,cancel:()=>{l||(l=!0,fs.length<12?fs.unshift(s):a||(s.src=""))}},c=new Promise(d=>s.addEventListener("load",()=>d(null)));requestAnimationFrame(async()=>{try{s.src=n,await c,await s.decode();const d=this.cache[o];if(d!==void 0&&!l){d.img=s;for(const f of d.cells)this.loadedLocations.push(Ks(f));a=!0,this.sendLoaded()}}catch{u.cancel()}}),this.cache[o]=u}loadOrGetImage(n,i,r){const o=n,a=this.cache[o];if(a!==void 0){const s=rr(i,r);return a.cells.includes(s)||a.cells.push(s),a.img}else this.loadImage(n,i,r,o)}}const Zv=(e,t)=>{const n=g.useMemo(()=>({...zp,...e.headerIcons}),[e.headerIcons]),i=g.useMemo(()=>e.imageWindowLoader??new Kv,[e.imageWindowLoader]);return g.createElement(av,{...e,renderers:Wv,headerIcons:n,ref:t,imageWindowLoader:i})},Jv=g.forwardRef(Zv);function Su(e,t){const n=g.useRef(null),i=g.useRef(),r=g.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return g.useEffect(()=>r,[r]),{debouncedCallback:g.useCallback((...a)=>{i.current=a,r(),n.current=setTimeout(()=>{i.current&&(e(...i.current),i.current=void 0)},t)},[e,t,r]),cancel:r}}var Qv={exports:{}};/*! Moment Duration Format v2.2.2
177
177
  * https://github.com/jsmreese/moment-duration-format
178
178
  * Date: 2018-02-16
@@ -194,4 +194,4 @@ Error: ${f}`)}},[t,n,e,i,r])}}function M1(e,t,n,i,r,o,a){const s=t.defaultRowHei
194
194
  0%, 80%, 100% { opacity: 0; }
195
195
  40% { opacity: 1; }
196
196
  `]))),Yb=function(t,n){var i=t.isFocused,r=t.size,o=t.theme,a=o.colors,s=o.spacing.baseUnit;return Ye({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},n?{}:{color:i?a.neutral60:a.neutral20,padding:s*2})},hs=function(t){var n=t.delay,i=t.offset;return Ne("span",{css:hc({animation:"".concat(Ub," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:i?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Xb=function(t){var n=t.innerProps,i=t.isRtl,r=t.size,o=r===void 0?4:r,a=kr(t,Ab);return Ne("div",et({},nn(Ye(Ye({},a),{},{innerProps:n,isRtl:i,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Ne(hs,{delay:0,offset:i}),Ne(hs,{delay:160,offset:!0}),Ne(hs,{delay:320,offset:!i}))},Gb=function(t,n){var i=t.isDisabled,r=t.isFocused,o=t.theme,a=o.colors,s=o.borderRadius,l=o.spacing;return Ye({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:i?a.neutral5:a.neutral0,borderColor:i?a.neutral10:r?a.primary:a.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:r?a.primary:a.neutral30}})},jb=function(t){var n=t.children,i=t.isDisabled,r=t.isFocused,o=t.innerRef,a=t.innerProps,s=t.menuIsOpen;return Ne("div",et({ref:o},nn(t,"control",{control:!0,"control--is-disabled":i,"control--is-focused":r,"control--menu-is-open":s}),a,{"aria-disabled":i||void 0}),n)},qb=jb,Kb=["data"],Zb=function(t,n){var i=t.theme.spacing;return n?{}:{paddingBottom:i.baseUnit*2,paddingTop:i.baseUnit*2}},Jb=function(t){var n=t.children,i=t.cx,r=t.getStyles,o=t.getClassNames,a=t.Heading,s=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return Ne("div",et({},nn(t,"group",{group:!0}),l),Ne(a,et({},s,{selectProps:d,theme:c,getStyles:r,getClassNames:o,cx:i}),u),Ne("div",null,n))},Qb=function(t,n){var i=t.theme,r=i.colors,o=i.spacing;return Ye({label:"group",cursor:"default",display:"block"},n?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},ew=function(t){var n=Dd(t);n.data;var i=kr(n,Kb);return Ne("div",et({},nn(t,"groupHeading",{"group-heading":!0}),i))},tw=Jb,nw=["innerRef","isDisabled","isHidden","inputClassName"],rw=function(t,n){var i=t.isDisabled,r=t.value,o=t.theme,a=o.spacing,s=o.colors;return Ye(Ye({visibility:i?"hidden":"visible",transform:r?"translateZ(0)":""},iw),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:s.neutral80})},$d={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},iw={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Ye({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},$d)},ow=function(t){return Ye({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},$d)},aw=function(t){var n=t.cx,i=t.value,r=Dd(t),o=r.innerRef,a=r.isDisabled,s=r.isHidden,l=r.inputClassName,u=kr(r,nw);return Ne("div",et({},nn(t,"input",{"input-container":!0}),{"data-value":i||""}),Ne("input",et({className:n({input:!0},l),ref:o,style:ow(s),disabled:a},u)))},sw=aw,lw=function(t,n){var i=t.theme,r=i.spacing,o=i.borderRadius,a=i.colors;return Ye({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},uw=function(t,n){var i=t.theme,r=i.borderRadius,o=i.colors,a=t.cropWithEllipsis;return Ye({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},cw=function(t,n){var i=t.theme,r=i.spacing,o=i.borderRadius,a=i.colors,s=t.isFocused;return Ye({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:s?a.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},Vd=function(t){var n=t.children,i=t.innerProps;return Ne("div",i,n)},dw=Vd,fw=Vd;function hw(e){var t=e.children,n=e.innerProps;return Ne("div",et({role:"button"},n),t||Ne(hl,{size:14}))}var gw=function(t){var n=t.children,i=t.components,r=t.data,o=t.innerProps,a=t.isDisabled,s=t.removeProps,l=t.selectProps,u=i.Container,c=i.Label,d=i.Remove;return Ne(u,{data:r,innerProps:Ye(Ye({},nn(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:l},Ne(c,{data:r,innerProps:Ye({},nn(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Ne(d,{data:r,innerProps:Ye(Ye({},nn(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},s),selectProps:l}))},mw=gw,pw=function(t,n){var i=t.isDisabled,r=t.isFocused,o=t.isSelected,a=t.theme,s=a.spacing,l=a.colors;return Ye({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:r?l.primary25:"transparent",color:i?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(s.baseUnit*2,"px ").concat(s.baseUnit*3,"px"),":active":{backgroundColor:i?void 0:o?l.primary:l.primary50}})},vw=function(t){var n=t.children,i=t.isDisabled,r=t.isFocused,o=t.isSelected,a=t.innerRef,s=t.innerProps;return Ne("div",et({},nn(t,"option",{option:!0,"option--is-disabled":i,"option--is-focused":r,"option--is-selected":o}),{ref:a,"aria-disabled":i},s),n)},bw=vw,ww=function(t,n){var i=t.theme,r=i.spacing,o=i.colors;return Ye({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},yw=function(t){var n=t.children,i=t.innerProps;return Ne("div",et({},nn(t,"placeholder",{placeholder:!0}),i),n)},Cw=yw,Sw=function(t,n){var i=t.isDisabled,r=t.theme,o=r.spacing,a=r.colors;return Ye({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:i?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},xw=function(t){var n=t.children,i=t.isDisabled,r=t.innerProps;return Ne("div",et({},nn(t,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),r),n)},kw=xw,Nd={ClearIndicator:Nb,Control:qb,DropdownIndicator:$b,DownChevron:Hd,CrossIcon:hl,Group:tw,GroupHeading:ew,IndicatorsContainer:Lb,IndicatorSeparator:Wb,Input:sw,LoadingIndicator:Xb,Menu:yb,MenuList:Sb,MenuPortal:Ib,LoadingMessage:Rb,NoOptionsMessage:Mb,MultiValue:mw,MultiValueContainer:dw,MultiValueLabel:fw,MultiValueRemove:hw,Option:bw,Placeholder:Cw,SelectContainer:Db,SingleValue:kw,ValueContainer:Pb},Mw=function(t){return Ye(Ye({},Nd),t.components)},Vu=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Rw(e,t){return!!(e===t||Vu(e)&&Vu(t))}function Ew(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Rw(e[n],t[n]))return!1;return!0}function Iw(e,t){t===void 0&&(t=Ew);var n=null;function i(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var a=e.apply(this,r);return n={lastResult:a,lastArgs:r,lastThis:this},a}return i.clear=function(){n=null},i}var Tw={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},Dw=function(t){return Ne("span",et({css:Tw},t))},Nu=Dw,Ow={guidance:function(t){var n=t.isSearchable,i=t.isMulti,r=t.tabSelectsValue,o=t.context,a=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return a?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(i?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,i=t.label,r=i===void 0?"":i,o=t.labels,a=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return a?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(t){var n=t.context,i=t.focused,r=t.options,o=t.label,a=o===void 0?"":o,s=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(p,b){return p&&p.length?"".concat(p.indexOf(b)+1," of ").concat(p.length):""};if(n==="value"&&s)return"value ".concat(a," focused, ").concat(d(s,i),".");if(n==="menu"&&c){var f=l?" disabled":"",h="".concat(u?" selected":"").concat(f);return"".concat(a).concat(h,", ").concat(d(r,i),".")}return""},onFilter:function(t){var n=t.inputValue,i=t.resultsMessage;return"".concat(i).concat(n?" for search term "+n:"",".")}},Pw=function(t){var n=t.ariaSelection,i=t.focusedOption,r=t.focusedValue,o=t.focusableOptions,a=t.isFocused,s=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,d=l.ariaLiveMessages,f=l.getOptionLabel,h=l.inputValue,m=l.isMulti,p=l.isOptionDisabled,b=l.isSearchable,w=l.menuIsOpen,y=l.options,S=l.screenReaderStatus,M=l.tabSelectsValue,C=l.isLoading,x=l["aria-label"],R=l["aria-live"],I=g.useMemo(function(){return Ye(Ye({},Ow),d||{})},[d]),E=g.useMemo(function(){var ne="";if(n&&I.onChange){var q=n.option,oe=n.options,Se=n.removedValue,xe=n.removedValues,re=n.value,J=function(k){return Array.isArray(k)?null:k},ee=Se||q||J(re),ie=ee?f(ee):"",ge=oe||xe||void 0,fe=ge?ge.map(f):[],G=Ye({isDisabled:ee&&p(ee,s),label:ie,labels:fe},n);ne=I.onChange(G)}return ne},[n,I,p,s,f]),H=g.useMemo(function(){var ne="",q=i||r,oe=!!(i&&s&&s.includes(i));if(q&&I.onFocus){var Se={focused:q,label:f(q),isDisabled:p(q,s),isSelected:oe,options:o,context:q===i?"menu":"value",selectValue:s,isAppleDevice:c};ne=I.onFocus(Se)}return ne},[i,r,f,p,I,o,s,c]),z=g.useMemo(function(){var ne="";if(w&&y.length&&!C&&I.onFilter){var q=S({count:o.length});ne=I.onFilter({inputValue:h,resultsMessage:q})}return ne},[o,h,w,I,y,S,C]),L=(n==null?void 0:n.action)==="initial-input-focus",_=g.useMemo(function(){var ne="";if(I.guidance){var q=r?"value":w?"menu":"input";ne=I.guidance({"aria-label":x,context:q,isDisabled:i&&p(i,s),isMulti:m,isSearchable:b,tabSelectsValue:M,isInitialFocus:L})}return ne},[x,i,r,m,p,b,w,I,s,M,L]),O=Ne(g.Fragment,null,Ne("span",{id:"aria-selection"},E),Ne("span",{id:"aria-focused"},H),Ne("span",{id:"aria-results"},z),Ne("span",{id:"aria-guidance"},_));return Ne(g.Fragment,null,Ne(Nu,{id:u},L&&O),Ne(Nu,{"aria-live":R,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!L&&O))},_w=Pw,Ls=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Lw=new RegExp("["+Ls.map(function(e){return e.letters}).join("")+"]","g"),Bd={};for(var gs=0;gs<Ls.length;gs++)for(var ms=Ls[gs],ps=0;ps<ms.letters.length;ps++)Bd[ms.letters[ps]]=ms.base;var Wd=function(t){return t.replace(Lw,function(n){return Bd[n]})},Fw=Iw(Wd),Bu=function(t){return t.replace(/^\s+|\s+$/g,"")},Aw=function(t){return"".concat(t.label," ").concat(t.value)},Hw=function(t){return function(n,i){if(n.data.__isNew__)return!0;var r=Ye({ignoreCase:!0,ignoreAccents:!0,stringify:Aw,trim:!0,matchFrom:"any"},t),o=r.ignoreCase,a=r.ignoreAccents,s=r.stringify,l=r.trim,u=r.matchFrom,c=l?Bu(i):i,d=l?Bu(s(n)):s(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),a&&(c=Fw(c),d=Wd(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},zw=["innerRef"];function $w(e){var t=e.innerRef,n=kr(e,zw),i=fb(n,"onExited","in","enter","exit","appear");return Ne("input",et({ref:t},i,{css:hc({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Vw=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function Nw(e){var t=e.isEnabled,n=e.onBottomArrive,i=e.onBottomLeave,r=e.onTopArrive,o=e.onTopLeave,a=g.useRef(!1),s=g.useRef(!1),l=g.useRef(0),u=g.useRef(null),c=g.useCallback(function(b,w){if(u.current!==null){var y=u.current,S=y.scrollTop,M=y.scrollHeight,C=y.clientHeight,x=u.current,R=w>0,I=M-C-S,E=!1;I>w&&a.current&&(i&&i(b),a.current=!1),R&&s.current&&(o&&o(b),s.current=!1),R&&w>I?(n&&!a.current&&n(b),x.scrollTop=M,E=!0,a.current=!0):!R&&-w>S&&(r&&!s.current&&r(b),x.scrollTop=0,E=!0,s.current=!0),E&&Vw(b)}},[n,i,r,o]),d=g.useCallback(function(b){c(b,b.deltaY)},[c]),f=g.useCallback(function(b){l.current=b.changedTouches[0].clientY},[]),h=g.useCallback(function(b){var w=l.current-b.changedTouches[0].clientY;c(b,w)},[c]),m=g.useCallback(function(b){if(b){var w=ub?{passive:!1}:!1;b.addEventListener("wheel",d,w),b.addEventListener("touchstart",f,w),b.addEventListener("touchmove",h,w)}},[h,f,d]),p=g.useCallback(function(b){b&&(b.removeEventListener("wheel",d,!1),b.removeEventListener("touchstart",f,!1),b.removeEventListener("touchmove",h,!1))},[h,f,d]);return g.useEffect(function(){if(t){var b=u.current;return m(b),function(){p(b)}}},[t,m,p]),function(b){u.current=b}}var Wu=["boxSizing","height","overflow","paddingRight","position"],Uu={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Yu(e){e.preventDefault()}function Xu(e){e.stopPropagation()}function Gu(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function ju(){return"ontouchstart"in window||navigator.maxTouchPoints}var qu=!!(typeof window<"u"&&window.document&&window.document.createElement),ji=0,pi={capture:!1,passive:!1};function Bw(e){var t=e.isEnabled,n=e.accountForScrollbars,i=n===void 0?!0:n,r=g.useRef({}),o=g.useRef(null),a=g.useCallback(function(l){if(qu){var u=document.body,c=u&&u.style;if(i&&Wu.forEach(function(m){var p=c&&c[m];r.current[m]=p}),i&&ji<1){var d=parseInt(r.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,h=window.innerWidth-f+d||0;Object.keys(Uu).forEach(function(m){var p=Uu[m];c&&(c[m]=p)}),c&&(c.paddingRight="".concat(h,"px"))}u&&ju()&&(u.addEventListener("touchmove",Yu,pi),l&&(l.addEventListener("touchstart",Gu,pi),l.addEventListener("touchmove",Xu,pi))),ji+=1}},[i]),s=g.useCallback(function(l){if(qu){var u=document.body,c=u&&u.style;ji=Math.max(ji-1,0),i&&ji<1&&Wu.forEach(function(d){var f=r.current[d];c&&(c[d]=f)}),u&&ju()&&(u.removeEventListener("touchmove",Yu,pi),l&&(l.removeEventListener("touchstart",Gu,pi),l.removeEventListener("touchmove",Xu,pi)))}},[i]);return g.useEffect(function(){if(t){var l=o.current;return a(l),function(){s(l)}}},[t,a,s]),function(l){o.current=l}}var Ww=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Uw={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Yw(e){var t=e.children,n=e.lockEnabled,i=e.captureEnabled,r=i===void 0?!0:i,o=e.onBottomArrive,a=e.onBottomLeave,s=e.onTopArrive,l=e.onTopLeave,u=Nw({isEnabled:r,onBottomArrive:o,onBottomLeave:a,onTopArrive:s,onTopLeave:l}),c=Bw({isEnabled:n}),d=function(h){u(h),c(h)};return Ne(g.Fragment,null,n&&Ne("div",{onClick:Ww,css:Uw}),t(d))}var Xw={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Gw=function(t){var n=t.name,i=t.onFocus;return Ne("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:i,css:Xw,value:"",onChange:function(){}})},jw=Gw;function gl(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function qw(){return gl(/^iPhone/i)}function Ud(){return gl(/^Mac/i)}function Kw(){return gl(/^iPad/i)||Ud()&&navigator.maxTouchPoints>1}function Zw(){return qw()||Kw()}function Jw(){return Ud()||Zw()}var Qw=function(t){return t.label},ey=function(t){return t.label},ty=function(t){return t.value},ny=function(t){return!!t.isDisabled},ry={clearIndicator:Vb,container:Tb,control:Gb,dropdownIndicator:zb,group:Zb,groupHeading:Qb,indicatorsContainer:_b,indicatorSeparator:Bb,input:rw,loadingIndicator:Yb,loadingMessage:kb,menu:vb,menuList:Cb,menuPortal:Eb,multiValue:lw,multiValueLabel:uw,multiValueRemove:cw,noOptionsMessage:xb,option:pw,placeholder:ww,singleValue:Sw,valueContainer:Ob},iy={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},oy=4,Yd=4,ay=38,sy=Yd*2,ly={baseUnit:Yd,controlHeight:ay,menuGutter:sy},vs={borderRadius:oy,colors:iy,spacing:ly},uy={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:zu(),captureMenuScroll:!zu(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Hw(),formatGroupLabel:Qw,getOptionLabel:ey,getOptionValue:ty,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:ny,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!sb(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Ku(e,t,n,i){var r=jd(e,t,n),o=qd(e,t,n),a=Gd(e,t),s=Ma(e,t);return{type:"option",data:t,isDisabled:r,isSelected:o,label:a,value:s,index:i}}function oa(e,t){return e.options.map(function(n,i){if("options"in n){var r=n.options.map(function(a,s){return Ku(e,a,t,s)}).filter(function(a){return Ju(e,a)});return r.length>0?{type:"group",data:n,options:r,index:i}:void 0}var o=Ku(e,n,t,i);return Ju(e,o)?o:void 0}).filter(cb)}function Xd(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,zs(n.options.map(function(i){return i.data}))):t.push(n.data),t},[])}function Zu(e,t){return e.reduce(function(n,i){return i.type==="group"?n.push.apply(n,zs(i.options.map(function(r){return{data:r.data,id:"".concat(t,"-").concat(i.index,"-").concat(r.index)}}))):n.push({data:i.data,id:"".concat(t,"-").concat(i.index)}),n},[])}function cy(e,t){return Xd(oa(e,t))}function Ju(e,t){var n=e.inputValue,i=n===void 0?"":n,r=t.data,o=t.isSelected,a=t.label,s=t.value;return(!Zd(e)||!o)&&Kd(e,{label:a,value:s,data:r},i)}function dy(e,t){var n=e.focusedValue,i=e.selectValue,r=i.indexOf(n);if(r>-1){var o=t.indexOf(n);if(o>-1)return n;if(r<t.length)return t[r]}return null}function fy(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var bs=function(t,n){var i,r=(i=t.find(function(o){return o.data===n}))===null||i===void 0?void 0:i.id;return r||null},Gd=function(t,n){return t.getOptionLabel(n)},Ma=function(t,n){return t.getOptionValue(n)};function jd(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function qd(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var i=Ma(e,t);return n.some(function(r){return Ma(e,r)===i})}function Kd(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Zd=function(t){var n=t.hideSelectedOptions,i=t.isMulti;return n===void 0?i:n},hy=1,Jd=function(e){hh(n,e);var t=ph(n);function n(i){var r;if(gh(this,n),r=t.call(this,i),r.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.isAppleDevice=Jw(),r.controlRef=null,r.getControlRef=function(l){r.controlRef=l},r.focusedOptionRef=null,r.getFocusedOptionRef=function(l){r.focusedOptionRef=l},r.menuListRef=null,r.getMenuListRef=function(l){r.menuListRef=l},r.inputRef=null,r.getInputRef=function(l){r.inputRef=l},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(l,u){var c=r.props,d=c.onChange,f=c.name;u.name=f,r.ariaOnChange(l,u),d(l,u)},r.setValue=function(l,u,c){var d=r.props,f=d.closeMenuOnSelect,h=d.isMulti,m=d.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:m}),f&&(r.setState({inputIsHiddenAfterUpdate:!h}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(l,{action:u,option:c})},r.selectOption=function(l){var u=r.props,c=u.blurInputOnSelect,d=u.isMulti,f=u.name,h=r.state.selectValue,m=d&&r.isOptionSelected(l,h),p=r.isOptionDisabled(l,h);if(m){var b=r.getOptionValue(l);r.setValue(h.filter(function(w){return r.getOptionValue(w)!==b}),"deselect-option",l)}else if(!p)d?r.setValue([].concat(zs(h),[l]),"select-option",l):r.setValue(l,"select-option");else{r.ariaOnChange(l,{action:"select-option",option:l,name:f});return}c&&r.blurInput()},r.removeValue=function(l){var u=r.props.isMulti,c=r.state.selectValue,d=r.getOptionValue(l),f=c.filter(function(m){return r.getOptionValue(m)!==d}),h=ea(u,f,f[0]||null);r.onChange(h,{action:"remove-value",removedValue:l}),r.focusInput()},r.clearValue=function(){var l=r.state.selectValue;r.onChange(ea(r.props.isMulti,[],null),{action:"clear",removedValues:l})},r.popValue=function(){var l=r.props.isMulti,u=r.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),f=ea(l,d,d[0]||null);c&&r.onChange(f,{action:"pop-value",removedValue:c})},r.getFocusedOptionId=function(l){return bs(r.state.focusableOptionsWithIds,l)},r.getFocusableOptionsWithIds=function(){return Zu(oa(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return nb.apply(void 0,[r.props.classNamePrefix].concat(u))},r.getOptionLabel=function(l){return Gd(r.props,l)},r.getOptionValue=function(l){return Ma(r.props,l)},r.getStyles=function(l,u){var c=r.props.unstyled,d=ry[l](u,c);d.boxSizing="border-box";var f=r.props.styles[l];return f?f(d,u):d},r.getClassNames=function(l,u){var c,d;return(c=(d=r.props.classNames)[l])===null||c===void 0?void 0:c.call(d,u)},r.getElementId=function(l){return"".concat(r.state.instancePrefix,"-").concat(l)},r.getComponents=function(){return Mw(r.props)},r.buildCategorizedOptions=function(){return oa(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return Xd(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(l,u){r.setState({ariaSelection:Ye({value:l},u)})},r.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(l){r.blockOptionHover=!1},r.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&r.onMenuClose():u&&r.openMenu("first"):(u&&(r.openAfterFocus=!0),r.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},r.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!r.props.isDisabled){var u=r.props,c=u.isMulti,d=u.menuIsOpen;r.focusInput(),d?(r.setState({inputIsHiddenAfterUpdate:!c}),r.onMenuClose()):r.openMenu("first"),l.preventDefault()}},r.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(r.clearValue(),l.preventDefault(),r.openAfterFocus=!1,l.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(l){typeof r.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&_a(l.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(l)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(r.initialTouchX=c.clientX,r.initialTouchY=c.clientY,r.userIsDragging=!1)},r.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var d=Math.abs(c.clientX-r.initialTouchX),f=Math.abs(c.clientY-r.initialTouchY),h=5;r.userIsDragging=d>h||f>h}},r.onTouchEnd=function(l){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(l.target)&&r.menuListRef&&!r.menuListRef.contains(l.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(l){r.userIsDragging||r.onControlMouseDown(l)},r.onClearIndicatorTouchEnd=function(l){r.userIsDragging||r.onClearIndicatorMouseDown(l)},r.onDropdownIndicatorTouchEnd=function(l){r.userIsDragging||r.onDropdownIndicatorMouseDown(l)},r.handleInputChange=function(l){var u=r.props.inputValue,c=l.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(c,{action:"input-change",prevInputValue:u}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(l){r.props.onFocus&&r.props.onFocus(l),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(l){var u=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(l),r.onInputChange("",{action:"input-blur",prevInputValue:u}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(l){if(!(r.blockOptionHover||r.state.focusedOption===l)){var u=r.getFocusableOptions(),c=u.indexOf(l);r.setState({focusedOption:l,focusedOptionId:c>-1?r.getFocusedOptionId(l):null})}},r.shouldHideSelectedOptions=function(){return Zd(r.props)},r.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),r.focus()},r.onKeyDown=function(l){var u=r.props,c=u.isMulti,d=u.backspaceRemovesValue,f=u.escapeClearsValue,h=u.inputValue,m=u.isClearable,p=u.isDisabled,b=u.menuIsOpen,w=u.onKeyDown,y=u.tabSelectsValue,S=u.openMenuOnFocus,M=r.state,C=M.focusedOption,x=M.focusedValue,R=M.selectValue;if(!p&&!(typeof w=="function"&&(w(l),l.defaultPrevented))){switch(r.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||h)return;r.focusValue("previous");break;case"ArrowRight":if(!c||h)return;r.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(x)r.removeValue(x);else{if(!d)return;c?r.popValue():m&&r.clearValue()}break;case"Tab":if(r.isComposing||l.shiftKey||!b||!y||!C||S&&r.isOptionSelected(C,R))return;r.selectOption(C);break;case"Enter":if(l.keyCode===229)break;if(b){if(!C||r.isComposing)return;r.selectOption(C);break}return;case"Escape":b?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:h}),r.onMenuClose()):m&&f&&r.clearValue();break;case" ":if(h)return;if(!b){r.openMenu("first");break}if(!C)return;r.selectOption(C);break;case"ArrowUp":b?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":b?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!b)return;r.focusOption("pageup");break;case"PageDown":if(!b)return;r.focusOption("pagedown");break;case"Home":if(!b)return;r.focusOption("first");break;case"End":if(!b)return;r.focusOption("last");break;default:return}l.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++hy),r.state.selectValue=Au(i.value),i.menuIsOpen&&r.state.selectValue.length){var o=r.getFocusableOptionsWithIds(),a=r.buildFocusableOptions(),s=a.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=o,r.state.focusedOption=a[s],r.state.focusedOptionId=bs(o,a[s])}return r}return mh(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Hu(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var o=this.props,a=o.isDisabled,s=o.menuIsOpen,l=this.state.isFocused;(l&&!a&&r.isDisabled||l&&s&&!r.menuIsOpen)&&this.focusInput(),l&&a&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!a&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Hu(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,o){this.props.onInputChange(r,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var o=this,a=this.state,s=a.selectValue,l=a.isFocused,u=this.buildFocusableOptions(),c=r==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(s[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,a=o.selectValue,s=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=a.indexOf(s);s||(l=-1);var u=a.length-1,c=-1;if(a.length){switch(r){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l<u&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:a[c]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,a=this.state.focusedOption,s=this.getFocusableOptions();if(s.length){var l=0,u=s.indexOf(a);a||(u=-1),r==="up"?l=u>0?u-1:s.length-1:r==="down"?l=(u+1)%s.length:r==="pageup"?(l=u-o,l<0&&(l=0)):r==="pagedown"?(l=u+o,l>s.length-1&&(l=s.length-1)):r==="last"&&(l=s.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:s[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(s[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(vs):Ye(Ye({},vs),this.props.theme):vs}},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,a=this.getStyles,s=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,f=d.isMulti,h=d.isRtl,m=d.options,p=this.hasValue();return{clearValue:r,cx:o,getStyles:a,getClassNames:s,getValue:l,hasValue:p,isMulti:f,isRtl:h,options:m,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,o=r.isClearable,a=r.isMulti;return o===void 0?a:o}},{key:"isOptionDisabled",value:function(r,o){return jd(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return qd(this.props,r,o)}},{key:"filterOption",value:function(r,o){return Kd(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,s=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:a,selectValue:s})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var r=this.props,o=r.isDisabled,a=r.isSearchable,s=r.inputId,l=r.inputValue,u=r.tabIndex,c=r.form,d=r.menuIsOpen,f=r.required,h=this.getComponents(),m=h.Input,p=this.state,b=p.inputIsHidden,w=p.ariaSelection,y=this.commonProps,S=s||this.getElementId("input"),M=Ye(Ye(Ye({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?(w==null?void 0:w.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?g.createElement(m,et({},y,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:S,innerRef:this.getInputRef,isDisabled:o,isHidden:b,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},M)):g.createElement($w,et({id:S,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:xa,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},M))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),a=o.MultiValue,s=o.MultiValueContainer,l=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,f=this.commonProps,h=this.props,m=h.controlShouldRenderValue,p=h.isDisabled,b=h.isMulti,w=h.inputValue,y=h.placeholder,S=this.state,M=S.selectValue,C=S.focusedValue,x=S.isFocused;if(!this.hasValue()||!m)return w?null:g.createElement(d,et({},f,{key:"placeholder",isDisabled:p,isFocused:x,innerProps:{id:this.getElementId("placeholder")}}),y);if(b)return M.map(function(I,E){var H=I===C,z="".concat(r.getOptionLabel(I),"-").concat(r.getOptionValue(I));return g.createElement(a,et({},f,{components:{Container:s,Label:l,Remove:u},isFocused:H,isDisabled:p,key:z,index:E,removeProps:{onClick:function(){return r.removeValue(I)},onTouchEnd:function(){return r.removeValue(I)},onMouseDown:function(_){_.preventDefault()}},data:I}),r.formatOptionLabel(I,"value"))});if(w)return null;var R=M[0];return g.createElement(c,et({},f,{data:R,isDisabled:p}),this.formatOptionLabel(R,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,a=this.commonProps,s=this.props,l=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return g.createElement(o,et({},a,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,a=this.commonProps,s=this.props,l=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return g.createElement(o,et({},a,{innerProps:d,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,a=r.IndicatorSeparator;if(!o||!a)return null;var s=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return g.createElement(a,et({},s,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var a=this.commonProps,s=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return g.createElement(o,et({},a,{innerProps:u,isDisabled:s,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),a=o.Group,s=o.GroupHeading,l=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,f=o.NoOptionsMessage,h=o.Option,m=this.commonProps,p=this.state.focusedOption,b=this.props,w=b.captureMenuScroll,y=b.inputValue,S=b.isLoading,M=b.loadingMessage,C=b.minMenuHeight,x=b.maxMenuHeight,R=b.menuIsOpen,I=b.menuPlacement,E=b.menuPosition,H=b.menuPortalTarget,z=b.menuShouldBlockScroll,L=b.menuShouldScrollIntoView,_=b.noOptionsMessage,O=b.onMenuScrollToTop,ne=b.onMenuScrollToBottom;if(!R)return null;var q=function(ie,ge){var fe=ie.type,G=ie.data,P=ie.isDisabled,k=ie.isSelected,$=ie.label,le=ie.value,Te=p===G,Be=P?void 0:function(){return r.onOptionHover(G)},ce=P?void 0:function(){return r.selectOption(G)},nt="".concat(r.getElementId("option"),"-").concat(ge),ke={id:nt,onClick:ce,onMouseMove:Be,onMouseOver:Be,tabIndex:-1,role:"option","aria-selected":r.isAppleDevice?void 0:k};return g.createElement(h,et({},m,{innerProps:ke,data:G,isDisabled:P,isSelected:k,key:nt,label:$,type:fe,value:le,isFocused:Te,innerRef:Te?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(ie.data,"menu"))},oe;if(this.hasOptions())oe=this.getCategorizedOptions().map(function(ee){if(ee.type==="group"){var ie=ee.data,ge=ee.options,fe=ee.index,G="".concat(r.getElementId("group"),"-").concat(fe),P="".concat(G,"-heading");return g.createElement(a,et({},m,{key:G,data:ie,options:ge,Heading:s,headingProps:{id:P,data:ee.data},label:r.formatGroupLabel(ee.data)}),ee.options.map(function(k){return q(k,"".concat(fe,"-").concat(k.index))}))}else if(ee.type==="option")return q(ee,"".concat(ee.index))});else if(S){var Se=M({inputValue:y});if(Se===null)return null;oe=g.createElement(d,m,Se)}else{var xe=_({inputValue:y});if(xe===null)return null;oe=g.createElement(f,m,xe)}var re={minMenuHeight:C,maxMenuHeight:x,menuPlacement:I,menuPosition:E,menuShouldScrollIntoView:L},J=g.createElement(bb,et({},m,re),function(ee){var ie=ee.ref,ge=ee.placerProps,fe=ge.placement,G=ge.maxHeight;return g.createElement(l,et({},m,re,{innerRef:ie,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:S,placement:fe}),g.createElement(Yw,{captureEnabled:w,onTopArrive:O,onBottomArrive:ne,lockEnabled:z},function(P){return g.createElement(u,et({},m,{innerRef:function($){r.getMenuListRef($),P($)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:r.getElementId("listbox")},isLoading:S,maxHeight:G,focusedOption:p}),oe)}))});return H||E==="fixed"?g.createElement(c,et({},m,{appendTo:H,controlElement:this.controlRef,menuPlacement:I,menuPosition:E}),J):J}},{key:"renderFormField",value:function(){var r=this,o=this.props,a=o.delimiter,s=o.isDisabled,l=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!s)return g.createElement(jw,{name:u,onFocus:this.onValueInputFocus});if(!(!u||s))if(l)if(a){var f=d.map(function(p){return r.getOptionValue(p)}).join(a);return g.createElement("input",{name:u,type:"hidden",value:f})}else{var h=d.length>0?d.map(function(p,b){return g.createElement("input",{key:"i-".concat(b),name:u,type:"hidden",value:r.getOptionValue(p)})}):g.createElement("input",{name:u,type:"hidden",value:""});return g.createElement("div",null,h)}else{var m=d[0]?this.getOptionValue(d[0]):"";return g.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,a=o.ariaSelection,s=o.focusedOption,l=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return g.createElement(_w,et({},r,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:s,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,a=r.IndicatorsContainer,s=r.SelectContainer,l=r.ValueContainer,u=this.props,c=u.className,d=u.id,f=u.isDisabled,h=u.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return g.createElement(s,et({},p,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:m}),this.renderLiveRegion(),g.createElement(o,et({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:m,menuIsOpen:h}),g.createElement(l,et({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),g.createElement(a,et({},p,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var a=o.prevProps,s=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,f=o.instancePrefix,h=r.options,m=r.value,p=r.menuIsOpen,b=r.inputValue,w=r.isMulti,y=Au(m),S={};if(a&&(m!==a.value||h!==a.options||p!==a.menuIsOpen||b!==a.inputValue)){var M=p?cy(r,y):[],C=p?Zu(oa(r,y),"".concat(f,"-option")):[],x=s?dy(o,y):null,R=fy(o,M),I=bs(C,R);S={selectValue:y,focusedOption:R,focusedOptionId:I,focusableOptionsWithIds:C,focusedValue:x,clearFocusValueOnUpdate:!1}}var E=l!=null&&r!==a?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},H=u,z=c&&d;return c&&!z&&(H={value:ea(w,y,y[0]||null),options:y,action:"initial-input-focus"},z=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(H=null),Ye(Ye(Ye({},S),E),{},{prevProps:r,ariaSelection:H,prevWasFocused:z})}}]),n}(g.Component);Jd.defaultProps=uy;var gy=g.forwardRef(function(e,t){var n=$1(e);return g.createElement(Jd,et({ref:t},n))}),my=gy;const py=e=>{const{Menu:t}=Nd,{children:n,...i}=e;return g.createElement(t,{...i},n)},vy=hn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),by=hn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),wy=hn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),yy=e=>{const{value:t,onFinishedEditing:n,initialValue:i}=e,{allowedValues:r,value:o}=t.data,[a,s]=g.useState(o),[l,u]=g.useState(i??""),c=Am(),d=g.useMemo(()=>r.map(f=>typeof f=="string"||f===null||f===void 0?{value:f,label:(f==null?void 0:f.toString())??""}:f),[r]);return t.readonly?g.createElement(wy,null,g.createElement(Ei,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):g.createElement(vy,null,g.createElement(my,{className:"glide-select",inputValue:l,onInputChange:u,menuPlacement:"auto",value:d.find(f=>f.value===a),styles:{control:f=>({...f,border:0,boxShadow:"none"}),option:(f,{isFocused:h})=>({...f,fontSize:c.editorFontSize,fontFamily:c.fontFamily,cursor:h?"pointer":void 0,paddingLeft:c.cellHorizontalPadding,paddingRight:c.cellHorizontalPadding,":active":{...f[":active"],color:c.accentFg},":empty::after":{content:'"&nbsp;"',visibility:"hidden"}})},theme:f=>({...f,colors:{...f.colors,neutral0:c.bgCell,neutral5:c.bgCell,neutral10:c.bgCell,neutral20:c.bgCellMedium,neutral30:c.bgCellMedium,neutral40:c.bgCellMedium,neutral50:c.textLight,neutral60:c.textMedium,neutral70:c.textMedium,neutral80:c.textDark,neutral90:c.textDark,neutral100:c.textDark,primary:c.accentColor,primary75:c.accentColor,primary50:c.accentColor,primary25:c.accentLight}}),menuPortalTarget:document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:f=>g.createElement(by,null,g.createElement(py,{className:"click-outside-ignore",...f}))},options:d,onChange:async f=>{f!==null&&(s(f.value),await new Promise(h=>window.requestAnimationFrame(h)),n({...t,data:{...t.data,value:f.value}}))}}))},Cy={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:i,rect:r}=e,{value:o}=t.data,a=t.data.allowedValues.find(l=>typeof l=="string"||l===null||l===void 0?l===o:l.value===o),s=typeof a=="string"?a:(a==null?void 0:a.label)??"";return s&&(n.fillStyle=i.textDark,n.fillText(s,r.x+i.cellHorizontalPadding,r.y+r.height/2+mr(n,i))),!0},measure:(e,t,n)=>{const{value:i}=t.data;return(i?e.measureText(i).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:yy,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.includes(e)?e:t.value})},Kr=6,Sy={marginRight:8},xy={display:"flex",alignItems:"center",flexGrow:1},ky={kind:Z.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:i,rect:r}=e,{min:o,max:a,value:s,label:l,measureLabel:u}=t.data,c=r.x+i.cellHorizontalPadding,d=r.y+r.height/2,f=a-o,h=(s-o)/f;n.save();let m=0;l!==void 0&&(n.font=`12px ${i.fontFamily}`,m=ii(u??l,n,`12px ${i.fontFamily}`).width+i.cellHorizontalPadding);const p=r.width-i.cellHorizontalPadding*2-m;if(p>=Kr){const b=n.createLinearGradient(c,d,c+p,d);b.addColorStop(0,i.accentColor),b.addColorStop(h,i.accentColor),b.addColorStop(h,i.bgBubble),b.addColorStop(1,i.bgBubble),n.beginPath(),n.fillStyle=b,Ou(n,c,d-Kr/2,p,Kr,Kr/2),n.fill(),n.beginPath(),Ou(n,c+.5,d-Kr/2+.5,p-1,Kr-1,(Kr-1)/2),n.strokeStyle=i.accentLight,n.lineWidth=1,n.stroke()}return l!==void 0&&(n.textAlign="right",n.fillStyle=i.textDark,n.fillText(l,r.x+r.width-i.cellHorizontalPadding,d+mr(n,`12px ${i.fontFamily}`))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,i=t.value.toString(),r=t.min.toString(),o=t.max.toString(),a=t.step.toString(),s=l=>{e.onChange({...e.value,data:{...t,value:Number(l.target.value)}})};return g.createElement("label",{style:xy},g.createElement("input",{style:Sy,type:"range",value:i,min:r,max:o,step:a,onChange:s,disabled:n}),i)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},My=hn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),ws=(e,t)=>{if(t==null)return"";const n=t.toISOString();switch(e){case"date":return n.split("T")[0];case"datetime-local":return n.replace("Z","");case"time":return n.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},Ry=e=>{const t=e.value.data,{format:n,displayDate:i}=t,r=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.min instanceof Date?ws(n,t.min):t.min,a=t.max instanceof Date?ws(n,t.max):t.max;let s=t.date;const l=t.timezoneOffset?t.timezoneOffset*60*1e3:0;l&&s&&(s=new Date(s.getTime()+l));const u=ws(n,s);return e.value.readonly?ae.createElement(Ei,{highlight:!0,autoFocus:!1,disabled:!0,value:i??"",onChange:()=>{}}):ae.createElement(My,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:u,min:o,max:a,step:r,autoFocus:!0,onChange:c=>{isNaN(c.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(c.target.valueAsNumber-l)}})}})},Ey={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Nc(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:i}=t.data;return e.measureText(i).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Ry}),onPaste:(e,t)=>{let n=NaN;return e&&(n=Number(e).valueOf(),Number.isNaN(n)&&(n=Date.parse(e),t.format==="time"&&Number.isNaN(n)&&(n=Date.parse(`1970-01-01T${e}Z`)))),{...t,date:Number.isNaN(n)?void 0:new Date(n)}}},Iy="None";function Qu(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-8,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+8),e.fillStyle=n.accentColor,e.fill(),e.restore()}const Ty=e=>{const{cell:t,theme:n,ctx:i}=e;Nc({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`},spriteManager:{},hyperWrapping:!1},Iy,t.contentAlign),i.fillStyle=n.textDark};function Dy(e){const t=ae.useCallback((i,r)=>{const{cell:o,theme:a,ctx:s,rect:l}=i,u=i.col;if(Si(o))Qu(s,l,a);else if(Oa(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?r():Ty(i),c.isRequired&&c.isEditable&&Qu(s,l,a);return}r()},[e]),n=ae.useMemo(()=>[H1,Cy,ky,Ey,...d1],[]);return{drawCell:t,customRenderers:n}}const Qd=",",Ji='"',Oy='"',ef=`
197
- `,Py="\uFEFF",_y=new RegExp(`[${[Qd,Ji,ef].join("")}]`);function ec(e){return e.map(t=>Ly(t)).join(Qd)+ef}function Ly(e){if(Ze(e))return"";const t=Rt(e);return _y.test(t)?`${Ji}${t.replace(new RegExp(Ji,"g"),Oy+Ji)}${Ji}`:t}async function tc(e,t,n,i){const r=new TextEncoder;await e.write(r.encode(Py));const o=n.map(a=>a.name);await e.write(r.encode(ec(o)));for(let a=0;a<i;a++){const s=[];n.forEach((l,u,c)=>{s.push(l.getCellValue(t([u,a])))}),await e.write(r.encode(ec(s)))}await e.close()}function Fy(e,t,n,i){return{exportToCsv:ae.useCallback(async()=>{const a=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await As(()=>import("./es6.DoVDVSd_.js").then(c=>c.a),__vite__mapDeps([13,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:a,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await tc(u,e,t,n)}catch(s){if(s instanceof Error&&s.name==="AbortError")return;try{fc("Failed to export data as CSV with FileSystem API, trying fallback method",s);let l="";const u=new WritableStream({write:async h=>{l+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await tc(u.getWriter(),e,t,n);const c=new Blob([l],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),f=dh({enforceDownloadInNewTab:i,url:d,filename:a});f.style.display="none",document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(d)}catch(l){dc("Failed to export data as CSV",l)}}},[t,n,e,i])}}function Ay(e,t,n,i,r){const[o,a]=ae.useState({columns:yt.empty(),rows:yt.empty(),current:void 0}),s=!t&&!n&&(e.selectionMode.includes(Un.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Un.SelectionMode.SINGLE_ROW)),l=s&&e.selectionMode.includes(Un.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(Un.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Un.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(Un.SelectionMode.MULTI_COLUMN),d=o.rows.length>0,f=o.columns.length>0,h=o.current!==void 0,m=ae.useCallback(b=>{const w=!ts(b.rows.toArray(),o.rows.toArray()),y=!ts(b.columns.toArray(),o.columns.toArray()),S=!ts(b.current,o.current);let M=s&&w||u&&y,C=b;if((s||u)&&b.current!==void 0&&S&&(C={...b,rows:o.rows,columns:o.columns},M=!1),w&&b.rows.length>0&&y&&b.columns.length===0&&(C={...C,columns:o.columns},M=!0),y&&b.columns.length>0&&w&&b.rows.length===0&&(C={...C,rows:o.rows},M=!0),y&&C.columns.length>=0){let x=C.columns;i.forEach((R,I)=>{R.isIndex&&(x=x.remove(I))}),x.length<C.columns.length&&(C={...C,columns:x})}a(C),M&&r(C)},[o,s,u,r,i]),p=ae.useCallback((b=!1,w=!1)=>{const y={columns:w?o.columns:yt.empty(),rows:b?o.rows:yt.empty(),current:void 0};a(y),(!b&&s||!w&&u)&&r(y)},[o,s,u,r]);return{gridSelection:o,isRowSelectionActivated:s,isMultiRowSelectionActivated:l,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isRowSelected:d,isColumnSelected:f,isCellSelected:h,clearSelection:p,processSelectionChange:m}}function Hy({top:e,left:t,content:n,clearTooltip:i}){const[r,o]=ae.useState(!0),a=Hs(),{colors:s,fontSizes:l,radii:u,fontWeights:c}=a,d=ae.useCallback(()=>{o(!1),i()},[i,o]);return xn(nh,{content:xn(Zf,{"data-testid":"stDataFrameTooltipContent",children:xn(Jf,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:Qf.top,accessibilityType:eh.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:d,onEsc:d,overrides:{Body:{style:{borderTopLeftRadius:u.default,borderTopRightRadius:u.default,borderBottomLeftRadius:u.default,borderBottomRightRadius:u.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:th(a)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:l.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:r,children:xn("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const nc=cc("div",{target:"egqaslz0"})(({hasCustomizedScrollbars:e,theme:t})=>({position:"relative",display:"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:t.radii.default},"& .dvn-scroller":{...!e&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"}})),rc=150,zy=15e4,ta=6;function $y({element:e,data:t,disabled:n,widgetMgr:i,disableFullscreenMode:r,fragmentId:o}){const{expanded:a,expand:s,collapse:l,width:u,height:c}=sh(lh),d=ae.useRef(null),f=ae.useRef(null),h=ae.useRef(null),m=x1(),{libConfig:{enforceDownloadInNewTab:p=!1}}=ae.useContext(rh),[b,w]=ae.useState(!0),[y,S]=ae.useState(!1),[M,C]=ae.useState(!1),[x,R]=ae.useState(!1),I=ae.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),E=ae.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Ze(e.editingMode)&&(e.editingMode=Un.EditingMode.READ_ONLY);const{READ_ONLY:H,DYNAMIC:z}=Un.EditingMode,L=t.dimensions,_=Math.max(0,L.dataRows),O=_===0&&!(e.editingMode===z&&L.dataColumns>0),ne=_>zy,q=ae.useRef(new Ko(_)),[oe,Se]=ae.useState(q.current.getNumRows());ae.useEffect(()=>{q.current=new Ko(_),Se(q.current.getNumRows())},[_]);const xe=ae.useCallback(()=>{q.current=new Ko(_),Se(q.current.getNumRows())},[_]),{columns:re}=S1(e,t,n);ae.useEffect(()=>{if(e.editingMode===H)return;const De=i.getStringValue({id:e.id,formId:e.formId});De&&(q.current.fromJson(De,re),Se(q.current.getNumRows()))},[]);const{getCellContent:J}=k1(t,re,oe,q),{columns:ee,sortColumn:ie,getOriginalIndex:ge,getCellContent:fe}=_1(_,re,J),G=ae.useCallback(De=>{const lt={selection:{rows:[],columns:[]}};lt.selection.rows=De.rows.toArray().map(vt=>ge(vt)),lt.selection.columns=De.columns.toArray().map(vt=>oo(ee[vt]));const ze=JSON.stringify(lt),Lt=i.getStringValue({id:e.id,formId:e.formId});(Lt===void 0||Lt!==ze)&&i.setStringValue({id:e.id,formId:e.formId},ze,{fromUi:!0},o)},[ee,e.id,e.formId,i,o,ge]),{debouncedCallback:P}=Su(G,rc),{gridSelection:k,isRowSelectionActivated:$,isMultiRowSelectionActivated:le,isColumnSelectionActivated:Te,isMultiColumnSelectionActivated:Be,isRowSelected:ce,isColumnSelected:nt,isCellSelected:ke,clearSelection:bt,processSelectionChange:Et}=Ay(e,O,n,ee,P);ae.useEffect(()=>{bt(!0,!0)},[a]);const at=ae.useCallback(De=>{var lt;(lt=f.current)==null||lt.updateCells(De)},[]);ae.useEffect(()=>{var lt,ze,Lt,vt;if(!$&&!Te)return;const De=i.getStringValue({id:e.id,formId:e.formId});if(De){const on=ee.map(Pt=>oo(Pt)),Tt=JSON.parse(De);let Ft=yt.empty(),Ve=yt.empty();(ze=(lt=Tt.selection)==null?void 0:lt.rows)==null||ze.forEach(Pt=>{Ft=Ft.add(Pt)}),(vt=(Lt=Tt.selection)==null?void 0:Lt.columns)==null||vt.forEach(Pt=>{Ve=Ve.add(on.indexOf(Pt))}),(Ft.length>0||Ve.length>0)&&Et({rows:Ft,columns:Ve,current:void 0})}},[]);const te=ae.useCallback(()=>{oe!==q.current.getNumRows()&&Se(q.current.getNumRows())},[oe]),it=ae.useCallback(()=>{const De=q.current.toJson(ee);let lt=i.getStringValue({id:e.id,formId:e.formId});lt===void 0&&(lt=new Ko(0).toJson([])),De!==lt&&i.setStringValue({id:e.id,formId:e.formId},De,{fromUi:!0},o)},[ee,e.id,e.formId,i,o]),{debouncedCallback:me}=Su(it,rc),{exportToCsv:se}=Fy(fe,ee,oe,p),{onCellEdited:he,onPaste:$e,onRowAppended:Le,onDelete:Je,validateCell:de}=R1(ee,e.editingMode!==z,q,fe,ge,at,te,me,bt),{tooltip:be,clearTooltip:Ge,onItemHovered:Ae}=A1(ee,fe),{drawCell:tt,customRenderers:wt}=Dy(ee),gt=ae.useMemo(()=>ee.map(De=>Os(De)),[ee]),{columns:He,onColumnResize:_t}=E1(gt),Xt=t.columns.length>1,{minHeight:Ot,maxHeight:Ht,minWidth:rn,maxWidth:zt,rowHeight:gn,resizableSize:$t,setResizableSize:It}=M1(e,m,oe,Xt,u,c,a),In=ae.useCallback(([De,lt])=>({...r1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(ee.length-1,0)]}),[ee,m.glideTheme.textLight]),bn=ae.useCallback(()=>{xe(),bt()},[xe,bt]);oh({element:e,widgetMgr:i,onFormCleared:bn});const Oe=!O&&e.editingMode===z&&!n,Vt=g.useMemo(()=>ee.filter(De=>De.isPinned).reduce((De,lt)=>De+(lt.width??m.minColumnWidth*2),0)>u*.6,[ee,u,m.minColumnWidth]),dn=O||Vt?0:ee.filter(De=>De.isPinned).length;return ae.useEffect(()=>{setTimeout(()=>{var De,lt;if(h.current&&f.current){const ze=(lt=(De=h.current)==null?void 0:De.querySelector(".dvn-stack"))==null?void 0:lt.getBoundingClientRect();ze&&(C(ze.height>h.current.clientHeight),R(ze.width>h.current.clientWidth))}},1)},[$t,oe,He]),Fl(nc,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:E,ref:h,onMouseDown:De=>{if(h.current&&E){const lt=h.current.getBoundingClientRect();x&&lt.height-(ta+1)<De.clientY-lt.top&&De.stopPropagation(),M&&lt.width-(ta+1)<De.clientX-lt.left&&De.stopPropagation()}},onBlur:De=>{!b&&!I&&!De.currentTarget.contains(De.relatedTarget)&&bt(!0,!0)},children:[Fl(uh,{isFullScreen:a,disableFullscreenMode:r,locked:ce&&!$||ke||I&&b,onExpand:s,onCollapse:l,target:nc,children:[($&&ce||Te&&nt)&&xn(Wi,{label:"Clear selection",icon:fh,onClick:()=>{bt(),Ge()}}),Oe&&ce&&xn(Wi,{label:"Delete row(s)",icon:vh,onClick:()=>{Je&&(Je(k),Ge())}}),Oe&&!ce&&xn(Wi,{label:"Add row",icon:gc,onClick:()=>{Le&&(w(!0),Le(),Ge())}}),!ne&&!O&&xn(Wi,{label:"Download as CSV",icon:bh,onClick:()=>se()}),!O&&xn(Wi,{label:"Search",icon:mc,onClick:()=>{y?S(!1):(w(!0),S(!0)),Ge()}})]}),xn(ih,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:$t,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:Ot,maxHeight:Ht,minWidth:rn,maxWidth:zt,size:$t,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,gn],snapGap:gn/3,onResizeStop:(De,lt,ze,Lt)=>{if(d.current){const vt=2*m.tableBorderWidth;It({width:d.current.size.width,height:Ht-d.current.size.height===vt?d.current.size.height+vt:d.current.size.height})}},children:xn(Jv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:f,columns:He,rows:O?1:oe,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:gn,headerHeight:m.defaultHeaderHeight,getCellContent:O?In:fe,onColumnResize:I?void 0:_t,resizeIndicator:"header",freezeColumns:dn,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:I?"cell":"rect",columnSelect:"none",rowSelect:"none",onItemHovered:Ae,keybindings:{downFill:!0},onKeyDown:De=>{(De.ctrlKey||De.metaKey)&&De.key==="f"&&(S(lt=>!lt),De.stopPropagation(),De.preventDefault())},showSearch:y,onSearchClose:()=>{S(!1),Ge()},onHeaderClicked:(De,lt)=>{O||ne||Te||($&&ce&&bt(),ie(De))},gridSelection:k,onGridSelectionChange:De=>{(b||I)&&(Et(De),be!==void 0&&Ge())},theme:m.glideTheme,onMouseMove:De=>{De.kind==="out-of-bounds"&&b?w(!1):De.kind!=="out-of-bounds"&&!b&&w(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...E&&{paddingBottom:x?-ta:void 0,paddingRight:M?-ta:void 0}},drawCell:tt,customRenderers:wt,imageEditorOverride:c1,headerIcons:m.headerIcons,validateCell:de,onPaste:!1,...$&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:le?"multi":"auto",rowSelect:n?"none":le?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...Te&&{columnSelect:n?"none":Be?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!O&&e.editingMode!==H&&!n&&{fillHandle:!I,onCellEdited:he,onPaste:$e,onDelete:Je},...!O&&e.editingMode===z&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:Le,onHeaderClicked:void 0}})}),be&&be.content&&xn(Hy,{top:be.top,left:be.left,content:be.content,clearTooltip:Ge})]})}const Vy=ah($y),Jy=Object.freeze(Object.defineProperty({__proto__:null,default:Vy},Symbol.toStringTag,{value:"Module"}));export{E0 as C,jc as T,wi as a,Th as b,Jy as c,vi as i,Fm as m,hn as s};
197
+ `,Py="\uFEFF",_y=new RegExp(`[${[Qd,Ji,ef].join("")}]`);function ec(e){return e.map(t=>Ly(t)).join(Qd)+ef}function Ly(e){if(Ze(e))return"";const t=Rt(e);return _y.test(t)?`${Ji}${t.replace(new RegExp(Ji,"g"),Oy+Ji)}${Ji}`:t}async function tc(e,t,n,i){const r=new TextEncoder;await e.write(r.encode(Py));const o=n.map(a=>a.name);await e.write(r.encode(ec(o)));for(let a=0;a<i;a++){const s=[];n.forEach((l,u,c)=>{s.push(l.getCellValue(t([u,a])))}),await e.write(r.encode(ec(s)))}await e.close()}function Fy(e,t,n,i){return{exportToCsv:ae.useCallback(async()=>{const a=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await As(()=>import("./es6.OcNPOAdx.js").then(c=>c.a),__vite__mapDeps([13,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:a,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await tc(u,e,t,n)}catch(s){if(s instanceof Error&&s.name==="AbortError")return;try{fc("Failed to export data as CSV with FileSystem API, trying fallback method",s);let l="";const u=new WritableStream({write:async h=>{l+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await tc(u.getWriter(),e,t,n);const c=new Blob([l],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),f=dh({enforceDownloadInNewTab:i,url:d,filename:a});f.style.display="none",document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(d)}catch(l){dc("Failed to export data as CSV",l)}}},[t,n,e,i])}}function Ay(e,t,n,i,r){const[o,a]=ae.useState({columns:yt.empty(),rows:yt.empty(),current:void 0}),s=!t&&!n&&(e.selectionMode.includes(Un.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Un.SelectionMode.SINGLE_ROW)),l=s&&e.selectionMode.includes(Un.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(Un.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Un.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(Un.SelectionMode.MULTI_COLUMN),d=o.rows.length>0,f=o.columns.length>0,h=o.current!==void 0,m=ae.useCallback(b=>{const w=!ts(b.rows.toArray(),o.rows.toArray()),y=!ts(b.columns.toArray(),o.columns.toArray()),S=!ts(b.current,o.current);let M=s&&w||u&&y,C=b;if((s||u)&&b.current!==void 0&&S&&(C={...b,rows:o.rows,columns:o.columns},M=!1),w&&b.rows.length>0&&y&&b.columns.length===0&&(C={...C,columns:o.columns},M=!0),y&&b.columns.length>0&&w&&b.rows.length===0&&(C={...C,rows:o.rows},M=!0),y&&C.columns.length>=0){let x=C.columns;i.forEach((R,I)=>{R.isIndex&&(x=x.remove(I))}),x.length<C.columns.length&&(C={...C,columns:x})}a(C),M&&r(C)},[o,s,u,r,i]),p=ae.useCallback((b=!1,w=!1)=>{const y={columns:w?o.columns:yt.empty(),rows:b?o.rows:yt.empty(),current:void 0};a(y),(!b&&s||!w&&u)&&r(y)},[o,s,u,r]);return{gridSelection:o,isRowSelectionActivated:s,isMultiRowSelectionActivated:l,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isRowSelected:d,isColumnSelected:f,isCellSelected:h,clearSelection:p,processSelectionChange:m}}function Hy({top:e,left:t,content:n,clearTooltip:i}){const[r,o]=ae.useState(!0),a=Hs(),{colors:s,fontSizes:l,radii:u,fontWeights:c}=a,d=ae.useCallback(()=>{o(!1),i()},[i,o]);return xn(nh,{content:xn(Zf,{"data-testid":"stDataFrameTooltipContent",children:xn(Jf,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:Qf.top,accessibilityType:eh.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:d,onEsc:d,overrides:{Body:{style:{borderTopLeftRadius:u.default,borderTopRightRadius:u.default,borderBottomLeftRadius:u.default,borderBottomRightRadius:u.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:th(a)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:l.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:r,children:xn("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const nc=cc("div",{target:"egqaslz0"})(({hasCustomizedScrollbars:e,theme:t})=>({position:"relative",display:"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:t.radii.default},"& .dvn-scroller":{...!e&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"}})),rc=150,zy=15e4,ta=6;function $y({element:e,data:t,disabled:n,widgetMgr:i,disableFullscreenMode:r,fragmentId:o}){const{expanded:a,expand:s,collapse:l,width:u,height:c}=sh(lh),d=ae.useRef(null),f=ae.useRef(null),h=ae.useRef(null),m=x1(),{libConfig:{enforceDownloadInNewTab:p=!1}}=ae.useContext(rh),[b,w]=ae.useState(!0),[y,S]=ae.useState(!1),[M,C]=ae.useState(!1),[x,R]=ae.useState(!1),I=ae.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),E=ae.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Ze(e.editingMode)&&(e.editingMode=Un.EditingMode.READ_ONLY);const{READ_ONLY:H,DYNAMIC:z}=Un.EditingMode,L=t.dimensions,_=Math.max(0,L.dataRows),O=_===0&&!(e.editingMode===z&&L.dataColumns>0),ne=_>zy,q=ae.useRef(new Ko(_)),[oe,Se]=ae.useState(q.current.getNumRows());ae.useEffect(()=>{q.current=new Ko(_),Se(q.current.getNumRows())},[_]);const xe=ae.useCallback(()=>{q.current=new Ko(_),Se(q.current.getNumRows())},[_]),{columns:re}=S1(e,t,n);ae.useEffect(()=>{if(e.editingMode===H)return;const De=i.getStringValue({id:e.id,formId:e.formId});De&&(q.current.fromJson(De,re),Se(q.current.getNumRows()))},[]);const{getCellContent:J}=k1(t,re,oe,q),{columns:ee,sortColumn:ie,getOriginalIndex:ge,getCellContent:fe}=_1(_,re,J),G=ae.useCallback(De=>{const lt={selection:{rows:[],columns:[]}};lt.selection.rows=De.rows.toArray().map(vt=>ge(vt)),lt.selection.columns=De.columns.toArray().map(vt=>oo(ee[vt]));const ze=JSON.stringify(lt),Lt=i.getStringValue({id:e.id,formId:e.formId});(Lt===void 0||Lt!==ze)&&i.setStringValue({id:e.id,formId:e.formId},ze,{fromUi:!0},o)},[ee,e.id,e.formId,i,o,ge]),{debouncedCallback:P}=Su(G,rc),{gridSelection:k,isRowSelectionActivated:$,isMultiRowSelectionActivated:le,isColumnSelectionActivated:Te,isMultiColumnSelectionActivated:Be,isRowSelected:ce,isColumnSelected:nt,isCellSelected:ke,clearSelection:bt,processSelectionChange:Et}=Ay(e,O,n,ee,P);ae.useEffect(()=>{bt(!0,!0)},[a]);const at=ae.useCallback(De=>{var lt;(lt=f.current)==null||lt.updateCells(De)},[]);ae.useEffect(()=>{var lt,ze,Lt,vt;if(!$&&!Te)return;const De=i.getStringValue({id:e.id,formId:e.formId});if(De){const on=ee.map(Pt=>oo(Pt)),Tt=JSON.parse(De);let Ft=yt.empty(),Ve=yt.empty();(ze=(lt=Tt.selection)==null?void 0:lt.rows)==null||ze.forEach(Pt=>{Ft=Ft.add(Pt)}),(vt=(Lt=Tt.selection)==null?void 0:Lt.columns)==null||vt.forEach(Pt=>{Ve=Ve.add(on.indexOf(Pt))}),(Ft.length>0||Ve.length>0)&&Et({rows:Ft,columns:Ve,current:void 0})}},[]);const te=ae.useCallback(()=>{oe!==q.current.getNumRows()&&Se(q.current.getNumRows())},[oe]),it=ae.useCallback(()=>{const De=q.current.toJson(ee);let lt=i.getStringValue({id:e.id,formId:e.formId});lt===void 0&&(lt=new Ko(0).toJson([])),De!==lt&&i.setStringValue({id:e.id,formId:e.formId},De,{fromUi:!0},o)},[ee,e.id,e.formId,i,o]),{debouncedCallback:me}=Su(it,rc),{exportToCsv:se}=Fy(fe,ee,oe,p),{onCellEdited:he,onPaste:$e,onRowAppended:Le,onDelete:Je,validateCell:de}=R1(ee,e.editingMode!==z,q,fe,ge,at,te,me,bt),{tooltip:be,clearTooltip:Ge,onItemHovered:Ae}=A1(ee,fe),{drawCell:tt,customRenderers:wt}=Dy(ee),gt=ae.useMemo(()=>ee.map(De=>Os(De)),[ee]),{columns:He,onColumnResize:_t}=E1(gt),Xt=t.columns.length>1,{minHeight:Ot,maxHeight:Ht,minWidth:rn,maxWidth:zt,rowHeight:gn,resizableSize:$t,setResizableSize:It}=M1(e,m,oe,Xt,u,c,a),In=ae.useCallback(([De,lt])=>({...r1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(ee.length-1,0)]}),[ee,m.glideTheme.textLight]),bn=ae.useCallback(()=>{xe(),bt()},[xe,bt]);oh({element:e,widgetMgr:i,onFormCleared:bn});const Oe=!O&&e.editingMode===z&&!n,Vt=g.useMemo(()=>ee.filter(De=>De.isPinned).reduce((De,lt)=>De+(lt.width??m.minColumnWidth*2),0)>u*.6,[ee,u,m.minColumnWidth]),dn=O||Vt?0:ee.filter(De=>De.isPinned).length;return ae.useEffect(()=>{setTimeout(()=>{var De,lt;if(h.current&&f.current){const ze=(lt=(De=h.current)==null?void 0:De.querySelector(".dvn-stack"))==null?void 0:lt.getBoundingClientRect();ze&&(C(ze.height>h.current.clientHeight),R(ze.width>h.current.clientWidth))}},1)},[$t,oe,He]),Fl(nc,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:E,ref:h,onMouseDown:De=>{if(h.current&&E){const lt=h.current.getBoundingClientRect();x&&lt.height-(ta+1)<De.clientY-lt.top&&De.stopPropagation(),M&&lt.width-(ta+1)<De.clientX-lt.left&&De.stopPropagation()}},onBlur:De=>{!b&&!I&&!De.currentTarget.contains(De.relatedTarget)&&bt(!0,!0)},children:[Fl(uh,{isFullScreen:a,disableFullscreenMode:r,locked:ce&&!$||ke||I&&b,onExpand:s,onCollapse:l,target:nc,children:[($&&ce||Te&&nt)&&xn(Wi,{label:"Clear selection",icon:fh,onClick:()=>{bt(),Ge()}}),Oe&&ce&&xn(Wi,{label:"Delete row(s)",icon:vh,onClick:()=>{Je&&(Je(k),Ge())}}),Oe&&!ce&&xn(Wi,{label:"Add row",icon:gc,onClick:()=>{Le&&(w(!0),Le(),Ge())}}),!ne&&!O&&xn(Wi,{label:"Download as CSV",icon:bh,onClick:()=>se()}),!O&&xn(Wi,{label:"Search",icon:mc,onClick:()=>{y?S(!1):(w(!0),S(!0)),Ge()}})]}),xn(ih,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:$t,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:Ot,maxHeight:Ht,minWidth:rn,maxWidth:zt,size:$t,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,gn],snapGap:gn/3,onResizeStop:(De,lt,ze,Lt)=>{if(d.current){const vt=2*m.tableBorderWidth;It({width:d.current.size.width,height:Ht-d.current.size.height===vt?d.current.size.height+vt:d.current.size.height})}},children:xn(Jv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:f,columns:He,rows:O?1:oe,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:gn,headerHeight:m.defaultHeaderHeight,getCellContent:O?In:fe,onColumnResize:I?void 0:_t,resizeIndicator:"header",freezeColumns:dn,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:I?"cell":"rect",columnSelect:"none",rowSelect:"none",onItemHovered:Ae,keybindings:{downFill:!0},onKeyDown:De=>{(De.ctrlKey||De.metaKey)&&De.key==="f"&&(S(lt=>!lt),De.stopPropagation(),De.preventDefault())},showSearch:y,onSearchClose:()=>{S(!1),Ge()},onHeaderClicked:(De,lt)=>{O||ne||Te||($&&ce&&bt(),ie(De))},gridSelection:k,onGridSelectionChange:De=>{(b||I)&&(Et(De),be!==void 0&&Ge())},theme:m.glideTheme,onMouseMove:De=>{De.kind==="out-of-bounds"&&b?w(!1):De.kind!=="out-of-bounds"&&!b&&w(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...E&&{paddingBottom:x?-ta:void 0,paddingRight:M?-ta:void 0}},drawCell:tt,customRenderers:wt,imageEditorOverride:c1,headerIcons:m.headerIcons,validateCell:de,onPaste:!1,...$&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:le?"multi":"auto",rowSelect:n?"none":le?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...Te&&{columnSelect:n?"none":Be?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!O&&e.editingMode!==H&&!n&&{fillHandle:!I,onCellEdited:he,onPaste:$e,onDelete:Je},...!O&&e.editingMode===z&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:Le,onHeaderClicked:void 0}})}),be&&be.content&&xn(Hy,{top:be.top,left:be.left,content:be.content,clearTooltip:Ge})]})}const Vy=ah($y),Jy=Object.freeze(Object.defineProperty({__proto__:null,default:Vy},Symbol.toStringTag,{value:"Module"}));export{E0 as C,jc as T,wi as a,Th as b,Jy as c,vi as i,Fm as m,hn as s};