@epam/ai-dial-ui-kit 0.16.0-dev.49 → 0.16.0-dev.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),f=require("./icon-D93YIwGJ.cjs"),c=require("./DateCellRenderer-C3KzulHA.cjs"),F=require("@tabler/icons-react"),B=require("@floating-ui/react"),m=require("react"),ee=require("classnames"),fn=require("./editors.cjs"),za=require("react-dom");function Fa(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Me=Fa(m),Mr=({text:e,className:t,variant:r=c.CaptionType.Description,...n})=>e?s.jsx("span",{...n,role:"alert",className:f.mergeClasses("dial-tiny-text",r===c.CaptionType.Error?"text-error":"text-secondary",t),children:e}):null,Fe=({...e})=>s.jsx(Mr,{...e,variant:c.CaptionType.Error}),hs={[c.ButtonVariant.Primary]:{[c.ButtonAppearance.Solid]:"dial-primary-solid-button",[c.ButtonAppearance.Ghost]:"dial-primary-ghost-button",[c.ButtonAppearance.Link]:"dial-primary-link-button"},[c.ButtonVariant.Neutral]:{[c.ButtonAppearance.Outlined]:"dial-neutral-outlined-button"},[c.ButtonVariant.Danger]:{[c.ButtonAppearance.Solid]:"dial-danger-solid-button",[c.ButtonAppearance.Ghost]:"dial-danger-ghost-button",[c.ButtonAppearance.Outlined]:"dial-danger-outlined-button"},[c.ButtonVariant.Success]:{[c.ButtonAppearance.Ghost]:"dial-success-ghost-button"},[c.ButtonVariant.Secondary]:{[c.ButtonAppearance.Ghost]:"dial-secondary-ghost-button"},[c.ButtonVariant.Tertiary]:{[c.ButtonAppearance.Ghost]:"dial-tertiary-ghost-button"},[c.ButtonVariant.Static]:{},[c.ButtonVariant.Starter]:{}},pn=(e=c.ButtonVariant.Primary,t=c.ButtonAppearance.Solid)=>{const r=hs[e]?.[t];return r||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${t}. Using default primary solid button styles.`),hs[c.ButtonVariant.Primary][c.ButtonAppearance.Solid])},Ha=7,$a=2,hn=m.createContext(null),mn=()=>{const e=m.useContext(hn);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},Ka=({initialOpen:e=!1,placement:t="bottom",isTriggerClickable:r=!1,open:n,onOpenChange:a}={})=>{const[o,i]=m.useState(e),l=m.useRef(null),d=n??o,u=a??i,h=B.useFloating({placement:t,open:d,onOpenChange:u,whileElementsMounted:B.autoUpdate,middleware:[B.offset(Ha+$a),B.flip({crossAxis:t.includes("-"),fallbackAxisSideDirection:"start",padding:5}),B.shift({padding:5}),B.arrow({element:l})]}),p=B.useHover(h.context,{move:!1,enabled:n==null,mouseOnly:r,delay:{open:500,close:0}}),g=B.useFocus(h.context,{enabled:n==null}),x=B.useDismiss(h.context),y=B.useRole(h.context,{role:"tooltip"}),v=B.useInteractions([p,g,x,y]);return m.useEffect(()=>{if(!d)return;const b=h.refs.reference.current;if(!(b instanceof Element))return;const C=new IntersectionObserver(([I])=>{I.isIntersecting||u(!1)},{root:null,threshold:0});return C.observe(b),()=>C.disconnect()},[d,h.refs.reference,u]),m.useMemo(()=>({open:d,setOpen:u,arrowRef:l,...v,...h}),[d,u,v,h])},Pr=({children:e,...t})=>{const r=Ka(t);return s.jsx(hn.Provider,{value:r,children:e})},Br=({style:e,...t})=>{const r=mn(),n=c.useHasHover(),a=m.useRef(null),o=B.useMergeRefs([r.refs.setFloating,a]);return!r.open||!n?null:s.jsx(B.FloatingPortal,{id:"tooltip-portal",children:s.jsxs("div",{ref:o,style:{...r.floatingStyles,...e},...r.getFloatingProps(t),className:ee("z-tooltip whitespace-pre-wrap break-words rounded border border-primary bg-layer-0 px-2 py-1 dial-tiny-text shadow max-w-[300px]",r.getFloatingProps(t).className),children:[t.children,s.jsx(B.FloatingArrow,{ref:r.arrowRef,context:r.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary text-[var(--bg-layer-0,_#000000)]"})]})})},zr=({children:e,asChild:t=!1,...r})=>{const n=mn(),a=t&&m.isValidElement(e),o=a?e.props?.ref:null,i=B.useMergeRefs([n.refs.setReference,...o?[o]:[]]);return a?m.cloneElement(e,n.getReferenceProps({...e.props,...r,ref:i})):s.jsx("span",{ref:i,...n.getReferenceProps(r),className:r.className??"dial-tooltip-trigger text-start",children:e})},qe=({hideTooltip:e,tooltip:t,children:r,triggerClassName:n,contentClassName:a,...o})=>s.jsxs(Pr,{...o,children:[s.jsx(zr,{className:ee(n,"truncate"),children:r}),s.jsx(Br,{className:ee("text-primary",a,"max-w-[300px]",(e||!t)&&"hidden"),children:t})]}),Dt=({variant:e,appearance:t=c.ButtonAppearance.Solid,size:r=c.ElementSize.Standard,className:n,icon:a,tooltipProps:o,type:i="button",...l})=>{const d=f.mergeClasses(e&&pn(e,t),r===c.ElementSize.Small?"h-[24px] w-[24px]":"h-[40px] w-[40px] dial-kit-enhanced-target","dial-icon-button disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",n),u=s.jsx("button",{...l,type:i,className:d,"aria-label":c.resolveAccessibleName(l["aria-label"],o?.tooltip),children:a});return o?s.jsx(qe,{...o,children:u}):u},Va="w-[24px] h-[24px] border border-solid rounded-[6px] border-transparent flex items-center justify-center text-secondary hover:text-controls-accent-primary-hover active:text-controls-accent-primary-active",Wa=({caption:e,onClick:t})=>{if(!e)return null;const r=s.jsx(Dt,{"aria-label":e,className:Va,icon:s.jsx(F.IconInfoCircle,{size:f.DIAL_ICON_SIZE.SM}),onClick:t});return e?s.jsx(qe,{tooltip:e,triggerClassName:"flex justify-center items-center",children:r}):r},Fr=({label:e,required:t,className:r,caption:n,...a})=>e?s.jsxs("label",{...a,className:f.mergeClasses("dial-tiny-text text-secondary flex items-center gap-1",r),children:[typeof e=="string"?s.jsx("span",{className:"min-h-4",children:e}):e,t&&s.jsx("span",{className:"text-accent-primary",children:"*"}),s.jsx(Wa,{caption:n})]}):null,Ga=({title:e,description:t,children:r,expanded:n,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,onToggle:l,className:d,headerClassName:u,contentClassName:h})=>{const p=n!==void 0,[g,x]=m.useState(a),y=i?!0:p?n:g,v=m.useId(),b=()=>{if(o)return;const C=!y;p||x(C),l?.(C)};return s.jsxs("div",{className:f.mergeClasses("rounded border border-secondary",d),children:[s.jsxs("button",{type:"button","aria-expanded":y,"aria-controls":v,disabled:o||i,onClick:b,className:f.mergeClasses("flex w-full items-center gap-2 p-4 text-left",o?"cursor-not-allowed":"cursor-pointer",i&&"cursor-default",u),children:[!i&&s.jsx(c.DialIcon,{className:ee("text-secondary transition-transform",y&&"rotate-90"),icon:s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM})}),s.jsx("span",{className:"dial-body-text text-primary",children:e}),t!=null&&t!==!1&&s.jsx("span",{className:"dial-tiny-text text-secondary",children:t})]}),y&&s.jsx("div",{id:v,role:"region",className:f.mergeClasses("px-4 pb-4",h),children:r})]})},Ua="flex items-center justify-center text-secondary",Za="shrink-0 grow-0 basis-auto animate-spin-steps",qa=e=>Me.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Me.createElement("path",{d:"M24 39V46.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.4,d:"M9 24H1.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.5,d:"M8.0918 8.0918L13.3994 13.3994",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.6,d:"M24 1.5V9",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.7,d:"M39.9121 8.08594L37.2607 10.7373L34.6094 13.3887",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.8,d:"M46.5 24H39",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.9,d:"M34.6055 34.6055L39.9082 39.9082",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.3,d:"M13.3936 34.6055L8.08594 39.9131",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),Ya=({size:e=18,className:t,iconClassName:r,fullWidth:n=!0,ariaLabel:a="Loading"})=>s.jsx("div",{role:"status",className:ee({[Ua]:!0,"size-full":n,[t||""]:!!t}),children:s.jsx(c.DialIcon,{icon:s.jsx(qa,{width:e,height:e,className:ee(Za,r),role:"img","aria-label":a})})}),Ve=({size:e=40,className:t,fullWidth:r=!1,ariaLabel:n="Loading"})=>s.jsx("div",{role:"status",className:f.mergeClasses("flex items-center justify-center",{"size-full":r},t,c.DIAL_KIT_CLASS.spinner),children:s.jsx("div",{role:"img","aria-label":n,style:{width:e,height:e},className:"rounded-full border-2 border-secondary border-t-accent animate-spin-steps shrink-0"})}),gn=({value:e,max:t=100,size:r=c.ElementSize.Standard,labelProps:n,valueLabel:a,id:o,className:i,"aria-label":l,...d})=>{const u=m.useId(),h=o??u,p=!!n?.label,g=p?n?.id??`${h}-label`:void 0,x=t>0?t:0,y=Number.isFinite(e)?e:0,v=Math.min(Math.max(y,0),x),b=x>0?v/x*100:0,C=s.jsx("div",{...d,id:h,role:"progressbar","aria-valuenow":v,"aria-valuemin":0,"aria-valuemax":x,"aria-labelledby":g,"aria-label":c.resolveAccessibleName(l,p?void 0:"Progress"),className:f.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===c.ElementSize.Small?"h-1":"h-2",i,!p&&!a&&c.DIAL_KIT_CLASS.progressBar),children:s.jsx("div",{style:{width:`${b}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!p&&!a?C:s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-1",c.DIAL_KIT_CLASS.progressBar),children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[n&&s.jsx(c.Label,{...n,id:g}),a&&s.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),C]})},Xa=({icon:e,title:t,description:r,containerClassName:n,titleClassName:a,descriptionClassName:o})=>s.jsxs("div",{className:f.mergeClasses("h-full w-full flex flex-col items-center justify-center text-secondary",n),"aria-label":"no-data-container",children:[e||s.jsx(F.IconClipboardX,{width:60,height:60,stroke:.5}),s.jsx("span",{className:f.mergeClasses("dial-small-text mt-2 text-primary",a),"aria-label":"no-results-title",children:t}),r&&s.jsx("span",{className:f.mergeClasses("mt-1 text-primary",o),"aria-label":"no-results-description",children:r})]}),Qa=({label:e,text:t,tooltip:r,children:n,postfix:a,className:o})=>s.jsxs("div",{className:f.mergeClasses("flex flex-col",n?"":"max-w-[200px]",o),children:[e&&s.jsx("label",{className:"dial-tiny-text mb-2 text-secondary",children:e}),n||s.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[s.jsx(qe,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),Tt=({label:e,variant:t,appearance:r=c.ButtonAppearance.Solid,size:n=c.ElementSize.Standard,className:a,textClassName:o,iconAfter:i,iconBefore:l,hideTitleOnMobile:d,type:u="button",tooltipProps:h,...p})=>{const g=ee(d?"hidden sm:inline":"inline",o),x=f.mergeClasses(t&&pn(t,r),n===c.ElementSize.Small?"dial-tiny-semi-text":"dial-small-semi-text",r!==c.ButtonAppearance.Link&&(n===c.ElementSize.Small?"h-[24px] px-2":"h-[40px] px-3"),n!==c.ElementSize.Small&&r!==c.ButtonAppearance.Link&&"dial-kit-enhanced-target","disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",a),y=s.jsxs("button",{...p,type:u,className:x,"aria-label":typeof e=="string"&&e||p["aria-label"],children:[s.jsx(c.DialIcon,{icon:l}),e&&s.jsx("span",{className:g,children:e}),s.jsx(c.DialIcon,{icon:i})]});return h?s.jsx(qe,{...h,children:y}):y},Ja="text-primary",Qt=({text:e,className:t,contentClassName:r,hideTooltip:n,id:a,customTooltipContent:o,...i})=>{const l=m.useRef(null),[d,u]=m.useState(!1),[h,p]=m.useState(""),g=m.useCallback(()=>{const b=l.current;b&&(p(b.textContent??""),u(b.scrollWidth>b.clientWidth))},[]),x=m.useCallback(()=>c.scheduleMeasure(g),[g]);m.useEffect(()=>{const b=l.current;if(b)return c.observeElementSize(b,g)},[g]),m.useEffect(()=>{x()},[e,x]);const y=m.useMemo(()=>typeof e=="string"?e:h,[h,e]),v=m.useMemo(()=>n?"":o||(d?y:""),[o,y,n,d]);return s.jsxs(Pr,{...i,children:[s.jsx(zr,{asChild:!0,onMouseEnter:x,onFocusCapture:x,children:s.jsx("span",{id:a,className:f.mergeClasses("block truncate flex-1 min-w-0 max-w-full text-start",t),"aria-label":d?y:void 0,onMouseEnter:x,onFocus:x,ref:l,children:e})}),s.jsx(Br,{className:f.mergeClasses(Ja,r,!v&&"hidden"),children:v})]})},eo=({label:e,className:t,icon:r,selected:n,closable:a,onClick:o,onRemove:i})=>{const l=f.mergeClasses("flex items-center gap-1 cursor-pointer dial-tiny-text px-2 h-[24px] border text-primary rounded-[8px]",n?"hover:bg-controls-accent-primary-alpha-active bg-accent-primary-alpha border-accent-primary":"bg-neutral border-primary",t);return s.jsxs("div",{className:l,onClick:o,children:[s.jsx(c.DialIcon,{icon:r}),s.jsx(Qt,{text:e}),a&&i&&s.jsx(Tt,{className:"p-0",iconAfter:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM}),onClick:d=>i(d)})]},e)};var Ee=(e=>(e.Default="default",e.Text="text",e.Circular="circular",e.Rectangular="rectangular",e))(Ee||{}),bt=(e=>(e.Small="small",e.Default="default",e.Large="large",e))(bt||{}),Vt=(e=>(e.Circle="circle",e.Square="square",e))(Vt||{});const to=e=>{if(typeof e=="number")return e;switch(e){case bt.Small:return 32;case bt.Large:return 64;case bt.Default:default:return 40}},Ht=({active:e=!0,paragraph:t=!0,avatar:r=!1,showTitle:n=!0,loading:a=!0,children:o,variant:i=Ee.Default,width:l,height:d,overlay:u,color:h,className:p,...g})=>{if(!a&&o)return s.jsx(s.Fragment,{children:o});const x=f.mergeClasses("bg-layer-raised",e&&"animate-pulse",p);if(i!==Ee.Default){const D=f.mergeClasses(x,i===Ee.Circular&&"rounded-full",i===Ee.Rectangular&&"rounded",i===Ee.Text&&"rounded",!!u&&"relative"),E={};return l&&(E.width=typeof l=="number"?`${l}px`:l),d&&(E.height=typeof d=="number"?`${d}px`:d),h&&(E.backgroundColor=h),s.jsx("div",{className:D,style:E,...g,children:u&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:u})})}const y=!!r,v=!!n,b=!!t,C=typeof r=="object"?r:{},I=typeof n=="object"?n:{},S=typeof t=="object"?t:{},w=to(C.size),N=C.shape??Vt.Circle,L=I.width??"38%",A=S.rows??3,T=S.width,j=D=>T?Array.isArray(T)?T[D]??"100%":T:D===A-1?"61%":"100%";return s.jsxs("div",{...g,className:f.mergeClasses("flex gap-4",!!u&&"relative",p,c.DIAL_KIT_CLASS.skeleton),children:[y&&s.jsx("div",{className:f.mergeClasses(x,N===Vt.Circle?"rounded-full":"rounded","flex-shrink-0"),style:{width:w,height:w,...h&&{backgroundColor:h}}}),s.jsxs("div",{className:"flex-1 flex flex-col gap-3",children:[v&&s.jsx("div",{className:f.mergeClasses(x,"h-4 rounded"),style:{width:L,...h&&{backgroundColor:h}}}),b&&s.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:A}).map((D,E)=>s.jsx("div",{className:f.mergeClasses(x,"h-4 rounded"),style:{width:j(E),...h&&{backgroundColor:h}}},E))})]}),u&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:u})]})},ro=ee("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),so=ee("z-floating overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-hidden"),jr=ee("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-hidden","hover:bg-accent-primary-alpha px-3","dial-small-text h-[34px] rounded text-primary",c.DIAL_KIT_CLASS.menuItem),Dr="opacity-75 !cursor-not-allowed",xn="text-error",no="my-1 border-t border-hover border-secondary",st=4,ao=s.jsx(F.IconChevronRight,{size:14}),ct=(e,t)=>({appearance:n,...a})=>s.jsx(Dt,{...a,variant:e,appearance:n||t}),oo=(e,t)=>({variant:n,...a})=>s.jsx(Dt,{...a,variant:n||t,appearance:e}),io=ct(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),lo=ct(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),bn=ct(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),co=ct(c.ButtonVariant.Secondary,c.ButtonAppearance.Ghost),uo=ct(c.ButtonVariant.Tertiary,c.ButtonAppearance.Ghost),fo=ct(c.ButtonVariant.Success,c.ButtonAppearance.Ghost),vn=oo(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),yn=({ariaLabel:e,className:t,size:r=24,onClose:n,...a})=>s.jsx(vn,{"aria-label":e,className:f.mergeClasses(t,"w-auto h-auto"),onClick:n,icon:s.jsx(F.IconX,{size:r}),...a}),po=({item:e,onRootClose:t})=>{const{isOpen:r,refs:n,floatingStyles:a,context:o,getReferenceProps:i,getFloatingProps:l}=c.useSubMenuFloating(st,"menu",!!e.disabled),d=m.useCallback(u=>h=>{u.disabled||(u.onClick?.({key:u.key,domEvent:h}),t())},[t]);return s.jsxs(s.Fragment,{children:[s.jsxs("button",{ref:n.setReference,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":r,"aria-disabled":!!e.disabled,disabled:e.disabled,className:ee(jr,e.disabled&&Dr,e.className),...i(),children:[e.icon&&s.jsx("span",{className:ee(e.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:e.icon})}),s.jsx("span",{className:ee("flex-1 truncate text-start",e.disabled&&"text-secondary"),children:e.label}),s.jsx("span",{className:ee("ml-auto shrink-0",e.disabled&&"text-secondary"),children:ao})]}),r&&s.jsx(c.SubMenuPanel,{refs:n,floatingStyles:a,context:o,getFloatingProps:l,role:"menu",className:"w-max",children:s.jsx("div",{role:"none",className:ee("py-1",c.DIAL_KIT_CLASS.dropdownList),children:e.children.map(u=>s.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!u.disabled,disabled:u.disabled,className:ee(jr,u.disabled&&Dr,u.danger&&xn,u.className),onClick:d(u),children:[u.icon&&s.jsx("span",{className:ee(u.danger&&"text-error",u.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:u.icon})}),s.jsx("span",{className:ee("flex-1 truncate text-start",u.danger&&"text-error",u.disabled&&"text-secondary"),children:u.label})]},u.key))})})]})},ho=e=>"clientWidth"in e?e.clientWidth:e.getBoundingClientRect?.()?.width??0,Wt=({children:e,items:t,onItemClick:r,menuHeader:n,menuFooter:a,renderOverlay:o,trigger:i=[c.DropdownTrigger.Click],placement:l,disabled:d=!1,open:u,defaultOpen:h=!1,onOpenChange:p,closable:g=!1,onClose:x,className:y,overlayContentClassName:v,separatorClassName:b,listClassName:C,outsidePressIgnoreRef:I,outsideClosable:S=!0,allowedPlacements:w,anchorToMouse:N=!1,matchReferenceWidth:L=!0,maxDropdownHeight:A})=>{const[T,j]=m.useState(h),D=u!==void 0,E=D?!!u:T,k=m.useRef(null),P=m.useCallback(_=>{D||j(_),p?.(_)},[D,p]),O=m.useId(),R=l===void 0,{refs:M,floatingStyles:H,context:W}=B.useFloating({placement:l,open:E,onOpenChange:P,whileElementsMounted:B.autoUpdate,middleware:[B.offset({mainAxis:st,crossAxis:0}),R?B.autoPlacement({alignment:"start",crossAxis:!0,padding:st,allowedPlacements:w}):B.flip({padding:st}),B.shift({padding:st}),B.size({padding:st,apply({availableWidth:_,availableHeight:U,elements:de}){const ne=de.floating,ge=ho(de.reference);ne.style.setProperty("--fui-available-height",`${Math.floor(U)}px`),ne.style.setProperty("--reference-width",L?`${Math.round(ge)}px`:"0px"),L?ne.style.minWidth=`${Math.round(ge)}px`:ne.style.removeProperty("min-width"),ne.style.maxWidth=`${Math.floor(_)}px`;const Qe=Math.floor(U);ne.style.maxHeight=`${A?Math.min(Qe,A):Qe}px`}})]}),K=B.useClick(W,{enabled:i.includes(c.DropdownTrigger.Click)&&!d}),V=B.useHover(W,{enabled:i.includes(c.DropdownTrigger.Hover)&&!d,move:!1,restMs:40,delay:{open:80,close:80}}),G=B.useDismiss(W,{bubbles:!0,referencePress:!1,outsidePress:_=>{if(!S)return!1;const U=_.target;return!(I?.current&&U instanceof Node&&I.current.contains(U))}}),J=B.useRole(W,{role:"menu"}),{getReferenceProps:re,getFloatingProps:q}=B.useInteractions([K,V,G,J]),Y=m.useCallback((_,U)=>{M.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:_,y:U,top:U,left:_,right:_,bottom:U})})},[M]),se=m.useCallback(_=>{!i.includes(c.DropdownTrigger.ContextMenu)||d||(_.preventDefault(),N&&(Y(_.clientX,_.clientY),k.current=document.elementFromPoint(_.clientX,_.clientY)),P(!0))},[N,d,P,Y,i]),le=m.useCallback(_=>{!N||d||(i.includes(c.DropdownTrigger.ContextMenu)&&E&&P(!1),Y(_.clientX,_.clientY),k.current=document.elementFromPoint(_.clientX,_.clientY))},[N,d,Y,E,i,P]);m.useEffect(()=>{d&&E&&P(!1)},[d,E,P]);const oe=m.useCallback(_=>U=>{_.disabled||(_.onClick?.({key:_.key,domEvent:U}),r?.({key:_.key,domEvent:U}),P(!1))},[r,P]),me=m.useMemo(()=>o?o():t?s.jsxs(s.Fragment,{children:[n&&s.jsx(s.Fragment,{children:typeof n=="function"?n():n}),s.jsx("div",{role:"none",className:f.mergeClasses("py-1",v,c.DIAL_KIT_CLASS.dropdownList),"aria-label":"dropdown",children:t.map(_=>_.type===c.DropdownItemType.Divider?s.jsx("div",{role:"separator",className:f.mergeClasses(no,b)},_.key):_.type===c.DropdownItemType.PlainText?s.jsx("div",{className:f.mergeClasses("px-3 py-2 text-secondary dial-caption-text",_.className),children:_.label},_.key):_.children?.length?s.jsx(po,{item:_,onRootClose:()=>P(!1)},_.key):s.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!_.disabled,className:ee(jr,_.disabled&&Dr,_.danger&&xn,_.className),disabled:_.disabled,onClick:oe(_),children:[_.icon&&s.jsx("span",{className:ee(_.danger&&"text-error",_.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:_.icon})}),s.jsx("span",{className:ee("flex-1 truncate text-start",_.danger&&"text-error",_.disabled&&"text-secondary"),"aria-labelledby":"item-text",children:_.label})]},_.key))}),a&&s.jsx(s.Fragment,{children:typeof a=="function"?a():a})]}):null,[oe,t,a,n,o,P,v,b]),ve=re({onContextMenu:se,onMouseDown:le});return m.useEffect(()=>{if(!E)return;const _=M.reference.current;let U=null;if(_ instanceof Element?U=_:k.current instanceof Element&&(U=k.current),!U)return;const de=new IntersectionObserver(([ne])=>{ne.isIntersecting||P(!1)},{root:null,threshold:0});return de.observe(U),()=>de.disconnect()},[E,M.reference,P]),s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:M.setReference,className:ee(ro,d&&"!cursor-not-allowed opacity-75",y),"aria-haspopup":"menu","aria-expanded":E,"aria-controls":O,...ve,children:e}),E&&s.jsx(B.FloatingPortal,{children:s.jsx(B.FloatingFocusManager,{context:W,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsxs("div",{id:O,ref:M.setFloating,style:H,className:ee(so,!L&&"w-max",C),...q(),children:[g&&s.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:s.jsx(yn,{ariaLabel:"Close dropdown",onClose:_=>{x?.(_),P(!1)}})}),me]})})})]})};var Ge=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(Ge||{}),ot=(e=>(e.Error="error",e.Warning="warning",e))(ot||{}),Ue=(e=>(e.Default="default",e.Inline="inline",e))(Ue||{}),Gt=(e=>(e.Mobile="mobile",e.Tablet="tablet",e))(Gt||{});const gt=({tab:e,active:t,invalid:r,className:n,horizontal:a,view:o=Ue.Default,onClick:i})=>{const l=o===Ue.Inline,d=f.mergeClasses("rounded h-[38px] items-center flex flex-row border-transparent cursor-pointer dial-small-text hover:text-accent-primary",{"border-b-2 px-4":a,"border-l-2 px-3":!a},{"bg-layer-4":a,"bg-layer-1 text-secondary pointer-events-none":e.disabled,"bg-accent-primary-alpha text-primary":t&&!e.disabled,"text-primary":!t&&!e.disabled,"border-b-accent-primary":t&&a&&!e.disabled,"border-l-accent-primary":t&&!a&&!e.disabled}),u=f.mergeClasses("flex flex-row gap-1 h-6 items-center py-1 px-2 rounded cursor-pointer hover:bg-accent-primary-alpha",t?"dial-small-semi-text":"dial-small-text",{"text-secondary pointer-events-none":e.disabled,"bg-accent-primary-alpha text-primary":t&&!e.disabled,"text-secondary":!t&&!e.disabled}),h=f.mergeClasses(l?u:d,n);return s.jsxs("button",{role:"tab","aria-selected":t,className:h,onClick:()=>i(e.id),disabled:e.disabled,children:[l&&t&&!e.disabled&&s.jsx(F.IconCheck,{size:f.DIAL_ICON_SIZE.SM}),s.jsx(Qt,{text:e.label,contentClassName:"max-w-[200px]",className:"max-w-[200px]"}),(r||e.invalid)&&s.jsx("div",{className:"text-error pl-1",children:s.jsx(F.IconExclamationCircle,{...f.BASE_ICON_PROPS})}),e.warning&&s.jsx("div",{className:"text-warning pl-1",children:s.jsx(F.IconAlertTriangle,{...f.BASE_ICON_PROPS})})]})},mo=()=>{const[e,t]=m.useState(()=>typeof window>"u"?c.ScreenType.Desktop:c.getScreenType());return m.useEffect(()=>{t(c.getScreenType());const r=()=>t(c.getScreenType());return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),e},go=12,xo=({tabs:e,activeTab:t,onClick:r,className:n,orientation:a=Ge.Horizontal,view:o=Ue.Default,screenThreshold:i=Gt.Tablet,smallScreenContainerClassName:l,smallScreenDropdownItemClassName:d,desktopDropdownClassName:u,desktopTabClassName:h,inlineContainerClassName:p,inlineTabClassName:g})=>{const[x,y]=m.useState(!1),[v,b]=m.useState(!1),[C,I]=m.useState(!1),S=mo(),w=S===c.ScreenType.Mobile||i===Gt.Tablet&&S===c.ScreenType.Tablet,N=a===Ge.Horizontal,L=m.useRef(null),A=m.useRef(null),T=m.useRef(null),j=e.find(O=>O.id===t),D=m.useMemo(()=>f.mergeClasses("flex gap-2",N?"flex-row flex-nowrap overflow-x-auto":"flex-col flex-wrap w-full"),[N]),E=m.useCallback(()=>{const O=A.current;O&&I(O.scrollWidth>O.clientWidth)},[]),k=m.useCallback(()=>{const O=T.current,R=A.current;if(!O||!R)return;const M=O.getBoundingClientRect(),H=R.getBoundingClientRect();if(M.width===0||H.width===0)return;const W=go;let K=R.scrollLeft;if(M.left<H.left+W)K-=H.left+W-M.left;else if(M.right>H.right-W)K+=M.right-(H.right-W);else return;const V=Math.max(0,R.scrollWidth-R.clientWidth);K=Math.max(0,Math.min(K,V)),K!==R.scrollLeft&&R.scrollTo({left:K,behavior:"smooth"})},[]),P=m.useCallback(O=>{r(O),O===t&&k()},[r,t,k]);return m.useEffect(()=>{E();const O=new ResizeObserver(()=>E()),R=A.current;return R&&O.observe(R),()=>O.disconnect()},[e,E]),m.useEffect(()=>{k()},[t,k]),o===Ue.Inline?s.jsx("div",{role:"tablist",className:f.mergeClasses("flex flex-row items-center gap-0.5 bg-layer-4 rounded w-fit p-0.5",p),children:e.map(O=>s.jsx(gt,{tab:O,active:t===O.id,view:Ue.Inline,onClick:P,className:g},O.id))}):w?s.jsx("div",{role:"tablist",className:f.mergeClasses("h-11 flex items-center bg-layer-3 px-4",l),children:s.jsx(Wt,{trigger:[c.DropdownTrigger.Click],open:x,onOpenChange:y,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],renderOverlay:()=>e.map(O=>s.jsx(gt,{tab:O,active:O.id===t,onClick:R=>{P(R),y(!1)},className:f.mergeClasses("w-full rounded-none h-11 items-center px-6",d)},O.id)),children:s.jsxs("div",{className:"flex gap-2 items-center h-11 cursor-pointer",children:[s.jsx(gt,{tab:j,active:!0,onClick:P,className:"rounded-none bg-transparent border-l-0 border-b-0 h-full items-center px-0"},t),s.jsx(c.DialIcon,{icon:s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.SM}),className:f.mergeClasses("text-primary transition-transform",x&&"rotate-180")})]})})}):s.jsxs("div",{ref:L,className:f.mergeClasses("flex items-center",n),children:[s.jsx("div",{ref:A,role:"tablist",className:D,children:e.map(O=>s.jsx("div",{ref:t===O.id?T:void 0,className:"w-full",children:s.jsx(gt,{tab:O,active:t===O.id,onClick:P,horizontal:N,className:f.mergeClasses("w-full",h)})},O.id))}),C&&s.jsx("div",{className:"flex items-center ml-2",children:s.jsx(Wt,{trigger:[c.DropdownTrigger.Click],open:v,onOpenChange:b,placement:"bottom-end",renderOverlay:()=>e.map(O=>s.jsx(gt,{tab:O,active:O.id===t,onClick:R=>{P(R),b(!1)},className:"w-full rounded-none h-8 items-center px-3 py-2"},O.id)),children:s.jsx(Tt,{iconBefore:s.jsx(F.IconDotsVertical,{size:f.BASE_ICON_SIZE}),className:f.mergeClasses("w-8 h-8 flex items-center justify-center rounded border",v?"bg-layer-4 border-transparent":"border-primary",u)})})})]})},Cn="w-full overflow-hidden",In="flex flex-nowrap items-center gap-2 min-w-0 px-0 py-0 whitespace-nowrap",Ut="flex items-center gap-2 dial-small-text",pr={first:"shrink-0",middle:"shrink min-w-0 max-w-[30%]",last:"shrink min-w-0 max-w-[51%]"},Tr="flex flex-1 items-center gap-1 min-w-0 transition-colors",bo="text-secondary hover:text-accent-primary",Sn="text-primary cursor-default",Hr="flex-none inline-flex items-center leading-none text-secondary",vo="items-center gap-1 min-w-0 transition-colors text-secondary hover:text-accent-primary",Nn=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,"aria-hidden":"true"}),xt=({label:e,href:t,onClick:r,disabled:n,isLast:a,isFirst:o,separator:i=Nn,className:l,iconBefore:d,labelClassName:u,onBeforeNavigate:h,...p})=>{const g=async I=>{if(h&&!a&&!await h()){I.preventDefault();return}r&&r(I)},x=a?pr.last:o?pr.first:pr.middle,y=f.mergeClasses(Ut,x,l),v=(!!t||!!r)&&!a&&!n,b=v?f.mergeClasses(Tr,bo):f.mergeClasses(Tr,Sn,n?"pointer-events-none opacity-75":""),C=typeof e=="string"?s.jsx(Qt,{className:f.mergeClasses("cursor-pointer",u),text:e,id:"breadcrumb-item-content"}):s.jsx("span",{className:f.mergeClasses("flex-1 min-w-0 truncate cursor-pointer max-w-[300px]",u),"aria-label":"breadcrumb-item-content",children:e});return s.jsxs("li",{...p,className:y,"aria-label":p["aria-label"]||"breadcrumb-item",children:[v?s.jsxs("a",{href:t,onClick:g,className:b,children:[d,C]}):s.jsxs("span",{className:b,"aria-current":a?"page":void 0,"aria-disabled":n?"true":void 0,children:[d,C]}),!a&&s.jsx("span",{className:Hr,"aria-label":"separator",children:i})]})},yo=({pathItems:e,separator:t=Nn,ariaLabel:r="Breadcrumb",className:n,children:a,labelClassName:o,onBeforeNavigate:i})=>{const l=m.useMemo(()=>e?.length?e:m.Children.toArray(a).filter(m.isValidElement).map(h=>{const p=h.props,{labelClassName:g,isLast:x,separator:y,...v}=p;return v}),[e,a]),d=m.useCallback(async h=>{const p=parseInt(h.key,10),g=l[p];if(i&&!await i()){h.domEvent.preventDefault();return}g.onClick?g.onClick(h.domEvent):g.href&&(window.location.href=g.href)},[l,i]),u=m.useMemo(()=>{if(l.length===0)return null;if(l.length<=3)return l.map((v,b)=>m.createElement(xt,{...v,key:`item-${b}`,isFirst:b===0&&l.length>1,isLast:b===l.length-1,separator:t,labelClassName:o,onBeforeNavigate:i}));const h=l.at(0),p=l.slice(1,-2),g=l.at(-2),x=l.at(-1);if(!h||!g||!x)return null;const y=p.map((v,b)=>({key:String(b+1),label:typeof v.label=="string"?v.label:`Item ${b+1}`,disabled:v.disabled}));return s.jsxs(s.Fragment,{children:[m.createElement(xt,{...h,key:"item-0",isFirst:!0,separator:t,labelClassName:o,onBeforeNavigate:i}),s.jsxs("li",{className:f.mergeClasses(Ut,"shrink-0"),children:[s.jsx(Wt,{items:y,onItemClick:d,placement:"bottom-start",matchReferenceWidth:!1,children:s.jsx("button",{type:"button","aria-label":"More breadcrumbs",className:vo,children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM})})}),s.jsx("span",{className:Hr,children:t})]}),m.createElement(xt,{...g,key:`item-${l.length-2}`,separator:t,labelClassName:o,onBeforeNavigate:i}),m.createElement(xt,{...x,key:`item-${l.length-1}`,isLast:!0,separator:t,labelClassName:o,onBeforeNavigate:i})]})},[l,t,o,d,i]);return s.jsx("nav",{"aria-label":r,className:f.mergeClasses(Cn,n),children:s.jsx("ol",{className:In,children:u})})},$r=(e,t)=>({appearance:n,...a})=>s.jsx(Tt,{...a,variant:e,appearance:n||t}),wn=(e,t)=>({variant:n,...a})=>s.jsx(Tt,{...a,variant:n||t,appearance:e}),Kr=$r(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),jn=$r(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),Dn=$r(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),Co=wn(c.ButtonAppearance.Link,c.ButtonVariant.Primary),Io=wn(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Tn=({iconClassName:e,label:t,...r})=>t?s.jsx(Dn,{...r,label:t,appearance:c.ButtonAppearance.Ghost,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}):s.jsx(bn,{...r,appearance:c.ButtonAppearance.Ghost,icon:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}),So="bg-layer-4 flex items-center justify-center enabled:text-secondary enabled:hover:text-accent-primary enabled:active:bg-controls-accent-primary-alpha-active enabled:hover:bg-accent-primary-alpha enabled:active:text-accent-primary",No=({icon:e,onClick:t,disabled:r,size:n=c.ElementSize.Standard,className:a})=>s.jsx("div",{className:ee("border-l border-tertiary",n===c.ElementSize.Standard?"h-[40px] w-[44px]":"h-[24px] w-[32px]"),children:s.jsx(Dt,{className:ee(So,n===c.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:n})}),wo=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],jo=(e,t,r,n)=>{if((t==="number"||r!==void 0||n!==void 0)&&!wo.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||n!==void 0){const o=e.currentTarget.value,i=e.currentTarget.selectionStart||0,l=o.slice(0,i)+e.key+o.slice(i),d=parseFloat(l);if(!isNaN(d)){if(r!==void 0&&d<+r){e.preventDefault();return}if(n!==void 0&&d>+n){e.preventDefault();return}}}}},En=({labelProps:e,error:t,caption:r,id:n,containerClassName:a,...o})=>s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",a),children:[e&&s.jsx(Fr,{...e,htmlFor:n}),s.jsx(Ln,{id:n,...o}),s.jsx(Fe,{text:t}),!t&&s.jsx(Mr,{text:r})]}),Ln=({invalid:e,disabled:t,prefix:r,className:n,postfix:a,iconBefore:o,iconAfter:i,wrapperClassName:l,type:d,inputRef:u,value:h,tooltipText:p,min:g,onChange:x,max:y,inputButtonProps:v,...b})=>{const C=m.useRef(null),I=B.useMergeRefs([u,C]),S=d==="number"||g!==void 0||y!==void 0;m.useEffect(()=>{const A=C.current;if(!A||!S||t)return;const T=j=>{j.preventDefault()};return A.addEventListener("wheel",T,{passive:!1}),()=>{A.removeEventListener("wheel",T)}},[t,S,d]);const w=A=>{jo(A,d,g,y)},N=A=>{const T=A.currentTarget.value;if(S&&T!==""){const j=parseFloat(T);if(isNaN(j)&&T!=="-"&&T!=="."||!isNaN(j)&&(g!==void 0&&j<+g||y!==void 0&&j>+y))return}x?.(T||void 0)},L=()=>s.jsxs("div",{className:f.mergeClasses("dial-input flex flex-row items-center gap-x-2 justify-between py-2",e&&"dial-input-error",t&&"dial-input-disable",!r&&"pl-3",!v&&"pr-3",l),"aria-label":"input-container",children:[r&&s.jsx("div",{className:"border-r border-tertiary",children:s.jsx(Ln,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,id:`${r}_textBefore`})}),s.jsx(c.DialIcon,{icon:o}),s.jsx("input",{ref:I,type:d,autoComplete:d==="password"?"new-password":"off",value:h??"",className:f.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",n),onChange:N,onKeyDown:w,min:g,disabled:t,max:y,...b}),a&&s.jsxs("p",{className:"text-secondary dial-small-text",children:[" ",a]}),s.jsx(c.DialIcon,{icon:i}),v&&s.jsx(No,{...v,disabled:t})]});return t&&d!=="password"?s.jsx(qe,{tooltip:p||h,children:L()}):L()},An=m.createContext({dragDropManager:void 0});function ye(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 ms=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),gs=function(){return Math.random().toString(36).substring(7).split("").join(".")},xs={INIT:"@@redux/INIT"+gs(),REPLACE:"@@redux/REPLACE"+gs()};function Do(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 To(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(Ao(e))return"date";if(Lo(e))return"error";var r=Eo(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 Eo(e){return typeof e.constructor=="function"?e.constructor.name:null}function Lo(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Ao(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Je(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=To(e)),t}function On(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?ye(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"?ye(1):"Expected the enhancer to be a function. Instead, received: '"+Je(r)+"'");return r(On)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?ye(2):"Expected the root reducer to be a function. Instead, received: '"+Je(e)+"'");var a=e,o=t,i=[],l=i,d=!1;function u(){l===i&&(l=i.slice())}function h(){if(d)throw new Error(process.env.NODE_ENV==="production"?ye(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(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ye(4):"Expected the listener to be a function. Instead, received: '"+Je(v)+"'");if(d)throw new Error(process.env.NODE_ENV==="production"?ye(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 b=!0;return u(),l.push(v),function(){if(b){if(d)throw new Error(process.env.NODE_ENV==="production"?ye(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.");b=!1,u();var I=l.indexOf(v);l.splice(I,1),i=null}}}function g(v){if(!Do(v))throw new Error(process.env.NODE_ENV==="production"?ye(7):"Actions must be plain objects. Instead, the actual type was: '"+Je(v)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?ye(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(d)throw new Error(process.env.NODE_ENV==="production"?ye(9):"Reducers may not dispatch actions.");try{d=!0,o=a(o,v)}finally{d=!1}for(var b=i=l,C=0;C<b.length;C++){var I=b[C];I()}return v}function x(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ye(10):"Expected the nextReducer to be a function. Instead, received: '"+Je(v));a=v,g({type:xs.REPLACE})}function y(){var v,b=p;return v={subscribe:function(I){if(typeof I!="object"||I===null)throw new Error(process.env.NODE_ENV==="production"?ye(11):"Expected the observer to be an object. Instead, received: '"+Je(I)+"'");function S(){I.next&&I.next(h())}S();var w=b(S);return{unsubscribe:w}}},v[ms]=function(){return this},v}return g({type:xs.INIT}),n={dispatch:g,subscribe:p,getState:h,replaceReducer:x},n[ms]=y,n}function Z(e,t,...r){if(Oo()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let n;if(t===void 0)n=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;n=new Error(t.replace(/%s/g,function(){return r[a++]})),n.name="Invariant Violation"}throw n.framesToPop=1,n}}function Oo(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function _o(e,t,r){return t.split(".").reduce((n,a)=>n&&n[a]?n[a]:r||null,e)}function ko(e,t){return e.filter(r=>r!==t)}function _n(e){return typeof e=="object"}function Ro(e,t){const r=new Map,n=o=>{r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(n),t.forEach(n);const a=[];return r.forEach((o,i)=>{o===1&&a.push(i)}),a}function Mo(e,t){return e.filter(r=>t.indexOf(r)>-1)}const Vr="dnd-core/INIT_COORDS",Jt="dnd-core/BEGIN_DRAG",Wr="dnd-core/PUBLISH_DRAG_SOURCE",er="dnd-core/HOVER",tr="dnd-core/DROP",rr="dnd-core/END_DRAG";function bs(e,t){return{type:Vr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Po={type:Vr,payload:{clientOffset:null,sourceClientOffset:null}};function Bo(e){return function(r=[],n={publishSource:!0}){const{publishSource:a=!0,clientOffset:o,getSourceClientOffset:i}=n,l=e.getMonitor(),d=e.getRegistry();e.dispatch(bs(o)),zo(r,l,d);const u=$o(r,l);if(u==null){e.dispatch(Po);return}let h=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");Fo(i),h=i(u)}e.dispatch(bs(o,h));const g=d.getSource(u).beginDrag(l,u);if(g==null)return;Ho(g),d.pinSource(u);const x=d.getSourceType(u);return{type:Jt,payload:{itemType:x,item:g,sourceId:u,clientOffset:o||null,sourceClientOffset:h||null,isSourcePublic:!!a}}}}function zo(e,t,r){Z(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){Z(r.getSource(n),"Expected sourceIds to be registered.")})}function Fo(e){Z(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Ho(e){Z(_n(e),"Item must be an object.")}function $o(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function Ko(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Ko(e,a,r[a])})}return e}function Wo(e){return function(r={}){const n=e.getMonitor(),a=e.getRegistry();Go(n),qo(n).forEach((i,l)=>{const d=Uo(i,l,a,n),u={type:tr,payload:{dropResult:Vo({},r,d)}};e.dispatch(u)})}}function Go(e){Z(e.isDragging(),"Cannot call drop while not dragging."),Z(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function Uo(e,t,r,n){const a=r.getTarget(e);let o=a?a.drop(n,e):void 0;return Zo(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function Zo(e){Z(typeof e>"u"||_n(e),"Drop result must either be an object or undefined.")}function qo(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Yo(e){return function(){const r=e.getMonitor(),n=e.getRegistry();Xo(r);const a=r.getSourceId();return a!=null&&(n.getSource(a,!0).endDrag(r,a),n.unpinSource()),{type:rr}}}function Xo(e){Z(e.isDragging(),"Cannot call endDrag while not dragging.")}function Er(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Qo(e){return function(r,{clientOffset:n}={}){Jo(r);const a=r.slice(0),o=e.getMonitor(),i=e.getRegistry(),l=o.getItemType();return ti(a,i,l),ei(a,o,i),ri(a,o,i),{type:er,payload:{targetIds:a,clientOffset:n||null}}}}function Jo(e){Z(Array.isArray(e),"Expected targetIds to be an array.")}function ei(e,t,r){Z(t.isDragging(),"Cannot call hover while not dragging."),Z(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n<e.length;n++){const a=e[n];Z(e.lastIndexOf(a)===n,"Expected targetIds to be unique in the passed array.");const o=r.getTarget(a);Z(o,"Expected targetIds to be registered.")}}function ti(e,t,r){for(let n=e.length-1;n>=0;n--){const a=e[n],o=t.getTargetType(a);Er(o,r)||e.splice(n,1)}}function ri(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function si(e){return function(){if(e.getMonitor().isDragging())return{type:Wr}}}function ni(e){return{beginDrag:Bo(e),publishDragSource:si(e),hover:Qo(e),drop:Wo(e),endDrag:Yo(e)}}class ai{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 n(o){return(...i)=>{const l=o.apply(t,i);typeof l<"u"&&r(l)}}const a=ni(this);return Object.keys(a).reduce((o,i)=>{const l=a[i];return o[i]=n(l),o},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const n=this.store.getState().refCount>0;this.backend&&(n&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!n&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function oi(e,t){return{x:e.x+t.x,y:e.y+t.y}}function kn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ii(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:kn(oi(t,n),r)}function li(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:kn(t,r)}const vt=[],Gr=[];vt.__IS_NONE__=!0;Gr.__IS_ALL__=!0;function ci(e,t){return e===vt?!1:e===Gr||typeof t>"u"?!0:Mo(t,e).length>0}class di{subscribeToStateChange(t,r={}){const{handlerIds:n}=r;Z(typeof t=="function","listener must be a function."),Z(typeof n>"u"||Array.isArray(n),"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&&!ci(i.dirtyHandlerIds,n)||t()}finally{a=l}};return this.store.subscribe(o)}subscribeToOffsetChange(t){Z(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const n=()=>{const a=this.store.getState().dragOffset;a!==r&&(r=a,t())};return this.store.subscribe(n)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return Z(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(Z(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const n=this.registry.getTargetType(t),a=this.getItemType();return Er(n,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Z(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const n=this.registry.getSourceType(t),a=this.getItemType();return n!==a?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:n}=r;if(!this.isDragging())return!1;const a=this.registry.getTargetType(t),o=this.getItemType();if(o&&!Er(a,o))return!1;const i=this.getTargetIds();if(!i.length)return!1;const l=i.indexOf(t);return n?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 ii(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return li(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const vs=typeof global<"u"?global:self,Rn=vs.MutationObserver||vs.WebKitMutationObserver;function Mn(e){return function(){const r=setTimeout(a,0),n=setInterval(a,50);function a(){clearTimeout(r),clearInterval(n),e()}}}function ui(e){let t=1;const r=new Rn(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const fi=typeof Rn=="function"?ui:Mn;class pi{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),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 n=0,a=t.length-this.index;n<a;n++)t[n]=t[n+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=fi(this.flush),this.requestErrorThrow=Mn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class hi{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 mi{create(t){const r=this.freeTasks,n=r.length?r.pop():new hi(this.onError,a=>r[r.length]=a);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const Pn=new pi,gi=new mi(Pn.registerPendingError);function xi(e){Pn.enqueueTask(gi.create(e))}const Ur="dnd-core/ADD_SOURCE",Zr="dnd-core/ADD_TARGET",qr="dnd-core/REMOVE_SOURCE",sr="dnd-core/REMOVE_TARGET";function bi(e){return{type:Ur,payload:{sourceId:e}}}function vi(e){return{type:Zr,payload:{targetId:e}}}function yi(e){return{type:qr,payload:{sourceId:e}}}function Ci(e){return{type:sr,payload:{targetId:e}}}function Ii(e){Z(typeof e.canDrag=="function","Expected canDrag to be a function."),Z(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Z(typeof e.endDrag=="function","Expected endDrag to be a function.")}function Si(e){Z(typeof e.canDrop=="function","Expected canDrop to be a function."),Z(typeof e.hover=="function","Expected hover to be a function."),Z(typeof e.drop=="function","Expected beginDrag to be a function.")}function Lr(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Lr(r,!1));return}Z(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 Ie;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ie||(Ie={}));let Ni=0;function wi(){return Ni++}function ji(e){const t=wi().toString();switch(e){case Ie.SOURCE:return`S${t}`;case Ie.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function ys(e){switch(e[0]){case"S":return Ie.SOURCE;case"T":return Ie.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Cs(e,t){const r=e.entries();let n=!1;do{const{done:a,value:[,o]}=r.next();if(o===t)return!0;n=!!a}while(!n);return!1}class Di{addSource(t,r){Lr(t),Ii(r);const n=this.addHandler(Ie.SOURCE,t,r);return this.store.dispatch(bi(n)),n}addTarget(t,r){Lr(t,!0),Si(r);const n=this.addHandler(Ie.TARGET,t,r);return this.store.dispatch(vi(n)),n}containsHandler(t){return Cs(this.dragSources,t)||Cs(this.dropTargets,t)}getSource(t,r=!1){return Z(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Z(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Z(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Z(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return ys(t)===Ie.SOURCE}isTargetId(t){return ys(t)===Ie.TARGET}removeSource(t){Z(this.getSource(t),"Expected an existing source."),this.store.dispatch(yi(t)),xi(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Z(this.getTarget(t),"Expected an existing target."),this.store.dispatch(Ci(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Z(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Z(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,n){const a=ji(t);return this.types.set(a,r),t===Ie.SOURCE?this.dragSources.set(a,n):t===Ie.TARGET&&this.dropTargets.set(a,n),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 Ti=(e,t)=>e===t;function Ei(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Li(e,t,r=Ti){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function Ai(e=vt,t){switch(t.type){case er:break;case Ur:case Zr:case sr:case qr:return vt;case Jt:case Wr:case rr:case tr:default:return Gr}const{targetIds:r=[],prevTargetIds:n=[]}=t.payload,a=Ro(r,n);if(!(a.length>0||!Li(r,n)))return vt;const i=n[n.length-1],l=r[r.length-1];return i!==l&&(i&&a.push(i),l&&a.push(l)),a}function Oi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _i(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Oi(e,a,r[a])})}return e}const Is={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function ki(e=Is,t){const{payload:r}=t;switch(t.type){case Vr:case Jt:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case er:return Ei(e.clientOffset,r.clientOffset)?e:_i({},e,{clientOffset:r.clientOffset});case rr:case tr:return Is;default:return e}}function Ri(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function et(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Ri(e,a,r[a])})}return e}const Mi={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Pi(e=Mi,t){const{payload:r}=t;switch(t.type){case Jt:return et({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Wr:return et({},e,{isSourcePublic:!0});case er:return et({},e,{targetIds:r.targetIds});case sr:return e.targetIds.indexOf(r.targetId)===-1?e:et({},e,{targetIds:ko(e.targetIds,r.targetId)});case tr:return et({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case rr:return et({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Bi(e=0,t){switch(t.type){case Ur:case Zr:return e+1;case qr:case sr:return e-1;default:return e}}function zi(e=0){return e+1}function Fi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Fi(e,a,r[a])})}return e}function $i(e={},t){return{dirtyHandlerIds:Ai(e.dirtyHandlerIds,{type:t.type,payload:Hi({},t.payload,{prevTargetIds:_o(e,"dragOperation.targetIds",[])})}),dragOffset:ki(e.dragOffset,t),refCount:Bi(e.refCount,t),dragOperation:Pi(e.dragOperation,t),stateId:zi(e.stateId)}}function Ki(e,t=void 0,r={},n=!1){const a=Vi(n),o=new di(a,new Di(a)),i=new ai(a,o),l=e(i,t,r);return i.receiveBackend(l),i}function Vi(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return On($i,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Wi(e,t){if(e==null)return{};var r=Gi(e,t),n,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Gi(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,o;for(o=0;o<n.length;o++)a=n[o],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}let Ss=0;const $t=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Ui=m.memo(function(t){var{children:r}=t,n=Wi(t,["children"]);const[a,o]=Zi(n);return m.useEffect(()=>{if(o){const i=Bn();return++Ss,()=>{--Ss===0&&(i[$t]=null)}}},[]),s.jsx(An.Provider,{value:a,children:r})});function Zi(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=qi(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function qi(e,t=Bn(),r,n){const a=t;return a[$t]||(a[$t]={dragDropManager:Ki(e,t,r,n)}),a[$t]}function Bn(){return typeof global<"u"?global:window}function Yi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hr,Ns;function Xi(){return Ns||(Ns=1,hr=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 n,a,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(a=n;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),n=o.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[a]))return!1;for(a=n;a--!==0;){var i=o[a];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}),hr}var Qi=Xi();const Ji=Yi(Qi),nr=typeof window<"u"?m.useLayoutEffect:m.useEffect;function el(e,t,r){const[n,a]=m.useState(()=>t(e)),o=m.useCallback(()=>{const i=t(e);Ji(n,i)||(a(i),r&&r())},[n,e,r]);return nr(o),[n,o]}function tl(e,t,r){const[n,a]=el(e,t,r);return nr(function(){const i=e.getHandlerId();if(i!=null)return e.subscribeToStateChange(a,{handlerIds:[i]})},[e,a]),n}function rl(e,t,r){return tl(t,e||(()=>({})),()=>r.reconnect())}function sl(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),m.useMemo(()=>typeof e=="function"?e():e,r)}let mr=!1;class nl{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Z(!mr,"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 mr=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{mr=!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 al(e,t,r){const n=r.getRegistry(),a=n.addTarget(e,t);return[a,()=>n.removeTarget(a)]}function ol(e,t,r,n){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 d=0;d<o.length;d++){const u=o[d];if(!l(u))return!1;const h=e[u],p=t[u];if(a=void 0,a===!1||a===void 0&&h!==p)return!1}return!0}function il(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ll(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 cl(e){return(t=null,r=null)=>{if(!m.isValidElement(t)){const o=t;return e(o,r),o}const n=t;return ll(n),ul(n,r?o=>e(o,r):e)}}function dl(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=cl(n);t[r]=()=>a}}),t}function ws(e,t){typeof e=="function"?e(t):e.current=t}function ul(e,t){const r=e.ref;return Z(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?m.cloneElement(e,{ref:n=>{ws(r,n),ws(t,n)}}):m.cloneElement(e,{ref:t})}class fl{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!ol(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=dl({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,il(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 Yr(){const{dragDropManager:e}=m.useContext(An);return Z(e!=null,"Expected drag drop context"),e}function pl(e){return m.useMemo(()=>e.hooks.dropTarget(),[e])}function hl(e){const t=Yr(),r=m.useMemo(()=>new fl(t.getBackend()),[t]);return nr(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function ml(){const e=Yr();return m.useMemo(()=>new nl(e),[e])}function gl(e){const{accept:t}=e;return m.useMemo(()=>(Z(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class xl{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 bl(e,t){const r=m.useMemo(()=>new xl(e,t),[t]);return m.useEffect(()=>{r.spec=e},[e]),r}function vl(e,t,r){const n=Yr(),a=bl(e,t),o=gl(e);nr(function(){const[l,d]=al(o,a,n);return t.receiveHandlerId(l),r.receiveHandlerId(l),d},[n,t,a,r,o.map(i=>i.toString()).join("|")])}function zn(e,t){const r=sl(e,t),n=ml(),a=hl(r.options);return vl(r,n,a),[rl(r.collect,n,a),pl(a)]}function Fn(e){let t=null;return()=>(t==null&&(t=e()),t)}function yl(e,t){return e.filter(r=>r!==t)}function Cl(e,t){const r=new Set,n=o=>r.add(o);e.forEach(n),t.forEach(n);const a=[];return r.forEach(o=>a.push(o)),a}class Il{enter(t){const r=this.entered.length,n=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=Cl(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=yl(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Sl{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(n=>{const a=this.config.exposeProperties[n];a!=null&&(r[n]={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 ar="__NATIVE_FILE__",Hn="__NATIVE_URL__",$n="__NATIVE_TEXT__",Kn="__NATIVE_HTML__",js=Object.freeze(Object.defineProperty({__proto__:null,FILE:ar,HTML:Kn,TEXT:$n,URL:Hn},Symbol.toStringTag,{value:"Module"}));function gr(e,t,r){const n=t.reduce((a,o)=>a||e.getData(o),"");return n??r}const Ar={[ar]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[Kn]:{exposeProperties:{html:(e,t)=>gr(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Hn]:{exposeProperties:{urls:(e,t)=>gr(e,t,"").split(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),f=require("./icon-D93YIwGJ.cjs"),c=require("./DateCellRenderer-CPl27YD9.cjs"),F=require("@tabler/icons-react"),B=require("@floating-ui/react"),m=require("react"),ee=require("classnames"),fn=require("./editors.cjs"),za=require("react-dom");function Fa(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Me=Fa(m),Mr=({text:e,className:t,variant:r=c.CaptionType.Description,...n})=>e?s.jsx("span",{...n,role:"alert",className:f.mergeClasses("dial-tiny-text",r===c.CaptionType.Error?"text-error":"text-secondary",t),children:e}):null,Fe=({...e})=>s.jsx(Mr,{...e,variant:c.CaptionType.Error}),hs={[c.ButtonVariant.Primary]:{[c.ButtonAppearance.Solid]:"dial-primary-solid-button",[c.ButtonAppearance.Ghost]:"dial-primary-ghost-button",[c.ButtonAppearance.Link]:"dial-primary-link-button"},[c.ButtonVariant.Neutral]:{[c.ButtonAppearance.Outlined]:"dial-neutral-outlined-button"},[c.ButtonVariant.Danger]:{[c.ButtonAppearance.Solid]:"dial-danger-solid-button",[c.ButtonAppearance.Ghost]:"dial-danger-ghost-button",[c.ButtonAppearance.Outlined]:"dial-danger-outlined-button"},[c.ButtonVariant.Success]:{[c.ButtonAppearance.Ghost]:"dial-success-ghost-button"},[c.ButtonVariant.Secondary]:{[c.ButtonAppearance.Ghost]:"dial-secondary-ghost-button"},[c.ButtonVariant.Tertiary]:{[c.ButtonAppearance.Ghost]:"dial-tertiary-ghost-button"},[c.ButtonVariant.Static]:{},[c.ButtonVariant.Starter]:{}},pn=(e=c.ButtonVariant.Primary,t=c.ButtonAppearance.Solid)=>{const r=hs[e]?.[t];return r||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${t}. Using default primary solid button styles.`),hs[c.ButtonVariant.Primary][c.ButtonAppearance.Solid])},Ha=7,$a=2,hn=m.createContext(null),mn=()=>{const e=m.useContext(hn);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},Ka=({initialOpen:e=!1,placement:t="bottom",isTriggerClickable:r=!1,open:n,onOpenChange:a}={})=>{const[o,i]=m.useState(e),l=m.useRef(null),d=n??o,u=a??i,h=B.useFloating({placement:t,open:d,onOpenChange:u,whileElementsMounted:B.autoUpdate,middleware:[B.offset(Ha+$a),B.flip({crossAxis:t.includes("-"),fallbackAxisSideDirection:"start",padding:5}),B.shift({padding:5}),B.arrow({element:l})]}),p=B.useHover(h.context,{move:!1,enabled:n==null,mouseOnly:r,delay:{open:500,close:0}}),g=B.useFocus(h.context,{enabled:n==null}),x=B.useDismiss(h.context),y=B.useRole(h.context,{role:"tooltip"}),v=B.useInteractions([p,g,x,y]);return m.useEffect(()=>{if(!d)return;const b=h.refs.reference.current;if(!(b instanceof Element))return;const C=new IntersectionObserver(([I])=>{I.isIntersecting||u(!1)},{root:null,threshold:0});return C.observe(b),()=>C.disconnect()},[d,h.refs.reference,u]),m.useMemo(()=>({open:d,setOpen:u,arrowRef:l,...v,...h}),[d,u,v,h])},Pr=({children:e,...t})=>{const r=Ka(t);return s.jsx(hn.Provider,{value:r,children:e})},Br=({style:e,...t})=>{const r=mn(),n=c.useHasHover(),a=m.useRef(null),o=B.useMergeRefs([r.refs.setFloating,a]);return!r.open||!n?null:s.jsx(B.FloatingPortal,{id:"tooltip-portal",children:s.jsxs("div",{ref:o,style:{...r.floatingStyles,...e},...r.getFloatingProps(t),className:ee("z-tooltip whitespace-pre-wrap break-words rounded border border-primary bg-layer-0 px-2 py-1 dial-tiny-text shadow max-w-[300px]",r.getFloatingProps(t).className),children:[t.children,s.jsx(B.FloatingArrow,{ref:r.arrowRef,context:r.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary text-[var(--bg-layer-0,_#000000)]"})]})})},zr=({children:e,asChild:t=!1,...r})=>{const n=mn(),a=t&&m.isValidElement(e),o=a?e.props?.ref:null,i=B.useMergeRefs([n.refs.setReference,...o?[o]:[]]);return a?m.cloneElement(e,n.getReferenceProps({...e.props,...r,ref:i})):s.jsx("span",{ref:i,...n.getReferenceProps(r),className:r.className??"dial-tooltip-trigger text-start",children:e})},qe=({hideTooltip:e,tooltip:t,children:r,triggerClassName:n,contentClassName:a,...o})=>s.jsxs(Pr,{...o,children:[s.jsx(zr,{className:ee(n,"truncate"),children:r}),s.jsx(Br,{className:ee("text-primary",a,"max-w-[300px]",(e||!t)&&"hidden"),children:t})]}),Dt=({variant:e,appearance:t=c.ButtonAppearance.Solid,size:r=c.ElementSize.Standard,className:n,icon:a,tooltipProps:o,type:i="button",...l})=>{const d=f.mergeClasses(e&&pn(e,t),r===c.ElementSize.Small?"h-[24px] w-[24px]":"h-[40px] w-[40px] dial-kit-enhanced-target","dial-icon-button disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",n),u=s.jsx("button",{...l,type:i,className:d,"aria-label":c.resolveAccessibleName(l["aria-label"],o?.tooltip),children:a});return o?s.jsx(qe,{...o,children:u}):u},Va="w-[24px] h-[24px] border border-solid rounded-[6px] border-transparent flex items-center justify-center text-secondary hover:text-controls-accent-primary-hover active:text-controls-accent-primary-active",Wa=({caption:e,onClick:t})=>{if(!e)return null;const r=s.jsx(Dt,{"aria-label":e,className:Va,icon:s.jsx(F.IconInfoCircle,{size:f.DIAL_ICON_SIZE.SM}),onClick:t});return e?s.jsx(qe,{tooltip:e,triggerClassName:"flex justify-center items-center",children:r}):r},Fr=({label:e,required:t,className:r,caption:n,...a})=>e?s.jsxs("label",{...a,className:f.mergeClasses("dial-tiny-text text-secondary flex items-center gap-1",r),children:[typeof e=="string"?s.jsx("span",{className:"min-h-4",children:e}):e,t&&s.jsx("span",{className:"text-accent-primary",children:"*"}),s.jsx(Wa,{caption:n})]}):null,Ga=({title:e,description:t,children:r,expanded:n,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,onToggle:l,className:d,headerClassName:u,contentClassName:h})=>{const p=n!==void 0,[g,x]=m.useState(a),y=i?!0:p?n:g,v=m.useId(),b=()=>{if(o)return;const C=!y;p||x(C),l?.(C)};return s.jsxs("div",{className:f.mergeClasses("rounded border border-secondary",d),children:[s.jsxs("button",{type:"button","aria-expanded":y,"aria-controls":v,disabled:o||i,onClick:b,className:f.mergeClasses("flex w-full items-center gap-2 p-4 text-left",o?"cursor-not-allowed":"cursor-pointer",i&&"cursor-default",u),children:[!i&&s.jsx(c.DialIcon,{className:ee("text-secondary transition-transform",y&&"rotate-90"),icon:s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM})}),s.jsx("span",{className:"dial-body-text text-primary",children:e}),t!=null&&t!==!1&&s.jsx("span",{className:"dial-tiny-text text-secondary",children:t})]}),y&&s.jsx("div",{id:v,role:"region",className:f.mergeClasses("px-4 pb-4",h),children:r})]})},Ua="flex items-center justify-center text-secondary",Za="shrink-0 grow-0 basis-auto animate-spin-steps",qa=e=>Me.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Me.createElement("path",{d:"M24 39V46.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.4,d:"M9 24H1.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.5,d:"M8.0918 8.0918L13.3994 13.3994",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.6,d:"M24 1.5V9",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.7,d:"M39.9121 8.08594L37.2607 10.7373L34.6094 13.3887",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.8,d:"M46.5 24H39",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.9,d:"M34.6055 34.6055L39.9082 39.9082",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.3,d:"M13.3936 34.6055L8.08594 39.9131",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),Ya=({size:e=18,className:t,iconClassName:r,fullWidth:n=!0,ariaLabel:a="Loading"})=>s.jsx("div",{role:"status",className:ee({[Ua]:!0,"size-full":n,[t||""]:!!t}),children:s.jsx(c.DialIcon,{icon:s.jsx(qa,{width:e,height:e,className:ee(Za,r),role:"img","aria-label":a})})}),Ve=({size:e=40,className:t,fullWidth:r=!1,ariaLabel:n="Loading"})=>s.jsx("div",{role:"status",className:f.mergeClasses("flex items-center justify-center",{"size-full":r},t,c.DIAL_KIT_CLASS.spinner),children:s.jsx("div",{role:"img","aria-label":n,style:{width:e,height:e},className:"rounded-full border-2 border-secondary border-t-accent animate-spin-steps shrink-0"})}),gn=({value:e,max:t=100,size:r=c.ElementSize.Standard,labelProps:n,valueLabel:a,id:o,className:i,"aria-label":l,...d})=>{const u=m.useId(),h=o??u,p=!!n?.label,g=p?n?.id??`${h}-label`:void 0,x=t>0?t:0,y=Number.isFinite(e)?e:0,v=Math.min(Math.max(y,0),x),b=x>0?v/x*100:0,C=s.jsx("div",{...d,id:h,role:"progressbar","aria-valuenow":v,"aria-valuemin":0,"aria-valuemax":x,"aria-labelledby":g,"aria-label":c.resolveAccessibleName(l,p?void 0:"Progress"),className:f.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===c.ElementSize.Small?"h-1":"h-2",i,!p&&!a&&c.DIAL_KIT_CLASS.progressBar),children:s.jsx("div",{style:{width:`${b}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!p&&!a?C:s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-1",c.DIAL_KIT_CLASS.progressBar),children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[n&&s.jsx(c.Label,{...n,id:g}),a&&s.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),C]})},Xa=({icon:e,title:t,description:r,containerClassName:n,titleClassName:a,descriptionClassName:o})=>s.jsxs("div",{className:f.mergeClasses("h-full w-full flex flex-col items-center justify-center text-secondary",n),"aria-label":"no-data-container",children:[e||s.jsx(F.IconClipboardX,{width:60,height:60,stroke:.5}),s.jsx("span",{className:f.mergeClasses("dial-small-text mt-2 text-primary",a),"aria-label":"no-results-title",children:t}),r&&s.jsx("span",{className:f.mergeClasses("mt-1 text-primary",o),"aria-label":"no-results-description",children:r})]}),Qa=({label:e,text:t,tooltip:r,children:n,postfix:a,className:o})=>s.jsxs("div",{className:f.mergeClasses("flex flex-col",n?"":"max-w-[200px]",o),children:[e&&s.jsx("label",{className:"dial-tiny-text mb-2 text-secondary",children:e}),n||s.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[s.jsx(qe,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),Tt=({label:e,variant:t,appearance:r=c.ButtonAppearance.Solid,size:n=c.ElementSize.Standard,className:a,textClassName:o,iconAfter:i,iconBefore:l,hideTitleOnMobile:d,type:u="button",tooltipProps:h,...p})=>{const g=ee(d?"hidden sm:inline":"inline",o),x=f.mergeClasses(t&&pn(t,r),n===c.ElementSize.Small?"dial-tiny-semi-text":"dial-small-semi-text",r!==c.ButtonAppearance.Link&&(n===c.ElementSize.Small?"h-[24px] px-2":"h-[40px] px-3"),n!==c.ElementSize.Small&&r!==c.ButtonAppearance.Link&&"dial-kit-enhanced-target","disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",a),y=s.jsxs("button",{...p,type:u,className:x,"aria-label":typeof e=="string"&&e||p["aria-label"],children:[s.jsx(c.DialIcon,{icon:l}),e&&s.jsx("span",{className:g,children:e}),s.jsx(c.DialIcon,{icon:i})]});return h?s.jsx(qe,{...h,children:y}):y},Ja="text-primary",Qt=({text:e,className:t,contentClassName:r,hideTooltip:n,id:a,customTooltipContent:o,...i})=>{const l=m.useRef(null),[d,u]=m.useState(!1),[h,p]=m.useState(""),g=m.useCallback(()=>{const b=l.current;b&&(p(b.textContent??""),u(b.scrollWidth>b.clientWidth))},[]),x=m.useCallback(()=>c.scheduleMeasure(g),[g]);m.useEffect(()=>{const b=l.current;if(b)return c.observeElementSize(b,g)},[g]),m.useEffect(()=>{x()},[e,x]);const y=m.useMemo(()=>typeof e=="string"?e:h,[h,e]),v=m.useMemo(()=>n?"":o||(d?y:""),[o,y,n,d]);return s.jsxs(Pr,{...i,children:[s.jsx(zr,{asChild:!0,onMouseEnter:x,onFocusCapture:x,children:s.jsx("span",{id:a,className:f.mergeClasses("block truncate flex-1 min-w-0 max-w-full text-start",t),"aria-label":d?y:void 0,onMouseEnter:x,onFocus:x,ref:l,children:e})}),s.jsx(Br,{className:f.mergeClasses(Ja,r,!v&&"hidden"),children:v})]})},eo=({label:e,className:t,icon:r,selected:n,closable:a,onClick:o,onRemove:i})=>{const l=f.mergeClasses("flex items-center gap-1 cursor-pointer dial-tiny-text px-2 h-[24px] border text-primary rounded-[8px]",n?"hover:bg-controls-accent-primary-alpha-active bg-accent-primary-alpha border-accent-primary":"bg-neutral border-primary",t);return s.jsxs("div",{className:l,onClick:o,children:[s.jsx(c.DialIcon,{icon:r}),s.jsx(Qt,{text:e}),a&&i&&s.jsx(Tt,{className:"p-0",iconAfter:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM}),onClick:d=>i(d)})]},e)};var Ee=(e=>(e.Default="default",e.Text="text",e.Circular="circular",e.Rectangular="rectangular",e))(Ee||{}),bt=(e=>(e.Small="small",e.Default="default",e.Large="large",e))(bt||{}),Vt=(e=>(e.Circle="circle",e.Square="square",e))(Vt||{});const to=e=>{if(typeof e=="number")return e;switch(e){case bt.Small:return 32;case bt.Large:return 64;case bt.Default:default:return 40}},Ht=({active:e=!0,paragraph:t=!0,avatar:r=!1,showTitle:n=!0,loading:a=!0,children:o,variant:i=Ee.Default,width:l,height:d,overlay:u,color:h,className:p,...g})=>{if(!a&&o)return s.jsx(s.Fragment,{children:o});const x=f.mergeClasses("bg-layer-raised",e&&"animate-pulse",p);if(i!==Ee.Default){const D=f.mergeClasses(x,i===Ee.Circular&&"rounded-full",i===Ee.Rectangular&&"rounded",i===Ee.Text&&"rounded",!!u&&"relative"),E={};return l&&(E.width=typeof l=="number"?`${l}px`:l),d&&(E.height=typeof d=="number"?`${d}px`:d),h&&(E.backgroundColor=h),s.jsx("div",{className:D,style:E,...g,children:u&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:u})})}const y=!!r,v=!!n,b=!!t,C=typeof r=="object"?r:{},I=typeof n=="object"?n:{},S=typeof t=="object"?t:{},w=to(C.size),N=C.shape??Vt.Circle,L=I.width??"38%",A=S.rows??3,T=S.width,j=D=>T?Array.isArray(T)?T[D]??"100%":T:D===A-1?"61%":"100%";return s.jsxs("div",{...g,className:f.mergeClasses("flex gap-4",!!u&&"relative",p,c.DIAL_KIT_CLASS.skeleton),children:[y&&s.jsx("div",{className:f.mergeClasses(x,N===Vt.Circle?"rounded-full":"rounded","flex-shrink-0"),style:{width:w,height:w,...h&&{backgroundColor:h}}}),s.jsxs("div",{className:"flex-1 flex flex-col gap-3",children:[v&&s.jsx("div",{className:f.mergeClasses(x,"h-4 rounded"),style:{width:L,...h&&{backgroundColor:h}}}),b&&s.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:A}).map((D,E)=>s.jsx("div",{className:f.mergeClasses(x,"h-4 rounded"),style:{width:j(E),...h&&{backgroundColor:h}}},E))})]}),u&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:u})]})},ro=ee("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),so=ee("z-floating overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-hidden"),jr=ee("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-hidden","hover:bg-accent-primary-alpha px-3","dial-small-text h-[34px] rounded text-primary",c.DIAL_KIT_CLASS.menuItem),Dr="opacity-75 !cursor-not-allowed",xn="text-error",no="my-1 border-t border-hover border-secondary",st=4,ao=s.jsx(F.IconChevronRight,{size:14}),ct=(e,t)=>({appearance:n,...a})=>s.jsx(Dt,{...a,variant:e,appearance:n||t}),oo=(e,t)=>({variant:n,...a})=>s.jsx(Dt,{...a,variant:n||t,appearance:e}),io=ct(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),lo=ct(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),bn=ct(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),co=ct(c.ButtonVariant.Secondary,c.ButtonAppearance.Ghost),uo=ct(c.ButtonVariant.Tertiary,c.ButtonAppearance.Ghost),fo=ct(c.ButtonVariant.Success,c.ButtonAppearance.Ghost),vn=oo(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),yn=({ariaLabel:e,className:t,size:r=24,onClose:n,...a})=>s.jsx(vn,{"aria-label":e,className:f.mergeClasses(t,"w-auto h-auto"),onClick:n,icon:s.jsx(F.IconX,{size:r}),...a}),po=({item:e,onRootClose:t})=>{const{isOpen:r,refs:n,floatingStyles:a,context:o,getReferenceProps:i,getFloatingProps:l}=c.useSubMenuFloating(st,"menu",!!e.disabled),d=m.useCallback(u=>h=>{u.disabled||(u.onClick?.({key:u.key,domEvent:h}),t())},[t]);return s.jsxs(s.Fragment,{children:[s.jsxs("button",{ref:n.setReference,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":r,"aria-disabled":!!e.disabled,disabled:e.disabled,className:ee(jr,e.disabled&&Dr,e.className),...i(),children:[e.icon&&s.jsx("span",{className:ee(e.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:e.icon})}),s.jsx("span",{className:ee("flex-1 truncate text-start",e.disabled&&"text-secondary"),children:e.label}),s.jsx("span",{className:ee("ml-auto shrink-0",e.disabled&&"text-secondary"),children:ao})]}),r&&s.jsx(c.SubMenuPanel,{refs:n,floatingStyles:a,context:o,getFloatingProps:l,role:"menu",className:"w-max",children:s.jsx("div",{role:"none",className:ee("py-1",c.DIAL_KIT_CLASS.dropdownList),children:e.children.map(u=>s.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!u.disabled,disabled:u.disabled,className:ee(jr,u.disabled&&Dr,u.danger&&xn,u.className),onClick:d(u),children:[u.icon&&s.jsx("span",{className:ee(u.danger&&"text-error",u.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:u.icon})}),s.jsx("span",{className:ee("flex-1 truncate text-start",u.danger&&"text-error",u.disabled&&"text-secondary"),children:u.label})]},u.key))})})]})},ho=e=>"clientWidth"in e?e.clientWidth:e.getBoundingClientRect?.()?.width??0,Wt=({children:e,items:t,onItemClick:r,menuHeader:n,menuFooter:a,renderOverlay:o,trigger:i=[c.DropdownTrigger.Click],placement:l,disabled:d=!1,open:u,defaultOpen:h=!1,onOpenChange:p,closable:g=!1,onClose:x,className:y,overlayContentClassName:v,separatorClassName:b,listClassName:C,outsidePressIgnoreRef:I,outsideClosable:S=!0,allowedPlacements:w,anchorToMouse:N=!1,matchReferenceWidth:L=!0,maxDropdownHeight:A})=>{const[T,j]=m.useState(h),D=u!==void 0,E=D?!!u:T,k=m.useRef(null),P=m.useCallback(_=>{D||j(_),p?.(_)},[D,p]),O=m.useId(),R=l===void 0,{refs:M,floatingStyles:H,context:W}=B.useFloating({placement:l,open:E,onOpenChange:P,whileElementsMounted:B.autoUpdate,middleware:[B.offset({mainAxis:st,crossAxis:0}),R?B.autoPlacement({alignment:"start",crossAxis:!0,padding:st,allowedPlacements:w}):B.flip({padding:st}),B.shift({padding:st}),B.size({padding:st,apply({availableWidth:_,availableHeight:U,elements:de}){const ne=de.floating,ge=ho(de.reference);ne.style.setProperty("--fui-available-height",`${Math.floor(U)}px`),ne.style.setProperty("--reference-width",L?`${Math.round(ge)}px`:"0px"),L?ne.style.minWidth=`${Math.round(ge)}px`:ne.style.removeProperty("min-width"),ne.style.maxWidth=`${Math.floor(_)}px`;const Qe=Math.floor(U);ne.style.maxHeight=`${A?Math.min(Qe,A):Qe}px`}})]}),K=B.useClick(W,{enabled:i.includes(c.DropdownTrigger.Click)&&!d}),V=B.useHover(W,{enabled:i.includes(c.DropdownTrigger.Hover)&&!d,move:!1,restMs:40,delay:{open:80,close:80}}),G=B.useDismiss(W,{bubbles:!0,referencePress:!1,outsidePress:_=>{if(!S)return!1;const U=_.target;return!(I?.current&&U instanceof Node&&I.current.contains(U))}}),J=B.useRole(W,{role:"menu"}),{getReferenceProps:re,getFloatingProps:q}=B.useInteractions([K,V,G,J]),Y=m.useCallback((_,U)=>{M.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:_,y:U,top:U,left:_,right:_,bottom:U})})},[M]),se=m.useCallback(_=>{!i.includes(c.DropdownTrigger.ContextMenu)||d||(_.preventDefault(),N&&(Y(_.clientX,_.clientY),k.current=document.elementFromPoint(_.clientX,_.clientY)),P(!0))},[N,d,P,Y,i]),le=m.useCallback(_=>{!N||d||(i.includes(c.DropdownTrigger.ContextMenu)&&E&&P(!1),Y(_.clientX,_.clientY),k.current=document.elementFromPoint(_.clientX,_.clientY))},[N,d,Y,E,i,P]);m.useEffect(()=>{d&&E&&P(!1)},[d,E,P]);const oe=m.useCallback(_=>U=>{_.disabled||(_.onClick?.({key:_.key,domEvent:U}),r?.({key:_.key,domEvent:U}),P(!1))},[r,P]),me=m.useMemo(()=>o?o():t?s.jsxs(s.Fragment,{children:[n&&s.jsx(s.Fragment,{children:typeof n=="function"?n():n}),s.jsx("div",{role:"none",className:f.mergeClasses("py-1",v,c.DIAL_KIT_CLASS.dropdownList),"aria-label":"dropdown",children:t.map(_=>_.type===c.DropdownItemType.Divider?s.jsx("div",{role:"separator",className:f.mergeClasses(no,b)},_.key):_.type===c.DropdownItemType.PlainText?s.jsx("div",{className:f.mergeClasses("px-3 py-2 text-secondary dial-caption-text",_.className),children:_.label},_.key):_.children?.length?s.jsx(po,{item:_,onRootClose:()=>P(!1)},_.key):s.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!_.disabled,className:ee(jr,_.disabled&&Dr,_.danger&&xn,_.className),disabled:_.disabled,onClick:oe(_),children:[_.icon&&s.jsx("span",{className:ee(_.danger&&"text-error",_.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:_.icon})}),s.jsx("span",{className:ee("flex-1 truncate text-start",_.danger&&"text-error",_.disabled&&"text-secondary"),"aria-labelledby":"item-text",children:_.label})]},_.key))}),a&&s.jsx(s.Fragment,{children:typeof a=="function"?a():a})]}):null,[oe,t,a,n,o,P,v,b]),ve=re({onContextMenu:se,onMouseDown:le});return m.useEffect(()=>{if(!E)return;const _=M.reference.current;let U=null;if(_ instanceof Element?U=_:k.current instanceof Element&&(U=k.current),!U)return;const de=new IntersectionObserver(([ne])=>{ne.isIntersecting||P(!1)},{root:null,threshold:0});return de.observe(U),()=>de.disconnect()},[E,M.reference,P]),s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:M.setReference,className:ee(ro,d&&"!cursor-not-allowed opacity-75",y),"aria-haspopup":"menu","aria-expanded":E,"aria-controls":O,...ve,children:e}),E&&s.jsx(B.FloatingPortal,{children:s.jsx(B.FloatingFocusManager,{context:W,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsxs("div",{id:O,ref:M.setFloating,style:H,className:ee(so,!L&&"w-max",C),...q(),children:[g&&s.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:s.jsx(yn,{ariaLabel:"Close dropdown",onClose:_=>{x?.(_),P(!1)}})}),me]})})})]})};var Ge=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(Ge||{}),ot=(e=>(e.Error="error",e.Warning="warning",e))(ot||{}),Ue=(e=>(e.Default="default",e.Inline="inline",e))(Ue||{}),Gt=(e=>(e.Mobile="mobile",e.Tablet="tablet",e))(Gt||{});const gt=({tab:e,active:t,invalid:r,className:n,horizontal:a,view:o=Ue.Default,onClick:i})=>{const l=o===Ue.Inline,d=f.mergeClasses("rounded h-[38px] items-center flex flex-row border-transparent cursor-pointer dial-small-text hover:text-accent-primary",{"border-b-2 px-4":a,"border-l-2 px-3":!a},{"bg-layer-4":a,"bg-layer-1 text-secondary pointer-events-none":e.disabled,"bg-accent-primary-alpha text-primary":t&&!e.disabled,"text-primary":!t&&!e.disabled,"border-b-accent-primary":t&&a&&!e.disabled,"border-l-accent-primary":t&&!a&&!e.disabled}),u=f.mergeClasses("flex flex-row gap-1 h-6 items-center py-1 px-2 rounded cursor-pointer hover:bg-accent-primary-alpha",t?"dial-small-semi-text":"dial-small-text",{"text-secondary pointer-events-none":e.disabled,"bg-accent-primary-alpha text-primary":t&&!e.disabled,"text-secondary":!t&&!e.disabled}),h=f.mergeClasses(l?u:d,n);return s.jsxs("button",{role:"tab","aria-selected":t,className:h,onClick:()=>i(e.id),disabled:e.disabled,children:[l&&t&&!e.disabled&&s.jsx(F.IconCheck,{size:f.DIAL_ICON_SIZE.SM}),s.jsx(Qt,{text:e.label,contentClassName:"max-w-[200px]",className:"max-w-[200px]"}),(r||e.invalid)&&s.jsx("div",{className:"text-error pl-1",children:s.jsx(F.IconExclamationCircle,{...f.BASE_ICON_PROPS})}),e.warning&&s.jsx("div",{className:"text-warning pl-1",children:s.jsx(F.IconAlertTriangle,{...f.BASE_ICON_PROPS})})]})},mo=()=>{const[e,t]=m.useState(()=>typeof window>"u"?c.ScreenType.Desktop:c.getScreenType());return m.useEffect(()=>{t(c.getScreenType());const r=()=>t(c.getScreenType());return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),e},go=12,xo=({tabs:e,activeTab:t,onClick:r,className:n,orientation:a=Ge.Horizontal,view:o=Ue.Default,screenThreshold:i=Gt.Tablet,smallScreenContainerClassName:l,smallScreenDropdownItemClassName:d,desktopDropdownClassName:u,desktopTabClassName:h,inlineContainerClassName:p,inlineTabClassName:g})=>{const[x,y]=m.useState(!1),[v,b]=m.useState(!1),[C,I]=m.useState(!1),S=mo(),w=S===c.ScreenType.Mobile||i===Gt.Tablet&&S===c.ScreenType.Tablet,N=a===Ge.Horizontal,L=m.useRef(null),A=m.useRef(null),T=m.useRef(null),j=e.find(O=>O.id===t),D=m.useMemo(()=>f.mergeClasses("flex gap-2",N?"flex-row flex-nowrap overflow-x-auto":"flex-col flex-wrap w-full"),[N]),E=m.useCallback(()=>{const O=A.current;O&&I(O.scrollWidth>O.clientWidth)},[]),k=m.useCallback(()=>{const O=T.current,R=A.current;if(!O||!R)return;const M=O.getBoundingClientRect(),H=R.getBoundingClientRect();if(M.width===0||H.width===0)return;const W=go;let K=R.scrollLeft;if(M.left<H.left+W)K-=H.left+W-M.left;else if(M.right>H.right-W)K+=M.right-(H.right-W);else return;const V=Math.max(0,R.scrollWidth-R.clientWidth);K=Math.max(0,Math.min(K,V)),K!==R.scrollLeft&&R.scrollTo({left:K,behavior:"smooth"})},[]),P=m.useCallback(O=>{r(O),O===t&&k()},[r,t,k]);return m.useEffect(()=>{E();const O=new ResizeObserver(()=>E()),R=A.current;return R&&O.observe(R),()=>O.disconnect()},[e,E]),m.useEffect(()=>{k()},[t,k]),o===Ue.Inline?s.jsx("div",{role:"tablist",className:f.mergeClasses("flex flex-row items-center gap-0.5 bg-layer-4 rounded w-fit p-0.5",p),children:e.map(O=>s.jsx(gt,{tab:O,active:t===O.id,view:Ue.Inline,onClick:P,className:g},O.id))}):w?s.jsx("div",{role:"tablist",className:f.mergeClasses("h-11 flex items-center bg-layer-3 px-4",l),children:s.jsx(Wt,{trigger:[c.DropdownTrigger.Click],open:x,onOpenChange:y,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],renderOverlay:()=>e.map(O=>s.jsx(gt,{tab:O,active:O.id===t,onClick:R=>{P(R),y(!1)},className:f.mergeClasses("w-full rounded-none h-11 items-center px-6",d)},O.id)),children:s.jsxs("div",{className:"flex gap-2 items-center h-11 cursor-pointer",children:[s.jsx(gt,{tab:j,active:!0,onClick:P,className:"rounded-none bg-transparent border-l-0 border-b-0 h-full items-center px-0"},t),s.jsx(c.DialIcon,{icon:s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.SM}),className:f.mergeClasses("text-primary transition-transform",x&&"rotate-180")})]})})}):s.jsxs("div",{ref:L,className:f.mergeClasses("flex items-center",n),children:[s.jsx("div",{ref:A,role:"tablist",className:D,children:e.map(O=>s.jsx("div",{ref:t===O.id?T:void 0,className:"w-full",children:s.jsx(gt,{tab:O,active:t===O.id,onClick:P,horizontal:N,className:f.mergeClasses("w-full",h)})},O.id))}),C&&s.jsx("div",{className:"flex items-center ml-2",children:s.jsx(Wt,{trigger:[c.DropdownTrigger.Click],open:v,onOpenChange:b,placement:"bottom-end",renderOverlay:()=>e.map(O=>s.jsx(gt,{tab:O,active:O.id===t,onClick:R=>{P(R),b(!1)},className:"w-full rounded-none h-8 items-center px-3 py-2"},O.id)),children:s.jsx(Tt,{iconBefore:s.jsx(F.IconDotsVertical,{size:f.BASE_ICON_SIZE}),className:f.mergeClasses("w-8 h-8 flex items-center justify-center rounded border",v?"bg-layer-4 border-transparent":"border-primary",u)})})})]})},Cn="w-full overflow-hidden",In="flex flex-nowrap items-center gap-2 min-w-0 px-0 py-0 whitespace-nowrap",Ut="flex items-center gap-2 dial-small-text",pr={first:"shrink-0",middle:"shrink min-w-0 max-w-[30%]",last:"shrink min-w-0 max-w-[51%]"},Tr="flex flex-1 items-center gap-1 min-w-0 transition-colors",bo="text-secondary hover:text-accent-primary",Sn="text-primary cursor-default",Hr="flex-none inline-flex items-center leading-none text-secondary",vo="items-center gap-1 min-w-0 transition-colors text-secondary hover:text-accent-primary",Nn=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,"aria-hidden":"true"}),xt=({label:e,href:t,onClick:r,disabled:n,isLast:a,isFirst:o,separator:i=Nn,className:l,iconBefore:d,labelClassName:u,onBeforeNavigate:h,...p})=>{const g=async I=>{if(h&&!a&&!await h()){I.preventDefault();return}r&&r(I)},x=a?pr.last:o?pr.first:pr.middle,y=f.mergeClasses(Ut,x,l),v=(!!t||!!r)&&!a&&!n,b=v?f.mergeClasses(Tr,bo):f.mergeClasses(Tr,Sn,n?"pointer-events-none opacity-75":""),C=typeof e=="string"?s.jsx(Qt,{className:f.mergeClasses("cursor-pointer",u),text:e,id:"breadcrumb-item-content"}):s.jsx("span",{className:f.mergeClasses("flex-1 min-w-0 truncate cursor-pointer max-w-[300px]",u),"aria-label":"breadcrumb-item-content",children:e});return s.jsxs("li",{...p,className:y,"aria-label":p["aria-label"]||"breadcrumb-item",children:[v?s.jsxs("a",{href:t,onClick:g,className:b,children:[d,C]}):s.jsxs("span",{className:b,"aria-current":a?"page":void 0,"aria-disabled":n?"true":void 0,children:[d,C]}),!a&&s.jsx("span",{className:Hr,"aria-label":"separator",children:i})]})},yo=({pathItems:e,separator:t=Nn,ariaLabel:r="Breadcrumb",className:n,children:a,labelClassName:o,onBeforeNavigate:i})=>{const l=m.useMemo(()=>e?.length?e:m.Children.toArray(a).filter(m.isValidElement).map(h=>{const p=h.props,{labelClassName:g,isLast:x,separator:y,...v}=p;return v}),[e,a]),d=m.useCallback(async h=>{const p=parseInt(h.key,10),g=l[p];if(i&&!await i()){h.domEvent.preventDefault();return}g.onClick?g.onClick(h.domEvent):g.href&&(window.location.href=g.href)},[l,i]),u=m.useMemo(()=>{if(l.length===0)return null;if(l.length<=3)return l.map((v,b)=>m.createElement(xt,{...v,key:`item-${b}`,isFirst:b===0&&l.length>1,isLast:b===l.length-1,separator:t,labelClassName:o,onBeforeNavigate:i}));const h=l.at(0),p=l.slice(1,-2),g=l.at(-2),x=l.at(-1);if(!h||!g||!x)return null;const y=p.map((v,b)=>({key:String(b+1),label:typeof v.label=="string"?v.label:`Item ${b+1}`,disabled:v.disabled}));return s.jsxs(s.Fragment,{children:[m.createElement(xt,{...h,key:"item-0",isFirst:!0,separator:t,labelClassName:o,onBeforeNavigate:i}),s.jsxs("li",{className:f.mergeClasses(Ut,"shrink-0"),children:[s.jsx(Wt,{items:y,onItemClick:d,placement:"bottom-start",matchReferenceWidth:!1,children:s.jsx("button",{type:"button","aria-label":"More breadcrumbs",className:vo,children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM})})}),s.jsx("span",{className:Hr,children:t})]}),m.createElement(xt,{...g,key:`item-${l.length-2}`,separator:t,labelClassName:o,onBeforeNavigate:i}),m.createElement(xt,{...x,key:`item-${l.length-1}`,isLast:!0,separator:t,labelClassName:o,onBeforeNavigate:i})]})},[l,t,o,d,i]);return s.jsx("nav",{"aria-label":r,className:f.mergeClasses(Cn,n),children:s.jsx("ol",{className:In,children:u})})},$r=(e,t)=>({appearance:n,...a})=>s.jsx(Tt,{...a,variant:e,appearance:n||t}),wn=(e,t)=>({variant:n,...a})=>s.jsx(Tt,{...a,variant:n||t,appearance:e}),Kr=$r(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),jn=$r(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),Dn=$r(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),Co=wn(c.ButtonAppearance.Link,c.ButtonVariant.Primary),Io=wn(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Tn=({iconClassName:e,label:t,...r})=>t?s.jsx(Dn,{...r,label:t,appearance:c.ButtonAppearance.Ghost,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}):s.jsx(bn,{...r,appearance:c.ButtonAppearance.Ghost,icon:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}),So="bg-layer-4 flex items-center justify-center enabled:text-secondary enabled:hover:text-accent-primary enabled:active:bg-controls-accent-primary-alpha-active enabled:hover:bg-accent-primary-alpha enabled:active:text-accent-primary",No=({icon:e,onClick:t,disabled:r,size:n=c.ElementSize.Standard,className:a})=>s.jsx("div",{className:ee("border-l border-tertiary",n===c.ElementSize.Standard?"h-[40px] w-[44px]":"h-[24px] w-[32px]"),children:s.jsx(Dt,{className:ee(So,n===c.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:n})}),wo=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],jo=(e,t,r,n)=>{if((t==="number"||r!==void 0||n!==void 0)&&!wo.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||n!==void 0){const o=e.currentTarget.value,i=e.currentTarget.selectionStart||0,l=o.slice(0,i)+e.key+o.slice(i),d=parseFloat(l);if(!isNaN(d)){if(r!==void 0&&d<+r){e.preventDefault();return}if(n!==void 0&&d>+n){e.preventDefault();return}}}}},En=({labelProps:e,error:t,caption:r,id:n,containerClassName:a,...o})=>s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",a),children:[e&&s.jsx(Fr,{...e,htmlFor:n}),s.jsx(Ln,{id:n,...o}),s.jsx(Fe,{text:t}),!t&&s.jsx(Mr,{text:r})]}),Ln=({invalid:e,disabled:t,prefix:r,className:n,postfix:a,iconBefore:o,iconAfter:i,wrapperClassName:l,type:d,inputRef:u,value:h,tooltipText:p,min:g,onChange:x,max:y,inputButtonProps:v,...b})=>{const C=m.useRef(null),I=B.useMergeRefs([u,C]),S=d==="number"||g!==void 0||y!==void 0;m.useEffect(()=>{const A=C.current;if(!A||!S||t)return;const T=j=>{j.preventDefault()};return A.addEventListener("wheel",T,{passive:!1}),()=>{A.removeEventListener("wheel",T)}},[t,S,d]);const w=A=>{jo(A,d,g,y)},N=A=>{const T=A.currentTarget.value;if(S&&T!==""){const j=parseFloat(T);if(isNaN(j)&&T!=="-"&&T!=="."||!isNaN(j)&&(g!==void 0&&j<+g||y!==void 0&&j>+y))return}x?.(T||void 0)},L=()=>s.jsxs("div",{className:f.mergeClasses("dial-input flex flex-row items-center gap-x-2 justify-between py-2",e&&"dial-input-error",t&&"dial-input-disable",!r&&"pl-3",!v&&"pr-3",l),"aria-label":"input-container",children:[r&&s.jsx("div",{className:"border-r border-tertiary",children:s.jsx(Ln,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,id:`${r}_textBefore`})}),s.jsx(c.DialIcon,{icon:o}),s.jsx("input",{ref:I,type:d,autoComplete:d==="password"?"new-password":"off",value:h??"",className:f.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",n),onChange:N,onKeyDown:w,min:g,disabled:t,max:y,...b}),a&&s.jsxs("p",{className:"text-secondary dial-small-text",children:[" ",a]}),s.jsx(c.DialIcon,{icon:i}),v&&s.jsx(No,{...v,disabled:t})]});return t&&d!=="password"?s.jsx(qe,{tooltip:p||h,children:L()}):L()},An=m.createContext({dragDropManager:void 0});function ye(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 ms=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),gs=function(){return Math.random().toString(36).substring(7).split("").join(".")},xs={INIT:"@@redux/INIT"+gs(),REPLACE:"@@redux/REPLACE"+gs()};function Do(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 To(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(Ao(e))return"date";if(Lo(e))return"error";var r=Eo(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 Eo(e){return typeof e.constructor=="function"?e.constructor.name:null}function Lo(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Ao(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Je(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=To(e)),t}function On(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?ye(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"?ye(1):"Expected the enhancer to be a function. Instead, received: '"+Je(r)+"'");return r(On)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?ye(2):"Expected the root reducer to be a function. Instead, received: '"+Je(e)+"'");var a=e,o=t,i=[],l=i,d=!1;function u(){l===i&&(l=i.slice())}function h(){if(d)throw new Error(process.env.NODE_ENV==="production"?ye(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(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ye(4):"Expected the listener to be a function. Instead, received: '"+Je(v)+"'");if(d)throw new Error(process.env.NODE_ENV==="production"?ye(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 b=!0;return u(),l.push(v),function(){if(b){if(d)throw new Error(process.env.NODE_ENV==="production"?ye(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.");b=!1,u();var I=l.indexOf(v);l.splice(I,1),i=null}}}function g(v){if(!Do(v))throw new Error(process.env.NODE_ENV==="production"?ye(7):"Actions must be plain objects. Instead, the actual type was: '"+Je(v)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?ye(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(d)throw new Error(process.env.NODE_ENV==="production"?ye(9):"Reducers may not dispatch actions.");try{d=!0,o=a(o,v)}finally{d=!1}for(var b=i=l,C=0;C<b.length;C++){var I=b[C];I()}return v}function x(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ye(10):"Expected the nextReducer to be a function. Instead, received: '"+Je(v));a=v,g({type:xs.REPLACE})}function y(){var v,b=p;return v={subscribe:function(I){if(typeof I!="object"||I===null)throw new Error(process.env.NODE_ENV==="production"?ye(11):"Expected the observer to be an object. Instead, received: '"+Je(I)+"'");function S(){I.next&&I.next(h())}S();var w=b(S);return{unsubscribe:w}}},v[ms]=function(){return this},v}return g({type:xs.INIT}),n={dispatch:g,subscribe:p,getState:h,replaceReducer:x},n[ms]=y,n}function Z(e,t,...r){if(Oo()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let n;if(t===void 0)n=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;n=new Error(t.replace(/%s/g,function(){return r[a++]})),n.name="Invariant Violation"}throw n.framesToPop=1,n}}function Oo(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function _o(e,t,r){return t.split(".").reduce((n,a)=>n&&n[a]?n[a]:r||null,e)}function ko(e,t){return e.filter(r=>r!==t)}function _n(e){return typeof e=="object"}function Ro(e,t){const r=new Map,n=o=>{r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(n),t.forEach(n);const a=[];return r.forEach((o,i)=>{o===1&&a.push(i)}),a}function Mo(e,t){return e.filter(r=>t.indexOf(r)>-1)}const Vr="dnd-core/INIT_COORDS",Jt="dnd-core/BEGIN_DRAG",Wr="dnd-core/PUBLISH_DRAG_SOURCE",er="dnd-core/HOVER",tr="dnd-core/DROP",rr="dnd-core/END_DRAG";function bs(e,t){return{type:Vr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Po={type:Vr,payload:{clientOffset:null,sourceClientOffset:null}};function Bo(e){return function(r=[],n={publishSource:!0}){const{publishSource:a=!0,clientOffset:o,getSourceClientOffset:i}=n,l=e.getMonitor(),d=e.getRegistry();e.dispatch(bs(o)),zo(r,l,d);const u=$o(r,l);if(u==null){e.dispatch(Po);return}let h=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");Fo(i),h=i(u)}e.dispatch(bs(o,h));const g=d.getSource(u).beginDrag(l,u);if(g==null)return;Ho(g),d.pinSource(u);const x=d.getSourceType(u);return{type:Jt,payload:{itemType:x,item:g,sourceId:u,clientOffset:o||null,sourceClientOffset:h||null,isSourcePublic:!!a}}}}function zo(e,t,r){Z(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){Z(r.getSource(n),"Expected sourceIds to be registered.")})}function Fo(e){Z(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Ho(e){Z(_n(e),"Item must be an object.")}function $o(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function Ko(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Ko(e,a,r[a])})}return e}function Wo(e){return function(r={}){const n=e.getMonitor(),a=e.getRegistry();Go(n),qo(n).forEach((i,l)=>{const d=Uo(i,l,a,n),u={type:tr,payload:{dropResult:Vo({},r,d)}};e.dispatch(u)})}}function Go(e){Z(e.isDragging(),"Cannot call drop while not dragging."),Z(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function Uo(e,t,r,n){const a=r.getTarget(e);let o=a?a.drop(n,e):void 0;return Zo(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function Zo(e){Z(typeof e>"u"||_n(e),"Drop result must either be an object or undefined.")}function qo(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Yo(e){return function(){const r=e.getMonitor(),n=e.getRegistry();Xo(r);const a=r.getSourceId();return a!=null&&(n.getSource(a,!0).endDrag(r,a),n.unpinSource()),{type:rr}}}function Xo(e){Z(e.isDragging(),"Cannot call endDrag while not dragging.")}function Er(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Qo(e){return function(r,{clientOffset:n}={}){Jo(r);const a=r.slice(0),o=e.getMonitor(),i=e.getRegistry(),l=o.getItemType();return ti(a,i,l),ei(a,o,i),ri(a,o,i),{type:er,payload:{targetIds:a,clientOffset:n||null}}}}function Jo(e){Z(Array.isArray(e),"Expected targetIds to be an array.")}function ei(e,t,r){Z(t.isDragging(),"Cannot call hover while not dragging."),Z(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n<e.length;n++){const a=e[n];Z(e.lastIndexOf(a)===n,"Expected targetIds to be unique in the passed array.");const o=r.getTarget(a);Z(o,"Expected targetIds to be registered.")}}function ti(e,t,r){for(let n=e.length-1;n>=0;n--){const a=e[n],o=t.getTargetType(a);Er(o,r)||e.splice(n,1)}}function ri(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function si(e){return function(){if(e.getMonitor().isDragging())return{type:Wr}}}function ni(e){return{beginDrag:Bo(e),publishDragSource:si(e),hover:Qo(e),drop:Wo(e),endDrag:Yo(e)}}class ai{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 n(o){return(...i)=>{const l=o.apply(t,i);typeof l<"u"&&r(l)}}const a=ni(this);return Object.keys(a).reduce((o,i)=>{const l=a[i];return o[i]=n(l),o},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const n=this.store.getState().refCount>0;this.backend&&(n&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!n&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function oi(e,t){return{x:e.x+t.x,y:e.y+t.y}}function kn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ii(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:kn(oi(t,n),r)}function li(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:kn(t,r)}const vt=[],Gr=[];vt.__IS_NONE__=!0;Gr.__IS_ALL__=!0;function ci(e,t){return e===vt?!1:e===Gr||typeof t>"u"?!0:Mo(t,e).length>0}class di{subscribeToStateChange(t,r={}){const{handlerIds:n}=r;Z(typeof t=="function","listener must be a function."),Z(typeof n>"u"||Array.isArray(n),"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&&!ci(i.dirtyHandlerIds,n)||t()}finally{a=l}};return this.store.subscribe(o)}subscribeToOffsetChange(t){Z(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const n=()=>{const a=this.store.getState().dragOffset;a!==r&&(r=a,t())};return this.store.subscribe(n)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return Z(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(Z(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const n=this.registry.getTargetType(t),a=this.getItemType();return Er(n,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Z(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const n=this.registry.getSourceType(t),a=this.getItemType();return n!==a?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:n}=r;if(!this.isDragging())return!1;const a=this.registry.getTargetType(t),o=this.getItemType();if(o&&!Er(a,o))return!1;const i=this.getTargetIds();if(!i.length)return!1;const l=i.indexOf(t);return n?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 ii(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return li(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const vs=typeof global<"u"?global:self,Rn=vs.MutationObserver||vs.WebKitMutationObserver;function Mn(e){return function(){const r=setTimeout(a,0),n=setInterval(a,50);function a(){clearTimeout(r),clearInterval(n),e()}}}function ui(e){let t=1;const r=new Rn(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const fi=typeof Rn=="function"?ui:Mn;class pi{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),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 n=0,a=t.length-this.index;n<a;n++)t[n]=t[n+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=fi(this.flush),this.requestErrorThrow=Mn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class hi{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 mi{create(t){const r=this.freeTasks,n=r.length?r.pop():new hi(this.onError,a=>r[r.length]=a);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const Pn=new pi,gi=new mi(Pn.registerPendingError);function xi(e){Pn.enqueueTask(gi.create(e))}const Ur="dnd-core/ADD_SOURCE",Zr="dnd-core/ADD_TARGET",qr="dnd-core/REMOVE_SOURCE",sr="dnd-core/REMOVE_TARGET";function bi(e){return{type:Ur,payload:{sourceId:e}}}function vi(e){return{type:Zr,payload:{targetId:e}}}function yi(e){return{type:qr,payload:{sourceId:e}}}function Ci(e){return{type:sr,payload:{targetId:e}}}function Ii(e){Z(typeof e.canDrag=="function","Expected canDrag to be a function."),Z(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Z(typeof e.endDrag=="function","Expected endDrag to be a function.")}function Si(e){Z(typeof e.canDrop=="function","Expected canDrop to be a function."),Z(typeof e.hover=="function","Expected hover to be a function."),Z(typeof e.drop=="function","Expected beginDrag to be a function.")}function Lr(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Lr(r,!1));return}Z(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 Ie;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ie||(Ie={}));let Ni=0;function wi(){return Ni++}function ji(e){const t=wi().toString();switch(e){case Ie.SOURCE:return`S${t}`;case Ie.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function ys(e){switch(e[0]){case"S":return Ie.SOURCE;case"T":return Ie.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Cs(e,t){const r=e.entries();let n=!1;do{const{done:a,value:[,o]}=r.next();if(o===t)return!0;n=!!a}while(!n);return!1}class Di{addSource(t,r){Lr(t),Ii(r);const n=this.addHandler(Ie.SOURCE,t,r);return this.store.dispatch(bi(n)),n}addTarget(t,r){Lr(t,!0),Si(r);const n=this.addHandler(Ie.TARGET,t,r);return this.store.dispatch(vi(n)),n}containsHandler(t){return Cs(this.dragSources,t)||Cs(this.dropTargets,t)}getSource(t,r=!1){return Z(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Z(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Z(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Z(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return ys(t)===Ie.SOURCE}isTargetId(t){return ys(t)===Ie.TARGET}removeSource(t){Z(this.getSource(t),"Expected an existing source."),this.store.dispatch(yi(t)),xi(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Z(this.getTarget(t),"Expected an existing target."),this.store.dispatch(Ci(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Z(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Z(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,n){const a=ji(t);return this.types.set(a,r),t===Ie.SOURCE?this.dragSources.set(a,n):t===Ie.TARGET&&this.dropTargets.set(a,n),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 Ti=(e,t)=>e===t;function Ei(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Li(e,t,r=Ti){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function Ai(e=vt,t){switch(t.type){case er:break;case Ur:case Zr:case sr:case qr:return vt;case Jt:case Wr:case rr:case tr:default:return Gr}const{targetIds:r=[],prevTargetIds:n=[]}=t.payload,a=Ro(r,n);if(!(a.length>0||!Li(r,n)))return vt;const i=n[n.length-1],l=r[r.length-1];return i!==l&&(i&&a.push(i),l&&a.push(l)),a}function Oi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _i(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Oi(e,a,r[a])})}return e}const Is={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function ki(e=Is,t){const{payload:r}=t;switch(t.type){case Vr:case Jt:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case er:return Ei(e.clientOffset,r.clientOffset)?e:_i({},e,{clientOffset:r.clientOffset});case rr:case tr:return Is;default:return e}}function Ri(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function et(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Ri(e,a,r[a])})}return e}const Mi={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Pi(e=Mi,t){const{payload:r}=t;switch(t.type){case Jt:return et({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Wr:return et({},e,{isSourcePublic:!0});case er:return et({},e,{targetIds:r.targetIds});case sr:return e.targetIds.indexOf(r.targetId)===-1?e:et({},e,{targetIds:ko(e.targetIds,r.targetId)});case tr:return et({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case rr:return et({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Bi(e=0,t){switch(t.type){case Ur:case Zr:return e+1;case qr:case sr:return e-1;default:return e}}function zi(e=0){return e+1}function Fi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Fi(e,a,r[a])})}return e}function $i(e={},t){return{dirtyHandlerIds:Ai(e.dirtyHandlerIds,{type:t.type,payload:Hi({},t.payload,{prevTargetIds:_o(e,"dragOperation.targetIds",[])})}),dragOffset:ki(e.dragOffset,t),refCount:Bi(e.refCount,t),dragOperation:Pi(e.dragOperation,t),stateId:zi(e.stateId)}}function Ki(e,t=void 0,r={},n=!1){const a=Vi(n),o=new di(a,new Di(a)),i=new ai(a,o),l=e(i,t,r);return i.receiveBackend(l),i}function Vi(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return On($i,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Wi(e,t){if(e==null)return{};var r=Gi(e,t),n,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Gi(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,o;for(o=0;o<n.length;o++)a=n[o],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}let Ss=0;const $t=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Ui=m.memo(function(t){var{children:r}=t,n=Wi(t,["children"]);const[a,o]=Zi(n);return m.useEffect(()=>{if(o){const i=Bn();return++Ss,()=>{--Ss===0&&(i[$t]=null)}}},[]),s.jsx(An.Provider,{value:a,children:r})});function Zi(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=qi(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function qi(e,t=Bn(),r,n){const a=t;return a[$t]||(a[$t]={dragDropManager:Ki(e,t,r,n)}),a[$t]}function Bn(){return typeof global<"u"?global:window}function Yi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hr,Ns;function Xi(){return Ns||(Ns=1,hr=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 n,a,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(a=n;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),n=o.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[a]))return!1;for(a=n;a--!==0;){var i=o[a];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}),hr}var Qi=Xi();const Ji=Yi(Qi),nr=typeof window<"u"?m.useLayoutEffect:m.useEffect;function el(e,t,r){const[n,a]=m.useState(()=>t(e)),o=m.useCallback(()=>{const i=t(e);Ji(n,i)||(a(i),r&&r())},[n,e,r]);return nr(o),[n,o]}function tl(e,t,r){const[n,a]=el(e,t,r);return nr(function(){const i=e.getHandlerId();if(i!=null)return e.subscribeToStateChange(a,{handlerIds:[i]})},[e,a]),n}function rl(e,t,r){return tl(t,e||(()=>({})),()=>r.reconnect())}function sl(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),m.useMemo(()=>typeof e=="function"?e():e,r)}let mr=!1;class nl{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Z(!mr,"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 mr=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{mr=!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 al(e,t,r){const n=r.getRegistry(),a=n.addTarget(e,t);return[a,()=>n.removeTarget(a)]}function ol(e,t,r,n){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 d=0;d<o.length;d++){const u=o[d];if(!l(u))return!1;const h=e[u],p=t[u];if(a=void 0,a===!1||a===void 0&&h!==p)return!1}return!0}function il(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ll(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 cl(e){return(t=null,r=null)=>{if(!m.isValidElement(t)){const o=t;return e(o,r),o}const n=t;return ll(n),ul(n,r?o=>e(o,r):e)}}function dl(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=cl(n);t[r]=()=>a}}),t}function ws(e,t){typeof e=="function"?e(t):e.current=t}function ul(e,t){const r=e.ref;return Z(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?m.cloneElement(e,{ref:n=>{ws(r,n),ws(t,n)}}):m.cloneElement(e,{ref:t})}class fl{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!ol(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=dl({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,il(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 Yr(){const{dragDropManager:e}=m.useContext(An);return Z(e!=null,"Expected drag drop context"),e}function pl(e){return m.useMemo(()=>e.hooks.dropTarget(),[e])}function hl(e){const t=Yr(),r=m.useMemo(()=>new fl(t.getBackend()),[t]);return nr(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function ml(){const e=Yr();return m.useMemo(()=>new nl(e),[e])}function gl(e){const{accept:t}=e;return m.useMemo(()=>(Z(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class xl{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 bl(e,t){const r=m.useMemo(()=>new xl(e,t),[t]);return m.useEffect(()=>{r.spec=e},[e]),r}function vl(e,t,r){const n=Yr(),a=bl(e,t),o=gl(e);nr(function(){const[l,d]=al(o,a,n);return t.receiveHandlerId(l),r.receiveHandlerId(l),d},[n,t,a,r,o.map(i=>i.toString()).join("|")])}function zn(e,t){const r=sl(e,t),n=ml(),a=hl(r.options);return vl(r,n,a),[rl(r.collect,n,a),pl(a)]}function Fn(e){let t=null;return()=>(t==null&&(t=e()),t)}function yl(e,t){return e.filter(r=>r!==t)}function Cl(e,t){const r=new Set,n=o=>r.add(o);e.forEach(n),t.forEach(n);const a=[];return r.forEach(o=>a.push(o)),a}class Il{enter(t){const r=this.entered.length,n=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=Cl(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=yl(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Sl{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(n=>{const a=this.config.exposeProperties[n];a!=null&&(r[n]={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 ar="__NATIVE_FILE__",Hn="__NATIVE_URL__",$n="__NATIVE_TEXT__",Kn="__NATIVE_HTML__",js=Object.freeze(Object.defineProperty({__proto__:null,FILE:ar,HTML:Kn,TEXT:$n,URL:Hn},Symbol.toStringTag,{value:"Module"}));function gr(e,t,r){const n=t.reduce((a,o)=>a||e.getData(o),"");return n??r}const Ar={[ar]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[Kn]:{exposeProperties:{html:(e,t)=>gr(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Hn]:{exposeProperties:{urls:(e,t)=>gr(e,t,"").split(`
2
2
  `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[$n]:{exposeProperties:{text:(e,t)=>gr(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Nl(e,t){const r=Ar[e];if(!r)throw new Error(`native type ${e} has no configuration`);const n=new Sl(r);return n.loadDataTransfer(t),n}function xr(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Ar).filter(r=>{const n=Ar[r];return n?.matchesTypes?n.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const wl=Fn(()=>/firefox/i.test(navigator.userAgent)),Vn=Fn(()=>!!window.safari);class Ds{interpolate(t){const{xs:r,ys:n,c1s:a,c2s:o,c3s:i}=this;let l=r.length-1;if(t===r[l])return n[l];let d=0,u=i.length-1,h;for(;d<=u;){h=Math.floor(.5*(d+u));const x=r[h];if(x<t)d=h+1;else if(x>t)u=h-1;else return n[h]}l=Math.max(0,u);const p=t-r[l],g=p*p;return n[l]+a[l]*p+o[l]*g+i[l]*p*g}constructor(t,r){const{length:n}=t,a=[];for(let x=0;x<n;x++)a.push(x);a.sort((x,y)=>t[x]<t[y]?-1:1);const o=[],i=[];let l,d;for(let x=0;x<n-1;x++)l=t[x+1]-t[x],d=r[x+1]-r[x],o.push(l),i.push(d/l);const u=[i[0]];for(let x=0;x<o.length-1;x++){const y=i[x],v=i[x+1];if(y*v<=0)u.push(0);else{l=o[x];const b=o[x+1],C=l+b;u.push(3*C/((C+b)/y+(C+l)/v))}}u.push(i[i.length-1]);const h=[],p=[];let g;for(let x=0;x<u.length-1;x++){g=i[x];const y=u[x],v=1/o[x],b=y+u[x+1]-g-g;h.push((g-y-b)*v),p.push(b*v*v)}this.xs=t,this.ys=r,this.c1s=u,this.c2s=h,this.c3s=p}}const jl=1;function Wn(e){const t=e.nodeType===jl?e:e.parentElement;if(!t)return null;const{top:r,left:n}=t.getBoundingClientRect();return{x:n,y:r}}function kt(e){return{x:e.clientX,y:e.clientY}}function Dl(e){var t;return e.nodeName==="IMG"&&(wl()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Tl(e,t,r,n){let a=e?t.width:r,o=e?t.height:n;return Vn()&&e&&(o/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:o}}function El(e,t,r,n,a){const o=Dl(t),l=Wn(o?e:t),d={x:r.x-l.x,y:r.y-l.y},{offsetWidth:u,offsetHeight:h}=e,{anchorX:p,anchorY:g}=n,{dragPreviewWidth:x,dragPreviewHeight:y}=Tl(o,t,u,h),v=()=>{let L=new Ds([0,.5,1],[d.y,d.y/h*y,d.y+y-h]).interpolate(g);return Vn()&&o&&(L+=(window.devicePixelRatio-1)*y),L},b=()=>new Ds([0,.5,1],[d.x,d.x/u*x,d.x+x-u]).interpolate(p),{offsetX:C,offsetY:I}=a,S=C===0||C,w=I===0||I;return{x:S?C:b(),y:w?I:v()}}class Ll{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 Al(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ts(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Al(e,a,r[a])})}return e}class Ol{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,n){return this.sourcePreviewNodeOptions.set(t,n),this.sourcePreviewNodes.set(t,r),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,n){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,n);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 n=i=>this.handleDragEnter(i,t),a=i=>this.handleDragOver(i,t),o=i=>this.handleDrop(i,t);return r.addEventListener("dragenter",n),r.addEventListener("dragover",a),r.addEventListener("drop",o),()=>{r.removeEventListener("dragenter",n),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 Ts({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 Ts({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(js).some(r=>js[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=Nl(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 n;return(n=this.rootElement)===null||n===void 0?void 0:n.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,n){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&&Wn(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=kt(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:i});const{dataTransfer:l}=a,d=xr(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const h=this.monitor.getSourceId(),p=this.sourceNodes.get(h),g=this.sourcePreviewNodes.get(h)||p;if(g){const{anchorX:x,anchorY:y,offsetX:v,offsetY:b}=this.getCurrentSourcePreviewNodeOptions(),S=El(p,g,i,{anchorX:x,anchorY:y},{offsetX:v,offsetY:b});l.setDragImage(g,S.x,S.y)}}try{l?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(a.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(d)this.beginDragNativeItem(d);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,d=xr(l);d&&this.beginDragNativeItem(d,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:kt(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=kt(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 xr(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:o}=this;this.dropTargetIds=[],this.actions.hover(o,{clientOffset:kt(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 Ll(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Il(this.isNodeInDocument)}}const _l=function(t,r,n){return new Ol(t,r,n)},kl=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:n,acceptTypes:a,maxFilesCount:o,multiple:i,fileFormatError:l,fileCountError:d,fileSizeError:u,getIsFileFormatError:h,getIsFileSizeError:p})=>{const g=m.useRef(null),x=m.useRef(null),[y,v]=m.useState([]),[b,C]=m.useState(!1),[I,S]=m.useState(!1),w=m.useCallback(M=>{const H=M.target.files;if(H&&H.length>0){const W=Array.from(H),K=h?.(W),V=p?.(W);K?C(!0):V?S(!0):e(W)}},[h,p,e]),N=m.useCallback(M=>o&&M?.length>o,[o]),L=m.useMemo(()=>b||I||N(y),[b,I,N,y]),A=()=>{v([]),C(!1),S(!1)},T=m.useMemo(()=>b?s.jsx(Fe,{text:l}):I?s.jsx(Fe,{text:u}):N(y)?s.jsx(Fe,{text:d}):null,[d,l,u,y,N,b,I]);m.useEffect(()=>{A()},[a]);const[{isOver:j,canDrop:D},E]=zn(()=>({accept:[ar],drop(M){const H=M.files,W=h?.(H)??!1,K=p?.(H)??!1,V=N?.(H)??!1;if(C(W),S(K),W||K||V){v(H);return}e(H),A()},collect:M=>({isOver:M.isOver(),canDrop:M.canDrop()})}),[e,h,p,N]),k=M=>{(M.key==="Enter"||M.key==="Space")&&(M.preventDefault(),x.current?.click())},P=M=>{M?.preventDefault();const H=Array.from(M.dataTransfer?.items??[]);C(!!h?.(H)),S(!!p?.(H)),v(H)},O=M=>{M.target===M.currentTarget&&A()},R=ee("border border-dashed rounded size-full cursor-pointer relative hover:border-hover",!D&&!L&&"border-primary",D&&(j?"border-accent-primary":"border-hover"),L&&"border-error");return E(g),s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:R,ref:g,onDragOver:P,onDragLeave:O,children:[s.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:k,className:"flex flex-col items-center cursor-pointer size-full text-secondary dial-tiny-text justify-center",children:[t&&s.jsx("p",{className:"mb-1",children:t}),r&&s.jsx("p",{className:"mb-0.5",children:r}),n&&s.jsx(Kr,{appearance:c.ButtonAppearance.Ghost,label:n,onClick:()=>x.current?.click()})]}),s.jsx("input",{multiple:i,id:"file",type:"file",ref:x,hidden:!0,accept:a,onChange:w})]}),s.jsx(s.Fragment,{children:T})]})},Rl=({iconBefore:e,className:t,...r})=>{const n=r.invalid,a=()=>s.jsx("div",{className:"mr-2",children:n?s.jsx(F.IconExclamationCircle,{...f.BASE_ICON_PROPS,className:"text-error"}):e});return s.jsx(En,{...r,iconBefore:a(),containerClassName:ee("h-[40px] p-0",n&&"h-[60px]"),className:ee("rounded-r-none border-r-0",n&&"text-error",t)})},Ml=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:n,getIsFileSizeError:a,maxFilesCount:o,fileFormatError:i,fileSizeError:l,fileCountError:d})=>{const u=m.useRef(null),[h,p]=m.useState(!1),[g,x]=m.useState(!1),[y,v]=m.useState(0),b=m.useCallback(()=>{p(!1),x(!1),v(0)},[]),C=m.useCallback(j=>!!(o&&t.length+j.length>o),[o,t.length]),I=h||g,[{isOver:S,canDrop:w},N]=zn(()=>({accept:[ar],drop(j){const D=j.files,E=[...t,...D],k=n?.(D)??!1,P=a?.(D)??!1,O=C?.(D)??!1;if(p(k),x(P),k||P||O){v(D.length);return}r(E),b()},collect:j=>({isOver:j.isOver(),canDrop:j.canDrop()})}),[t,r,n,a,C,b]),L=j=>{j.preventDefault();const D=Array.from(j.dataTransfer?.items??[]);p(!!n?.(D)),x(!1),v(D.length)},A=j=>{j.target===j.currentTarget&&b()};N(u);const T=C(Array.from({length:y}));return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsx("div",{ref:u,onDragOver:L,onDragLeave:A,className:ee("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!I&&!T&&(w&&S?"border-accent-primary":"border-primary"),(I||T)&&"border-error"),children:e}),h&&s.jsx(Fe,{text:i}),g&&s.jsx(Fe,{text:l}),!h&&!g&&T&&s.jsx(Fe,{text:d})]})},Gn=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:n,onChange:a,isInvalid:o,errorText:i,removeButtonAriaLabel:l,getIsMultiFilesSizeError:d,multiFilesSizeError:u,getIsFileFormatError:h,getIsFileSizeError:p,maxFilesCount:g}=e,x=m.useCallback((b,C)=>{b.stopPropagation(),a(t?.filter(I=>I.name!==C)||[])},[a,t]),y=m.useCallback(b=>s.jsx(Tn,{"aria-label":l,onClick:C=>x(C,b)}),[l,x]),v=m.useMemo(()=>s.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((b,C)=>s.jsx(Rl,{id:b.name,value:b.name,iconAfter:y(b.name),iconBefore:r||n?.(b.name),invalid:o?.(b),error:o?.(b)?i:""},b.name+C))}),[t,r,n,o,i,y]);return s.jsx(Ui,{backend:_l,children:!t||t.length===0?s.jsx(kl,{...e,onChange:a}):s.jsxs(s.Fragment,{children:[s.jsx(Ml,{existingFiles:t,onDrop:a,getIsFileFormatError:h,getIsFileSizeError:p,maxFilesCount:g,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:v}),d?.(t)&&s.jsx(Fe,{text:u})]})})},Pl=({onChange:e,fieldTitle:t,elementId:r,files:n,maxFilesCount:a,maxFileSize:o,maxMultiFilesSize:i,fileFormatError:l,fileCountError:d,fileSizeError:u,multiFilesSizeError:h,multiple:p=!0,acceptTypes:g,deleteAllButtonLabel:x,addButtonLabel:y,additionalActionButtons:v,...b})=>{const C=m.useRef(null),I=()=>C.current?.click(),S=()=>{e([])},w=m.useCallback(T=>T?.some(j=>!(g==="/"||g?.toLowerCase()?.includes(j?.type?.toLowerCase()))),[g]),N=m.useCallback(T=>{if(!o)return!1;const j=o*(1024*1024);return T?.some(D=>{const E=D.size;return!!E&&E>j})},[o]),L=m.useCallback(T=>{if(!i||!p)return!1;const j=i*1024*1024;return T.reduce((E,k)=>E+k.size,0)>j},[i,p]),A=m.useCallback(T=>{const j=T.target.files;if(j&&j.length>0){const D=Array.from(j),E=w(D),k=N(D);!E&&!k&&e([...n||[],...D])}},[w,N,e,n]);return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsxs("div",{className:"flex justify-between items-center pb-1 min-h-[42px]",children:[s.jsx(Fr,{label:`${t}: ${p?n?.length||0:""}`,htmlFor:r}),p&&!!n?.length&&s.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[s.jsx(jn,{label:x,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS}),onClick:S}),(a?a>n?.length:!0)&&s.jsx(Kr,{appearance:c.ButtonAppearance.Ghost,iconBefore:s.jsx(F.IconPlus,{...f.BASE_ICON_PROPS}),label:y,onClick:I}),v]})]}),n&&n.length>0&&s.jsx("input",{id:"file",type:"file",multiple:p,ref:C,hidden:!0,accept:g,onChange:A}),s.jsx(Gn,{files:n,onChange:e,acceptTypes:g,maxFilesCount:a,multiple:p,fileFormatError:l,fileCountError:d,fileSizeError:u,multiFilesSizeError:h,getIsFileFormatError:w,getIsFileSizeError:N,getIsMultiFilesSizeError:L,...b})]})};var Oe=(e=>(e.Row="Row",e.Column="Column",e))(Oe||{}),We=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(We||{}),it=(e=>(e.Info="info",e.Danger="danger",e))(it||{}),Un=(e=>(e.Normal="normal",e.Reverse="reverse",e))(Un||{}),Ae=(e=>(e.File="file",e.Folder="folder",e))(Ae||{}),Ct=(e=>(e.Left="left",e.Right="right",e))(Ct||{}),te=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e.Loading="loading",e.General="general",e))(te||{}),fe=(e=>(e.Toast="toast",e.SectionMessage="section-message",e))(fe||{});const Xr="data-editable-container",Bl={[Xr]:""};function zl({value:e,isEditing:t,isCreating:r,isLoading:n=!1,restoreOnCancel:a=!0,onValidate:o,onSave:i,onCancel:l,onCreateFolderSave:d,onCreateFolderCancel:u}){const[h,p]=m.useState(e),[g,x]=m.useState(!1),[y,v]=m.useState(""),b=m.useRef(null),C=m.useRef(!1),I=m.useRef(!1),S=m.useCallback((j=!1,D="")=>{x(j),v(D)},[]),w=m.useCallback(j=>{if(!o)return S(),!0;const D=o(j);return D?D.startsWith(`${te.Warning}__`)?(S(!1,D),!0):(S(!0,D),!1):(S(),!0)},[o,S]),N=m.useCallback(j=>{const D=j??"";p(D),w(D)},[w]),L=m.useCallback(j=>{r&&!C.current&&!n?d?.(j):!r&&t&&i?.(j),C.current=!1},[i,d,r,t,n]),A=m.useCallback(()=>{a&&p(e),r?u?.():l?.(),C.current=!0,S()},[e,l,a,S,u,r]),T=m.useCallback(()=>{if(!I.current){if(I.current=!0,w(h)){L(h);return}!r&&w(e)?(p(e),S(),L(e)):A()}},[w,h,e,L,A,S,r]);return m.useEffect(()=>{!t&&!r||(C.current=!1,I.current=!1,p(e),S(),requestAnimationFrame(()=>{b.current?.focus(),b.current?.select()}))},[t,r,e,S]),m.useEffect(()=>{const j=b.current;if(!t&&!r||!j)return;const D=E=>{E.key==="Enter"?(E.preventDefault(),b.current?.blur()):E.key==="Escape"&&(E.preventDefault(),A())};return j.addEventListener("keydown",D),()=>j.removeEventListener("keydown",D)},[t,r,A]),m.useEffect(()=>{if(!t&&!r||n)return;const j=b.current;if(!j)return;const D=P=>P?(j.closest(`[${Xr}]`)??j).contains(P):!1,E=P=>{D(P.target)||T()},k=P=>{D(P.relatedTarget)||T()};return document.addEventListener("pointerdown",E,!0),j.addEventListener("blur",k),()=>{document.removeEventListener("pointerdown",E,!0),j.removeEventListener("blur",k)}},[t,r,n,T]),{inputRef:b,value:h,onChange:N,invalid:g,invalidMessage:y}}var be=(e=>(e.VALID="valid",e.ERROR="error",e))(be||{}),ze=(e=>(e.ITEM="item",e.FOLDER="folder",e))(ze||{}),Qr=(e=>(e.FILE="FILE",e.PROMPT="PROMPT",e.CONVERSATION="CONVERSATION",e.APPLICATION="APPLICATION",e.TOOLSET="TOOL_SET",e))(Qr||{}),Zn=(e=>(e.READ="READ",e.WRITE="WRITE",e.SHARE="SHARE",e))(Zn||{});const Fl="application/octet-stream";function Hl(e,t){if(!e||e.length===0)return[];const r=e.find(d=>d.parentPath===""&&d.nodeType==="FOLDER");if(!r)return[];const n=r.path||r.url||"",a=br(n,!0),o=e.filter(d=>d!==r).map(d=>{const u=d.path||d.url||"",h=$l(d.nodeType),p=h===ze.FOLDER,g=br(u,p);let x;return d.parentPath===null||d.parentPath===void 0?x=a:d.parentPath===""?x="":x=br(d.parentPath,!0),{...d,originalPath:u,path:g,parentPath:x,nodeType:h}}),i=new Map;o.forEach(d=>{const u={...d,id:d.originalPath,name:d.name,path:d.path,parentPath:d.parentPath,nodeType:d.nodeType,resourceType:Kl(d.resourceType),folderId:t,updatedAt:d.updatedAt?new Date(d.updatedAt).toISOString():new Date().toISOString(),items:d.nodeType===ze.FOLDER?[]:void 0};d.nodeType===ze.ITEM&&(u.extension=Vl(d.name),u.contentType=d.contentType||Fl,u.contentLength=d.contentLength||0),i.set(d.path,u)});const l=[];return i.forEach(d=>{if(d.parentPath===a)l.push(d);else{const u=d.path.lastIndexOf(d.name||""),h=d.path.slice(0,u),p=i.get(h);p&&p.nodeType===ze.FOLDER?(p.items=p.items||[],p.items.push(d)):l.push(d)}}),l}function br(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 $l(e){return e.toUpperCase()==="FOLDER"?ze.FOLDER:ze.ITEM}function Kl(e){if(!e)return;const t=e.toUpperCase();return Object.values(Qr).find(n=>n.toUpperCase()===t)}function Vl(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function Wl(e,t="Prompts",r="prompts/public/",n="root"){const a=Hl(e,n);return[{id:n,name:t,path:r,parentPath:"",nodeType:ze.FOLDER,folderId:n,items:a}]}const qn=({locale:e,timeZone:t,date:r=new Date}={})=>{const n=t??Intl.DateTimeFormat().resolvedOptions().timeZone;try{const a=new Intl.DateTimeFormat(e,{timeZone:n,timeZoneName:"longOffset"}).formatToParts(r).find(o=>o.type==="timeZoneName")?.value;return a?`(${a}) ${n}`:n}catch{return n}},Yn=':;,=/{}%&\\"',Jr=`(\r
3
3
  |
4
4
  |\r| )|[\0-]`,Gl=`[${Yn.replace(/\\/g,"\\\\")}]`,Ul=new RegExp(`${Gl}|${Jr}`),Zl=new RegExp(Jr);var nt=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(nt||{}),or=(e=>(e.Select="select",e.Radio="radio",e))(or||{}),ir=(e=>(e.Row="row",e.Column="column",e))(ir||{}),$=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))($||{});const ql={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"};function Es(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 X(e,t,r=0){if(r>10)return e;let n=e;if(n.$ref){const a=n.$ref.replace(/^#\//,"").split("/");let o=t;for(const h of a)o=o?.[h];if(!o||typeof o!="object")return e;const{$ref:i,...l}=n,d=o;n={...d.$ref?X(d,t,r+1):d,...l}}if(n.allOf&&n.allOf.length>0){const{allOf:a,...o}=n;let i={};for(const l of a)i=Es(i,X(l,t,r+1));n=Es(i,o)}return n}function Xn(e){return e.map((t,r)=>({entry:t,index:r})).sort((t,r)=>{const n=t.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0,a=r.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0;return n!==a?n-a:t.index-r.index}).map(({entry:t})=>t)}function lr(e){return e==null||e===""}function Ye(e){return e.type===$.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function Zt(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}const es=e=>`"${e}" is required`;function Qn(e,t){return e.type===$.Null?"null":e.$ref?X(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 He(e,t,r=0){if(r>15)return;const n=X(e,t);if("default"in n)return n.default;if(n.discriminator&&n.oneOf){const a=Object.keys(n.discriminator.mapping)[0];if(a){const o=X({$ref:n.discriminator.mapping[a]},t);return{...He(o,t,r+1)??{},[n.discriminator.propertyName]:a}}}if(Ye(n)){if(n.properties){const a={};let o=!1;for(const[i,l]of Object.entries(n.properties)){const d=He(l,t,r+1);d!==void 0&&(a[i]=d,o=!0)}return o?a:void 0}if(n.additionalProperties!=null&&n.additionalProperties!==!1)return{}}}function Be(e,t,r,n="",a=0){if(a>15)return[];const o=[],i=X(t,r);if(i.anyOf){const u=i.anyOf.filter(h=>h.type!==$.Null);return e!=null&&u.length===1?Be(e,u[0],r,n,a+1):o}if(i.oneOf&&i.discriminator){const u=i.discriminator.propertyName,h=e?.[u];if(h&&i.discriminator.mapping[h]){const p={$ref:i.discriminator.mapping[h]},g=X(p,r);return Be(e,g,r,n,a+1)}return o}if(i.type===$.Array||!i.type&&Array.isArray(e)){if(Array.isArray(e)&&i.items)for(let u=0;u<e.length;u++){const h=Be(e[u],i.items,r,`${n}[${u}]`,a+1);o.push(...h)}return o}if(!Ye(i))return o;const l=i.required??[],d=e;for(const u of l){const h=i.properties?.[u];if(h&&X(h,r).isHidden)continue;const p=n?`${n}.${u}`:u,g=d?.[u];if(lr(g)){const x=h?.title??Zt(u);o.push({path:p,message:es(x)})}}if(d&&i.properties)for(const[u,h]of Object.entries(i.properties)){if(X(h,r).isHidden)continue;const p=n?`${n}.${u}`:u,g=d[u];if(g!=null){const x=Be(g,h,r,p,a+1);o.push(...x)}}if(d&&i.additionalProperties!=null&&i.additionalProperties!==!1&&typeof i.additionalProperties=="object"){const u=i.additionalProperties;for(const[h,p]of Object.entries(d)){const g=n?`${n}.${h}`:h,x=Be(p,u,r,g,a+1);o.push(...x)}}return o}function ts(e,t,r){const n=X(t,r);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(Ye(n)&&n.properties){const a=Object.entries(n.properties).filter(([,d])=>!X(d,r).isHidden),o=a.length,i=e;return`${a.filter(([d])=>{const u=i?.[d];return u!=null&&u!==""}).length}/${o} fields`}return""}function Yl(e,t,r){if(e==null){const n=t.findIndex(a=>a.type===$.Null);return n>=0?n:0}if(Array.isArray(e)){const n=t.findIndex(a=>X(a,r).type===$.Array);return n>=0?n:0}if(typeof e=="boolean"){const n=t.findIndex(a=>X(a,r).type===$.Boolean);return n>=0?n:0}if(typeof e=="number"){const n=t.findIndex(a=>{const o=X(a,r);return o.type===$.Number||o.type===$.Integer});return n>=0?n:0}if(typeof e=="string"){const n=t.findIndex(a=>X(a,r).type===$.String);return n>=0?n:0}if(typeof e=="object"){const n=e;for(let a=0;a<t.length;a++){const o=X(t[a],r);if(o.discriminator&&o.discriminator.propertyName in n)return a}for(let a=0;a<t.length;a++){const o=X(t[a],r);if(Ye(o)||o.oneOf)return a}return 0}return 0}function Xl(e,t,r){if(t&&typeof e=="object"&&e!==null){const n=e[t];if(n)return`Item ${r+1}: ${n}`}if(typeof e=="object"&&e!==null){const n=e,a=n.name??n.title??n.id;if(a)return`Item ${r+1}: ${a}`}return`Item ${r+1}`}function Jn(e){switch(Array.isArray(e.type)?e.type[0]:e.type){case $.String:return"";case $.Boolean:return!1;case $.Array:return[];case $.Integer:case $.Number:return;default:return{}}}const Ql=[$.String,$.Number,$.Boolean,$.Null,$.Object,$.Array];function Jl(e){return Array.isArray(e)?$.Array:typeof e=="object"&&e!==null?$.Object:typeof e=="boolean"?$.Boolean:typeof e=="number"?$.Number:e===null?$.Null:$.String}const ec={[$.String]:"",[$.Number]:0,[$.Boolean]:!1,[$.Null]:null,[$.Object]:{},[$.Array]:[]};function tc(e){return ec[e]}const ea=m.createContext(null),ke=()=>{const e=m.useContext(ea);if(!e)throw new Error("useSchemaContext must be used inside SchemaRenderer");return e},It=(e,t=new Set,r=!1,n=!1)=>{if(!r||t.has(e))return!0;if(!n)return!1;const a=e+".";return[...t].some(o=>o.startsWith(a))},ta=({availableWidth:e,tagWidths:t,overflowChipWidth:r,gap:n})=>{if(e<=0)return t.length;let a=0,o=0;for(const i of t){const l=i+n;if(a+l>e)break;a+=l,o++}if(o===t.length)return o;for(;o>0&&a+r>e;)o--,a-=t[o]+n;return o};var je=(e=>(e.Outlined="outlined",e.Selectable="selectable",e.Bordered="bordered",e))(je||{});const rc="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",sc={[je.Outlined]:"dial-tiny-text",[je.Selectable]:"dial-tiny-text",[je.Bordered]:"h-[24px] rounded-md border px-2 dial-small-text"},nc={[je.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[je.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"},[je.Bordered]:{default:"border-tertiary bg-layer-sunken text-primary",selected:"border-accent bg-control-accent-alpha text-primary"}},ac="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",oc="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Le=({label:e,icon:t,appearance:r=je.Outlined,selected:n=!1,disabled:a=!1,closable:o=!1,removeLabel:i,className:l,title:d,onClick:u,onRemove:h,onKeyDown:p,...g})=>{const x=r===je.Selectable,y=!!u&&!a,v=o&&!!h&&!a,b=x&&n,C=I=>{p?.(I),!(!y||I.defaultPrevented)&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),I.currentTarget.click())};return s.jsxs("span",{...g,role:y?"button":g.role,tabIndex:y?0:g.tabIndex,"aria-disabled":a||void 0,"aria-pressed":x&&y?n:void 0,onClick:a?void 0:u,onKeyDown:C,className:f.mergeClasses(rc,b?"dial-tiny-semi-text":sc[r],nc[r][n?"selected":"default"],a&&"cursor-not-allowed",y&&[ac,oc],l,c.DIAL_KIT_CLASS.tag),children:[t&&s.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),s.jsx("span",{className:"truncate",title:d??e,children:e}),v&&s.jsx(c.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:c.ElementSize.Small,"aria-label":i??`Remove ${e}`,icon:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:I=>{I.stopPropagation(),h?.(I)}})]})},qt="h-[24px] max-w-full rounded-md border border-secondary bg-layer-sunken px-2",yt=({options:e,selectedValues:t,handleRemoveTag:r,tagClassName:n})=>s.jsx(s.Fragment,{children:t.map(a=>{const o=e.find(i=>i.value===a);return s.jsx(Le,{label:o?.label??a,closable:!!r,onRemove:i=>r?.(i,a),icon:o?.icon,className:f.mergeClasses(qt,n)},a)})}),ic=8,lc=e=>e.stopPropagation(),cc=e=>{e.key!=="Escape"&&e.stopPropagation()},dc=({options:e,selectedValues:t,handleRemoveTag:r})=>{const n=m.useRef(null),a=m.useRef(null),[o,i]=m.useState(null),l=m.useCallback(()=>{const p=n.current,g=a.current;if(!p||!g)return;const x=Array.from(g.children,v=>v.offsetWidth),y=x.pop()??0;i(ta({tagWidths:x,overflowChipWidth:y,availableWidth:p.clientWidth,gap:ic}))},[]);m.useLayoutEffect(()=>{l()},[l,e,t]),m.useLayoutEffect(()=>{const p=n.current;return p?c.observeElementSize(p,l):void 0},[l]);const d=o??t.length,u=t.slice(0,d),h=t.slice(d);return s.jsxs("div",{ref:n,className:"relative flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:[s.jsx(yt,{options:e,selectedValues:u,handleRemoveTag:r,tagClassName:"min-w-0"}),h.length>0&&s.jsx(c.InteractiveTooltip,{asChild:!0,placement:c.TooltipPlacement.Bottom,content:s.jsx("div",{className:"flex flex-wrap gap-2",onClick:lc,onKeyDown:cc,children:s.jsx(yt,{options:e,selectedValues:h,handleRemoveTag:r})}),children:s.jsx(Le,{label:`+${h.length}`,role:"button",tabIndex:0,"aria-haspopup":"true","aria-label":`${h.length} more selected: ${h.map(p=>e.find(g=>g.value===p)?.label??p).join(", ")}`,title:"",className:f.mergeClasses(qt,"shrink-0")})}),s.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:[s.jsx(yt,{options:e,selectedValues:t,handleRemoveTag:r,tagClassName:"shrink-0"}),s.jsx(Le,{label:`+${t.length}`,className:f.mergeClasses(qt,"shrink-0")})]})]})},uc=f.mergeClasses("w-full flex flex-col"),fc=c.overlayItemClassName,pc="!max-w-[var(--reference-width)]",hc=f.mergeClasses("max-h-[344px] overflow-y-auto py-1",c.overlayListClassName),mc=c.overlayGap,gc=c.overlaySubMenuListClassName,xc=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),bc="text-secondary transition-transform",vc=8,yc=s.jsx(F.IconSearch,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Cc=s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Ic=({opt:e,selectedValues:t,mark:r=c.MenuItemMark.Tint,onSelect:n})=>{const{isOpen:a,nodeId:o,refs:i,floatingStyles:l,context:d,getReferenceProps:u,getFloatingProps:h}=c.useSubMenuFloating(mc,"listbox",!!e.disabled),p=e.children?.some(x=>t.includes(x.value)),g=s.jsx(c.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:xc,...u()});return s.jsxs(B.FloatingNode,{id:o,children:[e.interactiveTooltip?s.jsx(c.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:g}):g,a&&s.jsx(c.SubMenuPanel,{refs:i,floatingStyles:l,context:d,getFloatingProps:h,role:"listbox",surfaceClassName:gc,children:e.children.map(x=>{const y=s.jsx(c.MenuItem,{role:"option","aria-selected":t.includes(x.value),"aria-disabled":!!x.disabled,disabled:x.disabled,mark:r,selected:t.includes(x.value),ellipsisLabel:!0,icon:x.icon,label:x.labelNode??x.label,rightControl:x.rightControl,onClick:()=>!x.disabled&&n(x.value)});return s.jsx(m.Fragment,{children:x.interactiveTooltip?s.jsx(c.InteractiveTooltip,{asChild:!0,placement:x.interactiveTooltip.placement,content:x.interactiveTooltip.content,contentClassName:x.interactiveTooltip.contentClassName,children:y}):y},x.value)})})]})},$e=({options:e,multiple:t=!1,id:r,value:n,defaultValue:a,size:o=c.ElementSize.Standard,prefix:i,customSelectedValue:l,placeholder:d="Select...",labelProps:u,error:h,caption:p,ariaLabel:g,ariaDescribedBy:x,searchable:y=!1,searchSize:v=c.ElementSize.Standard,searchPlaceholder:b,selectAll:C=!1,invalid:I,selectAllLabel:S="Select all",collapseTagOverflow:w=!1,selectedOptionMark:N=c.MenuItemMark.Tint,emptyStateTitle:L="No options available",emptyStateDescription:A,emptyStateIcon:T,disabled:j=!1,className:D,fieldClassName:E,listClassName:k,closable:P=!1,header:O,footer:R,onClose:M,onChange:H,dismissRef:W,onFooterClick:K,open:V,onOpenChange:G,onSearchQueryChange:J,customMultiSelectTagsRenderer:re})=>{const q=m.useId(),Y=r||q,se=`list-${Y}`,le=h?`${Y}-error`:void 0,oe=!h&&p?`${Y}-caption`:void 0,me=o===c.ElementSize.Small,[ve,_]=m.useState(!1),U=V!==void 0,de=U?!!V:ve,ne=m.useCallback(z=>{U||_(z),G?.(z)},[U,G]),[ge,Qe]=m.useState(""),ft=m.useCallback(z=>{z!==ge&&(Qe(z||""),J?.(z||""))},[J,ge]),pt=n!==void 0,[Q,ce]=m.useState(a),he=pt?n:Q,ue=m.useMemo(()=>t?Array.isArray(he)?he:[]:typeof he=="string"?[he]:[],[he,t]),Et=m.useMemo(()=>{const z=ge.trim().toLowerCase();return z?e.filter(ae=>ae.label.toLowerCase().includes(z)):e},[e,ge]);m.useEffect(()=>{de||ft("")},[de,ft]);const Re=m.useCallback(z=>{pt||ce(z),H?.(z)},[pt,H]),cr=m.useCallback(z=>{if(t){const ae=new Set(ue);ae.has(z)?ae.delete(z):ae.add(z),Re(Array.from(ae));return}Re(z),ne(!1)},[t,Re,ne,ue]),Lt=m.useCallback((z,ae)=>{if(z.stopPropagation(),!t){Re("");return}const _t=ue.filter(Ba=>Ba!==ae);Re(_t)},[t,ue,Re]),De=m.useMemo(()=>Et.filter(z=>!z.disabled),[Et]),dr=m.useMemo(()=>De.filter(z=>ue.includes(z.value)).length,[De,ue]),{allSelectedInFiltered:ur,someSelectedInFiltered:La}=m.useMemo(()=>{const z=De.length>0&&dr===De.length;return{allSelectedInFiltered:z,someSelectedInFiltered:dr>0&&!z}},[De,dr]),Aa=m.useCallback(()=>{if(!(!t||De.length===0))if(ur){const z=new Set(De.map(ae=>ae.value));Re(ue.filter(ae=>!z.has(ae)))}else{const z=new Set(ue);De.forEach(ae=>z.add(ae.value)),Re(Array.from(z))}},[ur,t,De,ue,Re]),At=ue.length>0,Ot=!t&&At?ue[0]:void 0,Se=m.useMemo(()=>Ot?e.find(z=>z.value===Ot)??e.flatMap(z=>z.children??[]).find(z=>z.value===Ot):void 0,[e,Ot]),ht=Se?i?`${i} ${Se.label}`:Se.label:void 0,Oa=c.useIsMobileScreen(),fr=t&&w&&!re&&!Oa,mt=m.useMemo(()=>t?At?fr?s.jsx(dc,{options:e,selectedValues:ue,handleRemoveTag:Lt}):s.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",children:re?.(e,ue,Lt)??s.jsx(yt,{options:e,selectedValues:ue,handleRemoveTag:Lt})}):null:!Se||!Se.labelNode&&!Se.description?null:s.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[s.jsx(c.EllipsisTooltip,{text:Se.labelNode??ht}),Se.description&&s.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:Se.description})]}),[fr,re,Lt,At,t,e,ht,ue,Se]),_a=t||mt?"":ht||(l&&n?l:""),ka=typeof u?.label=="string"?u.label:void 0,Ra=mt?[c.resolveAccessibleName(g,ka),t?ue.map(z=>e.find(ae=>ae.value===z)?.label??z).join(", "):ht].filter(Boolean).join(", ")||void 0:c.resolveAccessibleName(g);m.useImperativeHandle(W,()=>({dismiss:()=>{ne(!1)}}));const Ma=m.useCallback(z=>{j||(z.key==="ArrowDown"||z.key==="ArrowUp")&&(z.preventDefault(),de||ne(!0))},[j,de,ne]),Pa=()=>s.jsxs("div",{id:se,role:"listbox","aria-multiselectable":t||void 0,className:uc,children:[O&&s.jsx(s.Fragment,{children:typeof O=="function"?O():O}),(y||P)&&(e.length>vc||!!ge)&&s.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[y&&s.jsx(c.Input,{id:`search-${Y}`,size:v,placeholder:b,"aria-label":b||"Search options",onChange:z=>ft(z),value:ge,iconBefore:yc,containerClassName:"w-full"}),P&&s.jsx(c.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:c.ElementSize.Small,icon:Cc,onClick:z=>{M?.(z),ne(!1)}})]}),t&&C&&De.length>0&&s.jsx("div",{className:f.mergeClasses(fc,"mt-2"),children:s.jsx(c.Checkbox,{id:`${Y}-selectAll`,labelProps:{label:S},isSelected:ur,isIndeterminate:La,onChange:Aa})}),s.jsx("div",{role:"none",className:hc,children:Et.length===0?s.jsx("div",{className:"px-2 py-3",children:s.jsx(c.NoDataContent,{icon:T,title:L,description:A})}):Et.map(z=>{const ae=ue.includes(z.value);if(z.children?.length)return s.jsx(Ic,{opt:z,selectedValues:ue,mark:t?c.MenuItemMark.Checkbox:N,onSelect:cr},z.value);const _t=t?s.jsx(c.MenuItem,{id:`${Y}-${z.value}`,role:"option","aria-selected":ae,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:c.MenuItemMark.Checkbox,selected:ae,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>cr(z.value)}):s.jsx(c.MenuItem,{role:"option","aria-selected":ae,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:N,selected:ae,ellipsisLabel:!0,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>!z.disabled&&cr(z.value)});return s.jsx(m.Fragment,{children:z.interactiveTooltip?s.jsx(c.InteractiveTooltip,{asChild:!0,placement:z.interactiveTooltip.placement,content:z.interactiveTooltip.content,contentClassName:z.interactiveTooltip.contentClassName,children:_t}):_t},z.value)})}),R&&s.jsx("div",{onClick:z=>{K?.(z),K&&ne(!1)},children:typeof R=="function"?R():R})]});return s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-2",D,c.DIAL_KIT_CLASS.select),children:[u&&s.jsx(c.Label,{...u,htmlFor:Y}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(c.Dropdown,{open:de,onOpenChange:ne,disabled:j,closable:P,onClose:M,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:f.mergeClasses(pc,k),className:"w-full",renderOverlay:Pa,children:s.jsx(c.Input,{id:Y,size:o,disabled:j,invalid:I,value:_a,placeholder:mt?void 0:d,readOnly:!0,iconBefore:t?void 0:Se?.icon,iconAfter:s.jsx(F.IconChevronDown,{size:me?f.DIAL_ICON_SIZE.SM:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses(bc,de&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":de,"aria-controls":se,"aria-autocomplete":"none","aria-label":Ra,"aria-describedby":[x,le,oe].filter(Boolean).join(" ")||void 0,"aria-invalid":h||I?!0:void 0,containerClassName:"w-full",wrapperClassName:f.mergeClasses(!j&&"cursor-pointer",t&&At&&!fr&&["!h-auto flex-wrap py-2",me?"min-h-[24px]":"min-h-[40px]"],E),className:f.mergeClasses("cursor-pointer",mt&&"w-0 min-w-0 flex-none p-0"),onKeyDown:Ma,children:mt})}),s.jsx(c.ErrorText,{id:le,text:h}),!h&&s.jsx(c.CaptionText,{id:oe,text:p})]})]})},Ls={[$.Array]:[],[$.String]:"",[$.Boolean]:!1,[$.Integer]:0,[$.Number]:0},Sc=({schema:e,value:t,onChange:r,path:n,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:d=!1}=ke(),u=e.anyOf??[],h=Yl(t,u,i),p=u[h],g=!p||X(p,i).type===$.Null,x=y=>{const v=X(u[y],i);if(v.type===$.Null){r(null);return}const b=He(v,i);if(b!==void 0){r(b);return}const C=typeof v.type=="string"?v.type:"";r(C in Ls?Ls[C]:{})};return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx($e,{ariaLabel:o??l.selectTypePlaceholder,options:u.map((y,v)=>({value:String(v),label:Qn(y,i)})),value:String(h),disabled:d,onChange:y=>x(Number(typeof y=="string"?y:y[0])),className:"max-w-[280px]"}),!g&&s.jsx("div",{className:"border-l-2 border-tertiary pl-3",children:s.jsx(Ke,{schema:p,value:t,onChange:r,path:n,level:a,ariaLabel:o})})]})},Xe=({label:e,variant:t,appearance:r=c.ButtonAppearance.Solid,size:n=c.ElementSize.Standard,className:a,textClassName:o,iconAfter:i,iconBefore:l,type:d="button",tooltipProps:u,href:h,target:p,rel:g,disabled:x,...y})=>{const v=f.mergeClasses("dial-kit-base-button",t&&c.getButtonClassNames(t,r),n===c.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",n===c.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",n===c.ElementSize.Small&&"dial-kit-base-button-small",r!==c.ButtonAppearance.Link&&(n===c.ElementSize.Small?"px-2":"px-4"),n!==c.ElementSize.Small&&r!==c.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),b=e?void 0:u?.tooltip,C=c.resolveAccessibleName(typeof e=="string"?e:void 0,y["aria-label"],b),I=s.jsxs(s.Fragment,{children:[s.jsx(c.DialIcon,{icon:l}),e&&s.jsx("span",{className:o,children:e}),s.jsx(c.DialIcon,{icon:i})]}),S=y,w=h!==void 0?s.jsx("a",{...S,href:x?void 0:h,target:p,rel:g??(p==="_blank"?"noopener noreferrer":void 0),"aria-disabled":x||void 0,tabIndex:x?-1:S.tabIndex,onClick:x?void 0:S.onClick,className:v,"aria-label":C,children:I}):s.jsx("button",{...y,...c.getDisabledButtonProps(x,u,y.onClick),type:d,className:v,"aria-label":C,children:I});return u?s.jsx(c.Tooltip,{asChild:!0,...u,children:w}):w},rs=(e,t)=>({appearance:n,...a})=>s.jsx(Xe,{...a,variant:e,appearance:n||t}),ss=(e,t)=>({variant:n,...a})=>s.jsx(Xe,{...a,variant:n||t,appearance:e}),ra=rs(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),ns=rs(c.ButtonVariant.Neutral,c.ButtonAppearance.Solid),Nc=rs(c.ButtonVariant.Danger,c.ButtonAppearance.Solid),tt={x1:"-5.06",y1:"2.26",x2:"30.62",y2:"22.63",from:"var(--stroke-gradient-1, #5976E9)",to:"var(--stroke-gradient-2, #885DF2)"},wc=s.jsx(F.IconSparkles,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0}),jc=({appearance:e=c.ButtonAppearance.Outlined,iconBefore:t=wc,iconAfter:r,style:n,...a})=>{const o=`dial-kit-starter-gradient-${m.useId().replace(/[^\w-]/g,"")}`,i=s.jsx("svg",{className:"pointer-events-none absolute size-0 overflow-hidden","aria-hidden":"true",focusable:"false",children:s.jsx("defs",{children:s.jsxs("linearGradient",{id:o,x1:tt.x1,y1:tt.y1,x2:tt.x2,y2:tt.y2,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:tt.from}),s.jsx("stop",{offset:"1",stopColor:tt.to})]})})}),l=d=>s.jsxs(s.Fragment,{children:[i,d]});return s.jsx(Xe,{...a,variant:c.ButtonVariant.Starter,appearance:e,iconBefore:t?l(t):void 0,iconAfter:r&&!t?l(r):r,style:{"--dial-kit-starter-icon-stroke":`url(#${o})`,...n}})},Dc=ss(c.ButtonAppearance.Link,c.ButtonVariant.Primary),as=ss(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Tc=ss(c.ButtonAppearance.Outlined,c.ButtonVariant.Neutral),St=({title:e,description:t,summary:r,errorCount:n=0,level:a=0,children:o,onRemove:i,defaultExpanded:l=!0,removeItemAriaLabel:d="Remove item"})=>{const[u,h]=m.useState(l),p=m.useId(),g=a===0;return s.jsxs("div",{className:f.mergeClasses("flex flex-col border border-tertiary",g?"rounded-xl bg-layer-raised":"rounded-lg",c.DIAL_KIT_CLASS.schemaRendererSection),children:[s.jsxs("div",{className:f.mergeClasses("flex items-center gap-2",g?"px-4 py-3":"px-3 py-2"),children:[s.jsxs("button",{type:"button","aria-expanded":u,"aria-controls":u?p:void 0,onClick:()=>h(x=>!x),className:"flex min-w-0 flex-1 items-center gap-2 rounded text-left text-primary focus-visible:outline focus-visible:outline-focus",children:[s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses("shrink-0 text-secondary transition-transform",!u&&"-rotate-90")}),s.jsx("span",{className:f.mergeClasses("truncate",g?"dial-small-semi-text":"dial-small-text"),children:e})]}),s.jsx(c.InfoButton,{caption:t}),r&&s.jsx("span",{className:"dial-tiny-text whitespace-nowrap text-secondary",children:r}),n>0?s.jsxs("span",{className:"flex items-center gap-1 whitespace-nowrap dial-tiny-text text-error",children:[s.jsx(F.IconAlertTriangle,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"shrink-0"}),n," error",n>1?"s":""]}):s.jsx(F.IconCheck,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"shrink-0 text-success"}),i&&s.jsx(c.DangerIconButton,{size:c.ElementSize.Small,icon:s.jsx(F.IconTrash,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),"aria-label":d,onClick:i,className:"shrink-0"})]}),u&&s.jsx("div",{id:p,className:f.mergeClasses("border-t border-tertiary",g?"p-4":"p-3"),children:o})]})},Ec=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,defaultExpanded:d=!0}=ke(),[u,h]=m.useState(),p=Array.isArray(t)?t:[],g=e.items;if(!g)return s.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemSchema});const x=X(g,o),y=x.discriminator,v=y?Object.keys(y.mapping).map(w=>({value:w,label:w})):[],b=u??v[0]?.value,C=()=>{let w;if(y&&b){const N=X({$ref:y.mapping[b]},o);w={...He(N,o)??{},[y.propertyName]:b}}else w=He(x,o)??Jn(x);r([...p,w])},I=w=>{r(p.filter((N,L)=>L!==w))},S=(w,N)=>{r(p.map((L,A)=>A===w?N:L))};return s.jsxs("div",{className:"flex flex-col gap-3",children:[p.length===0&&s.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemsYet}),p.map((w,N)=>{const L=Xl(w,y?.propertyName,N),A=Be(w,x,o,`${n.join(".")}[${N}]`);return s.jsx(St,{title:L,level:a,summary:ts(w,x,o),errorCount:A.length,onRemove:l?void 0:()=>I(N),defaultExpanded:d,removeItemAriaLabel:`${i.removeItemAriaLabel}: ${L}`,children:s.jsx(Ke,{schema:g,value:w,onChange:T=>S(N,T),path:[...n,String(N)],level:a+1,ariaLabel:L})},N)}),!l&&s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[v.length>0&&s.jsx($e,{ariaLabel:i.selectTypeToAdd,options:v,value:b,placeholder:i.selectTypeToAdd,onChange:w=>h(typeof w=="string"?w:w[0]),className:"max-w-[280px] flex-1"}),s.jsx(as,{label:i.addItem,iconBefore:s.jsx(F.IconPlus,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:C})]})]})};var os=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(os||{});const As={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},Lc=e=>typeof e=="boolean"?As[e?"both":"none"]:As[e],sa=({className:e="",value:t,onChange:r,error:n,containerClassName:a,resize:o=!1,labelProps:i,caption:l,id:d,invalid:u,"aria-describedby":h,"aria-invalid":p,...g})=>{const x=m.useId(),y=d??x,v=n?`${y}-error`:void 0,b=!n&&l?`${y}-caption`:void 0,C=f.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",u&&"dial-kit-input-error",g.disabled&&"dial-kit-input-disable",Lc(o),e);return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-2",a),children:[i&&s.jsx(c.Label,{...i,htmlFor:y}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("textarea",{id:y,value:t||"",className:C,onChange:I=>r?.(I.currentTarget.value),"aria-describedby":[h,v,b].filter(Boolean).join(" ")||void 0,"aria-invalid":p??(n||u?!0:void 0),...g}),s.jsx(c.ErrorText,{id:v,text:n}),!n&&s.jsx(c.CaptionText,{id:b,text:l})]})]})},Os=e=>{try{return JSON.parse(e),!0}catch{return!1}},is=({value:e,onChange:t,id:r,ariaLabel:n})=>{const{readonly:a,texts:o}=ke(),[i,l]=m.useState(()=>JSON.stringify(e,null,2)??""),d=!Os(i),u=h=>{l(h),Os(h)&&t(JSON.parse(h))};return s.jsx(sa,{id:r,"aria-label":n,value:i,onChange:u,readOnly:a,invalid:d,error:d?o.invalidJsonError:void 0,spellCheck:!1,rows:10,resize:os.Vertical,className:"font-mono !whitespace-pre"})},Ac=/^0+\.(\d+)?$/,Oc=/^0+/,_c=[".","-","+","e","E"],_s=e=>!e||e==="-"?e:String(e).match(Ac)?String(e).replace(Oc,"0"):Number(e),ls=({integer:e,onChange:t,min:r,max:n,onKeyDown:a,onPaste:o,...i})=>{const l=u=>{if(e&&_c.includes(u.key)){u.preventDefault();return}c.handleKeyDown(u,"number",r,n),a?.(u)},d=u=>{if(e){const h=u.clipboardData.getData("text"),p=h.replace(/\D/g,"");if(p!==h&&(u.preventDefault(),p)){const g=u.currentTarget,x=g.selectionStart??0,y=g.selectionEnd??0,v=g.value.slice(0,x)+p+g.value.slice(y);t?.(_s(v))}}o?.(u)};return s.jsx(c.Input,{...i,wrapperClassName:f.mergeClasses(i.wrapperClassName,c.DIAL_KIT_CLASS.numberInput),type:"number",min:r,max:n,onChange:u=>t?.(_s(u)),onKeyDown:l,onPaste:d})},na=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:r,isToggleHidden:n,size:a=c.ElementSize.Standard,...o})=>{const[i,l]=m.useState(!1),d=!r&&!n,u=i&&d;return m.useEffect(()=>{d||l(!1)},[d]),s.jsx(c.Input,{...o,wrapperClassName:f.mergeClasses(o.wrapperClassName,c.DIAL_KIT_CLASS.passwordInput),size:a,disabled:r,type:u?"text":"password",iconAfter:d?s.jsx(c.GhostIconButton,{size:c.ElementSize.Small,"aria-label":u?t:e,"aria-pressed":u,icon:u?s.jsx(F.IconEyeOff,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):s.jsx(F.IconEye,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>l(h=>!h)}):void 0})},kc="flex flex-col gap-2",Rc="flex",Mc="mt-2 ml-[26px]",Pc={[Oe.Column]:"flex-col gap-y-3",[Oe.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},Nt=({items:e,value:t,onChange:r,name:n,id:a,orientation:o=Oe.Column,labelProps:i,disabled:l,error:d,caption:u,ariaLabel:h,className:p,optionsClassName:g,radioClassName:x,contentClassName:y})=>{const v=m.useId(),b=a??v,C=`${b}-label`,I=d?`${b}-error`:void 0,S=!d&&u?`${b}-caption`:void 0,w=c.resolveAccessibleName(i?.label);return s.jsxs("div",{className:f.mergeClasses(kc,p,c.DIAL_KIT_CLASS.radioGroup),children:[i&&s.jsx(c.Label,{...i,id:C}),s.jsx("div",{role:"radiogroup","aria-labelledby":w?C:void 0,"aria-label":w?void 0:c.resolveAccessibleName(h),"aria-describedby":[I,S].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:f.mergeClasses(Rc,Pc[o],g),children:e.map(N=>{const L=N.value===t;return s.jsxs("div",{className:"flex min-w-0 flex-col",children:[s.jsx(c.Radio,{id:`${b}-${N.value}`,name:n??b,value:N.value,labelProps:N.label==null?void 0:{label:N.label},"aria-label":N["aria-label"],caption:N.caption,isSelected:L,disabled:l||N.disabled,onChange:r,className:x}),L&&N.content?s.jsx("div",{className:f.mergeClasses(Mc,y),children:N.content}):null]},N.value)})}),s.jsx(c.ErrorText,{id:I,text:d}),!d&&s.jsx(c.CaptionText,{id:S,text:u})]})},aa=({id:e,labelProps:t,isOn:r=!1,disabled:n,onChange:a,caption:o,className:i,...l})=>{const d=m.useId(),u=e??d,h=o?`${u}-caption`:void 0,p=m.useCallback(g=>{a?.(g.target.checked)},[a]);return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:f.mergeClasses("group/choice flex items-center gap-2",i,c.DIAL_KIT_CLASS.switch),children:[s.jsx("input",{...l,type:"checkbox",role:"switch",id:u,checked:r,"aria-checked":r,disabled:n,onChange:p,"aria-label":c.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":h,className:"peer sr-only"}),s.jsx("label",{htmlFor:u,className:f.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",n?"cursor-not-allowed bg-control-disable-primary":f.mergeClasses("cursor-pointer",r?"bg-control-accent group-has-[label:hover]/choice:bg-control-accent-hover":"bg-control-neutral-default group-has-[label:hover]/choice:bg-control-neutral-hover-strong")),children:s.jsx("span",{className:f.mergeClasses("size-3.5 shrink-0 rounded-full",n?"bg-control-disable-secondary":"bg-control-neutral")})}),t&&s.jsx(c.Label,{size:c.ElementSize.Standard,...t,htmlFor:u,className:f.mergeClasses("py-[1px]",n?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),o&&s.jsx("span",{id:h,className:"dial-tiny-text text-secondary ml-[44px]",children:o})]})},ks=e=>typeof e=="string"?e:e[0],vr=e=>e!=null?String(e):"",Bc=e=>e!==void 0?Number(e):void 0,oa=({schema:e,value:t,onChange:r,invalid:n,id:a,ariaLabel:o,ariaDescribedBy:i})=>{const{texts:l,readonly:d=!1,inputClassName:u,acceptableResourceTypes:h}=ke(),p=e.const!==void 0,g=Array.isArray(e.enum)?e.enum:[],x=g.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===$.String||e.type===void 0)){const v=(e.acceptableResourceTypes??[]).flatMap(b=>{const C=h?.[b];return Array.isArray(C)?C.map(I=>{const S=String(I);return{value:S,label:S}}):[]});return s.jsx($e,{id:a,ariaLabel:o,ariaDescribedBy:i,options:v,value:t!=null?String(t):void 0,invalid:n,disabled:d,onChange:b=>r(ks(b)),placeholder:l.enumSelectPlaceholder,className:u})}if(p)return s.jsx(c.Input,{id:a,"aria-label":o,value:String(e.const??""),disabled:!0,containerClassName:u});if(x&&e.enumDisplay===or.Radio)return s.jsx(Nt,{id:a,ariaLabel:o,items:g.map(v=>({value:String(v),label:String(v)})),value:t!=null?String(t):void 0,orientation:e.enumOrientation===ir.Row?Oe.Row:Oe.Column,disabled:d,onChange:v=>r(v)});if(x)return s.jsx($e,{id:a,ariaLabel:o,ariaDescribedBy:i,options:g.map(v=>({value:String(v),label:String(v)})),value:t!=null?String(t):void 0,invalid:n,disabled:d,onChange:v=>r(ks(v)),placeholder:l.enumSelectPlaceholder,className:u});switch(e.type){case $.Boolean:return s.jsx(aa,{id:a,"aria-label":o,isOn:!!t,disabled:d,onChange:v=>r(v)});case $.Integer:case $.Number:return s.jsx(ls,{id:a,"aria-label":o,"aria-describedby":i,integer:e.type===$.Integer,value:vr(t),invalid:n,disabled:d,onChange:v=>r(Bc(v)),placeholder:e.type===$.Integer?l.integerInputPlaceholder:l.numberInputPlaceholder,containerClassName:u});default:return e.isProtected?s.jsx(na,{id:a,"aria-label":o,"aria-describedby":i,value:vr(t),invalid:n,disabled:d,onChange:v=>r(v??void 0),placeholder:l.stringInputPlaceholder,containerClassName:u}):s.jsx(c.Input,{id:a,"aria-label":o,"aria-describedby":i,value:vr(t),invalid:n,disabled:d,onChange:v=>r(v??void 0),placeholder:l.stringInputPlaceholder,containerClassName:u})}},Rs=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),ia=e=>!!(e.oneOf||e.anyOf||e.type===$.Array||Ye(e)),zc={[$.String]:"entryTypeString",[$.Number]:"entryTypeNumber",[$.Boolean]:"entryTypeBoolean",[$.Null]:"entryTypeNull",[$.Object]:"entryTypeObject",[$.Array]:"entryTypeArray"},Ms=e=>typeof e=="string"?e:e[0],Fc=({pair:e,valueSchema:t,isUnschematizedValue:r,onKeyChange:n,onValueChange:a,onRemove:o,path:i,level:l})=>{const{rootSchema:d,texts:u,readonly:h=!1,inputClassName:p,defaultExpanded:g=!0,touchedPaths:x,markTouched:y,skipUntouched:v}=ke(),[b,C]=m.useState(e.key),[I,S]=m.useState(()=>Jl(e.value)),w=ia(t),N=r&&(I===$.Object||I===$.Array),L=r&&I===$.Null,A=r&&I===$.Boolean,T=w||N,j=[...i,e.id,"key"].join("."),D=It(j,x,v)&&e.key==="",E=e.key||u.valueColumnHeader,k=K=>{a(tc(K)),S(K)},P=m.useMemo(()=>Ql.map(K=>({value:K,label:u[zc[K]]})),[u]),O=m.useMemo(()=>[{value:"true",label:u.booleanTrueOption},{value:"false",label:u.booleanFalseOption}],[u]),R=()=>L?s.jsx(c.Input,{"aria-label":E,value:"null",disabled:!0}):A?s.jsx($e,{ariaLabel:E,options:O,value:e.value?"true":"false",disabled:h,onChange:K=>{const V=Ms(K);V&&a(V==="true")}}):s.jsx(oa,{schema:r?{type:I}:t,value:e.value,onChange:a,ariaLabel:E}),M=s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:T?"min-w-0 flex-1":"w-2/5 min-w-0",children:s.jsx(c.Input,{"aria-label":u.keyColumnHeader,value:b,disabled:h,invalid:D,error:D?`${u.keyColumnHeader} is required`:void 0,onChange:K=>C(K??""),onBlur:()=>{y?.(j),b!==e.key&&n(b)},placeholder:u.keyInputPlaceholder,containerClassName:p})}),!T&&s.jsx("div",{className:"min-w-0 flex-1",children:R()}),r&&s.jsx("div",{className:"w-28 shrink-0",children:s.jsx(c.Tooltip,{tooltip:u.entryTypeChangeWarning,triggerClassName:"block",children:s.jsx($e,{ariaLabel:u.typeColumnHeader,options:P,value:I,disabled:h,onChange:K=>{const V=Ms(K);V&&k(V)}})})}),!h&&s.jsx(c.DangerIconButton,{size:c.ElementSize.Small,icon:s.jsx(F.IconTrash,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),"aria-label":e.key?`${u.removeFieldAriaLabel}: ${e.key}`:u.removeFieldAriaLabel,onClick:o,className:"mt-2 shrink-0"})]});if(!T)return M;if(N)return s.jsxs("div",{className:"flex flex-col gap-2",children:[M,s.jsx(is,{value:e.value,onChange:a,ariaLabel:E},I)]});const H=[...i,e.key],W=Be(e.value,t,d,H.join("."));return s.jsxs("div",{className:"flex flex-col gap-2",children:[M,s.jsx(St,{title:e.key,level:l,summary:ts(e.value,t,d),errorCount:W.length+(D?1:0),defaultExpanded:g,children:s.jsx(Ke,{schema:t,value:e.value,onChange:a,path:H,level:l+1,ariaLabel:E})})]})},Hc=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1}=ke(),d=e.additionalProperties===!0||e.additionalProperties==null,u=!d&&typeof e.additionalProperties=="object"?X(e.additionalProperties,o):{type:$.String},h=ia(u),[p,g]=m.useState(()=>Object.entries(t??{}).map(([b,C])=>Rs(b,C))),x=b=>{g(b),r(Object.fromEntries(b.filter(C=>C.key!=="").map(C=>[C.key,C.value])))},y=(b,C)=>x(p.map((I,S)=>S===b?{...I,...C}:I)),v=()=>{const b=h?He(u,o)??Jn(u):"";g(C=>[...C,Rs("",b)])};return s.jsxs("div",{className:"flex flex-col gap-2",children:[p.length===0&&s.jsx("p",{className:"dial-small-text text-secondary",children:i.noFieldsYet}),p.length>0&&!h&&s.jsxs("div",{"aria-hidden":"true",className:"flex gap-2 pr-8",children:[s.jsx("span",{className:"w-2/5 dial-tiny-semi-text text-secondary",children:i.keyColumnHeader}),s.jsx("span",{className:"flex-1 dial-tiny-semi-text text-secondary",children:i.valueColumnHeader}),d&&s.jsx("span",{className:"w-28 shrink-0 dial-tiny-semi-text text-secondary",children:i.typeColumnHeader})]}),p.map((b,C)=>s.jsx(Fc,{pair:b,valueSchema:u,isUnschematizedValue:d,onKeyChange:I=>y(C,{key:I}),onValueChange:I=>y(C,{value:I}),onRemove:()=>x(p.filter((I,S)=>S!==C)),path:n,level:a},b.id)),!l&&s.jsx("div",{className:"pt-1",children:s.jsx(as,{label:i.addField,iconBefore:s.jsx(F.IconPlus,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:v})})]})},Or=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i}=ke(),l=X(e,o),d=Xn(Object.entries(l.properties??{}).filter(([,p])=>!X(p,o).isHidden)),u=l.required??[],h=t??{};return d.length===0?s.jsx("p",{className:"dial-small-text text-secondary",children:i.noConfigurableProperties}):s.jsx("div",{className:"flex flex-col gap-4",children:d.map(([p,g])=>{const x=X(g,o);return s.jsx(la,{schema:g,value:h[p],onChange:y=>r({...h,[p]:y}),path:[...n,p],level:a,required:u.includes(p),label:x.title??g.title??Zt(p)},p)})})},Ps=e=>typeof e=="string"?e:e[0],$c=(e,t)=>{const{[t]:r,...n}=e.properties??{};return{...e,properties:n}},Kc=({schema:e,value:t,onChange:r,path:n,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:d=!1}=ke(),u=m.useId(),h=o??l.selectTypePlaceholder,p=e.discriminatorDisplay===or.Radio,g=e.discriminator;if(g){const I=g.propertyName,S=g.mapping,w=T=>X({$ref:S[T]},i),N=typeof t=="object"&&t!==null?t[I]:void 0,L=N?w(N):void 0,A=T=>{const j=He(w(T),i)??{};r({...j,[I]:T})};if(p){const T=e.discriminatorOrientation===ir.Row,j=E=>s.jsx(Or,{schema:$c(E,I),value:t,onChange:r,path:n,level:a}),D=s.jsx(Nt,{id:u,ariaLabel:h,value:N,onChange:A,disabled:d,orientation:T?Oe.Row:Oe.Column,items:Object.keys(S).map(E=>{const k=w(E);return{value:E,label:k.title??E,content:T?void 0:j(k)}})});return T?s.jsxs("div",{className:"flex flex-col gap-3",children:[D,L&&j(L)]}):D}return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx($e,{ariaLabel:h,options:Object.keys(S).map(T=>({value:T,label:T})),value:N,placeholder:l.selectTypePlaceholder,disabled:d,onChange:T=>{const j=Ps(T);j&&A(j)},className:"max-w-[280px]"}),L&&s.jsx("div",{className:"pl-3",children:s.jsx(Or,{schema:L,value:t,onChange:r,path:n,level:a})})]})}const x=e.oneOf??[],v=(()=>{if(typeof t!="object"||t===null||Array.isArray(t))return 0;const I=x.findIndex(S=>X(S,i).required?.every(w=>w in t));return I>=0?I:0})(),b=x[v],C=I=>{const S=He(X(x[I],i),i);r(S??null)};return p?s.jsx(Nt,{id:u,ariaLabel:h,value:String(v),onChange:I=>C(Number(I)),disabled:d,items:x.map((I,S)=>({value:String(S),label:Qn(I,i)??`Option ${S+1}`,content:s.jsx(Ke,{schema:X(I,i),value:t,onChange:r,path:n,level:a,ariaLabel:o})}))}):s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx($e,{ariaLabel:h,options:x.map((I,S)=>({value:String(S),label:X(I,i).title??`Option ${S+1}`})),value:String(v),disabled:d,onChange:I=>C(Number(Ps(I))),className:"max-w-[280px]"}),b&&s.jsx("div",{className:"border-l-2 border-tertiary pl-3",children:s.jsx(Ke,{schema:b,value:t,onChange:r,path:n,level:a,ariaLabel:o})})]})},Ke=({schema:e,value:t,onChange:r,path:n,level:a,required:o,suppressInlineError:i=!1,fieldId:l,ariaLabel:d,ariaDescribedBy:u})=>{const h=m.useId(),{rootSchema:p,renderField:g,markTouched:x,touchedPaths:y,skipUntouched:v}=ke(),b=X(e,p),C=n.join("."),I=N=>{x?.(C),r(N)},S={schema:b,value:t,onChange:I,path:n,level:a};let w;if(b.oneOf)w=s.jsx(Kc,{...S,ariaLabel:d});else if(b.anyOf&&b.type!==$.Object)w=s.jsx(Sc,{...S,ariaLabel:d});else if(Ye(b)){const N=b.additionalProperties!=null&&b.additionalProperties!==!1,L=!b.properties||Object.keys(b.properties).length===0;N&&L?w=s.jsx(Hc,{...S}):L&&b.additionalProperties!==!1?w=s.jsx(is,{value:t,onChange:I,id:l,ariaLabel:d}):w=s.jsx(Or,{...S})}else if(b.type===$.Array)w=s.jsx(Ec,{...S});else{const N=It(C,y,v)&&!!o&&lr(t),L=!i&&N?es(b.title??d??"Field"):void 0;w=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(oa,{schema:b,value:t,onChange:I,invalid:N,id:l,ariaLabel:d,ariaDescribedBy:L?h:u}),s.jsx(c.ErrorText,{id:h,text:L})]})}return g?g(n,b,w):w},la=({schema:e,value:t,onChange:r,path:n,level:a=0,required:o,label:i})=>{const l=m.useId(),{rootSchema:d,defaultExpanded:u=!0,touchedPaths:h,skipUntouched:p}=ke(),g=X(e,d),x=n.join(".");if(Ye(g)||g.type===$.Array){const v=Be(t,g,d,x),b=i??g.title??n[n.length-1]??"Section";return s.jsx(St,{title:b,description:g.description,level:a,summary:ts(t,g,d),errorCount:It(x,h,p,!0)?v.length:0,defaultExpanded:u,children:s.jsx(Ke,{schema:g,value:t,onChange:r,path:n,level:a+1,required:o,ariaLabel:b})})}const y=It(x,h,p)&&o&&lr(t)?es(i??"Field"):void 0;return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(c.Label,{htmlFor:l,label:i,required:o,caption:g.description}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(Ke,{schema:g,value:t,onChange:r,path:n,level:a,required:o,suppressInlineError:!0,fieldId:l,ariaLabel:i,ariaDescribedBy:y?`${l}-error`:void 0}),s.jsx(c.ErrorText,{id:`${l}-error`,text:y})]})]})},Bs="dial-small-semi-text text-primary",Vc=({schema:e,defaultValue:t,texts:r,className:n,readonly:a=!1,defaultExpanded:o=!0,inputClassName:i,variant:l=nt.Sections,onChange:d,onPropertyChange:u,onDefaultValues:h,renderField:p,skipUntouched:g=!1,acceptableResourceTypes:x})=>{const y=m.useMemo(()=>({...ql,...r}),[r]),v=m.useMemo(()=>t||(He(e,e)??{}),[]),[b,C]=m.useState(v),[I,S]=m.useState(()=>new Set),w=m.useCallback(D=>{S(E=>E.has(D)?E:new Set([...E,D]))},[]);m.useEffect(()=>{h?.(v)},[]);const N=(D,E)=>{const k={...b,[D]:E};C(k),d?.(k),u?.(D,E)},L=new Set(Object.keys(e.properties??{})),A=Object.keys(b).filter(D=>!L.has(D)),T=Xn(Object.entries(e.properties??{}).filter(([,D])=>!X(D,e).isHidden)),j=e.required??[];return s.jsx(ea.Provider,{value:{rootSchema:e,texts:y,readonly:a,defaultExpanded:o,inputClassName:i,acceptableResourceTypes:x,renderField:p,touchedPaths:I,markTouched:w,skipUntouched:g},children:s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-4",n,c.DIAL_KIT_CLASS.schemaRenderer),children:[T.map(([D,E])=>{const k=X(E,e),P=k.title??E.title??Zt(D),O=j.includes(D),R=b[D],M=K=>N(D,K);if(l===nt.Flat)return s.jsx(la,{schema:E,value:R,onChange:M,path:[D],level:0,required:O,label:P},D);if(l===nt.FlatSections)return s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsx("h2",{className:Bs,children:P}),s.jsx(Ke,{schema:E,value:R,onChange:M,path:[D],level:0,required:O,ariaLabel:P})]},D);const H=Be(R,k,e,D),W=O&&lr(R)?Math.max(H.length,1):H.length;return s.jsx(St,{title:P,description:k.description,level:0,defaultExpanded:o,errorCount:It(D,I,g,!0)?W:0,children:s.jsx(Ke,{schema:E,value:R,onChange:M,path:[D],level:1,required:O,ariaLabel:P})},D)}),A.map(D=>{const E=Zt(D),k=s.jsx(is,{value:b[D],onChange:P=>N(D,P),ariaLabel:E});return l===nt.Sections?s.jsx(St,{title:E,level:0,defaultExpanded:o,children:k},D):s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsx("h2",{className:Bs,children:E}),k]},D)})]})})},Wc=e=>({info:s.jsx(F.IconInfoCircleFilled,{size:e.size}),error:s.jsx(F.IconAlertCircleFilled,{size:e.size}),warning:s.jsx(F.IconAlertTriangleFilled,{size:e.size}),success:s.jsx(F.IconCircleCheckFilled,{size:e.size}),loading:s.jsx(Ve,{size:e.size}),general:s.jsx(F.IconCheck,{size:e.size,stroke:e.stroke})}),Gc={[te.Info]:"bg-info text-info",[te.Success]:"bg-success text-success",[te.Warning]:"bg-warning text-warning",[te.Error]:"bg-error text-error",[te.Loading]:"bg-layer-raised text-info",[te.General]:"bg-layer-sunken text-primary"},Uc={[te.Info]:"status",[te.Success]:"status",[te.Warning]:"alert",[te.Error]:"alert",[te.Loading]:"status",[te.General]:"status"},Zc="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",cs=({variant:e=te.Info,type:t=fe.Toast,title:r,message:n,action:a,className:o,iconSize:i=24,iconStroke:l=2,closable:d=!1,onClose:u,children:h,textClassName:p,...g})=>{const x=m.useMemo(()=>Wc({size:i,stroke:l})[e],[e,i,l]),y=p??(t===fe.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return s.jsxs("div",{role:Uc[e],...g,className:f.mergeClasses(Zc,Gc[e],t===fe.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===fe.SectionMessage&&e===te.Loading&&"border-secondary",o,c.DIAL_KIT_CLASS.notification),children:[s.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[s.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:s.jsx(c.DialIcon,{icon:x})}),r?s.jsxs("div",{className:f.mergeClasses("flex min-w-0 text-primary break-words",y),children:[s.jsx("div",{className:"dial-small-paragraph-semi-text min-w-0 break-words",children:r}),s.jsx("div",{className:"dial-small-paragraph-text min-w-0 break-words",children:n})]}):s.jsx("div",{className:"dial-small-paragraph-text min-w-0 text-primary break-words",children:n})]}),a!=null&&s.jsx("div",{className:"flex shrink-0 items-center",children:a}),h,d&&s.jsx(c.CloseButton,{className:"shrink-0 self-start",ariaLabel:"Close notification",onClose:v=>u?.(v)})]})},qc=({className:e,children:t,...r})=>s.jsx("article",{...r,className:f.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,c.DIAL_KIT_CLASS.cardShell),children:t}),dt=(e,t)=>({type:n,...a})=>s.jsx(cs,{...a,variant:e,type:n||t}),ut=(e,t)=>({variant:n,...a})=>s.jsx(cs,{...a,variant:n||t,type:e}),Yc=dt(te.Error,fe.Toast),Xc=dt(te.Info,fe.Toast),Qc=dt(te.Success,fe.Toast),Jc=dt(te.Warning,fe.Toast),ed=dt(te.Loading,fe.Toast),td=dt(te.General,fe.Toast),rd=ut(fe.SectionMessage,te.Error),sd=ut(fe.SectionMessage,te.Info),nd=ut(fe.SectionMessage,te.Success),ad=ut(fe.SectionMessage,te.Warning),od=ut(fe.SectionMessage,te.Loading),id=ut(fe.SectionMessage,te.General);var xe=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(xe||{});const ld="en-GB",cd={[xe.Date]:"Select date",[xe.DateTime]:"Select date and time",[xe.Time]:"--:--",[xe.Weekday]:"Select day"},ca="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-hidden transition-colors hover:border-accent-alpha focus-within:border-accent-focus",da="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",ua="!border-error",dd="z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",ud="z-floating rounded-lg bg-layer-raised p-2 shadow-md",fd="absolute end-2 top-1/2 flex size-8 -translate-y-1/2 items-center justify-center rounded-lg text-secondary hover:bg-control-accent-alpha-hover hover:text-primary focus:outline-hidden focus-visible:outline focus-visible:outline-focus disabled:cursor-not-allowed disabled:text-control-disable-primary disabled:hover:bg-transparent",pd="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-hidden focus-visible:outline focus-visible:outline-focus",hd="bg-control-accent text-control-permanent",md="text-accent dial-small-semi-text",gd="text-control-disable-primary",fa="text-secondary",xd=s.jsx(F.IconCalendar,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:fa}),zs={prev:s.jsx(F.IconChevronLeft,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},bd=(e,t)=>{const n=(new Date(e,t,1).getDay()+6)%7,a=new Date(e,t,1-n);return Array.from({length:42},(o,i)=>{const l=new Date(a);return l.setDate(a.getDate()+i),l})},Fs=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Hs=(e,t,r)=>{const n=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t){const a=new Date(t.getFullYear(),t.getMonth(),t.getDate());if(n<a)return!0}if(r){const a=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(n>a)return!0}return!1},vd=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),$s=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),yd=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),Rt=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,Ks=(e,t)=>{const[r,n]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,n||0,0,0),a},Cd=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),Id=e=>{const t=e.replace(/\D/g,"").slice(0,4);let r=t.slice(0,2);const n=t.slice(2,4);if(r.length===2&&(r=String(Math.min(Number(r),23)).padStart(2,"0")),n.length===0)return r;const a=String(Math.min(Number(n),59)).padStart(n.length,"0");return`${r}:${a}`},pa=5,ha=e=>e.charAt(0).toUpperCase()+e.slice(1),Sd=e=>Array.from({length:7},(t,r)=>{const n=new Date(Date.UTC(1970,0,pa+r));return ha(n.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),Nd=e=>Array.from({length:7},(t,r)=>{const n=new Date(Date.UTC(1970,0,pa+r));return{value:String(r+1),label:ha(n.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),wd=Array.from({length:24},(e,t)=>String(t).padStart(2,"0")),jd=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),Dd="flex w-full shrink-0 items-center justify-center rounded-lg px-3 py-2 dial-small-text text-primary hover:bg-control-accent-alpha-hover focus:outline-hidden focus-visible:outline focus-visible:outline-focus",Td="bg-control-accent text-control-permanent hover:bg-control-accent",Vs=({label:e,options:t,selected:r,onSelect:n})=>{const a=m.useRef(null);m.useEffect(()=>{const l=a.current,d=l?.querySelector('[aria-selected="true"]');!l||!d||(l.scrollTop=d.offsetTop-l.clientHeight/2+d.offsetHeight/2)},[]);const o=l=>{const d=Array.from(l.currentTarget.querySelectorAll("button")),u=d.indexOf(document.activeElement),h={ArrowDown:d[u+1],ArrowUp:d[u-1],Home:d[0],End:d[d.length-1]}[l.key];h&&(l.preventDefault(),h.focus())},i=r??t[0];return s.jsx("div",{ref:a,role:"listbox","aria-label":e,tabIndex:-1,className:"flex h-56 flex-1 flex-col gap-0.5 overflow-y-auto",onKeyDown:o,children:t.map(l=>s.jsx("button",{type:"button",role:"option","aria-selected":l===r,tabIndex:l===i?0:-1,className:f.mergeClasses(Dd,l===r&&Td),onClick:()=>n(l),children:l},l))})},Ed=({value:e,onSelect:t})=>{const[r,n]=m.useMemo(()=>{const a=/^(\d{2}):(\d{2})$/.exec(e);return a?[a[1],a[2]]:[void 0,void 0]},[e]);return s.jsxs("div",{className:"flex w-[168px] gap-1",children:[s.jsx(Vs,{label:"Hours",options:wd,selected:r,onSelect:a=>t(`${a}:${n??"00"}`,!1)}),s.jsx(Vs,{label:"Minutes",options:jd,selected:n,onSelect:a=>t(`${r??"00"}:${a}`,!0)})]})},Ws=({id:e,disabled:t,invalid:r,trigger:n,panelClassName:a,fieldClassName:o,panel:i,labelledBy:l,panelLabel:d})=>{const u=c.useThemeScope(),[h,p]=m.useState(!1),{refs:g,floatingStyles:x,context:y}=B.useFloating({open:h,onOpenChange:w=>p(t?!1:w),placement:"bottom-start",whileElementsMounted:B.autoUpdate,middleware:[B.offset(8),B.flip({padding:8}),B.shift({padding:8})]}),v=B.useClick(y,{enabled:!t}),b=B.useDismiss(y),C=B.useRole(y,{role:"dialog"}),{getReferenceProps:I,getFloatingProps:S}=B.useInteractions([v,b,C]);return s.jsxs(s.Fragment,{children:[s.jsx("div",{id:e,ref:g.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":h,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:f.mergeClasses(ca,"focus-visible:outline focus-visible:outline-focus",r&&ua,t&&da,o),...I(),children:n}),h&&s.jsx(B.FloatingPortal,{children:s.jsx(B.FloatingFocusManager,{context:y,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:g.setFloating,style:x,"aria-label":d,className:f.mergeClasses(dd,u,a),...S(),children:i(()=>p(!1))})})})]})},Gs=({id:e,value:t,onChange:r,onBlur:n,disabled:a,invalid:o,className:i,ariaLabel:l,placeholder:d="--:--",timezoneLabel:u,timezoneLabelClassName:h,picker:p=!1})=>{const[g,x]=m.useState(t),[y,v]=m.useState(!1),b=c.useThemeScope(),{refs:C,floatingStyles:I,context:S}=B.useFloating({open:y,onOpenChange:T=>v(a?!1:T),placement:"bottom-start",whileElementsMounted:B.autoUpdate,middleware:[B.offset(8),B.flip({padding:8}),B.shift({padding:8})]}),w=B.useDismiss(S),N=B.useRole(S,{role:"dialog"}),{getFloatingProps:L}=B.useInteractions([w,N]);m.useEffect(()=>{x(t)},[t]);const A=s.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":l,placeholder:d,disabled:a,value:g,onChange:T=>{const j=Id(T.target.value);x(j),Cd(j)&&r(j)},onBlur:n,className:f.mergeClasses(ca,o&&ua,a&&da,p&&"pe-12",i)});return!u&&!p?A:s.jsxs("div",{ref:p?C.setReference:void 0,className:"relative w-full",children:[A,u&&s.jsx("span",{className:f.mergeClasses("dial-small-paragraph-text pointer-events-none absolute end-4 top-1/2 -translate-y-1/2 truncate text-secondary",p&&"end-12",h),children:u}),p&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button","aria-label":"Choose time","aria-haspopup":"dialog","aria-expanded":y,disabled:a,className:fd,onClick:()=>v(T=>!T),children:s.jsx(F.IconClock,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),y&&s.jsx(B.FloatingPortal,{children:s.jsx(B.FloatingFocusManager,{context:S,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:C.setFloating,style:I,"aria-label":"Choose time",className:f.mergeClasses(ud,b),...L(),children:s.jsx(Ed,{value:g,onSelect:(T,j)=>{x(T),r(T),j&&v(!1)}})})})})]})]})},Ld=({mode:e=xe.Date,value:t,onChange:r,onBlur:n,labelProps:a,placeholder:o,disabled:i=!1,invalid:l=!1,id:d,className:u,minDate:h,maxDate:p,locale:g=ld,fieldClassName:x,showTimezone:y=!1,showTimePicker:v=!0})=>{const b=o??cd[e],C=t instanceof Date?t:null,I=m.useId(),S=d??I,w=a?.id??`${S}-label`,N=!!a?.label,L=typeof a?.label=="string"?a.label:void 0,A=N?`${w} ${S}`:void 0,T=a?s.jsx(c.Label,{...a,id:w,htmlFor:S}):null,[j,D]=m.useState(()=>C??new Date),E=m.useMemo(()=>new Date,[]),k=m.useMemo(()=>y?qn({locale:g}):null,[y,g]),P=m.useMemo(()=>Sd(g),[g]),O=m.useMemo(()=>Nd(g),[g]),R=m.useMemo(()=>bd(j.getFullYear(),j.getMonth()),[j]),M=V=>{D(G=>new Date(G.getFullYear(),G.getMonth()+V,1))},H=(V,G)=>{if(Hs(V,h,p))return;const J=e===xe.DateTime&&C?Ks(V,Rt(C)):V;r?.(J),e===xe.Date&&G()},W=V=>{r?.(Ks(C??new Date,V))},K=()=>C?e===xe.DateTime?`${$s(C,g)}, ${Rt(C)}`:$s(C,g):b;if(e===xe.Time){const V=typeof t=="string"?t:C?Rt(C):"";return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",u,c.DIAL_KIT_CLASS.calendar),children:[T,s.jsx(Gs,{id:S,value:V,onChange:G=>r?.(G),onBlur:n,disabled:i,invalid:l,placeholder:b,className:x,timezoneLabel:k,picker:v})]})}if(e===xe.Weekday){const V=typeof t=="string"?t:void 0,G=O.find(J=>J.value===V);return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",u,c.DIAL_KIT_CLASS.calendar),children:[T,s.jsx(Ws,{id:S,disabled:i,invalid:l,labelledBy:A,panelLabel:L??b,fieldClassName:x,trigger:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:f.mergeClasses("truncate",!G&&"text-secondary"),children:G?.label??b}),s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:fa})]}),panel:J=>s.jsx("div",{role:"listbox","aria-label":L??b,className:"flex flex-col gap-0.5",children:O.map(re=>s.jsx("button",{type:"button",role:"option","aria-selected":re.value===V,className:f.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",re.value===V&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(re.value),J()},children:re.label},re.value))})})]})}return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",u,c.DIAL_KIT_CLASS.calendar),children:[T,s.jsx(Ws,{id:S,disabled:i,invalid:l,labelledBy:A,panelLabel:L??b,fieldClassName:x,trigger:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:f.mergeClasses("truncate",!C&&"text-secondary"),children:K()}),xd]}),panel:V=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(c.StaticIconButton,{"aria-label":"Previous month",icon:zs.prev,size:c.ElementSize.Small,onClick:()=>M(-1)}),s.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:vd(j,g)}),s.jsx(c.StaticIconButton,{"aria-label":"Next month",icon:zs.next,size:c.ElementSize.Small,onClick:()=>M(1)})]}),s.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[P.map(G=>s.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:G},G)),R.map(G=>{const J=G.getMonth()!==j.getMonth(),re=Fs(G,C),q=Fs(G,E),Y=Hs(G,h,p);return s.jsx("button",{type:"button",disabled:Y,"aria-label":yd(G,g),"aria-pressed":re,"aria-current":q?"date":void 0,className:f.mergeClasses(pd,J&&gd,q&&!re&&md,re&&hd,Y&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>H(G,V),children:G.getDate()},G.toISOString())})]}),e===xe.DateTime&&s.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-secondary pt-3",children:[s.jsx("span",{className:"dial-small-text text-primary",children:"Time"}),s.jsx(Gs,{ariaLabel:"Time",value:C?Rt(C):"",onChange:W,onBlur:n,className:f.mergeClasses(!k&&"w-[120px]","px-3 py-1.5"),timezoneLabel:k,timezoneLabelClassName:"end-3 max-w-[60%]"})]})]})})]})},Ad=3,Od=({segments:e,labelClassName:t="dial-small-text",leafClassName:r="dial-small-semi-text",className:n,ariaLabel:a="Folder path"})=>{const o=m.useRef(null),i=m.useRef(null),l=m.useRef(null),[d,u]=m.useState(!1),h=m.useRef(!1),p=m.useRef(0),g=m.useCallback(j=>{h.current=j,u(j)},[]),x=m.useCallback(()=>{const j=o.current;if(!j)return;if(h.current){j.clientWidth>=p.current&&g(!1);return}const D=i.current,E=l.current;if(!D||!E)return;const k=D.scrollWidth-D.clientWidth,P=parseFloat(getComputedStyle(E).minWidth)||0,O=E.clientWidth<=P+1;k>0&&O&&(p.current=j.clientWidth+k,g(!0))},[g]);m.useEffect(()=>{const j=o.current;if(j)return c.observeElementSize(j,x)},[x]);const y=e.join("\0");m.useEffect(()=>{g(!1),c.scheduleMeasure(x)},[y,x,g]),m.useEffect(()=>{d||c.scheduleMeasure(x)},[d,x]);const v=s.jsx(c.DialIcon,{icon:s.jsx(F.IconFolder,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),className:"text-secondary"}),b=s.jsx("span",{className:Hr,children:s.jsx(c.DialIcon,{icon:s.jsx(F.IconChevronRight,{size:14,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),className:"text-secondary"})}),C=f.mergeClasses(t,"text-secondary cursor-default"),I=e.length-1,S=e.length>=3?I-1:-1,w=e.length>Ad||d,N=e.slice(1,d?I:I-1),L=j=>{const D=j===I,E=j===S;let k=e[j];return D&&(k=s.jsx("span",{className:r,children:e[j]})),s.jsxs("li",{className:f.mergeClasses(Ut,D&&"min-w-0",E&&"shrink-[1000]",!D&&!E&&"shrink-0"),children:[s.jsxs("span",{className:f.mergeClasses(Tr,Sn,"pointer-events-none opacity-75",E&&"min-w-auto"),"aria-current":D?"page":void 0,"aria-disabled":"true",children:[j===0&&v,s.jsx("span",{ref:D&&i||E&&l||void 0,className:f.mergeClasses("truncate",D&&"min-w-0 flex-1",E&&"min-w-[2ch]",C),children:k})]}),!D&&b]},`item-${j}`)},A=()=>s.jsxs("li",{className:f.mergeClasses(Ut,"shrink-0"),children:[s.jsxs(c.Tooltip,{tooltip:e.join(" > "),triggerClassName:"inline-flex cursor-default items-center text-secondary",children:[s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),s.jsx("span",{className:"sr-only",children:N.join(", ")})]}),b]},"ellipsis"),T=[];return w?(T.push(L(0),A()),d||T.push(L(I-1)),T.push(L(I))):e.forEach((j,D)=>T.push(L(D))),s.jsx("nav",{ref:o,"aria-label":a,className:f.mergeClasses(Cn,n,c.DIAL_KIT_CLASS.folderPath),children:s.jsx("ol",{className:In,children:T})})};var Ze=(e=>(e.Small="small",e.Heading="heading",e))(Ze||{});const _d="w-full overflow-hidden",kd="flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap",Us="flex min-w-0 items-center gap-2",Zs={[Ze.Small]:"dial-small-text",[Ze.Heading]:"dial-h2-text"},Rd={[Ze.Small]:"dial-small-semi-text",[Ze.Heading]:"dial-h2-text"},Md={first:"shrink-0",middle:"min-w-0 max-w-[30%] shrink",last:"min-w-0 max-w-[51%] shrink"},Pd="flex min-w-0 flex-1 items-center gap-1 rounded-xs transition-colors",Bd="text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",zd="cursor-default text-primary",Fd="cursor-default text-secondary",qs="inline-flex flex-none items-center leading-none text-secondary",Hd="dial-kit-minimum-target flex shrink-0 items-center rounded-xs text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",$d=3,Kd=4,Vd=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),Wd=({items:e,maxVisibleItems:t=Kd,size:r=Ze.Small,separator:n=Vd,ariaLabel:a="Breadcrumb",overflowAriaLabel:o="Show hidden path segments",className:i,itemClassName:l})=>{const d=Math.max(t,$d),u=m.useMemo(()=>e.length>d?e.slice(1,-(d-2)):[],[e,d]),h=m.useMemo(()=>u.map((y,v)=>({key:String(v),label:y.label,icon:y.icon})),[u]),p=m.useCallback(({key:y,domEvent:v})=>{const b=u[Number(y)];b&&(b.onClick?.(v),!b.onClick&&b.href&&!v.defaultPrevented&&(window.location.href=b.href))},[u]);if(e.length===0)return null;const g=e.slice(u.length+1),x=(y,{index:v,isFirst:b,isCurrent:C})=>{const I=!C&&(!!y.href||!!y.onClick),S=f.mergeClasses(Pd,I?Bd:C?f.mergeClasses(zd,Rd[r]):Fd,l,c.DIAL_KIT_CLASS.breadcrumbsItem),w=s.jsxs(s.Fragment,{children:[y.icon,s.jsx(c.EllipsisTooltip,{text:y.label})]});return s.jsxs("li",{className:f.mergeClasses(Us,Zs[r],Md[C?"last":b?"first":"middle"]),children:[I?y.href?s.jsx("a",{href:y.href,onClick:y.onClick,className:S,children:w}):s.jsx("button",{type:"button",onClick:y.onClick,className:S,children:w}):s.jsx("span",{className:S,"aria-current":C?"page":void 0,children:w}),!C&&s.jsx("span",{className:qs,"aria-hidden":"true",children:n})]},`segment-${v}`)};return s.jsx("nav",{"aria-label":a,className:f.mergeClasses(_d,i,c.DIAL_KIT_CLASS.breadcrumbs),children:s.jsxs("ol",{className:kd,children:[x(e[0],{index:0,isFirst:!0,isCurrent:e.length===1}),u.length>0&&s.jsxs("li",{className:f.mergeClasses(Us,Zs[r],"shrink-0"),children:[s.jsx(c.Dropdown,{items:h,onItemClick:p,placement:"bottom-start",matchReferenceWidth:!1,children:s.jsx("button",{type:"button","aria-label":o,className:Hd,children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})}),s.jsx("span",{className:qs,"aria-hidden":"true",children:n})]}),g.map((y,v)=>x(y,{index:e.length-g.length+v,isFirst:!1,isCurrent:v===g.length-1}))]})})},Gd=({className:e,icon:t,tooltipProps:r,type:n="button",...a})=>{const o=f.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=s.jsx("button",{...a,type:n,className:o,"aria-label":c.resolveAccessibleName(a["aria-label"],r?.tooltip),children:t||s.jsx(F.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return r?s.jsx(qe,{...r,children:i}):i},Ud=e=>s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:f.mergeClasses("transition-transform",e&&"rotate-180")}),Zd=({variant:e,appearance:t,items:r,dropdownProps:n,...a})=>{const[o,i]=m.useState(!1),l=m.useMemo(()=>Ud(o),[o]);return s.jsx("div",{className:c.DIAL_KIT_CLASS.buttonDropdown,children:s.jsx(c.Dropdown,{...n,items:r,onOpenChange:d=>i(d),children:s.jsx(Xe,{...a,iconAfter:l,variant:e||c.ButtonVariant.Primary,appearance:t||c.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":o})})})},ma=({label:e,size:t,isOpen:r=!1,labelClassName:n,className:a,"aria-label":o,...i})=>{const l=t===c.ElementSize.Small?"h-[32px]":"h-[40px] dial-kit-enhanced-target";return s.jsxs("button",{type:"button",...i,"aria-haspopup":"menu","aria-expanded":r,"aria-label":o?`${o} ${e}`:void 0,className:f.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,c.DIAL_KIT_CLASS.inlineSelect),children:[s.jsx("span",{className:n,children:e}),s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:f.mergeClasses("transition-transform",r&&"rotate-180")})]})},qd=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:n,size:a,disabled:o,placement:i="bottom-end",matchReferenceWidth:l=!1,listClassName:d,listStyle:u,ariaLabel:h,triggerClassName:p,triggerLabelClassName:g,open:x,onOpenChange:y})=>{const[v,b]=m.useState(!1),C=x!==void 0,I=C?x:v,S=m.useCallback(D=>{C||b(D),y?.(D)},[C,y]),[w,N]=m.useState(r??e[0]?.key),L=t!==void 0,A=L?t:w,T=m.useMemo(()=>{const D=e.find(E=>E.key===A);return D?.label?String(D.label):""},[e,A]),j=m.useCallback(({key:D})=>{const E=e.find(k=>k.key===D);E&&(L||N(D),n?.(E))},[e,L,n]);return s.jsx(c.Dropdown,{items:e,placement:i,matchReferenceWidth:l,listClassName:d,listStyle:u,disabled:o,open:C?x:void 0,onOpenChange:S,onItemClick:j,children:s.jsx(ma,{label:T,size:a,isOpen:I,disabled:o,"aria-label":h,className:p,labelClassName:g})})},Yd={[be.VALID]:"Completed",[be.ERROR]:"Error"},Xd=(e,t)=>e.status===be.ERROR?t?"border-error text-primary":"border-error text-error":t?e.status===be.VALID?"border-success text-primary":"border-accent text-primary":e.status===be.VALID?"border-primary text-primary":"border-primary text-secondary",Qd=(e,t)=>e.status===be.ERROR?"bg-control-error text-control-permanent":e.status===be.VALID&&!t?"bg-success text-success":t?e.status===be.VALID?"bg-success text-success":"bg-control-accent text-control-permanent":"bg-layer-sunken text-secondary",Jd=({steps:e,currentStep:t,onChangeStep:r,statusLabels:n,ariaLabel:a,className:o})=>{const i=l=>{if(l===t)return;const d=e.findIndex(p=>p.id===t),u=e.findIndex(p=>p.id===l);(e.slice(0,u).every(p=>p.status===be.VALID)||u<d)&&r(l)};return s.jsx("ol",{"aria-label":a,className:f.mergeClasses("m-0 flex list-none gap-x-3 p-0",o,c.DIAL_KIT_CLASS.steps),children:e.map((l,d)=>{const u=t===l.id,h=l.status?n?.[l.status]??Yd[l.status]:void 0;let p=d+1;return u&&l.status===be.ERROR?p=s.jsx(F.IconExclamationCircle,{"aria-hidden":"true",size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE}):!u&&l.status===be.VALID&&(p=s.jsx(F.IconCheck,{"aria-hidden":"true",size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE})),s.jsx("li",{className:"flex min-w-[180px] flex-1",children:s.jsxs("button",{type:"button","aria-current":u?"step":void 0,onClick:()=>i(l.id),className:f.mergeClasses("flex h-8 w-full cursor-pointer items-center border-t-2 text-start dial-tiny-text","focus-visible:outline focus-visible:outline-focus",Xd(l,u)),children:[s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("me-2 flex size-[22px] shrink-0 items-center justify-center rounded-full",Qd(l,u)),children:p}),s.jsx("span",{children:l.name}),h&&s.jsx("span",{className:"sr-only",children:h})]})},l.id)})})};var _e=(e=>(e.Outlined="outlined",e.Filled="filled",e))(_e||{}),Ne=(e=>(e.Blue="blue",e.Green="green",e.Violet="violet",e.Indigo="indigo",e.Brown="brown",e.Red="red",e))(Ne||{});const eu={[Ne.Blue]:"bg-blue text-blue",[Ne.Green]:"bg-green-2 text-green-1",[Ne.Violet]:"bg-violet-2 text-violet-1",[Ne.Indigo]:"bg-violet-1 text-violet-2",[Ne.Brown]:"bg-brown text-brown-2",[Ne.Red]:"bg-red text-red"},tu={[_e.Outlined]:"rounded-md border border-tertiary bg-layer-sunken text-secondary",[_e.Filled]:"rounded-full"},ru={[_e.Outlined]:"dial-tiny-text",[_e.Filled]:"dial-caption-lead-semi-text"},ds=({label:e,variant:t=_e.Outlined,color:r=Ne.Blue,icon:n,textClassName:a,className:o,...i})=>s.jsxs("span",{...i,className:f.mergeClasses("inline-flex h-6 w-fit shrink-0 items-center gap-1 whitespace-nowrap px-2",tu[t],t===_e.Filled&&eu[r],o,c.DIAL_KIT_CLASS.badge),children:[n&&s.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:n}),s.jsx("span",{className:a??ru[t],children:e})]});var wt=(e=>(e.Default="default",e.Compact="compact",e))(wt||{});const su={[wt.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[wt.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},nu=({title:e,value:t,description:r,variant:n=wt.Default,error:a,isLoading:o,className:i,delta:l,deltaPositive:d,deltaUnit:u,compareValues:h})=>{const p=su[n],g=d!==void 0?d:(l??0)>=0,x=l===void 0?null:`${l>=0?`+${l}`:String(l)}${u??""}`;return s.jsxs("div",{className:f.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||o?"gap-2":"gap-1",p.container,i,c.DIAL_KIT_CLASS.analyticsCard),children:[l!==void 0?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:p.title,children:e}),s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",g?"bg-success text-success":"bg-error text-error"),children:x})]}):s.jsx("span",{className:p.title,children:e}),a?s.jsx(ds,{label:"Error",variant:_e.Filled,color:Ne.Red,textClassName:"dial-tiny-semi-text",className:"self-start"}):o?s.jsx(Ve,{size:18,fullWidth:!1,className:"self-start"}):h?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx(c.EllipsisTooltip,{text:h[0].title,className:"dial-tiny-text text-secondary"}),s.jsx("span",{className:p.value,children:h[0].value})]}),s.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx(c.EllipsisTooltip,{text:h[1].title,className:"dial-tiny-text text-secondary"}),s.jsx("span",{className:p.value,children:h[1].value})]})]}):s.jsx("span",{className:p.value,children:t}),!a&&!o&&p.showDescription&&r!=null&&r!==!1&&s.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},us=[{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"}],au=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),ou=(e,t)=>{if(e<=0)return;let r;for(const n of t)(n.from===n.to?e>=n.from:e>n.from&&e<=n.to)&&(r=n.color);return r},Kt=({value:e,maxValue:t=1,error:r,isLoading:n,title:a,valueLabel:o,colorMap:i=us,className:l,titleClassName:d,valueClassName:u,inline:h,ariaLabel:p})=>{const g=e==null,x=!!(r||n||!g),y=au(g?0:e,t),v=ou(y,i),b=o??(g?"—":e),C=p??(typeof a=="string"?a:void 0),I=r||n,S=r?s.jsx(ds,{label:"Error",variant:_e.Filled,color:Ne.Red,textClassName:"dial-tiny-semi-text"}):n?s.jsx(Ve,{size:18,fullWidth:!1}):s.jsx("span",{className:f.mergeClasses("shrink-0 tabular-nums text-end",h?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",u),children:b}),w=x?s.jsx("div",{role:"progressbar","aria-valuenow":r||n||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":C,className:f.mergeClasses("w-full overflow-hidden rounded-xs",h?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!I&&s.jsx("div",{className:"h-full rounded-xs transition-[width] duration-300",style:{width:`${y*100}%`,backgroundColor:v}})}):null,N=s.jsx("span",{className:f.mergeClasses("dial-small-text text-primary",d),children:a});return h?s.jsxs("div",{className:f.mergeClasses("flex flex-row items-center gap-2",l,c.DIAL_KIT_CLASS.analyticsBar),children:[s.jsx("div",{className:"w-1/2 min-w-0",children:N}),s.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[s.jsx("div",{className:"min-w-0 flex-1",children:w}),S]})]}):s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-1",l,c.DIAL_KIT_CLASS.analyticsBar),children:[s.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[N,S]}),w]})};var Yt=(e=>(e.Start="start",e.End="end",e))(Yt||{});const ga=({title:e,description:t,children:r,expanded:n,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,ariaLabel:l,onToggle:d,caretPosition:u=Yt.End,className:h,headerClassName:p,contentClassName:g})=>{const x=n!==void 0,[y,v]=m.useState(a),b=i?!0:x?n:y,C=m.useId(),I=`accordion-header-${C}`,S=`accordion-content-${C}`,w=()=>{if(o)return;const j=!b;x||v(j),d?.(j)},N=u===Yt.Start,L=i?null:s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses("shrink-0 text-secondary transition-transform motion-reduce:transition-none",b?"rotate-90":"rtl:rotate-180")}),A=s.jsxs(s.Fragment,{children:[N&&L,s.jsxs("span",{className:"flex min-w-0 flex-col",children:[s.jsx("span",{className:"truncate dial-body-text text-primary",children:e}),t?s.jsx("span",{className:"truncate dial-tiny-text text-secondary",children:t}):null]}),!N&&L]}),T=N?"justify-start gap-2":"justify-between";return s.jsxs("div",{className:f.mergeClasses("flex flex-col py-3 overflow-hidden bg-transparent",h,c.DIAL_KIT_CLASS.accordion),children:[i?s.jsx("div",{id:I,className:f.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",T,p),children:A}):s.jsx("button",{id:I,type:"button","aria-expanded":b,"aria-controls":S,"aria-label":c.resolveAccessibleName(l),disabled:o,onClick:w,className:f.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",T,o?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",p),children:A}),s.jsx("div",{inert:!b,className:f.mergeClasses("grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",b?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:s.jsx("div",{className:"min-h-0 overflow-hidden",children:s.jsx("div",{className:"pt-3",children:s.jsx("div",{id:S,role:"region","aria-labelledby":I,className:f.mergeClasses("px-4 dial-small-text text-primary",g),children:r})})})})]})},iu=({title:e,titleTooltip:t,description:r,data:n,compareData:a,compareLabels:o,maxValue:i,colorMap:l,defaultExpanded:d=!0,nonCollapsible:u,isLoading:h,onBarClick:p,inline:g,barTitleClassName:x,barValueClassName:y,barClassName:v,barDescriptions:b,className:C})=>{const I=Object.entries(n),S=g?f.mergeClasses("text-secondary",x):x,w=o?"dial-tiny-text text-secondary":void 0,N=t?s.jsx(c.Tooltip,{tooltip:t,children:e}):e,L=a?[...new Set([...Object.keys(n),...Object.keys(a)])]:[],A="cursor-pointer rounded-xs text-left focus-visible:outline focus-visible:outline-focus",T="group flex flex-col gap-1.5",j=f.mergeClasses("flex flex-col gap-1.5 pl-2",p&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",v);return s.jsx(ga,{title:N,description:r,defaultExpanded:d,nonCollapsible:u,className:f.mergeClasses(C,c.DIAL_KIT_CLASS.analyticsBarGroup),children:s.jsx("div",{className:f.mergeClasses("flex flex-col",a?"gap-4":g?"gap-2":"gap-3"),children:h?s.jsx(Ve,{size:18,fullWidth:!1,className:"self-center"}):a?L.map(D=>{const E=D in n?n[D]:null,k=D in a?a[D]:null,O=typeof E=="number"&&typeof k=="number"?parseFloat((k-E).toFixed(3)):null,R=O!=null&&O!==0,M=R&&O>0,H=R?M?`+${O}`:String(O):null,W=b?.[D],K=s.jsx("span",{className:"dial-small-text text-secondary",children:D}),V=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[W?s.jsx(c.Tooltip,{tooltip:W,children:K}):K,H!=null&&s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",M?"bg-success text-success":"bg-error text-error"),children:H})]}),s.jsxs("div",{className:j,children:[s.jsx(Kt,{title:o?.[0],value:E,maxValue:i,colorMap:l,inline:g,titleClassName:w,ariaLabel:D}),s.jsx(Kt,{title:o?.[1],value:k,maxValue:i,colorMap:l,inline:g,titleClassName:w,ariaLabel:`${D} compare`})]})]});return p?s.jsx("button",{type:"button",onClick:()=>p(D,E),className:f.mergeClasses(T,A),children:V},D):s.jsx("div",{className:T,children:V},D)}):I.map(([D,E])=>{const k=s.jsx(Kt,{title:D,value:E,maxValue:i,colorMap:l,inline:g,titleClassName:S,valueClassName:y,className:v}),P=p?s.jsx("button",{type:"button",onClick:()=>p(D,E),className:A,children:k}):k,O=b?.[D];return O?s.jsx(c.Tooltip,{tooltip:O,triggerClassName:"flex flex-col",children:P},D):s.jsx(m.Fragment,{children:P},D)})})})},lu="#FF4E50",cu=(e,t)=>{let r=-1;return t.forEach((n,a)=>{(n.from===n.to?e>=n.from:e>n.from&&e<=n.to)&&(r=a)}),r},Ys=(e,t)=>{const r=t.map(()=>0);let n=0;e.forEach(d=>{if(d<=0){n+=1;return}const u=cu(d,t);u>=0&&(r[u]+=1)});const a=Math.max(0,n,...r),o=d=>a>0?d/a:0,i={from:0,to:0,color:lu,count:n,ratio:o(n),isZeroBucket:!0},l=t.map((d,u)=>({from:d.from,to:d.to,color:d.color,count:r[u],ratio:o(r[u]),isZeroBucket:!1}));return[i,...l]},xa=e=>e<=0?2:e%2===0?e:e+1,du=e=>{const t=xa(e);return[t,t/2,0]},yr=e=>`${Math.round(e*100)/100}`,ba=(e,t)=>e===t?yr(e):`${yr(e)}-${yr(t)}`,Cr=128,uu=(e,t)=>{const r=ba(e,t);return e===t?`scored ${r}`:`scored between ${r}`},Xs=(e,t,r,n,a)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&s.jsx("strong",{children:e}),s.jsxs("span",{children:[t," out of ",r," ",n]}),s.jsx("span",{children:uu(a.from,a.to)})]}),fu=({title:e,values:t,colorMap:r=us,valueTitle:n="values",showCount:a,isLoading:o,className:i,compareValues:l,valueSetLabel:d,compareValueSetLabel:u})=>{const h=Ys(t,r),p=l?Ys(l,r):void 0,g=t.length,x=l?.length??0,y=Math.max(g,x),v=xa(y),b=du(y),C=N=>N.map(L=>({...L,ratio:v>0?L.count/v:0})),I=C(h),S=p?C(p):void 0,w=(N,L,A,T)=>{if(N.count===0)return s.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:s.jsx("div",{className:"min-h-2 w-full rounded-xs",style:{height:`${N.ratio*100}%`}})});const j=T?{backgroundImage:`repeating-linear-gradient(135deg, ${N.color} 0px, ${N.color} 1px, transparent 1px, transparent 4px)`,borderColor:N.color}:{backgroundColor:N.color};return s.jsx(c.Tooltip,{placement:c.TooltipPlacement.Bottom,tooltip:L,triggerClassName:"flex h-full flex-1 items-end",children:s.jsx("div",{role:"img","aria-label":A,className:"flex min-h-2 w-full items-center justify-center rounded-xs border border-transparent",style:{height:`${N.ratio*100}%`,...j},children:a&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:N.count})})})};return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-2",i,c.DIAL_KIT_CLASS.analyticsHistogram),children:[s.jsx("span",{className:"dial-small-text text-primary",children:e}),o?s.jsx("div",{className:"flex items-center justify-center",style:{height:Cr},children:s.jsx(Ve,{size:18,fullWidth:!1})}):s.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1",children:[s.jsx("div",{"data-histogram-y-axis":!0,"aria-hidden":"true",className:"relative",style:{height:Cr},children:b.map((N,L)=>s.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${L/(b.length-1)*100}%`,transform:"translateY(-50%)"},children:N},N))}),s.jsxs("div",{className:"relative min-w-0",children:[b.map((N,L)=>s.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${L/(b.length-1)*100}%`}},N)),s.jsx("div",{className:"relative flex items-end gap-1",style:{height:Cr},children:S?I.map((N,L)=>{const A=S[L],T=`${N.count} out of ${g} ${n}`,j=`${A.count} out of ${x} ${n}`;return s.jsxs("div",{className:"flex h-full flex-1 items-end",children:[w(N,Xs(d,N.count,g,n,N),T,!0),w(A,Xs(u,A.count,x,n,A),j,!1)]},L)}):I.map((N,L)=>{const A=`${N.count} out of ${g} ${n}`;return N.count===0?s.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:s.jsx("div",{className:"min-h-2 w-full rounded-xs",style:{height:`${N.ratio*100}%`}})},L):s.jsx(c.Tooltip,{placement:c.TooltipPlacement.Bottom,tooltip:A,triggerClassName:"flex h-full flex-1 items-end",children:s.jsx("div",{role:"img","aria-label":A,className:f.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-xs border","border-transparent"),style:{height:`${N.ratio*100}%`,backgroundColor:N.color},children:a&&N.count>0&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:N.count})})},L)})})]}),s.jsx("div",{}),s.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:I.map((N,L)=>s.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:ba(N.from,N.to)},L))})]})]})},pu=({label:e,text:t,tooltip:r,children:n,postfix:a,className:o})=>{const i=!!n||t!=null;return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-1",!n&&"max-w-[200px]",o,c.DIAL_KIT_CLASS.labelledText),children:[s.jsx(c.Label,{label:e}),i&&s.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-primary",children:[n??s.jsx(c.EllipsisTooltip,{text:t,customTooltipContent:r,className:"dial-small-text min-w-0 flex-1"}),!n&&a]})]})},hu="z-popup flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",mu="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",gu="flex flex-row items-center justify-between px-6 py-4",xu="flex-1 min-w-0 mr-3 truncate dial-h2-text text-primary",bu="border-b border-tertiary",vu="flex flex-row items-center gap-2 px-6 py-4",yu="border-t border-tertiary",Ir="flex shrink-0 flex-row items-center gap-2",Cu="ml-auto mobile:flex-1",Xt="mobile:flex-1",Iu={[We.Sm]:"max-w-full md:max-w-[400px]",[We.Md]:"max-w-full md:max-w-[800px]",[We.Lg]:"max-w-full md:max-w-[1200px]"},fs=({open:e=!1,header:t,ariaLabel:r,portalId:n,className:a,overlayClassName:o,overlayStyle:i,titleClassName:l,headerClassName:d,bodyClassName:u,children:h,footer:p,footerClassName:g,onClose:x,onBack:y,backAriaLabel:v="Back",headerActions:b,headerDivider:C=!1,mainButtons:I,additionalButtons:S,additionalButtonsOnLeft:w=!1,footerDivider:N=!1,size:L=We.Md,hideClose:A=!1,closeAriaLabel:T="Close dialog",closeOnOutsideClick:j=!0,preventKeyboardOnOpen:D=!1})=>{const E=c.useThemeScope(),k=m.useRef(null),P=m.useId(),{refs:O,context:R}=B.useFloating({open:e,onOpenChange:q=>{q||x?.(null)}}),M=B.useRole(R,{role:"dialog"}),H=B.useDismiss(R,{outsidePress:j}),{getFloatingProps:W}=B.useInteractions([M,H]);if(!e)return null;const K=typeof t=="string"?`popup-heading-${P}`:void 0,V=q=>q?typeof q=="string"?s.jsx("h2",{id:K,className:f.mergeClasses(xu,l),children:s.jsx(c.Tooltip,{tooltip:q,triggerClassName:"truncate",children:q})}):q:s.jsx("span",{}),G=A?null:s.jsx(c.CloseButton,{ariaLabel:T,onClose:q=>x?.(q)}),J=(q,Y=[],se)=>Y.map(({variant:le=c.ButtonVariant.Neutral,className:oe,...me},ve)=>s.jsx(Xe,{variant:le,className:f.mergeClasses(se,oe),...me},`${q}-${ve}`)),re=()=>{if(p!==void 0)return p;if(!I?.length&&!S?.length)return null;const q=J("additional",S,w?void 0:Xt);return s.jsxs("div",{className:f.mergeClasses(vu,N&&yu,g),children:[w&&q.length>0&&s.jsx("div",{className:Ir,children:q}),s.jsxs("div",{className:f.mergeClasses(Ir,Cu),children:[!w&&q,J("main",I,Xt)]})]})};return s.jsx(B.FloatingPortal,{id:n,children:s.jsx(B.FloatingOverlay,{style:i,className:f.mergeClasses(hu,E,o),children:s.jsx(B.FloatingFocusManager,{context:R,initialFocus:D?k:O.floating,children:s.jsxs("div",{ref:O.setFloating,...W(),role:"dialog","aria-modal":"true","aria-labelledby":K,"aria-label":K?void 0:r,className:f.mergeClasses(mu,Iu[L],a,c.DIAL_KIT_CLASS.popup),children:[D&&s.jsx("div",{ref:k,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),s.jsxs("div",{className:f.mergeClasses(gu,C&&bu,d),children:[y&&s.jsx(c.GhostIconButton,{"aria-label":v,size:c.ElementSize.Small,className:"mr-2",onClick:y,icon:s.jsx(F.IconChevronLeft,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),V(t),b?s.jsxs("div",{className:Ir,children:[b,G]}):G]}),s.jsx("div",{className:f.mergeClasses("grow overflow-auto",u),children:h}),re()]})})})})},Su="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Nu="text-secondary dial-small-paragraph-text px-6 pb-4",wu="px-6 py-4 h-[120px]",ju="Cancel",Du="Ok",Qs={[it.Info]:{confirm:{variant:c.ButtonVariant.Primary,appearance:c.ButtonAppearance.Solid}},[it.Danger]:{confirm:{variant:c.ButtonVariant.Danger,appearance:c.ButtonAppearance.Solid}}},va=({header:e,description:t,descriptionClassName:r,open:n=!1,confirmLabel:a=Du,cancelLabel:o=ju,isLoading:i=!1,disableConfirmButton:l=!1,className:d,confirmClassName:u,onClose:h,onConfirm:p,onCancel:g,children:x,variant:y=it.Info,size:v=We.Sm,footer:b,hideClose:C,...I})=>{const S=i?null:s.jsxs("div",{className:Su,children:[s.jsx(ns,{className:Xt,label:o,onClick:()=>g?g():h?.()}),s.jsx(Xe,{variant:Qs[y].confirm.variant,appearance:Qs[y].confirm.appearance,className:f.mergeClasses(Xt,u),label:a,disabled:l,onClick:p})]}),w=m.useCallback(()=>i?s.jsx("div",{className:wu,children:s.jsx(Ve,{size:40})}):x??(t?s.jsx("div",{className:f.mergeClasses(Nu,r),children:t}):null),[x,t,i,r]);return s.jsx(fs,{...I,open:n,header:e,className:f.mergeClasses(d,c.DIAL_KIT_CLASS.confirmationPopup),onClose:()=>h?.(),footer:b??S,size:v,hideClose:C??(!i&&b===void 0),children:w()})},Tu="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",Eu="min-w-0 flex-1 truncate text-primary",Lu="min-w-0 flex-1 truncate text-secondary",Au="shrink-0 text-secondary",Ou="px-6 pb-4",_u="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",ku="Cancel",Ru="Apply",Mu=({items:e,value:t,customValue:r,header:n,onApply:a,id:o,labelProps:i,placeholder:l,selectedValue:d,onSelectionChange:u,onCancel:h,onClose:p,isValid:g=!0,applyButtonLabel:x=Ru,cancelButtonLabel:y=ku,size:v=We.Md,portalId:b,disabled:C,invalid:I,error:S,caption:w,ariaLabel:N,className:L,fieldClassName:A})=>{const T=m.useId(),j=o??T,D=`${j}-label`,E=`${j}-value`,k=S?`${j}-error`:void 0,P=!S&&w?`${j}-caption`:void 0,[O,R]=m.useState(!1),M=d!==void 0,[H,W]=m.useState(t),K=M?d:H,V=m.useCallback(()=>{C||(M||W(t),R(!0))},[C,M,t]),G=m.useCallback(()=>{R(!1),p?.()},[p]),J=m.useCallback(()=>{h?.(),G()},[h,G]),re=m.useCallback(()=>{a(K),G()},[a,K,G]),q=m.useCallback(_=>{M||W(_),u?.(_)},[M,u]),Y=c.resolveAccessibleName(i?.label),se=Y?void 0:c.resolveAccessibleName(N),le=Y?D:se&&`${j}-name`,oe=c.resolveAccessibleName(n),me=e.find(_=>_.value===t)?.label,ve=r??me;return s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-2",L,c.DIAL_KIT_CLASS.radioGroupPopupField),children:[i&&s.jsx(c.Label,{...i,id:D,htmlFor:j}),s.jsxs("div",{className:"flex flex-col gap-1",children:[se&&s.jsx("span",{id:le,className:"sr-only",children:se}),s.jsxs("button",{type:"button",id:j,disabled:C,"aria-haspopup":"dialog","aria-expanded":O,"aria-labelledby":le?`${le} ${E}`:void 0,"aria-describedby":[k,P].filter(Boolean).join(" ")||void 0,onClick:V,className:f.mergeClasses(Tu,I&&"dial-kit-input-error",C&&"dial-kit-input-disable",A),children:[s.jsx("span",{id:E,className:ve==null?Lu:Eu,children:ve??l}),s.jsx(F.IconMaximize,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Au})]}),s.jsx(c.ErrorText,{id:k,text:S}),!S&&s.jsx(c.CaptionText,{id:P,text:w})]}),s.jsx(fs,{open:O,header:n,ariaLabel:oe?void 0:Y,portalId:b,size:v,onClose:J,footer:s.jsxs("div",{className:_u,children:[s.jsx(ns,{label:y,onClick:J}),s.jsx(ra,{label:x,disabled:!g,onClick:re})]}),children:s.jsx("div",{className:Ou,children:s.jsx(Nt,{id:`${j}-options`,items:e,value:K,onChange:q,orientation:Oe.Column,ariaLabel:Y??oe})})})]})},Pu=({icon:e,selectedIcon:t,isSelected:r=!1,onToggle:n,onClick:a,tooltipProps:o,size:i=c.ElementSize.Small,className:l,...d})=>{const u=m.useCallback(p=>{a?.(p),n?.(!r)},[a,n,r]),h=s.jsx(c.IconButton,{...d,size:i,variant:c.ButtonVariant.Primary,appearance:c.ButtonAppearance.Ghost,icon:r?t??e:e,"aria-pressed":r,"aria-label":c.resolveAccessibleName(d["aria-label"],o?.tooltip),onClick:u,className:f.mergeClasses("!rounded","[&_svg]:size-4",r&&"!text-accent",l,c.DIAL_KIT_CLASS.toggleIconButton)});return o?s.jsx(c.Tooltip,{asChild:!0,...o,children:h}):h},Bu=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],zu="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Fu="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",Hu="bg-layer-raised text-accent shadow-xs",$u="bg-transparent text-secondary",Ku="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Vu="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",Wu="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",Gu="cursor-not-allowed bg-transparent text-control-disable-primary",Uu=({items:e,value:t,onChange:r,disabled:n,className:a,segmentClassName:o,"aria-label":i})=>{const l=m.useRef({}),d=e.find(p=>p.value===t),u=d&&!d.disabled?d.value:e.find(p=>!p.disabled)?.value,h=m.useCallback(p=>{if(n||!Bu.includes(p.key))return;const g=e.filter(C=>!C.disabled);if(g.length===0)return;const x=Math.max(g.findIndex(C=>C.value===t),0),y=g.length-1;let v=x;switch(p.key){case"ArrowRight":case"ArrowDown":v=x===y?0:x+1;break;case"ArrowLeft":case"ArrowUp":v=x===0?y:x-1;break;case"Home":v=0;break;case"End":v=y;break}p.preventDefault();const b=g[v];l.current[b.value]?.focus(),b.value!==t&&r(b.value)},[n,e,t,r]);return s.jsx("div",{role:"radiogroup","aria-label":i,"aria-disabled":n||void 0,onKeyDown:h,className:f.mergeClasses(zu,a,c.DIAL_KIT_CLASS.segmentedControl),children:e.map(p=>{const g=p.value===t,x=n||p.disabled;return s.jsxs("button",{ref:y=>{l.current[p.value]=y},type:"button",role:"radio","aria-checked":g,"aria-label":c.resolveAccessibleName(p["aria-label"],typeof p.label=="string"?p.label:void 0),tabIndex:p.value===u?0:-1,disabled:x,onClick:()=>r(p.value),className:f.mergeClasses(Fu,g?Hu:$u,x?g?Wu:Gu:g?Ku:Vu,o,c.DIAL_KIT_CLASS.segmentedControlItem),children:[p.icon,p.label]},p.value)})})},Zu={[ot.Error]:"Error",[ot.Warning]:"Warning"},qu={[Ge.Horizontal]:{next:"ArrowRight",previous:"ArrowLeft"},[Ge.Vertical]:{next:"ArrowDown",previous:"ArrowUp"}},Yu=({tabs:e,activeTabId:t,onTabChange:r,orientation:n=Ge.Horizontal,sectionLabel:a,ariaLabel:o,className:i,tabListClassName:l,tabClassName:d,sectionLabelClassName:u})=>{const h=m.useRef({}),p=m.useId(),g=n===Ge.Vertical,x=e.find(C=>C.id===t),y=x&&!x.disabled?x.id:e.find(C=>!C.disabled)?.id,v=m.useCallback(C=>{const{next:I,previous:S}=qu[n];if(![I,S,"Home","End"].includes(C.key)||e.length===0)return;const w=e.filter(j=>!j.disabled);if(w.length===0)return;const N=Math.max(w.findIndex(j=>j.id===t),0),L=w.length-1;let A=N;C.key===I?A=N===L?0:N+1:C.key===S?A=N===0?L:N-1:C.key==="Home"?A=0:A=L,C.preventDefault();const T=w[A];h.current[T.id]?.focus(),T.id!==t&&r(T.id)},[e,t,r,n]),b=s.jsx("div",{role:"tablist","aria-orientation":g?"vertical":void 0,"aria-label":o,"aria-labelledby":!o&&a?p:void 0,onKeyDown:v,className:f.mergeClasses(g?"flex flex-col gap-1 px-2":"flex justify-start gap-1",!a&&i,l,c.DIAL_KIT_CLASS.tabList,!a&&c.DIAL_KIT_CLASS.tabs),children:e.map(C=>{const I=t===C.id,S=!!C.disabled;return s.jsxs("button",{ref:w=>{h.current[C.id]=w},type:"button",role:"tab","aria-selected":I,disabled:S,tabIndex:C.id===y?0:-1,onClick:()=>r(C.id),className:f.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"],S&&(g?"cursor-not-allowed text-control-disable-primary":"cursor-not-allowed border-control-disable-primary text-control-disable-primary"),!S&&(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"),d,c.DIAL_KIT_CLASS.tab,I&&c.DIAL_KIT_CLASS.tabSelected),children:[C.icon&&s.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:C.icon}),s.jsx("span",{className:f.mergeClasses(g&&!I&&!S&&"text-primary"),children:C.label}),C.status&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("flex shrink-0",C.status===ot.Error?"text-error":"text-warning",g&&C.count==null&&"ms-auto"),children:C.status===ot.Error?s.jsx(F.IconExclamationCircle,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE}):s.jsx(F.IconAlertTriangle,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE})}),s.jsx("span",{className:"sr-only",children:C.statusLabel??Zu[C.status]})]}),C.count!=null&&s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",g&&"ms-auto",S&&"bg-layer-sunken text-control-disable-primary",!S&&(I?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:C.count})]},C.id)})});return a?s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-3",i,c.DIAL_KIT_CLASS.tabs),children:[s.jsx("div",{className:f.mergeClasses("flex h-16 shrink-0 items-center",g?"px-4":"px-3"),children:s.jsx("span",{id:p,className:f.mergeClasses("dial-h1-text text-primary",u,c.DIAL_KIT_CLASS.tabsSectionLabel),children:a})}),b]}):b},Xu="flex flex-nowrap items-center gap-1",Qu="min-w-max flex-1 justify-center",Ju=({items:e,value:t,onChange:r,stretch:n=!1,className:a,chipClassName:o,"aria-label":i,"aria-labelledby":l})=>s.jsx("div",{role:"group","aria-label":i,"aria-labelledby":l,className:f.mergeClasses(Xu,a,c.DIAL_KIT_CLASS.filterChips),children:e.map(d=>s.jsx(Le,{label:d.label,icon:d.icon,appearance:je.Selectable,selected:d.value===t,onClick:()=>r(d.value),className:f.mergeClasses(n&&Qu,o)},d.value))}),_r=(e,t)=>{const r=(t??"").split(",").map(o=>o.trim().toLowerCase()).filter(Boolean);if(r.length===0)return!0;const n=e.name.toLowerCase(),a=e.type.toLowerCase();return r.some(o=>{if(o.startsWith("."))return n.endsWith(o);if(o.endsWith("/*")){const i=o.slice(0,-1);return a.length>i.length&&a.startsWith(i)}return a===o})},ef=({labelProps:e,label:t,description:r,onChange:n,onReject:a,accept:o,multiple:i=!1,disabled:l=!1,errorText:d,icon:u,id:h,ariaLabel:p,className:g})=>{const x=m.useId(),y=h??`file-dropzone-${x}`,v=d?`${y}-error`:void 0,[b,C]=m.useState(!1),I=m.useRef(0),S=m.useCallback(D=>{if(D.length===0)return;const E=i?D:D.slice(0,1),k=E.filter(O=>_r(O,o)),P=E.filter(O=>!_r(O,o));P.length>0&&a?.(P),k.length>0&&n(k)},[o,i,n,a]),w=m.useCallback(D=>{S(Array.from(D.target.files??[])),D.target.value=""},[S]),N=m.useCallback(()=>{I.current=0,C(!1)},[]),L=m.useCallback(D=>{l||(D.preventDefault(),I.current+=1,C(!0))},[l]),A=m.useCallback(D=>{l||(D.preventDefault(),D.dataTransfer.dropEffect="copy")},[l]),T=m.useCallback(()=>{l||(I.current-=1,I.current<=0&&N())},[l,N]),j=m.useCallback(D=>{D.preventDefault(),!l&&(N(),S(Array.from(D.dataTransfer?.files??[])))},[l,N,S]);return s.jsxs("div",{className:"flex flex-col gap-1",children:[e&&s.jsx(c.Label,{...e,htmlFor:y}),s.jsx("input",{id:y,type:"file",accept:o,multiple:i,disabled:l,onChange:w,"aria-label":c.resolveAccessibleName(typeof t!="string"?p:void 0),"aria-describedby":v,"aria-invalid":d?!0:void 0,className:"peer sr-only"}),s.jsxs("label",{htmlFor:y,onDragEnter:L,onDragOver:A,onDragLeave:T,onDrop:j,className:f.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&&b&&"border-accent bg-control-accent-alpha",!l&&!b&&"border-secondary hover:border-accent",d&&!b&&"border-error hover:border-error",g,c.DIAL_KIT_CLASS.fileDropzone),children:[u??s.jsx(F.IconUpload,{size:f.DIAL_ICON_SIZE.LG,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:l?"text-control-disable-primary":"text-secondary"}),s.jsxs("span",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:f.mergeClasses("dial-small-text",l?"text-control-disable-primary":"text-primary"),children:t}),r&&s.jsx("span",{className:f.mergeClasses("dial-tiny-text",l?"text-control-disable-primary":"text-secondary"),children:r})]})]}),s.jsx(c.ErrorText,{id:v,text:d})]})},ya=({label:e="Shared",tooltip:t,size:r=12,className:n})=>s.jsx(c.Tooltip,{tooltip:t||"Shared",asChild:!0,children:s.jsx("span",{role:"img","aria-label":e,className:f.mergeClasses("flex shrink-0 rounded-xs bg-layer-raised text-accent",n,c.DIAL_KIT_CLASS.sharedEntityIndicator),children:s.jsx(F.IconArrowUpRight,{size:r,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})});var Ce=(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))(Ce||{});const tf={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"]},rf=new Map(Object.entries(tf).flatMap(([e,t])=>t.map(r=>[r,e]))),sf=e=>rf.get(e)??"other",Js="var(--text-control-permanent, #FCFCFC)",Mt={x1:"20.4167",y1:"-3.33333",x2:"2.5",y2:"20",from:"var(--bg-visual-blue, #D6EDF9)",to:"var(--stroke-gradient-1, #5976E9)"},nf="#1B212D",af={[Ce.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:Mt},[Ce.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:nf}},[Ce.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)"}},[Ce.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)"}},[Ce.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)"}},[Ce.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:Mt},[Ce.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:Mt},[Ce.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)"}},[Ce.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)"}},[Ce.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)"},[Ce.Other]:{path:"M6.80005 8H13.2M6.80005 10.2222H13.2M6.80005 12.4444H13.2",sheet:Mt}},of=({size:e,kind:t})=>{const r=`dial-kit-file-gradient-${m.useId().replace(/[^\w-]/g,"")}`,{path:n,fillPath:a,sheet:o}=af[t],i=typeof o=="string";return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[s.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})`}),n&&s.jsx("path",{d:n,stroke:Js,strokeWidth:"0.7",strokeLinecap:"round",strokeLinejoin:"round"}),a&&s.jsx("path",{d:a,fill:Js}),!i&&s.jsx("defs",{children:s.jsxs("linearGradient",{id:r,x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:o.from}),s.jsx("stop",{offset:"1",stopColor:o.to})]})})]})},lf=({size:e})=>{const t=`dial-kit-folder-gradient-${m.useId().replace(/[^\w-]/g,"")}`;return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[s.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)"}),s.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})`}),s.jsx("defs",{children:s.jsxs("linearGradient",{id:t,x1:"17.0833",y1:"5.83335",x2:"9.38489",y2:"19.6653",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"var(--stroke-secondary, #D1DBEA)"}),s.jsx("stop",{offset:"0.91",stopColor:"var(--stroke-gradient-1, #5976E9)"})]})})]})},cf=(e,t)=>(t??(e.includes(".")?e.split(".").pop():"")??"").trim().replace(/^\./,"").toLowerCase(),df=(e,t)=>e===Ae.Folder?"Folder":t?`${t.toUpperCase()} file`:"File",uf=(e,t,r)=>e===Ae.Folder?s.jsx(lf,{size:r}):s.jsx(of,{size:r,kind:sf(t)}),ps=({type:e,name:t,fileExtension:r,shared:n=!1,loading:a=!1,size:o=f.DIAL_ICON_SIZE.MD,className:i,decorative:l=!1,label:d,loadingLabel:u="Loading",sharedIndicatorClassName:h,sharedIndicatorTooltip:p})=>{if(e!==Ae.File&&e!==Ae.Folder)return null;const g=e===Ae.File?cf(t,r):"",x=df(e,g),y=d??(n?`${x}, shared`:x),v=l?{"aria-hidden":!0}:a?{}:{role:"img","aria-label":y};return s.jsxs("span",{className:f.mergeClasses("relative inline-flex shrink-0 items-center justify-center text-secondary",i,c.DIAL_KIT_CLASS.fileIcon),...v,children:[a?s.jsx(Ve,{size:o,ariaLabel:u}):uf(e,g,o),n&&s.jsx(ya,{tooltip:p,className:f.mergeClasses("absolute -bottom-0.5 -left-0.5",h)})]})},Ca=({name:e,type:t=Ae.File,fileExtension:r,shared:n=!1,loading:a=!1,loadingLabel:o,iconSize:i,details:l,isInvalidName:d=!1,className:u,nameClassName:h,sharedIndicatorClassName:p,sharedIndicatorTooltip:g,sharedLabel:x="Shared",hideTooltip:y=!1,tooltipContent:v})=>s.jsxs("div",{className:f.mergeClasses("flex w-full min-w-0 items-center gap-2",u,c.DIAL_KIT_CLASS.fileName),children:[s.jsx(ps,{name:e,type:t,fileExtension:r,shared:n,loading:a,loadingLabel:o,size:i,sharedIndicatorClassName:p,sharedIndicatorTooltip:g,decorative:!a}),s.jsxs("div",{className:f.mergeClasses("flex min-w-0 flex-1",{"flex-col gap-1":!!l}),children:[s.jsx(c.EllipsisTooltip,{className:f.mergeClasses("dial-small-paragraph-text",d?"text-secondary":"text-primary",h),text:e,hideTooltip:y,customTooltipContent:v}),n&&s.jsx("span",{className:"sr-only",children:x}),l]})]}),ff=({className:e,...t})=>s.jsx(Ca,{...t,type:Ae.Folder,className:f.mergeClasses(e,c.DIAL_KIT_CLASS.folderName)}),pf=({open:e,onClose:t,title:r,ariaLabel:n,onBack:a,backAriaLabel:o="Back",closeAriaLabel:i="Close",closeOnOutsideClick:l=!0,children:d,className:u,overlayClassName:h,headerClassName:p,style:g,overlayStyle:x,bodyClassName:y,titleClassName:v,portalId:b})=>{const C=c.useThemeScope(),I=`bottom-sheet-title-${m.useId()}`,{refs:S,context:w}=B.useFloating({open:e,onOpenChange:T=>{T||t()}}),N=B.useRole(w,{role:"dialog"}),L=B.useDismiss(w,{outsidePress:l}),{getFloatingProps:A}=B.useInteractions([N,L]);return e?s.jsx(B.FloatingPortal,{id:b,children:s.jsx(B.FloatingOverlay,{lockScroll:!0,style:x,className:f.mergeClasses("z-popup flex items-end bg-backdrop",C,h,c.DIAL_KIT_CLASS.bottomSheetOverlay),children:s.jsx(B.FloatingFocusManager,{context:w,initialFocus:S.floating,children:s.jsxs("div",{ref:S.setFloating,...A(),role:"dialog","aria-modal":"true","aria-labelledby":r?I:void 0,"aria-label":r?void 0:n,style:g,className:f.mergeClasses("flex max-h-[85dvh] w-full flex-col rounded-t-lg bg-layer-raised outline-hidden","animate-slideUp motion-reduce:animate-none",u,c.DIAL_KIT_CLASS.bottomSheet),children:[r&&s.jsxs("div",{className:f.mergeClasses("relative flex h-[60px] shrink-0 items-center justify-center border-b border-tertiary px-14",p),children:[a&&s.jsx(c.GhostIconButton,{"aria-label":o,className:"absolute start-4",onClick:a,icon:s.jsx(F.IconArrowLeft,{size:f.DIAL_ICON_SIZE.LG,stroke:f.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),s.jsx("h2",{id:I,className:f.mergeClasses("min-w-0 truncate text-primary",v??"dial-body-semi-text"),children:r}),s.jsx(c.CloseButton,{ariaLabel:i,onClose:t,size:c.ElementSize.Standard,className:"absolute end-4"})]}),s.jsx("div",{className:f.mergeClasses("min-h-0 overflow-y-auto",y),children:d})]})})})}):null};var lt=(e=>(e.Circle="circle",e.Square="square",e))(lt||{}),Pe=(e=>(e.Green1="green-1",e.Violet2="violet-2",e.Brown="brown",e.Red="red",e.Green2="green-2",e.Blue="blue",e.Violet1="violet-1",e))(Pe||{});const Ia={[Pe.Green1]:{background:"bg-green-1",foreground:"text-green-2"},[Pe.Violet2]:{background:"bg-violet-2",foreground:"text-violet-1"},[Pe.Brown]:{background:"bg-brown",foreground:"text-brown-2"},[Pe.Red]:{background:"bg-red",foreground:"text-red"},[Pe.Green2]:{background:"bg-green-2",foreground:"text-green-3"},[Pe.Blue]:{background:"bg-blue",foreground:"text-accent"},[Pe.Violet1]:{background:"bg-violet-1",foreground:"text-violet-2"}},hf=e=>{const t=Object.values(Ia);let r=0;for(let n=0;n<e.length;n++)r+=e.charCodeAt(n);return t[r%t.length]},en=e=>e.match(new RegExp("\\p{L}","u"))?.[0]??"",Sa=e=>{const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length>=2?(en(t[0])+en(t[1])).toUpperCase()||"?":t[0].replace(/[^\p{L}]/gu,"").slice(0,2).toUpperCase()||"?"},mf={[lt.Circle]:"rounded-full",[lt.Square]:"rounded-md"},Na=({name:e,initials:t,src:r,alt:n="",size:a=32,shape:o=lt.Circle,color:i,className:l,textClassName:d,imageClassName:u,onImageError:h})=>{const[p,g]=m.useState(),x=!!r&&p!==r,y=n!=="",v=I=>f.mergeClasses("inline-flex shrink-0 select-none items-center justify-center overflow-hidden",mf[o],I,l,c.DIAL_KIT_CLASS.avatar);if(x)return s.jsx("img",{src:r,alt:n,width:a,height:a,className:f.mergeClasses(v(u),"object-cover"),onError:I=>{g(r),h?.(I)}});const{background:b,foreground:C}=i??hf(e);return s.jsx("span",{role:y?"img":void 0,"aria-label":y?n:void 0,"aria-hidden":y?void 0:!0,className:v(f.mergeClasses(b,C)),style:{width:a,height:a,fontSize:d?void 0:Math.round(a*.4)},children:s.jsx("span",{className:f.mergeClasses("leading-none",d??"font-semibold"),children:t??Sa(e)})})};var pe=(e=>(e.Model="model",e.Agent="agent",e.Toolset="toolset",e.Skill="skill",e.Prompt="prompt",e))(pe||{});const gf={[pe.Model]:"Model",[pe.Agent]:"Agent",[pe.Toolset]:"Toolset",[pe.Skill]:"Skill",[pe.Prompt]:"Prompt"},tn={[pe.Model]:"text-blue",[pe.Agent]:"text-green-1",[pe.Toolset]:"text-brown-2",[pe.Skill]:"text-violet-1",[pe.Prompt]:"text-violet-2"},xf={[pe.Model]:"bg-blue",[pe.Agent]:"bg-green-2",[pe.Toolset]:"bg-brown",[pe.Skill]:"bg-violet-2",[pe.Prompt]:"bg-violet-1"},bf=["h1","h2","h3","h4","h5","h6"],vf=e=>bf[Math.min(6,Math.max(1,Math.round(e)))-1],wa=({item:e,labels:t,showType:r=!0,showVersion:n=!0,hasFeaturedTag:a=!0,iconSize:o=48,headingLevel:i=3,query:l,footer:d,statusBadge:u,className:h,nameClassName:p="dial-h3-text",typeClassName:g="dial-caption-lead-semi-text",versionClassName:x="dial-tiny-text",iconClassName:y,featuredChipClassName:v})=>{const b=vf(i),C=a&&!!e.isFeatured,I=u!=null||C,S=n?e.version:void 0,w=r?t?.type??gf[e.type]:void 0;return s.jsxs("div",{className:f.mergeClasses("flex items-start gap-2",h,c.DIAL_KIT_CLASS.entityIdentity),children:[s.jsx(Na,{name:e.name,src:e.iconUrl,size:o,shape:lt.Square,imageClassName:"bg-entity-icon",className:f.mergeClasses("rounded-[14px]",y)}),s.jsxs("div",{className:f.mergeClasses("flex min-w-0 flex-1 flex-col gap-1",d!=null&&"self-stretch"),children:[(I||w)&&s.jsxs("div",{className:"relative flex items-center justify-between",children:[w&&s.jsx("span",{className:f.mergeClasses("uppercase",g,tn[e.type]),children:w}),I&&s.jsxs("div",{className:"absolute end-0 top-[-6px] flex items-center gap-2",children:[u,C&&s.jsx("span",{className:f.mergeClasses("flex h-6 items-center justify-center rounded-2xl px-2","dial-caption-lead-semi-text",xf[e.type],tn[e.type],v),children:t?.featured??"Featured"})]})]}),s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(b,{className:f.mergeClasses("min-w-0 shrink text-primary",p),children:l?s.jsx(c.Highlight,{text:e.name,query:l,maxLines:1}):s.jsx(c.EllipsisTooltip,{text:e.name})}),S!=null&&s.jsx(c.EllipsisTooltip,{className:f.mergeClasses("max-w-[30%] shrink-0 text-secondary",x),text:S})]}),d!=null&&d]})]})},Sr="bg-control-neutral-active",yf=({iconSize:e})=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"shrink-0 overflow-hidden rounded-[14px]",children:s.jsx(Ht,{variant:Ee.Rectangular,width:e,height:e,className:Sr})}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s.jsx(Ht,{variant:Ee.Text,width:"30%",height:12,className:Sr}),s.jsx(Ht,{variant:Ee.Text,width:"60%",height:16,className:Sr})]})]}),Cf=({entityId:e,item:t,isLoading:r=!1,isDisabled:n=!1,error:a,details:o,labels:i,showType:l=!0,iconSize:d=44,headingLevel:u=4,className:h})=>{const p=o!=null?s.jsx("span",{className:"dial-caption-text text-secondary",children:o}):void 0,g=()=>e?r?s.jsx(yf,{iconSize:d}):t==null?s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"dial-body-semi-text block truncate text-secondary",children:e}),p]}):s.jsx(wa,{item:t,labels:{type:i?.type},hasFeaturedTag:!1,iconSize:d,headingLevel:u,nameClassName:"dial-body-semi-text",showType:l,footer:p}):s.jsx("span",{className:"dial-body-semi-text block truncate text-secondary",children:i?.placeholder??"Not selected"});return s.jsxs("div",{children:[s.jsx("div",{className:f.mergeClasses("rounded-2xl border bg-layer-raised p-3",a?"border-error":"border-tertiary",n&&"opacity-50",h,c.DIAL_KIT_CLASS.selectedEntityCard),children:g()}),s.jsx(c.ErrorText,{text:a,className:"mt-1 block"})]})},If=({open:e,onClose:t,header:r,ariaLabel:n,headerActions:a,onBack:o,backAriaLabel:i="Back",backDisabled:l=!1,closeAriaLabel:d="Close",closeDisabled:u=!1,hideClose:h=!1,closeOnOutsideClick:p=!0,children:g,className:x,overlayClassName:y,headerClassName:v,style:b,overlayStyle:C,bodyClassName:I,titleClassName:S,portalId:w})=>{const N=c.useThemeScope(),L=`side-drawer-title-${m.useId()}`,A=typeof r=="string",{refs:T,context:j}=B.useFloating({open:e,onOpenChange:O=>{O||t()}}),D=B.useRole(j,{role:"dialog"}),E=B.useDismiss(j,{outsidePress:p}),{getFloatingProps:k}=B.useInteractions([D,E]),P=r!=null||o!=null||!h;return s.jsx(B.FloatingPortal,{id:w,children:s.jsx(B.FloatingOverlay,{lockScroll:e,style:C,className:f.mergeClasses("z-popup bg-backdrop transition-opacity duration-300 motion-reduce:transition-none",e?"opacity-100":"pointer-events-none opacity-0",N,y),children:s.jsx(B.FloatingFocusManager,{context:j,disabled:!e,initialFocus:T.floating,children:s.jsxs("div",{ref:T.setFloating,...k(),role:"dialog","aria-modal":"true","aria-labelledby":A?L:void 0,"aria-label":A?void 0:n,inert:!e,style:b,className:f.mergeClasses("fixed inset-y-0 end-0 flex w-full flex-col overflow-hidden bg-layer-raised outline-hidden","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",x,c.DIAL_KIT_CLASS.sideDrawer),children:[P&&s.jsxs("div",{className:f.mergeClasses("flex shrink-0 items-center gap-2 border-b border-tertiary px-6 py-3",v),children:[o&&s.jsx(c.GhostIconButton,{"aria-label":i,disabled:l,onClick:o,icon:s.jsx(F.IconChevronLeft,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),A?s.jsx("h2",{id:L,className:f.mergeClasses("min-w-0 flex-1 truncate text-primary",S??"dial-h2-text"),children:r}):s.jsx("div",{className:"min-w-0 flex-1",children:r}),a,!h&&s.jsx(c.CloseButton,{ariaLabel:d,onClose:t,disabled:u,size:c.ElementSize.Standard})]}),s.jsx("div",{className:f.mergeClasses("min-h-0 flex-1 overflow-y-auto",I),children:g})]})})})})},Sf=4,Nf=24,rn=e=>parseFloat(e)||0,wf=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},jf=()=>{},Df=({id:e,value:t,defaultValue:r,size:n=c.ElementSize.Standard,labelProps:a,placeholder:o,caption:i,error:l,invalid:d,disabled:u=!1,readOnly:h=!1,collapseTagOverflow:p=!1,ariaLabel:g,tagListLabel:x="Tags",className:y,fieldClassName:v,tagClassName:b,onChange:C})=>{const I=m.useId(),S=e||I,w=n===c.ElementSize.Small,N=m.useRef(null),L=m.useRef([]),A=m.useRef(null),T=t!==void 0,[j,D]=m.useState(r??[]),E=T?t:j,k=E.length,[P,O]=m.useState(""),[R,M]=m.useState(k),H=!h&&!u,W=m.useCallback(_=>{T||D(_),C?.(_)},[T,C]),K=m.useCallback(_=>U=>{L.current[_]=U},[]),V=m.useCallback(()=>{const _=N.current;if(!_||_.clientWidth===0){M(E.length);return}const{paddingLeft:U,paddingRight:de}=getComputedStyle(_);M(ta({availableWidth:_.clientWidth-rn(U)-rn(de)-(h?0:Nf),tagWidths:E.map((ne,ge)=>L.current[ge]?.offsetWidth??0),overflowChipWidth:A.current?.offsetWidth??0,gap:Sf}))},[h,E]);m.useEffect(()=>{if(!p){M(k);return}const _=N.current;if(!_)return;const U=new ResizeObserver(()=>V());return U.observe(_),V(),()=>U.disconnect()},[p,V,k]);const G=f.mergeClasses(p?"shrink-0":"min-w-0",b),J=_=>{const U=wf(_.trim()).trim();!U||E.includes(U)||W([...E,U])},re=_=>{W(E.filter(U=>U!==_))},q=()=>{J(P),O("")},Y=_=>{if(H){if(_.key==="Enter"||_.key===","){_.preventDefault(),q();return}_.key==="Backspace"&&!P&&k>0&&(_.preventDefault(),W(E.slice(0,-1)))}},se=()=>{H&&P.trim()&&q()},le=p?E.slice(0,R):E,oe=p?E.slice(R):[],me=oe.join(", "),ve=k>0&&s.jsxs("span",{role:"list","aria-label":x,className:f.mergeClasses("relative flex min-w-0 items-center gap-1",p?"flex-nowrap":"flex-wrap"),children:[le.map(_=>s.jsx(Le,{role:"listitem",label:_,className:G,disabled:u,closable:H,onRemove:H?()=>re(_):void 0},_)),oe.length>0&&s.jsx(Le,{role:"listitem",label:`+${oe.length}`,"aria-label":me,title:me,className:f.mergeClasses("shrink-0",b),disabled:u}),p&&s.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[E.map((_,U)=>s.jsx("span",{ref:K(U),className:"inline-flex",children:s.jsx(Le,{label:_,className:b,disabled:u,closable:H,onRemove:H?jf:void 0})},_)),s.jsx("span",{ref:A,className:"inline-flex",children:s.jsx(Le,{label:`+${k}`,className:b})})]})]});return s.jsx(c.Input,{id:S,size:n,labelProps:a,caption:i,error:l,invalid:d,disabled:u,readOnly:h,value:P,placeholder:k>0?void 0:o,"aria-label":g,wrapperRef:N,onChange:_=>O(_??""),onKeyDown:Y,onBlur:se,containerClassName:f.mergeClasses("w-full",y),wrapperClassName:f.mergeClasses(k>0&&["!h-auto",w?"min-h-[24px] py-0.5":"min-h-[40px] py-[3px]",p?"flex-nowrap overflow-hidden":"flex-wrap"],v,c.DIAL_KIT_CLASS.tagInput),className:f.mergeClasses("w-auto flex-1",p?"min-w-[24px]":"min-w-[100px]",h&&"cursor-default"),children:ve})},Tf=(e,t,r,n)=>{const a=t.trim().toLowerCase(),o=new Set(r);return e.filter(({value:i,label:l,description:d})=>!o.has(i)&&[l,i,d].some(u=>u?.toLowerCase().includes(a))).slice(0,Math.max(n,0))},Ef=5,Lf=({id:e,value:t,defaultValue:r,suggestions:n,maxSuggestions:a=Ef,openOnFocus:o=!1,size:i=c.ElementSize.Standard,labelProps:l,placeholder:d,caption:u,error:h,invalid:p=!1,disabled:g=!1,readOnly:x=!1,ariaLabel:y,tagListLabel:v="Tags",getRemoveTagLabel:b,className:C,fieldClassName:I,tagClassName:S,listClassName:w,onChange:N})=>{const L=m.useId(),A=e||L,T=`${A}-listbox`,j=c.useThemeScope(),D=i===c.ElementSize.Small,E=t!==void 0,[k,P]=m.useState(r??[]),O=E?t:k,R=O.length>0,M=!x&&!g,[H,W]=m.useState(""),[K,V]=m.useState(!1),[G,J]=m.useState(0),re=!H.trim(),q=m.useMemo(()=>Tf(n,H,O,o&&re?n.length:a),[H,re,a,o,n,O]),Y=K&&M&&q.length>0,se=Math.min(G,q.length-1),le=Y&&se>=0,oe=Q=>`${T}-option-${Q}`,{refs:me,floatingStyles:ve}=B.useFloating({open:Y,placement:"bottom-start",whileElementsMounted:B.autoUpdate,middleware:[B.offset(c.overlayGap),B.flip({padding:c.overlayGap}),B.size({padding:c.overlayGap,apply({rects:Q,availableHeight:ce,elements:he}){he.floating.style.width=`${Math.round(Q.reference.width)}px`,he.floating.style.maxHeight=`${Math.floor(ce)}px`}})]}),_=m.useCallback(Q=>{E||P(Q),N?.(Q)},[E,N]),U=()=>{V(!1),J(0)},de=()=>{!o||!M||(V(!0),J(re?-1:0))},ne=Q=>{const ce=Q.trim();ce&&!O.includes(ce)&&_([...O,ce]),W(""),o?J(-1):U()},ge=Q=>_(O.filter(ce=>ce!==Q)),Qe=Q=>{const ce=Q??"",he=!!ce.trim();W(ce),V(he||o),J(he?0:-1)},ft=Q=>{if(M)switch(Q.key){case"ArrowDown":case"ArrowUp":{if(Q.preventDefault(),!Y){V(!0),J(0);return}const ce=Q.key==="ArrowDown"?1:-1,he=se<0?Math.min(-ce,0):se;J((he+ce+q.length)%q.length);return}case"Enter":case",":Q.preventDefault(),ne(le?q[se].value:H);return;case"Escape":Y&&Q.preventDefault(),U();return;case"Backspace":!H&&R&&(Q.preventDefault(),_(O.slice(0,-1)));return}},pt=Q=>Q.preventDefault();return s.jsxs(s.Fragment,{children:[s.jsx(c.Input,{id:A,role:"combobox","aria-autocomplete":"list","aria-expanded":Y,"aria-controls":T,"aria-activedescendant":le?oe(se):void 0,"aria-invalid":p||void 0,"aria-label":y,size:i,labelProps:l,caption:u,error:h,invalid:p,disabled:g,readOnly:x,value:H,placeholder:R?void 0:d,wrapperRef:me.setReference,onChange:Qe,onKeyDown:ft,onFocus:de,onClick:de,onBlur:U,containerClassName:f.mergeClasses("w-full",C),wrapperClassName:f.mergeClasses(R&&["!h-auto flex-wrap gap-1 py-2",D?"min-h-[24px]":"min-h-[40px]"],I,c.DIAL_KIT_CLASS.autocompleteTagInput),className:f.mergeClasses("w-auto min-w-[100px] flex-1",x&&"cursor-default"),children:R&&s.jsx("span",{role:"list","aria-label":v,className:"flex min-w-0 flex-wrap items-center gap-1",children:O.map(Q=>s.jsx(Le,{role:"listitem",label:Q,className:f.mergeClasses(qt,"min-w-0",S),disabled:g,closable:M,removeLabel:b?.(Q),onRemove:M?()=>ge(Q):void 0},Q))})}),s.jsx(B.FloatingPortal,{children:s.jsx("div",{ref:me.setFloating,id:T,role:"listbox","aria-label":v,hidden:!Y,style:ve,className:f.mergeClasses("z-floating overflow-y-auto",c.overlaySurfaceClassName,c.overlayListClassName,!Y&&"hidden",j,w),children:Y&&q.map((Q,ce)=>{const he=ce===se;return s.jsx(c.MenuItem,{id:oe(ce),role:"option","aria-selected":he,tabIndex:-1,label:Q.label,description:Q.description,mark:c.MenuItemMark.Tint,selected:he,onMouseDown:pt,onMouseEnter:()=>J(ce),onClick:()=>ne(Q.value)},Q.value)})})})]})},Af=(e,t)=>{if(e<=0||t<=0)return[];const r=Math.floor(e/t+1e-9);return Array.from({length:r},(n,a)=>(a+1)*t/e*100)},ja=e=>(e.toString().split(".")[1]??"").length,Of=(e,t,r,n)=>{const a=Math.min(r,Math.max(t,e));if(n<=0)return a;const o=Math.round(Number(((a-t)/n).toFixed(9))),i=t+o*n;return Number(Math.min(r,i).toFixed(ja(n)))},_f=12,sn=e=>`calc(${e}% + ${(.5-e/100)*_f}px)`,kf=(e,t)=>e&&t?"grid-cols-[auto_minmax(0,1fr)_auto]":e?"grid-cols-[auto_minmax(0,1fr)]":t?"grid-cols-[minmax(0,1fr)_auto]":"grid-cols-[minmax(0,1fr)]",Rf=({id:e,value:t,min:r=0,max:n=1,step:a=.1,disabled:o,labelProps:i,labels:l,formatValue:d,showValue:u=!1,showTooltip:h=!1,showTicks:p=!1,leftContent:g,rightContent:x,showValueInput:y=!1,valueInputAriaLabel:v,caption:b,error:C,onChange:I,containerClassName:S,trackClassName:w,fillClassName:N,className:L,...A})=>{const T=m.useId(),j=e??T,D=b&&!C?`${j}-caption`:void 0,E=C?`${j}-error`:void 0,k=n-r,P=k>0?Math.min(100,Math.max(0,(t-r)/k*100)):0,O=sn(P),R=p&&!o?Af(k,a):[],M=h&&!o,H=g!=null,W=y||x!=null,K=ja(a),[V,G]=m.useState(null),J=d?d(t):t.toFixed(K),re=m.useCallback(se=>{I?.(Number(se.target.value))},[I]),q=m.useCallback(se=>{const le=se==null?"":String(se);G(le);const oe=Number(le);le!==""&&Number.isFinite(oe)&&I?.(Of(oe,r,n,a))},[n,r,I,a]),Y=m.useCallback(()=>G(null),[]);return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-2",S),children:[(i||u)&&s.jsxs("div",{className:"flex items-center gap-2",children:[i&&s.jsx(c.Label,{...i,htmlFor:j}),u&&s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("dial-small-text ml-auto",o?"text-control-disable-primary":"text-primary"),children:J})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:f.mergeClasses("grid items-center gap-y-1",y?"gap-x-2":"gap-x-3",kf(H,W),M&&"mt-2"),children:[H&&s.jsx("div",{className:"flex items-center",children:g}),s.jsxs("div",{className:"relative flex h-6 items-center",children:[s.jsx("div",{className:f.mergeClasses("pointer-events-none absolute inset-x-0 h-1 rounded-full",o?"bg-control-disable-primary":"bg-control-accent-muted",w)}),R.map(se=>s.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute size-0.5 -translate-x-1/2 rounded-full border border-accent-focus",style:{left:sn(se)}},se)),s.jsx("div",{className:f.mergeClasses("pointer-events-none absolute left-0 h-1 rounded-full",o?"bg-control-disable-secondary":"bg-control-accent",N),style:{width:O}}),M&&s.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none absolute bottom-full mb-0.5 flex -translate-x-1/2 flex-col items-center",style:{left:O},children:[s.jsx("span",{className:"whitespace-nowrap rounded-md bg-control-inverted px-2 py-0.5 dial-small-text text-control-inverted shadow-xs",children:J}),s.jsx("svg",{width:"8",height:"4",viewBox:"0 0 8 4",className:"fill-control-inverted",children:s.jsx("path",{d:"M0 0h8L4 4z"})})]}),s.jsx("input",{...A,type:"range",id:j,value:t,min:r,max:n,step:a,disabled:o,onChange:re,"aria-label":c.resolveAccessibleName(typeof i?.label!="string"?A["aria-label"]:void 0),"aria-valuetext":d?J:void 0,"aria-describedby":E??D,className:f.mergeClasses("dial-kit-slider absolute inset-0 h-full w-full",L)})]}),W&&s.jsx("div",{className:"flex items-center",children:y?s.jsx(ls,{"aria-label":c.resolveAccessibleName(v??(typeof i?.label=="string"?i.label:void 0)),value:V??t.toFixed(K),min:r,max:n,step:a,disabled:o,size:c.ElementSize.Small,containerClassName:"w-12",className:"text-center",onChange:q,onBlur:Y}):x}),l&&s.jsx("div",{className:f.mergeClasses("dial-tiny-text flex text-secondary",H&&"col-start-2"),children:l.length===3?s.jsxs(s.Fragment,{children:[s.jsx("span",{children:l[0]}),s.jsx("span",{className:"flex-1 text-center",children:l[1]}),s.jsx("span",{children:l[2]})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{children:l[0]}),s.jsx("span",{className:"ml-auto",children:l[1]})]})})]}),s.jsx(c.ErrorText,{id:E,text:C}),!C&&s.jsx(c.CaptionText,{id:D,text:b})]})]})},Mf=48,Pf=({children:e,title:t,width:r=280,collapsedWidth:n=Mf,isOpened:a,defaultOpened:o=!0,onToggle:i,additionalButtons:l,ariaLabel:d="Sidebar",collapseLabel:u="Collapse sidebar",expandLabel:h="Expand sidebar",className:p,titleClassName:g,contentClassName:x,footerClassName:y})=>{const v=a!==void 0,[b,C]=m.useState(o),I=v?a:b,S=`collapsible-sidebar-content-${m.useId()}`,w=I?u:h,N=L=>{const A=!I;v||C(A),i?.(A,L)};return s.jsxs("aside",{"aria-label":d,style:{width:`${I?r:n}px`},className:f.mergeClasses("flex flex-col justify-between",p,c.DIAL_KIT_CLASS.collapsibleSidebar),children:[s.jsx("div",{id:S,hidden:!I,className:f.mergeClasses("min-h-0 flex-1 overflow-auto p-4",x),children:e}),s.jsx("div",{hidden:I,className:f.mergeClasses("rotate-180 px-3 py-4 [writing-mode:tb-rl] dial-small-text text-primary",g),children:t}),s.jsxs("div",{className:f.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",y),children:[I&&l,s.jsx(c.IconButton,{variant:c.ButtonVariant.Primary,appearance:c.ButtonAppearance.Ghost,size:c.ElementSize.Standard,onClick:N,"aria-label":w,"aria-expanded":I,"aria-controls":S,tooltipProps:{tooltip:w},icon:I?s.jsx(F.IconChevronsLeft,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):s.jsx(F.IconChevronsRight,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})};var ie=function(){return ie=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},ie.apply(this,arguments)},nn={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},an={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Pt={width:"20px",height:"20px",position:"absolute",zIndex:1},Bf={top:ie(ie({},nn),{top:"-5px"}),right:ie(ie({},an),{left:void 0,right:"-5px"}),bottom:ie(ie({},nn),{top:void 0,bottom:"-5px"}),left:ie(ie({},an),{left:"-5px"}),topRight:ie(ie({},Pt),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:ie(ie({},Pt),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:ie(ie({},Pt),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:ie(ie({},Pt),{left:"-10px",top:"-10px",cursor:"nw-resize"})},zf=m.memo(function(e){var t=e.onResizeStart,r=e.direction,n=e.children,a=e.replaceStyles,o=e.className,i=m.useCallback(function(u){t(u,r)},[t,r]),l=m.useCallback(function(u){t(u,r)},[t,r]),d=m.useMemo(function(){return ie(ie({position:"absolute",userSelect:"none"},Bf[r]),a??{})},[a,r]);return s.jsx("div",{className:o||void 0,style:d,onMouseDown:i,onTouchStart:l,children:n})}),Ff=(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Te=function(){return Te=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Te.apply(this,arguments)},Hf={width:"auto",height:"auto"},Bt=function(e,t,r){return Math.max(Math.min(e,r),t)},on=function(e,t,r){var n=Math.round(e/t);return n*t+r*(n-1)},rt=function(e,t){return new RegExp(e,"i").test(t)},zt=function(e){return!!(e.touches&&e.touches.length)},$f=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},ln=function(e,t,r){r===void 0&&(r=0);var n=t.reduce(function(o,i,l){return Math.abs(i-e)<Math.abs(t[o]-e)?l:o},0),a=Math.abs(t[n]-e);return r===0||a<r?t[n]:e},Nr=function(e){return e=e.toString(),e==="auto"||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:"".concat(e,"px")},Ft=function(e,t,r,n){if(e&&typeof e=="string"){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%")){var a=Number(e.replace("%",""))/100;return t*a}if(e.endsWith("vw")){var a=Number(e.replace("vw",""))/100;return r*a}if(e.endsWith("vh")){var a=Number(e.replace("vh",""))/100;return n*a}}return e},Kf=function(e,t,r,n,a,o,i){return n=Ft(n,e.width,t,r),a=Ft(a,e.height,t,r),o=Ft(o,e.width,t,r),i=Ft(i,e.height,t,r),{maxWidth:typeof n>"u"?void 0:Number(n),maxHeight:typeof a>"u"?void 0:Number(a),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof i>"u"?void 0:Number(i)}},Vf=function(e){return Array.isArray(e)?e:[e,e]},Wf=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],cn="__resizable_base__",Gf=(function(e){Ff(t,e);function t(r){var n,a,o,i,l=e.call(this,r)||this;return l.ratio=1,l.resizable=null,l.parentLeft=0,l.parentTop=0,l.resizableLeft=0,l.resizableRight=0,l.resizableTop=0,l.resizableBottom=0,l.targetLeft=0,l.targetTop=0,l.delta={width:0,height:0},l.appendBase=function(){if(!l.resizable||!l.window)return null;var d=l.parentNode;if(!d)return null;var u=l.window.document.createElement("div");return u.style.width="100%",u.style.height="100%",u.style.position="absolute",u.style.transform="scale(0, 0)",u.style.left="0",u.style.flex="0 0 100%",u.classList?u.classList.add(cn):u.className+=cn,d.appendChild(u),u},l.removeBase=function(d){var u=l.parentNode;u&&u.removeChild(d)},l.state={isResizing:!1,width:(a=(n=l.propsSize)===null||n===void 0?void 0:n.width)!==null&&a!==void 0?a:"auto",height:(i=(o=l.propsSize)===null||o===void 0?void 0:o.height)!==null&&i!==void 0?i:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},l.onResizeStart=l.onResizeStart.bind(l),l.onMouseMove=l.onMouseMove.bind(l),l.onMouseUp=l.onMouseUp.bind(l),l}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||Hf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var r=0,n=0;if(this.resizable&&this.window){var a=this.resizable.offsetWidth,o=this.resizable.offsetHeight,i=this.resizable.style.position;i!=="relative"&&(this.resizable.style.position="relative"),r=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:a,n=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=i}return{width:r,height:n}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var r=this,n=this.props.size,a=function(l){var d;if(typeof r.state[l]>"u"||r.state[l]==="auto")return"auto";if(r.propsSize&&r.propsSize[l]&&(!((d=r.propsSize[l])===null||d===void 0)&&d.toString().endsWith("%"))){if(r.state[l].toString().endsWith("%"))return r.state[l].toString();var u=r.getParentSize(),h=Number(r.state[l].toString().replace("px","")),p=h/u[l]*100;return"".concat(p,"%")}return Nr(r.state[l])},o=n&&typeof n.width<"u"&&!this.state.isResizing?Nr(n.width):a("width"),i=n&&typeof n.height<"u"&&!this.state.isResizing?Nr(n.height):a("height");return{width:o,height:i}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var r=this.appendBase();if(!r)return{width:0,height:0};var n=!1,a=this.parentNode.style.flexWrap;a!=="wrap"&&(n=!0,this.parentNode.style.flexWrap="wrap"),r.style.position="relative",r.style.minWidth="100%",r.style.minHeight="100%";var o={width:r.offsetWidth,height:r.offsetHeight};return n&&(this.parentNode.style.flexWrap=a),this.removeBase(r),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var r=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:r.flexBasis!=="auto"?r.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(r,n){var a=this.propsSize&&this.propsSize[n];return this.state[n]==="auto"&&this.state.original[n]===r&&(typeof a>"u"||a==="auto")?"auto":r},t.prototype.calculateNewMaxFromBoundary=function(r,n){var a=this.props.boundsByDirection,o=this.state.direction,i=a&&rt("left",o),l=a&&rt("top",o),d,u;if(this.props.bounds==="parent"){var h=this.parentNode;h&&(d=i?this.resizableRight-this.parentLeft:h.offsetWidth+(this.parentLeft-this.resizableLeft),u=l?this.resizableBottom-this.parentTop:h.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(d=i?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=l?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(d=i?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=l?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return d&&Number.isFinite(d)&&(r=r&&r<d?r:d),u&&Number.isFinite(u)&&(n=n&&n<u?n:u),{maxWidth:r,maxHeight:n}},t.prototype.calculateNewSizeFromDirection=function(r,n){var a=this.props.scale||1,o=Vf(this.props.resizeRatio||1),i=o[0],l=o[1],d=this.state,u=d.direction,h=d.original,p=this.props,g=p.lockAspectRatio,x=p.lockAspectRatioExtraHeight,y=p.lockAspectRatioExtraWidth,v=h.width,b=h.height,C=x||0,I=y||0;return rt("right",u)&&(v=h.width+(r-h.x)*i/a,g&&(b=(v-I)/this.ratio+C)),rt("left",u)&&(v=h.width-(r-h.x)*i/a,g&&(b=(v-I)/this.ratio+C)),rt("bottom",u)&&(b=h.height+(n-h.y)*l/a,g&&(v=(b-C)*this.ratio+I)),rt("top",u)&&(b=h.height-(n-h.y)*l/a,g&&(v=(b-C)*this.ratio+I)),{newWidth:v,newHeight:b}},t.prototype.calculateNewSizeFromAspectRatio=function(r,n,a,o){var i=this.props,l=i.lockAspectRatio,d=i.lockAspectRatioExtraHeight,u=i.lockAspectRatioExtraWidth,h=typeof o.width>"u"?10:o.width,p=typeof a.width>"u"||a.width<0?r:a.width,g=typeof o.height>"u"?10:o.height,x=typeof a.height>"u"||a.height<0?n:a.height,y=d||0,v=u||0;if(l){var b=(g-y)*this.ratio+v,C=(x-y)*this.ratio+v,I=(h-v)/this.ratio+y,S=(p-v)/this.ratio+y,w=Math.max(h,b),N=Math.min(p,C),L=Math.max(g,I),A=Math.min(x,S);r=Bt(r,w,N),n=Bt(n,L,A)}else r=Bt(r,h,p),n=Bt(n,g,x);return{newWidth:r,newHeight:n}},t.prototype.setBoundingClientRect=function(){var r=1/(this.props.scale||1);if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var a=n.getBoundingClientRect();this.parentLeft=a.left*r,this.parentTop=a.top*r}}if(this.props.bounds&&typeof this.props.bounds!="string"){var o=this.props.bounds.getBoundingClientRect();this.targetLeft=o.left*r,this.targetTop=o.top*r}if(this.resizable){var i=this.resizable.getBoundingClientRect(),l=i.left,d=i.top,u=i.right,h=i.bottom;this.resizableLeft=l*r,this.resizableRight=u*r,this.resizableTop=d*r,this.resizableBottom=h*r}},t.prototype.onResizeStart=function(r,n){if(!(!this.resizable||!this.window)){var a=0,o=0;if(r.nativeEvent&&$f(r.nativeEvent)?(a=r.nativeEvent.clientX,o=r.nativeEvent.clientY):r.nativeEvent&&zt(r.nativeEvent)&&(a=r.nativeEvent.touches[0].clientX,o=r.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var i=this.props.onResizeStart(r,n,this.resizable);if(i===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var l,d=this.window.getComputedStyle(this.resizable);if(d.flexBasis!=="auto"){var u=this.parentNode;if(u){var h=this.window.getComputedStyle(u).flexDirection;this.flexDir=h.startsWith("row")?"row":"column",l=d.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var p={original:{x:a,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Te(Te({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(r.target).cursor||"auto"}),direction:n,flexBasis:l};this.setState(p)}},t.prototype.onMouseMove=function(r){var n=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&zt(r))try{r.preventDefault(),r.stopPropagation()}catch{}var a=this.props,o=a.maxWidth,i=a.maxHeight,l=a.minWidth,d=a.minHeight,u=zt(r)?r.touches[0].clientX:r.clientX,h=zt(r)?r.touches[0].clientY:r.clientY,p=this.state,g=p.direction,x=p.original,y=p.width,v=p.height,b=this.getParentSize(),C=Kf(b,this.window.innerWidth,this.window.innerHeight,o,i,l,d);o=C.maxWidth,i=C.maxHeight,l=C.minWidth,d=C.minHeight;var I=this.calculateNewSizeFromDirection(u,h),S=I.newHeight,w=I.newWidth,N=this.calculateNewMaxFromBoundary(o,i);this.props.snap&&this.props.snap.x&&(w=ln(w,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(S=ln(S,this.props.snap.y,this.props.snapGap));var L=this.calculateNewSizeFromAspectRatio(w,S,{width:N.maxWidth,height:N.maxHeight},{width:l,height:d});if(w=L.newWidth,S=L.newHeight,this.props.grid){var A=on(w,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),T=on(S,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),j=this.props.snapGap||0,D=j===0||Math.abs(A-w)<=j?A:w,E=j===0||Math.abs(T-S)<=j?T:S;w=D,S=E}var k={width:w-x.width,height:S-x.height};if(this.delta=k,y&&typeof y=="string"){if(y.endsWith("%")){var P=w/b.width*100;w="".concat(P,"%")}else if(y.endsWith("vw")){var O=w/this.window.innerWidth*100;w="".concat(O,"vw")}else if(y.endsWith("vh")){var R=w/this.window.innerHeight*100;w="".concat(R,"vh")}}if(v&&typeof v=="string"){if(v.endsWith("%")){var P=S/b.height*100;S="".concat(P,"%")}else if(v.endsWith("vw")){var O=S/this.window.innerWidth*100;S="".concat(O,"vw")}else if(v.endsWith("vh")){var R=S/this.window.innerHeight*100;S="".concat(R,"vh")}}var M={width:this.createSizeForCssProperty(w,"width"),height:this.createSizeForCssProperty(S,"height")};this.flexDir==="row"?M.flexBasis=M.width:this.flexDir==="column"&&(M.flexBasis=M.height);var H=this.state.width!==M.width,W=this.state.height!==M.height,K=this.state.flexBasis!==M.flexBasis,V=H||W||K;V&&za.flushSync(function(){n.setState(M)}),this.props.onResize&&V&&this.props.onResize(r,g,this.resizable,k)}},t.prototype.onMouseUp=function(r){var n,a,o=this.state,i=o.isResizing,l=o.direction;o.original,!(!i||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(r,l,this.resizable,this.delta),this.props.size&&this.setState({width:(n=this.props.size.width)!==null&&n!==void 0?n:"auto",height:(a=this.props.size.height)!==null&&a!==void 0?a:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Te(Te({},this.state.backgroundStyle),{cursor:"auto"})}))},t.prototype.updateSize=function(r){var n,a;this.setState({width:(n=r.width)!==null&&n!==void 0?n:"auto",height:(a=r.height)!==null&&a!==void 0?a:"auto"})},t.prototype.renderResizer=function(){var r=this,n=this.props,a=n.enable,o=n.handleStyles,i=n.handleClasses,l=n.handleWrapperStyle,d=n.handleWrapperClass,u=n.handleComponent;if(!a)return null;var h=Object.keys(a).map(function(p){return a[p]!==!1?s.jsx(zf,{direction:p,onResizeStart:r.onResizeStart,replaceStyles:o&&o[p],className:i&&i[p],children:u&&u[p]?u[p]:null},p):null});return s.jsx("div",{className:d,style:l,children:h})},t.prototype.render=function(){var r=this,n=Object.keys(this.props).reduce(function(i,l){return Wf.indexOf(l)!==-1||(i[l]=r.props[l]),i},{}),a=Te(Te(Te({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(a.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return s.jsxs(o,Te({style:a,className:this.props.className},n,{ref:function(i){i&&(r.resizable=i)},children:[this.state.isResizing&&s.jsx("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t})(m.PureComponent);const Uf=({side:e,isResizing:t,width:r,minWidth:n,maxWidth:a,step:o,ariaLabel:i,onWidthChange:l,customHandler:d,handlerClassName:u})=>{const h=e===Ct.Left,p=h?F.IconChevronLeft:F.IconChevronRight,g=x=>{let y;switch(x.key){case"ArrowLeft":y=r+(h?o:-o);break;case"ArrowRight":y=r+(h?-o:o);break;case"Home":y=n;break;case"End":y=a;break;default:return}x.preventDefault(),l(y)};return s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":i,"aria-valuenow":r,"aria-valuemin":n,"aria-valuemax":a,tabIndex:0,onKeyDown:g,className:f.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",u),children:d??s.jsx(p,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses("pointer-events-none absolute top-1/2 -translate-y-1/2",h?"right-full":"left-full")})})},Zf=16,Da=({children:e,minWidth:t,maxWidth:r,width:n,defaultWidth:a,onResizeStop:o,onResize:i,side:l=Ct.Right,keyboardStep:d=Zf,ariaLabel:u="Resize panel",className:h,resizeHandlerClassName:p,resizeHandler:g})=>{const[x,y]=m.useState(!1),[v,b]=m.useState(a??t),C=n!==void 0,I=C?n:v,S=m.useRef(null),w=m.useCallback(()=>{y(!0)},[]),N=m.useCallback(()=>{y(!1);const T=S.current?.resizable?.getBoundingClientRect(),j=T?Math.round(T.width):t;C||b(j),o?.(j)},[o,C,t]),L=m.useCallback(T=>{const j=Math.min(r,Math.max(t,T));j!==I&&(C||(b(j),S.current?.updateSize({width:j,height:"100%"})),i?.(j),o?.(j))},[r,t,I,C,i,o]),A=m.useMemo(()=>{const T=l===Ct.Left,j=s.jsx(Uf,{side:l,isResizing:x,width:I,minWidth:t,maxWidth:r,step:d,ariaLabel:u,onWidthChange:L,customHandler:g,handlerClassName:p});return{size:C?{width:I,height:"100%"}:void 0,defaultSize:C?void 0:{width:I,height:"100%"},minWidth:t,maxWidth:r,enable:{left:T,right:!T},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:T?j:void 0,right:T?void 0:j},onResizeStart:w,onResize:(D,E,k)=>{i?.(Math.round(k.offsetWidth))},onResizeStop:N}},[l,C,I,t,r,d,u,L,g,p,x,w,N,i]);return s.jsx(Gf,{ref:S,...A,children:s.jsx("div",{className:f.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",h,c.DIAL_KIT_CLASS.resizableContainer),children:e})})},qf=16,Yf=1e3,Xf=4,wr=e=>e==null?!1:(e.closest("[dir]")?.getAttribute("dir")??e.ownerDocument.defaultView?.getComputedStyle(e).direction)==="rtl",Qf=({width:e,minWidth:t,maxWidth:r,defaultWidth:n,onWidthChange:a,label:o,tooltip:i,keyboardStep:l=qf,className:d})=>{const[u,h]=m.useState(!1),[p,g]=m.useState(!1),[x,y]=m.useState(!1),v=m.useRef(null),b=m.useRef(null),C=m.useRef({x:0,y:0}),I=m.useRef(null),S=m.useRef(void 0),w=m.useRef(void 0);m.useEffect(()=>()=>{clearTimeout(S.current),w.current!=null&&cancelAnimationFrame(w.current)},[]);const N=m.useCallback(R=>{const M=Number.isFinite(R)?R:t;return Math.round(Math.min(r,Math.max(t,M)))},[r,t]),L=R=>{b.current?.style.setProperty("transform",`translate(${R.clientX}px, ${R.clientY}px) translate(-50%, -50%)`),y(!0)},A=R=>{C.current={x:R.clientX,y:R.clientY},clearTimeout(S.current),S.current=setTimeout(()=>g(!0),Yf)},T=R=>{L(R),A(R)},j=()=>{y(!1),clearTimeout(S.current),g(!1)},D=R=>{R.button===0&&(R.currentTarget.setPointerCapture(R.pointerId),I.current={x:R.clientX,width:e},h(!0))},E=R=>{L(R);const M=I.current;if(M==null){Math.hypot(R.clientX-C.current.x,R.clientY-C.current.y)>Xf&&(g(!1),A(R));return}const H=wr(v.current)?-1:1,W=N(M.width+(R.clientX-M.x)*H);w.current!=null&&cancelAnimationFrame(w.current),w.current=requestAnimationFrame(()=>a(W))},k=R=>{I.current!=null&&(I.current=null,h(!1),R.currentTarget.hasPointerCapture(R.pointerId)&&R.currentTarget.releasePointerCapture(R.pointerId))},P=R=>{const M=wr(v.current)?-1:1;let H;switch(R.key){case"ArrowRight":H=e+l*M;break;case"ArrowLeft":H=e-l*M;break;case"Home":H=t;break;case"End":H=r;break;default:return}R.preventDefault(),a(N(H))},O=()=>{n!=null&&a(N(n))};return s.jsx("div",{ref:v,role:"separator","aria-orientation":"vertical","aria-label":o,"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":r,tabIndex:0,className:f.mergeClasses("absolute inset-y-0 end-0 -me-1 w-2 touch-none select-none","dial-resize-handle",x&&"dial-resize-handle-cursor-ready",p&&"dial-resize-handle-hover",u&&"dial-resize-handle-dragging",d,c.DIAL_KIT_CLASS.resizeHandle),onPointerEnter:T,onPointerLeave:j,onPointerDown:D,onPointerMove:E,onPointerUp:k,onPointerCancel:k,onKeyDown:P,onDoubleClick:O,children:s.jsx(c.Tooltip,{tooltip:i,open:p&&!u,placement:wr(v.current)?c.TooltipPlacement.Left:c.TooltipPlacement.Right,asChild:!0,children:s.jsx("span",{ref:b,"aria-hidden":"true",className:f.mergeClasses("pointer-events-none fixed top-0 left-0 z-tooltip hidden text-secondary","dial-resize-handle-arrow"),children:s.jsx(F.IconArrowsHorizontal,{size:f.DIAL_ICON_SIZE.LG,stroke:f.DIAL_KIT_ICON_STROKE})})})})},Jf=({enabled:e=!0,children:t,...r})=>e?s.jsx(Da,{...r,children:t}):t,ep=({title:e,description:t,icon:r,action:n,className:a,titleClassName:o,descriptionClassName:i})=>{const l=m.useId();return s.jsxs("section",{"aria-labelledby":l,className:f.mergeClasses("flex size-full flex-col items-center justify-center px-4 text-center",a,c.DIAL_KIT_CLASS.stateScreen),children:[r!=null&&s.jsx("span",{"aria-hidden":"true",className:"mb-4 flex size-14 items-center justify-center rounded-full border border-secondary text-secondary",children:r}),s.jsx("h1",{id:l,className:f.mergeClasses("dial-body-semi-text text-primary",o),children:e}),t!=null&&s.jsx("p",{className:f.mergeClasses("dial-small-text mt-2 text-secondary",i),children:t}),n!=null&&s.jsx("div",{className:"mt-4",children:n})]})};var at=(e=>(e.Row="row",e.Caption="caption",e.Setting="setting",e))(at||{});const tp={[at.Row]:{header:"gap-2",title:"dial-small-semi-text",description:"dial-small-text"},[at.Caption]:{header:"gap-4",title:"dial-caption-lead-semi-text",description:"dial-tiny-text"},[at.Setting]:{header:"gap-4",title:"dial-tiny-semi-text",description:"dial-tiny-text"}},rp=({title:e,action:t,description:r,variant:n=at.Row,headingLevel:a=3,children:o,className:i,titleClassName:l,descriptionClassName:d,contentClassName:u})=>{const h=m.useId(),p=tp[n],g=`h${a}`;return s.jsxs("section",{"aria-labelledby":h,className:f.mergeClasses("flex flex-col gap-3",i,c.DIAL_KIT_CLASS.formSection),children:[s.jsxs("div",{className:f.mergeClasses("flex items-center justify-between",p.header),children:[s.jsx(g,{id:h,className:f.mergeClasses("min-w-0 text-primary",p.title,l),children:e}),t!=null&&s.jsx("div",{className:"shrink-0",children:t})]}),r!=null&&s.jsx("p",{className:f.mergeClasses("text-secondary",p.description,d),children:r}),o!=null&&s.jsx("div",{className:f.mergeClasses("relative",u),children:o})]})};var we=(e=>(e.InProgress="inProgress",e.Success="success",e.Warning="warning",e.Failed="failed",e.Canceled="canceled",e))(we||{});const Ta=8e3,jt="flex size-7 shrink-0 items-center justify-center",Ea={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"},sp=({title:e,isCollapsed:t,itemsId:r,labels:n,onToggleCollapse:a,onClose:o})=>{const i=t?F.IconChevronUp:F.IconChevronDown;return s.jsxs("div",{className:"mx-4 flex items-center justify-between border-b border-tertiary py-3",children:[s.jsx("span",{className:"dial-small-paragraph-semi-text min-w-0 truncate text-primary",children:e}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(c.GhostIconButton,{"aria-label":t?n.expandAriaLabel:n.collapseAriaLabel,"aria-expanded":!t,"aria-controls":r,size:c.ElementSize.Small,icon:s.jsx(i,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:a,className:jt}),s.jsx(c.GhostIconButton,{"aria-label":n.closeAriaLabel,size:c.ElementSize.Small,icon:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:o,className:jt})]})]})},dn=({message:e,isError:t})=>{const r=t?F.IconAlertCircleFilled:F.IconAlertTriangleFilled;return s.jsx(c.Tooltip,{tooltip:e,asChild:!0,children:s.jsx("span",{className:jt,role:"img","aria-label":e,tabIndex:0,children:s.jsx(r,{size:f.DIAL_ICON_SIZE.SM,className:t?"text-error":"text-warning-icon","aria-hidden":!0})})})},kr=2,Rr=(f.DIAL_ICON_SIZE.SM-kr)/2,un=2*Math.PI*Rr,np=({percent:e,label:t,className:r})=>{const n=Math.min(100,Math.max(0,Math.round(e))),a=f.DIAL_ICON_SIZE.SM/2;return s.jsx("span",{role:"progressbar","aria-label":t,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n,className:f.mergeClasses("flex",r),children:s.jsxs("svg",{width:f.DIAL_ICON_SIZE.SM,height:f.DIAL_ICON_SIZE.SM,viewBox:`0 0 ${f.DIAL_ICON_SIZE.SM} ${f.DIAL_ICON_SIZE.SM}`,className:"-rotate-90","aria-hidden":!0,children:[s.jsx("circle",{cx:a,cy:a,r:Rr,fill:"none",strokeWidth:kr,className:"stroke-(--stroke-secondary,#d1dbea)"}),s.jsx("circle",{cx:a,cy:a,r:Rr,fill:"none",strokeWidth:kr,strokeLinecap:"round",strokeDasharray:un,strokeDashoffset:un*(1-n/100),className:"stroke-(--stroke-accent,#1d4ed8) transition-[stroke-dashoffset] duration-200 motion-reduce:transition-none"})]})})},ap=({item:e,labels:t,onCancel:r})=>{const n=e.status===we.Canceled,a=f.mergeClasses("pointer-events-none col-start-1 row-start-1 transition-opacity",r&&"group-focus-within:opacity-0 group-hover:opacity-0");return s.jsxs("div",{className:"group flex items-center gap-2 px-4 py-2",children:[s.jsx(ps,{type:Ae.File,name:e.name,size:f.DIAL_ICON_SIZE.MD,className:f.mergeClasses(n&&"opacity-50"),decorative:!0}),s.jsx(c.EllipsisTooltip,{text:e.name,className:f.mergeClasses("dial-small-text",n?"text-secondary":"text-primary")}),e.status===we.InProgress&&s.jsxs("div",{className:f.mergeClasses(jt,"grid"),children:[typeof e.percent=="number"?s.jsx(np,{percent:e.percent,label:t.itemProgressAriaLabel(e.name),className:a}):s.jsx(Ve,{size:f.DIAL_ICON_SIZE.SM,ariaLabel:t.itemProgressAriaLabel(e.name),className:a}),r&&s.jsx(c.GhostIconButton,{"aria-label":t.cancelItemAriaLabel(e.name),size:c.ElementSize.Small,icon:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.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===we.Success&&s.jsx("span",{className:jt,role:"img","aria-label":t.successLabel,children:s.jsx(F.IconCheck,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-accent","aria-hidden":!0})}),e.status===we.Warning&&s.jsx(dn,{message:e.message||t.warningMessage,isError:!1}),e.status===we.Failed&&s.jsx(dn,{message:e.message||t.failedMessage,isError:!0}),n&&s.jsx("span",{className:"dial-small-text shrink-0 text-secondary",children:t.canceledLabel})]})},op=e=>Math.round(e.reduce((t,r)=>t+(r.percent??(r.status===we.InProgress?0:100)),0)/e.length),ip=(e,t)=>e?t.closeConfirmDescriptionMixed:t.closeConfirmDescriptionInProgress,lp=({title:e,items:t,onClose:r,onCancelItem:n,labels:a,autoCloseDelay:o=Ta,className:i,bodyClassName:l})=>{const[d,u]=m.useState(!1),[h,p]=m.useState(!1),g=m.useId(),x={...Ea,...a},y=t.filter(N=>N.status===we.InProgress).length,v=y>0,b=t.some(N=>N.status===we.Failed),C=t.length>0&&t.every(N=>N.status===we.Success),I=m.useCallback(()=>{v?p(!0):r()},[v,r]),S=m.useCallback(()=>{p(!1),r()},[r]),w=m.useCallback(()=>{u(N=>!N)},[]);return m.useEffect(()=>{if(!C||o<=0)return;const N=setTimeout(r,o);return()=>clearTimeout(N)},[C,o,r]),t.length===0?null:s.jsxs("div",{role:"status","aria-live":"polite",className:f.mergeClasses("w-[370px] max-w-[calc(100vw-2rem)] rounded-xl bg-layer-raised shadow-md",i,c.DIAL_KIT_CLASS.transferQueue),children:[s.jsx(sp,{title:e,isCollapsed:d,itemsId:g,labels:x,onToggleCollapse:w,onClose:I}),d&&v&&s.jsx(gn,{value:op(t),size:c.ElementSize.Small,"aria-label":x.queueProgressAriaLabel,"aria-valuetext":x.queueProgressValueText(t.length-y,t.length)}),!d&&s.jsx("div",{id:g,className:f.mergeClasses("flex max-h-[40vh] flex-col overflow-y-auto py-1",l),children:t.map(N=>s.jsx(ap,{item:N,labels:x,onCancel:n},N.id))}),s.jsx(va,{open:h,header:x.closeConfirmHeader,description:ip(b,x),confirmLabel:x.closeConfirmLabel,cancelLabel:x.closeCancelLabel,variant:it.Danger,onConfirm:S,onClose:()=>p(!1)})]})};exports.BASE_ICON_PROPS=f.BASE_ICON_PROPS;exports.BASE_ICON_SIZE=f.BASE_ICON_SIZE;exports.DIAL_ICON_SIZE=f.DIAL_ICON_SIZE;exports.DIAL_KIT_ICON_STROKE=f.DIAL_KIT_ICON_STROKE;exports.mergeClasses=f.mergeClasses;exports.ButtonAppearance=c.ButtonAppearance;exports.ButtonVariant=c.ButtonVariant;exports.CaptionText=c.CaptionText;exports.Checkbox=c.Checkbox;exports.CheckboxBox=c.CheckboxBox;exports.CloseButton=c.CloseButton;exports.DEFAULT_DATE_FORMAT_OPTIONS=c.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_DATE_LOCALE=c.DEFAULT_LOCALE;exports.DIAL_KIT_CLASS=c.DIAL_KIT_CLASS;exports.DangerIconButton=c.DangerIconButton;exports.DateCellRenderer=c.DateCellRenderer;exports.DialIcon=c.DialIcon;exports.Dropdown=c.Dropdown;exports.DropdownItemType=c.DropdownItemType;exports.DropdownTrigger=c.DropdownTrigger;exports.DropdownType=c.DropdownType;exports.ElementSize=c.ElementSize;exports.EllipsisTooltip=c.EllipsisTooltip;exports.ErrorText=c.ErrorText;exports.GRID_ALIGN_RIGHT_CLASS=c.GRID_ALIGN_RIGHT_CLASS;exports.GRID_ROOT_CLASS=c.GRID_ROOT_CLASS;exports.GRID_ROW_HEIGHT=c.ROW_HEIGHT;exports.GRID_SELECTION_COLUMN_ID=c.GRID_SELECTION_COLUMN_ID;exports.GRID_THEME_PARAMS=c.GRID_THEME_PARAMS;exports.GhostIconButton=c.GhostIconButton;exports.Grid=c.Grid;exports.GridAppearance=c.GridAppearance;exports.GridColorScheme=c.GridColorScheme;exports.GridSelectionMode=c.GridSelectionMode;exports.Highlight=c.Highlight;exports.IconButton=c.IconButton;exports.InfoButton=c.InfoButton;exports.Input=c.Input;exports.InteractiveTooltip=c.InteractiveTooltip;exports.InteractiveTooltipTrigger=c.InteractiveTooltipTrigger;exports.Label=c.Label;exports.MenuItem=c.MenuItem;exports.MenuItemMark=c.MenuItemMark;exports.NeutralIconButton=c.NeutralIconButton;exports.NoDataContent=c.NoDataContent;exports.PrimaryIconButton=c.PrimaryIconButton;exports.Radio=c.Radio;exports.Search=c.Search;exports.StaticIconButton=c.StaticIconButton;exports.ThemeScope=c.ThemeScope;exports.Tooltip=c.Tooltip;exports.TooltipContainer=c.TooltipContainer;exports.TooltipContent=c.TooltipContent;exports.TooltipPlacement=c.TooltipPlacement;exports.TooltipTrigger=c.TooltipTrigger;exports.baseColumnComparator=c.baseColumnComparator;exports.checkColDefsChanges=c.checkColDefsChanges;exports.convertToDate=c.convertToDate;exports.useThemeScope=c.useThemeScope;exports.EditorThemes=fn.EditorThemes;exports.LazyMarkdownEditor=fn.LazyMarkdownEditor;exports.AVATAR_PALETTE=Ia;exports.Accordion=ga;exports.AccordionCaretPosition=Yt;exports.AnalyticsBar=Kt;exports.AnalyticsBarGroup=iu;exports.AnalyticsCard=nu;exports.AnalyticsCardVariant=wt;exports.AnalyticsHistogram=fu;exports.AutocompleteTagInput=Lf;exports.Avatar=Na;exports.AvatarColor=Pe;exports.AvatarShape=lt;exports.Badge=ds;exports.BadgeColor=Ne;exports.BadgeVariant=_e;exports.BottomSheet=pf;exports.Breadcrumbs=Wd;exports.BreadcrumbsSize=Ze;exports.Button=Xe;exports.ButtonDropdown=Zd;exports.Calendar=Ld;exports.CalendarMode=xe;exports.CardShell=qc;exports.CollapsibleSidebar=Pf;exports.ConditionalResizableContainer=Jf;exports.ConfirmationPopup=va;exports.ConfirmationPopupVariant=it;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=us;exports.DEFAULT_TRANSFER_QUEUE_LABELS=Ea;exports.DangerButton=Nc;exports.DialAccordion=Ga;exports.DialBreadcrumb=yo;exports.DialBreadcrumbItem=xt;exports.DialButton=Tt;exports.DialCaptionText=Mr;exports.DialCloseButton=yn;exports.DialDangerButton=Dn;exports.DialDangerIconButton=bn;exports.DialDropdown=Wt;exports.DialEllipsisTooltip=Qt;exports.DialErrorText=Fe;exports.DialFileNodeType=ze;exports.DialFilePermission=Zn;exports.DialFileResourceType=Qr;exports.DialGhostButton=Io;exports.DialGhostIconButton=vn;exports.DialIconButton=Dt;exports.DialInput=En;exports.DialItemType=Ae;exports.DialLabel=Fr;exports.DialLabelledText=Qa;exports.DialLinkButton=Co;exports.DialLoadFileArea=Gn;exports.DialLoadFileAreaField=Pl;exports.DialLoader=Ya;exports.DialNeutralButton=jn;exports.DialNeutralIconButton=lo;exports.DialNoDataContent=Xa;exports.DialPrimaryButton=Kr;exports.DialPrimaryIconButton=io;exports.DialRemoveButton=Tn;exports.DialSecondaryIconButton=co;exports.DialSuccessIconButton=fo;exports.DialTabs=xo;exports.DialTag=eo;exports.DialTertiaryIconButton=uo;exports.DialTooltip=qe;exports.DialTooltipContainer=Pr;exports.DialTooltipContent=Br;exports.DialTooltipTrigger=zr;exports.EDITABLE_CONTAINER_ATTRIBUTE=Xr;exports.EntityIdentity=wa;exports.EntityType=pe;exports.ErrorMessageNotification=rd;exports.ErrorToastNotification=Yc;exports.FabButton=Gd;exports.FileDropzone=ef;exports.FileIcon=ps;exports.FileName=Ca;exports.FilterChips=Ju;exports.FlexibleActionsDirection=Un;exports.FolderName=ff;exports.FolderPath=Od;exports.FormSection=rp;exports.FormSectionVariant=at;exports.GeneralMessageNotification=id;exports.GeneralToastNotification=td;exports.GhostButton=as;exports.InfoMessageNotification=sd;exports.InfoToastNotification=Xc;exports.InlineSelect=qd;exports.InlineSelectTrigger=ma;exports.JsonSchemaType=$;exports.LabelledText=pu;exports.LinkButton=Dc;exports.LoadingMessageNotification=od;exports.LoadingToastNotification=ed;exports.MultiSelectTags=yt;exports.NOT_ALLOWED_SPACES=Jr;exports.NOT_ALLOWED_SPACES_REGEXP=Zl;exports.NOT_ALLOWED_SYMBOLS=Yn;exports.NOT_ALLOWED_SYMBOLS_REGEXP=Ul;exports.NeutralButton=ns;exports.Notification=cs;exports.NotificationType=fe;exports.NotificationVariant=te;exports.NumberInput=ls;exports.OutlinedButton=Tc;exports.PasswordInput=na;exports.Popup=fs;exports.PopupSize=We;exports.PrimaryButton=ra;exports.ProgressBar=gn;exports.RadioGroup=Nt;exports.RadioGroupOrientation=Oe;exports.RadioGroupPopupField=Mu;exports.ResizableContainer=Da;exports.ResizableContainerSide=Ct;exports.ResizeHandle=Qf;exports.SchemaDisplayMode=or;exports.SchemaOrientation=ir;exports.SchemaRenderer=Vc;exports.SchemaRendererVariant=nt;exports.ScreenResolution=Gt;exports.SegmentedControl=Uu;exports.Select=$e;exports.SelectedEntityCard=Cf;exports.SharedEntityIndicator=ya;exports.SideDrawer=If;exports.Skeleton=Ht;exports.SkeletonAvatarShape=Vt;exports.SkeletonAvatarSize=bt;exports.SkeletonVariant=Ee;exports.Slider=Rf;exports.Spinner=Ve;exports.StarterButton=jc;exports.StateScreen=ep;exports.StepStatus=be;exports.Steps=Jd;exports.SuccessMessageNotification=nd;exports.SuccessToastNotification=Qc;exports.Switch=aa;exports.TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS=Ta;exports.TabOrientation=Ge;exports.TabStatus=ot;exports.TabView=Ue;exports.Tabs=Yu;exports.Tag=Le;exports.TagAppearance=je;exports.TagInput=Df;exports.Textarea=sa;exports.TextareaResize=os;exports.ToggleIconButton=Pu;exports.TransferQueue=lp;exports.TransferQueueItemStatus=we;exports.WarningMessageNotification=ad;exports.WarningToastNotification=Jc;exports.editableContainerProps=Bl;exports.extractInitials=Sa;exports.getTimezoneLabel=qn;exports.matchesAccept=_r;exports.useEditableItem=zl;exports.wrapInRootFolder=Wl;