@epam/ai-dial-ui-kit 0.9.0-rc.17 → 0.9.0-rc.18

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.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),ue=require("classnames"),G=require("@tabler/icons-react"),Ie=require("@floating-ui/react"),g=require("react"),zi=require("react-dom");function Mw(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const Se=Mw(g),$d="-",Iw=e=>{const t=Aw(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:r=>{const a=r.split($d);return a[0]===""&&a.length!==1&&a.shift(),Tp(a,t)||kw(r)},getConflictingClassGroupIds:(r,a)=>{const l=s[r]||[];return a&&o[r]?[...l,...o[r]]:l}}},Tp=(e,t)=>{if(e.length===0)return t.classGroupId;const s=e[0],o=t.nextPart.get(s),i=o?Tp(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;const n=e.join($d);return t.validators.find(({validator:r})=>r(n))?.classGroupId},vh=/^\[(.+)\]$/,kw=e=>{if(vh.test(e)){const t=vh.exec(e)[1],s=t?.substring(0,t.indexOf(":"));if(s)return"arbitrary.."+s}},Aw=e=>{const{theme:t,classGroups:s}=e,o={nextPart:new Map,validators:[]};for(const i in s)ed(s[i],o,i,t);return o},ed=(e,t,s,o)=>{e.forEach(i=>{if(typeof i=="string"){const n=i===""?t:wh(t,i);n.classGroupId=s;return}if(typeof i=="function"){if(Lw(i)){ed(i(o),t,s,o);return}t.validators.push({validator:i,classGroupId:s});return}Object.entries(i).forEach(([n,r])=>{ed(r,wh(t,n),s,o)})})},wh=(e,t)=>{let s=e;return t.split($d).forEach(o=>{s.nextPart.has(o)||s.nextPart.set(o,{nextPart:new Map,validators:[]}),s=s.nextPart.get(o)}),s},Lw=e=>e.isThemeGetter,Ow=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=new Map,o=new Map;const i=(n,r)=>{s.set(n,r),t++,t>e&&(t=0,o=s,s=new Map)};return{get(n){let r=s.get(n);if(r!==void 0)return r;if((r=o.get(n))!==void 0)return i(n,r),r},set(n,r){s.has(n)?s.set(n,r):i(n,r)}}},td="!",sd=":",Nw=sd.length,Hw=e=>{const{prefix:t,experimentalParseClassName:s}=e;let o=i=>{const n=[];let r=0,a=0,l=0,c;for(let m=0;m<i.length;m++){let C=i[m];if(r===0&&a===0){if(C===sd){n.push(i.slice(l,m)),l=m+Nw;continue}if(C==="/"){c=m;continue}}C==="["?r++:C==="]"?r--:C==="("?a++:C===")"&&a--}const d=n.length===0?i:i.substring(l),u=Gw(d),h=u!==d,p=c&&c>l?c-l:void 0;return{modifiers:n,hasImportantModifier:h,baseClassName:u,maybePostfixModifierPosition:p}};if(t){const i=t+sd,n=o;o=r=>r.startsWith(i)?n(r.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:r,maybePostfixModifierPosition:void 0}}if(s){const i=o;o=n=>s({className:n,parseClassName:i})}return o},Gw=e=>e.endsWith(td)?e.substring(0,e.length-1):e.startsWith(td)?e.substring(1):e,Bw=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const i=[];let n=[];return o.forEach(r=>{r[0]==="["||t[r]?(i.push(...n.sort(),r),n=[]):n.push(r)}),i.push(...n.sort()),i}},Vw=e=>({cache:Ow(e.cacheSize),parseClassName:Hw(e),sortModifiers:Bw(e),...Iw(e)}),zw=/\s+/,Ww=(e,t)=>{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:i,sortModifiers:n}=t,r=[],a=e.trim().split(zw);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:u,modifiers:h,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:C}=s(d);if(u){l=d+(l.length>0?" "+l:l);continue}let v=!!C,w=o(v?m.substring(0,C):m);if(!w){if(!v){l=d+(l.length>0?" "+l:l);continue}if(w=o(m),!w){l=d+(l.length>0?" "+l:l);continue}v=!1}const b=n(h).join(":"),S=p?b+td:b,x=S+w;if(r.includes(x))continue;r.push(x);const y=i(w,v);for(let F=0;F<y.length;++F){const R=y[F];r.push(S+R)}l=d+(l.length>0?" "+l:l)}return l};function _w(){let e=0,t,s,o="";for(;e<arguments.length;)(t=arguments[e++])&&(s=Mp(t))&&(o&&(o+=" "),o+=s);return o}const Mp=e=>{if(typeof e=="string")return e;let t,s="";for(let o=0;o<e.length;o++)e[o]&&(t=Mp(e[o]))&&(s&&(s+=" "),s+=t);return s};function jw(e,...t){let s,o,i,n=r;function r(l){const c=t.reduce((d,u)=>u(d),e());return s=Vw(c),o=s.cache.get,i=s.cache.set,n=a,a(l)}function a(l){const c=o(l);if(c)return c;const d=Ww(l,s);return i(l,d),d}return function(){return n(_w.apply(null,arguments))}}const it=e=>{const t=s=>s[e]||[];return t.isThemeGetter=!0,t},Ip=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,kp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Uw=/^\d+\/\d+$/,$w=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qw=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Kw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Yw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ri=e=>Uw.test(e),Te=e=>!!e&&!Number.isNaN(Number(e)),js=e=>!!e&&Number.isInteger(Number(e)),Ql=e=>e.endsWith("%")&&Te(e.slice(0,-1)),Es=e=>$w.test(e),Xw=()=>!0,Qw=e=>qw.test(e)&&!Kw.test(e),Ap=()=>!1,Jw=e=>Yw.test(e),e1=e=>Zw.test(e),t1=e=>!he(e)&&!ge(e),s1=e=>Wi(e,Np,Ap),he=e=>Ip.test(e),go=e=>Wi(e,Hp,Qw),Jl=e=>Wi(e,a1,Te),bh=e=>Wi(e,Lp,Ap),o1=e=>Wi(e,Op,e1),Wr=e=>Wi(e,Gp,Jw),ge=e=>kp.test(e),mn=e=>_i(e,Hp),i1=e=>_i(e,l1),Sh=e=>_i(e,Lp),n1=e=>_i(e,Np),r1=e=>_i(e,Op),_r=e=>_i(e,Gp,!0),Wi=(e,t,s)=>{const o=Ip.exec(e);return o?o[1]?t(o[1]):s(o[2]):!1},_i=(e,t,s=!1)=>{const o=kp.exec(e);return o?o[1]?t(o[1]):s:!1},Lp=e=>e==="position"||e==="percentage",Op=e=>e==="image"||e==="url",Np=e=>e==="length"||e==="size"||e==="bg-size",Hp=e=>e==="length",a1=e=>e==="number",l1=e=>e==="family-name",Gp=e=>e==="shadow",c1=()=>{const e=it("color"),t=it("font"),s=it("text"),o=it("font-weight"),i=it("tracking"),n=it("leading"),r=it("breakpoint"),a=it("container"),l=it("spacing"),c=it("radius"),d=it("shadow"),u=it("inset-shadow"),h=it("text-shadow"),p=it("drop-shadow"),m=it("blur"),C=it("perspective"),v=it("aspect"),w=it("ease"),b=it("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],y=()=>[...x(),ge,he],F=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],E=()=>[ge,he,l],D=()=>[ri,"full","auto",...E()],P=()=>[js,"none","subgrid",ge,he],T=()=>["auto",{span:["full",js,ge,he]},js,ge,he],M=()=>[js,"auto",ge,he],k=()=>["auto","min","max","fr",ge,he],N=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],A=()=>["start","end","center","stretch","center-safe","end-safe"],W=()=>["auto",...E()],U=()=>[ri,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],L=()=>[e,ge,he],de=()=>[...x(),Sh,bh,{position:[ge,he]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],te=()=>["auto","cover","contain",n1,s1,{size:[ge,he]}],Q=()=>[Ql,mn,go],J=()=>["","none","full",c,ge,he],me=()=>["",Te,mn,go],Re=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_=()=>[Te,Ql,Sh,bh],Fe=()=>["","none",m,ge,he],ie=()=>["none",Te,ge,he],$=()=>["none",Te,ge,he],q=()=>[Te,ge,he],se=()=>[ri,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Es],breakpoint:[Es],color:[Xw],container:[Es],"drop-shadow":[Es],ease:["in","out","in-out"],font:[t1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Es],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Es],shadow:[Es],spacing:["px",Te],text:[Es],"text-shadow":[Es],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ri,he,ge,v]}],container:["container"],columns:[{columns:[Te,he,ge,a]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{start:D()}],end:[{end:D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[js,"auto",ge,he]}],basis:[{basis:[ri,"full","auto",a,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Te,ri,"auto","initial","none",he]}],grow:[{grow:["",Te,ge,he]}],shrink:[{shrink:["",Te,ge,he]}],order:[{order:[js,"first","last","none",ge,he]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:T()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:T()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...N(),"normal"]}],"justify-items":[{"justify-items":[...A(),"normal"]}],"justify-self":[{"justify-self":["auto",...A()]}],"align-content":[{content:["normal",...N()]}],"align-items":[{items:[...A(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...A(),{baseline:["","last"]}]}],"place-content":[{"place-content":N()}],"place-items":[{"place-items":[...A(),"baseline"]}],"place-self":[{"place-self":["auto",...A()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],w:[{w:[a,"screen",...U()]}],"min-w":[{"min-w":[a,"screen","none",...U()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[r]},...U()]}],h:[{h:["screen","lh",...U()]}],"min-h":[{"min-h":["screen","lh","none",...U()]}],"max-h":[{"max-h":["screen","lh",...U()]}],"font-size":[{text:["base",s,mn,go]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,ge,Jl]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ql,he]}],"font-family":[{font:[i1,he,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,ge,he]}],"line-clamp":[{"line-clamp":[Te,"none",ge,Jl]}],leading:[{leading:[n,...E()]}],"list-image":[{"list-image":["none",ge,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ge,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Re(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",ge,go]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Te,"auto",ge,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge,he]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ge,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:de()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},js,ge,he],radial:["",ge,he],conic:[js,ge,he]},r1,o1]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":me()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Re(),"hidden","none"]}],"divide-style":[{divide:[...Re(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...Re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,ge,he]}],"outline-w":[{outline:["",Te,mn,go]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,_r,Wr]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",u,_r,Wr]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Te,go]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,_r,Wr]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Te,ge,he]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Te]}],"mask-image-linear-from-pos":[{"mask-linear-from":_()}],"mask-image-linear-to-pos":[{"mask-linear-to":_()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":_()}],"mask-image-t-to-pos":[{"mask-t-to":_()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":_()}],"mask-image-r-to-pos":[{"mask-r-to":_()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":_()}],"mask-image-b-to-pos":[{"mask-b-to":_()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":_()}],"mask-image-l-to-pos":[{"mask-l-to":_()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":_()}],"mask-image-x-to-pos":[{"mask-x-to":_()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":_()}],"mask-image-y-to-pos":[{"mask-y-to":_()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[ge,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":_()}],"mask-image-radial-to-pos":[{"mask-radial-to":_()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[Te]}],"mask-image-conic-from-pos":[{"mask-conic-from":_()}],"mask-image-conic-to-pos":[{"mask-conic-to":_()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:de()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,he]}],filter:[{filter:["","none",ge,he]}],blur:[{blur:Fe()}],brightness:[{brightness:[Te,ge,he]}],contrast:[{contrast:[Te,ge,he]}],"drop-shadow":[{"drop-shadow":["","none",p,_r,Wr]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Te,ge,he]}],"hue-rotate":[{"hue-rotate":[Te,ge,he]}],invert:[{invert:["",Te,ge,he]}],saturate:[{saturate:[Te,ge,he]}],sepia:[{sepia:["",Te,ge,he]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,he]}],"backdrop-blur":[{"backdrop-blur":Fe()}],"backdrop-brightness":[{"backdrop-brightness":[Te,ge,he]}],"backdrop-contrast":[{"backdrop-contrast":[Te,ge,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,ge,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,ge,he]}],"backdrop-invert":[{"backdrop-invert":["",Te,ge,he]}],"backdrop-opacity":[{"backdrop-opacity":[Te,ge,he]}],"backdrop-saturate":[{"backdrop-saturate":[Te,ge,he]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,ge,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ge,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Te,"initial",ge,he]}],ease:[{ease:["linear","initial",w,ge,he]}],delay:[{delay:[Te,ge,he]}],animate:[{animate:["none",b,ge,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ge,he]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:$()}],"scale-x":[{"scale-x":$()}],"scale-y":[{"scale-y":$()}],"scale-z":[{"scale-z":$()}],"scale-3d":["scale-3d"],skew:[{skew:q()}],"skew-x":[{"skew-x":q()}],"skew-y":[{"skew-y":q()}],transform:[{transform:[ge,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:se()}],"translate-x":[{"translate-x":se()}],"translate-y":[{"translate-y":se()}],"translate-z":[{"translate-z":se()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ge,he]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ge,he]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Te,mn,go,Jl]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},d1=jw(c1);function oe(...e){return d1(ue(e))}var Ra=(e=>(e.Description="description",e.Error="error",e))(Ra||{});const ir=({text:e,className:t,variant:s=Ra.Description,...o})=>e?f.jsx("span",{...o,role:"alert",className:oe("dial-tiny-text",s===Ra.Error?"text-error":"text-secondary",t),children:e}):null,ns=({...e})=>f.jsx(ir,{...e,variant:Ra.Error});var Ge=(e=>(e.Primary="primary",e.Neutral="neutral",e.Error="error",e.Success="Success",e.Secondary="secondary",e.Tertiary="tertiary",e))(Ge||{}),Me=(e=>(e.Solid="solid",e.Outlined="outlined",e.Ghost="ghost",e.Link="link",e))(Me||{});const yh={[Ge.Primary]:{[Me.Solid]:"dial-primary-solid-button",[Me.Ghost]:"dial-primary-ghost-button",[Me.Link]:"dial-primary-link-button"},[Ge.Neutral]:{[Me.Outlined]:"dial-neutral-outlined-button"},[Ge.Error]:{[Me.Solid]:"dial-error-solid-button",[Me.Ghost]:"dial-error-ghost-button"},[Ge.Success]:{[Me.Ghost]:"dial-success-ghost-button"},[Ge.Secondary]:{[Me.Ghost]:"dial-secondary-ghost-button"},[Ge.Tertiary]:{[Me.Ghost]:"dial-tertiary-ghost-button"}},Bp=(e=Ge.Primary,t=Me.Solid)=>{const s=yh[e]?.[t];return s||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${t}. Using default primary solid button styles.`),yh[Ge.Primary][Me.Solid])},u1=7,h1=2,Vp=g.createContext(null),zp=()=>{const e=g.useContext(Vp);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},g1=({initialOpen:e=!1,placement:t="bottom",isTriggerClickable:s=!1,open:o,onOpenChange:i}={})=>{const[n,r]=g.useState(e),a=g.useRef(null),l=o??n,c=i??r,d=Ie.useFloating({placement:t,open:l,onOpenChange:c,whileElementsMounted:Ie.autoUpdate,middleware:[Ie.offset(u1+h1),Ie.flip({crossAxis:t.includes("-"),fallbackAxisSideDirection:"start",padding:5}),Ie.shift({padding:5}),Ie.arrow({element:a})]}),u=Ie.useHover(d.context,{move:!1,enabled:o==null,mouseOnly:s,delay:{open:500,close:0}}),h=Ie.useFocus(d.context,{enabled:o==null}),p=Ie.useDismiss(d.context),m=Ie.useRole(d.context,{role:"tooltip"}),C=Ie.useInteractions([u,h,p,m]);return g.useEffect(()=>{if(!l)return;const v=d.refs.reference.current;if(!(v instanceof Element))return;const w=new IntersectionObserver(([b])=>{b.isIntersecting||c(!1)},{root:null,threshold:0});return w.observe(v),()=>w.disconnect()},[l,d.refs.reference,c]),g.useMemo(()=>({open:l,setOpen:c,arrowRef:a,...C,...d}),[l,c,C,d])},qd=({children:e,...t})=>{const s=g1(t);return f.jsx(Vp.Provider,{value:s,children:e})},Kd=({style:e,...t})=>{const s=zp(),o=g.useRef(null),i=Ie.useMergeRefs([s.refs.setFloating,o]);return s.open?f.jsx(Ie.FloatingPortal,{id:"tooltip-portal",children:f.jsxs("div",{ref:i,style:{...s.floatingStyles,...e},...s.getFloatingProps(t),className:ue("z-[55] whitespace-pre-wrap break-words rounded border border-primary bg-layer-0 px-2 py-1 dial-tiny shadow max-w-[300px]",s.getFloatingProps(t).className),children:[t.children,f.jsx(Ie.FloatingArrow,{ref:s.arrowRef,context:s.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary text-[var(--bg-layer-0,_#000000)]"})]})}):null},Yd=({children:e,asChild:t=!1,...s})=>{const o=zp(),i=t&&g.isValidElement(e),n=i?e.props?.ref:null,r=Ie.useMergeRefs([o.refs.setReference,...n?[n]:[]]);return i?g.cloneElement(e,o.getReferenceProps({...e.props,...s,ref:r})):f.jsx("span",{ref:r,...o.getReferenceProps(s),className:s.className??"dial-tooltip-trigger text-left",children:e})},yt=({hideTooltip:e,tooltip:t,children:s,triggerClassName:o,contentClassName:i,...n})=>f.jsxs(qd,{...n,children:[f.jsx(Yd,{className:ue(o,"truncate"),children:s}),f.jsx(Kd,{className:ue("text-primary",i,"max-w-[300px]",(e||!t)&&"hidden"),children:t})]});var bt=(e=>(e.Small="small",e.Standard="standard",e))(bt||{});const no=({variant:e,appearance:t=Me.Solid,size:s=bt.Standard,className:o,icon:i,tooltipProps:n,type:r="button",...a})=>{const l=oe(e&&Bp(e,t),s===bt.Small?"h-[24px] w-[24px]":"h-[40px] w-[40px]","dial-icon-button disabled:cursor-not-allowed focus-visible:outline outline-offset-0 disabled:text-controls-secondary-disable",o),c=f.jsx("button",{...a,type:r,className:l,"aria-label":a["aria-label"],children:i});return n?f.jsx(yt,{...n,children:c}):c},p1="w-[24px] h-[24px] border border-solid rounded-[6px] border-transparent p-1 text-secondary hover:text-controls-accent-primary-hover active:text-controls-accent-primary-active focus-within:border-focus";var pt=(e=>(e[e.LG=24]="LG",e[e.MD=20]="MD",e[e.SM=16]="SM",e))(pt||{});const Nt=18,Y={size:Nt,stroke:2},f1=({caption:e,onClick:t})=>{if(!e)return null;const s=f.jsx(no,{"aria-label":e,className:p1,icon:f.jsx(G.IconInfoCircle,{size:pt.SM}),onClick:t});return e?f.jsx(yt,{tooltip:e,triggerClassName:"flex justify-center items-center",children:s}):s},Bo=({label:e,required:t,className:s,caption:o,...i})=>e?f.jsxs("label",{...i,className:oe("dial-tiny-text text-secondary flex items-center gap-1",s),children:[typeof e=="string"?f.jsx("span",{className:"min-h-4",children:e}):e,t&&f.jsx("span",{className:"text-accent-primary",children:"*"}),f.jsx(f1,{caption:o})]}):null,$e=({icon:e,className:t})=>e?f.jsx("span",{className:ue("flex-shrink-0",t),children:e}):null,ss=({label:e,variant:t,appearance:s=Me.Solid,size:o=bt.Standard,className:i,textClassName:n,iconAfter:r,iconBefore:a,hideTitleOnMobile:l,type:c="button",tooltipProps:d,...u})=>{const h=ue(l?"hidden sm:inline":"inline",n),p=oe(t&&Bp(t,s),o===bt.Small?"dial-tiny-semi-text":"dial-small-semi-text",s!==Me.Link&&(o===bt.Small?"h-[24px] px-2":"h-[40px] px-3"),"disabled:cursor-not-allowed focus-visible:outline outline-offset-0",i),m=f.jsxs("button",{...u,type:c,className:p,"aria-label":typeof e=="string"&&e||u["aria-label"],children:[f.jsx($e,{icon:a}),e&&f.jsx("span",{className:h,children:e}),f.jsx($e,{icon:r})]});return d?f.jsx(yt,{...d,children:m}):m};var is=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e))(is||{});const m1=e=>({info:f.jsx(G.IconInfoCircle,{...e}),error:f.jsx(G.IconAlertCircle,{...e}),warning:f.jsx(G.IconAlertTriangle,{...e}),success:f.jsx(G.IconCircleCheck,{...e})}),C1={[is.Info]:"bg-info border-info text-info",[is.Success]:"bg-success border-success text-success",[is.Warning]:"bg-warning border-warning text-warning",[is.Error]:"bg-error border-error text-error"},v1="items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex",Wp=({variant:e=is.Info,message:t,className:s,iconSize:o=24,iconStroke:i=2,closable:n=!1,onClose:r,children:a,...l})=>{const c=g.useMemo(()=>m1({size:o,stroke:i})[e],[e,o,i]);return f.jsxs("div",{...l,role:"alert",className:oe(v1,C1[e],s),children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx($e,{icon:c}),f.jsx("div",{className:"text-primary",children:t})]}),a,n&&f.jsx(ss,{className:"ml-2 text-secondary hover:text-primary","aria-label":"Close alert",iconBefore:f.jsx(G.IconX,{size:pt.SM}),onClick:r})]})},w1="flex items-center justify-center text-secondary",b1="shrink-0 grow-0 basis-auto animate-spin-steps",S1=e=>Se.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M24 39V46.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Se.createElement("path",{opacity:.4,d:"M9 24H1.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Se.createElement("path",{opacity:.5,d:"M8.0918 8.0918L13.3994 13.3994",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Se.createElement("path",{opacity:.6,d:"M24 1.5V9",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Se.createElement("path",{opacity:.7,d:"M39.9121 8.08594L37.2607 10.7373L34.6094 13.3887",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Se.createElement("path",{opacity:.8,d:"M46.5 24H39",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Se.createElement("path",{opacity:.9,d:"M34.6055 34.6055L39.9082 39.9082",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Se.createElement("path",{opacity:.3,d:"M13.3936 34.6055L8.08594 39.9131",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),nr=({size:e=18,className:t,iconClassName:s,fullWidth:o=!0,ariaLabel:i="Loading"})=>f.jsx("div",{role:"status",className:ue({[w1]:!0,"w-full h-full":o,[t||""]:!!t}),children:f.jsx($e,{icon:f.jsx(S1,{width:e,height:e,className:ue(b1,s),role:"img","aria-label":i})})}),y1="text-primary",ht=({text:e,className:t,contentClassName:s,hideTooltip:o,id:i,customTooltipContent:n,...r})=>{const a=g.useRef(null),[l,c]=g.useState(!1),[d,u]=g.useState(""),h=g.useRef(null),p=()=>{const w=a.current;if(!w)return;u(w.textContent??"");const b=w.clientWidth,S=w.scrollWidth,x=Math.ceil(w.getBoundingClientRect().width);c(S>b||S>x)},m=g.useCallback(()=>{h.current&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(p)},[]);g.useEffect(()=>{m();const w=()=>m();window.addEventListener("resize",w);let b=null;return"ResizeObserver"in window&&a.current&&(b=new ResizeObserver(()=>m()),b.observe(a.current)),()=>{window.removeEventListener("resize",w),b&&b.disconnect(),h.current&&cancelAnimationFrame(h.current)}},[e,m]);const C=g.useMemo(()=>typeof e=="string"?e:d,[d,e]),v=g.useMemo(()=>o?"":n||(l?C:""),[n,C,o,l]);return f.jsxs(qd,{...r,children:[f.jsx(Yd,{asChild:!0,onMouseEnter:m,onFocusCapture:m,children:f.jsx("span",{id:i,className:oe("block truncate flex-1 min-w-0 max-w-full text-left",t),"aria-label":l?C:void 0,onMouseEnter:m,onFocus:m,ref:a,children:e})}),f.jsx(Kd,{className:oe(y1,s,!v&&"hidden"),children:v})]})},od="checkbox-container",id=({label:e,id:t,checked:s,indeterminate:o,disabled:i,ariaLabel:n,onChange:r,className:a,...l})=>{const c=g.useCallback(p=>{r?.(p.target.checked,t)},[r,t]),d=ue("flex flex-row items-center cursor-pointer text-accent-primary small-medium min-w-0",`${s||o?"":'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded'}`,i?"pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4":"",a),u=ue("border rounded",i?"bg-layer-4 border-icon-secondary":""),h=()=>o?f.jsx(G.IconMinus,{className:u,...Y}):s?f.jsx(G.IconCheck,{className:u,...Y}):null;return f.jsxs("label",{...l,className:d,htmlFor:t,"aria-description":l["aria-description"]||od,children:[h(),e&&(typeof e=="string"?f.jsx(ht,{text:e,className:"ml-2 text-primary"}):e),f.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:c,id:t,checked:s,"aria-checked":o?"mixed":s,"aria-disabled":i||void 0,"aria-label":e?void 0:n,className:"invisible w-0 h-0"})]})};var Gt=(e=>(e.VALID="valid",e.ERROR="error",e))(Gt||{});const x1=(e,t)=>{if(t===e.id)switch(e.status){case Gt.VALID:return"border-accent-secondary text-primary";case Gt.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case Gt.VALID:return"border-primary text-primary";case Gt.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},R1=(e,t)=>{if(t===e.id)switch(e.status){case Gt.VALID:return"bg-accent-secondary";case Gt.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case Gt.VALID:return"bg-accent-secondary";case Gt.ERROR:return"bg-red-400";default:return"bg-layer-4"}},F1=({step:e,index:t,currentStep:s,onChangeStep:o})=>{const i="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny cursor-pointer dial-step",n="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",r=()=>s===e.id&&e.status===Gt.ERROR?f.jsx(G.IconExclamationCircle,{stroke:2,size:pt.SM}):s!==e.id&&e.status===Gt.VALID?f.jsx(G.IconCheck,{stroke:2,size:pt.SM}):t+1;return f.jsxs("button",{className:ue(i,x1(e,s)),onClick:()=>o(e.id),children:[f.jsx("span",{className:ue(n,R1(e,s)),children:r()}),f.jsx("span",{children:e.name})]})},E1=({steps:e,currentStep:t,onChangeStep:s})=>{const o=i=>{const n=e.findIndex(a=>a.id===t),r=e.findIndex(a=>a.id===i);(i!==t&&e[n].status===Gt.VALID||r<n)&&s(i)};return f.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((i,n)=>f.jsx(F1,{currentStep:t,onChangeStep:o,step:i,index:n},i.id))})},Zd=({name:e,value:t,label:s,description:o,checked:i=!1,inputId:n,className:r,labelClassName:a,disabled:l,onChange:c,descriptionClassName:d,caption:u})=>{const h=`${n}-desc`,p=ue("dial-small cursor-pointer py-[1px]",l?"text-secondary":"text-primary",a),m=ue("cursor-pointer dial-input-radio",!!s&&"mr-2",r),C=ue("flex flex-col",!!o&&"mb-2"),v=ue("dial-tiny mt-2 ml-[26px] text-secondary",d),w=b=>{l||b.target.checked&&c?.(t)};return f.jsxs("div",{className:C,children:[f.jsxs("div",{className:"flex flex-row",children:[f.jsx("input",{type:"radio",id:n,name:e,value:t,checked:i,disabled:l,"aria-describedby":i&&o?h:void 0,className:m,onChange:w}),(s||u)&&f.jsxs("div",{className:"flex flex-col gap-1 ml-2",children:[s&&f.jsx("label",{className:p,htmlFor:n,"aria-describedby":u?"caption":"",children:s}),u&&f.jsx("span",{id:"caption",className:"dial-tiny text-secondary",children:u})]})]}),i&&o&&f.jsx("div",{id:h,className:v,children:o})]})};var zn=(e=>(e.Vertical="vertical",e.Horizontal="horizontal",e))(zn||{});const D1="w-full flex gap-2",P1={[zn.Vertical]:"flex-col",[zn.Horizontal]:"flex-row items-end"},Xd=({id:e,label:t,required:s,description:o,error:i,orientation:n=zn.Vertical,labelVisuallyHidden:r=!1,className:a,labelClassName:l,errorClassName:c,childrenClassName:d,captionDescription:u,readonly:h,value:p,defaultEmptyText:m,children:C})=>{const v=`${e}-label`,w=o?`${e}-desc`:void 0,b=i?`${e}-err`:void 0,S=`${e}-caption-desc`,x=[w,b].filter(Boolean).join(" ")||void 0,y=g.useCallback(()=>typeof i=="boolean"?null:typeof i=="string"||typeof i>"u"?i?f.jsx("div",{id:b,"aria-live":"polite",className:c,children:f.jsx(ns,{text:i})}):null:f.jsx("div",{id:b,role:"alert","aria-live":"polite",className:c,children:i}),[i,c,b]),F=g.useCallback(()=>p?typeof p=="string"||typeof p=="number"?f.jsx("span",{"aria-readonly":"true",children:p}):p:f.jsx("span",{className:"flex min-h-4","aria-readonly":"true",children:m??"None"}),[p,m]);return f.jsxs("div",{role:"group","aria-labelledby":t?v:void 0,"aria-describedby":x,className:oe(D1,P1[n],a),children:[t&&f.jsx("div",{id:v,className:oe(n==="horizontal"&&"shrink-0"),children:f.jsx(Bo,{htmlFor:e,label:t,required:s,className:oe(r&&"sr-only",l),caption:o})}),f.jsxs("div",{className:oe("min-w-0 w-full",d),children:[h?f.jsx("div",{className:"dial-input px-3 py-2",children:F()}):C,u&&f.jsx("div",{id:S,className:oe({"dial-tiny text-secondary mt-1":!0,"text-error":!!i}),children:u}),y()]})]})};var To=(e=>(e.Row="Row",e.Column="Column",e))(To||{});const T1="flex",M1="pb-1 mt-2",I1={[To.Column]:"flex-col gap-y-3",[To.Row]:"flex-row gap-x-6"},Fa=({fieldTitle:e,radioClassName:t,containerClassName:s,selectedItemClassName:o,selectedLabelClassName:i,radioGroupClassName:n,inputContainerClassName:r,selectedInputContainerClassName:a,groupLabelClassName:l,formItemChildrenClassName:c,labelClassName:d,disabled:u,elementId:h,radioButtons:p,activeRadioButton:m,orientation:C,onChange:v})=>f.jsx(Xd,{id:h,label:e,labelClassName:l||d,className:s,childrenClassName:c,children:f.jsx("div",{role:"radiogroup","aria-label":e,"aria-disabled":u||void 0,className:oe(T1,I1[C],n),children:p.map(w=>f.jsxs("div",{className:oe("flex flex-col",r,w.id===m&&a),children:[f.jsx(Zd,{name:h,value:w.id,inputId:w.id,disabled:u,className:t,labelClassName:oe(d,w.id===m&&i),label:w.name,caption:w.caption,checked:w.id===m,onChange:()=>v(w.id)}),w.id===m&&w.content?f.jsx("div",{className:oe(M1,o),children:w.content}):null]},w.id))})}),rr=({icon:e,title:t,description:s,containerClassName:o,titleClassName:i,descriptionClassName:n})=>f.jsxs("div",{className:oe("h-full w-full flex flex-col items-center justify-center text-secondary",o),"aria-label":"no-data-container",children:[e||f.jsx(G.IconClipboardX,{width:60,height:60,stroke:.5}),f.jsx("span",{className:oe("dial-small mt-2 text-primary",i),"aria-label":"no-results-title",children:t}),s&&f.jsx("span",{className:oe("mt-1 text-primary",n),"aria-label":"no-results-description",children:s})]}),ec=48,_p=({containerClassName:e,children:t,width:s=280,title:o,iconSize:i=24,iconStroke:n=1.5,titleClassName:r,additionalButtons:a,isOpened:l,onToggle:c})=>{const[d,u]=g.useState(s),[h,p]=g.useState(!0),m=g.useMemo(()=>typeof l=="boolean",[l]),C=m?l:h;g.useEffect(()=>{m&&u(l?s:ec)},[m,l,s]);const v=oe(["transform rotate-180 [writing-mode:tb-rl] py-4 px-3",C&&"hidden",r]),w=oe(["flex flex-row gap-2 cursor-pointer text-secondary py-2 items-center",C?"justify-end px-4":"justify-center"]),b=S=>{const x=!C;if(m){u(x?s:ec),c?.(x,S);return}u(x?s:ec),p(x)};return f.jsxs("div",{className:oe(["rounded flex flex-col justify-between",e]),style:{width:`${d}px`},"aria-label":"collapsible-sidebar",children:[f.jsx("div",{className:oe(["flex-1 p-4 min-h-0 overflow-auto",!C&&"hidden"]),children:t}),f.jsx("div",{className:v,children:o}),f.jsxs("div",{className:oe("border-t border-tertiary h-12",w),children:[C&&a,f.jsx(no,{className:"hover:text-accent-primary",onClick:b,"aria-label":"sidebar-state",size:bt.Small,icon:C?f.jsx(G.IconChevronsLeft,{size:i,stroke:n}):f.jsx(G.IconChevronsRight,{size:i,stroke:n})})]})]})},k1=({label:e,text:t,tooltip:s,children:o,postfix:i,className:n})=>f.jsxs("div",{className:oe("flex flex-col",o?"":"max-w-[200px]",n),children:[e&&f.jsx("label",{className:"dial-tiny mb-2 text-secondary",children:e}),o||f.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[f.jsx(yt,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:s||t,children:t}),i||null]})]});var sl=(e=>(e.Default="default",e))(sl||{});const A1={[sl.Default]:"border-icon-secondary bg-layer-3"},vo=({tag:e,className:t,remove:s,variant:o=sl.Default,iconBefore:i,bordered:n=!0})=>{const r=A1[o],a=oe("flex items-center gap-1 dial-tiny rounded p-1 h-[22px] text-primary",r,n?"border":"border-transparent",t);return f.jsxs("div",{className:a,children:[f.jsx($e,{icon:i}),f.jsx(ht,{text:e}),s&&f.jsx(ss,{className:"p-0",iconAfter:f.jsx(G.IconX,{size:pt.SM}),onClick:l=>s(l)})]},e)},jp=g.createContext({dragDropManager:void 0});function qt(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var xh=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Rh=function(){return Math.random().toString(36).substring(7).split("").join(".")},Fh={INIT:"@@redux/INIT"+Rh(),REPLACE:"@@redux/REPLACE"+Rh()};function L1(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function O1(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(G1(e))return"date";if(H1(e))return"error";var s=N1(e);switch(s){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return s}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function N1(e){return typeof e.constructor=="function"?e.constructor.name:null}function H1(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function G1(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function ai(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=O1(e)),t}function Up(e,t,s){var o;if(typeof t=="function"&&typeof s=="function"||typeof s=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?qt(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof s>"u"&&(s=t,t=void 0),typeof s<"u"){if(typeof s!="function")throw new Error(process.env.NODE_ENV==="production"?qt(1):"Expected the enhancer to be a function. Instead, received: '"+ai(s)+"'");return s(Up)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?qt(2):"Expected the root reducer to be a function. Instead, received: '"+ai(e)+"'");var i=e,n=t,r=[],a=r,l=!1;function c(){a===r&&(a=r.slice())}function d(){if(l)throw new Error(process.env.NODE_ENV==="production"?qt(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return n}function u(C){if(typeof C!="function")throw new Error(process.env.NODE_ENV==="production"?qt(4):"Expected the listener to be a function. Instead, received: '"+ai(C)+"'");if(l)throw new Error(process.env.NODE_ENV==="production"?qt(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var v=!0;return c(),a.push(C),function(){if(v){if(l)throw new Error(process.env.NODE_ENV==="production"?qt(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");v=!1,c();var b=a.indexOf(C);a.splice(b,1),r=null}}}function h(C){if(!L1(C))throw new Error(process.env.NODE_ENV==="production"?qt(7):"Actions must be plain objects. Instead, the actual type was: '"+ai(C)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof C.type>"u")throw new Error(process.env.NODE_ENV==="production"?qt(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(l)throw new Error(process.env.NODE_ENV==="production"?qt(9):"Reducers may not dispatch actions.");try{l=!0,n=i(n,C)}finally{l=!1}for(var v=r=a,w=0;w<v.length;w++){var b=v[w];b()}return C}function p(C){if(typeof C!="function")throw new Error(process.env.NODE_ENV==="production"?qt(10):"Expected the nextReducer to be a function. Instead, received: '"+ai(C));i=C,h({type:Fh.REPLACE})}function m(){var C,v=u;return C={subscribe:function(b){if(typeof b!="object"||b===null)throw new Error(process.env.NODE_ENV==="production"?qt(11):"Expected the observer to be an object. Instead, received: '"+ai(b)+"'");function S(){b.next&&b.next(d())}S();var x=v(S);return{unsubscribe:x}}},C[xh]=function(){return this},C}return h({type:Fh.INIT}),o={dispatch:h,subscribe:u,getState:d,replaceReducer:p},o[xh]=m,o}function Pe(e,t,...s){if(B1()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let o;if(t===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let i=0;o=new Error(t.replace(/%s/g,function(){return s[i++]})),o.name="Invariant Violation"}throw o.framesToPop=1,o}}function B1(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function V1(e,t,s){return t.split(".").reduce((o,i)=>o&&o[i]?o[i]:s||null,e)}function z1(e,t){return e.filter(s=>s!==t)}function $p(e){return typeof e=="object"}function W1(e,t){const s=new Map,o=n=>{s.set(n,s.has(n)?s.get(n)+1:1)};e.forEach(o),t.forEach(o);const i=[];return s.forEach((n,r)=>{n===1&&i.push(r)}),i}function _1(e,t){return e.filter(s=>t.indexOf(s)>-1)}const Qd="dnd-core/INIT_COORDS",ol="dnd-core/BEGIN_DRAG",Jd="dnd-core/PUBLISH_DRAG_SOURCE",il="dnd-core/HOVER",nl="dnd-core/DROP",rl="dnd-core/END_DRAG";function Eh(e,t){return{type:Qd,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const j1={type:Qd,payload:{clientOffset:null,sourceClientOffset:null}};function U1(e){return function(s=[],o={publishSource:!0}){const{publishSource:i=!0,clientOffset:n,getSourceClientOffset:r}=o,a=e.getMonitor(),l=e.getRegistry();e.dispatch(Eh(n)),$1(s,a,l);const c=Y1(s,a);if(c==null){e.dispatch(j1);return}let d=null;if(n){if(!r)throw new Error("getSourceClientOffset must be defined");q1(r),d=r(c)}e.dispatch(Eh(n,d));const h=l.getSource(c).beginDrag(a,c);if(h==null)return;K1(h),l.pinSource(c);const p=l.getSourceType(c);return{type:ol,payload:{itemType:p,item:h,sourceId:c,clientOffset:n||null,sourceClientOffset:d||null,isSourcePublic:!!i}}}}function $1(e,t,s){Pe(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(o){Pe(s.getSource(o),"Expected sourceIds to be registered.")})}function q1(e){Pe(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function K1(e){Pe($p(e),"Item must be an object.")}function Y1(e,t){let s=null;for(let o=e.length-1;o>=0;o--)if(t.canDragSource(e[o])){s=e[o];break}return s}function Z1(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function X1(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{},o=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(s).filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable}))),o.forEach(function(i){Z1(e,i,s[i])})}return e}function Q1(e){return function(s={}){const o=e.getMonitor(),i=e.getRegistry();J1(o),sb(o).forEach((r,a)=>{const l=eb(r,a,i,o),c={type:nl,payload:{dropResult:X1({},s,l)}};e.dispatch(c)})}}function J1(e){Pe(e.isDragging(),"Cannot call drop while not dragging."),Pe(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function eb(e,t,s,o){const i=s.getTarget(e);let n=i?i.drop(o,e):void 0;return tb(n),typeof n>"u"&&(n=t===0?{}:o.getDropResult()),n}function tb(e){Pe(typeof e>"u"||$p(e),"Drop result must either be an object or undefined.")}function sb(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function ob(e){return function(){const s=e.getMonitor(),o=e.getRegistry();ib(s);const i=s.getSourceId();return i!=null&&(o.getSource(i,!0).endDrag(s,i),o.unpinSource()),{type:rl}}}function ib(e){Pe(e.isDragging(),"Cannot call endDrag while not dragging.")}function nd(e,t){return t===null?e===null:Array.isArray(e)?e.some(s=>s===t):e===t}function nb(e){return function(s,{clientOffset:o}={}){rb(s);const i=s.slice(0),n=e.getMonitor(),r=e.getRegistry(),a=n.getItemType();return lb(i,r,a),ab(i,n,r),cb(i,n,r),{type:il,payload:{targetIds:i,clientOffset:o||null}}}}function rb(e){Pe(Array.isArray(e),"Expected targetIds to be an array.")}function ab(e,t,s){Pe(t.isDragging(),"Cannot call hover while not dragging."),Pe(!t.didDrop(),"Cannot call hover after drop.");for(let o=0;o<e.length;o++){const i=e[o];Pe(e.lastIndexOf(i)===o,"Expected targetIds to be unique in the passed array.");const n=s.getTarget(i);Pe(n,"Expected targetIds to be registered.")}}function lb(e,t,s){for(let o=e.length-1;o>=0;o--){const i=e[o],n=t.getTargetType(i);nd(n,s)||e.splice(o,1)}}function cb(e,t,s){e.forEach(function(o){s.getTarget(o).hover(t,o)})}function db(e){return function(){if(e.getMonitor().isDragging())return{type:Jd}}}function ub(e){return{beginDrag:U1(e),publishDragSource:db(e),hover:nb(e),drop:Q1(e),endDrag:ob(e)}}class hb{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:s}=this.store;function o(n){return(...r)=>{const a=n.apply(t,r);typeof a<"u"&&s(a)}}const i=ub(this);return Object.keys(i).reduce((n,r)=>{const a=i[r];return n[r]=o(a),n},{})}dispatch(t){this.store.dispatch(t)}constructor(t,s){this.isSetUp=!1,this.handleRefCountChange=()=>{const o=this.store.getState().refCount>0;this.backend&&(o&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!o&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=s,t.subscribe(this.handleRefCountChange)}}function gb(e,t){return{x:e.x+t.x,y:e.y+t.y}}function qp(e,t){return{x:e.x-t.x,y:e.y-t.y}}function pb(e){const{clientOffset:t,initialClientOffset:s,initialSourceClientOffset:o}=e;return!t||!s||!o?null:qp(gb(t,o),s)}function fb(e){const{clientOffset:t,initialClientOffset:s}=e;return!t||!s?null:qp(t,s)}const Pn=[],eu=[];Pn.__IS_NONE__=!0;eu.__IS_ALL__=!0;function mb(e,t){return e===Pn?!1:e===eu||typeof t>"u"?!0:_1(t,e).length>0}class Cb{subscribeToStateChange(t,s={}){const{handlerIds:o}=s;Pe(typeof t=="function","listener must be a function."),Pe(typeof o>"u"||Array.isArray(o),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const n=()=>{const r=this.store.getState(),a=r.stateId;try{a===i||a===i+1&&!mb(r.dirtyHandlerIds,o)||t()}finally{i=a}};return this.store.subscribe(n)}subscribeToOffsetChange(t){Pe(typeof t=="function","listener must be a function.");let s=this.store.getState().dragOffset;const o=()=>{const i=this.store.getState().dragOffset;i!==s&&(s=i,t())};return this.store.subscribe(o)}canDragSource(t){if(!t)return!1;const s=this.registry.getSource(t);return Pe(s,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:s.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const s=this.registry.getTarget(t);if(Pe(s,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const o=this.registry.getTargetType(t),i=this.getItemType();return nd(o,i)&&s.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const s=this.registry.getSource(t,!0);if(Pe(s,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const o=this.registry.getSourceType(t),i=this.getItemType();return o!==i?!1:s.isDragging(this,t)}isOverTarget(t,s={shallow:!1}){if(!t)return!1;const{shallow:o}=s;if(!this.isDragging())return!1;const i=this.registry.getTargetType(t),n=this.getItemType();if(n&&!nd(i,n))return!1;const r=this.getTargetIds();if(!r.length)return!1;const a=r.indexOf(t);return o?a===r.length-1:a>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return pb(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return fb(this.store.getState().dragOffset)}constructor(t,s){this.store=t,this.registry=s}}const Dh=typeof global<"u"?global:self,Kp=Dh.MutationObserver||Dh.WebKitMutationObserver;function Yp(e){return function(){const s=setTimeout(i,0),o=setInterval(i,50);function i(){clearTimeout(s),clearInterval(o),e()}}}function vb(e){let t=1;const s=new Kp(e),o=document.createTextNode("");return s.observe(o,{characterData:!0}),function(){t=-t,o.data=t}}const wb=typeof Kp=="function"?vb:Yp;class bb{enqueueTask(t){const{queue:s,requestFlush:o}=this;s.length||(o(),this.flushing=!0),s[s.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const s=this.index;if(this.index++,t[s].call(),this.index>this.capacity){for(let o=0,i=t.length-this.index;o<i;o++)t[o]=t[o+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=wb(this.flush),this.requestErrorThrow=Yp(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Sb{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,s){this.onError=t,this.release=s,this.task=null}}class yb{create(t){const s=this.freeTasks,o=s.length?s.pop():new Sb(this.onError,i=>s[s.length]=i);return o.task=t,o}constructor(t){this.onError=t,this.freeTasks=[]}}const Zp=new bb,xb=new yb(Zp.registerPendingError);function Rb(e){Zp.enqueueTask(xb.create(e))}const tu="dnd-core/ADD_SOURCE",su="dnd-core/ADD_TARGET",ou="dnd-core/REMOVE_SOURCE",al="dnd-core/REMOVE_TARGET";function Fb(e){return{type:tu,payload:{sourceId:e}}}function Eb(e){return{type:su,payload:{targetId:e}}}function Db(e){return{type:ou,payload:{sourceId:e}}}function Pb(e){return{type:al,payload:{targetId:e}}}function Tb(e){Pe(typeof e.canDrag=="function","Expected canDrag to be a function."),Pe(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Pe(typeof e.endDrag=="function","Expected endDrag to be a function.")}function Mb(e){Pe(typeof e.canDrop=="function","Expected canDrop to be a function."),Pe(typeof e.hover=="function","Expected hover to be a function."),Pe(typeof e.drop=="function","Expected beginDrag to be a function.")}function rd(e,t){if(t&&Array.isArray(e)){e.forEach(s=>rd(s,!1));return}Pe(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Zt;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Zt||(Zt={}));let Ib=0;function kb(){return Ib++}function Ab(e){const t=kb().toString();switch(e){case Zt.SOURCE:return`S${t}`;case Zt.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Ph(e){switch(e[0]){case"S":return Zt.SOURCE;case"T":return Zt.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Th(e,t){const s=e.entries();let o=!1;do{const{done:i,value:[,n]}=s.next();if(n===t)return!0;o=!!i}while(!o);return!1}class Lb{addSource(t,s){rd(t),Tb(s);const o=this.addHandler(Zt.SOURCE,t,s);return this.store.dispatch(Fb(o)),o}addTarget(t,s){rd(t,!0),Mb(s);const o=this.addHandler(Zt.TARGET,t,s);return this.store.dispatch(Eb(o)),o}containsHandler(t){return Th(this.dragSources,t)||Th(this.dropTargets,t)}getSource(t,s=!1){return Pe(this.isSourceId(t),"Expected a valid source ID."),s&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Pe(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Pe(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Pe(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Ph(t)===Zt.SOURCE}isTargetId(t){return Ph(t)===Zt.TARGET}removeSource(t){Pe(this.getSource(t),"Expected an existing source."),this.store.dispatch(Db(t)),Rb(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Pe(this.getTarget(t),"Expected an existing target."),this.store.dispatch(Pb(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const s=this.getSource(t);Pe(s,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=s}unpinSource(){Pe(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,s,o){const i=Ab(t);return this.types.set(i,s),t===Zt.SOURCE?this.dragSources.set(i,o):t===Zt.TARGET&&this.dropTargets.set(i,o),i}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const Ob=(e,t)=>e===t;function Nb(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Hb(e,t,s=Ob){if(e.length!==t.length)return!1;for(let o=0;o<e.length;++o)if(!s(e[o],t[o]))return!1;return!0}function Gb(e=Pn,t){switch(t.type){case il:break;case tu:case su:case al:case ou:return Pn;case ol:case Jd:case rl:case nl:default:return eu}const{targetIds:s=[],prevTargetIds:o=[]}=t.payload,i=W1(s,o);if(!(i.length>0||!Hb(s,o)))return Pn;const r=o[o.length-1],a=s[s.length-1];return r!==a&&(r&&i.push(r),a&&i.push(a)),i}function Bb(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function Vb(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{},o=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(s).filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable}))),o.forEach(function(i){Bb(e,i,s[i])})}return e}const Mh={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function zb(e=Mh,t){const{payload:s}=t;switch(t.type){case Qd:case ol:return{initialSourceClientOffset:s.sourceClientOffset,initialClientOffset:s.clientOffset,clientOffset:s.clientOffset};case il:return Nb(e.clientOffset,s.clientOffset)?e:Vb({},e,{clientOffset:s.clientOffset});case rl:case nl:return Mh;default:return e}}function Wb(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function li(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{},o=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(s).filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable}))),o.forEach(function(i){Wb(e,i,s[i])})}return e}const _b={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function jb(e=_b,t){const{payload:s}=t;switch(t.type){case ol:return li({},e,{itemType:s.itemType,item:s.item,sourceId:s.sourceId,isSourcePublic:s.isSourcePublic,dropResult:null,didDrop:!1});case Jd:return li({},e,{isSourcePublic:!0});case il:return li({},e,{targetIds:s.targetIds});case al:return e.targetIds.indexOf(s.targetId)===-1?e:li({},e,{targetIds:z1(e.targetIds,s.targetId)});case nl:return li({},e,{dropResult:s.dropResult,didDrop:!0,targetIds:[]});case rl:return li({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Ub(e=0,t){switch(t.type){case tu:case su:return e+1;case ou:case al:return e-1;default:return e}}function $b(e=0){return e+1}function qb(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function Kb(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{},o=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(s).filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable}))),o.forEach(function(i){qb(e,i,s[i])})}return e}function Yb(e={},t){return{dirtyHandlerIds:Gb(e.dirtyHandlerIds,{type:t.type,payload:Kb({},t.payload,{prevTargetIds:V1(e,"dragOperation.targetIds",[])})}),dragOffset:zb(e.dragOffset,t),refCount:Ub(e.refCount,t),dragOperation:jb(e.dragOperation,t),stateId:$b(e.stateId)}}function Zb(e,t=void 0,s={},o=!1){const i=Xb(o),n=new Cb(i,new Lb(i)),r=new hb(i,n),a=e(r,t,s);return r.receiveBackend(a),r}function Xb(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Up(Yb,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Qb(e,t){if(e==null)return{};var s=Jb(e,t),o,i;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(s[o]=e[o])}return s}function Jb(e,t){if(e==null)return{};var s={},o=Object.keys(e),i,n;for(n=0;n<o.length;n++)i=o[n],!(t.indexOf(i)>=0)&&(s[i]=e[i]);return s}let Ih=0;const la=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var e0=g.memo(function(t){var{children:s}=t,o=Qb(t,["children"]);const[i,n]=t0(o);return g.useEffect(()=>{if(n){const r=Xp();return++Ih,()=>{--Ih===0&&(r[la]=null)}}},[]),f.jsx(jp.Provider,{value:i,children:s})});function t0(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=s0(e.backend,e.context,e.options,e.debugMode),s=!e.context;return[t,s]}function s0(e,t=Xp(),s,o){const i=t;return i[la]||(i[la]={dragDropManager:Zb(e,t,s,o)}),i[la]}function Xp(){return typeof global<"u"?global:window}function o0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tc,kh;function i0(){return kh||(kh=1,tc=function e(t,s){if(t===s)return!0;if(t&&s&&typeof t=="object"&&typeof s=="object"){if(t.constructor!==s.constructor)return!1;var o,i,n;if(Array.isArray(t)){if(o=t.length,o!=s.length)return!1;for(i=o;i--!==0;)if(!e(t[i],s[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if(n=Object.keys(t),o=n.length,o!==Object.keys(s).length)return!1;for(i=o;i--!==0;)if(!Object.prototype.hasOwnProperty.call(s,n[i]))return!1;for(i=o;i--!==0;){var r=n[i];if(!e(t[r],s[r]))return!1}return!0}return t!==t&&s!==s}),tc}var n0=i0();const r0=o0(n0),Mo=typeof window<"u"?g.useLayoutEffect:g.useEffect;function a0(e,t,s){const[o,i]=g.useState(()=>t(e)),n=g.useCallback(()=>{const r=t(e);r0(o,r)||(i(r),s&&s())},[o,e,s]);return Mo(n),[o,n]}function l0(e,t,s){const[o,i]=a0(e,t,s);return Mo(function(){const r=e.getHandlerId();if(r!=null)return e.subscribeToStateChange(i,{handlerIds:[r]})},[e,i]),o}function Qp(e,t,s){return l0(t,e||(()=>({})),()=>s.reconnect())}function Jp(e,t){const s=[...t||[]];return t==null&&typeof e!="function"&&s.push(e),g.useMemo(()=>typeof e=="function"?e():e,s)}function c0(e){return g.useMemo(()=>e.hooks.dragSource(),[e])}function d0(e){return g.useMemo(()=>e.hooks.dragPreview(),[e])}let sc=!1,oc=!1;class u0{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Pe(!sc,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return sc=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{sc=!1}}isDragging(){if(!this.sourceId)return!1;Pe(!oc,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return oc=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{oc=!1}}subscribeToStateChange(t,s){return this.internalMonitor.subscribeToStateChange(t,s)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,s){return this.internalMonitor.isOverTarget(t,s)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let ic=!1;class h0{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,s){return this.internalMonitor.subscribeToStateChange(t,s)}canDrop(){if(!this.targetId)return!1;Pe(!ic,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return ic=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{ic=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function g0(e,t,s){const o=s.getRegistry(),i=o.addTarget(e,t);return[i,()=>o.removeTarget(i)]}function p0(e,t,s){const o=s.getRegistry(),i=o.addSource(e,t);return[i,()=>o.removeSource(i)]}function ad(e,t,s,o){let i;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const a=Object.prototype.hasOwnProperty.bind(t);for(let l=0;l<n.length;l++){const c=n[l];if(!a(c))return!1;const d=e[c],u=t[c];if(i=void 0,i===!1||i===void 0&&d!==u)return!1}return!0}function ld(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function f0(e){if(typeof e.type=="string")return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function m0(e){return(t=null,s=null)=>{if(!g.isValidElement(t)){const n=t;return e(n,s),n}const o=t;return f0(o),C0(o,s?n=>e(n,s):e)}}function ef(e){const t={};return Object.keys(e).forEach(s=>{const o=e[s];if(s.endsWith("Ref"))t[s]=e[s];else{const i=m0(o);t[s]=()=>i}}),t}function Ah(e,t){typeof e=="function"?e(t):e.current=t}function C0(e,t){const s=e.ref;return Pe(typeof s!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),s?g.cloneElement(e,{ref:o=>{Ah(s,o),Ah(t,o)}}):g.cloneElement(e,{ref:t})}class v0{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,s=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return s&&this.disconnectDragSource(),this.handlerId?t?(s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),s):(this.lastConnectedDragSource=t,s):s}reconnectDragPreview(t=!1){const s=this.dragPreview,o=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(o&&this.disconnectDragPreview(),!!this.handlerId){if(!s){this.lastConnectedDragPreview=s;return}o&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=s,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,s,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!ad(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!ad(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=ef({dragSource:(s,o)=>{this.clearDragSource(),this.dragSourceOptions=o||null,ld(s)?this.dragSourceRef=s:this.dragSourceNode=s,this.reconnectDragSource()},dragPreview:(s,o)=>{this.clearDragPreview(),this.dragPreviewOptions=o||null,ld(s)?this.dragPreviewRef=s:this.dragPreviewNode=s,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class w0{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const s=this.dropTarget;if(this.handlerId){if(!s){this.lastConnectedDropTarget=s;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=s,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,s,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!ad(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=ef({dropTarget:(s,o)=>{this.clearDropTarget(),this.dropTargetOptions=o,ld(s)?this.dropTargetRef=s:this.dropTargetNode=s,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function ji(){const{dragDropManager:e}=g.useContext(jp);return Pe(e!=null,"Expected drag drop context"),e}function b0(e,t){const s=ji(),o=g.useMemo(()=>new v0(s.getBackend()),[s]);return Mo(()=>(o.dragSourceOptions=e||null,o.reconnect(),()=>o.disconnectDragSource()),[o,e]),Mo(()=>(o.dragPreviewOptions=t||null,o.reconnect(),()=>o.disconnectDragPreview()),[o,t]),o}function S0(){const e=ji();return g.useMemo(()=>new u0(e),[e])}class y0{beginDrag(){const t=this.spec,s=this.monitor;let o=null;return typeof t.item=="object"?o=t.item:typeof t.item=="function"?o=t.item(s):o={},o??null}canDrag(){const t=this.spec,s=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(s):!0}isDragging(t,s){const o=this.spec,i=this.monitor,{isDragging:n}=o;return n?n(i):s===t.getSourceId()}endDrag(){const t=this.spec,s=this.monitor,o=this.connector,{end:i}=t;i&&i(s.getItem(),s),o.reconnect()}constructor(t,s,o){this.spec=t,this.monitor=s,this.connector=o}}function x0(e,t,s){const o=g.useMemo(()=>new y0(e,t,s),[t,s]);return g.useEffect(()=>{o.spec=e},[e]),o}function R0(e){return g.useMemo(()=>{const t=e.type;return Pe(t!=null,"spec.type must be defined"),t},[e])}function F0(e,t,s){const o=ji(),i=x0(e,t,s),n=R0(e);Mo(function(){if(n!=null){const[a,l]=p0(n,i,o);return t.receiveHandlerId(a),s.receiveHandlerId(a),l}},[o,t,s,i,n])}function E0(e,t){const s=Jp(e,t);Pe(!s.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const o=S0(),i=b0(s.options,s.previewOptions);return F0(s,o,i),[Qp(s.collect,o,i),c0(i),d0(i)]}function D0(e){return g.useMemo(()=>e.hooks.dropTarget(),[e])}function P0(e){const t=ji(),s=g.useMemo(()=>new w0(t.getBackend()),[t]);return Mo(()=>(s.dropTargetOptions=e||null,s.reconnect(),()=>s.disconnectDropTarget()),[e]),s}function T0(){const e=ji();return g.useMemo(()=>new h0(e),[e])}function M0(e){const{accept:t}=e;return g.useMemo(()=>(Pe(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class I0{canDrop(){const t=this.spec,s=this.monitor;return t.canDrop?t.canDrop(s.getItem(),s):!0}hover(){const t=this.spec,s=this.monitor;t.hover&&t.hover(s.getItem(),s)}drop(){const t=this.spec,s=this.monitor;if(t.drop)return t.drop(s.getItem(),s)}constructor(t,s){this.spec=t,this.monitor=s}}function k0(e,t){const s=g.useMemo(()=>new I0(e,t),[t]);return g.useEffect(()=>{s.spec=e},[e]),s}function A0(e,t,s){const o=ji(),i=k0(e,t),n=M0(e);Mo(function(){const[a,l]=g0(n,i,o);return t.receiveHandlerId(a),s.receiveHandlerId(a),l},[o,t,i,s,n.map(r=>r.toString()).join("|")])}function tf(e,t){const s=Jp(e,t),o=T0(),i=P0(s.options);return A0(s,o,i),[Qp(s.collect,o,i),D0(i)]}const Lh="column",L0="flex items-center",O0="mr-3 cursor-move text-secondary",N0=({id:e,children:t,className:s,onFind:o,onMove:i,ariaLabel:n="Drag item"})=>{const r=g.useRef(null),a=g.useRef(null),l=typeof o=="function"?o(e):-1,[{isDragging:c},d,u]=E0(()=>({type:Lh,item:{id:e,originalIndex:l},collect:p=>{const m=p.getItem();return{isDragging:p.isDragging()&&m?.id===e}},end:(p,m)=>{if(!p)return;!m.didDrop()&&typeof i=="function"&&p.originalIndex>-1&&i(p.id,p.originalIndex)}}),[e,l,i]),[,h]=tf(()=>({accept:Lh,hover:p=>{if(!(!p||p.id===e)&&typeof o=="function"&&typeof i=="function"){const m=o(e);i(p.id,m)}}}),[o,i,e]);return u(h(a)),d(r),f.jsxs("div",{ref:a,className:oe(L0,s),style:{opacity:c?0:1},"aria-roledescription":"Draggable item",children:[f.jsx("div",{ref:r,className:O0,"aria-label":n,children:f.jsx(G.IconGripVertical,{...Y})}),t]})},H0=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M3.68628 10.3945C3.91003 10.408 4.10927 10.4422 4.2832 10.4978L4.28394 10.4971C4.5167 10.5698 4.71621 10.6662 4.87939 10.7871C4.9994 10.876 5.10332 10.974 5.18994 11.0815L5.27051 11.1929L5.27197 11.1943L5.34009 11.3079C5.38301 11.3838 5.42067 11.4597 5.45288 11.5356L5.49683 11.6492L5.49756 11.6514L5.53198 11.7649C5.56274 11.877 5.5838 11.9867 5.59497 12.0938C5.61194 12.23 5.62059 12.3501 5.62061 12.4534C5.62061 12.6166 5.57231 12.7639 5.47559 12.8906C5.41544 12.9694 5.325 13.0198 5.21997 13.0503C5.11455 13.0809 4.98537 13.0942 4.83691 13.0942C4.73711 13.0942 4.62608 13.0838 4.50439 13.0635C4.37577 13.0415 4.26002 12.9966 4.16089 12.9272L4.15869 12.9258C4.04118 12.8396 3.98657 12.7121 3.98657 12.5625C3.98655 12.2721 3.94576 12.0552 3.87231 11.9033L3.87158 11.9011C3.81572 11.7798 3.69406 11.7026 3.45337 11.7026C3.33114 11.7027 3.25307 11.7292 3.20435 11.7671C3.14221 11.8149 3.10061 11.864 3.07617 11.9128C3.04149 11.985 3.02355 12.0599 3.02124 12.1384V14.7905L3.02637 14.8652C3.03466 14.9384 3.05266 15.0073 3.07983 15.0725L3.10254 15.1201C3.12874 15.1672 3.16488 15.2124 3.21167 15.2556C3.2602 15.2978 3.33572 15.3259 3.45337 15.3259C3.56813 15.3259 3.65533 15.3041 3.71997 15.2673C3.78314 15.2313 3.83208 15.1772 3.86646 15.0996C3.94535 14.9186 3.98655 14.7002 3.98657 14.4412C3.98657 14.3004 4.04381 14.1839 4.1499 14.0991L4.19824 14.0647C4.33673 13.9762 4.55866 13.9431 4.83691 13.9431C5.09384 13.9431 5.30559 13.9858 5.43604 14.1013C5.55182 14.204 5.62061 14.3293 5.62061 14.4749C5.62057 14.7549 5.57953 15.0125 5.49536 15.2461L5.45654 15.3442C5.36294 15.5677 5.23261 15.7627 5.06543 15.928L4.99146 15.9968C4.58057 16.3629 4.03856 16.541 3.37793 16.541L3.12671 16.5278C3.00679 16.5188 2.87303 16.495 2.72607 16.4575C2.61505 16.4287 2.50136 16.3894 2.38696 16.3396L2.27197 16.2861C2.1155 16.2094 1.9705 16.0983 1.83691 15.9558L1.83618 15.9551C1.70598 15.8128 1.59909 15.6391 1.51392 15.4365L1.51318 15.4351C1.42797 15.2251 1.38722 14.9736 1.38721 14.6843V12.345C1.38721 12.1069 1.41644 11.892 1.47656 11.7026C1.52068 11.5616 1.57629 11.4337 1.64355 11.3196L1.7146 11.2097C1.81013 11.07 1.92167 10.9524 2.04932 10.8582C2.17206 10.7676 2.29884 10.6909 2.42871 10.6289L2.54297 10.5798C2.81231 10.4716 3.11394 10.4081 3.44678 10.3879L3.45337 10.3872L3.68628 10.3945Z",fill:"currentColor"}),Se.createElement("path",{d:"M8.10791 11.7371C8.33261 11.7371 8.5218 11.8023 8.61255 11.9758C8.68772 12.1131 8.72383 12.2741 8.72388 12.4534V12.7522H9.03003C9.21461 12.7522 9.37781 12.7845 9.5127 12.8562C9.68704 12.9456 9.7463 13.149 9.74634 13.3843C9.74634 13.612 9.68105 13.8034 9.50537 13.894L9.5061 13.8948C9.36923 13.9665 9.20861 14.0002 9.03003 14.0002H8.72388V14.3064C8.72388 14.4941 8.68994 14.6588 8.61768 14.7942L8.61841 14.7949C8.5293 14.9647 8.334 15.0226 8.10791 15.0227C7.87257 15.0227 7.66761 14.9685 7.5769 14.8L7.57617 14.7993C7.50612 14.6659 7.47583 14.4988 7.47583 14.3064V14.0002H7.18579C6.99507 14.0002 6.82804 13.9669 6.69214 13.894C6.52182 13.8026 6.46069 13.6102 6.46069 13.3843C6.46073 13.1491 6.51509 12.944 6.68335 12.8533L6.68481 12.8525L6.79102 12.8079C6.90305 12.7697 7.03293 12.7522 7.177 12.7522H7.47583V12.4534C7.47587 12.2683 7.50712 12.1056 7.57617 11.9707L7.5769 11.9685L7.61646 11.9092C7.72038 11.7825 7.90134 11.7371 8.10791 11.7371Z",fill:"currentColor"}),Se.createElement("path",{d:"M12.728 11.7371C12.9527 11.7371 13.1419 11.8023 13.2327 11.9758C13.3078 12.1131 13.3439 12.2741 13.344 12.4534V12.7522H13.6501C13.8347 12.7522 13.9979 12.7845 14.1328 12.8562C14.3072 12.9456 14.3664 13.149 14.3665 13.3843C14.3665 13.612 14.3012 13.8034 14.1255 13.894L14.1262 13.8948C13.9894 13.9665 13.8287 14.0002 13.6501 14.0002H13.344V14.3064C13.344 14.4941 13.3101 14.6588 13.2378 14.7942L13.2385 14.7949C13.1494 14.9647 12.9541 15.0226 12.728 15.0227C12.4927 15.0227 12.2877 14.9685 12.197 14.8L12.1963 14.7993C12.1262 14.6659 12.0959 14.4988 12.0959 14.3064V14.0002H11.8059C11.6152 14.0002 11.4482 13.9669 11.3123 13.894C11.1419 13.8026 11.0808 13.6102 11.0808 13.3843C11.0808 13.1491 11.1352 12.944 11.3035 12.8533L11.3049 12.8525L11.4111 12.8079C11.5232 12.7697 11.653 12.7522 11.7971 12.7522H12.0959V12.4534C12.096 12.2683 12.1272 12.1056 12.1963 11.9707L12.197 11.9685L12.2366 11.9092C12.3405 11.7825 12.5215 11.7371 12.728 11.7371Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.574 1.50366C10.7457 1.52068 10.9072 1.59662 11.0303 1.71973L14.7803 5.46973C14.9209 5.61038 15 5.80109 15 6V9C15 9.41421 14.6642 9.75 14.25 9.75C13.8358 9.75 13.5 9.41421 13.5 9V6.75H11.25C10.8522 6.75 10.4708 6.59185 10.1895 6.31055C9.90815 6.02924 9.75 5.64783 9.75 5.25V3H5.25C5.05109 3 4.86038 3.07907 4.71973 3.21973C4.57907 3.36038 4.5 3.55109 4.5 3.75V9C4.5 9.41421 4.16421 9.75 3.75 9.75C3.33579 9.75 3 9.41421 3 9V3.75C3 3.15326 3.23722 2.58114 3.65918 2.15918C4.08114 1.73722 4.65326 1.5 5.25 1.5H10.5L10.574 1.50366ZM11.25 5.25H12.4395L11.25 4.06055V5.25Z",fill:"currentColor"})),G0=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M4.29639 10.3945C4.50665 10.4083 4.69413 10.4433 4.85815 10.5L4.85889 10.4993C5.07789 10.5733 5.26574 10.6715 5.41919 10.7944C5.53204 10.8849 5.62958 10.9843 5.71069 11.0933L5.78613 11.2053L5.78687 11.2068L5.85059 11.3218C5.89058 11.3983 5.92606 11.4746 5.95605 11.551L5.99707 11.666L5.9978 11.6682L6.05566 11.8945C6.0708 11.9689 6.08168 12.0422 6.08862 12.1143C6.10449 12.252 6.11279 12.3734 6.11279 12.4775C6.11276 12.6403 6.06824 12.7876 5.97803 12.9155C5.92155 12.9956 5.83545 13.0472 5.73486 13.0789C5.63441 13.1104 5.51212 13.1243 5.37231 13.1243C5.32505 13.1243 5.27524 13.1215 5.2229 13.1162L5.05811 13.0928C4.93553 13.0701 4.82533 13.024 4.73145 12.9529L4.72998 12.9514C4.61882 12.8632 4.56958 12.7352 4.56958 12.5874C4.56955 12.2926 4.5312 12.0715 4.46191 11.9165L4.46045 11.9143C4.4319 11.8474 4.38931 11.8003 4.33154 11.7686C4.27185 11.7358 4.18944 11.7158 4.07812 11.7158C3.96626 11.7158 3.89622 11.7421 3.85254 11.7788C3.79519 11.8265 3.75637 11.8759 3.73315 11.926C3.70026 11.9999 3.68262 12.0771 3.68042 12.1582V14.8425L3.68555 14.9187C3.69337 14.9937 3.71038 15.0643 3.73608 15.1311L3.75732 15.1802C3.78176 15.2276 3.81496 15.2727 3.85767 15.3157L3.89575 15.3442C3.93843 15.3699 3.99697 15.386 4.07812 15.386C4.18296 15.386 4.26146 15.3647 4.31982 15.3289C4.37727 15.2935 4.4233 15.2389 4.45605 15.1589C4.53037 14.9746 4.56957 14.7522 4.56958 14.4888C4.56958 14.3307 4.63662 14.2007 4.7666 14.1116L4.82007 14.0801C4.95284 14.0119 5.14337 13.9856 5.37231 13.9856C5.61445 13.9856 5.81633 14.0298 5.94067 14.1489C6.04986 14.2536 6.11274 14.379 6.11279 14.5225C6.11279 14.8453 6.06245 15.1386 5.95972 15.3999C5.85998 15.6574 5.71501 15.8781 5.52466 16.0598L5.52393 16.0591C5.13817 16.4307 4.62871 16.6128 4.00708 16.6128C3.95774 16.6128 3.87811 16.6081 3.77124 16.5996C3.65793 16.5904 3.53127 16.5659 3.39331 16.5278C3.28866 16.4984 3.18149 16.4584 3.07397 16.4077L2.96631 16.3535C2.81858 16.2752 2.68196 16.1624 2.55688 16.0181L2.55615 16.0166C2.43435 15.8725 2.33453 15.6972 2.25513 15.4929L2.25439 15.4915C2.17508 15.28 2.13721 15.0267 2.13721 14.7349V12.3669C2.13721 12.1269 2.16476 11.9109 2.2207 11.7202L2.26538 11.5825C2.3136 11.4491 2.37234 11.3289 2.44263 11.2229C2.53187 11.0816 2.63607 10.9621 2.7561 10.8662C2.87117 10.7743 2.98996 10.6964 3.11206 10.6333L3.11353 10.6326L3.22046 10.5828C3.47384 10.4727 3.75793 10.4085 4.0708 10.3879L4.07812 10.3872L4.29639 10.3945Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.574 1.50366C10.7457 1.52068 10.9072 1.59662 11.0303 1.71973L14.7803 5.46973C14.9209 5.61038 15 5.80109 15 6V14.25C15 14.8467 14.7628 15.4189 14.3408 15.8408C13.9189 16.2628 13.3467 16.5 12.75 16.5H8.625C8.21079 16.5 7.875 16.1642 7.875 15.75C7.875 15.3358 8.21079 15 8.625 15H12.75C12.9489 15 13.1396 14.9209 13.2803 14.7803C13.4209 14.6396 13.5 14.4489 13.5 14.25V6.75H11.25C10.8522 6.75 10.4708 6.59185 10.1895 6.31055C9.90815 6.02924 9.75 5.64783 9.75 5.25V3H5.25C5.05109 3 4.86038 3.07907 4.71973 3.21973C4.57907 3.36038 4.5 3.55109 4.5 3.75V9C4.5 9.41421 4.16421 9.75 3.75 9.75C3.33579 9.75 3 9.41421 3 9V3.75C3 3.15326 3.23722 2.58114 3.65918 2.15918C4.08114 1.73722 4.65326 1.5 5.25 1.5H10.5L10.574 1.50366ZM11.25 5.25H12.4395L11.25 4.06055V5.25Z",fill:"currentColor"})),B0=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M3.62109 10.571C3.83849 10.5842 4.03206 10.618 4.20117 10.6721L4.2019 10.6714C4.42776 10.742 4.62121 10.8352 4.77979 10.9526C4.89663 11.0392 4.99793 11.135 5.08228 11.2397L5.16064 11.3474L5.16211 11.3489L5.22803 11.4595C5.26973 11.5332 5.30659 11.6069 5.33789 11.6807L5.38037 11.7905L5.3811 11.7935L5.44116 12.0117C5.45675 12.0826 5.46834 12.1524 5.47559 12.2212L5.49463 12.4087C5.49888 12.4674 5.50049 12.5222 5.50049 12.5728C5.50045 12.7317 5.45415 12.8755 5.35986 12.999C5.30088 13.0762 5.2117 13.1246 5.10938 13.1543C5.0067 13.1841 4.88146 13.1975 4.7373 13.1975C4.64029 13.1975 4.53244 13.1872 4.41431 13.1675C4.28898 13.1461 4.17557 13.1026 4.07886 13.0349L4.07739 13.0334C3.96236 12.9491 3.90894 12.8243 3.90894 12.6782C3.90893 12.3968 3.86925 12.187 3.79834 12.0403L3.79761 12.0381C3.74418 11.922 3.62816 11.847 3.39551 11.8469C3.27715 11.8469 3.20179 11.873 3.15527 11.9092C3.09597 11.9548 3.05572 12.0012 3.03223 12.0476L3.03296 12.0483C2.99919 12.1182 2.98102 12.1906 2.97876 12.2666V14.8396L2.98389 14.9114C2.99188 14.9821 3.00888 15.049 3.03516 15.1121L3.05786 15.1582C3.08304 15.2033 3.11768 15.2464 3.1626 15.2878C3.2089 15.3285 3.28115 15.356 3.39551 15.356C3.50633 15.3559 3.58982 15.3349 3.65186 15.2996C3.71249 15.2651 3.75936 15.2131 3.79248 15.1384L3.84302 15.0007C3.88665 14.8554 3.90893 14.6891 3.90894 14.5005C3.90894 14.363 3.96502 14.2494 4.0686 14.1665L4.11621 14.1328C4.25147 14.0465 4.46739 14.0134 4.7373 14.0134C4.98658 14.0134 5.19278 14.0552 5.32031 14.168C5.43323 14.268 5.5004 14.3903 5.50049 14.5327C5.50049 14.8049 5.46077 15.0556 5.37891 15.2827L5.34155 15.3779C5.23762 15.6261 5.08621 15.8373 4.88892 16.0115L4.88965 16.0122C4.49029 16.3681 3.96383 16.541 3.32227 16.541C3.27168 16.541 3.18935 16.5367 3.07837 16.5286C3.02014 16.5242 2.95789 16.5158 2.89307 16.5044L2.68799 16.4597C2.5801 16.4317 2.47025 16.3938 2.35913 16.3455L2.2478 16.2935C2.09553 16.2188 1.95433 16.1112 1.82446 15.9727L1.82373 15.9712C1.69712 15.8328 1.593 15.6642 1.51025 15.4673L1.50952 15.4658C1.42669 15.2616 1.38721 15.0172 1.38721 14.7363V12.4666C1.38723 12.2355 1.41597 12.0273 1.47437 11.8433C1.53119 11.6615 1.60684 11.502 1.70361 11.3665L1.77686 11.2676C1.85263 11.1732 1.9374 11.0913 2.03101 11.0222C2.15024 10.9342 2.27322 10.8598 2.39941 10.7996L2.40015 10.7988L2.51074 10.7512C2.77229 10.6462 3.0652 10.5848 3.38818 10.5652L3.39551 10.5645L3.62109 10.571Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.574 1.50366C10.7457 1.52068 10.9072 1.59662 11.0303 1.71973L14.7803 5.46973C14.9209 5.61038 15 5.80109 15 6V14.25C15 14.8467 14.7628 15.4189 14.3408 15.8408C13.9189 16.2628 13.3467 16.5 12.75 16.5H12C11.5858 16.5 11.25 16.1642 11.25 15.75C11.25 15.3358 11.5858 15 12 15H12.75C12.9489 15 13.1396 14.9209 13.2803 14.7803C13.4209 14.6396 13.5 14.4489 13.5 14.25V6.75H11.25C10.8522 6.75 10.4708 6.59185 10.1895 6.31055C9.90815 6.02924 9.75 5.64783 9.75 5.25V3H5.25C5.05109 3 4.86038 3.07907 4.71973 3.21973C4.57907 3.36038 4.5 3.55109 4.5 3.75V9C4.5 9.41421 4.16421 9.75 3.75 9.75C3.33579 9.75 3 9.41421 3 9V3.75C3 3.15326 3.23722 2.58114 3.65918 2.15918C4.08114 1.73722 4.65326 1.5 5.25 1.5H10.5L10.574 1.50366ZM11.25 5.25H12.4395L11.25 4.06055V5.25Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.36914 11.28C9.50263 11.28 9.62352 11.3063 9.72583 11.3643L9.7251 11.365C9.85906 11.4379 9.90454 11.5838 9.90454 11.7429C9.9045 11.7567 9.90157 11.7778 9.89941 11.7935C9.89658 11.814 9.89242 11.8422 9.88696 11.8777C9.87611 11.9455 9.8639 12.0222 9.85034 12.1062C9.84553 12.136 9.84018 12.1643 9.83569 12.1912H10.0525C10.1919 12.1912 10.3171 12.2148 10.4216 12.2688L10.4209 12.2695C10.5686 12.3412 10.6128 12.5089 10.6128 12.6863C10.6128 12.8587 10.5617 13.0123 10.4194 13.0898L10.4187 13.0906C10.3122 13.1472 10.1885 13.1726 10.0525 13.1726H9.67529L9.55225 13.8589H9.75952C9.89706 13.8589 10.0206 13.8819 10.1243 13.9343C10.2748 14.005 10.3198 14.1752 10.3198 14.354C10.3198 14.5291 10.2702 14.6875 10.1243 14.7627L10.1235 14.7634C10.0176 14.8164 9.89461 14.8403 9.75952 14.8403H9.38452L9.33398 15.1677L9.33325 15.1714C9.30492 15.3271 9.26297 15.4669 9.20728 15.5903L9.20801 15.5911C9.17656 15.6626 9.13001 15.7228 9.06592 15.7646C9.00162 15.8065 8.92683 15.8247 8.84839 15.8247C8.72 15.8247 8.60307 15.8041 8.50122 15.7581L8.49976 15.7573C8.35755 15.6908 8.31299 15.5386 8.31299 15.3787C8.31299 15.3406 8.31787 15.2939 8.32617 15.241L8.35913 15.0242C8.36863 14.9624 8.37948 14.9012 8.38989 14.8403H7.92847L7.87793 15.1677L7.8772 15.1714C7.84887 15.3271 7.80691 15.4669 7.75122 15.5903L7.75195 15.5911C7.72046 15.6627 7.6734 15.7228 7.60913 15.7646C7.54487 15.8064 7.47071 15.8247 7.39233 15.8247C7.26394 15.8247 7.14702 15.8041 7.04517 15.7581L7.0437 15.7573C6.90149 15.6908 6.85693 15.5387 6.85693 15.3787C6.85694 15.3406 6.86181 15.2939 6.87012 15.241L6.90308 15.0242C6.91257 14.9624 6.92342 14.9012 6.93384 14.8403H6.6687C6.52906 14.8403 6.40313 14.8167 6.29663 14.7634L6.29297 14.762C6.15355 14.6853 6.10844 14.5261 6.1084 14.354C6.1084 14.1782 6.1487 14.0079 6.29297 13.9358C6.39784 13.882 6.52535 13.8589 6.6687 13.8589H7.09497L7.21802 13.1726H6.95361C6.81311 13.1726 6.68646 13.1475 6.57935 13.0906L6.57788 13.0898C6.43874 13.0135 6.39332 12.8568 6.39331 12.6863C6.39331 12.5105 6.43361 12.3402 6.57788 12.2681C6.68271 12.2144 6.81036 12.1912 6.95361 12.1912H7.38721L7.46045 11.7561C7.47174 11.6625 7.50842 11.5673 7.56372 11.4712C7.63824 11.3418 7.76255 11.2801 7.91309 11.28C8.04657 11.28 8.16746 11.3063 8.26978 11.3643L8.26904 11.365C8.403 11.4379 8.44849 11.5838 8.44849 11.7429C8.44844 11.7567 8.44552 11.7778 8.44336 11.7935C8.44053 11.814 8.43636 11.8422 8.43091 11.8777C8.42006 11.9455 8.40784 12.0222 8.39429 12.1062C8.38947 12.136 8.38413 12.1643 8.37964 12.1912H8.84326L8.9165 11.7561C8.92779 11.6625 8.96448 11.5673 9.01978 11.4712C9.0943 11.3418 9.21861 11.2801 9.36914 11.28ZM8.09619 13.8589H8.55103L8.67407 13.1726H8.21924L8.09619 13.8589Z",fill:"currentColor"})),V0=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M4.43188 10.4409C4.65285 10.4409 4.85471 10.4869 4.99951 10.6152L4.99878 10.6159C5.13097 10.7305 5.21409 10.881 5.25146 11.0576C5.28474 11.2148 5.30052 11.3869 5.30054 11.5724V15.4323C5.30054 15.6193 5.28417 15.7927 5.25146 15.9516L5.2522 15.9523C5.21779 16.1313 5.13551 16.2842 4.99951 16.3976L4.99878 16.3969C4.85386 16.52 4.65269 16.5646 4.43188 16.5646C4.21337 16.5646 4.01411 16.5195 3.86792 16.3976L3.86353 16.394C3.73466 16.2798 3.65263 16.1299 3.6123 15.9553L3.61157 15.9516C3.57826 15.7941 3.5625 15.6205 3.5625 15.4323V11.5724C3.56252 11.3869 3.5783 11.2148 3.61157 11.0576C3.64882 10.8815 3.72996 10.7302 3.85986 10.6152L3.86133 10.6137C4.00804 10.4875 4.2103 10.4409 4.43188 10.4409Z",fill:"currentColor"}),Se.createElement("path",{d:"M8.07129 10.4474C8.18434 10.4599 8.28945 10.4924 8.3811 10.55L8.38184 10.5493C8.45754 10.5942 8.52569 10.6451 8.58472 10.7016L8.64111 10.7602L8.64331 10.7631L8.69385 10.8298C8.72596 10.8768 8.75504 10.9284 8.78101 10.9836L8.81763 11.0685L8.81909 11.0729L9.85986 13.8928V11.2692C9.85986 11.0565 9.89522 10.8654 9.98291 10.7119L9.98364 10.7104L10.0349 10.6393C10.1656 10.4886 10.3781 10.4409 10.5974 10.4409C10.8635 10.4409 11.125 10.4947 11.2529 10.6965C11.3535 10.8508 11.3928 11.0487 11.3928 11.2692V15.4323C11.3928 15.6163 11.3809 15.7863 11.3577 15.9413L11.3584 15.9421C11.3349 16.1167 11.2678 16.2708 11.1467 16.3881C11.0102 16.5202 10.8106 16.5646 10.5974 16.5646H10.0554C9.86994 16.5646 9.69972 16.5199 9.56104 16.416C9.44129 16.3261 9.3452 16.215 9.27466 16.0842C9.21353 15.9706 9.16292 15.8593 9.12378 15.7509L8.14893 13.1091V15.7363C8.14893 15.9493 8.11322 16.1406 8.02661 16.2958L8.02588 16.2973C7.90706 16.5052 7.66112 16.5646 7.41138 16.5646C7.14233 16.5646 6.88122 16.5106 6.75 16.312C6.64812 16.1572 6.60791 15.9581 6.60791 15.7363V11.5724C6.60792 11.3882 6.61818 11.2193 6.63867 11.0671V11.0641L6.66724 10.9367C6.7042 10.8142 6.76699 10.706 6.85986 10.6188C6.9982 10.4862 7.19704 10.4409 7.41138 10.4409H7.95337L8.07129 10.4474Z",fill:"currentColor"}),Se.createElement("path",{d:"M13.5688 10.4409C13.7898 10.4409 13.9917 10.4869 14.1365 10.6152L14.1357 10.6159C14.2679 10.7305 14.3511 10.881 14.3884 11.0576C14.4217 11.2148 14.4375 11.3869 14.4375 11.5724V15.4323C14.4375 15.6193 14.4211 15.7927 14.3884 15.9516L14.3892 15.9523C14.3548 16.1313 14.2725 16.2842 14.1365 16.3976L14.1357 16.3969C13.9908 16.52 13.7897 16.5646 13.5688 16.5646C13.3503 16.5646 13.1511 16.5195 13.0049 16.3976L13.0005 16.394C12.8716 16.2798 12.7896 16.1299 12.7493 15.9553L12.7485 15.9516C12.7152 15.7941 12.6995 15.6205 12.6995 15.4323V11.5724C12.6995 11.3869 12.7153 11.2148 12.7485 11.0576C12.7858 10.8815 12.8669 10.7302 12.9968 10.6152L12.9983 10.6137C13.145 10.4875 13.3473 10.4409 13.5688 10.4409Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.574 1.50385C10.7457 1.52087 10.9072 1.59681 11.0303 1.71991L14.7803 5.46991C14.9208 5.61054 15 5.80136 15 6.00018V9.00018C14.9998 9.41423 14.6641 9.75018 14.25 9.75018C13.8359 9.75018 13.5002 9.41423 13.5 9.00018V6.75018H11.25C10.8523 6.75018 10.4707 6.59192 10.1895 6.31073C9.90824 6.02951 9.7501 5.64788 9.75 5.25018V3.00018H5.25C5.05109 3.00018 4.86038 3.07926 4.71973 3.21991C4.57919 3.36054 4.5 3.55136 4.5 3.75018V9.00018C4.4998 9.41423 4.16409 9.75018 3.75 9.75018C3.33591 9.75018 3.0002 9.41423 3 9.00018V3.75018C3 3.15353 3.23734 2.5813 3.65918 2.15936C4.08114 1.73741 4.65326 1.50018 5.25 1.50018H10.5L10.574 1.50385ZM11.25 5.25018H12.4395L11.25 4.06073V5.25018Z",fill:"currentColor"})),z0=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M6.76831 10.8267C6.93291 10.8267 7.08404 10.8408 7.22021 10.8691L7.35205 10.9021L7.35278 10.9028L7.46851 10.9431C7.57872 10.986 7.67614 11.038 7.75928 11.0991C7.84245 11.1591 7.91481 11.2265 7.97388 11.3005L8.02881 11.3767L8.02954 11.3774L8.11011 11.5254C8.13317 11.5747 8.15233 11.6249 8.16797 11.6755C8.19815 11.7711 8.21863 11.8631 8.22656 11.9502C8.23376 12.0294 8.23755 12.096 8.23755 12.1479C8.23753 12.318 8.17338 12.4626 8.04639 12.572C7.92503 12.676 7.77653 12.7265 7.60913 12.7266C7.4711 12.7266 7.34146 12.6749 7.22241 12.583C7.1027 12.4905 7.02328 12.3741 7.02319 12.2329C7.02319 12.0468 6.98759 11.9498 6.94775 11.907L6.94629 11.9055C6.90561 11.8606 6.83878 11.8294 6.72583 11.8293C6.58234 11.8293 6.48534 11.856 6.42334 11.896C6.4086 11.9056 6.38747 11.9281 6.37061 11.981C6.35372 12.0341 6.34351 12.1099 6.34351 12.2117C6.34581 12.2878 6.36799 12.3546 6.40869 12.4153C6.45761 12.4821 6.52298 12.549 6.60718 12.6138L6.73608 12.7053C6.78632 12.7386 6.84449 12.7751 6.9104 12.8145C7.04454 12.8945 7.16167 12.9644 7.2605 13.0232L7.44507 13.1426C7.50565 13.1844 7.56597 13.2284 7.62524 13.2744C7.74715 13.3666 7.8562 13.4715 7.95337 13.5886C8.05276 13.7085 8.13297 13.8432 8.1936 13.9922C8.25599 14.1456 8.28891 14.3172 8.29395 14.5049V14.5364C8.29395 14.7339 8.26896 14.9141 8.21777 15.0754V15.0776C8.11696 15.3776 7.94914 15.6082 7.7124 15.761L7.71313 15.7617C7.62701 15.8179 7.53944 15.8644 7.45166 15.9016L7.36304 15.936C7.30225 15.9571 7.24075 15.9753 7.1792 15.9902L6.99243 16.0261C6.87331 16.0431 6.75886 16.0529 6.65039 16.0554H6.61304C6.41017 16.0554 6.22414 16.0345 6.05786 15.9917C5.89914 15.9495 5.75823 15.8922 5.63892 15.8196L5.63745 15.8188C5.52025 15.7449 5.42093 15.6589 5.34155 15.561C5.26338 15.4674 5.20001 15.3681 5.15332 15.2644C5.10802 15.1659 5.07431 15.0659 5.05371 14.9656C5.03361 14.8676 5.02297 14.7738 5.02295 14.6851C5.02295 14.5014 5.0798 14.3447 5.20898 14.2375L5.20972 14.2368L5.30493 14.1731C5.40409 14.1186 5.51594 14.0918 5.63745 14.0918C5.79553 14.0919 5.94175 14.1407 6.07251 14.2354L6.12451 14.2764C6.2216 14.3622 6.27861 14.4745 6.2959 14.6067L6.30103 14.6741L6.31055 14.7847C6.32502 14.8796 6.35383 14.9312 6.38306 14.9568C6.43071 14.9963 6.50789 15.0238 6.63135 15.0242C6.76743 15.0198 6.85874 14.9863 6.91772 14.9355L6.91846 14.9341L6.95361 14.8938C6.98575 14.8434 7.00924 14.7604 7.00928 14.6287C7.00928 14.4903 6.96843 14.3706 6.8877 14.2661L6.88696 14.2646C6.80068 14.1504 6.68858 14.0439 6.55078 13.946L6.55005 13.9453C6.40626 13.841 6.25592 13.7396 6.10034 13.6421C5.93262 13.5343 5.77326 13.4207 5.62427 13.303L5.62354 13.3022C5.46846 13.1772 5.34021 13.0351 5.24121 12.8752C5.13746 12.7076 5.0852 12.514 5.08008 12.2988V12.2388L5.0874 12.0505C5.10126 11.869 5.13388 11.7086 5.18628 11.5708V11.5693L5.2478 11.4382C5.31532 11.3136 5.40255 11.2077 5.51074 11.1233L5.62207 11.0464C5.73813 10.9764 5.87099 10.9263 6.01831 10.894C6.21201 10.8494 6.43196 10.8267 6.67603 10.8267H6.76831Z",fill:"currentColor"}),Se.createElement("path",{d:"M14.2266 10.8062C14.3565 10.8062 14.4736 10.8329 14.5693 10.8933L14.5701 10.8926L14.5715 10.894L14.5737 10.8948L14.573 10.8955C14.6342 10.9321 14.6895 10.9722 14.7363 11.0171L14.781 11.064L14.7825 11.0662L14.8235 11.1204C14.8363 11.1392 14.8492 11.159 14.8608 11.1797L14.9246 11.3159L14.9253 11.3181L15.9163 14.0024V11.4705C15.9163 11.2922 15.9461 11.1369 16.0159 11.0149L16.054 10.9607C16.1527 10.8467 16.3175 10.8062 16.5022 10.8062C16.7284 10.8062 16.9271 10.8532 17.0229 11.0017C17.1032 11.1237 17.1379 11.2847 17.1379 11.4705V15.0535C17.1379 15.21 17.1275 15.3541 17.1079 15.4849L17.1086 15.4856C17.0896 15.6273 17.0355 15.7491 16.9409 15.8408C16.837 15.9414 16.6806 15.9784 16.5022 15.9785H16.0356C15.8837 15.9785 15.7483 15.9422 15.6394 15.8606C15.5419 15.7874 15.4638 15.6974 15.4065 15.5911C15.3549 15.4953 15.3125 15.4018 15.2798 15.3113L14.3459 12.7815V15.3149C14.3459 15.4932 14.316 15.6489 14.2471 15.7727L14.2463 15.7734C14.158 15.9281 13.9711 15.9784 13.76 15.9785C13.53 15.9785 13.3292 15.9315 13.2312 15.783C13.151 15.6609 13.1169 15.5006 13.1169 15.3149V11.7319C13.117 11.575 13.126 11.4319 13.1433 11.3035V11.3013L13.166 11.1987C13.1955 11.1009 13.2454 11.0157 13.3176 10.9475L13.3594 10.9124C13.4627 10.8363 13.6027 10.8062 13.76 10.8062H14.2266Z",fill:"currentColor"}),Se.createElement("path",{d:"M3.62183 10.73C3.8058 10.73 3.96571 10.7696 4.07959 10.8677C4.185 10.9586 4.25306 11.0796 4.28613 11.2229C4.31675 11.3557 4.33154 11.5018 4.33154 11.6602V14.3606C4.33154 14.617 4.29481 14.8413 4.21655 15.0293C4.15993 15.1652 4.09098 15.286 4.00928 15.3896L3.92285 15.4878C3.80762 15.6056 3.67869 15.6971 3.5376 15.7625L3.53833 15.7632C3.40115 15.8269 3.27011 15.872 3.14722 15.8979L3.14795 15.8987C3.09669 15.9112 3.04501 15.9213 2.99414 15.9294L2.8418 15.9478C2.74998 15.9548 2.68156 15.9587 2.64111 15.9587C2.3706 15.9587 2.13396 15.928 1.93506 15.8643C1.73937 15.8022 1.56914 15.7204 1.42749 15.6174C1.28776 15.5158 1.17335 15.3984 1.08691 15.2651L1.02686 15.1685C0.970789 15.0715 0.926873 14.9732 0.895752 14.874L0.896484 14.8733C0.852315 14.745 0.821564 14.6203 0.806396 14.499L0.805664 14.4968C0.793555 14.3806 0.786621 14.2779 0.786621 14.1899C0.786659 14.0481 0.829716 13.9196 0.914062 13.8091C0.968035 13.7386 1.04873 13.6949 1.13965 13.6685C1.231 13.642 1.34202 13.6297 1.46851 13.6296C1.55651 13.6297 1.65224 13.6393 1.75415 13.6567C1.8653 13.6758 1.96539 13.7157 2.05151 13.7783C2.15785 13.853 2.20677 13.9666 2.20679 14.0977C2.20679 14.3421 2.24112 14.5246 2.302 14.6528L2.32178 14.6865C2.37332 14.7613 2.46833 14.8095 2.64111 14.8096C2.74386 14.8095 2.80532 14.7883 2.8396 14.762L2.84106 14.7605L2.90552 14.7019C2.92253 14.6822 2.9356 14.6623 2.94507 14.6426L2.97803 14.5518C2.98565 14.5209 2.98953 14.4889 2.99048 14.4565V11.9641H2.17236C2.0293 11.9641 1.8922 11.9536 1.76221 11.9312L1.76001 11.9304C1.62252 11.9035 1.50268 11.8482 1.40698 11.7612L1.40625 11.7598C1.30008 11.6602 1.25688 11.5177 1.25684 11.3547C1.25684 11.1882 1.29936 11.0419 1.40625 10.9417C1.49986 10.8517 1.6187 10.7951 1.75635 10.7681L1.9585 10.7395C2.02775 10.7333 2.09935 10.73 2.17236 10.73H3.62183Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.0061 10.8398C11.1058 10.8474 11.2146 10.8676 11.3313 10.8984L11.332 10.8977C11.4562 10.9275 11.5817 10.9747 11.7078 11.0376L11.803 11.0896C11.8653 11.1277 11.926 11.1727 11.9839 11.2244L12.0688 11.3071L12.0696 11.3079L12.1472 11.4001C12.2197 11.4965 12.2807 11.608 12.3303 11.7327L12.3772 11.8674C12.417 12.0081 12.4358 12.1667 12.4358 12.3406V14.4111C12.4358 14.649 12.4035 14.8579 12.3347 15.0337L12.334 15.0352C12.2654 15.204 12.1782 15.349 12.071 15.4666C11.9653 15.5823 11.8439 15.6747 11.7085 15.7412L11.7078 15.7405C11.5864 15.8034 11.4622 15.8534 11.335 15.8877C11.2172 15.9189 11.1066 15.9387 11.0061 15.9463C10.9136 15.9532 10.8413 15.9573 10.793 15.9573H10.675L10.4626 15.9463C10.362 15.9387 10.2518 15.919 10.1338 15.8877C10.0122 15.8554 9.8873 15.8055 9.75952 15.7405C9.62706 15.6742 9.50578 15.5832 9.39624 15.4688L9.39551 15.468C9.28579 15.3506 9.19561 15.2056 9.12451 15.0366L9.12378 15.0352C9.05226 14.8589 9.01835 14.6495 9.01831 14.4111V12.3406C9.01831 12.105 9.05259 11.8998 9.12451 11.7297C9.19368 11.5618 9.28389 11.4184 9.39697 11.3027C9.50677 11.1905 9.62826 11.1014 9.76099 11.0376C9.82393 11.0062 9.88688 10.9792 9.94849 10.957L9.94922 10.9563L10.1323 10.8992L10.1345 10.8984L10.3066 10.8604C10.3612 10.8506 10.4136 10.8436 10.4626 10.8398L10.675 10.8289H10.793C10.8413 10.8289 10.9136 10.8329 11.0061 10.8398ZM10.738 11.9473C10.6399 11.9473 10.5796 11.9688 10.5439 11.9963L10.5432 11.9971C10.4934 12.0354 10.4596 12.0746 10.4385 12.1135L10.4377 12.1143C10.4103 12.1641 10.3949 12.222 10.3931 12.2886V14.5393L10.4062 14.6309L10.4385 14.7151L10.4392 14.7158L10.481 14.7766C10.4976 14.7958 10.5181 14.8147 10.5417 14.833L10.5732 14.8521C10.6101 14.8689 10.6637 14.8806 10.738 14.8806C10.8345 14.8805 10.8925 14.8598 10.9255 14.8345C10.9743 14.7969 11.0075 14.7565 11.0288 14.7158C11.054 14.6605 11.0699 14.5993 11.0757 14.5327V12.2944L11.0588 12.197C11.051 12.167 11.0406 12.138 11.0281 12.1106C11.0069 12.0728 10.9738 12.0343 10.9255 11.9971L10.9233 11.9949C10.8905 11.9684 10.8335 11.9474 10.738 11.9473Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.574 1.50366C10.7457 1.52068 10.9072 1.59662 11.0303 1.71973L14.7803 5.46973C14.9209 5.61038 15 5.80109 15 6V9C15 9.41421 14.6642 9.75 14.25 9.75C13.8358 9.75 13.5 9.41421 13.5 9V6.75H11.25C10.8522 6.75 10.4708 6.59185 10.1895 6.31055C9.90815 6.02924 9.75 5.64783 9.75 5.25V3H5.25C5.05109 3 4.86038 3.07907 4.71973 3.21973C4.57907 3.36038 4.5 3.55109 4.5 3.75V9C4.5 9.41421 4.16421 9.75 3.75 9.75C3.33579 9.75 3 9.41421 3 9V3.75C3 3.15326 3.23722 2.58114 3.65918 2.15918C4.08114 1.73722 4.65326 1.5 5.25 1.5H10.5L10.574 1.50366ZM11.25 5.25H12.4395L11.25 4.06055V5.25Z",fill:"currentColor"})),W0=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.574 1.50366C10.7457 1.52068 10.9072 1.59662 11.0303 1.71973L14.7803 5.46973C14.9209 5.61038 15 5.80109 15 6V14.25C15 14.8467 14.7628 15.4189 14.3408 15.8408C13.9189 16.2628 13.3467 16.5 12.75 16.5H12C11.5858 16.5 11.25 16.1642 11.25 15.75C11.25 15.3358 11.5858 15 12 15H12.75C12.9489 15 13.1396 14.9209 13.2803 14.7803C13.4209 14.6396 13.5 14.4489 13.5 14.25V6.75H11.25C10.8522 6.75 10.4708 6.59185 10.1895 6.31055C9.90815 6.02924 9.75 5.64783 9.75 5.25V3H5.25C5.05109 3 4.86038 3.07907 4.71973 3.21973C4.57907 3.36038 4.5 3.55109 4.5 3.75V9C4.5 9.41421 4.16421 9.75 3.75 9.75C3.33579 9.75 3 9.41421 3 9V3.75C3 3.15326 3.23722 2.58114 3.65918 2.15918C4.08114 1.73722 4.65326 1.5 5.25 1.5H10.5L10.574 1.50366ZM11.25 5.25H12.4395L11.25 4.06055V5.25Z",fill:"currentColor"}),Se.createElement("path",{d:"M2.39355 10.5C2.53545 10.5 2.6592 10.5122 2.75757 10.5417C2.88987 10.5815 2.99161 10.6954 3.07251 10.8289L3.15747 10.9885L3.25195 11.2031L3.25269 11.2046L3.35229 11.4683C3.38786 11.5664 3.42601 11.6752 3.46655 11.7942L3.76318 12.6665L3.76392 12.6687L3.76904 12.6848L3.79907 12.5911L3.94849 12.1348C3.99515 11.9948 4.03674 11.8689 4.073 11.7576L4.07373 11.7561L4.1814 11.4434C4.21489 11.3495 4.24596 11.265 4.27515 11.1907L4.36084 10.9849C4.38855 10.9239 4.41584 10.8705 4.44214 10.8252C4.51581 10.6953 4.61188 10.5823 4.74243 10.5417H4.7439L4.82153 10.5227C4.90321 10.5069 4.99686 10.5 5.09985 10.5H5.67041C5.87137 10.5 6.05265 10.5425 6.17505 10.6619L6.17944 10.6655C6.29073 10.7714 6.35329 10.9108 6.375 11.072C6.39695 11.2133 6.40721 11.3701 6.40723 11.5415V15.5149C6.4072 15.7232 6.3696 15.9065 6.27686 16.0474C6.16065 16.2235 5.92578 16.2751 5.67041 16.2751C5.43573 16.2751 5.21924 16.2184 5.11157 16.0378L5.10938 16.0342C5.03005 15.8921 4.9966 15.7149 4.99658 15.5149V12.8335L4.4436 14.4456L4.44141 14.4521C4.39239 14.576 4.32667 14.6919 4.24658 14.8008L4.24731 14.8015C4.14341 14.9438 3.9882 15.008 3.80933 15.0081H3.73096C3.55351 15.008 3.40015 14.9437 3.29004 14.8081L3.28857 14.8066C3.20076 14.6954 3.13356 14.575 3.08862 14.4463L2.53564 12.8496V15.5149C2.53562 15.7149 2.50218 15.8921 2.42285 16.0342L2.42212 16.0356C2.31692 16.2193 2.09741 16.2751 1.86182 16.2751C1.60639 16.2751 1.37154 16.2236 1.25537 16.0474C1.16263 15.9065 1.12502 15.7232 1.125 15.5149V11.5415C1.12501 11.3697 1.13426 11.2129 1.15356 11.072L1.1543 11.0691L1.17993 10.9526C1.21308 10.8409 1.26884 10.7425 1.35059 10.6633L1.39966 10.6223C1.52082 10.5332 1.68333 10.5 1.86182 10.5H2.39355Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.1106 10.5C9.62746 10.5 10.0624 10.6251 10.4026 10.8875L10.5256 10.9944C10.6405 11.1071 10.7342 11.238 10.8062 11.3862C10.9039 11.5876 10.9497 11.8187 10.9497 12.074V14.4983C10.9497 14.7119 10.927 14.9051 10.8779 15.0754C10.8306 15.2398 10.7676 15.3875 10.689 15.5156L10.6875 15.5186C10.6079 15.6408 10.5165 15.7481 10.4143 15.8386C10.3155 15.9261 10.2132 15.9989 10.1074 16.0547L10.1067 16.054C9.86566 16.1854 9.58987 16.2585 9.28271 16.2751H7.97681C7.77408 16.2751 7.59145 16.2335 7.46704 16.1169C7.35471 16.0115 7.2898 15.8714 7.26489 15.7097C7.24266 15.5651 7.23194 15.4033 7.23193 15.2256V11.5415C7.23195 11.3663 7.2426 11.2069 7.26489 11.0647C7.28985 10.9032 7.35482 10.7635 7.46704 10.6582C7.59145 10.5416 7.77403 10.5 7.97681 10.5H9.1106ZM8.72095 15.0447H9.07544C9.15931 15.0426 9.23737 15.0225 9.31055 14.9839L9.31348 14.9817L9.35815 14.9553C9.40066 14.926 9.43743 14.8876 9.46802 14.8381L9.46875 14.8367L9.49438 14.7861C9.51748 14.7305 9.53172 14.6593 9.53174 14.5686V12.2615C9.53174 12.1256 9.50631 12.0248 9.46509 11.9517L9.46362 11.9495C9.42061 11.8696 9.36785 11.8162 9.30762 11.7825C9.25706 11.7542 9.19978 11.7342 9.1355 11.7231L9.06885 11.7151H8.72095V15.0447Z",fill:"currentColor"})),_0=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.6416 10.3784C3.95675 10.4068 4.24355 10.4808 4.49927 10.6033L4.68896 10.7058C4.75102 10.7437 4.81209 10.7853 4.87207 10.8303C4.99897 10.9227 5.10899 11.0375 5.20459 11.1724C5.30765 11.311 5.38613 11.4733 5.44116 11.6558L5.47998 11.8008C5.51306 11.9504 5.52903 12.1125 5.52905 12.2856C5.52905 12.6011 5.47828 12.8867 5.37305 13.1382L5.37378 13.1389C5.28434 13.3557 5.15787 13.5441 4.99512 13.7014L4.92334 13.7666C4.52343 14.1103 3.97203 14.269 3.2959 14.269H2.95166V15.4292C2.95165 15.614 2.93964 15.7845 2.91577 15.9397C2.8883 16.1182 2.81511 16.2739 2.68652 16.3909L2.68579 16.3901C2.54556 16.5202 2.34254 16.5645 2.12329 16.5645C1.90696 16.5644 1.70685 16.5194 1.56738 16.3887L1.56519 16.3865C1.44288 16.2679 1.37145 16.1152 1.34399 15.9404L1.34326 15.936C1.32257 15.7822 1.31251 15.613 1.3125 15.4292V11.5042C1.31251 11.3204 1.3225 11.1524 1.34326 11.001L1.34399 10.9973L1.37256 10.8691C1.40991 10.7455 1.47366 10.6362 1.56738 10.5483C1.70673 10.4148 1.90677 10.3689 2.12329 10.3689H3.50464L3.6416 10.3784ZM2.95166 12.9053H3.31787C3.43267 12.8984 3.53116 12.8714 3.61597 12.8269C3.69435 12.7857 3.75967 12.7244 3.81226 12.6387L3.84448 12.5728C3.8728 12.5 3.88989 12.4058 3.88989 12.2856C3.88984 12.1374 3.85971 12.0411 3.81812 11.9795L3.81519 11.9744C3.76419 11.8937 3.70357 11.8366 3.63428 11.7979C3.56584 11.7635 3.47692 11.7377 3.36328 11.7253H2.95166V12.9053Z",fill:"currentColor"}),Se.createElement("path",{d:"M9.85181 10.3689C9.96017 10.369 10.0701 10.3945 10.1792 10.4392L10.2876 10.4897L10.2935 10.4927L10.2993 10.4963C10.4209 10.5712 10.5226 10.6619 10.5879 10.7725C10.6503 10.8716 10.6882 10.9809 10.6882 11.0969C10.6882 11.1892 10.6526 11.2993 10.6077 11.4089L10.6069 11.4082C10.5828 11.4685 10.5524 11.5379 10.5154 11.6147C10.4774 11.6937 10.4326 11.7792 10.3813 11.8704L9.1582 14.0391V15.4373C9.1582 15.6164 9.14303 15.7853 9.11279 15.9426C9.07918 16.1138 9.00547 16.2635 8.88647 16.3799L8.88721 16.3806C8.75142 16.5164 8.5562 16.5644 8.34668 16.5645C8.13595 16.5644 7.94219 16.5154 7.80249 16.3843L7.80103 16.3828C7.68055 16.2661 7.60635 16.1157 7.57251 15.9434C7.54226 15.786 7.52783 15.6164 7.52783 15.4373V14.0398L6.12085 11.5283L6.11938 11.5261C6.0459 11.3891 6.00587 11.2453 6.00586 11.0969C6.00589 10.986 6.03681 10.8798 6.09155 10.7812L6.09302 10.7791L6.15015 10.6963C6.21492 10.6176 6.30071 10.5509 6.39771 10.4941L6.4043 10.4905L6.5127 10.4392C6.6213 10.3943 6.73162 10.369 6.84155 10.3689C7.06446 10.369 7.25232 10.4649 7.39307 10.6399L7.48096 10.752C7.5635 10.8656 7.6337 10.9873 7.69263 11.116L8.34668 12.4878L9.00073 11.116C9.07902 10.945 9.177 10.7867 9.29443 10.6421L9.29517 10.6414L9.35083 10.5791C9.48615 10.443 9.65571 10.3689 9.85181 10.3689Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.574 1.50366C10.7457 1.52068 10.9072 1.59662 11.0303 1.71973L14.7803 5.46973C14.9209 5.61038 15 5.80109 15 6V14.25C15 14.8467 14.7628 15.4189 14.3408 15.8408C13.9189 16.2628 13.3467 16.5 12.75 16.5H12C11.5858 16.5 11.25 16.1642 11.25 15.75C11.25 15.3358 11.5858 15 12 15H12.75C12.9489 15 13.1396 14.9209 13.2803 14.7803C13.4209 14.6396 13.5 14.4489 13.5 14.25V6.75H11.25C10.8522 6.75 10.4708 6.59185 10.1895 6.31055C9.90815 6.02924 9.75 5.64783 9.75 5.25V3H5.25C5.05109 3 4.86038 3.07907 4.71973 3.21973C4.57907 3.36038 4.5 3.55109 4.5 3.75V9C4.5 9.41421 4.16421 9.75 3.75 9.75C3.33579 9.75 3 9.41421 3 9V3.75C3 3.15326 3.23722 2.58114 3.65918 2.15918C4.08114 1.73722 4.65326 1.5 5.25 1.5H10.5L10.574 1.50366ZM11.25 5.25H12.4395L11.25 4.06055V5.25Z",fill:"currentColor"})),je=(e,t)=>f.jsx(e,{size:t.size??Y.size,stroke:t.stroke??Y.stroke,className:t.className}),po=(e,t)=>f.jsx(e,{width:Number(t.size??Y.size),height:Number(t.size??Y.size),className:t.className}),Oh={".bmp":e=>je(G.IconFileTypeBmp,e),".cpp":e=>po(H0,e),".c":e=>po(G0,e),".cs":e=>po(B0,e),".css":e=>je(G.IconFileTypeCss,e),".csv":e=>je(G.IconFileTypeCsv,e),".doc":e=>je(G.IconFileTypeDoc,e),".docx":e=>je(G.IconFileTypeDocx,e),".html":e=>je(G.IconFileTypeHtml,e),".ini":e=>po(V0,e),".jpg":e=>je(G.IconFileTypeJpg,e),".js":e=>je(G.IconFileTypeJs,e),".json":e=>po(z0,e),".jsx":e=>je(G.IconFileTypeJsx,e),".md":e=>po(W0,e),".pdf":e=>je(G.IconFileTypePdf,e),".php":e=>je(G.IconFileTypePhp,e),".png":e=>je(G.IconFileTypePng,e),".ppt":e=>je(G.IconFileTypePpt,e),".py":e=>po(_0,e),".rs":e=>je(G.IconFileTypeRs,e),".sql":e=>je(G.IconFileTypeSql,e),".svg":e=>je(G.IconFileTypeSvg,e),".ts":e=>je(G.IconFileTypeTs,e),".tsx":e=>je(G.IconFileTypeTsx,e),".txt":e=>je(G.IconFileTypeTxt,e),".vue":e=>je(G.IconFileTypeVue,e),".xls":e=>je(G.IconFileTypeXls,e),".xml":e=>je(G.IconFileTypeXml,e),".zip":e=>je(G.IconFileTypeZip,e),default:e=>je(G.IconFile,e)},iu=({extension:e,size:t=Y.size,stroke:s=Y.stroke,className:o,decorative:i=!1,label:n,indicator:r})=>{const a=(()=>{if(!e)return"";const u=e.trim().toLowerCase();return u.startsWith(".")?u:`.${u}`})(),c=(Oh[a]??Oh.default)({size:t,stroke:s}),d=typeof n=="string"?n:`${a.slice(1).toUpperCase()} file icon`;return f.jsxs("span",{className:ue("inline-flex relative",o),...i?{"aria-hidden":!0}:{role:"img","aria-label":d},children:[f.jsx($e,{icon:c,className:"inline-block align-middle"}),r&&f.jsx("span",{className:"absolute -bottom-0.5 -left-0.5",children:r})]})},Wn=({label:e="Shared entity",size:t=14,className:s,containerClassName:o,stroke:i=1.5,sharedIndicatorTooltip:n})=>f.jsx(yt,{tooltip:n||"Shared",children:f.jsx($e,{className:oe("text-accent-primary flex bg-layer-3",o),icon:f.jsx(G.IconArrowUpRight,{size:t,stroke:i,"aria-label":typeof e=="string"?e:void 0,className:s,role:"img"})})}),ll=({name:e,className:t,shared:s=!1,iconSize:o=Nt,details:i,sharedIndicatorClassName:n,sharedIndicatorTooltip:r,fileExtension:a,hideTooltip:l=!1,isInvalidName:c=!1,tooltipContent:d})=>{const u=a||(e.includes(".")?e.split(".").pop():void 0);return f.jsxs("div",{className:oe("flex items-center gap-2 w-full",t),children:[f.jsx(iu,{extension:u,size:o,className:"text-secondary",indicator:s?f.jsx(Wn,{className:n,sharedIndicatorTooltip:r}):null,label:"File type icon"}),f.jsxs("div",{className:ue(["w-full flex min-w-0",i&&"flex-col gap-1"]),children:[f.jsx(ht,{className:ue(["dial-small flex-1 min-w-0",c?"text-secondary":"text-primary"]),text:e,id:"name",hideTooltip:l,customTooltipContent:d}),i]})]})},cl=({name:e,className:t,shared:s=!1,loading:o=!1,iconSize:i=Nt,sharedIndicatorClassName:n,sharedIndicatorTooltip:r,hideTooltip:a=!1,isInvalidName:l=!1,tooltipContent:c})=>{const d=()=>o?f.jsx(nr,{size:i}):f.jsx($e,{icon:f.jsx(G.IconFolder,{...Y,size:i}),className:"inline-block align-middle"});return f.jsxs("div",{className:oe("flex items-center gap-2 w-full",t),children:[f.jsxs("span",{className:"inline-flex relative text-secondary",role:"img",children:[d(),s&&f.jsx("span",{className:"absolute z-50 -bottom-0.5 -left-0.5",children:f.jsx(Wn,{className:n,sharedIndicatorTooltip:r})})]}),f.jsx(ht,{className:ue("dial-small flex-1 min-w-0",l?"text-secondary":"text-primary"),text:e,id:"name",hideTooltip:a,customTooltipContent:c})]})};var _n=(e=>(e.Left="left",e.Right="right",e))(_n||{}),tt=function(){return tt=Object.assign||function(e){for(var t,s=1,o=arguments.length;s<o;s++){t=arguments[s];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},tt.apply(this,arguments)},Nh={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},Hh={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},jr={width:"20px",height:"20px",position:"absolute",zIndex:1},j0={top:tt(tt({},Nh),{top:"-5px"}),right:tt(tt({},Hh),{left:void 0,right:"-5px"}),bottom:tt(tt({},Nh),{top:void 0,bottom:"-5px"}),left:tt(tt({},Hh),{left:"-5px"}),topRight:tt(tt({},jr),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:tt(tt({},jr),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:tt(tt({},jr),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:tt(tt({},jr),{left:"-10px",top:"-10px",cursor:"nw-resize"})},U0=g.memo(function(e){var t=e.onResizeStart,s=e.direction,o=e.children,i=e.replaceStyles,n=e.className,r=g.useCallback(function(c){t(c,s)},[t,s]),a=g.useCallback(function(c){t(c,s)},[t,s]),l=g.useMemo(function(){return tt(tt({position:"absolute",userSelect:"none"},j0[s]),i??{})},[i,s]);return f.jsx("div",{className:n||void 0,style:l,onMouseDown:r,onTouchStart:a,children:o})}),$0=(function(){var e=function(t,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(o[n]=i[n])},e(t,s)};return function(t,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");e(t,s);function o(){this.constructor=t}t.prototype=s===null?Object.create(s):(o.prototype=s.prototype,new o)}})(),gs=function(){return gs=Object.assign||function(e){for(var t,s=1,o=arguments.length;s<o;s++){t=arguments[s];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},gs.apply(this,arguments)},q0={width:"auto",height:"auto"},Ur=function(e,t,s){return Math.max(Math.min(e,s),t)},Gh=function(e,t,s){var o=Math.round(e/t);return o*t+s*(o-1)},ci=function(e,t){return new RegExp(e,"i").test(t)},$r=function(e){return!!(e.touches&&e.touches.length)},K0=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},Bh=function(e,t,s){s===void 0&&(s=0);var o=t.reduce(function(n,r,a){return Math.abs(r-e)<Math.abs(t[n]-e)?a:n},0),i=Math.abs(t[o]-e);return s===0||i<s?t[o]:e},nc=function(e){return e=e.toString(),e==="auto"||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:"".concat(e,"px")},qr=function(e,t,s,o){if(e&&typeof e=="string"){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%")){var i=Number(e.replace("%",""))/100;return t*i}if(e.endsWith("vw")){var i=Number(e.replace("vw",""))/100;return s*i}if(e.endsWith("vh")){var i=Number(e.replace("vh",""))/100;return o*i}}return e},Y0=function(e,t,s,o,i,n,r){return o=qr(o,e.width,t,s),i=qr(i,e.height,t,s),n=qr(n,e.width,t,s),r=qr(r,e.height,t,s),{maxWidth:typeof o>"u"?void 0:Number(o),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof n>"u"?void 0:Number(n),minHeight:typeof r>"u"?void 0:Number(r)}},Z0=function(e){return Array.isArray(e)?e:[e,e]},X0=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],Vh="__resizable_base__",Q0=(function(e){$0(t,e);function t(s){var o,i,n,r,a=e.call(this,s)||this;return a.ratio=1,a.resizable=null,a.parentLeft=0,a.parentTop=0,a.resizableLeft=0,a.resizableRight=0,a.resizableTop=0,a.resizableBottom=0,a.targetLeft=0,a.targetTop=0,a.delta={width:0,height:0},a.appendBase=function(){if(!a.resizable||!a.window)return null;var l=a.parentNode;if(!l)return null;var c=a.window.document.createElement("div");return c.style.width="100%",c.style.height="100%",c.style.position="absolute",c.style.transform="scale(0, 0)",c.style.left="0",c.style.flex="0 0 100%",c.classList?c.classList.add(Vh):c.className+=Vh,l.appendChild(c),c},a.removeBase=function(l){var c=a.parentNode;c&&c.removeChild(l)},a.state={isResizing:!1,width:(i=(o=a.propsSize)===null||o===void 0?void 0:o.width)!==null&&i!==void 0?i:"auto",height:(r=(n=a.propsSize)===null||n===void 0?void 0:n.height)!==null&&r!==void 0?r:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},a.onResizeStart=a.onResizeStart.bind(a),a.onMouseMove=a.onMouseMove.bind(a),a.onMouseUp=a.onMouseUp.bind(a),a}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||q0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var s=0,o=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,n=this.resizable.offsetHeight,r=this.resizable.style.position;r!=="relative"&&(this.resizable.style.position="relative"),s=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,o=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:n,this.resizable.style.position=r}return{width:s,height:o}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var s=this,o=this.props.size,i=function(a){var l;if(typeof s.state[a]>"u"||s.state[a]==="auto")return"auto";if(s.propsSize&&s.propsSize[a]&&(!((l=s.propsSize[a])===null||l===void 0)&&l.toString().endsWith("%"))){if(s.state[a].toString().endsWith("%"))return s.state[a].toString();var c=s.getParentSize(),d=Number(s.state[a].toString().replace("px","")),u=d/c[a]*100;return"".concat(u,"%")}return nc(s.state[a])},n=o&&typeof o.width<"u"&&!this.state.isResizing?nc(o.width):i("width"),r=o&&typeof o.height<"u"&&!this.state.isResizing?nc(o.height):i("height");return{width:n,height:r}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var s=this.appendBase();if(!s)return{width:0,height:0};var o=!1,i=this.parentNode.style.flexWrap;i!=="wrap"&&(o=!0,this.parentNode.style.flexWrap="wrap"),s.style.position="relative",s.style.minWidth="100%",s.style.minHeight="100%";var n={width:s.offsetWidth,height:s.offsetHeight};return o&&(this.parentNode.style.flexWrap=i),this.removeBase(s),n},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var s=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:s.flexBasis!=="auto"?s.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(s,o){var i=this.propsSize&&this.propsSize[o];return this.state[o]==="auto"&&this.state.original[o]===s&&(typeof i>"u"||i==="auto")?"auto":s},t.prototype.calculateNewMaxFromBoundary=function(s,o){var i=this.props.boundsByDirection,n=this.state.direction,r=i&&ci("left",n),a=i&&ci("top",n),l,c;if(this.props.bounds==="parent"){var d=this.parentNode;d&&(l=r?this.resizableRight-this.parentLeft:d.offsetWidth+(this.parentLeft-this.resizableLeft),c=a?this.resizableBottom-this.parentTop:d.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=r?this.resizableRight:this.window.innerWidth-this.resizableLeft,c=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(l=r?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),c=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return l&&Number.isFinite(l)&&(s=s&&s<l?s:l),c&&Number.isFinite(c)&&(o=o&&o<c?o:c),{maxWidth:s,maxHeight:o}},t.prototype.calculateNewSizeFromDirection=function(s,o){var i=this.props.scale||1,n=Z0(this.props.resizeRatio||1),r=n[0],a=n[1],l=this.state,c=l.direction,d=l.original,u=this.props,h=u.lockAspectRatio,p=u.lockAspectRatioExtraHeight,m=u.lockAspectRatioExtraWidth,C=d.width,v=d.height,w=p||0,b=m||0;return ci("right",c)&&(C=d.width+(s-d.x)*r/i,h&&(v=(C-b)/this.ratio+w)),ci("left",c)&&(C=d.width-(s-d.x)*r/i,h&&(v=(C-b)/this.ratio+w)),ci("bottom",c)&&(v=d.height+(o-d.y)*a/i,h&&(C=(v-w)*this.ratio+b)),ci("top",c)&&(v=d.height-(o-d.y)*a/i,h&&(C=(v-w)*this.ratio+b)),{newWidth:C,newHeight:v}},t.prototype.calculateNewSizeFromAspectRatio=function(s,o,i,n){var r=this.props,a=r.lockAspectRatio,l=r.lockAspectRatioExtraHeight,c=r.lockAspectRatioExtraWidth,d=typeof n.width>"u"?10:n.width,u=typeof i.width>"u"||i.width<0?s:i.width,h=typeof n.height>"u"?10:n.height,p=typeof i.height>"u"||i.height<0?o:i.height,m=l||0,C=c||0;if(a){var v=(h-m)*this.ratio+C,w=(p-m)*this.ratio+C,b=(d-C)/this.ratio+m,S=(u-C)/this.ratio+m,x=Math.max(d,v),y=Math.min(u,w),F=Math.max(h,b),R=Math.min(p,S);s=Ur(s,x,y),o=Ur(o,F,R)}else s=Ur(s,d,u),o=Ur(o,h,p);return{newWidth:s,newHeight:o}},t.prototype.setBoundingClientRect=function(){var s=1/(this.props.scale||1);if(this.props.bounds==="parent"){var o=this.parentNode;if(o){var i=o.getBoundingClientRect();this.parentLeft=i.left*s,this.parentTop=i.top*s}}if(this.props.bounds&&typeof this.props.bounds!="string"){var n=this.props.bounds.getBoundingClientRect();this.targetLeft=n.left*s,this.targetTop=n.top*s}if(this.resizable){var r=this.resizable.getBoundingClientRect(),a=r.left,l=r.top,c=r.right,d=r.bottom;this.resizableLeft=a*s,this.resizableRight=c*s,this.resizableTop=l*s,this.resizableBottom=d*s}},t.prototype.onResizeStart=function(s,o){if(!(!this.resizable||!this.window)){var i=0,n=0;if(s.nativeEvent&&K0(s.nativeEvent)?(i=s.nativeEvent.clientX,n=s.nativeEvent.clientY):s.nativeEvent&&$r(s.nativeEvent)&&(i=s.nativeEvent.touches[0].clientX,n=s.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var r=this.props.onResizeStart(s,o,this.resizable);if(r===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var a,l=this.window.getComputedStyle(this.resizable);if(l.flexBasis!=="auto"){var c=this.parentNode;if(c){var d=this.window.getComputedStyle(c).flexDirection;this.flexDir=d.startsWith("row")?"row":"column",a=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var u={original:{x:i,y:n,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:gs(gs({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(s.target).cursor||"auto"}),direction:o,flexBasis:a};this.setState(u)}},t.prototype.onMouseMove=function(s){var o=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&$r(s))try{s.preventDefault(),s.stopPropagation()}catch{}var i=this.props,n=i.maxWidth,r=i.maxHeight,a=i.minWidth,l=i.minHeight,c=$r(s)?s.touches[0].clientX:s.clientX,d=$r(s)?s.touches[0].clientY:s.clientY,u=this.state,h=u.direction,p=u.original,m=u.width,C=u.height,v=this.getParentSize(),w=Y0(v,this.window.innerWidth,this.window.innerHeight,n,r,a,l);n=w.maxWidth,r=w.maxHeight,a=w.minWidth,l=w.minHeight;var b=this.calculateNewSizeFromDirection(c,d),S=b.newHeight,x=b.newWidth,y=this.calculateNewMaxFromBoundary(n,r);this.props.snap&&this.props.snap.x&&(x=Bh(x,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(S=Bh(S,this.props.snap.y,this.props.snapGap));var F=this.calculateNewSizeFromAspectRatio(x,S,{width:y.maxWidth,height:y.maxHeight},{width:a,height:l});if(x=F.newWidth,S=F.newHeight,this.props.grid){var R=Gh(x,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),E=Gh(S,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),D=this.props.snapGap||0,P=D===0||Math.abs(R-x)<=D?R:x,T=D===0||Math.abs(E-S)<=D?E:S;x=P,S=T}var M={width:x-p.width,height:S-p.height};if(this.delta=M,m&&typeof m=="string"){if(m.endsWith("%")){var k=x/v.width*100;x="".concat(k,"%")}else if(m.endsWith("vw")){var N=x/this.window.innerWidth*100;x="".concat(N,"vw")}else if(m.endsWith("vh")){var A=x/this.window.innerHeight*100;x="".concat(A,"vh")}}if(C&&typeof C=="string"){if(C.endsWith("%")){var k=S/v.height*100;S="".concat(k,"%")}else if(C.endsWith("vw")){var N=S/this.window.innerWidth*100;S="".concat(N,"vw")}else if(C.endsWith("vh")){var A=S/this.window.innerHeight*100;S="".concat(A,"vh")}}var W={width:this.createSizeForCssProperty(x,"width"),height:this.createSizeForCssProperty(S,"height")};this.flexDir==="row"?W.flexBasis=W.width:this.flexDir==="column"&&(W.flexBasis=W.height);var U=this.state.width!==W.width,L=this.state.height!==W.height,de=this.state.flexBasis!==W.flexBasis,H=U||L||de;H&&zi.flushSync(function(){o.setState(W)}),this.props.onResize&&H&&this.props.onResize(s,h,this.resizable,M)}},t.prototype.onMouseUp=function(s){var o,i,n=this.state,r=n.isResizing,a=n.direction;n.original,!(!r||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(s,a,this.resizable,this.delta),this.props.size&&this.setState({width:(o=this.props.size.width)!==null&&o!==void 0?o:"auto",height:(i=this.props.size.height)!==null&&i!==void 0?i:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:gs(gs({},this.state.backgroundStyle),{cursor:"auto"})}))},t.prototype.updateSize=function(s){var o,i;this.setState({width:(o=s.width)!==null&&o!==void 0?o:"auto",height:(i=s.height)!==null&&i!==void 0?i:"auto"})},t.prototype.renderResizer=function(){var s=this,o=this.props,i=o.enable,n=o.handleStyles,r=o.handleClasses,a=o.handleWrapperStyle,l=o.handleWrapperClass,c=o.handleComponent;if(!i)return null;var d=Object.keys(i).map(function(u){return i[u]!==!1?f.jsx(U0,{direction:u,onResizeStart:s.onResizeStart,replaceStyles:n&&n[u],className:r&&r[u],children:c&&c[u]?c[u]:null},u):null});return f.jsx("div",{className:l,style:a,children:d})},t.prototype.render=function(){var s=this,o=Object.keys(this.props).reduce(function(r,a){return X0.indexOf(a)!==-1||(r[a]=s.props[a]),r},{}),i=gs(gs(gs({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var n=this.props.as||"div";return f.jsxs(n,gs({style:i,className:this.props.className},o,{ref:function(r){r&&(s.resizable=r)},children:[this.state.isResizing&&f.jsx("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t})(g.PureComponent);const J0=({side:e,className:t})=>{const s=e===_n.Left,o=s?G.IconChevronLeft:G.IconChevronRight;return f.jsx("div",{className:t,children:f.jsx(o,{className:ue("h-full",s&&"-ml-6")})})},eS=({side:e,isResizing:t,customHandler:s,handlerClassName:o})=>{const i=oe("invisible h-full w-0.5 group-hover:visible bg-accent-primary text-accent-primary cursor-col-resize transition-opacity",t&&"visible",o),n=f.jsx(J0,{side:e,className:i});return s?f.jsx("div",{className:i,children:s}):n},sf=({children:e,minWidth:t,maxWidth:s,width:o,defaultWidth:i,onResizeStop:n,onResize:r,side:a=_n.Right,resizeHandlerClassName:l,resizeHandler:c})=>{const[d,u]=g.useState(!1),[h,p]=g.useState(i),m=o!==void 0,C=m?o:h,v=g.useRef(null),w=g.useCallback(()=>{u(!0)},[]),b=g.useCallback(()=>{u(!1);const x=v.current?.resizable?.getBoundingClientRect(),y=x?Math.round(x.width):t;m||p(y),n?.(y)},[n,m,t]),S=g.useMemo(()=>{const x=a===_n.Left,y=f.jsx(eS,{side:a,isResizing:d,customHandler:c,handlerClassName:l});return{size:m?{width:C,height:"100%"}:void 0,defaultSize:m?void 0:{width:C,height:"100%"},minWidth:t,maxWidth:s,enable:{left:x,right:!x},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:x?y:void 0,right:x?void 0:y},onResizeStart:w,onResize:(F,R,E)=>{const D=Math.round(E.offsetWidth);r?.(D)},onResizeStop:b}},[a,m,C,t,s,c,l,d,w,b,r]);return f.jsx(Q0,{ref:v,...S,children:f.jsx("div",{className:"group flex size-full flex-col bg-layer-3 divide-y divide-tertiary transition-all",children:e})})},of=({enabled:e=!0,children:t,...s})=>e?f.jsx(sf,{...s,children:t}):t;var Xt=(e=>(e.Default="default",e.Text="text",e.Circular="circular",e.Rectangular="rectangular",e))(Xt||{}),Tn=(e=>(e.Small="small",e.Default="default",e.Large="large",e))(Tn||{}),Ea=(e=>(e.Circle="circle",e.Square="square",e))(Ea||{});const tS=e=>{if(typeof e=="number")return e;switch(e){case Tn.Small:return 32;case Tn.Large:return 64;case Tn.Default:default:return 40}},pi=({active:e=!0,paragraph:t=!0,avatar:s=!1,showTitle:o=!0,loading:i=!0,children:n,variant:r=Xt.Default,width:a,height:l,className:c,...d})=>{if(!i&&n)return f.jsx(f.Fragment,{children:n});const u=oe("bg-layer-3",e&&"animate-pulse",c);if(r!==Xt.Default){const E=oe(u,r===Xt.Circular&&"rounded-full",r===Xt.Rectangular&&"rounded",r===Xt.Text&&"rounded"),D={};return a&&(D.width=typeof a=="number"?`${a}px`:a),l&&(D.height=typeof l=="number"?`${l}px`:l),f.jsx("div",{className:E,style:D,...d})}const h=!!s,p=!!o,m=!!t,C=typeof s=="object"?s:{},v=typeof o=="object"?o:{},w=typeof t=="object"?t:{},b=tS(C.size),S=C.shape??Ea.Circle,x=v.width??"38%",y=w.rows??3,F=w.width,R=E=>F?Array.isArray(F)?F[E]??"100%":F:E===y-1?"61%":"100%";return f.jsxs("div",{...d,className:oe("flex gap-4",c),children:[h&&f.jsx("div",{className:oe(u,S===Ea.Circle?"rounded-full":"rounded","flex-shrink-0"),style:{width:b,height:b}}),f.jsxs("div",{className:"flex-1 flex flex-col gap-3",children:[p&&f.jsx("div",{className:oe(u,"h-4 rounded"),style:{width:x}}),m&&f.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:y}).map((E,D)=>f.jsx("div",{className:oe(u,"h-4 rounded"),style:{width:R(D)}},D))})]})]})};var Io=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,s){const o=t?this.allAsyncListeners:this.allSyncListeners;let i=o.get(e);return!i&&s&&(i=new Set,o.set(e,i)),i}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,s=!1){this.getListeners(e,s,!0).add(t)}removeEventListener(e,t,s=!1){const o=this.getListeners(e,s,!1);o&&(o.delete(t),o.size===0&&(s?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){this.getGlobalListeners(t).add(e)}removeGlobalListener(e,t=!1){this.getGlobalListeners(t).delete(e)}dispatchEvent(e){this.dispatchToListeners(e,!0),this.dispatchToListeners(e,!1),this.firedEvents[e.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const s=e.type;if(t&&"event"in e){const a=e.event;a instanceof Event&&(e.eventPath=a.composedPath())}const{frameworkOverrides:o}=this,i=a=>{const l=o?()=>o.wrapIncoming(a):a;t?this.dispatchAsync(l):l()},n=this.getListeners(s,t,!1);if((n?.size??0)>0){const a=new Set(n);for(const l of a)n?.has(l)&&i(()=>l(e))}const r=this.getGlobalListeners(t);if(r.size>0){const a=new Set(r);for(const l of a)i(()=>l(s,e))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(const t of e)t()}};function ks(e){return e==null||e===""?null:e}function X(e){return e!=null&&e!==""}function qe(e){return!X(e)}function cd(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function jn(e,t){const s=e?JSON.stringify(e):null,o=t?JSON.stringify(t):null;return s===o}function sS(e,t,s=!1){const o=e==null,i=t==null;if(e?.toNumber&&(e=e.toNumber()),t?.toNumber&&(t=t.toNumber()),o&&i)return 0;if(o)return-1;if(i)return 1;function n(r,a){return r>a?1:r<a?-1:0}if(typeof e!="string"||!s)return n(e,t);try{return e.localeCompare(t)}catch{return n(e,t)}}var oS=/[&<>"']/g,iS={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Ui(e){return e?.toString().toString()??null}function Mn(e){return Ui(e)?.replace(oS,t=>iS[t])??null}function os(e){return e.eRootDiv.getRootNode()}function Ze(e){return os(e).activeElement}function dt(e){const{gos:t,eRootDiv:s}=e;let o=null;const i=t.get("getDocument");return i&&X(i)?o=i():s&&(o=s.ownerDocument),o&&X(o)?o:document}function nf(e){const t=Ze(e);return t===null||t===dt(e).body}function rf(e){return dt(e).defaultView||window}function nu(e){let t=null,s=null;try{t=dt(e).fullscreenElement}catch{}finally{t||(t=os(e));const o=t.querySelector("body");o?s=o:t instanceof ShadowRoot?s=t:t instanceof Document?s=t?.documentElement:s=t}return s}function nS(e){return nu(e)?.clientWidth??(window.innerWidth||-1)}function rS(e){return nu(e)?.clientHeight??(window.innerHeight||-1)}function ls(e,t,s){s==null||typeof s=="string"&&s==""?af(e,t):cs(e,t,s)}function cs(e,t,s){e.setAttribute(lf(t),s.toString())}function af(e,t){e.removeAttribute(lf(t))}function lf(e){return`aria-${e}`}function ko(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function aS(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function lS(e){return e.getAttribute("aria-label")}function Ai(e,t){ls(e,"label",t)}function Un(e,t){ls(e,"labelledby",t)}function cf(e,t){ls(e,"live",t)}function cS(e,t){ls(e,"atomic",t)}function dS(e,t){ls(e,"relevant",t)}function uS(e,t){ls(e,"invalid",t)}function hS(e,t){ls(e,"disabled",t)}function df(e,t){ls(e,"hidden",t)}function dd(e,t){cs(e,"expanded",t)}function gS(e,t){cs(e,"setsize",t)}function pS(e,t){cs(e,"posinset",t)}function fS(e,t){cs(e,"rowcount",t)}function uf(e,t){cs(e,"rowindex",t)}function mS(e,t){cs(e,"rowspan",t)}function CS(e,t){cs(e,"colcount",t)}function hf(e,t){cs(e,"colindex",t)}function vS(e,t){cs(e,"colspan",t)}function wS(e,t){cs(e,"sort",t)}function bS(e){af(e,"sort")}function gf(e,t){ls(e,"selected",t)}function SS(e,t){ls(e,"controls",t)}function yS(e,t){SS(e,t.id),Un(t,e.id)}function zh(e,t){ls(e,"owns",t)}function dl(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var xS="[tabindex], input, select, button, textarea, [href]",pf="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function In(e){return!e||!e.matches("input, select, button, textarea")||!e.matches(pf)?!1:Hs(e)}function Ye(e,t,s={}){const{skipAriaHidden:o}=s;e.classList.toggle("ag-hidden",!t),o||df(e,!t)}function RS(e,t,s={}){const{skipAriaHidden:o}=s;e.classList.toggle("ag-invisible",!t),o||df(e,!t)}function $n(e,t){const s="disabled",o=t?n=>n.setAttribute(s,""):n=>n.removeAttribute(s);o(e);const i=e.querySelectorAll("input")??[];for(const n of i)o(n)}function yo(e,t,s){let o=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof s=="number"){if(++o>s)break}else if(e===s)break}return!1}function Vo(e){const{height:t,width:s,borderTopWidth:o,borderRightWidth:i,borderBottomWidth:n,borderLeftWidth:r,paddingTop:a,paddingRight:l,paddingBottom:c,paddingLeft:d,marginTop:u,marginRight:h,marginBottom:p,marginLeft:m,boxSizing:C}=window.getComputedStyle(e),v=Number.parseFloat;return{height:v(t||"0"),width:v(s||"0"),borderTopWidth:v(o||"0"),borderRightWidth:v(i||"0"),borderBottomWidth:v(n||"0"),borderLeftWidth:v(r||"0"),paddingTop:v(a||"0"),paddingRight:v(l||"0"),paddingBottom:v(c||"0"),paddingLeft:v(d||"0"),marginTop:v(u||"0"),marginRight:v(h||"0"),marginBottom:v(p||"0"),marginLeft:v(m||"0"),boxSizing:C}}function ru(e){const t=Vo(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function qn(e){const t=Vo(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function ff(e){const{height:t,marginBottom:s,marginTop:o}=Vo(e);return Math.floor(t+s+o)}function Da(e){const{width:t,marginLeft:s,marginRight:o}=Vo(e);return Math.floor(t+s+o)}function mf(e){const t=e.getBoundingClientRect(),{borderTopWidth:s,borderLeftWidth:o,borderRightWidth:i,borderBottomWidth:n}=Vo(e);return{top:t.top+(s||0),left:t.left+(o||0),right:t.right+(i||0),bottom:t.bottom+(n||0)}}function Pa(e,t){let s=e.scrollLeft;return t&&(s=Math.abs(s)),s}function Ta(e,t,s){s&&(t*=-1),e.scrollLeft=t}function Mt(e){for(;e?.firstChild;)e.firstChild.remove()}function eo(e){e?.parentNode&&e.remove()}function Cf(e){return!!e.offsetParent}function Hs(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!Cf(e)||window.getComputedStyle(e).visibility!=="visible")}function au(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function ca(e){return()=>{const t=e();return t?lu(t)||vf(t):!0}}function lu(e){return e.clientWidth<e.scrollWidth}function vf(e){return e.clientHeight<e.scrollHeight}function Ma(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):vs(e,t)}function vs(e,t){t=cu(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function kn(e,t){t=cu(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function cu(e){return typeof e=="number"?`${e}px`:e}function du(e){return e instanceof Node||e instanceof HTMLElement}function Bt(e,t,s){s==null||s===""?e.removeAttribute(t):e.setAttribute(t,s.toString())}function Gs(e,t,s){const i=rf(e).ResizeObserver,n=i?new i(s):null;return n?.observe(t),()=>n?.disconnect()}function Bs(e,t){const s=rf(e);s.requestAnimationFrame?s.requestAnimationFrame(t):s.webkitRequestAnimationFrame?s.webkitRequestAnimationFrame(t):s.setTimeout(t,0)}var wf="data-ref",rc;function Wh(){return rc??(rc=document.createTextNode(" ")),rc.cloneNode()}function ar(e){const{attrs:t,children:s,cls:o,ref:i,role:n,tag:r}=e,a=document.createElement(r);if(o&&(a.className=o),i&&a.setAttribute(wf,i),n&&a.setAttribute("role",n),t)for(const l of Object.keys(t))a.setAttribute(l,t[l]);if(s)if(typeof s=="string")a.textContent=s;else{let l=!0;for(const c of s)c&&(typeof c=="string"?(a.appendChild(document.createTextNode(c)),l=!1):typeof c=="function"?a.appendChild(c()):(l&&(a.appendChild(Wh()),l=!1),a.append(ar(c)),a.appendChild(Wh())))}return a}var FS=["touchstart","touchend","touchmove","touchcancel","scroll"],ES=["wheel"],ac={},bf=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return s=>{if(typeof ac[s]=="boolean")return ac[s];const o=document.createElement(e[s]||"div");return s="on"+s,ac[s]=s in o}})();function DS(e,t){return!t||!e?!1:TS(t).indexOf(e)>=0}function PS(e){const t=[];let s=e.target;for(;s;)t.push(s),s=s.parentElement;return t}function TS(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():PS(t)}function MS(e,t,s){const o=IS(t);let i;o!=null&&(i={passive:o}),e.addEventListener(t,s,i)}var IS=e=>{const t=FS.includes(e),s=ES.includes(e);if(t)return!0;if(s)return!1};function Sf(e,t,s){if(s===0)return!1;const o=Math.abs(e.clientX-t.clientX),i=Math.abs(e.clientY-t.clientY);return Math.max(o,i)<=s}var An=(e,t)=>{const s=e.identifier;for(let o=0,i=t.length;o<i;++o){const n=t[o];if(n.identifier===s)return n}return null};function Kn(e,t){return e.gos.isElementInThisInstance(t.target)}function kS(e,t,s){const i=e.getBoundingClientRect().height,n=nS(s)-2,r=rS(s)-2;if(!e.offsetParent)return;const l=mf(e.offsetParent),{clientY:c,clientX:d}=t;let u=c-l.top-i/2,h=d-l.left-10;const p=dt(s),m=p.defaultView||window,C=m.pageYOffset||p.documentElement.scrollTop,v=m.pageXOffset||p.documentElement.scrollLeft;n>0&&h+e.clientWidth>n+v&&(h=n+v-e.clientWidth),h<0&&(h=0),r>0&&u+e.clientHeight>r+C&&(u=r+C-e.clientHeight),u<0&&(u=0),e.style.left=`${h}px`,e.style.top=`${u}px`}var da=(e,...t)=>{for(const s of t){const[o,i,n,r]=s;o.addEventListener(i,n,r),e.push(s)}},uu=e=>{if(e){for(const[t,s,o,i]of e)t.removeEventListener(s,o,i);e.length=0}},Ks=e=>{e.cancelable&&e.preventDefault()};function AS(e,t){return t}function yf(e){return e?.getLocaleTextFunc()??AS}function LS(e,t,s,o){const i=t[s];return e.getLocaleTextFunc()(s,typeof i=="function"?i(o):i,o)}function OS(e){return(t,s,o)=>e({key:t,defaultValue:s,variableValues:o})}function NS(e){return(t,s,o)=>{let i=e?.[t];if(i&&o?.length){let n=0;for(;!(n>=o.length||i.indexOf("${variable}")===-1);)i=i.replace("${variable}",o[n++])}return i??s}}var xs=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.beans=e,this.stubContext=e.context,this.eventSvc=e.eventSvc,this.gos=e.gos}destroy(){const{destroyFunctions:e}=this;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t,s){this.localEventService||(this.localEventService=new Io),this.localEventService.addEventListener(e,t,s)}removeEventListener(e,t,s){this.localEventService?.removeEventListener(e,t,s)}dispatchLocalEvent(e){this.localEventService?.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventSvc,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const s=[];for(const o of Object.keys(t)){const i=t[o];i&&s.push(this._setupListener(e,o,i))}return s}_setupListener(e,t,s){if(this.destroyed)return()=>null;let o;if(HS(e))e.__addEventListener(t,s),o=()=>(e.__removeEventListener(t,s),null);else{const i=GS(e);e instanceof HTMLElement?MS(e,t,s):i?e.addListener(t,s):e.addEventListener(t,s),o=i?()=>(e.removeListener(t,s),null):()=>(e.removeEventListener(t,s),null)}return this.destroyFunctions.push(o),()=>(o(),this.destroyFunctions=this.destroyFunctions.filter(i=>i!==o),null)}setupPropertyListener(e,t){const{gos:s}=this;s.addPropertyEventListener(e,t);const o=()=>(s.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(o),()=>(o(),this.destroyFunctions=this.destroyFunctions.filter(i=>i!==o),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const s=e.join("-")+this.propertyListenerId++,o=i=>{if(i.changeSet){if(i.changeSet&&i.changeSet.id===this.lastChangeSetIdLookup[s])return;this.lastChangeSetIdLookup[s]=i.changeSet.id}const n={type:"propertyChanged",changeSet:i.changeSet,source:i.source};t(n)};for(const i of e)this.setupPropertyListener(i,o)}getLocaleTextFunc(){return yf(this.beans.localeSvc)}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const s=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),s}createBean(e,t,s){return(t||this.stubContext).createBean(e,s)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function HS(e){return e.__addEventListener!==void 0}function GS(e){return e.eventServiceType==="global"}var O=class extends xs{},_h={};function hu(e,t){_h[t]||(e(),_h[t]=!0)}var BS={pending:!1,funcs:[]},VS={pending:!1,funcs:[]};function ud(e,t="setTimeout",s){const o=t==="raf"?VS:BS;if(o.funcs.push(e),o.pending)return;o.pending=!0;const i=()=>{const n=o.funcs.slice();o.funcs.length=0,o.pending=!1;for(const r of n)r()};t==="raf"?Bs(s,i):window.setTimeout(i,0)}function lt(e,t,s){let o;return function(...i){const n=this;window.clearTimeout(o),o=window.setTimeout(function(){e.isAlive()&&t.apply(n,i)},s)}}function jh(e,t){let s=0;return function(...o){const i=this,n=Date.now();n-s<t||(s=n,e.apply(i,o))}}function zS(e,t,s,o=100){const i=Date.now();let n=null,r=!1;const a=()=>{n!=null&&(window.clearInterval(n),n=null)};e.addDestroyFunc(a);const l=()=>{const c=Date.now()-i>o;(t()||c)&&(s(),r=!0,a())};l(),r||(n=window.setInterval(l,10))}var xf=new Set(["__proto__","constructor","prototype"]);function WS(e,t){if(e!=null){if(Array.isArray(e)){for(let s=0;s<e.length;s++)t(s.toString(),e[s]);return}for(const s of Object.keys(e).filter(o=>!xf.has(o)))t(s,e[s])}}function St(e,t,s=!0,o=!1){X(t)&&WS(t,(i,n)=>{let r=e[i];r!==n&&(o&&r==null&&n!=null&&typeof n=="object"&&n.constructor===Object&&(r={},e[i]=r),Uh(n)&&Uh(r)&&!Array.isArray(r)?St(r,n,s,o):(s||n!==void 0)&&(e[i]=n))})}function Uh(e){return typeof e=="object"&&e!==null}var gu=class Ps{static applyGlobalGridOptions(t){if(!Ps.gridOptions)return{...t};let s={};return St(s,Ps.gridOptions,!0,!0),Ps.mergeStrategy==="deep"?St(s,t,!0,!0):s={...s,...t},Ps.gridOptions.context&&(s.context=Ps.gridOptions.context),t.context&&(Ps.mergeStrategy==="deep"&&s.context&&St(t.context,s.context,!0,!0),s.context=t.context),s}static applyGlobalGridOption(t,s){if(Ps.mergeStrategy==="deep"){const o=Rf(t);if(o&&typeof o=="object"&&typeof s=="object")return Ps.applyGlobalGridOptions({[t]:s})[t]}return s}};gu.gridOptions=void 0;gu.mergeStrategy="shallow";var pu=gu;function Rf(e){return pu.gridOptions?.[e]}var Ff={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,rowNumbers:!1,enableFilterHandlers:!1},Ef="https://www.ag-grid.com";function Ao(e,t,...s){e.get("debug")&&console.log("AG Grid: "+t,...s)}function Ln(e,...t){hu(()=>console.warn("AG Grid: "+e,...t),e+t?.join(""))}function bi(e,...t){hu(()=>console.error("AG Grid: "+e,...t),e+t?.join(""))}var Df=new Set,Ia={},xo={},ua,Pf=!1,Tf=!1,_S=!1;function jS(e){const[t,s]=e.version.split(".")||[],[o,i]=ua.split(".")||[];return t===o&&s===i}function US(e){ua||(ua=e.version);const t=o=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${o} Please update all modules to the same version.`;e.version?jS(e)||bi(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${ua}.`)):bi(t(`'${e.moduleName}' is incompatible.`));const s=e.validate?.();s&&!s.isValid&&bi(`${s.message}`)}function Yn(e,t,s=!1){s||(Pf=!0),US(e);const o=e.rowModels??["all"];Df.add(e);let i;t!==void 0?(Tf=!0,xo[t]===void 0&&(xo[t]={}),i=xo[t]):i=Ia;for(const n of o)i[n]===void 0&&(i[n]={}),i[n][e.moduleName]=e;if(e.dependsOn)for(const n of e.dependsOn)Yn(n,t,s)}function $S(e){delete xo[e]}function hd(e,t,s){const o=i=>!!Ia[i]?.[e]||!!xo[t]?.[i]?.[e];return o(s)||o("all")}function fu(){return Tf}function qS(e,t){const s=xo[e]??{};return[...Object.values(Ia.all??{}),...Object.values(s.all??{}),...Object.values(Ia[t]??{}),...Object.values(s[t]??{})]}function KS(){return new Set(Df)}function YS(e,t){const s=xo[e]??{};return[...Object.values(s.all??{}),...Object.values(s[t]??{})]}function ZS(){return Pf}function XS(){return _S}var Mf=class{static register(e){Yn(e,void 0)}static registerModules(e){for(const t of e)Yn(t,void 0)}},Z="34.3.0",$h=2e3,qh=100,If="_version_",kf=null,Si=`${Ef}/javascript-data-grid`;function QS(e){kf=e}function JS(e){Si=e}function Af(e,t,s){return kf?.(e,t)??[oy(e,t,s)]}function mu(e,t,s,o,i){e(`${o?"warning":"error"} #${t}`,...Af(t,s,i))}function ey(e){if(!e)return String(e);const t={};for(const s of Object.keys(e))typeof e[s]!="object"&&typeof e[s]!="function"&&(t[s]=e[s]);return JSON.stringify(t)}function ty(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=ey(e)),t}function ka(e){return e===void 0?"undefined":e===null?"null":e}function gd(e,t){return`${e}?${t.toString()}`}function sy(e,t,s){const o=Array.from(t.entries()).sort((n,r)=>r[1].length-n[1].length);let i=gd(e,t);for(const[n,r]of o){if(n===If)continue;const a=i.length-s;if(a<=0)break;const l="...",c=a+l.length,d=r.length-c>qh?r.slice(0,r.length-c)+l:r.slice(0,qh)+l;t.set(n,d),i=gd(e,t)}return i}function Lf(e,t){const s=new URLSearchParams;if(s.append(If,Z),t)for(const n of Object.keys(t))s.append(n,ty(t[n]));const o=`${Si}/errors/${e}`,i=gd(o,s);return i.length<=$h?i:sy(o,s,$h)}var oy=(e,t,s)=>{const o=Lf(e,t);return`${`${s?s+`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),ue=require("classnames"),G=require("@tabler/icons-react"),Ie=require("@floating-ui/react"),g=require("react"),zi=require("react-dom");function Mw(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const Se=Mw(g),$d="-",Iw=e=>{const t=Aw(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:r=>{const a=r.split($d);return a[0]===""&&a.length!==1&&a.shift(),Tp(a,t)||kw(r)},getConflictingClassGroupIds:(r,a)=>{const l=s[r]||[];return a&&o[r]?[...l,...o[r]]:l}}},Tp=(e,t)=>{if(e.length===0)return t.classGroupId;const s=e[0],o=t.nextPart.get(s),i=o?Tp(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;const n=e.join($d);return t.validators.find(({validator:r})=>r(n))?.classGroupId},vh=/^\[(.+)\]$/,kw=e=>{if(vh.test(e)){const t=vh.exec(e)[1],s=t?.substring(0,t.indexOf(":"));if(s)return"arbitrary.."+s}},Aw=e=>{const{theme:t,classGroups:s}=e,o={nextPart:new Map,validators:[]};for(const i in s)ed(s[i],o,i,t);return o},ed=(e,t,s,o)=>{e.forEach(i=>{if(typeof i=="string"){const n=i===""?t:wh(t,i);n.classGroupId=s;return}if(typeof i=="function"){if(Lw(i)){ed(i(o),t,s,o);return}t.validators.push({validator:i,classGroupId:s});return}Object.entries(i).forEach(([n,r])=>{ed(r,wh(t,n),s,o)})})},wh=(e,t)=>{let s=e;return t.split($d).forEach(o=>{s.nextPart.has(o)||s.nextPart.set(o,{nextPart:new Map,validators:[]}),s=s.nextPart.get(o)}),s},Lw=e=>e.isThemeGetter,Ow=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=new Map,o=new Map;const i=(n,r)=>{s.set(n,r),t++,t>e&&(t=0,o=s,s=new Map)};return{get(n){let r=s.get(n);if(r!==void 0)return r;if((r=o.get(n))!==void 0)return i(n,r),r},set(n,r){s.has(n)?s.set(n,r):i(n,r)}}},td="!",sd=":",Nw=sd.length,Hw=e=>{const{prefix:t,experimentalParseClassName:s}=e;let o=i=>{const n=[];let r=0,a=0,l=0,c;for(let m=0;m<i.length;m++){let C=i[m];if(r===0&&a===0){if(C===sd){n.push(i.slice(l,m)),l=m+Nw;continue}if(C==="/"){c=m;continue}}C==="["?r++:C==="]"?r--:C==="("?a++:C===")"&&a--}const d=n.length===0?i:i.substring(l),u=Gw(d),h=u!==d,p=c&&c>l?c-l:void 0;return{modifiers:n,hasImportantModifier:h,baseClassName:u,maybePostfixModifierPosition:p}};if(t){const i=t+sd,n=o;o=r=>r.startsWith(i)?n(r.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:r,maybePostfixModifierPosition:void 0}}if(s){const i=o;o=n=>s({className:n,parseClassName:i})}return o},Gw=e=>e.endsWith(td)?e.substring(0,e.length-1):e.startsWith(td)?e.substring(1):e,Bw=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const i=[];let n=[];return o.forEach(r=>{r[0]==="["||t[r]?(i.push(...n.sort(),r),n=[]):n.push(r)}),i.push(...n.sort()),i}},Vw=e=>({cache:Ow(e.cacheSize),parseClassName:Hw(e),sortModifiers:Bw(e),...Iw(e)}),zw=/\s+/,Ww=(e,t)=>{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:i,sortModifiers:n}=t,r=[],a=e.trim().split(zw);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:u,modifiers:h,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:C}=s(d);if(u){l=d+(l.length>0?" "+l:l);continue}let v=!!C,w=o(v?m.substring(0,C):m);if(!w){if(!v){l=d+(l.length>0?" "+l:l);continue}if(w=o(m),!w){l=d+(l.length>0?" "+l:l);continue}v=!1}const b=n(h).join(":"),S=p?b+td:b,x=S+w;if(r.includes(x))continue;r.push(x);const y=i(w,v);for(let F=0;F<y.length;++F){const R=y[F];r.push(S+R)}l=d+(l.length>0?" "+l:l)}return l};function _w(){let e=0,t,s,o="";for(;e<arguments.length;)(t=arguments[e++])&&(s=Mp(t))&&(o&&(o+=" "),o+=s);return o}const Mp=e=>{if(typeof e=="string")return e;let t,s="";for(let o=0;o<e.length;o++)e[o]&&(t=Mp(e[o]))&&(s&&(s+=" "),s+=t);return s};function jw(e,...t){let s,o,i,n=r;function r(l){const c=t.reduce((d,u)=>u(d),e());return s=Vw(c),o=s.cache.get,i=s.cache.set,n=a,a(l)}function a(l){const c=o(l);if(c)return c;const d=Ww(l,s);return i(l,d),d}return function(){return n(_w.apply(null,arguments))}}const it=e=>{const t=s=>s[e]||[];return t.isThemeGetter=!0,t},Ip=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,kp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Uw=/^\d+\/\d+$/,$w=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qw=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Kw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Yw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ri=e=>Uw.test(e),Te=e=>!!e&&!Number.isNaN(Number(e)),js=e=>!!e&&Number.isInteger(Number(e)),Ql=e=>e.endsWith("%")&&Te(e.slice(0,-1)),Es=e=>$w.test(e),Xw=()=>!0,Qw=e=>qw.test(e)&&!Kw.test(e),Ap=()=>!1,Jw=e=>Yw.test(e),e1=e=>Zw.test(e),t1=e=>!he(e)&&!ge(e),s1=e=>Wi(e,Np,Ap),he=e=>Ip.test(e),go=e=>Wi(e,Hp,Qw),Jl=e=>Wi(e,a1,Te),bh=e=>Wi(e,Lp,Ap),o1=e=>Wi(e,Op,e1),Wr=e=>Wi(e,Gp,Jw),ge=e=>kp.test(e),mn=e=>_i(e,Hp),i1=e=>_i(e,l1),Sh=e=>_i(e,Lp),n1=e=>_i(e,Np),r1=e=>_i(e,Op),_r=e=>_i(e,Gp,!0),Wi=(e,t,s)=>{const o=Ip.exec(e);return o?o[1]?t(o[1]):s(o[2]):!1},_i=(e,t,s=!1)=>{const o=kp.exec(e);return o?o[1]?t(o[1]):s:!1},Lp=e=>e==="position"||e==="percentage",Op=e=>e==="image"||e==="url",Np=e=>e==="length"||e==="size"||e==="bg-size",Hp=e=>e==="length",a1=e=>e==="number",l1=e=>e==="family-name",Gp=e=>e==="shadow",c1=()=>{const e=it("color"),t=it("font"),s=it("text"),o=it("font-weight"),i=it("tracking"),n=it("leading"),r=it("breakpoint"),a=it("container"),l=it("spacing"),c=it("radius"),d=it("shadow"),u=it("inset-shadow"),h=it("text-shadow"),p=it("drop-shadow"),m=it("blur"),C=it("perspective"),v=it("aspect"),w=it("ease"),b=it("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],y=()=>[...x(),ge,he],F=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],E=()=>[ge,he,l],D=()=>[ri,"full","auto",...E()],P=()=>[js,"none","subgrid",ge,he],T=()=>["auto",{span:["full",js,ge,he]},js,ge,he],M=()=>[js,"auto",ge,he],k=()=>["auto","min","max","fr",ge,he],N=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],A=()=>["start","end","center","stretch","center-safe","end-safe"],W=()=>["auto",...E()],U=()=>[ri,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],L=()=>[e,ge,he],de=()=>[...x(),Sh,bh,{position:[ge,he]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],te=()=>["auto","cover","contain",n1,s1,{size:[ge,he]}],Q=()=>[Ql,mn,go],J=()=>["","none","full",c,ge,he],me=()=>["",Te,mn,go],Re=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_=()=>[Te,Ql,Sh,bh],Fe=()=>["","none",m,ge,he],ie=()=>["none",Te,ge,he],$=()=>["none",Te,ge,he],q=()=>[Te,ge,he],se=()=>[ri,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Es],breakpoint:[Es],color:[Xw],container:[Es],"drop-shadow":[Es],ease:["in","out","in-out"],font:[t1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Es],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Es],shadow:[Es],spacing:["px",Te],text:[Es],"text-shadow":[Es],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ri,he,ge,v]}],container:["container"],columns:[{columns:[Te,he,ge,a]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{start:D()}],end:[{end:D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[js,"auto",ge,he]}],basis:[{basis:[ri,"full","auto",a,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Te,ri,"auto","initial","none",he]}],grow:[{grow:["",Te,ge,he]}],shrink:[{shrink:["",Te,ge,he]}],order:[{order:[js,"first","last","none",ge,he]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:T()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:T()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...N(),"normal"]}],"justify-items":[{"justify-items":[...A(),"normal"]}],"justify-self":[{"justify-self":["auto",...A()]}],"align-content":[{content:["normal",...N()]}],"align-items":[{items:[...A(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...A(),{baseline:["","last"]}]}],"place-content":[{"place-content":N()}],"place-items":[{"place-items":[...A(),"baseline"]}],"place-self":[{"place-self":["auto",...A()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],w:[{w:[a,"screen",...U()]}],"min-w":[{"min-w":[a,"screen","none",...U()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[r]},...U()]}],h:[{h:["screen","lh",...U()]}],"min-h":[{"min-h":["screen","lh","none",...U()]}],"max-h":[{"max-h":["screen","lh",...U()]}],"font-size":[{text:["base",s,mn,go]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,ge,Jl]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ql,he]}],"font-family":[{font:[i1,he,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,ge,he]}],"line-clamp":[{"line-clamp":[Te,"none",ge,Jl]}],leading:[{leading:[n,...E()]}],"list-image":[{"list-image":["none",ge,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ge,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Re(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",ge,go]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Te,"auto",ge,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge,he]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ge,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:de()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},js,ge,he],radial:["",ge,he],conic:[js,ge,he]},r1,o1]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":me()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Re(),"hidden","none"]}],"divide-style":[{divide:[...Re(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...Re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,ge,he]}],"outline-w":[{outline:["",Te,mn,go]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,_r,Wr]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",u,_r,Wr]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Te,go]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,_r,Wr]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Te,ge,he]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Te]}],"mask-image-linear-from-pos":[{"mask-linear-from":_()}],"mask-image-linear-to-pos":[{"mask-linear-to":_()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":_()}],"mask-image-t-to-pos":[{"mask-t-to":_()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":_()}],"mask-image-r-to-pos":[{"mask-r-to":_()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":_()}],"mask-image-b-to-pos":[{"mask-b-to":_()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":_()}],"mask-image-l-to-pos":[{"mask-l-to":_()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":_()}],"mask-image-x-to-pos":[{"mask-x-to":_()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":_()}],"mask-image-y-to-pos":[{"mask-y-to":_()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[ge,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":_()}],"mask-image-radial-to-pos":[{"mask-radial-to":_()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[Te]}],"mask-image-conic-from-pos":[{"mask-conic-from":_()}],"mask-image-conic-to-pos":[{"mask-conic-to":_()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:de()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,he]}],filter:[{filter:["","none",ge,he]}],blur:[{blur:Fe()}],brightness:[{brightness:[Te,ge,he]}],contrast:[{contrast:[Te,ge,he]}],"drop-shadow":[{"drop-shadow":["","none",p,_r,Wr]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Te,ge,he]}],"hue-rotate":[{"hue-rotate":[Te,ge,he]}],invert:[{invert:["",Te,ge,he]}],saturate:[{saturate:[Te,ge,he]}],sepia:[{sepia:["",Te,ge,he]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,he]}],"backdrop-blur":[{"backdrop-blur":Fe()}],"backdrop-brightness":[{"backdrop-brightness":[Te,ge,he]}],"backdrop-contrast":[{"backdrop-contrast":[Te,ge,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,ge,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,ge,he]}],"backdrop-invert":[{"backdrop-invert":["",Te,ge,he]}],"backdrop-opacity":[{"backdrop-opacity":[Te,ge,he]}],"backdrop-saturate":[{"backdrop-saturate":[Te,ge,he]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,ge,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ge,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Te,"initial",ge,he]}],ease:[{ease:["linear","initial",w,ge,he]}],delay:[{delay:[Te,ge,he]}],animate:[{animate:["none",b,ge,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ge,he]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:$()}],"scale-x":[{"scale-x":$()}],"scale-y":[{"scale-y":$()}],"scale-z":[{"scale-z":$()}],"scale-3d":["scale-3d"],skew:[{skew:q()}],"skew-x":[{"skew-x":q()}],"skew-y":[{"skew-y":q()}],transform:[{transform:[ge,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:se()}],"translate-x":[{"translate-x":se()}],"translate-y":[{"translate-y":se()}],"translate-z":[{"translate-z":se()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ge,he]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ge,he]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Te,mn,go,Jl]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},d1=jw(c1);function oe(...e){return d1(ue(e))}var Ra=(e=>(e.Description="description",e.Error="error",e))(Ra||{});const ir=({text:e,className:t,variant:s=Ra.Description,...o})=>e?f.jsx("span",{...o,role:"alert",className:oe("dial-tiny-text",s===Ra.Error?"text-error":"text-secondary",t),children:e}):null,ns=({...e})=>f.jsx(ir,{...e,variant:Ra.Error});var Ge=(e=>(e.Primary="primary",e.Neutral="neutral",e.Error="error",e.Success="Success",e.Secondary="secondary",e.Tertiary="tertiary",e))(Ge||{}),Me=(e=>(e.Solid="solid",e.Outlined="outlined",e.Ghost="ghost",e.Link="link",e))(Me||{});const yh={[Ge.Primary]:{[Me.Solid]:"dial-primary-solid-button",[Me.Ghost]:"dial-primary-ghost-button",[Me.Link]:"dial-primary-link-button"},[Ge.Neutral]:{[Me.Outlined]:"dial-neutral-outlined-button"},[Ge.Error]:{[Me.Solid]:"dial-error-solid-button",[Me.Ghost]:"dial-error-ghost-button"},[Ge.Success]:{[Me.Ghost]:"dial-success-ghost-button"},[Ge.Secondary]:{[Me.Ghost]:"dial-secondary-ghost-button"},[Ge.Tertiary]:{[Me.Ghost]:"dial-tertiary-ghost-button"}},Bp=(e=Ge.Primary,t=Me.Solid)=>{const s=yh[e]?.[t];return s||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${t}. Using default primary solid button styles.`),yh[Ge.Primary][Me.Solid])},u1=7,h1=2,Vp=g.createContext(null),zp=()=>{const e=g.useContext(Vp);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},g1=({initialOpen:e=!1,placement:t="bottom",isTriggerClickable:s=!1,open:o,onOpenChange:i}={})=>{const[n,r]=g.useState(e),a=g.useRef(null),l=o??n,c=i??r,d=Ie.useFloating({placement:t,open:l,onOpenChange:c,whileElementsMounted:Ie.autoUpdate,middleware:[Ie.offset(u1+h1),Ie.flip({crossAxis:t.includes("-"),fallbackAxisSideDirection:"start",padding:5}),Ie.shift({padding:5}),Ie.arrow({element:a})]}),u=Ie.useHover(d.context,{move:!1,enabled:o==null,mouseOnly:s,delay:{open:500,close:0}}),h=Ie.useFocus(d.context,{enabled:o==null}),p=Ie.useDismiss(d.context),m=Ie.useRole(d.context,{role:"tooltip"}),C=Ie.useInteractions([u,h,p,m]);return g.useEffect(()=>{if(!l)return;const v=d.refs.reference.current;if(!(v instanceof Element))return;const w=new IntersectionObserver(([b])=>{b.isIntersecting||c(!1)},{root:null,threshold:0});return w.observe(v),()=>w.disconnect()},[l,d.refs.reference,c]),g.useMemo(()=>({open:l,setOpen:c,arrowRef:a,...C,...d}),[l,c,C,d])},qd=({children:e,...t})=>{const s=g1(t);return f.jsx(Vp.Provider,{value:s,children:e})},Kd=({style:e,...t})=>{const s=zp(),o=g.useRef(null),i=Ie.useMergeRefs([s.refs.setFloating,o]);return s.open?f.jsx(Ie.FloatingPortal,{id:"tooltip-portal",children:f.jsxs("div",{ref:i,style:{...s.floatingStyles,...e},...s.getFloatingProps(t),className:ue("z-[55] whitespace-pre-wrap break-words rounded border border-primary bg-layer-0 px-2 py-1 dial-tiny-text shadow max-w-[300px]",s.getFloatingProps(t).className),children:[t.children,f.jsx(Ie.FloatingArrow,{ref:s.arrowRef,context:s.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary text-[var(--bg-layer-0,_#000000)]"})]})}):null},Yd=({children:e,asChild:t=!1,...s})=>{const o=zp(),i=t&&g.isValidElement(e),n=i?e.props?.ref:null,r=Ie.useMergeRefs([o.refs.setReference,...n?[n]:[]]);return i?g.cloneElement(e,o.getReferenceProps({...e.props,...s,ref:r})):f.jsx("span",{ref:r,...o.getReferenceProps(s),className:s.className??"dial-tooltip-trigger text-left",children:e})},yt=({hideTooltip:e,tooltip:t,children:s,triggerClassName:o,contentClassName:i,...n})=>f.jsxs(qd,{...n,children:[f.jsx(Yd,{className:ue(o,"truncate"),children:s}),f.jsx(Kd,{className:ue("text-primary",i,"max-w-[300px]",(e||!t)&&"hidden"),children:t})]});var bt=(e=>(e.Small="small",e.Standard="standard",e))(bt||{});const no=({variant:e,appearance:t=Me.Solid,size:s=bt.Standard,className:o,icon:i,tooltipProps:n,type:r="button",...a})=>{const l=oe(e&&Bp(e,t),s===bt.Small?"h-[24px] w-[24px]":"h-[40px] w-[40px]","dial-icon-button disabled:cursor-not-allowed focus-visible:outline outline-offset-0 disabled:text-controls-secondary-disable",o),c=f.jsx("button",{...a,type:r,className:l,"aria-label":a["aria-label"],children:i});return n?f.jsx(yt,{...n,children:c}):c},p1="w-[24px] h-[24px] border border-solid rounded-[6px] border-transparent p-1 text-secondary hover:text-controls-accent-primary-hover active:text-controls-accent-primary-active focus-within:border-focus";var pt=(e=>(e[e.LG=24]="LG",e[e.MD=20]="MD",e[e.SM=16]="SM",e))(pt||{});const Nt=18,Y={size:Nt,stroke:2},f1=({caption:e,onClick:t})=>{if(!e)return null;const s=f.jsx(no,{"aria-label":e,className:p1,icon:f.jsx(G.IconInfoCircle,{size:pt.SM}),onClick:t});return e?f.jsx(yt,{tooltip:e,triggerClassName:"flex justify-center items-center",children:s}):s},Bo=({label:e,required:t,className:s,caption:o,...i})=>e?f.jsxs("label",{...i,className:oe("dial-tiny-text text-secondary flex items-center gap-1",s),children:[typeof e=="string"?f.jsx("span",{className:"min-h-4",children:e}):e,t&&f.jsx("span",{className:"text-accent-primary",children:"*"}),f.jsx(f1,{caption:o})]}):null,$e=({icon:e,className:t})=>e?f.jsx("span",{className:ue("flex-shrink-0",t),children:e}):null,ss=({label:e,variant:t,appearance:s=Me.Solid,size:o=bt.Standard,className:i,textClassName:n,iconAfter:r,iconBefore:a,hideTitleOnMobile:l,type:c="button",tooltipProps:d,...u})=>{const h=ue(l?"hidden sm:inline":"inline",n),p=oe(t&&Bp(t,s),o===bt.Small?"dial-tiny-semi-text":"dial-small-semi-text",s!==Me.Link&&(o===bt.Small?"h-[24px] px-2":"h-[40px] px-3"),"disabled:cursor-not-allowed focus-visible:outline outline-offset-0",i),m=f.jsxs("button",{...u,type:c,className:p,"aria-label":typeof e=="string"&&e||u["aria-label"],children:[f.jsx($e,{icon:a}),e&&f.jsx("span",{className:h,children:e}),f.jsx($e,{icon:r})]});return d?f.jsx(yt,{...d,children:m}):m};var is=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e))(is||{});const m1=e=>({info:f.jsx(G.IconInfoCircle,{...e}),error:f.jsx(G.IconAlertCircle,{...e}),warning:f.jsx(G.IconAlertTriangle,{...e}),success:f.jsx(G.IconCircleCheck,{...e})}),C1={[is.Info]:"bg-info border-info text-info",[is.Success]:"bg-success border-success text-success",[is.Warning]:"bg-warning border-warning text-warning",[is.Error]:"bg-error border-error text-error"},v1="items-center justify-between gap-2 p-3 border border-solid dial-small-text-150 rounded flex",Wp=({variant:e=is.Info,message:t,className:s,iconSize:o=24,iconStroke:i=2,closable:n=!1,onClose:r,children:a,...l})=>{const c=g.useMemo(()=>m1({size:o,stroke:i})[e],[e,o,i]);return f.jsxs("div",{...l,role:"alert",className:oe(v1,C1[e],s),children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx($e,{icon:c}),f.jsx("div",{className:"text-primary",children:t})]}),a,n&&f.jsx(ss,{className:"ml-2 text-secondary hover:text-primary","aria-label":"Close alert",iconBefore:f.jsx(G.IconX,{size:pt.SM}),onClick:r})]})},w1="flex items-center justify-center text-secondary",b1="shrink-0 grow-0 basis-auto animate-spin-steps",S1=e=>Se.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M24 39V46.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Se.createElement("path",{opacity:.4,d:"M9 24H1.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Se.createElement("path",{opacity:.5,d:"M8.0918 8.0918L13.3994 13.3994",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Se.createElement("path",{opacity:.6,d:"M24 1.5V9",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Se.createElement("path",{opacity:.7,d:"M39.9121 8.08594L37.2607 10.7373L34.6094 13.3887",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Se.createElement("path",{opacity:.8,d:"M46.5 24H39",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Se.createElement("path",{opacity:.9,d:"M34.6055 34.6055L39.9082 39.9082",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Se.createElement("path",{opacity:.3,d:"M13.3936 34.6055L8.08594 39.9131",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),nr=({size:e=18,className:t,iconClassName:s,fullWidth:o=!0,ariaLabel:i="Loading"})=>f.jsx("div",{role:"status",className:ue({[w1]:!0,"w-full h-full":o,[t||""]:!!t}),children:f.jsx($e,{icon:f.jsx(S1,{width:e,height:e,className:ue(b1,s),role:"img","aria-label":i})})}),y1="text-primary",ht=({text:e,className:t,contentClassName:s,hideTooltip:o,id:i,customTooltipContent:n,...r})=>{const a=g.useRef(null),[l,c]=g.useState(!1),[d,u]=g.useState(""),h=g.useRef(null),p=()=>{const w=a.current;if(!w)return;u(w.textContent??"");const b=w.clientWidth,S=w.scrollWidth,x=Math.ceil(w.getBoundingClientRect().width);c(S>b||S>x)},m=g.useCallback(()=>{h.current&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(p)},[]);g.useEffect(()=>{m();const w=()=>m();window.addEventListener("resize",w);let b=null;return"ResizeObserver"in window&&a.current&&(b=new ResizeObserver(()=>m()),b.observe(a.current)),()=>{window.removeEventListener("resize",w),b&&b.disconnect(),h.current&&cancelAnimationFrame(h.current)}},[e,m]);const C=g.useMemo(()=>typeof e=="string"?e:d,[d,e]),v=g.useMemo(()=>o?"":n||(l?C:""),[n,C,o,l]);return f.jsxs(qd,{...r,children:[f.jsx(Yd,{asChild:!0,onMouseEnter:m,onFocusCapture:m,children:f.jsx("span",{id:i,className:oe("block truncate flex-1 min-w-0 max-w-full text-left",t),"aria-label":l?C:void 0,onMouseEnter:m,onFocus:m,ref:a,children:e})}),f.jsx(Kd,{className:oe(y1,s,!v&&"hidden"),children:v})]})},od="checkbox-container",id=({label:e,id:t,checked:s,indeterminate:o,disabled:i,ariaLabel:n,onChange:r,className:a,...l})=>{const c=g.useCallback(p=>{r?.(p.target.checked,t)},[r,t]),d=ue("flex flex-row items-center cursor-pointer text-accent-primary small-medium min-w-0",`${s||o?"":'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded'}`,i?"pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4":"",a),u=ue("border rounded",i?"bg-layer-4 border-icon-secondary":""),h=()=>o?f.jsx(G.IconMinus,{className:u,...Y}):s?f.jsx(G.IconCheck,{className:u,...Y}):null;return f.jsxs("label",{...l,className:d,htmlFor:t,"aria-description":l["aria-description"]||od,children:[h(),e&&(typeof e=="string"?f.jsx(ht,{text:e,className:"ml-2 text-primary"}):e),f.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:c,id:t,checked:s,"aria-checked":o?"mixed":s,"aria-disabled":i||void 0,"aria-label":e?void 0:n,className:"invisible w-0 h-0"})]})};var Gt=(e=>(e.VALID="valid",e.ERROR="error",e))(Gt||{});const x1=(e,t)=>{if(t===e.id)switch(e.status){case Gt.VALID:return"border-accent-secondary text-primary";case Gt.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case Gt.VALID:return"border-primary text-primary";case Gt.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},R1=(e,t)=>{if(t===e.id)switch(e.status){case Gt.VALID:return"bg-accent-secondary";case Gt.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case Gt.VALID:return"bg-accent-secondary";case Gt.ERROR:return"bg-red-400";default:return"bg-layer-4"}},F1=({step:e,index:t,currentStep:s,onChangeStep:o})=>{const i="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny-text cursor-pointer dial-step",n="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",r=()=>s===e.id&&e.status===Gt.ERROR?f.jsx(G.IconExclamationCircle,{stroke:2,size:pt.SM}):s!==e.id&&e.status===Gt.VALID?f.jsx(G.IconCheck,{stroke:2,size:pt.SM}):t+1;return f.jsxs("button",{className:ue(i,x1(e,s)),onClick:()=>o(e.id),children:[f.jsx("span",{className:ue(n,R1(e,s)),children:r()}),f.jsx("span",{children:e.name})]})},E1=({steps:e,currentStep:t,onChangeStep:s})=>{const o=i=>{const n=e.findIndex(a=>a.id===t),r=e.findIndex(a=>a.id===i);(i!==t&&e[n].status===Gt.VALID||r<n)&&s(i)};return f.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((i,n)=>f.jsx(F1,{currentStep:t,onChangeStep:o,step:i,index:n},i.id))})},Zd=({name:e,value:t,label:s,description:o,checked:i=!1,inputId:n,className:r,labelClassName:a,disabled:l,onChange:c,descriptionClassName:d,caption:u})=>{const h=`${n}-desc`,p=ue("dial-small-text cursor-pointer py-[1px]",l?"text-secondary":"text-primary",a),m=ue("cursor-pointer dial-input-radio",!!s&&"mr-2",r),C=ue("flex flex-col",!!o&&"mb-2"),v=ue("dial-tiny-text mt-2 ml-[26px] text-secondary",d),w=b=>{l||b.target.checked&&c?.(t)};return f.jsxs("div",{className:C,children:[f.jsxs("div",{className:"flex flex-row",children:[f.jsx("input",{type:"radio",id:n,name:e,value:t,checked:i,disabled:l,"aria-describedby":i&&o?h:void 0,className:m,onChange:w}),(s||u)&&f.jsxs("div",{className:"flex flex-col gap-1 ml-2",children:[s&&f.jsx("label",{className:p,htmlFor:n,"aria-describedby":u?"caption":"",children:s}),u&&f.jsx("span",{id:"caption",className:"dial-tiny-text text-secondary",children:u})]})]}),i&&o&&f.jsx("div",{id:h,className:v,children:o})]})};var zn=(e=>(e.Vertical="vertical",e.Horizontal="horizontal",e))(zn||{});const D1="w-full flex gap-2",P1={[zn.Vertical]:"flex-col",[zn.Horizontal]:"flex-row items-end"},Xd=({id:e,label:t,required:s,description:o,error:i,orientation:n=zn.Vertical,labelVisuallyHidden:r=!1,className:a,labelClassName:l,errorClassName:c,childrenClassName:d,captionDescription:u,readonly:h,value:p,defaultEmptyText:m,children:C})=>{const v=`${e}-label`,w=o?`${e}-desc`:void 0,b=i?`${e}-err`:void 0,S=`${e}-caption-desc`,x=[w,b].filter(Boolean).join(" ")||void 0,y=g.useCallback(()=>typeof i=="boolean"?null:typeof i=="string"||typeof i>"u"?i?f.jsx("div",{id:b,"aria-live":"polite",className:c,children:f.jsx(ns,{text:i})}):null:f.jsx("div",{id:b,role:"alert","aria-live":"polite",className:c,children:i}),[i,c,b]),F=g.useCallback(()=>p?typeof p=="string"||typeof p=="number"?f.jsx("span",{"aria-readonly":"true",children:p}):p:f.jsx("span",{className:"flex min-h-4","aria-readonly":"true",children:m??"None"}),[p,m]);return f.jsxs("div",{role:"group","aria-labelledby":t?v:void 0,"aria-describedby":x,className:oe(D1,P1[n],a),children:[t&&f.jsx("div",{id:v,className:oe(n==="horizontal"&&"shrink-0"),children:f.jsx(Bo,{htmlFor:e,label:t,required:s,className:oe(r&&"sr-only",l),caption:o})}),f.jsxs("div",{className:oe("min-w-0 w-full",d),children:[h?f.jsx("div",{className:"dial-input px-3 py-2",children:F()}):C,u&&f.jsx("div",{id:S,className:oe({"dial-tiny-text text-secondary mt-1":!0,"text-error":!!i}),children:u}),y()]})]})};var To=(e=>(e.Row="Row",e.Column="Column",e))(To||{});const T1="flex",M1="pb-1 mt-2",I1={[To.Column]:"flex-col gap-y-3",[To.Row]:"flex-row gap-x-6"},Fa=({fieldTitle:e,radioClassName:t,containerClassName:s,selectedItemClassName:o,selectedLabelClassName:i,radioGroupClassName:n,inputContainerClassName:r,selectedInputContainerClassName:a,groupLabelClassName:l,formItemChildrenClassName:c,labelClassName:d,disabled:u,elementId:h,radioButtons:p,activeRadioButton:m,orientation:C,onChange:v})=>f.jsx(Xd,{id:h,label:e,labelClassName:l||d,className:s,childrenClassName:c,children:f.jsx("div",{role:"radiogroup","aria-label":e,"aria-disabled":u||void 0,className:oe(T1,I1[C],n),children:p.map(w=>f.jsxs("div",{className:oe("flex flex-col",r,w.id===m&&a),children:[f.jsx(Zd,{name:h,value:w.id,inputId:w.id,disabled:u,className:t,labelClassName:oe(d,w.id===m&&i),label:w.name,caption:w.caption,checked:w.id===m,onChange:()=>v(w.id)}),w.id===m&&w.content?f.jsx("div",{className:oe(M1,o),children:w.content}):null]},w.id))})}),rr=({icon:e,title:t,description:s,containerClassName:o,titleClassName:i,descriptionClassName:n})=>f.jsxs("div",{className:oe("h-full w-full flex flex-col items-center justify-center text-secondary",o),"aria-label":"no-data-container",children:[e||f.jsx(G.IconClipboardX,{width:60,height:60,stroke:.5}),f.jsx("span",{className:oe("dial-small-text mt-2 text-primary",i),"aria-label":"no-results-title",children:t}),s&&f.jsx("span",{className:oe("mt-1 text-primary",n),"aria-label":"no-results-description",children:s})]}),ec=48,_p=({containerClassName:e,children:t,width:s=280,title:o,iconSize:i=24,iconStroke:n=1.5,titleClassName:r,additionalButtons:a,isOpened:l,onToggle:c})=>{const[d,u]=g.useState(s),[h,p]=g.useState(!0),m=g.useMemo(()=>typeof l=="boolean",[l]),C=m?l:h;g.useEffect(()=>{m&&u(l?s:ec)},[m,l,s]);const v=oe(["transform rotate-180 [writing-mode:tb-rl] py-4 px-3",C&&"hidden",r]),w=oe(["flex flex-row gap-2 cursor-pointer text-secondary py-2 items-center",C?"justify-end px-4":"justify-center"]),b=S=>{const x=!C;if(m){u(x?s:ec),c?.(x,S);return}u(x?s:ec),p(x)};return f.jsxs("div",{className:oe(["rounded flex flex-col justify-between",e]),style:{width:`${d}px`},"aria-label":"collapsible-sidebar",children:[f.jsx("div",{className:oe(["flex-1 p-4 min-h-0 overflow-auto",!C&&"hidden"]),children:t}),f.jsx("div",{className:v,children:o}),f.jsxs("div",{className:oe("border-t border-tertiary h-12",w),children:[C&&a,f.jsx(no,{className:"hover:text-accent-primary",onClick:b,"aria-label":"sidebar-state",size:bt.Small,icon:C?f.jsx(G.IconChevronsLeft,{size:i,stroke:n}):f.jsx(G.IconChevronsRight,{size:i,stroke:n})})]})]})},k1=({label:e,text:t,tooltip:s,children:o,postfix:i,className:n})=>f.jsxs("div",{className:oe("flex flex-col",o?"":"max-w-[200px]",n),children:[e&&f.jsx("label",{className:"dial-tiny-text mb-2 text-secondary",children:e}),o||f.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[f.jsx(yt,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:s||t,children:t}),i||null]})]});var sl=(e=>(e.Default="default",e))(sl||{});const A1={[sl.Default]:"border-icon-secondary bg-layer-3"},vo=({tag:e,className:t,remove:s,variant:o=sl.Default,iconBefore:i,bordered:n=!0})=>{const r=A1[o],a=oe("flex items-center gap-1 dial-tiny-text rounded p-1 h-[22px] text-primary",r,n?"border":"border-transparent",t);return f.jsxs("div",{className:a,children:[f.jsx($e,{icon:i}),f.jsx(ht,{text:e}),s&&f.jsx(ss,{className:"p-0",iconAfter:f.jsx(G.IconX,{size:pt.SM}),onClick:l=>s(l)})]},e)},jp=g.createContext({dragDropManager:void 0});function qt(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var xh=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Rh=function(){return Math.random().toString(36).substring(7).split("").join(".")},Fh={INIT:"@@redux/INIT"+Rh(),REPLACE:"@@redux/REPLACE"+Rh()};function L1(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function O1(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(G1(e))return"date";if(H1(e))return"error";var s=N1(e);switch(s){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return s}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function N1(e){return typeof e.constructor=="function"?e.constructor.name:null}function H1(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function G1(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function ai(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=O1(e)),t}function Up(e,t,s){var o;if(typeof t=="function"&&typeof s=="function"||typeof s=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?qt(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof s>"u"&&(s=t,t=void 0),typeof s<"u"){if(typeof s!="function")throw new Error(process.env.NODE_ENV==="production"?qt(1):"Expected the enhancer to be a function. Instead, received: '"+ai(s)+"'");return s(Up)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?qt(2):"Expected the root reducer to be a function. Instead, received: '"+ai(e)+"'");var i=e,n=t,r=[],a=r,l=!1;function c(){a===r&&(a=r.slice())}function d(){if(l)throw new Error(process.env.NODE_ENV==="production"?qt(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return n}function u(C){if(typeof C!="function")throw new Error(process.env.NODE_ENV==="production"?qt(4):"Expected the listener to be a function. Instead, received: '"+ai(C)+"'");if(l)throw new Error(process.env.NODE_ENV==="production"?qt(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var v=!0;return c(),a.push(C),function(){if(v){if(l)throw new Error(process.env.NODE_ENV==="production"?qt(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");v=!1,c();var b=a.indexOf(C);a.splice(b,1),r=null}}}function h(C){if(!L1(C))throw new Error(process.env.NODE_ENV==="production"?qt(7):"Actions must be plain objects. Instead, the actual type was: '"+ai(C)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof C.type>"u")throw new Error(process.env.NODE_ENV==="production"?qt(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(l)throw new Error(process.env.NODE_ENV==="production"?qt(9):"Reducers may not dispatch actions.");try{l=!0,n=i(n,C)}finally{l=!1}for(var v=r=a,w=0;w<v.length;w++){var b=v[w];b()}return C}function p(C){if(typeof C!="function")throw new Error(process.env.NODE_ENV==="production"?qt(10):"Expected the nextReducer to be a function. Instead, received: '"+ai(C));i=C,h({type:Fh.REPLACE})}function m(){var C,v=u;return C={subscribe:function(b){if(typeof b!="object"||b===null)throw new Error(process.env.NODE_ENV==="production"?qt(11):"Expected the observer to be an object. Instead, received: '"+ai(b)+"'");function S(){b.next&&b.next(d())}S();var x=v(S);return{unsubscribe:x}}},C[xh]=function(){return this},C}return h({type:Fh.INIT}),o={dispatch:h,subscribe:u,getState:d,replaceReducer:p},o[xh]=m,o}function Pe(e,t,...s){if(B1()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let o;if(t===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let i=0;o=new Error(t.replace(/%s/g,function(){return s[i++]})),o.name="Invariant Violation"}throw o.framesToPop=1,o}}function B1(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function V1(e,t,s){return t.split(".").reduce((o,i)=>o&&o[i]?o[i]:s||null,e)}function z1(e,t){return e.filter(s=>s!==t)}function $p(e){return typeof e=="object"}function W1(e,t){const s=new Map,o=n=>{s.set(n,s.has(n)?s.get(n)+1:1)};e.forEach(o),t.forEach(o);const i=[];return s.forEach((n,r)=>{n===1&&i.push(r)}),i}function _1(e,t){return e.filter(s=>t.indexOf(s)>-1)}const Qd="dnd-core/INIT_COORDS",ol="dnd-core/BEGIN_DRAG",Jd="dnd-core/PUBLISH_DRAG_SOURCE",il="dnd-core/HOVER",nl="dnd-core/DROP",rl="dnd-core/END_DRAG";function Eh(e,t){return{type:Qd,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const j1={type:Qd,payload:{clientOffset:null,sourceClientOffset:null}};function U1(e){return function(s=[],o={publishSource:!0}){const{publishSource:i=!0,clientOffset:n,getSourceClientOffset:r}=o,a=e.getMonitor(),l=e.getRegistry();e.dispatch(Eh(n)),$1(s,a,l);const c=Y1(s,a);if(c==null){e.dispatch(j1);return}let d=null;if(n){if(!r)throw new Error("getSourceClientOffset must be defined");q1(r),d=r(c)}e.dispatch(Eh(n,d));const h=l.getSource(c).beginDrag(a,c);if(h==null)return;K1(h),l.pinSource(c);const p=l.getSourceType(c);return{type:ol,payload:{itemType:p,item:h,sourceId:c,clientOffset:n||null,sourceClientOffset:d||null,isSourcePublic:!!i}}}}function $1(e,t,s){Pe(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(o){Pe(s.getSource(o),"Expected sourceIds to be registered.")})}function q1(e){Pe(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function K1(e){Pe($p(e),"Item must be an object.")}function Y1(e,t){let s=null;for(let o=e.length-1;o>=0;o--)if(t.canDragSource(e[o])){s=e[o];break}return s}function Z1(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function X1(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{},o=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(s).filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable}))),o.forEach(function(i){Z1(e,i,s[i])})}return e}function Q1(e){return function(s={}){const o=e.getMonitor(),i=e.getRegistry();J1(o),sb(o).forEach((r,a)=>{const l=eb(r,a,i,o),c={type:nl,payload:{dropResult:X1({},s,l)}};e.dispatch(c)})}}function J1(e){Pe(e.isDragging(),"Cannot call drop while not dragging."),Pe(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function eb(e,t,s,o){const i=s.getTarget(e);let n=i?i.drop(o,e):void 0;return tb(n),typeof n>"u"&&(n=t===0?{}:o.getDropResult()),n}function tb(e){Pe(typeof e>"u"||$p(e),"Drop result must either be an object or undefined.")}function sb(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function ob(e){return function(){const s=e.getMonitor(),o=e.getRegistry();ib(s);const i=s.getSourceId();return i!=null&&(o.getSource(i,!0).endDrag(s,i),o.unpinSource()),{type:rl}}}function ib(e){Pe(e.isDragging(),"Cannot call endDrag while not dragging.")}function nd(e,t){return t===null?e===null:Array.isArray(e)?e.some(s=>s===t):e===t}function nb(e){return function(s,{clientOffset:o}={}){rb(s);const i=s.slice(0),n=e.getMonitor(),r=e.getRegistry(),a=n.getItemType();return lb(i,r,a),ab(i,n,r),cb(i,n,r),{type:il,payload:{targetIds:i,clientOffset:o||null}}}}function rb(e){Pe(Array.isArray(e),"Expected targetIds to be an array.")}function ab(e,t,s){Pe(t.isDragging(),"Cannot call hover while not dragging."),Pe(!t.didDrop(),"Cannot call hover after drop.");for(let o=0;o<e.length;o++){const i=e[o];Pe(e.lastIndexOf(i)===o,"Expected targetIds to be unique in the passed array.");const n=s.getTarget(i);Pe(n,"Expected targetIds to be registered.")}}function lb(e,t,s){for(let o=e.length-1;o>=0;o--){const i=e[o],n=t.getTargetType(i);nd(n,s)||e.splice(o,1)}}function cb(e,t,s){e.forEach(function(o){s.getTarget(o).hover(t,o)})}function db(e){return function(){if(e.getMonitor().isDragging())return{type:Jd}}}function ub(e){return{beginDrag:U1(e),publishDragSource:db(e),hover:nb(e),drop:Q1(e),endDrag:ob(e)}}class hb{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:s}=this.store;function o(n){return(...r)=>{const a=n.apply(t,r);typeof a<"u"&&s(a)}}const i=ub(this);return Object.keys(i).reduce((n,r)=>{const a=i[r];return n[r]=o(a),n},{})}dispatch(t){this.store.dispatch(t)}constructor(t,s){this.isSetUp=!1,this.handleRefCountChange=()=>{const o=this.store.getState().refCount>0;this.backend&&(o&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!o&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=s,t.subscribe(this.handleRefCountChange)}}function gb(e,t){return{x:e.x+t.x,y:e.y+t.y}}function qp(e,t){return{x:e.x-t.x,y:e.y-t.y}}function pb(e){const{clientOffset:t,initialClientOffset:s,initialSourceClientOffset:o}=e;return!t||!s||!o?null:qp(gb(t,o),s)}function fb(e){const{clientOffset:t,initialClientOffset:s}=e;return!t||!s?null:qp(t,s)}const Pn=[],eu=[];Pn.__IS_NONE__=!0;eu.__IS_ALL__=!0;function mb(e,t){return e===Pn?!1:e===eu||typeof t>"u"?!0:_1(t,e).length>0}class Cb{subscribeToStateChange(t,s={}){const{handlerIds:o}=s;Pe(typeof t=="function","listener must be a function."),Pe(typeof o>"u"||Array.isArray(o),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const n=()=>{const r=this.store.getState(),a=r.stateId;try{a===i||a===i+1&&!mb(r.dirtyHandlerIds,o)||t()}finally{i=a}};return this.store.subscribe(n)}subscribeToOffsetChange(t){Pe(typeof t=="function","listener must be a function.");let s=this.store.getState().dragOffset;const o=()=>{const i=this.store.getState().dragOffset;i!==s&&(s=i,t())};return this.store.subscribe(o)}canDragSource(t){if(!t)return!1;const s=this.registry.getSource(t);return Pe(s,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:s.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const s=this.registry.getTarget(t);if(Pe(s,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const o=this.registry.getTargetType(t),i=this.getItemType();return nd(o,i)&&s.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const s=this.registry.getSource(t,!0);if(Pe(s,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const o=this.registry.getSourceType(t),i=this.getItemType();return o!==i?!1:s.isDragging(this,t)}isOverTarget(t,s={shallow:!1}){if(!t)return!1;const{shallow:o}=s;if(!this.isDragging())return!1;const i=this.registry.getTargetType(t),n=this.getItemType();if(n&&!nd(i,n))return!1;const r=this.getTargetIds();if(!r.length)return!1;const a=r.indexOf(t);return o?a===r.length-1:a>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return pb(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return fb(this.store.getState().dragOffset)}constructor(t,s){this.store=t,this.registry=s}}const Dh=typeof global<"u"?global:self,Kp=Dh.MutationObserver||Dh.WebKitMutationObserver;function Yp(e){return function(){const s=setTimeout(i,0),o=setInterval(i,50);function i(){clearTimeout(s),clearInterval(o),e()}}}function vb(e){let t=1;const s=new Kp(e),o=document.createTextNode("");return s.observe(o,{characterData:!0}),function(){t=-t,o.data=t}}const wb=typeof Kp=="function"?vb:Yp;class bb{enqueueTask(t){const{queue:s,requestFlush:o}=this;s.length||(o(),this.flushing=!0),s[s.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const s=this.index;if(this.index++,t[s].call(),this.index>this.capacity){for(let o=0,i=t.length-this.index;o<i;o++)t[o]=t[o+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=wb(this.flush),this.requestErrorThrow=Yp(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Sb{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,s){this.onError=t,this.release=s,this.task=null}}class yb{create(t){const s=this.freeTasks,o=s.length?s.pop():new Sb(this.onError,i=>s[s.length]=i);return o.task=t,o}constructor(t){this.onError=t,this.freeTasks=[]}}const Zp=new bb,xb=new yb(Zp.registerPendingError);function Rb(e){Zp.enqueueTask(xb.create(e))}const tu="dnd-core/ADD_SOURCE",su="dnd-core/ADD_TARGET",ou="dnd-core/REMOVE_SOURCE",al="dnd-core/REMOVE_TARGET";function Fb(e){return{type:tu,payload:{sourceId:e}}}function Eb(e){return{type:su,payload:{targetId:e}}}function Db(e){return{type:ou,payload:{sourceId:e}}}function Pb(e){return{type:al,payload:{targetId:e}}}function Tb(e){Pe(typeof e.canDrag=="function","Expected canDrag to be a function."),Pe(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Pe(typeof e.endDrag=="function","Expected endDrag to be a function.")}function Mb(e){Pe(typeof e.canDrop=="function","Expected canDrop to be a function."),Pe(typeof e.hover=="function","Expected hover to be a function."),Pe(typeof e.drop=="function","Expected beginDrag to be a function.")}function rd(e,t){if(t&&Array.isArray(e)){e.forEach(s=>rd(s,!1));return}Pe(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Zt;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Zt||(Zt={}));let Ib=0;function kb(){return Ib++}function Ab(e){const t=kb().toString();switch(e){case Zt.SOURCE:return`S${t}`;case Zt.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Ph(e){switch(e[0]){case"S":return Zt.SOURCE;case"T":return Zt.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Th(e,t){const s=e.entries();let o=!1;do{const{done:i,value:[,n]}=s.next();if(n===t)return!0;o=!!i}while(!o);return!1}class Lb{addSource(t,s){rd(t),Tb(s);const o=this.addHandler(Zt.SOURCE,t,s);return this.store.dispatch(Fb(o)),o}addTarget(t,s){rd(t,!0),Mb(s);const o=this.addHandler(Zt.TARGET,t,s);return this.store.dispatch(Eb(o)),o}containsHandler(t){return Th(this.dragSources,t)||Th(this.dropTargets,t)}getSource(t,s=!1){return Pe(this.isSourceId(t),"Expected a valid source ID."),s&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Pe(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Pe(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Pe(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Ph(t)===Zt.SOURCE}isTargetId(t){return Ph(t)===Zt.TARGET}removeSource(t){Pe(this.getSource(t),"Expected an existing source."),this.store.dispatch(Db(t)),Rb(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Pe(this.getTarget(t),"Expected an existing target."),this.store.dispatch(Pb(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const s=this.getSource(t);Pe(s,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=s}unpinSource(){Pe(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,s,o){const i=Ab(t);return this.types.set(i,s),t===Zt.SOURCE?this.dragSources.set(i,o):t===Zt.TARGET&&this.dropTargets.set(i,o),i}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const Ob=(e,t)=>e===t;function Nb(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Hb(e,t,s=Ob){if(e.length!==t.length)return!1;for(let o=0;o<e.length;++o)if(!s(e[o],t[o]))return!1;return!0}function Gb(e=Pn,t){switch(t.type){case il:break;case tu:case su:case al:case ou:return Pn;case ol:case Jd:case rl:case nl:default:return eu}const{targetIds:s=[],prevTargetIds:o=[]}=t.payload,i=W1(s,o);if(!(i.length>0||!Hb(s,o)))return Pn;const r=o[o.length-1],a=s[s.length-1];return r!==a&&(r&&i.push(r),a&&i.push(a)),i}function Bb(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function Vb(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{},o=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(s).filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable}))),o.forEach(function(i){Bb(e,i,s[i])})}return e}const Mh={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function zb(e=Mh,t){const{payload:s}=t;switch(t.type){case Qd:case ol:return{initialSourceClientOffset:s.sourceClientOffset,initialClientOffset:s.clientOffset,clientOffset:s.clientOffset};case il:return Nb(e.clientOffset,s.clientOffset)?e:Vb({},e,{clientOffset:s.clientOffset});case rl:case nl:return Mh;default:return e}}function Wb(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function li(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{},o=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(s).filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable}))),o.forEach(function(i){Wb(e,i,s[i])})}return e}const _b={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function jb(e=_b,t){const{payload:s}=t;switch(t.type){case ol:return li({},e,{itemType:s.itemType,item:s.item,sourceId:s.sourceId,isSourcePublic:s.isSourcePublic,dropResult:null,didDrop:!1});case Jd:return li({},e,{isSourcePublic:!0});case il:return li({},e,{targetIds:s.targetIds});case al:return e.targetIds.indexOf(s.targetId)===-1?e:li({},e,{targetIds:z1(e.targetIds,s.targetId)});case nl:return li({},e,{dropResult:s.dropResult,didDrop:!0,targetIds:[]});case rl:return li({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Ub(e=0,t){switch(t.type){case tu:case su:return e+1;case ou:case al:return e-1;default:return e}}function $b(e=0){return e+1}function qb(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function Kb(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{},o=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(s).filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable}))),o.forEach(function(i){qb(e,i,s[i])})}return e}function Yb(e={},t){return{dirtyHandlerIds:Gb(e.dirtyHandlerIds,{type:t.type,payload:Kb({},t.payload,{prevTargetIds:V1(e,"dragOperation.targetIds",[])})}),dragOffset:zb(e.dragOffset,t),refCount:Ub(e.refCount,t),dragOperation:jb(e.dragOperation,t),stateId:$b(e.stateId)}}function Zb(e,t=void 0,s={},o=!1){const i=Xb(o),n=new Cb(i,new Lb(i)),r=new hb(i,n),a=e(r,t,s);return r.receiveBackend(a),r}function Xb(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Up(Yb,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Qb(e,t){if(e==null)return{};var s=Jb(e,t),o,i;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(s[o]=e[o])}return s}function Jb(e,t){if(e==null)return{};var s={},o=Object.keys(e),i,n;for(n=0;n<o.length;n++)i=o[n],!(t.indexOf(i)>=0)&&(s[i]=e[i]);return s}let Ih=0;const la=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var e0=g.memo(function(t){var{children:s}=t,o=Qb(t,["children"]);const[i,n]=t0(o);return g.useEffect(()=>{if(n){const r=Xp();return++Ih,()=>{--Ih===0&&(r[la]=null)}}},[]),f.jsx(jp.Provider,{value:i,children:s})});function t0(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=s0(e.backend,e.context,e.options,e.debugMode),s=!e.context;return[t,s]}function s0(e,t=Xp(),s,o){const i=t;return i[la]||(i[la]={dragDropManager:Zb(e,t,s,o)}),i[la]}function Xp(){return typeof global<"u"?global:window}function o0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tc,kh;function i0(){return kh||(kh=1,tc=function e(t,s){if(t===s)return!0;if(t&&s&&typeof t=="object"&&typeof s=="object"){if(t.constructor!==s.constructor)return!1;var o,i,n;if(Array.isArray(t)){if(o=t.length,o!=s.length)return!1;for(i=o;i--!==0;)if(!e(t[i],s[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if(n=Object.keys(t),o=n.length,o!==Object.keys(s).length)return!1;for(i=o;i--!==0;)if(!Object.prototype.hasOwnProperty.call(s,n[i]))return!1;for(i=o;i--!==0;){var r=n[i];if(!e(t[r],s[r]))return!1}return!0}return t!==t&&s!==s}),tc}var n0=i0();const r0=o0(n0),Mo=typeof window<"u"?g.useLayoutEffect:g.useEffect;function a0(e,t,s){const[o,i]=g.useState(()=>t(e)),n=g.useCallback(()=>{const r=t(e);r0(o,r)||(i(r),s&&s())},[o,e,s]);return Mo(n),[o,n]}function l0(e,t,s){const[o,i]=a0(e,t,s);return Mo(function(){const r=e.getHandlerId();if(r!=null)return e.subscribeToStateChange(i,{handlerIds:[r]})},[e,i]),o}function Qp(e,t,s){return l0(t,e||(()=>({})),()=>s.reconnect())}function Jp(e,t){const s=[...t||[]];return t==null&&typeof e!="function"&&s.push(e),g.useMemo(()=>typeof e=="function"?e():e,s)}function c0(e){return g.useMemo(()=>e.hooks.dragSource(),[e])}function d0(e){return g.useMemo(()=>e.hooks.dragPreview(),[e])}let sc=!1,oc=!1;class u0{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Pe(!sc,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return sc=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{sc=!1}}isDragging(){if(!this.sourceId)return!1;Pe(!oc,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return oc=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{oc=!1}}subscribeToStateChange(t,s){return this.internalMonitor.subscribeToStateChange(t,s)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,s){return this.internalMonitor.isOverTarget(t,s)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let ic=!1;class h0{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,s){return this.internalMonitor.subscribeToStateChange(t,s)}canDrop(){if(!this.targetId)return!1;Pe(!ic,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return ic=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{ic=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function g0(e,t,s){const o=s.getRegistry(),i=o.addTarget(e,t);return[i,()=>o.removeTarget(i)]}function p0(e,t,s){const o=s.getRegistry(),i=o.addSource(e,t);return[i,()=>o.removeSource(i)]}function ad(e,t,s,o){let i;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const a=Object.prototype.hasOwnProperty.bind(t);for(let l=0;l<n.length;l++){const c=n[l];if(!a(c))return!1;const d=e[c],u=t[c];if(i=void 0,i===!1||i===void 0&&d!==u)return!1}return!0}function ld(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function f0(e){if(typeof e.type=="string")return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function m0(e){return(t=null,s=null)=>{if(!g.isValidElement(t)){const n=t;return e(n,s),n}const o=t;return f0(o),C0(o,s?n=>e(n,s):e)}}function ef(e){const t={};return Object.keys(e).forEach(s=>{const o=e[s];if(s.endsWith("Ref"))t[s]=e[s];else{const i=m0(o);t[s]=()=>i}}),t}function Ah(e,t){typeof e=="function"?e(t):e.current=t}function C0(e,t){const s=e.ref;return Pe(typeof s!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),s?g.cloneElement(e,{ref:o=>{Ah(s,o),Ah(t,o)}}):g.cloneElement(e,{ref:t})}class v0{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,s=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return s&&this.disconnectDragSource(),this.handlerId?t?(s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),s):(this.lastConnectedDragSource=t,s):s}reconnectDragPreview(t=!1){const s=this.dragPreview,o=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(o&&this.disconnectDragPreview(),!!this.handlerId){if(!s){this.lastConnectedDragPreview=s;return}o&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=s,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,s,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!ad(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!ad(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=ef({dragSource:(s,o)=>{this.clearDragSource(),this.dragSourceOptions=o||null,ld(s)?this.dragSourceRef=s:this.dragSourceNode=s,this.reconnectDragSource()},dragPreview:(s,o)=>{this.clearDragPreview(),this.dragPreviewOptions=o||null,ld(s)?this.dragPreviewRef=s:this.dragPreviewNode=s,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class w0{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const s=this.dropTarget;if(this.handlerId){if(!s){this.lastConnectedDropTarget=s;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=s,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,s,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!ad(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=ef({dropTarget:(s,o)=>{this.clearDropTarget(),this.dropTargetOptions=o,ld(s)?this.dropTargetRef=s:this.dropTargetNode=s,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function ji(){const{dragDropManager:e}=g.useContext(jp);return Pe(e!=null,"Expected drag drop context"),e}function b0(e,t){const s=ji(),o=g.useMemo(()=>new v0(s.getBackend()),[s]);return Mo(()=>(o.dragSourceOptions=e||null,o.reconnect(),()=>o.disconnectDragSource()),[o,e]),Mo(()=>(o.dragPreviewOptions=t||null,o.reconnect(),()=>o.disconnectDragPreview()),[o,t]),o}function S0(){const e=ji();return g.useMemo(()=>new u0(e),[e])}class y0{beginDrag(){const t=this.spec,s=this.monitor;let o=null;return typeof t.item=="object"?o=t.item:typeof t.item=="function"?o=t.item(s):o={},o??null}canDrag(){const t=this.spec,s=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(s):!0}isDragging(t,s){const o=this.spec,i=this.monitor,{isDragging:n}=o;return n?n(i):s===t.getSourceId()}endDrag(){const t=this.spec,s=this.monitor,o=this.connector,{end:i}=t;i&&i(s.getItem(),s),o.reconnect()}constructor(t,s,o){this.spec=t,this.monitor=s,this.connector=o}}function x0(e,t,s){const o=g.useMemo(()=>new y0(e,t,s),[t,s]);return g.useEffect(()=>{o.spec=e},[e]),o}function R0(e){return g.useMemo(()=>{const t=e.type;return Pe(t!=null,"spec.type must be defined"),t},[e])}function F0(e,t,s){const o=ji(),i=x0(e,t,s),n=R0(e);Mo(function(){if(n!=null){const[a,l]=p0(n,i,o);return t.receiveHandlerId(a),s.receiveHandlerId(a),l}},[o,t,s,i,n])}function E0(e,t){const s=Jp(e,t);Pe(!s.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const o=S0(),i=b0(s.options,s.previewOptions);return F0(s,o,i),[Qp(s.collect,o,i),c0(i),d0(i)]}function D0(e){return g.useMemo(()=>e.hooks.dropTarget(),[e])}function P0(e){const t=ji(),s=g.useMemo(()=>new w0(t.getBackend()),[t]);return Mo(()=>(s.dropTargetOptions=e||null,s.reconnect(),()=>s.disconnectDropTarget()),[e]),s}function T0(){const e=ji();return g.useMemo(()=>new h0(e),[e])}function M0(e){const{accept:t}=e;return g.useMemo(()=>(Pe(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class I0{canDrop(){const t=this.spec,s=this.monitor;return t.canDrop?t.canDrop(s.getItem(),s):!0}hover(){const t=this.spec,s=this.monitor;t.hover&&t.hover(s.getItem(),s)}drop(){const t=this.spec,s=this.monitor;if(t.drop)return t.drop(s.getItem(),s)}constructor(t,s){this.spec=t,this.monitor=s}}function k0(e,t){const s=g.useMemo(()=>new I0(e,t),[t]);return g.useEffect(()=>{s.spec=e},[e]),s}function A0(e,t,s){const o=ji(),i=k0(e,t),n=M0(e);Mo(function(){const[a,l]=g0(n,i,o);return t.receiveHandlerId(a),s.receiveHandlerId(a),l},[o,t,i,s,n.map(r=>r.toString()).join("|")])}function tf(e,t){const s=Jp(e,t),o=T0(),i=P0(s.options);return A0(s,o,i),[Qp(s.collect,o,i),D0(i)]}const Lh="column",L0="flex items-center",O0="mr-3 cursor-move text-secondary",N0=({id:e,children:t,className:s,onFind:o,onMove:i,ariaLabel:n="Drag item"})=>{const r=g.useRef(null),a=g.useRef(null),l=typeof o=="function"?o(e):-1,[{isDragging:c},d,u]=E0(()=>({type:Lh,item:{id:e,originalIndex:l},collect:p=>{const m=p.getItem();return{isDragging:p.isDragging()&&m?.id===e}},end:(p,m)=>{if(!p)return;!m.didDrop()&&typeof i=="function"&&p.originalIndex>-1&&i(p.id,p.originalIndex)}}),[e,l,i]),[,h]=tf(()=>({accept:Lh,hover:p=>{if(!(!p||p.id===e)&&typeof o=="function"&&typeof i=="function"){const m=o(e);i(p.id,m)}}}),[o,i,e]);return u(h(a)),d(r),f.jsxs("div",{ref:a,className:oe(L0,s),style:{opacity:c?0:1},"aria-roledescription":"Draggable item",children:[f.jsx("div",{ref:r,className:O0,"aria-label":n,children:f.jsx(G.IconGripVertical,{...Y})}),t]})},H0=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M3.68628 10.3945C3.91003 10.408 4.10927 10.4422 4.2832 10.4978L4.28394 10.4971C4.5167 10.5698 4.71621 10.6662 4.87939 10.7871C4.9994 10.876 5.10332 10.974 5.18994 11.0815L5.27051 11.1929L5.27197 11.1943L5.34009 11.3079C5.38301 11.3838 5.42067 11.4597 5.45288 11.5356L5.49683 11.6492L5.49756 11.6514L5.53198 11.7649C5.56274 11.877 5.5838 11.9867 5.59497 12.0938C5.61194 12.23 5.62059 12.3501 5.62061 12.4534C5.62061 12.6166 5.57231 12.7639 5.47559 12.8906C5.41544 12.9694 5.325 13.0198 5.21997 13.0503C5.11455 13.0809 4.98537 13.0942 4.83691 13.0942C4.73711 13.0942 4.62608 13.0838 4.50439 13.0635C4.37577 13.0415 4.26002 12.9966 4.16089 12.9272L4.15869 12.9258C4.04118 12.8396 3.98657 12.7121 3.98657 12.5625C3.98655 12.2721 3.94576 12.0552 3.87231 11.9033L3.87158 11.9011C3.81572 11.7798 3.69406 11.7026 3.45337 11.7026C3.33114 11.7027 3.25307 11.7292 3.20435 11.7671C3.14221 11.8149 3.10061 11.864 3.07617 11.9128C3.04149 11.985 3.02355 12.0599 3.02124 12.1384V14.7905L3.02637 14.8652C3.03466 14.9384 3.05266 15.0073 3.07983 15.0725L3.10254 15.1201C3.12874 15.1672 3.16488 15.2124 3.21167 15.2556C3.2602 15.2978 3.33572 15.3259 3.45337 15.3259C3.56813 15.3259 3.65533 15.3041 3.71997 15.2673C3.78314 15.2313 3.83208 15.1772 3.86646 15.0996C3.94535 14.9186 3.98655 14.7002 3.98657 14.4412C3.98657 14.3004 4.04381 14.1839 4.1499 14.0991L4.19824 14.0647C4.33673 13.9762 4.55866 13.9431 4.83691 13.9431C5.09384 13.9431 5.30559 13.9858 5.43604 14.1013C5.55182 14.204 5.62061 14.3293 5.62061 14.4749C5.62057 14.7549 5.57953 15.0125 5.49536 15.2461L5.45654 15.3442C5.36294 15.5677 5.23261 15.7627 5.06543 15.928L4.99146 15.9968C4.58057 16.3629 4.03856 16.541 3.37793 16.541L3.12671 16.5278C3.00679 16.5188 2.87303 16.495 2.72607 16.4575C2.61505 16.4287 2.50136 16.3894 2.38696 16.3396L2.27197 16.2861C2.1155 16.2094 1.9705 16.0983 1.83691 15.9558L1.83618 15.9551C1.70598 15.8128 1.59909 15.6391 1.51392 15.4365L1.51318 15.4351C1.42797 15.2251 1.38722 14.9736 1.38721 14.6843V12.345C1.38721 12.1069 1.41644 11.892 1.47656 11.7026C1.52068 11.5616 1.57629 11.4337 1.64355 11.3196L1.7146 11.2097C1.81013 11.07 1.92167 10.9524 2.04932 10.8582C2.17206 10.7676 2.29884 10.6909 2.42871 10.6289L2.54297 10.5798C2.81231 10.4716 3.11394 10.4081 3.44678 10.3879L3.45337 10.3872L3.68628 10.3945Z",fill:"currentColor"}),Se.createElement("path",{d:"M8.10791 11.7371C8.33261 11.7371 8.5218 11.8023 8.61255 11.9758C8.68772 12.1131 8.72383 12.2741 8.72388 12.4534V12.7522H9.03003C9.21461 12.7522 9.37781 12.7845 9.5127 12.8562C9.68704 12.9456 9.7463 13.149 9.74634 13.3843C9.74634 13.612 9.68105 13.8034 9.50537 13.894L9.5061 13.8948C9.36923 13.9665 9.20861 14.0002 9.03003 14.0002H8.72388V14.3064C8.72388 14.4941 8.68994 14.6588 8.61768 14.7942L8.61841 14.7949C8.5293 14.9647 8.334 15.0226 8.10791 15.0227C7.87257 15.0227 7.66761 14.9685 7.5769 14.8L7.57617 14.7993C7.50612 14.6659 7.47583 14.4988 7.47583 14.3064V14.0002H7.18579C6.99507 14.0002 6.82804 13.9669 6.69214 13.894C6.52182 13.8026 6.46069 13.6102 6.46069 13.3843C6.46073 13.1491 6.51509 12.944 6.68335 12.8533L6.68481 12.8525L6.79102 12.8079C6.90305 12.7697 7.03293 12.7522 7.177 12.7522H7.47583V12.4534C7.47587 12.2683 7.50712 12.1056 7.57617 11.9707L7.5769 11.9685L7.61646 11.9092C7.72038 11.7825 7.90134 11.7371 8.10791 11.7371Z",fill:"currentColor"}),Se.createElement("path",{d:"M12.728 11.7371C12.9527 11.7371 13.1419 11.8023 13.2327 11.9758C13.3078 12.1131 13.3439 12.2741 13.344 12.4534V12.7522H13.6501C13.8347 12.7522 13.9979 12.7845 14.1328 12.8562C14.3072 12.9456 14.3664 13.149 14.3665 13.3843C14.3665 13.612 14.3012 13.8034 14.1255 13.894L14.1262 13.8948C13.9894 13.9665 13.8287 14.0002 13.6501 14.0002H13.344V14.3064C13.344 14.4941 13.3101 14.6588 13.2378 14.7942L13.2385 14.7949C13.1494 14.9647 12.9541 15.0226 12.728 15.0227C12.4927 15.0227 12.2877 14.9685 12.197 14.8L12.1963 14.7993C12.1262 14.6659 12.0959 14.4988 12.0959 14.3064V14.0002H11.8059C11.6152 14.0002 11.4482 13.9669 11.3123 13.894C11.1419 13.8026 11.0808 13.6102 11.0808 13.3843C11.0808 13.1491 11.1352 12.944 11.3035 12.8533L11.3049 12.8525L11.4111 12.8079C11.5232 12.7697 11.653 12.7522 11.7971 12.7522H12.0959V12.4534C12.096 12.2683 12.1272 12.1056 12.1963 11.9707L12.197 11.9685L12.2366 11.9092C12.3405 11.7825 12.5215 11.7371 12.728 11.7371Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.574 1.50366C10.7457 1.52068 10.9072 1.59662 11.0303 1.71973L14.7803 5.46973C14.9209 5.61038 15 5.80109 15 6V9C15 9.41421 14.6642 9.75 14.25 9.75C13.8358 9.75 13.5 9.41421 13.5 9V6.75H11.25C10.8522 6.75 10.4708 6.59185 10.1895 6.31055C9.90815 6.02924 9.75 5.64783 9.75 5.25V3H5.25C5.05109 3 4.86038 3.07907 4.71973 3.21973C4.57907 3.36038 4.5 3.55109 4.5 3.75V9C4.5 9.41421 4.16421 9.75 3.75 9.75C3.33579 9.75 3 9.41421 3 9V3.75C3 3.15326 3.23722 2.58114 3.65918 2.15918C4.08114 1.73722 4.65326 1.5 5.25 1.5H10.5L10.574 1.50366ZM11.25 5.25H12.4395L11.25 4.06055V5.25Z",fill:"currentColor"})),G0=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M4.29639 10.3945C4.50665 10.4083 4.69413 10.4433 4.85815 10.5L4.85889 10.4993C5.07789 10.5733 5.26574 10.6715 5.41919 10.7944C5.53204 10.8849 5.62958 10.9843 5.71069 11.0933L5.78613 11.2053L5.78687 11.2068L5.85059 11.3218C5.89058 11.3983 5.92606 11.4746 5.95605 11.551L5.99707 11.666L5.9978 11.6682L6.05566 11.8945C6.0708 11.9689 6.08168 12.0422 6.08862 12.1143C6.10449 12.252 6.11279 12.3734 6.11279 12.4775C6.11276 12.6403 6.06824 12.7876 5.97803 12.9155C5.92155 12.9956 5.83545 13.0472 5.73486 13.0789C5.63441 13.1104 5.51212 13.1243 5.37231 13.1243C5.32505 13.1243 5.27524 13.1215 5.2229 13.1162L5.05811 13.0928C4.93553 13.0701 4.82533 13.024 4.73145 12.9529L4.72998 12.9514C4.61882 12.8632 4.56958 12.7352 4.56958 12.5874C4.56955 12.2926 4.5312 12.0715 4.46191 11.9165L4.46045 11.9143C4.4319 11.8474 4.38931 11.8003 4.33154 11.7686C4.27185 11.7358 4.18944 11.7158 4.07812 11.7158C3.96626 11.7158 3.89622 11.7421 3.85254 11.7788C3.79519 11.8265 3.75637 11.8759 3.73315 11.926C3.70026 11.9999 3.68262 12.0771 3.68042 12.1582V14.8425L3.68555 14.9187C3.69337 14.9937 3.71038 15.0643 3.73608 15.1311L3.75732 15.1802C3.78176 15.2276 3.81496 15.2727 3.85767 15.3157L3.89575 15.3442C3.93843 15.3699 3.99697 15.386 4.07812 15.386C4.18296 15.386 4.26146 15.3647 4.31982 15.3289C4.37727 15.2935 4.4233 15.2389 4.45605 15.1589C4.53037 14.9746 4.56957 14.7522 4.56958 14.4888C4.56958 14.3307 4.63662 14.2007 4.7666 14.1116L4.82007 14.0801C4.95284 14.0119 5.14337 13.9856 5.37231 13.9856C5.61445 13.9856 5.81633 14.0298 5.94067 14.1489C6.04986 14.2536 6.11274 14.379 6.11279 14.5225C6.11279 14.8453 6.06245 15.1386 5.95972 15.3999C5.85998 15.6574 5.71501 15.8781 5.52466 16.0598L5.52393 16.0591C5.13817 16.4307 4.62871 16.6128 4.00708 16.6128C3.95774 16.6128 3.87811 16.6081 3.77124 16.5996C3.65793 16.5904 3.53127 16.5659 3.39331 16.5278C3.28866 16.4984 3.18149 16.4584 3.07397 16.4077L2.96631 16.3535C2.81858 16.2752 2.68196 16.1624 2.55688 16.0181L2.55615 16.0166C2.43435 15.8725 2.33453 15.6972 2.25513 15.4929L2.25439 15.4915C2.17508 15.28 2.13721 15.0267 2.13721 14.7349V12.3669C2.13721 12.1269 2.16476 11.9109 2.2207 11.7202L2.26538 11.5825C2.3136 11.4491 2.37234 11.3289 2.44263 11.2229C2.53187 11.0816 2.63607 10.9621 2.7561 10.8662C2.87117 10.7743 2.98996 10.6964 3.11206 10.6333L3.11353 10.6326L3.22046 10.5828C3.47384 10.4727 3.75793 10.4085 4.0708 10.3879L4.07812 10.3872L4.29639 10.3945Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.574 1.50366C10.7457 1.52068 10.9072 1.59662 11.0303 1.71973L14.7803 5.46973C14.9209 5.61038 15 5.80109 15 6V14.25C15 14.8467 14.7628 15.4189 14.3408 15.8408C13.9189 16.2628 13.3467 16.5 12.75 16.5H8.625C8.21079 16.5 7.875 16.1642 7.875 15.75C7.875 15.3358 8.21079 15 8.625 15H12.75C12.9489 15 13.1396 14.9209 13.2803 14.7803C13.4209 14.6396 13.5 14.4489 13.5 14.25V6.75H11.25C10.8522 6.75 10.4708 6.59185 10.1895 6.31055C9.90815 6.02924 9.75 5.64783 9.75 5.25V3H5.25C5.05109 3 4.86038 3.07907 4.71973 3.21973C4.57907 3.36038 4.5 3.55109 4.5 3.75V9C4.5 9.41421 4.16421 9.75 3.75 9.75C3.33579 9.75 3 9.41421 3 9V3.75C3 3.15326 3.23722 2.58114 3.65918 2.15918C4.08114 1.73722 4.65326 1.5 5.25 1.5H10.5L10.574 1.50366ZM11.25 5.25H12.4395L11.25 4.06055V5.25Z",fill:"currentColor"})),B0=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M3.62109 10.571C3.83849 10.5842 4.03206 10.618 4.20117 10.6721L4.2019 10.6714C4.42776 10.742 4.62121 10.8352 4.77979 10.9526C4.89663 11.0392 4.99793 11.135 5.08228 11.2397L5.16064 11.3474L5.16211 11.3489L5.22803 11.4595C5.26973 11.5332 5.30659 11.6069 5.33789 11.6807L5.38037 11.7905L5.3811 11.7935L5.44116 12.0117C5.45675 12.0826 5.46834 12.1524 5.47559 12.2212L5.49463 12.4087C5.49888 12.4674 5.50049 12.5222 5.50049 12.5728C5.50045 12.7317 5.45415 12.8755 5.35986 12.999C5.30088 13.0762 5.2117 13.1246 5.10938 13.1543C5.0067 13.1841 4.88146 13.1975 4.7373 13.1975C4.64029 13.1975 4.53244 13.1872 4.41431 13.1675C4.28898 13.1461 4.17557 13.1026 4.07886 13.0349L4.07739 13.0334C3.96236 12.9491 3.90894 12.8243 3.90894 12.6782C3.90893 12.3968 3.86925 12.187 3.79834 12.0403L3.79761 12.0381C3.74418 11.922 3.62816 11.847 3.39551 11.8469C3.27715 11.8469 3.20179 11.873 3.15527 11.9092C3.09597 11.9548 3.05572 12.0012 3.03223 12.0476L3.03296 12.0483C2.99919 12.1182 2.98102 12.1906 2.97876 12.2666V14.8396L2.98389 14.9114C2.99188 14.9821 3.00888 15.049 3.03516 15.1121L3.05786 15.1582C3.08304 15.2033 3.11768 15.2464 3.1626 15.2878C3.2089 15.3285 3.28115 15.356 3.39551 15.356C3.50633 15.3559 3.58982 15.3349 3.65186 15.2996C3.71249 15.2651 3.75936 15.2131 3.79248 15.1384L3.84302 15.0007C3.88665 14.8554 3.90893 14.6891 3.90894 14.5005C3.90894 14.363 3.96502 14.2494 4.0686 14.1665L4.11621 14.1328C4.25147 14.0465 4.46739 14.0134 4.7373 14.0134C4.98658 14.0134 5.19278 14.0552 5.32031 14.168C5.43323 14.268 5.5004 14.3903 5.50049 14.5327C5.50049 14.8049 5.46077 15.0556 5.37891 15.2827L5.34155 15.3779C5.23762 15.6261 5.08621 15.8373 4.88892 16.0115L4.88965 16.0122C4.49029 16.3681 3.96383 16.541 3.32227 16.541C3.27168 16.541 3.18935 16.5367 3.07837 16.5286C3.02014 16.5242 2.95789 16.5158 2.89307 16.5044L2.68799 16.4597C2.5801 16.4317 2.47025 16.3938 2.35913 16.3455L2.2478 16.2935C2.09553 16.2188 1.95433 16.1112 1.82446 15.9727L1.82373 15.9712C1.69712 15.8328 1.593 15.6642 1.51025 15.4673L1.50952 15.4658C1.42669 15.2616 1.38721 15.0172 1.38721 14.7363V12.4666C1.38723 12.2355 1.41597 12.0273 1.47437 11.8433C1.53119 11.6615 1.60684 11.502 1.70361 11.3665L1.77686 11.2676C1.85263 11.1732 1.9374 11.0913 2.03101 11.0222C2.15024 10.9342 2.27322 10.8598 2.39941 10.7996L2.40015 10.7988L2.51074 10.7512C2.77229 10.6462 3.0652 10.5848 3.38818 10.5652L3.39551 10.5645L3.62109 10.571Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.574 1.50366C10.7457 1.52068 10.9072 1.59662 11.0303 1.71973L14.7803 5.46973C14.9209 5.61038 15 5.80109 15 6V14.25C15 14.8467 14.7628 15.4189 14.3408 15.8408C13.9189 16.2628 13.3467 16.5 12.75 16.5H12C11.5858 16.5 11.25 16.1642 11.25 15.75C11.25 15.3358 11.5858 15 12 15H12.75C12.9489 15 13.1396 14.9209 13.2803 14.7803C13.4209 14.6396 13.5 14.4489 13.5 14.25V6.75H11.25C10.8522 6.75 10.4708 6.59185 10.1895 6.31055C9.90815 6.02924 9.75 5.64783 9.75 5.25V3H5.25C5.05109 3 4.86038 3.07907 4.71973 3.21973C4.57907 3.36038 4.5 3.55109 4.5 3.75V9C4.5 9.41421 4.16421 9.75 3.75 9.75C3.33579 9.75 3 9.41421 3 9V3.75C3 3.15326 3.23722 2.58114 3.65918 2.15918C4.08114 1.73722 4.65326 1.5 5.25 1.5H10.5L10.574 1.50366ZM11.25 5.25H12.4395L11.25 4.06055V5.25Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.36914 11.28C9.50263 11.28 9.62352 11.3063 9.72583 11.3643L9.7251 11.365C9.85906 11.4379 9.90454 11.5838 9.90454 11.7429C9.9045 11.7567 9.90157 11.7778 9.89941 11.7935C9.89658 11.814 9.89242 11.8422 9.88696 11.8777C9.87611 11.9455 9.8639 12.0222 9.85034 12.1062C9.84553 12.136 9.84018 12.1643 9.83569 12.1912H10.0525C10.1919 12.1912 10.3171 12.2148 10.4216 12.2688L10.4209 12.2695C10.5686 12.3412 10.6128 12.5089 10.6128 12.6863C10.6128 12.8587 10.5617 13.0123 10.4194 13.0898L10.4187 13.0906C10.3122 13.1472 10.1885 13.1726 10.0525 13.1726H9.67529L9.55225 13.8589H9.75952C9.89706 13.8589 10.0206 13.8819 10.1243 13.9343C10.2748 14.005 10.3198 14.1752 10.3198 14.354C10.3198 14.5291 10.2702 14.6875 10.1243 14.7627L10.1235 14.7634C10.0176 14.8164 9.89461 14.8403 9.75952 14.8403H9.38452L9.33398 15.1677L9.33325 15.1714C9.30492 15.3271 9.26297 15.4669 9.20728 15.5903L9.20801 15.5911C9.17656 15.6626 9.13001 15.7228 9.06592 15.7646C9.00162 15.8065 8.92683 15.8247 8.84839 15.8247C8.72 15.8247 8.60307 15.8041 8.50122 15.7581L8.49976 15.7573C8.35755 15.6908 8.31299 15.5386 8.31299 15.3787C8.31299 15.3406 8.31787 15.2939 8.32617 15.241L8.35913 15.0242C8.36863 14.9624 8.37948 14.9012 8.38989 14.8403H7.92847L7.87793 15.1677L7.8772 15.1714C7.84887 15.3271 7.80691 15.4669 7.75122 15.5903L7.75195 15.5911C7.72046 15.6627 7.6734 15.7228 7.60913 15.7646C7.54487 15.8064 7.47071 15.8247 7.39233 15.8247C7.26394 15.8247 7.14702 15.8041 7.04517 15.7581L7.0437 15.7573C6.90149 15.6908 6.85693 15.5387 6.85693 15.3787C6.85694 15.3406 6.86181 15.2939 6.87012 15.241L6.90308 15.0242C6.91257 14.9624 6.92342 14.9012 6.93384 14.8403H6.6687C6.52906 14.8403 6.40313 14.8167 6.29663 14.7634L6.29297 14.762C6.15355 14.6853 6.10844 14.5261 6.1084 14.354C6.1084 14.1782 6.1487 14.0079 6.29297 13.9358C6.39784 13.882 6.52535 13.8589 6.6687 13.8589H7.09497L7.21802 13.1726H6.95361C6.81311 13.1726 6.68646 13.1475 6.57935 13.0906L6.57788 13.0898C6.43874 13.0135 6.39332 12.8568 6.39331 12.6863C6.39331 12.5105 6.43361 12.3402 6.57788 12.2681C6.68271 12.2144 6.81036 12.1912 6.95361 12.1912H7.38721L7.46045 11.7561C7.47174 11.6625 7.50842 11.5673 7.56372 11.4712C7.63824 11.3418 7.76255 11.2801 7.91309 11.28C8.04657 11.28 8.16746 11.3063 8.26978 11.3643L8.26904 11.365C8.403 11.4379 8.44849 11.5838 8.44849 11.7429C8.44844 11.7567 8.44552 11.7778 8.44336 11.7935C8.44053 11.814 8.43636 11.8422 8.43091 11.8777C8.42006 11.9455 8.40784 12.0222 8.39429 12.1062C8.38947 12.136 8.38413 12.1643 8.37964 12.1912H8.84326L8.9165 11.7561C8.92779 11.6625 8.96448 11.5673 9.01978 11.4712C9.0943 11.3418 9.21861 11.2801 9.36914 11.28ZM8.09619 13.8589H8.55103L8.67407 13.1726H8.21924L8.09619 13.8589Z",fill:"currentColor"})),V0=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M4.43188 10.4409C4.65285 10.4409 4.85471 10.4869 4.99951 10.6152L4.99878 10.6159C5.13097 10.7305 5.21409 10.881 5.25146 11.0576C5.28474 11.2148 5.30052 11.3869 5.30054 11.5724V15.4323C5.30054 15.6193 5.28417 15.7927 5.25146 15.9516L5.2522 15.9523C5.21779 16.1313 5.13551 16.2842 4.99951 16.3976L4.99878 16.3969C4.85386 16.52 4.65269 16.5646 4.43188 16.5646C4.21337 16.5646 4.01411 16.5195 3.86792 16.3976L3.86353 16.394C3.73466 16.2798 3.65263 16.1299 3.6123 15.9553L3.61157 15.9516C3.57826 15.7941 3.5625 15.6205 3.5625 15.4323V11.5724C3.56252 11.3869 3.5783 11.2148 3.61157 11.0576C3.64882 10.8815 3.72996 10.7302 3.85986 10.6152L3.86133 10.6137C4.00804 10.4875 4.2103 10.4409 4.43188 10.4409Z",fill:"currentColor"}),Se.createElement("path",{d:"M8.07129 10.4474C8.18434 10.4599 8.28945 10.4924 8.3811 10.55L8.38184 10.5493C8.45754 10.5942 8.52569 10.6451 8.58472 10.7016L8.64111 10.7602L8.64331 10.7631L8.69385 10.8298C8.72596 10.8768 8.75504 10.9284 8.78101 10.9836L8.81763 11.0685L8.81909 11.0729L9.85986 13.8928V11.2692C9.85986 11.0565 9.89522 10.8654 9.98291 10.7119L9.98364 10.7104L10.0349 10.6393C10.1656 10.4886 10.3781 10.4409 10.5974 10.4409C10.8635 10.4409 11.125 10.4947 11.2529 10.6965C11.3535 10.8508 11.3928 11.0487 11.3928 11.2692V15.4323C11.3928 15.6163 11.3809 15.7863 11.3577 15.9413L11.3584 15.9421C11.3349 16.1167 11.2678 16.2708 11.1467 16.3881C11.0102 16.5202 10.8106 16.5646 10.5974 16.5646H10.0554C9.86994 16.5646 9.69972 16.5199 9.56104 16.416C9.44129 16.3261 9.3452 16.215 9.27466 16.0842C9.21353 15.9706 9.16292 15.8593 9.12378 15.7509L8.14893 13.1091V15.7363C8.14893 15.9493 8.11322 16.1406 8.02661 16.2958L8.02588 16.2973C7.90706 16.5052 7.66112 16.5646 7.41138 16.5646C7.14233 16.5646 6.88122 16.5106 6.75 16.312C6.64812 16.1572 6.60791 15.9581 6.60791 15.7363V11.5724C6.60792 11.3882 6.61818 11.2193 6.63867 11.0671V11.0641L6.66724 10.9367C6.7042 10.8142 6.76699 10.706 6.85986 10.6188C6.9982 10.4862 7.19704 10.4409 7.41138 10.4409H7.95337L8.07129 10.4474Z",fill:"currentColor"}),Se.createElement("path",{d:"M13.5688 10.4409C13.7898 10.4409 13.9917 10.4869 14.1365 10.6152L14.1357 10.6159C14.2679 10.7305 14.3511 10.881 14.3884 11.0576C14.4217 11.2148 14.4375 11.3869 14.4375 11.5724V15.4323C14.4375 15.6193 14.4211 15.7927 14.3884 15.9516L14.3892 15.9523C14.3548 16.1313 14.2725 16.2842 14.1365 16.3976L14.1357 16.3969C13.9908 16.52 13.7897 16.5646 13.5688 16.5646C13.3503 16.5646 13.1511 16.5195 13.0049 16.3976L13.0005 16.394C12.8716 16.2798 12.7896 16.1299 12.7493 15.9553L12.7485 15.9516C12.7152 15.7941 12.6995 15.6205 12.6995 15.4323V11.5724C12.6995 11.3869 12.7153 11.2148 12.7485 11.0576C12.7858 10.8815 12.8669 10.7302 12.9968 10.6152L12.9983 10.6137C13.145 10.4875 13.3473 10.4409 13.5688 10.4409Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.574 1.50385C10.7457 1.52087 10.9072 1.59681 11.0303 1.71991L14.7803 5.46991C14.9208 5.61054 15 5.80136 15 6.00018V9.00018C14.9998 9.41423 14.6641 9.75018 14.25 9.75018C13.8359 9.75018 13.5002 9.41423 13.5 9.00018V6.75018H11.25C10.8523 6.75018 10.4707 6.59192 10.1895 6.31073C9.90824 6.02951 9.7501 5.64788 9.75 5.25018V3.00018H5.25C5.05109 3.00018 4.86038 3.07926 4.71973 3.21991C4.57919 3.36054 4.5 3.55136 4.5 3.75018V9.00018C4.4998 9.41423 4.16409 9.75018 3.75 9.75018C3.33591 9.75018 3.0002 9.41423 3 9.00018V3.75018C3 3.15353 3.23734 2.5813 3.65918 2.15936C4.08114 1.73741 4.65326 1.50018 5.25 1.50018H10.5L10.574 1.50385ZM11.25 5.25018H12.4395L11.25 4.06073V5.25018Z",fill:"currentColor"})),z0=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M6.76831 10.8267C6.93291 10.8267 7.08404 10.8408 7.22021 10.8691L7.35205 10.9021L7.35278 10.9028L7.46851 10.9431C7.57872 10.986 7.67614 11.038 7.75928 11.0991C7.84245 11.1591 7.91481 11.2265 7.97388 11.3005L8.02881 11.3767L8.02954 11.3774L8.11011 11.5254C8.13317 11.5747 8.15233 11.6249 8.16797 11.6755C8.19815 11.7711 8.21863 11.8631 8.22656 11.9502C8.23376 12.0294 8.23755 12.096 8.23755 12.1479C8.23753 12.318 8.17338 12.4626 8.04639 12.572C7.92503 12.676 7.77653 12.7265 7.60913 12.7266C7.4711 12.7266 7.34146 12.6749 7.22241 12.583C7.1027 12.4905 7.02328 12.3741 7.02319 12.2329C7.02319 12.0468 6.98759 11.9498 6.94775 11.907L6.94629 11.9055C6.90561 11.8606 6.83878 11.8294 6.72583 11.8293C6.58234 11.8293 6.48534 11.856 6.42334 11.896C6.4086 11.9056 6.38747 11.9281 6.37061 11.981C6.35372 12.0341 6.34351 12.1099 6.34351 12.2117C6.34581 12.2878 6.36799 12.3546 6.40869 12.4153C6.45761 12.4821 6.52298 12.549 6.60718 12.6138L6.73608 12.7053C6.78632 12.7386 6.84449 12.7751 6.9104 12.8145C7.04454 12.8945 7.16167 12.9644 7.2605 13.0232L7.44507 13.1426C7.50565 13.1844 7.56597 13.2284 7.62524 13.2744C7.74715 13.3666 7.8562 13.4715 7.95337 13.5886C8.05276 13.7085 8.13297 13.8432 8.1936 13.9922C8.25599 14.1456 8.28891 14.3172 8.29395 14.5049V14.5364C8.29395 14.7339 8.26896 14.9141 8.21777 15.0754V15.0776C8.11696 15.3776 7.94914 15.6082 7.7124 15.761L7.71313 15.7617C7.62701 15.8179 7.53944 15.8644 7.45166 15.9016L7.36304 15.936C7.30225 15.9571 7.24075 15.9753 7.1792 15.9902L6.99243 16.0261C6.87331 16.0431 6.75886 16.0529 6.65039 16.0554H6.61304C6.41017 16.0554 6.22414 16.0345 6.05786 15.9917C5.89914 15.9495 5.75823 15.8922 5.63892 15.8196L5.63745 15.8188C5.52025 15.7449 5.42093 15.6589 5.34155 15.561C5.26338 15.4674 5.20001 15.3681 5.15332 15.2644C5.10802 15.1659 5.07431 15.0659 5.05371 14.9656C5.03361 14.8676 5.02297 14.7738 5.02295 14.6851C5.02295 14.5014 5.0798 14.3447 5.20898 14.2375L5.20972 14.2368L5.30493 14.1731C5.40409 14.1186 5.51594 14.0918 5.63745 14.0918C5.79553 14.0919 5.94175 14.1407 6.07251 14.2354L6.12451 14.2764C6.2216 14.3622 6.27861 14.4745 6.2959 14.6067L6.30103 14.6741L6.31055 14.7847C6.32502 14.8796 6.35383 14.9312 6.38306 14.9568C6.43071 14.9963 6.50789 15.0238 6.63135 15.0242C6.76743 15.0198 6.85874 14.9863 6.91772 14.9355L6.91846 14.9341L6.95361 14.8938C6.98575 14.8434 7.00924 14.7604 7.00928 14.6287C7.00928 14.4903 6.96843 14.3706 6.8877 14.2661L6.88696 14.2646C6.80068 14.1504 6.68858 14.0439 6.55078 13.946L6.55005 13.9453C6.40626 13.841 6.25592 13.7396 6.10034 13.6421C5.93262 13.5343 5.77326 13.4207 5.62427 13.303L5.62354 13.3022C5.46846 13.1772 5.34021 13.0351 5.24121 12.8752C5.13746 12.7076 5.0852 12.514 5.08008 12.2988V12.2388L5.0874 12.0505C5.10126 11.869 5.13388 11.7086 5.18628 11.5708V11.5693L5.2478 11.4382C5.31532 11.3136 5.40255 11.2077 5.51074 11.1233L5.62207 11.0464C5.73813 10.9764 5.87099 10.9263 6.01831 10.894C6.21201 10.8494 6.43196 10.8267 6.67603 10.8267H6.76831Z",fill:"currentColor"}),Se.createElement("path",{d:"M14.2266 10.8062C14.3565 10.8062 14.4736 10.8329 14.5693 10.8933L14.5701 10.8926L14.5715 10.894L14.5737 10.8948L14.573 10.8955C14.6342 10.9321 14.6895 10.9722 14.7363 11.0171L14.781 11.064L14.7825 11.0662L14.8235 11.1204C14.8363 11.1392 14.8492 11.159 14.8608 11.1797L14.9246 11.3159L14.9253 11.3181L15.9163 14.0024V11.4705C15.9163 11.2922 15.9461 11.1369 16.0159 11.0149L16.054 10.9607C16.1527 10.8467 16.3175 10.8062 16.5022 10.8062C16.7284 10.8062 16.9271 10.8532 17.0229 11.0017C17.1032 11.1237 17.1379 11.2847 17.1379 11.4705V15.0535C17.1379 15.21 17.1275 15.3541 17.1079 15.4849L17.1086 15.4856C17.0896 15.6273 17.0355 15.7491 16.9409 15.8408C16.837 15.9414 16.6806 15.9784 16.5022 15.9785H16.0356C15.8837 15.9785 15.7483 15.9422 15.6394 15.8606C15.5419 15.7874 15.4638 15.6974 15.4065 15.5911C15.3549 15.4953 15.3125 15.4018 15.2798 15.3113L14.3459 12.7815V15.3149C14.3459 15.4932 14.316 15.6489 14.2471 15.7727L14.2463 15.7734C14.158 15.9281 13.9711 15.9784 13.76 15.9785C13.53 15.9785 13.3292 15.9315 13.2312 15.783C13.151 15.6609 13.1169 15.5006 13.1169 15.3149V11.7319C13.117 11.575 13.126 11.4319 13.1433 11.3035V11.3013L13.166 11.1987C13.1955 11.1009 13.2454 11.0157 13.3176 10.9475L13.3594 10.9124C13.4627 10.8363 13.6027 10.8062 13.76 10.8062H14.2266Z",fill:"currentColor"}),Se.createElement("path",{d:"M3.62183 10.73C3.8058 10.73 3.96571 10.7696 4.07959 10.8677C4.185 10.9586 4.25306 11.0796 4.28613 11.2229C4.31675 11.3557 4.33154 11.5018 4.33154 11.6602V14.3606C4.33154 14.617 4.29481 14.8413 4.21655 15.0293C4.15993 15.1652 4.09098 15.286 4.00928 15.3896L3.92285 15.4878C3.80762 15.6056 3.67869 15.6971 3.5376 15.7625L3.53833 15.7632C3.40115 15.8269 3.27011 15.872 3.14722 15.8979L3.14795 15.8987C3.09669 15.9112 3.04501 15.9213 2.99414 15.9294L2.8418 15.9478C2.74998 15.9548 2.68156 15.9587 2.64111 15.9587C2.3706 15.9587 2.13396 15.928 1.93506 15.8643C1.73937 15.8022 1.56914 15.7204 1.42749 15.6174C1.28776 15.5158 1.17335 15.3984 1.08691 15.2651L1.02686 15.1685C0.970789 15.0715 0.926873 14.9732 0.895752 14.874L0.896484 14.8733C0.852315 14.745 0.821564 14.6203 0.806396 14.499L0.805664 14.4968C0.793555 14.3806 0.786621 14.2779 0.786621 14.1899C0.786659 14.0481 0.829716 13.9196 0.914062 13.8091C0.968035 13.7386 1.04873 13.6949 1.13965 13.6685C1.231 13.642 1.34202 13.6297 1.46851 13.6296C1.55651 13.6297 1.65224 13.6393 1.75415 13.6567C1.8653 13.6758 1.96539 13.7157 2.05151 13.7783C2.15785 13.853 2.20677 13.9666 2.20679 14.0977C2.20679 14.3421 2.24112 14.5246 2.302 14.6528L2.32178 14.6865C2.37332 14.7613 2.46833 14.8095 2.64111 14.8096C2.74386 14.8095 2.80532 14.7883 2.8396 14.762L2.84106 14.7605L2.90552 14.7019C2.92253 14.6822 2.9356 14.6623 2.94507 14.6426L2.97803 14.5518C2.98565 14.5209 2.98953 14.4889 2.99048 14.4565V11.9641H2.17236C2.0293 11.9641 1.8922 11.9536 1.76221 11.9312L1.76001 11.9304C1.62252 11.9035 1.50268 11.8482 1.40698 11.7612L1.40625 11.7598C1.30008 11.6602 1.25688 11.5177 1.25684 11.3547C1.25684 11.1882 1.29936 11.0419 1.40625 10.9417C1.49986 10.8517 1.6187 10.7951 1.75635 10.7681L1.9585 10.7395C2.02775 10.7333 2.09935 10.73 2.17236 10.73H3.62183Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.0061 10.8398C11.1058 10.8474 11.2146 10.8676 11.3313 10.8984L11.332 10.8977C11.4562 10.9275 11.5817 10.9747 11.7078 11.0376L11.803 11.0896C11.8653 11.1277 11.926 11.1727 11.9839 11.2244L12.0688 11.3071L12.0696 11.3079L12.1472 11.4001C12.2197 11.4965 12.2807 11.608 12.3303 11.7327L12.3772 11.8674C12.417 12.0081 12.4358 12.1667 12.4358 12.3406V14.4111C12.4358 14.649 12.4035 14.8579 12.3347 15.0337L12.334 15.0352C12.2654 15.204 12.1782 15.349 12.071 15.4666C11.9653 15.5823 11.8439 15.6747 11.7085 15.7412L11.7078 15.7405C11.5864 15.8034 11.4622 15.8534 11.335 15.8877C11.2172 15.9189 11.1066 15.9387 11.0061 15.9463C10.9136 15.9532 10.8413 15.9573 10.793 15.9573H10.675L10.4626 15.9463C10.362 15.9387 10.2518 15.919 10.1338 15.8877C10.0122 15.8554 9.8873 15.8055 9.75952 15.7405C9.62706 15.6742 9.50578 15.5832 9.39624 15.4688L9.39551 15.468C9.28579 15.3506 9.19561 15.2056 9.12451 15.0366L9.12378 15.0352C9.05226 14.8589 9.01835 14.6495 9.01831 14.4111V12.3406C9.01831 12.105 9.05259 11.8998 9.12451 11.7297C9.19368 11.5618 9.28389 11.4184 9.39697 11.3027C9.50677 11.1905 9.62826 11.1014 9.76099 11.0376C9.82393 11.0062 9.88688 10.9792 9.94849 10.957L9.94922 10.9563L10.1323 10.8992L10.1345 10.8984L10.3066 10.8604C10.3612 10.8506 10.4136 10.8436 10.4626 10.8398L10.675 10.8289H10.793C10.8413 10.8289 10.9136 10.8329 11.0061 10.8398ZM10.738 11.9473C10.6399 11.9473 10.5796 11.9688 10.5439 11.9963L10.5432 11.9971C10.4934 12.0354 10.4596 12.0746 10.4385 12.1135L10.4377 12.1143C10.4103 12.1641 10.3949 12.222 10.3931 12.2886V14.5393L10.4062 14.6309L10.4385 14.7151L10.4392 14.7158L10.481 14.7766C10.4976 14.7958 10.5181 14.8147 10.5417 14.833L10.5732 14.8521C10.6101 14.8689 10.6637 14.8806 10.738 14.8806C10.8345 14.8805 10.8925 14.8598 10.9255 14.8345C10.9743 14.7969 11.0075 14.7565 11.0288 14.7158C11.054 14.6605 11.0699 14.5993 11.0757 14.5327V12.2944L11.0588 12.197C11.051 12.167 11.0406 12.138 11.0281 12.1106C11.0069 12.0728 10.9738 12.0343 10.9255 11.9971L10.9233 11.9949C10.8905 11.9684 10.8335 11.9474 10.738 11.9473Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.574 1.50366C10.7457 1.52068 10.9072 1.59662 11.0303 1.71973L14.7803 5.46973C14.9209 5.61038 15 5.80109 15 6V9C15 9.41421 14.6642 9.75 14.25 9.75C13.8358 9.75 13.5 9.41421 13.5 9V6.75H11.25C10.8522 6.75 10.4708 6.59185 10.1895 6.31055C9.90815 6.02924 9.75 5.64783 9.75 5.25V3H5.25C5.05109 3 4.86038 3.07907 4.71973 3.21973C4.57907 3.36038 4.5 3.55109 4.5 3.75V9C4.5 9.41421 4.16421 9.75 3.75 9.75C3.33579 9.75 3 9.41421 3 9V3.75C3 3.15326 3.23722 2.58114 3.65918 2.15918C4.08114 1.73722 4.65326 1.5 5.25 1.5H10.5L10.574 1.50366ZM11.25 5.25H12.4395L11.25 4.06055V5.25Z",fill:"currentColor"})),W0=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.574 1.50366C10.7457 1.52068 10.9072 1.59662 11.0303 1.71973L14.7803 5.46973C14.9209 5.61038 15 5.80109 15 6V14.25C15 14.8467 14.7628 15.4189 14.3408 15.8408C13.9189 16.2628 13.3467 16.5 12.75 16.5H12C11.5858 16.5 11.25 16.1642 11.25 15.75C11.25 15.3358 11.5858 15 12 15H12.75C12.9489 15 13.1396 14.9209 13.2803 14.7803C13.4209 14.6396 13.5 14.4489 13.5 14.25V6.75H11.25C10.8522 6.75 10.4708 6.59185 10.1895 6.31055C9.90815 6.02924 9.75 5.64783 9.75 5.25V3H5.25C5.05109 3 4.86038 3.07907 4.71973 3.21973C4.57907 3.36038 4.5 3.55109 4.5 3.75V9C4.5 9.41421 4.16421 9.75 3.75 9.75C3.33579 9.75 3 9.41421 3 9V3.75C3 3.15326 3.23722 2.58114 3.65918 2.15918C4.08114 1.73722 4.65326 1.5 5.25 1.5H10.5L10.574 1.50366ZM11.25 5.25H12.4395L11.25 4.06055V5.25Z",fill:"currentColor"}),Se.createElement("path",{d:"M2.39355 10.5C2.53545 10.5 2.6592 10.5122 2.75757 10.5417C2.88987 10.5815 2.99161 10.6954 3.07251 10.8289L3.15747 10.9885L3.25195 11.2031L3.25269 11.2046L3.35229 11.4683C3.38786 11.5664 3.42601 11.6752 3.46655 11.7942L3.76318 12.6665L3.76392 12.6687L3.76904 12.6848L3.79907 12.5911L3.94849 12.1348C3.99515 11.9948 4.03674 11.8689 4.073 11.7576L4.07373 11.7561L4.1814 11.4434C4.21489 11.3495 4.24596 11.265 4.27515 11.1907L4.36084 10.9849C4.38855 10.9239 4.41584 10.8705 4.44214 10.8252C4.51581 10.6953 4.61188 10.5823 4.74243 10.5417H4.7439L4.82153 10.5227C4.90321 10.5069 4.99686 10.5 5.09985 10.5H5.67041C5.87137 10.5 6.05265 10.5425 6.17505 10.6619L6.17944 10.6655C6.29073 10.7714 6.35329 10.9108 6.375 11.072C6.39695 11.2133 6.40721 11.3701 6.40723 11.5415V15.5149C6.4072 15.7232 6.3696 15.9065 6.27686 16.0474C6.16065 16.2235 5.92578 16.2751 5.67041 16.2751C5.43573 16.2751 5.21924 16.2184 5.11157 16.0378L5.10938 16.0342C5.03005 15.8921 4.9966 15.7149 4.99658 15.5149V12.8335L4.4436 14.4456L4.44141 14.4521C4.39239 14.576 4.32667 14.6919 4.24658 14.8008L4.24731 14.8015C4.14341 14.9438 3.9882 15.008 3.80933 15.0081H3.73096C3.55351 15.008 3.40015 14.9437 3.29004 14.8081L3.28857 14.8066C3.20076 14.6954 3.13356 14.575 3.08862 14.4463L2.53564 12.8496V15.5149C2.53562 15.7149 2.50218 15.8921 2.42285 16.0342L2.42212 16.0356C2.31692 16.2193 2.09741 16.2751 1.86182 16.2751C1.60639 16.2751 1.37154 16.2236 1.25537 16.0474C1.16263 15.9065 1.12502 15.7232 1.125 15.5149V11.5415C1.12501 11.3697 1.13426 11.2129 1.15356 11.072L1.1543 11.0691L1.17993 10.9526C1.21308 10.8409 1.26884 10.7425 1.35059 10.6633L1.39966 10.6223C1.52082 10.5332 1.68333 10.5 1.86182 10.5H2.39355Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.1106 10.5C9.62746 10.5 10.0624 10.6251 10.4026 10.8875L10.5256 10.9944C10.6405 11.1071 10.7342 11.238 10.8062 11.3862C10.9039 11.5876 10.9497 11.8187 10.9497 12.074V14.4983C10.9497 14.7119 10.927 14.9051 10.8779 15.0754C10.8306 15.2398 10.7676 15.3875 10.689 15.5156L10.6875 15.5186C10.6079 15.6408 10.5165 15.7481 10.4143 15.8386C10.3155 15.9261 10.2132 15.9989 10.1074 16.0547L10.1067 16.054C9.86566 16.1854 9.58987 16.2585 9.28271 16.2751H7.97681C7.77408 16.2751 7.59145 16.2335 7.46704 16.1169C7.35471 16.0115 7.2898 15.8714 7.26489 15.7097C7.24266 15.5651 7.23194 15.4033 7.23193 15.2256V11.5415C7.23195 11.3663 7.2426 11.2069 7.26489 11.0647C7.28985 10.9032 7.35482 10.7635 7.46704 10.6582C7.59145 10.5416 7.77403 10.5 7.97681 10.5H9.1106ZM8.72095 15.0447H9.07544C9.15931 15.0426 9.23737 15.0225 9.31055 14.9839L9.31348 14.9817L9.35815 14.9553C9.40066 14.926 9.43743 14.8876 9.46802 14.8381L9.46875 14.8367L9.49438 14.7861C9.51748 14.7305 9.53172 14.6593 9.53174 14.5686V12.2615C9.53174 12.1256 9.50631 12.0248 9.46509 11.9517L9.46362 11.9495C9.42061 11.8696 9.36785 11.8162 9.30762 11.7825C9.25706 11.7542 9.19978 11.7342 9.1355 11.7231L9.06885 11.7151H8.72095V15.0447Z",fill:"currentColor"})),_0=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.6416 10.3784C3.95675 10.4068 4.24355 10.4808 4.49927 10.6033L4.68896 10.7058C4.75102 10.7437 4.81209 10.7853 4.87207 10.8303C4.99897 10.9227 5.10899 11.0375 5.20459 11.1724C5.30765 11.311 5.38613 11.4733 5.44116 11.6558L5.47998 11.8008C5.51306 11.9504 5.52903 12.1125 5.52905 12.2856C5.52905 12.6011 5.47828 12.8867 5.37305 13.1382L5.37378 13.1389C5.28434 13.3557 5.15787 13.5441 4.99512 13.7014L4.92334 13.7666C4.52343 14.1103 3.97203 14.269 3.2959 14.269H2.95166V15.4292C2.95165 15.614 2.93964 15.7845 2.91577 15.9397C2.8883 16.1182 2.81511 16.2739 2.68652 16.3909L2.68579 16.3901C2.54556 16.5202 2.34254 16.5645 2.12329 16.5645C1.90696 16.5644 1.70685 16.5194 1.56738 16.3887L1.56519 16.3865C1.44288 16.2679 1.37145 16.1152 1.34399 15.9404L1.34326 15.936C1.32257 15.7822 1.31251 15.613 1.3125 15.4292V11.5042C1.31251 11.3204 1.3225 11.1524 1.34326 11.001L1.34399 10.9973L1.37256 10.8691C1.40991 10.7455 1.47366 10.6362 1.56738 10.5483C1.70673 10.4148 1.90677 10.3689 2.12329 10.3689H3.50464L3.6416 10.3784ZM2.95166 12.9053H3.31787C3.43267 12.8984 3.53116 12.8714 3.61597 12.8269C3.69435 12.7857 3.75967 12.7244 3.81226 12.6387L3.84448 12.5728C3.8728 12.5 3.88989 12.4058 3.88989 12.2856C3.88984 12.1374 3.85971 12.0411 3.81812 11.9795L3.81519 11.9744C3.76419 11.8937 3.70357 11.8366 3.63428 11.7979C3.56584 11.7635 3.47692 11.7377 3.36328 11.7253H2.95166V12.9053Z",fill:"currentColor"}),Se.createElement("path",{d:"M9.85181 10.3689C9.96017 10.369 10.0701 10.3945 10.1792 10.4392L10.2876 10.4897L10.2935 10.4927L10.2993 10.4963C10.4209 10.5712 10.5226 10.6619 10.5879 10.7725C10.6503 10.8716 10.6882 10.9809 10.6882 11.0969C10.6882 11.1892 10.6526 11.2993 10.6077 11.4089L10.6069 11.4082C10.5828 11.4685 10.5524 11.5379 10.5154 11.6147C10.4774 11.6937 10.4326 11.7792 10.3813 11.8704L9.1582 14.0391V15.4373C9.1582 15.6164 9.14303 15.7853 9.11279 15.9426C9.07918 16.1138 9.00547 16.2635 8.88647 16.3799L8.88721 16.3806C8.75142 16.5164 8.5562 16.5644 8.34668 16.5645C8.13595 16.5644 7.94219 16.5154 7.80249 16.3843L7.80103 16.3828C7.68055 16.2661 7.60635 16.1157 7.57251 15.9434C7.54226 15.786 7.52783 15.6164 7.52783 15.4373V14.0398L6.12085 11.5283L6.11938 11.5261C6.0459 11.3891 6.00587 11.2453 6.00586 11.0969C6.00589 10.986 6.03681 10.8798 6.09155 10.7812L6.09302 10.7791L6.15015 10.6963C6.21492 10.6176 6.30071 10.5509 6.39771 10.4941L6.4043 10.4905L6.5127 10.4392C6.6213 10.3943 6.73162 10.369 6.84155 10.3689C7.06446 10.369 7.25232 10.4649 7.39307 10.6399L7.48096 10.752C7.5635 10.8656 7.6337 10.9873 7.69263 11.116L8.34668 12.4878L9.00073 11.116C9.07902 10.945 9.177 10.7867 9.29443 10.6421L9.29517 10.6414L9.35083 10.5791C9.48615 10.443 9.65571 10.3689 9.85181 10.3689Z",fill:"currentColor"}),Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.574 1.50366C10.7457 1.52068 10.9072 1.59662 11.0303 1.71973L14.7803 5.46973C14.9209 5.61038 15 5.80109 15 6V14.25C15 14.8467 14.7628 15.4189 14.3408 15.8408C13.9189 16.2628 13.3467 16.5 12.75 16.5H12C11.5858 16.5 11.25 16.1642 11.25 15.75C11.25 15.3358 11.5858 15 12 15H12.75C12.9489 15 13.1396 14.9209 13.2803 14.7803C13.4209 14.6396 13.5 14.4489 13.5 14.25V6.75H11.25C10.8522 6.75 10.4708 6.59185 10.1895 6.31055C9.90815 6.02924 9.75 5.64783 9.75 5.25V3H5.25C5.05109 3 4.86038 3.07907 4.71973 3.21973C4.57907 3.36038 4.5 3.55109 4.5 3.75V9C4.5 9.41421 4.16421 9.75 3.75 9.75C3.33579 9.75 3 9.41421 3 9V3.75C3 3.15326 3.23722 2.58114 3.65918 2.15918C4.08114 1.73722 4.65326 1.5 5.25 1.5H10.5L10.574 1.50366ZM11.25 5.25H12.4395L11.25 4.06055V5.25Z",fill:"currentColor"})),je=(e,t)=>f.jsx(e,{size:t.size??Y.size,stroke:t.stroke??Y.stroke,className:t.className}),po=(e,t)=>f.jsx(e,{width:Number(t.size??Y.size),height:Number(t.size??Y.size),className:t.className}),Oh={".bmp":e=>je(G.IconFileTypeBmp,e),".cpp":e=>po(H0,e),".c":e=>po(G0,e),".cs":e=>po(B0,e),".css":e=>je(G.IconFileTypeCss,e),".csv":e=>je(G.IconFileTypeCsv,e),".doc":e=>je(G.IconFileTypeDoc,e),".docx":e=>je(G.IconFileTypeDocx,e),".html":e=>je(G.IconFileTypeHtml,e),".ini":e=>po(V0,e),".jpg":e=>je(G.IconFileTypeJpg,e),".js":e=>je(G.IconFileTypeJs,e),".json":e=>po(z0,e),".jsx":e=>je(G.IconFileTypeJsx,e),".md":e=>po(W0,e),".pdf":e=>je(G.IconFileTypePdf,e),".php":e=>je(G.IconFileTypePhp,e),".png":e=>je(G.IconFileTypePng,e),".ppt":e=>je(G.IconFileTypePpt,e),".py":e=>po(_0,e),".rs":e=>je(G.IconFileTypeRs,e),".sql":e=>je(G.IconFileTypeSql,e),".svg":e=>je(G.IconFileTypeSvg,e),".ts":e=>je(G.IconFileTypeTs,e),".tsx":e=>je(G.IconFileTypeTsx,e),".txt":e=>je(G.IconFileTypeTxt,e),".vue":e=>je(G.IconFileTypeVue,e),".xls":e=>je(G.IconFileTypeXls,e),".xml":e=>je(G.IconFileTypeXml,e),".zip":e=>je(G.IconFileTypeZip,e),default:e=>je(G.IconFile,e)},iu=({extension:e,size:t=Y.size,stroke:s=Y.stroke,className:o,decorative:i=!1,label:n,indicator:r})=>{const a=(()=>{if(!e)return"";const u=e.trim().toLowerCase();return u.startsWith(".")?u:`.${u}`})(),c=(Oh[a]??Oh.default)({size:t,stroke:s}),d=typeof n=="string"?n:`${a.slice(1).toUpperCase()} file icon`;return f.jsxs("span",{className:ue("inline-flex relative",o),...i?{"aria-hidden":!0}:{role:"img","aria-label":d},children:[f.jsx($e,{icon:c,className:"inline-block align-middle"}),r&&f.jsx("span",{className:"absolute -bottom-0.5 -left-0.5",children:r})]})},Wn=({label:e="Shared entity",size:t=14,className:s,containerClassName:o,stroke:i=1.5,sharedIndicatorTooltip:n})=>f.jsx(yt,{tooltip:n||"Shared",children:f.jsx($e,{className:oe("text-accent-primary flex bg-layer-3",o),icon:f.jsx(G.IconArrowUpRight,{size:t,stroke:i,"aria-label":typeof e=="string"?e:void 0,className:s,role:"img"})})}),ll=({name:e,className:t,shared:s=!1,iconSize:o=Nt,details:i,sharedIndicatorClassName:n,sharedIndicatorTooltip:r,fileExtension:a,hideTooltip:l=!1,isInvalidName:c=!1,tooltipContent:d})=>{const u=a||(e.includes(".")?e.split(".").pop():void 0);return f.jsxs("div",{className:oe("flex items-center gap-2 w-full",t),children:[f.jsx(iu,{extension:u,size:o,className:"text-secondary",indicator:s?f.jsx(Wn,{className:n,sharedIndicatorTooltip:r}):null,label:"File type icon"}),f.jsxs("div",{className:ue(["w-full flex min-w-0",i&&"flex-col gap-1"]),children:[f.jsx(ht,{className:ue(["dial-small-text flex-1 min-w-0",c?"text-secondary":"text-primary"]),text:e,id:"name",hideTooltip:l,customTooltipContent:d}),i]})]})},cl=({name:e,className:t,shared:s=!1,loading:o=!1,iconSize:i=Nt,sharedIndicatorClassName:n,sharedIndicatorTooltip:r,hideTooltip:a=!1,isInvalidName:l=!1,tooltipContent:c})=>{const d=()=>o?f.jsx(nr,{size:i}):f.jsx($e,{icon:f.jsx(G.IconFolder,{...Y,size:i}),className:"inline-block align-middle"});return f.jsxs("div",{className:oe("flex items-center gap-2 w-full",t),children:[f.jsxs("span",{className:"inline-flex relative text-secondary",role:"img",children:[d(),s&&f.jsx("span",{className:"absolute z-50 -bottom-0.5 -left-0.5",children:f.jsx(Wn,{className:n,sharedIndicatorTooltip:r})})]}),f.jsx(ht,{className:ue("dial-small-text flex-1 min-w-0",l?"text-secondary":"text-primary"),text:e,id:"name",hideTooltip:a,customTooltipContent:c})]})};var _n=(e=>(e.Left="left",e.Right="right",e))(_n||{}),tt=function(){return tt=Object.assign||function(e){for(var t,s=1,o=arguments.length;s<o;s++){t=arguments[s];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},tt.apply(this,arguments)},Nh={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},Hh={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},jr={width:"20px",height:"20px",position:"absolute",zIndex:1},j0={top:tt(tt({},Nh),{top:"-5px"}),right:tt(tt({},Hh),{left:void 0,right:"-5px"}),bottom:tt(tt({},Nh),{top:void 0,bottom:"-5px"}),left:tt(tt({},Hh),{left:"-5px"}),topRight:tt(tt({},jr),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:tt(tt({},jr),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:tt(tt({},jr),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:tt(tt({},jr),{left:"-10px",top:"-10px",cursor:"nw-resize"})},U0=g.memo(function(e){var t=e.onResizeStart,s=e.direction,o=e.children,i=e.replaceStyles,n=e.className,r=g.useCallback(function(c){t(c,s)},[t,s]),a=g.useCallback(function(c){t(c,s)},[t,s]),l=g.useMemo(function(){return tt(tt({position:"absolute",userSelect:"none"},j0[s]),i??{})},[i,s]);return f.jsx("div",{className:n||void 0,style:l,onMouseDown:r,onTouchStart:a,children:o})}),$0=(function(){var e=function(t,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(o[n]=i[n])},e(t,s)};return function(t,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");e(t,s);function o(){this.constructor=t}t.prototype=s===null?Object.create(s):(o.prototype=s.prototype,new o)}})(),gs=function(){return gs=Object.assign||function(e){for(var t,s=1,o=arguments.length;s<o;s++){t=arguments[s];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},gs.apply(this,arguments)},q0={width:"auto",height:"auto"},Ur=function(e,t,s){return Math.max(Math.min(e,s),t)},Gh=function(e,t,s){var o=Math.round(e/t);return o*t+s*(o-1)},ci=function(e,t){return new RegExp(e,"i").test(t)},$r=function(e){return!!(e.touches&&e.touches.length)},K0=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},Bh=function(e,t,s){s===void 0&&(s=0);var o=t.reduce(function(n,r,a){return Math.abs(r-e)<Math.abs(t[n]-e)?a:n},0),i=Math.abs(t[o]-e);return s===0||i<s?t[o]:e},nc=function(e){return e=e.toString(),e==="auto"||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:"".concat(e,"px")},qr=function(e,t,s,o){if(e&&typeof e=="string"){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%")){var i=Number(e.replace("%",""))/100;return t*i}if(e.endsWith("vw")){var i=Number(e.replace("vw",""))/100;return s*i}if(e.endsWith("vh")){var i=Number(e.replace("vh",""))/100;return o*i}}return e},Y0=function(e,t,s,o,i,n,r){return o=qr(o,e.width,t,s),i=qr(i,e.height,t,s),n=qr(n,e.width,t,s),r=qr(r,e.height,t,s),{maxWidth:typeof o>"u"?void 0:Number(o),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof n>"u"?void 0:Number(n),minHeight:typeof r>"u"?void 0:Number(r)}},Z0=function(e){return Array.isArray(e)?e:[e,e]},X0=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],Vh="__resizable_base__",Q0=(function(e){$0(t,e);function t(s){var o,i,n,r,a=e.call(this,s)||this;return a.ratio=1,a.resizable=null,a.parentLeft=0,a.parentTop=0,a.resizableLeft=0,a.resizableRight=0,a.resizableTop=0,a.resizableBottom=0,a.targetLeft=0,a.targetTop=0,a.delta={width:0,height:0},a.appendBase=function(){if(!a.resizable||!a.window)return null;var l=a.parentNode;if(!l)return null;var c=a.window.document.createElement("div");return c.style.width="100%",c.style.height="100%",c.style.position="absolute",c.style.transform="scale(0, 0)",c.style.left="0",c.style.flex="0 0 100%",c.classList?c.classList.add(Vh):c.className+=Vh,l.appendChild(c),c},a.removeBase=function(l){var c=a.parentNode;c&&c.removeChild(l)},a.state={isResizing:!1,width:(i=(o=a.propsSize)===null||o===void 0?void 0:o.width)!==null&&i!==void 0?i:"auto",height:(r=(n=a.propsSize)===null||n===void 0?void 0:n.height)!==null&&r!==void 0?r:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},a.onResizeStart=a.onResizeStart.bind(a),a.onMouseMove=a.onMouseMove.bind(a),a.onMouseUp=a.onMouseUp.bind(a),a}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||q0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var s=0,o=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,n=this.resizable.offsetHeight,r=this.resizable.style.position;r!=="relative"&&(this.resizable.style.position="relative"),s=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,o=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:n,this.resizable.style.position=r}return{width:s,height:o}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var s=this,o=this.props.size,i=function(a){var l;if(typeof s.state[a]>"u"||s.state[a]==="auto")return"auto";if(s.propsSize&&s.propsSize[a]&&(!((l=s.propsSize[a])===null||l===void 0)&&l.toString().endsWith("%"))){if(s.state[a].toString().endsWith("%"))return s.state[a].toString();var c=s.getParentSize(),d=Number(s.state[a].toString().replace("px","")),u=d/c[a]*100;return"".concat(u,"%")}return nc(s.state[a])},n=o&&typeof o.width<"u"&&!this.state.isResizing?nc(o.width):i("width"),r=o&&typeof o.height<"u"&&!this.state.isResizing?nc(o.height):i("height");return{width:n,height:r}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var s=this.appendBase();if(!s)return{width:0,height:0};var o=!1,i=this.parentNode.style.flexWrap;i!=="wrap"&&(o=!0,this.parentNode.style.flexWrap="wrap"),s.style.position="relative",s.style.minWidth="100%",s.style.minHeight="100%";var n={width:s.offsetWidth,height:s.offsetHeight};return o&&(this.parentNode.style.flexWrap=i),this.removeBase(s),n},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var s=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:s.flexBasis!=="auto"?s.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(s,o){var i=this.propsSize&&this.propsSize[o];return this.state[o]==="auto"&&this.state.original[o]===s&&(typeof i>"u"||i==="auto")?"auto":s},t.prototype.calculateNewMaxFromBoundary=function(s,o){var i=this.props.boundsByDirection,n=this.state.direction,r=i&&ci("left",n),a=i&&ci("top",n),l,c;if(this.props.bounds==="parent"){var d=this.parentNode;d&&(l=r?this.resizableRight-this.parentLeft:d.offsetWidth+(this.parentLeft-this.resizableLeft),c=a?this.resizableBottom-this.parentTop:d.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=r?this.resizableRight:this.window.innerWidth-this.resizableLeft,c=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(l=r?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),c=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return l&&Number.isFinite(l)&&(s=s&&s<l?s:l),c&&Number.isFinite(c)&&(o=o&&o<c?o:c),{maxWidth:s,maxHeight:o}},t.prototype.calculateNewSizeFromDirection=function(s,o){var i=this.props.scale||1,n=Z0(this.props.resizeRatio||1),r=n[0],a=n[1],l=this.state,c=l.direction,d=l.original,u=this.props,h=u.lockAspectRatio,p=u.lockAspectRatioExtraHeight,m=u.lockAspectRatioExtraWidth,C=d.width,v=d.height,w=p||0,b=m||0;return ci("right",c)&&(C=d.width+(s-d.x)*r/i,h&&(v=(C-b)/this.ratio+w)),ci("left",c)&&(C=d.width-(s-d.x)*r/i,h&&(v=(C-b)/this.ratio+w)),ci("bottom",c)&&(v=d.height+(o-d.y)*a/i,h&&(C=(v-w)*this.ratio+b)),ci("top",c)&&(v=d.height-(o-d.y)*a/i,h&&(C=(v-w)*this.ratio+b)),{newWidth:C,newHeight:v}},t.prototype.calculateNewSizeFromAspectRatio=function(s,o,i,n){var r=this.props,a=r.lockAspectRatio,l=r.lockAspectRatioExtraHeight,c=r.lockAspectRatioExtraWidth,d=typeof n.width>"u"?10:n.width,u=typeof i.width>"u"||i.width<0?s:i.width,h=typeof n.height>"u"?10:n.height,p=typeof i.height>"u"||i.height<0?o:i.height,m=l||0,C=c||0;if(a){var v=(h-m)*this.ratio+C,w=(p-m)*this.ratio+C,b=(d-C)/this.ratio+m,S=(u-C)/this.ratio+m,x=Math.max(d,v),y=Math.min(u,w),F=Math.max(h,b),R=Math.min(p,S);s=Ur(s,x,y),o=Ur(o,F,R)}else s=Ur(s,d,u),o=Ur(o,h,p);return{newWidth:s,newHeight:o}},t.prototype.setBoundingClientRect=function(){var s=1/(this.props.scale||1);if(this.props.bounds==="parent"){var o=this.parentNode;if(o){var i=o.getBoundingClientRect();this.parentLeft=i.left*s,this.parentTop=i.top*s}}if(this.props.bounds&&typeof this.props.bounds!="string"){var n=this.props.bounds.getBoundingClientRect();this.targetLeft=n.left*s,this.targetTop=n.top*s}if(this.resizable){var r=this.resizable.getBoundingClientRect(),a=r.left,l=r.top,c=r.right,d=r.bottom;this.resizableLeft=a*s,this.resizableRight=c*s,this.resizableTop=l*s,this.resizableBottom=d*s}},t.prototype.onResizeStart=function(s,o){if(!(!this.resizable||!this.window)){var i=0,n=0;if(s.nativeEvent&&K0(s.nativeEvent)?(i=s.nativeEvent.clientX,n=s.nativeEvent.clientY):s.nativeEvent&&$r(s.nativeEvent)&&(i=s.nativeEvent.touches[0].clientX,n=s.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var r=this.props.onResizeStart(s,o,this.resizable);if(r===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var a,l=this.window.getComputedStyle(this.resizable);if(l.flexBasis!=="auto"){var c=this.parentNode;if(c){var d=this.window.getComputedStyle(c).flexDirection;this.flexDir=d.startsWith("row")?"row":"column",a=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var u={original:{x:i,y:n,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:gs(gs({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(s.target).cursor||"auto"}),direction:o,flexBasis:a};this.setState(u)}},t.prototype.onMouseMove=function(s){var o=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&$r(s))try{s.preventDefault(),s.stopPropagation()}catch{}var i=this.props,n=i.maxWidth,r=i.maxHeight,a=i.minWidth,l=i.minHeight,c=$r(s)?s.touches[0].clientX:s.clientX,d=$r(s)?s.touches[0].clientY:s.clientY,u=this.state,h=u.direction,p=u.original,m=u.width,C=u.height,v=this.getParentSize(),w=Y0(v,this.window.innerWidth,this.window.innerHeight,n,r,a,l);n=w.maxWidth,r=w.maxHeight,a=w.minWidth,l=w.minHeight;var b=this.calculateNewSizeFromDirection(c,d),S=b.newHeight,x=b.newWidth,y=this.calculateNewMaxFromBoundary(n,r);this.props.snap&&this.props.snap.x&&(x=Bh(x,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(S=Bh(S,this.props.snap.y,this.props.snapGap));var F=this.calculateNewSizeFromAspectRatio(x,S,{width:y.maxWidth,height:y.maxHeight},{width:a,height:l});if(x=F.newWidth,S=F.newHeight,this.props.grid){var R=Gh(x,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),E=Gh(S,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),D=this.props.snapGap||0,P=D===0||Math.abs(R-x)<=D?R:x,T=D===0||Math.abs(E-S)<=D?E:S;x=P,S=T}var M={width:x-p.width,height:S-p.height};if(this.delta=M,m&&typeof m=="string"){if(m.endsWith("%")){var k=x/v.width*100;x="".concat(k,"%")}else if(m.endsWith("vw")){var N=x/this.window.innerWidth*100;x="".concat(N,"vw")}else if(m.endsWith("vh")){var A=x/this.window.innerHeight*100;x="".concat(A,"vh")}}if(C&&typeof C=="string"){if(C.endsWith("%")){var k=S/v.height*100;S="".concat(k,"%")}else if(C.endsWith("vw")){var N=S/this.window.innerWidth*100;S="".concat(N,"vw")}else if(C.endsWith("vh")){var A=S/this.window.innerHeight*100;S="".concat(A,"vh")}}var W={width:this.createSizeForCssProperty(x,"width"),height:this.createSizeForCssProperty(S,"height")};this.flexDir==="row"?W.flexBasis=W.width:this.flexDir==="column"&&(W.flexBasis=W.height);var U=this.state.width!==W.width,L=this.state.height!==W.height,de=this.state.flexBasis!==W.flexBasis,H=U||L||de;H&&zi.flushSync(function(){o.setState(W)}),this.props.onResize&&H&&this.props.onResize(s,h,this.resizable,M)}},t.prototype.onMouseUp=function(s){var o,i,n=this.state,r=n.isResizing,a=n.direction;n.original,!(!r||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(s,a,this.resizable,this.delta),this.props.size&&this.setState({width:(o=this.props.size.width)!==null&&o!==void 0?o:"auto",height:(i=this.props.size.height)!==null&&i!==void 0?i:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:gs(gs({},this.state.backgroundStyle),{cursor:"auto"})}))},t.prototype.updateSize=function(s){var o,i;this.setState({width:(o=s.width)!==null&&o!==void 0?o:"auto",height:(i=s.height)!==null&&i!==void 0?i:"auto"})},t.prototype.renderResizer=function(){var s=this,o=this.props,i=o.enable,n=o.handleStyles,r=o.handleClasses,a=o.handleWrapperStyle,l=o.handleWrapperClass,c=o.handleComponent;if(!i)return null;var d=Object.keys(i).map(function(u){return i[u]!==!1?f.jsx(U0,{direction:u,onResizeStart:s.onResizeStart,replaceStyles:n&&n[u],className:r&&r[u],children:c&&c[u]?c[u]:null},u):null});return f.jsx("div",{className:l,style:a,children:d})},t.prototype.render=function(){var s=this,o=Object.keys(this.props).reduce(function(r,a){return X0.indexOf(a)!==-1||(r[a]=s.props[a]),r},{}),i=gs(gs(gs({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var n=this.props.as||"div";return f.jsxs(n,gs({style:i,className:this.props.className},o,{ref:function(r){r&&(s.resizable=r)},children:[this.state.isResizing&&f.jsx("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t})(g.PureComponent);const J0=({side:e,className:t})=>{const s=e===_n.Left,o=s?G.IconChevronLeft:G.IconChevronRight;return f.jsx("div",{className:t,children:f.jsx(o,{className:ue("h-full",s&&"-ml-6")})})},eS=({side:e,isResizing:t,customHandler:s,handlerClassName:o})=>{const i=oe("invisible h-full w-0.5 group-hover:visible bg-accent-primary text-accent-primary cursor-col-resize transition-opacity",t&&"visible",o),n=f.jsx(J0,{side:e,className:i});return s?f.jsx("div",{className:i,children:s}):n},sf=({children:e,minWidth:t,maxWidth:s,width:o,defaultWidth:i,onResizeStop:n,onResize:r,side:a=_n.Right,resizeHandlerClassName:l,resizeHandler:c})=>{const[d,u]=g.useState(!1),[h,p]=g.useState(i),m=o!==void 0,C=m?o:h,v=g.useRef(null),w=g.useCallback(()=>{u(!0)},[]),b=g.useCallback(()=>{u(!1);const x=v.current?.resizable?.getBoundingClientRect(),y=x?Math.round(x.width):t;m||p(y),n?.(y)},[n,m,t]),S=g.useMemo(()=>{const x=a===_n.Left,y=f.jsx(eS,{side:a,isResizing:d,customHandler:c,handlerClassName:l});return{size:m?{width:C,height:"100%"}:void 0,defaultSize:m?void 0:{width:C,height:"100%"},minWidth:t,maxWidth:s,enable:{left:x,right:!x},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:x?y:void 0,right:x?void 0:y},onResizeStart:w,onResize:(F,R,E)=>{const D=Math.round(E.offsetWidth);r?.(D)},onResizeStop:b}},[a,m,C,t,s,c,l,d,w,b,r]);return f.jsx(Q0,{ref:v,...S,children:f.jsx("div",{className:"group flex size-full flex-col bg-layer-3 divide-y divide-tertiary transition-all",children:e})})},of=({enabled:e=!0,children:t,...s})=>e?f.jsx(sf,{...s,children:t}):t;var Xt=(e=>(e.Default="default",e.Text="text",e.Circular="circular",e.Rectangular="rectangular",e))(Xt||{}),Tn=(e=>(e.Small="small",e.Default="default",e.Large="large",e))(Tn||{}),Ea=(e=>(e.Circle="circle",e.Square="square",e))(Ea||{});const tS=e=>{if(typeof e=="number")return e;switch(e){case Tn.Small:return 32;case Tn.Large:return 64;case Tn.Default:default:return 40}},pi=({active:e=!0,paragraph:t=!0,avatar:s=!1,showTitle:o=!0,loading:i=!0,children:n,variant:r=Xt.Default,width:a,height:l,className:c,...d})=>{if(!i&&n)return f.jsx(f.Fragment,{children:n});const u=oe("bg-layer-3",e&&"animate-pulse",c);if(r!==Xt.Default){const E=oe(u,r===Xt.Circular&&"rounded-full",r===Xt.Rectangular&&"rounded",r===Xt.Text&&"rounded"),D={};return a&&(D.width=typeof a=="number"?`${a}px`:a),l&&(D.height=typeof l=="number"?`${l}px`:l),f.jsx("div",{className:E,style:D,...d})}const h=!!s,p=!!o,m=!!t,C=typeof s=="object"?s:{},v=typeof o=="object"?o:{},w=typeof t=="object"?t:{},b=tS(C.size),S=C.shape??Ea.Circle,x=v.width??"38%",y=w.rows??3,F=w.width,R=E=>F?Array.isArray(F)?F[E]??"100%":F:E===y-1?"61%":"100%";return f.jsxs("div",{...d,className:oe("flex gap-4",c),children:[h&&f.jsx("div",{className:oe(u,S===Ea.Circle?"rounded-full":"rounded","flex-shrink-0"),style:{width:b,height:b}}),f.jsxs("div",{className:"flex-1 flex flex-col gap-3",children:[p&&f.jsx("div",{className:oe(u,"h-4 rounded"),style:{width:x}}),m&&f.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:y}).map((E,D)=>f.jsx("div",{className:oe(u,"h-4 rounded"),style:{width:R(D)}},D))})]})]})};var Io=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,s){const o=t?this.allAsyncListeners:this.allSyncListeners;let i=o.get(e);return!i&&s&&(i=new Set,o.set(e,i)),i}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,s=!1){this.getListeners(e,s,!0).add(t)}removeEventListener(e,t,s=!1){const o=this.getListeners(e,s,!1);o&&(o.delete(t),o.size===0&&(s?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){this.getGlobalListeners(t).add(e)}removeGlobalListener(e,t=!1){this.getGlobalListeners(t).delete(e)}dispatchEvent(e){this.dispatchToListeners(e,!0),this.dispatchToListeners(e,!1),this.firedEvents[e.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const s=e.type;if(t&&"event"in e){const a=e.event;a instanceof Event&&(e.eventPath=a.composedPath())}const{frameworkOverrides:o}=this,i=a=>{const l=o?()=>o.wrapIncoming(a):a;t?this.dispatchAsync(l):l()},n=this.getListeners(s,t,!1);if((n?.size??0)>0){const a=new Set(n);for(const l of a)n?.has(l)&&i(()=>l(e))}const r=this.getGlobalListeners(t);if(r.size>0){const a=new Set(r);for(const l of a)i(()=>l(s,e))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(const t of e)t()}};function ks(e){return e==null||e===""?null:e}function X(e){return e!=null&&e!==""}function qe(e){return!X(e)}function cd(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function jn(e,t){const s=e?JSON.stringify(e):null,o=t?JSON.stringify(t):null;return s===o}function sS(e,t,s=!1){const o=e==null,i=t==null;if(e?.toNumber&&(e=e.toNumber()),t?.toNumber&&(t=t.toNumber()),o&&i)return 0;if(o)return-1;if(i)return 1;function n(r,a){return r>a?1:r<a?-1:0}if(typeof e!="string"||!s)return n(e,t);try{return e.localeCompare(t)}catch{return n(e,t)}}var oS=/[&<>"']/g,iS={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Ui(e){return e?.toString().toString()??null}function Mn(e){return Ui(e)?.replace(oS,t=>iS[t])??null}function os(e){return e.eRootDiv.getRootNode()}function Ze(e){return os(e).activeElement}function dt(e){const{gos:t,eRootDiv:s}=e;let o=null;const i=t.get("getDocument");return i&&X(i)?o=i():s&&(o=s.ownerDocument),o&&X(o)?o:document}function nf(e){const t=Ze(e);return t===null||t===dt(e).body}function rf(e){return dt(e).defaultView||window}function nu(e){let t=null,s=null;try{t=dt(e).fullscreenElement}catch{}finally{t||(t=os(e));const o=t.querySelector("body");o?s=o:t instanceof ShadowRoot?s=t:t instanceof Document?s=t?.documentElement:s=t}return s}function nS(e){return nu(e)?.clientWidth??(window.innerWidth||-1)}function rS(e){return nu(e)?.clientHeight??(window.innerHeight||-1)}function ls(e,t,s){s==null||typeof s=="string"&&s==""?af(e,t):cs(e,t,s)}function cs(e,t,s){e.setAttribute(lf(t),s.toString())}function af(e,t){e.removeAttribute(lf(t))}function lf(e){return`aria-${e}`}function ko(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function aS(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function lS(e){return e.getAttribute("aria-label")}function Ai(e,t){ls(e,"label",t)}function Un(e,t){ls(e,"labelledby",t)}function cf(e,t){ls(e,"live",t)}function cS(e,t){ls(e,"atomic",t)}function dS(e,t){ls(e,"relevant",t)}function uS(e,t){ls(e,"invalid",t)}function hS(e,t){ls(e,"disabled",t)}function df(e,t){ls(e,"hidden",t)}function dd(e,t){cs(e,"expanded",t)}function gS(e,t){cs(e,"setsize",t)}function pS(e,t){cs(e,"posinset",t)}function fS(e,t){cs(e,"rowcount",t)}function uf(e,t){cs(e,"rowindex",t)}function mS(e,t){cs(e,"rowspan",t)}function CS(e,t){cs(e,"colcount",t)}function hf(e,t){cs(e,"colindex",t)}function vS(e,t){cs(e,"colspan",t)}function wS(e,t){cs(e,"sort",t)}function bS(e){af(e,"sort")}function gf(e,t){ls(e,"selected",t)}function SS(e,t){ls(e,"controls",t)}function yS(e,t){SS(e,t.id),Un(t,e.id)}function zh(e,t){ls(e,"owns",t)}function dl(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var xS="[tabindex], input, select, button, textarea, [href]",pf="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function In(e){return!e||!e.matches("input, select, button, textarea")||!e.matches(pf)?!1:Hs(e)}function Ye(e,t,s={}){const{skipAriaHidden:o}=s;e.classList.toggle("ag-hidden",!t),o||df(e,!t)}function RS(e,t,s={}){const{skipAriaHidden:o}=s;e.classList.toggle("ag-invisible",!t),o||df(e,!t)}function $n(e,t){const s="disabled",o=t?n=>n.setAttribute(s,""):n=>n.removeAttribute(s);o(e);const i=e.querySelectorAll("input")??[];for(const n of i)o(n)}function yo(e,t,s){let o=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof s=="number"){if(++o>s)break}else if(e===s)break}return!1}function Vo(e){const{height:t,width:s,borderTopWidth:o,borderRightWidth:i,borderBottomWidth:n,borderLeftWidth:r,paddingTop:a,paddingRight:l,paddingBottom:c,paddingLeft:d,marginTop:u,marginRight:h,marginBottom:p,marginLeft:m,boxSizing:C}=window.getComputedStyle(e),v=Number.parseFloat;return{height:v(t||"0"),width:v(s||"0"),borderTopWidth:v(o||"0"),borderRightWidth:v(i||"0"),borderBottomWidth:v(n||"0"),borderLeftWidth:v(r||"0"),paddingTop:v(a||"0"),paddingRight:v(l||"0"),paddingBottom:v(c||"0"),paddingLeft:v(d||"0"),marginTop:v(u||"0"),marginRight:v(h||"0"),marginBottom:v(p||"0"),marginLeft:v(m||"0"),boxSizing:C}}function ru(e){const t=Vo(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function qn(e){const t=Vo(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function ff(e){const{height:t,marginBottom:s,marginTop:o}=Vo(e);return Math.floor(t+s+o)}function Da(e){const{width:t,marginLeft:s,marginRight:o}=Vo(e);return Math.floor(t+s+o)}function mf(e){const t=e.getBoundingClientRect(),{borderTopWidth:s,borderLeftWidth:o,borderRightWidth:i,borderBottomWidth:n}=Vo(e);return{top:t.top+(s||0),left:t.left+(o||0),right:t.right+(i||0),bottom:t.bottom+(n||0)}}function Pa(e,t){let s=e.scrollLeft;return t&&(s=Math.abs(s)),s}function Ta(e,t,s){s&&(t*=-1),e.scrollLeft=t}function Mt(e){for(;e?.firstChild;)e.firstChild.remove()}function eo(e){e?.parentNode&&e.remove()}function Cf(e){return!!e.offsetParent}function Hs(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!Cf(e)||window.getComputedStyle(e).visibility!=="visible")}function au(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function ca(e){return()=>{const t=e();return t?lu(t)||vf(t):!0}}function lu(e){return e.clientWidth<e.scrollWidth}function vf(e){return e.clientHeight<e.scrollHeight}function Ma(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):vs(e,t)}function vs(e,t){t=cu(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function kn(e,t){t=cu(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function cu(e){return typeof e=="number"?`${e}px`:e}function du(e){return e instanceof Node||e instanceof HTMLElement}function Bt(e,t,s){s==null||s===""?e.removeAttribute(t):e.setAttribute(t,s.toString())}function Gs(e,t,s){const i=rf(e).ResizeObserver,n=i?new i(s):null;return n?.observe(t),()=>n?.disconnect()}function Bs(e,t){const s=rf(e);s.requestAnimationFrame?s.requestAnimationFrame(t):s.webkitRequestAnimationFrame?s.webkitRequestAnimationFrame(t):s.setTimeout(t,0)}var wf="data-ref",rc;function Wh(){return rc??(rc=document.createTextNode(" ")),rc.cloneNode()}function ar(e){const{attrs:t,children:s,cls:o,ref:i,role:n,tag:r}=e,a=document.createElement(r);if(o&&(a.className=o),i&&a.setAttribute(wf,i),n&&a.setAttribute("role",n),t)for(const l of Object.keys(t))a.setAttribute(l,t[l]);if(s)if(typeof s=="string")a.textContent=s;else{let l=!0;for(const c of s)c&&(typeof c=="string"?(a.appendChild(document.createTextNode(c)),l=!1):typeof c=="function"?a.appendChild(c()):(l&&(a.appendChild(Wh()),l=!1),a.append(ar(c)),a.appendChild(Wh())))}return a}var FS=["touchstart","touchend","touchmove","touchcancel","scroll"],ES=["wheel"],ac={},bf=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return s=>{if(typeof ac[s]=="boolean")return ac[s];const o=document.createElement(e[s]||"div");return s="on"+s,ac[s]=s in o}})();function DS(e,t){return!t||!e?!1:TS(t).indexOf(e)>=0}function PS(e){const t=[];let s=e.target;for(;s;)t.push(s),s=s.parentElement;return t}function TS(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():PS(t)}function MS(e,t,s){const o=IS(t);let i;o!=null&&(i={passive:o}),e.addEventListener(t,s,i)}var IS=e=>{const t=FS.includes(e),s=ES.includes(e);if(t)return!0;if(s)return!1};function Sf(e,t,s){if(s===0)return!1;const o=Math.abs(e.clientX-t.clientX),i=Math.abs(e.clientY-t.clientY);return Math.max(o,i)<=s}var An=(e,t)=>{const s=e.identifier;for(let o=0,i=t.length;o<i;++o){const n=t[o];if(n.identifier===s)return n}return null};function Kn(e,t){return e.gos.isElementInThisInstance(t.target)}function kS(e,t,s){const i=e.getBoundingClientRect().height,n=nS(s)-2,r=rS(s)-2;if(!e.offsetParent)return;const l=mf(e.offsetParent),{clientY:c,clientX:d}=t;let u=c-l.top-i/2,h=d-l.left-10;const p=dt(s),m=p.defaultView||window,C=m.pageYOffset||p.documentElement.scrollTop,v=m.pageXOffset||p.documentElement.scrollLeft;n>0&&h+e.clientWidth>n+v&&(h=n+v-e.clientWidth),h<0&&(h=0),r>0&&u+e.clientHeight>r+C&&(u=r+C-e.clientHeight),u<0&&(u=0),e.style.left=`${h}px`,e.style.top=`${u}px`}var da=(e,...t)=>{for(const s of t){const[o,i,n,r]=s;o.addEventListener(i,n,r),e.push(s)}},uu=e=>{if(e){for(const[t,s,o,i]of e)t.removeEventListener(s,o,i);e.length=0}},Ks=e=>{e.cancelable&&e.preventDefault()};function AS(e,t){return t}function yf(e){return e?.getLocaleTextFunc()??AS}function LS(e,t,s,o){const i=t[s];return e.getLocaleTextFunc()(s,typeof i=="function"?i(o):i,o)}function OS(e){return(t,s,o)=>e({key:t,defaultValue:s,variableValues:o})}function NS(e){return(t,s,o)=>{let i=e?.[t];if(i&&o?.length){let n=0;for(;!(n>=o.length||i.indexOf("${variable}")===-1);)i=i.replace("${variable}",o[n++])}return i??s}}var xs=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.beans=e,this.stubContext=e.context,this.eventSvc=e.eventSvc,this.gos=e.gos}destroy(){const{destroyFunctions:e}=this;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t,s){this.localEventService||(this.localEventService=new Io),this.localEventService.addEventListener(e,t,s)}removeEventListener(e,t,s){this.localEventService?.removeEventListener(e,t,s)}dispatchLocalEvent(e){this.localEventService?.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventSvc,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const s=[];for(const o of Object.keys(t)){const i=t[o];i&&s.push(this._setupListener(e,o,i))}return s}_setupListener(e,t,s){if(this.destroyed)return()=>null;let o;if(HS(e))e.__addEventListener(t,s),o=()=>(e.__removeEventListener(t,s),null);else{const i=GS(e);e instanceof HTMLElement?MS(e,t,s):i?e.addListener(t,s):e.addEventListener(t,s),o=i?()=>(e.removeListener(t,s),null):()=>(e.removeEventListener(t,s),null)}return this.destroyFunctions.push(o),()=>(o(),this.destroyFunctions=this.destroyFunctions.filter(i=>i!==o),null)}setupPropertyListener(e,t){const{gos:s}=this;s.addPropertyEventListener(e,t);const o=()=>(s.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(o),()=>(o(),this.destroyFunctions=this.destroyFunctions.filter(i=>i!==o),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const s=e.join("-")+this.propertyListenerId++,o=i=>{if(i.changeSet){if(i.changeSet&&i.changeSet.id===this.lastChangeSetIdLookup[s])return;this.lastChangeSetIdLookup[s]=i.changeSet.id}const n={type:"propertyChanged",changeSet:i.changeSet,source:i.source};t(n)};for(const i of e)this.setupPropertyListener(i,o)}getLocaleTextFunc(){return yf(this.beans.localeSvc)}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const s=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),s}createBean(e,t,s){return(t||this.stubContext).createBean(e,s)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function HS(e){return e.__addEventListener!==void 0}function GS(e){return e.eventServiceType==="global"}var O=class extends xs{},_h={};function hu(e,t){_h[t]||(e(),_h[t]=!0)}var BS={pending:!1,funcs:[]},VS={pending:!1,funcs:[]};function ud(e,t="setTimeout",s){const o=t==="raf"?VS:BS;if(o.funcs.push(e),o.pending)return;o.pending=!0;const i=()=>{const n=o.funcs.slice();o.funcs.length=0,o.pending=!1;for(const r of n)r()};t==="raf"?Bs(s,i):window.setTimeout(i,0)}function lt(e,t,s){let o;return function(...i){const n=this;window.clearTimeout(o),o=window.setTimeout(function(){e.isAlive()&&t.apply(n,i)},s)}}function jh(e,t){let s=0;return function(...o){const i=this,n=Date.now();n-s<t||(s=n,e.apply(i,o))}}function zS(e,t,s,o=100){const i=Date.now();let n=null,r=!1;const a=()=>{n!=null&&(window.clearInterval(n),n=null)};e.addDestroyFunc(a);const l=()=>{const c=Date.now()-i>o;(t()||c)&&(s(),r=!0,a())};l(),r||(n=window.setInterval(l,10))}var xf=new Set(["__proto__","constructor","prototype"]);function WS(e,t){if(e!=null){if(Array.isArray(e)){for(let s=0;s<e.length;s++)t(s.toString(),e[s]);return}for(const s of Object.keys(e).filter(o=>!xf.has(o)))t(s,e[s])}}function St(e,t,s=!0,o=!1){X(t)&&WS(t,(i,n)=>{let r=e[i];r!==n&&(o&&r==null&&n!=null&&typeof n=="object"&&n.constructor===Object&&(r={},e[i]=r),Uh(n)&&Uh(r)&&!Array.isArray(r)?St(r,n,s,o):(s||n!==void 0)&&(e[i]=n))})}function Uh(e){return typeof e=="object"&&e!==null}var gu=class Ps{static applyGlobalGridOptions(t){if(!Ps.gridOptions)return{...t};let s={};return St(s,Ps.gridOptions,!0,!0),Ps.mergeStrategy==="deep"?St(s,t,!0,!0):s={...s,...t},Ps.gridOptions.context&&(s.context=Ps.gridOptions.context),t.context&&(Ps.mergeStrategy==="deep"&&s.context&&St(t.context,s.context,!0,!0),s.context=t.context),s}static applyGlobalGridOption(t,s){if(Ps.mergeStrategy==="deep"){const o=Rf(t);if(o&&typeof o=="object"&&typeof s=="object")return Ps.applyGlobalGridOptions({[t]:s})[t]}return s}};gu.gridOptions=void 0;gu.mergeStrategy="shallow";var pu=gu;function Rf(e){return pu.gridOptions?.[e]}var Ff={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,rowNumbers:!1,enableFilterHandlers:!1},Ef="https://www.ag-grid.com";function Ao(e,t,...s){e.get("debug")&&console.log("AG Grid: "+t,...s)}function Ln(e,...t){hu(()=>console.warn("AG Grid: "+e,...t),e+t?.join(""))}function bi(e,...t){hu(()=>console.error("AG Grid: "+e,...t),e+t?.join(""))}var Df=new Set,Ia={},xo={},ua,Pf=!1,Tf=!1,_S=!1;function jS(e){const[t,s]=e.version.split(".")||[],[o,i]=ua.split(".")||[];return t===o&&s===i}function US(e){ua||(ua=e.version);const t=o=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${o} Please update all modules to the same version.`;e.version?jS(e)||bi(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${ua}.`)):bi(t(`'${e.moduleName}' is incompatible.`));const s=e.validate?.();s&&!s.isValid&&bi(`${s.message}`)}function Yn(e,t,s=!1){s||(Pf=!0),US(e);const o=e.rowModels??["all"];Df.add(e);let i;t!==void 0?(Tf=!0,xo[t]===void 0&&(xo[t]={}),i=xo[t]):i=Ia;for(const n of o)i[n]===void 0&&(i[n]={}),i[n][e.moduleName]=e;if(e.dependsOn)for(const n of e.dependsOn)Yn(n,t,s)}function $S(e){delete xo[e]}function hd(e,t,s){const o=i=>!!Ia[i]?.[e]||!!xo[t]?.[i]?.[e];return o(s)||o("all")}function fu(){return Tf}function qS(e,t){const s=xo[e]??{};return[...Object.values(Ia.all??{}),...Object.values(s.all??{}),...Object.values(Ia[t]??{}),...Object.values(s[t]??{})]}function KS(){return new Set(Df)}function YS(e,t){const s=xo[e]??{};return[...Object.values(s.all??{}),...Object.values(s[t]??{})]}function ZS(){return Pf}function XS(){return _S}var Mf=class{static register(e){Yn(e,void 0)}static registerModules(e){for(const t of e)Yn(t,void 0)}},Z="34.3.0",$h=2e3,qh=100,If="_version_",kf=null,Si=`${Ef}/javascript-data-grid`;function QS(e){kf=e}function JS(e){Si=e}function Af(e,t,s){return kf?.(e,t)??[oy(e,t,s)]}function mu(e,t,s,o,i){e(`${o?"warning":"error"} #${t}`,...Af(t,s,i))}function ey(e){if(!e)return String(e);const t={};for(const s of Object.keys(e))typeof e[s]!="object"&&typeof e[s]!="function"&&(t[s]=e[s]);return JSON.stringify(t)}function ty(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=ey(e)),t}function ka(e){return e===void 0?"undefined":e===null?"null":e}function gd(e,t){return`${e}?${t.toString()}`}function sy(e,t,s){const o=Array.from(t.entries()).sort((n,r)=>r[1].length-n[1].length);let i=gd(e,t);for(const[n,r]of o){if(n===If)continue;const a=i.length-s;if(a<=0)break;const l="...",c=a+l.length,d=r.length-c>qh?r.slice(0,r.length-c)+l:r.slice(0,qh)+l;t.set(n,d),i=gd(e,t)}return i}function Lf(e,t){const s=new URLSearchParams;if(s.append(If,Z),t)for(const n of Object.keys(t))s.append(n,ty(t[n]));const o=`${Si}/errors/${e}`,i=gd(o,s);return i.length<=$h?i:sy(o,s,$h)}var oy=(e,t,s)=>{const o=Lf(e,t);return`${`${s?s+`
2
2
  `:""}Visit ${o}`}${s?"":`
3
3
  Alternatively register the ValidationModule to see the full message in the console.`}`};function z(...e){mu(Ln,e[0],e[1],!0)}function He(...e){mu(bi,e[0],e[1],!1)}function Fn(e,t,s){mu(bi,e,t,!1,s)}function iy(e,t){const s=t[0];return`error #${s} `+Af(s,t[1],e).join(" ")}function ws(...e){return iy(void 0,e)}function Of(e,t){return e.get("rowModelType")===t}function Qe(e,t){return Of(e,"clientSide")}function zo(e,t){return Of(e,"serverSide")}function gt(e,t){return e.get("domLayout")===t}function Ro(e){return La(e)!==void 0}function Nf(e){return typeof e.get("getRowHeight")=="function"}function ny(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function to(e,t,s=!1,o){const{gos:i,environment:n}=e;if(o==null&&(o=n.getDefaultRowHeight()),Nf(i)){if(s)return{height:o,estimated:!0};const l={node:t,data:t.data},c=i.getCallback("getRowHeight")(l);if(pd(c))return c===0&&z(23),{height:Math.max(1,c),estimated:!1}}if(t.detail&&i.get("masterDetail"))return ry(i);const r=i.get("rowHeight");return{height:r&&pd(r)?r:o,estimated:!1}}function ry(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return pd(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function Fo(e){const{environment:t,gos:s}=e,o=s.get("rowHeight");if(!o||qe(o))return t.getDefaultRowHeight();const i=t.refreshRowHeightVariable();return i!==-1?i:(z(24),t.getDefaultRowHeight())}function pd(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function Hf(e,t,s){const o=t[e.getDomDataKey()];return o?o[s]:void 0}function Lo(e,t,s,o){const i=e.getDomDataKey();let n=t[i];qe(n)&&(n={},t[i]=n),n[s]=o}function yi(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function Gf(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||gt(e,"print"))}function fs(e){return!e.get("autoGroupColumnDef")?.comparator&&!e.get("treeData")}function fd(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function Bf(e){return e.get("grandTotalRow")}function Vf(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function zf(e,t,s){return!!t.group&&!t.footer&&Vf(e,s)}function Li(e){const t=e.getCallback("getRowId");return t===void 0?t:s=>{let o=t(s);return typeof o!="string"&&(hu(()=>z(25,{id:o}),"getRowIdString"),o=String(o)),o}}function ay(e,t){const s=e.get("groupHideParentOfSingleChild");return!!(s===!0||s==="leafGroupsOnly"&&t.leafGroup||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")&&t.leafGroup)}function ly(e){const t=e.get("maxConcurrentDatasourceRequests");return t>0?t:void 0}function xi(e){return e?.checkboxes??!0}function ha(e){return e?.mode==="multiRow"&&(e.headerCheckbox??!0)}function Aa(e){if(typeof e=="object")return e.checkboxLocation??"selectionColumn"}function lc(e){return e?.hideDisabledCheckboxes??!1}function cy(e){return typeof e.get("rowSelection")!="string"}function so(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function Wf(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const s=e.get("suppressRowClickSelection"),o=e.get("suppressRowDeselection");return s&&o?!1:s?"enableDeselection":o?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function dy(e){const t=Wf(e);return t===!0||t==="enableSelection"}function uy(e){const t=Wf(e);return t===!0||t==="enableDeselection"}function md(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t?.isRowSelectable}function La(e){const t="beanName"in e&&e.beanName==="gos"?e.get("rowSelection"):e.rowSelection;if(typeof t=="string")switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(t?.mode){case"multiRow":case"singleRow":return t.mode;default:return}}function Oa(e){return La(e)==="multiRow"}function hy(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):t?.enableSelectionWithoutKeys??!1}function Na(e){const t=e.get("rowSelection");if(typeof t=="string"){const s=e.get("groupSelectsChildren"),o=e.get("groupSelectsFiltered");return s&&o?"filteredDescendants":s?"descendants":"self"}return t?.mode==="multiRow"?t.groupSelects:void 0}function _f(e,t=!0){const s=e.get("rowSelection");return typeof s!="object"?t?"all":void 0:s.mode==="multiRow"?s.selectAll:"all"}function gy(e){const t=e.get("rowSelection");return typeof t=="string"?!1:t?.mode==="multiRow"?t.ctrlASelectsRows??!1:!1}function Zn(e){const t=Na(e);return t==="descendants"||t==="filteredDescendants"}function Kh(e){const t=e.get("rowSelection");return typeof t=="object"&&t.masterSelects||"self"}function py(e){return e.isModuleRegistered("SetFilter")&&!e.get("suppressSetFilterByDefault")}function Vt(e){return e.get("columnMenu")==="legacy"}function fy(e){return!Vt(e)}function my(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}function Cy(e,t,s){typeof e!="object"&&(e={});const o={...e};for(const i of s){const n=t[i];typeof n<"u"&&(o[i]=n)}return o}function vy(e,t){if(!e)return;const s={};let o=!1;for(const r of Object.keys(e))s[r]=e[r],o=!0;if(!o)return;const i={type:"gridOptionsChanged",options:s};t.dispatchEvent(i);const n={type:"componentStateChanged",...s};t.dispatchEvent(n)}function we(e,t){return e.addCommon(t)}function ga(e,t){return e[t]??e.gridOptions?.[t]??Rf(t)??Ff[t]}function Yh({gos:e},t){return t.button===2||t.ctrlKey&&e.get("allowContextMenuWithControlKey")}var wy={resizable:!0,sortable:!0},by=0;function jf(){return by++}function oo(e){return e instanceof Wo}var Wo=class extends O{constructor(e,t,s,o){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=s,this.primary=o,this.isColumn=!0,this.instanceId=jf(),this.autoHeaderHeight=null,this.moving=!1,this.resizing=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.colEventSvc=new Io,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=Mn(s)}destroy(){super.destroy(),this.beans.rowSpanSvc?.deregister(this)}getInstanceId(){return this.instanceId}setState(){const{colDef:e,beans:{sortSvc:t,pinnedCols:s,colFlex:o}}=this;t?.initCol(this);const i=e.hide;i!==void 0?this.visible=!i:this.visible=!e.initialHide,s?.initCol(this),o?.initCol(this)}setColDef(e,t,s){const o=e.spanRows!==this.colDef.spanRows;this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),o&&(this.beans.rowSpanSvc?.deregister(this),this.initRowSpan()),this.dispatchColEvent("colDefChanged",s)}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.setState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip(),this.initRowSpan(),this.addPivotListener()}initDotNotation(){const{gos:e,colDef:{field:t,tooltipField:s}}=this,o=e.get("suppressFieldDotNotation");this.fieldContainsDots=X(t)&&t.includes(".")&&!o,this.tooltipFieldContainsDots=X(s)&&s.includes(".")&&!o}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.beans.tooltipSvc?.initCol(this)}initRowSpan(){this.colDef.spanRows&&this.beans.rowSpanSvc?.register(this)}addPivotListener(){const e=this.beans.pivotColDefSvc,t=this.colDef.pivotValueColumn;!e||!t||this.addManagedListeners(t,{colDefChanged:s=>{const o=e.recreateColDef(this.colDef);this.setColDef(o,o,s.source)}})}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let t;const s=e.width,o=e.initialWidth;return s!=null?t=s:o!=null?t=o:t=200,Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){return this.beans.showRowGroupCols?.isRowGroupDisplayed(this,e)??!1}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}getHighlighted(){return this.highlighted}__addEventListener(e,t){this.colEventSvc.addEventListener(e,t)}__removeEventListener(e,t){this.colEventSvc.removeEventListener(e,t)}addEventListener(e,t){this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,this.colEventSvc);const s=this.frameworkEventListenerService?.wrap(e,t)??t;this.colEventSvc.addEventListener(e,s)}removeEventListener(e,t){const s=this.frameworkEventListenerService?.unwrap(e,t)??t;this.colEventSvc.removeEventListener(e,s)}createColumnFunctionCallbackParams(e){return we(this.gos,{node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){return this.beans.cellNavigation?.isSuppressNavigable(this,e)??!1}isCellEditable(e){return this.beans.editSvc?.isCellEditable({rowNode:e,column:this})??!1}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.beans.selectionSvc?.isCellCheckboxSelection(this,e)??!1}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?.suppressPaste??null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??wy[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const s=this.createColumnFunctionCallbackParams(e);return t(s)}return!1}createColumnEvent(e,t){return we(this.gos,{type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return qe(this.sort)}isSorting(){return X(this.sort)}getSortIndex(){return this.sortIndex}isMenuVisible(){return this.menuVisible}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchColEvent("leftChanged",t))}isFilterActive(){return this.filterActive}isHovered(){return z(261),!!this.beans.colHover?.isHovered(this)}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.dispatchColEvent("firstRightPinnedChanged",t))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.dispatchColEvent("lastLeftPinnedChanged",t))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const s=e===!0;this.visible!==s&&(this.visible=s,this.dispatchColEvent("visibleChanged",t)),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.getColDef().suppressSpanHeaderHeight}getFirstRealParent(){let e=this.getOriginalParent();for(;e?.isPadding();)e=e.getOriginalParent();return e}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e?.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let s=!0;for(;e;){if(!e.isPadding()){s=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:s}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return we(this.gos,{node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(qe(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),s=this.colDef.colSpan(t);return Math.max(s,1)}getRowSpan(e){if(qe(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),s=this.colDef.rowSpan(t);return Math.max(s,1)}setActualWidth(e,t,s=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex!=null&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),s||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.dispatchColEvent("widthChanged",e)}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex}isRowGroupActive(){return this.rowGroupActive}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}dispatchColEvent(e,t,s){const o=this.createColumnEvent(e,t);s&&St(o,s),this.colEventSvc.dispatchEvent(o)}dispatchStateUpdatedEvent(e){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:e})}};function mt(e){return e instanceof pa}var pa=class extends O{constructor(e,t,s,o){super(),this.colGroupDef=e,this.groupId=t,this.padding=s,this.level=o,this.isColumn=!1,this.expandable=!1,this.instanceId=jf(),this.expandableListenerRemoveCallback=null,this.expanded=!!e?.openByDefault}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}forEachLeafColumn(e){if(this.children)for(const t of this.children)oo(t)?e(t):mt(t)&&t.forEachLeafColumn(e)}addLeafColumns(e){if(this.children)for(const t of this.children)oo(t)?e.push(t):mt(t)&&t.addLeafColumns(e)}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);for(const t of this.getLeafColumns())t.__addEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=()=>{for(const t of this.getLeafColumns())t.__removeEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,s=!1;const o=this.findChildrenRemovingPadding();for(let n=0,r=o.length;n<r;n++){const a=o[n];if(!a.isVisible())continue;const l=a.getColumnGroupShow();l==="open"?(e=!0,s=!0):l==="closed"?(t=!0,s=!0):(e=!0,t=!0)}const i=e&&t&&s;this.expandable!==i&&(this.expandable=i,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=s=>{for(const o of s)mt(o)&&o.isPadding()?t(o.children):e.push(o)};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},Sy={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function Zh(e,t,s){const o={},i=e.gos;return Object.assign(o,i.get("defaultColGroupDef")),Object.assign(o,t),i.validateColDef(o,s),o}var yy=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=cd(e);let s=0;for(;;){let o=e??t;if(o?s!==0&&(o+="_"+s):o=s,!this.existingKeys[o]){const i=String(o);return e&&s>0&&z(273,{providedId:e,usedId:i}),this.existingKeys[i]=!0,i}s++}}};function Be(e){if(e?.length)return e[e.length-1]}function ro(e,t,s){if(e===t)return!0;if(!e||!t)return e==null&&t==null;const o=e.length;if(o!==t.length)return!1;for(let i=0;i<o;i++)if(e[i]!==t[i]&&!s?.(e[i],t[i]))return!1;return!0}function Cn(e,t){if(e)for(const s of e)t(s)}function as(e,t){const s=e.indexOf(t);s>=0&&e.splice(s,1)}function Xh(e,t,s){for(let o=0;o<t.length;o++)as(e,t[o]);for(let o=t.length-1;o>=0;o--)e.splice(s,0,t[o])}var Xs="ag-Grid-AutoColumn",Cu="ag-Grid-SelectionColumn",vu="ag-Grid-RowNumbersColumn";function Uf(e){const t=[],s=o=>{for(let i=0;i<o.length;i++){const n=o[i];oo(n)?t.push(n):mt(n)&&s(n.getChildren())}};return s(e),t}function Ts(e){return e.reduce((t,s)=>t+s.getActualWidth(),0)}function Ha(e,t,s){const o={};if(!t)return;Ls(null,t,n=>{o[n.getInstanceId()]=n}),s&&Ls(null,s,n=>{o[n.getInstanceId()]=null});const i=Object.values(o).filter(n=>n!=null);e.context.destroyBeans(i)}function wu(e){return e.getId().startsWith(Xs)}function Vs(e){return(typeof e=="string"?e:"getColId"in e?e.getColId():e.colId)?.startsWith(Cu)??!1}function As(e){return(typeof e=="string"?e:"getColId"in e?e.getColId():e.colId)?.startsWith(vu)??!1}function xy(e){return Vs(e)||As(e)}function Ga(e){let t=[];return e instanceof Array?t=e:typeof e=="string"&&(t=e.split(",")),t}function Ry(e,t){return ro(e,t,(s,o)=>s.getColId()===o.getColId())}function Fy(e){e.map={};for(const t of e.list)e.map[t.getId()]=t}function Ri(e){return e==="optionsUpdated"?"gridOptionsChanged":e}function On(e,t){const s=e===t,o=e.getColDef()===t,i=e.getColId()==t;return s||o||i}var Ey=(e,t)=>(s,o)=>{const i={value1:void 0,value2:void 0};let n=!1;return e&&(e[s]!==void 0&&(i.value1=e[s],n=!0),X(o)&&e[o]!==void 0&&(i.value2=e[o],n=!0)),!n&&t&&(t[s]!==void 0&&(i.value1=t[s]),X(o)&&t[o]!==void 0&&(i.value2=t[o])),i},Dy=(e,t)=>{mt(e)&&e.setupExpandable(),e.originalParent=t};function Py(e,t=null,s,o,i){const n=new yy,{existingCols:r,existingGroups:a,existingColKeys:l}=Ty(o);n.addExistingKeys(l);const c=$f(e,t,0,s,r,n,a,i),{colGroupSvc:d}=e,u=d?.findMaxDepth(c,0)??0,h=d?d.balanceColumnTree(c,0,u,n):c;return Ls(null,h,Dy),{columnTree:h,treeDepth:u}}function Ty(e){const t=[],s=[],o=[];return e&&Ls(null,e,i=>{if(mt(i)){const n=i;s.push(n)}else{const n=i;o.push(n.getId()),t.push(n)}}),{existingCols:t,existingGroups:s,existingColKeys:o}}function $f(e,t,s,o,i,n,r,a){if(!t)return[];const{colGroupSvc:l}=e,c=new Array(t.length);for(let d=0;d<c.length;d++){const u=t[d];l&&Oy(u)?c[d]=l.createProvidedColumnGroup(o,u,s,i,n,r,a):c[d]=My(e,o,u,i,n,a)}return c}function My(e,t,s,o,i,n){const r=ky(s,o);r&&o?.splice(r.idx,1);let a=r?.column;if(a){const l=Cd(e,s,a.getColId());a.setColDef(l,s,n),Iy(e,a,l,n)}else{const l=i.getUniqueKey(s.colId,s.field),c=Cd(e,s,l);a=new Wo(c,s,l,t),e.context.createBean(a)}return e.dataTypeSvc?.addColumnListeners(a),a}function qf(e,t,s,o,i,n,r,a){const{sortSvc:l,pinnedCols:c,colFlex:d}=e;s!==void 0&&t.setVisible(!s,a),l&&(l.updateColSort(t,o,a),i!==void 0&&l.setColSortIndex(t,i)),n!==void 0&&c?.setColPinned(t,n),r!==void 0&&d?.setColFlex(t,r)}function Iy(e,t,s,o){qf(e,t,s.hide,s.sort,s.sortIndex,s.pinned,s.flex,o);const i=t.getFlex();if(!(i!=null&&i>0))if(s.width!=null)t.setActualWidth(s.width,o);else{const n=t.getActualWidth();t.setActualWidth(n,o)}}function ky(e,t){if(t)for(let s=0;s<t.length;s++){const o=t[s].getUserProvidedColDef();if(!o)continue;if(e.colId!=null){if(t[s].getId()===e.colId)return{idx:s,column:t[s]};continue}if(e.field!=null){if(o.field===e.field)return{idx:s,column:t[s]};continue}if(o===e)return{idx:s,column:t[s]}}}function Cd(e,t,s,o){const{gos:i,dataTypeSvc:n}=e,r={},a=i.get("defaultColDef");St(r,a,!1,!0);const l=Ay(e,r,t,s);l&&Ly(e,l,r);const c=r.cellDataType;St(r,t,!1,!0),c!==void 0&&(r.cellDataType=c);const d=i.get("autoGroupColumnDef"),u=fs(i);return t.rowGroup&&d&&u&&St(r,{sort:d.sort,initialSort:d.initialSort},!1,!0),n&&(n.postProcess(r),n.validateColDef(r)),i.validateColDef(r,s,o),r}function Ay(e,t,s,o){const i=e.dataTypeSvc?.updateColDefAndGetColumnType(t,s,o),n=s.type??i??t.type;return t.type=n,n?Ga(n):void 0}function Ly(e,t,s){if(!t.length)return;const o=Object.assign({},Sy),i=e.gos.get("columnTypes")||{};for(const n of Object.keys(i)){const r=i[n];n in o?z(34,{key:n}):(r.type&&z(35),o[n]=r)}for(const n of t){const r=o[n.trim()];r?St(s,r,!1,!0):z(36,{t:n})}}function Oy(e){return e.children!==void 0}function Ls(e,t,s){if(t)for(let o=0;o<t.length;o++){const i=t[o];mt(i)&&Ls(i,i.getChildren(),s),s(i,e)}}function Kf(e,t){const s=[],o=[],i=[];return e.forEach(r=>{const a=r.getColDef().lockPosition;a==="right"?i.push(r):a==="left"||a===!0?s.push(r):o.push(r)}),t.get("enableRtl")?[...i,...o,...s]:[...s,...o,...i]}function Yf(e,t){let s=!0;return Ls(null,t,o=>{if(!mt(o))return;const i=o;if(!i.getColGroupDef()?.marryChildren)return;const a=[];for(const h of i.getLeafColumns()){const p=e.indexOf(h);a.push(p)}const l=Math.max.apply(Math,a),c=Math.min.apply(Math,a),d=l-c,u=i.getLeafColumns().length-1;d>u&&(s=!1)}),s}function Zf(e,t){if(!e||e.length==0)return;const s=t(e[0]);for(let o=1;o<e.length;o++)if(s!==t(e[o]))return;return s}function Xf(e,t,s){if(!t.length)return;const o=t.length===1?t[0]:null,i=Zf(t,n=>n.getPinned());e.dispatchEvent({type:"columnPinned",pinned:i??null,columns:t,column:o,source:s})}function Ny(e,t,s){if(!t.length)return;const o=t.length===1?t[0]:null,i=Zf(t,n=>n.isVisible());e.dispatchEvent({type:"columnVisible",visible:i,columns:t,column:o,source:s})}function Hy(e,t,s,o){e.dispatchEvent({type:t,columns:s,column:s&&s.length==1?s[0]:null,source:o})}function Oi(e,t,s,o,i=null){t?.length&&e.dispatchEvent({type:"columnResized",columns:t,column:t.length===1?t[0]:null,flexColumns:i,finished:s,source:o})}function rs(e,t,s){const{colModel:o,rowGroupColsSvc:i,pivotColsSvc:n,autoColSvc:r,selectionColSvc:a,colAnimation:l,visibleCols:c,pivotResultCols:d,environment:u,valueColsSvc:h,eventSvc:p,gos:m}=e,C=o.getColDefCols()??[],v=a?.getColumns();if(!C.length&&!v?.length)return!1;if(t?.state&&!t.state.forEach)return z(32),!1;const w=(y,F,R,E,D)=>{if(!y)return;const P=Ey(F,t.defaultState),T=P("flex").value1;if(qf(e,y,P("hide").value1,P("sort").value1,P("sortIndex").value1,P("pinned").value1,T,s),T==null){const M=P("width").value1;if(M!=null){const k=y.getColDef().minWidth??u.getDefaultColumnMinWidth();k!=null&&M>=k&&y.setActualWidth(M,s)}}D||!y.isPrimary()||(h?.syncColumnWithState(y,s,P),i?.syncColumnWithState(y,s,P,R),n?.syncColumnWithState(y,s,P,E))},b=(y,F,R)=>{const E=Qf(e,s),D=F.slice(),P={},T={},M=[],k=[],N=[];let A=0;const W=i?.columns.slice()??[],U=n?.columns.slice()??[];for(const H of y){const te=H.colId;if(te.startsWith(Xs)){M.push(H),N.push(H);continue}if(Vs(te)){k.push(H),N.push(H);continue}const J=R(te);J?(w(J,H,P,T,!1),as(D,J)):(N.push(H),A+=1)}const L=H=>w(H,null,P,T,!1);D.forEach(L),i?.sortColumns(Qh.bind(i,P,W)),n?.sortColumns(Qh.bind(n,T,U)),o.refreshCols(!1,s);const de=(H,te,Q=[])=>{for(const J of te){const me=H(J.colId);as(Q,me),w(me,J,null,null,!0)}Q.forEach(L)};return de(H=>r?.getColumn(H)??null,M,r?.getColumns()?.slice()),de(H=>a?.getColumn(H)??null,k,a?.getColumns()?.slice()),By(t,o,m),c.refresh(s),p.dispatchEvent({type:"columnEverythingChanged",source:s}),E(),{unmatchedAndAutoStates:N,unmatchedCount:A}};l?.start();let{unmatchedAndAutoStates:S,unmatchedCount:x}=b(t.state||[],C,y=>o.getColDefCol(y));if(S.length>0||X(t.defaultState)){const y=d?.getPivotResultCols()?.list??[];x=b(S,y,F=>d?.getPivotResultCol(F)??null).unmatchedCount}return l?.finish(),x===0}function Gy(e,t){const{colModel:s,autoColSvc:o,selectionColSvc:i,eventSvc:n,gos:r}=e,a=s.getColDefCols();if(!a?.length)return;const l=s.getColDefColTree(),c=Uf(l),d=[];let u=1e3,h=1e3;const p=b=>{const S=Jf(b);qe(S.rowGroupIndex)&&S.rowGroup&&(S.rowGroupIndex=u++),qe(S.pivotIndex)&&S.pivot&&(S.pivotIndex=h++),d.push(S)};o?.getColumns()?.forEach(p),i?.getColumns()?.forEach(p),c?.forEach(p),rs(e,{state:d},t);const m=o?.getColumns()??[],w=[...i?.getColumns()??[],...m,...a].map(b=>({colId:b.colId}));rs(e,{state:w,applyOrder:!0},t),n.dispatchEvent(we(r,{type:"columnsReset",source:t}))}function Qf(e,t){const{rowGroupColsSvc:s,pivotColsSvc:o,valueColsSvc:i,colModel:n,sortSvc:r,eventSvc:a}=e,l={rowGroupColumns:s?.columns.slice()??[],pivotColumns:o?.columns.slice()??[],valueColumns:i?.columns.slice()??[]},c=Ba(e),d={};for(const u of c)d[u.colId]=u;return()=>{const u=(F,R,E,D)=>{const P=R.map(D),T=E.map(D);if(ro(P,T))return;const k=new Set(R);for(const A of E)k.delete(A)||k.add(A);const N=[...k];a.dispatchEvent({type:F,columns:N,column:N.length===1?N[0]:null,source:t})},h=F=>{const R=[];return n.forAllCols(E=>{const D=d[E.getColId()];D&&F(D,E)&&R.push(E)}),R},p=F=>F.getColId();u("columnRowGroupChanged",l.rowGroupColumns,s?.columns??[],p),u("columnPivotChanged",l.pivotColumns,o?.columns??[],p);const C=h((F,R)=>{const E=F.aggFunc!=null,D=E!=R.isValueActive(),P=E&&F.aggFunc!=R.getAggFunc();return D||P});C.length>0&&Hy(a,"columnValueChanged",C,t),Oi(a,h((F,R)=>F.width!=R.getActualWidth()),!0,t),Xf(a,h((F,R)=>F.pinned!=R.getPinned()),t),Ny(a,h((F,R)=>F.hide==R.isVisible()),t);const x=h((F,R)=>F.sort!=R.getSort()||F.sortIndex!=R.getSortIndex());x.length>0&&r?.dispatchSortChangedEvents(t,x);const y=Ba(e);zy(c,y,t,n,a)}}function Ba(e){const{colModel:t,rowGroupColsSvc:s,pivotColsSvc:o}=e,i=t.getColDefCols();if(qe(i)||!t.isAlive())return[];const n=s?.columns,r=o?.columns,a=[],l=d=>{const u=d.isRowGroupActive()&&n?n.indexOf(d):null,h=d.isPivotActive()&&r?r.indexOf(d):null,p=d.isValueActive()?d.getAggFunc():null,m=d.getSort()!=null?d.getSort():null,C=d.getSortIndex()!=null?d.getSortIndex():null;a.push({colId:d.getColId(),width:d.getActualWidth(),hide:!d.isVisible(),pinned:d.getPinned(),sort:m,sortIndex:C,aggFunc:p,rowGroup:d.isRowGroupActive(),rowGroupIndex:u,pivot:d.isPivotActive(),pivotIndex:h,flex:d.getFlex()??null})};t.forAllCols(d=>l(d));const c=new Map(t.getCols().map((d,u)=>[d.getColId(),u]));return a.sort((d,u)=>{const h=c.has(d.colId)?c.get(d.colId):-1,p=c.has(u.colId)?c.get(u.colId):-1;return h-p}),a}function Jf(e){const t=(m,C)=>m??C??null,s=e.getColDef(),o=t(s.sort,s.initialSort),i=t(s.sortIndex,s.initialSortIndex),n=t(s.hide,s.initialHide),r=t(s.pinned,s.initialPinned),a=t(s.width,s.initialWidth),l=t(s.flex,s.initialFlex);let c=t(s.rowGroupIndex,s.initialRowGroupIndex),d=t(s.rowGroup,s.initialRowGroup);c==null&&!d&&(c=null,d=null);let u=t(s.pivotIndex,s.initialPivotIndex),h=t(s.pivot,s.initialPivot);u==null&&!h&&(u=null,h=null);const p=t(s.aggFunc,s.initialAggFunc);return{colId:e.getColId(),sort:o,sortIndex:i,hide:n,pinned:r,width:a,flex:l,rowGroup:d,rowGroupIndex:c,pivot:h,pivotIndex:u,aggFunc:p}}function By(e,t,s){if(!e.applyOrder||!e.state)return;const o=[];for(const i of e.state)i.colId!=null&&o.push(i.colId);Vy(t.cols,o,t,s)}function Vy(e,t,s,o){if(e==null)return;let i=[];const n={};for(const a of t){if(n[a])continue;const l=e.map[a];l&&(i.push(l),n[a]=!0)}let r=0;for(const a of e.list){const l=a.getColId();if(n[l]!=null)continue;l.startsWith(Xs)?i.splice(r++,0,a):i.push(a)}if(i=Kf(i,o),!Yf(i,s.getColTree())){z(39);return}e.list=i}function zy(e,t,s,o,i){const n={};for(const d of t)n[d.colId]=d;const r={};for(const d of e)n[d.colId]&&(r[d.colId]=!0);const a=e.filter(d=>r[d.colId]),l=t.filter(d=>r[d.colId]),c=[];l.forEach((d,u)=>{const h=a?.[u];if(h&&h.colId!==d.colId){const p=o.getCol(h.colId);p&&c.push(p)}}),c.length&&i.dispatchEvent({type:"columnMoved",columns:c,column:c.length===1?c[0]:null,finished:!0,source:s})}var Qh=(e,t,s,o)=>{const i=e[s.getId()],n=e[o.getId()],r=i!=null,a=n!=null;if(r&&a)return i-n;if(r)return-1;if(a)return 1;const l=t.indexOf(s),c=t.indexOf(o),d=l>=0,u=c>=0;return d&&u?l-c:d?-1:1},Wy=class extends O{constructor(){super(...arguments),this.beanName="colModel",this.pivotMode=!1,this.ready=!1,this.changeEventsDispatching=!1}postConstruct(){this.pivotMode=this.gos.get("pivotMode"),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents","rowNumbers","hidePaddedHeaderRows"],e=>this.refreshAll(Ri(e.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),Ri(e.source)))}createColsFromColDefs(e){const{beans:t}=this,{valueCache:s,colAutosize:o,rowGroupColsSvc:i,pivotColsSvc:n,valueColsSvc:r,visibleCols:a,eventSvc:l,groupHierarchyColSvc:c}=t,d=this.colDefs?Qf(t,e):void 0;s?.expire();const u=this.colDefCols?.list,h=this.colDefCols?.tree,p=Py(t,this.colDefs,!0,h,e);Ha(t,this.colDefCols?.tree,p.columnTree);const m=p.columnTree,C=p.treeDepth,v=Uf(m),w={};for(const b of v)w[b.getId()]=b;this.colDefCols={tree:m,treeDepth:C,list:v,map:w},this.createColumnsForService([c],this.colDefCols,e),i?.extractCols(e,u),n?.extractCols(e,u),r?.extractCols(e,u),this.ready=!0,this.refreshCols(!0,e),a.refresh(e),l.dispatchEvent({type:"columnEverythingChanged",source:e}),d&&(this.changeEventsDispatching=!0,d(),this.changeEventsDispatching=!1),l.dispatchEvent({type:"newColumnsLoaded",source:e}),e==="gridInitializing"&&o?.applyAutosizeStrategy()}refreshCols(e,t){if(!this.colDefCols)return;const s=this.cols?.tree;this.saveColOrder();const{autoColSvc:o,selectionColSvc:i,rowNumbersSvc:n,quickFilter:r,pivotResultCols:a,showRowGroupCols:l,rowAutoHeight:c,visibleCols:d,colViewport:u,eventSvc:h}=this.beans,p=this.selectCols(a,this.colDefCols);this.createColumnsForService([o,i,n],p,t);const m=ny(this.gos,this.showingPivotResult);(!e||m)&&this.restoreColOrder(p),this.positionLockedCols(p),l?.refresh(),r?.refreshCols(),this.setColSpanActive(),c?.setAutoHeightActive(p),d.clear(),u.clear(),!ro(s,this.cols.tree)&&h.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(e,t,s){for(const o of e)o&&(o.createColumns(t,i=>{this.lastOrder=i(this.lastOrder),this.lastPivotOrder=i(this.lastPivotOrder)},s),o.addColumns(t))}selectCols(e,t){const s=e?.getPivotResultCols()??null;this.showingPivotResult=s!=null;const{map:o,list:i,tree:n,treeDepth:r}=s??t;return this.cols={list:i.slice(),map:{...o},tree:n.slice(),treeDepth:r},s&&(s.list.some(l=>this.cols?.map[l.getColId()]!==void 0)||(this.lastPivotOrder=null)),this.cols}getColsToShow(){if(!this.cols)return[];const{valueColsSvc:e,selectionColSvc:t,gos:s}=this.beans,o=this.isPivotMode()&&!this.showingPivotResult,i=t?.isSelectionColumnEnabled(),n=s.get("rowNumbers"),r=e?.columns;return this.cols.list.filter(l=>{const c=wu(l);if(o){const d=r?.includes(l);return c||d||i&&Vs(l)||n&&As(l)}else return c||l.isVisible()})}refreshAll(e){this.ready&&(this.refreshCols(!1,e),this.beans.visibleCols.refresh(e))}setColsVisible(e,t=!1,s){rs(this.beans,{state:e.map(o=>({colId:typeof o=="string"?o:o.getColId(),hide:!t}))},s)}restoreColOrder(e){const t=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!t)return;const s=t.filter(u=>e.map[u.getId()]!=null);if(s.length===0)return;if(s.length===e.list.length){e.list=s;return}const o=u=>{const h=u.getOriginalParent();return h?h.getChildren().length>1?!0:o(h):!1};if(!s.some(u=>o(u))){const u=new Set(s);for(const h of e.list)u.has(h)||s.push(h);e.list=s;return}const i=new Map;for(let u=0;u<s.length;u++){const h=s[u];i.set(h,u)}const n=e.list.filter(u=>!i.has(u));if(n.length===0){e.list=s;return}const r=(u,h)=>{const p=h?h.getOriginalParent():u.getOriginalParent();if(!p)return null;let m=null,C=null;for(const v of p.getChildren())if(!(v===h||v===u)){if(v instanceof Wo){const w=i.get(v);if(w==null)continue;(m==null||m<w)&&(m=w,C=v);continue}v.forEachLeafColumn(w=>{const b=i.get(w);b!=null&&(m==null||m<b)&&(m=b,C=w)})}return C??r(u,p)},a=[],l=new Map;for(const u of n){const h=r(u,null);if(h==null){a.push(u);continue}const p=l.get(h);p===void 0?l.set(h,u):Array.isArray(p)?p.push(u):l.set(h,[p,u])}const c=new Array(e.list.length);let d=c.length-1;for(let u=a.length-1;u>=0;u--)c[d--]=a[u];for(let u=s.length-1;u>=0;u--){const h=s[u],p=l.get(h);if(p)if(Array.isArray(p))for(let m=p.length-1;m>=0;m--){const C=p[m];c[d--]=C}else c[d--]=p;c[d--]=h}e.list=c}positionLockedCols(e){e.list=Kf(e.list,this.gos)}saveColOrder(){this.showingPivotResult?this.lastPivotOrder=this.cols?.list??null:this.lastOrder=this.cols?.list??null}getColumnDefs(e){return this.colDefCols&&this.beans.colDefFactory?.getColumnDefs(this.colDefCols.list,this.showingPivotResult,this.lastOrder,this.cols?.list??[],e)}setColSpanActive(){this.colSpanActive=!!this.cols?.list.some(e=>e.getColDef().colSpan!=null)}isPivotMode(){return this.pivotMode}setPivotMode(e,t){if(e===this.pivotMode||(this.pivotMode=e,!this.ready))return;this.refreshCols(!1,t);const{visibleCols:s,eventSvc:o}=this.beans;s.refresh(t),o.dispatchEvent({type:"columnPivotModeChanged"})}isPivotActive(){const e=this.beans.pivotColsSvc?.columns;return this.pivotMode&&!!e?.length}recreateColumnDefs(e){if(!this.cols)return;this.beans.autoColSvc?.updateColumns(e);const t=Ri(e.source);this.createColsFromColDefs(t)}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){Ha(this.beans,this.colDefCols?.tree),super.destroy()}getColTree(){return this.cols?.tree??[]}getColDefColTree(){return this.colDefCols?.tree??[]}getColDefCols(){return this.colDefCols?.list??null}getCols(){return this.cols?.list??[]}forAllCols(e){const{pivotResultCols:t,autoColSvc:s,selectionColSvc:o,groupHierarchyColSvc:i}=this.beans;Cn(this.colDefCols?.list,e),Cn(s?.columns?.list,e),Cn(o?.columns?.list,e),Cn(i?.columns?.list,e),Cn(t?.getPivotResultCols()?.list,e)}getColsForKeys(e){return e?e.map(t=>this.getCol(t)).filter(t=>t!=null):[]}getColDefCol(e){return this.colDefCols?.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return e==null?null:this.getColFromCollection(e,this.cols)}getColById(e){return this.cols?.map[e]??null}getColFromCollection(e,t){if(t==null)return null;const{map:s,list:o}=t;if(typeof e=="string"&&s[e])return s[e];for(let a=0;a<o.length;a++)if(On(o[a],e))return o[a];const{autoColSvc:i,selectionColSvc:n,groupHierarchyColSvc:r}=this.beans;return i?.getColumn(e)??n?.getColumn(e)??r?.getColumn(e)??null}},em=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let s;return typeof t!="number"?s=0:s=t+1,this.existingIds[e]=s,s}},$i=class extends O{};function lr(e,t,s){return s&&e.addDestroyFunc(()=>t.destroyBean(s)),s??e}var ve=null;function Jh(e){return typeof e?.getGui=="function"}var cr=class{constructor(e){this.cssClassStates={},this.getGui=e}toggleCss(e,t){if(!e)return;if(e.indexOf(" ")>=0){const o=(e||"").split(" ");if(o.length>1){for(const i of o)this.toggleCss(i,t);return}}this.cssClassStates[e]!==t&&e.length&&(this.getGui()?.classList.toggle(e,t),this.cssClassStates[e]=t)}},_y=0,dr=class extends xs{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=_y++,this.cssManager=new cr(()=>this.eGui),this.componentSelectors=new Map((t??[]).map(s=>[s.selector,s])),e&&this.setTemplate(e)}preConstruct(){this.wireTemplate(this.getGui());const e="component-"+Object.getPrototypeOf(this)?.constructor?.name;for(const t of this.css??[])this.beans.environment.addGlobalCSS(t,e)}wireTemplate(e,t){e&&this.gos&&(this.applyElementsToComponent(e),this.createChildComponentsFromTags(e,t))}getCompId(){return this.compId}getDataRefAttribute(e){return e.getAttribute?e.getAttribute(wf):null}applyElementsToComponent(e,t,s,o=null){if(t===void 0&&(t=this.getDataRefAttribute(e)),t){const i=this[t];if(i===ve)this[t]=o??e;else{const n=s?.[t];if(!this.suppressDataRefValidation&&!n)throw new Error(`data-ref: ${t} on ${this.constructor.name} with ${i}`)}}}createChildComponentsFromTags(e,t){const s=[];for(const o of e.childNodes??[])s.push(o);for(const o of s){if(!(o instanceof HTMLElement))continue;const i=this.createComponentFromElement(o,n=>{const r=n.getGui();if(r)for(const a of o.attributes??[])r.setAttribute(a.name,a.value)},t);if(i){if(i.addItems&&o.children.length){this.createChildComponentsFromTags(o,t);const n=Array.prototype.slice.call(o.children);i.addItems(n)}this.swapComponentForNode(i,e,o)}else o.childNodes&&this.createChildComponentsFromTags(o,t)}}createComponentFromElement(e,t,s){const o=e.nodeName,i=this.getDataRefAttribute(e),n=o.indexOf("AG-")===0,r=n?this.componentSelectors.get(o):null;let a=null;if(r){const l=s&&i?s[i]:void 0;a=new r.component(l),a.setParentComponent(this),this.createBean(a,null,t)}else if(n)throw new Error(`selector: ${o}`);return this.applyElementsToComponent(e,i,s,a),a}swapComponentForNode(e,t,s){const o=e.getGui();t.replaceChild(o,s),t.insertBefore(document.createComment(s.nodeName),o),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e){const t=this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui());for(const s of e)s.setAttribute("tabindex",t.toString())}setTemplate(e,t,s){let o;typeof e=="string"||e==null?o=au(e):o=ar(e),this.setTemplateFromElement(o,t,s)}setTemplateFromElement(e,t,s,o=!1){if(this.eGui=e,this.suppressDataRefValidation=o,t)for(let i=0;i<t.length;i++){const n=t[i];this.componentSelectors.set(n.selector,n)}this.wireTemplate(e,s)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}getContainerAndElement(e,t){let s=t;return e==null?null:(s||(s=this.eGui),du(e)?{element:e,parent:s}:{element:e.getGui(),parent:s})}prependChild(e,t){const{element:s,parent:o}=this.getContainerAndElement(e,t)||{};!s||!o||o.insertAdjacentElement("afterbegin",s)}appendChild(e,t){const{element:s,parent:o}=this.getContainerAndElement(e,t)||{};!s||!o||o.appendChild(s)}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:s}=t;RS(this.eGui,e,{skipAriaHidden:s})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:s}=t;Ye(this.eGui,e,{skipAriaHidden:s});const o={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(o)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),super.destroy()}addGuiEventListener(e,t,s){this.eGui.addEventListener(e,t,s),this.addDestroyFunc(()=>this.eGui.removeEventListener(e,t))}addCss(e){this.cssManager.toggleCss(e,!0)}removeCss(e){this.cssManager.toggleCss(e,!1)}toggleCss(e,t){this.cssManager.toggleCss(e,t)}registerCSS(e){this.css||(this.css=[]),this.css.push(e)}},Xe=class extends dr{};function tm(e){return typeof e=="object"&&!!e.component}function jy(e,t){return new Ae(s=>{s(window.setInterval(e,t))})}var Ae=class En{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(s=>this.onDone(s),s=>this.onReject(s))}static all(t){return t.length?new En(s=>{let o=t.length;const i=new Array(o);t.forEach((n,r)=>{n.then(a=>{i[r]=a,o--,o===0&&s(i)})})}):En.resolve()}static resolve(t=null){return new En(s=>s(t))}then(t){return new En(s=>{this.status===1?s(t(this.resolution)):this.waiters.push(o=>s(t(o)))})}onDone(t){this.status=1,this.resolution=t;for(const s of this.waiters)s(t)}onReject(t){}};function Uy(e){return e?e.prototype&&"getGui"in e.prototype:!1}function sm(e,t,s,o){const{name:i}=s;let n,r,a,l,c,d;if(t){const u=t,h=u[i+"Selector"],p=h?h(o):null,m=C=>{typeof C=="string"?n=C:C!=null&&C!==!0&&(e.isFrameworkComponent(C)?a=C:r=C)};p?(m(p.component),l=p.params,c=p.popup,d=p.popupPosition):m(u[i])}return{compName:n,jsComp:r,fwComp:a,paramsFromSelector:l,popupFromSelector:c,popupPositionFromSelector:d}}var $y=class extends O{constructor(){super(...arguments),this.beanName="userCompFactory"}wireBeans(e){this.agCompUtils=e.agCompUtils,this.registry=e.registry,this.frameworkCompWrapper=e.frameworkCompWrapper,this.gridOptions=e.gridOptions}getCompDetailsFromGridOptions(e,t,s,o=!1){return this.getCompDetails(this.gridOptions,e,t,s,o)}getCompDetails(e,t,s,o,i=!1){const{name:n,cellRenderer:r}=t;let{compName:a,jsComp:l,fwComp:c,paramsFromSelector:d,popupFromSelector:u,popupPositionFromSelector:h}=sm(this.beans.frameworkOverrides,e,t,o),p,m;const C=S=>{const x=this.registry.getUserComponent(n,S);x&&(l=x.componentFromFramework?void 0:x.component,c=x.componentFromFramework?x.component:void 0,p=x.params,m=x.processParams)};if(a!=null&&C(a),l==null&&c==null&&s!=null&&C(s),l&&r&&!Uy(l)&&(l=this.agCompUtils?.adaptFunction(t,l)),!l&&!c){const{validation:S}=this.beans;i&&(a!==s||!s)?a?S?.isProvidedUserComp(a)||He(50,{compName:a}):s?S||He(260,{...this.gos.getModuleErrorParams(),propName:n,compName:s}):He(216,{name:n}):s&&!S&&He(146,{comp:s});return}const v=this.mergeParams(e,t,o,d,p,m),w=l==null,b=l??c;return{componentFromFramework:w,componentClass:b,params:v,type:t,popupFromSelector:u,popupPositionFromSelector:h,newAgStackInstance:()=>this.newAgStackInstance(b,w,v,t)}}newAgStackInstance(e,t,s,o){const i=!t;let n;i?n=new e:n=this.frameworkCompWrapper.wrap(e,o.mandatoryMethods,o.optionalMethods,o),this.createBean(n);const r=n.init?.(s);return r==null?Ae.resolve(n):r.then(()=>n)}mergeParams(e,t,s,o=null,i,n){const r={...s,...i},l=e?.[t.name+"Params"];if(typeof l=="function"){const c=l(s);St(r,c)}else typeof l=="object"&&St(r,l);return St(r,o),n?n(r):r}},qy={name:"dateComponent",mandatoryMethods:["getDate","setDate"],optionalMethods:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","refresh"]},Ky={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},Yy={name:"headerComponent",optionalMethods:["refresh"]},Zy={name:"innerHeaderComponent"},Xy={name:"innerHeaderGroupComponent"},Qy={name:"headerGroupComponent"},Jy={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},ex={name:"loadingCellRenderer",cellRenderer:!0},tx={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},sx={name:"loadingOverlayComponent",optionalMethods:["refresh"]},ox={name:"noRowsOverlayComponent",optionalMethods:["refresh"]},ix={name:"tooltipComponent"},bu={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},nx={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},rx={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},ax={name:"loadingCellRenderer",cellRenderer:!0},lx={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},cx={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function dx(e,t){return e.getCompDetailsFromGridOptions(Ky,"agDragAndDropImage",t,!0)}function ux(e,t,s){return e.getCompDetails(t,Yy,"agColumnHeader",s)}function hx(e,t,s){return e.getCompDetails(t,Zy,void 0,s)}function gx(e,t){const s=t.columnGroup.getColGroupDef();return e.getCompDetails(s,Qy,"agColumnGroupHeader",t)}function px(e,t,s){return e.getCompDetails(t,Xy,void 0,s)}function fx(e,t){return e.getCompDetailsFromGridOptions(rx,void 0,t,!0)}function mx(e,t){return e.getCompDetailsFromGridOptions(ax,"agLoadingCellRenderer",t,!0)}function Cx(e,t){return e.getCompDetailsFromGridOptions(lx,"agGroupRowRenderer",t,!0)}function vx(e,t){return e.getCompDetailsFromGridOptions(cx,"agDetailCellRenderer",t,!0)}function eg(e,t,s){return e.getCompDetails(t,Jy,void 0,s)}function tg(e,t,s){return e.getCompDetails(t,ex,"agSkeletonCellRenderer",s,!0)}function om(e,t,s){return e.getCompDetails(t,tx,"agCellEditor",s,!0)}function wx(e,t,s,o){const i=t.filter;return tm(i)&&(t={filter:i.component,filterParams:t.filterParams}),e.getCompDetails(t,bu,o,s,!0)}function bx(e,t,s){return e.getCompDetails(t,qy,"agDateInput",s,!0)}function Sx(e,t){return e.getCompDetailsFromGridOptions(sx,"agLoadingOverlay",t,!0)}function yx(e,t){return e.getCompDetailsFromGridOptions(ox,"agNoRowsOverlay",t,!0)}function xx(e,t){return e.getCompDetails(t.colDef,ix,"agTooltipComponent",t,!0)}function Rx(e,t,s,o){return e.getCompDetails(t,nx,o,s)}function im(e,t){return sm(e,t,bu)}function cc(e,t,s){return e.mergeParams(t,bu,s)}function Xn(e){const t=e;return t?.getFrameworkComponentInstance!=null?t.getFrameworkComponentInstance():e}function Fx(e){return typeof e=="object"&&!!e.getComp}var I={BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",SPACE:" ",LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown",DELETE:"Delete",F2:"F2",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",PAGE_HOME:"Home",PAGE_END:"End",A:"KeyA",C:"KeyC",D:"KeyD",V:"KeyV",X:"KeyX",Y:"KeyY",Z:"KeyZ"},Su=class extends dr{isPopup(){return!0}setParentComponent(e){e.addCss("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e?.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},dc,uc,hc,gc,vd,wd,pc;function ao(){return dc===void 0&&(dc=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),dc}function nm(){return uc===void 0&&(uc=/(firefox)/i.test(navigator.userAgent)),uc}function rm(){return hc===void 0&&(hc=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),hc}function Eo(){return gc===void 0&&(gc=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),gc}function bd(e){if(!e)return null;const t=e.tabIndex,s=e.getAttribute("tabIndex");return t===-1&&(s===null||s===""&&!nm())?null:t.toString()}function Ex(){if(pc!==void 0)return pc;if(!document.body)return-1;let e=1e6;const t=nm()?6e6:1e9,s=document.createElement("div");for(document.body.appendChild(s);;){const o=e*2;if(s.style.height=o+"px",o>t||s.clientHeight!==o)break;e=o}return s.remove(),pc=e,e}function Dx(){return wd==null&&am(),wd}function am(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let s=t.offsetWidth-t.clientWidth;s===0&&t.clientWidth===0&&(s=null),t.parentNode&&t.remove(),s!=null&&(wd=s,vd=s===0)}function lm(){return vd==null&&am(),vd}var yu="T",Px=new RegExp(`[${yu} ]`),Tx=new RegExp(`^\\d{4}-\\d{2}-\\d{2}(${yu}\\d{2}:\\d{2}:\\d{2}\\D?)?`);function ms(e,t){return e.toString().padStart(t,"0")}function zt(e,t=!0,s=yu){if(!e)return null;let o=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(i=>ms(i,2)).join("-");return t&&(o+=s+[e.getHours(),e.getMinutes(),e.getSeconds()].map(i=>ms(i,2)).join(":")),o}function Kr(e,t=!0){return e?t?[String(e.getFullYear()),String(e.getMonth()+1),ms(e.getDate(),2),ms(e.getHours(),2),`:${ms(e.getMinutes(),2)}`,`:${ms(e.getSeconds(),2)}`]:[e.getFullYear(),e.getMonth()+1,ms(e.getDate(),2)].map(String):null}var fc=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"},sg=["January","February","March","April","May","June","July","August","September","October","November","December"],mc=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Sd(e,t){if(t==null)return zt(e,!1);const s=ms(e.getFullYear(),4),o={YYYY:()=>s.slice(s.length-4,s.length),YY:()=>s.slice(s.length-2,s.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>sg[e.getMonth()],MMM:()=>sg[e.getMonth()].slice(0,3),MM:()=>ms(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${fc(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${fc(e.getDate())}`,DD:()=>ms(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>mc[e.getDay()],ddd:()=>mc[e.getDay()].slice(0,3),dd:()=>mc[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${fc(e.getDay())}`,d:()=>`${e.getDay()}`},i=new RegExp(Object.keys(o).join("|"),"g");return t.replace(i,n=>n in o?o[n]():n)}function fa(e,t=!1){return!!It(e,t)}function Mx(e){return fa(e,!0)}function It(e,t=!1,s){if(!e||!s&&!Tx.test(e))return null;const[o,i]=e.split(Px);if(!o)return null;const n=o.split("-").map(p=>Number.parseInt(p,10));if(n.filter(p=>!isNaN(p)).length!==3)return null;const[r,a,l]=n,c=new Date(r,a-1,l);if(c.getFullYear()!==r||c.getMonth()!==a-1||c.getDate()!==l||!i&&t)return null;if(!i||i==="00:00:00")return c;const[d,u,h]=i.split(":").map(p=>Number.parseInt(p,10));if(d>=0&&d<24)c.setHours(d);else if(t)return null;if(u>=0&&u<60)c.setMinutes(u);else if(t)return null;if(h>=0&&h<60)c.setSeconds(h);else if(t)return null;return c}function yd(e){const{inputValue:t,allSuggestions:s,hideIrrelevant:o,filterByPercentageOfBestMatch:i}=e;let n=(s??[]).map((l,c)=>({value:l,relevance:Ix(t,l),idx:c}));if(n.sort((l,c)=>l.relevance-c.relevance),o&&(n=n.filter(l=>l.relevance<Math.max(l.value.length,t.length))),n.length>0&&i&&i>0){const c=n[0].relevance*i;n=n.filter(d=>c-d.relevance<0)}const r=[],a=[];for(const l of n)r.push(l.value),a.push(l.idx);return{values:r,indices:a}}function Ix(e,t){e.length<t.length&&([e,t]=[t,e]);let s=[],o=[];const i=e.length,n=t.length;for(let a=0;a<=n;a++)s[a]=a;let r=0;for(let a=1;a<=i;a++){o[0]=a;for(let l=1;l<=n;l++){const c=e[a-1],d=t[l-1];if(c.toLocaleLowerCase()===d.toLocaleLowerCase())++r,c===d&&++r,a>1&&l>1&&e[a-2].toLocaleLowerCase()===t[l-2].toLocaleLowerCase()&&(++r,e[a-2]===t[l-2]&&++r),a<i/2-10&&++r,o[l]=s[l-1];else{const u=o[l-1],h=s[l],p=s[l-1];o[l]=1+Math.min(u,h,p)}}[s,o]=[o,s]}return s[n]/(r+1)}function cm(e){return e.altKey||e.ctrlKey||e.metaKey?!1:e.key?.length===1}var xd=!1,Va=0;function kx(e){Va>0||(e.addEventListener("keydown",za),e.addEventListener("mousedown",za))}function Ax(e){Va>0||(e.removeEventListener("keydown",za),e.removeEventListener("mousedown",za))}function za(e){const t=xd,s=e.type==="keydown";s&&(e.ctrlKey||e.metaKey||e.altKey)||t!==s&&(xd=s)}function Lx(e){const t=dt(e);return kx(t),Va++,()=>{Va--,Ax(t)}}function Ox(){return xd}function Fi(e,t,s=!1){const o=xS;let i=pf;t&&(i+=", "+t),s&&(i+=', [tabindex="-1"]');const n=Array.prototype.slice.apply(e.querySelectorAll(o)).filter(l=>Hs(l)),r=Array.prototype.slice.apply(e.querySelectorAll(i));return r.length?((l,c)=>l.filter(d=>c.indexOf(d)===-1))(n,r):n}function Oo(e,t=!1,s=!1,o=!1){const i=Fi(e,o?".ag-tab-guard":null,s),n=t?Be(i):i[0];return n?(n.focus({preventScroll:!0}),!0):!1}function _o(e,t,s,o){const i=Fi(t,s?':not([tabindex="-1"])':null),n=Ze(e);let r;s?r=i.findIndex(l=>l.contains(n)):r=i.indexOf(n);const a=r+(o?-1:1);return a<0||a>=i.length?null:i[a]}function dm(e,t=5){let s=0;for(;e&&bd(e)===null&&++s<=t;)e=e.parentElement;return bd(e)===null?null:e}var Nx=".ag-label{white-space:nowrap}:where(.ag-ltr) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-label-align-right) .ag-label{order:1}:where(.ag-ltr) :where(.ag-label-align-right) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-label-align-right) .ag-label{margin-right:var(--ag-spacing)}.ag-label-align-right>*{flex:none}.ag-label-align-top{align-items:flex-start;flex-direction:column;>*{align-self:stretch}}.ag-label-ellipsis{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-label-align-top) .ag-label{margin-bottom:calc(var(--ag-spacing)*.5)}",Hx=class extends dr{constructor(e,t,s){super(t,s),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{},this.registerCSS(Nx)}postConstruct(){this.addCss("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:s,labelAlignment:o,disabled:i}=this.config;i!=null&&this.setDisabled(i),e!=null&&this.setLabelSeparator(e),t!=null&&this.setLabel(t),s!=null&&this.setLabelWidth(s),this.setLabelAlignment(o||this.labelAlignment),this.refreshLabel()}refreshLabel(){const{label:e,eLabel:t}=this;Mt(t),typeof e=="string"?t.innerText=e+this.labelSeparator:e&&t.appendChild(e),e===""?(Ye(t,!1),ko(t,"presentation")):(Ye(t,!0),ko(t,null))}setLabelSeparator(e){return this.labelSeparator===e?this:(this.labelSeparator=e,this.label!=null&&this.refreshLabel(),this)}getLabelId(){const e=this.eLabel;return e.id=e.id||`ag-${this.getCompId()}-label`,e.id}getLabel(){return this.label}setLabel(e){return this.label===e?this:(this.label=e,this.refreshLabel(),this)}setLabelAlignment(e){const s=this.getGui().classList;return s.toggle("ag-label-align-left",e==="left"),s.toggle("ag-label-align-right",e==="right"),s.toggle("ag-label-align-top",e==="top"),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return this.label==null?this:(Ma(this.eLabel,e),this)}setDisabled(e){e=!!e;const t=this.getGui();return $n(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},um=class extends Hx{constructor(e,t,s,o){super(e,t,s),this.className=o}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:s}=this.config;e!=null&&this.setWidth(e),t!=null&&this.setValue(t),s!=null&&this.onValueChange(s),this.className&&this.addCss(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),s=this.getLabel();s==null||s==""||lS(e)!==null?Un(e,""):Un(e,t??"")}setAriaLabel(e){return Ai(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return vs(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e?this:(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"}),this)}};function Gx(e){return{tag:"div",role:"presentation",children:[{tag:"div",ref:"eLabel",cls:"ag-input-field-label"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-input-wrapper",role:"presentation",children:[{tag:e,ref:"eInput",cls:"ag-input-field-input"}]}]}}var wo=class extends um{constructor(e,t,s="text",o="input"){super(e,e?.template??Gx(o),[],t),this.inputType=s,this.displayFieldTag=o,this.eLabel=ve,this.eWrapper=ve,this.eInput=ve}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);const{eLabel:e,eWrapper:t,eInput:s,className:o}=this;e.classList.add(`${o}-label`),t.classList.add(`${o}-input-wrapper`),s.classList.add(`${o}-input`),this.addCss("ag-input-field"),s.id=s.id||`ag-${this.getCompId()}-input`;const{inputName:i,inputWidth:n}=this.config;i!=null&&this.setInputName(i),n!=null&&this.setInputWidth(n),this.addInputListeners(),this.activateTabIndex([s])}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(e){this.displayFieldTag==="input"&&(this.inputType=e,Bt(this.eInput,"type",e))}getInputElement(){return this.eInput}setInputWidth(e){return Ma(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){const t=this.eInput;return t.maxLength=e,this}setInputPlaceholder(e){return Bt(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return Ai(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return $n(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)Bt(this.eInput,"autocomplete",null);else{const t=typeof e=="string"?e:"off";Bt(this.eInput,"autocomplete",t)}return this}},xu=class extends wo{constructor(e,t="ag-checkbox",s="checkbox"){super(e,t,s),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;typeof e=="boolean"&&this.setReadOnly(e),typeof t=="boolean"&&this.setPassive(t)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return this.selected===void 0?!0:!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){const t=this.getInputElement();return t.name=e,this}isSelected(){return this.selected}setSelected(e,t){if(this.isSelected()===e)return;this.previousValue=this.isSelected(),e=this.selected=typeof e=="boolean"?e:void 0;const s=this.eInput;s.checked=e,s.indeterminate=e===void 0,t||this.dispatchChange(this.selected,this.previousValue)}dispatchChange(e,t,s){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:s});const o=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:o.id,name:o.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),s=this.selected=e.target.checked;this.refreshSelectedClass(s),this.dispatchChange(s,t,e)}refreshSelectedClass(e){const t=this.eWrapper.classList;t.toggle("ag-checked",e===!0),t.toggle("ag-indeterminate",e==null)}},Ru={selector:"AG-CHECKBOX",component:xu},Bx=class extends xu{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedEventListeners({checkboxChanged:this.onChange.bind(this)})}onChange(e){const t=this.eInput;e.selected&&e.name&&t.name&&t.name===e.name&&e.id&&t.id!==e.id&&this.setValue(!1,!0)}},jo=class extends wo{constructor(e,t="ag-text-field",s="text"){super(e,t,s)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){const s=this.eInput;return s.value!==e&&(s.value=X(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`),t=s=>{cm(s)&&s.key&&!e.test(s.key)&&s.preventDefault()};this.addManagedListeners(this.eInput,{keydown:t,paste:s=>{s.clipboardData?.getData("text")?.split("").some(i=>!e.test(i))&&s.preventDefault()}})}},ul={selector:"AG-INPUT-TEXT-FIELD",component:jo},Vx=class extends wo{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const s=super.setValue(e,t);return this.eInput.value=e,s}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},zx={selector:"AG-INPUT-TEXT-AREA",component:Vx},Fu=class extends jo{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct();const e=this.eInput;this.addManagedListeners(e,{blur:()=>{const n=Number.parseFloat(e.value),r=isNaN(n)?"":this.normalizeValue(n.toString());this.value!==r&&this.setValue(r)},wheel:this.onWheel.bind(this)}),e.step="any";const{precision:t,min:s,max:o,step:i}=this.config;typeof t=="number"&&this.setPrecision(t),typeof s=="number"&&this.setMin(s),typeof o=="number"&&this.setMax(o),typeof i=="number"&&this.setStep(i)}onWheel(e){Ze(this.beans)===this.eInput&&e.preventDefault()}normalizeValue(e){return e===""?"":(this.precision!=null&&(e=this.adjustPrecision(e)),e)}adjustPrecision(e,t){const s=this.precision;if(s==null)return e;if(t){const i=Number.parseFloat(e).toFixed(s);return Number.parseFloat(i).toString()}const o=String(e).split(".");if(o.length>1){if(o[1].length<=s)return e;if(s>0)return`${o[0]}.${o[1].slice(0,s)}`}return o[0]}setMin(e){return this.min===e?this:(this.min=e,Bt(this.eInput,"min",e),this)}setMax(e){return this.max===e?this:(this.max=e,Bt(this.eInput,"max",e),this)}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e?this:(this.step=e,Bt(this.eInput,"step",e),this)}setValue(e,t){return this.setValueOrInputValue(s=>super.setValue(s,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(t=>super.setValue(t,!0),t=>{this.eInput.value=t},e)}setValueOrInputValue(e,t,s){if(X(s)){let o=this.isScientificNotation(s);if(o&&this.eInput.validity.valid)return e(s);if(!o){s=this.adjustPrecision(s);const i=this.normalizeValue(s);o=s!=i}if(o)return t(s)}return e(s)}getValue(){const e=this.eInput;if(!e.validity.valid)return;const t=e.value;return this.isScientificNotation(t)?this.adjustPrecision(t,!0):super.getValue()}isScientificNotation(e){return typeof e=="string"&&e.includes("e")}},Wx={selector:"AG-INPUT-NUMBER-FIELD",component:Fu},_x=class extends jo{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct();const e=ao();this.addManagedListeners(this.eInput,{wheel:this.onWheel.bind(this),mousedown:()=>{this.isDisabled()||e||this.eInput.focus()}}),this.eInput.step="any"}onWheel(e){Ze(this.beans)===this.eInput&&e.preventDefault()}setMin(e){const t=e instanceof Date?zt(e??null,!!this.includeTime)??void 0:e;return this.min===t?this:(this.min=t,Bt(this.eInput,"min",t),this)}setMax(e){const t=e instanceof Date?zt(e??null,!!this.includeTime)??void 0:e;return this.max===t?this:(this.max=t,Bt(this.eInput,"max",t),this)}setStep(e){return this.step===e?this:(this.step=e,Bt(this.eInput,"step",e),this)}setIncludeTime(e){return this.includeTime===e?this:(this.includeTime=e,super.setInputType(e?"datetime-local":"date"),e&&this.setStep(1),this)}getDate(){if(this.eInput.validity.valid)return It(this.getValue())??void 0}setDate(e,t){this.setValue(zt(e??null,this.includeTime),t)}},hm={selector:"AG-INPUT-DATE-FIELD",component:_x},jx=".ag-list-item{align-items:center;display:flex;height:var(--ag-list-item-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&.ag-active-item{background-color:var(--ag-row-hover-color)}}",Ux="ag-active-item",$x=(e,t)=>({tag:"div",cls:`ag-list-item ag-${e}-list-item`,attrs:{role:"option"},children:[{tag:"span",ref:"eText",children:t}]}),qx=class extends dr{constructor(e,t,s){super($x(e,t)),this.label=t,this.value=s,this.eText=ve}postConstruct(){this.createTooltip(),this.addEventListeners()}setHighlighted(e){const t=this.getGui();t.classList.toggle(Ux,e),gf(t,e),this.dispatchLocalEvent({type:"itemHighlighted",highlighted:e})}getHeight(){return this.getGui().clientHeight}setIndex(e,t){const s=this.getGui();pS(s,e),gS(s,t)}createTooltip(){const e={getTooltipValue:()=>this.label,getGui:()=>this.getGui(),getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>lu(this.eText)},t=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("highlightTooltipFeature",!1,e,this));t&&(this.tooltipFeature=t)}addEventListeners(){const e=this.getParentComponent();e&&(this.addGuiEventListener("mouseover",()=>{e.highlightItem(this)}),this.addGuiEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),e.setValue(this.value)}))}},Kx=class extends dr{constructor(e="default"){super({tag:"div",cls:`ag-list ag-${e}-list`}),this.cssIdentifier=e,this.options=[],this.listItems=[],this.highlightedItem=null,this.registerCSS(jx)}postConstruct(){const e=this.getGui();this.addManagedElementListeners(e,{mouseleave:()=>this.clearHighlighted()})}handleKeyDown(e){const t=e.key;switch(t){case I.ENTER:if(!this.highlightedItem)this.setValue(this.getValue());else{const s=this.listItems.indexOf(this.highlightedItem);this.setValueByIndex(s)}break;case I.DOWN:case I.UP:e.preventDefault(),this.navigate(t);break;case I.PAGE_DOWN:case I.PAGE_UP:case I.PAGE_HOME:case I.PAGE_END:e.preventDefault(),this.navigateToPage(t);break}}addOptions(e){for(const t of e)this.addOption(t);return this}addOption(e){const{value:t,text:s}=e,o=s??t;return this.options.push({value:t,text:o}),this.renderOption(t,o),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0);for(const e of this.listItems)e.destroy();Mt(this.getGui()),this.listItems=[],this.refreshAriaRole()}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(e==null)return this.reset(t),this;const s=this.options.findIndex(o=>o.value===e);if(s!==-1){const o=this.options[s];this.value=o.value,this.displayValue=o.text,this.highlightItem(this.listItems[s]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex(t=>t.value===this.value);e!==-1&&this.highlightItem(this.listItems[e])}highlightItem(e){const t=e.getGui();if(!Hs(t))return;this.clearHighlighted(),e.setHighlighted(!0),this.highlightedItem=e;const s=this.getGui(),{scrollTop:o,clientHeight:i}=s,{offsetTop:n,offsetHeight:r}=t;(n+r>o+i||n<o)&&t.scrollIntoView({block:"nearest"})}hideItemTooltip(){this.highlightedItem?.tooltipFeature?.attemptToHideTooltip()}destroy(){this.hideItemTooltip(),super.destroy()}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}clearHighlighted(){this.highlightedItem?.setHighlighted(!1),this.highlightedItem=null}renderOption(e,t){const s=new qx(this.cssIdentifier,t,e);s.setParentComponent(this);const o=this.createManagedBean(s);this.listItems.push(o),this.getGui().appendChild(o.getGui())}navigate(e){const t=e===I.DOWN;let s;const{listItems:o,highlightedItem:i}=this;if(!i)s=t?o[0]:Be(o);else{let r=o.indexOf(i)+(t?1:-1);r=Math.min(Math.max(r,0),o.length-1),s=o[r]}this.highlightItem(s)}navigateToPage(e){const{listItems:t,highlightedItem:s}=this;if(!s||t.length===0)return;const o=t.indexOf(s),i=this.options.length-1,n=t[0].getHeight(),r=Math.floor(this.getGui().clientHeight/n);let a=-1;e===I.PAGE_HOME?a=0:e===I.PAGE_END?a=i:e===I.PAGE_DOWN?a=Math.min(o+r,i):e===I.PAGE_UP&&(a=Math.max(o-r,0)),a!==-1&&this.highlightItem(t[a])}refreshAriaRole(){ko(this.getGui(),this.options.length===0?"presentation":"listbox")}updateIndices(){this.refreshAriaRole();const e=this.listItems,t=e.length;e.forEach((s,o)=>{s.setIndex(o+1,t)})}fireChangeEvent(){this.dispatchLocalEvent({type:"fieldValueChanged"}),this.fireItemSelected()}fireItemSelected(){this.dispatchLocalEvent({type:"selectedItem"})}},Yx=".ag-picker-field-display{flex:1 1 auto}.ag-picker-field{align-items:center;display:flex}.ag-picker-field-icon{border:0;cursor:pointer;display:flex;margin:0;padding:0}.ag-picker-field-wrapper{background-color:var(--ag-picker-button-background-color);border:var(--ag-picker-button-border);border-radius:5px;min-height:max(var(--ag-list-item-height),calc(var(--ag-spacing)*4));overflow:hidden;&:where(.ag-picker-has-focus),&:where(:focus-within){background-color:var(--ag-picker-button-focus-background-color);border:var(--ag-picker-button-focus-border);box-shadow:var(--ag-focus-shadow);&:where(.invalid){box-shadow:var(--ag-focus-error-shadow)}}&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&:disabled{opacity:.5}}",Zx={tag:"div",cls:"ag-picker-field",role:"presentation",children:[{tag:"div",ref:"eLabel"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-picker-field-wrapper ag-picker-collapsed",children:[{tag:"div",ref:"eDisplayField",cls:"ag-picker-field-display"},{tag:"div",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},Xx=class extends um{constructor(e){if(super(e,e?.template||Zx,e?.agComponents||[],e?.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=ve,this.eWrapper=ve,this.eDisplayField=ve,this.eIcon=ve,this.registerCSS(Yx),this.ariaRole=e?.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:s,variableWidth:o,minPickerWidth:i,maxPickerWidth:n}=e;t!=null&&(this.pickerGap=t),this.variableWidth=!!o,s!=null&&this.setPickerMaxHeight(s),i!=null&&this.setPickerMinWidth(i),n!=null&&this.setPickerMaxWidth(n)}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedElementListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedElementListeners(this.eLabel,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)}),this.addManagedElementListeners(this.eWrapper,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)});const{pickerIcon:s,inputWidth:o}=this.config;if(s){const i=this.beans.iconSvc.createIconNoSpan(s);i&&this.eIcon.appendChild(i)}o!=null&&this.setInputWidth(o)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),dd(e,!1),this.ariaRole&&ko(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&e?.target===t)return;e.preventDefault(),this.getFocusableElement().focus()}if(this.skipClick){this.skipClick=!1;return}this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case I.UP:case I.DOWN:case I.ENTER:case I.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case I.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker());break}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||([this.destroyMouseWheelFunc]=this.addManagedEventListeners({bodyScroll:()=>{this.hidePicker()}}));const t=this.getLocaleTextFunc(),{config:{pickerAriaLabelKey:s,pickerAriaLabelValue:o,modalPicker:i=!0},maxPickerHeight:n,minPickerWidth:r,maxPickerWidth:a,variableWidth:l,beans:c,eWrapper:d}=this,u={modal:i,eChild:e,closeOnEsc:!0,closedCallback:()=>{const C=nf(c);this.beforeHidePicker(),C&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:t(s,o),anchorToElement:d};e.style.position="absolute";const h=c.popupSvc,p=h.addPopup(u);l?(r&&(e.style.minWidth=r),e.style.width=cu(Da(d)),a&&(e.style.maxWidth=a)):Ma(e,a??Da(d));const m=n??`${ru(h.getPopupParent())}px`;return e.style.setProperty("max-height",m),this.alignPickerToComponent(),p.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerGap:e,config:{pickerType:t},beans:{popupSvc:s,gos:o},eWrapper:i,pickerComponent:n}=this,r=o.get("enableRtl")?"right":"left";s.positionPopupByComponent({type:t,eventSource:i,ePopup:n.getGui(),position:"under",alignSide:r,keepWithinBounds:!0,nudgeY:e})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;const t=this.getAriaElement();dd(t,e);const s=this.eWrapper.classList;s.toggle("ag-picker-expanded",e),s.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){this.pickerComponent?.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&(this.hideCurrentPicker(),this.dispatchLocalEvent({type:"pickerHidden"}))}setInputWidth(e){return Ma(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return typeof e=="number"&&(e=`${e}px`),this.minPickerWidth=e??void 0,this}setPickerMaxWidth(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerWidth=e??void 0,this}setPickerMaxHeight(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerHeight=e??void 0,this}destroy(){this.hidePicker(),super.destroy()}},Qx=".ag-select{align-items:center;display:flex;&.ag-disabled{opacity:.5}}:where(.ag-select){.ag-picker-field-wrapper{cursor:default}&.ag-disabled .ag-picker-field-wrapper:focus{box-shadow:none}&:not(.ag-cell-editor,.ag-label-align-top){min-height:var(--ag-list-item-height)}.ag-picker-field-display{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-picker-field-icon{align-items:center;display:flex}}:where(.ag-ltr) :where(.ag-select){.ag-picker-field-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding)/2);padding-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-select){.ag-picker-field-wrapper{padding-left:var(--ag-spacing);padding-right:calc(var(--ag-cell-horizontal-padding)/2)}}.ag-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);overflow:hidden auto}.ag-select-list-item{cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;:where(span){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}:where(.ag-ltr) .ag-select-list-item{padding-left:calc(var(--ag-cell-horizontal-padding)/2)}:where(.ag-rtl) .ag-select-list-item{padding-right:calc(var(--ag-cell-horizontal-padding)/2)}",Eu=class extends Xx{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"selectOpen",ariaRole:"combobox",...e}),this.registerCSS(Qx)}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{shouldDisplayTooltip:ca(()=>this.eDisplayField),getGui:()=>this.getGui()})),super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:s}=this.config;e!=null&&this.addOptions(e),t!=null&&this.setValue(t,!0),s&&t==null&&(this.eDisplayField.textContent=s),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){const e=this.createBean(new Kx("select"));this.listComponent=e,e.setParentComponent(this);const t=e.getAriaElement(),s=`ag-select-list-${e.getCompId()}`;t.setAttribute("id",s),yS(this.getAriaElement(),t),e.addManagedElementListeners(e.getGui(),{mousedown:o=>{o?.preventDefault()}}),e.addManagedListeners(e,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem"})},fieldValueChanged:()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}})}createPickerComponent(){return this.listComponent}beforeHidePicker(){this.listComponent?.hideItemTooltip(),super.beforeHidePicker()}onKeyDown(e){const{key:t}=e;switch(t===I.TAB&&this.hidePicker(),t){case I.ENTER:case I.UP:case I.DOWN:case I.PAGE_UP:case I.PAGE_DOWN:case I.PAGE_HOME:case I.PAGE_END:e.preventDefault(),this.isPickerDisplayed?this.listComponent?.handleKeyDown(e):super.onKeyDown(e);break;case I.ESCAPE:super.onKeyDown(e);break;case I.SPACE:this.isPickerDisplayed?e.preventDefault():super.onKeyDown(e);break}}showPicker(){const e=this.listComponent;e&&(super.showPicker(),e.refreshHighlighted())}addOptions(e){for(const t of e)this.addOption(t);return this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){return this.listComponent?.clearOptions(),this.setValue(void 0,!0),this}setValue(e,t,s){const{listComponent:o,config:{placeholder:i},eDisplayField:n,tooltipFeature:r}=this;if(this.value===e||!o)return this;if(s||o.setValue(e,!0),o.getValue()===this.getValue())return this;let l=o.getDisplayValue();return l==null&&i&&(l=i),n.textContent=l,r?.setTooltipAndRefresh(l??null),super.setValue(e,t)}destroy(){this.listComponent=this.destroyBean(this.listComponent),super.destroy()}},Jx={selector:"AG-SELECT",component:Eu},eR=':where(.ag-root-wrapper,.ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart),:where(.ag-root-wrapper,.ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart) :where([class^=ag-]){box-sizing:border-box;&:after,&:before{box-sizing:border-box}&:where(div,span,label):focus-visible{box-shadow:inset var(--ag-focus-shadow);outline:none;&:where(.invalid){box-shadow:inset var(--ag-focus-error-shadow)}}&:where(button){color:inherit}}:where(.ag-root-wrapper,ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart) :where([class^=ag-]) ::-ms-clear{display:none}.ag-hidden{display:none!important}.ag-invisible{visibility:hidden!important}.ag-popup-child{top:0;z-index:5;&:where(:not(.ag-tooltip-custom)){box-shadow:var(--ag-popup-shadow)}}.ag-input-wrapper,.ag-picker-field-wrapper{align-items:center;display:flex;flex:1 1 auto;line-height:normal;position:relative}.ag-input-field{align-items:center;display:flex;flex-direction:row}.ag-input-field-input:where(:not([type=checkbox],[type=radio])){flex:1 1 auto;min-width:0;width:100%}.ag-chart,.ag-dnd-ghost,.ag-external,.ag-popup,.ag-root-wrapper{cursor:default;line-height:normal;white-space:normal;-webkit-font-smoothing:antialiased;background-color:var(--ag-background-color);color:var(--ag-text-color);color-scheme:var(--ag-browser-color-scheme);font-family:var(--ag-font-family);font-size:var(--ag-font-size);--ag-indentation-level:0}:where(.ag-icon):before{align-items:center;background-color:currentcolor;color:inherit;content:"";display:flex;font-family:inherit;font-size:var(--ag-icon-size);font-style:normal;font-variant:normal;height:var(--ag-icon-size);justify-content:center;line-height:var(--ag-icon-size);-webkit-mask-size:contain;mask-size:contain;text-transform:none;width:var(--ag-icon-size)}.ag-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;color:var(--ag-icon-color);display:block;height:var(--ag-icon-size);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-icon-size)}.ag-disabled,[disabled]{.ag-icon{opacity:.5}&.ag-icon-grip{opacity:.35}}.ag-resizer{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}:where(.ag-resizer){&.ag-resizer-topLeft{cursor:nwse-resize;height:5px;left:0;top:0;width:5px}&.ag-resizer-top{cursor:ns-resize;height:5px;left:5px;right:5px;top:0}&.ag-resizer-topRight{cursor:nesw-resize;height:5px;right:0;top:0;width:5px}&.ag-resizer-right{bottom:5px;cursor:ew-resize;right:0;top:5px;width:5px}&.ag-resizer-bottomRight{bottom:0;cursor:nwse-resize;height:5px;right:0;width:5px}&.ag-resizer-bottom{bottom:0;cursor:ns-resize;height:5px;left:5px;right:5px}&.ag-resizer-bottomLeft{bottom:0;cursor:nesw-resize;height:5px;left:0;width:5px}&.ag-resizer-left{bottom:5px;cursor:ew-resize;left:0;top:5px;width:5px}}',Du=typeof window!="object"||!window?.document?.fonts?.forEach,Ni=(e,t,s,o,i,n)=>{if(Du)return;o&&(e=`@layer ${CSS.escape(o)} { ${e} }`);let r=Ei.map.get(t);if(r||(r=[],Ei.map.set(t,r)),r.some(d=>d.css===e))return;const a=document.createElement("style");n&&a.setAttribute("nonce",n),a.dataset.agGlobalCss=s,a.textContent=e;const l={css:e,el:a,priority:i};let c;for(const d of r){if(d.priority>i)break;c=d}if(c){c.el.insertAdjacentElement("afterend",a);const d=r.indexOf(c);r.splice(d+1,0,l)}else t.insertBefore(a,t.querySelector(":not(title, meta)")),r.push(l)},gm=(e,t,s,o)=>{Ni(eR,e,"shared",t,0,s),o?.forEach((i,n)=>i.forEach(r=>Ni(r,e,n,t,0,s)))},tR=e=>{Ei.grids.add(e)},sR=e=>{if(Ei.grids.delete(e),Ei.grids.size===0){Ei.map=new WeakMap;for(const t of document.head.querySelectorAll("style[data-ag-global-css]"))t.remove()}},og,Ei=(og=typeof window=="object"?window:{}).agStyleInjectionState??(og.agStyleInjectionState={map:new WeakMap,grids:new Set}),xt=e=>new pm(e),Ys="$default",oR=0,pm=class{constructor({feature:e,params:t,modeParams:s={},css:o,cssImports:i}){this.feature=e,this.css=o,this.cssImports=i,this.modeParams={[Ys]:{...s[Ys]??{},...t??{}},...s}}use(e,t,s){let o=this._inject;if(o==null){let{css:i}=this;if(i){const n=`ag-theme-${this.feature??"part"}-${++oR}`;typeof i=="function"&&(i=i()),i=`:where(.${n}) {
4
4
  ${i}
@@ -58,7 +58,7 @@ See ${Lf(e,t)}`;return Array.isArray(o)?o.concat(n):[o,n]}var d4={1:"Charting Ag
58
58
  `)}checkProperties(e,t,s,o,i){const n=["__ob__","__v_skip","__metadata__"],r=I4(Object.getOwnPropertyNames(e),[...n,...t,...s],s),a=Object.keys(r);for(const l of a){const c=r[l];let d=`invalid ${o} property '${l}' did you mean any of these: ${c.slice(0,8).join(", ")}.`;s.includes("context")&&(d+=`
59
59
  If you are trying to annotate ${o} with application data, use the '${o}.context' property instead.`),Ln(d)}if(a.length>0&&i){const l=this.beans.frameworkOverrides.getDocLink(i);Ln(`to see all the valid ${o} properties please check: ${l}`)}}};function I4(e,t,s){const o={},i=e.filter(n=>!t.some(r=>r===n));if(i.length>0)for(const n of i)o[n]=yd({inputValue:n,allSuggestions:s}).values;return o}var k4=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),A4={moduleName:"Validation",version:Z,beans:[M4]};function AC(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var L4=class extends O{constructor(){super(...arguments),this.beanName="filterStage",this.step="filter",this.refreshProps=["excludeChildrenWhenTreeDataFiltering"]}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){const t=!!this.filterManager?.isChildFilterPresent();this.filterNodes(t,e)}filterNodes(e,t){const s=(o,i)=>{o.hasChildren()&&e&&!i?o.childrenAfterFilter=o.childrenAfterGroup.filter(n=>{const r=n.childrenAfterFilter&&n.childrenAfterFilter.length>0,a=n.data&&this.filterManager.doesRowPassFilter({rowNode:n});return r||a}):o.childrenAfterFilter=o.childrenAfterGroup,AC(o)};if(this.doingTreeDataFiltering()){const o=(n,r)=>{if(n.childrenAfterGroup)for(let a=0;a<n.childrenAfterGroup.length;a++){const l=n.childrenAfterGroup[a],c=r||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?o(n.childrenAfterGroup[a],c):s(l,c)}s(n,r)},i=n=>o(n,!1);t.executeFromRootNode(i)}else{const o=i=>s(i,!1);t.forEachChangedNodeDepthFirst(o,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},O4=class extends Gu{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,s,o,i){this.comp=e;const n=lr(this,this.beans.context,i);this.eButtonShowMainFilter=s,this.eFloatingFilterBody=o,this.setGui(t,n),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(n),this.setupLeft(n),this.setupHover(n),this.setupFocus(n),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(n),this.setupUi(),n.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(n);const r=()=>this.onColDefChanged(n);n.addManagedListeners(this.column,{colDefChanged:r}),n.addManagedEventListeners({filterSwitched:({column:a})=>{a===this.column&&r()}}),n.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,s=e.colDef;return we(t.gos,{colDef:s,column:e,floatingFilter:!0})}setupActive(){const e=this.column.getColDef(),t=!!e.filter,s=!!e.floatingFilter;this.active=t&&s}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=Jt("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new qi(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.getLocaleTextFunc();Ai(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){const{beans:t}=this;if(Ze(t)===this.eGui)return;const i=_o(t,this.eGui,null,e.shiftKey);if(i){t.headerNavigation?.scrollToColumn(this.column),e.preventDefault(),i.focus();return}const n=this.findNextColumnWithFloatingFilter(e.shiftKey);n&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:n},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let s=this.column;do if(s=e?t.getColBefore(s):t.getColAfter(s),!s)break;while(!s.getColDef().filter||!s.getColDef().floatingFilter);return s}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case I.UP:case I.DOWN:case I.LEFT:case I.RIGHT:if(t)return;No(e);case I.ENTER:t&&Oo(this.eGui)&&e.preventDefault();break;case I.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const s=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),o=!!e.relatedTarget&&yo(e.relatedTarget,"ag-floating-filter");if(s&&o&&e.target===this.eGui){const i=this.lastFocusEvent,n=!!(i&&i.key===I.TAB);if(i&&n){const r=i.shiftKey;Oo(this.eGui,r)}}this.focusThis()}setupHover(e){this.beans.colHover?.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new Hu(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){this.suppressFilterButton=!this.beans.menuSvc?.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!Vt(this.gos)}setupUserComp(){if(!this.active)return;const e=this.beans.colFilter?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.beans.menuSvc?.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:s,gos:o}=this,i=n=>{if(n?.source==="filterDestroyed"&&(!this.isAlive()||!t?.isAlive()))return;const r=this.comp.getFloatingFilterComp();r&&r.then(a=>{if(a){if(o.get("enableFilterHandlers")){const d=n;let u="filter";d?.afterFloatingFilter?u="ui":d?.afterDataChange?u="dataChanged":n?.source==="api"&&(u="api"),this.updateFloatingFilterParams(this.userCompDetails,u);return}const l=t?.getCurrentFloatingFilterParentModel(s),c=n?{...n,columns:n.columns??[],source:n.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,c)}})};[this.destroySyncListener]=e.addManagedListeners(s,{filterChanged:i}),t?.isFilterActive(s)&&i(null)}setupWidth(e){const t=()=>{const s=`${this.column.getActualWidth()}px`;this.comp.setWidth(s)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupFilterChangedListener(e){this.active&&([this.destroyFilterChangedListener]=e.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){const e=!!this.beans.filterManager?.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){const t=this.active;this.setupActive();const s=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const o=this.beans.colFilter,i=this.active?o?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,n=this.comp.getFloatingFilterComp();!n||!i?this.updateCompDetails(e,i,s):n.then(r=>{!r||o?.areFilterCompsDifferent(this.userCompDetails??null,i)?this.updateCompDetails(e,i,s):this.updateFloatingFilterParams(i,"colDef")})}updateCompDetails(e,t,s){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),s&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){if(!e)return;let s=e.params;this.comp.getFloatingFilterComp()?.then(o=>{typeof o?.refresh=="function"&&(this.gos.get("enableFilterHandlers")&&(s={...s,model:ct(this.beans.colFilter?.model??{},this.column.getColId()),source:t}),o.refresh(s))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function N4(e,t){const s=e.colModel.getCol(t);if(!s){He(12,{colKey:t});return}e.menuSvc?.showColumnMenu({column:s,positionBy:"auto"})}function H4(e){e.menuSvc?.hidePopupMenu()}var G4={moduleName:"SharedMenu",version:Z,beans:[nF],apiFunctions:{showColumnMenu:N4,hidePopupMenu:H4}},B4=class extends LR{postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getDefaultPopupParent(){return this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:s,event:o}=e,i=t.getBoundingClientRect(),n=this.getParentRect();this.setAlignedTo(t,s);let r=!1;const a=()=>{const l=this.keepXYWithinBounds(s,i.top-n.top,0),c=s.clientWidth>0?s.clientWidth:200;r||(s.style.minWidth=`${c}px`,r=!0);const u=n.right-n.left-c;let h;return this.gos.get("enableRtl")?(h=m(),h<0&&(h=p(),this.setAlignedStyles(s,"left")),h>u&&(h=0,this.setAlignedStyles(s,"right"))):(h=p(),h>u&&(h=m(),this.setAlignedStyles(s,"right")),h<0&&(h=0,this.setAlignedStyles(s,"left"))),{x:h,y:l};function p(){return i.right-n.left-2}function m(){return i.left-n.left-c}};this.positionPopup({ePopup:s,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e,"subMenu",s,t,o instanceof MouseEvent?o:void 0)})}callPostProcessPopup(e,t,s,o,i){const n=this.gos.getCallback("postProcessPopup");if(n){const{column:r,rowNode:a}=e;n({column:r,rowNode:a,ePopup:s,type:t,eventSource:o,mouseEvent:i})}}getActivePopups(){return this.popupList.map(e=>e.element)}handleThemeChange(e){if(e.themeChanged){const t=this.beans.environment;for(const s of this.popupList)t.applyThemeClasses(s.wrapper)}}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return Os(e)}},Cl={moduleName:"Popup",version:Z,beans:[B4]},V4=".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;>*{cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper,:where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}:where(.ag-floating-filter-full-body)>div{flex:1 1 auto}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>*{flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));&>*{margin-bottom:var(--ag-widget-vertical-spacing)}:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}";function z4(e){const t=e.filterManager;return!!t?.isColumnFilterPresent()||!!t?.isAggregateFilterPresent()}function W4(e,t){return e.filterManager?.getColumnFilterInstance(t)??Promise.resolve(void 0)}function _4(e,t){const s=e.colModel.getColDefCol(t);if(s)return e.colFilter?.destroyFilter(s,"api")}function j4(e,t){e.frameworkOverrides.wrapIncoming(()=>e.filterManager?.setFilterModel(t))}function U4(e){return e.filterManager?.getFilterModel()??{}}function $4(e,t,s){const{gos:o,colModel:i,colFilter:n}=e;s&&!o.get("enableFilterHandlers")&&(z(288),s=!1);const r=i.getColDefCol(t);return r?n?.getModelForColumn(r,s)??null:null}function q4(e,t,s){return e.filterManager?.setColumnFilterModel(t,s)??Promise.resolve()}function K4(e,t){const s=e.colModel.getCol(t);if(!s){He(12,{colKey:t});return}e.menuSvc?.showFilterMenu({column:s,containerType:"columnFilter",positionBy:"auto"})}function Y4(e){e.menuSvc?.hideFilterMenu()}function Z4(e,t){const s=e.colModel.getCol(t);if(!s){He(12,{colKey:t});return}return e.colFilter?.getHandler(s,!0)}function X4(e,t){const{colModel:s,colFilter:o,gos:i}=e;if(!i.get("enableFilterHandlers")){z(287);return}const{colId:n,action:r}=t;if(n){const a=s.getColById(n);a&&o?.updateModel(a,r)}else o?.updateAllModels(r)}var Q4={filterHandler:()=>({doesFilterPass:()=>!0})},J4=class extends O{constructor(){super(...arguments),this.beanName="colFilter",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.modelUpdates=[],this.columnModelUpdates=[],this.state=new Map,this.handlerMap={...Em},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)});const e=this.gos,t={...e.get("initialState")?.filter?.filterModel??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",s){const{colModel:o,dataTypeSvc:i,filterManager:n}=this.beans;if(i?.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const r=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((c,d)=>{const u=e[d];r.push(this.setModelOnFilterWrapper(c,u)),l.delete(d)}),l.forEach(c=>{const d=o.getColDefCol(c)||o.getCol(c);if(!d){z(62,{colId:c});return}if(!d.isFilterAllowed()){z(63,{colId:c});return}const u=this.getOrCreateFilterWrapper(d,!0);if(!u){z(64,{colId:c});return}r.push(this.setModelOnFilterWrapper(u,e[c],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{r.push(this.setModelOnFilterWrapper(l,null))});Ae.all(r).then(()=>{const l=this.getModel(!0),c=[];this.allColumnFilters.forEach((d,u)=>{const h=a?a[u]:null,p=l?l[u]:null;jn(h,p)||c.push(d.column)}),c.length>0?n?.onFilterChanged({columns:c,source:t}):s&&this.updateActive("filterChanged")})}getModel(e){const t={},{allColumnFilters:s,initialModel:o,beans:{colModel:i}}=this;if(s.forEach((n,r)=>{const a=this.getModelFromFilterWrapper(n);X(a)&&(t[r]=a)}),!e)for(const n of Object.keys(o)){const r=o[n];X(r)&&!s.has(n)&&i.getCol(n)?.isFilterAllowed()&&(t[n]=r)}return t}setState(e,t,s="api"){if(this.state.clear(),t)for(const o of Object.keys(t)){const i=t[o];this.state.set(o,{model:ct(this.model,o),state:i})}this.setModel(e,s,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let s=!1;return e.forEach((o,i)=>{const n=o.state;n!=null&&(s=!0,t[i]=n)}),s?t:void 0}getModelFromFilterWrapper(e){const s=e.column.getColId();if(e.isHandler)return ct(this.model,s);const o=e.filter;return o?typeof o.getModel!="function"?(z(66),null):o.getModel():ct(this.initialModel,s)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};const{allColumnFilters:e}=this;return e.size?(e.forEach(t=>this.disposeFilterWrapper(t,"advancedFilterEnabled")),!0):!1}updateActiveFilters(){const e=c=>c?c.isFilterActive?c.isFilterActive():(z(67),!1):!1,{colModel:t,gos:s}=this.beans,o=!!fd(s),i=c=>{if(!c.isPrimary())return!0;const u=!t.isPivotActive();return!c.isValueActive()||!u?!1:t.isPivotMode()?!0:o},n=[],r=[],a=(c,d,u)=>{d&&(i(c)?n.push(u):r.push(u))},l=[];return this.allColumnFilters.forEach(c=>{const d=c.column,u=d.getColId();if(c.isHandler)l.push(Ae.resolve().then(()=>{a(d,this.isHandlerActive(d),{colId:u,isHandler:!0,handler:c.handler,handlerParams:c.handlerParams})}));else{const h=Us(c);h&&l.push(h.then(p=>{a(d,e(p),{colId:u,isHandler:!1,comp:p})}))}}),Ae.all(l).then(()=>{this.activeAggregateFilters=n,this.activeColumnFilters=r})}updateFilterFlagInColumns(e,t){const s=[];return this.allColumnFilters.forEach(o=>{const i=o.column;if(o.isHandler)s.push(Ae.resolve().then(()=>{this.setColFilterActive(i,this.isHandlerActive(i),e,t)}));else{const n=Us(o);n&&s.push(n.then(r=>{this.setColFilterActive(i,r.isFilterActive(),e,t)}))}}),this.beans.groupFilter?.updateFilterFlags(e,t),Ae.all(s)}doFiltersPass(e,t,s){const{data:o,aggData:i}=e,n=s?this.activeAggregateFilters:this.activeColumnFilters,r=s?i:o,a=this.model;for(let l=0;l<n.length;l++){const c=n[l],{colId:d,isHandler:u}=c;if(d!==t)if(u){const{handler:h,handlerParams:p}=c;if(!h.doesFilterPass({node:e,data:r,model:ct(a,d),handlerParams:p}))return!1}else{const h=c.comp;if(typeof h.doesFilterPass!="function"){He(91);continue}if(!h.doesFilterPass({node:e,data:r}))return!1}}return!0}getHandlerParams(e){const t=this.allColumnFilters.get(e.getColId());return t?.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){const{rowRenderer:t,filterManager:s}=this.beans,o=()=>{this.isAlive()&&s?.onFilterChanged(e)};t.isRefreshInProgress()?setTimeout(o,0):o()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:s}=e,o=t?.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",s).then(()=>{this.allColumnFilters.forEach(i=>{const{column:n,isHandler:r}=i;o!==n.getColId()&&(r&&i.handler.onAnyFilterChanged?.(),Us(i,r)?.then(a=>{typeof a?.onAnyFilterChanged=="function"&&a.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(s=>{const o=s.isHandler;o&&s.handler.onNewRowsLoaded?.();const i=Us(s,o);i&&t.push(i.then(n=>{n.onNewRowsLoaded?.()}))}),Ae.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){const{filterValueSvc:s,colModel:o}=this.beans;return(i,n)=>{const r=n?o.getCol(n):e;return r?s.getValue(r,i,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t?.isHandler)return this.isHandlerActive(e);const s=t?.filter;return s?s.isFilterActive():ct(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=X(ct(this.model,e.getColId()));if(t)return t;const s=this.beans.groupFilter;return s?.isGroupFilter(e)?s.isFilterActive(e):!1}getOrCreateFilterUi(e){const t=this.getOrCreateFilterWrapper(e,!0);return t?Us(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const s=Us(t);return s?s.then(o=>({comp:o,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const s=this.getOrCreateFilterWrapper(e,t);return s?.isHandler?s.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let s=this.cachedFilter(e);return!s&&t&&(s=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,s)),s}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>this.beans.dataTypeSvc?.getBaseDataType(e),t)}getDefaultFilterFromDataType(e,t=!1){return py(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":i2(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,s,o,i,n){const r=()=>{const c=this.createFilterCompParams(e,i,n),d=o(c,i);return wx(this.beans.userCompFactory,t,d,s)},a=r();return a?{compDetails:a,createFilterUi:c=>(c?r():a).newAgStackInstance()}:null}createFilterInstance(e,t,s,o){const i=this.beans.selectableFilter;i?.isSelectable(t)&&(t=i.getFilterDef(e,t));const{handler:n,handlerParams:r,handlerGenerator:a}=this.createHandler(e,t,s)??{},l=this.createFilterComp(e,t,s,o,!!n,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:n,handlerGenerator:a,handlerParams:r};const{compDetails:c,createFilterUi:d}=l;return this.isGlobalButtons&&(c.params?.buttons?.length||z(281,{colId:e.getColId()})),{compDetails:c,handler:n,handlerGenerator:a,handlerParams:r,createFilterUi:d}}createBaseFilterParams(e,t){const{filterManager:s,rowModel:o}=this.beans;return we(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:i=>s?.doesRowPassOtherFilters(e.getColId(),i)??!0,rowModel:o})}createFilterCompParams(e,t,s,o){const i=this.filterChangedCallbackFactory(e),n=this.createBaseFilterParams(e,o);if(n.filterChangedCallback=i,n.filterModifiedCallback=o?()=>{}:r=>this.filterModified(e,r),t){const r=n,a=e.getColId(),l=ct(this.model,a);r.model=l,r.state=this.state.get(a)??{model:l},r.onModelChange=(c,d)=>{this.updateStoredModel(a,c),this.refreshHandlerAndUi(e,c,"ui",!1,d).then(()=>{i({...d,source:"columnFilter"})})},r.onStateChange=c=>{this.updateState(e,c),this.updateOrRefreshFilterUi(e)},r.onAction=(c,d,u)=>{this.updateModel(e,c,d),this.dispatchLocalEvent({type:"filterAction",column:e,action:c,event:u})},r.getHandler=()=>this.getHandler(e,!0),r.onUiChange=c=>this.filterUiChanged(e,c),r.source=s}return n}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,s){const o=t(),i={created:!0,create:t,filterParams:e.params,compDetails:e,promise:o};return o.then(s),i}createFilterWrapper(e){const{compDetails:t,handler:s,handlerGenerator:o,handlerParams:i,createFilterUi:n}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),a=>a),r=e.getColId();if(s)return delete this.initialModel[r],s.init?.({...i,source:"init",model:ct(this.model,r)}),{column:e,isHandler:!0,handler:s,handlerGenerator:o,handlerParams:i,filterUi:this.createFilterUiForHandler(t,n)};if(n){const a={column:e,filterUi:null,isHandler:!1};return a.filterUi=this.createFilterUiLegacy(t,n,l=>{a.filter=l??void 0}),a}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,s){const{gos:o,frameworkOverrides:i,registry:n}=this.beans;let r;const a=p=>{const m=p.filter;if(tm(m)){const C=m.handler;return C||(r=m.doesFilterPass,r?()=>({doesFilterPass:r}):void 0)}return typeof m=="string"?m:void 0},l=o.get("enableFilterHandlers"),c=l?a(t):void 0,d=p=>()=>this.createBean(n.createDynamicBean(p,!0));let u,h;if(typeof c=="string"){const p=o.get("filterHandlers")?.[c];p!=null?u=p:$R.has(c)&&(u=d(c),h=c)}else u=c;if(!u){let p;const{compName:m,jsComp:C,fwComp:v}=im(i,t);m?p=m:C==null&&v==null&&t.filter===!0&&(p=s),h=this.handlerMap[p],h&&(u=d(h))}return u?{filterHandler:u,handlerNameOrCallback:r??h}:l?(Qe(o)&&z(277,{colId:e.getColId()}),Q4):void 0}createHandler(e,t,s){const o=this.createHandlerFunc(e,t,s);if(!o)return;const i=cc(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:n,filterHandler:r}=o,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,r,i);return{handler:a,handlerParams:l,handlerGenerator:n??r}}createHandlerFromFunc(e,t,s){const o=e.getColDef(),i=t(we(this.gos,{column:e,colDef:o})),n=this.createHandlerParams(e,s);return{handler:i,handlerParams:n}}createHandlerParams(e,t){const s=e.getColDef(),o=e.getColId(),i=this.filterChangedCallbackFactory(e);return we(this.gos,{colDef:s,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:n=>this.beans.filterManager?.doesRowPassOtherFilters(o,n)??!0,onModelChange:(n,r)=>{this.updateStoredModel(o,n),this.refreshHandlerAndUi(e,n,"handler",!1,r).then(()=>{i({...r,source:"columnFilter"})})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:s,groupFilter:o}=this.beans;this.allColumnFilters.forEach((n,r)=>{let a;n.column.isPrimary()?a=t.getColDefCol(r):a=t.getCol(r),!(a&&a===n.column)&&(e.push(n.column),this.disposeFilterWrapper(n,"columnChanged"),this.disposeColumnListener(r))});const i=o&&e.every(n=>o.isGroupFilter(n));e.length>0&&!i&&s?.onFilterChanged({columns:e,source:"api"})}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const s=this.beans.groupFilter;return s?.isGroupFilter(e)?s.isFilterAllowed(e):!0}getFloatingFilterCompDetails(e,t){const{userCompFactory:s,frameworkOverrides:o,selectableFilter:i}=this.beans,n=h=>{const p=this.getOrCreateFilterUi(e);p?.then(m=>{h(Xn(m))})},r=e.getColDef(),a=i?.isSelectable(r)?i.getFilterDef(e,r):r,l=c2(o,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",c=this.gos.get("enableFilterHandlers"),d=cc(s,a,this.createFilterCompParams(e,c,"init",!0)),u=we(this.gos,{column:e,filterParams:d,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:n,showParentFilter:t});if(c){const h=u,p=e.getColId(),m=this.filterChangedCallbackFactory(e);h.onUiChange=C=>this.floatingFilterUiChanged(e,C),h.model=ct(this.model,p),h.onModelChange=(C,v)=>{this.updateStoredModel(p,C),this.refreshHandlerAndUi(e,C,"floating",!0,v).then(()=>{m({...v,source:"columnFilter"})})},h.getHandler=()=>this.getHandler(e,!0),h.source="init"}return Rx(s,r,u,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,s,o){const i="paramsUpdated";if(e.isHandler){const n=t.getColId();delete this.initialModel[n],this.state.delete(n);const r=e.filterUi,a=this.createFilterUiForHandler(s,o);e.filterUi=a;const l=this.eventSvc;r?.created?r.promise.then(c=>{this.destroyBean(c),l.dispatchEvent({type:"filterDestroyed",source:i,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:i,column:t})}else this.destroyFilter(t,i)}destroyFilter(e,t="api"){const s=e.getColId(),o=this.allColumnFilters.get(s);this.disposeColumnListener(s),delete this.initialModel[s],o&&this.disposeFilterWrapper(o,t).then(i=>{i&&this.isAlive()&&this.beans.filterManager?.onFilterChanged({columns:[e],source:"api"})})}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let s=!1;const{column:o,isHandler:i,filterUi:n}=e,r=o.getColId();i&&(s=this.isHandlerActive(o),this.destroyBean(e.handler),delete this.model[r],this.state.delete(r));const a=()=>{this.setColFilterActive(o,!1,"filterDestroyed"),this.allColumnFilters.delete(r),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:o})};if(n){if(n.created)return n.promise.then(l=>(s=i?s:!!l?.isFilterActive(),this.destroyBean(l),a(),s));a()}return Ae.resolve(s)}filterChangedCallbackFactory(e){return t=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:t?.source??"columnFilter"})}}filterParamsChanged(e,t="api"){const s=this.allColumnFilters.get(e);if(!s)return;const o=this.beans,i=s.column,n=i.getColDef(),r=i.isFilterAllowed(),a=this.getDefaultFilter(i),l=o.selectableFilter,c=l?.isSelectable(n)?l.getFilterDef(i,n):n,d=r?this.createHandlerFunc(i,c,this.getDefaultFilter(i)):void 0,u=!!d,h=s.isHandler;if(h!=u){this.destroyFilter(i,"paramsUpdated");return}const{compDetails:p,createFilterUi:m}=(r?this.createFilterComp(i,c,a,v=>v,u,"colDef"):null)??{compDetails:null,createFilterUi:null},C=p?.params??cc(o.userCompFactory,c,this.createFilterCompParams(i,u,"colDef"));if(h){const v=d?.handlerNameOrCallback??d?.filterHandler,w=ct(this.model,e);if(s.handlerGenerator!=v){const b=s.handler,{handler:S,handlerParams:x}=this.createHandlerFromFunc(i,d.filterHandler,C);s.handler=S,s.handlerParams=x,s.handlerGenerator=v,delete this.model[e],S.init?.({...x,source:"init",model:null}),this.destroyBean(b),w!=null&&this.beans.filterManager?.onFilterChanged({columns:[i],source:t})}else{const b=this.createHandlerParams(i,p?.params);s.handlerParams=b,s.handler.refresh?.({...b,source:"colDef",model:w})}}if(this.areFilterCompsDifferent(s.filterUi?.compDetails??null,p)||!s.filterUi||!p){this.destroyFilterUi(s,i,p,m);return}s.filterUi.filterParams=C,Us(s,h)?.then(v=>{(v?.refresh?v.refresh(C):!0)===!1?this.destroyFilterUi(s,i,p,m):this.dispatchLocalEvent({type:"filterParamsChanged",column:i,params:C})})}refreshHandlerAndUi(e,t,s,o,i){const n=this.cachedFilter(e);if(!n)return o&&this.getOrCreateFilterWrapper(e,!0),Ae.resolve();if(!n.isHandler)return Ae.resolve();const{filterUi:r,handler:a,handlerParams:l}=n;return qR(()=>{if(r){const{created:c,filterParams:d}=r;if(c)return r.promise.then(u=>u?{filter:u,filterParams:d}:void 0);r.refreshed=!0}return Ae.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},s,i)}setColumnFilterWrapper(e,t){const s=e.getColId();this.allColumnFilters.set(s,t),this.allColumnListeners.set(s,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(s)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:s}=e,{componentClass:o}=t;return!(s===o||s?.render&&o?.render&&s.render===o.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e){const t=this.beans.colModel.getColDefCol(e);if(!t)return Promise.resolve(void 0);const s=this.getOrCreateFilterUi(t);return s?new Promise(o=>{s.then(i=>{o(Xn(i))})}):Promise.resolve(null)}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:e,source:t})=>this.setModel(e,t)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:e,model:t,resolve:s})=>{this.setModelForColumn(e,t).then(()=>s())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:o,model:i}=this,n=e.getColId(),r=o.get(n);return r?r.model??null:ct(i,n)}const s=this.cachedFilter(e);return s?this.getModelFromFilterWrapper(s):null}setModelForColumn(e,t){if(this.beans.dataTypeSvc?.isPendingInference){let s=()=>{};const o=new Promise(i=>{s=i});return this.columnModelUpdates.push({key:e,model:t,resolve:s}),o}return new Promise(s=>{this.setModelForColumnLegacy(e,t).then(o=>s(o))})}getStateForColumn(e){return this.state.get(e)??{model:ct(this.model,e)}}setModelForColumnLegacy(e,t){const s=this.beans.colModel.getColDefCol(e),o=s?this.getOrCreateFilterWrapper(s,!0):null;return o?this.setModelOnFilterWrapper(o,t):Ae.resolve()}setColDefPropsForDataType(e,t,s){const o=e.filter,i=o===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):o;if(typeof i!="string")return;let n,r;const a=this.beans,{filterParams:l,filterValueGetter:c}=e;i==="agMultiColumnFilter"?{filterParams:n,filterValueGetter:r}=a.multiFilter?.getParamsForDataType(l,c,t,s)??{}:{filterParams:n,filterValueGetter:r}=t2(i,l,c,t,s,a,this.getLocaleTextFunc()),e.filterParams=n,r&&(e.filterValueGetter=r)}setColFilterActive(e,t,s,o){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",s)),e.dispatchColEvent("filterChanged",s,o)}setModelOnFilterWrapper(e,t,s){return new Ae(o=>{if(e.isHandler){const n=e.column,r=n.getColId(),a=this.model[r];if(this.updateStoredModel(r,t),s&&t===a){o();return}this.refreshHandlerAndUi(n,t,"api").then(()=>o());return}const i=Us(e);if(i){i.then(n=>{if(typeof n?.setModel!="function"){z(65),o();return}(n.setModel(t)||Ae.resolve()).then(()=>o())});return}o()})}updateStoredModel(e,t){X(t)?this.model[e]=t:delete this.model[e];const s=this.state.get(e),o={model:t,state:s?.state};this.state.set(e,o)}filterModified(e,t){this.getOrCreateFilterUi(e)?.then(s=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:s,...t})})}filterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"filterUiChanged",column:e,...t})}floatingFilterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"floatingFilterUiChanged",column:e,...t})}updateModel(e,t,s){const o=e.getColId(),i=this.cachedFilter(e),n=()=>i?.filterUi;dg(t,n,()=>ct(this.model,o),()=>this.state.get(o),r=>this.updateState(e,r),r=>n()?.filterParams?.onModelChange(r,s),i?.isHandler?i.handler.processModelToApply?.bind(i.handler):void 0)}updateAllModels(e,t){const s=[];this.allColumnFilters.forEach((o,i)=>{const n=this.beans.colModel.getColDefCol(i);n&&dg(e,()=>o.filterUi,()=>ct(this.model,i),()=>this.state.get(i),r=>this.updateState(n,r),r=>{this.updateStoredModel(i,r),this.dispatchLocalEvent({type:"filterAction",column:n,action:e}),s.push(this.refreshHandlerAndUi(n,r,"ui"))},o?.isHandler?o.handler.processModelToApply?.bind(o.handler):void 0)}),s.length&&Ae.all(s).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();Pm(()=>this.cachedFilter(e)?.filterUi,()=>ct(this.model,t),()=>this.state.get(t))}updateState(e,t){this.state.set(e.getColId(),t),this.dispatchLocalEvent({type:"filterStateChanged",column:e,state:t})}canApplyAll(){const{state:e,model:t,activeFilterComps:s}=this;for(const i of s)if(i.source==="COLUMN_MENU")return!1;let o=!1;for(const i of e.keys()){const n=e.get(i);if(n.valid===!1)return!1;(n.model??null)!==ct(t,i)&&(o=!0)}return o}hasUnappliedModel(e){const{model:t,state:s}=this;return(s.get(e)?.model??null)!==ct(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if(t==="newFiltersToolPanel")return!0;const s=this.beans.filterPanelSvc;return s?.isActive?!!s.getState(e.getColId()):!1}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function eT(e){return!!e.filterManager?.isAnyFilterPresent()}function tT(e,t="api"){e.filterManager?.onFilterChanged({source:t})}var sT=class extends O{constructor(){super(...arguments),this.beanName="filterManager",this.advFilterModelUpdateQueue=[]}wireBeans(e){this.quickFilter=e.quickFilter,this.advancedFilter=e.advancedFilter,this.colFilter=e.colFilter}postConstruct(){const e=this.refreshFiltersForAggregations.bind(this),t=this.updateAdvFilterColumns.bind(this);this.addManagedEventListeners({columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:o})=>this.onAdvFilterEnabledChanged(o),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.quickFilter&&this.addManagedListeners(this.quickFilter,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})});const{gos:s}=this;this.alwaysPassFilter=s.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=s.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"&&t(e)}setFilterState(e,t,s="api"){this.isAdvFilterEnabled()||this.colFilter?.setState(e,t,s)}setFilterModel(e,t="api",s){if(this.isAdvFilterEnabled()){s||this.warnAdvFilters();return}this.colFilter?.setModel(e,t)}getFilterModel(){return this.colFilter?.getModel()??{}}getFilterState(){return this.colFilter?.getState()}isColumnFilterPresent(){return!!this.colFilter?.isFilterPresent()}isAggregateFilterPresent(){return!!this.colFilter?.isAggFilterPresent()}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(e){e?this.colFilter?.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):this.advancedFilter?.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){return!!this.advancedFilter?.isEnabled()}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){fd(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:s,columns:o=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):Ae.resolve()).then(()=>{const i={source:t,type:"filterChanged",columns:o};s&&St(i,s),this.eventSvc.dispatchEvent(i),this.colFilter?.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){return!!this.colFilter?.isSuppressFlashingCellsBecauseFiltering()}isQuickFilterPresent(){return!!this.quickFilter?.isFilterPresent()}updateAggFiltering(){this.aggFiltering=!!fd(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,colIdToSkip:e})}doesRowPassAggregateFilters(e){const{rowNode:t}=e;return this.alwaysPassFilter?.(t)?!0:!(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))}doesRowPassFilter(e){const{rowNode:t}=e;return this.alwaysPassFilter?.(t)?!0:!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.externalFilterPresent&&!this.doesExternalFilterPass(t)||this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip)||this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(t))}isFilterAllowed(e){return this.isAdvFilterEnabled()?!1:!!this.colFilter?.isFilterAllowed(e)}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){if(this.isAdvFilterEnabled()){if(this.beans.dataTypeSvc?.isPendingInference){this.advFilterModelUpdateQueue.push(e);return}this.advancedFilter.setModel(e??null),this.onFilterChanged({source:t})}}toggleAdvFilterBuilder(e,t){this.isAdvFilterEnabled()&&this.advancedFilter.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvFilterColumns(){this.isAdvFilterEnabled()&&this.advancedFilter.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){return this.isAdvFilterEnabled()?!1:!!this.colFilter?.hasFloatingFilters()}getColumnFilterInstance(e){return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):this.colFilter?.getFilterInstance(e)??Promise.resolve(void 0)}warnAdvFilters(){z(68)}setupAdvFilterHeaderComp(e){this.advancedFilter?.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(const e of this.advFilterModelUpdateQueue)this.setAdvFilterModel(e);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(e,t){return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):this.colFilter?.setModelForColumn(e,t)??Promise.resolve()}},oT=class extends O{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){this.hidePopup?.()}showMenuAfterMouseEvent(e,t,s,o){e&&!e.isColumn||this.showPopup(e,i=>{this.popupSvc?.positionPopupUnderMouseEvent({column:e,type:s,mouseEvent:t,ePopup:i})},s,t.target,Vt(this.gos),o)}showMenuAfterButtonClick(e,t,s,o){if(e&&!e.isColumn)return;let i=-1,n="left";const r=Vt(this.gos);!r&&this.gos.get("enableRtl")&&(i=1,n="right");const a=r?void 0:4*i,l=r?void 0:4;this.showPopup(e,c=>{this.popupSvc?.positionPopupByComponent({type:s,eventSource:t,ePopup:c,nudgeX:a,nudgeY:l,alignSide:n,keepWithinBounds:!0,position:"under",column:e})},s,t,r,o)}showPopup(e,t,s,o,i,n){const r=e?this.createBean(new JR(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!r?.hasFilter()||!e){He(57);return}const a=Rt({tag:"div",cls:`ag-menu${i?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:C=>this.trapFocusWithin(C,a)}),a.appendChild(r?.getGui());let l;const c=()=>r?.afterGuiDetached(),d=fy(this.gos)?o??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,u=C=>{vg(e,!1,"contextMenu");const v=C instanceof KeyboardEvent;this.tabListener&&(this.tabListener=this.tabListener()),v&&o&&Hs(o)&&dm(o)?.focus({preventScroll:!0}),c(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,s,e),n?.()},h=this.getLocaleTextFunc(),p=i&&s!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),m=this.popupSvc?.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:u,positionCallback:()=>t(a),anchorToElement:d,ariaLabel:p});m&&(this.hidePopup=l=m.hideFunc),r.afterInit().then(()=>{t(a),r.afterGuiAttached({container:s,hidePopup:l})}),vg(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,s,e)}trapFocusWithin(e,t){e.key!==I.TAB||e.defaultPrevented||_o(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),Oo(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,s){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:s??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},iT=class extends O{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,s){if(!t)return;const o=e.getColDef(),{selectableFilter:i,valueSvc:n}=this.beans,r=s??i?.getFilterValueGetter(e.getColId())??o.filterValueGetter;return r?this.executeFilterValueGetter(r,t.data,e,t,o):n.getValue(e,t)}executeFilterValueGetter(e,t,s,o,i){const{expressionSvc:n,valueSvc:r}=this.beans,a=we(this.gos,{data:t,node:o,column:s,colDef:i,getValue:r.getValueCallback.bind(r,o)});return typeof e=="function"?e(a):n?.evaluate(e,a)}},nT={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},rT=class extends Xe{constructor(){super(nT,[ul]),this.eFloatingFilterText=ve}init(e){this.params=e;const t=this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0);if(this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){const s=e,o=s.getHandler();if(o.getModelAsString){const i=o.getModelAsString(s.model);this.eFloatingFilterText.setValue(i)}}}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const s=t.getModelAsString(e);this.eFloatingFilterText.setValue(s)}})}refresh(e){this.init(e)}},Uu=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){const s=e.filterOptions??t;this.filterOptions!==s&&(this.filterOptions=s,this.customFilterOptions={},this.mapCustomOptions()),this.defaultOption=this.getDefaultItem(e.defaultOption)}mapCustomOptions(){const{filterOptions:e}=this;if(e)for(const t of e){if(typeof t=="string")continue;const s=[["displayKey"],["displayName"],["predicate","test"]],o=i=>i.some(n=>t[n]!=null)?!0:(z(72,{keys:i}),!1);if(!s.every(o)){this.filterOptions=e.filter(i=>i===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){const{filterOptions:t}=this;if(e)return e;if(t.length>=1){const s=t[0];if(typeof s=="string")return s;if(s.displayKey)return s.displayKey;z(73)}else z(74)}getCustomOption(e){return this.customFilterOptions[e]}};function Bn(e,t,s){return s==null?e.splice(t):e.splice(t,s)}function Ka(e){return e==null||typeof e=="string"&&e.trim().length===0}function aT(e){return e==="AND"||e==="OR"?e:"AND"}function lT(e,t,s){if(e==null)return;const{predicate:o}=e;if(o!=null&&!t.some(i=>i==null))return o(t,s)}function cT(e,t){let s=e.length;return s>t&&(e.splice(t),z(78),s=t),s}function tr(e,t){const s=t.getCustomOption(e);if(s){const{numberOfInputs:i}=s;return i??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}var $u=class extends l2{constructor(e,t,s){super(e,"simple-filter"),this.mapValuesFromModel=t,this.defaultOptions=s,this.eTypes=[],this.eJoinPanels=[],this.eJoinAnds=[],this.eJoinOrs=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}setParams(e){super.setParams(e);const t=new Uu;this.optionsFactory=t,t.init(e,this.defaultOptions),this.commonUpdateSimpleParams(e),this.createOption(),this.createMissingConditionsAndOperators()}updateParams(e,t){this.optionsFactory.refresh(e,this.defaultOptions),super.updateParams(e,t),this.commonUpdateSimpleParams(e)}commonUpdateSimpleParams(e){this.setNumConditions(e),this.defaultJoinOperator=aT(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions();const t=this.getGui();this.isReadOnly()?t.setAttribute("tabindex","-1"):t.removeAttribute("tabindex")}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,s)=>{const o=s===0?e:this.optionsFactory.defaultOption;t.setValue(o,!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.filterType,operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){const{eJoinOrs:e,defaultJoinOperator:t}=this;return e.length===0?t:e[0].getValue()===!0?"OR":"AND"}areNonNullModelsEqual(e,t){const s=!e.operator,o=!t.operator;if(!s&&o||s&&!o)return!1;let n;if(s){const r=e,a=t;n=this.areSimpleModelsEqual(r,a)}else{const r=e,a=t;n=r.operator===a.operator&&ro(r.conditions,a.conditions,(l,c)=>this.areSimpleModelsEqual(l,c))}return n}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),Ae.resolve();if(e.operator){const o=e;let i=o.conditions;i==null&&(i=[],z(77));const n=cT(i,this.maxNumConditions),r=this.getNumConditions();if(n<r)this.removeConditionsAndOperators(n);else if(n>r)for(let l=r;l<n;l++)this.createJoinOperatorPanel(),this.createOption();const a=o.operator==="OR";this.eJoinAnds.forEach(l=>l.setValue(!a,!0)),this.eJoinOrs.forEach(l=>l.setValue(a,!0)),i.forEach((l,c)=>{this.eTypes[c].setValue(l.type,!0),this.setConditionIntoUi(l,c)})}else{const o=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(o.type,!0),this.setConditionIntoUi(o,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),Ae.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(z(79),t=1),this.maxNumConditions=t;let s=e.numAlwaysVisibleConditions??1;s<1&&(z(80),s=1),s>t&&(z(81),s=t),this.numAlwaysVisibleConditions=s}createOption(){const e=this.getGui(),t=this.createManagedBean(new Eu);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());const s=this.createEValue();this.eConditionBodies.push(s),e.appendChild(s),this.putOptionsIntoDropdown(t),this.resetType(t);const o=this.getNumConditions()-1;this.forEachPositionInput(o,i=>this.resetInput(i)),this.addChangedListeners(t,o)}createJoinOperatorPanel(){const e=Rt({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);const t=this.createJoinOperator(this.eJoinAnds,e,"and"),s=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);const o=this.eJoinPanels.length-1,i=this.joinOperatorId++;this.resetJoinOperatorAnd(t,o,i),this.resetJoinOperatorOr(s,o,i),this.isReadOnly()||(t.onValueChange(this.listener),s.onValueChange(this.listener))}createJoinOperator(e,t,s){const o=this.createManagedBean(new Bx);e.push(o);const i="ag-filter-condition-operator";return o.addCss(i),o.addCss(`${i}-${s}`),t.appendChild(o.getGui()),o}createFilterListOptions(){this.filterListOptions=this.optionsFactory.filterOptions.map(e=>typeof e=="string"?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){const{filterListOptions:t}=this;for(const s of t)e.addOption(s);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,s=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:s?this.getLocaleTextFunc()(s.displayKey,s.displayName):this.translate(t)}}createBodyTemplate(){return null}getAgComponents(){return[]}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let s=0;s<this.getNumConditions();s++)this.isConditionUiComplete(s)?e=s:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const s=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<s){this.removeConditionsAndOperators(s+1);const o=e+1,i=s-o;i>0&&this.removeConditionsAndOperators(o,i),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((o,i)=>{const n=this.isConditionDisabled(i,e);o.setDisabled(n||this.filterListOptions.length<=1),i===1&&($n(this.eJoinPanels[0],n),this.eJoinAnds[0].setDisabled(n),this.eJoinOrs[0].setDisabled(n))}),this.eConditionBodies.forEach((o,i)=>{Ye(o,this.isConditionBodyVisible(i))});const s=(t??this.getJoinOperator())==="OR";for(const o of this.eJoinAnds)o.setValue(!s,!0);for(const o of this.eJoinOrs)o.setValue(s,!0);this.forEachInput((o,i,n,r)=>{this.setElementDisplayed(o,i<r),this.setElementDisabled(o,this.isConditionDisabled(n,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;const{eTypes:s,eConditionBodies:o,eJoinPanels:i,eJoinAnds:n,eJoinOrs:r}=this;this.removeComponents(s,e,t),this.removeElements(o,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(i,a,t),this.removeComponents(n,a,t),this.removeComponents(r,a,t)}removeElements(e,t,s){const o=Bn(e,t,s);for(const i of o)eo(i)}removeComponents(e,t,s){const o=Bn(e,t,s);for(const i of o)eo(i.getGui()),this.destroyBean(i)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!e?.suppressFocus){let t;if(!this.isReadOnly()){const s=this.getInputs(0)[0];s instanceof wo&&this.isConditionBodyVisible(0)?t=s.getInputElement():t=this.eTypes[0]?.getFocusableElement()}(t??this.getGui()).focus({preventScroll:!0})}}afterGuiDetached(){super.afterGuiDetached();const e=this.params;if(this.beans.colFilter?.shouldKeepStateOnDetach(e.column))return;e.onStateChange({model:e.model});let t=-1,s=-1,o=!1;const i=this.getJoinOperator();for(let r=this.getNumConditions()-1;r>=0;r--)if(this.isConditionUiComplete(r))t===-1&&(t=r,s=r);else{const a=r>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(r-1),l=r<t;(a||l)&&(this.removeConditionsAndOperators(r,1),o=!0,l&&s--)}let n=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),n=!0),this.shouldAddNewConditionAtEnd(s===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),n=!0),n&&this.updateConditionStatusesAndValues(s,i),o&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=s}getModelAsString(e){return this.params.getHandler()?.getModelAsString?.(e)??""}getPlaceholderText(e,t){let s=this.translate(e);if(typeof this.filterPlaceholder=="function"){const o=this.eTypes[t].getValue(),i=this.translate(o);s=this.filterPlaceholder({filterOptionKey:o,filterOption:i,placeholder:s})}else typeof this.filterPlaceholder=="string"&&(s=this.filterPlaceholder);return s}resetPlaceholder(){const e=this.getLocaleTextFunc();this.forEachInput((t,s,o,i)=>{if(!(t instanceof wo))return;const n=s===0&&i>1?"inRangeStart":s===0?"filterOoo":"inRangeEnd",r=s===0&&i>1?e("ariaFilterFromValue","Filter from value"):s===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(n,o)),t.setInputAriaLabel(r)})}setElementValue(e,t,s){e instanceof wo&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){Jh(e)&&Ye(e.getGui(),t)}setElementDisabled(e,t){Jh(e)&&$n(e.getGui(),t)}attachElementOnChange(e,t){e instanceof wo&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,s)=>{this.forEachPositionTypeInput(s,t,e)})}forEachPositionInput(e,t){const s=this.getConditionType(e);this.forEachPositionTypeInput(e,s,t)}forEachPositionTypeInput(e,t,s){const o=tr(t,this.optionsFactory),i=this.getInputs(e);for(let n=0;n<i.length;n++){const r=i[n];r!=null&&s(r,n,e,o)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return tr(t,this.optionsFactory)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(s=>s==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinAnds.forEach((t,s)=>this.resetJoinOperatorAnd(t,s,this.joinOperatorId+s)),this.eJoinOrs.forEach((t,s)=>this.resetJoinOperatorOr(t,s,this.joinOperatorId+s)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,this.updateUiVisibility(),e||this.params.onUiChange(this.getUiChangeEventParams())}resetType(e){const s=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(s).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,s){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),s)}resetJoinOperatorOr(e,t,s){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),s)}resetJoinOperator(e,t,s,o,i){this.updateJoinOperatorDisabled(e.setValue(s,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${i}`).setLabel(o),t)}updateJoinOperatorsDisabled(){const e=(t,s)=>this.updateJoinOperatorDisabled(t,s);this.eJoinAnds.forEach(e),this.eJoinOrs.forEach(e)}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const s=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((o,i,n)=>{n===t&&this.setElementValue(o,s[i]!=null?s[i]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,s,o)=>{this.setElementValue(t,s===0&&o===0?e:null,!0)})}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,s=>{this.attachElementOnChange(s,this.listener)}))}hasInvalidInputs(){return!1}isReadOnly(){return!!this.params.readOnly}},LC=class{constructor(e,t,s,o,i,n){this.alive=!0,this.context=e,this.eParent=i;const r=bx(t,s,o);r&&r.newAgStackInstance().then(a=>{if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;i.appendChild(a.getGui()),a?.afterGuiAttached?.();const{tempValue:l,disabled:c}=this;l&&a.setDate(l),c!=null&&a.setDisabled?.(c),n?.(this)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){const t=this.dateComp;t?t.setDate(e):this.tempValue=e}setDisabled(e){const t=this.dateComp;t?t.setDisabled?.(e):this.disabled=e}setDisplayed(e){Ye(this.eParent,e)}setInputPlaceholder(e){this.dateComp?.setInputPlaceholder?.(e)}setInputAriaLabel(e){this.dateComp?.setInputAriaLabel?.(e)}afterGuiAttached(e){this.dateComp?.afterGuiAttached?.(e)}updateParams(e){this.dateComp?.refresh?.(e)}},qu=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function OC(e,t){const{dateFrom:s,dateTo:o,type:i}=e||{};return[s&&It(s,void 0,!0)||null,o&&It(o,void 0,!0)||null].slice(0,tr(i,t))}var Jg=1e3,ep=1/0,dT=class extends $u{constructor(){super("dateFilter",OC,qu),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=Jg,this.maxValidYear=ep,this.minValidDate=null,this.maxValidDate=null,this.filterType="date"}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}commonUpdateSimpleParams(e){super.commonUpdateSimpleParams(e);const t=(l,c)=>{const d=e[l];if(d!=null)if(isNaN(d))z(82,{param:l});else return d==null?c:Number(d);return c},s=t("minValidYear",Jg),o=t("maxValidYear",ep);this.minValidYear=s,this.maxValidYear=o,s>o&&z(83);const{minValidDate:i,maxValidDate:n}=e,r=i instanceof Date?i:It(i);this.minValidDate=r;const a=n instanceof Date?n:It(n);this.maxValidDate=a,r&&a&&r>a&&z(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:s,gos:o},params:i}=this,n=new LC(s,t,i.colDef,we(o,{onDateChanged:()=>this.onUiChanged(),filterParams:i,location:"filter"}),e);return this.addDestroyFunc(()=>n.destroy()),n}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=Rt({tag:"div",cls:"ag-filter-body"});return this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,s,o){const i=Rt({tag:"div",cls:`ag-filter-${o} ag-filter-date-${o}`});t.push(i),e.appendChild(i),s.push(this.createDateCompWrapper(i))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),Bn(this.eConditionPanelsFrom,e,t),Bn(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,s){const o=Bn(e,t,s);for(const i of o)i.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:s,minValidYear:o,maxValidYear:i}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<o)return!1;if(s){if(e>s)return!1}else if(e.getUTCFullYear()>i)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((s,o,i,n)=>{i!==e||!t||o>=n||(t=t&&this.isValidDateValue(s.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),s={},o=this.getValues(e),i=this.params.useIsoSeparator?"T":" ";return o.length>0&&(s.dateFrom=zt(o[0],!0,i)),o.length>1&&(s.dateTo=zt(o[1],!0,i)),{dateFrom:null,dateTo:null,filterType:this.filterType,type:t,...s}}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),s=e("ariaFilterValue","Filter Value");this.forEachInput(o=>{o.setInputPlaceholder(t),o.setInputAriaLabel(s)})}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:s}=this;return e>=t.length?[null,null]:[t[e],s[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(s,o,i,n)=>{o<n&&t.push(s.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}},NC=class extends O{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,s=new Uu;this.optionsFactory=s,s.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(s,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){const t=e.filterParams,s=this.optionsFactory;s.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:s,filterParams:t}),this.updateParams(e)}this.validateModel(e)}updateParams(e){this.params=e}doesFilterPass(e){const t=e.model;if(t==null)return!0;const{operator:s}=t,o=[];if(s){const r=t;o.push(...r.conditions??[])}else o.push(t);const i=s&&s==="OR"?"some":"every",n=this.params.getValue(e.node);return o[i](r=>this.individualConditionPasses(e,r,n))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:s,maxNumConditions:o}}=e;if(t==null)return;let n=Im(t)?t.conditions:[t];const r=s?.map(d=>typeof d=="string"?d:d.displayKey)??this.defaultOptions;if(!(!n||n.every(d=>r.find(u=>u===d.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const c=this.filterType;if((n&&!n.every(d=>d.filterType===c)||t.filterType!==c)&&(n=n.map(d=>({...d,filterType:c})),l=!0),typeof o=="number"&&n&&n.length>o&&(n=n.slice(0,o),l=!0),l){const d=n.length>1?{...t,filterType:c,conditions:n}:{...n[0],filterType:c};this.params={...e,model:d},e.onModelChange(d)}}individualConditionPasses(e,t,s){const o=this.optionsFactory,i=this.mapValuesFromModel(t,o),n=o.getCustomOption(t.type),r=lT(n,i,s);return r??(s==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(i,s,t,e))}},HC=class extends NC{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:s,includeBlanksInGreaterThan:o,includeBlanksInLessThan:i,includeBlanksInRange:n}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(s)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(o)return!0;break;case"lessThan":case"lessThanOrEqual":if(i)return!0;break;case"inRange":if(n)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,s){const o=s.type;if(!this.isValid(t))return o==="notEqual"||o==="notBlank";const i=this.comparator(),n=e[0]!=null?i(e[0],t):0;switch(o){case"equals":return n===0;case"notEqual":return n!==0;case"greaterThan":return n>0;case"greaterThanOrEqual":return n>=0;case"lessThan":return n<0;case"lessThanOrEqual":return n<=0;case"inRange":{const r=i(e[1],t);return this.params.filterParams.inRangeInclusive?n>=0&&r<=0:n>0&&r<0}case"blank":return Ka(t);case"notBlank":return!Ka(t);default:return z(76,{filterModelType:o}),!0}}},GC={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},uT={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},Ku=class extends O{constructor(e,t,s){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=s}getModelAsString(e,t){const s=this.getLocaleTextFunc(),o=t==="filterToolPanel";if(!e)return o?Zs(this,"filterSummaryInactive"):null;if(e.operator!=null){const n=e,a=(n.conditions??[]).map(c=>this.getModelAsString(c,t)),l=n.operator==="AND"?"andCondition":"orCondition";return a.join(` ${Zs(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return o?Zs(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):s(e.type,e.type);{const n=e,r=this.optionsFactory.getCustomOption(n.type),{displayKey:a,displayName:l,numberOfInputs:c}=r||{};return a&&l&&c===0?s(a,l):this.conditionToString(n,o,n.type==="inRange"||c===2,a,l)}}}updateParams(e){const{optionsFactory:t,filterParams:s}=e;this.optionsFactory=t,this.filterParams=s}conditionForToolPanel(e,t,s,o,i,n){let r;const a=this.getTypeKey(e);return a&&(r=Zs(this,a)),i&&n&&(r=this.getLocaleTextFunc()(i,n)),r!=null?t?`${r} ${Zs(this,"filterSummaryInRangeValues",[s(),o()])}`:`${r} ${s()}`:null}getTypeKey(e){const t=this.filterTypeKeys[e];return t?`filterSummary${t}`:null}formatValue(e){const t=this.valueFormatter;return t?t(e??null)??"":String(e)}},BC=class extends Ku{constructor(e,t){super(e,t,s=>{const{dataTypeSvc:o,valueSvc:i}=this.beans,n=t.column,r=o?.getDateFormatterFunction(n),a=r?r(s??void 0):s;return i.formatValue(n,null,a)}),this.filterTypeKeys=GC}conditionToString(e,t,s,o,i){const{type:n}=e,r=It(e.dateFrom),a=It(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,c=t?this.formatValue.bind(this):h=>Sd(h,l),d=()=>r!==null?c(r):"null",u=()=>a!==null?c(a):"null";if(t){const h=this.conditionForToolPanel(n,s,d,u,o,i);if(h!=null)return h}return s?`${d()}-${u()}`:r!=null?c(r):`${n}`}};function hT(e,t){const s=t;return s<e?-1:s>e?1:0}var gT=class extends HC{constructor(){super(OC,qu),this.filterType="date",this.FilterModelFormatterClass=BC}comparator(){return this.params.filterParams.comparator??hT}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}},VC=class extends Xe{constructor(){super(...arguments),this.defaultDebounceMs=0}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.defaultOption;return}const t=e.operator;let s;t?s=e.conditions[0]:s=e,this.lastType=s.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const s=e;return this.isTypeEditable(s.type)}init(e){this.params=e;const t=this.gos.get("enableFilterHandlers");if(this.reactive=t,this.setParams(e),t){const s=e;this.onModelUpdated(s.model)}}setParams(e){const t=new Uu;this.optionsFactory=t,t.init(e.filterParams,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(t,e.filterParams)),this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){const s=this.optionsFactory.defaultOption;t||(this.lastType=s),this.readOnly=!!e.filterParams.readOnly;const o=this.isTypeEditable(s);this.setEditable(o)}refresh(e){this.params=e;const t=e,s=this.reactive;if((!s||t.source==="colDef")&&this.updateParams(e),s){const{source:o,model:i}=t;if(o==="dataChanged"||o==="ui")return;this.onModelUpdated(i)}}updateParams(e){const t=this.optionsFactory;t.refresh(e.filterParams,this.defaultOptions),this.setSimpleParams(e),this.filterModelFormatter.updateParams({optionsFactory:t,filterParams:e.filterParams})}onParentModelChanged(e,t){t?.afterFloatingFilter||t?.afterDataChange||this.onModelUpdated(e)}hasSingleInput(e){const t=this.optionsFactory.getCustomOption(e)?.numberOfInputs;return t==null||t==1}isTypeEditable(e){const t=["inRange","empty","blank","notBlank"];return!!e&&!this.readOnly&&this.hasSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0)} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},pT={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eReadOnlyText"},{tag:"div",ref:"eDateWrapper",cls:"ag-date-floating-filter-wrapper"}]},fT=class extends VC{constructor(){super(pT,[ul]),this.eReadOnlyText=ve,this.eDateWrapper=ve,this.FilterModelFormatterClass=BC,this.filterType="date",this.defaultOptions=qu}setParams(e){super.setParams(e),this.createDateComponent();const t=this.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}updateParams(e){super.updateParams(e),this.dateComp.updateParams(this.getDateComponentParams()),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.readOnly&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){const s=e?It(e.dateFrom):null;this.dateComp.setDate(s),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){Ye(this.eDateWrapper,e),Ye(this.eReadOnlyText.getGui(),!e)}onModelUpdated(e){super.setLastTypeFromModel(e),this.updateCompOnModelChange(e)}onDateChanged(){const e=this.dateComp.getDate();if(this.reactive){const t=this.params;t.onUiChange();const s=t.model,o=zt(e),i=o==null?null:{...s??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:o};t.onModelChange(i,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t?.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=Iu(e,this.defaultDebounceMs);return we(this.gos,{onDateChanged:lt(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:s,params:o}=this;this.dateComp=new LC(e,t,o.column.getColDef(),this.getDateComponentParams(),s,i=>{i.setInputAriaLabel(this.getAriaLabel(o))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},mT={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},CT=class extends Xe{constructor(){super(mT,[ul]),this.eDateInput=ve,this.isApply=!1,this.applyOnFocusOut=!1}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus({preventScroll:!0})},input:this.handleInput.bind(this,!1),change:this.handleInput.bind(this,!0),focusout:this.handleFocusOut.bind(this)})}handleInput(e){if(!this.eDateInput.isDisabled()){if(this.isApply){this.applyOnFocusOut=!e,e&&this.params.onDateChanged();return}e||this.params.onDateChanged()}}handleFocusOut(){this.applyOnFocusOut&&(this.applyOnFocusOut=!1,this.params.onDateChanged())}setParams(e){const t=this.eDateInput.getInputElement(),s=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=s&&ao();const{minValidYear:o,maxValidYear:i,minValidDate:n,maxValidDate:r,buttons:a,includeTime:l,colDef:c}=e.filterParams||{},d=this.beans.dataTypeSvc,u=l??d?.getDateIncludesTimeFlag?.(c.cellDataType)??!1;if(s?u?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text",n&&o&&z(85),r&&i&&z(86),n&&r){const[h,p]=[n,r].map(m=>m instanceof Date?m:It(m));h&&p&&h.getTime()>p.getTime()&&z(87)}n?n instanceof Date?t.min=Sd(n):t.min=n:o&&(t.min=`${o}-01-01`),r?r instanceof Date?t.max=Sd(r):t.max=r:i&&(t.max=`${i}-12-31`),this.isApply=e.location==="floatingFilter"&&!!a?.includes("apply")}refresh(e){this.params=e,this.setParams(e)}getDate(){return It(this.eDateInput.getValue())}setDate(e){const t=this.params.filterParams.colDef.cellDataType,s=this.beans.dataTypeSvc?.getDateIncludesTimeFlag(t)??!1;this.eDateInput.setValue(zt(e,s))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e?.suppressFocus||this.eDateInput.getInputElement().focus({preventScroll:!0})}shouldUseBrowserDatePicker(e){return e?.filterParams?.browserDatePicker??!0}},Yu=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function Bd(e){const{allowedCharPattern:t}=e??{};return t??null}function Vd(e){return e==null||isNaN(e)?null:e}function zC(e,t){const{filter:s,filterTo:o,type:i}=e||{};return[Vd(s),Vd(o)].slice(0,tr(i,t))}var vT=class extends $u{constructor(){super("numberFilter",zC,Yu),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}setElementValue(e,t,s){const{numberFormatter:o}=this.params,i=!s&&o?o(t??null):t;super.setElementValue(e,i)}createEValue(){const e=Bd(this.params),t=Rt({tag:"div",cls:"ag-filter-body",role:"presentation"});return this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,s,o){const i=this.createManagedBean(o?new jo({allowedCharPattern:o}):new Fu);i.addCss(`ag-filter-${s}`),i.addCss("ag-filter-filter"),t.push(i),e.appendChild(i.getGui())}removeEValues(e,t){const s=o=>this.removeComponents(o,e,t);s(this.eValuesFrom),s(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(s,o,i,n)=>{o<n&&t.push(Vd(this.stringToFloat(s.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}stringToFloat(e){if(typeof e=="number")return e;let t=ks(e);t!=null&&t.trim()===""&&(t=null);const s=this.params.numberParser;return s?s(t):t==null||t.trim()==="-"?null:Number.parseFloat(t)}createCondition(e){const t=this.getConditionType(e),s={filterType:this.filterType,type:t},o=this.getValues(e);return o.length>0&&(s.filter=o[0]),o.length>1&&(s.filterTo=o[1]),s}getInputs(e){const{eValuesFrom:t,eValuesTo:s}=this;return e>=t.length?[null,null]:[t[e],s[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}},WC=class extends Ku{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=GC}conditionToString(e,t,s,o,i){const{filter:n,filterTo:r,type:a}=e,l=this.formatValue.bind(this);if(t){const c=this.conditionForToolPanel(a,s,()=>l(n),()=>l(r),o,i);if(c!=null)return c}return s?`${l(n)}-${l(r)}`:n!=null?l(n):`${a}`}},wT=class extends HC{constructor(){super(zC,Yu),this.filterType="number",this.FilterModelFormatterClass=WC}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}},_C=class extends O{constructor(e){super(),this.params=e,this.eInput=ve,this.onValueChanged=()=>{}}setupGui(e){this.eInput=this.createManagedBean(new jo(this.params?.config));const t=this.eInput.getGui();e.appendChild(t);const s=o=>this.onValueChanged(o);this.addManagedListeners(t,{input:s,keydown:s})}setEditable(e){this.eInput.setDisabled(!e)}getValue(){return this.eInput.getValue()}setValue(e,t){this.eInput.setValue(e,t)}setValueChangedListener(e){this.onValueChanged=e}setParams({ariaLabel:e,autoComplete:t}){const{eInput:s}=this;s.setInputAriaLabel(e),t!==void 0&&s.setAutoComplete(t)}};function zd(e){const t=e?.trim();return t===""?e:t}function jC(e,t){const{filter:s,filterTo:o,type:i}=e||{};return[s||null,o||null].slice(0,tr(i,t))}var bT={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},UC=class extends VC{constructor(){super(...arguments),this.eFloatingFilterInputContainer=ve,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(bT)}onModelUpdated(e){this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(e))}setParams(e){this.setupFloatingFilterInputService(e),super.setParams(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.inputSvc=this.createFloatingFilterInputService(e),this.inputSvc.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){const t=e.browserAutoComplete??!1,{inputSvc:s,defaultDebounceMs:o,readOnly:i}=this;if(s.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=gl(e.filterParams),!i){const n=Iu(e.filterParams,o),r=lt(this,this.syncUpWithParentFilter.bind(this),n);s.setValueChangedListener(r)}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const{inputSvc:t}=this,s=t.getValue();Mt(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(s,!0)}syncUpWithParentFilter(e){const t=e.key===I.ENTER,s=this.reactive;if(s&&this.params.onUiChange(),this.applyActive&&!t)return;const{inputSvc:o,params:i,lastType:n}=this;let r=o.getValue();if(i.filterParams.trimInput&&(r=zd(r),o.setValue(r,!0)),s){const a=i,l=a.model,c=this.convertValue(r),d=c==null?null:{...l??{filterType:this.filterType,type:n??this.optionsFactory.defaultOption},filter:c};a.onModelChange(d,{afterFloatingFilter:!0})}else i.parentFilterInstance(a=>{a?.onFloatingFilterChanged(n||null,r||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},ST=class extends O{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new Fu),this.eTextInput=this.createManagedBean(new jo),this.eTextInput.setDisabled(!0);const t=this.eNumberInput.getGui(),s=this.eTextInput.getGui();e.appendChild(t),e.appendChild(s),this.setupListeners(t,o=>this.onValueChanged(o)),this.setupListeners(s,o=>this.onValueChanged(o))}setEditable(e){this.numberInputActive=e,this.eNumberInput.setDisplayed(this.numberInputActive),this.eTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eNumberInput.setAutoComplete(e),this.eTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eNumberInput:this.eTextInput}setValueChangedListener(e){this.onValueChanged=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},yT=class extends UC{constructor(){super(...arguments),this.FilterModelFormatterClass=WC,this.filterType="number",this.defaultOptions=Yu}updateParams(e){Bd(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=Bd(e.filterParams),this.allowedCharPattern?this.createManagedBean(new _C({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new ST)}convertValue(e){return e?Number(e):null}},Zu=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],xT=class extends $u{constructor(){super("textFilter",jC,Zu),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),s={filterType:this.filterType,type:t},o=this.getValues(e);return o.length>0&&(s.filter=o[0]),o.length>1&&(s.filterTo=o[1]),s}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:s}=this;return e>=t.length?[null,null]:[t[e],s[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(s,o,i,n)=>{o<n&&t.push(ks(s.getValue()))}),t}createEValue(){const e=Rt({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:s}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,s,"to"),e}createFromToElement(e,t,s){const o=this.createManagedBean(new jo);o.addCss(`ag-filter-${s}`),o.addCss("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeEValues(e,t){const s=n=>this.removeComponents(n,e,t),{eValuesFrom:o,eValuesTo:i}=this;s(o),s(i)}},$C=class extends Ku{constructor(){super(...arguments),this.filterTypeKeys=uT}conditionToString(e,t,s,o,i){const{filter:n,filterTo:r,type:a}=e;if(t){const l=d=>()=>Zs(this,"filterSummaryTextQuote",[d]),c=this.conditionForToolPanel(a,s,l(n),l(r),o,i);if(c!=null)return c}return s?`${n}-${r}`:n!=null?`${n}`:`${a}`}},RT=({filterOption:e,value:t,filterText:s})=>{if(s==null)return!1;switch(e){case"contains":return t.includes(s);case"notContains":return!t.includes(s);case"equals":return t===s;case"notEqual":return t!=s;case"startsWith":return t.indexOf(s)===0;case"endsWith":{const o=t.lastIndexOf(s);return o>=0&&o===t.length-s.length}default:return!1}},FT=e=>e,ET=e=>e==null?null:e.toString().toLowerCase(),DT=class extends NC{constructor(){super(jC,Zu),this.filterType="text",this.FilterModelFormatterClass=$C}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??RT,this.formatter=t.textFormatter??(t.caseSensitive?FT:ET)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,s,o){const i=e.map(h=>this.formatter(h))||[],n=this.formatter(t),{api:r,colDef:a,column:l,context:c,filterParams:{textFormatter:d}}=this.params;if(s.type==="blank")return Ka(t);if(s.type==="notBlank")return!Ka(t);const u={api:r,colDef:a,column:l,context:c,node:o.node,data:o.data,filterOption:s.type,value:n,textFormatter:d};return i.some(h=>this.matcher({...u,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=s=>{const o={...s},{filter:i,filterTo:n}=s;return i&&(o.filter=zd(i)??null),n&&(o.filterTo=zd(n)??null),o};return Im(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},PT=class extends UC{constructor(){super(...arguments),this.FilterModelFormatterClass=$C,this.filterType="text",this.defaultOptions=Zu}createFloatingFilterInputService(){return this.createManagedBean(new _C)}};function TT(e){return!!e.quickFilter?.isFilterPresent()}function MT(e){return e.quickFilter?.getText()}function IT(e){e.quickFilter?.resetCache()}var kT=class extends O{constructor(){super(...arguments),this.beanName="quickFilter",this.quickFilter=null,this.quickFilterParts=null}postConstruct(){const e=this.resetCache.bind(this),t=this.gos;this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{t.get("includeHiddenColumnsInQuickFilter")||this.resetCache()}}),this.addManagedPropertyListener("quickFilterText",s=>this.setFilter(s.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onColumnConfigChanged()),this.quickFilter=this.parseFilter(t.get("quickFilterText")),this.parser=t.get("quickFilterParser"),this.matcher=t.get("quickFilterMatcher"),this.setFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setParserAndMatcher())}refreshCols(){const{autoColSvc:e,colModel:t,gos:s,pivotResultCols:o}=this.beans,i=t.isPivotMode(),n=e?.getColumns(),r=t.getColDefCols();let a=(i&&!s.get("applyQuickFilterBeforePivotOrAgg")?o?.getPivotResultCols()?.list:r)??[];n&&(a=a.concat(n)),this.colsToUse=s.get("includeHiddenColumnsInQuickFilter")?a:a.filter(l=>l.isVisible()||l.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(s=>t?this.doesRowPassCache(e,s):this.doesRowPassNoCache(e,s))}resetCache(){this.beans.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){const{quickFilter:e,parser:t}=this;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseFilter(e){return X(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){z(70,{newFilter:e});return}const t=this.parseFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),s=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,s&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some(s=>{const o=this.getTextForColumn(s,e);return X(o)&&o.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let s;e?(this.checkGenerateAggText(t),s=t.quickFilterAggregateText):s=this.getAggText(t);const{quickFilterParts:o,matcher:i}=this;return i(o,s)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let s=this.beans.filterValueSvc.getValue(e,t);const o=e.getColDef();if(o.getQuickFilterText){const i=we(this.gos,{value:s,node:t,data:t.data,column:e,colDef:o});s=o.getQuickFilterText(i)}return X(s)?s.toString().toUpperCase():null}getAggText(e){const t=[];for(const s of this.colsToUse){const o=this.getTextForColumn(s,e);X(o)&&t.push(o)}return t.join(`
60
60
  `)}},AT={moduleName:"ClientSideRowModelFilter",version:Z,rowModels:["clientSide"],beans:[L4]},Xu={moduleName:"FilterCore",version:Z,beans:[sT],apiFunctions:{isAnyFilterPresent:eT,onFilterChanged:tT},css:[V4],dependsOn:[AT]},qC={moduleName:"FilterValue",version:Z,beans:[iT]},vl={moduleName:"ColumnFilter",version:Z,beans:[J4,oT],dynamicBeans:{headerFilterCellCtrl:O4},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:z4,getColumnFilterInstance:W4,destroyFilter:_4,setFilterModel:j4,getFilterModel:U4,getColumnFilterModel:$4,setColumnFilterModel:q4,showColumnFilter:K4,hideColumnFilter:Y4,getColumnFilterHandler:Z4,doFilterAction:X4},dependsOn:[Xu,Cl,qC,G4]},LT={moduleName:"CustomFilter",version:Z,userComponents:{agReadOnlyFloatingFilter:rT},dependsOn:[vl]},OT={moduleName:"TextFilter",version:Z,dependsOn:[vl],userComponents:{agTextColumnFilter:{classImp:xT,params:{useForm:!0}},agTextColumnFloatingFilter:PT},dynamicBeans:{agTextColumnFilterHandler:DT}},NT={moduleName:"NumberFilter",version:Z,dependsOn:[vl],userComponents:{agNumberColumnFilter:{classImp:vT,params:{useForm:!0}},agNumberColumnFloatingFilter:yT},dynamicBeans:{agNumberColumnFilterHandler:wT}},HT={moduleName:"DateFilter",version:Z,dependsOn:[vl],userComponents:{agDateColumnFilter:{classImp:dT,params:{useForm:!0}},agDateInput:CT,agDateColumnFloatingFilter:fT},dynamicBeans:{agDateColumnFilterHandler:gT}},GT={moduleName:"QuickFilterCore",version:Z,rowModels:["clientSide"],beans:[kT],dependsOn:[Xu,qC]},BT={moduleName:"QuickFilter",version:Z,apiFunctions:{isQuickFilterPresent:TT,getQuickFilter:MT,resetQuickFilter:IT},dependsOn:[GT]},VT={moduleName:"ExternalFilter",version:Z,dependsOn:[Xu]},zT=".ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-cell-editor-tooltip){background-color:var(--ag-tooltip-error-background-color);border:var(--ag-tooltip-error-border);color:var(--ag-tooltip-error-text-color);font-weight:500}}.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}",Hc=(e,t,s)=>{const{editModelSvc:o}=e,i=o?.getCellValidationModel()?.getCellValidation(t)?.errorMessages,n=o?.getRowValidationModel().getRowValidation(t)?.errorMessages,r=i||n;return r?.length?r.join(s("tooltipValidationErrorSeparator",". ")):void 0},WT=class extends O{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,s,o){e&&t.destroyBean(e);const i=this.gos,n=Nc(i),{column:r,eGui:a}=t,l=r.getColDef();!o&&n&&!l.headerComponent&&(o=ca(()=>a.querySelector(".ag-header-cell-text")));const c="header",u=this.beans.colNames.getDisplayNameForColumn(r,"header",!0),h=s??u,p={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>s??l?.headerTooltipValueGetter?.(we(i,{location:c,colDef:l,column:r,value:h,valueFormatted:u}))??l?.headerTooltip,shouldDisplayTooltip:o,getAdditionalParams:()=>({column:r,colDef:r.getColDef()})};let m=this.createTooltipFeature(p);return m&&(m=t.createBean(m),t.setRefreshFunction("tooltip",()=>m.refreshTooltip())),m}setupHeaderGroupTooltip(e,t,s,o){e&&t.destroyBean(e);const i=this.gos,n=Nc(i),{column:r,eGui:a}=t,l=r.getColGroupDef();!o&&n&&!l?.headerGroupComponent&&(o=ca(()=>a.querySelector(".ag-header-group-text")));const c="headerGroup",u=this.beans.colNames.getDisplayNameForColumnGroup(r,"header"),h=s??u,p={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>s??l?.headerTooltipValueGetter?.(we(i,{location:c,colDef:l,column:r,value:h,valueFormatted:u}))??l?.headerTooltip,shouldDisplayTooltip:o,getAdditionalParams:()=>{const C={column:r};return l&&(C.colDef=l),C}},m=this.createTooltipFeature(p);return m&&t.createBean(m)}enableCellTooltipFeature(e,t,s){const{beans:o}=this,{gos:i,editSvc:n}=o,{column:r,rowNode:a}=e;let l="cell";const c=()=>{const p=!!!n?.isEditing(e)&&Hc(o,e,this.getLocaleTextFunc());if(p)return l="cellEditor",p;l="cell";const m=r.getColDef(),C=a.data;if(m.tooltipField&&X(C))return Hn(C,m.tooltipField,r.isTooltipFieldContainsDots());const v=m.tooltipValueGetter;return v?v(we(i,{location:"cell",colDef:r.getColDef(),column:r,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},d=Nc(i);s||(d&&!e.isCellRenderer()?s=()=>{const h=!!n?.isEditing(e);if(!h&&Hc(o,e,this.getLocaleTextFunc()))return!0;if(!r.isTooltipEnabled())return!1;const C=ca(()=>{const v=e.eGui;return v.children.length===0?v:v.querySelector(".ag-cell-value")});return!h&&C()}:s=()=>!n?.isEditing(e));const u={getGui:()=>e.eGui,getLocation:()=>l,getTooltipValue:t!=null?()=>t:c,shouldDisplayTooltip:s,getAdditionalParams:()=>({column:r,colDef:r.getColDef(),rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(u,o)}setupFullWidthRowTooltip(e,t,s,o){const i={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>s,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:o},n=this.beans,r=n.context;e&&t.destroyBean(e,r);const a=this.createTooltipFeature(i,n);if(a)return t.createBean(a,r)}setupCellEditorTooltip(e,t){const{beans:s}=this,{context:o}=s,i=t.getValidationElement?.(!0)||!t.isPopup?.()&&e.eGui;if(!i)return;const n={getGui:()=>i,getTooltipValue:()=>Hc(s,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{const{editModelSvc:a}=s,l=a?.getRowValidationModel()?.getRowValidationMap(),c=a?.getCellValidationModel()?.getCellValidationMap(),d=!!l&&l.size>0,u=!!c&&c.size>0;return d||u}},r=this.createTooltipFeature(n,s);if(r)return e.createBean(r,o)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=X(t.tooltipField)||X(t.tooltipValueGetter)||X(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},_T=class extends IR{createTooltipComp(e,t){xx(this.beans.userCompFactory,e)?.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){this.onColumnMovedEventCallback?.(),this.onColumnMovedEventCallback=void 0}},KC={moduleName:"Tooltip",version:Z,beans:[WT],dynamicBeans:{tooltipFeature:Sm,highlightTooltipFeature:kR,tooltipStateManager:_T},userComponents:{agTooltipComponent:OR},dependsOn:[Cl],css:[zT]},fi=class{constructor(e){this.cellValueChanges=e}},Gc=class extends fi{constructor(e,t,s,o){super(e),this.initialRange=t,this.finalRange=s,this.ranges=o}},jT=10,tp=class{constructor(e){this.actionStack=[],this.maxStackSize=e||jT,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}},UT=class extends O{constructor(){super(...arguments),this.beanName="undoRedo",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.batchEditing=!1,this.bulkEditing=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},s=this.activeCellEdit!==null&&Qm(this.activeCellEdit,t),o=this.activeRowEdit!==null&&aE(this.activeRowEdit,t);if(!(s||o||this.isPasting||this.isRangeInAction))return;const{rowPinned:n,rowIndex:r,column:a,oldValue:l,value:c}=e,d={rowPinned:n,rowIndex:r,columnId:a.getColId(),newValue:c,oldValue:l};this.cellValueChanges.push(d)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}postConstruct(){const{gos:e,ctrlsSvc:t}=this.beans;if(!e.get("undoRedoCellEditing"))return;const s=e.get("undoRedoCellEditingLimit");if(s<=0)return;this.undoStack=new tp(s),this.redoStack=new tp(s),this.addListeners();const o=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:i=>{i.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:o,newColumnsLoaded:o,columnGroupOpened:o,columnRowGroupChanged:o,columnMoved:o,columnPinned:o,columnVisible:o,rowDragEnd:o}),t.whenReady(this,i=>{this.gridBodyCtrl=i.gridBodyCtrl})}getCurrentUndoStackSize(){return this.undoStack?.getCurrentStackSize()??0}getCurrentRedoStackSize(){return this.redoStack?.getCurrentStackSize()??0}undo(e){const{eventSvc:t,undoStack:s,redoStack:o}=this;t.dispatchEvent({type:"undoStarted",source:e});const i=this.undoRedo(s,o,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:i})}redo(e){const{eventSvc:t,undoStack:s,redoStack:o}=this;t.dispatchEvent({type:"redoStarted",source:e});const i=this.undoRedo(o,s,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:i})}undoRedo(e,t,s,o,i){if(!e)return!1;const n=e.pop();return n?.cellValueChanges?(this.processAction(n,r=>r[o],i),n instanceof Gc?this.processRange(n.ranges||[n[s]]):this.processCell(n.cellValueChanges),t.push(n),!0):!1}processAction(e,t,s){for(const o of e.cellValueChanges){const{rowIndex:i,rowPinned:n,columnId:r}=o,a={rowIndex:i,rowPinned:n},l=Ns(this.beans,a);l.displayed&&l.setDataValue(r,t(o),s)}}processRange(e){let t;const s=this.beans.rangeSvc;s.removeAllCellRanges(!0),e.forEach((o,i)=>{if(!o)return;const n=o.startRow,r=o.endRow;i===e.length-1&&(t={rowPinned:n.rowPinned,rowIndex:n.rowIndex,columnId:o.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:o.startColumn,columns:o.columns};s.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:s,rowPinned:o}=t,i={rowIndex:s,rowPinned:o},n=Ns(this.beans,i),r={rowPinned:t.rowPinned,rowIndex:n.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r)}setLastFocusedCell(e){const{rowIndex:t,columnId:s,rowPinned:o}=e,{colModel:i,focusSvc:n,rangeSvc:r}=this.beans,a=i.getCol(s);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:o};n.setFocusedCell({...c,forceBrowserFocus:!0}),r?.setRangeToCell(c)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new fi(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const s=new fi(this.cellValueChanges);this.pushActionsToUndoStack(s)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new fi(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new Gc(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;const{rangeSvc:t,gos:s}=this.beans;t&&so(s)?e=new Gc(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new fi(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1},batchEditingStarted:()=>this.startBigChange("batchEditing"),batchEditingStopped:({changes:e})=>this.stopBigChange("batchEditing",e),bulkEditingStarted:()=>this.startBigChange("bulkEditing"),bulkEditingStopped:({changes:e})=>this.stopBigChange("bulkEditing",e)})}startBigChange(e){this.updateBigChange(e,!0)}updateBigChange(e,t){e==="bulkEditing"?this.bulkEditing=t:this.batchEditing=t}stopBigChange(e,t){if(e==="bulkEditing"&&!this.bulkEditing||e==="batchEditing"&&!this.batchEditing||(this.updateBigChange(e,!1),t?.length===0))return;const s=new fi(t??[]);this.pushActionsToUndoStack(s),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},$T=".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) textarea{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}",qT={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},KT=class extends fl{constructor(){super(qT,[Ru]),this.eEditor=ve}initialiseEditor(e){const t=e.value??void 0,s=this.eEditor;s.setValue(t),s.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(s,{fieldValueChanged:i=>this.setAriaLabel(i.selected)})}getValue(){return this.eEditor.getValue()}focusIn(){this.eEditor.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.getLocaleTextFunc(),s=dl(t,e),o=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${o} (${s})`)}getValidationElement(e){return e?this.params.eGridCell:this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e,s=this.getValue();return t?t({value:s,internalErrors:null,cellEditorParams:e}):null}},wl=class extends fl{constructor(e){super(),this.cellEditorInput=e,this.eEditor=ve}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:s}=this,{cellStartedEdit:o,eventKey:i,suppressPreventDefault:n}=e;s.getInputElement().setAttribute("title",""),t.init(s,e);let r,a=!0;o?(this.focusAfterAttached=!0,i===I.BACKSPACE||i===I.DELETE?r="":i&&i.length===1?n?a=!1:r=i:(r=t.getStartValue(),i!==I.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,r=t.getStartValue()),a&&r!=null&&s.setStartValue(r),this.addGuiEventListener("keydown",l=>{const{key:c}=l;(c===I.PAGE_UP||c===I.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;ao()||t.getFocusableElement().focus();const s=t.getInputElement();this.highlightAllOnFocus?s.select():this.cellEditorInput.setCaret?.()}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),s=e.getInputElement();t.focus(),s.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}},YT={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},ZT=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return YT}getAgComponents(){return[hm]}init(e,t){this.eEditor=e,this.params=t;const{min:s,max:o,step:i,colDef:n}=t;s!=null&&e.setMin(s),o!=null&&e.setMax(o),i!=null&&e.setStep(i),this.includeTime=t.includeTime??this.getDataTypeService()?.getDateIncludesTimeFlag?.(n.cellDataType),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:s}=this,{min:o,max:i,getValidationErrors:n}=s;let r=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(o){const l=o instanceof Date?o:new Date(o);if(t<l){const c=l.toLocaleDateString();r.push(a("minDateValidation",`Date must be after ${c}`,[c]))}}if(i){const l=i instanceof Date?i:new Date(i);if(t>l){const c=l.toLocaleDateString();r.push(a("maxDateValidation",`Date must be before ${c}`,[c]))}}}return r.length||(r=null),n?n({value:t,cellEditorParams:s,internalErrors:r}):r}getValue(){const{eEditor:e,params:t}=this,s=e.getDate();return!X(s)&&!X(t.value)?t.value:s??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return zt(e,this.includeTime??!1)}},XT=class extends wl{constructor(){super(new ZT(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},QT={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},JT=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return QT}getAgComponents(){return[hm]}init(e,t){this.eEditor=e,this.params=t;const{min:s,max:o,step:i,colDef:n}=t;s!=null&&e.setMin(s),o!=null&&e.setMax(o),i!=null&&e.setStep(i),this.includeTime=t.includeTime??this.getDataTypeService()?.getDateIncludesTimeFlag?.(n.cellDataType),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,s=e.getInputElement().value,o=this.formatDate(this.parseDate(s??void 0)),{min:i,max:n,getValidationErrors:r}=t;let a=[];if(o){const l=new Date(o),c=this.getLocaleTextFunc();if(i){const d=new Date(i);if(l<d){const u=d.toLocaleDateString();a.push(c("minDateValidation",`Date must be after ${u}`,[u]))}}if(n){const d=new Date(n);if(l>d){const u=d.toLocaleDateString();a.push(c("maxDateValidation",`Date must be before ${u}`,[u]))}}}return a.length||(a=null),r?r({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,s=this.formatDate(t.getDate());return!X(s)&&!X(e.value)?e.value:e.parseValue(s??"")}getStartValue(){return zt(this.parseDate(this.params.value??void 0)??null,this.includeTime??!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):It(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):zt(e??null,this.includeTime??!1)??void 0}},eM=class extends wl{constructor(){super(new JT(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},tM={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},sM=class extends fl{constructor(){super(tM,[zx]),this.eEditor=ve}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:s,eventKey:o,maxLength:i,cols:n,rows:r}=e;this.focusAfterAttached=s,t.getInputElement().setAttribute("title",""),t.setMaxLength(i||200).setCols(n||60).setRows(r||10);let a;s?(this.focusAfterAttached=!0,o===I.BACKSPACE||o===I.DELETE?a="":o&&o.length===1?a=o:(a=this.getStartValue(e),o!==I.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,a=this.getStartValue(e)),a!=null&&t.setValue(a,!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}getStartValue(e){const{value:t}=e;return t?.toString()??t}onKeyDown(e){const t=e.key;(t===I.LEFT||t===I.UP||t===I.RIGHT||t===I.DOWN||e.shiftKey&&t===I.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:s}=this,o=this.getLocaleTextFunc();e.setInputAriaLabel(o("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),s&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:s}=t,o=e.getValue();return!X(o)&&!X(s)?s:t.parseValue(o)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:s}=e,o=this.getLocaleTextFunc(),i=this.getValue();let n=[];return typeof i=="string"&&t!=null&&i.length>t&&n.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),n.length||(n=null),s?s({value:i,internalErrors:n,cellEditorParams:e}):n}},oM={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},iM=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return oM}getAgComponents(){return[Wx]}init(e,t){this.eEditor=e,this.params=t;const{max:s,min:o,precision:i,step:n}=t;s!=null&&e.setMax(s),o!=null&&e.setMin(o),i!=null&&e.setPrecision(i),n!=null&&e.setStep(n);const r=e.getInputElement();t.preventStepping?e.addManagedElementListeners(r,{keydown:this.preventStepping}):t.showStepperButtons&&r.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:s,getValidationErrors:o}=e,n=this.eEditor.getInputElement().valueAsNumber,r=this.getLocaleTextFunc();let a=[];return typeof n=="number"&&(t!=null&&n<t&&a.push(r("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),s!=null&&n>s&&a.push(r("maxValueValidation",`Must be less than or equal to ${s}.`,[String(s)]))),a.length||(a=null),o?o({value:n,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===I.UP||e.key===I.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,s=e.getValue();if(!X(s)&&!X(t.value))return t.value;let o=t.parseValue(s);if(o==null)return o;if(typeof o=="string"){if(o==="")return null;o=Number(o)}return isNaN(o)?null:o}getStartValue(){return this.params.value}setCaret(){ao()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},nM=class extends wl{constructor(){super(new iM(()=>this.getLocaleTextFunc()))}},rM={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},aM=class extends fl{constructor(){super(rM,[Jx]),this.eEditor=ve,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:s,gos:o}=this,{values:i,value:n,eventKey:r}=e;if(qe(i)){z(58);return}this.startedByEnter=r!=null?r===I.ENTER:!1;let a=!1;i.forEach(u=>{const h={value:u},p=s.formatValue(e.column,null,u),m=p!=null;h.text=m?p:u,t.addOption(h),a=a||n===u}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:d}=e;l!=null&&t.setPickerGap(l),d!=null&&t.setPickerMaxHeight(d),c!=null&&t.setPickerMaxWidth(c),o.get("editType")!=="fullRow"&&this.addManagedListeners(this.eEditor,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eEditor.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eEditor.showPicker()})}focusIn(){this.eEditor.getFocusableElement().focus()}getValue(){return this.eEditor.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{values:t,getValidationErrors:s}=e,o=this.getValue();let i=[];if(t&&!t.includes(o)){const n=this.getLocaleTextFunc();i.push(n("invalidSelectionValidation","Invalid selection."))}else i=null;return s?s({value:o,internalErrors:i,cellEditorParams:e}):i}},lM={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},cM=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return lM}getAgComponents(){return[ul]}init(e,t){this.eEditor=e,this.params=t;const s=t.maxLength;s!=null&&e.setMaxLength(s)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:s}=e,o=this.getValue(),i=this.getLocaleTextFunc();let n=[];return t!=null&&typeof o=="string"&&o.length>t&&n.push(i("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),n.length||(n=null),s?s({value:o,cellEditorParams:e,internalErrors:n}):n}getValue(){const{eEditor:e,params:t}=this,s=e.getValue();return!X(s)&&!X(t.value)?t.value:t.parseValue(s)}getStartValue(){const e=this.params;return e.useFormatter||e.column.getColDef().refData?e.formatValue(e.value):e.value}setCaret(){ao()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),s=X(t)&&t.length||0;s&&e.getInputElement().setSelectionRange(s,s)}},sp=class extends wl{constructor(){super(new cM(()=>this.getLocaleTextFunc()))}};function dM(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function uM(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function YC(e,t,s="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,s),"ensureVisible")}function ZC(e,t,s){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,s),"ensureVisible")}function hM(e,t,s=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,s),"ensureVisible")}function gM(e){e.undoRedo?.undo("api")}function pM(e){e.undoRedo?.redo("api")}function fM(e,t){return e.editModelSvc?.getEditRowDataValue(t,{checkSiblings:!0})}function mM(e){const t=e.editModelSvc?.getEditMap(),s=[];return t?.forEach((o,i)=>{const{rowIndex:n,rowPinned:r}=i;o.forEach((a,l)=>{const{editorValue:c,pendingValue:d,sourceValue:u,state:h}=a,p=Is(a);let m=c??d;m===ts&&(m=void 0);const C={newValue:m,oldValue:u,state:h,column:l,colId:l.getColId(),colKey:l.getColId(),rowIndex:n,rowPinned:r};(h==="editing"||h==="changed"&&p)&&s.push(C)})}),s}function CM(e,t=!1){const{editSvc:s}=e;if(s?.isBatchEditing()){if(t)for(const o of e.editModelSvc?.getEditPositions()??[])o.state==="editing"&&s.revertSingleCellEdit(o);else bo(e,{persist:!0});Ti(e,void 0,{cancel:t})}else s?.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function vM(e,t){const s=Ue(e,t);return e.editSvc?.isEditing(s)??!1}function wM(e,t){const{key:s,colKey:o,rowIndex:i,rowPinned:n}=t,{editSvc:r,colModel:a}=e,l=a.getCol(o);if(!l){z(12,{colKey:o});return}const d=Ns(e,{rowIndex:i,rowPinned:n||null});if(!d){z(290,{rowIndex:i,rowPinned:n});return}if(!l.isCellEditable(d))return;n==null&&ZC(e,i),YC(e,o),r?.startEditing({rowNode:d,column:l},{event:s?new KeyboardEvent("keydown",{key:s}):void 0,source:"api"})}function bM(e){return e.editSvc?.validateEdit()||null}function SM(e){return e.undoRedo?.getCurrentUndoStackSize()??0}function yM(e){return e.undoRedo?.getCurrentRedoStackSize()??0}var xM={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},RM=class extends Su{constructor(e){super(xM),this.params=e}postConstruct(){Lo(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,s=o=>{Pd(this.gos,o,t.node,t.column,!0)||t.onKeyDown(o)};this.addManagedElementListeners(e,{keydown:s})}};function FM(e,{column:t},s,o,i="ui"){if(s instanceof KeyboardEvent&&(s.key===I.TAB||s.key===I.ENTER||s.key===I.F2||s.key===I.BACKSPACE&&o))return!0;if(s?.shiftKey&&e.rangeSvc?.getCellRanges().length!=0)return!1;const r=t?.getColDef(),a=EM(e.gos,r),l=s?.type;return l==="click"&&s?.detail===1&&a===1||l==="dblclick"&&s?.detail===2&&a===2?!0:i==="api"?o??!1:!1}function EM(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t?.singleClickEdit?1:2}function Wd(e,{rowNode:t,column:s},o="ui"){const i=s.getColDef().editable,n=e.editModelSvc;return s.isColumnFunc(t,i)||!!n&&n.hasEdits({rowNode:t,column:s},{withOpenEditor:!0})}function DM(e,t,s="ui"){const o=Wd(e,t,s);return o===!0||s==="ui"?o:e.colModel.getCols().some(n=>Wd(e,{rowNode:t.rowNode,column:n},s))}var Ya=(e,t=!1)=>{if(e!==void 0)return Is(e)||t&&e.state==="editing"};function XC(e,t,s=!1){return Ya(e.editModelSvc?.getEdit(t),s)}var QC=(e,t,s)=>{if(e)for(let o=0,i=e.length;o<i;++o){const n=e[o];if(n.data&&(Ya(t?.getEdit({rowNode:n,column:s}))||Ya(t?.getEdit({rowNode:n.pinnedSibling,column:s})))||QC(n.childrenAfterGroup,t,s))return!0}};function JC(e,t){const{column:s,rowNode:o}=t;return e.gos.get("groupTotalRow")&&!o?.footer?!1:QC(o?.childrenAfterGroup,e.editModelSvc,s)}function ev(e,{rowNode:t,column:s}){if(t=t.pinnedSibling,!!t)return Ya(e.editModelSvc?.getEdit({rowNode:t,column:s}))}var PM=class extends O{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}setComp(e){this.cellComp=e,this.applyCellStyles()}applyCellStyles(){const{cellCtrl:e,editSvc:t,beans:s}=this;if(t?.isBatchEditing()&&t.isEditing()){const i=XC(s,e)||JC(s,e)||ev(s,e);this.applyBatchingStyle(i)}else this.applyBatchingStyle(!1);const o=!!this.editModelSvc?.getCellValidationModel().hasCellValidation(this.cellCtrl);this.cellComp.toggleCss("ag-cell-editing-error",o)}applyBatchingStyle(e){this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&this.editSvc?.isBatchEditing())??!1)}},TM=class extends O{constructor(e,t){super(),this.rowCtrl=e,this.beans=t,this.gos=t.gos,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}applyRowStyles(){const{rowCtrl:e,editModelSvc:t,beans:s}=this;let o=e.rowNode,i=t?.getEditRow(o);const n=this.editModelSvc?.getRowValidationModel().hasRowValidation({rowNode:o});if(!i&&o.pinnedSibling&&(o=o.pinnedSibling,i=t?.getEditRow(o)),i){const r=Array.from(i.keys()).some(a=>{const l={rowNode:o,column:a};return XC(s,l,!0)||JC(s,l)||ev(s,l)});this.applyStyle(n,r);return}this.applyStyle(n)}applyStyle(e=!1,t=!1){const s=this.editSvc?.isBatchEditing()??!1,o=this.gos.get("editType")==="fullRow";this.rowCtrl?.forEachGui(void 0,({rowComp:i})=>{i.toggleCss("ag-row-editing",o&&t),i.toggleCss("ag-row-batch-edit",o&&t&&s),i.toggleCss("ag-row-inline-editing",t),i.toggleCss("ag-row-not-inline-editing",!t),i.toggleCss("ag-row-editing-invalid",o&&t&&e)})}},MM=({rowModel:e,pinnedRowModel:t,editModelSvc:s},o)=>{const i=new Set;e.forEachNode(n=>o.has(n)&&i.add(n)),t?.forEachPinnedRow("top",n=>o.has(n)&&i.add(n)),t?.forEachPinnedRow("bottom",n=>o.has(n)&&i.add(n));for(const n of o)i.has(n)||s.removeEdits({rowNode:n});return i},IM=({editModelSvc:e},t,s)=>{for(const o of t)e?.getEditRow(o)?.forEach((i,n)=>!s.has(n)&&e.removeEdits({rowNode:o,column:n}))},kM=e=>()=>{const t=new Set(e.colModel.getCols()),s=e.editModelSvc.getEditMap(!0),o=new Set(s.keys());IM(e,MM(e,o),t)},AM=new Set(["undo","redo","paste","bulk","rangeSvc"]),LM=new Set(["ui","api"]),tv={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},OM=new Set(Object.keys(tv)),NM=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),ia={cancel:!0,source:"api"},HM={cancel:!1,source:"api"},hi={checkSiblings:!0},bn={force:!0,suppressFlash:!0},GM=class extends O{constructor(){super(...arguments),this.beanName="editSvc",this.batch=!1,this.stopping=!1,this.committing=!1}postConstruct(){const{beans:e}=this;this.model=e.editModelSvc,this.valueSvc=e.valueSvc,this.rangeSvc=e.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:o})=>{this.stopEditing(void 0,ia),this.createStrategy(o)});const t=kM(e),s=()=>{const o=this.model.getCellValidationModel().getCellValidationMap().size>0,i=this.model.getRowValidationModel().getRowValidationMap().size>0;return o||i?this.stopEditing(void 0,ia):this.isEditing()&&(this.isBatchEditing()?Ti(e,this.model.getEditPositions()):this.stopEditing(void 0,HM)),!1};this.addManagedEventListeners({columnPinned:t,columnVisible:t,columnRowGroupChanged:t,rowExpansionStateChanged:t,pinnedRowsChanged:t,displayedRowsChanged:t,sortChanged:s,filterChanged:s,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}setBatchEditing(e){e?(this.batch=!0,this.stopEditing(void 0,ia)):(this.stopEditing(void 0,ia),this.batch=!1)}createStrategy(e){const{beans:t,gos:s,strategy:o}=this,i=op(s,e);if(o){if(o.beanName===i)return o;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(i,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,s,o="ui"){const i=FM(this.beans,e,t,s,o);return i&&(this.strategy??(this.strategy=this.createStrategy())),i}shouldStopEditing(e,t,s="ui"){return this.strategy?.shouldStop(e,t,s)??null}shouldCancelEditing(e,t,s="ui"){return this.strategy?.shouldCancel(e,t,s)??null}validateEdit(){return JP(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??hi)}isRowEditing(e,t){return(e&&this.model.hasRowEdits(e,t))??!1}startEditing(e,t){const{startedEdit:s=!0,event:o=null,source:i="ui",ignoreEventKey:n=!1,silent:r}=t;if(this.strategy??(this.strategy=this.createStrategy()),!this.isCellEditable(e,"api"))return;const a=Ue(this.beans,e);if(a&&!a.comp){a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const l=this.shouldStartEditing(e,o,s,i);if(l===!1&&i!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,i)&&!t.continueEditing&&this.stopEditing(void 0,{source:i}),l&&this.isBatchEditing()&&this.dispatchBatchEvent("batchEditingStarted",new Map),this.strategy.start({position:e,event:o,source:i,ignoreEventKey:n,startedEdit:s,silent:r})}stopEditing(e,t){const{event:s,cancel:o,source:i="ui",forceCancel:n,forceStop:r}=t||{},{beans:a,model:l}=this;if(OM.has(i)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const c=this.committing?tv[i]:i;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,hi))||!this.strategy||this.stopping)return!1;this.stopping=!0;const u=Ue(a,e);u&&(u.onEditorAttachedFuncs=[]);let h=l.getEditMap(!0),p=!1;const m=!o&&(!!this.shouldStopEditing(e,s,c)||this.committing&&!this.batch)||(r??!1),C=o&&!!this.shouldCancelEditing(e,s,c)||(n??!1);if(m||C){bo(a,{persist:!0,isCancelling:C||o,isStopping:m});const v=l.getEditMap(),w=this.processEdits(v,o,i);this.strategy?.stop(o,s);for(const b of w)l.clearEditValue(b);this.bulkRefresh(void 0,h);for(const b of l.getEditPositions(v)){const S=Ue(a,b),x=Is(b);S?.refreshCell({force:!0,suppressFlash:!x})}h=v,p||(p=m)}else if(s instanceof KeyboardEvent&&this.batch&&this.strategy?.midBatchInputsAllowed(e)&&this.isEditing(e,{withOpenEditor:!0})){const{key:v}=s,w=v===I.ENTER,b=v===I.ESCAPE,S=v===I.TAB;(w||S||b)&&(w||S?bo(a,{persist:!0}):b&&this.revertSingleCellEdit(u),this.isBatchEditing()?this.strategy?.cleanupEditors():Ti(a,l.getEditPositions(),{event:s,cancel:b}),s.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else bo(a,{persist:!0}),h=l.getEditMap();return p&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,u?.cellPosition),Nd(a),this.model.hasEdits()||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()),this.bulkRefresh(),C&&this.beans.rowRenderer.refreshRows({rowNodes:Array.from(h.keys())}),this.isBatchEditing()&&(this.beans.rowRenderer.refreshRows({suppressFlash:!0,force:!0}),p&&m&&this.dispatchBatchEvent("batchEditingStopped",h)),this.stopping=!1,p}navigateAfterEdit(e,t){if(!e||!t)return;const{event:s,suppressNavigateAfterEdit:o}=e;if(!(s instanceof KeyboardEvent)||o)return;const{key:n,shiftKey:r}=s,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(n!==I.ENTER||!a)return;const l=r?I.UP:I.DOWN;this.beans.navigation?.navigateToNextCell(null,l,t,!1)}processEdits(e,t=!1,s){const o=Array.from(e.keys()),i=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,n=[];for(const r of o){const a=e.get(r);for(const l of a.keys()){const c=a.get(l),d={rowNode:r,column:l},u=Is(c);!t&&u&&!i&&(this.setNodeDataValue(r,l,c.pendingValue,void 0,s)||n.push(d))}}return n}setNodeDataValue(e,t,s,o,i="edit"){const{beans:n}=this,r=Ue(n,{rowNode:e,column:t}),a=LM.has(i)?"edit":i;r&&(r.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,s,a);return r&&(r.suppressRefreshCell=!1),o&&r?.refreshCell(bn),l}setEditMap(e,t){this.strategy??(this.strategy=this.createStrategy()),this.strategy?.setEditMap(e,t),this.bulkRefresh();let s=bn;t?.forceRefreshOfEditCellsOnly&&(s={...BM(e),...bn}),this.beans.rowRenderer.refreshCells(s)}dispatchEditValuesChanged({rowNode:e,column:t},s={}){if(!e||!t||!s)return;const{pendingValue:o,sourceValue:i}=s,{rowIndex:n,rowPinned:r,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:n,rowPinned:r,column:t,source:"api",data:a,newValue:o,oldValue:i,value:o,colDef:t.getColDef()})}bulkRefresh(e={},t,s={}){const{beans:o,gos:i}=this,{editModelSvc:n,rowModel:r}=o;Qe(i)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),s):t&&n?.getEditMap(!1)?.forEach((a,l)=>{for(const c of a.keys())this.refCell({rowNode:l,column:c},a.get(c),s)}))}refCell({rowNode:e,column:t},s,o={}){const{beans:i,gos:n}=this,r=new Set([e]),a=new Set,l=e.pinnedSibling;l&&r.add(l);const c=e.sibling;c&&a.add(c);let d=e.parent;for(;d;)d.sibling?.footer&&n.get("groupTotalRow")||!d.parent&&d.sibling&&n.get("grandTotalRow")?a.add(d.sibling):a.add(d),d=d.parent;for(const u of r)this.dispatchEditValuesChanged({rowNode:u,column:t},s);for(const u of r)Ue(i,{rowNode:u,column:t})?.refreshCell(o);for(const u of a)Ue(i,{rowNode:u,column:t})?.refreshCell(o)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{rowNode:s}=e,{gos:o,beans:i}=this;if(s.group){if(o.get("treeData")){if(!s.data&&!o.get("enableGroupEdit"))return!1}else if(!o.get("enableGroupEdit"))return!1}const n=op(o)==="fullRow"?DM(i,e,t):Wd(i,e,t);return n&&(this.strategy??(this.strategy=this.createStrategy())),n}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,s=!0){if(this.hasValidationErrors(e)){const o=Ue(this.beans,e);return this.cellEditingInvalidCommitBlocks()?(t?.preventDefault?.(),s&&(!o?.hasBrowserFocus()&&o?.focusCell(),o?.comp?.getCellEditor()?.focusIn?.()),"block-stop"):(o&&this.revertSingleCellEdit(o),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){const s=Ue(this.beans,e);s?.comp?.getCellEditor()&&(Ti(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),Gi(this.beans,e,{silent:!0}),Ho(this.beans),s?.refreshCell(bn),t&&(s?.focusCell(),s?.comp?.getCellEditor()?.focusIn?.()))}hasValidationErrors(e){Ho(this.beans);const t=Ue(this.beans,e);t&&(t.refreshCell(bn),t.rowCtrl.rowEditStyleFeature?.applyRowStyles());let s=!1;return e?.rowNode?(s||(s=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(s||(s=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(s||(s=this.model.getCellValidationModel().getCellValidationMap().size>0),s||(s=this.model.getRowValidationModel().getRowValidationMap().size>0)),s}moveToNextCell(e,t,s,o="ui"){let i;const n=this.isEditing(),r=n&&this.checkNavWithValidation(void 0,s)==="block-stop";return e instanceof Mi&&n&&(i=this.strategy?.moveToNextEditingCell(e,t,s,o,r)),i===null||(i=i||!!this.beans.focusSvc.focusedHeader,i===!1&&!r&&this.stopEditing()),i}getCellDataValue({rowNode:e,column:t},s=!0){if(!e||!t)return;let o=this.model.getEdit({rowNode:e,column:t});const i=e.pinnedSibling;if(i){const r=this.model.getEdit({rowNode:i,column:t});r&&(o=r)}const n=s?o?.editorValue??o?.pendingValue:o?.pendingValue;return n===ts||!o?o?.sourceValue??this.valueSvc.getValue(t,e,!1,"api"):n}addStopEditingWhenGridLosesFocus(e){qP(this,this.beans,e)}createPopupEditorWrapper(e){return new RM(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,s){try{if((!this.isEditing()||this.committing)&&!NM.has(s))return;const{beans:o}=this;this.strategy??(this.strategy=this.createStrategy());const i=this.isBatchEditing()?"ui":this.committing?s??"api":"api";if(!s||AM.has(s))return ya(o,e,t,s,void 0,{persist:!0}),this.setNodeDataValue(e.rowNode,e.column,t,!0,s);const n=this.model.getEdit(e);if(n){if(n.pendingValue===t)return!1;if(n.sourceValue!==t)return ya(o,e,t,s,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0;if(n.sourceValue===t)return o.editModelSvc?.removeEdits(e),this.dispatchEditValuesChanged(e,{...n,pendingValue:t}),!0}return ya(o,e,t,s,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){ZP(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,hi))return;const{rowNode:o,column:i}=e,{compDetails:n,valueToDisplay:r}=t;if(n){const{params:l}=n;return l.data=this.model.getEditRowDataValue(o,hi),{compDetails:n}}const a=this.model.getEditRow(e.rowNode,hi);if(r!==void 0&&a?.has(i))return{valueToDisplay:this.valueSvc.getValue(i,o)}}cleanupEditors(){this.strategy?.cleanupEditors()}dispatchCellEvent(e,t,s,o){this.strategy?.dispatchCellEvent(e,t,s,o)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return we(this.gos,{type:e,...e==="batchEditingStopped"?{changes:this.toEventChangeList(t)}:{}})}toEventChangeList(e){return this.model.getEditPositions(e).map(t=>({rowIndex:t.rowNode.rowIndex,rowPinned:t.rowNode.rowPinned,columnId:t.column.getColId(),newValue:t.pendingValue,oldValue:t.sourceValue}))}applyBulkEdit({rowNode:e,column:t},s){if(!s||s.length===0)return;const{beans:o,rangeSvc:i,valueSvc:n}=this;bo(o,{persist:!0});const r=this.model.getEditMap(!0),a=r.get(e)?.get(t)?.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),s.forEach(c=>{if(i?.forEachRowInRange(c,d=>{const u=Ns(o,d);if(u===void 0)return;const h=r.get(u)??new Map;for(const p of c.columns)if(p&&this.isCellEditable({rowNode:u,column:p},"api")){const m=n.getValue(p,u,!0,"api");let C=n.parseValue(p,u??null,a,m);Number.isNaN(C)&&(C=null),h.set(p,{editorValue:void 0,pendingValue:C,sourceValue:m,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}h.size>0&&r.set(u,h)}),this.setEditMap(r),this.batch){this.cleanupEditors(),Nd(o),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(r)})}),this.bulkRefresh();const l=Ue(o,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new PM(e,t)}createRowStyleFeature(e,t){return new TM(e,t)}setEditingCells(e,t){const{beans:s}=this,{colModel:o,valueSvc:i}=s,n=new Map;for(let{colId:r,column:a,colKey:l,rowIndex:c,rowPinned:d,newValue:u,state:h}of e){const p=r?o.getCol(r):l?o.getCol(l):a;if(!p)continue;const m=Ns(s,{rowIndex:c,rowPinned:d});if(!m)continue;const C=i.getValue(p,m,!0,"api");if(!t?.forceRefreshOfEditCellsOnly&&!Is({pendingValue:u,sourceValue:C})&&h!=="editing")continue;let v=n.get(m);v||(v=new Map,n.set(m,v)),u===void 0&&(u=ts),v.set(p,{editorValue:void 0,pendingValue:u,sourceValue:C,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(n,t)}onCellFocused(e){const t=Ue(this.beans,e);if(!t||!this.isEditing(t,hi))return;const s=this.model.getEdit(t);if(!s||!Is(s))return;const i=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");this.beans.ariaAnnounce?.announceValue(i,"pendingChange")}allowedFocusTargetOnValidation(e){return Ue(this.beans,e)}};function BM(e){return{rowNodes:e?Array.from(e.keys()):void 0,columns:e?[...new Set(Array.from(e.values()).flatMap(t=>Array.from(t.keys())))]:void 0}}function op(e,t){return t??e.get("editType")??"singleCell"}var sv=class extends O{postConstruct(){this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:this.onCellFocusChanged?.bind(this),cellFocusCleared:this.onCellFocusChanged?.bind(this)})}clearEdits(e){this.model.clearEditValue(e)}onCellFocusChanged(e){let t;const s=e.previousParams,{editSvc:o,beans:i}=this,n=e.type==="cellFocused"?e.sourceEvent:null;s&&(t=Ue(i,s));const{gos:r,editModelSvc:a}=i,l=e.type==="cellFocusCleared";if(o.isEditing(void 0,{withOpenEditor:!0})){const{column:c,rowIndex:d,rowPinned:u}=e,h={column:c,rowNode:Ns(i,{rowIndex:d,rowPinned:u})},p=r.get("invalidEditValueMode")==="block";if(p)return;const m=!p,C=!!a?.getCellValidationModel().hasCellValidation(h),v=m&&C;(s||l?o.stopEditing(void 0,{cancel:v,source:l&&m?"api":void 0,event:n}):!0)||(o.isBatchEditing()?o.cleanupEditors():o.stopEditing(void 0,{source:"api"}))}t?.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){const s=this.model.getEditPositions(),o={all:[],pass:[],fail:[]};for(const i of s){if(o.all.push(i),(this.model.getCellValidationModel().getCellValidation(i)?.errorMessages?.length??0)>0){o.fail.push(i);continue}o.pass.push(i)}if(e)for(const i of s)$a(this.beans,i,{cancel:e}),this.model.stop(i);else{const i=this.processValidationResults(o);if(i.destroy.length>0)for(const n of i.destroy)$a(this.beans,n,{event:t,cancel:e}),this.model.stop(n);if(i.keep.length>0)for(const n of i.keep){const r=Ue(this.beans,n);this.editSvc?.cellEditingInvalidCommitBlocks()||r&&this.editSvc.revertSingleCellEdit(r)}}return!0}cleanupEditors({rowNode:e}={},t){bo(this.beans,{persist:!1});const s=this.model.getEditPositions(),o=[];if(e)for(const i of s)i.rowNode!==e&&o.push(i);else for(const i of s)o.push(i);Ti(this.beans,o),Nd(this.beans,t)}setFocusOutOnEditor(e){e.comp?.getCellEditor()?.focusOut?.()}setFocusInOnEditor(e){const t=e.comp,s=t?.getCellEditor();if(s?.focusIn)s.focusIn();else{const o=this.beans.gos.get("editType")==="fullRow";e.focusCell(o),e.onEditorAttachedFuncs.push(()=>t?.getCellEditor()?.focusIn?.())}}setupEditors(e){const{event:t,ignoreEventKey:s=!1,startedEdit:o,position:i,cells:n=this.model.getEditPositions()}=e,r=t instanceof KeyboardEvent&&!s&&t.key||void 0;YP(this.beans,n,i,r,t,o)}dispatchCellEvent(e,t,s,o){const i=Ue(this.beans,e);i&&this.eventSvc.dispatchEvent({...i.createEvent(t??null,s),...o})}dispatchRowEvent(e,t,s){if(s)return;const o=Wu(this.beans,e);o&&this.eventSvc.dispatchEvent(o.createRowEvent(t))}shouldStop(e,t,s="ui"){const o=this.editSvc.isBatchEditing();return o&&s==="api"?!0:o&&(s==="ui"||s==="edit")?!1:s==="api"?!0:t instanceof KeyboardEvent&&!o?t.key===I.ENTER:null}shouldCancel(e,t,s="ui"){const o=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!o&&t.key===I.ESCAPE||o&&s==="api"||s==="api")}setEditMap(e,t){t?.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const s=[];if(e.forEach((o,i)=>{o.forEach((n,r)=>{n.state==="editing"&&s.push({...n,rowNode:i,column:r})})}),t?.update&&(e=new Map([...this.model.getEditMap(),...e])),this.model?.setEditMap(e),s.length>0){const o=s.at(-1),i=o.pendingValue===ts?void 0:o.pendingValue;this.start({position:o,event:new KeyboardEvent("keydown",{key:i}),source:"api"});const n=Ue(this.beans,o);n&&this.setFocusInOnEditor(n)}}destroy(){this.cleanupEditors(),super.destroy()}},VM=class extends sv{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,s="ui"){const{rowNode:o}=e||{};if(!Wu(this.beans,{rowNode:this.rowNode}))return!0;const n=super.shouldStop({rowNode:this.rowNode},t,s);return n!==null?n:this.rowNode?o!==this.rowNode:!1}midBatchInputsAllowed({rowNode:e}){return e?this.model.hasEdits({rowNode:e}):!1}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:s,startedEdit:o,event:i,ignoreEventKey:n}=e,{rowNode:r}=t;this.rowNode!==r&&super.cleanupEditors(t),this.dispatchRowEvent({rowNode:r},"rowEditingStarted",s),this.startedRows.push(r);const a=this.beans.visibleCols.allCols,l=[];for(const c of a){if(!c.isCellEditable(r))continue;const d={rowNode:r,column:c};l.push(d),this.model.hasEdits(d)||this.model.start(d)}this.rowNode=r,this.setupEditors({cells:l,position:t,startedEdit:o,event:i,ignoreEventKey:n})}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){const{rowNode:s}=this;if(s&&!this.model.hasRowEdits(s))return!1;const o=[];if(e||this.model.getEditMap().forEach((i,n)=>{if(!(!i||i.size===0)){for(const r of i.values())if(Is(r)){o.push(n);break}}}),Ho(this.beans),!e&&this.editSvc?.checkNavWithValidation({rowNode:s})==="block-stop")return!1;super.stop(e,t);for(const i of o)this.dispatchRowEvent({rowNode:i},"rowValueChanged");return this.cleanupEditors({rowNode:s},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,s=e.previousParams;if(s?.rowIndex===t||e.sourceEvent instanceof KeyboardEvent)return;const o=Ue(this.beans,s);this.gos.get("invalidEditValueMode")==="block"&&o&&(this.model.getCellValidationModel().getCellValidation(o)||this.model.getRowValidationModel().getRowValidation(o))||super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);for(const s of this.startedRows)this.dispatchRowEvent({rowNode:s},"rowEditingStopped");this.startedRows.length=0}moveToNextEditingCell(e,t,s,o="ui",i=!1){const n=e.cellPosition;let r;this.model.suspend(!0);try{r=this.beans.navigation?.findNextCellToFocusOn(n,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(r===!1)return null;if(r==null)return!1;const a=r.cellPosition,l=e.isCellEditable(),c=r.isCellEditable(),d=a&&n.rowIndex===a.rowIndex&&n.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const u=this.gos.get("suppressStartEditOnTab");return c&&!i?u?r.focusCell(!0,s):(r.comp?.getCellEditor()||Gi(this.beans,r,{event:s,cellStartedEdit:!0}),this.setFocusInOnEditor(r),r.focusCell(!1,s)):(c&&i&&this.setFocusInOnEditor(r),r.focusCell(!0,s)),!d&&!i&&(this.editSvc?.stopEditing({rowNode:e.rowNode},{event:s}),this.cleanupEditors(r,!0),u?r.focusCell(!0,s):this.editSvc.startEditing(r,{startedEdit:!0,event:s,source:o,ignoreEventKey:!0})),e.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:s},o)=>{if(s!=="editing")return;const i=Ue(this.beans,{rowNode:t,column:o});i&&!i.comp?.getCellEditor()&&Gi(this.beans,i,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},zM=class extends sv{constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,s="ui"){const o=super.shouldStop(e,t,s);if(o!==null)return o;const{rowNode:i,column:n}=e||{};return(!this.rowNode||!this.column)&&i&&n?null:this.rowNode!==i||this.column!==n}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:s,event:o,ignoreEventKey:i}=e;(this.rowNode!==t.rowNode||this.column!==t.column)&&super.cleanupEditors(),this.rowNode=t.rowNode,this.column=t.column,this.model.start(t),this.setupEditors({cells:[t],position:t,startedEdit:s,event:o,ignoreEventKey:i})}dispatchRowEvent(e,t,s){}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){return super.stop(e,t),this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){const{colModel:t,editSvc:s}=this.beans,{rowIndex:o,column:i,rowPinned:n}=e,r=Ns(this.beans,{rowIndex:o,rowPinned:n}),a=Od(i),l=t.getCol(a),c=e.previousParams;if(c){const d=Od(c.column);if(c?.rowIndex===o&&d===a&&c?.rowPinned===n)return}s?.isEditing({rowNode:r,column:l},{withOpenEditor:!0})&&e.type==="cellFocused"||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,s,o="ui",i=!1){const n=this.beans.focusSvc.getFocusedCell();n&&(e=vi(this.beans,n)??e);const r=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),i||(e.eGui.focus(),this.editSvc?.stopEditing(e,{source:this.editSvc?.isBatchEditing()?"ui":"api",event:s}));try{a=this.beans.navigation?.findNextCellToFocusOn(r,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const c=a.cellPosition,d=e.isCellEditable(),u=a.isCellEditable(),h=c&&r.rowIndex===c.rowIndex&&r.rowPinned===c.rowPinned;d&&!i&&this.setFocusOutOnEditor(e);const p=this.gos.get("suppressStartEditOnTab");if(!h&&!i&&(super.cleanupEditors(a,!0),p?a.focusCell(!0,s):this.editSvc.startEditing(a,{startedEdit:!0,event:s,source:o,ignoreEventKey:!0})),u&&!i){if(a.focusCell(!1,s),p)a.focusCell(!0,s);else if(!a.comp?.getCellEditor()){const m=this.editSvc?.isEditing(a,{withOpenEditor:!0});Gi(this.beans,a,{event:s,cellStartedEdit:!0,silent:m}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else u&&i&&this.setFocusInOnEditor(a),a.focusCell(!0,s);return e.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},co={moduleName:"EditCore",version:Z,beans:[$P,GM],apiFunctions:{getEditingCells:mM,getEditRowValues:fM,getCellEditorInstances:KP,startEditingCell:wM,stopEditing:CM,isEditing:vM,validateEdit:bM},dynamicBeans:{singleCell:zM,fullRow:VM},dependsOn:[Cl,KC],css:[$T]},WM={moduleName:"UndoRedoEdit",version:Z,beans:[UT],apiFunctions:{undoCellEditing:gM,redoCellEditing:pM,getCurrentUndoSize:SM,getCurrentRedoSize:yM},dependsOn:[co]},_M={moduleName:"TextEditor",version:Z,userComponents:{agCellEditor:sp,agTextCellEditor:sp},dependsOn:[co]},jM={moduleName:"NumberEditor",version:Z,userComponents:{agNumberCellEditor:{classImp:nM}},dependsOn:[co]},UM={moduleName:"DateEditor",version:Z,userComponents:{agDateCellEditor:XT,agDateStringCellEditor:eM},dependsOn:[co]},$M={moduleName:"CheckboxEditor",version:Z,userComponents:{agCheckboxCellEditor:KT},dependsOn:[co]},qM={moduleName:"SelectEditor",version:Z,userComponents:{agSelectCellEditor:aM},dependsOn:[co]},KM={moduleName:"LargeTextEditor",version:Z,userComponents:{agLargeTextCellEditor:sM},dependsOn:[co]},YM={moduleName:"CustomEditor",version:Z,dependsOn:[co]},ZM=class extends O{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,Ri(e.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(e){const t=this.columns;t!=null&&(e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),Fy(e))}createColumns(e,t){const s=()=>{Ha(this.beans,this.columns?.tree),this.columns=null},o=e.treeDepth,n=(this.columns?.treeDepth??-1)==o,r=this.generateSelectionCols();if(Ry(r,this.columns?.list??[])&&n)return;s();const{colGroupSvc:l}=this.beans,c=l?.findDepth(e.tree)??0,d=l?.balanceTreeForAutoCols(r,c)??[];this.columns={list:r,tree:d,treeDepth:c,map:{}},t(h=>{if(!h)return null;const p=h.filter(m=>!Vs(m));return[...r,...p]})}updateColumns(e){const t=Ri(e.source);for(const s of this.columns?.list??[]){const o=this.createSelectionColDef(e.currentValue);s.setColDef(o,null,t),rs(this.beans,{state:[{...o,colId:s.getColId()}]},t)}}getColumn(e){return this.columns?.list.find(t=>On(t,e))??null}getColumns(){return this.columns?.list??null}isSelectionColumnEnabled(){const{gos:e,beans:t}=this,s=e.get("rowSelection");if(typeof s!="object"||!Ro(e))return!1;const o=(t.autoColSvc?.getColumns()?.length??0)>0;if(s.checkboxLocation==="autoGroupColumn"&&o)return!1;const i=!!xi(s),n=ha(s);return i||n}createSelectionColDef(e){const{gos:t}=this,s=e??t.get("selectionColumnDef"),o=t.get("enableRtl"),{rowSpan:i,spanRows:n,...r}=s??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:o?"right":"left",comparator(a,l,c,d){const u=c.isSelected(),h=d.isSelected();return u===h?0:u?1:-1},editable:!1,suppressFillHandle:!0,pinned:null,...r,colId:Cu,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const s=new Wo(e,null,t,!1);return this.createBean(s),[s]}onSelectionOptionsChanged(e,t,s){const o=t&&typeof t!="string"?xi(t):void 0,i=e&&typeof e!="string"?xi(e):void 0,n=o!==i,r=t&&typeof t!="string"?ha(t):void 0,a=e&&typeof e!="string"?ha(e):void 0,l=r!==a,c=Aa(e),d=Aa(t);(n||l||c!==d)&&this.beans.colModel.refreshAll(s)}destroy(){Ha(this.beans,this.columns?.tree),super.destroy()}refreshVisibility(e,t,s){if(!this.columns?.list.length)return;const o=e.length+t.length+s.length;if(o===0)return;const i=this.columns.list[0];if(!i.isVisible())return;const n=()=>{let l;switch(i.pinned){case"left":case!0:l=e;break;case"right":l=s;break;default:l=t}l&&as(l,i)};(this.beans.rowNumbersSvc?.getColumn(vu)?2:1)===o&&n()}};function XM(e,t){if(!t.nodes.every(r=>r.rowPinned&&!gr(r)?(z(59),!1):r.id===void 0?(z(60),!1):!0))return;const{nodes:o,source:i,newValue:n}=t;e.selectionSvc?.setNodesSelected({nodes:o,source:i??"api",newValue:n})}function QM(e,t,s="apiSelectAll"){e.selectionSvc?.selectAllRowNodes({source:s,selectAll:t})}function JM(e,t,s="apiSelectAll"){e.selectionSvc?.deselectAllRowNodes({source:s,selectAll:t})}function eI(e,t="apiSelectAllFiltered"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"filtered"})}function tI(e,t="apiSelectAllFiltered"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"filtered"})}function sI(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"currentPage"})}function oI(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function iI(e){return e.selectionSvc?.getSelectedNodes()??[]}function nI(e){return e.selectionSvc?.getSelectedRows()??[]}var rI=class extends TF{constructor(){super(...arguments),this.beanName="selectionSvc",this.selectedNodes=new Map,this.detailSelection=new Map,this.masterSelectsDetail=!1}postConstruct(){super.postConstruct();const{gos:e}=this;this.mode=La(e),this.groupSelectsDescendants=Zn(e),this.groupSelectsFiltered=Na(e)==="filteredDescendants",this.masterSelectsDetail=Kh(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=Zn(e),s=La(e),o=Na(e)==="filteredDescendants";this.masterSelectsDetail=Kh(e)==="detail",(t!==this.groupSelectsDescendants||o!==this.groupSelectsFiltered||s!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=o,this.mode=s)}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,s){if(this.isRowSelectionBlocked(t))return 0;const o=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,s);if(o==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in o)return o.reset?this.resetNodes():this.selectRange(o.deselect,!1,s),this.selectRange(o.select,!0,s);{const i=o.checkFilteredNodes?iv(o.node):o.newValue;return this.setNodesSelected({nodes:[o.node],newValue:i,clearSelection:o.clearSelection,keepDescendants:o.keepDescendants,event:e,source:s})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:s,nodes:o,event:i,source:n,keepDescendants:r=!1}){if(o.length===0)return 0;const{gos:a}=this;if(!Ro(a)&&e)return z(132),0;if(o.length>1&&!this.isMultiSelect())return z(130),0;let l=0;for(let c=0;c<o.length;c++){const d=o[c],u=gi(d);if(u.rowPinned&&!gr(u)){z(59);continue}if(u.id===void 0){z(60);continue}this.groupSelectsFiltered&&u.group&&!a.get("treeData")||this.selectRowNode(u,e,i,n)&&(this.detailSelection.delete(u.id),l++),this.groupSelectsDescendants&&u.childrenAfterGroup?.length&&(l+=this.selectChildren(u,e,n))}return s||(o.length===1&&n==="api"&&this.selectionCtx.setRoot(gi(o[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(gi(o[0]),r,n)),l>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n))),l}selectRange(e,t,s){let o=0;return e.forEach(i=>{const n=gi(i);if(n.group&&this.groupSelectsDescendants)return;this.selectRowNode(n,t,void 0,s)&&o++}),o>0&&(this.updateGroupsFromChildrenSelections(s),this.dispatchSelectionChanged(s)),o}selectChildren(e,t,s){const o=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return o?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:s,nodes:o}):0}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>t.data&&e.push(t.data)),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((s,o)=>{e(s)&&t.set(o,s)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:s,rowModel:o}=this.beans;if(!Qe(s))return!1;const i=o.rootNode;if(!i)return!1;t||(t=new Jn(!0,i),t.active=!1);let n=!1;return t.forEachChangedNodeDepthFirst(r=>{if(r!==i){const a=this.calculateSelectedFromChildren(r);n=this.selectRowNode(r,a===null?!1:a,void 0,e)||n}}),n}clearOtherNodes(e,t,s){const o=new Map;let i=0;return this.selectedNodes.forEach(n=>{const r=n.id==e.id;if((t?!lI(e,n):!0)&&!r){const l=this.selectedNodes.get(n.id);i+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:s}),this.groupSelectsDescendants&&n.parent&&o.set(n.parent.id,n.parent)}}),o.forEach(n=>{const r=this.calculateSelectedFromChildren(n);this.selectRowNode(n,r===null?!1:r,void 0,s)}),i}onRowSelected(e){const t=e.node;this.groupSelectsDescendants&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}createDaemonNode(e){if(!e.id)return;const t=new io(this.beans);return t.id=e.id,t.data=e.data,t.__selected=e.__selected,t.level=e.level,t}syncInOldRowNode(e,t){t&&e.id!==t.id&&this.selectedNodes.get(t.id)==e&&this.selectedNodes.set(t.id,t)}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.__selected=!0,this.selectedNodes.set(e.id,e)):e.__selected=!1}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){this.selectedNodes.forEach(e=>{this.selectRowNode(e,!1)}),this.selectedNodes.clear()}getBestCostNodeSelection(){const{gos:e,rowModel:t}=this.beans;if(!Qe(e))return;const s=t.getTopLevelNodes();if(s===null)return;const o=[];function i(n){for(let r=0,a=n.length;r<a;r++){const l=n[r];l.isSelected()?o.push(l):l.group&&l.childrenAfterGroup&&i(l.childrenAfterGroup)}}return i(s),o}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const s=Qe(this.gos);let o=!1;const i=n=>{const r=this.selectRowNode(gi(n),!1,void 0,e);o||(o=r)};if(t==="currentPage"||t==="filtered"){if(!s){He(102);return}this.getNodesToSelect(t).forEach(i)}else this.selectedNodes.forEach(i),this.reset(e);if(this.selectionCtx.selectAll=!1,s&&this.groupSelectsDescendants){const n=this.updateGroupsFromChildrenSelections(e);o||(o=n)}o&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,s=0;return this.getNodesToSelect(e).forEach(o=>{this.groupSelectsDescendants&&o.group||(o.isSelected()?t++:o.selectable&&s++)}),{selectedCount:t,notSelectedCount:s}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:s}=this.getSelectedCounts(e);return ov(t,s)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(t=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],s=i=>t.push(i);if(e==="currentPage")return this.forEachNodeOnPage(i=>{if(!i.group){s(i);return}if(!i.expanded&&!i.footer){const n=r=>{s(r),r.childrenAfterFilter?.forEach(n)};n(i);return}this.groupSelectsDescendants||s(i)}),t;const o=this.beans.rowModel;return e==="filtered"?(o.forEachNodeAfterFilter(s),t):(o.forEachNode(s),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:s}=this.beans,o=t.getFirstRow(),i=t.getLastRow();for(let n=o;n<=i;n++){const r=s.getRow(n);r&&e(r)}}selectAllRowNodes(e){const{gos:t,selectionCtx:s}=this;if(!Ro(t)){z(132);return}if(cy(t)&&!Oa(t)){z(130);return}if(!this.canSelectAll())return;const{source:o,selectAll:i}=e;let n=!1;if(this.getNodesToSelect(i).forEach(r=>{const a=this.selectRowNode(gi(r),!0,void 0,o);n||(n=a)}),s.selectAll=!0,Qe(t)&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(o);n||(n=r)}n&&this.dispatchSelectionChanged(o)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,s){if(e||(e=[]),!Array.isArray(e)){He(103);return}const o=new Set(e),i=[];this.beans.rowModel.forEachNode(n=>{o.has(n.id)&&i.push(n)}),s&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:i,source:t})}canSelectAll(){return Qe(this.beans.gos)}updateSelectable(e){const{gos:t,rowModel:s}=this.beans;if(!Ro(t))return;const o="selectableChanged",i=e!==void 0,n=Qe(t)&&this.groupSelectsDescendants,r=[],a=l=>{if(i&&!l.group)return;if(n&&l.group){const d=l.childrenAfterGroup?.some(u=>u.selectable)??!1;this.setRowSelectable(l,d,!0);return}!this.updateRowSelectable(l,!0)&&l.isSelected()&&r.push(l)};if(n){if(e===void 0){const l=s.rootNode;e=l?new Jn(!1,l):void 0}e?.forEachChangedNodeDepthFirst(a,!i,!i)}else s.forEachNode(a);r.length&&this.setNodesSelected({nodes:r,newValue:!1,source:o}),!i&&n&&this.updateGroupsFromChildrenSelections?.(o)}updateSelectableAfterGrouping(e){this.updateSelectable(e),this.groupSelectsDescendants&&this.updateGroupsFromChildrenSelections?.("rowGroupChanged",e)&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){if(!this.masterSelectsDetail)return;const s=e.detailNode?.detailGridInfo?.api;if(!s)return;const o=aI(s);if(e.isSelected()!==o&&this.selectRowNode(e,o,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),!o){const n=this.detailSelection.get(e.id)??new Set;for(const r of s.getSelectedNodes())n.add(r.id);this.detailSelection.set(e.id,n)}}setDetailSelectionState(e,t,s){if(this.masterSelectsDetail){if(!Oa(t)){z(269);return}switch(e.isSelected()){case!0:{s.selectAll();break}case!1:{s.deselectAll();break}case void 0:{const o=this.detailSelection.get(e.id);if(o){const i=[];for(const n of o){const r=s.getRowNode(n);r&&i.push(r)}s.setNodesSelected({nodes:i,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function gi(e){return gr(e)?e.pinnedSibling:e.footer?e.sibling:e}function aI(e){let t=0,s=0;return e.forEachNode(o=>{o.isSelected()?t++:o.selectable&&s++}),ov(t,s)}function ov(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function lI(e,t){let s=t.parent;for(;s;){if(s===e)return!0;s=s.parent}return!1}function iv(e){const t=e.isSelected()===!1,s=e.childrenAfterFilter?.some(iv)??!1;return t||s}var cI={moduleName:"SharedRowSelection",version:Z,beans:[ZM],apiFunctions:{setNodesSelected:XM,selectAll:QM,deselectAll:JM,selectAllFiltered:eI,deselectAllFiltered:tI,selectAllOnCurrentPage:sI,deselectAllOnCurrentPage:oI,getSelectedNodes:iI,getSelectedRows:nI}},dI={moduleName:"RowSelection",version:Z,rowModels:["clientSide","infinite","viewport"],beans:[rI],dependsOn:[cI]};function uI(e){e.expansionSvc?.expandAll(!0)}function hI(e){e.expansionSvc?.expandAll(!1)}function nv(e){e.rowModel?.onRowHeightChanged()}function rv(e){if(e.rowAutoHeight?.active){z(3);return}e.rowModel?.resetRowHeights()}function gI(e,t,s){const o=g4(e);if(o){if(e.rowGroupColsSvc?.columns.length===0){if(t<0){He(238);return}o.setRowCount(t,s);return}He(28);return}ml(e)?.setRowCount(t,s)}function pI(e){return zo(e.gos)?e.rowModel.getBlockStates():e.rowNodeBlockLoader?.getBlockState()??{}}function fI(e){return e.rowModel.isLastRowIndexKnown()}var mI={moduleName:"CsrmSsrmSharedApi",version:Z,apiFunctions:{expandAll:uI,collapseAll:hI}},CI={moduleName:"RowModelSharedApi",version:Z,apiFunctions:{onRowHeightChanged:nv,resetRowHeights:rv}},vI={moduleName:"SsrmInfiniteSharedApi",version:Z,apiFunctions:{setRowCount:gI,getCacheBlockState:pI,isLastRowIndexKnown:fI}},wI=class extends O{constructor(){super(...arguments),this.beanName="alignedGridsSvc",this.consuming=!1}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t=typeof e=="function";return typeof e=="function"&&(e=e()),e.map(o=>{if(!o){He(18),t||He(20);return}if(this.isGridApi(o))return o;const i=o;return"current"in i?i.current?.api:(i.api||He(19),i.api)}).filter(o=>!!o&&!o.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){if(!this.consuming)for(const t of this.getAlignedGridApis())t.isDestroyed()||t.dispatchEvent(e)}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent({type:"alignedGridColumn",event:e})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent({type:"alignedGridScroll",event:e})}onScrollEvent(e){this.onEvent(()=>{this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}extractDataFromEvent(e,t){const s=[];return e.columns?e.columns.forEach(o=>{s.push(t(o))}):e.column&&s.push(t(e.column)),s}getMasterColumns(e){return this.extractDataFromEvent(e,t=>t)}getColumnIds(e){return this.extractDataFromEvent(e,t=>t.getColId())}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{this.processColumnEvent(e);break}case"columnGroupOpened":{this.processGroupOpenedEvent(e);break}case"columnPivotChanged":z(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const s of e.columnGroups){let o=null;s&&(o=t.getProvidedColGroup(s.getGroupId())),!(s&&!o)&&t.setColumnGroupOpened(o,s.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let s=null;const o=this.beans,{colResize:i,ctrlsSvc:n,colModel:r}=o;if(t&&(s=r.getColDefCol(t.getColId())),t&&!s)return;const a=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const u=e.api.getColumnState().map(h=>({colId:h.colId}));rs(o,{state:u,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const u=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));rs(o,{state:u},"alignedGridChanged")}break;case"columnPinned":{const u=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));rs(o,{state:u},"alignedGridChanged")}break;case"columnResized":{const d=e,u={};for(const h of a)u[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of d.flexColumns??[])u[h.getId()]&&delete u[h.getId()];i?.setColumnWidths(Object.values(u),!1,d.finished,"alignedGridChanged");break}}const c=n.getGridBodyCtrl().isVerticalScrollShowing();for(const d of this.getAlignedGridApis())d.setGridOption("alwaysShowVerticalScroll",c)}},bI={moduleName:"AlignedGrids",version:Z,beans:[wI],dependsOn:[nC]},SI=class extends O{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},ip(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){const{selectionSvc:t,pinnedRowModel:s,groupStage:o}=this.beans;t?.reset("rowDataChanged"),s?.isManual()&&s.reset(),this.dispatchRowDataUpdateStarted(e),this.allNodesMap=Object.create(null),this.nextId=0;const i=ip(this.rootNode),n=new Array(e.length);i._leafs=n;let r=0;const a=o?.getNestedDataGetter(),l=a?new Set:null,c=(d,u)=>{const h=d.level+1;for(let p=0,m=u.length;p<m;++p){const C=u[p];if(!C)continue;const v=this.createRowNode(C,h);if(v.sourceRowIndex=r,n[r++]=v,l&&!l.has(C)){l.add(C),v.treeParent=d;const w=a(C);w&&c(v,w)}}};c(i,e),n.length=r}setImmutableRowData(e,t){const{rootNode:s,gos:o}=this;this.dispatchRowDataUpdateStarted(t);const i=Li(o),n=e.changedRowNodes,{adds:r,updates:a}=n,l=new Set,c=[],d=this.beans.groupStage?.getNestedDataGetter();let u=o.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,p=!1;const m=(w,b)=>{if(!u&&u!==void 0){const S=w.sourceRowIndex;u=S<=h,h=S}w.data!==b&&(w.updateData(b),r.has(w)||a.add(w),!w.selectable&&w.isSelected()&&c.push(w))},C=(w,b,S)=>{for(let x=0,y=b.length;x<y;++x){const F=b[x];if(!F)continue;let R=this.getRowNode(i({data:F,level:S}));if(R?(m(R,F),p||(p=!!d&&R.treeParent!==w)):(R=this.createRowNode(F,S),r.add(R)),!d||l.has(R)){l.add(R);continue}l.add(R),R.treeParent=w;const E=d(F);E&&C(R,E,S+1)}};C(s,t,0);const v=this.deleteUnusedNodes(l,n,c)||u||r.size>0;if(v){const w=s._leafs??(s._leafs=[]);u===void 0?EI(w,l,n):FI(w,l)&&(n.reordered=!0)}(v||p||a.size)&&(e.rowDataUpdated=!0,this.deselect(c))}deleteUnusedNodes(e,{removals:t},s){const o=this.rootNode._leafs;for(let i=0,n=o.length;i<n;i++){const r=o[i];e.has(r)||(t.add(r),r.isSelected()&&s.push(r),this.deleteNode(r))}return t.size>0}updateRowData(e,t){if(this.dispatchRowDataUpdateStarted(e.add),this.beans.groupStage?.getNestedDataGetter())return z(268),{remove:[],update:[],add:[]};const s=[],o=Li(this.gos),i=this.executeRemove(o,e,t,s),n=this.executeUpdate(o,e,t,s),r=this.executeAdd(e,t);return this.deselect(s),{remove:i,update:n,add:r}}executeRemove(e,{remove:t},{adds:s,updates:o,removals:i},n){const r=this.rootNode._leafs,a=r?.length,l=t?.length;if(!l||!a)return[];let c=0,d=a,u=0,h;const p=new Array(l);for(let m=0;m<l;++m){const C=this.lookupNode(e,t[m]);if(!C)continue;const v=C.sourceRowIndex;v<d&&(d=v),v>u&&(u=v),C.isSelected()&&n.push(C),this.deleteNode(C),s.delete(C)?(h??(h=new Set),h.add(C)):(o.delete(C),i.add(C)),p[c++]=C}return p.length=c,c&&RI(r,d,u,i,h),p}executeUpdate(e,{update:t},{adds:s,updates:o},i){const n=t?.length;if(!n)return[];const r=new Array(n);let a=0;for(let l=0;l<n;l++){const c=t[l],d=this.lookupNode(e,c);d&&(d.updateData(c),!d.selectable&&d.isSelected()&&i.push(d),r[a++]=d,s.has(d)||o.add(d))}return r.length=a,r}executeAdd(e,t){var s;const o=(s=this.rootNode)._leafs??(s._leafs=[]),i=o.length,n=e.add,r=n?.length;if(!r)return[];const a=i+r;let l=this.sanitizeAddIndex(o,e.addIndex);if(l<i){for(let u=i-1,h=a-1;u>=l;--u){const p=o[u];p.sourceRowIndex=h,o[h--]=p}t.reordered=!0}o.length=a;const c=new Array(r),d=t.adds;for(let u=0;u<r;u++){const h=this.createRowNode(n[u],0);d.add(h),h.sourceRowIndex=l,o[l]=h,c[u]=h,l++}return c}dispatchRowDataUpdateStarted(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e?.length?e[0]:null})}deselect(e){const t="rowDataChanged",s=this.beans.selectionSvc;e.length&&s?.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),s?.updateGroupsFromChildrenSelections?.(t),e.length&&this.eventSvc.dispatchEvent({type:"selectionChanged",source:t,selectedNodes:s?.getSelectedNodes()??null,serverSideState:null})}createRowNode(e,t){const s=new io(this.beans);s.parent=this.rootNode,s.level=t,s.group=!1,s.expanded=!1,s.setDataAndId(e,String(this.nextId++));const o=s.id,i=this.allNodesMap;return i[o]&&z(2,{nodeId:o}),i[o]=s,s}deleteNode(e){e.clearRowTopAndRowIndex();const t=e.id,s=this.allNodesMap;s[t]===e&&delete s[t];const o=e.pinnedSibling;o&&this.beans.pinnedRowModel?.pinRow(o,null)}lookupNode(e,t){if(!e)return xI(this.rootNode._leafs,t);const s=e({data:t,level:0}),o=this.allNodesMap[s];return o||(He(4,{id:s}),null)}sanitizeAddIndex(e,t){const s=e.length;if(typeof t!="number"||t<0||t>=s||Number.isNaN(t))return s;t=Math.ceil(t);const o=this.gos;return t>0&&o.get("treeData")&&o.get("getDataPath")&&(t=yI(e,t)),t}},yI=(e,t)=>{for(let s=0,o=e.length;s<o;s++)if(e[s]?.rowIndex==t-1)return s+1;return t},ip=e=>{e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",e._leafs?.length!==0&&(e._leafs=[]);const t=[],s=[],o=[],i=[];e.childrenAfterGroup=t,e.childrenAfterSort=s,e.childrenAfterAggFilter=o,e.childrenAfterFilter=i;const n=e.sibling;return n&&(n.childrenAfterGroup=t,n.childrenAfterSort=s,n.childrenAfterAggFilter=o,n.childrenAfterFilter=i,n.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},xI=(e,t)=>{if(e)for(let s=0,o=e.length;s<o;s++){const i=e[s];if(i.data===t)return i}return He(5,{data:t}),null},RI=(e,t,s,o,i)=>{t=Math.max(0,t);for(let n=t,r=e.length;n<r;++n){const a=e[n];n<=s&&(o.has(a)||i?.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},FI=(e,t)=>{const s=t.size;e.length=s;let o=0,i=!1,n=!1;for(const r of t){const a=r.sourceRowIndex;a===o?n||(n=i):(a>=0?n=!0:i=!0,r.sourceRowIndex=o,e[o]=r),++o}return n},EI=(e,t,{removals:s,adds:o})=>{const i=e.length;e.length=t.size;let n=0;for(let r=0;r<i;++r){const a=e[r];s.has(a)||(n!==r&&(a.sourceRowIndex=n,e[n]=a),++n)}for(const r of o)r.sourceRowIndex<0&&(r.sourceRowIndex=n,e[n++]=r);e.length=n},av=e=>{const t=e.childrenAfterSort,s=e.sibling;if(s&&(s.childrenAfterSort=t),!!t)for(let o=0,i=t.length-1;o<=i;o++){const n=t[o],r=o===0,a=o===i;n.firstChild!==r&&(n.firstChild=r,n.dispatchRowEvent("firstChildChanged")),n.lastChild!==a&&(n.lastChild=a,n.dispatchRowEvent("lastChildChanged")),n.childIndex!==o&&(n.childIndex=o,n.dispatchRowEvent("childIndexChanged"))}},DI=class extends O{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(e){const t=this.beans.sortSvc.getSortOptions(),s=t.length>0&&!!e.changedRowNodes&&this.gos.get("deltaSort");this.sort(t,s,e.changedRowNodes,e.changedPath)}sort(e,t,s,o){const{gos:i,colModel:n,rowGroupColsSvc:r,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:c}=this.beans,d=i.get("groupMaintainOrder"),u=n.getCols().some(b=>b.isRowGroupActive()),h=r?.columns,p=n.isPivotMode(),m=i.getCallback("postSortRows");let C=!1,v;const w=b=>{const S=p&&b.leafGroup;let x=d&&u&&!b.leafGroup;x&&(v??(v=this.shouldSortContainsGroupCols(e)),x&&(x=!v));let y=null;if(x){let F=!1;if(h){const R=b.level+1;R<h.length&&(F=h[R].getSort()===null)}F||(y=MI(b))}else!e.length||S||(t&&s?y=PI(a,b,s,o,e):y=a.doFullSort(b.childrenAfterAggFilter,e));if(y||(y=b.childrenAfterAggFilter?.slice(0)??[]),C||(C=b.childrenAfterSort?.[0]!==y[0]),b.childrenAfterSort=y,av(b),m){const F={nodes:b.childrenAfterSort};m(F)}};if(o?.forEachChangedNodeDepthFirst(w),C&&i.get("groupHideOpenParents")){const b=c?.getShowRowGroupCols();b?.length&&l.refreshCells({columns:b,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(fs(this.gos)){for(let s=0;s<t;++s){const o=e[s].column;if(o.isPrimary()&&o.isRowGroupActive())return!0}return!1}for(let s=0;s<t;++s)if(e[s].column.getColDef().showRowGroup)return!0;return!1}},PI=(e,t,s,o,i)=>{const n=t.childrenAfterAggFilter,r=t.childrenAfterSort;if(!r)return e.doFullSort(n,i);const a=new Set,l=[],{updates:c,adds:d}=s;for(let h=0,p=n.length;h<p;++h){const m=n[h];c.has(m)||d.has(m)||o&&!o.canSkip(m)?l.push({currentPos:l.length,rowNode:m}):a.add(m)}const u=r.filter(h=>a.has(h)).map((h,p)=>({currentPos:p,rowNode:h}));return l.sort((h,p)=>e.compareRowNodes(i,h,p)),TI(e,i,l,u)},TI=(e,t,s,o)=>{let i=0,n=0;const r=s.length,a=o.length,l=new Array(r+a);let c=0;for(;i<r&&n<a;){const d=s[i],u=o[n];e.compareRowNodes(t,d,u)<0?(l[c++]=d.rowNode,++i):(l[c++]=u.rowNode,++n)}for(;i<r;)l[c++]=s[i++].rowNode;for(;n<a;)l[c++]=o[n++].rowNode;return l},MI=e=>{const t=e.childrenAfterSort,s=e.childrenAfterAggFilter,o=t?.length,i=s?.length;if(!o||!i)return null;const n=new Array(i),r=new Set;for(let l=0;l<i;++l)r.add(s[l]);let a=0;for(let l=0;l<o;++l){const c=t[l];r.delete(c)&&(n[a++]=c)}if(r.size===0&&a===o)return t;for(const l of r)n[a++]=l;return n.length=a,n},II=class extends O{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null,this.rowCountReady=!1,this.nodeManager=void 0,this.rowsToDisplay=[],this.rowDataUpdatedPending=!1,this.asyncTransactions=null,this.asyncTransactionsTimer=0,this.started=!1,this.refreshingModel=!1,this.rowNodesCountReady=!1,this.stages=[],this.stagesRefreshProps=new Map,this.onRowHeightChanged_debounced=lt(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new io(e);this.rootNode=t,this.nodeManager=this.createBean(new SI(t));const s=this.refreshModel.bind(this,{step:"group"}),o=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")});this.addManagedEventListeners({newColumnsLoaded:o,columnRowGroupChanged:s,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:s,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,s=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(o=>!!o);this.stages=s;for(let o=s.length-1;o>=0;--o)for(const i of s[o].refreshProps)t.set(i,o);this.addManagedPropertyListeners([...t.keys()],o=>{const i=o.changeSet?.properties;i&&this.onPropChange(i)}),this.addManagedPropertyListener("rowData",()=>this.onPropChange(["rowData"])),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.started=!0,this.rowNodesCountReady?this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0}):this.setInitialData()}setInitialData(){this.gos.get("rowData")&&this.onPropChange(["rowData"])}ensureRowHeightsValid(e,t,s,o){let i,n=!1;do{i=!1;const r=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(r,s),c=Math.min(a,o);for(let d=l;d<=c;d++){const u=this.getRow(d);if(u.rowHeightEstimated){const h=to(this.beans,u);u.setRowHeight(h.height),i=!0,n=!0}}i&&this.setRowTopAndRowIndex()}while(i);return n}onPropChange(e){const{nodeManager:t,gos:s,beans:o}=this,i=o.groupStage;if(!t)return;const n=new Set(e),r=i?.onPropChange(n);let a;n.has("rowData")?a=s.get("rowData"):r&&(a=i?.extractData()),a&&!Array.isArray(a)&&(a=null,z(1));const l={step:"nothing",changedProps:n};a&&(!r&&!this.isEmpty()&&a.length>0&&s.exists("getRowId")&&!s.get("resetRowDataOnUpdate")?(l.keepRenderedRows=!0,l.animate=!s.get("suppressAnimationFrame"),l.changedRowNodes=new wa,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0));const c=l.rowDataUpdated?"group":this.getRefreshedStage(e);c&&(l.step=c,this.refreshModel(l))}getRefreshedStage(e){const{stages:t,stagesRefreshProps:s}=this,o=t.length;let i=o;for(let n=0,r=e.length;n<r&&i;++n)i=Math.min(i,s.get(e[n])??i);return i<o?t[i].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:s}=this,o=t.environment.getDefaultRowHeight();let i=0;const n=gt(this.gos,"normal");for(let r=0,a=s.length;r<a;++r){const l=s[r],c=l.id;if(c!=null&&e?.add(c),l.rowHeight==null){const d=to(t,l,n,o);l.setRowHeight(d.height,d.estimated)}l.setRowTop(i),l.setRowIndex(r),i+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const s=e.active,o=r=>{r?.id!=null&&!t.has(r.id)&&r.clearRowTopAndRowIndex()},i=r=>{o(r),o(r.detailNode),o(r.sibling);const a=r.childrenAfterGroup;if(!r.hasChildren()||!a)return;const l=r.level==-1;if(!(s&&!l&&!r.expanded))for(let d=0,u=a.length;d<u;++d)i(a[d])},n=this.rootNode;n&&i(n)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){const{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;const o=e.sibling?.displayed?1:0;return(e.childrenAfterSort?.length??0)+o}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:s,rowsToDisplay:o}=this;if(!s||!o.length||o[0]===s)return e;const n=s.childrenAfterSort,r=l=>{let c=n[l];if(this.gos.get("groupHideOpenParents"))for(;c.expanded&&c.childrenAfterSort&&c.childrenAfterSort.length>0;)c=c.childrenAfterSort[0];return c.rowIndex},a=t.footerSvc;return a?a?.getTopDisplayIndex(o,e,n,r):r(e)}getTopLevelIndexFromDisplayedIndex(e){const{rootNode:t,rowsToDisplay:s}=this;if(!t||!s.length||s[0]===t)return e;let i=this.getRow(e);i.footer&&(i=i.sibling);let n=i.parent;for(;n&&n!==t;)i=n,n=i.parent;const r=t.childrenAfterSort?.indexOf(i)??-1;return r>=0?r:e}getRowBounds(e){const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:yi(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const o=t.length===0||t.some(i=>i.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:o,keepRenderedRows:!0,animate:yi(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:yi(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new Jn(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:s,rowDataUpdated:o}=e;return!(!t||s||!o||t.removals.size||t.adds.size)}refreshModel(e){const{nodeManager:t,beans:s,eventSvc:o,started:i,refreshingModel:n}=this;if(!t)return;const r=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&r));if(i&&r&&o.dispatchEvent({type:"rowDataUpdated"}),!i||n||s.colModel.changeEventsDispatching||this.isSuppressModelUpdateAfterUpdateTransaction(e)){this.rowDataUpdatedPending||(this.rowDataUpdatedPending=r);return}switch(this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.refreshingModel=!0,s.masterDetailSvc?.refreshModel(e),r&&e.step!=="group"&&s.colFilter?.refreshModel(),e.step){case"group":this.doGrouping(e);case"filter":this.doFilter(a);case"pivot":this.doPivot(a);case"aggregate":this.doAggregate(a);case"filter_aggregates":this.doFilterAggregates(a);case"sort":this.doSort(e.changedRowNodes,a);case"map":this.doRowsToDisplay()}const l=new Set;this.setRowTopAndRowIndex(l),this.clearRowTopAndRowIndex(a,l),this.refreshingModel=!1,o.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}isEmpty(){return!this.rootNode?._leafs?.length||!this.beans.colModel?.ready}isRowsToRender(){return this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let s=!1,o=!1;const i=[],n=Zn(this.gos);return this.forEachNodeAfterFilterAndSort(r=>{if(o)return;if(s&&(r===t||r===e)&&(o=!0,n&&r.group)){lv(i,r);return}if(!s){if(r!==t&&r!==e)return;s=!0,t===e&&(o=!0)}(!r.group||!n)&&i.push(r)}),i}getTopLevelNodes(){return this.rootNode?.childrenAfterGroup??null}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){const t=this.rowsToDisplay,s=t.length;if(this.isEmpty()||s===0)return-1;let o=0,i=s-1;if(e<=0)return 0;if(t[i].rowTop<=e)return i;let r=-1,a=-1;for(;;){const l=Math.floor((o+i)/2),c=t[l];if(this.isRowInPixel(c,e)||(c.rowTop<e?o=l+1:c.rowTop>e&&(i=l-1),r===o&&a===i))return l;r=o,a=i}}isRowInPixel(e,t){const s=e.rowTop,o=s+e.rowHeight;return s<=t&&o>t}forEachLeafNode(e){const t=this.rootNode?._leafs;if(t)for(let s=0,o=t.length;s<o;++s)e(t[s],s)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToDisplay;for(let s=0,o=t.length;s<o;++s)e(t[s],s)}forEachNodeAfterFilter(e,t=!1){this.depthFirstSearchRowNodes(e,t,s=>s.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,s=>s.childrenAfterSort)}forEachPivotNode(e,t,s){const{colModel:o,rowGroupColsSvc:i}=this.beans;if(!o.isPivotMode())return;if(!i?.columns.length){e(this.rootNode,0);return}const n=s?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,r=>r.leafGroup?null:r[n])}depthFirstSearchRowNodes(e,t=!1,s=n=>n.childrenAfterGroup,o=this.rootNode,i=0){let n=i;if(!o)return n;const r=o===this.rootNode;if(r||e(o,n++),o.hasChildren()&&!o.footer){const a=s(o);if(a){const l=this.beans.footerSvc;n=l?.addTotalRows(n,o,e,t,r,"top")??n;for(const c of a)n=this.depthFirstSearchRowNodes(e,t,s,c,n);return l?.addTotalRows(n,o,e,t,r,"bottom")??n}}return n}doAggregate(e){const t=this.rootNode;t&&this.beans.aggStage?.execute({rowNode:t,changedPath:e})}doFilterAggregates(e){const t=this.rootNode,s=this.beans.filterAggStage;if(s){s.execute({rowNode:t,changedPath:e});return}t.childrenAfterAggFilter=t.childrenAfterFilter}doSort(e,t){const s=this.beans.sortStage;if(s){s.execute({rowNode:this.rootNode,changedRowNodes:e,changedPath:t});return}t.forEachChangedNodeDepthFirst(o=>{o.childrenAfterSort=o.childrenAfterAggFilter.slice(0),av(o)})}doGrouping(e){const t=this.rootNode,o=this.beans.groupStage?.execute({rowNode:t,changedRowNodes:e.changedRowNodes,changedPath:e.changedPath,afterColumnsChanged:!!e.afterColumnsChanged});if(o===void 0){const i=t._leafs;t.childrenAfterGroup=i,t.updateHasChildren();const n=t.sibling;n&&(n.childrenAfterGroup=i)}(o||e.rowDataUpdated)&&this.beans.colFilter?.refreshModel(),!this.rowCountReady&&this.rowNodesCountReady&&(this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){const t=this.beans.filterStage;if(t){t.execute({rowNode:this.rootNode,changedPath:e});return}e.forEachChangedNodeDepthFirst(s=>{s.childrenAfterFilter=s.childrenAfterGroup,AC(s)},!0)}doPivot(e){this.beans.pivotStage?.execute({rowNode:this.rootNode,changedPath:e})}getRowNode(e){const t=this.nodeManager?.getRowNode(e);return typeof t=="object"?t:typeof e=="string"&&e.indexOf(Fd)===0?this.beans.groupStage?.getNode(e):void 0}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const s=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),s)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){const{nodeManager:e,beans:t,eventSvc:s,asyncTransactions:o}=this;if(!e)return;t.valueCache?.onDataChanged();const i=[],n=[],r=new wa;for(const{rowDataTransaction:a,callback:l}of o??[]){this.rowNodesCountReady=!0;const c=e.updateRowData(a,r);i.push(c),l&&n.push(l.bind(null,c))}this.commitTransactions(r),n.length>0&&setTimeout(()=>{for(let a=0,l=n.length;a<l;a++)n[a]()},0),i.length>0&&s.dispatchEvent({type:"asyncTransactionsFlushed",results:i}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){const t=this.nodeManager;if(!t)return null;this.beans.valueCache?.onDataChanged(),this.rowNodesCountReady=!0;const s=new wa,o=t.updateRowData(e,s);return this.commitTransactions(s),o}commitTransactions(e){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:e,changedPath:this.createChangePath(!0)})}doRowsToDisplay(){const{beans:e,rootNode:t}=this,s=e.flattenStage;if(s){this.rowsToDisplay=s.execute({rowNode:t});return}const o=this.rootNode.childrenAfterSort??[];for(const i of o)i.setUiLevel(0);this.rowsToDisplay=o}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){const e=this.rootNode;if(!e)return;const t=this.resetRowHeightsForAllRowNodes();e.setRowHeight(e.rowHeight,!0);const s=e.sibling;s?.setRowHeight(s.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const s=t.detailNode;s?.setRowHeight(s.rowHeight,!0);const o=t.sibling;o?.setRowHeight(o.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){e.rowHeightChanged&&!this.beans.rowAutoHeight?.active&&this.resetRowHeights()}onGridReady(){this.started||this.setInitialData()}destroy(){super.destroy(),this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.asyncTransactions=null,clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},lv=(e,t)=>{const s=t.childrenAfterGroup;if(s)for(let o=0,i=s.length;o<i;++o){const n=s[o];n.data&&e.push(n),n.group&&lv(e,n)}};function kI(e){e.expansionSvc?.onGroupExpandedOrCollapsed()}function AI(e,t){const s=lo(e);s&&((!t||t==="everything")&&(t="group"),s.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function LI(e){return lo(e)?.isEmpty()??!0}function OI(e,t){lo(e)?.forEachLeafNode(t)}function NI(e,t){lo(e)?.forEachNodeAfterFilter(t)}function HI(e,t){lo(e)?.forEachNodeAfterFilterAndSort(t)}function GI(e,t){return e.frameworkOverrides.wrapIncoming(()=>lo(e)?.updateRowData(t))}function BI(e,t,s){e.frameworkOverrides.wrapIncoming(()=>lo(e)?.batchUpdateRowData(t,s))}function VI(e){e.frameworkOverrides.wrapIncoming(()=>lo(e)?.flushAsyncTransactions())}function zI(e){return e.selectionSvc?.getBestCostNodeSelection()}var WI={moduleName:"ClientSideRowModel",version:Z,rowModels:["clientSide"],beans:[II,DI],dependsOn:[TC]},_I={moduleName:"ClientSideRowModelApi",version:Z,apiFunctions:{onGroupExpandedOrCollapsed:kI,refreshClientSideRowModel:AI,isRowDataEmpty:LI,forEachLeafNode:OI,forEachNodeAfterFilter:NI,forEachNodeAfterFilterAndSort:HI,applyTransaction:GI,applyTransactionAsync:BI,flushAsyncTransactions:VI,getBestCostNodeSelection:zI,resetRowHeights:rv,onRowHeightChanged:nv},dependsOn:[mI,CI]},jI=class extends O{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel}serialize(e,t={}){const{allColumns:s,columnKeys:o,skipRowGroups:i,exportRowNumbers:n}=t,r=this.getColumnsToExport({allColumns:s,skipRowGroups:i,columnKeys:o,exportRowNumbers:n});return[this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,s,o){const i=t.shouldRowBeSkipped||(()=>!1),r=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!r,l=this.colModel.isPivotMode()?o.leafGroup:!o.group,c=!!o.footer,d=o.allChildrenCount===1&&o.childrenAfterGroup?.length===1&&ay(this.gos,o);if(!l&&!c&&(t.skipRowGroups||d||a)||t.onlySelected&&!o.isSelected()||t.skipPinnedTop&&o.rowPinned==="top"||t.skipPinnedBottom&&o.rowPinned==="bottom"||o.stub||o.level===-1&&!l&&!c||i(we(this.gos,{node:o})))return;const p=e.onNewBodyRow(o);if(s.forEach((m,C)=>{p.onColumn(m,C,o)}),t.getCustomContentBelowRow){const m=t.getCustomContentBelowRow(we(this.gos,{node:o}));m&&e.addCustomContent(m)}}appendContent(e){return t=>{const s=e.appendContent;return s&&t.addCustomContent(s),t}}prependContent(e){return t=>{const s=e.prependContent;return s&&t.addCustomContent(s),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return s=>{if(!e.skipColumnGroupHeaders){const o=new em,{colGroupSvc:i}=this.beans,n=i?i.createColumnGroups({columns:t,idCreator:o,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(n,s,e.processGroupHeaderCallback)}return s}}exportHeaders(e,t){return s=>{if(!e.skipColumnHeaders){const o=s.onNewHeaderRow();t.forEach((i,n)=>{o.onColumn(i,n,void 0)})}return s}}processPinnedTopRows(e,t){return s=>{const o=this.processRow.bind(this,s,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="top").sort((i,n)=>i.rowIndex-n.rowIndex).map(i=>this.pinnedRowModel?.getPinnedTopRow(i.rowIndex)).forEach(o):this.pinnedRowModel?.isManual()||this.pinnedRowModel?.forEachPinnedRow("top",o),s}}processRows(e,t){return s=>{const o=this.rowModel,i=Qe(this.gos),n=zo(this.gos),r=!i&&e.onlySelected,a=this.processRow.bind(this,s,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(c=>c.rowPinned==null).sort((c,d)=>c.rowIndex-d.rowIndex).map(c=>o.getRow(c.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())i?o.forEachPivotNode(a,!0,l==="filteredAndSorted"):n?o.forEachNodeAfterFilterAndSort(a,!0):o.forEachNode(a);else if(e.onlySelectedAllPages||r){const c=this.beans.selectionSvc?.getSelectedNodes()??[];this.replicateSortedOrder(c),c.forEach(a)}else l==="all"?o.forEachNode(a):i||n?o.forEachNodeAfterFilterAndSort(a,!0):o.forEachNode(a);return s}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:s}=this.beans;if(!t||!s)return;const o=t.getSortOptions(),i=(n,r)=>n.rowIndex!=null&&r.rowIndex!=null?n.rowIndex-r.rowIndex:n.level===r.level?n.parent?.id===r.parent?.id?s.compareRowNodes(o,{rowNode:n,currentPos:n.rowIndex??-1},{rowNode:r,currentPos:r.rowIndex??-1}):i(n.parent,r.parent):n.level>r.level?i(n.parent,r):i(n,r.parent);e.sort(i)}processPinnedBottomRows(e,t){return s=>{const o=this.processRow.bind(this,s,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="bottom").sort((i,n)=>i.rowIndex-n.rowIndex).map(i=>this.pinnedRowModel?.getPinnedBottomRow(i.rowIndex)).forEach(o):this.pinnedRowModel?.isManual()||this.pinnedRowModel?.forEachPinnedRow("bottom",o),s}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:s=!1,exportRowNumbers:o=!1,columnKeys:i}=e,{colModel:n,gos:r,visibleCols:a}=this,l=n.isPivotMode(),c=h=>Vs(h)?!1:!As(h)||o;if(i?.length)return n.getColsForKeys(i).filter(c);const d=r.get("treeData");let u=[];return t&&!l?u=n.getCols():u=a.allCols,u=u.filter(h=>c(h)&&(s&&!d?!wu(h):!0)),u}recursivelyAddHeaderGroups(e,t,s){const o=[];for(const i of e){const n=i;if(n.getChildren)for(const r of n.getChildren()??[])o.push(r)}e.length>0&&Je(e[0])&&this.doAddHeaderHeader(t,e,s),o&&o.length>0&&this.recursivelyAddHeaderGroups(o,t,s)}doAddHeaderHeader(e,t,s){const o=e.onNewHeaderGroupingRow();let i=0;for(const n of t){const r=n;let a;s?a=s(we(this.gos,{columnGroup:r})):a=this.beans.colNames.getDisplayNameForColumnGroup(r,"header");const c=(r.isExpandable()?r.getLeafColumns():[]).reduce((d,u,h,p)=>{let m=Be(d);return u.getColumnGroupShow()==="open"?(!m||m[1]!=null)&&(m=[h],d.push(m)):m&&m[1]==null&&(m[1]=h-1),h===p.length-1&&m&&m[1]==null&&(m[1]=h),d},[]);o.onColumn(r,a||"",i++,r.getLeafColumns().length-1,c)}}},UI={moduleName:"SharedExport",version:Z,beans:[jI]},np=`\r
61
- `,$I=class extends b4{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:s}=e;this.suppressQuotes=t,this.columnSeparator=s}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,np),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((s,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(s.data.value||""),s.mergeAcross&&this.appendEmptyCells(s.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,s,o){s!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(o)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,s){t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",s);this.result+=this.putInQuotes(o.valueFormatted??o.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(z(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=np),this.isFirstLine=!1}},qI=class extends w4{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){z(51);return}const t=this.getMergedParams(e),s=this.getData(t),o=new Blob(["\uFEFF",s],{type:"text/plain"}),i=typeof t.fileName=="function"?t.fileName(we(this.gos,{})):t.fileName;S4(this.getFileName(i),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const s=t?Object.assign({},e):this.getMergedParams(e);return this.getData(s)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:s,rowGroupColsSvc:o,valueSvc:i,gos:n}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:d,columnSeparator:u}=e;return new $I({colModel:t,colNames:s,valueSvc:i,gos:n,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:d||!1,columnSeparator:u||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function KI(e,t){return e.csvCreator?.getDataAsCsv(t)}function YI(e,t){e.csvCreator?.exportDataAsCsv(t)}var ZI={moduleName:"CsvExport",version:Z,beans:[qI],apiFunctions:{getDataAsCsv:KI,exportDataAsCsv:YI},dependsOn:[UI]},XI=class extends O{constructor(e,t,s){super(),this.id=e,this.parentCache=t,this.params=s,this.state="needsLoading",this.version=0,this.startRow=e*s.blockSize,this.endRow=this.startRow+s.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,s){this.successCommon(e,{rowData:t,rowCount:s})}isRequestMostRecentAndLive(e){const t=e===this.version,s=this.isAlive();return t&&s}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:s,beans:o,rowNodes:i}=this;for(let n=0;n<e;n++){const r=s+n,a=new io(o);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(r),a.setRowTop(t*r),i.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:s,state:o}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:s,pageStatus:o}}}setDataAndId(e,t,s){X(t)?e.setDataAndId(t,s.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(qe(this.params.datasource.getRows)){z(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:s,params:{sortModel:o,filterModel:i},gos:n}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,s),failCallback:this.pageLoadFailed.bind(this,s),sortModel:o,filterModel:i,context:we(n,{}).context}}forEachNode(e,t,s){this.rowNodes.forEach((o,i)=>{this.startRow+i<s&&e(o,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const s=e-this.startRow;return this.rowNodes[s]}processServerResult(e){const{rowNodes:t,beans:s}=this;t.forEach((i,n)=>{const r=e.rowData?e.rowData[n]:void 0;!i.id&&i.alreadyRendered&&r&&(t[n]=new io(s),t[n].setRowIndex(i.rowIndex),t[n].setRowTop(i.rowTop),t[n].setRowHeight(i.rowHeight),i.clearRowTopAndRowIndex()),this.setDataAndId(t[n],r,this.startRow+n)});const o=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,o)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},QI=2,JI=class extends O{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const s=Math.floor(e/this.params.blockSize);let o=this.blocks[s];if(!o){if(t)return;o=this.createBlock(s)}return o.getRow(e)}createBlock(e){const t=this.params,s=this.createBean(new XI(e,this,t));return this.blocks[s.id]=s,this.blockCount++,this.purgeBlocksIfNeeded(s),t.rowNodeBlockLoader.addBlock(s),s}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(Ao(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(r=>r!=e),s=(r,a)=>a.lastAccessed-r.lastAccessed;t.sort(s);const o=this.params.maxBlocksInCache>0,i=o?this.params.maxBlocksInCache-1:null,n=QI-1;t.forEach((r,a)=>{const l=r.state==="needsLoading"&&a>=n,c=o?a>=i:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(r)||this.isBlockFocused(r))return;this.removeBlockFromCache(r)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:s,endRow:o}=e;return t.rowIndex>=s&&t.rowIndex<o}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:s}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,s-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:s,overflowSize:o}=this.params,n=(e.id+1)*s+o;this.rowCount<n&&(this.rowCount=n)}}setRowCount(e,t){this.rowCount=e,X(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const s of this.getBlocksInOrder())s.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(s,o)=>s.id-o.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const s=[];let o=-1,i=!1;const n={value:0};let r=!1;for(const l of this.getBlocksInOrder())if(!r){if(i&&o+1!==l.id){r=!0;continue}o=l.id,l.forEachNode(c=>{const d=c===e||c===t;(i||d)&&s.push(c),d&&(i=!i)},n,this.rowCount)}return r||i?[]:s}},e6=class extends O{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new io(e);this.rootNode=t,t.level=-1,this.rowHeight=Fo(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=Fo(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){let e;this.cacheParams?e=!jn(this.cacheParams.sortModel,this.beans.sortSvc?.getSortModel()??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?.getRowNodesInRange(e,t)??[]}reset(){if(!this.datasource)return;Li(this.gos)!=null||this.beans.selectionSvc?.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:s,rowNodeBlockLoader:o,eventSvc:i,gos:n}=e;this.cacheParams={datasource:this.datasource,filterModel:t?.getFilterModel()??{},sortModel:s?.getSortModel()??[],rowNodeBlockLoader:o,initialRowCount:n.get("infiniteInitialRowCount"),maxBlocksInCache:n.get("maxBlocksInCache"),rowHeight:Fo(e),overflowSize:n.get("cacheOverflowSize"),blockSize:n.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new JI(this.cacheParams)),i.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(s=>{s.id===e&&(t=s)}),t}forEachNode(e){this.infiniteCache?.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),s=this.getRowCount()-1;return t>s?s:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache?.refreshCache()}purgeCache(){this.infiniteCache?.purgeCache()}isLastRowIndexKnown(){return this.infiniteCache?.isLastRowIndexKnown()??!1}setRowCount(e,t){this.infiniteCache?.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function t6(e){ml(e)?.refreshCache()}function s6(e){ml(e)?.purgeCache()}function o6(e){return ml(e)?.getRowCount()}var i6=class extends O{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=ly(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=lt(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){as(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){Ao(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(s=>s.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const s of t)s.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:s,state:o}=t.getBlockStateJson();e[s]=o}),e}printCacheStatus(){Ao(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},n6={moduleName:"InfiniteRowModelCore",version:Z,rowModels:["infinite"],beans:[e6,i6]},r6={moduleName:"InfiniteRowModel",version:Z,apiFunctions:{refreshInfiniteCache:t6,purgeInfiniteCache:s6,getInfiniteRowCount:o6},dependsOn:[n6,vI]},a6="↑",l6="↓",c6={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},d6=class extends Xe{constructor(){super(c6),this.eValue=ve,this.eDelta=ve,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const s=Math.abs(t),o=e.formatValue(s),i=X(o)?o:s,n=t>=0,r=this.eDelta;n?r.textContent=a6+i:r.textContent=l6+i,r.classList.toggle("ag-value-change-delta-up",n),r.classList.toggle("ag-value-change-delta-down",!n)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Mt(this.eDelta)}refresh(e,t=!1){const{value:s,valueFormatted:o}=e,{eValue:i,lastValue:n,beans:r}=this;if(s===n||(X(o)?i.textContent=o:X(s)?i.textContent=s:Mt(i),r.filterManager?.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=s&&typeof s=="object"&&"toNumber"in s?s.toNumber():s,l=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const c=a-l;this.showDelta(e,c)}return n&&i.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=s,!0}},u6=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",h6={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},g6=class extends Xe{constructor(){super(h6),this.eCurrent=ve,this.refreshCount=0,this.registerCSS(u6)}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious?.remove();const{beans:t,eCurrent:s}=this,o=Rt({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=o,o.textContent=s.textContent,this.getGui().insertBefore(o,s),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.ePrevious?.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){let s=e.value;if(qe(s)&&(s=""),s===this.lastValue||this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=s;const o=this.eCurrent;return X(e.valueFormatted)?o.textContent=e.valueFormatted:X(e.value)?o.textContent=s:Mt(o),!0}},p6=class extends O{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,s=this.beans.gos.get("cellFlashDuration"),o=this.beans.gos.get("cellFadeDuration")){const i=this.animations[t];i.delete(e);const n=Date.now(),r=n+s,a=n+s+o,l={phase:"flash",flashEndTime:r,fadeEndTime:a};i.set(e,l);const c=`ag-cell-${t}`,d=`${c}-animation`,{comp:u,eGui:{style:h}}=e;u.toggleCss(c,!0),u.toggleCss(d,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&r+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),s)}),this.nextAnimationTime=r)}advanceAnimations(){const e=Date.now();let t=null;for(const s of Object.keys(this.animations)){const o=this.animations[s],i=`ag-cell-${s}`,n=`${i}-animation`;for(const[r,a]of o){if(!r.isAlive()||!r.comp){o.delete(r);continue}const{phase:l,flashEndTime:c,fadeEndTime:d}=a,u=l==="flash"?c:d;if(!(e+15>=u)){t=Math.min(u,t??1/0);continue}const{comp:p,eGui:{style:m}}=r;switch(l){case"flash":p.toggleCss(i,!1),p.toggleCss(n,!0),m.transition=`background-color ${d-c}ms`,m.transitionDelay=`${c-e}ms`,t=Math.min(d,t??1/0),a.phase="fade";break;case"fade":p.toggleCss(i,!1),p.toggleCss(n,!1),m.removeProperty("transition"),m.removeProperty("transition-delay"),o.delete(r);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const s=nE(e.cellPosition);t.cells[s]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t?.flashDuration,t?.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function f6(e,t={}){const{cellFlashSvc:s}=e;s&&e.frameworkOverrides.wrapIncoming(()=>{for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))s.flashCell(o,t)})}var m6={moduleName:"HighlightChanges",version:Z,beans:[p6],userComponents:{agAnimateShowChangeCellRenderer:d6,agAnimateSlideCellRenderer:g6},apiFunctions:{flashCells:f6}};function C6(e){return e.stateSvc?.getState()??{}}function v6(e,t,s){return e.stateSvc?.setState(t,s)}function rp(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=w6(e)),e.version=Z,e}function w6(e){return e.cellSelection=b6(e,"rangeSelection"),e}function b6(e,t){if(e&&typeof e=="object")return e[t]}var S6=class extends O{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=lt(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=lt(this,()=>{this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(this.updateCachedState("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowGroupExpansion",void 0)):(this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("ssrmRowGroupExpansion",void 0))},0),this.onRowSelectedDebounced=lt(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:s}=this.beans;this.isClientSideRowModel=Qe(e);const o=rp(e.get("initialState")??{}),i=o.partialColumnState;delete o.partialColumnState,this.cachedState=o;const n=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>n(()=>this.setupStateOnGridReady(o))),(o.columnOrder||o.columnVisibility||o.columnSizing||o.columnPinning||o.columnGroup)&&s?.hideColumns("columnState");const[r,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(r(),n(()=>{this.setupStateOnColumnsInitialised(o,!!i),s?.revealColumns("columnState")}))},rowCountReady:()=>{a?.(),n(()=>this.setupStateOnRowCountReady(o))},firstDataRendered:()=>{l?.(),n(()=>this.setupStateOnFirstDataRendered(o))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const s=rp(e);delete s.partialColumnState,this.cachedState=s,this.startSuppressEvents();const o="api",i=t?new Set(t):void 0;this.setGridReadyState(s,o,i),this.setColumnsInitialisedState(s,o,!!i,i),this.setRowCountState(s,o,i),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(s,o,i),this.stopSuppressEvents(o)})}setGridReadyState(e,t,s){t==="api"&&!s?.has("sideBar")&&this.beans.sideBar?.comp?.setState(e.sideBar),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,s,o){this.setColumnState(e,t,s,o),this.setColumnGroupState(e,t,o),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const s=o=>()=>this.updateColumnState([o]);this.addManagedEventListeners({columnValueChanged:s("aggregation"),columnMoved:s("columnOrder"),columnPinned:s("columnPinning"),columnResized:s("columnSizing"),columnVisible:s("columnVisibility"),columnPivotChanged:s("pivot"),columnPivotModeChanged:s("pivot"),columnRowGroupChanged:s("rowGroup"),sortChanged:s("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,s){const{filter:o,rowGroupExpansion:i,ssrmRowGroupExpansion:n,rowSelection:r,pagination:a}=e,l=(d,u)=>!s?.has(d)&&(u||t==="api");l("filter",o)&&this.setFilterState(o),l("rowGroupExpansion",i)&&this.setRowGroupExpansionState(n,i,t),l("rowSelection",r)&&this.setRowSelectionState(r,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),s=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},o=()=>t("filter",this.getFilterState()),{gos:i,colFilter:n}=this.beans;this.addManagedEventListeners({filterChanged:o,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:s,columnRowGroupChanged:s,rowDataUpdated:()=>{(i.get("groupDefaultExpanded")!==0||i.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(s)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:r=>{(r.newPage||r.newPageSize)&&t("pagination",this.getPaginationState())}}),n&&this.addManagedListeners(n,{filterStateChanged:o})}setFirstDataRenderedState(e,t,s){const{scroll:o,cellSelection:i,focusedCell:n,columnOrder:r,rowPinning:a}=e,l=(u,h)=>!s?.has(u)&&(h||t==="api");l("focusedCell",n)&&this.setFocusedCellState(n),l("cellSelection",i)&&this.setCellSelectionState(i),l("scroll",o)&&this.setScrollState(o),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!r?.orderedColIds,t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const d=this.getRangeSelectionState();c("rangeSelection",d),c("cellSelection",d),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),s=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:s,cellFocusCleared:s,cellSelectionChanged:o=>{if(o.finished){const i=this.getRangeSelectionState();t("rangeSelection",i),t("cellSelection",i)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return f4(Ba(e),e.colModel.isPivotMode())}setColumnState(e,t,s,o){const{sort:i,rowGroup:n,aggregation:r,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:d,columnOrder:u}=e;let h=!1;const p=(T,M)=>{const k=!o?.has(T)&&!!(M||t==="api");return h||(h=k),k},m={},C=T=>{let M=m[T];return M||(M={colId:T},m[T]=M,M)},v={},w=p("sort",i);w&&i?.sortModel.forEach(({colId:T,sort:M},k)=>{const N=C(T);N.sort=M,N.sortIndex=k}),(w||!s)&&(v.sort=null,v.sortIndex=null);const b=p("rowGroup",n);b&&n?.groupColIds.forEach((T,M)=>{const k=C(T);k.rowGroup=!0,k.rowGroupIndex=M}),(b||!s)&&(v.rowGroup=null,v.rowGroupIndex=null);const S=p("aggregation",r);S&&r?.aggregationModel.forEach(({colId:T,aggFunc:M})=>{C(T).aggFunc=M}),(S||!s)&&(v.aggFunc=null);const x=p("pivot",a);x&&(a?.pivotColIds.forEach((T,M)=>{const k=C(T);k.pivot=!0,k.pivotIndex=M}),this.gos.updateGridOptions({options:{pivotMode:!!a?.pivotMode},source:t})),(x||!s)&&(v.pivot=null,v.pivotIndex=null);const y=p("columnPinning",l);if(y){for(const T of l?.leftColIds??[])C(T).pinned="left";for(const T of l?.rightColIds??[])C(T).pinned="right"}(y||!s)&&(v.pinned=null);const F=p("columnVisibility",c);if(F)for(const T of c?.hiddenColIds??[])C(T).hide=!0;(F||!s)&&(v.hide=null);const R=p("columnSizing",d);if(R)for(const{colId:T,flex:M,width:k}of d?.columnSizingModel??[]){const N=C(T);N.flex=M??null,N.width=k}(R||!s)&&(v.flex=null);const E=u?.orderedColIds,D=!!E?.length&&!o?.has("columnOrder"),P=D?E.map(T=>C(T)):Object.values(m);(P.length||h)&&(this.columnStates=P,rs(this.beans,{state:P,applyOrder:D,defaultState:v},t))}setColumnPivotState(e,t){const s=this.columnStates;this.columnStates=void 0;const o=this.columnGroupStates;this.columnGroupStates=void 0;const i=this.beans,{pivotResultCols:n,colGroupSvc:r}=i;if(n?.isPivotResultColsPresent()){if(s){const a=[];for(const l of s)n.getPivotResultCol(l.colId)&&a.push(l);rs(i,{state:a,applyOrder:e},t)}o&&r?.setColumnGroupState(o,t)}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return m4(t)}setColumnGroupState(e,t,s){const o=this.beans.colGroupSvc;if(!o||s?.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const i=new Set(e.columnGroup?.openColumnGroupIds),r=o.getColumnGroupState().map(({groupId:a})=>{const l=i.has(a);return l&&i.delete(a),{groupId:a,open:l}});for(const a of i)r.push({groupId:a,open:!0});r.length&&(this.columnGroupStates=r),o.setColumnGroupState(r,t)}getFilterState(){const e=this.beans.filterManager;let t=e?.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const s=e?.getFilterState(),o=e?.getAdvFilterModel()??void 0;return t||o||s?{filterModel:t,columnFilterState:s,advancedFilterModel:o}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:s,columnFilterState:o,advancedFilterModel:i}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(s!==void 0||o!==void 0)&&t?.setFilterState(s??null,o??null,"columnFilter"),i!==void 0&&t?.setAdvFilterModel(i??null,"advancedFilter")}getRangeSelectionState(){const e=this.beans.rangeSvc?.getCellRanges().map(t=>{const{id:s,type:o,startRow:i,endRow:n,columns:r,startColumn:a}=t;return{id:s,type:o,startRow:i,endRow:n,colIds:r.map(l=>l.getColId()),startColId:a.getColId()}});return e?.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:s,colModel:o,visibleCols:i}=this.beans;if(!so(t)||!s)return;const n=[];for(const r of e?.cellRanges??[]){const a=[];for(const c of r.colIds){const d=o.getCol(c);d&&a.push(d)}if(!a.length)continue;let l=o.getCol(r.startColId);if(!l){const c=i.allCols,d=new Set(a);l=c.find(u=>d.has(u))}n.push({...r,columns:a,startColumn:l})}s.setCellRanges(n)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=e?.getHScrollPosition()??{left:0},{top:s}=e?.getVScrollPosition()??{top:0};return s||t?{top:s,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:s}=e??{top:0,left:0},{frameworkOverrides:o,rowRenderer:i,animationFrameSvc:n,ctrlsSvc:r}=this.beans;o.wrapIncoming(()=>{r.get("center").setCenterViewportScrollLeft(s),r.getScrollFeature()?.setVerticalScrollPosition(t),i.redraw({afterScroll:!0}),n?.flushAllFrames()})}getSideBarState(){return this.beans.sideBar?.comp?.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:s,rowPinned:o}=e;return{colId:t.getColId(),rowIndex:s,rowPinned:o}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:s}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:o,rowIndex:i,rowPinned:n}=e;t.setFocusedCell({column:s.getCol(o),rowIndex:i,rowPinned:n,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const s=e.getCurrentPage(),o=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!s&&!o))return{page:s,pageSize:o}}setPaginationState(e,t){const{pagination:s,gos:o}=this.beans;if(!s)return;const{pageSize:i,page:n}=e??{page:0,pageSize:o.get("paginationPageSize")},r=t==="gridInitializing";i&&!o.get("paginationAutoPageSize")&&s.setPageSize(i,r?"initialState":"pageSizeSelector"),typeof n=="number"&&(r?s.setPage(n):s.goToPage(n))}getRowSelectionState(){const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!t?.toggledNodes?.length?void 0:t}setRowSelectionState(e,t){this.beans.selectionSvc?.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){return this.beans.pinnedRowModel?.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t?.setPinnedState(e):t?.reset()}setRowGroupExpansionState(e,t,s){const o=this.beans.expansionSvc;if(!o)return;const i=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};o.setExpansionState(i,s)}updateColumnState(e){const t=this.getColumnState();let s=!1;const o=this.cachedState;for(const i of Object.keys(t)){const n=t[i];jn(n,o[i])||(s=!0)}this.cachedState={...o,...t},s&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const s=this.cachedState[e];this.setCachedStateValue(e,t),jn(t,s)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){const e=this.staleStateKeys;for(const t of e)t==="rowSelection"&&this.setCachedStateValue(t,this.getRowSelectionState());e.clear()}dispatchStateUpdateEvent(e){if(!this.suppressEvents){for(const t of e)this.queuedUpdateSources.add(t);this.dispatchStateUpdateEventDebounced()}}dispatchQueuedStateUpdateEvents(){const e=this.queuedUpdateSources,t=Array.from(e);e.clear(),this.eventSvc.dispatchEvent({type:"stateUpdated",sources:t,state:this.cachedState})}startSuppressEvents(){this.suppressEvents=!0,this.beans.colAnimation?.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.beans.colAnimation?.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},y6={moduleName:"GridState",version:Z,beans:[S6],apiFunctions:{getState:C6,setState:v6}};function x6(e){return e.rowModel.isLastRowIndexKnown()}function R6(e){return e.pagination?.getPageSize()??100}function F6(e){return e.pagination?.getCurrentPage()??0}function E6(e){return e.pagination?.getTotalPages()??1}function D6(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function P6(e){e.pagination?.goToNextPage()}function T6(e){e.pagination?.goToPreviousPage()}function M6(e){e.pagination?.goToFirstPage()}function I6(e){e.pagination?.goToLastPage()}function k6(e,t){e.pagination?.goToPage(t)}var A6=class extends O{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,s=()=>{const o=Math.max(Fo(t),1),i=Math.floor(e/o);t.pagination.setPageSize(i,"autoCalculated")};this.isBodyRendered?lt(this,s,50)():(s(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},Sn="paginationPageSizeSelector",L6={tag:"span",cls:"ag-paging-page-size"},O6=class extends Xe{constructor(){super(L6),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.pagination.getPageSize()||(this.pagination.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.pagination=e.pagination}postConstruct(){this.addManagedPropertyListener(Sn,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!e?.newPageSize)return;const t=this.pagination.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){Mt(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(Sn)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),s=!t||!e.includes(t);if(s){const i=this.gos.exists("paginationPageSize"),n=this.gos.get(Sn)!==!0;z(94,{pageSizeSet:i,pageSizesSet:n,pageSizeOptions:e,paginationPageSizeOption:t}),n||z(95,{paginationPageSizeOption:t,paginationPageSizeSelector:Sn}),e.unshift("")}const o=String(s?"":t);this.selectPageSizeComp?(ro(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=s}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const s=this.getLocaleTextFunc(),o=s("pageSizeSelectorLabel","Page Size:"),i=s("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new Eu).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(i).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(Sn);return!Array.isArray(t)||!t?.length?e:[...t].sort((s,o)=>s-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},N6={selector:"AG-PAGE-SIZE-SELECTOR",component:O6},H6=".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;gap:calc(var(--ag-spacing)*4);height:var(--ag-pagination-panel-height);justify-content:flex-end;padding:0 var(--ag-cell-horizontal-padding)}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}",G6=class extends IF{constructor(){super(),this.btFirst=ve,this.btPrevious=ve,this.btNext=ve,this.btLast=ve,this.lbRecordCount=ve,this.lbFirstRowOnPage=ve,this.lbLastRowOnPage=ve,this.lbCurrent=ve,this.lbTotal=ve,this.pageSizeComp=ve,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(H6)}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination,this.ariaAnnounce=e.ariaAnnounce}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[N6]);const{btFirst:t,btPrevious:s,btNext:o,btLast:i}=this;this.activateTabIndex([t,s,o,i]),t.insertAdjacentElement("afterbegin",Jt(e?"last":"first",this.beans)),s.insertAdjacentElement("afterbegin",Jt(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",Jt(e?"previous":"next",this.beans)),i.insertAdjacentElement("afterbegin",Jt(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:n=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(n):Y2(this.beans,n),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:s}=e;this.addManagedListeners(t,{click:s,keydown:o=>{(o.key===I.ENTER||o.key===I.SPACE)&&(o.preventDefault(),s())}})}K2(this.beans,this,this.getGui()),this.areListenersSetup=!0}}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");return t?t({value:e}):v4(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),s=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const o=this.isZeroPagesToDisplay(),i=e===s-1;this.nextButtonDisabled=i||o,this.lastButtonDisabled=!t||o||e===s-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){hS(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),s=this.pagination.getMasterRowCount(),o=e?s:null,i=this.pagination.getCurrentPage(),n=this.pagination.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=n*i+1,a=r+n-1,e&&a>o&&(a=o));const l=r+n-1,c=!e&&s<l,d=this.formatNumber(r);this.lbFirstRowOnPage.textContent=d;let u;const h=this.getLocaleTextFunc();c?u=h("pageLastRowUnknown","?"):u=this.formatNumber(a),this.lbLastRowOnPage.textContent=u;const m=t>0?i+1:0,C=this.formatNumber(m);this.lbCurrent.textContent=C;let v,w;if(e)v=this.formatNumber(t),w=this.formatNumber(o);else{const b=h("more","more");v=b,w=b}this.lbTotal.textContent=v,this.lbRecordCount.textContent=w,this.announceAriaStatus(d,u,w,C,v)}announceAriaStatus(e,t,s,o,i){const n=this.getLocaleTextFunc(),r=n("page","Page"),a=n("to","to"),l=n("of","of"),c=`${e} ${a} ${t} ${l} ${s}`,d=`${r} ${o} ${l} ${i}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,this.ariaAnnounce?.announceValue(c,"paginationRow")),d!==this.ariaPageStatus&&(this.ariaPageStatus=d,this.ariaAnnounce?.announceValue(d,"paginationPage"))}},B6={selector:"AG-PAGINATION",component:G6},V6=class extends O{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return B6}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:s}=this.beans;s?.isEditing()&&(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){if(!this.active)return;let t=e;this.paginateChildRows||(t=this.beans.rowModel.getTopLevelIndexFromDisplayedIndex?.(e)??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return X(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:X(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:X(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:X(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const s=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}s!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const s=this.pageSize,o=t-1;this.totalPages=Math.floor(o/s)+1,this.adjustCurrentPageIfInvalid();const i=this.currentPage,n=s*i;let r=s*(i+1)-1;if(r>o&&(r=o),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(n),r===o)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(r+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:s}=this,o=e-1;this.totalPages=Math.floor(o/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*s,this.bottomDisplayedRowIndex=t*(s+1)-1,this.bottomDisplayedRowIndex>o&&(this.bottomDisplayedRowIndex=o)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:s=!1,newPageSize:o=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:s,newPageSize:o,keepRenderedRows:t})}},z6={moduleName:"Pagination",version:Z,beans:[V6,A6],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:x6,paginationGetPageSize:R6,paginationGetCurrentPage:F6,paginationGetTotalPages:E6,paginationGetRowCount:D6,paginationGoToNextPage:P6,paginationGoToPreviousPage:T6,paginationGoToFirstPage:M6,paginationGoToLastPage:I6,paginationGoToPage:k6},dependsOn:[Cl]};function W6(e,t={}){const s=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(s))}function cv(e,t,s,o,i){t&&(o&&t.parent&&t.parent.level!==-1&&cv(e,t.parent,s,o,i),t.setExpanded(s,void 0,i))}function _6(e,t){return e.rowModel.getRowNode(t)}function j6(e,t,s,o){e.rowRenderer.addRenderedRowListener(t,s,o)}function U6(e){return e.rowRenderer.getRenderedNodes()}function $6(e,t,s){e.rowModel.forEachNode(t,s)}function q6(e){return e.rowRenderer.firstRenderedRow}function K6(e){return e.rowRenderer.lastRenderedRow}function Y6(e,t){return e.rowModel.getRow(t)}function Z6(e){return e.rowModel.getRowCount()}var X6={moduleName:"RowApi",version:Z,apiFunctions:{redrawRows:W6,setRowNodeExpanded:cv,getRowNode:_6,addRenderedRowListener:j6,getRenderedNodes:U6,forEachNode:$6,getFirstDisplayedRowIndex:q6,getLastDisplayedRowIndex:K6,getDisplayedRowAtIndex:Y6,getDisplayedRowCount:Z6}},Q6={moduleName:"ScrollApi",version:Z,apiFunctions:{getVerticalPixelRange:dM,getHorizontalPixelRange:uM,ensureColumnVisible:YC,ensureIndexVisible:ZC,ensureNodeVisible:hM}};function J6(e,t,s){if(!t)return;const o=e.ctrlsSvc.getGridBodyCtrl().eGridBody,i=`aria-${t}`;s===null?o.removeAttribute(i):o.setAttribute(i,s)}function ek(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function tk(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function sk(e){return e.animationFrameSvc?.isQueueEmpty()??!0}function ok(e){e.animationFrameSvc?.flushAllFrames()}function ik(e){return{rowHeight:Fo(e),headerHeight:hr(e)}}function nk(e,t={}){const s=[];for(const n of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const r=n.getCellRenderer();r!=null&&s.push(Xn(r))}if(t.columns?.length)return s;const o=[],i=Hd(t.rowNodes);for(const n of e.rowRenderer.getAllRowCtrls()){if(i&&!Gd(n.rowNode,i)||!n.isFullWidth())continue;const r=n.getFullWidthCellRenderers();for(let a=0;a<r.length;a++){const l=r[a];l!=null&&o.push(Xn(l))}}return[...o,...s]}var rk={moduleName:"RenderApi",version:Z,apiFunctions:{setGridAriaProperty:J6,refreshCells:ek,refreshHeader:tk,isAnimationFrameQueueEmpty:sk,flushAllAnimationFrames:ok,getSizesForCurrentTheme:ik,getCellRendererInstances:nk}};function ak(e,t){typeof t=="number"?e.colAutosize?.sizeColumnsToFit(t,"api"):e.colAutosize?.sizeColumnsToFitGridBody(t)}function dv({colAutosize:e,visibleCols:t},s,o){Array.isArray(s)?e?.autoSizeCols({colKeys:s,skipHeader:o,source:"api"}):e?.autoSizeCols({...s,colKeys:s.colIds??t.allCols,source:"api"})}function lk(e,t){t&&typeof t=="object"?dv(e,t):e.colAutosize?.autoSizeAllColumns({source:"api",skipHeader:t})}var ck=class extends O{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let s=!1;const o=t.type;if(o==="fitGridWidth"||o==="fitProvidedWidth")s=!0;else if(o==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const i=e.get("rowData");s=i!=null&&i.length>0&&Qe(e)}s&&this.beans.colDelayRenderSvc?.hideColumns(o)}}autoSizeCols(e){const{eventSvc:t,visibleCols:s}=this.beans;this.innerAutoSizeCols(e).then(o=>{const i=c=>Oi(t,Array.from(c),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return i(o);const n=ap(this.beans),r=c=>s.leftCols.some(d=>On(d,c)),a=c=>s.rightCols.some(d=>On(d,c)),l=e.colKeys.filter(c=>!Vs(c)&&!As(c)&&!r(c)&&!a(c));this.sizeColumnsToFit(n,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:e.columnLimits?.map(c=>({...c,key:c.colId})),colKeys:l,onlyScaleUp:!0}),i(o)})}innerAutoSizeCols(e){return new Promise((t,s)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,s));const{colKeys:o,skipHeader:i,skipHeaderGroups:n,stopAtGroup:r,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:d="api"}=e,{animationFrameSvc:u,renderStatus:h,colModel:p,autoWidthCalc:m,visibleCols:C}=this.beans;if(u?.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,s)});return}this.timesDelayed=0;const v=new Set;let w=-1;const b=Object.fromEntries(c.map(({colId:y,...F})=>[y,F])),S=i??this.gos.get("skipHeaderOnAutoSize"),x=n??S;for(;w!==0;){w=0;const y=[];for(const F of o){if(!F||xy(F))continue;const R=p.getCol(F);if(!R||v.has(R))continue;const E=m.getPreferredWidthForColumn(R,S);if(E>0){const D=b[R.colId]??{};D.minWidth??(D.minWidth=l),D.maxWidth??(D.maxWidth=a);const P=dk(R,E,D);R.setActualWidth(P,d),v.add(R),w++}y.push(R)}y.length&&C.refresh(d)}x||this.autoSizeColumnGroupsByColumns(o,d,r),t(v)})}autoSizeColumn(e,t,s){this.autoSizeCols({colKeys:[e],skipHeader:s,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,s){const{colModel:o,ctrlsSvc:i}=this.beans,n=new Set,r=o.getColsForKeys(e);for(const l of r){let c=l.getParent();for(;c&&c!=s;)c.isPadding()||n.add(c),c=c.getParent()}let a;for(const l of n){for(const c of i.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a?.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const s=this.gos.get("skipHeaderOnAutoSize"),o=()=>{this.autoSizeColumn(t,"uiColumnResized",s)};e.addEventListener("dblclick",o);const i=new fo(e);return i.addEventListener("doubleTap",o),()=>{e.removeEventListener("dblclick",o),i.destroy()}}addColumnGroupResize(e,t,s){const o=this.gos.get("skipHeaderOnAutoSize"),i=()=>{const n=[],r=t.getDisplayedLeafColumns();for(const a of r)a.getColDef().suppressAutoSize||n.push(a.getColId());n.length>0&&this.autoSizeCols({colKeys:n,skipHeader:o,stopAtGroup:t,source:"uiColumnResized"}),s()};return e.addEventListener("dblclick",i),()=>e.removeEventListener("dblclick",i)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const s=ap(this.beans);if(s>0){this.sizeColumnsToFit(s,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):z(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",s,o){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,s,o));return}const i={};for(const{key:m,...C}of o?.columnLimits??[])i[typeof m=="string"?m:m.getColId()]=C;const n=this.beans.visibleCols.allCols;if(e<=0||!n.length)return;const r=Ts(n);if(o?.onlyScaleUp&&r>e||e===r&&n.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const v=i?.[C.getId()],w=v?.minWidth??o?.defaultMinWidth,b=v?.maxWidth??o?.defaultMaxWidth,S=C.getActualWidth();return(w==null||S>=w)&&(b==null||S<=b)}))return;const l=[],c=[];for(const m of n){const C=o?.colKeys?.some(v=>On(m,v))??!0;m.getColDef().suppressSizeToFit||!C?c.push(m):l.push(m)}const d=l.slice(0);let u=!1;const h=m=>{as(l,m),c.push(m)};for(const m of l){m.resetActualWidth(t);const C=i?.[m.getId()],v=C?.minWidth??o?.defaultMinWidth,w=C?.maxWidth??o?.defaultMaxWidth,b=m.getActualWidth();typeof v=="number"&&b<v?m.setActualWidth(v,t,!0):typeof w=="number"&&b>w&&m.setActualWidth(w,t,!0)}for(;!u;){u=!0;const m=e-Ts(c);if(m<=0)for(const C of l){const v=i?.[C.getId()]?.minWidth??o?.defaultMinWidth??C.minWidth;C.setActualWidth(v,t,!0)}else{const C=m/Ts(l);let v=m;for(let w=l.length-1;w>=0;w--){const b=l[w],S=i?.[b.getId()],x=S?.minWidth??o?.defaultMinWidth,y=S?.maxWidth??o?.defaultMaxWidth,F=b.getMinWidth(),R=b.getMaxWidth(),E=typeof x=="number"&&x>F?x:F,D=typeof y=="number"&&y<R?y:R;let P=Math.round(b.getActualWidth()*C);P<E?(P=E,h(b),u=!1):P>D?(P=D,h(b),u=!1):w===0&&(P=v),b.setActualWidth(P,t,!0),v-=P}}}for(const m of d)m.fireColumnWidthChangedEvent(t);const p=this.beans.visibleCols;p.setLeftValues(t),p.updateBodyWidths(),!s&&Oi(this.eventSvc,d,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,s=e.get("autoSizeStrategy");s?.type!=="fitGridWidth"&&s?.type!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const o=s.type;if(o==="fitGridWidth"){const{columnLimits:i,defaultMinWidth:n,defaultMaxWidth:r}=s,a=i?.map(({colId:l,minWidth:c,maxWidth:d})=>({key:l,minWidth:c,maxWidth:d}));this.sizeColumnsToFitGridBody({defaultMinWidth:n,defaultMaxWidth:r,columnLimits:a})}else o==="fitProvidedWidth"&&this.sizeColumnsToFit(s.width,"sizeColumnsToFit");t?.revealColumns(o)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{if(!this.isAlive())return;const s="autosizeColumns";e?this.autoSizeCols({...t,source:s,colKeys:e}):this.autoSizeAllColumns({...t,source:s}),this.beans.colDelayRenderSvc?.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function dk(e,t,s={}){const o=s.minWidth??e.getMinWidth();t<o&&(t=o);const i=s.maxWidth??e.getMaxWidth();return t>i&&(t=i),t}function ap({ctrlsSvc:e,scrollVisibleSvc:t}){const s=e.getGridBodyCtrl(),i=s.isVerticalScrollShowing()?t.getScrollbarWidth():0;return qn(s.eGridBody)-i}var uk={moduleName:"ColumnAutoSize",version:Z,beans:[ck],apiFunctions:{sizeColumnsToFit:ak,autoSizeColumns:dv,autoSizeAllColumns:lk},dependsOn:[iC]},hk=".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}";function gk(e){return e.pinnedRowModel?.getPinnedTopRowCount()??0}function pk(e){return e.pinnedRowModel?.getPinnedBottomRowCount()??0}function fk(e,t){return e.pinnedRowModel?.getPinnedTopRow(t)}function mk(e,t){return e.pinnedRowModel?.getPinnedBottomRow(t)}function Ck(e,t,s){return e.pinnedRowModel?.forEachPinnedRow(t,s)}var vk={moduleName:"PinnedRow",version:Z,beans:[RF],css:[hk],apiFunctions:{getPinnedTopRowCount:gk,getPinnedBottomRowCount:pk,getPinnedTopRow:fk,getPinnedBottomRow:mk,forEachPinnedRow:Ck},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},wk=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){const e=this.firstNode.__autoHeights?.[this.col.getColId()];if(e==null)return;let t=0;for(const s of this.spannedNodes)s!==this.lastNode&&(t+=s.rowHeight);return e-t}},bk=class extends O{constructor(e){super(),this.column=e}buildCache(e){const{column:t,beans:{gos:s,pinnedRowModel:o,rowModel:i,valueSvc:n,pagination:r}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,d=s.getCallback("isFullWidthRow"),u=a.equals,h=a.spanRows,p=typeof h=="function";let m=null,C=null,v;const w=(S,x)=>{m=S,C=null,v=x},b=S=>{const x=!S.isExpandable()&&!S.group&&!S.detail&&(d?!d({rowNode:S}):!0);if(S.rowIndex==null||!x){w(null,null);return}if(m==null||S.level!==m.level||S.footer||C&&S.rowIndex-1!==C?.getLastNode().rowIndex){w(S,n.getValue(t,S));return}const y=n.getValue(t,S);if(p){const F=we(s,{valueA:v,nodeA:m,valueB:y,nodeB:S,column:t,colDef:a});if(!h(F)){w(S,y);return}}else if(u?!u(v,y):v!==y){w(S,y);return}if(!C){const F=l?.get(m);F?.firstNode===m?(F.reset(),C=F):C=new wk(t,m),c.set(m,C)}C.addSpannedNode(S),c.set(S,C)};switch(e){case"center":i.forEachDisplayedNode?.(S=>{(!r||r.isRowInPage(S.rowIndex))&&b(S)}),this.centerValueNodeMap=c;break;case"top":o?.forEachPinnedRow("top",b),this.topValueNodeMap=c;break;case"bottom":o?.forEachPinnedRow("bottom",b),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},Sk=class extends O{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=lt(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=lt(this,this.dispatchCellsUpdatedEvent.bind(this,!1),0),this.pinnedTimeout=null,this.modelTimeout=null}postConstruct(){const e=this.onRowDataUpdated.bind(this),t=this.buildPinnedCaches.bind(this);this.addManagedEventListeners({paginationChanged:this.buildModelCaches.bind(this),pinnedRowDataChanged:t,pinnedRowsChanged:t,rowNodeDataChanged:e,cellValueChanged:e})}register(e){const{gos:t}=this.beans;if(!t.get("enableCellSpan")||this.spanningColumns.has(e))return;const s=this.createManagedBean(new bk(e));this.spanningColumns.set(e,s),s.buildCache("top"),s.buildCache("bottom"),s.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t?.createCtrls("top"),t?.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t?.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const s=this.spanningColumns.get(e);return s?s.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:s}=this.beans,o=e.column,i=e.rowIndex,n=this.spanningColumns.get(o);if(!n)return;let r;switch(e.rowPinned){case"top":r=t?.getPinnedTopRow(i);break;case"bottom":r=t?.getPinnedBottomRow(i);break;default:r=s.getRow(i)}if(r)return n.getCellSpan(r)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const s=this.spanningColumns.get(e);if(s)return s.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[s,o]of this.spanningColumns)if(o.isCellSpanning(e)){const i=o.getCellSpan(e);t(s,i)}}destroy(){super.destroy(),this.spanningColumns.clear()}},yk=class extends Mi{constructor(e,t,s){super(e.col,e.firstNode,s,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,s,o,i,n,r){this.eWrapper=s,super.setComp(e,t,s,o,i,n,r),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||uf(e,t.rowIndex)}setAriaRowSpan(){mS(this.eGui,this.cellSpan.spannedNodes.size)}setFocusedCellPosition(e){this.focusedCellPosition=e}getFocusedCellPosition(){return this.focusedCellPosition??this.cellPosition}checkCellFocused(){const e=this.beans.focusSvc.getFocusedCell();return!!e&&this.cellSpan.doesSpanContain(e)}applyStaticCssClasses(){super.applyStaticCssClasses(),this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS,!0)}onCellFocused(e){const{beans:t}=this;if(pl(t)){this.focusedCellPosition=void 0;return}const s=this.isCellFocused();s||(this.focusedCellPosition=void 0),e&&s&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},xk=class extends qa{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){const t=this.beans.rowSpanSvc?.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new yk(t,this,this.beans)}isCorrectCtrlForSpan(e){const t=this.beans.rowSpanSvc?.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},Rk=class extends O{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,s=this.getCtrlsMap(e),o=s.size,i=this.getAllRelevantRowControls(e),n=new Map;let r=!1;for(const l of i)l.isAlive()&&t?.forEachSpannedColumn(l.rowNode,(c,d)=>{if(n.has(d.firstNode))return;const u=s.get(d.firstNode);if(u){n.set(d.firstNode,u),s.delete(d.firstNode);return}r=!0;const h=new xk(d.firstNode,this.beans,!1,!1,!1);n.set(d.firstNode,h)});this.setCtrlsMap(e,n);const a=n.size===o;if(!(!r&&a)){for(const l of s.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,s=t?.getCellSpanByPosition(e);if(!s)return;const o=this.getCtrlsMap(e.rowPinned).get(s.firstNode);if(o)return o.getAllCellCtrls().find(i=>i.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},Fk={moduleName:"CellSpan",version:Z,beans:[Sk,Rk]},Ek=class extends O{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,s=e.colDef,o=s.cellClassRules,i=this.getCellClassParams(e,s);ju(this.beans.expressionSvc,o===this.cellClassRules?void 0:this.cellClassRules,o,i,n=>t.toggleCss(n,!0),n=>t.toggleCss(n,!1)),this.cellClassRules=o}applyUserStyles(){const e=this.column,t=e.colDef,s=t.cellStyle;if(!s)return;let o;if(typeof s=="function"){const i=this.getCellClassParams(e,t);o=s(i)}else o=s;o&&this.cellComp.setUserStyles(o)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,s=e.colDef,o=this.getCellClassParams(e,s);for(const n of this.staticClasses)t.toggleCss(n,!1);const i=this.beans.cellStyles.getStaticCellClasses(s,o);this.staticClasses=i;for(const n of i)t.toggleCss(n,!0)}getCellClassParams(e,t){const{value:s,rowNode:o}=this.cellCtrl;return we(this.beans.gos,{value:s,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},Dk=class extends O{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,s,o){ju(this.beans.expressionSvc,void 0,e.cellClassRules,t,s,o),this.processStaticCellClasses(e,t,s)}getStaticCellClasses(e,t){const{cellClass:s}=e;if(!s)return[];let o;return typeof s=="function"?o=s(t):o=s,typeof o=="string"&&(o=[o]),o||[]}createCellCustomStyleFeature(e,t){return new Ek(e,t)}processStaticCellClasses(e,t,s){this.getStaticCellClasses(e,t).forEach(i=>{s(i)})}},Pk={moduleName:"CellStyle",version:Z,beans:[Dk]},Tk={moduleName:"RowStyle",version:Z,beans:[p5]};function Mk(e,t){return!!e.colHover?.isHovered(t)}var Ik=class extends O{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=s=>{const{beans:o,gos:i,element:n,columns:r}=this,a=o.colHover;if(s??!!i.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(n,{mouseover:a.setMouseOver.bind(a,r),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},kk="ag-column-hover",Ak=class extends O{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,s){const o=()=>{const i=this.isHovered(s);t.toggleCss("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:o}),o()}onCellColumnHover(e,t){if(!t)return;const s=this.isHovered(e);t.toggleCss(kk,s)}addHeaderFilterColumnHoverListener(e,t,s,o){this.createHoverFeature(e,[s],o);const i=()=>{const n=this.isHovered(s);t.toggleCss("ag-column-hover",n)};e.addManagedEventListeners({columnHoverChanged:i}),i()}createHoverFeature(e,t,s){e.createManagedBean(new Ik(t,s))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},Lk={moduleName:"ColumnHover",version:Z,beans:[Ak],apiFunctions:{isColumnHovered:Mk}},Ok=class extends O{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){this.wrapSvc=this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.()}addListener(e,t){const s=this.wrapSvc?.wrap(e,t)??t,o=!Sa.has(e),i=o?this.asyncListeners:this.syncListeners;i.has(e)||i.set(e,new Set),i.get(e).add(s),this.eventSvc.addListener(e,s,o)}removeListener(e,t){const s=this.wrapSvc?.unwrap(e,t)??t,i=!!this.asyncListeners.get(e)?.delete(s);i||this.syncListeners.get(e)?.delete(s),this.eventSvc.removeListener(e,s,i)}addGlobalListener(e){const t=this.wrapSvc?.wrapGlobal(e)??e,s=(n,r)=>{Sa.has(n)&&t(n,r)},o=(n,r)=>{Sa.has(n)||t(n,r)};this.globalListenerPairs.set(e,{syncListener:s,asyncListener:o});const i=this.eventSvc;i.addGlobalListener(s,!1),i.addGlobalListener(o,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:s,globalListenerPairs:o}=this,i=s?.unwrapGlobal(e)??e;if(o.has(i)){const{syncListener:r,asyncListener:a}=o.get(i);t.removeGlobalListener(r,!1),t.removeGlobalListener(a,!0),o.delete(e)}else this.syncGlobalListeners.delete(i),t.removeGlobalListener(i,!1)}destroyEventListeners(e,t){e.forEach((s,o)=>{s.forEach(i=>this.eventSvc.removeListener(o,i,t)),s.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const s of e)this.eventSvc.removeGlobalListener(s,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:s,asyncListener:o})=>{t.removeGlobalListener(s,!1),t.removeGlobalListener(o,!0)}),e.clear()}};function Nk(e,t,s){e.apiEventSvc?.addListener(t,s)}function Hk(e,t,s){e.apiEventSvc?.removeListener(t,s)}function Gk(e,t){e.apiEventSvc?.addGlobalListener(t)}function Bk(e,t){e.apiEventSvc?.removeGlobalListener(t)}var Vk={moduleName:"EventApi",version:Z,apiFunctions:{addEventListener:Nk,addGlobalListener:Gk,removeEventListener:Hk,removeGlobalListener:Bk},beans:[Ok]},zk={moduleName:"Locale",version:Z,beans:[p4]},Wk=class extends O{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=lt(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){const{visibleCols:e,rowModel:t,rowSpanSvc:s,pinnedRowModel:o}=this.beans,i=e.autoHeightCols;let n=!1;const r=a=>{const l=a.__autoHeights;let c=to(this.beans,a).height;for(const d of i){let u=l?.[d.getColId()];const h=s?.getCellSpan(d,a);if(h){if(h.getLastNode()!==a)continue;if(u=s?.getCellSpan(d,a)?.getLastNodeAutoHeight(),!u)return}if(u==null){if(this.colSpanSkipCell(d,a))continue;return}c=Math.max(u,c)}c!==a.rowHeight&&(a.setRowHeight(c),n=!0)};o?.forEachPinnedRow?.("top",r),o?.forEachPinnedRow?.("bottom",r),t.forEachDisplayedNode?.(r),n&&t.onRowHeightChanged?.()}setRowAutoHeight(e,t,s){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[s.getId()];return}const o=e.__autoHeights[s.getId()];e.__autoHeights[s.getId()]=t,o!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:s,colViewport:o,visibleCols:i}=this.beans;if(!s.colSpanActive)return!1;let n=[];switch(e.getPinned()){case"left":n=i.getLeftColsForRow(t);break;case"right":n=i.getRightColsForRow(t);break;case null:n=o.getColsWithinViewport(t);break}return!n.includes(e)}setupCellAutoHeight(e,t,s){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:i,column:n}=e,r=this.beans,a=d=>{if(this.beans.editSvc?.isEditing(e)||!e.isAlive()||!s.isAlive())return;const{paddingTop:u,paddingBottom:h,borderBottomWidth:p,borderTopWidth:m}=Vo(o),C=u+h+p+m,w=t.offsetHeight+C;if(d<5){const S=!dt(r)?.contains(t),x=w==0;if(S||x){window.setTimeout(()=>a(d+1),0);return}}this.setRowAutoHeight(i,w,n)},l=()=>a(0);l();const c=Gs(r,t,l);return s.addDestroyFunc(()=>{c(),this.setRowAutoHeight(i,void 0,n)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:s}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(s).filter(i=>i.isAutoHeight())),t.length!==0){if(!s.__autoHeights)return!1;for(const o of t){const i=s.__autoHeights[o.getColId()];if(!i||s.rowHeight<i)return!1}}return!0}},_k={moduleName:"RowAutoHeight",version:Z,beans:[Wk]},jk={moduleName:"AllCommunity",version:Z,dependsOn:[WI,ZI,r6,A4,_M,jM,UM,$M,qM,KM,YM,WM,OT,NT,HT,LT,BT,VT,y6,bI,z6,nC,X6,Q6,rk,uk,SE,vk,dI,Z5,Pk,Lk,Tk,Vk,J5,m6,KC,zk,_k,bE,_I,Fk]};function ae(e,t={}){const s=Object.keys(t).map(o=>{const i=t[o];return i!=null?`${o}=${i}`:null}).filter(Boolean).join(";");return[e,s].filter(o=>o.length>0).join(":")}var ee={grid(e){return ae("ag-grid-root",{gridId:e})},headerGroupCell(e){return ae("ag-header-group-cell",{colId:e})},headerCell(e){return ae("ag-header-cell",{colId:e})},headerCheckbox(e){return ae("ag-header-selection-checkbox",{colId:e})},headerFilterButton(e){return ae("ag-header-cell-filter-button",{colId:e})},floatingFilter(e){return ae("ag-floating-filter",{colId:e})},floatingFilterButton(e){return ae("ag-floating-filter-button",{colId:e})},headerCellMenuButton(e){return ae("ag-header-cell-menu-button",{colId:e})},headerResizeHandle(e){return ae("ag-header-cell-resize",{colId:e})},filterInstancePickerDisplay(e){return ae(`ag-${e.source}-picker-display`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},numberFilterInstanceInput(e){return ae(`ag-${e.source}-number-input`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},textFilterInstanceInput(e){return ae(`ag-${e.source}-text-input`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},dateFilterInstanceInput(e){return ae(`ag-${e.source}-date-input`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},setFilterInstanceMiniFilterInput(e){return ae(`ag-${e.source}-set-filter-mini-filter-input`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},setFilterInstanceItem(e,t){return ae(`ag-${e.source}-set-filter-item`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,itemLabel:t}:{colId:e.colId,itemLabel:t})},setFilterApplyPanelButton(e,t){return ae(`ag-${e.source}-set-filter-apply-panel-button`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,buttonLabel:t}:{colId:e.colId,buttonLabel:t})},filterConditionRadioButton(e,t){return ae(`ag-${e.source}-filter-condition-radio-button`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,buttonLabel:t}:{colId:e.colId,buttonLabel:t})},advancedFilterInput(){return ae("ag-advanced-filter-input")},advancedFilterButton(e){return ae("ag-advanced-filter-button",{label:e})},advancedFilterBuilderButton(){return ae("ag-advanced-filter-builder-button")},advancedFilterPanelMaximiseButton(){return ae("ag-advanced-filter-builder-panel-maximise")},advancedFilterPanelCloseButton(){return ae("ag-advanced-filter-builder-panel-close")},advancedFilterPill(e){return ae("ag-advanced-filter-builder-pill",{label:e})},advancedFilterBuilderAddItemButton(){return ae("ag-advanced-filter-builder-add-item-button")},rowNode(e){return ae("ag-row",{"row-id":e})},cell(e,t){return ae("ag-cell",{"row-id":e,colId:t})},autoGroupCell(e){return ee.cell(e,Xs)},checkbox(e,t){return ae("ag-selection-checkbox",{"row-id":e,colId:t})},selectionColumnCheckbox(e){return ee.checkbox(e,Cu)},autoGroupColumnCheckbox(e){return ee.checkbox(e,Xs)},dragHandle(e,t){return ae("ag-drag-handle",{"row-id":e,colId:t})},groupContracted(e,t){return ae("ag-group-contracted",{"row-id":e,colId:t})},groupExpanded(e,t){return ae("ag-group-expanded",{"row-id":e,colId:t})},autoGroupContracted(e){return ee.groupContracted(e,Xs)},autoGroupExpanded(e){return ee.groupExpanded(e,Xs)},rowNumber(e){return ee.cell(e,vu)},menu(){return ae("ag-menu")},menuOption(e){return ae("ag-menu-option",{option:e})},sideBar(){return ae("ag-side-bar")},sideBarButton(e){return ae("ag-side-button",{label:e})},columnToolPanel(){return ae("ag-column-panel")},pivotModeSelect(){return ae("ag-pivot-mode-select")},columnPanelSelectHeaderCheckbox(){return ae("ag-column-panel-select-header-checkbox")},columnPanelSelectHeaderFilter(){return ae("ag-column-panel-select-header-filter")},columnSelectListItemGroupClosedIcon(e){return ae("ag-column-select-list-item-group-closed-icon",{label:e})},columnSelectListItemCheckbox(e){return ae("ag-column-select-list-item-checkbox",{label:e})},columnSelectListItemDragHandle(e){return ae("ag-column-select-list-item-drag-handle",{label:e})},columnDropCellDragHandle(e,t,s){return ae("ag-column-drop-cell-drag-handle",{source:e,area:t,label:s})},columnDropCellCancelButton(e,t,s){return ae("ag-column-drop-cell-cancel",{source:e,area:t,label:s})},columnDropArea(e,t){return ae("ag-column-drop-area",{source:e,name:t})},filterToolPanel(){return ae("ag-filter-panel")},filterToolPanelAddFilterButton(){return ae("ag-filter-panel-add-filter-button")},filterToolPanelFilterTypeSelector(e){return ae("ag-filter-panel-filter-type-selector",{colLabel:e})},filterToolPanelSearchInput(){return ae("ag-filter-toolpanel-search-input")},filterToolPanelGroup(e){return ae("ag-filter-toolpanel-group",{title:e})},filterToolPanelGroupCollapsedIcon(e){return ae("ag-filter-toolpanel-group-collapsed-icon",{title:e})},statusBarTotalAndFilteredRowCount(){return ae("ag-status-bar-total-and-filtered-row-count")},statusBarTotalRowCount(){return ae("ag-status-bar-total-row-count")},statusBarFilteredRowCount(){return ae("ag-status-bar-filtered-row-count")},statusBarSelectedRowCount(){return ae("ag-status-bar-selected-row-count")},statusBarAggregations(){return ae("ag-status-bar-aggregations")},paginationPanelSizePickerDisplay(e){return ae("ag-pagination-page-size-picker-field-display",{value:e})},paginationPanelFirstRowOnPage(e){return ae("ag-paging-row-summary-panel-first-row-on-page",{value:e})},paginationPanelLastRowOnPage(e){return ae("ag-paging-row-summary-panel-last-row-on-page",{value:e})},paginationPanelRecordCount(e){return ae("ag-paging-row-summary-panel-record-count",{value:e})},paginationSummaryPanelButton(e){return ae("ag-paging-page-summary-panel-btn",{label:e})},paginationSummaryPanelCurrentPage(e){return ae("ag-paging-page-summary-panel-current-page",{value:e})},paginationSummaryPanelTotalPage(e){return ae("ag-paging-page-summary-panel-total-page",{value:e})},fillHandle(){return ae("ag-fill-handle")},columnChooserCloseButton(){return ae("ag-column-chooser-close-button")},columnChooserSearchBarCheckbox(){return ae("ag-column-chooser-header-checkbox")},columnChooserSearchBarFilter(){return ae("ag-column-chooser-searchbar-filter")},columnChooserListItemGroupClosedIcon(e){return ae("ag-column-chooser-list-item-group-closed-icon",{label:e})},columnChooserListItemCheckbox(e){return ae("ag-column-chooser-list-item-checkbox",{label:e})},columnChooserListItemDragHandle(e){return ae("ag-column-chooser-list-item-drag-handle",{label:e})},overlay(){return ae("ag-overlay")}},uv="data-testid";function ce(e,t){e?.setAttribute(uv,t)}function Uk(e){uv=e}var $k=class extends O{constructor(){super(...arguments),this.beanName="testIdSvc"}postConstruct(){const e=lt(this,()=>this.setupAllTestIds(),500),t=lt(this,()=>{this.setupAllTestIds(),e()},0);this.addManagedEventListeners({firstDataRendered:t,displayedRowsChanged:t,displayedColumnsChanged:t,displayedColumnsWidthChanged:t,virtualColumnsChanged:t,columnMenuVisibleChanged:t,contextMenuVisibleChanged:t,advancedFilterBuilderVisibleChanged:t,fieldPickerValueSelected:t,modelUpdated:t,sideBarUpdated:t,pinnedHeightChanged:t,gridReady:t,overlayExclusiveChanged:t,rowGroupOpened:t,scrollVisibilityChanged:t,gridSizeChanged:t,filterOpened:t,filterChanged:t,cellSelectionChanged:t})}setupAllTestIds(){const e=os(this.beans),t=Zm(this.beans),s=e.querySelector(`[grid-id="${t}"]`);ce(s,ee.grid(t)),e.querySelectorAll(".ag-header-group-cell").forEach(n=>{ce(n,ee.headerGroupCell(n.getAttribute("col-id")))}),e.querySelectorAll(".ag-header-cell").forEach(n=>{const r=n.getAttribute("col-id"),l=n.classList.contains("ag-floating-filter")?ee.floatingFilter(r):ee.headerCell(r);ce(n,l),ce(n.querySelector(".ag-header-cell-filter-button"),ee.headerFilterButton(r)),ce(n.querySelector(".ag-header-cell-menu-button"),ee.headerCellMenuButton(r)),ce(n.querySelector(".ag-header-cell-resize"),ee.headerResizeHandle(r)),ce(n.querySelector(".ag-checkbox input[type=checkbox]"),ee.headerCheckbox(r)),ce(n.querySelector(".ag-floating-filter-button button"),ee.floatingFilterButton(r)),this.setupFilterInstance(n.querySelector(".ag-floating-filter-body"),{source:"floating-filter",colId:r})});const o=e.querySelector(".ag-filter-menu");this.setupFilterInstance(o,{source:"column-filter"}),ce(e.querySelector(".ag-advanced-filter input[type=text]"),ee.advancedFilterInput()),e.querySelectorAll(".ag-advanced-filter-buttons button").forEach(n=>{ce(n,ee.advancedFilterButton(n.textContent))}),ce(e.querySelector("button.ag-advanced-filter-builder-button"),ee.advancedFilterBuilderButton()),e.querySelectorAll('.ag-panel[aria-label="Advanced Filter"] .ag-panel-title-bar-button').forEach((n,r)=>{ce(n,r===0?ee.advancedFilterPanelMaximiseButton():ee.advancedFilterPanelCloseButton())}),e.querySelectorAll('.ag-panel[aria-lable="Advanced Filter"] .ag-advanced-filter-builder-pill').forEach(n=>{ce(n,ee.advancedFilterPill(n.querySelector(".ag-picker-field-display")?.textContent))}),ce(e.querySelector('.ag-panel[aria-label="Advanced Filter"] .ag-advanced-filter-builder-item-button'),ee.advancedFilterBuilderAddItemButton()),e.querySelectorAll(".ag-row").forEach(n=>{const r=n.getAttribute("row-id");ce(n,ee.rowNode(r)),n.querySelectorAll(".ag-cell").forEach(a=>{const l=a.getAttribute("col-id");ce(a,ee.cell(r,l)),ce(a.querySelector(".ag-selection-checkbox input[type=checkbox]"),ee.checkbox(r,l)),ce(a.querySelector(".ag-drag-handle"),ee.dragHandle(r,l)),ce(a.querySelector(".ag-group-contracted"),ee.groupContracted(r,l)),ce(a.querySelector(".ag-group-expanded"),ee.groupExpanded(r,l))})}),e.querySelectorAll(".ag-menu-list").forEach(n=>{ce(n,ee.menu()),n.querySelectorAll(".ag-menu-option").forEach(r=>{ce(r,ee.menuOption(r.querySelector(".ag-menu-option-text")?.textContent))})}),e.querySelectorAll(".ag-side-bar").forEach(n=>{ce(n,ee.sideBar()),n.querySelectorAll(".ag-side-button button").forEach(r=>{ce(r,ee.sideBarButton(r.querySelector(".ag-side-button-label")?.textContent))}),n.querySelectorAll(".ag-column-panel").forEach(r=>{ce(r,ee.columnToolPanel()),ce(r.querySelector(".ag-pivot-mode-select input[type=checkbox]"),ee.pivotModeSelect()),ce(r.querySelector(".ag-column-select-header-checkbox input[type=checkbox]"),ee.columnPanelSelectHeaderCheckbox()),ce(r.querySelector(".ag-column-select-header-filter-wrapper input[type=text]"),ee.columnPanelSelectHeaderFilter()),r.querySelectorAll(".ag-column-select-list").forEach(a=>{a.querySelectorAll(".ag-column-select-virtual-list-item").forEach(l=>{const c=l.getAttribute("aria-label");ce(l.querySelector(".ag-column-group-closed-icon"),ee.columnSelectListItemGroupClosedIcon(c)),ce(l.querySelector(".ag-column-select-checkbox input[type=checkbox]"),ee.columnSelectListItemCheckbox(c)),ce(l.querySelector(".ag-drag-handle"),ee.columnSelectListItemDragHandle(c))})}),this.setupColumnDropArea(r,"toolbar")}),n.querySelectorAll(".ag-filter-panel").forEach(r=>{ce(r,ee.filterToolPanel()),ce(r.querySelector("button.ag-filter-add-button"),ee.filterToolPanelAddFilterButton()),r.querySelectorAll(".ag-filter-card").forEach(a=>{const l=a.querySelector(".ag-filter-card-title")?.textContent,c=a.querySelector(".ag-filter-type-select");ce(c,ee.filterToolPanelFilterTypeSelector(l)),a.querySelectorAll(".ag-filter").forEach(d=>this.setupFilterInstance(d,{source:"filter-toolpanel",colLabel:l}))})}),n.querySelectorAll(".ag-filter-toolpanel").forEach(r=>{ce(r.querySelector(".ag-filter-toolpanel-search-input input[type=text]"),ee.filterToolPanelSearchInput()),r.querySelectorAll(".ag-filter-toolpanel-group").forEach(a=>{const l=a.querySelector(".ag-filter-toolpanel-group-title")?.textContent;ce(a,ee.filterToolPanelGroup(l)),ce(a.querySelector(".ag-filter-toolpanel-group-title-bar-icon .ag-icon-tree-closed"),ee.filterToolPanelGroupCollapsedIcon(l));const c=a.querySelector(".ag-filter-toolpanel-instance-filter");c&&this.setupFilterInstance(c,{source:"filter-toolpanel",colLabel:l})})})}),ce(e.querySelector(".ag-status-bar .ag-status-panel-total-and-filtered-row-count"),ee.statusBarTotalAndFilteredRowCount()),ce(e.querySelector(".ag-status-bar .ag-status-panel-total-row-count"),ee.statusBarTotalRowCount()),ce(e.querySelector(".ag-status-bar .ag-status-panel-filtered-row-count"),ee.statusBarFilteredRowCount()),ce(e.querySelector(".ag-status-bar .ag-status-panel-selected-row-count"),ee.statusBarSelectedRowCount()),ce(e.querySelector(".ag-status-bar .ag-status-panel-filtered-row-count"),ee.statusBarAggregations()),e.querySelectorAll(".ag-paging-panel").forEach(n=>{ce(n.querySelector(".ag-paging-page-size .ag-picker-field-display"),ee.paginationPanelSizePickerDisplay(n.querySelector(".ag-paging-page-size .ag-picker-field-display")?.textContent)),n.querySelectorAll(".ag-paging-row-summary-panel-number").forEach(r=>{switch(r.getAttribute("data-ref")){case"lbFirstRowOnPage":ce(r,ee.paginationPanelFirstRowOnPage(r.textContent));break;case"lbLastRowOnPage":ce(r,ee.paginationPanelLastRowOnPage(r.textContent));break;case"lbRecordCount":ce(r,ee.paginationPanelRecordCount(r.textContent));break}}),n.querySelectorAll(".ag-paging-page-summary-panel .ag-button").forEach(r=>{ce(r,ee.paginationSummaryPanelButton(r.getAttribute("aria-label")?.toLowerCase()))}),n.querySelectorAll(".ag-paging-page-summary-panel .ag-paging-number").forEach(r=>{switch(r.getAttribute("data-ref")){case"lbCurrent":ce(r,ee.paginationSummaryPanelCurrentPage(r.textContent));break;case"lbTotal":ce(r,ee.paginationSummaryPanelTotalPage(r.textContent));break}})}),ce(e.querySelector(".ag-fill-handle"),ee.fillHandle()),e.querySelectorAll('.ag-panel[aria-label="Choose Columns"]').forEach(n=>{ce(n.querySelector(".ag-panel-title-bar-button-icon"),ee.columnChooserCloseButton()),ce(n.querySelector('.ag-column-select-header-checkbox input[type="checkbox"]'),ee.columnChooserSearchBarCheckbox()),ce(n.querySelector('.ag-column-select-header-filter-wrapper input[type="text"]'),ee.columnChooserSearchBarFilter()),n.querySelectorAll(".ag-column-select-list").forEach(r=>{r.querySelectorAll(".ag-column-select-virtual-list-item").forEach(a=>{const l=a.getAttribute("aria-label");ce(a.querySelector(".ag-column-group-closed-icon"),ee.columnChooserListItemGroupClosedIcon(l)),ce(a.querySelector(".ag-column-select-checkbox input[type=checkbox]"),ee.columnChooserListItemCheckbox(l)),ce(a.querySelector(".ag-drag-handle"),ee.columnChooserListItemDragHandle(l))})})}),ce(e.querySelector(".ag-overlay-wrapper"),ee.overlay());const i=e.querySelector(".ag-column-drop-wrapper");i&&this.setupColumnDropArea(i,"panel")}setupFilterInstance(e,t){if(!e)return;e.querySelectorAll(".ag-filter-select .ag-picker-field-display").forEach(r=>{ce(r,ee.filterInstancePickerDisplay(t))});const s=e.querySelector('.ag-filter-body input[type="number"]');ce(s,ee.numberFilterInstanceInput(t));const o=e.querySelector('.ag-filter-body input[type="text"]');ce(o,ee.textFilterInstanceInput(t));const i=e.querySelector('.ag-filter-body input[type="date"]');ce(i,ee.dateFilterInstanceInput(t));const n=e.querySelector('.ag-mini-filter input[type="text"]');ce(n,ee.setFilterInstanceMiniFilterInput(t)),e.querySelectorAll(".ag-set-filter-list .ag-set-filter-item").forEach(r=>{const a=r.querySelector(".ag-checkbox-label")?.textContent,l=r.querySelector('input[type="checkbox"]');ce(l,ee.setFilterInstanceItem(t,a))}),e.querySelectorAll(".ag-filter-apply-panel button").forEach(r=>{ce(r,ee.setFilterApplyPanelButton(t,r.textContent))}),e.querySelectorAll(".ag-filter-condition .ag-radio-button").forEach(r=>{const a=r.querySelector(".ag-radio-button-label")?.textContent;ce(r.querySelector("input[type=radio]"),ee.filterConditionRadioButton(t,a))})}setupColumnDropArea(e,t){e.querySelectorAll(".ag-column-drop").forEach(s=>{const o=s.querySelector(".ag-column-drop-list")?.getAttribute("aria-label");ce(s,ee.columnDropArea(t,o)),s.querySelectorAll(".ag-column-drop-cell").forEach(i=>{const n=i.querySelector(".ag-column-drop-cell-text")?.textContent;ce(i.querySelector(".ag-drag-handle"),ee.columnDropCellDragHandle(t,o,n)),ce(i.querySelector(".ag-column-drop-cell-button .ag-icon-cancel"),ee.columnDropCellCancelButton(t,o,n))})})}},qk={moduleName:"Testing",version:Z,beans:[$k]};function Kk({testIdAttribute:e}={}){e&&Uk(e),Mf.registerModules([qk])}var Ct=g.createContext({}),hv=g.createContext("default"),pr=(e,t,s,o)=>{if(!e||e.componentFromFramework||t.isDestroyed())return;const n=e.newAgStackInstance();let r,a,l=!1;return n.then(c=>{if(l){t.destroyBean(c);return}r=c,a=r.getGui(),s.appendChild(a),lp(o,r)}),()=>{l=!0,r&&(a?.remove(),t.destroyBean(r),o&&lp(o,void 0))}},lp=(e,t)=>{if(e)if(e instanceof Function)e(t);else{const s=e;s.current=t}},Yt=(...e)=>e.filter(s=>s!=null&&s!=="").join(" "),es=class gv{constructor(...t){this.classesMap={};for(const s of t)this.classesMap[s]=!0}setClass(t,s){if(!!this.classesMap[t]==s)return this;const i=new gv;return i.classesMap={...this.classesMap},i.classesMap[t]=s,i}toString(){return Object.keys(this.classesMap).filter(s=>this.classesMap[s]).join(" ")}},Ki=e=>{const t=()=>typeof Symbol=="function"&&Symbol.for,s=()=>t()?Symbol.for("react.memo"):60115;return typeof e=="function"&&!(e.prototype&&e.prototype.isReactComponent)||typeof e=="object"&&e.$$typeof===s()},_d=g.version?.split(".")[0],pv=_d==="16"||_d==="17";function Yk(){return _d==="19"}var xa=!1;function Zk(e){return xa||setTimeout(()=>xa=!1,0),xa=!0,e()}var sr=(e,t)=>{!pv&&e&&!xa?zi.flushSync(t):t()},Xk=e=>{pv?e():g.startTransition(e)};function Qk(e,t,s){return g.useSyncExternalStore?g.useSyncExternalStore(e,t):s}function Za(e,t,s){if(t==null||e==null)return t;if(e===t||t.length===0&&e.length===0)return e;if(s||e.length===0&&t.length>0||e.length>0&&t.length===0)return t;const o=[],i=[],n=new Map,r=new Map;for(let a=0;a<t.length;a++){const l=t[a];r.set(l.instanceId,l)}for(let a=0;a<e.length;a++){const l=e[a];n.set(l.instanceId,l),r.has(l.instanceId)&&o.push(l)}for(let a=0;a<t.length;a++){const l=t[a],c=l.instanceId;n.has(c)||i.push(l)}return o.length===e.length&&i.length===0?e:o.length===0&&i.length===t.length?t:o.length===0?i:i.length===0?o:[...o,...i]}var fv=g.forwardRef((e,t)=>{const{registry:s,context:o}=g.useContext(Ct),i=g.useRef(null),n=g.useRef(null),r=g.useRef(null),a=g.useRef(null),l=g.useRef(null),c=g.useRef(),[d,u]=g.useState(),[h,p]=g.useState(),[m,C]=g.useState(),[v,w]=g.useState(()=>new es),[b,S]=g.useState(()=>new es("ag-hidden")),[x,y]=g.useState(()=>new es("ag-hidden")),[F,R]=g.useState(()=>new es("ag-invisible"));g.useImperativeHandle(t,()=>({refresh(){return!1}})),g.useLayoutEffect(()=>pr(d,o,n.current),[d]);const E=g.useCallback(U=>{if(i.current=U,!U||o.isDestroyed()){c.current=o.destroyBean(c.current);return}const L={setInnerRenderer:(H,te)=>{u(H),C(te)},setChildCount:H=>p(H),toggleCss:(H,te)=>w(Q=>Q.setClass(H,te)),setContractedDisplayed:H=>y(te=>te.setClass("ag-hidden",!H)),setExpandedDisplayed:H=>S(te=>te.setClass("ag-hidden",!H)),setCheckboxVisible:H=>R(te=>te.setClass("ag-invisible",!H)),setCheckboxSpacing:H=>R(te=>te.setClass("ag-group-checkbox-spacing",H))},de=s.createDynamicBean("groupCellRendererCtrl",!0);de&&(c.current=o.createBean(de),c.current.init(L,U,r.current,a.current,l.current,fv,e))},[]),D=g.useMemo(()=>`ag-cell-wrapper ${v.toString()}`,[v]),P=g.useMemo(()=>`ag-group-expanded ${b.toString()}`,[b]),T=g.useMemo(()=>`ag-group-contracted ${x.toString()}`,[x]),M=g.useMemo(()=>`ag-group-checkbox ${F.toString()}`,[F]),k=d?.componentFromFramework,N=k?d.componentClass:void 0,A=d==null&&m!=null,W=Ui(m);return g.createElement("span",{className:D,ref:E,...e.colDef?{}:{role:c.current?.getCellAriaRole()}},g.createElement("span",{className:P,ref:a}),g.createElement("span",{className:T,ref:l}),g.createElement("span",{className:M,ref:r}),g.createElement("span",{className:"ag-group-value",ref:n},A?W:k?g.createElement(N,{...d.params}):null),g.createElement("span",{className:"ag-group-child-count"},h))}),cp=fv,Qu=g.createContext({setMethods:()=>{}}),Jk=e=>{const{initialProps:t,addUpdateCallback:s,CustomComponentClass:o,setMethods:i}=e,[{key:n,...r},a]=g.useState(t);return g.useEffect(()=>{s(l=>a(l))},[]),g.createElement(Qu.Provider,{value:{setMethods:i}},g.createElement(o,{key:n,...r}))},eA=g.memo(Jk),tA=0;function dp(){return`agPortalKey_${++tA}`}var mv=class{constructor(e,t,s,o){this.portal=null,this.oldPortal=null,this.reactComponent=e,this.portalManager=t,this.componentType=s,this.suppressFallbackMethods=!!o,this.statelessComponent=this.isStateless(this.reactComponent),this.key=dp(),this.portalKey=dp(),this.instanceCreated=this.isStatelessComponent()?Ae.resolve(!1):new Ae(i=>{this.resolveInstanceCreated=i})}getGui(){return this.eParentElement}getRootElement(){return this.eParentElement.firstChild}destroy(){this.componentInstance&&typeof this.componentInstance.destroy=="function"&&this.componentInstance.destroy();const e=this.portal;e&&this.portalManager.destroyPortal(e)}createParentElement(e){const t=this.portalManager.getComponentWrappingElement(),s=document.createElement(t||"div");return s.classList.add("ag-react-container"),e.reactContainer=s,s}statelessComponentRendered(){return this.eParentElement.childElementCount>0||this.eParentElement.childNodes.length>0}getFrameworkComponentInstance(){return this.componentInstance}isStatelessComponent(){return this.statelessComponent}getReactComponentName(){return this.reactComponent.name}getMemoType(){return this.hasSymbol()?Symbol.for("react.memo"):60115}hasSymbol(){return typeof Symbol=="function"&&Symbol.for}isStateless(e){return typeof e=="function"&&!(e.prototype&&e.prototype.isReactComponent)||typeof e=="object"&&e.$$typeof===this.getMemoType()}hasMethod(e){const t=this.getFrameworkComponentInstance();return!!t&&t[e]!=null||this.fallbackMethodAvailable(e)}callMethod(e,t){const s=this.getFrameworkComponentInstance();if(this.isStatelessComponent())return this.fallbackMethod(e,t&&t[0]?t[0]:{});if(!s){setTimeout(()=>this.callMethod(e,t));return}const o=s[e];if(o)return o.apply(s,t);if(this.fallbackMethodAvailable(e))return this.fallbackMethod(e,t&&t[0]?t[0]:{})}addMethod(e,t){this[e]=t}init(e){return this.eParentElement=this.createParentElement(e),this.createOrUpdatePortal(e),new Ae(t=>this.createReactComponent(t))}createOrUpdatePortal(e){this.isStatelessComponent()||(this.ref=t=>{this.componentInstance=t,this.resolveInstanceCreated?.(!0),this.resolveInstanceCreated=void 0},e.ref=this.ref),this.reactElement=this.createElement(this.reactComponent,{...e,key:this.key}),this.portal=zi.createPortal(this.reactElement,this.eParentElement,this.portalKey)}createElement(e,t){return g.createElement(e,t)}createReactComponent(e){this.portalManager.mountReactPortal(this.portal,this,e)}rendered(){return this.isStatelessComponent()&&this.statelessComponentRendered()||!!(!this.isStatelessComponent()&&this.getFrameworkComponentInstance())}refreshComponent(e){this.oldPortal=this.portal,this.createOrUpdatePortal(e),this.portalManager.updateReactPortal(this.oldPortal,this.portal)}fallbackMethod(e,t){const s=this[`${e}Component`];if(!this.suppressFallbackMethods&&s)return s.bind(this)(t)}fallbackMethodAvailable(e){return this.suppressFallbackMethods?!1:!!this[`${e}Component`]}};function bl(e,t,s){for(const o of e){const i=t[o];i&&(s[o]=i)}}var jt=class extends mv{constructor(){super(...arguments),this.awaitUpdateCallback=new Ae(e=>{this.resolveUpdateCallback=e}),this.wrapperComponent=eA}init(e){return this.sourceParams=e,super.init(this.getProps())}addMethod(){}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}getFrameworkComponentInstance(){return this}createElement(e,t){return super.createElement(this.wrapperComponent,{initialProps:t,CustomComponentClass:e,setMethods:s=>this.setMethods(s),addUpdateCallback:s=>{this.updateCallback=()=>(s(this.getProps()),new Ae(o=>{setTimeout(()=>{o()})})),this.resolveUpdateCallback()}})}setMethods(e){this.providedMethods=e,bl(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return{...this.sourceParams,key:this.key,ref:this.ref}}refreshProps(){return this.updateCallback?this.updateCallback():new Ae(e=>this.awaitUpdateCallback.then(()=>{this.updateCallback().then(()=>e())}))}},sA=class extends jt{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},oA=class extends jt{constructor(){super(...arguments),this.date=null,this.onDateChange=e=>this.updateDate(e)}getDate(){return this.date}setDate(e){this.date=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled"]}updateDate(e){this.setDate(e),this.sourceParams.onDateChanged()}getProps(){const e=super.getProps();return e.date=this.date,e.onDateChange=this.onDateChange,delete e.onDateChanged,e}},iA=class extends jt{constructor(){super(...arguments),this.label="",this.icon=null,this.shake=!1}setIcon(e,t){this.icon=e,this.shake=t,this.refreshProps()}setLabel(e){this.label=e,this.refreshProps()}getProps(){const e=super.getProps(),{label:t,icon:s,shake:o}=this;return e.label=t,e.icon=s,e.shake=o,e}},nA=class extends jt{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e),this.onUiChange=()=>this.sourceParams.filterModifiedCallback(),this.expectingNewMethods=!0,this.hasBeenActive=!1,this.awaitSetMethodsCallback=new Ae(e=>{this.resolveSetMethodsCallback=e})}isFilterActive(){return this.model!=null}doesFilterPass(e){return this.providedMethods.doesFilterPass(e)}getModel(){return this.model}setModel(e){return this.expectingNewMethods=!0,this.model=e,this.hasBeenActive||(this.hasBeenActive=this.isFilterActive()),this.refreshProps()}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}afterGuiAttached(e){const t=this.providedMethods;t?t.afterGuiAttached?.(e):this.awaitSetMethodsCallback.then(()=>this.providedMethods?.afterGuiAttached?.(e))}getOptionalMethods(){return["afterGuiDetached","onNewRowsLoaded","getModelAsString","onAnyFilterChanged"]}setMethods(e){this.expectingNewMethods===!1&&this.hasBeenActive&&this.providedMethods?.doesFilterPass!==e?.doesFilterPass&&setTimeout(()=>{this.sourceParams.filterChangedCallback()}),this.expectingNewMethods=!1,super.setMethods(e),this.resolveSetMethodsCallback(),this.resolveFilterPassCallback?.(),this.resolveFilterPassCallback=void 0}updateModel(e){this.resolveFilterPassCallback?.();const t=new Ae(s=>{this.resolveFilterPassCallback=s});this.setModel(e).then(()=>{t.then(()=>{this.sourceParams.filterChangedCallback()})})}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e.onUiChange=this.onUiChange,delete e.filterChangedCallback,e}},rA=class extends jt{constructor(){super(...arguments),this.awaitSetMethodsCallback=new Ae(e=>{this.resolveSetMethodsCallback=e})}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}afterGuiAttached(e){const t=this.providedMethods;t?t.afterGuiAttached?.(e):this.awaitSetMethodsCallback.then(()=>this.providedMethods?.afterGuiAttached?.(e))}getOptionalMethods(){return["afterGuiDetached","onNewRowsLoaded","onAnyFilterChanged"]}setMethods(e){super.setMethods(e),this.resolveSetMethodsCallback()}};function Cv(e,t){e.parentFilterInstance(s=>{(s.setModel(t)||Ae.resolve()).then(()=>{e.filterParams.filterChangedCallback()})})}var aA=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t,this.model=null,this.onModelChange=s=>this.updateModel(s)}getProps(){return{...this.floatingFilterParams,model:this.model,onModelChange:this.onModelChange}}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){bl(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),Cv(this.floatingFilterParams,e)}},lA=class extends jt{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e)}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),Cv(this.sourceParams,e)}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e}},cA=class extends jt{refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}},dA=class extends jt{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},uA=class extends jt{refresh(e){this.sourceParams=e,this.refreshProps()}},hA=class extends jt{constructor(){super(...arguments),this.active=!1,this.expanded=!1,this.onActiveChange=e=>this.updateActive(e)}setActive(e){this.awaitSetActive(e)}setExpanded(e){this.expanded=e,this.refreshProps()}getOptionalMethods(){return["select","configureDefaults"]}awaitSetActive(e){return this.active=e,this.refreshProps()}updateActive(e){const t=this.awaitSetActive(e);e&&t.then(()=>this.sourceParams.onItemActivated())}getProps(){const e=super.getProps();return e.active=this.active,e.expanded=this.expanded,e.onActiveChange=this.onActiveChange,delete e.onItemActivated,e}},gA=class extends jt{refresh(e){this.sourceParams=e,this.refreshProps()}},pA=class extends jt{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},fA=class extends jt{constructor(){super(...arguments),this.onStateChange=e=>this.updateState(e)}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}getState(){return this.state}updateState(e){this.state=e,this.refreshProps(),this.sourceParams.onStateUpdated()}getProps(){const e=super.getProps();return e.state=this.state,e.onStateChange=this.onStateChange,e}};function Ju(){z(231)}var mA=1e3,CA=class{constructor(e,t,s){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=t||"div",this.refresher=e,this.maxComponentCreationTimeMs=s||mA}getPortals(){return this.portals}destroy(){this.destroyed=!0}destroyPortal(e){this.portals=this.portals.filter(t=>t!==e),this.batchUpdate()}getComponentWrappingElement(){return this.wrappingElement}mountReactPortal(e,t,s){this.portals=[...this.portals,e],this.waitForInstance(t,s),this.batchUpdate()}updateReactPortal(e,t){this.portals[this.portals.indexOf(e)]=t,this.batchUpdate()}batchUpdate(){this.hasPendingPortalUpdate||(setTimeout(()=>{this.destroyed||(this.refresher(),this.hasPendingPortalUpdate=!1)}),this.hasPendingPortalUpdate=!0)}waitForInstance(e,t,s=Date.now()){if(this.destroyed){t(null);return}if(e.rendered())t(e);else{if(Date.now()-s>=this.maxComponentCreationTimeMs&&!this.hasPendingPortalUpdate){sr(!0,()=>this.refresher()),e.rendered()&&t(e);return}window.setTimeout(()=>{this.waitForInstance(e,t,s)})}}},vA=({ctrl:e})=>{const t=e.isAlive(),{context:s}=g.useContext(Ct),[o,i]=g.useState(),[n,r]=g.useState(),a=g.useRef(),l=g.useRef(null),c=g.useRef(null),d=g.useRef(null),u=g.useRef(),h=g.useRef();t&&!h.current&&(h.current=new cr(()=>l.current));const p=g.useCallback(w=>{if(l.current=w,!w||!e.isAlive()||s.isDestroyed()){a.current=s.destroyBean(a.current);return}a.current=s.createBean(new $i);const b=()=>{const x=e.getSelectAllGui();x&&(c.current?.insertAdjacentElement("afterend",x),a.current.addDestroyFunc(()=>x.remove()))},S={setWidth:x=>{l.current&&(l.current.style.width=x)},toggleCss:(x,y)=>h.current.toggleCss(x,y),setUserStyles:x=>r(x),setAriaSort:x=>{l.current&&(x?wS(l.current,x):bS(l.current))},setUserCompDetails:x=>i(x),getUserCompInstance:()=>u.current||void 0,refreshSelectAllGui:b,removeSelectAllGui:()=>e.getSelectAllGui()?.remove()};e.setComp(S,w,c.current,d.current,a.current),b()},[]);g.useLayoutEffect(()=>pr(o,s,d.current,u),[o]),g.useEffect(()=>{e.setDragSource(l.current)},[o]);const m=g.useMemo(()=>!!(o?.componentFromFramework&&Ki(o.componentClass)),[o]),C=o?.componentFromFramework,v=o?.componentClass;return g.createElement("div",{ref:p,style:n,className:"ag-header-cell",role:"columnheader"},g.createElement("div",{ref:c,className:"ag-header-cell-resize",role:"presentation"}),g.createElement("div",{ref:d,className:"ag-header-cell-comp-wrapper",role:"presentation"},C?m?g.createElement(v,{...o.params}):g.createElement(v,{...o.params,ref:u}):null))},wA=g.memo(vA),bA=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t}getProps(){return this.floatingFilterParams}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){bl(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}},SA=({ctrl:e})=>{const{context:t,gos:s}=g.useContext(Ct),[o,i]=g.useState(),[n,r]=g.useState(()=>new es("ag-header-cell","ag-floating-filter")),[a,l]=g.useState(()=>new es),[c,d]=g.useState(()=>new es("ag-floating-filter-button","ag-hidden")),[u,h]=g.useState("false"),[p,m]=g.useState(),[,C]=g.useState(1),v=g.useRef(),w=g.useRef(null),b=g.useRef(null),S=g.useRef(null),x=g.useRef(null),y=g.useRef(),F=g.useRef(),R=H=>{H!=null&&y.current&&y.current(H)},E=g.useCallback(H=>{if(w.current=H,!H||!e.isAlive()||t.isDestroyed()){v.current=t.destroyBean(v.current);return}v.current=t.createBean(new $i),F.current=new Ae(Q=>{y.current=Q});const te={toggleCss:(Q,J)=>r(me=>me.setClass(Q,J)),setUserStyles:Q=>i(Q),addOrRemoveBodyCssClass:(Q,J)=>l(me=>me.setClass(Q,J)),setButtonWrapperDisplayed:Q=>{d(J=>J.setClass("ag-hidden",!Q)),h(Q?"false":"true")},setWidth:Q=>{w.current&&(w.current.style.width=Q)},setCompDetails:Q=>m(Q),getFloatingFilterComp:()=>F.current?F.current:null,setMenuIcon:Q=>x.current?.appendChild(Q)};e.setComp(te,H,x.current,b.current,v.current)},[]);g.useLayoutEffect(()=>pr(p,t,b.current,R),[p]);const D=g.useMemo(()=>n.toString(),[n]),P=g.useMemo(()=>a.toString(),[a]),T=g.useMemo(()=>c.toString(),[c]),M=g.useMemo(()=>!!(p&&p.componentFromFramework&&Ki(p.componentClass)),[p]),k=g.useMemo(()=>s.get("reactiveCustomComponents"),[]),N=g.useMemo(()=>s.get("enableFilterHandlers"),[]),[A,W]=g.useState();g.useEffect(()=>{if(p?.componentFromFramework)if(k){const H=N?bA:aA,te=new H(p.params,()=>C(Q=>Q+1));R(te),W(te)}else Ju()},[p]);const U=A?.getProps(),L=p?.componentFromFramework,de=p?.componentClass;return g.createElement("div",{ref:E,style:o,className:D,role:"gridcell"},g.createElement("div",{ref:b,className:P,role:"presentation"},L?k?U&&g.createElement(Qu.Provider,{value:{setMethods:H=>A.setMethods(H)}},g.createElement(de,{...U})):g.createElement(de,{...p.params,ref:M?()=>{}:R}):null),g.createElement("div",{ref:S,"aria-hidden":u,className:T,role:"presentation"},g.createElement("button",{ref:x,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))},yA=g.memo(SA),xA=({ctrl:e})=>{const{context:t}=g.useContext(Ct),[s,o]=g.useState(),[i,n]=g.useState(()=>new es),[r,a]=g.useState(()=>new es),[l,c]=g.useState("false"),[d,u]=g.useState(),[h,p]=g.useState(),m=g.useRef(),C=g.useRef(null),v=g.useRef(null),w=g.useRef(null),b=g.useRef(),S=g.useCallback(D=>{if(C.current=D,!D||!e.isAlive()||t.isDestroyed()){m.current=t.destroyBean(m.current);return}m.current=t.createBean(new $i);const P={setWidth:T=>{C.current&&(C.current.style.width=T)},toggleCss:(T,M)=>n(k=>k.setClass(T,M)),setUserStyles:T=>o(T),setHeaderWrapperHidden:T=>{const M=w.current;M&&(T?M.style.setProperty("display","none"):M.style.removeProperty("display"))},setHeaderWrapperMaxHeight:T=>{const M=w.current;M&&(T!=null?M.style.setProperty("max-height",`${T}px`):M.style.removeProperty("max-height"),M.classList.toggle("ag-header-cell-comp-wrapper-limited-height",T!=null))},setUserCompDetails:T=>p(T),setResizableDisplayed:T=>{a(M=>M.setClass("ag-hidden",!T)),c(T?"false":"true")},setAriaExpanded:T=>u(T),getUserCompInstance:()=>b.current||void 0};e.setComp(P,D,v.current,w.current,m.current)},[]);g.useLayoutEffect(()=>pr(h,t,w.current),[h]),g.useEffect(()=>{C.current&&e.setDragSource(C.current)},[h]);const x=g.useMemo(()=>!!(h?.componentFromFramework&&Ki(h.componentClass)),[h]),y=g.useMemo(()=>"ag-header-group-cell "+i.toString(),[i]),F=g.useMemo(()=>"ag-header-cell-resize "+r.toString(),[r]),R=h?.componentFromFramework,E=h?.componentClass;return g.createElement("div",{ref:S,style:s,className:y,role:"columnheader","aria-expanded":d},g.createElement("div",{ref:w,className:"ag-header-cell-comp-wrapper",role:"presentation"},R?x?g.createElement(E,{...h.params}):g.createElement(E,{...h.params,ref:b}):null),g.createElement("div",{ref:v,"aria-hidden":l,className:F}))},RA=g.memo(xA),FA=({ctrl:e})=>{const{gos:t,context:s}=g.useContext(Ct),{topOffset:o,rowHeight:i}=g.useMemo(()=>e.getTopAndHeight(),[]),n=g.useMemo(()=>t.get("tabIndex"),[]),[r,a]=g.useState(()=>e.getAriaRowIndex()),l=e.headerRowClass,[c,d]=g.useState(()=>i+"px"),[u,h]=g.useState(()=>o+"px"),p=g.useRef(null),[m,C]=g.useState(()=>e.getUpdatedHeaderCtrls()),v=g.useRef(),w=g.useRef(null),b=g.useCallback(y=>{if(w.current=y,!y||!e.isAlive()||s.isDestroyed()){v.current=s.destroyBean(v.current);return}v.current=s.createBean(new $i);const F={setHeight:R=>d(R),setTop:R=>h(R),setHeaderCtrls:(R,E,D)=>{const P=p.current,T=Za(P,R,E);T!==P&&(p.current=T,sr(D,()=>C(T)))},setWidth:R=>{w.current&&(w.current.style.width=R)},setRowIndex:R=>{a(R)}};e.setComp(F,v.current,!1)},[]),S=g.useMemo(()=>({height:c,top:u}),[c,u]),x=g.useCallback(y=>{switch(e.type){case"group":return g.createElement(RA,{ctrl:y,key:y.instanceId});case"filter":return g.createElement(yA,{ctrl:y,key:y.instanceId});default:return g.createElement(wA,{ctrl:y,key:y.instanceId})}},[]);return g.createElement("div",{ref:b,className:l,role:"row",style:S,tabIndex:n,"aria-rowindex":r},m.map(x))},EA=g.memo(FA),DA=({pinned:e})=>{const[t,s]=g.useState(!0),[o,i]=g.useState([]),{context:n}=g.useContext(Ct),r=g.useRef(null),a=g.useRef(null),l=g.useRef(),c=e==="left",d=e==="right",u=!c&&!d,h=g.useCallback(C=>{if(r.current=C,!C||n.isDestroyed()){l.current=n.destroyBean(l.current);return}l.current=n.createBean(new iF(e));const v={setDisplayed:s,setCtrls:w=>i(w),setCenterWidth:w=>{a.current&&(a.current.style.width=w)},setViewportScrollLeft:w=>{r.current&&(r.current.scrollLeft=w)},setPinnedContainerWidth:w=>{r.current&&(r.current.style.width=w,r.current.style.minWidth=w,r.current.style.maxWidth=w)}};l.current.setComp(v,r.current)},[]),p=t?"":"ag-hidden",m=()=>o.map(C=>g.createElement(EA,{ctrl:C,key:C.instanceId}));return c?g.createElement("div",{ref:h,className:"ag-pinned-left-header "+p,"aria-hidden":!t,role:"rowgroup"},m()):d?g.createElement("div",{ref:h,className:"ag-pinned-right-header "+p,"aria-hidden":!t,role:"rowgroup"},m()):u?g.createElement("div",{ref:h,className:"ag-header-viewport "+p,role:"rowgroup",tabIndex:-1},g.createElement("div",{ref:a,className:"ag-header-container",role:"presentation"},m())):null},Bc=g.memo(DA),PA=()=>{const[e,t]=g.useState(()=>new es),[s,o]=g.useState(),{context:i}=g.useContext(Ct),n=g.useRef(null),r=g.useRef(),a=g.useCallback(d=>{if(n.current=d,!d||i.isDestroyed()){r.current=i.destroyBean(r.current);return}r.current=i.createBean(new eF);const u={toggleCss:(h,p)=>t(m=>m.setClass(h,p)),setHeightAndMinHeight:h=>o(h)};r.current.setComp(u,d,d)},[]),l=g.useMemo(()=>"ag-header "+e.toString(),[e]),c=g.useMemo(()=>({height:s,minHeight:s}),[s]);return g.createElement("div",{ref:a,className:l,style:c,role:"presentation"},g.createElement(Bc,{pinned:"left"}),g.createElement(Bc,{pinned:null}),g.createElement(Bc,{pinned:"right"}))},TA=g.memo(PA),MA=(e,t)=>{g.useEffect(()=>{const s=t.current;if(s){const o=s.parentElement;if(o){const i=document.createComment(e);return o.insertBefore(i,s),()=>{i.remove()}}}},[e])},Co=MA,IA=class{constructor(e,t){this.cellEditorParams=e,this.refreshProps=t,this.instanceCreated=new Ae(s=>{this.resolveInstanceCreated=s}),this.onValueChange=s=>this.updateValue(s),this.value=e.value}getProps(){return{...this.cellEditorParams,initialValue:this.cellEditorParams.value,value:this.value,onValueChange:this.onValueChange}}getValue(){return this.value}refresh(e){this.cellEditorParams=e,this.refreshProps()}setMethods(e){bl(this.getOptionalMethods(),e,this)}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}setRef(e){this.componentInstance=e,this.resolveInstanceCreated?.(),this.resolveInstanceCreated=void 0}getOptionalMethods(){return["isCancelBeforeStart","isCancelAfterEnd","focusIn","focusOut","afterGuiAttached","getValidationErrors","getValidationElement"]}updateValue(e){this.value=e,this.refreshProps()}},kA=e=>{const t=g.useRef(e),s=g.useRef(),o=g.useRef(!1),i=g.useRef(!1),[,n]=g.useState(0);o.current&&(i.current=!0),g.useEffect(()=>(o.current||(s.current=t.current(),o.current=!0),n(r=>r+1),()=>{i.current&&s.current?.()}),[])},AA=e=>{const[t,s]=g.useState(),o=g.useContext(Ct),{context:i,popupSvc:n,gos:r,editSvc:a}=o,{editDetails:l,cellCtrl:c,eParentCell:d}=e;return kA(()=>{const{compDetails:u}=l,h=r.get("stopEditingWhenCellsLoseFocus");let p,m;if(!i.isDestroyed()){m=i.createBean(a.createPopupEditorWrapper(u.params));const C=m.getGui();if(e.jsChildComp){const y=e.jsChildComp.getGui();y&&C.appendChild(y)}const{column:v,rowNode:w}=c,b={column:v,rowNode:w,type:"popupCellEditor",eventSource:d,ePopup:C,position:l.popupPosition,keepWithinBounds:!0},S=n?.positionPopupByComponent.bind(n,b),x=n?.addPopup({modal:h,eChild:C,closeOnEsc:!0,closedCallback:()=>{c.onPopupEditorClosed()},anchorToElement:d,positionCallback:S,ariaOwns:d});p=x?x.hideFunc:void 0,s(m),e.jsChildComp?.afterGuiAttached?.()}return()=>{p?.(),i.destroyBean(m)}}),g.useLayoutEffect(()=>()=>{c.isCellFocused()&&t?.getGui().contains(Ze(o))&&d.focus({preventScroll:!0})},[t]),t&&e.wrappedContent?zi.createPortal(e.wrappedContent,t.getGui()):null},up=g.memo(AA),LA=(e,t,s)=>{const{compProxy:o}=e;s(o);const i=o.getProps(),n=Ki(t);return g.createElement(Qu.Provider,{value:{setMethods:r=>o.setMethods(r)}},n?g.createElement(t,{...i}):g.createElement(t,{...i,ref:r=>o.setRef(r)}))},hp=(e,t,s)=>e.compProxy?LA(e,t,s):g.createElement(t,{...e.compDetails.params,ref:s}),OA=(e,t,s,o,i)=>{const n=e.compDetails,r=n.componentClass,a=n.componentFromFramework&&!e.popup,l=n.componentFromFramework&&e.popup,c=!n.componentFromFramework&&e.popup;return a?hp(e,r,t):l?g.createElement(up,{editDetails:e,cellCtrl:o,eParentCell:s,wrappedContent:hp(e,r,t)}):c&&i?g.createElement(up,{editDetails:e,cellCtrl:o,eParentCell:s,jsChildComp:i}):null},NA=(e,t,s,o,i,n)=>{const{context:r}=g.useContext(Ct),a=g.useCallback(()=>{const l=i.current;if(!l)return;const c=l.getGui();c&&c.parentElement&&c.remove(),r.destroyBean(l),i.current=void 0},[]);g.useEffect(()=>{const l=e!=null,c=e?.compDetails&&!e.compDetails.componentFromFramework,d=t&&s==null;if(!(l&&c&&!d)){a();return}const h=e.compDetails;if(i.current){const m=i.current,v=m.refresh!=null&&e.force==!1?m.refresh(h.params):!1;if(v===!0||v===void 0)return;a()}h.newAgStackInstance().then(m=>{if(!m)return;const C=m.getGui();if(!C)return;(t?s:n.current).appendChild(C),i.current=m})},[e,t,o]),g.useEffect(()=>a,[])},vv=NA,HA=({cellCtrl:e,parent:t})=>{const s=g.useRef(),o=g.useMemo(()=>{const{loadingComp:i}=e.getDeferLoadingCellRenderer();return i?{value:void 0,compDetails:i,force:!1}:void 0},[e]);if(vv(o,!1,void 0,1,s,t),o?.compDetails?.componentFromFramework){const i=o.compDetails.componentClass;return g.createElement(i,{...o.compDetails.params})}return g.createElement(g.Fragment,null)},GA=({cellCtrl:e,printLayout:t,editingCell:s})=>{const o=g.useContext(Ct),{context:i}=o,{column:{colIdSanitised:n},instanceId:r}=e,a=g.useRef(),[l,c]=g.useState(()=>e.isCellRenderer()?void 0:{compDetails:void 0,value:e.getValueToDisplay(),force:!1}),[d,u]=g.useState(),[h,p]=g.useState(1),[m,C]=g.useState(),[v,w]=g.useState(!1),[b,S]=g.useState(!1),[x,y]=g.useState(!1),[F,R]=g.useState(),E=g.useMemo(()=>e.isForceWrapper(),[e]),D=g.useMemo(()=>e.getCellAriaRole(),[e]),P=g.useRef(null),T=g.useRef(null),M=g.useRef(null),k=g.useRef(),N=g.useRef(),A=g.useRef(),W=g.useRef([]),U=g.useRef(),L=g.useRef(),[de,H]=g.useState(0),te=g.useCallback(re=>{L.current=re,H(Ce=>Ce+1)},[]),Q=l!=null&&(v||x||b)&&(d==null||!!d.popup),J=E||Q,me=g.useMemo(()=>e.getCellValueClass(),[e]),Re=g.useCallback(re=>{if(N.current=re,re){const Ce=re.isCancelBeforeStart&&re.isCancelBeforeStart();setTimeout(()=>{Ce?(e.stopEditing(!0),e.focusCell(!0)):(e.cellEditorAttached(),e.enableEditorTooltipFeature(re))})}},[e]),ne=g.useRef();ne.current||(ne.current=new cr(()=>P.current)),vv(l,J,L.current,de,k,P);const _=g.useRef();g.useLayoutEffect(()=>{const re=_.current,Ce=l;if(_.current=l,re==null||re.compDetails==null||Ce==null||Ce.compDetails==null)return;U.current?.refreshVisibility();const xe=re.compDetails,Le=Ce.compDetails;if(xe.componentClass!=Le.componentClass||M.current?.refresh==null)return;M.current.refresh(Le.params)!=!0&&p(De=>De+1)},[l]),g.useLayoutEffect(()=>{if(!(d&&!d.compDetails.componentFromFramework)||i.isDestroyed())return;const Ce=d.compDetails,xe=d.popup===!0,Le=Ce.newAgStackInstance();return Le.then(fe=>{if(!fe)return;const De=fe.getGui();Re(fe),xe||((E?A:P).current?.appendChild(De),fe.afterGuiAttached?.()),R(fe)}),()=>{Le.then(fe=>{const De=fe.getGui();e.disableEditorTooltipFeature(),i.destroyBean(fe),Re(void 0),R(void 0),De?.remove()})}},[d]);const Fe=g.useCallback(re=>{if(A.current=re,!re||i.isDestroyed()||!e.isAlive()){const Le=W.current;W.current=[];for(const fe of Le)fe();return}let Ce;const xe=Le=>{Le&&(re.insertAdjacentElement("afterbegin",Le.getGui()),W.current.push(()=>{eo(Le.getGui()),i.destroyBean(Le),U.current===Ce&&(U.current=void 0)}))};v&&xe(e.createSelectionCheckbox()),x&&xe(e.createDndSource()),b&&(Ce=e.createRowDragComp(),U.current=Ce,Ce&&(xe(Ce),Ce.refreshVisibility()))},[e,i,x,b,v]),ie=g.useCallback(()=>{const re=!e.isCellSpanning()||T.current,Ce=P.current;if(!Ce||!re||!e||!e.isAlive()||i.isDestroyed()){a.current=i.destroyBean(a.current);return}a.current=i.createBean(new $i);const xe={toggleCss:(fe,De)=>ne.current.toggleCss(fe,De),setUserStyles:fe=>C(fe),getFocusableElement:()=>P.current,setIncludeSelection:fe=>w(fe),setIncludeRowDrag:fe=>S(fe),setIncludeDndSource:fe=>y(fe),getCellEditor:()=>N.current??null,getCellRenderer:()=>M.current??k.current,getParentOfValue:()=>L.current??A.current??P.current,setRenderDetails:(fe,De,ze)=>{const Ne=()=>{c(Ve=>Ve?.compDetails!==fe||Ve?.value!==De||Ve?.force!==ze?{value:De,compDetails:fe,force:ze}:Ve)};if(fe?.params?.deferRender&&!e.rowNode.group){const{loadingComp:Ve,onReady:kt}=e.getDeferLoadingCellRenderer();if(Ve){c({value:void 0,compDetails:Ve,force:!1}),kt.then(()=>Xk(Ne));return}}Ne()},setEditDetails:(fe,De,ze,Ne)=>{if(fe){let Ve;fe.componentFromFramework&&(Ne?Ve=new IA(fe.params,()=>p(kt=>kt+1)):Ju()),u({compDetails:fe,popup:De,popupPosition:ze,compProxy:Ve}),De||c(void 0)}else e.hasBrowserFocus()&&xe.getFocusableElement().focus({preventScroll:!0}),N.current=void 0,u(void 0)},refreshEditStyles:(fe,De)=>{if(!P.current)return;const{current:ze}=ne;ze.toggleCss("ag-cell-value",!J),ze.toggleCss("ag-cell-inline-editing",!!fe&&!De),ze.toggleCss("ag-cell-popup-editing",!!fe&&!!De),ze.toggleCss("ag-cell-not-inline-editing",!fe||!!De)}},Le=A.current||void 0;e.setComp(xe,Ce,T.current??void 0,Le,t,s,a.current)},[]),$=g.useCallback(re=>{P.current=re,ie()},[]),q=g.useCallback(re=>{T.current=re,ie()},[]),se=g.useMemo(()=>!!(l?.compDetails?.componentFromFramework&&Ki(l.compDetails.componentClass)),[l]);g.useLayoutEffect(()=>{if(!P.current)return;const{current:re}=ne;re.toggleCss("ag-cell-value",!J),re.toggleCss("ag-cell-inline-editing",!!d&&!d.popup),re.toggleCss("ag-cell-popup-editing",!!d&&!!d.popup),re.toggleCss("ag-cell-not-inline-editing",!d||!!d.popup)});const B=()=>{const{compDetails:re,value:Ce}=l;if(!re)return Ce?.toString?.()??Ce;if(re.componentFromFramework){const xe=re.componentClass;return g.createElement(g.Suspense,{fallback:g.createElement(HA,{cellCtrl:e,parent:P})},se?g.createElement(xe,{...re.params,key:h}):g.createElement(xe,{...re.params,key:h,ref:M}))}},pe=()=>{const re=()=>l==null?null:J?g.createElement("span",{role:"presentation",id:`cell-${r}`,className:me,ref:te},B()):B(),Ce=xe=>OA(xe,Re,P.current,e,F);return d!=null?d.popup?g.createElement(g.Fragment,null,re(),Ce(d)):Ce(d):re()},le=()=>g.createElement("div",{ref:$,style:m,role:D,"col-id":n},J?g.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:Fe},pe()):pe());return e.isCellSpanning()?g.createElement("div",{ref:q,className:"ag-spanned-cell-wrapper",role:"presentation"},le()):le()},BA=g.memo(GA),VA=({rowCtrl:e,containerType:t})=>{const{context:s,gos:o,editSvc:i}=g.useContext(Ct),n=g.useContext(hv)==="default",r=g.useRef(),a=g.useRef(e.getDomOrder()),l=e.isFullWidth(),c=e.rowNode.displayed,[d,u]=g.useState(()=>c?e.rowNode.getRowIndexString():null),[h,p]=g.useState(()=>e.rowId),[m,C]=g.useState(()=>e.businessKey),[v,w]=g.useState(()=>e.rowStyles),b=g.useRef(null),[S,x]=g.useState(()=>null),[y,F]=g.useState(),[R,E]=g.useState(()=>c?e.getInitialRowTop(t):void 0),[D,P]=g.useState(()=>c?e.getInitialTransform(t):void 0),T=g.useRef(null),M=g.useRef(),k=g.useRef(),N=g.useRef(!1),[A,W]=g.useState(0);g.useEffect(()=>{if(N.current||!y||A>10)return;const $=T.current?.firstChild;$?(e.setupDetailRowAutoHeight($),N.current=!0):W(q=>q+1)},[y,A]);const U=g.useRef();U.current||(U.current=new cr(()=>T.current));const L=g.useRef(()=>{}),de=g.useCallback($=>(L.current=$,()=>{L.current=()=>{}}),[]),H=Qk(de,()=>b.current,[]),te=n?H:S,Q=g.useCallback($=>{if(T.current=$,r.current=$?s.createBean(new $i):s.destroyBean(r.current),!$){e.unsetComp(t);return}if(!e.isAlive()||s.isDestroyed())return;const q={setTop:E,setTransform:P,toggleCss:(se,B)=>U.current.toggleCss(se,B),setDomOrder:se=>a.current=se,setRowIndex:u,setRowId:p,setRowBusinessKey:C,setUserStyles:w,setCellCtrls:(se,B)=>{const pe=b.current,le=Za(pe,se,a.current);le!==pe&&(b.current=le,n?L.current():sr(B,()=>x(le)))},showFullWidth:se=>{k.current=se.params,F(se)},getFullWidthCellRenderer:()=>M.current,getFullWidthCellRendererParams:()=>k.current,refreshFullWidth:se=>{const B=se();return k.current=B,_.current?(F(pe=>({...pe,params:B})),!0):!M.current||!M.current.refresh?!1:M.current.refresh(B)}};e.setComp(q,$,t,r.current)},[]);g.useLayoutEffect(()=>pr(y,s,T.current,M),[y]);const J=g.useMemo(()=>{const $={top:R,transform:D};return Object.assign($,v),$},[R,D,v]),me=l&&y?.componentFromFramework,Re=!l&&te!=null,ne=g.useMemo(()=>!!(y?.componentFromFramework&&Ki(y.componentClass)),[y]),_=g.useRef(!1);g.useEffect(()=>{_.current=ne&&!!y&&!!o.get("reactiveCustomComponents")},[ne,y]);const Fe=()=>te?.map($=>g.createElement(BA,{cellCtrl:$,editingCell:i?.isEditing($,{withOpenEditor:!0})??!1,printLayout:e.printLayout,key:$.instanceId})),ie=()=>{const $=y.componentClass;return ne?g.createElement($,{...y.params}):g.createElement($,{...y.params,ref:M})};return g.createElement("div",{ref:Q,role:"row",style:J,"row-index":d,"row-id":h,"row-business-key":m},Re?Fe():me?ie():null)},gp=g.memo(VA),zA=({name:e})=>{const{context:t,gos:s}=g.useContext(Ct),o=g.useMemo(()=>ur(e),[e]),i=g.useRef(null),n=g.useRef(null),r=g.useRef(null),a=g.useRef([]),l=g.useRef([]),[c,d]=g.useState(()=>[]),u=!!s.get("enableCellSpan")&&!!o.getSpannedRowCtrls,h=g.useRef([]),p=g.useRef([]),[m,C]=g.useState(()=>[]),v=g.useRef(!1),w=g.useRef(),b=g.useMemo(()=>Yt("ag-viewport",Om(e)),[e]),S=g.useMemo(()=>Yt(va(e)),[e]),x=g.useMemo(()=>Yt("ag-spanning-container",R2(e)),[e]),y=o.type==="center"||u,F=y?i:n;Co(" AG Row Container "+e+" ",F);const R=g.useCallback(()=>{const A=!y||i.current!=null,W=n.current!=null,U=!u||r.current!=null;return A&&W&&U},[]),E=g.useCallback(()=>i.current==null&&n.current==null&&r.current==null,[]),D=g.useCallback(()=>{if(E()&&(w.current=t.destroyBean(w.current)),!t.isDestroyed()&&R()){const A=L=>{const de=Za(l.current,a.current,v.current);de!==l.current&&(l.current=de,sr(L,()=>d(de)))},W=L=>{const de=Za(p.current,h.current,v.current);de!==p.current&&(p.current=de,sr(L,()=>C(de)))},U={setHorizontalScroll:L=>{i.current&&(i.current.scrollLeft=L)},setViewportHeight:L=>{i.current&&(i.current.style.height=L)},setRowCtrls:({rowCtrls:L,useFlushSync:de})=>{const H=!!de&&a.current.length>0&&L.length>0;a.current=L,A(H)},setSpannedRowCtrls:(L,de)=>{const H=!!de&&h.current.length>0&&L.length>0;h.current=L,W(H)},setDomOrder:L=>{v.current!=L&&(v.current=L,A(!1))},setContainerWidth:L=>{n.current&&(n.current.style.width=L)},setOffsetTop:L=>{n.current&&(n.current.style.transform=`translateY(${L})`)}};w.current=t.createBean(new L2(e)),w.current.setComp(U,n.current,r.current??void 0,i.current)}},[R,E]),P=g.useCallback(A=>{n.current=A,D()},[D]),T=g.useCallback(A=>{r.current=A,D()},[D]),M=g.useCallback(A=>{i.current=A,D()},[D]),k=()=>g.createElement("div",{className:S,ref:P,role:y?"presentation":"rowgroup"},c.map(A=>g.createElement(gp,{rowCtrl:A,containerType:o.type,key:A.instanceId})));if(!y)return k();const N=()=>g.createElement("div",{className:x,ref:T,role:"presentation"},m.map(A=>g.createElement(gp,{rowCtrl:A,containerType:o.type,key:A.instanceId})));return g.createElement("div",{className:b,ref:M,role:"rowgroup"},k(),u?N():null)},WA=g.memo(zA),_A=()=>{const e=g.useContext(Ct),{context:t,overlays:s}=e,[o,i]=g.useState(""),[n,r]=g.useState(0),[a,l]=g.useState(0),[c,d]=g.useState("0px"),[u,h]=g.useState("0px"),[p,m]=g.useState("100%"),[C,v]=g.useState("0px"),[w,b]=g.useState("0px"),[S,x]=g.useState("100%"),[y,F]=g.useState(!0),[R,E]=g.useState(!0),[D,P]=g.useState(null),[T,M]=g.useState(""),[k,N]=g.useState(null),[A,W]=g.useState("ag-layout-normal"),U=g.useRef();U.current||(U.current=new cr(()=>L.current));const L=g.useRef(null),de=g.useRef(null),H=g.useRef(null),te=g.useRef(null),Q=g.useRef(null),J=g.useRef(null),me=g.useRef(null),Re=g.useRef([]),ne=g.useRef([]);Co(" AG Grid Body ",L),Co(" AG Pinned Top ",de),Co(" AG Sticky Top ",H),Co(" AG Middle ",J),Co(" AG Pinned Bottom ",me);const _=g.useCallback(De=>{if(L.current=De,!De||t.isDestroyed()){Re.current=t.destroyBeans(Re.current);for(const V of ne.current)V();ne.current=[];return}const ze=(V,Ee)=>{V.appendChild(Ee),ne.current.push(()=>Ee.remove())},Ne=V=>{const Ee=t.createBean(new V);return Re.current.push(Ee),Ee},Ve=(V,Ee,At)=>{ze(V,document.createComment(At)),ze(V,Ne(Ee).getGui())};Ve(De,z2," AG Fake Horizontal Scroll ");const kt=s?.getOverlayWrapperCompClass();kt&&Ve(De,kt," AG Overlay Wrapper "),Q.current&&Ve(Q.current,_2," AG Fake Vertical Scroll ");const Et={setRowAnimationCssOnBodyViewport:i,setColumnCount:V=>{L.current&&CS(L.current,V)},setRowCount:V=>{L.current&&fS(L.current,V)},setTopHeight:r,setBottomHeight:l,setStickyTopHeight:d,setStickyTopTop:h,setStickyTopWidth:m,setTopInvisible:F,setBottomInvisible:E,setColumnMovingCss:(V,Ee)=>U.current.toggleCss(V,Ee),updateLayoutClasses:W,setAlwaysVerticalScrollClass:P,setPinnedTopBottomOverflowY:M,setCellSelectableCss:(V,Ee)=>N(Ee?V:null),setBodyViewportWidth:V=>{J.current&&(J.current.style.width=V)},registerBodyViewportResizeListener:V=>{if(J.current){const Ee=Gs(e,J.current,V);ne.current.push(()=>Ee())}},setStickyBottomHeight:v,setStickyBottomBottom:b,setStickyBottomWidth:x,setGridRootRole:V=>De.setAttribute("role",V)},Ut=t.createBean(new G2);Re.current.push(Ut),Ut.setComp(Et,De,J.current,de.current,me.current,H.current,te.current)},[]),Fe=g.useMemo(()=>Yt("ag-root","ag-unselectable",A),[A]),ie=g.useMemo(()=>Yt("ag-body-viewport",o,A,D,k),[o,A,D,k]),$=g.useMemo(()=>Yt("ag-body",A),[A]),q=g.useMemo(()=>Yt("ag-floating-top",y?"ag-invisible":null,k),[k,y]),se=g.useMemo(()=>Yt("ag-sticky-top",k),[k]),B=g.useMemo(()=>Yt("ag-sticky-bottom",C==="0px"?"ag-invisible":null,k),[k,C]),pe=g.useMemo(()=>Yt("ag-floating-bottom",R?"ag-invisible":null,k),[k,R]),le=g.useMemo(()=>({height:n,minHeight:n,overflowY:T}),[n,T]),re=g.useMemo(()=>({height:c,top:u,width:p}),[c,u,p]),Ce=g.useMemo(()=>({height:C,bottom:w,width:S}),[C,w,S]),xe=g.useMemo(()=>({height:a,minHeight:a,overflowY:T}),[a,T]),Le=De=>g.createElement(WA,{name:De,key:`${De}-container`}),fe=({section:De,children:ze,className:Ne,style:Ve})=>g.createElement("div",{ref:De,className:Ne,role:"presentation",style:Ve},ze.map(Le));return g.createElement("div",{ref:_,className:Fe},g.createElement(TA,null),fe({section:de,className:q,style:le,children:["topLeft","topCenter","topRight","topFullWidth"]}),g.createElement("div",{className:$,ref:Q,role:"presentation"},fe({section:J,className:ie,children:["left","center","right","fullWidth"]})),fe({section:H,className:se,style:re,children:["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"]}),fe({section:te,className:B,style:Ce,children:["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"]}),fe({section:me,className:pe,style:xe,children:["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"]}))},jA=g.memo(_A),UA=(e,t)=>{const{children:s,eFocusableElement:o,onTabKeyDown:i,gridCtrl:n,forceFocusOutWhenTabGuardsAreEmpty:r,isEmpty:a}=e,{context:l}=g.useContext(Ct),c=g.useRef(null),d=g.useRef(null),u=g.useRef(),h=w=>{const b=w==null?void 0:parseInt(w,10).toString();for(const S of[c,d])b===void 0?S.current?.removeAttribute("tabindex"):S.current?.setAttribute("tabindex",b)};g.useImperativeHandle(t,()=>({forceFocusOutOfContainer(w){u.current?.forceFocusOutOfContainer(w)}}));const p=g.useCallback(()=>{const w=c.current,b=d.current;if(!w&&!b||l.isDestroyed()){u.current=l.destroyBean(u.current);return}if(w&&b){const S={setTabIndex:h};u.current=l.createBean(new qm({comp:S,eTopGuard:w,eBottomGuard:b,eFocusableElement:o,onTabKeyDown:i,forceFocusOutWhenTabGuardsAreEmpty:r,focusInnerElement:x=>n.focusInnerElement(x),isEmpty:a}))}},[]),m=g.useCallback(w=>{c.current=w,p()},[p]),C=g.useCallback(w=>{d.current=w,p()},[p]),v=w=>{const b=w==="top"?Di.TAB_GUARD_TOP:Di.TAB_GUARD_BOTTOM;return g.createElement("div",{className:`${Di.TAB_GUARD} ${b}`,role:"presentation",ref:w==="top"?m:C})};return g.createElement(g.Fragment,null,v("top"),s,v("bottom"))},$A=g.forwardRef(UA),qA=g.memo($A),KA=({context:e})=>{const[t,s]=g.useState(""),[o,i]=g.useState(""),[n,r]=g.useState(null),[a,l]=g.useState(null),[c,d]=g.useState(!1),[u,h]=g.useState(),p=g.useRef(),m=g.useRef(null),C=g.useRef(),[v,w]=g.useState(null),b=g.useRef(()=>{}),S=g.useRef(),x=g.useRef([]),y=g.useCallback(()=>{},[]);Co(" AG Grid ",m);const F=g.useCallback(M=>{if(m.current=M,p.current=M?e.createBean(new VF):e.destroyBean(p.current),!M||e.isDestroyed())return;const k=p.current;b.current=k.focusInnerElement.bind(k);const N={destroyGridUi:()=>{},setRtlClass:s,forceFocusOutOfContainer:A=>{if(!A&&S.current?.isDisplayed()){S.current.forceFocusOutOfContainer(A);return}C.current?.forceFocusOutOfContainer(A)},updateLayoutClasses:i,getFocusableContainers:()=>{const A=[],W=m.current?.querySelector(".ag-root");W&&A.push({getGui:()=>W});for(const U of x.current)U.isDisplayed()&&A.push(U);return A},setCursor:r,setUserSelect:l};k.setComp(N,M,M),d(!0)},[]);g.useEffect(()=>{const M=p.current,k=m.current;if(!u||!M||!v||!k||e.isDestroyed())return;const N=[],{watermarkSelector:A,paginationSelector:W,sideBarSelector:U,statusBarSelector:L,gridHeaderDropZonesSelector:de}=M.getOptionalSelectors(),H=[];if(de){const Q=e.createBean(new de.component),J=Q.getGui();k.insertAdjacentElement("afterbegin",J),H.push(J),N.push(Q)}if(U){const Q=e.createBean(new U.component),J=Q.getGui(),me=v.querySelector(".ag-tab-guard-bottom");me&&(me.insertAdjacentElement("beforebegin",J),H.push(J)),N.push(Q),x.current.push(Q)}const te=Q=>{const J=e.createBean(new Q),me=J.getGui();return k.insertAdjacentElement("beforeend",me),H.push(me),N.push(J),J};if(L&&te(L.component),W){const Q=te(W.component);S.current=Q,x.current.push(Q)}return A&&te(A.component),()=>{e.destroyBeans(N);for(const Q of H)Q.remove()}},[u,v,e]);const R=g.useMemo(()=>Yt("ag-root-wrapper",t,o),[t,o]),E=g.useMemo(()=>Yt("ag-root-wrapper-body","ag-focus-managed",o),[o]),D=g.useMemo(()=>({userSelect:a??"",WebkitUserSelect:a??"",cursor:n??""}),[a,n]),P=g.useCallback(M=>{C.current=M,h(M!==null)},[]),T=g.useCallback(()=>!p.current?.isFocusable(),[]);return g.createElement("div",{ref:F,className:R,style:D,role:"presentation"},g.createElement("div",{className:E,ref:w,role:"presentation"},c&&v&&!e.isDestroyed()&&g.createElement(Ct.Provider,{value:e.getBeans()},g.createElement(qA,{ref:P,eFocusableElement:v,onTabKeyDown:y,gridCtrl:p.current,forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:T},g.createElement(jA,null)))))},YA=g.memo(KA),ZA=class extends O{postConstruct(){if(this.beans.colAutosize){const e=this.queueResizeOperationsForTick.bind(this);this.addManagedEventListeners({rowExpansionStateChanged:e,expandOrCollapseAll:e,cellValueChanged:e,rowNodeDataChanged:e,rowDataUpdated:e})}}queueResizeOperationsForTick(){const e=this.beans.colAutosize;e.shouldQueueResizeOperations=!0,setTimeout(()=>{e.processResizeOperations()},0)}areHeaderCellsRendered(){return this.beans.ctrlsSvc.getHeaderRowContainerCtrls().every(e=>e.getAllCtrls().every(t=>t.areCellsRendered()))}areCellsRendered(){return this.beans.rowRenderer.getAllRowCtrls().every(e=>e.isRowRendered()&&e.getAllCellCtrls().every(t=>!!t.eGui))}},wv={setGridApi:void 0,maxComponentCreationTimeMs:void 0,children:void 0},XA={gridOptions:void 0,modules:void 0,containerStyle:void 0,className:void 0,passGridApi:void 0,componentWrappingElement:void 0,...wv},bv=new Set(Object.keys(XA)),QA=new Set(Object.keys(wv)),Sv=e=>{const t=g.useRef(),s=g.useRef(null),o=g.useRef(null),i=g.useRef([]),n=g.useRef([]),r=g.useRef(e),a=g.useRef(),l=g.useRef(),c=g.useRef(!1),[d,u]=g.useState(void 0),[,h]=g.useState(0),p=g.useCallback(w=>{if(s.current=w,!w){for(const T of i.current)T();i.current.length=0;return}const b=e.modules||[];o.current||(o.current=new CA(()=>h(T=>T+1),e.componentWrappingElement,e.maxComponentCreationTimeMs),i.current.push(()=>{o.current?.destroy(),o.current=null}));const S=Cy(e.gridOptions,e,Object.keys(e).filter(T=>!bv.has(T))),x=()=>{if(c.current){const T=()=>a.current?.shouldQueueUpdates()?void 0:n.current.shift();let M=T();for(;M;)M(),M=T()}},y=new s8(x);a.current=y;const F=new ZA,R={providedBeanInstances:{frameworkCompWrapper:new e8(o.current,S),renderStatus:F},modules:b,frameworkOverrides:y,setThemeOnGridDiv:!0},E=T=>{u(T),T.createBean(F),i.current.push(()=>{T.destroy()}),T.getBean("ctrlsSvc").whenReady({addDestroyFunc:M=>{i.current.push(M)}},()=>{if(T.isDestroyed())return;const M=t.current;M&&e.passGridApi?.(M)})},D=T=>{T.getBean("ctrlsSvc").whenReady({addDestroyFunc:M=>{i.current.push(M)}},()=>{for(const M of n.current)M();n.current.length=0,c.current=!0})},P=new h4;S.gridId??(S.gridId=l.current),t.current=P.create(w,S,E,D,R),i.current.push(()=>{t.current=void 0}),t.current&&(l.current=t.current.getGridId())},[]),m=g.useMemo(()=>({height:"100%",...e.containerStyle||{}}),[e.containerStyle]),C=g.useCallback(w=>{c.current&&!a.current?.shouldQueueUpdates()?w():n.current.push(w)},[]);g.useEffect(()=>{const w=JA(r.current,e);r.current=e,C(()=>{t.current&&vy(w,t.current)})},[e]);const v=!g.useSyncExternalStore||ga(e,"renderingMode")==="legacy"?"legacy":"default";return g.createElement("div",{style:m,className:e.className,ref:p},g.createElement(hv.Provider,{value:v},d&&!d.isDestroyed()?g.createElement(YA,{key:d.instanceId,context:d}):null,o.current?.getPortals()??null))};function JA(e,t){const s={};for(const o of Object.keys(t)){if(bv.has(o)){QA.has(o)&&z(274,{prop:o});continue}const i=t[o];e[o]!==i&&(s[o]=i)}return s}var e8=class extends C4{constructor(e,t){super(),this.parent=e,this.gridOptions=t}createWrapper(e,t){const s=this.gridOptions;if(ga(s,"reactiveCustomComponents")){const r=(a=>{switch(a){case"filter":return ga(s,"enableFilterHandlers")?rA:nA;case"floatingFilterComponent":return ga(s,"enableFilterHandlers")?cA:lA;case"dateComponent":return oA;case"dragAndDropImageComponent":return iA;case"loadingOverlayComponent":return uA;case"noRowsOverlayComponent":return gA;case"statusPanel":return pA;case"toolPanel":return fA;case"menuItem":return hA;case"cellRenderer":return sA;case"innerHeaderComponent":return dA}})(t.name);if(r)return new r(e,this.parent,t)}else switch(t.name){case"filter":case"floatingFilterComponent":case"dateComponent":case"dragAndDropImageComponent":case"loadingOverlayComponent":case"noRowsOverlayComponent":case"statusPanel":case"toolPanel":case"menuItem":case"cellRenderer":Ju();break}const i=!t.cellRenderer&&t.name!=="toolPanel";return new mv(e,this.parent,t,i)}},t8=g.forwardRef((e,t)=>{const s=g.useContext(Ct),{registry:o,context:i,gos:n,rowModel:r}=s,[a,l]=g.useState(()=>new es),[c,d]=g.useState(()=>new es),[u,h]=g.useState(),[p,m]=g.useState(),C=g.useRef(),v=g.useRef(null),w=g.useRef(),b=g.useMemo(()=>YS(e.api.getGridId(),u?.rowModelType??"clientSide"),[e]),S=g.useMemo(()=>a.toString()+" ag-details-row",[a]),x=g.useMemo(()=>c.toString()+" ag-details-grid",[c]);t&&g.useImperativeHandle(t,()=>({refresh(){return C.current?.refresh()??!1}})),e.template&&z(230);const y=g.useCallback(R=>{if(v.current=R,!R||i.isDestroyed()){C.current=i.destroyBean(C.current),w.current?.();return}const E={toggleCss:(P,T)=>l(M=>M.setClass(P,T)),toggleDetailGridCss:(P,T)=>d(M=>M.setClass(P,T)),setDetailGrid:P=>h(P),setRowData:P=>m(P),getGui:()=>v.current},D=o.createDynamicBean("detailCellRendererCtrl",!0);if(D&&(i.createBean(D),D.init(E,e),C.current=D,n.get("detailRowAutoHeight"))){const P=()=>{if(v.current==null)return;const T=v.current.clientHeight;T!=null&&T>0&&setTimeout(()=>{e.node.setRowHeight(T),(Qe(n)||zo(n))&&r.onRowHeightChanged()},0)};w.current=Gs(s,R,P),P()}},[]),F=g.useCallback(R=>{C.current?.registerDetailWithMaster(R)},[]);return g.createElement("div",{className:S,ref:y},u&&g.createElement(Sv,{className:x,...u,modules:b,rowData:p,passGridApi:F}))}),s8=class extends Km{constructor(e){super("react"),this.processQueuedUpdates=e,this.queueUpdates=!1,this.renderingEngine="react",this.frameworkComponents={agGroupCellRenderer:cp,agGroupRowRenderer:cp,agDetailCellRenderer:t8},this.wrapIncoming=(t,s)=>s==="ensureVisible"?Zk(t):t()}frameworkComponent(e){return this.frameworkComponents[e]}isFrameworkComponent(e){if(!e)return!1;const t=e.prototype;return!(t&&"getGui"in t)}getLockOnRefresh(){this.queueUpdates=!0}releaseLockOnRefresh(){this.queueUpdates=!1,this.processQueuedUpdates()}shouldQueueUpdates(){return this.queueUpdates}runWhenReadyAsync(){return Yk()}},o8=class extends g.Component{constructor(){super(...arguments),this.apiListeners=[],this.setGridApi=e=>{this.api=e;for(const t of this.apiListeners)t(e)}}registerApiListener(e){this.apiListeners.push(e)}componentWillUnmount(){this.apiListeners.length=0}render(){return g.createElement(Sv,{...this.props,passGridApi:this.setGridApi})}},yv=(e=>(e.Dropdown="dropdown",e.Menu="menu",e))(yv||{}),Ht=(e=>(e.Click="click",e.Hover="hover",e.ContextMenu="contextMenu",e))(Ht||{}),Bi=(e=>(e.Item="item",e.Divider="divider",e.PlainText="plainText",e))(Bi||{});const i8=ue("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),n8=ue("z-[53] overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none"),r8=ue("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-none","hover:bg-accent-primary-alpha px-3","dial-small h-[34px] rounded text-primary"),a8="opacity-75 !cursor-not-allowed",l8="text-error",c8="my-1 border-t border-hover border-secondary",yn=4,eh=({ariaLabel:e,className:t,size:s=24,onClose:o,...i})=>f.jsx(no,{"aria-label":e,className:oe("text-secondary hover:enabled:text-accent-primary",t,"w-auto h-auto"),onClick:o,icon:f.jsx(G.IconX,{size:s}),...i}),Ft=({children:e,menu:t,renderOverlay:s,trigger:o=[Ht.Click],placement:i,disabled:n=!1,open:r,defaultOpen:a=!1,onOpenChange:l,closable:c=!1,onClose:d,className:u,listClassName:h,outsidePressIgnoreRef:p,outsideClosable:m=!0,allowedPlacements:C,anchorToMouse:v=!1,matchReferenceWidth:w=!0,maxDropdownHeight:b})=>{const[S,x]=g.useState(a),y=r!==void 0,F=y?!!r:S,R=g.useRef(null),E=g.useCallback(_=>{y||x(_),l?.(_)},[y,l]),D=g.useId(),P=i===void 0,T=_=>"clientWidth"in _?_.clientWidth:_.getBoundingClientRect?.()?.width??0,{refs:M,floatingStyles:k,context:N}=Ie.useFloating({placement:i,open:F,onOpenChange:E,whileElementsMounted:Ie.autoUpdate,middleware:[Ie.offset({mainAxis:yn,crossAxis:0}),P?Ie.autoPlacement({alignment:"start",crossAxis:!0,padding:yn,allowedPlacements:C}):Ie.flip({padding:yn}),Ie.shift({padding:yn}),Ie.size({padding:yn,apply({availableWidth:_,availableHeight:Fe,elements:ie}){const $=ie.floating,q=T(ie.reference);$.style.setProperty("--fui-available-height",`${Math.floor(Fe)}px`),$.style.setProperty("--reference-width",w?`${Math.round(q)}px`:"0px"),w?$.style.minWidth=`${Math.round(q)}px`:$.style.removeProperty("min-width"),$.style.maxWidth=`${Math.floor(_)}px`;const se=Math.floor(Fe);$.style.maxHeight=`${b?Math.min(se,b):se}px`}})]}),A=Ie.useClick(N,{enabled:o.includes(Ht.Click)&&!n}),W=Ie.useHover(N,{enabled:o.includes(Ht.Hover)&&!n,move:!1,restMs:40,delay:{open:80,close:80}}),U=Ie.useDismiss(N,{bubbles:!0,referencePress:!1,outsidePress:_=>{if(!m)return!1;const Fe=_.target;return!(p?.current&&Fe instanceof Node&&p.current.contains(Fe))}}),L=Ie.useRole(N,{role:"menu"}),{getReferenceProps:de,getFloatingProps:H}=Ie.useInteractions([A,W,U,L]),te=g.useCallback((_,Fe)=>{M.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:_,y:Fe,top:Fe,left:_,right:_,bottom:Fe})})},[M]),Q=g.useCallback(_=>{!o.includes(Ht.ContextMenu)||n||(_.preventDefault(),v&&(te(_.clientX,_.clientY),R.current=document.elementFromPoint(_.clientX,_.clientY)),E(!0))},[v,n,E,te,o]),J=g.useCallback(_=>{!v||n||(o.includes(Ht.ContextMenu)&&F&&E(!1),te(_.clientX,_.clientY),R.current=document.elementFromPoint(_.clientX,_.clientY))},[v,n,te,F,o,E]);g.useEffect(()=>{n&&F&&E(!1)},[n,F,E]);const me=g.useCallback(_=>Fe=>{_.disabled||(_.onClick?.({key:_.key,domEvent:Fe}),t?.onClick?.({key:_.key,domEvent:Fe}),E(!1))},[t,E]),Re=g.useMemo(()=>s?s():t?f.jsxs(f.Fragment,{children:[t.header&&f.jsx(f.Fragment,{children:typeof t.header=="function"?t.header():t.header}),f.jsx("div",{role:"none",className:"py-1","aria-label":"dropdown",children:t.items.map(_=>_.type===Bi.Divider?f.jsx("div",{role:"separator",className:c8},_.key):_.type===Bi.PlainText?f.jsx("div",{className:oe("px-3 py-2 text-secondary dial-caption",_.className),children:_.label},_.key):f.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!_.disabled,className:ue(r8,_.disabled&&a8,_.danger&&l8,_.className),disabled:_.disabled,onClick:me(_),children:[_.icon&&f.jsx("span",{className:ue(_.danger&&"text-error",_.disabled&&"text-secondary"),children:f.jsx($e,{icon:_.icon})}),f.jsx("span",{className:ue("flex-1 truncate text-left",_.danger&&"text-error",_.disabled&&"text-secondary"),"aria-labelledby":"item-text",children:_.label})]},_.key))}),t.footer&&f.jsx(f.Fragment,{children:typeof t.footer=="function"?t.footer():t.footer})]}):null,[me,t,s]),ne=de({onContextMenu:Q,onMouseDown:J});return g.useEffect(()=>{if(!F)return;const _=M.reference.current;let Fe=null;if(_ instanceof Element?Fe=_:R.current instanceof Element&&(Fe=R.current),!Fe)return;const ie=new IntersectionObserver(([$])=>{$.isIntersecting||E(!1)},{root:null,threshold:0});return ie.observe(Fe),()=>ie.disconnect()},[F,M.reference,E]),f.jsxs(f.Fragment,{children:[f.jsx("span",{ref:M.setReference,className:ue(i8,n&&"!cursor-not-allowed opacity-75",u),"aria-haspopup":"menu","aria-expanded":F,"aria-controls":D,...ne,children:e}),F&&f.jsx(Ie.FloatingPortal,{children:f.jsx(Ie.FloatingFocusManager,{context:N,modal:!1,initialFocus:-1,returnFocus:!0,children:f.jsxs("div",{id:D,ref:M.setFloating,style:k,className:ue(n8,!w&&"w-max",h),...H(),children:[c&&f.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:f.jsx(eh,{ariaLabel:"Close dropdown",onClose:_=>{d?.(_),E(!1)}})}),Re]})})})]})},d8="h-full w-full",pp=".ag-checkbox-input",Vc={accentColor:"var(--controls-bg-accent, #5C8DEA)",backgroundColor:"var(--bg-layer-3, #1D2439)",oddRowBackgroundColor:"var(--bg-layer-2, #161B2D)",selectedRowBackgroundColor:"var(--bg-accent-primary-alpha, #7DA4FF26)",borderColor:"var(--bg-layer-4, #242C42)",rowBorder:"1px solid var(--stroke-tertiary, #0C101D)",rowHoverColor:"var(--bg-accent-primary-alpha, #7DA4FF26)",borderRadius:3,browserColorScheme:"dark",chromeBackgroundColor:"var(--bg-layer-1, #0C101D)",foregroundColor:"var(--text-primary, ##EEF1F7)",headerFontSize:14,headerFontWeight:600,headerTextColor:"var(--text-secondary, #7F8792)",spacing:4,wrapperBorderRadius:3,fontSize:14,fontFamily:{googleFont:"var(--theme-font, var(--font-inter))"}},zc=40;var mo=(e=>(e.API="api",e.ROW_DATA_CHANGED="rowDataChanged",e.CHECKBOX_SELECTED="checkboxSelected",e))(mo||{});const u8=(e,t,s,o,i)=>{const n=typeof e=="string"?e.toLowerCase():e,r=typeof t=="string"?t.toLowerCase():t;return n===r?0:n?r?n>r?1:-1:i?1:-1:i?-1:1};var Vn=(e=>(e.MULTIPLE="MULTIPLE",e.SINGLE="SINGLE",e))(Vn||{});const xv="en-US",Rv={year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"},h8="text-primary",Wc=40,Fv={minWidth:Wc,width:Wc,maxWidth:Wc},g8={cellClass:"ag-grid-no-checkbox",...Fv},p8={...Fv};function f8(e,t){let s=null;return(...o)=>{s&&clearTimeout(s),s=setTimeout(()=>e(...o),t)}}Kk({testIdAttribute:"dataQA"});Mf.registerModules([jk]);const th=({columnDefs:e,rowData:t,additionalGridOptions:s,getContextMenuItems:o,className:i,ariaLabel:n="Data grid",wrapCustomCellRenderers:r=!0,disabledRowIds:a,selectedRowIds:l,selectionOnHover:c=!0,onSelectionChange:d,onGridApiChange:u,getRowId:h=R=>String(R.id??JSON.stringify(R)),alternateOddRowColors:p=!1,filterPlaceholder:m="Enter value",emptyStateIcon:C,emptyStateTitle:v="No results found",emptyStateDescription:w="Sorry, we couldn't find any results for your search.",loading:b=!1,wrapperBorder:S=!0,withoutHeaderBorders:x=!1,allowDisabledContextMenu:y=!1,selectionMode:F})=>{const[R,E]=g.useState(zc),[D,P]=g.useState(),T=g.useId(),M=g.useRef(new Set),k=g.useRef(void 0),N=g.useMemo(()=>({...Vc,oddRowBackgroundColor:p?Vc.oddRowBackgroundColor:Vc.backgroundColor,wrapperBorder:S}),[p,S]),A=g.useCallback(q=>{q.api.sizeColumnsToFit(),E(zc)},[]),W=g.useCallback(q=>{if(q.data){const se=h(q.data),B=a?.has(se)??!1,pe=B&&!y,le=q.value==null?"":String(q.value),re=o?.(q.data)??[];return f.jsx(Ft,{trigger:[Ht.ContextMenu],menu:{items:re},anchorToMouse:!0,matchReferenceWidth:!0,className:"w-full",disabled:pe,children:f.jsx("span",{className:"block min-w-0 h-full max-w-full",children:f.jsx(ht,{text:le,className:"max-w-full h-full",hideTooltip:B})})})}},[o,a,h,y]),U=g.useCallback(q=>q===mo.API||q===mo.ROW_DATA_CHANGED,[]),L=g.useCallback(q=>{if(!D)return;const B=(q.selectedNodes||[]).map(le=>le.data),pe=new Set(B.map(h));M.current=pe,k.current=q.source,U(q.source)||d?.(pe,B)},[D,h,U,d]),de=g.useMemo(()=>f8(q=>L?.(q),100),[L]),H=g.useCallback(q=>{if(!q.data)return null;const se=h(q.data),B=q.node.isSelected(),pe=a?.has(se),le=`row-select-${se}`;return f.jsx("div",{className:"h-6 w-6 flex items-center justify-center",children:f.jsx(Zd,{className:"w-[18px] h-[18px]",inputId:le,checked:B,disabled:pe,name:"gridradiobutton",value:"selected",onChange:()=>{pe||(q.node.setSelected(!0,!0,mo.CHECKBOX_SELECTED),q.api.refreshCells({columns:[q.column?.getColId()]}))}})})},[h,a]),te=g.useCallback(q=>{const se="dial-row-select",B="dial-row-select-visible";return q?se:`${se} ${B}`},[]),Q=g.useMemo(()=>{if(F===Vn.SINGLE)return{...g8,cellRenderer:H};if(F===Vn.MULTIPLE)return{...p8,headerClass:()=>te(c),cellClass:q=>{const se=q.data?h(q.data):null;let B=te(c);return se&&a?.has(se)&&(B+=" opacity-50 pointer-events-none"),B}}},[a,h,H,F,c,te]),J=g.useCallback(q=>{const se=typeof r=="function"?r(q):!!r;if(!q.cellRenderer)return{...q,cellRenderer:W};if(!se)return q;const B=q.cellRenderer;return{...q,cellRenderer:le=>{const re=le.data?o?.(le.data)??[]:[];let Ce=null;if(typeof B=="function"){const fe=B;Ce=f.jsx(fe,{...le})}else Ce=W(le);const xe=le.data?h(le.data):null,Le=xe?a?.has(xe):!1;return f.jsx(Ft,{trigger:[Ht.ContextMenu],menu:{items:re},anchorToMouse:!0,matchReferenceWidth:!0,className:ue("w-full h-full",Le&&"!cursor-not-allowed opacity-75"),disabled:Le&&!y,children:f.jsx("span",{className:"block min-w-0 max-w-full flex-1",children:Ce})})}}},[a,o,h,W,r,y]),me=g.useMemo(()=>r?(e??[]).map(J):e??[],[e,r,r?J:null]),Re=g.useMemo(()=>({minWidth:150,resizable:!0,sortable:!0,floatingFilter:!0,filter:"agTextColumnFilter",filterParams:{filterPlaceholder:m,buttons:["reset"]},comparator:u8.bind(void 0)}),[m]),ne=q=>{const se=document.querySelector(pp);se&&se.setAttribute("aria-description",od);const B=me.map(pe=>({...pe,sort:void 0}));q.api.updateGridOptions({columnDefs:B,rowData:t}),q.api.sizeColumnsToFit(),P(q.api),s?.onGridReady?.(q),u?.(q.api)};g.useEffect(()=>{D&&D.redrawRows()},[D]);const _=g.useCallback(()=>f.jsx(rr,{title:v,description:w,containerClassName:"gap-3",titleClassName:"mt-2 !text-lg",icon:C||f.jsx(G.IconZoomCancel,{size:100,stroke:.5,className:"text-secondary"})}),[v,w,C]),Fe=g.useMemo(()=>{if(F)return{mode:F===Vn.SINGLE?"singleRow":"multiRow",isRowSelectable:q=>{const se=q.data?h(q.data):null;return se?!a?.has(se):!0}}},[a,h,F]);g.useEffect(()=>{D&&t&&M.current.size&&M.current.forEach(q=>{const se=D.getRowNode(q);se&&!se.isSelected()&&se.setSelected(!0,!1,mo.API)})},[D,t]),g.useEffect(()=>{D&&l&&(D.deselectAll("all",mo.API),l.forEach(q=>{const se=D.getRowNode(q);se&&!se.isSelected()&&se.setSelected(!0,!1,mo.API)}))},[D,l]);const ie=g.useCallback(q=>q.data?h(q.data):"",[h]),$=g.useCallback(()=>{document.querySelectorAll(`.ag-row ${pp}`).forEach(q=>{q.setAttribute("aria-description",od)})},[]);return g.useEffect(()=>{const q=U(k.current);if(D&&l?.size&&q){const se=Array.from(l)[0];if(se){const B=D.getRowNode(se);B&&D.ensureNodeVisible(B)}}},[D,U,l]),f.jsx("div",{className:ue(d8,i,F&&"with-selection-column",x&&"dial-without-header-borders"),"aria-label":n,role:"region","aria-busy":b,children:f.jsx("div",{className:"ag-theme-balham-dark h-full overflow-x-auto",role:"table","aria-describedby":T,children:f.jsx(o8,{rowModelType:"clientSide",headerHeight:zc,rowHeight:R,cellSelection:!1,theme:_3.withPart(y3).withParams({...N}),autoSizeStrategy:{type:"fitGridWidth"},columnDefs:me,defaultColDef:Re,selectionColumnDef:Q,onGridSizeChanged:A,onGridReady:ne,loading:b,suppressCellFocus:!0,suppressDragLeaveHidesColumns:!0,noRowsOverlayComponent:_,rowData:t,rowSelection:Fe,onSelectionChanged:de,getRowId:ie,onRowDataUpdated:$,onBodyScroll:$,onFirstDataRendered:$,...s})})})};var Xa=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(Xa||{}),Qa=(e=>(e.Mobile="mobile",e.Tablet="tablet",e))(Qa||{});const na=({tab:e,active:t,invalid:s,className:o,horizontal:i,onClick:n})=>{const r=oe("rounded h-[38px] items-center flex flex-row border-transparent cursor-pointer dial-small leading-4 hover:text-accent-primary",{"border-b-2 px-4":i,"border-l-2 px-3":!i}),a=oe(r,{"bg-layer-4":i,"bg-layer-1 text-secondary pointer-events-none":e.disabled,"bg-accent-primary-alpha text-primary":t&&!e.disabled,"text-primary":!t&&!e.disabled,"border-b-accent-primary":t&&i&&!e.disabled,"border-l-accent-primary":t&&!i&&!e.disabled},o);return f.jsxs("button",{role:"tab",className:a,onClick:()=>n(e.id),disabled:e.disabled,children:[f.jsx(ht,{text:e.label,contentClassName:"max-w-[200px]",className:"max-w-[200px]"}),(s||e.invalid)&&f.jsx("div",{className:"text-error pl-1",children:f.jsx(G.IconExclamationCircle,{...Y})}),e.warning&&f.jsx("div",{className:"text-warning pl-1",children:f.jsx(G.IconAlertTriangle,{...Y})})]})},m8=12;var Qs=(e=>(e.Undefined="undefined",e.Mobile="mobile",e.Tablet="tablet",e.Desktop="desktop",e))(Qs||{});const fp=()=>typeof window<"u"&&window.innerWidth<640,_c=()=>{if(typeof window>"u")return Qs.Undefined;const e=window.innerWidth;return e>=1024?Qs.Desktop:e<640?Qs.Mobile:Qs.Tablet},C8=()=>{const[e,t]=g.useState(()=>typeof window>"u"?Qs.Desktop:_c());return g.useEffect(()=>{t(_c());const s=()=>t(_c());return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),e},Ev=({tabs:e,activeTab:t,onClick:s,orientation:o=Xa.Horizontal,screenThreshold:i=Qa.Tablet,smallScreenContainerClassName:n,smallScreenDropdownItemClassName:r,desktopDropdownClassName:a,desktopTabClassName:l})=>{const[c,d]=g.useState(!1),[u,h]=g.useState(!1),[p,m]=g.useState(!1),C=C8(),v=C===Qs.Mobile||i===Qa.Tablet&&C===Qs.Tablet,w=o===Xa.Horizontal,b=g.useRef(null),S=g.useRef(null),x=g.useRef(null),y=e.find(P=>P.id===t),F=g.useMemo(()=>ue("flex gap-2",w?"flex-row flex-nowrap overflow-x-auto":"flex-col flex-wrap w-full"),[w]),R=g.useCallback(()=>{const P=S.current;P&&m(P.scrollWidth>P.clientWidth)},[]),E=g.useCallback(()=>{const P=x.current,T=S.current;if(!P||!T)return;const M=P.getBoundingClientRect(),k=T.getBoundingClientRect();if(M.width===0||k.width===0)return;const N=m8;let A=T.scrollLeft;if(M.left<k.left+N)A-=k.left+N-M.left;else if(M.right>k.right-N)A+=M.right-(k.right-N);else return;const W=Math.max(0,T.scrollWidth-T.clientWidth);A=Math.max(0,Math.min(A,W)),A!==T.scrollLeft&&T.scrollTo({left:A,behavior:"smooth"})},[]),D=g.useCallback(P=>{s(P),P===t&&E()},[s,t,E]);return g.useEffect(()=>{R();const P=new ResizeObserver(()=>R()),T=S.current;return T&&P.observe(T),()=>P.disconnect()},[e,R]),g.useEffect(()=>{E()},[t,E]),v?f.jsx("div",{role:"tablist",className:oe("h-11 flex items-center bg-layer-3 px-4",n),children:f.jsx(Ft,{trigger:[Ht.Click],open:c,onOpenChange:d,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],renderOverlay:()=>e.map(P=>f.jsx(na,{tab:P,active:P.id===t,onClick:T=>{D(T),d(!1)},className:oe("w-full rounded-none h-11 items-center px-6",r)},P.id)),children:f.jsxs("div",{className:"flex gap-2 items-center h-11 cursor-pointer",children:[f.jsx(na,{tab:y,active:!0,onClick:D,className:"rounded-none bg-transparent border-l-0 border-b-0 h-full items-center px-0"},t),f.jsx($e,{icon:f.jsx(G.IconChevronDown,{size:pt.SM}),className:ue("text-primary transition-transform",c&&"rotate-180")})]})})}):f.jsxs("div",{ref:b,className:"flex w-full items-start",children:[f.jsx("div",{ref:S,role:"tablist",className:F,children:e.map(P=>f.jsx("div",{ref:t===P.id?x:void 0,className:"w-full",children:f.jsx(na,{tab:P,active:t===P.id,onClick:D,horizontal:w,className:oe("w-full",l)})},P.id))}),p&&f.jsx("div",{className:"flex items-center ml-2",children:f.jsx(Ft,{trigger:[Ht.Click],open:u,onOpenChange:h,placement:"bottom-end",renderOverlay:()=>e.map(P=>f.jsx(na,{tab:P,active:P.id===t,onClick:T=>{D(T),h(!1)},className:"w-full rounded-none h-8 items-center px-3 py-2"},P.id)),children:f.jsx(ss,{iconBefore:f.jsx(G.IconDotsVertical,{size:Nt}),className:oe("w-8 h-8 flex items-center justify-center rounded border",u?"bg-layer-4 border-transparent":"border-primary",a)})})})]})},v8="w-full overflow-hidden",w8="flex flex-nowrap items-center gap-2 min-w-0 px-0 py-0 whitespace-nowrap",Dv="flex items-center gap-2 min-w-0 shrink-0 dial-small",b8="basis-[20%] flex-none",S8="flex-1 min-w-0",mp="inline-flex items-center gap-1 min-w-0 transition-colors",y8="text-secondary hover:text-accent-primary",x8="text-primary cursor-default",Pv="flex-none inline-flex items-center leading-none text-secondary",R8="items-center gap-1 min-w-0 transition-colors text-secondary hover:text-accent-primary",Tv=f.jsx(G.IconChevronRight,{size:pt.SM,"aria-hidden":"true"}),Dn=({label:e,href:t,onClick:s,disabled:o,isLast:i,separator:n=Tv,className:r,iconBefore:a,labelClassName:l,onBeforeNavigate:c,...d})=>{const u=async v=>{if(c&&!i&&!await c()){v.preventDefault();return}s&&s(v)},h=oe(Dv,i?S8:b8,r),p=(!!t||!!s)&&!i&&!o,m=p?oe(mp,y8):oe(mp,x8,o?"pointer-events-none opacity-75":""),C=typeof e=="string"?f.jsx(ht,{className:oe("cursor-pointer",l),text:e,id:"breadcrumb-item-content"}):f.jsx("span",{className:oe("flex-1 min-w-0 max-w-full truncate cursor-pointer max-w-[300px]",l),"aria-label":"breadcrumb-item-content",children:e});return f.jsxs("li",{...d,className:h,"aria-label":d["aria-label"]||"breadcrumb-item",children:[p?f.jsxs("a",{href:t,onClick:u,className:m,children:[a,C]}):f.jsxs("span",{className:m,"aria-current":i?"page":void 0,"aria-disabled":o?"true":void 0,children:[a,C]}),!i&&f.jsx("span",{className:Pv,"aria-label":"separator",children:n})]})},Mv=({pathItems:e,separator:t=Tv,ariaLabel:s="Breadcrumb",className:o,children:i,labelClassName:n,onBeforeNavigate:r})=>{const a=g.useMemo(()=>e?.length?e:g.Children.toArray(i).filter(g.isValidElement).map(d=>{const u=d.props,{labelClassName:h,isLast:p,separator:m,...C}=u;return C}),[e,i]),l=g.useCallback(async d=>{const u=parseInt(d.key,10),h=a[u];if(r&&!await r()){d.domEvent.preventDefault();return}h.onClick?h.onClick(d.domEvent):h.href&&(window.location.href=h.href)},[a,r]),c=g.useMemo(()=>{if(a.length===0)return null;if(a.length<=3)return a.map((C,v)=>g.createElement(Dn,{...C,key:`item-${v}`,isLast:v===a.length-1,separator:t,labelClassName:n,onBeforeNavigate:r}));const d=a.at(0),u=a.slice(1,-2),h=a.at(-2),p=a.at(-1);if(!d||!h||!p)return null;const m=u.map((C,v)=>({key:String(v+1),label:typeof C.label=="string"?C.label:`Item ${v+1}`,disabled:C.disabled}));return f.jsxs(f.Fragment,{children:[g.createElement(Dn,{...d,key:"item-0",separator:t,labelClassName:n,onBeforeNavigate:r}),f.jsxs("li",{className:oe(Dv),children:[f.jsx(Ft,{menu:{items:m,onClick:l},placement:"bottom-start",matchReferenceWidth:!1,children:f.jsx("button",{type:"button","aria-label":"More breadcrumbs",className:R8,children:f.jsx(G.IconDots,{size:pt.SM})})}),f.jsx("span",{className:Pv,children:t})]}),g.createElement(Dn,{...h,key:`item-${a.length-2}`,separator:t,labelClassName:n,onBeforeNavigate:r}),g.createElement(Dn,{...p,key:`item-${a.length-1}`,isLast:!0,separator:t,labelClassName:n,onBeforeNavigate:r})]})},[a,t,n,l,r]);return f.jsx("nav",{"aria-label":s,className:oe(v8,o),children:f.jsx("ol",{className:w8,children:c})})},sh=(e,t)=>({appearance:o,...i})=>f.jsx(ss,{...i,variant:e,appearance:o||t}),Iv=(e,t)=>({variant:o,...i})=>f.jsx(ss,{...i,variant:o||t,appearance:e}),bs=sh(Ge.Primary,Me.Solid),ys=sh(Ge.Neutral,Me.Outlined),kv=sh(Ge.Error,Me.Outlined),F8=Iv(Me.Link,Ge.Primary),E8=Iv(Me.Ghost,Ge.Primary),Yi=(e,t)=>({appearance:o,...i})=>f.jsx(no,{...i,variant:e,appearance:o||t}),D8=(e,t)=>({variant:o,...i})=>f.jsx(no,{...i,variant:o||t,appearance:e}),P8=Yi(Ge.Primary,Me.Solid),T8=Yi(Ge.Neutral,Me.Outlined),Av=Yi(Ge.Error,Me.Outlined),M8=Yi(Ge.Secondary,Me.Ghost),I8=Yi(Ge.Tertiary,Me.Ghost),k8=Yi(Ge.Success,Me.Ghost),A8=D8(Me.Ghost,Ge.Primary),Lv=({iconClassName:e,label:t,...s})=>t?f.jsx(kv,{...s,label:t,appearance:Me.Ghost,iconBefore:f.jsx(G.IconTrashX,{...Y,className:e||""})}):f.jsx(Av,{...s,appearance:Me.Ghost,icon:f.jsx(G.IconTrashX,{...Y,className:e||""})}),L8=({className:e="",value:t,onChange:s,error:o,containerClassName:i,resize:n=!1,labelProps:r,caption:a,id:l,...c})=>{const d=oe("dial-textarea dial-input px-3 py-2",c.invalid&&"dial-input-error",c.disabled&&"dial-input-disable",n?"resize":"resize-none",e);return f.jsxs("div",{className:oe("flex flex-col gap-y-2",i),children:[r&&f.jsx(Bo,{...r,htmlFor:l}),f.jsx("textarea",{id:l,value:t||"",className:d,onChange:u=>s?.(u.currentTarget.value),...c}),f.jsx(ns,{text:o}),!o&&f.jsx(ir,{text:a})]})},oh=({label:e,switchId:t,isOn:s=!1,disabled:o,onChange:i,caption:n})=>{const r=ue("flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",s?"flex-row-reverse":"flex-row",o?"pointer-events-none":"",o?s?"bg-controls-disable":"bg-layer-4":s?"bg-accent-primary":"bg-layer-4"),a=g.useCallback(l=>{l.stopPropagation(),i?.(!s)},[i,s]);return f.jsxs("div",{className:"flex flex-row items-start",role:"switch",children:[f.jsx("input",{type:"checkbox",onChange:a,id:t,disabled:o,className:"invisible w-0 h-0",checked:s}),f.jsx("label",{htmlFor:t,className:r,"aria-describedby":n&&"caption",children:f.jsx("span",{className:ue("size-3 rounded-full",o?"bg-controls-disable-accent":"bg-controls-enable-primary")})}),(e||n)&&f.jsxs("div",{className:"flex flex-col gap-1 ml-2",children:[e&&f.jsx("span",{className:ue("dial-small py-[1px]",o?"text-secondary":"text-primary"),"aria-label":"switch-title",children:e}),n&&f.jsx("span",{id:"caption",className:"dial-tiny text-secondary",children:n})]})]})};var Wt=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(Wt||{});const O8="z-[52] flex items-center justify-center bg-blackout md:p-4",Cp="divide-tertiary divide-y",N8="flex flex-row justify-between py-4 px-6 items-center",H8={[Wt.Sm]:"dial-sm-popup",[Wt.Md]:"dial-md-popup",[Wt.Lg]:"dial-lg-popup"},Uo=({open:e=!1,header:t,portalId:s,className:o,overlayClassName:i,titleClassName:n,headerClassName:r,dividers:a=!0,dividerFooter:l=!0,children:c,footer:d,onClose:u,size:h=Wt.Md,hideClose:p=!1,closeOnOutsideClick:m=!0,preventKeyboardOnOpen:C=!1})=>{const v=g.useRef(null),{refs:w,context:b}=Ie.useFloating({open:e,onOpenChange:E=>{E||u?.(null)}}),S=Ie.useRole(b,{role:"dialog"}),x=Ie.useDismiss(b,{outsidePress:m}),{getFloatingProps:y}=Ie.useInteractions([S,x]);if(!e)return null;const F=typeof t=="string"?"dial-popup-heading":void 0,R=E=>E?typeof E=="string"?f.jsx("h3",{id:F,className:ue("flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",n),children:f.jsx(yt,{tooltip:E,children:E})}):E:f.jsx("span",{});return f.jsx(Ie.FloatingPortal,{id:s,children:f.jsx(Ie.FloatingOverlay,{className:ue(O8,i),children:f.jsx(Ie.FloatingFocusManager,{context:b,initialFocus:C?v:void 0,children:f.jsxs("div",{ref:w.setFloating,...y(),role:"dialog","aria-modal":"true","aria-labelledby":F,className:ue("dial-popup",H8[h],a&&Cp,o),children:[C&&f.jsx("div",{ref:v,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),f.jsxs("div",{className:oe(N8,r),children:[R(t),!p&&f.jsx(eh,{ariaLabel:"Close dialog",onClose:E=>u?.(E)})]}),f.jsx("div",{className:"flex-grow overflow-auto","aria-label":"popup-description",children:c}),l&&f.jsx("div",{className:Cp}),d]})})})})};var Vi=(e=>(e.Info="info",e.Danger="danger",e))(Vi||{});const G8="flex justify-end gap-2 px-6 py-4",B8="text-secondary dial-small-150 px-6 py-4",V8="Cancel",z8="Ok",jc={[Vi.Info]:{confirm:{variant:Ge.Primary,appearance:Me.Solid},cancel:{variant:Ge.Neutral,appearance:Me.Outlined}},[Vi.Danger]:{container:"dial-danger-popup",confirm:{variant:Ge.Error,appearance:Me.Solid},cancel:{variant:Ge.Neutral,appearance:Me.Outlined}}},Ov=({header:e,description:t,descriptionClassName:s,open:o=!1,confirmLabel:i=z8,cancelLabel:n=V8,isLoading:r=!1,disableConfirmButton:a=!1,className:l,confirmClassName:c,onClose:d,onConfirm:u,onCancel:h,children:p,dividers:m=!1,variant:C=Vi.Info,size:v=Wt.Sm,footer:w})=>{const b=r?null:f.jsxs("div",{className:G8,children:[f.jsx(ys,{label:n,onClick:()=>h?h():d?.()}),f.jsx(ss,{variant:jc[C].confirm?.variant,appearance:jc[C].confirm?.appearance,className:c,label:i,disabled:a,onClick:()=>u()})]}),S=g.useCallback(()=>r?f.jsx("div",{className:"px-6 py-4 h-[120px]",children:f.jsx(nr,{size:50})}):p??(t?f.jsx("div",{className:ue(B8,s),children:t}):null),[p,t,r,s]);return f.jsx(Uo,{open:o,header:e,className:ue(jc[C].container,l),dividers:m,onClose:()=>d?.(),footer:w??b,size:v,children:S()})},Nv=({selectedItems:e,listClassName:t,listElementClassName:s,placeholder:o})=>e?.length?f.jsx("ul",{className:ue("flex-row items-center truncate flex-wrap","flex gap-x-2 gap-y-1",t),children:e?.map((i,n)=>f.jsx("li",{children:f.jsx(yt,{tooltip:i,children:f.jsx(vo,{tag:i,className:ue([s])})})},`${i}_${n}`))}):o?f.jsx("span",{className:"text-secondary",children:o}):null,Uc=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z",fill:"currentColor"})),Hv=({children:e,open:t,disabled:s=!1,selectedValue:o,valueClassName:i,inputClassName:n,onOpen:r,elementId:a,errorText:l,invalid:c,emptyValueText:d,placeholder:u,editable:h=!1,onValueChange:p})=>{const m=Array.isArray(o)&&o.length>0,C=typeof o=="string"&&!!o.trim(),v=m||C?o:u?void 0:d,w=s?void 0:r,b=g.useCallback(F=>{p?.(F.target.value)},[p]),S=()=>f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:ue("dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between",n,s&&"dial-input-disable",(l||c)&&"dial-input-error"),children:[f.jsx("input",{type:"text",className:ue("flex-1 min-w-0 bg-transparent outline-none border-none p-0 dial-small-text text-primary placeholder:text-secondary",i),value:typeof o=="string"?o:"",placeholder:u||d,onChange:b,disabled:s,id:a,"aria-label":"input-popup-field"}),!s&&f.jsx("button",{type:"button",className:"flex-shrink-0 cursor-pointer bg-transparent border-none p-0 ml-1",onClick:r,"aria-label":"open-popup",children:f.jsx($e,{icon:f.jsx(Uc,{role:"img",width:Nt,height:Nt})})})]}),f.jsx(ns,{text:l})]}),x=()=>f.jsxs(f.Fragment,{children:[f.jsx("button",{type:"button",className:"w-full",onClick:w,"aria-label":"open-popup",id:a,children:f.jsxs("div",{className:ue("dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between cursor-pointer",n,s&&"dial-input-disable",(l||c)&&"dial-input-error"),children:[f.jsx(yt,{tooltip:v==null?void 0:String(v),children:v||!u?f.jsx("span",{className:i,children:v}):f.jsx("span",{className:"text-secondary",children:u})}),!s&&f.jsx("div",{className:"flex-shrink-0",children:f.jsx($e,{icon:f.jsx(Uc,{role:"img",width:Nt,height:Nt})})})]})}),f.jsx(ns,{text:l})]}),y=()=>f.jsx("div",{className:"w-full",onClick:w,children:f.jsxs("div",{className:ue("dial-input px-3 py-2 flex flex-row items-center w-full justify-between cursor-pointer",s&&"dial-input-disable"),children:[f.jsx(Nv,{placeholder:u,selectedItems:v}),!s&&f.jsx("div",{className:"ml-1",children:f.jsx($e,{icon:f.jsx(Uc,{role:"img",width:Nt,height:Nt})})})]})});return f.jsxs(f.Fragment,{children:[m?y():h?S():x(),t&&zi.createPortal(e,document.body)]})},W8=({label:e,htmlFor:t,disabled:s,selectedValue:o,radioButtons:i,customInputValue:n,valueClassName:r,inputClassName:a,emptyValueText:l,onClose:c,header:d,portalId:u,onApply:h,onCancel:p,cancelButtonTitle:m="Cancel",applyButtonTitle:C="Apply",isValid:v,selectedRadioValue:w,onChangeRadioField:b,id:S,size:x=Wt.Md})=>{const[y,F]=g.useState(!1),R=g.useCallback(()=>{s||F(!0)},[s]),E=g.useCallback(()=>{F(!1),c?.()},[c]),D=g.useCallback(()=>{p?.(),E()},[p,E]),P=g.useCallback(()=>{h(),E()},[h,E]);return f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(Bo,{label:e,htmlFor:t}),f.jsx(Hv,{disabled:s,open:y,selectedValue:n??i.find(T=>T.id===o)?.name,valueClassName:r,inputClassName:ue(a,"py-2","px-3"),emptyValueText:l,onOpen:R,children:f.jsx(Uo,{open:y,onClose:D,header:d,portalId:u,size:x,footer:f.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[f.jsx(ys,{label:m,onClick:D}),f.jsx(bs,{label:C,onClick:P,disabled:!v})]}),children:f.jsx("div",{className:"px-6 py-4",children:f.jsx(Fa,{radioButtons:i,labelClassName:"dial-small",activeRadioButton:w,onChange:b,elementId:S,orientation:To.Column})})})})]})},_8="Create",j8="Cancel",U8="flex items-center justify-end gap-2 px-6 py-3",$8=({header:e,open:t=!1,submitLabel:s=_8,cancelLabel:o=j8,isLoading:i=!1,disableSubmitButton:n=!1,className:r,submitClassName:a,onClose:l,onSubmit:c,onCancel:d,children:u,dividers:h=!0,size:p=Wt.Md,footer:m})=>{const C=i?null:f.jsxs("div",{className:U8,children:[f.jsx(ys,{label:o,onClick:()=>d?d():l?.()}),f.jsx(bs,{className:a,label:s,disabled:n,onClick:()=>c()})]}),v=g.useCallback(()=>i?f.jsx("div",{className:"px-6 py-4 h-[120px]",children:f.jsx(nr,{size:50})}):u??null,[u,i]);return f.jsx(Uo,{open:t,header:e,className:r,dividers:h,onClose:()=>l?.(),footer:m??C,size:p,children:v()})},q8=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],K8=(e,t,s,o)=>{if((t==="number"||s!==void 0||o!==void 0)&&!q8.includes(e.key)&&!(e.ctrlKey||e.metaKey)&&!(e.key==="-"&&(e.currentTarget.selectionStart??0)===0&&!e.currentTarget.value.includes("-"))&&!(e.key==="."&&t==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if(s!==void 0||o!==void 0){const n=e.currentTarget.value,r=e.currentTarget.selectionStart||0,a=n.slice(0,r)+e.key+n.slice(r),l=parseFloat(a);if(!isNaN(l)){if(s!==void 0&&l<+s){e.preventDefault();return}if(o!==void 0&&l>+o){e.preventDefault();return}}}}},Y8="bg-layer-4 flex items-center justify-center enabled:text-secondary enabled:hover:text-accent-primary enabled:active:bg-controls-accent-primary-alpha-active enabled:hover:bg-accent-primary-alpha enabled:active:text-accent-primary",Z8=({icon:e,onClick:t,disabled:s,size:o=bt.Standard})=>f.jsx("div",{className:ue("border-l border-tertiary",o===bt.Standard?"h-[40px] w-[44px]":"h-[24px] w-[32px]"),children:f.jsx(no,{className:ue(Y8,o===bt.Small&&"p-1"),icon:e,onClick:t,disabled:s,size:o})}),Zi=({labelProps:e,error:t,caption:s,id:o,containerClassName:i,...n})=>f.jsxs("div",{className:oe("flex flex-col gap-y-2",i),children:[e&&f.jsx(Bo,{...e,htmlFor:o}),f.jsx(Gv,{id:o,...n}),f.jsx(ns,{text:t}),!t&&f.jsx(ir,{text:s})]}),Gv=({invalid:e,disabled:t,prefix:s,className:o,postfix:i,iconBefore:n,iconAfter:r,wrapperClassName:a,type:l,inputRef:c,value:d,min:u,onChange:h,max:p,inputButtonProps:m,...C})=>{const v=g.useRef(null),w=Ie.useMergeRefs([c,v]);g.useEffect(()=>{const F=v.current;if(!F)return;const R=E=>{E.preventDefault()};return F.addEventListener("wheel",R,{passive:!1}),()=>{F.removeEventListener("wheel",R)}},[]);const b=l==="number"||u!==void 0||p!==void 0,S=F=>{K8(F,l,u,p)},x=F=>{const R=F.currentTarget.value;if(b&&R!==""){const E=parseFloat(R);if(isNaN(E)&&R!=="-"&&R!=="."||!isNaN(E)&&(u!==void 0&&E<+u||p!==void 0&&E>+p))return}h?.(R||void 0)},y=()=>f.jsxs("div",{className:oe("dial-input flex flex-row items-center gap-x-2 justify-between py-2",e&&"dial-input-error",t&&"dial-input-disable",!s&&"pl-3",!m&&"pr-3",a),"aria-label":"input-container",children:[s&&f.jsx("div",{className:"border-r border-tertiary",children:f.jsx(Gv,{wrapperClassName:"!rounded-r-none",className:"truncate",value:s,disabled:!0,id:`${s}_textBefore`})}),f.jsx($e,{icon:n}),f.jsx("input",{ref:w,type:l,autoComplete:l==="password"?"new-password":"off",value:d??"",className:oe("border-0 bg-transparent w-full truncate",o),onChange:x,onKeyDown:S,min:u,disabled:t,max:p,...C}),i&&f.jsxs("p",{className:"text-secondary dial-small-text",children:[" ",i]}),f.jsx($e,{icon:r}),m&&f.jsx(Z8,{...m,disabled:t})]});return t&&l!=="password"?f.jsx(yt,{tooltip:d,children:y()}):y()},X8=/^0+\.(\d+)?$/,Q8=/^0+/,J8=({onChange:e,...t})=>{const s=o=>!o||o==="-"?o:String(o)?.match(X8)?String(o)?.replace(Q8,"0"):Number(o);return f.jsx(Zi,{type:"number",onChange:o=>e?.(s(o)),...t})},eL=({onClick:e})=>f.jsx(G.IconEyeOff,{...Y,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),tL=({onClick:e})=>f.jsx(G.IconEye,{...Y,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),sL=({...e})=>{const[t,s]=g.useState(!1),o=g.useCallback(i=>{s(i)},[]);return f.jsx(Zi,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?f.jsx(eL,{onClick:()=>o(!1)}):f.jsx(tL,{onClick:()=>o(!0)})})},oL={[bt.Small]:{className:"dial-tiny-text",wrapperClassName:"pl-2 py-0",containerClassName:"h-[24px]",iconSize:16,iconStroke:1},[bt.Standard]:{className:"dial-small-text",wrapperClassName:"",containerClassName:"",iconSize:20,iconStroke:1.5}},ih=({size:e=bt.Standard,placeholder:t="Search...",value:s,onChange:o,...i})=>{const[n,r]=g.useState(s||"");g.useEffect(()=>{r(s||"")},[s]);const a=g.useCallback(u=>{r(u||""),o?.(u||"")},[o]),l=oL[e],c=g.useCallback(()=>{a("")},[a]),d=g.useMemo(()=>{if(n)return{icon:f.jsx(G.IconX,{size:l.iconSize,"aria-label":"Clear search",role:"button"}),onClick:c,size:e}},[c,n,e,l.iconSize]);return f.jsx(Zi,{placeholder:t,iconBefore:f.jsx(G.IconSearch,{size:l.iconSize,stroke:l.iconStroke}),value:n,onChange:a,inputButtonProps:d,containerClassName:l.containerClassName,className:l.className,wrapperClassName:l.wrapperClassName,...i})},$c=8,iL=24,nL=({initialTags:e=[],label:t,required:s,elementId:o,placeholder:i,captionDescription:n,errorText:r,invalid:a,disabled:l,collapseTagOverflow:c=!1,onChange:d})=>{const u=g.useRef(null),h=g.useRef([]),p=g.useRef(null),[m,C]=g.useState(e),[v,w]=g.useState(""),[b,S]=g.useState(!1),[x,y]=g.useState(e.length),F=g.useCallback(k=>N=>{h.current[k]=N},[]),R=g.useCallback(()=>{if(!c)return;const k=u.current;if(!k)return;const N=k.offsetWidth;if(N===0)return;const A=p.current?.offsetWidth??0,W=N-iL-$c;let U=0,L=0;for(let de=0;de<m.length;de++){const H=h.current[de];if(!H)continue;const te=H.offsetWidth+$c;if(U+te>W)break;U+=te,L++}if(L<m.length&&L>0)for(;U+A>W&&L>0;){L--;const de=h.current[L]?.offsetWidth??0;U-=de+$c}y(L)},[c,m]),E=k=>{const N=k.trim().replace(/,$/,"");if(N&&!m.includes(N)){const A=[N,...m];C(A),d?.(A)}},D=k=>{(k.key===","||k.key==="Enter")&&(k.preventDefault(),E(v),w(""))},P=()=>{v.trim()&&(E(v),w(""))},T=k=>{const N=m.filter((A,W)=>W!==k);C(N),d?.(N)},M=()=>r?f.jsx(ns,{text:r}):n?f.jsx(ir,{text:n}):null;return g.useEffect(()=>{if(c)return;const k=new ResizeObserver(()=>{if(u.current){const N=u.current.scrollHeight>u.current.clientHeight+10;S(N)}});return u.current&&k.observe(u.current),()=>k.disconnect()},[m,c]),g.useEffect(()=>{if(!c){y(m.length);return}y(m.length);const k=new ResizeObserver(()=>{R()}),N=u.current;return N&&k.observe(N),R(),()=>k.disconnect()},[c,R,m]),g.useEffect(()=>{C(e)},[JSON.stringify(e)]),f.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[f.jsx(Bo,{label:t,required:s,htmlFor:o}),f.jsx("div",{className:ue("dial-input min-h-[38px] p-[6px]",a&&"dial-input-error",l&&"dial-input-disable"),children:f.jsxs("div",{ref:u,className:ue("flex gap-2 items-center relative",c?"flex-nowrap overflow-hidden w-full min-w-0":ue("flex-wrap",b?"flex-col-reverse":"flex-row")),children:[(c?m.slice(0,x):m).map((k,N)=>f.jsx(vo,{tag:k,remove:l?void 0:()=>T(N)},k+N)),c&&x<m.length&&f.jsx(yt,{tooltip:m.slice(x).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:f.jsx(vo,{tag:`+${m.length-x}`})}),f.jsx("input",{type:"text",value:v,onChange:k=>w(k.target.value),onKeyDown:D,onBlur:P,className:ue("dial-input outline-none !border-none w-full flex-1 !p-1 !h-auto",c?"min-w-0":"min-w-[100px]"),placeholder:i??"",disabled:l}),c&&f.jsxs("div",{className:"absolute left-0 top-0 invisible pointer-events-none h-0 overflow-hidden whitespace-nowrap","aria-hidden":!0,children:[m.map((k,N)=>f.jsx("div",{ref:F(N),className:"inline-flex shrink-0",children:f.jsx(vo,{tag:k,remove:l?void 0:()=>T(N)})},`measure-${k}-${N}`)),f.jsx("div",{ref:p,className:"inline-flex shrink-0",children:f.jsx(vo,{tag:`+${m.length}`})})]})]})}),M()]})},rL="dial-input flex w-full items-center justify-between gap-2 dial-small cursor-pointer",aL="w-full rounded flex flex-col",qc="flex w-full items-center justify-between gap-2 px-3 h-[34px] dial-small text-primary truncate hover:bg-accent-primary-alpha focus:bg-accent-primary-alpha focus:outline-none",lL="bg-accent-primary-alpha",cL="bg-accent-primary-alpha border-l border-accent-primary border-1",vp="opacity-75",dL=352,uL=f.jsx(G.IconChevronDown,{size:pt.SM}),Bv=({options:e,selectedValues:t,handleRemoveTag:s})=>f.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(o=>{const i=e.find(r=>r.value===o)?.label??o,n=e.find(r=>r.value===o)?.icon;return f.jsx(vo,{tag:i,remove:r=>s?.(r,o),iconBefore:n?f.jsx($e,{icon:n}):null,className:"max-w-full"},o)})});var Ja=(e=>(e.Sm="sm",e.Md="md",e))(Ja||{}),el=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(el||{});const Vv=({options:e,multiple:t=!1,elementId:s,value:o,defaultValue:i,variant:n=el.Primary,size:r=Ja.Md,prefix:a,customSelectedValue:l,placeholder:c="Select...",searchable:d=!1,searchPlaceholder:u,selectAll:h=!1,invalid:p,selectAllLabel:m="Select all",emptyStateTitle:C="No options available",emptyStateDescription:v,emptyStateIcon:w,disabled:b=!1,className:S,listClassName:x,closable:y=!1,header:F,footer:R,onClose:E,onChange:D,inlineSearch:P=!1,dismissRef:T,onFooterClick:M,open:k,onOpenChange:N,onInlineQueryChange:A})=>{const W=g.useId(),[U,L]=g.useState(!1),de=k!==void 0,H=de?!!k:U,te=g.useCallback(V=>{de||L(V),N?.(V)},[de,N]),[Q,J]=g.useState(P&&l||""),me=g.useRef(null),Re=g.useCallback(V=>{V!==Q&&(J(V||""),A?.(V||""))},[A,Q]),ne=o!==void 0,[_,Fe]=g.useState(i),ie=ne?o:_,$=g.useMemo(()=>t?Array.isArray(ie)?ie:[]:typeof ie=="string"?[ie]:[],[ie,t]),q=g.useMemo(()=>{const V=Q.trim().toLowerCase();return V?e.filter(Ee=>Ee.label.toLowerCase().includes(V)):e},[e,Q]);g.useEffect(()=>{!H&&!P&&Re("")},[P,H,Re]),g.useEffect(()=>{P&&!H&&l&&Re(l||"")},[l,P,H,Re]);const se=g.useCallback(V=>{ne||Fe(V),D?.(V)},[ne,D]),B=g.useCallback(V=>{if(t){const Ee=new Set($);Ee.has(V)?Ee.delete(V):Ee.add(V),se(Array.from(Ee));return}if(se(V),P){const Ee=e.find(At=>At.value===V);Ee&&(Re(Ee.label),A?.(Ee.label))}te(!1)},[t,se,P,te,$,e,Re,A]),pe=g.useCallback((V,Ee)=>{if(V.stopPropagation(),!t){se("");return}const At=$.filter(Xi=>Xi!==Ee);se(At)},[t,$,se]),le=g.useMemo(()=>q.filter(V=>!V.disabled),[q]),re=g.useMemo(()=>le.filter(V=>$.includes(V.value)).length,[le,$]),Ce=V=>{P&&!t&&!V&&B(Q),te(V)},xe=le.length>0&&re===le.length,Le=re>0&&!xe,fe=()=>{if(!(!t||le.length===0))if(xe){const V=new Set(le.map(At=>At.value)),Ee=$.filter(At=>!V.has(At));se(Ee)}else{const V=new Set($);le.forEach(Ee=>V.add(Ee.value)),se(Array.from(V))}},De=$.length>0;g.useEffect(()=>{H&&P&&!t&&!b&&requestAnimationFrame(()=>{const V=me.current;if(!V)return;V.focus();const Ee=V.value?.length??0;V.setSelectionRange?.(Ee,Ee)})},[H,P,t,b]);const ze=!t&&De?$[0]:void 0,Ne=g.useMemo(()=>ze?e.find(V=>V.value===ze):void 0,[e,ze]),Ve=g.useCallback(()=>!t||$.length===0?null:f.jsx(Bv,{options:e,selectedValues:$,handleRemoveTag:pe}),[t,e,$,pe]),kt=g.useCallback(()=>t?De?Ve():f.jsx("span",{className:"text-secondary truncate",children:c}):Ne?f.jsxs(f.Fragment,{children:[Ne.icon&&f.jsx($e,{icon:Ne.icon}),f.jsx(ht,{text:a?`${a} ${Ne.label}`:Ne.label}),Ne?.description&&f.jsx("div",{className:"text-secondary dial-small",children:Ne.description})]}):l&&o?l:f.jsx("span",{className:"text-secondary truncate",children:c}),[De,t,l,a,o,c,Ve,Ne]);g.useImperativeHandle(T,()=>({dismiss:()=>{te(!1)}}));const Et=g.useCallback(()=>{Re($.length===1?Ne?.label??Q:"")},[Q,$.length,Re,Ne?.label]),Ut=g.useCallback(()=>{b||(te(!H),P&&!t&&(Et(),me.current?.focus()))},[b,P,H,t,Et,te]);return f.jsx(Ft,{open:H,onOpenChange:Ce,disabled:b,closable:y,onClose:E,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:d?null:dL,listClassName:x,renderOverlay:()=>f.jsxs("div",{id:`list-${s||W}`,role:"listbox","aria-multiselectable":t||void 0,className:aL,children:[F&&f.jsx(f.Fragment,{children:typeof F=="function"?F():F}),(d||y)&&e.length>8&&f.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[d&&f.jsx(ih,{placeholder:u,onChange:Re,value:Q,id:`search-${s||W}`,containerClassName:"w-full"}),y&&f.jsx(ss,{"aria-label":"Close select",className:"shrink-0",iconBefore:f.jsx(G.IconX,{size:pt.SM}),onClick:V=>{E?.(V),te(!1)}})]}),t&&h&&le.length>0&&f.jsx("div",{className:ue(qc,"mt-2"),children:f.jsx(id,{id:`${s||W}-selectAll`,label:m,checked:xe,indeterminate:Le,onChange:fe,ariaLabel:m})}),f.jsx("div",{className:ue("overflow-y-auto max-h-[352px]",P&&q.length===0?"":"py-1"),children:q.length===0?!P&&f.jsx("div",{className:"px-2 py-3",children:f.jsx(rr,{icon:w??f.jsx(G.IconClipboardX,{size:pt.LG,stroke:.5}),title:C,description:v})}):q.map(V=>{const Ee=$.includes(V.value);return t?f.jsxs("div",{role:"option","aria-selected":Ee,"aria-disabled":!!V.disabled,className:ue(qc,Ee&&lL,V.disabled&&vp,"w-full"),children:[f.jsx(id,{id:`${s||W}-${V.value}`,label:f.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[V.icon&&f.jsx($e,{icon:V.icon}),f.jsx("span",{className:"truncate",children:V.label})]}),checked:Ee,disabled:V.disabled,onChange:()=>!V.disabled&&B(V.value),ariaLabel:V.label}),V.description&&f.jsx("div",{className:"text-secondary dial-small",children:V.description})]},V.value):f.jsx("button",{role:"option",type:"button","aria-selected":Ee,"aria-disabled":!!V.disabled,disabled:V.disabled,className:ue(qc,Ee&&cL,V.disabled&&vp),onClick:()=>!V.disabled&&B(V.value),children:f.jsxs("div",{className:"flex items-center gap-2 w-full",children:[V.icon&&f.jsx($e,{icon:V.icon}),f.jsx(ht,{text:V.label}),V.description&&f.jsx("div",{className:"text-secondary dial-small",children:V.description})]})},V.value)})}),R&&f.jsx("div",{onClick:V=>{M?.(V),M&&te(!1)},children:typeof R=="function"?R():R})]}),children:f.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":H,"aria-controls":`list-${s||W}`,className:oe(rL,b&&"opacity-75 !cursor-not-allowed",r===Ja.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",p&&"dial-input-error",n===el.Secondary?"!bg-layer-4 !h-auto":"",S),onMouseDown:V=>{b||P&&!t&&(Et(),V.preventDefault())},onClick:()=>{Ut()},onKeyDown:V=>{(V.key===" "||V.code==="Space")&&(V.preventDefault(),Ut())},children:[P&&!t?f.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:f.jsx("input",{id:`inline-${s||W}`,type:"text",placeholder:u??c,value:Q||"",onChange:V=>Re(V.currentTarget.value.trimStart()),onFocus:()=>!b&&te(!0),onMouseDown:V=>{Et(),V.stopPropagation()},onClick:V=>{V.stopPropagation()},onKeyDown:V=>{V.stopPropagation()},className:"bg-transparent outline-none w-full dial-small",ref:me,disabled:b,"aria-disabled":b,autoComplete:"off"})}):f.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:kt()}),!P&&f.jsx($e,{icon:uL,className:ue("text-primary",H&&"rotate-180")})]})})},hL=({label:e,required:t,captionDescription:s,containerClassName:o,selectClassName:i,error:n,id:r,caption:a,readonly:l,value:c,defaultEmptyText:d,...u})=>{const h=g.useCallback(()=>{if(!c||Array.isArray(c)&&c.length===0)return d??"None";if(Array.isArray(c))return f.jsx(Bv,{options:u.options,selectedValues:c});{const p=u.options?.find(m=>m.value===c);return f.jsx("span",{"aria-readonly":!0,className:"text-primary",children:p?.label||c})}},[c,u.options,d]);return f.jsx(Xd,{id:r,label:e,required:t,description:a,error:n,captionDescription:s,className:o,readonly:l,value:h(),defaultEmptyText:d,children:f.jsx(Vv,{className:i,value:c,elementId:r,invalid:!!n,...u})})};function zv(e){let t=null;return()=>(t==null&&(t=e()),t)}function gL(e,t){return e.filter(s=>s!==t)}function pL(e,t){const s=new Set,o=n=>s.add(n);e.forEach(o),t.forEach(o);const i=[];return s.forEach(n=>i.push(n)),i}class fL{enter(t){const s=this.entered.length,o=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(t));return this.entered=pL(this.entered.filter(o),[t]),s===0&&this.entered.length>0}leave(t){const s=this.entered.length;return this.entered=gL(this.entered.filter(this.isNodeInDocument),t),s>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class mL{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const s={};Object.keys(this.config.exposeProperties).forEach(o=>{const i=this.config.exposeProperties[o];i!=null&&(s[o]={value:i(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,s)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,s){return s===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const nh="__NATIVE_FILE__",Wv="__NATIVE_URL__",_v="__NATIVE_TEXT__",jv="__NATIVE_HTML__",wp=Object.freeze(Object.defineProperty({__proto__:null,FILE:nh,HTML:jv,TEXT:_v,URL:Wv},Symbol.toStringTag,{value:"Module"}));function Kc(e,t,s){const o=t.reduce((i,n)=>i||e.getData(n),"");return o??s}const jd={[nh]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[jv]:{exposeProperties:{html:(e,t)=>Kc(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Wv]:{exposeProperties:{urls:(e,t)=>Kc(e,t,"").split(`
62
- `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[_v]:{exposeProperties:{text:(e,t)=>Kc(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function CL(e,t){const s=jd[e];if(!s)throw new Error(`native type ${e} has no configuration`);const o=new mL(s);return o.loadDataTransfer(t),o}function Yc(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(jd).filter(s=>{const o=jd[s];return o?.matchesTypes?o.matchesTypes.some(i=>t.indexOf(i)>-1):!1})[0]||null}const vL=zv(()=>/firefox/i.test(navigator.userAgent)),Uv=zv(()=>!!window.safari);class bp{interpolate(t){const{xs:s,ys:o,c1s:i,c2s:n,c3s:r}=this;let a=s.length-1;if(t===s[a])return o[a];let l=0,c=r.length-1,d;for(;l<=c;){d=Math.floor(.5*(l+c));const p=s[d];if(p<t)l=d+1;else if(p>t)c=d-1;else return o[d]}a=Math.max(0,c);const u=t-s[a],h=u*u;return o[a]+i[a]*u+n[a]*h+r[a]*u*h}constructor(t,s){const{length:o}=t,i=[];for(let p=0;p<o;p++)i.push(p);i.sort((p,m)=>t[p]<t[m]?-1:1);const n=[],r=[];let a,l;for(let p=0;p<o-1;p++)a=t[p+1]-t[p],l=s[p+1]-s[p],n.push(a),r.push(l/a);const c=[r[0]];for(let p=0;p<n.length-1;p++){const m=r[p],C=r[p+1];if(m*C<=0)c.push(0);else{a=n[p];const v=n[p+1],w=a+v;c.push(3*w/((w+v)/m+(w+a)/C))}}c.push(r[r.length-1]);const d=[],u=[];let h;for(let p=0;p<c.length-1;p++){h=r[p];const m=c[p],C=1/n[p],v=m+c[p+1]-h-h;d.push((h-m-v)*C),u.push(v*C*C)}this.xs=t,this.ys=s,this.c1s=c,this.c2s=d,this.c3s=u}}const wL=1;function $v(e){const t=e.nodeType===wL?e:e.parentElement;if(!t)return null;const{top:s,left:o}=t.getBoundingClientRect();return{x:o,y:s}}function ra(e){return{x:e.clientX,y:e.clientY}}function bL(e){var t;return e.nodeName==="IMG"&&(vL()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function SL(e,t,s,o){let i=e?t.width:s,n=e?t.height:o;return Uv()&&e&&(n/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:n}}function yL(e,t,s,o,i){const n=bL(t),a=$v(n?e:t),l={x:s.x-a.x,y:s.y-a.y},{offsetWidth:c,offsetHeight:d}=e,{anchorX:u,anchorY:h}=o,{dragPreviewWidth:p,dragPreviewHeight:m}=SL(n,t,c,d),C=()=>{let F=new bp([0,.5,1],[l.y,l.y/d*m,l.y+m-d]).interpolate(h);return Uv()&&n&&(F+=(window.devicePixelRatio-1)*m),F},v=()=>new bp([0,.5,1],[l.x,l.x/c*p,l.x+p-c]).interpolate(u),{offsetX:w,offsetY:b}=i,S=w===0||w,x=b===0||b;return{x:S?w:v(),y:x?b:C()}}class xL{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,s){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=s}}function RL(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function Sp(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{},o=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(s).filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable}))),o.forEach(function(i){RL(e,i,s[i])})}return e}class FL{profile(){var t,s;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((s=this.dragOverTargetIds)===null||s===void 0?void 0:s.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var s;(s=this.window)===null||s===void 0||s.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,s,o){return this.sourcePreviewNodeOptions.set(t,o),this.sourcePreviewNodes.set(t,s),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,s,o){this.sourceNodes.set(t,s),this.sourceNodeOptions.set(t,o);const i=r=>this.handleDragStart(r,t),n=r=>this.handleSelectStart(r);return s.setAttribute("draggable","true"),s.addEventListener("dragstart",i),s.addEventListener("selectstart",n),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),s.removeEventListener("dragstart",i),s.removeEventListener("selectstart",n),s.setAttribute("draggable","false")}}connectDropTarget(t,s){const o=r=>this.handleDragEnter(r,t),i=r=>this.handleDragOver(r,t),n=r=>this.handleDrop(r,t);return s.addEventListener("dragenter",o),s.addEventListener("dragover",i),s.addEventListener("drop",n),()=>{s.removeEventListener("dragenter",o),s.removeEventListener("dragover",i),s.removeEventListener("drop",n)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),s=this.sourceNodeOptions.get(t);return Sp({dropEffect:this.altKeyPressed?"copy":"move"},s||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),s=this.sourcePreviewNodeOptions.get(t);return Sp({anchorX:.5,anchorY:.5,captureDraggingState:!1},s||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(wp).some(s=>wp[s]===t)}beginDragNativeItem(t,s){this.clearCurrentDragSourceNode(),this.currentNativeSource=CL(t,s),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const s=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var o;return(o=this.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},s)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,s){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(s))}handleDragEnter(t,s){this.dragEnterTargetIds.unshift(s)}handleDragOver(t,s){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(s)}handleDrop(t,s){this.dropTargetIds.unshift(s)}constructor(t,s,o){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const n=this.sourceNodes.get(i);return n&&$v(n)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:n}=this;this.dragStartSourceIds=null;const r=ra(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(n||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});const{dataTransfer:a}=i,l=Yc(a);if(this.monitor.isDragging()){if(a&&typeof a.setDragImage=="function"){const d=this.monitor.getSourceId(),u=this.sourceNodes.get(d),h=this.sourcePreviewNodes.get(d)||u;if(h){const{anchorX:p,anchorY:m,offsetX:C,offsetY:v}=this.getCurrentSourcePreviewNodeOptions(),S=yL(u,h,r,{anchorX:p,anchorY:m},{offsetX:C,offsetY:v});a.setDragImage(h,S.x,S.y)}}try{a?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:c}=this.getCurrentSourcePreviewNodeOptions();c?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(l)this.beginDragNativeItem(l);else{if(a&&!a.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var n;(n=this.currentNativeSource)===null||n===void 0||n.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:a}=i,l=Yc(a);l&&this.beginDragNativeItem(l,a)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:n}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,n.length>0&&this.actions.hover(n,{clientOffset:ra(i)}),n.some(a=>this.monitor.canDropOnTarget(a))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var n;(n=this.currentNativeSource)===null||n===void 0||n.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:n}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=ra(i),this.scheduleHover(n),(n||[]).some(a=>this.monitor.canDropOnTarget(a))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var n;i.preventDefault(),(n=this.currentNativeSource)===null||n===void 0||n.loadDataTransfer(i.dataTransfer)}else Yc(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:n}=this;this.dropTargetIds=[],this.actions.hover(n,{clientOffset:ra(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const n=i.target;typeof n.dragDrop=="function"&&(n.tagName==="INPUT"||n.tagName==="SELECT"||n.tagName==="TEXTAREA"||n.isContentEditable||(i.preventDefault(),n.dragDrop()))},this.options=new xL(s,o),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new fL(this.isNodeInDocument)}}const EL=function(t,s,o){return new FL(t,s,o)},DL=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:s,emptyButtonLabel:o,acceptTypes:i,maxFilesCount:n,multiple:r,fileFormatError:a,fileCountError:l,fileSizeError:c,getIsFileFormatError:d,getIsFileSizeError:u})=>{const h=g.useRef(null),p=g.useRef(null),[m,C]=g.useState([]),[v,w]=g.useState(!1),[b,S]=g.useState(!1),x=g.useCallback(W=>{const U=W.target.files;if(U&&U.length>0){const L=Array.from(U),de=d?.(L),H=u?.(L);de?w(!0):H?S(!0):e(L)}},[d,u,e]),y=g.useCallback(W=>n&&W?.length>n,[n]),F=g.useMemo(()=>v||b||y(m),[v,b,y,m]),R=()=>{C([]),w(!1),S(!1)},E=g.useMemo(()=>v?f.jsx(ns,{text:a}):b?f.jsx(ns,{text:c}):y(m)?f.jsx(ns,{text:l}):null,[l,a,c,m,y,v,b]);g.useEffect(()=>{R()},[i]);const[{isOver:D,canDrop:P},T]=tf(()=>({accept:[nh],drop(W){const U=W.files;!d?.(U)&&!u?.(U)&&!y(U)&&e(U),R()},collect:W=>({isOver:W.isOver(),canDrop:W.canDrop()})}),[x]),M=W=>{(W.key==="Enter"||W.key==="Space")&&(W.preventDefault(),p.current?.click())},k=W=>{W?.preventDefault();const U=Array.from(W.dataTransfer?.items??[]);w(!!d?.(U)),S(!!u?.(U)),C(U)},N=W=>{W.target===W.currentTarget&&R()},A=ue("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!P&&!F&&"border-primary",P&&(D?"border-accent-primary":"border-hover"),F&&"border-error");return T(h),f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:A,ref:h,onDragOver:k,onDragLeave:N,children:[f.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:M,className:"flex flex-col items-center cursor-pointer h-full w-full text-secondary dial-tiny justify-center",children:[t&&f.jsx("p",{className:"mb-1",children:t}),s&&f.jsx("p",{className:"mb-0.5",children:s}),o&&f.jsx(bs,{appearance:Me.Ghost,label:o,onClick:()=>p.current?.click()})]}),f.jsx("input",{multiple:r,id:"file",type:"file",ref:p,hidden:!0,accept:i,onChange:x})]}),f.jsx(f.Fragment,{children:E})]})},PL=({iconBefore:e,className:t,error:s,...o})=>{const i=o.invalid,n=()=>f.jsx("div",{className:"mr-2",children:i?f.jsx(G.IconExclamationCircle,{...Y,className:"text-error"}):e});return f.jsx(Zi,{...o,iconBefore:n(),containerClassName:"h-[40px] p-0",className:ue("rounded-r-none border-r-0",i&&"text-error",t)})},qv=e=>{const{files:t,iconBeforeInput:s,dynamicIcon:o,onChange:i,isInvalid:n,errorText:r,removeButtonAriaLabel:a,getIsMultiFilesSizeError:l,multiFilesSizeError:c}=e,d=(p,m)=>{p.stopPropagation(),i(t?.filter(C=>C.name!==m)||[])},u=p=>f.jsx(Lv,{"aria-label":a,onClick:m=>d(m,p)}),h=p=>{i(p)};return!t||t.length===0?f.jsx(e0,{backend:EL,children:f.jsx(DL,{...e,onChange:h})}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"flex-1 min-h-0 border border-solid border-primary rounded p-2 overflow-y-auto",children:t&&t.length>0&&f.jsx("div",{className:"flex flex-col gap-y-1",children:t.map((p,m)=>f.jsx(PL,{id:p.name,value:p.name,iconAfter:u(p.name),iconBefore:s||o?.(p.name),invalid:n?.(p),error:r},p.name+m))})}),l?.(t)&&f.jsx(ns,{text:c})]})},TL=({onChange:e,fieldTitle:t,elementId:s,files:o,maxFilesCount:i,maxFileSize:n,maxMultiFilesSize:r,fileFormatError:a,fileCountError:l,fileSizeError:c,multiFilesSizeError:d,multiple:u=!0,acceptTypes:h,deleteAllButtonLabel:p,addButtonLabel:m,additionalActionButtons:C,...v})=>{const w=g.useRef(null),b=()=>w.current?.click(),S=()=>{e([])},x=g.useCallback(E=>E?.some(D=>!(h==="/"||h?.toLowerCase()?.includes(D?.type?.toLowerCase()))),[h]),y=g.useCallback(E=>{if(!n)return!1;const D=n*(1024*1024);return E?.some(P=>{const T=P.size;return!!T&&T>D})},[n]),F=g.useCallback(E=>{if(!r||!u)return!1;const D=r*1024*1024;return E.reduce((T,M)=>T+M.size,0)>D},[r,u]),R=g.useCallback(E=>{const D=E.target.files;if(D&&D.length>0){const P=Array.from(D),T=x(P),M=y(P);!T&&!M&&e([...o||[],...P])}},[x,y,e,o]);return f.jsxs("div",{className:"h-full flex flex-col",children:[f.jsxs("div",{className:"flex justify-between items-center pb-1 min-h-[42px]",children:[f.jsx(Bo,{label:`${t}: ${u?o?.length||0:""}`,htmlFor:s}),u&&!!o?.length&&f.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[f.jsx(ys,{label:p,iconBefore:f.jsx(G.IconTrashX,{...Y}),onClick:S}),(i?i>o?.length:!0)&&f.jsx(bs,{appearance:Me.Ghost,iconBefore:f.jsx(G.IconPlus,{...Y}),label:m,onClick:b}),C]})]}),o&&o.length>0&&f.jsx("input",{id:"file",type:"file",multiple:u,ref:w,hidden:!0,accept:h,onChange:R}),f.jsx(qv,{files:o,onChange:e,acceptTypes:h,maxFilesCount:i,multiple:u,fileFormatError:a,fileCountError:l,fileSizeError:c,multiFilesSizeError:d,getIsFileFormatError:x,getIsFileSizeError:y,getIsMultiFilesSizeError:F,...v})]})},ML=f.jsx(G.IconChevronDown,{size:pt.SM}),IL=f.jsx(G.IconChevronUp,{size:pt.SM}),Ud=({variant:e,appearance:t,items:s,...o})=>{const[i,n]=g.useState(!1),r=g.useMemo(()=>i?IL:ML,[i]);return f.jsx("div",{children:f.jsx(Ft,{menu:{items:s},onOpenChange:a=>n(a),children:f.jsx(ss,{...o,iconAfter:r,variant:e||Ge.Primary,appearance:t||Me.Solid})})})},Kv=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.1812 1.2002H2.80615C2.43319 1.2002 2.07551 1.34835 1.81178 1.61208C1.54806 1.8758 1.3999 2.23348 1.3999 2.60645V5.48145C1.3999 5.85441 1.54806 6.21209 1.81178 6.47581C2.07551 6.73954 2.43319 6.8877 2.80615 6.8877H15.1812C15.5541 6.8877 15.9118 6.73954 16.1755 6.47581C16.4392 6.21209 16.5874 5.85441 16.5874 5.48145V2.60645C16.5874 2.23348 16.4392 1.8758 16.1755 1.61208C15.9118 1.34835 15.5541 1.2002 15.1812 1.2002ZM14.8999 5.2002H3.0874V2.8877H14.8999V5.2002ZM12 7.80017C12.3107 7.80017 12.5625 8.05201 12.5625 8.36267V11.7377H15.9375C16.2482 11.7377 16.5 11.9895 16.5 12.3002C16.5 12.6108 16.2482 12.8627 15.9375 12.8627H12.5625V16.2377C12.5625 16.5483 12.3107 16.8002 12 16.8002C11.6893 16.8002 11.4375 16.5483 11.4375 16.2377V12.8627H8.0625C7.75184 12.8627 7.5 12.6108 7.5 12.3002C7.5 11.9895 7.75184 11.7377 8.0625 11.7377H11.4375V8.36267C11.4375 8.05201 11.6893 7.80017 12 7.80017ZM2.41188 12.5883C2.14816 12.3246 2 11.9669 2 11.5939V9.00018H3.6875V11.3127H6.1001V13.0002H3.40625C3.03329 13.0002 2.6756 12.852 2.41188 12.5883Z",fill:"currentColor"})),Yv=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M9.00049 7.7998C9.3108 7.80007 9.56279 8.05198 9.56299 8.3623V11.7373H12.938C13.2483 11.7376 13.5003 11.9895 13.5005 12.2998C13.5005 12.6103 13.2484 12.862 12.938 12.8623H9.56299V16.2373C9.56299 16.5478 9.31092 16.7995 9.00049 16.7998C8.68983 16.7998 8.43799 16.548 8.43799 16.2373V12.8623H5.06299C4.75233 12.8623 4.50049 12.6105 4.50049 12.2998C4.50069 11.9893 4.75245 11.7373 5.06299 11.7373H8.43799V8.3623C8.43819 8.05181 8.68995 7.7998 9.00049 7.7998ZM15.1812 1.2002C15.5541 1.2002 15.9116 1.34858 16.1753 1.6123C16.439 1.87603 16.5874 2.23348 16.5874 2.60645V5.48145C16.5874 5.85441 16.439 6.21186 16.1753 6.47559C15.9116 6.73931 15.5541 6.8877 15.1812 6.8877H2.80615C2.43319 6.8877 2.07573 6.73931 1.81201 6.47559C1.54829 6.21186 1.3999 5.85441 1.3999 5.48145V2.60645C1.3999 2.23348 1.54829 1.87603 1.81201 1.6123C2.07573 1.34858 2.43319 1.2002 2.80615 1.2002H15.1812ZM3.0874 2.8877V5.2002H14.8999V2.8877H3.0874Z",fill:"currentColor"})),rh=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M3.009 12.5527C2.77901 12.4216 2.5877 12.2321 2.45443 12.0034C2.32116 11.7746 2.25064 11.5147 2.25 11.25V3.75C2.25 2.925 2.925 2.25 3.75 2.25H11.25C11.8125 2.25 12.1185 2.53875 12.375 3M10.5 15.75H7.25025C6.98757 15.75 6.72747 15.6983 6.48479 15.5977C6.24211 15.4972 6.0216 15.3499 5.83586 15.1641C5.65012 14.9784 5.50278 14.7579 5.40226 14.5152C5.30174 14.2725 5.25 14.0124 5.25 13.7498V7.25025C5.25 6.71975 5.46074 6.21098 5.83586 5.83586C6.21098 5.46074 6.71975 5.25 7.25025 5.25H13.7498C14.0124 5.25 14.2725 5.30174 14.5152 5.40226C14.7579 5.50278 14.9784 5.65012 15.1641 5.83586C15.3499 6.0216 15.4972 6.24211 15.5977 6.48479C15.6983 6.72747 15.75 6.98757 15.75 7.25025V10.5M12.75 16.5L16.5 12.75M16.5 12.75V16.125M16.5 12.75H13.125",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),ah=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M9.75 14.25H3.75C3.35218 14.25 2.97064 14.092 2.68934 13.8107C2.40804 13.5294 2.25 13.1478 2.25 12.75V4.5C2.25 4.10218 2.40804 3.72064 2.68934 3.43934C2.97064 3.15804 3.35218 3 3.75 3H6.75L9 5.25H14.25C14.6478 5.25 15.0294 5.40804 15.3107 5.68934C15.592 5.97064 15.75 6.35218 15.75 6.75V9.75M12 16.5L15.75 12.75M15.75 12.75V16.125M15.75 12.75H12.375",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),lh=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M4.5 15.75V14.25C4.5 13.4544 4.81607 12.6913 5.37868 12.1287C5.94129 11.5661 6.70435 11.25 7.5 11.25H9.75M15.75 12.75L12 16.5M12 16.5V13.125M12 16.5H15.375M6 5.25C6 6.04565 6.31607 6.80871 6.87868 7.37132C7.44129 7.93393 8.20435 8.25 9 8.25C9.79565 8.25 10.5587 7.93393 11.1213 7.37132C11.6839 6.80871 12 6.04565 12 5.25C12 4.45435 11.6839 3.69129 11.1213 3.12868C10.5587 2.56607 9.79565 2.25 9 2.25C8.20435 2.25 7.44129 2.56607 6.87868 3.12868C6.31607 3.69129 6 4.45435 6 5.25Z",stroke:"#7F8792",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}));var wi=(e=>(e.MyFiles="my_files",e.Shared="shared",e.Organization="organization",e.Review="review",e))(wi||{}),K=(e=>(e.AddSibling="addSibling",e.AddChild="addChild",e.Duplicate="duplicate",e.Copy="copy",e.Move="move",e.Download="download",e.Delete="delete",e.Rename="rename",e.Info="info",e.Unshare="unshare",e.RemoveAccess="removeAccess",e.ManagePermissions="managePermissions",e.Preview="preview",e.OpenInNewTab="openInNewTab",e))(K||{}),nt=(e=>(e.Replace="replace",e.Duplicate="duplicate",e.Cancel="cancel",e))(nt||{}),Ot=(e=>(e.ReplaceAll="replaceAll",e.DuplicateAll="duplicateAll",e.DecideForEach="decideForEach",e))(Ot||{}),rt=(e=>(e.Copy="copy",e.Move="move",e))(rt||{}),Ii=(e=>(e.Tree="tree",e.Grid="grid",e))(Ii||{}),at=(e=>(e.Name="name",e.UpdatedAt="updatedAt",e.Size="size",e.Author="author",e.Owner="owner",e.Path="path",e.Actions="__actions",e.Version="version",e))(at||{});const kL="w-full h-full grid grid-rows-[auto_1fr] gap-5 p-6 overflow-hidden min-w-0 bg-layer-1",yp="w-full text-secondary flex items-center gap-2",AL="flex min-h-0 min-w-0 h-full gap-4 overflow-hidden",LL="flex flex-col flex-1 min-h-0 min-w-0 h-full gap-4",OL="h-full rounded bg-layer-3 text-secondary min-w-0",NL="flex-1 w-full rounded text-secondary overflow-auto min-h-0 min-w-0",HL="opacity-0 pointer-events-none group-hover/grid-row:opacity-100 group-hover/grid-row:pointer-events-auto",GL=280,BL="Files",Js=20,VL="Files",Zc=".dial_folder",zL=280,WL=460,Xc=44,_L=56,jL=800,UL=[at.Name,at.UpdatedAt,at.Size,at.Author,at.Actions];var be=(e=>(e.ITEM="item",e.FOLDER="folder",e))(be||{}),ch=(e=>(e.FILE="FILE",e.PROMPT="PROMPT",e.CONVERSATION="CONVERSATION",e.APPLICATION="APPLICATION",e.TOOLSET="TOOL_SET",e))(ch||{}),$o=(e=>(e.READ="READ",e.WRITE="WRITE",e.SHARE="SHARE",e))($o||{});const xp=({open:e,onClose:t,onReplace:s,onDuplicate:o,onDecideForEach:i,conflictingFiles:n,singleFileTitle:r="Replace Or Duplicate Item",multipleFilesTitle:a="Replace Or Duplicate Items",message:l,actionLabels:c,strategyLabels:d,confirmLabel:u="Confirm",cancelLabel:h="Cancel",nameColumnLabel:p="Name",actionColumnLabel:m="Action"})=>{const C=n.length===1,v=C?n[0]?.name:"",w=c?.[nt.Replace]??"Replace",b=c?.[nt.Duplicate]??"Duplicate",S=c?.[nt.Cancel]??"Cancel",x=d?.[Ot.ReplaceAll]??"Replace all",y=d?.[Ot.DuplicateAll]??"Duplicate all",F=d?.[Ot.DecideForEach]??"Decide for each",[R,E]=g.useState(nt.Replace),[D,P]=g.useState(Ot.ReplaceAll),[T,M]=g.useState(new Map(n.map(ne=>[ne.path,nt.Replace]))),[k,N]=g.useState(void 0),A=C?r:a,W=f.jsxs(f.Fragment,{children:["Item with the name ",f.jsxs("span",{className:"text-primary",children:['"',v,'"']})," ","already exists in this destination."]}),U=`${n.length} items with the same names already exist in this destination.`,L=l??(C?W:U),de=g.useMemo(()=>[{id:nt.Replace,name:w},{id:nt.Duplicate,name:b}],[w,b]),H=g.useMemo(()=>n.map(ne=>({id:ne.path,name:ne.name,path:ne.path,nodeType:ne.nodeType??be.ITEM,action:T.get(ne.path)||nt.Replace})),[n,T]),te=g.useMemo(()=>[{field:"name",headerName:p,flex:1,minWidth:200,floatingFilter:!1,filter:!1,resizable:!1,cellRenderer:ne=>ne.data?.nodeType===be.FOLDER?f.jsx(cl,{name:ne.data.name,iconSize:Js}):f.jsx(ll,{name:ne.data.name,iconSize:Js})},{field:"action",headerName:m,width:140,suppressSizeToFit:!0,sortable:!1,filter:!1,floatingFilter:!1,resizable:!1,cellRenderer:ne=>{if(!ne.data)return null;const _=[{key:nt.Replace,label:w,icon:f.jsx(G.IconCircleFilled,{size:10,className:"text-accent-tertiary"})},{key:nt.Duplicate,label:b,icon:f.jsx(G.IconCircleFilled,{size:10,className:"text-accent-secondary"})},{key:nt.Cancel,label:S,icon:f.jsx(G.IconCircleFilled,{size:10,className:"text-error"})}],Fe=_.find($=>$.key===ne.data.action),ie=k===ne.data.path;return f.jsx("div",{className:"flex items-center h-full",children:f.jsx(Ft,{trigger:[Ht.Click],open:ie,menu:{items:_,onClick:({key:$})=>{M(q=>{const se=new Map(q);return se.set(ne.data.path,$),se}),N(void 0)}},placement:"bottom-start",matchReferenceWidth:!1,allowedPlacements:["bottom-start","top-start"],onOpenChange:$=>{N($?ne.data.path:void 0)},children:f.jsxs("button",{type:"button",className:"flex items-center gap-2",children:[f.jsxs("span",{className:"flex items-center gap-2",children:[Fe?.icon,Fe?.label??w]}),f.jsx(G.IconChevronDown,{size:pt.SM,className:ue("text-secondary transition-transform",ie&&"rotate-180")})]})})})}}],[p,m,w,b,S,k]),Q=g.useMemo(()=>[{id:Ot.ReplaceAll,name:x},{id:Ot.DuplicateAll,name:y},{id:Ot.DecideForEach,name:F,content:D===Ot.DecideForEach?f.jsx("div",{className:"mt-4",children:f.jsx(th,{columnDefs:te,rowData:H,getRowId:ne=>ne.id,wrapCustomCellRenderers:!1,alternateOddRowColors:!1,additionalGridOptions:{domLayout:"autoHeight"}})}):void 0}],[x,y,F,D,te,H]),J=g.useCallback(()=>{E(nt.Replace),P(Ot.ReplaceAll),M(new Map(n.map(ne=>[ne.path,nt.Replace])))},[n]),me=g.useCallback(()=>{J(),t()},[J,t]),Re=g.useCallback(()=>{if(J(),C)R===nt.Replace?s():o();else if(D===Ot.ReplaceAll)s();else if(D===Ot.DuplicateAll)o();else if(D===Ot.DecideForEach&&i){const ne=n.map(_=>({file:_,action:T.get(_.path)||nt.Replace}));i(ne)}},[J,C,R,s,o,D,i,n,T]);return f.jsx(Uo,{open:e,onClose:me,size:C?Wt.Sm:Wt.Md,className:ue([!C&&"w-[600px]"]),header:A,dividers:!1,preventKeyboardOnOpen:!0,footer:f.jsxs("div",{className:"flex justify-end gap-3 py-4 px-6 border-t border-tertiary",children:[f.jsx(ys,{onClick:me,label:h}),f.jsx(bs,{onClick:Re,label:u})]}),children:f.jsxs("div",{className:"px-6 py-4",children:[f.jsx("p",{className:"text-secondary mb-4 break-words",children:L}),C?f.jsx(Fa,{elementId:"single-file-conflict",radioButtons:de,activeRadioButton:R,orientation:To.Column,onChange:ne=>E(ne)}):f.jsx(Fa,{elementId:"multiple-files-conflict",radioButtons:Q,activeRadioButton:D,orientation:To.Column,onChange:ne=>P(ne),formItemChildrenClassName:"gap-3"})]})})},$L=({getContextMenuItems:e,isRowDisabled:t,allowedFileTypes:s,maxSelectableFileSize:o,buttonClassName:i})=>{const n=g.useRef(e);g.useEffect(()=>{n.current=e},[e]);const r=g.useCallback(l=>{if(!l.data||t(l.data,s,o))return null;const d=l.data?n.current?.(l.data)??[]:[];return d.length?f.jsx(Ft,{placement:"bottom-start",allowedPlacements:["top-start","top-end","bottom-start"],menu:{items:d},className:oe("sticky right-0",i),children:f.jsx($e,{className:"text-secondary mx-2 flex flex-row gap-2 hover:text-accent-primary cursor-default",icon:f.jsx(G.IconDotsVertical,{...Y})})}):null},[s,o,i,t]);return{actionsColumnDef:g.useMemo(()=>({colId:"__actions",headerName:"",width:44,minWidth:44,maxWidth:44,suppressSizeToFit:!0,sortable:!1,resizable:!1,filter:!1,floatingFilter:!1,cellRenderer:r}),[r])}},qL=({onRename:e})=>{const[t,s]=g.useState(Ii.Grid),o=g.useCallback(n=>{e(n),s(Ii.Grid)},[e]),i=g.useCallback(n=>{e(n),s(Ii.Tree)},[e]);return{renameTriggerView:t,onGridRename:o,onTreeRename:i}};function KL(e,t){const s=g.useRef(null),[o,i]=g.useState(!1);return g.useEffect(()=>{if(!s.current)return;const n=new ResizeObserver(([r])=>{const a=r.contentRect.width;i(a<e)});return n.observe(t?.current||s?.current),()=>n.disconnect()},[e,t]),{containerRef:s,isBelowBreakpoint:o}}const Go=(e,t)=>{if(!(!e||!e.length||!t))for(const s of e){if(s.path===t)return s;const o=Go(s.items,t);if(o)return o}},Rp=(e,t)=>{if(!e?.length)return;if(!t)return e[0];const s=Go(e,t);if(s&&s.nodeType===be.FOLDER)return s;const o=t.split("/").filter(Boolean);if(o.length<=1)return e[0];const i="/"+o.slice(0,o.length-1).join("/");return Go(e,i)??e[0]},ki=e=>(e??"").toLowerCase(),YL=e=>ki(e).replace(/^\./,""),ZL=e=>{if(!e)return[];const t=[],s=o=>{const i=o.items??[];for(const n of i)t.push(n),n.nodeType===be.FOLDER&&s(n)};return s(e),t},Zv=e=>(e.name??e.path.split("/").pop()??"").startsWith("."),or=e=>{if(!e)return"0 bytes";const t=1024,s=t*1024;return e>=s?`${(e/s).toFixed(1)} MB`:e>=t?`${(e/t).toFixed(0)} KB`:`${e} bytes`},XL=(e,t="en-US",s={year:"numeric",month:"short",day:"2-digit"})=>{if(!e)return"";try{return new Intl.DateTimeFormat(t,s).format(new Date(e))}catch{return e}};function Xv(e,t,s){if(!e||e.includes("*/*"))return!0;const o=t.toLowerCase(),i=s&&s.includes(".")?`.${s.split(".").at(-1).toLowerCase()}`:void 0;return e.some(n=>{const r=n.toLowerCase();if(r.startsWith("."))return i===r;if(r.endsWith("/*")){const a=r.slice(0,-1);return o.startsWith(a)}return o===r})}const QL=e=>e?.join(", ")??"",Sl=e=>{if(!e)return;const t=e.flags.replace(/[gy]/g,"");return new RegExp(e.source,t)};function dh(e,t,s){if(t&&Sl(t)?.test(e.name))return s??`This ${e.isFolder?"folder":"file"} contains forbidden characters in its name. Please rename it.`}const JL=(e,t,s,o,i)=>{if(e.nodeType===be.FOLDER)return;const n=!e.contentLength||s==null||e.contentLength<=s;if(!(!e.contentType||Xv(t,e.contentType,e.name)))return o??(t?.length?`Unsupported file type. Supported types: ${QL(t)}.`:"Unsupported file type.");if(!n)return i??`File is too large. Maximum size: ${or(s)}.`},e7=e=>{const[t,s]=g.useState(e?.showHiddenFiles??!1),o=!!e?.onShowHiddenFilesChange,i=o?e.showHiddenFiles??!1:t,n=g.useCallback(a=>{o?e?.onShowHiddenFilesChange?.(a):s(a)},[o,e]),r=g.useCallback(()=>{const a=!i;o?e?.onShowHiddenFilesChange?.(a):s(a)},[i,o,e]);return{areHiddenFilesVisible:i,toggleHiddenFilesVisibility:r,setAreHiddenFilesVisible:n}},t7=e=>{const[t,s]=g.useState(e?.collapsed??!1),o=!!e?.onCollapseChange,i=o?e.collapsed??!1:t,n=g.useCallback(a=>{o?e?.onCollapseChange?.(a):s(a)},[o,e]),r=g.useCallback(()=>{const a=!i;o?e?.onCollapseChange?.(a):s(a)},[i,o,e]);return{isTreeCollapsed:i,toggleTreeCollapse:r,setIsTreeCollapsed:n}},Fp=(e,t,s)=>{if(!t.has(e))return e;const o=s===be.FOLDER?(i,n)=>`${i} (${n})`:(i,n)=>{const r=i.lastIndexOf("."),a=r>0,l=a?i.slice(0,r):i,c=a?i.slice(r):"";return`${l} (${n})${c}`};for(let i=1;;i++){const n=o(e,i);if(!t.has(n))return n}},Qc=e=>e.name,Qv=({getDestinationFiles:e,onResolve:t})=>{const[s,o]=g.useState([]),[i,n]=g.useState(!1),[r,a]=g.useState(null),l=g.useRef(!1),c=g.useCallback(S=>{l.current=!0,o(S),n(!0)},[]),d=g.useCallback(()=>{l.current=!1,n(!1),o([]),a(null)},[]),u=g.useCallback((S,x)=>{const y=e(S),F=new Set(y.map(Qc)),R=x.filter(E=>F.has(E.name));return{hasConflicts:R.length>0,conflicts:R}},[e]),h=g.useCallback((S,x,y,F)=>{const R=e(S),E=new Set(R.map(Qc));return x.map(D=>{const P=D.name,T=E.has(P),M=y&&T?P:Fp(P,E,D.nodeType);return(!y||!T)&&E.add(M),{sourceUrl:D.path,destinationUrl:`${S}/${M}`,overwrite:y&&T,nodeType:D.nodeType??be.ITEM,...F??{}}})},[e]),p=g.useCallback((S,x,y,F)=>{const R=e(S),E=new Set(R.map(Qc));return x.filter(P=>y.get(P.path)!==nt.Cancel).map(P=>{const T=y.get(P.path),M=E.has(P.name),k=T===nt.Replace&&M,N=k?P.name:Fp(P.name,E,P.nodeType);return k||E.add(N),{sourceUrl:P.path,destinationUrl:`${S}/${N}`,overwrite:k,nodeType:P.nodeType??be.ITEM,...F??{}}})},[e]),m=g.useCallback((S,x,y)=>{const F=u(S,x);return F.hasConflicts&&(a({files:x,destinationFolder:S,metadata:y}),c(F.conflicts)),F},[u,c]),C=g.useCallback(()=>{if(!r)return;const{files:S,destinationFolder:x,metadata:y}=r,F=h(x,S,!0,y);t?.(F,x),d()},[r,h,t,d]),v=g.useCallback(()=>{if(!r)return;const{files:S,destinationFolder:x,metadata:y}=r,F=h(x,S,!1,y);t?.(F,x),d()},[r,h,t,d]),w=g.useCallback(()=>{if(!r)return;const{files:S,destinationFolder:x,metadata:y}=r,F=p(x,S,new Map(s.map(R=>[R.path,nt.Cancel])),y);t?.(F,x),d()},[d,s,t,r,p]),b=g.useCallback(S=>{if(!r)return;const{files:x,destinationFolder:y,metadata:F}=r,R=new Map(S.map(D=>[D.file.path,D.action])),E=p(y,x,R,F);t?.(E,y),d()},[r,p,t,d]);return{conflictingFiles:s,conflictResolutionOpen:i,hasActiveConflictRef:l,checkForConflicts:u,startConflictResolution:m,resolveConflictsWithStrategy:h,resolveConflictsWithDecisions:p,openConflictResolution:c,closeConflictResolution:d,handleReplaceAll:C,handleDuplicateAll:v,handleCancelAll:w,handleDecideForEach:b}},s7=({getDestinationFiles:e,onCopyFiles:t,onMoveToFiles:s,onCopySuccess:o,onMoveSuccess:i,onDuplicateSuccess:n,getCopyHeader:r,getMoveHeader:a})=>{const[l,c]=g.useState(!1),[d,u]=g.useState([]),[h,p]=g.useState([]),[m,C]=g.useState(rt.Copy),[v,w]=g.useState(),[b,S]=g.useState(null),{conflictingFiles:x,conflictResolutionOpen:y,hasActiveConflictRef:F,startConflictResolution:R,resolveConflictsWithStrategy:E,closeConflictResolution:D,openConflictResolution:P,handleReplaceAll:T,handleDuplicateAll:M,handleCancelAll:k,handleDecideForEach:N}=Qv({getDestinationFiles:e,onResolve:(ie,$)=>{b?.type===rt.Copy?(t?.(ie,$),o?.()):b?.type===rt.Move&&b.sourceFolder&&(s?.(ie,b.sourceFolder,$),i?.())}}),A=g.useCallback(()=>{u([]),p([]),S(null),w(void 0)},[]),W=g.useCallback(ie=>{const $=R(ie,d,{type:rt.Copy});if(S({type:rt.Copy}),!$.hasConflicts){const q=E(ie,d,!1);t?.(q,ie),o?.(),A()}},[d,R,E,t,o,A]),U=g.useCallback((ie,$)=>{const q=$||(b?.sourceFolder??"/");if(!R(ie,h,{type:rt.Move,sourceFolderPath:q}).hasConflicts){const B=E(ie,h,!0);s?.(B,q,ie),i?.(),A()}},[h,R,E,s,i,A,b]),L=g.useCallback(()=>{T(),A()},[T,A]),de=g.useCallback(()=>{M(),A()},[M,A]),H=g.useCallback(()=>{k(),A()},[k,A]),te=g.useCallback(ie=>{N(ie),A()},[N,A]),Q=g.useCallback(ie=>{const $=ie.at(0)?.parentPath??"/",q=E($,ie,!1);t?.(q,$),n?.()},[t,n,E]),J=g.useCallback(ie=>{C(ie),c(!0)},[]),me=g.useCallback(()=>{c(!1),F.current||A()},[A,F]),[Re,ne]=g.useState(),_=g.useCallback(ie=>{u(ie);const $=ie[0]?.parentPath??ie[0]?.folderId;w($),r&&ie.length>0?ne(r(ie.length,ie[0]?.name)):ne(void 0)},[r]),Fe=g.useCallback(ie=>{p(ie);const $=ie[0]?.parentPath??ie[0]?.folderId;w($),S({type:rt.Move,sourceFolder:$}),a&&ie.length>0?ne(a(ie.length,ie[0]?.name)):ne(void 0)},[a]);return{handleDuplicate:Q,handleCloseDestinationFolderPopup:me,handleOpenDestinationFolderPopup:J,handleCopyTo:W,handleMoveTo:U,openDestinationFolderPopup:l,destinationFolderMode:m,destinationFolderTitle:Re,handleSetCopiedFiles:_,handleSetMovedFiles:Fe,clearState:A,conflictingFiles:x,conflictResolutionOpen:y,openConflictResolution:P,closeConflictResolution:D,handleConflictReplace:L,handleConflictCancel:H,handleConflictDuplicate:de,handleConflictDecideForEach:te,sourceFolder:v}},o7=({path:e,defaultPath:t,onPathChange:s,onSelectionClear:o})=>{const i=e!==void 0,[n,r]=g.useState(t),a=i?e:n,l=g.useCallback(d=>{i||r(d),s?.(d)},[i,s]),c=g.useCallback(d=>{l(d),o?.()},[l,o]);return{currentPath:a,setCurrentPath:l,handlePathChange:c}},i7=({onDeleteFiles:e,onDeleteSuccess:t})=>{const[s,o]=g.useState(!1),[i,n]=g.useState([]),[r,a]=g.useState(""),l=g.useCallback((u,h)=>{n(u),a(h),o(!0)},[]),c=g.useCallback(()=>{o(!1),n([])},[]),d=g.useCallback(()=>{if(e&&i.length>0){const u=i.map(h=>({sourceUrl:h.path,nodeType:h.nodeType}));e(u,r),t?.()}c()},[i,e,t,c,r]);return{deleteConfirmationOpen:s,itemsToDelete:i,openDeleteConfirmation:l,closeDeleteConfirmation:c,confirmDelete:d}},n7=({onDownloadFiles:e,customDownloadItemsAction:t,onDownloadSuccess:s})=>({handleDownloadFiles:g.useCallback(i=>{t&&i.length>0?t(i):e&&i.length>0&&(e(i),s?.())},[e,s,t])}),r7=e=>"dataTransfer"in e&&e.dataTransfer!==null,a7=({onUploadFiles:e,onValidateUpload:t,maxFileSize:s,allowedFileTypes:o,validationMessages:i={},onUploadArchive:n,uploadEnabled:r=!0,currentFolder:a}={})=>{const[l,c]=g.useState(!1),[d,u]=g.useState(!1),[h,p]=g.useState(),m=g.useRef(null),C=g.useRef(""),v=g.useRef([]),w=g.useMemo(()=>!!a?.permissions?.includes($o.WRITE),[a]),[b,S]=g.useState(new Map),[x,y]=g.useState(null),F=g.useCallback(B=>!o||o.includes("*/*")?B:B.filter(({fileContent:pe,name:le})=>Xv(o,pe.type,le)),[o]),R=g.useCallback(()=>{S(new Map),y(null)},[]),{conflictingFiles:E,conflictResolutionOpen:D,hasActiveConflictRef:P,startConflictResolution:T,closeConflictResolution:M,openConflictResolution:k,handleReplaceAll:N,handleDuplicateAll:A,handleCancelAll:W,handleDecideForEach:U}=Qv({getDestinationFiles:()=>v.current,onResolve:(B,pe)=>{if(!r||!w){R();return}if(!x)return;const le=B.map(re=>{const Ce=b.get(re.sourceUrl);if(!Ce)return;const xe=re.destinationUrl.split("/").pop();return{fileContent:Ce.fileContent,name:xe}}).filter(Boolean);le.length>0&&e?.(le,pe),R()}});g.useEffect(()=>{r&&w||(c(!1),u(!1),p(void 0),M(),R())},[r,M,R,w]),g.useEffect(()=>{if(!r||!w)return;let B=0;const pe=xe=>{r7(xe)&&xe.dataTransfer.types.includes(VL)&&(B++,u(!0))},le=()=>{B--,B===0&&u(!1)},re=()=>{B=0,u(!1)},Ce=xe=>{xe.preventDefault()};return window.addEventListener("dragenter",pe),window.addEventListener("dragleave",le),window.addEventListener("drop",re),window.addEventListener("dragover",Ce),()=>{window.removeEventListener("dragenter",pe),window.removeEventListener("dragleave",le),window.removeEventListener("drop",re),window.removeEventListener("dragover",Ce)}},[r,w]);const L=g.useCallback(B=>s?B.filter(pe=>pe.fileContent.size>s).map(pe=>pe.name):[],[s]),de=g.useCallback((B,pe)=>B.map(le=>({id:le.name,name:le.name,folderId:pe,path:le.name,nodeType:be.ITEM,parentPath:pe,contentLength:le.fileContent.size})),[]),H=g.useCallback(async(B,pe,le)=>{if(!r||!w)return!1;p(void 0),v.current=le;const re=L(B);if(re.length>0){const fe=s?(s/1048576).toFixed(2):0,De=i.oversizedFiles||`Files exceed maximum size (${fe}MB): ${re.join(", ")}`;return p(De),!1}if(t)try{const fe=await t(B,le,pe);if(!fe.valid)return p(fe.message||i.validationFailed||"Validation failed"),!1}catch{return p(i.validationError||"Validation error occurred"),!1}const Ce=new Map(B.map(fe=>[fe.name,fe]));S(Ce);const xe=de(B,pe);return y({destinationFolder:pe}),T(pe,xe,{destinationFolder:pe}).hasConflicts?!1:(e?.(B,pe),R(),!0)},[r,e,t,L,s,i,de,T,R,w]),te=g.useCallback(()=>{N(),R()},[N,R]),Q=g.useCallback(()=>{A(),R()},[A,R]),J=g.useCallback(()=>{W(),R()},[W,R]),me=g.useCallback(B=>{U(B),R()},[U,R]),Re=g.useCallback(()=>{M(),P.current||R()},[M,P,R]),ne=g.useCallback(B=>{!r||!w||(B.preventDefault(),B.stopPropagation(),B.dataTransfer.types.includes("Files")&&c(!0))},[r,w]),_=g.useCallback(B=>{if(!r||!w)return;B.preventDefault(),B.stopPropagation();const pe=B.currentTarget.getBoundingClientRect(),le=B.clientX,re=B.clientY;(le<=pe.left||le>=pe.right||re<=pe.top||re>=pe.bottom)&&c(!1)},[r,w]),Fe=g.useCallback(B=>{!r||!w||(B.preventDefault(),B.stopPropagation(),B.dataTransfer.types.includes("Files")&&(B.dataTransfer.dropEffect="copy"))},[r,w]),ie=g.useCallback(async(B,pe,le)=>{if(!r||!w||(B.preventDefault(),B.stopPropagation(),c(!1),!B.dataTransfer.types.includes("Files")))return;const re=Array.from(B.dataTransfer.files);if(re.length===0)return;const Ce=re.map(Le=>({fileContent:Le,name:Le.name})),xe=F(Ce);if(xe.length===0){p(i.unsupportedFiles||"Selected files are not supported");return}await H(xe,pe,le)},[r,F,H,i,w]);g.useEffect(()=>{let B=m.current;B||(B=document.createElement("input"),B.type="file",B.multiple=!0,B.style.display="none",document.body.appendChild(B),m.current=B),o&&o.length>0?B.accept=o.join(","):B.removeAttribute("accept");const pe=async()=>{if(!r||!w){B&&(B.value="");return}if(!B?.files?.length)return;const re=Array.from(B.files).map(xe=>({fileContent:xe,name:xe.name})),Ce=F(re);if(Ce.length===0){p(i.unsupportedFiles||"Selected files are not supported"),B.value="";return}await H(Ce,C.current,v.current),B.value=""};return B.addEventListener("change",pe),()=>{B&&(B.removeEventListener("change",pe),m.current===B&&(document.body.removeChild(B),m.current=null))}},[r,o,F,H,i,w]);const $=g.useCallback((B,pe)=>{!r||!w||(C.current=B,v.current=pe,m.current&&m.current.click())},[r,w]),q=g.useCallback((B,pe)=>{if(!n||!r||!w)return;const le=document.createElement("input");le.type="file",le.accept=".zip,application/zip",le.multiple=!1,le.style.display="none";const re=()=>{const Ce=le.files?.[0];if(!Ce){document.body.removeChild(le);return}const xe=Ce.name.replace(/\.zip$/i,"");if(pe.some(fe=>fe.nodeType===be.FOLDER&&fe.name.toLowerCase()===xe.toLowerCase())){p(i.validationFailed||`Folder with name "${xe}" already exists`),document.body.removeChild(le);return}try{n(Ce,xe,B)}finally{document.body.removeChild(le)}};le.addEventListener("change",re),document.body.appendChild(le),le.click()},[r,n,i,w]),se=g.useCallback(()=>{p(void 0)},[]);return{isDragging:l,isDraggingOverWindow:d,uploadError:h,handleDragEnter:ne,handleDragLeave:_,handleDragOver:Fe,handleDrop:ie,clearError:se,handleUpload:H,openFileDialog:$,openArchiveDialog:q,fileInputRef:m,uploadConflictingFiles:E,uploadConflictResolutionOpen:D,hasActiveUploadConflictRef:P,openUploadConflictResolution:k,closeUploadConflictResolution:Re,handleUploadConflictReplace:te,handleUploadConflictDuplicate:Q,handleUploadConflictCancel:J,handleUploadConflictDecideForEach:me}},Jv=g.createContext(void 0),ew={hiddenItemWarning:`${is.Warning}__A dot at the start of the name will make the item hidden`},l7={emptyName:"Name cannot be empty",duplicateName:"An item with this name already exists",hiddenItemWarning:ew.hiddenItemWarning};function c7(e){let t=e.length;for(;t>0&&e[t-1]==="/";)t--;return e.slice(0,t)}function d7(e,t){const s=c7(e),o=s.lastIndexOf("/");return o===-1?t:s.slice(0,o+1)+t}function u7(e){const t=e.lastIndexOf(".");return t===-1||t===0?e:e.substring(0,t)}function Ep(e){const t=e.lastIndexOf(".");return t===-1||t===0?"":e.substring(t)}const h7=({items:e,onRenameValidate:t,validationMessages:s,onMoveToFiles:o})=>{const[i,n]=g.useState(),r=g.useMemo(()=>({...l7,...s}),[s]),a=g.useMemo(()=>i?.path,[i]),l=g.useCallback(p=>{const m=Go(e,p);m&&n(m)},[e]),c=g.useCallback(()=>{n(void 0)},[]),d=g.useCallback(p=>{if(!i||!o){n(void 0);return}const m=i.nodeType===be.ITEM;let C=p.trim();if(m){const S=Ep(i.name);S&&!C.endsWith(S)&&(C=C+S)}if(C===i.name){n(void 0);return}const v=d7(i.path,C),w=i.parentPath;if(!w){n(void 0);return}const b={sourceUrl:i.path,destinationUrl:v,nodeType:i.nodeType};o([b],w,w),n(void 0)},[i,o]),u=g.useCallback((p,m)=>{const C=p.trim();if(!C)return r.emptyName;if(C.startsWith("."))return r.hiddenItemWarning;const v=m.nodeType===be.ITEM;let w=C;if(v){const S=Ep(m.name);S&&!w.endsWith(S)&&(w=w+S)}const b=m.parentPath;if(b){const S=Go(e,b);if(S&&new Set((S.items??[]).filter(y=>y.path!==m.path).map(y=>y.name.toLowerCase())).has(w.toLowerCase()))return r.duplicateName}if(t){const S=t(w,m);if(S)return S}return null},[t,r,e]),h=g.useCallback(p=>p.nodeType===be.ITEM?u7(p.name):p.name,[]);return{renamedPath:a,renamedItem:i,renameHandler:l,renameSaveHandler:d,renameCancelHandler:c,renameValidateHandler:u,getDisplayName:h}},tw=e=>{const[t,s]=g.useState(e?.expandedPaths??new Set),o=g.useMemo(()=>!!e?.onExpandedPathsChange,[e?.onExpandedPathsChange]),i=g.useMemo(()=>o?e?.expandedPaths??new Set:t,[o,e?.expandedPaths,t]);g.useEffect(()=>{o&&e?.expandedPaths&&s(new Set(e.expandedPaths))},[o,e?.expandedPaths]);const n=g.useCallback(d=>{o?e?.onExpandedPathsChange?.(d):s(d)},[o,e]),r=g.useCallback(d=>{const u=new Set(i);u.has(d)?u.delete(d):u.add(d),n(u)},[i,n]),a=g.useCallback(()=>{n(new Set)},[n]),l=g.useCallback(d=>{const u=new Set(i);u.add(d),n(u)},[i,n]),c=g.useCallback(d=>{const u=new Set(i);u.delete(d),n(u)},[i,n]);return{expandedPaths:i,setExpandedPaths:n,togglePath:r,collapseAll:a,expandPath:l,collapsePath:c,isControlled:o}},g7=({newActions:e,currentFolder:t,onUploadFiles:s,onCreateFolder:o,onUploadArchive:i,onCreateNewItem:n,isNewButtonDisabled:r})=>{const a=g.useMemo(()=>{const d=[];return e&&(e.newFolder&&d.push({key:"new-folder",label:e.newFolder.label,icon:e?.newFolder?.icon!==void 0?e?.newFolder?.icon:f.jsx(G.IconFolder,{...Y,className:"text-secondary"}),onClick:()=>{o&&o()}}),e.newItem&&d.push({key:"new-item",label:e.newItem.label,icon:e?.newItem?.icon!==void 0?e?.newItem?.icon:f.jsx(G.IconPlus,{...Y,className:"text-secondary"}),onClick:()=>{n&&n()}}),e.uploadFiles&&d.push({key:"upload-file",label:e.uploadFiles.label,icon:e?.uploadFiles?.icon!==void 0?e?.uploadFiles?.icon:f.jsx(G.IconFile,{...Y,className:"text-secondary"}),onClick:()=>{s&&s()}}),e.uploadArchive&&d.push({key:"upload-archive",label:e.uploadArchive.label,icon:e?.uploadArchive?.icon!==void 0?e?.uploadArchive?.icon:f.jsx(G.IconFileZip,{...Y,className:"text-secondary"}),onClick:()=>{i&&i()}})),d},[e,o,s,i,n]),l=g.useMemo(()=>a?.length>0,[a]),c=g.useMemo(()=>!t?.permissions?.includes($o.WRITE)||!!r,[t,r]);return{newActions:a,isNewButtonVisible:l,isNewButtonDisabled:c}},p7={emptyName:"Folder name cannot be empty",duplicateName:"A folder with this name already exists",hiddenItemWarning:ew.hiddenItemWarning},f7=({currentFolder:e,onCreateFolder:t,onValidateFolderName:s,validationMessages:o})=>{const[i,n]=g.useState(!1),[r,a]=g.useState(null),l=g.useRef(e?.path),c=g.useMemo(()=>({...p7,...o}),[o]);g.useEffect(()=>{const m=e?.path;l.current!==m&&i&&(n(!1),a(null)),l.current=m},[e?.path,i]);const d=g.useCallback(()=>{const m=`__new_folder_${Date.now()}`;a(m),n(!0)},[]),u=g.useCallback(()=>{n(!1),a(null)},[]),h=g.useCallback(m=>{const C=m.trim();if(!C)return c.emptyName;if(C.startsWith("."))return c.hiddenItemWarning;if(e&&new Set((e.items??[]).filter(w=>w.nodeType===be.FOLDER).map(w=>w.name.toLowerCase())).has(C.toLowerCase()))return c.duplicateName;if(s&&e){const v=s(C,e);if(v)return v}return null},[e,s,c]),p=g.useCallback(async m=>{const C=m.trim();if(!C)return;const w=`${e?.path??"/"}/${C}`,b=`${w}/${Zc}`,x={fileContent:new File([],Zc,{type:"text/plain"}),name:Zc};t&&await t(x,w,b),u()},[e,t,u]);return{isCreatingFolder:i,newFolderTempId:r,startFolderCreation:d,cancelFolderCreation:u,saveFolderCreation:p,validateFolderName:h}},m7=({additionalButtons:e,expandedPathsLength:t,collapseAll:s})=>{const o=t===0;return{additionalButtons:g.useMemo(()=>{const n=oe(["hover:text-accent-primary",o&&"controls-secondary-disable hover:controls-secondary-disable disabled:hover:cursor-default"]);return f.jsxs(f.Fragment,{children:[e,f.jsx(no,{disabled:o,className:n,size:bt.Small,onClick:s,icon:f.jsx(G.IconCopyMinus,{size:pt.LG,stroke:1.5}),"aria-label":"collapse-all"})]})},[e,o,s])}},C7=({onGetInfo:e})=>{const[t,s]=g.useState(!1),[o,i]=g.useState(void 0),n=g.useCallback(async a=>{i(a),s(!0),e&&await e(a)},[e]),r=g.useCallback(()=>{s(!1),i(void 0)},[]);return{isMetadataPopupOpen:t,selectedFileForMetadata:o,openMetadataPopup:n,closeMetadataPopup:r}};function v7(e){const t=[];function s(o){for(const i of o)t.push(i),i.items&&s(i.items)}return s(e),t}function Dp(e,t){const s=ki(t);return e.filter(o=>ki(o.name).includes(s))}function w7({onSearchFiles:e,clearSearchResults:t,currentPath:s,searchResults:o=[],searchInProgress:i=!1,navigationPanelValue:n,onNavigationPanelSearchChange:r,allItems:a=[],activeTab:l}){const[c,d]=g.useState(""),u=g.useRef(!1),h=g.useRef(!1),p=g.useRef([]),m=g.useRef(s),C=g.useRef(l);g.useEffect(()=>{n!=null&&d(String(n))},[n]);const v=String(n??c??"").trim(),w=h.current&&(i||o.length>0||v!==""),b=g.useCallback(F=>{const R=F.trim();if(!R){h.current=!1,u.current=!1;return}h.current=!0,e&&s&&!u.current&&(u.current=!0,e(s,R))},[e,s]),S=g.useCallback(()=>{u.current=!1,h.current=!1,p.current=[],d(""),r?.(""),t?.()},[t,r]),x=g.useCallback(F=>{const R=String(F??"");d(R),r?.(R),R.trim()?b(R):S()},[r,b,S]);g.useEffect(()=>{(m.current!==s||C.current!==l)&&(m.current=s,C.current=l,u.current=!1,h.current=!1,p.current=[],d(""),r?.(""),t?.())},[s,l,r,t]),g.useEffect(()=>{o.length>0&&p.current.length===0&&(p.current=o)},[o]);const y=g.useMemo(()=>{if(e){const R=p.current.length>0?p.current:o;return!v||R.length===0?R:Dp(R,v)}if(!v||!a.length)return[];const F=v7(a);return Dp(F,v)},[e,o,v,a]);return{isSearchMode:w,searchValue:c,effectiveSearchValue:v,setSearchValue:d,handleSearchChange:x,handleSearchActivate:b,handleSearchClear:S,searchResultsRows:y}}function b7({selectedPaths:e,defaultSelectedPaths:t,onSelectedPathsChange:s}){const o=e!==void 0,[i,n]=g.useState(()=>t??new Set),r=g.useMemo(()=>o?e:i,[o,e,i]),a=g.useCallback(c=>{const d=new Set(c);s?.(d),o||n(d)},[o,s]),l=g.useCallback(()=>{a(new Set)},[a]);return{selectedPaths:r,setSelectedPaths:a,clearSelection:l,isControlled:o}}const sw=':;,=/{}%&\\"',uh=`(\r
61
+ `,$I=class extends b4{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:s}=e;this.suppressQuotes=t,this.columnSeparator=s}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,np),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((s,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(s.data.value||""),s.mergeAcross&&this.appendEmptyCells(s.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,s,o){s!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(o)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,s){t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",s);this.result+=this.putInQuotes(o.valueFormatted??o.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(z(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=np),this.isFirstLine=!1}},qI=class extends w4{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){z(51);return}const t=this.getMergedParams(e),s=this.getData(t),o=new Blob(["\uFEFF",s],{type:"text/plain"}),i=typeof t.fileName=="function"?t.fileName(we(this.gos,{})):t.fileName;S4(this.getFileName(i),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const s=t?Object.assign({},e):this.getMergedParams(e);return this.getData(s)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:s,rowGroupColsSvc:o,valueSvc:i,gos:n}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:d,columnSeparator:u}=e;return new $I({colModel:t,colNames:s,valueSvc:i,gos:n,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:d||!1,columnSeparator:u||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function KI(e,t){return e.csvCreator?.getDataAsCsv(t)}function YI(e,t){e.csvCreator?.exportDataAsCsv(t)}var ZI={moduleName:"CsvExport",version:Z,beans:[qI],apiFunctions:{getDataAsCsv:KI,exportDataAsCsv:YI},dependsOn:[UI]},XI=class extends O{constructor(e,t,s){super(),this.id=e,this.parentCache=t,this.params=s,this.state="needsLoading",this.version=0,this.startRow=e*s.blockSize,this.endRow=this.startRow+s.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,s){this.successCommon(e,{rowData:t,rowCount:s})}isRequestMostRecentAndLive(e){const t=e===this.version,s=this.isAlive();return t&&s}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:s,beans:o,rowNodes:i}=this;for(let n=0;n<e;n++){const r=s+n,a=new io(o);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(r),a.setRowTop(t*r),i.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:s,state:o}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:s,pageStatus:o}}}setDataAndId(e,t,s){X(t)?e.setDataAndId(t,s.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(qe(this.params.datasource.getRows)){z(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:s,params:{sortModel:o,filterModel:i},gos:n}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,s),failCallback:this.pageLoadFailed.bind(this,s),sortModel:o,filterModel:i,context:we(n,{}).context}}forEachNode(e,t,s){this.rowNodes.forEach((o,i)=>{this.startRow+i<s&&e(o,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const s=e-this.startRow;return this.rowNodes[s]}processServerResult(e){const{rowNodes:t,beans:s}=this;t.forEach((i,n)=>{const r=e.rowData?e.rowData[n]:void 0;!i.id&&i.alreadyRendered&&r&&(t[n]=new io(s),t[n].setRowIndex(i.rowIndex),t[n].setRowTop(i.rowTop),t[n].setRowHeight(i.rowHeight),i.clearRowTopAndRowIndex()),this.setDataAndId(t[n],r,this.startRow+n)});const o=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,o)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},QI=2,JI=class extends O{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const s=Math.floor(e/this.params.blockSize);let o=this.blocks[s];if(!o){if(t)return;o=this.createBlock(s)}return o.getRow(e)}createBlock(e){const t=this.params,s=this.createBean(new XI(e,this,t));return this.blocks[s.id]=s,this.blockCount++,this.purgeBlocksIfNeeded(s),t.rowNodeBlockLoader.addBlock(s),s}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(Ao(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(r=>r!=e),s=(r,a)=>a.lastAccessed-r.lastAccessed;t.sort(s);const o=this.params.maxBlocksInCache>0,i=o?this.params.maxBlocksInCache-1:null,n=QI-1;t.forEach((r,a)=>{const l=r.state==="needsLoading"&&a>=n,c=o?a>=i:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(r)||this.isBlockFocused(r))return;this.removeBlockFromCache(r)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:s,endRow:o}=e;return t.rowIndex>=s&&t.rowIndex<o}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:s}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,s-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:s,overflowSize:o}=this.params,n=(e.id+1)*s+o;this.rowCount<n&&(this.rowCount=n)}}setRowCount(e,t){this.rowCount=e,X(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const s of this.getBlocksInOrder())s.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(s,o)=>s.id-o.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const s=[];let o=-1,i=!1;const n={value:0};let r=!1;for(const l of this.getBlocksInOrder())if(!r){if(i&&o+1!==l.id){r=!0;continue}o=l.id,l.forEachNode(c=>{const d=c===e||c===t;(i||d)&&s.push(c),d&&(i=!i)},n,this.rowCount)}return r||i?[]:s}},e6=class extends O{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new io(e);this.rootNode=t,t.level=-1,this.rowHeight=Fo(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=Fo(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){let e;this.cacheParams?e=!jn(this.cacheParams.sortModel,this.beans.sortSvc?.getSortModel()??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?.getRowNodesInRange(e,t)??[]}reset(){if(!this.datasource)return;Li(this.gos)!=null||this.beans.selectionSvc?.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:s,rowNodeBlockLoader:o,eventSvc:i,gos:n}=e;this.cacheParams={datasource:this.datasource,filterModel:t?.getFilterModel()??{},sortModel:s?.getSortModel()??[],rowNodeBlockLoader:o,initialRowCount:n.get("infiniteInitialRowCount"),maxBlocksInCache:n.get("maxBlocksInCache"),rowHeight:Fo(e),overflowSize:n.get("cacheOverflowSize"),blockSize:n.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new JI(this.cacheParams)),i.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(s=>{s.id===e&&(t=s)}),t}forEachNode(e){this.infiniteCache?.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),s=this.getRowCount()-1;return t>s?s:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache?.refreshCache()}purgeCache(){this.infiniteCache?.purgeCache()}isLastRowIndexKnown(){return this.infiniteCache?.isLastRowIndexKnown()??!1}setRowCount(e,t){this.infiniteCache?.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function t6(e){ml(e)?.refreshCache()}function s6(e){ml(e)?.purgeCache()}function o6(e){return ml(e)?.getRowCount()}var i6=class extends O{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=ly(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=lt(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){as(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){Ao(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(s=>s.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const s of t)s.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:s,state:o}=t.getBlockStateJson();e[s]=o}),e}printCacheStatus(){Ao(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},n6={moduleName:"InfiniteRowModelCore",version:Z,rowModels:["infinite"],beans:[e6,i6]},r6={moduleName:"InfiniteRowModel",version:Z,apiFunctions:{refreshInfiniteCache:t6,purgeInfiniteCache:s6,getInfiniteRowCount:o6},dependsOn:[n6,vI]},a6="↑",l6="↓",c6={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},d6=class extends Xe{constructor(){super(c6),this.eValue=ve,this.eDelta=ve,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const s=Math.abs(t),o=e.formatValue(s),i=X(o)?o:s,n=t>=0,r=this.eDelta;n?r.textContent=a6+i:r.textContent=l6+i,r.classList.toggle("ag-value-change-delta-up",n),r.classList.toggle("ag-value-change-delta-down",!n)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Mt(this.eDelta)}refresh(e,t=!1){const{value:s,valueFormatted:o}=e,{eValue:i,lastValue:n,beans:r}=this;if(s===n||(X(o)?i.textContent=o:X(s)?i.textContent=s:Mt(i),r.filterManager?.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=s&&typeof s=="object"&&"toNumber"in s?s.toNumber():s,l=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const c=a-l;this.showDelta(e,c)}return n&&i.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=s,!0}},u6=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",h6={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},g6=class extends Xe{constructor(){super(h6),this.eCurrent=ve,this.refreshCount=0,this.registerCSS(u6)}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious?.remove();const{beans:t,eCurrent:s}=this,o=Rt({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=o,o.textContent=s.textContent,this.getGui().insertBefore(o,s),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.ePrevious?.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){let s=e.value;if(qe(s)&&(s=""),s===this.lastValue||this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=s;const o=this.eCurrent;return X(e.valueFormatted)?o.textContent=e.valueFormatted:X(e.value)?o.textContent=s:Mt(o),!0}},p6=class extends O{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,s=this.beans.gos.get("cellFlashDuration"),o=this.beans.gos.get("cellFadeDuration")){const i=this.animations[t];i.delete(e);const n=Date.now(),r=n+s,a=n+s+o,l={phase:"flash",flashEndTime:r,fadeEndTime:a};i.set(e,l);const c=`ag-cell-${t}`,d=`${c}-animation`,{comp:u,eGui:{style:h}}=e;u.toggleCss(c,!0),u.toggleCss(d,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&r+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),s)}),this.nextAnimationTime=r)}advanceAnimations(){const e=Date.now();let t=null;for(const s of Object.keys(this.animations)){const o=this.animations[s],i=`ag-cell-${s}`,n=`${i}-animation`;for(const[r,a]of o){if(!r.isAlive()||!r.comp){o.delete(r);continue}const{phase:l,flashEndTime:c,fadeEndTime:d}=a,u=l==="flash"?c:d;if(!(e+15>=u)){t=Math.min(u,t??1/0);continue}const{comp:p,eGui:{style:m}}=r;switch(l){case"flash":p.toggleCss(i,!1),p.toggleCss(n,!0),m.transition=`background-color ${d-c}ms`,m.transitionDelay=`${c-e}ms`,t=Math.min(d,t??1/0),a.phase="fade";break;case"fade":p.toggleCss(i,!1),p.toggleCss(n,!1),m.removeProperty("transition"),m.removeProperty("transition-delay"),o.delete(r);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const s=nE(e.cellPosition);t.cells[s]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t?.flashDuration,t?.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function f6(e,t={}){const{cellFlashSvc:s}=e;s&&e.frameworkOverrides.wrapIncoming(()=>{for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))s.flashCell(o,t)})}var m6={moduleName:"HighlightChanges",version:Z,beans:[p6],userComponents:{agAnimateShowChangeCellRenderer:d6,agAnimateSlideCellRenderer:g6},apiFunctions:{flashCells:f6}};function C6(e){return e.stateSvc?.getState()??{}}function v6(e,t,s){return e.stateSvc?.setState(t,s)}function rp(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=w6(e)),e.version=Z,e}function w6(e){return e.cellSelection=b6(e,"rangeSelection"),e}function b6(e,t){if(e&&typeof e=="object")return e[t]}var S6=class extends O{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=lt(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=lt(this,()=>{this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(this.updateCachedState("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowGroupExpansion",void 0)):(this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("ssrmRowGroupExpansion",void 0))},0),this.onRowSelectedDebounced=lt(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:s}=this.beans;this.isClientSideRowModel=Qe(e);const o=rp(e.get("initialState")??{}),i=o.partialColumnState;delete o.partialColumnState,this.cachedState=o;const n=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>n(()=>this.setupStateOnGridReady(o))),(o.columnOrder||o.columnVisibility||o.columnSizing||o.columnPinning||o.columnGroup)&&s?.hideColumns("columnState");const[r,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(r(),n(()=>{this.setupStateOnColumnsInitialised(o,!!i),s?.revealColumns("columnState")}))},rowCountReady:()=>{a?.(),n(()=>this.setupStateOnRowCountReady(o))},firstDataRendered:()=>{l?.(),n(()=>this.setupStateOnFirstDataRendered(o))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const s=rp(e);delete s.partialColumnState,this.cachedState=s,this.startSuppressEvents();const o="api",i=t?new Set(t):void 0;this.setGridReadyState(s,o,i),this.setColumnsInitialisedState(s,o,!!i,i),this.setRowCountState(s,o,i),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(s,o,i),this.stopSuppressEvents(o)})}setGridReadyState(e,t,s){t==="api"&&!s?.has("sideBar")&&this.beans.sideBar?.comp?.setState(e.sideBar),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,s,o){this.setColumnState(e,t,s,o),this.setColumnGroupState(e,t,o),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const s=o=>()=>this.updateColumnState([o]);this.addManagedEventListeners({columnValueChanged:s("aggregation"),columnMoved:s("columnOrder"),columnPinned:s("columnPinning"),columnResized:s("columnSizing"),columnVisible:s("columnVisibility"),columnPivotChanged:s("pivot"),columnPivotModeChanged:s("pivot"),columnRowGroupChanged:s("rowGroup"),sortChanged:s("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,s){const{filter:o,rowGroupExpansion:i,ssrmRowGroupExpansion:n,rowSelection:r,pagination:a}=e,l=(d,u)=>!s?.has(d)&&(u||t==="api");l("filter",o)&&this.setFilterState(o),l("rowGroupExpansion",i)&&this.setRowGroupExpansionState(n,i,t),l("rowSelection",r)&&this.setRowSelectionState(r,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),s=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},o=()=>t("filter",this.getFilterState()),{gos:i,colFilter:n}=this.beans;this.addManagedEventListeners({filterChanged:o,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:s,columnRowGroupChanged:s,rowDataUpdated:()=>{(i.get("groupDefaultExpanded")!==0||i.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(s)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:r=>{(r.newPage||r.newPageSize)&&t("pagination",this.getPaginationState())}}),n&&this.addManagedListeners(n,{filterStateChanged:o})}setFirstDataRenderedState(e,t,s){const{scroll:o,cellSelection:i,focusedCell:n,columnOrder:r,rowPinning:a}=e,l=(u,h)=>!s?.has(u)&&(h||t==="api");l("focusedCell",n)&&this.setFocusedCellState(n),l("cellSelection",i)&&this.setCellSelectionState(i),l("scroll",o)&&this.setScrollState(o),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!r?.orderedColIds,t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const d=this.getRangeSelectionState();c("rangeSelection",d),c("cellSelection",d),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),s=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:s,cellFocusCleared:s,cellSelectionChanged:o=>{if(o.finished){const i=this.getRangeSelectionState();t("rangeSelection",i),t("cellSelection",i)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return f4(Ba(e),e.colModel.isPivotMode())}setColumnState(e,t,s,o){const{sort:i,rowGroup:n,aggregation:r,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:d,columnOrder:u}=e;let h=!1;const p=(T,M)=>{const k=!o?.has(T)&&!!(M||t==="api");return h||(h=k),k},m={},C=T=>{let M=m[T];return M||(M={colId:T},m[T]=M,M)},v={},w=p("sort",i);w&&i?.sortModel.forEach(({colId:T,sort:M},k)=>{const N=C(T);N.sort=M,N.sortIndex=k}),(w||!s)&&(v.sort=null,v.sortIndex=null);const b=p("rowGroup",n);b&&n?.groupColIds.forEach((T,M)=>{const k=C(T);k.rowGroup=!0,k.rowGroupIndex=M}),(b||!s)&&(v.rowGroup=null,v.rowGroupIndex=null);const S=p("aggregation",r);S&&r?.aggregationModel.forEach(({colId:T,aggFunc:M})=>{C(T).aggFunc=M}),(S||!s)&&(v.aggFunc=null);const x=p("pivot",a);x&&(a?.pivotColIds.forEach((T,M)=>{const k=C(T);k.pivot=!0,k.pivotIndex=M}),this.gos.updateGridOptions({options:{pivotMode:!!a?.pivotMode},source:t})),(x||!s)&&(v.pivot=null,v.pivotIndex=null);const y=p("columnPinning",l);if(y){for(const T of l?.leftColIds??[])C(T).pinned="left";for(const T of l?.rightColIds??[])C(T).pinned="right"}(y||!s)&&(v.pinned=null);const F=p("columnVisibility",c);if(F)for(const T of c?.hiddenColIds??[])C(T).hide=!0;(F||!s)&&(v.hide=null);const R=p("columnSizing",d);if(R)for(const{colId:T,flex:M,width:k}of d?.columnSizingModel??[]){const N=C(T);N.flex=M??null,N.width=k}(R||!s)&&(v.flex=null);const E=u?.orderedColIds,D=!!E?.length&&!o?.has("columnOrder"),P=D?E.map(T=>C(T)):Object.values(m);(P.length||h)&&(this.columnStates=P,rs(this.beans,{state:P,applyOrder:D,defaultState:v},t))}setColumnPivotState(e,t){const s=this.columnStates;this.columnStates=void 0;const o=this.columnGroupStates;this.columnGroupStates=void 0;const i=this.beans,{pivotResultCols:n,colGroupSvc:r}=i;if(n?.isPivotResultColsPresent()){if(s){const a=[];for(const l of s)n.getPivotResultCol(l.colId)&&a.push(l);rs(i,{state:a,applyOrder:e},t)}o&&r?.setColumnGroupState(o,t)}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return m4(t)}setColumnGroupState(e,t,s){const o=this.beans.colGroupSvc;if(!o||s?.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const i=new Set(e.columnGroup?.openColumnGroupIds),r=o.getColumnGroupState().map(({groupId:a})=>{const l=i.has(a);return l&&i.delete(a),{groupId:a,open:l}});for(const a of i)r.push({groupId:a,open:!0});r.length&&(this.columnGroupStates=r),o.setColumnGroupState(r,t)}getFilterState(){const e=this.beans.filterManager;let t=e?.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const s=e?.getFilterState(),o=e?.getAdvFilterModel()??void 0;return t||o||s?{filterModel:t,columnFilterState:s,advancedFilterModel:o}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:s,columnFilterState:o,advancedFilterModel:i}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(s!==void 0||o!==void 0)&&t?.setFilterState(s??null,o??null,"columnFilter"),i!==void 0&&t?.setAdvFilterModel(i??null,"advancedFilter")}getRangeSelectionState(){const e=this.beans.rangeSvc?.getCellRanges().map(t=>{const{id:s,type:o,startRow:i,endRow:n,columns:r,startColumn:a}=t;return{id:s,type:o,startRow:i,endRow:n,colIds:r.map(l=>l.getColId()),startColId:a.getColId()}});return e?.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:s,colModel:o,visibleCols:i}=this.beans;if(!so(t)||!s)return;const n=[];for(const r of e?.cellRanges??[]){const a=[];for(const c of r.colIds){const d=o.getCol(c);d&&a.push(d)}if(!a.length)continue;let l=o.getCol(r.startColId);if(!l){const c=i.allCols,d=new Set(a);l=c.find(u=>d.has(u))}n.push({...r,columns:a,startColumn:l})}s.setCellRanges(n)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=e?.getHScrollPosition()??{left:0},{top:s}=e?.getVScrollPosition()??{top:0};return s||t?{top:s,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:s}=e??{top:0,left:0},{frameworkOverrides:o,rowRenderer:i,animationFrameSvc:n,ctrlsSvc:r}=this.beans;o.wrapIncoming(()=>{r.get("center").setCenterViewportScrollLeft(s),r.getScrollFeature()?.setVerticalScrollPosition(t),i.redraw({afterScroll:!0}),n?.flushAllFrames()})}getSideBarState(){return this.beans.sideBar?.comp?.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:s,rowPinned:o}=e;return{colId:t.getColId(),rowIndex:s,rowPinned:o}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:s}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:o,rowIndex:i,rowPinned:n}=e;t.setFocusedCell({column:s.getCol(o),rowIndex:i,rowPinned:n,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const s=e.getCurrentPage(),o=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!s&&!o))return{page:s,pageSize:o}}setPaginationState(e,t){const{pagination:s,gos:o}=this.beans;if(!s)return;const{pageSize:i,page:n}=e??{page:0,pageSize:o.get("paginationPageSize")},r=t==="gridInitializing";i&&!o.get("paginationAutoPageSize")&&s.setPageSize(i,r?"initialState":"pageSizeSelector"),typeof n=="number"&&(r?s.setPage(n):s.goToPage(n))}getRowSelectionState(){const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!t?.toggledNodes?.length?void 0:t}setRowSelectionState(e,t){this.beans.selectionSvc?.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){return this.beans.pinnedRowModel?.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t?.setPinnedState(e):t?.reset()}setRowGroupExpansionState(e,t,s){const o=this.beans.expansionSvc;if(!o)return;const i=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};o.setExpansionState(i,s)}updateColumnState(e){const t=this.getColumnState();let s=!1;const o=this.cachedState;for(const i of Object.keys(t)){const n=t[i];jn(n,o[i])||(s=!0)}this.cachedState={...o,...t},s&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const s=this.cachedState[e];this.setCachedStateValue(e,t),jn(t,s)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){const e=this.staleStateKeys;for(const t of e)t==="rowSelection"&&this.setCachedStateValue(t,this.getRowSelectionState());e.clear()}dispatchStateUpdateEvent(e){if(!this.suppressEvents){for(const t of e)this.queuedUpdateSources.add(t);this.dispatchStateUpdateEventDebounced()}}dispatchQueuedStateUpdateEvents(){const e=this.queuedUpdateSources,t=Array.from(e);e.clear(),this.eventSvc.dispatchEvent({type:"stateUpdated",sources:t,state:this.cachedState})}startSuppressEvents(){this.suppressEvents=!0,this.beans.colAnimation?.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.beans.colAnimation?.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},y6={moduleName:"GridState",version:Z,beans:[S6],apiFunctions:{getState:C6,setState:v6}};function x6(e){return e.rowModel.isLastRowIndexKnown()}function R6(e){return e.pagination?.getPageSize()??100}function F6(e){return e.pagination?.getCurrentPage()??0}function E6(e){return e.pagination?.getTotalPages()??1}function D6(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function P6(e){e.pagination?.goToNextPage()}function T6(e){e.pagination?.goToPreviousPage()}function M6(e){e.pagination?.goToFirstPage()}function I6(e){e.pagination?.goToLastPage()}function k6(e,t){e.pagination?.goToPage(t)}var A6=class extends O{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,s=()=>{const o=Math.max(Fo(t),1),i=Math.floor(e/o);t.pagination.setPageSize(i,"autoCalculated")};this.isBodyRendered?lt(this,s,50)():(s(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},Sn="paginationPageSizeSelector",L6={tag:"span",cls:"ag-paging-page-size"},O6=class extends Xe{constructor(){super(L6),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.pagination.getPageSize()||(this.pagination.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.pagination=e.pagination}postConstruct(){this.addManagedPropertyListener(Sn,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!e?.newPageSize)return;const t=this.pagination.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){Mt(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(Sn)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),s=!t||!e.includes(t);if(s){const i=this.gos.exists("paginationPageSize"),n=this.gos.get(Sn)!==!0;z(94,{pageSizeSet:i,pageSizesSet:n,pageSizeOptions:e,paginationPageSizeOption:t}),n||z(95,{paginationPageSizeOption:t,paginationPageSizeSelector:Sn}),e.unshift("")}const o=String(s?"":t);this.selectPageSizeComp?(ro(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=s}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const s=this.getLocaleTextFunc(),o=s("pageSizeSelectorLabel","Page Size:"),i=s("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new Eu).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(i).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(Sn);return!Array.isArray(t)||!t?.length?e:[...t].sort((s,o)=>s-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},N6={selector:"AG-PAGE-SIZE-SELECTOR",component:O6},H6=".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;gap:calc(var(--ag-spacing)*4);height:var(--ag-pagination-panel-height);justify-content:flex-end;padding:0 var(--ag-cell-horizontal-padding)}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}",G6=class extends IF{constructor(){super(),this.btFirst=ve,this.btPrevious=ve,this.btNext=ve,this.btLast=ve,this.lbRecordCount=ve,this.lbFirstRowOnPage=ve,this.lbLastRowOnPage=ve,this.lbCurrent=ve,this.lbTotal=ve,this.pageSizeComp=ve,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(H6)}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination,this.ariaAnnounce=e.ariaAnnounce}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[N6]);const{btFirst:t,btPrevious:s,btNext:o,btLast:i}=this;this.activateTabIndex([t,s,o,i]),t.insertAdjacentElement("afterbegin",Jt(e?"last":"first",this.beans)),s.insertAdjacentElement("afterbegin",Jt(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",Jt(e?"previous":"next",this.beans)),i.insertAdjacentElement("afterbegin",Jt(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:n=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(n):Y2(this.beans,n),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:s}=e;this.addManagedListeners(t,{click:s,keydown:o=>{(o.key===I.ENTER||o.key===I.SPACE)&&(o.preventDefault(),s())}})}K2(this.beans,this,this.getGui()),this.areListenersSetup=!0}}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");return t?t({value:e}):v4(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),s=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const o=this.isZeroPagesToDisplay(),i=e===s-1;this.nextButtonDisabled=i||o,this.lastButtonDisabled=!t||o||e===s-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){hS(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),s=this.pagination.getMasterRowCount(),o=e?s:null,i=this.pagination.getCurrentPage(),n=this.pagination.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=n*i+1,a=r+n-1,e&&a>o&&(a=o));const l=r+n-1,c=!e&&s<l,d=this.formatNumber(r);this.lbFirstRowOnPage.textContent=d;let u;const h=this.getLocaleTextFunc();c?u=h("pageLastRowUnknown","?"):u=this.formatNumber(a),this.lbLastRowOnPage.textContent=u;const m=t>0?i+1:0,C=this.formatNumber(m);this.lbCurrent.textContent=C;let v,w;if(e)v=this.formatNumber(t),w=this.formatNumber(o);else{const b=h("more","more");v=b,w=b}this.lbTotal.textContent=v,this.lbRecordCount.textContent=w,this.announceAriaStatus(d,u,w,C,v)}announceAriaStatus(e,t,s,o,i){const n=this.getLocaleTextFunc(),r=n("page","Page"),a=n("to","to"),l=n("of","of"),c=`${e} ${a} ${t} ${l} ${s}`,d=`${r} ${o} ${l} ${i}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,this.ariaAnnounce?.announceValue(c,"paginationRow")),d!==this.ariaPageStatus&&(this.ariaPageStatus=d,this.ariaAnnounce?.announceValue(d,"paginationPage"))}},B6={selector:"AG-PAGINATION",component:G6},V6=class extends O{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return B6}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:s}=this.beans;s?.isEditing()&&(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){if(!this.active)return;let t=e;this.paginateChildRows||(t=this.beans.rowModel.getTopLevelIndexFromDisplayedIndex?.(e)??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return X(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:X(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:X(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:X(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const s=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}s!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const s=this.pageSize,o=t-1;this.totalPages=Math.floor(o/s)+1,this.adjustCurrentPageIfInvalid();const i=this.currentPage,n=s*i;let r=s*(i+1)-1;if(r>o&&(r=o),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(n),r===o)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(r+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:s}=this,o=e-1;this.totalPages=Math.floor(o/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*s,this.bottomDisplayedRowIndex=t*(s+1)-1,this.bottomDisplayedRowIndex>o&&(this.bottomDisplayedRowIndex=o)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:s=!1,newPageSize:o=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:s,newPageSize:o,keepRenderedRows:t})}},z6={moduleName:"Pagination",version:Z,beans:[V6,A6],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:x6,paginationGetPageSize:R6,paginationGetCurrentPage:F6,paginationGetTotalPages:E6,paginationGetRowCount:D6,paginationGoToNextPage:P6,paginationGoToPreviousPage:T6,paginationGoToFirstPage:M6,paginationGoToLastPage:I6,paginationGoToPage:k6},dependsOn:[Cl]};function W6(e,t={}){const s=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(s))}function cv(e,t,s,o,i){t&&(o&&t.parent&&t.parent.level!==-1&&cv(e,t.parent,s,o,i),t.setExpanded(s,void 0,i))}function _6(e,t){return e.rowModel.getRowNode(t)}function j6(e,t,s,o){e.rowRenderer.addRenderedRowListener(t,s,o)}function U6(e){return e.rowRenderer.getRenderedNodes()}function $6(e,t,s){e.rowModel.forEachNode(t,s)}function q6(e){return e.rowRenderer.firstRenderedRow}function K6(e){return e.rowRenderer.lastRenderedRow}function Y6(e,t){return e.rowModel.getRow(t)}function Z6(e){return e.rowModel.getRowCount()}var X6={moduleName:"RowApi",version:Z,apiFunctions:{redrawRows:W6,setRowNodeExpanded:cv,getRowNode:_6,addRenderedRowListener:j6,getRenderedNodes:U6,forEachNode:$6,getFirstDisplayedRowIndex:q6,getLastDisplayedRowIndex:K6,getDisplayedRowAtIndex:Y6,getDisplayedRowCount:Z6}},Q6={moduleName:"ScrollApi",version:Z,apiFunctions:{getVerticalPixelRange:dM,getHorizontalPixelRange:uM,ensureColumnVisible:YC,ensureIndexVisible:ZC,ensureNodeVisible:hM}};function J6(e,t,s){if(!t)return;const o=e.ctrlsSvc.getGridBodyCtrl().eGridBody,i=`aria-${t}`;s===null?o.removeAttribute(i):o.setAttribute(i,s)}function ek(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function tk(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function sk(e){return e.animationFrameSvc?.isQueueEmpty()??!0}function ok(e){e.animationFrameSvc?.flushAllFrames()}function ik(e){return{rowHeight:Fo(e),headerHeight:hr(e)}}function nk(e,t={}){const s=[];for(const n of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const r=n.getCellRenderer();r!=null&&s.push(Xn(r))}if(t.columns?.length)return s;const o=[],i=Hd(t.rowNodes);for(const n of e.rowRenderer.getAllRowCtrls()){if(i&&!Gd(n.rowNode,i)||!n.isFullWidth())continue;const r=n.getFullWidthCellRenderers();for(let a=0;a<r.length;a++){const l=r[a];l!=null&&o.push(Xn(l))}}return[...o,...s]}var rk={moduleName:"RenderApi",version:Z,apiFunctions:{setGridAriaProperty:J6,refreshCells:ek,refreshHeader:tk,isAnimationFrameQueueEmpty:sk,flushAllAnimationFrames:ok,getSizesForCurrentTheme:ik,getCellRendererInstances:nk}};function ak(e,t){typeof t=="number"?e.colAutosize?.sizeColumnsToFit(t,"api"):e.colAutosize?.sizeColumnsToFitGridBody(t)}function dv({colAutosize:e,visibleCols:t},s,o){Array.isArray(s)?e?.autoSizeCols({colKeys:s,skipHeader:o,source:"api"}):e?.autoSizeCols({...s,colKeys:s.colIds??t.allCols,source:"api"})}function lk(e,t){t&&typeof t=="object"?dv(e,t):e.colAutosize?.autoSizeAllColumns({source:"api",skipHeader:t})}var ck=class extends O{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let s=!1;const o=t.type;if(o==="fitGridWidth"||o==="fitProvidedWidth")s=!0;else if(o==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const i=e.get("rowData");s=i!=null&&i.length>0&&Qe(e)}s&&this.beans.colDelayRenderSvc?.hideColumns(o)}}autoSizeCols(e){const{eventSvc:t,visibleCols:s}=this.beans;this.innerAutoSizeCols(e).then(o=>{const i=c=>Oi(t,Array.from(c),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return i(o);const n=ap(this.beans),r=c=>s.leftCols.some(d=>On(d,c)),a=c=>s.rightCols.some(d=>On(d,c)),l=e.colKeys.filter(c=>!Vs(c)&&!As(c)&&!r(c)&&!a(c));this.sizeColumnsToFit(n,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:e.columnLimits?.map(c=>({...c,key:c.colId})),colKeys:l,onlyScaleUp:!0}),i(o)})}innerAutoSizeCols(e){return new Promise((t,s)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,s));const{colKeys:o,skipHeader:i,skipHeaderGroups:n,stopAtGroup:r,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:d="api"}=e,{animationFrameSvc:u,renderStatus:h,colModel:p,autoWidthCalc:m,visibleCols:C}=this.beans;if(u?.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,s)});return}this.timesDelayed=0;const v=new Set;let w=-1;const b=Object.fromEntries(c.map(({colId:y,...F})=>[y,F])),S=i??this.gos.get("skipHeaderOnAutoSize"),x=n??S;for(;w!==0;){w=0;const y=[];for(const F of o){if(!F||xy(F))continue;const R=p.getCol(F);if(!R||v.has(R))continue;const E=m.getPreferredWidthForColumn(R,S);if(E>0){const D=b[R.colId]??{};D.minWidth??(D.minWidth=l),D.maxWidth??(D.maxWidth=a);const P=dk(R,E,D);R.setActualWidth(P,d),v.add(R),w++}y.push(R)}y.length&&C.refresh(d)}x||this.autoSizeColumnGroupsByColumns(o,d,r),t(v)})}autoSizeColumn(e,t,s){this.autoSizeCols({colKeys:[e],skipHeader:s,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,s){const{colModel:o,ctrlsSvc:i}=this.beans,n=new Set,r=o.getColsForKeys(e);for(const l of r){let c=l.getParent();for(;c&&c!=s;)c.isPadding()||n.add(c),c=c.getParent()}let a;for(const l of n){for(const c of i.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a?.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const s=this.gos.get("skipHeaderOnAutoSize"),o=()=>{this.autoSizeColumn(t,"uiColumnResized",s)};e.addEventListener("dblclick",o);const i=new fo(e);return i.addEventListener("doubleTap",o),()=>{e.removeEventListener("dblclick",o),i.destroy()}}addColumnGroupResize(e,t,s){const o=this.gos.get("skipHeaderOnAutoSize"),i=()=>{const n=[],r=t.getDisplayedLeafColumns();for(const a of r)a.getColDef().suppressAutoSize||n.push(a.getColId());n.length>0&&this.autoSizeCols({colKeys:n,skipHeader:o,stopAtGroup:t,source:"uiColumnResized"}),s()};return e.addEventListener("dblclick",i),()=>e.removeEventListener("dblclick",i)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const s=ap(this.beans);if(s>0){this.sizeColumnsToFit(s,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):z(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",s,o){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,s,o));return}const i={};for(const{key:m,...C}of o?.columnLimits??[])i[typeof m=="string"?m:m.getColId()]=C;const n=this.beans.visibleCols.allCols;if(e<=0||!n.length)return;const r=Ts(n);if(o?.onlyScaleUp&&r>e||e===r&&n.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const v=i?.[C.getId()],w=v?.minWidth??o?.defaultMinWidth,b=v?.maxWidth??o?.defaultMaxWidth,S=C.getActualWidth();return(w==null||S>=w)&&(b==null||S<=b)}))return;const l=[],c=[];for(const m of n){const C=o?.colKeys?.some(v=>On(m,v))??!0;m.getColDef().suppressSizeToFit||!C?c.push(m):l.push(m)}const d=l.slice(0);let u=!1;const h=m=>{as(l,m),c.push(m)};for(const m of l){m.resetActualWidth(t);const C=i?.[m.getId()],v=C?.minWidth??o?.defaultMinWidth,w=C?.maxWidth??o?.defaultMaxWidth,b=m.getActualWidth();typeof v=="number"&&b<v?m.setActualWidth(v,t,!0):typeof w=="number"&&b>w&&m.setActualWidth(w,t,!0)}for(;!u;){u=!0;const m=e-Ts(c);if(m<=0)for(const C of l){const v=i?.[C.getId()]?.minWidth??o?.defaultMinWidth??C.minWidth;C.setActualWidth(v,t,!0)}else{const C=m/Ts(l);let v=m;for(let w=l.length-1;w>=0;w--){const b=l[w],S=i?.[b.getId()],x=S?.minWidth??o?.defaultMinWidth,y=S?.maxWidth??o?.defaultMaxWidth,F=b.getMinWidth(),R=b.getMaxWidth(),E=typeof x=="number"&&x>F?x:F,D=typeof y=="number"&&y<R?y:R;let P=Math.round(b.getActualWidth()*C);P<E?(P=E,h(b),u=!1):P>D?(P=D,h(b),u=!1):w===0&&(P=v),b.setActualWidth(P,t,!0),v-=P}}}for(const m of d)m.fireColumnWidthChangedEvent(t);const p=this.beans.visibleCols;p.setLeftValues(t),p.updateBodyWidths(),!s&&Oi(this.eventSvc,d,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,s=e.get("autoSizeStrategy");s?.type!=="fitGridWidth"&&s?.type!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const o=s.type;if(o==="fitGridWidth"){const{columnLimits:i,defaultMinWidth:n,defaultMaxWidth:r}=s,a=i?.map(({colId:l,minWidth:c,maxWidth:d})=>({key:l,minWidth:c,maxWidth:d}));this.sizeColumnsToFitGridBody({defaultMinWidth:n,defaultMaxWidth:r,columnLimits:a})}else o==="fitProvidedWidth"&&this.sizeColumnsToFit(s.width,"sizeColumnsToFit");t?.revealColumns(o)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{if(!this.isAlive())return;const s="autosizeColumns";e?this.autoSizeCols({...t,source:s,colKeys:e}):this.autoSizeAllColumns({...t,source:s}),this.beans.colDelayRenderSvc?.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function dk(e,t,s={}){const o=s.minWidth??e.getMinWidth();t<o&&(t=o);const i=s.maxWidth??e.getMaxWidth();return t>i&&(t=i),t}function ap({ctrlsSvc:e,scrollVisibleSvc:t}){const s=e.getGridBodyCtrl(),i=s.isVerticalScrollShowing()?t.getScrollbarWidth():0;return qn(s.eGridBody)-i}var uk={moduleName:"ColumnAutoSize",version:Z,beans:[ck],apiFunctions:{sizeColumnsToFit:ak,autoSizeColumns:dv,autoSizeAllColumns:lk},dependsOn:[iC]},hk=".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}";function gk(e){return e.pinnedRowModel?.getPinnedTopRowCount()??0}function pk(e){return e.pinnedRowModel?.getPinnedBottomRowCount()??0}function fk(e,t){return e.pinnedRowModel?.getPinnedTopRow(t)}function mk(e,t){return e.pinnedRowModel?.getPinnedBottomRow(t)}function Ck(e,t,s){return e.pinnedRowModel?.forEachPinnedRow(t,s)}var vk={moduleName:"PinnedRow",version:Z,beans:[RF],css:[hk],apiFunctions:{getPinnedTopRowCount:gk,getPinnedBottomRowCount:pk,getPinnedTopRow:fk,getPinnedBottomRow:mk,forEachPinnedRow:Ck},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},wk=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){const e=this.firstNode.__autoHeights?.[this.col.getColId()];if(e==null)return;let t=0;for(const s of this.spannedNodes)s!==this.lastNode&&(t+=s.rowHeight);return e-t}},bk=class extends O{constructor(e){super(),this.column=e}buildCache(e){const{column:t,beans:{gos:s,pinnedRowModel:o,rowModel:i,valueSvc:n,pagination:r}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,d=s.getCallback("isFullWidthRow"),u=a.equals,h=a.spanRows,p=typeof h=="function";let m=null,C=null,v;const w=(S,x)=>{m=S,C=null,v=x},b=S=>{const x=!S.isExpandable()&&!S.group&&!S.detail&&(d?!d({rowNode:S}):!0);if(S.rowIndex==null||!x){w(null,null);return}if(m==null||S.level!==m.level||S.footer||C&&S.rowIndex-1!==C?.getLastNode().rowIndex){w(S,n.getValue(t,S));return}const y=n.getValue(t,S);if(p){const F=we(s,{valueA:v,nodeA:m,valueB:y,nodeB:S,column:t,colDef:a});if(!h(F)){w(S,y);return}}else if(u?!u(v,y):v!==y){w(S,y);return}if(!C){const F=l?.get(m);F?.firstNode===m?(F.reset(),C=F):C=new wk(t,m),c.set(m,C)}C.addSpannedNode(S),c.set(S,C)};switch(e){case"center":i.forEachDisplayedNode?.(S=>{(!r||r.isRowInPage(S.rowIndex))&&b(S)}),this.centerValueNodeMap=c;break;case"top":o?.forEachPinnedRow("top",b),this.topValueNodeMap=c;break;case"bottom":o?.forEachPinnedRow("bottom",b),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},Sk=class extends O{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=lt(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=lt(this,this.dispatchCellsUpdatedEvent.bind(this,!1),0),this.pinnedTimeout=null,this.modelTimeout=null}postConstruct(){const e=this.onRowDataUpdated.bind(this),t=this.buildPinnedCaches.bind(this);this.addManagedEventListeners({paginationChanged:this.buildModelCaches.bind(this),pinnedRowDataChanged:t,pinnedRowsChanged:t,rowNodeDataChanged:e,cellValueChanged:e})}register(e){const{gos:t}=this.beans;if(!t.get("enableCellSpan")||this.spanningColumns.has(e))return;const s=this.createManagedBean(new bk(e));this.spanningColumns.set(e,s),s.buildCache("top"),s.buildCache("bottom"),s.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t?.createCtrls("top"),t?.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t?.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const s=this.spanningColumns.get(e);return s?s.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:s}=this.beans,o=e.column,i=e.rowIndex,n=this.spanningColumns.get(o);if(!n)return;let r;switch(e.rowPinned){case"top":r=t?.getPinnedTopRow(i);break;case"bottom":r=t?.getPinnedBottomRow(i);break;default:r=s.getRow(i)}if(r)return n.getCellSpan(r)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const s=this.spanningColumns.get(e);if(s)return s.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[s,o]of this.spanningColumns)if(o.isCellSpanning(e)){const i=o.getCellSpan(e);t(s,i)}}destroy(){super.destroy(),this.spanningColumns.clear()}},yk=class extends Mi{constructor(e,t,s){super(e.col,e.firstNode,s,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,s,o,i,n,r){this.eWrapper=s,super.setComp(e,t,s,o,i,n,r),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||uf(e,t.rowIndex)}setAriaRowSpan(){mS(this.eGui,this.cellSpan.spannedNodes.size)}setFocusedCellPosition(e){this.focusedCellPosition=e}getFocusedCellPosition(){return this.focusedCellPosition??this.cellPosition}checkCellFocused(){const e=this.beans.focusSvc.getFocusedCell();return!!e&&this.cellSpan.doesSpanContain(e)}applyStaticCssClasses(){super.applyStaticCssClasses(),this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS,!0)}onCellFocused(e){const{beans:t}=this;if(pl(t)){this.focusedCellPosition=void 0;return}const s=this.isCellFocused();s||(this.focusedCellPosition=void 0),e&&s&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},xk=class extends qa{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){const t=this.beans.rowSpanSvc?.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new yk(t,this,this.beans)}isCorrectCtrlForSpan(e){const t=this.beans.rowSpanSvc?.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},Rk=class extends O{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,s=this.getCtrlsMap(e),o=s.size,i=this.getAllRelevantRowControls(e),n=new Map;let r=!1;for(const l of i)l.isAlive()&&t?.forEachSpannedColumn(l.rowNode,(c,d)=>{if(n.has(d.firstNode))return;const u=s.get(d.firstNode);if(u){n.set(d.firstNode,u),s.delete(d.firstNode);return}r=!0;const h=new xk(d.firstNode,this.beans,!1,!1,!1);n.set(d.firstNode,h)});this.setCtrlsMap(e,n);const a=n.size===o;if(!(!r&&a)){for(const l of s.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,s=t?.getCellSpanByPosition(e);if(!s)return;const o=this.getCtrlsMap(e.rowPinned).get(s.firstNode);if(o)return o.getAllCellCtrls().find(i=>i.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},Fk={moduleName:"CellSpan",version:Z,beans:[Sk,Rk]},Ek=class extends O{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,s=e.colDef,o=s.cellClassRules,i=this.getCellClassParams(e,s);ju(this.beans.expressionSvc,o===this.cellClassRules?void 0:this.cellClassRules,o,i,n=>t.toggleCss(n,!0),n=>t.toggleCss(n,!1)),this.cellClassRules=o}applyUserStyles(){const e=this.column,t=e.colDef,s=t.cellStyle;if(!s)return;let o;if(typeof s=="function"){const i=this.getCellClassParams(e,t);o=s(i)}else o=s;o&&this.cellComp.setUserStyles(o)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,s=e.colDef,o=this.getCellClassParams(e,s);for(const n of this.staticClasses)t.toggleCss(n,!1);const i=this.beans.cellStyles.getStaticCellClasses(s,o);this.staticClasses=i;for(const n of i)t.toggleCss(n,!0)}getCellClassParams(e,t){const{value:s,rowNode:o}=this.cellCtrl;return we(this.beans.gos,{value:s,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},Dk=class extends O{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,s,o){ju(this.beans.expressionSvc,void 0,e.cellClassRules,t,s,o),this.processStaticCellClasses(e,t,s)}getStaticCellClasses(e,t){const{cellClass:s}=e;if(!s)return[];let o;return typeof s=="function"?o=s(t):o=s,typeof o=="string"&&(o=[o]),o||[]}createCellCustomStyleFeature(e,t){return new Ek(e,t)}processStaticCellClasses(e,t,s){this.getStaticCellClasses(e,t).forEach(i=>{s(i)})}},Pk={moduleName:"CellStyle",version:Z,beans:[Dk]},Tk={moduleName:"RowStyle",version:Z,beans:[p5]};function Mk(e,t){return!!e.colHover?.isHovered(t)}var Ik=class extends O{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=s=>{const{beans:o,gos:i,element:n,columns:r}=this,a=o.colHover;if(s??!!i.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(n,{mouseover:a.setMouseOver.bind(a,r),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},kk="ag-column-hover",Ak=class extends O{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,s){const o=()=>{const i=this.isHovered(s);t.toggleCss("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:o}),o()}onCellColumnHover(e,t){if(!t)return;const s=this.isHovered(e);t.toggleCss(kk,s)}addHeaderFilterColumnHoverListener(e,t,s,o){this.createHoverFeature(e,[s],o);const i=()=>{const n=this.isHovered(s);t.toggleCss("ag-column-hover",n)};e.addManagedEventListeners({columnHoverChanged:i}),i()}createHoverFeature(e,t,s){e.createManagedBean(new Ik(t,s))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},Lk={moduleName:"ColumnHover",version:Z,beans:[Ak],apiFunctions:{isColumnHovered:Mk}},Ok=class extends O{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){this.wrapSvc=this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.()}addListener(e,t){const s=this.wrapSvc?.wrap(e,t)??t,o=!Sa.has(e),i=o?this.asyncListeners:this.syncListeners;i.has(e)||i.set(e,new Set),i.get(e).add(s),this.eventSvc.addListener(e,s,o)}removeListener(e,t){const s=this.wrapSvc?.unwrap(e,t)??t,i=!!this.asyncListeners.get(e)?.delete(s);i||this.syncListeners.get(e)?.delete(s),this.eventSvc.removeListener(e,s,i)}addGlobalListener(e){const t=this.wrapSvc?.wrapGlobal(e)??e,s=(n,r)=>{Sa.has(n)&&t(n,r)},o=(n,r)=>{Sa.has(n)||t(n,r)};this.globalListenerPairs.set(e,{syncListener:s,asyncListener:o});const i=this.eventSvc;i.addGlobalListener(s,!1),i.addGlobalListener(o,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:s,globalListenerPairs:o}=this,i=s?.unwrapGlobal(e)??e;if(o.has(i)){const{syncListener:r,asyncListener:a}=o.get(i);t.removeGlobalListener(r,!1),t.removeGlobalListener(a,!0),o.delete(e)}else this.syncGlobalListeners.delete(i),t.removeGlobalListener(i,!1)}destroyEventListeners(e,t){e.forEach((s,o)=>{s.forEach(i=>this.eventSvc.removeListener(o,i,t)),s.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const s of e)this.eventSvc.removeGlobalListener(s,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:s,asyncListener:o})=>{t.removeGlobalListener(s,!1),t.removeGlobalListener(o,!0)}),e.clear()}};function Nk(e,t,s){e.apiEventSvc?.addListener(t,s)}function Hk(e,t,s){e.apiEventSvc?.removeListener(t,s)}function Gk(e,t){e.apiEventSvc?.addGlobalListener(t)}function Bk(e,t){e.apiEventSvc?.removeGlobalListener(t)}var Vk={moduleName:"EventApi",version:Z,apiFunctions:{addEventListener:Nk,addGlobalListener:Gk,removeEventListener:Hk,removeGlobalListener:Bk},beans:[Ok]},zk={moduleName:"Locale",version:Z,beans:[p4]},Wk=class extends O{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=lt(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){const{visibleCols:e,rowModel:t,rowSpanSvc:s,pinnedRowModel:o}=this.beans,i=e.autoHeightCols;let n=!1;const r=a=>{const l=a.__autoHeights;let c=to(this.beans,a).height;for(const d of i){let u=l?.[d.getColId()];const h=s?.getCellSpan(d,a);if(h){if(h.getLastNode()!==a)continue;if(u=s?.getCellSpan(d,a)?.getLastNodeAutoHeight(),!u)return}if(u==null){if(this.colSpanSkipCell(d,a))continue;return}c=Math.max(u,c)}c!==a.rowHeight&&(a.setRowHeight(c),n=!0)};o?.forEachPinnedRow?.("top",r),o?.forEachPinnedRow?.("bottom",r),t.forEachDisplayedNode?.(r),n&&t.onRowHeightChanged?.()}setRowAutoHeight(e,t,s){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[s.getId()];return}const o=e.__autoHeights[s.getId()];e.__autoHeights[s.getId()]=t,o!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:s,colViewport:o,visibleCols:i}=this.beans;if(!s.colSpanActive)return!1;let n=[];switch(e.getPinned()){case"left":n=i.getLeftColsForRow(t);break;case"right":n=i.getRightColsForRow(t);break;case null:n=o.getColsWithinViewport(t);break}return!n.includes(e)}setupCellAutoHeight(e,t,s){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:i,column:n}=e,r=this.beans,a=d=>{if(this.beans.editSvc?.isEditing(e)||!e.isAlive()||!s.isAlive())return;const{paddingTop:u,paddingBottom:h,borderBottomWidth:p,borderTopWidth:m}=Vo(o),C=u+h+p+m,w=t.offsetHeight+C;if(d<5){const S=!dt(r)?.contains(t),x=w==0;if(S||x){window.setTimeout(()=>a(d+1),0);return}}this.setRowAutoHeight(i,w,n)},l=()=>a(0);l();const c=Gs(r,t,l);return s.addDestroyFunc(()=>{c(),this.setRowAutoHeight(i,void 0,n)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:s}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(s).filter(i=>i.isAutoHeight())),t.length!==0){if(!s.__autoHeights)return!1;for(const o of t){const i=s.__autoHeights[o.getColId()];if(!i||s.rowHeight<i)return!1}}return!0}},_k={moduleName:"RowAutoHeight",version:Z,beans:[Wk]},jk={moduleName:"AllCommunity",version:Z,dependsOn:[WI,ZI,r6,A4,_M,jM,UM,$M,qM,KM,YM,WM,OT,NT,HT,LT,BT,VT,y6,bI,z6,nC,X6,Q6,rk,uk,SE,vk,dI,Z5,Pk,Lk,Tk,Vk,J5,m6,KC,zk,_k,bE,_I,Fk]};function ae(e,t={}){const s=Object.keys(t).map(o=>{const i=t[o];return i!=null?`${o}=${i}`:null}).filter(Boolean).join(";");return[e,s].filter(o=>o.length>0).join(":")}var ee={grid(e){return ae("ag-grid-root",{gridId:e})},headerGroupCell(e){return ae("ag-header-group-cell",{colId:e})},headerCell(e){return ae("ag-header-cell",{colId:e})},headerCheckbox(e){return ae("ag-header-selection-checkbox",{colId:e})},headerFilterButton(e){return ae("ag-header-cell-filter-button",{colId:e})},floatingFilter(e){return ae("ag-floating-filter",{colId:e})},floatingFilterButton(e){return ae("ag-floating-filter-button",{colId:e})},headerCellMenuButton(e){return ae("ag-header-cell-menu-button",{colId:e})},headerResizeHandle(e){return ae("ag-header-cell-resize",{colId:e})},filterInstancePickerDisplay(e){return ae(`ag-${e.source}-picker-display`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},numberFilterInstanceInput(e){return ae(`ag-${e.source}-number-input`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},textFilterInstanceInput(e){return ae(`ag-${e.source}-text-input`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},dateFilterInstanceInput(e){return ae(`ag-${e.source}-date-input`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},setFilterInstanceMiniFilterInput(e){return ae(`ag-${e.source}-set-filter-mini-filter-input`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},setFilterInstanceItem(e,t){return ae(`ag-${e.source}-set-filter-item`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,itemLabel:t}:{colId:e.colId,itemLabel:t})},setFilterApplyPanelButton(e,t){return ae(`ag-${e.source}-set-filter-apply-panel-button`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,buttonLabel:t}:{colId:e.colId,buttonLabel:t})},filterConditionRadioButton(e,t){return ae(`ag-${e.source}-filter-condition-radio-button`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,buttonLabel:t}:{colId:e.colId,buttonLabel:t})},advancedFilterInput(){return ae("ag-advanced-filter-input")},advancedFilterButton(e){return ae("ag-advanced-filter-button",{label:e})},advancedFilterBuilderButton(){return ae("ag-advanced-filter-builder-button")},advancedFilterPanelMaximiseButton(){return ae("ag-advanced-filter-builder-panel-maximise")},advancedFilterPanelCloseButton(){return ae("ag-advanced-filter-builder-panel-close")},advancedFilterPill(e){return ae("ag-advanced-filter-builder-pill",{label:e})},advancedFilterBuilderAddItemButton(){return ae("ag-advanced-filter-builder-add-item-button")},rowNode(e){return ae("ag-row",{"row-id":e})},cell(e,t){return ae("ag-cell",{"row-id":e,colId:t})},autoGroupCell(e){return ee.cell(e,Xs)},checkbox(e,t){return ae("ag-selection-checkbox",{"row-id":e,colId:t})},selectionColumnCheckbox(e){return ee.checkbox(e,Cu)},autoGroupColumnCheckbox(e){return ee.checkbox(e,Xs)},dragHandle(e,t){return ae("ag-drag-handle",{"row-id":e,colId:t})},groupContracted(e,t){return ae("ag-group-contracted",{"row-id":e,colId:t})},groupExpanded(e,t){return ae("ag-group-expanded",{"row-id":e,colId:t})},autoGroupContracted(e){return ee.groupContracted(e,Xs)},autoGroupExpanded(e){return ee.groupExpanded(e,Xs)},rowNumber(e){return ee.cell(e,vu)},menu(){return ae("ag-menu")},menuOption(e){return ae("ag-menu-option",{option:e})},sideBar(){return ae("ag-side-bar")},sideBarButton(e){return ae("ag-side-button",{label:e})},columnToolPanel(){return ae("ag-column-panel")},pivotModeSelect(){return ae("ag-pivot-mode-select")},columnPanelSelectHeaderCheckbox(){return ae("ag-column-panel-select-header-checkbox")},columnPanelSelectHeaderFilter(){return ae("ag-column-panel-select-header-filter")},columnSelectListItemGroupClosedIcon(e){return ae("ag-column-select-list-item-group-closed-icon",{label:e})},columnSelectListItemCheckbox(e){return ae("ag-column-select-list-item-checkbox",{label:e})},columnSelectListItemDragHandle(e){return ae("ag-column-select-list-item-drag-handle",{label:e})},columnDropCellDragHandle(e,t,s){return ae("ag-column-drop-cell-drag-handle",{source:e,area:t,label:s})},columnDropCellCancelButton(e,t,s){return ae("ag-column-drop-cell-cancel",{source:e,area:t,label:s})},columnDropArea(e,t){return ae("ag-column-drop-area",{source:e,name:t})},filterToolPanel(){return ae("ag-filter-panel")},filterToolPanelAddFilterButton(){return ae("ag-filter-panel-add-filter-button")},filterToolPanelFilterTypeSelector(e){return ae("ag-filter-panel-filter-type-selector",{colLabel:e})},filterToolPanelSearchInput(){return ae("ag-filter-toolpanel-search-input")},filterToolPanelGroup(e){return ae("ag-filter-toolpanel-group",{title:e})},filterToolPanelGroupCollapsedIcon(e){return ae("ag-filter-toolpanel-group-collapsed-icon",{title:e})},statusBarTotalAndFilteredRowCount(){return ae("ag-status-bar-total-and-filtered-row-count")},statusBarTotalRowCount(){return ae("ag-status-bar-total-row-count")},statusBarFilteredRowCount(){return ae("ag-status-bar-filtered-row-count")},statusBarSelectedRowCount(){return ae("ag-status-bar-selected-row-count")},statusBarAggregations(){return ae("ag-status-bar-aggregations")},paginationPanelSizePickerDisplay(e){return ae("ag-pagination-page-size-picker-field-display",{value:e})},paginationPanelFirstRowOnPage(e){return ae("ag-paging-row-summary-panel-first-row-on-page",{value:e})},paginationPanelLastRowOnPage(e){return ae("ag-paging-row-summary-panel-last-row-on-page",{value:e})},paginationPanelRecordCount(e){return ae("ag-paging-row-summary-panel-record-count",{value:e})},paginationSummaryPanelButton(e){return ae("ag-paging-page-summary-panel-btn",{label:e})},paginationSummaryPanelCurrentPage(e){return ae("ag-paging-page-summary-panel-current-page",{value:e})},paginationSummaryPanelTotalPage(e){return ae("ag-paging-page-summary-panel-total-page",{value:e})},fillHandle(){return ae("ag-fill-handle")},columnChooserCloseButton(){return ae("ag-column-chooser-close-button")},columnChooserSearchBarCheckbox(){return ae("ag-column-chooser-header-checkbox")},columnChooserSearchBarFilter(){return ae("ag-column-chooser-searchbar-filter")},columnChooserListItemGroupClosedIcon(e){return ae("ag-column-chooser-list-item-group-closed-icon",{label:e})},columnChooserListItemCheckbox(e){return ae("ag-column-chooser-list-item-checkbox",{label:e})},columnChooserListItemDragHandle(e){return ae("ag-column-chooser-list-item-drag-handle",{label:e})},overlay(){return ae("ag-overlay")}},uv="data-testid";function ce(e,t){e?.setAttribute(uv,t)}function Uk(e){uv=e}var $k=class extends O{constructor(){super(...arguments),this.beanName="testIdSvc"}postConstruct(){const e=lt(this,()=>this.setupAllTestIds(),500),t=lt(this,()=>{this.setupAllTestIds(),e()},0);this.addManagedEventListeners({firstDataRendered:t,displayedRowsChanged:t,displayedColumnsChanged:t,displayedColumnsWidthChanged:t,virtualColumnsChanged:t,columnMenuVisibleChanged:t,contextMenuVisibleChanged:t,advancedFilterBuilderVisibleChanged:t,fieldPickerValueSelected:t,modelUpdated:t,sideBarUpdated:t,pinnedHeightChanged:t,gridReady:t,overlayExclusiveChanged:t,rowGroupOpened:t,scrollVisibilityChanged:t,gridSizeChanged:t,filterOpened:t,filterChanged:t,cellSelectionChanged:t})}setupAllTestIds(){const e=os(this.beans),t=Zm(this.beans),s=e.querySelector(`[grid-id="${t}"]`);ce(s,ee.grid(t)),e.querySelectorAll(".ag-header-group-cell").forEach(n=>{ce(n,ee.headerGroupCell(n.getAttribute("col-id")))}),e.querySelectorAll(".ag-header-cell").forEach(n=>{const r=n.getAttribute("col-id"),l=n.classList.contains("ag-floating-filter")?ee.floatingFilter(r):ee.headerCell(r);ce(n,l),ce(n.querySelector(".ag-header-cell-filter-button"),ee.headerFilterButton(r)),ce(n.querySelector(".ag-header-cell-menu-button"),ee.headerCellMenuButton(r)),ce(n.querySelector(".ag-header-cell-resize"),ee.headerResizeHandle(r)),ce(n.querySelector(".ag-checkbox input[type=checkbox]"),ee.headerCheckbox(r)),ce(n.querySelector(".ag-floating-filter-button button"),ee.floatingFilterButton(r)),this.setupFilterInstance(n.querySelector(".ag-floating-filter-body"),{source:"floating-filter",colId:r})});const o=e.querySelector(".ag-filter-menu");this.setupFilterInstance(o,{source:"column-filter"}),ce(e.querySelector(".ag-advanced-filter input[type=text]"),ee.advancedFilterInput()),e.querySelectorAll(".ag-advanced-filter-buttons button").forEach(n=>{ce(n,ee.advancedFilterButton(n.textContent))}),ce(e.querySelector("button.ag-advanced-filter-builder-button"),ee.advancedFilterBuilderButton()),e.querySelectorAll('.ag-panel[aria-label="Advanced Filter"] .ag-panel-title-bar-button').forEach((n,r)=>{ce(n,r===0?ee.advancedFilterPanelMaximiseButton():ee.advancedFilterPanelCloseButton())}),e.querySelectorAll('.ag-panel[aria-lable="Advanced Filter"] .ag-advanced-filter-builder-pill').forEach(n=>{ce(n,ee.advancedFilterPill(n.querySelector(".ag-picker-field-display")?.textContent))}),ce(e.querySelector('.ag-panel[aria-label="Advanced Filter"] .ag-advanced-filter-builder-item-button'),ee.advancedFilterBuilderAddItemButton()),e.querySelectorAll(".ag-row").forEach(n=>{const r=n.getAttribute("row-id");ce(n,ee.rowNode(r)),n.querySelectorAll(".ag-cell").forEach(a=>{const l=a.getAttribute("col-id");ce(a,ee.cell(r,l)),ce(a.querySelector(".ag-selection-checkbox input[type=checkbox]"),ee.checkbox(r,l)),ce(a.querySelector(".ag-drag-handle"),ee.dragHandle(r,l)),ce(a.querySelector(".ag-group-contracted"),ee.groupContracted(r,l)),ce(a.querySelector(".ag-group-expanded"),ee.groupExpanded(r,l))})}),e.querySelectorAll(".ag-menu-list").forEach(n=>{ce(n,ee.menu()),n.querySelectorAll(".ag-menu-option").forEach(r=>{ce(r,ee.menuOption(r.querySelector(".ag-menu-option-text")?.textContent))})}),e.querySelectorAll(".ag-side-bar").forEach(n=>{ce(n,ee.sideBar()),n.querySelectorAll(".ag-side-button button").forEach(r=>{ce(r,ee.sideBarButton(r.querySelector(".ag-side-button-label")?.textContent))}),n.querySelectorAll(".ag-column-panel").forEach(r=>{ce(r,ee.columnToolPanel()),ce(r.querySelector(".ag-pivot-mode-select input[type=checkbox]"),ee.pivotModeSelect()),ce(r.querySelector(".ag-column-select-header-checkbox input[type=checkbox]"),ee.columnPanelSelectHeaderCheckbox()),ce(r.querySelector(".ag-column-select-header-filter-wrapper input[type=text]"),ee.columnPanelSelectHeaderFilter()),r.querySelectorAll(".ag-column-select-list").forEach(a=>{a.querySelectorAll(".ag-column-select-virtual-list-item").forEach(l=>{const c=l.getAttribute("aria-label");ce(l.querySelector(".ag-column-group-closed-icon"),ee.columnSelectListItemGroupClosedIcon(c)),ce(l.querySelector(".ag-column-select-checkbox input[type=checkbox]"),ee.columnSelectListItemCheckbox(c)),ce(l.querySelector(".ag-drag-handle"),ee.columnSelectListItemDragHandle(c))})}),this.setupColumnDropArea(r,"toolbar")}),n.querySelectorAll(".ag-filter-panel").forEach(r=>{ce(r,ee.filterToolPanel()),ce(r.querySelector("button.ag-filter-add-button"),ee.filterToolPanelAddFilterButton()),r.querySelectorAll(".ag-filter-card").forEach(a=>{const l=a.querySelector(".ag-filter-card-title")?.textContent,c=a.querySelector(".ag-filter-type-select");ce(c,ee.filterToolPanelFilterTypeSelector(l)),a.querySelectorAll(".ag-filter").forEach(d=>this.setupFilterInstance(d,{source:"filter-toolpanel",colLabel:l}))})}),n.querySelectorAll(".ag-filter-toolpanel").forEach(r=>{ce(r.querySelector(".ag-filter-toolpanel-search-input input[type=text]"),ee.filterToolPanelSearchInput()),r.querySelectorAll(".ag-filter-toolpanel-group").forEach(a=>{const l=a.querySelector(".ag-filter-toolpanel-group-title")?.textContent;ce(a,ee.filterToolPanelGroup(l)),ce(a.querySelector(".ag-filter-toolpanel-group-title-bar-icon .ag-icon-tree-closed"),ee.filterToolPanelGroupCollapsedIcon(l));const c=a.querySelector(".ag-filter-toolpanel-instance-filter");c&&this.setupFilterInstance(c,{source:"filter-toolpanel",colLabel:l})})})}),ce(e.querySelector(".ag-status-bar .ag-status-panel-total-and-filtered-row-count"),ee.statusBarTotalAndFilteredRowCount()),ce(e.querySelector(".ag-status-bar .ag-status-panel-total-row-count"),ee.statusBarTotalRowCount()),ce(e.querySelector(".ag-status-bar .ag-status-panel-filtered-row-count"),ee.statusBarFilteredRowCount()),ce(e.querySelector(".ag-status-bar .ag-status-panel-selected-row-count"),ee.statusBarSelectedRowCount()),ce(e.querySelector(".ag-status-bar .ag-status-panel-filtered-row-count"),ee.statusBarAggregations()),e.querySelectorAll(".ag-paging-panel").forEach(n=>{ce(n.querySelector(".ag-paging-page-size .ag-picker-field-display"),ee.paginationPanelSizePickerDisplay(n.querySelector(".ag-paging-page-size .ag-picker-field-display")?.textContent)),n.querySelectorAll(".ag-paging-row-summary-panel-number").forEach(r=>{switch(r.getAttribute("data-ref")){case"lbFirstRowOnPage":ce(r,ee.paginationPanelFirstRowOnPage(r.textContent));break;case"lbLastRowOnPage":ce(r,ee.paginationPanelLastRowOnPage(r.textContent));break;case"lbRecordCount":ce(r,ee.paginationPanelRecordCount(r.textContent));break}}),n.querySelectorAll(".ag-paging-page-summary-panel .ag-button").forEach(r=>{ce(r,ee.paginationSummaryPanelButton(r.getAttribute("aria-label")?.toLowerCase()))}),n.querySelectorAll(".ag-paging-page-summary-panel .ag-paging-number").forEach(r=>{switch(r.getAttribute("data-ref")){case"lbCurrent":ce(r,ee.paginationSummaryPanelCurrentPage(r.textContent));break;case"lbTotal":ce(r,ee.paginationSummaryPanelTotalPage(r.textContent));break}})}),ce(e.querySelector(".ag-fill-handle"),ee.fillHandle()),e.querySelectorAll('.ag-panel[aria-label="Choose Columns"]').forEach(n=>{ce(n.querySelector(".ag-panel-title-bar-button-icon"),ee.columnChooserCloseButton()),ce(n.querySelector('.ag-column-select-header-checkbox input[type="checkbox"]'),ee.columnChooserSearchBarCheckbox()),ce(n.querySelector('.ag-column-select-header-filter-wrapper input[type="text"]'),ee.columnChooserSearchBarFilter()),n.querySelectorAll(".ag-column-select-list").forEach(r=>{r.querySelectorAll(".ag-column-select-virtual-list-item").forEach(a=>{const l=a.getAttribute("aria-label");ce(a.querySelector(".ag-column-group-closed-icon"),ee.columnChooserListItemGroupClosedIcon(l)),ce(a.querySelector(".ag-column-select-checkbox input[type=checkbox]"),ee.columnChooserListItemCheckbox(l)),ce(a.querySelector(".ag-drag-handle"),ee.columnChooserListItemDragHandle(l))})})}),ce(e.querySelector(".ag-overlay-wrapper"),ee.overlay());const i=e.querySelector(".ag-column-drop-wrapper");i&&this.setupColumnDropArea(i,"panel")}setupFilterInstance(e,t){if(!e)return;e.querySelectorAll(".ag-filter-select .ag-picker-field-display").forEach(r=>{ce(r,ee.filterInstancePickerDisplay(t))});const s=e.querySelector('.ag-filter-body input[type="number"]');ce(s,ee.numberFilterInstanceInput(t));const o=e.querySelector('.ag-filter-body input[type="text"]');ce(o,ee.textFilterInstanceInput(t));const i=e.querySelector('.ag-filter-body input[type="date"]');ce(i,ee.dateFilterInstanceInput(t));const n=e.querySelector('.ag-mini-filter input[type="text"]');ce(n,ee.setFilterInstanceMiniFilterInput(t)),e.querySelectorAll(".ag-set-filter-list .ag-set-filter-item").forEach(r=>{const a=r.querySelector(".ag-checkbox-label")?.textContent,l=r.querySelector('input[type="checkbox"]');ce(l,ee.setFilterInstanceItem(t,a))}),e.querySelectorAll(".ag-filter-apply-panel button").forEach(r=>{ce(r,ee.setFilterApplyPanelButton(t,r.textContent))}),e.querySelectorAll(".ag-filter-condition .ag-radio-button").forEach(r=>{const a=r.querySelector(".ag-radio-button-label")?.textContent;ce(r.querySelector("input[type=radio]"),ee.filterConditionRadioButton(t,a))})}setupColumnDropArea(e,t){e.querySelectorAll(".ag-column-drop").forEach(s=>{const o=s.querySelector(".ag-column-drop-list")?.getAttribute("aria-label");ce(s,ee.columnDropArea(t,o)),s.querySelectorAll(".ag-column-drop-cell").forEach(i=>{const n=i.querySelector(".ag-column-drop-cell-text")?.textContent;ce(i.querySelector(".ag-drag-handle"),ee.columnDropCellDragHandle(t,o,n)),ce(i.querySelector(".ag-column-drop-cell-button .ag-icon-cancel"),ee.columnDropCellCancelButton(t,o,n))})})}},qk={moduleName:"Testing",version:Z,beans:[$k]};function Kk({testIdAttribute:e}={}){e&&Uk(e),Mf.registerModules([qk])}var Ct=g.createContext({}),hv=g.createContext("default"),pr=(e,t,s,o)=>{if(!e||e.componentFromFramework||t.isDestroyed())return;const n=e.newAgStackInstance();let r,a,l=!1;return n.then(c=>{if(l){t.destroyBean(c);return}r=c,a=r.getGui(),s.appendChild(a),lp(o,r)}),()=>{l=!0,r&&(a?.remove(),t.destroyBean(r),o&&lp(o,void 0))}},lp=(e,t)=>{if(e)if(e instanceof Function)e(t);else{const s=e;s.current=t}},Yt=(...e)=>e.filter(s=>s!=null&&s!=="").join(" "),es=class gv{constructor(...t){this.classesMap={};for(const s of t)this.classesMap[s]=!0}setClass(t,s){if(!!this.classesMap[t]==s)return this;const i=new gv;return i.classesMap={...this.classesMap},i.classesMap[t]=s,i}toString(){return Object.keys(this.classesMap).filter(s=>this.classesMap[s]).join(" ")}},Ki=e=>{const t=()=>typeof Symbol=="function"&&Symbol.for,s=()=>t()?Symbol.for("react.memo"):60115;return typeof e=="function"&&!(e.prototype&&e.prototype.isReactComponent)||typeof e=="object"&&e.$$typeof===s()},_d=g.version?.split(".")[0],pv=_d==="16"||_d==="17";function Yk(){return _d==="19"}var xa=!1;function Zk(e){return xa||setTimeout(()=>xa=!1,0),xa=!0,e()}var sr=(e,t)=>{!pv&&e&&!xa?zi.flushSync(t):t()},Xk=e=>{pv?e():g.startTransition(e)};function Qk(e,t,s){return g.useSyncExternalStore?g.useSyncExternalStore(e,t):s}function Za(e,t,s){if(t==null||e==null)return t;if(e===t||t.length===0&&e.length===0)return e;if(s||e.length===0&&t.length>0||e.length>0&&t.length===0)return t;const o=[],i=[],n=new Map,r=new Map;for(let a=0;a<t.length;a++){const l=t[a];r.set(l.instanceId,l)}for(let a=0;a<e.length;a++){const l=e[a];n.set(l.instanceId,l),r.has(l.instanceId)&&o.push(l)}for(let a=0;a<t.length;a++){const l=t[a],c=l.instanceId;n.has(c)||i.push(l)}return o.length===e.length&&i.length===0?e:o.length===0&&i.length===t.length?t:o.length===0?i:i.length===0?o:[...o,...i]}var fv=g.forwardRef((e,t)=>{const{registry:s,context:o}=g.useContext(Ct),i=g.useRef(null),n=g.useRef(null),r=g.useRef(null),a=g.useRef(null),l=g.useRef(null),c=g.useRef(),[d,u]=g.useState(),[h,p]=g.useState(),[m,C]=g.useState(),[v,w]=g.useState(()=>new es),[b,S]=g.useState(()=>new es("ag-hidden")),[x,y]=g.useState(()=>new es("ag-hidden")),[F,R]=g.useState(()=>new es("ag-invisible"));g.useImperativeHandle(t,()=>({refresh(){return!1}})),g.useLayoutEffect(()=>pr(d,o,n.current),[d]);const E=g.useCallback(U=>{if(i.current=U,!U||o.isDestroyed()){c.current=o.destroyBean(c.current);return}const L={setInnerRenderer:(H,te)=>{u(H),C(te)},setChildCount:H=>p(H),toggleCss:(H,te)=>w(Q=>Q.setClass(H,te)),setContractedDisplayed:H=>y(te=>te.setClass("ag-hidden",!H)),setExpandedDisplayed:H=>S(te=>te.setClass("ag-hidden",!H)),setCheckboxVisible:H=>R(te=>te.setClass("ag-invisible",!H)),setCheckboxSpacing:H=>R(te=>te.setClass("ag-group-checkbox-spacing",H))},de=s.createDynamicBean("groupCellRendererCtrl",!0);de&&(c.current=o.createBean(de),c.current.init(L,U,r.current,a.current,l.current,fv,e))},[]),D=g.useMemo(()=>`ag-cell-wrapper ${v.toString()}`,[v]),P=g.useMemo(()=>`ag-group-expanded ${b.toString()}`,[b]),T=g.useMemo(()=>`ag-group-contracted ${x.toString()}`,[x]),M=g.useMemo(()=>`ag-group-checkbox ${F.toString()}`,[F]),k=d?.componentFromFramework,N=k?d.componentClass:void 0,A=d==null&&m!=null,W=Ui(m);return g.createElement("span",{className:D,ref:E,...e.colDef?{}:{role:c.current?.getCellAriaRole()}},g.createElement("span",{className:P,ref:a}),g.createElement("span",{className:T,ref:l}),g.createElement("span",{className:M,ref:r}),g.createElement("span",{className:"ag-group-value",ref:n},A?W:k?g.createElement(N,{...d.params}):null),g.createElement("span",{className:"ag-group-child-count"},h))}),cp=fv,Qu=g.createContext({setMethods:()=>{}}),Jk=e=>{const{initialProps:t,addUpdateCallback:s,CustomComponentClass:o,setMethods:i}=e,[{key:n,...r},a]=g.useState(t);return g.useEffect(()=>{s(l=>a(l))},[]),g.createElement(Qu.Provider,{value:{setMethods:i}},g.createElement(o,{key:n,...r}))},eA=g.memo(Jk),tA=0;function dp(){return`agPortalKey_${++tA}`}var mv=class{constructor(e,t,s,o){this.portal=null,this.oldPortal=null,this.reactComponent=e,this.portalManager=t,this.componentType=s,this.suppressFallbackMethods=!!o,this.statelessComponent=this.isStateless(this.reactComponent),this.key=dp(),this.portalKey=dp(),this.instanceCreated=this.isStatelessComponent()?Ae.resolve(!1):new Ae(i=>{this.resolveInstanceCreated=i})}getGui(){return this.eParentElement}getRootElement(){return this.eParentElement.firstChild}destroy(){this.componentInstance&&typeof this.componentInstance.destroy=="function"&&this.componentInstance.destroy();const e=this.portal;e&&this.portalManager.destroyPortal(e)}createParentElement(e){const t=this.portalManager.getComponentWrappingElement(),s=document.createElement(t||"div");return s.classList.add("ag-react-container"),e.reactContainer=s,s}statelessComponentRendered(){return this.eParentElement.childElementCount>0||this.eParentElement.childNodes.length>0}getFrameworkComponentInstance(){return this.componentInstance}isStatelessComponent(){return this.statelessComponent}getReactComponentName(){return this.reactComponent.name}getMemoType(){return this.hasSymbol()?Symbol.for("react.memo"):60115}hasSymbol(){return typeof Symbol=="function"&&Symbol.for}isStateless(e){return typeof e=="function"&&!(e.prototype&&e.prototype.isReactComponent)||typeof e=="object"&&e.$$typeof===this.getMemoType()}hasMethod(e){const t=this.getFrameworkComponentInstance();return!!t&&t[e]!=null||this.fallbackMethodAvailable(e)}callMethod(e,t){const s=this.getFrameworkComponentInstance();if(this.isStatelessComponent())return this.fallbackMethod(e,t&&t[0]?t[0]:{});if(!s){setTimeout(()=>this.callMethod(e,t));return}const o=s[e];if(o)return o.apply(s,t);if(this.fallbackMethodAvailable(e))return this.fallbackMethod(e,t&&t[0]?t[0]:{})}addMethod(e,t){this[e]=t}init(e){return this.eParentElement=this.createParentElement(e),this.createOrUpdatePortal(e),new Ae(t=>this.createReactComponent(t))}createOrUpdatePortal(e){this.isStatelessComponent()||(this.ref=t=>{this.componentInstance=t,this.resolveInstanceCreated?.(!0),this.resolveInstanceCreated=void 0},e.ref=this.ref),this.reactElement=this.createElement(this.reactComponent,{...e,key:this.key}),this.portal=zi.createPortal(this.reactElement,this.eParentElement,this.portalKey)}createElement(e,t){return g.createElement(e,t)}createReactComponent(e){this.portalManager.mountReactPortal(this.portal,this,e)}rendered(){return this.isStatelessComponent()&&this.statelessComponentRendered()||!!(!this.isStatelessComponent()&&this.getFrameworkComponentInstance())}refreshComponent(e){this.oldPortal=this.portal,this.createOrUpdatePortal(e),this.portalManager.updateReactPortal(this.oldPortal,this.portal)}fallbackMethod(e,t){const s=this[`${e}Component`];if(!this.suppressFallbackMethods&&s)return s.bind(this)(t)}fallbackMethodAvailable(e){return this.suppressFallbackMethods?!1:!!this[`${e}Component`]}};function bl(e,t,s){for(const o of e){const i=t[o];i&&(s[o]=i)}}var jt=class extends mv{constructor(){super(...arguments),this.awaitUpdateCallback=new Ae(e=>{this.resolveUpdateCallback=e}),this.wrapperComponent=eA}init(e){return this.sourceParams=e,super.init(this.getProps())}addMethod(){}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}getFrameworkComponentInstance(){return this}createElement(e,t){return super.createElement(this.wrapperComponent,{initialProps:t,CustomComponentClass:e,setMethods:s=>this.setMethods(s),addUpdateCallback:s=>{this.updateCallback=()=>(s(this.getProps()),new Ae(o=>{setTimeout(()=>{o()})})),this.resolveUpdateCallback()}})}setMethods(e){this.providedMethods=e,bl(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return{...this.sourceParams,key:this.key,ref:this.ref}}refreshProps(){return this.updateCallback?this.updateCallback():new Ae(e=>this.awaitUpdateCallback.then(()=>{this.updateCallback().then(()=>e())}))}},sA=class extends jt{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},oA=class extends jt{constructor(){super(...arguments),this.date=null,this.onDateChange=e=>this.updateDate(e)}getDate(){return this.date}setDate(e){this.date=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled"]}updateDate(e){this.setDate(e),this.sourceParams.onDateChanged()}getProps(){const e=super.getProps();return e.date=this.date,e.onDateChange=this.onDateChange,delete e.onDateChanged,e}},iA=class extends jt{constructor(){super(...arguments),this.label="",this.icon=null,this.shake=!1}setIcon(e,t){this.icon=e,this.shake=t,this.refreshProps()}setLabel(e){this.label=e,this.refreshProps()}getProps(){const e=super.getProps(),{label:t,icon:s,shake:o}=this;return e.label=t,e.icon=s,e.shake=o,e}},nA=class extends jt{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e),this.onUiChange=()=>this.sourceParams.filterModifiedCallback(),this.expectingNewMethods=!0,this.hasBeenActive=!1,this.awaitSetMethodsCallback=new Ae(e=>{this.resolveSetMethodsCallback=e})}isFilterActive(){return this.model!=null}doesFilterPass(e){return this.providedMethods.doesFilterPass(e)}getModel(){return this.model}setModel(e){return this.expectingNewMethods=!0,this.model=e,this.hasBeenActive||(this.hasBeenActive=this.isFilterActive()),this.refreshProps()}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}afterGuiAttached(e){const t=this.providedMethods;t?t.afterGuiAttached?.(e):this.awaitSetMethodsCallback.then(()=>this.providedMethods?.afterGuiAttached?.(e))}getOptionalMethods(){return["afterGuiDetached","onNewRowsLoaded","getModelAsString","onAnyFilterChanged"]}setMethods(e){this.expectingNewMethods===!1&&this.hasBeenActive&&this.providedMethods?.doesFilterPass!==e?.doesFilterPass&&setTimeout(()=>{this.sourceParams.filterChangedCallback()}),this.expectingNewMethods=!1,super.setMethods(e),this.resolveSetMethodsCallback(),this.resolveFilterPassCallback?.(),this.resolveFilterPassCallback=void 0}updateModel(e){this.resolveFilterPassCallback?.();const t=new Ae(s=>{this.resolveFilterPassCallback=s});this.setModel(e).then(()=>{t.then(()=>{this.sourceParams.filterChangedCallback()})})}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e.onUiChange=this.onUiChange,delete e.filterChangedCallback,e}},rA=class extends jt{constructor(){super(...arguments),this.awaitSetMethodsCallback=new Ae(e=>{this.resolveSetMethodsCallback=e})}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}afterGuiAttached(e){const t=this.providedMethods;t?t.afterGuiAttached?.(e):this.awaitSetMethodsCallback.then(()=>this.providedMethods?.afterGuiAttached?.(e))}getOptionalMethods(){return["afterGuiDetached","onNewRowsLoaded","onAnyFilterChanged"]}setMethods(e){super.setMethods(e),this.resolveSetMethodsCallback()}};function Cv(e,t){e.parentFilterInstance(s=>{(s.setModel(t)||Ae.resolve()).then(()=>{e.filterParams.filterChangedCallback()})})}var aA=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t,this.model=null,this.onModelChange=s=>this.updateModel(s)}getProps(){return{...this.floatingFilterParams,model:this.model,onModelChange:this.onModelChange}}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){bl(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),Cv(this.floatingFilterParams,e)}},lA=class extends jt{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e)}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),Cv(this.sourceParams,e)}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e}},cA=class extends jt{refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}},dA=class extends jt{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},uA=class extends jt{refresh(e){this.sourceParams=e,this.refreshProps()}},hA=class extends jt{constructor(){super(...arguments),this.active=!1,this.expanded=!1,this.onActiveChange=e=>this.updateActive(e)}setActive(e){this.awaitSetActive(e)}setExpanded(e){this.expanded=e,this.refreshProps()}getOptionalMethods(){return["select","configureDefaults"]}awaitSetActive(e){return this.active=e,this.refreshProps()}updateActive(e){const t=this.awaitSetActive(e);e&&t.then(()=>this.sourceParams.onItemActivated())}getProps(){const e=super.getProps();return e.active=this.active,e.expanded=this.expanded,e.onActiveChange=this.onActiveChange,delete e.onItemActivated,e}},gA=class extends jt{refresh(e){this.sourceParams=e,this.refreshProps()}},pA=class extends jt{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},fA=class extends jt{constructor(){super(...arguments),this.onStateChange=e=>this.updateState(e)}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}getState(){return this.state}updateState(e){this.state=e,this.refreshProps(),this.sourceParams.onStateUpdated()}getProps(){const e=super.getProps();return e.state=this.state,e.onStateChange=this.onStateChange,e}};function Ju(){z(231)}var mA=1e3,CA=class{constructor(e,t,s){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=t||"div",this.refresher=e,this.maxComponentCreationTimeMs=s||mA}getPortals(){return this.portals}destroy(){this.destroyed=!0}destroyPortal(e){this.portals=this.portals.filter(t=>t!==e),this.batchUpdate()}getComponentWrappingElement(){return this.wrappingElement}mountReactPortal(e,t,s){this.portals=[...this.portals,e],this.waitForInstance(t,s),this.batchUpdate()}updateReactPortal(e,t){this.portals[this.portals.indexOf(e)]=t,this.batchUpdate()}batchUpdate(){this.hasPendingPortalUpdate||(setTimeout(()=>{this.destroyed||(this.refresher(),this.hasPendingPortalUpdate=!1)}),this.hasPendingPortalUpdate=!0)}waitForInstance(e,t,s=Date.now()){if(this.destroyed){t(null);return}if(e.rendered())t(e);else{if(Date.now()-s>=this.maxComponentCreationTimeMs&&!this.hasPendingPortalUpdate){sr(!0,()=>this.refresher()),e.rendered()&&t(e);return}window.setTimeout(()=>{this.waitForInstance(e,t,s)})}}},vA=({ctrl:e})=>{const t=e.isAlive(),{context:s}=g.useContext(Ct),[o,i]=g.useState(),[n,r]=g.useState(),a=g.useRef(),l=g.useRef(null),c=g.useRef(null),d=g.useRef(null),u=g.useRef(),h=g.useRef();t&&!h.current&&(h.current=new cr(()=>l.current));const p=g.useCallback(w=>{if(l.current=w,!w||!e.isAlive()||s.isDestroyed()){a.current=s.destroyBean(a.current);return}a.current=s.createBean(new $i);const b=()=>{const x=e.getSelectAllGui();x&&(c.current?.insertAdjacentElement("afterend",x),a.current.addDestroyFunc(()=>x.remove()))},S={setWidth:x=>{l.current&&(l.current.style.width=x)},toggleCss:(x,y)=>h.current.toggleCss(x,y),setUserStyles:x=>r(x),setAriaSort:x=>{l.current&&(x?wS(l.current,x):bS(l.current))},setUserCompDetails:x=>i(x),getUserCompInstance:()=>u.current||void 0,refreshSelectAllGui:b,removeSelectAllGui:()=>e.getSelectAllGui()?.remove()};e.setComp(S,w,c.current,d.current,a.current),b()},[]);g.useLayoutEffect(()=>pr(o,s,d.current,u),[o]),g.useEffect(()=>{e.setDragSource(l.current)},[o]);const m=g.useMemo(()=>!!(o?.componentFromFramework&&Ki(o.componentClass)),[o]),C=o?.componentFromFramework,v=o?.componentClass;return g.createElement("div",{ref:p,style:n,className:"ag-header-cell",role:"columnheader"},g.createElement("div",{ref:c,className:"ag-header-cell-resize",role:"presentation"}),g.createElement("div",{ref:d,className:"ag-header-cell-comp-wrapper",role:"presentation"},C?m?g.createElement(v,{...o.params}):g.createElement(v,{...o.params,ref:u}):null))},wA=g.memo(vA),bA=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t}getProps(){return this.floatingFilterParams}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){bl(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}},SA=({ctrl:e})=>{const{context:t,gos:s}=g.useContext(Ct),[o,i]=g.useState(),[n,r]=g.useState(()=>new es("ag-header-cell","ag-floating-filter")),[a,l]=g.useState(()=>new es),[c,d]=g.useState(()=>new es("ag-floating-filter-button","ag-hidden")),[u,h]=g.useState("false"),[p,m]=g.useState(),[,C]=g.useState(1),v=g.useRef(),w=g.useRef(null),b=g.useRef(null),S=g.useRef(null),x=g.useRef(null),y=g.useRef(),F=g.useRef(),R=H=>{H!=null&&y.current&&y.current(H)},E=g.useCallback(H=>{if(w.current=H,!H||!e.isAlive()||t.isDestroyed()){v.current=t.destroyBean(v.current);return}v.current=t.createBean(new $i),F.current=new Ae(Q=>{y.current=Q});const te={toggleCss:(Q,J)=>r(me=>me.setClass(Q,J)),setUserStyles:Q=>i(Q),addOrRemoveBodyCssClass:(Q,J)=>l(me=>me.setClass(Q,J)),setButtonWrapperDisplayed:Q=>{d(J=>J.setClass("ag-hidden",!Q)),h(Q?"false":"true")},setWidth:Q=>{w.current&&(w.current.style.width=Q)},setCompDetails:Q=>m(Q),getFloatingFilterComp:()=>F.current?F.current:null,setMenuIcon:Q=>x.current?.appendChild(Q)};e.setComp(te,H,x.current,b.current,v.current)},[]);g.useLayoutEffect(()=>pr(p,t,b.current,R),[p]);const D=g.useMemo(()=>n.toString(),[n]),P=g.useMemo(()=>a.toString(),[a]),T=g.useMemo(()=>c.toString(),[c]),M=g.useMemo(()=>!!(p&&p.componentFromFramework&&Ki(p.componentClass)),[p]),k=g.useMemo(()=>s.get("reactiveCustomComponents"),[]),N=g.useMemo(()=>s.get("enableFilterHandlers"),[]),[A,W]=g.useState();g.useEffect(()=>{if(p?.componentFromFramework)if(k){const H=N?bA:aA,te=new H(p.params,()=>C(Q=>Q+1));R(te),W(te)}else Ju()},[p]);const U=A?.getProps(),L=p?.componentFromFramework,de=p?.componentClass;return g.createElement("div",{ref:E,style:o,className:D,role:"gridcell"},g.createElement("div",{ref:b,className:P,role:"presentation"},L?k?U&&g.createElement(Qu.Provider,{value:{setMethods:H=>A.setMethods(H)}},g.createElement(de,{...U})):g.createElement(de,{...p.params,ref:M?()=>{}:R}):null),g.createElement("div",{ref:S,"aria-hidden":u,className:T,role:"presentation"},g.createElement("button",{ref:x,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))},yA=g.memo(SA),xA=({ctrl:e})=>{const{context:t}=g.useContext(Ct),[s,o]=g.useState(),[i,n]=g.useState(()=>new es),[r,a]=g.useState(()=>new es),[l,c]=g.useState("false"),[d,u]=g.useState(),[h,p]=g.useState(),m=g.useRef(),C=g.useRef(null),v=g.useRef(null),w=g.useRef(null),b=g.useRef(),S=g.useCallback(D=>{if(C.current=D,!D||!e.isAlive()||t.isDestroyed()){m.current=t.destroyBean(m.current);return}m.current=t.createBean(new $i);const P={setWidth:T=>{C.current&&(C.current.style.width=T)},toggleCss:(T,M)=>n(k=>k.setClass(T,M)),setUserStyles:T=>o(T),setHeaderWrapperHidden:T=>{const M=w.current;M&&(T?M.style.setProperty("display","none"):M.style.removeProperty("display"))},setHeaderWrapperMaxHeight:T=>{const M=w.current;M&&(T!=null?M.style.setProperty("max-height",`${T}px`):M.style.removeProperty("max-height"),M.classList.toggle("ag-header-cell-comp-wrapper-limited-height",T!=null))},setUserCompDetails:T=>p(T),setResizableDisplayed:T=>{a(M=>M.setClass("ag-hidden",!T)),c(T?"false":"true")},setAriaExpanded:T=>u(T),getUserCompInstance:()=>b.current||void 0};e.setComp(P,D,v.current,w.current,m.current)},[]);g.useLayoutEffect(()=>pr(h,t,w.current),[h]),g.useEffect(()=>{C.current&&e.setDragSource(C.current)},[h]);const x=g.useMemo(()=>!!(h?.componentFromFramework&&Ki(h.componentClass)),[h]),y=g.useMemo(()=>"ag-header-group-cell "+i.toString(),[i]),F=g.useMemo(()=>"ag-header-cell-resize "+r.toString(),[r]),R=h?.componentFromFramework,E=h?.componentClass;return g.createElement("div",{ref:S,style:s,className:y,role:"columnheader","aria-expanded":d},g.createElement("div",{ref:w,className:"ag-header-cell-comp-wrapper",role:"presentation"},R?x?g.createElement(E,{...h.params}):g.createElement(E,{...h.params,ref:b}):null),g.createElement("div",{ref:v,"aria-hidden":l,className:F}))},RA=g.memo(xA),FA=({ctrl:e})=>{const{gos:t,context:s}=g.useContext(Ct),{topOffset:o,rowHeight:i}=g.useMemo(()=>e.getTopAndHeight(),[]),n=g.useMemo(()=>t.get("tabIndex"),[]),[r,a]=g.useState(()=>e.getAriaRowIndex()),l=e.headerRowClass,[c,d]=g.useState(()=>i+"px"),[u,h]=g.useState(()=>o+"px"),p=g.useRef(null),[m,C]=g.useState(()=>e.getUpdatedHeaderCtrls()),v=g.useRef(),w=g.useRef(null),b=g.useCallback(y=>{if(w.current=y,!y||!e.isAlive()||s.isDestroyed()){v.current=s.destroyBean(v.current);return}v.current=s.createBean(new $i);const F={setHeight:R=>d(R),setTop:R=>h(R),setHeaderCtrls:(R,E,D)=>{const P=p.current,T=Za(P,R,E);T!==P&&(p.current=T,sr(D,()=>C(T)))},setWidth:R=>{w.current&&(w.current.style.width=R)},setRowIndex:R=>{a(R)}};e.setComp(F,v.current,!1)},[]),S=g.useMemo(()=>({height:c,top:u}),[c,u]),x=g.useCallback(y=>{switch(e.type){case"group":return g.createElement(RA,{ctrl:y,key:y.instanceId});case"filter":return g.createElement(yA,{ctrl:y,key:y.instanceId});default:return g.createElement(wA,{ctrl:y,key:y.instanceId})}},[]);return g.createElement("div",{ref:b,className:l,role:"row",style:S,tabIndex:n,"aria-rowindex":r},m.map(x))},EA=g.memo(FA),DA=({pinned:e})=>{const[t,s]=g.useState(!0),[o,i]=g.useState([]),{context:n}=g.useContext(Ct),r=g.useRef(null),a=g.useRef(null),l=g.useRef(),c=e==="left",d=e==="right",u=!c&&!d,h=g.useCallback(C=>{if(r.current=C,!C||n.isDestroyed()){l.current=n.destroyBean(l.current);return}l.current=n.createBean(new iF(e));const v={setDisplayed:s,setCtrls:w=>i(w),setCenterWidth:w=>{a.current&&(a.current.style.width=w)},setViewportScrollLeft:w=>{r.current&&(r.current.scrollLeft=w)},setPinnedContainerWidth:w=>{r.current&&(r.current.style.width=w,r.current.style.minWidth=w,r.current.style.maxWidth=w)}};l.current.setComp(v,r.current)},[]),p=t?"":"ag-hidden",m=()=>o.map(C=>g.createElement(EA,{ctrl:C,key:C.instanceId}));return c?g.createElement("div",{ref:h,className:"ag-pinned-left-header "+p,"aria-hidden":!t,role:"rowgroup"},m()):d?g.createElement("div",{ref:h,className:"ag-pinned-right-header "+p,"aria-hidden":!t,role:"rowgroup"},m()):u?g.createElement("div",{ref:h,className:"ag-header-viewport "+p,role:"rowgroup",tabIndex:-1},g.createElement("div",{ref:a,className:"ag-header-container",role:"presentation"},m())):null},Bc=g.memo(DA),PA=()=>{const[e,t]=g.useState(()=>new es),[s,o]=g.useState(),{context:i}=g.useContext(Ct),n=g.useRef(null),r=g.useRef(),a=g.useCallback(d=>{if(n.current=d,!d||i.isDestroyed()){r.current=i.destroyBean(r.current);return}r.current=i.createBean(new eF);const u={toggleCss:(h,p)=>t(m=>m.setClass(h,p)),setHeightAndMinHeight:h=>o(h)};r.current.setComp(u,d,d)},[]),l=g.useMemo(()=>"ag-header "+e.toString(),[e]),c=g.useMemo(()=>({height:s,minHeight:s}),[s]);return g.createElement("div",{ref:a,className:l,style:c,role:"presentation"},g.createElement(Bc,{pinned:"left"}),g.createElement(Bc,{pinned:null}),g.createElement(Bc,{pinned:"right"}))},TA=g.memo(PA),MA=(e,t)=>{g.useEffect(()=>{const s=t.current;if(s){const o=s.parentElement;if(o){const i=document.createComment(e);return o.insertBefore(i,s),()=>{i.remove()}}}},[e])},Co=MA,IA=class{constructor(e,t){this.cellEditorParams=e,this.refreshProps=t,this.instanceCreated=new Ae(s=>{this.resolveInstanceCreated=s}),this.onValueChange=s=>this.updateValue(s),this.value=e.value}getProps(){return{...this.cellEditorParams,initialValue:this.cellEditorParams.value,value:this.value,onValueChange:this.onValueChange}}getValue(){return this.value}refresh(e){this.cellEditorParams=e,this.refreshProps()}setMethods(e){bl(this.getOptionalMethods(),e,this)}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}setRef(e){this.componentInstance=e,this.resolveInstanceCreated?.(),this.resolveInstanceCreated=void 0}getOptionalMethods(){return["isCancelBeforeStart","isCancelAfterEnd","focusIn","focusOut","afterGuiAttached","getValidationErrors","getValidationElement"]}updateValue(e){this.value=e,this.refreshProps()}},kA=e=>{const t=g.useRef(e),s=g.useRef(),o=g.useRef(!1),i=g.useRef(!1),[,n]=g.useState(0);o.current&&(i.current=!0),g.useEffect(()=>(o.current||(s.current=t.current(),o.current=!0),n(r=>r+1),()=>{i.current&&s.current?.()}),[])},AA=e=>{const[t,s]=g.useState(),o=g.useContext(Ct),{context:i,popupSvc:n,gos:r,editSvc:a}=o,{editDetails:l,cellCtrl:c,eParentCell:d}=e;return kA(()=>{const{compDetails:u}=l,h=r.get("stopEditingWhenCellsLoseFocus");let p,m;if(!i.isDestroyed()){m=i.createBean(a.createPopupEditorWrapper(u.params));const C=m.getGui();if(e.jsChildComp){const y=e.jsChildComp.getGui();y&&C.appendChild(y)}const{column:v,rowNode:w}=c,b={column:v,rowNode:w,type:"popupCellEditor",eventSource:d,ePopup:C,position:l.popupPosition,keepWithinBounds:!0},S=n?.positionPopupByComponent.bind(n,b),x=n?.addPopup({modal:h,eChild:C,closeOnEsc:!0,closedCallback:()=>{c.onPopupEditorClosed()},anchorToElement:d,positionCallback:S,ariaOwns:d});p=x?x.hideFunc:void 0,s(m),e.jsChildComp?.afterGuiAttached?.()}return()=>{p?.(),i.destroyBean(m)}}),g.useLayoutEffect(()=>()=>{c.isCellFocused()&&t?.getGui().contains(Ze(o))&&d.focus({preventScroll:!0})},[t]),t&&e.wrappedContent?zi.createPortal(e.wrappedContent,t.getGui()):null},up=g.memo(AA),LA=(e,t,s)=>{const{compProxy:o}=e;s(o);const i=o.getProps(),n=Ki(t);return g.createElement(Qu.Provider,{value:{setMethods:r=>o.setMethods(r)}},n?g.createElement(t,{...i}):g.createElement(t,{...i,ref:r=>o.setRef(r)}))},hp=(e,t,s)=>e.compProxy?LA(e,t,s):g.createElement(t,{...e.compDetails.params,ref:s}),OA=(e,t,s,o,i)=>{const n=e.compDetails,r=n.componentClass,a=n.componentFromFramework&&!e.popup,l=n.componentFromFramework&&e.popup,c=!n.componentFromFramework&&e.popup;return a?hp(e,r,t):l?g.createElement(up,{editDetails:e,cellCtrl:o,eParentCell:s,wrappedContent:hp(e,r,t)}):c&&i?g.createElement(up,{editDetails:e,cellCtrl:o,eParentCell:s,jsChildComp:i}):null},NA=(e,t,s,o,i,n)=>{const{context:r}=g.useContext(Ct),a=g.useCallback(()=>{const l=i.current;if(!l)return;const c=l.getGui();c&&c.parentElement&&c.remove(),r.destroyBean(l),i.current=void 0},[]);g.useEffect(()=>{const l=e!=null,c=e?.compDetails&&!e.compDetails.componentFromFramework,d=t&&s==null;if(!(l&&c&&!d)){a();return}const h=e.compDetails;if(i.current){const m=i.current,v=m.refresh!=null&&e.force==!1?m.refresh(h.params):!1;if(v===!0||v===void 0)return;a()}h.newAgStackInstance().then(m=>{if(!m)return;const C=m.getGui();if(!C)return;(t?s:n.current).appendChild(C),i.current=m})},[e,t,o]),g.useEffect(()=>a,[])},vv=NA,HA=({cellCtrl:e,parent:t})=>{const s=g.useRef(),o=g.useMemo(()=>{const{loadingComp:i}=e.getDeferLoadingCellRenderer();return i?{value:void 0,compDetails:i,force:!1}:void 0},[e]);if(vv(o,!1,void 0,1,s,t),o?.compDetails?.componentFromFramework){const i=o.compDetails.componentClass;return g.createElement(i,{...o.compDetails.params})}return g.createElement(g.Fragment,null)},GA=({cellCtrl:e,printLayout:t,editingCell:s})=>{const o=g.useContext(Ct),{context:i}=o,{column:{colIdSanitised:n},instanceId:r}=e,a=g.useRef(),[l,c]=g.useState(()=>e.isCellRenderer()?void 0:{compDetails:void 0,value:e.getValueToDisplay(),force:!1}),[d,u]=g.useState(),[h,p]=g.useState(1),[m,C]=g.useState(),[v,w]=g.useState(!1),[b,S]=g.useState(!1),[x,y]=g.useState(!1),[F,R]=g.useState(),E=g.useMemo(()=>e.isForceWrapper(),[e]),D=g.useMemo(()=>e.getCellAriaRole(),[e]),P=g.useRef(null),T=g.useRef(null),M=g.useRef(null),k=g.useRef(),N=g.useRef(),A=g.useRef(),W=g.useRef([]),U=g.useRef(),L=g.useRef(),[de,H]=g.useState(0),te=g.useCallback(re=>{L.current=re,H(Ce=>Ce+1)},[]),Q=l!=null&&(v||x||b)&&(d==null||!!d.popup),J=E||Q,me=g.useMemo(()=>e.getCellValueClass(),[e]),Re=g.useCallback(re=>{if(N.current=re,re){const Ce=re.isCancelBeforeStart&&re.isCancelBeforeStart();setTimeout(()=>{Ce?(e.stopEditing(!0),e.focusCell(!0)):(e.cellEditorAttached(),e.enableEditorTooltipFeature(re))})}},[e]),ne=g.useRef();ne.current||(ne.current=new cr(()=>P.current)),vv(l,J,L.current,de,k,P);const _=g.useRef();g.useLayoutEffect(()=>{const re=_.current,Ce=l;if(_.current=l,re==null||re.compDetails==null||Ce==null||Ce.compDetails==null)return;U.current?.refreshVisibility();const xe=re.compDetails,Le=Ce.compDetails;if(xe.componentClass!=Le.componentClass||M.current?.refresh==null)return;M.current.refresh(Le.params)!=!0&&p(De=>De+1)},[l]),g.useLayoutEffect(()=>{if(!(d&&!d.compDetails.componentFromFramework)||i.isDestroyed())return;const Ce=d.compDetails,xe=d.popup===!0,Le=Ce.newAgStackInstance();return Le.then(fe=>{if(!fe)return;const De=fe.getGui();Re(fe),xe||((E?A:P).current?.appendChild(De),fe.afterGuiAttached?.()),R(fe)}),()=>{Le.then(fe=>{const De=fe.getGui();e.disableEditorTooltipFeature(),i.destroyBean(fe),Re(void 0),R(void 0),De?.remove()})}},[d]);const Fe=g.useCallback(re=>{if(A.current=re,!re||i.isDestroyed()||!e.isAlive()){const Le=W.current;W.current=[];for(const fe of Le)fe();return}let Ce;const xe=Le=>{Le&&(re.insertAdjacentElement("afterbegin",Le.getGui()),W.current.push(()=>{eo(Le.getGui()),i.destroyBean(Le),U.current===Ce&&(U.current=void 0)}))};v&&xe(e.createSelectionCheckbox()),x&&xe(e.createDndSource()),b&&(Ce=e.createRowDragComp(),U.current=Ce,Ce&&(xe(Ce),Ce.refreshVisibility()))},[e,i,x,b,v]),ie=g.useCallback(()=>{const re=!e.isCellSpanning()||T.current,Ce=P.current;if(!Ce||!re||!e||!e.isAlive()||i.isDestroyed()){a.current=i.destroyBean(a.current);return}a.current=i.createBean(new $i);const xe={toggleCss:(fe,De)=>ne.current.toggleCss(fe,De),setUserStyles:fe=>C(fe),getFocusableElement:()=>P.current,setIncludeSelection:fe=>w(fe),setIncludeRowDrag:fe=>S(fe),setIncludeDndSource:fe=>y(fe),getCellEditor:()=>N.current??null,getCellRenderer:()=>M.current??k.current,getParentOfValue:()=>L.current??A.current??P.current,setRenderDetails:(fe,De,ze)=>{const Ne=()=>{c(Ve=>Ve?.compDetails!==fe||Ve?.value!==De||Ve?.force!==ze?{value:De,compDetails:fe,force:ze}:Ve)};if(fe?.params?.deferRender&&!e.rowNode.group){const{loadingComp:Ve,onReady:kt}=e.getDeferLoadingCellRenderer();if(Ve){c({value:void 0,compDetails:Ve,force:!1}),kt.then(()=>Xk(Ne));return}}Ne()},setEditDetails:(fe,De,ze,Ne)=>{if(fe){let Ve;fe.componentFromFramework&&(Ne?Ve=new IA(fe.params,()=>p(kt=>kt+1)):Ju()),u({compDetails:fe,popup:De,popupPosition:ze,compProxy:Ve}),De||c(void 0)}else e.hasBrowserFocus()&&xe.getFocusableElement().focus({preventScroll:!0}),N.current=void 0,u(void 0)},refreshEditStyles:(fe,De)=>{if(!P.current)return;const{current:ze}=ne;ze.toggleCss("ag-cell-value",!J),ze.toggleCss("ag-cell-inline-editing",!!fe&&!De),ze.toggleCss("ag-cell-popup-editing",!!fe&&!!De),ze.toggleCss("ag-cell-not-inline-editing",!fe||!!De)}},Le=A.current||void 0;e.setComp(xe,Ce,T.current??void 0,Le,t,s,a.current)},[]),$=g.useCallback(re=>{P.current=re,ie()},[]),q=g.useCallback(re=>{T.current=re,ie()},[]),se=g.useMemo(()=>!!(l?.compDetails?.componentFromFramework&&Ki(l.compDetails.componentClass)),[l]);g.useLayoutEffect(()=>{if(!P.current)return;const{current:re}=ne;re.toggleCss("ag-cell-value",!J),re.toggleCss("ag-cell-inline-editing",!!d&&!d.popup),re.toggleCss("ag-cell-popup-editing",!!d&&!!d.popup),re.toggleCss("ag-cell-not-inline-editing",!d||!!d.popup)});const B=()=>{const{compDetails:re,value:Ce}=l;if(!re)return Ce?.toString?.()??Ce;if(re.componentFromFramework){const xe=re.componentClass;return g.createElement(g.Suspense,{fallback:g.createElement(HA,{cellCtrl:e,parent:P})},se?g.createElement(xe,{...re.params,key:h}):g.createElement(xe,{...re.params,key:h,ref:M}))}},pe=()=>{const re=()=>l==null?null:J?g.createElement("span",{role:"presentation",id:`cell-${r}`,className:me,ref:te},B()):B(),Ce=xe=>OA(xe,Re,P.current,e,F);return d!=null?d.popup?g.createElement(g.Fragment,null,re(),Ce(d)):Ce(d):re()},le=()=>g.createElement("div",{ref:$,style:m,role:D,"col-id":n},J?g.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:Fe},pe()):pe());return e.isCellSpanning()?g.createElement("div",{ref:q,className:"ag-spanned-cell-wrapper",role:"presentation"},le()):le()},BA=g.memo(GA),VA=({rowCtrl:e,containerType:t})=>{const{context:s,gos:o,editSvc:i}=g.useContext(Ct),n=g.useContext(hv)==="default",r=g.useRef(),a=g.useRef(e.getDomOrder()),l=e.isFullWidth(),c=e.rowNode.displayed,[d,u]=g.useState(()=>c?e.rowNode.getRowIndexString():null),[h,p]=g.useState(()=>e.rowId),[m,C]=g.useState(()=>e.businessKey),[v,w]=g.useState(()=>e.rowStyles),b=g.useRef(null),[S,x]=g.useState(()=>null),[y,F]=g.useState(),[R,E]=g.useState(()=>c?e.getInitialRowTop(t):void 0),[D,P]=g.useState(()=>c?e.getInitialTransform(t):void 0),T=g.useRef(null),M=g.useRef(),k=g.useRef(),N=g.useRef(!1),[A,W]=g.useState(0);g.useEffect(()=>{if(N.current||!y||A>10)return;const $=T.current?.firstChild;$?(e.setupDetailRowAutoHeight($),N.current=!0):W(q=>q+1)},[y,A]);const U=g.useRef();U.current||(U.current=new cr(()=>T.current));const L=g.useRef(()=>{}),de=g.useCallback($=>(L.current=$,()=>{L.current=()=>{}}),[]),H=Qk(de,()=>b.current,[]),te=n?H:S,Q=g.useCallback($=>{if(T.current=$,r.current=$?s.createBean(new $i):s.destroyBean(r.current),!$){e.unsetComp(t);return}if(!e.isAlive()||s.isDestroyed())return;const q={setTop:E,setTransform:P,toggleCss:(se,B)=>U.current.toggleCss(se,B),setDomOrder:se=>a.current=se,setRowIndex:u,setRowId:p,setRowBusinessKey:C,setUserStyles:w,setCellCtrls:(se,B)=>{const pe=b.current,le=Za(pe,se,a.current);le!==pe&&(b.current=le,n?L.current():sr(B,()=>x(le)))},showFullWidth:se=>{k.current=se.params,F(se)},getFullWidthCellRenderer:()=>M.current,getFullWidthCellRendererParams:()=>k.current,refreshFullWidth:se=>{const B=se();return k.current=B,_.current?(F(pe=>({...pe,params:B})),!0):!M.current||!M.current.refresh?!1:M.current.refresh(B)}};e.setComp(q,$,t,r.current)},[]);g.useLayoutEffect(()=>pr(y,s,T.current,M),[y]);const J=g.useMemo(()=>{const $={top:R,transform:D};return Object.assign($,v),$},[R,D,v]),me=l&&y?.componentFromFramework,Re=!l&&te!=null,ne=g.useMemo(()=>!!(y?.componentFromFramework&&Ki(y.componentClass)),[y]),_=g.useRef(!1);g.useEffect(()=>{_.current=ne&&!!y&&!!o.get("reactiveCustomComponents")},[ne,y]);const Fe=()=>te?.map($=>g.createElement(BA,{cellCtrl:$,editingCell:i?.isEditing($,{withOpenEditor:!0})??!1,printLayout:e.printLayout,key:$.instanceId})),ie=()=>{const $=y.componentClass;return ne?g.createElement($,{...y.params}):g.createElement($,{...y.params,ref:M})};return g.createElement("div",{ref:Q,role:"row",style:J,"row-index":d,"row-id":h,"row-business-key":m},Re?Fe():me?ie():null)},gp=g.memo(VA),zA=({name:e})=>{const{context:t,gos:s}=g.useContext(Ct),o=g.useMemo(()=>ur(e),[e]),i=g.useRef(null),n=g.useRef(null),r=g.useRef(null),a=g.useRef([]),l=g.useRef([]),[c,d]=g.useState(()=>[]),u=!!s.get("enableCellSpan")&&!!o.getSpannedRowCtrls,h=g.useRef([]),p=g.useRef([]),[m,C]=g.useState(()=>[]),v=g.useRef(!1),w=g.useRef(),b=g.useMemo(()=>Yt("ag-viewport",Om(e)),[e]),S=g.useMemo(()=>Yt(va(e)),[e]),x=g.useMemo(()=>Yt("ag-spanning-container",R2(e)),[e]),y=o.type==="center"||u,F=y?i:n;Co(" AG Row Container "+e+" ",F);const R=g.useCallback(()=>{const A=!y||i.current!=null,W=n.current!=null,U=!u||r.current!=null;return A&&W&&U},[]),E=g.useCallback(()=>i.current==null&&n.current==null&&r.current==null,[]),D=g.useCallback(()=>{if(E()&&(w.current=t.destroyBean(w.current)),!t.isDestroyed()&&R()){const A=L=>{const de=Za(l.current,a.current,v.current);de!==l.current&&(l.current=de,sr(L,()=>d(de)))},W=L=>{const de=Za(p.current,h.current,v.current);de!==p.current&&(p.current=de,sr(L,()=>C(de)))},U={setHorizontalScroll:L=>{i.current&&(i.current.scrollLeft=L)},setViewportHeight:L=>{i.current&&(i.current.style.height=L)},setRowCtrls:({rowCtrls:L,useFlushSync:de})=>{const H=!!de&&a.current.length>0&&L.length>0;a.current=L,A(H)},setSpannedRowCtrls:(L,de)=>{const H=!!de&&h.current.length>0&&L.length>0;h.current=L,W(H)},setDomOrder:L=>{v.current!=L&&(v.current=L,A(!1))},setContainerWidth:L=>{n.current&&(n.current.style.width=L)},setOffsetTop:L=>{n.current&&(n.current.style.transform=`translateY(${L})`)}};w.current=t.createBean(new L2(e)),w.current.setComp(U,n.current,r.current??void 0,i.current)}},[R,E]),P=g.useCallback(A=>{n.current=A,D()},[D]),T=g.useCallback(A=>{r.current=A,D()},[D]),M=g.useCallback(A=>{i.current=A,D()},[D]),k=()=>g.createElement("div",{className:S,ref:P,role:y?"presentation":"rowgroup"},c.map(A=>g.createElement(gp,{rowCtrl:A,containerType:o.type,key:A.instanceId})));if(!y)return k();const N=()=>g.createElement("div",{className:x,ref:T,role:"presentation"},m.map(A=>g.createElement(gp,{rowCtrl:A,containerType:o.type,key:A.instanceId})));return g.createElement("div",{className:b,ref:M,role:"rowgroup"},k(),u?N():null)},WA=g.memo(zA),_A=()=>{const e=g.useContext(Ct),{context:t,overlays:s}=e,[o,i]=g.useState(""),[n,r]=g.useState(0),[a,l]=g.useState(0),[c,d]=g.useState("0px"),[u,h]=g.useState("0px"),[p,m]=g.useState("100%"),[C,v]=g.useState("0px"),[w,b]=g.useState("0px"),[S,x]=g.useState("100%"),[y,F]=g.useState(!0),[R,E]=g.useState(!0),[D,P]=g.useState(null),[T,M]=g.useState(""),[k,N]=g.useState(null),[A,W]=g.useState("ag-layout-normal"),U=g.useRef();U.current||(U.current=new cr(()=>L.current));const L=g.useRef(null),de=g.useRef(null),H=g.useRef(null),te=g.useRef(null),Q=g.useRef(null),J=g.useRef(null),me=g.useRef(null),Re=g.useRef([]),ne=g.useRef([]);Co(" AG Grid Body ",L),Co(" AG Pinned Top ",de),Co(" AG Sticky Top ",H),Co(" AG Middle ",J),Co(" AG Pinned Bottom ",me);const _=g.useCallback(De=>{if(L.current=De,!De||t.isDestroyed()){Re.current=t.destroyBeans(Re.current);for(const V of ne.current)V();ne.current=[];return}const ze=(V,Ee)=>{V.appendChild(Ee),ne.current.push(()=>Ee.remove())},Ne=V=>{const Ee=t.createBean(new V);return Re.current.push(Ee),Ee},Ve=(V,Ee,At)=>{ze(V,document.createComment(At)),ze(V,Ne(Ee).getGui())};Ve(De,z2," AG Fake Horizontal Scroll ");const kt=s?.getOverlayWrapperCompClass();kt&&Ve(De,kt," AG Overlay Wrapper "),Q.current&&Ve(Q.current,_2," AG Fake Vertical Scroll ");const Et={setRowAnimationCssOnBodyViewport:i,setColumnCount:V=>{L.current&&CS(L.current,V)},setRowCount:V=>{L.current&&fS(L.current,V)},setTopHeight:r,setBottomHeight:l,setStickyTopHeight:d,setStickyTopTop:h,setStickyTopWidth:m,setTopInvisible:F,setBottomInvisible:E,setColumnMovingCss:(V,Ee)=>U.current.toggleCss(V,Ee),updateLayoutClasses:W,setAlwaysVerticalScrollClass:P,setPinnedTopBottomOverflowY:M,setCellSelectableCss:(V,Ee)=>N(Ee?V:null),setBodyViewportWidth:V=>{J.current&&(J.current.style.width=V)},registerBodyViewportResizeListener:V=>{if(J.current){const Ee=Gs(e,J.current,V);ne.current.push(()=>Ee())}},setStickyBottomHeight:v,setStickyBottomBottom:b,setStickyBottomWidth:x,setGridRootRole:V=>De.setAttribute("role",V)},Ut=t.createBean(new G2);Re.current.push(Ut),Ut.setComp(Et,De,J.current,de.current,me.current,H.current,te.current)},[]),Fe=g.useMemo(()=>Yt("ag-root","ag-unselectable",A),[A]),ie=g.useMemo(()=>Yt("ag-body-viewport",o,A,D,k),[o,A,D,k]),$=g.useMemo(()=>Yt("ag-body",A),[A]),q=g.useMemo(()=>Yt("ag-floating-top",y?"ag-invisible":null,k),[k,y]),se=g.useMemo(()=>Yt("ag-sticky-top",k),[k]),B=g.useMemo(()=>Yt("ag-sticky-bottom",C==="0px"?"ag-invisible":null,k),[k,C]),pe=g.useMemo(()=>Yt("ag-floating-bottom",R?"ag-invisible":null,k),[k,R]),le=g.useMemo(()=>({height:n,minHeight:n,overflowY:T}),[n,T]),re=g.useMemo(()=>({height:c,top:u,width:p}),[c,u,p]),Ce=g.useMemo(()=>({height:C,bottom:w,width:S}),[C,w,S]),xe=g.useMemo(()=>({height:a,minHeight:a,overflowY:T}),[a,T]),Le=De=>g.createElement(WA,{name:De,key:`${De}-container`}),fe=({section:De,children:ze,className:Ne,style:Ve})=>g.createElement("div",{ref:De,className:Ne,role:"presentation",style:Ve},ze.map(Le));return g.createElement("div",{ref:_,className:Fe},g.createElement(TA,null),fe({section:de,className:q,style:le,children:["topLeft","topCenter","topRight","topFullWidth"]}),g.createElement("div",{className:$,ref:Q,role:"presentation"},fe({section:J,className:ie,children:["left","center","right","fullWidth"]})),fe({section:H,className:se,style:re,children:["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"]}),fe({section:te,className:B,style:Ce,children:["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"]}),fe({section:me,className:pe,style:xe,children:["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"]}))},jA=g.memo(_A),UA=(e,t)=>{const{children:s,eFocusableElement:o,onTabKeyDown:i,gridCtrl:n,forceFocusOutWhenTabGuardsAreEmpty:r,isEmpty:a}=e,{context:l}=g.useContext(Ct),c=g.useRef(null),d=g.useRef(null),u=g.useRef(),h=w=>{const b=w==null?void 0:parseInt(w,10).toString();for(const S of[c,d])b===void 0?S.current?.removeAttribute("tabindex"):S.current?.setAttribute("tabindex",b)};g.useImperativeHandle(t,()=>({forceFocusOutOfContainer(w){u.current?.forceFocusOutOfContainer(w)}}));const p=g.useCallback(()=>{const w=c.current,b=d.current;if(!w&&!b||l.isDestroyed()){u.current=l.destroyBean(u.current);return}if(w&&b){const S={setTabIndex:h};u.current=l.createBean(new qm({comp:S,eTopGuard:w,eBottomGuard:b,eFocusableElement:o,onTabKeyDown:i,forceFocusOutWhenTabGuardsAreEmpty:r,focusInnerElement:x=>n.focusInnerElement(x),isEmpty:a}))}},[]),m=g.useCallback(w=>{c.current=w,p()},[p]),C=g.useCallback(w=>{d.current=w,p()},[p]),v=w=>{const b=w==="top"?Di.TAB_GUARD_TOP:Di.TAB_GUARD_BOTTOM;return g.createElement("div",{className:`${Di.TAB_GUARD} ${b}`,role:"presentation",ref:w==="top"?m:C})};return g.createElement(g.Fragment,null,v("top"),s,v("bottom"))},$A=g.forwardRef(UA),qA=g.memo($A),KA=({context:e})=>{const[t,s]=g.useState(""),[o,i]=g.useState(""),[n,r]=g.useState(null),[a,l]=g.useState(null),[c,d]=g.useState(!1),[u,h]=g.useState(),p=g.useRef(),m=g.useRef(null),C=g.useRef(),[v,w]=g.useState(null),b=g.useRef(()=>{}),S=g.useRef(),x=g.useRef([]),y=g.useCallback(()=>{},[]);Co(" AG Grid ",m);const F=g.useCallback(M=>{if(m.current=M,p.current=M?e.createBean(new VF):e.destroyBean(p.current),!M||e.isDestroyed())return;const k=p.current;b.current=k.focusInnerElement.bind(k);const N={destroyGridUi:()=>{},setRtlClass:s,forceFocusOutOfContainer:A=>{if(!A&&S.current?.isDisplayed()){S.current.forceFocusOutOfContainer(A);return}C.current?.forceFocusOutOfContainer(A)},updateLayoutClasses:i,getFocusableContainers:()=>{const A=[],W=m.current?.querySelector(".ag-root");W&&A.push({getGui:()=>W});for(const U of x.current)U.isDisplayed()&&A.push(U);return A},setCursor:r,setUserSelect:l};k.setComp(N,M,M),d(!0)},[]);g.useEffect(()=>{const M=p.current,k=m.current;if(!u||!M||!v||!k||e.isDestroyed())return;const N=[],{watermarkSelector:A,paginationSelector:W,sideBarSelector:U,statusBarSelector:L,gridHeaderDropZonesSelector:de}=M.getOptionalSelectors(),H=[];if(de){const Q=e.createBean(new de.component),J=Q.getGui();k.insertAdjacentElement("afterbegin",J),H.push(J),N.push(Q)}if(U){const Q=e.createBean(new U.component),J=Q.getGui(),me=v.querySelector(".ag-tab-guard-bottom");me&&(me.insertAdjacentElement("beforebegin",J),H.push(J)),N.push(Q),x.current.push(Q)}const te=Q=>{const J=e.createBean(new Q),me=J.getGui();return k.insertAdjacentElement("beforeend",me),H.push(me),N.push(J),J};if(L&&te(L.component),W){const Q=te(W.component);S.current=Q,x.current.push(Q)}return A&&te(A.component),()=>{e.destroyBeans(N);for(const Q of H)Q.remove()}},[u,v,e]);const R=g.useMemo(()=>Yt("ag-root-wrapper",t,o),[t,o]),E=g.useMemo(()=>Yt("ag-root-wrapper-body","ag-focus-managed",o),[o]),D=g.useMemo(()=>({userSelect:a??"",WebkitUserSelect:a??"",cursor:n??""}),[a,n]),P=g.useCallback(M=>{C.current=M,h(M!==null)},[]),T=g.useCallback(()=>!p.current?.isFocusable(),[]);return g.createElement("div",{ref:F,className:R,style:D,role:"presentation"},g.createElement("div",{className:E,ref:w,role:"presentation"},c&&v&&!e.isDestroyed()&&g.createElement(Ct.Provider,{value:e.getBeans()},g.createElement(qA,{ref:P,eFocusableElement:v,onTabKeyDown:y,gridCtrl:p.current,forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:T},g.createElement(jA,null)))))},YA=g.memo(KA),ZA=class extends O{postConstruct(){if(this.beans.colAutosize){const e=this.queueResizeOperationsForTick.bind(this);this.addManagedEventListeners({rowExpansionStateChanged:e,expandOrCollapseAll:e,cellValueChanged:e,rowNodeDataChanged:e,rowDataUpdated:e})}}queueResizeOperationsForTick(){const e=this.beans.colAutosize;e.shouldQueueResizeOperations=!0,setTimeout(()=>{e.processResizeOperations()},0)}areHeaderCellsRendered(){return this.beans.ctrlsSvc.getHeaderRowContainerCtrls().every(e=>e.getAllCtrls().every(t=>t.areCellsRendered()))}areCellsRendered(){return this.beans.rowRenderer.getAllRowCtrls().every(e=>e.isRowRendered()&&e.getAllCellCtrls().every(t=>!!t.eGui))}},wv={setGridApi:void 0,maxComponentCreationTimeMs:void 0,children:void 0},XA={gridOptions:void 0,modules:void 0,containerStyle:void 0,className:void 0,passGridApi:void 0,componentWrappingElement:void 0,...wv},bv=new Set(Object.keys(XA)),QA=new Set(Object.keys(wv)),Sv=e=>{const t=g.useRef(),s=g.useRef(null),o=g.useRef(null),i=g.useRef([]),n=g.useRef([]),r=g.useRef(e),a=g.useRef(),l=g.useRef(),c=g.useRef(!1),[d,u]=g.useState(void 0),[,h]=g.useState(0),p=g.useCallback(w=>{if(s.current=w,!w){for(const T of i.current)T();i.current.length=0;return}const b=e.modules||[];o.current||(o.current=new CA(()=>h(T=>T+1),e.componentWrappingElement,e.maxComponentCreationTimeMs),i.current.push(()=>{o.current?.destroy(),o.current=null}));const S=Cy(e.gridOptions,e,Object.keys(e).filter(T=>!bv.has(T))),x=()=>{if(c.current){const T=()=>a.current?.shouldQueueUpdates()?void 0:n.current.shift();let M=T();for(;M;)M(),M=T()}},y=new s8(x);a.current=y;const F=new ZA,R={providedBeanInstances:{frameworkCompWrapper:new e8(o.current,S),renderStatus:F},modules:b,frameworkOverrides:y,setThemeOnGridDiv:!0},E=T=>{u(T),T.createBean(F),i.current.push(()=>{T.destroy()}),T.getBean("ctrlsSvc").whenReady({addDestroyFunc:M=>{i.current.push(M)}},()=>{if(T.isDestroyed())return;const M=t.current;M&&e.passGridApi?.(M)})},D=T=>{T.getBean("ctrlsSvc").whenReady({addDestroyFunc:M=>{i.current.push(M)}},()=>{for(const M of n.current)M();n.current.length=0,c.current=!0})},P=new h4;S.gridId??(S.gridId=l.current),t.current=P.create(w,S,E,D,R),i.current.push(()=>{t.current=void 0}),t.current&&(l.current=t.current.getGridId())},[]),m=g.useMemo(()=>({height:"100%",...e.containerStyle||{}}),[e.containerStyle]),C=g.useCallback(w=>{c.current&&!a.current?.shouldQueueUpdates()?w():n.current.push(w)},[]);g.useEffect(()=>{const w=JA(r.current,e);r.current=e,C(()=>{t.current&&vy(w,t.current)})},[e]);const v=!g.useSyncExternalStore||ga(e,"renderingMode")==="legacy"?"legacy":"default";return g.createElement("div",{style:m,className:e.className,ref:p},g.createElement(hv.Provider,{value:v},d&&!d.isDestroyed()?g.createElement(YA,{key:d.instanceId,context:d}):null,o.current?.getPortals()??null))};function JA(e,t){const s={};for(const o of Object.keys(t)){if(bv.has(o)){QA.has(o)&&z(274,{prop:o});continue}const i=t[o];e[o]!==i&&(s[o]=i)}return s}var e8=class extends C4{constructor(e,t){super(),this.parent=e,this.gridOptions=t}createWrapper(e,t){const s=this.gridOptions;if(ga(s,"reactiveCustomComponents")){const r=(a=>{switch(a){case"filter":return ga(s,"enableFilterHandlers")?rA:nA;case"floatingFilterComponent":return ga(s,"enableFilterHandlers")?cA:lA;case"dateComponent":return oA;case"dragAndDropImageComponent":return iA;case"loadingOverlayComponent":return uA;case"noRowsOverlayComponent":return gA;case"statusPanel":return pA;case"toolPanel":return fA;case"menuItem":return hA;case"cellRenderer":return sA;case"innerHeaderComponent":return dA}})(t.name);if(r)return new r(e,this.parent,t)}else switch(t.name){case"filter":case"floatingFilterComponent":case"dateComponent":case"dragAndDropImageComponent":case"loadingOverlayComponent":case"noRowsOverlayComponent":case"statusPanel":case"toolPanel":case"menuItem":case"cellRenderer":Ju();break}const i=!t.cellRenderer&&t.name!=="toolPanel";return new mv(e,this.parent,t,i)}},t8=g.forwardRef((e,t)=>{const s=g.useContext(Ct),{registry:o,context:i,gos:n,rowModel:r}=s,[a,l]=g.useState(()=>new es),[c,d]=g.useState(()=>new es),[u,h]=g.useState(),[p,m]=g.useState(),C=g.useRef(),v=g.useRef(null),w=g.useRef(),b=g.useMemo(()=>YS(e.api.getGridId(),u?.rowModelType??"clientSide"),[e]),S=g.useMemo(()=>a.toString()+" ag-details-row",[a]),x=g.useMemo(()=>c.toString()+" ag-details-grid",[c]);t&&g.useImperativeHandle(t,()=>({refresh(){return C.current?.refresh()??!1}})),e.template&&z(230);const y=g.useCallback(R=>{if(v.current=R,!R||i.isDestroyed()){C.current=i.destroyBean(C.current),w.current?.();return}const E={toggleCss:(P,T)=>l(M=>M.setClass(P,T)),toggleDetailGridCss:(P,T)=>d(M=>M.setClass(P,T)),setDetailGrid:P=>h(P),setRowData:P=>m(P),getGui:()=>v.current},D=o.createDynamicBean("detailCellRendererCtrl",!0);if(D&&(i.createBean(D),D.init(E,e),C.current=D,n.get("detailRowAutoHeight"))){const P=()=>{if(v.current==null)return;const T=v.current.clientHeight;T!=null&&T>0&&setTimeout(()=>{e.node.setRowHeight(T),(Qe(n)||zo(n))&&r.onRowHeightChanged()},0)};w.current=Gs(s,R,P),P()}},[]),F=g.useCallback(R=>{C.current?.registerDetailWithMaster(R)},[]);return g.createElement("div",{className:S,ref:y},u&&g.createElement(Sv,{className:x,...u,modules:b,rowData:p,passGridApi:F}))}),s8=class extends Km{constructor(e){super("react"),this.processQueuedUpdates=e,this.queueUpdates=!1,this.renderingEngine="react",this.frameworkComponents={agGroupCellRenderer:cp,agGroupRowRenderer:cp,agDetailCellRenderer:t8},this.wrapIncoming=(t,s)=>s==="ensureVisible"?Zk(t):t()}frameworkComponent(e){return this.frameworkComponents[e]}isFrameworkComponent(e){if(!e)return!1;const t=e.prototype;return!(t&&"getGui"in t)}getLockOnRefresh(){this.queueUpdates=!0}releaseLockOnRefresh(){this.queueUpdates=!1,this.processQueuedUpdates()}shouldQueueUpdates(){return this.queueUpdates}runWhenReadyAsync(){return Yk()}},o8=class extends g.Component{constructor(){super(...arguments),this.apiListeners=[],this.setGridApi=e=>{this.api=e;for(const t of this.apiListeners)t(e)}}registerApiListener(e){this.apiListeners.push(e)}componentWillUnmount(){this.apiListeners.length=0}render(){return g.createElement(Sv,{...this.props,passGridApi:this.setGridApi})}},yv=(e=>(e.Dropdown="dropdown",e.Menu="menu",e))(yv||{}),Ht=(e=>(e.Click="click",e.Hover="hover",e.ContextMenu="contextMenu",e))(Ht||{}),Bi=(e=>(e.Item="item",e.Divider="divider",e.PlainText="plainText",e))(Bi||{});const i8=ue("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),n8=ue("z-[53] overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none"),r8=ue("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-none","hover:bg-accent-primary-alpha px-3","dial-small-text h-[34px] rounded text-primary"),a8="opacity-75 !cursor-not-allowed",l8="text-error",c8="my-1 border-t border-hover border-secondary",yn=4,eh=({ariaLabel:e,className:t,size:s=24,onClose:o,...i})=>f.jsx(no,{"aria-label":e,className:oe("text-secondary hover:enabled:text-accent-primary",t,"w-auto h-auto"),onClick:o,icon:f.jsx(G.IconX,{size:s}),...i}),Ft=({children:e,menu:t,renderOverlay:s,trigger:o=[Ht.Click],placement:i,disabled:n=!1,open:r,defaultOpen:a=!1,onOpenChange:l,closable:c=!1,onClose:d,className:u,listClassName:h,outsidePressIgnoreRef:p,outsideClosable:m=!0,allowedPlacements:C,anchorToMouse:v=!1,matchReferenceWidth:w=!0,maxDropdownHeight:b})=>{const[S,x]=g.useState(a),y=r!==void 0,F=y?!!r:S,R=g.useRef(null),E=g.useCallback(_=>{y||x(_),l?.(_)},[y,l]),D=g.useId(),P=i===void 0,T=_=>"clientWidth"in _?_.clientWidth:_.getBoundingClientRect?.()?.width??0,{refs:M,floatingStyles:k,context:N}=Ie.useFloating({placement:i,open:F,onOpenChange:E,whileElementsMounted:Ie.autoUpdate,middleware:[Ie.offset({mainAxis:yn,crossAxis:0}),P?Ie.autoPlacement({alignment:"start",crossAxis:!0,padding:yn,allowedPlacements:C}):Ie.flip({padding:yn}),Ie.shift({padding:yn}),Ie.size({padding:yn,apply({availableWidth:_,availableHeight:Fe,elements:ie}){const $=ie.floating,q=T(ie.reference);$.style.setProperty("--fui-available-height",`${Math.floor(Fe)}px`),$.style.setProperty("--reference-width",w?`${Math.round(q)}px`:"0px"),w?$.style.minWidth=`${Math.round(q)}px`:$.style.removeProperty("min-width"),$.style.maxWidth=`${Math.floor(_)}px`;const se=Math.floor(Fe);$.style.maxHeight=`${b?Math.min(se,b):se}px`}})]}),A=Ie.useClick(N,{enabled:o.includes(Ht.Click)&&!n}),W=Ie.useHover(N,{enabled:o.includes(Ht.Hover)&&!n,move:!1,restMs:40,delay:{open:80,close:80}}),U=Ie.useDismiss(N,{bubbles:!0,referencePress:!1,outsidePress:_=>{if(!m)return!1;const Fe=_.target;return!(p?.current&&Fe instanceof Node&&p.current.contains(Fe))}}),L=Ie.useRole(N,{role:"menu"}),{getReferenceProps:de,getFloatingProps:H}=Ie.useInteractions([A,W,U,L]),te=g.useCallback((_,Fe)=>{M.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:_,y:Fe,top:Fe,left:_,right:_,bottom:Fe})})},[M]),Q=g.useCallback(_=>{!o.includes(Ht.ContextMenu)||n||(_.preventDefault(),v&&(te(_.clientX,_.clientY),R.current=document.elementFromPoint(_.clientX,_.clientY)),E(!0))},[v,n,E,te,o]),J=g.useCallback(_=>{!v||n||(o.includes(Ht.ContextMenu)&&F&&E(!1),te(_.clientX,_.clientY),R.current=document.elementFromPoint(_.clientX,_.clientY))},[v,n,te,F,o,E]);g.useEffect(()=>{n&&F&&E(!1)},[n,F,E]);const me=g.useCallback(_=>Fe=>{_.disabled||(_.onClick?.({key:_.key,domEvent:Fe}),t?.onClick?.({key:_.key,domEvent:Fe}),E(!1))},[t,E]),Re=g.useMemo(()=>s?s():t?f.jsxs(f.Fragment,{children:[t.header&&f.jsx(f.Fragment,{children:typeof t.header=="function"?t.header():t.header}),f.jsx("div",{role:"none",className:"py-1","aria-label":"dropdown",children:t.items.map(_=>_.type===Bi.Divider?f.jsx("div",{role:"separator",className:c8},_.key):_.type===Bi.PlainText?f.jsx("div",{className:oe("px-3 py-2 text-secondary dial-caption",_.className),children:_.label},_.key):f.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!_.disabled,className:ue(r8,_.disabled&&a8,_.danger&&l8,_.className),disabled:_.disabled,onClick:me(_),children:[_.icon&&f.jsx("span",{className:ue(_.danger&&"text-error",_.disabled&&"text-secondary"),children:f.jsx($e,{icon:_.icon})}),f.jsx("span",{className:ue("flex-1 truncate text-left",_.danger&&"text-error",_.disabled&&"text-secondary"),"aria-labelledby":"item-text",children:_.label})]},_.key))}),t.footer&&f.jsx(f.Fragment,{children:typeof t.footer=="function"?t.footer():t.footer})]}):null,[me,t,s]),ne=de({onContextMenu:Q,onMouseDown:J});return g.useEffect(()=>{if(!F)return;const _=M.reference.current;let Fe=null;if(_ instanceof Element?Fe=_:R.current instanceof Element&&(Fe=R.current),!Fe)return;const ie=new IntersectionObserver(([$])=>{$.isIntersecting||E(!1)},{root:null,threshold:0});return ie.observe(Fe),()=>ie.disconnect()},[F,M.reference,E]),f.jsxs(f.Fragment,{children:[f.jsx("span",{ref:M.setReference,className:ue(i8,n&&"!cursor-not-allowed opacity-75",u),"aria-haspopup":"menu","aria-expanded":F,"aria-controls":D,...ne,children:e}),F&&f.jsx(Ie.FloatingPortal,{children:f.jsx(Ie.FloatingFocusManager,{context:N,modal:!1,initialFocus:-1,returnFocus:!0,children:f.jsxs("div",{id:D,ref:M.setFloating,style:k,className:ue(n8,!w&&"w-max",h),...H(),children:[c&&f.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:f.jsx(eh,{ariaLabel:"Close dropdown",onClose:_=>{d?.(_),E(!1)}})}),Re]})})})]})},d8="h-full w-full",pp=".ag-checkbox-input",Vc={accentColor:"var(--controls-bg-accent, #5C8DEA)",backgroundColor:"var(--bg-layer-3, #1D2439)",oddRowBackgroundColor:"var(--bg-layer-2, #161B2D)",selectedRowBackgroundColor:"var(--bg-accent-primary-alpha, #7DA4FF26)",borderColor:"var(--bg-layer-4, #242C42)",rowBorder:"1px solid var(--stroke-tertiary, #0C101D)",rowHoverColor:"var(--bg-accent-primary-alpha, #7DA4FF26)",borderRadius:3,browserColorScheme:"dark",chromeBackgroundColor:"var(--bg-layer-1, #0C101D)",foregroundColor:"var(--text-primary, ##EEF1F7)",headerFontSize:14,headerFontWeight:600,headerTextColor:"var(--text-secondary, #7F8792)",spacing:4,wrapperBorderRadius:3,fontSize:14,fontFamily:{googleFont:"var(--theme-font, var(--font-inter))"}},zc=40;var mo=(e=>(e.API="api",e.ROW_DATA_CHANGED="rowDataChanged",e.CHECKBOX_SELECTED="checkboxSelected",e))(mo||{});const u8=(e,t,s,o,i)=>{const n=typeof e=="string"?e.toLowerCase():e,r=typeof t=="string"?t.toLowerCase():t;return n===r?0:n?r?n>r?1:-1:i?1:-1:i?-1:1};var Vn=(e=>(e.MULTIPLE="MULTIPLE",e.SINGLE="SINGLE",e))(Vn||{});const xv="en-US",Rv={year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"},h8="text-primary",Wc=40,Fv={minWidth:Wc,width:Wc,maxWidth:Wc},g8={cellClass:"ag-grid-no-checkbox",...Fv},p8={...Fv};function f8(e,t){let s=null;return(...o)=>{s&&clearTimeout(s),s=setTimeout(()=>e(...o),t)}}Kk({testIdAttribute:"dataQA"});Mf.registerModules([jk]);const th=({columnDefs:e,rowData:t,additionalGridOptions:s,getContextMenuItems:o,className:i,ariaLabel:n="Data grid",wrapCustomCellRenderers:r=!0,disabledRowIds:a,selectedRowIds:l,selectionOnHover:c=!0,onSelectionChange:d,onGridApiChange:u,getRowId:h=R=>String(R.id??JSON.stringify(R)),alternateOddRowColors:p=!1,filterPlaceholder:m="Enter value",emptyStateIcon:C,emptyStateTitle:v="No results found",emptyStateDescription:w="Sorry, we couldn't find any results for your search.",loading:b=!1,wrapperBorder:S=!0,withoutHeaderBorders:x=!1,allowDisabledContextMenu:y=!1,selectionMode:F})=>{const[R,E]=g.useState(zc),[D,P]=g.useState(),T=g.useId(),M=g.useRef(new Set),k=g.useRef(void 0),N=g.useMemo(()=>({...Vc,oddRowBackgroundColor:p?Vc.oddRowBackgroundColor:Vc.backgroundColor,wrapperBorder:S}),[p,S]),A=g.useCallback(q=>{q.api.sizeColumnsToFit(),E(zc)},[]),W=g.useCallback(q=>{if(q.data){const se=h(q.data),B=a?.has(se)??!1,pe=B&&!y,le=q.value==null?"":String(q.value),re=o?.(q.data)??[];return f.jsx(Ft,{trigger:[Ht.ContextMenu],menu:{items:re},anchorToMouse:!0,matchReferenceWidth:!0,className:"w-full",disabled:pe,children:f.jsx("span",{className:"block min-w-0 h-full max-w-full",children:f.jsx(ht,{text:le,className:"max-w-full h-full",hideTooltip:B})})})}},[o,a,h,y]),U=g.useCallback(q=>q===mo.API||q===mo.ROW_DATA_CHANGED,[]),L=g.useCallback(q=>{if(!D)return;const B=(q.selectedNodes||[]).map(le=>le.data),pe=new Set(B.map(h));M.current=pe,k.current=q.source,U(q.source)||d?.(pe,B)},[D,h,U,d]),de=g.useMemo(()=>f8(q=>L?.(q),100),[L]),H=g.useCallback(q=>{if(!q.data)return null;const se=h(q.data),B=q.node.isSelected(),pe=a?.has(se),le=`row-select-${se}`;return f.jsx("div",{className:"h-6 w-6 flex items-center justify-center",children:f.jsx(Zd,{className:"w-[18px] h-[18px]",inputId:le,checked:B,disabled:pe,name:"gridradiobutton",value:"selected",onChange:()=>{pe||(q.node.setSelected(!0,!0,mo.CHECKBOX_SELECTED),q.api.refreshCells({columns:[q.column?.getColId()]}))}})})},[h,a]),te=g.useCallback(q=>{const se="dial-row-select",B="dial-row-select-visible";return q?se:`${se} ${B}`},[]),Q=g.useMemo(()=>{if(F===Vn.SINGLE)return{...g8,cellRenderer:H};if(F===Vn.MULTIPLE)return{...p8,headerClass:()=>te(c),cellClass:q=>{const se=q.data?h(q.data):null;let B=te(c);return se&&a?.has(se)&&(B+=" opacity-50 pointer-events-none"),B}}},[a,h,H,F,c,te]),J=g.useCallback(q=>{const se=typeof r=="function"?r(q):!!r;if(!q.cellRenderer)return{...q,cellRenderer:W};if(!se)return q;const B=q.cellRenderer;return{...q,cellRenderer:le=>{const re=le.data?o?.(le.data)??[]:[];let Ce=null;if(typeof B=="function"){const fe=B;Ce=f.jsx(fe,{...le})}else Ce=W(le);const xe=le.data?h(le.data):null,Le=xe?a?.has(xe):!1;return f.jsx(Ft,{trigger:[Ht.ContextMenu],menu:{items:re},anchorToMouse:!0,matchReferenceWidth:!0,className:ue("w-full h-full",Le&&"!cursor-not-allowed opacity-75"),disabled:Le&&!y,children:f.jsx("span",{className:"block min-w-0 max-w-full flex-1",children:Ce})})}}},[a,o,h,W,r,y]),me=g.useMemo(()=>r?(e??[]).map(J):e??[],[e,r,r?J:null]),Re=g.useMemo(()=>({minWidth:150,resizable:!0,sortable:!0,floatingFilter:!0,filter:"agTextColumnFilter",filterParams:{filterPlaceholder:m,buttons:["reset"]},comparator:u8.bind(void 0)}),[m]),ne=q=>{const se=document.querySelector(pp);se&&se.setAttribute("aria-description",od);const B=me.map(pe=>({...pe,sort:void 0}));q.api.updateGridOptions({columnDefs:B,rowData:t}),q.api.sizeColumnsToFit(),P(q.api),s?.onGridReady?.(q),u?.(q.api)};g.useEffect(()=>{D&&D.redrawRows()},[D]);const _=g.useCallback(()=>f.jsx(rr,{title:v,description:w,containerClassName:"gap-3",titleClassName:"mt-2 !text-lg",icon:C||f.jsx(G.IconZoomCancel,{size:100,stroke:.5,className:"text-secondary"})}),[v,w,C]),Fe=g.useMemo(()=>{if(F)return{mode:F===Vn.SINGLE?"singleRow":"multiRow",isRowSelectable:q=>{const se=q.data?h(q.data):null;return se?!a?.has(se):!0}}},[a,h,F]);g.useEffect(()=>{D&&t&&M.current.size&&M.current.forEach(q=>{const se=D.getRowNode(q);se&&!se.isSelected()&&se.setSelected(!0,!1,mo.API)})},[D,t]),g.useEffect(()=>{D&&l&&(D.deselectAll("all",mo.API),l.forEach(q=>{const se=D.getRowNode(q);se&&!se.isSelected()&&se.setSelected(!0,!1,mo.API)}))},[D,l]);const ie=g.useCallback(q=>q.data?h(q.data):"",[h]),$=g.useCallback(()=>{document.querySelectorAll(`.ag-row ${pp}`).forEach(q=>{q.setAttribute("aria-description",od)})},[]);return g.useEffect(()=>{const q=U(k.current);if(D&&l?.size&&q){const se=Array.from(l)[0];if(se){const B=D.getRowNode(se);B&&D.ensureNodeVisible(B)}}},[D,U,l]),f.jsx("div",{className:ue(d8,i,F&&"with-selection-column",x&&"dial-without-header-borders"),"aria-label":n,role:"region","aria-busy":b,children:f.jsx("div",{className:"ag-theme-balham-dark h-full overflow-x-auto",role:"table","aria-describedby":T,children:f.jsx(o8,{rowModelType:"clientSide",headerHeight:zc,rowHeight:R,cellSelection:!1,theme:_3.withPart(y3).withParams({...N}),autoSizeStrategy:{type:"fitGridWidth"},columnDefs:me,defaultColDef:Re,selectionColumnDef:Q,onGridSizeChanged:A,onGridReady:ne,loading:b,suppressCellFocus:!0,suppressDragLeaveHidesColumns:!0,noRowsOverlayComponent:_,rowData:t,rowSelection:Fe,onSelectionChanged:de,getRowId:ie,onRowDataUpdated:$,onBodyScroll:$,onFirstDataRendered:$,...s})})})};var Xa=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(Xa||{}),Qa=(e=>(e.Mobile="mobile",e.Tablet="tablet",e))(Qa||{});const na=({tab:e,active:t,invalid:s,className:o,horizontal:i,onClick:n})=>{const r=oe("rounded h-[38px] items-center flex flex-row border-transparent cursor-pointer dial-small-text leading-4 hover:text-accent-primary",{"border-b-2 px-4":i,"border-l-2 px-3":!i}),a=oe(r,{"bg-layer-4":i,"bg-layer-1 text-secondary pointer-events-none":e.disabled,"bg-accent-primary-alpha text-primary":t&&!e.disabled,"text-primary":!t&&!e.disabled,"border-b-accent-primary":t&&i&&!e.disabled,"border-l-accent-primary":t&&!i&&!e.disabled},o);return f.jsxs("button",{role:"tab",className:a,onClick:()=>n(e.id),disabled:e.disabled,children:[f.jsx(ht,{text:e.label,contentClassName:"max-w-[200px]",className:"max-w-[200px]"}),(s||e.invalid)&&f.jsx("div",{className:"text-error pl-1",children:f.jsx(G.IconExclamationCircle,{...Y})}),e.warning&&f.jsx("div",{className:"text-warning pl-1",children:f.jsx(G.IconAlertTriangle,{...Y})})]})},m8=12;var Qs=(e=>(e.Undefined="undefined",e.Mobile="mobile",e.Tablet="tablet",e.Desktop="desktop",e))(Qs||{});const fp=()=>typeof window<"u"&&window.innerWidth<640,_c=()=>{if(typeof window>"u")return Qs.Undefined;const e=window.innerWidth;return e>=1024?Qs.Desktop:e<640?Qs.Mobile:Qs.Tablet},C8=()=>{const[e,t]=g.useState(()=>typeof window>"u"?Qs.Desktop:_c());return g.useEffect(()=>{t(_c());const s=()=>t(_c());return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),e},Ev=({tabs:e,activeTab:t,onClick:s,orientation:o=Xa.Horizontal,screenThreshold:i=Qa.Tablet,smallScreenContainerClassName:n,smallScreenDropdownItemClassName:r,desktopDropdownClassName:a,desktopTabClassName:l})=>{const[c,d]=g.useState(!1),[u,h]=g.useState(!1),[p,m]=g.useState(!1),C=C8(),v=C===Qs.Mobile||i===Qa.Tablet&&C===Qs.Tablet,w=o===Xa.Horizontal,b=g.useRef(null),S=g.useRef(null),x=g.useRef(null),y=e.find(P=>P.id===t),F=g.useMemo(()=>ue("flex gap-2",w?"flex-row flex-nowrap overflow-x-auto":"flex-col flex-wrap w-full"),[w]),R=g.useCallback(()=>{const P=S.current;P&&m(P.scrollWidth>P.clientWidth)},[]),E=g.useCallback(()=>{const P=x.current,T=S.current;if(!P||!T)return;const M=P.getBoundingClientRect(),k=T.getBoundingClientRect();if(M.width===0||k.width===0)return;const N=m8;let A=T.scrollLeft;if(M.left<k.left+N)A-=k.left+N-M.left;else if(M.right>k.right-N)A+=M.right-(k.right-N);else return;const W=Math.max(0,T.scrollWidth-T.clientWidth);A=Math.max(0,Math.min(A,W)),A!==T.scrollLeft&&T.scrollTo({left:A,behavior:"smooth"})},[]),D=g.useCallback(P=>{s(P),P===t&&E()},[s,t,E]);return g.useEffect(()=>{R();const P=new ResizeObserver(()=>R()),T=S.current;return T&&P.observe(T),()=>P.disconnect()},[e,R]),g.useEffect(()=>{E()},[t,E]),v?f.jsx("div",{role:"tablist",className:oe("h-11 flex items-center bg-layer-3 px-4",n),children:f.jsx(Ft,{trigger:[Ht.Click],open:c,onOpenChange:d,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],renderOverlay:()=>e.map(P=>f.jsx(na,{tab:P,active:P.id===t,onClick:T=>{D(T),d(!1)},className:oe("w-full rounded-none h-11 items-center px-6",r)},P.id)),children:f.jsxs("div",{className:"flex gap-2 items-center h-11 cursor-pointer",children:[f.jsx(na,{tab:y,active:!0,onClick:D,className:"rounded-none bg-transparent border-l-0 border-b-0 h-full items-center px-0"},t),f.jsx($e,{icon:f.jsx(G.IconChevronDown,{size:pt.SM}),className:ue("text-primary transition-transform",c&&"rotate-180")})]})})}):f.jsxs("div",{ref:b,className:"flex w-full items-start",children:[f.jsx("div",{ref:S,role:"tablist",className:F,children:e.map(P=>f.jsx("div",{ref:t===P.id?x:void 0,className:"w-full",children:f.jsx(na,{tab:P,active:t===P.id,onClick:D,horizontal:w,className:oe("w-full",l)})},P.id))}),p&&f.jsx("div",{className:"flex items-center ml-2",children:f.jsx(Ft,{trigger:[Ht.Click],open:u,onOpenChange:h,placement:"bottom-end",renderOverlay:()=>e.map(P=>f.jsx(na,{tab:P,active:P.id===t,onClick:T=>{D(T),h(!1)},className:"w-full rounded-none h-8 items-center px-3 py-2"},P.id)),children:f.jsx(ss,{iconBefore:f.jsx(G.IconDotsVertical,{size:Nt}),className:oe("w-8 h-8 flex items-center justify-center rounded border",u?"bg-layer-4 border-transparent":"border-primary",a)})})})]})},v8="w-full overflow-hidden",w8="flex flex-nowrap items-center gap-2 min-w-0 px-0 py-0 whitespace-nowrap",Dv="flex items-center gap-2 min-w-0 shrink-0 dial-small-text",b8="basis-[20%] flex-none",S8="flex-1 min-w-0",mp="inline-flex items-center gap-1 min-w-0 transition-colors",y8="text-secondary hover:text-accent-primary",x8="text-primary cursor-default",Pv="flex-none inline-flex items-center leading-none text-secondary",R8="items-center gap-1 min-w-0 transition-colors text-secondary hover:text-accent-primary",Tv=f.jsx(G.IconChevronRight,{size:pt.SM,"aria-hidden":"true"}),Dn=({label:e,href:t,onClick:s,disabled:o,isLast:i,separator:n=Tv,className:r,iconBefore:a,labelClassName:l,onBeforeNavigate:c,...d})=>{const u=async v=>{if(c&&!i&&!await c()){v.preventDefault();return}s&&s(v)},h=oe(Dv,i?S8:b8,r),p=(!!t||!!s)&&!i&&!o,m=p?oe(mp,y8):oe(mp,x8,o?"pointer-events-none opacity-75":""),C=typeof e=="string"?f.jsx(ht,{className:oe("cursor-pointer",l),text:e,id:"breadcrumb-item-content"}):f.jsx("span",{className:oe("flex-1 min-w-0 truncate cursor-pointer max-w-[300px]",l),"aria-label":"breadcrumb-item-content",children:e});return f.jsxs("li",{...d,className:h,"aria-label":d["aria-label"]||"breadcrumb-item",children:[p?f.jsxs("a",{href:t,onClick:u,className:m,children:[a,C]}):f.jsxs("span",{className:m,"aria-current":i?"page":void 0,"aria-disabled":o?"true":void 0,children:[a,C]}),!i&&f.jsx("span",{className:Pv,"aria-label":"separator",children:n})]})},Mv=({pathItems:e,separator:t=Tv,ariaLabel:s="Breadcrumb",className:o,children:i,labelClassName:n,onBeforeNavigate:r})=>{const a=g.useMemo(()=>e?.length?e:g.Children.toArray(i).filter(g.isValidElement).map(d=>{const u=d.props,{labelClassName:h,isLast:p,separator:m,...C}=u;return C}),[e,i]),l=g.useCallback(async d=>{const u=parseInt(d.key,10),h=a[u];if(r&&!await r()){d.domEvent.preventDefault();return}h.onClick?h.onClick(d.domEvent):h.href&&(window.location.href=h.href)},[a,r]),c=g.useMemo(()=>{if(a.length===0)return null;if(a.length<=3)return a.map((C,v)=>g.createElement(Dn,{...C,key:`item-${v}`,isLast:v===a.length-1,separator:t,labelClassName:n,onBeforeNavigate:r}));const d=a.at(0),u=a.slice(1,-2),h=a.at(-2),p=a.at(-1);if(!d||!h||!p)return null;const m=u.map((C,v)=>({key:String(v+1),label:typeof C.label=="string"?C.label:`Item ${v+1}`,disabled:C.disabled}));return f.jsxs(f.Fragment,{children:[g.createElement(Dn,{...d,key:"item-0",separator:t,labelClassName:n,onBeforeNavigate:r}),f.jsxs("li",{className:oe(Dv),children:[f.jsx(Ft,{menu:{items:m,onClick:l},placement:"bottom-start",matchReferenceWidth:!1,children:f.jsx("button",{type:"button","aria-label":"More breadcrumbs",className:R8,children:f.jsx(G.IconDots,{size:pt.SM})})}),f.jsx("span",{className:Pv,children:t})]}),g.createElement(Dn,{...h,key:`item-${a.length-2}`,separator:t,labelClassName:n,onBeforeNavigate:r}),g.createElement(Dn,{...p,key:`item-${a.length-1}`,isLast:!0,separator:t,labelClassName:n,onBeforeNavigate:r})]})},[a,t,n,l,r]);return f.jsx("nav",{"aria-label":s,className:oe(v8,o),children:f.jsx("ol",{className:w8,children:c})})},sh=(e,t)=>({appearance:o,...i})=>f.jsx(ss,{...i,variant:e,appearance:o||t}),Iv=(e,t)=>({variant:o,...i})=>f.jsx(ss,{...i,variant:o||t,appearance:e}),bs=sh(Ge.Primary,Me.Solid),ys=sh(Ge.Neutral,Me.Outlined),kv=sh(Ge.Error,Me.Outlined),F8=Iv(Me.Link,Ge.Primary),E8=Iv(Me.Ghost,Ge.Primary),Yi=(e,t)=>({appearance:o,...i})=>f.jsx(no,{...i,variant:e,appearance:o||t}),D8=(e,t)=>({variant:o,...i})=>f.jsx(no,{...i,variant:o||t,appearance:e}),P8=Yi(Ge.Primary,Me.Solid),T8=Yi(Ge.Neutral,Me.Outlined),Av=Yi(Ge.Error,Me.Outlined),M8=Yi(Ge.Secondary,Me.Ghost),I8=Yi(Ge.Tertiary,Me.Ghost),k8=Yi(Ge.Success,Me.Ghost),A8=D8(Me.Ghost,Ge.Primary),Lv=({iconClassName:e,label:t,...s})=>t?f.jsx(kv,{...s,label:t,appearance:Me.Ghost,iconBefore:f.jsx(G.IconTrashX,{...Y,className:e||""})}):f.jsx(Av,{...s,appearance:Me.Ghost,icon:f.jsx(G.IconTrashX,{...Y,className:e||""})}),L8=({className:e="",value:t,onChange:s,error:o,containerClassName:i,resize:n=!1,labelProps:r,caption:a,id:l,...c})=>{const d=oe("dial-textarea dial-input px-3 py-2",c.invalid&&"dial-input-error",c.disabled&&"dial-input-disable",n?"resize":"resize-none",e);return f.jsxs("div",{className:oe("flex flex-col gap-y-2",i),children:[r&&f.jsx(Bo,{...r,htmlFor:l}),f.jsx("textarea",{id:l,value:t||"",className:d,onChange:u=>s?.(u.currentTarget.value),...c}),f.jsx(ns,{text:o}),!o&&f.jsx(ir,{text:a})]})},oh=({label:e,switchId:t,isOn:s=!1,disabled:o,onChange:i,caption:n})=>{const r=ue("flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",s?"flex-row-reverse":"flex-row",o?"pointer-events-none":"",o?s?"bg-controls-disable":"bg-layer-4":s?"bg-accent-primary":"bg-layer-4"),a=g.useCallback(l=>{l.stopPropagation(),i?.(!s)},[i,s]);return f.jsxs("div",{className:"flex flex-row items-start",role:"switch",children:[f.jsx("input",{type:"checkbox",onChange:a,id:t,disabled:o,className:"invisible w-0 h-0",checked:s}),f.jsx("label",{htmlFor:t,className:r,"aria-describedby":n&&"caption",children:f.jsx("span",{className:ue("size-3 rounded-full",o?"bg-controls-disable-accent":"bg-controls-enable-primary")})}),(e||n)&&f.jsxs("div",{className:"flex flex-col gap-1 ml-2",children:[e&&f.jsx("span",{className:ue("dial-small-text py-[1px]",o?"text-secondary":"text-primary"),"aria-label":"switch-title",children:e}),n&&f.jsx("span",{id:"caption",className:"dial-tiny-text text-secondary",children:n})]})]})};var Wt=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(Wt||{});const O8="z-[52] flex items-center justify-center bg-blackout md:p-4",Cp="divide-tertiary divide-y",N8="flex flex-row justify-between py-4 px-6 items-center",H8={[Wt.Sm]:"dial-sm-popup",[Wt.Md]:"dial-md-popup",[Wt.Lg]:"dial-lg-popup"},Uo=({open:e=!1,header:t,portalId:s,className:o,overlayClassName:i,titleClassName:n,headerClassName:r,dividers:a=!0,dividerFooter:l=!0,children:c,footer:d,onClose:u,size:h=Wt.Md,hideClose:p=!1,closeOnOutsideClick:m=!0,preventKeyboardOnOpen:C=!1})=>{const v=g.useRef(null),{refs:w,context:b}=Ie.useFloating({open:e,onOpenChange:E=>{E||u?.(null)}}),S=Ie.useRole(b,{role:"dialog"}),x=Ie.useDismiss(b,{outsidePress:m}),{getFloatingProps:y}=Ie.useInteractions([S,x]);if(!e)return null;const F=typeof t=="string"?"dial-popup-heading":void 0,R=E=>E?typeof E=="string"?f.jsx("h3",{id:F,className:ue("flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",n),children:f.jsx(yt,{tooltip:E,children:E})}):E:f.jsx("span",{});return f.jsx(Ie.FloatingPortal,{id:s,children:f.jsx(Ie.FloatingOverlay,{className:ue(O8,i),children:f.jsx(Ie.FloatingFocusManager,{context:b,initialFocus:C?v:void 0,children:f.jsxs("div",{ref:w.setFloating,...y(),role:"dialog","aria-modal":"true","aria-labelledby":F,className:ue("dial-popup",H8[h],a&&Cp,o),children:[C&&f.jsx("div",{ref:v,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),f.jsxs("div",{className:oe(N8,r),children:[R(t),!p&&f.jsx(eh,{ariaLabel:"Close dialog",onClose:E=>u?.(E)})]}),f.jsx("div",{className:"flex-grow overflow-auto","aria-label":"popup-description",children:c}),l&&!d&&f.jsx("div",{className:Cp}),d]})})})})};var Vi=(e=>(e.Info="info",e.Danger="danger",e))(Vi||{});const G8="flex justify-end gap-2 px-6 py-4",B8="text-secondary dial-small-150 px-6 py-4",V8="Cancel",z8="Ok",jc={[Vi.Info]:{confirm:{variant:Ge.Primary,appearance:Me.Solid},cancel:{variant:Ge.Neutral,appearance:Me.Outlined}},[Vi.Danger]:{container:"dial-danger-popup",confirm:{variant:Ge.Error,appearance:Me.Solid},cancel:{variant:Ge.Neutral,appearance:Me.Outlined}}},Ov=({header:e,description:t,descriptionClassName:s,open:o=!1,confirmLabel:i=z8,cancelLabel:n=V8,isLoading:r=!1,disableConfirmButton:a=!1,className:l,confirmClassName:c,onClose:d,onConfirm:u,onCancel:h,children:p,dividers:m=!1,variant:C=Vi.Info,size:v=Wt.Sm,footer:w})=>{const b=r?null:f.jsxs("div",{className:G8,children:[f.jsx(ys,{label:n,onClick:()=>h?h():d?.()}),f.jsx(ss,{variant:jc[C].confirm?.variant,appearance:jc[C].confirm?.appearance,className:c,label:i,disabled:a,onClick:()=>u()})]}),S=g.useCallback(()=>r?f.jsx("div",{className:"px-6 py-4 h-[120px]",children:f.jsx(nr,{size:50})}):p??(t?f.jsx("div",{className:ue(B8,s),children:t}):null),[p,t,r,s]);return f.jsx(Uo,{open:o,header:e,className:ue(jc[C].container,l),dividers:m,onClose:()=>d?.(),footer:w??b,size:v,children:S()})},Nv=({selectedItems:e,listClassName:t,listElementClassName:s,placeholder:o})=>e?.length?f.jsx("ul",{className:ue("flex-row items-center truncate flex-wrap","flex gap-x-2 gap-y-1",t),children:e?.map((i,n)=>f.jsx("li",{children:f.jsx(yt,{tooltip:i,children:f.jsx(vo,{tag:i,className:ue([s])})})},`${i}_${n}`))}):o?f.jsx("span",{className:"text-secondary",children:o}):null,Uc=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z",fill:"currentColor"})),Hv=({children:e,open:t,disabled:s=!1,selectedValue:o,valueClassName:i,inputClassName:n,onOpen:r,elementId:a,errorText:l,invalid:c,emptyValueText:d,placeholder:u,editable:h=!1,onValueChange:p})=>{const m=Array.isArray(o)&&o.length>0,C=typeof o=="string"&&!!o.trim(),v=m||C?o:u?void 0:d,w=s?void 0:r,b=g.useCallback(F=>{p?.(F.target.value)},[p]),S=()=>f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:ue("dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between",n,s&&"dial-input-disable",(l||c)&&"dial-input-error"),children:[f.jsx("input",{type:"text",className:ue("flex-1 min-w-0 bg-transparent outline-none border-none p-0 dial-small-text text-primary placeholder:text-secondary",i),value:typeof o=="string"?o:"",placeholder:u||d,onChange:b,disabled:s,id:a,"aria-label":"input-popup-field"}),!s&&f.jsx("button",{type:"button",className:"flex-shrink-0 cursor-pointer bg-transparent border-none p-0 ml-1",onClick:r,"aria-label":"open-popup",children:f.jsx($e,{icon:f.jsx(Uc,{role:"img",width:Nt,height:Nt})})})]}),f.jsx(ns,{text:l})]}),x=()=>f.jsxs(f.Fragment,{children:[f.jsx("button",{type:"button",className:"w-full",onClick:w,"aria-label":"open-popup",id:a,children:f.jsxs("div",{className:ue("dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between cursor-pointer",n,s&&"dial-input-disable",(l||c)&&"dial-input-error"),children:[f.jsx(yt,{tooltip:v==null?void 0:String(v),children:v||!u?f.jsx("span",{className:i,children:v}):f.jsx("span",{className:"text-secondary",children:u})}),!s&&f.jsx("div",{className:"flex-shrink-0",children:f.jsx($e,{icon:f.jsx(Uc,{role:"img",width:Nt,height:Nt})})})]})}),f.jsx(ns,{text:l})]}),y=()=>f.jsx("div",{className:"w-full",onClick:w,children:f.jsxs("div",{className:ue("dial-input px-3 py-2 flex flex-row items-center w-full justify-between cursor-pointer",s&&"dial-input-disable"),children:[f.jsx(Nv,{placeholder:u,selectedItems:v}),!s&&f.jsx("div",{className:"ml-1",children:f.jsx($e,{icon:f.jsx(Uc,{role:"img",width:Nt,height:Nt})})})]})});return f.jsxs(f.Fragment,{children:[m?y():h?S():x(),t&&zi.createPortal(e,document.body)]})},W8=({label:e,htmlFor:t,disabled:s,selectedValue:o,radioButtons:i,customInputValue:n,valueClassName:r,inputClassName:a,emptyValueText:l,onClose:c,header:d,portalId:u,onApply:h,onCancel:p,cancelButtonTitle:m="Cancel",applyButtonTitle:C="Apply",isValid:v,selectedRadioValue:w,onChangeRadioField:b,id:S,size:x=Wt.Md})=>{const[y,F]=g.useState(!1),R=g.useCallback(()=>{s||F(!0)},[s]),E=g.useCallback(()=>{F(!1),c?.()},[c]),D=g.useCallback(()=>{p?.(),E()},[p,E]),P=g.useCallback(()=>{h(),E()},[h,E]);return f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(Bo,{label:e,htmlFor:t}),f.jsx(Hv,{disabled:s,open:y,selectedValue:n??i.find(T=>T.id===o)?.name,valueClassName:r,inputClassName:ue(a,"py-2","px-3"),emptyValueText:l,onOpen:R,children:f.jsx(Uo,{open:y,onClose:D,header:d,portalId:u,size:x,footer:f.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[f.jsx(ys,{label:m,onClick:D}),f.jsx(bs,{label:C,onClick:P,disabled:!v})]}),children:f.jsx("div",{className:"px-6 py-4",children:f.jsx(Fa,{radioButtons:i,labelClassName:"dial-small-text",activeRadioButton:w,onChange:b,elementId:S,orientation:To.Column})})})})]})},_8="Create",j8="Cancel",U8="flex items-center justify-end gap-2 px-6 py-3",$8=({header:e,open:t=!1,submitLabel:s=_8,cancelLabel:o=j8,isLoading:i=!1,disableSubmitButton:n=!1,className:r,submitClassName:a,onClose:l,onSubmit:c,onCancel:d,children:u,dividers:h=!0,size:p=Wt.Md,footer:m})=>{const C=i?null:f.jsxs("div",{className:U8,children:[f.jsx(ys,{label:o,onClick:()=>d?d():l?.()}),f.jsx(bs,{className:a,label:s,disabled:n,onClick:()=>c()})]}),v=g.useCallback(()=>i?f.jsx("div",{className:"px-6 py-4 h-[120px]",children:f.jsx(nr,{size:50})}):u??null,[u,i]);return f.jsx(Uo,{open:t,header:e,className:r,dividers:h,onClose:()=>l?.(),footer:m??C,size:p,children:v()})},q8=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],K8=(e,t,s,o)=>{if((t==="number"||s!==void 0||o!==void 0)&&!q8.includes(e.key)&&!(e.ctrlKey||e.metaKey)&&!(e.key==="-"&&(e.currentTarget.selectionStart??0)===0&&!e.currentTarget.value.includes("-"))&&!(e.key==="."&&t==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if(s!==void 0||o!==void 0){const n=e.currentTarget.value,r=e.currentTarget.selectionStart||0,a=n.slice(0,r)+e.key+n.slice(r),l=parseFloat(a);if(!isNaN(l)){if(s!==void 0&&l<+s){e.preventDefault();return}if(o!==void 0&&l>+o){e.preventDefault();return}}}}},Y8="bg-layer-4 flex items-center justify-center enabled:text-secondary enabled:hover:text-accent-primary enabled:active:bg-controls-accent-primary-alpha-active enabled:hover:bg-accent-primary-alpha enabled:active:text-accent-primary",Z8=({icon:e,onClick:t,disabled:s,size:o=bt.Standard})=>f.jsx("div",{className:ue("border-l border-tertiary",o===bt.Standard?"h-[40px] w-[44px]":"h-[24px] w-[32px]"),children:f.jsx(no,{className:ue(Y8,o===bt.Small&&"p-1"),icon:e,onClick:t,disabled:s,size:o})}),Zi=({labelProps:e,error:t,caption:s,id:o,containerClassName:i,...n})=>f.jsxs("div",{className:oe("flex flex-col gap-y-2",i),children:[e&&f.jsx(Bo,{...e,htmlFor:o}),f.jsx(Gv,{id:o,...n}),f.jsx(ns,{text:t}),!t&&f.jsx(ir,{text:s})]}),Gv=({invalid:e,disabled:t,prefix:s,className:o,postfix:i,iconBefore:n,iconAfter:r,wrapperClassName:a,type:l,inputRef:c,value:d,min:u,onChange:h,max:p,inputButtonProps:m,...C})=>{const v=g.useRef(null),w=Ie.useMergeRefs([c,v]);g.useEffect(()=>{const F=v.current;if(!F)return;const R=E=>{E.preventDefault()};return F.addEventListener("wheel",R,{passive:!1}),()=>{F.removeEventListener("wheel",R)}},[]);const b=l==="number"||u!==void 0||p!==void 0,S=F=>{K8(F,l,u,p)},x=F=>{const R=F.currentTarget.value;if(b&&R!==""){const E=parseFloat(R);if(isNaN(E)&&R!=="-"&&R!=="."||!isNaN(E)&&(u!==void 0&&E<+u||p!==void 0&&E>+p))return}h?.(R||void 0)},y=()=>f.jsxs("div",{className:oe("dial-input flex flex-row items-center gap-x-2 justify-between py-2",e&&"dial-input-error",t&&"dial-input-disable",!s&&"pl-3",!m&&"pr-3",a),"aria-label":"input-container",children:[s&&f.jsx("div",{className:"border-r border-tertiary",children:f.jsx(Gv,{wrapperClassName:"!rounded-r-none",className:"truncate",value:s,disabled:!0,id:`${s}_textBefore`})}),f.jsx($e,{icon:n}),f.jsx("input",{ref:w,type:l,autoComplete:l==="password"?"new-password":"off",value:d??"",className:oe("border-0 bg-transparent w-full truncate",o),onChange:x,onKeyDown:S,min:u,disabled:t,max:p,...C}),i&&f.jsxs("p",{className:"text-secondary dial-small-text",children:[" ",i]}),f.jsx($e,{icon:r}),m&&f.jsx(Z8,{...m,disabled:t})]});return t&&l!=="password"?f.jsx(yt,{tooltip:d,children:y()}):y()},X8=/^0+\.(\d+)?$/,Q8=/^0+/,J8=({onChange:e,...t})=>{const s=o=>!o||o==="-"?o:String(o)?.match(X8)?String(o)?.replace(Q8,"0"):Number(o);return f.jsx(Zi,{type:"number",onChange:o=>e?.(s(o)),...t})},eL=({onClick:e})=>f.jsx(G.IconEyeOff,{...Y,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),tL=({onClick:e})=>f.jsx(G.IconEye,{...Y,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),sL=({...e})=>{const[t,s]=g.useState(!1),o=g.useCallback(i=>{s(i)},[]);return f.jsx(Zi,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?f.jsx(eL,{onClick:()=>o(!1)}):f.jsx(tL,{onClick:()=>o(!0)})})},oL={[bt.Small]:{className:"dial-tiny-text",wrapperClassName:"pl-2 py-0",containerClassName:"h-[24px]",iconSize:16,iconStroke:1},[bt.Standard]:{className:"dial-small-text",wrapperClassName:"",containerClassName:"",iconSize:20,iconStroke:1.5}},ih=({size:e=bt.Standard,placeholder:t="Search...",value:s,onChange:o,...i})=>{const[n,r]=g.useState(s||"");g.useEffect(()=>{r(s||"")},[s]);const a=g.useCallback(u=>{r(u||""),o?.(u||"")},[o]),l=oL[e],c=g.useCallback(()=>{a("")},[a]),d=g.useMemo(()=>{if(n)return{icon:f.jsx(G.IconX,{size:l.iconSize,"aria-label":"Clear search",role:"button"}),onClick:c,size:e}},[c,n,e,l.iconSize]);return f.jsx(Zi,{placeholder:t,iconBefore:f.jsx(G.IconSearch,{size:l.iconSize,stroke:l.iconStroke}),value:n,onChange:a,inputButtonProps:d,containerClassName:l.containerClassName,className:l.className,wrapperClassName:l.wrapperClassName,...i})},$c=8,iL=24,nL=({initialTags:e=[],label:t,required:s,elementId:o,placeholder:i,captionDescription:n,errorText:r,invalid:a,disabled:l,collapseTagOverflow:c=!1,onChange:d})=>{const u=g.useRef(null),h=g.useRef([]),p=g.useRef(null),[m,C]=g.useState(e),[v,w]=g.useState(""),[b,S]=g.useState(!1),[x,y]=g.useState(e.length),F=g.useCallback(k=>N=>{h.current[k]=N},[]),R=g.useCallback(()=>{if(!c)return;const k=u.current;if(!k)return;const N=k.offsetWidth;if(N===0)return;const A=p.current?.offsetWidth??0,W=N-iL-$c;let U=0,L=0;for(let de=0;de<m.length;de++){const H=h.current[de];if(!H)continue;const te=H.offsetWidth+$c;if(U+te>W)break;U+=te,L++}if(L<m.length&&L>0)for(;U+A>W&&L>0;){L--;const de=h.current[L]?.offsetWidth??0;U-=de+$c}y(L)},[c,m]),E=k=>{const N=k.trim().replace(/,$/,"");if(N&&!m.includes(N)){const A=[N,...m];C(A),d?.(A)}},D=k=>{(k.key===","||k.key==="Enter")&&(k.preventDefault(),E(v),w(""))},P=()=>{v.trim()&&(E(v),w(""))},T=k=>{const N=m.filter((A,W)=>W!==k);C(N),d?.(N)},M=()=>r?f.jsx(ns,{text:r}):n?f.jsx(ir,{text:n}):null;return g.useEffect(()=>{if(c)return;const k=new ResizeObserver(()=>{if(u.current){const N=u.current.scrollHeight>u.current.clientHeight+10;S(N)}});return u.current&&k.observe(u.current),()=>k.disconnect()},[m,c]),g.useEffect(()=>{if(!c){y(m.length);return}y(m.length);const k=new ResizeObserver(()=>{R()}),N=u.current;return N&&k.observe(N),R(),()=>k.disconnect()},[c,R,m]),g.useEffect(()=>{C(e)},[JSON.stringify(e)]),f.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[f.jsx(Bo,{label:t,required:s,htmlFor:o}),f.jsx("div",{className:ue("dial-input min-h-[38px] p-[6px]",a&&"dial-input-error",l&&"dial-input-disable"),children:f.jsxs("div",{ref:u,className:ue("flex gap-2 items-center relative",c?"flex-nowrap overflow-hidden w-full min-w-0":ue("flex-wrap",b?"flex-col-reverse":"flex-row")),children:[(c?m.slice(0,x):m).map((k,N)=>f.jsx(vo,{tag:k,remove:l?void 0:()=>T(N)},k+N)),c&&x<m.length&&f.jsx(yt,{tooltip:m.slice(x).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:f.jsx(vo,{tag:`+${m.length-x}`})}),f.jsx("input",{type:"text",value:v,onChange:k=>w(k.target.value),onKeyDown:D,onBlur:P,className:ue("dial-input outline-none !border-none w-full flex-1 !p-1 !h-auto",c?"min-w-0":"min-w-[100px]"),placeholder:i??"",disabled:l}),c&&f.jsxs("div",{className:"absolute left-0 top-0 invisible pointer-events-none h-0 overflow-hidden whitespace-nowrap","aria-hidden":!0,children:[m.map((k,N)=>f.jsx("div",{ref:F(N),className:"inline-flex shrink-0",children:f.jsx(vo,{tag:k,remove:l?void 0:()=>T(N)})},`measure-${k}-${N}`)),f.jsx("div",{ref:p,className:"inline-flex shrink-0",children:f.jsx(vo,{tag:`+${m.length}`})})]})]})}),M()]})},rL="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",aL="w-full rounded flex flex-col",qc="flex w-full items-center justify-between gap-2 px-3 h-[34px] dial-small-text text-primary truncate hover:bg-accent-primary-alpha focus:bg-accent-primary-alpha focus:outline-none",lL="bg-accent-primary-alpha",cL="bg-accent-primary-alpha border-l border-accent-primary border-1",vp="opacity-75",dL=352,uL=f.jsx(G.IconChevronDown,{size:pt.SM}),Bv=({options:e,selectedValues:t,handleRemoveTag:s})=>f.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(o=>{const i=e.find(r=>r.value===o)?.label??o,n=e.find(r=>r.value===o)?.icon;return f.jsx(vo,{tag:i,remove:r=>s?.(r,o),iconBefore:n?f.jsx($e,{icon:n}):null,className:"max-w-full"},o)})});var Ja=(e=>(e.Sm="sm",e.Md="md",e))(Ja||{}),el=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(el||{});const Vv=({options:e,multiple:t=!1,elementId:s,value:o,defaultValue:i,variant:n=el.Primary,size:r=Ja.Md,prefix:a,customSelectedValue:l,placeholder:c="Select...",searchable:d=!1,searchPlaceholder:u,selectAll:h=!1,invalid:p,selectAllLabel:m="Select all",emptyStateTitle:C="No options available",emptyStateDescription:v,emptyStateIcon:w,disabled:b=!1,className:S,listClassName:x,closable:y=!1,header:F,footer:R,onClose:E,onChange:D,inlineSearch:P=!1,dismissRef:T,onFooterClick:M,open:k,onOpenChange:N,onInlineQueryChange:A})=>{const W=g.useId(),[U,L]=g.useState(!1),de=k!==void 0,H=de?!!k:U,te=g.useCallback(V=>{de||L(V),N?.(V)},[de,N]),[Q,J]=g.useState(P&&l||""),me=g.useRef(null),Re=g.useCallback(V=>{V!==Q&&(J(V||""),A?.(V||""))},[A,Q]),ne=o!==void 0,[_,Fe]=g.useState(i),ie=ne?o:_,$=g.useMemo(()=>t?Array.isArray(ie)?ie:[]:typeof ie=="string"?[ie]:[],[ie,t]),q=g.useMemo(()=>{const V=Q.trim().toLowerCase();return V?e.filter(Ee=>Ee.label.toLowerCase().includes(V)):e},[e,Q]);g.useEffect(()=>{!H&&!P&&Re("")},[P,H,Re]),g.useEffect(()=>{P&&!H&&l&&Re(l||"")},[l,P,H,Re]);const se=g.useCallback(V=>{ne||Fe(V),D?.(V)},[ne,D]),B=g.useCallback(V=>{if(t){const Ee=new Set($);Ee.has(V)?Ee.delete(V):Ee.add(V),se(Array.from(Ee));return}if(se(V),P){const Ee=e.find(At=>At.value===V);Ee&&(Re(Ee.label),A?.(Ee.label))}te(!1)},[t,se,P,te,$,e,Re,A]),pe=g.useCallback((V,Ee)=>{if(V.stopPropagation(),!t){se("");return}const At=$.filter(Xi=>Xi!==Ee);se(At)},[t,$,se]),le=g.useMemo(()=>q.filter(V=>!V.disabled),[q]),re=g.useMemo(()=>le.filter(V=>$.includes(V.value)).length,[le,$]),Ce=V=>{P&&!t&&!V&&B(Q),te(V)},xe=le.length>0&&re===le.length,Le=re>0&&!xe,fe=()=>{if(!(!t||le.length===0))if(xe){const V=new Set(le.map(At=>At.value)),Ee=$.filter(At=>!V.has(At));se(Ee)}else{const V=new Set($);le.forEach(Ee=>V.add(Ee.value)),se(Array.from(V))}},De=$.length>0;g.useEffect(()=>{H&&P&&!t&&!b&&requestAnimationFrame(()=>{const V=me.current;if(!V)return;V.focus();const Ee=V.value?.length??0;V.setSelectionRange?.(Ee,Ee)})},[H,P,t,b]);const ze=!t&&De?$[0]:void 0,Ne=g.useMemo(()=>ze?e.find(V=>V.value===ze):void 0,[e,ze]),Ve=g.useCallback(()=>!t||$.length===0?null:f.jsx(Bv,{options:e,selectedValues:$,handleRemoveTag:pe}),[t,e,$,pe]),kt=g.useCallback(()=>t?De?Ve():f.jsx("span",{className:"text-secondary truncate",children:c}):Ne?f.jsxs(f.Fragment,{children:[Ne.icon&&f.jsx($e,{icon:Ne.icon}),f.jsx(ht,{text:a?`${a} ${Ne.label}`:Ne.label}),Ne?.description&&f.jsx("div",{className:"text-secondary dial-small-text",children:Ne.description})]}):l&&o?l:f.jsx("span",{className:"text-secondary truncate",children:c}),[De,t,l,a,o,c,Ve,Ne]);g.useImperativeHandle(T,()=>({dismiss:()=>{te(!1)}}));const Et=g.useCallback(()=>{Re($.length===1?Ne?.label??Q:"")},[Q,$.length,Re,Ne?.label]),Ut=g.useCallback(()=>{b||(te(!H),P&&!t&&(Et(),me.current?.focus()))},[b,P,H,t,Et,te]);return f.jsx(Ft,{open:H,onOpenChange:Ce,disabled:b,closable:y,onClose:E,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:d?null:dL,listClassName:x,renderOverlay:()=>f.jsxs("div",{id:`list-${s||W}`,role:"listbox","aria-multiselectable":t||void 0,className:aL,children:[F&&f.jsx(f.Fragment,{children:typeof F=="function"?F():F}),(d||y)&&e.length>8&&f.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[d&&f.jsx(ih,{placeholder:u,onChange:Re,value:Q,id:`search-${s||W}`,containerClassName:"w-full"}),y&&f.jsx(ss,{"aria-label":"Close select",className:"shrink-0",iconBefore:f.jsx(G.IconX,{size:pt.SM}),onClick:V=>{E?.(V),te(!1)}})]}),t&&h&&le.length>0&&f.jsx("div",{className:ue(qc,"mt-2"),children:f.jsx(id,{id:`${s||W}-selectAll`,label:m,checked:xe,indeterminate:Le,onChange:fe,ariaLabel:m})}),f.jsx("div",{className:ue("overflow-y-auto max-h-[352px]",P&&q.length===0?"":"py-1"),children:q.length===0?!P&&f.jsx("div",{className:"px-2 py-3",children:f.jsx(rr,{icon:w??f.jsx(G.IconClipboardX,{size:pt.LG,stroke:.5}),title:C,description:v})}):q.map(V=>{const Ee=$.includes(V.value);return t?f.jsxs("div",{role:"option","aria-selected":Ee,"aria-disabled":!!V.disabled,className:ue(qc,Ee&&lL,V.disabled&&vp,"w-full"),children:[f.jsx(id,{id:`${s||W}-${V.value}`,label:f.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[V.icon&&f.jsx($e,{icon:V.icon}),f.jsx("span",{className:"truncate",children:V.label})]}),checked:Ee,disabled:V.disabled,onChange:()=>!V.disabled&&B(V.value),ariaLabel:V.label}),V.description&&f.jsx("div",{className:"text-secondary dial-small-text",children:V.description})]},V.value):f.jsx("button",{role:"option",type:"button","aria-selected":Ee,"aria-disabled":!!V.disabled,disabled:V.disabled,className:ue(qc,Ee&&cL,V.disabled&&vp),onClick:()=>!V.disabled&&B(V.value),children:f.jsxs("div",{className:"flex items-center gap-2 w-full",children:[V.icon&&f.jsx($e,{icon:V.icon}),f.jsx(ht,{text:V.label}),V.description&&f.jsx("div",{className:"text-secondary dial-small-text",children:V.description})]})},V.value)})}),R&&f.jsx("div",{onClick:V=>{M?.(V),M&&te(!1)},children:typeof R=="function"?R():R})]}),children:f.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":H,"aria-controls":`list-${s||W}`,className:oe(rL,b&&"opacity-75 !cursor-not-allowed",r===Ja.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",p&&"dial-input-error",n===el.Secondary?"!bg-layer-4 !h-auto":"",S),onMouseDown:V=>{b||P&&!t&&(Et(),V.preventDefault())},onClick:()=>{Ut()},onKeyDown:V=>{(V.key===" "||V.code==="Space")&&(V.preventDefault(),Ut())},children:[P&&!t?f.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:f.jsx("input",{id:`inline-${s||W}`,type:"text",placeholder:u??c,value:Q||"",onChange:V=>Re(V.currentTarget.value.trimStart()),onFocus:()=>!b&&te(!0),onMouseDown:V=>{Et(),V.stopPropagation()},onClick:V=>{V.stopPropagation()},onKeyDown:V=>{V.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref:me,disabled:b,"aria-disabled":b,autoComplete:"off"})}):f.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:kt()}),!P&&f.jsx($e,{icon:uL,className:ue("text-primary",H&&"rotate-180")})]})})},hL=({label:e,required:t,captionDescription:s,containerClassName:o,selectClassName:i,error:n,id:r,caption:a,readonly:l,value:c,defaultEmptyText:d,...u})=>{const h=g.useCallback(()=>{if(!c||Array.isArray(c)&&c.length===0)return d??"None";if(Array.isArray(c))return f.jsx(Bv,{options:u.options,selectedValues:c});{const p=u.options?.find(m=>m.value===c);return f.jsx("span",{"aria-readonly":!0,className:"text-primary",children:p?.label||c})}},[c,u.options,d]);return f.jsx(Xd,{id:r,label:e,required:t,description:a,error:n,captionDescription:s,className:o,readonly:l,value:h(),defaultEmptyText:d,children:f.jsx(Vv,{className:i,value:c,elementId:r,invalid:!!n,...u})})};function zv(e){let t=null;return()=>(t==null&&(t=e()),t)}function gL(e,t){return e.filter(s=>s!==t)}function pL(e,t){const s=new Set,o=n=>s.add(n);e.forEach(o),t.forEach(o);const i=[];return s.forEach(n=>i.push(n)),i}class fL{enter(t){const s=this.entered.length,o=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(t));return this.entered=pL(this.entered.filter(o),[t]),s===0&&this.entered.length>0}leave(t){const s=this.entered.length;return this.entered=gL(this.entered.filter(this.isNodeInDocument),t),s>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class mL{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const s={};Object.keys(this.config.exposeProperties).forEach(o=>{const i=this.config.exposeProperties[o];i!=null&&(s[o]={value:i(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,s)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,s){return s===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const nh="__NATIVE_FILE__",Wv="__NATIVE_URL__",_v="__NATIVE_TEXT__",jv="__NATIVE_HTML__",wp=Object.freeze(Object.defineProperty({__proto__:null,FILE:nh,HTML:jv,TEXT:_v,URL:Wv},Symbol.toStringTag,{value:"Module"}));function Kc(e,t,s){const o=t.reduce((i,n)=>i||e.getData(n),"");return o??s}const jd={[nh]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[jv]:{exposeProperties:{html:(e,t)=>Kc(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Wv]:{exposeProperties:{urls:(e,t)=>Kc(e,t,"").split(`
62
+ `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[_v]:{exposeProperties:{text:(e,t)=>Kc(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function CL(e,t){const s=jd[e];if(!s)throw new Error(`native type ${e} has no configuration`);const o=new mL(s);return o.loadDataTransfer(t),o}function Yc(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(jd).filter(s=>{const o=jd[s];return o?.matchesTypes?o.matchesTypes.some(i=>t.indexOf(i)>-1):!1})[0]||null}const vL=zv(()=>/firefox/i.test(navigator.userAgent)),Uv=zv(()=>!!window.safari);class bp{interpolate(t){const{xs:s,ys:o,c1s:i,c2s:n,c3s:r}=this;let a=s.length-1;if(t===s[a])return o[a];let l=0,c=r.length-1,d;for(;l<=c;){d=Math.floor(.5*(l+c));const p=s[d];if(p<t)l=d+1;else if(p>t)c=d-1;else return o[d]}a=Math.max(0,c);const u=t-s[a],h=u*u;return o[a]+i[a]*u+n[a]*h+r[a]*u*h}constructor(t,s){const{length:o}=t,i=[];for(let p=0;p<o;p++)i.push(p);i.sort((p,m)=>t[p]<t[m]?-1:1);const n=[],r=[];let a,l;for(let p=0;p<o-1;p++)a=t[p+1]-t[p],l=s[p+1]-s[p],n.push(a),r.push(l/a);const c=[r[0]];for(let p=0;p<n.length-1;p++){const m=r[p],C=r[p+1];if(m*C<=0)c.push(0);else{a=n[p];const v=n[p+1],w=a+v;c.push(3*w/((w+v)/m+(w+a)/C))}}c.push(r[r.length-1]);const d=[],u=[];let h;for(let p=0;p<c.length-1;p++){h=r[p];const m=c[p],C=1/n[p],v=m+c[p+1]-h-h;d.push((h-m-v)*C),u.push(v*C*C)}this.xs=t,this.ys=s,this.c1s=c,this.c2s=d,this.c3s=u}}const wL=1;function $v(e){const t=e.nodeType===wL?e:e.parentElement;if(!t)return null;const{top:s,left:o}=t.getBoundingClientRect();return{x:o,y:s}}function ra(e){return{x:e.clientX,y:e.clientY}}function bL(e){var t;return e.nodeName==="IMG"&&(vL()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function SL(e,t,s,o){let i=e?t.width:s,n=e?t.height:o;return Uv()&&e&&(n/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:n}}function yL(e,t,s,o,i){const n=bL(t),a=$v(n?e:t),l={x:s.x-a.x,y:s.y-a.y},{offsetWidth:c,offsetHeight:d}=e,{anchorX:u,anchorY:h}=o,{dragPreviewWidth:p,dragPreviewHeight:m}=SL(n,t,c,d),C=()=>{let F=new bp([0,.5,1],[l.y,l.y/d*m,l.y+m-d]).interpolate(h);return Uv()&&n&&(F+=(window.devicePixelRatio-1)*m),F},v=()=>new bp([0,.5,1],[l.x,l.x/c*p,l.x+p-c]).interpolate(u),{offsetX:w,offsetY:b}=i,S=w===0||w,x=b===0||b;return{x:S?w:v(),y:x?b:C()}}class xL{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,s){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=s}}function RL(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function Sp(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{},o=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(s).filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable}))),o.forEach(function(i){RL(e,i,s[i])})}return e}class FL{profile(){var t,s;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((s=this.dragOverTargetIds)===null||s===void 0?void 0:s.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var s;(s=this.window)===null||s===void 0||s.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,s,o){return this.sourcePreviewNodeOptions.set(t,o),this.sourcePreviewNodes.set(t,s),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,s,o){this.sourceNodes.set(t,s),this.sourceNodeOptions.set(t,o);const i=r=>this.handleDragStart(r,t),n=r=>this.handleSelectStart(r);return s.setAttribute("draggable","true"),s.addEventListener("dragstart",i),s.addEventListener("selectstart",n),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),s.removeEventListener("dragstart",i),s.removeEventListener("selectstart",n),s.setAttribute("draggable","false")}}connectDropTarget(t,s){const o=r=>this.handleDragEnter(r,t),i=r=>this.handleDragOver(r,t),n=r=>this.handleDrop(r,t);return s.addEventListener("dragenter",o),s.addEventListener("dragover",i),s.addEventListener("drop",n),()=>{s.removeEventListener("dragenter",o),s.removeEventListener("dragover",i),s.removeEventListener("drop",n)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),s=this.sourceNodeOptions.get(t);return Sp({dropEffect:this.altKeyPressed?"copy":"move"},s||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),s=this.sourcePreviewNodeOptions.get(t);return Sp({anchorX:.5,anchorY:.5,captureDraggingState:!1},s||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(wp).some(s=>wp[s]===t)}beginDragNativeItem(t,s){this.clearCurrentDragSourceNode(),this.currentNativeSource=CL(t,s),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const s=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var o;return(o=this.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},s)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,s){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(s))}handleDragEnter(t,s){this.dragEnterTargetIds.unshift(s)}handleDragOver(t,s){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(s)}handleDrop(t,s){this.dropTargetIds.unshift(s)}constructor(t,s,o){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const n=this.sourceNodes.get(i);return n&&$v(n)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:n}=this;this.dragStartSourceIds=null;const r=ra(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(n||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});const{dataTransfer:a}=i,l=Yc(a);if(this.monitor.isDragging()){if(a&&typeof a.setDragImage=="function"){const d=this.monitor.getSourceId(),u=this.sourceNodes.get(d),h=this.sourcePreviewNodes.get(d)||u;if(h){const{anchorX:p,anchorY:m,offsetX:C,offsetY:v}=this.getCurrentSourcePreviewNodeOptions(),S=yL(u,h,r,{anchorX:p,anchorY:m},{offsetX:C,offsetY:v});a.setDragImage(h,S.x,S.y)}}try{a?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:c}=this.getCurrentSourcePreviewNodeOptions();c?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(l)this.beginDragNativeItem(l);else{if(a&&!a.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var n;(n=this.currentNativeSource)===null||n===void 0||n.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:a}=i,l=Yc(a);l&&this.beginDragNativeItem(l,a)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:n}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,n.length>0&&this.actions.hover(n,{clientOffset:ra(i)}),n.some(a=>this.monitor.canDropOnTarget(a))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var n;(n=this.currentNativeSource)===null||n===void 0||n.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:n}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=ra(i),this.scheduleHover(n),(n||[]).some(a=>this.monitor.canDropOnTarget(a))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var n;i.preventDefault(),(n=this.currentNativeSource)===null||n===void 0||n.loadDataTransfer(i.dataTransfer)}else Yc(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:n}=this;this.dropTargetIds=[],this.actions.hover(n,{clientOffset:ra(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const n=i.target;typeof n.dragDrop=="function"&&(n.tagName==="INPUT"||n.tagName==="SELECT"||n.tagName==="TEXTAREA"||n.isContentEditable||(i.preventDefault(),n.dragDrop()))},this.options=new xL(s,o),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new fL(this.isNodeInDocument)}}const EL=function(t,s,o){return new FL(t,s,o)},DL=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:s,emptyButtonLabel:o,acceptTypes:i,maxFilesCount:n,multiple:r,fileFormatError:a,fileCountError:l,fileSizeError:c,getIsFileFormatError:d,getIsFileSizeError:u})=>{const h=g.useRef(null),p=g.useRef(null),[m,C]=g.useState([]),[v,w]=g.useState(!1),[b,S]=g.useState(!1),x=g.useCallback(W=>{const U=W.target.files;if(U&&U.length>0){const L=Array.from(U),de=d?.(L),H=u?.(L);de?w(!0):H?S(!0):e(L)}},[d,u,e]),y=g.useCallback(W=>n&&W?.length>n,[n]),F=g.useMemo(()=>v||b||y(m),[v,b,y,m]),R=()=>{C([]),w(!1),S(!1)},E=g.useMemo(()=>v?f.jsx(ns,{text:a}):b?f.jsx(ns,{text:c}):y(m)?f.jsx(ns,{text:l}):null,[l,a,c,m,y,v,b]);g.useEffect(()=>{R()},[i]);const[{isOver:D,canDrop:P},T]=tf(()=>({accept:[nh],drop(W){const U=W.files;!d?.(U)&&!u?.(U)&&!y(U)&&e(U),R()},collect:W=>({isOver:W.isOver(),canDrop:W.canDrop()})}),[x]),M=W=>{(W.key==="Enter"||W.key==="Space")&&(W.preventDefault(),p.current?.click())},k=W=>{W?.preventDefault();const U=Array.from(W.dataTransfer?.items??[]);w(!!d?.(U)),S(!!u?.(U)),C(U)},N=W=>{W.target===W.currentTarget&&R()},A=ue("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!P&&!F&&"border-primary",P&&(D?"border-accent-primary":"border-hover"),F&&"border-error");return T(h),f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:A,ref:h,onDragOver:k,onDragLeave:N,children:[f.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:M,className:"flex flex-col items-center cursor-pointer h-full w-full text-secondary dial-tiny-text justify-center",children:[t&&f.jsx("p",{className:"mb-1",children:t}),s&&f.jsx("p",{className:"mb-0.5",children:s}),o&&f.jsx(bs,{appearance:Me.Ghost,label:o,onClick:()=>p.current?.click()})]}),f.jsx("input",{multiple:r,id:"file",type:"file",ref:p,hidden:!0,accept:i,onChange:x})]}),f.jsx(f.Fragment,{children:E})]})},PL=({iconBefore:e,className:t,error:s,...o})=>{const i=o.invalid,n=()=>f.jsx("div",{className:"mr-2",children:i?f.jsx(G.IconExclamationCircle,{...Y,className:"text-error"}):e});return f.jsx(Zi,{...o,iconBefore:n(),containerClassName:"h-[40px] p-0",className:ue("rounded-r-none border-r-0",i&&"text-error",t)})},qv=e=>{const{files:t,iconBeforeInput:s,dynamicIcon:o,onChange:i,isInvalid:n,errorText:r,removeButtonAriaLabel:a,getIsMultiFilesSizeError:l,multiFilesSizeError:c}=e,d=(p,m)=>{p.stopPropagation(),i(t?.filter(C=>C.name!==m)||[])},u=p=>f.jsx(Lv,{"aria-label":a,onClick:m=>d(m,p)}),h=p=>{i(p)};return!t||t.length===0?f.jsx(e0,{backend:EL,children:f.jsx(DL,{...e,onChange:h})}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"flex-1 min-h-0 border border-solid border-primary rounded p-2 overflow-y-auto",children:t&&t.length>0&&f.jsx("div",{className:"flex flex-col gap-y-1",children:t.map((p,m)=>f.jsx(PL,{id:p.name,value:p.name,iconAfter:u(p.name),iconBefore:s||o?.(p.name),invalid:n?.(p),error:r},p.name+m))})}),l?.(t)&&f.jsx(ns,{text:c})]})},TL=({onChange:e,fieldTitle:t,elementId:s,files:o,maxFilesCount:i,maxFileSize:n,maxMultiFilesSize:r,fileFormatError:a,fileCountError:l,fileSizeError:c,multiFilesSizeError:d,multiple:u=!0,acceptTypes:h,deleteAllButtonLabel:p,addButtonLabel:m,additionalActionButtons:C,...v})=>{const w=g.useRef(null),b=()=>w.current?.click(),S=()=>{e([])},x=g.useCallback(E=>E?.some(D=>!(h==="/"||h?.toLowerCase()?.includes(D?.type?.toLowerCase()))),[h]),y=g.useCallback(E=>{if(!n)return!1;const D=n*(1024*1024);return E?.some(P=>{const T=P.size;return!!T&&T>D})},[n]),F=g.useCallback(E=>{if(!r||!u)return!1;const D=r*1024*1024;return E.reduce((T,M)=>T+M.size,0)>D},[r,u]),R=g.useCallback(E=>{const D=E.target.files;if(D&&D.length>0){const P=Array.from(D),T=x(P),M=y(P);!T&&!M&&e([...o||[],...P])}},[x,y,e,o]);return f.jsxs("div",{className:"h-full flex flex-col",children:[f.jsxs("div",{className:"flex justify-between items-center pb-1 min-h-[42px]",children:[f.jsx(Bo,{label:`${t}: ${u?o?.length||0:""}`,htmlFor:s}),u&&!!o?.length&&f.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[f.jsx(ys,{label:p,iconBefore:f.jsx(G.IconTrashX,{...Y}),onClick:S}),(i?i>o?.length:!0)&&f.jsx(bs,{appearance:Me.Ghost,iconBefore:f.jsx(G.IconPlus,{...Y}),label:m,onClick:b}),C]})]}),o&&o.length>0&&f.jsx("input",{id:"file",type:"file",multiple:u,ref:w,hidden:!0,accept:h,onChange:R}),f.jsx(qv,{files:o,onChange:e,acceptTypes:h,maxFilesCount:i,multiple:u,fileFormatError:a,fileCountError:l,fileSizeError:c,multiFilesSizeError:d,getIsFileFormatError:x,getIsFileSizeError:y,getIsMultiFilesSizeError:F,...v})]})},ML=f.jsx(G.IconChevronDown,{size:pt.SM}),IL=f.jsx(G.IconChevronUp,{size:pt.SM}),Ud=({variant:e,appearance:t,items:s,...o})=>{const[i,n]=g.useState(!1),r=g.useMemo(()=>i?IL:ML,[i]);return f.jsx("div",{children:f.jsx(Ft,{menu:{items:s},onOpenChange:a=>n(a),children:f.jsx(ss,{...o,iconAfter:r,variant:e||Ge.Primary,appearance:t||Me.Solid})})})},Kv=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.1812 1.2002H2.80615C2.43319 1.2002 2.07551 1.34835 1.81178 1.61208C1.54806 1.8758 1.3999 2.23348 1.3999 2.60645V5.48145C1.3999 5.85441 1.54806 6.21209 1.81178 6.47581C2.07551 6.73954 2.43319 6.8877 2.80615 6.8877H15.1812C15.5541 6.8877 15.9118 6.73954 16.1755 6.47581C16.4392 6.21209 16.5874 5.85441 16.5874 5.48145V2.60645C16.5874 2.23348 16.4392 1.8758 16.1755 1.61208C15.9118 1.34835 15.5541 1.2002 15.1812 1.2002ZM14.8999 5.2002H3.0874V2.8877H14.8999V5.2002ZM12 7.80017C12.3107 7.80017 12.5625 8.05201 12.5625 8.36267V11.7377H15.9375C16.2482 11.7377 16.5 11.9895 16.5 12.3002C16.5 12.6108 16.2482 12.8627 15.9375 12.8627H12.5625V16.2377C12.5625 16.5483 12.3107 16.8002 12 16.8002C11.6893 16.8002 11.4375 16.5483 11.4375 16.2377V12.8627H8.0625C7.75184 12.8627 7.5 12.6108 7.5 12.3002C7.5 11.9895 7.75184 11.7377 8.0625 11.7377H11.4375V8.36267C11.4375 8.05201 11.6893 7.80017 12 7.80017ZM2.41188 12.5883C2.14816 12.3246 2 11.9669 2 11.5939V9.00018H3.6875V11.3127H6.1001V13.0002H3.40625C3.03329 13.0002 2.6756 12.852 2.41188 12.5883Z",fill:"currentColor"})),Yv=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M9.00049 7.7998C9.3108 7.80007 9.56279 8.05198 9.56299 8.3623V11.7373H12.938C13.2483 11.7376 13.5003 11.9895 13.5005 12.2998C13.5005 12.6103 13.2484 12.862 12.938 12.8623H9.56299V16.2373C9.56299 16.5478 9.31092 16.7995 9.00049 16.7998C8.68983 16.7998 8.43799 16.548 8.43799 16.2373V12.8623H5.06299C4.75233 12.8623 4.50049 12.6105 4.50049 12.2998C4.50069 11.9893 4.75245 11.7373 5.06299 11.7373H8.43799V8.3623C8.43819 8.05181 8.68995 7.7998 9.00049 7.7998ZM15.1812 1.2002C15.5541 1.2002 15.9116 1.34858 16.1753 1.6123C16.439 1.87603 16.5874 2.23348 16.5874 2.60645V5.48145C16.5874 5.85441 16.439 6.21186 16.1753 6.47559C15.9116 6.73931 15.5541 6.8877 15.1812 6.8877H2.80615C2.43319 6.8877 2.07573 6.73931 1.81201 6.47559C1.54829 6.21186 1.3999 5.85441 1.3999 5.48145V2.60645C1.3999 2.23348 1.54829 1.87603 1.81201 1.6123C2.07573 1.34858 2.43319 1.2002 2.80615 1.2002H15.1812ZM3.0874 2.8877V5.2002H14.8999V2.8877H3.0874Z",fill:"currentColor"})),rh=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M3.009 12.5527C2.77901 12.4216 2.5877 12.2321 2.45443 12.0034C2.32116 11.7746 2.25064 11.5147 2.25 11.25V3.75C2.25 2.925 2.925 2.25 3.75 2.25H11.25C11.8125 2.25 12.1185 2.53875 12.375 3M10.5 15.75H7.25025C6.98757 15.75 6.72747 15.6983 6.48479 15.5977C6.24211 15.4972 6.0216 15.3499 5.83586 15.1641C5.65012 14.9784 5.50278 14.7579 5.40226 14.5152C5.30174 14.2725 5.25 14.0124 5.25 13.7498V7.25025C5.25 6.71975 5.46074 6.21098 5.83586 5.83586C6.21098 5.46074 6.71975 5.25 7.25025 5.25H13.7498C14.0124 5.25 14.2725 5.30174 14.5152 5.40226C14.7579 5.50278 14.9784 5.65012 15.1641 5.83586C15.3499 6.0216 15.4972 6.24211 15.5977 6.48479C15.6983 6.72747 15.75 6.98757 15.75 7.25025V10.5M12.75 16.5L16.5 12.75M16.5 12.75V16.125M16.5 12.75H13.125",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),ah=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M9.75 14.25H3.75C3.35218 14.25 2.97064 14.092 2.68934 13.8107C2.40804 13.5294 2.25 13.1478 2.25 12.75V4.5C2.25 4.10218 2.40804 3.72064 2.68934 3.43934C2.97064 3.15804 3.35218 3 3.75 3H6.75L9 5.25H14.25C14.6478 5.25 15.0294 5.40804 15.3107 5.68934C15.592 5.97064 15.75 6.35218 15.75 6.75V9.75M12 16.5L15.75 12.75M15.75 12.75V16.125M15.75 12.75H12.375",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),lh=e=>Se.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{d:"M4.5 15.75V14.25C4.5 13.4544 4.81607 12.6913 5.37868 12.1287C5.94129 11.5661 6.70435 11.25 7.5 11.25H9.75M15.75 12.75L12 16.5M12 16.5V13.125M12 16.5H15.375M6 5.25C6 6.04565 6.31607 6.80871 6.87868 7.37132C7.44129 7.93393 8.20435 8.25 9 8.25C9.79565 8.25 10.5587 7.93393 11.1213 7.37132C11.6839 6.80871 12 6.04565 12 5.25C12 4.45435 11.6839 3.69129 11.1213 3.12868C10.5587 2.56607 9.79565 2.25 9 2.25C8.20435 2.25 7.44129 2.56607 6.87868 3.12868C6.31607 3.69129 6 4.45435 6 5.25Z",stroke:"#7F8792",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}));var wi=(e=>(e.MyFiles="my_files",e.Shared="shared",e.Organization="organization",e.Review="review",e))(wi||{}),K=(e=>(e.AddSibling="addSibling",e.AddChild="addChild",e.Duplicate="duplicate",e.Copy="copy",e.Move="move",e.Download="download",e.Delete="delete",e.Rename="rename",e.Info="info",e.Unshare="unshare",e.RemoveAccess="removeAccess",e.ManagePermissions="managePermissions",e.Preview="preview",e.OpenInNewTab="openInNewTab",e))(K||{}),nt=(e=>(e.Replace="replace",e.Duplicate="duplicate",e.Cancel="cancel",e))(nt||{}),Ot=(e=>(e.ReplaceAll="replaceAll",e.DuplicateAll="duplicateAll",e.DecideForEach="decideForEach",e))(Ot||{}),rt=(e=>(e.Copy="copy",e.Move="move",e))(rt||{}),Ii=(e=>(e.Tree="tree",e.Grid="grid",e))(Ii||{}),at=(e=>(e.Name="name",e.UpdatedAt="updatedAt",e.Size="size",e.Author="author",e.Owner="owner",e.Path="path",e.Actions="__actions",e.Version="version",e))(at||{});const kL="w-full h-full grid grid-rows-[auto_1fr] gap-5 p-6 overflow-hidden min-w-0 bg-layer-1",yp="w-full text-secondary flex items-center gap-2",AL="flex min-h-0 min-w-0 h-full gap-4 overflow-hidden",LL="flex flex-col flex-1 min-h-0 min-w-0 h-full gap-4",OL="h-full rounded bg-layer-3 text-secondary min-w-0",NL="flex-1 w-full rounded text-secondary overflow-auto min-h-0 min-w-0",HL="opacity-0 pointer-events-none group-hover/grid-row:opacity-100 group-hover/grid-row:pointer-events-auto",GL=280,BL="Files",Js=20,VL="Files",Zc=".dial_folder",zL=280,WL=460,Xc=44,_L=56,jL=800,UL=[at.Name,at.UpdatedAt,at.Size,at.Author,at.Actions];var be=(e=>(e.ITEM="item",e.FOLDER="folder",e))(be||{}),ch=(e=>(e.FILE="FILE",e.PROMPT="PROMPT",e.CONVERSATION="CONVERSATION",e.APPLICATION="APPLICATION",e.TOOLSET="TOOL_SET",e))(ch||{}),$o=(e=>(e.READ="READ",e.WRITE="WRITE",e.SHARE="SHARE",e))($o||{});const xp=({open:e,onClose:t,onReplace:s,onDuplicate:o,onDecideForEach:i,conflictingFiles:n,singleFileTitle:r="Replace Or Duplicate Item",multipleFilesTitle:a="Replace Or Duplicate Items",message:l,actionLabels:c,strategyLabels:d,confirmLabel:u="Confirm",cancelLabel:h="Cancel",nameColumnLabel:p="Name",actionColumnLabel:m="Action"})=>{const C=n.length===1,v=C?n[0]?.name:"",w=c?.[nt.Replace]??"Replace",b=c?.[nt.Duplicate]??"Duplicate",S=c?.[nt.Cancel]??"Cancel",x=d?.[Ot.ReplaceAll]??"Replace all",y=d?.[Ot.DuplicateAll]??"Duplicate all",F=d?.[Ot.DecideForEach]??"Decide for each",[R,E]=g.useState(nt.Replace),[D,P]=g.useState(Ot.ReplaceAll),[T,M]=g.useState(new Map(n.map(ne=>[ne.path,nt.Replace]))),[k,N]=g.useState(void 0),A=C?r:a,W=f.jsxs(f.Fragment,{children:["Item with the name ",f.jsxs("span",{className:"text-primary",children:['"',v,'"']})," ","already exists in this destination."]}),U=`${n.length} items with the same names already exist in this destination.`,L=l??(C?W:U),de=g.useMemo(()=>[{id:nt.Replace,name:w},{id:nt.Duplicate,name:b}],[w,b]),H=g.useMemo(()=>n.map(ne=>({id:ne.path,name:ne.name,path:ne.path,nodeType:ne.nodeType??be.ITEM,action:T.get(ne.path)||nt.Replace})),[n,T]),te=g.useMemo(()=>[{field:"name",headerName:p,flex:1,minWidth:200,floatingFilter:!1,filter:!1,resizable:!1,cellRenderer:ne=>ne.data?.nodeType===be.FOLDER?f.jsx(cl,{name:ne.data.name,iconSize:Js}):f.jsx(ll,{name:ne.data.name,iconSize:Js})},{field:"action",headerName:m,width:140,suppressSizeToFit:!0,sortable:!1,filter:!1,floatingFilter:!1,resizable:!1,cellRenderer:ne=>{if(!ne.data)return null;const _=[{key:nt.Replace,label:w,icon:f.jsx(G.IconCircleFilled,{size:10,className:"text-accent-tertiary"})},{key:nt.Duplicate,label:b,icon:f.jsx(G.IconCircleFilled,{size:10,className:"text-accent-secondary"})},{key:nt.Cancel,label:S,icon:f.jsx(G.IconCircleFilled,{size:10,className:"text-error"})}],Fe=_.find($=>$.key===ne.data.action),ie=k===ne.data.path;return f.jsx("div",{className:"flex items-center h-full",children:f.jsx(Ft,{trigger:[Ht.Click],open:ie,menu:{items:_,onClick:({key:$})=>{M(q=>{const se=new Map(q);return se.set(ne.data.path,$),se}),N(void 0)}},placement:"bottom-start",matchReferenceWidth:!1,allowedPlacements:["bottom-start","top-start"],onOpenChange:$=>{N($?ne.data.path:void 0)},children:f.jsxs("button",{type:"button",className:"flex items-center gap-2",children:[f.jsxs("span",{className:"flex items-center gap-2",children:[Fe?.icon,Fe?.label??w]}),f.jsx(G.IconChevronDown,{size:pt.SM,className:ue("text-secondary transition-transform",ie&&"rotate-180")})]})})})}}],[p,m,w,b,S,k]),Q=g.useMemo(()=>[{id:Ot.ReplaceAll,name:x},{id:Ot.DuplicateAll,name:y},{id:Ot.DecideForEach,name:F,content:D===Ot.DecideForEach?f.jsx("div",{className:"mt-4",children:f.jsx(th,{columnDefs:te,rowData:H,getRowId:ne=>ne.id,wrapCustomCellRenderers:!1,alternateOddRowColors:!1,additionalGridOptions:{domLayout:"autoHeight"}})}):void 0}],[x,y,F,D,te,H]),J=g.useCallback(()=>{E(nt.Replace),P(Ot.ReplaceAll),M(new Map(n.map(ne=>[ne.path,nt.Replace])))},[n]),me=g.useCallback(()=>{J(),t()},[J,t]),Re=g.useCallback(()=>{if(J(),C)R===nt.Replace?s():o();else if(D===Ot.ReplaceAll)s();else if(D===Ot.DuplicateAll)o();else if(D===Ot.DecideForEach&&i){const ne=n.map(_=>({file:_,action:T.get(_.path)||nt.Replace}));i(ne)}},[J,C,R,s,o,D,i,n,T]);return f.jsx(Uo,{open:e,onClose:me,size:C?Wt.Sm:Wt.Md,className:ue([!C&&"w-[600px]"]),header:A,dividers:!1,preventKeyboardOnOpen:!0,footer:f.jsxs("div",{className:"flex justify-end gap-3 py-4 px-6 border-t border-tertiary",children:[f.jsx(ys,{onClick:me,label:h}),f.jsx(bs,{onClick:Re,label:u})]}),children:f.jsxs("div",{className:"px-6 py-4",children:[f.jsx("p",{className:"text-secondary mb-4 break-words",children:L}),C?f.jsx(Fa,{elementId:"single-file-conflict",radioButtons:de,activeRadioButton:R,orientation:To.Column,onChange:ne=>E(ne)}):f.jsx(Fa,{elementId:"multiple-files-conflict",radioButtons:Q,activeRadioButton:D,orientation:To.Column,onChange:ne=>P(ne),formItemChildrenClassName:"gap-3"})]})})},$L=({getContextMenuItems:e,isRowDisabled:t,allowedFileTypes:s,maxSelectableFileSize:o,buttonClassName:i})=>{const n=g.useRef(e);g.useEffect(()=>{n.current=e},[e]);const r=g.useCallback(l=>{if(!l.data||t(l.data,s,o))return null;const d=l.data?n.current?.(l.data)??[]:[];return d.length?f.jsx(Ft,{placement:"bottom-start",allowedPlacements:["top-start","top-end","bottom-start"],menu:{items:d},className:oe("sticky right-0",i),children:f.jsx($e,{className:"text-secondary mx-2 flex flex-row gap-2 hover:text-accent-primary cursor-default",icon:f.jsx(G.IconDotsVertical,{...Y})})}):null},[s,o,i,t]);return{actionsColumnDef:g.useMemo(()=>({colId:"__actions",headerName:"",width:44,minWidth:44,maxWidth:44,suppressSizeToFit:!0,sortable:!1,resizable:!1,filter:!1,floatingFilter:!1,cellRenderer:r}),[r])}},qL=({onRename:e})=>{const[t,s]=g.useState(Ii.Grid),o=g.useCallback(n=>{e(n),s(Ii.Grid)},[e]),i=g.useCallback(n=>{e(n),s(Ii.Tree)},[e]);return{renameTriggerView:t,onGridRename:o,onTreeRename:i}};function KL(e,t){const s=g.useRef(null),[o,i]=g.useState(!1);return g.useEffect(()=>{if(!s.current)return;const n=new ResizeObserver(([r])=>{const a=r.contentRect.width;i(a<e)});return n.observe(t?.current||s?.current),()=>n.disconnect()},[e,t]),{containerRef:s,isBelowBreakpoint:o}}const Go=(e,t)=>{if(!(!e||!e.length||!t))for(const s of e){if(s.path===t)return s;const o=Go(s.items,t);if(o)return o}},Rp=(e,t)=>{if(!e?.length)return;if(!t)return e[0];const s=Go(e,t);if(s&&s.nodeType===be.FOLDER)return s;const o=t.split("/").filter(Boolean);if(o.length<=1)return e[0];const i="/"+o.slice(0,o.length-1).join("/");return Go(e,i)??e[0]},ki=e=>(e??"").toLowerCase(),YL=e=>ki(e).replace(/^\./,""),ZL=e=>{if(!e)return[];const t=[],s=o=>{const i=o.items??[];for(const n of i)t.push(n),n.nodeType===be.FOLDER&&s(n)};return s(e),t},Zv=e=>(e.name??e.path.split("/").pop()??"").startsWith("."),or=e=>{if(!e)return"0 bytes";const t=1024,s=t*1024;return e>=s?`${(e/s).toFixed(1)} MB`:e>=t?`${(e/t).toFixed(0)} KB`:`${e} bytes`},XL=(e,t="en-US",s={year:"numeric",month:"short",day:"2-digit"})=>{if(!e)return"";try{return new Intl.DateTimeFormat(t,s).format(new Date(e))}catch{return e}};function Xv(e,t,s){if(!e||e.includes("*/*"))return!0;const o=t.toLowerCase(),i=s&&s.includes(".")?`.${s.split(".").at(-1).toLowerCase()}`:void 0;return e.some(n=>{const r=n.toLowerCase();if(r.startsWith("."))return i===r;if(r.endsWith("/*")){const a=r.slice(0,-1);return o.startsWith(a)}return o===r})}const QL=e=>e?.join(", ")??"",Sl=e=>{if(!e)return;const t=e.flags.replace(/[gy]/g,"");return new RegExp(e.source,t)};function dh(e,t,s){if(t&&Sl(t)?.test(e.name))return s??`This ${e.isFolder?"folder":"file"} contains forbidden characters in its name. Please rename it.`}const JL=(e,t,s,o,i)=>{if(e.nodeType===be.FOLDER)return;const n=!e.contentLength||s==null||e.contentLength<=s;if(!(!e.contentType||Xv(t,e.contentType,e.name)))return o??(t?.length?`Unsupported file type. Supported types: ${QL(t)}.`:"Unsupported file type.");if(!n)return i??`File is too large. Maximum size: ${or(s)}.`},e7=e=>{const[t,s]=g.useState(e?.showHiddenFiles??!1),o=!!e?.onShowHiddenFilesChange,i=o?e.showHiddenFiles??!1:t,n=g.useCallback(a=>{o?e?.onShowHiddenFilesChange?.(a):s(a)},[o,e]),r=g.useCallback(()=>{const a=!i;o?e?.onShowHiddenFilesChange?.(a):s(a)},[i,o,e]);return{areHiddenFilesVisible:i,toggleHiddenFilesVisibility:r,setAreHiddenFilesVisible:n}},t7=e=>{const[t,s]=g.useState(e?.collapsed??!1),o=!!e?.onCollapseChange,i=o?e.collapsed??!1:t,n=g.useCallback(a=>{o?e?.onCollapseChange?.(a):s(a)},[o,e]),r=g.useCallback(()=>{const a=!i;o?e?.onCollapseChange?.(a):s(a)},[i,o,e]);return{isTreeCollapsed:i,toggleTreeCollapse:r,setIsTreeCollapsed:n}},Fp=(e,t,s)=>{if(!t.has(e))return e;const o=s===be.FOLDER?(i,n)=>`${i} (${n})`:(i,n)=>{const r=i.lastIndexOf("."),a=r>0,l=a?i.slice(0,r):i,c=a?i.slice(r):"";return`${l} (${n})${c}`};for(let i=1;;i++){const n=o(e,i);if(!t.has(n))return n}},Qc=e=>e.name,Qv=({getDestinationFiles:e,onResolve:t})=>{const[s,o]=g.useState([]),[i,n]=g.useState(!1),[r,a]=g.useState(null),l=g.useRef(!1),c=g.useCallback(S=>{l.current=!0,o(S),n(!0)},[]),d=g.useCallback(()=>{l.current=!1,n(!1),o([]),a(null)},[]),u=g.useCallback((S,x)=>{const y=e(S),F=new Set(y.map(Qc)),R=x.filter(E=>F.has(E.name));return{hasConflicts:R.length>0,conflicts:R}},[e]),h=g.useCallback((S,x,y,F)=>{const R=e(S),E=new Set(R.map(Qc));return x.map(D=>{const P=D.name,T=E.has(P),M=y&&T?P:Fp(P,E,D.nodeType);return(!y||!T)&&E.add(M),{sourceUrl:D.path,destinationUrl:`${S}/${M}`,overwrite:y&&T,nodeType:D.nodeType??be.ITEM,...F??{}}})},[e]),p=g.useCallback((S,x,y,F)=>{const R=e(S),E=new Set(R.map(Qc));return x.filter(P=>y.get(P.path)!==nt.Cancel).map(P=>{const T=y.get(P.path),M=E.has(P.name),k=T===nt.Replace&&M,N=k?P.name:Fp(P.name,E,P.nodeType);return k||E.add(N),{sourceUrl:P.path,destinationUrl:`${S}/${N}`,overwrite:k,nodeType:P.nodeType??be.ITEM,...F??{}}})},[e]),m=g.useCallback((S,x,y)=>{const F=u(S,x);return F.hasConflicts&&(a({files:x,destinationFolder:S,metadata:y}),c(F.conflicts)),F},[u,c]),C=g.useCallback(()=>{if(!r)return;const{files:S,destinationFolder:x,metadata:y}=r,F=h(x,S,!0,y);t?.(F,x),d()},[r,h,t,d]),v=g.useCallback(()=>{if(!r)return;const{files:S,destinationFolder:x,metadata:y}=r,F=h(x,S,!1,y);t?.(F,x),d()},[r,h,t,d]),w=g.useCallback(()=>{if(!r)return;const{files:S,destinationFolder:x,metadata:y}=r,F=p(x,S,new Map(s.map(R=>[R.path,nt.Cancel])),y);t?.(F,x),d()},[d,s,t,r,p]),b=g.useCallback(S=>{if(!r)return;const{files:x,destinationFolder:y,metadata:F}=r,R=new Map(S.map(D=>[D.file.path,D.action])),E=p(y,x,R,F);t?.(E,y),d()},[r,p,t,d]);return{conflictingFiles:s,conflictResolutionOpen:i,hasActiveConflictRef:l,checkForConflicts:u,startConflictResolution:m,resolveConflictsWithStrategy:h,resolveConflictsWithDecisions:p,openConflictResolution:c,closeConflictResolution:d,handleReplaceAll:C,handleDuplicateAll:v,handleCancelAll:w,handleDecideForEach:b}},s7=({getDestinationFiles:e,onCopyFiles:t,onMoveToFiles:s,onCopySuccess:o,onMoveSuccess:i,onDuplicateSuccess:n,getCopyHeader:r,getMoveHeader:a})=>{const[l,c]=g.useState(!1),[d,u]=g.useState([]),[h,p]=g.useState([]),[m,C]=g.useState(rt.Copy),[v,w]=g.useState(),[b,S]=g.useState(null),{conflictingFiles:x,conflictResolutionOpen:y,hasActiveConflictRef:F,startConflictResolution:R,resolveConflictsWithStrategy:E,closeConflictResolution:D,openConflictResolution:P,handleReplaceAll:T,handleDuplicateAll:M,handleCancelAll:k,handleDecideForEach:N}=Qv({getDestinationFiles:e,onResolve:(ie,$)=>{b?.type===rt.Copy?(t?.(ie,$),o?.()):b?.type===rt.Move&&b.sourceFolder&&(s?.(ie,b.sourceFolder,$),i?.())}}),A=g.useCallback(()=>{u([]),p([]),S(null),w(void 0)},[]),W=g.useCallback(ie=>{const $=R(ie,d,{type:rt.Copy});if(S({type:rt.Copy}),!$.hasConflicts){const q=E(ie,d,!1);t?.(q,ie),o?.(),A()}},[d,R,E,t,o,A]),U=g.useCallback((ie,$)=>{const q=$||(b?.sourceFolder??"/");if(!R(ie,h,{type:rt.Move,sourceFolderPath:q}).hasConflicts){const B=E(ie,h,!0);s?.(B,q,ie),i?.(),A()}},[h,R,E,s,i,A,b]),L=g.useCallback(()=>{T(),A()},[T,A]),de=g.useCallback(()=>{M(),A()},[M,A]),H=g.useCallback(()=>{k(),A()},[k,A]),te=g.useCallback(ie=>{N(ie),A()},[N,A]),Q=g.useCallback(ie=>{const $=ie.at(0)?.parentPath??"/",q=E($,ie,!1);t?.(q,$),n?.()},[t,n,E]),J=g.useCallback(ie=>{C(ie),c(!0)},[]),me=g.useCallback(()=>{c(!1),F.current||A()},[A,F]),[Re,ne]=g.useState(),_=g.useCallback(ie=>{u(ie);const $=ie[0]?.parentPath??ie[0]?.folderId;w($),r&&ie.length>0?ne(r(ie.length,ie[0]?.name)):ne(void 0)},[r]),Fe=g.useCallback(ie=>{p(ie);const $=ie[0]?.parentPath??ie[0]?.folderId;w($),S({type:rt.Move,sourceFolder:$}),a&&ie.length>0?ne(a(ie.length,ie[0]?.name)):ne(void 0)},[a]);return{handleDuplicate:Q,handleCloseDestinationFolderPopup:me,handleOpenDestinationFolderPopup:J,handleCopyTo:W,handleMoveTo:U,openDestinationFolderPopup:l,destinationFolderMode:m,destinationFolderTitle:Re,handleSetCopiedFiles:_,handleSetMovedFiles:Fe,clearState:A,conflictingFiles:x,conflictResolutionOpen:y,openConflictResolution:P,closeConflictResolution:D,handleConflictReplace:L,handleConflictCancel:H,handleConflictDuplicate:de,handleConflictDecideForEach:te,sourceFolder:v}},o7=({path:e,defaultPath:t,onPathChange:s,onSelectionClear:o})=>{const i=e!==void 0,[n,r]=g.useState(t),a=i?e:n,l=g.useCallback(d=>{i||r(d),s?.(d)},[i,s]),c=g.useCallback(d=>{l(d),o?.()},[l,o]);return{currentPath:a,setCurrentPath:l,handlePathChange:c}},i7=({onDeleteFiles:e,onDeleteSuccess:t})=>{const[s,o]=g.useState(!1),[i,n]=g.useState([]),[r,a]=g.useState(""),l=g.useCallback((u,h)=>{n(u),a(h),o(!0)},[]),c=g.useCallback(()=>{o(!1),n([])},[]),d=g.useCallback(()=>{if(e&&i.length>0){const u=i.map(h=>({sourceUrl:h.path,nodeType:h.nodeType}));e(u,r),t?.()}c()},[i,e,t,c,r]);return{deleteConfirmationOpen:s,itemsToDelete:i,openDeleteConfirmation:l,closeDeleteConfirmation:c,confirmDelete:d}},n7=({onDownloadFiles:e,customDownloadItemsAction:t,onDownloadSuccess:s})=>({handleDownloadFiles:g.useCallback(i=>{t&&i.length>0?t(i):e&&i.length>0&&(e(i),s?.())},[e,s,t])}),r7=e=>"dataTransfer"in e&&e.dataTransfer!==null,a7=({onUploadFiles:e,onValidateUpload:t,maxFileSize:s,allowedFileTypes:o,validationMessages:i={},onUploadArchive:n,uploadEnabled:r=!0,currentFolder:a}={})=>{const[l,c]=g.useState(!1),[d,u]=g.useState(!1),[h,p]=g.useState(),m=g.useRef(null),C=g.useRef(""),v=g.useRef([]),w=g.useMemo(()=>!!a?.permissions?.includes($o.WRITE),[a]),[b,S]=g.useState(new Map),[x,y]=g.useState(null),F=g.useCallback(B=>!o||o.includes("*/*")?B:B.filter(({fileContent:pe,name:le})=>Xv(o,pe.type,le)),[o]),R=g.useCallback(()=>{S(new Map),y(null)},[]),{conflictingFiles:E,conflictResolutionOpen:D,hasActiveConflictRef:P,startConflictResolution:T,closeConflictResolution:M,openConflictResolution:k,handleReplaceAll:N,handleDuplicateAll:A,handleCancelAll:W,handleDecideForEach:U}=Qv({getDestinationFiles:()=>v.current,onResolve:(B,pe)=>{if(!r||!w){R();return}if(!x)return;const le=B.map(re=>{const Ce=b.get(re.sourceUrl);if(!Ce)return;const xe=re.destinationUrl.split("/").pop();return{fileContent:Ce.fileContent,name:xe}}).filter(Boolean);le.length>0&&e?.(le,pe),R()}});g.useEffect(()=>{r&&w||(c(!1),u(!1),p(void 0),M(),R())},[r,M,R,w]),g.useEffect(()=>{if(!r||!w)return;let B=0;const pe=xe=>{r7(xe)&&xe.dataTransfer.types.includes(VL)&&(B++,u(!0))},le=()=>{B--,B===0&&u(!1)},re=()=>{B=0,u(!1)},Ce=xe=>{xe.preventDefault()};return window.addEventListener("dragenter",pe),window.addEventListener("dragleave",le),window.addEventListener("drop",re),window.addEventListener("dragover",Ce),()=>{window.removeEventListener("dragenter",pe),window.removeEventListener("dragleave",le),window.removeEventListener("drop",re),window.removeEventListener("dragover",Ce)}},[r,w]);const L=g.useCallback(B=>s?B.filter(pe=>pe.fileContent.size>s).map(pe=>pe.name):[],[s]),de=g.useCallback((B,pe)=>B.map(le=>({id:le.name,name:le.name,folderId:pe,path:le.name,nodeType:be.ITEM,parentPath:pe,contentLength:le.fileContent.size})),[]),H=g.useCallback(async(B,pe,le)=>{if(!r||!w)return!1;p(void 0),v.current=le;const re=L(B);if(re.length>0){const fe=s?(s/1048576).toFixed(2):0,De=i.oversizedFiles||`Files exceed maximum size (${fe}MB): ${re.join(", ")}`;return p(De),!1}if(t)try{const fe=await t(B,le,pe);if(!fe.valid)return p(fe.message||i.validationFailed||"Validation failed"),!1}catch{return p(i.validationError||"Validation error occurred"),!1}const Ce=new Map(B.map(fe=>[fe.name,fe]));S(Ce);const xe=de(B,pe);return y({destinationFolder:pe}),T(pe,xe,{destinationFolder:pe}).hasConflicts?!1:(e?.(B,pe),R(),!0)},[r,e,t,L,s,i,de,T,R,w]),te=g.useCallback(()=>{N(),R()},[N,R]),Q=g.useCallback(()=>{A(),R()},[A,R]),J=g.useCallback(()=>{W(),R()},[W,R]),me=g.useCallback(B=>{U(B),R()},[U,R]),Re=g.useCallback(()=>{M(),P.current||R()},[M,P,R]),ne=g.useCallback(B=>{!r||!w||(B.preventDefault(),B.stopPropagation(),B.dataTransfer.types.includes("Files")&&c(!0))},[r,w]),_=g.useCallback(B=>{if(!r||!w)return;B.preventDefault(),B.stopPropagation();const pe=B.currentTarget.getBoundingClientRect(),le=B.clientX,re=B.clientY;(le<=pe.left||le>=pe.right||re<=pe.top||re>=pe.bottom)&&c(!1)},[r,w]),Fe=g.useCallback(B=>{!r||!w||(B.preventDefault(),B.stopPropagation(),B.dataTransfer.types.includes("Files")&&(B.dataTransfer.dropEffect="copy"))},[r,w]),ie=g.useCallback(async(B,pe,le)=>{if(!r||!w||(B.preventDefault(),B.stopPropagation(),c(!1),!B.dataTransfer.types.includes("Files")))return;const re=Array.from(B.dataTransfer.files);if(re.length===0)return;const Ce=re.map(Le=>({fileContent:Le,name:Le.name})),xe=F(Ce);if(xe.length===0){p(i.unsupportedFiles||"Selected files are not supported");return}await H(xe,pe,le)},[r,F,H,i,w]);g.useEffect(()=>{let B=m.current;B||(B=document.createElement("input"),B.type="file",B.multiple=!0,B.style.display="none",document.body.appendChild(B),m.current=B),o&&o.length>0?B.accept=o.join(","):B.removeAttribute("accept");const pe=async()=>{if(!r||!w){B&&(B.value="");return}if(!B?.files?.length)return;const re=Array.from(B.files).map(xe=>({fileContent:xe,name:xe.name})),Ce=F(re);if(Ce.length===0){p(i.unsupportedFiles||"Selected files are not supported"),B.value="";return}await H(Ce,C.current,v.current),B.value=""};return B.addEventListener("change",pe),()=>{B&&(B.removeEventListener("change",pe),m.current===B&&(document.body.removeChild(B),m.current=null))}},[r,o,F,H,i,w]);const $=g.useCallback((B,pe)=>{!r||!w||(C.current=B,v.current=pe,m.current&&m.current.click())},[r,w]),q=g.useCallback((B,pe)=>{if(!n||!r||!w)return;const le=document.createElement("input");le.type="file",le.accept=".zip,application/zip",le.multiple=!1,le.style.display="none";const re=()=>{const Ce=le.files?.[0];if(!Ce){document.body.removeChild(le);return}const xe=Ce.name.replace(/\.zip$/i,"");if(pe.some(fe=>fe.nodeType===be.FOLDER&&fe.name.toLowerCase()===xe.toLowerCase())){p(i.validationFailed||`Folder with name "${xe}" already exists`),document.body.removeChild(le);return}try{n(Ce,xe,B)}finally{document.body.removeChild(le)}};le.addEventListener("change",re),document.body.appendChild(le),le.click()},[r,n,i,w]),se=g.useCallback(()=>{p(void 0)},[]);return{isDragging:l,isDraggingOverWindow:d,uploadError:h,handleDragEnter:ne,handleDragLeave:_,handleDragOver:Fe,handleDrop:ie,clearError:se,handleUpload:H,openFileDialog:$,openArchiveDialog:q,fileInputRef:m,uploadConflictingFiles:E,uploadConflictResolutionOpen:D,hasActiveUploadConflictRef:P,openUploadConflictResolution:k,closeUploadConflictResolution:Re,handleUploadConflictReplace:te,handleUploadConflictDuplicate:Q,handleUploadConflictCancel:J,handleUploadConflictDecideForEach:me}},Jv=g.createContext(void 0),ew={hiddenItemWarning:`${is.Warning}__A dot at the start of the name will make the item hidden`},l7={emptyName:"Name cannot be empty",duplicateName:"An item with this name already exists",hiddenItemWarning:ew.hiddenItemWarning};function c7(e){let t=e.length;for(;t>0&&e[t-1]==="/";)t--;return e.slice(0,t)}function d7(e,t){const s=c7(e),o=s.lastIndexOf("/");return o===-1?t:s.slice(0,o+1)+t}function u7(e){const t=e.lastIndexOf(".");return t===-1||t===0?e:e.substring(0,t)}function Ep(e){const t=e.lastIndexOf(".");return t===-1||t===0?"":e.substring(t)}const h7=({items:e,onRenameValidate:t,validationMessages:s,onMoveToFiles:o})=>{const[i,n]=g.useState(),r=g.useMemo(()=>({...l7,...s}),[s]),a=g.useMemo(()=>i?.path,[i]),l=g.useCallback(p=>{const m=Go(e,p);m&&n(m)},[e]),c=g.useCallback(()=>{n(void 0)},[]),d=g.useCallback(p=>{if(!i||!o){n(void 0);return}const m=i.nodeType===be.ITEM;let C=p.trim();if(m){const S=Ep(i.name);S&&!C.endsWith(S)&&(C=C+S)}if(C===i.name){n(void 0);return}const v=d7(i.path,C),w=i.parentPath;if(!w){n(void 0);return}const b={sourceUrl:i.path,destinationUrl:v,nodeType:i.nodeType};o([b],w,w),n(void 0)},[i,o]),u=g.useCallback((p,m)=>{const C=p.trim();if(!C)return r.emptyName;if(C.startsWith("."))return r.hiddenItemWarning;const v=m.nodeType===be.ITEM;let w=C;if(v){const S=Ep(m.name);S&&!w.endsWith(S)&&(w=w+S)}const b=m.parentPath;if(b){const S=Go(e,b);if(S&&new Set((S.items??[]).filter(y=>y.path!==m.path).map(y=>y.name.toLowerCase())).has(w.toLowerCase()))return r.duplicateName}if(t){const S=t(w,m);if(S)return S}return null},[t,r,e]),h=g.useCallback(p=>p.nodeType===be.ITEM?u7(p.name):p.name,[]);return{renamedPath:a,renamedItem:i,renameHandler:l,renameSaveHandler:d,renameCancelHandler:c,renameValidateHandler:u,getDisplayName:h}},tw=e=>{const[t,s]=g.useState(e?.expandedPaths??new Set),o=g.useMemo(()=>!!e?.onExpandedPathsChange,[e?.onExpandedPathsChange]),i=g.useMemo(()=>o?e?.expandedPaths??new Set:t,[o,e?.expandedPaths,t]);g.useEffect(()=>{o&&e?.expandedPaths&&s(new Set(e.expandedPaths))},[o,e?.expandedPaths]);const n=g.useCallback(d=>{o?e?.onExpandedPathsChange?.(d):s(d)},[o,e]),r=g.useCallback(d=>{const u=new Set(i);u.has(d)?u.delete(d):u.add(d),n(u)},[i,n]),a=g.useCallback(()=>{n(new Set)},[n]),l=g.useCallback(d=>{const u=new Set(i);u.add(d),n(u)},[i,n]),c=g.useCallback(d=>{const u=new Set(i);u.delete(d),n(u)},[i,n]);return{expandedPaths:i,setExpandedPaths:n,togglePath:r,collapseAll:a,expandPath:l,collapsePath:c,isControlled:o}},g7=({newActions:e,currentFolder:t,onUploadFiles:s,onCreateFolder:o,onUploadArchive:i,onCreateNewItem:n,isNewButtonDisabled:r})=>{const a=g.useMemo(()=>{const d=[];return e&&(e.newFolder&&d.push({key:"new-folder",label:e.newFolder.label,icon:e?.newFolder?.icon!==void 0?e?.newFolder?.icon:f.jsx(G.IconFolder,{...Y,className:"text-secondary"}),onClick:()=>{o&&o()}}),e.newItem&&d.push({key:"new-item",label:e.newItem.label,icon:e?.newItem?.icon!==void 0?e?.newItem?.icon:f.jsx(G.IconPlus,{...Y,className:"text-secondary"}),onClick:()=>{n&&n()}}),e.uploadFiles&&d.push({key:"upload-file",label:e.uploadFiles.label,icon:e?.uploadFiles?.icon!==void 0?e?.uploadFiles?.icon:f.jsx(G.IconFile,{...Y,className:"text-secondary"}),onClick:()=>{s&&s()}}),e.uploadArchive&&d.push({key:"upload-archive",label:e.uploadArchive.label,icon:e?.uploadArchive?.icon!==void 0?e?.uploadArchive?.icon:f.jsx(G.IconFileZip,{...Y,className:"text-secondary"}),onClick:()=>{i&&i()}})),d},[e,o,s,i,n]),l=g.useMemo(()=>a?.length>0,[a]),c=g.useMemo(()=>!t?.permissions?.includes($o.WRITE)||!!r,[t,r]);return{newActions:a,isNewButtonVisible:l,isNewButtonDisabled:c}},p7={emptyName:"Folder name cannot be empty",duplicateName:"A folder with this name already exists",hiddenItemWarning:ew.hiddenItemWarning},f7=({currentFolder:e,onCreateFolder:t,onValidateFolderName:s,validationMessages:o})=>{const[i,n]=g.useState(!1),[r,a]=g.useState(null),l=g.useRef(e?.path),c=g.useMemo(()=>({...p7,...o}),[o]);g.useEffect(()=>{const m=e?.path;l.current!==m&&i&&(n(!1),a(null)),l.current=m},[e?.path,i]);const d=g.useCallback(()=>{const m=`__new_folder_${Date.now()}`;a(m),n(!0)},[]),u=g.useCallback(()=>{n(!1),a(null)},[]),h=g.useCallback(m=>{const C=m.trim();if(!C)return c.emptyName;if(C.startsWith("."))return c.hiddenItemWarning;if(e&&new Set((e.items??[]).filter(w=>w.nodeType===be.FOLDER).map(w=>w.name.toLowerCase())).has(C.toLowerCase()))return c.duplicateName;if(s&&e){const v=s(C,e);if(v)return v}return null},[e,s,c]),p=g.useCallback(async m=>{const C=m.trim();if(!C)return;const w=`${e?.path??"/"}/${C}`,b=`${w}/${Zc}`,x={fileContent:new File([],Zc,{type:"text/plain"}),name:Zc};t&&await t(x,w,b),u()},[e,t,u]);return{isCreatingFolder:i,newFolderTempId:r,startFolderCreation:d,cancelFolderCreation:u,saveFolderCreation:p,validateFolderName:h}},m7=({additionalButtons:e,expandedPathsLength:t,collapseAll:s})=>{const o=t===0;return{additionalButtons:g.useMemo(()=>{const n=oe(["hover:text-accent-primary",o&&"controls-secondary-disable hover:controls-secondary-disable disabled:hover:cursor-default"]);return f.jsxs(f.Fragment,{children:[e,f.jsx(no,{disabled:o,className:n,size:bt.Small,onClick:s,icon:f.jsx(G.IconCopyMinus,{size:pt.LG,stroke:1.5}),"aria-label":"collapse-all"})]})},[e,o,s])}},C7=({onGetInfo:e})=>{const[t,s]=g.useState(!1),[o,i]=g.useState(void 0),n=g.useCallback(async a=>{i(a),s(!0),e&&await e(a)},[e]),r=g.useCallback(()=>{s(!1),i(void 0)},[]);return{isMetadataPopupOpen:t,selectedFileForMetadata:o,openMetadataPopup:n,closeMetadataPopup:r}};function v7(e){const t=[];function s(o){for(const i of o)t.push(i),i.items&&s(i.items)}return s(e),t}function Dp(e,t){const s=ki(t);return e.filter(o=>ki(o.name).includes(s))}function w7({onSearchFiles:e,clearSearchResults:t,currentPath:s,searchResults:o=[],searchInProgress:i=!1,navigationPanelValue:n,onNavigationPanelSearchChange:r,allItems:a=[],activeTab:l}){const[c,d]=g.useState(""),u=g.useRef(!1),h=g.useRef(!1),p=g.useRef([]),m=g.useRef(s),C=g.useRef(l);g.useEffect(()=>{n!=null&&d(String(n))},[n]);const v=String(n??c??"").trim(),w=h.current&&(i||o.length>0||v!==""),b=g.useCallback(F=>{const R=F.trim();if(!R){h.current=!1,u.current=!1;return}h.current=!0,e&&s&&!u.current&&(u.current=!0,e(s,R))},[e,s]),S=g.useCallback(()=>{u.current=!1,h.current=!1,p.current=[],d(""),r?.(""),t?.()},[t,r]),x=g.useCallback(F=>{const R=String(F??"");d(R),r?.(R),R.trim()?b(R):S()},[r,b,S]);g.useEffect(()=>{(m.current!==s||C.current!==l)&&(m.current=s,C.current=l,u.current=!1,h.current=!1,p.current=[],d(""),r?.(""),t?.())},[s,l,r,t]),g.useEffect(()=>{o.length>0&&p.current.length===0&&(p.current=o)},[o]);const y=g.useMemo(()=>{if(e){const R=p.current.length>0?p.current:o;return!v||R.length===0?R:Dp(R,v)}if(!v||!a.length)return[];const F=v7(a);return Dp(F,v)},[e,o,v,a]);return{isSearchMode:w,searchValue:c,effectiveSearchValue:v,setSearchValue:d,handleSearchChange:x,handleSearchActivate:b,handleSearchClear:S,searchResultsRows:y}}function b7({selectedPaths:e,defaultSelectedPaths:t,onSelectedPathsChange:s}){const o=e!==void 0,[i,n]=g.useState(()=>t??new Set),r=g.useMemo(()=>o?e:i,[o,e,i]),a=g.useCallback(c=>{const d=new Set(c);s?.(d),o||n(d)},[o,s]),l=g.useCallback(()=>{a(new Set)},[a]);return{selectedPaths:r,setSelectedPaths:a,clearSelection:l,isControlled:o}}const sw=':;,=/{}%&\\"',uh=`(\r
63
63
  |
64
- |\r| )|[\0-]`,S7=`[${sw.replace(/\\/g,"\\\\")}]`,ow=new RegExp(`${S7}|${uh}`),y7=new RegExp(uh),iw=({managerLabel:e,children:t,className:s,items:o=[],rootItem:i,path:n,defaultPath:r,filesLoading:a,selectedPaths:l,defaultSelectedPaths:c,onSelectedPathsChange:d,showHiddenFiles:u,onShowHiddenFilesChange:h,treeOptions:p,showNavigationPanel:m=!0,navigationPanelOptions:C,deleteConfirmationOptions:v,gridOptions:w,toolbarOptions:b,bulkActionsToolbarOptions:S,destinationFolderPopupOptions:x,conflictResolutionPopupOptions:y,onPathChange:F,onTableFileClick:R,handleSelectionClick:E,onGridApiChange:D,onCopyFiles:P,onMoveToFiles:T,onDeleteFiles:M,onDownloadFiles:k,onRenameValidate:N,onAddSibling:A,onAddChild:W,renameValidationMessages:U,forbiddenSymbolsRegExp:L=ow,forbiddenSymbolsTooltip:de,onUploadFiles:H,onValidateUpload:te,uploadEnabled:Q,uploadValidationMessages:J,maxFileSize:me,onUploadArchive:Re,onCreateFolder:ne,onCreateFolderValidate:_,folderCreationValidationMessages:Fe,fileMetadataPopupOptions:ie,onGetInfo:$,onUnshareFiles:q,onRemoveFilesAccess:se,actionsRef:B,sharedByMePaths:pe,onSearchFiles:le,searchResults:re,searchInProgress:Ce,clearSearchResults:xe,allowedFileTypes:Le,maxSelectableFileSize:fe,getDisabledTooltip:De,fileTooLargeTooltip:ze,unsupportedFileTypeTooltip:Ne,emptyStateIcon:Ve,emptyStateTitle:kt,emptyStateDescription:Et,sharedWithMeIds:Ut,onFolderPopupPathChange:V,onManagePermissions:Ee,onPreview:At,onOpenInNewTab:Xi,previewExtensions:yl,isRenameFileAvailable:xl,isDuplicateFolderAvailable:Rl,customUploadFileAction:uo,customCreateNewItemAction:Qi,customDuplicateAction:qo,customDeleteItemsAction:fr,customDownloadItemsAction:Ko,customBreakpointRef:mr,gridClassName:Cr,nonClickableTableColumns:vr,hideSearchPathItemName:Fl})=>{const{selectedPaths:Ji,clearSelection:Rs,setSelectedPaths:El}=b7({selectedPaths:l,defaultSelectedPaths:c,onSelectedPathsChange:d}),Dl=g.useMemo(()=>{const Oe=new Map;return Ji.forEach(Lt=>{const Pt=Go(o,Lt);Pt&&Oe.set(Lt,Pt)}),Oe},[Ji,o]),{currentPath:ot,setCurrentPath:Pl,handlePathChange:Fs}=o7({path:n,defaultPath:r,onPathChange:F,onSelectionClear:Rs}),en=g.useMemo(()=>{const{showFiles:Oe=!0,showFolders:Lt=!0,...Pt}=w||{};return{showFiles:Oe,showFolders:Lt,...Pt}},[w]),tn=en.showFiles,sn=en.showFolders,[Tl,Ml]=g.useState(),ds=x?.destinationFolderPath??Tl,on=g.useCallback(Oe=>{x?.setDestinationFolderPath?x.setDestinationFolderPath(Oe):Ml(Oe)},[x]),{areHiddenFilesVisible:Yo,toggleHiddenFilesVisibility:Il}=e7({showHiddenFiles:u,onShowHiddenFilesChange:h}),{isTreeCollapsed:Zo,toggleTreeCollapse:Xo,setIsTreeCollapsed:kl}=t7({collapsed:p?.collapsed,onCollapseChange:p?.onCollapseChange}),{renamedPath:wr,renamedItem:Qo,renameHandler:br,renameSaveHandler:Sr,renameCancelHandler:yr,renameValidateHandler:Jo,getDisplayName:Al}=h7({items:o,onRenameValidate:N,validationMessages:U,onMoveToFiles:T}),{isSearchMode:zs,searchValue:Ll,effectiveSearchValue:nn,setSearchValue:Ol,handleSearchChange:Nl,handleSearchClear:Dt,searchResultsRows:xr}=w7({onSearchFiles:le,clearSearchResults:xe,currentPath:ot,searchResults:re,searchInProgress:Ce,navigationPanelValue:C?.value,onNavigationPanelSearchChange:C?.onSearchChange,allItems:o,activeTab:b?.activeTab}),et=g.useMemo(()=>Rp(o,ot)??o[0],[o,ot]),{handleCopyTo:Rr,handleMoveTo:Hl,handleDuplicate:rn,handleOpenDestinationFolderPopup:Fr,handleCloseDestinationFolderPopup:Gl,openDestinationFolderPopup:ei,handleSetCopiedFiles:Er,handleSetMovedFiles:Dr,destinationFolderMode:Pr,destinationFolderTitle:ti,conflictingFiles:Tr,conflictResolutionOpen:si,closeConflictResolution:Bl,handleConflictReplace:Mr,handleConflictDuplicate:an,handleConflictCancel:Vl,handleConflictDecideForEach:zl,sourceFolder:Wl}=s7({getDestinationFiles:Oe=>Rp(o,Oe)?.items??[],onCopyFiles:P,onMoveToFiles:T,onCopySuccess:Rs,onMoveSuccess:Rs,onDuplicateSuccess:Rs,getCopyHeader:x?.getCopyHeader,getMoveHeader:x?.getMoveHeader});g.useEffect(()=>{ei||on(void 0)},[ei,on]);const{deleteConfirmationOpen:_l,itemsToDelete:jl,openDeleteConfirmation:Ir,closeDeleteConfirmation:kr,confirmDelete:Ar}=i7({onDeleteFiles:M,onDeleteSuccess:Rs}),{handleDownloadFiles:oi}=n7({onDownloadFiles:k,customDownloadItemsAction:Ko,onDownloadSuccess:Rs}),{isDragging:Ws,isDraggingOverWindow:Ul,uploadError:vt,handleDragEnter:$l,handleDragLeave:ln,handleDragOver:ii,handleDrop:_s,clearError:Lr,openFileDialog:cn,fileInputRef:Or,openArchiveDialog:dn,uploadConflictingFiles:Nr,uploadConflictResolutionOpen:ql,closeUploadConflictResolution:Kl,handleUploadConflictReplace:Hr,handleUploadConflictDuplicate:un,handleUploadConflictCancel:Yl,handleUploadConflictDecideForEach:Zl}=a7({onUploadFiles:H,onValidateUpload:te,maxFileSize:me,onUploadArchive:Re,allowedFileTypes:Le,validationMessages:J,uploadEnabled:Q,currentFolder:et}),hn=g.useCallback(Oe=>{Dt();const Lt=ot??"",Pt=et?.items??[];_s(Oe,Lt,Pt)},[ot,et,_s,Dt]),gn=g.useCallback(()=>{Dt();const Oe=ot??"",Lt=et?.items??[];cn(Oe,Lt)},[ot,et,cn,Dt]),Gr=g.useCallback(()=>{Dt();const Oe=ot??"",Lt=et?.items??[];dn(Oe,Lt)},[ot,et,dn,Dt]),Br=g.useCallback(()=>{Dt(),uo?.(ot,et)},[uo,ot,et,Dt]),Vr=g.useCallback(()=>{Dt(),Qi?.(ot,et)},[Qi,ot,et,Dt]),zr=g.useCallback(Oe=>{qo?.(Oe)},[qo]),{isCreatingFolder:ni,newFolderTempId:j,startFolderCreation:We,cancelFolderCreation:Ke,saveFolderCreation:$t,validateFolderName:ho}=f7({currentFolder:et,onCreateFolder:ne,onValidateFolderName:_,validationMessages:Fe}),ph=g.useCallback(()=>{Dt(),We()},[Dt,We]),{newActions:gw,isNewButtonVisible:pw,isNewButtonDisabled:fw}=g7({newActions:b?.newActions,currentFolder:et,onUploadFiles:uo?Br:gn,onUploadArchive:Gr,onCreateFolder:ph,onCreateNewItem:Vr,isNewButtonDisabled:b?.isNewButtonDisabled}),mw=g.useMemo(()=>{if(zs){let ke=xr;tn||(ke=ke.filter(_e=>_e.nodeType!==be.ITEM)),sn||(ke=ke.filter(_e=>_e.nodeType!==be.FOLDER)),Yo||(ke=ke.filter(_e=>!_e.path.split("/").filter(Boolean).some(fn=>fn.startsWith("."))));const pn=ke.map(_e=>({..._e,id:_e.id??_e.path,name:_e.name??_e.path.split("/").pop()??"",updatedAt:_e.updatedAt,size:_e.contentLength,contentLength:_e.contentLength,author:_e.author,path:_e.path,nodeType:_e.nodeType,extension:_e.extension,isTemporary:!1,owner:_e.owner,folderId:_e.folderId}));return ni&&j&&pn.unshift({id:j,name:"",updatedAt:void 0,author:void 0,path:ot??"/",nodeType:be.FOLDER,extension:void 0,isTemporary:!0,owner:void 0}),pn}const Oe=ki(nn).trim(),Lt=et?.items??[];let Pt=Oe?ZL(et):Lt;tn||(Pt=Pt.filter(ke=>ke.nodeType!==be.ITEM)),sn||(Pt=Pt.filter(ke=>ke.nodeType!==be.FOLDER)),Yo||(Pt=Pt.filter(ke=>Oe?!ke.path.split("/").filter(Boolean).some(_e=>_e.startsWith(".")):!Zv(ke)));const Xl=Pt.map(ke=>({...ke,id:ke.id??ke.path,name:ke.name??ke.path.split("/").pop()??"",updatedAt:ke.updatedAt,size:ke.contentLength,author:ke.author,path:ke.path,nodeType:ke.nodeType,extension:ke.extension,isTemporary:!1,owner:ke.owner,contentType:ke.contentType,contentLength:ke.contentLength,folderId:ke.folderId}));if(ni&&j&&!Oe&&Xl.unshift({id:j,name:"",updatedAt:void 0,author:void 0,path:ot??"/",nodeType:be.FOLDER,extension:void 0,isTemporary:!0,owner:void 0}),!Oe)return Xl;const Tw=Oe.split(/\s+/).filter(Boolean);return Xl.filter(ke=>{if(ke.isTemporary)return!0;const pn=ki(ke.name),_e=ki(ke.author),Ch=YL(ke.extension);return Tw.every(fn=>pn.includes(fn)||_e.includes(fn)||Ch.includes(fn))})},[zs,xr,et,nn,Yo,ni,j,tn,sn,ot]),Cw=g.useCallback(Oe=>{Fs(Oe.path)},[Fs]),vw=g.useCallback(Oe=>{Fs(Oe)},[Fs]),ww=g.useCallback(Oe=>{Oe.nodeType===be.FOLDER?Fs(Oe.path):R?.(Oe)},[Fs,R]),{expandedPaths:fh,setExpandedPaths:bw,collapseAll:Sw}=tw({expandedPaths:p?.expandedPaths,onExpandedPathsChange:p?.onExpandedPathsChange}),{additionalButtons:yw}=m7({collapseAll:Sw,expandedPathsLength:fh.size,additionalButtons:p?.additionalButtons}),{isMetadataPopupOpen:xw,selectedFileForMetadata:Rw,openMetadataPopup:Fw,closeMetadataPopup:mh}=C7({onGetInfo:$}),Ew=g.useCallback(()=>{mh(),ie?.clearMetadata?.()},[mh,ie]),Dw=g.useMemo(()=>{if(L)return Sl(L)},[L]),Pw={managerLabel:e,className:s,items:o,allowedFileTypes:Le,maxSelectableFileSize:fe,rootItem:i,filesLoading:a,treeOptions:{...p,expandedPaths:fh,onExpandedPathsChange:bw,additionalButtons:yw},showNavigationPanel:m,navigationPanelOptions:C,gridOptions:en,toolbarOptions:b,bulkActionsToolbarOptions:S,deleteConfirmationOptions:v,destinationFolderPopupOptions:{...x,destinationFolderPath:ds,setDestinationFolderPath:on,header:ti,onCreateFolder:ne,onCreateFolderValidate:_,folderCreationValidationMessages:Fe,sourceFolder:Wl},currentPath:ot,setCurrentPath:Pl,searchValue:Ll,effectiveSearchValue:nn,setSearchValue:Ol,areHiddenFilesVisible:Yo,toggleHiddenFilesVisibility:Il,isTreeCollapsed:Zo,toggleTreeCollapse:Xo,setIsTreeCollapsed:kl,selectedPaths:Ji,selectedFiles:Dl,setSelectedPaths:El,clearSelection:Rs,currentFolder:et,gridRows:mw,handleCopyTo:Rr,handleMoveTo:Hl,handleDuplicate:qo?zr:rn,handleSetCopiedFiles:Er,handleSetMovedFiles:Dr,openDestinationFolderPopup:ei,handleCloseDestinationFolderPopup:Gl,handleOpenDestinationFolderPopup:Fr,destinationFolderMode:Pr,handleAddSibling:A,handleAddChild:W,handleDownloadFiles:oi,renamedPath:wr,renamedItem:Qo,forbiddenSymbolsRegExp:Dw,forbiddenSymbolsTooltip:de,onRename:br,onRenameSave:Sr,onRenameCancel:yr,onRenameValidate:Jo,getDisplayName:Al,openDeleteConfirmation:fr||Ir,closeDeleteConfirmation:kr,confirmDelete:Ar,deleteConfirmationOpen:_l,itemsToDelete:jl,handlePathChange:Fs,handleTreeItemClick:Cw,handleBreadcrumbItemClick:vw,handleSearchChange:Nl,handleTableRowClick:ww,onTableFileClick:R,handleSelectionClick:E,onGridApiChange:D,isDragging:Ws,uploadError:vt,handleDragEnter:$l,handleDragLeave:ln,handleDragOver:ii,handleDrop:hn,clearUploadError:Lr,onUploadFiles:H,onValidateUpload:te,maxFileSize:me,isDraggingOverWindow:Ul,openFileDialog:gn,fileInputRef:Or,newActions:gw,isNewButtonVisible:pw,isNewButtonDisabled:fw,isCreatingFolder:ni,newFolderTempId:j,startFolderCreation:ph,cancelFolderCreation:Ke,saveFolderCreation:$t,validateFolderName:ho,conflictResolutionPopupOptions:y,conflictingFiles:Tr,conflictResolutionOpen:si,closeConflictResolution:Bl,handleConflictReplace:Mr,handleConflictDuplicate:an,handleConflictCancel:Vl,handleConflictDecideForEach:zl,uploadConflictingFiles:Nr,uploadConflictResolutionOpen:ql,closeUploadConflictResolution:Kl,handleUploadConflictReplace:Hr,handleUploadConflictDuplicate:un,handleUploadConflictCancel:Yl,handleUploadConflictDecideForEach:Zl,fileMetadataPopupOptions:ie,isMetadataPopupOpen:xw,selectedFileForMetadata:Rw,openMetadataPopup:Fw,closeMetadataPopup:Ew,onGetInfo:$,onUnshareFiles:q,onRemoveFilesAccess:se,actionsRef:B,sharedByMePaths:pe,onSearchFiles:le,searchInProgress:Ce,searchResults:re,clearSearchResults:xe,isSearchMode:zs,emptyStateIcon:Ve,emptyStateTitle:kt,emptyStateDescription:Et,gridClassName:Cr,sharedWithMeIds:Ut,onFolderPopupPathChange:V,onManagePermissions:Ee,onPreview:At,onOpenInNewTab:Xi,previewExtensions:yl,isRenameFileAvailable:xl,isDuplicateFolderAvailable:Rl,customUploadFileAction:uo,customBreakpointRef:mr,nonClickableTableColumns:vr,hideSearchPathItemName:Fl,getDisabledTooltip:De,fileTooLargeTooltip:ze,unsupportedFileTypeTooltip:Ne};return f.jsx(Jv.Provider,{value:Pw,children:t})},x7=({disabledGridRowIds:e,gridRows:t,getDisabledTooltip:s,getRowDisabledTooltip:o,allowedFileTypes:i,maxSelectableFileSize:n})=>{const[r,a]=g.useState(null),[l,c]=g.useState(null);g.useEffect(()=>{const h=()=>{a(null),c(null)};return window.addEventListener("scroll",h,!0),()=>window.removeEventListener("scroll",h,!0)},[]),g.useEffect(()=>{const h=C=>{const w=C.target.closest(".ag-row");if(!w){a(S=>S&&null);return}const b=w.getAttribute("row-id");b&&e.has(b)?a(S=>S!==b?(c(w.getBoundingClientRect()),b):S):a(S=>S&&null)},p=()=>{a(null),c(null)},m=document.querySelector('[aria-label="File Manager Grid View"]');if(m)return m.addEventListener("mousemove",h),m.addEventListener("mouseleave",p),()=>{m.removeEventListener("mousemove",h),m.removeEventListener("mouseleave",p)}},[e]);const d=g.useMemo(()=>{if(r)return t.find(h=>h.path===r)},[r,t]),u=g.useMemo(()=>{if(d)return s&&d.folderId?s(d):o(d,i,n)},[d,s,o,i,n]);return f.jsx(f.Fragment,{children:u&&l&&zi.createPortal(f.jsxs(qd,{open:!0,placement:"top",children:[f.jsx(Yd,{asChild:!0,children:f.jsx("div",{className:ue("fixed z-[-1]",u&&"pointer-events-none"),style:{top:l.top,left:l.left,width:l.width,height:l.height}})}),f.jsx(Kd,{className:"max-w-[300px] rounded border border-ui-outline-primary bg-ui-popover px-3 py-1.5 text-center text-primary shadow-md fill-ui-popover",children:u})]}),document.body)})},hh=()=>{const[e,t]=g.useState(fp());return g.useEffect(()=>{const s=()=>t(fp());return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),e},nw=({onClose:e,onConfirm:t,onFolderPopupPathChange:s,setDestinationFolderPath:o,open:i,copyLabel:n="Copy",moveLabel:r="Move",addFolderLabel:a="Add folder",mode:l=rt.Copy,hiddenFilesSwitcherLabel:c="Show hidden files",onUploadFiles:d,onValidateUpload:u,maxFileSize:h,header:p,sourceFolder:m,disabledPathTooltip:C="Unavailable for the original path. Please select another folder",path:v,collapsedFileTree:w=!1,alertProps:b,...S})=>{const[x,y]=g.useState(!1),[F,R]=g.useState(!1),E=g.useRef(null),D=hh(),P=g.useCallback(A=>{y(A)},[]),T=g.useMemo(()=>[{key:"add-folder",label:a,icon:f.jsx(G.IconFolderPlus,{...Y,className:"text-secondary"}),onClick:()=>{E.current?.createFolder(),R(!1)}},{key:"show-hidden-files",label:c,icon:f.jsx(G.IconEye,{...Y,className:"text-secondary"}),onClick:()=>{y(A=>!A),R(!1)}}],[a,c]),M=g.useCallback(A=>{A&&(s?.(A),o?.(A))},[s,o]),k=l===rt.Copy?"Copy to":"Move to",N=g.useMemo(()=>!v||!m?!1:m===v,[v,m]);return f.jsx(Uo,{open:i,onClose:()=>{e()},size:Wt.Lg,dividerFooter:!0,dividers:!1,className:"md:!h-[800px] !bg-layer-2",footer:f.jsxs("div",{className:"flex justify-between items-center gap-2 py-4 px-4 md:px-6",children:[f.jsx("div",{className:"flex items-center gap-4 min-w-0",children:D?f.jsx(Ft,{menu:{items:T},open:F,onOpenChange:R,children:f.jsx(ss,{className:"h-9 w-9 shrink-0","aria-label":"More options",iconBefore:f.jsx(G.IconDotsVertical,{...Y,className:"text-secondary"})})}):f.jsxs(f.Fragment,{children:[f.jsx(bs,{label:a,appearance:Me.Ghost,iconBefore:f.jsx(G.IconFolderPlus,{...Y}),onClick:()=>{E.current?.createFolder()}}),f.jsx("div",{className:"w-px h-[26px] bg-controls-disable-accent my-2"}),f.jsx("div",{className:"inline-flex items-center cursor-pointer",children:f.jsx(oh,{label:c,isOn:x,onChange:P,switchId:"hidden-files-switch"})})]})}),f.jsxs("div",{className:"flex space-x-4 items-center",children:[f.jsx(ys,{onClick:e,label:"Cancel"}),N?f.jsx(yt,{tooltip:C,children:f.jsx(bs,{onClick:t,label:l==="copy"?n:r,disabled:N,"aria-disabled":N})}):f.jsx(bs,{onClick:t,label:l==="copy"?n:r})]})]}),header:p??k,children:f.jsxs("div",{className:"bg-layer-2 h-full flex flex-col",children:[b&&f.jsx("div",{className:"px-4 pt-4",children:f.jsx(Wp,{...b})}),f.jsx("div",{className:"flex-1 min-h-0",children:f.jsx(hw,{...S,gridClassName:"size-full",className:oe(S.className,"bg-layer-2 h-full flex pt-0"),actionsRef:E,path:v,showHiddenFiles:x,onShowHiddenFilesChange:P,treeOptions:{...S.treeOptions,collapsed:w,expandedPaths:new Set([S.rootItem?.path||"/"]),header:S.treeOptions?.header},gridOptions:{...S.gridOptions,selectionMode:void 0},navigationPanelOptions:{elementId:"file-manager-destination-search",...S.navigationPanelOptions},onUploadFiles:d,onValidateUpload:u,onPathChange:M,maxFileSize:h})})]})})},R7=12,F7=8;var So=(e=>(e.Normal="normal",e.Reverse="reverse",e))(So||{});function E7({actions:e,direction:t=So.Normal,moreButtonWidth:s=Nt,actionsGap:o=8,containerPadding:i=8,dependencies:n=[]}){const r=g.useRef(null),a=g.useRef(null),l=g.useRef(null),c=g.useRef(null),d=g.useRef([]),[u,h]=g.useState(e.length);g.useLayoutEffect(()=>{if(!a.current)return;const C=Array.from(a.current.children);d.current=C.map(v=>Math.ceil(v.getBoundingClientRect().width))},[e,...n]),g.useEffect(()=>{if(!r.current)return;let C=null;const v=()=>{C&&cancelAnimationFrame(C),C=requestAnimationFrame(()=>{const b=r.current,S=l.current?.offsetWidth??0,x=c.current?.offsetWidth??0,y=S+x,R=b.getBoundingClientRect().width-y-s-o*2-i*2,E=d.current;let D=0,P=0;if(t===So.Reverse)for(let T=E.length-1;T>=0&&(D+=E[T]+o,!(D>R));T--)P++;else for(const T of E){if(D+=T+o,D>R)break;P++}h(P)})},w=new ResizeObserver(v);return w.observe(r.current),v(),()=>{C&&cancelAnimationFrame(C),w.disconnect()}},[e.length,t,...n]);const p=t===So.Reverse?e.slice(0,e.length-u):e.slice(u);return{visibleActions:t===So.Reverse?e.slice(e.length-u):e.slice(0,u),hiddenActions:p,refs:{containerRef:r,measureRef:a,leftSectionRef:l,rightSectionRef:c}}}const D7=({getSelectionLabel:e,onClearSelection:t,actions:s,selectedCount:o})=>{const i=hh(),{refs:{containerRef:n,leftSectionRef:r,measureRef:a},visibleActions:l,hiddenActions:c}=E7({actions:s,direction:So.Reverse,dependencies:[i],actionsGap:R7,containerPadding:F7}),d=e(o);return f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:a,className:"absolute top-0 left-0 invisible pointer-events-none overflow-hidden whitespace-nowrap flex gap-3",children:s.map(({key:u,icon:h,title:p})=>f.jsx(ys,{iconBefore:h,label:p,hideTitleOnMobile:!0},u))}),f.jsxs("div",{ref:n,className:"rounded bg-layer-0 p-2 flex justify-between items-center w-full",role:"toolbar","aria-label":"File bulk actions",children:[f.jsx("div",{ref:r,children:f.jsx(bs,{label:d,onClick:t,textClassName:"text-accent-primary whitespace-nowrap",appearance:Me.Ghost,iconBefore:f.jsx(G.IconX,{...Y,className:"text-accent-primary"})})}),f.jsxs("div",{className:"flex flex-1 w-full gap-3 items-center justify-end",children:[c.length>0&&f.jsx(Ft,{menu:{items:c},allowedPlacements:["bottom","bottom-start"],children:f.jsx(ss,{className:"h-[38px]",iconBefore:f.jsx(G.IconDotsVertical,{...Y,className:"text-secondary hover:text-accent-primary"})})}),l.map(({key:u,icon:h,tooltip:p,title:m,onClick:C,disabled:v})=>f.jsx(ys,{className:"!p-[9px]",iconBefore:h,label:m,hideTitleOnMobile:!0,disabled:v,tooltipProps:{tooltip:p},onClick:w=>C?.({key:u,domEvent:w})},u))]})]})]})},P7=({open:e,itemsToDelete:t,onClose:s,onConfirm:o,cancelLabel:i="Cancel",confirmLabel:n="Delete",titleRenderer:r,contentRenderer:a})=>{const l=t.map(p=>p.name),d=r?.(l)||"Confirm Deleting Items",u=f.jsxs("div",{className:"px-6 py-3 dial-small",children:[f.jsx("p",{className:"text-secondary mb-3",children:t.length===1?f.jsxs(f.Fragment,{children:["Do you want to delete file or folder"," ",f.jsxs("span",{className:"text-primary break-all",children:['"',t[0].name,'"']}),"?"]}):f.jsxs(f.Fragment,{children:["Do you want to delete the following"," ",f.jsx("span",{className:"text-primary",children:t.length})," items?"]})}),t.length>1&&f.jsx(f.Fragment,{children:t.length<=10?f.jsx("ul",{className:"space-y-1 text-primary list-none",children:t.map(p=>f.jsx("li",{className:"truncate",children:p.name},p.path))}):f.jsxs(f.Fragment,{children:[f.jsx("ul",{className:"space-y-1 text-primary list-none mb-2",children:t.slice(0,10).map(p=>f.jsx("li",{className:"truncate",children:p.name},p.path))}),f.jsxs("p",{className:"text-secondary italic",children:["... and ",t.length-10," more"]})]})})]}),h=a?.(l)||u;return f.jsx(Ov,{open:e,header:d,confirmLabel:n,cancelLabel:i,variant:Vi.Danger,onClose:s,onConfirm:o,children:h})},Pp=e=>e.split("/").map(t=>t.trim()).filter(Boolean),T7="w-full flex items-center justify-between gap-4",M7="min-w-0 h-[38px] flex-1 overflow-hidden bg-layer-3 px-3 flex items-center rounded",I7="w-[260px]",k7=({ariaLabel:e="Breadcrumb",labelClassName:t,onItemClick:s,path:o,makeHref:i,rootItemPath:n,rootItemLabel:r,breadcrumbsHiddenPathPart:a,className:l,breadcrumbClassName:c,searchable:d=!0,value:u,elementId:h="file-manager-search",disabled:p,invalid:m,onSearchChange:C,searchClassName:v,searchContainerClassName:w,isCompactView:b=!1})=>{const S=g.useMemo(()=>{if(!o)return;let D=Pp(o);const P=[...D];let T=0;if(a){const k=Pp(a);if(k.length){const N=D.findIndex((A,W)=>k.every((U,L)=>D[W+L]===U));N!==-1&&(T=k.length,D=[...D.slice(0,N),...D.slice(N+k.length)])}}if(!D.length)return[{label:"/"}];const M=D.map((k,N)=>{const A=N<D.length-T?N:N+T,W=P.slice(0,A+1),U=typeof i=="function"?i(W,A):void 0;return{label:k,href:U,onClick:s?L=>{L.preventDefault(),s(U)}:void 0}});if(n&&r){const k=n.split("/").filter(Boolean),N=o.split("/").filter(Boolean);if(k.every((W,U)=>N[U]===W)&&M.length>0){const W=M.slice(k.length);return[{label:r,href:n,onClick:s?U=>{U.preventDefault(),s(n)}:void 0},...W]}}return M},[o,a,n,r,i,s]),[x,y]=g.useState(!1),F=g.useCallback(()=>{if(b&&!x){y(!0);const D=document.getElementById(h);D&&D.focus()}},[h,x,b]),R=g.useCallback(()=>{(!u||String(u).trim()==="")&&C?.("")},[u,C]),E=g.useCallback(()=>b&&x?f.jsx(ys,{className:"!p-[9px]",iconBefore:f.jsx(G.IconArrowLeft,{...Y}),onClick:()=>{y(!1),C?.("")}}):f.jsx("div",{className:M7,children:f.jsx(Mv,{pathItems:S,ariaLabel:e,labelClassName:t,className:c})}),[e,c,S,x,b,t,C]);return f.jsxs("div",{className:oe(T7,{"gap-3":b},l),"aria-label":"navigation-panel",children:[E(),d&&f.jsx("div",{className:oe(I7,{"w-[40px]":b&&!x,"w-full":b&&x}),role:"search","aria-label":"Search",onClick:F,children:f.jsx(ih,{id:h,value:u??"",onChange:C,disabled:p,onBlur:R,invalid:m,className:v,wrapperClassName:b&&!x?"pl-2.5":"",containerClassName:w})})]})},A7=({tabs:e,activeTab:t,onTabChange:s,areHiddenFilesVisible:o,onToggleHiddenFiles:i,isNewButtonVisible:n,isNewButtonDisabled:r,newButtonVariant:a=Ge.Primary,newButtonDropdownItems:l=[],newButtonLabel:c="New",hiddenFilesSwitcherLabel:d="Hidden files",showHiddenFilesLabel:u="Show hidden files",hideHiddenFilesLabel:h="Hide hidden files",showHiddenFilesToggle:p=!0,disabledNewButtonTooltip:m})=>{const C=hh(),v=g.useMemo(()=>[{key:"hidden-files-switch",label:o?h:u,icon:o?f.jsx(G.IconEyeOff,{...Y,className:"text-secondary"}):f.jsx(G.IconEye,{...Y,className:"text-secondary"}),onClick:()=>i?.(!o)}],[o,h,u,i]),w=()=>e&&t&&s?f.jsx(Ev,{tabs:e,activeTab:t,onClick:x=>s(x),screenThreshold:Qa.Tablet,smallScreenContainerClassName:"w-fit bg-transparent h-[38px] overflow-hidden",smallScreenDropdownItemClassName:"px-3 h-[38px]"}):null,b=()=>f.jsxs(f.Fragment,{children:[p&&f.jsxs(f.Fragment,{children:[f.jsx(oh,{switchId:"hidden-files-switch",label:d,isOn:o,onChange:i}),f.jsx("div",{className:"h-6 border-l border-primary"})]}),n&&f.jsx(yt,{tooltip:r&&m?m:void 0,children:f.jsx(Ud,{label:c,variant:a,items:l,disabled:r})})]}),S=()=>f.jsxs(f.Fragment,{children:[f.jsx(Ft,{menu:{items:v},allowedPlacements:["bottom","bottom-start"],children:f.jsx(ss,{className:"h-[38px]",iconBefore:f.jsx(G.IconDotsVertical,{...Y,className:"text-secondary hover:text-accent-primary"})})}),n?f.jsx(yt,{tooltip:r&&m?m:void 0,children:f.jsx(Ud,{label:c,variant:a,items:l,disabled:r})}):null]});return f.jsxs("div",{className:"flex w-full justify-between gap-4 items-center overflow-x-auto",children:[f.jsx("div",{className:"flex-1 min-w-0",children:w()}),f.jsx("div",{className:"flex gap-4 flex-shrink-0 items-center",children:C?S():b()})]})},L7=100,xn=16,hs="text-secondary",aa="text-primary min-w-0",O7="text-primary break-words min-w-0",Rn="bg-layer-2",N7=({open:e,onClose:t,fileMetadata:s,loading:o=!1,header:i="Information",nameLabel:n="Name:",pathLabel:r="Path:",modifiedDateLabel:a="Modified Date:",sizeLabel:l="Size:",authorLabel:c="Author:",dateLocale:d="en-US",dateOptions:u})=>f.jsx(Uo,{open:e,onClose:t,size:Wt.Sm,header:i,dividers:!1,children:f.jsx("div",{className:"px-6 py-4",children:f.jsx("div",{className:"grid gap-x-4 gap-y-4 items-center dial-small",style:{gridTemplateColumns:`${L7}px 1fr`},children:o?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:hs,children:n}),f.jsx(pi,{variant:Xt.Text,width:"100%",height:xn,className:Rn}),f.jsx("div",{className:hs,children:a}),f.jsx(pi,{variant:Xt.Text,width:"90%",height:xn,className:Rn}),f.jsx("div",{className:hs,children:l}),f.jsx(pi,{variant:Xt.Text,width:"60%",height:xn,className:Rn}),f.jsx("div",{className:hs,children:c}),f.jsx(pi,{variant:Xt.Text,width:"80%",height:xn,className:Rn}),f.jsx("div",{className:hs,children:r}),f.jsx(pi,{variant:Xt.Text,width:"70%",height:xn,className:Rn})]}):s?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:hs,children:n}),f.jsx("div",{className:aa,children:f.jsx(ht,{text:s.name})}),f.jsx("div",{className:hs,children:a}),f.jsx("div",{className:aa,children:f.jsx(ht,{text:XL(s.updatedAt,d,u)})}),f.jsx("div",{className:hs,children:l}),f.jsx("div",{className:aa,children:f.jsx(ht,{text:or(s.contentLength)})}),f.jsx("div",{className:hs,children:c}),f.jsx("div",{className:aa,children:f.jsx(ht,{text:s.author||"—"})}),f.jsx("div",{className:hs,children:r}),f.jsx("div",{className:O7,children:decodeURIComponent(s.path)})]}):null})})}),H7={size:10,stroke:2},G7=26;var _t=(e=>(e.File="file",e.Folder="folder",e))(_t||{});const B7=({name:e,type:t,shared:s=!1,loading:o=!1,sharedIndicatorClassName:i,sharedIndicatorTooltip:n,fileExtension:r,...a})=>{const l=c=>f.jsxs("span",{className:"inline-flex relative text-secondary",role:"img",children:[c,s&&f.jsx("span",{className:"absolute -bottom-0.5 -left-0.5",children:f.jsx(Wn,{className:i,sharedIndicatorTooltip:n})})]});if(o)return l(f.jsx(nr,{}));if(t===_t.File){const c=r||(e.includes(".")?e.split(".").pop():void 0);return f.jsx(iu,{...a,extension:c??"",className:"text-secondary",indicator:s?f.jsx(Wn,{className:i,sharedIndicatorTooltip:n}):null,label:"File type icon"})}return t===_t.Folder?l(f.jsx($e,{icon:f.jsx(G.IconFolder,{className:a.className,size:a.size??Y.size,stroke:a.stroke??Y.stroke}),className:"inline-block align-middle"})):null},V7=({name:e,type:t,elementId:s,loading:o=!1,shared:i=!1,iconClassName:n,iconIndicator:r,iconLabel:a,iconSize:l,iconStroke:c,inputInvalid:d,inputInvalidMessage:u,inputContainerClassName:h,inputIconAfter:p,inputRef:m,onChange:C,sharedIndicatorClassName:v,sharedIndicatorTooltip:w,fileExtension:b})=>{const S=()=>{const x=u?.startsWith(`${is.Warning}__`);if(!d&&!x)return null;const y=u?.replace(`${is.Warning}__`,"");return f.jsx(yt,{tooltip:y,children:p||(x?f.jsx(G.IconAlertTriangleFilled,{...Y,className:"text-warning-icon","aria-label":"warning"}):f.jsx(G.IconAlertCircleFilled,{...Y,className:"text-error","aria-label":"alert"}))})};return f.jsxs("div",{className:"flex gap-2 items-center",children:[f.jsx(B7,{name:e,type:t,label:a,className:n,indicator:r,size:l,stroke:c,loading:o,shared:i,fileExtension:b,sharedIndicatorClassName:v,sharedIndicatorTooltip:w}),f.jsx(Zi,{containerClassName:oe("!h-6 py-[1px] pl-[7px] pr-[7px]",h),id:s,value:e,onChange:C,invalid:d,iconAfter:S(),inputRef:m})]})};function rw({value:e,isEditing:t,restoreOnCancel:s=!0,onValidate:o,onSave:i,onCancel:n}){const[r,a]=g.useState(e),[l,c]=g.useState(!1),[d,u]=g.useState(""),h=g.useRef(null),p=g.useCallback((b=!1,S="")=>{c(b),u(S)},[]),m=g.useCallback(b=>{if(!o)return p(),!0;const S=o(b);return S?S.startsWith(`${is.Warning}__`)?(p(!1,S),!0):(p(!0,S),!1):(p(),!0)},[o,p]),C=g.useCallback(b=>{const S=b??"";a(S),m(S)},[m]),v=g.useCallback(()=>{m(r)?i?.(r):h.current?.focus()},[m,i,r]),w=g.useCallback(()=>{s&&a(e),p(),n?.()},[e,n,s,p]);return g.useEffect(()=>{t&&(a(e),p(),requestAnimationFrame(()=>{h.current?.focus(),h.current?.select()}))},[t,e,p]),g.useEffect(()=>{const b=h.current;if(!t||!b)return;const S=x=>{x.key==="Enter"?(x.preventDefault(),h.current?.blur()):x.key==="Escape"&&(x.preventDefault(),w())};return b.addEventListener("keydown",S),()=>b.removeEventListener("keydown",S)},[t,v,w]),g.useEffect(()=>{if(!t)return;const b=h.current;if(!b)return;const S=x=>{const y=x.relatedTarget;y&&b.contains(y)||(m(r)?v():b.focus())};return b.addEventListener("blur",S),()=>{b.removeEventListener("blur",S)}},[t,r,m,v]),{inputRef:h,value:r,onChange:C,invalid:l,invalidMessage:d}}const tl=({name:e,type:t,elementId:s,editing:o=!1,loading:i=!1,shared:n=!1,iconSize:r=Nt,validate:a,onSave:l,fileExtension:c,onCancel:d,inputContainerClassName:u,sharedIndicatorClassName:h,sharedIndicatorTooltip:p,hideTooltip:m=!1,forbiddenSymbolsRegExp:C,forbiddenSymbolsTooltip:v,...w})=>{const{value:b,invalid:S,invalidMessage:x,onChange:y,inputRef:F}=rw({value:e,isEditing:o,onValidate:a,onCancel:d,onSave:l});if(!o){const R=dh({name:e,isFolder:t===_t.Folder},C,v),E=!!R;return t===_t.Folder?f.jsx(cl,{name:e,loading:i,shared:n,iconSize:r,className:"max-w-[428px] truncate",sharedIndicatorClassName:h,hideTooltip:m,isInvalidName:E,tooltipContent:R}):f.jsx(ll,{className:"max-w-[428px]",...w,name:e,shared:n,iconSize:r,sharedIndicatorClassName:h,hideTooltip:m,isInvalidName:E,tooltipContent:R})}return f.jsx(V7,{type:t,name:b,elementId:s,inputInvalid:S,inputInvalidMessage:x,inputRef:F,onChange:y,iconSize:r,fileExtension:c,inputContainerClassName:u,sharedIndicatorTooltip:p,sharedIndicatorClassName:h})},z7=({items:e,showFiles:t=!1,expandedPaths:s,loadingPaths:o=new Set,loadedPaths:i=new Set,sharedByMePaths:n=new Set,selectedPath:r,emptyStateTitle:a="No Folders",emptyStateDescription:l,emptyStateIcon:c,areHiddenFilesVisible:d=!1,renamedPath:u,rootItemLabel:h,rootItemPath:p,onItemClick:m,getContextMenuItems:C,onRenameSave:v,onRenameCancel:w,onRenameValidate:b,onExpandedPathsChange:S,forbiddenSymbolsRegExp:x,forbiddenSymbolsTooltip:y})=>{const{expandedPaths:F,togglePath:R}=tw({expandedPaths:s??new Set,onExpandedPathsChange:S}),E=P=>{m?.(P),R(P.path)},D=(P,T)=>P.map(M=>{const{path:k,nodeType:N,name:A,items:W}=M,U=N===be.FOLDER;if(!d&&Zv(M))return null;if(!U&&!t)return;const L=Array.isArray(W)&&W.length>0&&W.some($=>$.nodeType===be.FOLDER||t),de=F.has(k),H=r===k,te=o.has(k),Q=u===k,J=i.has(k),me=n.has(k),Re=p&&h&&k===p&&U,ne=b&&($=>b($,M)),_=H?"bg-accent-primary-alpha border-l-2 border-l-accent-primary rounded":"border-l-2 border-l-transparent",Fe=Re?[]:C?.(M)??[],ie=x?dh({name:M.name,isFolder:U},x,y):void 0;return f.jsx("div",{className:"cursor-pointer text-secondary",children:f.jsxs("div",{className:"flex flex-col w-full","aria-label":"folder",children:[f.jsx(Ft,{trigger:[Ht.ContextMenu],className:"w-full",anchorToMouse:!0,menu:{items:Fe},children:f.jsxs("div",{style:{paddingLeft:`${T*G7}px`},className:oe("py-1 gap-[2px] dial-small flex justify-between hover:bg-accent-primary-alpha rounded group/item w-full mb-[2px] relative",_),"aria-selected":H,children:[!Q&&f.jsx("div",{className:"absolute size-full left-0 top-0 z-0",onClick:()=>E(M)}),f.jsx("div",{className:"relative flex flex-row truncate items-center w-fit h-6 gap-x-1 pl-1",onClick:()=>!Q&&E(M),children:f.jsxs(f.Fragment,{children:[U&&f.jsx(G.IconCaretRightFilled,{...H7,className:ue("flex-shrink-0",de&&"rotate-90 transition-all",J&&!L&&"text-transparent")}),f.jsx(tl,{elementId:`${k}-tree-item`,name:Re?h:A,type:U?_t.Folder:_t.File,loading:te,shared:me,sharedIndicatorClassName:oe("group-hover/item:bg-accent-primary-alpha",H&&"bg-accent-primary-alpha"),iconSize:Js,forbiddenSymbolsRegExp:x,forbiddenSymbolsTooltip:ie,...!Re&&{editing:Q,onSave:v,onCancel:w,validate:ne}})]})}),Fe.length>0&&!Q&&!Re&&f.jsx("div",{className:"flex-1 flex justify-end",children:f.jsx(Ft,{placement:"bottom-start",allowedPlacements:["top-start","top-end"],menu:{items:Fe},className:"sticky right-0",children:f.jsx($e,{className:"invisible group-hover/item:visible text-secondary mx-2 flex flex-row gap-2 hover:text-accent-primary",icon:f.jsx(G.IconDotsVertical,{...Y})})})})]})}),de&&W&&D(W,T+1)]})},`${k}-children`)});return f.jsx("div",{className:"flex-1 w-full h-full overflow-y-auto","aria-label":"folders-tree",children:e.length>0?D(e,0):f.jsx(rr,{title:a,description:l,icon:c})})},W7=({selectedFiles:e,actionLabels:t,onDuplicate:s,onCopy:o,onMove:i,onDownload:n,onUnshare:r,onRemoveAccess:a,onDelete:l,getCurrentFolderPath:c,sharedWithMeIds:d,sharedByMePaths:u,onClearSelection:h,forbiddenSymbolsRegExp:p})=>g.useMemo(()=>{const m=[],C=Array.from(e.values());if(!C.length||!t)return m;const v=Sl(p),w=v?C.some(b=>v.test(b.name)):!1;if(t[K.Move]&&!w&&m.push({key:K.Move,label:t[K.Move],title:t[K.Move],icon:f.jsx(ah,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>i(C)}),t[K.Copy]&&!w&&m.push({key:K.Copy,label:t[K.Copy],title:t[K.Copy],icon:f.jsx(rh,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>o(C)}),t[K.Duplicate]&&!w&&m.push({key:K.Duplicate,label:t[K.Duplicate],title:t[K.Duplicate],icon:f.jsx(G.IconCopy,{...Y,className:"text-secondary"}),onClick:()=>s(C)}),t[K.Delete]){const b=C.some(S=>S.permissions&&!S.permissions.includes($o.WRITE));m.push({key:K.Delete,label:t[K.Delete],title:t[K.Delete],icon:f.jsx(G.IconTrashX,{...Y,className:"text-secondary"}),disabled:b,tooltip:b?"Selected items contain item which can not be deleted":void 0,onClick:()=>{const S=c();l(C,S)}})}if(t[K.Download]&&!w&&m.push({key:K.Download,label:t[K.Download],title:t[K.Download],icon:f.jsx(G.IconDownload,{...Y,className:"text-secondary"}),onClick:()=>n(C)}),t[K.Unshare]&&r){const b=C.some(S=>!d?.includes(S.path));m.push({key:K.Unshare,label:t[K.Unshare],title:t[K.Unshare],disabled:b,icon:f.jsx(lh,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>{r(C),h()}})}if(t[K.RemoveAccess]&&a){const b=C.some(S=>!u?.has(S.path));m.push({key:K.RemoveAccess,label:t[K.RemoveAccess],title:t[K.RemoveAccess],disabled:b,icon:f.jsx(G.IconUserX,{size:Y.size,className:"text-secondary"}),onClick:()=>{a(C),h()}})}return m},[e,t,r,a,i,o,s,c,l,n,d,h,u,p]);function gh(e){if(!e)return null;if(e instanceof Date)return isFinite(e.getTime())?e:null;if(typeof e=="number"){const t=new Date(e);return isFinite(t.getTime())?t:null}if(typeof e=="string"){const t=e.trim();if(/^-?\d+$/.test(t)){const o=Number(t);return gh(o)}const s=new Date(t);return isFinite(s.getTime())?s:null}return null}const aw=({value:e,locale:t=xv,options:s=Rv,emptyPlaceholder:o,className:i,hideTooltip:n=!1})=>{const r=gh(e),a=g.useMemo(()=>r?new Intl.DateTimeFormat(t,s).format(r):o,[r,o,t,s]),l=r?r.toISOString():void 0;return f.jsx(ht,{text:l?f.jsx("time",{dateTime:l,children:a}):f.jsx("span",{children:a}),className:ue(h8,i),hideTooltip:n})},_7=({id:e,name:t,nodeType:s,size:o,updatedAt:i,dateLocale:n,dateOptions:r,shared:a,sharedIndicatorClassName:l,hideTooltip:c=!1,forbiddenSymbolsRegExp:d,forbiddenSymbolsTooltip:u})=>f.jsx("div",{className:"flex",children:f.jsx("div",{className:"flex flex-1 min-w-0",children:f.jsx(tl,{type:s===be.FOLDER?_t.Folder:_t.File,name:t,elementId:e,shared:a,iconSize:Js,sharedIndicatorClassName:l,hideTooltip:c,forbiddenSymbolsRegExp:d,forbiddenSymbolsTooltip:u,details:f.jsxs("div",{className:"flex items-center gap-1 dial-tiny text-secondary",children:[f.jsx("span",{children:s===be.ITEM?or(o):""}),i&&o&&f.jsx(G.IconCircleFilled,{size:2,className:"text-secondary"}),i?f.jsx("span",{children:f.jsx(aw,{value:i,locale:n?.toString(),options:r,className:"dial-tiny text-secondary",hideTooltip:c})}):null]})})})}),lw=e=>(t,s,o)=>({colId:at.Name,field:"name",headerName:e,flex:1,minWidth:200,cellRenderer:i=>{const n=i.data.nodeType,{saveFolderCreation:r,validateFolderName:a,cancelFolderCreation:l,newFolderTempId:c,sharedByMePaths:d,selectedPaths:u,disabledRowIds:h}=i.context,p=d?.has(i.data.path),m=u?.has(i.data.path),C=h?.has(i.data.path)??!1,v=oe(["group-hover/grid-row:bg-accent-primary-alpha",m&&"bg-accent-primary-alpha"]);if(i.data?.isTemporary&&i.data.id===c)return f.jsx(tl,{name:"",type:_t.Folder,elementId:`new-folder-${i.data.id}`,editing:!0,shared:p,sharedIndicatorClassName:v,iconSize:Js,validate:a,onSave:r,onCancel:l,inputContainerClassName:oe(["!h-9",o&&n===be.ITEM&&"!h-10"])});const{renameTriggerView:w,renamedPath:b,renamedItem:S,getDisplayName:x,onRenameValidate:y,onRenameSave:F,onRenameCancel:R}=i.context;if(w===Ii.Grid&&b===i.data?.path&&S&&i.data){const P=x(S);return f.jsx(tl,{name:P,type:n===be.FOLDER?_t.Folder:_t.File,fileExtension:S.name.split(".").pop(),elementId:`rename-${i.data.id}`,editing:!0,shared:p,sharedIndicatorClassName:v,iconSize:Js,validate:T=>y(T,S),onSave:F,onCancel:R,inputContainerClassName:oe(["!h-9",o&&n===be.ITEM&&"!h-10"]),forbiddenSymbolsRegExp:i.context.forbiddenSymbolsRegExp})}if(o)return f.jsx(_7,{id:i.data.id,name:i.data.name,nodeType:n,size:i.data.size,shared:p,sharedIndicatorClassName:v,updatedAt:i.data.updatedAt,dateLocale:t,dateOptions:s,hideTooltip:C,forbiddenSymbolsRegExp:i.context.forbiddenSymbolsRegExp,forbiddenSymbolsTooltip:i.context.forbiddenSymbolsTooltip});const D=dh({name:i.data.name,isFolder:n===be.FOLDER},i.context.forbiddenSymbolsRegExp,i.context.forbiddenSymbolsTooltip);return n===be.FOLDER?f.jsx(cl,{name:i.data.name,shared:p,sharedIndicatorClassName:v,iconSize:Js,hideTooltip:C,isInvalidName:!!D,tooltipContent:D}):f.jsx(ll,{name:i.data.name,shared:p,sharedIndicatorClassName:v,iconSize:Js,hideTooltip:C,isInvalidName:!!D,tooltipContent:D})}}),cw=e=>(t,s)=>({colId:at.UpdatedAt,field:"updatedAt",headerName:e,width:168,suppressSizeToFit:!0,cellRenderer:o=>{const i=o.context?.disabledRowIds?.has(o.data?.path)??!1;return f.jsx(aw,{...o,hideTooltip:i})},cellRendererParams:{locale:t,options:s},filterValueGetter:o=>{const i=o.data[o.colDef.field||""],n=gh(i);return n?new Intl.DateTimeFormat(t||xv,s||Rv).format(n):""}}),dw=e=>({colId:at.Size,field:"size",headerName:e,width:120,suppressSizeToFit:!0,cellRenderer:t=>t.data.nodeType===be.ITEM?or(t.data.contentLength):"",filterValueGetter:t=>t.data.nodeType===be.ITEM?or(t.data.contentLength):""}),j7=e=>{const t=e.event;if(!(t?.target??null)?.closest("input")||!t)return!1;switch(t.key){case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":case"Home":case"End":return!0;default:return!1}};function U7({userColumnDefs:e,filterable:t,dateLocale:s,dateOptions:o,effectiveVisibleColumns:i,isCompactView:n,hasActions:r,actionsColumnDef:a,rootItemLabel:l,rootItemPath:c}){const d=g.useMemo(()=>[lw("Name")(s,o,n),{colId:at.Path,field:"path",headerName:"Path",flex:1,minWidth:200,cellRenderer:h=>{const p=h.context?.disabledRowIds?.has(h.data.path)??!1;let m=h.data.path;if(h.context?.hideSearchPathItemName&&(h.data.parentPath?m=h.data.parentPath:m=m.replace(/\/[^/]+\/?$/,"")||"/"),!c||!l)return f.jsx(ht,{text:m,hideTooltip:p});const C=m.replace(c,l);return f.jsx(ht,{text:C,hideTooltip:p})}},cw("Modified Date")(s,o),dw("Size"),{colId:at.Author,field:"author",headerName:"Author",width:200,suppressSizeToFit:!0,cellRenderer:h=>h.data.author},{colId:at.Owner,field:"owner",headerName:"Owner",width:200,suppressSizeToFit:!0,cellRenderer:h=>h.data.owner}],[s,o,n,l,c]);return{columnDefs:g.useMemo(()=>{const h=e?.map(C=>typeof C=="function"?C(s,o,n):C);let p=h??d;h||(p=p.filter(C=>C.colId&&i.includes(C.colId))),r&&(n&&(p=p.slice(0,1)),p.push(a));const m=C=>C.colId===at.Name;return p.map(C=>{const v={...C,filter:t?C.filter:!1,floatingFilter:t?C.floatingFilter:!1};return m(C)&&!C.suppressKeyboardEvent&&(v.suppressKeyboardEvent=j7),v})},[a,s,o,d,i,t,r,n,e])}}const uw=()=>{const e=g.useContext(Jv);if(!e)throw new Error("useFileManagerContext must be used within <FileManagerProvider>");return e},$7=({actionLabels:e,onDuplicate:t,onCopy:s,onMove:o,onDownload:i,onRename:n,onDelete:r,onInfo:a,onUnshare:l,onRemoveAccess:c,sharedWithMeIds:d,sharedByMePaths:u,onAddSibling:h,onAddChild:p,onManagePermissions:m,onPreview:C,onOpenInNewTab:v,previewExtensions:w,isRenameFileAvailable:b=!0,isDuplicateFolderAvailable:S=!0,forbiddenSymbolsRegExp:x})=>g.useMemo(()=>y=>{const F=[];if(!e)return F;const R=Sl(x)?.test(y.name);e[K.AddSibling]&&typeof h=="function"&&y.nodeType===be.FOLDER&&F.push({key:"addSibling",label:e[K.AddSibling],icon:f.jsx(Yv,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>h(y)}),e[K.AddChild]&&typeof p=="function"&&y.nodeType===be.FOLDER&&!R&&F.push({key:"addChild",label:e[K.AddChild],icon:f.jsx(Kv,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>p(y)},{key:"divider",type:Bi.Divider});const E=y.nodeType===be.ITEM||y.nodeType===be.FOLDER&&S;e[K.Duplicate]&&E&&!R&&F.push({key:K.Duplicate,label:e[K.Duplicate],icon:f.jsx(G.IconCopy,{...Y,className:"text-secondary"}),onClick:()=>t(y)}),e[K.Copy]&&!R&&F.push({key:K.Copy,label:e[K.Copy],icon:f.jsx(rh,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>s(y)}),e[K.Move]&&!R&&F.push({key:K.Move,label:e[K.Move],icon:f.jsx(ah,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>o(y)}),e[K.Download]&&!R&&F.push({key:K.Download,label:e[K.Download],icon:f.jsx(G.IconDownload,{...Y,className:"text-secondary"}),onClick:()=>i(y)}),e[K.ManagePermissions]&&typeof m=="function"&&y.nodeType===be.FOLDER&&!R&&F.push({key:K.ManagePermissions,label:e[K.ManagePermissions],icon:f.jsx(G.IconExternalLink,{...Y,className:"text-secondary"}),onClick:()=>m?.(y.path)});const D=y.name.split("."),P=D.length>1?D[D.length-1]:"",T=P&&w?.includes(`.${P}`);e[K.Preview]&&typeof C=="function"&&y.nodeType===be.ITEM&&T&&!R&&F.push({key:K.Preview,label:e[K.Preview],icon:f.jsx(G.IconEye,{...Y,className:"text-secondary"}),onClick:()=>C?.(y.path)}),e[K.OpenInNewTab]&&typeof v=="function"&&y.nodeType===be.ITEM&&!R&&F.push({key:K.OpenInNewTab,label:e[K.OpenInNewTab],icon:f.jsx(G.IconExternalLink,{...Y,className:"text-secondary"}),onClick:()=>v?.(y)});const M=!y.permissions||y.permissions.includes($o.WRITE);e[K.Delete]&&M&&F.push({key:K.Delete,label:e[K.Delete],icon:f.jsx(G.IconTrashX,{...Y,className:"text-secondary"}),onClick:()=>r(y,y.parentPath??"")});const k=y.nodeType===be.FOLDER||y.nodeType===be.ITEM&&b;return e[K.Rename]&&k&&F.push({key:K.Rename,label:e[K.Rename],icon:f.jsx(G.IconPencilMinus,{...Y,className:"text-secondary"}),onClick:()=>n(y.path)}),e[K.Info]&&y.nodeType===be.ITEM&&!R&&F.push({key:K.Info,label:e[K.Info],icon:f.jsx(G.IconInfoCircle,{...Y,className:"text-secondary"}),onClick:()=>a(y)}),e[K.Unshare]&&d?.includes(y.path)&&F.push({key:K.Unshare,label:e[K.Unshare],icon:f.jsx(lh,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>l(y)}),e[K.RemoveAccess]&&u?.has(y.path)&&c&&F.push({key:K.RemoveAccess,label:e[K.RemoveAccess],icon:f.jsx(G.IconUserX,{size:Y.size,className:"text-secondary"}),onClick:()=>c(y)}),F},[e,h,p,t,s,o,i,r,n,a,l,c,d,u,m,C,v,w,b,S,x]),hw=e=>f.jsx(iw,{...e,children:f.jsx(q7,{})}),q7=()=>{const{managerLabel:e,className:t,items:s,rootItem:o,filesLoading:i,treeOptions:n,showNavigationPanel:r,navigationPanelOptions:a,gridOptions:l,toolbarOptions:c,bulkActionsToolbarOptions:d,deleteConfirmationOptions:u,destinationFolderPopupOptions:h,conflictResolutionPopupOptions:p,compactViewWidthBreakpoint:m=jL,customBreakpointRef:C,sharedByMePaths:v,allowedFileTypes:w,maxSelectableFileSize:b,areHiddenFilesVisible:S,toggleHiddenFilesVisibility:x,isTreeCollapsed:y,toggleTreeCollapse:F,currentPath:R,gridRows:E,selectedPaths:D,selectedFiles:P,clearSelection:T,setSelectedPaths:M,effectiveSearchValue:k,handleBreadcrumbItemClick:N,handleSearchChange:A,handleTreeItemClick:W,handleTableRowClick:U,handleSelectionClick:L,onGridApiChange:de,handleOpenDestinationFolderPopup:H,handleCloseDestinationFolderPopup:te,openDestinationFolderPopup:Q,destinationFolderMode:J,handleSetCopiedFiles:me,handleSetMovedFiles:Re,handleDuplicate:ne,handleCopyTo:_,handleMoveTo:Fe,handleAddSibling:ie,handleAddChild:$,handleDownloadFiles:q,openDeleteConfirmation:se,closeDeleteConfirmation:B,confirmDelete:pe,deleteConfirmationOpen:le,itemsToDelete:re,renamedPath:Ce,renamedItem:xe,onRename:Le,onRenameSave:fe,onRenameCancel:De,onRenameValidate:ze,forbiddenSymbolsRegExp:Ne,forbiddenSymbolsTooltip:Ve,getDisplayName:kt,isDragging:Et,isDraggingOverWindow:Ut,handleDragEnter:V,handleDragLeave:Ee,handleDragOver:At,handleDrop:Xi,onUploadFiles:yl,onValidateUpload:xl,maxFileSize:Rl,newActions:uo,isNewButtonVisible:Qi,isNewButtonDisabled:qo,newFolderTempId:fr,cancelFolderCreation:Ko,saveFolderCreation:mr,validateFolderName:Cr,startFolderCreation:vr,conflictingFiles:Fl,conflictResolutionOpen:Ji,handleConflictReplace:Rs,handleConflictDuplicate:El,handleConflictCancel:Dl,handleConflictDecideForEach:ot,uploadConflictingFiles:Pl,uploadConflictResolutionOpen:Fs,handleUploadConflictReplace:en,handleUploadConflictDuplicate:tn,handleUploadConflictCancel:sn,handleUploadConflictDecideForEach:Tl,openMetadataPopup:Ml,fileMetadataPopupOptions:ds,isMetadataPopupOpen:on,selectedFileForMetadata:Yo,closeMetadataPopup:Il,onUnshareFiles:Zo,onRemoveFilesAccess:Xo,actionsRef:kl,searchInProgress:wr,isSearchMode:Qo,emptyStateIcon:br,emptyStateTitle:Sr="You don't have any files",emptyStateDescription:yr="Upload or drag and drop files",sharedWithMeIds:Jo,onFolderPopupPathChange:Al,onManagePermissions:zs,onPreview:Ll,onOpenInNewTab:nn,previewExtensions:Ol,isRenameFileAvailable:Nl,isDuplicateFolderAvailable:Dt,getDisabledTooltip:xr,fileTooLargeTooltip:et,unsupportedFileTypeTooltip:Rr,gridClassName:Hl,nonClickableTableColumns:rn,hideSearchPathItemName:Fr}=uw(),{width:Gl=GL,header:ei=BL,containerClassName:Er=OL,additionalButtons:Dr,...Pr}=n??{},[ti,Tr]=g.useState(Gl),{renameTriggerView:si,onGridRename:Bl,onTreeRename:Mr}=qL({onRename:Le}),an=g.useRef(null),Vl=j=>{an.current===null&&(an.current=requestAnimationFrame(()=>{Tr(j),an.current=null}))},{columnDefs:zl,filterable:Wl=!0,dateLocale:_l,dateOptions:jl,selectionMode:Ir,wrapCustomCellRenderers:kr,visibleColumns:Ar=UL,allowDisabledContextMenu:oi=!1,...Ws}=l??{},{containerRef:Ul,isBelowBreakpoint:vt}=KL(m,C),$l=g.useMemo(()=>Qo?[at.Name,at.Path,at.Actions]:Ar,[Qo,Ar]),ln=g.useCallback((j,We,Ke)=>JL(j,We,Ke,Rr,et),[et,Rr]),ii=g.useCallback((j,We,Ke)=>!!ln(j,We,Ke),[ln]),_s=g.useMemo(()=>{const j=new Set;for(const We of E)ii(We,w,b)&&j.add(We.path);return j},[w,b,E,ii]),Lr=g.useCallback(j=>{const We=[],Ke=[],$t=!j.parentPath,ho=Ne?.test(j.name);return n?.actionLabels&&(n.actionLabels[K.AddSibling]&&typeof ie=="function"&&j.nodeType===be.FOLDER&&!$t&&We.push({key:"addSibling",label:n.actionLabels[K.AddSibling],icon:f.jsx(Yv,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>ie([j])}),n.actionLabels[K.AddChild]&&typeof $=="function"&&j.nodeType===be.FOLDER&&!ho&&We.push({key:"addChild",label:n.actionLabels[K.AddChild],icon:f.jsx(Kv,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>$([j])}),n.actionLabels[K.Duplicate]&&!$t&&!ho&&Ke.push({key:"duplicate",label:n.actionLabels[K.Duplicate],icon:f.jsx(G.IconCopy,{...Y,className:"text-secondary"}),onClick:()=>ne([j])}),n.actionLabels[K.Copy]&&!$t&&!ho&&Ke.push({key:rt.Copy,label:n.actionLabels[K.Copy],icon:f.jsx(rh,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>{me([j]),H(rt.Copy)}}),n.actionLabels[K.Move]&&!$t&&!ho&&Ke.push({key:rt.Move,label:n.actionLabels[K.Move],icon:f.jsx(ah,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>{Re([j]),H(rt.Move)}}),n.actionLabels[K.Download]&&!$t&&!ho&&Ke.push({key:"download",label:n.actionLabels[K.Download],icon:f.jsx(G.IconDownload,{...Y,className:"text-secondary"}),onClick:()=>q([j])}),n.actionLabels[K.Rename]&&!$t&&Ke.push({key:"rename",label:n.actionLabels[K.Rename],icon:f.jsx(G.IconPencilMinus,{...Y,className:"text-secondary"}),onClick:()=>Mr(j.path)}),n.actionLabels[K.Unshare]&&Jo?.includes(j.path)&&!$t&&Ke.push({key:"unshare",label:n.actionLabels[K.Unshare],icon:f.jsx(lh,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>Zo?.([j])}),n.actionLabels[K.RemoveAccess]&&v?.has(j.path)&&!$t&&Ke.push({key:K.RemoveAccess,label:n.actionLabels[K.RemoveAccess],icon:f.jsx(G.IconUserX,{size:Y.size,className:"text-secondary"}),onClick:()=>Xo?.([j])}),n.actionLabels[K.ManagePermissions]&&typeof zs=="function"&&j.nodeType===be.FOLDER&&!$t&&Ke.push({key:K.ManagePermissions,label:n.actionLabels[K.ManagePermissions],icon:f.jsx(G.IconExternalLink,{...Y,className:"text-secondary"}),onClick:()=>zs?.(j.path)}),n.actionLabels[K.Delete]&&j.permissions?.includes($o.WRITE)&&!$t&&Ke.push({key:"delete",label:n.actionLabels[K.Delete],icon:f.jsx(G.IconTrashX,{...Y,className:"text-secondary"}),onClick:()=>se([j],j.parentPath??"")})),We.length?Ke.length===0?We:We.length===0?Ke:[...We,{key:"divider",type:Bi.Divider},...Ke]:Ke},[n?.actionLabels,ie,Ne,$,zs,ne,me,H,Re,q,Mr,Zo,Xo,Jo,v,se]),cn=g.useMemo(()=>{const j=new Set;return P.forEach((We,Ke)=>j.add(Ke)),j},[P]),Or=g.useCallback((j,We)=>{M(j),L?.(We)},[L,M]),dn=W7({selectedFiles:P,actionLabels:d?.actionLabels,onDuplicate:ne,onCopy:j=>{me(j),H(rt.Copy)},onMove:j=>{Re(j),H(rt.Move)},onDownload:q,onDelete:se,onUnshare:Zo,onRemoveAccess:Xo,getCurrentFolderPath:()=>R??"/",sharedWithMeIds:Jo,sharedByMePaths:v,onClearSelection:T,forbiddenSymbolsRegExp:Ne}),Nr=g.useCallback(j=>{c?.onTabChange?.(j),Ko()},[c,Ko]),ql=g.useCallback(()=>c&&D.size===0?f.jsxs("div",{className:yp,role:"toolbar","aria-label":"File Manager Toolbar",children:[e,f.jsx(A7,{...c,onTabChange:Nr,areHiddenFilesVisible:S,onToggleHiddenFiles:x,isNewButtonVisible:Qi,isNewButtonDisabled:qo,newButtonDropdownItems:uo})]}):D.size>0&&d?f.jsx("div",{className:yp,role:"toolbar","aria-label":"File Manager Toolbar",children:f.jsx(D7,{...d,selectedCount:D.size,onClearSelection:T,actions:dn})}):null,[Nr,d,D,T,dn,S,x,c,Qi,qo,uo,e]);g.useImperativeHandle(kl,()=>({createFolder:vr}),[vr]);const Kl=g.useCallback(()=>vt?null:f.jsx("aside",{role:"region","aria-label":"File Manager Tree Navigation",className:"min-h-0 min-w-0 h-full flex-none",children:f.jsx(of,{defaultWidth:ti,width:ti,onResizeStop:Tr,onResize:Vl,minWidth:zL,maxWidth:WL,enabled:!y,children:f.jsx(_p,{width:ti,title:ei,containerClassName:Er,titleClassName:"dial-body-text text-primary",additionalButtons:Dr,isOpened:!y,onToggle:F,children:f.jsx(z7,{...Pr,items:s,rootItemPath:o?.path,rootItemLabel:o?.label,selectedPath:R,sharedByMePaths:v,forbiddenSymbolsRegExp:Ne,forbiddenSymbolsTooltip:Ve,onItemClick:W,areHiddenFilesVisible:S,getContextMenuItems:Lr,renamedPath:si===Ii.Tree?Ce:void 0,onRenameSave:fe,onRenameCancel:De,onRenameValidate:ze})})})}),[vt,ti,y,ei,Er,Dr,F,Pr,s,o?.path,o?.label,R,v,Ne,Ve,W,S,Lr,si,Ce,fe,De,ze]),Hr=$7({actionLabels:l?.actionLabels,onDuplicate:j=>ne([j]),onCopy:j=>{me([j]),H(rt.Copy)},onMove:j=>{Re([j]),H(rt.Move)},onDownload:j=>q([j]),onRename:Bl,onDelete:(j,We)=>se([j],We),onInfo:j=>Ml(j),onUnshare:j=>Zo?.([j]),onRemoveAccess:j=>Xo?.([j]),sharedWithMeIds:Jo,sharedByMePaths:v,onAddChild:j=>$?.([j]),onAddSibling:j=>ie?.([j]),onManagePermissions:j=>zs?.(j),onPreview:j=>Ll?.(j),onOpenInNewTab:j=>nn?.(j),previewExtensions:Ol,isRenameFileAvailable:Nl,isDuplicateFolderAvailable:Dt,forbiddenSymbolsRegExp:Ne}),un=g.useCallback(j=>{const We=Go(s,j.path);return We?Hr(We):[]},[s,Hr]),Yl=g.useCallback((j,We,Ke)=>oi?!1:ii(j,We,Ke),[oi,ii]),{actionsColumnDef:Zl}=$L({getContextMenuItems:un,isRowDisabled:Yl,allowedFileTypes:w,buttonClassName:vt?"":HL}),{columnDefs:hn}=U7({userColumnDefs:zl,filterable:Wl,dateLocale:_l,dateOptions:jl,effectiveVisibleColumns:$l,isCompactView:vt,hasActions:!!l?.actionLabels,actionsColumnDef:Zl,rootItemLabel:o?.label,rootItemPath:o?.path}),gn=g.useCallback(j=>{j.colDef.colId==="ag-Grid-SelectionColumn"||j.colDef.colId===at.Actions||Ce&&j.data?.path===Ce||j.data?.isTemporary||rn&&rn.includes(j.colDef.colId)||j.data&&U(j.data)},[Ce,U,rn]),Gr=g.useCallback(()=>f.jsx(rr,{title:Sr,description:yr,descriptionClassName:"text-sm",containerClassName:"gap-3 size-full bg-layer-2 border rounded-[4px] border-primary",titleClassName:"mt-2 !text-lg",icon:br||f.jsx(G.IconFileDescription,{size:100,stroke:.5,className:"text-secondary"})}),[yr,br,Sr]),Br=g.useMemo(()=>j=>j.path,[]),Vr=g.useMemo(()=>ue(Et?"border border-dashed border-accent-primary":"",Ut&&!Et?"border border-dashed border-primary":""),[Et,Ut]),zr=g.useMemo(()=>({...Ws.additionalGridOptions,onCellClicked:gn,headerHeight:Xc,rowHeight:Xc,rowClass:"group/grid-row",defaultColDef:{...Ws.additionalGridOptions?.defaultColDef,floatingFilter:a?.searchable?!1:Ws.additionalGridOptions?.defaultColDef?.floatingFilter},...vt?{getRowHeight:j=>j.data?.nodeType===be.FOLDER?Xc:_L}:{},context:{cancelFolderCreation:Ko,saveFolderCreation:mr,getDisplayName:kt,onRenameCancel:De,onRenameSave:fe,onRenameValidate:ze,renameTriggerView:si,validateFolderName:Cr,renamedItem:xe,renamedPath:Ce,newFolderTempId:fr,sharedByMePaths:v,selectedPaths:D,disabledRowIds:_s,forbiddenSymbolsRegExp:Ne,forbiddenSymbolsTooltip:Ve,hideSearchPathItemName:Fr}}),[Ws.additionalGridOptions,gn,a?.searchable,vt,Ko,mr,kt,De,fe,ze,si,Cr,xe,Ce,fr,v,D,_s,Ne,Ve,Fr]),ni=g.useMemo(()=>E.length===0&&!Qo&&!i?Gr():f.jsx(th,{columnDefs:hn,rowData:E,getRowId:Br,loading:i||wr,getContextMenuItems:un,withoutHeaderBorders:vt,selectionOnHover:!vt,onGridApiChange:de,className:Vr,...Ws,selectionMode:Ir,wrapCustomCellRenderers:kr,additionalGridOptions:zr,selectedRowIds:cn,onSelectionChange:Or,wrapperBorder:!Et&&!Ut,disabledRowIds:_s,allowDisabledContextMenu:oi}),[E,Qo,i,Gr,hn,Br,wr,un,vt,de,Vr,Ws,Ir,kr,zr,cn,Or,Et,Ut,_s,oi]);return f.jsx("section",{ref:Ul,className:"size-full",children:f.jsxs("div",{className:oe(kL,{"gap-3 pt-4":d&&D.size>0,"gap-4 p-3 pt-4":vt,"gap-2 pt-2":vt&&d&&D.size>0},t),children:[ql(),f.jsxs("div",{className:oe(AL,Hl),children:[Kl(),f.jsxs("div",{className:oe(LL,{"gap-3":vt}),children:[r&&f.jsx(k7,{...a??{},makeHref:j=>j.join("/"),path:R,onItemClick:N,rootItemPath:o?.path,rootItemLabel:o?.label,value:k,onSearchChange:A,isCompactView:vt,labelClassName:"dial-tiny"}),f.jsxs("section",{role:"region","aria-label":"File Manager Grid View",className:oe(NL,"relative"),onDragEnter:V,onDragLeave:Ee,onDragOver:At,onDrop:Xi,children:[ni,f.jsx(x7,{disabledGridRowIds:_s,gridRows:E,getDisabledTooltip:xr,getRowDisabledTooltip:ln,allowedFileTypes:w,maxSelectableFileSize:b})]})]})]}),f.jsx(P7,{...u,open:le,itemsToDelete:re,onClose:B,onConfirm:pe}),f.jsx(nw,{...h,open:Q,onClose:te,onConfirm:()=>{const j=h?.destinationFolderPath??"/";J===rt.Copy?_(j):Fe(j),te()},mode:J,items:s,rootItem:o,gridOptions:{columnDefs:hn.filter(j=>j.colId!==at.Actions),loading:i},onUploadFiles:yl,onValidateUpload:xl,maxFileSize:Rl,path:h?.destinationFolderPath??h?.sourceFolder??R,onPathChange:j=>{h?.setDestinationFolderPath?.(j)},sourceFolder:h?.sourceFolder??R,treeOptions:{header:n?.header},onFolderPopupPathChange:Al}),f.jsx(xp,{...p,open:Ji,onClose:Dl,onReplace:Rs,onDuplicate:El,onDecideForEach:ot,conflictingFiles:Fl}),f.jsx(xp,{...p,open:Fs,onClose:sn,onReplace:en,onDuplicate:tn,onDecideForEach:Tl,conflictingFiles:Pl}),f.jsx(N7,{open:on,onClose:Il,fileMetadata:ds?.fileMetadata??Yo,loading:ds?.loading,header:ds?.header,nameLabel:ds?.nameLabel,pathLabel:ds?.pathLabel,modifiedDateLabel:ds?.modifiedDateLabel,sizeLabel:ds?.sizeLabel,authorLabel:ds?.authorLabel,dateLocale:l?.dateLocale,dateOptions:l?.dateOptions})]})})},K7=(e,t=wi.MyFiles)=>{const s=Object.values(wi).includes(t)?t:wi.MyFiles,[o,i]=g.useState(s),n=a=>{i(a)},r=g.useMemo(()=>{if(e)return Object.values(wi).map(a=>({id:a,label:e?.[a]||a.replace("_"," ")}))},[e]);return{activeTab:o,handleTabChange:n,tabs:r}},Y7="application/octet-stream";function Z7(e,t){if(!e||e.length===0)return[];const s=e.find(l=>l.parentPath===""&&l.nodeType==="FOLDER");if(!s)return[];const o=s.path||s.url||"",i=Jc(o,!0),n=e.filter(l=>l!==s).map(l=>{const c=l.path||l.url||"",d=X7(l.nodeType),u=d===be.FOLDER,h=Jc(c,u);let p;return l.parentPath===null||l.parentPath===void 0?p=i:l.parentPath===""?p="":p=Jc(l.parentPath,!0),{...l,originalPath:c,path:h,parentPath:p,nodeType:d}}),r=new Map;n.forEach(l=>{const c={...l,id:l.originalPath,name:l.name,path:l.path,parentPath:l.parentPath,nodeType:l.nodeType,resourceType:Q7(l.resourceType),folderId:t,updatedAt:l.updatedAt?new Date(l.updatedAt).toISOString():new Date().toISOString(),items:l.nodeType===be.FOLDER?[]:void 0};l.nodeType===be.ITEM&&(c.extension=J7(l.name),c.contentType=l.contentType||Y7,c.contentLength=l.contentLength||0),r.set(l.path,c)});const a=[];return r.forEach(l=>{if(l.parentPath===i)a.push(l);else{const c=l.path.lastIndexOf(l.name||""),d=l.path.slice(0,c),u=r.get(d);u&&u.nodeType===be.FOLDER?(u.items=u.items||[],u.items.push(l)):a.push(l)}}),a}function Jc(e,t){try{let s=decodeURIComponent(e);return t?s.endsWith("/")||(s+="/"):s.endsWith("/")&&(s=s.slice(0,-1)),s}catch{return t&&!e.endsWith("/")?e+"/":!t&&e.endsWith("/")?e.slice(0,-1):e}}function X7(e){return e.toUpperCase()==="FOLDER"?be.FOLDER:be.ITEM}function Q7(e){if(!e)return;const t=e.toUpperCase();return Object.values(ch).find(o=>o.toUpperCase()===t)}function J7(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function e9(e,t="Prompts",s="prompts/public/",o="root"){const i=Z7(e,o);return[{id:o,name:t,path:s,parentPath:"",nodeType:be.FOLDER,folderId:o,items:i}]}exports.AlertVariant=is;exports.BASE_ICON_PROPS=Y;exports.BASE_ICON_SIZE=Nt;exports.ButtonAppearance=Me;exports.ButtonVariant=Ge;exports.ConfirmationPopupVariant=Vi;exports.DIAL_ICON_SIZE=pt;exports.DialAlert=Wp;exports.DialAutocompleteInputValue=Nv;exports.DialBreadcrumb=Mv;exports.DialBreadcrumbItem=Dn;exports.DialButton=ss;exports.DialButtonDropdown=Ud;exports.DialCaptionText=ir;exports.DialCheckbox=id;exports.DialCloseButton=eh;exports.DialCollapsibleSidebar=_p;exports.DialConditionalResizableContainer=of;exports.DialConfirmationPopup=Ov;exports.DialDestinationFolderPopup=nw;exports.DialDraggableItem=N0;exports.DialDropdown=Ft;exports.DialEllipsisTooltip=ht;exports.DialErrorButton=kv;exports.DialErrorIconButton=Av;exports.DialErrorText=ns;exports.DialFileIcon=iu;exports.DialFileManager=hw;exports.DialFileManagerActions=K;exports.DialFileManagerTabs=wi;exports.DialFileName=ll;exports.DialFileNodeType=be;exports.DialFilePermission=$o;exports.DialFileResourceType=ch;exports.DialFolderName=cl;exports.DialFormItem=Xd;exports.DialFormPopup=$8;exports.DialGhostButton=E8;exports.DialGhostIconButton=A8;exports.DialGrid=th;exports.DialIcon=$e;exports.DialIconButton=no;exports.DialInput=Zi;exports.DialInputPopup=Hv;exports.DialItemType=_t;exports.DialLabel=Bo;exports.DialLabelledText=k1;exports.DialLinkButton=F8;exports.DialLoadFileArea=qv;exports.DialLoadFileAreaField=TL;exports.DialLoader=nr;exports.DialNeutralButton=ys;exports.DialNeutralIconButton=T8;exports.DialNoDataContent=rr;exports.DialNumberInput=J8;exports.DialPasswordInput=sL;exports.DialPopup=Uo;exports.DialPrimaryButton=bs;exports.DialPrimaryIconButton=P8;exports.DialRadioButton=Zd;exports.DialRadioGroup=Fa;exports.DialRadioGroupPopupField=W8;exports.DialRemoveButton=Lv;exports.DialResizableContainer=sf;exports.DialSearch=ih;exports.DialSecondaryIconButton=M8;exports.DialSelect=Vv;exports.DialSelectField=hL;exports.DialSharedEntityIndicator=Wn;exports.DialSkeleton=pi;exports.DialSkeletonAvatarShape=Ea;exports.DialSkeletonAvatarSize=Tn;exports.DialSkeletonVariant=Xt;exports.DialSteps=E1;exports.DialSuccessIconButton=k8;exports.DialSwitch=oh;exports.DialTabs=Ev;exports.DialTag=vo;exports.DialTagInput=nL;exports.DialTertiaryIconButton=I8;exports.DialTextarea=L8;exports.DialTooltip=yt;exports.DropdownItemType=Bi;exports.DropdownTrigger=Ht;exports.DropdownType=yv;exports.ElementSize=bt;exports.FileManagerColumnKey=at;exports.FileManagerProvider=iw;exports.FlexibleActionsDirection=So;exports.FormItemOrientation=zn;exports.GridSelectionMode=Vn;exports.NAME_COLUMN=lw;exports.NOT_ALLOWED_SPACES=uh;exports.NOT_ALLOWED_SPACES_REGEXP=y7;exports.NOT_ALLOWED_SYMBOLS=sw;exports.NOT_ALLOWED_SYMBOLS_REGEXP=ow;exports.PopupSize=Wt;exports.RadioGroupOrientation=To;exports.ResizableContainerSide=_n;exports.SIZE_COLUMN=dw;exports.SelectSize=Ja;exports.SelectVariant=el;exports.StepStatus=Gt;exports.TabOrientation=Xa;exports.TagVariant=sl;exports.UPDATED_AT_COLUMN=cw;exports.mergeClasses=oe;exports.useDialFileManagerTabs=K7;exports.useEditableItem=rw;exports.useFileManagerContext=uw;exports.wrapInRootFolder=e9;
64
+ |\r| )|[\0-]`,S7=`[${sw.replace(/\\/g,"\\\\")}]`,ow=new RegExp(`${S7}|${uh}`),y7=new RegExp(uh),iw=({managerLabel:e,children:t,className:s,items:o=[],rootItem:i,path:n,defaultPath:r,filesLoading:a,selectedPaths:l,defaultSelectedPaths:c,onSelectedPathsChange:d,showHiddenFiles:u,onShowHiddenFilesChange:h,treeOptions:p,showNavigationPanel:m=!0,navigationPanelOptions:C,deleteConfirmationOptions:v,gridOptions:w,toolbarOptions:b,bulkActionsToolbarOptions:S,destinationFolderPopupOptions:x,conflictResolutionPopupOptions:y,onPathChange:F,onTableFileClick:R,handleSelectionClick:E,onGridApiChange:D,onCopyFiles:P,onMoveToFiles:T,onDeleteFiles:M,onDownloadFiles:k,onRenameValidate:N,onAddSibling:A,onAddChild:W,renameValidationMessages:U,forbiddenSymbolsRegExp:L=ow,forbiddenSymbolsTooltip:de,onUploadFiles:H,onValidateUpload:te,uploadEnabled:Q,uploadValidationMessages:J,maxFileSize:me,onUploadArchive:Re,onCreateFolder:ne,onCreateFolderValidate:_,folderCreationValidationMessages:Fe,fileMetadataPopupOptions:ie,onGetInfo:$,onUnshareFiles:q,onRemoveFilesAccess:se,actionsRef:B,sharedByMePaths:pe,onSearchFiles:le,searchResults:re,searchInProgress:Ce,clearSearchResults:xe,allowedFileTypes:Le,maxSelectableFileSize:fe,getDisabledTooltip:De,fileTooLargeTooltip:ze,unsupportedFileTypeTooltip:Ne,emptyStateIcon:Ve,emptyStateTitle:kt,emptyStateDescription:Et,sharedWithMeIds:Ut,onFolderPopupPathChange:V,onManagePermissions:Ee,onPreview:At,onOpenInNewTab:Xi,previewExtensions:yl,isRenameFileAvailable:xl,isDuplicateFolderAvailable:Rl,customUploadFileAction:uo,customCreateNewItemAction:Qi,customDuplicateAction:qo,customDeleteItemsAction:fr,customDownloadItemsAction:Ko,customBreakpointRef:mr,gridClassName:Cr,nonClickableTableColumns:vr,hideSearchPathItemName:Fl})=>{const{selectedPaths:Ji,clearSelection:Rs,setSelectedPaths:El}=b7({selectedPaths:l,defaultSelectedPaths:c,onSelectedPathsChange:d}),Dl=g.useMemo(()=>{const Oe=new Map;return Ji.forEach(Lt=>{const Pt=Go(o,Lt);Pt&&Oe.set(Lt,Pt)}),Oe},[Ji,o]),{currentPath:ot,setCurrentPath:Pl,handlePathChange:Fs}=o7({path:n,defaultPath:r,onPathChange:F,onSelectionClear:Rs}),en=g.useMemo(()=>{const{showFiles:Oe=!0,showFolders:Lt=!0,...Pt}=w||{};return{showFiles:Oe,showFolders:Lt,...Pt}},[w]),tn=en.showFiles,sn=en.showFolders,[Tl,Ml]=g.useState(),ds=x?.destinationFolderPath??Tl,on=g.useCallback(Oe=>{x?.setDestinationFolderPath?x.setDestinationFolderPath(Oe):Ml(Oe)},[x]),{areHiddenFilesVisible:Yo,toggleHiddenFilesVisibility:Il}=e7({showHiddenFiles:u,onShowHiddenFilesChange:h}),{isTreeCollapsed:Zo,toggleTreeCollapse:Xo,setIsTreeCollapsed:kl}=t7({collapsed:p?.collapsed,onCollapseChange:p?.onCollapseChange}),{renamedPath:wr,renamedItem:Qo,renameHandler:br,renameSaveHandler:Sr,renameCancelHandler:yr,renameValidateHandler:Jo,getDisplayName:Al}=h7({items:o,onRenameValidate:N,validationMessages:U,onMoveToFiles:T}),{isSearchMode:zs,searchValue:Ll,effectiveSearchValue:nn,setSearchValue:Ol,handleSearchChange:Nl,handleSearchClear:Dt,searchResultsRows:xr}=w7({onSearchFiles:le,clearSearchResults:xe,currentPath:ot,searchResults:re,searchInProgress:Ce,navigationPanelValue:C?.value,onNavigationPanelSearchChange:C?.onSearchChange,allItems:o,activeTab:b?.activeTab}),et=g.useMemo(()=>Rp(o,ot)??o[0],[o,ot]),{handleCopyTo:Rr,handleMoveTo:Hl,handleDuplicate:rn,handleOpenDestinationFolderPopup:Fr,handleCloseDestinationFolderPopup:Gl,openDestinationFolderPopup:ei,handleSetCopiedFiles:Er,handleSetMovedFiles:Dr,destinationFolderMode:Pr,destinationFolderTitle:ti,conflictingFiles:Tr,conflictResolutionOpen:si,closeConflictResolution:Bl,handleConflictReplace:Mr,handleConflictDuplicate:an,handleConflictCancel:Vl,handleConflictDecideForEach:zl,sourceFolder:Wl}=s7({getDestinationFiles:Oe=>Rp(o,Oe)?.items??[],onCopyFiles:P,onMoveToFiles:T,onCopySuccess:Rs,onMoveSuccess:Rs,onDuplicateSuccess:Rs,getCopyHeader:x?.getCopyHeader,getMoveHeader:x?.getMoveHeader});g.useEffect(()=>{ei||on(void 0)},[ei,on]);const{deleteConfirmationOpen:_l,itemsToDelete:jl,openDeleteConfirmation:Ir,closeDeleteConfirmation:kr,confirmDelete:Ar}=i7({onDeleteFiles:M,onDeleteSuccess:Rs}),{handleDownloadFiles:oi}=n7({onDownloadFiles:k,customDownloadItemsAction:Ko,onDownloadSuccess:Rs}),{isDragging:Ws,isDraggingOverWindow:Ul,uploadError:vt,handleDragEnter:$l,handleDragLeave:ln,handleDragOver:ii,handleDrop:_s,clearError:Lr,openFileDialog:cn,fileInputRef:Or,openArchiveDialog:dn,uploadConflictingFiles:Nr,uploadConflictResolutionOpen:ql,closeUploadConflictResolution:Kl,handleUploadConflictReplace:Hr,handleUploadConflictDuplicate:un,handleUploadConflictCancel:Yl,handleUploadConflictDecideForEach:Zl}=a7({onUploadFiles:H,onValidateUpload:te,maxFileSize:me,onUploadArchive:Re,allowedFileTypes:Le,validationMessages:J,uploadEnabled:Q,currentFolder:et}),hn=g.useCallback(Oe=>{Dt();const Lt=ot??"",Pt=et?.items??[];_s(Oe,Lt,Pt)},[ot,et,_s,Dt]),gn=g.useCallback(()=>{Dt();const Oe=ot??"",Lt=et?.items??[];cn(Oe,Lt)},[ot,et,cn,Dt]),Gr=g.useCallback(()=>{Dt();const Oe=ot??"",Lt=et?.items??[];dn(Oe,Lt)},[ot,et,dn,Dt]),Br=g.useCallback(()=>{Dt(),uo?.(ot,et)},[uo,ot,et,Dt]),Vr=g.useCallback(()=>{Dt(),Qi?.(ot,et)},[Qi,ot,et,Dt]),zr=g.useCallback(Oe=>{qo?.(Oe)},[qo]),{isCreatingFolder:ni,newFolderTempId:j,startFolderCreation:We,cancelFolderCreation:Ke,saveFolderCreation:$t,validateFolderName:ho}=f7({currentFolder:et,onCreateFolder:ne,onValidateFolderName:_,validationMessages:Fe}),ph=g.useCallback(()=>{Dt(),We()},[Dt,We]),{newActions:gw,isNewButtonVisible:pw,isNewButtonDisabled:fw}=g7({newActions:b?.newActions,currentFolder:et,onUploadFiles:uo?Br:gn,onUploadArchive:Gr,onCreateFolder:ph,onCreateNewItem:Vr,isNewButtonDisabled:b?.isNewButtonDisabled}),mw=g.useMemo(()=>{if(zs){let ke=xr;tn||(ke=ke.filter(_e=>_e.nodeType!==be.ITEM)),sn||(ke=ke.filter(_e=>_e.nodeType!==be.FOLDER)),Yo||(ke=ke.filter(_e=>!_e.path.split("/").filter(Boolean).some(fn=>fn.startsWith("."))));const pn=ke.map(_e=>({..._e,id:_e.id??_e.path,name:_e.name??_e.path.split("/").pop()??"",updatedAt:_e.updatedAt,size:_e.contentLength,contentLength:_e.contentLength,author:_e.author,path:_e.path,nodeType:_e.nodeType,extension:_e.extension,isTemporary:!1,owner:_e.owner,folderId:_e.folderId}));return ni&&j&&pn.unshift({id:j,name:"",updatedAt:void 0,author:void 0,path:ot??"/",nodeType:be.FOLDER,extension:void 0,isTemporary:!0,owner:void 0}),pn}const Oe=ki(nn).trim(),Lt=et?.items??[];let Pt=Oe?ZL(et):Lt;tn||(Pt=Pt.filter(ke=>ke.nodeType!==be.ITEM)),sn||(Pt=Pt.filter(ke=>ke.nodeType!==be.FOLDER)),Yo||(Pt=Pt.filter(ke=>Oe?!ke.path.split("/").filter(Boolean).some(_e=>_e.startsWith(".")):!Zv(ke)));const Xl=Pt.map(ke=>({...ke,id:ke.id??ke.path,name:ke.name??ke.path.split("/").pop()??"",updatedAt:ke.updatedAt,size:ke.contentLength,author:ke.author,path:ke.path,nodeType:ke.nodeType,extension:ke.extension,isTemporary:!1,owner:ke.owner,contentType:ke.contentType,contentLength:ke.contentLength,folderId:ke.folderId}));if(ni&&j&&!Oe&&Xl.unshift({id:j,name:"",updatedAt:void 0,author:void 0,path:ot??"/",nodeType:be.FOLDER,extension:void 0,isTemporary:!0,owner:void 0}),!Oe)return Xl;const Tw=Oe.split(/\s+/).filter(Boolean);return Xl.filter(ke=>{if(ke.isTemporary)return!0;const pn=ki(ke.name),_e=ki(ke.author),Ch=YL(ke.extension);return Tw.every(fn=>pn.includes(fn)||_e.includes(fn)||Ch.includes(fn))})},[zs,xr,et,nn,Yo,ni,j,tn,sn,ot]),Cw=g.useCallback(Oe=>{Fs(Oe.path)},[Fs]),vw=g.useCallback(Oe=>{Fs(Oe)},[Fs]),ww=g.useCallback(Oe=>{Oe.nodeType===be.FOLDER?Fs(Oe.path):R?.(Oe)},[Fs,R]),{expandedPaths:fh,setExpandedPaths:bw,collapseAll:Sw}=tw({expandedPaths:p?.expandedPaths,onExpandedPathsChange:p?.onExpandedPathsChange}),{additionalButtons:yw}=m7({collapseAll:Sw,expandedPathsLength:fh.size,additionalButtons:p?.additionalButtons}),{isMetadataPopupOpen:xw,selectedFileForMetadata:Rw,openMetadataPopup:Fw,closeMetadataPopup:mh}=C7({onGetInfo:$}),Ew=g.useCallback(()=>{mh(),ie?.clearMetadata?.()},[mh,ie]),Dw=g.useMemo(()=>{if(L)return Sl(L)},[L]),Pw={managerLabel:e,className:s,items:o,allowedFileTypes:Le,maxSelectableFileSize:fe,rootItem:i,filesLoading:a,treeOptions:{...p,expandedPaths:fh,onExpandedPathsChange:bw,additionalButtons:yw},showNavigationPanel:m,navigationPanelOptions:C,gridOptions:en,toolbarOptions:b,bulkActionsToolbarOptions:S,deleteConfirmationOptions:v,destinationFolderPopupOptions:{...x,destinationFolderPath:ds,setDestinationFolderPath:on,header:ti,onCreateFolder:ne,onCreateFolderValidate:_,folderCreationValidationMessages:Fe,sourceFolder:Wl},currentPath:ot,setCurrentPath:Pl,searchValue:Ll,effectiveSearchValue:nn,setSearchValue:Ol,areHiddenFilesVisible:Yo,toggleHiddenFilesVisibility:Il,isTreeCollapsed:Zo,toggleTreeCollapse:Xo,setIsTreeCollapsed:kl,selectedPaths:Ji,selectedFiles:Dl,setSelectedPaths:El,clearSelection:Rs,currentFolder:et,gridRows:mw,handleCopyTo:Rr,handleMoveTo:Hl,handleDuplicate:qo?zr:rn,handleSetCopiedFiles:Er,handleSetMovedFiles:Dr,openDestinationFolderPopup:ei,handleCloseDestinationFolderPopup:Gl,handleOpenDestinationFolderPopup:Fr,destinationFolderMode:Pr,handleAddSibling:A,handleAddChild:W,handleDownloadFiles:oi,renamedPath:wr,renamedItem:Qo,forbiddenSymbolsRegExp:Dw,forbiddenSymbolsTooltip:de,onRename:br,onRenameSave:Sr,onRenameCancel:yr,onRenameValidate:Jo,getDisplayName:Al,openDeleteConfirmation:fr||Ir,closeDeleteConfirmation:kr,confirmDelete:Ar,deleteConfirmationOpen:_l,itemsToDelete:jl,handlePathChange:Fs,handleTreeItemClick:Cw,handleBreadcrumbItemClick:vw,handleSearchChange:Nl,handleTableRowClick:ww,onTableFileClick:R,handleSelectionClick:E,onGridApiChange:D,isDragging:Ws,uploadError:vt,handleDragEnter:$l,handleDragLeave:ln,handleDragOver:ii,handleDrop:hn,clearUploadError:Lr,onUploadFiles:H,onValidateUpload:te,maxFileSize:me,isDraggingOverWindow:Ul,openFileDialog:gn,fileInputRef:Or,newActions:gw,isNewButtonVisible:pw,isNewButtonDisabled:fw,isCreatingFolder:ni,newFolderTempId:j,startFolderCreation:ph,cancelFolderCreation:Ke,saveFolderCreation:$t,validateFolderName:ho,conflictResolutionPopupOptions:y,conflictingFiles:Tr,conflictResolutionOpen:si,closeConflictResolution:Bl,handleConflictReplace:Mr,handleConflictDuplicate:an,handleConflictCancel:Vl,handleConflictDecideForEach:zl,uploadConflictingFiles:Nr,uploadConflictResolutionOpen:ql,closeUploadConflictResolution:Kl,handleUploadConflictReplace:Hr,handleUploadConflictDuplicate:un,handleUploadConflictCancel:Yl,handleUploadConflictDecideForEach:Zl,fileMetadataPopupOptions:ie,isMetadataPopupOpen:xw,selectedFileForMetadata:Rw,openMetadataPopup:Fw,closeMetadataPopup:Ew,onGetInfo:$,onUnshareFiles:q,onRemoveFilesAccess:se,actionsRef:B,sharedByMePaths:pe,onSearchFiles:le,searchInProgress:Ce,searchResults:re,clearSearchResults:xe,isSearchMode:zs,emptyStateIcon:Ve,emptyStateTitle:kt,emptyStateDescription:Et,gridClassName:Cr,sharedWithMeIds:Ut,onFolderPopupPathChange:V,onManagePermissions:Ee,onPreview:At,onOpenInNewTab:Xi,previewExtensions:yl,isRenameFileAvailable:xl,isDuplicateFolderAvailable:Rl,customUploadFileAction:uo,customBreakpointRef:mr,nonClickableTableColumns:vr,hideSearchPathItemName:Fl,getDisabledTooltip:De,fileTooLargeTooltip:ze,unsupportedFileTypeTooltip:Ne};return f.jsx(Jv.Provider,{value:Pw,children:t})},x7=({disabledGridRowIds:e,gridRows:t,getDisabledTooltip:s,getRowDisabledTooltip:o,allowedFileTypes:i,maxSelectableFileSize:n})=>{const[r,a]=g.useState(null),[l,c]=g.useState(null);g.useEffect(()=>{const h=()=>{a(null),c(null)};return window.addEventListener("scroll",h,!0),()=>window.removeEventListener("scroll",h,!0)},[]),g.useEffect(()=>{const h=C=>{const w=C.target.closest(".ag-row");if(!w){a(S=>S&&null);return}const b=w.getAttribute("row-id");b&&e.has(b)?a(S=>S!==b?(c(w.getBoundingClientRect()),b):S):a(S=>S&&null)},p=()=>{a(null),c(null)},m=document.querySelector('[aria-label="File Manager Grid View"]');if(m)return m.addEventListener("mousemove",h),m.addEventListener("mouseleave",p),()=>{m.removeEventListener("mousemove",h),m.removeEventListener("mouseleave",p)}},[e]);const d=g.useMemo(()=>{if(r)return t.find(h=>h.path===r)},[r,t]),u=g.useMemo(()=>{if(d)return s&&d.folderId?s(d):o(d,i,n)},[d,s,o,i,n]);return f.jsx(f.Fragment,{children:u&&l&&zi.createPortal(f.jsxs(qd,{open:!0,placement:"top",children:[f.jsx(Yd,{asChild:!0,children:f.jsx("div",{className:ue("fixed z-[-1]",u&&"pointer-events-none"),style:{top:l.top,left:l.left,width:l.width,height:l.height}})}),f.jsx(Kd,{className:"max-w-[300px] rounded border border-ui-outline-primary bg-ui-popover px-3 py-1.5 text-center text-primary shadow-md fill-ui-popover",children:u})]}),document.body)})},hh=()=>{const[e,t]=g.useState(fp());return g.useEffect(()=>{const s=()=>t(fp());return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),e},nw=({onClose:e,onConfirm:t,onFolderPopupPathChange:s,setDestinationFolderPath:o,open:i,copyLabel:n="Copy",moveLabel:r="Move",addFolderLabel:a="Add folder",mode:l=rt.Copy,hiddenFilesSwitcherLabel:c="Show hidden files",onUploadFiles:d,onValidateUpload:u,maxFileSize:h,header:p,sourceFolder:m,disabledPathTooltip:C="Unavailable for the original path. Please select another folder",path:v,collapsedFileTree:w=!1,alertProps:b,...S})=>{const[x,y]=g.useState(!1),[F,R]=g.useState(!1),E=g.useRef(null),D=hh(),P=g.useCallback(A=>{y(A)},[]),T=g.useMemo(()=>[{key:"add-folder",label:a,icon:f.jsx(G.IconFolderPlus,{...Y,className:"text-secondary"}),onClick:()=>{E.current?.createFolder(),R(!1)}},{key:"show-hidden-files",label:c,icon:f.jsx(G.IconEye,{...Y,className:"text-secondary"}),onClick:()=>{y(A=>!A),R(!1)}}],[a,c]),M=g.useCallback(A=>{A&&(s?.(A),o?.(A))},[s,o]),k=l===rt.Copy?"Copy to":"Move to",N=g.useMemo(()=>!v||!m?!1:m===v,[v,m]);return f.jsx(Uo,{open:i,onClose:()=>{e()},size:Wt.Lg,dividerFooter:!0,dividers:!1,className:"md:!h-[800px] !bg-layer-2",footer:f.jsxs("div",{className:"flex justify-between items-center gap-2 py-4 px-4 md:px-6",children:[f.jsx("div",{className:"flex items-center gap-4 min-w-0",children:D?f.jsx(Ft,{menu:{items:T},open:F,onOpenChange:R,children:f.jsx(ss,{className:"h-9 w-9 shrink-0","aria-label":"More options",iconBefore:f.jsx(G.IconDotsVertical,{...Y,className:"text-secondary"})})}):f.jsxs(f.Fragment,{children:[f.jsx(bs,{label:a,appearance:Me.Ghost,iconBefore:f.jsx(G.IconFolderPlus,{...Y}),onClick:()=>{E.current?.createFolder()}}),f.jsx("div",{className:"w-px h-[26px] bg-controls-disable-accent my-2"}),f.jsx("div",{className:"inline-flex items-center cursor-pointer",children:f.jsx(oh,{label:c,isOn:x,onChange:P,switchId:"hidden-files-switch"})})]})}),f.jsxs("div",{className:"flex space-x-4 items-center",children:[f.jsx(ys,{onClick:e,label:"Cancel"}),N?f.jsx(yt,{tooltip:C,children:f.jsx(bs,{onClick:t,label:l==="copy"?n:r,disabled:N,"aria-disabled":N})}):f.jsx(bs,{onClick:t,label:l==="copy"?n:r})]})]}),header:p??k,children:f.jsxs("div",{className:"bg-layer-2 h-full flex flex-col",children:[b&&f.jsx("div",{className:"px-4 pt-4",children:f.jsx(Wp,{...b})}),f.jsx("div",{className:"flex-1 min-h-0",children:f.jsx(hw,{...S,gridClassName:"size-full",className:oe(S.className,"bg-layer-2 h-full flex pt-0"),actionsRef:E,path:v,showHiddenFiles:x,onShowHiddenFilesChange:P,treeOptions:{...S.treeOptions,collapsed:w,expandedPaths:new Set([S.rootItem?.path||"/"]),header:S.treeOptions?.header},gridOptions:{...S.gridOptions,selectionMode:void 0},navigationPanelOptions:{elementId:"file-manager-destination-search",...S.navigationPanelOptions},onUploadFiles:d,onValidateUpload:u,onPathChange:M,maxFileSize:h})})]})})},R7=12,F7=8;var So=(e=>(e.Normal="normal",e.Reverse="reverse",e))(So||{});function E7({actions:e,direction:t=So.Normal,moreButtonWidth:s=Nt,actionsGap:o=8,containerPadding:i=8,dependencies:n=[]}){const r=g.useRef(null),a=g.useRef(null),l=g.useRef(null),c=g.useRef(null),d=g.useRef([]),[u,h]=g.useState(e.length);g.useLayoutEffect(()=>{if(!a.current)return;const C=Array.from(a.current.children);d.current=C.map(v=>Math.ceil(v.getBoundingClientRect().width))},[e,...n]),g.useEffect(()=>{if(!r.current)return;let C=null;const v=()=>{C&&cancelAnimationFrame(C),C=requestAnimationFrame(()=>{const b=r.current,S=l.current?.offsetWidth??0,x=c.current?.offsetWidth??0,y=S+x,R=b.getBoundingClientRect().width-y-s-o*2-i*2,E=d.current;let D=0,P=0;if(t===So.Reverse)for(let T=E.length-1;T>=0&&(D+=E[T]+o,!(D>R));T--)P++;else for(const T of E){if(D+=T+o,D>R)break;P++}h(P)})},w=new ResizeObserver(v);return w.observe(r.current),v(),()=>{C&&cancelAnimationFrame(C),w.disconnect()}},[e.length,t,...n]);const p=t===So.Reverse?e.slice(0,e.length-u):e.slice(u);return{visibleActions:t===So.Reverse?e.slice(e.length-u):e.slice(0,u),hiddenActions:p,refs:{containerRef:r,measureRef:a,leftSectionRef:l,rightSectionRef:c}}}const D7=({getSelectionLabel:e,onClearSelection:t,actions:s,selectedCount:o})=>{const i=hh(),{refs:{containerRef:n,leftSectionRef:r,measureRef:a},visibleActions:l,hiddenActions:c}=E7({actions:s,direction:So.Reverse,dependencies:[i],actionsGap:R7,containerPadding:F7}),d=e(o);return f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:a,className:"absolute top-0 left-0 invisible pointer-events-none overflow-hidden whitespace-nowrap flex gap-3",children:s.map(({key:u,icon:h,title:p})=>f.jsx(ys,{iconBefore:h,label:p,hideTitleOnMobile:!0},u))}),f.jsxs("div",{ref:n,className:"rounded bg-layer-0 p-2 flex justify-between items-center w-full",role:"toolbar","aria-label":"File bulk actions",children:[f.jsx("div",{ref:r,children:f.jsx(bs,{label:d,onClick:t,textClassName:"text-accent-primary whitespace-nowrap",appearance:Me.Ghost,iconBefore:f.jsx(G.IconX,{...Y,className:"text-accent-primary"})})}),f.jsxs("div",{className:"flex flex-1 w-full gap-3 items-center justify-end",children:[c.length>0&&f.jsx(Ft,{menu:{items:c},allowedPlacements:["bottom","bottom-start"],children:f.jsx(ss,{className:"h-[38px]",iconBefore:f.jsx(G.IconDotsVertical,{...Y,className:"text-secondary hover:text-accent-primary"})})}),l.map(({key:u,icon:h,tooltip:p,title:m,onClick:C,disabled:v})=>f.jsx(ys,{className:"!p-[9px]",iconBefore:h,label:m,hideTitleOnMobile:!0,disabled:v,tooltipProps:{tooltip:p},onClick:w=>C?.({key:u,domEvent:w})},u))]})]})]})},P7=({open:e,itemsToDelete:t,onClose:s,onConfirm:o,cancelLabel:i="Cancel",confirmLabel:n="Delete",titleRenderer:r,contentRenderer:a})=>{const l=t.map(p=>p.name),d=r?.(l)||"Confirm Deleting Items",u=f.jsxs("div",{className:"px-6 py-3 dial-small-text",children:[f.jsx("p",{className:"text-secondary mb-3",children:t.length===1?f.jsxs(f.Fragment,{children:["Do you want to delete file or folder"," ",f.jsxs("span",{className:"text-primary break-all",children:['"',t[0].name,'"']}),"?"]}):f.jsxs(f.Fragment,{children:["Do you want to delete the following"," ",f.jsx("span",{className:"text-primary",children:t.length})," items?"]})}),t.length>1&&f.jsx(f.Fragment,{children:t.length<=10?f.jsx("ul",{className:"space-y-1 text-primary list-none",children:t.map(p=>f.jsx("li",{className:"truncate",children:p.name},p.path))}):f.jsxs(f.Fragment,{children:[f.jsx("ul",{className:"space-y-1 text-primary list-none mb-2",children:t.slice(0,10).map(p=>f.jsx("li",{className:"truncate",children:p.name},p.path))}),f.jsxs("p",{className:"text-secondary italic",children:["... and ",t.length-10," more"]})]})})]}),h=a?.(l)||u;return f.jsx(Ov,{open:e,header:d,confirmLabel:n,cancelLabel:i,variant:Vi.Danger,onClose:s,onConfirm:o,children:h})},Pp=e=>e.split("/").map(t=>t.trim()).filter(Boolean),T7="w-full flex items-center justify-between gap-4",M7="min-w-0 h-[38px] flex-1 overflow-hidden bg-layer-3 px-3 flex items-center rounded",I7="w-[260px]",k7=({ariaLabel:e="Breadcrumb",labelClassName:t,onItemClick:s,path:o,makeHref:i,rootItemPath:n,rootItemLabel:r,breadcrumbsHiddenPathPart:a,className:l,breadcrumbClassName:c,searchable:d=!0,value:u,elementId:h="file-manager-search",disabled:p,invalid:m,onSearchChange:C,searchClassName:v,searchContainerClassName:w,isCompactView:b=!1})=>{const S=g.useMemo(()=>{if(!o)return;let D=Pp(o);const P=[...D];let T=0;if(a){const k=Pp(a);if(k.length){const N=D.findIndex((A,W)=>k.every((U,L)=>D[W+L]===U));N!==-1&&(T=k.length,D=[...D.slice(0,N),...D.slice(N+k.length)])}}if(!D.length)return[{label:"/"}];const M=D.map((k,N)=>{const A=N<D.length-T?N:N+T,W=P.slice(0,A+1),U=typeof i=="function"?i(W,A):void 0;return{label:k,href:U,onClick:s?L=>{L.preventDefault(),s(U)}:void 0}});if(n&&r){const k=n.split("/").filter(Boolean),N=o.split("/").filter(Boolean);if(k.every((W,U)=>N[U]===W)&&M.length>0){const W=M.slice(k.length);return[{label:r,href:n,onClick:s?U=>{U.preventDefault(),s(n)}:void 0},...W]}}return M},[o,a,n,r,i,s]),[x,y]=g.useState(!1),F=g.useCallback(()=>{if(b&&!x){y(!0);const D=document.getElementById(h);D&&D.focus()}},[h,x,b]),R=g.useCallback(()=>{(!u||String(u).trim()==="")&&C?.("")},[u,C]),E=g.useCallback(()=>b&&x?f.jsx(ys,{className:"!p-[9px]",iconBefore:f.jsx(G.IconArrowLeft,{...Y}),onClick:()=>{y(!1),C?.("")}}):f.jsx("div",{className:M7,children:f.jsx(Mv,{pathItems:S,ariaLabel:e,labelClassName:t,className:c})}),[e,c,S,x,b,t,C]);return f.jsxs("div",{className:oe(T7,{"gap-3":b},l),"aria-label":"navigation-panel",children:[E(),d&&f.jsx("div",{className:oe(I7,{"w-[40px]":b&&!x,"w-full":b&&x}),role:"search","aria-label":"Search",onClick:F,children:f.jsx(ih,{id:h,value:u??"",onChange:C,disabled:p,onBlur:R,invalid:m,className:v,wrapperClassName:b&&!x?"pl-2.5":"",containerClassName:w})})]})},A7=({tabs:e,activeTab:t,onTabChange:s,areHiddenFilesVisible:o,onToggleHiddenFiles:i,isNewButtonVisible:n,isNewButtonDisabled:r,newButtonVariant:a=Ge.Primary,newButtonDropdownItems:l=[],newButtonLabel:c="New",hiddenFilesSwitcherLabel:d="Hidden files",showHiddenFilesLabel:u="Show hidden files",hideHiddenFilesLabel:h="Hide hidden files",showHiddenFilesToggle:p=!0,disabledNewButtonTooltip:m})=>{const C=hh(),v=g.useMemo(()=>[{key:"hidden-files-switch",label:o?h:u,icon:o?f.jsx(G.IconEyeOff,{...Y,className:"text-secondary"}):f.jsx(G.IconEye,{...Y,className:"text-secondary"}),onClick:()=>i?.(!o)}],[o,h,u,i]),w=()=>e&&t&&s?f.jsx(Ev,{tabs:e,activeTab:t,onClick:x=>s(x),screenThreshold:Qa.Tablet,smallScreenContainerClassName:"w-fit bg-transparent h-[38px] overflow-hidden",smallScreenDropdownItemClassName:"px-3 h-[38px]"}):null,b=()=>f.jsxs(f.Fragment,{children:[p&&f.jsxs(f.Fragment,{children:[f.jsx(oh,{switchId:"hidden-files-switch",label:d,isOn:o,onChange:i}),f.jsx("div",{className:"h-6 border-l border-primary"})]}),n&&f.jsx(yt,{tooltip:r&&m?m:void 0,children:f.jsx(Ud,{label:c,variant:a,items:l,disabled:r})})]}),S=()=>f.jsxs(f.Fragment,{children:[f.jsx(Ft,{menu:{items:v},allowedPlacements:["bottom","bottom-start"],children:f.jsx(ss,{className:"h-[38px]",iconBefore:f.jsx(G.IconDotsVertical,{...Y,className:"text-secondary hover:text-accent-primary"})})}),n?f.jsx(yt,{tooltip:r&&m?m:void 0,children:f.jsx(Ud,{label:c,variant:a,items:l,disabled:r})}):null]});return f.jsxs("div",{className:"flex w-full justify-between gap-4 items-center overflow-x-auto",children:[f.jsx("div",{className:"flex-1 min-w-0",children:w()}),f.jsx("div",{className:"flex gap-4 flex-shrink-0 items-center",children:C?S():b()})]})},L7=100,xn=16,hs="text-secondary",aa="text-primary min-w-0",O7="text-primary break-words min-w-0",Rn="bg-layer-2",N7=({open:e,onClose:t,fileMetadata:s,loading:o=!1,header:i="Information",nameLabel:n="Name:",pathLabel:r="Path:",modifiedDateLabel:a="Modified Date:",sizeLabel:l="Size:",authorLabel:c="Author:",dateLocale:d="en-US",dateOptions:u})=>f.jsx(Uo,{open:e,onClose:t,size:Wt.Sm,header:i,dividers:!1,children:f.jsx("div",{className:"px-6 py-4",children:f.jsx("div",{className:"grid gap-x-4 gap-y-4 items-center dial-small-text",style:{gridTemplateColumns:`${L7}px 1fr`},children:o?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:hs,children:n}),f.jsx(pi,{variant:Xt.Text,width:"100%",height:xn,className:Rn}),f.jsx("div",{className:hs,children:a}),f.jsx(pi,{variant:Xt.Text,width:"90%",height:xn,className:Rn}),f.jsx("div",{className:hs,children:l}),f.jsx(pi,{variant:Xt.Text,width:"60%",height:xn,className:Rn}),f.jsx("div",{className:hs,children:c}),f.jsx(pi,{variant:Xt.Text,width:"80%",height:xn,className:Rn}),f.jsx("div",{className:hs,children:r}),f.jsx(pi,{variant:Xt.Text,width:"70%",height:xn,className:Rn})]}):s?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:hs,children:n}),f.jsx("div",{className:aa,children:f.jsx(ht,{text:s.name})}),f.jsx("div",{className:hs,children:a}),f.jsx("div",{className:aa,children:f.jsx(ht,{text:XL(s.updatedAt,d,u)})}),f.jsx("div",{className:hs,children:l}),f.jsx("div",{className:aa,children:f.jsx(ht,{text:or(s.contentLength)})}),f.jsx("div",{className:hs,children:c}),f.jsx("div",{className:aa,children:f.jsx(ht,{text:s.author||"—"})}),f.jsx("div",{className:hs,children:r}),f.jsx("div",{className:O7,children:decodeURIComponent(s.path)})]}):null})})}),H7={size:10,stroke:2},G7=26;var _t=(e=>(e.File="file",e.Folder="folder",e))(_t||{});const B7=({name:e,type:t,shared:s=!1,loading:o=!1,sharedIndicatorClassName:i,sharedIndicatorTooltip:n,fileExtension:r,...a})=>{const l=c=>f.jsxs("span",{className:"inline-flex relative text-secondary",role:"img",children:[c,s&&f.jsx("span",{className:"absolute -bottom-0.5 -left-0.5",children:f.jsx(Wn,{className:i,sharedIndicatorTooltip:n})})]});if(o)return l(f.jsx(nr,{}));if(t===_t.File){const c=r||(e.includes(".")?e.split(".").pop():void 0);return f.jsx(iu,{...a,extension:c??"",className:"text-secondary",indicator:s?f.jsx(Wn,{className:i,sharedIndicatorTooltip:n}):null,label:"File type icon"})}return t===_t.Folder?l(f.jsx($e,{icon:f.jsx(G.IconFolder,{className:a.className,size:a.size??Y.size,stroke:a.stroke??Y.stroke}),className:"inline-block align-middle"})):null},V7=({name:e,type:t,elementId:s,loading:o=!1,shared:i=!1,iconClassName:n,iconIndicator:r,iconLabel:a,iconSize:l,iconStroke:c,inputInvalid:d,inputInvalidMessage:u,inputContainerClassName:h,inputIconAfter:p,inputRef:m,onChange:C,sharedIndicatorClassName:v,sharedIndicatorTooltip:w,fileExtension:b})=>{const S=()=>{const x=u?.startsWith(`${is.Warning}__`);if(!d&&!x)return null;const y=u?.replace(`${is.Warning}__`,"");return f.jsx(yt,{tooltip:y,children:p||(x?f.jsx(G.IconAlertTriangleFilled,{...Y,className:"text-warning-icon","aria-label":"warning"}):f.jsx(G.IconAlertCircleFilled,{...Y,className:"text-error","aria-label":"alert"}))})};return f.jsxs("div",{className:"flex gap-2 items-center",children:[f.jsx(B7,{name:e,type:t,label:a,className:n,indicator:r,size:l,stroke:c,loading:o,shared:i,fileExtension:b,sharedIndicatorClassName:v,sharedIndicatorTooltip:w}),f.jsx(Zi,{containerClassName:oe("!h-6 py-[1px] pl-[7px] pr-[7px]",h),id:s,value:e,onChange:C,invalid:d,iconAfter:S(),inputRef:m})]})};function rw({value:e,isEditing:t,restoreOnCancel:s=!0,onValidate:o,onSave:i,onCancel:n}){const[r,a]=g.useState(e),[l,c]=g.useState(!1),[d,u]=g.useState(""),h=g.useRef(null),p=g.useCallback((b=!1,S="")=>{c(b),u(S)},[]),m=g.useCallback(b=>{if(!o)return p(),!0;const S=o(b);return S?S.startsWith(`${is.Warning}__`)?(p(!1,S),!0):(p(!0,S),!1):(p(),!0)},[o,p]),C=g.useCallback(b=>{const S=b??"";a(S),m(S)},[m]),v=g.useCallback(()=>{m(r)?i?.(r):h.current?.focus()},[m,i,r]),w=g.useCallback(()=>{s&&a(e),p(),n?.()},[e,n,s,p]);return g.useEffect(()=>{t&&(a(e),p(),requestAnimationFrame(()=>{h.current?.focus(),h.current?.select()}))},[t,e,p]),g.useEffect(()=>{const b=h.current;if(!t||!b)return;const S=x=>{x.key==="Enter"?(x.preventDefault(),h.current?.blur()):x.key==="Escape"&&(x.preventDefault(),w())};return b.addEventListener("keydown",S),()=>b.removeEventListener("keydown",S)},[t,v,w]),g.useEffect(()=>{if(!t)return;const b=h.current;if(!b)return;const S=x=>{const y=x.relatedTarget;y&&b.contains(y)||(m(r)?v():b.focus())};return b.addEventListener("blur",S),()=>{b.removeEventListener("blur",S)}},[t,r,m,v]),{inputRef:h,value:r,onChange:C,invalid:l,invalidMessage:d}}const tl=({name:e,type:t,elementId:s,editing:o=!1,loading:i=!1,shared:n=!1,iconSize:r=Nt,validate:a,onSave:l,fileExtension:c,onCancel:d,inputContainerClassName:u,sharedIndicatorClassName:h,sharedIndicatorTooltip:p,hideTooltip:m=!1,forbiddenSymbolsRegExp:C,forbiddenSymbolsTooltip:v,...w})=>{const{value:b,invalid:S,invalidMessage:x,onChange:y,inputRef:F}=rw({value:e,isEditing:o,onValidate:a,onCancel:d,onSave:l});if(!o){const R=dh({name:e,isFolder:t===_t.Folder},C,v),E=!!R;return t===_t.Folder?f.jsx(cl,{name:e,loading:i,shared:n,iconSize:r,className:"max-w-[428px] truncate",sharedIndicatorClassName:h,hideTooltip:m,isInvalidName:E,tooltipContent:R}):f.jsx(ll,{className:"max-w-[428px]",...w,name:e,shared:n,iconSize:r,sharedIndicatorClassName:h,hideTooltip:m,isInvalidName:E,tooltipContent:R})}return f.jsx(V7,{type:t,name:b,elementId:s,inputInvalid:S,inputInvalidMessage:x,inputRef:F,onChange:y,iconSize:r,fileExtension:c,inputContainerClassName:u,sharedIndicatorTooltip:p,sharedIndicatorClassName:h})},z7=({items:e,showFiles:t=!1,expandedPaths:s,loadingPaths:o=new Set,loadedPaths:i=new Set,sharedByMePaths:n=new Set,selectedPath:r,emptyStateTitle:a="No Folders",emptyStateDescription:l,emptyStateIcon:c,areHiddenFilesVisible:d=!1,renamedPath:u,rootItemLabel:h,rootItemPath:p,onItemClick:m,getContextMenuItems:C,onRenameSave:v,onRenameCancel:w,onRenameValidate:b,onExpandedPathsChange:S,forbiddenSymbolsRegExp:x,forbiddenSymbolsTooltip:y})=>{const{expandedPaths:F,togglePath:R}=tw({expandedPaths:s??new Set,onExpandedPathsChange:S}),E=P=>{m?.(P),R(P.path)},D=(P,T)=>P.map(M=>{const{path:k,nodeType:N,name:A,items:W}=M,U=N===be.FOLDER;if(!d&&Zv(M))return null;if(!U&&!t)return;const L=Array.isArray(W)&&W.length>0&&W.some($=>$.nodeType===be.FOLDER||t),de=F.has(k),H=r===k,te=o.has(k),Q=u===k,J=i.has(k),me=n.has(k),Re=p&&h&&k===p&&U,ne=b&&($=>b($,M)),_=H?"bg-accent-primary-alpha border-l-2 border-l-accent-primary rounded":"border-l-2 border-l-transparent",Fe=Re?[]:C?.(M)??[],ie=x?dh({name:M.name,isFolder:U},x,y):void 0;return f.jsx("div",{className:"cursor-pointer text-secondary",children:f.jsxs("div",{className:"flex flex-col w-full","aria-label":"folder",children:[f.jsx(Ft,{trigger:[Ht.ContextMenu],className:"w-full",anchorToMouse:!0,menu:{items:Fe},children:f.jsxs("div",{style:{paddingLeft:`${T*G7}px`},className:oe("py-1 gap-[2px] dial-small-text flex justify-between hover:bg-accent-primary-alpha rounded group/item w-full mb-[2px] relative",_),"aria-selected":H,children:[!Q&&f.jsx("div",{className:"absolute size-full left-0 top-0 z-0",onClick:()=>E(M)}),f.jsx("div",{className:"relative flex flex-row truncate items-center w-fit h-6 gap-x-1 pl-1",onClick:()=>!Q&&E(M),children:f.jsxs(f.Fragment,{children:[U&&f.jsx(G.IconCaretRightFilled,{...H7,className:ue("flex-shrink-0",de&&"rotate-90 transition-all",J&&!L&&"text-transparent")}),f.jsx(tl,{elementId:`${k}-tree-item`,name:Re?h:A,type:U?_t.Folder:_t.File,loading:te,shared:me,sharedIndicatorClassName:oe("group-hover/item:bg-accent-primary-alpha",H&&"bg-accent-primary-alpha"),iconSize:Js,forbiddenSymbolsRegExp:x,forbiddenSymbolsTooltip:ie,...!Re&&{editing:Q,onSave:v,onCancel:w,validate:ne}})]})}),Fe.length>0&&!Q&&!Re&&f.jsx("div",{className:"flex-1 flex justify-end",children:f.jsx(Ft,{placement:"bottom-start",allowedPlacements:["top-start","top-end"],menu:{items:Fe},className:"sticky right-0",children:f.jsx($e,{className:"invisible group-hover/item:visible text-secondary mx-2 flex flex-row gap-2 hover:text-accent-primary",icon:f.jsx(G.IconDotsVertical,{...Y})})})})]})}),de&&W&&D(W,T+1)]})},`${k}-children`)});return f.jsx("div",{className:"flex-1 w-full h-full overflow-y-auto","aria-label":"folders-tree",children:e.length>0?D(e,0):f.jsx(rr,{title:a,description:l,icon:c})})},W7=({selectedFiles:e,actionLabels:t,onDuplicate:s,onCopy:o,onMove:i,onDownload:n,onUnshare:r,onRemoveAccess:a,onDelete:l,getCurrentFolderPath:c,sharedWithMeIds:d,sharedByMePaths:u,onClearSelection:h,forbiddenSymbolsRegExp:p})=>g.useMemo(()=>{const m=[],C=Array.from(e.values());if(!C.length||!t)return m;const v=Sl(p),w=v?C.some(b=>v.test(b.name)):!1;if(t[K.Move]&&!w&&m.push({key:K.Move,label:t[K.Move],title:t[K.Move],icon:f.jsx(ah,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>i(C)}),t[K.Copy]&&!w&&m.push({key:K.Copy,label:t[K.Copy],title:t[K.Copy],icon:f.jsx(rh,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>o(C)}),t[K.Duplicate]&&!w&&m.push({key:K.Duplicate,label:t[K.Duplicate],title:t[K.Duplicate],icon:f.jsx(G.IconCopy,{...Y,className:"text-secondary"}),onClick:()=>s(C)}),t[K.Delete]){const b=C.some(S=>S.permissions&&!S.permissions.includes($o.WRITE));m.push({key:K.Delete,label:t[K.Delete],title:t[K.Delete],icon:f.jsx(G.IconTrashX,{...Y,className:"text-secondary"}),disabled:b,tooltip:b?"Selected items contain item which can not be deleted":void 0,onClick:()=>{const S=c();l(C,S)}})}if(t[K.Download]&&!w&&m.push({key:K.Download,label:t[K.Download],title:t[K.Download],icon:f.jsx(G.IconDownload,{...Y,className:"text-secondary"}),onClick:()=>n(C)}),t[K.Unshare]&&r){const b=C.some(S=>!d?.includes(S.path));m.push({key:K.Unshare,label:t[K.Unshare],title:t[K.Unshare],disabled:b,icon:f.jsx(lh,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>{r(C),h()}})}if(t[K.RemoveAccess]&&a){const b=C.some(S=>!u?.has(S.path));m.push({key:K.RemoveAccess,label:t[K.RemoveAccess],title:t[K.RemoveAccess],disabled:b,icon:f.jsx(G.IconUserX,{size:Y.size,className:"text-secondary"}),onClick:()=>{a(C),h()}})}return m},[e,t,r,a,i,o,s,c,l,n,d,h,u,p]);function gh(e){if(!e)return null;if(e instanceof Date)return isFinite(e.getTime())?e:null;if(typeof e=="number"){const t=new Date(e);return isFinite(t.getTime())?t:null}if(typeof e=="string"){const t=e.trim();if(/^-?\d+$/.test(t)){const o=Number(t);return gh(o)}const s=new Date(t);return isFinite(s.getTime())?s:null}return null}const aw=({value:e,locale:t=xv,options:s=Rv,emptyPlaceholder:o,className:i,hideTooltip:n=!1})=>{const r=gh(e),a=g.useMemo(()=>r?new Intl.DateTimeFormat(t,s).format(r):o,[r,o,t,s]),l=r?r.toISOString():void 0;return f.jsx(ht,{text:l?f.jsx("time",{dateTime:l,children:a}):f.jsx("span",{children:a}),className:ue(h8,i),hideTooltip:n})},_7=({id:e,name:t,nodeType:s,size:o,updatedAt:i,dateLocale:n,dateOptions:r,shared:a,sharedIndicatorClassName:l,hideTooltip:c=!1,forbiddenSymbolsRegExp:d,forbiddenSymbolsTooltip:u})=>f.jsx("div",{className:"flex",children:f.jsx("div",{className:"flex flex-1 min-w-0",children:f.jsx(tl,{type:s===be.FOLDER?_t.Folder:_t.File,name:t,elementId:e,shared:a,iconSize:Js,sharedIndicatorClassName:l,hideTooltip:c,forbiddenSymbolsRegExp:d,forbiddenSymbolsTooltip:u,details:f.jsxs("div",{className:"flex items-center gap-1 dial-tiny-text text-secondary",children:[f.jsx("span",{children:s===be.ITEM?or(o):""}),i&&o&&f.jsx(G.IconCircleFilled,{size:2,className:"text-secondary"}),i?f.jsx("span",{children:f.jsx(aw,{value:i,locale:n?.toString(),options:r,className:"dial-tiny-text text-secondary",hideTooltip:c})}):null]})})})}),lw=e=>(t,s,o)=>({colId:at.Name,field:"name",headerName:e,flex:1,minWidth:200,cellRenderer:i=>{const n=i.data.nodeType,{saveFolderCreation:r,validateFolderName:a,cancelFolderCreation:l,newFolderTempId:c,sharedByMePaths:d,selectedPaths:u,disabledRowIds:h}=i.context,p=d?.has(i.data.path),m=u?.has(i.data.path),C=h?.has(i.data.path)??!1,v=oe(["group-hover/grid-row:bg-accent-primary-alpha",m&&"bg-accent-primary-alpha"]);if(i.data?.isTemporary&&i.data.id===c)return f.jsx(tl,{name:"",type:_t.Folder,elementId:`new-folder-${i.data.id}`,editing:!0,shared:p,sharedIndicatorClassName:v,iconSize:Js,validate:a,onSave:r,onCancel:l,inputContainerClassName:oe(["!h-9",o&&n===be.ITEM&&"!h-10"])});const{renameTriggerView:w,renamedPath:b,renamedItem:S,getDisplayName:x,onRenameValidate:y,onRenameSave:F,onRenameCancel:R}=i.context;if(w===Ii.Grid&&b===i.data?.path&&S&&i.data){const P=x(S);return f.jsx(tl,{name:P,type:n===be.FOLDER?_t.Folder:_t.File,fileExtension:S.name.split(".").pop(),elementId:`rename-${i.data.id}`,editing:!0,shared:p,sharedIndicatorClassName:v,iconSize:Js,validate:T=>y(T,S),onSave:F,onCancel:R,inputContainerClassName:oe(["!h-9",o&&n===be.ITEM&&"!h-10"]),forbiddenSymbolsRegExp:i.context.forbiddenSymbolsRegExp})}if(o)return f.jsx(_7,{id:i.data.id,name:i.data.name,nodeType:n,size:i.data.size,shared:p,sharedIndicatorClassName:v,updatedAt:i.data.updatedAt,dateLocale:t,dateOptions:s,hideTooltip:C,forbiddenSymbolsRegExp:i.context.forbiddenSymbolsRegExp,forbiddenSymbolsTooltip:i.context.forbiddenSymbolsTooltip});const D=dh({name:i.data.name,isFolder:n===be.FOLDER},i.context.forbiddenSymbolsRegExp,i.context.forbiddenSymbolsTooltip);return n===be.FOLDER?f.jsx(cl,{name:i.data.name,shared:p,sharedIndicatorClassName:v,iconSize:Js,hideTooltip:C,isInvalidName:!!D,tooltipContent:D}):f.jsx(ll,{name:i.data.name,shared:p,sharedIndicatorClassName:v,iconSize:Js,hideTooltip:C,isInvalidName:!!D,tooltipContent:D})}}),cw=e=>(t,s)=>({colId:at.UpdatedAt,field:"updatedAt",headerName:e,width:168,suppressSizeToFit:!0,cellRenderer:o=>{const i=o.context?.disabledRowIds?.has(o.data?.path)??!1;return f.jsx(aw,{...o,hideTooltip:i})},cellRendererParams:{locale:t,options:s},filterValueGetter:o=>{const i=o.data[o.colDef.field||""],n=gh(i);return n?new Intl.DateTimeFormat(t||xv,s||Rv).format(n):""}}),dw=e=>({colId:at.Size,field:"size",headerName:e,width:120,suppressSizeToFit:!0,cellRenderer:t=>t.data.nodeType===be.ITEM?or(t.data.contentLength):"",filterValueGetter:t=>t.data.nodeType===be.ITEM?or(t.data.contentLength):""}),j7=e=>{const t=e.event;if(!(t?.target??null)?.closest("input")||!t)return!1;switch(t.key){case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":case"Home":case"End":return!0;default:return!1}};function U7({userColumnDefs:e,filterable:t,dateLocale:s,dateOptions:o,effectiveVisibleColumns:i,isCompactView:n,hasActions:r,actionsColumnDef:a,rootItemLabel:l,rootItemPath:c}){const d=g.useMemo(()=>[lw("Name")(s,o,n),{colId:at.Path,field:"path",headerName:"Path",flex:1,minWidth:200,cellRenderer:h=>{const p=h.context?.disabledRowIds?.has(h.data.path)??!1;let m=h.data.path;if(h.context?.hideSearchPathItemName&&(h.data.parentPath?m=h.data.parentPath:m=m.replace(/\/[^/]+\/?$/,"")||"/"),!c||!l)return f.jsx(ht,{text:m,hideTooltip:p});const C=m.replace(c,l);return f.jsx(ht,{text:C,hideTooltip:p})}},cw("Modified Date")(s,o),dw("Size"),{colId:at.Author,field:"author",headerName:"Author",width:200,suppressSizeToFit:!0,cellRenderer:h=>h.data.author},{colId:at.Owner,field:"owner",headerName:"Owner",width:200,suppressSizeToFit:!0,cellRenderer:h=>h.data.owner}],[s,o,n,l,c]);return{columnDefs:g.useMemo(()=>{const h=e?.map(C=>typeof C=="function"?C(s,o,n):C);let p=h??d;h||(p=p.filter(C=>C.colId&&i.includes(C.colId))),r&&(n&&(p=p.slice(0,1)),p.push(a));const m=C=>C.colId===at.Name;return p.map(C=>{const v={...C,filter:t?C.filter:!1,floatingFilter:t?C.floatingFilter:!1};return m(C)&&!C.suppressKeyboardEvent&&(v.suppressKeyboardEvent=j7),v})},[a,s,o,d,i,t,r,n,e])}}const uw=()=>{const e=g.useContext(Jv);if(!e)throw new Error("useFileManagerContext must be used within <FileManagerProvider>");return e},$7=({actionLabels:e,onDuplicate:t,onCopy:s,onMove:o,onDownload:i,onRename:n,onDelete:r,onInfo:a,onUnshare:l,onRemoveAccess:c,sharedWithMeIds:d,sharedByMePaths:u,onAddSibling:h,onAddChild:p,onManagePermissions:m,onPreview:C,onOpenInNewTab:v,previewExtensions:w,isRenameFileAvailable:b=!0,isDuplicateFolderAvailable:S=!0,forbiddenSymbolsRegExp:x})=>g.useMemo(()=>y=>{const F=[];if(!e)return F;const R=Sl(x)?.test(y.name);e[K.AddSibling]&&typeof h=="function"&&y.nodeType===be.FOLDER&&F.push({key:"addSibling",label:e[K.AddSibling],icon:f.jsx(Yv,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>h(y)}),e[K.AddChild]&&typeof p=="function"&&y.nodeType===be.FOLDER&&!R&&F.push({key:"addChild",label:e[K.AddChild],icon:f.jsx(Kv,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>p(y)},{key:"divider",type:Bi.Divider});const E=y.nodeType===be.ITEM||y.nodeType===be.FOLDER&&S;e[K.Duplicate]&&E&&!R&&F.push({key:K.Duplicate,label:e[K.Duplicate],icon:f.jsx(G.IconCopy,{...Y,className:"text-secondary"}),onClick:()=>t(y)}),e[K.Copy]&&!R&&F.push({key:K.Copy,label:e[K.Copy],icon:f.jsx(rh,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>s(y)}),e[K.Move]&&!R&&F.push({key:K.Move,label:e[K.Move],icon:f.jsx(ah,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>o(y)}),e[K.Download]&&!R&&F.push({key:K.Download,label:e[K.Download],icon:f.jsx(G.IconDownload,{...Y,className:"text-secondary"}),onClick:()=>i(y)}),e[K.ManagePermissions]&&typeof m=="function"&&y.nodeType===be.FOLDER&&!R&&F.push({key:K.ManagePermissions,label:e[K.ManagePermissions],icon:f.jsx(G.IconExternalLink,{...Y,className:"text-secondary"}),onClick:()=>m?.(y.path)});const D=y.name.split("."),P=D.length>1?D[D.length-1]:"",T=P&&w?.includes(`.${P}`);e[K.Preview]&&typeof C=="function"&&y.nodeType===be.ITEM&&T&&!R&&F.push({key:K.Preview,label:e[K.Preview],icon:f.jsx(G.IconEye,{...Y,className:"text-secondary"}),onClick:()=>C?.(y.path)}),e[K.OpenInNewTab]&&typeof v=="function"&&y.nodeType===be.ITEM&&!R&&F.push({key:K.OpenInNewTab,label:e[K.OpenInNewTab],icon:f.jsx(G.IconExternalLink,{...Y,className:"text-secondary"}),onClick:()=>v?.(y)});const M=!y.permissions||y.permissions.includes($o.WRITE);e[K.Delete]&&M&&F.push({key:K.Delete,label:e[K.Delete],icon:f.jsx(G.IconTrashX,{...Y,className:"text-secondary"}),onClick:()=>r(y,y.parentPath??"")});const k=y.nodeType===be.FOLDER||y.nodeType===be.ITEM&&b;return e[K.Rename]&&k&&F.push({key:K.Rename,label:e[K.Rename],icon:f.jsx(G.IconPencilMinus,{...Y,className:"text-secondary"}),onClick:()=>n(y.path)}),e[K.Info]&&y.nodeType===be.ITEM&&!R&&F.push({key:K.Info,label:e[K.Info],icon:f.jsx(G.IconInfoCircle,{...Y,className:"text-secondary"}),onClick:()=>a(y)}),e[K.Unshare]&&d?.includes(y.path)&&F.push({key:K.Unshare,label:e[K.Unshare],icon:f.jsx(lh,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>l(y)}),e[K.RemoveAccess]&&u?.has(y.path)&&c&&F.push({key:K.RemoveAccess,label:e[K.RemoveAccess],icon:f.jsx(G.IconUserX,{size:Y.size,className:"text-secondary"}),onClick:()=>c(y)}),F},[e,h,p,t,s,o,i,r,n,a,l,c,d,u,m,C,v,w,b,S,x]),hw=e=>f.jsx(iw,{...e,children:f.jsx(q7,{})}),q7=()=>{const{managerLabel:e,className:t,items:s,rootItem:o,filesLoading:i,treeOptions:n,showNavigationPanel:r,navigationPanelOptions:a,gridOptions:l,toolbarOptions:c,bulkActionsToolbarOptions:d,deleteConfirmationOptions:u,destinationFolderPopupOptions:h,conflictResolutionPopupOptions:p,compactViewWidthBreakpoint:m=jL,customBreakpointRef:C,sharedByMePaths:v,allowedFileTypes:w,maxSelectableFileSize:b,areHiddenFilesVisible:S,toggleHiddenFilesVisibility:x,isTreeCollapsed:y,toggleTreeCollapse:F,currentPath:R,gridRows:E,selectedPaths:D,selectedFiles:P,clearSelection:T,setSelectedPaths:M,effectiveSearchValue:k,handleBreadcrumbItemClick:N,handleSearchChange:A,handleTreeItemClick:W,handleTableRowClick:U,handleSelectionClick:L,onGridApiChange:de,handleOpenDestinationFolderPopup:H,handleCloseDestinationFolderPopup:te,openDestinationFolderPopup:Q,destinationFolderMode:J,handleSetCopiedFiles:me,handleSetMovedFiles:Re,handleDuplicate:ne,handleCopyTo:_,handleMoveTo:Fe,handleAddSibling:ie,handleAddChild:$,handleDownloadFiles:q,openDeleteConfirmation:se,closeDeleteConfirmation:B,confirmDelete:pe,deleteConfirmationOpen:le,itemsToDelete:re,renamedPath:Ce,renamedItem:xe,onRename:Le,onRenameSave:fe,onRenameCancel:De,onRenameValidate:ze,forbiddenSymbolsRegExp:Ne,forbiddenSymbolsTooltip:Ve,getDisplayName:kt,isDragging:Et,isDraggingOverWindow:Ut,handleDragEnter:V,handleDragLeave:Ee,handleDragOver:At,handleDrop:Xi,onUploadFiles:yl,onValidateUpload:xl,maxFileSize:Rl,newActions:uo,isNewButtonVisible:Qi,isNewButtonDisabled:qo,newFolderTempId:fr,cancelFolderCreation:Ko,saveFolderCreation:mr,validateFolderName:Cr,startFolderCreation:vr,conflictingFiles:Fl,conflictResolutionOpen:Ji,handleConflictReplace:Rs,handleConflictDuplicate:El,handleConflictCancel:Dl,handleConflictDecideForEach:ot,uploadConflictingFiles:Pl,uploadConflictResolutionOpen:Fs,handleUploadConflictReplace:en,handleUploadConflictDuplicate:tn,handleUploadConflictCancel:sn,handleUploadConflictDecideForEach:Tl,openMetadataPopup:Ml,fileMetadataPopupOptions:ds,isMetadataPopupOpen:on,selectedFileForMetadata:Yo,closeMetadataPopup:Il,onUnshareFiles:Zo,onRemoveFilesAccess:Xo,actionsRef:kl,searchInProgress:wr,isSearchMode:Qo,emptyStateIcon:br,emptyStateTitle:Sr="You don't have any files",emptyStateDescription:yr="Upload or drag and drop files",sharedWithMeIds:Jo,onFolderPopupPathChange:Al,onManagePermissions:zs,onPreview:Ll,onOpenInNewTab:nn,previewExtensions:Ol,isRenameFileAvailable:Nl,isDuplicateFolderAvailable:Dt,getDisabledTooltip:xr,fileTooLargeTooltip:et,unsupportedFileTypeTooltip:Rr,gridClassName:Hl,nonClickableTableColumns:rn,hideSearchPathItemName:Fr}=uw(),{width:Gl=GL,header:ei=BL,containerClassName:Er=OL,additionalButtons:Dr,...Pr}=n??{},[ti,Tr]=g.useState(Gl),{renameTriggerView:si,onGridRename:Bl,onTreeRename:Mr}=qL({onRename:Le}),an=g.useRef(null),Vl=j=>{an.current===null&&(an.current=requestAnimationFrame(()=>{Tr(j),an.current=null}))},{columnDefs:zl,filterable:Wl=!0,dateLocale:_l,dateOptions:jl,selectionMode:Ir,wrapCustomCellRenderers:kr,visibleColumns:Ar=UL,allowDisabledContextMenu:oi=!1,...Ws}=l??{},{containerRef:Ul,isBelowBreakpoint:vt}=KL(m,C),$l=g.useMemo(()=>Qo?[at.Name,at.Path,at.Actions]:Ar,[Qo,Ar]),ln=g.useCallback((j,We,Ke)=>JL(j,We,Ke,Rr,et),[et,Rr]),ii=g.useCallback((j,We,Ke)=>!!ln(j,We,Ke),[ln]),_s=g.useMemo(()=>{const j=new Set;for(const We of E)ii(We,w,b)&&j.add(We.path);return j},[w,b,E,ii]),Lr=g.useCallback(j=>{const We=[],Ke=[],$t=!j.parentPath,ho=Ne?.test(j.name);return n?.actionLabels&&(n.actionLabels[K.AddSibling]&&typeof ie=="function"&&j.nodeType===be.FOLDER&&!$t&&We.push({key:"addSibling",label:n.actionLabels[K.AddSibling],icon:f.jsx(Yv,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>ie([j])}),n.actionLabels[K.AddChild]&&typeof $=="function"&&j.nodeType===be.FOLDER&&!ho&&We.push({key:"addChild",label:n.actionLabels[K.AddChild],icon:f.jsx(Kv,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>$([j])}),n.actionLabels[K.Duplicate]&&!$t&&!ho&&Ke.push({key:"duplicate",label:n.actionLabels[K.Duplicate],icon:f.jsx(G.IconCopy,{...Y,className:"text-secondary"}),onClick:()=>ne([j])}),n.actionLabels[K.Copy]&&!$t&&!ho&&Ke.push({key:rt.Copy,label:n.actionLabels[K.Copy],icon:f.jsx(rh,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>{me([j]),H(rt.Copy)}}),n.actionLabels[K.Move]&&!$t&&!ho&&Ke.push({key:rt.Move,label:n.actionLabels[K.Move],icon:f.jsx(ah,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>{Re([j]),H(rt.Move)}}),n.actionLabels[K.Download]&&!$t&&!ho&&Ke.push({key:"download",label:n.actionLabels[K.Download],icon:f.jsx(G.IconDownload,{...Y,className:"text-secondary"}),onClick:()=>q([j])}),n.actionLabels[K.Rename]&&!$t&&Ke.push({key:"rename",label:n.actionLabels[K.Rename],icon:f.jsx(G.IconPencilMinus,{...Y,className:"text-secondary"}),onClick:()=>Mr(j.path)}),n.actionLabels[K.Unshare]&&Jo?.includes(j.path)&&!$t&&Ke.push({key:"unshare",label:n.actionLabels[K.Unshare],icon:f.jsx(lh,{width:Y.size,height:Y.size,className:"text-secondary"}),onClick:()=>Zo?.([j])}),n.actionLabels[K.RemoveAccess]&&v?.has(j.path)&&!$t&&Ke.push({key:K.RemoveAccess,label:n.actionLabels[K.RemoveAccess],icon:f.jsx(G.IconUserX,{size:Y.size,className:"text-secondary"}),onClick:()=>Xo?.([j])}),n.actionLabels[K.ManagePermissions]&&typeof zs=="function"&&j.nodeType===be.FOLDER&&!$t&&Ke.push({key:K.ManagePermissions,label:n.actionLabels[K.ManagePermissions],icon:f.jsx(G.IconExternalLink,{...Y,className:"text-secondary"}),onClick:()=>zs?.(j.path)}),n.actionLabels[K.Delete]&&j.permissions?.includes($o.WRITE)&&!$t&&Ke.push({key:"delete",label:n.actionLabels[K.Delete],icon:f.jsx(G.IconTrashX,{...Y,className:"text-secondary"}),onClick:()=>se([j],j.parentPath??"")})),We.length?Ke.length===0?We:We.length===0?Ke:[...We,{key:"divider",type:Bi.Divider},...Ke]:Ke},[n?.actionLabels,ie,Ne,$,zs,ne,me,H,Re,q,Mr,Zo,Xo,Jo,v,se]),cn=g.useMemo(()=>{const j=new Set;return P.forEach((We,Ke)=>j.add(Ke)),j},[P]),Or=g.useCallback((j,We)=>{M(j),L?.(We)},[L,M]),dn=W7({selectedFiles:P,actionLabels:d?.actionLabels,onDuplicate:ne,onCopy:j=>{me(j),H(rt.Copy)},onMove:j=>{Re(j),H(rt.Move)},onDownload:q,onDelete:se,onUnshare:Zo,onRemoveAccess:Xo,getCurrentFolderPath:()=>R??"/",sharedWithMeIds:Jo,sharedByMePaths:v,onClearSelection:T,forbiddenSymbolsRegExp:Ne}),Nr=g.useCallback(j=>{c?.onTabChange?.(j),Ko()},[c,Ko]),ql=g.useCallback(()=>c&&D.size===0?f.jsxs("div",{className:yp,role:"toolbar","aria-label":"File Manager Toolbar",children:[e,f.jsx(A7,{...c,onTabChange:Nr,areHiddenFilesVisible:S,onToggleHiddenFiles:x,isNewButtonVisible:Qi,isNewButtonDisabled:qo,newButtonDropdownItems:uo})]}):D.size>0&&d?f.jsx("div",{className:yp,role:"toolbar","aria-label":"File Manager Toolbar",children:f.jsx(D7,{...d,selectedCount:D.size,onClearSelection:T,actions:dn})}):null,[Nr,d,D,T,dn,S,x,c,Qi,qo,uo,e]);g.useImperativeHandle(kl,()=>({createFolder:vr}),[vr]);const Kl=g.useCallback(()=>vt?null:f.jsx("aside",{role:"region","aria-label":"File Manager Tree Navigation",className:"min-h-0 min-w-0 h-full flex-none",children:f.jsx(of,{defaultWidth:ti,width:ti,onResizeStop:Tr,onResize:Vl,minWidth:zL,maxWidth:WL,enabled:!y,children:f.jsx(_p,{width:ti,title:ei,containerClassName:Er,titleClassName:"dial-body-text text-primary",additionalButtons:Dr,isOpened:!y,onToggle:F,children:f.jsx(z7,{...Pr,items:s,rootItemPath:o?.path,rootItemLabel:o?.label,selectedPath:R,sharedByMePaths:v,forbiddenSymbolsRegExp:Ne,forbiddenSymbolsTooltip:Ve,onItemClick:W,areHiddenFilesVisible:S,getContextMenuItems:Lr,renamedPath:si===Ii.Tree?Ce:void 0,onRenameSave:fe,onRenameCancel:De,onRenameValidate:ze})})})}),[vt,ti,y,ei,Er,Dr,F,Pr,s,o?.path,o?.label,R,v,Ne,Ve,W,S,Lr,si,Ce,fe,De,ze]),Hr=$7({actionLabels:l?.actionLabels,onDuplicate:j=>ne([j]),onCopy:j=>{me([j]),H(rt.Copy)},onMove:j=>{Re([j]),H(rt.Move)},onDownload:j=>q([j]),onRename:Bl,onDelete:(j,We)=>se([j],We),onInfo:j=>Ml(j),onUnshare:j=>Zo?.([j]),onRemoveAccess:j=>Xo?.([j]),sharedWithMeIds:Jo,sharedByMePaths:v,onAddChild:j=>$?.([j]),onAddSibling:j=>ie?.([j]),onManagePermissions:j=>zs?.(j),onPreview:j=>Ll?.(j),onOpenInNewTab:j=>nn?.(j),previewExtensions:Ol,isRenameFileAvailable:Nl,isDuplicateFolderAvailable:Dt,forbiddenSymbolsRegExp:Ne}),un=g.useCallback(j=>{const We=Go(s,j.path);return We?Hr(We):[]},[s,Hr]),Yl=g.useCallback((j,We,Ke)=>oi?!1:ii(j,We,Ke),[oi,ii]),{actionsColumnDef:Zl}=$L({getContextMenuItems:un,isRowDisabled:Yl,allowedFileTypes:w,buttonClassName:vt?"":HL}),{columnDefs:hn}=U7({userColumnDefs:zl,filterable:Wl,dateLocale:_l,dateOptions:jl,effectiveVisibleColumns:$l,isCompactView:vt,hasActions:!!l?.actionLabels,actionsColumnDef:Zl,rootItemLabel:o?.label,rootItemPath:o?.path}),gn=g.useCallback(j=>{j.colDef.colId==="ag-Grid-SelectionColumn"||j.colDef.colId===at.Actions||Ce&&j.data?.path===Ce||j.data?.isTemporary||rn&&rn.includes(j.colDef.colId)||j.data&&U(j.data)},[Ce,U,rn]),Gr=g.useCallback(()=>f.jsx(rr,{title:Sr,description:yr,descriptionClassName:"text-sm",containerClassName:"gap-3 size-full bg-layer-2 border rounded-[4px] border-primary",titleClassName:"mt-2 !text-lg",icon:br||f.jsx(G.IconFileDescription,{size:100,stroke:.5,className:"text-secondary"})}),[yr,br,Sr]),Br=g.useMemo(()=>j=>j.path,[]),Vr=g.useMemo(()=>ue(Et?"border border-dashed border-accent-primary":"",Ut&&!Et?"border border-dashed border-primary":""),[Et,Ut]),zr=g.useMemo(()=>({...Ws.additionalGridOptions,onCellClicked:gn,headerHeight:Xc,rowHeight:Xc,rowClass:"group/grid-row",defaultColDef:{...Ws.additionalGridOptions?.defaultColDef,floatingFilter:a?.searchable?!1:Ws.additionalGridOptions?.defaultColDef?.floatingFilter},...vt?{getRowHeight:j=>j.data?.nodeType===be.FOLDER?Xc:_L}:{},context:{cancelFolderCreation:Ko,saveFolderCreation:mr,getDisplayName:kt,onRenameCancel:De,onRenameSave:fe,onRenameValidate:ze,renameTriggerView:si,validateFolderName:Cr,renamedItem:xe,renamedPath:Ce,newFolderTempId:fr,sharedByMePaths:v,selectedPaths:D,disabledRowIds:_s,forbiddenSymbolsRegExp:Ne,forbiddenSymbolsTooltip:Ve,hideSearchPathItemName:Fr}}),[Ws.additionalGridOptions,gn,a?.searchable,vt,Ko,mr,kt,De,fe,ze,si,Cr,xe,Ce,fr,v,D,_s,Ne,Ve,Fr]),ni=g.useMemo(()=>E.length===0&&!Qo&&!i?Gr():f.jsx(th,{columnDefs:hn,rowData:E,getRowId:Br,loading:i||wr,getContextMenuItems:un,withoutHeaderBorders:vt,selectionOnHover:!vt,onGridApiChange:de,className:Vr,...Ws,selectionMode:Ir,wrapCustomCellRenderers:kr,additionalGridOptions:zr,selectedRowIds:cn,onSelectionChange:Or,wrapperBorder:!Et&&!Ut,disabledRowIds:_s,allowDisabledContextMenu:oi}),[E,Qo,i,Gr,hn,Br,wr,un,vt,de,Vr,Ws,Ir,kr,zr,cn,Or,Et,Ut,_s,oi]);return f.jsx("section",{ref:Ul,className:"size-full",children:f.jsxs("div",{className:oe(kL,{"gap-3 pt-4":d&&D.size>0,"gap-4 p-3 pt-4":vt,"gap-2 pt-2":vt&&d&&D.size>0},t),children:[ql(),f.jsxs("div",{className:oe(AL,Hl),children:[Kl(),f.jsxs("div",{className:oe(LL,{"gap-3":vt}),children:[r&&f.jsx(k7,{...a??{},makeHref:j=>j.join("/"),path:R,onItemClick:N,rootItemPath:o?.path,rootItemLabel:o?.label,value:k,onSearchChange:A,isCompactView:vt,labelClassName:"dial-tiny-text"}),f.jsxs("section",{role:"region","aria-label":"File Manager Grid View",className:oe(NL,"relative"),onDragEnter:V,onDragLeave:Ee,onDragOver:At,onDrop:Xi,children:[ni,f.jsx(x7,{disabledGridRowIds:_s,gridRows:E,getDisabledTooltip:xr,getRowDisabledTooltip:ln,allowedFileTypes:w,maxSelectableFileSize:b})]})]})]}),f.jsx(P7,{...u,open:le,itemsToDelete:re,onClose:B,onConfirm:pe}),f.jsx(nw,{...h,open:Q,onClose:te,onConfirm:()=>{const j=h?.destinationFolderPath??"/";J===rt.Copy?_(j):Fe(j),te()},mode:J,items:s,rootItem:o,gridOptions:{columnDefs:hn.filter(j=>j.colId!==at.Actions),loading:i},onUploadFiles:yl,onValidateUpload:xl,maxFileSize:Rl,path:h?.destinationFolderPath??h?.sourceFolder??R,onPathChange:j=>{h?.setDestinationFolderPath?.(j)},sourceFolder:h?.sourceFolder??R,treeOptions:{header:n?.header},onFolderPopupPathChange:Al}),f.jsx(xp,{...p,open:Ji,onClose:Dl,onReplace:Rs,onDuplicate:El,onDecideForEach:ot,conflictingFiles:Fl}),f.jsx(xp,{...p,open:Fs,onClose:sn,onReplace:en,onDuplicate:tn,onDecideForEach:Tl,conflictingFiles:Pl}),f.jsx(N7,{open:on,onClose:Il,fileMetadata:ds?.fileMetadata??Yo,loading:ds?.loading,header:ds?.header,nameLabel:ds?.nameLabel,pathLabel:ds?.pathLabel,modifiedDateLabel:ds?.modifiedDateLabel,sizeLabel:ds?.sizeLabel,authorLabel:ds?.authorLabel,dateLocale:l?.dateLocale,dateOptions:l?.dateOptions})]})})},K7=(e,t=wi.MyFiles)=>{const s=Object.values(wi).includes(t)?t:wi.MyFiles,[o,i]=g.useState(s),n=a=>{i(a)},r=g.useMemo(()=>{if(e)return Object.values(wi).map(a=>({id:a,label:e?.[a]||a.replace("_"," ")}))},[e]);return{activeTab:o,handleTabChange:n,tabs:r}},Y7="application/octet-stream";function Z7(e,t){if(!e||e.length===0)return[];const s=e.find(l=>l.parentPath===""&&l.nodeType==="FOLDER");if(!s)return[];const o=s.path||s.url||"",i=Jc(o,!0),n=e.filter(l=>l!==s).map(l=>{const c=l.path||l.url||"",d=X7(l.nodeType),u=d===be.FOLDER,h=Jc(c,u);let p;return l.parentPath===null||l.parentPath===void 0?p=i:l.parentPath===""?p="":p=Jc(l.parentPath,!0),{...l,originalPath:c,path:h,parentPath:p,nodeType:d}}),r=new Map;n.forEach(l=>{const c={...l,id:l.originalPath,name:l.name,path:l.path,parentPath:l.parentPath,nodeType:l.nodeType,resourceType:Q7(l.resourceType),folderId:t,updatedAt:l.updatedAt?new Date(l.updatedAt).toISOString():new Date().toISOString(),items:l.nodeType===be.FOLDER?[]:void 0};l.nodeType===be.ITEM&&(c.extension=J7(l.name),c.contentType=l.contentType||Y7,c.contentLength=l.contentLength||0),r.set(l.path,c)});const a=[];return r.forEach(l=>{if(l.parentPath===i)a.push(l);else{const c=l.path.lastIndexOf(l.name||""),d=l.path.slice(0,c),u=r.get(d);u&&u.nodeType===be.FOLDER?(u.items=u.items||[],u.items.push(l)):a.push(l)}}),a}function Jc(e,t){try{let s=decodeURIComponent(e);return t?s.endsWith("/")||(s+="/"):s.endsWith("/")&&(s=s.slice(0,-1)),s}catch{return t&&!e.endsWith("/")?e+"/":!t&&e.endsWith("/")?e.slice(0,-1):e}}function X7(e){return e.toUpperCase()==="FOLDER"?be.FOLDER:be.ITEM}function Q7(e){if(!e)return;const t=e.toUpperCase();return Object.values(ch).find(o=>o.toUpperCase()===t)}function J7(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function e9(e,t="Prompts",s="prompts/public/",o="root"){const i=Z7(e,o);return[{id:o,name:t,path:s,parentPath:"",nodeType:be.FOLDER,folderId:o,items:i}]}exports.AlertVariant=is;exports.BASE_ICON_PROPS=Y;exports.BASE_ICON_SIZE=Nt;exports.ButtonAppearance=Me;exports.ButtonVariant=Ge;exports.ConfirmationPopupVariant=Vi;exports.DIAL_ICON_SIZE=pt;exports.DialAlert=Wp;exports.DialAutocompleteInputValue=Nv;exports.DialBreadcrumb=Mv;exports.DialBreadcrumbItem=Dn;exports.DialButton=ss;exports.DialButtonDropdown=Ud;exports.DialCaptionText=ir;exports.DialCheckbox=id;exports.DialCloseButton=eh;exports.DialCollapsibleSidebar=_p;exports.DialConditionalResizableContainer=of;exports.DialConfirmationPopup=Ov;exports.DialDestinationFolderPopup=nw;exports.DialDraggableItem=N0;exports.DialDropdown=Ft;exports.DialEllipsisTooltip=ht;exports.DialErrorButton=kv;exports.DialErrorIconButton=Av;exports.DialErrorText=ns;exports.DialFileIcon=iu;exports.DialFileManager=hw;exports.DialFileManagerActions=K;exports.DialFileManagerTabs=wi;exports.DialFileName=ll;exports.DialFileNodeType=be;exports.DialFilePermission=$o;exports.DialFileResourceType=ch;exports.DialFolderName=cl;exports.DialFormItem=Xd;exports.DialFormPopup=$8;exports.DialGhostButton=E8;exports.DialGhostIconButton=A8;exports.DialGrid=th;exports.DialIcon=$e;exports.DialIconButton=no;exports.DialInput=Zi;exports.DialInputPopup=Hv;exports.DialItemType=_t;exports.DialLabel=Bo;exports.DialLabelledText=k1;exports.DialLinkButton=F8;exports.DialLoadFileArea=qv;exports.DialLoadFileAreaField=TL;exports.DialLoader=nr;exports.DialNeutralButton=ys;exports.DialNeutralIconButton=T8;exports.DialNoDataContent=rr;exports.DialNumberInput=J8;exports.DialPasswordInput=sL;exports.DialPopup=Uo;exports.DialPrimaryButton=bs;exports.DialPrimaryIconButton=P8;exports.DialRadioButton=Zd;exports.DialRadioGroup=Fa;exports.DialRadioGroupPopupField=W8;exports.DialRemoveButton=Lv;exports.DialResizableContainer=sf;exports.DialSearch=ih;exports.DialSecondaryIconButton=M8;exports.DialSelect=Vv;exports.DialSelectField=hL;exports.DialSharedEntityIndicator=Wn;exports.DialSkeleton=pi;exports.DialSkeletonAvatarShape=Ea;exports.DialSkeletonAvatarSize=Tn;exports.DialSkeletonVariant=Xt;exports.DialSteps=E1;exports.DialSuccessIconButton=k8;exports.DialSwitch=oh;exports.DialTabs=Ev;exports.DialTag=vo;exports.DialTagInput=nL;exports.DialTertiaryIconButton=I8;exports.DialTextarea=L8;exports.DialTooltip=yt;exports.DropdownItemType=Bi;exports.DropdownTrigger=Ht;exports.DropdownType=yv;exports.ElementSize=bt;exports.FileManagerColumnKey=at;exports.FileManagerProvider=iw;exports.FlexibleActionsDirection=So;exports.FormItemOrientation=zn;exports.GridSelectionMode=Vn;exports.NAME_COLUMN=lw;exports.NOT_ALLOWED_SPACES=uh;exports.NOT_ALLOWED_SPACES_REGEXP=y7;exports.NOT_ALLOWED_SYMBOLS=sw;exports.NOT_ALLOWED_SYMBOLS_REGEXP=ow;exports.PopupSize=Wt;exports.RadioGroupOrientation=To;exports.ResizableContainerSide=_n;exports.SIZE_COLUMN=dw;exports.SelectSize=Ja;exports.SelectVariant=el;exports.StepStatus=Gt;exports.TabOrientation=Xa;exports.TagVariant=sl;exports.UPDATED_AT_COLUMN=cw;exports.mergeClasses=oe;exports.useDialFileManagerTabs=K7;exports.useEditableItem=rw;exports.useFileManagerContext=uw;exports.wrapInRootFolder=e9;