@epam/ai-dial-ui-kit 0.16.0-dev.56 → 0.16.0-dev.57

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-4D9xu6E_.cjs"),c=require("./DateCellRenderer-weXr7pb2.cjs"),F=require("@tabler/icons-react"),B=require("@floating-ui/react"),m=require("react"),te=require("classnames"),hn=require("./editors.cjs"),Wa=require("react-dom");function Ga(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=Ga(m),Br=({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(Br,{...e,variant:c.CaptionType.Error}),gs={[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]:{}},mn=(e=c.ButtonVariant.Primary,t=c.ButtonAppearance.Solid)=>{const r=gs[e]?.[t];return r||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${t}. Using default primary solid button styles.`),gs[c.ButtonVariant.Primary][c.ButtonAppearance.Solid])},Ua=7,Za=2,gn=m.createContext(null),xn=()=>{const e=m.useContext(gn);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},qa=({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(Ua+Za),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])},zr=({children:e,...t})=>{const r=qa(t);return s.jsx(gn.Provider,{value:r,children:e})},Fr=({style:e,...t})=>{const r=xn(),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:te("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)]"})]})})},Hr=({children:e,asChild:t=!1,...r})=>{const n=xn(),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(zr,{...o,children:[s.jsx(Hr,{className:te(n,"truncate"),children:r}),s.jsx(Fr,{className:te("text-primary",a,"max-w-[300px]",(e||!t)&&"hidden"),children:t})]}),Tt=({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&&mn(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},Ya="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",Xa=({caption:e,onClick:t})=>{if(!e)return null;const r=s.jsx(Tt,{"aria-label":e,className:Ya,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},$r=({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(Xa,{caption:n})]}):null,Qa=({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:te("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})]})},Ja="flex items-center justify-center text-secondary",eo="shrink-0 grow-0 basis-auto animate-spin-steps",to=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"})),ro=({size:e=18,className:t,iconClassName:r,fullWidth:n=!0,ariaLabel:a="Loading"})=>s.jsx("div",{role:"status",className:te({[Ja]:!0,"size-full":n,[t||""]:!!t}),children:s.jsx(c.DialIcon,{icon:s.jsx(to,{width:e,height:e,className:te(eo,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"})});var Ct=(e=>(e.Progressbar="progressbar",e.Meter="meter",e))(Ct||{});const so={[Ct.Progressbar]:"Progress",[Ct.Meter]:"Meter"},bn=({value:e,max:t=100,size:r=c.ElementSize.Standard,labelProps:n,valueLabel:a,role:o=Ct.Progressbar,id:i,className:l,"aria-label":d,...u})=>{const h=m.useId(),p=i??h,g=!!n?.label,x=g?n?.id??`${p}-label`:void 0,y=t>0?t:0,v=Number.isFinite(e)?e:0,b=Math.min(Math.max(v,0),y),C=y>0?b/y*100:0,I=s.jsx("div",{...u,id:p,role:o,"aria-valuenow":b,"aria-valuemin":0,"aria-valuemax":y,"aria-labelledby":x,"aria-label":c.resolveAccessibleName(d,g?void 0:so[o]),className:f.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===c.ElementSize.Small?"h-1":"h-2",l,!g&&!a&&c.DIAL_KIT_CLASS.progressBar),children:s.jsx("div",{style:{width:`${C}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!g&&!a?I: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:x}),a&&s.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),I]})},no=({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})]}),ao=({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]})]}),Et=({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=te(d?"hidden sm:inline":"inline",o),x=f.mergeClasses(t&&mn(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},oo="text-primary",er=({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(zr,{...i,children:[s.jsx(Hr,{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(Fr,{className:f.mergeClasses(oo,r,!v&&"hidden"),children:v})]})},io=({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(er,{text:e}),a&&i&&s.jsx(Et,{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||{}),Wt=(e=>(e.Circle="circle",e.Square="square",e))(Wt||{});const lo=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}},$t=({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=lo(C.size),N=C.shape??Wt.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===Wt.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})]})},co=te("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),uo=te("z-floating overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-hidden"),Tr=te("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),Er="opacity-75 !cursor-not-allowed",vn="text-error",fo="my-1 border-t border-hover border-secondary",st=4,po=s.jsx(F.IconChevronRight,{size:14}),ct=(e,t)=>({appearance:n,...a})=>s.jsx(Tt,{...a,variant:e,appearance:n||t}),ho=(e,t)=>({variant:n,...a})=>s.jsx(Tt,{...a,variant:n||t,appearance:e}),mo=ct(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),go=ct(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),yn=ct(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),xo=ct(c.ButtonVariant.Secondary,c.ButtonAppearance.Ghost),bo=ct(c.ButtonVariant.Tertiary,c.ButtonAppearance.Ghost),vo=ct(c.ButtonVariant.Success,c.ButtonAppearance.Ghost),Cn=ho(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),In=({ariaLabel:e,className:t,size:r=24,onClose:n,...a})=>s.jsx(Cn,{"aria-label":e,className:f.mergeClasses(t,"w-auto h-auto"),onClick:n,icon:s.jsx(F.IconX,{size:r}),...a}),yo=({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:te(Tr,e.disabled&&Er,e.className),...i(),children:[e.icon&&s.jsx("span",{className:te(e.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:e.icon})}),s.jsx("span",{className:te("flex-1 truncate text-start",e.disabled&&"text-secondary"),children:e.label}),s.jsx("span",{className:te("ml-auto shrink-0",e.disabled&&"text-secondary"),children:po})]}),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:te("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:te(Tr,u.disabled&&Er,u.danger&&vn,u.className),onClick:d(u),children:[u.icon&&s.jsx("span",{className:te(u.danger&&"text-error",u.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:u.icon})}),s.jsx("span",{className:te("flex-1 truncate text-start",u.danger&&"text-error",u.disabled&&"text-secondary"),children:u.label})]},u.key))})})]})},Co=e=>"clientWidth"in e?e.clientWidth:e.getBoundingClientRect?.()?.width??0,Gt=({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=Co(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))}}),ee=B.useRole(W,{role:"menu"}),{getReferenceProps:re,getFloatingProps:q}=B.useInteractions([K,V,G,ee]),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(fo,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(yo,{item:_,onRootClose:()=>P(!1)},_.key):s.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!_.disabled,className:te(Tr,_.disabled&&Er,_.danger&&vn,_.className),disabled:_.disabled,onClick:oe(_),children:[_.icon&&s.jsx("span",{className:te(_.danger&&"text-error",_.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:_.icon})}),s.jsx("span",{className:te("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:te(co,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:te(uo,!L&&"w-max",C),...q(),children:[g&&s.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:s.jsx(In,{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||{}),Ut=(e=>(e.Mobile="mobile",e.Tablet="tablet",e))(Ut||{});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(er,{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})})]})},Io=()=>{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},So=12,No=({tabs:e,activeTab:t,onClick:r,className:n,orientation:a=Ge.Horizontal,view:o=Ue.Default,screenThreshold:i=Ut.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=Io(),w=S===c.ScreenType.Mobile||i===Ut.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=So;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(Gt,{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(Gt,{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(Et,{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)})})})]})},Sn="w-full overflow-hidden",Nn="flex flex-nowrap items-center gap-2 min-w-0 px-0 py-0 whitespace-nowrap",Zt="flex items-center gap-2 dial-small-text",mr={first:"shrink-0",middle:"shrink min-w-0 max-w-[30%]",last:"shrink min-w-0 max-w-[51%]"},Lr="flex flex-1 items-center gap-1 min-w-0 transition-colors",wo="text-secondary hover:text-accent-primary",wn="text-primary cursor-default",Kr="flex-none inline-flex items-center leading-none text-secondary",jo="items-center gap-1 min-w-0 transition-colors text-secondary hover:text-accent-primary",jn=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=jn,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?mr.last:o?mr.first:mr.middle,y=f.mergeClasses(Zt,x,l),v=(!!t||!!r)&&!a&&!n,b=v?f.mergeClasses(Lr,wo):f.mergeClasses(Lr,wn,n?"pointer-events-none opacity-75":""),C=typeof e=="string"?s.jsx(er,{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:Kr,"aria-label":"separator",children:i})]})},Do=({pathItems:e,separator:t=jn,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(Zt,"shrink-0"),children:[s.jsx(Gt,{items:y,onItemClick:d,placement:"bottom-start",matchReferenceWidth:!1,children:s.jsx("button",{type:"button","aria-label":"More breadcrumbs",className:jo,children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM})})}),s.jsx("span",{className:Kr,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(Sn,n),children:s.jsx("ol",{className:Nn,children:u})})},Vr=(e,t)=>({appearance:n,...a})=>s.jsx(Et,{...a,variant:e,appearance:n||t}),Dn=(e,t)=>({variant:n,...a})=>s.jsx(Et,{...a,variant:n||t,appearance:e}),Wr=Vr(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),Tn=Vr(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),En=Vr(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),To=Dn(c.ButtonAppearance.Link,c.ButtonVariant.Primary),Eo=Dn(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Ln=({iconClassName:e,label:t,...r})=>t?s.jsx(En,{...r,label:t,appearance:c.ButtonAppearance.Ghost,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}):s.jsx(yn,{...r,appearance:c.ButtonAppearance.Ghost,icon:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}),Lo="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",Ao=({icon:e,onClick:t,disabled:r,size:n=c.ElementSize.Standard,className:a})=>s.jsx("div",{className:te("border-l border-tertiary",n===c.ElementSize.Standard?"h-[40px] w-[44px]":"h-[24px] w-[32px]"),children:s.jsx(Tt,{className:te(Lo,n===c.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:n})}),Oo=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],_o=(e,t,r,n)=>{if((t==="number"||r!==void 0||n!==void 0)&&!Oo.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}}}}},An=({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($r,{...e,htmlFor:n}),s.jsx(On,{id:n,...o}),s.jsx(Fe,{text:t}),!t&&s.jsx(Br,{text:r})]}),On=({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=>{_o(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(On,{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(Ao,{...v,disabled:t})]});return t&&d!=="password"?s.jsx(qe,{tooltip:p||h,children:L()}):L()},_n=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 xs=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),bs=function(){return Math.random().toString(36).substring(7).split("").join(".")},vs={INIT:"@@redux/INIT"+bs(),REPLACE:"@@redux/REPLACE"+bs()};function ko(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 Ro(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(Bo(e))return"date";if(Po(e))return"error";var r=Mo(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 Mo(e){return typeof e.constructor=="function"?e.constructor.name:null}function Po(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Bo(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=Ro(e)),t}function kn(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(kn)(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(!ko(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:vs.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[xs]=function(){return this},v}return g({type:vs.INIT}),n={dispatch:g,subscribe:p,getState:h,replaceReducer:x},n[xs]=y,n}function Z(e,t,...r){if(zo()&&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 zo(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function Fo(e,t,r){return t.split(".").reduce((n,a)=>n&&n[a]?n[a]:r||null,e)}function Ho(e,t){return e.filter(r=>r!==t)}function Rn(e){return typeof e=="object"}function $o(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 Ko(e,t){return e.filter(r=>t.indexOf(r)>-1)}const Gr="dnd-core/INIT_COORDS",tr="dnd-core/BEGIN_DRAG",Ur="dnd-core/PUBLISH_DRAG_SOURCE",rr="dnd-core/HOVER",sr="dnd-core/DROP",nr="dnd-core/END_DRAG";function ys(e,t){return{type:Gr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Vo={type:Gr,payload:{clientOffset:null,sourceClientOffset:null}};function Wo(e){return function(r=[],n={publishSource:!0}){const{publishSource:a=!0,clientOffset:o,getSourceClientOffset:i}=n,l=e.getMonitor(),d=e.getRegistry();e.dispatch(ys(o)),Go(r,l,d);const u=qo(r,l);if(u==null){e.dispatch(Vo);return}let h=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");Uo(i),h=i(u)}e.dispatch(ys(o,h));const g=d.getSource(u).beginDrag(l,u);if(g==null)return;Zo(g),d.pinSource(u);const x=d.getSourceType(u);return{type:tr,payload:{itemType:x,item:g,sourceId:u,clientOffset:o||null,sourceClientOffset:h||null,isSourcePublic:!!a}}}}function Go(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 Uo(e){Z(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Zo(e){Z(Rn(e),"Item must be an object.")}function qo(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 Yo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xo(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){Yo(e,a,r[a])})}return e}function Qo(e){return function(r={}){const n=e.getMonitor(),a=e.getRegistry();Jo(n),ri(n).forEach((i,l)=>{const d=ei(i,l,a,n),u={type:sr,payload:{dropResult:Xo({},r,d)}};e.dispatch(u)})}}function Jo(e){Z(e.isDragging(),"Cannot call drop while not dragging."),Z(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function ei(e,t,r,n){const a=r.getTarget(e);let o=a?a.drop(n,e):void 0;return ti(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function ti(e){Z(typeof e>"u"||Rn(e),"Drop result must either be an object or undefined.")}function ri(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function si(e){return function(){const r=e.getMonitor(),n=e.getRegistry();ni(r);const a=r.getSourceId();return a!=null&&(n.getSource(a,!0).endDrag(r,a),n.unpinSource()),{type:nr}}}function ni(e){Z(e.isDragging(),"Cannot call endDrag while not dragging.")}function Ar(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function ai(e){return function(r,{clientOffset:n}={}){oi(r);const a=r.slice(0),o=e.getMonitor(),i=e.getRegistry(),l=o.getItemType();return li(a,i,l),ii(a,o,i),ci(a,o,i),{type:rr,payload:{targetIds:a,clientOffset:n||null}}}}function oi(e){Z(Array.isArray(e),"Expected targetIds to be an array.")}function ii(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 li(e,t,r){for(let n=e.length-1;n>=0;n--){const a=e[n],o=t.getTargetType(a);Ar(o,r)||e.splice(n,1)}}function ci(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function di(e){return function(){if(e.getMonitor().isDragging())return{type:Ur}}}function ui(e){return{beginDrag:Wo(e),publishDragSource:di(e),hover:ai(e),drop:Qo(e),endDrag:si(e)}}class fi{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=ui(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 pi(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Mn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function hi(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:Mn(pi(t,n),r)}function mi(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Mn(t,r)}const vt=[],Zr=[];vt.__IS_NONE__=!0;Zr.__IS_ALL__=!0;function gi(e,t){return e===vt?!1:e===Zr||typeof t>"u"?!0:Ko(t,e).length>0}class xi{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&&!gi(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 Ar(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&&!Ar(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 hi(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return mi(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Cs=typeof global<"u"?global:self,Pn=Cs.MutationObserver||Cs.WebKitMutationObserver;function Bn(e){return function(){const r=setTimeout(a,0),n=setInterval(a,50);function a(){clearTimeout(r),clearInterval(n),e()}}}function bi(e){let t=1;const r=new Pn(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const vi=typeof Pn=="function"?bi:Bn;class yi{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=vi(this.flush),this.requestErrorThrow=Bn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Ci{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 Ii{create(t){const r=this.freeTasks,n=r.length?r.pop():new Ci(this.onError,a=>r[r.length]=a);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const zn=new yi,Si=new Ii(zn.registerPendingError);function Ni(e){zn.enqueueTask(Si.create(e))}const qr="dnd-core/ADD_SOURCE",Yr="dnd-core/ADD_TARGET",Xr="dnd-core/REMOVE_SOURCE",ar="dnd-core/REMOVE_TARGET";function wi(e){return{type:qr,payload:{sourceId:e}}}function ji(e){return{type:Yr,payload:{targetId:e}}}function Di(e){return{type:Xr,payload:{sourceId:e}}}function Ti(e){return{type:ar,payload:{targetId:e}}}function Ei(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 Li(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 Or(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Or(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 Ai=0;function Oi(){return Ai++}function _i(e){const t=Oi().toString();switch(e){case Ie.SOURCE:return`S${t}`;case Ie.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Is(e){switch(e[0]){case"S":return Ie.SOURCE;case"T":return Ie.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Ss(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 ki{addSource(t,r){Or(t),Ei(r);const n=this.addHandler(Ie.SOURCE,t,r);return this.store.dispatch(wi(n)),n}addTarget(t,r){Or(t,!0),Li(r);const n=this.addHandler(Ie.TARGET,t,r);return this.store.dispatch(ji(n)),n}containsHandler(t){return Ss(this.dragSources,t)||Ss(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 Is(t)===Ie.SOURCE}isTargetId(t){return Is(t)===Ie.TARGET}removeSource(t){Z(this.getSource(t),"Expected an existing source."),this.store.dispatch(Di(t)),Ni(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Z(this.getTarget(t),"Expected an existing target."),this.store.dispatch(Ti(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=_i(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 Ri=(e,t)=>e===t;function Mi(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Pi(e,t,r=Ri){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 Bi(e=vt,t){switch(t.type){case rr:break;case qr:case Yr:case ar:case Xr:return vt;case tr:case Ur:case nr:case sr:default:return Zr}const{targetIds:r=[],prevTargetIds:n=[]}=t.payload,a=$o(r,n);if(!(a.length>0||!Pi(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 zi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fi(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){zi(e,a,r[a])})}return e}const Ns={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Hi(e=Ns,t){const{payload:r}=t;switch(t.type){case Gr:case tr:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case rr:return Mi(e.clientOffset,r.clientOffset)?e:Fi({},e,{clientOffset:r.clientOffset});case nr:case sr:return Ns;default:return e}}function $i(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){$i(e,a,r[a])})}return e}const Ki={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Vi(e=Ki,t){const{payload:r}=t;switch(t.type){case tr:return et({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Ur:return et({},e,{isSourcePublic:!0});case rr:return et({},e,{targetIds:r.targetIds});case ar:return e.targetIds.indexOf(r.targetId)===-1?e:et({},e,{targetIds:Ho(e.targetIds,r.targetId)});case sr:return et({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case nr:return et({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Wi(e=0,t){switch(t.type){case qr:case Yr:return e+1;case Xr:case ar:return e-1;default:return e}}function Gi(e=0){return e+1}function Ui(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zi(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){Ui(e,a,r[a])})}return e}function qi(e={},t){return{dirtyHandlerIds:Bi(e.dirtyHandlerIds,{type:t.type,payload:Zi({},t.payload,{prevTargetIds:Fo(e,"dragOperation.targetIds",[])})}),dragOffset:Hi(e.dragOffset,t),refCount:Wi(e.refCount,t),dragOperation:Vi(e.dragOperation,t),stateId:Gi(e.stateId)}}function Yi(e,t=void 0,r={},n=!1){const a=Xi(n),o=new xi(a,new ki(a)),i=new fi(a,o),l=e(i,t,r);return i.receiveBackend(l),i}function Xi(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return kn(qi,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Qi(e,t){if(e==null)return{};var r=Ji(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 Ji(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 ws=0;const Kt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var el=m.memo(function(t){var{children:r}=t,n=Qi(t,["children"]);const[a,o]=tl(n);return m.useEffect(()=>{if(o){const i=Fn();return++ws,()=>{--ws===0&&(i[Kt]=null)}}},[]),s.jsx(_n.Provider,{value:a,children:r})});function tl(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=rl(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function rl(e,t=Fn(),r,n){const a=t;return a[Kt]||(a[Kt]={dragDropManager:Yi(e,t,r,n)}),a[Kt]}function Fn(){return typeof global<"u"?global:window}function sl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gr,js;function nl(){return js||(js=1,gr=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}),gr}var al=nl();const ol=sl(al),or=typeof window<"u"?m.useLayoutEffect:m.useEffect;function il(e,t,r){const[n,a]=m.useState(()=>t(e)),o=m.useCallback(()=>{const i=t(e);ol(n,i)||(a(i),r&&r())},[n,e,r]);return or(o),[n,o]}function ll(e,t,r){const[n,a]=il(e,t,r);return or(function(){const i=e.getHandlerId();if(i!=null)return e.subscribeToStateChange(a,{handlerIds:[i]})},[e,a]),n}function cl(e,t,r){return ll(t,e||(()=>({})),()=>r.reconnect())}function dl(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),m.useMemo(()=>typeof e=="function"?e():e,r)}let xr=!1;class ul{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(!xr,"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 xr=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{xr=!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 fl(e,t,r){const n=r.getRegistry(),a=n.addTarget(e,t);return[a,()=>n.removeTarget(a)]}function pl(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 hl(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ml(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 gl(e){return(t=null,r=null)=>{if(!m.isValidElement(t)){const o=t;return e(o,r),o}const n=t;return ml(n),bl(n,r?o=>e(o,r):e)}}function xl(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=gl(n);t[r]=()=>a}}),t}function Ds(e,t){typeof e=="function"?e(t):e.current=t}function bl(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=>{Ds(r,n),Ds(t,n)}}):m.cloneElement(e,{ref:t})}class vl{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!pl(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=xl({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,hl(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 Qr(){const{dragDropManager:e}=m.useContext(_n);return Z(e!=null,"Expected drag drop context"),e}function yl(e){return m.useMemo(()=>e.hooks.dropTarget(),[e])}function Cl(e){const t=Qr(),r=m.useMemo(()=>new vl(t.getBackend()),[t]);return or(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function Il(){const e=Qr();return m.useMemo(()=>new ul(e),[e])}function Sl(e){const{accept:t}=e;return m.useMemo(()=>(Z(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class Nl{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 wl(e,t){const r=m.useMemo(()=>new Nl(e,t),[t]);return m.useEffect(()=>{r.spec=e},[e]),r}function jl(e,t,r){const n=Qr(),a=wl(e,t),o=Sl(e);or(function(){const[l,d]=fl(o,a,n);return t.receiveHandlerId(l),r.receiveHandlerId(l),d},[n,t,a,r,o.map(i=>i.toString()).join("|")])}function Hn(e,t){const r=dl(e,t),n=Il(),a=Cl(r.options);return jl(r,n,a),[cl(r.collect,n,a),yl(a)]}function $n(e){let t=null;return()=>(t==null&&(t=e()),t)}function Dl(e,t){return e.filter(r=>r!==t)}function Tl(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 El{enter(t){const r=this.entered.length,n=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=Tl(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Dl(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Ll{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 ir="__NATIVE_FILE__",Kn="__NATIVE_URL__",Vn="__NATIVE_TEXT__",Wn="__NATIVE_HTML__",Ts=Object.freeze(Object.defineProperty({__proto__:null,FILE:ir,HTML:Wn,TEXT:Vn,URL:Kn},Symbol.toStringTag,{value:"Module"}));function br(e,t,r){const n=t.reduce((a,o)=>a||e.getData(o),"");return n??r}const _r={[ir]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[Wn]:{exposeProperties:{html:(e,t)=>br(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Kn]:{exposeProperties:{urls:(e,t)=>br(e,t,"").split(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),f=require("./icon-4D9xu6E_.cjs"),c=require("./DateCellRenderer-CB2R7gM2.cjs"),F=require("@tabler/icons-react"),B=require("@floating-ui/react"),m=require("react"),te=require("classnames"),hn=require("./editors.cjs"),Wa=require("react-dom");function Ga(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=Ga(m),Br=({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(Br,{...e,variant:c.CaptionType.Error}),gs={[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]:{}},mn=(e=c.ButtonVariant.Primary,t=c.ButtonAppearance.Solid)=>{const r=gs[e]?.[t];return r||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${t}. Using default primary solid button styles.`),gs[c.ButtonVariant.Primary][c.ButtonAppearance.Solid])},Ua=7,Za=2,gn=m.createContext(null),xn=()=>{const e=m.useContext(gn);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},qa=({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(Ua+Za),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])},zr=({children:e,...t})=>{const r=qa(t);return s.jsx(gn.Provider,{value:r,children:e})},Fr=({style:e,...t})=>{const r=xn(),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:te("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)]"})]})})},Hr=({children:e,asChild:t=!1,...r})=>{const n=xn(),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(zr,{...o,children:[s.jsx(Hr,{className:te(n,"truncate"),children:r}),s.jsx(Fr,{className:te("text-primary",a,"max-w-[300px]",(e||!t)&&"hidden"),children:t})]}),Tt=({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&&mn(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},Ya="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",Xa=({caption:e,onClick:t})=>{if(!e)return null;const r=s.jsx(Tt,{"aria-label":e,className:Ya,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},$r=({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(Xa,{caption:n})]}):null,Qa=({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:te("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})]})},Ja="flex items-center justify-center text-secondary",eo="shrink-0 grow-0 basis-auto animate-spin-steps",to=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"})),ro=({size:e=18,className:t,iconClassName:r,fullWidth:n=!0,ariaLabel:a="Loading"})=>s.jsx("div",{role:"status",className:te({[Ja]:!0,"size-full":n,[t||""]:!!t}),children:s.jsx(c.DialIcon,{icon:s.jsx(to,{width:e,height:e,className:te(eo,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"})});var Ct=(e=>(e.Progressbar="progressbar",e.Meter="meter",e))(Ct||{});const so={[Ct.Progressbar]:"Progress",[Ct.Meter]:"Meter"},bn=({value:e,max:t=100,size:r=c.ElementSize.Standard,labelProps:n,valueLabel:a,role:o=Ct.Progressbar,id:i,className:l,"aria-label":d,...u})=>{const h=m.useId(),p=i??h,g=!!n?.label,x=g?n?.id??`${p}-label`:void 0,y=t>0?t:0,v=Number.isFinite(e)?e:0,b=Math.min(Math.max(v,0),y),C=y>0?b/y*100:0,I=s.jsx("div",{...u,id:p,role:o,"aria-valuenow":b,"aria-valuemin":0,"aria-valuemax":y,"aria-labelledby":x,"aria-label":c.resolveAccessibleName(d,g?void 0:so[o]),className:f.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===c.ElementSize.Small?"h-1":"h-2",l,!g&&!a&&c.DIAL_KIT_CLASS.progressBar),children:s.jsx("div",{style:{width:`${C}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!g&&!a?I: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:x}),a&&s.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),I]})},no=({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})]}),ao=({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]})]}),Et=({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=te(d?"hidden sm:inline":"inline",o),x=f.mergeClasses(t&&mn(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},oo="text-primary",er=({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(zr,{...i,children:[s.jsx(Hr,{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(Fr,{className:f.mergeClasses(oo,r,!v&&"hidden"),children:v})]})},io=({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(er,{text:e}),a&&i&&s.jsx(Et,{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||{}),Wt=(e=>(e.Circle="circle",e.Square="square",e))(Wt||{});const lo=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}},$t=({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=lo(C.size),N=C.shape??Wt.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===Wt.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})]})},co=te("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),uo=te("z-floating overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-hidden"),Tr=te("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),Er="opacity-75 !cursor-not-allowed",vn="text-error",fo="my-1 border-t border-hover border-secondary",st=4,po=s.jsx(F.IconChevronRight,{size:14}),ct=(e,t)=>({appearance:n,...a})=>s.jsx(Tt,{...a,variant:e,appearance:n||t}),ho=(e,t)=>({variant:n,...a})=>s.jsx(Tt,{...a,variant:n||t,appearance:e}),mo=ct(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),go=ct(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),yn=ct(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),xo=ct(c.ButtonVariant.Secondary,c.ButtonAppearance.Ghost),bo=ct(c.ButtonVariant.Tertiary,c.ButtonAppearance.Ghost),vo=ct(c.ButtonVariant.Success,c.ButtonAppearance.Ghost),Cn=ho(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),In=({ariaLabel:e,className:t,size:r=24,onClose:n,...a})=>s.jsx(Cn,{"aria-label":e,className:f.mergeClasses(t,"w-auto h-auto"),onClick:n,icon:s.jsx(F.IconX,{size:r}),...a}),yo=({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:te(Tr,e.disabled&&Er,e.className),...i(),children:[e.icon&&s.jsx("span",{className:te(e.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:e.icon})}),s.jsx("span",{className:te("flex-1 truncate text-start",e.disabled&&"text-secondary"),children:e.label}),s.jsx("span",{className:te("ml-auto shrink-0",e.disabled&&"text-secondary"),children:po})]}),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:te("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:te(Tr,u.disabled&&Er,u.danger&&vn,u.className),onClick:d(u),children:[u.icon&&s.jsx("span",{className:te(u.danger&&"text-error",u.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:u.icon})}),s.jsx("span",{className:te("flex-1 truncate text-start",u.danger&&"text-error",u.disabled&&"text-secondary"),children:u.label})]},u.key))})})]})},Co=e=>"clientWidth"in e?e.clientWidth:e.getBoundingClientRect?.()?.width??0,Gt=({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=Co(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))}}),ee=B.useRole(W,{role:"menu"}),{getReferenceProps:re,getFloatingProps:q}=B.useInteractions([K,V,G,ee]),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(fo,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(yo,{item:_,onRootClose:()=>P(!1)},_.key):s.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!_.disabled,className:te(Tr,_.disabled&&Er,_.danger&&vn,_.className),disabled:_.disabled,onClick:oe(_),children:[_.icon&&s.jsx("span",{className:te(_.danger&&"text-error",_.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:_.icon})}),s.jsx("span",{className:te("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:te(co,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:te(uo,!L&&"w-max",C),...q(),children:[g&&s.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:s.jsx(In,{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||{}),Ut=(e=>(e.Mobile="mobile",e.Tablet="tablet",e))(Ut||{});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(er,{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})})]})},Io=()=>{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},So=12,No=({tabs:e,activeTab:t,onClick:r,className:n,orientation:a=Ge.Horizontal,view:o=Ue.Default,screenThreshold:i=Ut.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=Io(),w=S===c.ScreenType.Mobile||i===Ut.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=So;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(Gt,{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(Gt,{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(Et,{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)})})})]})},Sn="w-full overflow-hidden",Nn="flex flex-nowrap items-center gap-2 min-w-0 px-0 py-0 whitespace-nowrap",Zt="flex items-center gap-2 dial-small-text",mr={first:"shrink-0",middle:"shrink min-w-0 max-w-[30%]",last:"shrink min-w-0 max-w-[51%]"},Lr="flex flex-1 items-center gap-1 min-w-0 transition-colors",wo="text-secondary hover:text-accent-primary",wn="text-primary cursor-default",Kr="flex-none inline-flex items-center leading-none text-secondary",jo="items-center gap-1 min-w-0 transition-colors text-secondary hover:text-accent-primary",jn=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=jn,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?mr.last:o?mr.first:mr.middle,y=f.mergeClasses(Zt,x,l),v=(!!t||!!r)&&!a&&!n,b=v?f.mergeClasses(Lr,wo):f.mergeClasses(Lr,wn,n?"pointer-events-none opacity-75":""),C=typeof e=="string"?s.jsx(er,{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:Kr,"aria-label":"separator",children:i})]})},Do=({pathItems:e,separator:t=jn,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(Zt,"shrink-0"),children:[s.jsx(Gt,{items:y,onItemClick:d,placement:"bottom-start",matchReferenceWidth:!1,children:s.jsx("button",{type:"button","aria-label":"More breadcrumbs",className:jo,children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM})})}),s.jsx("span",{className:Kr,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(Sn,n),children:s.jsx("ol",{className:Nn,children:u})})},Vr=(e,t)=>({appearance:n,...a})=>s.jsx(Et,{...a,variant:e,appearance:n||t}),Dn=(e,t)=>({variant:n,...a})=>s.jsx(Et,{...a,variant:n||t,appearance:e}),Wr=Vr(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),Tn=Vr(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),En=Vr(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),To=Dn(c.ButtonAppearance.Link,c.ButtonVariant.Primary),Eo=Dn(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Ln=({iconClassName:e,label:t,...r})=>t?s.jsx(En,{...r,label:t,appearance:c.ButtonAppearance.Ghost,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}):s.jsx(yn,{...r,appearance:c.ButtonAppearance.Ghost,icon:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}),Lo="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",Ao=({icon:e,onClick:t,disabled:r,size:n=c.ElementSize.Standard,className:a})=>s.jsx("div",{className:te("border-l border-tertiary",n===c.ElementSize.Standard?"h-[40px] w-[44px]":"h-[24px] w-[32px]"),children:s.jsx(Tt,{className:te(Lo,n===c.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:n})}),Oo=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],_o=(e,t,r,n)=>{if((t==="number"||r!==void 0||n!==void 0)&&!Oo.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}}}}},An=({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($r,{...e,htmlFor:n}),s.jsx(On,{id:n,...o}),s.jsx(Fe,{text:t}),!t&&s.jsx(Br,{text:r})]}),On=({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=>{_o(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(On,{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(Ao,{...v,disabled:t})]});return t&&d!=="password"?s.jsx(qe,{tooltip:p||h,children:L()}):L()},_n=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 xs=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),bs=function(){return Math.random().toString(36).substring(7).split("").join(".")},vs={INIT:"@@redux/INIT"+bs(),REPLACE:"@@redux/REPLACE"+bs()};function ko(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 Ro(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(Bo(e))return"date";if(Po(e))return"error";var r=Mo(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 Mo(e){return typeof e.constructor=="function"?e.constructor.name:null}function Po(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Bo(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=Ro(e)),t}function kn(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(kn)(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(!ko(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:vs.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[xs]=function(){return this},v}return g({type:vs.INIT}),n={dispatch:g,subscribe:p,getState:h,replaceReducer:x},n[xs]=y,n}function Z(e,t,...r){if(zo()&&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 zo(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function Fo(e,t,r){return t.split(".").reduce((n,a)=>n&&n[a]?n[a]:r||null,e)}function Ho(e,t){return e.filter(r=>r!==t)}function Rn(e){return typeof e=="object"}function $o(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 Ko(e,t){return e.filter(r=>t.indexOf(r)>-1)}const Gr="dnd-core/INIT_COORDS",tr="dnd-core/BEGIN_DRAG",Ur="dnd-core/PUBLISH_DRAG_SOURCE",rr="dnd-core/HOVER",sr="dnd-core/DROP",nr="dnd-core/END_DRAG";function ys(e,t){return{type:Gr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Vo={type:Gr,payload:{clientOffset:null,sourceClientOffset:null}};function Wo(e){return function(r=[],n={publishSource:!0}){const{publishSource:a=!0,clientOffset:o,getSourceClientOffset:i}=n,l=e.getMonitor(),d=e.getRegistry();e.dispatch(ys(o)),Go(r,l,d);const u=qo(r,l);if(u==null){e.dispatch(Vo);return}let h=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");Uo(i),h=i(u)}e.dispatch(ys(o,h));const g=d.getSource(u).beginDrag(l,u);if(g==null)return;Zo(g),d.pinSource(u);const x=d.getSourceType(u);return{type:tr,payload:{itemType:x,item:g,sourceId:u,clientOffset:o||null,sourceClientOffset:h||null,isSourcePublic:!!a}}}}function Go(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 Uo(e){Z(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Zo(e){Z(Rn(e),"Item must be an object.")}function qo(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 Yo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xo(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){Yo(e,a,r[a])})}return e}function Qo(e){return function(r={}){const n=e.getMonitor(),a=e.getRegistry();Jo(n),ri(n).forEach((i,l)=>{const d=ei(i,l,a,n),u={type:sr,payload:{dropResult:Xo({},r,d)}};e.dispatch(u)})}}function Jo(e){Z(e.isDragging(),"Cannot call drop while not dragging."),Z(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function ei(e,t,r,n){const a=r.getTarget(e);let o=a?a.drop(n,e):void 0;return ti(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function ti(e){Z(typeof e>"u"||Rn(e),"Drop result must either be an object or undefined.")}function ri(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function si(e){return function(){const r=e.getMonitor(),n=e.getRegistry();ni(r);const a=r.getSourceId();return a!=null&&(n.getSource(a,!0).endDrag(r,a),n.unpinSource()),{type:nr}}}function ni(e){Z(e.isDragging(),"Cannot call endDrag while not dragging.")}function Ar(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function ai(e){return function(r,{clientOffset:n}={}){oi(r);const a=r.slice(0),o=e.getMonitor(),i=e.getRegistry(),l=o.getItemType();return li(a,i,l),ii(a,o,i),ci(a,o,i),{type:rr,payload:{targetIds:a,clientOffset:n||null}}}}function oi(e){Z(Array.isArray(e),"Expected targetIds to be an array.")}function ii(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 li(e,t,r){for(let n=e.length-1;n>=0;n--){const a=e[n],o=t.getTargetType(a);Ar(o,r)||e.splice(n,1)}}function ci(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function di(e){return function(){if(e.getMonitor().isDragging())return{type:Ur}}}function ui(e){return{beginDrag:Wo(e),publishDragSource:di(e),hover:ai(e),drop:Qo(e),endDrag:si(e)}}class fi{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=ui(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 pi(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Mn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function hi(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:Mn(pi(t,n),r)}function mi(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Mn(t,r)}const vt=[],Zr=[];vt.__IS_NONE__=!0;Zr.__IS_ALL__=!0;function gi(e,t){return e===vt?!1:e===Zr||typeof t>"u"?!0:Ko(t,e).length>0}class xi{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&&!gi(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 Ar(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&&!Ar(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 hi(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return mi(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Cs=typeof global<"u"?global:self,Pn=Cs.MutationObserver||Cs.WebKitMutationObserver;function Bn(e){return function(){const r=setTimeout(a,0),n=setInterval(a,50);function a(){clearTimeout(r),clearInterval(n),e()}}}function bi(e){let t=1;const r=new Pn(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const vi=typeof Pn=="function"?bi:Bn;class yi{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=vi(this.flush),this.requestErrorThrow=Bn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Ci{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 Ii{create(t){const r=this.freeTasks,n=r.length?r.pop():new Ci(this.onError,a=>r[r.length]=a);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const zn=new yi,Si=new Ii(zn.registerPendingError);function Ni(e){zn.enqueueTask(Si.create(e))}const qr="dnd-core/ADD_SOURCE",Yr="dnd-core/ADD_TARGET",Xr="dnd-core/REMOVE_SOURCE",ar="dnd-core/REMOVE_TARGET";function wi(e){return{type:qr,payload:{sourceId:e}}}function ji(e){return{type:Yr,payload:{targetId:e}}}function Di(e){return{type:Xr,payload:{sourceId:e}}}function Ti(e){return{type:ar,payload:{targetId:e}}}function Ei(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 Li(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 Or(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Or(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 Ai=0;function Oi(){return Ai++}function _i(e){const t=Oi().toString();switch(e){case Ie.SOURCE:return`S${t}`;case Ie.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Is(e){switch(e[0]){case"S":return Ie.SOURCE;case"T":return Ie.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Ss(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 ki{addSource(t,r){Or(t),Ei(r);const n=this.addHandler(Ie.SOURCE,t,r);return this.store.dispatch(wi(n)),n}addTarget(t,r){Or(t,!0),Li(r);const n=this.addHandler(Ie.TARGET,t,r);return this.store.dispatch(ji(n)),n}containsHandler(t){return Ss(this.dragSources,t)||Ss(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 Is(t)===Ie.SOURCE}isTargetId(t){return Is(t)===Ie.TARGET}removeSource(t){Z(this.getSource(t),"Expected an existing source."),this.store.dispatch(Di(t)),Ni(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Z(this.getTarget(t),"Expected an existing target."),this.store.dispatch(Ti(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=_i(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 Ri=(e,t)=>e===t;function Mi(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Pi(e,t,r=Ri){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 Bi(e=vt,t){switch(t.type){case rr:break;case qr:case Yr:case ar:case Xr:return vt;case tr:case Ur:case nr:case sr:default:return Zr}const{targetIds:r=[],prevTargetIds:n=[]}=t.payload,a=$o(r,n);if(!(a.length>0||!Pi(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 zi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fi(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){zi(e,a,r[a])})}return e}const Ns={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Hi(e=Ns,t){const{payload:r}=t;switch(t.type){case Gr:case tr:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case rr:return Mi(e.clientOffset,r.clientOffset)?e:Fi({},e,{clientOffset:r.clientOffset});case nr:case sr:return Ns;default:return e}}function $i(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){$i(e,a,r[a])})}return e}const Ki={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Vi(e=Ki,t){const{payload:r}=t;switch(t.type){case tr:return et({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Ur:return et({},e,{isSourcePublic:!0});case rr:return et({},e,{targetIds:r.targetIds});case ar:return e.targetIds.indexOf(r.targetId)===-1?e:et({},e,{targetIds:Ho(e.targetIds,r.targetId)});case sr:return et({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case nr:return et({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Wi(e=0,t){switch(t.type){case qr:case Yr:return e+1;case Xr:case ar:return e-1;default:return e}}function Gi(e=0){return e+1}function Ui(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zi(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){Ui(e,a,r[a])})}return e}function qi(e={},t){return{dirtyHandlerIds:Bi(e.dirtyHandlerIds,{type:t.type,payload:Zi({},t.payload,{prevTargetIds:Fo(e,"dragOperation.targetIds",[])})}),dragOffset:Hi(e.dragOffset,t),refCount:Wi(e.refCount,t),dragOperation:Vi(e.dragOperation,t),stateId:Gi(e.stateId)}}function Yi(e,t=void 0,r={},n=!1){const a=Xi(n),o=new xi(a,new ki(a)),i=new fi(a,o),l=e(i,t,r);return i.receiveBackend(l),i}function Xi(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return kn(qi,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Qi(e,t){if(e==null)return{};var r=Ji(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 Ji(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 ws=0;const Kt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var el=m.memo(function(t){var{children:r}=t,n=Qi(t,["children"]);const[a,o]=tl(n);return m.useEffect(()=>{if(o){const i=Fn();return++ws,()=>{--ws===0&&(i[Kt]=null)}}},[]),s.jsx(_n.Provider,{value:a,children:r})});function tl(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=rl(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function rl(e,t=Fn(),r,n){const a=t;return a[Kt]||(a[Kt]={dragDropManager:Yi(e,t,r,n)}),a[Kt]}function Fn(){return typeof global<"u"?global:window}function sl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gr,js;function nl(){return js||(js=1,gr=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}),gr}var al=nl();const ol=sl(al),or=typeof window<"u"?m.useLayoutEffect:m.useEffect;function il(e,t,r){const[n,a]=m.useState(()=>t(e)),o=m.useCallback(()=>{const i=t(e);ol(n,i)||(a(i),r&&r())},[n,e,r]);return or(o),[n,o]}function ll(e,t,r){const[n,a]=il(e,t,r);return or(function(){const i=e.getHandlerId();if(i!=null)return e.subscribeToStateChange(a,{handlerIds:[i]})},[e,a]),n}function cl(e,t,r){return ll(t,e||(()=>({})),()=>r.reconnect())}function dl(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),m.useMemo(()=>typeof e=="function"?e():e,r)}let xr=!1;class ul{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(!xr,"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 xr=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{xr=!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 fl(e,t,r){const n=r.getRegistry(),a=n.addTarget(e,t);return[a,()=>n.removeTarget(a)]}function pl(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 hl(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ml(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 gl(e){return(t=null,r=null)=>{if(!m.isValidElement(t)){const o=t;return e(o,r),o}const n=t;return ml(n),bl(n,r?o=>e(o,r):e)}}function xl(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=gl(n);t[r]=()=>a}}),t}function Ds(e,t){typeof e=="function"?e(t):e.current=t}function bl(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=>{Ds(r,n),Ds(t,n)}}):m.cloneElement(e,{ref:t})}class vl{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!pl(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=xl({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,hl(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 Qr(){const{dragDropManager:e}=m.useContext(_n);return Z(e!=null,"Expected drag drop context"),e}function yl(e){return m.useMemo(()=>e.hooks.dropTarget(),[e])}function Cl(e){const t=Qr(),r=m.useMemo(()=>new vl(t.getBackend()),[t]);return or(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function Il(){const e=Qr();return m.useMemo(()=>new ul(e),[e])}function Sl(e){const{accept:t}=e;return m.useMemo(()=>(Z(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class Nl{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 wl(e,t){const r=m.useMemo(()=>new Nl(e,t),[t]);return m.useEffect(()=>{r.spec=e},[e]),r}function jl(e,t,r){const n=Qr(),a=wl(e,t),o=Sl(e);or(function(){const[l,d]=fl(o,a,n);return t.receiveHandlerId(l),r.receiveHandlerId(l),d},[n,t,a,r,o.map(i=>i.toString()).join("|")])}function Hn(e,t){const r=dl(e,t),n=Il(),a=Cl(r.options);return jl(r,n,a),[cl(r.collect,n,a),yl(a)]}function $n(e){let t=null;return()=>(t==null&&(t=e()),t)}function Dl(e,t){return e.filter(r=>r!==t)}function Tl(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 El{enter(t){const r=this.entered.length,n=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=Tl(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Dl(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Ll{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 ir="__NATIVE_FILE__",Kn="__NATIVE_URL__",Vn="__NATIVE_TEXT__",Wn="__NATIVE_HTML__",Ts=Object.freeze(Object.defineProperty({__proto__:null,FILE:ir,HTML:Wn,TEXT:Vn,URL:Kn},Symbol.toStringTag,{value:"Module"}));function br(e,t,r){const n=t.reduce((a,o)=>a||e.getData(o),"");return n??r}const _r={[ir]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[Wn]:{exposeProperties:{html:(e,t)=>br(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Kn]:{exposeProperties:{urls:(e,t)=>br(e,t,"").split(`
2
2
  `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[Vn]:{exposeProperties:{text:(e,t)=>br(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Al(e,t){const r=_r[e];if(!r)throw new Error(`native type ${e} has no configuration`);const n=new Ll(r);return n.loadDataTransfer(t),n}function vr(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(_r).filter(r=>{const n=_r[r];return n?.matchesTypes?n.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const Ol=$n(()=>/firefox/i.test(navigator.userAgent)),Gn=$n(()=>!!window.safari);class Es{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 _l=1;function Un(e){const t=e.nodeType===_l?e:e.parentElement;if(!t)return null;const{top:r,left:n}=t.getBoundingClientRect();return{x:n,y:r}}function Rt(e){return{x:e.clientX,y:e.clientY}}function kl(e){var t;return e.nodeName==="IMG"&&(Ol()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Rl(e,t,r,n){let a=e?t.width:r,o=e?t.height:n;return Gn()&&e&&(o/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:o}}function Ml(e,t,r,n,a){const o=kl(t),l=Un(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}=Rl(o,t,u,h),v=()=>{let L=new Es([0,.5,1],[d.y,d.y/h*y,d.y+y-h]).interpolate(g);return Gn()&&o&&(L+=(window.devicePixelRatio-1)*y),L},b=()=>new Es([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 Pl{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 Bl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ls(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){Bl(e,a,r[a])})}return e}class zl{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 Ls({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 Ls({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Ts).some(r=>Ts[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=Al(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&&Un(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=Rt(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=vr(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=Ml(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=vr(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:Rt(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=Rt(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 vr(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:o}=this;this.dropTargetIds=[],this.actions.hover(o,{clientOffset:Rt(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 Pl(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new El(this.isNodeInDocument)}}const Fl=function(t,r,n){return new zl(t,r,n)},Hl=({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]=Hn(()=>({accept:[ir],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=te("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(Wr,{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})]})},$l=({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(An,{...r,iconBefore:a(),containerClassName:te("h-[40px] p-0",n&&"h-[60px]"),className:te("rounded-r-none border-r-0",n&&"text-error",t)})},Kl=({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]=Hn(()=>({accept:[ir],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:te("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})]})},Zn=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(Ln,{"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($l,{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(el,{backend:Fl,children:!t||t.length===0?s.jsx(Hl,{...e,onChange:a}):s.jsxs(s.Fragment,{children:[s.jsx(Kl,{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})]})})},Vl=({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($r,{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(Tn,{label:x,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS}),onClick:S}),(a?a>n?.length:!0)&&s.jsx(Wr,{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(Zn,{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||{}),qn=(e=>(e.Normal="normal",e.Reverse="reverse",e))(qn||{}),Ae=(e=>(e.File="file",e.Folder="folder",e))(Ae||{}),It=(e=>(e.Left="left",e.Right="right",e))(It||{}),X=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e.Loading="loading",e.General="general",e))(X||{}),fe=(e=>(e.Toast="toast",e.SectionMessage="section-message",e))(fe||{}),qt=(e=>(e.Variant="variant",e.Neutral="neutral",e))(qt||{});const Jr="data-editable-container",Wl={[Jr]:""};function Gl({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(`${X.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(`[${Jr}]`)??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||{}),es=(e=>(e.FILE="FILE",e.PROMPT="PROMPT",e.CONVERSATION="CONVERSATION",e.APPLICATION="APPLICATION",e.TOOLSET="TOOL_SET",e))(es||{}),Yn=(e=>(e.READ="READ",e.WRITE="WRITE",e.SHARE="SHARE",e))(Yn||{});const Ul="application/octet-stream";function Zl(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=yr(n,!0),o=e.filter(d=>d!==r).map(d=>{const u=d.path||d.url||"",h=ql(d.nodeType),p=h===ze.FOLDER,g=yr(u,p);let x;return d.parentPath===null||d.parentPath===void 0?x=a:d.parentPath===""?x="":x=yr(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:Yl(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=Xl(d.name),u.contentType=d.contentType||Ul,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 yr(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 ql(e){return e.toUpperCase()==="FOLDER"?ze.FOLDER:ze.ITEM}function Yl(e){if(!e)return;const t=e.toUpperCase();return Object.values(es).find(n=>n.toUpperCase()===t)}function Xl(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function Ql(e,t="Prompts",r="prompts/public/",n="root"){const a=Zl(e,n);return[{id:n,name:t,path:r,parentPath:"",nodeType:ze.FOLDER,folderId:n,items:a}]}const Xn=({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}},Qn=':;,=/{}%&\\"',ts=`(\r
3
3
  |
4
4
  |\r| )|[\0-]`,Jl=`[${Qn.replace(/\\/g,"\\\\")}]`,ec=new RegExp(`${Jl}|${ts}`),tc=new RegExp(ts);var nt=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(nt||{}),lr=(e=>(e.Select="select",e.Radio="radio",e))(lr||{}),cr=(e=>(e.Row="row",e.Column="column",e))(cr||{}),$=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))($||{});const rc={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 As(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 Q(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?Q(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=As(i,Q(l,t,r+1));n=As(i,o)}return n}function Jn(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 dr(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 Yt(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}const rs=e=>`"${e}" is required`;function ea(e,t){return e.type===$.Null?"null":e.$ref?Q(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=Q(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=Q({$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=Q(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=Q(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&&Q(h,r).isHidden)continue;const p=n?`${n}.${u}`:u,g=d?.[u];if(dr(g)){const x=h?.title??Yt(u);o.push({path:p,message:rs(x)})}}if(d&&i.properties)for(const[u,h]of Object.entries(i.properties)){if(Q(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 ss(e,t,r){const n=Q(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])=>!Q(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 sc(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=>Q(a,r).type===$.Array);return n>=0?n:0}if(typeof e=="boolean"){const n=t.findIndex(a=>Q(a,r).type===$.Boolean);return n>=0?n:0}if(typeof e=="number"){const n=t.findIndex(a=>{const o=Q(a,r);return o.type===$.Number||o.type===$.Integer});return n>=0?n:0}if(typeof e=="string"){const n=t.findIndex(a=>Q(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=Q(t[a],r);if(o.discriminator&&o.discriminator.propertyName in n)return a}for(let a=0;a<t.length;a++){const o=Q(t[a],r);if(Ye(o)||o.oneOf)return a}return 0}return 0}function nc(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 ta(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 ac=[$.String,$.Number,$.Boolean,$.Null,$.Object,$.Array];function oc(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 ic={[$.String]:"",[$.Number]:0,[$.Boolean]:!1,[$.Null]:null,[$.Object]:{},[$.Array]:[]};function lc(e){return ic[e]}const ra=m.createContext(null),ke=()=>{const e=m.useContext(ra);if(!e)throw new Error("useSchemaContext must be used inside SchemaRenderer");return e},St=(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))},sa=({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 Se=(e=>(e.Outlined="outlined",e.Selectable="selectable",e.Bordered="bordered",e))(Se||{});const na="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",cc={[Se.Outlined]:"dial-tiny-text",[Se.Selectable]:"dial-tiny-text",[Se.Bordered]:"h-[24px] rounded-md border px-2 dial-small-text"},aa={[Se.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[Se.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"},[Se.Bordered]:{default:"border-tertiary bg-layer-sunken text-primary",selected:"border-accent bg-control-accent-alpha text-primary"}},oa="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",ia="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Le=({label:e,icon:t,appearance:r=Se.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===Se.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(na,b?"dial-tiny-semi-text":cc[r],aa[r][n?"selected":"default"],a&&"cursor-not-allowed",y&&[oa,ia],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)}})]})},Xt="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(Xt,n)},a)})}),dc=8,uc=e=>e.stopPropagation(),fc=e=>{e.key!=="Escape"&&e.stopPropagation()},pc=({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(sa({tagWidths:x,overflowChipWidth:y,availableWidth:p.clientWidth,gap:dc}))},[]);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:uc,onKeyDown:fc,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(Xt,"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(Xt,"shrink-0")})]})]})},hc=f.mergeClasses("w-full flex flex-col"),mc=c.overlayItemClassName,gc="!max-w-[var(--reference-width)]",xc=f.mergeClasses("max-h-[344px] overflow-y-auto py-1",c.overlayListClassName),bc=c.overlayGap,vc=c.overlaySubMenuListClassName,yc=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Cc="text-secondary transition-transform",Ic=8,Sc=s.jsx(F.IconSearch,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Nc=s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),wc=({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(bc,"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:yc,...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:vc,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:ee,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||""),ee?.(z||""))},[ee,ge]),pt=n!==void 0,[J,ce]=m.useState(a),he=pt?n:J,ue=m.useMemo(()=>t?Array.isArray(he)?he:[]:typeof he=="string"?[he]:[],[he,t]),Lt=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]),ur=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]),At=m.useCallback((z,ae)=>{if(z.stopPropagation(),!t){Re("");return}const kt=ue.filter(Va=>Va!==ae);Re(kt)},[t,ue,Re]),De=m.useMemo(()=>Lt.filter(z=>!z.disabled),[Lt]),fr=m.useMemo(()=>De.filter(z=>ue.includes(z.value)).length,[De,ue]),{allSelectedInFiltered:pr,someSelectedInFiltered:Ma}=m.useMemo(()=>{const z=De.length>0&&fr===De.length;return{allSelectedInFiltered:z,someSelectedInFiltered:fr>0&&!z}},[De,fr]),Pa=m.useCallback(()=>{if(!(!t||De.length===0))if(pr){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))}},[pr,t,De,ue,Re]),Ot=ue.length>0,_t=!t&&Ot?ue[0]:void 0,Ne=m.useMemo(()=>_t?e.find(z=>z.value===_t)??e.flatMap(z=>z.children??[]).find(z=>z.value===_t):void 0,[e,_t]),ht=Ne?i?`${i} ${Ne.label}`:Ne.label:void 0,Ba=c.useIsMobileScreen(),hr=t&&w&&!re&&!Ba,mt=m.useMemo(()=>t?Ot?hr?s.jsx(pc,{options:e,selectedValues:ue,handleRemoveTag:At}):s.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",children:re?.(e,ue,At)??s.jsx(yt,{options:e,selectedValues:ue,handleRemoveTag:At})}):null:!Ne||!Ne.labelNode&&!Ne.description?null:s.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[s.jsx(c.EllipsisTooltip,{text:Ne.labelNode??ht}),Ne.description&&s.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:Ne.description})]}),[hr,re,At,Ot,t,e,ht,ue,Ne]),za=t||mt?"":ht||(l&&n?l:""),Fa=typeof u?.label=="string"?u.label:void 0,Ha=mt?[c.resolveAccessibleName(g,Fa),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 $a=m.useCallback(z=>{j||(z.key==="ArrowDown"||z.key==="ArrowUp")&&(z.preventDefault(),de||ne(!0))},[j,de,ne]),Ka=()=>s.jsxs("div",{id:se,role:"listbox","aria-multiselectable":t||void 0,className:hc,children:[O&&s.jsx(s.Fragment,{children:typeof O=="function"?O():O}),(y||P)&&(e.length>Ic||!!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:Sc,containerClassName:"w-full"}),P&&s.jsx(c.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:c.ElementSize.Small,icon:Nc,onClick:z=>{M?.(z),ne(!1)}})]}),t&&C&&De.length>0&&s.jsx("div",{className:f.mergeClasses(mc,"mt-2"),children:s.jsx(c.Checkbox,{id:`${Y}-selectAll`,labelProps:{label:S},isSelected:pr,isIndeterminate:Ma,onChange:Pa})}),s.jsx("div",{role:"none",className:xc,children:Lt.length===0?s.jsx("div",{className:"px-2 py-3",children:s.jsx(c.NoDataContent,{icon:T,title:L,description:A})}):Lt.map(z=>{const ae=ue.includes(z.value);if(z.children?.length)return s.jsx(wc,{opt:z,selectedValues:ue,mark:t?c.MenuItemMark.Checkbox:N,onSelect:ur},z.value);const kt=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:()=>ur(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&&ur(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:kt}):kt},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(gc,k),className:"w-full",renderOverlay:Ka,children:s.jsx(c.Input,{id:Y,size:o,disabled:j,invalid:I,value:za,placeholder:mt?void 0:d,readOnly:!0,iconBefore:t?void 0:Ne?.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(Cc,de&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":de,"aria-controls":se,"aria-autocomplete":"none","aria-label":Ha,"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&&Ot&&!hr&&["!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:$a,children:mt})}),s.jsx(c.ErrorText,{id:le,text:h}),!h&&s.jsx(c.CaptionText,{id:oe,text:p})]})]})},Os={[$.Array]:[],[$.String]:"",[$.Boolean]:!1,[$.Integer]:0,[$.Number]:0},jc=({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=sc(t,u,i),p=u[h],g=!p||Q(p,i).type===$.Null,x=y=>{const v=Q(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 Os?Os[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:ea(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},ns=(e,t)=>({appearance:n,...a})=>s.jsx(Xe,{...a,variant:e,appearance:n||t}),as=(e,t)=>({variant:n,...a})=>s.jsx(Xe,{...a,variant:n||t,appearance:e}),la=ns(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),os=ns(c.ButtonVariant.Neutral,c.ButtonAppearance.Solid),Dc=ns(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)"},Tc=s.jsx(F.IconSparkles,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0}),Ec=({appearance:e=c.ButtonAppearance.Outlined,iconBefore:t=Tc,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}})},Lc=as(c.ButtonAppearance.Link,c.ButtonVariant.Primary),is=as(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Ac=as(c.ButtonAppearance.Outlined,c.ButtonVariant.Neutral),Nt=({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})]})},Oc=({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=Q(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=Q({$ref:y.mapping[b]},o);w={...He(N,o)??{},[y.propertyName]:b}}else w=He(x,o)??ta(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=nc(w,y?.propertyName,N),A=Be(w,x,o,`${n.join(".")}[${N}]`);return s.jsx(Nt,{title:L,level:a,summary:ss(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(is,{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 ls=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(ls||{});const _s={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},_c=e=>typeof e=="boolean"?_s[e?"both":"none"]:_s[e],ca=({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",_c(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})]})]})},ks=e=>{try{return JSON.parse(e),!0}catch{return!1}},cs=({value:e,onChange:t,id:r,ariaLabel:n})=>{const{readonly:a,texts:o}=ke(),[i,l]=m.useState(()=>JSON.stringify(e,null,2)??""),d=!ks(i),u=h=>{l(h),ks(h)&&t(JSON.parse(h))};return s.jsx(ca,{id:r,"aria-label":n,value:i,onChange:u,readOnly:a,invalid:d,error:d?o.invalidJsonError:void 0,spellCheck:!1,rows:10,resize:ls.Vertical,className:"font-mono !whitespace-pre"})},kc=/^0+\.(\d+)?$/,Rc=/^0+/,Mc=[".","-","+","e","E"],Rs=e=>!e||e==="-"?e:String(e).match(kc)?String(e).replace(Rc,"0"):Number(e),ds=({integer:e,onChange:t,min:r,max:n,onKeyDown:a,onPaste:o,...i})=>{const l=u=>{if(e&&Mc.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?.(Rs(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?.(Rs(u)),onKeyDown:l,onPaste:d})},da=({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})},Pc="flex flex-col gap-2",Bc="flex",zc="mt-2 ml-[26px]",Fc={[Oe.Column]:"flex-col gap-y-3",[Oe.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},wt=({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(Pc,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(Bc,Fc[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(zc,y),children:N.content}):null]},N.value)})}),s.jsx(c.ErrorText,{id:I,text:d}),!d&&s.jsx(c.CaptionText,{id:S,text:u})]})},ua=({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})]})},Ms=e=>typeof e=="string"?e:e[0],Cr=e=>e!=null?String(e):"",Hc=e=>e!==void 0?Number(e):void 0,fa=({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(Ms(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===lr.Radio)return s.jsx(wt,{id:a,ariaLabel:o,items:g.map(v=>({value:String(v),label:String(v)})),value:t!=null?String(t):void 0,orientation:e.enumOrientation===cr.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(Ms(v)),placeholder:l.enumSelectPlaceholder,className:u});switch(e.type){case $.Boolean:return s.jsx(ua,{id:a,"aria-label":o,isOn:!!t,disabled:d,onChange:v=>r(v)});case $.Integer:case $.Number:return s.jsx(ds,{id:a,"aria-label":o,"aria-describedby":i,integer:e.type===$.Integer,value:Cr(t),invalid:n,disabled:d,onChange:v=>r(Hc(v)),placeholder:e.type===$.Integer?l.integerInputPlaceholder:l.numberInputPlaceholder,containerClassName:u});default:return e.isProtected?s.jsx(da,{id:a,"aria-label":o,"aria-describedby":i,value:Cr(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:Cr(t),invalid:n,disabled:d,onChange:v=>r(v??void 0),placeholder:l.stringInputPlaceholder,containerClassName:u})}},Ps=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),pa=e=>!!(e.oneOf||e.anyOf||e.type===$.Array||Ye(e)),$c={[$.String]:"entryTypeString",[$.Number]:"entryTypeNumber",[$.Boolean]:"entryTypeBoolean",[$.Null]:"entryTypeNull",[$.Object]:"entryTypeObject",[$.Array]:"entryTypeArray"},Bs=e=>typeof e=="string"?e:e[0],Kc=({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(()=>oc(e.value)),w=pa(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=St(j,x,v)&&e.key==="",E=e.key||u.valueColumnHeader,k=K=>{a(lc(K)),S(K)},P=m.useMemo(()=>ac.map(K=>({value:K,label:u[$c[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=Bs(K);V&&a(V==="true")}}):s.jsx(fa,{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=Bs(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(cs,{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(Nt,{title:e.key,level:l,summary:ss(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})})]})},Vc=({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"?Q(e.additionalProperties,o):{type:$.String},h=pa(u),[p,g]=m.useState(()=>Object.entries(t??{}).map(([b,C])=>Ps(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)??ta(u):"";g(C=>[...C,Ps("",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(Kc,{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(is,{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})})]})},kr=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i}=ke(),l=Q(e,o),d=Jn(Object.entries(l.properties??{}).filter(([,p])=>!Q(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=Q(g,o);return s.jsx(ha,{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??Yt(p)},p)})})},zs=e=>typeof e=="string"?e:e[0],Wc=(e,t)=>{const{[t]:r,...n}=e.properties??{};return{...e,properties:n}},Gc=({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===lr.Radio,g=e.discriminator;if(g){const I=g.propertyName,S=g.mapping,w=T=>Q({$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===cr.Row,j=E=>s.jsx(kr,{schema:Wc(E,I),value:t,onChange:r,path:n,level:a}),D=s.jsx(wt,{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=zs(T);j&&A(j)},className:"max-w-[280px]"}),L&&s.jsx("div",{className:"pl-3",children:s.jsx(kr,{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=>Q(S,i).required?.every(w=>w in t));return I>=0?I:0})(),b=x[v],C=I=>{const S=He(Q(x[I],i),i);r(S??null)};return p?s.jsx(wt,{id:u,ariaLabel:h,value:String(v),onChange:I=>C(Number(I)),disabled:d,items:x.map((I,S)=>({value:String(S),label:ea(I,i)??`Option ${S+1}`,content:s.jsx(Ke,{schema:Q(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:Q(I,i).title??`Option ${S+1}`})),value:String(v),disabled:d,onChange:I=>C(Number(zs(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=Q(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(Gc,{...S,ariaLabel:d});else if(b.anyOf&&b.type!==$.Object)w=s.jsx(jc,{...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(Vc,{...S}):L&&b.additionalProperties!==!1?w=s.jsx(cs,{value:t,onChange:I,id:l,ariaLabel:d}):w=s.jsx(kr,{...S})}else if(b.type===$.Array)w=s.jsx(Oc,{...S});else{const N=St(C,y,v)&&!!o&&dr(t),L=!i&&N?rs(b.title??d??"Field"):void 0;w=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(fa,{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},ha=({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=Q(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(Nt,{title:b,description:g.description,level:a,summary:ss(t,g,d),errorCount:St(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=St(x,h,p)&&o&&dr(t)?rs(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})]})]})},Fs="dial-small-semi-text text-primary",Uc=({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(()=>({...rc,...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=Jn(Object.entries(e.properties??{}).filter(([,D])=>!Q(D,e).isHidden)),j=e.required??[];return s.jsx(ra.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=Q(E,e),P=k.title??E.title??Yt(D),O=j.includes(D),R=b[D],M=K=>N(D,K);if(l===nt.Flat)return s.jsx(ha,{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:Fs,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&&dr(R)?Math.max(H.length,1):H.length;return s.jsx(Nt,{title:P,description:k.description,level:0,defaultExpanded:o,errorCount:St(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=Yt(D),k=s.jsx(cs,{value:b[D],onChange:P=>N(D,P),ariaLabel:E});return l===nt.Sections?s.jsx(Nt,{title:E,level:0,defaultExpanded:o,children:k},D):s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsx("h2",{className:Fs,children:E}),k]},D)})]})})},Zc=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})}),qc={[X.Info]:"bg-info text-info",[X.Success]:"bg-success text-success",[X.Warning]:"bg-warning text-warning",[X.Error]:"bg-error text-error",[X.Loading]:"bg-layer-raised text-info",[X.General]:"bg-layer-sunken text-primary"},Yc="bg-layer-sunken text-primary",Xc={[X.Info]:"text-info",[X.Success]:"text-success",[X.Warning]:"text-warning-icon",[X.Error]:"text-error",[X.Loading]:"text-info",[X.General]:"text-primary"},Qc={[X.Info]:"status",[X.Success]:"status",[X.Warning]:"alert",[X.Error]:"alert",[X.Loading]:"status",[X.General]:"status"},Jc="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",us=({variant:e=X.Info,type:t=fe.Toast,surface:r=qt.Variant,title:n,message:a,action:o,className:i,iconSize:l=24,iconStroke:d=2,closable:u=!1,onClose:h,children:p,textClassName:g,...x})=>{const y=m.useMemo(()=>Zc({size:l,stroke:d})[e],[e,l,d]),v=r===qt.Neutral,b=g??(t===fe.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return s.jsxs("div",{role:Qc[e],...x,className:f.mergeClasses(Jc,v?Yc:qc[e],t===fe.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===fe.SectionMessage&&e===X.Loading&&"border-secondary",i,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:f.mergeClasses("flex shrink-0",v&&Xc[e]),children:s.jsx(c.DialIcon,{icon:y})}),n?s.jsxs("div",{className:f.mergeClasses("flex min-w-0 text-primary break-words",b),children:[s.jsx("div",{className:"dial-small-paragraph-semi-text min-w-0 break-words",children:n}),s.jsx("div",{className:"dial-small-paragraph-text min-w-0 break-words",children:a})]}):s.jsx("div",{className:"dial-small-paragraph-text min-w-0 text-primary break-words",children:a})]}),o!=null&&s.jsx("div",{className:"flex shrink-0 items-center",children:o}),p,u&&s.jsx(c.CloseButton,{className:"shrink-0 self-start",ariaLabel:"Close notification",onClose:C=>h?.(C)})]})},ed=({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(us,{...a,variant:e,type:n||t}),ut=(e,t)=>({variant:n,...a})=>s.jsx(us,{...a,variant:n||t,type:e}),td=dt(X.Error,fe.Toast),rd=dt(X.Info,fe.Toast),sd=dt(X.Success,fe.Toast),nd=dt(X.Warning,fe.Toast),ad=dt(X.Loading,fe.Toast),od=dt(X.General,fe.Toast),id=ut(fe.SectionMessage,X.Error),ld=ut(fe.SectionMessage,X.Info),cd=ut(fe.SectionMessage,X.Success),dd=ut(fe.SectionMessage,X.Warning),ud=ut(fe.SectionMessage,X.Loading),fd=ut(fe.SectionMessage,X.General);var xe=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(xe||{});const pd="en-GB",hd={[xe.Date]:"Select date",[xe.DateTime]:"Select date and time",[xe.Time]:"--:--",[xe.Weekday]:"Select day"},ma="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",ga="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",xa="!border-error",md="z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",gd="z-floating rounded-lg bg-layer-raised p-2 shadow-md",xd="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",bd="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",vd="bg-control-accent text-control-permanent",yd="text-accent dial-small-semi-text",Cd="text-control-disable-primary",ba="text-secondary",Id=s.jsx(F.IconCalendar,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:ba}),Hs={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"})},Sd=(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})},$s=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Ks=(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},Nd=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),Vs=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),wd=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),Mt=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,Ws=(e,t)=>{const[r,n]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,n||0,0,0),a},jd=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),Dd=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}`},va=5,ya=e=>e.charAt(0).toUpperCase()+e.slice(1),Td=e=>Array.from({length:7},(t,r)=>{const n=new Date(Date.UTC(1970,0,va+r));return ya(n.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),Ed=e=>Array.from({length:7},(t,r)=>{const n=new Date(Date.UTC(1970,0,va+r));return{value:String(r+1),label:ya(n.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),Ld=Array.from({length:24},(e,t)=>String(t).padStart(2,"0")),Ad=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),Od="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",_d="bg-control-accent text-control-permanent hover:bg-control-accent",Gs=({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(Od,l===r&&_d),onClick:()=>n(l),children:l},l))})},kd=({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(Gs,{label:"Hours",options:Ld,selected:r,onSelect:a=>t(`${a}:${n??"00"}`,!1)}),s.jsx(Gs,{label:"Minutes",options:Ad,selected:n,onSelect:a=>t(`${r??"00"}:${a}`,!0)})]})},Us=({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(ma,"focus-visible:outline focus-visible:outline-focus",r&&xa,t&&ga,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(md,u,a),...S(),children:i(()=>p(!1))})})})]})},Zs=({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=Dd(T.target.value);x(j),jd(j)&&r(j)},onBlur:n,className:f.mergeClasses(ma,o&&xa,a&&ga,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:xd,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(gd,b),...L(),children:s.jsx(kd,{value:g,onSelect:(T,j)=>{x(T),r(T),j&&v(!1)}})})})})]})]})},Rd=({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=pd,fieldClassName:x,showTimezone:y=!1,showTimePicker:v=!0})=>{const b=o??hd[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?Xn({locale:g}):null,[y,g]),P=m.useMemo(()=>Td(g),[g]),O=m.useMemo(()=>Ed(g),[g]),R=m.useMemo(()=>Sd(j.getFullYear(),j.getMonth()),[j]),M=V=>{D(G=>new Date(G.getFullYear(),G.getMonth()+V,1))},H=(V,G)=>{if(Ks(V,h,p))return;const ee=e===xe.DateTime&&C?Ws(V,Mt(C)):V;r?.(ee),e===xe.Date&&G()},W=V=>{r?.(Ws(C??new Date,V))},K=()=>C?e===xe.DateTime?`${Vs(C,g)}, ${Mt(C)}`:Vs(C,g):b;if(e===xe.Time){const V=typeof t=="string"?t:C?Mt(C):"";return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",u,c.DIAL_KIT_CLASS.calendar),children:[T,s.jsx(Zs,{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(ee=>ee.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(Us,{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:ba})]}),panel:ee=>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),ee()},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(Us,{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()}),Id]}),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:Hs.prev,size:c.ElementSize.Small,onClick:()=>M(-1)}),s.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:Nd(j,g)}),s.jsx(c.StaticIconButton,{"aria-label":"Next month",icon:Hs.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 ee=G.getMonth()!==j.getMonth(),re=$s(G,C),q=$s(G,E),Y=Ks(G,h,p);return s.jsx("button",{type:"button",disabled:Y,"aria-label":wd(G,g),"aria-pressed":re,"aria-current":q?"date":void 0,className:f.mergeClasses(bd,ee&&Cd,q&&!re&&yd,re&&vd,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(Zs,{ariaLabel:"Time",value:C?Mt(C):"",onChange:W,onBlur:n,className:f.mergeClasses(!k&&"w-[120px]","px-3 py-1.5"),timezoneLabel:k,timezoneLabelClassName:"end-3 max-w-[60%]"})]})]})})]})},Md=3,Pd=({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:Kr,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>Md||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(Zt,D&&"min-w-0",E&&"shrink-[1000]",!D&&!E&&"shrink-0"),children:[s.jsxs("span",{className:f.mergeClasses(Lr,wn,"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(Zt,"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(Sn,n,c.DIAL_KIT_CLASS.folderPath),children:s.jsx("ol",{className:Nn,children:T})})};var Ze=(e=>(e.Small="small",e.Heading="heading",e))(Ze||{});const Bd="w-full overflow-hidden",zd="flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap",qs="flex min-w-0 items-center gap-2",Ys={[Ze.Small]:"dial-small-text",[Ze.Heading]:"dial-h2-text"},Fd={[Ze.Small]:"dial-small-semi-text",[Ze.Heading]:"dial-h2-text"},Hd={first:"shrink-0",middle:"min-w-0 max-w-[30%] shrink",last:"min-w-0 max-w-[51%] shrink"},$d="flex min-w-0 flex-1 items-center gap-1 rounded-xs transition-colors",Kd="text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",Vd="cursor-default text-primary",Wd="cursor-default text-secondary",Xs="inline-flex flex-none items-center leading-none text-secondary",Gd="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",Ud=3,Zd=4,qd=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),Yd=({items:e,maxVisibleItems:t=Zd,size:r=Ze.Small,separator:n=qd,ariaLabel:a="Breadcrumb",overflowAriaLabel:o="Show hidden path segments",className:i,itemClassName:l})=>{const d=Math.max(t,Ud),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($d,I?Kd:C?f.mergeClasses(Vd,Fd[r]):Wd,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(qs,Ys[r],Hd[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:Xs,"aria-hidden":"true",children:n})]},`segment-${v}`)};return s.jsx("nav",{"aria-label":a,className:f.mergeClasses(Bd,i,c.DIAL_KIT_CLASS.breadcrumbs),children:s.jsxs("ol",{className:zd,children:[x(e[0],{index:0,isFirst:!0,isCurrent:e.length===1}),u.length>0&&s.jsxs("li",{className:f.mergeClasses(qs,Ys[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:Gd,children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})}),s.jsx("span",{className:Xs,"aria-hidden":"true",children:n})]}),g.map((y,v)=>x(y,{index:e.length-g.length+v,isFirst:!1,isCurrent:v===g.length-1}))]})})},Xd=({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},Qd=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")}),Jd=({variant:e,appearance:t,items:r,dropdownProps:n,...a})=>{const[o,i]=m.useState(!1),l=m.useMemo(()=>Qd(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})})})},Ca=({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")})]})},eu=({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(Ca,{label:T,size:a,isOpen:I,disabled:o,"aria-label":h,className:p,labelClassName:g})})},tu={[be.VALID]:"Completed",[be.ERROR]:"Error"},ru=(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",su=(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",nu=({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]??tu[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",ru(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",su(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||{}),we=(e=>(e.Blue="blue",e.Green="green",e.Violet="violet",e.Indigo="indigo",e.Brown="brown",e.Red="red",e))(we||{});const au={[we.Blue]:"bg-blue text-blue",[we.Green]:"bg-green-2 text-green-1",[we.Violet]:"bg-violet-2 text-violet-1",[we.Indigo]:"bg-violet-1 text-violet-2",[we.Brown]:"bg-brown text-brown-2",[we.Red]:"bg-red text-red"},ou={[_e.Outlined]:"rounded-md border border-tertiary bg-layer-sunken text-secondary",[_e.Filled]:"rounded-full"},iu={[_e.Outlined]:"dial-tiny-text",[_e.Filled]:"dial-caption-lead-semi-text"},fs=({label:e,variant:t=_e.Outlined,color:r=we.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",ou[t],t===_e.Filled&&au[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??iu[t],children:e})]});var jt=(e=>(e.Default="default",e.Compact="compact",e))(jt||{});const lu={[jt.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[jt.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},cu=({title:e,value:t,description:r,variant:n=jt.Default,error:a,isLoading:o,className:i,delta:l,deltaPositive:d,deltaUnit:u,compareValues:h})=>{const p=lu[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(fs,{label:"Error",variant:_e.Filled,color:we.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})]})},ps=[{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"}],du=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),uu=(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},Vt=({value:e,maxValue:t=1,error:r,isLoading:n,title:a,valueLabel:o,colorMap:i=ps,className:l,titleClassName:d,valueClassName:u,inline:h,ariaLabel:p})=>{const g=e==null,x=!!(r||n||!g),y=du(g?0:e,t),v=uu(y,i),b=o??(g?"—":e),C=p??(typeof a=="string"?a:void 0),I=r||n,S=r?s.jsx(fs,{label:"Error",variant:_e.Filled,color:we.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 Qt=(e=>(e.Start="start",e.End="end",e))(Qt||{});const Ia=({title:e,description:t,children:r,expanded:n,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,ariaLabel:l,onToggle:d,caretPosition:u=Qt.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===Qt.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})})})})]})},fu=({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(Ia,{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(Vt,{title:o?.[0],value:E,maxValue:i,colorMap:l,inline:g,titleClassName:w,ariaLabel:D}),s.jsx(Vt,{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(Vt,{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)})})})},pu="#FF4E50",hu=(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},Qs=(e,t)=>{const r=t.map(()=>0);let n=0;e.forEach(d=>{if(d<=0){n+=1;return}const u=hu(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:pu,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]},Sa=e=>e<=0?2:e%2===0?e:e+1,mu=e=>{const t=Sa(e);return[t,t/2,0]},Ir=e=>`${Math.round(e*100)/100}`,Na=(e,t)=>e===t?Ir(e):`${Ir(e)}-${Ir(t)}`,Sr=128,gu=(e,t)=>{const r=Na(e,t);return e===t?`scored ${r}`:`scored between ${r}`},Js=(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:gu(a.from,a.to)})]}),xu=({title:e,values:t,colorMap:r=ps,valueTitle:n="values",showCount:a,isLoading:o,className:i,compareValues:l,valueSetLabel:d,compareValueSetLabel:u})=>{const h=Qs(t,r),p=l?Qs(l,r):void 0,g=t.length,x=l?.length??0,y=Math.max(g,x),v=Sa(y),b=mu(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:Sr},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:Sr},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:Sr},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,Js(d,N.count,g,n,N),T,!0),w(A,Js(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:Na(N.from,N.to)},L))})]})]})},bu=({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]})]})},vu="z-popup flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",yu="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",Cu="flex flex-row items-center justify-between px-6 py-4",Iu="flex-1 min-w-0 mr-3 truncate dial-h2-text text-primary",Su="border-b border-tertiary",Nu="flex flex-row items-center gap-2 px-6 py-4",wu="border-t border-tertiary",Nr="flex shrink-0 flex-row items-center gap-2",ju="ml-auto mobile:flex-1",Jt="mobile:flex-1",Du={[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]"},hs=({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(Iu,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)}),ee=(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=ee("additional",S,w?void 0:Jt);return s.jsxs("div",{className:f.mergeClasses(Nu,N&&wu,g),children:[w&&q.length>0&&s.jsx("div",{className:Nr,children:q}),s.jsxs("div",{className:f.mergeClasses(Nr,ju),children:[!w&&q,ee("main",I,Jt)]})]})};return s.jsx(B.FloatingPortal,{id:n,children:s.jsx(B.FloatingOverlay,{style:i,className:f.mergeClasses(vu,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(yu,Du[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(Cu,C&&Su,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:Nr,children:[b,G]}):G]}),s.jsx("div",{className:f.mergeClasses("grow overflow-auto",u),children:h}),re()]})})})})},Tu="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Eu="text-secondary dial-small-paragraph-text px-6 pb-4",Lu="px-6 py-4 h-[120px]",Au="Cancel",Ou="Ok",en={[it.Info]:{confirm:{variant:c.ButtonVariant.Primary,appearance:c.ButtonAppearance.Solid}},[it.Danger]:{confirm:{variant:c.ButtonVariant.Danger,appearance:c.ButtonAppearance.Solid}}},wa=({header:e,description:t,descriptionClassName:r,open:n=!1,confirmLabel:a=Ou,cancelLabel:o=Au,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:Tu,children:[s.jsx(os,{className:Jt,label:o,onClick:()=>g?g():h?.()}),s.jsx(Xe,{variant:en[y].confirm.variant,appearance:en[y].confirm.appearance,className:f.mergeClasses(Jt,u),label:a,disabled:l,onClick:p})]}),w=m.useCallback(()=>i?s.jsx("div",{className:Lu,children:s.jsx(Ve,{size:40})}):x??(t?s.jsx("div",{className:f.mergeClasses(Eu,r),children:t}):null),[x,t,i,r]);return s.jsx(hs,{...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()})},_u="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",ku="min-w-0 flex-1 truncate text-primary",Ru="min-w-0 flex-1 truncate text-secondary",Mu="shrink-0 text-secondary",Pu="px-6 pb-4",Bu="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",zu="Cancel",Fu="Apply",Hu=({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=Fu,cancelButtonLabel:y=zu,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]),ee=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(_u,I&&"dial-kit-input-error",C&&"dial-kit-input-disable",A),children:[s.jsx("span",{id:E,className:ve==null?Ru:ku,children:ve??l}),s.jsx(F.IconMaximize,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Mu})]}),s.jsx(c.ErrorText,{id:k,text:S}),!S&&s.jsx(c.CaptionText,{id:P,text:w})]}),s.jsx(hs,{open:O,header:n,ariaLabel:oe?void 0:Y,portalId:b,size:v,onClose:ee,footer:s.jsxs("div",{className:Bu,children:[s.jsx(os,{label:y,onClick:ee}),s.jsx(la,{label:x,disabled:!g,onClick:re})]}),children:s.jsx("div",{className:Pu,children:s.jsx(wt,{id:`${j}-options`,items:e,value:K,onChange:q,orientation:Oe.Column,ariaLabel:Y??oe})})})]})},$u=({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},Ku={default:"dial-tiny-text",selected:"dial-tiny-semi-text"},Vu={default:"cursor-not-allowed text-control-disable-primary",selected:"cursor-not-allowed bg-control-disable-primary text-control-disable-primary"},Wu=({label:e,icon:t,isSelected:r=!1,onToggle:n,onClick:a,disabled:o=!1,className:i,title:l,...d})=>{const u=m.useCallback(p=>{a?.(p),!p.defaultPrevented&&n?.(!r)},[a,n,r]),h=r?"selected":"default";return s.jsxs("button",{...d,type:"button","aria-pressed":r,disabled:o,title:l??(typeof e=="string"?e:void 0),onClick:u,className:f.mergeClasses(na,Ku[h],o?Vu[h]:[aa[Se.Selectable][h],oa,ia],i,c.DIAL_KIT_CLASS.toggleChip),children:[t&&s.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),s.jsx("span",{className:"truncate",children:e})]})},Gu=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Uu="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Zu="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",qu="bg-layer-raised text-accent shadow-xs",Yu="bg-transparent text-secondary",Xu="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Qu="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",Ju="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",ef="cursor-not-allowed bg-transparent text-control-disable-primary",tf=({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||!Gu.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(Uu,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(Zu,g?qu:Yu,x?g?Ju:ef:g?Xu:Qu,o,c.DIAL_KIT_CLASS.segmentedControlItem),children:[p.icon,p.label]},p.value)})})},rf={[ot.Error]:"Error",[ot.Warning]:"Warning"},sf={[Ge.Horizontal]:{next:"ArrowRight",previous:"ArrowLeft"},[Ge.Vertical]:{next:"ArrowDown",previous:"ArrowUp"}},nf=({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}=sf[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??rf[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},af="flex flex-nowrap items-center gap-1",of="min-w-max flex-1 justify-center",lf=({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(af,a,c.DIAL_KIT_CLASS.filterChips),children:e.map(d=>s.jsx(Le,{label:d.label,icon:d.icon,appearance:Se.Selectable,selected:d.value===t,onClick:()=>r(d.value),className:f.mergeClasses(n&&of,o)},d.value))}),Rr=(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})},cf=({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=>Rr(O,o)),P=E.filter(O=>!Rr(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})]})},ja=({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 df={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"]},uf=new Map(Object.entries(df).flatMap(([e,t])=>t.map(r=>[r,e]))),ff=e=>uf.get(e)??"other",tn="var(--text-control-permanent, #FCFCFC)",Pt={x1:"20.4167",y1:"-3.33333",x2:"2.5",y2:"20",from:"var(--bg-visual-blue, #D6EDF9)",to:"var(--stroke-gradient-1, #5976E9)"},pf="#1B212D",hf={[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:Pt},[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:pf}},[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:Pt},[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:Pt},[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:Pt}},mf=({size:e,kind:t})=>{const r=`dial-kit-file-gradient-${m.useId().replace(/[^\w-]/g,"")}`,{path:n,fillPath:a,sheet:o}=hf[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:tn,strokeWidth:"0.7",strokeLinecap:"round",strokeLinejoin:"round"}),a&&s.jsx("path",{d:a,fill:tn}),!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})]})})]})},gf=({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)"})]})})]})},xf=(e,t)=>(t??(e.includes(".")?e.split(".").pop():"")??"").trim().replace(/^\./,"").toLowerCase(),bf=(e,t)=>e===Ae.Folder?"Folder":t?`${t.toUpperCase()} file`:"File",vf=(e,t,r)=>e===Ae.Folder?s.jsx(gf,{size:r}):s.jsx(mf,{size:r,kind:ff(t)}),ms=({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?xf(t,r):"",x=bf(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}):vf(e,g,o),n&&s.jsx(ja,{tooltip:p,className:f.mergeClasses("absolute -bottom-0.5 -left-0.5",h)})]})},Da=({name:e,type:t=Ae.File,fileExtension:r,icon:n,shared:a=!1,loading:o=!1,loadingLabel:i,iconSize:l,details:d,isInvalidName:u=!1,className:h,nameClassName:p,sharedIndicatorClassName:g,sharedIndicatorTooltip:x,sharedLabel:y="Shared",hideTooltip:v=!1,tooltipContent:b})=>s.jsxs("div",{className:f.mergeClasses("flex w-full min-w-0 items-center gap-2",h,c.DIAL_KIT_CLASS.fileName),children:[n!=null&&!o?s.jsx("span",{"aria-hidden":!0,className:"flex shrink-0 items-center justify-center",children:n}):s.jsx(ms,{name:e,type:t,fileExtension:r,shared:a,loading:o,loadingLabel:i,size:l,sharedIndicatorClassName:g,sharedIndicatorTooltip:x,decorative:!o}),s.jsxs("div",{className:f.mergeClasses("flex min-w-0 flex-1",{"flex-col gap-1":!!d}),children:[s.jsx(c.EllipsisTooltip,{className:f.mergeClasses("dial-small-paragraph-text",u?"text-secondary":"text-primary",p),text:e,hideTooltip:v,customTooltipContent:b}),a&&s.jsx("span",{className:"sr-only",children:y}),d]})]}),yf=({className:e,...t})=>s.jsx(Da,{...t,type:Ae.Folder,className:f.mergeClasses(e,c.DIAL_KIT_CLASS.folderName)}),Cf=({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 Ta={[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"}},If=e=>{const t=Object.values(Ta);let r=0;for(let n=0;n<e.length;n++)r+=e.charCodeAt(n);return t[r%t.length]},rn=e=>e.match(new RegExp("\\p{L}","u"))?.[0]??"",Ea=e=>{const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length>=2?(rn(t[0])+rn(t[1])).toUpperCase()||"?":t[0].replace(/[^\p{L}]/gu,"").slice(0,2).toUpperCase()||"?"},Sf={[lt.Circle]:"rounded-full",[lt.Square]:"rounded-md"},La=({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",Sf[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??If(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??Ea(e)})})};var pe=(e=>(e.Model="model",e.Agent="agent",e.Toolset="toolset",e.Skill="skill",e.Prompt="prompt",e))(pe||{});const Nf={[pe.Model]:"Model",[pe.Agent]:"Agent",[pe.Toolset]:"Toolset",[pe.Skill]:"Skill",[pe.Prompt]:"Prompt"},sn={[pe.Model]:"text-blue",[pe.Agent]:"text-green-1",[pe.Toolset]:"text-brown-2",[pe.Skill]:"text-violet-1",[pe.Prompt]:"text-violet-2"},wf={[pe.Model]:"bg-blue",[pe.Agent]:"bg-green-2",[pe.Toolset]:"bg-brown",[pe.Skill]:"bg-violet-2",[pe.Prompt]:"bg-violet-1"},jf=["h1","h2","h3","h4","h5","h6"],Df=e=>jf[Math.min(6,Math.max(1,Math.round(e)))-1],Aa=({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=Df(i),C=a&&!!e.isFeatured,I=u!=null||C,S=n?e.version:void 0,w=r?t?.type??Nf[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(La,{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,sn[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",wf[e.type],sn[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]})]})},wr="bg-control-neutral-active",Tf=({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($t,{variant:Ee.Rectangular,width:e,height:e,className:wr})}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s.jsx($t,{variant:Ee.Text,width:"30%",height:12,className:wr}),s.jsx($t,{variant:Ee.Text,width:"60%",height:16,className:wr})]})]}),Ef=({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(Tf,{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(Aa,{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"})]})},Lf=({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})]})})})})},Af=4,Of=24,nn=e=>parseFloat(e)||0,_f=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},kf=()=>{},Rf=({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(sa({availableWidth:_.clientWidth-nn(U)-nn(de)-(h?0:Of),tagWidths:E.map((ne,ge)=>L.current[ge]?.offsetWidth??0),overflowChipWidth:A.current?.offsetWidth??0,gap:Af}))},[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),ee=_=>{const U=_f(_.trim()).trim();!U||E.includes(U)||W([...E,U])},re=_=>{W(E.filter(U=>U!==_))},q=()=>{ee(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?kf: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})},Mf=(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))},Pf=5,Bf=({id:e,value:t,defaultValue:r,suggestions:n,maxSuggestions:a=Pf,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,ee]=m.useState(0),re=!H.trim(),q=m.useMemo(()=>Mf(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=J=>`${T}-option-${J}`,{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:J,availableHeight:ce,elements:he}){he.floating.style.width=`${Math.round(J.reference.width)}px`,he.floating.style.maxHeight=`${Math.floor(ce)}px`}})]}),_=m.useCallback(J=>{E||P(J),N?.(J)},[E,N]),U=()=>{V(!1),ee(0)},de=()=>{!o||!M||(V(!0),ee(re?-1:0))},ne=J=>{const ce=J.trim();ce&&!O.includes(ce)&&_([...O,ce]),W(""),o?ee(-1):U()},ge=J=>_(O.filter(ce=>ce!==J)),Qe=J=>{const ce=J??"",he=!!ce.trim();W(ce),V(he||o),ee(he?0:-1)},ft=J=>{if(M)switch(J.key){case"ArrowDown":case"ArrowUp":{if(J.preventDefault(),!Y){V(!0),ee(0);return}const ce=J.key==="ArrowDown"?1:-1,he=se<0?Math.min(-ce,0):se;ee((he+ce+q.length)%q.length);return}case"Enter":case",":J.preventDefault(),ne(le?q[se].value:H);return;case"Escape":Y&&J.preventDefault(),U();return;case"Backspace":!H&&R&&(J.preventDefault(),_(O.slice(0,-1)));return}},pt=J=>J.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(J=>s.jsx(Le,{role:"listitem",label:J,className:f.mergeClasses(Xt,"min-w-0",S),disabled:g,closable:M,removeLabel:b?.(J),onRemove:M?()=>ge(J):void 0},J))})}),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((J,ce)=>{const he=ce===se;return s.jsx(c.MenuItem,{id:oe(ce),role:"option","aria-selected":he,tabIndex:-1,label:J.label,description:J.description,mark:c.MenuItemMark.Tint,selected:he,onMouseDown:pt,onMouseEnter:()=>ee(ce),onClick:()=>ne(J.value)},J.value)})})})]})},zf=(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)},Oa=e=>(e.toString().split(".")[1]??"").length,Ff=(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(Oa(n)))},Hf=12,an=e=>`calc(${e}% + ${(.5-e/100)*Hf}px)`,$f=(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)]",Kf=({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=an(P),R=p&&!o?zf(k,a):[],M=h&&!o,H=g!=null,W=y||x!=null,K=Oa(a),[V,G]=m.useState(null),ee=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?.(Ff(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:ee})]}),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",$f(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:an(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:ee}),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?ee: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(ds,{"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})]})]})},Vf=48,Wf=({children:e,title:t,width:r=280,collapsedWidth:n=Vf,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)},on={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},ln={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Bt={width:"20px",height:"20px",position:"absolute",zIndex:1},Gf={top:ie(ie({},on),{top:"-5px"}),right:ie(ie({},ln),{left:void 0,right:"-5px"}),bottom:ie(ie({},on),{top:void 0,bottom:"-5px"}),left:ie(ie({},ln),{left:"-5px"}),topRight:ie(ie({},Bt),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:ie(ie({},Bt),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:ie(ie({},Bt),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:ie(ie({},Bt),{left:"-10px",top:"-10px",cursor:"nw-resize"})},Uf=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"},Gf[r]),a??{})},[a,r]);return s.jsx("div",{className:o||void 0,style:d,onMouseDown:i,onTouchStart:l,children:n})}),Zf=(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)},qf={width:"auto",height:"auto"},zt=function(e,t,r){return Math.max(Math.min(e,r),t)},cn=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)},Ft=function(e){return!!(e.touches&&e.touches.length)},Yf=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},dn=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},jr=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")},Ht=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},Xf=function(e,t,r,n,a,o,i){return n=Ht(n,e.width,t,r),a=Ht(a,e.height,t,r),o=Ht(o,e.width,t,r),i=Ht(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)}},Qf=function(e){return Array.isArray(e)?e:[e,e]},Jf=["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"],un="__resizable_base__",ep=(function(e){Zf(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(un):u.className+=un,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||qf},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 jr(r.state[l])},o=n&&typeof n.width<"u"&&!this.state.isResizing?jr(n.width):a("width"),i=n&&typeof n.height<"u"&&!this.state.isResizing?jr(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=Qf(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=zt(r,w,N),n=zt(n,L,A)}else r=zt(r,h,p),n=zt(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&&Yf(r.nativeEvent)?(a=r.nativeEvent.clientX,o=r.nativeEvent.clientY):r.nativeEvent&&Ft(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&&Ft(r))try{r.preventDefault(),r.stopPropagation()}catch{}var a=this.props,o=a.maxWidth,i=a.maxHeight,l=a.minWidth,d=a.minHeight,u=Ft(r)?r.touches[0].clientX:r.clientX,h=Ft(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=Xf(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=dn(w,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(S=dn(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=cn(w,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),T=cn(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&&Wa.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(Uf,{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 Jf.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 tp=({side:e,isResizing:t,width:r,minWidth:n,maxWidth:a,step:o,ariaLabel:i,onWidthChange:l,customHandler:d,handlerClassName:u})=>{const h=e===It.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")})})},rp=16,_a=({children:e,minWidth:t,maxWidth:r,width:n,defaultWidth:a,onResizeStop:o,onResize:i,side:l=It.Right,keyboardStep:d=rp,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===It.Left,j=s.jsx(tp,{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(ep,{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})})},sp=16,np=1e3,ap=4,Dr=e=>e==null?!1:(e.closest("[dir]")?.getAttribute("dir")??e.ownerDocument.defaultView?.getComputedStyle(e).direction)==="rtl",op=({width:e,minWidth:t,maxWidth:r,defaultWidth:n,onWidthChange:a,label:o,tooltip:i,keyboardStep:l=sp,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),np)},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)>ap&&(g(!1),A(R));return}const H=Dr(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=Dr(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:Dr(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})})})})},ip=({enabled:e=!0,children:t,...r})=>e?s.jsx(_a,{...r,children:t}):t,lp=({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 cp={[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"}},dp=({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=cp[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 je=(e=>(e.InProgress="inProgress",e.Success="success",e.Warning="warning",e.Failed="failed",e.Canceled="canceled",e))(je||{});const ka=8e3,Dt="flex size-7 shrink-0 items-center justify-center",Ra={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"},up=({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:Dt}),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:Dt})]})]})},fn=({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:Dt,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})})})},Mr=2,Pr=(f.DIAL_ICON_SIZE.SM-Mr)/2,pn=2*Math.PI*Pr,fp=({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:Pr,fill:"none",strokeWidth:Mr,className:"stroke-(--stroke-secondary,#d1dbea)"}),s.jsx("circle",{cx:a,cy:a,r:Pr,fill:"none",strokeWidth:Mr,strokeLinecap:"round",strokeDasharray:pn,strokeDashoffset:pn*(1-n/100),className:"stroke-(--stroke-accent,#1d4ed8) transition-[stroke-dashoffset] duration-200 motion-reduce:transition-none"})]})})},pp=({item:e,labels:t,onCancel:r})=>{const n=e.status===je.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(ms,{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===je.InProgress&&s.jsxs("div",{className:f.mergeClasses(Dt,"grid"),children:[typeof e.percent=="number"?s.jsx(fp,{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===je.Success&&s.jsx("span",{className:Dt,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===je.Warning&&s.jsx(fn,{message:e.message||t.warningMessage,isError:!1}),e.status===je.Failed&&s.jsx(fn,{message:e.message||t.failedMessage,isError:!0}),n&&s.jsx("span",{className:"dial-small-text shrink-0 text-secondary",children:t.canceledLabel})]})},hp=e=>Math.round(e.reduce((t,r)=>t+(r.percent??(r.status===je.InProgress?0:100)),0)/e.length),mp=(e,t)=>e?t.closeConfirmDescriptionMixed:t.closeConfirmDescriptionInProgress,gp=({title:e,items:t,onClose:r,onCancelItem:n,labels:a,autoCloseDelay:o=ka,className:i,bodyClassName:l})=>{const[d,u]=m.useState(!1),[h,p]=m.useState(!1),g=m.useId(),x={...Ra,...a},y=t.filter(N=>N.status===je.InProgress).length,v=y>0,b=t.some(N=>N.status===je.Failed),C=t.length>0&&t.every(N=>N.status===je.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(up,{title:e,isCollapsed:d,itemsId:g,labels:x,onToggleCollapse:w,onClose:I}),d&&v&&s.jsx(bn,{value:hp(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(pp,{item:N,labels:x,onCancel:n},N.id))}),s.jsx(wa,{open:h,header:x.closeConfirmHeader,description:mp(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.DropdownOverlayRole=c.DropdownOverlayRole;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.LiveRegion=c.LiveRegion;exports.LiveRegionElement=c.LiveRegionElement;exports.LiveRegionPoliteness=c.LiveRegionPoliteness;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=hn.EditorThemes;exports.LazyMarkdownEditor=hn.LazyMarkdownEditor;exports.AVATAR_PALETTE=Ta;exports.Accordion=Ia;exports.AccordionCaretPosition=Qt;exports.AnalyticsBar=Vt;exports.AnalyticsBarGroup=fu;exports.AnalyticsCard=cu;exports.AnalyticsCardVariant=jt;exports.AnalyticsHistogram=xu;exports.AutocompleteTagInput=Bf;exports.Avatar=La;exports.AvatarColor=Pe;exports.AvatarShape=lt;exports.Badge=fs;exports.BadgeColor=we;exports.BadgeVariant=_e;exports.BottomSheet=Cf;exports.Breadcrumbs=Yd;exports.BreadcrumbsSize=Ze;exports.Button=Xe;exports.ButtonDropdown=Jd;exports.Calendar=Rd;exports.CalendarMode=xe;exports.CardShell=ed;exports.CollapsibleSidebar=Wf;exports.ConditionalResizableContainer=ip;exports.ConfirmationPopup=wa;exports.ConfirmationPopupVariant=it;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=ps;exports.DEFAULT_TRANSFER_QUEUE_LABELS=Ra;exports.DangerButton=Dc;exports.DialAccordion=Qa;exports.DialBreadcrumb=Do;exports.DialBreadcrumbItem=xt;exports.DialButton=Et;exports.DialCaptionText=Br;exports.DialCloseButton=In;exports.DialDangerButton=En;exports.DialDangerIconButton=yn;exports.DialDropdown=Gt;exports.DialEllipsisTooltip=er;exports.DialErrorText=Fe;exports.DialFileNodeType=ze;exports.DialFilePermission=Yn;exports.DialFileResourceType=es;exports.DialGhostButton=Eo;exports.DialGhostIconButton=Cn;exports.DialIconButton=Tt;exports.DialInput=An;exports.DialItemType=Ae;exports.DialLabel=$r;exports.DialLabelledText=ao;exports.DialLinkButton=To;exports.DialLoadFileArea=Zn;exports.DialLoadFileAreaField=Vl;exports.DialLoader=ro;exports.DialNeutralButton=Tn;exports.DialNeutralIconButton=go;exports.DialNoDataContent=no;exports.DialPrimaryButton=Wr;exports.DialPrimaryIconButton=mo;exports.DialRemoveButton=Ln;exports.DialSecondaryIconButton=xo;exports.DialSuccessIconButton=vo;exports.DialTabs=No;exports.DialTag=io;exports.DialTertiaryIconButton=bo;exports.DialTooltip=qe;exports.DialTooltipContainer=zr;exports.DialTooltipContent=Fr;exports.DialTooltipTrigger=Hr;exports.EDITABLE_CONTAINER_ATTRIBUTE=Jr;exports.EntityIdentity=Aa;exports.EntityType=pe;exports.ErrorMessageNotification=id;exports.ErrorToastNotification=td;exports.FabButton=Xd;exports.FileDropzone=cf;exports.FileIcon=ms;exports.FileName=Da;exports.FilterChips=lf;exports.FlexibleActionsDirection=qn;exports.FolderName=yf;exports.FolderPath=Pd;exports.FormSection=dp;exports.FormSectionVariant=at;exports.GeneralMessageNotification=fd;exports.GeneralToastNotification=od;exports.GhostButton=is;exports.InfoMessageNotification=ld;exports.InfoToastNotification=rd;exports.InlineSelect=eu;exports.InlineSelectTrigger=Ca;exports.JsonSchemaType=$;exports.LabelledText=bu;exports.LinkButton=Lc;exports.LoadingMessageNotification=ud;exports.LoadingToastNotification=ad;exports.MultiSelectTags=yt;exports.NOT_ALLOWED_SPACES=ts;exports.NOT_ALLOWED_SPACES_REGEXP=tc;exports.NOT_ALLOWED_SYMBOLS=Qn;exports.NOT_ALLOWED_SYMBOLS_REGEXP=ec;exports.NeutralButton=os;exports.Notification=us;exports.NotificationSurface=qt;exports.NotificationType=fe;exports.NotificationVariant=X;exports.NumberInput=ds;exports.OutlinedButton=Ac;exports.PasswordInput=da;exports.Popup=hs;exports.PopupSize=We;exports.PrimaryButton=la;exports.ProgressBar=bn;exports.ProgressBarRole=Ct;exports.RadioGroup=wt;exports.RadioGroupOrientation=Oe;exports.RadioGroupPopupField=Hu;exports.ResizableContainer=_a;exports.ResizableContainerSide=It;exports.ResizeHandle=op;exports.SchemaDisplayMode=lr;exports.SchemaOrientation=cr;exports.SchemaRenderer=Uc;exports.SchemaRendererVariant=nt;exports.ScreenResolution=Ut;exports.SegmentedControl=tf;exports.Select=$e;exports.SelectedEntityCard=Ef;exports.SharedEntityIndicator=ja;exports.SideDrawer=Lf;exports.Skeleton=$t;exports.SkeletonAvatarShape=Wt;exports.SkeletonAvatarSize=bt;exports.SkeletonVariant=Ee;exports.Slider=Kf;exports.Spinner=Ve;exports.StarterButton=Ec;exports.StateScreen=lp;exports.StepStatus=be;exports.Steps=nu;exports.SuccessMessageNotification=cd;exports.SuccessToastNotification=sd;exports.Switch=ua;exports.TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS=ka;exports.TabOrientation=Ge;exports.TabStatus=ot;exports.TabView=Ue;exports.Tabs=nf;exports.Tag=Le;exports.TagAppearance=Se;exports.TagInput=Rf;exports.Textarea=ca;exports.TextareaResize=ls;exports.ToggleChip=Wu;exports.ToggleIconButton=$u;exports.TransferQueue=gp;exports.TransferQueueItemStatus=je;exports.WarningMessageNotification=dd;exports.WarningToastNotification=nd;exports.editableContainerProps=Wl;exports.extractInitials=Ea;exports.getTimezoneLabel=Xn;exports.matchesAccept=Rr;exports.useEditableItem=Gl;exports.wrapInRootFolder=Ql;