@epam/ai-dial-ui-kit 0.15.0-dev.17 → 0.15.0-dev.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,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./use-file-manager-tabs-DgIKWJoV.cjs"),_e=require("./Switch-CfxMs3AZ.cjs"),n=require("react/jsx-runtime"),g=require("react"),K=require("@tabler/icons-react"),oe=require("classnames"),w=require("./DateCellRenderer-Cm09x2e4.cjs"),H=require("./icon-CrGVkVpG.cjs"),I=require("./merge-classes-BEJXjzkx.cjs"),k=require("./DateCellRenderer-DX4hHj2a.cjs"),E=require("./IconButton-CVttu-k-.cjs"),Xn=require("react-dom"),lt=require("./lazy-BEsZqouS.cjs"),de=require("@floating-ui/react"),ie=require("./icon-DhjrDQ8I.cjs");function Jn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const mr=Jn(g),Ke=({label:e,className:t,icon:r,selected:s,closable:a,onClick:i,onRemove:o})=>{const l=I.mergeClasses("flex items-center gap-1 cursor-pointer dial-tiny-text px-2 h-[24px] border text-primary rounded-[8px]",s?"hover:bg-controls-accent-primary-alpha-active bg-accent-primary-alpha border-accent-primary":"bg-neutral border-primary",t);return n.jsxs("div",{className:l,onClick:i,children:[n.jsx(w.DialIcon,{icon:r}),n.jsx(w.DialEllipsisTooltip,{text:e}),a&&o&&n.jsx(y.DialButton,{className:"p-0",iconAfter:n.jsx(K.IconX,{size:H.DIAL_ICON_SIZE.SM}),onClick:c=>o(c)})]},e)},er=({label:e="Error",className:t})=>n.jsx(Ke,{label:e,className:I.mergeClasses("dial-tiny-semi-text cursor-default rounded-[120px] border-transparent bg-error text-error",t)});var at=(e=>(e.Default="default",e.Compact="compact",e))(at||{});const Qn={[at.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[at.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},es=({title:e,value:t,description:r,variant:s=at.Default,error:a,isLoading:i,className:o,delta:l,deltaPositive:c,deltaUnit:d,compareValues:f})=>{const p=Qn[s],h=c!==void 0?c:(l??0)>=0,u=l===void 0?null:`${l>=0?`+${l}`:String(l)}${d??""}`;return n.jsxs("div",{className:I.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||i?"gap-2":"gap-1",p.container,o),children:[l!==void 0?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:p.title,children:e}),n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",h?"bg-success text-success":"bg-error text-error"),children:u})]}):n.jsx("span",{className:p.title,children:e}),a?n.jsx(er,{className:"self-start"}):i?n.jsx(y.DialLoader,{fullWidth:!1,className:"self-start"}):f?n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(w.DialEllipsisTooltip,{text:f[0].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:p.value,children:f[0].value})]}),n.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(w.DialEllipsisTooltip,{text:f[1].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:p.value,children:f[1].value})]})]}):n.jsx("span",{className:p.value,children:t}),!a&&!i&&p.showDescription&&r!=null&&r!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},tr=[{from:0,to:.1,color:"#F26B5B"},{from:.1,to:.2,color:"#E5764A"},{from:.2,to:.3,color:"#E08C3F"},{from:.3,to:.4,color:"#D9A638"},{from:.4,to:.5,color:"#D4BE3A"},{from:.5,to:.6,color:"#B8C94A"},{from:.6,to:.7,color:"#7EC96B"},{from:.7,to:.8,color:"#4ECBA8"},{from:.8,to:.9,color:"#4EC5C5"},{from:.9,to:1,color:"#4DC87A"},{from:1,to:1,color:"#30E070"}],ts=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),rs=(e,t)=>{if(e<=0)return;let r;for(const s of t)(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=s.color);return r},ft=({value:e,maxValue:t=1,error:r,isLoading:s,title:a,valueLabel:i,colorMap:o=tr,className:l,titleClassName:c,valueClassName:d,inline:f,ariaLabel:p})=>{const h=e==null,u=!!(r||s||!h),m=ts(h?0:e,t),v=rs(m,o),x=i??(h?"—":e),b=p??(typeof a=="string"?a:void 0),C=r||s,S=r?n.jsx(er,{}):s?n.jsx(y.DialLoader,{fullWidth:!1}):n.jsx("span",{className:I.mergeClasses("shrink-0 tabular-nums text-end",f?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",d),children:x}),j=u?n.jsx("div",{role:"progressbar","aria-valuenow":r||s||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":b,className:I.mergeClasses("w-full overflow-hidden rounded-sm",f?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!C&&n.jsx("div",{className:"h-full rounded-sm transition-[width] duration-300",style:{width:`${m*100}%`,backgroundColor:v}})}):null,D=n.jsx("span",{className:I.mergeClasses("dial-small-text text-primary",c),children:a});return f?n.jsxs("div",{className:I.mergeClasses("flex flex-row items-center gap-2",l),children:[n.jsx("div",{className:"w-1/2 min-w-0",children:D}),n.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[n.jsx("div",{className:"min-w-0 flex-1",children:j}),S]})]}):n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-1",l),children:[n.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[D,S]}),j]})},Yr=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,onToggle:l,className:c,headerClassName:d,contentClassName:f})=>{const p=s!==void 0,[h,u]=g.useState(a),m=o?!0:p?s:h,v=g.useId(),x=()=>{if(i)return;const b=!m;p||u(b),l?.(b)};return n.jsxs("div",{className:I.mergeClasses("rounded border border-secondary",c),children:[n.jsxs("button",{type:"button","aria-expanded":m,"aria-controls":v,disabled:i||o,onClick:x,className:I.mergeClasses("flex w-full items-center gap-2 p-4 text-left",i?"cursor-not-allowed":"cursor-pointer",o&&"cursor-default",d),children:[!o&&n.jsx(w.DialIcon,{className:oe("text-secondary transition-transform",m&&"rotate-90"),icon:n.jsx(K.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM})}),n.jsx("span",{className:"dial-body-text text-primary",children:e}),t!=null&&t!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:t})]}),m&&n.jsx("div",{id:v,role:"region",className:I.mergeClasses("px-4 pb-4",f),children:r})]})},ns=({title:e,titleTooltip:t,description:r,data:s,compareData:a,compareLabels:i,maxValue:o,colorMap:l,defaultExpanded:c=!0,nonCollapsible:d,isLoading:f,onBarClick:p,inline:h,barTitleClassName:u,barValueClassName:m,barClassName:v,barDescriptions:x,className:b})=>{const C=Object.entries(s),S=h?I.mergeClasses("text-secondary",u):u,j=i?"dial-tiny-text text-secondary":void 0,D=t?n.jsx(E.DialTooltip,{tooltip:t,children:e}):e,T=a?[...new Set([...Object.keys(s),...Object.keys(a)])]:[],L="cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-primary",O="group flex flex-col gap-1.5",A=I.mergeClasses("flex flex-col gap-1.5 pl-2",p&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",v);return n.jsx(Yr,{title:D,description:r,defaultExpanded:c,nonCollapsible:d,className:b,children:n.jsx("div",{className:I.mergeClasses("flex flex-col",a?"gap-4":h?"gap-2":"gap-3"),children:f?n.jsx(y.DialLoader,{fullWidth:!1,className:"self-center"}):a?T.map(R=>{const N=R in s?s[R]:null,P=R in a?a[R]:null,U=typeof N=="number"&&typeof P=="number"?parseFloat((P-N).toFixed(3)):null,Q=U!=null&&U!==0,G=Q&&U>0,B=Q?G?`+${U}`:String(U):null,z=x?.[R],Z=n.jsx("span",{className:"dial-small-text text-secondary",children:R}),V=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[z?n.jsx(E.DialTooltip,{tooltip:z,children:Z}):Z,B!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",G?"bg-success text-success":"bg-error text-error"),children:B})]}),n.jsxs("div",{className:A,children:[n.jsx(ft,{title:i?.[0],value:N,maxValue:o,colorMap:l,inline:h,titleClassName:j,ariaLabel:R}),n.jsx(ft,{title:i?.[1],value:P,maxValue:o,colorMap:l,inline:h,titleClassName:j,ariaLabel:`${R} compare`})]})]});return p?n.jsx("button",{type:"button",onClick:()=>p(R,N),className:I.mergeClasses(O,L),children:V},R):n.jsx("div",{className:O,children:V},R)}):C.map(([R,N])=>{const P=n.jsx(ft,{title:R,value:N,maxValue:o,colorMap:l,inline:h,titleClassName:S,valueClassName:m,className:v}),F=p?n.jsx("button",{type:"button",onClick:()=>p(R,N),className:L,children:P}):P,U=x?.[R];return U?n.jsx(E.DialTooltip,{tooltip:U,triggerClassName:"flex flex-col",children:F},R):n.jsx(g.Fragment,{children:F},R)})})})},ss="#FF4E50",as=(e,t)=>{let r=-1;return t.forEach((s,a)=>{(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=a)}),r},xr=(e,t)=>{const r=t.map(()=>0);let s=0;e.forEach(c=>{if(c<=0){s+=1;return}const d=as(c,t);d>=0&&(r[d]+=1)});const a=Math.max(0,s,...r),i=c=>a>0?c/a:0,o={from:0,to:0,color:ss,count:s,ratio:i(s),isZeroBucket:!0},l=t.map((c,d)=>({from:c.from,to:c.to,color:c.color,count:r[d],ratio:i(r[d]),isZeroBucket:!1}));return[o,...l]},Xr=e=>e<=0?2:e%2===0?e:e+1,is=e=>{const t=Xr(e);return[t,t/2,0]},At=e=>`${Math.round(e*100)/100}`,Jr=(e,t)=>e===t?At(e):`${At(e)}-${At(t)}`,_t=128,os=(e,t)=>{const r=Jr(e,t);return e===t?`scored ${r}`:`scored between ${r}`},br=(e,t,r,s,a)=>n.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&n.jsx("strong",{children:e}),n.jsxs("span",{children:[t," out of ",r," ",s]}),n.jsx("span",{children:os(a.from,a.to)})]}),ls=({title:e,values:t,colorMap:r=tr,valueTitle:s="values",showCount:a,isLoading:i,className:o,compareValues:l,valueSetLabel:c,compareValueSetLabel:d})=>{const f=xr(t,r),p=l?xr(l,r):void 0,h=t.length,u=l?.length??0,m=Math.max(h,u),v=Xr(m),x=is(m),b=D=>D.map(T=>({...T,ratio:v>0?T.count/v:0})),C=b(f),S=p?b(p):void 0,j=(D,T,L,O)=>{if(D.count===0)return n.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:n.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${D.ratio*100}%`}})});const A=O?{backgroundImage:`repeating-linear-gradient(135deg, ${D.color} 0px, ${D.color} 1px, transparent 1px, transparent 4px)`,borderColor:D.color}:{backgroundColor:D.color};return n.jsx(E.DialTooltip,{placement:"bottom",tooltip:T,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":L,className:"flex min-h-2 w-full items-center justify-center rounded-sm border border-transparent",style:{height:`${D.ratio*100}%`,...A},children:a&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:D.count})})})};return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",o),children:[n.jsx("span",{className:"dial-small-text text-primary",children:e}),i?n.jsx("div",{className:"flex items-center justify-center",style:{height:_t},children:n.jsx(y.DialLoader,{fullWidth:!1})}):n.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1",children:[n.jsx("div",{"data-histogram-y-axis":!0,"aria-hidden":"true",className:"relative",style:{height:_t},children:x.map((D,T)=>n.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${T/(x.length-1)*100}%`,transform:"translateY(-50%)"},children:D},D))}),n.jsxs("div",{className:"relative min-w-0",children:[x.map((D,T)=>n.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${T/(x.length-1)*100}%`}},D)),n.jsx("div",{className:"relative flex items-end gap-1",style:{height:_t},children:S?C.map((D,T)=>{const L=S[T],O=`${D.count} out of ${h} ${s}`,A=`${L.count} out of ${u} ${s}`;return n.jsxs("div",{className:"flex h-full flex-1 items-end",children:[j(D,br(c,D.count,h,s,D),O,!0),j(L,br(d,L.count,u,s,L),A,!1)]},T)}):C.map((D,T)=>{const L=`${D.count} out of ${h} ${s}`;return D.count===0?n.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:n.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${D.ratio*100}%`}})},T):n.jsx(E.DialTooltip,{placement:"bottom",tooltip:L,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":L,className:I.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-sm border","border-transparent"),style:{height:`${D.ratio*100}%`,backgroundColor:D.color},children:a&&D.count>0&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:D.count})})},T)})})]}),n.jsx("div",{}),n.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:C.map((D,T)=>n.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:Jr(D.from,D.to)},T))})]})]})},cs=({value:e,max:t=100,size:r=E.ElementSize.Standard,labelProps:s,valueLabel:a,id:i,className:o,"aria-label":l,...c})=>{const d=g.useId(),f=i??d,p=!!s?.label,h=p?s?.id??`${f}-label`:void 0,u=t>0?t:0,m=Number.isFinite(e)?e:0,v=Math.min(Math.max(m,0),u),x=u>0?v/u*100:0,b=n.jsx("div",{...c,id:f,role:"progressbar","aria-valuenow":v,"aria-valuemin":0,"aria-valuemax":u,"aria-labelledby":h,"aria-label":E.resolveAccessibleName(l,p?void 0:"Progress"),className:I.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===E.ElementSize.Small?"h-1":"h-2",o,!p&&!a&&w.DIAL_KIT_CLASS.progressBar),children:n.jsx("div",{style:{width:`${x}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!p&&!a?b:n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-1",w.DIAL_KIT_CLASS.progressBar),children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[s&&n.jsx(k.Label,{...s,id:h}),a&&n.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),b]})},ds=7,us=2,fs=e=>e<=0?[]:Array.from({length:e},(t,r)=>r+1);var pt=(e=>(e.Active="active",e.Adjacent="adjacent",e.Far="far",e))(pt||{});const ps=(e,t,r)=>e===t?"active":r<ds||Math.abs(e-t)<=us?"adjacent":"far",hs=({page:e,totalPages:t,onPageChange:r,className:s})=>{const a=fs(t);return n.jsxs("nav",{"aria-label":"Pagination",className:I.mergeClasses("flex items-center gap-2",s),children:[n.jsx(E.DialIconButton,{icon:n.jsx(K.IconCaretLeftFilled,{size:H.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:E.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e<=1,onClick:()=>r(e-1),"aria-label":"Previous page"}),n.jsx("div",{className:"flex flex-row items-center gap-2",children:a.map(i=>{const o=ps(i,e,t);return n.jsx("button",{type:"button",onClick:()=>r(i),"aria-label":`Page ${i}`,"aria-current":i===e?"page":void 0,className:I.mergeClasses("dial-pagination-dot rounded-full focus-visible:outline outline-offset-0 transition-all duration-300 ease-in-out",o===pt.Active&&"h-[8px] w-[32px]",o===pt.Adjacent&&"size-[8px]",o===pt.Far&&"size-[4px]")},i)})}),n.jsx(E.DialIconButton,{icon:n.jsx(K.IconCaretRightFilled,{size:H.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:E.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e>=t,onClick:()=>r(e+1),"aria-label":"Next page"})]})},Gt=({label:e,id:t,checked:r,indeterminate:s,disabled:a,ariaLabel:i,onChange:o,className:l,...c})=>{const d=g.useCallback(u=>{o?.(u.target.checked,t)},[o,t]),f=oe("flex flex-row items-center cursor-pointer text-accent-primary small-medium min-w-0",`${r||s?"":'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded'}`,a?"pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4":"",l),p=oe("border rounded",a?"bg-layer-4 border-icon-secondary":""),h=()=>s?n.jsx(K.IconMinus,{className:p,...H.BASE_ICON_PROPS}):r?n.jsx(K.IconCheck,{className:p,...H.BASE_ICON_PROPS}):null;return n.jsxs("label",{...c,className:f,htmlFor:t,"aria-description":c["aria-description"]||w.ariaDescription,children:[h(),e&&(typeof e=="string"?n.jsx(w.DialEllipsisTooltip,{text:e,className:"ml-2 text-primary"}):e),n.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:d,id:t,checked:r,"aria-checked":s?"mixed":r,"aria-disabled":a||void 0,"aria-label":e?void 0:i,className:"invisible size-0"})]})};var ye=(e=>(e.VALID="valid",e.ERROR="error",e))(ye||{});const gs=(e,t)=>{if(t===e.id)switch(e.status){case ye.VALID:return"border-accent-secondary text-primary";case ye.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case ye.VALID:return"border-primary text-primary";case ye.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},ms=(e,t)=>{if(t===e.id)switch(e.status){case ye.VALID:return"bg-accent-secondary";case ye.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case ye.VALID:return"bg-accent-secondary";case ye.ERROR:return"bg-red-400";default:return"bg-layer-4"}},xs=({step:e,index:t,currentStep:r,onChangeStep:s})=>{const a="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny-text cursor-pointer dial-step",i="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",o=()=>r===e.id&&e.status===ye.ERROR?n.jsx(K.IconExclamationCircle,{stroke:2,size:H.DIAL_ICON_SIZE.SM}):r!==e.id&&e.status===ye.VALID?n.jsx(K.IconCheck,{stroke:2,size:H.DIAL_ICON_SIZE.SM}):t+1;return n.jsxs("button",{className:oe(a,gs(e,r)),onClick:()=>s(e.id),children:[n.jsx("span",{className:oe(i,ms(e,r)),children:o()}),n.jsx("span",{children:e.name})]})},bs=({steps:e,currentStep:t,onChangeStep:r})=>{const s=a=>{const i=e.findIndex(c=>c.id===t),o=e.findIndex(c=>c.id===a);if(a===t)return;(e.slice(0,o).every(c=>c.status===ye.VALID)||o<i)&&r(a)};return n.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,i)=>n.jsx(xs,{currentStep:t,onChangeStep:s,step:a,index:i},a.id))})},Lt=e=>(e.toString().split(".")[1]??"").length,ys=({value:e,min:t=0,max:r=1,step:s=.1,disabled:a=!1,labelProps:i,labels:o,formatValue:l,onChange:c,className:d,trackClassName:f,fillClassName:p,thumbClassName:h,labelsClassName:u,"aria-label":m,"aria-labelledby":v,...x})=>{const b=g.useRef(null),C=Math.max(0,Math.min(100,(e-t)/(r-t)*100)),S=Lt(s),j=l?l(e):e.toFixed(S),D=g.useCallback(A=>{const R=b.current;if(!R)return e;const N=R.getBoundingClientRect(),P=(A-N.left)/N.width,F=t+P*(r-t),U=Lt(s),Q=parseFloat((Math.round((F-t)/s)*s+t).toFixed(U));return Math.min(r,Math.max(t,Q))},[t,r,s,e]),T=g.useCallback(A=>{a||(A.currentTarget.setPointerCapture(A.pointerId),c?.(D(A.clientX)))},[a,D,c]),L=g.useCallback(A=>{a||A.buttons===0||c?.(D(A.clientX))},[a,D,c]),O=g.useCallback(A=>{if(a)return;const R=Lt(s),N=U=>parseFloat((Math.round((U-t)/s)*s+t).toFixed(R)),P=U=>Math.min(r,Math.max(t,U));let F=e;switch(A.key){case"ArrowRight":case"ArrowUp":F=P(N(e+s));break;case"ArrowLeft":case"ArrowDown":F=P(N(e-s));break;case"Home":F=t;break;case"End":F=r;break;default:return}A.preventDefault(),F!==e&&c?.(F)},[a,e,s,t,r,c]);return n.jsxs("div",{className:I.mergeClasses("flex flex-col",a&&"pointer-events-none opacity-50",d),...x,children:[i&&n.jsx(_e.DialLabel,{...i,htmlFor:x.id}),n.jsxs("div",{ref:b,className:"relative flex h-[38px] cursor-pointer items-center",onPointerDown:T,onPointerMove:L,children:[n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute inset-x-0 h-3 rounded-[10px] bg-layer-1",f)}),n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute left-0 h-3 rounded-[10px] bg-controls-accent-primary",p),style:{width:`${C}%`}}),n.jsx("div",{role:"slider",tabIndex:a?-1:0,"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":r,"aria-disabled":a||void 0,"aria-label":m,"aria-labelledby":v,className:I.mergeClasses("dial-small-text absolute -translate-x-1/2 flex size-[38px] cursor-grab select-none items-center justify-center rounded-full bg-layer-3 text-primary shadow focus:outline-none focus-visible:ring-2 focus-visible:ring-focus",h),style:{left:`${C}%`},onKeyDown:O,children:j})]}),o&&n.jsx("div",{className:I.mergeClasses("dial-tiny-text flex text-secondary",u),children:o.length===3?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:o[0]}),n.jsx("span",{className:"flex-1 text-center",children:o[1]}),n.jsx("span",{children:o[2]})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:o[0]}),n.jsx("span",{className:"ml-auto",children:o[1]})]})})]})},vs=({label:e,text:t,tooltip:r,children:s,postfix:a,className:i})=>n.jsxs("div",{className:I.mergeClasses("flex flex-col",s?"":"max-w-[200px]",i),children:[e&&n.jsx("label",{className:"dial-tiny-text mb-2 text-secondary",children:e}),s||n.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[n.jsx(E.DialTooltip,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),Qr=g.createContext({dragDropManager:void 0});function Ce(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 yr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),vr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Cr={INIT:"@@redux/INIT"+vr(),REPLACE:"@@redux/REPLACE"+vr()};function Cs(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 Ds(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(Ns(e))return"date";if(Ss(e))return"error";var r=Is(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function Is(e){return typeof e.constructor=="function"?e.constructor.name:null}function Ss(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Ns(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Ze(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Ds(e)),t}function en(e,t,r){var s;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Ce(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 r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Ce(1):"Expected the enhancer to be a function. Instead, received: '"+Ze(r)+"'");return r(en)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Ce(2):"Expected the root reducer to be a function. Instead, received: '"+Ze(e)+"'");var a=e,i=t,o=[],l=o,c=!1;function d(){l===o&&(l=o.slice())}function f(){if(c)throw new Error(process.env.NODE_ENV==="production"?Ce(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 i}function p(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ce(4):"Expected the listener to be a function. Instead, received: '"+Ze(v)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Ce(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 x=!0;return d(),l.push(v),function(){if(x){if(c)throw new Error(process.env.NODE_ENV==="production"?Ce(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.");x=!1,d();var C=l.indexOf(v);l.splice(C,1),o=null}}}function h(v){if(!Cs(v))throw new Error(process.env.NODE_ENV==="production"?Ce(7):"Actions must be plain objects. Instead, the actual type was: '"+Ze(v)+"'. 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 v.type>"u")throw new Error(process.env.NODE_ENV==="production"?Ce(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?Ce(9):"Reducers may not dispatch actions.");try{c=!0,i=a(i,v)}finally{c=!1}for(var x=o=l,b=0;b<x.length;b++){var C=x[b];C()}return v}function u(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ce(10):"Expected the nextReducer to be a function. Instead, received: '"+Ze(v));a=v,h({type:Cr.REPLACE})}function m(){var v,x=p;return v={subscribe:function(C){if(typeof C!="object"||C===null)throw new Error(process.env.NODE_ENV==="production"?Ce(11):"Expected the observer to be an object. Instead, received: '"+Ze(C)+"'");function S(){C.next&&C.next(f())}S();var j=x(S);return{unsubscribe:j}}},v[yr]=function(){return this},v}return h({type:Cr.INIT}),s={dispatch:h,subscribe:p,getState:f,replaceReducer:u},s[yr]=m,s}function Y(e,t,...r){if(js()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let s;if(t===void 0)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;s=new Error(t.replace(/%s/g,function(){return r[a++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}function js(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function Ts(e,t,r){return t.split(".").reduce((s,a)=>s&&s[a]?s[a]:r||null,e)}function ws(e,t){return e.filter(r=>r!==t)}function tn(e){return typeof e=="object"}function Es(e,t){const r=new Map,s=i=>{r.set(i,r.has(i)?r.get(i)+1:1)};e.forEach(s),t.forEach(s);const a=[];return r.forEach((i,o)=>{i===1&&a.push(o)}),a}function Os(e,t){return e.filter(r=>t.indexOf(r)>-1)}const rr="dnd-core/INIT_COORDS",vt="dnd-core/BEGIN_DRAG",nr="dnd-core/PUBLISH_DRAG_SOURCE",Ct="dnd-core/HOVER",Dt="dnd-core/DROP",It="dnd-core/END_DRAG";function Dr(e,t){return{type:rr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const As={type:rr,payload:{clientOffset:null,sourceClientOffset:null}};function _s(e){return function(r=[],s={publishSource:!0}){const{publishSource:a=!0,clientOffset:i,getSourceClientOffset:o}=s,l=e.getMonitor(),c=e.getRegistry();e.dispatch(Dr(i)),Ls(r,l,c);const d=Ps(r,l);if(d==null){e.dispatch(As);return}let f=null;if(i){if(!o)throw new Error("getSourceClientOffset must be defined");Rs(o),f=o(d)}e.dispatch(Dr(i,f));const h=c.getSource(d).beginDrag(l,d);if(h==null)return;ks(h),c.pinSource(d);const u=c.getSourceType(d);return{type:vt,payload:{itemType:u,item:h,sourceId:d,clientOffset:i||null,sourceClientOffset:f||null,isSourcePublic:!!a}}}}function Ls(e,t,r){Y(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(s){Y(r.getSource(s),"Expected sourceIds to be registered.")})}function Rs(e){Y(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function ks(e){Y(tn(e),"Item must be an object.")}function Ps(e,t){let r=null;for(let s=e.length-1;s>=0;s--)if(t.canDragSource(e[s])){r=e[s];break}return r}function Ms(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Ms(e,a,r[a])})}return e}function Fs(e){return function(r={}){const s=e.getMonitor(),a=e.getRegistry();zs(s),Hs(s).forEach((o,l)=>{const c=$s(o,l,a,s),d={type:Dt,payload:{dropResult:Bs({},r,c)}};e.dispatch(d)})}}function zs(e){Y(e.isDragging(),"Cannot call drop while not dragging."),Y(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function $s(e,t,r,s){const a=r.getTarget(e);let i=a?a.drop(s,e):void 0;return Ks(i),typeof i>"u"&&(i=t===0?{}:s.getDropResult()),i}function Ks(e){Y(typeof e>"u"||tn(e),"Drop result must either be an object or undefined.")}function Hs(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Vs(e){return function(){const r=e.getMonitor(),s=e.getRegistry();Gs(r);const a=r.getSourceId();return a!=null&&(s.getSource(a,!0).endDrag(r,a),s.unpinSource()),{type:It}}}function Gs(e){Y(e.isDragging(),"Cannot call endDrag while not dragging.")}function Ut(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Us(e){return function(r,{clientOffset:s}={}){Ws(r);const a=r.slice(0),i=e.getMonitor(),o=e.getRegistry(),l=i.getItemType();return Zs(a,o,l),qs(a,i,o),Ys(a,i,o),{type:Ct,payload:{targetIds:a,clientOffset:s||null}}}}function Ws(e){Y(Array.isArray(e),"Expected targetIds to be an array.")}function qs(e,t,r){Y(t.isDragging(),"Cannot call hover while not dragging."),Y(!t.didDrop(),"Cannot call hover after drop.");for(let s=0;s<e.length;s++){const a=e[s];Y(e.lastIndexOf(a)===s,"Expected targetIds to be unique in the passed array.");const i=r.getTarget(a);Y(i,"Expected targetIds to be registered.")}}function Zs(e,t,r){for(let s=e.length-1;s>=0;s--){const a=e[s],i=t.getTargetType(a);Ut(i,r)||e.splice(s,1)}}function Ys(e,t,r){e.forEach(function(s){r.getTarget(s).hover(t,s)})}function Xs(e){return function(){if(e.getMonitor().isDragging())return{type:nr}}}function Js(e){return{beginDrag:_s(e),publishDragSource:Xs(e),hover:Us(e),drop:Fs(e),endDrag:Vs(e)}}class Qs{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function s(i){return(...o)=>{const l=i.apply(t,o);typeof l<"u"&&r(l)}}const a=Js(this);return Object.keys(a).reduce((i,o)=>{const l=a[o];return i[o]=s(l),i},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const s=this.store.getState().refCount>0;this.backend&&(s&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!s&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function ea(e,t){return{x:e.x+t.x,y:e.y+t.y}}function rn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ta(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:s}=e;return!t||!r||!s?null:rn(ea(t,s),r)}function ra(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:rn(t,r)}const nt=[],sr=[];nt.__IS_NONE__=!0;sr.__IS_ALL__=!0;function na(e,t){return e===nt?!1:e===sr||typeof t>"u"?!0:Os(t,e).length>0}class sa{subscribeToStateChange(t,r={}){const{handlerIds:s}=r;Y(typeof t=="function","listener must be a function."),Y(typeof s>"u"||Array.isArray(s),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const i=()=>{const o=this.store.getState(),l=o.stateId;try{l===a||l===a+1&&!na(o.dirtyHandlerIds,s)||t()}finally{a=l}};return this.store.subscribe(i)}subscribeToOffsetChange(t){Y(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const s=()=>{const a=this.store.getState().dragOffset;a!==r&&(r=a,t())};return this.store.subscribe(s)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return Y(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(Y(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const s=this.registry.getTargetType(t),a=this.getItemType();return Ut(s,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Y(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const s=this.registry.getSourceType(t),a=this.getItemType();return s!==a?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:s}=r;if(!this.isDragging())return!1;const a=this.registry.getTargetType(t),i=this.getItemType();if(i&&!Ut(a,i))return!1;const o=this.getTargetIds();if(!o.length)return!1;const l=o.indexOf(t);return s?l===o.length-1:l>-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 ta(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return ra(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Ir=typeof global<"u"?global:self,nn=Ir.MutationObserver||Ir.WebKitMutationObserver;function sn(e){return function(){const r=setTimeout(a,0),s=setInterval(a,50);function a(){clearTimeout(r),clearInterval(s),e()}}}function aa(e){let t=1;const r=new nn(e),s=document.createTextNode("");return r.observe(s,{characterData:!0}),function(){t=-t,s.data=t}}const ia=typeof nn=="function"?aa:sn;class oa{enqueueTask(t){const{queue:r,requestFlush:s}=this;r.length||(s(),this.flushing=!0),r[r.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 r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let s=0,a=t.length-this.index;s<a;s++)t[s]=t[s+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=ia(this.flush),this.requestErrorThrow=sn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class la{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class ca{create(t){const r=this.freeTasks,s=r.length?r.pop():new la(this.onError,a=>r[r.length]=a);return s.task=t,s}constructor(t){this.onError=t,this.freeTasks=[]}}const an=new oa,da=new ca(an.registerPendingError);function ua(e){an.enqueueTask(da.create(e))}const ar="dnd-core/ADD_SOURCE",ir="dnd-core/ADD_TARGET",or="dnd-core/REMOVE_SOURCE",St="dnd-core/REMOVE_TARGET";function fa(e){return{type:ar,payload:{sourceId:e}}}function pa(e){return{type:ir,payload:{targetId:e}}}function ha(e){return{type:or,payload:{sourceId:e}}}function ga(e){return{type:St,payload:{targetId:e}}}function ma(e){Y(typeof e.canDrag=="function","Expected canDrag to be a function."),Y(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Y(typeof e.endDrag=="function","Expected endDrag to be a function.")}function xa(e){Y(typeof e.canDrop=="function","Expected canDrop to be a function."),Y(typeof e.hover=="function","Expected hover to be a function."),Y(typeof e.drop=="function","Expected beginDrag to be a function.")}function Wt(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Wt(r,!1));return}Y(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 De;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(De||(De={}));let ba=0;function ya(){return ba++}function va(e){const t=ya().toString();switch(e){case De.SOURCE:return`S${t}`;case De.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Sr(e){switch(e[0]){case"S":return De.SOURCE;case"T":return De.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Nr(e,t){const r=e.entries();let s=!1;do{const{done:a,value:[,i]}=r.next();if(i===t)return!0;s=!!a}while(!s);return!1}class Ca{addSource(t,r){Wt(t),ma(r);const s=this.addHandler(De.SOURCE,t,r);return this.store.dispatch(fa(s)),s}addTarget(t,r){Wt(t,!0),xa(r);const s=this.addHandler(De.TARGET,t,r);return this.store.dispatch(pa(s)),s}containsHandler(t){return Nr(this.dragSources,t)||Nr(this.dropTargets,t)}getSource(t,r=!1){return Y(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Y(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Y(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Y(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Sr(t)===De.SOURCE}isTargetId(t){return Sr(t)===De.TARGET}removeSource(t){Y(this.getSource(t),"Expected an existing source."),this.store.dispatch(ha(t)),ua(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Y(this.getTarget(t),"Expected an existing target."),this.store.dispatch(ga(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Y(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Y(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,s){const a=va(t);return this.types.set(a,r),t===De.SOURCE?this.dragSources.set(a,s):t===De.TARGET&&this.dropTargets.set(a,s),a}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const Da=(e,t)=>e===t;function Ia(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Sa(e,t,r=Da){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!r(e[s],t[s]))return!1;return!0}function Na(e=nt,t){switch(t.type){case Ct:break;case ar:case ir:case St:case or:return nt;case vt:case nr:case It:case Dt:default:return sr}const{targetIds:r=[],prevTargetIds:s=[]}=t.payload,a=Es(r,s);if(!(a.length>0||!Sa(r,s)))return nt;const o=s[s.length-1],l=r[r.length-1];return o!==l&&(o&&a.push(o),l&&a.push(l)),a}function ja(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ta(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){ja(e,a,r[a])})}return e}const jr={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function wa(e=jr,t){const{payload:r}=t;switch(t.type){case rr:case vt:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Ct:return Ia(e.clientOffset,r.clientOffset)?e:Ta({},e,{clientOffset:r.clientOffset});case It:case Dt:return jr;default:return e}}function Ea(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ye(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Ea(e,a,r[a])})}return e}const Oa={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Aa(e=Oa,t){const{payload:r}=t;switch(t.type){case vt:return Ye({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case nr:return Ye({},e,{isSourcePublic:!0});case Ct:return Ye({},e,{targetIds:r.targetIds});case St:return e.targetIds.indexOf(r.targetId)===-1?e:Ye({},e,{targetIds:ws(e.targetIds,r.targetId)});case Dt:return Ye({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case It:return Ye({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function _a(e=0,t){switch(t.type){case ar:case ir:return e+1;case or:case St:return e-1;default:return e}}function La(e=0){return e+1}function Ra(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ka(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Ra(e,a,r[a])})}return e}function Pa(e={},t){return{dirtyHandlerIds:Na(e.dirtyHandlerIds,{type:t.type,payload:ka({},t.payload,{prevTargetIds:Ts(e,"dragOperation.targetIds",[])})}),dragOffset:wa(e.dragOffset,t),refCount:_a(e.refCount,t),dragOperation:Aa(e.dragOperation,t),stateId:La(e.stateId)}}function Ma(e,t=void 0,r={},s=!1){const a=Ba(s),i=new sa(a,new Ca(a)),o=new Qs(a,i),l=e(o,t,r);return o.receiveBackend(l),o}function Ba(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return en(Pa,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Fa(e,t){if(e==null)return{};var r=za(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}function za(e,t){if(e==null)return{};var r={},s=Object.keys(e),a,i;for(i=0;i<s.length;i++)a=s[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}let Tr=0;const ht=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var $a=g.memo(function(t){var{children:r}=t,s=Fa(t,["children"]);const[a,i]=Ka(s);return g.useEffect(()=>{if(i){const o=on();return++Tr,()=>{--Tr===0&&(o[ht]=null)}}},[]),n.jsx(Qr.Provider,{value:a,children:r})});function Ka(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=Ha(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function Ha(e,t=on(),r,s){const a=t;return a[ht]||(a[ht]={dragDropManager:Ma(e,t,r,s)}),a[ht]}function on(){return typeof global<"u"?global:window}var Rt,wr;function Va(){return wr||(wr=1,Rt=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var s,a,i;if(Array.isArray(t)){if(s=t.length,s!=r.length)return!1;for(a=s;a--!==0;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),s=i.length,s!==Object.keys(r).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=s;a--!==0;){var o=i[a];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}),Rt}var Ga=Va();const Ua=y.getDefaultExportFromCjs(Ga),Ve=typeof window<"u"?g.useLayoutEffect:g.useEffect;function Wa(e,t,r){const[s,a]=g.useState(()=>t(e)),i=g.useCallback(()=>{const o=t(e);Ua(s,o)||(a(o),r&&r())},[s,e,r]);return Ve(i),[s,i]}function qa(e,t,r){const[s,a]=Wa(e,t,r);return Ve(function(){const o=e.getHandlerId();if(o!=null)return e.subscribeToStateChange(a,{handlerIds:[o]})},[e,a]),s}function ln(e,t,r){return qa(t,e||(()=>({})),()=>r.reconnect())}function cn(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),g.useMemo(()=>typeof e=="function"?e():e,r)}function Za(e){return g.useMemo(()=>e.hooks.dragSource(),[e])}function Ya(e){return g.useMemo(()=>e.hooks.dragPreview(),[e])}let kt=!1,Pt=!1;class Xa{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Y(!kt,"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 kt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{kt=!1}}isDragging(){if(!this.sourceId)return!1;Y(!Pt,"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 Pt=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Pt=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}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 Mt=!1;class Ja{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Y(!Mt,"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 Mt=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Mt=!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 Qa(e,t,r){const s=r.getRegistry(),a=s.addTarget(e,t);return[a,()=>s.removeTarget(a)]}function ei(e,t,r){const s=r.getRegistry(),a=s.addSource(e,t);return[a,()=>s.removeSource(a)]}function qt(e,t,r,s){let a;if(a!==void 0)return!!a;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let c=0;c<i.length;c++){const d=i[c];if(!l(d))return!1;const f=e[d],p=t[d];if(a=void 0,a===!1||a===void 0&&f!==p)return!1}return!0}function Zt(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ti(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 ri(e){return(t=null,r=null)=>{if(!g.isValidElement(t)){const i=t;return e(i,r),i}const s=t;return ti(s),ni(s,r?i=>e(i,r):e)}}function dn(e){const t={};return Object.keys(e).forEach(r=>{const s=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=ri(s);t[r]=()=>a}}),t}function Er(e,t){typeof e=="function"?e(t):e.current=t}function ni(e,t){const r=e.ref;return Y(typeof r!="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"),r?g.cloneElement(e,{ref:s=>{Er(r,s),Er(t,s)}}):g.cloneElement(e,{ref:t})}class si{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,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,s=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(s&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!qt(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!qt(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=dn({dragSource:(r,s)=>{this.clearDragSource(),this.dragSourceOptions=s||null,Zt(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,s)=>{this.clearDragPreview(),this.dragPreviewOptions=s||null,Zt(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,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 ai{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,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!qt(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=dn({dropTarget:(r,s)=>{this.clearDropTarget(),this.dropTargetOptions=s,Zt(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Je(){const{dragDropManager:e}=g.useContext(Qr);return Y(e!=null,"Expected drag drop context"),e}function ii(e,t){const r=Je(),s=g.useMemo(()=>new si(r.getBackend()),[r]);return Ve(()=>(s.dragSourceOptions=e||null,s.reconnect(),()=>s.disconnectDragSource()),[s,e]),Ve(()=>(s.dragPreviewOptions=t||null,s.reconnect(),()=>s.disconnectDragPreview()),[s,t]),s}function oi(){const e=Je();return g.useMemo(()=>new Xa(e),[e])}class li{beginDrag(){const t=this.spec,r=this.monitor;let s=null;return typeof t.item=="object"?s=t.item:typeof t.item=="function"?s=t.item(r):s={},s??null}canDrag(){const t=this.spec,r=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(r):!0}isDragging(t,r){const s=this.spec,a=this.monitor,{isDragging:i}=s;return i?i(a):r===t.getSourceId()}endDrag(){const t=this.spec,r=this.monitor,s=this.connector,{end:a}=t;a&&a(r.getItem(),r),s.reconnect()}constructor(t,r,s){this.spec=t,this.monitor=r,this.connector=s}}function ci(e,t,r){const s=g.useMemo(()=>new li(e,t,r),[t,r]);return g.useEffect(()=>{s.spec=e},[e]),s}function di(e){return g.useMemo(()=>{const t=e.type;return Y(t!=null,"spec.type must be defined"),t},[e])}function ui(e,t,r){const s=Je(),a=ci(e,t,r),i=di(e);Ve(function(){if(i!=null){const[l,c]=ei(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c}},[s,t,r,a,i])}function fi(e,t){const r=cn(e,t);Y(!r.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 s=oi(),a=ii(r.options,r.previewOptions);return ui(r,s,a),[ln(r.collect,s,a),Za(a),Ya(a)]}function pi(e){return g.useMemo(()=>e.hooks.dropTarget(),[e])}function hi(e){const t=Je(),r=g.useMemo(()=>new ai(t.getBackend()),[t]);return Ve(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function gi(){const e=Je();return g.useMemo(()=>new Ja(e),[e])}function mi(e){const{accept:t}=e;return g.useMemo(()=>(Y(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class xi{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function bi(e,t){const r=g.useMemo(()=>new xi(e,t),[t]);return g.useEffect(()=>{r.spec=e},[e]),r}function yi(e,t,r){const s=Je(),a=bi(e,t),i=mi(e);Ve(function(){const[l,c]=Qa(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c},[s,t,a,r,i.map(o=>o.toString()).join("|")])}function lr(e,t){const r=cn(e,t),s=gi(),a=hi(r.options);return yi(r,s,a),[ln(r.collect,s,a),pi(a)]}const Or="column",vi="flex items-center",Ci="mr-3 cursor-move text-secondary",Di=({id:e,children:t,className:r,onFind:s,onMove:a,ariaLabel:i="Drag item"})=>{const o=g.useRef(null),l=g.useRef(null),c=typeof s=="function"?s(e):-1,[{isDragging:d},f,p]=fi(()=>({type:Or,item:{id:e,originalIndex:c},collect:u=>{const m=u.getItem();return{isDragging:u.isDragging()&&m?.id===e}},end:(u,m)=>{if(!u)return;!m.didDrop()&&typeof a=="function"&&u.originalIndex>-1&&a(u.id,u.originalIndex)}}),[e,c,a]),[,h]=lr(()=>({accept:Or,hover:u=>{if(!(!u||u.id===e)&&typeof s=="function"&&typeof a=="function"){const m=s(e);a(u.id,m)}}}),[s,a,e]);return p(h(l)),f(o),n.jsxs("div",{ref:l,className:I.mergeClasses(vi,r),style:{opacity:d?0:1},"aria-roledescription":"Draggable item",children:[n.jsx("div",{ref:o,className:Ci,"aria-label":i,children:n.jsx(K.IconGripVertical,{...H.BASE_ICON_PROPS})}),t]})},Nt=({iconClassName:e,label:t,...r})=>t?n.jsx(y.DialDangerButton,{...r,label:t,appearance:E.ButtonAppearance.Ghost,iconBefore:n.jsx(K.IconTrashX,{...H.BASE_ICON_PROPS,className:e||""})}):n.jsx(w.DialDangerIconButton,{...r,appearance:E.ButtonAppearance.Ghost,icon:n.jsx(K.IconTrashX,{...H.BASE_ICON_PROPS,className:e||""})}),Ii=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...d})=>{const f=I.mergeClasses("dial-textarea dial-input px-3 py-2",d.invalid&&"dial-input-error",d.disabled&&"dial-input-disable",i?"resize":"resize-none",e);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-1",a),children:[o&&n.jsx(_e.DialLabel,{...o,htmlFor:c}),n.jsx("textarea",{id:c,value:t||"",className:f,onChange:p=>r?.(p.currentTarget.value),...d}),n.jsx(y.DialErrorText,{text:s}),!s&&n.jsx(y.DialCaptionText,{text:l})]})},Si="inline-flex items-center rounded bg-layer-3",Ni="flex flex-1 items-center justify-center gap-2 h-7 px-3 py-1 border border-primary dial-small-text whitespace-nowrap focus-visible:outline outline-offset-0 focus-visible:relative focus-visible:z-10",ji="relative z-10 bg-controls-accent-primary-alpha-active text-primary",Ti="text-secondary hover:text-primary",wi="text-controls-disable-accent cursor-not-allowed hover:text-controls-disable-accent",Ei=({options:e,value:t,onChange:r,disabled:s,className:a,ariaLabel:i})=>{const o=g.useCallback(l=>{if(s)return;const c=e.filter(h=>!h.disabled);if(c.length===0)return;const d=c.findIndex(h=>h.value===t);let f=null;switch(l.key){case"ArrowRight":case"ArrowDown":f=(d+1)%c.length;break;case"ArrowLeft":case"ArrowUp":f=(d-1+c.length)%c.length;break;case"Home":f=0;break;case"End":f=c.length-1;break;default:return}l.preventDefault();const p=c[f];p&&p.value!==t&&r(p.value)},[s,e,t,r]);return n.jsx("div",{role:"tablist","aria-label":i,className:I.mergeClasses(Si,a),children:e.map((l,c)=>{const d=l.value===t,f=c===0,p=c===e.length-1,h=s||l.disabled;return n.jsxs("button",{type:"button",role:"tab","aria-selected":d,tabIndex:d?0:-1,disabled:h,onClick:()=>r(l.value),onKeyDown:o,className:I.mergeClasses(Ni,!p&&"-mr-px",f&&"rounded-l",p&&"rounded-r",d?ji:Ti,h&&wi),children:[l.icon,l.label]},l.value)})})},Bt=8,Oi=24,un=({initialTags:e=[],label:t,required:r,elementId:s,placeholder:a,captionDescription:i,errorText:o,invalid:l,disabled:c,collapseTagOverflow:d=!1,readOnly:f=!1,containerClassName:p,tagClassName:h,onChange:u})=>{const m=g.useRef(null),v=g.useRef([]),x=g.useRef(null),[b,C]=g.useState(e),[S,j]=g.useState(""),[D,T]=g.useState(!1),[L,O]=g.useState(e.length),A=g.useCallback(B=>z=>{v.current[B]=z},[]),R=g.useCallback(()=>{if(!d)return;const B=m.current;if(!B)return;const z=B.offsetWidth;if(z===0)return;const Z=x.current?.offsetWidth??0,ne=z-(f?0:Oi)-Bt;let X=0,W=0;for(let se=0;se<b.length;se++){const te=v.current[se];if(!te)continue;const le=te.offsetWidth+Bt;if(X+le>ne)break;X+=le,W++}if(W<b.length&&W>0)for(;X+Z>ne&&W>0;){W--;const se=v.current[W]?.offsetWidth??0;X-=se+Bt}O(W)},[d,f,b.length]),N=B=>{const z=B.trim().replace(/,$/,"");if(z&&!b.includes(z)){const Z=[z,...b];C(Z),u?.(Z)}},P=B=>{(B.key===","||B.key==="Enter")&&(B.preventDefault(),N(S),j(""))},F=()=>{S.trim()&&(N(S),j(""))},U=B=>{const z=b.filter((Z,V)=>V!==B);C(z),u?.(z)},Q=()=>o?n.jsx(y.DialErrorText,{text:o}):i?n.jsx(y.DialCaptionText,{text:i}):null;g.useEffect(()=>{if(d)return;const B=new ResizeObserver(()=>{if(m.current){const z=m.current.scrollHeight>m.current.clientHeight+10;T(z)}});return m.current&&B.observe(m.current),()=>B.disconnect()},[b,d]),g.useEffect(()=>{if(!d){O(b.length);return}O(b.length);const B=new ResizeObserver(()=>{R()}),z=m.current;return z&&B.observe(z),R(),()=>B.disconnect()},[d,R,b]),g.useEffect(()=>{C(e)},[JSON.stringify(e)]);const G=n.jsxs("div",{ref:m,className:oe("flex gap-2 items-center relative",d?"flex-nowrap overflow-hidden w-full min-w-0":oe("flex-wrap",D?"flex-col-reverse":"flex-row"),p),children:[(d?b.slice(0,L):b).map((B,z)=>n.jsx(Ke,{label:B,className:h,closable:!c&&!f,onRemove:!c&&!f?()=>U(z):void 0},B+z)),d&&L<b.length&&n.jsx(E.DialTooltip,{tooltip:b.slice(L).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:n.jsx(Ke,{label:`+${b.length-L}`})}),!f&&n.jsx("input",{id:s,type:"text",value:S,onChange:B=>j(B.target.value),onKeyDown:P,onBlur:F,className:oe("dial-input outline-none !border-none w-full flex-1 !p-1 !h-auto",d?"min-w-0":"min-w-[100px]"),placeholder:a??"",disabled:c}),d&&n.jsxs("div",{className:"absolute left-0 top-0 invisible pointer-events-none h-0 overflow-hidden whitespace-nowrap","aria-hidden":!0,children:[b.map((B,z)=>n.jsx("div",{ref:A(z),className:"inline-flex shrink-0",children:n.jsx(Ke,{label:B,className:h,closable:!c&&!f,onRemove:!c&&!f?()=>U(z):void 0})},`measure-${B}-${z}`)),n.jsx("div",{ref:x,className:"inline-flex shrink-0",children:n.jsx(Ke,{label:`+${b.length}`})})]})]});return f?G:n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsx(_e.DialLabel,{label:t,required:r,htmlFor:s}),n.jsx("div",{className:oe("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:G}),Q()]})},fn=({selectedItems:e,placeholder:t,collapseTagOverflow:r=!1,listClassName:s,listElementClassName:a})=>e?.length?n.jsx(un,{readOnly:!0,initialTags:e,collapseTagOverflow:r,containerClassName:s,tagClassName:a}):t?n.jsx("span",{className:"text-secondary",children:t}):null,Ft=e=>mr.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},mr.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"})),pn=({children:e,open:t,disabled:r=!1,selectedValue:s,valueClassName:a,inputClassName:i,onOpen:o,elementId:l,errorText:c,invalid:d,emptyValueText:f,placeholder:p,editable:h=!1,onValueChange:u,collapseTagOverflow:m=!1,iconBefore:v})=>{const x=Array.isArray(s)&&s.length>0,b=typeof s=="string"&&!!s.trim(),C=x||b?s:p?void 0:f,S=r?void 0:o,j=g.useCallback(O=>{u?.(O.target.value)},[u]),D=()=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:oe("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between",i,r&&"dial-input-disable",(c||d)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[v&&n.jsx(w.DialIcon,{icon:v}),n.jsx("input",{type:"text",className:oe("flex-1 min-w-0 bg-transparent outline-none border-none p-0 dial-small-text text-primary placeholder:text-secondary",a),value:typeof s=="string"?s:"",placeholder:p||f,onChange:j,disabled:r,id:l,"aria-label":"input-popup-field"})]}),!r&&n.jsx("button",{type:"button",className:"shrink-0 cursor-pointer bg-transparent border-none p-0 ml-1",onClick:o,"aria-label":"open-popup",children:n.jsx(w.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]}),n.jsx(y.DialErrorText,{text:c})]}),T=()=>n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"w-full",onClick:S,"aria-label":"open-popup",id:l,children:n.jsxs("div",{className:oe("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",i,r&&"dial-input-disable",(c||d)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[v&&n.jsx(w.DialIcon,{icon:v}),n.jsx(E.DialTooltip,{tooltip:C==null?void 0:String(C),children:C||!p?n.jsx("span",{className:a,children:C}):n.jsx("span",{className:"text-secondary",children:p})})]}),!r&&n.jsx("div",{className:"shrink-0",children:n.jsx(w.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]})}),n.jsx(y.DialErrorText,{text:c})]}),L=()=>n.jsx("div",{className:"w-full",onClick:S,children:n.jsxs("div",{className:oe("dial-input px-3 py-2 flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",r&&"dial-input-disable"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[v&&n.jsx(w.DialIcon,{icon:v}),n.jsx(fn,{placeholder:p,selectedItems:C,collapseTagOverflow:m})]}),!r&&n.jsx("div",{className:"ml-1",children:n.jsx(w.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]})});return n.jsxs(n.Fragment,{children:[x?L():h?D():T(),t&&Xn.createPortal(e,document.body)]})},Ai=({label:e,htmlFor:t,disabled:r,selectedValue:s,radioButtons:a,customInputValue:i,valueClassName:o,inputClassName:l,emptyValueText:c,placeholder:d,onClose:f,header:p,portalId:h,onApply:u,onCancel:m,cancelButtonTitle:v="Cancel",applyButtonTitle:x="Apply",isValid:b,selectedRadioValue:C,onChangeRadioField:S,id:j,size:D=y.PopupSize.Md})=>{const[T,L]=g.useState(!1),O=g.useCallback(()=>{r||L(!0)},[r]),A=g.useCallback(()=>{L(!1),f?.()},[f]),R=g.useCallback(()=>{m?.(),A()},[m,A]),N=g.useCallback(()=>{u(),A()},[u,A]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(_e.DialLabel,{label:e,htmlFor:t}),n.jsx(pn,{disabled:r,open:T,selectedValue:i??a.find(P=>P.id===s)?.name,valueClassName:o,inputClassName:oe(l,"py-2","px-3"),emptyValueText:c,placeholder:d,onOpen:O,children:n.jsx(y.DialPopup,{open:T,onClose:R,header:p,portalId:h,size:D,footer:n.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[n.jsx(y.DialNeutralButton,{label:v,onClick:R}),n.jsx(y.DialPrimaryButton,{label:x,onClick:N,disabled:!b})]}),children:n.jsx("div",{className:"px-6 py-4",children:n.jsx(y.DialRadioGroup,{radioButtons:a,labelClassName:"dial-small-text",activeRadioButton:C,onChange:S,elementId:j,orientation:y.RadioGroupOrientation.Column})})})})]})},_i="Create",Li="Cancel",Ri="flex items-center justify-end gap-2 px-6 py-3",ki=({header:e,open:t=!1,submitLabel:r=_i,cancelLabel:s=Li,isLoading:a=!1,disableSubmitButton:i=!1,className:o,submitClassName:l,onClose:c,onSubmit:d,onCancel:f,children:p,dividers:h=!0,size:u=y.PopupSize.Md,footer:m})=>{const v=a?null:n.jsxs("div",{className:Ri,children:[n.jsx(y.DialNeutralButton,{label:s,onClick:()=>f?f():c?.()}),n.jsx(y.DialPrimaryButton,{className:l,label:r,disabled:i,onClick:()=>d()})]}),x=g.useCallback(()=>a?n.jsx("div",{className:"px-6 py-4 h-[120px]",children:n.jsx(y.DialLoader,{size:50})}):p??null,[p,a]);return n.jsx(y.DialPopup,{open:t,header:e,className:o,dividers:h,onClose:()=>c?.(),footer:m??v,size:u,children:x()})},Pi=/^0+\.(\d+)?$/,Mi=/^0+/,Yt=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=f=>!f||f==="-"?f:String(f)?.match(Pi)?String(f)?.replace(Mi,"0"):Number(f),c=f=>{if([".","-","+","e","E"].includes(f.key)){f.preventDefault();return}y.handleKeyDown(f,"number",r,s)},d=f=>{const p=f.clipboardData.getData("text"),h=p.replace(/\D/g,"");if(h!==p&&(f.preventDefault(),h)){const u=f.currentTarget,m=u.selectionStart??0,v=u.selectionEnd??0,x=u.value.slice(0,m)+h+u.value.slice(v);t?.(l(x))}};return n.jsx(y.DialInput,{type:"number",min:r,max:s,onChange:f=>t?.(l(f)),onKeyDown:e?c:a,onPaste:e?d:i,...o})},Bi=({onClick:e})=>n.jsx(K.IconEyeOff,{...H.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),Fi=({onClick:e})=>n.jsx(K.IconEye,{...H.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),hn=({...e})=>{const[t,r]=g.useState(!1),s=g.useCallback(a=>{r(a)},[]);return n.jsx(y.DialInput,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?n.jsx(Bi,{onClick:()=>s(!1)}):n.jsx(Fi,{onClick:()=>s(!0)})})},gn=({options:e,selectedValues:t,handleRemoveTag:r})=>n.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(s=>{const a=e.find(o=>o.value===s)?.label??s,i=e.find(o=>o.value===s)?.icon;return n.jsx(Ke,{label:a,onRemove:o=>r?.(o,s),icon:i?n.jsx(w.DialIcon,{icon:i}):null,className:"max-w-full"},s)})});var mt=(e=>(e.Sm="sm",e.Md="md",e))(mt||{}),xt=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(xt||{});const zi="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",$i="w-full rounded flex flex-col",st="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",Ki="bg-accent-primary-alpha",Xt="bg-accent-primary-alpha border-l border-accent-primary border-1",bt="opacity-75",Hi=352,Vi=4,Gi=n.jsx(K.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM}),Ui=({opt:e,selectedValues:t,onSelect:r})=>{const{isOpen:s,refs:a,floatingStyles:i,context:o,getReferenceProps:l,getFloatingProps:c}=w.useSubMenuFloating(Vi,"listbox",!!e.disabled),d=e.children?.some(f=>t.includes(f.value));return n.jsxs(n.Fragment,{children:[n.jsxs("button",{ref:a.setReference,type:"button",role:"option","aria-haspopup":"listbox","aria-expanded":s,"aria-selected":!!d,"aria-disabled":!!e.disabled,disabled:e.disabled,className:oe(st,d&&Xt,e.disabled&&bt),...l(),children:[n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.icon&&n.jsx(w.DialIcon,{icon:e.icon}),n.jsx(w.DialEllipsisTooltip,{text:e.labelNode??e.label})]}),n.jsx(K.IconChevronRight,{size:14,className:"shrink-0"})]}),s&&n.jsx(w.SubMenuPanel,{refs:a,floatingStyles:i,context:o,getFloatingProps:c,role:"listbox",className:"w-max py-1",children:e.children.map(f=>{const p=t.includes(f.value);return n.jsx("button",{type:"button",role:"option","aria-selected":p,"aria-disabled":!!f.disabled,disabled:f.disabled,className:oe(st,p&&Xt,f.disabled&&bt),onClick:()=>!f.disabled&&r(f.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f.icon&&n.jsx(w.DialIcon,{icon:f.icon}),n.jsx(w.DialEllipsisTooltip,{text:f.labelNode??f.label})]})},f.value)})})]})},Ne=({options:e,multiple:t=!1,elementId:r,value:s,defaultValue:a,variant:i=xt.Primary,size:o=mt.Md,prefix:l,customSelectedValue:c,placeholder:d="Select...",searchable:f=!1,searchSize:p=E.ElementSize.Standard,searchPlaceholder:h,selectAll:u=!1,invalid:m,selectAllLabel:v="Select all",emptyStateTitle:x="No options available",emptyStateDescription:b,emptyStateIcon:C,disabled:S=!1,className:j,listClassName:D,closable:T=!1,header:L,footer:O,onClose:A,onChange:R,inlineSearch:N=!1,dismissRef:P,onFooterClick:F,open:U,onOpenChange:Q,onInlineQueryChange:G,customMultiSelectTagsRenderer:B})=>{const z=g.useId(),[Z,V]=g.useState(!1),ne=U!==void 0,X=ne?!!U:Z,W=g.useCallback(_=>{ne||V(_),Q?.(_)},[ne,Q]),[se,te]=g.useState(N&&c||""),le=g.useRef(null),ue=g.useCallback(_=>{_!==se&&(te(_||""),G?.(_||""))},[G,se]),pe=s!==void 0,[he,fe]=g.useState(a),q=pe?s:he,ee=g.useMemo(()=>t?Array.isArray(q)?q:[]:typeof q=="string"?[q]:[],[q,t]),Ie=g.useMemo(()=>{const _=se.trim().toLowerCase();return _?e.filter(re=>re.label.toLowerCase().includes(_)):e},[e,se]);g.useEffect(()=>{!X&&!N&&ue("")},[N,X,ue]);const Me=g.useRef(c);g.useEffect(()=>{N&&c!==Me.current&&(X||(Me.current=c,ue(c||"")))},[c,N,X,ue]);const ge=g.useCallback(_=>{pe||fe(_),R?.(_)},[pe,R]),Be=g.useCallback(_=>{if(t){const re=new Set(ee);re.has(_)?re.delete(_):re.add(_),ge(Array.from(re));return}if(ge(_),N){const re=e.find(xe=>xe.value===_)??e.flatMap(xe=>xe.children??[]).find(xe=>xe.value===_);re&&ue(re.label)}W(!1)},[t,ge,N,W,ee,e,ue]),Te=g.useCallback((_,re)=>{if(_.stopPropagation(),!t){ge("");return}const xe=ee.filter(Ot=>Ot!==re);ge(xe)},[t,ee,ge]),ae=g.useMemo(()=>Ie.filter(_=>!_.disabled),[Ie]),Le=g.useMemo(()=>ae.filter(_=>ee.includes(_.value)).length,[ae,ee]),Se=g.useCallback(_=>{N&&!t&&!_&&Be(se),W(_)},[Be,N,t,se,W]),{allSelectedInFiltered:Fe,someSelectedInFiltered:rt}=g.useMemo(()=>{const _=ae.length>0&&Le===ae.length;return{allSelectedInFiltered:_,someSelectedInFiltered:Le>0&&!_}},[ae,Le]),ve=g.useCallback(()=>{if(!(!t||ae.length===0))if(Fe){const _=new Set(ae.map(re=>re.value));ge(ee.filter(re=>!_.has(re)))}else{const _=new Set(ee);ae.forEach(re=>_.add(re.value)),ge(Array.from(_))}},[Fe,t,ae,ee,ge]),ze=ee.length>0;g.useEffect(()=>{X&&N&&!t&&!S&&requestAnimationFrame(()=>{const _=le.current;if(!_)return;_.focus();const re=_.value?.length??0;_.setSelectionRange?.(re,re)})},[X,N,t,S]);const Re=!t&&ze?ee[0]:void 0,me=g.useMemo(()=>Re?e.find(_=>_.value===Re)??e.flatMap(_=>_.children??[]).find(_=>_.value===Re):void 0,[e,Re]),Et=g.useCallback(()=>t?ze?B?.(e,ee,Te)||n.jsx(gn,{options:e,selectedValues:ee,handleRemoveTag:Te}):n.jsx("span",{className:"text-secondary truncate",children:d}):me?n.jsxs(n.Fragment,{children:[me.icon&&n.jsx(w.DialIcon,{icon:me.icon}),n.jsx(w.DialEllipsisTooltip,{text:me.labelNode??(l?`${l} ${me.label}`:me.label)}),me?.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:me.description})]}):c&&s?c:n.jsx("span",{className:"text-secondary truncate",children:d}),[ze,t,c,l,s,d,me,e,ee,Te,B]);g.useImperativeHandle(P,()=>({dismiss:()=>{W(!1)}}));const we=g.useCallback(()=>{ue(ee.length===1?me?.label??se:"")},[se,ee.length,ue,me?.label]),$e=g.useCallback(()=>{S||(W(!X),N&&!t&&(we(),le.current?.focus()))},[S,N,X,t,we,W]);return n.jsx(w.DialDropdown,{open:X,onOpenChange:Se,disabled:S,closable:T,onClose:A,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:f?null:Hi,listClassName:D,renderOverlay:()=>n.jsxs("div",{id:`list-${r||z}`,role:"listbox","aria-multiselectable":t||void 0,className:$i,children:[L&&n.jsx(n.Fragment,{children:typeof L=="function"?L():L}),(f||T)&&e.length>8&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[f&&n.jsx(y.DialSearch,{size:p,placeholder:h,onChange:ue,value:se,id:`search-${r||z}`,containerClassName:I.mergeClasses(y.SIZE_CONFIG[p].containerClassName,"w-full")}),T&&n.jsx(y.DialButton,{"aria-label":"Close select",className:"shrink-0",iconBefore:n.jsx(K.IconX,{size:H.DIAL_ICON_SIZE.SM}),onClick:_=>{A?.(_),W(!1)}})]}),t&&u&&ae.length>0&&n.jsx("div",{className:oe(st,"mt-2"),children:n.jsx(Gt,{id:`${r||z}-selectAll`,label:v,checked:Fe,indeterminate:rt,onChange:ve,ariaLabel:v})}),n.jsx("div",{className:oe("overflow-y-auto max-h-[352px]",N&&Ie.length===0?"":"py-1"),children:Ie.length===0?!N&&n.jsx("div",{className:"px-2 py-3",children:n.jsx(w.DialNoDataContent,{icon:C??n.jsx(K.IconClipboardX,{size:H.DIAL_ICON_SIZE.LG,stroke:.5}),title:x,description:b})}):Ie.map(_=>{const re=ee.includes(_.value);return t?n.jsxs("div",{role:"option","aria-selected":re,"aria-disabled":!!_.disabled,className:oe(st,re&&Ki,_.disabled&&bt,"w-full"),children:[n.jsx(Gt,{id:`${r||z}-${_.value}`,label:n.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[_.icon&&n.jsx(w.DialIcon,{icon:_.icon}),n.jsx("span",{className:"truncate",children:_.labelNode??_.label})]}),checked:re,disabled:_.disabled,onChange:()=>!_.disabled&&Be(_.value),ariaLabel:_.label}),_.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:_.description})]},_.value):_.children?.length?n.jsx(Ui,{opt:_,selectedValues:ee,onSelect:Be},_.value):n.jsx("button",{role:"option",type:"button","aria-selected":re,"aria-disabled":!!_.disabled,disabled:_.disabled,className:oe(st,re&&Xt,_.disabled&&bt),onClick:()=>!_.disabled&&Be(_.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[_.icon&&n.jsx(w.DialIcon,{icon:_.icon}),n.jsx(w.DialEllipsisTooltip,{text:_.labelNode??_.label}),_.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:_.description})]})},_.value)})}),O&&n.jsx("div",{onClick:_=>{F?.(_),F&&W(!1)},children:typeof O=="function"?O():O})]}),children:n.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":X,"aria-controls":`list-${r||z}`,className:I.mergeClasses(zi,S&&"opacity-75 !cursor-not-allowed !border-primary",o===mt.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",m&&"dial-input-error",i===xt.Secondary?"!bg-layer-4 !h-auto":"",j),onMouseDown:_=>{S||N&&!t&&(we(),_.preventDefault())},onClick:()=>{$e()},onKeyDown:_=>{(_.key===" "||_.code==="Space")&&(_.preventDefault(),$e())},children:[N&&!t?n.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:n.jsx("input",{id:`inline-${r||z}`,type:"text",placeholder:h??d,value:se||"",onChange:_=>ue(_.currentTarget.value.trimStart()),onFocus:()=>!S&&W(!0),onMouseDown:_=>{we(),_.stopPropagation()},onClick:_=>{_.stopPropagation()},onKeyDown:_=>{_.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref:le,disabled:S,"aria-disabled":S,autoComplete:"off"})}):n.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:Et()}),!N&&n.jsx(w.DialIcon,{icon:Gi,className:oe("text-primary",X&&"rotate-180")})]})})},Wi=({label:e,required:t,captionDescription:r,containerClassName:s,selectClassName:a,error:i,id:o,caption:l,readonly:c,value:d,defaultEmptyText:f,...p})=>{const h=g.useCallback(()=>{if(!d||Array.isArray(d)&&d.length===0)return f??"None";if(Array.isArray(d))return n.jsx(gn,{options:p.options,selectedValues:d});{const u=p.options?.find(m=>m.value===d);return n.jsx("span",{"aria-readonly":!0,className:"text-primary",children:u?.label||d})}},[d,p.options,f]);return n.jsx(y.DialFormItem,{id:o,label:e,required:t,description:l,error:i,captionDescription:r,className:s,readonly:c,value:h(),defaultEmptyText:f,children:n.jsx(Ne,{className:a,value:d,elementId:o,invalid:!!i,...p})})};function mn(e){let t=null;return()=>(t==null&&(t=e()),t)}function qi(e,t){return e.filter(r=>r!==t)}function Zi(e,t){const r=new Set,s=i=>r.add(i);e.forEach(s),t.forEach(s);const a=[];return r.forEach(i=>a.push(i)),a}class Yi{enter(t){const r=this.entered.length,s=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=Zi(this.entered.filter(s),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=qi(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Xi{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 r={};Object.keys(this.config.exposeProperties).forEach(s=>{const a=this.config.exposeProperties[s];a!=null&&(r[s]={value:a(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const jt="__NATIVE_FILE__",xn="__NATIVE_URL__",bn="__NATIVE_TEXT__",yn="__NATIVE_HTML__",Ar=Object.freeze(Object.defineProperty({__proto__:null,FILE:jt,HTML:yn,TEXT:bn,URL:xn},Symbol.toStringTag,{value:"Module"}));function zt(e,t,r){const s=t.reduce((a,i)=>a||e.getData(i),"");return s??r}const Jt={[jt]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[yn]:{exposeProperties:{html:(e,t)=>zt(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[xn]:{exposeProperties:{urls:(e,t)=>zt(e,t,"").split(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./use-file-manager-tabs-BhQiRABT.cjs"),_e=require("./Switch-CfxMs3AZ.cjs"),n=require("react/jsx-runtime"),g=require("react"),K=require("@tabler/icons-react"),oe=require("classnames"),w=require("./DateCellRenderer-CWkRbOzj.cjs"),H=require("./icon-CrGVkVpG.cjs"),I=require("./merge-classes-BEJXjzkx.cjs"),k=require("./DateCellRenderer-lgC9R6XK.cjs"),E=require("./IconButton-CVttu-k-.cjs"),Xn=require("react-dom"),lt=require("./lazy-BEsZqouS.cjs"),de=require("@floating-ui/react"),ie=require("./icon-DhjrDQ8I.cjs");function Jn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const mr=Jn(g),Ke=({label:e,className:t,icon:r,selected:s,closable:a,onClick:i,onRemove:o})=>{const l=I.mergeClasses("flex items-center gap-1 cursor-pointer dial-tiny-text px-2 h-[24px] border text-primary rounded-[8px]",s?"hover:bg-controls-accent-primary-alpha-active bg-accent-primary-alpha border-accent-primary":"bg-neutral border-primary",t);return n.jsxs("div",{className:l,onClick:i,children:[n.jsx(w.DialIcon,{icon:r}),n.jsx(w.DialEllipsisTooltip,{text:e}),a&&o&&n.jsx(y.DialButton,{className:"p-0",iconAfter:n.jsx(K.IconX,{size:H.DIAL_ICON_SIZE.SM}),onClick:c=>o(c)})]},e)},er=({label:e="Error",className:t})=>n.jsx(Ke,{label:e,className:I.mergeClasses("dial-tiny-semi-text cursor-default rounded-[120px] border-transparent bg-error text-error",t)});var at=(e=>(e.Default="default",e.Compact="compact",e))(at||{});const Qn={[at.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[at.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},es=({title:e,value:t,description:r,variant:s=at.Default,error:a,isLoading:i,className:o,delta:l,deltaPositive:c,deltaUnit:d,compareValues:f})=>{const p=Qn[s],h=c!==void 0?c:(l??0)>=0,u=l===void 0?null:`${l>=0?`+${l}`:String(l)}${d??""}`;return n.jsxs("div",{className:I.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||i?"gap-2":"gap-1",p.container,o),children:[l!==void 0?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:p.title,children:e}),n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",h?"bg-success text-success":"bg-error text-error"),children:u})]}):n.jsx("span",{className:p.title,children:e}),a?n.jsx(er,{className:"self-start"}):i?n.jsx(y.DialLoader,{fullWidth:!1,className:"self-start"}):f?n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(w.DialEllipsisTooltip,{text:f[0].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:p.value,children:f[0].value})]}),n.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(w.DialEllipsisTooltip,{text:f[1].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:p.value,children:f[1].value})]})]}):n.jsx("span",{className:p.value,children:t}),!a&&!i&&p.showDescription&&r!=null&&r!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},tr=[{from:0,to:.1,color:"#F26B5B"},{from:.1,to:.2,color:"#E5764A"},{from:.2,to:.3,color:"#E08C3F"},{from:.3,to:.4,color:"#D9A638"},{from:.4,to:.5,color:"#D4BE3A"},{from:.5,to:.6,color:"#B8C94A"},{from:.6,to:.7,color:"#7EC96B"},{from:.7,to:.8,color:"#4ECBA8"},{from:.8,to:.9,color:"#4EC5C5"},{from:.9,to:1,color:"#4DC87A"},{from:1,to:1,color:"#30E070"}],ts=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),rs=(e,t)=>{if(e<=0)return;let r;for(const s of t)(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=s.color);return r},ft=({value:e,maxValue:t=1,error:r,isLoading:s,title:a,valueLabel:i,colorMap:o=tr,className:l,titleClassName:c,valueClassName:d,inline:f,ariaLabel:p})=>{const h=e==null,u=!!(r||s||!h),m=ts(h?0:e,t),v=rs(m,o),x=i??(h?"—":e),b=p??(typeof a=="string"?a:void 0),C=r||s,S=r?n.jsx(er,{}):s?n.jsx(y.DialLoader,{fullWidth:!1}):n.jsx("span",{className:I.mergeClasses("shrink-0 tabular-nums text-end",f?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",d),children:x}),j=u?n.jsx("div",{role:"progressbar","aria-valuenow":r||s||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":b,className:I.mergeClasses("w-full overflow-hidden rounded-sm",f?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!C&&n.jsx("div",{className:"h-full rounded-sm transition-[width] duration-300",style:{width:`${m*100}%`,backgroundColor:v}})}):null,D=n.jsx("span",{className:I.mergeClasses("dial-small-text text-primary",c),children:a});return f?n.jsxs("div",{className:I.mergeClasses("flex flex-row items-center gap-2",l),children:[n.jsx("div",{className:"w-1/2 min-w-0",children:D}),n.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[n.jsx("div",{className:"min-w-0 flex-1",children:j}),S]})]}):n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-1",l),children:[n.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[D,S]}),j]})},Yr=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,onToggle:l,className:c,headerClassName:d,contentClassName:f})=>{const p=s!==void 0,[h,u]=g.useState(a),m=o?!0:p?s:h,v=g.useId(),x=()=>{if(i)return;const b=!m;p||u(b),l?.(b)};return n.jsxs("div",{className:I.mergeClasses("rounded border border-secondary",c),children:[n.jsxs("button",{type:"button","aria-expanded":m,"aria-controls":v,disabled:i||o,onClick:x,className:I.mergeClasses("flex w-full items-center gap-2 p-4 text-left",i?"cursor-not-allowed":"cursor-pointer",o&&"cursor-default",d),children:[!o&&n.jsx(w.DialIcon,{className:oe("text-secondary transition-transform",m&&"rotate-90"),icon:n.jsx(K.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM})}),n.jsx("span",{className:"dial-body-text text-primary",children:e}),t!=null&&t!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:t})]}),m&&n.jsx("div",{id:v,role:"region",className:I.mergeClasses("px-4 pb-4",f),children:r})]})},ns=({title:e,titleTooltip:t,description:r,data:s,compareData:a,compareLabels:i,maxValue:o,colorMap:l,defaultExpanded:c=!0,nonCollapsible:d,isLoading:f,onBarClick:p,inline:h,barTitleClassName:u,barValueClassName:m,barClassName:v,barDescriptions:x,className:b})=>{const C=Object.entries(s),S=h?I.mergeClasses("text-secondary",u):u,j=i?"dial-tiny-text text-secondary":void 0,D=t?n.jsx(E.DialTooltip,{tooltip:t,children:e}):e,T=a?[...new Set([...Object.keys(s),...Object.keys(a)])]:[],L="cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-primary",O="group flex flex-col gap-1.5",A=I.mergeClasses("flex flex-col gap-1.5 pl-2",p&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",v);return n.jsx(Yr,{title:D,description:r,defaultExpanded:c,nonCollapsible:d,className:b,children:n.jsx("div",{className:I.mergeClasses("flex flex-col",a?"gap-4":h?"gap-2":"gap-3"),children:f?n.jsx(y.DialLoader,{fullWidth:!1,className:"self-center"}):a?T.map(R=>{const N=R in s?s[R]:null,P=R in a?a[R]:null,U=typeof N=="number"&&typeof P=="number"?parseFloat((P-N).toFixed(3)):null,Q=U!=null&&U!==0,G=Q&&U>0,B=Q?G?`+${U}`:String(U):null,z=x?.[R],Z=n.jsx("span",{className:"dial-small-text text-secondary",children:R}),V=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[z?n.jsx(E.DialTooltip,{tooltip:z,children:Z}):Z,B!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",G?"bg-success text-success":"bg-error text-error"),children:B})]}),n.jsxs("div",{className:A,children:[n.jsx(ft,{title:i?.[0],value:N,maxValue:o,colorMap:l,inline:h,titleClassName:j,ariaLabel:R}),n.jsx(ft,{title:i?.[1],value:P,maxValue:o,colorMap:l,inline:h,titleClassName:j,ariaLabel:`${R} compare`})]})]});return p?n.jsx("button",{type:"button",onClick:()=>p(R,N),className:I.mergeClasses(O,L),children:V},R):n.jsx("div",{className:O,children:V},R)}):C.map(([R,N])=>{const P=n.jsx(ft,{title:R,value:N,maxValue:o,colorMap:l,inline:h,titleClassName:S,valueClassName:m,className:v}),F=p?n.jsx("button",{type:"button",onClick:()=>p(R,N),className:L,children:P}):P,U=x?.[R];return U?n.jsx(E.DialTooltip,{tooltip:U,triggerClassName:"flex flex-col",children:F},R):n.jsx(g.Fragment,{children:F},R)})})})},ss="#FF4E50",as=(e,t)=>{let r=-1;return t.forEach((s,a)=>{(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=a)}),r},xr=(e,t)=>{const r=t.map(()=>0);let s=0;e.forEach(c=>{if(c<=0){s+=1;return}const d=as(c,t);d>=0&&(r[d]+=1)});const a=Math.max(0,s,...r),i=c=>a>0?c/a:0,o={from:0,to:0,color:ss,count:s,ratio:i(s),isZeroBucket:!0},l=t.map((c,d)=>({from:c.from,to:c.to,color:c.color,count:r[d],ratio:i(r[d]),isZeroBucket:!1}));return[o,...l]},Xr=e=>e<=0?2:e%2===0?e:e+1,is=e=>{const t=Xr(e);return[t,t/2,0]},At=e=>`${Math.round(e*100)/100}`,Jr=(e,t)=>e===t?At(e):`${At(e)}-${At(t)}`,_t=128,os=(e,t)=>{const r=Jr(e,t);return e===t?`scored ${r}`:`scored between ${r}`},br=(e,t,r,s,a)=>n.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&n.jsx("strong",{children:e}),n.jsxs("span",{children:[t," out of ",r," ",s]}),n.jsx("span",{children:os(a.from,a.to)})]}),ls=({title:e,values:t,colorMap:r=tr,valueTitle:s="values",showCount:a,isLoading:i,className:o,compareValues:l,valueSetLabel:c,compareValueSetLabel:d})=>{const f=xr(t,r),p=l?xr(l,r):void 0,h=t.length,u=l?.length??0,m=Math.max(h,u),v=Xr(m),x=is(m),b=D=>D.map(T=>({...T,ratio:v>0?T.count/v:0})),C=b(f),S=p?b(p):void 0,j=(D,T,L,O)=>{if(D.count===0)return n.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:n.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${D.ratio*100}%`}})});const A=O?{backgroundImage:`repeating-linear-gradient(135deg, ${D.color} 0px, ${D.color} 1px, transparent 1px, transparent 4px)`,borderColor:D.color}:{backgroundColor:D.color};return n.jsx(E.DialTooltip,{placement:"bottom",tooltip:T,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":L,className:"flex min-h-2 w-full items-center justify-center rounded-sm border border-transparent",style:{height:`${D.ratio*100}%`,...A},children:a&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:D.count})})})};return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",o),children:[n.jsx("span",{className:"dial-small-text text-primary",children:e}),i?n.jsx("div",{className:"flex items-center justify-center",style:{height:_t},children:n.jsx(y.DialLoader,{fullWidth:!1})}):n.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1",children:[n.jsx("div",{"data-histogram-y-axis":!0,"aria-hidden":"true",className:"relative",style:{height:_t},children:x.map((D,T)=>n.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${T/(x.length-1)*100}%`,transform:"translateY(-50%)"},children:D},D))}),n.jsxs("div",{className:"relative min-w-0",children:[x.map((D,T)=>n.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${T/(x.length-1)*100}%`}},D)),n.jsx("div",{className:"relative flex items-end gap-1",style:{height:_t},children:S?C.map((D,T)=>{const L=S[T],O=`${D.count} out of ${h} ${s}`,A=`${L.count} out of ${u} ${s}`;return n.jsxs("div",{className:"flex h-full flex-1 items-end",children:[j(D,br(c,D.count,h,s,D),O,!0),j(L,br(d,L.count,u,s,L),A,!1)]},T)}):C.map((D,T)=>{const L=`${D.count} out of ${h} ${s}`;return D.count===0?n.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:n.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${D.ratio*100}%`}})},T):n.jsx(E.DialTooltip,{placement:"bottom",tooltip:L,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":L,className:I.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-sm border","border-transparent"),style:{height:`${D.ratio*100}%`,backgroundColor:D.color},children:a&&D.count>0&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:D.count})})},T)})})]}),n.jsx("div",{}),n.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:C.map((D,T)=>n.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:Jr(D.from,D.to)},T))})]})]})},cs=({value:e,max:t=100,size:r=E.ElementSize.Standard,labelProps:s,valueLabel:a,id:i,className:o,"aria-label":l,...c})=>{const d=g.useId(),f=i??d,p=!!s?.label,h=p?s?.id??`${f}-label`:void 0,u=t>0?t:0,m=Number.isFinite(e)?e:0,v=Math.min(Math.max(m,0),u),x=u>0?v/u*100:0,b=n.jsx("div",{...c,id:f,role:"progressbar","aria-valuenow":v,"aria-valuemin":0,"aria-valuemax":u,"aria-labelledby":h,"aria-label":E.resolveAccessibleName(l,p?void 0:"Progress"),className:I.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===E.ElementSize.Small?"h-1":"h-2",o,!p&&!a&&w.DIAL_KIT_CLASS.progressBar),children:n.jsx("div",{style:{width:`${x}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!p&&!a?b:n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-1",w.DIAL_KIT_CLASS.progressBar),children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[s&&n.jsx(k.Label,{...s,id:h}),a&&n.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),b]})},ds=7,us=2,fs=e=>e<=0?[]:Array.from({length:e},(t,r)=>r+1);var pt=(e=>(e.Active="active",e.Adjacent="adjacent",e.Far="far",e))(pt||{});const ps=(e,t,r)=>e===t?"active":r<ds||Math.abs(e-t)<=us?"adjacent":"far",hs=({page:e,totalPages:t,onPageChange:r,className:s})=>{const a=fs(t);return n.jsxs("nav",{"aria-label":"Pagination",className:I.mergeClasses("flex items-center gap-2",s),children:[n.jsx(E.DialIconButton,{icon:n.jsx(K.IconCaretLeftFilled,{size:H.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:E.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e<=1,onClick:()=>r(e-1),"aria-label":"Previous page"}),n.jsx("div",{className:"flex flex-row items-center gap-2",children:a.map(i=>{const o=ps(i,e,t);return n.jsx("button",{type:"button",onClick:()=>r(i),"aria-label":`Page ${i}`,"aria-current":i===e?"page":void 0,className:I.mergeClasses("dial-pagination-dot rounded-full focus-visible:outline outline-offset-0 transition-all duration-300 ease-in-out",o===pt.Active&&"h-[8px] w-[32px]",o===pt.Adjacent&&"size-[8px]",o===pt.Far&&"size-[4px]")},i)})}),n.jsx(E.DialIconButton,{icon:n.jsx(K.IconCaretRightFilled,{size:H.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:E.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e>=t,onClick:()=>r(e+1),"aria-label":"Next page"})]})},Gt=({label:e,id:t,checked:r,indeterminate:s,disabled:a,ariaLabel:i,onChange:o,className:l,...c})=>{const d=g.useCallback(u=>{o?.(u.target.checked,t)},[o,t]),f=oe("flex flex-row items-center cursor-pointer text-accent-primary small-medium min-w-0",`${r||s?"":'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded'}`,a?"pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4":"",l),p=oe("border rounded",a?"bg-layer-4 border-icon-secondary":""),h=()=>s?n.jsx(K.IconMinus,{className:p,...H.BASE_ICON_PROPS}):r?n.jsx(K.IconCheck,{className:p,...H.BASE_ICON_PROPS}):null;return n.jsxs("label",{...c,className:f,htmlFor:t,"aria-description":c["aria-description"]||w.ariaDescription,children:[h(),e&&(typeof e=="string"?n.jsx(w.DialEllipsisTooltip,{text:e,className:"ml-2 text-primary"}):e),n.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:d,id:t,checked:r,"aria-checked":s?"mixed":r,"aria-disabled":a||void 0,"aria-label":e?void 0:i,className:"invisible size-0"})]})};var ye=(e=>(e.VALID="valid",e.ERROR="error",e))(ye||{});const gs=(e,t)=>{if(t===e.id)switch(e.status){case ye.VALID:return"border-accent-secondary text-primary";case ye.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case ye.VALID:return"border-primary text-primary";case ye.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},ms=(e,t)=>{if(t===e.id)switch(e.status){case ye.VALID:return"bg-accent-secondary";case ye.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case ye.VALID:return"bg-accent-secondary";case ye.ERROR:return"bg-red-400";default:return"bg-layer-4"}},xs=({step:e,index:t,currentStep:r,onChangeStep:s})=>{const a="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny-text cursor-pointer dial-step",i="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",o=()=>r===e.id&&e.status===ye.ERROR?n.jsx(K.IconExclamationCircle,{stroke:2,size:H.DIAL_ICON_SIZE.SM}):r!==e.id&&e.status===ye.VALID?n.jsx(K.IconCheck,{stroke:2,size:H.DIAL_ICON_SIZE.SM}):t+1;return n.jsxs("button",{className:oe(a,gs(e,r)),onClick:()=>s(e.id),children:[n.jsx("span",{className:oe(i,ms(e,r)),children:o()}),n.jsx("span",{children:e.name})]})},bs=({steps:e,currentStep:t,onChangeStep:r})=>{const s=a=>{const i=e.findIndex(c=>c.id===t),o=e.findIndex(c=>c.id===a);if(a===t)return;(e.slice(0,o).every(c=>c.status===ye.VALID)||o<i)&&r(a)};return n.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,i)=>n.jsx(xs,{currentStep:t,onChangeStep:s,step:a,index:i},a.id))})},Lt=e=>(e.toString().split(".")[1]??"").length,ys=({value:e,min:t=0,max:r=1,step:s=.1,disabled:a=!1,labelProps:i,labels:o,formatValue:l,onChange:c,className:d,trackClassName:f,fillClassName:p,thumbClassName:h,labelsClassName:u,"aria-label":m,"aria-labelledby":v,...x})=>{const b=g.useRef(null),C=Math.max(0,Math.min(100,(e-t)/(r-t)*100)),S=Lt(s),j=l?l(e):e.toFixed(S),D=g.useCallback(A=>{const R=b.current;if(!R)return e;const N=R.getBoundingClientRect(),P=(A-N.left)/N.width,F=t+P*(r-t),U=Lt(s),Q=parseFloat((Math.round((F-t)/s)*s+t).toFixed(U));return Math.min(r,Math.max(t,Q))},[t,r,s,e]),T=g.useCallback(A=>{a||(A.currentTarget.setPointerCapture(A.pointerId),c?.(D(A.clientX)))},[a,D,c]),L=g.useCallback(A=>{a||A.buttons===0||c?.(D(A.clientX))},[a,D,c]),O=g.useCallback(A=>{if(a)return;const R=Lt(s),N=U=>parseFloat((Math.round((U-t)/s)*s+t).toFixed(R)),P=U=>Math.min(r,Math.max(t,U));let F=e;switch(A.key){case"ArrowRight":case"ArrowUp":F=P(N(e+s));break;case"ArrowLeft":case"ArrowDown":F=P(N(e-s));break;case"Home":F=t;break;case"End":F=r;break;default:return}A.preventDefault(),F!==e&&c?.(F)},[a,e,s,t,r,c]);return n.jsxs("div",{className:I.mergeClasses("flex flex-col",a&&"pointer-events-none opacity-50",d),...x,children:[i&&n.jsx(_e.DialLabel,{...i,htmlFor:x.id}),n.jsxs("div",{ref:b,className:"relative flex h-[38px] cursor-pointer items-center",onPointerDown:T,onPointerMove:L,children:[n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute inset-x-0 h-3 rounded-[10px] bg-layer-1",f)}),n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute left-0 h-3 rounded-[10px] bg-controls-accent-primary",p),style:{width:`${C}%`}}),n.jsx("div",{role:"slider",tabIndex:a?-1:0,"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":r,"aria-disabled":a||void 0,"aria-label":m,"aria-labelledby":v,className:I.mergeClasses("dial-small-text absolute -translate-x-1/2 flex size-[38px] cursor-grab select-none items-center justify-center rounded-full bg-layer-3 text-primary shadow focus:outline-none focus-visible:ring-2 focus-visible:ring-focus",h),style:{left:`${C}%`},onKeyDown:O,children:j})]}),o&&n.jsx("div",{className:I.mergeClasses("dial-tiny-text flex text-secondary",u),children:o.length===3?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:o[0]}),n.jsx("span",{className:"flex-1 text-center",children:o[1]}),n.jsx("span",{children:o[2]})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:o[0]}),n.jsx("span",{className:"ml-auto",children:o[1]})]})})]})},vs=({label:e,text:t,tooltip:r,children:s,postfix:a,className:i})=>n.jsxs("div",{className:I.mergeClasses("flex flex-col",s?"":"max-w-[200px]",i),children:[e&&n.jsx("label",{className:"dial-tiny-text mb-2 text-secondary",children:e}),s||n.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[n.jsx(E.DialTooltip,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),Qr=g.createContext({dragDropManager:void 0});function Ce(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 yr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),vr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Cr={INIT:"@@redux/INIT"+vr(),REPLACE:"@@redux/REPLACE"+vr()};function Cs(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 Ds(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(Ns(e))return"date";if(Ss(e))return"error";var r=Is(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function Is(e){return typeof e.constructor=="function"?e.constructor.name:null}function Ss(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Ns(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Ze(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Ds(e)),t}function en(e,t,r){var s;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Ce(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 r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Ce(1):"Expected the enhancer to be a function. Instead, received: '"+Ze(r)+"'");return r(en)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Ce(2):"Expected the root reducer to be a function. Instead, received: '"+Ze(e)+"'");var a=e,i=t,o=[],l=o,c=!1;function d(){l===o&&(l=o.slice())}function f(){if(c)throw new Error(process.env.NODE_ENV==="production"?Ce(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 i}function p(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ce(4):"Expected the listener to be a function. Instead, received: '"+Ze(v)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Ce(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 x=!0;return d(),l.push(v),function(){if(x){if(c)throw new Error(process.env.NODE_ENV==="production"?Ce(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.");x=!1,d();var C=l.indexOf(v);l.splice(C,1),o=null}}}function h(v){if(!Cs(v))throw new Error(process.env.NODE_ENV==="production"?Ce(7):"Actions must be plain objects. Instead, the actual type was: '"+Ze(v)+"'. 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 v.type>"u")throw new Error(process.env.NODE_ENV==="production"?Ce(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?Ce(9):"Reducers may not dispatch actions.");try{c=!0,i=a(i,v)}finally{c=!1}for(var x=o=l,b=0;b<x.length;b++){var C=x[b];C()}return v}function u(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ce(10):"Expected the nextReducer to be a function. Instead, received: '"+Ze(v));a=v,h({type:Cr.REPLACE})}function m(){var v,x=p;return v={subscribe:function(C){if(typeof C!="object"||C===null)throw new Error(process.env.NODE_ENV==="production"?Ce(11):"Expected the observer to be an object. Instead, received: '"+Ze(C)+"'");function S(){C.next&&C.next(f())}S();var j=x(S);return{unsubscribe:j}}},v[yr]=function(){return this},v}return h({type:Cr.INIT}),s={dispatch:h,subscribe:p,getState:f,replaceReducer:u},s[yr]=m,s}function Y(e,t,...r){if(js()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let s;if(t===void 0)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;s=new Error(t.replace(/%s/g,function(){return r[a++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}function js(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function Ts(e,t,r){return t.split(".").reduce((s,a)=>s&&s[a]?s[a]:r||null,e)}function ws(e,t){return e.filter(r=>r!==t)}function tn(e){return typeof e=="object"}function Es(e,t){const r=new Map,s=i=>{r.set(i,r.has(i)?r.get(i)+1:1)};e.forEach(s),t.forEach(s);const a=[];return r.forEach((i,o)=>{i===1&&a.push(o)}),a}function Os(e,t){return e.filter(r=>t.indexOf(r)>-1)}const rr="dnd-core/INIT_COORDS",vt="dnd-core/BEGIN_DRAG",nr="dnd-core/PUBLISH_DRAG_SOURCE",Ct="dnd-core/HOVER",Dt="dnd-core/DROP",It="dnd-core/END_DRAG";function Dr(e,t){return{type:rr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const As={type:rr,payload:{clientOffset:null,sourceClientOffset:null}};function _s(e){return function(r=[],s={publishSource:!0}){const{publishSource:a=!0,clientOffset:i,getSourceClientOffset:o}=s,l=e.getMonitor(),c=e.getRegistry();e.dispatch(Dr(i)),Ls(r,l,c);const d=Ps(r,l);if(d==null){e.dispatch(As);return}let f=null;if(i){if(!o)throw new Error("getSourceClientOffset must be defined");Rs(o),f=o(d)}e.dispatch(Dr(i,f));const h=c.getSource(d).beginDrag(l,d);if(h==null)return;ks(h),c.pinSource(d);const u=c.getSourceType(d);return{type:vt,payload:{itemType:u,item:h,sourceId:d,clientOffset:i||null,sourceClientOffset:f||null,isSourcePublic:!!a}}}}function Ls(e,t,r){Y(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(s){Y(r.getSource(s),"Expected sourceIds to be registered.")})}function Rs(e){Y(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function ks(e){Y(tn(e),"Item must be an object.")}function Ps(e,t){let r=null;for(let s=e.length-1;s>=0;s--)if(t.canDragSource(e[s])){r=e[s];break}return r}function Ms(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Ms(e,a,r[a])})}return e}function Fs(e){return function(r={}){const s=e.getMonitor(),a=e.getRegistry();zs(s),Hs(s).forEach((o,l)=>{const c=$s(o,l,a,s),d={type:Dt,payload:{dropResult:Bs({},r,c)}};e.dispatch(d)})}}function zs(e){Y(e.isDragging(),"Cannot call drop while not dragging."),Y(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function $s(e,t,r,s){const a=r.getTarget(e);let i=a?a.drop(s,e):void 0;return Ks(i),typeof i>"u"&&(i=t===0?{}:s.getDropResult()),i}function Ks(e){Y(typeof e>"u"||tn(e),"Drop result must either be an object or undefined.")}function Hs(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Vs(e){return function(){const r=e.getMonitor(),s=e.getRegistry();Gs(r);const a=r.getSourceId();return a!=null&&(s.getSource(a,!0).endDrag(r,a),s.unpinSource()),{type:It}}}function Gs(e){Y(e.isDragging(),"Cannot call endDrag while not dragging.")}function Ut(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Us(e){return function(r,{clientOffset:s}={}){Ws(r);const a=r.slice(0),i=e.getMonitor(),o=e.getRegistry(),l=i.getItemType();return Zs(a,o,l),qs(a,i,o),Ys(a,i,o),{type:Ct,payload:{targetIds:a,clientOffset:s||null}}}}function Ws(e){Y(Array.isArray(e),"Expected targetIds to be an array.")}function qs(e,t,r){Y(t.isDragging(),"Cannot call hover while not dragging."),Y(!t.didDrop(),"Cannot call hover after drop.");for(let s=0;s<e.length;s++){const a=e[s];Y(e.lastIndexOf(a)===s,"Expected targetIds to be unique in the passed array.");const i=r.getTarget(a);Y(i,"Expected targetIds to be registered.")}}function Zs(e,t,r){for(let s=e.length-1;s>=0;s--){const a=e[s],i=t.getTargetType(a);Ut(i,r)||e.splice(s,1)}}function Ys(e,t,r){e.forEach(function(s){r.getTarget(s).hover(t,s)})}function Xs(e){return function(){if(e.getMonitor().isDragging())return{type:nr}}}function Js(e){return{beginDrag:_s(e),publishDragSource:Xs(e),hover:Us(e),drop:Fs(e),endDrag:Vs(e)}}class Qs{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function s(i){return(...o)=>{const l=i.apply(t,o);typeof l<"u"&&r(l)}}const a=Js(this);return Object.keys(a).reduce((i,o)=>{const l=a[o];return i[o]=s(l),i},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const s=this.store.getState().refCount>0;this.backend&&(s&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!s&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function ea(e,t){return{x:e.x+t.x,y:e.y+t.y}}function rn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ta(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:s}=e;return!t||!r||!s?null:rn(ea(t,s),r)}function ra(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:rn(t,r)}const nt=[],sr=[];nt.__IS_NONE__=!0;sr.__IS_ALL__=!0;function na(e,t){return e===nt?!1:e===sr||typeof t>"u"?!0:Os(t,e).length>0}class sa{subscribeToStateChange(t,r={}){const{handlerIds:s}=r;Y(typeof t=="function","listener must be a function."),Y(typeof s>"u"||Array.isArray(s),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const i=()=>{const o=this.store.getState(),l=o.stateId;try{l===a||l===a+1&&!na(o.dirtyHandlerIds,s)||t()}finally{a=l}};return this.store.subscribe(i)}subscribeToOffsetChange(t){Y(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const s=()=>{const a=this.store.getState().dragOffset;a!==r&&(r=a,t())};return this.store.subscribe(s)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return Y(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(Y(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const s=this.registry.getTargetType(t),a=this.getItemType();return Ut(s,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Y(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const s=this.registry.getSourceType(t),a=this.getItemType();return s!==a?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:s}=r;if(!this.isDragging())return!1;const a=this.registry.getTargetType(t),i=this.getItemType();if(i&&!Ut(a,i))return!1;const o=this.getTargetIds();if(!o.length)return!1;const l=o.indexOf(t);return s?l===o.length-1:l>-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 ta(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return ra(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Ir=typeof global<"u"?global:self,nn=Ir.MutationObserver||Ir.WebKitMutationObserver;function sn(e){return function(){const r=setTimeout(a,0),s=setInterval(a,50);function a(){clearTimeout(r),clearInterval(s),e()}}}function aa(e){let t=1;const r=new nn(e),s=document.createTextNode("");return r.observe(s,{characterData:!0}),function(){t=-t,s.data=t}}const ia=typeof nn=="function"?aa:sn;class oa{enqueueTask(t){const{queue:r,requestFlush:s}=this;r.length||(s(),this.flushing=!0),r[r.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 r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let s=0,a=t.length-this.index;s<a;s++)t[s]=t[s+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=ia(this.flush),this.requestErrorThrow=sn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class la{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class ca{create(t){const r=this.freeTasks,s=r.length?r.pop():new la(this.onError,a=>r[r.length]=a);return s.task=t,s}constructor(t){this.onError=t,this.freeTasks=[]}}const an=new oa,da=new ca(an.registerPendingError);function ua(e){an.enqueueTask(da.create(e))}const ar="dnd-core/ADD_SOURCE",ir="dnd-core/ADD_TARGET",or="dnd-core/REMOVE_SOURCE",St="dnd-core/REMOVE_TARGET";function fa(e){return{type:ar,payload:{sourceId:e}}}function pa(e){return{type:ir,payload:{targetId:e}}}function ha(e){return{type:or,payload:{sourceId:e}}}function ga(e){return{type:St,payload:{targetId:e}}}function ma(e){Y(typeof e.canDrag=="function","Expected canDrag to be a function."),Y(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Y(typeof e.endDrag=="function","Expected endDrag to be a function.")}function xa(e){Y(typeof e.canDrop=="function","Expected canDrop to be a function."),Y(typeof e.hover=="function","Expected hover to be a function."),Y(typeof e.drop=="function","Expected beginDrag to be a function.")}function Wt(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Wt(r,!1));return}Y(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 De;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(De||(De={}));let ba=0;function ya(){return ba++}function va(e){const t=ya().toString();switch(e){case De.SOURCE:return`S${t}`;case De.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Sr(e){switch(e[0]){case"S":return De.SOURCE;case"T":return De.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Nr(e,t){const r=e.entries();let s=!1;do{const{done:a,value:[,i]}=r.next();if(i===t)return!0;s=!!a}while(!s);return!1}class Ca{addSource(t,r){Wt(t),ma(r);const s=this.addHandler(De.SOURCE,t,r);return this.store.dispatch(fa(s)),s}addTarget(t,r){Wt(t,!0),xa(r);const s=this.addHandler(De.TARGET,t,r);return this.store.dispatch(pa(s)),s}containsHandler(t){return Nr(this.dragSources,t)||Nr(this.dropTargets,t)}getSource(t,r=!1){return Y(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Y(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Y(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Y(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Sr(t)===De.SOURCE}isTargetId(t){return Sr(t)===De.TARGET}removeSource(t){Y(this.getSource(t),"Expected an existing source."),this.store.dispatch(ha(t)),ua(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Y(this.getTarget(t),"Expected an existing target."),this.store.dispatch(ga(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Y(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Y(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,s){const a=va(t);return this.types.set(a,r),t===De.SOURCE?this.dragSources.set(a,s):t===De.TARGET&&this.dropTargets.set(a,s),a}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const Da=(e,t)=>e===t;function Ia(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Sa(e,t,r=Da){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!r(e[s],t[s]))return!1;return!0}function Na(e=nt,t){switch(t.type){case Ct:break;case ar:case ir:case St:case or:return nt;case vt:case nr:case It:case Dt:default:return sr}const{targetIds:r=[],prevTargetIds:s=[]}=t.payload,a=Es(r,s);if(!(a.length>0||!Sa(r,s)))return nt;const o=s[s.length-1],l=r[r.length-1];return o!==l&&(o&&a.push(o),l&&a.push(l)),a}function ja(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ta(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){ja(e,a,r[a])})}return e}const jr={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function wa(e=jr,t){const{payload:r}=t;switch(t.type){case rr:case vt:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Ct:return Ia(e.clientOffset,r.clientOffset)?e:Ta({},e,{clientOffset:r.clientOffset});case It:case Dt:return jr;default:return e}}function Ea(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ye(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Ea(e,a,r[a])})}return e}const Oa={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Aa(e=Oa,t){const{payload:r}=t;switch(t.type){case vt:return Ye({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case nr:return Ye({},e,{isSourcePublic:!0});case Ct:return Ye({},e,{targetIds:r.targetIds});case St:return e.targetIds.indexOf(r.targetId)===-1?e:Ye({},e,{targetIds:ws(e.targetIds,r.targetId)});case Dt:return Ye({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case It:return Ye({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function _a(e=0,t){switch(t.type){case ar:case ir:return e+1;case or:case St:return e-1;default:return e}}function La(e=0){return e+1}function Ra(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ka(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Ra(e,a,r[a])})}return e}function Pa(e={},t){return{dirtyHandlerIds:Na(e.dirtyHandlerIds,{type:t.type,payload:ka({},t.payload,{prevTargetIds:Ts(e,"dragOperation.targetIds",[])})}),dragOffset:wa(e.dragOffset,t),refCount:_a(e.refCount,t),dragOperation:Aa(e.dragOperation,t),stateId:La(e.stateId)}}function Ma(e,t=void 0,r={},s=!1){const a=Ba(s),i=new sa(a,new Ca(a)),o=new Qs(a,i),l=e(o,t,r);return o.receiveBackend(l),o}function Ba(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return en(Pa,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Fa(e,t){if(e==null)return{};var r=za(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}function za(e,t){if(e==null)return{};var r={},s=Object.keys(e),a,i;for(i=0;i<s.length;i++)a=s[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}let Tr=0;const ht=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var $a=g.memo(function(t){var{children:r}=t,s=Fa(t,["children"]);const[a,i]=Ka(s);return g.useEffect(()=>{if(i){const o=on();return++Tr,()=>{--Tr===0&&(o[ht]=null)}}},[]),n.jsx(Qr.Provider,{value:a,children:r})});function Ka(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=Ha(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function Ha(e,t=on(),r,s){const a=t;return a[ht]||(a[ht]={dragDropManager:Ma(e,t,r,s)}),a[ht]}function on(){return typeof global<"u"?global:window}var Rt,wr;function Va(){return wr||(wr=1,Rt=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var s,a,i;if(Array.isArray(t)){if(s=t.length,s!=r.length)return!1;for(a=s;a--!==0;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),s=i.length,s!==Object.keys(r).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=s;a--!==0;){var o=i[a];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}),Rt}var Ga=Va();const Ua=y.getDefaultExportFromCjs(Ga),Ve=typeof window<"u"?g.useLayoutEffect:g.useEffect;function Wa(e,t,r){const[s,a]=g.useState(()=>t(e)),i=g.useCallback(()=>{const o=t(e);Ua(s,o)||(a(o),r&&r())},[s,e,r]);return Ve(i),[s,i]}function qa(e,t,r){const[s,a]=Wa(e,t,r);return Ve(function(){const o=e.getHandlerId();if(o!=null)return e.subscribeToStateChange(a,{handlerIds:[o]})},[e,a]),s}function ln(e,t,r){return qa(t,e||(()=>({})),()=>r.reconnect())}function cn(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),g.useMemo(()=>typeof e=="function"?e():e,r)}function Za(e){return g.useMemo(()=>e.hooks.dragSource(),[e])}function Ya(e){return g.useMemo(()=>e.hooks.dragPreview(),[e])}let kt=!1,Pt=!1;class Xa{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Y(!kt,"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 kt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{kt=!1}}isDragging(){if(!this.sourceId)return!1;Y(!Pt,"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 Pt=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Pt=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}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 Mt=!1;class Ja{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Y(!Mt,"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 Mt=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Mt=!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 Qa(e,t,r){const s=r.getRegistry(),a=s.addTarget(e,t);return[a,()=>s.removeTarget(a)]}function ei(e,t,r){const s=r.getRegistry(),a=s.addSource(e,t);return[a,()=>s.removeSource(a)]}function qt(e,t,r,s){let a;if(a!==void 0)return!!a;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let c=0;c<i.length;c++){const d=i[c];if(!l(d))return!1;const f=e[d],p=t[d];if(a=void 0,a===!1||a===void 0&&f!==p)return!1}return!0}function Zt(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ti(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 ri(e){return(t=null,r=null)=>{if(!g.isValidElement(t)){const i=t;return e(i,r),i}const s=t;return ti(s),ni(s,r?i=>e(i,r):e)}}function dn(e){const t={};return Object.keys(e).forEach(r=>{const s=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=ri(s);t[r]=()=>a}}),t}function Er(e,t){typeof e=="function"?e(t):e.current=t}function ni(e,t){const r=e.ref;return Y(typeof r!="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"),r?g.cloneElement(e,{ref:s=>{Er(r,s),Er(t,s)}}):g.cloneElement(e,{ref:t})}class si{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,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,s=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(s&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!qt(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!qt(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=dn({dragSource:(r,s)=>{this.clearDragSource(),this.dragSourceOptions=s||null,Zt(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,s)=>{this.clearDragPreview(),this.dragPreviewOptions=s||null,Zt(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,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 ai{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,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!qt(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=dn({dropTarget:(r,s)=>{this.clearDropTarget(),this.dropTargetOptions=s,Zt(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Je(){const{dragDropManager:e}=g.useContext(Qr);return Y(e!=null,"Expected drag drop context"),e}function ii(e,t){const r=Je(),s=g.useMemo(()=>new si(r.getBackend()),[r]);return Ve(()=>(s.dragSourceOptions=e||null,s.reconnect(),()=>s.disconnectDragSource()),[s,e]),Ve(()=>(s.dragPreviewOptions=t||null,s.reconnect(),()=>s.disconnectDragPreview()),[s,t]),s}function oi(){const e=Je();return g.useMemo(()=>new Xa(e),[e])}class li{beginDrag(){const t=this.spec,r=this.monitor;let s=null;return typeof t.item=="object"?s=t.item:typeof t.item=="function"?s=t.item(r):s={},s??null}canDrag(){const t=this.spec,r=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(r):!0}isDragging(t,r){const s=this.spec,a=this.monitor,{isDragging:i}=s;return i?i(a):r===t.getSourceId()}endDrag(){const t=this.spec,r=this.monitor,s=this.connector,{end:a}=t;a&&a(r.getItem(),r),s.reconnect()}constructor(t,r,s){this.spec=t,this.monitor=r,this.connector=s}}function ci(e,t,r){const s=g.useMemo(()=>new li(e,t,r),[t,r]);return g.useEffect(()=>{s.spec=e},[e]),s}function di(e){return g.useMemo(()=>{const t=e.type;return Y(t!=null,"spec.type must be defined"),t},[e])}function ui(e,t,r){const s=Je(),a=ci(e,t,r),i=di(e);Ve(function(){if(i!=null){const[l,c]=ei(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c}},[s,t,r,a,i])}function fi(e,t){const r=cn(e,t);Y(!r.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 s=oi(),a=ii(r.options,r.previewOptions);return ui(r,s,a),[ln(r.collect,s,a),Za(a),Ya(a)]}function pi(e){return g.useMemo(()=>e.hooks.dropTarget(),[e])}function hi(e){const t=Je(),r=g.useMemo(()=>new ai(t.getBackend()),[t]);return Ve(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function gi(){const e=Je();return g.useMemo(()=>new Ja(e),[e])}function mi(e){const{accept:t}=e;return g.useMemo(()=>(Y(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class xi{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function bi(e,t){const r=g.useMemo(()=>new xi(e,t),[t]);return g.useEffect(()=>{r.spec=e},[e]),r}function yi(e,t,r){const s=Je(),a=bi(e,t),i=mi(e);Ve(function(){const[l,c]=Qa(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c},[s,t,a,r,i.map(o=>o.toString()).join("|")])}function lr(e,t){const r=cn(e,t),s=gi(),a=hi(r.options);return yi(r,s,a),[ln(r.collect,s,a),pi(a)]}const Or="column",vi="flex items-center",Ci="mr-3 cursor-move text-secondary",Di=({id:e,children:t,className:r,onFind:s,onMove:a,ariaLabel:i="Drag item"})=>{const o=g.useRef(null),l=g.useRef(null),c=typeof s=="function"?s(e):-1,[{isDragging:d},f,p]=fi(()=>({type:Or,item:{id:e,originalIndex:c},collect:u=>{const m=u.getItem();return{isDragging:u.isDragging()&&m?.id===e}},end:(u,m)=>{if(!u)return;!m.didDrop()&&typeof a=="function"&&u.originalIndex>-1&&a(u.id,u.originalIndex)}}),[e,c,a]),[,h]=lr(()=>({accept:Or,hover:u=>{if(!(!u||u.id===e)&&typeof s=="function"&&typeof a=="function"){const m=s(e);a(u.id,m)}}}),[s,a,e]);return p(h(l)),f(o),n.jsxs("div",{ref:l,className:I.mergeClasses(vi,r),style:{opacity:d?0:1},"aria-roledescription":"Draggable item",children:[n.jsx("div",{ref:o,className:Ci,"aria-label":i,children:n.jsx(K.IconGripVertical,{...H.BASE_ICON_PROPS})}),t]})},Nt=({iconClassName:e,label:t,...r})=>t?n.jsx(y.DialDangerButton,{...r,label:t,appearance:E.ButtonAppearance.Ghost,iconBefore:n.jsx(K.IconTrashX,{...H.BASE_ICON_PROPS,className:e||""})}):n.jsx(w.DialDangerIconButton,{...r,appearance:E.ButtonAppearance.Ghost,icon:n.jsx(K.IconTrashX,{...H.BASE_ICON_PROPS,className:e||""})}),Ii=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...d})=>{const f=I.mergeClasses("dial-textarea dial-input px-3 py-2",d.invalid&&"dial-input-error",d.disabled&&"dial-input-disable",i?"resize":"resize-none",e);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-1",a),children:[o&&n.jsx(_e.DialLabel,{...o,htmlFor:c}),n.jsx("textarea",{id:c,value:t||"",className:f,onChange:p=>r?.(p.currentTarget.value),...d}),n.jsx(y.DialErrorText,{text:s}),!s&&n.jsx(y.DialCaptionText,{text:l})]})},Si="inline-flex items-center rounded bg-layer-3",Ni="flex flex-1 items-center justify-center gap-2 h-7 px-3 py-1 border border-primary dial-small-text whitespace-nowrap focus-visible:outline outline-offset-0 focus-visible:relative focus-visible:z-10",ji="relative z-10 bg-controls-accent-primary-alpha-active text-primary",Ti="text-secondary hover:text-primary",wi="text-controls-disable-accent cursor-not-allowed hover:text-controls-disable-accent",Ei=({options:e,value:t,onChange:r,disabled:s,className:a,ariaLabel:i})=>{const o=g.useCallback(l=>{if(s)return;const c=e.filter(h=>!h.disabled);if(c.length===0)return;const d=c.findIndex(h=>h.value===t);let f=null;switch(l.key){case"ArrowRight":case"ArrowDown":f=(d+1)%c.length;break;case"ArrowLeft":case"ArrowUp":f=(d-1+c.length)%c.length;break;case"Home":f=0;break;case"End":f=c.length-1;break;default:return}l.preventDefault();const p=c[f];p&&p.value!==t&&r(p.value)},[s,e,t,r]);return n.jsx("div",{role:"tablist","aria-label":i,className:I.mergeClasses(Si,a),children:e.map((l,c)=>{const d=l.value===t,f=c===0,p=c===e.length-1,h=s||l.disabled;return n.jsxs("button",{type:"button",role:"tab","aria-selected":d,tabIndex:d?0:-1,disabled:h,onClick:()=>r(l.value),onKeyDown:o,className:I.mergeClasses(Ni,!p&&"-mr-px",f&&"rounded-l",p&&"rounded-r",d?ji:Ti,h&&wi),children:[l.icon,l.label]},l.value)})})},Bt=8,Oi=24,un=({initialTags:e=[],label:t,required:r,elementId:s,placeholder:a,captionDescription:i,errorText:o,invalid:l,disabled:c,collapseTagOverflow:d=!1,readOnly:f=!1,containerClassName:p,tagClassName:h,onChange:u})=>{const m=g.useRef(null),v=g.useRef([]),x=g.useRef(null),[b,C]=g.useState(e),[S,j]=g.useState(""),[D,T]=g.useState(!1),[L,O]=g.useState(e.length),A=g.useCallback(B=>z=>{v.current[B]=z},[]),R=g.useCallback(()=>{if(!d)return;const B=m.current;if(!B)return;const z=B.offsetWidth;if(z===0)return;const Z=x.current?.offsetWidth??0,ne=z-(f?0:Oi)-Bt;let X=0,W=0;for(let se=0;se<b.length;se++){const te=v.current[se];if(!te)continue;const le=te.offsetWidth+Bt;if(X+le>ne)break;X+=le,W++}if(W<b.length&&W>0)for(;X+Z>ne&&W>0;){W--;const se=v.current[W]?.offsetWidth??0;X-=se+Bt}O(W)},[d,f,b.length]),N=B=>{const z=B.trim().replace(/,$/,"");if(z&&!b.includes(z)){const Z=[z,...b];C(Z),u?.(Z)}},P=B=>{(B.key===","||B.key==="Enter")&&(B.preventDefault(),N(S),j(""))},F=()=>{S.trim()&&(N(S),j(""))},U=B=>{const z=b.filter((Z,V)=>V!==B);C(z),u?.(z)},Q=()=>o?n.jsx(y.DialErrorText,{text:o}):i?n.jsx(y.DialCaptionText,{text:i}):null;g.useEffect(()=>{if(d)return;const B=new ResizeObserver(()=>{if(m.current){const z=m.current.scrollHeight>m.current.clientHeight+10;T(z)}});return m.current&&B.observe(m.current),()=>B.disconnect()},[b,d]),g.useEffect(()=>{if(!d){O(b.length);return}O(b.length);const B=new ResizeObserver(()=>{R()}),z=m.current;return z&&B.observe(z),R(),()=>B.disconnect()},[d,R,b]),g.useEffect(()=>{C(e)},[JSON.stringify(e)]);const G=n.jsxs("div",{ref:m,className:oe("flex gap-2 items-center relative",d?"flex-nowrap overflow-hidden w-full min-w-0":oe("flex-wrap",D?"flex-col-reverse":"flex-row"),p),children:[(d?b.slice(0,L):b).map((B,z)=>n.jsx(Ke,{label:B,className:h,closable:!c&&!f,onRemove:!c&&!f?()=>U(z):void 0},B+z)),d&&L<b.length&&n.jsx(E.DialTooltip,{tooltip:b.slice(L).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:n.jsx(Ke,{label:`+${b.length-L}`})}),!f&&n.jsx("input",{id:s,type:"text",value:S,onChange:B=>j(B.target.value),onKeyDown:P,onBlur:F,className:oe("dial-input outline-none !border-none w-full flex-1 !p-1 !h-auto",d?"min-w-0":"min-w-[100px]"),placeholder:a??"",disabled:c}),d&&n.jsxs("div",{className:"absolute left-0 top-0 invisible pointer-events-none h-0 overflow-hidden whitespace-nowrap","aria-hidden":!0,children:[b.map((B,z)=>n.jsx("div",{ref:A(z),className:"inline-flex shrink-0",children:n.jsx(Ke,{label:B,className:h,closable:!c&&!f,onRemove:!c&&!f?()=>U(z):void 0})},`measure-${B}-${z}`)),n.jsx("div",{ref:x,className:"inline-flex shrink-0",children:n.jsx(Ke,{label:`+${b.length}`})})]})]});return f?G:n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsx(_e.DialLabel,{label:t,required:r,htmlFor:s}),n.jsx("div",{className:oe("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:G}),Q()]})},fn=({selectedItems:e,placeholder:t,collapseTagOverflow:r=!1,listClassName:s,listElementClassName:a})=>e?.length?n.jsx(un,{readOnly:!0,initialTags:e,collapseTagOverflow:r,containerClassName:s,tagClassName:a}):t?n.jsx("span",{className:"text-secondary",children:t}):null,Ft=e=>mr.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},mr.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"})),pn=({children:e,open:t,disabled:r=!1,selectedValue:s,valueClassName:a,inputClassName:i,onOpen:o,elementId:l,errorText:c,invalid:d,emptyValueText:f,placeholder:p,editable:h=!1,onValueChange:u,collapseTagOverflow:m=!1,iconBefore:v})=>{const x=Array.isArray(s)&&s.length>0,b=typeof s=="string"&&!!s.trim(),C=x||b?s:p?void 0:f,S=r?void 0:o,j=g.useCallback(O=>{u?.(O.target.value)},[u]),D=()=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:oe("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between",i,r&&"dial-input-disable",(c||d)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[v&&n.jsx(w.DialIcon,{icon:v}),n.jsx("input",{type:"text",className:oe("flex-1 min-w-0 bg-transparent outline-none border-none p-0 dial-small-text text-primary placeholder:text-secondary",a),value:typeof s=="string"?s:"",placeholder:p||f,onChange:j,disabled:r,id:l,"aria-label":"input-popup-field"})]}),!r&&n.jsx("button",{type:"button",className:"shrink-0 cursor-pointer bg-transparent border-none p-0 ml-1",onClick:o,"aria-label":"open-popup",children:n.jsx(w.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]}),n.jsx(y.DialErrorText,{text:c})]}),T=()=>n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"w-full",onClick:S,"aria-label":"open-popup",id:l,children:n.jsxs("div",{className:oe("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",i,r&&"dial-input-disable",(c||d)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[v&&n.jsx(w.DialIcon,{icon:v}),n.jsx(E.DialTooltip,{tooltip:C==null?void 0:String(C),children:C||!p?n.jsx("span",{className:a,children:C}):n.jsx("span",{className:"text-secondary",children:p})})]}),!r&&n.jsx("div",{className:"shrink-0",children:n.jsx(w.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]})}),n.jsx(y.DialErrorText,{text:c})]}),L=()=>n.jsx("div",{className:"w-full",onClick:S,children:n.jsxs("div",{className:oe("dial-input px-3 py-2 flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",r&&"dial-input-disable"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[v&&n.jsx(w.DialIcon,{icon:v}),n.jsx(fn,{placeholder:p,selectedItems:C,collapseTagOverflow:m})]}),!r&&n.jsx("div",{className:"ml-1",children:n.jsx(w.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]})});return n.jsxs(n.Fragment,{children:[x?L():h?D():T(),t&&Xn.createPortal(e,document.body)]})},Ai=({label:e,htmlFor:t,disabled:r,selectedValue:s,radioButtons:a,customInputValue:i,valueClassName:o,inputClassName:l,emptyValueText:c,placeholder:d,onClose:f,header:p,portalId:h,onApply:u,onCancel:m,cancelButtonTitle:v="Cancel",applyButtonTitle:x="Apply",isValid:b,selectedRadioValue:C,onChangeRadioField:S,id:j,size:D=y.PopupSize.Md})=>{const[T,L]=g.useState(!1),O=g.useCallback(()=>{r||L(!0)},[r]),A=g.useCallback(()=>{L(!1),f?.()},[f]),R=g.useCallback(()=>{m?.(),A()},[m,A]),N=g.useCallback(()=>{u(),A()},[u,A]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(_e.DialLabel,{label:e,htmlFor:t}),n.jsx(pn,{disabled:r,open:T,selectedValue:i??a.find(P=>P.id===s)?.name,valueClassName:o,inputClassName:oe(l,"py-2","px-3"),emptyValueText:c,placeholder:d,onOpen:O,children:n.jsx(y.DialPopup,{open:T,onClose:R,header:p,portalId:h,size:D,footer:n.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[n.jsx(y.DialNeutralButton,{label:v,onClick:R}),n.jsx(y.DialPrimaryButton,{label:x,onClick:N,disabled:!b})]}),children:n.jsx("div",{className:"px-6 py-4",children:n.jsx(y.DialRadioGroup,{radioButtons:a,labelClassName:"dial-small-text",activeRadioButton:C,onChange:S,elementId:j,orientation:y.RadioGroupOrientation.Column})})})})]})},_i="Create",Li="Cancel",Ri="flex items-center justify-end gap-2 px-6 py-3",ki=({header:e,open:t=!1,submitLabel:r=_i,cancelLabel:s=Li,isLoading:a=!1,disableSubmitButton:i=!1,className:o,submitClassName:l,onClose:c,onSubmit:d,onCancel:f,children:p,dividers:h=!0,size:u=y.PopupSize.Md,footer:m})=>{const v=a?null:n.jsxs("div",{className:Ri,children:[n.jsx(y.DialNeutralButton,{label:s,onClick:()=>f?f():c?.()}),n.jsx(y.DialPrimaryButton,{className:l,label:r,disabled:i,onClick:()=>d()})]}),x=g.useCallback(()=>a?n.jsx("div",{className:"px-6 py-4 h-[120px]",children:n.jsx(y.DialLoader,{size:50})}):p??null,[p,a]);return n.jsx(y.DialPopup,{open:t,header:e,className:o,dividers:h,onClose:()=>c?.(),footer:m??v,size:u,children:x()})},Pi=/^0+\.(\d+)?$/,Mi=/^0+/,Yt=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=f=>!f||f==="-"?f:String(f)?.match(Pi)?String(f)?.replace(Mi,"0"):Number(f),c=f=>{if([".","-","+","e","E"].includes(f.key)){f.preventDefault();return}y.handleKeyDown(f,"number",r,s)},d=f=>{const p=f.clipboardData.getData("text"),h=p.replace(/\D/g,"");if(h!==p&&(f.preventDefault(),h)){const u=f.currentTarget,m=u.selectionStart??0,v=u.selectionEnd??0,x=u.value.slice(0,m)+h+u.value.slice(v);t?.(l(x))}};return n.jsx(y.DialInput,{type:"number",min:r,max:s,onChange:f=>t?.(l(f)),onKeyDown:e?c:a,onPaste:e?d:i,...o})},Bi=({onClick:e})=>n.jsx(K.IconEyeOff,{...H.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),Fi=({onClick:e})=>n.jsx(K.IconEye,{...H.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),hn=({...e})=>{const[t,r]=g.useState(!1),s=g.useCallback(a=>{r(a)},[]);return n.jsx(y.DialInput,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?n.jsx(Bi,{onClick:()=>s(!1)}):n.jsx(Fi,{onClick:()=>s(!0)})})},gn=({options:e,selectedValues:t,handleRemoveTag:r})=>n.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(s=>{const a=e.find(o=>o.value===s)?.label??s,i=e.find(o=>o.value===s)?.icon;return n.jsx(Ke,{label:a,onRemove:o=>r?.(o,s),icon:i?n.jsx(w.DialIcon,{icon:i}):null,className:"max-w-full"},s)})});var mt=(e=>(e.Sm="sm",e.Md="md",e))(mt||{}),xt=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(xt||{});const zi="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",$i="w-full rounded flex flex-col",st="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",Ki="bg-accent-primary-alpha",Xt="bg-accent-primary-alpha border-l border-accent-primary border-1",bt="opacity-75",Hi=352,Vi=4,Gi=n.jsx(K.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM}),Ui=({opt:e,selectedValues:t,onSelect:r})=>{const{isOpen:s,refs:a,floatingStyles:i,context:o,getReferenceProps:l,getFloatingProps:c}=w.useSubMenuFloating(Vi,"listbox",!!e.disabled),d=e.children?.some(f=>t.includes(f.value));return n.jsxs(n.Fragment,{children:[n.jsxs("button",{ref:a.setReference,type:"button",role:"option","aria-haspopup":"listbox","aria-expanded":s,"aria-selected":!!d,"aria-disabled":!!e.disabled,disabled:e.disabled,className:oe(st,d&&Xt,e.disabled&&bt),...l(),children:[n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.icon&&n.jsx(w.DialIcon,{icon:e.icon}),n.jsx(w.DialEllipsisTooltip,{text:e.labelNode??e.label})]}),n.jsx(K.IconChevronRight,{size:14,className:"shrink-0"})]}),s&&n.jsx(w.SubMenuPanel,{refs:a,floatingStyles:i,context:o,getFloatingProps:c,role:"listbox",className:"w-max py-1",children:e.children.map(f=>{const p=t.includes(f.value);return n.jsx("button",{type:"button",role:"option","aria-selected":p,"aria-disabled":!!f.disabled,disabled:f.disabled,className:oe(st,p&&Xt,f.disabled&&bt),onClick:()=>!f.disabled&&r(f.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f.icon&&n.jsx(w.DialIcon,{icon:f.icon}),n.jsx(w.DialEllipsisTooltip,{text:f.labelNode??f.label})]})},f.value)})})]})},Ne=({options:e,multiple:t=!1,elementId:r,value:s,defaultValue:a,variant:i=xt.Primary,size:o=mt.Md,prefix:l,customSelectedValue:c,placeholder:d="Select...",searchable:f=!1,searchSize:p=E.ElementSize.Standard,searchPlaceholder:h,selectAll:u=!1,invalid:m,selectAllLabel:v="Select all",emptyStateTitle:x="No options available",emptyStateDescription:b,emptyStateIcon:C,disabled:S=!1,className:j,listClassName:D,closable:T=!1,header:L,footer:O,onClose:A,onChange:R,inlineSearch:N=!1,dismissRef:P,onFooterClick:F,open:U,onOpenChange:Q,onInlineQueryChange:G,customMultiSelectTagsRenderer:B})=>{const z=g.useId(),[Z,V]=g.useState(!1),ne=U!==void 0,X=ne?!!U:Z,W=g.useCallback(_=>{ne||V(_),Q?.(_)},[ne,Q]),[se,te]=g.useState(N&&c||""),le=g.useRef(null),ue=g.useCallback(_=>{_!==se&&(te(_||""),G?.(_||""))},[G,se]),pe=s!==void 0,[he,fe]=g.useState(a),q=pe?s:he,ee=g.useMemo(()=>t?Array.isArray(q)?q:[]:typeof q=="string"?[q]:[],[q,t]),Ie=g.useMemo(()=>{const _=se.trim().toLowerCase();return _?e.filter(re=>re.label.toLowerCase().includes(_)):e},[e,se]);g.useEffect(()=>{!X&&!N&&ue("")},[N,X,ue]);const Me=g.useRef(c);g.useEffect(()=>{N&&c!==Me.current&&(X||(Me.current=c,ue(c||"")))},[c,N,X,ue]);const ge=g.useCallback(_=>{pe||fe(_),R?.(_)},[pe,R]),Be=g.useCallback(_=>{if(t){const re=new Set(ee);re.has(_)?re.delete(_):re.add(_),ge(Array.from(re));return}if(ge(_),N){const re=e.find(xe=>xe.value===_)??e.flatMap(xe=>xe.children??[]).find(xe=>xe.value===_);re&&ue(re.label)}W(!1)},[t,ge,N,W,ee,e,ue]),Te=g.useCallback((_,re)=>{if(_.stopPropagation(),!t){ge("");return}const xe=ee.filter(Ot=>Ot!==re);ge(xe)},[t,ee,ge]),ae=g.useMemo(()=>Ie.filter(_=>!_.disabled),[Ie]),Le=g.useMemo(()=>ae.filter(_=>ee.includes(_.value)).length,[ae,ee]),Se=g.useCallback(_=>{N&&!t&&!_&&Be(se),W(_)},[Be,N,t,se,W]),{allSelectedInFiltered:Fe,someSelectedInFiltered:rt}=g.useMemo(()=>{const _=ae.length>0&&Le===ae.length;return{allSelectedInFiltered:_,someSelectedInFiltered:Le>0&&!_}},[ae,Le]),ve=g.useCallback(()=>{if(!(!t||ae.length===0))if(Fe){const _=new Set(ae.map(re=>re.value));ge(ee.filter(re=>!_.has(re)))}else{const _=new Set(ee);ae.forEach(re=>_.add(re.value)),ge(Array.from(_))}},[Fe,t,ae,ee,ge]),ze=ee.length>0;g.useEffect(()=>{X&&N&&!t&&!S&&requestAnimationFrame(()=>{const _=le.current;if(!_)return;_.focus();const re=_.value?.length??0;_.setSelectionRange?.(re,re)})},[X,N,t,S]);const Re=!t&&ze?ee[0]:void 0,me=g.useMemo(()=>Re?e.find(_=>_.value===Re)??e.flatMap(_=>_.children??[]).find(_=>_.value===Re):void 0,[e,Re]),Et=g.useCallback(()=>t?ze?B?.(e,ee,Te)||n.jsx(gn,{options:e,selectedValues:ee,handleRemoveTag:Te}):n.jsx("span",{className:"text-secondary truncate",children:d}):me?n.jsxs(n.Fragment,{children:[me.icon&&n.jsx(w.DialIcon,{icon:me.icon}),n.jsx(w.DialEllipsisTooltip,{text:me.labelNode??(l?`${l} ${me.label}`:me.label)}),me?.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:me.description})]}):c&&s?c:n.jsx("span",{className:"text-secondary truncate",children:d}),[ze,t,c,l,s,d,me,e,ee,Te,B]);g.useImperativeHandle(P,()=>({dismiss:()=>{W(!1)}}));const we=g.useCallback(()=>{ue(ee.length===1?me?.label??se:"")},[se,ee.length,ue,me?.label]),$e=g.useCallback(()=>{S||(W(!X),N&&!t&&(we(),le.current?.focus()))},[S,N,X,t,we,W]);return n.jsx(w.DialDropdown,{open:X,onOpenChange:Se,disabled:S,closable:T,onClose:A,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:f?null:Hi,listClassName:D,renderOverlay:()=>n.jsxs("div",{id:`list-${r||z}`,role:"listbox","aria-multiselectable":t||void 0,className:$i,children:[L&&n.jsx(n.Fragment,{children:typeof L=="function"?L():L}),(f||T)&&e.length>8&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[f&&n.jsx(y.DialSearch,{size:p,placeholder:h,onChange:ue,value:se,id:`search-${r||z}`,containerClassName:I.mergeClasses(y.SIZE_CONFIG[p].containerClassName,"w-full")}),T&&n.jsx(y.DialButton,{"aria-label":"Close select",className:"shrink-0",iconBefore:n.jsx(K.IconX,{size:H.DIAL_ICON_SIZE.SM}),onClick:_=>{A?.(_),W(!1)}})]}),t&&u&&ae.length>0&&n.jsx("div",{className:oe(st,"mt-2"),children:n.jsx(Gt,{id:`${r||z}-selectAll`,label:v,checked:Fe,indeterminate:rt,onChange:ve,ariaLabel:v})}),n.jsx("div",{className:oe("overflow-y-auto max-h-[352px]",N&&Ie.length===0?"":"py-1"),children:Ie.length===0?!N&&n.jsx("div",{className:"px-2 py-3",children:n.jsx(w.DialNoDataContent,{icon:C??n.jsx(K.IconClipboardX,{size:H.DIAL_ICON_SIZE.LG,stroke:.5}),title:x,description:b})}):Ie.map(_=>{const re=ee.includes(_.value);return t?n.jsxs("div",{role:"option","aria-selected":re,"aria-disabled":!!_.disabled,className:oe(st,re&&Ki,_.disabled&&bt,"w-full"),children:[n.jsx(Gt,{id:`${r||z}-${_.value}`,label:n.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[_.icon&&n.jsx(w.DialIcon,{icon:_.icon}),n.jsx("span",{className:"truncate",children:_.labelNode??_.label})]}),checked:re,disabled:_.disabled,onChange:()=>!_.disabled&&Be(_.value),ariaLabel:_.label}),_.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:_.description})]},_.value):_.children?.length?n.jsx(Ui,{opt:_,selectedValues:ee,onSelect:Be},_.value):n.jsx("button",{role:"option",type:"button","aria-selected":re,"aria-disabled":!!_.disabled,disabled:_.disabled,className:oe(st,re&&Xt,_.disabled&&bt),onClick:()=>!_.disabled&&Be(_.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[_.icon&&n.jsx(w.DialIcon,{icon:_.icon}),n.jsx(w.DialEllipsisTooltip,{text:_.labelNode??_.label}),_.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:_.description})]})},_.value)})}),O&&n.jsx("div",{onClick:_=>{F?.(_),F&&W(!1)},children:typeof O=="function"?O():O})]}),children:n.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":X,"aria-controls":`list-${r||z}`,className:I.mergeClasses(zi,S&&"opacity-75 !cursor-not-allowed !border-primary",o===mt.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",m&&"dial-input-error",i===xt.Secondary?"!bg-layer-4 !h-auto":"",j),onMouseDown:_=>{S||N&&!t&&(we(),_.preventDefault())},onClick:()=>{$e()},onKeyDown:_=>{(_.key===" "||_.code==="Space")&&(_.preventDefault(),$e())},children:[N&&!t?n.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:n.jsx("input",{id:`inline-${r||z}`,type:"text",placeholder:h??d,value:se||"",onChange:_=>ue(_.currentTarget.value.trimStart()),onFocus:()=>!S&&W(!0),onMouseDown:_=>{we(),_.stopPropagation()},onClick:_=>{_.stopPropagation()},onKeyDown:_=>{_.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref:le,disabled:S,"aria-disabled":S,autoComplete:"off"})}):n.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:Et()}),!N&&n.jsx(w.DialIcon,{icon:Gi,className:oe("text-primary",X&&"rotate-180")})]})})},Wi=({label:e,required:t,captionDescription:r,containerClassName:s,selectClassName:a,error:i,id:o,caption:l,readonly:c,value:d,defaultEmptyText:f,...p})=>{const h=g.useCallback(()=>{if(!d||Array.isArray(d)&&d.length===0)return f??"None";if(Array.isArray(d))return n.jsx(gn,{options:p.options,selectedValues:d});{const u=p.options?.find(m=>m.value===d);return n.jsx("span",{"aria-readonly":!0,className:"text-primary",children:u?.label||d})}},[d,p.options,f]);return n.jsx(y.DialFormItem,{id:o,label:e,required:t,description:l,error:i,captionDescription:r,className:s,readonly:c,value:h(),defaultEmptyText:f,children:n.jsx(Ne,{className:a,value:d,elementId:o,invalid:!!i,...p})})};function mn(e){let t=null;return()=>(t==null&&(t=e()),t)}function qi(e,t){return e.filter(r=>r!==t)}function Zi(e,t){const r=new Set,s=i=>r.add(i);e.forEach(s),t.forEach(s);const a=[];return r.forEach(i=>a.push(i)),a}class Yi{enter(t){const r=this.entered.length,s=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=Zi(this.entered.filter(s),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=qi(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Xi{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 r={};Object.keys(this.config.exposeProperties).forEach(s=>{const a=this.config.exposeProperties[s];a!=null&&(r[s]={value:a(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const jt="__NATIVE_FILE__",xn="__NATIVE_URL__",bn="__NATIVE_TEXT__",yn="__NATIVE_HTML__",Ar=Object.freeze(Object.defineProperty({__proto__:null,FILE:jt,HTML:yn,TEXT:bn,URL:xn},Symbol.toStringTag,{value:"Module"}));function zt(e,t,r){const s=t.reduce((a,i)=>a||e.getData(i),"");return s??r}const Jt={[jt]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[yn]:{exposeProperties:{html:(e,t)=>zt(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[xn]:{exposeProperties:{urls:(e,t)=>zt(e,t,"").split(`
2
2
  `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[bn]:{exposeProperties:{text:(e,t)=>zt(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Ji(e,t){const r=Jt[e];if(!r)throw new Error(`native type ${e} has no configuration`);const s=new Xi(r);return s.loadDataTransfer(t),s}function $t(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Jt).filter(r=>{const s=Jt[r];return s?.matchesTypes?s.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const Qi=mn(()=>/firefox/i.test(navigator.userAgent)),vn=mn(()=>!!window.safari);class _r{interpolate(t){const{xs:r,ys:s,c1s:a,c2s:i,c3s:o}=this;let l=r.length-1;if(t===r[l])return s[l];let c=0,d=o.length-1,f;for(;c<=d;){f=Math.floor(.5*(c+d));const u=r[f];if(u<t)c=f+1;else if(u>t)d=f-1;else return s[f]}l=Math.max(0,d);const p=t-r[l],h=p*p;return s[l]+a[l]*p+i[l]*h+o[l]*p*h}constructor(t,r){const{length:s}=t,a=[];for(let u=0;u<s;u++)a.push(u);a.sort((u,m)=>t[u]<t[m]?-1:1);const i=[],o=[];let l,c;for(let u=0;u<s-1;u++)l=t[u+1]-t[u],c=r[u+1]-r[u],i.push(l),o.push(c/l);const d=[o[0]];for(let u=0;u<i.length-1;u++){const m=o[u],v=o[u+1];if(m*v<=0)d.push(0);else{l=i[u];const x=i[u+1],b=l+x;d.push(3*b/((b+x)/m+(b+l)/v))}}d.push(o[o.length-1]);const f=[],p=[];let h;for(let u=0;u<d.length-1;u++){h=o[u];const m=d[u],v=1/i[u],x=m+d[u+1]-h-h;f.push((h-m-x)*v),p.push(x*v*v)}this.xs=t,this.ys=r,this.c1s=d,this.c2s=f,this.c3s=p}}const eo=1;function Cn(e){const t=e.nodeType===eo?e:e.parentElement;if(!t)return null;const{top:r,left:s}=t.getBoundingClientRect();return{x:s,y:r}}function dt(e){return{x:e.clientX,y:e.clientY}}function to(e){var t;return e.nodeName==="IMG"&&(Qi()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function ro(e,t,r,s){let a=e?t.width:r,i=e?t.height:s;return vn()&&e&&(i/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:i}}function no(e,t,r,s,a){const i=to(t),l=Cn(i?e:t),c={x:r.x-l.x,y:r.y-l.y},{offsetWidth:d,offsetHeight:f}=e,{anchorX:p,anchorY:h}=s,{dragPreviewWidth:u,dragPreviewHeight:m}=ro(i,t,d,f),v=()=>{let T=new _r([0,.5,1],[c.y,c.y/f*m,c.y+m-f]).interpolate(h);return vn()&&i&&(T+=(window.devicePixelRatio-1)*m),T},x=()=>new _r([0,.5,1],[c.x,c.x/d*u,c.x+u-d]).interpolate(p),{offsetX:b,offsetY:C}=a,S=b===0||b,j=C===0||C;return{x:S?b:x(),y:j?C:v()}}class so{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,r){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=r}}function ao(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){ao(e,a,r[a])})}return e}class io{profile(){var t,r;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:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.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 r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,r,s){return this.sourcePreviewNodeOptions.set(t,s),this.sourcePreviewNodes.set(t,r),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,s){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,s);const a=o=>this.handleDragStart(o,t),i=o=>this.handleSelectStart(o);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",a),r.addEventListener("selectstart",i),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",a),r.removeEventListener("selectstart",i),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const s=o=>this.handleDragEnter(o,t),a=o=>this.handleDragOver(o,t),i=o=>this.handleDrop(o,t);return r.addEventListener("dragenter",s),r.addEventListener("dragover",a),r.addEventListener("drop",i),()=>{r.removeEventListener("dragenter",s),r.removeEventListener("dragover",a),r.removeEventListener("drop",i)}}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(),r=this.sourceNodeOptions.get(t);return Lr({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(t);return Lr({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Ar).some(r=>Ar[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=Ji(t,r),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const r=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var s;return(s=this.rootElement)===null||s===void 0?void 0:s.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},r)}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,r){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}handleDragEnter(t,r){this.dragEnterTargetIds.unshift(r)}handleDragOver(t,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}handleDrop(t,r){this.dropTargetIds.unshift(r)}constructor(t,r,s){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=a=>{const i=this.sourceNodes.get(a);return i&&Cn(i)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=a=>!!(a&&this.document&&this.document.body&&this.document.body.contains(a)),this.endDragIfSourceWasRemovedFromDOM=()=>{const a=this.currentDragSourceNode;a==null||this.isNodeInDocument(a)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=a=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(a||[],{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=a=>{if(a.defaultPrevented)return;const{dragStartSourceIds:i}=this;this.dragStartSourceIds=null;const o=dt(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:o});const{dataTransfer:l}=a,c=$t(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const f=this.monitor.getSourceId(),p=this.sourceNodes.get(f),h=this.sourcePreviewNodes.get(f)||p;if(h){const{anchorX:u,anchorY:m,offsetX:v,offsetY:x}=this.getCurrentSourcePreviewNodeOptions(),S=no(p,h,o,{anchorX:u,anchorY:m},{offsetX:v,offsetY:x});l.setDragImage(h,S.x,S.y)}}try{l?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(a.target);const{captureDraggingState:d}=this.getCurrentSourcePreviewNodeOptions();d?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(l&&!l.types&&(a.target&&!a.target.hasAttribute||!a.target.hasAttribute("draggable")))return;a.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=a=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}if(!this.enterLeaveCounter.enter(a.target)||this.monitor.isDragging())return;const{dataTransfer:l}=a,c=$t(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=a=>{const{dragEnterTargetIds:i}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=a.altKey,i.length>0&&this.actions.hover(i,{clientOffset:dt(a)}),i.some(l=>this.monitor.canDropOnTarget(l))&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=a=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}},this.handleTopDragOver=a=>{const{dragOverTargetIds:i}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}this.altKeyPressed=a.altKey,this.lastClientOffset=dt(a),this.scheduleHover(i),(i||[]).some(l=>this.monitor.canDropOnTarget(l))?(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?a.preventDefault():(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=a=>{this.isDraggingNativeItem()&&a.preventDefault(),this.enterLeaveCounter.leave(a.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=a=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var i;a.preventDefault(),(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}else $t(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:i}=this;this.dropTargetIds=[],this.actions.hover(i,{clientOffset:dt(a)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=a=>{const i=a.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(a.preventDefault(),i.dragDrop()))},this.options=new so(r,s),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Yi(this.isNodeInDocument)}}const oo=function(t,r,s){return new io(t,r,s)},lo=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:s,acceptTypes:a,maxFilesCount:i,multiple:o,fileFormatError:l,fileCountError:c,fileSizeError:d,getIsFileFormatError:f,getIsFileSizeError:p})=>{const h=g.useRef(null),u=g.useRef(null),[m,v]=g.useState([]),[x,b]=g.useState(!1),[C,S]=g.useState(!1),j=g.useCallback(G=>{const B=G.target.files;if(B&&B.length>0){const z=Array.from(B),Z=f?.(z),V=p?.(z);Z?b(!0):V?S(!0):e(z)}},[f,p,e]),D=g.useCallback(G=>i&&G?.length>i,[i]),T=g.useMemo(()=>x||C||D(m),[x,C,D,m]),L=()=>{v([]),b(!1),S(!1)},O=g.useMemo(()=>x?n.jsx(y.DialErrorText,{text:l}):C?n.jsx(y.DialErrorText,{text:d}):D(m)?n.jsx(y.DialErrorText,{text:c}):null,[c,l,d,m,D,x,C]);g.useEffect(()=>{L()},[a]);const[{isOver:A,canDrop:R},N]=lr(()=>({accept:[jt],drop(G){const B=G.files,z=f?.(B)??!1,Z=p?.(B)??!1,V=D?.(B)??!1;if(b(z),S(Z),z||Z||V){v(B);return}e(B),L()},collect:G=>({isOver:G.isOver(),canDrop:G.canDrop()})}),[e,f,p,D]),P=G=>{(G.key==="Enter"||G.key==="Space")&&(G.preventDefault(),u.current?.click())},F=G=>{G?.preventDefault();const B=Array.from(G.dataTransfer?.items??[]);b(!!f?.(B)),S(!!p?.(B)),v(B)},U=G=>{G.target===G.currentTarget&&L()},Q=oe("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!R&&!T&&"border-primary",R&&(A?"border-accent-primary":"border-hover"),T&&"border-error");return N(h),n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:Q,ref:h,onDragOver:F,onDragLeave:U,children:[n.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:P,className:"flex flex-col items-center cursor-pointer size-full text-secondary dial-tiny-text justify-center",children:[t&&n.jsx("p",{className:"mb-1",children:t}),r&&n.jsx("p",{className:"mb-0.5",children:r}),s&&n.jsx(y.DialPrimaryButton,{appearance:E.ButtonAppearance.Ghost,label:s,onClick:()=>u.current?.click()})]}),n.jsx("input",{multiple:o,id:"file",type:"file",ref:u,hidden:!0,accept:a,onChange:j})]}),n.jsx(n.Fragment,{children:O})]})},co=({iconBefore:e,className:t,...r})=>{const s=r.invalid,a=()=>n.jsx("div",{className:"mr-2",children:s?n.jsx(K.IconExclamationCircle,{...H.BASE_ICON_PROPS,className:"text-error"}):e});return n.jsx(y.DialInput,{...r,iconBefore:a(),containerClassName:oe("h-[40px] p-0",s&&"h-[60px]"),className:oe("rounded-r-none border-r-0",s&&"text-error",t)})},uo=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:s,getIsFileSizeError:a,maxFilesCount:i,fileFormatError:o,fileSizeError:l,fileCountError:c})=>{const d=g.useRef(null),[f,p]=g.useState(!1),[h,u]=g.useState(!1),[m,v]=g.useState(0),x=g.useCallback(()=>{p(!1),u(!1),v(0)},[]),b=g.useCallback(A=>!!(i&&t.length+A.length>i),[i,t.length]),C=f||h,[{isOver:S,canDrop:j},D]=lr(()=>({accept:[jt],drop(A){const R=A.files,N=[...t,...R],P=s?.(R)??!1,F=a?.(R)??!1,U=b?.(R)??!1;if(p(P),u(F),P||F||U){v(R.length);return}r(N),x()},collect:A=>({isOver:A.isOver(),canDrop:A.canDrop()})}),[t,r,s,a,b,x]),T=A=>{A.preventDefault();const R=Array.from(A.dataTransfer?.items??[]);p(!!s?.(R)),u(!1),v(R.length)},L=A=>{A.target===A.currentTarget&&x()};D(d);const O=b(Array.from({length:m}));return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsx("div",{ref:d,onDragOver:T,onDragLeave:L,className:oe("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!C&&!O&&(j&&S?"border-accent-primary":"border-primary"),(C||O)&&"border-error"),children:e}),f&&n.jsx(y.DialErrorText,{text:o}),h&&n.jsx(y.DialErrorText,{text:l}),!f&&!h&&O&&n.jsx(y.DialErrorText,{text:c})]})},Dn=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:s,onChange:a,isInvalid:i,errorText:o,removeButtonAriaLabel:l,getIsMultiFilesSizeError:c,multiFilesSizeError:d,getIsFileFormatError:f,getIsFileSizeError:p,maxFilesCount:h}=e,u=g.useCallback((x,b)=>{x.stopPropagation(),a(t?.filter(C=>C.name!==b)||[])},[a,t]),m=g.useCallback(x=>n.jsx(Nt,{"aria-label":l,onClick:b=>u(b,x)}),[l,u]),v=g.useMemo(()=>n.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((x,b)=>n.jsx(co,{id:x.name,value:x.name,iconAfter:m(x.name),iconBefore:r||s?.(x.name),invalid:i?.(x),error:i?.(x)?o:""},x.name+b))}),[t,r,s,i,o,m]);return n.jsx($a,{backend:oo,children:!t||t.length===0?n.jsx(lo,{...e,onChange:a}):n.jsxs(n.Fragment,{children:[n.jsx(uo,{existingFiles:t,onDrop:a,getIsFileFormatError:f,getIsFileSizeError:p,maxFilesCount:h,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:v}),c?.(t)&&n.jsx(y.DialErrorText,{text:d})]})})},fo=({onChange:e,fieldTitle:t,elementId:r,files:s,maxFilesCount:a,maxFileSize:i,maxMultiFilesSize:o,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:f,multiple:p=!0,acceptTypes:h,deleteAllButtonLabel:u,addButtonLabel:m,additionalActionButtons:v,...x})=>{const b=g.useRef(null),C=()=>b.current?.click(),S=()=>{e([])},j=g.useCallback(O=>O?.some(A=>!(h==="/"||h?.toLowerCase()?.includes(A?.type?.toLowerCase()))),[h]),D=g.useCallback(O=>{if(!i)return!1;const A=i*(1024*1024);return O?.some(R=>{const N=R.size;return!!N&&N>A})},[i]),T=g.useCallback(O=>{if(!o||!p)return!1;const A=o*1024*1024;return O.reduce((N,P)=>N+P.size,0)>A},[o,p]),L=g.useCallback(O=>{const A=O.target.files;if(A&&A.length>0){const R=Array.from(A),N=j(R),P=D(R);!N&&!P&&e([...s||[],...R])}},[j,D,e,s]);return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsxs("div",{className:"flex justify-between items-center pb-1 min-h-[42px]",children:[n.jsx(_e.DialLabel,{label:`${t}: ${p?s?.length||0:""}`,htmlFor:r}),p&&!!s?.length&&n.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[n.jsx(y.DialNeutralButton,{label:u,iconBefore:n.jsx(K.IconTrashX,{...H.BASE_ICON_PROPS}),onClick:S}),(a?a>s?.length:!0)&&n.jsx(y.DialPrimaryButton,{appearance:E.ButtonAppearance.Ghost,iconBefore:n.jsx(K.IconPlus,{...H.BASE_ICON_PROPS}),label:m,onClick:C}),v]})]}),s&&s.length>0&&n.jsx("input",{id:"file",type:"file",multiple:p,ref:b,hidden:!0,accept:h,onChange:L}),n.jsx(Dn,{files:s,onChange:e,acceptTypes:h,maxFilesCount:a,multiple:p,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:f,getIsFileFormatError:j,getIsFileSizeError:D,getIsMultiFilesSizeError:T,...x})]})},po=({icon:e,ariaLabel:t,size:r=E.ElementSize.Standard,disabled:s=!1,className:a,buttonClassName:i,iconClassName:o,caretIcon:l=n.jsx(K.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM}),showCaret:c=!0,placement:d="bottom-start",matchReferenceWidth:f=!1,open:p,onOpenChange:h,defaultOpen:u=!1,...m})=>{const v=r===E.ElementSize.Small,[x,b]=g.useState(u),C=p??x,S=v?"w-8 px-0":"w-10 px-0",j={[E.ElementSize.Small]:"size-5",[E.ElementSize.Standard]:"size-6",[E.ElementSize.Large]:"size-7"},D=T=>{b(T),h?.(T)};return n.jsx(w.DialDropdown,{...m,disabled:s,placement:d,matchReferenceWidth:f,className:a,open:C,onOpenChange:D,defaultOpen:u,children:n.jsxs("button",{type:"button","aria-label":t,disabled:s,className:I.mergeClasses("group flex items-center justify-center rounded border border-transparent bg-layer-4 text-primary","enabled:hover:bg-accent-primary-alpha enabled:active:bg-controls-accent-primary-alpha-active","focus-visible:border-focus focus-visible:outline-none disabled:cursor-not-allowed disabled:text-controls-secondary-disable disabled:opacity-75",v?"h-8 px-2":"h-10 px-2",c?void 0:S,i),children:[n.jsx(w.DialIcon,{icon:e,className:I.mergeClasses("flex items-center justify-center text-inherit",j[r],c&&"-mr-2",o,w.DIAL_KIT_CLASS.dropdownIcon)}),c&&n.jsxs("div",{className:I.mergeClasses("relative z-10 inline-grid size-5 shrink-0 place-items-center",w.DIAL_KIT_CLASS.dropdownIconCaret),children:[n.jsx("div",{className:"absolute inset-0 rounded-full bg-layer-2"}),n.jsx(w.DialIcon,{icon:l,className:I.mergeClasses("relative flex items-center justify-center text-secondary transition-transform group-hover:text-primary group-disabled:text-controls-secondary-disable",C&&"rotate-180")})]})]})})},ho="application/octet-stream";function go(e,t){if(!e||e.length===0)return[];const r=e.find(c=>c.parentPath===""&&c.nodeType==="FOLDER");if(!r)return[];const s=r.path||r.url||"",a=Kt(s,!0),i=e.filter(c=>c!==r).map(c=>{const d=c.path||c.url||"",f=mo(c.nodeType),p=f===y.DialFileNodeType.FOLDER,h=Kt(d,p);let u;return c.parentPath===null||c.parentPath===void 0?u=a:c.parentPath===""?u="":u=Kt(c.parentPath,!0),{...c,originalPath:d,path:h,parentPath:u,nodeType:f}}),o=new Map;i.forEach(c=>{const d={...c,id:c.originalPath,name:c.name,path:c.path,parentPath:c.parentPath,nodeType:c.nodeType,resourceType:xo(c.resourceType),folderId:t,updatedAt:c.updatedAt?new Date(c.updatedAt).toISOString():new Date().toISOString(),items:c.nodeType===y.DialFileNodeType.FOLDER?[]:void 0};c.nodeType===y.DialFileNodeType.ITEM&&(d.extension=bo(c.name),d.contentType=c.contentType||ho,d.contentLength=c.contentLength||0),o.set(c.path,d)});const l=[];return o.forEach(c=>{if(c.parentPath===a)l.push(c);else{const d=c.path.lastIndexOf(c.name||""),f=c.path.slice(0,d),p=o.get(f);p&&p.nodeType===y.DialFileNodeType.FOLDER?(p.items=p.items||[],p.items.push(c)):l.push(c)}}),l}function Kt(e,t){try{let r=decodeURIComponent(e);return t?r.endsWith("/")||(r+="/"):r.endsWith("/")&&(r=r.slice(0,-1)),r}catch{return t&&!e.endsWith("/")?e+"/":!t&&e.endsWith("/")?e.slice(0,-1):e}}function mo(e){return e.toUpperCase()==="FOLDER"?y.DialFileNodeType.FOLDER:y.DialFileNodeType.ITEM}function xo(e){if(!e)return;const t=e.toUpperCase();return Object.values(y.DialFileResourceType).find(s=>s.toUpperCase()===t)}function bo(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function yo(e,t="Prompts",r="prompts/public/",s="root"){const a=go(e,s);return[{id:s,name:t,path:r,parentPath:"",nodeType:y.DialFileNodeType.FOLDER,folderId:s,items:a}]}const In=({locale:e,timeZone:t,date:r=new Date}={})=>{const s=t??Intl.DateTimeFormat().resolvedOptions().timeZone;try{const a=new Intl.DateTimeFormat(e,{timeZone:s,timeZoneName:"longOffset"}).formatToParts(r).find(i=>i.type==="timeZoneName")?.value;return a?`(${a}) ${s}`:s}catch{return s}};var Xe=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(Xe||{}),it=(e=>(e.Select="select",e.Radio="radio",e))(it||{}),Tt=(e=>(e.Row="row",e.Column="column",e))(Tt||{}),$=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))($||{});const vo={noItemSchema:"No item schema defined.",noItemsYet:"No items yet. Add one below.",addItem:"Add Item",selectTypeToAdd:"Select type to add…",noConfigurableProperties:"No configurable properties.",noFieldsYet:"No fields yet. Add one below.",keyColumnHeader:"Key",valueColumnHeader:"Value",addField:"Add Field",keyInputPlaceholder:"Enter key",stringInputPlaceholder:"Enter a value",integerInputPlaceholder:"Enter a whole number",numberInputPlaceholder:"Enter a number",enumSelectPlaceholder:"Select an option",selectTypePlaceholder:"Select type",removeItemAriaLabel:"Remove item",removeFieldAriaLabel:"Remove field",typeColumnHeader:"Type",entryTypeString:"String",entryTypeNumber:"Number",entryTypeBoolean:"Boolean",entryTypeNull:"Null",entryTypeObject:"Object",entryTypeArray:"Array",entryTypeChangeWarning:"Changing type will reset the current value.",booleanTrueOption:"True",booleanFalseOption:"False",invalidJsonError:"Invalid JSON"},Sn=g.createContext(null);function je(){const e=g.useContext(Sn);if(!e)throw new Error("useSchemaContext must be used inside DialSchemaRenderer");return e}function Rr(e,t){const r={...e,...t};return(e.properties||t.properties)&&(r.properties={...e.properties,...t.properties}),(e.required||t.required)&&(r.required=Array.from(new Set([...e.required??[],...t.required??[]]))),r}function J(e,t,r=0){if(r>10)return e;let s=e;if(s.$ref){const a=s.$ref.replace(/^#\//,"").split("/");let i=t;for(const f of a)i=i?.[f];if(!i||typeof i!="object")return e;const{$ref:o,...l}=s,c=i;s={...c.$ref?J(c,t,r+1):c,...l}}if(s.allOf&&s.allOf.length>0){const{allOf:a,...i}=s;let o={};for(const l of a)o=Rr(o,J(l,t,r+1));s=Rr(o,i)}return s}function Nn(e){return e.map((t,r)=>({entry:t,index:r})).sort((t,r)=>{const s=t.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0,a=r.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0;return s!==a?s-a:t.index-r.index}).map(({entry:t})=>t)}function wt(e){return e==null||e===""}function qe(e){return e.type===$.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function yt(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function jn(e,t){return e.type===$.Null?"null":e.$ref?J(e,t).title??e.$ref.split("/").pop()??"Option":e.title?e.title:e.type?Array.isArray(e.type)?e.type.join(" | "):e.type:e.discriminator?Object.keys(e.discriminator.mapping).join(" | "):e.const!=null?String(e.const):e.oneOf?"One of options":"Option"}function Oe(e,t,r=0){if(r>15)return;const s=J(e,t);if("default"in s)return s.default;if(s.discriminator&&s.oneOf){const a=Object.keys(s.discriminator.mapping)[0];if(a){const i=J({$ref:s.discriminator.mapping[a]},t);return{...Oe(i,t,r+1)??{},[s.discriminator.propertyName]:a}}}if(qe(s)){if(s.properties){const a={};let i=!1;for(const[o,l]of Object.entries(s.properties)){const c=Oe(l,t,r+1);c!==void 0&&(a[o]=c,i=!0)}return i?a:void 0}if(s.additionalProperties!=null&&s.additionalProperties!==!1)return{}}}function Ee(e,t,r,s="",a=0){if(a>15)return[];const i=[],o=J(t,r);if(o.anyOf){const d=o.anyOf.filter(f=>f.type!==$.Null);return e!=null&&d.length===1?Ee(e,d[0],r,s,a+1):i}if(o.oneOf&&o.discriminator){const d=o.discriminator.propertyName,f=e?.[d];if(f&&o.discriminator.mapping[f]){const p={$ref:o.discriminator.mapping[f]},h=J(p,r);return Ee(e,h,r,s,a+1)}return i}if(o.type===$.Array||!o.type&&Array.isArray(e)){if(Array.isArray(e)&&o.items)for(let d=0;d<e.length;d++){const f=Ee(e[d],o.items,r,`${s}[${d}]`,a+1);i.push(...f)}return i}if(!qe(o))return i;const l=o.required??[],c=e;for(const d of l){const f=o.properties?.[d];if(f&&J(f,r).isHidden)continue;const p=s?`${s}.${d}`:d,h=c?.[d];if(wt(h)){const u=f?.title??yt(d);i.push({path:p,message:`${u} is required`})}}if(c&&o.properties)for(const[d,f]of Object.entries(o.properties)){if(J(f,r).isHidden)continue;const p=s?`${s}.${d}`:d,h=c[d];if(h!=null){const u=Ee(h,f,r,p,a+1);i.push(...u)}}if(c&&o.additionalProperties!=null&&o.additionalProperties!==!1&&typeof o.additionalProperties=="object"){const d=o.additionalProperties;for(const[f,p]of Object.entries(c)){const h=s?`${s}.${f}`:f,u=Ee(p,d,r,h,a+1);i.push(...u)}}return i}function cr(e,t,r){const s=J(t,r);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(qe(s)&&s.properties){const a=Object.entries(s.properties).filter(([,c])=>!J(c,r).isHidden),i=a.length,o=e;return`${a.filter(([c])=>{const d=o?.[c];return d!=null&&d!==""}).length}/${i} fields`}return""}function Co(e,t,r){if(e==null){const s=t.findIndex(a=>a.type===$.Null);return s>=0?s:0}if(Array.isArray(e)){const s=t.findIndex(a=>J(a,r).type===$.Array);return s>=0?s:0}if(typeof e=="boolean"){const s=t.findIndex(a=>J(a,r).type===$.Boolean);return s>=0?s:0}if(typeof e=="number"){const s=t.findIndex(a=>{const i=J(a,r);return i.type===$.Number||i.type===$.Integer});return s>=0?s:0}if(typeof e=="string"){const s=t.findIndex(a=>J(a,r).type===$.String);return s>=0?s:0}if(typeof e=="object"){const s=e;for(let a=0;a<t.length;a++){const i=J(t[a],r);if(i.discriminator&&i.discriminator.propertyName in s)return a}for(let a=0;a<t.length;a++){const i=J(t[a],r);if(qe(i)||i.oneOf)return a}return 0}return 0}function Do(e,t,r){if(t&&typeof e=="object"&&e!==null){const s=e[t];if(s)return`Item ${r+1}: ${s}`}if(typeof e=="object"&&e!==null){const s=e,a=s.name??s.title??s.id;if(a)return`Item ${r+1}: ${a}`}return`Item ${r+1}`}function Tn(e){switch(Array.isArray(e.type)?e.type[0]:e.type){case $.String:return"";case $.Boolean:return!1;case $.Array:return[];case $.Integer:case $.Number:return;default:return{}}}const Io=[$.String,$.Number,$.Boolean,$.Null,$.Object,$.Array];function So(e){return Array.isArray(e)?$.Array:typeof e=="object"&&e!==null?$.Object:typeof e=="boolean"?$.Boolean:typeof e=="number"?$.Number:e===null?$.Null:$.String}const No={[$.String]:"",[$.Number]:0,[$.Boolean]:!1,[$.Null]:null,[$.Object]:{},[$.Array]:[]};function jo(e){return No[e]}const ot=({title:e,description:t,summary:r,errorCount:s=0,level:a=0,children:i,onRemove:o,defaultExpanded:l=!0,removeItemAriaLabel:c="Remove item"})=>{const[d,f]=g.useState(l),p=a===0,h="rounded border border-secondary",u=I.mergeClasses("flex items-center gap-2 cursor-pointer select-none transition-colors",p?"px-4 py-3 bg-layer-3 hover:bg-layer-4":"px-3 py-2 bg-layer-4 hover:bg-layer-3",d?"rounded-t":"rounded"),m=I.mergeClasses("border-t border-secondary",p?"p-4":"p-3");return n.jsxs("div",{className:h,children:[n.jsxs("div",{className:u,onClick:()=>f(v=>!v),role:"button","aria-expanded":d,children:[n.jsx("span",{className:"shrink-0 text-secondary",children:d?n.jsx(K.IconChevronDown,{size:16,stroke:2}):n.jsx(K.IconChevronRight,{size:16,stroke:2})}),n.jsx("span",{className:I.mergeClasses("flex-1 truncate",p?"dial-small-semi-text text-primary":"dial-small-text text-primary"),children:e}),t&&n.jsx(_e.DialInfoButton,{caption:t}),r&&n.jsx("span",{className:"dial-tiny-text text-secondary whitespace-nowrap ml-2",children:r}),s>0?n.jsxs("span",{className:"flex items-center gap-1 dial-tiny-text text-error whitespace-nowrap",children:[n.jsx(w.DialIcon,{icon:n.jsx(K.IconAlertTriangle,{size:13,stroke:2})}),s," error",s>1?"s":""]}):n.jsx(w.DialIcon,{icon:n.jsx(K.IconCheck,{size:13,stroke:2}),className:"text-success shrink-0"}),o&&n.jsx(Nt,{size:E.ElementSize.Small,onClick:v=>{v.stopPropagation(),o()},"aria-label":c,className:"ml-1 shrink-0 p-0.5"})]}),d&&n.jsx("div",{className:m,children:i})]})},wn=({schema:e,value:t,onChange:r,path:s,level:a=0,required:i,label:o})=>{const{rootSchema:l,defaultExpanded:c=!0,touchedPaths:d=new Set,skipUntouched:f=!1}=je(),p=J(e,l),h=qe(p),u=p.type===$.Array;if(h||u){const x=cr(t,p,l),b=Ee(t,p,l,s.join(".")),C=s.join("."),S=C+".",j=!f||d.has(C)||[...d].some(D=>D.startsWith(S));return n.jsx(ot,{title:o??p.title??s[s.length-1]??"Section",description:p.description,level:a,summary:x,errorCount:j?b.length:0,defaultExpanded:c,children:n.jsx(Ae,{schema:p,value:t,onChange:r,path:s,level:a+1,required:i})})}const v=(!f||d.has(s.join(".")))&&i&&wt(t)?`${o??"Field"} is required`:void 0;return n.jsx(y.DialFormItem,{label:o,required:i,description:p.description,error:v,children:n.jsx(Ae,{schema:p,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:!0})})},gt=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o}=je(),l=J(e,i),c=Nn(Object.entries(l.properties??{}).filter(([,p])=>!J(p,i).isHidden)),d=l.required??[],f=t??{};return c.length===0?n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noConfigurableProperties}):n.jsx("div",{className:"flex flex-col gap-4",children:c.map(([p,h])=>{const m=J(h,i).title??h.title??yt(p),v=d.includes(p);return n.jsx(wn,{schema:h,value:f[p],onChange:x=>r({...f,[p]:x}),path:[...s,p],level:a,required:v,label:m},p)})})},To=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,defaultExpanded:c=!0}=je(),d=Array.isArray(t)?t:[],f=e.items,[p,h]=g.useState(void 0);if(!f)return n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noItemSchema});const u=g.useMemo(()=>J(f,i),[f,i]),m=g.useMemo(()=>u.discriminator,[u]),v=g.useMemo(()=>m?.propertyName,[m]),x=g.useMemo(()=>m?Object.keys(m.mapping).map(j=>({value:j,label:j})):[],[m]),b=()=>{const j=p??x[0]?.value;let D;if(m&&j){const T=J({$ref:m.mapping[j]},i);D={...Oe(T,i)??{},[m.propertyName]:j}}else D=Oe(u,i)??Tn(u);r([...d,D])},C=j=>{r(d.filter((D,T)=>T!==j))},S=(j,D)=>{r(d.map((T,L)=>L===j?D:T))};return n.jsxs("div",{className:"flex flex-col gap-3",children:[d.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noItemsYet}),d.map((j,D)=>{const T=Do(j,v,D),L=cr(j,u,i),O=Ee(j,u,i,`${s.join(".")}[${D}]`);return n.jsx(ot,{title:T,level:a,summary:L,errorCount:O.length,onRemove:l?void 0:()=>C(D),defaultExpanded:c,removeItemAriaLabel:o.removeItemAriaLabel,children:n.jsx(Ae,{schema:f,value:j,onChange:A=>S(D,A),path:[...s,String(D)],level:a+1})},D)}),!l&&n.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[x.length>0&&n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(Ne,{options:x,value:p??x[0]?.value,placeholder:o.selectTypeToAdd,onChange:j=>{const D=typeof j=="string"?j:j[0];h(D)}})}),n.jsx(y.DialGhostButton,{label:o.addItem,iconBefore:n.jsx(K.IconPlus,{size:16,stroke:2}),onClick:b})]})]})},wo=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1}=je(),c=g.useId(),d=e.discriminator;if(d){const x=d.propertyName,b=d.mapping,C=Object.keys(b).map(T=>({value:T,label:T})),S=typeof t=="object"&&t!==null?t[x]:void 0,j=S?J({$ref:b[S]},i):void 0,D=T=>{const L=J({$ref:b[T]},i),O=Oe(L,i)??{};r({...O,[x]:T})};if(e.discriminatorDisplay===it.Radio){const T=e.discriminatorOrientation===Tt.Row,L=S?(()=>{const O=J({$ref:b[S]},i),{[x]:A,...R}=O.properties??{};return{...O,properties:R}})():void 0;return T?n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{role:"radiogroup",className:"flex flex-row flex-wrap gap-4",children:Object.keys(b).map(O=>{const A=J({$ref:b[O]},i);return n.jsx(w.DialRadioButton,{name:c,value:O,inputId:`${c}-${O}`,label:A.title??O,checked:S===O,disabled:l,onChange:()=>D(O)},O)})}),L&&n.jsx(gt,{schema:L,value:t,onChange:r,path:s,level:a})]}):n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:Object.keys(b).map(O=>{const A=J({$ref:b[O]},i),R=S===O,{[x]:N,...P}=A.properties??{},F={...A,properties:P};return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(w.DialRadioButton,{name:c,value:O,inputId:`${c}-${O}`,label:A.title??O,checked:R,disabled:l,onChange:()=>D(O)}),R&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(gt,{schema:F,value:t,onChange:r,path:s,level:a})})]},O)})})}return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(Ne,{options:C,value:S,placeholder:o.selectTypePlaceholder,disabled:l,onChange:T=>{const L=typeof T=="string"?T:T[0];L&&D(L)}})}),j&&n.jsx("div",{className:"pl-3",children:n.jsx(gt,{schema:j,value:t,onChange:r,path:s,level:a})})]})}const f=e.oneOf??[],h=(()=>{if(t==null)return 0;if(typeof t=="object"&&!Array.isArray(t)){for(let x=0;x<f.length;x++)if(J(f[x],i).required?.every(C=>C in t))return x}return 0})(),u=x=>{const b=J(f[x],i),C=Oe(b,i);r(C??null)},m=f[h];if(e.discriminatorDisplay===it.Radio)return n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:f.map((x,b)=>{const C=J(x,i),S=jn(x,i)??`Option ${b+1}`,j=h===b;return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(w.DialRadioButton,{name:c,value:String(b),inputId:`${c}-${b}`,label:S,checked:j,disabled:l,onChange:()=>u(b)}),j&&C&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(Ae,{schema:C,value:t,onChange:r,path:s,level:a})})]},b)})});const v=f.map((x,b)=>{const C=J(x,i);return{value:String(b),label:C.title??`Option ${b+1}`}});return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(Ne,{options:v,value:String(h),disabled:l,onChange:x=>{const b=typeof x=="string"?x:x[0];u(Number(b))}})}),m&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Ae,{schema:m,value:t,onChange:r,path:s,level:a})})]})},Eo=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,readonly:o=!1}=je(),l=e.anyOf??[],c=l.map((m,v)=>({value:String(v),label:jn(m,i)})),d=Co(t,l,i),f=l[d],h=J(f,i).type===$.Null,u=m=>{const v=J(l[m],i);if(v.type===$.Null){r(null);return}const x=Oe(v,i);if(x!==void 0){r(x);return}switch(v.type){case $.Array:r([]);break;case $.String:r("");break;case $.Boolean:r(!1);break;case $.Integer:case $.Number:r(0);break;default:r({});break}};return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(Ne,{options:c,value:String(d),disabled:o,onChange:m=>{const v=typeof m=="string"?m:m[0];u(Number(v))}})}),!h&&f&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Ae,{schema:f,value:t,onChange:r,path:s,level:a})})]})},En=({schema:e,value:t,onChange:r,invalid:s})=>{const a=g.useId(),{texts:i,readonly:o=!1,inputClassName:l,acceptableResourceTypes:c}=je(),d=e.const!==void 0,f=Array.isArray(e.enum)&&e.enum.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===$.String||e.type===void 0)){const h=(e.acceptableResourceTypes??[]).flatMap(u=>{const m=c?.[u];return Array.isArray(m)?m.map(v=>{const x=String(v);return{value:x,label:x}}):[]});return n.jsx(Ne,{options:h,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:u=>r(typeof u=="string"?u:u[0]),placeholder:i.enumSelectPlaceholder,className:l})}if(d)return n.jsx(y.DialInput,{value:String(e.const??""),disabled:!0,onChange:void 0,className:"opacity-60"});if(f&&e.enumDisplay===it.Radio){const h=e.enumOrientation===Tt.Row;return n.jsx("div",{role:"radiogroup",className:h?"flex flex-row flex-wrap gap-x-4 gap-y-2":"flex flex-col gap-2",children:e.enum.map(u=>{const m=String(u);return n.jsx(w.DialRadioButton,{name:a,value:m,inputId:`${a}-${m}`,label:m,checked:t!=null?String(t)===m:!1,disabled:o,onChange:v=>r(v)},m)})})}if(f){const h=e.enum.map(u=>({value:String(u),label:String(u)}));return n.jsx(Ne,{options:h,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:u=>r(typeof u=="string"?u:u[0]),placeholder:i.enumSelectPlaceholder})}switch(e.type){case $.Boolean:return n.jsx(_e.DialSwitch,{switchId:a,isOn:!!t,disabled:o,onChange:h=>r(h)});case $.Integer:return n.jsx(Yt,{integer:!0,value:t!=null?String(t):"",invalid:s,disabled:o,onChange:h=>r(h!==void 0?Number(h):void 0),placeholder:i.integerInputPlaceholder,containerClassName:l});case $.Number:return n.jsx(Yt,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:h=>r(h!==void 0?Number(h):void 0),placeholder:i.numberInputPlaceholder,containerClassName:l});default:return e.isProtected?n.jsx(hn,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:h=>r(h??void 0),placeholder:i.stringInputPlaceholder,containerClassName:l}):n.jsx(y.DialInput,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:h=>r(h??void 0),placeholder:i.stringInputPlaceholder,containerClassName:l})}},dr=({value:e,onChange:t,theme:r=lt.EditorThemes.dark,height:s=240})=>{const{readonly:a,texts:i}=je(),[o,l]=g.useState(null),[c,d]=g.useState(()=>JSON.stringify(e,null,2));g.useEffect(()=>{typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-BDe6elKO.cjs")).then(h=>{l(()=>h.DialJsonEditor)})},[]);let f=!1;try{JSON.parse(c)}catch{f=!0}const p=h=>{const u=h??"";d(u);try{t(JSON.parse(u))}catch{}};return n.jsxs("div",{children:[n.jsx("div",{className:"border border-primary rounded",style:{height:`${s}px`},children:o&&n.jsx(o,{value:c,currentTheme:r,onChange:p,options:{readOnly:a}})}),n.jsx(y.DialErrorText,{text:f?i.invalidJsonError:void 0})]})},kr=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),On=e=>!!(e.oneOf||e.anyOf||e.type===$.Array||qe(e)),Oo={[$.String]:"entryTypeString",[$.Number]:"entryTypeNumber",[$.Boolean]:"entryTypeBoolean",[$.Null]:"entryTypeNull",[$.Object]:"entryTypeObject",[$.Array]:"entryTypeArray"},Ao=({pairId:e,pairKey:t,pairValue:r,valueSchema:s,isUnschematizedValue:a,jsonEditorTheme:i,onKeyChange:o,onValueChange:l,onRemove:c,keyInputPlaceholder:d,removeFieldAriaLabel:f,path:p,level:h,readonly:u=!1,inputClassName:m})=>{const{rootSchema:v,texts:x,defaultExpanded:b=!0,touchedPaths:C=new Set,markTouched:S=()=>{},skipUntouched:j=!1}=je(),[D,T]=g.useState(t),L=On(s),[O,A]=g.useState(()=>So(r)),R=a&&(O===$.Object||O===$.Array),N=a&&O===$.Null,P=L||R,F=[...p,e,"key"].join("."),Q=(!j||C.has(F))&&t==="",G=g.useCallback(te=>{l(jo(te)),A(te)},[l]),B=g.useMemo(()=>Io.map(te=>({value:te,label:x[Oo[te]]})),[x]),z=g.useMemo(()=>[{value:"true",label:x.booleanTrueOption},{value:"false",label:x.booleanFalseOption}],[x]),Z=`${e}-key-error`,V=a&&O===$.Boolean,ne=n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsxs("div",{className:P?"flex-1 min-w-0":"w-2/5 min-w-0",children:[n.jsx(y.DialInput,{value:D,disabled:u,invalid:Q,"aria-describedby":Q?Z:void 0,onChange:te=>T(te??""),onBlur:()=>{S(F),D!==t&&o(D)},placeholder:d,containerClassName:m}),n.jsx(y.DialErrorText,{id:Z,text:Q?`${x.keyColumnHeader} is required`:void 0})]}),!L&&!R&&n.jsx("div",{className:"flex-1 min-w-0",children:N?n.jsx(y.DialInput,{value:"null",disabled:!0,onChange:void 0,className:"opacity-60"}):V?n.jsx(Ne,{options:z,value:r?"true":"false",disabled:u,onChange:te=>{const le=typeof te=="string"?te:te[0];le&&l(le==="true")}}):n.jsx(En,{schema:a?{type:O}:s,value:r,onChange:l})}),a&&n.jsx("div",{className:"w-28 shrink-0",children:n.jsx(E.DialTooltip,{tooltip:x.entryTypeChangeWarning,triggerClassName:"block",children:n.jsx(Ne,{options:B,value:O,disabled:u,onChange:te=>{const le=typeof te=="string"?te:te[0];le&&G(le)}})})}),!u&&n.jsx(Nt,{size:E.ElementSize.Small,onClick:c,"aria-label":f,className:"shrink-0 p-1"})]});if(!P)return ne;if(R)return n.jsxs("div",{className:"flex flex-col gap-2",children:[ne,n.jsx(dr,{value:r,onChange:l,theme:i},O)]});const X=[...p,t],W=cr(r,s,v),se=Ee(r,s,v,X.join("."));return n.jsxs("div",{className:"flex flex-col gap-2",children:[ne,n.jsx(ot,{title:t,level:h,summary:W,errorCount:se.length+(Q?1:0),defaultExpanded:b,children:n.jsx(Ae,{schema:s,value:r,onChange:l,path:X,level:h+1})})]})},_o=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,inputClassName:c,jsonEditorTheme:d}=je(),f=e.additionalProperties===!0||e.additionalProperties==null,p=f?{type:"string"}:typeof e.additionalProperties=="object"?J(e.additionalProperties,i):{type:"string"},h=On(p),[u,m]=g.useState(()=>Object.entries(t??{}).map(([D,T])=>kr(D,T))),v=D=>Object.fromEntries(D.filter(T=>T.key!=="").map(T=>[T.key,T.value])),x=(D,T)=>{const L=u.map((O,A)=>A===D?{...O,key:T}:O);m(L),r(v(L))},b=(D,T)=>{const L=u.map((O,A)=>A===D?{...O,value:T}:O);m(L),r(v(L))},C=()=>h?Oe(p,i)??Tn(p):"",S=()=>{m(D=>[...D,kr("",C())])},j=D=>{const T=u.filter((L,O)=>O!==D);m(T),r(v(T))};return n.jsxs("div",{className:"flex flex-col gap-2",children:[u.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noFieldsYet}),u.length>0&&!h&&n.jsxs("div",{className:"flex gap-2 mb-1 pr-7",children:[n.jsx("span",{className:"w-2/5 dial-tiny-text text-secondary font-medium",children:o.keyColumnHeader}),n.jsx("span",{className:"flex-1 dial-tiny-text text-secondary font-medium",children:o.valueColumnHeader}),f&&n.jsx("span",{className:"w-28 shrink-0 dial-tiny-text text-secondary font-medium",children:o.typeColumnHeader})]}),u.map((D,T)=>n.jsx(Ao,{pairId:D.id,pairKey:D.key,pairValue:D.value,valueSchema:p,isUnschematizedValue:f,jsonEditorTheme:d,onKeyChange:L=>x(T,L),onValueChange:L=>b(T,L),onRemove:()=>j(T),keyInputPlaceholder:o.keyInputPlaceholder,removeFieldAriaLabel:o.removeFieldAriaLabel,path:s,level:a,readonly:l,inputClassName:c},D.id)),!l&&n.jsx("div",{className:"pt-1",children:n.jsx(y.DialGhostButton,{label:o.addField,iconBefore:n.jsx(K.IconPlus,{size:16,stroke:2}),onClick:S})})]})},Ae=({schema:e,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:o=!1})=>{const{rootSchema:l,renderField:c,markTouched:d=()=>{},touchedPaths:f=new Set,skipUntouched:p=!1,jsonEditorTheme:h}=je(),u=J(e,l),m=b=>{d(s.join(".")),r(b)},v=!p||f.has(s.join("."));let x;if(u.oneOf)x=n.jsx(wo,{schema:u,value:t,onChange:m,path:s,level:a});else if(u.anyOf&&u.type!==$.Object)x=n.jsx(Eo,{schema:u,value:t,onChange:m,path:s,level:a});else if(qe(u)){const b=u.additionalProperties!=null&&u.additionalProperties!==!1,C=!u.properties||Object.keys(u.properties).length===0;b&&C?x=n.jsx(_o,{schema:u,value:t,onChange:m,path:s,level:a}):C&&u.additionalProperties!==!1?x=n.jsx(dr,{value:t,onChange:m,theme:h}):x=n.jsx(gt,{schema:u,value:t,onChange:m,path:s,level:a})}else if(u.type===$.Array)x=n.jsx(To,{schema:u,value:t,onChange:m,path:s,level:a});else{const b=v&&i&&wt(t),C=!o&&b?`${u.title??"Field"} is required`:void 0;x=n.jsxs(n.Fragment,{children:[n.jsx(En,{schema:u,value:t,onChange:m,invalid:b}),n.jsx(y.DialErrorText,{text:C})]})}return c?c(s,u,x):x},Lo=({schema:e,defaultValue:t,texts:r,className:s,readonly:a=!1,defaultExpanded:i=!0,inputClassName:o,variant:l=Xe.Sections,onChange:c,onPropertyChange:d,onDefaultValues:f,renderField:p,skipUntouched:h=!1,jsonEditorTheme:u,acceptableResourceTypes:m})=>{const v=g.useMemo(()=>({...vo,...r}),[r]),x=g.useMemo(()=>t||(Oe(e,e)??{}),[]),[b,C]=g.useState(x),[S,j]=g.useState(new Set),D=g.useCallback(N=>{j(P=>P.has(N)?P:new Set([...P,N]))},[]);g.useEffect(()=>{f?.(x)},[]);const T=(N,P)=>{const F={...b,[N]:P};C(F),c?.(F),d?.(N,P)},L=new Set(Object.keys(e.properties??{})),O=Object.keys(b).filter(N=>!L.has(N)),A=Nn(Object.entries(e.properties??{}).filter(([,N])=>!J(N,e).isHidden)),R=e.required??[];return n.jsx(Sn.Provider,{value:{rootSchema:e,texts:v,readonly:a,defaultExpanded:i,inputClassName:o,jsonEditorTheme:u,acceptableResourceTypes:m,renderField:p,touchedPaths:S,markTouched:D,skipUntouched:h},children:n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-4",s),children:[A.map(([N,P])=>{const F=J(P,e),U=F.title??P.title??yt(N),Q=R.includes(N),G=b[N];if(l===Xe.Flat)return n.jsx(wn,{schema:P,value:G,onChange:V=>T(N,V),path:[N],level:0,required:Q,label:U},N);if(l===Xe.FlatSections)return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:U}),n.jsx(Ae,{schema:P,value:G,onChange:V=>T(N,V),path:[N],level:0,required:Q})]},N);const B=Ee(G,F,e,N),z=N+".",Z=!h||S.has(N)||[...S].some(V=>V.startsWith(z));return n.jsx(ot,{title:U,description:F.description,level:0,defaultExpanded:i,errorCount:Z?Q&&wt(G)?Math.max(B.length,1):B.length:0,children:n.jsx(Ae,{schema:P,value:G,onChange:V=>T(N,V),path:[N],level:1,required:Q})},N)}),O.map(N=>{const P=yt(N),F=n.jsx(dr,{value:b[N],onChange:U=>T(N,U),theme:u});return l===Xe.Sections?n.jsx(ot,{title:P,level:0,defaultExpanded:i,children:F},N):n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:P}),F]},N)})]})})},Ro=e=>({info:n.jsx(K.IconInfoCircleFilled,{size:e.size}),error:n.jsx(K.IconAlertCircleFilled,{size:e.size}),warning:n.jsx(K.IconAlertTriangleFilled,{size:e.size}),success:n.jsx(K.IconCircleCheckFilled,{size:e.size}),loading:n.jsx(y.Spinner,{size:e.size}),general:n.jsx(K.IconCheck,{size:e.size,stroke:e.stroke})}),ko={[y.NotificationVariant.Info]:"bg-info text-info",[y.NotificationVariant.Success]:"bg-success text-success",[y.NotificationVariant.Warning]:"bg-warning text-warning",[y.NotificationVariant.Error]:"bg-error text-error",[y.NotificationVariant.Loading]:"bg-layer-raised text-info",[y.NotificationVariant.General]:"bg-layer-sunken text-primary"},Po={[y.NotificationVariant.Info]:"status",[y.NotificationVariant.Success]:"status",[y.NotificationVariant.Warning]:"alert",[y.NotificationVariant.Error]:"alert",[y.NotificationVariant.Loading]:"status",[y.NotificationVariant.General]:"status"},Mo="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",ur=({variant:e=y.NotificationVariant.Info,type:t=y.NotificationType.Toast,title:r,message:s,action:a,className:i,iconSize:o=24,iconStroke:l=2,closable:c=!1,onClose:d,children:f,textClassName:p,...h})=>{const u=g.useMemo(()=>Ro({size:o,stroke:l})[e],[e,o,l]),m=p??(t===y.NotificationType.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return n.jsxs("div",{role:Po[e],...h,className:I.mergeClasses(Mo,ko[e],t===y.NotificationType.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===y.NotificationType.SectionMessage&&e===y.NotificationVariant.Loading&&"border-secondary",i,w.DIAL_KIT_CLASS.notification),children:[n.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[n.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:n.jsx(w.DialIcon,{icon:u})}),r?n.jsxs("div",{className:I.mergeClasses("flex min-w-0 text-primary break-words",m),children:[n.jsx("div",{className:"dial-small-paragraph-semi-text min-w-0 break-words",children:r}),n.jsx("div",{className:"dial-small-paragraph-text min-w-0 break-words",children:s})]}):n.jsx("div",{className:"dial-small-paragraph-text min-w-0 text-primary break-words",children:s})]}),a!=null&&n.jsx("div",{className:"flex shrink-0 items-center",children:a}),f,c&&n.jsx(k.CloseButton,{className:"shrink-0 self-start",ariaLabel:"Close notification",onClose:v=>d?.(v)})]})},Pr={2:"line-clamp-2",3:"line-clamp-3",4:"line-clamp-4",5:"line-clamp-5",6:"line-clamp-6"},Bo=e=>e===1?"!truncate !whitespace-nowrap":`${Pr[e]??Pr[2]} !whitespace-normal`,Fo=({text:e,query:t,markClassName:r,className:s,maxLines:a=2})=>{const i=I.mergeClasses(Bo(a),s,w.DIAL_KIT_CLASS.highlight);if(!t.trim())return n.jsx(k.EllipsisTooltip,{className:i,text:e});const o=e.toLowerCase().indexOf(t.toLowerCase()),l=o===-1?e:n.jsxs(n.Fragment,{children:[e.slice(0,o),n.jsx("mark",{className:I.mergeClasses("text-accent bg-control-accent-alpha-hover",r),children:e.slice(o,o+t.length)}),e.slice(o+t.length)]});return n.jsx(k.EllipsisTooltip,{className:i,text:l})},zo=({className:e,children:t,...r})=>n.jsx("article",{...r,className:I.mergeClasses("relative flex flex-col gap-3 rounded-[20px] border-2 border-transparent p-5","bg-layer-raised shadow-md transition-[transform,box-shadow] duration-200 ease-out hover:-translate-y-[3px] hover:shadow-lg motion-reduce:transition-none motion-reduce:hover:translate-y-0",e,w.DIAL_KIT_CLASS.cardShell),children:t}),Qe=(e,t)=>({type:s,...a})=>n.jsx(ur,{...a,variant:e,type:s||t}),et=(e,t)=>({variant:s,...a})=>n.jsx(ur,{...a,variant:s||t,type:e}),$o=Qe(y.NotificationVariant.Error,y.NotificationType.Toast),Ko=Qe(y.NotificationVariant.Info,y.NotificationType.Toast),Ho=Qe(y.NotificationVariant.Success,y.NotificationType.Toast),Vo=Qe(y.NotificationVariant.Warning,y.NotificationType.Toast),Go=Qe(y.NotificationVariant.Loading,y.NotificationType.Toast),Uo=Qe(y.NotificationVariant.General,y.NotificationType.Toast),Wo=et(y.NotificationType.SectionMessage,y.NotificationVariant.Error),qo=et(y.NotificationType.SectionMessage,y.NotificationVariant.Info),Zo=et(y.NotificationType.SectionMessage,y.NotificationVariant.Success),Yo=et(y.NotificationType.SectionMessage,y.NotificationVariant.Warning),Xo=et(y.NotificationType.SectionMessage,y.NotificationVariant.Loading),Jo=et(y.NotificationType.SectionMessage,y.NotificationVariant.General);var be=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(be||{});const Qo="en-GB",el={[be.Date]:"Select date",[be.DateTime]:"Select date and time",[be.Time]:"--:--",[be.Weekday]:"Select day"},An="flex w-full items-center justify-between gap-2 rounded-xl border border-secondary bg-layer-raised px-4 py-3 dial-small-text text-primary outline-none transition-colors hover:border-accent-alpha focus-within:border-accent-focus",_n="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",Ln="!border-error",tl="z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",rl="flex size-10 items-center justify-center rounded-full dial-small-text text-primary hover:bg-control-accent-alpha-hover hover:text-primary focus:outline-none focus-visible:outline focus-visible:outline-focus",nl="bg-control-accent text-control-permanent",sl="text-accent dial-small-semi-text",al="text-control-disable-primary",Rn="text-secondary",il=n.jsx(K.IconCalendar,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Rn}),Mr={prev:n.jsx(K.IconChevronLeft,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:n.jsx(K.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},ol=(e,t)=>{const s=(new Date(e,t,1).getDay()+6)%7,a=new Date(e,t,1-s);return Array.from({length:42},(i,o)=>{const l=new Date(a);return l.setDate(a.getDate()+o),l})},Br=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Fr=(e,t,r)=>{const s=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t){const a=new Date(t.getFullYear(),t.getMonth(),t.getDate());if(s<a)return!0}if(r){const a=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(s>a)return!0}return!1},ll=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),zr=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),cl=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),ut=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,$r=(e,t)=>{const[r,s]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,s||0,0,0),a},dl=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),ul=e=>{const t=e.replace(/\D/g,"").slice(0,4);let r=t.slice(0,2);const s=t.slice(2,4);if(r.length===2&&(r=String(Math.min(Number(r),23)).padStart(2,"0")),s.length===0)return r;const a=String(Math.min(Number(s),59)).padStart(s.length,"0");return`${r}:${a}`},kn=5,Pn=e=>e.charAt(0).toUpperCase()+e.slice(1),fl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,kn+r));return Pn(s.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),pl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,kn+r));return{value:String(r+1),label:Pn(s.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),Kr=({id:e,disabled:t,invalid:r,trigger:s,panelClassName:a,fieldClassName:i,panel:o,labelledBy:l,panelLabel:c})=>{const d=w.useThemeScope(),[f,p]=g.useState(!1),{refs:h,floatingStyles:u,context:m}=de.useFloating({open:f,onOpenChange:j=>p(t?!1:j),placement:"bottom-start",whileElementsMounted:de.autoUpdate,middleware:[de.offset(8),de.flip({padding:8}),de.shift({padding:8})]}),v=de.useClick(m,{enabled:!t}),x=de.useDismiss(m),b=de.useRole(m,{role:"dialog"}),{getReferenceProps:C,getFloatingProps:S}=de.useInteractions([v,x,b]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{id:e,ref:h.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":f,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:I.mergeClasses(An,"focus-visible:outline focus-visible:outline-focus",r&&Ln,t&&_n,i),...C(),children:s}),f&&n.jsx(de.FloatingPortal,{children:n.jsx(de.FloatingFocusManager,{context:m,modal:!1,initialFocus:-1,returnFocus:!0,children:n.jsx("div",{ref:h.setFloating,style:u,"aria-label":c,className:I.mergeClasses(tl,d,a),...S(),children:o(()=>p(!1))})})})]})},Hr=({id:e,value:t,onChange:r,onBlur:s,disabled:a,invalid:i,className:o,ariaLabel:l,placeholder:c="--:--",timezoneLabel:d})=>{const[f,p]=g.useState(t);g.useEffect(()=>{p(t)},[t]);const h=n.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":l,placeholder:c,disabled:a,value:f,onChange:u=>{const m=ul(u.target.value);p(m),dl(m)&&r(m)},onBlur:s,className:I.mergeClasses(An,i&&Ln,a&&_n,o)});return d?n.jsxs("div",{className:"relative w-full",children:[h,n.jsx("span",{className:"dial-small-paragraph-text pointer-events-none absolute end-4 top-1/2 -translate-y-1/2 truncate text-secondary",children:d})]}):h},hl=({mode:e=be.Date,value:t,onChange:r,onBlur:s,labelProps:a,placeholder:i,disabled:o=!1,invalid:l=!1,id:c,className:d,minDate:f,maxDate:p,locale:h=Qo,fieldClassName:u,showTimezone:m=!1})=>{const v=i??el[e],x=t instanceof Date?t:null,b=g.useId(),C=c??b,S=a?.id??`${C}-label`,j=!!a?.label,D=typeof a?.label=="string"?a.label:void 0,T=j?`${S} ${C}`:void 0,L=a?n.jsx(k.Label,{...a,id:S,htmlFor:C}):null,[O,A]=g.useState(()=>x??new Date),R=g.useMemo(()=>new Date,[]),N=g.useMemo(()=>m?In({locale:h}):null,[m,h]),P=g.useMemo(()=>fl(h),[h]),F=g.useMemo(()=>pl(h),[h]),U=g.useMemo(()=>ol(O.getFullYear(),O.getMonth()),[O]),Q=Z=>{A(V=>new Date(V.getFullYear(),V.getMonth()+Z,1))},G=(Z,V)=>{if(Fr(Z,f,p))return;const ne=e===be.DateTime&&x?$r(Z,ut(x)):Z;r?.(ne),e===be.Date&&V()},B=Z=>{r?.($r(x??new Date,Z))},z=()=>x?e===be.DateTime?`${zr(x,h)}, ${ut(x)}`:zr(x,h):v;if(e===be.Time){const Z=typeof t=="string"?t:x?ut(x):"";return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",d,w.DIAL_KIT_CLASS.calendar),children:[L,n.jsx(Hr,{id:C,value:Z,onChange:V=>r?.(V),onBlur:s,disabled:o,invalid:l,placeholder:v,className:u,timezoneLabel:N})]})}if(e===be.Weekday){const Z=typeof t=="string"?t:void 0,V=F.find(ne=>ne.value===Z);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",d,w.DIAL_KIT_CLASS.calendar),children:[L,n.jsx(Kr,{id:C,disabled:o,invalid:l,labelledBy:T,panelLabel:D??v,fieldClassName:u,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!V&&"text-secondary"),children:V?.label??v}),n.jsx(K.IconChevronDown,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Rn})]}),panel:ne=>n.jsx("div",{role:"listbox","aria-label":D??v,className:"flex flex-col gap-0.5",children:F.map(X=>n.jsx("button",{type:"button",role:"option","aria-selected":X.value===Z,className:I.mergeClasses("flex w-full items-center rounded-lg px-3 py-2 text-left dial-small-text text-primary hover:bg-control-accent-alpha-hover","focus-visible:outline focus-visible:outline-focus",X.value===Z&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(X.value),ne()},children:X.label},X.value))})})]})}return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",d,w.DIAL_KIT_CLASS.calendar),children:[L,n.jsx(Kr,{id:C,disabled:o,invalid:l,labelledBy:T,panelLabel:D??v,fieldClassName:u,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!x&&"text-secondary"),children:z()}),il]}),panel:Z=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(k.StaticIconButton,{"aria-label":"Previous month",icon:Mr.prev,size:E.ElementSize.Small,onClick:()=>Q(-1)}),n.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:ll(O,h)}),n.jsx(k.StaticIconButton,{"aria-label":"Next month",icon:Mr.next,size:E.ElementSize.Small,onClick:()=>Q(1)})]}),n.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[P.map(V=>n.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:V},V)),U.map(V=>{const ne=V.getMonth()!==O.getMonth(),X=Br(V,x),W=Br(V,R),se=Fr(V,f,p);return n.jsx("button",{type:"button",disabled:se,"aria-label":cl(V,h),"aria-pressed":X,"aria-current":W?"date":void 0,className:I.mergeClasses(rl,ne&&al,W&&!X&&sl,X&&nl,se&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>G(V,Z),children:V.getDate()},V.toISOString())})]}),e===be.DateTime&&n.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-secondary pt-3",children:[n.jsx("span",{className:"dial-small-text text-primary",children:"Time"}),n.jsx(Hr,{ariaLabel:"Time",value:x?ut(x):"",onChange:B,onBlur:s,className:"w-[120px] px-3 py-1.5"})]})]})})]})},gl=({segments:e,labelClassName:t="dial-small-text",leafClassName:r="dial-small-semi-text",className:s,ariaLabel:a="Folder path"})=>{const i=n.jsx(w.DialIcon,{icon:n.jsx(K.IconFolder,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),className:"text-secondary"}),o=e.map((l,c)=>({label:c===e.length-1?n.jsx("span",{className:r,children:l}):l,disabled:!0,...c===0?{iconBefore:i}:{}}));return n.jsx(y.DialBreadcrumb,{className:I.mergeClasses(s,w.DIAL_KIT_CLASS.folderPath),ariaLabel:a,separator:n.jsx(w.DialIcon,{icon:n.jsx(K.IconChevronRight,{size:14,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),className:"text-secondary"}),pathItems:o,labelClassName:I.mergeClasses(t,"text-secondary","!cursor-default")})};var Ge=(e=>(e.Small="small",e.Heading="heading",e))(Ge||{});const ml="w-full overflow-hidden",xl="flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap",Vr="flex min-w-0 items-center gap-2",Gr={[Ge.Small]:"dial-small-text",[Ge.Heading]:"dial-h2-text"},bl={[Ge.Small]:"dial-small-semi-text",[Ge.Heading]:"dial-h2-text"},yl={first:"shrink-0",middle:"min-w-0 max-w-[30%] shrink",last:"min-w-0 max-w-[51%] shrink"},vl="flex min-w-0 flex-1 items-center gap-1 rounded-sm transition-colors",Cl="text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",Dl="cursor-default text-primary",Il="cursor-default text-secondary",Ur="inline-flex flex-none items-center leading-none text-secondary",Sl="dial-kit-minimum-target flex shrink-0 items-center rounded-sm text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",Nl=3,jl=4,Tl=n.jsx(K.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),wl=({items:e,maxVisibleItems:t=jl,size:r=Ge.Small,separator:s=Tl,ariaLabel:a="Breadcrumb",overflowAriaLabel:i="Show hidden path segments",className:o,itemClassName:l})=>{const c=Math.max(t,Nl),d=g.useMemo(()=>e.length>c?e.slice(1,-(c-2)):[],[e,c]),f=g.useMemo(()=>d.map((m,v)=>({key:String(v),label:m.label,icon:m.icon})),[d]),p=g.useCallback(({key:m,domEvent:v})=>{const x=d[Number(m)];x&&(x.onClick?.(v),!x.onClick&&x.href&&!v.defaultPrevented&&(window.location.href=x.href))},[d]);if(e.length===0)return null;const h=e.slice(d.length+1),u=(m,{index:v,isFirst:x,isCurrent:b})=>{const C=!b&&(!!m.href||!!m.onClick),S=I.mergeClasses(vl,C?Cl:b?I.mergeClasses(Dl,bl[r]):Il,l,w.DIAL_KIT_CLASS.breadcrumbsItem),j=n.jsxs(n.Fragment,{children:[m.icon,n.jsx(k.EllipsisTooltip,{text:m.label})]});return n.jsxs("li",{className:I.mergeClasses(Vr,Gr[r],yl[b?"last":x?"first":"middle"]),children:[C?m.href?n.jsx("a",{href:m.href,onClick:m.onClick,className:S,children:j}):n.jsx("button",{type:"button",onClick:m.onClick,className:S,children:j}):n.jsx("span",{className:S,"aria-current":b?"page":void 0,children:j}),!b&&n.jsx("span",{className:Ur,"aria-hidden":"true",children:s})]},`segment-${v}`)};return n.jsx("nav",{"aria-label":a,className:I.mergeClasses(ml,o,w.DIAL_KIT_CLASS.breadcrumbs),children:n.jsxs("ol",{className:xl,children:[u(e[0],{index:0,isFirst:!0,isCurrent:e.length===1}),d.length>0&&n.jsxs("li",{className:I.mergeClasses(Vr,Gr[r],"shrink-0"),children:[n.jsx(k.Dropdown,{items:f,onItemClick:p,placement:"bottom-start",matchReferenceWidth:!1,children:n.jsx("button",{type:"button","aria-label":i,className:Sl,children:n.jsx(K.IconDots,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})}),n.jsx("span",{className:Ur,"aria-hidden":"true",children:s})]}),h.map((m,v)=>u(m,{index:e.length-h.length+v,isFirst:!1,isCurrent:v===h.length-1}))]})})},tt=({label:e,variant:t,appearance:r=E.ButtonAppearance.Solid,size:s=E.ElementSize.Standard,className:a,textClassName:i,iconAfter:o,iconBefore:l,type:c="button",tooltipProps:d,href:f,target:p,rel:h,disabled:u,...m})=>{const v=I.mergeClasses("dial-kit-base-button",t&&k.getButtonClassNames(t,r),s===E.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",s===E.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",s===E.ElementSize.Small&&"dial-kit-base-button-small",r!==E.ButtonAppearance.Link&&(s===E.ElementSize.Small?"px-2":"px-4"),s!==E.ElementSize.Small&&r!==E.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),x=e?void 0:d?.tooltip,b=E.resolveAccessibleName(typeof e=="string"?e:void 0,m["aria-label"],x),C=n.jsxs(n.Fragment,{children:[n.jsx(w.DialIcon,{icon:l}),e&&n.jsx("span",{className:i,children:e}),n.jsx(w.DialIcon,{icon:o})]}),S=m,j=f!==void 0?n.jsx("a",{...S,href:u?void 0:f,target:p,rel:h??(p==="_blank"?"noopener noreferrer":void 0),"aria-disabled":u||void 0,tabIndex:u?-1:S.tabIndex,onClick:u?void 0:S.onClick,className:v,"aria-label":b,children:C}):n.jsx("button",{...m,type:c,disabled:u,className:v,"aria-label":b,children:C});return d?n.jsx(k.Tooltip,{asChild:!0,...d,children:j}):j},fr=(e,t)=>({appearance:s,...a})=>n.jsx(tt,{...a,variant:e,appearance:s||t}),pr=(e,t)=>({variant:s,...a})=>n.jsx(tt,{...a,variant:s||t,appearance:e}),Mn=fr(E.ButtonVariant.Primary,E.ButtonAppearance.Solid),hr=fr(E.ButtonVariant.Neutral,E.ButtonAppearance.Solid),El=fr(E.ButtonVariant.Danger,E.ButtonAppearance.Solid),Ol=pr(E.ButtonAppearance.Link,E.ButtonVariant.Primary),Al=pr(E.ButtonAppearance.Ghost,E.ButtonVariant.Primary),_l=pr(E.ButtonAppearance.Outlined,E.ButtonVariant.Neutral),Ll=({className:e,icon:t,tooltipProps:r,type:s="button",...a})=>{const i=I.mergeClasses("flex items-center justify-center rounded-full size-[40px]","dial-kit-enhanced-target","dial-kit-fab-button disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",e),o=n.jsx("button",{...a,type:s,className:i,"aria-label":E.resolveAccessibleName(a["aria-label"],r?.tooltip),children:t||n.jsx(K.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return r?n.jsx(E.DialTooltip,{...r,children:o}):o},Rl=e=>n.jsx(K.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",e&&"rotate-180")}),kl=({variant:e,appearance:t,items:r,...s})=>{const[a,i]=g.useState(!1),o=g.useMemo(()=>Rl(a),[a]);return n.jsx("div",{className:w.DIAL_KIT_CLASS.buttonDropdown,children:n.jsx(k.Dropdown,{items:r,onOpenChange:l=>i(l),children:n.jsx(tt,{...s,iconAfter:o,variant:e||E.ButtonVariant.Primary,appearance:t||E.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":a})})})},Bn=({label:e,size:t,isOpen:r=!1,"aria-label":s,...a})=>{const i=t===E.ElementSize.Small?"h-[32px]":"h-[40px] dial-kit-enhanced-target";return n.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":r,"aria-label":s?`${s} ${e}`:void 0,className:I.mergeClasses("dial-small-paragraph-text px-3 focus-visible:outline focus-visible:outline-focus","flex items-center gap-1 rounded-full text-primary disabled:text-control-disable-primary","hover:bg-control-accent-alpha-hover focus-visible:outline-offset-2 active:bg-control-accent-alpha-active",i,a.className,w.DIAL_KIT_CLASS.inlineSelect),...a,children:[e,n.jsx(K.IconChevronDown,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",r&&"rotate-180")})]})},Pl=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:s,size:a,disabled:i,placement:o="bottom-end",matchReferenceWidth:l=!1,listClassName:c,ariaLabel:d})=>{const[f,p]=g.useState(!1),[h,u]=g.useState(r??e[0]?.key),m=t!==void 0,v=m?t:h,x=g.useMemo(()=>{const C=e.find(S=>S.key===v);return C?.label?String(C.label):""},[e,v]),b=g.useCallback(({key:C})=>{const S=e.find(j=>j.key===C);S&&(m||u(C),s?.(S))},[e,m,s]);return n.jsx(k.Dropdown,{items:e,placement:o,matchReferenceWidth:l,listClassName:c,disabled:i,onOpenChange:p,onItemClick:b,children:n.jsx(Bn,{label:x,size:a,isOpen:f,disabled:i,"aria-label":d})})},ke=({text:e,className:t,variant:r=y.CaptionType.Description,...s})=>e?n.jsx("span",{...s,role:"alert",className:I.mergeClasses("dial-tiny-text",r===y.CaptionType.Error?"text-error":"text-secondary",t,w.DIAL_KIT_CLASS.captionText,r===y.CaptionType.Error&&w.DIAL_KIT_CLASS.errorText),children:e}):null,Pe=({...e})=>n.jsx(ke,{...e,variant:y.CaptionType.Error}),Ml="bg-control-neutral-active flex items-center justify-center enabled:text-secondary enabled:hover:text-control-accent-hover enabled:active:bg-control-accent-alpha-active enabled:hover:bg-control-accent-alpha-hover enabled:active:text-control-accent-active",Bl={[E.ElementSize.Small]:"size-[24px]",[E.ElementSize.Standard]:"size-[40px]",[E.ElementSize.Large]:"size-[48px]"},Fl=({icon:e,onClick:t,disabled:r,size:s=E.ElementSize.Standard,className:a})=>n.jsx("div",{className:I.mergeClasses("border-l border-tertiary",Bl[s]),children:n.jsx(k.IconButton,{className:I.mergeClasses(Ml,s===E.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:s})}),zl=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],Fn=(e,t,r,s)=>{if((t==="number"||r!==void 0||s!==void 0)&&!zl.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((r!==void 0||s!==void 0)&&e.currentTarget.selectionStart!==null){const i=e.currentTarget.value,o=e.currentTarget.selectionStart,l=e.currentTarget.selectionEnd??o,c=i.slice(0,o)+e.key+i.slice(l),d=parseFloat(c);if(!isNaN(d)){if(r!==void 0&&d<+r){e.preventDefault();return}if(s!==void 0&&d>+s){e.preventDefault();return}}}}},zn={[E.ElementSize.Small]:{field:"dial-kit-input-small gap-x-1",paddingStart:"pl-2",paddingEnd:"pr-2",stackGap:"gap-1",postfixText:"dial-tiny-text"},[E.ElementSize.Standard]:{field:"gap-x-2 py-2",paddingStart:"pl-3",paddingEnd:"pr-3",stackGap:"gap-2",postfixText:"dial-small-text"},[E.ElementSize.Large]:{field:"gap-x-2 py-3",paddingStart:"pl-4",paddingEnd:"pr-4",stackGap:"gap-2",postfixText:"dial-body-text"}},Ue=({labelProps:e,error:t,caption:r,id:s,containerClassName:a,size:i=E.ElementSize.Standard,...o})=>n.jsxs("div",{className:I.mergeClasses("flex flex-col",zn[i].stackGap,a),children:[e&&n.jsx(k.Label,{...e,htmlFor:s}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx($n,{id:s,size:i,...o}),n.jsx(Pe,{text:t}),!t&&n.jsx(ke,{text:r})]})]}),$n=({invalid:e,disabled:t,prefix:r,className:s,postfix:a,children:i,iconBefore:o,iconAfter:l,wrapperClassName:c,type:d,inputRef:f,value:p,tooltipText:h,min:u,onChange:m,max:v,inputButtonProps:x,wrapperRef:b,size:C=E.ElementSize.Standard,...S})=>{const j=zn[C],D=g.useRef(null),T=de.useMergeRefs([f,D]),L=d==="number"||u!==void 0||v!==void 0;g.useEffect(()=>{const N=D.current;if(!N||!L||t)return;const P=F=>{F.preventDefault()};return N.addEventListener("wheel",P,{passive:!1}),()=>{N.removeEventListener("wheel",P)}},[t,L,d]);const O=N=>{Fn(N,d,u,v)},A=N=>{const P=N.currentTarget.value;if(L&&P!==""){const F=parseFloat(P);if(isNaN(F)&&P!=="-"&&P!=="."||!isNaN(F)&&(u!==void 0&&F<+u||v!==void 0&&F>+v))return}m?.(P||void 0)},R=()=>n.jsxs("div",{ref:b,className:I.mergeClasses("dial-kit-input flex flex-row items-center justify-between",j.field,e&&"dial-kit-input-error",t&&"dial-kit-input-disable",!r&&j.paddingStart,!x&&j.paddingEnd,c),"aria-label":"input-container",children:[r&&n.jsx("div",{className:"border-r border-secondary",children:n.jsx($n,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,size:C,id:`${r}_textBefore`})}),n.jsx(w.DialIcon,{icon:o}),i,n.jsx("input",{ref:T,type:d,autoComplete:d==="password"?"new-password":"off",value:p??"",className:I.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",s),onChange:A,onKeyDown:O,min:u,disabled:t,max:v,...S}),a&&n.jsxs("p",{className:I.mergeClasses("text-secondary",j.postfixText),children:[" ",a]}),n.jsx(w.DialIcon,{icon:l}),x&&n.jsx(Fl,{size:C,...x,disabled:t})]});return t&&d!=="password"?n.jsx(k.Tooltip,{tooltip:h||p,children:R()}):R()};var We=(e=>(e.Outlined="outlined",e.Selectable="selectable",e))(We||{});const $l="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",Kl={[We.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[We.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"}},Hl="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",Vl="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",He=({label:e,icon:t,appearance:r=We.Outlined,selected:s=!1,disabled:a=!1,closable:i=!1,removeLabel:o,className:l,title:c,onClick:d,onRemove:f,onKeyDown:p,...h})=>{const u=r===We.Selectable,m=!!d&&!a,v=i&&!!f&&!a,x=u&&s,b=C=>{p?.(C),!(!m||C.defaultPrevented)&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),C.currentTarget.click())};return n.jsxs("span",{...h,role:m?"button":h.role,tabIndex:m?0:h.tabIndex,"aria-disabled":a||void 0,"aria-pressed":u&&m?s:void 0,onClick:a?void 0:d,onKeyDown:b,className:I.mergeClasses($l,x?"dial-tiny-semi-text":"dial-tiny-text",Kl[r][s?"selected":"default"],a&&"cursor-not-allowed",m&&[Hl,Vl],l,w.DIAL_KIT_CLASS.tag),children:[t&&n.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),n.jsx("span",{className:"truncate",title:c??e,children:e}),v&&n.jsx(k.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:E.ElementSize.Small,"aria-label":o??`Remove ${e}`,icon:n.jsx(K.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:C=>{C.stopPropagation(),f?.(C)}})]})},Kn=({options:e,selectedValues:t,handleRemoveTag:r})=>n.jsx(n.Fragment,{children:t.map(s=>{const a=e.find(i=>i.value===s);return n.jsx(He,{label:a?.label??s,closable:!!r,onRemove:i=>r?.(i,s),icon:a?.icon,className:"max-w-full border border-tertiary"},s)})}),Gl=I.mergeClasses("w-full flex flex-col"),Ul=k.overlayItemClassName,Wl="!max-w-[var(--reference-width)]",ql=I.mergeClasses("max-h-[344px] overflow-y-auto py-1",k.overlayListClassName),Zl=k.overlayGap,Yl=k.overlaySubMenuListClassName,Xl=n.jsx(K.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Jl="text-secondary transition-transform",Ql=8,ec=n.jsx(K.IconSearch,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),tc=n.jsx(K.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),rc=n.jsx(k.SvgNoData,{width:H.DIAL_ICON_SIZE.LG,height:H.DIAL_ICON_SIZE.LG,"aria-hidden":"true"}),nc=({opt:e,selectedValues:t,mark:r=k.MenuItemMark.Tint,onSelect:s})=>{const{isOpen:a,nodeId:i,refs:o,floatingStyles:l,context:c,getReferenceProps:d,getFloatingProps:f}=w.useSubMenuFloating(Zl,"listbox",!!e.disabled),p=e.children?.some(u=>t.includes(u.value)),h=n.jsx(k.MenuItem,{ref:o.setReference,role:"option","aria-haspopup":"listbox","aria-expanded":a,"aria-selected":!!p,"aria-disabled":!!e.disabled,disabled:e.disabled,ellipsisLabel:!0,icon:e.icon,label:e.labelNode??e.label,trailing:Xl,...d()});return n.jsxs(de.FloatingNode,{id:i,children:[e.interactiveTooltip?n.jsx(k.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:h}):h,a&&n.jsx(w.SubMenuPanel,{refs:o,floatingStyles:l,context:c,getFloatingProps:f,role:"listbox",surfaceClassName:Yl,children:e.children.map(u=>{const m=n.jsx(k.MenuItem,{role:"option","aria-selected":t.includes(u.value),"aria-disabled":!!u.disabled,disabled:u.disabled,mark:r,selected:t.includes(u.value),ellipsisLabel:!0,icon:u.icon,label:u.labelNode??u.label,rightControl:u.rightControl,onClick:()=>!u.disabled&&s(u.value)});return n.jsx(g.Fragment,{children:u.interactiveTooltip?n.jsx(k.InteractiveTooltip,{asChild:!0,placement:u.interactiveTooltip.placement,content:u.interactiveTooltip.content,contentClassName:u.interactiveTooltip.contentClassName,children:m}):m},u.value)})})]})},sc=({options:e,multiple:t=!1,id:r,value:s,defaultValue:a,size:i=E.ElementSize.Standard,prefix:o,customSelectedValue:l,placeholder:c="Select...",labelProps:d,error:f,caption:p,ariaLabel:h,searchable:u=!1,searchSize:m=E.ElementSize.Standard,searchPlaceholder:v,selectAll:x=!1,invalid:b,selectAllLabel:C="Select all",selectedOptionMark:S=k.MenuItemMark.Tint,emptyStateTitle:j="No options available",emptyStateDescription:D,emptyStateIcon:T,disabled:L=!1,className:O,fieldClassName:A,listClassName:R,closable:N=!1,header:P,footer:F,onClose:U,onChange:Q,dismissRef:G,onFooterClick:B,open:z,onOpenChange:Z,onSearchQueryChange:V,customMultiSelectTagsRenderer:ne})=>{const X=g.useId(),W=r||X,se=`list-${W}`,te=i===E.ElementSize.Small,[le,ue]=g.useState(!1),pe=z!==void 0,he=pe?!!z:le,fe=g.useCallback(M=>{pe||ue(M),Z?.(M)},[pe,Z]),[q,ee]=g.useState(""),Ie=g.useCallback(M=>{M!==q&&(ee(M||""),V?.(M||""))},[V,q]),Me=s!==void 0,[ge,Be]=g.useState(a),Te=Me?s:ge,ae=g.useMemo(()=>t?Array.isArray(Te)?Te:[]:typeof Te=="string"?[Te]:[],[Te,t]),Le=g.useMemo(()=>{const M=q.trim().toLowerCase();return M?e.filter(ce=>ce.label.toLowerCase().includes(M)):e},[e,q]);g.useEffect(()=>{he||Ie("")},[he,Ie]);const Se=g.useCallback(M=>{Me||Be(M),Q?.(M)},[Me,Q]),Fe=g.useCallback(M=>{if(t){const ce=new Set(ae);ce.has(M)?ce.delete(M):ce.add(M),Se(Array.from(ce));return}Se(M),fe(!1)},[t,Se,fe,ae]),rt=g.useCallback((M,ce)=>{if(M.stopPropagation(),!t){Se("");return}const ct=ae.filter(Yn=>Yn!==ce);Se(ct)},[t,ae,Se]),ve=g.useMemo(()=>Le.filter(M=>!M.disabled),[Le]),ze=g.useMemo(()=>ve.filter(M=>ae.includes(M.value)).length,[ve,ae]),{allSelectedInFiltered:Re,someSelectedInFiltered:me}=g.useMemo(()=>{const M=ve.length>0&&ze===ve.length;return{allSelectedInFiltered:M,someSelectedInFiltered:ze>0&&!M}},[ve,ze]),Et=g.useCallback(()=>{if(!(!t||ve.length===0))if(Re){const M=new Set(ve.map(ce=>ce.value));Se(ae.filter(ce=>!M.has(ce)))}else{const M=new Set(ae);ve.forEach(ce=>M.add(ce.value)),Se(Array.from(M))}},[Re,t,ve,ae,Se]),we=ae.length>0,$e=!t&&we?ae[0]:void 0,_=g.useMemo(()=>$e?e.find(M=>M.value===$e)??e.flatMap(M=>M.children??[]).find(M=>M.value===$e):void 0,[e,$e]),re=_?o?`${o} ${_.label}`:_.label:void 0,xe=g.useMemo(()=>t?we?n.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1",children:ne?.(e,ae,rt)??n.jsx(Kn,{options:e,selectedValues:ae,handleRemoveTag:rt})}):null:!_||!_.labelNode&&!_.description?null:n.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[n.jsx(k.EllipsisTooltip,{text:_.labelNode??re}),_.description&&n.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:_.description})]}),[ne,rt,we,t,e,re,ae,_]),Ot=t||xe?"":re||(l&&s?l:""),Un=typeof d?.label=="string"?d.label:void 0,Wn=xe?[E.resolveAccessibleName(h,Un),t?ae.map(M=>e.find(ce=>ce.value===M)?.label??M).join(", "):re].filter(Boolean).join(", ")||void 0:E.resolveAccessibleName(h);g.useImperativeHandle(G,()=>({dismiss:()=>{fe(!1)}}));const qn=g.useCallback(M=>{L||(M.key==="ArrowDown"||M.key==="ArrowUp")&&(M.preventDefault(),he||fe(!0))},[L,he,fe]),Zn=()=>n.jsxs("div",{id:se,role:"listbox","aria-multiselectable":t||void 0,className:Gl,children:[P&&n.jsx(n.Fragment,{children:typeof P=="function"?P():P}),(u||N)&&(e.length>Ql||!!q)&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[u&&n.jsx(Ue,{id:`search-${W}`,size:m,placeholder:v,"aria-label":v||"Search options",onChange:M=>Ie(M),value:q,iconBefore:ec,containerClassName:"w-full"}),N&&n.jsx(k.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:E.ElementSize.Small,icon:tc,onClick:M=>{U?.(M),fe(!1)}})]}),t&&x&&ve.length>0&&n.jsx("div",{className:I.mergeClasses(Ul,"mt-2"),children:n.jsx(k.Checkbox,{id:`${W}-selectAll`,labelProps:{label:C},isSelected:Re,isIndeterminate:me,onChange:Et})}),n.jsx("div",{role:"none",className:ql,children:Le.length===0?n.jsx("div",{className:"px-2 py-3",children:n.jsx(w.DialNoDataContent,{icon:T??rc,title:j,description:D})}):Le.map(M=>{const ce=ae.includes(M.value);if(M.children?.length)return n.jsx(nc,{opt:M,selectedValues:ae,mark:t?k.MenuItemMark.Checkbox:S,onSelect:Fe},M.value);const ct=t?n.jsx(k.MenuItem,{id:`${W}-${M.value}`,role:"option","aria-selected":ce,"aria-disabled":!!M.disabled,disabled:M.disabled,mark:k.MenuItemMark.Checkbox,selected:ce,icon:M.icon,label:M.labelNode??M.label,description:M.description,rightControl:M.rightControl,onClick:()=>Fe(M.value)}):n.jsx(k.MenuItem,{role:"option","aria-selected":ce,"aria-disabled":!!M.disabled,disabled:M.disabled,mark:S,selected:ce,ellipsisLabel:!0,icon:M.icon,label:M.labelNode??M.label,description:M.description,rightControl:M.rightControl,onClick:()=>!M.disabled&&Fe(M.value)});return n.jsx(g.Fragment,{children:M.interactiveTooltip?n.jsx(k.InteractiveTooltip,{asChild:!0,placement:M.interactiveTooltip.placement,content:M.interactiveTooltip.content,contentClassName:M.interactiveTooltip.contentClassName,children:ct}):ct},M.value)})}),F&&n.jsx("div",{onClick:M=>{B?.(M),B&&fe(!1)},children:typeof F=="function"?F():F})]});return n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-2",O,w.DIAL_KIT_CLASS.select),children:[d&&n.jsx(k.Label,{...d,htmlFor:W}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(k.Dropdown,{open:he,onOpenChange:fe,disabled:L,closable:N,onClose:U,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:I.mergeClasses(Wl,R),className:"w-full",renderOverlay:Zn,children:n.jsx(Ue,{id:W,size:i,disabled:L,invalid:b,value:Ot,placeholder:xe?void 0:c,readOnly:!0,iconBefore:t?void 0:_?.icon,iconAfter:n.jsx(K.IconChevronDown,{size:te?H.DIAL_ICON_SIZE.SM:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses(Jl,he&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":he,"aria-controls":se,"aria-autocomplete":"none","aria-label":Wn,containerClassName:"w-full",wrapperClassName:I.mergeClasses(!L&&"cursor-pointer",t&&we&&["!h-auto flex-wrap py-1.5",te?"min-h-[24px]":"min-h-[40px]"],A),className:I.mergeClasses("cursor-pointer",xe&&"w-0 min-w-0 flex-none p-0"),onKeyDown:qn,children:xe})}),n.jsx(Pe,{text:f}),!f&&n.jsx(ke,{text:p})]})]})};var Hn=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(Hn||{});const Wr={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},ac=e=>typeof e=="boolean"?Wr[e?"both":"none"]:Wr[e],ic=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...d})=>{const f=I.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",d.invalid&&"dial-kit-input-error",d.disabled&&"dial-kit-input-disable",ac(i),e);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",a),children:[o&&n.jsx(k.Label,{...o,htmlFor:c}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("textarea",{id:c,value:t||"",className:f,onChange:p=>r?.(p.currentTarget.value),...d}),n.jsx(Pe,{text:s}),!s&&n.jsx(ke,{text:l})]})]})},oc=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:r,size:s=E.ElementSize.Standard,...a})=>{const[i,o]=g.useState(!1),l=i&&!r;return g.useEffect(()=>{r&&o(!1)},[r]),n.jsx(Ue,{...a,wrapperClassName:I.mergeClasses(a.wrapperClassName,w.DIAL_KIT_CLASS.passwordInput),size:s,disabled:r,type:l?"text":"password",iconAfter:r?void 0:n.jsx(k.GhostIconButton,{size:E.ElementSize.Small,"aria-label":l?t:e,"aria-pressed":l,icon:l?n.jsx(K.IconEyeOff,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx(K.IconEye,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>o(c=>!c)})})},lc=/^0+\.(\d+)?$/,cc=/^0+/,dc=[".","-","+","e","E"],qr=e=>!e||e==="-"?e:String(e).match(lc)?String(e).replace(cc,"0"):Number(e),uc=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=d=>{if(e&&dc.includes(d.key)){d.preventDefault();return}Fn(d,"number",r,s),a?.(d)},c=d=>{if(e){const f=d.clipboardData.getData("text"),p=f.replace(/\D/g,"");if(p!==f&&(d.preventDefault(),p)){const h=d.currentTarget,u=h.selectionStart??0,m=h.selectionEnd??0,v=h.value.slice(0,u)+p+h.value.slice(m);t?.(qr(v))}}i?.(d)};return n.jsx(Ue,{...o,wrapperClassName:I.mergeClasses(o.wrapperClassName,w.DIAL_KIT_CLASS.numberInput),type:"number",min:r,max:s,onChange:d=>t?.(qr(d)),onKeyDown:l,onPaste:c})},fc="z-popup flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",pc="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",hc="flex flex-row items-center justify-between px-6 py-4",gc="flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary",mc="border-b border-tertiary",xc="flex flex-row items-center gap-2 px-6 py-4",bc="border-t border-tertiary",Ht="flex shrink-0 flex-row items-center gap-2",yc={[y.PopupSize.Sm]:"max-w-full md:max-w-[400px]",[y.PopupSize.Md]:"max-w-full md:max-w-[800px]",[y.PopupSize.Lg]:"max-w-full md:max-w-[1200px]"},gr=({open:e=!1,header:t,ariaLabel:r,portalId:s,className:a,overlayClassName:i,titleClassName:o,headerClassName:l,bodyClassName:c,children:d,footer:f,footerClassName:p,onClose:h,onBack:u,backAriaLabel:m="Back",headerActions:v,headerDivider:x=!1,mainButtons:b,additionalButtons:C,additionalButtonsOnLeft:S=!1,footerDivider:j=!1,size:D=y.PopupSize.Md,hideClose:T=!1,closeAriaLabel:L="Close dialog",closeOnOutsideClick:O=!0,preventKeyboardOnOpen:A=!1})=>{const R=w.useThemeScope(),N=g.useRef(null),P=g.useId(),{refs:F,context:U}=de.useFloating({open:e,onOpenChange:W=>{W||h?.(null)}}),Q=de.useRole(U,{role:"dialog"}),G=de.useDismiss(U,{outsidePress:O}),{getFloatingProps:B}=de.useInteractions([Q,G]);if(!e)return null;const z=typeof t=="string"?`popup-heading-${P}`:void 0,Z=W=>W?typeof W=="string"?n.jsx("h2",{id:z,className:I.mergeClasses(gc,o),children:n.jsx(k.Tooltip,{tooltip:W,triggerClassName:"truncate",children:W})}):W:n.jsx("span",{}),V=T?null:n.jsx(k.CloseButton,{ariaLabel:L,onClose:W=>h?.(W)}),ne=(W,se=[])=>se.map(({variant:te=E.ButtonVariant.Neutral,...le},ue)=>n.jsx(tt,{variant:te,...le},`${W}-${ue}`)),X=()=>{if(f!==void 0)return f;if(!b?.length&&!C?.length)return null;const W=ne("additional",C);return n.jsxs("div",{className:I.mergeClasses(xc,j&&bc,p),children:[S&&W.length>0&&n.jsx("div",{className:Ht,children:W}),n.jsxs("div",{className:I.mergeClasses(Ht,"ml-auto"),children:[!S&&W,ne("main",b)]})]})};return n.jsx(de.FloatingPortal,{id:s,children:n.jsx(de.FloatingOverlay,{className:I.mergeClasses(fc,R,i),children:n.jsx(de.FloatingFocusManager,{context:U,initialFocus:A?N:F.floating,children:n.jsxs("div",{ref:F.setFloating,...B(),role:"dialog","aria-modal":"true","aria-labelledby":z,"aria-label":z?void 0:r,className:I.mergeClasses(pc,yc[D],a,w.DIAL_KIT_CLASS.popup),children:[A&&n.jsx("div",{ref:N,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),n.jsxs("div",{className:I.mergeClasses(hc,x&&mc,l),children:[u&&n.jsx(k.GhostIconButton,{"aria-label":m,size:E.ElementSize.Small,className:"mr-2",onClick:u,icon:n.jsx(K.IconChevronLeft,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),Z(t),v?n.jsxs("div",{className:Ht,children:[v,V]}):V]}),n.jsx("div",{className:I.mergeClasses("grow overflow-auto",c),children:d}),X()]})})})})},vc="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Cc="text-secondary dial-small-paragraph-text px-6 pb-4",Dc="px-6 py-4 h-[120px]",Ic="Cancel",Sc="Ok",Vt={[y.ConfirmationPopupVariant.Info]:{confirm:{variant:E.ButtonVariant.Primary,appearance:E.ButtonAppearance.Solid}},[y.ConfirmationPopupVariant.Danger]:{container:"border-t-4 border-error",confirm:{variant:E.ButtonVariant.Danger,appearance:E.ButtonAppearance.Solid}}},Nc=({header:e,description:t,descriptionClassName:r,open:s=!1,confirmLabel:a=Sc,cancelLabel:i=Ic,isLoading:o=!1,disableConfirmButton:l=!1,className:c,confirmClassName:d,onClose:f,onConfirm:p,onCancel:h,children:u,variant:m=y.ConfirmationPopupVariant.Info,size:v=y.PopupSize.Sm,footer:x,hideClose:b,...C})=>{const S=o?null:n.jsxs("div",{className:vc,children:[n.jsx(hr,{label:i,onClick:()=>h?h():f?.()}),n.jsx(tt,{variant:Vt[m].confirm.variant,appearance:Vt[m].confirm.appearance,className:d,label:a,disabled:l,onClick:p})]}),j=g.useCallback(()=>o?n.jsx("div",{className:Dc,children:n.jsx(y.Spinner,{size:40})}):u??(t?n.jsx("div",{className:I.mergeClasses(Cc,r),children:t}):null),[u,t,o,r]);return n.jsx(gr,{...C,open:s,header:e,className:I.mergeClasses(Vt[m].container,c,w.DIAL_KIT_CLASS.confirmationPopup),onClose:()=>f?.(),footer:x??S,size:v,hideClose:b??(!o&&x===void 0),children:j()})},jc=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,ariaLabel:l,onToggle:c,className:d,headerClassName:f,contentClassName:p})=>{const h=s!==void 0,[u,m]=g.useState(a),v=o?!0:h?s:u,x=g.useId(),b=`accordion-header-${x}`,C=`accordion-content-${x}`,S=()=>{if(i)return;const D=!v;h||m(D),c?.(D)},j=n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"flex min-w-0 flex-col",children:[n.jsx("span",{className:"truncate dial-body-text text-primary",children:e}),t?n.jsx("span",{className:"truncate dial-tiny-text text-secondary",children:t}):null]}),!o&&n.jsx(K.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses("shrink-0 text-secondary transition-transform motion-reduce:transition-none",v&&"rotate-90")})]});return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-3 py-3 overflow-hidden bg-transparent ",d,w.DIAL_KIT_CLASS.accordion),children:[o?n.jsx("div",{id:b,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center justify-between dial-tiny-text",f),children:j}):n.jsx("button",{id:b,type:"button","aria-expanded":v,"aria-controls":v?C:void 0,"aria-label":E.resolveAccessibleName(l),disabled:i,onClick:S,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center justify-between dial-tiny-text",i?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",f),children:j}),v&&n.jsx("div",{id:C,role:"region","aria-labelledby":b,className:I.mergeClasses("px-4 dial-small-text text-primary",p),children:r})]})},Tc=({id:e,labelProps:t,isOn:r=!1,disabled:s,onChange:a,caption:i,className:o,...l})=>{const c=g.useId(),d=e??c,f=i?`${d}-caption`:void 0,p=g.useCallback(h=>{a?.(h.target.checked)},[a]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:I.mergeClasses("flex items-center gap-2",o,w.DIAL_KIT_CLASS.switch),children:[n.jsx("input",{...l,type:"checkbox",role:"switch",id:d,checked:r,"aria-checked":r,disabled:s,onChange:p,"aria-label":E.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":f,className:"peer sr-only"}),n.jsx("label",{htmlFor:d,className:I.mergeClasses("flex h-[18px] w-[36px] shrink-0 items-center rounded-full p-0.5 transition-colors duration-200","peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",r?"justify-end":"justify-start",s?"cursor-not-allowed bg-control-disable-primary":I.mergeClasses("cursor-pointer",r?"bg-control-accent hover:bg-control-accent-hover":"bg-control-neutral-default hover:bg-control-neutral-hover-strong")),children:n.jsx("span",{className:I.mergeClasses("size-3.5 shrink-0 rounded-full",s?"bg-control-disable-secondary":"bg-control-neutral")})}),t&&n.jsx(k.Label,{size:E.ElementSize.Standard,...t,htmlFor:d,className:I.mergeClasses("py-[1px]",s?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),i&&n.jsx("span",{id:f,className:"dial-tiny-text text-secondary ml-[44px]",children:i})]})},wc="flex flex-col gap-2",Ec="flex",Oc="mt-2 ml-[26px]",Ac={[y.RadioGroupOrientation.Column]:"flex-col gap-y-3",[y.RadioGroupOrientation.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},Vn=({items:e,value:t,onChange:r,name:s,id:a,orientation:i=y.RadioGroupOrientation.Column,labelProps:o,disabled:l,error:c,caption:d,ariaLabel:f,className:p,optionsClassName:h,radioClassName:u,contentClassName:m})=>{const v=g.useId(),x=a??v,b=`${x}-label`,C=c?`${x}-error`:void 0,S=!c&&d?`${x}-caption`:void 0,j=E.resolveAccessibleName(o?.label);return n.jsxs("div",{className:I.mergeClasses(wc,p,w.DIAL_KIT_CLASS.radioGroup),children:[o&&n.jsx(k.Label,{...o,id:b}),n.jsx("div",{role:"radiogroup","aria-labelledby":j?b:void 0,"aria-label":j?void 0:E.resolveAccessibleName(f),"aria-describedby":[C,S].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:I.mergeClasses(Ec,Ac[i],h),children:e.map(D=>{const T=D.value===t;return n.jsxs("div",{className:"flex min-w-0 flex-col",children:[n.jsx(k.Radio,{id:`${x}-${D.value}`,name:s??x,value:D.value,labelProps:D.label==null?void 0:{label:D.label},"aria-label":D["aria-label"],caption:D.caption,isSelected:T,disabled:l||D.disabled,onChange:r,className:u}),T&&D.content?n.jsx("div",{className:I.mergeClasses(Oc,m),children:D.content}):null]},D.value)})}),n.jsx(Pe,{id:C,text:c}),!c&&n.jsx(ke,{id:S,text:d})]})},_c="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",Lc="min-w-0 flex-1 truncate text-primary",Rc="min-w-0 flex-1 truncate text-secondary",kc="shrink-0 text-secondary",Pc="px-6 pb-4",Mc="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Bc="Cancel",Fc="Apply",zc=({items:e,value:t,customValue:r,header:s,onApply:a,id:i,labelProps:o,placeholder:l,selectedValue:c,onSelectionChange:d,onCancel:f,onClose:p,isValid:h=!0,applyButtonLabel:u=Fc,cancelButtonLabel:m=Bc,size:v=y.PopupSize.Md,portalId:x,disabled:b,invalid:C,error:S,caption:j,ariaLabel:D,className:T,fieldClassName:L})=>{const O=g.useId(),A=i??O,R=`${A}-label`,N=`${A}-value`,P=S?`${A}-error`:void 0,F=!S&&j?`${A}-caption`:void 0,[U,Q]=g.useState(!1),G=c!==void 0,[B,z]=g.useState(t),Z=G?c:B,V=g.useCallback(()=>{b||(G||z(t),Q(!0))},[b,G,t]),ne=g.useCallback(()=>{Q(!1),p?.()},[p]),X=g.useCallback(()=>{f?.(),ne()},[f,ne]),W=g.useCallback(()=>{a(Z),ne()},[a,Z,ne]),se=g.useCallback(q=>{G||z(q),d?.(q)},[G,d]),te=E.resolveAccessibleName(o?.label),le=te?void 0:E.resolveAccessibleName(D),ue=te?R:le&&`${A}-name`,pe=E.resolveAccessibleName(s),he=e.find(q=>q.value===t)?.label,fe=r??he;return n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-2",T,w.DIAL_KIT_CLASS.radioGroupPopupField),children:[o&&n.jsx(k.Label,{...o,id:R,htmlFor:A}),n.jsxs("div",{className:"flex flex-col gap-1",children:[le&&n.jsx("span",{id:ue,className:"sr-only",children:le}),n.jsxs("button",{type:"button",id:A,disabled:b,"aria-haspopup":"dialog","aria-expanded":U,"aria-labelledby":ue?`${ue} ${N}`:void 0,"aria-describedby":[P,F].filter(Boolean).join(" ")||void 0,onClick:V,className:I.mergeClasses(_c,C&&"dial-kit-input-error",b&&"dial-kit-input-disable",L),children:[n.jsx("span",{id:N,className:fe==null?Rc:Lc,children:fe??l}),n.jsx(K.IconMaximize,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:kc})]}),n.jsx(Pe,{id:P,text:S}),!S&&n.jsx(ke,{id:F,text:j})]}),n.jsx(gr,{open:U,header:s,ariaLabel:pe?void 0:te,portalId:x,size:v,onClose:X,footer:n.jsxs("div",{className:Mc,children:[n.jsx(hr,{label:m,onClick:X}),n.jsx(Mn,{label:u,disabled:!h,onClick:W})]}),children:n.jsx("div",{className:Pc,children:n.jsx(Vn,{id:`${A}-options`,items:e,value:Z,onChange:se,orientation:y.RadioGroupOrientation.Column,ariaLabel:te??pe})})})]})},$c=({icon:e,selectedIcon:t,isSelected:r=!1,onToggle:s,onClick:a,tooltipProps:i,size:o=E.ElementSize.Small,className:l,...c})=>{const d=g.useCallback(p=>{a?.(p),s?.(!r)},[a,s,r]),f=n.jsx(k.IconButton,{...c,size:o,variant:E.ButtonVariant.Primary,appearance:E.ButtonAppearance.Ghost,icon:r?t??e:e,"aria-pressed":r,"aria-label":E.resolveAccessibleName(c["aria-label"],i?.tooltip),onClick:d,className:I.mergeClasses("!rounded","[&_svg]:size-4",r&&"!text-accent",l,w.DIAL_KIT_CLASS.toggleIconButton)});return i?n.jsx(k.Tooltip,{asChild:!0,...i,children:f}):f},Kc=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Hc="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Vc="flex h-8 min-w-8 grow shrink-0 basis-auto items-center justify-center gap-2 whitespace-nowrap rounded-full px-4 dial-small-text transition-colors duration-200 outline-offset-0 focus-visible:outline focus-visible:outline-focus",Gc="bg-layer-raised text-accent shadow-xs",Uc="bg-transparent text-secondary",Wc="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",qc="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",Zc="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",Yc="cursor-not-allowed bg-transparent text-control-disable-primary",Xc=({items:e,value:t,onChange:r,disabled:s,className:a,segmentClassName:i,"aria-label":o})=>{const l=g.useRef({}),c=e.find(p=>p.value===t),d=c&&!c.disabled?c.value:e.find(p=>!p.disabled)?.value,f=g.useCallback(p=>{if(s||!Kc.includes(p.key))return;const h=e.filter(b=>!b.disabled);if(h.length===0)return;const u=Math.max(h.findIndex(b=>b.value===t),0),m=h.length-1;let v=u;switch(p.key){case"ArrowRight":case"ArrowDown":v=u===m?0:u+1;break;case"ArrowLeft":case"ArrowUp":v=u===0?m:u-1;break;case"Home":v=0;break;case"End":v=m;break}p.preventDefault();const x=h[v];l.current[x.value]?.focus(),x.value!==t&&r(x.value)},[s,e,t,r]);return n.jsx("div",{role:"radiogroup","aria-label":o,"aria-disabled":s||void 0,onKeyDown:f,className:I.mergeClasses(Hc,a,w.DIAL_KIT_CLASS.segmentedControl),children:e.map(p=>{const h=p.value===t,u=s||p.disabled;return n.jsxs("button",{ref:m=>{l.current[p.value]=m},type:"button",role:"radio","aria-checked":h,"aria-label":E.resolveAccessibleName(p["aria-label"],typeof p.label=="string"?p.label:void 0),tabIndex:p.value===d?0:-1,disabled:u,onClick:()=>r(p.value),className:I.mergeClasses(Vc,h?Gc:Uc,u?h?Zc:Yc:h?Wc:qc,i,w.DIAL_KIT_CLASS.segmentedControlItem),children:[p.icon,p.label]},p.value)})})},Jc={[y.TabOrientation.Horizontal]:{next:"ArrowRight",previous:"ArrowLeft"},[y.TabOrientation.Vertical]:{next:"ArrowDown",previous:"ArrowUp"}},Qc=({tabs:e,activeTabId:t,onTabChange:r,orientation:s=y.TabOrientation.Horizontal,sectionLabel:a,ariaLabel:i,className:o,tabListClassName:l,tabClassName:c,sectionLabelClassName:d})=>{const f=g.useRef({}),p=g.useId(),h=s===y.TabOrientation.Vertical,u=e.find(b=>b.id===t),m=u&&!u.disabled?u.id:e.find(b=>!b.disabled)?.id,v=g.useCallback(b=>{const{next:C,previous:S}=Jc[s];if(![C,S,"Home","End"].includes(b.key)||e.length===0)return;const j=e.filter(A=>!A.disabled);if(j.length===0)return;const D=Math.max(j.findIndex(A=>A.id===t),0),T=j.length-1;let L=D;b.key===C?L=D===T?0:D+1:b.key===S?L=D===0?T:D-1:b.key==="Home"?L=0:L=T,b.preventDefault();const O=j[L];f.current[O.id]?.focus(),O.id!==t&&r(O.id)},[e,t,r,s]),x=n.jsx("div",{role:"tablist","aria-orientation":h?"vertical":void 0,"aria-label":i,"aria-labelledby":!i&&a?p:void 0,onKeyDown:v,className:I.mergeClasses(h?"flex flex-col gap-1 px-2":"flex justify-start gap-1",!a&&o,l,w.DIAL_KIT_CLASS.tabList,!a&&w.DIAL_KIT_CLASS.tabs),children:e.map(b=>{const C=t===b.id,S=!!b.disabled;return n.jsxs("button",{ref:j=>{f.current[b.id]=j},type:"button",role:"tab","aria-selected":C,disabled:S,tabIndex:b.id===m?0:-1,onClick:()=>r(b.id),className:I.mergeClasses("dial-kit-enhanced-target flex items-center gap-2 text-start","transition-colors motion-reduce:transition-none","focus-visible:outline focus-visible:outline-focus",h?["h-11 w-full rounded-lg px-3 desktop:h-10","focus-visible:-outline-offset-1",C?"dial-small-semi-text":"dial-small-text text-secondary"]:["dial-small-paragraph-semi-text border-b-2 border-transparent px-3 py-2","focus-visible:outline-offset-2"],S&&(h?"cursor-not-allowed text-control-disable-primary":"cursor-not-allowed border-control-disable-primary text-control-disable-primary"),!S&&(h?C?"bg-control-accent-alpha text-accent hover:bg-control-accent-alpha-hover":"hover:bg-control-accent-alpha-hover":C?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),c,w.DIAL_KIT_CLASS.tab,C&&w.DIAL_KIT_CLASS.tabSelected),children:[b.icon&&n.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:b.icon}),n.jsx("span",{className:I.mergeClasses(h&&!C&&!S&&"text-primary"),children:b.label}),b.count!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",h&&"ms-auto",S&&"bg-layer-sunken text-control-disable-primary",!S&&(C?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:b.count})]},b.id)})});return a?n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-3",o,w.DIAL_KIT_CLASS.tabs),children:[n.jsx("div",{className:I.mergeClasses("flex h-16 shrink-0 items-center",h?"px-4":"px-3"),children:n.jsx("span",{id:p,className:I.mergeClasses("dial-h1-text text-primary",d,w.DIAL_KIT_CLASS.tabsSectionLabel),children:a})}),x]}):x},ed="flex flex-nowrap items-center gap-1",td="min-w-max flex-1 justify-center",rd=({items:e,value:t,onChange:r,stretch:s=!1,className:a,chipClassName:i,"aria-label":o,"aria-labelledby":l})=>n.jsx("div",{role:"group","aria-label":o,"aria-labelledby":l,className:I.mergeClasses(ed,a,w.DIAL_KIT_CLASS.filterChips),children:e.map(c=>n.jsx(He,{label:c.label,icon:c.icon,appearance:We.Selectable,selected:c.value===t,onClick:()=>r(c.value),className:I.mergeClasses(s&&td,i)},c.value))}),Qt=(e,t)=>{const r=(t??"").split(",").map(i=>i.trim().toLowerCase()).filter(Boolean);if(r.length===0)return!0;const s=e.name.toLowerCase(),a=e.type.toLowerCase();return r.some(i=>{if(i.startsWith("."))return s.endsWith(i);if(i.endsWith("/*")){const o=i.slice(0,-1);return a.length>o.length&&a.startsWith(o)}return a===i})},nd=({labelProps:e,label:t,description:r,onChange:s,onReject:a,accept:i,multiple:o=!1,disabled:l=!1,errorText:c,icon:d,id:f,ariaLabel:p,className:h})=>{const u=g.useId(),m=f??`file-dropzone-${u}`,v=c?`${m}-error`:void 0,[x,b]=g.useState(!1),C=g.useRef(0),S=g.useCallback(R=>{if(R.length===0)return;const N=o?R:R.slice(0,1),P=N.filter(U=>Qt(U,i)),F=N.filter(U=>!Qt(U,i));F.length>0&&a?.(F),P.length>0&&s(P)},[i,o,s,a]),j=g.useCallback(R=>{S(Array.from(R.target.files??[])),R.target.value=""},[S]),D=g.useCallback(()=>{C.current=0,b(!1)},[]),T=g.useCallback(R=>{l||(R.preventDefault(),C.current+=1,b(!0))},[l]),L=g.useCallback(R=>{l||(R.preventDefault(),R.dataTransfer.dropEffect="copy")},[l]),O=g.useCallback(()=>{l||(C.current-=1,C.current<=0&&D())},[l,D]),A=g.useCallback(R=>{R.preventDefault(),!l&&(D(),S(Array.from(R.dataTransfer?.files??[])))},[l,D,S]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[e&&n.jsx(k.Label,{...e,htmlFor:m}),n.jsx("input",{id:m,type:"file",accept:i,multiple:o,disabled:l,onChange:j,"aria-label":E.resolveAccessibleName(typeof t!="string"?p:void 0),"aria-describedby":v,"aria-invalid":c?!0:void 0,className:"peer sr-only"}),n.jsxs("label",{htmlFor:m,onDragEnter:T,onDragOver:L,onDragLeave:O,onDrop:A,className:I.mergeClasses("flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed px-6 py-10 text-center","transition-colors motion-reduce:transition-none","peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",l?"cursor-not-allowed border-secondary bg-layer-sunken":"cursor-pointer bg-layer-base",!l&&x&&"border-accent bg-control-accent-alpha",!l&&!x&&"border-secondary hover:border-accent",c&&!x&&"border-error hover:border-error",h,w.DIAL_KIT_CLASS.fileDropzone),children:[d??n.jsx(K.IconUpload,{size:H.DIAL_ICON_SIZE.LG,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:l?"text-control-disable-primary":"text-secondary"}),n.jsxs("span",{className:"flex flex-col gap-1",children:[n.jsx("span",{className:I.mergeClasses("dial-small-text",l?"text-control-disable-primary":"text-primary"),children:t}),r&&n.jsx("span",{className:I.mergeClasses("dial-tiny-text",l?"text-control-disable-primary":"text-secondary"),children:r})]})]}),n.jsx(Pe,{id:v,text:c})]})},sd=({availableWidth:e,tagWidths:t,overflowChipWidth:r,gap:s})=>{if(e<=0)return t.length;let a=0,i=0;for(const o of t){const l=o+s;if(a+l>e)break;a+=l,i++}if(i===t.length)return i;for(;i>0&&a+r>e;)i--,a-=t[i]+s;return i},ad=4,id=24,Zr=e=>parseFloat(e)||0,od=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},ld=()=>{},cd=({id:e,value:t,defaultValue:r,size:s=E.ElementSize.Standard,labelProps:a,placeholder:i,caption:o,error:l,invalid:c,disabled:d=!1,readOnly:f=!1,collapseTagOverflow:p=!1,ariaLabel:h,tagListLabel:u="Tags",className:m,fieldClassName:v,tagClassName:x,onChange:b})=>{const C=g.useId(),S=e||C,j=s===E.ElementSize.Small,D=g.useRef(null),T=g.useRef([]),L=g.useRef(null),O=t!==void 0,[A,R]=g.useState(r??[]),N=O?t:A,P=N.length,[F,U]=g.useState(""),[Q,G]=g.useState(P),B=!f&&!d,z=g.useCallback(q=>{O||R(q),b?.(q)},[O,b]),Z=g.useCallback(q=>ee=>{T.current[q]=ee},[]),V=g.useCallback(()=>{const q=D.current;if(!q||q.clientWidth===0){G(N.length);return}const{paddingLeft:ee,paddingRight:Ie}=getComputedStyle(q);G(sd({availableWidth:q.clientWidth-Zr(ee)-Zr(Ie)-(f?0:id),tagWidths:N.map((Me,ge)=>T.current[ge]?.offsetWidth??0),overflowChipWidth:L.current?.offsetWidth??0,gap:ad}))},[f,N]);g.useEffect(()=>{if(!p){G(P);return}const q=D.current;if(!q)return;const ee=new ResizeObserver(()=>V());return ee.observe(q),V(),()=>ee.disconnect()},[p,V,P]);const ne=I.mergeClasses(p?"shrink-0":"min-w-0",x),X=q=>{const ee=od(q.trim()).trim();!ee||N.includes(ee)||z([...N,ee])},W=q=>{z(N.filter(ee=>ee!==q))},se=()=>{X(F),U("")},te=q=>{if(B){if(q.key==="Enter"||q.key===","){q.preventDefault(),se();return}q.key==="Backspace"&&!F&&P>0&&(q.preventDefault(),z(N.slice(0,-1)))}},le=()=>{B&&F.trim()&&se()},ue=p?N.slice(0,Q):N,pe=p?N.slice(Q):[],he=pe.join(", "),fe=P>0&&n.jsxs("span",{role:"list","aria-label":u,className:I.mergeClasses("relative flex min-w-0 items-center gap-1",p?"flex-nowrap":"flex-wrap"),children:[ue.map(q=>n.jsx(He,{role:"listitem",label:q,className:ne,disabled:d,closable:B,onRemove:B?()=>W(q):void 0},q)),pe.length>0&&n.jsx(He,{role:"listitem",label:`+${pe.length}`,"aria-label":he,title:he,className:I.mergeClasses("shrink-0",x),disabled:d}),p&&n.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[N.map((q,ee)=>n.jsx("span",{ref:Z(ee),className:"inline-flex",children:n.jsx(He,{label:q,className:x,disabled:d,closable:B,onRemove:B?ld:void 0})},q)),n.jsx("span",{ref:L,className:"inline-flex",children:n.jsx(He,{label:`+${P}`,className:x})})]})]});return n.jsx(Ue,{id:S,size:s,labelProps:a,caption:o,error:l,invalid:c,disabled:d,readOnly:f,value:F,placeholder:P>0?void 0:i,"aria-label":h,wrapperRef:D,onChange:q=>U(q??""),onKeyDown:te,onBlur:le,containerClassName:I.mergeClasses("w-full",m),wrapperClassName:I.mergeClasses(P>0&&["!h-auto",j?"min-h-[24px] py-0.5":"min-h-[40px] py-1.5",p?"flex-nowrap overflow-hidden":"flex-wrap"],v,w.DIAL_KIT_CLASS.tagInput),className:I.mergeClasses("w-auto flex-1",p?"min-w-[24px]":"min-w-[100px]",f&&"cursor-default"),children:fe})},dd={[E.ElementSize.Small]:H.DIAL_ICON_SIZE.SM,[E.ElementSize.Standard]:H.DIAL_ICON_SIZE.MD,[E.ElementSize.Large]:H.DIAL_ICON_SIZE.MD},ud=({size:e=E.ElementSize.Standard,placeholder:t="Search...",withoutBorder:r=!1,clearLabel:s="Clear search",disabled:a,value:i,onChange:o,wrapperClassName:l,inputRef:c,...d})=>{const f=g.useRef(null),p=de.useMergeRefs([c,f]),h=!!i&&!a,u=g.useCallback(()=>{o?.(void 0),f.current?.focus()},[o]);return n.jsx(Ue,{...d,size:e,value:i,disabled:a,onChange:o,placeholder:t,inputRef:p,wrapperClassName:I.mergeClasses(r&&"dial-kit-input-borderless",l,w.DIAL_KIT_CLASS.search),iconBefore:n.jsx(K.IconSearch,{size:dd[e],stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":"true"}),iconAfter:h?n.jsx(k.GhostIconButton,{size:E.ElementSize.Small,"aria-label":s,icon:n.jsx(K.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:u}):void 0})},fd=16,pd=e=>(e.toString().split(".")[1]??"").length,hd=({id:e,value:t,min:r=0,max:s=1,step:a=.1,disabled:i,labelProps:o,labels:l,formatValue:c,showValue:d=!1,caption:f,error:p,onChange:h,containerClassName:u,trackClassName:m,fillClassName:v,className:x,...b})=>{const C=g.useId(),S=e??C,j=f&&!p?`${S}-caption`:void 0,D=p?`${S}-error`:void 0,T=s-r,L=T>0?Math.min(100,Math.max(0,(t-r)/T*100)):0,O=`calc(${L}% + ${(.5-L/100)*fd}px)`,A=c?c(t):t.toFixed(pd(a)),R=g.useCallback(N=>{h?.(Number(N.target.value))},[h]);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",u),children:[(o||d)&&n.jsxs("div",{className:"flex items-center gap-2",children:[o&&n.jsx(k.Label,{...o,htmlFor:S}),d&&n.jsx("span",{"aria-hidden":"true",className:I.mergeClasses("dial-small-text ml-auto",i?"text-control-disable-primary":"text-primary"),children:A})]}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:"relative flex h-6 items-center",children:[n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute inset-x-0 h-1 rounded-full",i?"bg-control-disable-primary":"bg-control-neutral-active",m)}),n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute left-0 h-1 rounded-full",i?"bg-control-disable-secondary":"bg-control-accent",v),style:{width:O}}),n.jsx("input",{...b,type:"range",id:S,value:t,min:r,max:s,step:a,disabled:i,onChange:R,"aria-label":E.resolveAccessibleName(typeof o?.label!="string"?b["aria-label"]:void 0),"aria-valuetext":c?A:void 0,"aria-describedby":D??j,className:I.mergeClasses("dial-kit-slider absolute inset-0 h-full w-full",x)})]}),l&&n.jsx("div",{className:"dial-tiny-text flex text-secondary",children:l.length===3?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:l[0]}),n.jsx("span",{className:"flex-1 text-center",children:l[1]}),n.jsx("span",{children:l[2]})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:l[0]}),n.jsx("span",{className:"ml-auto",children:l[1]})]})}),n.jsx(Pe,{id:D,text:p}),!p&&n.jsx(ke,{id:j,text:f})]})]})},gd=48,md=({children:e,title:t,width:r=280,collapsedWidth:s=gd,isOpened:a,defaultOpened:i=!0,onToggle:o,additionalButtons:l,ariaLabel:c="Sidebar",collapseLabel:d="Collapse sidebar",expandLabel:f="Expand sidebar",className:p,titleClassName:h,contentClassName:u,footerClassName:m})=>{const v=a!==void 0,[x,b]=g.useState(i),C=v?a:x,S=`collapsible-sidebar-content-${g.useId()}`,j=C?d:f,D=T=>{const L=!C;v||b(L),o?.(L,T)};return n.jsxs("aside",{"aria-label":c,style:{width:`${C?r:s}px`},className:I.mergeClasses("flex flex-col justify-between",p,w.DIAL_KIT_CLASS.collapsibleSidebar),children:[n.jsx("div",{id:S,hidden:!C,className:I.mergeClasses("min-h-0 flex-1 overflow-auto p-4",u),children:e}),n.jsx("div",{hidden:C,className:I.mergeClasses("rotate-180 px-3 py-4 [writing-mode:tb-rl] dial-small-text text-primary",h),children:t}),n.jsxs("div",{className:I.mergeClasses("flex h-12 shrink-0 flex-row items-center gap-2 border-t border-tertiary py-1",C?"justify-end px-2":"justify-center",m),children:[C&&l,n.jsx(k.IconButton,{variant:E.ButtonVariant.Primary,appearance:E.ButtonAppearance.Ghost,size:E.ElementSize.Standard,onClick:D,"aria-label":j,"aria-expanded":C,"aria-controls":S,tooltipProps:{tooltip:j},icon:C?n.jsx(K.IconChevronsLeft,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx(K.IconChevronsRight,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})},xd=({side:e,isResizing:t,width:r,minWidth:s,maxWidth:a,step:i,ariaLabel:o,onWidthChange:l,customHandler:c,handlerClassName:d})=>{const f=e===y.ResizableContainerSide.Left,p=f?K.IconChevronLeft:K.IconChevronRight,h=u=>{let m;switch(u.key){case"ArrowLeft":m=r+(f?i:-i);break;case"ArrowRight":m=r+(f?-i:i);break;case"Home":m=s;break;case"End":m=a;break;default:return}u.preventDefault(),l(m)};return n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":o,"aria-valuenow":r,"aria-valuemin":s,"aria-valuemax":a,tabIndex:0,onKeyDown:h,className:I.mergeClasses("relative h-full w-0.5 cursor-col-resize bg-control-accent text-accent","opacity-0 transition-opacity motion-reduce:transition-none","group-hover:opacity-100 focus-visible:opacity-100","focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",t&&"opacity-100",d),children:c??n.jsx(p,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses("pointer-events-none absolute top-1/2 -translate-y-1/2",f?"right-full":"left-full")})})},bd=16,Gn=({children:e,minWidth:t,maxWidth:r,width:s,defaultWidth:a,onResizeStop:i,onResize:o,side:l=y.ResizableContainerSide.Right,keyboardStep:c=bd,ariaLabel:d="Resize panel",className:f,resizeHandlerClassName:p,resizeHandler:h})=>{const[u,m]=g.useState(!1),[v,x]=g.useState(a??t),b=s!==void 0,C=b?s:v,S=g.useRef(null),j=g.useCallback(()=>{m(!0)},[]),D=g.useCallback(()=>{m(!1);const O=S.current?.resizable?.getBoundingClientRect(),A=O?Math.round(O.width):t;b||x(A),i?.(A)},[i,b,t]),T=g.useCallback(O=>{const A=Math.min(r,Math.max(t,O));A!==C&&(b||(x(A),S.current?.updateSize({width:A,height:"100%"})),o?.(A),i?.(A))},[r,t,C,b,o,i]),L=g.useMemo(()=>{const O=l===y.ResizableContainerSide.Left,A=n.jsx(xd,{side:l,isResizing:u,width:C,minWidth:t,maxWidth:r,step:c,ariaLabel:d,onWidthChange:T,customHandler:h,handlerClassName:p});return{size:b?{width:C,height:"100%"}:void 0,defaultSize:b?void 0:{width:C,height:"100%"},minWidth:t,maxWidth:r,enable:{left:O,right:!O},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:O?A:void 0,right:O?void 0:A},onResizeStart:j,onResize:(R,N,P)=>{o?.(Math.round(P.offsetWidth))},onResizeStop:D}},[l,b,C,t,r,c,d,T,h,p,u,j,D,o]);return n.jsx(y.Resizable,{ref:S,...L,children:n.jsx("div",{className:I.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",f,w.DIAL_KIT_CLASS.resizableContainer),children:e})})},yd=({enabled:e=!0,children:t,...r})=>e?n.jsx(Gn,{...r,children:t}):t;exports.ConfirmationPopupVariant=y.ConfirmationPopupVariant;exports.DialBreadcrumb=y.DialBreadcrumb;exports.DialBreadcrumbItem=y.DialBreadcrumbItem;exports.DialButton=y.DialButton;exports.DialButtonDropdown=y.DialButtonDropdown;exports.DialCaptionText=y.DialCaptionText;exports.DialCollapsibleSidebar=y.DialCollapsibleSidebar;exports.DialConditionalResizableContainer=y.DialConditionalResizableContainer;exports.DialConfirmationPopup=y.DialConfirmationPopup;exports.DialDangerButton=y.DialDangerButton;exports.DialDestinationFolderPopup=y.DialDestinationFolderPopup;exports.DialErrorText=y.DialErrorText;exports.DialFileIcon=y.DialFileIcon;exports.DialFileManager=y.DialFileManager;exports.DialFileManagerActions=y.DialFileManagerActions;exports.DialFileManagerTabs=y.DialFileManagerTabs;exports.DialFileName=y.DialFileName;exports.DialFileNodeType=y.DialFileNodeType;exports.DialFilePermission=y.DialFilePermission;exports.DialFileResourceType=y.DialFileResourceType;exports.DialFolderName=y.DialFolderName;exports.DialFoldersTree=y.DialFoldersTree;exports.DialFormItem=y.DialFormItem;exports.DialGhostButton=y.DialGhostButton;exports.DialInput=y.DialInput;exports.DialItemType=y.DialItemType;exports.DialLinkButton=y.DialLinkButton;exports.DialLoader=y.DialLoader;exports.DialNeutralButton=y.DialNeutralButton;exports.DialNotification=y.DialNotification;exports.DialPopup=y.DialPopup;exports.DialPrimaryButton=y.DialPrimaryButton;exports.DialRadioGroup=y.DialRadioGroup;exports.DialResizableContainer=y.DialResizableContainer;exports.DialSearch=y.DialSearch;exports.DialSharedEntityIndicator=y.DialSharedEntityIndicator;exports.DialTabs=y.DialTabs;exports.EDITABLE_CONTAINER_ATTRIBUTE=y.EDITABLE_CONTAINER_ATTRIBUTE;exports.FileManagerColumnKey=y.FileManagerColumnKey;exports.FileManagerProvider=y.FileManagerProvider;exports.FlexibleActionsDirection=y.FlexibleActionsDirection;exports.FormItemOrientation=y.FormItemOrientation;exports.NAME_COLUMN=y.NAME_COLUMN;exports.NOT_ALLOWED_SPACES=y.NOT_ALLOWED_SPACES;exports.NOT_ALLOWED_SPACES_REGEXP=y.NOT_ALLOWED_SPACES_REGEXP;exports.NOT_ALLOWED_SYMBOLS=y.NOT_ALLOWED_SYMBOLS;exports.NOT_ALLOWED_SYMBOLS_REGEXP=y.NOT_ALLOWED_SYMBOLS_REGEXP;exports.NotificationType=y.NotificationType;exports.NotificationVariant=y.NotificationVariant;exports.PopupSize=y.PopupSize;exports.RadioGroupOrientation=y.RadioGroupOrientation;exports.ResizableContainerSide=y.ResizableContainerSide;exports.SIZE_COLUMN=y.SIZE_COLUMN;exports.ScreenResolution=y.ScreenResolution;exports.Skeleton=y.Skeleton;exports.SkeletonAvatarShape=y.SkeletonAvatarShape;exports.SkeletonAvatarSize=y.SkeletonAvatarSize;exports.SkeletonVariant=y.SkeletonVariant;exports.Spinner=y.Spinner;exports.TabOrientation=y.TabOrientation;exports.TabView=y.TabView;exports.UPDATED_AT_COLUMN=y.UPDATED_AT_COLUMN;exports.editableContainerProps=y.editableContainerProps;exports.useDialFileManagerTabs=y.useDialFileManagerTabs;exports.useEditableItem=y.useEditableItem;exports.useFileManagerContext=y.useFileManagerContext;exports.DialLabel=_e.DialLabel;exports.DialSwitch=_e.DialSwitch;exports.DEFAULT_GRID_DATE_FORMAT_OPTIONS=w.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_GRID_DATE_LOCALE=w.DEFAULT_LOCALE;exports.DIAL_KIT_CLASS=w.DIAL_KIT_CLASS;exports.DialCloseButton=w.DialCloseButton;exports.DialDangerIconButton=w.DialDangerIconButton;exports.DialDateCellRenderer=w.DialDateCellRenderer;exports.DialDropdown=w.DialDropdown;exports.DialEllipsisTooltip=w.DialEllipsisTooltip;exports.DialGhostIconButton=w.DialGhostIconButton;exports.DialGrid=w.DialGrid;exports.DialIcon=w.DialIcon;exports.DialNeutralIconButton=w.DialNeutralIconButton;exports.DialNoDataContent=w.DialNoDataContent;exports.DialPrimaryIconButton=w.DialPrimaryIconButton;exports.DialRadioButton=w.DialRadioButton;exports.DialSecondaryIconButton=w.DialSecondaryIconButton;exports.DialSuccessIconButton=w.DialSuccessIconButton;exports.DialTertiaryIconButton=w.DialTertiaryIconButton;exports.DropdownItemType=w.DropdownItemType;exports.DropdownTrigger=w.DropdownTrigger;exports.DropdownType=w.DropdownType;exports.GridSelectionMode=w.GridSelectionMode;exports.ThemeScope=w.ThemeScope;exports.baseColumnComparator=w.baseColumnComparator;exports.checkColDefsChanges=w.checkColDefsChanges;exports.convertGridDateToDate=w.convertToDate;exports.convertToDate=w.convertToDate;exports.useThemeScope=w.useThemeScope;exports.BASE_ICON_PROPS=H.BASE_ICON_PROPS;exports.BASE_ICON_SIZE=H.BASE_ICON_SIZE;exports.DIAL_ICON_SIZE=H.DIAL_ICON_SIZE;exports.mergeClasses=I.mergeClasses;exports.Checkbox=k.Checkbox;exports.CheckboxBox=k.CheckboxBox;exports.CloseButton=k.CloseButton;exports.DEFAULT_DATE_FORMAT_OPTIONS=k.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_DATE_LOCALE=k.DEFAULT_LOCALE;exports.DangerIconButton=k.DangerIconButton;exports.DateCellRenderer=k.DateCellRenderer;exports.Dropdown=k.Dropdown;exports.EllipsisTooltip=k.EllipsisTooltip;exports.GRID_ALIGN_RIGHT_CLASS=k.GRID_ALIGN_RIGHT_CLASS;exports.GRID_ROOT_CLASS=k.GRID_ROOT_CLASS;exports.GRID_ROW_HEIGHT=k.ROW_HEIGHT;exports.GRID_SELECTION_COLUMN_ID=k.GRID_SELECTION_COLUMN_ID;exports.GRID_THEME_PARAMS=k.GRID_THEME_PARAMS;exports.GhostIconButton=k.GhostIconButton;exports.Grid=k.Grid;exports.IconButton=k.IconButton;exports.InfoButton=k.InfoButton;exports.InteractiveTooltip=k.InteractiveTooltip;exports.Label=k.Label;exports.MenuItem=k.MenuItem;exports.MenuItemMark=k.MenuItemMark;exports.NeutralIconButton=k.NeutralIconButton;exports.NoDataContent=k.NoDataContent;exports.PrimaryIconButton=k.PrimaryIconButton;exports.Radio=k.Radio;exports.StaticIconButton=k.StaticIconButton;exports.Tooltip=k.Tooltip;exports.TooltipContainer=k.TooltipContainer;exports.TooltipContent=k.TooltipContent;exports.TooltipPlacement=k.TooltipPlacement;exports.TooltipTrigger=k.TooltipTrigger;exports.ButtonAppearance=E.ButtonAppearance;exports.ButtonVariant=E.ButtonVariant;exports.DialIconButton=E.DialIconButton;exports.DialTooltip=E.DialTooltip;exports.DialTooltipContainer=E.DialTooltipContainer;exports.DialTooltipContent=E.DialTooltipContent;exports.DialTooltipTrigger=E.DialTooltipTrigger;exports.ElementSize=E.ElementSize;exports.EditorThemes=lt.EditorThemes;exports.LazyDialJsonEditor=lt.LazyDialJsonEditor;exports.LazyDialMarkdownEditor=lt.LazyDialMarkdownEditor;exports.LazyMarkdownEditor=lt.LazyMarkdownEditor;exports.DIAL_KIT_ICON_STROKE=ie.DIAL_KIT_ICON_STROKE;exports.Accordion=jc;exports.AnalyticsCardVariant=at;exports.Breadcrumbs=wl;exports.BreadcrumbsSize=Ge;exports.Button=tt;exports.ButtonDropdown=kl;exports.Calendar=hl;exports.CalendarMode=be;exports.CaptionText=ke;exports.CardShell=zo;exports.CollapsibleSidebar=md;exports.ConditionalResizableContainer=yd;exports.ConfirmationPopup=Nc;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=tr;exports.DangerButton=El;exports.DialAccordion=Yr;exports.DialAnalyticsBar=ft;exports.DialAnalyticsBarGroup=ns;exports.DialAnalyticsCard=es;exports.DialAnalyticsErrorTag=er;exports.DialAnalyticsHistogram=ls;exports.DialAutocompleteInputValue=fn;exports.DialCheckbox=Gt;exports.DialDraggableItem=Di;exports.DialDropdownIcon=po;exports.DialFormPopup=ki;exports.DialInputPopup=pn;exports.DialLabelledText=vs;exports.DialLoadFileArea=Dn;exports.DialLoadFileAreaField=fo;exports.DialNumberInput=Yt;exports.DialPagination=hs;exports.DialPasswordInput=hn;exports.DialRadioGroupPopupField=Ai;exports.DialRemoveButton=Nt;exports.DialSchemaRenderer=Lo;exports.DialSegmentedControl=Ei;exports.DialSelect=Ne;exports.DialSelectField=Wi;exports.DialSlider=ys;exports.DialSteps=bs;exports.DialTag=Ke;exports.DialTagInput=un;exports.DialTextarea=Ii;exports.ErrorMessageNotification=Wo;exports.ErrorText=Pe;exports.ErrorToastNotification=$o;exports.FabButton=Ll;exports.FileDropzone=nd;exports.FilterChips=rd;exports.FolderPath=gl;exports.GeneralMessageNotification=Jo;exports.GeneralToastNotification=Uo;exports.GhostButton=Al;exports.Highlight=Fo;exports.InfoMessageNotification=qo;exports.InfoToastNotification=Ko;exports.InlineSelect=Pl;exports.InlineSelectTrigger=Bn;exports.Input=Ue;exports.JsonSchemaType=$;exports.LinkButton=Ol;exports.LoadingMessageNotification=Xo;exports.LoadingToastNotification=Go;exports.MultiSelectTags=Kn;exports.NeutralButton=hr;exports.Notification=ur;exports.NumberInput=uc;exports.OutlinedButton=_l;exports.PasswordInput=oc;exports.Popup=gr;exports.PrimaryButton=Mn;exports.ProgressBar=cs;exports.RadioGroup=Vn;exports.RadioGroupPopupField=zc;exports.ResizableContainer=Gn;exports.SchemaDisplayMode=it;exports.SchemaOrientation=Tt;exports.SchemaRendererVariant=Xe;exports.Search=ud;exports.SegmentedControl=Xc;exports.Select=sc;exports.SelectSize=mt;exports.SelectVariant=xt;exports.Slider=hd;exports.StepStatus=ye;exports.SuccessMessageNotification=Zo;exports.SuccessToastNotification=Ho;exports.Switch=Tc;exports.Tabs=Qc;exports.Tag=He;exports.TagAppearance=We;exports.TagInput=cd;exports.Textarea=ic;exports.TextareaResize=Hn;exports.ToggleIconButton=$c;exports.WarningMessageNotification=Yo;exports.WarningToastNotification=Vo;exports.getTimezoneLabel=In;exports.matchesAccept=Qt;exports.wrapInRootFolder=yo;