@epam/ai-dial-ui-kit 0.15.0-dev.44 → 0.15.0-dev.45

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 v=require("./use-file-manager-tabs-C-dMqEFy.cjs"),Be=require("./Switch-DE6MrcqJ.cjs"),n=require("react/jsx-runtime"),h=require("react"),B=require("@tabler/icons-react"),ce=require("classnames"),j=require("./DateCellRenderer-Cl_mNbi1.cjs"),$=require("./icon-CrGVkVpG.cjs"),y=require("./merge-classes-BEJXjzkx.cjs"),k=require("./DateCellRenderer-ChqbDlQ2.cjs"),O=require("./IconButton-DHOFapLo.cjs"),ws=require("react-dom"),bt=require("./lazy-BEsZqouS.cjs"),ee=require("@floating-ui/react"),ie=require("./icon-DhjrDQ8I.cjs");function Es(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 Ar=Es(h),Ue=({label:e,className:t,icon:r,selected:s,closable:a,onClick:o,onRemove:i})=>{const l=y.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:o,children:[n.jsx(j.DialIcon,{icon:r}),n.jsx(j.DialEllipsisTooltip,{text:e}),a&&i&&n.jsx(v.DialButton,{className:"p-0",iconAfter:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM}),onClick:c=>i(c)})]},e)},pr=({label:e="Error",className:t})=>n.jsx(Ue,{label:e,className:y.mergeClasses("dial-tiny-semi-text cursor-default rounded-[120px] border-transparent bg-error text-error",t)});var gt=(e=>(e.Default="default",e.Compact="compact",e))(gt||{});const Os={[gt.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[gt.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},As=({title:e,value:t,description:r,variant:s=gt.Default,error:a,isLoading:o,className:i,delta:l,deltaPositive:c,deltaUnit:d,compareValues:f})=>{const p=Os[s],g=c!==void 0?c:(l??0)>=0,u=l===void 0?null:`${l>=0?`+${l}`:String(l)}${d??""}`;return n.jsxs("div",{className:y.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||o?"gap-2":"gap-1",p.container,i),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:y.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",g?"bg-success text-success":"bg-error text-error"),children:u})]}):n.jsx("span",{className:p.title,children:e}),a?n.jsx(pr,{className:"self-start"}):o?n.jsx(v.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(j.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(j.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&&!o&&p.showDescription&&r!=null&&r!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},gr=[{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"}],_s=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),Ls=(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},St=({value:e,maxValue:t=1,error:r,isLoading:s,title:a,valueLabel:o,colorMap:i=gr,className:l,titleClassName:c,valueClassName:d,inline:f,ariaLabel:p})=>{const g=e==null,u=!!(r||s||!g),m=_s(g?0:e,t),C=Ls(m,i),x=o??(g?"—":e),b=p??(typeof a=="string"?a:void 0),I=r||s,N=r?n.jsx(pr,{}):s?n.jsx(v.DialLoader,{fullWidth:!1}):n.jsx("span",{className:y.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}),T=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:y.mergeClasses("w-full overflow-hidden rounded-sm",f?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!I&&n.jsx("div",{className:"h-full rounded-sm transition-[width] duration-300",style:{width:`${m*100}%`,backgroundColor:C}})}):null,S=n.jsx("span",{className:y.mergeClasses("dial-small-text text-primary",c),children:a});return f?n.jsxs("div",{className:y.mergeClasses("flex flex-row items-center gap-2",l),children:[n.jsx("div",{className:"w-1/2 min-w-0",children:S}),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:T}),N]})]}):n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-1",l),children:[n.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[S,N]}),T]})},bn=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,onToggle:l,className:c,headerClassName:d,contentClassName:f})=>{const p=s!==void 0,[g,u]=h.useState(a),m=i?!0:p?s:g,C=h.useId(),x=()=>{if(o)return;const b=!m;p||u(b),l?.(b)};return n.jsxs("div",{className:y.mergeClasses("rounded border border-secondary",c),children:[n.jsxs("button",{type:"button","aria-expanded":m,"aria-controls":C,disabled:o||i,onClick:x,className:y.mergeClasses("flex w-full items-center gap-2 p-4 text-left",o?"cursor-not-allowed":"cursor-pointer",i&&"cursor-default",d),children:[!i&&n.jsx(j.DialIcon,{className:ce("text-secondary transition-transform",m&&"rotate-90"),icon:n.jsx(B.IconChevronRight,{size:$.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:C,role:"region",className:y.mergeClasses("px-4 pb-4",f),children:r})]})},ks=({title:e,titleTooltip:t,description:r,data:s,compareData:a,compareLabels:o,maxValue:i,colorMap:l,defaultExpanded:c=!0,nonCollapsible:d,isLoading:f,onBarClick:p,inline:g,barTitleClassName:u,barValueClassName:m,barClassName:C,barDescriptions:x,className:b})=>{const I=Object.entries(s),N=g?y.mergeClasses("text-secondary",u):u,T=o?"dial-tiny-text text-secondary":void 0,S=t?n.jsx(O.DialTooltip,{tooltip:t,children:e}):e,D=a?[...new Set([...Object.keys(s),...Object.keys(a)])]:[],_="cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-primary",E="group flex flex-col gap-1.5",A=y.mergeClasses("flex flex-col gap-1.5 pl-2",p&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",C);return n.jsx(bn,{title:S,description:r,defaultExpanded:c,nonCollapsible:d,className:b,children:n.jsx("div",{className:y.mergeClasses("flex flex-col",a?"gap-4":g?"gap-2":"gap-3"),children:f?n.jsx(v.DialLoader,{fullWidth:!1,className:"self-center"}):a?D.map(L=>{const w=L in s?s[L]:null,M=L in a?a[L]:null,K=typeof w=="number"&&typeof M=="number"?parseFloat((M-w).toFixed(3)):null,te=K!=null&&K!==0,G=te&&K>0,z=te?G?`+${K}`:String(K):null,H=x?.[L],q=n.jsx("span",{className:"dial-small-text text-secondary",children:L}),U=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[H?n.jsx(O.DialTooltip,{tooltip:H,children:q}):q,z!=null&&n.jsx("span",{className:y.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",G?"bg-success text-success":"bg-error text-error"),children:z})]}),n.jsxs("div",{className:A,children:[n.jsx(St,{title:o?.[0],value:w,maxValue:i,colorMap:l,inline:g,titleClassName:T,ariaLabel:L}),n.jsx(St,{title:o?.[1],value:M,maxValue:i,colorMap:l,inline:g,titleClassName:T,ariaLabel:`${L} compare`})]})]});return p?n.jsx("button",{type:"button",onClick:()=>p(L,w),className:y.mergeClasses(E,_),children:U},L):n.jsx("div",{className:E,children:U},L)}):I.map(([L,w])=>{const M=n.jsx(St,{title:L,value:w,maxValue:i,colorMap:l,inline:g,titleClassName:N,valueClassName:m,className:C}),F=p?n.jsx("button",{type:"button",onClick:()=>p(L,w),className:_,children:M}):M,K=x?.[L];return K?n.jsx(O.DialTooltip,{tooltip:K,triggerClassName:"flex flex-col",children:F},L):n.jsx(h.Fragment,{children:F},L)})})})},Rs="#FF4E50",Ms=(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},_r=(e,t)=>{const r=t.map(()=>0);let s=0;e.forEach(c=>{if(c<=0){s+=1;return}const d=Ms(c,t);d>=0&&(r[d]+=1)});const a=Math.max(0,s,...r),o=c=>a>0?c/a:0,i={from:0,to:0,color:Rs,count:s,ratio:o(s),isZeroBucket:!0},l=t.map((c,d)=>({from:c.from,to:c.to,color:c.color,count:r[d],ratio:o(r[d]),isZeroBucket:!1}));return[i,...l]},Cn=e=>e<=0?2:e%2===0?e:e+1,Ps=e=>{const t=Cn(e);return[t,t/2,0]},Gt=e=>`${Math.round(e*100)/100}`,vn=(e,t)=>e===t?Gt(e):`${Gt(e)}-${Gt(t)}`,Ut=128,Fs=(e,t)=>{const r=vn(e,t);return e===t?`scored ${r}`:`scored between ${r}`},Lr=(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:Fs(a.from,a.to)})]}),Bs=({title:e,values:t,colorMap:r=gr,valueTitle:s="values",showCount:a,isLoading:o,className:i,compareValues:l,valueSetLabel:c,compareValueSetLabel:d})=>{const f=_r(t,r),p=l?_r(l,r):void 0,g=t.length,u=l?.length??0,m=Math.max(g,u),C=Cn(m),x=Ps(m),b=S=>S.map(D=>({...D,ratio:C>0?D.count/C:0})),I=b(f),N=p?b(p):void 0,T=(S,D,_,E)=>{if(S.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:`${S.ratio*100}%`}})});const A=E?{backgroundImage:`repeating-linear-gradient(135deg, ${S.color} 0px, ${S.color} 1px, transparent 1px, transparent 4px)`,borderColor:S.color}:{backgroundColor:S.color};return n.jsx(O.DialTooltip,{placement:"bottom",tooltip:D,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":_,className:"flex min-h-2 w-full items-center justify-center rounded-sm border border-transparent",style:{height:`${S.ratio*100}%`,...A},children:a&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:S.count})})})};return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-2",i),children:[n.jsx("span",{className:"dial-small-text text-primary",children:e}),o?n.jsx("div",{className:"flex items-center justify-center",style:{height:Ut},children:n.jsx(v.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:Ut},children:x.map((S,D)=>n.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${D/(x.length-1)*100}%`,transform:"translateY(-50%)"},children:S},S))}),n.jsxs("div",{className:"relative min-w-0",children:[x.map((S,D)=>n.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${D/(x.length-1)*100}%`}},S)),n.jsx("div",{className:"relative flex items-end gap-1",style:{height:Ut},children:N?I.map((S,D)=>{const _=N[D],E=`${S.count} out of ${g} ${s}`,A=`${_.count} out of ${u} ${s}`;return n.jsxs("div",{className:"flex h-full flex-1 items-end",children:[T(S,Lr(c,S.count,g,s,S),E,!0),T(_,Lr(d,_.count,u,s,_),A,!1)]},D)}):I.map((S,D)=>{const _=`${S.count} out of ${g} ${s}`;return S.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:`${S.ratio*100}%`}})},D):n.jsx(O.DialTooltip,{placement:"bottom",tooltip:_,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":_,className:y.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-sm border","border-transparent"),style:{height:`${S.ratio*100}%`,backgroundColor:S.color},children:a&&S.count>0&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:S.count})})},D)})})]}),n.jsx("div",{}),n.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:I.map((S,D)=>n.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:vn(S.from,S.to)},D))})]})]})},yn=({value:e,max:t=100,size:r=O.ElementSize.Standard,labelProps:s,valueLabel:a,id:o,className:i,"aria-label":l,...c})=>{const d=h.useId(),f=o??d,p=!!s?.label,g=p?s?.id??`${f}-label`:void 0,u=t>0?t:0,m=Number.isFinite(e)?e:0,C=Math.min(Math.max(m,0),u),x=u>0?C/u*100:0,b=n.jsx("div",{...c,id:f,role:"progressbar","aria-valuenow":C,"aria-valuemin":0,"aria-valuemax":u,"aria-labelledby":g,"aria-label":O.resolveAccessibleName(l,p?void 0:"Progress"),className:y.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===O.ElementSize.Small?"h-1":"h-2",i,!p&&!a&&j.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:y.mergeClasses("flex w-full flex-col gap-1",j.DIAL_KIT_CLASS.progressBar),children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[s&&n.jsx(k.Label,{...s,id:g}),a&&n.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),b]})},zs=7,$s=2,Hs=e=>e<=0?[]:Array.from({length:e},(t,r)=>r+1);var Dt=(e=>(e.Active="active",e.Adjacent="adjacent",e.Far="far",e))(Dt||{});const Vs=(e,t,r)=>e===t?"active":r<zs||Math.abs(e-t)<=$s?"adjacent":"far",Ks=({page:e,totalPages:t,onPageChange:r,className:s})=>{const a=Hs(t);return n.jsxs("nav",{"aria-label":"Pagination",className:y.mergeClasses("flex items-center gap-2",s),children:[n.jsx(O.DialIconButton,{icon:n.jsx(B.IconCaretLeftFilled,{size:$.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:O.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(o=>{const i=Vs(o,e,t);return n.jsx("button",{type:"button",onClick:()=>r(o),"aria-label":`Page ${o}`,"aria-current":o===e?"page":void 0,className:y.mergeClasses("dial-pagination-dot rounded-full focus-visible:outline outline-offset-0 transition-all duration-300 ease-in-out",i===Dt.Active&&"h-[8px] w-[32px]",i===Dt.Adjacent&&"size-[8px]",i===Dt.Far&&"size-[4px]")},o)})}),n.jsx(O.DialIconButton,{icon:n.jsx(B.IconCaretRightFilled,{size:$.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:O.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e>=t,onClick:()=>r(e+1),"aria-label":"Next page"})]})},sr=({label:e,id:t,checked:r,indeterminate:s,disabled:a,ariaLabel:o,onChange:i,className:l,...c})=>{const d=h.useCallback(u=>{i?.(u.target.checked,t)},[i,t]),f=ce("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=ce("border rounded",a?"bg-layer-4 border-icon-secondary":""),g=()=>s?n.jsx(B.IconMinus,{className:p,...$.BASE_ICON_PROPS}):r?n.jsx(B.IconCheck,{className:p,...$.BASE_ICON_PROPS}):null;return n.jsxs("label",{...c,className:f,htmlFor:t,"aria-description":c["aria-description"]||j.ariaDescription,children:[g(),e&&(typeof e=="string"?n.jsx(j.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:o,className:"invisible size-0"})]})};var De=(e=>(e.VALID="valid",e.ERROR="error",e))(De||{});const Gs=(e,t)=>{if(t===e.id)switch(e.status){case De.VALID:return"border-accent-secondary text-primary";case De.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case De.VALID:return"border-primary text-primary";case De.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},Us=(e,t)=>{if(t===e.id)switch(e.status){case De.VALID:return"bg-accent-secondary";case De.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case De.VALID:return"bg-accent-secondary";case De.ERROR:return"bg-red-400";default:return"bg-layer-4"}},Zs=({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",o="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",i=()=>r===e.id&&e.status===De.ERROR?n.jsx(B.IconExclamationCircle,{stroke:2,size:$.DIAL_ICON_SIZE.SM}):r!==e.id&&e.status===De.VALID?n.jsx(B.IconCheck,{stroke:2,size:$.DIAL_ICON_SIZE.SM}):t+1;return n.jsxs("button",{className:ce(a,Gs(e,r)),onClick:()=>s(e.id),children:[n.jsx("span",{className:ce(o,Us(e,r)),children:i()}),n.jsx("span",{children:e.name})]})},Ws=({steps:e,currentStep:t,onChangeStep:r})=>{const s=a=>{const o=e.findIndex(c=>c.id===t),i=e.findIndex(c=>c.id===a);if(a===t)return;(e.slice(0,i).every(c=>c.status===De.VALID)||i<o)&&r(a)};return n.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,o)=>n.jsx(Zs,{currentStep:t,onChangeStep:s,step:a,index:o},a.id))})},Zt=e=>(e.toString().split(".")[1]??"").length,qs=({value:e,min:t=0,max:r=1,step:s=.1,disabled:a=!1,labelProps:o,labels:i,formatValue:l,onChange:c,className:d,trackClassName:f,fillClassName:p,thumbClassName:g,labelsClassName:u,"aria-label":m,"aria-labelledby":C,...x})=>{const b=h.useRef(null),I=Math.max(0,Math.min(100,(e-t)/(r-t)*100)),N=Zt(s),T=l?l(e):e.toFixed(N),S=h.useCallback(A=>{const L=b.current;if(!L)return e;const w=L.getBoundingClientRect(),M=(A-w.left)/w.width,F=t+M*(r-t),K=Zt(s),te=parseFloat((Math.round((F-t)/s)*s+t).toFixed(K));return Math.min(r,Math.max(t,te))},[t,r,s,e]),D=h.useCallback(A=>{a||(A.currentTarget.setPointerCapture(A.pointerId),c?.(S(A.clientX)))},[a,S,c]),_=h.useCallback(A=>{a||A.buttons===0||c?.(S(A.clientX))},[a,S,c]),E=h.useCallback(A=>{if(a)return;const L=Zt(s),w=K=>parseFloat((Math.round((K-t)/s)*s+t).toFixed(L)),M=K=>Math.min(r,Math.max(t,K));let F=e;switch(A.key){case"ArrowRight":case"ArrowUp":F=M(w(e+s));break;case"ArrowLeft":case"ArrowDown":F=M(w(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:y.mergeClasses("flex flex-col",a&&"pointer-events-none opacity-50",d),...x,children:[o&&n.jsx(Be.DialLabel,{...o,htmlFor:x.id}),n.jsxs("div",{ref:b,className:"relative flex h-[38px] cursor-pointer items-center",onPointerDown:D,onPointerMove:_,children:[n.jsx("div",{className:y.mergeClasses("pointer-events-none absolute inset-x-0 h-3 rounded-[10px] bg-layer-1",f)}),n.jsx("div",{className:y.mergeClasses("pointer-events-none absolute left-0 h-3 rounded-[10px] bg-controls-accent-primary",p),style:{width:`${I}%`}}),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":C,className:y.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",g),style:{left:`${I}%`},onKeyDown:E,children:T})]}),i&&n.jsx("div",{className:y.mergeClasses("dial-tiny-text flex text-secondary",u),children:i.length===3?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:i[0]}),n.jsx("span",{className:"flex-1 text-center",children:i[1]}),n.jsx("span",{children:i[2]})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:i[0]}),n.jsx("span",{className:"ml-auto",children:i[1]})]})})]})},Ys=({label:e,text:t,tooltip:r,children:s,postfix:a,className:o})=>n.jsxs("div",{className:y.mergeClasses("flex flex-col",s?"":"max-w-[200px]",o),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(O.DialTooltip,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),In=h.createContext({dragDropManager:void 0});function Ne(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 kr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Rr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Mr={INIT:"@@redux/INIT"+Rr(),REPLACE:"@@redux/REPLACE"+Rr()};function Xs(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 Qs(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(ta(e))return"date";if(ea(e))return"error";var r=Js(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 Js(e){return typeof e.constructor=="function"?e.constructor.name:null}function ea(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function ta(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function tt(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Qs(e)),t}function Sn(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"?Ne(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"?Ne(1):"Expected the enhancer to be a function. Instead, received: '"+tt(r)+"'");return r(Sn)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(2):"Expected the root reducer to be a function. Instead, received: '"+tt(e)+"'");var a=e,o=t,i=[],l=i,c=!1;function d(){l===i&&(l=i.slice())}function f(){if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(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 o}function p(C){if(typeof C!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(4):"Expected the listener to be a function. Instead, received: '"+tt(C)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(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(C),function(){if(x){if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(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 I=l.indexOf(C);l.splice(I,1),i=null}}}function g(C){if(!Xs(C))throw new Error(process.env.NODE_ENV==="production"?Ne(7):"Actions must be plain objects. Instead, the actual type was: '"+tt(C)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof C.type>"u")throw new Error(process.env.NODE_ENV==="production"?Ne(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"?Ne(9):"Reducers may not dispatch actions.");try{c=!0,o=a(o,C)}finally{c=!1}for(var x=i=l,b=0;b<x.length;b++){var I=x[b];I()}return C}function u(C){if(typeof C!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(10):"Expected the nextReducer to be a function. Instead, received: '"+tt(C));a=C,g({type:Mr.REPLACE})}function m(){var C,x=p;return C={subscribe:function(I){if(typeof I!="object"||I===null)throw new Error(process.env.NODE_ENV==="production"?Ne(11):"Expected the observer to be an object. Instead, received: '"+tt(I)+"'");function N(){I.next&&I.next(f())}N();var T=x(N);return{unsubscribe:T}}},C[kr]=function(){return this},C}return g({type:Mr.INIT}),s={dispatch:g,subscribe:p,getState:f,replaceReducer:u},s[kr]=m,s}function J(e,t,...r){if(ra()&&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 ra(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function na(e,t,r){return t.split(".").reduce((s,a)=>s&&s[a]?s[a]:r||null,e)}function sa(e,t){return e.filter(r=>r!==t)}function Dn(e){return typeof e=="object"}function aa(e,t){const r=new Map,s=o=>{r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(s),t.forEach(s);const a=[];return r.forEach((o,i)=>{o===1&&a.push(i)}),a}function oa(e,t){return e.filter(r=>t.indexOf(r)>-1)}const hr="dnd-core/INIT_COORDS",Lt="dnd-core/BEGIN_DRAG",mr="dnd-core/PUBLISH_DRAG_SOURCE",kt="dnd-core/HOVER",Rt="dnd-core/DROP",Mt="dnd-core/END_DRAG";function Pr(e,t){return{type:hr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const ia={type:hr,payload:{clientOffset:null,sourceClientOffset:null}};function la(e){return function(r=[],s={publishSource:!0}){const{publishSource:a=!0,clientOffset:o,getSourceClientOffset:i}=s,l=e.getMonitor(),c=e.getRegistry();e.dispatch(Pr(o)),ca(r,l,c);const d=fa(r,l);if(d==null){e.dispatch(ia);return}let f=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");da(i),f=i(d)}e.dispatch(Pr(o,f));const g=c.getSource(d).beginDrag(l,d);if(g==null)return;ua(g),c.pinSource(d);const u=c.getSourceType(d);return{type:Lt,payload:{itemType:u,item:g,sourceId:d,clientOffset:o||null,sourceClientOffset:f||null,isSourcePublic:!!a}}}}function ca(e,t,r){J(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(s){J(r.getSource(s),"Expected sourceIds to be registered.")})}function da(e){J(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function ua(e){J(Dn(e),"Item must be an object.")}function fa(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 pa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ga(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){pa(e,a,r[a])})}return e}function ha(e){return function(r={}){const s=e.getMonitor(),a=e.getRegistry();ma(s),Ca(s).forEach((i,l)=>{const c=xa(i,l,a,s),d={type:Rt,payload:{dropResult:ga({},r,c)}};e.dispatch(d)})}}function ma(e){J(e.isDragging(),"Cannot call drop while not dragging."),J(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function xa(e,t,r,s){const a=r.getTarget(e);let o=a?a.drop(s,e):void 0;return ba(o),typeof o>"u"&&(o=t===0?{}:s.getDropResult()),o}function ba(e){J(typeof e>"u"||Dn(e),"Drop result must either be an object or undefined.")}function Ca(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function va(e){return function(){const r=e.getMonitor(),s=e.getRegistry();ya(r);const a=r.getSourceId();return a!=null&&(s.getSource(a,!0).endDrag(r,a),s.unpinSource()),{type:Mt}}}function ya(e){J(e.isDragging(),"Cannot call endDrag while not dragging.")}function ar(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Ia(e){return function(r,{clientOffset:s}={}){Sa(r);const a=r.slice(0),o=e.getMonitor(),i=e.getRegistry(),l=o.getItemType();return Na(a,i,l),Da(a,o,i),ja(a,o,i),{type:kt,payload:{targetIds:a,clientOffset:s||null}}}}function Sa(e){J(Array.isArray(e),"Expected targetIds to be an array.")}function Da(e,t,r){J(t.isDragging(),"Cannot call hover while not dragging."),J(!t.didDrop(),"Cannot call hover after drop.");for(let s=0;s<e.length;s++){const a=e[s];J(e.lastIndexOf(a)===s,"Expected targetIds to be unique in the passed array.");const o=r.getTarget(a);J(o,"Expected targetIds to be registered.")}}function Na(e,t,r){for(let s=e.length-1;s>=0;s--){const a=e[s],o=t.getTargetType(a);ar(o,r)||e.splice(s,1)}}function ja(e,t,r){e.forEach(function(s){r.getTarget(s).hover(t,s)})}function Ta(e){return function(){if(e.getMonitor().isDragging())return{type:mr}}}function wa(e){return{beginDrag:la(e),publishDragSource:Ta(e),hover:Ia(e),drop:ha(e),endDrag:va(e)}}class Ea{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(o){return(...i)=>{const l=o.apply(t,i);typeof l<"u"&&r(l)}}const a=wa(this);return Object.keys(a).reduce((o,i)=>{const l=a[i];return o[i]=s(l),o},{})}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 Oa(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Nn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Aa(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:s}=e;return!t||!r||!s?null:Nn(Oa(t,s),r)}function _a(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Nn(t,r)}const ut=[],xr=[];ut.__IS_NONE__=!0;xr.__IS_ALL__=!0;function La(e,t){return e===ut?!1:e===xr||typeof t>"u"?!0:oa(t,e).length>0}class ka{subscribeToStateChange(t,r={}){const{handlerIds:s}=r;J(typeof t=="function","listener must be a function."),J(typeof s>"u"||Array.isArray(s),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const o=()=>{const i=this.store.getState(),l=i.stateId;try{l===a||l===a+1&&!La(i.dirtyHandlerIds,s)||t()}finally{a=l}};return this.store.subscribe(o)}subscribeToOffsetChange(t){J(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 J(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(J(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 ar(s,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(J(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),o=this.getItemType();if(o&&!ar(a,o))return!1;const i=this.getTargetIds();if(!i.length)return!1;const l=i.indexOf(t);return s?l===i.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 Aa(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return _a(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Fr=typeof global<"u"?global:self,jn=Fr.MutationObserver||Fr.WebKitMutationObserver;function Tn(e){return function(){const r=setTimeout(a,0),s=setInterval(a,50);function a(){clearTimeout(r),clearInterval(s),e()}}}function Ra(e){let t=1;const r=new jn(e),s=document.createTextNode("");return r.observe(s,{characterData:!0}),function(){t=-t,s.data=t}}const Ma=typeof jn=="function"?Ra:Tn;class Pa{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=Ma(this.flush),this.requestErrorThrow=Tn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Fa{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 Ba{create(t){const r=this.freeTasks,s=r.length?r.pop():new Fa(this.onError,a=>r[r.length]=a);return s.task=t,s}constructor(t){this.onError=t,this.freeTasks=[]}}const wn=new Pa,za=new Ba(wn.registerPendingError);function $a(e){wn.enqueueTask(za.create(e))}const br="dnd-core/ADD_SOURCE",Cr="dnd-core/ADD_TARGET",vr="dnd-core/REMOVE_SOURCE",Pt="dnd-core/REMOVE_TARGET";function Ha(e){return{type:br,payload:{sourceId:e}}}function Va(e){return{type:Cr,payload:{targetId:e}}}function Ka(e){return{type:vr,payload:{sourceId:e}}}function Ga(e){return{type:Pt,payload:{targetId:e}}}function Ua(e){J(typeof e.canDrag=="function","Expected canDrag to be a function."),J(typeof e.beginDrag=="function","Expected beginDrag to be a function."),J(typeof e.endDrag=="function","Expected endDrag to be a function.")}function Za(e){J(typeof e.canDrop=="function","Expected canDrop to be a function."),J(typeof e.hover=="function","Expected hover to be a function."),J(typeof e.drop=="function","Expected beginDrag to be a function.")}function or(e,t){if(t&&Array.isArray(e)){e.forEach(r=>or(r,!1));return}J(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 Te;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Te||(Te={}));let Wa=0;function qa(){return Wa++}function Ya(e){const t=qa().toString();switch(e){case Te.SOURCE:return`S${t}`;case Te.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Br(e){switch(e[0]){case"S":return Te.SOURCE;case"T":return Te.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function zr(e,t){const r=e.entries();let s=!1;do{const{done:a,value:[,o]}=r.next();if(o===t)return!0;s=!!a}while(!s);return!1}class Xa{addSource(t,r){or(t),Ua(r);const s=this.addHandler(Te.SOURCE,t,r);return this.store.dispatch(Ha(s)),s}addTarget(t,r){or(t,!0),Za(r);const s=this.addHandler(Te.TARGET,t,r);return this.store.dispatch(Va(s)),s}containsHandler(t){return zr(this.dragSources,t)||zr(this.dropTargets,t)}getSource(t,r=!1){return J(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return J(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return J(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return J(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Br(t)===Te.SOURCE}isTargetId(t){return Br(t)===Te.TARGET}removeSource(t){J(this.getSource(t),"Expected an existing source."),this.store.dispatch(Ka(t)),$a(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){J(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);J(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){J(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,s){const a=Ya(t);return this.types.set(a,r),t===Te.SOURCE?this.dragSources.set(a,s):t===Te.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 Qa=(e,t)=>e===t;function Ja(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function eo(e,t,r=Qa){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 to(e=ut,t){switch(t.type){case kt:break;case br:case Cr:case Pt:case vr:return ut;case Lt:case mr:case Mt:case Rt:default:return xr}const{targetIds:r=[],prevTargetIds:s=[]}=t.payload,a=aa(r,s);if(!(a.length>0||!eo(r,s)))return ut;const i=s[s.length-1],l=r[r.length-1];return i!==l&&(i&&a.push(i),l&&a.push(l)),a}function ro(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function no(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){ro(e,a,r[a])})}return e}const $r={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function so(e=$r,t){const{payload:r}=t;switch(t.type){case hr:case Lt:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case kt:return Ja(e.clientOffset,r.clientOffset)?e:no({},e,{clientOffset:r.clientOffset});case Mt:case Rt:return $r;default:return e}}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 rt(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}const oo={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function io(e=oo,t){const{payload:r}=t;switch(t.type){case Lt:return rt({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case mr:return rt({},e,{isSourcePublic:!0});case kt:return rt({},e,{targetIds:r.targetIds});case Pt:return e.targetIds.indexOf(r.targetId)===-1?e:rt({},e,{targetIds:sa(e.targetIds,r.targetId)});case Rt:return rt({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Mt:return rt({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function lo(e=0,t){switch(t.type){case br:case Cr:return e+1;case vr:case Pt:return e-1;default:return e}}function co(e=0){return e+1}function uo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fo(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){uo(e,a,r[a])})}return e}function po(e={},t){return{dirtyHandlerIds:to(e.dirtyHandlerIds,{type:t.type,payload:fo({},t.payload,{prevTargetIds:na(e,"dragOperation.targetIds",[])})}),dragOffset:so(e.dragOffset,t),refCount:lo(e.refCount,t),dragOperation:io(e.dragOperation,t),stateId:co(e.stateId)}}function go(e,t=void 0,r={},s=!1){const a=ho(s),o=new ka(a,new Xa(a)),i=new Ea(a,o),l=e(i,t,r);return i.receiveBackend(l),i}function ho(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Sn(po,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function mo(e,t){if(e==null)return{};var r=xo(e,t),s,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)s=o[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}function xo(e,t){if(e==null)return{};var r={},s=Object.keys(e),a,o;for(o=0;o<s.length;o++)a=s[o],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}let Hr=0;const Nt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var bo=h.memo(function(t){var{children:r}=t,s=mo(t,["children"]);const[a,o]=Co(s);return h.useEffect(()=>{if(o){const i=En();return++Hr,()=>{--Hr===0&&(i[Nt]=null)}}},[]),n.jsx(In.Provider,{value:a,children:r})});function Co(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=vo(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function vo(e,t=En(),r,s){const a=t;return a[Nt]||(a[Nt]={dragDropManager:go(e,t,r,s)}),a[Nt]}function En(){return typeof global<"u"?global:window}var Wt,Vr;function yo(){return Vr||(Vr=1,Wt=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,o;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(o=Object.keys(t),s=o.length,s!==Object.keys(r).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[a]))return!1;for(a=s;a--!==0;){var i=o[a];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}),Wt}var Io=yo();const So=v.getDefaultExportFromCjs(Io),Ze=typeof window<"u"?h.useLayoutEffect:h.useEffect;function Do(e,t,r){const[s,a]=h.useState(()=>t(e)),o=h.useCallback(()=>{const i=t(e);So(s,i)||(a(i),r&&r())},[s,e,r]);return Ze(o),[s,o]}function No(e,t,r){const[s,a]=Do(e,t,r);return Ze(function(){const i=e.getHandlerId();if(i!=null)return e.subscribeToStateChange(a,{handlerIds:[i]})},[e,a]),s}function On(e,t,r){return No(t,e||(()=>({})),()=>r.reconnect())}function An(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),h.useMemo(()=>typeof e=="function"?e():e,r)}function jo(e){return h.useMemo(()=>e.hooks.dragSource(),[e])}function To(e){return h.useMemo(()=>e.hooks.dragPreview(),[e])}let qt=!1,Yt=!1;class wo{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){J(!qt,"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 qt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{qt=!1}}isDragging(){if(!this.sourceId)return!1;J(!Yt,"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 Yt=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Yt=!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 Xt=!1;class Eo{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;J(!Xt,"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 Xt=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Xt=!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 Oo(e,t,r){const s=r.getRegistry(),a=s.addTarget(e,t);return[a,()=>s.removeTarget(a)]}function Ao(e,t,r){const s=r.getRegistry(),a=s.addSource(e,t);return[a,()=>s.removeSource(a)]}function ir(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 o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let c=0;c<o.length;c++){const d=o[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 lr(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function _o(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 Lo(e){return(t=null,r=null)=>{if(!h.isValidElement(t)){const o=t;return e(o,r),o}const s=t;return _o(s),ko(s,r?o=>e(o,r):e)}}function _n(e){const t={};return Object.keys(e).forEach(r=>{const s=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=Lo(s);t[r]=()=>a}}),t}function Kr(e,t){typeof e=="function"?e(t):e.current=t}function ko(e,t){const r=e.ref;return J(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?h.cloneElement(e,{ref:s=>{Kr(r,s),Kr(t,s)}}):h.cloneElement(e,{ref:t})}class Ro{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!ir(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!ir(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=_n({dragSource:(r,s)=>{this.clearDragSource(),this.dragSourceOptions=s||null,lr(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,s)=>{this.clearDragPreview(),this.dragPreviewOptions=s||null,lr(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 Mo{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!ir(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=_n({dropTarget:(r,s)=>{this.clearDropTarget(),this.dropTargetOptions=s,lr(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 ot(){const{dragDropManager:e}=h.useContext(In);return J(e!=null,"Expected drag drop context"),e}function Po(e,t){const r=ot(),s=h.useMemo(()=>new Ro(r.getBackend()),[r]);return Ze(()=>(s.dragSourceOptions=e||null,s.reconnect(),()=>s.disconnectDragSource()),[s,e]),Ze(()=>(s.dragPreviewOptions=t||null,s.reconnect(),()=>s.disconnectDragPreview()),[s,t]),s}function Fo(){const e=ot();return h.useMemo(()=>new wo(e),[e])}class Bo{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:o}=s;return o?o(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 zo(e,t,r){const s=h.useMemo(()=>new Bo(e,t,r),[t,r]);return h.useEffect(()=>{s.spec=e},[e]),s}function $o(e){return h.useMemo(()=>{const t=e.type;return J(t!=null,"spec.type must be defined"),t},[e])}function Ho(e,t,r){const s=ot(),a=zo(e,t,r),o=$o(e);Ze(function(){if(o!=null){const[l,c]=Ao(o,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c}},[s,t,r,a,o])}function Vo(e,t){const r=An(e,t);J(!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=Fo(),a=Po(r.options,r.previewOptions);return Ho(r,s,a),[On(r.collect,s,a),jo(a),To(a)]}function Ko(e){return h.useMemo(()=>e.hooks.dropTarget(),[e])}function Go(e){const t=ot(),r=h.useMemo(()=>new Mo(t.getBackend()),[t]);return Ze(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function Uo(){const e=ot();return h.useMemo(()=>new Eo(e),[e])}function Zo(e){const{accept:t}=e;return h.useMemo(()=>(J(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class Wo{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 qo(e,t){const r=h.useMemo(()=>new Wo(e,t),[t]);return h.useEffect(()=>{r.spec=e},[e]),r}function Yo(e,t,r){const s=ot(),a=qo(e,t),o=Zo(e);Ze(function(){const[l,c]=Oo(o,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c},[s,t,a,r,o.map(i=>i.toString()).join("|")])}function yr(e,t){const r=An(e,t),s=Uo(),a=Go(r.options);return Yo(r,s,a),[On(r.collect,s,a),Ko(a)]}const Gr="column",Xo="flex items-center",Qo="mr-3 cursor-move text-secondary",Jo=({id:e,children:t,className:r,onFind:s,onMove:a,ariaLabel:o="Drag item"})=>{const i=h.useRef(null),l=h.useRef(null),c=typeof s=="function"?s(e):-1,[{isDragging:d},f,p]=Vo(()=>({type:Gr,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]),[,g]=yr(()=>({accept:Gr,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(g(l)),f(i),n.jsxs("div",{ref:l,className:y.mergeClasses(Xo,r),style:{opacity:d?0:1},"aria-roledescription":"Draggable item",children:[n.jsx("div",{ref:i,className:Qo,"aria-label":o,children:n.jsx(B.IconGripVertical,{...$.BASE_ICON_PROPS})}),t]})},Ft=({iconClassName:e,label:t,...r})=>t?n.jsx(v.DialDangerButton,{...r,label:t,appearance:O.ButtonAppearance.Ghost,iconBefore:n.jsx(B.IconTrashX,{...$.BASE_ICON_PROPS,className:e||""})}):n.jsx(j.DialDangerIconButton,{...r,appearance:O.ButtonAppearance.Ghost,icon:n.jsx(B.IconTrashX,{...$.BASE_ICON_PROPS,className:e||""})}),ei=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:o=!1,labelProps:i,caption:l,id:c,...d})=>{const f=y.mergeClasses("dial-textarea dial-input px-3 py-2",d.invalid&&"dial-input-error",d.disabled&&"dial-input-disable",o?"resize":"resize-none",e);return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-y-1",a),children:[i&&n.jsx(Be.DialLabel,{...i,htmlFor:c}),n.jsx("textarea",{id:c,value:t||"",className:f,onChange:p=>r?.(p.currentTarget.value),...d}),n.jsx(v.DialErrorText,{text:s}),!s&&n.jsx(v.DialCaptionText,{text:l})]})},ti="inline-flex items-center rounded bg-layer-3",ri="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",ni="relative z-10 bg-controls-accent-primary-alpha-active text-primary",si="text-secondary hover:text-primary",ai="text-controls-disable-accent cursor-not-allowed hover:text-controls-disable-accent",oi=({options:e,value:t,onChange:r,disabled:s,className:a,ariaLabel:o})=>{const i=h.useCallback(l=>{if(s)return;const c=e.filter(g=>!g.disabled);if(c.length===0)return;const d=c.findIndex(g=>g.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":o,className:y.mergeClasses(ti,a),children:e.map((l,c)=>{const d=l.value===t,f=c===0,p=c===e.length-1,g=s||l.disabled;return n.jsxs("button",{type:"button",role:"tab","aria-selected":d,tabIndex:d?0:-1,disabled:g,onClick:()=>r(l.value),onKeyDown:i,className:y.mergeClasses(ri,!p&&"-mr-px",f&&"rounded-l",p&&"rounded-r",d?ni:si,g&&ai),children:[l.icon,l.label]},l.value)})})},Qt=8,ii=24,Ln=({initialTags:e=[],label:t,required:r,elementId:s,placeholder:a,captionDescription:o,errorText:i,invalid:l,disabled:c,collapseTagOverflow:d=!1,readOnly:f=!1,containerClassName:p,tagClassName:g,onChange:u})=>{const m=h.useRef(null),C=h.useRef([]),x=h.useRef(null),[b,I]=h.useState(e),[N,T]=h.useState(""),[S,D]=h.useState(!1),[_,E]=h.useState(e.length),A=h.useCallback(z=>H=>{C.current[z]=H},[]),L=h.useCallback(()=>{if(!d)return;const z=m.current;if(!z)return;const H=z.offsetWidth;if(H===0)return;const q=x.current?.offsetWidth??0,ae=H-(f?0:ii)-Qt;let Y=0,Z=0;for(let re=0;re<b.length;re++){const oe=C.current[re];if(!oe)continue;const le=oe.offsetWidth+Qt;if(Y+le>ae)break;Y+=le,Z++}if(Z<b.length&&Z>0)for(;Y+q>ae&&Z>0;){Z--;const re=C.current[Z]?.offsetWidth??0;Y-=re+Qt}E(Z)},[d,f,b.length]),w=z=>{const H=z.trim().replace(/,$/,"");if(H&&!b.includes(H)){const q=[H,...b];I(q),u?.(q)}},M=z=>{(z.key===","||z.key==="Enter")&&(z.preventDefault(),w(N),T(""))},F=()=>{N.trim()&&(w(N),T(""))},K=z=>{const H=b.filter((q,U)=>U!==z);I(H),u?.(H)},te=()=>i?n.jsx(v.DialErrorText,{text:i}):o?n.jsx(v.DialCaptionText,{text:o}):null;h.useEffect(()=>{if(d)return;const z=new ResizeObserver(()=>{if(m.current){const H=m.current.scrollHeight>m.current.clientHeight+10;D(H)}});return m.current&&z.observe(m.current),()=>z.disconnect()},[b,d]),h.useEffect(()=>{if(!d){E(b.length);return}E(b.length);const z=new ResizeObserver(()=>{L()}),H=m.current;return H&&z.observe(H),L(),()=>z.disconnect()},[d,L,b]),h.useEffect(()=>{I(e)},[JSON.stringify(e)]);const G=n.jsxs("div",{ref:m,className:ce("flex gap-2 items-center relative",d?"flex-nowrap overflow-hidden w-full min-w-0":ce("flex-wrap",S?"flex-col-reverse":"flex-row"),p),children:[(d?b.slice(0,_):b).map((z,H)=>n.jsx(Ue,{label:z,className:g,closable:!c&&!f,onRemove:!c&&!f?()=>K(H):void 0},z+H)),d&&_<b.length&&n.jsx(O.DialTooltip,{tooltip:b.slice(_).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:n.jsx(Ue,{label:`+${b.length-_}`})}),!f&&n.jsx("input",{id:s,type:"text",value:N,onChange:z=>T(z.target.value),onKeyDown:M,onBlur:F,className:ce("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((z,H)=>n.jsx("div",{ref:A(H),className:"inline-flex shrink-0",children:n.jsx(Ue,{label:z,className:g,closable:!c&&!f,onRemove:!c&&!f?()=>K(H):void 0})},`measure-${z}-${H}`)),n.jsx("div",{ref:x,className:"inline-flex shrink-0",children:n.jsx(Ue,{label:`+${b.length}`})})]})]});return f?G:n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsx(Be.DialLabel,{label:t,required:r,htmlFor:s}),n.jsx("div",{className:ce("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:G}),te()]})},kn=({selectedItems:e,placeholder:t,collapseTagOverflow:r=!1,listClassName:s,listElementClassName:a})=>e?.length?n.jsx(Ln,{readOnly:!0,initialTags:e,collapseTagOverflow:r,containerClassName:s,tagClassName:a}):t?n.jsx("span",{className:"text-secondary",children:t}):null,Jt=e=>Ar.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Ar.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"})),Rn=({children:e,open:t,disabled:r=!1,selectedValue:s,valueClassName:a,inputClassName:o,onOpen:i,elementId:l,errorText:c,invalid:d,emptyValueText:f,placeholder:p,editable:g=!1,onValueChange:u,collapseTagOverflow:m=!1,iconBefore:C})=>{const x=Array.isArray(s)&&s.length>0,b=typeof s=="string"&&!!s.trim(),I=x||b?s:p?void 0:f,N=r?void 0:i,T=h.useCallback(E=>{u?.(E.target.value)},[u]),S=()=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:ce("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between",o,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:[C&&n.jsx(j.DialIcon,{icon:C}),n.jsx("input",{type:"text",className:ce("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:T,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:i,"aria-label":"open-popup",children:n.jsx(j.DialIcon,{icon:n.jsx(Jt,{role:"img",width:$.BASE_ICON_SIZE,height:$.BASE_ICON_SIZE})})})]}),n.jsx(v.DialErrorText,{text:c})]}),D=()=>n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"w-full",onClick:N,"aria-label":"open-popup",id:l,children:n.jsxs("div",{className:ce("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",o,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:[C&&n.jsx(j.DialIcon,{icon:C}),n.jsx(O.DialTooltip,{tooltip:I==null?void 0:String(I),children:I||!p?n.jsx("span",{className:a,children:I}):n.jsx("span",{className:"text-secondary",children:p})})]}),!r&&n.jsx("div",{className:"shrink-0",children:n.jsx(j.DialIcon,{icon:n.jsx(Jt,{role:"img",width:$.BASE_ICON_SIZE,height:$.BASE_ICON_SIZE})})})]})}),n.jsx(v.DialErrorText,{text:c})]}),_=()=>n.jsx("div",{className:"w-full",onClick:N,children:n.jsxs("div",{className:ce("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:[C&&n.jsx(j.DialIcon,{icon:C}),n.jsx(kn,{placeholder:p,selectedItems:I,collapseTagOverflow:m})]}),!r&&n.jsx("div",{className:"ml-1",children:n.jsx(j.DialIcon,{icon:n.jsx(Jt,{role:"img",width:$.BASE_ICON_SIZE,height:$.BASE_ICON_SIZE})})})]})});return n.jsxs(n.Fragment,{children:[x?_():g?S():D(),t&&ws.createPortal(e,document.body)]})},li=({label:e,htmlFor:t,disabled:r,selectedValue:s,radioButtons:a,customInputValue:o,valueClassName:i,inputClassName:l,emptyValueText:c,placeholder:d,onClose:f,header:p,portalId:g,onApply:u,onCancel:m,cancelButtonTitle:C="Cancel",applyButtonTitle:x="Apply",isValid:b,selectedRadioValue:I,onChangeRadioField:N,id:T,size:S=v.PopupSize.Md})=>{const[D,_]=h.useState(!1),E=h.useCallback(()=>{r||_(!0)},[r]),A=h.useCallback(()=>{_(!1),f?.()},[f]),L=h.useCallback(()=>{m?.(),A()},[m,A]),w=h.useCallback(()=>{u(),A()},[u,A]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(Be.DialLabel,{label:e,htmlFor:t}),n.jsx(Rn,{disabled:r,open:D,selectedValue:o??a.find(M=>M.id===s)?.name,valueClassName:i,inputClassName:ce(l,"py-2","px-3"),emptyValueText:c,placeholder:d,onOpen:E,children:n.jsx(v.DialPopup,{open:D,onClose:L,header:p,portalId:g,size:S,footer:n.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[n.jsx(v.DialNeutralButton,{label:C,onClick:L}),n.jsx(v.DialPrimaryButton,{label:x,onClick:w,disabled:!b})]}),children:n.jsx("div",{className:"px-6 py-4",children:n.jsx(v.DialRadioGroup,{radioButtons:a,labelClassName:"dial-small-text",activeRadioButton:I,onChange:N,elementId:T,orientation:v.RadioGroupOrientation.Column})})})})]})},ci="Create",di="Cancel",ui="flex items-center justify-end gap-2 px-6 py-3",fi=({header:e,open:t=!1,submitLabel:r=ci,cancelLabel:s=di,isLoading:a=!1,disableSubmitButton:o=!1,className:i,submitClassName:l,onClose:c,onSubmit:d,onCancel:f,children:p,dividers:g=!0,size:u=v.PopupSize.Md,footer:m})=>{const C=a?null:n.jsxs("div",{className:ui,children:[n.jsx(v.DialNeutralButton,{label:s,onClick:()=>f?f():c?.()}),n.jsx(v.DialPrimaryButton,{className:l,label:r,disabled:o,onClick:()=>d()})]}),x=h.useCallback(()=>a?n.jsx("div",{className:"px-6 py-4 h-[120px]",children:n.jsx(v.DialLoader,{size:50})}):p??null,[p,a]);return n.jsx(v.DialPopup,{open:t,header:e,className:i,dividers:g,onClose:()=>c?.(),footer:m??C,size:u,children:x()})},pi=/^0+\.(\d+)?$/,gi=/^0+/,cr=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:o,...i})=>{const l=f=>!f||f==="-"?f:String(f)?.match(pi)?String(f)?.replace(gi,"0"):Number(f),c=f=>{if([".","-","+","e","E"].includes(f.key)){f.preventDefault();return}v.handleKeyDown(f,"number",r,s)},d=f=>{const p=f.clipboardData.getData("text"),g=p.replace(/\D/g,"");if(g!==p&&(f.preventDefault(),g)){const u=f.currentTarget,m=u.selectionStart??0,C=u.selectionEnd??0,x=u.value.slice(0,m)+g+u.value.slice(C);t?.(l(x))}};return n.jsx(v.DialInput,{type:"number",min:r,max:s,onChange:f=>t?.(l(f)),onKeyDown:e?c:a,onPaste:e?d:o,...i})},hi=({onClick:e})=>n.jsx(B.IconEyeOff,{...$.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),mi=({onClick:e})=>n.jsx(B.IconEye,{...$.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),Mn=({...e})=>{const[t,r]=h.useState(!1),s=h.useCallback(a=>{r(a)},[]);return n.jsx(v.DialInput,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?n.jsx(hi,{onClick:()=>s(!1)}):n.jsx(mi,{onClick:()=>s(!0)})})},Pn=({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(i=>i.value===s)?.label??s,o=e.find(i=>i.value===s)?.icon;return n.jsx(Ue,{label:a,onRemove:i=>r?.(i,s),icon:o?n.jsx(j.DialIcon,{icon:o}):null,className:"max-w-full"},s)})});var Tt=(e=>(e.Sm="sm",e.Md="md",e))(Tt||{}),wt=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(wt||{});const xi="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",bi="w-full rounded flex flex-col",ft="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",Ci="bg-accent-primary-alpha",dr="bg-accent-primary-alpha border-l border-accent-primary border-1",Et="opacity-75",vi=352,yi=4,Ii=n.jsx(B.IconChevronDown,{size:$.DIAL_ICON_SIZE.SM}),Si=({opt:e,selectedValues:t,onSelect:r})=>{const{isOpen:s,refs:a,floatingStyles:o,context:i,getReferenceProps:l,getFloatingProps:c}=j.useSubMenuFloating(yi,"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:ce(ft,d&&dr,e.disabled&&Et),...l(),children:[n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.icon&&n.jsx(j.DialIcon,{icon:e.icon}),n.jsx(j.DialEllipsisTooltip,{text:e.labelNode??e.label})]}),n.jsx(B.IconChevronRight,{size:14,className:"shrink-0"})]}),s&&n.jsx(j.SubMenuPanel,{refs:a,floatingStyles:o,context:i,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:ce(ft,p&&dr,f.disabled&&Et),onClick:()=>!f.disabled&&r(f.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f.icon&&n.jsx(j.DialIcon,{icon:f.icon}),n.jsx(j.DialEllipsisTooltip,{text:f.labelNode??f.label})]})},f.value)})})]})},_e=({options:e,multiple:t=!1,elementId:r,value:s,defaultValue:a,variant:o=wt.Primary,size:i=Tt.Md,prefix:l,customSelectedValue:c,placeholder:d="Select...",searchable:f=!1,searchSize:p=O.ElementSize.Standard,searchPlaceholder:g,selectAll:u=!1,invalid:m,selectAllLabel:C="Select all",emptyStateTitle:x="No options available",emptyStateDescription:b,emptyStateIcon:I,disabled:N=!1,className:T,listClassName:S,closable:D=!1,header:_,footer:E,onClose:A,onChange:L,inlineSearch:w=!1,dismissRef:M,onFooterClick:F,open:K,onOpenChange:te,onInlineQueryChange:G,customMultiSelectTagsRenderer:z})=>{const H=h.useId(),[q,U]=h.useState(!1),ae=K!==void 0,Y=ae?!!K:q,Z=h.useCallback(R=>{ae||U(R),te?.(R)},[ae,te]),[re,oe]=h.useState(w&&c||""),le=h.useRef(null),ue=h.useCallback(R=>{R!==re&&(oe(R||""),G?.(R||""))},[G,re]),me=s!==void 0,[Ce,ge]=h.useState(a),W=me?s:Ce,Q=h.useMemo(()=>t?Array.isArray(W)?W:[]:typeof W=="string"?[W]:[],[W,t]),we=h.useMemo(()=>{const R=re.trim().toLowerCase();return R?e.filter(ne=>ne.label.toLowerCase().includes(R)):e},[e,re]);h.useEffect(()=>{!Y&&!w&&ue("")},[w,Y,ue]);const ke=h.useRef(c);h.useEffect(()=>{w&&c!==ke.current&&(Y||(ke.current=c,ue(c||"")))},[c,w,Y,ue]);const X=h.useCallback(R=>{me||ge(R),L?.(R)},[me,L]),de=h.useCallback(R=>{if(t){const ne=new Set(Q);ne.has(R)?ne.delete(R):ne.add(R),X(Array.from(ne));return}if(X(R),w){const ne=e.find(Ie=>Ie.value===R)??e.flatMap(Ie=>Ie.children??[]).find(Ie=>Ie.value===R);ne&&ue(ne.label)}Z(!1)},[t,X,w,Z,Q,e,ue]),Ee=h.useCallback((R,ne)=>{if(R.stopPropagation(),!t){X("");return}const Ie=Q.filter(Vt=>Vt!==ne);X(Ie)},[t,Q,X]),xe=h.useMemo(()=>we.filter(R=>!R.disabled),[we]),fe=h.useMemo(()=>xe.filter(R=>Q.includes(R.value)).length,[xe,Q]),Qe=h.useCallback(R=>{w&&!t&&!R&&de(re),Z(R)},[de,w,t,re,Z]),{allSelectedInFiltered:ye,someSelectedInFiltered:ct}=h.useMemo(()=>{const R=xe.length>0&&fe===xe.length;return{allSelectedInFiltered:R,someSelectedInFiltered:fe>0&&!R}},[xe,fe]),Je=h.useCallback(()=>{if(!(!t||xe.length===0))if(ye){const R=new Set(xe.map(ne=>ne.value));X(Q.filter(ne=>!R.has(ne)))}else{const R=new Set(Q);xe.forEach(ne=>R.add(ne.value)),X(Array.from(R))}},[ye,t,xe,Q,X]),ve=Q.length>0;h.useEffect(()=>{Y&&w&&!t&&!N&&requestAnimationFrame(()=>{const R=le.current;if(!R)return;R.focus();const ne=R.value?.length??0;R.setSelectionRange?.(ne,ne)})},[Y,w,t,N]);const ze=!t&&ve?Q[0]:void 0,be=h.useMemo(()=>ze?e.find(R=>R.value===ze)??e.flatMap(R=>R.children??[]).find(R=>R.value===ze):void 0,[e,ze]),Ht=h.useCallback(()=>t?ve?z?.(e,Q,Ee)||n.jsx(Pn,{options:e,selectedValues:Q,handleRemoveTag:Ee}):n.jsx("span",{className:"text-secondary truncate",children:d}):be?n.jsxs(n.Fragment,{children:[be.icon&&n.jsx(j.DialIcon,{icon:be.icon}),n.jsx(j.DialEllipsisTooltip,{text:be.labelNode??(l?`${l} ${be.label}`:be.label)}),be?.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:be.description})]}):c&&s?c:n.jsx("span",{className:"text-secondary truncate",children:d}),[ve,t,c,l,s,d,be,e,Q,Ee,z]);h.useImperativeHandle(M,()=>({dismiss:()=>{Z(!1)}}));const et=h.useCallback(()=>{ue(Q.length===1?be?.label??re:"")},[re,Q.length,ue,be?.label]),Ge=h.useCallback(()=>{N||(Z(!Y),w&&!t&&(et(),le.current?.focus()))},[N,w,Y,t,et,Z]);return n.jsx(j.DialDropdown,{open:Y,onOpenChange:Qe,disabled:N,closable:D,onClose:A,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:f?null:vi,listClassName:S,renderOverlay:()=>n.jsxs("div",{id:`list-${r||H}`,role:"listbox","aria-multiselectable":t||void 0,className:bi,children:[_&&n.jsx(n.Fragment,{children:typeof _=="function"?_():_}),(f||D)&&e.length>8&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[f&&n.jsx(v.DialSearch,{size:p,placeholder:g,onChange:ue,value:re,id:`search-${r||H}`,containerClassName:y.mergeClasses(v.SIZE_CONFIG[p].containerClassName,"w-full")}),D&&n.jsx(v.DialButton,{"aria-label":"Close select",className:"shrink-0",iconBefore:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM}),onClick:R=>{A?.(R),Z(!1)}})]}),t&&u&&xe.length>0&&n.jsx("div",{className:ce(ft,"mt-2"),children:n.jsx(sr,{id:`${r||H}-selectAll`,label:C,checked:ye,indeterminate:ct,onChange:Je,ariaLabel:C})}),n.jsx("div",{className:ce("overflow-y-auto max-h-[352px]",w&&we.length===0?"":"py-1"),children:we.length===0?!w&&n.jsx("div",{className:"px-2 py-3",children:n.jsx(j.DialNoDataContent,{icon:I??n.jsx(B.IconClipboardX,{size:$.DIAL_ICON_SIZE.LG,stroke:.5}),title:x,description:b})}):we.map(R=>{const ne=Q.includes(R.value);return t?n.jsxs("div",{role:"option","aria-selected":ne,"aria-disabled":!!R.disabled,className:ce(ft,ne&&Ci,R.disabled&&Et,"w-full"),children:[n.jsx(sr,{id:`${r||H}-${R.value}`,label:n.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[R.icon&&n.jsx(j.DialIcon,{icon:R.icon}),n.jsx("span",{className:"truncate",children:R.labelNode??R.label})]}),checked:ne,disabled:R.disabled,onChange:()=>!R.disabled&&de(R.value),ariaLabel:R.label}),R.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:R.description})]},R.value):R.children?.length?n.jsx(Si,{opt:R,selectedValues:Q,onSelect:de},R.value):n.jsx("button",{role:"option",type:"button","aria-selected":ne,"aria-disabled":!!R.disabled,disabled:R.disabled,className:ce(ft,ne&&dr,R.disabled&&Et),onClick:()=>!R.disabled&&de(R.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[R.icon&&n.jsx(j.DialIcon,{icon:R.icon}),n.jsx(j.DialEllipsisTooltip,{text:R.labelNode??R.label}),R.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:R.description})]})},R.value)})}),E&&n.jsx("div",{onClick:R=>{F?.(R),F&&Z(!1)},children:typeof E=="function"?E():E})]}),children:n.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":Y,"aria-controls":`list-${r||H}`,className:y.mergeClasses(xi,N&&"opacity-75 !cursor-not-allowed !border-primary",i===Tt.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",m&&"dial-input-error",o===wt.Secondary?"!bg-layer-4 !h-auto":"",T),onMouseDown:R=>{N||w&&!t&&(et(),R.preventDefault())},onClick:()=>{Ge()},onKeyDown:R=>{(R.key===" "||R.code==="Space")&&(R.preventDefault(),Ge())},children:[w&&!t?n.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:n.jsx("input",{id:`inline-${r||H}`,type:"text",placeholder:g??d,value:re||"",onChange:R=>ue(R.currentTarget.value.trimStart()),onFocus:()=>!N&&Z(!0),onMouseDown:R=>{et(),R.stopPropagation()},onClick:R=>{R.stopPropagation()},onKeyDown:R=>{R.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref:le,disabled:N,"aria-disabled":N,autoComplete:"off"})}):n.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:Ht()}),!w&&n.jsx(j.DialIcon,{icon:Ii,className:ce("text-primary",Y&&"rotate-180")})]})})},Di=({label:e,required:t,captionDescription:r,containerClassName:s,selectClassName:a,error:o,id:i,caption:l,readonly:c,value:d,defaultEmptyText:f,...p})=>{const g=h.useCallback(()=>{if(!d||Array.isArray(d)&&d.length===0)return f??"None";if(Array.isArray(d))return n.jsx(Pn,{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(v.DialFormItem,{id:i,label:e,required:t,description:l,error:o,captionDescription:r,className:s,readonly:c,value:g(),defaultEmptyText:f,children:n.jsx(_e,{className:a,value:d,elementId:i,invalid:!!o,...p})})};function Fn(e){let t=null;return()=>(t==null&&(t=e()),t)}function Ni(e,t){return e.filter(r=>r!==t)}function ji(e,t){const r=new Set,s=o=>r.add(o);e.forEach(s),t.forEach(s);const a=[];return r.forEach(o=>a.push(o)),a}class Ti{enter(t){const r=this.entered.length,s=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=ji(this.entered.filter(s),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Ni(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class wi{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 Bt="__NATIVE_FILE__",Bn="__NATIVE_URL__",zn="__NATIVE_TEXT__",$n="__NATIVE_HTML__",Ur=Object.freeze(Object.defineProperty({__proto__:null,FILE:Bt,HTML:$n,TEXT:zn,URL:Bn},Symbol.toStringTag,{value:"Module"}));function er(e,t,r){const s=t.reduce((a,o)=>a||e.getData(o),"");return s??r}const ur={[Bt]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[$n]:{exposeProperties:{html:(e,t)=>er(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Bn]:{exposeProperties:{urls:(e,t)=>er(e,t,"").split(`
2
- `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[zn]:{exposeProperties:{text:(e,t)=>er(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Ei(e,t){const r=ur[e];if(!r)throw new Error(`native type ${e} has no configuration`);const s=new wi(r);return s.loadDataTransfer(t),s}function tr(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(ur).filter(r=>{const s=ur[r];return s?.matchesTypes?s.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const Oi=Fn(()=>/firefox/i.test(navigator.userAgent)),Hn=Fn(()=>!!window.safari);class Zr{interpolate(t){const{xs:r,ys:s,c1s:a,c2s:o,c3s:i}=this;let l=r.length-1;if(t===r[l])return s[l];let c=0,d=i.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],g=p*p;return s[l]+a[l]*p+o[l]*g+i[l]*p*g}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 o=[],i=[];let l,c;for(let u=0;u<s-1;u++)l=t[u+1]-t[u],c=r[u+1]-r[u],o.push(l),i.push(c/l);const d=[i[0]];for(let u=0;u<o.length-1;u++){const m=i[u],C=i[u+1];if(m*C<=0)d.push(0);else{l=o[u];const x=o[u+1],b=l+x;d.push(3*b/((b+x)/m+(b+l)/C))}}d.push(i[i.length-1]);const f=[],p=[];let g;for(let u=0;u<d.length-1;u++){g=i[u];const m=d[u],C=1/o[u],x=m+d[u+1]-g-g;f.push((g-m-x)*C),p.push(x*C*C)}this.xs=t,this.ys=r,this.c1s=d,this.c2s=f,this.c3s=p}}const Ai=1;function Vn(e){const t=e.nodeType===Ai?e:e.parentElement;if(!t)return null;const{top:r,left:s}=t.getBoundingClientRect();return{x:s,y:r}}function vt(e){return{x:e.clientX,y:e.clientY}}function _i(e){var t;return e.nodeName==="IMG"&&(Oi()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Li(e,t,r,s){let a=e?t.width:r,o=e?t.height:s;return Hn()&&e&&(o/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:o}}function ki(e,t,r,s,a){const o=_i(t),l=Vn(o?e:t),c={x:r.x-l.x,y:r.y-l.y},{offsetWidth:d,offsetHeight:f}=e,{anchorX:p,anchorY:g}=s,{dragPreviewWidth:u,dragPreviewHeight:m}=Li(o,t,d,f),C=()=>{let D=new Zr([0,.5,1],[c.y,c.y/f*m,c.y+m-f]).interpolate(g);return Hn()&&o&&(D+=(window.devicePixelRatio-1)*m),D},x=()=>new Zr([0,.5,1],[c.x,c.x/d*u,c.x+u-d]).interpolate(p),{offsetX:b,offsetY:I}=a,N=b===0||b,T=I===0||I;return{x:N?b:x(),y:T?I:C()}}class Ri{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 Mi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wr(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){Mi(e,a,r[a])})}return e}class Pi{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=i=>this.handleDragStart(i,t),o=i=>this.handleSelectStart(i);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",a),r.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",a),r.removeEventListener("selectstart",o),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const s=i=>this.handleDragEnter(i,t),a=i=>this.handleDragOver(i,t),o=i=>this.handleDrop(i,t);return r.addEventListener("dragenter",s),r.addEventListener("dragover",a),r.addEventListener("drop",o),()=>{r.removeEventListener("dragenter",s),r.removeEventListener("dragover",a),r.removeEventListener("drop",o)}}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 Wr({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 Wr({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Ur).some(r=>Ur[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=Ei(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 o=this.sourceNodes.get(a);return o&&Vn(o)||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:o}=this;this.dragStartSourceIds=null;const i=vt(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:i});const{dataTransfer:l}=a,c=tr(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const f=this.monitor.getSourceId(),p=this.sourceNodes.get(f),g=this.sourcePreviewNodes.get(f)||p;if(g){const{anchorX:u,anchorY:m,offsetX:C,offsetY:x}=this.getCurrentSourcePreviewNodeOptions(),N=ki(p,g,i,{anchorX:u,anchorY:m},{offsetX:C,offsetY:x});l.setDragImage(g,N.x,N.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 o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}if(!this.enterLeaveCounter.enter(a.target)||this.monitor.isDragging())return;const{dataTransfer:l}=a,c=tr(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=a=>{const{dragEnterTargetIds:o}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=a.altKey,o.length>0&&this.actions.hover(o,{clientOffset:vt(a)}),o.some(l=>this.monitor.canDropOnTarget(l))&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=a=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}},this.handleTopDragOver=a=>{const{dragOverTargetIds:o}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}this.altKeyPressed=a.altKey,this.lastClientOffset=vt(a),this.scheduleHover(o),(o||[]).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 o;a.preventDefault(),(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}else tr(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:o}=this;this.dropTargetIds=[],this.actions.hover(o,{clientOffset:vt(a)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=a=>{const o=a.target;typeof o.dragDrop=="function"&&(o.tagName==="INPUT"||o.tagName==="SELECT"||o.tagName==="TEXTAREA"||o.isContentEditable||(a.preventDefault(),o.dragDrop()))},this.options=new Ri(r,s),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Ti(this.isNodeInDocument)}}const Fi=function(t,r,s){return new Pi(t,r,s)},Bi=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:s,acceptTypes:a,maxFilesCount:o,multiple:i,fileFormatError:l,fileCountError:c,fileSizeError:d,getIsFileFormatError:f,getIsFileSizeError:p})=>{const g=h.useRef(null),u=h.useRef(null),[m,C]=h.useState([]),[x,b]=h.useState(!1),[I,N]=h.useState(!1),T=h.useCallback(G=>{const z=G.target.files;if(z&&z.length>0){const H=Array.from(z),q=f?.(H),U=p?.(H);q?b(!0):U?N(!0):e(H)}},[f,p,e]),S=h.useCallback(G=>o&&G?.length>o,[o]),D=h.useMemo(()=>x||I||S(m),[x,I,S,m]),_=()=>{C([]),b(!1),N(!1)},E=h.useMemo(()=>x?n.jsx(v.DialErrorText,{text:l}):I?n.jsx(v.DialErrorText,{text:d}):S(m)?n.jsx(v.DialErrorText,{text:c}):null,[c,l,d,m,S,x,I]);h.useEffect(()=>{_()},[a]);const[{isOver:A,canDrop:L},w]=yr(()=>({accept:[Bt],drop(G){const z=G.files,H=f?.(z)??!1,q=p?.(z)??!1,U=S?.(z)??!1;if(b(H),N(q),H||q||U){C(z);return}e(z),_()},collect:G=>({isOver:G.isOver(),canDrop:G.canDrop()})}),[e,f,p,S]),M=G=>{(G.key==="Enter"||G.key==="Space")&&(G.preventDefault(),u.current?.click())},F=G=>{G?.preventDefault();const z=Array.from(G.dataTransfer?.items??[]);b(!!f?.(z)),N(!!p?.(z)),C(z)},K=G=>{G.target===G.currentTarget&&_()},te=ce("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!L&&!D&&"border-primary",L&&(A?"border-accent-primary":"border-hover"),D&&"border-error");return w(g),n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:te,ref:g,onDragOver:F,onDragLeave:K,children:[n.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:M,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(v.DialPrimaryButton,{appearance:O.ButtonAppearance.Ghost,label:s,onClick:()=>u.current?.click()})]}),n.jsx("input",{multiple:i,id:"file",type:"file",ref:u,hidden:!0,accept:a,onChange:T})]}),n.jsx(n.Fragment,{children:E})]})},zi=({iconBefore:e,className:t,...r})=>{const s=r.invalid,a=()=>n.jsx("div",{className:"mr-2",children:s?n.jsx(B.IconExclamationCircle,{...$.BASE_ICON_PROPS,className:"text-error"}):e});return n.jsx(v.DialInput,{...r,iconBefore:a(),containerClassName:ce("h-[40px] p-0",s&&"h-[60px]"),className:ce("rounded-r-none border-r-0",s&&"text-error",t)})},$i=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:s,getIsFileSizeError:a,maxFilesCount:o,fileFormatError:i,fileSizeError:l,fileCountError:c})=>{const d=h.useRef(null),[f,p]=h.useState(!1),[g,u]=h.useState(!1),[m,C]=h.useState(0),x=h.useCallback(()=>{p(!1),u(!1),C(0)},[]),b=h.useCallback(A=>!!(o&&t.length+A.length>o),[o,t.length]),I=f||g,[{isOver:N,canDrop:T},S]=yr(()=>({accept:[Bt],drop(A){const L=A.files,w=[...t,...L],M=s?.(L)??!1,F=a?.(L)??!1,K=b?.(L)??!1;if(p(M),u(F),M||F||K){C(L.length);return}r(w),x()},collect:A=>({isOver:A.isOver(),canDrop:A.canDrop()})}),[t,r,s,a,b,x]),D=A=>{A.preventDefault();const L=Array.from(A.dataTransfer?.items??[]);p(!!s?.(L)),u(!1),C(L.length)},_=A=>{A.target===A.currentTarget&&x()};S(d);const E=b(Array.from({length:m}));return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsx("div",{ref:d,onDragOver:D,onDragLeave:_,className:ce("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!I&&!E&&(T&&N?"border-accent-primary":"border-primary"),(I||E)&&"border-error"),children:e}),f&&n.jsx(v.DialErrorText,{text:i}),g&&n.jsx(v.DialErrorText,{text:l}),!f&&!g&&E&&n.jsx(v.DialErrorText,{text:c})]})},Kn=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:s,onChange:a,isInvalid:o,errorText:i,removeButtonAriaLabel:l,getIsMultiFilesSizeError:c,multiFilesSizeError:d,getIsFileFormatError:f,getIsFileSizeError:p,maxFilesCount:g}=e,u=h.useCallback((x,b)=>{x.stopPropagation(),a(t?.filter(I=>I.name!==b)||[])},[a,t]),m=h.useCallback(x=>n.jsx(Ft,{"aria-label":l,onClick:b=>u(b,x)}),[l,u]),C=h.useMemo(()=>n.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((x,b)=>n.jsx(zi,{id:x.name,value:x.name,iconAfter:m(x.name),iconBefore:r||s?.(x.name),invalid:o?.(x),error:o?.(x)?i:""},x.name+b))}),[t,r,s,o,i,m]);return n.jsx(bo,{backend:Fi,children:!t||t.length===0?n.jsx(Bi,{...e,onChange:a}):n.jsxs(n.Fragment,{children:[n.jsx($i,{existingFiles:t,onDrop:a,getIsFileFormatError:f,getIsFileSizeError:p,maxFilesCount:g,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:C}),c?.(t)&&n.jsx(v.DialErrorText,{text:d})]})})},Hi=({onChange:e,fieldTitle:t,elementId:r,files:s,maxFilesCount:a,maxFileSize:o,maxMultiFilesSize:i,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:f,multiple:p=!0,acceptTypes:g,deleteAllButtonLabel:u,addButtonLabel:m,additionalActionButtons:C,...x})=>{const b=h.useRef(null),I=()=>b.current?.click(),N=()=>{e([])},T=h.useCallback(E=>E?.some(A=>!(g==="/"||g?.toLowerCase()?.includes(A?.type?.toLowerCase()))),[g]),S=h.useCallback(E=>{if(!o)return!1;const A=o*(1024*1024);return E?.some(L=>{const w=L.size;return!!w&&w>A})},[o]),D=h.useCallback(E=>{if(!i||!p)return!1;const A=i*1024*1024;return E.reduce((w,M)=>w+M.size,0)>A},[i,p]),_=h.useCallback(E=>{const A=E.target.files;if(A&&A.length>0){const L=Array.from(A),w=T(L),M=S(L);!w&&!M&&e([...s||[],...L])}},[T,S,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(Be.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(v.DialNeutralButton,{label:u,iconBefore:n.jsx(B.IconTrashX,{...$.BASE_ICON_PROPS}),onClick:N}),(a?a>s?.length:!0)&&n.jsx(v.DialPrimaryButton,{appearance:O.ButtonAppearance.Ghost,iconBefore:n.jsx(B.IconPlus,{...$.BASE_ICON_PROPS}),label:m,onClick:I}),C]})]}),s&&s.length>0&&n.jsx("input",{id:"file",type:"file",multiple:p,ref:b,hidden:!0,accept:g,onChange:_}),n.jsx(Kn,{files:s,onChange:e,acceptTypes:g,maxFilesCount:a,multiple:p,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:f,getIsFileFormatError:T,getIsFileSizeError:S,getIsMultiFilesSizeError:D,...x})]})},Vi=({icon:e,ariaLabel:t,size:r=O.ElementSize.Standard,disabled:s=!1,className:a,buttonClassName:o,iconClassName:i,caretIcon:l=n.jsx(B.IconChevronDown,{size:$.DIAL_ICON_SIZE.SM}),showCaret:c=!0,placement:d="bottom-start",matchReferenceWidth:f=!1,open:p,onOpenChange:g,defaultOpen:u=!1,...m})=>{const C=r===O.ElementSize.Small,[x,b]=h.useState(u),I=p??x,N=C?"w-8 px-0":"w-10 px-0",T={[O.ElementSize.Small]:"size-5",[O.ElementSize.Standard]:"size-6",[O.ElementSize.Large]:"size-7"},S=D=>{b(D),g?.(D)};return n.jsx(j.DialDropdown,{...m,disabled:s,placement:d,matchReferenceWidth:f,className:a,open:I,onOpenChange:S,defaultOpen:u,children:n.jsxs("button",{type:"button","aria-label":t,disabled:s,className:y.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",C?"h-8 px-2":"h-10 px-2",c?void 0:N,o),children:[n.jsx(j.DialIcon,{icon:e,className:y.mergeClasses("flex items-center justify-center text-inherit",T[r],c&&"-mr-2",i,j.DIAL_KIT_CLASS.dropdownIcon)}),c&&n.jsxs("div",{className:y.mergeClasses("relative z-10 inline-grid size-5 shrink-0 place-items-center",j.DIAL_KIT_CLASS.dropdownIconCaret),children:[n.jsx("div",{className:"absolute inset-0 rounded-full bg-layer-2"}),n.jsx(j.DialIcon,{icon:l,className:y.mergeClasses("relative flex items-center justify-center text-secondary transition-transform group-hover:text-primary group-disabled:text-controls-secondary-disable",I&&"rotate-180")})]})]})})},Ki="application/octet-stream";function Gi(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=rr(s,!0),o=e.filter(c=>c!==r).map(c=>{const d=c.path||c.url||"",f=Ui(c.nodeType),p=f===v.DialFileNodeType.FOLDER,g=rr(d,p);let u;return c.parentPath===null||c.parentPath===void 0?u=a:c.parentPath===""?u="":u=rr(c.parentPath,!0),{...c,originalPath:d,path:g,parentPath:u,nodeType:f}}),i=new Map;o.forEach(c=>{const d={...c,id:c.originalPath,name:c.name,path:c.path,parentPath:c.parentPath,nodeType:c.nodeType,resourceType:Zi(c.resourceType),folderId:t,updatedAt:c.updatedAt?new Date(c.updatedAt).toISOString():new Date().toISOString(),items:c.nodeType===v.DialFileNodeType.FOLDER?[]:void 0};c.nodeType===v.DialFileNodeType.ITEM&&(d.extension=Wi(c.name),d.contentType=c.contentType||Ki,d.contentLength=c.contentLength||0),i.set(c.path,d)});const l=[];return i.forEach(c=>{if(c.parentPath===a)l.push(c);else{const d=c.path.lastIndexOf(c.name||""),f=c.path.slice(0,d),p=i.get(f);p&&p.nodeType===v.DialFileNodeType.FOLDER?(p.items=p.items||[],p.items.push(c)):l.push(c)}}),l}function rr(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 Ui(e){return e.toUpperCase()==="FOLDER"?v.DialFileNodeType.FOLDER:v.DialFileNodeType.ITEM}function Zi(e){if(!e)return;const t=e.toUpperCase();return Object.values(v.DialFileResourceType).find(s=>s.toUpperCase()===t)}function Wi(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function qi(e,t="Prompts",r="prompts/public/",s="root"){const a=Gi(e,s);return[{id:s,name:t,path:r,parentPath:"",nodeType:v.DialFileNodeType.FOLDER,folderId:s,items:a}]}const Gn=({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(o=>o.type==="timeZoneName")?.value;return a?`(${a}) ${s}`:s}catch{return s}};var st=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(st||{}),ht=(e=>(e.Select="select",e.Radio="radio",e))(ht||{}),zt=(e=>(e.Row="row",e.Column="column",e))(zt||{}),V=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))(V||{});const Yi={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"},Un=h.createContext(null);function Le(){const e=h.useContext(Un);if(!e)throw new Error("useSchemaContext must be used inside DialSchemaRenderer");return e}function qr(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 se(e,t,r=0){if(r>10)return e;let s=e;if(s.$ref){const a=s.$ref.replace(/^#\//,"").split("/");let o=t;for(const f of a)o=o?.[f];if(!o||typeof o!="object")return e;const{$ref:i,...l}=s,c=o;s={...c.$ref?se(c,t,r+1):c,...l}}if(s.allOf&&s.allOf.length>0){const{allOf:a,...o}=s;let i={};for(const l of a)i=qr(i,se(l,t,r+1));s=qr(i,o)}return s}function Zn(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 $t(e){return e==null||e===""}function Ye(e){return e.type===V.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function Ot(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}const Ir=e=>`"${e}" is required`;function Wn(e,t){return e.type===V.Null?"null":e.$ref?se(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 Pe(e,t,r=0){if(r>15)return;const s=se(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 o=se({$ref:s.discriminator.mapping[a]},t);return{...Pe(o,t,r+1)??{},[s.discriminator.propertyName]:a}}}if(Ye(s)){if(s.properties){const a={};let o=!1;for(const[i,l]of Object.entries(s.properties)){const c=Pe(l,t,r+1);c!==void 0&&(a[i]=c,o=!0)}return o?a:void 0}if(s.additionalProperties!=null&&s.additionalProperties!==!1)return{}}}function Me(e,t,r,s="",a=0){if(a>15)return[];const o=[],i=se(t,r);if(i.anyOf){const d=i.anyOf.filter(f=>f.type!==V.Null);return e!=null&&d.length===1?Me(e,d[0],r,s,a+1):o}if(i.oneOf&&i.discriminator){const d=i.discriminator.propertyName,f=e?.[d];if(f&&i.discriminator.mapping[f]){const p={$ref:i.discriminator.mapping[f]},g=se(p,r);return Me(e,g,r,s,a+1)}return o}if(i.type===V.Array||!i.type&&Array.isArray(e)){if(Array.isArray(e)&&i.items)for(let d=0;d<e.length;d++){const f=Me(e[d],i.items,r,`${s}[${d}]`,a+1);o.push(...f)}return o}if(!Ye(i))return o;const l=i.required??[],c=e;for(const d of l){const f=i.properties?.[d];if(f&&se(f,r).isHidden)continue;const p=s?`${s}.${d}`:d,g=c?.[d];if($t(g)){const u=f?.title??Ot(d);o.push({path:p,message:Ir(u)})}}if(c&&i.properties)for(const[d,f]of Object.entries(i.properties)){if(se(f,r).isHidden)continue;const p=s?`${s}.${d}`:d,g=c[d];if(g!=null){const u=Me(g,f,r,p,a+1);o.push(...u)}}if(c&&i.additionalProperties!=null&&i.additionalProperties!==!1&&typeof i.additionalProperties=="object"){const d=i.additionalProperties;for(const[f,p]of Object.entries(c)){const g=s?`${s}.${f}`:f,u=Me(p,d,r,g,a+1);o.push(...u)}}return o}function Sr(e,t,r){const s=se(t,r);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(Ye(s)&&s.properties){const a=Object.entries(s.properties).filter(([,c])=>!se(c,r).isHidden),o=a.length,i=e;return`${a.filter(([c])=>{const d=i?.[c];return d!=null&&d!==""}).length}/${o} fields`}return""}function Xi(e,t,r){if(e==null){const s=t.findIndex(a=>a.type===V.Null);return s>=0?s:0}if(Array.isArray(e)){const s=t.findIndex(a=>se(a,r).type===V.Array);return s>=0?s:0}if(typeof e=="boolean"){const s=t.findIndex(a=>se(a,r).type===V.Boolean);return s>=0?s:0}if(typeof e=="number"){const s=t.findIndex(a=>{const o=se(a,r);return o.type===V.Number||o.type===V.Integer});return s>=0?s:0}if(typeof e=="string"){const s=t.findIndex(a=>se(a,r).type===V.String);return s>=0?s:0}if(typeof e=="object"){const s=e;for(let a=0;a<t.length;a++){const o=se(t[a],r);if(o.discriminator&&o.discriminator.propertyName in s)return a}for(let a=0;a<t.length;a++){const o=se(t[a],r);if(Ye(o)||o.oneOf)return a}return 0}return 0}function Qi(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 qn(e){switch(Array.isArray(e.type)?e.type[0]:e.type){case V.String:return"";case V.Boolean:return!1;case V.Array:return[];case V.Integer:case V.Number:return;default:return{}}}const Ji=[V.String,V.Number,V.Boolean,V.Null,V.Object,V.Array];function el(e){return Array.isArray(e)?V.Array:typeof e=="object"&&e!==null?V.Object:typeof e=="boolean"?V.Boolean:typeof e=="number"?V.Number:e===null?V.Null:V.String}const tl={[V.String]:"",[V.Number]:0,[V.Boolean]:!1,[V.Null]:null,[V.Object]:{},[V.Array]:[]};function rl(e){return tl[e]}const mt=({title:e,description:t,summary:r,errorCount:s=0,level:a=0,children:o,onRemove:i,defaultExpanded:l=!0,removeItemAriaLabel:c="Remove item"})=>{const[d,f]=h.useState(l),p=a===0,g="rounded border border-secondary",u=y.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=y.mergeClasses("border-t border-secondary",p?"p-4":"p-3");return n.jsxs("div",{className:g,children:[n.jsxs("div",{className:u,onClick:()=>f(C=>!C),role:"button","aria-expanded":d,children:[n.jsx("span",{className:"shrink-0 text-secondary",children:d?n.jsx(B.IconChevronDown,{size:16,stroke:2}):n.jsx(B.IconChevronRight,{size:16,stroke:2})}),n.jsx("span",{className:y.mergeClasses("flex-1 truncate",p?"dial-small-semi-text text-primary":"dial-small-text text-primary"),children:e}),t&&n.jsx(Be.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(j.DialIcon,{icon:n.jsx(B.IconAlertTriangle,{size:13,stroke:2})}),s," error",s>1?"s":""]}):n.jsx(j.DialIcon,{icon:n.jsx(B.IconCheck,{size:13,stroke:2}),className:"text-success shrink-0"}),i&&n.jsx(Ft,{size:O.ElementSize.Small,onClick:C=>{C.stopPropagation(),i()},"aria-label":c,className:"ml-1 shrink-0 p-0.5"})]}),d&&n.jsx("div",{className:m,children:o})]})},Yn=({schema:e,value:t,onChange:r,path:s,level:a=0,required:o,label:i})=>{const{rootSchema:l,defaultExpanded:c=!0,touchedPaths:d=new Set,skipUntouched:f=!1}=Le(),p=se(e,l),g=Ye(p),u=p.type===V.Array;if(g||u){const x=Sr(t,p,l),b=Me(t,p,l,s.join(".")),I=s.join("."),N=I+".",T=!f||d.has(I)||[...d].some(S=>S.startsWith(N));return n.jsx(mt,{title:i??p.title??s[s.length-1]??"Section",description:p.description,level:a,summary:x,errorCount:T?b.length:0,defaultExpanded:c,children:n.jsx(Fe,{schema:p,value:t,onChange:r,path:s,level:a+1,required:o})})}const C=(!f||d.has(s.join(".")))&&o&&$t(t)?Ir(i??"Field"):void 0;return n.jsx(v.DialFormItem,{label:i,required:o,description:p.description,error:C,children:n.jsx(Fe,{schema:p,value:t,onChange:r,path:s,level:a,required:o,suppressInlineError:!0})})},jt=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:o,texts:i}=Le(),l=se(e,o),c=Zn(Object.entries(l.properties??{}).filter(([,p])=>!se(p,o).isHidden)),d=l.required??[],f=t??{};return c.length===0?n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:i.noConfigurableProperties}):n.jsx("div",{className:"flex flex-col gap-4",children:c.map(([p,g])=>{const m=se(g,o).title??g.title??Ot(p),C=d.includes(p);return n.jsx(Yn,{schema:g,value:f[p],onChange:x=>r({...f,[p]:x}),path:[...s,p],level:a,required:C,label:m},p)})})},nl=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,defaultExpanded:c=!0}=Le(),d=Array.isArray(t)?t:[],f=e.items,[p,g]=h.useState(void 0);if(!f)return n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:i.noItemSchema});const u=h.useMemo(()=>se(f,o),[f,o]),m=h.useMemo(()=>u.discriminator,[u]),C=h.useMemo(()=>m?.propertyName,[m]),x=h.useMemo(()=>m?Object.keys(m.mapping).map(T=>({value:T,label:T})):[],[m]),b=()=>{const T=p??x[0]?.value;let S;if(m&&T){const D=se({$ref:m.mapping[T]},o);S={...Pe(D,o)??{},[m.propertyName]:T}}else S=Pe(u,o)??qn(u);r([...d,S])},I=T=>{r(d.filter((S,D)=>D!==T))},N=(T,S)=>{r(d.map((D,_)=>_===T?S:D))};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:i.noItemsYet}),d.map((T,S)=>{const D=Qi(T,C,S),_=Sr(T,u,o),E=Me(T,u,o,`${s.join(".")}[${S}]`);return n.jsx(mt,{title:D,level:a,summary:_,errorCount:E.length,onRemove:l?void 0:()=>I(S),defaultExpanded:c,removeItemAriaLabel:i.removeItemAriaLabel,children:n.jsx(Fe,{schema:f,value:T,onChange:A=>N(S,A),path:[...s,String(S)],level:a+1})},S)}),!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(_e,{options:x,value:p??x[0]?.value,placeholder:i.selectTypeToAdd,onChange:T=>{const S=typeof T=="string"?T:T[0];g(S)}})}),n.jsx(v.DialGhostButton,{label:i.addItem,iconBefore:n.jsx(B.IconPlus,{size:16,stroke:2}),onClick:b})]})]})},sl=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1}=Le(),c=h.useId(),d=e.discriminator;if(d){const x=d.propertyName,b=d.mapping,I=Object.keys(b).map(D=>({value:D,label:D})),N=typeof t=="object"&&t!==null?t[x]:void 0,T=N?se({$ref:b[N]},o):void 0,S=D=>{const _=se({$ref:b[D]},o),E=Pe(_,o)??{};r({...E,[x]:D})};if(e.discriminatorDisplay===ht.Radio){const D=e.discriminatorOrientation===zt.Row,_=N?(()=>{const E=se({$ref:b[N]},o),{[x]:A,...L}=E.properties??{};return{...E,properties:L}})():void 0;return D?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(E=>{const A=se({$ref:b[E]},o);return n.jsx(j.DialRadioButton,{name:c,value:E,inputId:`${c}-${E}`,label:A.title??E,checked:N===E,disabled:l,onChange:()=>S(E)},E)})}),_&&n.jsx(jt,{schema:_,value:t,onChange:r,path:s,level:a})]}):n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:Object.keys(b).map(E=>{const A=se({$ref:b[E]},o),L=N===E,{[x]:w,...M}=A.properties??{},F={...A,properties:M};return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(j.DialRadioButton,{name:c,value:E,inputId:`${c}-${E}`,label:A.title??E,checked:L,disabled:l,onChange:()=>S(E)}),L&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(jt,{schema:F,value:t,onChange:r,path:s,level:a})})]},E)})})}return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(_e,{options:I,value:N,placeholder:i.selectTypePlaceholder,disabled:l,onChange:D=>{const _=typeof D=="string"?D:D[0];_&&S(_)}})}),T&&n.jsx("div",{className:"pl-3",children:n.jsx(jt,{schema:T,value:t,onChange:r,path:s,level:a})})]})}const f=e.oneOf??[],g=(()=>{if(t==null)return 0;if(typeof t=="object"&&!Array.isArray(t)){for(let x=0;x<f.length;x++)if(se(f[x],o).required?.every(I=>I in t))return x}return 0})(),u=x=>{const b=se(f[x],o),I=Pe(b,o);r(I??null)},m=f[g];if(e.discriminatorDisplay===ht.Radio)return n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:f.map((x,b)=>{const I=se(x,o),N=Wn(x,o)??`Option ${b+1}`,T=g===b;return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(j.DialRadioButton,{name:c,value:String(b),inputId:`${c}-${b}`,label:N,checked:T,disabled:l,onChange:()=>u(b)}),T&&I&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(Fe,{schema:I,value:t,onChange:r,path:s,level:a})})]},b)})});const C=f.map((x,b)=>{const I=se(x,o);return{value:String(b),label:I.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(_e,{options:C,value:String(g),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(Fe,{schema:m,value:t,onChange:r,path:s,level:a})})]})},al=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:o,readonly:i=!1}=Le(),l=e.anyOf??[],c=l.map((m,C)=>({value:String(C),label:Wn(m,o)})),d=Xi(t,l,o),f=l[d],g=se(f,o).type===V.Null,u=m=>{const C=se(l[m],o);if(C.type===V.Null){r(null);return}const x=Pe(C,o);if(x!==void 0){r(x);return}switch(C.type){case V.Array:r([]);break;case V.String:r("");break;case V.Boolean:r(!1);break;case V.Integer:case V.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(_e,{options:c,value:String(d),disabled:i,onChange:m=>{const C=typeof m=="string"?m:m[0];u(Number(C))}})}),!g&&f&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Fe,{schema:f,value:t,onChange:r,path:s,level:a})})]})},Xn=({schema:e,value:t,onChange:r,invalid:s})=>{const a=h.useId(),{texts:o,readonly:i=!1,inputClassName:l,acceptableResourceTypes:c}=Le(),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===V.String||e.type===void 0)){const g=(e.acceptableResourceTypes??[]).flatMap(u=>{const m=c?.[u];return Array.isArray(m)?m.map(C=>{const x=String(C);return{value:x,label:x}}):[]});return n.jsx(_e,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:i,onChange:u=>r(typeof u=="string"?u:u[0]),placeholder:o.enumSelectPlaceholder,className:l})}if(d)return n.jsx(v.DialInput,{value:String(e.const??""),disabled:!0,onChange:void 0,className:"opacity-60"});if(f&&e.enumDisplay===ht.Radio){const g=e.enumOrientation===zt.Row;return n.jsx("div",{role:"radiogroup",className:g?"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(j.DialRadioButton,{name:a,value:m,inputId:`${a}-${m}`,label:m,checked:t!=null?String(t)===m:!1,disabled:i,onChange:C=>r(C)},m)})})}if(f){const g=e.enum.map(u=>({value:String(u),label:String(u)}));return n.jsx(_e,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:i,onChange:u=>r(typeof u=="string"?u:u[0]),placeholder:o.enumSelectPlaceholder})}switch(e.type){case V.Boolean:return n.jsx(Be.DialSwitch,{switchId:a,isOn:!!t,disabled:i,onChange:g=>r(g)});case V.Integer:return n.jsx(cr,{integer:!0,value:t!=null?String(t):"",invalid:s,disabled:i,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:o.integerInputPlaceholder,containerClassName:l});case V.Number:return n.jsx(cr,{value:t!=null?String(t):"",invalid:s,disabled:i,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:o.numberInputPlaceholder,containerClassName:l});default:return e.isProtected?n.jsx(Mn,{value:t!=null?String(t):"",invalid:s,disabled:i,onChange:g=>r(g??void 0),placeholder:o.stringInputPlaceholder,containerClassName:l}):n.jsx(v.DialInput,{value:t!=null?String(t):"",invalid:s,disabled:i,onChange:g=>r(g??void 0),placeholder:o.stringInputPlaceholder,containerClassName:l})}},Dr=({value:e,onChange:t,theme:r=bt.EditorThemes.dark,height:s=240})=>{const{readonly:a,texts:o}=Le(),[i,l]=h.useState(null),[c,d]=h.useState(()=>JSON.stringify(e,null,2));h.useEffect(()=>{typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-BDe6elKO.cjs")).then(g=>{l(()=>g.DialJsonEditor)})},[]);let f=!1;try{JSON.parse(c)}catch{f=!0}const p=g=>{const u=g??"";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:i&&n.jsx(i,{value:c,currentTheme:r,onChange:p,options:{readOnly:a}})}),n.jsx(v.DialErrorText,{text:f?o.invalidJsonError:void 0})]})},Yr=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),Qn=e=>!!(e.oneOf||e.anyOf||e.type===V.Array||Ye(e)),ol={[V.String]:"entryTypeString",[V.Number]:"entryTypeNumber",[V.Boolean]:"entryTypeBoolean",[V.Null]:"entryTypeNull",[V.Object]:"entryTypeObject",[V.Array]:"entryTypeArray"},il=({pairId:e,pairKey:t,pairValue:r,valueSchema:s,isUnschematizedValue:a,jsonEditorTheme:o,onKeyChange:i,onValueChange:l,onRemove:c,keyInputPlaceholder:d,removeFieldAriaLabel:f,path:p,level:g,readonly:u=!1,inputClassName:m})=>{const{rootSchema:C,texts:x,defaultExpanded:b=!0,touchedPaths:I=new Set,markTouched:N=()=>{},skipUntouched:T=!1}=Le(),[S,D]=h.useState(t),_=Qn(s),[E,A]=h.useState(()=>el(r)),L=a&&(E===V.Object||E===V.Array),w=a&&E===V.Null,M=_||L,F=[...p,e,"key"].join("."),te=(!T||I.has(F))&&t==="",G=h.useCallback(oe=>{l(rl(oe)),A(oe)},[l]),z=h.useMemo(()=>Ji.map(oe=>({value:oe,label:x[ol[oe]]})),[x]),H=h.useMemo(()=>[{value:"true",label:x.booleanTrueOption},{value:"false",label:x.booleanFalseOption}],[x]),q=`${e}-key-error`,U=a&&E===V.Boolean,ae=n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsxs("div",{className:M?"flex-1 min-w-0":"w-2/5 min-w-0",children:[n.jsx(v.DialInput,{value:S,disabled:u,invalid:te,"aria-describedby":te?q:void 0,onChange:oe=>D(oe??""),onBlur:()=>{N(F),S!==t&&i(S)},placeholder:d,containerClassName:m}),n.jsx(v.DialErrorText,{id:q,text:te?`${x.keyColumnHeader} is required`:void 0})]}),!_&&!L&&n.jsx("div",{className:"flex-1 min-w-0",children:w?n.jsx(v.DialInput,{value:"null",disabled:!0,onChange:void 0,className:"opacity-60"}):U?n.jsx(_e,{options:H,value:r?"true":"false",disabled:u,onChange:oe=>{const le=typeof oe=="string"?oe:oe[0];le&&l(le==="true")}}):n.jsx(Xn,{schema:a?{type:E}:s,value:r,onChange:l})}),a&&n.jsx("div",{className:"w-28 shrink-0",children:n.jsx(O.DialTooltip,{tooltip:x.entryTypeChangeWarning,triggerClassName:"block",children:n.jsx(_e,{options:z,value:E,disabled:u,onChange:oe=>{const le=typeof oe=="string"?oe:oe[0];le&&G(le)}})})}),!u&&n.jsx(Ft,{size:O.ElementSize.Small,onClick:c,"aria-label":f,className:"shrink-0 p-1"})]});if(!M)return ae;if(L)return n.jsxs("div",{className:"flex flex-col gap-2",children:[ae,n.jsx(Dr,{value:r,onChange:l,theme:o},E)]});const Y=[...p,t],Z=Sr(r,s,C),re=Me(r,s,C,Y.join("."));return n.jsxs("div",{className:"flex flex-col gap-2",children:[ae,n.jsx(mt,{title:t,level:g,summary:Z,errorCount:re.length+(te?1:0),defaultExpanded:b,children:n.jsx(Fe,{schema:s,value:r,onChange:l,path:Y,level:g+1})})]})},ll=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,inputClassName:c,jsonEditorTheme:d}=Le(),f=e.additionalProperties===!0||e.additionalProperties==null,p=f?{type:"string"}:typeof e.additionalProperties=="object"?se(e.additionalProperties,o):{type:"string"},g=Qn(p),[u,m]=h.useState(()=>Object.entries(t??{}).map(([S,D])=>Yr(S,D))),C=S=>Object.fromEntries(S.filter(D=>D.key!=="").map(D=>[D.key,D.value])),x=(S,D)=>{const _=u.map((E,A)=>A===S?{...E,key:D}:E);m(_),r(C(_))},b=(S,D)=>{const _=u.map((E,A)=>A===S?{...E,value:D}:E);m(_),r(C(_))},I=()=>g?Pe(p,o)??qn(p):"",N=()=>{m(S=>[...S,Yr("",I())])},T=S=>{const D=u.filter((_,E)=>E!==S);m(D),r(C(D))};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:i.noFieldsYet}),u.length>0&&!g&&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:i.keyColumnHeader}),n.jsx("span",{className:"flex-1 dial-tiny-text text-secondary font-medium",children:i.valueColumnHeader}),f&&n.jsx("span",{className:"w-28 shrink-0 dial-tiny-text text-secondary font-medium",children:i.typeColumnHeader})]}),u.map((S,D)=>n.jsx(il,{pairId:S.id,pairKey:S.key,pairValue:S.value,valueSchema:p,isUnschematizedValue:f,jsonEditorTheme:d,onKeyChange:_=>x(D,_),onValueChange:_=>b(D,_),onRemove:()=>T(D),keyInputPlaceholder:i.keyInputPlaceholder,removeFieldAriaLabel:i.removeFieldAriaLabel,path:s,level:a,readonly:l,inputClassName:c},S.id)),!l&&n.jsx("div",{className:"pt-1",children:n.jsx(v.DialGhostButton,{label:i.addField,iconBefore:n.jsx(B.IconPlus,{size:16,stroke:2}),onClick:N})})]})},Fe=({schema:e,value:t,onChange:r,path:s,level:a,required:o,suppressInlineError:i=!1})=>{const{rootSchema:l,renderField:c,markTouched:d=()=>{},touchedPaths:f=new Set,skipUntouched:p=!1,jsonEditorTheme:g}=Le(),u=se(e,l),m=b=>{d(s.join(".")),r(b)},C=!p||f.has(s.join("."));let x;if(u.oneOf)x=n.jsx(sl,{schema:u,value:t,onChange:m,path:s,level:a});else if(u.anyOf&&u.type!==V.Object)x=n.jsx(al,{schema:u,value:t,onChange:m,path:s,level:a});else if(Ye(u)){const b=u.additionalProperties!=null&&u.additionalProperties!==!1,I=!u.properties||Object.keys(u.properties).length===0;b&&I?x=n.jsx(ll,{schema:u,value:t,onChange:m,path:s,level:a}):I&&u.additionalProperties!==!1?x=n.jsx(Dr,{value:t,onChange:m,theme:g}):x=n.jsx(jt,{schema:u,value:t,onChange:m,path:s,level:a})}else if(u.type===V.Array)x=n.jsx(nl,{schema:u,value:t,onChange:m,path:s,level:a});else{const b=C&&o&&$t(t),I=!i&&b?Ir(u.title??"Field"):void 0;x=n.jsxs(n.Fragment,{children:[n.jsx(Xn,{schema:u,value:t,onChange:m,invalid:b}),n.jsx(v.DialErrorText,{text:I})]})}return c?c(s,u,x):x},cl=({schema:e,defaultValue:t,texts:r,className:s,readonly:a=!1,defaultExpanded:o=!0,inputClassName:i,variant:l=st.Sections,onChange:c,onPropertyChange:d,onDefaultValues:f,renderField:p,skipUntouched:g=!1,jsonEditorTheme:u,acceptableResourceTypes:m})=>{const C=h.useMemo(()=>({...Yi,...r}),[r]),x=h.useMemo(()=>t||(Pe(e,e)??{}),[]),[b,I]=h.useState(x),[N,T]=h.useState(new Set),S=h.useCallback(w=>{T(M=>M.has(w)?M:new Set([...M,w]))},[]);h.useEffect(()=>{f?.(x)},[]);const D=(w,M)=>{const F={...b,[w]:M};I(F),c?.(F),d?.(w,M)},_=new Set(Object.keys(e.properties??{})),E=Object.keys(b).filter(w=>!_.has(w)),A=Zn(Object.entries(e.properties??{}).filter(([,w])=>!se(w,e).isHidden)),L=e.required??[];return n.jsx(Un.Provider,{value:{rootSchema:e,texts:C,readonly:a,defaultExpanded:o,inputClassName:i,jsonEditorTheme:u,acceptableResourceTypes:m,renderField:p,touchedPaths:N,markTouched:S,skipUntouched:g},children:n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-4",s),children:[A.map(([w,M])=>{const F=se(M,e),K=F.title??M.title??Ot(w),te=L.includes(w),G=b[w];if(l===st.Flat)return n.jsx(Yn,{schema:M,value:G,onChange:U=>D(w,U),path:[w],level:0,required:te,label:K},w);if(l===st.FlatSections)return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:K}),n.jsx(Fe,{schema:M,value:G,onChange:U=>D(w,U),path:[w],level:0,required:te})]},w);const z=Me(G,F,e,w),H=w+".",q=!g||N.has(w)||[...N].some(U=>U.startsWith(H));return n.jsx(mt,{title:K,description:F.description,level:0,defaultExpanded:o,errorCount:q?te&&$t(G)?Math.max(z.length,1):z.length:0,children:n.jsx(Fe,{schema:M,value:G,onChange:U=>D(w,U),path:[w],level:1,required:te})},w)}),E.map(w=>{const M=Ot(w),F=n.jsx(Dr,{value:b[w],onChange:K=>D(w,K),theme:u});return l===st.Sections?n.jsx(mt,{title:M,level:0,defaultExpanded:o,children:F},w):n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:M}),F]},w)})]})})},dl=e=>({info:n.jsx(B.IconInfoCircleFilled,{size:e.size}),error:n.jsx(B.IconAlertCircleFilled,{size:e.size}),warning:n.jsx(B.IconAlertTriangleFilled,{size:e.size}),success:n.jsx(B.IconCircleCheckFilled,{size:e.size}),loading:n.jsx(v.Spinner,{size:e.size}),general:n.jsx(B.IconCheck,{size:e.size,stroke:e.stroke})}),ul={[v.NotificationVariant.Info]:"bg-info text-info",[v.NotificationVariant.Success]:"bg-success text-success",[v.NotificationVariant.Warning]:"bg-warning text-warning",[v.NotificationVariant.Error]:"bg-error text-error",[v.NotificationVariant.Loading]:"bg-layer-raised text-info",[v.NotificationVariant.General]:"bg-layer-sunken text-primary"},fl={[v.NotificationVariant.Info]:"status",[v.NotificationVariant.Success]:"status",[v.NotificationVariant.Warning]:"alert",[v.NotificationVariant.Error]:"alert",[v.NotificationVariant.Loading]:"status",[v.NotificationVariant.General]:"status"},pl="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",Nr=({variant:e=v.NotificationVariant.Info,type:t=v.NotificationType.Toast,title:r,message:s,action:a,className:o,iconSize:i=24,iconStroke:l=2,closable:c=!1,onClose:d,children:f,textClassName:p,...g})=>{const u=h.useMemo(()=>dl({size:i,stroke:l})[e],[e,i,l]),m=p??(t===v.NotificationType.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return n.jsxs("div",{role:fl[e],...g,className:y.mergeClasses(pl,ul[e],t===v.NotificationType.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===v.NotificationType.SectionMessage&&e===v.NotificationVariant.Loading&&"border-secondary",o,j.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(j.DialIcon,{icon:u})}),r?n.jsxs("div",{className:y.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:C=>d?.(C)})]})},Xr={2:"line-clamp-2",3:"line-clamp-3",4:"line-clamp-4",5:"line-clamp-5",6:"line-clamp-6"},gl=e=>e===1?"!truncate !whitespace-nowrap":`${Xr[e]??Xr[2]} !whitespace-normal`,Jn=({text:e,query:t,markClassName:r,className:s,maxLines:a=2})=>{const o=y.mergeClasses(gl(a),s,j.DIAL_KIT_CLASS.highlight);if(!t.trim())return n.jsx(k.EllipsisTooltip,{className:o,text:e});const i=e.toLowerCase().indexOf(t.toLowerCase()),l=i===-1?e:n.jsxs(n.Fragment,{children:[e.slice(0,i),n.jsx("mark",{className:y.mergeClasses("text-accent bg-control-accent-alpha-hover",r),children:e.slice(i,i+t.length)}),e.slice(i+t.length)]});return n.jsx(k.EllipsisTooltip,{className:o,text:l})},hl=({className:e,children:t,...r})=>n.jsx("article",{...r,className:y.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,j.DIAL_KIT_CLASS.cardShell),children:t}),it=(e,t)=>({type:s,...a})=>n.jsx(Nr,{...a,variant:e,type:s||t}),lt=(e,t)=>({variant:s,...a})=>n.jsx(Nr,{...a,variant:s||t,type:e}),ml=it(v.NotificationVariant.Error,v.NotificationType.Toast),xl=it(v.NotificationVariant.Info,v.NotificationType.Toast),bl=it(v.NotificationVariant.Success,v.NotificationType.Toast),Cl=it(v.NotificationVariant.Warning,v.NotificationType.Toast),vl=it(v.NotificationVariant.Loading,v.NotificationType.Toast),yl=it(v.NotificationVariant.General,v.NotificationType.Toast),Il=lt(v.NotificationType.SectionMessage,v.NotificationVariant.Error),Sl=lt(v.NotificationType.SectionMessage,v.NotificationVariant.Info),Dl=lt(v.NotificationType.SectionMessage,v.NotificationVariant.Success),Nl=lt(v.NotificationType.SectionMessage,v.NotificationVariant.Warning),jl=lt(v.NotificationType.SectionMessage,v.NotificationVariant.Loading),Tl=lt(v.NotificationType.SectionMessage,v.NotificationVariant.General);var Se=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(Se||{});const wl="en-GB",El={[Se.Date]:"Select date",[Se.DateTime]:"Select date and time",[Se.Time]:"--:--",[Se.Weekday]:"Select day"},es="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",ts="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",rs="!border-error",Ol="z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",Al="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",_l="bg-control-accent text-control-permanent",Ll="text-accent dial-small-semi-text",kl="text-control-disable-primary",ns="text-secondary",Rl=n.jsx(B.IconCalendar,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:ns}),Qr={prev:n.jsx(B.IconChevronLeft,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:n.jsx(B.IconChevronRight,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},Ml=(e,t)=>{const s=(new Date(e,t,1).getDay()+6)%7,a=new Date(e,t,1-s);return Array.from({length:42},(o,i)=>{const l=new Date(a);return l.setDate(a.getDate()+i),l})},Jr=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),en=(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},Pl=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),tn=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),Fl=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),yt=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,rn=(e,t)=>{const[r,s]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,s||0,0,0),a},Bl=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),zl=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}`},ss=5,as=e=>e.charAt(0).toUpperCase()+e.slice(1),$l=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,ss+r));return as(s.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),Hl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,ss+r));return{value:String(r+1),label:as(s.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),nn=({id:e,disabled:t,invalid:r,trigger:s,panelClassName:a,fieldClassName:o,panel:i,labelledBy:l,panelLabel:c})=>{const d=j.useThemeScope(),[f,p]=h.useState(!1),{refs:g,floatingStyles:u,context:m}=ee.useFloating({open:f,onOpenChange:T=>p(t?!1:T),placement:"bottom-start",whileElementsMounted:ee.autoUpdate,middleware:[ee.offset(8),ee.flip({padding:8}),ee.shift({padding:8})]}),C=ee.useClick(m,{enabled:!t}),x=ee.useDismiss(m),b=ee.useRole(m,{role:"dialog"}),{getReferenceProps:I,getFloatingProps:N}=ee.useInteractions([C,x,b]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{id:e,ref:g.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":f,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:y.mergeClasses(es,"focus-visible:outline focus-visible:outline-focus",r&&rs,t&&ts,o),...I(),children:s}),f&&n.jsx(ee.FloatingPortal,{children:n.jsx(ee.FloatingFocusManager,{context:m,modal:!1,initialFocus:-1,returnFocus:!0,children:n.jsx("div",{ref:g.setFloating,style:u,"aria-label":c,className:y.mergeClasses(Ol,d,a),...N(),children:i(()=>p(!1))})})})]})},sn=({id:e,value:t,onChange:r,onBlur:s,disabled:a,invalid:o,className:i,ariaLabel:l,placeholder:c="--:--",timezoneLabel:d})=>{const[f,p]=h.useState(t);h.useEffect(()=>{p(t)},[t]);const g=n.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":l,placeholder:c,disabled:a,value:f,onChange:u=>{const m=zl(u.target.value);p(m),Bl(m)&&r(m)},onBlur:s,className:y.mergeClasses(es,o&&rs,a&&ts,i)});return d?n.jsxs("div",{className:"relative w-full",children:[g,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})]}):g},Vl=({mode:e=Se.Date,value:t,onChange:r,onBlur:s,labelProps:a,placeholder:o,disabled:i=!1,invalid:l=!1,id:c,className:d,minDate:f,maxDate:p,locale:g=wl,fieldClassName:u,showTimezone:m=!1})=>{const C=o??El[e],x=t instanceof Date?t:null,b=h.useId(),I=c??b,N=a?.id??`${I}-label`,T=!!a?.label,S=typeof a?.label=="string"?a.label:void 0,D=T?`${N} ${I}`:void 0,_=a?n.jsx(k.Label,{...a,id:N,htmlFor:I}):null,[E,A]=h.useState(()=>x??new Date),L=h.useMemo(()=>new Date,[]),w=h.useMemo(()=>m?Gn({locale:g}):null,[m,g]),M=h.useMemo(()=>$l(g),[g]),F=h.useMemo(()=>Hl(g),[g]),K=h.useMemo(()=>Ml(E.getFullYear(),E.getMonth()),[E]),te=q=>{A(U=>new Date(U.getFullYear(),U.getMonth()+q,1))},G=(q,U)=>{if(en(q,f,p))return;const ae=e===Se.DateTime&&x?rn(q,yt(x)):q;r?.(ae),e===Se.Date&&U()},z=q=>{r?.(rn(x??new Date,q))},H=()=>x?e===Se.DateTime?`${tn(x,g)}, ${yt(x)}`:tn(x,g):C;if(e===Se.Time){const q=typeof t=="string"?t:x?yt(x):"";return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-y-3",d,j.DIAL_KIT_CLASS.calendar),children:[_,n.jsx(sn,{id:I,value:q,onChange:U=>r?.(U),onBlur:s,disabled:i,invalid:l,placeholder:C,className:u,timezoneLabel:w})]})}if(e===Se.Weekday){const q=typeof t=="string"?t:void 0,U=F.find(ae=>ae.value===q);return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-y-3",d,j.DIAL_KIT_CLASS.calendar),children:[_,n.jsx(nn,{id:I,disabled:i,invalid:l,labelledBy:D,panelLabel:S??C,fieldClassName:u,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:y.mergeClasses("truncate",!U&&"text-secondary"),children:U?.label??C}),n.jsx(B.IconChevronDown,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:ns})]}),panel:ae=>n.jsx("div",{role:"listbox","aria-label":S??C,className:"flex flex-col gap-0.5",children:F.map(Y=>n.jsx("button",{type:"button",role:"option","aria-selected":Y.value===q,className:y.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",Y.value===q&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(Y.value),ae()},children:Y.label},Y.value))})})]})}return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-y-3",d,j.DIAL_KIT_CLASS.calendar),children:[_,n.jsx(nn,{id:I,disabled:i,invalid:l,labelledBy:D,panelLabel:S??C,fieldClassName:u,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:y.mergeClasses("truncate",!x&&"text-secondary"),children:H()}),Rl]}),panel:q=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(k.StaticIconButton,{"aria-label":"Previous month",icon:Qr.prev,size:O.ElementSize.Small,onClick:()=>te(-1)}),n.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:Pl(E,g)}),n.jsx(k.StaticIconButton,{"aria-label":"Next month",icon:Qr.next,size:O.ElementSize.Small,onClick:()=>te(1)})]}),n.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[M.map(U=>n.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:U},U)),K.map(U=>{const ae=U.getMonth()!==E.getMonth(),Y=Jr(U,x),Z=Jr(U,L),re=en(U,f,p);return n.jsx("button",{type:"button",disabled:re,"aria-label":Fl(U,g),"aria-pressed":Y,"aria-current":Z?"date":void 0,className:y.mergeClasses(Al,ae&&kl,Z&&!Y&&Ll,Y&&_l,re&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>G(U,q),children:U.getDate()},U.toISOString())})]}),e===Se.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(sn,{ariaLabel:"Time",value:x?yt(x):"",onChange:z,onBlur:s,className:"w-[120px] px-3 py-1.5"})]})]})})]})},Kl=({segments:e,labelClassName:t="dial-small-text",leafClassName:r="dial-small-semi-text",className:s,ariaLabel:a="Folder path"})=>{const o=n.jsx(j.DialIcon,{icon:n.jsx(B.IconFolder,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),className:"text-secondary"}),i=e.map((l,c)=>({label:c===e.length-1?n.jsx("span",{className:r,children:l}):l,disabled:!0,...c===0?{iconBefore:o}:{}}));return n.jsx(v.DialBreadcrumb,{className:y.mergeClasses(s,j.DIAL_KIT_CLASS.folderPath),ariaLabel:a,separator:n.jsx(j.DialIcon,{icon:n.jsx(B.IconChevronRight,{size:14,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),className:"text-secondary"}),pathItems:i,labelClassName:y.mergeClasses(t,"text-secondary","!cursor-default")})};var We=(e=>(e.Small="small",e.Heading="heading",e))(We||{});const Gl="w-full overflow-hidden",Ul="flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap",an="flex min-w-0 items-center gap-2",on={[We.Small]:"dial-small-text",[We.Heading]:"dial-h2-text"},Zl={[We.Small]:"dial-small-semi-text",[We.Heading]:"dial-h2-text"},Wl={first:"shrink-0",middle:"min-w-0 max-w-[30%] shrink",last:"min-w-0 max-w-[51%] shrink"},ql="flex min-w-0 flex-1 items-center gap-1 rounded-sm transition-colors",Yl="text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",Xl="cursor-default text-primary",Ql="cursor-default text-secondary",ln="inline-flex flex-none items-center leading-none text-secondary",Jl="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",ec=3,tc=4,rc=n.jsx(B.IconChevronRight,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),nc=({items:e,maxVisibleItems:t=tc,size:r=We.Small,separator:s=rc,ariaLabel:a="Breadcrumb",overflowAriaLabel:o="Show hidden path segments",className:i,itemClassName:l})=>{const c=Math.max(t,ec),d=h.useMemo(()=>e.length>c?e.slice(1,-(c-2)):[],[e,c]),f=h.useMemo(()=>d.map((m,C)=>({key:String(C),label:m.label,icon:m.icon})),[d]),p=h.useCallback(({key:m,domEvent:C})=>{const x=d[Number(m)];x&&(x.onClick?.(C),!x.onClick&&x.href&&!C.defaultPrevented&&(window.location.href=x.href))},[d]);if(e.length===0)return null;const g=e.slice(d.length+1),u=(m,{index:C,isFirst:x,isCurrent:b})=>{const I=!b&&(!!m.href||!!m.onClick),N=y.mergeClasses(ql,I?Yl:b?y.mergeClasses(Xl,Zl[r]):Ql,l,j.DIAL_KIT_CLASS.breadcrumbsItem),T=n.jsxs(n.Fragment,{children:[m.icon,n.jsx(k.EllipsisTooltip,{text:m.label})]});return n.jsxs("li",{className:y.mergeClasses(an,on[r],Wl[b?"last":x?"first":"middle"]),children:[I?m.href?n.jsx("a",{href:m.href,onClick:m.onClick,className:N,children:T}):n.jsx("button",{type:"button",onClick:m.onClick,className:N,children:T}):n.jsx("span",{className:N,"aria-current":b?"page":void 0,children:T}),!b&&n.jsx("span",{className:ln,"aria-hidden":"true",children:s})]},`segment-${C}`)};return n.jsx("nav",{"aria-label":a,className:y.mergeClasses(Gl,i,j.DIAL_KIT_CLASS.breadcrumbs),children:n.jsxs("ol",{className:Ul,children:[u(e[0],{index:0,isFirst:!0,isCurrent:e.length===1}),d.length>0&&n.jsxs("li",{className:y.mergeClasses(an,on[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":o,className:Jl,children:n.jsx(B.IconDots,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})}),n.jsx("span",{className:ln,"aria-hidden":"true",children:s})]}),g.map((m,C)=>u(m,{index:e.length-g.length+C,isFirst:!1,isCurrent:C===g.length-1}))]})})},Xe=({label:e,variant:t,appearance:r=O.ButtonAppearance.Solid,size:s=O.ElementSize.Standard,className:a,textClassName:o,iconAfter:i,iconBefore:l,type:c="button",tooltipProps:d,href:f,target:p,rel:g,disabled:u,...m})=>{const C=y.mergeClasses("dial-kit-base-button",t&&k.getButtonClassNames(t,r),s===O.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",s===O.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",s===O.ElementSize.Small&&"dial-kit-base-button-small",r!==O.ButtonAppearance.Link&&(s===O.ElementSize.Small?"px-2":"px-4"),s!==O.ElementSize.Small&&r!==O.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),x=e?void 0:d?.tooltip,b=O.resolveAccessibleName(typeof e=="string"?e:void 0,m["aria-label"],x),I=n.jsxs(n.Fragment,{children:[n.jsx(j.DialIcon,{icon:l}),e&&n.jsx("span",{className:o,children:e}),n.jsx(j.DialIcon,{icon:i})]}),N=m,T=f!==void 0?n.jsx("a",{...N,href:u?void 0:f,target:p,rel:g??(p==="_blank"?"noopener noreferrer":void 0),"aria-disabled":u||void 0,tabIndex:u?-1:N.tabIndex,onClick:u?void 0:N.onClick,className:C,"aria-label":b,children:I}):n.jsx("button",{...m,...k.getDisabledButtonProps(u,d,m.onClick),type:c,className:C,"aria-label":b,children:I});return d?n.jsx(k.Tooltip,{asChild:!0,...d,children:T}):T},jr=(e,t)=>({appearance:s,...a})=>n.jsx(Xe,{...a,variant:e,appearance:s||t}),Tr=(e,t)=>({variant:s,...a})=>n.jsx(Xe,{...a,variant:s||t,appearance:e}),os=jr(O.ButtonVariant.Primary,O.ButtonAppearance.Solid),wr=jr(O.ButtonVariant.Neutral,O.ButtonAppearance.Solid),sc=jr(O.ButtonVariant.Danger,O.ButtonAppearance.Solid),nt={x1:"-5.06",y1:"2.26",x2:"30.62",y2:"22.63",from:"var(--stroke-gradient-1, #5976E9)",to:"var(--stroke-gradient-2, #885DF2)"},ac=({appearance:e=O.ButtonAppearance.Outlined,iconBefore:t,iconAfter:r,style:s,...a})=>{const o=`dial-kit-starter-gradient-${h.useId().replace(/[^\w-]/g,"")}`,i=n.jsx("svg",{className:"pointer-events-none absolute size-0 overflow-hidden","aria-hidden":"true",focusable:"false",children:n.jsx("defs",{children:n.jsxs("linearGradient",{id:o,x1:nt.x1,y1:nt.y1,x2:nt.x2,y2:nt.y2,gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:nt.from}),n.jsx("stop",{offset:"1",stopColor:nt.to})]})})}),l=c=>n.jsxs(n.Fragment,{children:[i,c]});return n.jsx(Xe,{...a,variant:O.ButtonVariant.Starter,appearance:e,iconBefore:t?l(t):void 0,iconAfter:r&&!t?l(r):r,style:{"--dial-kit-starter-icon-stroke":`url(#${o})`,...s}})},oc=Tr(O.ButtonAppearance.Link,O.ButtonVariant.Primary),ic=Tr(O.ButtonAppearance.Ghost,O.ButtonVariant.Primary),lc=Tr(O.ButtonAppearance.Outlined,O.ButtonVariant.Neutral),cc=({className:e,icon:t,tooltipProps:r,type:s="button",...a})=>{const o=y.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),i=n.jsx("button",{...a,type:s,className:o,"aria-label":O.resolveAccessibleName(a["aria-label"],r?.tooltip),children:t||n.jsx(B.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return r?n.jsx(O.DialTooltip,{...r,children:i}):i},dc=e=>n.jsx(B.IconChevronDown,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:y.mergeClasses("transition-transform",e&&"rotate-180")}),uc=({variant:e,appearance:t,items:r,dropdownProps:s,...a})=>{const[o,i]=h.useState(!1),l=h.useMemo(()=>dc(o),[o]);return n.jsx("div",{className:j.DIAL_KIT_CLASS.buttonDropdown,children:n.jsx(k.Dropdown,{...s,items:r,onOpenChange:c=>i(c),children:n.jsx(Xe,{...a,iconAfter:l,variant:e||O.ButtonVariant.Primary,appearance:t||O.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":o})})})},is=({label:e,size:t,isOpen:r=!1,labelClassName:s,className:a,"aria-label":o,...i})=>{const l=t===O.ElementSize.Small?"h-[32px]":"h-[40px] dial-kit-enhanced-target";return n.jsxs("button",{type:"button",...i,"aria-haspopup":"menu","aria-expanded":r,"aria-label":o?`${o} ${e}`:void 0,className:y.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",l,a,j.DIAL_KIT_CLASS.inlineSelect),children:[n.jsx("span",{className:s,children:e}),n.jsx(B.IconChevronDown,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:y.mergeClasses("transition-transform",r&&"rotate-180")})]})},fc=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:s,size:a,disabled:o,placement:i="bottom-end",matchReferenceWidth:l=!1,listClassName:c,listStyle:d,ariaLabel:f,triggerClassName:p,triggerLabelClassName:g,open:u,onOpenChange:m})=>{const[C,x]=h.useState(!1),b=u!==void 0,I=b?u:C,N=h.useCallback(L=>{b||x(L),m?.(L)},[b,m]),[T,S]=h.useState(r??e[0]?.key),D=t!==void 0,_=D?t:T,E=h.useMemo(()=>{const L=e.find(w=>w.key===_);return L?.label?String(L.label):""},[e,_]),A=h.useCallback(({key:L})=>{const w=e.find(M=>M.key===L);w&&(D||S(L),s?.(w))},[e,D,s]);return n.jsx(k.Dropdown,{items:e,placement:i,matchReferenceWidth:l,listClassName:c,listStyle:d,disabled:o,open:b?u:void 0,onOpenChange:N,onItemClick:A,children:n.jsx(is,{label:E,size:a,isOpen:I,disabled:o,"aria-label":f,className:p,labelClassName:g})})},Ve=({text:e,className:t,variant:r=v.CaptionType.Description,...s})=>e?n.jsx("span",{...s,role:"alert",className:y.mergeClasses("dial-tiny-text",r===v.CaptionType.Error?"text-error":"text-secondary",t,j.DIAL_KIT_CLASS.captionText,r===v.CaptionType.Error&&j.DIAL_KIT_CLASS.errorText),children:e}):null,Ke=({...e})=>n.jsx(Ve,{...e,variant:v.CaptionType.Error}),pc="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",gc={[O.ElementSize.Small]:"size-[24px]",[O.ElementSize.Standard]:"size-[40px]",[O.ElementSize.Large]:"size-[48px]"},hc=({icon:e,onClick:t,disabled:r,size:s=O.ElementSize.Standard,className:a})=>n.jsx("div",{className:y.mergeClasses("border-l border-tertiary",gc[s]),children:n.jsx(k.IconButton,{className:y.mergeClasses(pc,s===O.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:s})}),mc=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],ls=(e,t,r,s)=>{if((t==="number"||r!==void 0||s!==void 0)&&!mc.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 o=e.currentTarget.value,i=e.currentTarget.selectionStart,l=e.currentTarget.selectionEnd??i,c=o.slice(0,i)+e.key+o.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}}}}},cs={[O.ElementSize.Small]:{field:"dial-kit-input-small gap-x-1",paddingStart:"pl-2",paddingEnd:"pr-2",stackGap:"gap-1",postfixText:"dial-tiny-text"},[O.ElementSize.Standard]:{field:"gap-x-2 py-2",paddingStart:"pl-3",paddingEnd:"pr-3",stackGap:"gap-2",postfixText:"dial-small-text"},[O.ElementSize.Large]:{field:"gap-x-2 py-3",paddingStart:"pl-4",paddingEnd:"pr-4",stackGap:"gap-2",postfixText:"dial-body-text"}},$e=({labelProps:e,error:t,caption:r,id:s,containerClassName:a,size:o=O.ElementSize.Standard,...i})=>n.jsxs("div",{className:y.mergeClasses("flex flex-col",cs[o].stackGap,a),children:[e&&n.jsx(k.Label,{...e,htmlFor:s}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(ds,{id:s,size:o,...i}),n.jsx(Ke,{text:t}),!t&&n.jsx(Ve,{text:r})]})]}),ds=({invalid:e,disabled:t,prefix:r,className:s,postfix:a,children:o,iconBefore:i,iconAfter:l,wrapperClassName:c,type:d,inputRef:f,value:p,tooltipText:g,min:u,onChange:m,max:C,inputButtonProps:x,wrapperRef:b,size:I=O.ElementSize.Standard,...N})=>{const T=cs[I],S=h.useRef(null),D=ee.useMergeRefs([f,S]),_=d==="number"||u!==void 0||C!==void 0;h.useEffect(()=>{const w=S.current;if(!w||!_||t)return;const M=F=>{F.preventDefault()};return w.addEventListener("wheel",M,{passive:!1}),()=>{w.removeEventListener("wheel",M)}},[t,_,d]);const E=w=>{ls(w,d,u,C)},A=w=>{const M=w.currentTarget.value;if(_&&M!==""){const F=parseFloat(M);if(isNaN(F)&&M!=="-"&&M!=="."||!isNaN(F)&&(u!==void 0&&F<+u||C!==void 0&&F>+C))return}m?.(M||void 0)},L=()=>n.jsxs("div",{ref:b,className:y.mergeClasses("dial-kit-input flex flex-row items-center justify-between",T.field,e&&"dial-kit-input-error",t&&"dial-kit-input-disable",!r&&T.paddingStart,!x&&T.paddingEnd,c),"aria-label":"input-container",children:[r&&n.jsx("div",{className:"border-r border-secondary",children:n.jsx(ds,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,size:I,id:`${r}_textBefore`})}),n.jsx(j.DialIcon,{icon:i}),o,n.jsx("input",{ref:D,type:d,autoComplete:d==="password"?"new-password":"off",value:p??"",className:y.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",s),onChange:A,onKeyDown:E,min:u,disabled:t,max:C,...N}),a&&n.jsxs("p",{className:y.mergeClasses("text-secondary",T.postfixText),children:[" ",a]}),n.jsx(j.DialIcon,{icon:l}),x&&n.jsx(hc,{size:I,...x,disabled:t})]});return t&&d!=="password"?n.jsx(k.Tooltip,{tooltip:g||p,children:L()}):L()},us=({availableWidth:e,tagWidths:t,overflowChipWidth:r,gap:s})=>{if(e<=0)return t.length;let a=0,o=0;for(const i of t){const l=i+s;if(a+l>e)break;a+=l,o++}if(o===t.length)return o;for(;o>0&&a+r>e;)o--,a-=t[o]+s;return o};var qe=(e=>(e.Outlined="outlined",e.Selectable="selectable",e))(qe||{});const xc="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",bc={[qe.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[qe.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"}},Cc="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",vc="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Ae=({label:e,icon:t,appearance:r=qe.Outlined,selected:s=!1,disabled:a=!1,closable:o=!1,removeLabel:i,className:l,title:c,onClick:d,onRemove:f,onKeyDown:p,...g})=>{const u=r===qe.Selectable,m=!!d&&!a,C=o&&!!f&&!a,x=u&&s,b=I=>{p?.(I),!(!m||I.defaultPrevented)&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),I.currentTarget.click())};return n.jsxs("span",{...g,role:m?"button":g.role,tabIndex:m?0:g.tabIndex,"aria-disabled":a||void 0,"aria-pressed":u&&m?s:void 0,onClick:a?void 0:d,onKeyDown:b,className:y.mergeClasses(xc,x?"dial-tiny-semi-text":"dial-tiny-text",bc[r][s?"selected":"default"],a&&"cursor-not-allowed",m&&[Cc,vc],l,j.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}),C&&n.jsx(k.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:O.ElementSize.Small,"aria-label":i??`Remove ${e}`,icon:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:I=>{I.stopPropagation(),f?.(I)}})]})},At="h-[24px] max-w-full rounded-md border border-secondary bg-layer-sunken px-2",pt=({options:e,selectedValues:t,handleRemoveTag:r,tagClassName:s})=>n.jsx(n.Fragment,{children:t.map(a=>{const o=e.find(i=>i.value===a);return n.jsx(Ae,{label:o?.label??a,closable:!!r,onRemove:i=>r?.(i,a),icon:o?.icon,className:y.mergeClasses(At,s)},a)})}),yc=8,Ic=e=>e.stopPropagation(),Sc=e=>{e.key!=="Escape"&&e.stopPropagation()},Dc=({options:e,selectedValues:t,handleRemoveTag:r})=>{const s=h.useRef(null),a=h.useRef(null),[o,i]=h.useState(null),l=h.useCallback(()=>{const p=s.current,g=a.current;if(!p||!g)return;const u=Array.from(g.children,C=>C.offsetWidth),m=u.pop()??0;i(us({tagWidths:u,overflowChipWidth:m,availableWidth:p.clientWidth,gap:yc}))},[]);h.useLayoutEffect(()=>{l()},[l,e,t]),h.useLayoutEffect(()=>{const p=s.current;return p?j.observeElementSize(p,l):void 0},[l]);const c=o??t.length,d=t.slice(0,c),f=t.slice(c);return n.jsxs("div",{ref:s,className:"relative flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:[n.jsx(pt,{options:e,selectedValues:d,handleRemoveTag:r,tagClassName:"min-w-0"}),f.length>0&&n.jsx(k.InteractiveTooltip,{asChild:!0,placement:k.TooltipPlacement.Bottom,content:n.jsx("div",{className:"flex flex-wrap gap-2",onClick:Ic,onKeyDown:Sc,children:n.jsx(pt,{options:e,selectedValues:f,handleRemoveTag:r})}),children:n.jsx(Ae,{label:`+${f.length}`,role:"button",tabIndex:0,"aria-haspopup":"true","aria-label":`${f.length} more selected: ${f.map(p=>e.find(g=>g.value===p)?.label??p).join(", ")}`,title:"",className:y.mergeClasses(At,"shrink-0")})}),n.jsxs("div",{ref:a,"aria-hidden":"true",inert:!0,className:"pointer-events-none invisible absolute left-0 top-0 flex h-0 w-max gap-2 overflow-hidden",children:[n.jsx(pt,{options:e,selectedValues:t,handleRemoveTag:r,tagClassName:"shrink-0"}),n.jsx(Ae,{label:`+${t.length}`,className:y.mergeClasses(At,"shrink-0")})]})]})},Nc=y.mergeClasses("w-full flex flex-col"),jc=k.overlayItemClassName,Tc="!max-w-[var(--reference-width)]",wc=y.mergeClasses("max-h-[344px] overflow-y-auto py-1",k.overlayListClassName),Ec=k.overlayGap,Oc=k.overlaySubMenuListClassName,Ac=n.jsx(B.IconChevronRight,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),_c="text-secondary transition-transform",Lc=8,kc=n.jsx(B.IconSearch,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Rc=n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Mc=n.jsx(k.SvgNoData,{width:$.DIAL_ICON_SIZE.LG,height:$.DIAL_ICON_SIZE.LG,"aria-hidden":"true"}),Pc=({opt:e,selectedValues:t,mark:r=k.MenuItemMark.Tint,onSelect:s})=>{const{isOpen:a,nodeId:o,refs:i,floatingStyles:l,context:c,getReferenceProps:d,getFloatingProps:f}=j.useSubMenuFloating(Ec,"listbox",!!e.disabled),p=e.children?.some(u=>t.includes(u.value)),g=n.jsx(k.MenuItem,{ref:i.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:Ac,...d()});return n.jsxs(ee.FloatingNode,{id:o,children:[e.interactiveTooltip?n.jsx(k.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:g}):g,a&&n.jsx(j.SubMenuPanel,{refs:i,floatingStyles:l,context:c,getFloatingProps:f,role:"listbox",surfaceClassName:Oc,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(h.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)})})]})},Fc=({options:e,multiple:t=!1,id:r,value:s,defaultValue:a,size:o=O.ElementSize.Standard,prefix:i,customSelectedValue:l,placeholder:c="Select...",labelProps:d,error:f,caption:p,ariaLabel:g,searchable:u=!1,searchSize:m=O.ElementSize.Standard,searchPlaceholder:C,selectAll:x=!1,invalid:b,selectAllLabel:I="Select all",collapseTagOverflow:N=!1,selectedOptionMark:T=k.MenuItemMark.Tint,emptyStateTitle:S="No options available",emptyStateDescription:D,emptyStateIcon:_,disabled:E=!1,className:A,fieldClassName:L,listClassName:w,closable:M=!1,header:F,footer:K,onClose:te,onChange:G,dismissRef:z,onFooterClick:H,open:q,onOpenChange:U,onSearchQueryChange:ae,customMultiSelectTagsRenderer:Y})=>{const Z=h.useId(),re=r||Z,oe=`list-${re}`,le=o===O.ElementSize.Small,[ue,me]=h.useState(!1),Ce=q!==void 0,ge=Ce?!!q:ue,W=h.useCallback(P=>{Ce||me(P),U?.(P)},[Ce,U]),[Q,we]=h.useState(""),ke=h.useCallback(P=>{P!==Q&&(we(P||""),ae?.(P||""))},[ae,Q]),X=s!==void 0,[de,Ee]=h.useState(a),xe=X?s:de,fe=h.useMemo(()=>t?Array.isArray(xe)?xe:[]:typeof xe=="string"?[xe]:[],[xe,t]),Qe=h.useMemo(()=>{const P=Q.trim().toLowerCase();return P?e.filter(pe=>pe.label.toLowerCase().includes(P)):e},[e,Q]);h.useEffect(()=>{ge||ke("")},[ge,ke]);const ye=h.useCallback(P=>{X||Ee(P),G?.(P)},[X,G]),ct=h.useCallback(P=>{if(t){const pe=new Set(fe);pe.has(P)?pe.delete(P):pe.add(P),ye(Array.from(pe));return}ye(P),W(!1)},[t,ye,W,fe]),Je=h.useCallback((P,pe)=>{if(P.stopPropagation(),!t){ye("");return}const Ct=fe.filter(Ts=>Ts!==pe);ye(Ct)},[t,fe,ye]),ve=h.useMemo(()=>Qe.filter(P=>!P.disabled),[Qe]),ze=h.useMemo(()=>ve.filter(P=>fe.includes(P.value)).length,[ve,fe]),{allSelectedInFiltered:be,someSelectedInFiltered:Ht}=h.useMemo(()=>{const P=ve.length>0&&ze===ve.length;return{allSelectedInFiltered:P,someSelectedInFiltered:ze>0&&!P}},[ve,ze]),et=h.useCallback(()=>{if(!(!t||ve.length===0))if(be){const P=new Set(ve.map(pe=>pe.value));ye(fe.filter(pe=>!P.has(pe)))}else{const P=new Set(fe);ve.forEach(pe=>P.add(pe.value)),ye(Array.from(P))}},[be,t,ve,fe,ye]),Ge=fe.length>0,R=!t&&Ge?fe[0]:void 0,ne=h.useMemo(()=>R?e.find(P=>P.value===R)??e.flatMap(P=>P.children??[]).find(P=>P.value===R):void 0,[e,R]),Ie=ne?i?`${i} ${ne.label}`:ne.label:void 0,Vt=j.useIsMobileScreen(),Kt=t&&N&&!Y&&!Vt,dt=h.useMemo(()=>t?Ge?Kt?n.jsx(Dc,{options:e,selectedValues:fe,handleRemoveTag:Je}):n.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",children:Y?.(e,fe,Je)??n.jsx(pt,{options:e,selectedValues:fe,handleRemoveTag:Je})}):null:!ne||!ne.labelNode&&!ne.description?null:n.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[n.jsx(k.EllipsisTooltip,{text:ne.labelNode??Ie}),ne.description&&n.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:ne.description})]}),[Kt,Y,Je,Ge,t,e,Ie,fe,ne]),Is=t||dt?"":Ie||(l&&s?l:""),Ss=typeof d?.label=="string"?d.label:void 0,Ds=dt?[O.resolveAccessibleName(g,Ss),t?fe.map(P=>e.find(pe=>pe.value===P)?.label??P).join(", "):Ie].filter(Boolean).join(", ")||void 0:O.resolveAccessibleName(g);h.useImperativeHandle(z,()=>({dismiss:()=>{W(!1)}}));const Ns=h.useCallback(P=>{E||(P.key==="ArrowDown"||P.key==="ArrowUp")&&(P.preventDefault(),ge||W(!0))},[E,ge,W]),js=()=>n.jsxs("div",{id:oe,role:"listbox","aria-multiselectable":t||void 0,className:Nc,children:[F&&n.jsx(n.Fragment,{children:typeof F=="function"?F():F}),(u||M)&&(e.length>Lc||!!Q)&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[u&&n.jsx($e,{id:`search-${re}`,size:m,placeholder:C,"aria-label":C||"Search options",onChange:P=>ke(P),value:Q,iconBefore:kc,containerClassName:"w-full"}),M&&n.jsx(k.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:O.ElementSize.Small,icon:Rc,onClick:P=>{te?.(P),W(!1)}})]}),t&&x&&ve.length>0&&n.jsx("div",{className:y.mergeClasses(jc,"mt-2"),children:n.jsx(k.Checkbox,{id:`${re}-selectAll`,labelProps:{label:I},isSelected:be,isIndeterminate:Ht,onChange:et})}),n.jsx("div",{role:"none",className:wc,children:Qe.length===0?n.jsx("div",{className:"px-2 py-3",children:n.jsx(j.DialNoDataContent,{icon:_??Mc,title:S,description:D})}):Qe.map(P=>{const pe=fe.includes(P.value);if(P.children?.length)return n.jsx(Pc,{opt:P,selectedValues:fe,mark:t?k.MenuItemMark.Checkbox:T,onSelect:ct},P.value);const Ct=t?n.jsx(k.MenuItem,{id:`${re}-${P.value}`,role:"option","aria-selected":pe,"aria-disabled":!!P.disabled,disabled:P.disabled,mark:k.MenuItemMark.Checkbox,selected:pe,icon:P.icon,label:P.labelNode??P.label,description:P.description,rightControl:P.rightControl,onClick:()=>ct(P.value)}):n.jsx(k.MenuItem,{role:"option","aria-selected":pe,"aria-disabled":!!P.disabled,disabled:P.disabled,mark:T,selected:pe,ellipsisLabel:!0,icon:P.icon,label:P.labelNode??P.label,description:P.description,rightControl:P.rightControl,onClick:()=>!P.disabled&&ct(P.value)});return n.jsx(h.Fragment,{children:P.interactiveTooltip?n.jsx(k.InteractiveTooltip,{asChild:!0,placement:P.interactiveTooltip.placement,content:P.interactiveTooltip.content,contentClassName:P.interactiveTooltip.contentClassName,children:Ct}):Ct},P.value)})}),K&&n.jsx("div",{onClick:P=>{H?.(P),H&&W(!1)},children:typeof K=="function"?K():K})]});return n.jsxs("div",{className:y.mergeClasses("flex w-full flex-col gap-2",A,j.DIAL_KIT_CLASS.select),children:[d&&n.jsx(k.Label,{...d,htmlFor:re}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(k.Dropdown,{open:ge,onOpenChange:W,disabled:E,closable:M,onClose:te,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:y.mergeClasses(Tc,w),className:"w-full",renderOverlay:js,children:n.jsx($e,{id:re,size:o,disabled:E,invalid:b,value:Is,placeholder:dt?void 0:c,readOnly:!0,iconBefore:t?void 0:ne?.icon,iconAfter:n.jsx(B.IconChevronDown,{size:le?$.DIAL_ICON_SIZE.SM:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:y.mergeClasses(_c,ge&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":ge,"aria-controls":oe,"aria-autocomplete":"none","aria-label":Ds,containerClassName:"w-full",wrapperClassName:y.mergeClasses(!E&&"cursor-pointer",t&&Ge&&!Kt&&["!h-auto flex-wrap py-2",le?"min-h-[24px]":"min-h-[40px]"],L),className:y.mergeClasses("cursor-pointer",dt&&"w-0 min-w-0 flex-none p-0"),onKeyDown:Ns,children:dt})}),n.jsx(Ke,{text:f}),!f&&n.jsx(Ve,{text:p})]})]})};var fs=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(fs||{});const cn={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},Bc=e=>typeof e=="boolean"?cn[e?"both":"none"]:cn[e],zc=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:o=!1,labelProps:i,caption:l,id:c,...d})=>{const f=y.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",d.invalid&&"dial-kit-input-error",d.disabled&&"dial-kit-input-disable",Bc(o),e);return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-2",a),children:[i&&n.jsx(k.Label,{...i,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(Ke,{text:s}),!s&&n.jsx(Ve,{text:l})]})]})},$c=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:r,size:s=O.ElementSize.Standard,...a})=>{const[o,i]=h.useState(!1),l=o&&!r;return h.useEffect(()=>{r&&i(!1)},[r]),n.jsx($e,{...a,wrapperClassName:y.mergeClasses(a.wrapperClassName,j.DIAL_KIT_CLASS.passwordInput),size:s,disabled:r,type:l?"text":"password",iconAfter:r?void 0:n.jsx(k.GhostIconButton,{size:O.ElementSize.Small,"aria-label":l?t:e,"aria-pressed":l,icon:l?n.jsx(B.IconEyeOff,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx(B.IconEye,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>i(c=>!c)})})},Hc=/^0+\.(\d+)?$/,Vc=/^0+/,Kc=[".","-","+","e","E"],dn=e=>!e||e==="-"?e:String(e).match(Hc)?String(e).replace(Vc,"0"):Number(e),Gc=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:o,...i})=>{const l=d=>{if(e&&Kc.includes(d.key)){d.preventDefault();return}ls(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 g=d.currentTarget,u=g.selectionStart??0,m=g.selectionEnd??0,C=g.value.slice(0,u)+p+g.value.slice(m);t?.(dn(C))}}o?.(d)};return n.jsx($e,{...i,wrapperClassName:y.mergeClasses(i.wrapperClassName,j.DIAL_KIT_CLASS.numberInput),type:"number",min:r,max:s,onChange:d=>t?.(dn(d)),onKeyDown:l,onPaste:c})},Uc="z-popup flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",Zc="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",Wc="flex flex-row items-center justify-between px-6 py-4",qc="flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary",Yc="border-b border-tertiary",Xc="flex flex-row items-center gap-2 px-6 py-4",Qc="border-t border-tertiary",nr="flex shrink-0 flex-row items-center gap-2",Jc={[v.PopupSize.Sm]:"max-w-full md:max-w-[400px]",[v.PopupSize.Md]:"max-w-full md:max-w-[800px]",[v.PopupSize.Lg]:"max-w-full md:max-w-[1200px]"},Er=({open:e=!1,header:t,ariaLabel:r,portalId:s,className:a,overlayClassName:o,titleClassName:i,headerClassName:l,bodyClassName:c,children:d,footer:f,footerClassName:p,onClose:g,onBack:u,backAriaLabel:m="Back",headerActions:C,headerDivider:x=!1,mainButtons:b,additionalButtons:I,additionalButtonsOnLeft:N=!1,footerDivider:T=!1,size:S=v.PopupSize.Md,hideClose:D=!1,closeAriaLabel:_="Close dialog",closeOnOutsideClick:E=!0,preventKeyboardOnOpen:A=!1})=>{const L=j.useThemeScope(),w=h.useRef(null),M=h.useId(),{refs:F,context:K}=ee.useFloating({open:e,onOpenChange:Z=>{Z||g?.(null)}}),te=ee.useRole(K,{role:"dialog"}),G=ee.useDismiss(K,{outsidePress:E}),{getFloatingProps:z}=ee.useInteractions([te,G]);if(!e)return null;const H=typeof t=="string"?`popup-heading-${M}`:void 0,q=Z=>Z?typeof Z=="string"?n.jsx("h2",{id:H,className:y.mergeClasses(qc,i),children:n.jsx(k.Tooltip,{tooltip:Z,triggerClassName:"truncate",children:Z})}):Z:n.jsx("span",{}),U=D?null:n.jsx(k.CloseButton,{ariaLabel:_,onClose:Z=>g?.(Z)}),ae=(Z,re=[])=>re.map(({variant:oe=O.ButtonVariant.Neutral,...le},ue)=>n.jsx(Xe,{variant:oe,...le},`${Z}-${ue}`)),Y=()=>{if(f!==void 0)return f;if(!b?.length&&!I?.length)return null;const Z=ae("additional",I);return n.jsxs("div",{className:y.mergeClasses(Xc,T&&Qc,p),children:[N&&Z.length>0&&n.jsx("div",{className:nr,children:Z}),n.jsxs("div",{className:y.mergeClasses(nr,"ml-auto"),children:[!N&&Z,ae("main",b)]})]})};return n.jsx(ee.FloatingPortal,{id:s,children:n.jsx(ee.FloatingOverlay,{className:y.mergeClasses(Uc,L,o),children:n.jsx(ee.FloatingFocusManager,{context:K,initialFocus:A?w:F.floating,children:n.jsxs("div",{ref:F.setFloating,...z(),role:"dialog","aria-modal":"true","aria-labelledby":H,"aria-label":H?void 0:r,className:y.mergeClasses(Zc,Jc[S],a,j.DIAL_KIT_CLASS.popup),children:[A&&n.jsx("div",{ref:w,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),n.jsxs("div",{className:y.mergeClasses(Wc,x&&Yc,l),children:[u&&n.jsx(k.GhostIconButton,{"aria-label":m,size:O.ElementSize.Small,className:"mr-2",onClick:u,icon:n.jsx(B.IconChevronLeft,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),q(t),C?n.jsxs("div",{className:nr,children:[C,U]}):U]}),n.jsx("div",{className:y.mergeClasses("grow overflow-auto",c),children:d}),Y()]})})})})},ed="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",td="text-secondary dial-small-paragraph-text px-6 pb-4",rd="px-6 py-4 h-[120px]",nd="Cancel",sd="Ok",un={[v.ConfirmationPopupVariant.Info]:{confirm:{variant:O.ButtonVariant.Primary,appearance:O.ButtonAppearance.Solid}},[v.ConfirmationPopupVariant.Danger]:{confirm:{variant:O.ButtonVariant.Danger,appearance:O.ButtonAppearance.Solid}}},ps=({header:e,description:t,descriptionClassName:r,open:s=!1,confirmLabel:a=sd,cancelLabel:o=nd,isLoading:i=!1,disableConfirmButton:l=!1,className:c,confirmClassName:d,onClose:f,onConfirm:p,onCancel:g,children:u,variant:m=v.ConfirmationPopupVariant.Info,size:C=v.PopupSize.Sm,footer:x,hideClose:b,...I})=>{const N=i?null:n.jsxs("div",{className:ed,children:[n.jsx(wr,{label:o,onClick:()=>g?g():f?.()}),n.jsx(Xe,{variant:un[m].confirm.variant,appearance:un[m].confirm.appearance,className:d,label:a,disabled:l,onClick:p})]}),T=h.useCallback(()=>i?n.jsx("div",{className:rd,children:n.jsx(v.Spinner,{size:40})}):u??(t?n.jsx("div",{className:y.mergeClasses(td,r),children:t}):null),[u,t,i,r]);return n.jsx(Er,{...I,open:s,header:e,className:y.mergeClasses(c,j.DIAL_KIT_CLASS.confirmationPopup),onClose:()=>f?.(),footer:x??N,size:C,hideClose:b??(!i&&x===void 0),children:T()})};var _t=(e=>(e.Start="start",e.End="end",e))(_t||{});const ad=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,ariaLabel:l,onToggle:c,caretPosition:d=_t.End,className:f,headerClassName:p,contentClassName:g})=>{const u=s!==void 0,[m,C]=h.useState(a),x=i?!0:u?s:m,b=h.useId(),I=`accordion-header-${b}`,N=`accordion-content-${b}`,T=()=>{if(o)return;const A=!x;u||C(A),c?.(A)},S=d===_t.Start,D=i?null:n.jsx(B.IconChevronRight,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:y.mergeClasses("shrink-0 text-secondary transition-transform motion-reduce:transition-none",x?"rotate-90":"rtl:rotate-180")}),_=n.jsxs(n.Fragment,{children:[S&&D,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]}),!S&&D]}),E=S?"justify-start gap-2":"justify-between";return n.jsxs("div",{className:y.mergeClasses("flex flex-col py-3 overflow-hidden bg-transparent",f,j.DIAL_KIT_CLASS.accordion),children:[i?n.jsx("div",{id:I,className:y.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",E,p),children:_}):n.jsx("button",{id:I,type:"button","aria-expanded":x,"aria-controls":N,"aria-label":O.resolveAccessibleName(l),disabled:o,onClick:T,className:y.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",E,o?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",p),children:_}),n.jsx("div",{inert:!x,className:y.mergeClasses("grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",x?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:n.jsx("div",{className:"min-h-0 overflow-hidden",children:n.jsx("div",{className:"pt-3",children:n.jsx("div",{id:N,role:"region","aria-labelledby":I,className:y.mergeClasses("px-4 dial-small-text text-primary",g),children:r})})})})]})},od=({id:e,labelProps:t,isOn:r=!1,disabled:s,onChange:a,caption:o,className:i,...l})=>{const c=h.useId(),d=e??c,f=o?`${d}-caption`:void 0,p=h.useCallback(g=>{a?.(g.target.checked)},[a]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:y.mergeClasses("flex items-center gap-2",i,j.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":O.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":f,className:"peer sr-only"}),n.jsx("label",{htmlFor:d,className:y.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":y.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:y.mergeClasses("size-3.5 shrink-0 rounded-full",s?"bg-control-disable-secondary":"bg-control-neutral")})}),t&&n.jsx(k.Label,{size:O.ElementSize.Standard,...t,htmlFor:d,className:y.mergeClasses("py-[1px]",s?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),o&&n.jsx("span",{id:f,className:"dial-tiny-text text-secondary ml-[44px]",children:o})]})},id="flex flex-col gap-2",ld="flex",cd="mt-2 ml-[26px]",dd={[v.RadioGroupOrientation.Column]:"flex-col gap-y-3",[v.RadioGroupOrientation.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},gs=({items:e,value:t,onChange:r,name:s,id:a,orientation:o=v.RadioGroupOrientation.Column,labelProps:i,disabled:l,error:c,caption:d,ariaLabel:f,className:p,optionsClassName:g,radioClassName:u,contentClassName:m})=>{const C=h.useId(),x=a??C,b=`${x}-label`,I=c?`${x}-error`:void 0,N=!c&&d?`${x}-caption`:void 0,T=O.resolveAccessibleName(i?.label);return n.jsxs("div",{className:y.mergeClasses(id,p,j.DIAL_KIT_CLASS.radioGroup),children:[i&&n.jsx(k.Label,{...i,id:b}),n.jsx("div",{role:"radiogroup","aria-labelledby":T?b:void 0,"aria-label":T?void 0:O.resolveAccessibleName(f),"aria-describedby":[I,N].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:y.mergeClasses(ld,dd[o],g),children:e.map(S=>{const D=S.value===t;return n.jsxs("div",{className:"flex min-w-0 flex-col",children:[n.jsx(k.Radio,{id:`${x}-${S.value}`,name:s??x,value:S.value,labelProps:S.label==null?void 0:{label:S.label},"aria-label":S["aria-label"],caption:S.caption,isSelected:D,disabled:l||S.disabled,onChange:r,className:u}),D&&S.content?n.jsx("div",{className:y.mergeClasses(cd,m),children:S.content}):null]},S.value)})}),n.jsx(Ke,{id:I,text:c}),!c&&n.jsx(Ve,{id:N,text:d})]})},ud="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",fd="min-w-0 flex-1 truncate text-primary",pd="min-w-0 flex-1 truncate text-secondary",gd="shrink-0 text-secondary",hd="px-6 pb-4",md="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",xd="Cancel",bd="Apply",Cd=({items:e,value:t,customValue:r,header:s,onApply:a,id:o,labelProps:i,placeholder:l,selectedValue:c,onSelectionChange:d,onCancel:f,onClose:p,isValid:g=!0,applyButtonLabel:u=bd,cancelButtonLabel:m=xd,size:C=v.PopupSize.Md,portalId:x,disabled:b,invalid:I,error:N,caption:T,ariaLabel:S,className:D,fieldClassName:_})=>{const E=h.useId(),A=o??E,L=`${A}-label`,w=`${A}-value`,M=N?`${A}-error`:void 0,F=!N&&T?`${A}-caption`:void 0,[K,te]=h.useState(!1),G=c!==void 0,[z,H]=h.useState(t),q=G?c:z,U=h.useCallback(()=>{b||(G||H(t),te(!0))},[b,G,t]),ae=h.useCallback(()=>{te(!1),p?.()},[p]),Y=h.useCallback(()=>{f?.(),ae()},[f,ae]),Z=h.useCallback(()=>{a(q),ae()},[a,q,ae]),re=h.useCallback(W=>{G||H(W),d?.(W)},[G,d]),oe=O.resolveAccessibleName(i?.label),le=oe?void 0:O.resolveAccessibleName(S),ue=oe?L:le&&`${A}-name`,me=O.resolveAccessibleName(s),Ce=e.find(W=>W.value===t)?.label,ge=r??Ce;return n.jsxs("div",{className:y.mergeClasses("flex w-full flex-col gap-2",D,j.DIAL_KIT_CLASS.radioGroupPopupField),children:[i&&n.jsx(k.Label,{...i,id:L,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":K,"aria-labelledby":ue?`${ue} ${w}`:void 0,"aria-describedby":[M,F].filter(Boolean).join(" ")||void 0,onClick:U,className:y.mergeClasses(ud,I&&"dial-kit-input-error",b&&"dial-kit-input-disable",_),children:[n.jsx("span",{id:w,className:ge==null?pd:fd,children:ge??l}),n.jsx(B.IconMaximize,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:gd})]}),n.jsx(Ke,{id:M,text:N}),!N&&n.jsx(Ve,{id:F,text:T})]}),n.jsx(Er,{open:K,header:s,ariaLabel:me?void 0:oe,portalId:x,size:C,onClose:Y,footer:n.jsxs("div",{className:md,children:[n.jsx(wr,{label:m,onClick:Y}),n.jsx(os,{label:u,disabled:!g,onClick:Z})]}),children:n.jsx("div",{className:hd,children:n.jsx(gs,{id:`${A}-options`,items:e,value:q,onChange:re,orientation:v.RadioGroupOrientation.Column,ariaLabel:oe??me})})})]})},vd=({icon:e,selectedIcon:t,isSelected:r=!1,onToggle:s,onClick:a,tooltipProps:o,size:i=O.ElementSize.Small,className:l,...c})=>{const d=h.useCallback(p=>{a?.(p),s?.(!r)},[a,s,r]),f=n.jsx(k.IconButton,{...c,size:i,variant:O.ButtonVariant.Primary,appearance:O.ButtonAppearance.Ghost,icon:r?t??e:e,"aria-pressed":r,"aria-label":O.resolveAccessibleName(c["aria-label"],o?.tooltip),onClick:d,className:y.mergeClasses("!rounded","[&_svg]:size-4",r&&"!text-accent",l,j.DIAL_KIT_CLASS.toggleIconButton)});return o?n.jsx(k.Tooltip,{asChild:!0,...o,children:f}):f},yd=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Id="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Sd="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",Dd="bg-layer-raised text-accent shadow-xs",Nd="bg-transparent text-secondary",jd="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Td="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",wd="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",Ed="cursor-not-allowed bg-transparent text-control-disable-primary",Od=({items:e,value:t,onChange:r,disabled:s,className:a,segmentClassName:o,"aria-label":i})=>{const l=h.useRef({}),c=e.find(p=>p.value===t),d=c&&!c.disabled?c.value:e.find(p=>!p.disabled)?.value,f=h.useCallback(p=>{if(s||!yd.includes(p.key))return;const g=e.filter(b=>!b.disabled);if(g.length===0)return;const u=Math.max(g.findIndex(b=>b.value===t),0),m=g.length-1;let C=u;switch(p.key){case"ArrowRight":case"ArrowDown":C=u===m?0:u+1;break;case"ArrowLeft":case"ArrowUp":C=u===0?m:u-1;break;case"Home":C=0;break;case"End":C=m;break}p.preventDefault();const x=g[C];l.current[x.value]?.focus(),x.value!==t&&r(x.value)},[s,e,t,r]);return n.jsx("div",{role:"radiogroup","aria-label":i,"aria-disabled":s||void 0,onKeyDown:f,className:y.mergeClasses(Id,a,j.DIAL_KIT_CLASS.segmentedControl),children:e.map(p=>{const g=p.value===t,u=s||p.disabled;return n.jsxs("button",{ref:m=>{l.current[p.value]=m},type:"button",role:"radio","aria-checked":g,"aria-label":O.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:y.mergeClasses(Sd,g?Dd:Nd,u?g?wd:Ed:g?jd:Td,o,j.DIAL_KIT_CLASS.segmentedControlItem),children:[p.icon,p.label]},p.value)})})},Ad={[v.TabOrientation.Horizontal]:{next:"ArrowRight",previous:"ArrowLeft"},[v.TabOrientation.Vertical]:{next:"ArrowDown",previous:"ArrowUp"}},_d=({tabs:e,activeTabId:t,onTabChange:r,orientation:s=v.TabOrientation.Horizontal,sectionLabel:a,ariaLabel:o,className:i,tabListClassName:l,tabClassName:c,sectionLabelClassName:d})=>{const f=h.useRef({}),p=h.useId(),g=s===v.TabOrientation.Vertical,u=e.find(b=>b.id===t),m=u&&!u.disabled?u.id:e.find(b=>!b.disabled)?.id,C=h.useCallback(b=>{const{next:I,previous:N}=Ad[s];if(![I,N,"Home","End"].includes(b.key)||e.length===0)return;const T=e.filter(A=>!A.disabled);if(T.length===0)return;const S=Math.max(T.findIndex(A=>A.id===t),0),D=T.length-1;let _=S;b.key===I?_=S===D?0:S+1:b.key===N?_=S===0?D:S-1:b.key==="Home"?_=0:_=D,b.preventDefault();const E=T[_];f.current[E.id]?.focus(),E.id!==t&&r(E.id)},[e,t,r,s]),x=n.jsx("div",{role:"tablist","aria-orientation":g?"vertical":void 0,"aria-label":o,"aria-labelledby":!o&&a?p:void 0,onKeyDown:C,className:y.mergeClasses(g?"flex flex-col gap-1 px-2":"flex justify-start gap-1",!a&&i,l,j.DIAL_KIT_CLASS.tabList,!a&&j.DIAL_KIT_CLASS.tabs),children:e.map(b=>{const I=t===b.id,N=!!b.disabled;return n.jsxs("button",{ref:T=>{f.current[b.id]=T},type:"button",role:"tab","aria-selected":I,disabled:N,tabIndex:b.id===m?0:-1,onClick:()=>r(b.id),className:y.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",g?["h-11 w-full rounded-lg px-3 desktop:h-10","focus-visible:-outline-offset-1",I?"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"],N&&(g?"cursor-not-allowed text-control-disable-primary":"cursor-not-allowed border-control-disable-primary text-control-disable-primary"),!N&&(g?I?"bg-control-accent-alpha text-accent hover:bg-control-accent-alpha-hover":"hover:bg-control-accent-alpha-hover":I?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),c,j.DIAL_KIT_CLASS.tab,I&&j.DIAL_KIT_CLASS.tabSelected),children:[b.icon&&n.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:b.icon}),n.jsx("span",{className:y.mergeClasses(g&&!I&&!N&&"text-primary"),children:b.label}),b.count!=null&&n.jsx("span",{className:y.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",g&&"ms-auto",N&&"bg-layer-sunken text-control-disable-primary",!N&&(I?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:b.count})]},b.id)})});return a?n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-3",i,j.DIAL_KIT_CLASS.tabs),children:[n.jsx("div",{className:y.mergeClasses("flex h-16 shrink-0 items-center",g?"px-4":"px-3"),children:n.jsx("span",{id:p,className:y.mergeClasses("dial-h1-text text-primary",d,j.DIAL_KIT_CLASS.tabsSectionLabel),children:a})}),x]}):x},Ld="flex flex-nowrap items-center gap-1",kd="min-w-max flex-1 justify-center",Rd=({items:e,value:t,onChange:r,stretch:s=!1,className:a,chipClassName:o,"aria-label":i,"aria-labelledby":l})=>n.jsx("div",{role:"group","aria-label":i,"aria-labelledby":l,className:y.mergeClasses(Ld,a,j.DIAL_KIT_CLASS.filterChips),children:e.map(c=>n.jsx(Ae,{label:c.label,icon:c.icon,appearance:qe.Selectable,selected:c.value===t,onClick:()=>r(c.value),className:y.mergeClasses(s&&kd,o)},c.value))}),fr=(e,t)=>{const r=(t??"").split(",").map(o=>o.trim().toLowerCase()).filter(Boolean);if(r.length===0)return!0;const s=e.name.toLowerCase(),a=e.type.toLowerCase();return r.some(o=>{if(o.startsWith("."))return s.endsWith(o);if(o.endsWith("/*")){const i=o.slice(0,-1);return a.length>i.length&&a.startsWith(i)}return a===o})},Md=({labelProps:e,label:t,description:r,onChange:s,onReject:a,accept:o,multiple:i=!1,disabled:l=!1,errorText:c,icon:d,id:f,ariaLabel:p,className:g})=>{const u=h.useId(),m=f??`file-dropzone-${u}`,C=c?`${m}-error`:void 0,[x,b]=h.useState(!1),I=h.useRef(0),N=h.useCallback(L=>{if(L.length===0)return;const w=i?L:L.slice(0,1),M=w.filter(K=>fr(K,o)),F=w.filter(K=>!fr(K,o));F.length>0&&a?.(F),M.length>0&&s(M)},[o,i,s,a]),T=h.useCallback(L=>{N(Array.from(L.target.files??[])),L.target.value=""},[N]),S=h.useCallback(()=>{I.current=0,b(!1)},[]),D=h.useCallback(L=>{l||(L.preventDefault(),I.current+=1,b(!0))},[l]),_=h.useCallback(L=>{l||(L.preventDefault(),L.dataTransfer.dropEffect="copy")},[l]),E=h.useCallback(()=>{l||(I.current-=1,I.current<=0&&S())},[l,S]),A=h.useCallback(L=>{L.preventDefault(),!l&&(S(),N(Array.from(L.dataTransfer?.files??[])))},[l,S,N]);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:o,multiple:i,disabled:l,onChange:T,"aria-label":O.resolveAccessibleName(typeof t!="string"?p:void 0),"aria-describedby":C,"aria-invalid":c?!0:void 0,className:"peer sr-only"}),n.jsxs("label",{htmlFor:m,onDragEnter:D,onDragOver:_,onDragLeave:E,onDrop:A,className:y.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",g,j.DIAL_KIT_CLASS.fileDropzone),children:[d??n.jsx(B.IconUpload,{size:$.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:y.mergeClasses("dial-small-text",l?"text-control-disable-primary":"text-primary"),children:t}),r&&n.jsx("span",{className:y.mergeClasses("dial-tiny-text",l?"text-control-disable-primary":"text-secondary"),children:r})]})]}),n.jsx(Ke,{id:C,text:c})]})},hs=({label:e="Shared",tooltip:t,size:r=12,className:s})=>n.jsx(k.Tooltip,{tooltip:t||"Shared",asChild:!0,children:n.jsx("span",{role:"img","aria-label":e,className:y.mergeClasses("flex shrink-0 rounded-sm bg-layer-raised text-accent",s,j.DIAL_KIT_CLASS.sharedEntityIndicator),children:n.jsx(B.IconArrowUpRight,{size:r,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})});var je=(e=>(e.Images="images",e.Video="video",e.Audio="audio",e.Code="code",e.Text="text",e.Pdf="pdf",e.Spreadsheet="spreadsheet",e.Presentation="presentation",e.Archive="archive",e.Dial="dial",e.Other="other",e))(je||{});const Pd={images:["apng","avif","bmp","gif","heic","heif","ico","jpeg","jpg","png","svg","tif","tiff","webp"],video:["avi","flv","m4v","mkv","mov","mp4","mpeg","mpg","ogv","webm","wmv"],audio:["aac","aiff","flac","m4a","mid","midi","mp3","oga","ogg","opus","wav","wma"],code:["bash","c","cjs","cpp","cs","css","go","h","hpp","htm","html","ini","ipynb","java","js","json","jsx","kt","less","lua","mjs","php","ps1","py","r","rb","rs","sass","scala","scss","sh","sql","svelte","swift","toml","ts","tsx","vue","xml","yaml","yml","zsh"],text:["doc","docx","log","markdown","md","odt","rtf","text","txt"],pdf:["pdf"],spreadsheet:["csv","numbers","ods","tsv","xls","xlsm","xlsx"],presentation:["key","odp","pps","ppsx","ppt","pptx"],archive:["7z","bz2","gz","rar","tar","tgz","xz","zip"],dial:["dial"]},Fd=new Map(Object.entries(Pd).flatMap(([e,t])=>t.map(r=>[r,e]))),Bd=e=>Fd.get(e)??"other",fn="var(--text-control-permanent, #FCFCFC)",It={x1:"20.4167",y1:"-3.33333",x2:"2.5",y2:"20",from:"var(--bg-visual-blue, #D6EDF9)",to:"var(--stroke-gradient-1, #5976E9)"},zd="#1B212D",$d={[je.Images]:{path:"M11.0002 8.66667H11.0036M7.00024 11.3333L8.66691 9.66667C8.97624 9.369 9.35758 9.369 9.66691 9.66667L11.3336 11.3333M10.6669 10.6667L11.0002 10.3333C11.3096 10.0357 11.6909 10.0357 12.0002 10.3333L13.0002 11.3333M7.00024 8C7.00024 7.73478 7.1056 7.48043 7.29314 7.29289C7.48067 7.10536 7.73503 7 8.00024 7H12.0002C12.2655 7 12.5198 7.10536 12.7074 7.29289C12.8949 7.48043 13.0002 7.73478 13.0002 8V12C13.0002 12.2652 12.8949 12.5196 12.7074 12.7071C12.5198 12.8946 12.2655 13 12.0002 13H8.00024C7.73503 13 7.48067 12.8946 7.29314 12.7071C7.1056 12.5196 7.00024 12.2652 7.00024 12V8Z",sheet:It},[je.Code]:{path:"M8.33358 8.66665L7.00024 9.99998L8.33358 11.3333M11.6669 8.66665L13.0002 9.99998L11.6669 11.3333M10.6669 7.33331L9.33358 12.6666",sheet:{x1:"16.6667",y1:"0",x2:"2.08333",y2:"20.4167",from:"var(--bg-control-inverted, #57647A)",to:zd}},[je.Text]:{path:"M7.3335 8H12.6668M7.3335 10H12.6668M7.3335 12H11.3335",sheet:{x1:"25.8333",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-violet-1, #DDE3F9)",to:"var(--bg-gradient-1, #1D4ED8)"}},[je.Spreadsheet]:{path:"M7.33325 10.1667H12.6666M9.99992 7.5V12.8333M7.33325 8.16667C7.33325 7.98986 7.40349 7.82029 7.52851 7.69526C7.65354 7.57024 7.82311 7.5 7.99992 7.5H11.9999C12.1767 7.5 12.3463 7.57024 12.4713 7.69526C12.5963 7.82029 12.6666 7.98986 12.6666 8.16667V12.1667C12.6666 12.3435 12.5963 12.513 12.4713 12.6381C12.3463 12.7631 12.1767 12.8333 11.9999 12.8333H7.99992C7.82311 12.8333 7.65354 12.7631 7.52851 12.6381C7.40349 12.513 7.33325 12.3435 7.33325 12.1667V8.16667Z",sheet:{x1:"20.4167",y1:"-3.75",x2:"2.91667",y2:"20.4167",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-1, #059669)"}},[je.Pdf]:{fillPath:"M12.5373 10.3151C12.0382 10.3151 11.4137 10.4021 11.2094 10.4328C10.3637 9.54967 10.1231 9.04771 10.069 8.91388C10.1423 8.72544 10.3975 8.0096 10.4338 7.09022C10.4517 6.62991 10.3544 6.28596 10.1447 6.06792C9.93533 5.85024 9.68191 5.83331 9.60924 5.83331C9.35443 5.83331 8.92697 5.96216 8.92697 6.82503C8.92697 7.5737 9.27603 8.36813 9.37252 8.57339C8.86416 10.0536 8.31837 11.0669 8.20248 11.2753C6.15974 12.0444 6 12.788 6 12.9988C6 13.3775 6.26973 13.6036 6.72152 13.6036C7.8192 13.6036 8.8209 11.7607 8.98653 11.4407C9.76614 11.1301 10.8096 10.9377 11.0749 10.8918C11.8357 11.6166 12.7157 11.81 13.0811 11.81C13.3561 11.81 14 11.81 14 11.148C14 10.5332 13.2121 10.3151 12.5373 10.3151ZM12.4844 10.7497C13.0773 10.7497 13.234 10.9458 13.234 11.0494C13.234 11.1145 13.2093 11.3268 12.8915 11.3268C12.6065 11.3268 12.1145 11.1621 11.6303 10.8047C11.8322 10.7782 12.131 10.7497 12.4844 10.7497ZM9.57812 6.25458C9.63218 6.25458 9.66777 6.27195 9.69711 6.31264C9.86764 6.54926 9.73014 7.32242 9.56279 7.92745C9.40124 7.40867 9.28 6.61264 9.45058 6.33259C9.48392 6.27793 9.52204 6.25458 9.57812 6.25458ZM9.29017 10.8856C9.50483 10.452 9.74542 9.81997 9.87646 9.46253C10.1387 9.90147 10.4914 10.309 10.6954 10.53C10.0603 10.6639 9.57969 10.7976 9.29017 10.8856ZM6.4264 13.0566C6.41226 13.0399 6.41017 13.0045 6.42083 12.9621C6.44317 12.8731 6.61396 12.4322 7.84924 11.8796C7.67236 12.1582 7.39585 12.5563 7.09208 12.8537C6.87825 13.0538 6.71174 13.1553 6.59719 13.1553C6.55621 13.1553 6.49974 13.1442 6.4264 13.0566Z",sheet:{x1:"26.25",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-red, #FCE7F3)",to:"var(--bg-control-error-active, #CC4545)"}},[je.Audio]:{path:"M9 11.5C9 11.7652 8.89464 12.0195 8.70711 12.2071C8.51957 12.3946 8.26522 12.5 8 12.5C7.73478 12.5 7.48043 12.3946 7.29289 12.2071C7.10536 12.0195 7 11.7652 7 11.5C7 11.2347 7.10536 10.9804 7.29289 10.7929C7.48043 10.6053 7.73478 10.5 8 10.5C8.26522 10.5 8.51957 10.6053 8.70711 10.7929C8.89464 10.9804 9 11.2347 9 11.5ZM9 11.5V7.16663H12.3333V11.5M12.3333 11.5C12.3333 11.7652 12.228 12.0195 12.0404 12.2071C11.8529 12.3946 11.5985 12.5 11.3333 12.5C11.0681 12.5 10.8138 12.3946 10.6262 12.2071C10.4387 12.0195 10.3333 11.7652 10.3333 11.5C10.3333 11.2347 10.4387 10.9804 10.6262 10.7929C10.8138 10.6053 11.0681 10.5 11.3333 10.5C11.5985 10.5 11.8529 10.6053 12.0404 10.7929C12.228 10.9804 12.3333 11.2347 12.3333 11.5ZM9 8.49996H12.3333",sheet:It},[je.Video]:{path:"M9.99996 13.1667C11.8409 13.1667 13.3333 11.6743 13.3333 9.83333C13.3333 7.99238 11.8409 6.5 9.99996 6.5C8.15901 6.5 6.66663 7.99238 6.66663 9.83333C6.66663 11.6743 8.15901 13.1667 9.99996 13.1667ZM9.33337 8.5L11.3334 9.83333L9.33337 11.1667V8.5Z",sheet:It},[je.Presentation]:{path:"M7 7.33331H13M7.33333 7.33331V10.6666C7.33333 10.8435 7.40357 11.013 7.5286 11.1381C7.65362 11.2631 7.82319 11.3333 8 11.3333H12C12.1768 11.3333 12.3464 11.2631 12.4714 11.1381C12.5964 11.013 12.6667 10.8435 12.6667 10.6666V7.33331M10 11.3333V12.6666M9 12.6666H11M8.66667 9.99998L9.66667 8.99998L10.3333 9.66665L11.3333 8.66665",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-brown, #FDE8D8)",to:"var(--text-visual-brown-2, #B45309)"}},[je.Archive]:{path:"M10.0001 6.66669H9.58341M10.8334 7.451H10.4167M10.0001 8.23531H9.58341M10.8334 9.01963H10.4167M10.0001 9.80394H9.58341M10.8334 10.5883H10.4167M10.0001 11.3726C10.2211 11.3726 10.4331 11.4552 10.5893 11.6023C10.7456 11.7494 10.8334 11.9489 10.8334 12.1569V12.9412C10.8334 13.0452 10.7895 13.1449 10.7114 13.2185C10.6332 13.292 10.5273 13.3334 10.4167 13.3334H9.58341C9.47291 13.3334 9.36693 13.292 9.28879 13.2185C9.21065 13.1449 9.16675 13.0452 9.16675 12.9412V12.1569C9.16675 11.9489 9.25455 11.7494 9.41083 11.6023C9.56711 11.4552 9.77907 11.3726 10.0001 11.3726Z",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-3, #065F46)"}},[je.Dial]:{path:"M8.26392 7.44049C8.80816 7.44049 9.28449 7.50578 9.69653 7.63092L9.69849 7.6319C10.1079 7.75343 10.4556 7.938 10.7463 8.1817L10.7483 8.18365C11.0312 8.41601 11.2537 8.72491 11.4104 9.12115V9.12213C11.5666 9.51456 11.6496 9.98403 11.6497 10.5381C11.6497 11.5957 11.3539 12.3492 10.8108 12.8565C10.2602 13.3708 9.47204 13.6504 8.39868 13.6505H6.71313V7.44049H8.26392Z",fillPath:"M12.7167 12.1008L12.9558 12.3564L12.9558 12.3564L12.7167 12.1008ZM11.4504 6.20825L11.3486 6.54311L11.3507 6.54375L11.4504 6.20825ZM12.637 6.833L12.4119 7.10109L12.4147 7.10334L12.637 6.833ZM13.4108 7.9263L13.0853 8.05488L13.0856 8.05566L13.4108 7.9263ZM11.1666 12.8853L11.0909 12.5436V12.5436L11.1666 12.8853ZM10.4391 12.6553C10.2487 12.689 10.1217 12.8706 10.1553 13.0609C10.189 13.2513 10.3706 13.3783 10.5609 13.3447L10.5 13L10.4391 12.6553ZM13.6781 9.49291H13.3281C13.3281 10.5655 13.0283 11.33 12.4776 11.8451L12.7167 12.1008L12.9558 12.3564C13.687 11.6724 14.0281 10.6984 14.0281 9.49291H13.6781ZM7.9751 6.12805H8.3251C8.3251 6.24476 8.23053 6.35 8.1009 6.35V6V5.65C7.83231 5.65 7.6251 5.86989 7.6251 6.12805H7.9751ZM8.1009 6V6.35H9.89799V6V5.65H8.1009V6ZM9.89799 6V6.35C10.449 6.35 10.9312 6.41618 11.3486 6.54311L11.4504 6.20825L11.5522 5.87339C11.0566 5.72265 10.5039 5.65 9.89799 5.65V6ZM11.4504 6.20825L11.3507 6.54375C11.7654 6.66701 12.1173 6.85376 12.4119 7.10107L12.637 6.833L12.862 6.56492C12.4875 6.2506 12.0484 6.02084 11.5501 5.87275L11.4504 6.20825ZM12.637 6.833L12.4147 7.10334C12.7016 7.33926 12.9264 7.65273 13.0853 8.05488L13.4108 7.9263L13.7363 7.79772C13.5387 7.29746 13.2477 6.88206 12.8593 6.56265L12.637 6.833ZM13.4108 7.9263L13.0856 8.05566C13.2441 8.45409 13.3281 8.93071 13.3281 9.49291H13.6781H14.0281C14.0281 8.86239 13.934 8.29465 13.736 7.79694L13.4108 7.9263ZM7.9751 7.21882H8.3251V6.12805H7.9751H7.6251V7.21882H7.9751ZM12.7167 12.1008L12.4776 11.8451C12.117 12.1824 11.6591 12.4177 11.0909 12.5436L11.1666 12.8853L11.2423 13.227C11.9168 13.0776 12.4923 12.7898 12.9558 12.3564L12.7167 12.1008ZM11.1666 12.8853L11.0909 12.5436C11.091 12.5435 11.0826 12.5452 11.0606 12.5493C11.041 12.5528 11.0155 12.5573 10.9857 12.5625C10.926 12.5729 10.8511 12.5857 10.7756 12.5984C10.6269 12.6236 10.472 12.6495 10.4391 12.6553L10.5 13L10.5609 13.3447C10.6064 13.3366 11.1725 13.2425 11.2423 13.227L11.1666 12.8853Z",sheet:"var(--bg-gradient-2, #885DF2)"},[je.Other]:{path:"M6.80005 8H13.2M6.80005 10.2222H13.2M6.80005 12.4444H13.2",sheet:It}},Hd=({size:e,kind:t})=>{const r=`dial-kit-file-gradient-${h.useId().replace(/[^\w-]/g,"")}`,{path:s,fillPath:a,sheet:o}=$d[t],i=typeof o=="string";return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[n.jsx("path",{d:"M17.4999 3.97859V16C17.4999 18.2091 15.709 20 13.4999 20H6.5C4.29086 20 2.5 18.2091 2.5 16V4C2.5 1.79086 4.29086 0 6.5 0H13.1683H13.5213C15.7186 0 17.4999 1.78128 17.4999 3.97859Z",fill:i?o:`url(#${r})`}),s&&n.jsx("path",{d:s,stroke:fn,strokeWidth:"0.7",strokeLinecap:"round",strokeLinejoin:"round"}),a&&n.jsx("path",{d:a,fill:fn}),!i&&n.jsx("defs",{children:n.jsxs("linearGradient",{id:r,x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:o.from}),n.jsx("stop",{offset:"1",stopColor:o.to})]})})]})},Vd=({size:e})=>{const t=`dial-kit-folder-gradient-${h.useId().replace(/[^\w-]/g,"")}`;return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[n.jsx("path",{d:"M6.38992 3.75H4.66663C3.00977 3.75 1.66663 5.09315 1.66663 6.75V7.91667H7.16339L10.8333 5.79247L7.85075 4.1297C7.40412 3.8807 6.90127 3.75 6.38992 3.75Z",fill:"var(--stroke-gradient-1, #5976E9)"}),n.jsx("path",{d:"M14.3333 5.41669C16.5424 5.41669 18.3333 7.20755 18.3333 9.41669V12.25C18.3333 14.4592 16.5424 16.25 14.3333 16.25H5.66663C3.45749 16.25 1.66663 14.4592 1.66663 12.25V7.6708C1.66663 7.11851 2.11434 6.6708 2.66663 6.6708H6.89447C7.43998 6.6708 7.97973 6.55922 8.48053 6.34291L9.86582 5.74458C10.3666 5.52827 10.9064 5.41669 11.4519 5.41669H14.3333Z",fill:`url(#${t})`}),n.jsx("defs",{children:n.jsxs("linearGradient",{id:t,x1:"17.0833",y1:"5.83335",x2:"9.38489",y2:"19.6653",gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:"var(--stroke-secondary, #D1DBEA)"}),n.jsx("stop",{offset:"0.91",stopColor:"var(--stroke-gradient-1, #5976E9)"})]})})]})},Kd=(e,t)=>(t??(e.includes(".")?e.split(".").pop():"")??"").trim().replace(/^\./,"").toLowerCase(),Gd=(e,t)=>e===v.DialItemType.Folder?"Folder":t?`${t.toUpperCase()} file`:"File",Ud=(e,t,r)=>e===v.DialItemType.Folder?n.jsx(Vd,{size:r}):n.jsx(Hd,{size:r,kind:Bd(t)}),Or=({type:e,name:t,fileExtension:r,shared:s=!1,loading:a=!1,size:o=$.DIAL_ICON_SIZE.MD,className:i,decorative:l=!1,label:c,loadingLabel:d="Loading",sharedIndicatorClassName:f,sharedIndicatorTooltip:p})=>{if(e!==v.DialItemType.File&&e!==v.DialItemType.Folder)return null;const g=e===v.DialItemType.File?Kd(t,r):"",u=Gd(e,g),m=c??(s?`${u}, shared`:u),C=l?{"aria-hidden":!0}:a?{}:{role:"img","aria-label":m};return n.jsxs("span",{className:y.mergeClasses("relative inline-flex shrink-0 items-center justify-center text-secondary",i,j.DIAL_KIT_CLASS.fileIcon),...C,children:[a?n.jsx(v.Spinner,{size:o,ariaLabel:d}):Ud(e,g,o),s&&n.jsx(hs,{tooltip:p,className:y.mergeClasses("absolute -bottom-0.5 -left-0.5",f)})]})},ms=({name:e,type:t=v.DialItemType.File,fileExtension:r,shared:s=!1,loading:a=!1,loadingLabel:o,iconSize:i,details:l,isInvalidName:c=!1,className:d,nameClassName:f,sharedIndicatorClassName:p,sharedIndicatorTooltip:g,sharedLabel:u="Shared",hideTooltip:m=!1,tooltipContent:C})=>n.jsxs("div",{className:y.mergeClasses("flex w-full min-w-0 items-center gap-2",d,j.DIAL_KIT_CLASS.fileName),children:[n.jsx(Or,{name:e,type:t,fileExtension:r,shared:s,loading:a,loadingLabel:o,size:i,sharedIndicatorClassName:p,sharedIndicatorTooltip:g,decorative:!a}),n.jsxs("div",{className:y.mergeClasses("flex min-w-0 flex-1",{"flex-col gap-1":!!l}),children:[n.jsx(k.EllipsisTooltip,{className:y.mergeClasses("dial-small-paragraph-text",c?"text-secondary":"text-primary",f),text:e,hideTooltip:m,customTooltipContent:C}),s&&n.jsx("span",{className:"sr-only",children:u}),l]})]}),Zd=({className:e,...t})=>n.jsx(ms,{...t,type:v.DialItemType.Folder,className:y.mergeClasses(e,j.DIAL_KIT_CLASS.folderName)}),Wd=({open:e,onClose:t,title:r,ariaLabel:s,onBack:a,backAriaLabel:o="Back",closeAriaLabel:i="Close",closeOnOutsideClick:l=!0,children:c,className:d,overlayClassName:f,headerClassName:p,style:g,overlayStyle:u,bodyClassName:m,titleClassName:C,portalId:x})=>{const b=j.useThemeScope(),I=`bottom-sheet-title-${h.useId()}`,{refs:N,context:T}=ee.useFloating({open:e,onOpenChange:E=>{E||t()}}),S=ee.useRole(T,{role:"dialog"}),D=ee.useDismiss(T,{outsidePress:l}),{getFloatingProps:_}=ee.useInteractions([S,D]);return e?n.jsx(ee.FloatingPortal,{id:x,children:n.jsx(ee.FloatingOverlay,{lockScroll:!0,style:u,className:y.mergeClasses("z-popup flex items-end bg-backdrop",b,f),children:n.jsx(ee.FloatingFocusManager,{context:T,initialFocus:N.floating,children:n.jsxs("div",{ref:N.setFloating,..._(),role:"dialog","aria-modal":"true","aria-labelledby":r?I:void 0,"aria-label":r?void 0:s,style:g,className:y.mergeClasses("flex max-h-[85dvh] w-full flex-col rounded-t-lg bg-layer-raised outline-none","animate-slideUp motion-reduce:animate-none",d,j.DIAL_KIT_CLASS.bottomSheet),children:[r&&n.jsxs("div",{className:y.mergeClasses("relative flex h-[60px] shrink-0 items-center justify-center border-b border-tertiary px-14",p),children:[a&&n.jsx(k.GhostIconButton,{"aria-label":o,className:"absolute start-4",onClick:a,icon:n.jsx(B.IconArrowLeft,{size:$.DIAL_ICON_SIZE.LG,stroke:ie.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),n.jsx("h2",{id:I,className:y.mergeClasses("min-w-0 truncate text-primary",C??"dial-body-semi-text"),children:r}),n.jsx(k.CloseButton,{ariaLabel:i,onClose:t,size:O.ElementSize.Standard,className:"absolute end-4"})]}),n.jsx("div",{className:y.mergeClasses("min-h-0 overflow-y-auto",m),children:c})]})})})}):null};var He=(e=>(e.Outlined="outlined",e.Filled="filled",e))(He||{}),Re=(e=>(e.Blue="blue",e.Green="green",e.Violet="violet",e.Indigo="indigo",e.Brown="brown",e.Red="red",e))(Re||{});const qd={[Re.Blue]:"bg-blue text-blue",[Re.Green]:"bg-green-2 text-green-1",[Re.Violet]:"bg-violet-2 text-violet-1",[Re.Indigo]:"bg-violet-1 text-violet-2",[Re.Brown]:"bg-brown text-brown-2",[Re.Red]:"bg-red text-red"},Yd={[He.Outlined]:"rounded-md border border-tertiary bg-layer-sunken text-secondary",[He.Filled]:"rounded-full"},Xd={[He.Outlined]:"dial-tiny-text",[He.Filled]:"dial-caption-lead-semi-text"},Qd=({label:e,variant:t=He.Outlined,color:r=Re.Blue,icon:s,textClassName:a,className:o,...i})=>n.jsxs("span",{...i,className:y.mergeClasses("inline-flex h-6 w-fit shrink-0 items-center gap-1 whitespace-nowrap px-2",Yd[t],t===He.Filled&&qd[r],o,j.DIAL_KIT_CLASS.badge),children:[s&&n.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:s}),n.jsx("span",{className:a??Xd[t],children:e})]});var at=(e=>(e.Circle="circle",e.Square="square",e))(at||{});const pn=[{background:"bg-green-1",foreground:"text-green-2"},{background:"bg-violet-2",foreground:"text-violet-1"},{background:"bg-brown",foreground:"text-brown-2"},{background:"bg-red",foreground:"text-red"},{background:"bg-green-2",foreground:"text-green-3"},{background:"bg-blue",foreground:"text-accent"},{background:"bg-violet-1",foreground:"text-violet-2"}],Jd=e=>{let t=0;for(let r=0;r<e.length;r++)t+=e.charCodeAt(r);return pn[t%pn.length]},gn=e=>e.match(new RegExp("\\p{L}","u"))?.[0]??"",xs=e=>{const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length>=2?(gn(t[0])+gn(t[1])).toUpperCase()||"?":t[0].replace(/[^\p{L}]/gu,"").slice(0,2).toUpperCase()||"?"},eu={[at.Circle]:"rounded-full",[at.Square]:"rounded-md"},bs=({name:e,initials:t,src:r,alt:s="",size:a=32,shape:o=at.Circle,className:i,textClassName:l,onImageError:c})=>{const[d,f]=h.useState(),p=!!r&&d!==r,g=s!=="",u=x=>y.mergeClasses("inline-flex shrink-0 select-none items-center justify-center overflow-hidden",eu[o],x,i,j.DIAL_KIT_CLASS.avatar);if(p)return n.jsx("img",{src:r,alt:s,width:a,height:a,className:y.mergeClasses(u(),"object-cover"),onError:x=>{f(r),c?.(x)}});const{background:m,foreground:C}=Jd(e);return n.jsx("span",{role:g?"img":void 0,"aria-label":g?s:void 0,"aria-hidden":g?void 0:!0,className:u(y.mergeClasses(m,C)),style:{width:a,height:a,fontSize:l?void 0:Math.round(a*.4)},children:n.jsx("span",{className:y.mergeClasses("leading-none",l??"font-semibold"),children:t??xs(e)})})};var he=(e=>(e.Model="model",e.Agent="agent",e.Toolset="toolset",e.Skill="skill",e.Prompt="prompt",e))(he||{});const tu={[he.Model]:"Model",[he.Agent]:"Agent",[he.Toolset]:"Toolset",[he.Skill]:"Skill",[he.Prompt]:"Prompt"},hn={[he.Model]:"text-blue",[he.Agent]:"text-green-1",[he.Toolset]:"text-brown-2",[he.Skill]:"text-violet-1",[he.Prompt]:"text-violet-2"},ru={[he.Model]:"bg-blue",[he.Agent]:"bg-green-2",[he.Toolset]:"bg-brown",[he.Skill]:"bg-violet-2",[he.Prompt]:"bg-violet-1"},nu=["h1","h2","h3","h4","h5","h6"],su=e=>nu[Math.min(6,Math.max(1,Math.round(e)))-1],au=({item:e,labels:t,showVersion:r=!0,hasFeaturedTag:s=!0,iconSize:a=48,headingLevel:o=3,query:i,footer:l,statusBadge:c,className:d,nameClassName:f="dial-h3-text",typeClassName:p="dial-caption-lead-semi-text",versionClassName:g="dial-tiny-text",iconClassName:u,featuredChipClassName:m})=>{const C=su(o),x=s&&!!e.isFeatured,b=c!=null||x,I=r?e.version:void 0;return n.jsxs("div",{className:y.mergeClasses("flex items-start gap-2",d,j.DIAL_KIT_CLASS.entityIdentity),children:[n.jsx(bs,{name:e.name,src:e.iconUrl,size:a,shape:at.Square,className:y.mergeClasses("rounded-[14px]",u)}),n.jsxs("div",{className:y.mergeClasses("flex min-w-0 flex-1 flex-col gap-1",l!=null&&"self-stretch"),children:[n.jsxs("div",{className:"relative flex items-center justify-between",children:[n.jsx("span",{className:y.mergeClasses("uppercase",p,hn[e.type]),children:t?.type??tu[e.type]}),b&&n.jsxs("div",{className:"absolute end-0 top-[-6px] flex items-center gap-2",children:[c,x&&n.jsx("span",{className:y.mergeClasses("flex h-6 items-center justify-center rounded-2xl px-2","dial-caption-lead-semi-text",ru[e.type],hn[e.type],m),children:t?.featured??"Featured"})]})]}),n.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[n.jsx(C,{className:y.mergeClasses("min-w-0 shrink text-primary",f),children:i?n.jsx(Jn,{text:e.name,query:i,maxLines:1}):n.jsx(k.EllipsisTooltip,{text:e.name})}),I!=null&&n.jsx(k.EllipsisTooltip,{className:y.mergeClasses("max-w-[30%] shrink-0 text-secondary",g),text:I})]}),l!=null&&n.jsx("div",{className:"mt-auto pt-1",children:l})]})]})},ou=({open:e,onClose:t,header:r,ariaLabel:s,headerActions:a,onBack:o,backAriaLabel:i="Back",backDisabled:l=!1,closeAriaLabel:c="Close",closeDisabled:d=!1,hideClose:f=!1,closeOnOutsideClick:p=!0,children:g,className:u,overlayClassName:m,headerClassName:C,style:x,overlayStyle:b,bodyClassName:I,titleClassName:N,portalId:T})=>{const S=j.useThemeScope(),D=`side-drawer-title-${h.useId()}`,_=typeof r=="string",{refs:E,context:A}=ee.useFloating({open:e,onOpenChange:K=>{K||t()}}),L=ee.useRole(A,{role:"dialog"}),w=ee.useDismiss(A,{outsidePress:p}),{getFloatingProps:M}=ee.useInteractions([L,w]),F=r!=null||o!=null||!f;return n.jsx(ee.FloatingPortal,{id:T,children:n.jsx(ee.FloatingOverlay,{lockScroll:e,style:b,className:y.mergeClasses("z-popup bg-backdrop transition-opacity duration-300 motion-reduce:transition-none",e?"opacity-100":"pointer-events-none opacity-0",S,m),children:n.jsx(ee.FloatingFocusManager,{context:A,disabled:!e,initialFocus:E.floating,children:n.jsxs("div",{ref:E.setFloating,...M(),role:"dialog","aria-modal":"true","aria-labelledby":_?D:void 0,"aria-label":_?void 0:s,inert:!e,style:x,className:y.mergeClasses("fixed inset-y-0 end-0 flex w-full flex-col overflow-hidden bg-layer-raised outline-none","desktop:w-[540px] desktop:rounded-s-xl desktop:border-s desktop:border-secondary","transition-transform duration-300 motion-reduce:transition-none",e?"translate-x-0":"translate-x-full rtl:-translate-x-full",u,j.DIAL_KIT_CLASS.sideDrawer),children:[F&&n.jsxs("div",{className:y.mergeClasses("flex shrink-0 items-center gap-2 border-b border-tertiary px-6 py-3",C),children:[o&&n.jsx(k.GhostIconButton,{"aria-label":i,disabled:l,onClick:o,icon:n.jsx(B.IconChevronLeft,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),_?n.jsx("h2",{id:D,className:y.mergeClasses("min-w-0 flex-1 truncate text-primary",N??"dial-h2-text"),children:r}):n.jsx("div",{className:"min-w-0 flex-1",children:r}),a,!f&&n.jsx(k.CloseButton,{ariaLabel:c,onClose:t,disabled:d,size:O.ElementSize.Standard})]}),n.jsx("div",{className:y.mergeClasses("min-h-0 flex-1 overflow-y-auto",I),children:g})]})})})})},iu=4,lu=24,mn=e=>parseFloat(e)||0,cu=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},du=()=>{},uu=({id:e,value:t,defaultValue:r,size:s=O.ElementSize.Standard,labelProps:a,placeholder:o,caption:i,error:l,invalid:c,disabled:d=!1,readOnly:f=!1,collapseTagOverflow:p=!1,ariaLabel:g,tagListLabel:u="Tags",className:m,fieldClassName:C,tagClassName:x,onChange:b})=>{const I=h.useId(),N=e||I,T=s===O.ElementSize.Small,S=h.useRef(null),D=h.useRef([]),_=h.useRef(null),E=t!==void 0,[A,L]=h.useState(r??[]),w=E?t:A,M=w.length,[F,K]=h.useState(""),[te,G]=h.useState(M),z=!f&&!d,H=h.useCallback(W=>{E||L(W),b?.(W)},[E,b]),q=h.useCallback(W=>Q=>{D.current[W]=Q},[]),U=h.useCallback(()=>{const W=S.current;if(!W||W.clientWidth===0){G(w.length);return}const{paddingLeft:Q,paddingRight:we}=getComputedStyle(W);G(us({availableWidth:W.clientWidth-mn(Q)-mn(we)-(f?0:lu),tagWidths:w.map((ke,X)=>D.current[X]?.offsetWidth??0),overflowChipWidth:_.current?.offsetWidth??0,gap:iu}))},[f,w]);h.useEffect(()=>{if(!p){G(M);return}const W=S.current;if(!W)return;const Q=new ResizeObserver(()=>U());return Q.observe(W),U(),()=>Q.disconnect()},[p,U,M]);const ae=y.mergeClasses(p?"shrink-0":"min-w-0",x),Y=W=>{const Q=cu(W.trim()).trim();!Q||w.includes(Q)||H([...w,Q])},Z=W=>{H(w.filter(Q=>Q!==W))},re=()=>{Y(F),K("")},oe=W=>{if(z){if(W.key==="Enter"||W.key===","){W.preventDefault(),re();return}W.key==="Backspace"&&!F&&M>0&&(W.preventDefault(),H(w.slice(0,-1)))}},le=()=>{z&&F.trim()&&re()},ue=p?w.slice(0,te):w,me=p?w.slice(te):[],Ce=me.join(", "),ge=M>0&&n.jsxs("span",{role:"list","aria-label":u,className:y.mergeClasses("relative flex min-w-0 items-center gap-1",p?"flex-nowrap":"flex-wrap"),children:[ue.map(W=>n.jsx(Ae,{role:"listitem",label:W,className:ae,disabled:d,closable:z,onRemove:z?()=>Z(W):void 0},W)),me.length>0&&n.jsx(Ae,{role:"listitem",label:`+${me.length}`,"aria-label":Ce,title:Ce,className:y.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:[w.map((W,Q)=>n.jsx("span",{ref:q(Q),className:"inline-flex",children:n.jsx(Ae,{label:W,className:x,disabled:d,closable:z,onRemove:z?du:void 0})},W)),n.jsx("span",{ref:_,className:"inline-flex",children:n.jsx(Ae,{label:`+${M}`,className:x})})]})]});return n.jsx($e,{id:N,size:s,labelProps:a,caption:i,error:l,invalid:c,disabled:d,readOnly:f,value:F,placeholder:M>0?void 0:o,"aria-label":g,wrapperRef:S,onChange:W=>K(W??""),onKeyDown:oe,onBlur:le,containerClassName:y.mergeClasses("w-full",m),wrapperClassName:y.mergeClasses(M>0&&["!h-auto",T?"min-h-[24px] py-0.5":"min-h-[40px] py-[3px]",p?"flex-nowrap overflow-hidden":"flex-wrap"],C,j.DIAL_KIT_CLASS.tagInput),className:y.mergeClasses("w-auto flex-1",p?"min-w-[24px]":"min-w-[100px]",f&&"cursor-default"),children:ge})},fu=(e,t,r,s)=>{const a=t.trim().toLowerCase(),o=new Set(r);return e.filter(({value:i,label:l,description:c})=>!o.has(i)&&[l,i,c].some(d=>d?.toLowerCase().includes(a))).slice(0,Math.max(s,0))},pu=5,gu=({id:e,value:t,defaultValue:r,suggestions:s,maxSuggestions:a=pu,size:o=O.ElementSize.Standard,labelProps:i,placeholder:l,caption:c,error:d,invalid:f=!1,disabled:p=!1,readOnly:g=!1,ariaLabel:u,tagListLabel:m="Tags",getRemoveTagLabel:C,className:x,fieldClassName:b,tagClassName:I,listClassName:N,onChange:T})=>{const S=h.useId(),D=e||S,_=`${D}-listbox`,E=j.useThemeScope(),A=o===O.ElementSize.Small,L=t!==void 0,[w,M]=h.useState(r??[]),F=L?t:w,K=F.length>0,te=!g&&!p,[G,z]=h.useState(""),[H,q]=h.useState(!1),[U,ae]=h.useState(0),Y=h.useMemo(()=>fu(s,G,F,a),[G,a,s,F]),Z=H&&te&&Y.length>0,re=Math.min(U,Y.length-1),oe=X=>`${_}-option-${X}`,{refs:le,floatingStyles:ue}=ee.useFloating({open:Z,placement:"bottom-start",whileElementsMounted:ee.autoUpdate,middleware:[ee.offset(k.overlayGap),ee.flip({padding:k.overlayGap}),ee.size({padding:k.overlayGap,apply({rects:X,availableHeight:de,elements:Ee}){Ee.floating.style.width=`${Math.round(X.reference.width)}px`,Ee.floating.style.maxHeight=`${Math.floor(de)}px`}})]}),me=h.useCallback(X=>{L||M(X),T?.(X)},[L,T]),Ce=()=>{q(!1),ae(0)},ge=X=>{const de=X.trim();de&&!F.includes(de)&&me([...F,de]),z(""),Ce()},W=X=>me(F.filter(de=>de!==X)),Q=X=>{const de=X??"";z(de),q(!!de.trim()),ae(0)},we=X=>{if(te)switch(X.key){case"ArrowDown":case"ArrowUp":{if(X.preventDefault(),q(!0),!Z)return;const de=X.key==="ArrowDown"?1:-1;ae((re+de+Y.length)%Y.length);return}case"Enter":case",":X.preventDefault(),ge(Z?Y[re].value:G);return;case"Escape":Z&&X.preventDefault(),Ce();return;case"Backspace":!G&&K&&(X.preventDefault(),me(F.slice(0,-1)));return}},ke=X=>X.preventDefault();return n.jsxs(n.Fragment,{children:[n.jsx($e,{id:D,role:"combobox","aria-autocomplete":"list","aria-expanded":Z,"aria-controls":_,"aria-activedescendant":Z?oe(re):void 0,"aria-invalid":f||void 0,"aria-label":u,size:o,labelProps:i,caption:c,error:d,invalid:f,disabled:p,readOnly:g,value:G,placeholder:K?void 0:l,wrapperRef:le.setReference,onChange:Q,onKeyDown:we,onBlur:Ce,containerClassName:y.mergeClasses("w-full",x),wrapperClassName:y.mergeClasses(K&&["!h-auto flex-wrap gap-1 py-2",A?"min-h-[24px]":"min-h-[40px]"],b,j.DIAL_KIT_CLASS.autocompleteTagInput),className:y.mergeClasses("w-auto min-w-[100px] flex-1",g&&"cursor-default"),children:K&&n.jsx("span",{role:"list","aria-label":m,className:"flex min-w-0 flex-wrap items-center gap-1",children:F.map(X=>n.jsx(Ae,{role:"listitem",label:X,className:y.mergeClasses(At,"min-w-0",I),disabled:p,closable:te,removeLabel:C?.(X),onRemove:te?()=>W(X):void 0},X))})}),n.jsx(ee.FloatingPortal,{children:n.jsx("div",{ref:le.setFloating,id:_,role:"listbox","aria-label":m,hidden:!Z,style:ue,className:y.mergeClasses("z-floating overflow-y-auto",k.overlaySurfaceClassName,k.overlayListClassName,!Z&&"hidden",E,N),children:Z&&Y.map((X,de)=>{const Ee=de===re;return n.jsx(k.MenuItem,{id:oe(de),role:"option","aria-selected":Ee,tabIndex:-1,label:X.label,description:X.description,mark:k.MenuItemMark.Tint,selected:Ee,onMouseDown:ke,onMouseEnter:()=>ae(de),onClick:()=>ge(X.value)},X.value)})})})]})},hu={[O.ElementSize.Small]:$.DIAL_ICON_SIZE.SM,[O.ElementSize.Standard]:$.DIAL_ICON_SIZE.MD,[O.ElementSize.Large]:$.DIAL_ICON_SIZE.MD},mu=({size:e=O.ElementSize.Standard,placeholder:t="Search...",withoutBorder:r=!1,clearLabel:s="Clear search",disabled:a,value:o,onChange:i,wrapperClassName:l,inputRef:c,...d})=>{const f=h.useRef(null),p=ee.useMergeRefs([c,f]),g=!!o&&!a,u=h.useCallback(()=>{i?.(void 0),f.current?.focus()},[i]);return n.jsx($e,{...d,size:e,value:o,disabled:a,onChange:i,placeholder:t,inputRef:p,wrapperClassName:y.mergeClasses(r&&"dial-kit-input-borderless",l,j.DIAL_KIT_CLASS.search),iconBefore:n.jsx(B.IconSearch,{size:hu[e],stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":"true"}),iconAfter:g?n.jsx(k.GhostIconButton,{size:O.ElementSize.Small,"aria-label":s,icon:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:u}):void 0})},xu=16,bu=e=>(e.toString().split(".")[1]??"").length,Cu=({id:e,value:t,min:r=0,max:s=1,step:a=.1,disabled:o,labelProps:i,labels:l,formatValue:c,showValue:d=!1,caption:f,error:p,onChange:g,containerClassName:u,trackClassName:m,fillClassName:C,className:x,...b})=>{const I=h.useId(),N=e??I,T=f&&!p?`${N}-caption`:void 0,S=p?`${N}-error`:void 0,D=s-r,_=D>0?Math.min(100,Math.max(0,(t-r)/D*100)):0,E=`calc(${_}% + ${(.5-_/100)*xu}px)`,A=c?c(t):t.toFixed(bu(a)),L=h.useCallback(w=>{g?.(Number(w.target.value))},[g]);return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-2",u),children:[(i||d)&&n.jsxs("div",{className:"flex items-center gap-2",children:[i&&n.jsx(k.Label,{...i,htmlFor:N}),d&&n.jsx("span",{"aria-hidden":"true",className:y.mergeClasses("dial-small-text ml-auto",o?"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:y.mergeClasses("pointer-events-none absolute inset-x-0 h-1 rounded-full",o?"bg-control-disable-primary":"bg-control-neutral-active",m)}),n.jsx("div",{className:y.mergeClasses("pointer-events-none absolute left-0 h-1 rounded-full",o?"bg-control-disable-secondary":"bg-control-accent",C),style:{width:E}}),n.jsx("input",{...b,type:"range",id:N,value:t,min:r,max:s,step:a,disabled:o,onChange:L,"aria-label":O.resolveAccessibleName(typeof i?.label!="string"?b["aria-label"]:void 0),"aria-valuetext":c?A:void 0,"aria-describedby":S??T,className:y.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(Ke,{id:S,text:p}),!p&&n.jsx(Ve,{id:T,text:f})]})]})},vu=48,yu=({children:e,title:t,width:r=280,collapsedWidth:s=vu,isOpened:a,defaultOpened:o=!0,onToggle:i,additionalButtons:l,ariaLabel:c="Sidebar",collapseLabel:d="Collapse sidebar",expandLabel:f="Expand sidebar",className:p,titleClassName:g,contentClassName:u,footerClassName:m})=>{const C=a!==void 0,[x,b]=h.useState(o),I=C?a:x,N=`collapsible-sidebar-content-${h.useId()}`,T=I?d:f,S=D=>{const _=!I;C||b(_),i?.(_,D)};return n.jsxs("aside",{"aria-label":c,style:{width:`${I?r:s}px`},className:y.mergeClasses("flex flex-col justify-between",p,j.DIAL_KIT_CLASS.collapsibleSidebar),children:[n.jsx("div",{id:N,hidden:!I,className:y.mergeClasses("min-h-0 flex-1 overflow-auto p-4",u),children:e}),n.jsx("div",{hidden:I,className:y.mergeClasses("rotate-180 px-3 py-4 [writing-mode:tb-rl] dial-small-text text-primary",g),children:t}),n.jsxs("div",{className:y.mergeClasses("flex h-12 shrink-0 flex-row items-center gap-2 border-t border-tertiary py-1",I?"justify-end px-2":"justify-center",m),children:[I&&l,n.jsx(k.IconButton,{variant:O.ButtonVariant.Primary,appearance:O.ButtonAppearance.Ghost,size:O.ElementSize.Standard,onClick:S,"aria-label":T,"aria-expanded":I,"aria-controls":N,tooltipProps:{tooltip:T},icon:I?n.jsx(B.IconChevronsLeft,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx(B.IconChevronsRight,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})},Iu=({side:e,isResizing:t,width:r,minWidth:s,maxWidth:a,step:o,ariaLabel:i,onWidthChange:l,customHandler:c,handlerClassName:d})=>{const f=e===v.ResizableContainerSide.Left,p=f?B.IconChevronLeft:B.IconChevronRight,g=u=>{let m;switch(u.key){case"ArrowLeft":m=r+(f?o:-o);break;case"ArrowRight":m=r+(f?-o:o);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":i,"aria-valuenow":r,"aria-valuemin":s,"aria-valuemax":a,tabIndex:0,onKeyDown:g,className:y.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:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:y.mergeClasses("pointer-events-none absolute top-1/2 -translate-y-1/2",f?"right-full":"left-full")})})},Su=16,Cs=({children:e,minWidth:t,maxWidth:r,width:s,defaultWidth:a,onResizeStop:o,onResize:i,side:l=v.ResizableContainerSide.Right,keyboardStep:c=Su,ariaLabel:d="Resize panel",className:f,resizeHandlerClassName:p,resizeHandler:g})=>{const[u,m]=h.useState(!1),[C,x]=h.useState(a??t),b=s!==void 0,I=b?s:C,N=h.useRef(null),T=h.useCallback(()=>{m(!0)},[]),S=h.useCallback(()=>{m(!1);const E=N.current?.resizable?.getBoundingClientRect(),A=E?Math.round(E.width):t;b||x(A),o?.(A)},[o,b,t]),D=h.useCallback(E=>{const A=Math.min(r,Math.max(t,E));A!==I&&(b||(x(A),N.current?.updateSize({width:A,height:"100%"})),i?.(A),o?.(A))},[r,t,I,b,i,o]),_=h.useMemo(()=>{const E=l===v.ResizableContainerSide.Left,A=n.jsx(Iu,{side:l,isResizing:u,width:I,minWidth:t,maxWidth:r,step:c,ariaLabel:d,onWidthChange:D,customHandler:g,handlerClassName:p});return{size:b?{width:I,height:"100%"}:void 0,defaultSize:b?void 0:{width:I,height:"100%"},minWidth:t,maxWidth:r,enable:{left:E,right:!E},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:E?A:void 0,right:E?void 0:A},onResizeStart:T,onResize:(L,w,M)=>{i?.(Math.round(M.offsetWidth))},onResizeStop:S}},[l,b,I,t,r,c,d,D,g,p,u,T,S,i]);return n.jsx(v.Resizable,{ref:N,..._,children:n.jsx("div",{className:y.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",f,j.DIAL_KIT_CLASS.resizableContainer),children:e})})},Du=({enabled:e=!0,children:t,...r})=>e?n.jsx(Cs,{...r,children:t}):t;var Oe=(e=>(e.InProgress="inProgress",e.Success="success",e.Warning="warning",e.Failed="failed",e.Canceled="canceled",e))(Oe||{});const vs=8e3,xt="flex size-7 shrink-0 items-center justify-center",ys={cancelItemAriaLabel:e=>`Cancel "${e}"`,itemProgressAriaLabel:e=>`"${e}" in progress`,successLabel:"Completed",canceledLabel:"Canceled",failedMessage:"Failed",warningMessage:"Completed with warnings",queueProgressAriaLabel:"Progress",queueProgressValueText:(e,t)=>`${e} of ${t}`,collapseAriaLabel:"Collapse",expandAriaLabel:"Expand",closeAriaLabel:"Close",closeConfirmHeader:"Close?",closeConfirmDescriptionInProgress:"Some items are still in progress.",closeConfirmDescriptionFailed:"Some items have failed.",closeConfirmDescriptionMixed:"Some items are still in progress, and some have failed.",closeConfirmLabel:"Close",closeCancelLabel:"Cancel"},Nu=({title:e,failedCount:t,isCollapsed:r,itemsId:s,labels:a,onToggleCollapse:o,onClose:i})=>{const l=r?B.IconChevronUp:B.IconChevronDown;return n.jsxs("div",{className:"mx-4 flex items-center justify-between border-b border-tertiary py-3",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[n.jsx("span",{className:"dial-small-paragraph-semi-text truncate text-primary",children:e}),t>0&&n.jsx("span",{className:"dial-small-paragraph-semi-text inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-control-error px-1 text-control-permanent",children:t})]}),n.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[n.jsx(k.GhostIconButton,{"aria-label":r?a.expandAriaLabel:a.collapseAriaLabel,"aria-expanded":!r,"aria-controls":s,size:O.ElementSize.Small,icon:n.jsx(l,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:o,className:xt}),n.jsx(k.GhostIconButton,{"aria-label":a.closeAriaLabel,size:O.ElementSize.Small,icon:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:i,className:xt})]})]})},xn=({message:e,isError:t})=>{const r=t?B.IconAlertCircleFilled:B.IconAlertTriangleFilled;return n.jsx(k.Tooltip,{tooltip:e,asChild:!0,children:n.jsx("span",{className:xt,role:"img","aria-label":e,tabIndex:0,children:n.jsx(r,{size:$.DIAL_ICON_SIZE.SM,className:t?"text-error":"text-warning-icon","aria-hidden":!0})})})},ju=({item:e,labels:t,onCancel:r})=>{const s=e.status===Oe.Canceled;return n.jsxs("div",{className:"group flex items-center gap-2 px-4 py-2",children:[n.jsx(Or,{type:v.DialItemType.File,name:e.name,size:$.DIAL_ICON_SIZE.MD,className:y.mergeClasses(s&&"opacity-50"),decorative:!0}),n.jsx(k.EllipsisTooltip,{text:e.name,className:y.mergeClasses("dial-small-text",s?"text-secondary":"text-primary")}),e.status===Oe.InProgress&&n.jsxs("div",{className:y.mergeClasses(xt,"grid"),children:[n.jsx(v.Spinner,{size:$.DIAL_ICON_SIZE.SM,ariaLabel:t.itemProgressAriaLabel(e.name),className:y.mergeClasses("pointer-events-none col-start-1 row-start-1 transition-opacity",r&&"group-focus-within:opacity-0 group-hover:opacity-0")}),r&&n.jsx(k.GhostIconButton,{"aria-label":t.cancelItemAriaLabel(e.name),size:O.ElementSize.Small,icon:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:()=>r(e.id),className:"col-start-1 row-start-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100"})]}),e.status===Oe.Success&&n.jsx("span",{className:xt,role:"img","aria-label":t.successLabel,children:n.jsx(B.IconCheck,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-accent","aria-hidden":!0})}),e.status===Oe.Warning&&n.jsx(xn,{message:e.message||t.warningMessage,isError:!1}),e.status===Oe.Failed&&n.jsx(xn,{message:e.message||t.failedMessage,isError:!0}),s&&n.jsx("span",{className:"dial-small-text shrink-0 text-secondary",children:t.canceledLabel})]})},Tu=e=>Math.round(e.reduce((t,r)=>t+(r.percent??(r.status===Oe.InProgress?0:100)),0)/e.length),wu=(e,t,r)=>e&&t?r.closeConfirmDescriptionMixed:t?r.closeConfirmDescriptionFailed:r.closeConfirmDescriptionInProgress,Eu=({title:e,items:t,onClose:r,onCancelItem:s,labels:a,autoCloseDelay:o=vs,className:i,bodyClassName:l})=>{const[c,d]=h.useState(!1),[f,p]=h.useState(!1),g=h.useId(),u={...ys,...a},m=t.filter(D=>D.status===Oe.InProgress).length,C=m>0,x=t.filter(D=>D.status===Oe.Failed).length,b=x>0,I=t.length>0&&t.every(D=>D.status===Oe.Success),N=h.useCallback(()=>{C||b?p(!0):r()},[C,b,r]),T=h.useCallback(()=>{p(!1),r()},[r]),S=h.useCallback(()=>{d(D=>!D)},[]);return h.useEffect(()=>{if(!I||o<=0)return;const D=setTimeout(r,o);return()=>clearTimeout(D)},[I,o,r]),t.length===0?null:n.jsxs("div",{role:"status","aria-live":"polite",className:y.mergeClasses("w-[370px] max-w-[calc(100vw-2rem)] rounded-xl bg-layer-raised shadow-md",i,j.DIAL_KIT_CLASS.transferQueue),children:[n.jsx(Nu,{title:e,failedCount:x,isCollapsed:c,itemsId:g,labels:u,onToggleCollapse:S,onClose:N}),c&&C&&n.jsx(yn,{value:Tu(t),size:O.ElementSize.Small,"aria-label":u.queueProgressAriaLabel,"aria-valuetext":u.queueProgressValueText(t.length-m,t.length)}),!c&&n.jsx("div",{id:g,className:y.mergeClasses("flex max-h-[40vh] flex-col overflow-y-auto py-1",l),children:t.map(D=>n.jsx(ju,{item:D,labels:u,onCancel:s},D.id))}),n.jsx(ps,{open:f,header:u.closeConfirmHeader,description:wu(C,b,u),confirmLabel:u.closeConfirmLabel,cancelLabel:u.closeCancelLabel,variant:v.ConfirmationPopupVariant.Danger,onConfirm:T,onClose:()=>p(!1)})]})};exports.ConfirmationPopupVariant=v.ConfirmationPopupVariant;exports.DialBreadcrumb=v.DialBreadcrumb;exports.DialBreadcrumbItem=v.DialBreadcrumbItem;exports.DialButton=v.DialButton;exports.DialButtonDropdown=v.DialButtonDropdown;exports.DialCaptionText=v.DialCaptionText;exports.DialCollapsibleSidebar=v.DialCollapsibleSidebar;exports.DialConditionalResizableContainer=v.DialConditionalResizableContainer;exports.DialConfirmationPopup=v.DialConfirmationPopup;exports.DialDangerButton=v.DialDangerButton;exports.DialDestinationFolderPopup=v.DialDestinationFolderPopup;exports.DialErrorText=v.DialErrorText;exports.DialFileIcon=v.DialFileIcon;exports.DialFileManager=v.DialFileManager;exports.DialFileManagerActions=v.DialFileManagerActions;exports.DialFileManagerTabs=v.DialFileManagerTabs;exports.DialFileName=v.DialFileName;exports.DialFileNodeType=v.DialFileNodeType;exports.DialFilePermission=v.DialFilePermission;exports.DialFileResourceType=v.DialFileResourceType;exports.DialFolderName=v.DialFolderName;exports.DialFoldersTree=v.DialFoldersTree;exports.DialFormItem=v.DialFormItem;exports.DialGhostButton=v.DialGhostButton;exports.DialInput=v.DialInput;exports.DialItemType=v.DialItemType;exports.DialLinkButton=v.DialLinkButton;exports.DialLoader=v.DialLoader;exports.DialNeutralButton=v.DialNeutralButton;exports.DialNotification=v.DialNotification;exports.DialPopup=v.DialPopup;exports.DialPrimaryButton=v.DialPrimaryButton;exports.DialRadioGroup=v.DialRadioGroup;exports.DialResizableContainer=v.DialResizableContainer;exports.DialSearch=v.DialSearch;exports.DialSharedEntityIndicator=v.DialSharedEntityIndicator;exports.DialTabs=v.DialTabs;exports.EDITABLE_CONTAINER_ATTRIBUTE=v.EDITABLE_CONTAINER_ATTRIBUTE;exports.FileManagerColumnKey=v.FileManagerColumnKey;exports.FileManagerProvider=v.FileManagerProvider;exports.FlexibleActionsDirection=v.FlexibleActionsDirection;exports.FormItemOrientation=v.FormItemOrientation;exports.NAME_COLUMN=v.NAME_COLUMN;exports.NOT_ALLOWED_SPACES=v.NOT_ALLOWED_SPACES;exports.NOT_ALLOWED_SPACES_REGEXP=v.NOT_ALLOWED_SPACES_REGEXP;exports.NOT_ALLOWED_SYMBOLS=v.NOT_ALLOWED_SYMBOLS;exports.NOT_ALLOWED_SYMBOLS_REGEXP=v.NOT_ALLOWED_SYMBOLS_REGEXP;exports.NotificationType=v.NotificationType;exports.NotificationVariant=v.NotificationVariant;exports.PopupSize=v.PopupSize;exports.RadioGroupOrientation=v.RadioGroupOrientation;exports.ResizableContainerSide=v.ResizableContainerSide;exports.SIZE_COLUMN=v.SIZE_COLUMN;exports.ScreenResolution=v.ScreenResolution;exports.Skeleton=v.Skeleton;exports.SkeletonAvatarShape=v.SkeletonAvatarShape;exports.SkeletonAvatarSize=v.SkeletonAvatarSize;exports.SkeletonVariant=v.SkeletonVariant;exports.Spinner=v.Spinner;exports.TabOrientation=v.TabOrientation;exports.TabView=v.TabView;exports.UPDATED_AT_COLUMN=v.UPDATED_AT_COLUMN;exports.editableContainerProps=v.editableContainerProps;exports.useDialFileManagerTabs=v.useDialFileManagerTabs;exports.useEditableItem=v.useEditableItem;exports.useFileManagerContext=v.useFileManagerContext;exports.DialLabel=Be.DialLabel;exports.DialSwitch=Be.DialSwitch;exports.DEFAULT_GRID_DATE_FORMAT_OPTIONS=j.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_GRID_DATE_LOCALE=j.DEFAULT_LOCALE;exports.DIAL_KIT_CLASS=j.DIAL_KIT_CLASS;exports.DialCloseButton=j.DialCloseButton;exports.DialDangerIconButton=j.DialDangerIconButton;exports.DialDateCellRenderer=j.DialDateCellRenderer;exports.DialDropdown=j.DialDropdown;exports.DialEllipsisTooltip=j.DialEllipsisTooltip;exports.DialGhostIconButton=j.DialGhostIconButton;exports.DialGrid=j.DialGrid;exports.DialIcon=j.DialIcon;exports.DialNeutralIconButton=j.DialNeutralIconButton;exports.DialNoDataContent=j.DialNoDataContent;exports.DialPrimaryIconButton=j.DialPrimaryIconButton;exports.DialRadioButton=j.DialRadioButton;exports.DialSecondaryIconButton=j.DialSecondaryIconButton;exports.DialSuccessIconButton=j.DialSuccessIconButton;exports.DialTertiaryIconButton=j.DialTertiaryIconButton;exports.DropdownItemType=j.DropdownItemType;exports.DropdownTrigger=j.DropdownTrigger;exports.DropdownType=j.DropdownType;exports.GridSelectionMode=j.GridSelectionMode;exports.ThemeScope=j.ThemeScope;exports.baseColumnComparator=j.baseColumnComparator;exports.checkColDefsChanges=j.checkColDefsChanges;exports.convertGridDateToDate=j.convertToDate;exports.convertToDate=j.convertToDate;exports.useThemeScope=j.useThemeScope;exports.BASE_ICON_PROPS=$.BASE_ICON_PROPS;exports.BASE_ICON_SIZE=$.BASE_ICON_SIZE;exports.DIAL_ICON_SIZE=$.DIAL_ICON_SIZE;exports.mergeClasses=y.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=O.ButtonAppearance;exports.ButtonVariant=O.ButtonVariant;exports.DialIconButton=O.DialIconButton;exports.DialTooltip=O.DialTooltip;exports.DialTooltipContainer=O.DialTooltipContainer;exports.DialTooltipContent=O.DialTooltipContent;exports.DialTooltipTrigger=O.DialTooltipTrigger;exports.ElementSize=O.ElementSize;exports.EditorThemes=bt.EditorThemes;exports.LazyDialJsonEditor=bt.LazyDialJsonEditor;exports.LazyDialMarkdownEditor=bt.LazyDialMarkdownEditor;exports.LazyMarkdownEditor=bt.LazyMarkdownEditor;exports.DIAL_KIT_ICON_STROKE=ie.DIAL_KIT_ICON_STROKE;exports.Accordion=ad;exports.AccordionCaretPosition=_t;exports.AnalyticsCardVariant=gt;exports.AutocompleteTagInput=gu;exports.Avatar=bs;exports.AvatarShape=at;exports.Badge=Qd;exports.BadgeColor=Re;exports.BadgeVariant=He;exports.BottomSheet=Wd;exports.Breadcrumbs=nc;exports.BreadcrumbsSize=We;exports.Button=Xe;exports.ButtonDropdown=uc;exports.Calendar=Vl;exports.CalendarMode=Se;exports.CaptionText=Ve;exports.CardShell=hl;exports.CollapsibleSidebar=yu;exports.ConditionalResizableContainer=Du;exports.ConfirmationPopup=ps;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=gr;exports.DEFAULT_TRANSFER_QUEUE_LABELS=ys;exports.DangerButton=sc;exports.DialAccordion=bn;exports.DialAnalyticsBar=St;exports.DialAnalyticsBarGroup=ks;exports.DialAnalyticsCard=As;exports.DialAnalyticsErrorTag=pr;exports.DialAnalyticsHistogram=Bs;exports.DialAutocompleteInputValue=kn;exports.DialCheckbox=sr;exports.DialDraggableItem=Jo;exports.DialDropdownIcon=Vi;exports.DialFormPopup=fi;exports.DialInputPopup=Rn;exports.DialLabelledText=Ys;exports.DialLoadFileArea=Kn;exports.DialLoadFileAreaField=Hi;exports.DialNumberInput=cr;exports.DialPagination=Ks;exports.DialPasswordInput=Mn;exports.DialRadioGroupPopupField=li;exports.DialRemoveButton=Ft;exports.DialSchemaRenderer=cl;exports.DialSegmentedControl=oi;exports.DialSelect=_e;exports.DialSelectField=Di;exports.DialSlider=qs;exports.DialSteps=Ws;exports.DialTag=Ue;exports.DialTagInput=Ln;exports.DialTextarea=ei;exports.EntityIdentity=au;exports.EntityType=he;exports.ErrorMessageNotification=Il;exports.ErrorText=Ke;exports.ErrorToastNotification=ml;exports.FabButton=cc;exports.FileDropzone=Md;exports.FileIcon=Or;exports.FileName=ms;exports.FilterChips=Rd;exports.FolderName=Zd;exports.FolderPath=Kl;exports.GeneralMessageNotification=Tl;exports.GeneralToastNotification=yl;exports.GhostButton=ic;exports.Highlight=Jn;exports.InfoMessageNotification=Sl;exports.InfoToastNotification=xl;exports.InlineSelect=fc;exports.InlineSelectTrigger=is;exports.Input=$e;exports.JsonSchemaType=V;exports.LinkButton=oc;exports.LoadingMessageNotification=jl;exports.LoadingToastNotification=vl;exports.MultiSelectTags=pt;exports.NeutralButton=wr;exports.Notification=Nr;exports.NumberInput=Gc;exports.OutlinedButton=lc;exports.PasswordInput=$c;exports.Popup=Er;exports.PrimaryButton=os;exports.ProgressBar=yn;exports.RadioGroup=gs;exports.RadioGroupPopupField=Cd;exports.ResizableContainer=Cs;exports.SchemaDisplayMode=ht;exports.SchemaOrientation=zt;exports.SchemaRendererVariant=st;exports.Search=mu;exports.SegmentedControl=Od;exports.Select=Fc;exports.SelectSize=Tt;exports.SelectVariant=wt;exports.SharedEntityIndicator=hs;exports.SideDrawer=ou;exports.Slider=Cu;exports.StarterButton=ac;exports.StepStatus=De;exports.SuccessMessageNotification=Dl;exports.SuccessToastNotification=bl;exports.Switch=od;exports.TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS=vs;exports.Tabs=_d;exports.Tag=Ae;exports.TagAppearance=qe;exports.TagInput=uu;exports.Textarea=zc;exports.TextareaResize=fs;exports.ToggleIconButton=vd;exports.TransferQueue=Eu;exports.TransferQueueItemStatus=Oe;exports.WarningMessageNotification=Nl;exports.WarningToastNotification=Cl;exports.extractInitials=xs;exports.getTimezoneLabel=Gn;exports.matchesAccept=fr;exports.wrapInRootFolder=qi;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./use-file-manager-tabs-C-dMqEFy.cjs"),Be=require("./Switch-DE6MrcqJ.cjs"),n=require("react/jsx-runtime"),h=require("react"),B=require("@tabler/icons-react"),ce=require("classnames"),j=require("./DateCellRenderer-Cl_mNbi1.cjs"),$=require("./icon-CrGVkVpG.cjs"),y=require("./merge-classes-BEJXjzkx.cjs"),k=require("./DateCellRenderer-ChqbDlQ2.cjs"),O=require("./IconButton-DHOFapLo.cjs"),ws=require("react-dom"),bt=require("./lazy-Cy9WobJf.cjs"),ee=require("@floating-ui/react"),ie=require("./icon-DhjrDQ8I.cjs");function Es(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 Ar=Es(h),Ue=({label:e,className:t,icon:r,selected:s,closable:a,onClick:o,onRemove:i})=>{const l=y.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:o,children:[n.jsx(j.DialIcon,{icon:r}),n.jsx(j.DialEllipsisTooltip,{text:e}),a&&i&&n.jsx(v.DialButton,{className:"p-0",iconAfter:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM}),onClick:c=>i(c)})]},e)},pr=({label:e="Error",className:t})=>n.jsx(Ue,{label:e,className:y.mergeClasses("dial-tiny-semi-text cursor-default rounded-[120px] border-transparent bg-error text-error",t)});var gt=(e=>(e.Default="default",e.Compact="compact",e))(gt||{});const Os={[gt.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[gt.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},As=({title:e,value:t,description:r,variant:s=gt.Default,error:a,isLoading:o,className:i,delta:l,deltaPositive:c,deltaUnit:d,compareValues:f})=>{const p=Os[s],g=c!==void 0?c:(l??0)>=0,u=l===void 0?null:`${l>=0?`+${l}`:String(l)}${d??""}`;return n.jsxs("div",{className:y.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||o?"gap-2":"gap-1",p.container,i),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:y.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",g?"bg-success text-success":"bg-error text-error"),children:u})]}):n.jsx("span",{className:p.title,children:e}),a?n.jsx(pr,{className:"self-start"}):o?n.jsx(v.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(j.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(j.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&&!o&&p.showDescription&&r!=null&&r!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},gr=[{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"}],_s=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),Ls=(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},St=({value:e,maxValue:t=1,error:r,isLoading:s,title:a,valueLabel:o,colorMap:i=gr,className:l,titleClassName:c,valueClassName:d,inline:f,ariaLabel:p})=>{const g=e==null,u=!!(r||s||!g),m=_s(g?0:e,t),C=Ls(m,i),x=o??(g?"—":e),b=p??(typeof a=="string"?a:void 0),I=r||s,N=r?n.jsx(pr,{}):s?n.jsx(v.DialLoader,{fullWidth:!1}):n.jsx("span",{className:y.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}),T=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:y.mergeClasses("w-full overflow-hidden rounded-sm",f?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!I&&n.jsx("div",{className:"h-full rounded-sm transition-[width] duration-300",style:{width:`${m*100}%`,backgroundColor:C}})}):null,S=n.jsx("span",{className:y.mergeClasses("dial-small-text text-primary",c),children:a});return f?n.jsxs("div",{className:y.mergeClasses("flex flex-row items-center gap-2",l),children:[n.jsx("div",{className:"w-1/2 min-w-0",children:S}),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:T}),N]})]}):n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-1",l),children:[n.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[S,N]}),T]})},bn=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,onToggle:l,className:c,headerClassName:d,contentClassName:f})=>{const p=s!==void 0,[g,u]=h.useState(a),m=i?!0:p?s:g,C=h.useId(),x=()=>{if(o)return;const b=!m;p||u(b),l?.(b)};return n.jsxs("div",{className:y.mergeClasses("rounded border border-secondary",c),children:[n.jsxs("button",{type:"button","aria-expanded":m,"aria-controls":C,disabled:o||i,onClick:x,className:y.mergeClasses("flex w-full items-center gap-2 p-4 text-left",o?"cursor-not-allowed":"cursor-pointer",i&&"cursor-default",d),children:[!i&&n.jsx(j.DialIcon,{className:ce("text-secondary transition-transform",m&&"rotate-90"),icon:n.jsx(B.IconChevronRight,{size:$.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:C,role:"region",className:y.mergeClasses("px-4 pb-4",f),children:r})]})},ks=({title:e,titleTooltip:t,description:r,data:s,compareData:a,compareLabels:o,maxValue:i,colorMap:l,defaultExpanded:c=!0,nonCollapsible:d,isLoading:f,onBarClick:p,inline:g,barTitleClassName:u,barValueClassName:m,barClassName:C,barDescriptions:x,className:b})=>{const I=Object.entries(s),N=g?y.mergeClasses("text-secondary",u):u,T=o?"dial-tiny-text text-secondary":void 0,S=t?n.jsx(O.DialTooltip,{tooltip:t,children:e}):e,D=a?[...new Set([...Object.keys(s),...Object.keys(a)])]:[],_="cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-primary",E="group flex flex-col gap-1.5",A=y.mergeClasses("flex flex-col gap-1.5 pl-2",p&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",C);return n.jsx(bn,{title:S,description:r,defaultExpanded:c,nonCollapsible:d,className:b,children:n.jsx("div",{className:y.mergeClasses("flex flex-col",a?"gap-4":g?"gap-2":"gap-3"),children:f?n.jsx(v.DialLoader,{fullWidth:!1,className:"self-center"}):a?D.map(L=>{const w=L in s?s[L]:null,M=L in a?a[L]:null,K=typeof w=="number"&&typeof M=="number"?parseFloat((M-w).toFixed(3)):null,te=K!=null&&K!==0,G=te&&K>0,z=te?G?`+${K}`:String(K):null,H=x?.[L],q=n.jsx("span",{className:"dial-small-text text-secondary",children:L}),U=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[H?n.jsx(O.DialTooltip,{tooltip:H,children:q}):q,z!=null&&n.jsx("span",{className:y.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",G?"bg-success text-success":"bg-error text-error"),children:z})]}),n.jsxs("div",{className:A,children:[n.jsx(St,{title:o?.[0],value:w,maxValue:i,colorMap:l,inline:g,titleClassName:T,ariaLabel:L}),n.jsx(St,{title:o?.[1],value:M,maxValue:i,colorMap:l,inline:g,titleClassName:T,ariaLabel:`${L} compare`})]})]});return p?n.jsx("button",{type:"button",onClick:()=>p(L,w),className:y.mergeClasses(E,_),children:U},L):n.jsx("div",{className:E,children:U},L)}):I.map(([L,w])=>{const M=n.jsx(St,{title:L,value:w,maxValue:i,colorMap:l,inline:g,titleClassName:N,valueClassName:m,className:C}),F=p?n.jsx("button",{type:"button",onClick:()=>p(L,w),className:_,children:M}):M,K=x?.[L];return K?n.jsx(O.DialTooltip,{tooltip:K,triggerClassName:"flex flex-col",children:F},L):n.jsx(h.Fragment,{children:F},L)})})})},Rs="#FF4E50",Ms=(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},_r=(e,t)=>{const r=t.map(()=>0);let s=0;e.forEach(c=>{if(c<=0){s+=1;return}const d=Ms(c,t);d>=0&&(r[d]+=1)});const a=Math.max(0,s,...r),o=c=>a>0?c/a:0,i={from:0,to:0,color:Rs,count:s,ratio:o(s),isZeroBucket:!0},l=t.map((c,d)=>({from:c.from,to:c.to,color:c.color,count:r[d],ratio:o(r[d]),isZeroBucket:!1}));return[i,...l]},Cn=e=>e<=0?2:e%2===0?e:e+1,Ps=e=>{const t=Cn(e);return[t,t/2,0]},Gt=e=>`${Math.round(e*100)/100}`,vn=(e,t)=>e===t?Gt(e):`${Gt(e)}-${Gt(t)}`,Ut=128,Fs=(e,t)=>{const r=vn(e,t);return e===t?`scored ${r}`:`scored between ${r}`},Lr=(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:Fs(a.from,a.to)})]}),Bs=({title:e,values:t,colorMap:r=gr,valueTitle:s="values",showCount:a,isLoading:o,className:i,compareValues:l,valueSetLabel:c,compareValueSetLabel:d})=>{const f=_r(t,r),p=l?_r(l,r):void 0,g=t.length,u=l?.length??0,m=Math.max(g,u),C=Cn(m),x=Ps(m),b=S=>S.map(D=>({...D,ratio:C>0?D.count/C:0})),I=b(f),N=p?b(p):void 0,T=(S,D,_,E)=>{if(S.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:`${S.ratio*100}%`}})});const A=E?{backgroundImage:`repeating-linear-gradient(135deg, ${S.color} 0px, ${S.color} 1px, transparent 1px, transparent 4px)`,borderColor:S.color}:{backgroundColor:S.color};return n.jsx(O.DialTooltip,{placement:"bottom",tooltip:D,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":_,className:"flex min-h-2 w-full items-center justify-center rounded-sm border border-transparent",style:{height:`${S.ratio*100}%`,...A},children:a&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:S.count})})})};return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-2",i),children:[n.jsx("span",{className:"dial-small-text text-primary",children:e}),o?n.jsx("div",{className:"flex items-center justify-center",style:{height:Ut},children:n.jsx(v.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:Ut},children:x.map((S,D)=>n.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${D/(x.length-1)*100}%`,transform:"translateY(-50%)"},children:S},S))}),n.jsxs("div",{className:"relative min-w-0",children:[x.map((S,D)=>n.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${D/(x.length-1)*100}%`}},S)),n.jsx("div",{className:"relative flex items-end gap-1",style:{height:Ut},children:N?I.map((S,D)=>{const _=N[D],E=`${S.count} out of ${g} ${s}`,A=`${_.count} out of ${u} ${s}`;return n.jsxs("div",{className:"flex h-full flex-1 items-end",children:[T(S,Lr(c,S.count,g,s,S),E,!0),T(_,Lr(d,_.count,u,s,_),A,!1)]},D)}):I.map((S,D)=>{const _=`${S.count} out of ${g} ${s}`;return S.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:`${S.ratio*100}%`}})},D):n.jsx(O.DialTooltip,{placement:"bottom",tooltip:_,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":_,className:y.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-sm border","border-transparent"),style:{height:`${S.ratio*100}%`,backgroundColor:S.color},children:a&&S.count>0&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:S.count})})},D)})})]}),n.jsx("div",{}),n.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:I.map((S,D)=>n.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:vn(S.from,S.to)},D))})]})]})},yn=({value:e,max:t=100,size:r=O.ElementSize.Standard,labelProps:s,valueLabel:a,id:o,className:i,"aria-label":l,...c})=>{const d=h.useId(),f=o??d,p=!!s?.label,g=p?s?.id??`${f}-label`:void 0,u=t>0?t:0,m=Number.isFinite(e)?e:0,C=Math.min(Math.max(m,0),u),x=u>0?C/u*100:0,b=n.jsx("div",{...c,id:f,role:"progressbar","aria-valuenow":C,"aria-valuemin":0,"aria-valuemax":u,"aria-labelledby":g,"aria-label":O.resolveAccessibleName(l,p?void 0:"Progress"),className:y.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===O.ElementSize.Small?"h-1":"h-2",i,!p&&!a&&j.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:y.mergeClasses("flex w-full flex-col gap-1",j.DIAL_KIT_CLASS.progressBar),children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[s&&n.jsx(k.Label,{...s,id:g}),a&&n.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),b]})},zs=7,$s=2,Hs=e=>e<=0?[]:Array.from({length:e},(t,r)=>r+1);var Dt=(e=>(e.Active="active",e.Adjacent="adjacent",e.Far="far",e))(Dt||{});const Vs=(e,t,r)=>e===t?"active":r<zs||Math.abs(e-t)<=$s?"adjacent":"far",Ks=({page:e,totalPages:t,onPageChange:r,className:s})=>{const a=Hs(t);return n.jsxs("nav",{"aria-label":"Pagination",className:y.mergeClasses("flex items-center gap-2",s),children:[n.jsx(O.DialIconButton,{icon:n.jsx(B.IconCaretLeftFilled,{size:$.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:O.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(o=>{const i=Vs(o,e,t);return n.jsx("button",{type:"button",onClick:()=>r(o),"aria-label":`Page ${o}`,"aria-current":o===e?"page":void 0,className:y.mergeClasses("dial-pagination-dot rounded-full focus-visible:outline outline-offset-0 transition-all duration-300 ease-in-out",i===Dt.Active&&"h-[8px] w-[32px]",i===Dt.Adjacent&&"size-[8px]",i===Dt.Far&&"size-[4px]")},o)})}),n.jsx(O.DialIconButton,{icon:n.jsx(B.IconCaretRightFilled,{size:$.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:O.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e>=t,onClick:()=>r(e+1),"aria-label":"Next page"})]})},sr=({label:e,id:t,checked:r,indeterminate:s,disabled:a,ariaLabel:o,onChange:i,className:l,...c})=>{const d=h.useCallback(u=>{i?.(u.target.checked,t)},[i,t]),f=ce("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=ce("border rounded",a?"bg-layer-4 border-icon-secondary":""),g=()=>s?n.jsx(B.IconMinus,{className:p,...$.BASE_ICON_PROPS}):r?n.jsx(B.IconCheck,{className:p,...$.BASE_ICON_PROPS}):null;return n.jsxs("label",{...c,className:f,htmlFor:t,"aria-description":c["aria-description"]||j.ariaDescription,children:[g(),e&&(typeof e=="string"?n.jsx(j.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:o,className:"invisible size-0"})]})};var De=(e=>(e.VALID="valid",e.ERROR="error",e))(De||{});const Gs=(e,t)=>{if(t===e.id)switch(e.status){case De.VALID:return"border-accent-secondary text-primary";case De.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case De.VALID:return"border-primary text-primary";case De.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},Us=(e,t)=>{if(t===e.id)switch(e.status){case De.VALID:return"bg-accent-secondary";case De.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case De.VALID:return"bg-accent-secondary";case De.ERROR:return"bg-red-400";default:return"bg-layer-4"}},Zs=({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",o="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",i=()=>r===e.id&&e.status===De.ERROR?n.jsx(B.IconExclamationCircle,{stroke:2,size:$.DIAL_ICON_SIZE.SM}):r!==e.id&&e.status===De.VALID?n.jsx(B.IconCheck,{stroke:2,size:$.DIAL_ICON_SIZE.SM}):t+1;return n.jsxs("button",{className:ce(a,Gs(e,r)),onClick:()=>s(e.id),children:[n.jsx("span",{className:ce(o,Us(e,r)),children:i()}),n.jsx("span",{children:e.name})]})},Ws=({steps:e,currentStep:t,onChangeStep:r})=>{const s=a=>{const o=e.findIndex(c=>c.id===t),i=e.findIndex(c=>c.id===a);if(a===t)return;(e.slice(0,i).every(c=>c.status===De.VALID)||i<o)&&r(a)};return n.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,o)=>n.jsx(Zs,{currentStep:t,onChangeStep:s,step:a,index:o},a.id))})},Zt=e=>(e.toString().split(".")[1]??"").length,qs=({value:e,min:t=0,max:r=1,step:s=.1,disabled:a=!1,labelProps:o,labels:i,formatValue:l,onChange:c,className:d,trackClassName:f,fillClassName:p,thumbClassName:g,labelsClassName:u,"aria-label":m,"aria-labelledby":C,...x})=>{const b=h.useRef(null),I=Math.max(0,Math.min(100,(e-t)/(r-t)*100)),N=Zt(s),T=l?l(e):e.toFixed(N),S=h.useCallback(A=>{const L=b.current;if(!L)return e;const w=L.getBoundingClientRect(),M=(A-w.left)/w.width,F=t+M*(r-t),K=Zt(s),te=parseFloat((Math.round((F-t)/s)*s+t).toFixed(K));return Math.min(r,Math.max(t,te))},[t,r,s,e]),D=h.useCallback(A=>{a||(A.currentTarget.setPointerCapture(A.pointerId),c?.(S(A.clientX)))},[a,S,c]),_=h.useCallback(A=>{a||A.buttons===0||c?.(S(A.clientX))},[a,S,c]),E=h.useCallback(A=>{if(a)return;const L=Zt(s),w=K=>parseFloat((Math.round((K-t)/s)*s+t).toFixed(L)),M=K=>Math.min(r,Math.max(t,K));let F=e;switch(A.key){case"ArrowRight":case"ArrowUp":F=M(w(e+s));break;case"ArrowLeft":case"ArrowDown":F=M(w(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:y.mergeClasses("flex flex-col",a&&"pointer-events-none opacity-50",d),...x,children:[o&&n.jsx(Be.DialLabel,{...o,htmlFor:x.id}),n.jsxs("div",{ref:b,className:"relative flex h-[38px] cursor-pointer items-center",onPointerDown:D,onPointerMove:_,children:[n.jsx("div",{className:y.mergeClasses("pointer-events-none absolute inset-x-0 h-3 rounded-[10px] bg-layer-1",f)}),n.jsx("div",{className:y.mergeClasses("pointer-events-none absolute left-0 h-3 rounded-[10px] bg-controls-accent-primary",p),style:{width:`${I}%`}}),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":C,className:y.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",g),style:{left:`${I}%`},onKeyDown:E,children:T})]}),i&&n.jsx("div",{className:y.mergeClasses("dial-tiny-text flex text-secondary",u),children:i.length===3?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:i[0]}),n.jsx("span",{className:"flex-1 text-center",children:i[1]}),n.jsx("span",{children:i[2]})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:i[0]}),n.jsx("span",{className:"ml-auto",children:i[1]})]})})]})},Ys=({label:e,text:t,tooltip:r,children:s,postfix:a,className:o})=>n.jsxs("div",{className:y.mergeClasses("flex flex-col",s?"":"max-w-[200px]",o),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(O.DialTooltip,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),In=h.createContext({dragDropManager:void 0});function Ne(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 kr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Rr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Mr={INIT:"@@redux/INIT"+Rr(),REPLACE:"@@redux/REPLACE"+Rr()};function Xs(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 Qs(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(ta(e))return"date";if(ea(e))return"error";var r=Js(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 Js(e){return typeof e.constructor=="function"?e.constructor.name:null}function ea(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function ta(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function tt(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Qs(e)),t}function Sn(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"?Ne(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"?Ne(1):"Expected the enhancer to be a function. Instead, received: '"+tt(r)+"'");return r(Sn)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(2):"Expected the root reducer to be a function. Instead, received: '"+tt(e)+"'");var a=e,o=t,i=[],l=i,c=!1;function d(){l===i&&(l=i.slice())}function f(){if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(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 o}function p(C){if(typeof C!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(4):"Expected the listener to be a function. Instead, received: '"+tt(C)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(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(C),function(){if(x){if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(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 I=l.indexOf(C);l.splice(I,1),i=null}}}function g(C){if(!Xs(C))throw new Error(process.env.NODE_ENV==="production"?Ne(7):"Actions must be plain objects. Instead, the actual type was: '"+tt(C)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof C.type>"u")throw new Error(process.env.NODE_ENV==="production"?Ne(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"?Ne(9):"Reducers may not dispatch actions.");try{c=!0,o=a(o,C)}finally{c=!1}for(var x=i=l,b=0;b<x.length;b++){var I=x[b];I()}return C}function u(C){if(typeof C!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(10):"Expected the nextReducer to be a function. Instead, received: '"+tt(C));a=C,g({type:Mr.REPLACE})}function m(){var C,x=p;return C={subscribe:function(I){if(typeof I!="object"||I===null)throw new Error(process.env.NODE_ENV==="production"?Ne(11):"Expected the observer to be an object. Instead, received: '"+tt(I)+"'");function N(){I.next&&I.next(f())}N();var T=x(N);return{unsubscribe:T}}},C[kr]=function(){return this},C}return g({type:Mr.INIT}),s={dispatch:g,subscribe:p,getState:f,replaceReducer:u},s[kr]=m,s}function J(e,t,...r){if(ra()&&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 ra(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function na(e,t,r){return t.split(".").reduce((s,a)=>s&&s[a]?s[a]:r||null,e)}function sa(e,t){return e.filter(r=>r!==t)}function Dn(e){return typeof e=="object"}function aa(e,t){const r=new Map,s=o=>{r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(s),t.forEach(s);const a=[];return r.forEach((o,i)=>{o===1&&a.push(i)}),a}function oa(e,t){return e.filter(r=>t.indexOf(r)>-1)}const hr="dnd-core/INIT_COORDS",Lt="dnd-core/BEGIN_DRAG",mr="dnd-core/PUBLISH_DRAG_SOURCE",kt="dnd-core/HOVER",Rt="dnd-core/DROP",Mt="dnd-core/END_DRAG";function Pr(e,t){return{type:hr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const ia={type:hr,payload:{clientOffset:null,sourceClientOffset:null}};function la(e){return function(r=[],s={publishSource:!0}){const{publishSource:a=!0,clientOffset:o,getSourceClientOffset:i}=s,l=e.getMonitor(),c=e.getRegistry();e.dispatch(Pr(o)),ca(r,l,c);const d=fa(r,l);if(d==null){e.dispatch(ia);return}let f=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");da(i),f=i(d)}e.dispatch(Pr(o,f));const g=c.getSource(d).beginDrag(l,d);if(g==null)return;ua(g),c.pinSource(d);const u=c.getSourceType(d);return{type:Lt,payload:{itemType:u,item:g,sourceId:d,clientOffset:o||null,sourceClientOffset:f||null,isSourcePublic:!!a}}}}function ca(e,t,r){J(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(s){J(r.getSource(s),"Expected sourceIds to be registered.")})}function da(e){J(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function ua(e){J(Dn(e),"Item must be an object.")}function fa(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 pa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ga(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){pa(e,a,r[a])})}return e}function ha(e){return function(r={}){const s=e.getMonitor(),a=e.getRegistry();ma(s),Ca(s).forEach((i,l)=>{const c=xa(i,l,a,s),d={type:Rt,payload:{dropResult:ga({},r,c)}};e.dispatch(d)})}}function ma(e){J(e.isDragging(),"Cannot call drop while not dragging."),J(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function xa(e,t,r,s){const a=r.getTarget(e);let o=a?a.drop(s,e):void 0;return ba(o),typeof o>"u"&&(o=t===0?{}:s.getDropResult()),o}function ba(e){J(typeof e>"u"||Dn(e),"Drop result must either be an object or undefined.")}function Ca(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function va(e){return function(){const r=e.getMonitor(),s=e.getRegistry();ya(r);const a=r.getSourceId();return a!=null&&(s.getSource(a,!0).endDrag(r,a),s.unpinSource()),{type:Mt}}}function ya(e){J(e.isDragging(),"Cannot call endDrag while not dragging.")}function ar(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Ia(e){return function(r,{clientOffset:s}={}){Sa(r);const a=r.slice(0),o=e.getMonitor(),i=e.getRegistry(),l=o.getItemType();return Na(a,i,l),Da(a,o,i),ja(a,o,i),{type:kt,payload:{targetIds:a,clientOffset:s||null}}}}function Sa(e){J(Array.isArray(e),"Expected targetIds to be an array.")}function Da(e,t,r){J(t.isDragging(),"Cannot call hover while not dragging."),J(!t.didDrop(),"Cannot call hover after drop.");for(let s=0;s<e.length;s++){const a=e[s];J(e.lastIndexOf(a)===s,"Expected targetIds to be unique in the passed array.");const o=r.getTarget(a);J(o,"Expected targetIds to be registered.")}}function Na(e,t,r){for(let s=e.length-1;s>=0;s--){const a=e[s],o=t.getTargetType(a);ar(o,r)||e.splice(s,1)}}function ja(e,t,r){e.forEach(function(s){r.getTarget(s).hover(t,s)})}function Ta(e){return function(){if(e.getMonitor().isDragging())return{type:mr}}}function wa(e){return{beginDrag:la(e),publishDragSource:Ta(e),hover:Ia(e),drop:ha(e),endDrag:va(e)}}class Ea{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(o){return(...i)=>{const l=o.apply(t,i);typeof l<"u"&&r(l)}}const a=wa(this);return Object.keys(a).reduce((o,i)=>{const l=a[i];return o[i]=s(l),o},{})}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 Oa(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Nn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Aa(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:s}=e;return!t||!r||!s?null:Nn(Oa(t,s),r)}function _a(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Nn(t,r)}const ut=[],xr=[];ut.__IS_NONE__=!0;xr.__IS_ALL__=!0;function La(e,t){return e===ut?!1:e===xr||typeof t>"u"?!0:oa(t,e).length>0}class ka{subscribeToStateChange(t,r={}){const{handlerIds:s}=r;J(typeof t=="function","listener must be a function."),J(typeof s>"u"||Array.isArray(s),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const o=()=>{const i=this.store.getState(),l=i.stateId;try{l===a||l===a+1&&!La(i.dirtyHandlerIds,s)||t()}finally{a=l}};return this.store.subscribe(o)}subscribeToOffsetChange(t){J(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 J(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(J(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 ar(s,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(J(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),o=this.getItemType();if(o&&!ar(a,o))return!1;const i=this.getTargetIds();if(!i.length)return!1;const l=i.indexOf(t);return s?l===i.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 Aa(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return _a(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Fr=typeof global<"u"?global:self,jn=Fr.MutationObserver||Fr.WebKitMutationObserver;function Tn(e){return function(){const r=setTimeout(a,0),s=setInterval(a,50);function a(){clearTimeout(r),clearInterval(s),e()}}}function Ra(e){let t=1;const r=new jn(e),s=document.createTextNode("");return r.observe(s,{characterData:!0}),function(){t=-t,s.data=t}}const Ma=typeof jn=="function"?Ra:Tn;class Pa{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=Ma(this.flush),this.requestErrorThrow=Tn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Fa{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 Ba{create(t){const r=this.freeTasks,s=r.length?r.pop():new Fa(this.onError,a=>r[r.length]=a);return s.task=t,s}constructor(t){this.onError=t,this.freeTasks=[]}}const wn=new Pa,za=new Ba(wn.registerPendingError);function $a(e){wn.enqueueTask(za.create(e))}const br="dnd-core/ADD_SOURCE",Cr="dnd-core/ADD_TARGET",vr="dnd-core/REMOVE_SOURCE",Pt="dnd-core/REMOVE_TARGET";function Ha(e){return{type:br,payload:{sourceId:e}}}function Va(e){return{type:Cr,payload:{targetId:e}}}function Ka(e){return{type:vr,payload:{sourceId:e}}}function Ga(e){return{type:Pt,payload:{targetId:e}}}function Ua(e){J(typeof e.canDrag=="function","Expected canDrag to be a function."),J(typeof e.beginDrag=="function","Expected beginDrag to be a function."),J(typeof e.endDrag=="function","Expected endDrag to be a function.")}function Za(e){J(typeof e.canDrop=="function","Expected canDrop to be a function."),J(typeof e.hover=="function","Expected hover to be a function."),J(typeof e.drop=="function","Expected beginDrag to be a function.")}function or(e,t){if(t&&Array.isArray(e)){e.forEach(r=>or(r,!1));return}J(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 Te;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Te||(Te={}));let Wa=0;function qa(){return Wa++}function Ya(e){const t=qa().toString();switch(e){case Te.SOURCE:return`S${t}`;case Te.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Br(e){switch(e[0]){case"S":return Te.SOURCE;case"T":return Te.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function zr(e,t){const r=e.entries();let s=!1;do{const{done:a,value:[,o]}=r.next();if(o===t)return!0;s=!!a}while(!s);return!1}class Xa{addSource(t,r){or(t),Ua(r);const s=this.addHandler(Te.SOURCE,t,r);return this.store.dispatch(Ha(s)),s}addTarget(t,r){or(t,!0),Za(r);const s=this.addHandler(Te.TARGET,t,r);return this.store.dispatch(Va(s)),s}containsHandler(t){return zr(this.dragSources,t)||zr(this.dropTargets,t)}getSource(t,r=!1){return J(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return J(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return J(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return J(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Br(t)===Te.SOURCE}isTargetId(t){return Br(t)===Te.TARGET}removeSource(t){J(this.getSource(t),"Expected an existing source."),this.store.dispatch(Ka(t)),$a(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){J(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);J(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){J(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,s){const a=Ya(t);return this.types.set(a,r),t===Te.SOURCE?this.dragSources.set(a,s):t===Te.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 Qa=(e,t)=>e===t;function Ja(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function eo(e,t,r=Qa){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 to(e=ut,t){switch(t.type){case kt:break;case br:case Cr:case Pt:case vr:return ut;case Lt:case mr:case Mt:case Rt:default:return xr}const{targetIds:r=[],prevTargetIds:s=[]}=t.payload,a=aa(r,s);if(!(a.length>0||!eo(r,s)))return ut;const i=s[s.length-1],l=r[r.length-1];return i!==l&&(i&&a.push(i),l&&a.push(l)),a}function ro(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function no(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){ro(e,a,r[a])})}return e}const $r={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function so(e=$r,t){const{payload:r}=t;switch(t.type){case hr:case Lt:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case kt:return Ja(e.clientOffset,r.clientOffset)?e:no({},e,{clientOffset:r.clientOffset});case Mt:case Rt:return $r;default:return e}}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 rt(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}const oo={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function io(e=oo,t){const{payload:r}=t;switch(t.type){case Lt:return rt({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case mr:return rt({},e,{isSourcePublic:!0});case kt:return rt({},e,{targetIds:r.targetIds});case Pt:return e.targetIds.indexOf(r.targetId)===-1?e:rt({},e,{targetIds:sa(e.targetIds,r.targetId)});case Rt:return rt({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Mt:return rt({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function lo(e=0,t){switch(t.type){case br:case Cr:return e+1;case vr:case Pt:return e-1;default:return e}}function co(e=0){return e+1}function uo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fo(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){uo(e,a,r[a])})}return e}function po(e={},t){return{dirtyHandlerIds:to(e.dirtyHandlerIds,{type:t.type,payload:fo({},t.payload,{prevTargetIds:na(e,"dragOperation.targetIds",[])})}),dragOffset:so(e.dragOffset,t),refCount:lo(e.refCount,t),dragOperation:io(e.dragOperation,t),stateId:co(e.stateId)}}function go(e,t=void 0,r={},s=!1){const a=ho(s),o=new ka(a,new Xa(a)),i=new Ea(a,o),l=e(i,t,r);return i.receiveBackend(l),i}function ho(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Sn(po,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function mo(e,t){if(e==null)return{};var r=xo(e,t),s,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)s=o[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}function xo(e,t){if(e==null)return{};var r={},s=Object.keys(e),a,o;for(o=0;o<s.length;o++)a=s[o],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}let Hr=0;const Nt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var bo=h.memo(function(t){var{children:r}=t,s=mo(t,["children"]);const[a,o]=Co(s);return h.useEffect(()=>{if(o){const i=En();return++Hr,()=>{--Hr===0&&(i[Nt]=null)}}},[]),n.jsx(In.Provider,{value:a,children:r})});function Co(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=vo(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function vo(e,t=En(),r,s){const a=t;return a[Nt]||(a[Nt]={dragDropManager:go(e,t,r,s)}),a[Nt]}function En(){return typeof global<"u"?global:window}var Wt,Vr;function yo(){return Vr||(Vr=1,Wt=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,o;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(o=Object.keys(t),s=o.length,s!==Object.keys(r).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[a]))return!1;for(a=s;a--!==0;){var i=o[a];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}),Wt}var Io=yo();const So=v.getDefaultExportFromCjs(Io),Ze=typeof window<"u"?h.useLayoutEffect:h.useEffect;function Do(e,t,r){const[s,a]=h.useState(()=>t(e)),o=h.useCallback(()=>{const i=t(e);So(s,i)||(a(i),r&&r())},[s,e,r]);return Ze(o),[s,o]}function No(e,t,r){const[s,a]=Do(e,t,r);return Ze(function(){const i=e.getHandlerId();if(i!=null)return e.subscribeToStateChange(a,{handlerIds:[i]})},[e,a]),s}function On(e,t,r){return No(t,e||(()=>({})),()=>r.reconnect())}function An(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),h.useMemo(()=>typeof e=="function"?e():e,r)}function jo(e){return h.useMemo(()=>e.hooks.dragSource(),[e])}function To(e){return h.useMemo(()=>e.hooks.dragPreview(),[e])}let qt=!1,Yt=!1;class wo{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){J(!qt,"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 qt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{qt=!1}}isDragging(){if(!this.sourceId)return!1;J(!Yt,"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 Yt=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Yt=!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 Xt=!1;class Eo{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;J(!Xt,"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 Xt=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Xt=!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 Oo(e,t,r){const s=r.getRegistry(),a=s.addTarget(e,t);return[a,()=>s.removeTarget(a)]}function Ao(e,t,r){const s=r.getRegistry(),a=s.addSource(e,t);return[a,()=>s.removeSource(a)]}function ir(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 o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let c=0;c<o.length;c++){const d=o[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 lr(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function _o(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 Lo(e){return(t=null,r=null)=>{if(!h.isValidElement(t)){const o=t;return e(o,r),o}const s=t;return _o(s),ko(s,r?o=>e(o,r):e)}}function _n(e){const t={};return Object.keys(e).forEach(r=>{const s=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=Lo(s);t[r]=()=>a}}),t}function Kr(e,t){typeof e=="function"?e(t):e.current=t}function ko(e,t){const r=e.ref;return J(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?h.cloneElement(e,{ref:s=>{Kr(r,s),Kr(t,s)}}):h.cloneElement(e,{ref:t})}class Ro{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!ir(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!ir(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=_n({dragSource:(r,s)=>{this.clearDragSource(),this.dragSourceOptions=s||null,lr(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,s)=>{this.clearDragPreview(),this.dragPreviewOptions=s||null,lr(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 Mo{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!ir(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=_n({dropTarget:(r,s)=>{this.clearDropTarget(),this.dropTargetOptions=s,lr(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 ot(){const{dragDropManager:e}=h.useContext(In);return J(e!=null,"Expected drag drop context"),e}function Po(e,t){const r=ot(),s=h.useMemo(()=>new Ro(r.getBackend()),[r]);return Ze(()=>(s.dragSourceOptions=e||null,s.reconnect(),()=>s.disconnectDragSource()),[s,e]),Ze(()=>(s.dragPreviewOptions=t||null,s.reconnect(),()=>s.disconnectDragPreview()),[s,t]),s}function Fo(){const e=ot();return h.useMemo(()=>new wo(e),[e])}class Bo{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:o}=s;return o?o(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 zo(e,t,r){const s=h.useMemo(()=>new Bo(e,t,r),[t,r]);return h.useEffect(()=>{s.spec=e},[e]),s}function $o(e){return h.useMemo(()=>{const t=e.type;return J(t!=null,"spec.type must be defined"),t},[e])}function Ho(e,t,r){const s=ot(),a=zo(e,t,r),o=$o(e);Ze(function(){if(o!=null){const[l,c]=Ao(o,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c}},[s,t,r,a,o])}function Vo(e,t){const r=An(e,t);J(!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=Fo(),a=Po(r.options,r.previewOptions);return Ho(r,s,a),[On(r.collect,s,a),jo(a),To(a)]}function Ko(e){return h.useMemo(()=>e.hooks.dropTarget(),[e])}function Go(e){const t=ot(),r=h.useMemo(()=>new Mo(t.getBackend()),[t]);return Ze(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function Uo(){const e=ot();return h.useMemo(()=>new Eo(e),[e])}function Zo(e){const{accept:t}=e;return h.useMemo(()=>(J(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class Wo{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 qo(e,t){const r=h.useMemo(()=>new Wo(e,t),[t]);return h.useEffect(()=>{r.spec=e},[e]),r}function Yo(e,t,r){const s=ot(),a=qo(e,t),o=Zo(e);Ze(function(){const[l,c]=Oo(o,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c},[s,t,a,r,o.map(i=>i.toString()).join("|")])}function yr(e,t){const r=An(e,t),s=Uo(),a=Go(r.options);return Yo(r,s,a),[On(r.collect,s,a),Ko(a)]}const Gr="column",Xo="flex items-center",Qo="mr-3 cursor-move text-secondary",Jo=({id:e,children:t,className:r,onFind:s,onMove:a,ariaLabel:o="Drag item"})=>{const i=h.useRef(null),l=h.useRef(null),c=typeof s=="function"?s(e):-1,[{isDragging:d},f,p]=Vo(()=>({type:Gr,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]),[,g]=yr(()=>({accept:Gr,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(g(l)),f(i),n.jsxs("div",{ref:l,className:y.mergeClasses(Xo,r),style:{opacity:d?0:1},"aria-roledescription":"Draggable item",children:[n.jsx("div",{ref:i,className:Qo,"aria-label":o,children:n.jsx(B.IconGripVertical,{...$.BASE_ICON_PROPS})}),t]})},Ft=({iconClassName:e,label:t,...r})=>t?n.jsx(v.DialDangerButton,{...r,label:t,appearance:O.ButtonAppearance.Ghost,iconBefore:n.jsx(B.IconTrashX,{...$.BASE_ICON_PROPS,className:e||""})}):n.jsx(j.DialDangerIconButton,{...r,appearance:O.ButtonAppearance.Ghost,icon:n.jsx(B.IconTrashX,{...$.BASE_ICON_PROPS,className:e||""})}),ei=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:o=!1,labelProps:i,caption:l,id:c,...d})=>{const f=y.mergeClasses("dial-textarea dial-input px-3 py-2",d.invalid&&"dial-input-error",d.disabled&&"dial-input-disable",o?"resize":"resize-none",e);return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-y-1",a),children:[i&&n.jsx(Be.DialLabel,{...i,htmlFor:c}),n.jsx("textarea",{id:c,value:t||"",className:f,onChange:p=>r?.(p.currentTarget.value),...d}),n.jsx(v.DialErrorText,{text:s}),!s&&n.jsx(v.DialCaptionText,{text:l})]})},ti="inline-flex items-center rounded bg-layer-3",ri="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",ni="relative z-10 bg-controls-accent-primary-alpha-active text-primary",si="text-secondary hover:text-primary",ai="text-controls-disable-accent cursor-not-allowed hover:text-controls-disable-accent",oi=({options:e,value:t,onChange:r,disabled:s,className:a,ariaLabel:o})=>{const i=h.useCallback(l=>{if(s)return;const c=e.filter(g=>!g.disabled);if(c.length===0)return;const d=c.findIndex(g=>g.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":o,className:y.mergeClasses(ti,a),children:e.map((l,c)=>{const d=l.value===t,f=c===0,p=c===e.length-1,g=s||l.disabled;return n.jsxs("button",{type:"button",role:"tab","aria-selected":d,tabIndex:d?0:-1,disabled:g,onClick:()=>r(l.value),onKeyDown:i,className:y.mergeClasses(ri,!p&&"-mr-px",f&&"rounded-l",p&&"rounded-r",d?ni:si,g&&ai),children:[l.icon,l.label]},l.value)})})},Qt=8,ii=24,Ln=({initialTags:e=[],label:t,required:r,elementId:s,placeholder:a,captionDescription:o,errorText:i,invalid:l,disabled:c,collapseTagOverflow:d=!1,readOnly:f=!1,containerClassName:p,tagClassName:g,onChange:u})=>{const m=h.useRef(null),C=h.useRef([]),x=h.useRef(null),[b,I]=h.useState(e),[N,T]=h.useState(""),[S,D]=h.useState(!1),[_,E]=h.useState(e.length),A=h.useCallback(z=>H=>{C.current[z]=H},[]),L=h.useCallback(()=>{if(!d)return;const z=m.current;if(!z)return;const H=z.offsetWidth;if(H===0)return;const q=x.current?.offsetWidth??0,ae=H-(f?0:ii)-Qt;let Y=0,Z=0;for(let re=0;re<b.length;re++){const oe=C.current[re];if(!oe)continue;const le=oe.offsetWidth+Qt;if(Y+le>ae)break;Y+=le,Z++}if(Z<b.length&&Z>0)for(;Y+q>ae&&Z>0;){Z--;const re=C.current[Z]?.offsetWidth??0;Y-=re+Qt}E(Z)},[d,f,b.length]),w=z=>{const H=z.trim().replace(/,$/,"");if(H&&!b.includes(H)){const q=[H,...b];I(q),u?.(q)}},M=z=>{(z.key===","||z.key==="Enter")&&(z.preventDefault(),w(N),T(""))},F=()=>{N.trim()&&(w(N),T(""))},K=z=>{const H=b.filter((q,U)=>U!==z);I(H),u?.(H)},te=()=>i?n.jsx(v.DialErrorText,{text:i}):o?n.jsx(v.DialCaptionText,{text:o}):null;h.useEffect(()=>{if(d)return;const z=new ResizeObserver(()=>{if(m.current){const H=m.current.scrollHeight>m.current.clientHeight+10;D(H)}});return m.current&&z.observe(m.current),()=>z.disconnect()},[b,d]),h.useEffect(()=>{if(!d){E(b.length);return}E(b.length);const z=new ResizeObserver(()=>{L()}),H=m.current;return H&&z.observe(H),L(),()=>z.disconnect()},[d,L,b]),h.useEffect(()=>{I(e)},[JSON.stringify(e)]);const G=n.jsxs("div",{ref:m,className:ce("flex gap-2 items-center relative",d?"flex-nowrap overflow-hidden w-full min-w-0":ce("flex-wrap",S?"flex-col-reverse":"flex-row"),p),children:[(d?b.slice(0,_):b).map((z,H)=>n.jsx(Ue,{label:z,className:g,closable:!c&&!f,onRemove:!c&&!f?()=>K(H):void 0},z+H)),d&&_<b.length&&n.jsx(O.DialTooltip,{tooltip:b.slice(_).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:n.jsx(Ue,{label:`+${b.length-_}`})}),!f&&n.jsx("input",{id:s,type:"text",value:N,onChange:z=>T(z.target.value),onKeyDown:M,onBlur:F,className:ce("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((z,H)=>n.jsx("div",{ref:A(H),className:"inline-flex shrink-0",children:n.jsx(Ue,{label:z,className:g,closable:!c&&!f,onRemove:!c&&!f?()=>K(H):void 0})},`measure-${z}-${H}`)),n.jsx("div",{ref:x,className:"inline-flex shrink-0",children:n.jsx(Ue,{label:`+${b.length}`})})]})]});return f?G:n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsx(Be.DialLabel,{label:t,required:r,htmlFor:s}),n.jsx("div",{className:ce("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:G}),te()]})},kn=({selectedItems:e,placeholder:t,collapseTagOverflow:r=!1,listClassName:s,listElementClassName:a})=>e?.length?n.jsx(Ln,{readOnly:!0,initialTags:e,collapseTagOverflow:r,containerClassName:s,tagClassName:a}):t?n.jsx("span",{className:"text-secondary",children:t}):null,Jt=e=>Ar.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Ar.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"})),Rn=({children:e,open:t,disabled:r=!1,selectedValue:s,valueClassName:a,inputClassName:o,onOpen:i,elementId:l,errorText:c,invalid:d,emptyValueText:f,placeholder:p,editable:g=!1,onValueChange:u,collapseTagOverflow:m=!1,iconBefore:C})=>{const x=Array.isArray(s)&&s.length>0,b=typeof s=="string"&&!!s.trim(),I=x||b?s:p?void 0:f,N=r?void 0:i,T=h.useCallback(E=>{u?.(E.target.value)},[u]),S=()=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:ce("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between",o,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:[C&&n.jsx(j.DialIcon,{icon:C}),n.jsx("input",{type:"text",className:ce("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:T,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:i,"aria-label":"open-popup",children:n.jsx(j.DialIcon,{icon:n.jsx(Jt,{role:"img",width:$.BASE_ICON_SIZE,height:$.BASE_ICON_SIZE})})})]}),n.jsx(v.DialErrorText,{text:c})]}),D=()=>n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"w-full",onClick:N,"aria-label":"open-popup",id:l,children:n.jsxs("div",{className:ce("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",o,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:[C&&n.jsx(j.DialIcon,{icon:C}),n.jsx(O.DialTooltip,{tooltip:I==null?void 0:String(I),children:I||!p?n.jsx("span",{className:a,children:I}):n.jsx("span",{className:"text-secondary",children:p})})]}),!r&&n.jsx("div",{className:"shrink-0",children:n.jsx(j.DialIcon,{icon:n.jsx(Jt,{role:"img",width:$.BASE_ICON_SIZE,height:$.BASE_ICON_SIZE})})})]})}),n.jsx(v.DialErrorText,{text:c})]}),_=()=>n.jsx("div",{className:"w-full",onClick:N,children:n.jsxs("div",{className:ce("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:[C&&n.jsx(j.DialIcon,{icon:C}),n.jsx(kn,{placeholder:p,selectedItems:I,collapseTagOverflow:m})]}),!r&&n.jsx("div",{className:"ml-1",children:n.jsx(j.DialIcon,{icon:n.jsx(Jt,{role:"img",width:$.BASE_ICON_SIZE,height:$.BASE_ICON_SIZE})})})]})});return n.jsxs(n.Fragment,{children:[x?_():g?S():D(),t&&ws.createPortal(e,document.body)]})},li=({label:e,htmlFor:t,disabled:r,selectedValue:s,radioButtons:a,customInputValue:o,valueClassName:i,inputClassName:l,emptyValueText:c,placeholder:d,onClose:f,header:p,portalId:g,onApply:u,onCancel:m,cancelButtonTitle:C="Cancel",applyButtonTitle:x="Apply",isValid:b,selectedRadioValue:I,onChangeRadioField:N,id:T,size:S=v.PopupSize.Md})=>{const[D,_]=h.useState(!1),E=h.useCallback(()=>{r||_(!0)},[r]),A=h.useCallback(()=>{_(!1),f?.()},[f]),L=h.useCallback(()=>{m?.(),A()},[m,A]),w=h.useCallback(()=>{u(),A()},[u,A]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(Be.DialLabel,{label:e,htmlFor:t}),n.jsx(Rn,{disabled:r,open:D,selectedValue:o??a.find(M=>M.id===s)?.name,valueClassName:i,inputClassName:ce(l,"py-2","px-3"),emptyValueText:c,placeholder:d,onOpen:E,children:n.jsx(v.DialPopup,{open:D,onClose:L,header:p,portalId:g,size:S,footer:n.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[n.jsx(v.DialNeutralButton,{label:C,onClick:L}),n.jsx(v.DialPrimaryButton,{label:x,onClick:w,disabled:!b})]}),children:n.jsx("div",{className:"px-6 py-4",children:n.jsx(v.DialRadioGroup,{radioButtons:a,labelClassName:"dial-small-text",activeRadioButton:I,onChange:N,elementId:T,orientation:v.RadioGroupOrientation.Column})})})})]})},ci="Create",di="Cancel",ui="flex items-center justify-end gap-2 px-6 py-3",fi=({header:e,open:t=!1,submitLabel:r=ci,cancelLabel:s=di,isLoading:a=!1,disableSubmitButton:o=!1,className:i,submitClassName:l,onClose:c,onSubmit:d,onCancel:f,children:p,dividers:g=!0,size:u=v.PopupSize.Md,footer:m})=>{const C=a?null:n.jsxs("div",{className:ui,children:[n.jsx(v.DialNeutralButton,{label:s,onClick:()=>f?f():c?.()}),n.jsx(v.DialPrimaryButton,{className:l,label:r,disabled:o,onClick:()=>d()})]}),x=h.useCallback(()=>a?n.jsx("div",{className:"px-6 py-4 h-[120px]",children:n.jsx(v.DialLoader,{size:50})}):p??null,[p,a]);return n.jsx(v.DialPopup,{open:t,header:e,className:i,dividers:g,onClose:()=>c?.(),footer:m??C,size:u,children:x()})},pi=/^0+\.(\d+)?$/,gi=/^0+/,cr=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:o,...i})=>{const l=f=>!f||f==="-"?f:String(f)?.match(pi)?String(f)?.replace(gi,"0"):Number(f),c=f=>{if([".","-","+","e","E"].includes(f.key)){f.preventDefault();return}v.handleKeyDown(f,"number",r,s)},d=f=>{const p=f.clipboardData.getData("text"),g=p.replace(/\D/g,"");if(g!==p&&(f.preventDefault(),g)){const u=f.currentTarget,m=u.selectionStart??0,C=u.selectionEnd??0,x=u.value.slice(0,m)+g+u.value.slice(C);t?.(l(x))}};return n.jsx(v.DialInput,{type:"number",min:r,max:s,onChange:f=>t?.(l(f)),onKeyDown:e?c:a,onPaste:e?d:o,...i})},hi=({onClick:e})=>n.jsx(B.IconEyeOff,{...$.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),mi=({onClick:e})=>n.jsx(B.IconEye,{...$.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),Mn=({...e})=>{const[t,r]=h.useState(!1),s=h.useCallback(a=>{r(a)},[]);return n.jsx(v.DialInput,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?n.jsx(hi,{onClick:()=>s(!1)}):n.jsx(mi,{onClick:()=>s(!0)})})},Pn=({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(i=>i.value===s)?.label??s,o=e.find(i=>i.value===s)?.icon;return n.jsx(Ue,{label:a,onRemove:i=>r?.(i,s),icon:o?n.jsx(j.DialIcon,{icon:o}):null,className:"max-w-full"},s)})});var Tt=(e=>(e.Sm="sm",e.Md="md",e))(Tt||{}),wt=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(wt||{});const xi="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",bi="w-full rounded flex flex-col",ft="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",Ci="bg-accent-primary-alpha",dr="bg-accent-primary-alpha border-l border-accent-primary border-1",Et="opacity-75",vi=352,yi=4,Ii=n.jsx(B.IconChevronDown,{size:$.DIAL_ICON_SIZE.SM}),Si=({opt:e,selectedValues:t,onSelect:r})=>{const{isOpen:s,refs:a,floatingStyles:o,context:i,getReferenceProps:l,getFloatingProps:c}=j.useSubMenuFloating(yi,"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:ce(ft,d&&dr,e.disabled&&Et),...l(),children:[n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.icon&&n.jsx(j.DialIcon,{icon:e.icon}),n.jsx(j.DialEllipsisTooltip,{text:e.labelNode??e.label})]}),n.jsx(B.IconChevronRight,{size:14,className:"shrink-0"})]}),s&&n.jsx(j.SubMenuPanel,{refs:a,floatingStyles:o,context:i,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:ce(ft,p&&dr,f.disabled&&Et),onClick:()=>!f.disabled&&r(f.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f.icon&&n.jsx(j.DialIcon,{icon:f.icon}),n.jsx(j.DialEllipsisTooltip,{text:f.labelNode??f.label})]})},f.value)})})]})},_e=({options:e,multiple:t=!1,elementId:r,value:s,defaultValue:a,variant:o=wt.Primary,size:i=Tt.Md,prefix:l,customSelectedValue:c,placeholder:d="Select...",searchable:f=!1,searchSize:p=O.ElementSize.Standard,searchPlaceholder:g,selectAll:u=!1,invalid:m,selectAllLabel:C="Select all",emptyStateTitle:x="No options available",emptyStateDescription:b,emptyStateIcon:I,disabled:N=!1,className:T,listClassName:S,closable:D=!1,header:_,footer:E,onClose:A,onChange:L,inlineSearch:w=!1,dismissRef:M,onFooterClick:F,open:K,onOpenChange:te,onInlineQueryChange:G,customMultiSelectTagsRenderer:z})=>{const H=h.useId(),[q,U]=h.useState(!1),ae=K!==void 0,Y=ae?!!K:q,Z=h.useCallback(R=>{ae||U(R),te?.(R)},[ae,te]),[re,oe]=h.useState(w&&c||""),le=h.useRef(null),ue=h.useCallback(R=>{R!==re&&(oe(R||""),G?.(R||""))},[G,re]),me=s!==void 0,[Ce,ge]=h.useState(a),W=me?s:Ce,Q=h.useMemo(()=>t?Array.isArray(W)?W:[]:typeof W=="string"?[W]:[],[W,t]),we=h.useMemo(()=>{const R=re.trim().toLowerCase();return R?e.filter(ne=>ne.label.toLowerCase().includes(R)):e},[e,re]);h.useEffect(()=>{!Y&&!w&&ue("")},[w,Y,ue]);const ke=h.useRef(c);h.useEffect(()=>{w&&c!==ke.current&&(Y||(ke.current=c,ue(c||"")))},[c,w,Y,ue]);const X=h.useCallback(R=>{me||ge(R),L?.(R)},[me,L]),de=h.useCallback(R=>{if(t){const ne=new Set(Q);ne.has(R)?ne.delete(R):ne.add(R),X(Array.from(ne));return}if(X(R),w){const ne=e.find(Ie=>Ie.value===R)??e.flatMap(Ie=>Ie.children??[]).find(Ie=>Ie.value===R);ne&&ue(ne.label)}Z(!1)},[t,X,w,Z,Q,e,ue]),Ee=h.useCallback((R,ne)=>{if(R.stopPropagation(),!t){X("");return}const Ie=Q.filter(Vt=>Vt!==ne);X(Ie)},[t,Q,X]),xe=h.useMemo(()=>we.filter(R=>!R.disabled),[we]),fe=h.useMemo(()=>xe.filter(R=>Q.includes(R.value)).length,[xe,Q]),Qe=h.useCallback(R=>{w&&!t&&!R&&de(re),Z(R)},[de,w,t,re,Z]),{allSelectedInFiltered:ye,someSelectedInFiltered:ct}=h.useMemo(()=>{const R=xe.length>0&&fe===xe.length;return{allSelectedInFiltered:R,someSelectedInFiltered:fe>0&&!R}},[xe,fe]),Je=h.useCallback(()=>{if(!(!t||xe.length===0))if(ye){const R=new Set(xe.map(ne=>ne.value));X(Q.filter(ne=>!R.has(ne)))}else{const R=new Set(Q);xe.forEach(ne=>R.add(ne.value)),X(Array.from(R))}},[ye,t,xe,Q,X]),ve=Q.length>0;h.useEffect(()=>{Y&&w&&!t&&!N&&requestAnimationFrame(()=>{const R=le.current;if(!R)return;R.focus();const ne=R.value?.length??0;R.setSelectionRange?.(ne,ne)})},[Y,w,t,N]);const ze=!t&&ve?Q[0]:void 0,be=h.useMemo(()=>ze?e.find(R=>R.value===ze)??e.flatMap(R=>R.children??[]).find(R=>R.value===ze):void 0,[e,ze]),Ht=h.useCallback(()=>t?ve?z?.(e,Q,Ee)||n.jsx(Pn,{options:e,selectedValues:Q,handleRemoveTag:Ee}):n.jsx("span",{className:"text-secondary truncate",children:d}):be?n.jsxs(n.Fragment,{children:[be.icon&&n.jsx(j.DialIcon,{icon:be.icon}),n.jsx(j.DialEllipsisTooltip,{text:be.labelNode??(l?`${l} ${be.label}`:be.label)}),be?.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:be.description})]}):c&&s?c:n.jsx("span",{className:"text-secondary truncate",children:d}),[ve,t,c,l,s,d,be,e,Q,Ee,z]);h.useImperativeHandle(M,()=>({dismiss:()=>{Z(!1)}}));const et=h.useCallback(()=>{ue(Q.length===1?be?.label??re:"")},[re,Q.length,ue,be?.label]),Ge=h.useCallback(()=>{N||(Z(!Y),w&&!t&&(et(),le.current?.focus()))},[N,w,Y,t,et,Z]);return n.jsx(j.DialDropdown,{open:Y,onOpenChange:Qe,disabled:N,closable:D,onClose:A,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:f?null:vi,listClassName:S,renderOverlay:()=>n.jsxs("div",{id:`list-${r||H}`,role:"listbox","aria-multiselectable":t||void 0,className:bi,children:[_&&n.jsx(n.Fragment,{children:typeof _=="function"?_():_}),(f||D)&&e.length>8&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[f&&n.jsx(v.DialSearch,{size:p,placeholder:g,onChange:ue,value:re,id:`search-${r||H}`,containerClassName:y.mergeClasses(v.SIZE_CONFIG[p].containerClassName,"w-full")}),D&&n.jsx(v.DialButton,{"aria-label":"Close select",className:"shrink-0",iconBefore:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM}),onClick:R=>{A?.(R),Z(!1)}})]}),t&&u&&xe.length>0&&n.jsx("div",{className:ce(ft,"mt-2"),children:n.jsx(sr,{id:`${r||H}-selectAll`,label:C,checked:ye,indeterminate:ct,onChange:Je,ariaLabel:C})}),n.jsx("div",{className:ce("overflow-y-auto max-h-[352px]",w&&we.length===0?"":"py-1"),children:we.length===0?!w&&n.jsx("div",{className:"px-2 py-3",children:n.jsx(j.DialNoDataContent,{icon:I??n.jsx(B.IconClipboardX,{size:$.DIAL_ICON_SIZE.LG,stroke:.5}),title:x,description:b})}):we.map(R=>{const ne=Q.includes(R.value);return t?n.jsxs("div",{role:"option","aria-selected":ne,"aria-disabled":!!R.disabled,className:ce(ft,ne&&Ci,R.disabled&&Et,"w-full"),children:[n.jsx(sr,{id:`${r||H}-${R.value}`,label:n.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[R.icon&&n.jsx(j.DialIcon,{icon:R.icon}),n.jsx("span",{className:"truncate",children:R.labelNode??R.label})]}),checked:ne,disabled:R.disabled,onChange:()=>!R.disabled&&de(R.value),ariaLabel:R.label}),R.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:R.description})]},R.value):R.children?.length?n.jsx(Si,{opt:R,selectedValues:Q,onSelect:de},R.value):n.jsx("button",{role:"option",type:"button","aria-selected":ne,"aria-disabled":!!R.disabled,disabled:R.disabled,className:ce(ft,ne&&dr,R.disabled&&Et),onClick:()=>!R.disabled&&de(R.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[R.icon&&n.jsx(j.DialIcon,{icon:R.icon}),n.jsx(j.DialEllipsisTooltip,{text:R.labelNode??R.label}),R.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:R.description})]})},R.value)})}),E&&n.jsx("div",{onClick:R=>{F?.(R),F&&Z(!1)},children:typeof E=="function"?E():E})]}),children:n.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":Y,"aria-controls":`list-${r||H}`,className:y.mergeClasses(xi,N&&"opacity-75 !cursor-not-allowed !border-primary",i===Tt.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",m&&"dial-input-error",o===wt.Secondary?"!bg-layer-4 !h-auto":"",T),onMouseDown:R=>{N||w&&!t&&(et(),R.preventDefault())},onClick:()=>{Ge()},onKeyDown:R=>{(R.key===" "||R.code==="Space")&&(R.preventDefault(),Ge())},children:[w&&!t?n.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:n.jsx("input",{id:`inline-${r||H}`,type:"text",placeholder:g??d,value:re||"",onChange:R=>ue(R.currentTarget.value.trimStart()),onFocus:()=>!N&&Z(!0),onMouseDown:R=>{et(),R.stopPropagation()},onClick:R=>{R.stopPropagation()},onKeyDown:R=>{R.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref:le,disabled:N,"aria-disabled":N,autoComplete:"off"})}):n.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:Ht()}),!w&&n.jsx(j.DialIcon,{icon:Ii,className:ce("text-primary",Y&&"rotate-180")})]})})},Di=({label:e,required:t,captionDescription:r,containerClassName:s,selectClassName:a,error:o,id:i,caption:l,readonly:c,value:d,defaultEmptyText:f,...p})=>{const g=h.useCallback(()=>{if(!d||Array.isArray(d)&&d.length===0)return f??"None";if(Array.isArray(d))return n.jsx(Pn,{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(v.DialFormItem,{id:i,label:e,required:t,description:l,error:o,captionDescription:r,className:s,readonly:c,value:g(),defaultEmptyText:f,children:n.jsx(_e,{className:a,value:d,elementId:i,invalid:!!o,...p})})};function Fn(e){let t=null;return()=>(t==null&&(t=e()),t)}function Ni(e,t){return e.filter(r=>r!==t)}function ji(e,t){const r=new Set,s=o=>r.add(o);e.forEach(s),t.forEach(s);const a=[];return r.forEach(o=>a.push(o)),a}class Ti{enter(t){const r=this.entered.length,s=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=ji(this.entered.filter(s),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Ni(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class wi{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 Bt="__NATIVE_FILE__",Bn="__NATIVE_URL__",zn="__NATIVE_TEXT__",$n="__NATIVE_HTML__",Ur=Object.freeze(Object.defineProperty({__proto__:null,FILE:Bt,HTML:$n,TEXT:zn,URL:Bn},Symbol.toStringTag,{value:"Module"}));function er(e,t,r){const s=t.reduce((a,o)=>a||e.getData(o),"");return s??r}const ur={[Bt]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[$n]:{exposeProperties:{html:(e,t)=>er(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Bn]:{exposeProperties:{urls:(e,t)=>er(e,t,"").split(`
2
+ `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[zn]:{exposeProperties:{text:(e,t)=>er(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Ei(e,t){const r=ur[e];if(!r)throw new Error(`native type ${e} has no configuration`);const s=new wi(r);return s.loadDataTransfer(t),s}function tr(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(ur).filter(r=>{const s=ur[r];return s?.matchesTypes?s.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const Oi=Fn(()=>/firefox/i.test(navigator.userAgent)),Hn=Fn(()=>!!window.safari);class Zr{interpolate(t){const{xs:r,ys:s,c1s:a,c2s:o,c3s:i}=this;let l=r.length-1;if(t===r[l])return s[l];let c=0,d=i.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],g=p*p;return s[l]+a[l]*p+o[l]*g+i[l]*p*g}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 o=[],i=[];let l,c;for(let u=0;u<s-1;u++)l=t[u+1]-t[u],c=r[u+1]-r[u],o.push(l),i.push(c/l);const d=[i[0]];for(let u=0;u<o.length-1;u++){const m=i[u],C=i[u+1];if(m*C<=0)d.push(0);else{l=o[u];const x=o[u+1],b=l+x;d.push(3*b/((b+x)/m+(b+l)/C))}}d.push(i[i.length-1]);const f=[],p=[];let g;for(let u=0;u<d.length-1;u++){g=i[u];const m=d[u],C=1/o[u],x=m+d[u+1]-g-g;f.push((g-m-x)*C),p.push(x*C*C)}this.xs=t,this.ys=r,this.c1s=d,this.c2s=f,this.c3s=p}}const Ai=1;function Vn(e){const t=e.nodeType===Ai?e:e.parentElement;if(!t)return null;const{top:r,left:s}=t.getBoundingClientRect();return{x:s,y:r}}function vt(e){return{x:e.clientX,y:e.clientY}}function _i(e){var t;return e.nodeName==="IMG"&&(Oi()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Li(e,t,r,s){let a=e?t.width:r,o=e?t.height:s;return Hn()&&e&&(o/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:o}}function ki(e,t,r,s,a){const o=_i(t),l=Vn(o?e:t),c={x:r.x-l.x,y:r.y-l.y},{offsetWidth:d,offsetHeight:f}=e,{anchorX:p,anchorY:g}=s,{dragPreviewWidth:u,dragPreviewHeight:m}=Li(o,t,d,f),C=()=>{let D=new Zr([0,.5,1],[c.y,c.y/f*m,c.y+m-f]).interpolate(g);return Hn()&&o&&(D+=(window.devicePixelRatio-1)*m),D},x=()=>new Zr([0,.5,1],[c.x,c.x/d*u,c.x+u-d]).interpolate(p),{offsetX:b,offsetY:I}=a,N=b===0||b,T=I===0||I;return{x:N?b:x(),y:T?I:C()}}class Ri{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 Mi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wr(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){Mi(e,a,r[a])})}return e}class Pi{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=i=>this.handleDragStart(i,t),o=i=>this.handleSelectStart(i);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",a),r.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",a),r.removeEventListener("selectstart",o),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const s=i=>this.handleDragEnter(i,t),a=i=>this.handleDragOver(i,t),o=i=>this.handleDrop(i,t);return r.addEventListener("dragenter",s),r.addEventListener("dragover",a),r.addEventListener("drop",o),()=>{r.removeEventListener("dragenter",s),r.removeEventListener("dragover",a),r.removeEventListener("drop",o)}}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 Wr({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 Wr({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Ur).some(r=>Ur[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=Ei(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 o=this.sourceNodes.get(a);return o&&Vn(o)||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:o}=this;this.dragStartSourceIds=null;const i=vt(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:i});const{dataTransfer:l}=a,c=tr(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const f=this.monitor.getSourceId(),p=this.sourceNodes.get(f),g=this.sourcePreviewNodes.get(f)||p;if(g){const{anchorX:u,anchorY:m,offsetX:C,offsetY:x}=this.getCurrentSourcePreviewNodeOptions(),N=ki(p,g,i,{anchorX:u,anchorY:m},{offsetX:C,offsetY:x});l.setDragImage(g,N.x,N.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 o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}if(!this.enterLeaveCounter.enter(a.target)||this.monitor.isDragging())return;const{dataTransfer:l}=a,c=tr(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=a=>{const{dragEnterTargetIds:o}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=a.altKey,o.length>0&&this.actions.hover(o,{clientOffset:vt(a)}),o.some(l=>this.monitor.canDropOnTarget(l))&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=a=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}},this.handleTopDragOver=a=>{const{dragOverTargetIds:o}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}this.altKeyPressed=a.altKey,this.lastClientOffset=vt(a),this.scheduleHover(o),(o||[]).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 o;a.preventDefault(),(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}else tr(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:o}=this;this.dropTargetIds=[],this.actions.hover(o,{clientOffset:vt(a)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=a=>{const o=a.target;typeof o.dragDrop=="function"&&(o.tagName==="INPUT"||o.tagName==="SELECT"||o.tagName==="TEXTAREA"||o.isContentEditable||(a.preventDefault(),o.dragDrop()))},this.options=new Ri(r,s),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Ti(this.isNodeInDocument)}}const Fi=function(t,r,s){return new Pi(t,r,s)},Bi=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:s,acceptTypes:a,maxFilesCount:o,multiple:i,fileFormatError:l,fileCountError:c,fileSizeError:d,getIsFileFormatError:f,getIsFileSizeError:p})=>{const g=h.useRef(null),u=h.useRef(null),[m,C]=h.useState([]),[x,b]=h.useState(!1),[I,N]=h.useState(!1),T=h.useCallback(G=>{const z=G.target.files;if(z&&z.length>0){const H=Array.from(z),q=f?.(H),U=p?.(H);q?b(!0):U?N(!0):e(H)}},[f,p,e]),S=h.useCallback(G=>o&&G?.length>o,[o]),D=h.useMemo(()=>x||I||S(m),[x,I,S,m]),_=()=>{C([]),b(!1),N(!1)},E=h.useMemo(()=>x?n.jsx(v.DialErrorText,{text:l}):I?n.jsx(v.DialErrorText,{text:d}):S(m)?n.jsx(v.DialErrorText,{text:c}):null,[c,l,d,m,S,x,I]);h.useEffect(()=>{_()},[a]);const[{isOver:A,canDrop:L},w]=yr(()=>({accept:[Bt],drop(G){const z=G.files,H=f?.(z)??!1,q=p?.(z)??!1,U=S?.(z)??!1;if(b(H),N(q),H||q||U){C(z);return}e(z),_()},collect:G=>({isOver:G.isOver(),canDrop:G.canDrop()})}),[e,f,p,S]),M=G=>{(G.key==="Enter"||G.key==="Space")&&(G.preventDefault(),u.current?.click())},F=G=>{G?.preventDefault();const z=Array.from(G.dataTransfer?.items??[]);b(!!f?.(z)),N(!!p?.(z)),C(z)},K=G=>{G.target===G.currentTarget&&_()},te=ce("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!L&&!D&&"border-primary",L&&(A?"border-accent-primary":"border-hover"),D&&"border-error");return w(g),n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:te,ref:g,onDragOver:F,onDragLeave:K,children:[n.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:M,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(v.DialPrimaryButton,{appearance:O.ButtonAppearance.Ghost,label:s,onClick:()=>u.current?.click()})]}),n.jsx("input",{multiple:i,id:"file",type:"file",ref:u,hidden:!0,accept:a,onChange:T})]}),n.jsx(n.Fragment,{children:E})]})},zi=({iconBefore:e,className:t,...r})=>{const s=r.invalid,a=()=>n.jsx("div",{className:"mr-2",children:s?n.jsx(B.IconExclamationCircle,{...$.BASE_ICON_PROPS,className:"text-error"}):e});return n.jsx(v.DialInput,{...r,iconBefore:a(),containerClassName:ce("h-[40px] p-0",s&&"h-[60px]"),className:ce("rounded-r-none border-r-0",s&&"text-error",t)})},$i=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:s,getIsFileSizeError:a,maxFilesCount:o,fileFormatError:i,fileSizeError:l,fileCountError:c})=>{const d=h.useRef(null),[f,p]=h.useState(!1),[g,u]=h.useState(!1),[m,C]=h.useState(0),x=h.useCallback(()=>{p(!1),u(!1),C(0)},[]),b=h.useCallback(A=>!!(o&&t.length+A.length>o),[o,t.length]),I=f||g,[{isOver:N,canDrop:T},S]=yr(()=>({accept:[Bt],drop(A){const L=A.files,w=[...t,...L],M=s?.(L)??!1,F=a?.(L)??!1,K=b?.(L)??!1;if(p(M),u(F),M||F||K){C(L.length);return}r(w),x()},collect:A=>({isOver:A.isOver(),canDrop:A.canDrop()})}),[t,r,s,a,b,x]),D=A=>{A.preventDefault();const L=Array.from(A.dataTransfer?.items??[]);p(!!s?.(L)),u(!1),C(L.length)},_=A=>{A.target===A.currentTarget&&x()};S(d);const E=b(Array.from({length:m}));return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsx("div",{ref:d,onDragOver:D,onDragLeave:_,className:ce("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!I&&!E&&(T&&N?"border-accent-primary":"border-primary"),(I||E)&&"border-error"),children:e}),f&&n.jsx(v.DialErrorText,{text:i}),g&&n.jsx(v.DialErrorText,{text:l}),!f&&!g&&E&&n.jsx(v.DialErrorText,{text:c})]})},Kn=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:s,onChange:a,isInvalid:o,errorText:i,removeButtonAriaLabel:l,getIsMultiFilesSizeError:c,multiFilesSizeError:d,getIsFileFormatError:f,getIsFileSizeError:p,maxFilesCount:g}=e,u=h.useCallback((x,b)=>{x.stopPropagation(),a(t?.filter(I=>I.name!==b)||[])},[a,t]),m=h.useCallback(x=>n.jsx(Ft,{"aria-label":l,onClick:b=>u(b,x)}),[l,u]),C=h.useMemo(()=>n.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((x,b)=>n.jsx(zi,{id:x.name,value:x.name,iconAfter:m(x.name),iconBefore:r||s?.(x.name),invalid:o?.(x),error:o?.(x)?i:""},x.name+b))}),[t,r,s,o,i,m]);return n.jsx(bo,{backend:Fi,children:!t||t.length===0?n.jsx(Bi,{...e,onChange:a}):n.jsxs(n.Fragment,{children:[n.jsx($i,{existingFiles:t,onDrop:a,getIsFileFormatError:f,getIsFileSizeError:p,maxFilesCount:g,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:C}),c?.(t)&&n.jsx(v.DialErrorText,{text:d})]})})},Hi=({onChange:e,fieldTitle:t,elementId:r,files:s,maxFilesCount:a,maxFileSize:o,maxMultiFilesSize:i,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:f,multiple:p=!0,acceptTypes:g,deleteAllButtonLabel:u,addButtonLabel:m,additionalActionButtons:C,...x})=>{const b=h.useRef(null),I=()=>b.current?.click(),N=()=>{e([])},T=h.useCallback(E=>E?.some(A=>!(g==="/"||g?.toLowerCase()?.includes(A?.type?.toLowerCase()))),[g]),S=h.useCallback(E=>{if(!o)return!1;const A=o*(1024*1024);return E?.some(L=>{const w=L.size;return!!w&&w>A})},[o]),D=h.useCallback(E=>{if(!i||!p)return!1;const A=i*1024*1024;return E.reduce((w,M)=>w+M.size,0)>A},[i,p]),_=h.useCallback(E=>{const A=E.target.files;if(A&&A.length>0){const L=Array.from(A),w=T(L),M=S(L);!w&&!M&&e([...s||[],...L])}},[T,S,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(Be.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(v.DialNeutralButton,{label:u,iconBefore:n.jsx(B.IconTrashX,{...$.BASE_ICON_PROPS}),onClick:N}),(a?a>s?.length:!0)&&n.jsx(v.DialPrimaryButton,{appearance:O.ButtonAppearance.Ghost,iconBefore:n.jsx(B.IconPlus,{...$.BASE_ICON_PROPS}),label:m,onClick:I}),C]})]}),s&&s.length>0&&n.jsx("input",{id:"file",type:"file",multiple:p,ref:b,hidden:!0,accept:g,onChange:_}),n.jsx(Kn,{files:s,onChange:e,acceptTypes:g,maxFilesCount:a,multiple:p,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:f,getIsFileFormatError:T,getIsFileSizeError:S,getIsMultiFilesSizeError:D,...x})]})},Vi=({icon:e,ariaLabel:t,size:r=O.ElementSize.Standard,disabled:s=!1,className:a,buttonClassName:o,iconClassName:i,caretIcon:l=n.jsx(B.IconChevronDown,{size:$.DIAL_ICON_SIZE.SM}),showCaret:c=!0,placement:d="bottom-start",matchReferenceWidth:f=!1,open:p,onOpenChange:g,defaultOpen:u=!1,...m})=>{const C=r===O.ElementSize.Small,[x,b]=h.useState(u),I=p??x,N=C?"w-8 px-0":"w-10 px-0",T={[O.ElementSize.Small]:"size-5",[O.ElementSize.Standard]:"size-6",[O.ElementSize.Large]:"size-7"},S=D=>{b(D),g?.(D)};return n.jsx(j.DialDropdown,{...m,disabled:s,placement:d,matchReferenceWidth:f,className:a,open:I,onOpenChange:S,defaultOpen:u,children:n.jsxs("button",{type:"button","aria-label":t,disabled:s,className:y.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",C?"h-8 px-2":"h-10 px-2",c?void 0:N,o),children:[n.jsx(j.DialIcon,{icon:e,className:y.mergeClasses("flex items-center justify-center text-inherit",T[r],c&&"-mr-2",i,j.DIAL_KIT_CLASS.dropdownIcon)}),c&&n.jsxs("div",{className:y.mergeClasses("relative z-10 inline-grid size-5 shrink-0 place-items-center",j.DIAL_KIT_CLASS.dropdownIconCaret),children:[n.jsx("div",{className:"absolute inset-0 rounded-full bg-layer-2"}),n.jsx(j.DialIcon,{icon:l,className:y.mergeClasses("relative flex items-center justify-center text-secondary transition-transform group-hover:text-primary group-disabled:text-controls-secondary-disable",I&&"rotate-180")})]})]})})},Ki="application/octet-stream";function Gi(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=rr(s,!0),o=e.filter(c=>c!==r).map(c=>{const d=c.path||c.url||"",f=Ui(c.nodeType),p=f===v.DialFileNodeType.FOLDER,g=rr(d,p);let u;return c.parentPath===null||c.parentPath===void 0?u=a:c.parentPath===""?u="":u=rr(c.parentPath,!0),{...c,originalPath:d,path:g,parentPath:u,nodeType:f}}),i=new Map;o.forEach(c=>{const d={...c,id:c.originalPath,name:c.name,path:c.path,parentPath:c.parentPath,nodeType:c.nodeType,resourceType:Zi(c.resourceType),folderId:t,updatedAt:c.updatedAt?new Date(c.updatedAt).toISOString():new Date().toISOString(),items:c.nodeType===v.DialFileNodeType.FOLDER?[]:void 0};c.nodeType===v.DialFileNodeType.ITEM&&(d.extension=Wi(c.name),d.contentType=c.contentType||Ki,d.contentLength=c.contentLength||0),i.set(c.path,d)});const l=[];return i.forEach(c=>{if(c.parentPath===a)l.push(c);else{const d=c.path.lastIndexOf(c.name||""),f=c.path.slice(0,d),p=i.get(f);p&&p.nodeType===v.DialFileNodeType.FOLDER?(p.items=p.items||[],p.items.push(c)):l.push(c)}}),l}function rr(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 Ui(e){return e.toUpperCase()==="FOLDER"?v.DialFileNodeType.FOLDER:v.DialFileNodeType.ITEM}function Zi(e){if(!e)return;const t=e.toUpperCase();return Object.values(v.DialFileResourceType).find(s=>s.toUpperCase()===t)}function Wi(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function qi(e,t="Prompts",r="prompts/public/",s="root"){const a=Gi(e,s);return[{id:s,name:t,path:r,parentPath:"",nodeType:v.DialFileNodeType.FOLDER,folderId:s,items:a}]}const Gn=({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(o=>o.type==="timeZoneName")?.value;return a?`(${a}) ${s}`:s}catch{return s}};var st=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(st||{}),ht=(e=>(e.Select="select",e.Radio="radio",e))(ht||{}),zt=(e=>(e.Row="row",e.Column="column",e))(zt||{}),V=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))(V||{});const Yi={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"},Un=h.createContext(null);function Le(){const e=h.useContext(Un);if(!e)throw new Error("useSchemaContext must be used inside DialSchemaRenderer");return e}function qr(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 se(e,t,r=0){if(r>10)return e;let s=e;if(s.$ref){const a=s.$ref.replace(/^#\//,"").split("/");let o=t;for(const f of a)o=o?.[f];if(!o||typeof o!="object")return e;const{$ref:i,...l}=s,c=o;s={...c.$ref?se(c,t,r+1):c,...l}}if(s.allOf&&s.allOf.length>0){const{allOf:a,...o}=s;let i={};for(const l of a)i=qr(i,se(l,t,r+1));s=qr(i,o)}return s}function Zn(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 $t(e){return e==null||e===""}function Ye(e){return e.type===V.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function Ot(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}const Ir=e=>`"${e}" is required`;function Wn(e,t){return e.type===V.Null?"null":e.$ref?se(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 Pe(e,t,r=0){if(r>15)return;const s=se(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 o=se({$ref:s.discriminator.mapping[a]},t);return{...Pe(o,t,r+1)??{},[s.discriminator.propertyName]:a}}}if(Ye(s)){if(s.properties){const a={};let o=!1;for(const[i,l]of Object.entries(s.properties)){const c=Pe(l,t,r+1);c!==void 0&&(a[i]=c,o=!0)}return o?a:void 0}if(s.additionalProperties!=null&&s.additionalProperties!==!1)return{}}}function Me(e,t,r,s="",a=0){if(a>15)return[];const o=[],i=se(t,r);if(i.anyOf){const d=i.anyOf.filter(f=>f.type!==V.Null);return e!=null&&d.length===1?Me(e,d[0],r,s,a+1):o}if(i.oneOf&&i.discriminator){const d=i.discriminator.propertyName,f=e?.[d];if(f&&i.discriminator.mapping[f]){const p={$ref:i.discriminator.mapping[f]},g=se(p,r);return Me(e,g,r,s,a+1)}return o}if(i.type===V.Array||!i.type&&Array.isArray(e)){if(Array.isArray(e)&&i.items)for(let d=0;d<e.length;d++){const f=Me(e[d],i.items,r,`${s}[${d}]`,a+1);o.push(...f)}return o}if(!Ye(i))return o;const l=i.required??[],c=e;for(const d of l){const f=i.properties?.[d];if(f&&se(f,r).isHidden)continue;const p=s?`${s}.${d}`:d,g=c?.[d];if($t(g)){const u=f?.title??Ot(d);o.push({path:p,message:Ir(u)})}}if(c&&i.properties)for(const[d,f]of Object.entries(i.properties)){if(se(f,r).isHidden)continue;const p=s?`${s}.${d}`:d,g=c[d];if(g!=null){const u=Me(g,f,r,p,a+1);o.push(...u)}}if(c&&i.additionalProperties!=null&&i.additionalProperties!==!1&&typeof i.additionalProperties=="object"){const d=i.additionalProperties;for(const[f,p]of Object.entries(c)){const g=s?`${s}.${f}`:f,u=Me(p,d,r,g,a+1);o.push(...u)}}return o}function Sr(e,t,r){const s=se(t,r);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(Ye(s)&&s.properties){const a=Object.entries(s.properties).filter(([,c])=>!se(c,r).isHidden),o=a.length,i=e;return`${a.filter(([c])=>{const d=i?.[c];return d!=null&&d!==""}).length}/${o} fields`}return""}function Xi(e,t,r){if(e==null){const s=t.findIndex(a=>a.type===V.Null);return s>=0?s:0}if(Array.isArray(e)){const s=t.findIndex(a=>se(a,r).type===V.Array);return s>=0?s:0}if(typeof e=="boolean"){const s=t.findIndex(a=>se(a,r).type===V.Boolean);return s>=0?s:0}if(typeof e=="number"){const s=t.findIndex(a=>{const o=se(a,r);return o.type===V.Number||o.type===V.Integer});return s>=0?s:0}if(typeof e=="string"){const s=t.findIndex(a=>se(a,r).type===V.String);return s>=0?s:0}if(typeof e=="object"){const s=e;for(let a=0;a<t.length;a++){const o=se(t[a],r);if(o.discriminator&&o.discriminator.propertyName in s)return a}for(let a=0;a<t.length;a++){const o=se(t[a],r);if(Ye(o)||o.oneOf)return a}return 0}return 0}function Qi(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 qn(e){switch(Array.isArray(e.type)?e.type[0]:e.type){case V.String:return"";case V.Boolean:return!1;case V.Array:return[];case V.Integer:case V.Number:return;default:return{}}}const Ji=[V.String,V.Number,V.Boolean,V.Null,V.Object,V.Array];function el(e){return Array.isArray(e)?V.Array:typeof e=="object"&&e!==null?V.Object:typeof e=="boolean"?V.Boolean:typeof e=="number"?V.Number:e===null?V.Null:V.String}const tl={[V.String]:"",[V.Number]:0,[V.Boolean]:!1,[V.Null]:null,[V.Object]:{},[V.Array]:[]};function rl(e){return tl[e]}const mt=({title:e,description:t,summary:r,errorCount:s=0,level:a=0,children:o,onRemove:i,defaultExpanded:l=!0,removeItemAriaLabel:c="Remove item"})=>{const[d,f]=h.useState(l),p=a===0,g="rounded border border-secondary",u=y.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=y.mergeClasses("border-t border-secondary",p?"p-4":"p-3");return n.jsxs("div",{className:g,children:[n.jsxs("div",{className:u,onClick:()=>f(C=>!C),role:"button","aria-expanded":d,children:[n.jsx("span",{className:"shrink-0 text-secondary",children:d?n.jsx(B.IconChevronDown,{size:16,stroke:2}):n.jsx(B.IconChevronRight,{size:16,stroke:2})}),n.jsx("span",{className:y.mergeClasses("flex-1 truncate",p?"dial-small-semi-text text-primary":"dial-small-text text-primary"),children:e}),t&&n.jsx(Be.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(j.DialIcon,{icon:n.jsx(B.IconAlertTriangle,{size:13,stroke:2})}),s," error",s>1?"s":""]}):n.jsx(j.DialIcon,{icon:n.jsx(B.IconCheck,{size:13,stroke:2}),className:"text-success shrink-0"}),i&&n.jsx(Ft,{size:O.ElementSize.Small,onClick:C=>{C.stopPropagation(),i()},"aria-label":c,className:"ml-1 shrink-0 p-0.5"})]}),d&&n.jsx("div",{className:m,children:o})]})},Yn=({schema:e,value:t,onChange:r,path:s,level:a=0,required:o,label:i})=>{const{rootSchema:l,defaultExpanded:c=!0,touchedPaths:d=new Set,skipUntouched:f=!1}=Le(),p=se(e,l),g=Ye(p),u=p.type===V.Array;if(g||u){const x=Sr(t,p,l),b=Me(t,p,l,s.join(".")),I=s.join("."),N=I+".",T=!f||d.has(I)||[...d].some(S=>S.startsWith(N));return n.jsx(mt,{title:i??p.title??s[s.length-1]??"Section",description:p.description,level:a,summary:x,errorCount:T?b.length:0,defaultExpanded:c,children:n.jsx(Fe,{schema:p,value:t,onChange:r,path:s,level:a+1,required:o})})}const C=(!f||d.has(s.join(".")))&&o&&$t(t)?Ir(i??"Field"):void 0;return n.jsx(v.DialFormItem,{label:i,required:o,description:p.description,error:C,children:n.jsx(Fe,{schema:p,value:t,onChange:r,path:s,level:a,required:o,suppressInlineError:!0})})},jt=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:o,texts:i}=Le(),l=se(e,o),c=Zn(Object.entries(l.properties??{}).filter(([,p])=>!se(p,o).isHidden)),d=l.required??[],f=t??{};return c.length===0?n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:i.noConfigurableProperties}):n.jsx("div",{className:"flex flex-col gap-4",children:c.map(([p,g])=>{const m=se(g,o).title??g.title??Ot(p),C=d.includes(p);return n.jsx(Yn,{schema:g,value:f[p],onChange:x=>r({...f,[p]:x}),path:[...s,p],level:a,required:C,label:m},p)})})},nl=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,defaultExpanded:c=!0}=Le(),d=Array.isArray(t)?t:[],f=e.items,[p,g]=h.useState(void 0);if(!f)return n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:i.noItemSchema});const u=h.useMemo(()=>se(f,o),[f,o]),m=h.useMemo(()=>u.discriminator,[u]),C=h.useMemo(()=>m?.propertyName,[m]),x=h.useMemo(()=>m?Object.keys(m.mapping).map(T=>({value:T,label:T})):[],[m]),b=()=>{const T=p??x[0]?.value;let S;if(m&&T){const D=se({$ref:m.mapping[T]},o);S={...Pe(D,o)??{},[m.propertyName]:T}}else S=Pe(u,o)??qn(u);r([...d,S])},I=T=>{r(d.filter((S,D)=>D!==T))},N=(T,S)=>{r(d.map((D,_)=>_===T?S:D))};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:i.noItemsYet}),d.map((T,S)=>{const D=Qi(T,C,S),_=Sr(T,u,o),E=Me(T,u,o,`${s.join(".")}[${S}]`);return n.jsx(mt,{title:D,level:a,summary:_,errorCount:E.length,onRemove:l?void 0:()=>I(S),defaultExpanded:c,removeItemAriaLabel:i.removeItemAriaLabel,children:n.jsx(Fe,{schema:f,value:T,onChange:A=>N(S,A),path:[...s,String(S)],level:a+1})},S)}),!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(_e,{options:x,value:p??x[0]?.value,placeholder:i.selectTypeToAdd,onChange:T=>{const S=typeof T=="string"?T:T[0];g(S)}})}),n.jsx(v.DialGhostButton,{label:i.addItem,iconBefore:n.jsx(B.IconPlus,{size:16,stroke:2}),onClick:b})]})]})},sl=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1}=Le(),c=h.useId(),d=e.discriminator;if(d){const x=d.propertyName,b=d.mapping,I=Object.keys(b).map(D=>({value:D,label:D})),N=typeof t=="object"&&t!==null?t[x]:void 0,T=N?se({$ref:b[N]},o):void 0,S=D=>{const _=se({$ref:b[D]},o),E=Pe(_,o)??{};r({...E,[x]:D})};if(e.discriminatorDisplay===ht.Radio){const D=e.discriminatorOrientation===zt.Row,_=N?(()=>{const E=se({$ref:b[N]},o),{[x]:A,...L}=E.properties??{};return{...E,properties:L}})():void 0;return D?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(E=>{const A=se({$ref:b[E]},o);return n.jsx(j.DialRadioButton,{name:c,value:E,inputId:`${c}-${E}`,label:A.title??E,checked:N===E,disabled:l,onChange:()=>S(E)},E)})}),_&&n.jsx(jt,{schema:_,value:t,onChange:r,path:s,level:a})]}):n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:Object.keys(b).map(E=>{const A=se({$ref:b[E]},o),L=N===E,{[x]:w,...M}=A.properties??{},F={...A,properties:M};return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(j.DialRadioButton,{name:c,value:E,inputId:`${c}-${E}`,label:A.title??E,checked:L,disabled:l,onChange:()=>S(E)}),L&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(jt,{schema:F,value:t,onChange:r,path:s,level:a})})]},E)})})}return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(_e,{options:I,value:N,placeholder:i.selectTypePlaceholder,disabled:l,onChange:D=>{const _=typeof D=="string"?D:D[0];_&&S(_)}})}),T&&n.jsx("div",{className:"pl-3",children:n.jsx(jt,{schema:T,value:t,onChange:r,path:s,level:a})})]})}const f=e.oneOf??[],g=(()=>{if(t==null)return 0;if(typeof t=="object"&&!Array.isArray(t)){for(let x=0;x<f.length;x++)if(se(f[x],o).required?.every(I=>I in t))return x}return 0})(),u=x=>{const b=se(f[x],o),I=Pe(b,o);r(I??null)},m=f[g];if(e.discriminatorDisplay===ht.Radio)return n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:f.map((x,b)=>{const I=se(x,o),N=Wn(x,o)??`Option ${b+1}`,T=g===b;return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(j.DialRadioButton,{name:c,value:String(b),inputId:`${c}-${b}`,label:N,checked:T,disabled:l,onChange:()=>u(b)}),T&&I&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(Fe,{schema:I,value:t,onChange:r,path:s,level:a})})]},b)})});const C=f.map((x,b)=>{const I=se(x,o);return{value:String(b),label:I.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(_e,{options:C,value:String(g),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(Fe,{schema:m,value:t,onChange:r,path:s,level:a})})]})},al=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:o,readonly:i=!1}=Le(),l=e.anyOf??[],c=l.map((m,C)=>({value:String(C),label:Wn(m,o)})),d=Xi(t,l,o),f=l[d],g=se(f,o).type===V.Null,u=m=>{const C=se(l[m],o);if(C.type===V.Null){r(null);return}const x=Pe(C,o);if(x!==void 0){r(x);return}switch(C.type){case V.Array:r([]);break;case V.String:r("");break;case V.Boolean:r(!1);break;case V.Integer:case V.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(_e,{options:c,value:String(d),disabled:i,onChange:m=>{const C=typeof m=="string"?m:m[0];u(Number(C))}})}),!g&&f&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Fe,{schema:f,value:t,onChange:r,path:s,level:a})})]})},Xn=({schema:e,value:t,onChange:r,invalid:s})=>{const a=h.useId(),{texts:o,readonly:i=!1,inputClassName:l,acceptableResourceTypes:c}=Le(),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===V.String||e.type===void 0)){const g=(e.acceptableResourceTypes??[]).flatMap(u=>{const m=c?.[u];return Array.isArray(m)?m.map(C=>{const x=String(C);return{value:x,label:x}}):[]});return n.jsx(_e,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:i,onChange:u=>r(typeof u=="string"?u:u[0]),placeholder:o.enumSelectPlaceholder,className:l})}if(d)return n.jsx(v.DialInput,{value:String(e.const??""),disabled:!0,onChange:void 0,className:"opacity-60"});if(f&&e.enumDisplay===ht.Radio){const g=e.enumOrientation===zt.Row;return n.jsx("div",{role:"radiogroup",className:g?"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(j.DialRadioButton,{name:a,value:m,inputId:`${a}-${m}`,label:m,checked:t!=null?String(t)===m:!1,disabled:i,onChange:C=>r(C)},m)})})}if(f){const g=e.enum.map(u=>({value:String(u),label:String(u)}));return n.jsx(_e,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:i,onChange:u=>r(typeof u=="string"?u:u[0]),placeholder:o.enumSelectPlaceholder})}switch(e.type){case V.Boolean:return n.jsx(Be.DialSwitch,{switchId:a,isOn:!!t,disabled:i,onChange:g=>r(g)});case V.Integer:return n.jsx(cr,{integer:!0,value:t!=null?String(t):"",invalid:s,disabled:i,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:o.integerInputPlaceholder,containerClassName:l});case V.Number:return n.jsx(cr,{value:t!=null?String(t):"",invalid:s,disabled:i,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:o.numberInputPlaceholder,containerClassName:l});default:return e.isProtected?n.jsx(Mn,{value:t!=null?String(t):"",invalid:s,disabled:i,onChange:g=>r(g??void 0),placeholder:o.stringInputPlaceholder,containerClassName:l}):n.jsx(v.DialInput,{value:t!=null?String(t):"",invalid:s,disabled:i,onChange:g=>r(g??void 0),placeholder:o.stringInputPlaceholder,containerClassName:l})}},Dr=({value:e,onChange:t,theme:r=bt.EditorThemes.dark,height:s=240})=>{const{readonly:a,texts:o}=Le(),[i,l]=h.useState(null),[c,d]=h.useState(()=>JSON.stringify(e,null,2));h.useEffect(()=>{typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-CpSpVa0v.cjs")).then(g=>{l(()=>g.DialJsonEditor)})},[]);let f=!1;try{JSON.parse(c)}catch{f=!0}const p=g=>{const u=g??"";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:i&&n.jsx(i,{value:c,currentTheme:r,onChange:p,options:{readOnly:a}})}),n.jsx(v.DialErrorText,{text:f?o.invalidJsonError:void 0})]})},Yr=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),Qn=e=>!!(e.oneOf||e.anyOf||e.type===V.Array||Ye(e)),ol={[V.String]:"entryTypeString",[V.Number]:"entryTypeNumber",[V.Boolean]:"entryTypeBoolean",[V.Null]:"entryTypeNull",[V.Object]:"entryTypeObject",[V.Array]:"entryTypeArray"},il=({pairId:e,pairKey:t,pairValue:r,valueSchema:s,isUnschematizedValue:a,jsonEditorTheme:o,onKeyChange:i,onValueChange:l,onRemove:c,keyInputPlaceholder:d,removeFieldAriaLabel:f,path:p,level:g,readonly:u=!1,inputClassName:m})=>{const{rootSchema:C,texts:x,defaultExpanded:b=!0,touchedPaths:I=new Set,markTouched:N=()=>{},skipUntouched:T=!1}=Le(),[S,D]=h.useState(t),_=Qn(s),[E,A]=h.useState(()=>el(r)),L=a&&(E===V.Object||E===V.Array),w=a&&E===V.Null,M=_||L,F=[...p,e,"key"].join("."),te=(!T||I.has(F))&&t==="",G=h.useCallback(oe=>{l(rl(oe)),A(oe)},[l]),z=h.useMemo(()=>Ji.map(oe=>({value:oe,label:x[ol[oe]]})),[x]),H=h.useMemo(()=>[{value:"true",label:x.booleanTrueOption},{value:"false",label:x.booleanFalseOption}],[x]),q=`${e}-key-error`,U=a&&E===V.Boolean,ae=n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsxs("div",{className:M?"flex-1 min-w-0":"w-2/5 min-w-0",children:[n.jsx(v.DialInput,{value:S,disabled:u,invalid:te,"aria-describedby":te?q:void 0,onChange:oe=>D(oe??""),onBlur:()=>{N(F),S!==t&&i(S)},placeholder:d,containerClassName:m}),n.jsx(v.DialErrorText,{id:q,text:te?`${x.keyColumnHeader} is required`:void 0})]}),!_&&!L&&n.jsx("div",{className:"flex-1 min-w-0",children:w?n.jsx(v.DialInput,{value:"null",disabled:!0,onChange:void 0,className:"opacity-60"}):U?n.jsx(_e,{options:H,value:r?"true":"false",disabled:u,onChange:oe=>{const le=typeof oe=="string"?oe:oe[0];le&&l(le==="true")}}):n.jsx(Xn,{schema:a?{type:E}:s,value:r,onChange:l})}),a&&n.jsx("div",{className:"w-28 shrink-0",children:n.jsx(O.DialTooltip,{tooltip:x.entryTypeChangeWarning,triggerClassName:"block",children:n.jsx(_e,{options:z,value:E,disabled:u,onChange:oe=>{const le=typeof oe=="string"?oe:oe[0];le&&G(le)}})})}),!u&&n.jsx(Ft,{size:O.ElementSize.Small,onClick:c,"aria-label":f,className:"shrink-0 p-1"})]});if(!M)return ae;if(L)return n.jsxs("div",{className:"flex flex-col gap-2",children:[ae,n.jsx(Dr,{value:r,onChange:l,theme:o},E)]});const Y=[...p,t],Z=Sr(r,s,C),re=Me(r,s,C,Y.join("."));return n.jsxs("div",{className:"flex flex-col gap-2",children:[ae,n.jsx(mt,{title:t,level:g,summary:Z,errorCount:re.length+(te?1:0),defaultExpanded:b,children:n.jsx(Fe,{schema:s,value:r,onChange:l,path:Y,level:g+1})})]})},ll=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,inputClassName:c,jsonEditorTheme:d}=Le(),f=e.additionalProperties===!0||e.additionalProperties==null,p=f?{type:"string"}:typeof e.additionalProperties=="object"?se(e.additionalProperties,o):{type:"string"},g=Qn(p),[u,m]=h.useState(()=>Object.entries(t??{}).map(([S,D])=>Yr(S,D))),C=S=>Object.fromEntries(S.filter(D=>D.key!=="").map(D=>[D.key,D.value])),x=(S,D)=>{const _=u.map((E,A)=>A===S?{...E,key:D}:E);m(_),r(C(_))},b=(S,D)=>{const _=u.map((E,A)=>A===S?{...E,value:D}:E);m(_),r(C(_))},I=()=>g?Pe(p,o)??qn(p):"",N=()=>{m(S=>[...S,Yr("",I())])},T=S=>{const D=u.filter((_,E)=>E!==S);m(D),r(C(D))};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:i.noFieldsYet}),u.length>0&&!g&&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:i.keyColumnHeader}),n.jsx("span",{className:"flex-1 dial-tiny-text text-secondary font-medium",children:i.valueColumnHeader}),f&&n.jsx("span",{className:"w-28 shrink-0 dial-tiny-text text-secondary font-medium",children:i.typeColumnHeader})]}),u.map((S,D)=>n.jsx(il,{pairId:S.id,pairKey:S.key,pairValue:S.value,valueSchema:p,isUnschematizedValue:f,jsonEditorTheme:d,onKeyChange:_=>x(D,_),onValueChange:_=>b(D,_),onRemove:()=>T(D),keyInputPlaceholder:i.keyInputPlaceholder,removeFieldAriaLabel:i.removeFieldAriaLabel,path:s,level:a,readonly:l,inputClassName:c},S.id)),!l&&n.jsx("div",{className:"pt-1",children:n.jsx(v.DialGhostButton,{label:i.addField,iconBefore:n.jsx(B.IconPlus,{size:16,stroke:2}),onClick:N})})]})},Fe=({schema:e,value:t,onChange:r,path:s,level:a,required:o,suppressInlineError:i=!1})=>{const{rootSchema:l,renderField:c,markTouched:d=()=>{},touchedPaths:f=new Set,skipUntouched:p=!1,jsonEditorTheme:g}=Le(),u=se(e,l),m=b=>{d(s.join(".")),r(b)},C=!p||f.has(s.join("."));let x;if(u.oneOf)x=n.jsx(sl,{schema:u,value:t,onChange:m,path:s,level:a});else if(u.anyOf&&u.type!==V.Object)x=n.jsx(al,{schema:u,value:t,onChange:m,path:s,level:a});else if(Ye(u)){const b=u.additionalProperties!=null&&u.additionalProperties!==!1,I=!u.properties||Object.keys(u.properties).length===0;b&&I?x=n.jsx(ll,{schema:u,value:t,onChange:m,path:s,level:a}):I&&u.additionalProperties!==!1?x=n.jsx(Dr,{value:t,onChange:m,theme:g}):x=n.jsx(jt,{schema:u,value:t,onChange:m,path:s,level:a})}else if(u.type===V.Array)x=n.jsx(nl,{schema:u,value:t,onChange:m,path:s,level:a});else{const b=C&&o&&$t(t),I=!i&&b?Ir(u.title??"Field"):void 0;x=n.jsxs(n.Fragment,{children:[n.jsx(Xn,{schema:u,value:t,onChange:m,invalid:b}),n.jsx(v.DialErrorText,{text:I})]})}return c?c(s,u,x):x},cl=({schema:e,defaultValue:t,texts:r,className:s,readonly:a=!1,defaultExpanded:o=!0,inputClassName:i,variant:l=st.Sections,onChange:c,onPropertyChange:d,onDefaultValues:f,renderField:p,skipUntouched:g=!1,jsonEditorTheme:u,acceptableResourceTypes:m})=>{const C=h.useMemo(()=>({...Yi,...r}),[r]),x=h.useMemo(()=>t||(Pe(e,e)??{}),[]),[b,I]=h.useState(x),[N,T]=h.useState(new Set),S=h.useCallback(w=>{T(M=>M.has(w)?M:new Set([...M,w]))},[]);h.useEffect(()=>{f?.(x)},[]);const D=(w,M)=>{const F={...b,[w]:M};I(F),c?.(F),d?.(w,M)},_=new Set(Object.keys(e.properties??{})),E=Object.keys(b).filter(w=>!_.has(w)),A=Zn(Object.entries(e.properties??{}).filter(([,w])=>!se(w,e).isHidden)),L=e.required??[];return n.jsx(Un.Provider,{value:{rootSchema:e,texts:C,readonly:a,defaultExpanded:o,inputClassName:i,jsonEditorTheme:u,acceptableResourceTypes:m,renderField:p,touchedPaths:N,markTouched:S,skipUntouched:g},children:n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-4",s),children:[A.map(([w,M])=>{const F=se(M,e),K=F.title??M.title??Ot(w),te=L.includes(w),G=b[w];if(l===st.Flat)return n.jsx(Yn,{schema:M,value:G,onChange:U=>D(w,U),path:[w],level:0,required:te,label:K},w);if(l===st.FlatSections)return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:K}),n.jsx(Fe,{schema:M,value:G,onChange:U=>D(w,U),path:[w],level:0,required:te})]},w);const z=Me(G,F,e,w),H=w+".",q=!g||N.has(w)||[...N].some(U=>U.startsWith(H));return n.jsx(mt,{title:K,description:F.description,level:0,defaultExpanded:o,errorCount:q?te&&$t(G)?Math.max(z.length,1):z.length:0,children:n.jsx(Fe,{schema:M,value:G,onChange:U=>D(w,U),path:[w],level:1,required:te})},w)}),E.map(w=>{const M=Ot(w),F=n.jsx(Dr,{value:b[w],onChange:K=>D(w,K),theme:u});return l===st.Sections?n.jsx(mt,{title:M,level:0,defaultExpanded:o,children:F},w):n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:M}),F]},w)})]})})},dl=e=>({info:n.jsx(B.IconInfoCircleFilled,{size:e.size}),error:n.jsx(B.IconAlertCircleFilled,{size:e.size}),warning:n.jsx(B.IconAlertTriangleFilled,{size:e.size}),success:n.jsx(B.IconCircleCheckFilled,{size:e.size}),loading:n.jsx(v.Spinner,{size:e.size}),general:n.jsx(B.IconCheck,{size:e.size,stroke:e.stroke})}),ul={[v.NotificationVariant.Info]:"bg-info text-info",[v.NotificationVariant.Success]:"bg-success text-success",[v.NotificationVariant.Warning]:"bg-warning text-warning",[v.NotificationVariant.Error]:"bg-error text-error",[v.NotificationVariant.Loading]:"bg-layer-raised text-info",[v.NotificationVariant.General]:"bg-layer-sunken text-primary"},fl={[v.NotificationVariant.Info]:"status",[v.NotificationVariant.Success]:"status",[v.NotificationVariant.Warning]:"alert",[v.NotificationVariant.Error]:"alert",[v.NotificationVariant.Loading]:"status",[v.NotificationVariant.General]:"status"},pl="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",Nr=({variant:e=v.NotificationVariant.Info,type:t=v.NotificationType.Toast,title:r,message:s,action:a,className:o,iconSize:i=24,iconStroke:l=2,closable:c=!1,onClose:d,children:f,textClassName:p,...g})=>{const u=h.useMemo(()=>dl({size:i,stroke:l})[e],[e,i,l]),m=p??(t===v.NotificationType.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return n.jsxs("div",{role:fl[e],...g,className:y.mergeClasses(pl,ul[e],t===v.NotificationType.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===v.NotificationType.SectionMessage&&e===v.NotificationVariant.Loading&&"border-secondary",o,j.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(j.DialIcon,{icon:u})}),r?n.jsxs("div",{className:y.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:C=>d?.(C)})]})},Xr={2:"line-clamp-2",3:"line-clamp-3",4:"line-clamp-4",5:"line-clamp-5",6:"line-clamp-6"},gl=e=>e===1?"!truncate !whitespace-nowrap":`${Xr[e]??Xr[2]} !whitespace-normal`,Jn=({text:e,query:t,markClassName:r,className:s,maxLines:a=2})=>{const o=y.mergeClasses(gl(a),s,j.DIAL_KIT_CLASS.highlight);if(!t.trim())return n.jsx(k.EllipsisTooltip,{className:o,text:e});const i=e.toLowerCase().indexOf(t.toLowerCase()),l=i===-1?e:n.jsxs(n.Fragment,{children:[e.slice(0,i),n.jsx("mark",{className:y.mergeClasses("text-accent bg-control-accent-alpha-hover",r),children:e.slice(i,i+t.length)}),e.slice(i+t.length)]});return n.jsx(k.EllipsisTooltip,{className:o,text:l})},hl=({className:e,children:t,...r})=>n.jsx("article",{...r,className:y.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,j.DIAL_KIT_CLASS.cardShell),children:t}),it=(e,t)=>({type:s,...a})=>n.jsx(Nr,{...a,variant:e,type:s||t}),lt=(e,t)=>({variant:s,...a})=>n.jsx(Nr,{...a,variant:s||t,type:e}),ml=it(v.NotificationVariant.Error,v.NotificationType.Toast),xl=it(v.NotificationVariant.Info,v.NotificationType.Toast),bl=it(v.NotificationVariant.Success,v.NotificationType.Toast),Cl=it(v.NotificationVariant.Warning,v.NotificationType.Toast),vl=it(v.NotificationVariant.Loading,v.NotificationType.Toast),yl=it(v.NotificationVariant.General,v.NotificationType.Toast),Il=lt(v.NotificationType.SectionMessage,v.NotificationVariant.Error),Sl=lt(v.NotificationType.SectionMessage,v.NotificationVariant.Info),Dl=lt(v.NotificationType.SectionMessage,v.NotificationVariant.Success),Nl=lt(v.NotificationType.SectionMessage,v.NotificationVariant.Warning),jl=lt(v.NotificationType.SectionMessage,v.NotificationVariant.Loading),Tl=lt(v.NotificationType.SectionMessage,v.NotificationVariant.General);var Se=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(Se||{});const wl="en-GB",El={[Se.Date]:"Select date",[Se.DateTime]:"Select date and time",[Se.Time]:"--:--",[Se.Weekday]:"Select day"},es="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",ts="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",rs="!border-error",Ol="z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",Al="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",_l="bg-control-accent text-control-permanent",Ll="text-accent dial-small-semi-text",kl="text-control-disable-primary",ns="text-secondary",Rl=n.jsx(B.IconCalendar,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:ns}),Qr={prev:n.jsx(B.IconChevronLeft,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:n.jsx(B.IconChevronRight,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},Ml=(e,t)=>{const s=(new Date(e,t,1).getDay()+6)%7,a=new Date(e,t,1-s);return Array.from({length:42},(o,i)=>{const l=new Date(a);return l.setDate(a.getDate()+i),l})},Jr=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),en=(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},Pl=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),tn=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),Fl=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),yt=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,rn=(e,t)=>{const[r,s]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,s||0,0,0),a},Bl=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),zl=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}`},ss=5,as=e=>e.charAt(0).toUpperCase()+e.slice(1),$l=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,ss+r));return as(s.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),Hl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,ss+r));return{value:String(r+1),label:as(s.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),nn=({id:e,disabled:t,invalid:r,trigger:s,panelClassName:a,fieldClassName:o,panel:i,labelledBy:l,panelLabel:c})=>{const d=j.useThemeScope(),[f,p]=h.useState(!1),{refs:g,floatingStyles:u,context:m}=ee.useFloating({open:f,onOpenChange:T=>p(t?!1:T),placement:"bottom-start",whileElementsMounted:ee.autoUpdate,middleware:[ee.offset(8),ee.flip({padding:8}),ee.shift({padding:8})]}),C=ee.useClick(m,{enabled:!t}),x=ee.useDismiss(m),b=ee.useRole(m,{role:"dialog"}),{getReferenceProps:I,getFloatingProps:N}=ee.useInteractions([C,x,b]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{id:e,ref:g.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":f,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:y.mergeClasses(es,"focus-visible:outline focus-visible:outline-focus",r&&rs,t&&ts,o),...I(),children:s}),f&&n.jsx(ee.FloatingPortal,{children:n.jsx(ee.FloatingFocusManager,{context:m,modal:!1,initialFocus:-1,returnFocus:!0,children:n.jsx("div",{ref:g.setFloating,style:u,"aria-label":c,className:y.mergeClasses(Ol,d,a),...N(),children:i(()=>p(!1))})})})]})},sn=({id:e,value:t,onChange:r,onBlur:s,disabled:a,invalid:o,className:i,ariaLabel:l,placeholder:c="--:--",timezoneLabel:d})=>{const[f,p]=h.useState(t);h.useEffect(()=>{p(t)},[t]);const g=n.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":l,placeholder:c,disabled:a,value:f,onChange:u=>{const m=zl(u.target.value);p(m),Bl(m)&&r(m)},onBlur:s,className:y.mergeClasses(es,o&&rs,a&&ts,i)});return d?n.jsxs("div",{className:"relative w-full",children:[g,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})]}):g},Vl=({mode:e=Se.Date,value:t,onChange:r,onBlur:s,labelProps:a,placeholder:o,disabled:i=!1,invalid:l=!1,id:c,className:d,minDate:f,maxDate:p,locale:g=wl,fieldClassName:u,showTimezone:m=!1})=>{const C=o??El[e],x=t instanceof Date?t:null,b=h.useId(),I=c??b,N=a?.id??`${I}-label`,T=!!a?.label,S=typeof a?.label=="string"?a.label:void 0,D=T?`${N} ${I}`:void 0,_=a?n.jsx(k.Label,{...a,id:N,htmlFor:I}):null,[E,A]=h.useState(()=>x??new Date),L=h.useMemo(()=>new Date,[]),w=h.useMemo(()=>m?Gn({locale:g}):null,[m,g]),M=h.useMemo(()=>$l(g),[g]),F=h.useMemo(()=>Hl(g),[g]),K=h.useMemo(()=>Ml(E.getFullYear(),E.getMonth()),[E]),te=q=>{A(U=>new Date(U.getFullYear(),U.getMonth()+q,1))},G=(q,U)=>{if(en(q,f,p))return;const ae=e===Se.DateTime&&x?rn(q,yt(x)):q;r?.(ae),e===Se.Date&&U()},z=q=>{r?.(rn(x??new Date,q))},H=()=>x?e===Se.DateTime?`${tn(x,g)}, ${yt(x)}`:tn(x,g):C;if(e===Se.Time){const q=typeof t=="string"?t:x?yt(x):"";return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-y-3",d,j.DIAL_KIT_CLASS.calendar),children:[_,n.jsx(sn,{id:I,value:q,onChange:U=>r?.(U),onBlur:s,disabled:i,invalid:l,placeholder:C,className:u,timezoneLabel:w})]})}if(e===Se.Weekday){const q=typeof t=="string"?t:void 0,U=F.find(ae=>ae.value===q);return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-y-3",d,j.DIAL_KIT_CLASS.calendar),children:[_,n.jsx(nn,{id:I,disabled:i,invalid:l,labelledBy:D,panelLabel:S??C,fieldClassName:u,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:y.mergeClasses("truncate",!U&&"text-secondary"),children:U?.label??C}),n.jsx(B.IconChevronDown,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:ns})]}),panel:ae=>n.jsx("div",{role:"listbox","aria-label":S??C,className:"flex flex-col gap-0.5",children:F.map(Y=>n.jsx("button",{type:"button",role:"option","aria-selected":Y.value===q,className:y.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",Y.value===q&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(Y.value),ae()},children:Y.label},Y.value))})})]})}return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-y-3",d,j.DIAL_KIT_CLASS.calendar),children:[_,n.jsx(nn,{id:I,disabled:i,invalid:l,labelledBy:D,panelLabel:S??C,fieldClassName:u,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:y.mergeClasses("truncate",!x&&"text-secondary"),children:H()}),Rl]}),panel:q=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(k.StaticIconButton,{"aria-label":"Previous month",icon:Qr.prev,size:O.ElementSize.Small,onClick:()=>te(-1)}),n.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:Pl(E,g)}),n.jsx(k.StaticIconButton,{"aria-label":"Next month",icon:Qr.next,size:O.ElementSize.Small,onClick:()=>te(1)})]}),n.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[M.map(U=>n.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:U},U)),K.map(U=>{const ae=U.getMonth()!==E.getMonth(),Y=Jr(U,x),Z=Jr(U,L),re=en(U,f,p);return n.jsx("button",{type:"button",disabled:re,"aria-label":Fl(U,g),"aria-pressed":Y,"aria-current":Z?"date":void 0,className:y.mergeClasses(Al,ae&&kl,Z&&!Y&&Ll,Y&&_l,re&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>G(U,q),children:U.getDate()},U.toISOString())})]}),e===Se.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(sn,{ariaLabel:"Time",value:x?yt(x):"",onChange:z,onBlur:s,className:"w-[120px] px-3 py-1.5"})]})]})})]})},Kl=({segments:e,labelClassName:t="dial-small-text",leafClassName:r="dial-small-semi-text",className:s,ariaLabel:a="Folder path"})=>{const o=n.jsx(j.DialIcon,{icon:n.jsx(B.IconFolder,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),className:"text-secondary"}),i=e.map((l,c)=>({label:c===e.length-1?n.jsx("span",{className:r,children:l}):l,disabled:!0,...c===0?{iconBefore:o}:{}}));return n.jsx(v.DialBreadcrumb,{className:y.mergeClasses(s,j.DIAL_KIT_CLASS.folderPath),ariaLabel:a,separator:n.jsx(j.DialIcon,{icon:n.jsx(B.IconChevronRight,{size:14,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),className:"text-secondary"}),pathItems:i,labelClassName:y.mergeClasses(t,"text-secondary","!cursor-default")})};var We=(e=>(e.Small="small",e.Heading="heading",e))(We||{});const Gl="w-full overflow-hidden",Ul="flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap",an="flex min-w-0 items-center gap-2",on={[We.Small]:"dial-small-text",[We.Heading]:"dial-h2-text"},Zl={[We.Small]:"dial-small-semi-text",[We.Heading]:"dial-h2-text"},Wl={first:"shrink-0",middle:"min-w-0 max-w-[30%] shrink",last:"min-w-0 max-w-[51%] shrink"},ql="flex min-w-0 flex-1 items-center gap-1 rounded-sm transition-colors",Yl="text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",Xl="cursor-default text-primary",Ql="cursor-default text-secondary",ln="inline-flex flex-none items-center leading-none text-secondary",Jl="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",ec=3,tc=4,rc=n.jsx(B.IconChevronRight,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),nc=({items:e,maxVisibleItems:t=tc,size:r=We.Small,separator:s=rc,ariaLabel:a="Breadcrumb",overflowAriaLabel:o="Show hidden path segments",className:i,itemClassName:l})=>{const c=Math.max(t,ec),d=h.useMemo(()=>e.length>c?e.slice(1,-(c-2)):[],[e,c]),f=h.useMemo(()=>d.map((m,C)=>({key:String(C),label:m.label,icon:m.icon})),[d]),p=h.useCallback(({key:m,domEvent:C})=>{const x=d[Number(m)];x&&(x.onClick?.(C),!x.onClick&&x.href&&!C.defaultPrevented&&(window.location.href=x.href))},[d]);if(e.length===0)return null;const g=e.slice(d.length+1),u=(m,{index:C,isFirst:x,isCurrent:b})=>{const I=!b&&(!!m.href||!!m.onClick),N=y.mergeClasses(ql,I?Yl:b?y.mergeClasses(Xl,Zl[r]):Ql,l,j.DIAL_KIT_CLASS.breadcrumbsItem),T=n.jsxs(n.Fragment,{children:[m.icon,n.jsx(k.EllipsisTooltip,{text:m.label})]});return n.jsxs("li",{className:y.mergeClasses(an,on[r],Wl[b?"last":x?"first":"middle"]),children:[I?m.href?n.jsx("a",{href:m.href,onClick:m.onClick,className:N,children:T}):n.jsx("button",{type:"button",onClick:m.onClick,className:N,children:T}):n.jsx("span",{className:N,"aria-current":b?"page":void 0,children:T}),!b&&n.jsx("span",{className:ln,"aria-hidden":"true",children:s})]},`segment-${C}`)};return n.jsx("nav",{"aria-label":a,className:y.mergeClasses(Gl,i,j.DIAL_KIT_CLASS.breadcrumbs),children:n.jsxs("ol",{className:Ul,children:[u(e[0],{index:0,isFirst:!0,isCurrent:e.length===1}),d.length>0&&n.jsxs("li",{className:y.mergeClasses(an,on[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":o,className:Jl,children:n.jsx(B.IconDots,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})}),n.jsx("span",{className:ln,"aria-hidden":"true",children:s})]}),g.map((m,C)=>u(m,{index:e.length-g.length+C,isFirst:!1,isCurrent:C===g.length-1}))]})})},Xe=({label:e,variant:t,appearance:r=O.ButtonAppearance.Solid,size:s=O.ElementSize.Standard,className:a,textClassName:o,iconAfter:i,iconBefore:l,type:c="button",tooltipProps:d,href:f,target:p,rel:g,disabled:u,...m})=>{const C=y.mergeClasses("dial-kit-base-button",t&&k.getButtonClassNames(t,r),s===O.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",s===O.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",s===O.ElementSize.Small&&"dial-kit-base-button-small",r!==O.ButtonAppearance.Link&&(s===O.ElementSize.Small?"px-2":"px-4"),s!==O.ElementSize.Small&&r!==O.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),x=e?void 0:d?.tooltip,b=O.resolveAccessibleName(typeof e=="string"?e:void 0,m["aria-label"],x),I=n.jsxs(n.Fragment,{children:[n.jsx(j.DialIcon,{icon:l}),e&&n.jsx("span",{className:o,children:e}),n.jsx(j.DialIcon,{icon:i})]}),N=m,T=f!==void 0?n.jsx("a",{...N,href:u?void 0:f,target:p,rel:g??(p==="_blank"?"noopener noreferrer":void 0),"aria-disabled":u||void 0,tabIndex:u?-1:N.tabIndex,onClick:u?void 0:N.onClick,className:C,"aria-label":b,children:I}):n.jsx("button",{...m,...k.getDisabledButtonProps(u,d,m.onClick),type:c,className:C,"aria-label":b,children:I});return d?n.jsx(k.Tooltip,{asChild:!0,...d,children:T}):T},jr=(e,t)=>({appearance:s,...a})=>n.jsx(Xe,{...a,variant:e,appearance:s||t}),Tr=(e,t)=>({variant:s,...a})=>n.jsx(Xe,{...a,variant:s||t,appearance:e}),os=jr(O.ButtonVariant.Primary,O.ButtonAppearance.Solid),wr=jr(O.ButtonVariant.Neutral,O.ButtonAppearance.Solid),sc=jr(O.ButtonVariant.Danger,O.ButtonAppearance.Solid),nt={x1:"-5.06",y1:"2.26",x2:"30.62",y2:"22.63",from:"var(--stroke-gradient-1, #5976E9)",to:"var(--stroke-gradient-2, #885DF2)"},ac=({appearance:e=O.ButtonAppearance.Outlined,iconBefore:t,iconAfter:r,style:s,...a})=>{const o=`dial-kit-starter-gradient-${h.useId().replace(/[^\w-]/g,"")}`,i=n.jsx("svg",{className:"pointer-events-none absolute size-0 overflow-hidden","aria-hidden":"true",focusable:"false",children:n.jsx("defs",{children:n.jsxs("linearGradient",{id:o,x1:nt.x1,y1:nt.y1,x2:nt.x2,y2:nt.y2,gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:nt.from}),n.jsx("stop",{offset:"1",stopColor:nt.to})]})})}),l=c=>n.jsxs(n.Fragment,{children:[i,c]});return n.jsx(Xe,{...a,variant:O.ButtonVariant.Starter,appearance:e,iconBefore:t?l(t):void 0,iconAfter:r&&!t?l(r):r,style:{"--dial-kit-starter-icon-stroke":`url(#${o})`,...s}})},oc=Tr(O.ButtonAppearance.Link,O.ButtonVariant.Primary),ic=Tr(O.ButtonAppearance.Ghost,O.ButtonVariant.Primary),lc=Tr(O.ButtonAppearance.Outlined,O.ButtonVariant.Neutral),cc=({className:e,icon:t,tooltipProps:r,type:s="button",...a})=>{const o=y.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),i=n.jsx("button",{...a,type:s,className:o,"aria-label":O.resolveAccessibleName(a["aria-label"],r?.tooltip),children:t||n.jsx(B.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return r?n.jsx(O.DialTooltip,{...r,children:i}):i},dc=e=>n.jsx(B.IconChevronDown,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:y.mergeClasses("transition-transform",e&&"rotate-180")}),uc=({variant:e,appearance:t,items:r,dropdownProps:s,...a})=>{const[o,i]=h.useState(!1),l=h.useMemo(()=>dc(o),[o]);return n.jsx("div",{className:j.DIAL_KIT_CLASS.buttonDropdown,children:n.jsx(k.Dropdown,{...s,items:r,onOpenChange:c=>i(c),children:n.jsx(Xe,{...a,iconAfter:l,variant:e||O.ButtonVariant.Primary,appearance:t||O.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":o})})})},is=({label:e,size:t,isOpen:r=!1,labelClassName:s,className:a,"aria-label":o,...i})=>{const l=t===O.ElementSize.Small?"h-[32px]":"h-[40px] dial-kit-enhanced-target";return n.jsxs("button",{type:"button",...i,"aria-haspopup":"menu","aria-expanded":r,"aria-label":o?`${o} ${e}`:void 0,className:y.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",l,a,j.DIAL_KIT_CLASS.inlineSelect),children:[n.jsx("span",{className:s,children:e}),n.jsx(B.IconChevronDown,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:y.mergeClasses("transition-transform",r&&"rotate-180")})]})},fc=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:s,size:a,disabled:o,placement:i="bottom-end",matchReferenceWidth:l=!1,listClassName:c,listStyle:d,ariaLabel:f,triggerClassName:p,triggerLabelClassName:g,open:u,onOpenChange:m})=>{const[C,x]=h.useState(!1),b=u!==void 0,I=b?u:C,N=h.useCallback(L=>{b||x(L),m?.(L)},[b,m]),[T,S]=h.useState(r??e[0]?.key),D=t!==void 0,_=D?t:T,E=h.useMemo(()=>{const L=e.find(w=>w.key===_);return L?.label?String(L.label):""},[e,_]),A=h.useCallback(({key:L})=>{const w=e.find(M=>M.key===L);w&&(D||S(L),s?.(w))},[e,D,s]);return n.jsx(k.Dropdown,{items:e,placement:i,matchReferenceWidth:l,listClassName:c,listStyle:d,disabled:o,open:b?u:void 0,onOpenChange:N,onItemClick:A,children:n.jsx(is,{label:E,size:a,isOpen:I,disabled:o,"aria-label":f,className:p,labelClassName:g})})},Ve=({text:e,className:t,variant:r=v.CaptionType.Description,...s})=>e?n.jsx("span",{...s,role:"alert",className:y.mergeClasses("dial-tiny-text",r===v.CaptionType.Error?"text-error":"text-secondary",t,j.DIAL_KIT_CLASS.captionText,r===v.CaptionType.Error&&j.DIAL_KIT_CLASS.errorText),children:e}):null,Ke=({...e})=>n.jsx(Ve,{...e,variant:v.CaptionType.Error}),pc="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",gc={[O.ElementSize.Small]:"size-[24px]",[O.ElementSize.Standard]:"size-[40px]",[O.ElementSize.Large]:"size-[48px]"},hc=({icon:e,onClick:t,disabled:r,size:s=O.ElementSize.Standard,className:a})=>n.jsx("div",{className:y.mergeClasses("border-l border-tertiary",gc[s]),children:n.jsx(k.IconButton,{className:y.mergeClasses(pc,s===O.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:s})}),mc=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],ls=(e,t,r,s)=>{if((t==="number"||r!==void 0||s!==void 0)&&!mc.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 o=e.currentTarget.value,i=e.currentTarget.selectionStart,l=e.currentTarget.selectionEnd??i,c=o.slice(0,i)+e.key+o.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}}}}},cs={[O.ElementSize.Small]:{field:"dial-kit-input-small gap-x-1",paddingStart:"pl-2",paddingEnd:"pr-2",stackGap:"gap-1",postfixText:"dial-tiny-text"},[O.ElementSize.Standard]:{field:"gap-x-2 py-2",paddingStart:"pl-3",paddingEnd:"pr-3",stackGap:"gap-2",postfixText:"dial-small-text"},[O.ElementSize.Large]:{field:"gap-x-2 py-3",paddingStart:"pl-4",paddingEnd:"pr-4",stackGap:"gap-2",postfixText:"dial-body-text"}},$e=({labelProps:e,error:t,caption:r,id:s,containerClassName:a,size:o=O.ElementSize.Standard,...i})=>n.jsxs("div",{className:y.mergeClasses("flex flex-col",cs[o].stackGap,a),children:[e&&n.jsx(k.Label,{...e,htmlFor:s}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(ds,{id:s,size:o,...i}),n.jsx(Ke,{text:t}),!t&&n.jsx(Ve,{text:r})]})]}),ds=({invalid:e,disabled:t,prefix:r,className:s,postfix:a,children:o,iconBefore:i,iconAfter:l,wrapperClassName:c,type:d,inputRef:f,value:p,tooltipText:g,min:u,onChange:m,max:C,inputButtonProps:x,wrapperRef:b,size:I=O.ElementSize.Standard,...N})=>{const T=cs[I],S=h.useRef(null),D=ee.useMergeRefs([f,S]),_=d==="number"||u!==void 0||C!==void 0;h.useEffect(()=>{const w=S.current;if(!w||!_||t)return;const M=F=>{F.preventDefault()};return w.addEventListener("wheel",M,{passive:!1}),()=>{w.removeEventListener("wheel",M)}},[t,_,d]);const E=w=>{ls(w,d,u,C)},A=w=>{const M=w.currentTarget.value;if(_&&M!==""){const F=parseFloat(M);if(isNaN(F)&&M!=="-"&&M!=="."||!isNaN(F)&&(u!==void 0&&F<+u||C!==void 0&&F>+C))return}m?.(M||void 0)},L=()=>n.jsxs("div",{ref:b,className:y.mergeClasses("dial-kit-input flex flex-row items-center justify-between",T.field,e&&"dial-kit-input-error",t&&"dial-kit-input-disable",!r&&T.paddingStart,!x&&T.paddingEnd,c),"aria-label":"input-container",children:[r&&n.jsx("div",{className:"border-r border-secondary",children:n.jsx(ds,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,size:I,id:`${r}_textBefore`})}),n.jsx(j.DialIcon,{icon:i}),o,n.jsx("input",{ref:D,type:d,autoComplete:d==="password"?"new-password":"off",value:p??"",className:y.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",s),onChange:A,onKeyDown:E,min:u,disabled:t,max:C,...N}),a&&n.jsxs("p",{className:y.mergeClasses("text-secondary",T.postfixText),children:[" ",a]}),n.jsx(j.DialIcon,{icon:l}),x&&n.jsx(hc,{size:I,...x,disabled:t})]});return t&&d!=="password"?n.jsx(k.Tooltip,{tooltip:g||p,children:L()}):L()},us=({availableWidth:e,tagWidths:t,overflowChipWidth:r,gap:s})=>{if(e<=0)return t.length;let a=0,o=0;for(const i of t){const l=i+s;if(a+l>e)break;a+=l,o++}if(o===t.length)return o;for(;o>0&&a+r>e;)o--,a-=t[o]+s;return o};var qe=(e=>(e.Outlined="outlined",e.Selectable="selectable",e))(qe||{});const xc="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",bc={[qe.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[qe.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"}},Cc="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",vc="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Ae=({label:e,icon:t,appearance:r=qe.Outlined,selected:s=!1,disabled:a=!1,closable:o=!1,removeLabel:i,className:l,title:c,onClick:d,onRemove:f,onKeyDown:p,...g})=>{const u=r===qe.Selectable,m=!!d&&!a,C=o&&!!f&&!a,x=u&&s,b=I=>{p?.(I),!(!m||I.defaultPrevented)&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),I.currentTarget.click())};return n.jsxs("span",{...g,role:m?"button":g.role,tabIndex:m?0:g.tabIndex,"aria-disabled":a||void 0,"aria-pressed":u&&m?s:void 0,onClick:a?void 0:d,onKeyDown:b,className:y.mergeClasses(xc,x?"dial-tiny-semi-text":"dial-tiny-text",bc[r][s?"selected":"default"],a&&"cursor-not-allowed",m&&[Cc,vc],l,j.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}),C&&n.jsx(k.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:O.ElementSize.Small,"aria-label":i??`Remove ${e}`,icon:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:I=>{I.stopPropagation(),f?.(I)}})]})},At="h-[24px] max-w-full rounded-md border border-secondary bg-layer-sunken px-2",pt=({options:e,selectedValues:t,handleRemoveTag:r,tagClassName:s})=>n.jsx(n.Fragment,{children:t.map(a=>{const o=e.find(i=>i.value===a);return n.jsx(Ae,{label:o?.label??a,closable:!!r,onRemove:i=>r?.(i,a),icon:o?.icon,className:y.mergeClasses(At,s)},a)})}),yc=8,Ic=e=>e.stopPropagation(),Sc=e=>{e.key!=="Escape"&&e.stopPropagation()},Dc=({options:e,selectedValues:t,handleRemoveTag:r})=>{const s=h.useRef(null),a=h.useRef(null),[o,i]=h.useState(null),l=h.useCallback(()=>{const p=s.current,g=a.current;if(!p||!g)return;const u=Array.from(g.children,C=>C.offsetWidth),m=u.pop()??0;i(us({tagWidths:u,overflowChipWidth:m,availableWidth:p.clientWidth,gap:yc}))},[]);h.useLayoutEffect(()=>{l()},[l,e,t]),h.useLayoutEffect(()=>{const p=s.current;return p?j.observeElementSize(p,l):void 0},[l]);const c=o??t.length,d=t.slice(0,c),f=t.slice(c);return n.jsxs("div",{ref:s,className:"relative flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:[n.jsx(pt,{options:e,selectedValues:d,handleRemoveTag:r,tagClassName:"min-w-0"}),f.length>0&&n.jsx(k.InteractiveTooltip,{asChild:!0,placement:k.TooltipPlacement.Bottom,content:n.jsx("div",{className:"flex flex-wrap gap-2",onClick:Ic,onKeyDown:Sc,children:n.jsx(pt,{options:e,selectedValues:f,handleRemoveTag:r})}),children:n.jsx(Ae,{label:`+${f.length}`,role:"button",tabIndex:0,"aria-haspopup":"true","aria-label":`${f.length} more selected: ${f.map(p=>e.find(g=>g.value===p)?.label??p).join(", ")}`,title:"",className:y.mergeClasses(At,"shrink-0")})}),n.jsxs("div",{ref:a,"aria-hidden":"true",inert:!0,className:"pointer-events-none invisible absolute left-0 top-0 flex h-0 w-max gap-2 overflow-hidden",children:[n.jsx(pt,{options:e,selectedValues:t,handleRemoveTag:r,tagClassName:"shrink-0"}),n.jsx(Ae,{label:`+${t.length}`,className:y.mergeClasses(At,"shrink-0")})]})]})},Nc=y.mergeClasses("w-full flex flex-col"),jc=k.overlayItemClassName,Tc="!max-w-[var(--reference-width)]",wc=y.mergeClasses("max-h-[344px] overflow-y-auto py-1",k.overlayListClassName),Ec=k.overlayGap,Oc=k.overlaySubMenuListClassName,Ac=n.jsx(B.IconChevronRight,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),_c="text-secondary transition-transform",Lc=8,kc=n.jsx(B.IconSearch,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Rc=n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Mc=n.jsx(k.SvgNoData,{width:$.DIAL_ICON_SIZE.LG,height:$.DIAL_ICON_SIZE.LG,"aria-hidden":"true"}),Pc=({opt:e,selectedValues:t,mark:r=k.MenuItemMark.Tint,onSelect:s})=>{const{isOpen:a,nodeId:o,refs:i,floatingStyles:l,context:c,getReferenceProps:d,getFloatingProps:f}=j.useSubMenuFloating(Ec,"listbox",!!e.disabled),p=e.children?.some(u=>t.includes(u.value)),g=n.jsx(k.MenuItem,{ref:i.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:Ac,...d()});return n.jsxs(ee.FloatingNode,{id:o,children:[e.interactiveTooltip?n.jsx(k.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:g}):g,a&&n.jsx(j.SubMenuPanel,{refs:i,floatingStyles:l,context:c,getFloatingProps:f,role:"listbox",surfaceClassName:Oc,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(h.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)})})]})},Fc=({options:e,multiple:t=!1,id:r,value:s,defaultValue:a,size:o=O.ElementSize.Standard,prefix:i,customSelectedValue:l,placeholder:c="Select...",labelProps:d,error:f,caption:p,ariaLabel:g,searchable:u=!1,searchSize:m=O.ElementSize.Standard,searchPlaceholder:C,selectAll:x=!1,invalid:b,selectAllLabel:I="Select all",collapseTagOverflow:N=!1,selectedOptionMark:T=k.MenuItemMark.Tint,emptyStateTitle:S="No options available",emptyStateDescription:D,emptyStateIcon:_,disabled:E=!1,className:A,fieldClassName:L,listClassName:w,closable:M=!1,header:F,footer:K,onClose:te,onChange:G,dismissRef:z,onFooterClick:H,open:q,onOpenChange:U,onSearchQueryChange:ae,customMultiSelectTagsRenderer:Y})=>{const Z=h.useId(),re=r||Z,oe=`list-${re}`,le=o===O.ElementSize.Small,[ue,me]=h.useState(!1),Ce=q!==void 0,ge=Ce?!!q:ue,W=h.useCallback(P=>{Ce||me(P),U?.(P)},[Ce,U]),[Q,we]=h.useState(""),ke=h.useCallback(P=>{P!==Q&&(we(P||""),ae?.(P||""))},[ae,Q]),X=s!==void 0,[de,Ee]=h.useState(a),xe=X?s:de,fe=h.useMemo(()=>t?Array.isArray(xe)?xe:[]:typeof xe=="string"?[xe]:[],[xe,t]),Qe=h.useMemo(()=>{const P=Q.trim().toLowerCase();return P?e.filter(pe=>pe.label.toLowerCase().includes(P)):e},[e,Q]);h.useEffect(()=>{ge||ke("")},[ge,ke]);const ye=h.useCallback(P=>{X||Ee(P),G?.(P)},[X,G]),ct=h.useCallback(P=>{if(t){const pe=new Set(fe);pe.has(P)?pe.delete(P):pe.add(P),ye(Array.from(pe));return}ye(P),W(!1)},[t,ye,W,fe]),Je=h.useCallback((P,pe)=>{if(P.stopPropagation(),!t){ye("");return}const Ct=fe.filter(Ts=>Ts!==pe);ye(Ct)},[t,fe,ye]),ve=h.useMemo(()=>Qe.filter(P=>!P.disabled),[Qe]),ze=h.useMemo(()=>ve.filter(P=>fe.includes(P.value)).length,[ve,fe]),{allSelectedInFiltered:be,someSelectedInFiltered:Ht}=h.useMemo(()=>{const P=ve.length>0&&ze===ve.length;return{allSelectedInFiltered:P,someSelectedInFiltered:ze>0&&!P}},[ve,ze]),et=h.useCallback(()=>{if(!(!t||ve.length===0))if(be){const P=new Set(ve.map(pe=>pe.value));ye(fe.filter(pe=>!P.has(pe)))}else{const P=new Set(fe);ve.forEach(pe=>P.add(pe.value)),ye(Array.from(P))}},[be,t,ve,fe,ye]),Ge=fe.length>0,R=!t&&Ge?fe[0]:void 0,ne=h.useMemo(()=>R?e.find(P=>P.value===R)??e.flatMap(P=>P.children??[]).find(P=>P.value===R):void 0,[e,R]),Ie=ne?i?`${i} ${ne.label}`:ne.label:void 0,Vt=j.useIsMobileScreen(),Kt=t&&N&&!Y&&!Vt,dt=h.useMemo(()=>t?Ge?Kt?n.jsx(Dc,{options:e,selectedValues:fe,handleRemoveTag:Je}):n.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",children:Y?.(e,fe,Je)??n.jsx(pt,{options:e,selectedValues:fe,handleRemoveTag:Je})}):null:!ne||!ne.labelNode&&!ne.description?null:n.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[n.jsx(k.EllipsisTooltip,{text:ne.labelNode??Ie}),ne.description&&n.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:ne.description})]}),[Kt,Y,Je,Ge,t,e,Ie,fe,ne]),Is=t||dt?"":Ie||(l&&s?l:""),Ss=typeof d?.label=="string"?d.label:void 0,Ds=dt?[O.resolveAccessibleName(g,Ss),t?fe.map(P=>e.find(pe=>pe.value===P)?.label??P).join(", "):Ie].filter(Boolean).join(", ")||void 0:O.resolveAccessibleName(g);h.useImperativeHandle(z,()=>({dismiss:()=>{W(!1)}}));const Ns=h.useCallback(P=>{E||(P.key==="ArrowDown"||P.key==="ArrowUp")&&(P.preventDefault(),ge||W(!0))},[E,ge,W]),js=()=>n.jsxs("div",{id:oe,role:"listbox","aria-multiselectable":t||void 0,className:Nc,children:[F&&n.jsx(n.Fragment,{children:typeof F=="function"?F():F}),(u||M)&&(e.length>Lc||!!Q)&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[u&&n.jsx($e,{id:`search-${re}`,size:m,placeholder:C,"aria-label":C||"Search options",onChange:P=>ke(P),value:Q,iconBefore:kc,containerClassName:"w-full"}),M&&n.jsx(k.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:O.ElementSize.Small,icon:Rc,onClick:P=>{te?.(P),W(!1)}})]}),t&&x&&ve.length>0&&n.jsx("div",{className:y.mergeClasses(jc,"mt-2"),children:n.jsx(k.Checkbox,{id:`${re}-selectAll`,labelProps:{label:I},isSelected:be,isIndeterminate:Ht,onChange:et})}),n.jsx("div",{role:"none",className:wc,children:Qe.length===0?n.jsx("div",{className:"px-2 py-3",children:n.jsx(j.DialNoDataContent,{icon:_??Mc,title:S,description:D})}):Qe.map(P=>{const pe=fe.includes(P.value);if(P.children?.length)return n.jsx(Pc,{opt:P,selectedValues:fe,mark:t?k.MenuItemMark.Checkbox:T,onSelect:ct},P.value);const Ct=t?n.jsx(k.MenuItem,{id:`${re}-${P.value}`,role:"option","aria-selected":pe,"aria-disabled":!!P.disabled,disabled:P.disabled,mark:k.MenuItemMark.Checkbox,selected:pe,icon:P.icon,label:P.labelNode??P.label,description:P.description,rightControl:P.rightControl,onClick:()=>ct(P.value)}):n.jsx(k.MenuItem,{role:"option","aria-selected":pe,"aria-disabled":!!P.disabled,disabled:P.disabled,mark:T,selected:pe,ellipsisLabel:!0,icon:P.icon,label:P.labelNode??P.label,description:P.description,rightControl:P.rightControl,onClick:()=>!P.disabled&&ct(P.value)});return n.jsx(h.Fragment,{children:P.interactiveTooltip?n.jsx(k.InteractiveTooltip,{asChild:!0,placement:P.interactiveTooltip.placement,content:P.interactiveTooltip.content,contentClassName:P.interactiveTooltip.contentClassName,children:Ct}):Ct},P.value)})}),K&&n.jsx("div",{onClick:P=>{H?.(P),H&&W(!1)},children:typeof K=="function"?K():K})]});return n.jsxs("div",{className:y.mergeClasses("flex w-full flex-col gap-2",A,j.DIAL_KIT_CLASS.select),children:[d&&n.jsx(k.Label,{...d,htmlFor:re}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(k.Dropdown,{open:ge,onOpenChange:W,disabled:E,closable:M,onClose:te,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:y.mergeClasses(Tc,w),className:"w-full",renderOverlay:js,children:n.jsx($e,{id:re,size:o,disabled:E,invalid:b,value:Is,placeholder:dt?void 0:c,readOnly:!0,iconBefore:t?void 0:ne?.icon,iconAfter:n.jsx(B.IconChevronDown,{size:le?$.DIAL_ICON_SIZE.SM:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:y.mergeClasses(_c,ge&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":ge,"aria-controls":oe,"aria-autocomplete":"none","aria-label":Ds,containerClassName:"w-full",wrapperClassName:y.mergeClasses(!E&&"cursor-pointer",t&&Ge&&!Kt&&["!h-auto flex-wrap py-2",le?"min-h-[24px]":"min-h-[40px]"],L),className:y.mergeClasses("cursor-pointer",dt&&"w-0 min-w-0 flex-none p-0"),onKeyDown:Ns,children:dt})}),n.jsx(Ke,{text:f}),!f&&n.jsx(Ve,{text:p})]})]})};var fs=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(fs||{});const cn={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},Bc=e=>typeof e=="boolean"?cn[e?"both":"none"]:cn[e],zc=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:o=!1,labelProps:i,caption:l,id:c,...d})=>{const f=y.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",d.invalid&&"dial-kit-input-error",d.disabled&&"dial-kit-input-disable",Bc(o),e);return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-2",a),children:[i&&n.jsx(k.Label,{...i,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(Ke,{text:s}),!s&&n.jsx(Ve,{text:l})]})]})},$c=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:r,size:s=O.ElementSize.Standard,...a})=>{const[o,i]=h.useState(!1),l=o&&!r;return h.useEffect(()=>{r&&i(!1)},[r]),n.jsx($e,{...a,wrapperClassName:y.mergeClasses(a.wrapperClassName,j.DIAL_KIT_CLASS.passwordInput),size:s,disabled:r,type:l?"text":"password",iconAfter:r?void 0:n.jsx(k.GhostIconButton,{size:O.ElementSize.Small,"aria-label":l?t:e,"aria-pressed":l,icon:l?n.jsx(B.IconEyeOff,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx(B.IconEye,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>i(c=>!c)})})},Hc=/^0+\.(\d+)?$/,Vc=/^0+/,Kc=[".","-","+","e","E"],dn=e=>!e||e==="-"?e:String(e).match(Hc)?String(e).replace(Vc,"0"):Number(e),Gc=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:o,...i})=>{const l=d=>{if(e&&Kc.includes(d.key)){d.preventDefault();return}ls(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 g=d.currentTarget,u=g.selectionStart??0,m=g.selectionEnd??0,C=g.value.slice(0,u)+p+g.value.slice(m);t?.(dn(C))}}o?.(d)};return n.jsx($e,{...i,wrapperClassName:y.mergeClasses(i.wrapperClassName,j.DIAL_KIT_CLASS.numberInput),type:"number",min:r,max:s,onChange:d=>t?.(dn(d)),onKeyDown:l,onPaste:c})},Uc="z-popup flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",Zc="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",Wc="flex flex-row items-center justify-between px-6 py-4",qc="flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary",Yc="border-b border-tertiary",Xc="flex flex-row items-center gap-2 px-6 py-4",Qc="border-t border-tertiary",nr="flex shrink-0 flex-row items-center gap-2",Jc={[v.PopupSize.Sm]:"max-w-full md:max-w-[400px]",[v.PopupSize.Md]:"max-w-full md:max-w-[800px]",[v.PopupSize.Lg]:"max-w-full md:max-w-[1200px]"},Er=({open:e=!1,header:t,ariaLabel:r,portalId:s,className:a,overlayClassName:o,titleClassName:i,headerClassName:l,bodyClassName:c,children:d,footer:f,footerClassName:p,onClose:g,onBack:u,backAriaLabel:m="Back",headerActions:C,headerDivider:x=!1,mainButtons:b,additionalButtons:I,additionalButtonsOnLeft:N=!1,footerDivider:T=!1,size:S=v.PopupSize.Md,hideClose:D=!1,closeAriaLabel:_="Close dialog",closeOnOutsideClick:E=!0,preventKeyboardOnOpen:A=!1})=>{const L=j.useThemeScope(),w=h.useRef(null),M=h.useId(),{refs:F,context:K}=ee.useFloating({open:e,onOpenChange:Z=>{Z||g?.(null)}}),te=ee.useRole(K,{role:"dialog"}),G=ee.useDismiss(K,{outsidePress:E}),{getFloatingProps:z}=ee.useInteractions([te,G]);if(!e)return null;const H=typeof t=="string"?`popup-heading-${M}`:void 0,q=Z=>Z?typeof Z=="string"?n.jsx("h2",{id:H,className:y.mergeClasses(qc,i),children:n.jsx(k.Tooltip,{tooltip:Z,triggerClassName:"truncate",children:Z})}):Z:n.jsx("span",{}),U=D?null:n.jsx(k.CloseButton,{ariaLabel:_,onClose:Z=>g?.(Z)}),ae=(Z,re=[])=>re.map(({variant:oe=O.ButtonVariant.Neutral,...le},ue)=>n.jsx(Xe,{variant:oe,...le},`${Z}-${ue}`)),Y=()=>{if(f!==void 0)return f;if(!b?.length&&!I?.length)return null;const Z=ae("additional",I);return n.jsxs("div",{className:y.mergeClasses(Xc,T&&Qc,p),children:[N&&Z.length>0&&n.jsx("div",{className:nr,children:Z}),n.jsxs("div",{className:y.mergeClasses(nr,"ml-auto"),children:[!N&&Z,ae("main",b)]})]})};return n.jsx(ee.FloatingPortal,{id:s,children:n.jsx(ee.FloatingOverlay,{className:y.mergeClasses(Uc,L,o),children:n.jsx(ee.FloatingFocusManager,{context:K,initialFocus:A?w:F.floating,children:n.jsxs("div",{ref:F.setFloating,...z(),role:"dialog","aria-modal":"true","aria-labelledby":H,"aria-label":H?void 0:r,className:y.mergeClasses(Zc,Jc[S],a,j.DIAL_KIT_CLASS.popup),children:[A&&n.jsx("div",{ref:w,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),n.jsxs("div",{className:y.mergeClasses(Wc,x&&Yc,l),children:[u&&n.jsx(k.GhostIconButton,{"aria-label":m,size:O.ElementSize.Small,className:"mr-2",onClick:u,icon:n.jsx(B.IconChevronLeft,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),q(t),C?n.jsxs("div",{className:nr,children:[C,U]}):U]}),n.jsx("div",{className:y.mergeClasses("grow overflow-auto",c),children:d}),Y()]})})})})},ed="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",td="text-secondary dial-small-paragraph-text px-6 pb-4",rd="px-6 py-4 h-[120px]",nd="Cancel",sd="Ok",un={[v.ConfirmationPopupVariant.Info]:{confirm:{variant:O.ButtonVariant.Primary,appearance:O.ButtonAppearance.Solid}},[v.ConfirmationPopupVariant.Danger]:{confirm:{variant:O.ButtonVariant.Danger,appearance:O.ButtonAppearance.Solid}}},ps=({header:e,description:t,descriptionClassName:r,open:s=!1,confirmLabel:a=sd,cancelLabel:o=nd,isLoading:i=!1,disableConfirmButton:l=!1,className:c,confirmClassName:d,onClose:f,onConfirm:p,onCancel:g,children:u,variant:m=v.ConfirmationPopupVariant.Info,size:C=v.PopupSize.Sm,footer:x,hideClose:b,...I})=>{const N=i?null:n.jsxs("div",{className:ed,children:[n.jsx(wr,{label:o,onClick:()=>g?g():f?.()}),n.jsx(Xe,{variant:un[m].confirm.variant,appearance:un[m].confirm.appearance,className:d,label:a,disabled:l,onClick:p})]}),T=h.useCallback(()=>i?n.jsx("div",{className:rd,children:n.jsx(v.Spinner,{size:40})}):u??(t?n.jsx("div",{className:y.mergeClasses(td,r),children:t}):null),[u,t,i,r]);return n.jsx(Er,{...I,open:s,header:e,className:y.mergeClasses(c,j.DIAL_KIT_CLASS.confirmationPopup),onClose:()=>f?.(),footer:x??N,size:C,hideClose:b??(!i&&x===void 0),children:T()})};var _t=(e=>(e.Start="start",e.End="end",e))(_t||{});const ad=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,ariaLabel:l,onToggle:c,caretPosition:d=_t.End,className:f,headerClassName:p,contentClassName:g})=>{const u=s!==void 0,[m,C]=h.useState(a),x=i?!0:u?s:m,b=h.useId(),I=`accordion-header-${b}`,N=`accordion-content-${b}`,T=()=>{if(o)return;const A=!x;u||C(A),c?.(A)},S=d===_t.Start,D=i?null:n.jsx(B.IconChevronRight,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:y.mergeClasses("shrink-0 text-secondary transition-transform motion-reduce:transition-none",x?"rotate-90":"rtl:rotate-180")}),_=n.jsxs(n.Fragment,{children:[S&&D,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]}),!S&&D]}),E=S?"justify-start gap-2":"justify-between";return n.jsxs("div",{className:y.mergeClasses("flex flex-col py-3 overflow-hidden bg-transparent",f,j.DIAL_KIT_CLASS.accordion),children:[i?n.jsx("div",{id:I,className:y.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",E,p),children:_}):n.jsx("button",{id:I,type:"button","aria-expanded":x,"aria-controls":N,"aria-label":O.resolveAccessibleName(l),disabled:o,onClick:T,className:y.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",E,o?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",p),children:_}),n.jsx("div",{inert:!x,className:y.mergeClasses("grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",x?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:n.jsx("div",{className:"min-h-0 overflow-hidden",children:n.jsx("div",{className:"pt-3",children:n.jsx("div",{id:N,role:"region","aria-labelledby":I,className:y.mergeClasses("px-4 dial-small-text text-primary",g),children:r})})})})]})},od=({id:e,labelProps:t,isOn:r=!1,disabled:s,onChange:a,caption:o,className:i,...l})=>{const c=h.useId(),d=e??c,f=o?`${d}-caption`:void 0,p=h.useCallback(g=>{a?.(g.target.checked)},[a]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:y.mergeClasses("flex items-center gap-2",i,j.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":O.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":f,className:"peer sr-only"}),n.jsx("label",{htmlFor:d,className:y.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":y.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:y.mergeClasses("size-3.5 shrink-0 rounded-full",s?"bg-control-disable-secondary":"bg-control-neutral")})}),t&&n.jsx(k.Label,{size:O.ElementSize.Standard,...t,htmlFor:d,className:y.mergeClasses("py-[1px]",s?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),o&&n.jsx("span",{id:f,className:"dial-tiny-text text-secondary ml-[44px]",children:o})]})},id="flex flex-col gap-2",ld="flex",cd="mt-2 ml-[26px]",dd={[v.RadioGroupOrientation.Column]:"flex-col gap-y-3",[v.RadioGroupOrientation.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},gs=({items:e,value:t,onChange:r,name:s,id:a,orientation:o=v.RadioGroupOrientation.Column,labelProps:i,disabled:l,error:c,caption:d,ariaLabel:f,className:p,optionsClassName:g,radioClassName:u,contentClassName:m})=>{const C=h.useId(),x=a??C,b=`${x}-label`,I=c?`${x}-error`:void 0,N=!c&&d?`${x}-caption`:void 0,T=O.resolveAccessibleName(i?.label);return n.jsxs("div",{className:y.mergeClasses(id,p,j.DIAL_KIT_CLASS.radioGroup),children:[i&&n.jsx(k.Label,{...i,id:b}),n.jsx("div",{role:"radiogroup","aria-labelledby":T?b:void 0,"aria-label":T?void 0:O.resolveAccessibleName(f),"aria-describedby":[I,N].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:y.mergeClasses(ld,dd[o],g),children:e.map(S=>{const D=S.value===t;return n.jsxs("div",{className:"flex min-w-0 flex-col",children:[n.jsx(k.Radio,{id:`${x}-${S.value}`,name:s??x,value:S.value,labelProps:S.label==null?void 0:{label:S.label},"aria-label":S["aria-label"],caption:S.caption,isSelected:D,disabled:l||S.disabled,onChange:r,className:u}),D&&S.content?n.jsx("div",{className:y.mergeClasses(cd,m),children:S.content}):null]},S.value)})}),n.jsx(Ke,{id:I,text:c}),!c&&n.jsx(Ve,{id:N,text:d})]})},ud="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",fd="min-w-0 flex-1 truncate text-primary",pd="min-w-0 flex-1 truncate text-secondary",gd="shrink-0 text-secondary",hd="px-6 pb-4",md="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",xd="Cancel",bd="Apply",Cd=({items:e,value:t,customValue:r,header:s,onApply:a,id:o,labelProps:i,placeholder:l,selectedValue:c,onSelectionChange:d,onCancel:f,onClose:p,isValid:g=!0,applyButtonLabel:u=bd,cancelButtonLabel:m=xd,size:C=v.PopupSize.Md,portalId:x,disabled:b,invalid:I,error:N,caption:T,ariaLabel:S,className:D,fieldClassName:_})=>{const E=h.useId(),A=o??E,L=`${A}-label`,w=`${A}-value`,M=N?`${A}-error`:void 0,F=!N&&T?`${A}-caption`:void 0,[K,te]=h.useState(!1),G=c!==void 0,[z,H]=h.useState(t),q=G?c:z,U=h.useCallback(()=>{b||(G||H(t),te(!0))},[b,G,t]),ae=h.useCallback(()=>{te(!1),p?.()},[p]),Y=h.useCallback(()=>{f?.(),ae()},[f,ae]),Z=h.useCallback(()=>{a(q),ae()},[a,q,ae]),re=h.useCallback(W=>{G||H(W),d?.(W)},[G,d]),oe=O.resolveAccessibleName(i?.label),le=oe?void 0:O.resolveAccessibleName(S),ue=oe?L:le&&`${A}-name`,me=O.resolveAccessibleName(s),Ce=e.find(W=>W.value===t)?.label,ge=r??Ce;return n.jsxs("div",{className:y.mergeClasses("flex w-full flex-col gap-2",D,j.DIAL_KIT_CLASS.radioGroupPopupField),children:[i&&n.jsx(k.Label,{...i,id:L,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":K,"aria-labelledby":ue?`${ue} ${w}`:void 0,"aria-describedby":[M,F].filter(Boolean).join(" ")||void 0,onClick:U,className:y.mergeClasses(ud,I&&"dial-kit-input-error",b&&"dial-kit-input-disable",_),children:[n.jsx("span",{id:w,className:ge==null?pd:fd,children:ge??l}),n.jsx(B.IconMaximize,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:gd})]}),n.jsx(Ke,{id:M,text:N}),!N&&n.jsx(Ve,{id:F,text:T})]}),n.jsx(Er,{open:K,header:s,ariaLabel:me?void 0:oe,portalId:x,size:C,onClose:Y,footer:n.jsxs("div",{className:md,children:[n.jsx(wr,{label:m,onClick:Y}),n.jsx(os,{label:u,disabled:!g,onClick:Z})]}),children:n.jsx("div",{className:hd,children:n.jsx(gs,{id:`${A}-options`,items:e,value:q,onChange:re,orientation:v.RadioGroupOrientation.Column,ariaLabel:oe??me})})})]})},vd=({icon:e,selectedIcon:t,isSelected:r=!1,onToggle:s,onClick:a,tooltipProps:o,size:i=O.ElementSize.Small,className:l,...c})=>{const d=h.useCallback(p=>{a?.(p),s?.(!r)},[a,s,r]),f=n.jsx(k.IconButton,{...c,size:i,variant:O.ButtonVariant.Primary,appearance:O.ButtonAppearance.Ghost,icon:r?t??e:e,"aria-pressed":r,"aria-label":O.resolveAccessibleName(c["aria-label"],o?.tooltip),onClick:d,className:y.mergeClasses("!rounded","[&_svg]:size-4",r&&"!text-accent",l,j.DIAL_KIT_CLASS.toggleIconButton)});return o?n.jsx(k.Tooltip,{asChild:!0,...o,children:f}):f},yd=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Id="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Sd="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",Dd="bg-layer-raised text-accent shadow-xs",Nd="bg-transparent text-secondary",jd="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Td="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",wd="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",Ed="cursor-not-allowed bg-transparent text-control-disable-primary",Od=({items:e,value:t,onChange:r,disabled:s,className:a,segmentClassName:o,"aria-label":i})=>{const l=h.useRef({}),c=e.find(p=>p.value===t),d=c&&!c.disabled?c.value:e.find(p=>!p.disabled)?.value,f=h.useCallback(p=>{if(s||!yd.includes(p.key))return;const g=e.filter(b=>!b.disabled);if(g.length===0)return;const u=Math.max(g.findIndex(b=>b.value===t),0),m=g.length-1;let C=u;switch(p.key){case"ArrowRight":case"ArrowDown":C=u===m?0:u+1;break;case"ArrowLeft":case"ArrowUp":C=u===0?m:u-1;break;case"Home":C=0;break;case"End":C=m;break}p.preventDefault();const x=g[C];l.current[x.value]?.focus(),x.value!==t&&r(x.value)},[s,e,t,r]);return n.jsx("div",{role:"radiogroup","aria-label":i,"aria-disabled":s||void 0,onKeyDown:f,className:y.mergeClasses(Id,a,j.DIAL_KIT_CLASS.segmentedControl),children:e.map(p=>{const g=p.value===t,u=s||p.disabled;return n.jsxs("button",{ref:m=>{l.current[p.value]=m},type:"button",role:"radio","aria-checked":g,"aria-label":O.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:y.mergeClasses(Sd,g?Dd:Nd,u?g?wd:Ed:g?jd:Td,o,j.DIAL_KIT_CLASS.segmentedControlItem),children:[p.icon,p.label]},p.value)})})},Ad={[v.TabOrientation.Horizontal]:{next:"ArrowRight",previous:"ArrowLeft"},[v.TabOrientation.Vertical]:{next:"ArrowDown",previous:"ArrowUp"}},_d=({tabs:e,activeTabId:t,onTabChange:r,orientation:s=v.TabOrientation.Horizontal,sectionLabel:a,ariaLabel:o,className:i,tabListClassName:l,tabClassName:c,sectionLabelClassName:d})=>{const f=h.useRef({}),p=h.useId(),g=s===v.TabOrientation.Vertical,u=e.find(b=>b.id===t),m=u&&!u.disabled?u.id:e.find(b=>!b.disabled)?.id,C=h.useCallback(b=>{const{next:I,previous:N}=Ad[s];if(![I,N,"Home","End"].includes(b.key)||e.length===0)return;const T=e.filter(A=>!A.disabled);if(T.length===0)return;const S=Math.max(T.findIndex(A=>A.id===t),0),D=T.length-1;let _=S;b.key===I?_=S===D?0:S+1:b.key===N?_=S===0?D:S-1:b.key==="Home"?_=0:_=D,b.preventDefault();const E=T[_];f.current[E.id]?.focus(),E.id!==t&&r(E.id)},[e,t,r,s]),x=n.jsx("div",{role:"tablist","aria-orientation":g?"vertical":void 0,"aria-label":o,"aria-labelledby":!o&&a?p:void 0,onKeyDown:C,className:y.mergeClasses(g?"flex flex-col gap-1 px-2":"flex justify-start gap-1",!a&&i,l,j.DIAL_KIT_CLASS.tabList,!a&&j.DIAL_KIT_CLASS.tabs),children:e.map(b=>{const I=t===b.id,N=!!b.disabled;return n.jsxs("button",{ref:T=>{f.current[b.id]=T},type:"button",role:"tab","aria-selected":I,disabled:N,tabIndex:b.id===m?0:-1,onClick:()=>r(b.id),className:y.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",g?["h-11 w-full rounded-lg px-3 desktop:h-10","focus-visible:-outline-offset-1",I?"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"],N&&(g?"cursor-not-allowed text-control-disable-primary":"cursor-not-allowed border-control-disable-primary text-control-disable-primary"),!N&&(g?I?"bg-control-accent-alpha text-accent hover:bg-control-accent-alpha-hover":"hover:bg-control-accent-alpha-hover":I?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),c,j.DIAL_KIT_CLASS.tab,I&&j.DIAL_KIT_CLASS.tabSelected),children:[b.icon&&n.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:b.icon}),n.jsx("span",{className:y.mergeClasses(g&&!I&&!N&&"text-primary"),children:b.label}),b.count!=null&&n.jsx("span",{className:y.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",g&&"ms-auto",N&&"bg-layer-sunken text-control-disable-primary",!N&&(I?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:b.count})]},b.id)})});return a?n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-3",i,j.DIAL_KIT_CLASS.tabs),children:[n.jsx("div",{className:y.mergeClasses("flex h-16 shrink-0 items-center",g?"px-4":"px-3"),children:n.jsx("span",{id:p,className:y.mergeClasses("dial-h1-text text-primary",d,j.DIAL_KIT_CLASS.tabsSectionLabel),children:a})}),x]}):x},Ld="flex flex-nowrap items-center gap-1",kd="min-w-max flex-1 justify-center",Rd=({items:e,value:t,onChange:r,stretch:s=!1,className:a,chipClassName:o,"aria-label":i,"aria-labelledby":l})=>n.jsx("div",{role:"group","aria-label":i,"aria-labelledby":l,className:y.mergeClasses(Ld,a,j.DIAL_KIT_CLASS.filterChips),children:e.map(c=>n.jsx(Ae,{label:c.label,icon:c.icon,appearance:qe.Selectable,selected:c.value===t,onClick:()=>r(c.value),className:y.mergeClasses(s&&kd,o)},c.value))}),fr=(e,t)=>{const r=(t??"").split(",").map(o=>o.trim().toLowerCase()).filter(Boolean);if(r.length===0)return!0;const s=e.name.toLowerCase(),a=e.type.toLowerCase();return r.some(o=>{if(o.startsWith("."))return s.endsWith(o);if(o.endsWith("/*")){const i=o.slice(0,-1);return a.length>i.length&&a.startsWith(i)}return a===o})},Md=({labelProps:e,label:t,description:r,onChange:s,onReject:a,accept:o,multiple:i=!1,disabled:l=!1,errorText:c,icon:d,id:f,ariaLabel:p,className:g})=>{const u=h.useId(),m=f??`file-dropzone-${u}`,C=c?`${m}-error`:void 0,[x,b]=h.useState(!1),I=h.useRef(0),N=h.useCallback(L=>{if(L.length===0)return;const w=i?L:L.slice(0,1),M=w.filter(K=>fr(K,o)),F=w.filter(K=>!fr(K,o));F.length>0&&a?.(F),M.length>0&&s(M)},[o,i,s,a]),T=h.useCallback(L=>{N(Array.from(L.target.files??[])),L.target.value=""},[N]),S=h.useCallback(()=>{I.current=0,b(!1)},[]),D=h.useCallback(L=>{l||(L.preventDefault(),I.current+=1,b(!0))},[l]),_=h.useCallback(L=>{l||(L.preventDefault(),L.dataTransfer.dropEffect="copy")},[l]),E=h.useCallback(()=>{l||(I.current-=1,I.current<=0&&S())},[l,S]),A=h.useCallback(L=>{L.preventDefault(),!l&&(S(),N(Array.from(L.dataTransfer?.files??[])))},[l,S,N]);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:o,multiple:i,disabled:l,onChange:T,"aria-label":O.resolveAccessibleName(typeof t!="string"?p:void 0),"aria-describedby":C,"aria-invalid":c?!0:void 0,className:"peer sr-only"}),n.jsxs("label",{htmlFor:m,onDragEnter:D,onDragOver:_,onDragLeave:E,onDrop:A,className:y.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",g,j.DIAL_KIT_CLASS.fileDropzone),children:[d??n.jsx(B.IconUpload,{size:$.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:y.mergeClasses("dial-small-text",l?"text-control-disable-primary":"text-primary"),children:t}),r&&n.jsx("span",{className:y.mergeClasses("dial-tiny-text",l?"text-control-disable-primary":"text-secondary"),children:r})]})]}),n.jsx(Ke,{id:C,text:c})]})},hs=({label:e="Shared",tooltip:t,size:r=12,className:s})=>n.jsx(k.Tooltip,{tooltip:t||"Shared",asChild:!0,children:n.jsx("span",{role:"img","aria-label":e,className:y.mergeClasses("flex shrink-0 rounded-sm bg-layer-raised text-accent",s,j.DIAL_KIT_CLASS.sharedEntityIndicator),children:n.jsx(B.IconArrowUpRight,{size:r,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})});var je=(e=>(e.Images="images",e.Video="video",e.Audio="audio",e.Code="code",e.Text="text",e.Pdf="pdf",e.Spreadsheet="spreadsheet",e.Presentation="presentation",e.Archive="archive",e.Dial="dial",e.Other="other",e))(je||{});const Pd={images:["apng","avif","bmp","gif","heic","heif","ico","jpeg","jpg","png","svg","tif","tiff","webp"],video:["avi","flv","m4v","mkv","mov","mp4","mpeg","mpg","ogv","webm","wmv"],audio:["aac","aiff","flac","m4a","mid","midi","mp3","oga","ogg","opus","wav","wma"],code:["bash","c","cjs","cpp","cs","css","go","h","hpp","htm","html","ini","ipynb","java","js","json","jsx","kt","less","lua","mjs","php","ps1","py","r","rb","rs","sass","scala","scss","sh","sql","svelte","swift","toml","ts","tsx","vue","xml","yaml","yml","zsh"],text:["doc","docx","log","markdown","md","odt","rtf","text","txt"],pdf:["pdf"],spreadsheet:["csv","numbers","ods","tsv","xls","xlsm","xlsx"],presentation:["key","odp","pps","ppsx","ppt","pptx"],archive:["7z","bz2","gz","rar","tar","tgz","xz","zip"],dial:["dial"]},Fd=new Map(Object.entries(Pd).flatMap(([e,t])=>t.map(r=>[r,e]))),Bd=e=>Fd.get(e)??"other",fn="var(--text-control-permanent, #FCFCFC)",It={x1:"20.4167",y1:"-3.33333",x2:"2.5",y2:"20",from:"var(--bg-visual-blue, #D6EDF9)",to:"var(--stroke-gradient-1, #5976E9)"},zd="#1B212D",$d={[je.Images]:{path:"M11.0002 8.66667H11.0036M7.00024 11.3333L8.66691 9.66667C8.97624 9.369 9.35758 9.369 9.66691 9.66667L11.3336 11.3333M10.6669 10.6667L11.0002 10.3333C11.3096 10.0357 11.6909 10.0357 12.0002 10.3333L13.0002 11.3333M7.00024 8C7.00024 7.73478 7.1056 7.48043 7.29314 7.29289C7.48067 7.10536 7.73503 7 8.00024 7H12.0002C12.2655 7 12.5198 7.10536 12.7074 7.29289C12.8949 7.48043 13.0002 7.73478 13.0002 8V12C13.0002 12.2652 12.8949 12.5196 12.7074 12.7071C12.5198 12.8946 12.2655 13 12.0002 13H8.00024C7.73503 13 7.48067 12.8946 7.29314 12.7071C7.1056 12.5196 7.00024 12.2652 7.00024 12V8Z",sheet:It},[je.Code]:{path:"M8.33358 8.66665L7.00024 9.99998L8.33358 11.3333M11.6669 8.66665L13.0002 9.99998L11.6669 11.3333M10.6669 7.33331L9.33358 12.6666",sheet:{x1:"16.6667",y1:"0",x2:"2.08333",y2:"20.4167",from:"var(--bg-control-inverted, #57647A)",to:zd}},[je.Text]:{path:"M7.3335 8H12.6668M7.3335 10H12.6668M7.3335 12H11.3335",sheet:{x1:"25.8333",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-violet-1, #DDE3F9)",to:"var(--bg-gradient-1, #1D4ED8)"}},[je.Spreadsheet]:{path:"M7.33325 10.1667H12.6666M9.99992 7.5V12.8333M7.33325 8.16667C7.33325 7.98986 7.40349 7.82029 7.52851 7.69526C7.65354 7.57024 7.82311 7.5 7.99992 7.5H11.9999C12.1767 7.5 12.3463 7.57024 12.4713 7.69526C12.5963 7.82029 12.6666 7.98986 12.6666 8.16667V12.1667C12.6666 12.3435 12.5963 12.513 12.4713 12.6381C12.3463 12.7631 12.1767 12.8333 11.9999 12.8333H7.99992C7.82311 12.8333 7.65354 12.7631 7.52851 12.6381C7.40349 12.513 7.33325 12.3435 7.33325 12.1667V8.16667Z",sheet:{x1:"20.4167",y1:"-3.75",x2:"2.91667",y2:"20.4167",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-1, #059669)"}},[je.Pdf]:{fillPath:"M12.5373 10.3151C12.0382 10.3151 11.4137 10.4021 11.2094 10.4328C10.3637 9.54967 10.1231 9.04771 10.069 8.91388C10.1423 8.72544 10.3975 8.0096 10.4338 7.09022C10.4517 6.62991 10.3544 6.28596 10.1447 6.06792C9.93533 5.85024 9.68191 5.83331 9.60924 5.83331C9.35443 5.83331 8.92697 5.96216 8.92697 6.82503C8.92697 7.5737 9.27603 8.36813 9.37252 8.57339C8.86416 10.0536 8.31837 11.0669 8.20248 11.2753C6.15974 12.0444 6 12.788 6 12.9988C6 13.3775 6.26973 13.6036 6.72152 13.6036C7.8192 13.6036 8.8209 11.7607 8.98653 11.4407C9.76614 11.1301 10.8096 10.9377 11.0749 10.8918C11.8357 11.6166 12.7157 11.81 13.0811 11.81C13.3561 11.81 14 11.81 14 11.148C14 10.5332 13.2121 10.3151 12.5373 10.3151ZM12.4844 10.7497C13.0773 10.7497 13.234 10.9458 13.234 11.0494C13.234 11.1145 13.2093 11.3268 12.8915 11.3268C12.6065 11.3268 12.1145 11.1621 11.6303 10.8047C11.8322 10.7782 12.131 10.7497 12.4844 10.7497ZM9.57812 6.25458C9.63218 6.25458 9.66777 6.27195 9.69711 6.31264C9.86764 6.54926 9.73014 7.32242 9.56279 7.92745C9.40124 7.40867 9.28 6.61264 9.45058 6.33259C9.48392 6.27793 9.52204 6.25458 9.57812 6.25458ZM9.29017 10.8856C9.50483 10.452 9.74542 9.81997 9.87646 9.46253C10.1387 9.90147 10.4914 10.309 10.6954 10.53C10.0603 10.6639 9.57969 10.7976 9.29017 10.8856ZM6.4264 13.0566C6.41226 13.0399 6.41017 13.0045 6.42083 12.9621C6.44317 12.8731 6.61396 12.4322 7.84924 11.8796C7.67236 12.1582 7.39585 12.5563 7.09208 12.8537C6.87825 13.0538 6.71174 13.1553 6.59719 13.1553C6.55621 13.1553 6.49974 13.1442 6.4264 13.0566Z",sheet:{x1:"26.25",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-red, #FCE7F3)",to:"var(--bg-control-error-active, #CC4545)"}},[je.Audio]:{path:"M9 11.5C9 11.7652 8.89464 12.0195 8.70711 12.2071C8.51957 12.3946 8.26522 12.5 8 12.5C7.73478 12.5 7.48043 12.3946 7.29289 12.2071C7.10536 12.0195 7 11.7652 7 11.5C7 11.2347 7.10536 10.9804 7.29289 10.7929C7.48043 10.6053 7.73478 10.5 8 10.5C8.26522 10.5 8.51957 10.6053 8.70711 10.7929C8.89464 10.9804 9 11.2347 9 11.5ZM9 11.5V7.16663H12.3333V11.5M12.3333 11.5C12.3333 11.7652 12.228 12.0195 12.0404 12.2071C11.8529 12.3946 11.5985 12.5 11.3333 12.5C11.0681 12.5 10.8138 12.3946 10.6262 12.2071C10.4387 12.0195 10.3333 11.7652 10.3333 11.5C10.3333 11.2347 10.4387 10.9804 10.6262 10.7929C10.8138 10.6053 11.0681 10.5 11.3333 10.5C11.5985 10.5 11.8529 10.6053 12.0404 10.7929C12.228 10.9804 12.3333 11.2347 12.3333 11.5ZM9 8.49996H12.3333",sheet:It},[je.Video]:{path:"M9.99996 13.1667C11.8409 13.1667 13.3333 11.6743 13.3333 9.83333C13.3333 7.99238 11.8409 6.5 9.99996 6.5C8.15901 6.5 6.66663 7.99238 6.66663 9.83333C6.66663 11.6743 8.15901 13.1667 9.99996 13.1667ZM9.33337 8.5L11.3334 9.83333L9.33337 11.1667V8.5Z",sheet:It},[je.Presentation]:{path:"M7 7.33331H13M7.33333 7.33331V10.6666C7.33333 10.8435 7.40357 11.013 7.5286 11.1381C7.65362 11.2631 7.82319 11.3333 8 11.3333H12C12.1768 11.3333 12.3464 11.2631 12.4714 11.1381C12.5964 11.013 12.6667 10.8435 12.6667 10.6666V7.33331M10 11.3333V12.6666M9 12.6666H11M8.66667 9.99998L9.66667 8.99998L10.3333 9.66665L11.3333 8.66665",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-brown, #FDE8D8)",to:"var(--text-visual-brown-2, #B45309)"}},[je.Archive]:{path:"M10.0001 6.66669H9.58341M10.8334 7.451H10.4167M10.0001 8.23531H9.58341M10.8334 9.01963H10.4167M10.0001 9.80394H9.58341M10.8334 10.5883H10.4167M10.0001 11.3726C10.2211 11.3726 10.4331 11.4552 10.5893 11.6023C10.7456 11.7494 10.8334 11.9489 10.8334 12.1569V12.9412C10.8334 13.0452 10.7895 13.1449 10.7114 13.2185C10.6332 13.292 10.5273 13.3334 10.4167 13.3334H9.58341C9.47291 13.3334 9.36693 13.292 9.28879 13.2185C9.21065 13.1449 9.16675 13.0452 9.16675 12.9412V12.1569C9.16675 11.9489 9.25455 11.7494 9.41083 11.6023C9.56711 11.4552 9.77907 11.3726 10.0001 11.3726Z",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-3, #065F46)"}},[je.Dial]:{path:"M8.26392 7.44049C8.80816 7.44049 9.28449 7.50578 9.69653 7.63092L9.69849 7.6319C10.1079 7.75343 10.4556 7.938 10.7463 8.1817L10.7483 8.18365C11.0312 8.41601 11.2537 8.72491 11.4104 9.12115V9.12213C11.5666 9.51456 11.6496 9.98403 11.6497 10.5381C11.6497 11.5957 11.3539 12.3492 10.8108 12.8565C10.2602 13.3708 9.47204 13.6504 8.39868 13.6505H6.71313V7.44049H8.26392Z",fillPath:"M12.7167 12.1008L12.9558 12.3564L12.9558 12.3564L12.7167 12.1008ZM11.4504 6.20825L11.3486 6.54311L11.3507 6.54375L11.4504 6.20825ZM12.637 6.833L12.4119 7.10109L12.4147 7.10334L12.637 6.833ZM13.4108 7.9263L13.0853 8.05488L13.0856 8.05566L13.4108 7.9263ZM11.1666 12.8853L11.0909 12.5436V12.5436L11.1666 12.8853ZM10.4391 12.6553C10.2487 12.689 10.1217 12.8706 10.1553 13.0609C10.189 13.2513 10.3706 13.3783 10.5609 13.3447L10.5 13L10.4391 12.6553ZM13.6781 9.49291H13.3281C13.3281 10.5655 13.0283 11.33 12.4776 11.8451L12.7167 12.1008L12.9558 12.3564C13.687 11.6724 14.0281 10.6984 14.0281 9.49291H13.6781ZM7.9751 6.12805H8.3251C8.3251 6.24476 8.23053 6.35 8.1009 6.35V6V5.65C7.83231 5.65 7.6251 5.86989 7.6251 6.12805H7.9751ZM8.1009 6V6.35H9.89799V6V5.65H8.1009V6ZM9.89799 6V6.35C10.449 6.35 10.9312 6.41618 11.3486 6.54311L11.4504 6.20825L11.5522 5.87339C11.0566 5.72265 10.5039 5.65 9.89799 5.65V6ZM11.4504 6.20825L11.3507 6.54375C11.7654 6.66701 12.1173 6.85376 12.4119 7.10107L12.637 6.833L12.862 6.56492C12.4875 6.2506 12.0484 6.02084 11.5501 5.87275L11.4504 6.20825ZM12.637 6.833L12.4147 7.10334C12.7016 7.33926 12.9264 7.65273 13.0853 8.05488L13.4108 7.9263L13.7363 7.79772C13.5387 7.29746 13.2477 6.88206 12.8593 6.56265L12.637 6.833ZM13.4108 7.9263L13.0856 8.05566C13.2441 8.45409 13.3281 8.93071 13.3281 9.49291H13.6781H14.0281C14.0281 8.86239 13.934 8.29465 13.736 7.79694L13.4108 7.9263ZM7.9751 7.21882H8.3251V6.12805H7.9751H7.6251V7.21882H7.9751ZM12.7167 12.1008L12.4776 11.8451C12.117 12.1824 11.6591 12.4177 11.0909 12.5436L11.1666 12.8853L11.2423 13.227C11.9168 13.0776 12.4923 12.7898 12.9558 12.3564L12.7167 12.1008ZM11.1666 12.8853L11.0909 12.5436C11.091 12.5435 11.0826 12.5452 11.0606 12.5493C11.041 12.5528 11.0155 12.5573 10.9857 12.5625C10.926 12.5729 10.8511 12.5857 10.7756 12.5984C10.6269 12.6236 10.472 12.6495 10.4391 12.6553L10.5 13L10.5609 13.3447C10.6064 13.3366 11.1725 13.2425 11.2423 13.227L11.1666 12.8853Z",sheet:"var(--bg-gradient-2, #885DF2)"},[je.Other]:{path:"M6.80005 8H13.2M6.80005 10.2222H13.2M6.80005 12.4444H13.2",sheet:It}},Hd=({size:e,kind:t})=>{const r=`dial-kit-file-gradient-${h.useId().replace(/[^\w-]/g,"")}`,{path:s,fillPath:a,sheet:o}=$d[t],i=typeof o=="string";return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[n.jsx("path",{d:"M17.4999 3.97859V16C17.4999 18.2091 15.709 20 13.4999 20H6.5C4.29086 20 2.5 18.2091 2.5 16V4C2.5 1.79086 4.29086 0 6.5 0H13.1683H13.5213C15.7186 0 17.4999 1.78128 17.4999 3.97859Z",fill:i?o:`url(#${r})`}),s&&n.jsx("path",{d:s,stroke:fn,strokeWidth:"0.7",strokeLinecap:"round",strokeLinejoin:"round"}),a&&n.jsx("path",{d:a,fill:fn}),!i&&n.jsx("defs",{children:n.jsxs("linearGradient",{id:r,x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:o.from}),n.jsx("stop",{offset:"1",stopColor:o.to})]})})]})},Vd=({size:e})=>{const t=`dial-kit-folder-gradient-${h.useId().replace(/[^\w-]/g,"")}`;return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[n.jsx("path",{d:"M6.38992 3.75H4.66663C3.00977 3.75 1.66663 5.09315 1.66663 6.75V7.91667H7.16339L10.8333 5.79247L7.85075 4.1297C7.40412 3.8807 6.90127 3.75 6.38992 3.75Z",fill:"var(--stroke-gradient-1, #5976E9)"}),n.jsx("path",{d:"M14.3333 5.41669C16.5424 5.41669 18.3333 7.20755 18.3333 9.41669V12.25C18.3333 14.4592 16.5424 16.25 14.3333 16.25H5.66663C3.45749 16.25 1.66663 14.4592 1.66663 12.25V7.6708C1.66663 7.11851 2.11434 6.6708 2.66663 6.6708H6.89447C7.43998 6.6708 7.97973 6.55922 8.48053 6.34291L9.86582 5.74458C10.3666 5.52827 10.9064 5.41669 11.4519 5.41669H14.3333Z",fill:`url(#${t})`}),n.jsx("defs",{children:n.jsxs("linearGradient",{id:t,x1:"17.0833",y1:"5.83335",x2:"9.38489",y2:"19.6653",gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:"var(--stroke-secondary, #D1DBEA)"}),n.jsx("stop",{offset:"0.91",stopColor:"var(--stroke-gradient-1, #5976E9)"})]})})]})},Kd=(e,t)=>(t??(e.includes(".")?e.split(".").pop():"")??"").trim().replace(/^\./,"").toLowerCase(),Gd=(e,t)=>e===v.DialItemType.Folder?"Folder":t?`${t.toUpperCase()} file`:"File",Ud=(e,t,r)=>e===v.DialItemType.Folder?n.jsx(Vd,{size:r}):n.jsx(Hd,{size:r,kind:Bd(t)}),Or=({type:e,name:t,fileExtension:r,shared:s=!1,loading:a=!1,size:o=$.DIAL_ICON_SIZE.MD,className:i,decorative:l=!1,label:c,loadingLabel:d="Loading",sharedIndicatorClassName:f,sharedIndicatorTooltip:p})=>{if(e!==v.DialItemType.File&&e!==v.DialItemType.Folder)return null;const g=e===v.DialItemType.File?Kd(t,r):"",u=Gd(e,g),m=c??(s?`${u}, shared`:u),C=l?{"aria-hidden":!0}:a?{}:{role:"img","aria-label":m};return n.jsxs("span",{className:y.mergeClasses("relative inline-flex shrink-0 items-center justify-center text-secondary",i,j.DIAL_KIT_CLASS.fileIcon),...C,children:[a?n.jsx(v.Spinner,{size:o,ariaLabel:d}):Ud(e,g,o),s&&n.jsx(hs,{tooltip:p,className:y.mergeClasses("absolute -bottom-0.5 -left-0.5",f)})]})},ms=({name:e,type:t=v.DialItemType.File,fileExtension:r,shared:s=!1,loading:a=!1,loadingLabel:o,iconSize:i,details:l,isInvalidName:c=!1,className:d,nameClassName:f,sharedIndicatorClassName:p,sharedIndicatorTooltip:g,sharedLabel:u="Shared",hideTooltip:m=!1,tooltipContent:C})=>n.jsxs("div",{className:y.mergeClasses("flex w-full min-w-0 items-center gap-2",d,j.DIAL_KIT_CLASS.fileName),children:[n.jsx(Or,{name:e,type:t,fileExtension:r,shared:s,loading:a,loadingLabel:o,size:i,sharedIndicatorClassName:p,sharedIndicatorTooltip:g,decorative:!a}),n.jsxs("div",{className:y.mergeClasses("flex min-w-0 flex-1",{"flex-col gap-1":!!l}),children:[n.jsx(k.EllipsisTooltip,{className:y.mergeClasses("dial-small-paragraph-text",c?"text-secondary":"text-primary",f),text:e,hideTooltip:m,customTooltipContent:C}),s&&n.jsx("span",{className:"sr-only",children:u}),l]})]}),Zd=({className:e,...t})=>n.jsx(ms,{...t,type:v.DialItemType.Folder,className:y.mergeClasses(e,j.DIAL_KIT_CLASS.folderName)}),Wd=({open:e,onClose:t,title:r,ariaLabel:s,onBack:a,backAriaLabel:o="Back",closeAriaLabel:i="Close",closeOnOutsideClick:l=!0,children:c,className:d,overlayClassName:f,headerClassName:p,style:g,overlayStyle:u,bodyClassName:m,titleClassName:C,portalId:x})=>{const b=j.useThemeScope(),I=`bottom-sheet-title-${h.useId()}`,{refs:N,context:T}=ee.useFloating({open:e,onOpenChange:E=>{E||t()}}),S=ee.useRole(T,{role:"dialog"}),D=ee.useDismiss(T,{outsidePress:l}),{getFloatingProps:_}=ee.useInteractions([S,D]);return e?n.jsx(ee.FloatingPortal,{id:x,children:n.jsx(ee.FloatingOverlay,{lockScroll:!0,style:u,className:y.mergeClasses("z-popup flex items-end bg-backdrop",b,f),children:n.jsx(ee.FloatingFocusManager,{context:T,initialFocus:N.floating,children:n.jsxs("div",{ref:N.setFloating,..._(),role:"dialog","aria-modal":"true","aria-labelledby":r?I:void 0,"aria-label":r?void 0:s,style:g,className:y.mergeClasses("flex max-h-[85dvh] w-full flex-col rounded-t-lg bg-layer-raised outline-none","animate-slideUp motion-reduce:animate-none",d,j.DIAL_KIT_CLASS.bottomSheet),children:[r&&n.jsxs("div",{className:y.mergeClasses("relative flex h-[60px] shrink-0 items-center justify-center border-b border-tertiary px-14",p),children:[a&&n.jsx(k.GhostIconButton,{"aria-label":o,className:"absolute start-4",onClick:a,icon:n.jsx(B.IconArrowLeft,{size:$.DIAL_ICON_SIZE.LG,stroke:ie.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),n.jsx("h2",{id:I,className:y.mergeClasses("min-w-0 truncate text-primary",C??"dial-body-semi-text"),children:r}),n.jsx(k.CloseButton,{ariaLabel:i,onClose:t,size:O.ElementSize.Standard,className:"absolute end-4"})]}),n.jsx("div",{className:y.mergeClasses("min-h-0 overflow-y-auto",m),children:c})]})})})}):null};var He=(e=>(e.Outlined="outlined",e.Filled="filled",e))(He||{}),Re=(e=>(e.Blue="blue",e.Green="green",e.Violet="violet",e.Indigo="indigo",e.Brown="brown",e.Red="red",e))(Re||{});const qd={[Re.Blue]:"bg-blue text-blue",[Re.Green]:"bg-green-2 text-green-1",[Re.Violet]:"bg-violet-2 text-violet-1",[Re.Indigo]:"bg-violet-1 text-violet-2",[Re.Brown]:"bg-brown text-brown-2",[Re.Red]:"bg-red text-red"},Yd={[He.Outlined]:"rounded-md border border-tertiary bg-layer-sunken text-secondary",[He.Filled]:"rounded-full"},Xd={[He.Outlined]:"dial-tiny-text",[He.Filled]:"dial-caption-lead-semi-text"},Qd=({label:e,variant:t=He.Outlined,color:r=Re.Blue,icon:s,textClassName:a,className:o,...i})=>n.jsxs("span",{...i,className:y.mergeClasses("inline-flex h-6 w-fit shrink-0 items-center gap-1 whitespace-nowrap px-2",Yd[t],t===He.Filled&&qd[r],o,j.DIAL_KIT_CLASS.badge),children:[s&&n.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:s}),n.jsx("span",{className:a??Xd[t],children:e})]});var at=(e=>(e.Circle="circle",e.Square="square",e))(at||{});const pn=[{background:"bg-green-1",foreground:"text-green-2"},{background:"bg-violet-2",foreground:"text-violet-1"},{background:"bg-brown",foreground:"text-brown-2"},{background:"bg-red",foreground:"text-red"},{background:"bg-green-2",foreground:"text-green-3"},{background:"bg-blue",foreground:"text-accent"},{background:"bg-violet-1",foreground:"text-violet-2"}],Jd=e=>{let t=0;for(let r=0;r<e.length;r++)t+=e.charCodeAt(r);return pn[t%pn.length]},gn=e=>e.match(new RegExp("\\p{L}","u"))?.[0]??"",xs=e=>{const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length>=2?(gn(t[0])+gn(t[1])).toUpperCase()||"?":t[0].replace(/[^\p{L}]/gu,"").slice(0,2).toUpperCase()||"?"},eu={[at.Circle]:"rounded-full",[at.Square]:"rounded-md"},bs=({name:e,initials:t,src:r,alt:s="",size:a=32,shape:o=at.Circle,className:i,textClassName:l,onImageError:c})=>{const[d,f]=h.useState(),p=!!r&&d!==r,g=s!=="",u=x=>y.mergeClasses("inline-flex shrink-0 select-none items-center justify-center overflow-hidden",eu[o],x,i,j.DIAL_KIT_CLASS.avatar);if(p)return n.jsx("img",{src:r,alt:s,width:a,height:a,className:y.mergeClasses(u(),"object-cover"),onError:x=>{f(r),c?.(x)}});const{background:m,foreground:C}=Jd(e);return n.jsx("span",{role:g?"img":void 0,"aria-label":g?s:void 0,"aria-hidden":g?void 0:!0,className:u(y.mergeClasses(m,C)),style:{width:a,height:a,fontSize:l?void 0:Math.round(a*.4)},children:n.jsx("span",{className:y.mergeClasses("leading-none",l??"font-semibold"),children:t??xs(e)})})};var he=(e=>(e.Model="model",e.Agent="agent",e.Toolset="toolset",e.Skill="skill",e.Prompt="prompt",e))(he||{});const tu={[he.Model]:"Model",[he.Agent]:"Agent",[he.Toolset]:"Toolset",[he.Skill]:"Skill",[he.Prompt]:"Prompt"},hn={[he.Model]:"text-blue",[he.Agent]:"text-green-1",[he.Toolset]:"text-brown-2",[he.Skill]:"text-violet-1",[he.Prompt]:"text-violet-2"},ru={[he.Model]:"bg-blue",[he.Agent]:"bg-green-2",[he.Toolset]:"bg-brown",[he.Skill]:"bg-violet-2",[he.Prompt]:"bg-violet-1"},nu=["h1","h2","h3","h4","h5","h6"],su=e=>nu[Math.min(6,Math.max(1,Math.round(e)))-1],au=({item:e,labels:t,showVersion:r=!0,hasFeaturedTag:s=!0,iconSize:a=48,headingLevel:o=3,query:i,footer:l,statusBadge:c,className:d,nameClassName:f="dial-h3-text",typeClassName:p="dial-caption-lead-semi-text",versionClassName:g="dial-tiny-text",iconClassName:u,featuredChipClassName:m})=>{const C=su(o),x=s&&!!e.isFeatured,b=c!=null||x,I=r?e.version:void 0;return n.jsxs("div",{className:y.mergeClasses("flex items-start gap-2",d,j.DIAL_KIT_CLASS.entityIdentity),children:[n.jsx(bs,{name:e.name,src:e.iconUrl,size:a,shape:at.Square,className:y.mergeClasses("rounded-[14px]",u)}),n.jsxs("div",{className:y.mergeClasses("flex min-w-0 flex-1 flex-col gap-1",l!=null&&"self-stretch"),children:[n.jsxs("div",{className:"relative flex items-center justify-between",children:[n.jsx("span",{className:y.mergeClasses("uppercase",p,hn[e.type]),children:t?.type??tu[e.type]}),b&&n.jsxs("div",{className:"absolute end-0 top-[-6px] flex items-center gap-2",children:[c,x&&n.jsx("span",{className:y.mergeClasses("flex h-6 items-center justify-center rounded-2xl px-2","dial-caption-lead-semi-text",ru[e.type],hn[e.type],m),children:t?.featured??"Featured"})]})]}),n.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[n.jsx(C,{className:y.mergeClasses("min-w-0 shrink text-primary",f),children:i?n.jsx(Jn,{text:e.name,query:i,maxLines:1}):n.jsx(k.EllipsisTooltip,{text:e.name})}),I!=null&&n.jsx(k.EllipsisTooltip,{className:y.mergeClasses("max-w-[30%] shrink-0 text-secondary",g),text:I})]}),l!=null&&n.jsx("div",{className:"mt-auto pt-1",children:l})]})]})},ou=({open:e,onClose:t,header:r,ariaLabel:s,headerActions:a,onBack:o,backAriaLabel:i="Back",backDisabled:l=!1,closeAriaLabel:c="Close",closeDisabled:d=!1,hideClose:f=!1,closeOnOutsideClick:p=!0,children:g,className:u,overlayClassName:m,headerClassName:C,style:x,overlayStyle:b,bodyClassName:I,titleClassName:N,portalId:T})=>{const S=j.useThemeScope(),D=`side-drawer-title-${h.useId()}`,_=typeof r=="string",{refs:E,context:A}=ee.useFloating({open:e,onOpenChange:K=>{K||t()}}),L=ee.useRole(A,{role:"dialog"}),w=ee.useDismiss(A,{outsidePress:p}),{getFloatingProps:M}=ee.useInteractions([L,w]),F=r!=null||o!=null||!f;return n.jsx(ee.FloatingPortal,{id:T,children:n.jsx(ee.FloatingOverlay,{lockScroll:e,style:b,className:y.mergeClasses("z-popup bg-backdrop transition-opacity duration-300 motion-reduce:transition-none",e?"opacity-100":"pointer-events-none opacity-0",S,m),children:n.jsx(ee.FloatingFocusManager,{context:A,disabled:!e,initialFocus:E.floating,children:n.jsxs("div",{ref:E.setFloating,...M(),role:"dialog","aria-modal":"true","aria-labelledby":_?D:void 0,"aria-label":_?void 0:s,inert:!e,style:x,className:y.mergeClasses("fixed inset-y-0 end-0 flex w-full flex-col overflow-hidden bg-layer-raised outline-none","desktop:w-[540px] desktop:rounded-s-xl desktop:border-s desktop:border-secondary","transition-transform duration-300 motion-reduce:transition-none",e?"translate-x-0":"translate-x-full rtl:-translate-x-full",u,j.DIAL_KIT_CLASS.sideDrawer),children:[F&&n.jsxs("div",{className:y.mergeClasses("flex shrink-0 items-center gap-2 border-b border-tertiary px-6 py-3",C),children:[o&&n.jsx(k.GhostIconButton,{"aria-label":i,disabled:l,onClick:o,icon:n.jsx(B.IconChevronLeft,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),_?n.jsx("h2",{id:D,className:y.mergeClasses("min-w-0 flex-1 truncate text-primary",N??"dial-h2-text"),children:r}):n.jsx("div",{className:"min-w-0 flex-1",children:r}),a,!f&&n.jsx(k.CloseButton,{ariaLabel:c,onClose:t,disabled:d,size:O.ElementSize.Standard})]}),n.jsx("div",{className:y.mergeClasses("min-h-0 flex-1 overflow-y-auto",I),children:g})]})})})})},iu=4,lu=24,mn=e=>parseFloat(e)||0,cu=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},du=()=>{},uu=({id:e,value:t,defaultValue:r,size:s=O.ElementSize.Standard,labelProps:a,placeholder:o,caption:i,error:l,invalid:c,disabled:d=!1,readOnly:f=!1,collapseTagOverflow:p=!1,ariaLabel:g,tagListLabel:u="Tags",className:m,fieldClassName:C,tagClassName:x,onChange:b})=>{const I=h.useId(),N=e||I,T=s===O.ElementSize.Small,S=h.useRef(null),D=h.useRef([]),_=h.useRef(null),E=t!==void 0,[A,L]=h.useState(r??[]),w=E?t:A,M=w.length,[F,K]=h.useState(""),[te,G]=h.useState(M),z=!f&&!d,H=h.useCallback(W=>{E||L(W),b?.(W)},[E,b]),q=h.useCallback(W=>Q=>{D.current[W]=Q},[]),U=h.useCallback(()=>{const W=S.current;if(!W||W.clientWidth===0){G(w.length);return}const{paddingLeft:Q,paddingRight:we}=getComputedStyle(W);G(us({availableWidth:W.clientWidth-mn(Q)-mn(we)-(f?0:lu),tagWidths:w.map((ke,X)=>D.current[X]?.offsetWidth??0),overflowChipWidth:_.current?.offsetWidth??0,gap:iu}))},[f,w]);h.useEffect(()=>{if(!p){G(M);return}const W=S.current;if(!W)return;const Q=new ResizeObserver(()=>U());return Q.observe(W),U(),()=>Q.disconnect()},[p,U,M]);const ae=y.mergeClasses(p?"shrink-0":"min-w-0",x),Y=W=>{const Q=cu(W.trim()).trim();!Q||w.includes(Q)||H([...w,Q])},Z=W=>{H(w.filter(Q=>Q!==W))},re=()=>{Y(F),K("")},oe=W=>{if(z){if(W.key==="Enter"||W.key===","){W.preventDefault(),re();return}W.key==="Backspace"&&!F&&M>0&&(W.preventDefault(),H(w.slice(0,-1)))}},le=()=>{z&&F.trim()&&re()},ue=p?w.slice(0,te):w,me=p?w.slice(te):[],Ce=me.join(", "),ge=M>0&&n.jsxs("span",{role:"list","aria-label":u,className:y.mergeClasses("relative flex min-w-0 items-center gap-1",p?"flex-nowrap":"flex-wrap"),children:[ue.map(W=>n.jsx(Ae,{role:"listitem",label:W,className:ae,disabled:d,closable:z,onRemove:z?()=>Z(W):void 0},W)),me.length>0&&n.jsx(Ae,{role:"listitem",label:`+${me.length}`,"aria-label":Ce,title:Ce,className:y.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:[w.map((W,Q)=>n.jsx("span",{ref:q(Q),className:"inline-flex",children:n.jsx(Ae,{label:W,className:x,disabled:d,closable:z,onRemove:z?du:void 0})},W)),n.jsx("span",{ref:_,className:"inline-flex",children:n.jsx(Ae,{label:`+${M}`,className:x})})]})]});return n.jsx($e,{id:N,size:s,labelProps:a,caption:i,error:l,invalid:c,disabled:d,readOnly:f,value:F,placeholder:M>0?void 0:o,"aria-label":g,wrapperRef:S,onChange:W=>K(W??""),onKeyDown:oe,onBlur:le,containerClassName:y.mergeClasses("w-full",m),wrapperClassName:y.mergeClasses(M>0&&["!h-auto",T?"min-h-[24px] py-0.5":"min-h-[40px] py-[3px]",p?"flex-nowrap overflow-hidden":"flex-wrap"],C,j.DIAL_KIT_CLASS.tagInput),className:y.mergeClasses("w-auto flex-1",p?"min-w-[24px]":"min-w-[100px]",f&&"cursor-default"),children:ge})},fu=(e,t,r,s)=>{const a=t.trim().toLowerCase(),o=new Set(r);return e.filter(({value:i,label:l,description:c})=>!o.has(i)&&[l,i,c].some(d=>d?.toLowerCase().includes(a))).slice(0,Math.max(s,0))},pu=5,gu=({id:e,value:t,defaultValue:r,suggestions:s,maxSuggestions:a=pu,size:o=O.ElementSize.Standard,labelProps:i,placeholder:l,caption:c,error:d,invalid:f=!1,disabled:p=!1,readOnly:g=!1,ariaLabel:u,tagListLabel:m="Tags",getRemoveTagLabel:C,className:x,fieldClassName:b,tagClassName:I,listClassName:N,onChange:T})=>{const S=h.useId(),D=e||S,_=`${D}-listbox`,E=j.useThemeScope(),A=o===O.ElementSize.Small,L=t!==void 0,[w,M]=h.useState(r??[]),F=L?t:w,K=F.length>0,te=!g&&!p,[G,z]=h.useState(""),[H,q]=h.useState(!1),[U,ae]=h.useState(0),Y=h.useMemo(()=>fu(s,G,F,a),[G,a,s,F]),Z=H&&te&&Y.length>0,re=Math.min(U,Y.length-1),oe=X=>`${_}-option-${X}`,{refs:le,floatingStyles:ue}=ee.useFloating({open:Z,placement:"bottom-start",whileElementsMounted:ee.autoUpdate,middleware:[ee.offset(k.overlayGap),ee.flip({padding:k.overlayGap}),ee.size({padding:k.overlayGap,apply({rects:X,availableHeight:de,elements:Ee}){Ee.floating.style.width=`${Math.round(X.reference.width)}px`,Ee.floating.style.maxHeight=`${Math.floor(de)}px`}})]}),me=h.useCallback(X=>{L||M(X),T?.(X)},[L,T]),Ce=()=>{q(!1),ae(0)},ge=X=>{const de=X.trim();de&&!F.includes(de)&&me([...F,de]),z(""),Ce()},W=X=>me(F.filter(de=>de!==X)),Q=X=>{const de=X??"";z(de),q(!!de.trim()),ae(0)},we=X=>{if(te)switch(X.key){case"ArrowDown":case"ArrowUp":{if(X.preventDefault(),q(!0),!Z)return;const de=X.key==="ArrowDown"?1:-1;ae((re+de+Y.length)%Y.length);return}case"Enter":case",":X.preventDefault(),ge(Z?Y[re].value:G);return;case"Escape":Z&&X.preventDefault(),Ce();return;case"Backspace":!G&&K&&(X.preventDefault(),me(F.slice(0,-1)));return}},ke=X=>X.preventDefault();return n.jsxs(n.Fragment,{children:[n.jsx($e,{id:D,role:"combobox","aria-autocomplete":"list","aria-expanded":Z,"aria-controls":_,"aria-activedescendant":Z?oe(re):void 0,"aria-invalid":f||void 0,"aria-label":u,size:o,labelProps:i,caption:c,error:d,invalid:f,disabled:p,readOnly:g,value:G,placeholder:K?void 0:l,wrapperRef:le.setReference,onChange:Q,onKeyDown:we,onBlur:Ce,containerClassName:y.mergeClasses("w-full",x),wrapperClassName:y.mergeClasses(K&&["!h-auto flex-wrap gap-1 py-2",A?"min-h-[24px]":"min-h-[40px]"],b,j.DIAL_KIT_CLASS.autocompleteTagInput),className:y.mergeClasses("w-auto min-w-[100px] flex-1",g&&"cursor-default"),children:K&&n.jsx("span",{role:"list","aria-label":m,className:"flex min-w-0 flex-wrap items-center gap-1",children:F.map(X=>n.jsx(Ae,{role:"listitem",label:X,className:y.mergeClasses(At,"min-w-0",I),disabled:p,closable:te,removeLabel:C?.(X),onRemove:te?()=>W(X):void 0},X))})}),n.jsx(ee.FloatingPortal,{children:n.jsx("div",{ref:le.setFloating,id:_,role:"listbox","aria-label":m,hidden:!Z,style:ue,className:y.mergeClasses("z-floating overflow-y-auto",k.overlaySurfaceClassName,k.overlayListClassName,!Z&&"hidden",E,N),children:Z&&Y.map((X,de)=>{const Ee=de===re;return n.jsx(k.MenuItem,{id:oe(de),role:"option","aria-selected":Ee,tabIndex:-1,label:X.label,description:X.description,mark:k.MenuItemMark.Tint,selected:Ee,onMouseDown:ke,onMouseEnter:()=>ae(de),onClick:()=>ge(X.value)},X.value)})})})]})},hu={[O.ElementSize.Small]:$.DIAL_ICON_SIZE.SM,[O.ElementSize.Standard]:$.DIAL_ICON_SIZE.MD,[O.ElementSize.Large]:$.DIAL_ICON_SIZE.MD},mu=({size:e=O.ElementSize.Standard,placeholder:t="Search...",withoutBorder:r=!1,clearLabel:s="Clear search",disabled:a,value:o,onChange:i,wrapperClassName:l,inputRef:c,...d})=>{const f=h.useRef(null),p=ee.useMergeRefs([c,f]),g=!!o&&!a,u=h.useCallback(()=>{i?.(void 0),f.current?.focus()},[i]);return n.jsx($e,{...d,size:e,value:o,disabled:a,onChange:i,placeholder:t,inputRef:p,wrapperClassName:y.mergeClasses(r&&"dial-kit-input-borderless",l,j.DIAL_KIT_CLASS.search),iconBefore:n.jsx(B.IconSearch,{size:hu[e],stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":"true"}),iconAfter:g?n.jsx(k.GhostIconButton,{size:O.ElementSize.Small,"aria-label":s,icon:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:u}):void 0})},xu=16,bu=e=>(e.toString().split(".")[1]??"").length,Cu=({id:e,value:t,min:r=0,max:s=1,step:a=.1,disabled:o,labelProps:i,labels:l,formatValue:c,showValue:d=!1,caption:f,error:p,onChange:g,containerClassName:u,trackClassName:m,fillClassName:C,className:x,...b})=>{const I=h.useId(),N=e??I,T=f&&!p?`${N}-caption`:void 0,S=p?`${N}-error`:void 0,D=s-r,_=D>0?Math.min(100,Math.max(0,(t-r)/D*100)):0,E=`calc(${_}% + ${(.5-_/100)*xu}px)`,A=c?c(t):t.toFixed(bu(a)),L=h.useCallback(w=>{g?.(Number(w.target.value))},[g]);return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-2",u),children:[(i||d)&&n.jsxs("div",{className:"flex items-center gap-2",children:[i&&n.jsx(k.Label,{...i,htmlFor:N}),d&&n.jsx("span",{"aria-hidden":"true",className:y.mergeClasses("dial-small-text ml-auto",o?"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:y.mergeClasses("pointer-events-none absolute inset-x-0 h-1 rounded-full",o?"bg-control-disable-primary":"bg-control-neutral-active",m)}),n.jsx("div",{className:y.mergeClasses("pointer-events-none absolute left-0 h-1 rounded-full",o?"bg-control-disable-secondary":"bg-control-accent",C),style:{width:E}}),n.jsx("input",{...b,type:"range",id:N,value:t,min:r,max:s,step:a,disabled:o,onChange:L,"aria-label":O.resolveAccessibleName(typeof i?.label!="string"?b["aria-label"]:void 0),"aria-valuetext":c?A:void 0,"aria-describedby":S??T,className:y.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(Ke,{id:S,text:p}),!p&&n.jsx(Ve,{id:T,text:f})]})]})},vu=48,yu=({children:e,title:t,width:r=280,collapsedWidth:s=vu,isOpened:a,defaultOpened:o=!0,onToggle:i,additionalButtons:l,ariaLabel:c="Sidebar",collapseLabel:d="Collapse sidebar",expandLabel:f="Expand sidebar",className:p,titleClassName:g,contentClassName:u,footerClassName:m})=>{const C=a!==void 0,[x,b]=h.useState(o),I=C?a:x,N=`collapsible-sidebar-content-${h.useId()}`,T=I?d:f,S=D=>{const _=!I;C||b(_),i?.(_,D)};return n.jsxs("aside",{"aria-label":c,style:{width:`${I?r:s}px`},className:y.mergeClasses("flex flex-col justify-between",p,j.DIAL_KIT_CLASS.collapsibleSidebar),children:[n.jsx("div",{id:N,hidden:!I,className:y.mergeClasses("min-h-0 flex-1 overflow-auto p-4",u),children:e}),n.jsx("div",{hidden:I,className:y.mergeClasses("rotate-180 px-3 py-4 [writing-mode:tb-rl] dial-small-text text-primary",g),children:t}),n.jsxs("div",{className:y.mergeClasses("flex h-12 shrink-0 flex-row items-center gap-2 border-t border-tertiary py-1",I?"justify-end px-2":"justify-center",m),children:[I&&l,n.jsx(k.IconButton,{variant:O.ButtonVariant.Primary,appearance:O.ButtonAppearance.Ghost,size:O.ElementSize.Standard,onClick:S,"aria-label":T,"aria-expanded":I,"aria-controls":N,tooltipProps:{tooltip:T},icon:I?n.jsx(B.IconChevronsLeft,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx(B.IconChevronsRight,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})},Iu=({side:e,isResizing:t,width:r,minWidth:s,maxWidth:a,step:o,ariaLabel:i,onWidthChange:l,customHandler:c,handlerClassName:d})=>{const f=e===v.ResizableContainerSide.Left,p=f?B.IconChevronLeft:B.IconChevronRight,g=u=>{let m;switch(u.key){case"ArrowLeft":m=r+(f?o:-o);break;case"ArrowRight":m=r+(f?-o:o);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":i,"aria-valuenow":r,"aria-valuemin":s,"aria-valuemax":a,tabIndex:0,onKeyDown:g,className:y.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:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:y.mergeClasses("pointer-events-none absolute top-1/2 -translate-y-1/2",f?"right-full":"left-full")})})},Su=16,Cs=({children:e,minWidth:t,maxWidth:r,width:s,defaultWidth:a,onResizeStop:o,onResize:i,side:l=v.ResizableContainerSide.Right,keyboardStep:c=Su,ariaLabel:d="Resize panel",className:f,resizeHandlerClassName:p,resizeHandler:g})=>{const[u,m]=h.useState(!1),[C,x]=h.useState(a??t),b=s!==void 0,I=b?s:C,N=h.useRef(null),T=h.useCallback(()=>{m(!0)},[]),S=h.useCallback(()=>{m(!1);const E=N.current?.resizable?.getBoundingClientRect(),A=E?Math.round(E.width):t;b||x(A),o?.(A)},[o,b,t]),D=h.useCallback(E=>{const A=Math.min(r,Math.max(t,E));A!==I&&(b||(x(A),N.current?.updateSize({width:A,height:"100%"})),i?.(A),o?.(A))},[r,t,I,b,i,o]),_=h.useMemo(()=>{const E=l===v.ResizableContainerSide.Left,A=n.jsx(Iu,{side:l,isResizing:u,width:I,minWidth:t,maxWidth:r,step:c,ariaLabel:d,onWidthChange:D,customHandler:g,handlerClassName:p});return{size:b?{width:I,height:"100%"}:void 0,defaultSize:b?void 0:{width:I,height:"100%"},minWidth:t,maxWidth:r,enable:{left:E,right:!E},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:E?A:void 0,right:E?void 0:A},onResizeStart:T,onResize:(L,w,M)=>{i?.(Math.round(M.offsetWidth))},onResizeStop:S}},[l,b,I,t,r,c,d,D,g,p,u,T,S,i]);return n.jsx(v.Resizable,{ref:N,..._,children:n.jsx("div",{className:y.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",f,j.DIAL_KIT_CLASS.resizableContainer),children:e})})},Du=({enabled:e=!0,children:t,...r})=>e?n.jsx(Cs,{...r,children:t}):t;var Oe=(e=>(e.InProgress="inProgress",e.Success="success",e.Warning="warning",e.Failed="failed",e.Canceled="canceled",e))(Oe||{});const vs=8e3,xt="flex size-7 shrink-0 items-center justify-center",ys={cancelItemAriaLabel:e=>`Cancel "${e}"`,itemProgressAriaLabel:e=>`"${e}" in progress`,successLabel:"Completed",canceledLabel:"Canceled",failedMessage:"Failed",warningMessage:"Completed with warnings",queueProgressAriaLabel:"Progress",queueProgressValueText:(e,t)=>`${e} of ${t}`,collapseAriaLabel:"Collapse",expandAriaLabel:"Expand",closeAriaLabel:"Close",closeConfirmHeader:"Close?",closeConfirmDescriptionInProgress:"Some items are still in progress.",closeConfirmDescriptionFailed:"Some items have failed.",closeConfirmDescriptionMixed:"Some items are still in progress, and some have failed.",closeConfirmLabel:"Close",closeCancelLabel:"Cancel"},Nu=({title:e,failedCount:t,isCollapsed:r,itemsId:s,labels:a,onToggleCollapse:o,onClose:i})=>{const l=r?B.IconChevronUp:B.IconChevronDown;return n.jsxs("div",{className:"mx-4 flex items-center justify-between border-b border-tertiary py-3",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[n.jsx("span",{className:"dial-small-paragraph-semi-text truncate text-primary",children:e}),t>0&&n.jsx("span",{className:"dial-small-paragraph-semi-text inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-control-error px-1 text-control-permanent",children:t})]}),n.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[n.jsx(k.GhostIconButton,{"aria-label":r?a.expandAriaLabel:a.collapseAriaLabel,"aria-expanded":!r,"aria-controls":s,size:O.ElementSize.Small,icon:n.jsx(l,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:o,className:xt}),n.jsx(k.GhostIconButton,{"aria-label":a.closeAriaLabel,size:O.ElementSize.Small,icon:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:i,className:xt})]})]})},xn=({message:e,isError:t})=>{const r=t?B.IconAlertCircleFilled:B.IconAlertTriangleFilled;return n.jsx(k.Tooltip,{tooltip:e,asChild:!0,children:n.jsx("span",{className:xt,role:"img","aria-label":e,tabIndex:0,children:n.jsx(r,{size:$.DIAL_ICON_SIZE.SM,className:t?"text-error":"text-warning-icon","aria-hidden":!0})})})},ju=({item:e,labels:t,onCancel:r})=>{const s=e.status===Oe.Canceled;return n.jsxs("div",{className:"group flex items-center gap-2 px-4 py-2",children:[n.jsx(Or,{type:v.DialItemType.File,name:e.name,size:$.DIAL_ICON_SIZE.MD,className:y.mergeClasses(s&&"opacity-50"),decorative:!0}),n.jsx(k.EllipsisTooltip,{text:e.name,className:y.mergeClasses("dial-small-text",s?"text-secondary":"text-primary")}),e.status===Oe.InProgress&&n.jsxs("div",{className:y.mergeClasses(xt,"grid"),children:[n.jsx(v.Spinner,{size:$.DIAL_ICON_SIZE.SM,ariaLabel:t.itemProgressAriaLabel(e.name),className:y.mergeClasses("pointer-events-none col-start-1 row-start-1 transition-opacity",r&&"group-focus-within:opacity-0 group-hover:opacity-0")}),r&&n.jsx(k.GhostIconButton,{"aria-label":t.cancelItemAriaLabel(e.name),size:O.ElementSize.Small,icon:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:()=>r(e.id),className:"col-start-1 row-start-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100"})]}),e.status===Oe.Success&&n.jsx("span",{className:xt,role:"img","aria-label":t.successLabel,children:n.jsx(B.IconCheck,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-accent","aria-hidden":!0})}),e.status===Oe.Warning&&n.jsx(xn,{message:e.message||t.warningMessage,isError:!1}),e.status===Oe.Failed&&n.jsx(xn,{message:e.message||t.failedMessage,isError:!0}),s&&n.jsx("span",{className:"dial-small-text shrink-0 text-secondary",children:t.canceledLabel})]})},Tu=e=>Math.round(e.reduce((t,r)=>t+(r.percent??(r.status===Oe.InProgress?0:100)),0)/e.length),wu=(e,t,r)=>e&&t?r.closeConfirmDescriptionMixed:t?r.closeConfirmDescriptionFailed:r.closeConfirmDescriptionInProgress,Eu=({title:e,items:t,onClose:r,onCancelItem:s,labels:a,autoCloseDelay:o=vs,className:i,bodyClassName:l})=>{const[c,d]=h.useState(!1),[f,p]=h.useState(!1),g=h.useId(),u={...ys,...a},m=t.filter(D=>D.status===Oe.InProgress).length,C=m>0,x=t.filter(D=>D.status===Oe.Failed).length,b=x>0,I=t.length>0&&t.every(D=>D.status===Oe.Success),N=h.useCallback(()=>{C||b?p(!0):r()},[C,b,r]),T=h.useCallback(()=>{p(!1),r()},[r]),S=h.useCallback(()=>{d(D=>!D)},[]);return h.useEffect(()=>{if(!I||o<=0)return;const D=setTimeout(r,o);return()=>clearTimeout(D)},[I,o,r]),t.length===0?null:n.jsxs("div",{role:"status","aria-live":"polite",className:y.mergeClasses("w-[370px] max-w-[calc(100vw-2rem)] rounded-xl bg-layer-raised shadow-md",i,j.DIAL_KIT_CLASS.transferQueue),children:[n.jsx(Nu,{title:e,failedCount:x,isCollapsed:c,itemsId:g,labels:u,onToggleCollapse:S,onClose:N}),c&&C&&n.jsx(yn,{value:Tu(t),size:O.ElementSize.Small,"aria-label":u.queueProgressAriaLabel,"aria-valuetext":u.queueProgressValueText(t.length-m,t.length)}),!c&&n.jsx("div",{id:g,className:y.mergeClasses("flex max-h-[40vh] flex-col overflow-y-auto py-1",l),children:t.map(D=>n.jsx(ju,{item:D,labels:u,onCancel:s},D.id))}),n.jsx(ps,{open:f,header:u.closeConfirmHeader,description:wu(C,b,u),confirmLabel:u.closeConfirmLabel,cancelLabel:u.closeCancelLabel,variant:v.ConfirmationPopupVariant.Danger,onConfirm:T,onClose:()=>p(!1)})]})};exports.ConfirmationPopupVariant=v.ConfirmationPopupVariant;exports.DialBreadcrumb=v.DialBreadcrumb;exports.DialBreadcrumbItem=v.DialBreadcrumbItem;exports.DialButton=v.DialButton;exports.DialButtonDropdown=v.DialButtonDropdown;exports.DialCaptionText=v.DialCaptionText;exports.DialCollapsibleSidebar=v.DialCollapsibleSidebar;exports.DialConditionalResizableContainer=v.DialConditionalResizableContainer;exports.DialConfirmationPopup=v.DialConfirmationPopup;exports.DialDangerButton=v.DialDangerButton;exports.DialDestinationFolderPopup=v.DialDestinationFolderPopup;exports.DialErrorText=v.DialErrorText;exports.DialFileIcon=v.DialFileIcon;exports.DialFileManager=v.DialFileManager;exports.DialFileManagerActions=v.DialFileManagerActions;exports.DialFileManagerTabs=v.DialFileManagerTabs;exports.DialFileName=v.DialFileName;exports.DialFileNodeType=v.DialFileNodeType;exports.DialFilePermission=v.DialFilePermission;exports.DialFileResourceType=v.DialFileResourceType;exports.DialFolderName=v.DialFolderName;exports.DialFoldersTree=v.DialFoldersTree;exports.DialFormItem=v.DialFormItem;exports.DialGhostButton=v.DialGhostButton;exports.DialInput=v.DialInput;exports.DialItemType=v.DialItemType;exports.DialLinkButton=v.DialLinkButton;exports.DialLoader=v.DialLoader;exports.DialNeutralButton=v.DialNeutralButton;exports.DialNotification=v.DialNotification;exports.DialPopup=v.DialPopup;exports.DialPrimaryButton=v.DialPrimaryButton;exports.DialRadioGroup=v.DialRadioGroup;exports.DialResizableContainer=v.DialResizableContainer;exports.DialSearch=v.DialSearch;exports.DialSharedEntityIndicator=v.DialSharedEntityIndicator;exports.DialTabs=v.DialTabs;exports.EDITABLE_CONTAINER_ATTRIBUTE=v.EDITABLE_CONTAINER_ATTRIBUTE;exports.FileManagerColumnKey=v.FileManagerColumnKey;exports.FileManagerProvider=v.FileManagerProvider;exports.FlexibleActionsDirection=v.FlexibleActionsDirection;exports.FormItemOrientation=v.FormItemOrientation;exports.NAME_COLUMN=v.NAME_COLUMN;exports.NOT_ALLOWED_SPACES=v.NOT_ALLOWED_SPACES;exports.NOT_ALLOWED_SPACES_REGEXP=v.NOT_ALLOWED_SPACES_REGEXP;exports.NOT_ALLOWED_SYMBOLS=v.NOT_ALLOWED_SYMBOLS;exports.NOT_ALLOWED_SYMBOLS_REGEXP=v.NOT_ALLOWED_SYMBOLS_REGEXP;exports.NotificationType=v.NotificationType;exports.NotificationVariant=v.NotificationVariant;exports.PopupSize=v.PopupSize;exports.RadioGroupOrientation=v.RadioGroupOrientation;exports.ResizableContainerSide=v.ResizableContainerSide;exports.SIZE_COLUMN=v.SIZE_COLUMN;exports.ScreenResolution=v.ScreenResolution;exports.Skeleton=v.Skeleton;exports.SkeletonAvatarShape=v.SkeletonAvatarShape;exports.SkeletonAvatarSize=v.SkeletonAvatarSize;exports.SkeletonVariant=v.SkeletonVariant;exports.Spinner=v.Spinner;exports.TabOrientation=v.TabOrientation;exports.TabView=v.TabView;exports.UPDATED_AT_COLUMN=v.UPDATED_AT_COLUMN;exports.editableContainerProps=v.editableContainerProps;exports.useDialFileManagerTabs=v.useDialFileManagerTabs;exports.useEditableItem=v.useEditableItem;exports.useFileManagerContext=v.useFileManagerContext;exports.DialLabel=Be.DialLabel;exports.DialSwitch=Be.DialSwitch;exports.DEFAULT_GRID_DATE_FORMAT_OPTIONS=j.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_GRID_DATE_LOCALE=j.DEFAULT_LOCALE;exports.DIAL_KIT_CLASS=j.DIAL_KIT_CLASS;exports.DialCloseButton=j.DialCloseButton;exports.DialDangerIconButton=j.DialDangerIconButton;exports.DialDateCellRenderer=j.DialDateCellRenderer;exports.DialDropdown=j.DialDropdown;exports.DialEllipsisTooltip=j.DialEllipsisTooltip;exports.DialGhostIconButton=j.DialGhostIconButton;exports.DialGrid=j.DialGrid;exports.DialIcon=j.DialIcon;exports.DialNeutralIconButton=j.DialNeutralIconButton;exports.DialNoDataContent=j.DialNoDataContent;exports.DialPrimaryIconButton=j.DialPrimaryIconButton;exports.DialRadioButton=j.DialRadioButton;exports.DialSecondaryIconButton=j.DialSecondaryIconButton;exports.DialSuccessIconButton=j.DialSuccessIconButton;exports.DialTertiaryIconButton=j.DialTertiaryIconButton;exports.DropdownItemType=j.DropdownItemType;exports.DropdownTrigger=j.DropdownTrigger;exports.DropdownType=j.DropdownType;exports.GridSelectionMode=j.GridSelectionMode;exports.ThemeScope=j.ThemeScope;exports.baseColumnComparator=j.baseColumnComparator;exports.checkColDefsChanges=j.checkColDefsChanges;exports.convertGridDateToDate=j.convertToDate;exports.convertToDate=j.convertToDate;exports.useThemeScope=j.useThemeScope;exports.BASE_ICON_PROPS=$.BASE_ICON_PROPS;exports.BASE_ICON_SIZE=$.BASE_ICON_SIZE;exports.DIAL_ICON_SIZE=$.DIAL_ICON_SIZE;exports.mergeClasses=y.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=O.ButtonAppearance;exports.ButtonVariant=O.ButtonVariant;exports.DialIconButton=O.DialIconButton;exports.DialTooltip=O.DialTooltip;exports.DialTooltipContainer=O.DialTooltipContainer;exports.DialTooltipContent=O.DialTooltipContent;exports.DialTooltipTrigger=O.DialTooltipTrigger;exports.ElementSize=O.ElementSize;exports.EditorThemes=bt.EditorThemes;exports.LazyDialJsonEditor=bt.LazyDialJsonEditor;exports.LazyDialMarkdownEditor=bt.LazyDialMarkdownEditor;exports.LazyMarkdownEditor=bt.LazyMarkdownEditor;exports.DIAL_KIT_ICON_STROKE=ie.DIAL_KIT_ICON_STROKE;exports.Accordion=ad;exports.AccordionCaretPosition=_t;exports.AnalyticsCardVariant=gt;exports.AutocompleteTagInput=gu;exports.Avatar=bs;exports.AvatarShape=at;exports.Badge=Qd;exports.BadgeColor=Re;exports.BadgeVariant=He;exports.BottomSheet=Wd;exports.Breadcrumbs=nc;exports.BreadcrumbsSize=We;exports.Button=Xe;exports.ButtonDropdown=uc;exports.Calendar=Vl;exports.CalendarMode=Se;exports.CaptionText=Ve;exports.CardShell=hl;exports.CollapsibleSidebar=yu;exports.ConditionalResizableContainer=Du;exports.ConfirmationPopup=ps;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=gr;exports.DEFAULT_TRANSFER_QUEUE_LABELS=ys;exports.DangerButton=sc;exports.DialAccordion=bn;exports.DialAnalyticsBar=St;exports.DialAnalyticsBarGroup=ks;exports.DialAnalyticsCard=As;exports.DialAnalyticsErrorTag=pr;exports.DialAnalyticsHistogram=Bs;exports.DialAutocompleteInputValue=kn;exports.DialCheckbox=sr;exports.DialDraggableItem=Jo;exports.DialDropdownIcon=Vi;exports.DialFormPopup=fi;exports.DialInputPopup=Rn;exports.DialLabelledText=Ys;exports.DialLoadFileArea=Kn;exports.DialLoadFileAreaField=Hi;exports.DialNumberInput=cr;exports.DialPagination=Ks;exports.DialPasswordInput=Mn;exports.DialRadioGroupPopupField=li;exports.DialRemoveButton=Ft;exports.DialSchemaRenderer=cl;exports.DialSegmentedControl=oi;exports.DialSelect=_e;exports.DialSelectField=Di;exports.DialSlider=qs;exports.DialSteps=Ws;exports.DialTag=Ue;exports.DialTagInput=Ln;exports.DialTextarea=ei;exports.EntityIdentity=au;exports.EntityType=he;exports.ErrorMessageNotification=Il;exports.ErrorText=Ke;exports.ErrorToastNotification=ml;exports.FabButton=cc;exports.FileDropzone=Md;exports.FileIcon=Or;exports.FileName=ms;exports.FilterChips=Rd;exports.FolderName=Zd;exports.FolderPath=Kl;exports.GeneralMessageNotification=Tl;exports.GeneralToastNotification=yl;exports.GhostButton=ic;exports.Highlight=Jn;exports.InfoMessageNotification=Sl;exports.InfoToastNotification=xl;exports.InlineSelect=fc;exports.InlineSelectTrigger=is;exports.Input=$e;exports.JsonSchemaType=V;exports.LinkButton=oc;exports.LoadingMessageNotification=jl;exports.LoadingToastNotification=vl;exports.MultiSelectTags=pt;exports.NeutralButton=wr;exports.Notification=Nr;exports.NumberInput=Gc;exports.OutlinedButton=lc;exports.PasswordInput=$c;exports.Popup=Er;exports.PrimaryButton=os;exports.ProgressBar=yn;exports.RadioGroup=gs;exports.RadioGroupPopupField=Cd;exports.ResizableContainer=Cs;exports.SchemaDisplayMode=ht;exports.SchemaOrientation=zt;exports.SchemaRendererVariant=st;exports.Search=mu;exports.SegmentedControl=Od;exports.Select=Fc;exports.SelectSize=Tt;exports.SelectVariant=wt;exports.SharedEntityIndicator=hs;exports.SideDrawer=ou;exports.Slider=Cu;exports.StarterButton=ac;exports.StepStatus=De;exports.SuccessMessageNotification=Dl;exports.SuccessToastNotification=bl;exports.Switch=od;exports.TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS=vs;exports.Tabs=_d;exports.Tag=Ae;exports.TagAppearance=qe;exports.TagInput=uu;exports.Textarea=zc;exports.TextareaResize=fs;exports.ToggleIconButton=vd;exports.TransferQueue=Eu;exports.TransferQueueItemStatus=Oe;exports.WarningMessageNotification=Nl;exports.WarningToastNotification=Cl;exports.extractInitials=xs;exports.getTimezoneLabel=Gn;exports.matchesAccept=fr;exports.wrapInRootFolder=qi;